@mapxus/mapxus-visual-jp 1.8.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bitbucket-pipelines.yml +50 -0
- package/config/rollup.js +33 -0
- package/config/rollup.serve.config.js +3 -0
- package/debug/circlemarker.html +444 -0
- package/debug/create_tags.html +474 -0
- package/debug/distance.html +220 -0
- package/debug/index.html +92 -0
- package/debug/integration.html +1084 -0
- package/debug/leaflet.html +54 -0
- package/debug/markers.html +115 -0
- package/debug/multi_monitor_sync.html +377 -0
- package/debug/outdoor.html +1026 -0
- package/debug/rect_tags.html +147 -0
- package/debug/rotate.html +236 -0
- package/debug/sample.html +324 -0
- package/debug/sequence.html +75 -0
- package/debug/tags.html +218 -0
- package/package.json +34 -10
- package/rollup.config.js +39 -0
- package/server.js +35 -0
- package/spec/api/APIv3.spec.ts +86 -0
- package/spec/component/Component.spec.ts +68 -0
- package/spec/component/StatsComponent.spec.ts +33 -0
- package/spec/component/direction/DirectionComponent.spec.ts +163 -0
- package/spec/component/direction/DirectionDOMRenderer.spec.ts +233 -0
- package/spec/component/keyboard/KeyZoomHandler.spec.ts +236 -0
- package/spec/component/marker/Marker.spec.ts +104 -0
- package/spec/component/marker/MarkerComponent.spec.ts +88 -0
- package/spec/component/marker/MarkerScene.spec.ts +223 -0
- package/spec/component/marker/MarkerSet.spec.ts +453 -0
- package/spec/component/mouse/DoubleClickZoomHandler.spec.ts +211 -0
- package/spec/component/popup/Popup.spec.ts +479 -0
- package/spec/component/popup/PopupComponent.spec.ts +414 -0
- package/spec/component/tag/CreateHandlerBase.spec.ts +83 -0
- package/spec/component/tag/CreatePointHandler.spec.ts +190 -0
- package/spec/component/tag/OutlineRenderTag.spec.ts +91 -0
- package/spec/component/tag/PointGeometry.spec.ts +131 -0
- package/spec/component/tag/PolygonGeometry.spec.ts +497 -0
- package/spec/component/tag/RectGeometry.spec.ts +1157 -0
- package/spec/component/tag/TagComponent.spec.ts +513 -0
- package/spec/component/tag/TagScene.spec.ts +346 -0
- package/spec/component/tag/TagSet.spec.ts +241 -0
- package/spec/component/utils/HandlerBase.spec.ts +203 -0
- package/spec/geo/Camera.spec.ts +250 -0
- package/spec/geo/GeoCoords.spec.ts +364 -0
- package/spec/geo/Spatial.spec.ts +711 -0
- package/spec/geo/Transform.spec.ts +850 -0
- package/spec/geo/ViewportCoords.spec.ts +534 -0
- package/spec/graph/FilterCreator.spec.ts +892 -0
- package/spec/graph/Graph.spec.ts +2078 -0
- package/spec/graph/GraphCalculator.spec.ts +263 -0
- package/spec/graph/GraphService.spec.ts +663 -0
- package/spec/graph/Node.spec.ts +373 -0
- package/spec/graph/NodeCache.spec.ts +206 -0
- package/spec/graph/Sequence.spec.ts +37 -0
- package/spec/graph/edge/EdgeCalculator.Pano.spec.ts +963 -0
- package/spec/graph/edge/EdgeCalculator.Sequence.spec.ts +108 -0
- package/spec/graph/edge/EdgeCalculator.Similar.spec.ts +272 -0
- package/spec/graph/edge/EdgeCalculator.Step.spec.ts +383 -0
- package/spec/graph/edge/EdgeCalculator.Turn.spec.ts +278 -0
- package/spec/graph/edge/EdgeCalculator.spec.ts +747 -0
- package/spec/helper/ContainerMockCreator.spec.ts +33 -0
- package/spec/helper/DOMRendererMockCreator.spec.ts +22 -0
- package/spec/helper/EdgeCalculatorHelper.spec.ts +96 -0
- package/spec/helper/EventHelper.spec.ts +92 -0
- package/spec/helper/GLRendererMockCreator.spec.ts +23 -0
- package/spec/helper/GeoHelper.spec.ts +16 -0
- package/spec/helper/ImageLoadingServiceMockCreator.spec.ts +24 -0
- package/spec/helper/KeyboardServiceMockCreator.spec.ts +21 -0
- package/spec/helper/LoadingServiceMockCreator.spec.ts +21 -0
- package/spec/helper/MockCreator.spec.ts +18 -0
- package/spec/helper/MockCreatorBase.spec.ts +17 -0
- package/spec/helper/MouseServiceMockCreator.spec.ts +38 -0
- package/spec/helper/NavigatorMockCreator.spec.ts +28 -0
- package/spec/helper/NodeHelper.spec.ts +77 -0
- package/spec/helper/NodeMockCreator.spec.ts +19 -0
- package/spec/helper/RenderServiceMockCreator.spec.ts +25 -0
- package/spec/helper/SpriteServiceMockCreator.spec.ts +22 -0
- package/spec/helper/StateServiceMockCreator.spec.ts +33 -0
- package/spec/helper/TouchServiceMockCreator.spec.ts +29 -0
- package/spec/helper/TransformHelper.spec.ts +17 -0
- package/spec/render/DOMRenderer.spec.ts +112 -0
- package/spec/render/GLRenderer.spec.ts +453 -0
- package/spec/render/RenderCamera.spec.ts +535 -0
- package/spec/render/RenderService.spec.ts +531 -0
- package/spec/state/StateBase.spec.ts +369 -0
- package/spec/state/StateService.spec.ts +9 -0
- package/spec/state/TraversingState.spec.ts +262 -0
- package/spec/state/WaitingState.spec.ts +319 -0
- package/spec/tiles/TextureProvider.spec.ts +653 -0
- package/spec/utils/EventEmitter.spec.ts +71 -0
- package/spec/utils/Support.spec.ts +54 -0
- package/spec/viewer/CacheService.spec.ts +160 -0
- package/spec/viewer/ComponentController.spec.ts +310 -0
- package/spec/viewer/LoadingService.spec.ts +19 -0
- package/spec/viewer/MouseService.spec.ts +1344 -0
- package/spec/viewer/Navigator.spec.ts +970 -0
- package/spec/viewer/Observer.spec.ts +96 -0
- package/spec/viewer/SpriteService.spec.ts +224 -0
- package/src/API.ts +3 -0
- package/src/Component.ts +77 -0
- package/src/Edge.ts +6 -0
- package/src/Error.ts +3 -0
- package/src/FilterRender.ts +27 -0
- package/src/Geo.ts +7 -0
- package/src/Graph.ts +19 -0
- package/src/MapxusVisual.ts +66 -0
- package/src/Render.ts +7 -0
- package/src/State.ts +8 -0
- package/src/Support.ts +35 -0
- package/src/Tiles.ts +5 -0
- package/src/Utils.ts +6 -0
- package/src/Viewer.ts +16 -0
- package/src/api/API.ts +396 -0
- package/src/api/Auth.ts +76 -0
- package/src/api/AuthStore.ts +11 -0
- package/src/api/GraphQLCreator.ts +100 -0
- package/src/api/interfaces/IAuth.ts +7 -0
- package/src/api/interfaces/IBuildingBase.ts +7 -0
- package/src/api/interfaces/IBuildingInfo.ts +19 -0
- package/src/api/interfaces/ICoreNode.ts +28 -0
- package/src/api/interfaces/IFillNode.ts +96 -0
- package/src/api/interfaces/IFloorInfo.ts +10 -0
- package/src/api/interfaces/IFullNode.ts +10 -0
- package/src/api/interfaces/IGPano.ts +38 -0
- package/src/api/interfaces/IImageTagInfo.ts +14 -0
- package/src/api/interfaces/IKey.ts +13 -0
- package/src/api/interfaces/ILatLon.ts +19 -0
- package/src/api/interfaces/IOutdoor.ts +14 -0
- package/src/api/interfaces/IPathNode.ts +37 -0
- package/src/api/interfaces/IProject.ts +8 -0
- package/src/api/interfaces/IQueryBuilding.ts +37 -0
- package/src/api/interfaces/IResponse.ts +7 -0
- package/src/api/interfaces/ISequence.ts +16 -0
- package/src/api/interfaces/IUser.ts +13 -0
- package/src/api/interfaces/interfaces.ts +17 -0
- package/src/component/AttributionComponent.ts +48 -0
- package/src/component/BackgroundComponent.ts +39 -0
- package/src/component/BearingComponent.ts +282 -0
- package/src/component/CacheComponent.ts +295 -0
- package/src/component/Component.ts +130 -0
- package/src/component/ComponentService.ts +150 -0
- package/src/component/CoverComponent.ts +132 -0
- package/src/component/DebugComponent.ts +157 -0
- package/src/component/ImageComponent.ts +96 -0
- package/src/component/LoadingComponent.ts +85 -0
- package/src/component/NavigationComponent.ts +233 -0
- package/src/component/RouteComponent.ts +354 -0
- package/src/component/StatsComponent.ts +100 -0
- package/src/component/direction/DirectionComponent.ts +254 -0
- package/src/component/direction/DirectionDOMCalculator.ts +243 -0
- package/src/component/direction/DirectionDOMRenderer.ts +631 -0
- package/src/component/imageplane/ImagePlaneComponent.ts +497 -0
- package/src/component/imageplane/ImagePlaneFactory.ts +314 -0
- package/src/component/imageplane/ImagePlaneGLRenderer.ts +247 -0
- package/src/component/imageplane/ImagePlaneScene.ts +87 -0
- package/src/component/imageplane/ImagePlaneShaders.ts +16 -0
- package/src/component/imageplane/SliderComponent.ts +697 -0
- package/src/component/imageplane/interfaces/IBBoxShaderMaterial.ts +10 -0
- package/src/component/imageplane/interfaces/IShaderMaterial.ts +9 -0
- package/src/component/imageplane/interfaces/interfaces.ts +2 -0
- package/src/component/imageplane/shaders/equirectangular.fragment.glsl.ts +26 -0
- package/src/component/imageplane/shaders/equirectangular.vertex.glsl.ts +15 -0
- package/src/component/imageplane/shaders/perspective.fragment.glsl.ts +27 -0
- package/src/component/imageplane/shaders/perspective.vertex.glsl.ts +15 -0
- package/src/component/interfaces/ICacheConfiguration.ts +72 -0
- package/src/component/interfaces/IComponentConfiguration.ts +5 -0
- package/src/component/interfaces/ICoverConfiguration.ts +15 -0
- package/src/component/interfaces/IDirectionConfiguration.ts +63 -0
- package/src/component/interfaces/IImagePlaneConfiguration.ts +17 -0
- package/src/component/interfaces/IKeyboardConfiguration.ts +44 -0
- package/src/component/interfaces/IMarkerConfiguration.ts +31 -0
- package/src/component/interfaces/IMouseConfiguration.ts +52 -0
- package/src/component/interfaces/INavigationConfiguration.ts +35 -0
- package/src/component/interfaces/IRouteConfiguration.ts +20 -0
- package/src/component/interfaces/ISequenceConfiguration.ts +72 -0
- package/src/component/interfaces/IShader.ts +6 -0
- package/src/component/interfaces/ISliderConfiguration.ts +61 -0
- package/src/component/interfaces/ITagConfiguration.ts +40 -0
- package/src/component/interfaces/interfaces.ts +17 -0
- package/src/component/keyboard/KeySequenceNavigationHandler.ts +86 -0
- package/src/component/keyboard/KeySpatialNavigationHandler.ts +216 -0
- package/src/component/keyboard/KeyZoomHandler.ts +106 -0
- package/src/component/keyboard/KeyboardComponent.ts +125 -0
- package/src/component/marker/Marker.ts +5 -0
- package/src/component/marker/MarkerComponent.ts +856 -0
- package/src/component/marker/MarkerScene.ts +145 -0
- package/src/component/marker/MarkerSet.ts +142 -0
- package/src/component/marker/interfaces/IArrowMarkerOptions.ts +41 -0
- package/src/component/marker/interfaces/ICircleMarkerOptions.ts +30 -0
- package/src/component/marker/interfaces/IDotMarkerOptions.ts +18 -0
- package/src/component/marker/interfaces/IMarkerEvent.ts +28 -0
- package/src/component/marker/interfaces/ISimpleMarkerOptions.ts +54 -0
- package/src/component/marker/interfaces/interfaces.ts +5 -0
- package/src/component/marker/marker/ArrowMarker.ts +84 -0
- package/src/component/marker/marker/CircleMarker.ts +82 -0
- package/src/component/marker/marker/DotMarker.ts +68 -0
- package/src/component/marker/marker/ImageMarker.ts +45 -0
- package/src/component/marker/marker/Marker.ts +99 -0
- package/src/component/marker/marker/SimpleMarker.ts +187 -0
- package/src/component/mouse/BounceHandler.ts +148 -0
- package/src/component/mouse/DoubleClickZoomHandler.ts +106 -0
- package/src/component/mouse/DragPanHandler.ts +489 -0
- package/src/component/mouse/HandlerTypes.ts +13 -0
- package/src/component/mouse/MouseComponent.ts +170 -0
- package/src/component/mouse/ScrollZoomHandler.ts +137 -0
- package/src/component/mouse/TouchZoomHandler.ts +136 -0
- package/src/component/path/PathComponent.ts +75 -0
- package/src/component/path/PathEvent.ts +245 -0
- package/src/component/path/PathMarker.ts +42 -0
- package/src/component/path/PathRender.ts +163 -0
- package/src/component/popup/Popup.ts +2 -0
- package/src/component/popup/PopupComponent.ts +244 -0
- package/src/component/popup/interfaces/IPopupOffset.ts +37 -0
- package/src/component/popup/interfaces/IPopupOptions.ts +81 -0
- package/src/component/popup/popup/Popup.ts +594 -0
- package/src/component/popup/popup/PopupAlignment.ts +3 -0
- package/src/component/sequence/SequenceComponent.ts +500 -0
- package/src/component/sequence/SequenceDOMInteraction.ts +23 -0
- package/src/component/sequence/SequenceDOMRenderer.ts +179 -0
- package/src/component/tag/Tag.ts +9 -0
- package/src/component/tag/TagComponent.ts +787 -0
- package/src/component/tag/TagCreator.ts +138 -0
- package/src/component/tag/TagDOMRenderer.ts +35 -0
- package/src/component/tag/TagMode.ts +37 -0
- package/src/component/tag/TagOperation.ts +7 -0
- package/src/component/tag/TagScene.ts +216 -0
- package/src/component/tag/TagSet.ts +186 -0
- package/src/component/tag/error/GeometryTagError.ts +11 -0
- package/src/component/tag/geometry/Geometry.ts +62 -0
- package/src/component/tag/geometry/PointGeometry.ts +89 -0
- package/src/component/tag/geometry/PolygonGeometry.ts +349 -0
- package/src/component/tag/geometry/RectGeometry.ts +759 -0
- package/src/component/tag/geometry/VertexGeometry.ts +185 -0
- package/src/component/tag/handlers/CreateHandlerBase.ts +81 -0
- package/src/component/tag/handlers/CreatePointHandler.ts +35 -0
- package/src/component/tag/handlers/CreatePolygonHandler.ts +33 -0
- package/src/component/tag/handlers/CreateRectDragHandler.ts +199 -0
- package/src/component/tag/handlers/CreateRectHandler.ts +57 -0
- package/src/component/tag/handlers/CreateVertexHandler.ts +165 -0
- package/src/component/tag/handlers/EditVertexHandler.ts +275 -0
- package/src/component/tag/handlers/TagHandlerBase.ts +57 -0
- package/src/component/tag/interfaces/IInteraction.ts +14 -0
- package/src/component/tag/interfaces/IOutlineCreateTagOptions.ts +15 -0
- package/src/component/tag/interfaces/IOutlineTagOptions.ts +89 -0
- package/src/component/tag/interfaces/ISpotTagOptions.ts +37 -0
- package/src/component/tag/interfaces/interfaces.ts +4 -0
- package/src/component/tag/tag/OutlineCreateTag.ts +330 -0
- package/src/component/tag/tag/OutlineRenderTag.ts +569 -0
- package/src/component/tag/tag/OutlineTag.ts +380 -0
- package/src/component/tag/tag/RenderTag.ts +50 -0
- package/src/component/tag/tag/SpotRenderTag.ts +160 -0
- package/src/component/tag/tag/SpotTag.ts +170 -0
- package/src/component/tag/tag/Tag.ts +103 -0
- package/src/component/utils/HandlerBase.ts +71 -0
- package/src/error/ArgumentBeeviewError.ts +11 -0
- package/src/error/BeeviewError.ts +9 -0
- package/src/error/GraphBeeviewError.ts +11 -0
- package/src/geo/Camera.ts +149 -0
- package/src/geo/GeoCoords.ts +280 -0
- package/src/geo/GeoRBush.ts +25 -0
- package/src/geo/Spatial.ts +259 -0
- package/src/geo/Transform.ts +543 -0
- package/src/geo/ViewportCoords.ts +518 -0
- package/src/geo/interfaces/ILatLonAlt.ts +7 -0
- package/src/geo/interfaces/interfaces.ts +1 -0
- package/src/graph/FilterCreator.ts +106 -0
- package/src/graph/FilterExpression.ts +16 -0
- package/src/graph/Graph.ts +1516 -0
- package/src/graph/GraphCalculator.ts +197 -0
- package/src/graph/GraphService.ts +516 -0
- package/src/graph/ImageLoadingService.ts +44 -0
- package/src/graph/MeshReader.ts +19 -0
- package/src/graph/Node.ts +622 -0
- package/src/graph/NodeCache.ts +548 -0
- package/src/graph/Sequence.ts +117 -0
- package/src/graph/edge/EdgeCalculator.ts +919 -0
- package/src/graph/edge/EdgeCalculatorCoefficients.ts +43 -0
- package/src/graph/edge/EdgeCalculatorDirections.ts +80 -0
- package/src/graph/edge/EdgeCalculatorSettings.ts +61 -0
- package/src/graph/edge/EdgeDirection.ts +63 -0
- package/src/graph/edge/interfaces/IEdge.ts +26 -0
- package/src/graph/edge/interfaces/IEdgeData.ts +22 -0
- package/src/graph/edge/interfaces/IPano.ts +8 -0
- package/src/graph/edge/interfaces/IPotentialEdge.ts +106 -0
- package/src/graph/edge/interfaces/IStep.ts +7 -0
- package/src/graph/edge/interfaces/ITurn.ts +7 -0
- package/src/graph/edge/interfaces/interfaces.ts +6 -0
- package/src/graph/interfaces/IEdgeStatus.ts +25 -0
- package/src/graph/interfaces/IGraphConfiguration.ts +26 -0
- package/src/graph/interfaces/ILoadStatus.ts +18 -0
- package/src/graph/interfaces/ILoadStatusObject.ts +8 -0
- package/src/graph/interfaces/IMesh.ts +20 -0
- package/src/graph/interfaces/interfaces.ts +5 -0
- package/src/render/DOMRenderer.ts +288 -0
- package/src/render/GLRenderStage.ts +6 -0
- package/src/render/GLRenderer.ts +436 -0
- package/src/render/RenderCamera.ts +212 -0
- package/src/render/RenderMode.ts +34 -0
- package/src/render/RenderService.ts +264 -0
- package/src/render/interfaces/IGLRender.ts +10 -0
- package/src/render/interfaces/IGLRenderFunction.ts +10 -0
- package/src/render/interfaces/IGLRenderHash.ts +8 -0
- package/src/render/interfaces/ISize.ts +6 -0
- package/src/render/interfaces/IVNodeHash.ts +8 -0
- package/src/render/interfaces/interfaces.ts +5 -0
- package/src/state/FrameGenerator.ts +36 -0
- package/src/state/State.ts +6 -0
- package/src/state/StateContext.ts +180 -0
- package/src/state/StateService.ts +600 -0
- package/src/state/StateTransitionMatrix.ts +58 -0
- package/src/state/interfaces/ICurrentState.ts +21 -0
- package/src/state/interfaces/IFrame.ts +9 -0
- package/src/state/interfaces/IRotation.ts +6 -0
- package/src/state/interfaces/IState.ts +11 -0
- package/src/state/interfaces/IStateContext.ts +31 -0
- package/src/state/interfaces/interfaces.ts +5 -0
- package/src/state/states/StateBase.ts +425 -0
- package/src/state/states/TraversingState.ts +861 -0
- package/src/state/states/WaitingState.ts +109 -0
- package/src/tiles/ImageTileLoader.ts +121 -0
- package/src/tiles/ImageTileStore.ts +70 -0
- package/src/tiles/RegionOfInterestCalculator.ts +158 -0
- package/src/tiles/TextureProvider.ts +609 -0
- package/src/tiles/interfaces/IBoundingBox.ts +28 -0
- package/src/tiles/interfaces/IRegionOfInterest.ts +25 -0
- package/src/tiles/interfaces/interfaces.ts +2 -0
- package/src/utils/DOM.ts +28 -0
- package/src/utils/EventEmitter.ts +61 -0
- package/src/utils/Func.ts +3 -0
- package/src/utils/Settings.ts +39 -0
- package/src/utils/Support.ts +70 -0
- package/src/utils/Urls.ts +43 -0
- package/src/viewer/Alignment.ts +53 -0
- package/src/viewer/CacheService.ts +75 -0
- package/src/viewer/ComponentController.ts +237 -0
- package/src/viewer/Container.ts +100 -0
- package/src/viewer/EventNames.ts +192 -0
- package/src/viewer/ImageSize.ts +28 -0
- package/src/viewer/KeyboardService.ts +15 -0
- package/src/viewer/LoadingService.ts +66 -0
- package/src/viewer/MouseService.ts +541 -0
- package/src/viewer/Navigator.ts +362 -0
- package/src/viewer/Observer.ts +441 -0
- package/src/viewer/Projection.ts +162 -0
- package/src/viewer/SpriteService.ts +281 -0
- package/src/viewer/TouchService.ts +336 -0
- package/src/viewer/Viewer.ts +1132 -0
- package/src/viewer/interfaces/IComponentOptions.ts +176 -0
- package/src/viewer/interfaces/IMouseClaim.ts +6 -0
- package/src/viewer/interfaces/IMouseDeferPixels.ts +6 -0
- package/src/viewer/interfaces/IPinch.ts +81 -0
- package/src/viewer/interfaces/ISpriteAtlas.ts +12 -0
- package/src/viewer/interfaces/IUnprojection.ts +9 -0
- package/src/viewer/interfaces/IViewerMouseEvent.ts +56 -0
- package/src/viewer/interfaces/IViewerOptions.ts +88 -0
- package/src/viewer/interfaces/PointOfView.ts +19 -0
- package/src/viewer/interfaces/interfaces.ts +9 -0
- package/styles/AttributionComponent.css +26 -0
- package/styles/BackgroundComponent.css +21 -0
- package/styles/BearingComponent.css +48 -0
- package/styles/CoverComponent.css +169 -0
- package/styles/DebugComponent.css +28 -0
- package/styles/DirectionComponent.css +154 -0
- package/styles/LoadingComponent.css +14 -0
- package/styles/NavigationComponent.css +64 -0
- package/styles/NorthBg.png +0 -0
- package/styles/PopupComponent.css +188 -0
- package/styles/RouteComponent.css +21 -0
- package/styles/SequenceComponent.css +120 -0
- package/styles/SliderComponent.css +82 -0
- package/styles/TagComponent.css +105 -0
- package/styles/cover-logo.png +0 -0
- package/styles/mapillary-js.css +29 -0
- package/styles/pano-indicator.svg +3 -0
- package/styles/pano.svg +20 -0
- package/styles/pointer-wheat.svg +3 -0
- package/styles/pointer-white.svg +3 -0
- package/styles/spinner.svg +1 -0
- package/styles/stepper-left.svg +1 -0
- package/styles/stepper-play.svg +1 -0
- package/styles/stepper-right.svg +1 -0
- package/styles/stepper-stop.svg +1 -0
- package/styles/turn-around.svg +3 -0
- package/styles/turn.svg +3 -0
- package/tsconfig.json +28 -0
- package/tslint.json +81 -0
- package/types/graphql/index.d.ts +28 -0
- package/types/graphql/language/ast/index.d.ts +7 -0
- package/types/images/index.d.ts +7 -0
- package/types/pbf/index.d.ts +16 -0
- package/types/rbush/index.d.ts +28 -0
- package/version/beeview-0.1.0.css +2 -0
- package/version/beeview-0.1.0.js +1 -0
- package/version/beeview-0.1.1.css +2 -0
- package/version/beeview-0.1.1.js +1 -0
- package/version/beeview-0.1.2.css +2 -0
- package/version/beeview-0.1.2.js +1 -0
- package/version/beeview-0.2.0.css +2 -0
- package/version/beeview-0.2.0.js +1 -0
- package/version/beeview-0.2.1.css +2 -0
- package/version/beeview-0.2.1.js +1 -0
- package/version/beeview-0.3.0.css +2 -0
- package/version/beeview-0.3.0.js +1 -0
- package/version/beeview-0.4.0.css +2 -0
- package/version/beeview-0.4.0.js +1 -0
- package/version/beeview-0.4.1.css +2 -0
- package/version/beeview-0.4.1.js +1 -0
- package/version/mapxus-visual-1.0.0.css +2 -0
- package/version/mapxus-visual-1.0.0.js +1 -0
- package/version/mapxus-visual-1.1.0.css +2 -0
- package/version/mapxus-visual-1.1.0.js +1 -0
- package/version/mapxus-visual-1.1.1.css +2 -0
- package/version/mapxus-visual-1.1.1.js +1 -0
- package/version/mapxus-visual-1.1.2.css +2 -0
- package/version/mapxus-visual-1.1.2.js +1 -0
- package/version/mapxus-visual-1.2.0.css +2 -0
- package/version/mapxus-visual-1.2.0.js +1 -0
- package/version/mapxus-visual-1.3.0.css +2 -0
- package/version/mapxus-visual-1.3.0.js +1 -0
- package/LICENSE +0 -11
- package/README.md +0 -28
- package/index.css +0 -2
- package/index.d.ts +0 -163
- package/index.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Beeview=e()}}(function(){return function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return i(r||e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,r){"use strict";function n(e,t,r){t=t||1;for(var n,a,u,l,h=0;h<e[0].length;h++){var p=e[0][h];(!h||p[0]<n)&&(n=p[0]),(!h||p[1]<a)&&(a=p[1]),(!h||p[0]>u)&&(u=p[0]),(!h||p[1]>l)&&(l=p[1])}var f=u-n,d=l-a,m=Math.min(f,d),v=m/2,y=new c(null,i);if(0===m)return[n,a];for(var g=n;g<u;g+=m)for(var b=a;b<l;b+=m)y.push(new o(g+v,b+v,v,e));var _=s(e),x=new o(n+f/2,a+d/2,0,e);x.d>_.d&&(_=x);for(var w=y.length;y.length;){var S=y.pop();S.d>_.d&&(_=S,r&&console.log("found best %d after %d probes",Math.round(1e4*S.d)/1e4,w)),S.max-_.d<=t||(v=S.h/2,y.push(new o(S.x-v,S.y-v,v,e)),y.push(new o(S.x+v,S.y-v,v,e)),y.push(new o(S.x-v,S.y+v,v,e)),y.push(new o(S.x+v,S.y+v,v,e)),w+=4)}return r&&(console.log("num probes: "+w),console.log("best distance: "+_.d)),[_.x,_.y]}function i(e,t){return t.max-e.max}function o(e,t,r,n){this.x=e,this.y=t,this.h=r,this.d=a(e,t,n),this.max=this.d+this.h*Math.SQRT2}function a(e,t,r){for(var n=!1,i=1/0,o=0;o<r.length;o++)for(var a=r[o],s=0,c=a.length,l=c-1;s<c;l=s++){var h=a[s],p=a[l];h[1]>t!=p[1]>t&&e<(p[0]-h[0])*(t-h[1])/(p[1]-h[1])+h[0]&&(n=!n),i=Math.min(i,u(e,t,h,p))}return(n?1:-1)*Math.sqrt(i)}function s(e){for(var t=0,r=0,n=0,i=e[0],a=0,s=i.length,u=s-1;a<s;u=a++){var c=i[a],l=i[u],h=c[0]*l[1]-l[0]*c[1];r+=(c[0]+l[0])*h,n+=(c[1]+l[1])*h,t+=3*h}return 0===t?new o(i[0][0],i[0][1],0,e):new o(r/t,n/t,0,e)}function u(e,t,r,n){var i=r[0],o=r[1],a=n[0]-i,s=n[1]-o;if(0!==a||0!==s){var u=((e-i)*a+(t-o)*s)/(a*a+s*s);u>1?(i=n[0],o=n[1]):u>0&&(i+=a*u,o+=s*u)}return a=e-i,s=t-o,a*a+s*s}var c=e("tinyqueue");t.exports=n,t.exports.default=n},{tinyqueue:312}],2:[function(e,t,r){function n(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=n,this.p2x=r,this.p2y=n}t.exports=n,n.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},n.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},n.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},n.prototype.solveCurveX=function(e,t){void 0===t&&(t=1e-6);var r,n,i,o,a;for(i=e,a=0;a<8;a++){if(o=this.sampleCurveX(i)-e,Math.abs(o)<t)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=o/s}if(r=0,n=1,(i=e)<r)return r;if(i>n)return n;for(;r<n;){if(o=this.sampleCurveX(i),Math.abs(o-e)<t)return i;e>o?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},{}],3:[function(e,t,r){!function(n,i){"object"==typeof r&&void 0!==t?i(r,e("apollo-client"),e("apollo-link"),e("apollo-cache-inmemory"),e("apollo-link-http"),e("apollo-link-state"),e("apollo-link-error"),e("graphql-tag")):i((n.apollo=n.apollo||{},n.apollo.boost={}),n.apollo.core,n.apolloLink.core,n.apolloCacheInMemory,n.apolloLinkHttp,n.apolloLinkState,n.apolloLinkError,n.graphqlTag)}(this,function(e,t,r,n,i,o,a,s){"use strict";var u="default"in t?t.default:t;s=s&&s.hasOwnProperty("default")?s.default:s;var c=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),l=function(){return(l=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},h=["request","uri","credentials","headers","fetch","fetchOptions","clientState","onError","cacheRedirects","cache"],p=function(e){function t(t){void 0===t&&(t={});if(t){var s=Object.keys(t).filter(function(e){return-1===h.indexOf(e)});s.length>0&&console.warn("ApolloBoost was initialized with unsupported options: "+s.join(" "))}var u=t.request,c=t.uri,p=t.credentials,f=t.headers,d=t.fetch,m=t.fetchOptions,v=t.clientState,y=t.cacheRedirects,g=t.onError,b=t.cache;if(b&&y)throw new Error("Incompatible cache configuration. If providing `cache` then configure the provided instance with `cacheRedirects` instead.");b||(b=y?new n.InMemoryCache({cacheRedirects:y}):new n.InMemoryCache);var _=!!v&&o.withClientState(l({},v,{cache:b})),x=g?a.onError(g):a.onError(function(e){var t=e.graphQLErrors,r=e.networkError;t&&t.map(function(e){var t=e.message,r=e.locations,n=e.path;return console.log("[GraphQL error]: Message: "+t+", Location: "+r+", Path: "+n)}),r&&console.log("[Network error]: "+r)}),w=!!u&&new r.ApolloLink(function(e,t){return new r.Observable(function(r){var n;return Promise.resolve(e).then(function(e){return u(e)}).then(function(){n=t(e).subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)})}).catch(r.error.bind(r)),function(){n&&n.unsubscribe()}})}),S=new i.HttpLink({uri:c||"/graphql",fetch:d,fetchOptions:m||{},credentials:p||"same-origin",headers:f||{}}),T=r.ApolloLink.from([x,w,_,S].filter(function(e){return!!e}));return e.call(this,{cache:b,link:T})||this}return c(t,e),t}(u);Object.keys(t).forEach(function(r){e[r]=t[r]}),Object.keys(r).forEach(function(t){e[t]=r[t]}),Object.keys(n).forEach(function(t){e[t]=n[t]}),e.InMemoryCache=n.InMemoryCache,e.HttpLink=i.HttpLink,e.gql=s,e.default=p,Object.defineProperty(e,"__esModule",{value:!0})})},{"apollo-cache-inmemory":4,"apollo-client":6,"apollo-link":12,"apollo-link-error":8,"apollo-link-http":10,"apollo-link-state":11,"graphql-tag":31}],4:[function(e,t,r){!function(n,i){"object"==typeof r&&void 0!==t?i(r,e("apollo-utilities"),e("graphql/language/printer"),e("apollo-cache")):i((n.apollo=n.apollo||{},n.apollo.cache=n.apollo.cache||{},n.apollo.cache.inmemory={}),n.apollo.utilities,n.print,n.apolloCache.core)}(this,function(t,r,n,i){"use strict";function o(e){return new x(e)}function a(e){if(!r.isIdValue(e))throw new Error("Encountered a sub-selection on the query, but the store doesn't have an object reference. This should never happen during normal use unless you have custom code that is directly manipulating the store; please file an issue.")}function s(e,t,n,i,o){o.resultKey;var s=o.directives;a(t);var u=t.id,c=i.store.get(u),l=e;(n||s)&&(l=r.getStoreKeyName(l,n,s));var h=void 0;if(c&&void 0===(h=c[l])&&i.cacheRedirects&&(c.__typename||"ROOT_QUERY"===u)){var p=c.__typename||"Query",f=i.cacheRedirects[p];if(f){var d=f[e];d&&(h=d(c,n,{getCacheKey:function(e){return r.toIdValue({id:i.dataIdFromObject(e),typename:e.__typename})}}))}}return void 0===h?{result:h,missing:[{objectId:u,fieldName:l,tolerable:!1}]}:(r.isJsonValue(h)&&(h=h.json),{result:h})}function u(e,t){return null!==t&&"object"==typeof t&&t!==e&&(Object.isExtensible&&!Object.isExtensible(e)&&(e=O({},e)),Object.keys(t).forEach(function(r){var n=t[r];C.call(e,r)?e[r]=u(e[r],n):e[r]=n})),e}function c(e,t){var r=new N("Error writing result to store for query:\n "+n.print(t));return r.message+="\n"+e.message,r.stack=e.stack,r}function l(e){return"$"===e[0]}function h(e,t,n){if(e===t)return!1;var i=n.get(e),o=n.get(t),a=!1;Object.keys(i).forEach(function(e){var t=i[e],s=o[e];r.isIdValue(t)&&l(t.id)&&r.isIdValue(s)&&!r.isEqual(t,s)&&h(t.id,s.id,n)&&(a=!0)}),n.delete(e);var s=A({},i,o);return r.isEqual(s,o)?a:(n.set(t,s),!0)}function p(e,t,r){if(!r)return!1;if(r[e]){if(r[e].indexOf(t)>=0)return!0;r[e].push(t)}else r[e]=[t];return!1}function f(e,t){return new k(e).record(t)}function d(e){if(e.__typename){if(void 0!==e.id)return e.__typename+":"+e.id;if(void 0!==e._id)return e.__typename+":"+e._id}return null}var m=!1,v=function(){function e(){}return e.prototype.ensureReady=function(){return Promise.resolve()},e.prototype.canBypassInit=function(){return!0},e.prototype.match=function(e,t,n){var i=n.store.get(e.id);return!i&&"ROOT_QUERY"===e.id||!!i&&(i.__typename?i.__typename===t||(r.warnOnceInDevelopment("You are using the simple (heuristic) fragment matcher, but your queries contain union or interface types. Apollo Client will not be able to accurately map fragments. To make this error go away, use the `IntrospectionFragmentMatcher` as described in the docs: https://www.apollographql.com/docs/react/recipes/fragment-matching.html","error"),"heuristic"):(m||(console.warn("You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments."),console.warn("Could not find __typename on Fragment ",t,i),console.warn("DEPRECATION WARNING: using fragments without __typename is unsupported behavior and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now."),r.isTest()||(m=!0)),"heuristic"))},e}(),y=function(){function e(e){e&&e.introspectionQueryResultData?(this.possibleTypesMap=this.parseIntrospectionResult(e.introspectionQueryResultData),this.isReady=!0):this.isReady=!1,this.match=this.match.bind(this)}return e.prototype.match=function(e,t,r){if(!this.isReady)throw new Error("FragmentMatcher.match() was called before FragmentMatcher.init()");var n=r.store.get(e.id);if(!n)return!1;if(!n.__typename)throw new Error("Cannot match fragment because __typename property is missing: "+JSON.stringify(n));if(n.__typename===t)return!0;var i=this.possibleTypesMap[t];return!!(i&&i.indexOf(n.__typename)>-1)},e.prototype.parseIntrospectionResult=function(e){var t={};return e.__schema.types.forEach(function(e){"UNION"!==e.kind&&"INTERFACE"!==e.kind||(t[e.name]=e.possibleTypes.map(function(e){return e.name}))}),t},e}(),g=e("optimism").wrap,b=function(){function e(){this.children=null,this.key=null}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return e.forEach(function(e){t=t.getOrCreate(e)}),t.key||(t.key=Object.create(null))},e.prototype.getOrCreate=function(t){var r=this.children||(this.children=new Map);return r.get(t)||r.set(t,new e).get(t)},e}(),_=Object.prototype.hasOwnProperty,x=function(){function e(e){void 0===e&&(e=Object.create(null));var t=this;this.data=e,this.depend=g(function(e){return t.data[e]},{disposable:!0,makeCacheKey:function(e){return e}})}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.depend(e),this.data[e]},e.prototype.set=function(e,t){t!==this.data[e]&&(this.data[e]=t,this.depend.dirty(e))},e.prototype.delete=function(e){_.call(this.data,e)&&(delete this.data[e],this.depend.dirty(e))},e.prototype.clear=function(){this.replace(null)},e.prototype.replace=function(e){var t=this;e?(Object.keys(e).forEach(function(r){t.set(r,e[r])}),Object.keys(this.data).forEach(function(r){_.call(e,r)||t.delete(r)})):Object.keys(this.data).forEach(function(e){t.delete(e)})},e}(),w=function(){return(w=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},S=Object.create(null),T=function(){function e(e){this.cacheKeyRoot=e,this.perQueryKeyMakers=new Map}return e.prototype.forQuery=function(e){return this.perQueryKeyMakers.has(e)||this.perQueryKeyMakers.set(e,new E(this.cacheKeyRoot,e)),this.perQueryKeyMakers.get(e)},e}(),E=function(){function e(e,t){this.cacheKeyRoot=e,this.query=t,this.cache=new Map,this.lookupArray=this.cacheMethod(this.lookupArray),this.lookupObject=this.cacheMethod(this.lookupObject),this.lookupFragmentSpread=this.cacheMethod(this.lookupFragmentSpread)}return e.prototype.cacheMethod=function(e){var t=this;return function(r){if(t.cache.has(r)){var n=t.cache.get(r);if(n===S)throw new Error("QueryKeyMaker cannot handle circular query structures");return n}t.cache.set(r,S);try{var i=e.call(t,r);return t.cache.set(r,i),i}catch(e){throw t.cache.delete(r),e}}},e.prototype.lookupQuery=function(e){return this.lookupObject(e)},e.prototype.lookupSelectionSet=function(e){return this.lookupObject(e)},e.prototype.lookupFragmentSpread=function(e){var t=e.name.value,r=null;return this.query.definitions.some(function(e){if("FragmentDefinition"===e.kind&&e.name.value===t)return r=e,!0}),this.lookupObject(w({},e,{fragment:r}))},e.prototype.lookupAny=function(e){return Array.isArray(e)?this.lookupArray(e):"object"==typeof e&&null!==e?"FragmentSpread"===e.kind?this.lookupFragmentSpread(e):this.lookupObject(e):e},e.prototype.lookupArray=function(e){var t=e.map(this.lookupAny,this);return this.cacheKeyRoot.lookup(Array.prototype,this.cacheKeyRoot.lookupArray(t))},e.prototype.lookupObject=function(e){var t=this,r=Object.keys(e),n=r.indexOf("loc");n>=0&&r.splice(n,1),r.sort();var i=r.map(function(r){return t.lookupAny(e[r])});return this.cacheKeyRoot.lookup(Object.getPrototypeOf(e),this.cacheKeyRoot.lookupArray(r),this.cacheKeyRoot.lookupArray(i))},e}(),O=function(){return(O=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},M=function(){function e(e){var t=void 0===e?{}:e,r=t.addTypename,n=void 0!==r&&r,i=t.cacheKeyRoot,o=void 0===i?new b:i,a=this,s=a.executeStoreQuery,u=a.executeSelectionSet;a.addTypename=n,a.cacheKeyRoot=o,a.keyMaker=new T(o),this.executeStoreQuery=g(function(e){return s.call(a,e)},{makeCacheKey:function(e){var t=e.query,r=(e.rootValue,e.contextValue),n=e.variableValues;if(r.store instanceof x)return a.cacheKeyRoot.lookup(a.keyMaker.forQuery(t).lookupQuery(t),r.store,JSON.stringify(n))}}),this.executeSelectionSet=g(function(e){return u.call(a,e)},{makeCacheKey:function(e){var t=e.selectionSet,r=e.rootValue,n=e.execContext;if(n.contextValue.store instanceof x)return a.cacheKeyRoot.lookup(a.keyMaker.forQuery(n.query).lookupSelectionSet(t),n.contextValue.store,JSON.stringify(n.variableValues),r.id)}})}return e.prototype.readQueryFromStore=function(e){var t={returnPartialData:!1};return this.diffQueryAgainstStore(O({},e,t)).result},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,i=e.variables,o=e.previousResult,a=e.returnPartialData,s=void 0===a||a,u=e.rootId,c=void 0===u?"ROOT_QUERY":u,l=e.fragmentMatcherFunction,h=e.config,p=r.getQueryDefinition(n);i=r.assign({},r.getDefaultValues(p),i);var f={store:t,dataIdFromObject:h&&h.dataIdFromObject||null,cacheRedirects:h&&h.cacheRedirects||{}},d=this.executeStoreQuery({query:n,rootValue:{type:"id",id:c,generated:!0,typename:"Query"},contextValue:f,variableValues:i,fragmentMatcher:l}),m=d.missing&&d.missing.length>0;return m&&!s&&d.missing.forEach(function(e){if(!e.tolerable)throw new Error("Can't find field "+e.fieldName+" on object ("+e.objectId+") "+JSON.stringify(t.get(e.objectId),null,2)+".")}),o&&r.isEqual(o,d.result)&&(d.result=o),{result:d.result,complete:!m}},e.prototype.executeStoreQuery=function(e){var t=e.query,n=e.rootValue,i=e.contextValue,o=e.variableValues,a=e.fragmentMatcher,s=void 0===a?function(){return!0}:a,u=r.getMainDefinition(t),c=r.getFragmentDefinitions(t),l={query:t,fragmentMap:r.createFragmentMap(c),contextValue:i,variableValues:o,fragmentMatcher:s};return this.executeSelectionSet({selectionSet:u.selectionSet,rootValue:n,execContext:l,parentKind:u.kind})},e.prototype.executeSelectionSet=function(e){function t(e){var t;return e.missing&&(p.missing=p.missing||[],(t=p.missing).push.apply(t,e.missing)),e.result}var n=this,i=e.selectionSet,o=e.rootValue,a=e.execContext,s=e.parentKind,c=a.fragmentMap,l=a.contextValue,h=a.variableValues,p={result:{}},f=!1,d=function(e){var i;if(r.shouldInclude(e,h))if(r.isField(e)){var s=t(n.executeField(e,o,a)),d=r.resultKeyNameFromField(e);"__typename"===d&&(f=!0),void 0!==s&&u(p.result,(i={},i[d]=s,i))}else{var m=void 0;if(r.isInlineFragment(e))m=e;else if(!(m=c[e.name.value]))throw new Error("No fragment named "+e.name.value);var v=m.typeCondition.name.value,y=a.fragmentMatcher(o,v,l);if(y){var g=n.executeSelectionSet({selectionSet:m.selectionSet,rootValue:o,execContext:a,parentKind:m.kind});"heuristic"===y&&g.missing&&(g=O({},g,{missing:g.missing.map(function(e){return O({},e,{tolerable:!0})})})),u(p.result,t(g))}}};return i.selections.forEach(d),!f&&this.addTypename&&"OperationDefinition"!==s&&d({kind:"Field",name:{kind:"Name",value:"__typename"}}),p},e.prototype.executeField=function(e,t,n){function i(e){var t=null;return u.missing&&(t=t||[]).push.apply(t,u.missing),e.missing&&(t=t||[]).push.apply(t,e.missing),{result:e.result,missing:t}}var o=n.variableValues,a=n.contextValue,u=s(e.name.value,t,r.argumentsObjectFromField(e,o),a,{resultKey:r.resultKeyNameFromField(e),directives:r.getDirectiveInfoFromField(e,o)});return e.selectionSet?null==u.result?u:i(Array.isArray(u.result)?this.executeSubSelectedArray(e,u.result,n):this.executeSelectionSet({selectionSet:e.selectionSet,rootValue:u.result,execContext:n,parentKind:e.kind})):u},e.prototype.executeSubSelectedArray=function(e,t,r){function n(e){return e.missing&&(o=o||[]).push.apply(o,e.missing),e.result}var i=this,o=null;return t=t.map(function(t){return null===t?null:n(Array.isArray(t)?i.executeSubSelectedArray(e,t,r):i.executeSelectionSet({selectionSet:e.selectionSet,rootValue:t,execContext:r,parentKind:e.kind}))}),{result:t,missing:o}},e}(),C=Object.prototype.hasOwnProperty,j=function(){function e(e){void 0===e&&(e=Object.create(null)),this.data=e}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e.prototype.delete=function(e){this.data[e]=void 0},e.prototype.clear=function(){this.data=Object.create(null)},e.prototype.replace=function(e){this.data=e||Object.create(null)},e}(),P=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),A=function(){return(A=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},N=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="WriteError",t}return P(t,e),t}(Error),L={kind:"Field",name:{kind:"Name",value:"__typename"}},I=function(){function e(e){var t=(void 0===e?{}:e).addTypename,r=void 0!==t&&t;this.addTypename=r}return e.prototype.writeQueryToStore=function(e){var t=e.query,r=e.result,n=e.store,i=void 0===n?o():n,a=e.variables,s=e.dataIdFromObject,u=e.fragmentMatcherFunction;return this.writeResultToStore({dataId:"ROOT_QUERY",result:r,document:t,store:i,variables:a,dataIdFromObject:s,fragmentMatcherFunction:u})},e.prototype.writeResultToStore=function(e){var t=e.dataId,n=e.result,i=e.document,a=e.store,s=void 0===a?o():a,u=e.variables,l=e.dataIdFromObject,h=e.fragmentMatcherFunction,p=r.getOperationDefinition(i);try{return this.writeSelectionSetToStore({result:n,dataId:t,selectionSet:p.selectionSet,context:{store:s,processedData:{},variables:r.assign({},r.getDefaultValues(p),u),dataIdFromObject:l,fragmentMap:r.createFragmentMap(r.getFragmentDefinitions(i)),fragmentMatcherFunction:h},parentKind:p.kind})}catch(e){throw c(e,i)}},e.prototype.writeSelectionSetToStore=function(e){var t=this,n=e.result,i=e.dataId,o=e.selectionSet,a=e.context,s=e.parentKind,u=a.variables,c=a.store,l=a.fragmentMap,h=!1;return o.selections.forEach(function(e){if(r.shouldInclude(e,u))if(r.isField(e)){var o=r.resultKeyNameFromField(e),s=n[o];"__typename"===o&&(h=!0),void 0!==s?t.writeFieldToStore({dataId:i,value:s,field:e,context:a}):!(e.directives&&e.directives.length&&e.directives.some(function(e){return e.name&&"defer"===e.name.value}))&&a.fragmentMatcherFunction&&(r.isProduction()||console.warn("Missing field "+o+" in "+JSON.stringify(n,null,2).substring(0,100)))}else{var c=void 0;if(r.isInlineFragment(e))c=e;else if(!(c=(l||{})[e.name.value]))throw new Error("No fragment named "+e.name.value+".");var p=!0;if(a.fragmentMatcherFunction&&c.typeCondition){var f=r.toIdValue({id:"self",typename:void 0}),d={store:new j({self:n}),cacheRedirects:{}},m=a.fragmentMatcherFunction(f,c.typeCondition.name.value,d);r.isProduction()||"heuristic"!==m||console.error("WARNING: heuristic fragment matching going on!"),p=!!m}p&&t.writeSelectionSetToStore({result:n,selectionSet:c.selectionSet,dataId:i,context:a,parentKind:c.kind})}}),!h&&this.addTypename&&"OperationDefinition"!==s&&"string"==typeof n.__typename&&this.writeFieldToStore({dataId:i,value:n.__typename,field:L,context:a}),c},e.prototype.writeFieldToStore=function(e){var t,i,o,a=e.field,s=e.value,u=e.dataId,c=e.context,f=c.variables,d=c.dataIdFromObject,m=c.store,v=r.storeKeyNameFromField(a,f);if(a.selectionSet&&null!==s)if(Array.isArray(s)){var y=u+"."+v;i=this.processArrayValue(s,y,a.selectionSet,c,a.kind)}else{var g=u+"."+v,b=!0;if(l(g)||(g="$"+g),d){var _=d(s);if(_&&l(_))throw new Error('IDs returned by dataIdFromObject cannot begin with the "$" character.');(_||"number"==typeof _&&0===_)&&(g=_,b=!1)}p(g,a,c.processedData)||this.writeSelectionSetToStore({dataId:g,result:s,selectionSet:a.selectionSet,context:c,parentKind:a.kind});var x=s.__typename;i=r.toIdValue({id:g,typename:x},b);var w=(o=m.get(u))&&o[v];if(w!==i&&r.isIdValue(w)){var S=void 0!==w.typename,T=void 0!==x,E=S&&T&&w.typename!==x;if(b&&!w.generated&&!E)throw new Error("Store error: the application attempted to write an object with no provided id but the store already contains an id of "+w.id+" for this object. The selectionSet that was trying to be written is:\n"+n.print(a));if(S&&!T)throw new Error("Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of "+w.typename+" for the object of id "+w.id+". The selectionSet that was trying to be written is:\n"+n.print(a));w.generated&&(E?b||m.delete(w.id):h(w.id,i.id,m))}}else i=null!=s&&"object"==typeof s?{type:"json",json:s}:s;(o=m.get(u))&&r.isEqual(i,o[v])||m.set(u,A({},o,(t={},t[v]=i,t)))},e.prototype.processArrayValue=function(e,t,n,i,o){var a=this;return e.map(function(e,s){if(null===e)return null;var u=t+"."+s;if(Array.isArray(e))return a.processArrayValue(e,u,n,i,o);var c=!0;if(i.dataIdFromObject){var l=i.dataIdFromObject(e);l&&(u=l,c=!1)}return p(u,n,i.processedData)||a.writeSelectionSetToStore({dataId:u,result:e,selectionSet:n,context:i,parentKind:o}),r.toIdValue({id:u,typename:e.__typename},c)})},e}(),R=function(){return(R=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},k=function(){function e(e){void 0===e&&(e={}),this.data=e,this.recordedData={}}return e.prototype.record=function(e){e(this);var t=this.recordedData;return this.recordedData={},t},e.prototype.toObject=function(){return R({},this.data,this.recordedData)},e.prototype.get=function(e){return this.recordedData.hasOwnProperty(e)?this.recordedData[e]:this.data[e]},e.prototype.set=function(e,t){this.get(e)!==t&&(this.recordedData[e]=t)},e.prototype.delete=function(e){this.recordedData[e]=void 0},e.prototype.clear=function(){var e=this;Object.keys(this.data).forEach(function(t){return e.delete(t)}),this.recordedData={}},e.prototype.replace=function(e){this.clear(),this.recordedData=R({},e)},e}(),D=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),F=function(){return(F=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},V={fragmentMatcher:new v,dataIdFromObject:d,addTypename:!0},B=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;r.optimistic=[],r.watches=new Set,r.typenameDocumentCache=new Map,r.cacheKeyRoot=new b,r.silenceBroadcast=!1,r.config=F({},V,t),r.config.customResolvers&&(console.warn("customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version."),r.config.cacheRedirects=r.config.customResolvers),r.config.cacheResolvers&&(console.warn("cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version."),r.config.cacheRedirects=r.config.cacheResolvers),r.addTypename=r.config.addTypename,r.data=o(),r.storeReader=new M({addTypename:r.config.addTypename,cacheKeyRoot:r.cacheKeyRoot}),r.storeWriter=new I({addTypename:r.config.addTypename});var n=r,i=n.maybeBroadcastWatch;return r.maybeBroadcastWatch=g(function(e){return i.call(r,e)},{makeCacheKey:function(e){if(!(e.optimistic&&n.optimistic.length>0||e.previousResult))return n.data instanceof x?n.cacheKeyRoot.lookup(e.query,JSON.stringify(e.variables)):void 0}}),r}return D(t,e),t.prototype.restore=function(e){return e&&this.data.replace(e),this},t.prototype.extract=function(e){if(void 0===e&&(e=!1),e&&this.optimistic.length>0){var t=this.optimistic.map(function(e){return e.data});return Object.assign.apply(Object,[{},this.data.toObject()].concat(t))}return this.data.toObject()},t.prototype.read=function(e){if(e.rootId&&void 0===this.data.get(e.rootId))return null;var t=e.optimistic&&this.optimistic.length?o(this.extract(!0)):this.data;return this.storeReader.readQueryFromStore({store:t,query:e.query,variables:e.variables,rootId:e.rootId,fragmentMatcherFunction:this.config.fragmentMatcher.match,previousResult:e.previousResult,config:this.config})},t.prototype.write=function(e){this.storeWriter.writeResultToStore({dataId:e.dataId,result:e.result,variables:e.variables,document:e.query,store:this.data,dataIdFromObject:this.config.dataIdFromObject,fragmentMatcherFunction:this.config.fragmentMatcher.match}),this.broadcastWatches()},t.prototype.diff=function(e){var t=e.optimistic&&this.optimistic.length?o(this.extract(!0)):this.data;return this.storeReader.diffQueryAgainstStore({store:t,query:e.query,variables:e.variables,returnPartialData:e.returnPartialData,previousResult:e.previousResult,fragmentMatcherFunction:this.config.fragmentMatcher.match,config:this.config})},t.prototype.watch=function(e){var t=this;return this.watches.add(e),function(){t.watches.delete(e)}},t.prototype.evict=function(e){throw new Error("eviction is not implemented on InMemory Cache")},t.prototype.reset=function(){return this.data.clear(),this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this,r=this.optimistic.filter(function(t){return t.id!==e});this.optimistic=[],r.forEach(function(e){t.recordOptimisticTransaction(e.transaction,e.id)}),this.broadcastWatches()},t.prototype.performTransaction=function(e){var t=this.silenceBroadcast;this.silenceBroadcast=!0,e(this),t||(this.silenceBroadcast=!1),this.broadcastWatches()},t.prototype.recordOptimisticTransaction=function(e,t){var r=this;this.silenceBroadcast=!0;var n=f(this.extract(!0),function(t){var n=r.data;r.data=t,r.performTransaction(e),r.data=n});this.optimistic.push({id:t,transaction:e,data:n}),this.silenceBroadcast=!1,this.broadcastWatches()},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||this.typenameDocumentCache.set(e,t=r.addTypenameToDocument(e)),t}return e},t.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.read({query:e.query,variables:e.variables,optimistic:t})},t.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.read({query:r.getFragmentQueryDocument(e.fragment,e.fragmentName),variables:e.variables,rootId:e.id,optimistic:t})},t.prototype.writeQuery=function(e){this.write({dataId:"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables})},t.prototype.writeFragment=function(e){this.write({dataId:e.id,result:e.data,query:r.getFragmentQueryDocument(e.fragment,e.fragmentName),variables:e.variables})},t.prototype.broadcastWatches=function(){var e=this;if(!this.silenceBroadcast){var t=this.optimistic.length>0;this.watches.forEach(function(r){e.maybeBroadcastWatch(r),t&&e.maybeBroadcastWatch.dirty(r)})}},t.prototype.maybeBroadcastWatch=function(e){var t=e.previousResult&&e.previousResult(),r=this.diff({query:e.query,variables:e.variables,previousResult:t,optimistic:e.optimistic});t&&t===r.result||e.callback(r)},t}(i.ApolloCache);t.InMemoryCache=B,t.defaultDataIdFromObject=d,t.StoreReader=M,t.assertIdValue=a,t.WriteError=N,t.enhanceErrorWithDocument=c,t.StoreWriter=I,t.HeuristicFragmentMatcher=v,t.IntrospectionFragmentMatcher=y,t.ObjectCache=j,t.defaultNormalizedCacheFactory=function(e){return new j(e)},t.RecordingCache=k,t.record=f,Object.defineProperty(t,"__esModule",{value:!0})})},{"apollo-cache":5,"apollo-utilities":13,"graphql/language/printer":71,optimism:148}],5:[function(e,t,r){!function(n,i){"object"==typeof r&&void 0!==t?i(r,e("apollo-utilities")):i((n.apollo=n.apollo||{},n.apollo.cache=n.apollo.cache||{},n.apollo.cache.core={}),n.apollo.utilities)}(this,function(e,t){"use strict";function r(e){return{kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:i(e)}]}}function n(e,t){return{kind:"Document",definitions:[{kind:"FragmentDefinition",typeCondition:{kind:"NamedType",name:{kind:"Name",value:t||"__FakeType"}},name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:i(e)}]}}function i(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||void 0===e||null===e)return null;if(Array.isArray(e))return i(e[0]);var t=[];return Object.keys(e).forEach(function(r){var n={kind:"Field",name:{kind:"Name",value:r}},o=i(e[r]);o&&(n.selectionSet=o),t.push(n)}),{kind:"SelectionSet",selections:t}}var o={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:null,variableDefinitions:null,directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:null,name:{kind:"Name",value:"__typename"},arguments:[],directives:[],selectionSet:null}]}}]},a=function(){function e(){}return e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.read({query:e.query,variables:e.variables,optimistic:t})},e.prototype.readFragment=function(e,r){return void 0===r&&(r=!1),this.read({query:t.getFragmentQueryDocument(e.fragment,e.fragmentName),variables:e.variables,rootId:e.id,optimistic:r})},e.prototype.writeQuery=function(e){this.write({dataId:"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables})},e.prototype.writeFragment=function(e){this.write({dataId:e.id,result:e.data,variables:e.variables,query:t.getFragmentQueryDocument(e.fragment,e.fragmentName)})},e.prototype.writeData=function(e){var t=e.id,i=e.data;if(void 0!==t){var a=null;try{a=this.read({rootId:t,optimistic:!1,query:o})}catch(e){}var s=a&&a.__typename||"__ClientData",u=Object.assign({__typename:s},i);this.writeFragment({id:t,fragment:n(u,s),data:u})}else this.writeQuery({query:r(i),data:i})},e}();e.Cache||(e.Cache={}),e.ApolloCache=a,Object.defineProperty(e,"__esModule",{value:!0})})},{"apollo-utilities":13}],6:[function(e,t,r){!function(n,i){"object"==typeof r&&void 0!==t?i(r,e("apollo-link"),e("symbol-observable"),e("apollo-utilities"),e("graphql/language/printer"),e("apollo-link-dedup")):i((n.apollo=n.apollo||{},n.apollo.core={}),n.apolloLink.core,n.$$observable,n.apollo.utilities,n.print,n.apolloLink.dedup)}(this,function(e,t,r,n,i,o){"use strict";function a(e){return e<7}function s(e){return e.hasOwnProperty("graphQLErrors")}r=r&&r.hasOwnProperty("default")?r.default:r,function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(e.NetworkStatus||(e.NetworkStatus={}));var u=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype[r]=function(){return this},t.prototype["@@observable"]=function(){return this},t}(t.Observable),l=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),h=function(e){var t="";return Array.isArray(e.graphQLErrors)&&0!==e.graphQLErrors.length&&e.graphQLErrors.forEach(function(e){var r=e?e.message:"Error message not found.";t+="GraphQL error: "+r+"\n"}),e.networkError&&(t+="Network error: "+e.networkError.message+"\n"),t=t.replace(/\n$/,"")},p=function(e){function t(r){var n=r.graphQLErrors,i=r.networkError,o=r.errorMessage,a=r.extraInfo,s=e.call(this,o)||this;return s.graphQLErrors=n||[],s.networkError=i||null,s.message=o||h(s),s.extraInfo=a,s.__proto__=t.prototype,s}return l(t,e),t}(Error);!function(e){e[e.normal=1]="normal",e[e.refetch=2]="refetch",e[e.poll=3]="poll"}(e.FetchType||(e.FetchType={}));var f=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),d=function(){return(d=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},m=function(e,t){return void 0===t&&(t="none"),e&&(e.graphQLErrors&&e.graphQLErrors.length>0&&"none"===t||e.networkError)},v=function(t){function r(e){var r=e.scheduler,n=e.options,i=e.shouldSubscribe,o=void 0===i||i,a=t.call(this,function(e){return a.onSubscribe(e)})||this;return a.isCurrentlyPolling=!1,a.isTornDown=!1,a.options=n,a.variables=n.variables||{},a.queryId=r.queryManager.generateQueryId(),a.shouldSubscribe=o,a.scheduler=r,a.queryManager=r.queryManager,a.observers=[],a.subscriptionHandles=[],a}return f(r,t),r.prototype.result=function(){var e=this;return new Promise(function(t,r){var n,i={next:function(r){t(r),e.observers.some(function(e){return e!==i})||e.queryManager.removeQuery(e.queryId),setTimeout(function(){n.unsubscribe()},0)},error:function(e){r(e)}};n=e.subscribe(i)})},r.prototype.currentResult=function(){if(this.isTornDown)return{data:this.lastError?{}:this.lastResult?this.lastResult.data:{},error:this.lastError,loading:!1,networkStatus:e.NetworkStatus.error};var t=this.queryManager.queryStore.get(this.queryId);if(m(t,this.options.errorPolicy))return{data:{},loading:!1,networkStatus:t.networkStatus,error:new p({graphQLErrors:t.graphQLErrors,networkError:t.networkError})};var r,n=this.queryManager.getCurrentQueryResult(this),i=n.data,o=n.partial,s=!t||t.networkStatus===e.NetworkStatus.loading,u="network-only"===this.options.fetchPolicy&&s||o&&"cache-only"!==this.options.fetchPolicy,c={data:i,loading:a(r=t?t.networkStatus:u?e.NetworkStatus.loading:e.NetworkStatus.ready),networkStatus:r};if(t&&t.graphQLErrors&&"all"===this.options.errorPolicy&&(c.errors=t.graphQLErrors),!o){this.lastResult=d({},c,{stale:!1})}return d({},c,{partial:o})},r.prototype.getLastResult=function(){return this.lastResult},r.prototype.getLastError=function(){return this.lastError},r.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastError,this.isTornDown=!1},r.prototype.refetch=function(t){var r=this.options.fetchPolicy;if("cache-only"===r)return Promise.reject(new Error("cache-only fetchPolicy option should not be used together with query refetch."));n.isEqual(this.variables,t)||(this.variables=Object.assign({},this.variables,t)),n.isEqual(this.options.variables,this.variables)||(this.options.variables=Object.assign({},this.options.variables,this.variables));var i="network-only"===r||"no-cache"===r,o=d({},this.options,{fetchPolicy:i?r:"network-only"});return this.queryManager.fetchQuery(this.queryId,o,e.FetchType.refetch).then(function(e){return e})},r.prototype.fetchMore=function(t){var r=this;if(!t.updateQuery)throw new Error("updateQuery option is required. This function defines how to update the query data with the new results.");var n;return Promise.resolve().then(function(){var i=r.queryManager.generateQueryId();return n=t.query?t:d({},r.options,t,{variables:Object.assign({},r.variables,t.variables)}),n.fetchPolicy="network-only",r.queryManager.fetchQuery(i,n,e.FetchType.normal,r.queryId)}).then(function(e){return r.updateQuery(function(r){return t.updateQuery(r,{fetchMoreResult:e.data,variables:n.variables})}),e})},r.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables}).subscribe({next:function(r){e.updateQuery&&t.updateQuery(function(t,n){var i=n.variables;return e.updateQuery(t,{subscriptionData:r,variables:i})})},error:function(t){e.onError?e.onError(t):console.error("Unhandled GraphQL subscription error",t)}});return this.subscriptionHandles.push(r),function(){var e=t.subscriptionHandles.indexOf(r);e>=0&&(t.subscriptionHandles.splice(e,1),r.unsubscribe())}},r.prototype.setOptions=function(e){var t=this.options;this.options=Object.assign({},this.options,e),e.pollInterval?this.startPolling(e.pollInterval):0===e.pollInterval&&this.stopPolling();var r="network-only"!==t.fetchPolicy&&"network-only"===e.fetchPolicy||"cache-only"===t.fetchPolicy&&"cache-only"!==e.fetchPolicy||"standby"===t.fetchPolicy&&"standby"!==e.fetchPolicy||!1;return this.setVariables(this.options.variables,r,e.fetchResults)},r.prototype.setVariables=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0),this.isTornDown=!1;var i=e||this.variables;return n.isEqual(i,this.variables)&&!t?0!==this.observers.length&&r?this.result():new Promise(function(e){return e()}):(this.variables=i,this.options.variables=i,0===this.observers.length?new Promise(function(e){return e()}):this.queryManager.fetchQuery(this.queryId,d({},this.options,{variables:this.variables})).then(function(e){return e}))},r.prototype.updateQuery=function(e){var t=this.queryManager.getQueryWithPreviousResult(this.queryId),r=t.previousResult,i=t.variables,o=t.document,a=n.tryFunctionOrLogError(function(){return e(r,{variables:i})});a&&(this.queryManager.dataStore.markUpdateQueryResult(o,i,a),this.queryManager.broadcastQueries())},r.prototype.stopPolling=function(){this.isCurrentlyPolling&&(this.scheduler.stopPollingQuery(this.queryId),this.options.pollInterval=void 0,this.isCurrentlyPolling=!1)},r.prototype.startPolling=function(e){if("cache-first"===this.options.fetchPolicy||"cache-only"===this.options.fetchPolicy)throw new Error("Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.");this.isCurrentlyPolling&&(this.scheduler.stopPollingQuery(this.queryId),this.isCurrentlyPolling=!1),this.options.pollInterval=e,this.isCurrentlyPolling=!0,this.scheduler.startPollingQuery(this.options,this.queryId)},r.prototype.onSubscribe=function(e){var t=this;return e._subscription&&e._subscription._observer&&!e._subscription._observer.error&&(e._subscription._observer.error=function(e){console.error("Unhandled error",e.message,e.stack)}),this.observers.push(e),e.next&&this.lastResult&&e.next(this.lastResult),e.error&&this.lastError&&e.error(this.lastError),1===this.observers.length&&this.setUpQuery(),function(){t.observers=t.observers.filter(function(t){return t!==e}),0===t.observers.length&&t.tearDownQuery()}},r.prototype.setUpQuery=function(){var e=this;if(this.shouldSubscribe&&this.queryManager.addObservableQuery(this.queryId,this),this.options.pollInterval){if("cache-first"===this.options.fetchPolicy||"cache-only"===this.options.fetchPolicy)throw new Error("Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.");this.isCurrentlyPolling=!0,this.scheduler.startPollingQuery(this.options,this.queryId)}var t={next:function(t){e.lastResult=t,e.observers.forEach(function(e){return e.next&&e.next(t)})},error:function(t){e.lastError=t,e.observers.forEach(function(e){return e.error&&e.error(t)})}};this.queryManager.startQuery(this.queryId,this.options,this.queryManager.queryListenerForObserver(this.queryId,this.options,t))},r.prototype.tearDownQuery=function(){this.isTornDown=!0,this.isCurrentlyPolling&&(this.scheduler.stopPollingQuery(this.queryId),this.isCurrentlyPolling=!1),this.subscriptionHandles.forEach(function(e){return e.unsubscribe()}),this.subscriptionHandles=[],this.queryManager.removeObservableQuery(this.queryId),this.queryManager.stopQuery(this.queryId),this.observers=[]},r}(c),y=function(){return(y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},g=function(){function t(e){var t=e.queryManager,r=e.ssrMode;this.inFlightQueries={},this.registeredQueries={},this.intervalQueries={},this.pollingTimers={},this.ssrMode=!1,this.queryManager=t,this.ssrMode=r||!1}return t.prototype.checkInFlight=function(t){var r=this.queryManager.queryStore.get(t);return r&&r.networkStatus!==e.NetworkStatus.ready&&r.networkStatus!==e.NetworkStatus.error},t.prototype.fetchQuery=function(e,t,r){var n=this;return new Promise(function(i,o){n.queryManager.fetchQuery(e,t,r).then(function(e){i(e)}).catch(function(e){o(e)})})},t.prototype.startPollingQuery=function(e,t,r){if(!e.pollInterval)throw new Error("Attempted to start a polling query without a polling interval.");return this.ssrMode?t:(this.registeredQueries[t]=e,r&&this.queryManager.addQueryListener(t,r),this.addQueryOnInterval(t,e),t)},t.prototype.stopPollingQuery=function(e){delete this.registeredQueries[e]},t.prototype.fetchQueriesOnInterval=function(t){var r=this;this.intervalQueries[t]=this.intervalQueries[t].filter(function(n){if(!r.registeredQueries.hasOwnProperty(n)||r.registeredQueries[n].pollInterval!==t)return!1;if(r.checkInFlight(n))return!0;var i=r.registeredQueries[n],o=y({},i);return o.fetchPolicy="network-only",r.fetchQuery(n,o,e.FetchType.poll).catch(function(){}),!0}),0===this.intervalQueries[t].length&&(clearInterval(this.pollingTimers[t]),delete this.intervalQueries[t])},t.prototype.addQueryOnInterval=function(e,t){var r=this,n=t.pollInterval;if(!n)throw new Error("A poll interval is required to start polling query with id '"+e+"'.");this.intervalQueries.hasOwnProperty(n.toString())&&this.intervalQueries[n].length>0?this.intervalQueries[n].push(e):(this.intervalQueries[n]=[e],this.pollingTimers[n]=setInterval(function(){r.fetchQueriesOnInterval(n)},n))},t.prototype.registerPollingQuery=function(e){if(!e.pollInterval)throw new Error("Attempted to register a non-polling query with the scheduler.");return new v({scheduler:this,options:e})},t}(),b=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initMutation=function(e,t,r){this.store[e]={mutationString:t,variables:r||{},loading:!0,error:null}},e.prototype.markMutationError=function(e,t){var r=this.store[e];r&&(r.loading=!1,r.error=t)},e.prototype.markMutationResult=function(e){var t=this.store[e];t&&(t.loading=!1,t.error=null)},e.prototype.reset=function(){this.store={}},e}(),_=function(){return(_=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},x=function(){function t(){this.store={}}return t.prototype.getStore=function(){return this.store},t.prototype.get=function(e){return this.store[e]},t.prototype.initQuery=function(t){var r=this.store[t.queryId];if(r&&r.document!==t.document&&i.print(r.document)!==i.print(t.document))throw new Error("Internal Error: may not update existing query string in store");var o=!1,a=null;t.storePreviousVariables&&r&&r.networkStatus!==e.NetworkStatus.loading&&(n.isEqual(r.variables,t.variables)||(o=!0,a=r.variables));var s;s=o?e.NetworkStatus.setVariables:t.isPoll?e.NetworkStatus.poll:t.isRefetch?e.NetworkStatus.refetch:e.NetworkStatus.loading;var u=[];r&&r.graphQLErrors&&(u=r.graphQLErrors),this.store[t.queryId]={document:t.document,variables:t.variables,previousVariables:a,networkError:null,graphQLErrors:u,networkStatus:s,metadata:t.metadata},"string"==typeof t.fetchMoreForQueryId&&this.store[t.fetchMoreForQueryId]&&(this.store[t.fetchMoreForQueryId].networkStatus=e.NetworkStatus.fetchMore)},t.prototype.markQueryResult=function(t,r,n){this.store[t]&&(this.store[t].networkError=null,this.store[t].graphQLErrors=r.errors&&r.errors.length?r.errors:[],this.store[t].previousVariables=null,this.store[t].networkStatus=e.NetworkStatus.ready,"string"==typeof n&&this.store[n]&&(this.store[n].networkStatus=e.NetworkStatus.ready))},t.prototype.markQueryError=function(t,r,n){this.store[t]&&(this.store[t].networkError=r,this.store[t].networkStatus=e.NetworkStatus.error,"string"==typeof n&&this.markQueryResultClient(n,!0))},t.prototype.markQueryResultClient=function(t,r){this.store[t]&&(this.store[t].networkError=null,this.store[t].previousVariables=null,this.store[t].networkStatus=r?e.NetworkStatus.ready:e.NetworkStatus.loading)},t.prototype.stopQuery=function(e){delete this.store[e]},t.prototype.reset=function(t){var r=this;this.store=Object.keys(this.store).filter(function(e){return t.indexOf(e)>-1}).reduce(function(t,n){return t[n]=_({},r.store[n],{networkStatus:e.NetworkStatus.loading}),t},{})},t}(),w=function(){return(w=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},S=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((n=n.apply(e,t||[])).next())})},T=function(e,t){function r(e){return function(t){return n([e,t])}}function n(r){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(a=2&r[0]?o.return:r[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,r[1])).done)return a;switch(o=0,a&&(r=[2&r[0],a.value]),r[0]){case 0:case 1:a=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,o=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(a=u.trys,!(a=a.length>0&&a[a.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!a||r[1]>a[0]&&r[1]<a[3])){u.label=r[1];break}if(6===r[0]&&u.label<a[1]){u.label=a[1],a=r;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(r);break}a[2]&&u.ops.pop(),u.trys.pop();continue}r=t.call(e,u)}catch(e){r=[6,e],o=0}finally{i=a=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var i,o,a,s,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s},E={listeners:[],invalidated:!1,document:null,newData:null,lastRequestId:null,observableQuery:null,subscriptions:[]},O=function(){function r(e){var r=e.link,n=e.queryDeduplication,i=void 0!==n&&n,a=e.store,s=e.onBroadcast,u=void 0===s?function(){}:s,c=e.ssrMode,l=void 0!==c&&c;this.mutationStore=new b,this.queryStore=new x,this.idCounter=1,this.queries=new Map,this.fetchQueryPromises=new Map,this.queryIdsByName={},this.link=r,this.deduplicator=t.ApolloLink.from([new o.DedupLink,r]),this.queryDeduplication=i,this.dataStore=a,this.onBroadcast=u,this.scheduler=new g({queryManager:this,ssrMode:l})}return r.prototype.mutate=function(e){var r=this,o=e.mutation,a=e.variables,s=e.optimisticResponse,u=e.updateQueries,c=e.refetchQueries,l=void 0===c?[]:c,h=e.awaitRefetchQueries,f=void 0!==h&&h,d=e.update,m=e.errorPolicy,v=void 0===m?"none":m,y=e.fetchPolicy,g=e.context,b=void 0===g?{}:g;if(!o)throw new Error("mutation option is required. You must specify your GraphQL document in the mutation option.");if(y&&"no-cache"!==y)throw new Error("fetchPolicy for mutations currently only supports the 'no-cache' policy");var _=this.generateQueryId(),x=this.dataStore.getCache();o=x.transformDocument(o),a=n.assign({},n.getDefaultValues(n.getMutationDefinition(o)),a);var E=i.print(o);this.setQuery(_,function(){return{document:o}});var O=function(){var e={};return u&&Object.keys(u).forEach(function(t){return(r.queryIdsByName[t]||[]).forEach(function(n){e[n]={updater:u[t],query:r.queryStore.get(n)}})}),e};return this.mutationStore.initMutation(_,E,a),this.dataStore.markMutationInit({mutationId:_,document:o,variables:a||{},updateQueries:O(),update:d,optimisticResponse:s}),this.broadcastQueries(),new Promise(function(e,i){var u,c,h=r.buildOperationForLink(o,a,w({},b,{optimisticResponse:s})),m=function(){return S(r,void 0,void 0,function(){var e,t,r,i,o,a;return T(this,function(h){switch(h.label){case 0:if(c&&this.mutationStore.markMutationError(_,c),this.dataStore.markMutationComplete({mutationId:_,optimisticResponse:s}),this.broadcastQueries(),c)throw c;for("function"==typeof l&&(l=l(u)),e=[],t=0,r=l;t<r.length;t++)"string"!=typeof(i=r[t])?(a={query:i.query,variables:i.variables,fetchPolicy:"network-only"},i.context&&(a.context=i.context),e.push(this.query(a))):(o=this.refetchQueryByName(i))&&e.push(o);return f?[4,Promise.all(e)]:[3,2];case 1:h.sent(),h.label=2;case 2:return this.setQuery(_,function(){return{document:void 0}}),"ignore"===v&&u&&n.graphQLResultHasError(u)&&delete u.errors,[2,u]}})})};t.execute(r.link,h).subscribe({next:function(e){n.graphQLResultHasError(e)&&"none"===v?c=new p({graphQLErrors:e.errors}):(r.mutationStore.markMutationResult(_),"no-cache"!==y&&r.dataStore.markMutationResult({mutationId:_,result:e,document:o,variables:a||{},updateQueries:O(),update:d}),u=e)},error:function(e){r.mutationStore.markMutationError(_,e),r.dataStore.markMutationComplete({mutationId:_,optimisticResponse:s}),r.broadcastQueries(),r.setQuery(_,function(){return{document:void 0}}),i(new p({networkError:e}))},complete:function(){return m().then(e,i)}})})},r.prototype.fetchQuery=function(t,r,i,o){var a,u=this,c=r.variables,l=void 0===c?{}:c,h=r.metadata,f=void 0===h?null:h,d=r.fetchPolicy,m=void 0===d?"cache-first":d,v=this.dataStore.getCache().transformDocument(r.query),y="network-only"===m||"no-cache"===m;if(i!==e.FetchType.refetch&&"network-only"!==m&&"no-cache"!==m){var g=this.dataStore.getCache().diff({query:v,variables:l,returnPartialData:!0,optimistic:!1}),b=g.complete,_=g.result;y=!b||"cache-and-network"===m,a=_}var x=y&&"cache-only"!==m&&"standby"!==m;n.hasDirectives(["live"],v)&&(x=!0);var w=this.generateRequestId(),S=this.updateQueryWatch(t,v,r);if(this.setQuery(t,function(){return{document:v,lastRequestId:w,invalidated:!0,cancel:S}}),this.invalidate(!0,o),this.queryStore.initQuery({queryId:t,document:v,storePreviousVariables:x,variables:l,isPoll:i===e.FetchType.poll,isRefetch:i===e.FetchType.refetch,metadata:f,fetchMoreForQueryId:o}),this.broadcastQueries(),(!x||"cache-and-network"===m)&&(this.queryStore.markQueryResultClient(t,!x),this.invalidate(!0,t,o),this.broadcastQueries()),x){var T=this.fetchRequest({requestId:w,queryId:t,document:v,options:r,fetchMoreForQueryId:o}).catch(function(e){if(s(e))throw e;var r=u.getQuery(t).lastRequestId;throw w>=(r||1)&&(u.queryStore.markQueryError(t,e,o),u.invalidate(!0,t,o),u.broadcastQueries()),u.removeFetchQueryPromise(w),new p({networkError:e})});if("cache-and-network"!==m)return T;T.catch(function(){})}return Promise.resolve({data:a})},r.prototype.queryListenerForObserver=function(e,t,r){var o=this,s=!1;return function(u,c){if(o.invalidate(!1,e),u){var l=o.getQuery(e).observableQuery,h=l?l.options.fetchPolicy:t.fetchPolicy;if("standby"!==h){var f=l?l.options.errorPolicy:t.errorPolicy,d=l?l.getLastResult():null,m=l?l.getLastError():null,v=!c&&null!=u.previousVariables||"cache-only"===h||"cache-and-network"===h,y=Boolean(d&&u.networkStatus!==d.networkStatus),g=f&&(m&&m.graphQLErrors)!==u.graphQLErrors&&"none"!==f;if(!a(u.networkStatus)||y&&t.notifyOnNetworkStatusChange||v){if((!f||"none"===f)&&u.graphQLErrors&&u.graphQLErrors.length>0||u.networkError){var b=new p({graphQLErrors:u.graphQLErrors,networkError:u.networkError});if(s=!0,r.error)try{r.error(b)}catch(e){setTimeout(function(){throw e},0)}else setTimeout(function(){throw b},0),n.isProduction()||console.info("An unhandled error was thrown because no error handler is registered for the query "+i.print(u.document));return}try{var _=void 0,x=void 0;if(c)"no-cache"!==h&&o.setQuery(e,function(){return{newData:null}}),_=c.result,x=!c.complete||!1;else if(d&&d.data&&!g)_=d.data,x=!1;else{var w=o.getQuery(e).document,S=o.dataStore.getCache().diff({query:w,variables:u.previousVariables||u.variables,optimistic:!0});_=S.result,x=!S.complete}var T=void 0;if(T=x&&"cache-only"!==h?{data:d&&d.data,loading:a(u.networkStatus),networkStatus:u.networkStatus,stale:!0}:{data:_,loading:a(u.networkStatus),networkStatus:u.networkStatus,stale:!1},"all"===f&&u.graphQLErrors&&u.graphQLErrors.length>0&&(T.errors=u.graphQLErrors),r.next&&(!(d&&T&&d.networkStatus===T.networkStatus&&d.stale===T.stale&&d.data===T.data)||s))try{r.next(T)}catch(e){setTimeout(function(){throw e},0)}s=!1}catch(e){return s=!0,void(r.error&&r.error(new p({networkError:e})))}}}}}},r.prototype.watchQuery=function(e,t){if(void 0===t&&(t=!0),"standby"===e.fetchPolicy)throw new Error('client.watchQuery cannot be called with fetchPolicy set to "standby"');var r=n.getQueryDefinition(e.query);if(r.variableDefinitions&&r.variableDefinitions.length){var i=n.getDefaultValues(r);e.variables=n.assign({},i,e.variables)}void 0===e.notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var o=w({},e);return new v({scheduler:this.scheduler,options:o,shouldSubscribe:t})},r.prototype.query=function(e){var t=this;if(!e.query)throw new Error("query option is required. You must specify your GraphQL document in the query option.");if("Document"!==e.query.kind)throw new Error('You must wrap the query string in a "gql" tag.');if(e.returnPartialData)throw new Error("returnPartialData option only supported on watchQuery.");if(e.pollInterval)throw new Error("pollInterval option only supported on watchQuery.");var r=this.idCounter;return new Promise(function(n,i){return t.addFetchQueryPromise(r,n,i),t.watchQuery(e,!1).result().then(function(e){t.removeFetchQueryPromise(r),n(e)}).catch(function(e){t.removeFetchQueryPromise(r),i(e)})})},r.prototype.generateQueryId=function(){var e=this.idCounter.toString();return this.idCounter++,e},r.prototype.stopQueryInStore=function(e){this.queryStore.stopQuery(e),this.invalidate(!0,e),this.broadcastQueries()},r.prototype.addQueryListener=function(e,t){this.setQuery(e,function(e){var r=e.listeners;return{listeners:(void 0===r?[]:r).concat([t]),invalidate:!1}})},r.prototype.updateQueryWatch=function(e,t,r){var n=this,i=this.getQuery(e).cancel;i&&i();return this.dataStore.getCache().watch({query:t,variables:r.variables,optimistic:!0,previousResult:function(){var t=null,r=n.getQuery(e).observableQuery;if(r){var i=r.getLastResult();i&&(t=i.data)}return t},callback:function(t){n.setQuery(e,function(){return{invalidated:!0,newData:t}})}})},r.prototype.addFetchQueryPromise=function(e,t,r){this.fetchQueryPromises.set(e.toString(),{resolve:t,reject:r})},r.prototype.removeFetchQueryPromise=function(e){this.fetchQueryPromises.delete(e.toString())},r.prototype.addObservableQuery=function(e,t){this.setQuery(e,function(){return{observableQuery:t}});var r=n.getQueryDefinition(t.options.query);if(r.name&&r.name.value){var i=r.name.value;this.queryIdsByName[i]=this.queryIdsByName[i]||[],this.queryIdsByName[i].push(t.queryId)}},r.prototype.removeObservableQuery=function(e){var t=this.getQuery(e),r=t.observableQuery,i=t.cancel;if(i&&i(),r){var o=n.getQueryDefinition(r.options.query),a=o.name?o.name.value:null;this.setQuery(e,function(){return{observableQuery:null}}),a&&(this.queryIdsByName[a]=this.queryIdsByName[a].filter(function(e){return!(r.queryId===e)}))}},r.prototype.clearStore=function(){this.fetchQueryPromises.forEach(function(e){(0,e.reject)(new Error("Store reset while query was in flight(not completed in link chain)"))});var e=[];return this.queries.forEach(function(t,r){t.observableQuery&&e.push(r)}),this.queryStore.reset(e),this.mutationStore.reset(),this.dataStore.reset()},r.prototype.resetStore=function(){var e=this;return this.clearStore().then(function(){return e.reFetchObservableQueries()})},r.prototype.reFetchObservableQueries=function(e){var t=this.getObservableQueryPromises(e);return this.broadcastQueries(),Promise.all(t)},r.prototype.startQuery=function(e,t,r){return this.addQueryListener(e,r),this.fetchQuery(e,t).catch(function(){}),e},r.prototype.startGraphQLSubscription=function(e){var r,i=this,o=e.query,a=!(e.fetchPolicy&&"no-cache"===e.fetchPolicy),s=this.dataStore.getCache().transformDocument(o),u=n.assign({},n.getDefaultValues(n.getOperationDefinition(o)),e.variables),l=[];return new c(function(e){if(l.push(e),1===l.length){var o={next:function(e){a&&(i.dataStore.markSubscriptionResult(e,s,u),i.broadcastQueries()),l.forEach(function(t){n.graphQLResultHasError(e)&&t.error?t.error(new p({graphQLErrors:e.errors})):t.next&&t.next(e)})},error:function(e){l.forEach(function(t){t.error&&t.error(e)})}},c=i.buildOperationForLink(s,u);r=t.execute(i.link,c).subscribe(o)}return function(){0===(l=l.filter(function(t){return t!==e})).length&&r&&r.unsubscribe()}})},r.prototype.stopQuery=function(e){this.stopQueryInStore(e),this.removeQuery(e)},r.prototype.removeQuery=function(e){this.getQuery(e).subscriptions.forEach(function(e){return e.unsubscribe()}),this.queries.delete(e)},r.prototype.getCurrentQueryResult=function(e,t){void 0===t&&(t=!0);var r=e.options,n=r.variables,i=r.query,o=e.getLastResult(),a=this.getQuery(e.queryId).newData;if(a)return{data:a.result,partial:!1};try{return{data:this.dataStore.getCache().read({query:i,variables:n,previousResult:o?o.data:void 0,optimistic:t}),partial:!1}}catch(e){return{data:{},partial:!0}}},r.prototype.getQueryWithPreviousResult=function(e){var t;if("string"==typeof e){var r=this.getQuery(e).observableQuery;if(!r)throw new Error("ObservableQuery with this id doesn't exist: "+e);t=r}else t=e;var n=t.options,i=n.variables,o=n.query;return{previousResult:this.getCurrentQueryResult(t,!1).data,variables:i,document:o}},r.prototype.broadcastQueries=function(){var e=this;this.onBroadcast(),this.queries.forEach(function(t,r){t.invalidated&&t.listeners&&t.listeners.filter(function(e){return!!e}).forEach(function(n){n(e.queryStore.get(r),t.newData)})})},r.prototype.getObservableQueryPromises=function(e){var t=this,r=[];return this.queries.forEach(function(n,i){var o=n.observableQuery;if(o){var a=o.options.fetchPolicy;o.resetLastResults(),"cache-only"===a||!e&&"standby"===a||r.push(o.refetch()),t.setQuery(i,function(){return{newData:null}}),t.invalidate(!0,i)}}),r},r.prototype.fetchRequest=function(r){var n,i,o=this,a=r.requestId,s=r.queryId,u=r.document,c=r.options,l=r.fetchMoreForQueryId,h=c.variables,f=c.context,d=c.errorPolicy,m=void 0===d?"none":d,v=c.fetchPolicy,y=this.buildOperationForLink(u,h,w({},f,{forceFetch:!this.queryDeduplication}));return new Promise(function(r,c){o.addFetchQueryPromise(a,r,c);var f=t.execute(o.deduplicator,y).subscribe({next:function(e){var t=o.getQuery(s).lastRequestId;if(a>=(t||1)){if("no-cache"!==v)try{o.dataStore.markQueryResult(e,u,h,l,"ignore"===m||"all"===m)}catch(e){return void c(e)}else o.setQuery(s,function(){return{newData:{result:e.data,complete:!0}}});o.queryStore.markQueryResult(s,e,l),o.invalidate(!0,s,l),o.broadcastQueries()}if(e.errors&&"none"===m)c(new p({graphQLErrors:e.errors}));else if("all"===m&&(i=e.errors),l||"no-cache"===v)n=e.data;else try{n=o.dataStore.getCache().read({variables:h,query:u,optimistic:!1})}catch(e){}},error:function(e){o.removeFetchQueryPromise(a),o.setQuery(s,function(e){return{subscriptions:e.subscriptions.filter(function(e){return e!==f})}}),c(e)},complete:function(){o.removeFetchQueryPromise(a),o.setQuery(s,function(e){return{subscriptions:e.subscriptions.filter(function(e){return e!==f})}}),r({data:n,errors:i,loading:!1,networkStatus:e.NetworkStatus.ready,stale:!1})}});o.setQuery(s,function(e){return{subscriptions:e.subscriptions.concat([f])}})})},r.prototype.refetchQueryByName=function(e){var t=this,r=this.queryIdsByName[e];if(void 0!==r)return Promise.all(r.map(function(e){return t.getQuery(e).observableQuery}).filter(function(e){return!!e}).map(function(e){return e.refetch()}))},r.prototype.generateRequestId=function(){var e=this.idCounter;return this.idCounter++,e},r.prototype.getQuery=function(e){return this.queries.get(e)||w({},E)},r.prototype.setQuery=function(e,t){var r=this.getQuery(e),n=w({},r,t(r));this.queries.set(e,n)},r.prototype.invalidate=function(e,t,r){t&&this.setQuery(t,function(){return{invalidated:e}}),r&&this.setQuery(r,function(){return{invalidated:e}})},r.prototype.buildOperationForLink=function(e,t,r){var i=this.dataStore.getCache();return{query:i.transformForLink?i.transformForLink(e):e,variables:t,operationName:n.getOperationName(e)||void 0,context:w({},r,{cache:i,getCacheKey:function(e){if(i.config)return i.config.dataIdFromObject(e);throw new Error("To use context.getCacheKey, you need to use a cache that has a configurable dataIdFromObject, like apollo-cache-inmemory.")}})}},r}(),M=function(){function e(e){this.cache=e}return e.prototype.getCache=function(){return this.cache},e.prototype.markQueryResult=function(e,t,r,i,o){void 0===o&&(o=!1);var a=!n.graphQLResultHasError(e);o&&n.graphQLResultHasError(e)&&e.data&&(a=!0),!i&&a&&this.cache.write({result:e.data,dataId:"ROOT_QUERY",query:t,variables:r})},e.prototype.markSubscriptionResult=function(e,t,r){n.graphQLResultHasError(e)||this.cache.write({result:e.data,dataId:"ROOT_SUBSCRIPTION",query:t,variables:r})},e.prototype.markMutationInit=function(e){var t=this;if(e.optimisticResponse){var r;r="function"==typeof e.optimisticResponse?e.optimisticResponse(e.variables):e.optimisticResponse;var n=function(){t.markMutationResult({mutationId:e.mutationId,result:{data:r},document:e.document,variables:e.variables,updateQueries:e.updateQueries,update:e.update})};this.cache.recordOptimisticTransaction(function(e){var r=t.cache;t.cache=e;try{n()}finally{t.cache=r}},e.mutationId)}},e.prototype.markMutationResult=function(e){var t=this;if(!n.graphQLResultHasError(e.result)){var r=[];r.push({result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),e.updateQueries&&Object.keys(e.updateQueries).filter(function(t){return e.updateQueries[t]}).forEach(function(i){var o=e.updateQueries[i],a=o.query,s=o.updater,u=t.cache.diff({query:a.document,variables:a.variables,returnPartialData:!0,optimistic:!1}),c=u.result;if(u.complete){var l=n.tryFunctionOrLogError(function(){return s(c,{mutationResult:e.result,queryName:n.getOperationName(a.document)||void 0,queryVariables:a.variables})});l&&r.push({result:l,dataId:"ROOT_QUERY",query:a.document,variables:a.variables})}}),this.cache.performTransaction(function(e){r.forEach(function(t){return e.write(t)})});var i=e.update;i&&this.cache.performTransaction(function(t){n.tryFunctionOrLogError(function(){return i(t,e.result)})})}},e.prototype.markMutationComplete=function(e){var t=e.mutationId;e.optimisticResponse&&this.cache.removeOptimistic(t)},e.prototype.markUpdateQueryResult=function(e,t,r){this.cache.write({result:r,dataId:"ROOT_QUERY",variables:t,query:e})},e.prototype.reset=function(){return this.cache.reset()},e}(),C="2.4.2",j=function(){return(j=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},P=!1,A=new t.ApolloLink(function(e,t){return e.query=n.removeConnectionDirectiveFromDocument(e.query),t(e)}),N=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[];var r=e.link,i=e.cache,o=e.ssrMode,a=void 0!==o&&o,s=e.ssrForceFetchDelay,u=void 0===s?0:s,c=e.connectToDevTools,l=e.queryDeduplication,h=void 0===l||l,p=e.defaultOptions;if(!r||!i)throw new Error("\n In order to initialize Apollo Client, you must specify link & cache properties on the config object.\n This is part of the required upgrade when migrating from Apollo Client 1.0 to Apollo Client 2.0.\n For more information, please visit:\n https://www.apollographql.com/docs/react/basics/setup.html\n to help you get started.\n ");this.link=A.concat(r),this.cache=i,this.store=new M(i),this.disableNetworkFetches=a||u>0,this.queryDeduplication=h,this.ssrMode=a,this.defaultOptions=p||{},u&&setTimeout(function(){return t.disableNetworkFetches=!1},u),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this);var f=!n.isProduction()&&"undefined"!=typeof window&&!window.__APOLLO_CLIENT__;(void 0===c?f:c&&"undefined"!=typeof window)&&(window.__APOLLO_CLIENT__=this),P||n.isProduction()||(P=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&void 0===window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__&&window.navigator&&window.navigator.userAgent.indexOf("Chrome")>-1&&console.debug("Download the Apollo DevTools for a better development experience: https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm")),this.version=C}return e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=j({},this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=j({},e,{fetchPolicy:"cache-first"})),this.initQueryManager().watchQuery(e)},e.prototype.query=function(e){if(this.defaultOptions.query&&(e=j({},this.defaultOptions.query,e)),"cache-and-network"===e.fetchPolicy)throw new Error("cache-and-network fetchPolicy can only be used with watchQuery");return this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=j({},e,{fetchPolicy:"cache-first"})),this.initQueryManager().query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=j({},this.defaultOptions.mutate,e)),this.initQueryManager().mutate(e)},e.prototype.subscribe=function(e){return this.initQueryManager().startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.initProxy().readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.initProxy().readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.initProxy().writeQuery(e);return this.initQueryManager().broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.initProxy().writeFragment(e);return this.initQueryManager().broadcastQueries(),t},e.prototype.writeData=function(e){var t=this.initProxy().writeData(e);return this.initQueryManager().broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return t.execute(this.link,e)},e.prototype.initQueryManager=function(){var e=this;return this.queryManager||(this.queryManager=new O({link:this.link,store:this.store,queryDeduplication:this.queryDeduplication,ssrMode:this.ssrMode,onBroadcast:function(){e.devToolsHookCb&&e.devToolsHookCb({action:{},state:{queries:e.queryManager?e.queryManager.queryStore.getStore():{},mutations:e.queryManager?e.queryManager.mutationStore.getStore():{}},dataWithOptimisticResults:e.cache.extract(!0)})}})),this.queryManager},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager?e.queryManager.clearStore():Promise.resolve(null)}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(e){return e()}))}).then(function(){return e.queryManager&&e.queryManager.reFetchObservableQueries?e.queryManager.reFetchObservableQueries():Promise.resolve(null)})},e.prototype.clearStore=function(){var e=this.queryManager;return Promise.resolve().then(function(){return e?e.clearStore():Promise.resolve(null)})},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager?this.queryManager.reFetchObservableQueries(e):Promise.resolve(null)},e.prototype.extract=function(e){return this.initProxy().extract(e)},e.prototype.restore=function(e){return this.initProxy().restore(e)},e.prototype.initProxy=function(){return this.proxy||(this.initQueryManager(),this.proxy=this.cache),this.proxy},e}();e.printAST=i.print,e.ApolloClient=N,e.default=N,e.ObservableQuery=v,e.ApolloError=p,Object.defineProperty(e,"__esModule",{value:!0})})},{"apollo-link":12,"apollo-link-dedup":7,"apollo-utilities":13,"graphql/language/printer":71,"symbol-observable":308}],7:[function(e,t,r){!function(n,i){"object"==typeof r&&void 0!==t?i(r,e("apollo-link")):i((n.apolloLink=n.apolloLink||{},n.apolloLink.dedup={}),n.apolloLink.core)}(this,function(e,t){"use strict";var r=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),n=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.inFlightRequestObservables=new Map,t.subscribers=new Map,t}return r(n,e),n.prototype.request=function(e,r){var n=this;if(e.getContext().forceFetch)return r(e);var i=e.toKey(),o=function(e){return n.inFlightRequestObservables.delete(e),n.subscribers.get(e)};if(!this.inFlightRequestObservables.get(i)){var a,s=r(e),u=new t.Observable(function(e){var t=n.subscribers.get(i);return t||(t={next:[],error:[],complete:[]}),n.subscribers.set(i,{next:t.next.concat([e.next.bind(e)]),error:t.error.concat([e.error.bind(e)]),complete:t.complete.concat([e.complete.bind(e)])}),a||(a=s.subscribe({next:function(e){var t=o(i);n.subscribers.delete(i),t&&(t.next.forEach(function(t){return t(e)}),t.complete.forEach(function(e){return e()}))},error:function(e){var t=o(i);n.subscribers.delete(i),t&&t.error.forEach(function(t){return t(e)})}})),function(){a&&a.unsubscribe(),n.inFlightRequestObservables.delete(i)}});this.inFlightRequestObservables.set(i,u)}return this.inFlightRequestObservables.get(i)},n}(t.ApolloLink);e.DedupLink=n,Object.defineProperty(e,"__esModule",{value:!0})})},{"apollo-link":12}],8:[function(e,t,r){!function(n,i){"object"==typeof r&&void 0!==t?i(r,e("apollo-link")):i((n.apolloLink=n.apolloLink||{},n.apolloLink.error={}),n.apolloLink.core)}(this,function(e,t){"use strict";var r=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),n=function(e){return new t.ApolloLink(function(r,n){return new t.Observable(function(t){var i,o,a;try{i=n(r).subscribe({next:function(i){i.errors&&(a=e({graphQLErrors:i.errors,response:i,operation:r,forward:n}))?o=a.subscribe({next:t.next.bind(t),error:t.error.bind(t),complete:t.complete.bind(t)}):t.next(i)},error:function(i){(a=e({operation:r,networkError:i,graphQLErrors:i.result&&i.result.errors,forward:n}))?o=a.subscribe({next:t.next.bind(t),error:t.error.bind(t),complete:t.complete.bind(t)}):t.error(i)},complete:function(){a||t.complete.bind(t)()}})}catch(i){e({networkError:i,operation:r,forward:n}),t.error(i)}return function(){i&&i.unsubscribe(),o&&i.unsubscribe()}})})},i=function(e){function t(t){var r=e.call(this)||this;return r.link=n(t),r}return r(t,e),t.prototype.request=function(e,t){return this.link.request(e,t)},t}(t.ApolloLink);e.onError=n,e.ErrorLink=i,Object.defineProperty(e,"__esModule",{value:!0})})},{"apollo-link":12}],9:[function(e,t,r){!function(n,i){"object"==typeof r&&void 0!==t?i(r,e("graphql/language/printer")):i((n.apolloLink=n.apolloLink||{},n.apolloLink.httpCommon={}),n.printer)}(this,function(e,t){"use strict";var r=function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},n={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},i=function(e,t,r){var n=new Error(r);throw n.response=e,n.statusCode=e.status,n.result=t,n};e.fallbackHttpConfig=n,e.throwServerError=i,e.parseAndCheckHttpResponse=function(e){return function(t){return t.text().then(function(e){try{return JSON.parse(e)}catch(n){var r=n;return r.response=t,r.statusCode=t.status,r.bodyText=e,Promise.reject(r)}}).then(function(r){return t.status>=300&&i(t,r,"Response not successful: Received status code "+t.status),Array.isArray(r)||r.hasOwnProperty("data")||r.hasOwnProperty("errors")||i(t,r,"Server response was missing for query '"+(Array.isArray(e)?e.map(function(e){return e.operationName}):e.operationName)+"'."),r})}},e.checkFetcher=function(e){if(!e&&"undefined"==typeof fetch){var t="unfetch";throw"undefined"==typeof window&&(t="node-fetch"),new Error("\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/"+t+".\n\nFor example:\nimport fetch from '"+t+"';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });")}},e.createSignalIfSupported=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}},e.selectHttpOptionsAndBody=function(e,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];var a=r({},n.options,{headers:n.headers,credentials:n.credentials}),s=n.http;i.forEach(function(e){a=r({},a,e.options,{headers:r({},a.headers,e.headers)}),e.credentials&&(a.credentials=e.credentials),s=r({},s,e.http)});var u=e.operationName,c=e.extensions,l=e.variables,h=e.query,p={operationName:u,variables:l};return s.includeExtensions&&(p.extensions=c),s.includeQuery&&(p.query=t.print(h)),{options:a,body:p}},e.serializeFetchParameter=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=new Error("Network request failed. "+t+" is not serializable: "+e.message);throw n.parseError=e,n}return r},e.selectURI=function(e,t){var r=e.getContext().uri;return r||("function"==typeof t?t(e):t||"/graphql")},Object.defineProperty(e,"__esModule",{value:!0})})},{"graphql/language/printer":71}],10:[function(e,t,r){!function(n,i){"object"==typeof r&&void 0!==t?i(r,e("apollo-link"),e("apollo-link-http-common")):i((n.apolloLink=n.apolloLink||{},n.apolloLink.http={}),n.apolloLink.core,n.apolloLink.httpCommon)}(this,function(e,t,r){"use strict";function n(e,t){var n=[],i=function(e,t){n.push(e+"="+encodeURIComponent(t))};if("query"in t&&i("query",t.query),t.operationName&&i("operationName",t.operationName),t.variables){var o=void 0;try{o=r.serializeFetchParameter(t.variables,"Variables map")}catch(e){return{parseError:e}}i("variables",o)}if(t.extensions){var a=void 0;try{a=r.serializeFetchParameter(t.extensions,"Extensions map")}catch(e){return{parseError:e}}i("extensions",a)}var s="",u=e,c=e.indexOf("#");return-1!==c&&(s=e.substr(c),u=e.substr(0,c)),{newURI:u+(-1===u.indexOf("?")?"?":"&")+n.join("&")+s}}var i=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&(r[n[i]]=e[n[i]]);return r},a=function(e){void 0===e&&(e={});var i=e.uri,a=void 0===i?"/graphql":i,s=e.fetch,u=e.includeExtensions,c=e.useGETForQueries,l=o(e,["uri","fetch","includeExtensions","useGETForQueries"]);r.checkFetcher(s),s||(s=fetch);var h={http:{includeExtensions:u},options:l.fetchOptions,credentials:l.credentials,headers:l.headers};return new t.ApolloLink(function(e){var i,o=r.selectURI(e,a),u=e.getContext(),l={http:u.http,options:u.fetchOptions,credentials:u.credentials,headers:u.headers},p=r.selectHttpOptionsAndBody(e,r.fallbackHttpConfig,h,l),f=p.options,d=p.body;if(!f.signal){var m=r.createSignalIfSupported(),v=m.controller,y=m.signal;(i=v)&&(f.signal=y)}if(c&&!e.query.definitions.some(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})&&(f.method="GET"),"GET"===f.method){var g=n(o,d),b=g.newURI,_=g.parseError;if(_)return t.fromError(_);o=b}else try{f.body=r.serializeFetchParameter(d,"Payload")}catch(_){return t.fromError(_)}return new t.Observable(function(t){return s(o,f).then(function(t){return e.setContext({response:t}),t}).then(r.parseAndCheckHttpResponse(e)).then(function(e){return t.next(e),t.complete(),e}).catch(function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e))}),function(){i&&i.abort()}})})},s=function(e){function t(t){return e.call(this,a(t).request)||this}return i(t,e),t}(t.ApolloLink);e.createHttpLink=a,e.HttpLink=s,Object.defineProperty(e,"__esModule",{value:!0})})},{"apollo-link":12,"apollo-link-http-common":9}],11:[function(e,t,r){!function(n,i){"object"==typeof r&&void 0!==t?i(r,e("graphql"),e("apollo-utilities"),e("apollo-link"),e("graphql-anywhere/lib/async")):i((n.apolloLink=n.apolloLink||{},n.apolloLink.state={}),n.graphql,n.apollo.utilities,n.apolloLink.core,n.graphqlAnywhere.async)}(this,function(e,t,r,n,i){"use strict";function o(e){var t=u.get(e);if(t)return t;r.checkDocument(e);var n=r.removeDirectivesFromDocument([s],e);return u.set(e,n),n}function a(e){return(Array.isArray(e)?e:[e]).map(function(e){return"string"==typeof e?e:t.print(e)}).map(function(e){return e.trim()}).join("\n")}var s={test:function(e){return"client"===e.name.value},remove:!0},u=new Map,c=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),l=i.graphql,h=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};e.withClientState=function(e){void 0===e&&(e={resolvers:{},defaults:{}});var t=e.defaults,i=e.cache,s=e.typeDefs,u=e.fragmentMatcher;return i&&t&&i.writeData({data:t}),new(function(p){function f(){return null!==p&&p.apply(this,arguments)||this}return c(f,p),f.prototype.writeDefaults=function(){i&&t&&i.writeData({data:t})},f.prototype.request=function(i,c){if(void 0===c&&(c=function(){return n.Observable.of({data:{}})}),s){var p=a(s);i.setContext(function(e){var t=e.schemas;return{schemas:(void 0===t?[]:t).concat([{definition:p,directives:"directive @client on FIELD"}])}})}if(!r.hasDirectives(["client"],i.query))return c(i);var f="function"==typeof e.resolvers?e.resolvers():e.resolvers,d=o(i.query),m=i.query,v=h((r.getMainDefinition(m)||{}).operation)||"Query",y=function(e,r,n,i,o){void 0===r&&(r={});var a=o.resultKey,s=r[a],u=r[e],c=a!==e;if(void 0!==s||void 0!==u)return s||u;var l=f[r.__typename||v];if(l){var h=l[e];if(h)return h(r,n,i,o)}return(c?s:u)||(t||{})[e]};d&&(i.query=d);var g=d&&c?c(i):n.Observable.of({data:{}});return new n.Observable(function(e){var t=!1,r=!1;g.subscribe({next:function(n){var o=n.data,a=n.errors,s=e.error.bind(e),c=i.getContext();r=!0,l(y,m,o,c,i.variables,{fragmentMatcher:u}).then(function(n){e.next({data:n,errors:a}),t&&e.complete(),r=!1}).catch(s)},error:e.error.bind(e),complete:function(){r||e.complete(),t=!0}})})},f}(n.ApolloLink))},Object.defineProperty(e,"__esModule",{value:!0})})},{"apollo-link":12,"apollo-utilities":13,graphql:42,"graphql-anywhere/lib/async":30}],12:[function(e,t,r){!function(n,i){"object"==typeof r&&void 0!==t?i(r,e("apollo-utilities"),e("zen-observable-ts"),e("graphql/language/printer")):i((n.apolloLink=n.apolloLink||{},n.apolloLink.core={}),n.apollo.utilities,n.apolloLink.zenObservable,n.printer)}(this,function(e,t,r,n){"use strict";function i(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw new Error("illegal argument: "+i)}return e}function o(e){return e.request.length<=1}function a(e){var t=!1;return new Promise(function(r,n){e.subscribe({next:function(e){t?console.warn("Promise Wrapper does not support multiple results from Observable"):(t=!0,r(e))},error:n})})}function s(e){var r={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return r.operationName||(r.operationName="string"!=typeof r.query?t.getOperationName(r.query):""),r}function u(e,t){var r=p({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){r="function"==typeof e?p({},r,e(r)):p({},r,e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return p({},r)}}),Object.defineProperty(t,"toKey",{enumerable:!1,value:function(){return c(t)}}),t}function c(e){return n.print(e.query)+"|"+JSON.stringify(e.variables)+"|"+e.operationName}function l(e,t){return e.request(u(t.context,s(i(t))))||r.of()}r=r&&r.hasOwnProperty("default")?r.default:r;var h=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),p=function(){return(p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},f=function(e){function t(t,r){var n=e.call(this,t)||this;return n.link=r,n}return h(t,e),t}(Error),d=a,m=function(e,t){return t?t(e):r.of()},v=function(e){return"function"==typeof e?new x(e):e},y=function(){return new x(function(e,t){return r.of()})},g=function(e){return 0===e.length?y():e.map(v).reduce(function(e,t){return e.concat(t)})},b=function(e,t,n){void 0===n&&(n=new x(m));var i=v(t),a=v(n);return new x(o(i)&&o(a)?function(t){return e(t)?i.request(t)||r.of():a.request(t)||r.of()}:function(t,n){return e(t)?i.request(t,n)||r.of():a.request(t,n)||r.of()})},_=function(e,t){var n=v(e);if(o(n))return console.warn(new f("You are calling concat on a terminating link, which will have no effect",n)),n;var i=v(t);return new x(o(i)?function(e){return n.request(e,function(e){return i.request(e)||r.of()})||r.of()}:function(e,t){return n.request(e,function(e){return i.request(e,t)||r.of()})||r.of()})},x=function(){function e(e){e&&(this.request=e)}return e.prototype.split=function(t,r,n){return void 0===n&&(n=new e(m)),this.concat(b(t,r,n))},e.prototype.concat=function(e){return _(this,e)},e.prototype.request=function(e,t){throw new Error("request is not implemented")},e.empty=y,e.from=g,e.split=b,e.execute=l,e}();e.Observable=r,e.createOperation=u,e.makePromise=d,e.toPromise=a,e.fromPromise=function(e){return new r(function(t){e.then(function(e){t.next(e),t.complete()}).catch(t.error.bind(t))})},e.fromError=function(e){return new r(function(t){t.error(e)})},e.empty=y,e.from=g,e.split=b,e.concat=_,e.ApolloLink=x,e.execute=l,Object.defineProperty(e,"__esModule",{value:!0})})},{"apollo-utilities":13,"graphql/language/printer":71,"zen-observable-ts":360}],13:[function(e,t,r){(function(n){!function(n,i){"object"==typeof r&&void 0!==t?i(r,e("fast-json-stable-stringify"),e("fclone")):i((n.apollo=n.apollo||{},n.apollo.utilities={}),n.stringify,n.fclone)}(this,function(e,t,r){"use strict";function i(e){return"StringValue"===e.kind}function o(e){return"BooleanValue"===e.kind}function a(e){return"IntValue"===e.kind}function s(e){return"FloatValue"===e.kind}function u(e){return"Variable"===e.kind}function c(e){return"ObjectValue"===e.kind}function l(e){return"ListValue"===e.kind}function h(e){return"EnumValue"===e.kind}function p(e){return"NullValue"===e.kind}function f(e,t,r,n){if(a(r)||s(r))e[t.value]=Number(r.value);else if(o(r)||i(r))e[t.value]=r.value;else if(c(r)){var d={};r.fields.map(function(e){return f(d,e.name,e.value,n)}),e[t.value]=d}else if(u(r)){var m=(n||{})[r.name.value];e[t.value]=m}else if(l(r))e[t.value]=r.values.map(function(e){var r={};return f(r,t,e,n),r[t.value]});else if(h(r))e[t.value]=r.value;else{if(!p(r))throw new Error('The inline argument "'+t.value+'" of kind "'+r.kind+'"is not supported. Use variables instead of inline arguments to overcome this limitation.');e[t.value]=null}}function d(e,r,n){if(n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){var i=n.connection.filter?n.connection.filter:[];i.sort();var o=r,a={};return i.forEach(function(e){a[e]=o[e]}),n.connection.key+"("+JSON.stringify(a)+")"}return n.connection.key}var s=e;if(r){var u=t(r);s+="("+u+")"}return n&&Object.keys(n).forEach(function(e){-1===z.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?s+="@"+e+"("+JSON.stringify(n[e])+")":s+="@"+e)}),s}function m(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach(function(e){var n=e.name,i=e.value;return f(r,n,i,t)}),r}return null}function v(e){throw new Error("Variable nodes are not supported by valueFromNode")}function y(e,t){switch(void 0===t&&(t=v),e.kind){case"Variable":return t(e);case"NullValue":return null;case"IntValue":return parseInt(e.value,10);case"FloatValue":return parseFloat(e.value);case"ListValue":return e.values.map(function(e){return y(e,t)});case"ObjectValue":for(var r={},n=0,i=e.fields;n<i.length;n++){var o=i[n];r[o.name.value]=y(o.value,t)}return r;default:return e.value}}function g(e){return e.selectionSet&&e.selectionSet.selections.length>0?[e].concat(e.selectionSet.selections.map(function(e){return[e].concat(g(e))}).reduce(function(e,t){return e.concat(t)},[])):[e]}function b(e){return e.definitions.filter(function(e){return e.selectionSet&&e.selectionSet.selections}).map(function(e){return g(e)}).reduce(function(e,t){return e.concat(t)},[]).filter(function(e){return e.directives&&e.directives.length>0}).map(function(e){return e.directives}).reduce(function(e,t){return e.concat(t)},[]).map(function(e){return e.name.value})}function _(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.forEach(function(t){void 0!==t&&null!==t&&Object.keys(t).forEach(function(r){e[r]=t[r]})}),e}function x(e){if("Document"!==e.kind)throw new Error('Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql');var t=e.definitions.filter(function(e){return"FragmentDefinition"!==e.kind}).map(function(e){if("OperationDefinition"!==e.kind)throw new Error('Schema type definitions not allowed in queries. Found: "'+e.kind+'"');return e});if(t.length>1)throw new Error("Ambiguous GraphQL document: contains "+t.length+" operations")}function w(e){return x(e),e.definitions.filter(function(e){return"OperationDefinition"===e.kind})[0]}function S(e){var t=w(e);if(!t)throw new Error("GraphQL document is missing an operation");return t}function T(e){return e.definitions.filter(function(e){return"FragmentDefinition"===e.kind})}function E(e){void 0===e&&(e=[]);var t={};return e.forEach(function(e){t[e.name.value]=e}),t}function O(e){return r(e)}function M(e,t){return e.selectionSet.selections.filter(function(e){return!(e&&"FragmentSpread"===e.kind&&!M(t[e.name.value],t))}).length>0}function C(e){return function(t){return e.some(function(e){return!(!e.name||e.name!==t.name.value)||!(!e.test||!e.test(t))})}}function j(e,t){void 0===t&&(t=!1),e.selections&&(t||e.selections.some(function(e){return"Field"===e.kind&&"__typename"===e.name.value})||e.selections.push($),e.selections.forEach(function(e){"Field"===e.kind?0!==e.name.value.lastIndexOf("__",0)&&e.selectionSet&&j(e.selectionSet):"InlineFragment"===e.kind&&e.selectionSet&&j(e.selectionSet)}))}function P(e,t){if(!t.selections)return t;var r=e.some(function(e){return e.remove});return t.selections=t.selections.map(function(t){if("Field"!==t.kind||!t||!t.directives)return t;var n,i=C(e);return t.directives=t.directives.filter(function(e){var t=!i(e);return n||t||!r||(n=!0),t}),n?null:t}).filter(function(e){return!!e}),t.selections.forEach(function(t){"Field"!==t.kind&&"InlineFragment"!==t.kind||!t.selectionSet||P(e,t.selectionSet)}),t}function A(e,t){var r=O(t);return r.definitions.forEach(function(t){P(e,t.selectionSet)}),M(S(r),E(T(r)))?r:null}function N(e,t,r){return void 0===r&&(r=!0),!(!t||!t.selections)&&t.selections.filter(function(t){return L(e,t,r)}).length>0}function L(e,t,r){if(void 0===r&&(r=!0),"Field"!==t.kind||!t)return!0;if(!t.directives)return!1;var n=C(e);return t.directives.filter(n).length>0||r&&N(e,t.selectionSet,r)}function I(e,t){return t.selections=t.selections.filter(function(t){return L(e,t,!0)}).map(function(t){return L(e,t,!1)?t:("Field"!==t.kind&&"InlineFragment"!==t.kind||!t.selectionSet||(t.selectionSet=I(e,t.selectionSet)),t)}),t}function R(){return void 0!==n&&n.env.NODE_ENV?n.env.NODE_ENV:"development"}function k(e){return R()===e}function D(){return!0===k("production")}function F(){return!0===k("development")}function V(){return!0===k("test")}function B(e,t){if(e===t)return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(null!=e&&"object"==typeof e&&null!=t&&"object"==typeof t){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;if(!B(e[r],t[r]))return!1}for(var r in t)if(!Object.prototype.hasOwnProperty.call(e,r))return!1;return!0}return!1}function U(e){return Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){null===e[t]||"object"!=typeof e[t]&&"function"!=typeof e[t]||Object.isFrozen(e[t])||U(e[t])}),e}t=t&&t.hasOwnProperty("default")?t.default:t,r=r&&r.hasOwnProperty("default")?r.default:r;var G=function(){return(G=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},z=["connection","include","skip","client","rest","export"],q=function(){return(q=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},$={kind:"Field",name:{kind:"Name",value:"__typename"}},H={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some(function(e){return"key"===e.name.value})||console.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key.")),t}},W=Object.create({});e.getDirectiveInfoFromField=function(e,t){if(e.directives&&e.directives.length){var r={};return e.directives.forEach(function(e){r[e.name.value]=m(e,t)}),r}return null},e.shouldInclude=function(e,t){if(void 0===t&&(t={}),!e.directives)return!0;var r=!0;return e.directives.forEach(function(e){if("skip"===e.name.value||"include"===e.name.value){var n=e.arguments||[],i=e.name.value;if(1!==n.length)throw new Error("Incorrect number of arguments for the @"+i+" directive.");var o=n[0];if(!o.name||"if"!==o.name.value)throw new Error("Invalid argument for the @"+i+" directive.");var a=n[0].value,s=!1;if(a&&"BooleanValue"===a.kind)s=a.value;else{if("Variable"!==a.kind)throw new Error("Argument for the @"+i+" directive must be a variable or a boolean value.");if(void 0===(s=t[a.name.value]))throw new Error("Invalid variable referenced in @"+i+" directive.")}"skip"===i&&(s=!s),s||(r=!1)}}),r},e.flattenSelections=g,e.getDirectiveNames=b,e.hasDirectives=function(e,t){return b(t).some(function(t){return e.indexOf(t)>-1})},e.getFragmentQueryDocument=function(e,t){var r=t,n=[];if(e.definitions.forEach(function(e){if("OperationDefinition"===e.kind)throw new Error("Found a "+e.operation+" operation"+(e.name?" named '"+e.name.value+"'":"")+". No operations are allowed when using a fragment as a query. Only fragments are allowed.");"FragmentDefinition"===e.kind&&n.push(e)}),void 0===r){if(1!==n.length)throw new Error("Found "+n.length+" fragments. `fragmentName` must be provided when there is not exactly 1 fragment.");r=n[0].name.value}return q({},e,{definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}].concat(e.definitions)})},e.getMutationDefinition=function(e){x(e);var t=e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})[0];if(!t)throw new Error("Must contain a mutation definition.");return t},e.checkDocument=x,e.getOperationDefinition=w,e.getOperationDefinitionOrDie=S,e.getOperationName=function(e){return e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&e.name}).map(function(e){return e.name.value})[0]||null},e.getFragmentDefinitions=T,e.getQueryDefinition=function(e){var t=w(e);if(!t||"query"!==t.operation)throw new Error("Must contain a query definition.");return t},e.getFragmentDefinition=function(e){if("Document"!==e.kind)throw new Error('Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql');if(e.definitions.length>1)throw new Error("Fragment must have exactly one definition.");var t=e.definitions[0];if("FragmentDefinition"!==t.kind)throw new Error("Must be a fragment definition.");return t},e.getMainDefinition=function(e){x(e);for(var t,r=0,n=e.definitions;r<n.length;r++){var i=n[r];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw new Error("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.")},e.createFragmentMap=E,e.getDefaultValues=function(e){if(e&&e.variableDefinitions&&e.variableDefinitions.length){var t=e.variableDefinitions.filter(function(e){return e.defaultValue}).map(function(e){var t=e.variable,r=e.defaultValue,n={};return f(n,t.name,r),n});return _.apply(void 0,[{}].concat(t))}return{}},e.variablesInOperation=function(e){var t=new Set;if(e.variableDefinitions)for(var r=0,n=e.variableDefinitions;r<n.length;r++){var i=n[r];t.add(i.variable.name.value)}return t},e.removeDirectivesFromDocument=A,e.addTypenameToDocument=function(e){x(e);var t=O(e);return t.definitions.forEach(function(e){var t="OperationDefinition"===e.kind;j(e.selectionSet,t)}),t},e.removeConnectionDirectiveFromDocument=function(e){return x(e),A([H],e)},e.getDirectivesFromDocument=function(e,t,r){void 0===r&&(r=!1),x(t);var n=O(t);return n.definitions=n.definitions.map(function(t){return("OperationDefinition"===t.kind||"FragmentDefinition"===t.kind&&!r)&&t.selectionSet&&(t.selectionSet=I(e,t.selectionSet)),t}),M(S(n),E(T(n)))?n:null},e.isScalarValue=function(e){return["StringValue","BooleanValue","EnumValue"].indexOf(e.kind)>-1},e.isNumberValue=function(e){return["IntValue","FloatValue"].indexOf(e.kind)>-1},e.valueToObjectRepresentation=f,e.storeKeyNameFromField=function(e,t){var r=null;e.directives&&(r={},e.directives.forEach(function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach(function(n){var i=n.name,o=n.value;return f(r[e.name.value],i,o,t)})}));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach(function(e){var r=e.name,i=e.value;return f(n,r,i,t)})),d(e.name.value,n,r)},e.getStoreKeyName=d,e.argumentsObjectFromField=m,e.resultKeyNameFromField=function(e){return e.alias?e.alias.value:e.name.value},e.isField=function(e){return"Field"===e.kind},e.isInlineFragment=function(e){return"InlineFragment"===e.kind},e.isIdValue=function(e){return e&&"id"===e.type},e.toIdValue=function(e,t){return void 0===t&&(t=!1),G({type:"id",generated:t},"string"==typeof e?{id:e,typename:void 0}:e)},e.isJsonValue=function(e){return null!=e&&"object"==typeof e&&"json"===e.type},e.valueFromNode=y,e.assign=_,e.cloneDeep=O,e.getEnv=R,e.isEnv=k,e.isProduction=D,e.isDevelopment=F,e.isTest=V,e.tryFunctionOrLogError=function(e){try{return e()}catch(e){console.error&&console.error(e)}},e.graphQLResultHasError=function(e){return e.errors&&e.errors.length},e.isEqual=B,e.maybeDeepFreeze=function(e){return!F()&&!V()||"function"==typeof Symbol&&"string"==typeof Symbol("")?e:U(e)},e.warnOnceInDevelopment=function(e,t){if(void 0===t&&(t="warn"),!D()&&!W[e])switch(V()||(W[e]=!0),t){case"error":console.error(e);break;default:console.warn(e)}},e.stripSymbols=function(e){return JSON.parse(JSON.stringify(e))},Object.defineProperty(e,"__esModule",{value:!0})})}).call(this,e("_process"))},{_process:17,"fast-json-stable-stringify":27,fclone:28}],14:[function(e,t,r){"use strict";function n(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}function o(e,t,r){for(var n,o=[],a=t;a<r;a+=3)n=(e[a]<<16)+(e[a+1]<<8)+e[a+2],o.push(i(n));return o.join("")}r.byteLength=function(e){return 3*e.length/4-n(e)},r.toByteArray=function(e){var t,r,i,o,a,c=e.length;o=n(e),a=new u(3*c/4-o),r=o>0?c-4:c;var l=0;for(t=0;t<r;t+=4)i=s[e.charCodeAt(t)]<<18|s[e.charCodeAt(t+1)]<<12|s[e.charCodeAt(t+2)]<<6|s[e.charCodeAt(t+3)],a[l++]=i>>16&255,a[l++]=i>>8&255,a[l++]=255&i;return 2===o?(i=s[e.charCodeAt(t)]<<2|s[e.charCodeAt(t+1)]>>4,a[l++]=255&i):1===o&&(i=s[e.charCodeAt(t)]<<10|s[e.charCodeAt(t+1)]<<4|s[e.charCodeAt(t+2)]>>2,a[l++]=i>>8&255,a[l++]=255&i),a},r.fromByteArray=function(e){for(var t,r=e.length,n=r%3,i="",s=[],u=0,c=r-n;u<c;u+=16383)s.push(o(e,u,u+16383>c?c:u+16383));return 1===n?(t=e[r-1],i+=a[t>>2],i+=a[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=a[t>>10],i+=a[t>>4&63],i+=a[t<<2&63],i+="="),s.push(i),s.join("")};for(var a=[],s=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,h=c.length;l<h;++l)a[l]=c[l],s[c.charCodeAt(l)]=l;s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},{}],15:[function(e,t,r){},{}],16:[function(e,t,r){t.exports=function(e){var t=String.prototype.split,r=/()??/.exec("")[1]===e;return function(n,i,o){if("[object RegExp]"!==Object.prototype.toString.call(i))return t.call(n,i,o);var a,s,u,c,l=[],h=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.extended?"x":"")+(i.sticky?"y":""),p=0,i=new RegExp(i.source,h+"g");for(n+="",r||(a=new RegExp("^"+i.source+"$(?!\\s)",h)),o=o===e?-1>>>0:o>>>0;(s=i.exec(n))&&!((u=s.index+s[0].length)>p&&(l.push(n.slice(p,s.index)),!r&&s.length>1&&s[0].replace(a,function(){for(var t=1;t<arguments.length-2;t++)arguments[t]===e&&(s[t]=e)}),s.length>1&&s.index<n.length&&Array.prototype.push.apply(l,s.slice(1)),c=s[0].length,p=u,l.length>=o));)i.lastIndex===s.index&&i.lastIndex++;return p===n.length?!c&&i.test("")||l.push(""):l.push(n.slice(p)),l.length>o?l.slice(0,o):l}}()},{}],17:[function(e,t,r){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(e){if(h===setTimeout)return setTimeout(e,0);if((h===n||!h)&&setTimeout)return h=setTimeout,setTimeout(e,0);try{return h(e,0)}catch(t){try{return h.call(null,e,0)}catch(t){return h.call(this,e,0)}}}function a(e){if(p===clearTimeout)return clearTimeout(e);if((p===i||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function s(){v&&d&&(v=!1,d.length?m=d.concat(m):y=-1,m.length&&u())}function u(){if(!v){var e=o(s);v=!0;for(var t=m.length;t;){for(d=m,m=[];++y<t;)d&&d[y].run();y=-1,t=m.length}d=null,v=!1,a(e)}}function c(e,t){this.fun=e,this.array=t}function l(){}var h,p,f=t.exports={};!function(){try{h="function"==typeof setTimeout?setTimeout:n}catch(e){h=n}try{p="function"==typeof clearTimeout?clearTimeout:i}catch(e){p=i}}();var d,m=[],v=!1,y=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];m.push(new c(e,t)),1!==m.length||v||o(u)},c.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=l,f.addListener=l,f.once=l,f.off=l,f.removeListener=l,f.removeAllListeners=l,f.emit=l,f.prependListener=l,f.prependOnceListener=l,f.listeners=function(e){return[]},f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},{}],18:[function(e,t,r){"use strict";function n(e){if(e>Q)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=i.prototype,t}function i(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(e)}return o(e,t,r)}function o(e,t,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return e instanceof ArrayBuffer?h(e,t,r):"string"==typeof e?c(e,t):p(e)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function s(e,t,r){return a(e),e<=0?n(e):void 0!==t?"string"==typeof r?n(e).fill(t,r):n(e).fill(t):n(e)}function u(e){return a(e),n(e<0?0:0|f(e))}function c(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!i.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,t),o=n(r),a=o.write(e,t);return a!==r&&(o=o.slice(0,a)),o}function l(e){for(var t=e.length<0?0:0|f(e.length),r=n(t),i=0;i<t;i+=1)r[i]=255&e[i];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(r||0))throw new RangeError("'length' is out of bounds");var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),n.__proto__=i.prototype,n}function p(e){if(i.isBuffer(e)){var t=0|f(e.length),r=n(t);return 0===r.length?r:(e.copy(r,0,0,t),r)}if(e){if(q(e)||"length"in e)return"number"!=typeof e.length||$(e.length)?n(0):l(e);if("Buffer"===e.type&&Array.isArray(e.data))return l(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function f(e){if(e>=Q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q.toString(16)+" bytes");return 0|e}function d(e,t){if(i.isBuffer(e))return e.length;if(q(e)||e instanceof ArrayBuffer)return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return C(this,t,r);case"latin1":case"binary":return j(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,$(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=i.from(t,n)),i.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){function o(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}var c;if(i){var l=-1;for(c=r;c<s;c++)if(o(e,c)===o(t,-1===l?0:c-l)){if(-1===l&&(l=c),c-l+1===u)return l*a}else-1!==l&&(c-=c-l),l=-1}else for(r+u>s&&(r=s-u),c=r;c>=0;c--){for(var h=!0,p=0;p<u;p++)if(o(e,c+p)!==o(t,p)){h=!1;break}if(h)return c}return-1}function b(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if($(s))return a;e[r+a]=s}return a}function _(e,t,r,n){return z(V(t,e.length-r),e,r,n)}function x(e,t,r,n){return z(B(t),e,r,n)}function w(e,t,r,n){return x(e,t,r,n)}function S(e,t,r,n){return z(G(t),e,r,n)}function T(e,t,r,n){return z(U(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?H.fromByteArray(e):H.fromByteArray(e.slice(t,r))}function O(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o=e[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=r){var u,c,l,h;switch(s){case 1:o<128&&(a=o);break;case 2:128==(192&(u=e[i+1]))&&(h=(31&o)<<6|63&u)>127&&(a=h);break;case 3:u=e[i+1],c=e[i+2],128==(192&u)&&128==(192&c)&&(h=(15&o)<<12|(63&u)<<6|63&c)>2047&&(h<55296||h>57343)&&(a=h);break;case 4:u=e[i+1],c=e[i+2],l=e[i+3],128==(192&u)&&128==(192&c)&&128==(192&l)&&(h=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&l)>65535&&h<1114112&&(a=h)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return M(n)}function M(e){var t=e.length;if(t<=K)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=K));return r}function C(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function j(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function P(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=F(e[o]);return i}function A(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function N(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,o,a){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function I(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(e,t,r,n,i){return t=+t,r>>>=0,i||I(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),W.write(e,t,r,n,23,4),r+4}function k(e,t,r,n,i){return t=+t,r>>>=0,i||I(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),W.write(e,t,r,n,52,8),r+8}function D(e){if((e=e.trim().replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function F(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function B(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function U(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}function G(e){return H.toByteArray(D(e))}function z(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function q(e){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(e)}function $(e){return e!==e}var H=e("base64-js"),W=e("ieee754");r.Buffer=i,r.SlowBuffer=function(e){return+e!=e&&(e=0),i.alloc(+e)},r.INSPECT_MAX_BYTES=50;var Q=2147483647;r.kMaxLength=Q,i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(e,t,r){return o(e,t,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(e,t,r){return s(e,t,r)},i.allocUnsafe=function(e){return u(e)},i.allocUnsafeSlow=function(e){return u(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer},i.compare=function(e,t){if(!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,o=0,a=Math.min(r,n);o<a;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},i.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return i.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=i.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var a=e[r];if(!i.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},i.byteLength=d,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},i.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},i.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},i.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?O(this,0,e):m.apply(this,arguments)},i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===i.compare(this,e)},i.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},i.prototype.compare=function(e,t,r,n,o){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,o>>>=0,this===e)return 0;for(var a=o-n,s=r-t,u=Math.min(a,s),c=this.slice(n,o),l=e.slice(t,r),h=0;h<u;++h)if(c[h]!==l[h]){a=c[h],s=l[h];break}return a<s?-1:s<a?1:0},i.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},i.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},i.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},i.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":return x(this,e,t,r);case"latin1":case"binary":return w(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var K=4096;i.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return n.__proto__=i.prototype,n},i.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},i.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},i.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},i.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},i.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),W.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),W.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),W.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),W.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||L(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},i.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||L(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},i.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},i.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},i.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},i.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeFloatLE=function(e,t,r){return R(this,e,t,!0,r)},i.prototype.writeFloatBE=function(e,t,r){return R(this,e,t,!1,r)},i.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},i.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},i.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},i.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var a;if("number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var s=i.isBuffer(e)?e:new i(e,n),u=s.length;for(a=0;a<r-t;++a)this[a+t]=s[a%u]}return this};var X=/[^+/0-9A-Za-z-_]/g},{"base64-js":14,ieee754:139}],19:[function(e,t,r){"use strict";function n(e,t,r){r=r||2;var n=t&&t.length,o=n?t[0]*r:e.length,s=i(e,0,o,r,!0),u=[];if(!s)return u;var c,l,p,f,d,m,v;if(n&&(s=h(e,t,s,r)),e.length>80*r){c=p=e[0],l=f=e[1];for(var y=r;y<o;y+=r)d=e[y],m=e[y+1],d<c&&(c=d),m<l&&(l=m),d>p&&(p=d),m>f&&(f=m);v=Math.max(p-c,f-l)}return a(s,u,r,c,l,v),u}function i(e,t,r,n,i){var o,a;if(i===A(e,t,r,n)>0)for(o=t;o<r;o+=n)a=C(o,e[o],e[o+1],a);else for(o=r-n;o>=t;o-=n)a=C(o,e[o],e[o+1],a);return a&&w(a,a.next)&&(j(a),a=a.next),a}function o(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!w(n,n.next)&&0!==x(n.prev,n,n.next))n=n.next;else{if(j(n),(n=t=n.prev)===n.next)return null;r=!0}}while(r||n!==t);return t}function a(e,t,r,n,i,h,p){if(e){!p&&h&&m(e,n,i,h);for(var f,d,v=e;e.prev!==e.next;)if(f=e.prev,d=e.next,h?u(e,n,i,h):s(e))t.push(f.i/r),t.push(e.i/r),t.push(d.i/r),j(e),e=d.next,v=d.next;else if((e=d)===v){p?1===p?a(e=c(e,t,r),t,r,n,i,h,2):2===p&&l(e,t,r,n,i,h):a(o(e),t,r,n,i,h,1);break}}}function s(e){var t=e.prev,r=e,n=e.next;if(x(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(b(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&x(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function u(e,t,r,n){var i=e.prev,o=e,a=e.next;if(x(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,c=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=y(s,u,t,r,n),p=y(c,l,t,r,n),f=e.nextZ;f&&f.z<=p;){if(f!==e.prev&&f!==e.next&&b(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&x(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=e.prevZ;f&&f.z>=h;){if(f!==e.prev&&f!==e.next&&b(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&x(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function c(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!w(i,o)&&S(i,n,n.next,o)&&E(i,o)&&E(o,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(o.i/r),j(n),j(n.next),n=e=o),n=n.next}while(n!==e);return n}function l(e,t,r,n,i,s){var u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&_(u,c)){var l=M(u,c);return u=o(u,u.next),l=o(l,l.next),a(u,t,r,n,i,s),void a(l,t,r,n,i,s)}c=c.next}u=u.next}while(u!==e)}function h(e,t,r,n){var a,s,u,c=[];for(a=0,s=t.length;a<s;a++)(u=i(e,t[a]*n,a<s-1?t[a+1]*n:e.length,n,!1))===u.next&&(u.steiner=!0),c.push(g(u));for(c.sort(p),a=0;a<c.length;a++)f(c[a],r),r=o(r,r.next);return r}function p(e,t){return e.x-t.x}function f(e,t){if(t=d(e,t)){var r=M(t,e);o(r,r.next)}}function d(e,t){var r,n=t,i=e.x,o=e.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(i===a)return r.prev;var u,c=r,l=r.x,h=r.y,p=1/0;for(n=r.next;n!==c;)i>=n.x&&n.x>=l&&b(o<h?i:a,o,l,h,o<h?a:i,o,n.x,n.y)&&((u=Math.abs(o-n.y)/(i-n.x))<p||u===p&&n.x>r.x)&&E(n,e)&&(r=n,p=u),n=n.next;return r}function m(e,t,r,n){var i=e;do{null===i.z&&(i.z=y(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,v(i)}function v(e){var t,r,n,i,o,a,s,u,c=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t<c&&(s++,n=n.nextZ);t++);for(u=c;s>0||u>0&&n;)0===s?(i=n,n=n.nextZ,u--):0!==u&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--):(i=r,r=r.nextZ,s--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(a>1);return e}function y(e,t,r,n,i){return e=32767*(e-r)/i,t=32767*(t-n)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function g(e){var t=e,r=e;do{t.x<r.x&&(r=t),t=t.next}while(t!==e);return r}function b(e,t,r,n,i,o,a,s){return(i-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(n-s)-(r-a)*(t-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function _(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!T(e,t)&&E(e,t)&&E(t,e)&&O(e,t)}function x(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function w(e,t){return e.x===t.x&&e.y===t.y}function S(e,t,r,n){return!!(w(e,t)&&w(r,n)||w(e,n)&&w(r,t))||x(e,t,r)>0!=x(e,t,n)>0&&x(r,n,e)>0!=x(r,n,t)>0}function T(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&S(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function E(e,t){return x(e.prev,e,e.next)<0?x(e,t,e.next)>=0&&x(e,e.prev,t)>=0:x(e,t,e.prev)<0||x(e,e.next,t)<0}function O(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}function M(e,t){var r=new P(e.i,e.x,e.y),n=new P(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function C(e,t,r,n){var i=new P(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function j(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function P(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(e,t,r,n){for(var i=0,o=t,a=r-n;o<r;o+=n)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}t.exports=n,n.deviation=function(e,t,r,n){var i=t&&t.length,o=i?t[0]*r:e.length,a=Math.abs(A(e,0,o,r));if(i)for(var s=0,u=t.length;s<u;s++){var c=t[s]*r,l=s<u-1?t[s+1]*r:e.length;a-=Math.abs(A(e,c,l,r))}var h=0;for(s=0;s<n.length;s+=3){var p=n[s]*r,f=n[s+1]*r,d=n[s+2]*r;h+=Math.abs((e[p]-e[d])*(e[f+1]-e[p+1])-(e[p]-e[f])*(e[d+1]-e[p+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},n.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)r.vertices.push(e[i][o][a]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r}},{}],20:[function(e,t,r){"use strict";e("individual/one-version")("ev-store","7");var n="__EV_STORE_KEY@7";t.exports=function(e){var t=e[n];return t||(t=e[n]={}),t}},{"individual/one-version":142}],21:[function(e,t,r){"use strict";function n(e,t){var r;for(r in t)e[r]=t[r];return e}function i(e,t){this._jsongUrl=e,"number"==typeof t&&(t={timeout:t}),this._config=n({timeout:15e3,headers:{}},t||{})}var o=e("./request"),a=e("./buildQueryObject");Array.isArray;i.prototype={constructor:i,buildQueryObject:a,get:function(e){var t=n(this.buildQueryObject(this._jsongUrl,"GET",{paths:e,method:"get"}),this._config);return o("GET",t,this)},set:function(e){var t=n(this.buildQueryObject(this._jsongUrl,"POST",{jsonGraph:e,method:"set"}),this._config);return t.headers["Content-Type"]="application/x-www-form-urlencoded",o("POST",t,this)},call:function(e,t,r,i){t=t||[],r=r||[],i=i||[];var a=[];a.push("method=call"),a.push("callPath="+encodeURIComponent(JSON.stringify(e))),a.push("arguments="+encodeURIComponent(JSON.stringify(t))),a.push("pathSuffixes="+encodeURIComponent(JSON.stringify(r))),a.push("paths="+encodeURIComponent(JSON.stringify(i)));var s=n(this.buildQueryObject(this._jsongUrl,"POST",a.join("&")),this._config);return s.headers["Content-Type"]="application/x-www-form-urlencoded",o("POST",s,this)}},i.XMLHttpSource=i,i.default=i,t.exports=i},{"./buildQueryObject":22,"./request":25}],22:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=[],i={url:e},o=-1!==e.indexOf("?")?"&":"?";return"string"==typeof r?n.push(r):Object.keys(r).forEach(function(e){var t="object"==typeof r[e]?JSON.stringify(r[e]):r[e];n.push(e+"="+encodeURIComponent(t))}),"GET"===t?i.url+=o+n.join("&"):i.data=n.join("&"),i}},{}],23:[function(e,t,r){(function(e){"use strict";t.exports=function(){var t=new e.XMLHttpRequest;if("withCredentials"in t)return t;if(e.XDomainRequest)return new XDomainRequest;throw new Error("CORS is not supported by your browser")}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],24:[function(e,t,r){(function(e){"use strict";t.exports=function(){var t,r,n;if(e.XMLHttpRequest)return new e.XMLHttpRequest;try{for(r=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],n=0;n<3;n++)try{if(t=r[n],new e.ActiveXObject(t))break}catch(e){}return new e.ActiveXObject(t)}catch(e){throw new Error("XMLHttpRequest is not supported by your browser")}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],25:[function(e,t,r){"use strict";function n(){}function i(e,t,r){r||(r=new Error(t)),e.onError(r)}function o(e,t,r){var n,o;if(t&&e){o=t.responseType,n="response"in t?t.response:t.responseText;var a=1223===t.status?204:t.status;if(a>=200&&a<=399){try{"json"!==o&&(n=JSON.parse(n||"")),"string"==typeof n&&(n=JSON.parse(n||""))}catch(r){i(e,"invalid json",r)}return e.onNext(n),void e.onCompleted()}return 401===a||403===a||407===a?i(e,n):410===a?i(e,n):408===a||504===a?i(e,n):i(e,n||"Response code "+a)}}function a(e,t,r,n){i(e,r||t.statusText||"request error",n)}var s=e("./getXMLHttpRequest"),u=e("./getCORSRequest"),c=Object.prototype.hasOwnProperty,l=function(){};n.create=function(e){var t=new n;return t.subscribe=function(t,r,n){var i,o;return i="function"==typeof t?{onNext:t,onError:r||l,onCompleted:n||l}:t,"function"==typeof(o=e(i))?{dispose:o}:o},t},t.exports=function(e,t,r){return n.create(function(n){var i,l,h,p,f,d={method:e||"GET",crossDomain:!1,async:!0,headers:{},responseType:"json"};for(f in t)c.call(t,f)&&(d[f]=t[f]);d.crossDomain||d.headers["X-Requested-With"]||(d.headers["X-Requested-With"]="XMLHttpRequest"),null!=r.onBeforeRequest&&r.onBeforeRequest(d);try{i=d.crossDomain?u():s()}catch(e){n.onError(e)}try{d.user?i.open(d.method,d.url,d.async,d.user,d.password):i.open(d.method,d.url,d.async),i.timeout=d.timeout,i.withCredentials=!1!==d.withCredentials,h=d.headers;for(p in h)c.call(h,p)&&i.setRequestHeader(p,h[p]);if(d.responseType)try{i.responseType=d.responseType}catch(e){if("json"!==d.responseType)throw e}i.onreadystatechange=function(e){4===i.readyState&&(l||(l=!0,o(n,i)))},i.ontimeout=function(e){l||(l=!0,a(n,i,"timeout error",e))},i.send(d.data)}catch(e){n.onError(e)}return function(){l||4===i.readyState||(l=!0,i.abort())}})}},{"./getCORSRequest":23,"./getXMLHttpRequest":24}],26:[function(e,t,r){(function(n){!function(e){if("object"==typeof r&&void 0!==t)t.exports=e();else{("undefined"!=typeof window?window:void 0!==n?n:"undefined"!=typeof self?self:this).falcor=e()}}(function(){return function t(r,n,i){function o(s,u){if(!n[s]){if(!r[s]){var c="function"==typeof e&&e;if(!u&&c)return c(s,!0);if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=n[s]={exports:{}};r[s][0].call(h.exports,function(e){var t=r[s][1][e];return o(t||e)},h,h.exports,t,r,n,i)}return n[s].exports}for(var a="function"==typeof e&&e,s=0;s<i.length;s++)o(i[s]);return o}({1:[function(e,t,r){var n=e(32),i=e(130);n.atom=i.atom,n.ref=i.ref,n.error=i.error,n.pathValue=i.pathValue,n.HttpDataSource=e(125),t.exports=n},{125:125,130:130,32:32}],2:[function(e,t,r){function n(e){var t=e||{};this._root=t._root||new i(t),this._path=t.path||t._path||[],this._scheduler=t.scheduler||t._scheduler||new f,this._source=t.source||t._source,this._request=t.request||t._request||new a(this,this._scheduler),this._ID=M++,"number"==typeof t.maxSize?this._maxSize=t.maxSize:this._maxSize=t._maxSize||n.prototype._maxSize,"number"==typeof t.collectRatio?this._collectRatio=t.collectRatio:this._collectRatio=t._collectRatio||n.prototype._collectRatio,(t.boxed||t.hasOwnProperty("_boxed"))&&(this._boxed=t.boxed||t._boxed),(t.materialized||t.hasOwnProperty("_materialized"))&&(this._materialized=t.materialized||t._materialized),"boolean"==typeof t.treatErrorsAsValues?this._treatErrorsAsValues=t.treatErrorsAsValues:t.hasOwnProperty("_treatErrorsAsValues")&&(this._treatErrorsAsValues=t._treatErrorsAsValues),t.cache&&this.setCache(t.cache)}var i=e(4),o=e(3),a=e(55),s=e(64),u=e(65),c=e(61),l=e(63),h=e(73),p=e(75),f=e(74),d=e(81),m=e(84),v=e(49),y=e(134),g=e(88),b=e(100),_=e(96),x=e(102),w=e(98),S=e(99),T=e(77),E=e(76),O=e(130),M=0,C=e(116),j=function(){},P=e(14),A=e(19),N={pathValue:!0,pathSyntax:!0,json:!0,jsonGraph:!0},L=e(72);t.exports=n,n.ref=O.ref,n.atom=O.atom,n.error=O.error,n.pathValue=O.pathValue,n.prototype.constructor=n,n.prototype._materialized=!1,n.prototype._boxed=!1,n.prototype._progressive=!1,n.prototype._treatErrorsAsValues=!1,n.prototype._maxSize=Math.pow(2,53)-1,n.prototype._collectRatio=.75,n.prototype.get=e(71),n.prototype._getWithPaths=e(70),n.prototype.set=function(){var e=C(arguments,N,"set");return!0!==e?new s(function(t){t.onError(e)}):this._set.apply(this,arguments)},n.prototype.preload=function(){var e=C(arguments,L,"preload");if(!0!==e)return new s(function(t){t.onError(e)});var t=Array.prototype.slice.call(arguments),r=this;return new s(function(e){return r.get.apply(r,t).subscribe(function(){},function(t){e.onError(t)},function(){e.onCompleted()})})},n.prototype._set=function(){var e,t=-1,r=arguments.length,n=arguments[r-1];for(_(n)?r-=1:n=void 0,e=new Array(r);++t<r;)e[t]=arguments[t];return u.create(this,e,n)},n.prototype.call=function(){var e,t=-1,r=arguments.length;for(e=new Array(r);++t<r;){var n=arguments[t];e[t]=n;var i=typeof n;if(t>1&&!Array.isArray(n)||0===t&&!Array.isArray(n)&&"string"!==i||1===t&&!Array.isArray(n)&&!x(n))return new s(function(e){e.onError(new Error("Invalid argument"))})}return c.create(this,e)},n.prototype.invalidate=function(){var e,t=-1,r=arguments.length,n=arguments[r-1];for(e=new Array(r);++t<r;)if(e[t]=y.fromPath(arguments[t]),"object"!=typeof e[t])throw new Error("Invalid argument");l.create(this,e,n).subscribe(j,function(e){throw e})},n.prototype.deref=e(5),n.prototype.getValue=e(16),n.prototype.setValue=e(79),n.prototype._getValueSync=e(24),n.prototype._setValueSync=e(80),n.prototype._derefSync=e(6),n.prototype.setCache=function(e){var t=this._root.cache;if(e!==t){var r=this._root,n=this._path;this._path=[],this._root.cache={},void 0!==t&&v(r,r.expired,g(t),0),S(e)?E(this,[e]):w(e)?T(this,[e]):b(e)&&T(this,[{json:e}]),this._path=n}else void 0===t&&(this._root.cache={});return this},n.prototype.getCache=function(){var e=m(arguments);if(0===e.length)return P(this._root.cache);var t=[{}],r=this._path;return A.getWithPathsAsJSONGraph(this,e,t),this._path=r,t[0].jsonGraph},n.prototype.getVersion=function(e){var t=e&&y.fromPath(e)||[];if(!1===Array.isArray(t))throw new Error("Model#getVersion must be called with an Array path.");return this._path.length&&(t=this._path.concat(t)),this._getVersion(this,t)},n.prototype._syncCheck=function(e){if(Boolean(this._source)&&this._root.syncRefCount<=0&&!1===this._root.unsafeMode)throw new Error("Model#"+e+" may only be called within the context of a request selector.");return!0},n.prototype._clone=function(e){var t=new n(this);for(var r in e){var i=e[r];"delete"===i?delete t[r]:t[r]=i}return t.setCache=void 0,t},n.prototype.batch=function(e){var t=e;"number"==typeof t?t=new p(Math.round(Math.abs(t))):t&&t.schedule||(t=new h);var r=this._clone();return r._request=new a(r,t),r},n.prototype.unbatch=function(){var e=this._clone();return e._request=new a(e,new f),e},n.prototype.treatErrorsAsValues=function(){return this._clone({_treatErrorsAsValues:!0})},n.prototype.asDataSource=function(){return new o(this)},n.prototype._materialize=function(){return this._clone({_materialized:!0})},n.prototype._dematerialize=function(){return this._clone({_materialized:"delete"})},n.prototype.boxValues=function(){return this._clone({_boxed:!0})},n.prototype.unboxValues=function(){return this._clone({_boxed:"delete"})},n.prototype.withoutDataSource=function(){return this._clone({_source:"delete"})},n.prototype.toJSON=function(){return{$type:"ref",value:this._path}},n.prototype.getPath=function(){return d(this._path)},n.prototype._getBoundValue=e(13),n.prototype._getVersion=e(18),n.prototype._getValueSync=e(17),n.prototype._getPathValuesAsPathMap=A.getWithPathsAsPathMap,n.prototype._getPathValuesAsJSONG=A.getWithPathsAsJSONGraph,n.prototype._setPathValuesAsJSON=e(78),n.prototype._setPathValuesAsJSONG=e(78),n.prototype._setPathValuesAsPathMap=e(78),n.prototype._setPathValuesAsValues=e(78),n.prototype._setPathMapsAsJSON=e(77),n.prototype._setPathMapsAsJSONG=e(77),n.prototype._setPathMapsAsPathMap=e(77),n.prototype._setPathMapsAsValues=e(77),n.prototype._setJSONGsAsJSON=e(76),n.prototype._setJSONGsAsJSONG=e(76),n.prototype._setJSONGsAsPathMap=e(76),n.prototype._setJSONGsAsValues=e(76),n.prototype._setCache=e(77),n.prototype._invalidatePathValuesAsJSON=e(48),n.prototype._invalidatePathMapsAsJSON=e(47)},{100:100,102:102,116:116,13:13,130:130,134:134,14:14,16:16,17:17,18:18,19:19,24:24,3:3,4:4,47:47,48:48,49:49,5:5,55:55,6:6,61:61,63:63,64:64,65:65,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,84:84,88:88,96:96,98:98,99:99}],3:[function(e,t,r){function n(e){this._model=e._materialize().treatErrorsAsValues()}n.prototype.get=function(e){return this._model.get.apply(this._model,e)._toJSONG()},n.prototype.set=function(e){return this._model.set(e)._toJSONG()},n.prototype.call=function(e,t,r,n){var i=[e,t,r].concat(n);return this._model.call.apply(this._model,i)._toJSONG()},t.exports=n},{}],4:[function(e,t,r){function n(e){var t=e||{};this.syncRefCount=0,this.expired=t.expired||[],this.unsafeMode=t.unsafeMode||!1,this.collectionScheduler=t.collectionScheduler||new a,this.cache={},i(t.comparator)&&(this.comparator=t.comparator),i(t.errorSelector)&&(this.errorSelector=t.errorSelector),i(t.onChange)&&(this.onChange=t.onChange)}var i=e(96),o=e(91),a=e(74);n.prototype.errorSelector=function(e,t){return t},n.prototype.comparator=function(e,t){return o(e,"value")&&o(t,"value")?e.value===t.value&&e.$type===t.$type&&e.$expires===t.$expires:e===t},t.exports=n},{74:74,91:91,96:96}],5:[function(e,t,r){function n(e,t){var r,n=!1;try{++e._root.syncRefCount,r=e._derefSync(t)}catch(e){r=e,n=!0}finally{--e._root.syncRefCount}return n?i.Observable.throw(r):i.Observable.return(r)}var i=e(159),o=e(134);t.exports=function(e){for(var t=this,r=-1,a=arguments.length-1,s=new Array(a),u=o.fromPath(e);++r<a;)s[r]=o.fromPath(arguments[r+1]);if(0===a)throw new Error("Model#deref requires at least one value path.");return i.Observable.defer(function(){return n(t,u)}).flatMap(function(e){if(Boolean(e)){if(a>0){var r=i.Observable.of(e);return e.get.apply(e,s).catch(i.Observable.empty()).concat(r).last().flatMap(function(){return n(t,u)}).filter(function(e){return e})}return i.Observable.return(e)}if(a>0){var o=s.map(function(e){return u.concat(e)});return t.get.apply(t,o).concat(i.Observable.defer(function(){return n(t,u)})).last().filter(function(e){return e})}return i.Observable.empty()})}},{134:134,159:159}],6:[function(e,t,r){var n=e(134),i=e(13),o=e(8),a=e(118);t.exports=function(e){var t=n.fromPath(e);if(!Array.isArray(t))throw new Error("Model#derefSync must be called with an Array path.");var r=i(this,this._path.concat(t),!1),s=r.path,u=r.value;if(r.found&&void 0!==u&&(u.$type!==a||void 0!==u.value)){if(u.$type)throw new o;return this._clone({_path:s})}}},{118:118,13:13,134:134,8:8}],7:[function(e,t,r){function n(){this.message=n.message,this.stack=(new Error).stack}n.prototype=new Error,n.prototype.name="BoundJSONGraphModelError",n.message="It is not legal to use the JSON Graph format from a bound Model. JSON Graph format can only be used from a root model.",t.exports=n},{}],8:[function(e,t,r){function n(e,t){this.message=i,this.stack=(new Error).stack,this.boundPath=e,this.shortedPath=t}var i="The boundPath of the model is not valid since a value or error was found before the path end.";(n.prototype=new Error).name="InvalidModelError",n.message=i,t.exports=n},{}],9:[function(e,t,r){function n(e){this.message="An exception was thrown when making a request.",this.stack=(new Error).stack,this.innerError=e}var i="InvalidSourceError";(n.prototype=new Error).name=i,n.is=function(e){return e&&e.name===i},t.exports=n},{}],10:[function(e,t,r){function n(){this.message="The allowed number of retries have been exceeded.",this.stack=(new Error).stack}var i="MaxRetryExceededError";(n.prototype=new Error).name=i,n.is=function(e){return e&&e.name===i},t.exports=n},{}],11:[function(e,t,r){var n=e(26).create,i=e(22),o=e(27),a=e(120),s=e(33),u=e(29).promote;t.exports=function(e,t,r,c,l,h,p){for(var f,d,m=r,v=l,y=c,g=0;;){if(0===g&&y[s]?(g=v.length,d=y[s]):(f=v[g++],d=m[f]),d){var b=d.$type,_=b&&d.value||d;if(g<v.length){if(b){m=d;break}m=d;continue}if(m=d,b&&o(d))break;if(y[s]||n(y,d),b===a){p?i(e,d,h,null,null,null,v,v.length,p):u(e,d),g=0,v=_,y=d,m=t;continue}break}m=void 0;break}if(g<v.length&&void 0!==m){for(var x=[],w=0;g>w;w++)x[w]=v[w];v=x}return[m,v]}},{120:120,22:22,26:26,27:27,29:29,33:33}],12:[function(e,t,r){var n=e(15),i=e(8),o=e(7);t.exports=function(e,t){return function(r,a,s){var u,c,l,h=s[0],p={values:s,optimizedPaths:[]},f=r._root.cache,d=r._path,m=f,v=d.length,y=[];if(v){if(t)return{criticalError:new o};if((m=n(r,d)).$type)return{criticalError:new i(d,d)};for(u=[],c=0;v>c;++c)u[c]=d[c]}else u=[],v=0;for(c=0,l=a.length;l>c;c++)e(r,f,m,a[c],0,h,p,y,u,v,t);return p}}},{15:15,7:7,8:8}],13:[function(e,t,r){var n=e(17),i=e(8);t.exports=function(e,t,r){var o,a,s,u,c,l=t,h=t;for(o=e._boxed,r=e._materialized,a=e._treatErrorsAsValues,e._boxed=!0,e._materialized=void 0===r||r,e._treatErrorsAsValues=!0,s=n(e,l.concat(null),!0),e._boxed=o,e._materialized=r,e._treatErrorsAsValues=a,l=s.optimizedPath,u=s.shorted,c=s.found,s=s.value;l.length&&null===l[l.length-1];)l.pop();if(c&&u)throw new i(h,l);return{path:l,value:s,shorted:u,found:c}}},{17:17,8:8}],14:[function(e,t,r){function n(e){var t,r,n,i={},o=Object.keys(e);for(r=0,n=o.length;n>r;r++)t=o[r],a(t)||(i[t]=e[t]);return i}function i(e,t,r){Object.keys(e).filter(function(t){return!a(t)&&e[t]}).forEach(function(r){var a=e[r],s=t[r];if(s||(s=t[r]={}),a.$type){var u,c=a.value&&"object"==typeof a.value,l=!e[o];return u=c||l?n(a):a.value,void(t[r]=u)}i(a,s,r)})}var o=e(37),a=e(97);t.exports=function(e){var t={};return i(e,t),t}},{37:37,97:97}],15:[function(e,t,r){t.exports=function(e,t){for(var r=e._root.cache,n=-1,i=t.length;++n<i&&r&&!r.$type;)r=r[t[n]];return r}},{}],16:[function(e,t,r){var n=e(64),i=e(134);t.exports=function(e){for(var t=i.fromPath(e),r=0,o=t.length;++r<o;)if("object"==typeof t[r])return new n(function(e){e.onError(new Error("Paths must be simple paths"))});var a=this;return new n(function(e){return a.get(t).subscribe(function(r){for(var n=r.json,i=-1,o=t.length;n&&++i<o;)n=n[t[i]];e.onNext(n)},function(t){e.onError(t)},function(){e.onCompleted()})})}},{134:134,64:64}],17:[function(e,t,r){var n=e(11),i=e(25),o=e(27),a=e(29).promote,s=e(120),u=e(118),c=e(119);t.exports=function(e,t,r){for(var l,h,p,f,d,m=e._root.cache,v=t.length,y=[],g=!1,b=!1,_=0,x=m,w=m,S=m,T=!0,E=!1;x&&v>_;){if(null!==(l=t[_++])&&(x=w[l],y[y.length]=l),!x){S=void 0,g=!0,T=!1;break}if((p=x.$type)===u&&void 0===x.value){S=void 0,T=!1,g=v>_;break}if(v>_){if(p===s){if(o(x)){E=!0,S=void 0,T=!1;break}if(f=n(e,m,m,x,x.value),!(d=f[0])){S=void 0,x=void 0,T=!1;break}p=d.$type,x=d,y=f[1].slice(0)}if(p)break}else S=x;w=x}if(v>_&&!E){for(h=_;v>h;++h)if(null!==t[_]){b=!0;break}for(b?(g=!0,S=void 0):S=x,h=_;v>h;++h)null!==t[h]&&(y[y.length]=t[h])}if(S&&p&&(o(S)?S=void 0:a(e,S)),S&&p===c&&!e._treatErrorsAsValues)throw{path:_===v?t:t.slice(0,_),value:S.value};return S&&e._boxed?S=Boolean(p)&&!r?i(S):S:!S&&e._materialized?S={$type:u}:S&&(S=S.value),{value:S,shorted:g,optimizedPath:y,found:T}}},{11:11,118:118,119:119,120:120,25:25,27:27,29:29}],18:[function(e,t,r){var n=e(46);t.exports=function(e,t){var r=e._getValueSync({_boxed:!0,_root:e._root,_treatErrorsAsValues:e._treatErrorsAsValues},t,!0).value,i=r&&r[n];return null==i?-1:i}},{46:46}],19:[function(e,t,r){var n=e(12),i=e(31),o=n(i,!1),a=n(i,!0);t.exports={getValueSync:e(17),getBoundValue:e(13),getWithPathsAsPathMap:o,getWithPathsAsJSONGraph:a}},{12:12,13:13,17:17,31:31}],20:[function(e,t,r){var n=e(29),i=e(25),o=n.promote;t.exports=function(e,t,r,n,a){var s=t.value;a.errors||(a.errors=[]),e._boxed&&(s=i(t)),a.errors.push({path:n.slice(0,r+1),value:s}),o(e,t)}},{25:25,29:29}],21:[function(e,t,r){function n(e,t,r,n,i,o,a){a.requestedMissingPaths.push(n.slice(0,r).concat(t)),a.optimizedMissingPaths.push(i.slice(0,o).concat(t))}var i=e(30).fastCopy;t.exports=function(e,t,r,o,a,s,u){o.requestedMissingPaths||(o.requestedMissingPaths=[],o.optimizedMissingPaths=[]),n(0,r<t.length?i(t,r):[],r,a,s,u,o)}},{30:30}],22:[function(e,t,r){var n=e(29),i=e(25),o=n.promote,a=e(120),s=e(118),u=e(119),c=e(37);t.exports=function(e,t,r,n,l,h,p,f,d,m){if(r){var v,y,g,b,_,x,w,S,T=!1;if(t&&o(e,t),t&&void 0!==t.value||(T=e._materialized),T)S={$type:s};else if(e._boxed)S=i(t);else if(t.$type===a||t.$type===u)S=d?i(t):t.value;else if(d){var E=t.value&&"object"==typeof t.value,O=!t[c];S=E||O?i(t):t.value}else S=t.value;if(l&&(l.hasValue=!0),d){for((_=r.jsonGraph)||(_=r.jsonGraph={},r.paths=[]),v=0,y=f-1;y>v;v++)b=p[v],_[b]||(_[b]={}),_=_[b];_[b=p[v]]=T?{$type:s}:S,h&&r.paths.push(h.slice(0,n))}else if(0===n)r.json=S;else{for((_=r.json)||(_=r.json={}),v=0;n-1>v;v++)g=h[v],_[g]||(_[g]={}),x=_,w=g,_=_[g];null!==(g=h[v])?_[g]=S:x[w]=S}}}},{118:118,119:119,120:120,25:25,29:29,37:37}],23:[function(e,t,r){var n=e(27),i=e(26),o=e(29),a=i.remove,s=o.splice,u=e(119),c=e(20),l=e(22),h=e(21),p=e(28),f=e(35);t.exports=function(e,t,r,i,o,d,m,v,y,g,b){var _=t&&t.$type,x=t&&void 0===t.value;return t&&_?void(n(t)?(t[f]||(s(e,t),a(t)),h(e,r,i,d,m,v,y)):_===u?(b&&(m[i]=null),g||e._treatErrorsAsValues?l(e,t,o,i,d,m,v,y,g,b):c(e,t,i,m,d)):(b&&(m[i]=null),(!x||x&&e._materialized)&&l(e,t,o,i,d,m,v,y,g,b))):void(p(e)?l(e,t,o,i,d,m,v,y,g,b):h(e,r,i,d,m,v,y))}},{119:119,20:20,21:21,22:22,26:26,27:27,28:28,29:29,35:35}],24:[function(e,t,r){var n=e(134);t.exports=function(e){var t=n.fromPath(e);if(!1===Array.isArray(t))throw new Error("Model#getValueSync must be called with an Array path.");return this._path.length&&(t=this._path.concat(t)),this._syncCheck("getValueSync")&&this._getValueSync(this,t).value}},{134:134}],25:[function(e,t,r){var n=e(40);t.exports=function(e){var t,r,i,o=Object.keys(e);for(t={},r=0,i=o.length;i>r;r++){var a=o[r];a[0]!==n&&(t[a]=e[a])}return t}},{40:40}],26:[function(e,t,r){var n=e(43),i=e(33),o=e(42),a=e(44);t.exports={create:function(e,t){var r=t[a]||0;t[n+r]=e,t[a]=r+1,e[o]=r,e[i]=t},remove:function(e){var t=e[i];if(t){for(var r=e[o],s=t[a];s>r;)t[n+r]=t[n+r+1],++r;t[a]=s-1,e[i]=void 0,e[o]=void 0}}}},{33:33,42:42,43:43,44:44}],27:[function(e,t,r){var n=e(106);t.exports=function(e){var t=void 0===e.$expires&&-1||e.$expires;return-1!==t&&1!==t&&(0===t||t<n())}},{106:106}],28:[function(e,t,r){t.exports=function(e){return e._materialized&&!e._source}},{}],29:[function(e,t,r){var n=e(34),i=e(45),o=e(38),a=e(41),s=e(35);t.exports={promote:function(e,t){var r=e._root,i=r[n];if(i!==t){var s=t[a],u=t[o];u&&(u[a]=s),s&&(s[o]=u),t[a]=void 0,r[n]=t,t[o]=i,i[a]=t}},splice:function(e,t){var r=e._root,u=t[a],c=t[o];c&&(c[a]=u),u&&(u[o]=c),t[a]=void 0,t===r[n]&&(r[n]=void 0),t===r[i]&&(r[i]=void 0),t[s]=!0,r.expired.push(t)}}},{34:34,35:35,38:38,41:41,45:45}],30:[function(e,t,r){t.exports={fastCat:function(e,t){var r,n,i,o=[];for(r=0,n=e.length;n>r;r++)o[r]=e[r];for(i=0,n=t.length;n>i;i++)o[r++]=t[i];return o},fastCatSkipNulls:function(e,t){var r,n,i,o=[];for(r=0,n=e.length;n>r;r++)o[r]=e[r];for(i=0,n=t.length;n>i;i++)null!==t[i]&&(o[r++]=t[i]);return o},fastCopy:function(e,t){var r,n,i,o=[];for(n=0,i=t||0,r=e.length;r>i;n++,i++)o[n]=e[i];return o}}},{}],31:[function(e,t,r){var n=e(11),i=e(23),o=e(27),a=e(143).iterateKeySet,s=e(120),u=e(29).promote;t.exports=function e(t,r,c,l,h,p,f,d,m,v,y,g){var b=g,_=m;if(!c||c&&c.$type||h===l.length)i(t,c,l,h,p,f,d,_,v,y,b);else{var x,w,S=h+1,T=!1,E=x=l[h];if("object"==typeof x&&(T={},E=a(x,T)),void 0!==E||!T.done){var O=v+1;do{b=!1;var M;null===E?M=c:(M=c[E],_[v]=E,d[h]=E);var C=_,j=O;if(M){var P=M.$type,A=P&&M.value||M;if(S<l.length&&P&&P===s&&!o(M)){y&&i(t,M,l,S,p,f,null,_,j,y,b),u(t,M);var N=n(t,r,r,M,A,p,y);b=!0,M=N[0];var L=N[1];for(C=[],j=L.length,w=0;j>w;++w)C[w]=L[w]}}e(t,r,M,l,S,p,f,d,C,j,y,b),T&&!T.done&&(E=a(x,T))}while(T&&!T.done)}}}},{11:11,120:120,143:143,23:23,27:27,29:29}],32:[function(e,t,r){"use strict";function n(e){return new n.Model(e)}"function"==typeof Promise?n.Promise=Promise:n.Promise=e(151),t.exports=n,n.Model=e(2)},{151:151,2:2}],33:[function(e,t,r){t.exports=e(40)+"context"},{40:40}],34:[function(e,t,r){t.exports=e(40)+"head"},{40:40}],35:[function(e,t,r){t.exports=e(40)+"invalidated"},{40:40}],36:[function(e,t,r){t.exports=e(40)+"key"},{40:40}],37:[function(e,t,r){t.exports="$modelCreated"},{}],38:[function(e,t,r){t.exports=e(40)+"next"},{40:40}],39:[function(e,t,r){t.exports=e(40)+"parent"},{40:40}],40:[function(e,t,r){t.exports=String.fromCharCode(30)},{}],41:[function(e,t,r){t.exports=e(40)+"prev"},{40:40}],42:[function(e,t,r){t.exports=e(40)+"ref-index"},{40:40}],43:[function(e,t,r){t.exports=e(40)+"ref"},{40:40}],44:[function(e,t,r){t.exports=e(40)+"refs-length"},{40:40}],45:[function(e,t,r){t.exports=e(40)+"tail"},{40:40}],46:[function(e,t,r){t.exports=e(40)+"version"},{40:40}],47:[function(e,t,r){function n(e,t,r,i,a,s,c,l,h,p){if(!w(e)&&!e.$type)for(var f in e)if(f[0]!==u&&"$"!==f[0]&&g(e,f)){var d=e[f],m=b(d)&&!d.$type,v=o(r,i,a,f,d,m,!1,s,c,l,h,p),_=v[0],x=v[1];_&&(m?n(d,t+1,r,x,_,s,c,l,h,p):O(_,x,f,l)&&E(x,y(_),l,s))}}function i(e,t,r,n,i,a,u,h){if(_(r))return S(r,i,a),[void 0,t];v(a,r);var d=r,m=r.value,y=t;if(null!=(r=r[l]))y=r[c]||t;else{var g=0,b=m.length-1;y=r=t;do{var x=o(t,y,r,m[g],e,b>g,!0,n,i,a,u,h);if(r=x[0],w(r))return x;y=x[1]}while(g++<b);if(d[l]!==r){var T=r[f]||0;r[f]=T+1,r[s+T]=d,d[l]=r,d[p]=T}}return[r,y]}function o(e,t,r,n,o,s,u,c,l,h,p,f){for(var m=r.$type;m===d;){var v=i(o,e,r,c,l,h,p,f);if(r=v[0],w(r))return v;t=v[1],m=r&&r.$type}if(void 0!==m)return[r,t];if(null==n){if(s)throw new Error("`null` is not allowed in branch key positions.");r&&(n=r[a])}else t=r,r=t[n];return[r,t]}var a=e(36),s=e(43),u=e(40),c=e(39),l=e(33),h=e(46),p=e(42),f=e(44),d=e(120),m=e(13),v=e(50),y=e(88),g=e(91),b=e(100),_=e(95),x=e(96),w=e(102),S=e(86),T=e(92),E=e(115),O=e(109);t.exports=function(e,t){for(var r=e._root,i=r,o=r.expired,a=T(),s=r._comparator,u=r._errorSelector,l=e._path,p=r.cache,f=l.length?m(e,l).value:p,d=f[c]||p,v=p[h],y=-1,g=t.length;++y<g;)n(t[y].json,0,p,d,f,a,o,i,s,u);var b=p[h],_=r.onChange;x(_)&&v!==b&&_()}},{100:100,102:102,109:109,115:115,120:120,13:13,33:33,36:36,39:39,40:40,42:42,43:43,44:44,46:46,50:50,86:86,88:88,91:91,92:92,95:95,96:96}],48:[function(e,t,r){function n(e,t,r,i,a,s,u,c){var l={},h=t<e.length-1,p=e[t],f=x(p,l);do{var d=o(r,i,a,f,h,!1,s,u,c),m=d[0],y=d[1];m&&(h?n(e,t+1,r,y,m,s,u,c):T(m,y,f,c)&&S(y,v(m),c,s)),f=x(p,l)}while(!l.done)}function i(e,t,r,n,i){if(y(t))return _(t,n,i),[void 0,e];m(i,t);var a=t,l=t.value,f=e;if(null!=(t=t[c]))f=t[u]||e;else{var d=0,v=l.length-1;f=t=e;do{var g=o(e,f,t,l[d],v>d,!0,r,n,i);if(t=g[0],b(t))return g;f=g[1]}while(d++<v);if(a[c]!==t){var x=t[p]||0;t[p]=x+1,t[s+x]=a,a[c]=t,a[h]=x}}return[t,f]}function o(e,t,r,n,o,s,u,c,l){for(var h=r.$type;h===f;){var p=i(e,r,u,c,l);if(r=p[0],b(r))return p;t=p[1],h=r.$type}if(void 0!==h)return[r,t];if(null==n){if(o)throw new Error("`null` is not allowed in branch key positions.");r&&(n=r[a])}else t=r,r=t[n];return[r,t]}var a=e(36),s=e(43),u=e(39),c=e(33),l=e(46),h=e(42),p=e(44),f=e(120),d=e(13),m=e(50),v=e(88),y=e(95),g=e(96),b=e(102),_=e(86),x=e(143).iterateKeySet,w=e(92),S=e(115),T=e(109);t.exports=function(e,t){for(var r=e._root,i=r,o=r.expired,a=w(),s=e._path,c=r.cache,h=s.length?d(e,s).value:c,p=h[u]||c,f=c[l],m=-1,v=t.length;++m<v;)n(t[m],0,c,p,h,a,o,i);var y=c[l],b=r.onChange;g(b)&&f!==y&&b()}},{102:102,109:109,115:115,120:120,13:13,143:143,33:33,36:36,39:39,42:42,43:43,44:44,46:46,50:50,86:86,88:88,92:92,95:95,96:96}],49:[function(e,t,r){var n=e(36),i=e(39),o=e(34),a=e(45),s=e(38),u=e(41),c=e(108),l=e(115);t.exports=function(e,t,r,h,p,f){var d=r,m=p;"number"!=typeof m&&(m=.75);var v,y,g,b="number"==typeof f,_=h*m;for(y=t.pop();y;)g=y.$size||0,d-=g,!0===b?l(y,g,e,f):(v=y[i])&&c(y,v,y[n],e),y=t.pop();if(d>=h){var x=e[a];for(y=x;d>=_&&y;)x=x[u],g=y.$size||0,d-=g,!0===b&&l(y,g,e,f),y=x;e[a]=e[u]=y,null==y?e[o]=e[s]=void 0:y[s]=void 0}}},{108:108,115:115,34:34,36:36,38:38,39:39,41:41,45:45}],50:[function(e,t,r){var n=e(121),i=e(34),o=e(45),a=e(38),s=e(41),u=e(100);t.exports=function(e,t){if(u(t)&&t.$expires!==n){var r=e[i],c=e[o],l=t[a],h=t[s];t!==r&&(null!=l&&"object"==typeof l&&(l[s]=h),null!=h&&"object"==typeof h&&(h[a]=l),l=r,null!=r&&"object"==typeof r&&(r[s]=t),e[i]=e[a]=r=t,r[a]=l,r[s]=void 0),null!=c&&t!==c||(e[o]=e[s]=c=h||t)}return t}},{100:100,121:121,34:34,38:38,41:41,45:45}],51:[function(e,t,r){var n=e(34),i=e(45),o=e(38),a=e(41);t.exports=function(e,t){var r=e[n],s=e[i],u=t[o],c=t[a];null!=u&&"object"==typeof u&&(u[a]=c),null!=c&&"object"==typeof c&&(c[o]=u),t===r&&(e[n]=e[o]=u),t===s&&(e[i]=e[a]=c),t[o]=t[a]=void 0,r=s=u=c=void 0}},{34:34,38:38,41:41,45:45}],52:[function(e,t,r){function n(e,t){var r=!1;return function(){r||e._disposed||(r=!0,e._callbacks[t]=null,e._optimizedPaths[t]=[],e._requestedPaths[t]=[],0!==--e._count||e.sent||(e._disposable.dispose(),e.requestQueue.removeRequest(e)))}}function i(e){for(var t=[],r=-1,n=0,i=e.length;i>n;++n)for(var o=e[n],a=0,s=o.length;s>a;++a)t[++r]=o[a];return t}var o=e(59),a=e(60),s=0,u=e(57).GetRequest,c=e(76),l=e(78),h=e(119),p=[],f=function(e,t){this.sent=!1,this.scheduled=!1,this.requestQueue=t,this.id=++s,this.type=u,this._scheduler=e,this._pathMap={},this._optimizedPaths=[],this._requestedPaths=[],this._callbacks=[],this._count=0,this._disposable=null,this._collapsed=null,this._disposed=!1};f.prototype={batch:function(e,t,r){var i=this,o=i._optimizedPaths,s=i._requestedPaths,u=i._callbacks,c=o.length;return o[c]=t,s[c]=e,u[c]=r,++i._count,i.scheduled||(i.scheduled=!0,i._disposable=i._scheduler.schedule(function(){a(i,o,function(e,t){if(i.requestQueue.removeRequest(i),i._disposed=!0,i._count){i._merge(s,e,t);for(var r=0,n=u.length;n>r;++r){var o=u[r];o&&o(e,t)}}})})),n(i,c)},add:function(e,t,r){var i,a,s=this,u=o(e,t,s._pathMap);u?(a=u[2],i=u[1]):(a=e,i=t);var c=!1,l=!1;if(i.length<t.length){c=!0;var h=s._callbacks.length;s._callbacks[h]=r,s._requestedPaths[h]=u[0],s._optimizedPaths[h]=[],++s._count,l=n(s,h)}return[c,a,i,l]},_merge:function(e,t,r){var n=this.requestQueue.model,o=n._root,a=o.errorSelector,s=o.comparator,u=n._path;n._path=p;var f=i(e);if(t){var d=t;d instanceof Error&&(d={message:d.message}),d.$type||(d={$type:h,value:d});var m=f.map(function(e){return{path:e,value:d}});l(n,m,null,a,s)}else c(n,[{paths:f,jsonGraph:r.jsonGraph}],null,a,s);n._path=u}},t.exports=f},{119:119,57:57,59:59,60:60,76:76,78:78}],53:[function(e,t,r){function n(){this.length=0,this.pending=!1,this.pathmaps=[],a.call(this,this._subscribe)}var i=e(159),o=i.Observer,a=i.Observable,s=i.Disposable,u=i.SerialDisposable,c=i.CompositeDisposable,l=e(9),h=e(143).iterateKeySet;n.create=function(e,t,r){var n=new this;return n.queue=e,n.model=t,n.index=r,n},(n.prototype=Object.create(a.prototype)).constructor=n,n.prototype.insertPath=function(e,t,r,n,i){var o=n||0,a=i||e.length-1,s=r||this.pathmaps[a+1]||(this.pathmaps[a+1]=Object.create(null));if(void 0===s||null===s)return!1;var u,c,l=e[o],p={};u=h(l,p);do{if(c=s[u],a>o){if(null==c){if(t)return!1;c=s[u]=Object.create(null)}if(!1===this.insertPath(e,t,c,o+1,a))return!1}else s[u]=(c||0)+1,this.length+=1;p.done||(u=h(l,p))}while(!p.done);return!0},n.prototype.removePath=function(e,t,r,n){var i=r||0,o=n||e.length-1,a=t||this.pathmaps[o+1];if(void 0===a||null===a)return!0;var s,u,c=0,l=e[i],p={};s=h(l,p);do{if(void 0!==(u=a[s])&&null!==u){if(o>i){c+=this.removePath(e,u,i+1,o);var f=void 0;for(f in u)break;void 0===f&&delete a[s]}else 0===(u=a[s]=(u||1)-1)&&delete a[s],c+=1,this.length-=1;p.done||(s=h(l,p))}}while(!p.done);return c},n.prototype.getSourceObserver=function(e){var t=this;return o.create(function(r){r.jsonGraph=r.jsonGraph||r.jsong||r.values||r.value,r.index=t.index,e.onNext(r)},function(t){e.onError(t)},function(){e.onCompleted()})},n.prototype._subscribe=function(e){var t=this,r=this.queue;t.pending=!0;var n=!1,i=new u,o=s.create(function(){n||(n=!0,r&&r._remove(t))}),a=new c(i,o);try{i.setDisposable(this.model._source[this.method](this.getSourceArgs()).subscribe(this.getSourceObserver(e)))}catch(e){throw new l(e)}return a},t.exports=n},{143:143,159:159,9:9}],54:[function(e,t,r){function n(e,t){this.total=0,this.model=e,this.requests=[],this.scheduler=t}var i=e(58),o=e(40),a=e(90),s=e(100),u=e(143);n.prototype.set=function(e){return e.paths=u.collapse(e.paths),i.create(this.model,e)},n.prototype._remove=function(e){var t=this.requests,r=t.indexOf(e);-1!==r&&t.splice(r,1)},n.prototype.distributePaths=function(e,t,r){var n,i,o=this.model,a=-1,s=e.length,u=-1,c=t.length,l=[];e:for(;++a<s;){var h=e[a];for(u=-1;++u<c;)if((i=t[u]).insertPath(h,i.pending)){l[u]=i;continue e}n||(n=r.create(this,o,this.total++),t[u]=n,l[c++]=n),n.insertPath(h,!1)}var p=[],f=-1;for(u=-1;++u<c;)null!=(i=l[u])&&(p[++f]=i);return p},n.prototype.mergeJSONGraphs=function(e,t){var r=0,n=[],i=[],u=[],c=e.index,l=t.index;e.index=Math.max(c,l),n[-1]=e.jsonGraph||{},i[-1]=t.jsonGraph||{};e:for(;r>-1;){for(var h=n[r-1],p=i[r-1],f=u[r-1]||(u[r-1]=Object.keys(p));f.length>0;){var d=f.pop();if(d[0]!==o)if(h.hasOwnProperty(d)){var m=h[d],v=a(m),y=p[d],g=a(y);if(s(m)&&s(y)&&!v&&!g){n[r]=m,i[r]=y,r+=1;continue e}l>c&&(h[d]=y)}else h[d]=p[d]}r-=1}return e},t.exports=n},{100:100,143:143,40:40,58:58,90:90}],55:[function(e,t,r){function n(e,t){this.model=e,this.scheduler=t,this.requests=this._requests=[]}var i=e(54),o=e(56);n.prototype.get=o.prototype.get,n.prototype.removeRequest=o.prototype.removeRequest,n.prototype.set=i.prototype.set,n.prototype.call=i.prototype.call,t.exports=n},{54:54,56:56}],56:[function(e,t,r){function n(e,t){this.model=e,this.scheduler=t,this.requests=this._requests=[]}var i=e(57),o=e(52);n.prototype={setScheduler:function(e){this.scheduler=e},get:function(e,t,r){function n(){m||0==--h&&r()}var a,s,u,c=this,l=[],h=0,p=c._requests,f=t,d=e,m=!1;for(a=0,s=p.length;s>a;++a)if((u=p[a]).type===i.GetRequest){if(u.sent){var v=u.add(d,f,n);v[0]&&(d=v[1],f=v[2],l[l.length]=v[3],++h)}else u.batch(d,f,n),f=[],d=[],++h;if(!f.length)break}if(f.length){u=new o(c.scheduler,c),p[p.length]=u,++h;var y=u.batch(d,f,n);l[l.length]=y}return function(){if(!m&&0!==h){m=!0;for(var e=l.length,t=0;e>t;++t)l[t]()}}},removeRequest:function(e){for(var t=this._requests,r=t.length;--r>=0;)if(t[r].id===e.id){t.splice(r,1);break}}},t.exports=n},{52:52,57:57}],57:[function(e,t,r){t.exports={GetRequest:"GET"}},{}],58:[function(e,t,r){function n(){o.call(this)}var i=e(159).Observer,o=e(53),a=e(83),s=e(76),u=e(78),c=new Array(0);n.create=function(e,t){var r=new n;return r.model=e,r.jsonGraphEnvelope=t,r},(n.prototype=Object.create(o.prototype)).constructor=n,n.prototype.method="set",n.prototype.insertPath=function(){return!1},n.prototype.removePath=function(){return 0},n.prototype.getSourceArgs=function(){return this.jsonGraphEnvelope},n.prototype.getSourceObserver=function(e){var t=this.model,r=t._path,n=this.jsonGraphEnvelope.paths,l=t._root,h=l.errorSelector,p=l.comparator;return o.prototype.getSourceObserver.call(this,i.create(function(i){t._path=c;var o=s(t,[{paths:n,jsonGraph:i.jsonGraph}],null,h,p);i.paths=o[1],t._path=r,e.onNext(i)},function(i){t._path=c,u(t,a(n,function(e){return{path:e,value:i}}),null,h,p),t._path=r,e.onError(i)},function(){e.onCompleted()}))},t.exports=n},{159:159,53:53,76:76,78:78,83:83}],59:[function(e,t,r){var n=e(143).hasIntersection,i=e(84);t.exports=function(e,t,r){for(var o=[],a=[],s=[],u=-1,c=-1,l=!1,h=0,p=t.length;p>h;++h){var f=t[h],d=r[f.length];d&&n(d,f,0)?(!l&&h>0&&(a=i(e,0,h),o=i(t,0,h)),s[++u]=e[h],l=!0):l&&(o[++c]=f,a[c]=e[h])}return l?[s,o,a]:null}},{143:143,84:84}],60:[function(e,t,r){var n=e(143),i=n.toTree,o=n.toPaths;t.exports=function(e,t,r){if(0!==e._count){e.sent=!0,e.scheduled=!1;for(var n=e._pathMap,a=0,s=Object.keys(t).length;s>a;++a)for(var u=t[a],c=0,l=u.length;l>c;++c){var h=u[c],p=h.length;if(n[p]){var f=n[p];f[f.length]=h}else n[p]=[h]}for(var d=Object.keys(n),m=0,v=d.length;v>m;++m){var y=d[m];n[y]=i(n[y])}var g,b=e._collasped=o(n);e.requestQueue.model._source.get(b).subscribe(function(e){g=e},function(e){r(e,g)},function(){r(null,g)})}else e.requestQueue.removeRequest(e)}},{143:143}],61:[function(e,t,r){function n(e){s.call(this,e||o)}function i(e){return a.Observable.defer(function(){return e})}function o(e){function t(e){return b.concat(e)}var r=this.args,n=this.model,o=h.fromPath(r[0]),c=r[1]||[],f=(r[2]||[]).map(h.fromPath),d=(r[3]||[]).map(h.fromPath),m=n._clone({_path:[]}),v=m.withoutDataSource(),y=n._path,g=y.concat(o),b=g.slice(0,-1),_=i(n.withoutDataSource().get(o)).map(function(e){for(var t=e.json,r=-1,n=o.length;t&&++r<n;)t=t[o[r]];return{model:m._derefSync(b).boxValues(),localFn:t}}).flatMap(function(e){function r(e,t){var r=t.path;return e.push.apply(e,f.map(function(e){return r.concat(e)})),e}function n(e){return e.path}var o=e&&e.localFn;if("function"==typeof o){var a=e.model,u=a._path,l=o.apply(a,c).reduce(function(e,r){if(Boolean(r.invalidated))e.invalidations.push(e.localThisPath.concat(r.path));else{var n=r.path,i=r.value;Boolean(i)&&"object"==typeof i&&i.$type===p?e.references.push({path:t(n),value:r.value}):e.values.push({path:t(n),value:r.value})}return e},{values:[],references:[],invalidations:[],localThisPath:u}).flatMap(function(e){var t=e.values.concat(e.references);return t.length>0?i(v.set.apply(v,t)._toJSONG()).map(function(t){return{results:e,envelope:t}}):s.return({results:e,envelope:{jsonGraph:{},paths:[]}})}).flatMap(function(e){var o=e.envelope,a=e.results,u=a.values,c=a.references,l=a.invalidations,h=u.map(n).map(t),p=c.reduce(r,[]),f=d.map(t),v=p.concat(f);return(v.length>0?i(m.get.apply(m,h.concat(v))._toJSONG()):s.return(o)).doAction(function(e){e.invalidated=l})});return s.return(l)}return s.empty()}).defaultIfEmpty(function(e){return e&&"object"==typeof e?a.Observable.defer(function(){var t;try{t=e.call(g,c,f,d)}catch(e){t=s.throw(new l(e))}return t}).map(function(e){var t=e.invalidated;return t&&t.length&&m.invalidate.apply(m,t),e}):s.empty()}(n._source)).mergeAll().flatMap(function(e){return i(v.set(e)).reduce(function(e){return e},null).map(function(){return{invalidated:e.invalidated,paths:e.paths.map(function(e){return e.slice(y.length)})}})}),x=new u;return x.add(_.subscribe(function(t){var r=t.paths,o=t.invalidated,a=n.get.apply(n,r);"AsJSONG"===e.outputFormat&&(a=i(a._toJSONG()).doAction(function(e){e.invalidated=o})),x.add(a.subscribe(e))},function(t){e.onError(t)})),x}var a=e(159)&&e(158),s=a.Observable,u=a.CompositeDisposable,c=e(64),l=e(9),h=e(134),p=e(120);n.create=c.create,(n.prototype=Object.create(s.prototype)).constructor=n,n.prototype.invokeSourceRequest=function(e){return this},n.prototype.ensureCollect=function(e){return this},n.prototype.initialize=function(){return this},t.exports=n},{120:120,134:134,158:158,159:159,64:64,9:9}],62:[function(e,t,r){function n(e){i.call(this,e)}var i=e(159).Observable,o=e(64),a=e(134),s=e(88),u=e(49),c=e(81),l=e(46),h=Array.isArray,p=e(101),f=e(98),d=e(99);n.create=o.create,(n.prototype=Object.create(i.prototype)).constructor=n,n.prototype.subscribeCount=0,n.prototype.subscribeLimit=10,n.prototype.initialize=function(){for(var e,t,r=this.model,n=this.outputFormat||"AsPathMap",i=this.isProgressive,o=[{}],s=[],u=this.args,l=-1,m=u.length;++l<m;){var v,y=u[l];h(y)||"string"==typeof y?(y=a.fromPath(y),v="PathValues"):p(y)?(y.path=a.fromPath(y.path),v="PathValues"):d(y)?v="JSONGs":f(y)&&(v="PathMaps"),t!==v&&(t=v,e={inputType:v,arguments:[]},s.push(e),e.values=o),e.arguments.push(y)}return this.boundPath=c(r._path),this.groups=s,this.outputFormat=n,this.isProgressive=i,this.isCompleted=!1,this.isMaster=null==r._source,this.values=o,this},n.prototype.invokeSourceRequest=function(e){return this},n.prototype.ensureCollect=function(e){var t=this.finally(function(){var t=e._root,r=t.cache;t.collectionScheduler.schedule(function(){u(t,t.expired,s(r),e._maxSize,e._collectRatio,r[l])})});return new this.constructor(function(e){return t.subscribe(e)})},t.exports=n},{101:101,134:134,159:159,46:46,49:49,64:64,81:81,88:88,98:98,99:99}],63:[function(e,t,r){function n(e){a.call(this,e||i)}function i(e){for(var t=this.model,r=this.method,n=this.groups,i=-1,a=n.length;++i<a;){var s=n[i],u=s.inputType,c=s.arguments;c.length>0&&(0,t["_"+r+u+"AsJSON"])(t,c)}return e.onCompleted(),o.empty}var o=e(159).Disposable,a=e(62);n.create=a.create,(n.prototype=Object.create(a.prototype)).method="invalidate",n.prototype.constructor=n,t.exports=n},{159:159,62:62}],64:[function(e,t,r){function n(e){this._subscribe=e}function i(e){var t=this.model,r=new this.type;return r.model=t,r.args=this.args,r.outputFormat=e.outputFormat||"AsPathMap",r.isProgressive=e.isProgressive||!1,r.subscribeCount=0,r.subscribeLimit=e.retryLimit||10,r.initialize().invokeSourceRequest(t).ensureCollect(t).subscribe(e)}var o=e(32),a=(e(159)&&e(158)).Observable,s=e(84),u=e(105),c={outputFormat:{value:"AsJSONG"}},l={isProgressive:{value:!0}};n.create=function(e,t){var r=new n(i);return r.args=t,r.type=this,r.model=e,r},(n.prototype=Object.create(a.prototype)).constructor=n,n.prototype._mixin=function(){var e=this,t=s(arguments);return new e.constructor(function(r){return e.subscribe(t.reduce(function(e,t){return Object.create(e,t)},r))})},n.prototype._toJSONG=function(){return this._mixin(c)},n.prototype.progressively=function(){return this._mixin(l)},n.prototype.subscribe=function(e,t,r){var n=e;n&&"object"==typeof n||(n={onNext:e||u,onError:t||u,onCompleted:r||u});var i=this._subscribe(n);switch(typeof i){case"function":return{dispose:i};case"object":return i||{dispose:u};default:return{dispose:u}}},n.prototype.then=function(e,t){var r=this;return new o.Promise(function(e,t){var n,i=!1;r.toArray().subscribe(function(e){n=e.length<=1?e[0]:e},function(e){i=!0,t(e)},function(){!1===i&&e(n)})}).then(e,t)},t.exports=n},{105:105,158:158,159:159,32:32,84:84}],65:[function(e,t,r){function n(e){f.call(this,e||i)}function i(e){return this.isCompleted?a.call(this,e):o.call(this,e)}function o(e){if(this.subscribeCount++>this.subscribeLimit)return e.onError("Loop kill switch thrown."),h.empty;for(var t=[],r=[],n=this.model,i=this.isMaster,o=n._root,c=this.outputFormat,l=o.errorSelector,p=this.method,f=this.groups,d=-1,v=f.length;++d<v;){var y=f[d],g=y.inputType,b=y.arguments;if(b.length>0){var _=(0,n["_"+p+g+c])(n,b,null,l);r.push.apply(r,_[1]),"PathValues"===g?t.push.apply(t,b.map(s)):"JSONGs"===g?t.push.apply(t,m(b,u)):t.push.apply(t,_[0])}}return this.requestedPaths=t,i?(this.isCompleted=!0,a.call(this,e)):void e.onError({method:p,optimizedPaths:r,invokeSourceRequest:!0})}function a(e){var t=new p(this.model,this.requestedPaths);return"AsJSONG"===this.outputFormat&&(t=t._toJSONG()),this.isProgressive&&(t=t.progressively()),t.subscribe(e)}function s(e){return e.path}function u(e){return e.paths}var c=e(159),l=c.Observable,h=c.Disposable,p=e(67),f=e(62),d=e(9),m=e(82),v=new Array(0);n.create=f.create,(n.prototype=Object.create(f.prototype)).method="set",n.prototype.constructor=n,n.prototype.invokeSourceRequest=function(e){var t=this,r=this.catch(function(n){var i;if(n&&!0===n.invokeSourceRequest){var o={},a=e._path,s=n.optimizedPaths;e._path=v,e._getPathValuesAsJSONG(e._materialize().withoutDataSource(),s,[o]),e._path=a,i=e._request.set(o).do(function(e){t.isCompleted=s.length===e.paths.length},function(){t.isCompleted=!0}).materialize().flatMap(function(e){if("C"===e.kind)return l.empty();if("E"===e.kind){var t=e.exception;if(d.is(t))return l.throw(e.exception)}return r})}else i=l.throw(n);return i});return new this.constructor(function(e){return r.subscribe(e)})},t.exports=n},{159:159,62:62,67:67,82:82,9:9}],66:[function(e,t,r){var n=function(e){this.disposed=!1,this.currentDisposable=e};n.prototype={dispose:function(){if(!this.disposed&&this.currentDisposable){this.disposed=!0;var e=this.currentDisposable;e.dispose?e.dispose():e()}}},t.exports=n},{}],67:[function(e,t,r){var n=e(64),i=e(68),o=e(69),a={dispose:function(){}},s=e(159).Observable,u=t.exports=function(e,t,r,n){this.model=e,this.currentRemainingPaths=t,this.isJSONGraph=r||!1,this.isProgressive=n||!1};u.prototype=Object.create(s.prototype),u.prototype.subscribe=n.prototype.subscribe,u.prototype.then=n.prototype.then,u.prototype._toJSONG=function(){return new u(this.model,this.currentRemainingPaths,!0,this.isProgressive)},u.prototype.progressively=function(){return new u(this.model,this.currentRemainingPaths,this.isJSONGraph,!0)},u.prototype._subscribe=function(e){var t=[{}],r=[],n=e.isJSONG=this.isJSONGraph,s=this.isProgressive,u=i(this.model,this.currentRemainingPaths,e,s,n,t,r);return u?o(this,this.model,u,e,t,r,1):a}},{159:159,64:64,68:68,69:69}],68:[function(e,t,r){var n=e(19),i=n.getWithPathsAsJSONGraph,o=n.getWithPathsAsPathMap;t.exports=function(e,t,r,n,a,s,u){var c;if((c=a?i(e,t,s):o(e,t,s)).criticalError)return r.onError(c.criticalError),null;var l=c.hasValue,h=!c.requestedMissingPaths||!e._source,p=s[0].json||s[0].jsonGraph;if(c.errors)for(var f=c.errors,d=u.length,m=0,v=f.length;v>m;++m,++d)u[d]=f[m];if(l&&n||p&&h)try{++e._root.syncRefCount,r.onNext(s[0])}catch(e){throw e}finally{--e._root.syncRefCount}return h?(u.length?r.onError(u):r.onCompleted(),null):c}},{19:19}],69:[function(e,t,r){var n=e(68),i=e(10),o=e(30).fastCat,a=e(49),s=e(88),u=e(66),c=e(46);t.exports=function e(t,r,l,h,p,f,d){if(10===d)throw new i;var m=r._request,v=l.requestedMissingPaths,y=l.optimizedMissingPaths,g=new u,b=[],_=r._path;if(_.length)for(var x=0,w=v.length;w>x;++x)b[x]=o(_,v[x]);else b=v;var S=m.get(b,y,function(){var i=n(r,v,h,t.isProgressive,t.isJSONGraph,p,f);if(i)g.currentDisposable=e(t,r,i,h,p,f,d+1);else{var o=r._root,u=o.cache,l=u[c];a(o,o.expired,s(u),r._maxSize,r._collectRatio,l)}});return g.currentDisposable=S,g}},{10:10,30:30,46:46,49:49,66:66,68:68,88:88}],70:[function(e,t,r){var n=e(67);t.exports=function(e){return new n(this,e)}},{67:67}],71:[function(e,t,r){var n=e(134),i=e(64),o=e(72),a=e(116),s=e(67);t.exports=function(){var e=a(arguments,o,"get");if(!0!==e)return new i(function(t){t.onError(e)});var t=n.fromPathsOrPathValues(arguments);return new s(this,t)}},{116:116,134:134,64:64,67:67,72:72}],72:[function(e,t,r){t.exports={path:!0,pathSyntax:!0}},{}],73:[function(e,t,r){function n(){}var i=e(123),o=e(159).Disposable;n.prototype.schedule=function(e){return i(e),o.empty},n.prototype.scheduleWithState=function(e,t){var r=this;return i(function(){t(r,e)}),o.empty},t.exports=n},{123:123,159:159}],74:[function(e,t,r){function n(){}var i=e(159).Disposable;n.prototype.schedule=function(e){return e(),i.empty},n.prototype.scheduleWithState=function(e,t){return t(this,e),i.empty},t.exports=n},{159:159}],75:[function(e,t,r){function n(e){this.delay=e}var i=e(159).Disposable;n.prototype.schedule=function(e){var t=setTimeout(e,this.delay);return i.create(function(){void 0!==t&&(clearTimeout(t),t=void 0)})},n.prototype.scheduleWithState=function(e,t){var r=this,n=setTimeout(function(){t(r,e)},this.delay);return i.create(function(){void 0!==n&&(clearTimeout(n),n=void 0)})},t.exports=n},{159:159}],76:[function(e,t,r){function n(e,t,r,i,a,s,u,c,l,h,p,d,m,v,y,b,_){for(var x={},w=t<e.length-1,S=e[t],T=g(S,x),E=d.index;;){p.depth=t;var O=o(r,i,a,s,u,c,T,w,!1,p,d,m,v,y,b,_);p[t]=T,p.index=t,d[d.index++]=T;var M=O[0],C=O[1];if(M&&(w?n(e,t+1,r,C,M,s,O[3],O[2],l,h,p,d,m,v,y,b,_):(f(y,M),l.push(p.slice(0,p.index+1)),h.push(d.slice(0,d.index)))),T=g(S,x),x.done)break;d.index=E}}function i(e,t,r,n,i,a,c,p,m,g,b){var _=t.value;if(a.splice(0,a.length),a.push.apply(a,_),d(t))return a.index=_.length,y(t,p,m),[void 0,e,n,r];f(m,t);var x=0,w=t,S=_.length-1,T=t=e,E=n=r;do{var O=o(e,T,t,r,E,n,_[x],S>x,!0,i,a,c,p,m,g,b);if(t=O[0],v(t))return a.index=x,O;T=O[1],n=O[2],E=O[3]}while(x++<S);if(a.index=x,w[u]!==t){var M=t[h]||0;t[h]=M+1,t[s+M]=w,w[u]=t,w[l]=M}return[t,T,n,E]}function o(e,t,r,n,o,s,u,c,l,h,f,d,m,y,g,b){for(var x=r.$type;x===p;){var w=i(e,r,n,s,h,f,d,m,y,g,b);if(r=w[0],v(r))return w;t=w[1],s=w[2],o=w[3],x=r.$type}if(void 0!==x)return[r,t,s,o];if(null==u){if(c)throw new Error("`null` is not allowed in branch key positions.");r&&(u=r[a])}else t=r,o=s,r=t[u],s=o&&o[u];return r=_(t,r,s,u,h,f,d,m,y,g,b),[r,t,s,o]}var a=e(36),s=e(43),u=e(33),c=e(46),l=e(42),h=e(44),p=e(120),f=e(50),d=e(94),m=e(96),v=e(102),y=e(86),g=e(143).iterateKeySet,b=e(92),_=e(103);t.exports=function(e,t,r,i,o){for(var a=e._root,s=a,u=a.expired,l=b(),h=a.cache,p=h[c],f=[],d=[],v=[],y=[],g=-1,_=t.length;++g<_;)for(var x=t[g],w=x.paths,S=x.jsonGraph,T=-1,E=w.length;++T<E;){var O=w[T];d.index=0,n(O,0,h,h,h,S,S,S,v,y,f,d,l,u,s,o,i)}var M=h[c],C=a.onChange;return m(C)&&p!==M&&C(),[v,y]}},{102:102,103:103,120:120,143:143,33:33,36:36,42:42,43:43,44:44,46:46,50:50,86:86,92:92,94:94,96:96}],77:[function(e,t,r){function n(e,t,r,i,s,u,c,l,h,p,f,d,m,v){var y=a(e);if(y&&y.length)for(var b=0,x=y.length,w=h.index;;){var S=y[b],T=e[S],E=_(T)&&!T.$type;l.depth=t;var O=o(r,i,s,S,T,E,!1,l,h,p,f,d,m,v);l[t]=S,l.index=t,h[h.index++]=S;var M=O[0],C=O[1];if(M&&(E?n(T,t+1,r,C,M,u,c,l,h,p,f,d,m,v):(g(d,M),u.push(l.slice(0,l.index+1)),c.push(h.slice(0,h.index)))),++b>=x)break;h.index=w}}function i(e,t,r,n,i,a,s,c,p,m){var v=r.value;if(i.splice(0,i.length),i.push.apply(i,v),x(r))return i.index=v.length,T(r,s,c),[void 0,t];g(c,r);var y=r,b=t;if(null!=(r=r[h]))b=r[l]||t,i.index=v.length;else{var _=0,w=v.length-1;b=r=t;do{var E=o(t,b,r,v[_],e,w>_,!0,n,i,a,s,c,p,m);if(r=E[0],S(r))return i.index=_,E;b=E[1]}while(_++<w);if(i.index=_,y[h]!==r){var O=r[d]||0;r[d]=O+1,r[u+O]=y,y[h]=r,y[f]=O}}return[r,b]}function o(e,t,r,n,o,a,u,c,l,h,p,f,d,v){for(var y=r.$type;y===m;){var g=i(o,e,r,c,l,h,p,f,d,v);if(r=g[0],S(r))return g;t=g[1],y=r&&r.$type}if(void 0!==y)return[r,t];if(null==n){if(a)throw new Error("`null` is not allowed in branch key positions.");r&&(n=r[s])}else t=r,r=t[n];return r=O(t,r,n,o,a,u,c,l,h,p,f,d,v),[r,t]}function a(e){if(_(e)&&!e.$type){var t=[],r=0;y(e)&&(t[r++]="length");for(var n in e)n[0]!==c&&"$"!==n[0]&&b(e,n)&&(t[r++]=n);return t}}var s=e(36),u=e(43),c=e(40),l=e(39),h=e(33),p=e(46),f=e(42),d=e(44),m=e(120),v=e(13),y=Array.isArray,g=e(50),b=e(91),_=e(100),x=e(95),w=e(96),S=e(102),T=e(86),E=e(92),O=e(104);t.exports=function(e,t,r,i,o){for(var a=e._root,s=a,u=a.expired,c=E(),h=e._path,f=a.cache,d=h.length?v(e,h).value:f,m=d[l]||f,y=f[p],g=[],b=[],_=[],x=h.length,S=-1,T=t.length;++S<T;){var O=t[S],M=h.slice(0);M.index=x,n(O.json,0,f,m,d,b,_,g,M,c,u,s,o,i)}var C=f[p],j=a.onChange;return w(j)&&y!==C&&j(),[b,_]}},{100:100,102:102,104:104,120:120,13:13,33:33,36:36,39:39,40:40,42:42,43:43,44:44,46:46,50:50,86:86,91:91,92:92,95:95,96:96}],78:[function(e,t,r){function n(e,t,r,i,a,s,u,c,l,h,p,f,d,v,y){for(var g={},b=r<t.length-1,x=t[r],w=_(x,g),S=h.index;;){l.depth=r;var T=o(i,a,s,w,e,b,!1,l,h,p,f,d,v,y);l[r]=w,l.index=r,h[h.index++]=w;var E=T[0],O=T[1];if(E&&(b?n(e,t,r+1,i,O,E,u,c,l,h,p,f,d,v,y):(m(d,E),u.push(l.slice(0,l.index+1)),c.push(h.slice(0,h.index)))),w=_(x,g),g.done)break;h.index=S}}function i(e,t,r,n,i,a,l,f,d,y){var _=r.value;if(i.splice(0,i.length),i.push.apply(i,_),v(r))return i.index=_.length,b(r,l,f),[void 0,t];m(f,r);var x=r,w=t;if(null!=(r=r[c]))w=r[u]||t,i.index=_.length;else{var S=0,T=_.length-1;w=r=t;do{var E=o(t,w,r,_[S],e,T>S,!0,n,i,a,l,f,d,y);if(r=E[0],g(r))return i.index=S,E;w=E[1]}while(S++<T);if(i.index=S,x[c]!==r){var O=r[p]||0;r[p]=O+1,r[s+O]=x,x[c]=r,x[h]=O}}return[r,w]}function o(e,t,r,n,o,s,u,c,l,h,p,d,m,v){for(var y=r.$type;y===f;){var b=i(o,e,r,c,l,h,p,d,m,v);if(r=b[0],g(r))return b;t=b[1],y=r.$type}if(void 0!==y)return[r,t];if(null==n){if(s)throw new Error("`null` is not allowed in branch key positions.");r&&(n=r[a])}else t=r,r=t[n];return r=w(t,r,n,o,s,u,c,l,h,p,d,m,v),[r,t]}var a=e(36),s=e(43),u=e(39),c=e(33),l=e(46),h=e(42),p=e(44),f=e(120),d=e(13),m=e(50),v=e(95),y=e(96),g=e(102),b=e(86),_=e(143).iterateKeySet,x=e(92),w=e(104);t.exports=function(e,t,r,i,o){for(var a=e._root,s=a,c=a.expired,h=x(),p=e._path,f=a.cache,m=p.length?d(e,p).value:f,v=m[u]||f,g=f[l],b=[],_=[],w=[],S=p.length,T=-1,E=t.length;++T<E;){var O=t[T],M=O.path,C=O.value,j=p.slice(0);j.index=S,n(C,M,0,f,v,m,_,w,b,j,h,c,s,o,i)}var P=f[l],A=a.onChange;return y(A)&&g!==P&&A(),[_,w]}},{102:102,104:104,120:120,13:13,143:143,33:33,36:36,39:39,42:42,43:43,44:44,46:46,50:50,86:86,92:92,95:95,96:96}],79:[function(e,t,r){var n=e(130),i=e(64),o=e(101);t.exports=function(e,t){for(var r=o(e)?e:n.pathValue(e,t),a=0,s=r.path,u=s.length;++a<u;)if("object"==typeof s[a])return new i(function(e){e.onError(new Error("Paths must be simple paths"))});var c=this;return new i(function(e){return c._set(r).subscribe(function(t){for(var r=t.json,n=-1,i=s.length;r&&++n<i;)r=r[s[n]];e.onNext(r)},function(t){e.onError(t)},function(){e.onCompleted()})})}},{101:101,130:130,64:64}],80:[function(e,t,r){var n=e(134),i=e(101),o=e(78);t.exports=function(e,t,r,a){var s=n.fromPath(e),u=t,c=r,l=a;if(i(s)?(l=c,c=u,u=s):u={path:s,value:u},!1===i(u))throw new Error("Model#setValueSync must be called with an Array path.");return"function"!=typeof c&&(c=this._root._errorSelector),"function"!=typeof l&&(l=this._root._comparator),this._syncCheck("setValueSync")?(o(this,[u]),this._getValueSync(this,u.path).value):void 0}},{101:101,134:134,78:78}],81:[function(e,t,r){t.exports=function(e){if(!e)return e;for(var t=-1,r=e.length,n=[];++t<r;)n[t]=e[t];return n}},{}],82:[function(e,t,r){t.exports=function(e,t){for(var r=-1,n=-1,i=e.length,o=[];++n<i;)for(var a=t(e[n],n,e),s=-1,u=a.length;++s<u;)o[++r]=a[s];return o}},{}],83:[function(e,t,r){t.exports=function(e,t){for(var r=-1,n=e.length,i=new Array(n);++r<n;)i[r]=t(e[r],r,e);return i}},{}],84:[function(e,t,r){t.exports=function(e,t,r){var n=t||0,i=-1,o=e.length-n;0>o&&(o=0),r>0&&o>r&&(o=r);for(var a=new Array(o);++i<o;)a[i]=e[i+n];return a}},{}],85:[function(e,t,r){var n=e(40),i=e(91),o=Array.isArray,a=e(100);t.exports=function(e){var t=e;if(a(t)){t=o(e)?[]:{};var r=e;for(var s in r)s[0]!==n&&i(r,s)&&(t[s]=r[s])}return t}},{100:100,40:40,91:91}],86:[function(e,t,r){var n=e(51),i=e(35);t.exports=function(e,t,r){return e[i]||(e[i]=!0,t.push(e),n(r,e)),e}},{35:35,51:51}],87:[function(e,t,r){var n=e(100);t.exports=function(e){return n(e)&&e.$expires||void 0}},{100:100}],88:[function(e,t,r){var n=e(100);t.exports=function(e){return n(e)&&e.$size||0}},{100:100}],89:[function(e,t,r){var n=e(100);t.exports=function(e){return n(e)&&e.$timestamp||void 0}},{100:100}],90:[function(e,t,r){var n=e(100);t.exports=function(e,t){var r=n(e)&&e.$type||void 0;return t&&r?"branch":r}},{100:100}],91:[function(e,t,r){var n=e(100),i=Object.prototype.hasOwnProperty;t.exports=function(e,t){return n(e)&&i.call(e,t)}},{100:100}],92:[function(e,t,r){var n=1;t.exports=function(){return n++}},{}],93:[function(e,t,r){var n=e(36),i=e(39),o=e(46);t.exports=function(e,t,r,a){return e[n]=r,e[i]=t,e[o]=a,t[r]=e,e}},{36:36,39:39,46:46}],94:[function(e,t,r){var n=e(106),i=e(122),o=e(121);t.exports=function(e){var t=e.$expires;return null!=t&&t!==o&&t!==i&&t<n()}},{106:106,121:121,122:122}],95:[function(e,t,r){var n=e(106),i=e(122),o=e(121);t.exports=function(e){var t=e.$expires;return null!=t&&t!==o&&(t===i||t<n())}},{106:106,121:121,122:122}],96:[function(e,t,r){t.exports=function(e){return Boolean(e)&&"function"==typeof e}},{}],97:[function(e,t,r){var n=e(40);t.exports=function(e){return"$size"===e||e&&e.charAt(0)===n}},{40:40}],98:[function(e,t,r){var n=e(100);t.exports=function(e){return n(e)&&"json"in e}},{100:100}],99:[function(e,t,r){var n=Array.isArray,i=e(100);t.exports=function(e){return i(e)&&n(e.paths)&&(i(e.jsonGraph)||i(e.jsong)||i(e.json)||i(e.values)||i(e.value))}},{100:100}],100:[function(e,t,r){t.exports=function(e){return null!==e&&"object"==typeof e}},{}],101:[function(e,t,r){var n=Array.isArray,i=e(100);t.exports=function(e){return i(e)&&(n(e.path)||"string"==typeof e.path)}},{100:100}],102:[function(e,t,r){t.exports=function(e){return null==e||"object"!=typeof e}},{}],103:[function(e,t,r){var n=e(36),i=e(39),o=e(120),a=e(119),s=e(88),u=e(89),c=e(100),l=e(95),h=e(96),p=e(50),f=e(117),d=e(93),m=e(86),v=e(110),y=e(115),g=e(107);t.exports=function(e,t,r,b,_,x,w,S,T,E,O){var M,C,j,P,A,N,L;if(t===r){if(null===r)return t=f(r,void 0,r),e=y(e,-t.$size,T,w),t=d(t,e,b),p(T,t),t;if(void 0===r)return r;if((P=c(t))&&null==(C=t.$type))return null==t[i]&&(t[n]=b,t[i]=e),t}else(P=c(t))&&(C=t.$type);if(C!==o){if((A=c(r))&&(j=r.$type),P&&!C&&(null==r||A&&!j))return t}else{if(null==r)return l(t)?void m(t,S,T):t;if((A=c(r))&&(j=r.$type)===o)if(t===r){if(null!=t[i])return t}else if(N=t.$timestamp,L=r.$timestamp,!l(t)&&!l(r)&&N>L)return}if(C&&A&&!j)return d(v(t,r,e,b,T),e,b);if(j||!A){if(j===a&&h(O)&&(r=O(g(_,b),r)),j&&t===r)null==t[i]&&(t=f(t,C,t.value),e=y(e,-t.$size,T,w),t=d(t,e,b,w));else{var I=!0;!C&&P||(I=u(r)<u(t)==0,(C||j)&&h(E)&&(I=!E(t,r,x.slice(0,x.index)))),I&&(r=f(r,j,j?r.value:r),M=s(t)-s(r),t=v(t,r,e,b,T),e=y(e,M,T,w),t=d(t,e,b,w))}l(t)?m(t,S,T):p(T,t)}else null==t&&(t=d(r,e,b));return t}},{100:100,107:107,110:110,115:115,117:117,119:119,120:120,36:36,39:39,50:50,86:86,88:88,89:89,93:93,95:95,96:96}],104:[function(e,t,r){var n=e(120),i=e(119),o=e(90),a=e(88),s=e(89),u=e(95),c=e(102),l=e(96),h=e(117),p=e(86),f=e(93),d=e(110),m=e(115),v=e(114),y=e(107);t.exports=function(e,t,r,g,b,_,x,w,S,T,E,O,M){var C=o(t,_);if(b||_)C&&u(t)&&(C="expired",p(t,T,E)),(C&&C!==n||c(t))&&(t=d(t,{},e,r,E),t=f(t,e,r,S),t=v(t,S));else{var j=g,P=o(j),A=s(j)<s(t)==0;if((C||P)&&l(O)&&(A=!O(t,j,w.slice(0,w.index))),A){P===i&&l(M)&&(j=M(y(x,r),j)),j=h(j,P,P?j.value:j);var N=a(t)-a(j);t=d(t,j,e,r,E),e=m(e,N,E,S),t=f(t,e,r,S)}}return t}},{102:102,107:107,110:110,114:114,115:115,117:117,119:119,120:120,86:86,88:88,89:89,90:90,93:93,95:95,96:96}],105:[function(e,t,r){t.exports=function(){}},{}],106:[function(e,t,r){t.exports=Date.now},{}],107:[function(e,t,r){t.exports=function(e,t){var r=e.slice(0,e.depth);return r[r.length]=t,r}},{}],108:[function(e,t,r){var n=e(120),i=e(39),o=e(51),a=e(100),s=e(112),u=e(113);t.exports=function(e,t,r,c){if(a(e)){var l=e.$type;return Boolean(l)&&(l===n&&u(e),o(c,e)),s(e),t[r]=e[i]=void 0,!0}return!1}},{100:100,112:112,113:113,120:120,39:39,51:51}],109:[function(e,t,r){var n=e(91),i=e(40),o=e(108);t.exports=function e(t,r,a,s){if(o(t,r,a,s)){if(null==t.$type)for(var u in t)u[0]!==i&&"$"!==u[0]&&n(t,u)&&e(t[u],t,u,s);return!0}return!1}},{108:108,40:40,91:91}],110:[function(e,t,r){var n=e(100),i=e(111),o=e(109);t.exports=function(e,t,r,a,s){return e===t?e:(n(e)&&(i(e,t),o(e,r,a,s)),r[a]=t,t)}},{100:100,109:109,111:111}],111:[function(e,t,r){var n=e(43),i=e(33),o=e(44);t.exports=function(e,t){for(var r=e[o]||0,a=t[o]||0,s=-1;++s<r;){var u=e[n+s];void 0!==u&&(u[i]=t,t[n+(a+s)]=u,e[n+s]=void 0)}return t[o]=r+a,e[o]=void 0,t}},{33:33,43:43,44:44}],112:[function(e,t,r){var n=e(43),i=e(33),o=e(42),a=e(44);t.exports=function(e){for(var t=-1,r=e[a]||0;++t<r;){var s=e[n+t];null!=s&&(s[i]=s[o]=e[n+t]=void 0)}return e[a]=void 0,e}},{33:33,42:42,43:43,44:44}],113:[function(e,t,r){var n=e(43),i=e(33),o=e(42),a=e(44);t.exports=function(e){var t=e[i];if(t){for(var r=(e[o]||0)-1,s=(t[a]||0)-1;++r<=s;)t[n+r]=t[n+(r+1)];t[a]=s,e[o]=e[i]=t=void 0}return e}},{33:33,42:42,43:43,44:44}],114:[function(e,t,r){var n=e(43),i=e(39),o=e(46),a=e(44);t.exports=function(e,t){var r=[e],s=0;do{var u=r[s--];if(u&&u[o]!==t){u[o]=t,r[s++]=u[i];for(var c=-1,l=u[a]||0;++c<l;)r[s++]=u[n+c]}}while(s>-1);return e}},{39:39,43:43,44:44,46:46}],115:[function(e,t,r){var n=e(36),i=e(46),o=e(39),a=e(108),s=e(114);t.exports=function(e,t,r,u){var c=e;do{var l=c[o];0>=(c.$size=(c.$size||0)-t)&&null!=l?a(c,l,c[n],r):c[i]!==u&&s(c,u),c=l}while(c);return e}},{108:108,114:114,36:36,39:39,46:46}],116:[function(e,t,r){var n=Array.isArray,i=e(101),o=e(99),a=e(98),s=e(134);t.exports=function(e,t,r){for(var u=0,c=e.length;c>u;++u){var l=e[u],h=!1;if(n(l)&&t.path?h=!0:"string"==typeof l&&t.pathSyntax?h=!0:i(l)&&t.pathValue?(l.path=s.fromPath(l.path),h=!0):o(l)&&t.jsonGraph?h=!0:a(l)&&t.json?h=!0:"function"==typeof l&&u+1===c&&t.selector&&(h=!0),!h)return new Error("Unrecognized argument "+typeof l+" ["+String(l)+"] to Model#"+r)}return!0}},{101:101,134:134,98:98,99:99}],117:[function(e,t,r){var n=e(130).atom,i=e(106),o=e(122),a=e(37),s=e(85),u=Array.isArray,c=e(88),l=e(87);t.exports=function(e,t,r){var h=0,p=e,f=t;if(f?(p=s(p),h=c(p),p.$type=f):(p=n(r),f=p.$type,p[a]=!0),null==r)h=51;else if(null==h||0>=h)switch(typeof r){case"object":h=u(r)?50+r.length:51;break;case"string":h=50+r.length;break;default:h=51}var d=l(p);return"number"==typeof d&&o>d&&(p.$expires=i()+-1*d),p.$size=h,p}},{106:106,122:122,130:130,37:37,85:85,87:87,88:88}],118:[function(e,t,r){t.exports="atom"},{}],119:[function(e,t,r){t.exports="error"},{}],120:[function(e,t,r){t.exports="ref"},{}],121:[function(e,t,r){t.exports=1},{}],122:[function(e,t,r){t.exports=0},{}],123:[function(e,t,r){"use strict";function n(e){var t;(t=a.length?a.pop():new i).task=e,o(t)}function i(){this.task=null}var o=e(124),a=[],s=[],u=o.makeRequestCallFromTimer(function(){if(s.length)throw s.shift()});t.exports=n,i.prototype.call=function(){try{this.task.call()}catch(e){n.onerror?n.onerror(e):(s.push(e),u())}finally{this.task=null,a[a.length]=this}}},{124:124}],124:[function(e,t,r){(function(e){"use strict";function r(e){a.length||(o(),s=!0),a[a.length]=e}function n(){for(;u<a.length;){var e=u;if(u+=1,a[e].call(),u>c){for(var t=0,r=a.length-u;r>t;t++)a[t]=a[t+u];a.length-=u,u=0}}a.length=0,u=0,s=!1}function i(e){return function(){function t(){clearTimeout(r),clearInterval(n),e()}var r=setTimeout(t,0),n=setInterval(t,50)}}t.exports=r;var o,a=[],s=!1,u=0,c=1024,l=e.MutationObserver||e.WebKitMutationObserver;o="function"==typeof l?function(e){var t=1,r=new l(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}(n):i(n),r.requestFlush=o,r.makeRequestCallFromTimer=i}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],125:[function(e,t,r){"use strict";function n(e,t){var r;for(r in t)e[r]=t[r];return e}function i(e,t){this._jsongUrl=e,"number"==typeof t&&(t={timeout:t}),this._config=n({timeout:15e3,headers:{}},t||{})}var o=e(129),a=e(126);Array.isArray,i.prototype={constructor:i,buildQueryObject:a,get:function(e){var t=n(this.buildQueryObject(this._jsongUrl,"GET",{paths:e,method:"get"}),this._config);return o("GET",t,this)},set:function(e){var t="POST",r=n(this.buildQueryObject(this._jsongUrl,t,{jsonGraph:e,method:"set"}),this._config);return r.headers["Content-Type"]="application/x-www-form-urlencoded",o(t,r,this)},call:function(e,t,r,i){t=t||[],r=r||[],i=i||[];var a="POST",s=[];s.push("method=call"),s.push("callPath="+encodeURIComponent(JSON.stringify(e))),s.push("arguments="+encodeURIComponent(JSON.stringify(t))),s.push("pathSuffixes="+encodeURIComponent(JSON.stringify(r))),s.push("paths="+encodeURIComponent(JSON.stringify(i)));var u=n(this.buildQueryObject(this._jsongUrl,a,s.join("&")),this._config);return u.headers["Content-Type"]="application/x-www-form-urlencoded",o(a,u,this)}},i.XMLHttpSource=i,i.default=i,t.exports=i},{126:126,129:129}],126:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=[],i={url:e},o=-1!==e.indexOf("?")?"&":"?";return"string"==typeof r?n.push(r):Object.keys(r).forEach(function(e){var t="object"==typeof r[e]?JSON.stringify(r[e]):r[e];n.push(e+"="+encodeURIComponent(t))}),"GET"===t?i.url+=o+n.join("&"):i.data=n.join("&"),i}},{}],127:[function(e,t,r){(function(e){"use strict";t.exports=function(){var t=new e.XMLHttpRequest;if("withCredentials"in t)return t;if(e.XDomainRequest)return new XDomainRequest;throw new Error("CORS is not supported by your browser")}}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],128:[function(e,t,r){(function(e){"use strict";t.exports=function(){var t,r,n;if(e.XMLHttpRequest)return new e.XMLHttpRequest;try{for(r=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],n=0;3>n;n++)try{if(t=r[n],new e.ActiveXObject(t))break}catch(e){}return new e.ActiveXObject(t)}catch(e){throw new Error("XMLHttpRequest is not supported by your browser")}}}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],129:[function(e,t,r){"use strict";function n(){}function i(e,t,r){r||(r=new Error(t)),e.onError(r)}function o(e,t,r){var n,o;if(t&&e){o=t.responseType,n="response"in t?t.response:t.responseText;var a=1223===t.status?204:t.status;if(a>=200&&399>=a){try{"json"!==o&&(n=JSON.parse(n||"")),"string"==typeof n&&(n=JSON.parse(n||""))}catch(r){i(e,"invalid json",r)}return e.onNext(n),void e.onCompleted()}return 401===a||403===a||407===a?i(e,n):410===a?i(e,n):408===a||504===a?i(e,n):i(e,n||"Response code "+a)}}function a(e,t,r,n){i(e,r||t.statusText||"request error",n)}var s=e(128),u=e(127),c=Object.prototype.hasOwnProperty,l=function(){};n.create=function(e){var t=new n;return t.subscribe=function(t,r,n){var i,o;return i="function"==typeof t?{onNext:t,onError:r||l,onCompleted:n||l}:t,"function"==typeof(o=e(i))?{dispose:o}:o},t},t.exports=function(e,t,r){return n.create(function(n){var i,l,h,p,f,d={method:e||"GET",crossDomain:!1,async:!0,headers:{},responseType:"json"};for(f in t)c.call(t,f)&&(d[f]=t[f]);d.crossDomain||d.headers["X-Requested-With"]||(d.headers["X-Requested-With"]="XMLHttpRequest"),null!=r.onBeforeRequest&&r.onBeforeRequest(d);try{i=d.crossDomain?u():s()}catch(e){n.onError(e)}try{d.user?i.open(d.method,d.url,d.async,d.user,d.password):i.open(d.method,d.url,d.async),i.timeout=d.timeout,i.withCredentials=!1!==d.withCredentials,h=d.headers;for(p in h)c.call(h,p)&&i.setRequestHeader(p,h[p]);if(d.responseType)try{i.responseType=d.responseType}catch(e){if("json"!==d.responseType)throw e}i.onreadystatechange=function(e){4===i.readyState&&(l||(l=!0,o(n,i)))},i.ontimeout=function(e){l||(l=!0,a(n,i,"timeout error",e))},i.send(d.data)}catch(e){n.onError(e)}return function(){l||4===i.readyState||(l=!0,i.abort())}})}},{127:127,128:128}],130:[function(e,t,r){function n(e,t,r){var n=Object.create(null);if(null!=r){for(var i in r)n[i]=r[i];return n.$type=e,n.value=t,n}return{$type:e,value:t}}var i=e(134);t.exports={ref:function(e,t){return n("ref",i.fromPath(e),t)},atom:function(e,t){return n("atom",e,t)},undefined:function(){return n("atom")},error:function(e,t){return n("error",e,t)},pathValue:function(e,t){return{path:i.fromPath(e),value:t}},pathInvalidation:function(e){return{path:i.fromPath(e),invalidated:!0}}}},{134:134}],131:[function(e,t,r){t.exports={integers:"integers",ranges:"ranges",keys:"keys"}},{}],132:[function(e,t,r){var n={token:"token",dotSeparator:".",commaSeparator:",",openingBracket:"[",closingBracket:"]",openingBrace:"{",closingBrace:"}",escape:"\\",space:" ",colon:":",quote:"quote",unknown:"unknown"};t.exports=n},{}],133:[function(e,t,r){t.exports={indexer:{nested:"Indexers cannot be nested.",needQuotes:"unquoted indexers must be numeric.",empty:"cannot have empty indexers.",leadingDot:"Indexers cannot have leading dots.",leadingComma:"Indexers cannot have leading comma.",requiresComma:"Indexers require commas between indexer args.",routedTokens:"Only one token can be used per indexer when specifying routed tokens."},range:{precedingNaN:"ranges must be preceded by numbers.",suceedingNaN:"ranges must be suceeded by numbers."},routed:{invalid:"Invalid routed token. only integers|ranges|keys are supported."},quote:{empty:"cannot have empty quoted keys.",illegalEscape:"Invalid escape character. Only quotes are escapable."},unexpectedToken:"Unexpected token.",invalidIdentifier:"Invalid Identifier.",invalidPath:"Please provide a valid path.",throwError:function(e,t,r){if(r)throw e+" -- "+t.parseString+" with next token: "+r;throw e+" -- "+t.parseString}}},{}],134:[function(e,t,r){var n=e(140),i=e(135),o=e(131),a=function(e,t){return i(new n(e,t))};t.exports=a,a.fromPathsOrPathValues=function(e,t){if(!e)return[];for(var r=[],n=0,i=e.length;i>n;n++)"string"==typeof e[n]?r[n]=a(e[n],t):"string"==typeof e[n].path?r[n]={path:a(e[n].path,t),value:e[n].value}:r[n]=e[n];return r},a.fromPath=function(e,t){return e?"string"==typeof e?a(e,t):e:[]},a.RoutedTokens=o},{131:131,135:135,140:140}],135:[function(e,t,r){var n=e(132),i=e(133),o=e(136);t.exports=function(e){for(var t=e.next(),r={},a=[];!t.done;){switch(t.type){case n.token:var s=+t.token[0];isNaN(s)||i.throwError(i.invalidIdentifier,e),a[a.length]=t.token;break;case n.dotSeparator:0===a.length&&i.throwError(i.unexpectedToken,e);break;case n.space:break;case n.openingBracket:o(e,t,r,a);break;default:i.throwError(i.unexpectedToken,e)}t=e.next()}return 0===a.length&&i.throwError(i.invalidPath,e),a}},{132:132,133:133,136:136}],136:[function(e,t,r){var n=e(132),i=e(133),o=i.indexer,a=e(138),s=e(137),u=e(139);t.exports=function(e,t,r,c){var l=e.next(),h=!1,p=1,f=!1;for(r.indexer=[];!l.done;){switch(l.type){case n.token:case n.quote:r.indexer.length===p&&i.throwError(o.requiresComma,e)}switch(l.type){case n.openingBrace:f=!0,u(e,l,r,c);break;case n.token:var d=+l.token;isNaN(d)&&i.throwError(o.needQuotes,e),r.indexer[r.indexer.length]=d;break;case n.dotSeparator:r.indexer.length||i.throwError(o.leadingDot,e),a(e,l,r,c);break;case n.space:break;case n.closingBracket:h=!0;break;case n.quote:s(e,l,r,c);break;case n.openingBracket:i.throwError(o.nested,e);break;case n.commaSeparator:++p;break;default:i.throwError(i.unexpectedToken,e)}if(h)break;l=e.next()}0===r.indexer.length&&i.throwError(o.empty,e),r.indexer.length>1&&f&&i.throwError(o.routedTokens,e),1===r.indexer.length&&(r.indexer=r.indexer[0]),c[c.length]=r.indexer,r.indexer=void 0}},{132:132,133:133,137:137,138:138,139:139}],137:[function(e,t,r){var n=e(132),i=e(133),o=i.quote;t.exports=function(e,t,r,a){for(var s=e.next(),u="",c=t.token,l=!1,h=!1;!s.done;){switch(s.type){case n.token:case n.space:case n.dotSeparator:case n.commaSeparator:case n.openingBracket:case n.closingBracket:case n.openingBrace:case n.closingBrace:l&&i.throwError(o.illegalEscape,e),u+=s.token;break;case n.quote:l?(u+=s.token,l=!1):s.token!==c?u+=s.token:h=!0;break;case n.escape:l=!0;break;default:i.throwError(i.unexpectedToken,e)}if(h)break;s=e.next()}0===u.length&&i.throwError(o.empty,e),r.indexer[r.indexer.length]=u}},{132:132,133:133}],138:[function(e,t,r){var n=e(140),i=e(132),o=e(133);t.exports=function(e,t,r,a){var s,u=e.peek(),c=1,l=!1,h=!0,p=r.indexer.length-1,f=n.toNumber(r.indexer[p]);for(isNaN(f)&&o.throwError(o.range.precedingNaN,e);!l&&!u.done;){switch(u.type){case i.dotSeparator:3===c&&o.throwError(o.unexpectedToken,e),3===++c&&(h=!1);break;case i.token:s=n.toNumber(e.next().token),isNaN(s)&&o.throwError(o.range.suceedingNaN,e),l=!0;break;default:l=!0}if(l)break;e.next(),u=e.peek()}r.indexer[p]={from:f,to:h?s:s-1}}},{132:132,133:133,140:140}],139:[function(e,t,r){var n=e(132),i=e(131),o=e(133),a=o.routed;t.exports=function(e,t,r,s){var u=e.next(),c=!1,l="";switch(u.token){case i.integers:case i.ranges:case i.keys:break;default:o.throwError(a.invalid,e)}var h=e.next();if(h.type===n.colon&&(c=!0,(h=e.next()).type!==n.token&&o.throwError(a.invalid,e),l=h.token,h=e.next()),h.type===n.closingBrace){var p={type:u.token,named:c,name:l};r.indexer[r.indexer.length]=p}else o.throwError(a.invalid,e)}},{131:131,132:132,133:133}],140:[function(e,t,r){function n(e,t,r){return{token:e,done:r,type:t}}function i(e,t,r){var i,b=!1,_="",x=r?g:y;do{if(i=t+1>=e.length)break;var w=e[t+1];if(void 0===w||-1!==x.indexOf(w)){if(_.length)break;++t;var S;switch(w){case a:S=o.dotSeparator;break;case s:S=o.commaSeparator;break;case u:S=o.openingBracket;break;case c:S=o.closingBracket;break;case l:S=o.openingBrace;break;case h:S=o.closingBrace;break;case v:S=o.space;break;case d:case m:S=o.quote;break;case f:S=o.escape;break;case p:S=o.colon;break;default:S=o.unknown}b=n(w,S,!1);break}_+=w,++t}while(!i);return!b&&_.length&&(b=n(_,o.token,!1)),b||(b={done:!0}),{token:b,idx:t}}var o=e(132),a=".",s=",",u="[",c="]",l="{",h="}",p=":",f="\\",d='"',m="'",v=" ",y="\\'\"[]., ",g="\\{}'\"[]., :",b=t.exports=function(e,t){this._string=e,this._idx=-1,this._extended=t,this.parseString=""};b.prototype={next:function(){var e=this._nextToken?this._nextToken:i(this._string,this._idx,this._extended);return this._idx=e.idx,this._nextToken=!1,this.parseString+=e.token.token,e.token},peek:function(){var e=this._nextToken?this._nextToken:i(this._string,this._idx,this._extended);return this._nextToken=e,e.token}},b.toNumber=function(e){return isNaN(+e)?NaN:+e}},{132:132}],141:[function(e,t,r){var n=e(147),i=e(148);t.exports=function(e){var t=e.reduce(function(e,t){var r=t.length;return e[r]||(e[r]=[]),e[r].push(t),e},{});return Object.keys(t).forEach(function(e){t[e]=i(t[e])}),n(t)}},{147:147,148:148}],142:[function(e,t,r){var n=e(144);t.exports=function e(t,r,i){for(var o=t,a=!0;a&&i<r.length;++i){var s=r[i],u=typeof s;if(s&&"object"===u){var c={},l=n(s,c),h=i+1;do{var p=o[l];(a=void 0!==p)&&(a=e(p,r,h)),l=n(s,c)}while(a&&!c.done);break}a=void 0!==(o=o[s])}return a}},{144:144}],143:[function(e,t,r){t.exports={iterateKeySet:e(144),toTree:e(148),toTreeWithUnion:e(149),pathsComplementFromTree:e(146),pathsComplementFromLengthTree:e(145),hasIntersection:e(142),toPaths:e(147),collapse:e(141)}},{141:141,142:142,144:144,145:145,146:146,147:147,148:148,149:149}],144:[function(e,t,r){function n(e,t){var r=t.from=e.from||0,n=t.to=e.to||"number"==typeof e.length&&t.from+e.length-1||0;t.rangeOffset=t.from,t.loaded=!0,r>n&&(t.empty=!0)}function i(e,t){t.done=!1;var r=t.isObject=!(!e||"object"!=typeof e);t.isArray=r&&o(e),t.arrayOffset=0}var o=Array.isArray;t.exports=function(e,t){if(void 0===t.isArray&&i(e,t),t.isArray){var r;do{if(t.loaded&&t.rangeOffset>t.to&&(++t.arrayOffset,t.loaded=!1),t.arrayOffset>=e.length){t.done=!0;break}var o=e[t.arrayOffset];if("object"===typeof o){if(t.loaded||n(o,t),t.empty)continue;r=t.rangeOffset++}else++t.arrayOffset,r=o}while(void 0===r);return r}return t.isObject?(t.loaded||n(e,t),t.rangeOffset>t.to?void(t.done=!0):t.rangeOffset++):(t.done=!0,e)}},{}],145:[function(e,t,r){var n=e(142);t.exports=function(e,t){for(var r=[],i=-1,o=0,a=e.length;a>o;++o){var s=e[o];n(t[s.length],s,0)||(r[++i]=s)}return r}},{142:142}],146:[function(e,t,r){var n=e(142);t.exports=function(e,t){for(var r=[],i=-1,o=0,a=e.length;a>o;++o)n(t,e[o],0)||(r[++i]=e[o]);return r}},{142:142}],147:[function(e,t,r){function n(e){return null!==e&&typeof e===p}function i(e,t,r){var n,o,a,s,h,p,f,d,m,v,y,g,b,_,x=c(String(t)),w=Object.create(null),S=[],T=-1,E=0,O=[],M=0;if(s=[],h=-1,r-1>t){for(p=u(e,s);++h<p;)n=s[h],o=i(e[n],t+1,r),a=o.code,w[a]?o=w[a]:(S[E++]=a,o=w[a]={keys:[],sets:o.sets}),x=c(x+n+a),l(n)&&o.keys.push(parseInt(n,10))||o.keys.push(n);for(;++T<E;)if(n=S[T],o=w[n],s=o.keys,(p=s.length)>0)for(f=o.sets,d=-1,m=f.length,b=s[0];++d<m;){for(y=-1,g=(v=f[d]).length,(_=new Array(g+1))[0]=p>1&&s||b;++y<g;)_[y+1]=v[y];O[M++]=_}}else for(p=u(e,s),O[M++]=p>1?[s]:s;++h<p;)x=c(x+s[h]);return{code:x,sets:O}}function o(e){for(var t=-1,r=e.length;++t<r;){var n=e[t];h(n)&&(e[t]=a(n))}return e}function a(e){for(var t=-1,r=e.length-1,n=r>0;++t<=r;){var i=e[t];if(!l(i)){n=!1;break}e[t]=parseInt(i,10)}if(!0===n){e.sort(s);var o=e[0],a=e[r];if(r>=a-o)return{from:o,to:a}}return e}function s(e,t){return e-t}function u(e,t,r){var n=0;for(var i in e)t[n++]=i;return n>1&&t.sort(r),n}function c(e){for(var t=5381,r=-1,n=e.length;++r<n;)t=(t<<5)+t+e.charCodeAt(r);return String(t)}function l(e){return!h(e)&&e-parseFloat(e)+1>=0}var h=Array.isArray,p="object";t.exports=function(e){var t,r=[],a=0;for(var s in e)if(l(s)&&n(t=e[s]))for(var u=i(t,0,parseInt(s,10)).sets,c=-1,h=u.length;++c<h;)r[a++]=o(u[c]);return r}},{}],148:[function(e,t,r){function n(e,t,r){var o,a=t[r],s={},u=r+1;o=i(a,s);do{var c=e[o];c||(u===t.length?e[o]=null:c=e[o]={}),u<t.length&&n(c,t,u),s.done||(o=i(a,s))}while(!s.done)}var i=e(144);Array.isArray,t.exports=function(e){return e.reduce(function(e,t){return n(e,t,0),e},{})}},{144:144}],149:[function(e,t,r){},{}],150:[function(e,t,r){function n(){l=!1,s.length?c=s.concat(c):h=-1,c.length&&i()}function i(){if(!l){var e=setTimeout(n);l=!0;for(var t=c.length;t;){for(s=c,c=[];++h<t;)s&&s[h].run();h=-1,t=c.length}s=null,l=!1,clearTimeout(e)}}function o(e,t){this.fun=e,this.array=t}function a(){}var s,u=t.exports={},c=[],l=!1,h=-1;u.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new o(e,t)),1!==c.length||l||setTimeout(i,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=a,u.addListener=a,u.once=a,u.off=a,u.removeListener=a,u.removeAllListeners=a,u.emit=a,u.binding=function(e){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(e){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},{}],151:[function(e,t,r){"use strict";t.exports=e(156)},{156:156}],152:[function(e,t,r){"use strict";function n(){}function i(e){try{return e.then}catch(e){return v=e,y}}function o(e,t){try{return e(t)}catch(e){return v=e,y}}function a(e,t,r){try{e(t,r)}catch(e){return v=e,y}}function s(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._37=0,this._12=null,this._59=[],e!==n&&d(e,this)}function u(e,t,r){return new e.constructor(function(i,o){var a=new s(n);a.then(i,o),c(e,new f(t,r,a))})}function c(e,t){for(;3===e._37;)e=e._12;return 0===e._37?void e._59.push(t):void m(function(){var r=1===e._37?t.onFulfilled:t.onRejected;if(null!==r){var n=o(r,e._12);n===y?h(t.promise,v):l(t.promise,n)}else 1===e._37?l(t.promise,e._12):h(t.promise,e._12)})}function l(e,t){if(t===e)return h(e,new TypeError("A promise cannot be resolved with itself."));if(t&&("object"==typeof t||"function"==typeof t)){var r=i(t);if(r===y)return h(e,v);if(r===e.then&&t instanceof s)return e._37=3,e._12=t,void p(e);if("function"==typeof r)return void d(r.bind(t),e)}e._37=1,e._12=t,p(e)}function h(e,t){e._37=2,e._12=t,p(e)}function p(e){for(var t=0;t<e._59.length;t++)c(e,e._59[t]);e._59=null}function f(e,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=r}function d(e,t){var r=!1,n=a(e,function(e){r||(r=!0,l(t,e))},function(e){r||(r=!0,h(t,e))});r||n!==y||(r=!0,h(t,v))}var m=e(124),v=null,y={};t.exports=s,s._99=n,s.prototype.then=function(e,t){if(this.constructor!==s)return u(this,e,t);var r=new s(n);return c(this,new f(e,t,r)),r}},{124:124}],153:[function(e,t,r){"use strict";var n=e(152);t.exports=n,n.prototype.done=function(e,t){(arguments.length?this.then.apply(this,arguments):this).then(null,function(e){setTimeout(function(){throw e},0)})}},{152:152}],154:[function(e,t,r){"use strict";function n(e){var t=new i(i._99);return t._37=1,t._12=e,t}var i=e(152);t.exports=i;var o=n(!0),a=n(!1),s=n(null),u=n(void 0),c=n(0),l=n("");i.resolve=function(e){if(e instanceof i)return e;if(null===e)return s;if(void 0===e)return u;if(!0===e)return o;if(!1===e)return a;if(0===e)return c;if(""===e)return l;if("object"==typeof e||"function"==typeof e)try{var t=e.then;if("function"==typeof t)return new i(t.bind(e))}catch(e){return new i(function(t,r){r(e)})}return n(e)},i.all=function(e){var t=Array.prototype.slice.call(e);return new i(function(e,r){function n(a,s){if(s&&("object"==typeof s||"function"==typeof s)){if(s instanceof i&&s.then===i.prototype.then){for(;3===s._37;)s=s._12;return 1===s._37?n(a,s._12):(2===s._37&&r(s._12),void s.then(function(e){n(a,e)},r))}var u=s.then;if("function"==typeof u)return void new i(u.bind(s)).then(function(e){n(a,e)},r)}t[a]=s,0==--o&&e(t)}if(0===t.length)return e([]);for(var o=t.length,a=0;a<t.length;a++)n(a,t[a])})},i.reject=function(e){return new i(function(t,r){r(e)})},i.race=function(e){return new i(function(t,r){e.forEach(function(e){i.resolve(e).then(t,r)})})},i.prototype.catch=function(e){return this.then(null,e)}},{152:152}],155:[function(e,t,r){"use strict";var n=e(152);t.exports=n,n.prototype.finally=function(e){return this.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){throw t})})}},{152:152}],156:[function(e,t,r){"use strict";t.exports=e(152),e(153),e(155),e(154),e(157)},{152:152,153:153,154:154,155:155,157:157}],157:[function(e,t,r){"use strict";var n=e(152),i=e(123);t.exports=n,n.denodeify=function(e,t){return t=t||1/0,function(){var r=this,i=Array.prototype.slice.call(arguments,0,t>0?t:0);return new n(function(t,n){i.push(function(e,r){e?n(e):t(r)});var o=e.apply(r,i);!o||"object"!=typeof o&&"function"!=typeof o||"function"!=typeof o.then||t(o)})}},n.nodeify=function(e){return function(){var t=Array.prototype.slice.call(arguments),r="function"==typeof t[t.length-1]?t.pop():null,o=this;try{return e.apply(this,arguments).nodeify(r,o)}catch(e){if(null===r||void 0===r)return new n(function(t,r){r(e)});i(function(){r.call(o,e)})}}},n.prototype.nodeify=function(e,t){return"function"!=typeof e?this:void this.then(function(r){i(function(){e.call(t,null,r)})},function(r){i(function(){e.call(t,r)})})}},{123:123,152:152}],158:[function(e,t,r){(function(n){(function(i){var o={boolean:!1,function:!0,object:!0,number:!1,string:!1,undefined:!1},a=o[typeof window]&&window||this,s=o[typeof r]&&r&&!r.nodeType&&r,u=o[typeof t]&&t&&!t.nodeType&&t,c=(u&&u.exports,o[typeof n]&&n);!c||c.global!==c&&c.window!==c||(a=c),"object"==typeof t&&t&&t.exports===s?t.exports=i(a,t.exports,e(159)):a.Rx=i(a,{},a.Rx)}).call(this,function(e,t,r,n){function i(){try{return f.apply(this,arguments)}catch(e){return R.e=e,R}}function o(e){if(!T(e))throw new TypeError("fn must be a function");return f=e,i}function a(e,t,r){return new y(function(n){var i=!1,o=null,a=[];return e.subscribe(function(e){var s,u;try{u=t(e)}catch(e){return void n.onError(e)}if(s=0,i)try{s=r(u,o)}catch(e){return void n.onError(e)}else i=!0,o=u;s>0&&(o=u,a=[]),s>=0&&a.push(e)},function(e){n.onError(e)},function(){n.onNext(a),n.onCompleted()})},e)}function s(e){if(0===e.length)throw new N;return e[0]}function u(e,t,r,n){if(0>t)throw new I;return new y(function(i){var o=t;return e.subscribe(function(e){0==o--&&(i.onNext(e),i.onCompleted())},function(e){i.onError(e)},function(){r?(i.onNext(n),i.onCompleted()):i.onError(new I)})},e)}function c(e,t,r){return new y(function(n){var i=r,o=!1;return e.subscribe(function(e){o?n.onError(new Error("Sequence contains more than one element")):(i=e,o=!0)},function(e){n.onError(e)},function(){o||t?(n.onNext(i),n.onCompleted()):n.onError(new N)})},e)}function l(e,t,r){return new y(function(n){return e.subscribe(function(e){n.onNext(e),n.onCompleted()},function(e){n.onError(e)},function(){t?(n.onNext(r),n.onCompleted()):n.onError(new N)})},e)}function h(e,t,r){return new y(function(n){var i=r,o=!1;return e.subscribe(function(e){i=e,o=!0},function(e){n.onError(e)},function(){o||t?(n.onNext(i),n.onCompleted()):n.onError(new N)})},e)}function p(e,t,r,i){var o=A(t,r,3);return new y(function(t){var r=0;return e.subscribe(function(n){var a;try{a=o(n,r,e)}catch(e){return void t.onError(e)}a?(t.onNext(i?r:n),t.onCompleted()):r++},function(e){t.onError(e)},function(){t.onNext(i?-1:n),t.onCompleted()})},e)}var f,d=r.Observable,m=d.prototype,v=r.CompositeDisposable,y=r.AnonymousObservable,g=r.Disposable.empty,b=(r.internals.isEqual,r.helpers),_=b.not,x=b.defaultComparer,w=b.identity,S=b.defaultSubComparer,T=b.isFunction,E=b.isPromise,O=b.isArrayLike,M=b.isIterable,C=r.internals.inherits,j=d.fromPromise,P=d.from,A=r.internals.bindCallback,N=r.EmptyError,L=r.ObservableBase,I=r.ArgumentOutOfRangeError,R={e:{}};m.aggregate=function(){var e,t,r=!1,n=this;return 2===arguments.length?(r=!0,t=arguments[0],e=arguments[1]):e=arguments[0],new y(function(i){var o,a,s;return n.subscribe(function(n){!s&&(s=!0);try{o?a=e(a,n):(a=r?e(t,n):n,o=!0)}catch(e){return i.onError(e)}},function(e){i.onError(e)},function(){s&&i.onNext(a),!s&&r&&i.onNext(t),!s&&!r&&i.onError(new N),i.onCompleted()})},n)};var k=function(e){function t(t,r,n,i){this.source=t,this.acc=r,this.hasSeed=n,this.seed=i,e.call(this)}function r(e,t){this.o=e,this.acc=t.acc,this.hasSeed=t.hasSeed,this.seed=t.seed,this.hasAccumulation=!1,this.result=null,this.hasValue=!1,this.isStopped=!1}return C(t,e),t.prototype.subscribeCore=function(e){return this.source.subscribe(new r(e,this))},r.prototype.onNext=function(e){this.isStopped||(!this.hasValue&&(this.hasValue=!0),this.hasAccumulation?this.result=o(this.acc)(this.result,e):(this.result=this.hasSeed?o(this.acc)(this.seed,e):e,this.hasAccumulation=!0),this.result===R&&this.o.onError(this.result.e))},r.prototype.onError=function(e){this.isStopped||(this.isStopped=!0,this.o.onError(e))},r.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.hasValue&&this.o.onNext(this.result),!this.hasValue&&this.hasSeed&&this.o.onNext(this.seed),!this.hasValue&&!this.hasSeed&&this.o.onError(new N),this.o.onCompleted())},r.prototype.dispose=function(){this.isStopped=!0},r.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.o.onError(e),!0)},t}(L);return m.reduce=function(e){var t=!1;if(2===arguments.length){t=!0;var r=arguments[1]}return new k(this,e,t,r)},m.some=function(e,t){var r=this;return e?r.filter(e,t).some():new y(function(e){return r.subscribe(function(){e.onNext(!0),e.onCompleted()},function(t){e.onError(t)},function(){e.onNext(!1),e.onCompleted()})},r)},m.any=function(){return this.some.apply(this,arguments)},m.isEmpty=function(){return this.any().map(_)},m.every=function(e,t){return this.filter(function(t){return!e(t)},t).some().map(_)},m.all=function(){return this.every.apply(this,arguments)},m.includes=function(e,t){function r(e,t){return 0===e&&0===t||e===t||isNaN(e)&&isNaN(t)}var n=this;return new y(function(i){var o=0,a=+t||0;return Math.abs(a)===1/0&&(a=0),0>a?(i.onNext(!1),i.onCompleted(),g):n.subscribe(function(t){o++>=a&&r(t,e)&&(i.onNext(!0),i.onCompleted())},function(e){i.onError(e)},function(){i.onNext(!1),i.onCompleted()})},this)},m.contains=function(e,t){m.includes(e,t)},m.count=function(e,t){return e?this.filter(e,t).count():this.reduce(function(e){return e+1},0)},m.indexOf=function(e,t){var r=this;return new y(function(n){var i=0,o=+t||0;return Math.abs(o)===1/0&&(o=0),0>o?(n.onNext(-1),n.onCompleted(),g):r.subscribe(function(t){i>=o&&t===e&&(n.onNext(i),n.onCompleted()),i++},function(e){n.onError(e)},function(){n.onNext(-1),n.onCompleted()})},r)},m.sum=function(e,t){return e&&T(e)?this.map(e,t).sum():this.reduce(function(e,t){return e+t},0)},m.minBy=function(e,t){return t||(t=S),a(this,e,function(e,r){return-1*t(e,r)})},m.min=function(e){return this.minBy(w,e).map(function(e){return s(e)})},m.maxBy=function(e,t){return t||(t=S),a(this,e,t)},m.max=function(e){return this.maxBy(w,e).map(function(e){return s(e)})},m.average=function(e,t){return e&&T(e)?this.map(e,t).average():this.reduce(function(e,t){return{sum:e.sum+t,count:e.count+1}},{sum:0,count:0}).map(function(e){if(0===e.count)throw new N;return e.sum/e.count})},m.sequenceEqual=function(e,t){var r=this;return t||(t=x),new y(function(n){var i=!1,o=!1,a=[],s=[],u=r.subscribe(function(e){var r,i;if(s.length>0){i=s.shift();try{r=t(i,e)}catch(e){return void n.onError(e)}r||(n.onNext(!1),n.onCompleted())}else o?(n.onNext(!1),n.onCompleted()):a.push(e)},function(e){n.onError(e)},function(){i=!0,0===a.length&&(s.length>0?(n.onNext(!1),n.onCompleted()):o&&(n.onNext(!0),n.onCompleted()))});(O(e)||M(e))&&(e=P(e)),E(e)&&(e=j(e));var c=e.subscribe(function(e){var r;if(a.length>0){var o=a.shift();try{r=t(o,e)}catch(e){return void n.onError(e)}r||(n.onNext(!1),n.onCompleted())}else i?(n.onNext(!1),n.onCompleted()):s.push(e)},function(e){n.onError(e)},function(){o=!0,0===s.length&&(a.length>0?(n.onNext(!1),n.onCompleted()):i&&(n.onNext(!0),n.onCompleted()))});return new v(u,c)},r)},m.elementAt=function(e){return u(this,e,!1)},m.elementAtOrDefault=function(e,t){return u(this,e,!0,t)},m.single=function(e,t){return e&&T(e)?this.where(e,t).single():c(this,!1)},m.singleOrDefault=function(e,t,r){return e&&T(e)?this.filter(e,r).singleOrDefault(null,t):c(this,!0,t)},m.first=function(e,t){return e?this.where(e,t).first():l(this,!1)},m.firstOrDefault=function(e,t,r){return e?this.where(e).firstOrDefault(null,t):l(this,!0,t)},m.last=function(e,t){return e?this.where(e,t).last():h(this,!1)},m.lastOrDefault=function(e,t,r){return e?this.where(e,r).lastOrDefault(null,t):h(this,!0,t)},m.find=function(e,t){return p(this,e,t,!1)},m.findIndex=function(e,t){return p(this,e,t,!0)},m.toSet=function(){if(void 0===e.Set)throw new TypeError;var t=this;return new y(function(r){var n=new e.Set;return t.subscribe(function(e){n.add(e)},function(e){r.onError(e)},function(){r.onNext(n),r.onCompleted()})},t)},m.toMap=function(t,r){if(void 0===e.Map)throw new TypeError;var n=this;return new y(function(i){var o=new e.Map;return n.subscribe(function(e){var n;try{n=t(e)}catch(e){return void i.onError(e)}var a=e;if(r)try{a=r(e)}catch(e){return void i.onError(e)}o.set(n,a)},function(e){i.onError(e)},function(){i.onNext(o),i.onCompleted()})},n)},r})}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{159:159}],159:[function(e,t,r){(function(e,n){(function(i){function o(e){for(var t=[],r=0,n=e.length;n>r;r++)t.push(e[r]);return t}function a(e,t){if(ue&&t.stack&&"object"==typeof e&&null!==e&&e.stack&&-1===e.stack.indexOf(he)){for(var r=[],n=t;n;n=n.source)n.stack&&r.unshift(n.stack);r.unshift(e.stack);var i=r.join("\n"+he+"\n");e.stack=u(i)}}function u(e){for(var t=e.split("\n"),r=[],n=0,i=t.length;i>n;n++){var o=t[n];c(o)||l(o)||!o||r.push(o)}return r.join("\n")}function c(e){var t=p(e);if(!t)return!1;var r=t[0],n=t[1];return r===ce&&n>=le&&Ar>=n}function l(e){return-1!==e.indexOf("(module.js:")||-1!==e.indexOf("(node.js:")}function h(){if(ue)try{throw new Error}catch(r){var e=r.stack.split("\n"),t=p(e[0].indexOf("@")>0?e[1]:e[2]);if(!t)return;return ce=t[0],t[1]}}function p(e){var t=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(e);if(t)return[t[1],Number(t[2])];var r=/at ([^ ]+):(\d+):(?:\d+)$/.exec(e);if(r)return[r[1],Number(r[2])];var n=/.*@(.+):(\d+)$/.exec(e);return n?[n[1],Number(n[2])]:void 0}function f(e){var t=[];if(!ze(e))return t;Ge.nonEnumArgs&&e.length&&qe(e)&&(e=We.call(e));var r=Ge.enumPrototypes&&"function"==typeof e,n=Ge.enumErrorProps&&(e===De||e instanceof Error);for(var i in e)r&&"prototype"==i||n&&("message"==i||"name"==i)||t.push(i);if(Ge.nonEnumShadows&&e!==Fe){var o=e.constructor,a=-1,s=Te;if(e===(o&&o.prototype))var u=e===Ve?Le:e===De?je:Ie.call(e),c=Ue[u];for(;++a<s;)i=Se[a],c&&c[i]||!Re.call(e,i)||t.push(i)}return t}function d(e,t,r){for(var n=-1,i=r(e),o=i.length;++n<o;){var a=i[n];if(!1===t(e[a],a,e))break}return e}function m(e,t){return d(e,t,f)}function v(e){return"function"!=typeof e.toString&&"string"==typeof(e+"")}function y(e,t,r,n){if(e===t)return 0!==e||1/e==1/t;var i=typeof e,o=typeof t;if(e===e&&(null==e||null==t||"function"!=i&&"object"!=i&&"function"!=o&&"object"!=o))return!1;var a=Ie.call(e),s=Ie.call(t);if(a==Ee&&(a=Ae),s==Ee&&(s=Ae),a!=s)return!1;switch(a){case Me:case Ce:return+e==+t;case Pe:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case Ne:case Le:return e==String(t)}var u=a==Oe;if(!u){if(a!=Ae||!Ge.nodeClass&&(v(e)||v(t)))return!1;var c=!Ge.argsObject&&qe(e)?Object:e.constructor,l=!Ge.argsObject&&qe(t)?Object:t.constructor;if(!(c==l||Re.call(e,"constructor")&&Re.call(t,"constructor")||se(c)&&c instanceof c&&se(l)&&l instanceof l)&&("constructor"in e&&"constructor"in t))return!1}r||(r=[]),n||(n=[]);for(var h=r.length;h--;)if(r[h]==e)return n[h]==t;var p=0,f=!0;if(r.push(e),n.push(t),u){if(h=e.length,p=t.length,f=p==h)for(;p--;){var d=t[p];if(!(f=y(e[p],d,r,n)))break}}else m(t,function(t,i,o){return Re.call(o,i)?(p++,f=Re.call(e,i)&&y(e[i],t,r,n)):void 0}),f&&m(e,function(e,t,r){return Re.call(r,t)?f=--p>-1:void 0});return r.pop(),n.pop(),f}function g(e,t){for(var r=new Array(e),n=0;e>n;n++)r[n]=t();return r}function b(){try{return $e.apply(this,arguments)}catch(e){return Ye.e=e,Ye}}function _(e){if(!se(e))throw new TypeError("fn must be a function");return $e=e,b}function x(e){throw e}function w(e,t){this.id=e,this.value=t}function S(e,t){this.scheduler=e,this.disposable=t,this.isDisposed=!1}function T(e,t){t.isDisposed||(t.isDisposed=!0,t.disposable.dispose())}function E(e){this._s=s}function O(e){this._s=s,this._l=s.length,this._i=0}function M(e){this._a=e}function C(e){this._a=e,this._l=N(e),this._i=0}function j(e){return"number"==typeof e&&Q.isFinite(e)}function P(e){var t=e[ge];if(!t&&"string"==typeof e)return new E(e)[ge]();if(!t&&e.length!==i)return new M(e)[ge]();if(!t)throw new TypeError("Object is not iterable");return e[ge]()}function A(e){var t=+e;return 0===t?t:isNaN(t)?t:0>t?-1:1}function N(e){var t=+e.length;return isNaN(t)?0:0!==t&&j(t)?0>=(t=A(t)*Math.floor(Math.abs(t)))?0:t>Kt?Kt:t:t}function L(e,t){this.observer=e,this.parent=t}function I(e,t){return ft(e)||(e=yt),new Yt(t,e)}function R(e,t){this.observer=e,this.parent=t}function k(e,t){this.observer=e,this.parent=t}function D(e,t){return new Or(function(r){var n=new st,i=new ut;return i.setDisposable(n),n.setDisposable(e.subscribe(function(e){r.onNext(e)},function(e){try{var n=t(e)}catch(e){return r.onError(e)}ae(n)&&(n=zt(n));var o=new st;i.setDisposable(o),o.setDisposable(n.subscribe(r))},function(e){r.onCompleted(e)})),i},e)}function F(){return!1}function V(e,t){var r=this;return new Or(function(n){var i=0,o=e.length;return r.subscribe(function(r){if(o>i){var a=e[i++],s=_(t)(r,a);if(s===Ye)return n.onError(s.e);n.onNext(s)}else n.onCompleted()},function(e){n.onError(e)},function(){n.onCompleted()})},r)}function F(){return!1}function B(){return[]}function F(){return!1}function U(){return[]}function G(e,t){this.observer=e,this.accumulator=t.accumulator,this.hasSeed=t.hasSeed,this.seed=t.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function z(e,t,r){var n=we(t,r,3);return e.map(function(t,r){var i=n(t,r,e);return ae(i)&&(i=zt(i)),(xe(i)||_e(i))&&(i=Xt(i)),i}).concatAll()}function q(e,t,r){for(var n=0,i=e.length;i>n;n++)if(r(e[n],t))return n;return-1}function $(e){this.comparer=e,this.set=[]}function H(e,t,r){var n=we(t,r,3);return e.map(function(t,r){var i=n(t,r,e);return ae(i)&&(i=zt(i)),(xe(i)||_e(i))&&(i=Xt(i)),i}).mergeAll()}var W={boolean:!1,function:!0,object:!0,number:!1,string:!1,undefined:!1},Q=W[typeof window]&&window||this,K=W[typeof r]&&r&&!r.nodeType&&r,X=W[typeof t]&&t&&!t.nodeType&&t,Y=X&&X.exports===K&&K,Z=W[typeof n]&&n;!Z||Z.global!==Z&&Z.window!==Z||(Q=Z);var J={internals:{},config:{Promise:Q.Promise},helpers:{}},ee=J.helpers.noop=function(){},te=(J.helpers.notDefined=function(e){return void 0===e},J.helpers.identity=function(e){return e}),re=(J.helpers.pluck=function(e){return function(t){return t[e]}},J.helpers.just=function(e){return function(){return e}},J.helpers.defaultNow=Date.now),ne=J.helpers.defaultComparer=function(e,t){return He(e,t)},ie=J.helpers.defaultSubComparer=function(e,t){return e>t?1:t>e?-1:0},oe=(J.helpers.defaultKeySerializer=function(e){return e.toString()},J.helpers.defaultError=function(e){throw e}),ae=J.helpers.isPromise=function(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then},se=(J.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},J.helpers.not=function(e){return!e},J.helpers.isFunction=function(){var e=function(e){return"function"==typeof e||!1};return e(/x/)&&(e=function(e){return"function"==typeof e&&"[object Function]"==Ie.call(e)}),e}());J.config.longStackSupport=!1;var ue=!1;try{throw new Error}catch(e){ue=!!e.stack}var ce,le=h(),he="From previous event:";(J.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)}).prototype=Error.prototype;var pe=J.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};pe.prototype=Error.prototype;var fe=J.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};fe.prototype=Error.prototype;var de=J.NotSupportedError=function(e){this.message=e||"This operation is not supported",Error.call(this)};de.prototype=Error.prototype;var me=J.NotImplementedError=function(e){this.message=e||"This operation is not implemented",Error.call(this)};me.prototype=Error.prototype;var ve=J.helpers.notImplemented=function(){throw new me},ye=J.helpers.notSupported=function(){throw new de},ge="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";Q.Set&&"function"==typeof(new Q.Set)["@@iterator"]&&(ge="@@iterator");var be=J.doneEnumerator={done:!0,value:i},_e=J.helpers.isIterable=function(e){return e[ge]!==i},xe=J.helpers.isArrayLike=function(e){return e&&e.length!==i};J.helpers.iterator=ge;var we=J.internals.bindCallback=function(e,t,r){if(void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}},Se=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Te=Se.length,Ee="[object Arguments]",Oe="[object Array]",Me="[object Boolean]",Ce="[object Date]",je="[object Error]",Pe="[object Number]",Ae="[object Object]",Ne="[object RegExp]",Le="[object String]",Ie=Object.prototype.toString,Re=Object.prototype.hasOwnProperty,ke=Ie.call(arguments)==Ee,De=Error.prototype,Fe=Object.prototype,Ve=String.prototype,Be=Fe.propertyIsEnumerable;try{!(Ie.call(document)==Ae&&!({toString:0}+""))}catch(e){!0}var Ue={};Ue[Oe]=Ue[Ce]=Ue[Pe]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Ue[Me]=Ue[Le]={constructor:!0,toString:!0,valueOf:!0},Ue[je]=Ue["[object Function]"]=Ue[Ne]={constructor:!0,toString:!0},Ue[Ae]={constructor:!0};var Ge={};!function(){var e=function(){this.x=1},t=[];e.prototype={valueOf:1,y:1};for(var r in new e)t.push(r);for(r in arguments);Ge.enumErrorProps=Be.call(De,"message")||Be.call(De,"name"),Ge.enumPrototypes=Be.call(e,"prototype"),Ge.nonEnumArgs=0!=r,Ge.nonEnumShadows=!/valueOf/.test(t)}(1);var ze=J.internals.isObject=function(e){var t=typeof e;return e&&("function"==t||"object"==t)||!1},qe=function(e){return!(!e||"object"!=typeof e)&&Ie.call(e)==Ee};ke||(qe=function(e){return!(!e||"object"!=typeof e)&&Re.call(e,"callee")});var $e,He=J.internals.isEqual=function(e,t){return y(e,t,[],[])},We=Array.prototype.slice,Qe=this.inherits=J.internals.inherits=function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r},Ke=J.internals.addProperties=function(e){for(var t=[],r=1,n=arguments.length;n>r;r++)t.push(arguments[r]);for(var i=0,o=t.length;o>i;i++){var a=t[i];for(var s in a)e[s]=a[s]}},Xe=J.internals.addRef=function(e,t){return new Or(function(r){return new et(t.getDisposable(),e.subscribe(r))})},Ye={e:{}};w.prototype.compareTo=function(e){var t=this.value.compareTo(e.value);return 0===t&&(t=this.id-e.id),t};var Ze=J.internals.PriorityQueue=function(e){this.items=new Array(e),this.length=0},Je=Ze.prototype;Je.isHigherPriority=function(e,t){return this.items[e].compareTo(this.items[t])<0},Je.percolate=function(e){if(!(e>=this.length||0>e)){var t=e-1>>1;if(!(0>t||t===e)&&this.isHigherPriority(e,t)){var r=this.items[e];this.items[e]=this.items[t],this.items[t]=r,this.percolate(t)}}},Je.heapify=function(e){if(+e||(e=0),!(e>=this.length||0>e)){var t=2*e+1,r=2*e+2,n=e;if(t<this.length&&this.isHigherPriority(t,n)&&(n=t),r<this.length&&this.isHigherPriority(r,n)&&(n=r),n!==e){var i=this.items[e];this.items[e]=this.items[n],this.items[n]=i,this.heapify(n)}}},Je.peek=function(){return this.items[0].value},Je.removeAt=function(e){this.items[e]=this.items[--this.length],this.items[this.length]=i,this.heapify()},Je.dequeue=function(){var e=this.peek();return this.removeAt(0),e},Je.enqueue=function(e){var t=this.length++;this.items[t]=new w(Ze.count++,e),this.percolate(t)},Je.remove=function(e){for(var t=0;t<this.length;t++)if(this.items[t].value===e)return this.removeAt(t),!0;return!1},Ze.count=0;var et=J.CompositeDisposable=function(){var e,t,r=[];if(Array.isArray(arguments[0]))r=arguments[0],t=r.length;else for(t=arguments.length,r=new Array(t),e=0;t>e;e++)r[e]=arguments[e];for(e=0;t>e;e++)if(!ot(r[e]))throw new TypeError("Not a disposable");this.disposables=r,this.isDisposed=!1,this.length=r.length},tt=et.prototype;tt.add=function(e){this.isDisposed?e.dispose():(this.disposables.push(e),this.length++)},tt.remove=function(e){var t=!1;if(!this.isDisposed){var r=this.disposables.indexOf(e);-1!==r&&(t=!0,this.disposables.splice(r,1),this.length--,e.dispose())}return t},tt.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var e=this.disposables.length,t=new Array(e),r=0;e>r;r++)t[r]=this.disposables[r];for(this.disposables=[],this.length=0,r=0;e>r;r++)t[r].dispose()}};var rt=J.Disposable=function(e){this.isDisposed=!1,this.action=e||ee};rt.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var nt=rt.create=function(e){return new rt(e)},it=rt.empty={dispose:ee},ot=rt.isDisposable=function(e){return e&&se(e.dispose)},at=rt.checkDisposed=function(e){if(e.isDisposed)throw new pe},st=J.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};st.prototype.getDisposable=function(){return this.current},st.prototype.setDisposable=function(e){if(this.current)throw new Error("Disposable has already been assigned");var t=this.isDisposed;!t&&(this.current=e),t&&e&&e.dispose()},st.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var e=this.current;this.current=null}e&&e.dispose()};var ut=J.SerialDisposable=function(){this.isDisposed=!1,this.current=null};ut.prototype.getDisposable=function(){return this.current},ut.prototype.setDisposable=function(e){var t=this.isDisposed;if(!t){var r=this.current;this.current=e}r&&r.dispose(),t&&e&&e.dispose()},ut.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var e=this.current;this.current=null}e&&e.dispose()};var ct=J.RefCountDisposable=function(){function e(e){this.disposable=e,this.disposable.count++,this.isInnerDisposed=!1}function t(e){this.underlyingDisposable=e,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return e.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,0===--this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},t.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},t.prototype.getDisposable=function(){return this.isDisposed?it:new e(this)},t}();S.prototype.dispose=function(){this.scheduler.scheduleWithState(this,T)};var lt=J.internals.ScheduledItem=function(e,t,r,n,i){this.scheduler=e,this.state=t,this.action=r,this.dueTime=n,this.comparer=i||ie,this.disposable=new st};lt.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},lt.prototype.compareTo=function(e){return this.comparer(this.dueTime,e.dueTime)},lt.prototype.isCancelled=function(){return this.disposable.isDisposed},lt.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var ht=J.Scheduler=function(){function e(e,t,r,n){this.now=e,this._schedule=t,this._scheduleRelative=r,this._scheduleAbsolute=n}function t(e,t){return t(),it}e.isScheduler=function(t){return t instanceof e};var r=e.prototype;return r.schedule=function(e){return this._schedule(e,t)},r.scheduleWithState=function(e,t){return this._schedule(e,t)},r.scheduleWithRelative=function(e,r){return this._scheduleRelative(r,e,t)},r.scheduleWithRelativeAndState=function(e,t,r){return this._scheduleRelative(e,t,r)},r.scheduleWithAbsolute=function(e,r){return this._scheduleAbsolute(r,e,t)},r.scheduleWithAbsoluteAndState=function(e,t,r){return this._scheduleAbsolute(e,t,r)},e.now=re,e.normalize=function(e){return 0>e&&(e=0),e},e}(),pt=ht.normalize,ft=ht.isScheduler;!function(e){function t(e,t){function r(t){i(t,function(t){var n=!1,i=!1,a=e.scheduleWithState(t,function(e,t){return n?o.remove(a):i=!0,r(t),it});i||(o.add(a),n=!0)})}var n=t[0],i=t[1],o=new et;return r(n),o}function r(e,t,r){function n(t){o(t,function(t,i){var o=!1,s=!1,u=e[r](t,i,function(e,t){return o?a.remove(u):s=!0,n(t),it});s||(a.add(u),o=!0)})}var i=t[0],o=t[1],a=new et;return n(i),a}function n(e,t){e(function(r){t(e,r)})}e.scheduleRecursive=function(e){return this.scheduleRecursiveWithState(e,n)},e.scheduleRecursiveWithState=function(e,r){return this.scheduleWithState([e,r],t)},e.scheduleRecursiveWithRelative=function(e,t){return this.scheduleRecursiveWithRelativeAndState(t,e,n)},e.scheduleRecursiveWithRelativeAndState=function(e,t,n){return this._scheduleRelative([e,n],t,function(e,t){return r(e,t,"scheduleWithRelativeAndState")})},e.scheduleRecursiveWithAbsolute=function(e,t){return this.scheduleRecursiveWithAbsoluteAndState(t,e,n)},e.scheduleRecursiveWithAbsoluteAndState=function(e,t,n){return this._scheduleAbsolute([e,n],t,function(e,t){return r(e,t,"scheduleWithAbsoluteAndState")})}}(ht.prototype),ht.prototype,ht.prototype.schedulePeriodic=function(e,t){return this.schedulePeriodicWithState(null,e,t)},ht.prototype.schedulePeriodicWithState=function(e,t,r){if(void 0===Q.setInterval)throw new de;t=pt(t);var n=e,i=Q.setInterval(function(){n=r(n)},t);return nt(function(){Q.clearInterval(i)})},function(e){e.catchError=e.catch=function(e){return new xt(this,e)}}(ht.prototype);var dt,mt,vt=(J.internals.SchedulePeriodicRecursive=function(){function e(e,t){t(0,this._period);try{this._state=this._action(this._state)}catch(e){throw this._cancel.dispose(),e}}function t(e,t,r,n){this._scheduler=e,this._state=t,this._period=r,this._action=n}return t.prototype.start=function(){var t=new st;return this._cancel=t,t.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,e.bind(this))),t},t}(),ht.immediate=function(){return new ht(re,function(e,t){return t(this,e)},ye,ye)}()),yt=ht.currentThread=function(){function e(){for(;t.length>0;){var e=t.dequeue();!e.isCancelled()&&e.invoke()}}var t,r=new ht(re,function(r,n){var i=new lt(this,r,n,this.now());if(t)t.enqueue(i);else{(t=new Ze(4)).enqueue(i);var o=_(e)();if(t=null,o===Ye)return x(o.e)}return i.disposable},ye,ye);return r.scheduleRequired=function(){return!t},r}(),gt=function(){var e,t=ee;if(Q.setTimeout)e=Q.setTimeout,t=Q.clearTimeout;else{if(!Q.WScript)throw new de;e=function(e,t){Q.WScript.Sleep(t),e()}}return{setTimeout:e,clearTimeout:t}}(),bt=gt.setTimeout,_t=gt.clearTimeout;!function(){function t(e){if(o)bt(function(){t(e)},0);else{var r=i[e];if(r){o=!0;var n=_(r)();if(mt(e),o=!1,n===Ye)return x(n.e)}}}function r(e){"string"==typeof e.data&&e.data.substring(0,u.length)===u&&t(e.data.substring(u.length))}var n=1,i={},o=!1;mt=function(e){delete i[e]};var a=RegExp("^"+String(Ie).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),s="function"==typeof(s=Z&&Y&&Z.setImmediate)&&!a.test(s)&&s;if(se(s))dt=function(e){var r=n++;return i[r]=e,s(function(){t(r)}),r};else if(void 0!==e&&"[object process]"==={}.toString.call(e))dt=function(r){var o=n++;return i[o]=r,e.nextTick(function(){t(o)}),o};else if(function(){if(!Q.postMessage||Q.importScripts)return!1;var e=!1,t=Q.onmessage;return Q.onmessage=function(){e=!0},Q.postMessage("","*"),Q.onmessage=t,e}()){var u="ms.rx.schedule"+Math.random();Q.addEventListener?Q.addEventListener("message",r,!1):Q.attachEvent?Q.attachEvent("onmessage",r):Q.onmessage=r,dt=function(e){var t=n++;return i[t]=e,Q.postMessage(u+currentId,"*"),t}}else if(Q.MessageChannel){var c=new Q.MessageChannel;c.port1.onmessage=function(e){t(e.data)},dt=function(e){var t=n++;return i[t]=e,c.port2.postMessage(t),t}}else dt="document"in Q&&"onreadystatechange"in Q.document.createElement("script")?function(e){var r=Q.document.createElement("script"),o=n++;return i[o]=e,r.onreadystatechange=function(){t(o),r.onreadystatechange=null,r.parentNode.removeChild(r),r=null},Q.document.documentElement.appendChild(r),o}:function(e){var r=n++;return i[r]=e,bt(function(){t(r)},0),r}}();var xt=(ht.timeout=ht.default=function(){return new ht(re,function(e,t){var r=this,n=new st,i=dt(function(){!n.isDisposed&&n.setDisposable(t(r,e))});return new et(n,nt(function(){mt(i)}))},function(e,t,r){var n=this,i=ht.normalize(t),o=new st;if(0===i)return n.scheduleWithState(e,r);var a=bt(function(){!o.isDisposed&&o.setDisposable(r(n,e))},i);return new et(o,nt(function(){_t(a)}))},function(e,t,r){return this.scheduleWithRelativeAndState(e,t-this.now(),r)})}(),function(e){function t(e,t){return this._scheduler.scheduleWithState(e,this._wrap(t))}function r(e,t,r){return this._scheduler.scheduleWithRelativeAndState(e,t,this._wrap(r))}function n(e,t,r){return this._scheduler.scheduleWithAbsoluteAndState(e,t,this._wrap(r))}function i(i,o){this._scheduler=i,this._handler=o,this._recursiveOriginal=null,this._recursiveWrapper=null,e.call(this,this._scheduler.now.bind(this._scheduler),t,r,n)}return Qe(i,e),i.prototype._clone=function(e){return new i(e,this._handler)},i.prototype._wrap=function(e){var t=this;return function(r,n){try{return e(t._getRecursiveWrapper(r),n)}catch(e){if(!t._handler(e))throw e;return it}}},i.prototype._getRecursiveWrapper=function(e){if(this._recursiveOriginal!==e){this._recursiveOriginal=e;var t=this._clone(e);t._recursiveOriginal=e,t._recursiveWrapper=t,this._recursiveWrapper=t}return this._recursiveWrapper},i.prototype.schedulePeriodicWithState=function(e,t,r){var n=this,i=!1,o=new st;return o.setDisposable(this._scheduler.schedulePeriodicWithState(e,t,function(e){if(i)return null;try{return r(e)}catch(e){if(i=!0,!n._handler(e))throw e;return o.dispose(),null}})),o},i}(ht)),wt=J.Notification=function(){function e(e,t,r,n,i,o){this.kind=e,this.value=t,this.exception=r,this._accept=n,this._acceptObservable=i,this.toString=o}return e.prototype.accept=function(e,t,r){return e&&"object"==typeof e?this._acceptObservable(e):this._accept(e,t,r)},e.prototype.toObservable=function(e){var t=this;return ft(e)||(e=vt),new Or(function(r){return e.scheduleWithState(t,function(e,t){t._acceptObservable(r),"N"===t.kind&&r.onCompleted()})})},e}(),St=wt.createOnNext=function(){function e(e){return e(this.value)}function t(e){return e.onNext(this.value)}function r(){return"OnNext("+this.value+")"}return function(n){return new wt("N",n,null,e,t,r)}}(),Tt=wt.createOnError=function(){function e(e,t){return t(this.exception)}function t(e){return e.onError(this.exception)}function r(){return"OnError("+this.exception+")"}return function(n){return new wt("E",null,n,e,t,r)}}(),Et=wt.createOnCompleted=function(){function e(e,t,r){return r()}function t(e){return e.onCompleted()}function r(){return"OnCompleted()"}return function(){return new wt("C",null,null,e,t,r)}}(),Ot=J.Observer=function(){};Ot.prototype.toNotifier=function(){var e=this;return function(t){return t.accept(e)}},Ot.prototype.asObserver=function(){return new Pt(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Ot.prototype.checked=function(){return new At(this)};var Mt=Ot.create=function(e,t,r){return e||(e=ee),t||(t=oe),r||(r=ee),new Pt(e,t,r)};Ot.fromNotifier=function(e,t){return new Pt(function(r){return e.call(t,St(r))},function(r){return e.call(t,Tt(r))},function(){return e.call(t,Et())})},Ot.prototype.notifyOn=function(e){return new Nt(e,this)},Ot.prototype.makeSafe=function(e){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,e)};var Ct,jt=J.internals.AbstractObserver=function(e){function t(){this.isStopped=!1,e.call(this)}return Qe(t,e),t.prototype.next=ve,t.prototype.error=ve,t.prototype.completed=ve,t.prototype.onNext=function(e){this.isStopped||this.next(e)},t.prototype.onError=function(e){this.isStopped||(this.isStopped=!0,this.error(e))},t.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},t.prototype.dispose=function(){this.isStopped=!0},t.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.error(e),!0)},t}(Ot),Pt=J.AnonymousObserver=function(e){function t(t,r,n){e.call(this),this._onNext=t,this._onError=r,this._onCompleted=n}return Qe(t,e),t.prototype.next=function(e){this._onNext(e)},t.prototype.error=function(e){this._onError(e)},t.prototype.completed=function(){this._onCompleted()},t}(jt),At=function(e){function t(t){e.call(this),this._observer=t,this._state=0}Qe(t,e);var r=t.prototype;return r.onNext=function(e){this.checkAccess();var t=_(this._observer.onNext).call(this._observer,e);this._state=0,t===Ye&&x(t.e)},r.onError=function(e){this.checkAccess();var t=_(this._observer.onError).call(this._observer,e);this._state=2,t===Ye&&x(t.e)},r.onCompleted=function(){this.checkAccess();var e=_(this._observer.onCompleted).call(this._observer);this._state=2,e===Ye&&x(e.e)},r.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},t}(Ot),Nt=function(e){function t(t,r,n){e.call(this,t,r),this._cancel=n}return Qe(t,e),t.prototype.next=function(t){e.prototype.next.call(this,t),this.ensureActive()},t.prototype.error=function(t){e.prototype.error.call(this,t),this.ensureActive()},t.prototype.completed=function(){e.prototype.completed.call(this),this.ensureActive()},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},t}(J.internals.ScheduledObserver=function(e){function t(t,r){e.call(this),this.scheduler=t,this.observer=r,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new ut}return Qe(t,e),t.prototype.next=function(e){var t=this;this.queue.push(function(){t.observer.onNext(e)})},t.prototype.error=function(e){var t=this;this.queue.push(function(){t.observer.onError(e)})},t.prototype.completed=function(){var e=this;this.queue.push(function(){e.observer.onCompleted()})},t.prototype.ensureActive=function(){var e=!1,t=this;!this.hasFaulted&&this.queue.length>0&&(e=!this.isAcquired,this.isAcquired=!0),e&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(e){var r;if(t.queue.length>0){r=t.queue.shift();try{r()}catch(e){throw t.queue=[],t.hasFaulted=!0,e}e()}else t.isAcquired=!1}))},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.disposable.dispose()},t}(jt)),Lt=J.Observable=function(){function e(e){if(J.config.longStackSupport&&ue){try{throw new Error}catch(e){this.stack=e.stack.substring(e.stack.indexOf("\n")+1)}var t=this;this._subscribe=function(r){var n=r.onError.bind(r);return r.onError=function(e){a(e,t),n(e)},e.call(t,r)}}else this._subscribe=e}return Ct=e.prototype,Ct.subscribe=Ct.forEach=function(e,t,r){return this._subscribe("object"==typeof e?e:Mt(e,t,r))},Ct.subscribeOnNext=function(e,t){return this._subscribe(Mt(void 0!==t?function(r){e.call(t,r)}:e))},Ct.subscribeOnError=function(e,t){return this._subscribe(Mt(null,void 0!==t?function(r){e.call(t,r)}:e))},Ct.subscribeOnCompleted=function(e,t){return this._subscribe(Mt(null,null,void 0!==t?function(){e.call(t)}:e))},e}(),It=J.ObservableBase=function(e){function t(e){return e&&se(e.dispose)?e:se(e)?nt(e):it}function r(e,r){var n=r[0],i=r[1],o=_(i.subscribeCore).call(i,n);return o!==Ye||n.fail(Ye.e)?void n.setDisposable(t(o)):x(Ye.e)}function n(e){var t=new Mr(e),n=[t,this];return yt.scheduleRequired()?yt.scheduleWithState(n,r):r(null,n),t}function i(){e.call(this,n)}return Qe(i,e),i.prototype.subscribeCore=ve,i}(Lt),Rt=J.internals.Enumerable=function(){},kt=function(e){function t(t){this.sources=t,e.call(this)}function r(e,t,r){this.o=e,this.s=t,this.e=r,this.isStopped=!1}return Qe(t,e),t.prototype.subscribeCore=function(e){var t,n=new ut,i=vt.scheduleRecursiveWithState(this.sources[ge](),function(i,o){if(!t){var a=_(i.next).call(i);if(a===Ye)return e.onError(a.e);if(a.done)return e.onCompleted();var s=a.value;ae(s)&&(s=zt(s));var u=new st;n.setDisposable(u),u.setDisposable(s.subscribe(new r(e,o,i)))}});return new et(n,i,nt(function(){t=!0}))},r.prototype.onNext=function(e){this.isStopped||this.o.onNext(e)},r.prototype.onError=function(e){this.isStopped||(this.isStopped=!0,this.o.onError(e))},r.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.s(this.e))},r.prototype.dispose=function(){this.isStopped=!0},r.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.o.onError(e),!0)},t}(It);Rt.prototype.concat=function(){return new kt(this)};var Dt=function(e){function t(t){this.sources=t,e.call(this)}return Qe(t,e),t.prototype.subscribeCore=function(e){var t,r=this.sources[ge](),n=new ut,i=vt.scheduleRecursiveWithState(null,function(i,o){if(!t){var a=_(r.next).call(r);if(a===Ye)return e.onError(a.e);if(a.done)return null!==i?e.onError(i):e.onCompleted();var s=a.value;ae(s)&&(s=zt(s));var u=new st;n.setDisposable(u),u.setDisposable(s.subscribe(function(t){e.onNext(t)},o,function(){e.onCompleted()}))}});return new et(n,i,nt(function(){t=!0}))},t}(It);Rt.prototype.catchError=function(){return new Dt(this)},Rt.prototype.catchErrorWhen=function(e){var t=this;return new Or(function(r){var n,i=new jr,o=new jr,a=e(i).subscribe(o),s=t[ge](),u=new ut,c=vt.scheduleRecursive(function(e){if(!n){var t=_(s.next).call(s);if(t===Ye)return r.onError(t.e);if(t.done)return void r.onCompleted();var a=t.value;ae(a)&&(a=zt(a));var c=new st,l=new st;u.setDisposable(new et(l,c)),c.setDisposable(a.subscribe(function(e){r.onNext(e)},function(t){l.setDisposable(o.subscribe(e,function(e){r.onError(e)},function(){r.onCompleted()})),i.onNext(t)},function(){r.onCompleted()}))}});return new et(a,u,c,nt(function(){n=!0}))})};var Ft=function(e){function t(e,t){this.v=e,this.c=null==t?-1:t}function r(e){this.v=e.v,this.l=e.c}return Qe(t,Rt),t.prototype[ge]=function(){return new r(this)},r.prototype.next=function(){return 0===this.l?be:(this.l>0&&this.l--,{done:!1,value:this.v})},t}(),Vt=Rt.repeat=function(e,t){return new Ft(e,t)},Bt=function(e){function t(e,t,r){this.s=e,this.fn=t?we(t,r,3):null}function r(e){this.i=-1,this.s=e.s,this.l=this.s.length,this.fn=e.fn}return Qe(t,Rt),t.prototype[ge]=function(){return new r(this)},r.prototype.next=function(){return++this.i<this.l?{done:!1,value:this.fn?this.fn(this.s[this.i],this.i,this.s):this.s[this.i]}:be},t}(),Ut=Rt.of=function(e,t,r){return new Bt(e,t,r)};Ct.observeOn=function(e){var t=this;return new Or(function(r){return t.subscribe(new Nt(e,r))},t)},Ct.subscribeOn=function(e){var t=this;return new Or(function(r){var n=new st,i=new ut;return i.setDisposable(n),n.setDisposable(e.schedule(function(){i.setDisposable(new S(e,t.subscribe(r)))})),i},t)};var Gt=function(e){function t(t){this.p=t,e.call(this)}return Qe(t,e),t.prototype.subscribeCore=function(e){return this.p.then(function(t){e.onNext(t),e.onCompleted()},function(t){e.onError(t)}),it},t}(It),zt=Lt.fromPromise=function(e){return new Gt(e)};Ct.toPromise=function(e){if(e||(e=J.config.Promise),!e)throw new de("Promise type not provided nor in Rx.config.Promise");var t=this;return new e(function(e,r){var n,i=!1;t.subscribe(function(e){n=e,i=!0},r,function(){i&&e(n)})})};var qt=function(e){function t(t){this.source=t,e.call(this)}function r(e){this.o=e,this.a=[],this.isStopped=!1}return Qe(t,e),t.prototype.subscribeCore=function(e){return this.source.subscribe(new r(e))},r.prototype.onNext=function(e){this.isStopped||this.a.push(e)},r.prototype.onError=function(e){this.isStopped||(this.isStopped=!0,this.o.onError(e))},r.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onNext(this.a),this.o.onCompleted())},r.prototype.dispose=function(){this.isStopped=!0},r.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.o.onError(e),!0)},t}(It);Ct.toArray=function(){return new qt(this)},Lt.create=Lt.createWithDisposable=function(e,t){return new Or(e,t)};var $t=(Lt.defer=function(e){return new Or(function(t){var r;try{r=e()}catch(e){return sr(e).subscribe(t)}return ae(r)&&(r=zt(r)),r.subscribe(t)})},function(e){function t(t){this.scheduler=t,e.call(this)}function r(e,t){this.observer=e,this.parent=t}function n(e,t){t.onCompleted()}return Qe(t,e),t.prototype.subscribeCore=function(e){return new r(e,this).run()},r.prototype.run=function(){return this.parent.scheduler.scheduleWithState(this.observer,n)},t}(It)),Ht=Lt.empty=function(e){return ft(e)||(e=vt),new $t(e)},Wt=function(e){function t(t,r,n){this.iterable=t,this.mapper=r,this.scheduler=n,e.call(this)}return Qe(t,e),t.prototype.subscribeCore=function(e){return new Qt(e,this).run()},t}(It),Qt=function(){function e(e,t){this.observer=e,this.parent=t}return e.prototype.run=function(){var e=P(Object(this.parent.iterable)),t=this.observer,r=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,function(n,i){try{var o=e.next()}catch(e){return t.onError(e)}if(o.done)return t.onCompleted();var a=o.value;if(r)try{a=r(a,n)}catch(e){return t.onError(e)}t.onNext(a),i(n+1)})},e}(),Kt=Math.pow(2,53)-1;E.prototype[ge]=function(){return new O(this._s)},O.prototype[ge]=function(){return this},O.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:be},M.prototype[ge]=function(){return new C(this._a)},C.prototype[ge]=function(){return this},C.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:be};var Xt=Lt.from=function(e,t,r,n){if(null==e)throw new Error("iterable cannot be null.");if(t&&!se(t))throw new Error("mapFn when provided must be a function");if(t)var i=we(t,r,2);return ft(n)||(n=yt),new Wt(e,i,n)},Yt=function(e){function t(t,r){this.args=t,this.scheduler=r,e.call(this)}return Qe(t,e),t.prototype.subscribeCore=function(e){return new L(e,this).run()},t}(It);L.prototype.run=function(){var e=this.observer,t=this.parent.args,r=t.length;return this.parent.scheduler.scheduleRecursiveWithState(0,function(n,i){r>n?(e.onNext(t[n]),i(n+1)):e.onCompleted()})};var Zt=Lt.fromArray=function(e,t){return ft(t)||(t=yt),new Yt(e,t)};Lt.generate=function(e,t,r,n,i){return ft(i)||(i=yt),new Or(function(o){var a=!0;return i.scheduleRecursiveWithState(e,function(e,i){var s,u;try{a?a=!1:e=r(e),(s=t(e))&&(u=n(e))}catch(e){return o.onError(e)}s?(o.onNext(u),i(e)):o.onCompleted()})})};var Jt=function(e){function t(){e.call(this)}return Qe(t,e),t.prototype.subscribeCore=function(e){return it},t}(It),er=Lt.never=function(){return new Jt};Lt.of=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return new Yt(t,yt)},Lt.ofWithScheduler=function(e){for(var t=arguments.length,r=new Array(t-1),n=1;t>n;n++)r[n-1]=arguments[n];return new Yt(r,e)};var tr=function(e){function t(t,r){this.obj=t,this.keys=Object.keys(t),this.scheduler=r,e.call(this)}return Qe(t,e),t.prototype.subscribeCore=function(e){return new R(e,this).run()},t}(It);R.prototype.run=function(){var e=this.observer,t=this.parent.obj,r=this.parent.keys,n=r.length;return this.parent.scheduler.scheduleRecursiveWithState(0,function(i,o){if(n>i){var a=r[i];e.onNext([a,t[a]]),o(i+1)}else e.onCompleted()})},Lt.pairs=function(e,t){return t||(t=yt),new tr(e,t)};var rr=function(e){function t(t,r,n){this.start=t,this.rangeCount=r,this.scheduler=n,e.call(this)}return Qe(t,e),t.prototype.subscribeCore=function(e){return new nr(e,this).run()},t}(It),nr=function(){function e(e,t){this.observer=e,this.parent=t}return e.prototype.run=function(){var e=this.parent.start,t=this.parent.rangeCount,r=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,function(n,i){t>n?(r.onNext(e+n),i(n+1)):r.onCompleted()})},e}();Lt.range=function(e,t,r){return ft(r)||(r=yt),new rr(e,t,r)};var ir=function(e){function t(t,r,n){this.value=t,this.repeatCount=null==r?-1:r,this.scheduler=n,e.call(this)}return Qe(t,e),t.prototype.subscribeCore=function(e){return new k(e,this).run()},t}(It);k.prototype.run=function(){var e=this.observer,t=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,function(r,n){return(-1===r||r>0)&&(e.onNext(t),r>0&&r--),0===r?e.onCompleted():void n(r)})},Lt.repeat=function(e,t,r){return ft(r)||(r=yt),new ir(e,t,r)};var or=function(e){function t(t,r){this.value=t,this.scheduler=r,e.call(this)}function r(e,t){this.observer=e,this.parent=t}function n(e,t){var r=t[0],n=t[1];n.onNext(r),n.onCompleted()}return Qe(t,e),t.prototype.subscribeCore=function(e){return new r(e,this).run()},r.prototype.run=function(){return this.parent.scheduler.scheduleWithState([this.parent.value,this.observer],n)},t}(It),ar=(Lt.return=Lt.just=Lt.returnValue=function(e,t){return ft(t)||(t=vt),new or(e,t)},function(e){function t(t,r){this.error=t,this.scheduler=r,e.call(this)}function r(e,t){this.o=e,this.p=t}function n(e,t){var r=t[0];t[1].onError(r)}return Qe(t,e),t.prototype.subscribeCore=function(e){return new r(e,this).run()},r.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],n)},t}(It)),sr=Lt.throw=Lt.throwError=Lt.throwException=function(e,t){return ft(t)||(t=vt),new ar(e,t)};Lt.using=function(e,t){return new Or(function(r){var n,i,o=it;try{(n=e())&&(o=n),i=t(n)}catch(e){return new et(sr(e).subscribe(r),o)}return new et(i.subscribe(r),o)})},Ct.amb=function(e){var t=this;return new Or(function(r){function n(){o||(o=a,c.dispose())}function i(){o||(o=s,u.dispose())}var o,a="L",s="R",u=new st,c=new st;return ae(e)&&(e=zt(e)),u.setDisposable(t.subscribe(function(e){n(),o===a&&r.onNext(e)},function(e){n(),o===a&&r.onError(e)},function(){n(),o===a&&r.onCompleted()})),c.setDisposable(e.subscribe(function(e){i(),o===s&&r.onNext(e)},function(e){i(),o===s&&r.onError(e)},function(){i(),o===s&&r.onCompleted()})),new et(u,c)})},Lt.amb=function(){var e=er(),t=[];if(Array.isArray(arguments[0]))t=arguments[0];else for(var r=0,n=arguments.length;n>r;r++)t.push(arguments[r]);for(var r=0,n=t.length;n>r;r++)e=function(e,t){return e.amb(t)}(e,t[r]);return e},Ct.catch=Ct.catchError=Ct.catchException=function(e){return"function"==typeof e?D(this,e):ur([this,e])};var ur=Lt.catchError=Lt.catch=Lt.catchException=function(){var e=[];if(Array.isArray(arguments[0]))e=arguments[0];else for(var t=0,r=arguments.length;r>t;t++)e.push(arguments[t]);return Ut(e).catchError()};Ct.combineLatest=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return Array.isArray(t[0])?t[0].unshift(this):t.unshift(this),cr.apply(this,t)};var cr=Lt.combineLatest=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=t.pop();return Array.isArray(t[0])&&(t=t[0]),new Or(function(e){function r(t){if(s[t]=!0,u||(u=s.every(te))){try{var r=n.apply(null,l)}catch(t){return e.onError(t)}e.onNext(r)}else c.filter(function(e,r){return r!==t}).every(te)&&e.onCompleted()}function i(t){c[t]=!0,c.every(te)&&e.onCompleted()}for(var o=t.length,a=function(){return!1},s=g(o,a),u=!1,c=g(o,a),l=new Array(o),h=new Array(o),p=0;o>p;p++)!function(n){var o=t[n],a=new st;ae(o)&&(o=zt(o)),a.setDisposable(o.subscribe(function(e){l[n]=e,r(n)},function(t){e.onError(t)},function(){i(n)})),h[n]=a}(p);return new et(h)},this)};Ct.concat=function(){for(var e=[],t=0,r=arguments.length;r>t;t++)e.push(arguments[t]);return e.unshift(this),hr.apply(null,e)};var lr=function(e){function t(t){this.sources=t,e.call(this)}function r(e,t){this.sources=e,this.o=t}return Qe(t,e),t.prototype.subscribeCore=function(e){return new r(this.sources,e).run()},r.prototype.run=function(){var e,t=new ut,r=this.sources,n=r.length,i=this.o,o=vt.scheduleRecursiveWithState(0,function(o,a){if(!e){if(o===n)return i.onCompleted();var s=r[o];ae(s)&&(s=zt(s));var u=new st;t.setDisposable(u),u.setDisposable(s.subscribe(function(e){i.onNext(e)},function(e){i.onError(e)},function(){a(o+1)}))}});return new et(t,o,nt(function(){e=!0}))},t}(It),hr=Lt.concat=function(){var e;if(Array.isArray(arguments[0]))e=arguments[0];else{e=new Array(arguments.length);for(var t=0,r=arguments.length;r>t;t++)e[t]=arguments[t]}return new lr(e)};Ct.concatAll=Ct.concatObservable=function(){return this.merge(1)};var pr=function(e){function t(t,r){this.source=t,this.maxConcurrent=r,e.call(this)}return Qe(t,e),t.prototype.subscribeCore=function(e){var t=new et;return t.add(this.source.subscribe(new fr(e,this.maxConcurrent,t))),t},t}(It),fr=function(){function e(e,t,r){this.o=e,this.max=t,this.g=r,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function t(e,t){this.parent=e,this.sad=t,this.isStopped=!1}return e.prototype.handleSubscribe=function(e){var r=new st;this.g.add(r),ae(e)&&(e=zt(e)),r.setDisposable(e.subscribe(new t(this,r)))},e.prototype.onNext=function(e){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(e)):this.q.push(e))},e.prototype.onError=function(e){this.isStopped||(this.isStopped=!0,this.o.onError(e))},e.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},e.prototype.dispose=function(){this.isStopped=!0},e.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.o.onError(e),!0)},t.prototype.onNext=function(e){this.isStopped||this.parent.o.onNext(e)},t.prototype.onError=function(e){this.isStopped||(this.isStopped=!0,this.parent.o.onError(e))},t.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var e=this.parent;e.g.remove(this.sad),e.q.length>0?e.handleSubscribe(e.q.shift()):(e.activeCount--,e.done&&0===e.activeCount&&e.o.onCompleted())}},t.prototype.dispose=function(){this.isStopped=!0},t.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.parent.o.onError(e),!0)},e}();Ct.merge=function(e){return"number"!=typeof e?dr(this,e):new pr(this,e)};var dr=Lt.merge=function(){var e,t,r=[],n=arguments.length;if(arguments[0])if(ft(arguments[0]))for(e=arguments[0],t=1;n>t;t++)r.push(arguments[t]);else for(e=vt,t=0;n>t;t++)r.push(arguments[t]);else for(e=vt,t=1;n>t;t++)r.push(arguments[t]);return Array.isArray(r[0])&&(r=r[0]),I(e,r).mergeAll()},mr=J.CompositeError=function(e){this.name="NotImplementedError",this.innerErrors=e,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};mr.prototype=Error.prototype,Lt.mergeDelayError=function(){var e;if(Array.isArray(arguments[0]))e=arguments[0];else{var t=arguments.length;e=new Array(t);for(var r=0;t>r;r++)e[r]=arguments[r]}var n=I(null,e);return new Or(function(e){function t(){0===a.length?e.onCompleted():1===a.length?e.onError(a[0]):e.onError(new mr(a))}var r=new et,i=new st,o=!1,a=[];return r.add(i),i.setDisposable(n.subscribe(function(n){var i=new st;r.add(i),ae(n)&&(n=zt(n)),i.setDisposable(n.subscribe(function(t){e.onNext(t)},function(e){a.push(e),r.remove(i),o&&1===r.length&&t()},function(){r.remove(i),o&&1===r.length&&t()}))},function(e){a.push(e),o=!0,1===r.length&&t()},function(){o=!0,1===r.length&&t()})),r})};var vr=function(e){function t(t){this.source=t,e.call(this)}function r(e,t){this.o=e,this.g=t,this.isStopped=!1,this.done=!1}function n(e,t,r){this.parent=e,this.g=t,this.sad=r,this.isStopped=!1}return Qe(t,e),t.prototype.subscribeCore=function(e){var t=new et,n=new st;return t.add(n),n.setDisposable(this.source.subscribe(new r(e,t))),t},r.prototype.onNext=function(e){if(!this.isStopped){var t=new st;this.g.add(t),ae(e)&&(e=zt(e)),t.setDisposable(e.subscribe(new n(this,this.g,t)))}},r.prototype.onError=function(e){this.isStopped||(this.isStopped=!0,this.o.onError(e))},r.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},r.prototype.dispose=function(){this.isStopped=!0},r.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.o.onError(e),!0)},n.prototype.onNext=function(e){this.isStopped||this.parent.o.onNext(e)},n.prototype.onError=function(e){this.isStopped||(this.isStopped=!0,this.parent.o.onError(e))},n.prototype.onCompleted=function(){if(!this.isStopped){var e=this.parent;this.isStopped=!0,e.g.remove(this.sad),e.done&&1===e.g.length&&e.o.onCompleted()}},n.prototype.dispose=function(){this.isStopped=!0},n.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.parent.o.onError(e),!0)},t}(It);Ct.mergeAll=Ct.mergeObservable=function(){return new vr(this)},Ct.onErrorResumeNext=function(e){if(!e)throw new Error("Second observable is required");return yr([this,e])};var yr=Lt.onErrorResumeNext=function(){var e=[];if(Array.isArray(arguments[0]))e=arguments[0];else for(var t=0,r=arguments.length;r>t;t++)e.push(arguments[t]);return new Or(function(t){var r=0,n=new ut,i=vt.scheduleRecursive(function(i){var o,a;r<e.length?(o=e[r++],ae(o)&&(o=zt(o)),a=new st,n.setDisposable(a),a.setDisposable(o.subscribe(t.onNext.bind(t),i,i))):t.onCompleted()});return new et(n,i)})};Ct.skipUntil=function(e){var t=this;return new Or(function(r){var n=!1,i=new et(t.subscribe(function(e){n&&r.onNext(e)},function(e){r.onError(e)},function(){n&&r.onCompleted()}));ae(e)&&(e=zt(e));var o=new st;return i.add(o),o.setDisposable(e.subscribe(function(){n=!0,o.dispose()},function(e){r.onError(e)},function(){o.dispose()})),i},t)};var gr=function(e){function t(t){this.source=t,e.call(this)}function r(e,t){this.o=e,this.inner=t,this.stopped=!1,this.latest=0,this.hasLatest=!1,this.isStopped=!1}function n(e,t){this.parent=e,this.id=t,this.isStopped=!1}return Qe(t,e),t.prototype.subscribeCore=function(e){var t=new ut,n=this.source.subscribe(new r(e,t));return new et(n,t)},r.prototype.onNext=function(e){if(!this.isStopped){var t=new st,r=++this.latest;this.hasLatest=!0,this.inner.setDisposable(t),ae(e)&&(e=zt(e)),t.setDisposable(e.subscribe(new n(this,r)))}},r.prototype.onError=function(e){this.isStopped||(this.isStopped=!0,this.o.onError(e))},r.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.stopped=!0,!this.hasLatest&&this.o.onCompleted())},r.prototype.dispose=function(){this.isStopped=!0},r.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.o.onError(e),!0)},n.prototype.onNext=function(e){this.isStopped||this.parent.latest===this.id&&this.parent.o.onNext(e)},n.prototype.onError=function(e){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&this.parent.o.onError(e))},n.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.isStopped&&this.parent.o.onCompleted()))},n.prototype.dispose=function(){this.isStopped=!0},n.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.parent.o.onError(e),!0)},t}(It);Ct.switch=Ct.switchLatest=function(){return new gr(this)};var br=function(e){function t(t,r){this.source=t,this.other=ae(r)?zt(r):r,e.call(this)}function r(e){this.o=e,this.isStopped=!1}return Qe(t,e),t.prototype.subscribeCore=function(e){return new et(this.source.subscribe(e),this.other.subscribe(new r(e)))},r.prototype.onNext=function(e){this.isStopped||this.o.onCompleted()},r.prototype.onError=function(e){this.isStopped||(this.isStopped=!0,this.o.onError(e))},r.prototype.onCompleted=function(){!this.isStopped&&(this.isStopped=!0)},r.prototype.dispose=function(){this.isStopped=!0},r.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.o.onError(e),!0)},t}(It);Ct.takeUntil=function(e){return new br(this,e)},Ct.withLatestFrom=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=t.pop(),i=this;return Array.isArray(t[0])&&(t=t[0]),new Or(function(e){for(var r=t.length,o=g(r,F),a=!1,s=new Array(r),u=new Array(r+1),c=0;r>c;c++)!function(r){var n=t[r],i=new st;ae(n)&&(n=zt(n)),i.setDisposable(n.subscribe(function(e){s[r]=e,o[r]=!0,a=o.every(te)},function(t){e.onError(t)},ee)),u[r]=i}(c);var l=new st;return l.setDisposable(i.subscribe(function(t){var r=[t].concat(s);if(a){var i=_(n).apply(null,r);return i===Ye?e.onError(i.e):void e.onNext(i)}},function(t){e.onError(t)},function(){e.onCompleted()})),u[r]=l,new et(u)},this)},Ct.zip=function(){if(Array.isArray(arguments[0]))return V.apply(this,arguments);for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=this,i=t.pop();return t.unshift(n),new Or(function(e){for(var r=t.length,o=g(r,B),a=g(r,F),s=new Array(r),u=0;r>u;u++)!function(r){var u=t[r],c=new st;ae(u)&&(u=zt(u)),c.setDisposable(u.subscribe(function(t){if(o[r].push(t),o.every(function(e){return e.length>0})){var s=o.map(function(e){return e.shift()}),u=_(i).apply(n,s);if(u===Ye)return e.onError(u.e);e.onNext(u)}else a.filter(function(e,t){return t!==r}).every(te)&&e.onCompleted()},function(t){e.onError(t)},function(){a[r]=!0,a.every(te)&&e.onCompleted()})),s[r]=c}(u);return new et(s)},n)},Lt.zip=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=t.shift();return n.zip.apply(n,t)},Lt.zipArray=function(){var e;if(Array.isArray(arguments[0]))e=arguments[0];else{var t=arguments.length;e=new Array(t);for(var r=0;t>r;r++)e[r]=arguments[r]}return new Or(function(t){for(var r=e.length,n=g(r,U),i=g(r,F),o=new Array(r),a=0;r>a;a++)!function(r){o[r]=new st,o[r].setDisposable(e[r].subscribe(function(e){if(n[r].push(e),n.every(function(e){return e.length>0})){var o=n.map(function(e){return e.shift()});t.onNext(o)}else if(i.filter(function(e,t){return t!==r}).every(te))return t.onCompleted()},function(e){t.onError(e)},function(){i[r]=!0,i.every(te)&&t.onCompleted()}))}(a);return new et(o)})},Ct.asObservable=function(){var e=this;return new Or(function(t){return e.subscribe(t)},e)},Ct.bufferWithCount=function(e,t){return"number"!=typeof t&&(t=e),this.windowWithCount(e,t).selectMany(function(e){return e.toArray()}).where(function(e){return e.length>0})},Ct.dematerialize=function(){var e=this;return new Or(function(t){return e.subscribe(function(e){return e.accept(t)},function(e){t.onError(e)},function(){t.onCompleted()})},this)},Ct.distinctUntilChanged=function(e,t){var r=this;return t||(t=ne),new Or(function(n){var i,o=!1;return r.subscribe(function(r){var a=r;if(e&&(a=_(e)(r))===Ye)return n.onError(a.e);if(o){var s=_(t)(i,a);if(s===Ye)return n.onError(s.e)}o&&s||(o=!0,i=a,n.onNext(r))},function(e){n.onError(e)},function(){n.onCompleted()})},this)};var _r=function(e){function t(t,r,n,i){this.source=t,this.t=!r||se(r)?Mt(r||ee,n||ee,i||ee):r,e.call(this)}function r(e,t){this.o=e,this.t=t,this.isStopped=!1}return Qe(t,e),t.prototype.subscribeCore=function(e){return this.source.subscribe(new r(e,this.t))},r.prototype.onNext=function(e){if(!this.isStopped){var t=_(this.t.onNext).call(this.t,e);t===Ye&&this.o.onError(t.e),this.o.onNext(e)}},r.prototype.onError=function(e){if(!this.isStopped){this.isStopped=!0;var t=_(this.t.onError).call(this.t,e);if(t===Ye)return this.o.onError(t.e);this.o.onError(e)}},r.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var e=_(this.t.onCompleted).call(this.t);if(e===Ye)return this.o.onError(e.e);this.o.onCompleted()}},r.prototype.dispose=function(){this.isStopped=!0},r.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.o.onError(e),!0)},t}(It);Ct.do=Ct.tap=Ct.doAction=function(e,t,r){return new _r(this,e,t,r)},Ct.doOnNext=Ct.tapOnNext=function(e,t){return this.tap(void 0!==t?function(r){e.call(t,r)}:e)},Ct.doOnError=Ct.tapOnError=function(e,t){return this.tap(ee,void 0!==t?function(r){e.call(t,r)}:e)},Ct.doOnCompleted=Ct.tapOnCompleted=function(e,t){return this.tap(ee,null,void 0!==t?function(){e.call(t)}:e)},Ct.finally=Ct.ensure=function(e){var t=this;return new Or(function(r){var n;try{n=t.subscribe(r)}catch(t){throw e(),t}return nt(function(){try{n.dispose()}catch(e){throw e}finally{e()}})},this)},Ct.finallyAction=function(e){return this.ensure(e)};var xr=function(e){function t(t){this.source=t,e.call(this)}function r(e){this.o=e,this.isStopped=!1}return Qe(t,e),t.prototype.subscribeCore=function(e){return this.source.subscribe(new r(e))},r.prototype.onNext=ee,r.prototype.onError=function(e){this.isStopped||(this.isStopped=!0,this.o.onError(e))},r.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},r.prototype.dispose=function(){this.isStopped=!0},r.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.observer.onError(e),!0)},t}(It);Ct.ignoreElements=function(){return new xr(this)},Ct.materialize=function(){var e=this;return new Or(function(t){return e.subscribe(function(e){t.onNext(St(e))},function(e){t.onNext(Tt(e)),t.onCompleted()},function(){t.onNext(Et()),t.onCompleted()})},e)},Ct.repeat=function(e){return Vt(this,e).concat()},Ct.retry=function(e){return Vt(this,e).catchError()},Ct.retryWhen=function(e){return Vt(this).catchErrorWhen(e)};var wr=function(e){function t(t,r,n,i){this.source=t,this.accumulator=r,this.hasSeed=n,this.seed=i,e.call(this)}return Qe(t,e),t.prototype.subscribeCore=function(e){return this.source.subscribe(new G(e,this))},t}(It);G.prototype.onNext=function(e){if(!this.isStopped){!this.hasValue&&(this.hasValue=!0);try{this.hasAccumulation?this.accumulation=this.accumulator(this.accumulation,e):(this.accumulation=this.hasSeed?this.accumulator(this.seed,e):e,this.hasAccumulation=!0)}catch(e){return this.observer.onError(e)}this.observer.onNext(this.accumulation)}},G.prototype.onError=function(e){this.isStopped||(this.isStopped=!0,this.observer.onError(e))},G.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,!this.hasValue&&this.hasSeed&&this.observer.onNext(this.seed),this.observer.onCompleted())},G.prototype.dispose=function(){this.isStopped=!0},G.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.observer.onError(e),!0)},Ct.scan=function(){var e,t,r=!1;return 2===arguments.length?(r=!0,e=arguments[0],t=arguments[1]):t=arguments[0],new wr(this,t,r,e)},Ct.skipLast=function(e){if(0>e)throw new fe;var t=this;return new Or(function(r){var n=[];return t.subscribe(function(t){n.push(t),n.length>e&&r.onNext(n.shift())},function(e){r.onError(e)},function(){r.onCompleted()})},t)},Ct.startWith=function(){var e,t=0;arguments.length&&ft(arguments[0])?(e=arguments[0],t=1):e=vt;for(var r=[],n=t,i=arguments.length;i>n;n++)r.push(arguments[n]);return Ut([Zt(r,e),this]).concat()},Ct.takeLast=function(e){if(0>e)throw new fe;var t=this;return new Or(function(r){var n=[];return t.subscribe(function(t){n.push(t),n.length>e&&n.shift()},function(e){r.onError(e)},function(){for(;n.length>0;)r.onNext(n.shift());r.onCompleted()})},t)},Ct.takeLastBuffer=function(e){var t=this;return new Or(function(r){var n=[];return t.subscribe(function(t){n.push(t),n.length>e&&n.shift()},function(e){r.onError(e)},function(){r.onNext(n),r.onCompleted()})},t)},Ct.windowWithCount=function(e,t){var r=this;if(+e||(e=0),Math.abs(e)===1/0&&(e=0),0>=e)throw new fe;if(null==t&&(t=e),+t||(t=0),Math.abs(t)===1/0&&(t=0),0>=t)throw new fe;return new Or(function(n){function i(){var e=new jr;u.push(e),n.onNext(Xe(e,a))}var o=new st,a=new ct(o),s=0,u=[];return i(),o.setDisposable(r.subscribe(function(r){for(var n=0,o=u.length;o>n;n++)u[n].onNext(r);var a=s-e+1;a>=0&&a%t==0&&u.shift().onCompleted(),++s%t==0&&i()},function(e){for(;u.length>0;)u.shift().onError(e);n.onError(e)},function(){for(;u.length>0;)u.shift().onCompleted();n.onCompleted()})),a},r)},Ct.selectConcat=Ct.concatMap=function(e,t,r){return se(e)&&se(t)?this.concatMap(function(r,n){var i=e(r,n);return ae(i)&&(i=zt(i)),(xe(i)||_e(i))&&(i=Xt(i)),i.map(function(e,i){return t(r,e,n,i)})}):se(e)?z(this,e,r):z(this,function(){return e})},Ct.concatMapObserver=Ct.selectConcatObserver=function(e,t,r,n){var i=this,o=we(e,n,2),a=we(t,n,1),s=we(r,n,0);return new Or(function(e){var t=0;return i.subscribe(function(r){var n;try{n=o(r,t++)}catch(t){return void e.onError(t)}ae(n)&&(n=zt(n)),e.onNext(n)},function(t){var r;try{r=a(t)}catch(t){return void e.onError(t)}ae(r)&&(r=zt(r)),e.onNext(r),e.onCompleted()},function(){var t;try{t=s()}catch(t){return void e.onError(t)}ae(t)&&(t=zt(t)),e.onNext(t),e.onCompleted()})},this).concatAll()},Ct.defaultIfEmpty=function(e){var t=this;return e===i&&(e=null),new Or(function(r){var n=!1;return t.subscribe(function(e){n=!0,r.onNext(e)},function(e){r.onError(e)},function(){!n&&r.onNext(e),r.onCompleted()})},t)},$.prototype.push=function(e){var t=-1===q(this.set,e,this.comparer);return t&&this.set.push(e),t},Ct.distinct=function(e,t){var r=this;return t||(t=ne),new Or(function(n){var i=new $(t);return r.subscribe(function(t){var r=t;if(e)try{r=e(t)}catch(e){return void n.onError(e)}i.push(r)&&n.onNext(t)},function(e){n.onError(e)},function(){n.onCompleted()})},this)};var Sr=function(e){function t(t,r,n){this.source=t,this.selector=we(r,n,3),e.call(this)}function r(e,t){return function(r,n,i){return e.call(this,t.selector(r,n,i),n,i)}}function n(e,t,r){this.o=e,this.selector=t,this.source=r,this.i=0,this.isStopped=!1}return Qe(t,e),t.prototype.internalMap=function(e,n){return new t(this.source,r(e,this),n)},t.prototype.subscribeCore=function(e){return this.source.subscribe(new n(e,this.selector,this))},n.prototype.onNext=function(e){if(!this.isStopped){var t=_(this.selector)(e,this.i++,this.source);return t===Ye?this.o.onError(t.e):void this.o.onNext(t)}},n.prototype.onError=function(e){this.isStopped||(this.isStopped=!0,this.o.onError(e))},n.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},n.prototype.dispose=function(){this.isStopped=!0},n.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.o.onError(e),!0)},t}(It);Ct.map=Ct.select=function(e,t){var r="function"==typeof e?e:function(){return e};return this instanceof Sr?this.internalMap(r,t):new Sr(this,r,t)},Ct.pluck=function(){var e=arguments,t=arguments.length;if(0===t)throw new Error("List of properties cannot be empty.");return this.map(function(r){for(var n=r,o=0;t>o;o++){var a=n[e[o]];if(void 0===a)return i;n=a}return n})},Ct.flatMapObserver=Ct.selectManyObserver=function(e,t,r,n){var i=this;return new Or(function(o){var a=0;return i.subscribe(function(t){var r;try{r=e.call(n,t,a++)}catch(e){return void o.onError(e)}ae(r)&&(r=zt(r)),o.onNext(r)},function(e){var r;try{r=t.call(n,e)}catch(e){return void o.onError(e)}ae(r)&&(r=zt(r)),o.onNext(r),o.onCompleted()},function(){var e;try{e=r.call(n)}catch(e){return void o.onError(e)}ae(e)&&(e=zt(e)),o.onNext(e),o.onCompleted()})},i).mergeAll()},Ct.selectMany=Ct.flatMap=function(e,t,r){return se(e)&&se(t)?this.flatMap(function(r,n){var i=e(r,n);return ae(i)&&(i=zt(i)),(xe(i)||_e(i))&&(i=Xt(i)),i.map(function(e,i){return t(r,e,n,i)})},r):se(e)?H(this,e,r):H(this,function(){return e})},Ct.selectSwitch=Ct.flatMapLatest=Ct.switchMap=function(e,t){return this.select(e,t).switchLatest()};var Tr=function(e){function t(t,r){this.source=t,this.skipCount=r,e.call(this)}function r(e,t){this.c=t,this.r=t,this.o=e,this.isStopped=!1}return Qe(t,e),t.prototype.subscribeCore=function(e){return this.source.subscribe(new r(e,this.skipCount))},r.prototype.onNext=function(e){this.isStopped||(this.r<=0?this.o.onNext(e):this.r--)},r.prototype.onError=function(e){this.isStopped||(this.isStopped=!0,this.o.onError(e))},r.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},r.prototype.dispose=function(){this.isStopped=!0},r.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.o.onError(e),!0)},t}(It);Ct.skip=function(e){if(0>e)throw new fe;return new Tr(this,e)},Ct.skipWhile=function(e,t){var r=this,n=we(e,t,3);return new Or(function(e){var t=0,i=!1;return r.subscribe(function(o){if(!i)try{i=!n(o,t++,r)}catch(t){return void e.onError(t)}i&&e.onNext(o)},function(t){e.onError(t)},function(){e.onCompleted()})},r)},Ct.take=function(e,t){if(0>e)throw new fe;if(0===e)return Ht(t);var r=this;return new Or(function(t){var n=e;return r.subscribe(function(e){n-- >0&&(t.onNext(e),0>=n&&t.onCompleted())},function(e){t.onError(e)},function(){t.onCompleted()})},r)},Ct.takeWhile=function(e,t){var r=this,n=we(e,t,3);return new Or(function(e){var t=0,i=!0;return r.subscribe(function(o){if(i){try{i=n(o,t++,r)}catch(t){return void e.onError(t)}i?e.onNext(o):e.onCompleted()}},function(t){e.onError(t)},function(){e.onCompleted()})},r)};var Er=function(e){function t(t,r,n){this.source=t,this.predicate=we(r,n,3),e.call(this)}function r(e,t){return function(r,n,i){return t.predicate(r,n,i)&&e.call(this,r,n,i)}}function n(e,t,r){this.o=e,this.predicate=t,this.source=r,this.i=0,this.isStopped=!1}return Qe(t,e),t.prototype.subscribeCore=function(e){return this.source.subscribe(new n(e,this.predicate,this))},t.prototype.internalFilter=function(e,n){return new t(this.source,r(e,this),n)},n.prototype.onNext=function(e){if(!this.isStopped){var t=_(this.predicate)(e,this.i++,this.source);return t===Ye?this.o.onError(t.e):void(t&&this.o.onNext(e))}},n.prototype.onError=function(e){this.isStopped||(this.isStopped=!0,this.o.onError(e))},n.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},n.prototype.dispose=function(){this.isStopped=!0},n.prototype.fail=function(e){return!this.isStopped&&(this.isStopped=!0,this.o.onError(e),!0)},t}(It);Ct.filter=Ct.where=function(e,t){return this instanceof Er?this.internalFilter(e,t):new Er(this,e,t)},Ct.transduce=function(e){function t(e){return{"@@transducer/init":function(){return e},"@@transducer/step":function(e,t){return e.onNext(t)},"@@transducer/result":function(e){return e.onCompleted()}}}var r=this;return new Or(function(n){var i=e(t(n));return r.subscribe(function(e){try{i["@@transducer/step"](n,e)}catch(e){n.onError(e)}},function(e){n.onError(e)},function(){i["@@transducer/result"](n)})},r)};var Or=J.AnonymousObservable=function(e){function t(e){return e&&se(e.dispose)?e:se(e)?nt(e):it}function r(e,r){var n=r[0],i=_(r[1])(n);return i!==Ye||n.fail(Ye.e)?void n.setDisposable(t(i)):x(Ye.e)}function n(t,n){this.source=n,e.call(this,function(e){var n=new Mr(e),i=[n,t];return yt.scheduleRequired()?yt.scheduleWithState(i,r):r(null,i),n})}return Qe(n,e),n}(Lt),Mr=function(e){function t(t){e.call(this),this.observer=t,this.m=new st}Qe(t,e);var r=t.prototype;return r.next=function(e){var t=_(this.observer.onNext).call(this.observer,e);t===Ye&&(this.dispose(),x(t.e))},r.error=function(e){var t=_(this.observer.onError).call(this.observer,e);this.dispose(),t===Ye&&x(t.e)},r.completed=function(){var e=_(this.observer.onCompleted).call(this.observer);this.dispose(),e===Ye&&x(e.e)},r.setDisposable=function(e){this.m.setDisposable(e)},r.getDisposable=function(){return this.m.getDisposable()},r.dispose=function(){e.prototype.dispose.call(this),this.m.dispose()},t}(jt),Cr=function(e,t){this.subject=e,this.observer=t};Cr.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var e=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(e,1),this.observer=null}};var jr=J.Subject=function(e){function t(e){return at(this),this.isStopped?this.hasError?(e.onError(this.error),it):(e.onCompleted(),it):(this.observers.push(e),new Cr(this,e))}function r(){e.call(this,t),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Qe(r,e),Ke(r.prototype,Ot.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(at(this),!this.isStopped){this.isStopped=!0;for(var e=0,t=o(this.observers),r=t.length;r>e;e++)t[e].onCompleted();this.observers.length=0}},onError:function(e){if(at(this),!this.isStopped){this.isStopped=!0,this.error=e,this.hasError=!0;for(var t=0,r=o(this.observers),n=r.length;n>t;t++)r[t].onError(e);this.observers.length=0}},onNext:function(e){if(at(this),!this.isStopped)for(var t=0,r=o(this.observers),n=r.length;n>t;t++)r[t].onNext(e)},dispose:function(){this.isDisposed=!0,this.observers=null}}),r.create=function(e,t){return new Pr(e,t)},r}(Lt),Pr=(J.AsyncSubject=function(e){function t(e){return at(this),this.isStopped?(this.hasError?e.onError(this.error):this.hasValue?(e.onNext(this.value),e.onCompleted()):e.onCompleted(),it):(this.observers.push(e),new Cr(this,e))}function r(){e.call(this,t),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Qe(r,e),Ke(r.prototype,Ot,{hasObservers:function(){return at(this),this.observers.length>0},onCompleted:function(){var e;if(at(this),!this.isStopped){this.isStopped=!0;var t=o(this.observers),r=t.length;if(this.hasValue)for(e=0;r>e;e++){var n=t[e];n.onNext(this.value),n.onCompleted()}else for(e=0;r>e;e++)t[e].onCompleted();this.observers.length=0}},onError:function(e){if(at(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=e;for(var t=0,r=o(this.observers),n=r.length;n>t;t++)r[t].onError(e);this.observers.length=0}},onNext:function(e){at(this),this.isStopped||(this.value=e,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),r}(Lt),J.AnonymousSubject=function(e){function t(e){return this.observable.subscribe(e)}function r(r,n){this.observer=r,this.observable=n,e.call(this,t)}return Qe(r,e),Ke(r.prototype,Ot.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(e){this.observer.onError(e)},onNext:function(e){this.observer.onNext(e)}}),r}(Lt));K&&X?Y?(X.exports=J).Rx=J:K.Rx=J:Q.Rx=J;var Ar=h()}).call(this)}).call(this,e(150),void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{150:150}]},{},[1])(1)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],27:[function(e,t,r){"use strict";t.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r="boolean"==typeof t.cycles&&t.cycles,n=t.cmp&&function(e){return function(t){return function(r,n){var i={key:r,value:t[r]},o={key:n,value:t[n]};return e(i,o)}}}(t.cmp),i=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var o,a;if(Array.isArray(t)){for(a="[",o=0;o<t.length;o++)o&&(a+=","),a+=e(t[o])||"null";return a+"]"}if(null===t)return"null";if(-1!==i.indexOf(t)){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=i.push(t)-1,u=Object.keys(t).sort(n&&n(t));for(a="",o=0;o<u.length;o++){var c=u[o],l=e(t[c]);l&&(a&&(a+=","),a+=JSON.stringify(c)+":"+l)}return i.splice(s,1),"{"+a+"}"}}(e)}},{}],28:[function(e,t,r){(function(e){!function(e,r){"object"==typeof t&&t.exports?t.exports=r():e.fclone=r()}(this,function(){"use strict";function t(e){if(Array.isArray(e))return!0;var t=e&&e.length;return"number"==typeof t&&(0===t||t-1 in e)&&"function"==typeof e.indexOf}function r(i,o){if(!i||"object"!==(void 0===i?"undefined":n(i)))return i;if(i instanceof Date)return new Date(i);if(void 0!==e&&e.isBuffer(i))return new e(i);if("function"==typeof i.subarray&&/[A-Z][A-Za-z\d]+Array/.test(Object.prototype.toString.call(i)))return i.subarray(0);if(o||(o=[]),t(i)){o[o.length]=i;for(var a=i.length,s=-1,u=[];a>++s;)u[s]=~o.indexOf(i[s])?"[Circular]":r(i[s],o);return o.length&&o.length--,u}o[o.length]=i;var c={};i instanceof Error&&(c.name=i.name,c.message=i.message,c.stack=i.stack);for(var l=Object.keys(i),h=l.length;h--;){var p=l[h];c[p]=~o.indexOf(i[p])?"[Circular]":r(i[p],o)}return o.length&&o.length--,c}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};return r.default=r,r})}).call(this,e("buffer").Buffer)},{buffer:18}],29:[function(e,t,r){(function(r){var n,i=void 0!==r?r:"undefined"!=typeof window?window:{},o=e("min-document");"undefined"!=typeof document?n=document:(n=i["__GLOBAL_DOCUMENT_CACHE@4"])||(n=i["__GLOBAL_DOCUMENT_CACHE@4"]=o),t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"min-document":15}],30:[function(e,t,r){!function(n,i){"object"==typeof r&&void 0!==t?i(r,e("apollo-utilities")):i(n.graphqlAnywhereAsync={},n.apollo.utilities)}(this,function(e,t){"use strict";function r(e,t){null!==t&&"object"==typeof t&&Object.keys(t).forEach(function(n){var i=t[n];a.call(e,n)?r(e[n],i):e[n]=i})}function n(e,o,a){return s(this,void 0,void 0,function(){var c,l,h,p,f,d=this;return u(this,function(m){switch(m.label){case 0:return c=a.fragmentMap,l=a.contextValue,h=a.variableValues,p={},f=function(e){return s(d,void 0,void 0,function(){var s,f,d,m,v;return u(this,function(u){switch(u.label){case 0:return t.shouldInclude(e,h)?t.isField(e)?[4,i(e,o,a)]:[3,2]:[2];case 1:return s=u.sent(),f=t.resultKeyNameFromField(e),void 0!==s&&(void 0===p[f]?p[f]=s:r(p[f],s)),[2];case 2:if(t.isInlineFragment(e))d=e;else if(!(d=c[e.name.value]))throw new Error("No fragment named "+e.name.value);return m=d.typeCondition.name.value,a.fragmentMatcher(o,m,l)?[4,n(d.selectionSet,o,a)]:[3,4];case 3:v=u.sent(),r(p,v),u.label=4;case 4:return[2]}})})},[4,Promise.all(e.selections.map(f))];case 1:return m.sent(),a.resultMapper?[2,a.resultMapper(p,o)]:[2,p]}})})}function i(e,r,i){return s(this,void 0,void 0,function(){var a,s,c,l,h,p,f;return u(this,function(u){switch(u.label){case 0:return a=i.variableValues,s=i.contextValue,c=i.resolver,l=e.name.value,h=t.argumentsObjectFromField(e,a),p={isLeaf:!e.selectionSet,resultKey:t.resultKeyNameFromField(e),directives:t.getDirectiveInfoFromField(e,a)},[4,c(l,r,h,s,p)];case 1:return f=u.sent(),e.selectionSet?null==f?[2,f]:Array.isArray(f)?[2,o(e,f,i)]:[2,n(e.selectionSet,f,i)]:[2,f]}})})}function o(e,t,r){return Promise.all(t.map(function(t){return null===t?null:Array.isArray(t)?o(e,t,r):n(e.selectionSet,t,r)}))}var a=Object.prototype.hasOwnProperty,s=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((n=n.apply(e,t||[])).next())})},u=function(e,t){function r(e){return function(t){return n([e,t])}}function n(r){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(a=2&r[0]?o.return:r[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,r[1])).done)return a;switch(o=0,a&&(r=[2&r[0],a.value]),r[0]){case 0:case 1:a=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,o=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(a=u.trys,!(a=a.length>0&&a[a.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!a||r[1]>a[0]&&r[1]<a[3])){u.label=r[1];break}if(6===r[0]&&u.label<a[1]){u.label=a[1],a=r;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(r);break}a[2]&&u.ops.pop(),u.trys.pop();continue}r=t.call(e,u)}catch(e){r=[6,e],o=0}finally{i=a=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var i,o,a,s,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s};e.graphql=function(e,r,i,o,a,s){void 0===s&&(s={});var u=t.getMainDefinition(r),c=t.getFragmentDefinitions(r),l={fragmentMap:t.createFragmentMap(c),contextValue:o,variableValues:a,resultMapper:s.resultMapper,resolver:e,fragmentMatcher:s.fragmentMatcher||function(){return!0}};return n(u.selectionSet,i,l)},Object.defineProperty(e,"__esModule",{value:!0})})},{"apollo-utilities":13}],31:[function(e,t,r){!function(e,t){t()}(0,function(){"use strict";function r(e){return e.replace(/[\s,]+/g," ").trim()}function n(e){return r(e.source.body.substring(e.start,e.end))}function i(e){for(var t={},r=[],i=0;i<e.definitions.length;i++){var o=e.definitions[i];if("FragmentDefinition"===o.kind){var a=o.name.value,s=n(o.loc);l.hasOwnProperty(a)&&!l[a][s]?(h&&console.warn("Warning: fragment with name "+a+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"),l[a][s]=!0):l.hasOwnProperty(a)||(l[a]={},l[a][s]=!0),t[s]||(t[s]=!0,r.push(o))}else r.push(o)}return e.definitions=r,e}function o(e,t){var r=Object.prototype.toString.call(e);if("[object Array]"===r)return e.map(function(e){return o(e,t)});if("[object Object]"!==r)throw new Error("Unexpected input.");t&&e.loc&&delete e.loc,e.loc&&(delete e.loc.startToken,delete e.loc.endToken);var n,i,a,s=Object.keys(e);for(n in s)s.hasOwnProperty(n)&&(i=e[s[n]],"[object Object]"!==(a=Object.prototype.toString.call(i))&&"[object Array]"!==a||(e[s[n]]=o(i,!0)));return e}function a(e){var t=r(e);if(c[t])return c[t];var n=u(e,{experimentalFragmentVariables:p});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");return n=i(n),n=o(n,!1),c[t]=n,n}function s(){for(var e=Array.prototype.slice.call(arguments),t=e[0],r="string"==typeof t?t:t[0],n=1;n<e.length;n++)e[n]&&e[n].kind&&"Document"===e[n].kind?r+=e[n].loc.source.body:r+=e[n],r+=t[n];return a(r)}var u=e("graphql/language/parser").parse,c={},l={},h=!0,p=!1;s.default=s,s.resetCaches=function(){c={},l={}},s.disableFragmentWarnings=function(){h=!1},s.enableExperimentalFragmentVariables=function(){p=!0},s.disableExperimentalFragmentVariables=function(){p=!1},t.exports=s})},{"graphql/language/parser":69}],32:[function(e,t,r){"use strict";function n(e,t,r,i,a,s,u){var c=Array.isArray(t)?0!==t.length?t:void 0:t?[t]:void 0,l=r;if(!l&&c){var h=c[0];l=h&&h.loc&&h.loc.source}var p=i;!p&&c&&(p=c.reduce(function(e,t){return t.loc&&e.push(t.loc.start),e},[])),p&&0===p.length&&(p=void 0);var f;i&&r?f=i.map(function(e){return(0,o.getLocation)(r,e)}):c&&(f=c.reduce(function(e,t){return t.loc&&e.push((0,o.getLocation)(t.loc.source,t.loc.start)),e},[]));var d=u||s&&s.extensions;Object.defineProperties(this,{message:{value:e,enumerable:!0,writable:!0},locations:{value:f||void 0,enumerable:Boolean(f)},path:{value:a||void 0,enumerable:Boolean(a)},nodes:{value:c||void 0},source:{value:l||void 0},positions:{value:p||void 0},originalError:{value:s},extensions:{value:d||void 0,enumerable:Boolean(d)}}),s&&s.stack?Object.defineProperty(this,"stack",{value:s.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,n):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}Object.defineProperty(r,"__esModule",{value:!0}),r.GraphQLError=n;var i=e("./printError"),o=e("../language/location");n.prototype=Object.create(Error.prototype,{constructor:{value:n},name:{value:"GraphQLError"},toString:{value:function(){return(0,i.printError)(this)}}})},{"../language/location":68,"./printError":36}],33:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.formatError=function(e){e||(0,n.default)(0,"Received null or undefined error.");var t=e.message||"An unknown error occurred.",r=e.locations,i=e.path,o=e.extensions;return o?{message:t,locations:r,path:i,extensions:o}:{message:t,locations:r,path:i}};var n=function(e){return e&&e.__esModule?e:{default:e}}(e("../jsutils/invariant"))},{"../jsutils/invariant":48}],34:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"GraphQLError",{enumerable:!0,get:function(){return n.GraphQLError}}),Object.defineProperty(r,"syntaxError",{enumerable:!0,get:function(){return i.syntaxError}}),Object.defineProperty(r,"locatedError",{enumerable:!0,get:function(){return o.locatedError}}),Object.defineProperty(r,"printError",{enumerable:!0,get:function(){return a.printError}}),Object.defineProperty(r,"formatError",{enumerable:!0,get:function(){return s.formatError}});var n=e("./GraphQLError"),i=e("./syntaxError"),o=e("./locatedError"),a=e("./printError"),s=e("./formatError")},{"./GraphQLError":32,"./formatError":33,"./locatedError":35,"./printError":36,"./syntaxError":37}],35:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.locatedError=function(e,t,r){return e&&Array.isArray(e.path)?e:new n.GraphQLError(e&&e.message,e&&e.nodes||t,e&&e.source,e&&e.positions,r,e)};var n=e("./GraphQLError")},{"./GraphQLError":32}],36:[function(e,t,r){"use strict";function n(e,t){var r=e.locationOffset.column-1,n=o(r)+e.body,a=t.line-1,s=e.locationOffset.line-1,u=t.line+s,c=1===t.line?r:0,l=t.column+c,h=n.split(/\r\n|[\n\r]/g);return"".concat(e.name," (").concat(u,":").concat(l,")\n")+i([["".concat(u-1,": "),h[a-1]],["".concat(u,": "),h[a]],["",o(l-1)+"^"],["".concat(u+1,": "),h[a+1]]])}function i(e){var t=e.filter(function(e){e[0];return void 0!==e[1]}),r=0,n=!0,i=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){var c=s.value[0];r=Math.max(r,c.length)}}catch(e){i=!0,o=e}finally{try{n||null==u.return||u.return()}finally{if(i)throw o}}return t.map(function(e){var t=e[0],n=e[1];return a(r,t)+n}).join("\n")}function o(e){return Array(e+1).join(" ")}function a(e,t){return o(e-t.length)+t}Object.defineProperty(r,"__esModule",{value:!0}),r.printError=function(e){var t=[];if(e.nodes){var r=!0,i=!1,o=void 0;try{for(var a,u=e.nodes[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var c=a.value;c.loc&&t.push(n(c.loc.source,(0,s.getLocation)(c.loc.source,c.loc.start)))}}catch(e){i=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}}else if(e.source&&e.locations){var l=e.source,h=!0,p=!1,f=void 0;try{for(var d,m=e.locations[Symbol.iterator]();!(h=(d=m.next()).done);h=!0){var v=d.value;t.push(n(l,v))}}catch(e){p=!0,f=e}finally{try{h||null==m.return||m.return()}finally{if(p)throw f}}}return 0===t.length?e.message:[e.message].concat(t).join("\n\n")+"\n"};var s=e("../language/location")},{"../language/location":68}],37:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.syntaxError=function(e,t,r){return new n.GraphQLError("Syntax Error: ".concat(r),void 0,e,[t])};var n=e("./GraphQLError")},{"./GraphQLError":32}],38:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t,r,n,i,o,s){c(e,t,i);var u=l(e,t,r,n,i,o,s);return Array.isArray(u)?{errors:u}:a(u,h(u,u.operation,r))}function a(e,t){return(0,U.default)(t)?t.then(function(t){return a(e,t)}):0===e.errors.length?{data:t}:{errors:e.errors,data:t}}function s(e){for(var t=[],r=e;r;)t.push(r.key),r=r.prev;return t.reverse()}function u(e,t){return{prev:e,key:t}}function c(e,t,r){t||(0,F.default)(0,"Must provide document"),(0,Z.assertValidSchema)(e),r&&"object"!==i(r)&&(0,F.default)(0,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function l(e,t,r,n,i,o,a){for(var s,u=[],c=!1,l=Object.create(null),h=0;h<t.definitions.length;h++){var p=t.definitions[h];switch(p.kind){case W.Kind.OPERATION_DEFINITION:!o&&s?c=!0:(!o||p.name&&p.name.value===o)&&(s=p);break;case W.Kind.FRAGMENT_DEFINITION:l[p.name.value]=p}}s?c&&u.push(new R.GraphQLError("Must provide operation name if query contains multiple operations.")):o?u.push(new R.GraphQLError('Unknown operation named "'.concat(o,'".'))):u.push(new R.GraphQLError("Must provide an operation."));var f;if(s){var d=(0,Q.getVariableValues)(e,s.variableDefinitions||[],i||{});d.errors?u.push.apply(u,d.errors):f=d.coerced}return 0!==u.length?u:(s||(0,F.default)(0,"Has operation if no errors."),f||(0,F.default)(0,"Has variables if no errors."),{schema:e,fragments:l,rootValue:r,contextValue:n,operation:s,variableValues:f,fieldResolver:a||ee,errors:u})}function h(e,t,r){var n=(0,$.getOperationRootType)(e.schema,t),i=d(e,n,t.selectionSet,Object.create(null),Object.create(null));try{var o="mutation"===t.operation?p(e,n,r,void 0,i):f(e,n,r,void 0,i);return(0,U.default)(o)?o.then(void 0,function(t){return e.errors.push(t),Promise.resolve(null)}):o}catch(t){return e.errors.push(t),null}}function p(e,t,r,n,i){return(0,q.default)(Object.keys(i),function(o,a){var s=i[a],c=u(n,a),l=g(e,t,r,s,c);return void 0===l?o:(0,U.default)(l)?l.then(function(e){return o[a]=e,o}):(o[a]=l,o)},Object.create(null))}function f(e,t,r,n,i){for(var o=Object.create(null),a=!1,s=0,c=Object.keys(i);s<c.length;++s){var l=c[s],h=g(e,t,r,i[l],u(n,l));void 0!==h&&(o[l]=h,!a&&(0,U.default)(h)&&(a=!0))}return a?(0,z.default)(o):o}function d(e,t,r,n,i){for(var o=0;o<r.selections.length;o++){var a=r.selections[o];switch(a.kind){case W.Kind.FIELD:if(!m(e,a))continue;var s=y(a);n[s]||(n[s]=[]),n[s].push(a);break;case W.Kind.INLINE_FRAGMENT:if(!m(e,a)||!v(e,a,t))continue;d(e,t,a.selectionSet,n,i);break;case W.Kind.FRAGMENT_SPREAD:var u=a.name.value;if(i[u]||!m(e,a))continue;i[u]=!0;var c=e.fragments[u];if(!c||!v(e,c,t))continue;d(e,t,c.selectionSet,n,i)}}return n}function m(e,t){var r=(0,Q.getDirectiveValues)(Y.GraphQLSkipDirective,t,e.variableValues);if(r&&!0===r.if)return!1;var n=(0,Q.getDirectiveValues)(Y.GraphQLIncludeDirective,t,e.variableValues);return!n||!1!==n.if}function v(e,t,r){var n=t.typeCondition;if(!n)return!0;var i=(0,H.typeFromAST)(e.schema,n);return i===r||!!(0,K.isAbstractType)(i)&&e.schema.isPossibleType(i,r)}function y(e){return e.alias?e.alias.value:e.name.value}function g(e,t,r,n,i){var o=n[0].name.value,a=L(e.schema,t,o);if(a){var s=a.resolve||e.fieldResolver,u=b(e,a,n,t,i),c=_(e,a,n,s,r,u);return w(e,a.type,n,u,i,c)}}function b(e,t,r,n,i){return{fieldName:t.name,fieldNodes:r,returnType:t.type,parentType:n,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function _(e,t,r,n,i,o){try{var a=n(i,(0,Q.getArgumentValues)(t,r[0],e.variableValues),e.contextValue,o);return(0,U.default)(a)?a.then(void 0,x):a}catch(e){return x(e)}}function x(e){return e instanceof Error?e:new Error(e||void 0)}function w(e,t,r,n,i,o){try{var a;return a=(0,U.default)(o)?o.then(function(o){return T(e,t,r,n,i,o)}):T(e,t,r,n,i,o),(0,U.default)(a)?a.then(void 0,function(n){return S(n,r,i,t,e)}):a}catch(n){return S(n,r,i,t,e)}}function S(e,t,r,n,i){var o=(0,k.locatedError)(x(e),t,s(r));if((0,K.isNonNullType)(n))throw o;return i.errors.push(o),null}function T(e,t,r,n,i,o){if(o instanceof Error)throw o;if((0,K.isNonNullType)(t)){var a=T(e,t.ofType,r,n,i,o);if(null===a)throw new Error("Cannot return null for non-nullable field ".concat(n.parentType.name,".").concat(n.fieldName,"."));return a}if((0,B.default)(o))return null;if((0,K.isListType)(t))return E(e,t,r,n,i,o);if((0,K.isLeafType)(t))return O(t,o);if((0,K.isAbstractType)(t))return M(e,t,r,n,i,o);if((0,K.isObjectType)(t))return j(e,t,r,n,i,o);throw new Error('Cannot complete value of unexpected type "'.concat((0,D.default)(t),'".'))}function E(e,t,r,n,i,o){(0,I.isCollection)(o)||(0,F.default)(0,"Expected Iterable, but did not find one for field ".concat(n.parentType.name,".").concat(n.fieldName,"."));var a=t.ofType,s=!1,c=[];return(0,I.forEach)(o,function(t,o){var l=u(i,o),h=w(e,a,r,n,l,t);!s&&(0,U.default)(h)&&(s=!0),c.push(h)}),s?Promise.all(c):c}function O(e,t){e.serialize||(0,F.default)(0,"Missing serialize method on type");var r=e.serialize(t);if((0,V.default)(r))throw new Error('Expected a value of type "'.concat((0,D.default)(e),'" but ')+"received: ".concat((0,D.default)(t)));return r}function M(e,t,r,n,i,o){var a=t.resolveType?t.resolveType(o,e.contextValue,n):N(o,e.contextValue,n,t);return(0,U.default)(a)?a.then(function(a){return j(e,C(a,e,t,r,n,o),r,n,i,o)}):j(e,C(a,e,t,r,n,o),r,n,i,o)}function C(e,t,r,n,i,o){var a="string"==typeof e?t.schema.getType(e):e;if(!(0,K.isObjectType)(a))throw new R.GraphQLError("Abstract type ".concat(r.name," must resolve to an Object type at ")+"runtime for field ".concat(i.parentType.name,".").concat(i.fieldName," with ")+"value ".concat((0,D.default)(o),', received "').concat((0,D.default)(a),'". ')+"Either the ".concat(r.name,' type should provide a "resolveType" ')+'function or each possible type should provide an "isTypeOf" function.',n);if(!t.schema.isPossibleType(r,a))throw new R.GraphQLError('Runtime Object type "'.concat(a.name,'" is not a possible type ')+'for "'.concat(r.name,'".'),n);return a}function j(e,t,r,n,i,o){if(t.isTypeOf){var a=t.isTypeOf(o,e.contextValue,n);if((0,U.default)(a))return a.then(function(n){if(!n)throw P(t,o,r);return A(e,t,r,i,o)});if(!a)throw P(t,o,r)}return A(e,t,r,i,o)}function P(e,t,r){return new R.GraphQLError('Expected value of type "'.concat(e.name,'" but got: ').concat((0,D.default)(t),"."),r)}function A(e,t,r,n,i){return f(e,t,i,n,J(e,t,r))}function N(e,t,r,n){if(null!==e&&"object"===i(e)&&"string"==typeof e.__typename)return e.__typename;for(var o=r.schema.getPossibleTypes(n),a=[],s=0;s<o.length;s++){var u=o[s];if(u.isTypeOf){var c=u.isTypeOf(e,t,r);if((0,U.default)(c))a[s]=c;else if(c)return u}}return a.length?Promise.all(a).then(function(e){for(var t=0;t<e.length;t++)if(e[t])return o[t]}):void 0}function L(e,t,r){return r===X.SchemaMetaFieldDef.name&&e.getQueryType()===t?X.SchemaMetaFieldDef:r===X.TypeMetaFieldDef.name&&e.getQueryType()===t?X.TypeMetaFieldDef:r===X.TypeNameMetaFieldDef.name?X.TypeNameMetaFieldDef:t.getFields()[r]}Object.defineProperty(r,"__esModule",{value:!0}),r.execute=function(e,t,r,n,i,a,s){return 1===arguments.length?o(e.schema,e.document,e.rootValue,e.contextValue,e.variableValues,e.operationName,e.fieldResolver):o(e,t,r,n,i,a,s)},r.responsePathAsArray=s,r.addPath=u,r.assertValidExecutionArguments=c,r.buildExecutionContext=l,r.collectFields=d,r.buildResolveInfo=b,r.resolveFieldValueOrError=_,r.getFieldDef=L,r.defaultFieldResolver=void 0;var I=e("iterall"),R=e("../error/GraphQLError"),k=e("../error/locatedError"),D=n(e("../jsutils/inspect")),F=n(e("../jsutils/invariant")),V=n(e("../jsutils/isInvalid")),B=n(e("../jsutils/isNullish")),U=n(e("../jsutils/isPromise")),G=n(e("../jsutils/memoize3")),z=n(e("../jsutils/promiseForObject")),q=n(e("../jsutils/promiseReduce")),$=e("../utilities/getOperationRootType"),H=e("../utilities/typeFromAST"),W=e("../language/kinds"),Q=e("./values"),K=e("../type/definition"),X=e("../type/introspection"),Y=e("../type/directives"),Z=e("../type/validate"),J=(0,G.default)(function(e,t,r){for(var n=Object.create(null),i=Object.create(null),o=0;o<r.length;o++){var a=r[o].selectionSet;a&&(n=d(e,t,a,n,i))}return n}),ee=function(e,t,r,n){if("object"===i(e)||"function"==typeof e){var o=e[n.fieldName];return"function"==typeof o?e[n.fieldName](t,r,n):o}};r.defaultFieldResolver=ee},{"../error/GraphQLError":32,"../error/locatedError":35,"../jsutils/inspect":46,"../jsutils/invariant":48,"../jsutils/isInvalid":51,"../jsutils/isNullish":52,"../jsutils/isPromise":53,"../jsutils/memoize3":56,"../jsutils/promiseForObject":59,"../jsutils/promiseReduce":60,"../language/kinds":66,"../type/definition":77,"../type/directives":78,"../type/introspection":80,"../type/validate":83,"../utilities/getOperationRootType":95,"../utilities/typeFromAST":105,"./values":40,iterall:144}],39:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"execute",{enumerable:!0,get:function(){return n.execute}}),Object.defineProperty(r,"defaultFieldResolver",{enumerable:!0,get:function(){return n.defaultFieldResolver}}),Object.defineProperty(r,"responsePathAsArray",{enumerable:!0,get:function(){return n.responsePathAsArray}}),Object.defineProperty(r,"getDirectiveValues",{enumerable:!0,get:function(){return i.getDirectiveValues}});var n=e("./execute"),i=e("./values")},{"./execute":38,"./values":40}],40:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){var n={},i=e.args,s=t.arguments;if(!i||!s)return n;for(var h=(0,l.default)(s,function(e){return e.name.value}),p=0;p<i.length;p++){var y=i[p],g=y.name,b=y.type,_=h[g],x=void 0,w=void 0;if(_&&_.value.kind===d.Kind.VARIABLE){var S=_.value.name.value;x=r&&o(r,S),w=r&&null===r[S]}else x=null!=_,w=_&&_.value.kind===d.Kind.NULL;if(x||void 0===y.defaultValue){if((!x||w)&&(0,v.isNonNullType)(b)){if(w)throw new a.GraphQLError('Argument "'.concat(g,'" of non-null type "').concat((0,u.default)(b),'" ')+"must not be null.",[_.value]);if(_&&_.value.kind===d.Kind.VARIABLE){var T=_.value.name.value;throw new a.GraphQLError('Argument "'.concat(g,'" of required type "').concat((0,u.default)(b),'" ')+'was provided the variable "$'.concat(T,'" ')+"which was not provided a runtime value.",[_.value])}throw new a.GraphQLError('Argument "'.concat(g,'" of required type "').concat((0,u.default)(b),'" ')+"was not provided.",[t])}if(x)if(_.value.kind===d.Kind.NULL)n[g]=null;else if(_.value.kind===d.Kind.VARIABLE){var E=_.value.name.value;r||(0,c.default)(0,"Must exist for hasValue to be true."),n[g]=r[E]}else{var O=_.value,M=(0,f.valueFromAST)(O,b,r);if(void 0===M)throw new a.GraphQLError('Argument "'.concat(g,'" has invalid value ').concat((0,m.print)(O),"."),[_.value]);n[g]=M}}else n[g]=y.defaultValue}return n}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}Object.defineProperty(r,"__esModule",{value:!0}),r.getVariableValues=function(e,t,r){for(var n=[],i={},s=0;s<t.length;s++){var c=t[s],l=c.variable.name.value,d=(0,p.typeFromAST)(e,c.type);if((0,v.isInputType)(d)){var y=o(r,l),g=y?r[l]:void 0;if(!y&&c.defaultValue)i[l]=(0,f.valueFromAST)(c.defaultValue,d);else if(y&&null!==g||!(0,v.isNonNullType)(d)){if(y)if(null===g)i[l]=null;else{var b=(0,h.coerceValue)(g,d,c),_=b.errors;if(_){var x=!0,w=!1,S=void 0;try{for(var T,E=_[Symbol.iterator]();!(x=(T=E.next()).done);x=!0){var O=T.value;O.message='Variable "$'.concat(l,'" got invalid value ').concat((0,u.default)(g),"; ")+O.message}}catch(e){w=!0,S=e}finally{try{x||null==E.return||E.return()}finally{if(w)throw S}}n.push.apply(n,_)}else i[l]=b.value}}else n.push(new a.GraphQLError(y?'Variable "$'.concat(l,'" of non-null type ')+'"'.concat((0,u.default)(d),'" must not be null.'):'Variable "$'.concat(l,'" of required type ')+'"'.concat((0,u.default)(d),'" was not provided.'),[c]))}else n.push(new a.GraphQLError('Variable "$'.concat(l,'" expected value of type ')+'"'.concat((0,m.print)(c.type),'" which cannot be used as an input type.'),[c.type]))}return 0===n.length?{errors:void 0,coerced:i}:{errors:n,coerced:void 0}},r.getArgumentValues=i,r.getDirectiveValues=function(e,t,r){var n=t.directives&&(0,s.default)(t.directives,function(t){return t.name.value===e.name});if(n)return i(e,n,r)};var a=e("../error/GraphQLError"),s=n(e("../jsutils/find")),u=n(e("../jsutils/inspect")),c=n(e("../jsutils/invariant")),l=n(e("../jsutils/keyMap")),h=e("../utilities/coerceValue"),p=e("../utilities/typeFromAST"),f=e("../utilities/valueFromAST"),d=e("../language/kinds"),m=e("../language/printer"),v=e("../type/definition")},{"../error/GraphQLError":32,"../jsutils/find":45,"../jsutils/inspect":46,"../jsutils/invariant":48,"../jsutils/keyMap":54,"../language/kinds":66,"../language/printer":71,"../type/definition":77,"../utilities/coerceValue":89,"../utilities/typeFromAST":105,"../utilities/valueFromAST":106}],41:[function(e,t,r){"use strict";function n(e,t,r,n,u,c,l){var h=(0,i.validateSchema)(e);if(h.length>0)return{errors:h};var p;try{p=(0,o.parse)(t)}catch(e){return{errors:[e]}}var f=(0,a.validate)(e,p);return f.length>0?{errors:f}:(0,s.execute)(e,p,r,n,u,c,l)}Object.defineProperty(r,"__esModule",{value:!0}),r.graphql=function(e,t,r,i,o,a,s){var u=arguments;return new Promise(function(c){return c(1===u.length?n(e.schema,e.source,e.rootValue,e.contextValue,e.variableValues,e.operationName,e.fieldResolver):n(e,t,r,i,o,a,s))})},r.graphqlSync=function(e,t,r,i,o,a,s){var u=1===arguments.length?n(e.schema,e.source,e.rootValue,e.contextValue,e.variableValues,e.operationName,e.fieldResolver):n(e,t,r,i,o,a,s);if(u.then)throw new Error("GraphQL execution failed to complete synchronously.");return u};var i=e("./type/validate"),o=e("./language/parser"),a=e("./validation/validate"),s=e("./execution/execute")},{"./execution/execute":38,"./language/parser":69,"./type/validate":83,"./validation/validate":138}],42:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"graphql",{enumerable:!0,get:function(){return n.graphql}}),Object.defineProperty(r,"graphqlSync",{enumerable:!0,get:function(){return n.graphqlSync}}),Object.defineProperty(r,"GraphQLSchema",{enumerable:!0,get:function(){return i.GraphQLSchema}}),Object.defineProperty(r,"GraphQLScalarType",{enumerable:!0,get:function(){return i.GraphQLScalarType}}),Object.defineProperty(r,"GraphQLObjectType",{enumerable:!0,get:function(){return i.GraphQLObjectType}}),Object.defineProperty(r,"GraphQLInterfaceType",{enumerable:!0,get:function(){return i.GraphQLInterfaceType}}),Object.defineProperty(r,"GraphQLUnionType",{enumerable:!0,get:function(){return i.GraphQLUnionType}}),Object.defineProperty(r,"GraphQLEnumType",{enumerable:!0,get:function(){return i.GraphQLEnumType}}),Object.defineProperty(r,"GraphQLInputObjectType",{enumerable:!0,get:function(){return i.GraphQLInputObjectType}}),Object.defineProperty(r,"GraphQLList",{enumerable:!0,get:function(){return i.GraphQLList}}),Object.defineProperty(r,"GraphQLNonNull",{enumerable:!0,get:function(){return i.GraphQLNonNull}}),Object.defineProperty(r,"GraphQLDirective",{enumerable:!0,get:function(){return i.GraphQLDirective}}),Object.defineProperty(r,"TypeKind",{enumerable:!0,get:function(){return i.TypeKind}}),Object.defineProperty(r,"specifiedScalarTypes",{enumerable:!0,get:function(){return i.specifiedScalarTypes}}),Object.defineProperty(r,"GraphQLInt",{enumerable:!0,get:function(){return i.GraphQLInt}}),Object.defineProperty(r,"GraphQLFloat",{enumerable:!0,get:function(){return i.GraphQLFloat}}),Object.defineProperty(r,"GraphQLString",{enumerable:!0,get:function(){return i.GraphQLString}}),Object.defineProperty(r,"GraphQLBoolean",{enumerable:!0,get:function(){return i.GraphQLBoolean}}),Object.defineProperty(r,"GraphQLID",{enumerable:!0,get:function(){return i.GraphQLID}}),Object.defineProperty(r,"specifiedDirectives",{enumerable:!0,get:function(){return i.specifiedDirectives}}),Object.defineProperty(r,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return i.GraphQLIncludeDirective}}),Object.defineProperty(r,"GraphQLSkipDirective",{enumerable:!0,get:function(){return i.GraphQLSkipDirective}}),Object.defineProperty(r,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return i.GraphQLDeprecatedDirective}}),Object.defineProperty(r,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return i.DEFAULT_DEPRECATION_REASON}}),Object.defineProperty(r,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return i.SchemaMetaFieldDef}}),Object.defineProperty(r,"TypeMetaFieldDef",{enumerable:!0,get:function(){return i.TypeMetaFieldDef}}),Object.defineProperty(r,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return i.TypeNameMetaFieldDef}}),Object.defineProperty(r,"introspectionTypes",{enumerable:!0,get:function(){return i.introspectionTypes}}),Object.defineProperty(r,"__Schema",{enumerable:!0,get:function(){return i.__Schema}}),Object.defineProperty(r,"__Directive",{enumerable:!0,get:function(){return i.__Directive}}),Object.defineProperty(r,"__DirectiveLocation",{enumerable:!0,get:function(){return i.__DirectiveLocation}}),Object.defineProperty(r,"__Type",{enumerable:!0,get:function(){return i.__Type}}),Object.defineProperty(r,"__Field",{enumerable:!0,get:function(){return i.__Field}}),Object.defineProperty(r,"__InputValue",{enumerable:!0,get:function(){return i.__InputValue}}),Object.defineProperty(r,"__EnumValue",{enumerable:!0,get:function(){return i.__EnumValue}}),Object.defineProperty(r,"__TypeKind",{enumerable:!0,get:function(){return i.__TypeKind}}),Object.defineProperty(r,"isSchema",{enumerable:!0,get:function(){return i.isSchema}}),Object.defineProperty(r,"isDirective",{enumerable:!0,get:function(){return i.isDirective}}),Object.defineProperty(r,"isType",{enumerable:!0,get:function(){return i.isType}}),Object.defineProperty(r,"isScalarType",{enumerable:!0,get:function(){return i.isScalarType}}),Object.defineProperty(r,"isObjectType",{enumerable:!0,get:function(){return i.isObjectType}}),Object.defineProperty(r,"isInterfaceType",{enumerable:!0,get:function(){return i.isInterfaceType}}),Object.defineProperty(r,"isUnionType",{enumerable:!0,get:function(){return i.isUnionType}}),Object.defineProperty(r,"isEnumType",{enumerable:!0,get:function(){return i.isEnumType}}),Object.defineProperty(r,"isInputObjectType",{enumerable:!0,get:function(){return i.isInputObjectType}}),Object.defineProperty(r,"isListType",{enumerable:!0,get:function(){return i.isListType}}),Object.defineProperty(r,"isNonNullType",{enumerable:!0,get:function(){return i.isNonNullType}}),Object.defineProperty(r,"isInputType",{enumerable:!0,get:function(){return i.isInputType}}),Object.defineProperty(r,"isOutputType",{enumerable:!0,get:function(){return i.isOutputType}}),Object.defineProperty(r,"isLeafType",{enumerable:!0,get:function(){return i.isLeafType}}),Object.defineProperty(r,"isCompositeType",{enumerable:!0,get:function(){return i.isCompositeType}}),Object.defineProperty(r,"isAbstractType",{enumerable:!0,get:function(){return i.isAbstractType}}),Object.defineProperty(r,"isWrappingType",{enumerable:!0,get:function(){return i.isWrappingType}}),Object.defineProperty(r,"isNullableType",{enumerable:!0,get:function(){return i.isNullableType}}),Object.defineProperty(r,"isNamedType",{enumerable:!0,get:function(){return i.isNamedType}}),Object.defineProperty(r,"isRequiredArgument",{enumerable:!0,get:function(){return i.isRequiredArgument}}),Object.defineProperty(r,"isRequiredInputField",{enumerable:!0,get:function(){return i.isRequiredInputField}}),Object.defineProperty(r,"isSpecifiedScalarType",{enumerable:!0,get:function(){return i.isSpecifiedScalarType}}),Object.defineProperty(r,"isIntrospectionType",{enumerable:!0,get:function(){return i.isIntrospectionType}}),Object.defineProperty(r,"isSpecifiedDirective",{enumerable:!0,get:function(){return i.isSpecifiedDirective}}),Object.defineProperty(r,"assertType",{enumerable:!0,get:function(){return i.assertType}}),Object.defineProperty(r,"assertScalarType",{enumerable:!0,get:function(){return i.assertScalarType}}),Object.defineProperty(r,"assertObjectType",{enumerable:!0,get:function(){return i.assertObjectType}}),Object.defineProperty(r,"assertInterfaceType",{enumerable:!0,get:function(){return i.assertInterfaceType}}),Object.defineProperty(r,"assertUnionType",{enumerable:!0,get:function(){return i.assertUnionType}}),Object.defineProperty(r,"assertEnumType",{enumerable:!0,get:function(){return i.assertEnumType}}),Object.defineProperty(r,"assertInputObjectType",{enumerable:!0,get:function(){return i.assertInputObjectType}}),Object.defineProperty(r,"assertListType",{enumerable:!0,get:function(){return i.assertListType}}),Object.defineProperty(r,"assertNonNullType",{enumerable:!0,get:function(){return i.assertNonNullType}}),Object.defineProperty(r,"assertInputType",{enumerable:!0,get:function(){return i.assertInputType}}),Object.defineProperty(r,"assertOutputType",{enumerable:!0,get:function(){return i.assertOutputType}}),Object.defineProperty(r,"assertLeafType",{enumerable:!0,get:function(){return i.assertLeafType}}),Object.defineProperty(r,"assertCompositeType",{enumerable:!0,get:function(){return i.assertCompositeType}}),Object.defineProperty(r,"assertAbstractType",{enumerable:!0,get:function(){return i.assertAbstractType}}),Object.defineProperty(r,"assertWrappingType",{enumerable:!0,get:function(){return i.assertWrappingType}}),Object.defineProperty(r,"assertNullableType",{enumerable:!0,get:function(){return i.assertNullableType}}),Object.defineProperty(r,"assertNamedType",{enumerable:!0,get:function(){return i.assertNamedType}}),Object.defineProperty(r,"getNullableType",{enumerable:!0,get:function(){return i.getNullableType}}),Object.defineProperty(r,"getNamedType",{enumerable:!0,get:function(){return i.getNamedType}}),Object.defineProperty(r,"validateSchema",{enumerable:!0,get:function(){return i.validateSchema}}),Object.defineProperty(r,"assertValidSchema",{enumerable:!0,get:function(){return i.assertValidSchema}}),Object.defineProperty(r,"Source",{enumerable:!0,get:function(){return o.Source}}),Object.defineProperty(r,"getLocation",{enumerable:!0,get:function(){return o.getLocation}}),Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return o.parse}}),Object.defineProperty(r,"parseValue",{enumerable:!0,get:function(){return o.parseValue}}),Object.defineProperty(r,"parseType",{enumerable:!0,get:function(){return o.parseType}}),Object.defineProperty(r,"print",{enumerable:!0,get:function(){return o.print}}),Object.defineProperty(r,"visit",{enumerable:!0,get:function(){return o.visit}}),Object.defineProperty(r,"visitInParallel",{enumerable:!0,get:function(){return o.visitInParallel}}),Object.defineProperty(r,"visitWithTypeInfo",{enumerable:!0,get:function(){return o.visitWithTypeInfo}}),Object.defineProperty(r,"getVisitFn",{enumerable:!0,get:function(){return o.getVisitFn}}),Object.defineProperty(r,"Kind",{enumerable:!0,get:function(){return o.Kind}}),Object.defineProperty(r,"TokenKind",{enumerable:!0,get:function(){return o.TokenKind}}),Object.defineProperty(r,"DirectiveLocation",{enumerable:!0,get:function(){return o.DirectiveLocation}}),Object.defineProperty(r,"BREAK",{enumerable:!0,get:function(){return o.BREAK}}),Object.defineProperty(r,"isDefinitionNode",{enumerable:!0,get:function(){return o.isDefinitionNode}}),Object.defineProperty(r,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return o.isExecutableDefinitionNode}}),Object.defineProperty(r,"isSelectionNode",{enumerable:!0,get:function(){return o.isSelectionNode}}),Object.defineProperty(r,"isValueNode",{enumerable:!0,get:function(){return o.isValueNode}}),Object.defineProperty(r,"isTypeNode",{enumerable:!0,get:function(){return o.isTypeNode}}),Object.defineProperty(r,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return o.isTypeSystemDefinitionNode}}),Object.defineProperty(r,"isTypeDefinitionNode",{enumerable:!0,get:function(){return o.isTypeDefinitionNode}}),Object.defineProperty(r,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return o.isTypeSystemExtensionNode}}),Object.defineProperty(r,"isTypeExtensionNode",{enumerable:!0,get:function(){return o.isTypeExtensionNode}}),Object.defineProperty(r,"execute",{enumerable:!0,get:function(){return a.execute}}),Object.defineProperty(r,"defaultFieldResolver",{enumerable:!0,get:function(){return a.defaultFieldResolver}}),Object.defineProperty(r,"responsePathAsArray",{enumerable:!0,get:function(){return a.responsePathAsArray}}),Object.defineProperty(r,"getDirectiveValues",{enumerable:!0,get:function(){return a.getDirectiveValues}}),Object.defineProperty(r,"subscribe",{enumerable:!0,get:function(){return s.subscribe}}),Object.defineProperty(r,"createSourceEventStream",{enumerable:!0,get:function(){return s.createSourceEventStream}}),Object.defineProperty(r,"validate",{enumerable:!0,get:function(){return u.validate}}),Object.defineProperty(r,"ValidationContext",{enumerable:!0,get:function(){return u.ValidationContext}}),Object.defineProperty(r,"specifiedRules",{enumerable:!0,get:function(){return u.specifiedRules}}),Object.defineProperty(r,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return u.FieldsOnCorrectTypeRule}}),Object.defineProperty(r,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return u.FragmentsOnCompositeTypesRule}}),Object.defineProperty(r,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return u.KnownArgumentNamesRule}}),Object.defineProperty(r,"KnownDirectivesRule",{enumerable:!0,get:function(){return u.KnownDirectivesRule}}),Object.defineProperty(r,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return u.KnownFragmentNamesRule}}),Object.defineProperty(r,"KnownTypeNamesRule",{enumerable:!0,get:function(){return u.KnownTypeNamesRule}}),Object.defineProperty(r,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return u.LoneAnonymousOperationRule}}),Object.defineProperty(r,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return u.NoFragmentCyclesRule}}),Object.defineProperty(r,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return u.NoUndefinedVariablesRule}}),Object.defineProperty(r,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return u.NoUnusedFragmentsRule}}),Object.defineProperty(r,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return u.NoUnusedVariablesRule}}),Object.defineProperty(r,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return u.OverlappingFieldsCanBeMergedRule}}),Object.defineProperty(r,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return u.PossibleFragmentSpreadsRule}}),Object.defineProperty(r,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return u.ProvidedRequiredArgumentsRule}}),Object.defineProperty(r,"ScalarLeafsRule",{enumerable:!0,get:function(){return u.ScalarLeafsRule}}),Object.defineProperty(r,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return u.SingleFieldSubscriptionsRule}}),Object.defineProperty(r,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return u.UniqueArgumentNamesRule}}),Object.defineProperty(r,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return u.UniqueDirectivesPerLocationRule}}),Object.defineProperty(r,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return u.UniqueFragmentNamesRule}}),Object.defineProperty(r,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return u.UniqueInputFieldNamesRule}}),Object.defineProperty(r,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return u.UniqueOperationNamesRule}}),Object.defineProperty(r,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return u.UniqueVariableNamesRule}}),Object.defineProperty(r,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return u.ValuesOfCorrectTypeRule}}),Object.defineProperty(r,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return u.VariablesAreInputTypesRule}}),Object.defineProperty(r,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return u.VariablesInAllowedPositionRule}}),Object.defineProperty(r,"GraphQLError",{enumerable:!0,get:function(){return c.GraphQLError}}),Object.defineProperty(r,"formatError",{enumerable:!0,get:function(){return c.formatError}}),Object.defineProperty(r,"printError",{enumerable:!0,get:function(){return c.printError}}),Object.defineProperty(r,"getIntrospectionQuery",{enumerable:!0,get:function(){return l.getIntrospectionQuery}}),Object.defineProperty(r,"introspectionQuery",{enumerable:!0,get:function(){return l.introspectionQuery}}),Object.defineProperty(r,"getOperationAST",{enumerable:!0,get:function(){return l.getOperationAST}}),Object.defineProperty(r,"getOperationRootType",{enumerable:!0,get:function(){return l.getOperationRootType}}),Object.defineProperty(r,"introspectionFromSchema",{enumerable:!0,get:function(){return l.introspectionFromSchema}}),Object.defineProperty(r,"buildClientSchema",{enumerable:!0,get:function(){return l.buildClientSchema}}),Object.defineProperty(r,"buildASTSchema",{enumerable:!0,get:function(){return l.buildASTSchema}}),Object.defineProperty(r,"buildSchema",{enumerable:!0,get:function(){return l.buildSchema}}),Object.defineProperty(r,"getDescription",{enumerable:!0,get:function(){return l.getDescription}}),Object.defineProperty(r,"extendSchema",{enumerable:!0,get:function(){return l.extendSchema}}),Object.defineProperty(r,"lexicographicSortSchema",{enumerable:!0,get:function(){return l.lexicographicSortSchema}}),Object.defineProperty(r,"printSchema",{enumerable:!0,get:function(){return l.printSchema}}),Object.defineProperty(r,"printIntrospectionSchema",{enumerable:!0,get:function(){return l.printIntrospectionSchema}}),Object.defineProperty(r,"printType",{enumerable:!0,get:function(){return l.printType}}),Object.defineProperty(r,"typeFromAST",{enumerable:!0,get:function(){return l.typeFromAST}}),Object.defineProperty(r,"valueFromAST",{enumerable:!0,get:function(){return l.valueFromAST}}),Object.defineProperty(r,"valueFromASTUntyped",{enumerable:!0,get:function(){return l.valueFromASTUntyped}}),Object.defineProperty(r,"astFromValue",{enumerable:!0,get:function(){return l.astFromValue}}),Object.defineProperty(r,"TypeInfo",{enumerable:!0,get:function(){return l.TypeInfo}}),Object.defineProperty(r,"coerceValue",{enumerable:!0,get:function(){return l.coerceValue}}),Object.defineProperty(r,"isValidJSValue",{enumerable:!0,get:function(){return l.isValidJSValue}}),Object.defineProperty(r,"isValidLiteralValue",{enumerable:!0,get:function(){return l.isValidLiteralValue}}),Object.defineProperty(r,"concatAST",{enumerable:!0,get:function(){return l.concatAST}}),Object.defineProperty(r,"separateOperations",{enumerable:!0,get:function(){return l.separateOperations}}),Object.defineProperty(r,"isEqualType",{enumerable:!0,get:function(){return l.isEqualType}}),Object.defineProperty(r,"isTypeSubTypeOf",{enumerable:!0,get:function(){return l.isTypeSubTypeOf}}),Object.defineProperty(r,"doTypesOverlap",{enumerable:!0,get:function(){return l.doTypesOverlap}}),Object.defineProperty(r,"assertValidName",{enumerable:!0,get:function(){return l.assertValidName}}),Object.defineProperty(r,"isValidNameError",{enumerable:!0,get:function(){return l.isValidNameError}}),Object.defineProperty(r,"findBreakingChanges",{enumerable:!0,get:function(){return l.findBreakingChanges}}),Object.defineProperty(r,"findDangerousChanges",{enumerable:!0,get:function(){return l.findDangerousChanges}}),Object.defineProperty(r,"BreakingChangeType",{enumerable:!0,get:function(){return l.BreakingChangeType}}),Object.defineProperty(r,"DangerousChangeType",{enumerable:!0,get:function(){return l.DangerousChangeType}}),Object.defineProperty(r,"findDeprecatedUsages",{enumerable:!0,get:function(){return l.findDeprecatedUsages}});var n=e("./graphql"),i=e("./type"),o=e("./language"),a=e("./execution"),s=e("./subscription"),u=e("./validation"),c=e("./error"),l=e("./utilities")},{"./error":34,"./execution":39,"./graphql":41,"./language":65,"./subscription":74,"./type":79,"./utilities":96,"./validation":109}],43:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){e.prototype.toJSON=e.prototype.inspect=e.prototype.toString}},{}],44:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){"function"==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return this.constructor.name}})}},{}],45:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}},{}],46:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){switch(n(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":if(e){if("function"==typeof e.inspect)return e.inspect();if(Array.isArray(e))return"["+e.map(i).join(", ")+"]";var t=Object.keys(e).map(function(t){return"".concat(t,": ").concat(i(e[t]))}).join(", ");return t?"{ "+t+" }":"{}"}return String(e);default:return String(e)}}Object.defineProperty(r,"__esModule",{value:!0}),r.default=i},{}],47:[function(e,t,r){(function(e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var t="production"===e.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if(e){var r=e.constructor,n=t.name;if(n&&r&&r.name===n)throw new Error("Cannot use ".concat(n,' "').concat(e,'" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.'))}return!1};r.default=t}).call(this,e("_process"))},{_process:17}],48:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){if(!e)throw new Error(t)}},{}],49:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=Number.isFinite||function(e){return"number"==typeof e&&n(e)},i=n;r.default=i},{}],50:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};r.default=n},{}],51:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return void 0===e||e!==e}},{}],52:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return null===e||void 0===e||e!==e}},{}],53:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return Boolean(e&&"function"==typeof e.then)}},{}],54:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){return e.reduce(function(e,r){return e[t(r)]=r,e},Object.create(null))}},{}],55:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t,r){return e.reduce(function(e,n){return e[t(n)]=r(n),e},Object.create(null))}},{}],56:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){var t;return function(r,n,i){t||(t=new WeakMap);var o,a=t.get(r);if(a){if(o=a.get(n)){var s=o.get(i);if(void 0!==s)return s}}else a=new WeakMap,t.set(r,a);o||(o=new WeakMap,a.set(n,o));var u=e.apply(this,arguments);return o.set(i,u),u}}},{}],57:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})};r.default=n},{}],58:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){var t=e.slice(0,n);return t.reduce(function(e,r,n){return e+(t.length>2?", ":" ")+(n===t.length-1?"or ":"")+r})};var n=5},{}],59:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){var t=Object.keys(e),r=t.map(function(t){return e[t]});return Promise.all(r).then(function(e){return e.reduce(function(e,r,n){return e[t[n]]=r,e},Object.create(null))})}},{}],60:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t,r){return e.reduce(function(e,r){return(0,n.default)(e)?e.then(function(e){return t(e,r)}):t(e,r)},r)};var n=function(e){return e&&e.__esModule?e:{default:e}}(e("./isPromise"))},{"./isPromise":53}],61:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return(0,n.default)(e.map(function(e){return'"'.concat(e,'"')}))};var n=function(e){return e&&e.__esModule?e:{default:e}}(e("./orList"))},{"./orList":58}],62:[function(e,t,r){"use strict";function n(e,t){if(e===t)return 0;var r,n,i=[],o=e.toLowerCase(),a=t.toLowerCase(),s=o.length,u=a.length;if(o===a)return 1;for(r=0;r<=s;r++)i[r]=[r];for(n=1;n<=u;n++)i[0][n]=n;for(r=1;r<=s;r++)for(n=1;n<=u;n++){var c=o[r-1]===a[n-1]?0:1;i[r][n]=Math.min(i[r-1][n]+1,i[r][n-1]+1,i[r-1][n-1]+c),r>1&&n>1&&o[r-1]===a[n-2]&&o[r-2]===a[n-1]&&(i[r][n]=Math.min(i[r][n],i[r-2][n-2]+c))}return i[s][u]}Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){for(var r=Object.create(null),i=t.length,o=e.length/2,a=0;a<i;a++){var s=n(e,t[a]);s<=Math.max(o,t[a].length/2,1)&&(r[t[a]]=s)}return Object.keys(r).sort(function(e,t){return r[e]-r[t]})}},{}],63:[function(e,t,r){"use strict";function n(e){for(var t=0;t<e.length&&(" "===e[t]||"\t"===e[t]);)t++;return t}function i(e){return n(e)===e.length}Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){for(var t=e.split(/\r\n|[\n\r]/g),r=null,o=1;o<t.length;o++){var a=t[o],s=n(a);if(s<a.length&&(null===r||s<r)&&0===(r=s))break}if(r)for(var u=1;u<t.length;u++)t[u]=t[u].slice(r);for(;t.length>0&&i(t[0]);)t.shift();for(;t.length>0&&i(t[t.length-1]);)t.pop();return t.join("\n")}},{}],64:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.DirectiveLocation=void 0;var n=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});r.DirectiveLocation=n},{}],65:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getLocation",{enumerable:!0,get:function(){return n.getLocation}}),Object.defineProperty(r,"Kind",{enumerable:!0,get:function(){return i.Kind}}),Object.defineProperty(r,"createLexer",{enumerable:!0,get:function(){return o.createLexer}}),Object.defineProperty(r,"TokenKind",{enumerable:!0,get:function(){return o.TokenKind}}),Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return a.parse}}),Object.defineProperty(r,"parseValue",{enumerable:!0,get:function(){return a.parseValue}}),Object.defineProperty(r,"parseType",{enumerable:!0,get:function(){return a.parseType}}),Object.defineProperty(r,"print",{enumerable:!0,get:function(){return s.print}}),Object.defineProperty(r,"Source",{enumerable:!0,get:function(){return u.Source}}),Object.defineProperty(r,"visit",{enumerable:!0,get:function(){return c.visit}}),Object.defineProperty(r,"visitInParallel",{enumerable:!0,get:function(){return c.visitInParallel}}),Object.defineProperty(r,"visitWithTypeInfo",{enumerable:!0,get:function(){return c.visitWithTypeInfo}}),Object.defineProperty(r,"getVisitFn",{enumerable:!0,get:function(){return c.getVisitFn}}),Object.defineProperty(r,"BREAK",{enumerable:!0,get:function(){return c.BREAK}}),Object.defineProperty(r,"isDefinitionNode",{enumerable:!0,get:function(){return l.isDefinitionNode}}),Object.defineProperty(r,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return l.isExecutableDefinitionNode}}),Object.defineProperty(r,"isSelectionNode",{enumerable:!0,get:function(){return l.isSelectionNode}}),Object.defineProperty(r,"isValueNode",{enumerable:!0,get:function(){return l.isValueNode}}),Object.defineProperty(r,"isTypeNode",{enumerable:!0,get:function(){return l.isTypeNode}}),Object.defineProperty(r,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return l.isTypeSystemDefinitionNode}}),Object.defineProperty(r,"isTypeDefinitionNode",{enumerable:!0,get:function(){return l.isTypeDefinitionNode}}),Object.defineProperty(r,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return l.isTypeSystemExtensionNode}}),Object.defineProperty(r,"isTypeExtensionNode",{enumerable:!0,get:function(){return l.isTypeExtensionNode}}),Object.defineProperty(r,"DirectiveLocation",{enumerable:!0,get:function(){return h.DirectiveLocation}});var n=e("./location"),i=e("./kinds"),o=e("./lexer"),a=e("./parser"),s=e("./printer"),u=e("./source"),c=e("./visitor"),l=e("./predicates"),h=e("./directiveLocation")},{"./directiveLocation":64,"./kinds":66,"./lexer":67,"./location":68,"./parser":69,"./predicates":70,"./printer":71,"./source":72,"./visitor":73}],66:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Kind=void 0;var n=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});r.Kind=n},{}],67:[function(e,t,r){"use strict";function n(){return this.lastToken=this.token,this.token=this.lookahead()}function i(){var e=this.token;if(e.kind!==_.EOF)do{e=e.next||(e.next=s(this,e))}while(e.kind===_.COMMENT);return e}function o(e,t,r,n,i,o,a){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=a,this.prev=o,this.next=null}function a(e){return isNaN(e)?_.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function s(e,t){var r=e.source,n=r.body,i=n.length,a=c(n,t.end,e),s=e.line,p=1+a-e.lineStart;if(a>=i)return new o(_.EOF,i,i,s,p,t);var m=x.call(n,a);switch(m){case 33:return new o(_.BANG,a,a+1,s,p,t);case 35:return l(r,a,s,p,t);case 36:return new o(_.DOLLAR,a,a+1,s,p,t);case 38:return new o(_.AMP,a,a+1,s,p,t);case 40:return new o(_.PAREN_L,a,a+1,s,p,t);case 41:return new o(_.PAREN_R,a,a+1,s,p,t);case 46:if(46===x.call(n,a+1)&&46===x.call(n,a+2))return new o(_.SPREAD,a,a+3,s,p,t);break;case 58:return new o(_.COLON,a,a+1,s,p,t);case 61:return new o(_.EQUALS,a,a+1,s,p,t);case 64:return new o(_.AT,a,a+1,s,p,t);case 91:return new o(_.BRACKET_L,a,a+1,s,p,t);case 93:return new o(_.BRACKET_R,a,a+1,s,p,t);case 123:return new o(_.BRACE_L,a,a+1,s,p,t);case 124:return new o(_.PIPE,a,a+1,s,p,t);case 125:return new o(_.BRACE_R,a,a+1,s,p,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return y(r,a,s,p,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return h(r,a,m,s,p,t);case 34:return 34===x.call(n,a+1)&&34===x.call(n,a+2)?d(r,a,s,p,t):f(r,a,s,p,t)}throw(0,g.syntaxError)(r,a,u(m))}function u(e){return e<32&&9!==e&&10!==e&&13!==e?"Cannot contain the invalid character ".concat(a(e),"."):39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":"Cannot parse the unexpected character ".concat(a(e),".")}function c(e,t,r){for(var n=e.length,i=t;i<n;){var o=x.call(e,i);if(9===o||32===o||44===o||65279===o)++i;else if(10===o)++i,++r.line,r.lineStart=i;else{if(13!==o)break;10===x.call(e,i+1)?i+=2:++i,++r.line,r.lineStart=i}}return i}function l(e,t,r,n,i){var a,s=e.body,u=t;do{a=x.call(s,++u)}while(null!==a&&(a>31||9===a));return new o(_.COMMENT,t,u,r,n,i,w.call(s,t+1,u))}function h(e,t,r,n,i,s){var u=e.body,c=r,l=t,h=!1;if(45===c&&(c=x.call(u,++l)),48===c){if((c=x.call(u,++l))>=48&&c<=57)throw(0,g.syntaxError)(e,l,"Invalid number, unexpected digit after 0: ".concat(a(c),"."))}else l=p(e,l,c),c=x.call(u,l);return 46===c&&(h=!0,c=x.call(u,++l),l=p(e,l,c),c=x.call(u,l)),69!==c&&101!==c||(h=!0,43!==(c=x.call(u,++l))&&45!==c||(c=x.call(u,++l)),l=p(e,l,c)),new o(h?_.FLOAT:_.INT,t,l,n,i,s,w.call(u,t,l))}function p(e,t,r){var n=e.body,i=t,o=r;if(o>=48&&o<=57){do{o=x.call(n,++i)}while(o>=48&&o<=57);return i}throw(0,g.syntaxError)(e,i,"Invalid number, expected digit but got: ".concat(a(o),"."))}function f(e,t,r,n,i){for(var s=e.body,u=t+1,c=u,l=0,h="";u<s.length&&null!==(l=x.call(s,u))&&10!==l&&13!==l;){if(34===l)return h+=w.call(s,c,u),new o(_.STRING,t,u+1,r,n,i,h);if(l<32&&9!==l)throw(0,g.syntaxError)(e,u,"Invalid character within String: ".concat(a(l),"."));if(++u,92===l){switch(h+=w.call(s,c,u-1),l=x.call(s,u)){case 34:h+='"';break;case 47:h+="/";break;case 92:h+="\\";break;case 98:h+="\b";break;case 102:h+="\f";break;case 110:h+="\n";break;case 114:h+="\r";break;case 116:h+="\t";break;case 117:var p=m(x.call(s,u+1),x.call(s,u+2),x.call(s,u+3),x.call(s,u+4));if(p<0)throw(0,g.syntaxError)(e,u,"Invalid character escape sequence: "+"\\u".concat(s.slice(u+1,u+5),"."));h+=String.fromCharCode(p),u+=4;break;default:throw(0,g.syntaxError)(e,u,"Invalid character escape sequence: \\".concat(String.fromCharCode(l),"."))}c=++u}}throw(0,g.syntaxError)(e,u,"Unterminated string.")}function d(e,t,r,n,i){for(var s=e.body,u=t+3,c=u,l=0,h="";u<s.length&&null!==(l=x.call(s,u));){if(34===l&&34===x.call(s,u+1)&&34===x.call(s,u+2))return h+=w.call(s,c,u),new o(_.BLOCK_STRING,t,u+3,r,n,i,(0,b.default)(h));if(l<32&&9!==l&&10!==l&&13!==l)throw(0,g.syntaxError)(e,u,"Invalid character within String: ".concat(a(l),"."));92===l&&34===x.call(s,u+1)&&34===x.call(s,u+2)&&34===x.call(s,u+3)?(h+=w.call(s,c,u)+'"""',c=u+=4):++u}throw(0,g.syntaxError)(e,u,"Unterminated string.")}function m(e,t,r,n){return v(e)<<12|v(t)<<8|v(r)<<4|v(n)}function v(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function y(e,t,r,n,i){for(var a=e.body,s=a.length,u=t+1,c=0;u!==s&&null!==(c=x.call(a,u))&&(95===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122);)++u;return new o(_.NAME,t,u,r,n,i,w.call(a,t,u))}Object.defineProperty(r,"__esModule",{value:!0}),r.createLexer=function(e,t){var r=new o(_.SOF,0,0,0,0,null);return{source:e,options:t,lastToken:r,token:r,line:1,lineStart:0,advance:n,lookahead:i}},r.getTokenDesc=function(e){var t=e.value;return t?"".concat(e.kind,' "').concat(t,'"'):e.kind},r.TokenKind=void 0;var g=e("../error"),b=function(e){return e&&e.__esModule?e:{default:e}}(e("./blockStringValue")),_=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});r.TokenKind=_;var x=String.prototype.charCodeAt,w=String.prototype.slice;o.prototype.toJSON=o.prototype.inspect=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},{"../error":34,"./blockStringValue":63}],68:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getLocation=function(e,t){for(var r,n=/\r\n|[\n\r]/g,i=1,o=t+1;(r=n.exec(e.body))&&r.index<t;)i+=1,o=t+1-(r.index+r[0].length);return{line:i,column:o}}},{}],69:[function(e,t,r){"use strict";function n(e){var t=fe(e,xe.TokenKind.NAME);return{kind:we.Kind.NAME,value:t.value,loc:ce(e,t)}}function i(e){var t=e.token;return{kind:we.Kind.DOCUMENT,definitions:ye(e,xe.TokenKind.SOF,o,xe.TokenKind.EOF),loc:ce(e,t)}}function o(e){if(he(e,xe.TokenKind.NAME))switch(e.token.value){case"query":case"mutation":case"subscription":case"fragment":return a(e);case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return N(e);case"extend":return Z(e)}else{if(he(e,xe.TokenKind.BRACE_L))return a(e);if(L(e))return N(e)}throw me(e)}function a(e){if(he(e,xe.TokenKind.NAME))switch(e.token.value){case"query":case"mutation":case"subscription":return s(e);case"fragment":return b(e)}else if(he(e,xe.TokenKind.BRACE_L))return s(e);throw me(e)}function s(e){var t=e.token;if(he(e,xe.TokenKind.BRACE_L))return{kind:we.Kind.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:p(e),loc:ce(e,t)};var r,i=u(e);return he(e,xe.TokenKind.NAME)&&(r=n(e)),{kind:we.Kind.OPERATION_DEFINITION,operation:i,name:r,variableDefinitions:c(e),directives:C(e,!1),selectionSet:p(e),loc:ce(e,t)}}function u(e){var t=fe(e,xe.TokenKind.NAME);switch(t.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw me(e,t)}function c(e){return he(e,xe.TokenKind.PAREN_L)?ye(e,xe.TokenKind.PAREN_L,l,xe.TokenKind.PAREN_R):[]}function l(e){var t=e.token;return e.options.experimentalVariableDefinitionDirectives?{kind:we.Kind.VARIABLE_DEFINITION,variable:h(e),type:(fe(e,xe.TokenKind.COLON),P(e)),defaultValue:pe(e,xe.TokenKind.EQUALS)?x(e,!0):void 0,directives:C(e,!0),loc:ce(e,t)}:{kind:we.Kind.VARIABLE_DEFINITION,variable:h(e),type:(fe(e,xe.TokenKind.COLON),P(e)),defaultValue:pe(e,xe.TokenKind.EQUALS)?x(e,!0):void 0,loc:ce(e,t)}}function h(e){var t=e.token;return fe(e,xe.TokenKind.DOLLAR),{kind:we.Kind.VARIABLE,name:n(e),loc:ce(e,t)}}function p(e){var t=e.token;return{kind:we.Kind.SELECTION_SET,selections:ye(e,xe.TokenKind.BRACE_L,f,xe.TokenKind.BRACE_R),loc:ce(e,t)}}function f(e){return he(e,xe.TokenKind.SPREAD)?g(e):d(e)}function d(e){var t,r,i=e.token,o=n(e);return pe(e,xe.TokenKind.COLON)?(t=o,r=n(e)):r=o,{kind:we.Kind.FIELD,alias:t,name:r,arguments:m(e,!1),directives:C(e,!1),selectionSet:he(e,xe.TokenKind.BRACE_L)?p(e):void 0,loc:ce(e,i)}}function m(e,t){var r=t?y:v;return he(e,xe.TokenKind.PAREN_L)?ye(e,xe.TokenKind.PAREN_L,r,xe.TokenKind.PAREN_R):[]}function v(e){var t=e.token;return{kind:we.Kind.ARGUMENT,name:n(e),value:(fe(e,xe.TokenKind.COLON),x(e,!1)),loc:ce(e,t)}}function y(e){var t=e.token;return{kind:we.Kind.ARGUMENT,name:n(e),value:(fe(e,xe.TokenKind.COLON),S(e)),loc:ce(e,t)}}function g(e){var t=e.token;if(fe(e,xe.TokenKind.SPREAD),he(e,xe.TokenKind.NAME)&&"on"!==e.token.value)return{kind:we.Kind.FRAGMENT_SPREAD,name:_(e),directives:C(e,!1),loc:ce(e,t)};var r;return"on"===e.token.value&&(e.advance(),r=A(e)),{kind:we.Kind.INLINE_FRAGMENT,typeCondition:r,directives:C(e,!1),selectionSet:p(e),loc:ce(e,t)}}function b(e){var t=e.token;return de(e,"fragment"),e.options.experimentalFragmentVariables?{kind:we.Kind.FRAGMENT_DEFINITION,name:_(e),variableDefinitions:c(e),typeCondition:(de(e,"on"),A(e)),directives:C(e,!1),selectionSet:p(e),loc:ce(e,t)}:{kind:we.Kind.FRAGMENT_DEFINITION,name:_(e),typeCondition:(de(e,"on"),A(e)),directives:C(e,!1),selectionSet:p(e),loc:ce(e,t)}}function _(e){if("on"===e.token.value)throw me(e);return n(e)}function x(e,t){var r=e.token;switch(r.kind){case xe.TokenKind.BRACKET_L:return E(e,t);case xe.TokenKind.BRACE_L:return O(e,t);case xe.TokenKind.INT:return e.advance(),{kind:we.Kind.INT,value:r.value,loc:ce(e,r)};case xe.TokenKind.FLOAT:return e.advance(),{kind:we.Kind.FLOAT,value:r.value,loc:ce(e,r)};case xe.TokenKind.STRING:case xe.TokenKind.BLOCK_STRING:return w(e);case xe.TokenKind.NAME:return"true"===r.value||"false"===r.value?(e.advance(),{kind:we.Kind.BOOLEAN,value:"true"===r.value,loc:ce(e,r)}):"null"===r.value?(e.advance(),{kind:we.Kind.NULL,loc:ce(e,r)}):(e.advance(),{kind:we.Kind.ENUM,value:r.value,loc:ce(e,r)});case xe.TokenKind.DOLLAR:if(!t)return h(e)}throw me(e)}function w(e){var t=e.token;return e.advance(),{kind:we.Kind.STRING,value:t.value,block:t.kind===xe.TokenKind.BLOCK_STRING,loc:ce(e,t)}}function S(e){return x(e,!0)}function T(e){return x(e,!1)}function E(e,t){var r=e.token,n=t?S:T;return{kind:we.Kind.LIST,values:ve(e,xe.TokenKind.BRACKET_L,n,xe.TokenKind.BRACKET_R),loc:ce(e,r)}}function O(e,t){var r=e.token;fe(e,xe.TokenKind.BRACE_L);for(var n=[];!pe(e,xe.TokenKind.BRACE_R);)n.push(M(e,t));return{kind:we.Kind.OBJECT,fields:n,loc:ce(e,r)}}function M(e,t){var r=e.token;return{kind:we.Kind.OBJECT_FIELD,name:n(e),value:(fe(e,xe.TokenKind.COLON),x(e,t)),loc:ce(e,r)}}function C(e,t){for(var r=[];he(e,xe.TokenKind.AT);)r.push(j(e,t));return r}function j(e,t){var r=e.token;return fe(e,xe.TokenKind.AT),{kind:we.Kind.DIRECTIVE,name:n(e),arguments:m(e,t),loc:ce(e,r)}}function P(e){var t,r=e.token;return pe(e,xe.TokenKind.BRACKET_L)?(t=P(e),fe(e,xe.TokenKind.BRACKET_R),t={kind:we.Kind.LIST_TYPE,type:t,loc:ce(e,r)}):t=A(e),pe(e,xe.TokenKind.BANG)?{kind:we.Kind.NON_NULL_TYPE,type:t,loc:ce(e,r)}:t}function A(e){var t=e.token;return{kind:we.Kind.NAMED_TYPE,name:n(e),loc:ce(e,t)}}function N(e){var t=L(e)?e.lookahead():e.token;if(t.kind===xe.TokenKind.NAME)switch(t.value){case"schema":return R(e);case"scalar":return D(e);case"type":return F(e);case"interface":return q(e);case"union":return $(e);case"enum":return W(e);case"input":return X(e);case"directive":return ae(e)}throw me(e,t)}function L(e){return he(e,xe.TokenKind.STRING)||he(e,xe.TokenKind.BLOCK_STRING)}function I(e){if(L(e))return w(e)}function R(e){var t=e.token;de(e,"schema");var r=C(e,!0),n=ye(e,xe.TokenKind.BRACE_L,k,xe.TokenKind.BRACE_R);return{kind:we.Kind.SCHEMA_DEFINITION,directives:r,operationTypes:n,loc:ce(e,t)}}function k(e){var t=e.token,r=u(e);fe(e,xe.TokenKind.COLON);var n=A(e);return{kind:we.Kind.OPERATION_TYPE_DEFINITION,operation:r,type:n,loc:ce(e,t)}}function D(e){var t=e.token,r=I(e);de(e,"scalar");var i=n(e),o=C(e,!0);return{kind:we.Kind.SCALAR_TYPE_DEFINITION,description:r,name:i,directives:o,loc:ce(e,t)}}function F(e){var t=e.token,r=I(e);de(e,"type");var i=n(e),o=V(e),a=C(e,!0),s=B(e);return{kind:we.Kind.OBJECT_TYPE_DEFINITION,description:r,name:i,interfaces:o,directives:a,fields:s,loc:ce(e,t)}}function V(e){var t=[];if("implements"===e.token.value){e.advance(),pe(e,xe.TokenKind.AMP);do{t.push(A(e))}while(pe(e,xe.TokenKind.AMP)||e.options.allowLegacySDLImplementsInterfaces&&he(e,xe.TokenKind.NAME))}return t}function B(e){return e.options.allowLegacySDLEmptyFields&&he(e,xe.TokenKind.BRACE_L)&&e.lookahead().kind===xe.TokenKind.BRACE_R?(e.advance(),e.advance(),[]):he(e,xe.TokenKind.BRACE_L)?ye(e,xe.TokenKind.BRACE_L,U,xe.TokenKind.BRACE_R):[]}function U(e){var t=e.token,r=I(e),i=n(e),o=G(e);fe(e,xe.TokenKind.COLON);var a=P(e),s=C(e,!0);return{kind:we.Kind.FIELD_DEFINITION,description:r,name:i,arguments:o,type:a,directives:s,loc:ce(e,t)}}function G(e){return he(e,xe.TokenKind.PAREN_L)?ye(e,xe.TokenKind.PAREN_L,z,xe.TokenKind.PAREN_R):[]}function z(e){var t=e.token,r=I(e),i=n(e);fe(e,xe.TokenKind.COLON);var o,a=P(e);pe(e,xe.TokenKind.EQUALS)&&(o=S(e));var s=C(e,!0);return{kind:we.Kind.INPUT_VALUE_DEFINITION,description:r,name:i,type:a,defaultValue:o,directives:s,loc:ce(e,t)}}function q(e){var t=e.token,r=I(e);de(e,"interface");var i=n(e),o=C(e,!0),a=B(e);return{kind:we.Kind.INTERFACE_TYPE_DEFINITION,description:r,name:i,directives:o,fields:a,loc:ce(e,t)}}function $(e){var t=e.token,r=I(e);de(e,"union");var i=n(e),o=C(e,!0),a=H(e);return{kind:we.Kind.UNION_TYPE_DEFINITION,description:r,name:i,directives:o,types:a,loc:ce(e,t)}}function H(e){var t=[];if(pe(e,xe.TokenKind.EQUALS)){pe(e,xe.TokenKind.PIPE);do{t.push(A(e))}while(pe(e,xe.TokenKind.PIPE))}return t}function W(e){var t=e.token,r=I(e);de(e,"enum");var i=n(e),o=C(e,!0),a=Q(e);return{kind:we.Kind.ENUM_TYPE_DEFINITION,description:r,name:i,directives:o,values:a,loc:ce(e,t)}}function Q(e){return he(e,xe.TokenKind.BRACE_L)?ye(e,xe.TokenKind.BRACE_L,K,xe.TokenKind.BRACE_R):[]}function K(e){var t=e.token,r=I(e),i=n(e),o=C(e,!0);return{kind:we.Kind.ENUM_VALUE_DEFINITION,description:r,name:i,directives:o,loc:ce(e,t)}}function X(e){var t=e.token,r=I(e);de(e,"input");var i=n(e),o=C(e,!0),a=Y(e);return{kind:we.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:r,name:i,directives:o,fields:a,loc:ce(e,t)}}function Y(e){return he(e,xe.TokenKind.BRACE_L)?ye(e,xe.TokenKind.BRACE_L,z,xe.TokenKind.BRACE_R):[]}function Z(e){var t=e.lookahead();if(t.kind===xe.TokenKind.NAME)switch(t.value){case"schema":return J(e);case"scalar":return ee(e);case"type":return te(e);case"interface":return re(e);case"union":return ne(e);case"enum":return ie(e);case"input":return oe(e)}throw me(e,t)}function J(e){var t=e.token;de(e,"extend"),de(e,"schema");var r=C(e,!0),n=he(e,xe.TokenKind.BRACE_L)?ye(e,xe.TokenKind.BRACE_L,k,xe.TokenKind.BRACE_R):[];if(0===r.length&&0===n.length)throw me(e);return{kind:we.Kind.SCHEMA_EXTENSION,directives:r,operationTypes:n,loc:ce(e,t)}}function ee(e){var t=e.token;de(e,"extend"),de(e,"scalar");var r=n(e),i=C(e,!0);if(0===i.length)throw me(e);return{kind:we.Kind.SCALAR_TYPE_EXTENSION,name:r,directives:i,loc:ce(e,t)}}function te(e){var t=e.token;de(e,"extend"),de(e,"type");var r=n(e),i=V(e),o=C(e,!0),a=B(e);if(0===i.length&&0===o.length&&0===a.length)throw me(e);return{kind:we.Kind.OBJECT_TYPE_EXTENSION,name:r,interfaces:i,directives:o,fields:a,loc:ce(e,t)}}function re(e){var t=e.token;de(e,"extend"),de(e,"interface");var r=n(e),i=C(e,!0),o=B(e);if(0===i.length&&0===o.length)throw me(e);return{kind:we.Kind.INTERFACE_TYPE_EXTENSION,name:r,directives:i,fields:o,loc:ce(e,t)}}function ne(e){var t=e.token;de(e,"extend"),de(e,"union");var r=n(e),i=C(e,!0),o=H(e);if(0===i.length&&0===o.length)throw me(e);return{kind:we.Kind.UNION_TYPE_EXTENSION,name:r,directives:i,types:o,loc:ce(e,t)}}function ie(e){var t=e.token;de(e,"extend"),de(e,"enum");var r=n(e),i=C(e,!0),o=Q(e);if(0===i.length&&0===o.length)throw me(e);return{kind:we.Kind.ENUM_TYPE_EXTENSION,name:r,directives:i,values:o,loc:ce(e,t)}}function oe(e){var t=e.token;de(e,"extend"),de(e,"input");var r=n(e),i=C(e,!0),o=Y(e);if(0===i.length&&0===o.length)throw me(e);return{kind:we.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:r,directives:i,fields:o,loc:ce(e,t)}}function ae(e){var t=e.token,r=I(e);de(e,"directive"),fe(e,xe.TokenKind.AT);var i=n(e),o=G(e);de(e,"on");var a=se(e);return{kind:we.Kind.DIRECTIVE_DEFINITION,description:r,name:i,arguments:o,locations:a,loc:ce(e,t)}}function se(e){pe(e,xe.TokenKind.PIPE);var t=[];do{t.push(ue(e))}while(pe(e,xe.TokenKind.PIPE));return t}function ue(e){var t=e.token,r=n(e);if(Se.DirectiveLocation.hasOwnProperty(r.value))return r;throw me(e,t)}function ce(e,t){if(!e.options.noLocation)return new le(t,e.lastToken,e.source)}function le(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}function he(e,t){return e.token.kind===t}function pe(e,t){var r=e.token.kind===t;return r&&e.advance(),r}function fe(e,t){var r=e.token;if(r.kind===t)return e.advance(),r;throw(0,_e.syntaxError)(e.source,r.start,"Expected ".concat(t,", found ").concat((0,xe.getTokenDesc)(r)))}function de(e,t){var r=e.token;if(r.kind===xe.TokenKind.NAME&&r.value===t)return e.advance(),r;throw(0,_e.syntaxError)(e.source,r.start,'Expected "'.concat(t,'", found ').concat((0,xe.getTokenDesc)(r)))}function me(e,t){var r=t||e.token;return(0,_e.syntaxError)(e.source,r.start,"Unexpected ".concat((0,xe.getTokenDesc)(r)))}function ve(e,t,r,n){fe(e,t);for(var i=[];!pe(e,n);)i.push(r(e));return i}function ye(e,t,r,n){fe(e,t);for(var i=[r(e)];!pe(e,n);)i.push(r(e));return i}Object.defineProperty(r,"__esModule",{value:!0}),r.parse=function(e,t){var r="string"==typeof e?new be.Source(e):e;if(!(r instanceof be.Source))throw new TypeError("Must provide Source. Received: ".concat((0,ge.default)(r)));return i((0,xe.createLexer)(r,t||{}))},r.parseValue=function(e,t){var r="string"==typeof e?new be.Source(e):e,n=(0,xe.createLexer)(r,t||{});fe(n,xe.TokenKind.SOF);var i=x(n,!1);return fe(n,xe.TokenKind.EOF),i},r.parseType=function(e,t){var r="string"==typeof e?new be.Source(e):e,n=(0,xe.createLexer)(r,t||{});fe(n,xe.TokenKind.SOF);var i=P(n);return fe(n,xe.TokenKind.EOF),i},r.parseConstValue=S,r.parseTypeReference=P,r.parseNamedType=A;var ge=function(e){return e&&e.__esModule?e:{default:e}}(e("../jsutils/inspect")),be=e("./source"),_e=e("../error"),xe=e("./lexer"),we=e("./kinds"),Se=e("./directiveLocation");le.prototype.toJSON=le.prototype.inspect=function(){return{start:this.start,end:this.end}}},{"../error":34,"../jsutils/inspect":46,"./directiveLocation":64,"./kinds":66,"./lexer":67,"./source":72}],70:[function(e,t,r){"use strict";function n(e){return e.kind===u.Kind.OPERATION_DEFINITION||e.kind===u.Kind.FRAGMENT_DEFINITION}function i(e){return e.kind===u.Kind.SCHEMA_DEFINITION||o(e)||e.kind===u.Kind.DIRECTIVE_DEFINITION}function o(e){return e.kind===u.Kind.SCALAR_TYPE_DEFINITION||e.kind===u.Kind.OBJECT_TYPE_DEFINITION||e.kind===u.Kind.INTERFACE_TYPE_DEFINITION||e.kind===u.Kind.UNION_TYPE_DEFINITION||e.kind===u.Kind.ENUM_TYPE_DEFINITION||e.kind===u.Kind.INPUT_OBJECT_TYPE_DEFINITION}function a(e){return e.kind===u.Kind.SCHEMA_EXTENSION||s(e)}function s(e){return e.kind===u.Kind.SCALAR_TYPE_EXTENSION||e.kind===u.Kind.OBJECT_TYPE_EXTENSION||e.kind===u.Kind.INTERFACE_TYPE_EXTENSION||e.kind===u.Kind.UNION_TYPE_EXTENSION||e.kind===u.Kind.ENUM_TYPE_EXTENSION||e.kind===u.Kind.INPUT_OBJECT_TYPE_EXTENSION}Object.defineProperty(r,"__esModule",{value:!0}),r.isDefinitionNode=function(e){return n(e)||i(e)||a(e)},r.isExecutableDefinitionNode=n,r.isSelectionNode=function(e){return e.kind===u.Kind.FIELD||e.kind===u.Kind.FRAGMENT_SPREAD||e.kind===u.Kind.INLINE_FRAGMENT},r.isValueNode=function(e){return e.kind===u.Kind.VARIABLE||e.kind===u.Kind.INT||e.kind===u.Kind.FLOAT||e.kind===u.Kind.STRING||e.kind===u.Kind.BOOLEAN||e.kind===u.Kind.NULL||e.kind===u.Kind.ENUM||e.kind===u.Kind.LIST||e.kind===u.Kind.OBJECT},r.isTypeNode=function(e){return e.kind===u.Kind.NAMED_TYPE||e.kind===u.Kind.LIST_TYPE||e.kind===u.Kind.NON_NULL_TYPE},r.isTypeSystemDefinitionNode=i,r.isTypeDefinitionNode=o,r.isTypeSystemExtensionNode=a,r.isTypeExtensionNode=s;var u=e("./kinds")},{"./kinds":66}],71:[function(e,t,r){"use strict";function n(e){return function(t){return i([t.description,e(t)],"\n")}}function i(e,t){return e?e.filter(function(e){return e}).join(t||""):""}function o(e){return e&&0!==e.length?"{\n"+s(i(e,"\n"))+"\n}":""}function a(e,t,r){return t?e+t+(r||""):""}function s(e){return e&&" "+e.replace(/\n/g,"\n ")}function u(e,t){var r=e.replace(/"""/g,'\\"""');return" "!==e[0]&&"\t"!==e[0]||-1!==e.indexOf("\n")?'"""\n'.concat(t?r:s(r),'\n"""'):'"""'.concat(r.replace(/"$/,'"\n'),'"""')}Object.defineProperty(r,"__esModule",{value:!0}),r.print=function(e){return(0,c.visit)(e,{leave:l})};var c=e("./visitor"),l={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return i(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=a("(",i(e.variableDefinitions,", "),")"),o=i(e.directives," "),s=e.selectionSet;return r||o||n||"query"!==t?i([t,i([r,n]),o,s]," "):s},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,o=e.directives;return t+": "+r+a(" = ",n)+a(" ",i(o," "))},SelectionSet:function(e){return o(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,o=e.directives,s=e.selectionSet;return i([a("",t,": ")+r+a("(",i(n,", "),")"),i(o," "),s]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+a(" ",i(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return i(["...",a("on ",t),i(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,o=e.directives,s=e.selectionSet;return"fragment ".concat(t).concat(a("(",i(n,", "),")")," ")+"on ".concat(r," ").concat(a("",i(o," ")," "))+s},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?u(r,"description"===t):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+i(e.values,", ")+"]"},ObjectValue:function(e){return"{"+i(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+a("(",i(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:function(e){var t=e.directives,r=e.operationTypes;return i(["schema",i(t," "),o(r)]," ")},OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:n(function(e){return i(["scalar",e.name,i(e.directives," ")]," ")}),ObjectTypeDefinition:n(function(e){var t=e.name,r=e.interfaces,n=e.directives,s=e.fields;return i(["type",t,a("implements ",i(r," & ")),i(n," "),o(s)]," ")}),FieldDefinition:n(function(e){var t=e.name,r=e.arguments,n=e.type,o=e.directives;return t+(r.every(function(e){return-1===e.indexOf("\n")})?a("(",i(r,", "),")"):a("(\n",s(i(r,"\n")),"\n)"))+": "+n+a(" ",i(o," "))}),InputValueDefinition:n(function(e){var t=e.name,r=e.type,n=e.defaultValue,o=e.directives;return i([t+": "+r,a("= ",n),i(o," ")]," ")}),InterfaceTypeDefinition:n(function(e){var t=e.name,r=e.directives,n=e.fields;return i(["interface",t,i(r," "),o(n)]," ")}),UnionTypeDefinition:n(function(e){var t=e.name,r=e.directives,n=e.types;return i(["union",t,i(r," "),n&&0!==n.length?"= "+i(n," | "):""]," ")}),EnumTypeDefinition:n(function(e){var t=e.name,r=e.directives,n=e.values;return i(["enum",t,i(r," "),o(n)]," ")}),EnumValueDefinition:n(function(e){return i([e.name,i(e.directives," ")]," ")}),InputObjectTypeDefinition:n(function(e){var t=e.name,r=e.directives,n=e.fields;return i(["input",t,i(r," "),o(n)]," ")}),DirectiveDefinition:n(function(e){var t=e.name,r=e.arguments,n=e.locations;return"directive @"+t+(r.every(function(e){return-1===e.indexOf("\n")})?a("(",i(r,", "),")"):a("(\n",s(i(r,"\n")),"\n)"))+" on "+i(n," | ")}),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return i(["extend schema",i(t," "),o(r)]," ")},ScalarTypeExtension:function(e){return i(["extend scalar",e.name,i(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,s=e.fields;return i(["extend type",t,a("implements ",i(r," & ")),i(n," "),o(s)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return i(["extend interface",t,i(r," "),o(n)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return i(["extend union",t,i(r," "),n&&0!==n.length?"= "+i(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return i(["extend enum",t,i(r," "),o(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return i(["extend input",t,i(r," "),o(n)]," ")}}},{"./visitor":73}],72:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(r,"__esModule",{value:!0}),r.Source=void 0;var o=n(e("../jsutils/invariant")),a=n(e("../jsutils/defineToStringTag")),s=function(e,t,r){i(this,"body",void 0),i(this,"name",void 0),i(this,"locationOffset",void 0),this.body=e,this.name=t||"GraphQL request",this.locationOffset=r||{line:1,column:1},this.locationOffset.line>0||(0,o.default)(0,"line in locationOffset is 1-indexed and must be positive"),this.locationOffset.column>0||(0,o.default)(0,"column in locationOffset is 1-indexed and must be positive")};r.Source=s,(0,a.default)(s)},{"../jsutils/defineToStringTag":44,"../jsutils/invariant":48}],73:[function(e,t,r){"use strict";function n(e){return Boolean(e&&"string"==typeof e.kind)}function i(e,t,r){var n=e[t];if(n){if(!r&&"function"==typeof n)return n;var i=r?n.leave:n.enter;if("function"==typeof i)return i}else{var o=r?e.leave:e.enter;if(o){if("function"==typeof o)return o;var a=o[t];if("function"==typeof a)return a}}}Object.defineProperty(r,"__esModule",{value:!0}),r.visit=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,u=void 0,c=Array.isArray(e),l=[e],h=-1,p=[],f=void 0,d=void 0,m=void 0,v=[],y=[],g=e;do{var b=++h===l.length,_=b&&0!==p.length;if(b){if(d=0===y.length?void 0:v[v.length-1],f=m,m=y.pop(),_){if(c)f=f.slice();else{var x={};for(var w in f)f.hasOwnProperty(w)&&(x[w]=f[w]);f=x}for(var S=0,T=0;T<p.length;T++){var E=p[T][0],O=p[T][1];c&&(E-=S),c&&null===O?(f.splice(E,1),S++):f[E]=O}}h=u.index,l=u.keys,p=u.edits,c=u.inArray,u=u.prev}else{if(d=m?c?h:l[h]:void 0,null===(f=m?m[d]:g)||void 0===f)continue;m&&v.push(d)}var M=void 0;if(!Array.isArray(f)){if(!n(f))throw new Error("Invalid AST Node: "+(0,o.default)(f));var C=i(t,f.kind,b);if(C){if((M=C.call(t,f,d,m,v,y))===s)break;if(!1===M){if(!b){v.pop();continue}}else if(void 0!==M&&(p.push([d,M]),!b)){if(!n(M)){v.pop();continue}f=M}}}void 0===M&&_&&p.push([d,f]),b?v.pop():(u={inArray:c,index:h,keys:l,edits:p,prev:u},l=(c=Array.isArray(f))?f:r[f.kind]||[],h=-1,p=[],m&&y.push(m),m=f)}while(void 0!==u);return 0!==p.length&&(g=p[p.length-1][1]),g},r.visitInParallel=function(e){var t=new Array(e.length);return{enter:function(r){for(var n=0;n<e.length;n++)if(!t[n]){var o=i(e[n],r.kind,!1);if(o){var a=o.apply(e[n],arguments);if(!1===a)t[n]=r;else if(a===s)t[n]=s;else if(void 0!==a)return a}}},leave:function(r){for(var n=0;n<e.length;n++)if(t[n])t[n]===r&&(t[n]=null);else{var o=i(e[n],r.kind,!0);if(o){var a=o.apply(e[n],arguments);if(a===s)t[n]=s;else if(void 0!==a&&!1!==a)return a}}}}},r.visitWithTypeInfo=function(e,t){return{enter:function(r){e.enter(r);var o=i(t,r.kind,!1);if(o){var a=o.apply(t,arguments);return void 0!==a&&(e.leave(r),n(a)&&e.enter(a)),a}},leave:function(r){var n,o=i(t,r.kind,!0);return o&&(n=o.apply(t,arguments)),e.leave(r),n}}},r.getVisitFn=i,r.BREAK=r.QueryDocumentKeys=void 0;var o=function(e){return e&&e.__esModule?e:{default:e}}(e("../jsutils/inspect")),a={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};r.QueryDocumentKeys=a;var s={};r.BREAK=s},{"../jsutils/inspect":46}],74:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"subscribe",{enumerable:!0,get:function(){return n.subscribe}}),Object.defineProperty(r,"createSourceEventStream",{enumerable:!0,get:function(){return n.createSourceEventStream}});var n=e("./subscribe")},{"./subscribe":76}],75:[function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){return new Promise(function(r){return r(t(e))})}function o(e){return{value:e,done:!1}}Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t,r){function s(e){return e.done?e:i(e.value,t).then(o,c)}var u,c,l=(0,a.getAsyncIterator)(e);"function"==typeof l.return&&(u=l.return,c=function(e){var t=function(){return Promise.reject(e)};return u.call(l).then(t,t)});var h;if(r){var p=r;h=function(e){return i(e,p).then(o,c)}}return n({next:function(){return l.next().then(s,h)},return:function(){return u?u.call(l).then(s,h):Promise.resolve({value:void 0,done:!0})},throw:function(e){return"function"==typeof l.throw?l.throw(e).then(s,h):Promise.reject(e).catch(c)}},a.$$asyncIterator,function(){return this})};var a=e("iterall")},{iterall:144}],76:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){if(e instanceof c.GraphQLError)return{errors:[e]};throw e}function o(e,t,r,n,o,u,c,l){var f=function(r){return(0,h.execute)(e,t,r,n,o,u,c)};return a(e,t,r,n,o,u,l).then(function(e){return(0,s.isAsyncIterable)(e)?(0,p.default)(e,f,i):e},i)}function a(e,t,r,n,i,o,a){(0,h.assertValidExecutionArguments)(e,t,i);try{var p=(0,h.buildExecutionContext)(e,t,r,n,i,o,a);if(Array.isArray(p))return Promise.resolve({errors:p});var d=(0,f.getOperationRootType)(e,p.operation),m=(0,h.collectFields)(p,d,p.operation.selectionSet,Object.create(null),Object.create(null)),v=Object.keys(m)[0],y=m[v],g=y[0].name.value,b=(0,h.getFieldDef)(e,d,g);if(!b)throw new c.GraphQLError('The subscription field "'.concat(g,'" is not defined.'),y);var _=b.subscribe||p.fieldResolver,x=(0,h.addPath)(void 0,v),w=(0,h.buildResolveInfo)(p,b,y,d,x),S=(0,h.resolveFieldValueOrError)(p,b,y,_,r,w);return Promise.resolve(S).then(function(e){if(e instanceof Error)throw(0,l.locatedError)(e,y,(0,h.responsePathAsArray)(x));if((0,s.isAsyncIterable)(e))return e;throw new Error("Subscription field must return Async Iterable. Received: "+(0,u.default)(e))})}catch(e){return Promise.reject(e)}}Object.defineProperty(r,"__esModule",{value:!0}),r.subscribe=function(e,t,r,n,i,a,s,u){return 1===arguments.length?o(e.schema,e.document,e.rootValue,e.contextValue,e.variableValues,e.operationName,e.fieldResolver,e.subscribeFieldResolver):o(e,t,r,n,i,a,s,u)},r.createSourceEventStream=a;var s=e("iterall"),u=n(e("../jsutils/inspect")),c=e("../error/GraphQLError"),l=e("../error/locatedError"),h=e("../execution/execute"),p=n(e("./mapAsyncIterator")),f=e("../utilities/getOperationRootType")},{"../error/GraphQLError":32,"../error/locatedError":35,"../execution/execute":38,"../jsutils/inspect":46,"../utilities/getOperationRootType":95,"./mapAsyncIterator":75,iterall:144}],77:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){a(e,t,r[t])})}return e}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e){return c(e)||l(e)||h(e)||p(e)||f(e)||d(e)||m(e)||v(e)}function u(e){return s(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL type.")),e}function c(e){return(0,D.default)(e,z)}function l(e){return(0,D.default)(e,q)}function h(e){return(0,D.default)(e,$)}function p(e){return(0,D.default)(e,H)}function f(e){return(0,D.default)(e,W)}function d(e){return(0,D.default)(e,Q)}function m(e){return(0,D.default)(e,w)}function v(e){return(0,D.default)(e,S)}function y(e){return c(e)||f(e)||d(e)||T(e)&&y(e.ofType)}function g(e){return c(e)||l(e)||h(e)||p(e)||f(e)||T(e)&&g(e.ofType)}function b(e){return c(e)||f(e)}function _(e){return l(e)||h(e)||p(e)}function x(e){return h(e)||p(e)}function w(e){if(!(this instanceof w))return new w(e);this.ofType=u(e)}function S(e){if(!(this instanceof S))return new S(e);this.ofType=O(e)}function T(e){return m(e)||v(e)}function E(e){return s(e)&&!v(e)}function O(e){return E(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL nullable type.")),e}function M(e){return c(e)||l(e)||h(e)||p(e)||f(e)||d(e)}function C(e){return"function"==typeof e?e():e}function j(e){var t=C(e.interfaces)||[];return Array.isArray(t)||(0,V.default)(0,"".concat(e.name," interfaces must be an Array or a function which returns ")+"an Array."),t}function P(e){var t=C(e.fields)||{};A(t)||(0,V.default)(0,"".concat(e.name," fields must be an object with field names as keys or a ")+"function which returns such an object.");for(var r=Object.create(null),n=Object.keys(t),i=0;i<n.length;i++)!function(){var a=n[i],s=t[a];A(s)||(0,V.default)(0,"".concat(e.name,".").concat(a," field config must be an object")),s.hasOwnProperty("isDeprecated")&&(0,V.default)(0,"".concat(e.name,".").concat(a,' should provide "deprecationReason" ')+'instead of "isDeprecated".');var u=o({},s,{isDeprecated:Boolean(s.deprecationReason),name:a});null!=u.resolve&&"function"!=typeof u.resolve&&(0,V.default)(0,"".concat(e.name,".").concat(a," field resolver must be a function if ")+"provided, but got: ".concat((0,F.default)(u.resolve),"."));var c=s.args;c?(A(c)||(0,V.default)(0,"".concat(e.name,".").concat(a," args must be an object with argument ")+"names as keys."),u.args=Object.keys(c).map(function(e){var t=c[e];return{name:e,description:void 0===t.description?null:t.description,type:t.type,defaultValue:t.defaultValue,astNode:t.astNode}})):u.args=[],r[a]=u}();return r}function A(e){return e&&"object"===i(e)&&!Array.isArray(e)}function N(e){var t=C(e.types)||[];return Array.isArray(t)||(0,V.default)(0,"Must provide Array of types or a function which returns "+"such an array for Union ".concat(e.name,".")),t}function L(e,t){return A(t)||(0,V.default)(0,"".concat(e.name," values must be an object with value names as keys.")),Object.keys(t).map(function(r){var n=t[r];return A(n)||(0,V.default)(0,"".concat(e.name,".").concat(r,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat((0,F.default)(n),".")),n.hasOwnProperty("isDeprecated")&&(0,V.default)(0,"".concat(e.name,".").concat(r,' should provide "deprecationReason" instead ')+'of "isDeprecated".'),{name:r,description:n.description,isDeprecated:Boolean(n.deprecationReason),deprecationReason:n.deprecationReason,astNode:n.astNode,value:n.hasOwnProperty("value")?n.value:r}})}function I(e){var t=C(e.fields)||{};A(t)||(0,V.default)(0,"".concat(e.name," fields must be an object with field names as keys or a ")+"function which returns such an object.");for(var r=Object.create(null),n=Object.keys(t),i=0;i<n.length;i++){var a=n[i],s=o({},t[a],{name:a});s.hasOwnProperty("resolve")&&(0,V.default)(0,"".concat(e.name,".").concat(a," field has a resolve property, but ")+"Input Types cannot define resolvers."),r[a]=s}return r}Object.defineProperty(r,"__esModule",{value:!0}),r.isType=s,r.assertType=u,r.isScalarType=c,r.assertScalarType=function(e){return c(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL Scalar type.")),e},r.isObjectType=l,r.assertObjectType=function(e){return l(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL Object type.")),e},r.isInterfaceType=h,r.assertInterfaceType=function(e){return h(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL Interface type.")),e},r.isUnionType=p,r.assertUnionType=function(e){return p(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL Union type.")),e},r.isEnumType=f,r.assertEnumType=function(e){return f(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL Enum type.")),e},r.isInputObjectType=d,r.assertInputObjectType=function(e){return d(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL Input Object type.")),e},r.isListType=m,r.assertListType=function(e){return m(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL List type.")),e},r.isNonNullType=v,r.assertNonNullType=function(e){return v(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL Non-Null type.")),e},r.isInputType=y,r.assertInputType=function(e){return y(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL input type.")),e},r.isOutputType=g,r.assertOutputType=function(e){return g(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL output type.")),e},r.isLeafType=b,r.assertLeafType=function(e){return b(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL leaf type.")),e},r.isCompositeType=_,r.assertCompositeType=function(e){return _(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL composite type.")),e},r.isAbstractType=x,r.assertAbstractType=function(e){return x(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL abstract type.")),e},r.GraphQLList=w,r.GraphQLNonNull=S,r.isWrappingType=T,r.assertWrappingType=function(e){return T(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL wrapping type.")),e},r.isNullableType=E,r.assertNullableType=O,r.getNullableType=function(e){if(e)return v(e)?e.ofType:e},r.isNamedType=M,r.assertNamedType=function(e){return M(e)||(0,V.default)(0,"Expected ".concat((0,F.default)(e)," to be a GraphQL named type.")),e},r.getNamedType=function(e){if(e){for(var t=e;T(t);)t=t.ofType;return t}},r.isRequiredArgument=function(e){return v(e.type)&&void 0===e.defaultValue},r.isRequiredInputField=function(e){return v(e.type)&&void 0===e.defaultValue},r.GraphQLInputObjectType=r.GraphQLEnumType=r.GraphQLUnionType=r.GraphQLInterfaceType=r.GraphQLObjectType=r.GraphQLScalarType=void 0;var R=n(e("../jsutils/defineToJSON")),k=n(e("../jsutils/defineToStringTag")),D=n(e("../jsutils/instanceOf")),F=n(e("../jsutils/inspect")),V=n(e("../jsutils/invariant")),B=n(e("../jsutils/keyMap")),U=e("../language/kinds"),G=e("../utilities/valueFromASTUntyped");w.prototype.toString=function(){return"["+String(this.ofType)+"]"},(0,R.default)(w),S.prototype.toString=function(){return String(this.ofType)+"!"},(0,R.default)(S);var z=function(){function e(e){a(this,"name",void 0),a(this,"description",void 0),a(this,"serialize",void 0),a(this,"parseValue",void 0),a(this,"parseLiteral",void 0),a(this,"astNode",void 0),a(this,"extensionASTNodes",void 0),this.name=e.name,this.description=e.description,this.serialize=e.serialize,this.parseValue=e.parseValue||function(e){return e},this.parseLiteral=e.parseLiteral||G.valueFromASTUntyped,this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes,"string"!=typeof e.name&&(0,V.default)(0,"Must provide name."),"function"!=typeof e.serialize&&(0,V.default)(0,"".concat(this.name,' must provide "serialize" function. If this custom Scalar ')+'is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.'),(e.parseValue||e.parseLiteral)&&("function"!=typeof e.parseValue||"function"!=typeof e.parseLiteral)&&(0,V.default)(0,"".concat(this.name,' must provide both "parseValue" and "parseLiteral" ')+"functions.")}return e.prototype.toString=function(){return this.name},e}();r.GraphQLScalarType=z,(0,k.default)(z),(0,R.default)(z);var q=function(){function e(e){a(this,"name",void 0),a(this,"description",void 0),a(this,"astNode",void 0),a(this,"extensionASTNodes",void 0),a(this,"isTypeOf",void 0),a(this,"_fields",void 0),a(this,"_interfaces",void 0),this.name=e.name,this.description=e.description,this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes,this.isTypeOf=e.isTypeOf,this._fields=P.bind(void 0,e),this._interfaces=j.bind(void 0,e),"string"!=typeof e.name&&(0,V.default)(0,"Must provide name."),null!=e.isTypeOf&&"function"!=typeof e.isTypeOf&&(0,V.default)(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat((0,F.default)(e.isTypeOf),"."))}var t=e.prototype;return t.getFields=function(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces},t.toString=function(){return this.name},e}();r.GraphQLObjectType=q,(0,k.default)(q),(0,R.default)(q);var $=function(){function e(e){a(this,"name",void 0),a(this,"description",void 0),a(this,"astNode",void 0),a(this,"extensionASTNodes",void 0),a(this,"resolveType",void 0),a(this,"_fields",void 0),this.name=e.name,this.description=e.description,this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes,this.resolveType=e.resolveType,this._fields=P.bind(void 0,e),"string"!=typeof e.name&&(0,V.default)(0,"Must provide name."),null!=e.resolveType&&"function"!=typeof e.resolveType&&(0,V.default)(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat((0,F.default)(e.resolveType),"."))}var t=e.prototype;return t.getFields=function(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields},t.toString=function(){return this.name},e}();r.GraphQLInterfaceType=$,(0,k.default)($),(0,R.default)($);var H=function(){function e(e){a(this,"name",void 0),a(this,"description",void 0),a(this,"astNode",void 0),a(this,"extensionASTNodes",void 0),a(this,"resolveType",void 0),a(this,"_types",void 0),this.name=e.name,this.description=e.description,this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes,this.resolveType=e.resolveType,this._types=N.bind(void 0,e),"string"!=typeof e.name&&(0,V.default)(0,"Must provide name."),null!=e.resolveType&&"function"!=typeof e.resolveType&&(0,V.default)(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat((0,F.default)(e.resolveType),"."))}var t=e.prototype;return t.getTypes=function(){return"function"==typeof this._types&&(this._types=this._types()),this._types},t.toString=function(){return this.name},e}();r.GraphQLUnionType=H,(0,k.default)(H),(0,R.default)(H);var W=function(){function e(e){a(this,"name",void 0),a(this,"description",void 0),a(this,"astNode",void 0),a(this,"extensionASTNodes",void 0),a(this,"_values",void 0),a(this,"_valueLookup",void 0),a(this,"_nameLookup",void 0),this.name=e.name,this.description=e.description,this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes,this._values=L(this,e.values),this._valueLookup=new Map(this._values.map(function(e){return[e.value,e]})),this._nameLookup=(0,B.default)(this._values,function(e){return e.name}),"string"!=typeof e.name&&(0,V.default)(0,"Must provide name.")}var t=e.prototype;return t.getValues=function(){return this._values},t.getValue=function(e){return this._nameLookup[e]},t.serialize=function(e){var t=this._valueLookup.get(e);if(t)return t.name},t.parseValue=function(e){if("string"==typeof e){var t=this.getValue(e);if(t)return t.value}},t.parseLiteral=function(e,t){if(e.kind===U.Kind.ENUM){var r=this.getValue(e.value);if(r)return r.value}},t.toString=function(){return this.name},e}();r.GraphQLEnumType=W,(0,k.default)(W),(0,R.default)(W);var Q=function(){function e(e){a(this,"name",void 0),a(this,"description",void 0),a(this,"astNode",void 0),a(this,"extensionASTNodes",void 0),a(this,"_fields",void 0),this.name=e.name,this.description=e.description,this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes,this._fields=I.bind(void 0,e),"string"!=typeof e.name&&(0,V.default)(0,"Must provide name.")}var t=e.prototype;return t.getFields=function(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields},t.toString=function(){return this.name},e}();r.GraphQLInputObjectType=Q,(0,k.default)(Q),(0,R.default)(Q)},{"../jsutils/defineToJSON":43,"../jsutils/defineToStringTag":44,"../jsutils/inspect":46,"../jsutils/instanceOf":47,"../jsutils/invariant":48,"../jsutils/keyMap":54,"../language/kinds":66,"../utilities/valueFromASTUntyped":107}],78:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(r,"__esModule",{value:!0}),r.isDirective=function(e){return(0,c.default)(e,p)},r.isSpecifiedDirective=function(e){return v.some(function(t){return t.name===e.name})},r.specifiedDirectives=r.GraphQLDeprecatedDirective=r.DEFAULT_DEPRECATION_REASON=r.GraphQLSkipDirective=r.GraphQLIncludeDirective=r.GraphQLDirective=void 0;var o=e("./definition"),a=e("./scalars"),s=n(e("../jsutils/defineToStringTag")),u=n(e("../jsutils/defineToJSON")),c=n(e("../jsutils/instanceOf")),l=n(e("../jsutils/invariant")),h=e("../language/directiveLocation"),p=function(){function e(e){i(this,"name",void 0),i(this,"description",void 0),i(this,"locations",void 0),i(this,"args",void 0),i(this,"astNode",void 0),this.name=e.name,this.description=e.description,this.locations=e.locations,this.astNode=e.astNode,e.name||(0,l.default)(0,"Directive must be named."),Array.isArray(e.locations)||(0,l.default)(0,"Must provide locations for directive.");var t=e.args;t?(Array.isArray(t)&&(0,l.default)(0,"@".concat(e.name," args must be an object with argument names as keys.")),this.args=Object.keys(t).map(function(e){var r=t[e];return{name:e,description:void 0===r.description?null:r.description,type:r.type,defaultValue:r.defaultValue,astNode:r.astNode}})):this.args=[]}return e.prototype.toString=function(){return"@"+this.name},e}();r.GraphQLDirective=p,(0,s.default)(p),(0,u.default)(p);var f=new p({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[h.DirectiveLocation.FIELD,h.DirectiveLocation.FRAGMENT_SPREAD,h.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:(0,o.GraphQLNonNull)(a.GraphQLBoolean),description:"Included when true."}}});r.GraphQLIncludeDirective=f;var d=new p({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[h.DirectiveLocation.FIELD,h.DirectiveLocation.FRAGMENT_SPREAD,h.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:(0,o.GraphQLNonNull)(a.GraphQLBoolean),description:"Skipped when true."}}});r.GraphQLSkipDirective=d;r.DEFAULT_DEPRECATION_REASON="No longer supported";var m=new p({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[h.DirectiveLocation.FIELD_DEFINITION,h.DirectiveLocation.ENUM_VALUE],args:{reason:{type:a.GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax (as specified by [CommonMark](https://commonmark.org/).",defaultValue:"No longer supported"}}});r.GraphQLDeprecatedDirective=m;var v=[f,d,m];r.specifiedDirectives=v},{"../jsutils/defineToJSON":43,"../jsutils/defineToStringTag":44,"../jsutils/instanceOf":47,"../jsutils/invariant":48,"../language/directiveLocation":64,"./definition":77,"./scalars":81}],79:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isSchema",{enumerable:!0,get:function(){return n.isSchema}}),Object.defineProperty(r,"GraphQLSchema",{enumerable:!0,get:function(){return n.GraphQLSchema}}),Object.defineProperty(r,"isType",{enumerable:!0,get:function(){return i.isType}}),Object.defineProperty(r,"isScalarType",{enumerable:!0,get:function(){return i.isScalarType}}),Object.defineProperty(r,"isObjectType",{enumerable:!0,get:function(){return i.isObjectType}}),Object.defineProperty(r,"isInterfaceType",{enumerable:!0,get:function(){return i.isInterfaceType}}),Object.defineProperty(r,"isUnionType",{enumerable:!0,get:function(){return i.isUnionType}}),Object.defineProperty(r,"isEnumType",{enumerable:!0,get:function(){return i.isEnumType}}),Object.defineProperty(r,"isInputObjectType",{enumerable:!0,get:function(){return i.isInputObjectType}}),Object.defineProperty(r,"isListType",{enumerable:!0,get:function(){return i.isListType}}),Object.defineProperty(r,"isNonNullType",{enumerable:!0,get:function(){return i.isNonNullType}}),Object.defineProperty(r,"isInputType",{enumerable:!0,get:function(){return i.isInputType}}),Object.defineProperty(r,"isOutputType",{enumerable:!0,get:function(){return i.isOutputType}}),Object.defineProperty(r,"isLeafType",{enumerable:!0,get:function(){return i.isLeafType}}),Object.defineProperty(r,"isCompositeType",{enumerable:!0,get:function(){return i.isCompositeType}}),Object.defineProperty(r,"isAbstractType",{enumerable:!0,get:function(){return i.isAbstractType}}),Object.defineProperty(r,"isWrappingType",{enumerable:!0,get:function(){return i.isWrappingType}}),Object.defineProperty(r,"isNullableType",{enumerable:!0,get:function(){return i.isNullableType}}),Object.defineProperty(r,"isNamedType",{enumerable:!0,get:function(){return i.isNamedType}}),Object.defineProperty(r,"isRequiredArgument",{enumerable:!0,get:function(){return i.isRequiredArgument}}),Object.defineProperty(r,"isRequiredInputField",{enumerable:!0,get:function(){return i.isRequiredInputField}}),Object.defineProperty(r,"assertType",{enumerable:!0,get:function(){return i.assertType}}),Object.defineProperty(r,"assertScalarType",{enumerable:!0,get:function(){return i.assertScalarType}}),Object.defineProperty(r,"assertObjectType",{enumerable:!0,get:function(){return i.assertObjectType}}),Object.defineProperty(r,"assertInterfaceType",{enumerable:!0,get:function(){return i.assertInterfaceType}}),Object.defineProperty(r,"assertUnionType",{enumerable:!0,get:function(){return i.assertUnionType}}),Object.defineProperty(r,"assertEnumType",{enumerable:!0,get:function(){return i.assertEnumType}}),Object.defineProperty(r,"assertInputObjectType",{enumerable:!0,get:function(){return i.assertInputObjectType}}),Object.defineProperty(r,"assertListType",{enumerable:!0,get:function(){return i.assertListType}}),Object.defineProperty(r,"assertNonNullType",{enumerable:!0,get:function(){return i.assertNonNullType}}),Object.defineProperty(r,"assertInputType",{enumerable:!0,get:function(){return i.assertInputType}}),Object.defineProperty(r,"assertOutputType",{enumerable:!0,get:function(){return i.assertOutputType}}),Object.defineProperty(r,"assertLeafType",{enumerable:!0,get:function(){return i.assertLeafType}}),Object.defineProperty(r,"assertCompositeType",{enumerable:!0,get:function(){return i.assertCompositeType}}),Object.defineProperty(r,"assertAbstractType",{enumerable:!0,get:function(){return i.assertAbstractType}}),Object.defineProperty(r,"assertWrappingType",{enumerable:!0,get:function(){return i.assertWrappingType}}),Object.defineProperty(r,"assertNullableType",{enumerable:!0,get:function(){return i.assertNullableType}}),Object.defineProperty(r,"assertNamedType",{enumerable:!0,get:function(){return i.assertNamedType}}),Object.defineProperty(r,"getNullableType",{enumerable:!0,get:function(){return i.getNullableType}}),Object.defineProperty(r,"getNamedType",{enumerable:!0,get:function(){return i.getNamedType}}),Object.defineProperty(r,"GraphQLScalarType",{enumerable:!0,get:function(){return i.GraphQLScalarType}}),Object.defineProperty(r,"GraphQLObjectType",{enumerable:!0,get:function(){return i.GraphQLObjectType}}),Object.defineProperty(r,"GraphQLInterfaceType",{enumerable:!0,get:function(){return i.GraphQLInterfaceType}}),Object.defineProperty(r,"GraphQLUnionType",{enumerable:!0,get:function(){return i.GraphQLUnionType}}),Object.defineProperty(r,"GraphQLEnumType",{enumerable:!0,get:function(){return i.GraphQLEnumType}}),Object.defineProperty(r,"GraphQLInputObjectType",{enumerable:!0,get:function(){return i.GraphQLInputObjectType}}),Object.defineProperty(r,"GraphQLList",{enumerable:!0,get:function(){return i.GraphQLList}}),Object.defineProperty(r,"GraphQLNonNull",{enumerable:!0,get:function(){return i.GraphQLNonNull}}),Object.defineProperty(r,"isDirective",{enumerable:!0,get:function(){return o.isDirective}}),Object.defineProperty(r,"GraphQLDirective",{enumerable:!0,get:function(){return o.GraphQLDirective}}),Object.defineProperty(r,"isSpecifiedDirective",{enumerable:!0,get:function(){return o.isSpecifiedDirective}}),Object.defineProperty(r,"specifiedDirectives",{enumerable:!0,get:function(){return o.specifiedDirectives}}),Object.defineProperty(r,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return o.GraphQLIncludeDirective}}),Object.defineProperty(r,"GraphQLSkipDirective",{enumerable:!0,get:function(){return o.GraphQLSkipDirective}}),Object.defineProperty(r,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return o.GraphQLDeprecatedDirective}}),Object.defineProperty(r,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return o.DEFAULT_DEPRECATION_REASON}}),Object.defineProperty(r,"isSpecifiedScalarType",{enumerable:!0,get:function(){return a.isSpecifiedScalarType}}),Object.defineProperty(r,"specifiedScalarTypes",{enumerable:!0,get:function(){return a.specifiedScalarTypes}}),Object.defineProperty(r,"GraphQLInt",{enumerable:!0,get:function(){return a.GraphQLInt}}),Object.defineProperty(r,"GraphQLFloat",{enumerable:!0,get:function(){return a.GraphQLFloat}}),Object.defineProperty(r,"GraphQLString",{enumerable:!0,get:function(){return a.GraphQLString}}),Object.defineProperty(r,"GraphQLBoolean",{enumerable:!0,get:function(){return a.GraphQLBoolean}}),Object.defineProperty(r,"GraphQLID",{enumerable:!0,get:function(){return a.GraphQLID}}),Object.defineProperty(r,"TypeKind",{enumerable:!0,get:function(){return s.TypeKind}}),Object.defineProperty(r,"isIntrospectionType",{enumerable:!0,get:function(){return s.isIntrospectionType}}),Object.defineProperty(r,"introspectionTypes",{enumerable:!0,get:function(){return s.introspectionTypes}}),Object.defineProperty(r,"__Schema",{enumerable:!0,get:function(){return s.__Schema}}),Object.defineProperty(r,"__Directive",{enumerable:!0,get:function(){return s.__Directive}}),Object.defineProperty(r,"__DirectiveLocation",{enumerable:!0,get:function(){return s.__DirectiveLocation}}),Object.defineProperty(r,"__Type",{enumerable:!0,get:function(){return s.__Type}}),Object.defineProperty(r,"__Field",{enumerable:!0,get:function(){return s.__Field}}),Object.defineProperty(r,"__InputValue",{enumerable:!0,get:function(){return s.__InputValue}}),Object.defineProperty(r,"__EnumValue",{enumerable:!0,get:function(){return s.__EnumValue}}),Object.defineProperty(r,"__TypeKind",{enumerable:!0,get:function(){return s.__TypeKind}}),Object.defineProperty(r,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return s.SchemaMetaFieldDef}}),Object.defineProperty(r,"TypeMetaFieldDef",{enumerable:!0,get:function(){return s.TypeMetaFieldDef}}),Object.defineProperty(r,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return s.TypeNameMetaFieldDef}}),Object.defineProperty(r,"validateSchema",{enumerable:!0,get:function(){return u.validateSchema}}),Object.defineProperty(r,"assertValidSchema",{enumerable:!0,get:function(){return u.assertValidSchema}});var n=e("./schema"),i=e("./definition"),o=e("./directives"),a=e("./scalars"),s=e("./introspection"),u=e("./validate")},{"./definition":77,"./directives":78,"./introspection":80,"./scalars":81,"./schema":82,"./validate":83}],80:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.isIntrospectionType=function(e){return(0,u.isNamedType)(e)&&(e.name===h.name||e.name===p.name||e.name===f.name||e.name===d.name||e.name===m.name||e.name===v.name||e.name===y.name||e.name===b.name)},r.introspectionTypes=r.TypeNameMetaFieldDef=r.TypeMetaFieldDef=r.SchemaMetaFieldDef=r.__TypeKind=r.TypeKind=r.__EnumValue=r.__InputValue=r.__Field=r.__Type=r.__DirectiveLocation=r.__Directive=r.__Schema=void 0;var i=n(e("../jsutils/isInvalid")),o=n(e("../jsutils/objectValues")),a=e("../utilities/astFromValue"),s=e("../language/printer"),u=e("./definition"),c=e("./scalars"),l=e("../language/directiveLocation"),h=new u.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:function(){return{types:{description:"A list of all types supported by this server.",type:(0,u.GraphQLNonNull)((0,u.GraphQLList)((0,u.GraphQLNonNull)(d))),resolve:function(e){return(0,o.default)(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:(0,u.GraphQLNonNull)(d),resolve:function(e){return e.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:d,resolve:function(e){return e.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:d,resolve:function(e){return e.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:(0,u.GraphQLNonNull)((0,u.GraphQLList)((0,u.GraphQLNonNull)(p))),resolve:function(e){return e.getDirectives()}}}}});r.__Schema=h;var p=new u.GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:function(){return{name:{type:(0,u.GraphQLNonNull)(c.GraphQLString),resolve:function(e){return e.name}},description:{type:c.GraphQLString,resolve:function(e){return e.description}},locations:{type:(0,u.GraphQLNonNull)((0,u.GraphQLList)((0,u.GraphQLNonNull)(f))),resolve:function(e){return e.locations}},args:{type:(0,u.GraphQLNonNull)((0,u.GraphQLList)((0,u.GraphQLNonNull)(v))),resolve:function(e){return e.args||[]}}}}});r.__Directive=p;var f=new u.GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:l.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:l.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:l.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:l.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:l.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:l.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:l.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:l.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:l.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:l.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:l.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:l.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:l.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:l.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:l.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:l.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:l.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:l.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:l.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});r.__DirectiveLocation=f;var d=new u.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:function(){return{kind:{type:(0,u.GraphQLNonNull)(b),resolve:function(e){if((0,u.isScalarType)(e))return g.SCALAR;if((0,u.isObjectType)(e))return g.OBJECT;if((0,u.isInterfaceType)(e))return g.INTERFACE;if((0,u.isUnionType)(e))return g.UNION;if((0,u.isEnumType)(e))return g.ENUM;if((0,u.isInputObjectType)(e))return g.INPUT_OBJECT;if((0,u.isListType)(e))return g.LIST;if((0,u.isNonNullType)(e))return g.NON_NULL;throw new Error("Unknown kind of type: "+e)}},name:{type:c.GraphQLString,resolve:function(e){return e.name}},description:{type:c.GraphQLString,resolve:function(e){return e.description}},fields:{type:(0,u.GraphQLList)((0,u.GraphQLNonNull)(m)),args:{includeDeprecated:{type:c.GraphQLBoolean,defaultValue:!1}},resolve:function(e,t){var r=t.includeDeprecated;if((0,u.isObjectType)(e)||(0,u.isInterfaceType)(e)){var n=(0,o.default)(e.getFields());return r||(n=n.filter(function(e){return!e.deprecationReason})),n}return null}},interfaces:{type:(0,u.GraphQLList)((0,u.GraphQLNonNull)(d)),resolve:function(e){if((0,u.isObjectType)(e))return e.getInterfaces()}},possibleTypes:{type:(0,u.GraphQLList)((0,u.GraphQLNonNull)(d)),resolve:function(e,t,r,n){var i=n.schema;if((0,u.isAbstractType)(e))return i.getPossibleTypes(e)}},enumValues:{type:(0,u.GraphQLList)((0,u.GraphQLNonNull)(y)),args:{includeDeprecated:{type:c.GraphQLBoolean,defaultValue:!1}},resolve:function(e,t){var r=t.includeDeprecated;if((0,u.isEnumType)(e)){var n=e.getValues();return r||(n=n.filter(function(e){return!e.deprecationReason})),n}}},inputFields:{type:(0,u.GraphQLList)((0,u.GraphQLNonNull)(v)),resolve:function(e){if((0,u.isInputObjectType)(e))return(0,o.default)(e.getFields())}},ofType:{type:d,resolve:function(e){return e.ofType}}}}});r.__Type=d;var m=new u.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:function(){return{name:{type:(0,u.GraphQLNonNull)(c.GraphQLString),resolve:function(e){return e.name}},description:{type:c.GraphQLString,resolve:function(e){return e.description}},args:{type:(0,u.GraphQLNonNull)((0,u.GraphQLList)((0,u.GraphQLNonNull)(v))),resolve:function(e){return e.args||[]}},type:{type:(0,u.GraphQLNonNull)(d),resolve:function(e){return e.type}},isDeprecated:{type:(0,u.GraphQLNonNull)(c.GraphQLBoolean),resolve:function(e){return e.isDeprecated}},deprecationReason:{type:c.GraphQLString,resolve:function(e){return e.deprecationReason}}}}});r.__Field=m;var v=new u.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:function(){return{name:{type:(0,u.GraphQLNonNull)(c.GraphQLString),resolve:function(e){return e.name}},description:{type:c.GraphQLString,resolve:function(e){return e.description}},type:{type:(0,u.GraphQLNonNull)(d),resolve:function(e){return e.type}},defaultValue:{type:c.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(e){return(0,i.default)(e.defaultValue)?null:(0,s.print)((0,a.astFromValue)(e.defaultValue,e.type))}}}}});r.__InputValue=v;var y=new u.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:function(){return{name:{type:(0,u.GraphQLNonNull)(c.GraphQLString),resolve:function(e){return e.name}},description:{type:c.GraphQLString,resolve:function(e){return e.description}},isDeprecated:{type:(0,u.GraphQLNonNull)(c.GraphQLBoolean),resolve:function(e){return e.isDeprecated}},deprecationReason:{type:c.GraphQLString,resolve:function(e){return e.deprecationReason}}}}});r.__EnumValue=y;var g={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"};r.TypeKind=g;var b=new u.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:g.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:g.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:g.INTERFACE,description:"Indicates this type is an interface. `fields` and `possibleTypes` are valid fields."},UNION:{value:g.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:g.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:g.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:g.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:g.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});r.__TypeKind=b;var _={name:"__schema",type:(0,u.GraphQLNonNull)(h),description:"Access the current type schema of this server.",args:[],resolve:function(e,t,r,n){return n.schema}};r.SchemaMetaFieldDef=_;var x={name:"__type",type:d,description:"Request the type information of a single type.",args:[{name:"name",type:(0,u.GraphQLNonNull)(c.GraphQLString)}],resolve:function(e,t,r,n){var i=t.name;return n.schema.getType(i)}};r.TypeMetaFieldDef=x;var w={name:"__typename",type:(0,u.GraphQLNonNull)(c.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:function(e,t,r,n){return n.parentType.name}};r.TypeNameMetaFieldDef=w;var S=[h,p,f,d,m,v,y,b];r.introspectionTypes=S},{"../jsutils/isInvalid":51,"../jsutils/objectValues":57,"../language/directiveLocation":64,"../language/printer":71,"../utilities/astFromValue":86,"./definition":77,"./scalars":81}],81:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.isSpecifiedScalarType=function(e){return(0,s.isNamedType)(e)&&(e.name===f.name||e.name===h.name||e.name===p.name||e.name===d.name||e.name===m.name)},r.specifiedScalarTypes=r.GraphQLID=r.GraphQLBoolean=r.GraphQLString=r.GraphQLFloat=r.GraphQLInt=void 0;var i=n(e("../jsutils/inspect")),o=n(e("../jsutils/isFinite")),a=n(e("../jsutils/isInteger")),s=e("./definition"),u=e("../language/kinds"),c=2147483647,l=-2147483648,h=new s.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. ",serialize:function(e){if("boolean"==typeof e)return e?1:0;var t=e;if("string"==typeof e&&""!==e&&(t=Number(e)),!(0,a.default)(t))throw new TypeError("Int cannot represent non-integer value: ".concat((0,i.default)(e)));if(t>c||t<l)throw new TypeError("Int cannot represent non 32-bit signed integer value: ".concat((0,i.default)(e)));return t},parseValue:function(e){if(!(0,a.default)(e))throw new TypeError("Int cannot represent non-integer value: ".concat((0,i.default)(e)));if(e>c||e<l)throw new TypeError("Int cannot represent non 32-bit signed integer value: ".concat((0,i.default)(e)));return e},parseLiteral:function(e){if(e.kind===u.Kind.INT){var t=parseInt(e.value,10);if(t<=c&&t>=l)return t}}});r.GraphQLInt=h;var p=new s.GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). ",serialize:function(e){if("boolean"==typeof e)return e?1:0;var t=e;if("string"==typeof e&&""!==e&&(t=Number(e)),!(0,o.default)(t))throw new TypeError("Float cannot represent non numeric value: ".concat((0,i.default)(e)));return t},parseValue:function(e){if(!(0,o.default)(e))throw new TypeError("Float cannot represent non numeric value: ".concat((0,i.default)(e)));return e},parseLiteral:function(e){return e.kind===u.Kind.FLOAT||e.kind===u.Kind.INT?parseFloat(e.value):void 0}});r.GraphQLFloat=p;var f=new s.GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize:function(e){var t=e&&"function"==typeof e.valueOf?e.valueOf():e;if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if((0,o.default)(t))return t.toString();throw new TypeError("String cannot represent value: ".concat((0,i.default)(e)))},parseValue:function(e){if("string"!=typeof e)throw new TypeError("String cannot represent a non string value: ".concat((0,i.default)(e)));return e},parseLiteral:function(e){return e.kind===u.Kind.STRING?e.value:void 0}});r.GraphQLString=f;var d=new s.GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:function(e){if("boolean"==typeof e)return e;if((0,o.default)(e))return 0!==e;throw new TypeError("Boolean cannot represent a non boolean value: ".concat((0,i.default)(e)))},parseValue:function(e){if("boolean"!=typeof e)throw new TypeError("Boolean cannot represent a non boolean value: ".concat((0,i.default)(e)));return e},parseLiteral:function(e){return e.kind===u.Kind.BOOLEAN?e.value:void 0}});r.GraphQLBoolean=d;var m=new s.GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize:function(e){var t=e&&"function"==typeof e.valueOf?e.valueOf():e;if("string"==typeof t)return t;if((0,a.default)(t))return String(t);throw new TypeError("ID cannot represent value: ".concat((0,i.default)(e)))},parseValue:function(e){if("string"==typeof e)return e;if((0,a.default)(e))return e.toString();throw new TypeError("ID cannot represent value: ".concat((0,i.default)(e)))},parseLiteral:function(e){return e.kind===u.Kind.STRING||e.kind===u.Kind.INT?e.value:void 0}});r.GraphQLID=m;var v=[f,h,p,d,m];r.specifiedScalarTypes=v},{"../jsutils/inspect":46,"../jsutils/isFinite":49,"../jsutils/isInteger":50,"../language/kinds":66,"./definition":77}],82:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){if(!t)return e;if((0,u.isWrappingType)(t))return a(e,t.ofType);if(e[t.name])return e[t.name]!==t&&(0,m.default)(0,"Schema must contain unique named types but contains multiple "+'types named "'.concat(t.name,'".')),e;e[t.name]=t;var r=e;if((0,u.isUnionType)(t)&&(r=t.getTypes().reduce(a,r)),(0,u.isObjectType)(t)&&(r=t.getInterfaces().reduce(a,r)),(0,u.isObjectType)(t)||(0,u.isInterfaceType)(t)){var n=!0,i=!1,o=void 0;try{for(var s,c=(0,v.default)(t.getFields())[Symbol.iterator]();!(n=(s=c.next()).done);n=!0){var l=s.value;l.args&&(r=l.args.map(function(e){return e.type}).reduce(a,r)),r=a(r,l.type)}}catch(e){i=!0,o=e}finally{try{n||null==c.return||c.return()}finally{if(i)throw o}}}if((0,u.isInputObjectType)(t)){var h=!0,p=!1,f=void 0;try{for(var d,y=(0,v.default)(t.getFields())[Symbol.iterator]();!(h=(d=y.next()).done);h=!0)r=a(r,d.value.type)}catch(e){p=!0,f=e}finally{try{h||null==y.return||y.return()}finally{if(p)throw f}}}return r}function s(e,t){return(0,c.isDirective)(t)?t.args.reduce(function(e,t){return a(e,t.type)},e):e}Object.defineProperty(r,"__esModule",{value:!0}),r.isSchema=function(e){return(0,d.default)(e,y)},r.GraphQLSchema=void 0;var u=e("./definition"),c=e("./directives"),l=n(e("../jsutils/inspect")),h=e("./introspection"),p=n(e("../jsutils/defineToStringTag")),f=n(e("../jsutils/find")),d=n(e("../jsutils/instanceOf")),m=n(e("../jsutils/invariant")),v=n(e("../jsutils/objectValues")),y=function(){function e(e){o(this,"astNode",void 0),o(this,"extensionASTNodes",void 0),o(this,"_queryType",void 0),o(this,"_mutationType",void 0),o(this,"_subscriptionType",void 0),o(this,"_directives",void 0),o(this,"_typeMap",void 0),o(this,"_implementations",void 0),o(this,"_possibleTypeMap",void 0),o(this,"__validationErrors",void 0),o(this,"__allowedLegacyNames",void 0),e&&e.assumeValid?this.__validationErrors=[]:("object"!==i(e)&&(0,m.default)(0,"Must provide configuration object."),e.types&&!Array.isArray(e.types)&&(0,m.default)(0,'"types" must be Array if provided but got: '.concat((0,l.default)(e.types),".")),e.directives&&!Array.isArray(e.directives)&&(0,m.default)(0,'"directives" must be Array if provided but got: '+"".concat((0,l.default)(e.directives),".")),e.allowedLegacyNames&&!Array.isArray(e.allowedLegacyNames)&&(0,m.default)(0,'"allowedLegacyNames" must be Array if provided but got: '+"".concat((0,l.default)(e.allowedLegacyNames),"."))),this.__allowedLegacyNames=e.allowedLegacyNames||[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives||c.specifiedDirectives,this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes;var t=[this.getQueryType(),this.getMutationType(),this.getSubscriptionType(),h.__Schema],r=e.types;r&&(t=t.concat(r));var n=Object.create(null);n=t.reduce(a,n),n=this._directives.reduce(s,n),this._typeMap=n,this._implementations=Object.create(null);for(var p=Object.keys(this._typeMap),f=0;f<p.length;f++){var d=p[f],v=this._typeMap[d];if((0,u.isObjectType)(v)){var y=!0,g=!1,b=void 0;try{for(var _,x=v.getInterfaces()[Symbol.iterator]();!(y=(_=x.next()).done);y=!0){var w=_.value;if((0,u.isInterfaceType)(w)){var S=this._implementations[w.name];S?S.push(v):this._implementations[w.name]=[v]}}}catch(e){g=!0,b=e}finally{try{y||null==x.return||x.return()}finally{if(g)throw b}}}else(0,u.isAbstractType)(v)&&!this._implementations[v.name]&&(this._implementations[v.name]=[])}}var t=e.prototype;return t.getQueryType=function(){return this._queryType},t.getMutationType=function(){return this._mutationType},t.getSubscriptionType=function(){return this._subscriptionType},t.getTypeMap=function(){return this._typeMap},t.getType=function(e){return this.getTypeMap()[e]},t.getPossibleTypes=function(e){return(0,u.isUnionType)(e)?e.getTypes():this._implementations[e.name]},t.isPossibleType=function(e,t){var r=this._possibleTypeMap;if(r||(this._possibleTypeMap=r=Object.create(null)),!r[e.name]){var n=this.getPossibleTypes(e);r[e.name]=n.reduce(function(e,t){return e[t.name]=!0,e},Object.create(null))}return Boolean(r[e.name][t.name])},t.getDirectives=function(){return this._directives},t.getDirective=function(e){return(0,f.default)(this.getDirectives(),function(t){return t.name===e})},e}();r.GraphQLSchema=y,(0,p.default)(y)},{"../jsutils/defineToStringTag":44,"../jsutils/find":45,"../jsutils/inspect":46,"../jsutils/instanceOf":47,"../jsutils/invariant":48,"../jsutils/objectValues":57,"./definition":77,"./directives":78,"./introspection":80}],83:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){if((0,I.isSchema)(e)||(0,D.default)(0,"Expected ".concat((0,R.default)(e)," to be a GraphQL schema.")),e.__validationErrors)return e.__validationErrors;var t=new G(e);a(t),u(t),l(t);var r=t.getErrors();return e.__validationErrors=r,r}function a(e){var t=e.schema,r=t.getQueryType();r?(0,A.isObjectType)(r)||e.reportError("Query root type must be Object type, it cannot be ".concat((0,R.default)(r),"."),s(t,r,"query")):e.reportError("Query root type must be provided.",t.astNode);var n=t.getMutationType();n&&!(0,A.isObjectType)(n)&&e.reportError("Mutation root type must be Object type if provided, it cannot be "+"".concat((0,R.default)(n),"."),s(t,n,"mutation"));var i=t.getSubscriptionType();i&&!(0,A.isObjectType)(i)&&e.reportError("Subscription root type must be Object type if provided, it cannot be "+"".concat((0,R.default)(i),"."),s(t,i,"subscription"))}function s(e,t,r){var n=g(e,function(e){return e.operationTypes}),i=!0,o=!1,a=void 0;try{for(var s,u=n[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;if(c.operation===r)return c.type}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return t.astNode}function u(e){var t=!0,r=!1,n=void 0;try{for(var i,o=e.schema.getDirectives()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if((0,N.isDirective)(a)){c(e,a);var s=Object.create(null),u=!0,l=!1,h=void 0;try{for(var p,f=a.args[Symbol.iterator]();!(u=(p=f.next()).done);u=!0){var d=p.value,m=d.name;c(e,d),s[m]?e.reportError("Argument @".concat(a.name,"(").concat(m,":) can only be defined once."),M(a,m)):(s[m]=!0,(0,A.isInputType)(d.type)||e.reportError("The type of @".concat(a.name,"(").concat(m,":) must be Input Type ")+"but got: ".concat((0,R.default)(d.type),"."),C(a,m)))}}catch(e){l=!0,h=e}finally{try{u||null==f.return||f.return()}finally{if(l)throw h}}}else e.reportError("Expected directive but got: ".concat((0,R.default)(a),"."),a&&a.astNode)}}catch(e){r=!0,n=e}finally{try{t||null==o.return||o.return()}finally{if(r)throw n}}}function c(e,t){if(-1===e.schema.__allowedLegacyNames.indexOf(t.name)){var r=(0,B.isValidNameError)(t.name,t.astNode||void 0);r&&e.addError(r)}}function l(e){var t=e.schema.getTypeMap(),r=!0,n=!1,i=void 0;try{for(var o,a=(0,F.default)(t)[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;(0,A.isNamedType)(s)?((0,L.isIntrospectionType)(s)||c(e,s),(0,A.isObjectType)(s)?(h(e,s),p(e,s)):(0,A.isInterfaceType)(s)?h(e,s):(0,A.isUnionType)(s)?d(e,s):(0,A.isEnumType)(s)?m(e,s):(0,A.isInputObjectType)(s)&&v(e,s)):e.reportError("Expected GraphQL named type but got: ".concat((0,R.default)(s),"."),s&&s.astNode)}}catch(e){n=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(n)throw i}}}function h(e,t){var r=(0,F.default)(t.getFields());0===r.length&&e.reportError("Type ".concat(t.name," must define one or more fields."),y(t));var n=!0,i=!1,o=void 0;try{for(var a,s=r[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;c(e,u);var l=w(t,u.name);if(l.length>1)e.reportError("Field ".concat(t.name,".").concat(u.name," can only be defined once."),l);else{(0,A.isOutputType)(u.type)||e.reportError("The type of ".concat(t.name,".").concat(u.name," must be Output Type ")+"but got: ".concat((0,R.default)(u.type),"."),S(t,u.name));var h=Object.create(null),p=!0,f=!1,d=void 0;try{for(var m,v=u.args[Symbol.iterator]();!(p=(m=v.next()).done);p=!0){var g=m.value,b=g.name;c(e,g),h[b]&&e.reportError("Field argument ".concat(t.name,".").concat(u.name,"(").concat(b,":) can only ")+"be defined once.",E(t,u.name,b)),h[b]=!0,(0,A.isInputType)(g.type)||e.reportError("The type of ".concat(t.name,".").concat(u.name,"(").concat(b,":) must be Input ")+"Type but got: ".concat((0,R.default)(g.type),"."),O(t,u.name,b))}}catch(e){f=!0,d=e}finally{try{p||null==v.return||v.return()}finally{if(f)throw d}}}}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}}function p(e,t){var r=Object.create(null),n=!0,i=!1,o=void 0;try{for(var a,s=t.getInterfaces()[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;(0,A.isInterfaceType)(u)?r[u.name]?e.reportError("Type ".concat(t.name," can only implement ").concat(u.name," once."),_(t,u)):(r[u.name]=!0,f(e,t,u)):e.reportError("Type ".concat((0,R.default)(t)," must only implement Interface types, ")+"it cannot implement ".concat((0,R.default)(u),"."),b(t,u))}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}}function f(e,t,r){for(var n=t.getFields(),i=r.getFields(),o=Object.keys(i),a=0;a<o.length;a++){var s=o[a],u=n[s],c=i[s];if(u){(0,U.isTypeSubTypeOf)(e.schema,u.type,c.type)||e.reportError("Interface field ".concat(r.name,".").concat(s," expects type ")+"".concat((0,R.default)(c.type)," but ").concat(t.name,".").concat(s," ")+"is type ".concat((0,R.default)(u.type),"."),[S(r,s),S(t,s)]);var l=!0,h=!1,p=void 0;try{for(var f,d=c.args[Symbol.iterator]();!(l=(f=d.next()).done);l=!0){(function(){var n=f.value,i=n.name,o=(0,k.default)(u.args,function(e){return e.name===i});if(!o)return e.reportError("Interface field argument ".concat(r.name,".").concat(s,"(").concat(i,":) ")+"expected but ".concat(t.name,".").concat(s," does not provide it."),[T(r,s,i),x(t,s)]),"continue";(0,U.isEqualType)(n.type,o.type)||e.reportError("Interface field argument ".concat(r.name,".").concat(s,"(").concat(i,":) ")+"expects type ".concat((0,R.default)(n.type)," but ")+"".concat(t.name,".").concat(s,"(").concat(i,":) is type ")+"".concat((0,R.default)(o.type),"."),[O(r,s,i),O(t,s,i)])})()}}catch(e){h=!0,p=e}finally{try{l||null==d.return||d.return()}finally{if(h)throw p}}var m=!0,v=!1,g=void 0;try{for(var b,_=u.args[Symbol.iterator]();!(m=(b=_.next()).done);m=!0)!function(){var n=b.value,i=n.name;!(0,k.default)(c.args,function(e){return e.name===i})&&(0,A.isRequiredArgument)(n)&&e.reportError("Object field ".concat(t.name,".").concat(s," includes required ")+"argument ".concat(i," that is missing from the Interface field ")+"".concat(r.name,".").concat(s,"."),[T(t,s,i),x(r,s)])}()}catch(e){v=!0,g=e}finally{try{m||null==_.return||_.return()}finally{if(v)throw g}}}else e.reportError("Interface field ".concat(r.name,".").concat(s," expected but ")+"".concat(t.name," does not provide it."),[x(r,s)].concat(y(t)))}}function d(e,t){var r=t.getTypes();0===r.length&&e.reportError("Union type ".concat(t.name," must define one or more member types."),y(t));var n=Object.create(null),i=!0,o=!1,a=void 0;try{for(var s,u=r[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;n[c.name]?e.reportError("Union type ".concat(t.name," can only include type ")+"".concat(c.name," once."),j(t,c.name)):(n[c.name]=!0,(0,A.isObjectType)(c)||e.reportError("Union type ".concat(t.name," can only include Object types, ")+"it cannot include ".concat((0,R.default)(c),"."),j(t,String(c))))}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}}function m(e,t){var r=t.getValues();0===r.length&&e.reportError("Enum type ".concat(t.name," must define one or more values."),y(t));var n=!0,i=!1,o=void 0;try{for(var a,s=r[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value,l=u.name,h=P(t,l);h&&h.length>1&&e.reportError("Enum type ".concat(t.name," can include value ").concat(l," only once."),h),c(e,u),"true"!==l&&"false"!==l&&"null"!==l||e.reportError("Enum type ".concat(t.name," cannot include value: ").concat(l,"."),u.astNode)}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}}function v(e,t){var r=(0,F.default)(t.getFields());0===r.length&&e.reportError("Input Object type ".concat(t.name," must define one or more fields."),y(t));var n=!0,i=!1,o=void 0;try{for(var a,s=r[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;c(e,u),(0,A.isInputType)(u.type)||e.reportError("The type of ".concat(t.name,".").concat(u.name," must be Input Type ")+"but got: ".concat((0,R.default)(u.type),"."),u.astNode&&u.astNode.type)}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}}function y(e){var t=e.astNode,r=e.extensionASTNodes;return t?r?[t].concat(r):[t]:r||[]}function g(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=y(e)[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;if(u){var c=t(u);c&&(r=r.concat(c))}}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}function b(e,t){return _(e,t)[0]}function _(e,t){return g(e,function(e){return e.interfaces}).filter(function(e){return e.name.value===t.name})}function x(e,t){return w(e,t)[0]}function w(e,t){return g(e,function(e){return e.fields}).filter(function(e){return e.name.value===t})}function S(e,t){var r=x(e,t);return r&&r.type}function T(e,t,r){return E(e,t,r)[0]}function E(e,t,r){var n=[],i=x(e,t);if(i&&i.arguments){var o=!0,a=!1,s=void 0;try{for(var u,c=i.arguments[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var l=u.value;l.name.value===r&&n.push(l)}}catch(e){a=!0,s=e}finally{try{o||null==c.return||c.return()}finally{if(a)throw s}}}return n}function O(e,t,r){var n=T(e,t,r);return n&&n.type}function M(e,t){return g(e,function(e){return e.arguments}).filter(function(e){return e.name.value===t})}function C(e,t){var r=M(e,t)[0];return r&&r.type}function j(e,t){return g(e,function(e){return e.types}).filter(function(e){return e.name.value===t})}function P(e,t){return g(e,function(e){return e.values}).filter(function(e){return e.name.value===t})}Object.defineProperty(r,"__esModule",{value:!0}),r.validateSchema=o,r.assertValidSchema=function(e){var t=o(e);if(0!==t.length)throw new Error(t.map(function(e){return e.message}).join("\n\n"))};var A=e("./definition"),N=e("./directives"),L=e("./introspection"),I=e("./schema"),R=n(e("../jsutils/inspect")),k=n(e("../jsutils/find")),D=n(e("../jsutils/invariant")),F=n(e("../jsutils/objectValues")),V=e("../error/GraphQLError"),B=e("../utilities/assertValidName"),U=e("../utilities/typeComparators"),G=function(){function e(e){i(this,"_errors",void 0),i(this,"schema",void 0),this._errors=[],this.schema=e}var t=e.prototype;return t.reportError=function(e,t){var r=(Array.isArray(t)?t:[t]).filter(Boolean);this.addError(new V.GraphQLError(e,r))},t.addError=function(e){this._errors.push(e)},t.getErrors=function(){return this._errors},e}()},{"../error/GraphQLError":32,"../jsutils/find":45,"../jsutils/inspect":46,"../jsutils/invariant":48,"../jsutils/objectValues":57,"../utilities/assertValidName":85,"../utilities/typeComparators":104,"./definition":77,"./directives":78,"./introspection":80,"./schema":82}],84:[function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t,r){var n=r.name.value;return n===s.SchemaMetaFieldDef.name&&e.getQueryType()===t?s.SchemaMetaFieldDef:n===s.TypeMetaFieldDef.name&&e.getQueryType()===t?s.TypeMetaFieldDef:n===s.TypeNameMetaFieldDef.name&&(0,a.isCompositeType)(t)?s.TypeNameMetaFieldDef:(0,a.isObjectType)(t)||(0,a.isInterfaceType)(t)?t.getFields()[n]:void 0}Object.defineProperty(r,"__esModule",{value:!0}),r.TypeInfo=void 0;var o=e("../language/kinds"),a=e("../type/definition"),s=e("../type/introspection"),u=e("./typeFromAST"),c=function(e){return e&&e.__esModule?e:{default:e}}(e("../jsutils/find")),l=function(){function e(e,t,r){n(this,"_schema",void 0),n(this,"_typeStack",void 0),n(this,"_parentTypeStack",void 0),n(this,"_inputTypeStack",void 0),n(this,"_fieldDefStack",void 0),n(this,"_defaultValueStack",void 0),n(this,"_directive",void 0),n(this,"_argument",void 0),n(this,"_enumValue",void 0),n(this,"_getFieldDef",void 0),this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=t||i,r&&((0,a.isInputType)(r)&&this._inputTypeStack.push(r),(0,a.isCompositeType)(r)&&this._parentTypeStack.push(r),(0,a.isOutputType)(r)&&this._typeStack.push(r))}var t=e.prototype;return t.getType=function(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]},t.getParentType=function(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]},t.getInputType=function(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]},t.getParentInputType=function(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]},t.getFieldDef=function(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]},t.getDefaultValue=function(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]},t.getDirective=function(){return this._directive},t.getArgument=function(){return this._argument},t.getEnumValue=function(){return this._enumValue},t.enter=function(e){var t=this._schema;switch(e.kind){case o.Kind.SELECTION_SET:var r=(0,a.getNamedType)(this.getType());this._parentTypeStack.push((0,a.isCompositeType)(r)?r:void 0);break;case o.Kind.FIELD:var n,i,s=this.getParentType();s&&(n=this._getFieldDef(t,s,e))&&(i=n.type),this._fieldDefStack.push(n),this._typeStack.push((0,a.isOutputType)(i)?i:void 0);break;case o.Kind.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case o.Kind.OPERATION_DEFINITION:var l;"query"===e.operation?l=t.getQueryType():"mutation"===e.operation?l=t.getMutationType():"subscription"===e.operation&&(l=t.getSubscriptionType()),this._typeStack.push((0,a.isObjectType)(l)?l:void 0);break;case o.Kind.INLINE_FRAGMENT:case o.Kind.FRAGMENT_DEFINITION:var h=e.typeCondition,p=h?(0,u.typeFromAST)(t,h):(0,a.getNamedType)(this.getType());this._typeStack.push((0,a.isOutputType)(p)?p:void 0);break;case o.Kind.VARIABLE_DEFINITION:var f=(0,u.typeFromAST)(t,e.type);this._inputTypeStack.push((0,a.isInputType)(f)?f:void 0);break;case o.Kind.ARGUMENT:var d,m,v=this.getDirective()||this.getFieldDef();v&&(d=(0,c.default)(v.args,function(t){return t.name===e.name.value}))&&(m=d.type),this._argument=d,this._defaultValueStack.push(d?d.defaultValue:void 0),this._inputTypeStack.push((0,a.isInputType)(m)?m:void 0);break;case o.Kind.LIST:var y=(0,a.getNullableType)(this.getInputType()),g=(0,a.isListType)(y)?y.ofType:y;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,a.isInputType)(g)?g:void 0);break;case o.Kind.OBJECT_FIELD:var b,_,x=(0,a.getNamedType)(this.getInputType());(0,a.isInputObjectType)(x)&&(_=x.getFields()[e.name.value])&&(b=_.type),this._defaultValueStack.push(_?_.defaultValue:void 0),this._inputTypeStack.push((0,a.isInputType)(b)?b:void 0);break;case o.Kind.ENUM:var w,S=(0,a.getNamedType)(this.getInputType());(0,a.isEnumType)(S)&&(w=S.getValue(e.value)),this._enumValue=w}},t.leave=function(e){switch(e.kind){case o.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case o.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case o.Kind.DIRECTIVE:this._directive=null;break;case o.Kind.OPERATION_DEFINITION:case o.Kind.INLINE_FRAGMENT:case o.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case o.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case o.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case o.Kind.LIST:case o.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case o.Kind.ENUM:this._enumValue=null}},e}();r.TypeInfo=l},{"../jsutils/find":45,"../language/kinds":66,"../type/definition":77,"../type/introspection":80,"./typeFromAST":105}],85:[function(e,t,r){"use strict";function n(e,t){return"string"!=typeof e&&(0,o.default)(0,"Expected string"),e.length>1&&"_"===e[0]&&"_"===e[1]?new i.GraphQLError('Name "'.concat(e,'" must not begin with "__", which is reserved by ')+"GraphQL introspection.",t):a.test(e)?void 0:new i.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(e,'" does not.'),t)}Object.defineProperty(r,"__esModule",{value:!0}),r.assertValidName=function(e){var t=n(e);if(t)throw t;return e},r.isValidNameError=n;var i=e("../error/GraphQLError"),o=function(e){return e&&e.__esModule?e:{default:e}}(e("../jsutils/invariant")),a=/^[_a-zA-Z][_a-zA-Z0-9]*$/},{"../error/GraphQLError":32,"../jsutils/invariant":48}],86:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if((0,p.isNonNullType)(t)){var r=o(e,t.ofType);return r&&r.kind===h.Kind.NULL?null:r}if(null===e)return{kind:h.Kind.NULL};if((0,c.default)(e))return null;if((0,p.isListType)(t)){var n=t.ofType;if((0,a.isCollection)(e)){var m=[];return(0,a.forEach)(e,function(e){var t=o(e,n);t&&m.push(t)}),{kind:h.Kind.LIST,values:m}}return o(e,n)}if((0,p.isInputObjectType)(t)){if(null===e||"object"!==i(e))return null;var v=(0,l.default)(t.getFields()),y=[],g=!0,b=!1,_=void 0;try{for(var x,w=v[Symbol.iterator]();!(g=(x=w.next()).done);g=!0){var S=x.value,T=o(e[S.name],S.type);T&&y.push({kind:h.Kind.OBJECT_FIELD,name:{kind:h.Kind.NAME,value:S.name},value:T})}}catch(e){b=!0,_=e}finally{try{g||null==w.return||w.return()}finally{if(b)throw _}}return{kind:h.Kind.OBJECT,fields:y}}if((0,p.isScalarType)(t)||(0,p.isEnumType)(t)){var E=t.serialize(e);if((0,u.default)(E))return null;if("boolean"==typeof E)return{kind:h.Kind.BOOLEAN,value:E};if("number"==typeof E){var O=String(E);return d.test(O)?{kind:h.Kind.INT,value:O}:{kind:h.Kind.FLOAT,value:O}}if("string"==typeof E)return(0,p.isEnumType)(t)?{kind:h.Kind.ENUM,value:E}:t===f.GraphQLID&&d.test(E)?{kind:h.Kind.INT,value:E}:{kind:h.Kind.STRING,value:E};throw new TypeError("Cannot convert value to AST: ".concat((0,s.default)(E)))}throw new Error("Unknown type: ".concat(t,"."))}Object.defineProperty(r,"__esModule",{value:!0}),r.astFromValue=o;var a=e("iterall"),s=n(e("../jsutils/inspect")),u=n(e("../jsutils/isNullish")),c=n(e("../jsutils/isInvalid")),l=n(e("../jsutils/objectValues")),h=e("../language/kinds"),p=e("../type/definition"),f=e("../type/scalars"),d=/^-?(0|[1-9][0-9]*)$/},{"../jsutils/inspect":46,"../jsutils/isInvalid":51,"../jsutils/isNullish":52,"../jsutils/objectValues":57,"../language/kinds":66,"../type/definition":77,"../type/scalars":81,iterall:144}],87:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){e&&e.kind===g.Kind.DOCUMENT||(0,c.default)(0,"Must provide valid Document AST"),t&&(t.assumeValid||t.assumeValidSDL)||(0,f.assertValidSDL)(e);for(var r,n=[],i=Object.create(null),o=[],a=0;a<e.definitions.length;a++){var s=e.definitions[a];if(s.kind===g.Kind.SCHEMA_DEFINITION)r=s;else if((0,b.isTypeDefinitionNode)(s)){var u=s.name.value;if(i[u])throw new Error('Type "'.concat(u,'" was defined more than once.'));n.push(s),i[u]=s}else s.kind===g.Kind.DIRECTIVE_DEFINITION&&o.push(s)}var l=r?function(e){var t={},r=!0,n=!1,o=void 0;try{for(var a,s=e.operationTypes[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var u=a.value,c=u.type.name.value,l=u.operation;if(t[l])throw new Error("Must provide only one ".concat(l," type in schema."));if(!i[c])throw new Error("Specified ".concat(l,' type "').concat(c,'" not found in document.'));t[l]=u.type}}catch(e){n=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw o}}return t}(r):{query:i.Query,mutation:i.Mutation,subscription:i.Subscription},h=new E(i,t,function(e){throw new Error('Type "'.concat(e.name.value,'" not found in document.'))}),p=o.map(function(e){return h.buildDirective(e)});return p.some(function(e){return"skip"===e.name})||p.push(x.GraphQLSkipDirective),p.some(function(e){return"include"===e.name})||p.push(x.GraphQLIncludeDirective),p.some(function(e){return"deprecated"===e.name})||p.push(x.GraphQLDeprecatedDirective),new T.GraphQLSchema({query:l.query?h.buildType(l.query):null,mutation:l.mutation?h.buildType(l.mutation):null,subscription:l.subscription?h.buildType(l.subscription):null,types:n.map(function(e){return h.buildType(e)}),directives:p,astNode:r,assumeValid:t&&t.assumeValid,allowedLegacyNames:t&&t.allowedLegacyNames})}function a(e){var t=(0,y.getDirectiveValues)(x.GraphQLDeprecatedDirective,e);return t&&t.reason}function s(e,t){if(e.description)return e.description.value;if(t&&t.commentDescriptions){var r=u(e);if(void 0!==r)return(0,d.default)("\n"+r)}}function u(e){var t=e.loc;if(t){for(var r=[],n=t.startToken.prev;n&&n.kind===m.TokenKind.COMMENT&&n.next&&n.prev&&n.line+1===n.next.line&&n.line!==n.prev.line;){var i=String(n.value);r.push(i),n=n.prev}return r.reverse().join("\n")}}Object.defineProperty(r,"__esModule",{value:!0}),r.buildASTSchema=o,r.getDescription=s,r.buildSchema=function(e,t){return o((0,v.parse)(e,t),t)},r.ASTDefinitionBuilder=void 0;var c=n(e("../jsutils/invariant")),l=n(e("../jsutils/keyMap")),h=n(e("../jsutils/keyValMap")),p=e("./valueFromAST"),f=e("../validation/validate"),d=n(e("../language/blockStringValue")),m=e("../language/lexer"),v=e("../language/parser"),y=e("../execution/values"),g=e("../language/kinds"),b=e("../language/predicates"),_=e("../type/definition"),x=e("../type/directives"),w=e("../type/introspection"),S=e("../type/scalars"),T=e("../type/schema"),E=function(){function e(e,t,r){i(this,"_typeDefinitionsMap",void 0),i(this,"_options",void 0),i(this,"_resolveType",void 0),i(this,"_cache",void 0),this._typeDefinitionsMap=e,this._options=t,this._resolveType=r,this._cache=(0,l.default)(S.specifiedScalarTypes.concat(w.introspectionTypes),function(e){return e.name})}var t=e.prototype;return t.buildType=function(e){var t=e.name.value;if(!this._cache[t])if(e.kind===g.Kind.NAMED_TYPE){var r=this._typeDefinitionsMap[t];this._cache[t]=r?this._makeSchemaDef(r):this._resolveType(e)}else this._cache[t]=this._makeSchemaDef(e);return this._cache[t]},t._buildWrappedType=function(e){return e.kind===g.Kind.LIST_TYPE?(0,_.GraphQLList)(this._buildWrappedType(e.type)):e.kind===g.Kind.NON_NULL_TYPE?(0,_.GraphQLNonNull)(this._buildWrappedType(e.type)):this.buildType(e)},t.buildDirective=function(e){return new x.GraphQLDirective({name:e.name.value,description:s(e,this._options),locations:e.locations.map(function(e){return e.value}),args:e.arguments&&this._makeInputValues(e.arguments),astNode:e})},t.buildField=function(e){return{type:this._buildWrappedType(e.type),description:s(e,this._options),args:e.arguments&&this._makeInputValues(e.arguments),deprecationReason:a(e),astNode:e}},t.buildInputField=function(e){var t=this._buildWrappedType(e.type);return{name:e.name.value,type:t,description:s(e,this._options),defaultValue:(0,p.valueFromAST)(e.defaultValue,t),astNode:e}},t.buildEnumValue=function(e){return{description:s(e,this._options),deprecationReason:a(e),astNode:e}},t._makeSchemaDef=function(e){switch(e.kind){case g.Kind.OBJECT_TYPE_DEFINITION:return this._makeTypeDef(e);case g.Kind.INTERFACE_TYPE_DEFINITION:return this._makeInterfaceDef(e);case g.Kind.ENUM_TYPE_DEFINITION:return this._makeEnumDef(e);case g.Kind.UNION_TYPE_DEFINITION:return this._makeUnionDef(e);case g.Kind.SCALAR_TYPE_DEFINITION:return this._makeScalarDef(e);case g.Kind.INPUT_OBJECT_TYPE_DEFINITION:return this._makeInputObjectDef(e);default:throw new Error('Type kind "'.concat(e.kind,'" not supported.'))}},t._makeTypeDef=function(e){var t=this,r=e.interfaces;return new _.GraphQLObjectType({name:e.name.value,description:s(e,this._options),fields:function(){return t._makeFieldDefMap(e)},interfaces:r?function(){return r.map(function(e){return t.buildType(e)})}:[],astNode:e})},t._makeFieldDefMap=function(e){var t=this;return e.fields?(0,h.default)(e.fields,function(e){return e.name.value},function(e){return t.buildField(e)}):{}},t._makeInputValues=function(e){var t=this;return(0,h.default)(e,function(e){return e.name.value},function(e){return t.buildInputField(e)})},t._makeInterfaceDef=function(e){var t=this;return new _.GraphQLInterfaceType({name:e.name.value,description:s(e,this._options),fields:function(){return t._makeFieldDefMap(e)},astNode:e})},t._makeEnumDef=function(e){return new _.GraphQLEnumType({name:e.name.value,description:s(e,this._options),values:this._makeValueDefMap(e),astNode:e})},t._makeValueDefMap=function(e){var t=this;return e.values?(0,h.default)(e.values,function(e){return e.name.value},function(e){return t.buildEnumValue(e)}):{}},t._makeUnionDef=function(e){var t=this,r=e.types;return new _.GraphQLUnionType({name:e.name.value,description:s(e,this._options),types:r?function(){return r.map(function(e){return t.buildType(e)})}:[],astNode:e})},t._makeScalarDef=function(e){return new _.GraphQLScalarType({name:e.name.value,description:s(e,this._options),astNode:e,serialize:function(e){return e}})},t._makeInputObjectDef=function(e){var t=this;return new _.GraphQLInputObjectType({name:e.name.value,description:s(e,this._options),fields:function(){return e.fields?t._makeInputValues(e.fields):{}},astNode:e})},e}();r.ASTDefinitionBuilder=E},{"../execution/values":40,"../jsutils/invariant":48,"../jsutils/keyMap":54,"../jsutils/keyValMap":55,"../language/blockStringValue":63,"../language/kinds":66,"../language/lexer":67,"../language/parser":69,"../language/predicates":70,"../type/definition":77,"../type/directives":78,"../type/introspection":80,"../type/scalars":81,"../type/schema":82,"../validation/validate":138,"./valueFromAST":106}],88:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.buildClientSchema=function(e,t){function r(e){if(e.kind===f.TypeKind.LIST){var t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");return(0,h.GraphQLList)(r(t))}if(e.kind===f.TypeKind.NON_NULL){var o=e.ofType;if(!o)throw new Error("Decorated type deeper than introspection query.");var a=r(o);return(0,h.GraphQLNonNull)((0,h.assertNullableType)(a))}if(!e.name)throw new Error("Unknown type reference: "+(0,i.default)(e));return n(e.name)}function n(e){if(A[e])return A[e];var t=P[e];if(!t)throw new Error("Invalid or incomplete schema, unknown type: ".concat(e,". Ensure ")+"that a full introspection query is used in order to build a client schema.");var r=b(t);return A[e]=r,r}function m(e){var t=r(e);return(0,h.isInputType)(t)||(0,o.default)(0,"Introspection must provide input type for arguments."),t}function v(e){var t=r(e);return(0,h.isOutputType)(t)||(0,o.default)(0,"Introspection must provide output type for fields."),t}function y(e){var t=r(e);return(0,h.assertObjectType)(t)}function g(e){var t=r(e);return(0,h.assertInterfaceType)(t)}function b(e){if(e&&e.name&&e.kind)switch(e.kind){case f.TypeKind.SCALAR:return _(e);case f.TypeKind.OBJECT:return x(e);case f.TypeKind.INTERFACE:return w(e);case f.TypeKind.UNION:return S(e);case f.TypeKind.ENUM:return T(e);case f.TypeKind.INPUT_OBJECT:return E(e)}throw new Error("Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema:"+(0,i.default)(e))}function _(e){return new h.GraphQLScalarType({name:e.name,description:e.description,serialize:function(e){return e}})}function x(e){if(!e.interfaces)throw new Error("Introspection result missing interfaces: "+(0,i.default)(e));return new h.GraphQLObjectType({name:e.name,description:e.description,interfaces:function(){return e.interfaces.map(g)},fields:function(){return O(e)}})}function w(e){return new h.GraphQLInterfaceType({name:e.name,description:e.description,fields:function(){return O(e)}})}function S(e){if(!e.possibleTypes)throw new Error("Introspection result missing possibleTypes: "+(0,i.default)(e));return new h.GraphQLUnionType({name:e.name,description:e.description,types:function(){return e.possibleTypes.map(y)}})}function T(e){if(!e.enumValues)throw new Error("Introspection result missing enumValues: "+(0,i.default)(e));return new h.GraphQLEnumType({name:e.name,description:e.description,values:(0,s.default)(e.enumValues,function(e){return e.name},function(e){return{description:e.description,deprecationReason:e.deprecationReason}})})}function E(e){if(!e.inputFields)throw new Error("Introspection result missing inputFields: "+(0,i.default)(e));return new h.GraphQLInputObjectType({name:e.name,description:e.description,fields:function(){return M(e.inputFields)}})}function O(e){if(!e.fields)throw new Error("Introspection result missing fields: "+(0,i.default)(e));return(0,s.default)(e.fields,function(e){return e.name},function(e){if(!e.args)throw new Error("Introspection result missing field args: "+(0,i.default)(e));return{description:e.description,deprecationReason:e.deprecationReason,type:v(e.type),args:M(e.args)}})}function M(e){return(0,s.default)(e,function(e){return e.name},C)}function C(e){var t=m(e.type),r=e.defaultValue?(0,u.valueFromAST)((0,c.parseValue)(e.defaultValue),t):void 0;return{description:e.description,type:t,defaultValue:r}}var j=e.__schema,P=(0,a.default)(j.types,function(e){return e.name}),A=(0,a.default)(d.specifiedScalarTypes.concat(f.introspectionTypes),function(e){return e.name}),N=j.types.map(function(e){return n(e.name)}),L=j.queryType?y(j.queryType):null,I=j.mutationType?y(j.mutationType):null,R=j.subscriptionType?y(j.subscriptionType):null,k=j.directives?j.directives.map(function(e){if(!e.args)throw new Error("Introspection result missing directive args: "+(0,i.default)(e));if(!e.locations)throw new Error("Introspection result missing directive locations: "+(0,i.default)(e));return new p.GraphQLDirective({name:e.name,description:e.description,locations:e.locations.slice(),args:M(e.args)})}):[];return new l.GraphQLSchema({query:L,mutation:I,subscription:R,types:N,directives:k,assumeValid:t&&t.assumeValid,allowedLegacyNames:t&&t.allowedLegacyNames})};var i=n(e("../jsutils/inspect")),o=n(e("../jsutils/invariant")),a=n(e("../jsutils/keyMap")),s=n(e("../jsutils/keyValMap")),u=e("./valueFromAST"),c=e("../language/parser"),l=e("../type/schema"),h=e("../type/definition"),p=e("../type/directives"),f=e("../type/introspection"),d=e("../type/scalars")},{"../jsutils/inspect":46,"../jsutils/invariant":48,"../jsutils/keyMap":54,"../jsutils/keyValMap":55,"../language/parser":69,"../type/definition":77,"../type/directives":78,"../type/introspection":80,"../type/scalars":81,"../type/schema":82,"./valueFromAST":106}],89:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t,r,n){if((0,g.isNonNullType)(t))return null==e?s([l("Expected non-nullable type ".concat((0,f.default)(t)," not to be null"),r,n)]):o(e,t.ofType,r,n);if(null==e)return a(null);if((0,g.isScalarType)(t))try{var y=t.parseValue(e);return(0,d.default)(y)?s([l("Expected type ".concat(t.name),r,n)]):a(y)}catch(e){return s([l("Expected type ".concat(t.name),r,n,e.message,e)])}if((0,g.isEnumType)(t)){if("string"==typeof e){var _=t.getValue(e);if(_)return a(_.value)}var x=(0,v.default)(String(e),t.getValues().map(function(e){return e.name})),w=0!==x.length?"did you mean ".concat((0,m.default)(x),"?"):void 0;return s([l("Expected type ".concat(t.name),r,n,w)])}if((0,g.isListType)(t)){var S=t.ofType;if((0,p.isCollection)(e)){var T,E=[];return(0,p.forEach)(e,function(e,t){var i=o(e,S,r,c(n,t));i.errors?T=u(T,i.errors):T||E.push(i.value)}),T?s(T):a(E)}var O=o(e,S,r);return O.errors?O:a([O.value])}if((0,g.isInputObjectType)(t)){if("object"!==i(e))return s([l("Expected type ".concat(t.name," to be an object"),r,n)]);var M,C={},j=t.getFields();for(var P in j)if(b.call(j,P)){var A=j[P],N=e[P];if((0,d.default)(N))(0,d.default)(A.defaultValue)?(0,g.isNonNullType)(A.type)&&(M=u(M,l("Field ".concat(h(c(n,P))," of required ")+"type ".concat((0,f.default)(A.type)," was not provided"),r))):C[P]=A.defaultValue;else{var L=o(N,A.type,r,c(n,P));L.errors?M=u(M,L.errors):M||(C[P]=L.value)}}for(var I in e)if(b.call(e,I)&&!j[I]){var R=(0,v.default)(I,Object.keys(j)),k=0!==R.length?"did you mean ".concat((0,m.default)(R),"?"):void 0;M=u(M,l('Field "'.concat(I,'" is not defined by type ').concat(t.name),r,n,k))}return M?s(M):a(C)}throw new Error("Unexpected type: ".concat(t,"."))}function a(e){return{errors:void 0,value:e}}function s(e){return{errors:e,value:void 0}}function u(e,t){return(e||[]).concat(t)}function c(e,t){return{prev:e,key:t}}function l(e,t,r,n,i){var o=h(r);return new y.GraphQLError(e+(o?" at "+o:"")+(n?"; "+n:"."),t,void 0,void 0,void 0,i)}function h(e){for(var t="",r=e;r;)t=("string"==typeof r.key?"."+r.key:"["+String(r.key)+"]")+t,r=r.prev;return t?"value"+t:""}Object.defineProperty(r,"__esModule",{value:!0}),r.coerceValue=o;var p=e("iterall"),f=n(e("../jsutils/inspect")),d=n(e("../jsutils/isInvalid")),m=n(e("../jsutils/orList")),v=n(e("../jsutils/suggestionList")),y=e("../error/GraphQLError"),g=e("../type/definition"),b=Object.prototype.hasOwnProperty},{"../error/GraphQLError":32,"../jsutils/inspect":46,"../jsutils/isInvalid":51,"../jsutils/orList":58,"../jsutils/suggestionList":62,"../type/definition":77,iterall:144}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.concatAST=function(e){for(var t=[],r=0;r<e.length;r++)for(var n=e[r].definitions,i=0;i<n.length;i++)t.push(n[i]);return{kind:"Document",definitions:t}}},{}],91:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){o(e,t,r[t])})}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){switch(t.kind){case b.Kind.OBJECT_TYPE_EXTENSION:if(!(0,y.isObjectType)(e))throw new f.GraphQLError('Cannot extend non-object type "'.concat(e.name,'".'),[t]);break;case b.Kind.INTERFACE_TYPE_EXTENSION:if(!(0,y.isInterfaceType)(e))throw new f.GraphQLError('Cannot extend non-interface type "'.concat(e.name,'".'),[t]);break;case b.Kind.ENUM_TYPE_EXTENSION:if(!(0,y.isEnumType)(e))throw new f.GraphQLError('Cannot extend non-enum type "'.concat(e.name,'".'),[t]);break;case b.Kind.UNION_TYPE_EXTENSION:if(!(0,y.isUnionType)(e))throw new f.GraphQLError('Cannot extend non-union type "'.concat(e.name,'".'),[t]);break;case b.Kind.INPUT_OBJECT_TYPE_EXTENSION:if(!(0,y.isInputObjectType)(e))throw new f.GraphQLError('Cannot extend non-input object type "'.concat(e.name,'".'),[t])}}Object.defineProperty(r,"__esModule",{value:!0}),r.extendSchema=function(e,t,r){function n(e){return e?o(e):null}function o(e){if((0,m.isIntrospectionType)(e)||(0,v.isSpecifiedScalarType)(e))return e;var t=e.name;return Q[t]||((0,y.isScalarType)(e)?Q[t]=O(e):(0,y.isObjectType)(e)?Q[t]=M(e):(0,y.isInterfaceType)(e)?Q[t]=j(e):(0,y.isUnionType)(e)?Q[t]=P(e):(0,y.isEnumType)(e)?Q[t]=T(e):(0,y.isInputObjectType)(e)&&(Q[t]=w(e))),Q[t]}function x(e){return new g.GraphQLDirective({name:e.name,description:e.description,locations:e.locations,args:C(e.args),astNode:e.astNode})}function w(e){var t=e.name,r=D[t]?e.extensionASTNodes?e.extensionASTNodes.concat(D[t]):D[t]:e.extensionASTNodes;return new y.GraphQLInputObjectType({name:t,description:e.description,fields:function(){return S(e)},astNode:e.astNode,extensionASTNodes:r})}function S(e){for(var t=Object.create(null),r=e.getFields(),n=Object.keys(r),i=0;i<n.length;i++){var o=n[i],a=r[o];t[o]={description:a.description,type:I(a.type),defaultValue:a.defaultValue,astNode:a.astNode}}var s=D[e.name];if(s){var u=!0,c=!1,l=void 0;try{for(var h,p=s[Symbol.iterator]();!(u=(h=p.next()).done);u=!0){var d=h.value,m=!0,v=!1,y=void 0;try{for(var g,b=d.fields[Symbol.iterator]();!(m=(g=b.next()).done);m=!0){var _=g.value,x=_.name.value;if(r[x])throw new f.GraphQLError('Field "'.concat(e.name,".").concat(x,'" already exists in the ')+"schema. It cannot also be defined in this type extension.",[_]);t[x]=W.buildInputField(_)}}catch(e){v=!0,y=e}finally{try{m||null==b.return||b.return()}finally{if(v)throw y}}}}catch(e){c=!0,l=e}finally{try{u||null==p.return||p.return()}finally{if(c)throw l}}}return t}function T(e){var t=e.name,r=D[t]?e.extensionASTNodes?e.extensionASTNodes.concat(D[t]):D[t]:e.extensionASTNodes;return new y.GraphQLEnumType({name:t,description:e.description,values:E(e),astNode:e.astNode,extensionASTNodes:r})}function E(e){for(var t=Object.create(null),r=(0,u.default)(e.getValues(),function(e){return e.name}),n=Object.keys(r),i=0;i<n.length;i++){var o=n[i],a=r[o];t[o]={name:a.name,description:a.description,value:a.value,deprecationReason:a.deprecationReason,astNode:a.astNode}}var s=D[e.name];if(s){var c=!0,l=!1,h=void 0;try{for(var p,d=s[Symbol.iterator]();!(c=(p=d.next()).done);c=!0){var m=p.value,v=!0,y=!1,g=void 0;try{for(var b,_=m.values[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value,w=x.name.value;if(r[w])throw new f.GraphQLError('Enum value "'.concat(e.name,".").concat(w,'" already exists in the ')+"schema. It cannot also be defined in this type extension.",[x]);t[w]=W.buildEnumValue(x)}}catch(e){y=!0,g=e}finally{try{v||null==_.return||_.return()}finally{if(y)throw g}}}}catch(e){l=!0,h=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw h}}}return t}function O(e){var t=e.name,r=D[t]?e.extensionASTNodes?e.extensionASTNodes.concat(D[t]):D[t]:e.extensionASTNodes;return new y.GraphQLScalarType({name:t,description:e.description,astNode:e.astNode,extensionASTNodes:r,serialize:e.serialize,parseValue:e.parseValue,parseLiteral:e.parseLiteral})}function M(e){var t=e.name,r=D[t]?e.extensionASTNodes?e.extensionASTNodes.concat(D[t]):D[t]:e.extensionASTNodes;return new y.GraphQLObjectType({name:t,description:e.description,interfaces:function(){return N(e)},fields:function(){return L(e)},astNode:e.astNode,extensionASTNodes:r,isTypeOf:e.isTypeOf})}function C(e){return(0,c.default)(e,function(e){return e.name},function(e){return{type:I(e.type),defaultValue:e.defaultValue,description:e.description,astNode:e.astNode}})}function j(e){var t=e.name,r=D[t]?e.extensionASTNodes?e.extensionASTNodes.concat(D[t]):D[t]:e.extensionASTNodes;return new y.GraphQLInterfaceType({name:e.name,description:e.description,fields:function(){return L(e)},astNode:e.astNode,extensionASTNodes:r,resolveType:e.resolveType})}function P(e){var t=e.name,r=D[t]?e.extensionASTNodes?e.extensionASTNodes.concat(D[t]):D[t]:e.extensionASTNodes;return new y.GraphQLUnionType({name:t,description:e.description,types:function(){return A(e)},astNode:e.astNode,resolveType:e.resolveType,extensionASTNodes:r})}function A(e){var t=e.getTypes().map(o),r=D[e.name];if(r){var n=!0,i=!1,a=void 0;try{for(var s,u=r[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){var c=s.value,l=!0,h=!1,p=void 0;try{for(var f,d=c.types[Symbol.iterator]();!(l=(f=d.next()).done);l=!0){var m=f.value;t.push(W.buildType(m))}}catch(e){h=!0,p=e}finally{try{l||null==d.return||d.return()}finally{if(h)throw p}}}}catch(e){i=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(i)throw a}}}return t}function N(e){var t=e.getInterfaces().map(o),r=D[e.name];if(r){var n=!0,i=!1,a=void 0;try{for(var s,u=r[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){var c=s.value,l=!0,h=!1,p=void 0;try{for(var f,d=c.interfaces[Symbol.iterator]();!(l=(f=d.next()).done);l=!0){var m=f.value;t.push(W.buildType(m))}}catch(e){h=!0,p=e}finally{try{l||null==d.return||d.return()}finally{if(h)throw p}}}}catch(e){i=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(i)throw a}}}return t}function L(e){for(var t=Object.create(null),r=e.getFields(),n=Object.keys(r),i=0;i<n.length;i++){var o=n[i],a=r[o];t[o]={description:a.description,deprecationReason:a.deprecationReason,type:I(a.type),args:C(a.args),astNode:a.astNode,resolve:a.resolve}}var s=D[e.name];if(s){var u=!0,c=!1,l=void 0;try{for(var h,p=s[Symbol.iterator]();!(u=(h=p.next()).done);u=!0){var d=h.value,m=!0,v=!1,y=void 0;try{for(var g,b=d.fields[Symbol.iterator]();!(m=(g=b.next()).done);m=!0){var _=g.value,x=_.name.value;if(r[x])throw new f.GraphQLError('Field "'.concat(e.name,".").concat(x,'" already exists in the ')+"schema. It cannot also be defined in this type extension.",[_]);t[x]=W.buildField(_)}}catch(e){v=!0,y=e}finally{try{m||null==b.return||b.return()}finally{if(v)throw y}}}}catch(e){c=!0,l=e}finally{try{u||null==p.return||p.return()}finally{if(c)throw l}}}return t}function I(e){return(0,y.isListType)(e)?(0,y.GraphQLList)(I(e.ofType)):(0,y.isNonNullType)(e)?(0,y.GraphQLNonNull)(I(e.ofType)):o(e)}(0,d.isSchema)(e)||(0,s.default)(0,"Must provide valid GraphQLSchema"),t&&t.kind===b.Kind.DOCUMENT||(0,s.default)(0,"Must provide valid Document AST"),r&&(r.assumeValid||r.assumeValidSDL)||(0,p.assertValidSDLExtension)(t,e);for(var R,k=Object.create(null),D=Object.create(null),F=[],V=[],B=0;B<t.definitions.length;B++){var U=t.definitions[B];if(U.kind===b.Kind.SCHEMA_DEFINITION)R=U;else if(U.kind===b.Kind.SCHEMA_EXTENSION)V.push(U);else if((0,_.isTypeDefinitionNode)(U)){var G=U.name.value;if(e.getType(G))throw new f.GraphQLError('Type "'.concat(G,'" already exists in the schema. It cannot also ')+"be defined in this type definition.",[U]);k[G]=U}else if((0,_.isTypeExtensionNode)(U)){var z=U.name.value,q=e.getType(z);if(!q)throw new f.GraphQLError('Cannot extend type "'.concat(z,'" because it does not ')+"exist in the existing schema.",[U]);a(q,U);var $=D[z];D[z]=$?$.concat([U]):[U]}else if(U.kind===b.Kind.DIRECTIVE_DEFINITION){var H=U.name.value;if(e.getDirective(H))throw new f.GraphQLError('Directive "'.concat(H,'" already exists in the schema. It ')+"cannot be redefined.",[U]);F.push(U)}}if(0===Object.keys(D).length&&0===Object.keys(k).length&&0===F.length&&0===V.length&&!R)return e;var W=new h.ASTDefinitionBuilder(k,r,function(t){var r=t.name.value,n=e.getType(r);if(n)return o(n);throw new f.GraphQLError('Unknown type: "'.concat(r,'". Ensure that this type exists ')+"either in the original schema, or is added in a type definition.",[t])}),Q=Object.create(null),K={query:n(e.getQueryType()),mutation:n(e.getMutationType()),subscription:n(e.getSubscriptionType())};if(R){var X=!0,Y=!1,Z=void 0;try{for(var J,ee=R.operationTypes[Symbol.iterator]();!(X=(J=ee.next()).done);X=!0){var te=J.value,re=te.operation,ne=te.type;if(K[re])throw new Error("Must provide only one ".concat(re," type in schema."));K[re]=W.buildType(ne)}}catch(e){Y=!0,Z=e}finally{try{X||null==ee.return||ee.return()}finally{if(Y)throw Z}}}for(var ie=0;ie<V.length;ie++){var oe=V[ie];if(oe.operationTypes){var ae=!0,se=!1,ue=void 0;try{for(var ce,le=oe.operationTypes[Symbol.iterator]();!(ae=(ce=le.next()).done);ae=!0){var he=ce.value,re=he.operation,ne=he.type;if(K[re])throw new Error("Must provide only one ".concat(re," type in schema."));K[re]=W.buildType(ne)}}catch(e){se=!0,ue=e}finally{try{ae||null==le.return||le.return()}finally{if(se)throw ue}}}}var pe=V?e.extensionASTNodes?e.extensionASTNodes.concat(V):V:e.extensionASTNodes,fe=(0,l.default)(e.getTypeMap()).map(function(e){return o(e)}).concat((0,l.default)(k).map(function(e){return W.buildType(e)})),de=e.__allowedLegacyNames.concat(r&&r.allowedLegacyNames||[]);return new d.GraphQLSchema(i({},K,{types:fe,directives:function(){var t=e.getDirectives().map(x);return t||(0,s.default)(0,"schema must have default directives"),t.concat(F.map(function(e){return W.buildDirective(e)}))}(),astNode:e.astNode,extensionASTNodes:pe,allowedLegacyNames:de}))};var s=n(e("../jsutils/invariant")),u=n(e("../jsutils/keyMap")),c=n(e("../jsutils/keyValMap")),l=n(e("../jsutils/objectValues")),h=e("./buildASTSchema"),p=e("../validation/validate"),f=e("../error/GraphQLError"),d=e("../type/schema"),m=e("../type/introspection"),v=e("../type/scalars"),y=e("../type/definition"),g=e("../type/directives"),b=e("../language/kinds"),_=e("../language/predicates")},{"../error/GraphQLError":32,"../jsutils/invariant":48,"../jsutils/keyMap":54,"../jsutils/keyValMap":55,"../jsutils/objectValues":57,"../language/kinds":66,"../language/predicates":70,"../type/definition":77,"../type/directives":78,"../type/introspection":80,"../type/scalars":81,"../type/schema":82,"../validation/validate":138,"./buildASTSchema":87}],92:[function(e,t,r){"use strict";function n(e,t){for(var r=e.getTypeMap(),n=t.getTypeMap(),i=[],o=Object.keys(r),a=0;a<o.length;a++){var s=o[a];n[s]||i.push({type:C.TYPE_REMOVED,description:"".concat(s," was removed.")})}return i}function i(e,t){for(var r=e.getTypeMap(),n=t.getTypeMap(),i=[],o=Object.keys(r),s=0;s<o.length;s++){var u=o[s];if(n[u]){var c=r[u],l=n[u];c.constructor!==l.constructor&&i.push({type:C.TYPE_CHANGED_KIND,description:"".concat(u," changed from ")+"".concat(a(c)," to ").concat(a(l),".")})}}return i}function o(e,t){for(var r=e.getTypeMap(),n=t.getTypeMap(),i=[],o=[],a=Object.keys(r),s=0;s<a.length;s++){var u=a[s],c=r[u],h=n[u];if(((0,O.isObjectType)(c)||(0,O.isInterfaceType)(c))&&((0,O.isObjectType)(h)||(0,O.isInterfaceType)(h))&&h.constructor===c.constructor)for(var p=c.getFields(),f=h.getFields(),d=Object.keys(p),m=0;m<d.length;m++){var v=d[m];if(f[v]){var y=!0,g=!1,b=void 0;try{for(var _,x=p[v].args[Symbol.iterator]();!(y=(_=x.next()).done);y=!0)!function(){var e=_.value,t=f[v].args.find(function(t){return t.name===e.name});t?l(e.type,t.type)?void 0!==e.defaultValue&&e.defaultValue!==t.defaultValue&&o.push({type:j.ARG_DEFAULT_VALUE_CHANGE,description:"".concat(c.name,".").concat(v," arg ")+"".concat(e.name," has changed defaultValue")}):i.push({type:C.ARG_CHANGED_KIND,description:"".concat(c.name,".").concat(v," arg ")+"".concat(e.name," has changed type from ")+"".concat(e.type.toString()," to ").concat(t.type.toString())}):i.push({type:C.ARG_REMOVED,description:"".concat(c.name,".").concat(v," arg ")+"".concat(e.name," was removed")})}()}catch(e){g=!0,b=e}finally{try{y||null==x.return||x.return()}finally{if(g)throw b}}var w=!0,S=!1,T=void 0;try{for(var E,M=f[v].args[Symbol.iterator]();!(w=(E=M.next()).done);w=!0)!function(){var e=E.value;if(!p[v].args.find(function(t){return t.name===e.name})){var t=e.name;(0,O.isRequiredArgument)(e)?i.push({type:C.REQUIRED_ARG_ADDED,description:"A required arg ".concat(t," on ")+"".concat(u,".").concat(v," was added")}):o.push({type:j.OPTIONAL_ARG_ADDED,description:"An optional arg ".concat(t," on ")+"".concat(u,".").concat(v," was added")})}}()}catch(e){S=!0,T=e}finally{try{w||null==M.return||M.return()}finally{if(S)throw T}}}}}return{breakingChanges:i,dangerousChanges:o}}function a(e){if((0,O.isScalarType)(e))return"a Scalar type";if((0,O.isObjectType)(e))return"an Object type";if((0,O.isInterfaceType)(e))return"an Interface type";if((0,O.isUnionType)(e))return"a Union type";if((0,O.isEnumType)(e))return"an Enum type";if((0,O.isInputObjectType)(e))return"an Input type";throw new TypeError("Unknown type "+e.constructor.name)}function s(e,t){for(var r=e.getTypeMap(),n=t.getTypeMap(),i=[],o=Object.keys(r),a=0;a<o.length;a++){var s=o[a],u=r[s],l=n[s];if(((0,O.isObjectType)(u)||(0,O.isInterfaceType)(u))&&((0,O.isObjectType)(l)||(0,O.isInterfaceType)(l))&&l.constructor===u.constructor)for(var h=u.getFields(),p=l.getFields(),f=Object.keys(h),d=0;d<f.length;d++){var m=f[d];if(m in p){var v=h[m].type,y=p[m].type;if(!c(v,y)){var g=(0,O.isNamedType)(v)?v.name:v.toString(),b=(0,O.isNamedType)(y)?y.name:y.toString();i.push({type:C.FIELD_CHANGED_KIND,description:"".concat(s,".").concat(m," changed type from ")+"".concat(g," to ").concat(b,".")})}}else i.push({type:C.FIELD_REMOVED,description:"".concat(s,".").concat(m," was removed.")})}}return i}function u(e,t){for(var r=e.getTypeMap(),n=t.getTypeMap(),i=[],o=[],a=Object.keys(r),s=0;s<a.length;s++){var u=a[s],c=r[u],h=n[u];if((0,O.isInputObjectType)(c)&&(0,O.isInputObjectType)(h)){for(var p=c.getFields(),f=h.getFields(),d=Object.keys(p),m=0;m<d.length;m++){var v=d[m];if(v in f){var y=p[v].type,g=f[v].type;if(!l(y,g)){var b=(0,O.isNamedType)(y)?y.name:y.toString(),_=(0,O.isNamedType)(g)?g.name:g.toString();i.push({type:C.FIELD_CHANGED_KIND,description:"".concat(u,".").concat(v," changed type from ")+"".concat(b," to ").concat(_,".")})}}else i.push({type:C.FIELD_REMOVED,description:"".concat(u,".").concat(v," was removed.")})}for(var x=Object.keys(f),w=0;w<x.length;w++){var S=x[w];S in p||((0,O.isRequiredInputField)(f[S])?i.push({type:C.REQUIRED_INPUT_FIELD_ADDED,description:"A required field ".concat(S," on ")+"input type ".concat(u," was added.")}):o.push({type:j.OPTIONAL_INPUT_FIELD_ADDED,description:"An optional field ".concat(S," on ")+"input type ".concat(u," was added.")}))}}}return{breakingChanges:i,dangerousChanges:o}}function c(e,t){return(0,O.isNamedType)(e)?(0,O.isNamedType)(t)&&e.name===t.name||(0,O.isNonNullType)(t)&&c(e,t.ofType):(0,O.isListType)(e)?(0,O.isListType)(t)&&c(e.ofType,t.ofType)||(0,O.isNonNullType)(t)&&c(e,t.ofType):!!(0,O.isNonNullType)(e)&&((0,O.isNonNullType)(t)&&c(e.ofType,t.ofType))}function l(e,t){return(0,O.isNamedType)(e)?(0,O.isNamedType)(t)&&e.name===t.name:(0,O.isListType)(e)?(0,O.isListType)(t)&&l(e.ofType,t.ofType):!!(0,O.isNonNullType)(e)&&((0,O.isNonNullType)(t)&&l(e.ofType,t.ofType)||!(0,O.isNonNullType)(t)&&l(e.ofType,t))}function h(e,t){for(var r=e.getTypeMap(),n=t.getTypeMap(),i=[],o=Object.keys(r),a=0;a<o.length;a++){var s=o[a],u=r[s],c=n[s];if((0,O.isUnionType)(u)&&(0,O.isUnionType)(c)){var l=Object.create(null),h=!0,p=!1,f=void 0;try{for(var d,m=c.getTypes()[Symbol.iterator]();!(h=(d=m.next()).done);h=!0)l[d.value.name]=!0}catch(e){p=!0,f=e}finally{try{h||null==m.return||m.return()}finally{if(p)throw f}}var v=!0,y=!1,g=void 0;try{for(var b,_=u.getTypes()[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;l[x.name]||i.push({type:C.TYPE_REMOVED_FROM_UNION,description:"".concat(x.name," was removed from union type ").concat(s,".")})}}catch(e){y=!0,g=e}finally{try{v||null==_.return||_.return()}finally{if(y)throw g}}}}return i}function p(e,t){for(var r=e.getTypeMap(),n=t.getTypeMap(),i=[],o=Object.keys(n),a=0;a<o.length;a++){var s=o[a],u=r[s],c=n[s];if((0,O.isUnionType)(u)&&(0,O.isUnionType)(c)){var l=Object.create(null),h=!0,p=!1,f=void 0;try{for(var d,m=u.getTypes()[Symbol.iterator]();!(h=(d=m.next()).done);h=!0)l[d.value.name]=!0}catch(e){p=!0,f=e}finally{try{h||null==m.return||m.return()}finally{if(p)throw f}}var v=!0,y=!1,g=void 0;try{for(var b,_=c.getTypes()[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;l[x.name]||i.push({type:j.TYPE_ADDED_TO_UNION,description:"".concat(x.name," was added to union type ").concat(s,".")})}}catch(e){y=!0,g=e}finally{try{v||null==_.return||_.return()}finally{if(y)throw g}}}}return i}function f(e,t){for(var r=e.getTypeMap(),n=t.getTypeMap(),i=[],o=Object.keys(r),a=0;a<o.length;a++){var s=o[a],u=r[s],c=n[s];if((0,O.isEnumType)(u)&&(0,O.isEnumType)(c)){var l=Object.create(null),h=!0,p=!1,f=void 0;try{for(var d,m=c.getValues()[Symbol.iterator]();!(h=(d=m.next()).done);h=!0)l[d.value.name]=!0}catch(e){p=!0,f=e}finally{try{h||null==m.return||m.return()}finally{if(p)throw f}}var v=!0,y=!1,g=void 0;try{for(var b,_=u.getValues()[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;l[x.name]||i.push({type:C.VALUE_REMOVED_FROM_ENUM,description:"".concat(x.name," was removed from enum type ").concat(s,".")})}}catch(e){y=!0,g=e}finally{try{v||null==_.return||_.return()}finally{if(y)throw g}}}}return i}function d(e,t){for(var r=e.getTypeMap(),n=t.getTypeMap(),i=[],o=Object.keys(r),a=0;a<o.length;a++){var s=o[a],u=r[s],c=n[s];if((0,O.isEnumType)(u)&&(0,O.isEnumType)(c)){var l=Object.create(null),h=!0,p=!1,f=void 0;try{for(var d,m=u.getValues()[Symbol.iterator]();!(h=(d=m.next()).done);h=!0)l[d.value.name]=!0}catch(e){p=!0,f=e}finally{try{h||null==m.return||m.return()}finally{if(p)throw f}}var v=!0,y=!1,g=void 0;try{for(var b,_=c.getValues()[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;l[x.name]||i.push({type:j.VALUE_ADDED_TO_ENUM,description:"".concat(x.name," was added to enum type ").concat(s,".")})}}catch(e){y=!0,g=e}finally{try{v||null==_.return||_.return()}finally{if(y)throw g}}}}return i}function m(e,t){for(var r=e.getTypeMap(),n=t.getTypeMap(),i=[],o=Object.keys(r),a=0;a<o.length;a++){var s=o[a],u=r[s],c=n[s];if((0,O.isObjectType)(u)&&(0,O.isObjectType)(c)){var l=u.getInterfaces(),h=c.getInterfaces(),p=!0,f=!1,d=void 0;try{for(var m,v=l[Symbol.iterator]();!(p=(m=v.next()).done);p=!0)!function(){var e=m.value;h.some(function(t){return t.name===e.name})||i.push({type:C.INTERFACE_REMOVED_FROM_OBJECT,description:"".concat(s," no longer implements interface ")+"".concat(e.name,".")})}()}catch(e){f=!0,d=e}finally{try{p||null==v.return||v.return()}finally{if(f)throw d}}}}return i}function v(e,t){for(var r=e.getTypeMap(),n=t.getTypeMap(),i=[],o=Object.keys(n),a=0;a<o.length;a++){var s=o[a],u=r[s],c=n[s];if((0,O.isObjectType)(u)&&(0,O.isObjectType)(c)){var l=u.getInterfaces(),h=c.getInterfaces(),p=!0,f=!1,d=void 0;try{for(var m,v=h[Symbol.iterator]();!(p=(m=v.next()).done);p=!0)!function(){var e=m.value;l.some(function(t){return t.name===e.name})||i.push({type:j.INTERFACE_ADDED_TO_OBJECT,description:"".concat(e.name," added to interfaces implemented ")+"by ".concat(s,".")})}()}catch(e){f=!0,d=e}finally{try{p||null==v.return||v.return()}finally{if(f)throw d}}}}return i}function y(e,t){var r=[],n=T(t),i=!0,o=!1,a=void 0;try{for(var s,u=e.getDirectives()[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;n[c.name]||r.push({type:C.DIRECTIVE_REMOVED,description:"".concat(c.name," was removed")})}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return r}function g(e,t){var r=[],n=E(t),i=!0,o=!1,a=void 0;try{for(var s,u=e.args[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;n[c.name]||r.push(c)}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return r}function b(e,t){var r=[],n=T(e),i=!0,o=!1,a=void 0;try{for(var s,u=t.getDirectives()[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value,l=n[c.name];if(l){var h=!0,p=!1,f=void 0;try{for(var d,m=g(l,c)[Symbol.iterator]();!(h=(d=m.next()).done);h=!0){var v=d.value;r.push({type:C.DIRECTIVE_ARG_REMOVED,description:"".concat(v.name," was removed from ").concat(c.name)})}}catch(e){p=!0,f=e}finally{try{h||null==m.return||m.return()}finally{if(p)throw f}}}}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return r}function _(e,t){var r=[],n=E(e),i=!0,o=!1,a=void 0;try{for(var s,u=t.args[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;n[c.name]||r.push(c)}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return r}function x(e,t){var r=[],n=T(e),i=!0,o=!1,a=void 0;try{for(var s,u=t.getDirectives()[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value,l=n[c.name];if(l){var h=!0,p=!1,f=void 0;try{for(var d,m=_(l,c)[Symbol.iterator]();!(h=(d=m.next()).done);h=!0){var v=d.value;(0,O.isRequiredArgument)(v)&&r.push({type:C.REQUIRED_DIRECTIVE_ARG_ADDED,description:"A required arg ".concat(v.name," on directive ")+"".concat(c.name," was added")})}}catch(e){p=!0,f=e}finally{try{h||null==m.return||m.return()}finally{if(p)throw f}}}}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return r}function w(e,t){var r=[],n=new Set(t.locations),i=!0,o=!1,a=void 0;try{for(var s,u=e.locations[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;n.has(c)||r.push(c)}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return r}function S(e,t){var r=[],n=T(e),i=!0,o=!1,a=void 0;try{for(var s,u=t.getDirectives()[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value,l=n[c.name];if(l){var h=!0,p=!1,f=void 0;try{for(var d,m=w(l,c)[Symbol.iterator]();!(h=(d=m.next()).done);h=!0){var v=d.value;r.push({type:C.DIRECTIVE_LOCATION_REMOVED,description:"".concat(v," was removed from ").concat(c.name)})}}catch(e){p=!0,f=e}finally{try{h||null==m.return||m.return()}finally{if(p)throw f}}}}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return r}function T(e){return(0,M.default)(e.getDirectives(),function(e){return e.name})}function E(e){return(0,M.default)(e.args,function(e){return e.name})}Object.defineProperty(r,"__esModule",{value:!0}),r.findBreakingChanges=function(e,t){return n(e,t).concat(i(e,t),s(e,t),u(e,t).breakingChanges,h(e,t),f(e,t),o(e,t).breakingChanges,m(e,t),y(e,t),b(e,t),x(e,t),S(e,t))},r.findDangerousChanges=function(e,t){return o(e,t).dangerousChanges.concat(d(e,t),v(e,t),p(e,t),u(e,t).dangerousChanges)},r.findRemovedTypes=n,r.findTypesThatChangedKind=i,r.findArgChanges=o,r.findFieldsThatChangedTypeOnObjectOrInterfaceTypes=s,r.findFieldsThatChangedTypeOnInputObjectTypes=u,r.findTypesRemovedFromUnions=h,r.findTypesAddedToUnions=p,r.findValuesRemovedFromEnums=f,r.findValuesAddedToEnums=d,r.findInterfacesRemovedFromObjectTypes=m,r.findInterfacesAddedToObjectTypes=v,r.findRemovedDirectives=y,r.findRemovedDirectiveArgs=b,r.findAddedNonNullDirectiveArgs=x,r.findRemovedLocationsForDirective=w,r.findRemovedDirectiveLocations=S,r.DangerousChangeType=r.BreakingChangeType=void 0;var O=e("../type/definition"),M=function(e){return e&&e.__esModule?e:{default:e}}(e("../jsutils/keyMap")),C={FIELD_CHANGED_KIND:"FIELD_CHANGED_KIND",FIELD_REMOVED:"FIELD_REMOVED",TYPE_CHANGED_KIND:"TYPE_CHANGED_KIND",TYPE_REMOVED:"TYPE_REMOVED",TYPE_REMOVED_FROM_UNION:"TYPE_REMOVED_FROM_UNION",VALUE_REMOVED_FROM_ENUM:"VALUE_REMOVED_FROM_ENUM",ARG_REMOVED:"ARG_REMOVED",ARG_CHANGED_KIND:"ARG_CHANGED_KIND",REQUIRED_ARG_ADDED:"REQUIRED_ARG_ADDED",REQUIRED_INPUT_FIELD_ADDED:"REQUIRED_INPUT_FIELD_ADDED",INTERFACE_REMOVED_FROM_OBJECT:"INTERFACE_REMOVED_FROM_OBJECT",DIRECTIVE_REMOVED:"DIRECTIVE_REMOVED",DIRECTIVE_ARG_REMOVED:"DIRECTIVE_ARG_REMOVED",DIRECTIVE_LOCATION_REMOVED:"DIRECTIVE_LOCATION_REMOVED",REQUIRED_DIRECTIVE_ARG_ADDED:"REQUIRED_DIRECTIVE_ARG_ADDED"};r.BreakingChangeType=C;var j={ARG_DEFAULT_VALUE_CHANGE:"ARG_DEFAULT_VALUE_CHANGE",VALUE_ADDED_TO_ENUM:"VALUE_ADDED_TO_ENUM",INTERFACE_ADDED_TO_OBJECT:"INTERFACE_ADDED_TO_OBJECT",TYPE_ADDED_TO_UNION:"TYPE_ADDED_TO_UNION",OPTIONAL_INPUT_FIELD_ADDED:"OPTIONAL_INPUT_FIELD_ADDED",OPTIONAL_ARG_ADDED:"OPTIONAL_ARG_ADDED"};r.DangerousChangeType=j},{"../jsutils/keyMap":54,"../type/definition":77}],93:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.findDeprecatedUsages=function(e,t){var r=[],s=new a.TypeInfo(e);return(0,i.visit)(t,(0,i.visitWithTypeInfo)(s,{Field:function(e){var t=s.getFieldDef();if(t&&t.isDeprecated){var i=s.getParentType();if(i){var o=t.deprecationReason;r.push(new n.GraphQLError("The field ".concat(i.name,".").concat(t.name," is deprecated.")+(o?" "+o:""),[e]))}}},EnumValue:function(e){var t=s.getEnumValue();if(t&&t.isDeprecated){var i=(0,o.getNamedType)(s.getInputType());if(i){var a=t.deprecationReason;r.push(new n.GraphQLError("The enum value ".concat(i.name,".").concat(t.name," is deprecated.")+(a?" "+a:""),[e]))}}}})),r};var n=e("../error/GraphQLError"),i=e("../language/visitor"),o=e("../type/definition"),a=e("./TypeInfo")},{"../error/GraphQLError":32,"../language/visitor":73,"../type/definition":77,"./TypeInfo":84}],94:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getOperationAST=function(e,t){for(var r=null,i=0;i<e.definitions.length;i++){var o=e.definitions[i];if(o.kind===n.Kind.OPERATION_DEFINITION)if(t){if(o.name&&o.name.value===t)return o}else{if(r)return null;r=o}}return r};var n=e("../language/kinds")},{"../language/kinds":66}],95:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getOperationRootType=function(e,t){switch(t.operation){case"query":var r=e.getQueryType();if(!r)throw new n.GraphQLError("Schema does not define the required query root type.",[t]);return r;case"mutation":var i=e.getMutationType();if(!i)throw new n.GraphQLError("Schema is not configured for mutations.",[t]);return i;case"subscription":var o=e.getSubscriptionType();if(!o)throw new n.GraphQLError("Schema is not configured for subscriptions.",[t]);return o;default:throw new n.GraphQLError("Can only have query, mutation and subscription operations.",[t])}};var n=e("../error/GraphQLError")},{"../error/GraphQLError":32}],96:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getIntrospectionQuery",{enumerable:!0,get:function(){return n.getIntrospectionQuery}}),Object.defineProperty(r,"introspectionQuery",{enumerable:!0,get:function(){return n.introspectionQuery}}),Object.defineProperty(r,"getOperationAST",{enumerable:!0,get:function(){return i.getOperationAST}}),Object.defineProperty(r,"getOperationRootType",{enumerable:!0,get:function(){return o.getOperationRootType}}),Object.defineProperty(r,"introspectionFromSchema",{enumerable:!0,get:function(){return a.introspectionFromSchema}}),Object.defineProperty(r,"buildClientSchema",{enumerable:!0,get:function(){return s.buildClientSchema}}),Object.defineProperty(r,"buildASTSchema",{enumerable:!0,get:function(){return u.buildASTSchema}}),Object.defineProperty(r,"buildSchema",{enumerable:!0,get:function(){return u.buildSchema}}),Object.defineProperty(r,"getDescription",{enumerable:!0,get:function(){return u.getDescription}}),Object.defineProperty(r,"extendSchema",{enumerable:!0,get:function(){return c.extendSchema}}),Object.defineProperty(r,"lexicographicSortSchema",{enumerable:!0,get:function(){return l.lexicographicSortSchema}}),Object.defineProperty(r,"printSchema",{enumerable:!0,get:function(){return h.printSchema}}),Object.defineProperty(r,"printType",{enumerable:!0,get:function(){return h.printType}}),Object.defineProperty(r,"printIntrospectionSchema",{enumerable:!0,get:function(){return h.printIntrospectionSchema}}),Object.defineProperty(r,"typeFromAST",{enumerable:!0,get:function(){return p.typeFromAST}}),Object.defineProperty(r,"valueFromAST",{enumerable:!0,get:function(){return f.valueFromAST}}),Object.defineProperty(r,"valueFromASTUntyped",{enumerable:!0,get:function(){return d.valueFromASTUntyped}}),Object.defineProperty(r,"astFromValue",{enumerable:!0,get:function(){return m.astFromValue}}),Object.defineProperty(r,"TypeInfo",{enumerable:!0,get:function(){return v.TypeInfo}}),Object.defineProperty(r,"coerceValue",{enumerable:!0,get:function(){return y.coerceValue}}),Object.defineProperty(r,"isValidJSValue",{enumerable:!0,get:function(){return g.isValidJSValue}}),Object.defineProperty(r,"isValidLiteralValue",{enumerable:!0,get:function(){return b.isValidLiteralValue}}),Object.defineProperty(r,"concatAST",{enumerable:!0,get:function(){return _.concatAST}}),Object.defineProperty(r,"separateOperations",{enumerable:!0,get:function(){return x.separateOperations}}),Object.defineProperty(r,"isEqualType",{enumerable:!0,get:function(){return w.isEqualType}}),Object.defineProperty(r,"isTypeSubTypeOf",{enumerable:!0,get:function(){return w.isTypeSubTypeOf}}),Object.defineProperty(r,"doTypesOverlap",{enumerable:!0,get:function(){return w.doTypesOverlap}}),Object.defineProperty(r,"assertValidName",{enumerable:!0,get:function(){return S.assertValidName}}),Object.defineProperty(r,"isValidNameError",{enumerable:!0,get:function(){return S.isValidNameError}}),Object.defineProperty(r,"BreakingChangeType",{enumerable:!0,get:function(){return T.BreakingChangeType}}),Object.defineProperty(r,"DangerousChangeType",{enumerable:!0,get:function(){return T.DangerousChangeType}}),Object.defineProperty(r,"findBreakingChanges",{enumerable:!0,get:function(){return T.findBreakingChanges}}),Object.defineProperty(r,"findDangerousChanges",{enumerable:!0,get:function(){return T.findDangerousChanges}}),Object.defineProperty(r,"findDeprecatedUsages",{enumerable:!0,get:function(){return E.findDeprecatedUsages}});var n=e("./introspectionQuery"),i=e("./getOperationAST"),o=e("./getOperationRootType"),a=e("./introspectionFromSchema"),s=e("./buildClientSchema"),u=e("./buildASTSchema"),c=e("./extendSchema"),l=e("./lexicographicSortSchema"),h=e("./schemaPrinter"),p=e("./typeFromAST"),f=e("./valueFromAST"),d=e("./valueFromASTUntyped"),m=e("./astFromValue"),v=e("./TypeInfo"),y=e("./coerceValue"),g=e("./isValidJSValue"),b=e("./isValidLiteralValue"),_=e("./concatAST"),x=e("./separateOperations"),w=e("./typeComparators"),S=e("./assertValidName"),T=e("./findBreakingChanges"),E=e("./findDeprecatedUsages")},{"./TypeInfo":84,"./assertValidName":85,"./astFromValue":86,"./buildASTSchema":87,"./buildClientSchema":88,"./coerceValue":89,"./concatAST":90,"./extendSchema":91,"./findBreakingChanges":92,"./findDeprecatedUsages":93,"./getOperationAST":94,"./getOperationRootType":95,"./introspectionFromSchema":97,"./introspectionQuery":98,"./isValidJSValue":99,"./isValidLiteralValue":100,"./lexicographicSortSchema":101,"./schemaPrinter":102,"./separateOperations":103,"./typeComparators":104,"./typeFromAST":105,"./valueFromAST":106,"./valueFromASTUntyped":107}],97:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.introspectionFromSchema=function(e,t){var r=(0,a.parse)((0,i.getIntrospectionQuery)(t)),s=(0,o.execute)(e,r);return(s.then||s.errors||!s.data)&&(0,n.default)(0),s.data};var n=function(e){return e&&e.__esModule?e:{default:e}}(e("../jsutils/invariant")),i=e("./introspectionQuery"),o=e("../execution/execute"),a=e("../language/parser")},{"../execution/execute":38,"../jsutils/invariant":48,"../language/parser":69,"./introspectionQuery":98}],98:[function(e,t,r){"use strict";function n(e){var t=!(e&&!1===e.descriptions);return"\n query IntrospectionQuery {\n __schema {\n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n ".concat(t?"description":"","\n locations\n args {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n ").concat(t?"description":"","\n fields(includeDeprecated: true) {\n name\n ").concat(t?"description":"","\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n ").concat(t?"description":"","\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n ").concat(t?"description":"","\n type { ...TypeRef }\n defaultValue\n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n ")}Object.defineProperty(r,"__esModule",{value:!0}),r.getIntrospectionQuery=n,r.introspectionQuery=void 0;var i=n();r.introspectionQuery=i},{}],99:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isValidJSValue=function(e,t){var r=(0,n.coerceValue)(e,t).errors;return r?r.map(function(e){return e.message}):[]};var n=e("./coerceValue")},{"./coerceValue":89}],100:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isValidLiteralValue=function(e,t){var r=new a.GraphQLSchema({}),c={kind:i.Kind.DOCUMENT,definitions:[]},l=new n.TypeInfo(r,void 0,e),h=new u.ValidationContext(r,c,l),p=(0,s.ValuesOfCorrectType)(h);return(0,o.visit)(t,(0,o.visitWithTypeInfo)(l,p)),h.getErrors()};var n=e("./TypeInfo"),i=e("../language/kinds"),o=e("../language/visitor"),a=e("../type/schema"),s=e("../validation/rules/ValuesOfCorrectType"),u=e("../validation/ValidationContext")},{"../language/kinds":66,"../language/visitor":73,"../type/schema":82,"../validation/ValidationContext":108,"../validation/rules/ValuesOfCorrectType":134,"./TypeInfo":84}],101:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){o(e,t,r[t])})}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){for(var r=Object.create(null),n=u(Object.keys(e),function(e){return e}),i=0;i<n.length;i++){var o=n[i],a=e[o];r[o]=t?t(a):a}return r}function s(e){return u(e,function(e){return e.name})}function u(e,t){return e.slice().sort(function(e,r){var n=t(e),i=t(r);return n.localeCompare(i)})}Object.defineProperty(r,"__esModule",{value:!0}),r.lexicographicSortSchema=function(e){function t(e){return(0,c.default)(s(e),function(e){return e.name},function(e){return i({},e,{type:o(e.type)})})}function r(e){return a(e,function(e){return{type:o(e.type),args:t(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,description:e.description,astNode:e.astNode}})}function n(e){return a(e,function(e){return{type:o(e.type),defaultValue:e.defaultValue,description:e.description,astNode:e.astNode}})}function o(e){return(0,f.isListType)(e)?new f.GraphQLList(o(e.ofType)):(0,f.isNonNullType)(e)?new f.GraphQLNonNull(o(e.ofType)):y(e)}function v(e){return s(e).map(y)}function y(e){if((0,d.isSpecifiedScalarType)(e)||(0,m.isIntrospectionType)(e))return e;var t=b[e.name];return t||(t=g(e),b[e.name]=t),t}function g(e){if((0,f.isScalarType)(e))return e;if((0,f.isObjectType)(e))return new f.GraphQLObjectType({name:e.name,interfaces:function(){return v(e.getInterfaces())},fields:function(){return r(e.getFields())},isTypeOf:e.isTypeOf,description:e.description,astNode:e.astNode,extensionASTNodes:e.extensionASTNodes});if((0,f.isInterfaceType)(e))return new f.GraphQLInterfaceType({name:e.name,fields:function(){return r(e.getFields())},resolveType:e.resolveType,description:e.description,astNode:e.astNode,extensionASTNodes:e.extensionASTNodes});if((0,f.isUnionType)(e))return new f.GraphQLUnionType({name:e.name,types:function(){return v(e.getTypes())},resolveType:e.resolveType,description:e.description,astNode:e.astNode});if((0,f.isEnumType)(e))return new f.GraphQLEnumType({name:e.name,values:(0,c.default)(s(e.getValues()),function(e){return e.name},function(e){return{value:e.value,deprecationReason:e.deprecationReason,description:e.description,astNode:e.astNode}}),description:e.description,astNode:e.astNode});if((0,f.isInputObjectType)(e))return new f.GraphQLInputObjectType({name:e.name,fields:function(){return n(e.getFields())},description:e.description,astNode:e.astNode});throw new Error('Unknown type: "'.concat(e,'"'))}var b=Object.create(null),_=function(e){return e&&y(e)};return new h.GraphQLSchema({types:v((0,l.default)(e.getTypeMap())),directives:s(e.getDirectives()).map(function(e){return new p.GraphQLDirective({name:e.name,description:e.description,locations:u(e.locations,function(e){return e}),args:t(e.args),astNode:e.astNode})}),query:_(e.getQueryType()),mutation:_(e.getMutationType()),subscription:_(e.getSubscriptionType()),astNode:e.astNode})};var c=n(e("../jsutils/keyValMap")),l=n(e("../jsutils/objectValues")),h=e("../type/schema"),p=e("../type/directives"),f=e("../type/definition"),d=e("../type/scalars"),m=e("../type/introspection")},{"../jsutils/keyValMap":55,"../jsutils/objectValues":57,"../type/definition":77,"../type/directives":78,"../type/introspection":80,"../type/scalars":81,"../type/schema":82}],102:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){return!(0,N.isSpecifiedScalarType)(e)&&!(0,I.isIntrospectionType)(e)}function o(e,t,r,n){var i=e.getDirectives().filter(t),o=e.getTypeMap(),s=(0,C.default)(o).sort(function(e,t){return e.name.localeCompare(t.name)}).filter(r);return[a(e)].concat(i.map(function(e){return b(e,n)}),s.map(function(e){return u(e,n)})).filter(Boolean).join("\n\n")+"\n"}function a(e){if(!s(e)){var t=[],r=e.getQueryType();r&&t.push(" query: ".concat(r.name));var n=e.getMutationType();n&&t.push(" mutation: ".concat(n.name));var i=e.getSubscriptionType();return i&&t.push(" subscription: ".concat(i.name)),"schema {\n".concat(t.join("\n"),"\n}")}}function s(e){var t=e.getQueryType();if(t&&"Query"!==t.name)return!1;var r=e.getMutationType();if(r&&"Mutation"!==r.name)return!1;var n=e.getSubscriptionType();return!n||"Subscription"===n.name}function u(e,t){if((0,A.isScalarType)(e))return c(e,t);if((0,A.isObjectType)(e))return l(e,t);if((0,A.isInterfaceType)(e))return h(e,t);if((0,A.isUnionType)(e))return p(e,t);if((0,A.isEnumType)(e))return f(e,t);if((0,A.isInputObjectType)(e))return m(e,t);throw new Error("Unknown type: ".concat(e,"."))}function c(e,t){return x(t,e)+"scalar ".concat(e.name)}function l(e,t){var r=e.getInterfaces(),n=r.length?" implements "+r.map(function(e){return e.name}).join(" & "):"";return x(t,e)+"type ".concat(e.name).concat(n," {\n")+v(t,e)+"\n}"}function h(e,t){return x(t,e)+"interface ".concat(e.name," {\n")+v(t,e)+"\n}"}function p(e,t){return x(t,e)+"union ".concat(e.name," = ").concat(e.getTypes().join(" | "))}function f(e,t){return x(t,e)+"enum ".concat(e.name," {\n")+d(e.getValues(),t)+"\n}"}function d(e,t){return e.map(function(e,r){return x(t,e," ",!r)+" "+e.name+_(e)}).join("\n")}function m(e,t){var r=(0,C.default)(e.getFields());return x(t,e)+"input ".concat(e.name," {\n")+r.map(function(e,r){return x(t,e," ",!r)+" "+g(e)}).join("\n")+"\n}"}function v(e,t){return(0,C.default)(t.getFields()).map(function(t,r){return x(e,t," ",!r)+" "+t.name+y(e,t.args," ")+": "+String(t.type)+_(t)}).join("\n")}function y(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return 0===t.length?"":t.every(function(e){return!e.description})?"("+t.map(g).join(", ")+")":"(\n"+t.map(function(t,n){return x(e,t," "+r,!n)+" "+r+g(t)}).join("\n")+"\n"+r+")"}function g(e){var t=e.name+": "+String(e.type);return(0,M.default)(e.defaultValue)||(t+=" = ".concat((0,P.print)((0,j.astFromValue)(e.defaultValue,e.type)))),t}function b(e,t){return x(t,e)+"directive @"+e.name+y(t,e.args)+" on "+e.locations.join(" | ")}function _(e){if(!e.isDeprecated)return"";var t=e.deprecationReason;return(0,O.default)(t)||""===t||t===L.DEFAULT_DEPRECATION_REASON?" @deprecated":" @deprecated(reason: "+(0,P.print)((0,j.astFromValue)(t,N.GraphQLString))+")"}function x(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!t.description)return"";var i=T(t.description,120-r.length);if(e&&e.commentDescriptions)return S(i,r,n);var o=r&&!n?"\n"+r+'"""':r+'"""';if(1===i.length&&i[0].length<70&&'"'!==i[0][i[0].length-1])return o+w(i[0])+'"""\n';var a=" "===i[0][0]||"\t"===i[0][0];a||(o+="\n");for(var s=0;s<i.length;s++)0===s&&a||(o+=r),o+=w(i[s])+"\n";return o+=r+'"""\n'}function w(e){return e.replace(/"""/g,'\\"""')}function S(e,t,r){for(var n=t&&!r?"\n":"",i=0;i<e.length;i++)""===e[i]?n+=t+"#\n":n+=t+"# "+e[i]+"\n";return n}function T(e,t){for(var r=[],n=e.split("\n"),i=0;i<n.length;i++)if(""===n[i])r.push(n[i]);else for(var o=E(n[i],t),a=0;a<o.length;a++)r.push(o[a]);return r}function E(e,t){if(e.length<t+5)return[e];var r=e.split(new RegExp("((?: |^).{15,".concat(t-40,"}(?= |$))")));if(r.length<4)return[e];for(var n=[r[0]+r[1]+r[2]],i=3;i<r.length;i+=2)n.push(r[i].slice(1)+r[i+1]);return n}Object.defineProperty(r,"__esModule",{value:!0}),r.printSchema=function(e,t){return o(e,function(e){return!(0,L.isSpecifiedDirective)(e)},i,t)},r.printIntrospectionSchema=function(e,t){return o(e,L.isSpecifiedDirective,I.isIntrospectionType,t)},r.printType=u;var O=n(e("../jsutils/isNullish")),M=n(e("../jsutils/isInvalid")),C=n(e("../jsutils/objectValues")),j=e("../utilities/astFromValue"),P=e("../language/printer"),A=e("../type/definition"),N=e("../type/scalars"),L=e("../type/directives"),I=e("../type/introspection")},{"../jsutils/isInvalid":51,"../jsutils/isNullish":52,"../jsutils/objectValues":57,"../language/printer":71,"../type/definition":77,"../type/directives":78,"../type/introspection":80,"../type/scalars":81,"../utilities/astFromValue":86}],103:[function(e,t,r){"use strict";function n(e){return e.name?e.name.value:""}function i(e,t,r){var n=t[r];if(n)for(var o=Object.keys(n),a=0;a<o.length;a++){var s=o[a];e[s]||(e[s]=!0,i(e,t,s))}}Object.defineProperty(r,"__esModule",{value:!0}),r.separateOperations=function(e){var t,r=[],a=Object.create(null),s=new Map,u=Object.create(null),c=0;(0,o.visit)(e,{OperationDefinition:function(e){t=n(e),r.push(e),s.set(e,c++)},FragmentDefinition:function(e){t=e.name.value,a[t]=e,s.set(e,c++)},FragmentSpread:function(e){var r=e.name.value;(u[t]||(u[t]=Object.create(null)))[r]=!0}});for(var l=Object.create(null),h=0;h<r.length;h++){var p=r[h],f=n(p),d=Object.create(null);i(d,u,f);for(var m=[p],v=Object.keys(d),y=0;y<v.length;y++){var g=v[y];m.push(a[g])}m.sort(function(e,t){return(s.get(e)||0)-(s.get(t)||0)}),l[f]={kind:"Document",definitions:m}}return l};var o=e("../language/visitor")},{"../language/visitor":73}],104:[function(e,t,r){"use strict";function n(e,t){return e===t||((0,o.isNonNullType)(e)&&(0,o.isNonNullType)(t)?n(e.ofType,t.ofType):!(!(0,o.isListType)(e)||!(0,o.isListType)(t))&&n(e.ofType,t.ofType))}function i(e,t,r){return t===r||((0,o.isNonNullType)(r)?!!(0,o.isNonNullType)(t)&&i(e,t.ofType,r.ofType):(0,o.isNonNullType)(t)?i(e,t.ofType,r):(0,o.isListType)(r)?!!(0,o.isListType)(t)&&i(e,t.ofType,r.ofType):!(0,o.isListType)(t)&&!!((0,o.isAbstractType)(r)&&(0,o.isObjectType)(t)&&e.isPossibleType(r,t)))}Object.defineProperty(r,"__esModule",{value:!0}),r.isEqualType=n,r.isTypeSubTypeOf=i,r.doTypesOverlap=function(e,t,r){return t===r||((0,o.isAbstractType)(t)?(0,o.isAbstractType)(r)?e.getPossibleTypes(t).some(function(t){return e.isPossibleType(r,t)}):e.isPossibleType(t,r):!!(0,o.isAbstractType)(r)&&e.isPossibleType(r,t))};var o=e("../type/definition")},{"../type/definition":77}],105:[function(e,t,r){"use strict";function n(e,t){var r;if(t.kind===i.Kind.LIST_TYPE)return(r=n(e,t.type))&&(0,o.GraphQLList)(r);if(t.kind===i.Kind.NON_NULL_TYPE)return(r=n(e,t.type))&&(0,o.GraphQLNonNull)(r);if(t.kind===i.Kind.NAMED_TYPE)return e.getType(t.name.value);throw new Error("Unexpected type kind: ".concat(t.kind,"."))}Object.defineProperty(r,"__esModule",{value:!0}),r.typeFromAST=n;var i=e("../language/kinds"),o=e("../type/definition")},{"../language/kinds":66,"../type/definition":77}],106:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){if(e){if((0,l.isNonNullType)(t)){if(e.kind===c.Kind.NULL)return;return i(e,t.ofType,r)}if(e.kind===c.Kind.NULL)return null;if(e.kind===c.Kind.VARIABLE){var n=e.name.value;if(!r||(0,s.default)(r[n]))return;var h=r[n];if(null===h&&(0,l.isNonNullType)(t))return;return h}if((0,l.isListType)(t)){var p=t.ofType;if(e.kind===c.Kind.LIST){for(var f=[],d=e.values,m=0;m<d.length;m++)if(o(d[m],r)){if((0,l.isNonNullType)(p))return;f.push(null)}else{var v=i(d[m],p,r);if((0,s.default)(v))return;f.push(v)}return f}var y=i(e,p,r);if((0,s.default)(y))return;return[y]}if((0,l.isInputObjectType)(t)){if(e.kind!==c.Kind.OBJECT)return;for(var g=Object.create(null),b=(0,a.default)(e.fields,function(e){return e.name.value}),_=(0,u.default)(t.getFields()),x=0;x<_.length;x++){var w=_[x],S=b[w.name];if(S&&!o(S.value,r)){var T=i(S.value,w.type,r);if((0,s.default)(T))return;g[w.name]=T}else if(void 0!==w.defaultValue)g[w.name]=w.defaultValue;else if((0,l.isNonNullType)(w.type))return}return g}if((0,l.isEnumType)(t)){if(e.kind!==c.Kind.ENUM)return;var E=t.getValue(e.value);if(!E)return;return E.value}if((0,l.isScalarType)(t)){var O;try{O=t.parseLiteral(e,r)}catch(e){return}if((0,s.default)(O))return;return O}throw new Error("Unknown type: ".concat(t,"."))}}function o(e,t){return e.kind===c.Kind.VARIABLE&&(!t||(0,s.default)(t[e.name.value]))}Object.defineProperty(r,"__esModule",{value:!0}),r.valueFromAST=i;var a=n(e("../jsutils/keyMap")),s=n(e("../jsutils/isInvalid")),u=n(e("../jsutils/objectValues")),c=e("../language/kinds"),l=e("../type/definition")},{"../jsutils/isInvalid":51,"../jsutils/keyMap":54,"../jsutils/objectValues":57,"../language/kinds":66,"../type/definition":77}],107:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){switch(e.kind){case s.Kind.NULL:return null;case s.Kind.INT:return parseInt(e.value,10);case s.Kind.FLOAT:return parseFloat(e.value);case s.Kind.STRING:case s.Kind.ENUM:case s.Kind.BOOLEAN:return e.value;case s.Kind.LIST:return e.values.map(function(e){return i(e,t)});case s.Kind.OBJECT:return(0,o.default)(e.fields,function(e){return e.name.value},function(e){return i(e.value,t)});case s.Kind.VARIABLE:var r=e.name.value;return t&&!(0,a.default)(t[r])?t[r]:void 0}throw new Error("Unexpected value kind: "+e.kind)}Object.defineProperty(r,"__esModule",{value:!0}),r.valueFromASTUntyped=i;var o=n(e("../jsutils/keyValMap")),a=n(e("../jsutils/isInvalid")),s=e("../language/kinds")},{"../jsutils/isInvalid":51,"../jsutils/keyValMap":55,"../language/kinds":66}],108:[function(e,t,r){"use strict";function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(r,"__esModule",{value:!0}),r.ValidationContext=r.SDLValidationContext=r.ASTValidationContext=void 0;var a=e("../language/visitor"),s=e("../language/kinds"),u=e("../utilities/TypeInfo"),c=function(){function e(e){o(this,"_ast",void 0),o(this,"_errors",void 0),this._ast=e,this._errors=[]}var t=e.prototype;return t.reportError=function(e){this._errors.push(e)},t.getErrors=function(){return this._errors},t.getDocument=function(){return this._ast},e}();r.ASTValidationContext=c;var l=function(e){function t(t,r){var n;return n=e.call(this,t)||this,o(i(i(n)),"_schema",void 0),n._schema=r,n}return n(t,e),t.prototype.getSchema=function(){return this._schema},t}(c);r.SDLValidationContext=l;var h=function(e){function t(t,r,n){var a;return a=e.call(this,r)||this,o(i(i(a)),"_schema",void 0),o(i(i(a)),"_typeInfo",void 0),o(i(i(a)),"_fragments",void 0),o(i(i(a)),"_fragmentSpreads",void 0),o(i(i(a)),"_recursivelyReferencedFragments",void 0),o(i(i(a)),"_variableUsages",void 0),o(i(i(a)),"_recursiveVariableUsages",void 0),a._schema=t,a._typeInfo=n,a._fragmentSpreads=new Map,a._recursivelyReferencedFragments=new Map,a._variableUsages=new Map,a._recursiveVariableUsages=new Map,a}n(t,e);var r=t.prototype;return r.getSchema=function(){return this._schema},r.getFragment=function(e){var t=this._fragments;return t||(this._fragments=t=this.getDocument().definitions.reduce(function(e,t){return t.kind===s.Kind.FRAGMENT_DEFINITION&&(e[t.name.value]=t),e},Object.create(null))),t[e]},r.getFragmentSpreads=function(e){var t=this._fragmentSpreads.get(e);if(!t){t=[];for(var r=[e];0!==r.length;)for(var n=r.pop(),i=0;i<n.selections.length;i++){var o=n.selections[i];o.kind===s.Kind.FRAGMENT_SPREAD?t.push(o):o.selectionSet&&r.push(o.selectionSet)}this._fragmentSpreads.set(e,t)}return t},r.getRecursivelyReferencedFragments=function(e){var t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];for(var r=Object.create(null),n=[e.selectionSet];0!==n.length;)for(var i=n.pop(),o=this.getFragmentSpreads(i),a=0;a<o.length;a++){var s=o[a].name.value;if(!0!==r[s]){r[s]=!0;var u=this.getFragment(s);u&&(t.push(u),n.push(u.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t},r.getVariableUsages=function(e){var t=this._variableUsages.get(e);if(!t){var r=[],n=new u.TypeInfo(this._schema);(0,a.visit)(e,(0,a.visitWithTypeInfo)(n,{VariableDefinition:function(){return!1},Variable:function(e){r.push({node:e,type:n.getInputType(),defaultValue:n.getDefaultValue()})}})),t=r,this._variableUsages.set(e,t)}return t},r.getRecursiveVariableUsages=function(e){var t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(var r=this.getRecursivelyReferencedFragments(e),n=0;n<r.length;n++)Array.prototype.push.apply(t,this.getVariableUsages(r[n]));this._recursiveVariableUsages.set(e,t)}return t},r.getType=function(){return this._typeInfo.getType()},r.getParentType=function(){return this._typeInfo.getParentType()},r.getInputType=function(){return this._typeInfo.getInputType()},r.getParentInputType=function(){return this._typeInfo.getParentInputType()},r.getFieldDef=function(){return this._typeInfo.getFieldDef()},r.getDirective=function(){return this._typeInfo.getDirective()},r.getArgument=function(){return this._typeInfo.getArgument()},t}(c);r.ValidationContext=h},{"../language/kinds":66,"../language/visitor":73,"../utilities/TypeInfo":84}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"validate",{enumerable:!0,get:function(){return n.validate}}),Object.defineProperty(r,"ValidationContext",{enumerable:!0,get:function(){return i.ValidationContext}}),Object.defineProperty(r,"specifiedRules",{enumerable:!0,get:function(){return o.specifiedRules}}),Object.defineProperty(r,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return a.FieldsOnCorrectType}}),Object.defineProperty(r,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return s.FragmentsOnCompositeTypes}}),Object.defineProperty(r,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return u.KnownArgumentNames}}),Object.defineProperty(r,"KnownDirectivesRule",{enumerable:!0,get:function(){return c.KnownDirectives}}),Object.defineProperty(r,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return l.KnownFragmentNames}}),Object.defineProperty(r,"KnownTypeNamesRule",{enumerable:!0,get:function(){return h.KnownTypeNames}}),Object.defineProperty(r,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return p.LoneAnonymousOperation}}),Object.defineProperty(r,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return f.NoFragmentCycles}}),Object.defineProperty(r,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return d.NoUndefinedVariables}}),Object.defineProperty(r,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return m.NoUnusedFragments}}),Object.defineProperty(r,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return v.NoUnusedVariables}}),Object.defineProperty(r,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return y.OverlappingFieldsCanBeMerged}}),Object.defineProperty(r,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return g.PossibleFragmentSpreads}}),Object.defineProperty(r,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return b.ProvidedRequiredArguments}}),Object.defineProperty(r,"ScalarLeafsRule",{enumerable:!0,get:function(){return _.ScalarLeafs}}),Object.defineProperty(r,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return x.SingleFieldSubscriptions}}),Object.defineProperty(r,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return w.UniqueArgumentNames}}),Object.defineProperty(r,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return S.UniqueDirectivesPerLocation}}),Object.defineProperty(r,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return T.UniqueFragmentNames}}),Object.defineProperty(r,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return E.UniqueInputFieldNames}}),Object.defineProperty(r,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return O.UniqueOperationNames}}),Object.defineProperty(r,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return M.UniqueVariableNames}}),Object.defineProperty(r,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return C.ValuesOfCorrectType}}),Object.defineProperty(r,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return j.VariablesAreInputTypes}}),Object.defineProperty(r,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return P.VariablesInAllowedPosition}});var n=e("./validate"),i=e("./ValidationContext"),o=e("./specifiedRules"),a=e("./rules/FieldsOnCorrectType"),s=e("./rules/FragmentsOnCompositeTypes"),u=e("./rules/KnownArgumentNames"),c=e("./rules/KnownDirectives"),l=e("./rules/KnownFragmentNames"),h=e("./rules/KnownTypeNames"),p=e("./rules/LoneAnonymousOperation"),f=e("./rules/NoFragmentCycles"),d=e("./rules/NoUndefinedVariables"),m=e("./rules/NoUnusedFragments"),v=e("./rules/NoUnusedVariables"),y=e("./rules/OverlappingFieldsCanBeMerged"),g=e("./rules/PossibleFragmentSpreads"),b=e("./rules/ProvidedRequiredArguments"),_=e("./rules/ScalarLeafs"),x=e("./rules/SingleFieldSubscriptions"),w=e("./rules/UniqueArgumentNames"),S=e("./rules/UniqueDirectivesPerLocation"),T=e("./rules/UniqueFragmentNames"),E=e("./rules/UniqueInputFieldNames"),O=e("./rules/UniqueOperationNames"),M=e("./rules/UniqueVariableNames"),C=e("./rules/ValuesOfCorrectType"),j=e("./rules/VariablesAreInputTypes"),P=e("./rules/VariablesInAllowedPosition")},{"./ValidationContext":108,"./rules/FieldsOnCorrectType":111,"./rules/FragmentsOnCompositeTypes":112,"./rules/KnownArgumentNames":113,"./rules/KnownDirectives":114,"./rules/KnownFragmentNames":115,"./rules/KnownTypeNames":116,"./rules/LoneAnonymousOperation":117,"./rules/NoFragmentCycles":119,"./rules/NoUndefinedVariables":120,"./rules/NoUnusedFragments":121,"./rules/NoUnusedVariables":122,"./rules/OverlappingFieldsCanBeMerged":123,"./rules/PossibleFragmentSpreads":124,"./rules/ProvidedRequiredArguments":125,"./rules/ScalarLeafs":126,"./rules/SingleFieldSubscriptions":127,"./rules/UniqueArgumentNames":128,"./rules/UniqueDirectivesPerLocation":129,"./rules/UniqueFragmentNames":130,"./rules/UniqueInputFieldNames":131,"./rules/UniqueOperationNames":132,"./rules/UniqueVariableNames":133,"./rules/ValuesOfCorrectType":134,"./rules/VariablesAreInputTypes":135,"./rules/VariablesInAllowedPosition":136,"./specifiedRules":137,"./validate":138}],110:[function(e,t,r){"use strict";function n(e){return"The ".concat(e," definition is not executable.")}Object.defineProperty(r,"__esModule",{value:!0}),r.nonExecutableDefinitionMessage=n,r.ExecutableDefinitions=function(e){return{Document:function(t){var r=!0,s=!1,u=void 0;try{for(var c,l=t.definitions[Symbol.iterator]();!(r=(c=l.next()).done);r=!0){var h=c.value;(0,a.isExecutableDefinitionNode)(h)||e.reportError(new i.GraphQLError(n(h.kind===o.Kind.SCHEMA_DEFINITION||h.kind===o.Kind.SCHEMA_EXTENSION?"schema":h.name.value),[h]))}}catch(e){s=!0,u=e}finally{try{r||null==l.return||l.return()}finally{if(s)throw u}}return!1}}};var i=e("../../error/GraphQLError"),o=e("../../language/kinds"),a=e("../../language/predicates")},{"../../error/GraphQLError":32,"../../language/kinds":66,"../../language/predicates":70}],111:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r,n){var i='Cannot query field "'.concat(e,'" on type "').concat(t,'".');if(0!==r.length){var o=(0,c.default)(r);i+=" Did you mean to use an inline fragment on ".concat(o,"?")}else 0!==n.length&&(i+=" Did you mean ".concat((0,c.default)(n),"?"));return i}function o(e,t,r){if((0,l.isAbstractType)(t)){var n=[],i=Object.create(null),o=!0,a=!1,s=void 0;try{for(var u,c=e.getPossibleTypes(t)[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var h=u.value;if(h.getFields()[r]){n.push(h.name);var p=!0,f=!1,d=void 0;try{for(var m,v=h.getInterfaces()[Symbol.iterator]();!(p=(m=v.next()).done);p=!0){var y=m.value;y.getFields()[r]&&(i[y.name]=(i[y.name]||0)+1)}}catch(e){f=!0,d=e}finally{try{p||null==v.return||v.return()}finally{if(f)throw d}}}}}catch(e){a=!0,s=e}finally{try{o||null==c.return||c.return()}finally{if(a)throw s}}return Object.keys(i).sort(function(e,t){return i[t]-i[e]}).concat(n)}return[]}function a(e,t,r){if((0,l.isObjectType)(t)||(0,l.isInterfaceType)(t)){var n=Object.keys(t.getFields());return(0,u.default)(r,n)}return[]}Object.defineProperty(r,"__esModule",{value:!0}),r.undefinedFieldMessage=i,r.FieldsOnCorrectType=function(e){return{Field:function(t){var r=e.getParentType();if(r&&!e.getFieldDef()){var n=e.getSchema(),u=t.name.value,c=o(n,r,u),l=0!==c.length?[]:a(0,r,u);e.reportError(new s.GraphQLError(i(u,r.name,c,l),[t]))}}}};var s=e("../../error/GraphQLError"),u=n(e("../../jsutils/suggestionList")),c=n(e("../../jsutils/quotedOrList")),l=e("../../type/definition")},{"../../error/GraphQLError":32,"../../jsutils/quotedOrList":61,"../../jsutils/suggestionList":62,"../../type/definition":77}],112:[function(e,t,r){"use strict";function n(e){return'Fragment cannot condition on non composite type "'.concat(e,'".')}function i(e,t){return'Fragment "'.concat(e,'" cannot condition on non composite ')+'type "'.concat(t,'".')}Object.defineProperty(r,"__esModule",{value:!0}),r.inlineFragmentOnNonCompositeErrorMessage=n,r.fragmentOnNonCompositeErrorMessage=i,r.FragmentsOnCompositeTypes=function(e){return{InlineFragment:function(t){var r=t.typeCondition;if(r){var i=(0,u.typeFromAST)(e.getSchema(),r);i&&!(0,s.isCompositeType)(i)&&e.reportError(new o.GraphQLError(n((0,a.print)(r)),[r]))}},FragmentDefinition:function(t){var r=(0,u.typeFromAST)(e.getSchema(),t.typeCondition);r&&!(0,s.isCompositeType)(r)&&e.reportError(new o.GraphQLError(i(t.name.value,(0,a.print)(t.typeCondition)),[t.typeCondition]))}}};var o=e("../../error/GraphQLError"),a=e("../../language/printer"),s=e("../../type/definition"),u=e("../../utilities/typeFromAST")},{"../../error/GraphQLError":32,"../../language/printer":71,"../../type/definition":77,"../../utilities/typeFromAST":105}],113:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){o(e,t,r[t])})}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t,r,n){var i='Unknown argument "'.concat(e,'" on field "').concat(t,'" of ')+'type "'.concat(r,'".');return n.length&&(i+=" Did you mean ".concat((0,h.default)(n),"?")),i}function s(e,t,r){var n='Unknown argument "'.concat(e,'" on directive "@').concat(t,'".');return r.length&&(n+=" Did you mean ".concat((0,h.default)(r),"?")),n}function u(e){var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():f.specifiedDirectives,i=!0,o=!1,a=void 0;try{for(var u,h=n[Symbol.iterator]();!(i=(u=h.next()).done);i=!0){var d=u.value;t[d.name]=d.args.map(function(e){return e.name})}}catch(e){o=!0,a=e}finally{try{i||null==h.return||h.return()}finally{if(o)throw a}}var m=e.getDocument().definitions,v=!0,y=!1,g=void 0;try{for(var b,_=m[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;x.kind===p.Kind.DIRECTIVE_DEFINITION&&(t[x.name.value]=x.arguments?x.arguments.map(function(e){return e.name.value}):[])}}catch(e){y=!0,g=e}finally{try{v||null==_.return||_.return()}finally{if(y)throw g}}return{Directive:function(r){var n=r.name.value,i=t[n];if(r.arguments&&i){var o=!0,a=!1,u=void 0;try{for(var h,p=r.arguments[Symbol.iterator]();!(o=(h=p.next()).done);o=!0){var f=h.value,d=f.name.value;if(-1===i.indexOf(d)){var m=(0,l.default)(d,i);e.reportError(new c.GraphQLError(s(d,n,m),f))}}}catch(e){a=!0,u=e}finally{try{o||null==p.return||p.return()}finally{if(a)throw u}}}return!1}}}Object.defineProperty(r,"__esModule",{value:!0}),r.unknownArgMessage=a,r.unknownDirectiveArgMessage=s,r.KnownArgumentNames=function(e){return i({},u(e),{Argument:function(t){var r=e.getArgument(),n=e.getFieldDef(),i=e.getParentType();if(!r&&n&&i){var o=t.name.value,s=n.args.map(function(e){return e.name});e.reportError(new c.GraphQLError(a(o,n.name,i.name,(0,l.default)(o,s)),t))}}})},r.KnownArgumentNamesOnDirectives=u;var c=e("../../error/GraphQLError"),l=n(e("../../jsutils/suggestionList")),h=n(e("../../jsutils/quotedOrList")),p=e("../../language/kinds"),f=e("../../type/directives")},{"../../error/GraphQLError":32,"../../jsutils/quotedOrList":61,"../../jsutils/suggestionList":62,"../../language/kinds":66,"../../type/directives":78}],114:[function(e,t,r){"use strict";function n(e){return'Unknown directive "'.concat(e,'".')}function i(e,t){return'Directive "'.concat(e,'" may not be used on ').concat(t,".")}function o(e){var t=e[e.length-1];if(!Array.isArray(t))switch(t.kind){case s.Kind.OPERATION_DEFINITION:switch(t.operation){case"query":return u.DirectiveLocation.QUERY;case"mutation":return u.DirectiveLocation.MUTATION;case"subscription":return u.DirectiveLocation.SUBSCRIPTION}break;case s.Kind.FIELD:return u.DirectiveLocation.FIELD;case s.Kind.FRAGMENT_SPREAD:return u.DirectiveLocation.FRAGMENT_SPREAD;case s.Kind.INLINE_FRAGMENT:return u.DirectiveLocation.INLINE_FRAGMENT;case s.Kind.FRAGMENT_DEFINITION:return u.DirectiveLocation.FRAGMENT_DEFINITION;case s.Kind.VARIABLE_DEFINITION:return u.DirectiveLocation.VARIABLE_DEFINITION;case s.Kind.SCHEMA_DEFINITION:case s.Kind.SCHEMA_EXTENSION:return u.DirectiveLocation.SCHEMA;case s.Kind.SCALAR_TYPE_DEFINITION:case s.Kind.SCALAR_TYPE_EXTENSION:return u.DirectiveLocation.SCALAR;case s.Kind.OBJECT_TYPE_DEFINITION:case s.Kind.OBJECT_TYPE_EXTENSION:return u.DirectiveLocation.OBJECT;case s.Kind.FIELD_DEFINITION:return u.DirectiveLocation.FIELD_DEFINITION;case s.Kind.INTERFACE_TYPE_DEFINITION:case s.Kind.INTERFACE_TYPE_EXTENSION:return u.DirectiveLocation.INTERFACE;case s.Kind.UNION_TYPE_DEFINITION:case s.Kind.UNION_TYPE_EXTENSION:return u.DirectiveLocation.UNION;case s.Kind.ENUM_TYPE_DEFINITION:case s.Kind.ENUM_TYPE_EXTENSION:return u.DirectiveLocation.ENUM;case s.Kind.ENUM_VALUE_DEFINITION:return u.DirectiveLocation.ENUM_VALUE;case s.Kind.INPUT_OBJECT_TYPE_DEFINITION:case s.Kind.INPUT_OBJECT_TYPE_EXTENSION:return u.DirectiveLocation.INPUT_OBJECT;case s.Kind.INPUT_VALUE_DEFINITION:return e[e.length-3].kind===s.Kind.INPUT_OBJECT_TYPE_DEFINITION?u.DirectiveLocation.INPUT_FIELD_DEFINITION:u.DirectiveLocation.ARGUMENT_DEFINITION}}Object.defineProperty(r,"__esModule",{value:!0}),r.unknownDirectiveMessage=n,r.misplacedDirectiveMessage=i,r.KnownDirectives=function(e){var t=Object.create(null),r=e.getSchema(),u=r?r.getDirectives():c.specifiedDirectives,l=!0,h=!1,p=void 0;try{for(var f,d=u[Symbol.iterator]();!(l=(f=d.next()).done);l=!0){var m=f.value;t[m.name]=m.locations}}catch(e){h=!0,p=e}finally{try{l||null==d.return||d.return()}finally{if(h)throw p}}var v=e.getDocument().definitions,y=!0,g=!1,b=void 0;try{for(var _,x=v[Symbol.iterator]();!(y=(_=x.next()).done);y=!0){var w=_.value;w.kind===s.Kind.DIRECTIVE_DEFINITION&&(t[w.name.value]=w.locations.map(function(e){return e.value}))}}catch(e){g=!0,b=e}finally{try{y||null==x.return||x.return()}finally{if(g)throw b}}return{Directive:function(r,s,u,c,l){var h=r.name.value,p=t[h];if(p){var f=o(l);f&&-1===p.indexOf(f)&&e.reportError(new a.GraphQLError(i(h,f),[r]))}else e.reportError(new a.GraphQLError(n(h),[r]))}}};var a=e("../../error/GraphQLError"),s=e("../../language/kinds"),u=e("../../language/directiveLocation"),c=e("../../type/directives")},{"../../error/GraphQLError":32,"../../language/directiveLocation":64,"../../language/kinds":66,"../../type/directives":78}],115:[function(e,t,r){"use strict";function n(e){return'Unknown fragment "'.concat(e,'".')}Object.defineProperty(r,"__esModule",{value:!0}),r.unknownFragmentMessage=n,r.KnownFragmentNames=function(e){return{FragmentSpread:function(t){var r=t.name.value;e.getFragment(r)||e.reportError(new i.GraphQLError(n(r),[t.name]))}}};var i=e("../../error/GraphQLError")},{"../../error/GraphQLError":32}],116:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r='Unknown type "'.concat(e,'".');return t.length&&(r+=" Did you mean ".concat((0,s.default)(t),"?")),r}Object.defineProperty(r,"__esModule",{value:!0}),r.unknownTypeMessage=i,r.KnownTypeNames=function(e){return{ObjectTypeDefinition:function(){return!1},InterfaceTypeDefinition:function(){return!1},UnionTypeDefinition:function(){return!1},InputObjectTypeDefinition:function(){return!1},NamedType:function(t){var r=e.getSchema(),n=t.name.value;r.getType(n)||e.reportError(new o.GraphQLError(i(n,(0,a.default)(n,Object.keys(r.getTypeMap()))),[t]))}}};var o=e("../../error/GraphQLError"),a=n(e("../../jsutils/suggestionList")),s=n(e("../../jsutils/quotedOrList"))},{"../../error/GraphQLError":32,"../../jsutils/quotedOrList":61,"../../jsutils/suggestionList":62}],117:[function(e,t,r){"use strict";function n(){return"This anonymous operation must be the only defined operation."}Object.defineProperty(r,"__esModule",{value:!0}),r.anonOperationNotAloneMessage=n,r.LoneAnonymousOperation=function(e){var t=0;return{Document:function(e){t=e.definitions.filter(function(e){return e.kind===o.Kind.OPERATION_DEFINITION}).length},OperationDefinition:function(r){!r.name&&t>1&&e.reportError(new i.GraphQLError(n(),[r]))}}};var i=e("../../error/GraphQLError"),o=e("../../language/kinds")},{"../../error/GraphQLError":32,"../../language/kinds":66}],118:[function(e,t,r){"use strict";function n(){return"Must provide only one schema definition."}function i(){return"Cannot define a new schema within a schema extension."}Object.defineProperty(r,"__esModule",{value:!0}),r.schemaDefinitionNotAloneMessage=n,r.canNotDefineSchemaWithinExtensionMessage=i,r.LoneSchemaDefinition=function(e){var t=e.getSchema(),r=t&&(t.astNode||t.getQueryType()||t.getMutationType()||t.getSubscriptionType()),a=0;return{SchemaDefinition:function(t){r?e.reportError(new o.GraphQLError(i(),t)):(a>0&&e.reportError(new o.GraphQLError(n(),t)),++a)}}};var o=e("../../error/GraphQLError")},{"../../error/GraphQLError":32}],119:[function(e,t,r){"use strict";function n(e,t){var r=t.length?" via "+t.join(", "):"";return'Cannot spread fragment "'.concat(e,'" within itself').concat(r,".")}Object.defineProperty(r,"__esModule",{value:!0}),r.cycleErrorMessage=n,r.NoFragmentCycles=function(e){function t(s){if(!r[s.name.value]){var u=s.name.value;r[u]=!0;var c=e.getFragmentSpreads(s.selectionSet);if(0!==c.length){a[u]=o.length;for(var l=0;l<c.length;l++){var h=c[l],p=h.name.value,f=a[p];if(o.push(h),void 0===f){var d=e.getFragment(p);d&&t(d)}else{var m=o.slice(f),v=m.slice(0,-1).map(function(e){return e.name.value});e.reportError(new i.GraphQLError(n(p,v),m))}o.pop()}a[u]=void 0}}}var r=Object.create(null),o=[],a=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(e){return t(e),!1}}};var i=e("../../error/GraphQLError")},{"../../error/GraphQLError":32}],120:[function(e,t,r){"use strict";function n(e,t){return t?'Variable "$'.concat(e,'" is not defined by operation "').concat(t,'".'):'Variable "$'.concat(e,'" is not defined.')}Object.defineProperty(r,"__esModule",{value:!0}),r.undefinedVarMessage=n,r.NoUndefinedVariables=function(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(r){var o=e.getRecursiveVariableUsages(r),a=!0,s=!1,u=void 0;try{for(var c,l=o[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var h=c.value.node,p=h.name.value;!0!==t[p]&&e.reportError(new i.GraphQLError(n(p,r.name&&r.name.value),[h,r]))}}catch(e){s=!0,u=e}finally{try{a||null==l.return||l.return()}finally{if(s)throw u}}}},VariableDefinition:function(e){t[e.variable.name.value]=!0}}};var i=e("../../error/GraphQLError")},{"../../error/GraphQLError":32}],121:[function(e,t,r){"use strict";function n(e){return'Fragment "'.concat(e,'" is never used.')}Object.defineProperty(r,"__esModule",{value:!0}),r.unusedFragMessage=n,r.NoUnusedFragments=function(e){var t=[],r=[];return{OperationDefinition:function(e){return t.push(e),!1},FragmentDefinition:function(e){return r.push(e),!1},Document:{leave:function(){for(var o=Object.create(null),a=0;a<t.length;a++){var s=t[a],u=!0,c=!1,l=void 0;try{for(var h,p=e.getRecursivelyReferencedFragments(s)[Symbol.iterator]();!(u=(h=p.next()).done);u=!0)o[h.value.name.value]=!0}catch(e){c=!0,l=e}finally{try{u||null==p.return||p.return()}finally{if(c)throw l}}}for(var f=0;f<r.length;f++){var d=r[f],m=d.name.value;!0!==o[m]&&e.reportError(new i.GraphQLError(n(m),[d]))}}}}};var i=e("../../error/GraphQLError")},{"../../error/GraphQLError":32}],122:[function(e,t,r){"use strict";function n(e,t){return t?'Variable "$'.concat(e,'" is never used in operation "').concat(t,'".'):'Variable "$'.concat(e,'" is never used.')}Object.defineProperty(r,"__esModule",{value:!0}),r.unusedVariableMessage=n,r.NoUnusedVariables=function(e){var t=[];return{OperationDefinition:{enter:function(){t=[]},leave:function(r){var o=Object.create(null),a=e.getRecursiveVariableUsages(r),s=r.name?r.name.value:null,u=!0,c=!1,l=void 0;try{for(var h,p=a[Symbol.iterator]();!(u=(h=p.next()).done);u=!0)o[h.value.node.name.value]=!0}catch(e){c=!0,l=e}finally{try{u||null==p.return||p.return()}finally{if(c)throw l}}for(var f=0;f<t.length;f++){var d=t[f],m=d.variable.name.value;!0!==o[m]&&e.reportError(new i.GraphQLError(n(m,s),[d]))}}},VariableDefinition:function(e){t.push(e)}}};var i=e("../../error/GraphQLError")},{"../../error/GraphQLError":32}],123:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){return'Fields "'.concat(e,'" conflict because ').concat(a(t),". ")+"Use different aliases on the fields to fetch both if this was intentional."}function a(e){return Array.isArray(e)?e.map(function(e){var t=e[0],r=e[1];return'subfields "'.concat(t,'" conflict because ').concat(a(r))}).join(" and "):e}function s(e,t,r,n,i){var o=[],a=y(e,t,n,i),s=a[0],l=a[1];if(h(e,o,t,r,s),0!==l.length)for(var p=Object.create(null),f=0;f<l.length;f++){u(e,o,t,p,r,!1,s,l[f]);for(var d=f+1;d<l.length;d++)c(e,o,t,r,!1,l[f],l[d])}return o}function u(e,t,r,n,i,o,a,s){if(!n[s]){n[s]=!0;var c=e.getFragment(s);if(c){var l=g(e,r,c),h=l[0],f=l[1];if(a!==h){p(e,t,r,i,o,a,h);for(var d=0;d<f.length;d++)u(e,t,r,n,i,o,a,f[d])}}}}function c(e,t,r,n,i,o,a){if(o!==a&&!n.has(o,a,i)){n.add(o,a,i);var s=e.getFragment(o),u=e.getFragment(a);if(s&&u){var l=g(e,r,s),h=l[0],f=l[1],d=g(e,r,u),m=d[0],v=d[1];p(e,t,r,n,i,h,m);for(var y=0;y<v.length;y++)c(e,t,r,n,i,o,v[y]);for(var b=0;b<f.length;b++)c(e,t,r,n,i,f[b],a)}}}function l(e,t,r,n,i,o,a,s){var l=[],h=y(e,t,i,o),f=h[0],d=h[1],m=y(e,t,a,s),v=m[0],g=m[1];if(p(e,l,t,r,n,f,v),0!==g.length)for(var b=Object.create(null),_=0;_<g.length;_++)u(e,l,t,b,r,n,f,g[_]);if(0!==d.length)for(var x=Object.create(null),w=0;w<d.length;w++)u(e,l,t,x,r,n,v,d[w]);for(var S=0;S<d.length;S++)for(var T=0;T<g.length;T++)c(e,l,t,r,n,d[S],g[T]);return l}function h(e,t,r,n,i){for(var o=Object.keys(i),a=0;a<o.length;a++){var s=o[a],u=i[s];if(u.length>1)for(var c=0;c<u.length;c++)for(var l=c+1;l<u.length;l++){var h=f(e,r,n,!1,s,u[c],u[l]);h&&t.push(h)}}}function p(e,t,r,n,i,o,a){for(var s=Object.keys(o),u=0;u<s.length;u++){var c=s[u],l=a[c];if(l)for(var h=o[c],p=0;p<h.length;p++)for(var d=0;d<l.length;d++){var m=f(e,r,n,i,c,h[p],l[d]);m&&t.push(m)}}}function f(e,t,r,n,i,o,a){var s=o[0],u=o[1],c=o[2],h=a[0],p=a[1],f=a[2],m=n||s!==h&&(0,M.isObjectType)(s)&&(0,M.isObjectType)(h),y=c&&c.type,g=f&&f.type;if(!m){var b=u.name.value,x=p.name.value;if(b!==x)return[[i,"".concat(b," and ").concat(x," are different fields")],[u],[p]];if(!d(u.arguments||[],p.arguments||[]))return[[i,"they have differing arguments"],[u],[p]]}if(y&&g&&v(y,g))return[[i,"they return conflicting types ".concat((0,S.default)(y)," and ").concat((0,S.default)(g))],[u],[p]];var w=u.selectionSet,T=p.selectionSet;return w&&T?_(l(e,t,r,m,(0,M.getNamedType)(y),w,(0,M.getNamedType)(g),T),i,u,p):void 0}function d(e,t){return e.length===t.length&&e.every(function(e){var r=(0,T.default)(t,function(t){return t.name.value===e.name.value});return!!r&&m(e.value,r.value)})}function m(e,t){return!e&&!t||(0,O.print)(e)===(0,O.print)(t)}function v(e,t){return(0,M.isListType)(e)?!(0,M.isListType)(t)||v(e.ofType,t.ofType):!!(0,M.isListType)(t)||((0,M.isNonNullType)(e)?!(0,M.isNonNullType)(t)||v(e.ofType,t.ofType):!!(0,M.isNonNullType)(t)||!(!(0,M.isLeafType)(e)&&!(0,M.isLeafType)(t))&&e!==t)}function y(e,t,r,n){var i=t.get(n);if(!i){var o=Object.create(null),a=Object.create(null);b(e,r,n,o,a),i=[o,Object.keys(a)],t.set(n,i)}return i}function g(e,t,r){var n=t.get(r.selectionSet);return n||y(e,t,(0,C.typeFromAST)(e.getSchema(),r.typeCondition),r.selectionSet)}function b(e,t,r,n,i){for(var o=0;o<r.selections.length;o++){var a=r.selections[o];switch(a.kind){case E.Kind.FIELD:var s=a.name.value,u=void 0;((0,M.isObjectType)(t)||(0,M.isInterfaceType)(t))&&(u=t.getFields()[s]);var c=a.alias?a.alias.value:s;n[c]||(n[c]=[]),n[c].push([t,a,u]);break;case E.Kind.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case E.Kind.INLINE_FRAGMENT:var l=a.typeCondition;b(e,l?(0,C.typeFromAST)(e.getSchema(),l):t,a.selectionSet,n,i)}}}function _(e,t,r,n){if(e.length>0)return[[t,e.map(function(e){return e[0]})],e.reduce(function(e,t){var r=t[1];return e.concat(r)},[r]),e.reduce(function(e,t){var r=t[2];return e.concat(r)},[n])]}function x(e,t,r,n){var i=e[t];i||(i=Object.create(null),e[t]=i),i[r]=n}Object.defineProperty(r,"__esModule",{value:!0}),r.fieldsConflictMessage=o,r.OverlappingFieldsCanBeMerged=function(e){var t=new j,r=new Map;return{SelectionSet:function(n){for(var i=s(e,r,t,e.getParentType(),n),a=0;a<i.length;a++){var u=i[a],c=u[0],l=c[0],h=c[1],p=u[1],f=u[2];e.reportError(new w.GraphQLError(o(l,h),p.concat(f)))}}}};var w=e("../../error/GraphQLError"),S=n(e("../../jsutils/inspect")),T=n(e("../../jsutils/find")),E=e("../../language/kinds"),O=e("../../language/printer"),M=e("../../type/definition"),C=e("../../utilities/typeFromAST"),j=function(){function e(){i(this,"_data",void 0),this._data=Object.create(null)}var t=e.prototype;return t.has=function(e,t,r){var n=this._data[e],i=n&&n[t];return void 0!==i&&(!1!==r||!1===i)},t.add=function(e,t,r){x(this._data,e,t,r),x(this._data,t,e,r)},e}()},{"../../error/GraphQLError":32,"../../jsutils/find":45,"../../jsutils/inspect":46,"../../language/kinds":66,"../../language/printer":71,"../../type/definition":77,"../../utilities/typeFromAST":105}],124:[function(e,t,r){"use strict";function n(e,t,r){return'Fragment "'.concat(e,'" cannot be spread here as objects of ')+'type "'.concat(t,'" can never be of type "').concat(r,'".')}function i(e,t){return"Fragment cannot be spread here as objects of "+'type "'.concat(e,'" can never be of type "').concat(t,'".')}function o(e,t){var r=e.getFragment(t);if(r){var n=(0,c.typeFromAST)(e.getSchema(),r.typeCondition);if((0,l.isCompositeType)(n))return n}}Object.defineProperty(r,"__esModule",{value:!0}),r.typeIncompatibleSpreadMessage=n,r.typeIncompatibleAnonSpreadMessage=i,r.PossibleFragmentSpreads=function(e){return{InlineFragment:function(t){var r=e.getType(),n=e.getParentType();(0,l.isCompositeType)(r)&&(0,l.isCompositeType)(n)&&!(0,u.doTypesOverlap)(e.getSchema(),r,n)&&e.reportError(new s.GraphQLError(i((0,a.default)(n),(0,a.default)(r)),[t]))},FragmentSpread:function(t){var r=t.name.value,i=o(e,r),c=e.getParentType();i&&c&&!(0,u.doTypesOverlap)(e.getSchema(),i,c)&&e.reportError(new s.GraphQLError(n(r,(0,a.default)(c),(0,a.default)(i)),[t]))}}};var a=function(e){return e&&e.__esModule?e:{default:e}}(e("../../jsutils/inspect")),s=e("../../error/GraphQLError"),u=e("../../utilities/typeComparators"),c=e("../../utilities/typeFromAST"),l=e("../../type/definition")},{"../../error/GraphQLError":32,"../../jsutils/inspect":46,"../../type/definition":77,"../../utilities/typeComparators":104,"../../utilities/typeFromAST":105}],125:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){o(e,t,r[t])})}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t,r){return'Field "'.concat(e,'" argument "').concat(t,'" of type ')+'"'.concat(r,'" is required but not provided.')}function s(e,t,r){return'Directive "@'.concat(e,'" argument "').concat(t,'" of type ')+'"'.concat(r,'" is required but not provided.')}function u(e){var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():v.specifiedDirectives,i=!0,o=!1,a=void 0;try{for(var u,y=n[Symbol.iterator]();!(i=(u=y.next()).done);i=!0){var g=u.value;t[g.name]=(0,f.default)(g.args.filter(d.isRequiredArgument),function(e){return e.name})}}catch(e){o=!0,a=e}finally{try{i||null==y.return||y.return()}finally{if(o)throw a}}var b=e.getDocument().definitions,_=!0,x=!1,w=void 0;try{for(var S,T=b[Symbol.iterator]();!(_=(S=T.next()).done);_=!0){var E=S.value;E.kind===h.Kind.DIRECTIVE_DEFINITION&&(t[E.name.value]=(0,f.default)(E.arguments?E.arguments.filter(c):[],function(e){return e.name.value}))}}catch(e){x=!0,w=e}finally{try{_||null==T.return||T.return()}finally{if(x)throw w}}return{Directive:{leave:function(r){var n=r.name.value,i=t[n];if(i)for(var o=r.arguments||[],a=(0,f.default)(o,function(e){return e.name.value}),u=Object.keys(i),c=0;c<u.length;c++){var h=u[c];if(!a[h]){var v=i[h].type;e.reportError(new l.GraphQLError(s(n,h,(0,d.isType)(v)?(0,p.default)(v):(0,m.print)(v)),r))}}}}}}function c(e){return e.type.kind===h.Kind.NON_NULL_TYPE&&null==e.defaultValue}Object.defineProperty(r,"__esModule",{value:!0}),r.missingFieldArgMessage=a,r.missingDirectiveArgMessage=s,r.ProvidedRequiredArguments=function(e){return i({},u(e),{Field:{leave:function(t){var r=e.getFieldDef();if(!r)return!1;var n=t.arguments||[],i=(0,f.default)(n,function(e){return e.name.value}),o=!0,s=!1,u=void 0;try{for(var c,h=r.args[Symbol.iterator]();!(o=(c=h.next()).done);o=!0){var m=c.value;!i[m.name]&&(0,d.isRequiredArgument)(m)&&e.reportError(new l.GraphQLError(a(r.name,m.name,(0,p.default)(m.type)),[t]))}}catch(e){s=!0,u=e}finally{try{o||null==h.return||h.return()}finally{if(s)throw u}}}}})},r.ProvidedRequiredArgumentsOnDirectives=u;var l=e("../../error/GraphQLError"),h=e("../../language/kinds"),p=n(e("../../jsutils/inspect")),f=n(e("../../jsutils/keyMap")),d=e("../../type/definition"),m=e("../../language/printer"),v=e("../../type/directives")},{"../../error/GraphQLError":32,"../../jsutils/inspect":46,"../../jsutils/keyMap":54,"../../language/kinds":66,"../../language/printer":71,"../../type/definition":77,"../../type/directives":78}],126:[function(e,t,r){"use strict";function n(e,t){return'Field "'.concat(e,'" must not have a selection since ')+'type "'.concat(t,'" has no subfields.')}function i(e,t){return'Field "'.concat(e,'" of type "').concat(t,'" must have a ')+'selection of subfields. Did you mean "'.concat(e,' { ... }"?')}Object.defineProperty(r,"__esModule",{value:!0}),r.noSubselectionAllowedMessage=n,r.requiredSubselectionMessage=i,r.ScalarLeafs=function(e){return{Field:function(t){var r=e.getType(),u=t.selectionSet;r&&((0,s.isLeafType)((0,s.getNamedType)(r))?u&&e.reportError(new a.GraphQLError(n(t.name.value,(0,o.default)(r)),[u])):u||e.reportError(new a.GraphQLError(i(t.name.value,(0,o.default)(r)),[t])))}}};var o=function(e){return e&&e.__esModule?e:{default:e}}(e("../../jsutils/inspect")),a=e("../../error/GraphQLError"),s=e("../../type/definition")},{"../../error/GraphQLError":32,"../../jsutils/inspect":46,"../../type/definition":77}],127:[function(e,t,r){"use strict";function n(e){return(e?'Subscription "'.concat(e,'" '):"Anonymous Subscription ")+"must select only one top level field."}Object.defineProperty(r,"__esModule",{value:!0}),r.singleFieldOnlyMessage=n,r.SingleFieldSubscriptions=function(e){return{OperationDefinition:function(t){"subscription"===t.operation&&1!==t.selectionSet.selections.length&&e.reportError(new i.GraphQLError(n(t.name&&t.name.value),t.selectionSet.selections.slice(1)))}}};var i=e("../../error/GraphQLError")},{"../../error/GraphQLError":32}],128:[function(e,t,r){"use strict";function n(e){return'There can be only one argument named "'.concat(e,'".')}Object.defineProperty(r,"__esModule",{value:!0}),r.duplicateArgMessage=n,r.UniqueArgumentNames=function(e){var t=Object.create(null);return{Field:function(){t=Object.create(null)},Directive:function(){t=Object.create(null)},Argument:function(r){var o=r.name.value;return t[o]?e.reportError(new i.GraphQLError(n(o),[t[o],r.name])):t[o]=r.name,!1}}};var i=e("../../error/GraphQLError")},{"../../error/GraphQLError":32}],129:[function(e,t,r){"use strict";function n(e){return'The directive "'.concat(e,'" can only be used once at ')+"this location."}Object.defineProperty(r,"__esModule",{value:!0}),r.duplicateDirectiveMessage=n,r.UniqueDirectivesPerLocation=function(e){return{enter:function(t){var r=t.directives;if(r){var o=Object.create(null),a=!0,s=!1,u=void 0;try{for(var c,l=r[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var h=c.value,p=h.name.value;o[p]?e.reportError(new i.GraphQLError(n(p),[o[p],h])):o[p]=h}}catch(e){s=!0,u=e}finally{try{a||null==l.return||l.return()}finally{if(s)throw u}}}}}};var i=e("../../error/GraphQLError")},{"../../error/GraphQLError":32}],130:[function(e,t,r){"use strict";function n(e){return'There can be only one fragment named "'.concat(e,'".')}Object.defineProperty(r,"__esModule",{value:!0}),r.duplicateFragmentNameMessage=n,r.UniqueFragmentNames=function(e){var t=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(r){var o=r.name.value;return t[o]?e.reportError(new i.GraphQLError(n(o),[t[o],r.name])):t[o]=r.name,!1}}};var i=e("../../error/GraphQLError")},{"../../error/GraphQLError":32}],131:[function(e,t,r){"use strict";function n(e){return'There can be only one input field named "'.concat(e,'".')}Object.defineProperty(r,"__esModule",{value:!0}),r.duplicateInputFieldMessage=n,r.UniqueInputFieldNames=function(e){var t=[],r=Object.create(null);return{ObjectValue:{enter:function(){t.push(r),r=Object.create(null)},leave:function(){r=t.pop()}},ObjectField:function(t){var o=t.name.value;return r[o]?e.reportError(new i.GraphQLError(n(o),[r[o],t.name])):r[o]=t.name,!1}}};var i=e("../../error/GraphQLError")},{"../../error/GraphQLError":32}],132:[function(e,t,r){"use strict";function n(e){return'There can be only one operation named "'.concat(e,'".')}Object.defineProperty(r,"__esModule",{value:!0}),r.duplicateOperationNameMessage=n,r.UniqueOperationNames=function(e){var t=Object.create(null);return{OperationDefinition:function(r){var o=r.name;return o&&(t[o.value]?e.reportError(new i.GraphQLError(n(o.value),[t[o.value],o])):t[o.value]=o),!1},FragmentDefinition:function(){return!1}}};var i=e("../../error/GraphQLError")},{"../../error/GraphQLError":32}],133:[function(e,t,r){"use strict";function n(e){return'There can be only one variable named "'.concat(e,'".')}Object.defineProperty(r,"__esModule",{value:!0}),r.duplicateVariableMessage=n,r.UniqueVariableNames=function(e){var t=Object.create(null);return{OperationDefinition:function(){t=Object.create(null)},VariableDefinition:function(r){var o=r.variable.name.value;t[o]?e.reportError(new i.GraphQLError(n(o),[t[o],r.variable.name])):t[o]=r.variable.name}}};var i=e("../../error/GraphQLError")},{"../../error/GraphQLError":32}],134:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){return"Expected type ".concat(e,", found ").concat(t)+(r?"; ".concat(r):".")}function o(e,t,r){return"Field ".concat(e,".").concat(t," of required type ")+"".concat(r," was not provided.")}function a(e,t,r){return'Field "'.concat(t,'" is not defined by type ').concat(e)+(r?"; ".concat(r):".")}function s(e,t){var r=e.getInputType();if(r){var n=(0,h.getNamedType)(r);if((0,h.isScalarType)(n))try{var o=n.parseLiteral(t,void 0);(0,f.default)(o)&&e.reportError(new c.GraphQLError(i((0,p.default)(r),(0,l.print)(t)),t))}catch(n){e.reportError(new c.GraphQLError(i((0,p.default)(r),(0,l.print)(t),n.message),t,void 0,void 0,void 0,n))}else e.reportError(new c.GraphQLError(i((0,p.default)(r),(0,l.print)(t),u(n,t)),t))}}function u(e,t){if((0,h.isEnumType)(e)){var r=(0,v.default)((0,l.print)(t),e.getValues().map(function(e){return e.name}));if(0!==r.length)return"Did you mean the enum value ".concat((0,m.default)(r),"?")}}Object.defineProperty(r,"__esModule",{value:!0}),r.badValueMessage=i,r.requiredFieldMessage=o,r.unknownFieldMessage=a,r.ValuesOfCorrectType=function(e){return{NullValue:function(t){var r=e.getInputType();(0,h.isNonNullType)(r)&&e.reportError(new c.GraphQLError(i((0,p.default)(r),(0,l.print)(t)),t))},ListValue:function(t){var r=(0,h.getNullableType)(e.getParentInputType());if(!(0,h.isListType)(r))return s(e,t),!1},ObjectValue:function(t){var r=(0,h.getNamedType)(e.getInputType());if(!(0,h.isInputObjectType)(r))return s(e,t),!1;for(var n=r.getFields(),i=(0,d.default)(t.fields,function(e){return e.name.value}),a=Object.keys(n),u=0;u<a.length;u++){var l=a[u],f=n[l];if(!i[l]&&(0,h.isRequiredInputField)(f)){var m=(0,p.default)(f.type);e.reportError(new c.GraphQLError(o(r.name,l,m),t))}}},ObjectField:function(t){var r=(0,h.getNamedType)(e.getParentInputType());if(!e.getInputType()&&(0,h.isInputObjectType)(r)){var n=(0,v.default)(t.name.value,Object.keys(r.getFields())),i=0!==n.length?"Did you mean ".concat((0,m.default)(n),"?"):void 0;e.reportError(new c.GraphQLError(a(r.name,t.name.value,i),t))}},EnumValue:function(t){var r=(0,h.getNamedType)(e.getInputType());(0,h.isEnumType)(r)?r.getValue(t.value)||e.reportError(new c.GraphQLError(i(r.name,(0,l.print)(t),u(r,t)),t)):s(e,t)},IntValue:function(t){return s(e,t)},FloatValue:function(t){return s(e,t)},StringValue:function(t){return s(e,t)},BooleanValue:function(t){return s(e,t)}}};var c=e("../../error/GraphQLError"),l=e("../../language/printer"),h=e("../../type/definition"),p=n(e("../../jsutils/inspect")),f=n(e("../../jsutils/isInvalid")),d=n(e("../../jsutils/keyMap")),m=n(e("../../jsutils/orList")),v=n(e("../../jsutils/suggestionList"))},{"../../error/GraphQLError":32,"../../jsutils/inspect":46,"../../jsutils/isInvalid":51,"../../jsutils/keyMap":54,"../../jsutils/orList":58,"../../jsutils/suggestionList":62,"../../language/printer":71,"../../type/definition":77}],135:[function(e,t,r){"use strict";function n(e,t){return'Variable "$'.concat(e,'" cannot be non-input type "').concat(t,'".')}Object.defineProperty(r,"__esModule",{value:!0}),r.nonInputTypeOnVarMessage=n,r.VariablesAreInputTypes=function(e){return{VariableDefinition:function(t){var r=(0,s.typeFromAST)(e.getSchema(),t.type);if(r&&!(0,a.isInputType)(r)){var u=t.variable.name.value;e.reportError(new i.GraphQLError(n(u,(0,o.print)(t.type)),[t.type]))}}}};var i=e("../../error/GraphQLError"),o=e("../../language/printer"),a=e("../../type/definition"),s=e("../../utilities/typeFromAST")},{"../../error/GraphQLError":32,"../../language/printer":71,"../../type/definition":77,"../../utilities/typeFromAST":105}],136:[function(e,t,r){"use strict";function n(e,t,r){return'Variable "$'.concat(e,'" of type "').concat(t,'" used in ')+'position expecting type "'.concat(r,'".')}function i(e,t,r,n,i){if((0,u.isNonNullType)(n)&&!(0,u.isNonNullType)(t)){var o=void 0!==i;if(!(r&&r.kind!==s.Kind.NULL)&&!o)return!1;var a=n.ofType;return(0,c.isTypeSubTypeOf)(e,t,a)}return(0,c.isTypeSubTypeOf)(e,t,n)}Object.defineProperty(r,"__esModule",{value:!0}),r.badVarPosMessage=n,r.VariablesInAllowedPosition=function(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(r){var s=e.getRecursiveVariableUsages(r),u=!0,c=!1,h=void 0;try{for(var p,f=s[Symbol.iterator]();!(u=(p=f.next()).done);u=!0){var d=p.value,m=d.node,v=d.type,y=d.defaultValue,g=m.name.value,b=t[g];if(b&&v){var _=e.getSchema(),x=(0,l.typeFromAST)(_,b.type);x&&!i(_,x,b.defaultValue,v,y)&&e.reportError(new a.GraphQLError(n(g,(0,o.default)(x),(0,o.default)(v)),[b,m]))}}}catch(e){c=!0,h=e}finally{try{u||null==f.return||f.return()}finally{if(c)throw h}}}},VariableDefinition:function(e){t[e.variable.name.value]=e}}};var o=function(e){return e&&e.__esModule?e:{default:e}}(e("../../jsutils/inspect")),a=e("../../error/GraphQLError"),s=e("../../language/kinds"),u=e("../../type/definition"),c=e("../../utilities/typeComparators"),l=e("../../utilities/typeFromAST")},{"../../error/GraphQLError":32,"../../jsutils/inspect":46,"../../language/kinds":66,"../../type/definition":77,"../../utilities/typeComparators":104,"../../utilities/typeFromAST":105}],137:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.specifiedSDLRules=r.specifiedRules=void 0;var n=e("./rules/ExecutableDefinitions"),i=e("./rules/UniqueOperationNames"),o=e("./rules/LoneAnonymousOperation"),a=e("./rules/SingleFieldSubscriptions"),s=e("./rules/KnownTypeNames"),u=e("./rules/FragmentsOnCompositeTypes"),c=e("./rules/VariablesAreInputTypes"),l=e("./rules/ScalarLeafs"),h=e("./rules/FieldsOnCorrectType"),p=e("./rules/UniqueFragmentNames"),f=e("./rules/KnownFragmentNames"),d=e("./rules/NoUnusedFragments"),m=e("./rules/PossibleFragmentSpreads"),v=e("./rules/NoFragmentCycles"),y=e("./rules/UniqueVariableNames"),g=e("./rules/NoUndefinedVariables"),b=e("./rules/NoUnusedVariables"),_=e("./rules/KnownDirectives"),x=e("./rules/UniqueDirectivesPerLocation"),w=e("./rules/KnownArgumentNames"),S=e("./rules/UniqueArgumentNames"),T=e("./rules/ValuesOfCorrectType"),E=e("./rules/ProvidedRequiredArguments"),O=e("./rules/VariablesInAllowedPosition"),M=e("./rules/OverlappingFieldsCanBeMerged"),C=e("./rules/UniqueInputFieldNames"),j=e("./rules/LoneSchemaDefinition"),P=[n.ExecutableDefinitions,i.UniqueOperationNames,o.LoneAnonymousOperation,a.SingleFieldSubscriptions,s.KnownTypeNames,u.FragmentsOnCompositeTypes,c.VariablesAreInputTypes,l.ScalarLeafs,h.FieldsOnCorrectType,p.UniqueFragmentNames,f.KnownFragmentNames,d.NoUnusedFragments,m.PossibleFragmentSpreads,v.NoFragmentCycles,y.UniqueVariableNames,g.NoUndefinedVariables,b.NoUnusedVariables,_.KnownDirectives,x.UniqueDirectivesPerLocation,w.KnownArgumentNames,S.UniqueArgumentNames,T.ValuesOfCorrectType,E.ProvidedRequiredArguments,O.VariablesInAllowedPosition,M.OverlappingFieldsCanBeMerged,C.UniqueInputFieldNames];r.specifiedRules=P;var A=[j.LoneSchemaDefinition,_.KnownDirectives,x.UniqueDirectivesPerLocation,w.KnownArgumentNamesOnDirectives,S.UniqueArgumentNames,C.UniqueInputFieldNames,E.ProvidedRequiredArgumentsOnDirectives];r.specifiedSDLRules=A},{"./rules/ExecutableDefinitions":110,"./rules/FieldsOnCorrectType":111,"./rules/FragmentsOnCompositeTypes":112,"./rules/KnownArgumentNames":113,"./rules/KnownDirectives":114,"./rules/KnownFragmentNames":115,"./rules/KnownTypeNames":116,"./rules/LoneAnonymousOperation":117,"./rules/LoneSchemaDefinition":118,"./rules/NoFragmentCycles":119,"./rules/NoUndefinedVariables":120,"./rules/NoUnusedFragments":121,"./rules/NoUnusedVariables":122,"./rules/OverlappingFieldsCanBeMerged":123,"./rules/PossibleFragmentSpreads":124,"./rules/ProvidedRequiredArguments":125,"./rules/ScalarLeafs":126,"./rules/SingleFieldSubscriptions":127,"./rules/UniqueArgumentNames":128,"./rules/UniqueDirectivesPerLocation":129,"./rules/UniqueFragmentNames":130,"./rules/UniqueInputFieldNames":131,"./rules/UniqueOperationNames":132,"./rules/UniqueVariableNames":133,"./rules/ValuesOfCorrectType":134,"./rules/VariablesAreInputTypes":135,"./rules/VariablesInAllowedPosition":136}],138:[function(e,t,r){"use strict";function n(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.specifiedSDLRules,n=new c.SDLValidationContext(e,t),i=r.map(function(e){return e(n)});return(0,o.visit)(e,(0,o.visitInParallel)(i)),n.getErrors()}Object.defineProperty(r,"__esModule",{value:!0}),r.validate=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.specifiedRules,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new s.TypeInfo(e);t||(0,i.default)(0,"Must provide document"),(0,a.assertValidSchema)(e);var l=new c.ValidationContext(e,t,n),h=(0,o.visitInParallel)(r.map(function(e){return e(l)}));return(0,o.visit)(t,(0,o.visitWithTypeInfo)(n,h)),l.getErrors()},r.validateSDL=n,r.assertValidSDL=function(e){var t=n(e);if(0!==t.length)throw new Error(t.map(function(e){return e.message}).join("\n\n"))},r.assertValidSDLExtension=function(e,t){var r=n(e,t);if(0!==r.length)throw new Error(r.map(function(e){return e.message}).join("\n\n"))};var i=function(e){return e&&e.__esModule?e:{default:e}}(e("../jsutils/invariant")),o=e("../language/visitor"),a=e("../type/validate"),s=e("../utilities/TypeInfo"),u=e("./specifiedRules"),c=e("./ValidationContext")},{"../jsutils/invariant":48,"../language/visitor":73,"../type/validate":83,"../utilities/TypeInfo":84,"./ValidationContext":108,"./specifiedRules":137}],139:[function(e,t,r){r.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,h=r?i-1:0,p=r?-1:1,f=e[t+h];for(h+=p,o=f&(1<<-l)-1,f>>=-l,l+=s;l>0;o=256*o+e[t+h],h+=p,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+e[t+h],h+=p,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=c}return(f?-1:1)*a*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(t*u-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+f]=255&a,f+=d,a/=256,c-=8);e[r+f-d]|=128*m}},{}],140:[function(e,t,r){"use strict";function n(e){switch(typeof e){case"object":if(null===e)return!1;case"function":return!0;default:return!1}}function i(e,t,r,n){return Object.defineProperty(e,t,{value:r,enumerable:!!n,writable:!1,configurable:!1}),r}function o(){for(var e=arguments,t=d,r=arguments.length,n=0;n<r;++n){var i=e[n];t=t.get(i)||t.set(i,new c)}return t.data||(t.data=Object.create(null))}function a(){var e=arguments,t=o.apply(null,arguments);if(t.tuple)return t.tuple;for(var r=Object.create(a.prototype),n=arguments.length,s=0;s<n;++s)r[s]=e[s];return i(r,"length",n,!1),f(t.tuple=r)}function s(e){return!(!e||!0!==e[h])}function u(e){for(var t=[],r=e.length;r--;)t[r]=e[r];return t}Object.defineProperty(r,"__esModule",{value:!0});var c=function(){this._weakMap=null,this._strongMap=null,this.data=null};c.prototype.get=function(e){var t=this._getMap(e,!1);if(t)return t.get(e)},c.prototype.set=function(e,t){return this._getMap(e,!0).set(e,t),t},c.prototype._getMap=function(e,t){return t?n(e)?this._weakMap||(this._weakMap=new WeakMap):this._strongMap||(this._strongMap=new Map):n(e)?this._weakMap:this._strongMap};var l="function"==typeof Symbol,h=l?Symbol.for("immutable-tuple"):"@@__IMMUTABLE_TUPLE__@@",p=l?Symbol.for("immutable-tuple-root"):"@@__IMMUTABLE_TUPLE_ROOT__@@",f=Object.freeze||function(e){return e},d=Array[p]||i(Array,p,new c,!1);i(a.prototype,h,!0,!1),a.isTuple=s,function(e){function t(t,r){var n=Object.getOwnPropertyDescriptor(Array.prototype,t);e(t,n,!!r)}t("every"),t("filter"),t("find"),t("findIndex"),t("forEach"),t("includes"),t("indexOf"),t("join"),t("lastIndexOf"),t("map"),t("reduce"),t("reduceRight"),t("slice"),t("some"),t("toLocaleString"),t("toString"),t("reverse",!0),t("sort",!0),t(l&&Symbol.iterator||"@@iterator")}(function(e,t,r){var n=t&&t.value;"function"==typeof n&&(t.value=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i=n.apply(r?u(this):this,e);return Array.isArray(i)?a.apply(void 0,i):i},Object.defineProperty(a.prototype,e,t))});var m=Array.prototype.concat;a.prototype.concat=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return a.apply(void 0,m.apply(u(this),e.map(function(e){return s(e)?u(e):e})))},r.default=a,r.tuple=a,r.lookup=o},{}],141:[function(e,t,r){(function(e){"use strict";var r="undefined"!=typeof window?window:void 0!==e?e:{};t.exports=function(e,t){return e in r?r[e]:(r[e]=t,t)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],142:[function(e,t,r){"use strict";var n=e("./index.js");t.exports=function(e,t,r){var i="__INDIVIDUAL_ONE_VERSION_"+e,o=n(i+"_ENFORCE_SINGLETON",t);if(o!==t)throw new Error("Can only have one copy of "+e+".\nYou already have version "+o+" installed.\nThis means you cannot install version "+t);return n(i,r)}},{"./index.js":141}],143:[function(e,t,r){"use strict";t.exports=function(e){return"object"==typeof e&&null!==e}},{}],144:[function(e,t,r){"use strict";function n(e){return!!a(e)}function i(e){var t=null!=e&&e.length;return"number"==typeof t&&t>=0&&t%1==0}function o(e){var t=a(e);if(t)return t.call(e)}function a(e){if(null!=e){var t=d&&e[d]||e["@@iterator"];if("function"==typeof t)return t}}function s(e){if(null!=e){var t=o(e);if(t)return t;if(i(e))return new u(e)}}function u(e){this._o=e,this._i=0}function c(e){var t=l(e);if(t)return t.call(e)}function l(e){if(null!=e){var t=v&&e[v]||e["@@asyncIterator"];if("function"==typeof t)return t}}function h(e){if(null!=e){var t=c(e);if(t)return t;var r=s(e);if(r)return new p(r)}}function p(e){this._i=e}r.isIterable=n,r.isArrayLike=i,r.isCollection=function(e){return Object(e)===e&&(i(e)||n(e))},r.getIterator=o,r.getIteratorMethod=a,r.createIterator=s,r.forEach=function(e,t,r){if(null!=e){if("function"==typeof e.forEach)return e.forEach(t,r);var n=0,a=o(e);if(a){for(var s;!(s=a.next()).done;)if(t.call(r,s.value,n++,e),n>9999999)throw new TypeError("Near-infinite iteration.")}else if(i(e))for(;n<e.length;n++)e.hasOwnProperty(n)&&t.call(r,e[n],n,e)}},r.isAsyncIterable=function(e){return!!l(e)},r.getAsyncIterator=c,r.getAsyncIteratorMethod=l,r.createAsyncIterator=h,r.forAwaitEach=function(e,t,r){var n=h(e);if(n){var i=0;return new Promise(function(o,a){function s(){return n.next().then(function(n){return n.done?o():Promise.resolve(t.call(r,n.value,i++,e)).then(s).catch(a),null}).catch(a),null}s()})}};var f="function"==typeof Symbol?Symbol:void 0,d=f&&f.iterator,m=r.$$iterator=d||"@@iterator";u.prototype[m]=function(){return this},u.prototype.next=function(){return void 0===this._o||this._i>=this._o.length?(this._o=void 0,{value:void 0,done:!0}):{value:this._o[this._i++],done:!1}};var v=f&&f.asyncIterator,y=r.$$asyncIterator=v||"@@asyncIterator";p.prototype[y]=function(){return this},p.prototype.next=function(){var e=this._i.next();return Promise.resolve(e.value).then(function(t){return{value:t,done:e.done}})}},{}],145:[function(e,t,r){"use strict";var n={};n.base32="0123456789bcdefghjkmnpqrstuvwxyz",n.encode=function(e,t,r){if(void 0===r){for(var i=1;i<=12;i++){var o=n.encode(e,t,i),a=n.decode(o);if(a.lat==e&&a.lon==t)return o}r=12}if(e=Number(e),t=Number(t),r=Number(r),isNaN(e)||isNaN(t)||isNaN(r))throw new Error("Invalid geohash");for(var s=0,u=0,c=!0,l="",h=-90,p=90,f=-180,d=180;l.length<r;){if(c){var m=(f+d)/2;t>=m?(s=2*s+1,f=m):(s*=2,d=m)}else{var v=(h+p)/2;e>=v?(s=2*s+1,h=v):(s*=2,p=v)}c=!c,5==++u&&(l+=n.base32.charAt(s),u=0,s=0)}return l},n.decode=function(e){var t=n.bounds(e),r=t.sw.lat,i=t.sw.lon,o=t.ne.lat,a=t.ne.lon,s=(r+o)/2,u=(i+a)/2;return s=s.toFixed(Math.floor(2-Math.log(o-r)/Math.LN10)),u=u.toFixed(Math.floor(2-Math.log(a-i)/Math.LN10)),{lat:Number(s),lon:Number(u)}},n.bounds=function(e){if(0===e.length)throw new Error("Invalid geohash");e=e.toLowerCase();for(var t=!0,r=-90,i=90,o=-180,a=180,s=0;s<e.length;s++){var u=e.charAt(s),c=n.base32.indexOf(u);if(-1==c)throw new Error("Invalid geohash");for(var l=4;l>=0;l--){var h=c>>l&1;if(t){var p=(o+a)/2;1==h?o=p:a=p}else{var f=(r+i)/2;1==h?r=f:i=f}t=!t}}return{sw:{lat:r,lon:o},ne:{lat:i,lon:a}}},n.adjacent=function(e,t){if(e=e.toLowerCase(),t=t.toLowerCase(),0===e.length)throw new Error("Invalid geohash");if(-1=="nsew".indexOf(t))throw new Error("Invalid direction");var r={n:["p0r21436x8zb9dcf5h7kjnmqesgutwvy","bc01fg45238967deuvhjyznpkmstqrwx"],s:["14365h7k9dcfesgujnmqp0r2twvyx8zb","238967debc01fg45kmstqrwxuvhjyznp"],e:["bc01fg45238967deuvhjyznpkmstqrwx","p0r21436x8zb9dcf5h7kjnmqesgutwvy"],w:["238967debc01fg45kmstqrwxuvhjyznp","14365h7k9dcfesgujnmqp0r2twvyx8zb"]},i={n:["prxz","bcfguvyz"],s:["028b","0145hjnp"],e:["bcfguvyz","prxz"],w:["0145hjnp","028b"]},o=e.slice(-1),a=e.slice(0,-1),s=e.length%2;return-1!=i[t][s].indexOf(o)&&""!==a&&(a=n.adjacent(a,t)),a+n.base32.charAt(r[t][s].indexOf(o))},n.neighbours=function(e){return{n:n.adjacent(e,"n"),ne:n.adjacent(n.adjacent(e,"n"),"e"),e:n.adjacent(e,"e"),se:n.adjacent(n.adjacent(e,"s"),"e"),s:n.adjacent(e,"s"),sw:n.adjacent(n.adjacent(e,"s"),"w"),w:n.adjacent(e,"w"),nw:n.adjacent(n.adjacent(e,"n"),"w")}},void 0!==t&&t.exports&&(t.exports=n)},{}],146:[function(e,t,r){"use strict";function n(e){this.map=new Map,this.newest=null,this.oldest=null,this.max=e&&e.max,this.dispose=e&&e.dispose}function i(e,t){var r=e.map.get(t);if(r&&r!==e.newest){var n=r.older,i=r.newer;i&&(i.older=n),n&&(n.newer=i),r.older=e.newest,r.older.newer=r,r.newer=null,e.newest=r,r===e.oldest&&(e.oldest=i)}return r}r.Cache=n;var o=n.prototype;o.has=function(e){return this.map.has(e)},o.get=function(e){var t=i(this,e);return t&&t.value},o.set=function(e,t){var r=i(this,e);if(r)return r.value=t;if(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),"number"==typeof this.max)for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key);return r.value},o.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),"function"==typeof this.dispose&&this.dispose(e,t.value),!0)}},{}],147:[function(e,t,r){"use strict";function n(e,t){if(!e)throw new Error(t||"assertion failure")}function i(e,t,r){this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,o(this,e,t,r),++i.count}function o(e,t,r,n){e.fn=t,e.key=r,e.args=n,e.value=S,e.dirty=!0,e.subscribe=null,e.unsubscribe=null,e.recomputing=!1,e.reportOrphan=null}function a(e){n(0===e.parents.size),n(0===e.childValues.size),n(null===e.dirtyChildren),E.length<r.POOL_TARGET_SIZE&&E.push(e)}function s(e){var t=e.reportOrphan;return"function"==typeof t&&0===e.parents.size&&!0===t(e)}function u(e){e.dirty=!1,h(e)||l(e)}function c(e){e.parents.forEach(function(t){p(t,e)})}function l(e){e.parents.forEach(function(t){f(t,e)})}function h(e){return e.dirty||e.dirtyChildren&&e.dirtyChildren.size}function p(e,t){if(n(e.childValues.has(t)),n(h(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=T.pop()||new Set;e.dirtyChildren.add(t),c(e)}function f(e,t){var r=e.childValues;n(r.has(t)),n(!h(t));var i=r.get(t);i===S?r.set(t,t.value):i!==t.value&&e.setDirty(),d(e,t),h(e)||l(e)}function d(e,t){var n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(T.length<r.POOL_TARGET_SIZE&&T.push(n),e.dirtyChildren=null))}function m(e){var t=w().currentParentEntry;if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,S),h(e)?p(t,e):f(t,e),t}function v(e){return e.dirty?y(e):h(e)&&(e.dirtyChildren.forEach(function(t){n(e.childValues.has(t));try{v(t)}catch(t){e.setDirty()}}),e.dirty)?y(e):(n(e.value!==S),e.value)}function y(e){n(!e.recomputing,"already recomputing"),e.recomputing=!0;var t=g(e),r=w(),i=r.currentParentEntry;r.currentParentEntry=e;var o=!0;try{e.value=e.fn.apply(null,e.args),o=!1}finally{e.recomputing=!1,n(r.currentParentEntry===e),r.currentParentEntry=i,o||!_(e)?e.setDirty():u(e)}return t.forEach(s),e.value}function g(e){var t=M;return e.childValues.size>0&&(t=[],e.childValues.forEach(function(r,n){b(e,n),t.push(n)})),n(null===e.dirtyChildren),t}function b(e,t){t.parents.delete(e),e.childValues.delete(t),d(e,t)}function _(e){if("function"==typeof e.subscribe)try{x(e),e.unsubscribe=e.subscribe.apply(null,e.args)}catch(t){return e.setDirty(),!1}return!0}function x(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=null,t())}var w=e("./local.js").get,S=Object.create(null),T=[],E=[];r.POOL_TARGET_SIZE=100,i.count=0,i.acquire=function(e,t,r){var n=E.pop();return n?(o(n,e,t,r),n):new i(e,t,r)},r.Entry=i;var O=i.prototype;O.recompute=function(){if(m(this)||!s(this))return v(this)},O.setDirty=function(){this.dirty||(this.dirty=!0,this.value=S,c(this),x(this))},O.dispose=function(){var e=this;g(e).forEach(s),x(e),e.parents.forEach(function(t){t.setDirty(),b(t,e)}),a(e)};var M=[]},{"./local.js":149}],148:[function(e,t,r){"use strict";function n(){return a.apply(null,arguments)}function i(e){return"function"!=typeof(e=e||Object.create(null)).makeCacheKey&&(e.makeCacheKey=n),"number"!=typeof e.max&&(e.max=Math.pow(2,16)),e}var o=e("./cache.js").Cache,a=e("immutable-tuple").tuple,s=e("./entry.js").Entry,u=e("./local.js").get;r.defaultMakeCacheKey=n,r.wrap=function(e,t){function r(e){if(a)return c.delete(e.key),!0}function n(){if(!a||u().currentParentEntry){var n=t.makeCacheKey.apply(null,arguments);if(!n)return e.apply(null,arguments);for(var i=[],o=arguments.length;o--;)i[o]=arguments[o];var l=c.get(n);l?l.args=i:(c.set(n,l=s.acquire(e,n,i)),l.subscribe=t.subscribe,a&&(l.reportOrphan=r));var h=l.recompute();return a?void 0:h}}var a=!!(t=i(t)).disposable,c=new o({max:t.max,dispose:function(e,t){t.dispose()}});return n.dirty=function(){var e=t.makeCacheKey.apply(null,arguments);e&&c.has(e)&&c.get(e).setDirty()},n}},{"./cache.js":146,"./entry.js":147,"./local.js":149,"immutable-tuple":140}],149:[function(e,t,r){"use strict";function n(){return i}var i=new function(){};if("object"==typeof t)try{var o=t["eriuqer".split("").reverse().join("")]("fibers");n=function(){return o.current||i}}catch(e){}r.get=function(){var e=n();return e._optimism_local||(e._optimism_local=Object.create(null))}},{}],150:[function(e,t,r){(function(e){function t(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return i.exec(e).slice(1)};r.resolve=function(){for(var r="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(r=a+"/"+r,i="/"===a.charAt(0))}return r=t(n(r.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(e){var i=r.isAbsolute(e),o="/"===a(e,-1);return(e=t(n(e.split("/"),function(e){return!!e}),!i).join("/"))||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var i=n(e.split("/")),o=n(t.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u<a;u++)if(i[u]!==o[u]){s=u;break}for(var c=[],u=s;u<i.length;u++)c.push("..");return(c=c.concat(o.slice(s))).join("/")},r.sep="/",r.delimiter=":",r.dirname=function(e){var t=o(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},r.basename=function(e,t){var r=o(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},r.extname=function(e){return o(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(this,e("_process"))},{_process:17}],151:[function(e,t,r){"use strict";function n(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}function i(e,t,r){var n,i,o=r.buf;if(i=o[r.pos++],n=(112&i)>>4,i<128)return a(e,n,t);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return a(e,n,t);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return a(e,n,t);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return a(e,n,t);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return a(e,n,t);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return a(e,n,t);throw new Error("Expected varint not more than 10 bytes")}function o(e){return e.type===n.Bytes?e.readVarint()+e.pos:e.pos+1}function a(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function s(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),u(r,n,t),c(n,t)}function u(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}function c(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}function l(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.ceil(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function h(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function p(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function f(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function d(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function m(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function v(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function y(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function g(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function b(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function _(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function x(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function w(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function S(e,t,r){for(var n="",i=t;i<r;){var o=e[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s>r)break;var u,c,l;1===s?o<128&&(a=o):2===s?128==(192&(u=e[i+1]))&&(a=(31&o)<<6|63&u)<=127&&(a=null):3===s?(u=e[i+1],c=e[i+2],128==(192&u)&&128==(192&c)&&((a=(15&o)<<12|(63&u)<<6|63&c)<=2047||a>=55296&&a<=57343)&&(a=null)):4===s&&(u=e[i+1],c=e[i+2],l=e[i+3],128==(192&u)&&128==(192&c)&&128==(192&l)&&((a=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&l)<=65535||a>=1114112)&&(a=null)),null===a?(a=65533,s=1):a>65535&&(a-=65536,n+=String.fromCharCode(a>>>10&1023|55296),a=56320|1023&a),n+=String.fromCharCode(a),i+=s}return n}function T(e,t,r){for(var n,i,o=0;o<t.length;o++){if((n=t.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}t.exports=n;var E=e("ieee754");n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;n.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,e(i,t,this),this.pos===o&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=_(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=w(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=_(this.buf,this.pos)+4294967296*_(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=_(this.buf,this.pos)+4294967296*w(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=E.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=E.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return r=n[this.pos++],t=127&r,r<128?t:(r=n[this.pos++],t|=(127&r)<<7,r<128?t:(r=n[this.pos++],t|=(127&r)<<14,r<128?t:(r=n[this.pos++],t|=(127&r)<<21,r<128?t:(r=n[this.pos],t|=(15&r)<<28,i(t,e,this)))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=S(this.buf,this.pos,e);return this.pos=e,t},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){var r=o(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===n.Varint)for(;this.buf[this.pos++]>127;);else if(t===n.Bytes)this.pos=this.readVarint()+this.pos;else if(t===n.Fixed32)this.pos+=4;else{if(t!==n.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),x(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),x(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),x(this.buf,-1&e,this.pos),x(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),x(this.buf,-1&e,this.pos),x(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?s(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length);var t=++this.pos;this.pos=T(this.buf,e,this.pos);var r=this.pos-t;r>=128&&l(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),E.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),E.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){var r=++this.pos;e(t,this);var n=this.pos-r;n>=128&&l(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,n.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){this.writeMessage(e,h,t)},writePackedSVarint:function(e,t){this.writeMessage(e,p,t)},writePackedBoolean:function(e,t){this.writeMessage(e,m,t)},writePackedFloat:function(e,t){this.writeMessage(e,f,t)},writePackedDouble:function(e,t){this.writeMessage(e,d,t)},writePackedFixed32:function(e,t){this.writeMessage(e,v,t)},writePackedSFixed32:function(e,t){this.writeMessage(e,y,t)},writePackedFixed64:function(e,t){this.writeMessage(e,g,t)},writePackedSFixed64:function(e,t){this.writeMessage(e,b,t)},writeBytesField:function(e,t){this.writeTag(e,n.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,n.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,n.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,n.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,n.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,n.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,n.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,n.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,n.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,n.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}}},{ieee754:139}],152:[function(e,t,r){"use strict";function n(e,t,r,a,s){for(r=r||0,a=a||e.length-1,s=s||o;a>r;){if(a-r>600){var u=a-r+1,c=t-r+1,l=Math.log(u),h=.5*Math.exp(2*l/3),p=.5*Math.sqrt(l*h*(u-h)/u)*(c-u/2<0?-1:1);n(e,t,Math.max(r,Math.floor(t-c*h/u+p)),Math.min(a,Math.floor(t+(u-c)*h/u+p)),s)}var f=e[t],d=r,m=a;for(i(e,r,t),s(e[a],f)>0&&i(e,r,a);d<m;){for(i(e,d,m),d++,m--;s(e[d],f)<0;)d++;for(;s(e[m],f)>0;)m--}0===s(e[r],f)?i(e,r,m):i(e,++m,a),m<=t&&(r=m+1),t<=m&&(a=m-1)}}function i(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function o(e,t){return e<t?-1:e>t?1:0}t.exports=n},{}],153:[function(e,t,r){"use strict";function n(e,t){if(!(this instanceof n))return new n(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&this._initFormat(t),this.clear()}function i(e,t,r){if(!r)return t.indexOf(e);for(var n=0;n<t.length;n++)if(r(e,t[n]))return n;return-1}function o(e,t){a(e,0,e.children.length,t,e)}function a(e,t,r,n,i){i||(i=v(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,a=t;a<r;a++)o=e.children[a],s(i,e.leaf?n(o):o);return i}function s(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function u(e,t){return e.minX-t.minX}function c(e,t){return e.minY-t.minY}function l(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function h(e){return e.maxX-e.minX+(e.maxY-e.minY)}function p(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function f(e,t){var r=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,i-r)*Math.max(0,o-n)}function d(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function m(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function v(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,t,r,n,i){for(var o,a=[t,r];a.length;)(r=a.pop())-(t=a.pop())<=n||(o=t+Math.ceil((r-t)/n/2)*n,g(e,o,t,r,i),a.push(t,o,o,r))}t.exports=n;var g=e("quickselect");n.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,r=[],n=this.toBBox;if(!m(e,t))return r;for(var i,o,a,s,u=[];t;){for(i=0,o=t.children.length;i<o;i++)a=t.children[i],m(e,s=t.leaf?n(a):a)&&(t.leaf?r.push(a):d(e,s)?this._all(a,r):u.push(a));t=u.pop()}return r},collides:function(e){var t=this.data,r=this.toBBox;if(!m(e,t))return!1;for(var n,i,o,a,s=[];t;){for(n=0,i=t.children.length;n<i;n++)if(o=t.children[n],a=t.leaf?r(o):o,m(e,a)){if(t.leaf||d(e,a))return!0;s.push(o)}t=s.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,r=e.length;t<r;t++)this.insert(e[t]);return this}var n=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=v([]),this},remove:function(e,t){if(!e)return this;for(var r,n,o,a,s=this.data,u=this.toBBox(e),c=[],l=[];s||c.length;){if(s||(s=c.pop(),n=c[c.length-1],r=l.pop(),a=!0),s.leaf&&-1!==(o=i(e,s.children,t)))return s.children.splice(o,1),c.push(s),this._condense(c),this;a||s.leaf||!d(s,u)?n?(r++,s=n.children[r],a=!1):s=null:(c.push(s),l.push(r),r=0,n=s,s=s.children[0])}return this},toBBox:function(e){return e},compareMinX:u,compareMinY:c,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){for(var r=[];e;)e.leaf?t.push.apply(t,e.children):r.push.apply(r,e.children),e=r.pop();return t},_build:function(e,t,r,n){var i,a=r-t+1,s=this._maxEntries;if(a<=s)return i=v(e.slice(t,r+1)),o(i,this.toBBox),i;n||(n=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,n-1))),(i=v([])).leaf=!1,i.height=n;var u,c,l,h,p=Math.ceil(a/s),f=p*Math.ceil(Math.sqrt(s));for(y(e,t,r,f,this.compareMinX),u=t;u<=r;u+=f)for(y(e,u,l=Math.min(u+f-1,r),p,this.compareMinY),c=u;c<=l;c+=p)h=Math.min(c+p-1,l),i.children.push(this._build(e,c,h,n-1));return o(i,this.toBBox),i},_chooseSubtree:function(e,t,r,n){for(var i,o,a,s,u,c,h,f;;){if(n.push(t),t.leaf||n.length-1===r)break;for(h=f=1/0,i=0,o=t.children.length;i<o;i++)u=l(a=t.children[i]),(c=p(e,a)-u)<f?(f=c,h=u<h?u:h,s=a):c===f&&u<h&&(h=u,s=a);t=s||t.children[0]}return t},_insert:function(e,t,r){var n=this.toBBox,i=r?e:n(e),o=[],a=this._chooseSubtree(i,this.data,t,o);for(a.children.push(e),s(a,i);t>=0&&o[t].children.length>this._maxEntries;)this._split(o,t),t--;this._adjustParentBBoxes(i,o,t)},_split:function(e,t){var r=e[t],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var a=this._chooseSplitIndex(r,i,n),s=v(r.children.splice(a,r.children.length-a));s.height=r.height,s.leaf=r.leaf,o(r,this.toBBox),o(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(r,s)},_splitRoot:function(e,t){this.data=v([e,t]),this.data.height=e.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,r){var n,i,o,s,u,c,h,p;for(c=h=1/0,n=t;n<=r-t;n++)s=f(i=a(e,0,n,this.toBBox),o=a(e,n,r,this.toBBox)),u=l(i)+l(o),s<c?(c=s,p=n,h=u<h?u:h):s===c&&u<h&&(h=u,p=n);return p},_chooseSplitAxis:function(e,t,r){var n=e.leaf?this.compareMinX:u,i=e.leaf?this.compareMinY:c;this._allDistMargin(e,t,r,n)<this._allDistMargin(e,t,r,i)&&e.children.sort(n)},_allDistMargin:function(e,t,r,n){e.children.sort(n);var i,o,u=this.toBBox,c=a(e,0,t,u),l=a(e,r-t,r,u),p=h(c)+h(l);for(i=t;i<r-t;i++)o=e.children[i],s(c,e.leaf?u(o):o),p+=h(c);for(i=r-t-1;i>=t;i--)o=e.children[i],s(l,e.leaf?u(o):o),p+=h(l);return p},_adjustParentBBoxes:function(e,t,r){for(var n=r;n>=0;n--)s(t[n],e)},_condense:function(e){for(var t,r=e.length-1;r>=0;r--)0===e[r].children.length?r>0?(t=e[r-1].children).splice(t.indexOf(e[r]),1):this.clear():o(e[r],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}},{quickselect:152}],154:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("./Subject"),o=e("./util/ObjectUnsubscribedError"),a=function(e){function t(t){e.call(this),this._value=t}return n(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return r&&!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new o.ObjectUnsubscribedError;return this._value},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(i.Subject);r.BehaviorSubject=a},{"./Subject":162,"./util/ObjectUnsubscribedError":292}],155:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=function(e){function t(t,r,n){e.call(this),this.parent=t,this.outerValue=r,this.outerIndex=n,this.index=0}return n(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(e("./Subscriber").Subscriber);r.InnerSubscriber=i},{"./Subscriber":164}],156:[function(e,t,r){"use strict";var n=e("./Observable"),i=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,r){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return r&&r()}},e.prototype.accept=function(e,t,r){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){switch(this.kind){case"N":return n.Observable.of(this.value);case"E":return n.Observable.throw(this.error);case"C":return n.Observable.empty()}throw new Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}();r.Notification=i},{"./Observable":157}],157:[function(e,t,r){"use strict";var n=e("./util/root"),i=e("./util/toSubscriber"),o=e("./symbol/observable"),a=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this.operator,o=i.toSubscriber(e,t,r);if(n?n.call(o,this.source):o.add(this.source?this._subscribe(o):this._trySubscribe(o)),o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.syncErrorThrown=!0,e.syncErrorValue=t,e.error(t)}},e.prototype.forEach=function(e,t){var r=this;if(t||(n.root.Rx&&n.root.Rx.config&&n.root.Rx.config.Promise?t=n.root.Rx.config.Promise:n.root.Promise&&(t=n.root.Promise)),!t)throw new Error("no Promise impl found");return new t(function(t,n){var i;i=r.subscribe(function(t){if(i)try{e(t)}catch(e){n(e),i.unsubscribe()}else e(t)},n,t)})},e.prototype._subscribe=function(e){return this.source.subscribe(e)},e.prototype[o.observable]=function(){return this},e.create=function(t){return new e(t)},e}();r.Observable=a},{"./symbol/observable":287,"./util/root":304,"./util/toSubscriber":306}],158:[function(e,t,r){"use strict";r.empty={closed:!0,next:function(e){},error:function(e){throw e},complete:function(){}}},{}],159:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=function(e){function t(){e.apply(this,arguments)}return n(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(e("./Subscriber").Subscriber);r.OuterSubscriber=i},{"./Subscriber":164}],160:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("./Subject"),o=e("./scheduler/queue"),a=e("./Subscription"),s=e("./operator/observeOn"),u=e("./util/ObjectUnsubscribedError"),c=e("./SubjectSubscription"),l=function(e){function t(t,r,n){void 0===t&&(t=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY),e.call(this),this.scheduler=n,this._events=[],this._bufferSize=t<1?1:t,this._windowTime=r<1?1:r}return n(t,e),t.prototype.next=function(t){var r=this._getNow();this._events.push(new h(r,t)),this._trimBufferThenGetEvents(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){var t,r=this._trimBufferThenGetEvents(),n=this.scheduler;if(this.closed)throw new u.ObjectUnsubscribedError;this.hasError?t=a.Subscription.EMPTY:this.isStopped?t=a.Subscription.EMPTY:(this.observers.push(e),t=new c.SubjectSubscription(this,e)),n&&e.add(e=new s.ObserveOnSubscriber(e,n));for(var i=r.length,o=0;o<i&&!e.closed;o++)e.next(r[o].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),t},t.prototype._getNow=function(){return(this.scheduler||o.queue).now()},t.prototype._trimBufferThenGetEvents=function(){for(var e=this._getNow(),t=this._bufferSize,r=this._windowTime,n=this._events,i=n.length,o=0;o<i&&!(e-n[o].time<r);)o++;return i>t&&(o=Math.max(o,i-t)),o>0&&n.splice(0,o),n},t}(i.Subject);r.ReplaySubject=l;var h=function(){return function(e,t){this.time=e,this.value=t}}()},{"./Subject":162,"./SubjectSubscription":163,"./Subscription":165,"./operator/observeOn":259,"./scheduler/queue":285,"./util/ObjectUnsubscribedError":292}],161:[function(e,t,r){"use strict";var n=function(){function e(t,r){void 0===r&&(r=e.now),this.SchedulerAction=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(r,t)},e.now=Date.now?Date.now:function(){return+new Date},e}();r.Scheduler=n},{}],162:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("./Observable"),o=e("./Subscriber"),a=e("./Subscription"),s=e("./util/ObjectUnsubscribedError"),u=e("./SubjectSubscription"),c=e("./symbol/rxSubscriber"),l=function(e){function t(t){e.call(this,t),this.destination=t}return n(t,e),t}(o.Subscriber);r.SubjectSubscriber=l;var h=function(e){function t(){e.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return n(t,e),t.prototype[c.rxSubscriber]=function(){return new l(this)},t.prototype.lift=function(e){var t=new p(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new s.ObjectUnsubscribedError;if(!this.isStopped)for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new s.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new s.ObjectUnsubscribedError;this.isStopped=!0;for(var e=this.observers,t=e.length,r=e.slice(),n=0;n<t;n++)r[n].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new s.ObjectUnsubscribedError;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new s.ObjectUnsubscribedError;return this.hasError?(e.error(this.thrownError),a.Subscription.EMPTY):this.isStopped?(e.complete(),a.Subscription.EMPTY):(this.observers.push(e),new u.SubjectSubscription(this,e))},t.prototype.asObservable=function(){var e=new i.Observable;return e.source=this,e},t.create=function(e,t){return new p(e,t)},t}(i.Observable);r.Subject=h;var p=function(e){function t(t,r){e.call(this),this.destination=t,this.source=r}return n(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):a.Subscription.EMPTY},t}(h);r.AnonymousSubject=p},{"./Observable":157,"./SubjectSubscription":163,"./Subscriber":164,"./Subscription":165,"./symbol/rxSubscriber":288,"./util/ObjectUnsubscribedError":292}],163:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=function(e){function t(t,r){e.call(this),this.subject=t,this.subscriber=r,this.closed=!1}return n(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}},t}(e("./Subscription").Subscription);r.SubjectSubscription=i},{"./Subscription":165}],164:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("./util/isFunction"),o=e("./Subscription"),a=e("./Observer"),s=e("./symbol/rxSubscriber"),u=function(e){function t(r,n,i){switch(e.call(this),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=a.empty;break;case 1:if(!r){this.destination=a.empty;break}if("object"==typeof r){r instanceof t?(this.destination=r,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new c(this,r));break}default:this.syncErrorThrowable=!0,this.destination=new c(this,r,n,i)}}return n(t,e),t.prototype[s.rxSubscriber]=function(){return this},t.create=function(e,r,n){var i=new t(e,r,n);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this,t=e._parent,r=e._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=t,this._parents=r,this},t}(o.Subscription);r.Subscriber=u;var c=function(e){function t(t,r,n,o){e.call(this),this._parentSubscriber=t;var s,u=this;i.isFunction(r)?s=r:r&&(s=r.next,n=r.error,o=r.complete,r!==a.empty&&(u=Object.create(r),i.isFunction(u.unsubscribe)&&this.add(u.unsubscribe.bind(u)),u.unsubscribe=this.unsubscribe.bind(this))),this._context=u,this._next=s,this._error=n,this._complete=o}return n(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber;if(this._error)t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else{if(!t.syncErrorThrowable)throw this.unsubscribe(),e;t.syncErrorValue=e,t.syncErrorThrown=!0,this.unsubscribe()}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var r=function(){return e._complete.call(e._context)};t.syncErrorThrowable?(this.__tryOrSetError(t,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){throw this.unsubscribe(),e}},t.prototype.__tryOrSetError=function(e,t,r){try{t.call(this._context,r)}catch(t){return e.syncErrorValue=t,e.syncErrorThrown=!0,!0}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(u)},{"./Observer":158,"./Subscription":165,"./symbol/rxSubscriber":288,"./util/isFunction":299}],165:[function(e,t,r){"use strict";function n(e){return e.reduce(function(e,t){return e.concat(t instanceof c.UnsubscriptionError?t.errors:t)},[])}var i=e("./util/isArray"),o=e("./util/isObject"),a=e("./util/isFunction"),s=e("./util/tryCatch"),u=e("./util/errorObject"),c=e("./util/UnsubscriptionError"),l=function(){function e(e){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,e&&(this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var e,t=!1;if(!this.closed){var r=this,l=r._parent,h=r._parents,p=r._unsubscribe,f=r._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var d=-1,m=h?h.length:0;l;)l.remove(this),l=++d<m&&h[d]||null;if(a.isFunction(p)&&(y=s.tryCatch(p).call(this))===u.errorObject&&(t=!0,e=e||(u.errorObject.e instanceof c.UnsubscriptionError?n(u.errorObject.e.errors):[u.errorObject.e])),i.isArray(f))for(d=-1,m=f.length;++d<m;){var v=f[d];if(o.isObject(v)){var y=s.tryCatch(v.unsubscribe).call(v);if(y===u.errorObject){t=!0,e=e||[];var g=u.errorObject.e;g instanceof c.UnsubscriptionError?e=e.concat(n(g.errors)):e.push(g)}}}if(t)throw new c.UnsubscriptionError(e)}},e.prototype.add=function(t){if(!t||t===e.EMPTY)return e.EMPTY;if(t===this)return this;var r=t;switch(typeof t){case"function":r=new e(t);case"object":if(r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if("function"!=typeof r._addParent){var n=r;(r=new e)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(r),r._addParent(this),r},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}},e.prototype._addParent=function(e){var t=this,r=t._parent,n=t._parents;r&&r!==e?n?-1===n.indexOf(e)&&n.push(e):this._parents=[e]:this._parent=e},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();r.Subscription=l},{"./util/UnsubscriptionError":294,"./util/errorObject":295,"./util/isArray":296,"./util/isFunction":299,"./util/isObject":301,"./util/tryCatch":307}],166:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../observable/combineLatest");n.Observable.combineLatest=i.combineLatest},{"../../Observable":157,"../../observable/combineLatest":227}],167:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../observable/defer");n.Observable.defer=i.defer},{"../../Observable":157,"../../observable/defer":228}],168:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../observable/empty");n.Observable.empty=i.empty},{"../../Observable":157,"../../observable/empty":229}],169:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../observable/from");n.Observable.from=i.from},{"../../Observable":157,"../../observable/from":230}],170:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../observable/fromEvent");n.Observable.fromEvent=i.fromEvent},{"../../Observable":157,"../../observable/fromEvent":231}],171:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../observable/fromPromise");n.Observable.fromPromise=i.fromPromise},{"../../Observable":157,"../../observable/fromPromise":232}],172:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../observable/merge");n.Observable.merge=i.merge},{"../../Observable":157,"../../observable/merge":233}],173:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../observable/of");n.Observable.of=i.of},{"../../Observable":157,"../../observable/of":234}],174:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../observable/throw");n.Observable.throw=i._throw},{"../../Observable":157,"../../observable/throw":235}],175:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../observable/timer");n.Observable.timer=i.timer},{"../../Observable":157,"../../observable/timer":236}],176:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../observable/zip");n.Observable.zip=i.zip},{"../../Observable":157,"../../observable/zip":237}],177:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/buffer");n.Observable.prototype.buffer=i.buffer},{"../../Observable":157,"../../operator/buffer":238}],178:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/bufferCount");n.Observable.prototype.bufferCount=i.bufferCount},{"../../Observable":157,"../../operator/bufferCount":239}],179:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/bufferWhen");n.Observable.prototype.bufferWhen=i.bufferWhen},{"../../Observable":157,"../../operator/bufferWhen":240}],180:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/catch");n.Observable.prototype.catch=i._catch,n.Observable.prototype._catch=i._catch},{"../../Observable":157,"../../operator/catch":241}],181:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/combineLatest");n.Observable.prototype.combineLatest=i.combineLatest},{"../../Observable":157,"../../operator/combineLatest":242}],182:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/concat");n.Observable.prototype.concat=i.concat},{"../../Observable":157,"../../operator/concat":243}],183:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/debounceTime");n.Observable.prototype.debounceTime=i.debounceTime},{"../../Observable":157,"../../operator/debounceTime":244}],184:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/delay");n.Observable.prototype.delay=i.delay},{"../../Observable":157,"../../operator/delay":245}],185:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/distinct");n.Observable.prototype.distinct=i.distinct},{"../../Observable":157,"../../operator/distinct":246}],186:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/distinctUntilChanged");n.Observable.prototype.distinctUntilChanged=i.distinctUntilChanged},{"../../Observable":157,"../../operator/distinctUntilChanged":247}],187:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/do");n.Observable.prototype.do=i._do,n.Observable.prototype._do=i._do},{"../../Observable":157,"../../operator/do":248}],188:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/expand");n.Observable.prototype.expand=i.expand},{"../../Observable":157,"../../operator/expand":249}],189:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/filter");n.Observable.prototype.filter=i.filter},{"../../Observable":157,"../../operator/filter":250}],190:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/finally");n.Observable.prototype.finally=i._finally,n.Observable.prototype._finally=i._finally},{"../../Observable":157,"../../operator/finally":251}],191:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/first");n.Observable.prototype.first=i.first},{"../../Observable":157,"../../operator/first":252}],192:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/last");n.Observable.prototype.last=i.last},{"../../Observable":157,"../../operator/last":253}],193:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/map");n.Observable.prototype.map=i.map},{"../../Observable":157,"../../operator/map":254}],194:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/merge");n.Observable.prototype.merge=i.merge},{"../../Observable":157,"../../operator/merge":255}],195:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/mergeAll");n.Observable.prototype.mergeAll=i.mergeAll},{"../../Observable":157,"../../operator/mergeAll":256}],196:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/mergeMap");n.Observable.prototype.mergeMap=i.mergeMap,n.Observable.prototype.flatMap=i.mergeMap},{"../../Observable":157,"../../operator/mergeMap":257}],197:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/pairwise");n.Observable.prototype.pairwise=i.pairwise},{"../../Observable":157,"../../operator/pairwise":260}],198:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/pluck");n.Observable.prototype.pluck=i.pluck},{"../../Observable":157,"../../operator/pluck":261}],199:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/publish");n.Observable.prototype.publish=i.publish},{"../../Observable":157,"../../operator/publish":262}],200:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/publishReplay");n.Observable.prototype.publishReplay=i.publishReplay},{"../../Observable":157,"../../operator/publishReplay":263}],201:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/sample");n.Observable.prototype.sample=i.sample},{"../../Observable":157,"../../operator/sample":264}],202:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/scan");n.Observable.prototype.scan=i.scan},{"../../Observable":157,"../../operator/scan":265}],203:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/share");n.Observable.prototype.share=i.share},{"../../Observable":157,"../../operator/share":266}],204:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/skip");n.Observable.prototype.skip=i.skip},{"../../Observable":157,"../../operator/skip":267}],205:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/skipUntil");n.Observable.prototype.skipUntil=i.skipUntil},{"../../Observable":157,"../../operator/skipUntil":268}],206:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/skipWhile");n.Observable.prototype.skipWhile=i.skipWhile},{"../../Observable":157,"../../operator/skipWhile":269}],207:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/startWith");n.Observable.prototype.startWith=i.startWith},{"../../Observable":157,"../../operator/startWith":270}],208:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/switchMap");n.Observable.prototype.switchMap=i.switchMap},{"../../Observable":157,"../../operator/switchMap":271}],209:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/take");n.Observable.prototype.take=i.take},{"../../Observable":157,"../../operator/take":272}],210:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/takeUntil");n.Observable.prototype.takeUntil=i.takeUntil},{"../../Observable":157,"../../operator/takeUntil":273}],211:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/takeWhile");n.Observable.prototype.takeWhile=i.takeWhile},{"../../Observable":157,"../../operator/takeWhile":274}],212:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/throttleTime");n.Observable.prototype.throttleTime=i.throttleTime},{"../../Observable":157,"../../operator/throttleTime":276}],213:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/withLatestFrom");n.Observable.prototype.withLatestFrom=i.withLatestFrom},{"../../Observable":157,"../../operator/withLatestFrom":277}],214:[function(e,t,r){"use strict";var n=e("../../Observable"),i=e("../../operator/zip");n.Observable.prototype.zip=i.zipProto},{"../../Observable":157,"../../operator/zip":278}],215:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Observable"),o=e("./ScalarObservable"),a=e("./EmptyObservable"),s=function(e){function t(t,r){e.call(this),this.arrayLike=t,this.scheduler=r,r||1!==t.length||(this._isScalar=!0,this.value=t[0])}return n(t,e),t.create=function(e,r){var n=e.length;return 0===n?new a.EmptyObservable:1===n?new o.ScalarObservable(e[0],r):new t(e,r)},t.dispatch=function(e){var t=e.arrayLike,r=e.index,n=e.length,i=e.subscriber;i.closed||(r>=n?i.complete():(i.next(t[r]),e.index=r+1,this.schedule(e)))},t.prototype._subscribe=function(e){var r=this,n=r.arrayLike,i=r.scheduler,o=n.length;if(i)return i.schedule(t.dispatch,0,{arrayLike:n,index:0,length:o,subscriber:e});for(var a=0;a<o&&!e.closed;a++)e.next(n[a]);e.complete()},t}(i.Observable);r.ArrayLikeObservable=s},{"../Observable":157,"./EmptyObservable":219,"./ScalarObservable":225}],216:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Observable"),o=e("./ScalarObservable"),a=e("./EmptyObservable"),s=e("../util/isScheduler"),u=function(e){function t(t,r){e.call(this),this.array=t,this.scheduler=r,r||1!==t.length||(this._isScalar=!0,this.value=t[0])}return n(t,e),t.create=function(e,r){return new t(e,r)},t.of=function(){for(var e=[],r=0;r<arguments.length;r++)e[r-0]=arguments[r];var n=e[e.length-1];s.isScheduler(n)?e.pop():n=null;var i=e.length;return i>1?new t(e,n):1===i?new o.ScalarObservable(e[0],n):new a.EmptyObservable(n)},t.dispatch=function(e){var t=e.array,r=e.index,n=e.count,i=e.subscriber;r>=n?i.complete():(i.next(t[r]),i.closed||(e.index=r+1,this.schedule(e)))},t.prototype._subscribe=function(e){var r=this.array,n=r.length,i=this.scheduler;if(i)return i.schedule(t.dispatch,0,{array:r,index:0,count:n,subscriber:e});for(var o=0;o<n&&!e.closed;o++)e.next(r[o]);e.complete()},t}(i.Observable);r.ArrayObservable=u},{"../Observable":157,"../util/isScheduler":303,"./EmptyObservable":219,"./ScalarObservable":225}],217:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subject"),o=e("../Observable"),a=e("../Subscriber"),s=e("../Subscription"),u=function(e){function t(t,r){e.call(this),this.source=t,this.subjectFactory=r,this._refCount=0,this._isComplete=!1}return n(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var e=this._connection;return e||(this._isComplete=!1,(e=this._connection=new s.Subscription).add(this.source.subscribe(new l(this.getSubject(),this))),e.closed?(this._connection=null,e=s.Subscription.EMPTY):this._connection=e),e},t.prototype.refCount=function(){return this.lift(new h(this))},t}(o.Observable);r.ConnectableObservable=u;var c=u.prototype;r.connectableObservableDescriptor={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:c._subscribe},_isComplete:{value:c._isComplete,writable:!0},getSubject:{value:c.getSubject},connect:{value:c.connect},refCount:{value:c.refCount}};var l=function(e){function t(t,r){e.call(this,t),this.connectable=r}return n(t,e),t.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},t}(i.SubjectSubscriber),h=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var r=this.connectable;r._refCount++;var n=new p(e,r),i=t.subscribe(n);return n.closed||(n.connection=r.connect()),i},e}(),p=function(e){function t(t,r){e.call(this,t),this.connectable=r}return n(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._refCount;if(t<=0)this.connection=null;else if(e._refCount=t-1,t>1)this.connection=null;else{var r=this.connection,n=e._connection;this.connection=null,!n||r&&n!==r||n.unsubscribe()}}else this.connection=null},t}(a.Subscriber)},{"../Observable":157,"../Subject":162,"../Subscriber":164,"../Subscription":165}],218:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Observable"),o=e("../util/subscribeToResult"),a=e("../OuterSubscriber"),s=function(e){function t(t){e.call(this),this.observableFactory=t}return n(t,e),t.create=function(e){return new t(e)},t.prototype._subscribe=function(e){return new u(e,this.observableFactory)},t}(i.Observable);r.DeferObservable=s;var u=function(e){function t(t,r){e.call(this,t),this.factory=r,this.tryDefer()}return n(t,e),t.prototype.tryDefer=function(){try{this._callFactory()}catch(e){this._error(e)}},t.prototype._callFactory=function(){var e=this.factory();e&&this.add(o.subscribeToResult(this,e))},t}(a.OuterSubscriber)},{"../Observable":157,"../OuterSubscriber":159,"../util/subscribeToResult":305}],219:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=function(e){function t(t){e.call(this),this.scheduler=t}return n(t,e),t.create=function(e){return new t(e)},t.dispatch=function(e){e.subscriber.complete()},t.prototype._subscribe=function(e){var r=this.scheduler;if(r)return r.schedule(t.dispatch,0,{subscriber:e});e.complete()},t}(e("../Observable").Observable);r.EmptyObservable=i},{"../Observable":157}],220:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=function(e){function t(t,r){e.call(this),this.error=t,this.scheduler=r}return n(t,e),t.create=function(e,r){return new t(e,r)},t.dispatch=function(e){var t=e.error;e.subscriber.error(t)},t.prototype._subscribe=function(e){var r=this.error,n=this.scheduler;if(e.syncErrorThrowable=!0,n)return n.schedule(t.dispatch,0,{error:r,subscriber:e});e.error(r)},t}(e("../Observable").Observable);r.ErrorObservable=i},{"../Observable":157}],221:[function(e,t,r){"use strict";function n(e){return!!e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}function i(e){return!!e&&"function"==typeof e.on&&"function"==typeof e.off}function o(e){return!!e&&"[object NodeList]"===d.call(e)}function a(e){return!!e&&"[object HTMLCollection]"===d.call(e)}function s(e){return!!e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}var u=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},c=e("../Observable"),l=e("../util/tryCatch"),h=e("../util/isFunction"),p=e("../util/errorObject"),f=e("../Subscription"),d=Object.prototype.toString,m=function(e){function t(t,r,n,i){e.call(this),this.sourceObj=t,this.eventName=r,this.selector=n,this.options=i}return u(t,e),t.create=function(e,r,n,i){return h.isFunction(n)&&(i=n,n=void 0),new t(e,r,i,n)},t.setupSubscription=function(e,r,u,c,l){var h;if(o(e)||a(e))for(var p=0,d=e.length;p<d;p++)t.setupSubscription(e[p],r,u,c,l);else if(s(e)){var m=e;e.addEventListener(r,u,l),h=function(){return m.removeEventListener(r,u)}}else if(i(e)){var v=e;e.on(r,u),h=function(){return v.off(r,u)}}else{if(!n(e))throw new TypeError("Invalid event target");var y=e;e.addListener(r,u),h=function(){return y.removeListener(r,u)}}c.add(new f.Subscription(h))},t.prototype._subscribe=function(e){var r=this.sourceObj,n=this.eventName,i=this.options,o=this.selector,a=o?function(){for(var t=[],r=0;r<arguments.length;r++)t[r-0]=arguments[r];var n=l.tryCatch(o).apply(void 0,t);n===p.errorObject?e.error(p.errorObject.e):e.next(n)}:function(t){return e.next(t)};t.setupSubscription(r,n,a,e,i)},t}(c.Observable);r.FromEventObservable=m},{"../Observable":157,"../Subscription":165,"../util/errorObject":295,"../util/isFunction":299,"../util/tryCatch":307}],222:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../util/isArray"),o=e("../util/isArrayLike"),a=e("../util/isPromise"),s=e("./PromiseObservable"),u=e("./IteratorObservable"),c=e("./ArrayObservable"),l=e("./ArrayLikeObservable"),h=e("../symbol/iterator"),p=e("../Observable"),f=e("../operator/observeOn"),d=e("../symbol/observable"),m=function(e){function t(t,r){e.call(this,null),this.ish=t,this.scheduler=r}return n(t,e),t.create=function(e,r){if(null!=e){if("function"==typeof e[d.observable])return e instanceof p.Observable&&!r?e:new t(e,r);if(i.isArray(e))return new c.ArrayObservable(e,r);if(a.isPromise(e))return new s.PromiseObservable(e,r);if("function"==typeof e[h.iterator]||"string"==typeof e)return new u.IteratorObservable(e,r);if(o.isArrayLike(e))return new l.ArrayLikeObservable(e,r)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")},t.prototype._subscribe=function(e){var t=this.ish,r=this.scheduler;return null==r?t[d.observable]().subscribe(e):t[d.observable]().subscribe(new f.ObserveOnSubscriber(e,r,0))},t}(p.Observable);r.FromObservable=m},{"../Observable":157,"../operator/observeOn":259,"../symbol/iterator":286,"../symbol/observable":287,"../util/isArray":296,"../util/isArrayLike":297,"../util/isPromise":302,"./ArrayLikeObservable":215,"./ArrayObservable":216,"./IteratorObservable":223,"./PromiseObservable":224}],223:[function(e,t,r){"use strict";function n(e){var t=e[l.iterator];if(!t&&"string"==typeof e)return new p(e);if(!t&&void 0!==e.length)return new f(e);if(!t)throw new TypeError("object is not iterable");return e[l.iterator]()}function i(e){var t=+e.length;return isNaN(t)?0:0!==t&&o(t)?(t=a(t)*Math.floor(Math.abs(t)))<=0?0:t>d?d:t:t}function o(e){return"number"==typeof e&&u.root.isFinite(e)}function a(e){var t=+e;return 0===t?t:isNaN(t)?t:t<0?-1:1}var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},u=e("../util/root"),c=e("../Observable"),l=e("../symbol/iterator"),h=function(e){function t(t,r){if(e.call(this),this.scheduler=r,null==t)throw new Error("iterator cannot be null.");this.iterator=n(t)}return s(t,e),t.create=function(e,r){return new t(e,r)},t.dispatch=function(e){var t=e.index,r=e.hasError,n=e.iterator,i=e.subscriber;if(r)i.error(e.error);else{var o=n.next();o.done?i.complete():(i.next(o.value),e.index=t+1,i.closed?"function"==typeof n.return&&n.return():this.schedule(e))}},t.prototype._subscribe=function(e){var r=this,n=r.iterator,i=r.scheduler;if(i)return i.schedule(t.dispatch,0,{index:0,iterator:n,subscriber:e});for(;;){var o=n.next();if(o.done){e.complete();break}if(e.next(o.value),e.closed){"function"==typeof n.return&&n.return();break}}},t}(c.Observable);r.IteratorObservable=h;var p=function(){function e(e,t,r){void 0===t&&(t=0),void 0===r&&(r=e.length),this.str=e,this.idx=t,this.len=r}return e.prototype[l.iterator]=function(){return this},e.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.str.charAt(this.idx++)}:{done:!0,value:void 0}},e}(),f=function(){function e(e,t,r){void 0===t&&(t=0),void 0===r&&(r=i(e)),this.arr=e,this.idx=t,this.len=r}return e.prototype[l.iterator]=function(){return this},e.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.arr[this.idx++]}:{done:!0,value:void 0}},e}(),d=Math.pow(2,53)-1},{"../Observable":157,"../symbol/iterator":286,"../util/root":304}],224:[function(e,t,r){"use strict";function n(e){var t=e.value,r=e.subscriber;r.closed||(r.next(t),r.complete())}function i(e){var t=e.err,r=e.subscriber;r.closed||r.error(t)}var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=e("../util/root"),s=function(e){function t(t,r){e.call(this),this.promise=t,this.scheduler=r}return o(t,e),t.create=function(e,r){return new t(e,r)},t.prototype._subscribe=function(e){var t=this,r=this.promise,o=this.scheduler;if(null==o)this._isScalar?e.closed||(e.next(this.value),e.complete()):r.then(function(r){t.value=r,t._isScalar=!0,e.closed||(e.next(r),e.complete())},function(t){e.closed||e.error(t)}).then(null,function(e){a.root.setTimeout(function(){throw e})});else if(this._isScalar){if(!e.closed)return o.schedule(n,0,{value:this.value,subscriber:e})}else r.then(function(r){t.value=r,t._isScalar=!0,e.closed||e.add(o.schedule(n,0,{value:r,subscriber:e}))},function(t){e.closed||e.add(o.schedule(i,0,{err:t,subscriber:e}))}).then(null,function(e){a.root.setTimeout(function(){throw e})})},t}(e("../Observable").Observable);r.PromiseObservable=s},{"../Observable":157,"../util/root":304}],225:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=function(e){function t(t,r){e.call(this),this.value=t,this.scheduler=r,this._isScalar=!0,r&&(this._isScalar=!1)}return n(t,e),t.create=function(e,r){return new t(e,r)},t.dispatch=function(e){var t=e.done,r=e.value,n=e.subscriber;t?n.complete():(n.next(r),n.closed||(e.done=!0,this.schedule(e)))},t.prototype._subscribe=function(e){var r=this.value,n=this.scheduler;if(n)return n.schedule(t.dispatch,0,{done:!1,value:r,subscriber:e});e.next(r),e.closed||e.complete()},t}(e("../Observable").Observable);r.ScalarObservable=i},{"../Observable":157}],226:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../util/isNumeric"),o=e("../Observable"),a=e("../scheduler/async"),s=e("../util/isScheduler"),u=e("../util/isDate"),c=function(e){function t(t,r,n){void 0===t&&(t=0),e.call(this),this.period=-1,this.dueTime=0,i.isNumeric(r)?this.period=Number(r)<1&&1||Number(r):s.isScheduler(r)&&(n=r),s.isScheduler(n)||(n=a.async),this.scheduler=n,this.dueTime=u.isDate(t)?+t-this.scheduler.now():t}return n(t,e),t.create=function(e,r,n){return void 0===e&&(e=0),new t(e,r,n)},t.dispatch=function(e){var t=e.index,r=e.period,n=e.subscriber,i=this;if(n.next(t),!n.closed){if(-1===r)return n.complete();e.index=t+1,i.schedule(e,r)}},t.prototype._subscribe=function(e){var r=this,n=r.period,i=r.dueTime;return r.scheduler.schedule(t.dispatch,i,{index:0,period:n,subscriber:e})},t}(o.Observable);r.TimerObservable=c},{"../Observable":157,"../scheduler/async":284,"../util/isDate":298,"../util/isNumeric":300,"../util/isScheduler":303}],227:[function(e,t,r){"use strict";var n=e("../util/isScheduler"),i=e("../util/isArray"),o=e("./ArrayObservable"),a=e("../operator/combineLatest");r.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];var r=null,s=null;return n.isScheduler(e[e.length-1])&&(s=e.pop()),"function"==typeof e[e.length-1]&&(r=e.pop()),1===e.length&&i.isArray(e[0])&&(e=e[0]),new o.ArrayObservable(e,s).lift(new a.CombineLatestOperator(r))}},{"../operator/combineLatest":242,"../util/isArray":296,"../util/isScheduler":303,"./ArrayObservable":216}],228:[function(e,t,r){"use strict";var n=e("./DeferObservable");r.defer=n.DeferObservable.create},{"./DeferObservable":218}],229:[function(e,t,r){"use strict";var n=e("./EmptyObservable");r.empty=n.EmptyObservable.create},{"./EmptyObservable":219}],230:[function(e,t,r){"use strict";var n=e("./FromObservable");r.from=n.FromObservable.create},{"./FromObservable":222}],231:[function(e,t,r){"use strict";var n=e("./FromEventObservable");r.fromEvent=n.FromEventObservable.create},{"./FromEventObservable":221}],232:[function(e,t,r){"use strict";var n=e("./PromiseObservable");r.fromPromise=n.PromiseObservable.create},{"./PromiseObservable":224}],233:[function(e,t,r){"use strict";var n=e("../operator/merge");r.merge=n.mergeStatic},{"../operator/merge":255}],234:[function(e,t,r){"use strict";var n=e("./ArrayObservable");r.of=n.ArrayObservable.of},{"./ArrayObservable":216}],235:[function(e,t,r){"use strict";var n=e("./ErrorObservable");r._throw=n.ErrorObservable.create},{"./ErrorObservable":220}],236:[function(e,t,r){"use strict";var n=e("./TimerObservable");r.timer=n.TimerObservable.create},{"./TimerObservable":226}],237:[function(e,t,r){"use strict";var n=e("../operator/zip");r.zip=n.zipStatic},{"../operator/zip":278}],238:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../OuterSubscriber"),o=e("../util/subscribeToResult");r.buffer=function(e){return this.lift(new a(e))};var a=function(){function e(e){this.closingNotifier=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.closingNotifier))},e}(),s=function(e){function t(t,r){e.call(this,t),this.buffer=[],this.add(o.subscribeToResult(this,r))}return n(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype.notifyNext=function(e,t,r,n,i){var o=this.buffer;this.buffer=[],this.destination.next(o)},t}(i.OuterSubscriber)},{"../OuterSubscriber":159,"../util/subscribeToResult":305}],239:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subscriber");r.bufferCount=function(e,t){return void 0===t&&(t=null),this.lift(new o(e,t))};var o=function(){function e(e,t){this.bufferSize=e,this.startBufferEvery=t,this.subscriberClass=t&&e!==t?s:a}return e.prototype.call=function(e,t){return t.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},e}(),a=function(e){function t(t,r){e.call(this,t),this.bufferSize=r,this.buffer=[]}return n(t,e),t.prototype._next=function(e){var t=this.buffer;t.push(e),t.length==this.bufferSize&&(this.destination.next(t),this.buffer=[])},t.prototype._complete=function(){var t=this.buffer;t.length>0&&this.destination.next(t),e.prototype._complete.call(this)},t}(i.Subscriber),s=function(e){function t(t,r,n){e.call(this,t),this.bufferSize=r,this.startBufferEvery=n,this.buffers=[],this.count=0}return n(t,e),t.prototype._next=function(e){var t=this,r=t.bufferSize,n=t.startBufferEvery,i=t.buffers,o=t.count;this.count++,o%n==0&&i.push([]);for(var a=i.length;a--;){var s=i[a];s.push(e),s.length===r&&(i.splice(a,1),this.destination.next(s))}},t.prototype._complete=function(){for(var t=this,r=t.buffers,n=t.destination;r.length>0;){var i=r.shift();i.length>0&&n.next(i)}e.prototype._complete.call(this)},t}(i.Subscriber)},{"../Subscriber":164}],240:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subscription"),o=e("../util/tryCatch"),a=e("../util/errorObject"),s=e("../OuterSubscriber"),u=e("../util/subscribeToResult");r.bufferWhen=function(e){return this.lift(new c(e))};var c=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.closingSelector))},e}(),l=function(e){function t(t,r){e.call(this,t),this.closingSelector=r,this.subscribing=!1,this.openBuffer()}return n(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=null,this.subscribing=!1},t.prototype.notifyNext=function(e,t,r,n,i){this.openBuffer()},t.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},t.prototype.openBuffer=function(){var e=this.closingSubscription;e&&(this.remove(e),e.unsubscribe());var t=this.buffer;this.buffer&&this.destination.next(t),this.buffer=[];var r=o.tryCatch(this.closingSelector)();r===a.errorObject?this.error(a.errorObject.e):(e=new i.Subscription,this.closingSubscription=e,this.add(e),this.subscribing=!0,e.add(u.subscribeToResult(this,r)),this.subscribing=!1)},t}(s.OuterSubscriber)},{"../OuterSubscriber":159,"../Subscription":165,"../util/errorObject":295,"../util/subscribeToResult":305,"../util/tryCatch":307}],241:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../OuterSubscriber"),o=e("../util/subscribeToResult");r._catch=function(e){var t=new a(e),r=this.lift(t);return t.caught=r};var a=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.selector,this.caught))},e}(),s=function(e){function t(t,r,n){e.call(this,t),this.selector=r,this.caught=n}return n(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=void 0;try{r=this.selector(t,this.caught)}catch(t){return void e.prototype.error.call(this,t)}this._unsubscribeAndRecycle(),this.add(o.subscribeToResult(this,r))}},t}(i.OuterSubscriber)},{"../OuterSubscriber":159,"../util/subscribeToResult":305}],242:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../observable/ArrayObservable"),o=e("../util/isArray"),a=e("../OuterSubscriber"),s=e("../util/subscribeToResult"),u={};r.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];var r=null;return"function"==typeof e[e.length-1]&&(r=e.pop()),1===e.length&&o.isArray(e[0])&&(e=e[0].slice()),e.unshift(this),this.lift.call(new i.ArrayObservable(e),new c(r))};var c=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.project))},e}();r.CombineLatestOperator=c;var l=function(e){function t(t,r){e.call(this,t),this.project=r,this.active=0,this.values=[],this.observables=[]}return n(t,e),t.prototype._next=function(e){this.values.push(u),this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(var r=0;r<t;r++){var n=e[r];this.add(s.subscribeToResult(this,n,n,r))}}},t.prototype.notifyComplete=function(e){0==(this.active-=1)&&this.destination.complete()},t.prototype.notifyNext=function(e,t,r,n,i){var o=this.values,a=o[r],s=this.toRespond?a===u?--this.toRespond:this.toRespond:0;o[r]=t,0===s&&(this.project?this._tryProject(o):this.destination.next(o.slice()))},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(a.OuterSubscriber);r.CombineLatestSubscriber=l},{"../OuterSubscriber":159,"../observable/ArrayObservable":216,"../util/isArray":296,"../util/subscribeToResult":305}],243:[function(e,t,r){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];var r=null,n=e;return o.isScheduler(n[e.length-1])&&(r=n.pop()),null===r&&1===e.length&&e[0]instanceof i.Observable?e[0]:new a.ArrayObservable(e,r).lift(new s.MergeAllOperator(1))}var i=e("../Observable"),o=e("../util/isScheduler"),a=e("../observable/ArrayObservable"),s=e("./mergeAll");r.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return this.lift.call(n.apply(void 0,[this].concat(e)))},r.concatStatic=n},{"../Observable":157,"../observable/ArrayObservable":216,"../util/isScheduler":303,"./mergeAll":256}],244:[function(e,t,r){"use strict";function n(e){e.debouncedNext()}var i=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=e("../Subscriber"),a=e("../scheduler/async");r.debounceTime=function(e,t){return void 0===t&&(t=a.async),this.lift(new s(e,t))};var s=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.dueTime,this.scheduler))},e}(),u=function(e){function t(t,r,n){e.call(this,t),this.dueTime=r,this.scheduler=n,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}return i(t,e),t.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(n,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){this.clearDebounce(),this.hasValue&&(this.destination.next(this.lastValue),this.lastValue=null,this.hasValue=!1)},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},t}(o.Subscriber)},{"../Subscriber":164,"../scheduler/async":284}],245:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../scheduler/async"),o=e("../util/isDate"),a=e("../Subscriber"),s=e("../Notification");r.delay=function(e,t){void 0===t&&(t=i.async);var r=o.isDate(e)?+e-t.now():Math.abs(e);return this.lift(new u(r,t))};var u=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.delay,this.scheduler))},e}(),c=function(e){function t(t,r,n){e.call(this,t),this.delay=r,this.scheduler=n,this.queue=[],this.active=!1,this.errored=!1}return n(t,e),t.dispatch=function(e){for(var t=e.source,r=t.queue,n=e.scheduler,i=e.destination;r.length>0&&r[0].time-n.now()<=0;)r.shift().notification.observe(i);if(r.length>0){var o=Math.max(0,r[0].time-n.now());this.schedule(e,o)}else t.active=!1},t.prototype._schedule=function(e){this.active=!0,this.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,r=new l(t.now()+this.delay,e);this.queue.push(r),!1===this.active&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(s.Notification.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e)},t.prototype._complete=function(){this.scheduleNotification(s.Notification.createComplete())},t}(a.Subscriber),l=function(){return function(e,t){this.time=e,this.notification=t}}()},{"../Notification":156,"../Subscriber":164,"../scheduler/async":284,"../util/isDate":298}],246:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../OuterSubscriber"),o=e("../util/subscribeToResult"),a=e("../util/Set");r.distinct=function(e,t){return this.lift(new s(e,t))};var s=function(){function e(e,t){this.keySelector=e,this.flushes=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.keySelector,this.flushes))},e}(),u=function(e){function t(t,r,n){e.call(this,t),this.keySelector=r,this.values=new a.Set,n&&this.add(o.subscribeToResult(this,n))}return n(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.values.clear()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)},t.prototype._useKeySelector=function(e){var t,r=this.destination;try{t=this.keySelector(e)}catch(e){return void r.error(e)}this._finalizeNext(t,e)},t.prototype._finalizeNext=function(e,t){var r=this.values;r.has(e)||(r.add(e),this.destination.next(t))},t}(i.OuterSubscriber);r.DistinctSubscriber=u},{"../OuterSubscriber":159,"../util/Set":293,"../util/subscribeToResult":305}],247:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subscriber"),o=e("../util/tryCatch"),a=e("../util/errorObject");r.distinctUntilChanged=function(e,t){return this.lift(new s(e,t))};var s=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.compare,this.keySelector))},e}(),u=function(e){function t(t,r,n){e.call(this,t),this.keySelector=n,this.hasKey=!1,"function"==typeof r&&(this.compare=r)}return n(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){var t=e;if(this.keySelector&&(t=o.tryCatch(this.keySelector)(e))===a.errorObject)return this.destination.error(a.errorObject.e);var r=!1;if(this.hasKey){if((r=o.tryCatch(this.compare)(this.key,t))===a.errorObject)return this.destination.error(a.errorObject.e)}else this.hasKey=!0;!1===Boolean(r)&&(this.key=t,this.destination.next(e))},t}(i.Subscriber)},{"../Subscriber":164,"../util/errorObject":295,"../util/tryCatch":307}],248:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subscriber");r._do=function(e,t,r){return this.lift(new o(e,t,r))};var o=function(){function e(e,t,r){this.nextOrObserver=e,this.error=t,this.complete=r}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.nextOrObserver,this.error,this.complete))},e}(),a=function(e){function t(t,r,n,o){e.call(this,t);var a=new i.Subscriber(r,n,o);a.syncErrorThrowable=!0,this.add(a),this.safeSubscriber=a}return n(t,e),t.prototype._next=function(e){var t=this.safeSubscriber;t.next(e),t.syncErrorThrown?this.destination.error(t.syncErrorValue):this.destination.next(e)},t.prototype._error=function(e){var t=this.safeSubscriber;t.error(e),t.syncErrorThrown?this.destination.error(t.syncErrorValue):this.destination.error(e)},t.prototype._complete=function(){var e=this.safeSubscriber;e.complete(),e.syncErrorThrown?this.destination.error(e.syncErrorValue):this.destination.complete()},t}(i.Subscriber)},{"../Subscriber":164}],249:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../util/tryCatch"),o=e("../util/errorObject"),a=e("../OuterSubscriber"),s=e("../util/subscribeToResult");r.expand=function(e,t,r){return void 0===t&&(t=Number.POSITIVE_INFINITY),void 0===r&&(r=void 0),t=(t||0)<1?Number.POSITIVE_INFINITY:t,this.lift(new u(e,t,r))};var u=function(){function e(e,t,r){this.project=e,this.concurrent=t,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.project,this.concurrent,this.scheduler))},e}();r.ExpandOperator=u;var c=function(e){function t(t,r,n,i){e.call(this,t),this.project=r,this.concurrent=n,this.scheduler=i,this.index=0,this.active=0,this.hasCompleted=!1,n<Number.POSITIVE_INFINITY&&(this.buffer=[])}return n(t,e),t.dispatch=function(e){var t=e.subscriber,r=e.result,n=e.value,i=e.index;t.subscribeToProjection(r,n,i)},t.prototype._next=function(e){var r=this.destination;if(r.closed)this._complete();else{var n=this.index++;if(this.active<this.concurrent){r.next(e);var a=i.tryCatch(this.project)(e,n);if(a===o.errorObject)r.error(o.errorObject.e);else if(this.scheduler){var s={subscriber:this,result:a,value:e,index:n};this.add(this.scheduler.schedule(t.dispatch,0,s))}else this.subscribeToProjection(a,e,n)}else this.buffer.push(e)}},t.prototype.subscribeToProjection=function(e,t,r){this.active++,this.add(s.subscribeToResult(this,e,t,r))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete()},t.prototype.notifyNext=function(e,t,r,n,i){this._next(t)},t.prototype.notifyComplete=function(e){var t=this.buffer;this.remove(e),this.active--,t&&t.length>0&&this._next(t.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},t}(a.OuterSubscriber);r.ExpandSubscriber=c},{"../OuterSubscriber":159,"../util/errorObject":295,"../util/subscribeToResult":305,"../util/tryCatch":307}],250:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subscriber");r.filter=function(e,t){return this.lift(new o(e,t))};var o=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate,this.thisArg))},e}(),a=function(e){function t(t,r,n){e.call(this,t),this.predicate=r,this.thisArg=n,this.count=0,this.predicate=r}return n(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}t&&this.destination.next(e)},t}(i.Subscriber)},{"../Subscriber":164}],251:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subscriber"),o=e("../Subscription");r._finally=function(e){return this.lift(new a(e))};var a=function(){function e(e){this.callback=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.callback))},e}(),s=function(e){function t(t,r){e.call(this,t),this.add(new o.Subscription(r))}return n(t,e),t}(i.Subscriber)},{"../Subscriber":164,"../Subscription":165}],252:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subscriber"),o=e("../util/EmptyError");r.first=function(e,t,r){return this.lift(new a(e,t,r,this))};var a=function(){function e(e,t,r,n){this.predicate=e,this.resultSelector=t,this.defaultValue=r,this.source=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.resultSelector,this.defaultValue,this.source))},e}(),s=function(e){function t(t,r,n,i,o){e.call(this,t),this.predicate=r,this.resultSelector=n,this.defaultValue=i,this.source=o,this.index=0,this.hasCompleted=!1,this._emitted=!1}return n(t,e),t.prototype._next=function(e){var t=this.index++;this.predicate?this._tryPredicate(e,t):this._emit(e,t)},t.prototype._tryPredicate=function(e,t){var r;try{r=this.predicate(e,t,this.source)}catch(e){return void this.destination.error(e)}r&&this._emit(e,t)},t.prototype._emit=function(e,t){this.resultSelector?this._tryResultSelector(e,t):this._emitFinal(e)},t.prototype._tryResultSelector=function(e,t){var r;try{r=this.resultSelector(e,t)}catch(e){return void this.destination.error(e)}this._emitFinal(r)},t.prototype._emitFinal=function(e){var t=this.destination;this._emitted||(this._emitted=!0,t.next(e),t.complete(),this.hasCompleted=!0)},t.prototype._complete=function(){var e=this.destination;this.hasCompleted||void 0===this.defaultValue?this.hasCompleted||e.error(new o.EmptyError):(e.next(this.defaultValue),e.complete())},t}(i.Subscriber)},{"../Subscriber":164,"../util/EmptyError":291}],253:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subscriber"),o=e("../util/EmptyError");r.last=function(e,t,r){return this.lift(new a(e,t,r,this))};var a=function(){function e(e,t,r,n){this.predicate=e,this.resultSelector=t,this.defaultValue=r,this.source=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.resultSelector,this.defaultValue,this.source))},e}(),s=function(e){function t(t,r,n,i,o){e.call(this,t),this.predicate=r,this.resultSelector=n,this.defaultValue=i,this.source=o,this.hasValue=!1,this.index=0,void 0!==i&&(this.lastValue=i,this.hasValue=!0)}return n(t,e),t.prototype._next=function(e){var t=this.index++;if(this.predicate)this._tryPredicate(e,t);else{if(this.resultSelector)return void this._tryResultSelector(e,t);this.lastValue=e,this.hasValue=!0}},t.prototype._tryPredicate=function(e,t){var r;try{r=this.predicate(e,t,this.source)}catch(e){return void this.destination.error(e)}if(r){if(this.resultSelector)return void this._tryResultSelector(e,t);this.lastValue=e,this.hasValue=!0}},t.prototype._tryResultSelector=function(e,t){var r;try{r=this.resultSelector(e,t)}catch(e){return void this.destination.error(e)}this.lastValue=r,this.hasValue=!0},t.prototype._complete=function(){var e=this.destination;this.hasValue?(e.next(this.lastValue),e.complete()):e.error(new o.EmptyError)},t}(i.Subscriber)},{"../Subscriber":164,"../util/EmptyError":291}],254:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subscriber");r.map=function(e,t){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return this.lift(new o(e,t))};var o=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.project,this.thisArg))},e}();r.MapOperator=o;var a=function(e){function t(t,r,n){e.call(this,t),this.project=r,this.count=0,this.thisArg=n||this}return n(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(i.Subscriber)},{"../Subscriber":164}],255:[function(e,t,r){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];var r=Number.POSITIVE_INFINITY,n=null,u=e[e.length-1];return s.isScheduler(u)?(n=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(r=e.pop())):"number"==typeof u&&(r=e.pop()),null===n&&1===e.length&&e[0]instanceof i.Observable?e[0]:new o.ArrayObservable(e,n).lift(new a.MergeAllOperator(r))}var i=e("../Observable"),o=e("../observable/ArrayObservable"),a=e("./mergeAll"),s=e("../util/isScheduler");r.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return this.lift.call(n.apply(void 0,[this].concat(e)))},r.mergeStatic=n},{"../Observable":157,"../observable/ArrayObservable":216,"../util/isScheduler":303,"./mergeAll":256}],256:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../OuterSubscriber"),o=e("../util/subscribeToResult");r.mergeAll=function(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),this.lift(new a(e))};var a=function(){function e(e){this.concurrent=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.concurrent))},e}();r.MergeAllOperator=a;var s=function(e){function t(t,r){e.call(this,t),this.concurrent=r,this.hasCompleted=!1,this.buffer=[],this.active=0}return n(t,e),t.prototype._next=function(e){this.active<this.concurrent?(this.active++,this.add(o.subscribeToResult(this,e))):this.buffer.push(e)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete()},t.prototype.notifyComplete=function(e){var t=this.buffer;this.remove(e),this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(i.OuterSubscriber);r.MergeAllSubscriber=s},{"../OuterSubscriber":159,"../util/subscribeToResult":305}],257:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../util/subscribeToResult"),o=e("../OuterSubscriber");r.mergeMap=function(e,t,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"number"==typeof t&&(r=t,t=null),this.lift(new a(e,t,r))};var a=function(){function e(e,t,r){void 0===r&&(r=Number.POSITIVE_INFINITY),this.project=e,this.resultSelector=t,this.concurrent=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.resultSelector,this.concurrent))},e}();r.MergeMapOperator=a;var s=function(e){function t(t,r,n,i){void 0===i&&(i=Number.POSITIVE_INFINITY),e.call(this,t),this.project=r,this.resultSelector=n,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return n(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){return void this.destination.error(e)}this.active++,this._innerSub(t,e,r)},t.prototype._innerSub=function(e,t,r){this.add(i.subscribeToResult(this,e,t,r))},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete()},t.prototype.notifyNext=function(e,t,r,n,i){this.resultSelector?this._notifyResultSelector(e,t,r,n):this.destination.next(t)},t.prototype._notifyResultSelector=function(e,t,r,n){var i;try{i=this.resultSelector(e,t,r,n)}catch(e){return void this.destination.error(e)}this.destination.next(i)},t.prototype.notifyComplete=function(e){var t=this.buffer;this.remove(e),this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(o.OuterSubscriber);r.MergeMapSubscriber=s},{"../OuterSubscriber":159,"../util/subscribeToResult":305}],258:[function(e,t,r){"use strict";var n=e("../observable/ConnectableObservable");r.multicast=function(e,t){var r;if(r="function"==typeof e?e:function(){return e},"function"==typeof t)return this.lift(new i(r,t));var o=Object.create(this,n.connectableObservableDescriptor);return o.source=this,o.subjectFactory=r,o};var i=function(){function e(e,t){this.subjectFactory=e,this.selector=t}return e.prototype.call=function(e,t){var r=this.selector,n=this.subjectFactory(),i=r(n).subscribe(e);return i.add(t.subscribe(n)),i},e}();r.MulticastOperator=i},{"../observable/ConnectableObservable":217}],259:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subscriber"),o=e("../Notification");r.observeOn=function(e,t){return void 0===t&&(t=0),this.lift(new a(e,t))};var a=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.scheduler,this.delay))},e}();r.ObserveOnOperator=a;var s=function(e){function t(t,r,n){void 0===n&&(n=0),e.call(this,t),this.scheduler=r,this.delay=n}return n(t,e),t.dispatch=function(e){var t=e.notification,r=e.destination;t.observe(r),this.unsubscribe()},t.prototype.scheduleMessage=function(e){this.add(this.scheduler.schedule(t.dispatch,this.delay,new u(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(o.Notification.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(o.Notification.createError(e))},t.prototype._complete=function(){this.scheduleMessage(o.Notification.createComplete())},t}(i.Subscriber);r.ObserveOnSubscriber=s;var u=function(){return function(e,t){this.notification=e,this.destination=t}}();r.ObserveOnMessage=u},{"../Notification":156,"../Subscriber":164}],260:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subscriber");r.pairwise=function(){return this.lift(new o)};var o=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new a(e))},e}(),a=function(e){function t(t){e.call(this,t),this.hasPrev=!1}return n(t,e),t.prototype._next=function(e){this.hasPrev?this.destination.next([this.prev,e]):this.hasPrev=!0,this.prev=e},t}(i.Subscriber)},{"../Subscriber":164}],261:[function(e,t,r){"use strict";function n(e,t){return function(r){for(var n=r,i=0;i<t;i++){var o=n[e[i]];if(void 0===o)return;n=o}return n}}var i=e("./map");r.pluck=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];var r=e.length;if(0===r)throw new Error("list of properties cannot be empty.");return i.map.call(this,n(e,r))}},{"./map":254}],262:[function(e,t,r){"use strict";var n=e("../Subject"),i=e("./multicast");r.publish=function(e){return e?i.multicast.call(this,function(){return new n.Subject},e):i.multicast.call(this,new n.Subject)}},{"../Subject":162,"./multicast":258}],263:[function(e,t,r){"use strict";var n=e("../ReplaySubject"),i=e("./multicast");r.publishReplay=function(e,t,r){return void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===t&&(t=Number.POSITIVE_INFINITY),i.multicast.call(this,new n.ReplaySubject(e,t,r))}},{"../ReplaySubject":160,"./multicast":258}],264:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../OuterSubscriber"),o=e("../util/subscribeToResult");r.sample=function(e){return this.lift(new a(e))};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var r=new s(e),n=t.subscribe(r);return n.add(o.subscribeToResult(r,this.notifier)),n},e}(),s=function(e){function t(){e.apply(this,arguments),this.hasValue=!1}return n(t,e),t.prototype._next=function(e){this.value=e,this.hasValue=!0},t.prototype.notifyNext=function(e,t,r,n,i){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},t}(i.OuterSubscriber)},{"../OuterSubscriber":159,"../util/subscribeToResult":305}],265:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subscriber");r.scan=function(e,t){var r=!1;return arguments.length>=2&&(r=!0),this.lift(new o(e,t,r))};var o=function(){function e(e,t,r){void 0===r&&(r=!1),this.accumulator=e,this.seed=t,this.hasSeed=r}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.accumulator,this.seed,this.hasSeed))},e}(),a=function(e){function t(t,r,n,i){e.call(this,t),this.accumulator=r,this._seed=n,this.hasSeed=i,this.index=0}return n(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.accumulator(this.seed,e,r)}catch(e){this.destination.error(e)}this.seed=t,this.destination.next(t)},t}(i.Subscriber)},{"../Subscriber":164}],266:[function(e,t,r){"use strict";function n(){return new o.Subject}var i=e("./multicast"),o=e("../Subject");r.share=function(){return i.multicast.call(this,n).refCount()}},{"../Subject":162,"./multicast":258}],267:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subscriber");r.skip=function(e){return this.lift(new o(e))};var o=function(){function e(e){this.total=e}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.total))},e}(),a=function(e){function t(t,r){e.call(this,t),this.total=r,this.count=0}return n(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(i.Subscriber)},{"../Subscriber":164}],268:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../OuterSubscriber"),o=e("../util/subscribeToResult");r.skipUntil=function(e){return this.lift(new a(e))};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.notifier))},e}(),s=function(e){function t(t,r){e.call(this,t),this.hasValue=!1,this.isInnerStopped=!1,this.add(o.subscribeToResult(this,r))}return n(t,e),t.prototype._next=function(t){this.hasValue&&e.prototype._next.call(this,t)},t.prototype._complete=function(){this.isInnerStopped?e.prototype._complete.call(this):this.unsubscribe()},t.prototype.notifyNext=function(e,t,r,n,i){this.hasValue=!0},t.prototype.notifyComplete=function(){this.isInnerStopped=!0,this.isStopped&&e.prototype._complete.call(this)},t}(i.OuterSubscriber)},{"../OuterSubscriber":159,"../util/subscribeToResult":305}],269:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subscriber");r.skipWhile=function(e){return this.lift(new o(e))};var o=function(){function e(e){this.predicate=e}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate))},e}(),a=function(e){function t(t,r){e.call(this,t),this.predicate=r,this.skipping=!0,this.index=0}return n(t,e),t.prototype._next=function(e){var t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)},t.prototype.tryCallPredicate=function(e){try{var t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(e){this.destination.error(e)}},t}(i.Subscriber)},{"../Subscriber":164}],270:[function(e,t,r){"use strict";var n=e("../observable/ArrayObservable"),i=e("../observable/ScalarObservable"),o=e("../observable/EmptyObservable"),a=e("./concat"),s=e("../util/isScheduler");r.startWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];var r=e[e.length-1];s.isScheduler(r)?e.pop():r=null;var u=e.length;return 1===u?a.concatStatic(new i.ScalarObservable(e[0],r),this):u>1?a.concatStatic(new n.ArrayObservable(e,r),this):a.concatStatic(new o.EmptyObservable(r),this)}},{"../observable/ArrayObservable":216,"../observable/EmptyObservable":219,"../observable/ScalarObservable":225,"../util/isScheduler":303,"./concat":243}],271:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../OuterSubscriber"),o=e("../util/subscribeToResult");r.switchMap=function(e,t){return this.lift(new a(e,t))};var a=function(){function e(e,t){this.project=e,this.resultSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.resultSelector))},e}(),s=function(e){function t(t,r,n){e.call(this,t),this.project=r,this.resultSelector=n,this.index=0}return n(t,e),t.prototype._next=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){return void this.destination.error(e)}this._innerSub(t,e,r)},t.prototype._innerSub=function(e,t,r){var n=this.innerSubscription;n&&n.unsubscribe(),this.add(this.innerSubscription=o.subscribeToResult(this,e,t,r))},t.prototype._complete=function(){var t=this.innerSubscription;t&&!t.closed||e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.innerSubscription=null},t.prototype.notifyComplete=function(t){this.remove(t),this.innerSubscription=null,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t,r,n,i){this.resultSelector?this._tryNotifyNext(e,t,r,n):this.destination.next(t)},t.prototype._tryNotifyNext=function(e,t,r,n){var i;try{i=this.resultSelector(e,t,r,n)}catch(e){return void this.destination.error(e)}this.destination.next(i)},t}(i.OuterSubscriber)},{"../OuterSubscriber":159,"../util/subscribeToResult":305}],272:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subscriber"),o=e("../util/ArgumentOutOfRangeError"),a=e("../observable/EmptyObservable");r.take=function(e){return 0===e?new a.EmptyObservable:this.lift(new s(e))};var s=function(){function e(e){if(this.total=e,this.total<0)throw new o.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,r){e.call(this,t),this.total=r,this.count=0}return n(t,e),t.prototype._next=function(e){var t=this.total,r=++this.count;r<=t&&(this.destination.next(e),r===t&&(this.destination.complete(),this.unsubscribe()))},t}(i.Subscriber)},{"../Subscriber":164,"../observable/EmptyObservable":219,"../util/ArgumentOutOfRangeError":290}],273:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../OuterSubscriber"),o=e("../util/subscribeToResult");r.takeUntil=function(e){return this.lift(new a(e))};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.notifier))},e}(),s=function(e){function t(t,r){e.call(this,t),this.notifier=r,this.add(o.subscribeToResult(this,r))}return n(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.complete()},t.prototype.notifyComplete=function(){},t}(i.OuterSubscriber)},{"../OuterSubscriber":159,"../util/subscribeToResult":305}],274:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../Subscriber");r.takeWhile=function(e){return this.lift(new o(e))};var o=function(){function e(e){this.predicate=e}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate))},e}(),a=function(e){function t(t,r){e.call(this,t),this.predicate=r,this.index=0}return n(t,e),t.prototype._next=function(e){var t,r=this.destination;try{t=this.predicate(e,this.index++)}catch(e){return void r.error(e)}this.nextOrComplete(e,t)},t.prototype.nextOrComplete=function(e,t){var r=this.destination;Boolean(t)?r.next(e):r.complete()},t}(i.Subscriber)},{"../Subscriber":164}],275:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../OuterSubscriber"),o=e("../util/subscribeToResult");r.defaultThrottleConfig={leading:!0,trailing:!1},r.throttle=function(e,t){return void 0===t&&(t=r.defaultThrottleConfig),this.lift(new a(e,t.leading,t.trailing))};var a=function(){function e(e,t,r){this.durationSelector=e,this.leading=t,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector,this.leading,this.trailing))},e}(),s=function(e){function t(t,r,n,i){e.call(this,t),this.destination=t,this.durationSelector=r,this._leading=n,this._trailing=i,this._hasTrailingValue=!1}return n(t,e),t.prototype._next=function(e){if(this.throttled)this._trailing&&(this._hasTrailingValue=!0,this._trailingValue=e);else{var t=this.tryDurationSelector(e);t&&this.add(this.throttled=o.subscribeToResult(this,t)),this._leading&&(this.destination.next(e),this._trailing&&(this._hasTrailingValue=!0,this._trailingValue=e))}},t.prototype.tryDurationSelector=function(e){try{return this.durationSelector(e)}catch(e){return this.destination.error(e),null}},t.prototype._unsubscribe=function(){var e=this,t=e.throttled;e._trailingValue,e._hasTrailingValue,e._trailing;this._trailingValue=null,this._hasTrailingValue=!1,t&&(this.remove(t),this.throttled=null,t.unsubscribe())},t.prototype._sendTrailing=function(){var e=this,t=e.destination,r=e.throttled,n=e._trailing,i=e._trailingValue,o=e._hasTrailingValue;r&&n&&o&&(t.next(i),this._trailingValue=null,this._hasTrailingValue=!1)},t.prototype.notifyNext=function(e,t,r,n,i){this._sendTrailing(),this._unsubscribe()},t.prototype.notifyComplete=function(){this._sendTrailing(),this._unsubscribe()},t}(i.OuterSubscriber)},{"../OuterSubscriber":159,"../util/subscribeToResult":305}],276:[function(e,t,r){"use strict";function n(e){e.subscriber.clearThrottle()}var i=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=e("../Subscriber"),a=e("../scheduler/async"),s=e("./throttle");r.throttleTime=function(e,t,r){return void 0===t&&(t=a.async),void 0===r&&(r=s.defaultThrottleConfig),this.lift(new u(e,t,r.leading,r.trailing))};var u=function(){function e(e,t,r,n){this.duration=e,this.scheduler=t,this.leading=r,this.trailing=n}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),c=function(e){function t(t,r,n,i,o){e.call(this,t),this.duration=r,this.scheduler=n,this.leading=i,this.trailing=o,this._hasTrailingValue=!1,this._trailingValue=null}return i(t,e),t.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(n,this.duration,{subscriber:this})),this.leading&&this.destination.next(e))},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},t}(o.Subscriber)},{"../Subscriber":164,"../scheduler/async":284,"./throttle":275}],277:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../OuterSubscriber"),o=e("../util/subscribeToResult");r.withLatestFrom=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];var r;"function"==typeof e[e.length-1]&&(r=e.pop());var n=e;return this.lift(new a(n,r))};var a=function(){function e(e,t){this.observables=e,this.project=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.observables,this.project))},e}(),s=function(e){function t(t,r,n){e.call(this,t),this.observables=r,this.project=n,this.toRespond=[];var i=r.length;this.values=new Array(i);for(a=0;a<i;a++)this.toRespond.push(a);for(var a=0;a<i;a++){var s=r[a];this.add(o.subscribeToResult(this,s,s,a))}}return n(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.values[r]=t;var o=this.toRespond;if(o.length>0){var a=o.indexOf(r);-1!==a&&o.splice(a,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(i.OuterSubscriber)},{"../OuterSubscriber":159,"../util/subscribeToResult":305}],278:[function(e,t,r){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];var r=e[e.length-1];return"function"==typeof r&&e.pop(),new o.ArrayObservable(e).lift(new h(r))}var i=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=e("../observable/ArrayObservable"),a=e("../util/isArray"),s=e("../Subscriber"),u=e("../OuterSubscriber"),c=e("../util/subscribeToResult"),l=e("../symbol/iterator");r.zipProto=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return this.lift.call(n.apply(void 0,[this].concat(e)))},r.zipStatic=n;var h=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new p(e,this.project))},e}();r.ZipOperator=h;var p=function(e){function t(t,r,n){void 0===n&&(n=Object.create(null)),e.call(this,t),this.iterators=[],this.active=0,this.project="function"==typeof r?r:null,this.values=n}return i(t,e),t.prototype._next=function(e){var t=this.iterators;a.isArray(e)?t.push(new d(e)):"function"==typeof e[l.iterator]?t.push(new f(e[l.iterator]())):t.push(new m(this.destination,this,e))},t.prototype._complete=function(){var e=this.iterators,t=e.length;if(0!==t){this.active=t;for(var r=0;r<t;r++){var n=e[r];n.stillUnsubscribed?this.add(n.subscribe(n,r)):this.active--}}else this.destination.complete()},t.prototype.notifyInactive=function(){0===--this.active&&this.destination.complete()},t.prototype.checkIterators=function(){for(var e=this.iterators,t=e.length,r=this.destination,n=0;n<t;n++)if("function"==typeof(a=e[n]).hasValue&&!a.hasValue())return;for(var i=!1,o=[],n=0;n<t;n++){var a=e[n],s=a.next();if(a.hasCompleted()&&(i=!0),s.done)return void r.complete();o.push(s.value)}this.project?this._tryProject(o):r.next(o),i&&r.complete()},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(s.Subscriber);r.ZipSubscriber=p;var f=function(){function e(e){this.iterator=e,this.nextResult=e.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},e.prototype.hasCompleted=function(){var e=this.nextResult;return e&&e.done},e}(),d=function(){function e(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return e.prototype[l.iterator]=function(){return this},e.prototype.next=function(e){var t=this.index++,r=this.array;return t<this.length?{value:r[t],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),m=function(e){function t(t,r,n){e.call(this,t),this.parent=r,this.observable=n,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}return i(t,e),t.prototype[l.iterator]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e,t,r,n,i){this.buffer.push(t),this.parent.checkIterators()},t.prototype.subscribe=function(e,t){return c.subscribeToResult(this,this.observable,this,t)},t}(u.OuterSubscriber)},{"../OuterSubscriber":159,"../Subscriber":164,"../observable/ArrayObservable":216,"../symbol/iterator":286,"../util/isArray":296,"../util/subscribeToResult":305}],279:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=function(e){function t(t,r){e.call(this)}return n(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(e("../Subscription").Subscription);r.Action=i},{"../Subscription":165}],280:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=e("../util/root"),o=function(e){function t(t,r){e.call(this,t,r),this.scheduler=t,this.work=r,this.pending=!1}return n(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e,this.pending=!0;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,t)),this.delay=t,this.id=this.id||this.requestAsyncId(n,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),i.root.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){return void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending?t:i.root.clearInterval(t)&&void 0||void 0},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r=!1,n=void 0;try{this.work(e)}catch(e){r=!0,n=!!e&&e||new Error(e)}if(r)return this.unsubscribe(),n},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,r=t.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(e("./Action").Action);r.AsyncAction=o},{"../util/root":304,"./Action":279}],281:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=function(e){function t(){e.apply(this,arguments),this.actions=[],this.active=!1,this.scheduled=void 0}return n(t,e),t.prototype.flush=function(e){var t=this.actions;if(this.active)t.push(e);else{var r;this.active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(e("../Scheduler").Scheduler);r.AsyncScheduler=i},{"../Scheduler":161}],282:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=function(e){function t(t,r){e.call(this,t,r),this.scheduler=t,this.work=r}return n(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):t.flush(this)},t}(e("./AsyncAction").AsyncAction);r.QueueAction=i},{"./AsyncAction":280}],283:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=function(e){function t(){e.apply(this,arguments)}return n(t,e),t}(e("./AsyncScheduler").AsyncScheduler);r.QueueScheduler=i},{"./AsyncScheduler":281}],284:[function(e,t,r){"use strict";var n=e("./AsyncAction"),i=e("./AsyncScheduler");r.async=new i.AsyncScheduler(n.AsyncAction)},{"./AsyncAction":280,"./AsyncScheduler":281}],285:[function(e,t,r){"use strict";var n=e("./QueueAction"),i=e("./QueueScheduler");r.queue=new i.QueueScheduler(n.QueueAction)},{"./QueueAction":282,"./QueueScheduler":283}],286:[function(e,t,r){"use strict";function n(e){var t=e.Symbol;if("function"==typeof t)return t.iterator||(t.iterator=t("iterator polyfill")),t.iterator;var r=e.Set;if(r&&"function"==typeof(new r)["@@iterator"])return"@@iterator";var n=e.Map;if(n)for(var i=Object.getOwnPropertyNames(n.prototype),o=0;o<i.length;++o){var a=i[o];if("entries"!==a&&"size"!==a&&n.prototype[a]===n.prototype.entries)return a}return"@@iterator"}var i=e("../util/root");r.symbolIteratorPonyfill=n,r.iterator=n(i.root),r.$$iterator=r.iterator},{"../util/root":304}],287:[function(e,t,r){"use strict";function n(e){var t,r=e.Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}var i=e("../util/root");r.getSymbolObservable=n,r.observable=n(i.root),r.$$observable=r.observable},{"../util/root":304}],288:[function(e,t,r){"use strict";var n=e("../util/root").root.Symbol;r.rxSubscriber="function"==typeof n&&"function"==typeof n.for?n.for("rxSubscriber"):"@@rxSubscriber",r.$$rxSubscriber=r.rxSubscriber},{"../util/root":304}],289:[function(e,t,r){"use strict";var n=e("./root"),i=function(){return function(e){e.requestAnimationFrame?(this.cancelAnimationFrame=e.cancelAnimationFrame.bind(e),this.requestAnimationFrame=e.requestAnimationFrame.bind(e)):e.mozRequestAnimationFrame?(this.cancelAnimationFrame=e.mozCancelAnimationFrame.bind(e),this.requestAnimationFrame=e.mozRequestAnimationFrame.bind(e)):e.webkitRequestAnimationFrame?(this.cancelAnimationFrame=e.webkitCancelAnimationFrame.bind(e),this.requestAnimationFrame=e.webkitRequestAnimationFrame.bind(e)):e.msRequestAnimationFrame?(this.cancelAnimationFrame=e.msCancelAnimationFrame.bind(e),this.requestAnimationFrame=e.msRequestAnimationFrame.bind(e)):e.oRequestAnimationFrame?(this.cancelAnimationFrame=e.oCancelAnimationFrame.bind(e),this.requestAnimationFrame=e.oRequestAnimationFrame.bind(e)):(this.cancelAnimationFrame=e.clearTimeout.bind(e),this.requestAnimationFrame=function(t){return e.setTimeout(t,1e3/60)})}}();r.RequestAnimationFrameDefinition=i,r.AnimationFrame=new i(n.root)},{"./root":304}],290:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=function(e){function t(){var t=e.call(this,"argument out of range");this.name=t.name="ArgumentOutOfRangeError",this.stack=t.stack,this.message=t.message}return n(t,e),t}(Error);r.ArgumentOutOfRangeError=i},{}],291:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=function(e){function t(){var t=e.call(this,"no elements in sequence");this.name=t.name="EmptyError",this.stack=t.stack,this.message=t.message}return n(t,e),t}(Error);r.EmptyError=i},{}],292:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=function(e){function t(){var t=e.call(this,"object unsubscribed");this.name=t.name="ObjectUnsubscribedError",this.stack=t.stack,this.message=t.message}return n(t,e),t}(Error);r.ObjectUnsubscribedError=i},{}],293:[function(e,t,r){"use strict";function n(){return function(){function e(){this._values=[]}return e.prototype.add=function(e){this.has(e)||this._values.push(e)},e.prototype.has=function(e){return-1!==this._values.indexOf(e)},Object.defineProperty(e.prototype,"size",{get:function(){return this._values.length},enumerable:!0,configurable:!0}),e.prototype.clear=function(){this._values.length=0},e}()}var i=e("./root");r.minimalSetImpl=n,r.Set=i.root.Set||n()},{"./root":304}],294:[function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=function(e){function t(t){e.call(this),this.errors=t;var r=Error.call(this,t?t.length+" errors occurred during unsubscription:\n "+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"");this.name=r.name="UnsubscriptionError",this.stack=r.stack,this.message=r.message}return n(t,e),t}(Error);r.UnsubscriptionError=i},{}],295:[function(e,t,r){"use strict";r.errorObject={e:{}}},{}],296:[function(e,t,r){"use strict";r.isArray=Array.isArray||function(e){return e&&"number"==typeof e.length}},{}],297:[function(e,t,r){"use strict";r.isArrayLike=function(e){return e&&"number"==typeof e.length}},{}],298:[function(e,t,r){"use strict";r.isDate=function(e){return e instanceof Date&&!isNaN(+e)}},{}],299:[function(e,t,r){"use strict";r.isFunction=function(e){return"function"==typeof e}},{}],300:[function(e,t,r){"use strict";var n=e("../util/isArray");r.isNumeric=function(e){return!n.isArray(e)&&e-parseFloat(e)+1>=0}},{"../util/isArray":296}],301:[function(e,t,r){"use strict";r.isObject=function(e){return null!=e&&"object"==typeof e}},{}],302:[function(e,t,r){"use strict";r.isPromise=function(e){return e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}},{}],303:[function(e,t,r){"use strict";r.isScheduler=function(e){return e&&"function"==typeof e.schedule}},{}],304:[function(e,t,r){(function(e){"use strict";var t="undefined"!=typeof window&&window,n="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,i=void 0!==e&&e,o=t||i||n;r.root=o,function(){if(!o)throw new Error("RxJS could not find any global context (window, self, global)")}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],305:[function(e,t,r){"use strict";var n=e("./root"),i=e("./isArrayLike"),o=e("./isPromise"),a=e("./isObject"),s=e("../Observable"),u=e("../symbol/iterator"),c=e("../InnerSubscriber"),l=e("../symbol/observable");r.subscribeToResult=function(e,t,r,h){var p=new c.InnerSubscriber(e,r,h);if(p.closed)return null;if(t instanceof s.Observable)return t._isScalar?(p.next(t.value),p.complete(),null):t.subscribe(p);if(i.isArrayLike(t)){for(var f=0,d=t.length;f<d&&!p.closed;f++)p.next(t[f]);p.closed||p.complete()}else{if(o.isPromise(t))return t.then(function(e){p.closed||(p.next(e),p.complete())},function(e){return p.error(e)}).then(null,function(e){n.root.setTimeout(function(){throw e})}),p;if(t&&"function"==typeof t[u.iterator])for(var m=t[u.iterator]();;){var v=m.next();if(v.done){p.complete();break}if(p.next(v.value),p.closed)break}else if(t&&"function"==typeof t[l.observable]){var y=t[l.observable]();if("function"==typeof y.subscribe)return y.subscribe(new c.InnerSubscriber(e,r,h));p.error(new TypeError("Provided object does not correctly implement Symbol.observable"))}else{var g="You provided "+(a.isObject(t)?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";p.error(new TypeError(g))}}return null}},{"../InnerSubscriber":155,"../Observable":157,"../symbol/iterator":286,"../symbol/observable":287,"./isArrayLike":297,"./isObject":301,"./isPromise":302,"./root":304}],306:[function(e,t,r){"use strict";var n=e("../Subscriber"),i=e("../symbol/rxSubscriber"),o=e("../Observer");r.toSubscriber=function(e,t,r){if(e){if(e instanceof n.Subscriber)return e;if(e[i.rxSubscriber])return e[i.rxSubscriber]()}return e||t||r?new n.Subscriber(e,t,r):new n.Subscriber(o.empty)}},{"../Observer":158,"../Subscriber":164,"../symbol/rxSubscriber":288}],307:[function(e,t,r){"use strict";function n(){try{return i.apply(this,arguments)}catch(e){return o.errorObject.e=e,o.errorObject}}var i,o=e("./errorObject");r.tryCatch=function(e){return i=e,n}},{"./errorObject":295}],308:[function(e,t,r){t.exports=e("./lib/index")},{"./lib/index":309}],309:[function(e,t,r){(function(n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i,o=function(e){return e&&e.__esModule?e:{default:e}}(e("./ponyfill"));i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:void 0!==t?t:Function("return this")();var a=(0,o.default)(i);r.default=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./ponyfill":310}],310:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){var t,r=e.Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}},{}],311:[function(e,t,r){!function(e,n){n("object"==typeof r&&void 0!==t?r:e.THREE=e.THREE||{})}(this,function(e){function t(){}function r(e,t){this.x=e||0,this.y=t||0}function n(e,t,i,o,a,s,u,c,l,h){Object.defineProperty(this,"id",{value:wi++}),this.uuid=xi.generateUUID(),this.name="",this.image=void 0!==e?e:n.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:n.DEFAULT_MAPPING,this.wrapS=void 0!==i?i:1001,this.wrapT=void 0!==o?o:1001,this.magFilter=void 0!==a?a:1006,this.minFilter=void 0!==s?s:1008,this.anisotropy=void 0!==l?l:1,this.format=void 0!==u?u:1023,this.type=void 0!==c?c:1009,this.offset=new r(0,0),this.repeat=new r(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==h?h:3e3,this.version=0,this.onUpdate=null}function i(e,t,r,n){this.x=e||0,this.y=t||0,this.z=r||0,this.w=void 0!==n?n:1}function o(e,t,r){this.uuid=xi.generateUUID(),this.width=e,this.height=t,this.scissor=new i(0,0,e,t),this.scissorTest=!1,this.viewport=new i(0,0,e,t),void 0===(r=r||{}).minFilter&&(r.minFilter=1006),this.texture=new n(void 0,void 0,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.depthBuffer=void 0===r.depthBuffer||r.depthBuffer,this.stencilBuffer=void 0===r.stencilBuffer||r.stencilBuffer,this.depthTexture=void 0!==r.depthTexture?r.depthTexture:null}function a(e,t,r){o.call(this,e,t,r),this.activeMipMapLevel=this.activeCubeFace=0}function s(e,t,r,n){this._x=e||0,this._y=t||0,this._z=r||0,this._w=void 0!==n?n:1}function u(e,t,r){this.x=e||0,this.y=t||0,this.z=r||0}function c(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function l(e,t,r,i,o,a,s,u,c,l,h,p){n.call(this,null,a,s,u,c,l,i,o,h,p),this.image={data:e,width:t,height:r},this.magFilter=void 0!==c?c:1003,this.minFilter=void 0!==l?l:1003,this.flipY=this.generateMipmaps=!1,this.unpackAlignment=1}function h(e,t,r,i,o,a,s,u,c,l){e=void 0!==e?e:[],n.call(this,e,void 0!==t?t:301,r,i,o,a,s,u,c,l),this.flipY=!1}function p(e,t,r){var n=e[0];if(0>=n||0<n)return e;var i=t*r,o=Ei[i];if(void 0===o&&(o=new Float32Array(i),Ei[i]=o),0!==t)for(n.toArray(o,0),n=1,i=0;n!==t;++n)i+=r,e[n].toArray(o,i);return o}function f(e,t){var r=Oi[t];void 0===r&&(r=new Int32Array(t),Oi[t]=r);for(var n=0;n!==t;++n)r[n]=e.allocTextureUnit();return r}function d(e,t){e.uniform1f(this.addr,t)}function m(e,t){e.uniform1i(this.addr,t)}function v(e,t){void 0===t.x?e.uniform2fv(this.addr,t):e.uniform2f(this.addr,t.x,t.y)}function y(e,t){void 0!==t.x?e.uniform3f(this.addr,t.x,t.y,t.z):void 0!==t.r?e.uniform3f(this.addr,t.r,t.g,t.b):e.uniform3fv(this.addr,t)}function g(e,t){void 0===t.x?e.uniform4fv(this.addr,t):e.uniform4f(this.addr,t.x,t.y,t.z,t.w)}function b(e,t){e.uniformMatrix2fv(this.addr,!1,t.elements||t)}function _(e,t){void 0===t.elements?e.uniformMatrix3fv(this.addr,!1,t):(Ci.set(t.elements),e.uniformMatrix3fv(this.addr,!1,Ci))}function x(e,t){void 0===t.elements?e.uniformMatrix4fv(this.addr,!1,t):(Mi.set(t.elements),e.uniformMatrix4fv(this.addr,!1,Mi))}function w(e,t,r){var n=r.allocTextureUnit();e.uniform1i(this.addr,n),r.setTexture2D(t||Si,n)}function S(e,t,r){var n=r.allocTextureUnit();e.uniform1i(this.addr,n),r.setTextureCube(t||Ti,n)}function T(e,t){e.uniform2iv(this.addr,t)}function E(e,t){e.uniform3iv(this.addr,t)}function O(e,t){e.uniform4iv(this.addr,t)}function M(e){switch(e){case 5126:return d;case 35664:return v;case 35665:return y;case 35666:return g;case 35674:return b;case 35675:return _;case 35676:return x;case 35678:case 36198:return w;case 35680:return S;case 5124:case 35670:return m;case 35667:case 35671:return T;case 35668:case 35672:return E;case 35669:case 35673:return O}}function C(e,t){e.uniform1fv(this.addr,t)}function j(e,t){e.uniform1iv(this.addr,t)}function P(e,t){e.uniform2fv(this.addr,p(t,this.size,2))}function A(e,t){e.uniform3fv(this.addr,p(t,this.size,3))}function N(e,t){e.uniform4fv(this.addr,p(t,this.size,4))}function L(e,t){e.uniformMatrix2fv(this.addr,!1,p(t,this.size,4))}function I(e,t){e.uniformMatrix3fv(this.addr,!1,p(t,this.size,9))}function R(e,t){e.uniformMatrix4fv(this.addr,!1,p(t,this.size,16))}function k(e,t,r){var n=t.length,i=f(r,n);for(e.uniform1iv(this.addr,i),e=0;e!==n;++e)r.setTexture2D(t[e]||Si,i[e])}function D(e,t,r){var n=t.length,i=f(r,n);for(e.uniform1iv(this.addr,i),e=0;e!==n;++e)r.setTextureCube(t[e]||Ti,i[e])}function F(e){switch(e){case 5126:return C;case 35664:return P;case 35665:return A;case 35666:return N;case 35674:return L;case 35675:return I;case 35676:return R;case 35678:return k;case 35680:return D;case 5124:case 35670:return j;case 35667:case 35671:return T;case 35668:case 35672:return E;case 35669:case 35673:return O}}function V(e,t,r){this.id=e,this.addr=r,this.setValue=M(t.type)}function B(e,t,r){this.id=e,this.addr=r,this.size=t.size,this.setValue=F(t.type)}function U(e){this.id=e,this.seq=[],this.map={}}function G(e,t,r){this.seq=[],this.map={},this.renderer=r,r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(var n=0;n<r;++n){var i=e.getActiveUniform(t,n),o=e.getUniformLocation(t,i.name),a=this,s=i.name,u=s.length;for(ji.lastIndex=0;;){var c=ji.exec(s),l=ji.lastIndex,h=c[1],p=c[3];if("]"===c[2]&&(h|=0),void 0===p||"["===p&&l+2===u){s=a,i=void 0===p?new V(h,i,o):new B(h,i,o),s.seq.push(i),s.map[i.id]=i;break}void 0===(p=a.map[h])&&(p=new U(h),h=a,a=p,h.seq.push(a),h.map[a.id]=a),a=p}}}function z(e,t,r){return void 0===t&&void 0===r?this.set(e):this.setRGB(e,t,r)}function q(e,t){this.min=void 0!==e?e:new r(1/0,1/0),this.max=void 0!==t?t:new r(-1/0,-1/0)}function $(e,t){var n,i,o,a,s,c,l,h,p,f,d,m,v,y,g,b,_=e.context,x=e.state;this.render=function(w,S,T){if(0!==t.length){w=new u;var E=T.w/T.z,O=.5*T.z,M=.5*T.w,C=new r((N=16/T.w)*E,N),j=new u(1,1,0),P=new r(1,1),A=new q;if(A.min.set(T.x,T.y),A.max.set(T.x+(T.z-16),T.y+(T.w-16)),void 0===y){var N=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),L=new Uint16Array([0,1,2,0,2,3]);d=_.createBuffer(),m=_.createBuffer(),_.bindBuffer(_.ARRAY_BUFFER,d),_.bufferData(_.ARRAY_BUFFER,N,_.STATIC_DRAW),_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,m),_.bufferData(_.ELEMENT_ARRAY_BUFFER,L,_.STATIC_DRAW),g=_.createTexture(),b=_.createTexture(),x.bindTexture(_.TEXTURE_2D,g),_.texImage2D(_.TEXTURE_2D,0,_.RGB,16,16,0,_.RGB,_.UNSIGNED_BYTE,null),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_S,_.CLAMP_TO_EDGE),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_T,_.CLAMP_TO_EDGE),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_MAG_FILTER,_.NEAREST),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_MIN_FILTER,_.NEAREST),x.bindTexture(_.TEXTURE_2D,b),_.texImage2D(_.TEXTURE_2D,0,_.RGBA,16,16,0,_.RGBA,_.UNSIGNED_BYTE,null),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_S,_.CLAMP_TO_EDGE),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_T,_.CLAMP_TO_EDGE),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_MAG_FILTER,_.NEAREST),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_MIN_FILTER,_.NEAREST);var N=v={vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif ( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility = visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *= visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif ( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if ( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},L=_.createProgram(),I=_.createShader(_.FRAGMENT_SHADER),R=_.createShader(_.VERTEX_SHADER),k="precision "+e.getPrecision()+" float;\n";_.shaderSource(I,k+N.fragmentShader),_.shaderSource(R,k+N.vertexShader),_.compileShader(I),_.compileShader(R),_.attachShader(L,I),_.attachShader(L,R),_.linkProgram(L),y=L,p=_.getAttribLocation(y,"position"),f=_.getAttribLocation(y,"uv"),n=_.getUniformLocation(y,"renderType"),i=_.getUniformLocation(y,"map"),o=_.getUniformLocation(y,"occlusionMap"),a=_.getUniformLocation(y,"opacity"),s=_.getUniformLocation(y,"color"),c=_.getUniformLocation(y,"scale"),l=_.getUniformLocation(y,"rotation"),h=_.getUniformLocation(y,"screenPosition")}for(_.useProgram(y),x.initAttributes(),x.enableAttribute(p),x.enableAttribute(f),x.disableUnusedAttributes(),_.uniform1i(o,0),_.uniform1i(i,1),_.bindBuffer(_.ARRAY_BUFFER,d),_.vertexAttribPointer(p,2,_.FLOAT,!1,16,0),_.vertexAttribPointer(f,2,_.FLOAT,!1,16,8),_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,m),x.disable(_.CULL_FACE),x.buffers.depth.setMask(!1),L=0,I=t.length;L<I;L++)if(N=16/T.w,C.set(N*E,N),R=t[L],w.set(R.matrixWorld.elements[12],R.matrixWorld.elements[13],R.matrixWorld.elements[14]),w.applyMatrix4(S.matrixWorldInverse),w.applyMatrix4(S.projectionMatrix),j.copy(w),P.x=T.x+j.x*O+O-8,P.y=T.y+j.y*M+M-8,!0===A.containsPoint(P)){x.activeTexture(_.TEXTURE0),x.bindTexture(_.TEXTURE_2D,null),x.activeTexture(_.TEXTURE1),x.bindTexture(_.TEXTURE_2D,g),_.copyTexImage2D(_.TEXTURE_2D,0,_.RGB,P.x,P.y,16,16,0),_.uniform1i(n,0),_.uniform2f(c,C.x,C.y),_.uniform3f(h,j.x,j.y,j.z),x.disable(_.BLEND),x.enable(_.DEPTH_TEST),_.drawElements(_.TRIANGLES,6,_.UNSIGNED_SHORT,0),x.activeTexture(_.TEXTURE0),x.bindTexture(_.TEXTURE_2D,b),_.copyTexImage2D(_.TEXTURE_2D,0,_.RGBA,P.x,P.y,16,16,0),_.uniform1i(n,1),x.disable(_.DEPTH_TEST),x.activeTexture(_.TEXTURE1),x.bindTexture(_.TEXTURE_2D,g),_.drawElements(_.TRIANGLES,6,_.UNSIGNED_SHORT,0),R.positionScreen.copy(j),R.customUpdateCallback?R.customUpdateCallback(R):R.updateLensFlares(),_.uniform1i(n,2),x.enable(_.BLEND);for(var k=0,D=R.lensFlares.length;k<D;k++){var F=R.lensFlares[k];.001<F.opacity&&.001<F.scale&&(j.x=F.x,j.y=F.y,j.z=F.z,N=F.size*F.scale/T.w,C.x=N*E,C.y=N,_.uniform3f(h,j.x,j.y,j.z),_.uniform2f(c,C.x,C.y),_.uniform1f(l,F.rotation),_.uniform1f(a,F.opacity),_.uniform3f(s,F.color.r,F.color.g,F.color.b),x.setBlending(F.blending,F.blendEquation,F.blendSrc,F.blendDst),e.setTexture2D(F.texture,1),_.drawElements(_.TRIANGLES,6,_.UNSIGNED_SHORT,0))}}x.enable(_.CULL_FACE),x.enable(_.DEPTH_TEST),x.buffers.depth.setMask(!0),e.resetGLState()}}}function H(e,t){function r(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:t.id-e.id}var i,o,a,c,l,h,p,f,d,m,v,y,g,b,_,x,w,S,T,E,O,M=e.context,C=e.state,j=new u,P=new s,A=new u;this.render=function(s,u){if(0!==t.length){if(void 0===E){var N=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),L=new Uint16Array([0,1,2,0,2,3]);S=M.createBuffer(),T=M.createBuffer(),M.bindBuffer(M.ARRAY_BUFFER,S),M.bufferData(M.ARRAY_BUFFER,N,M.STATIC_DRAW),M.bindBuffer(M.ELEMENT_ARRAY_BUFFER,T),M.bufferData(M.ELEMENT_ARRAY_BUFFER,L,M.STATIC_DRAW);var N=M.createProgram(),L=M.createShader(M.VERTEX_SHADER),I=M.createShader(M.FRAGMENT_SHADER);M.shaderSource(L,["precision "+e.getPrecision()+" float;","#define SHADER_NAME SpriteMaterial\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n")),M.shaderSource(I,["precision "+e.getPrecision()+" float;","#define SHADER_NAME SpriteMaterial\nuniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")),M.compileShader(L),M.compileShader(I),M.attachShader(N,L),M.attachShader(N,I),M.linkProgram(N),E=N,x=M.getAttribLocation(E,"position"),w=M.getAttribLocation(E,"uv"),i=M.getUniformLocation(E,"uvOffset"),o=M.getUniformLocation(E,"uvScale"),a=M.getUniformLocation(E,"rotation"),c=M.getUniformLocation(E,"scale"),l=M.getUniformLocation(E,"color"),h=M.getUniformLocation(E,"map"),p=M.getUniformLocation(E,"opacity"),f=M.getUniformLocation(E,"modelViewMatrix"),d=M.getUniformLocation(E,"projectionMatrix"),m=M.getUniformLocation(E,"fogType"),v=M.getUniformLocation(E,"fogDensity"),y=M.getUniformLocation(E,"fogNear"),g=M.getUniformLocation(E,"fogFar"),b=M.getUniformLocation(E,"fogColor"),_=M.getUniformLocation(E,"alphaTest"),(N=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")).width=8,N.height=8,(L=N.getContext("2d")).fillStyle="white",L.fillRect(0,0,8,8),(O=new n(N)).needsUpdate=!0}M.useProgram(E),C.initAttributes(),C.enableAttribute(x),C.enableAttribute(w),C.disableUnusedAttributes(),C.disable(M.CULL_FACE),C.enable(M.BLEND),M.bindBuffer(M.ARRAY_BUFFER,S),M.vertexAttribPointer(x,2,M.FLOAT,!1,16,0),M.vertexAttribPointer(w,2,M.FLOAT,!1,16,8),M.bindBuffer(M.ELEMENT_ARRAY_BUFFER,T),M.uniformMatrix4fv(d,!1,u.projectionMatrix.elements),C.activeTexture(M.TEXTURE0),M.uniform1i(h,0),L=N=0,(I=s.fog)?(M.uniform3f(b,I.color.r,I.color.g,I.color.b),I.isFog?(M.uniform1f(y,I.near),M.uniform1f(g,I.far),M.uniform1i(m,1),L=N=1):I.isFogExp2&&(M.uniform1f(v,I.density),M.uniform1i(m,2),L=N=2)):(M.uniform1i(m,0),L=N=0);for(var I=0,R=t.length;I<R;I++)(D=t[I]).modelViewMatrix.multiplyMatrices(u.matrixWorldInverse,D.matrixWorld),D.z=-D.modelViewMatrix.elements[14];t.sort(r);for(var k=[],I=0,R=t.length;I<R;I++){var D=t[I],F=D.material;if(!1!==F.visible){D.onBeforeRender(e,s,u,void 0,F,void 0),M.uniform1f(_,F.alphaTest),M.uniformMatrix4fv(f,!1,D.modelViewMatrix.elements),D.matrixWorld.decompose(j,P,A),k[0]=A.x,k[1]=A.y;var V=0;s.fog&&F.fog&&(V=L),N!==V&&(M.uniform1i(m,V),N=V),null!==F.map?(M.uniform2f(i,F.map.offset.x,F.map.offset.y),M.uniform2f(o,F.map.repeat.x,F.map.repeat.y)):(M.uniform2f(i,0,0),M.uniform2f(o,1,1)),M.uniform1f(p,F.opacity),M.uniform3f(l,F.color.r,F.color.g,F.color.b),M.uniform1f(a,F.rotation),M.uniform2fv(c,k),C.setBlending(F.blending,F.blendEquation,F.blendSrc,F.blendDst,F.blendEquationAlpha,F.blendSrcAlpha,F.blendDstAlpha,F.premultipliedAlpha),C.buffers.depth.setTest(F.depthTest),C.buffers.depth.setMask(F.depthWrite),F.map?e.setTexture2D(F.map,0):e.setTexture2D(O,0),M.drawElements(M.TRIANGLES,6,M.UNSIGNED_SHORT,0),D.onAfterRender(e,s,u,void 0,F,void 0)}}C.enable(M.CULL_FACE),e.resetGLState()}}}function W(){Object.defineProperty(this,"id",{value:Ri++}),this.uuid=xi.generateUUID(),this.name="",this.type="Material",this.lights=this.fog=!0,this.blending=1,this.side=0,this.shading=2,this.vertexColors=0,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null,this.depthFunc=3,this.depthWrite=this.depthTest=!0,this.clippingPlanes=null,this.clipShadows=this.clipIntersection=!1,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetUnits=this.polygonOffsetFactor=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.needsUpdate=this.visible=!0}function Q(e){W.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.morphNormals=this.morphTargets=this.skinning=this.clipping=this.lights=this.fog=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function K(e){W.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.morphTargets=this.skinning=!1,this.displacementMap=this.alphaMap=this.map=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.lights=this.fog=!1,this.setValues(e)}function X(e,t){this.min=void 0!==e?e:new u(1/0,1/0,1/0),this.max=void 0!==t?t:new u(-1/0,-1/0,-1/0)}function Y(e,t){this.center=void 0!==e?e:new u,this.radius=void 0!==t?t:0}function Z(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function J(e,t){this.normal=void 0!==e?e:new u(1,0,0),this.constant=void 0!==t?t:0}function ee(e,t,r,n,i,o){this.planes=[void 0!==e?e:new J,void 0!==t?t:new J,void 0!==r?r:new J,void 0!==n?n:new J,void 0!==i?i:new J,void 0!==o?o:new J]}function te(e,t,n,a){function s(t,r,n,i){var o,a=t.geometry;o=_;var s=t.customDepthMaterial;return n&&(o=x,s=t.customDistanceMaterial),s?o=s:(s=!1,r.morphTargets&&(a&&a.isBufferGeometry?s=a.morphAttributes&&a.morphAttributes.position&&0<a.morphAttributes.position.length:a&&a.isGeometry&&(s=a.morphTargets&&0<a.morphTargets.length)),t.isSkinnedMesh&&!1===r.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t),t=t.isSkinnedMesh&&r.skinning,a=0,s&&(a|=1),t&&(a|=2),o=o[a]),e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length&&(a=o.uuid,s=r.uuid,void 0===(t=w[a])&&(t={},w[a]=t),void 0===(a=t[s])&&(a=o.clone(),t[s]=a),o=a),o.visible=r.visible,o.wireframe=r.wireframe,s=r.side,A.renderSingleSided&&2==s&&(s=0),A.renderReverseSided&&(0===s?s=1:1===s&&(s=0)),o.side=s,o.clipShadows=r.clipShadows,o.clippingPlanes=r.clippingPlanes,o.wireframeLinewidth=r.wireframeLinewidth,o.linewidth=r.linewidth,n&&void 0!==o.uniforms.lightPos&&o.uniforms.lightPos.value.copy(i),o}function l(t,r,i,o){if(!1!==t.visible){if(t.layers.test(r.layers)&&(t.isMesh||t.isLine||t.isPoints)&&t.castShadow&&(!t.frustumCulled||f.intersectsObject(t))){t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld);var a=n.update(t),u=t.material;if(Array.isArray(u))for(var c=a.groups,h=0,p=c.length;h<p;h++){var d=c[h],m=u[d.materialIndex];m&&m.visible&&(m=s(t,m,o,b),e.renderBufferDirect(i,null,a,m,t,d))}else u.visible&&(m=s(t,u,o,b),e.renderBufferDirect(i,null,a,m,t,null))}for(a=0,u=(t=t.children).length;a<u;a++)l(t[a],r,i,o)}}var h=e.context,p=e.state,f=new ee,d=new c,m=t.shadows,v=new r,y=new r(a.maxTextureSize,a.maxTextureSize),g=new u,b=new u,_=Array(4),x=Array(4),w={},S=[new u(1,0,0),new u(-1,0,0),new u(0,0,1),new u(0,0,-1),new u(0,1,0),new u(0,-1,0)],T=[new u(0,1,0),new u(0,1,0),new u(0,1,0),new u(0,1,0),new u(0,0,1),new u(0,0,-1)],E=[new i,new i,new i,new i,new i,new i];(t=new K).depthPacking=3201,t.clipping=!0,a=Ii.distanceRGBA;for(var O=Ni.clone(a.uniforms),M=0;4!==M;++M){var C=0!=(1&M),j=0!=(2&M),P=t.clone();P.morphTargets=C,P.skinning=j,_[M]=P,C=new Q({defines:{USE_SHADOWMAP:""},uniforms:O,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,morphTargets:C,skinning:j,clipping:!0}),x[M]=C}var A=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.renderSingleSided=this.renderReverseSided=!0,this.render=function(t,r){if(!1!==A.enabled&&(!1!==A.autoUpdate||!1!==A.needsUpdate)&&0!==m.length){p.disable(h.BLEND),p.buffers.color.setClear(1,1,1,1),p.buffers.depth.setTest(!0),p.setScissorTest(!1);for(var n,i=0,a=m.length;i<a;i++){var s=m[i];n=s.shadow;var u=s&&s.isPointLight;if(void 0===n)console.warn("THREE.WebGLShadowMap:",s,"has no shadow.");else{var c=n.camera;if(v.copy(n.mapSize),v.min(y),u){var _=v.x,x=v.y;E[0].set(2*_,x,_,x),E[1].set(0,x,_,x),E[2].set(3*_,x,_,x),E[3].set(_,x,_,x),E[4].set(3*_,0,_,x),E[5].set(_,0,_,x),v.x*=4,v.y*=2}for(null===n.map&&(n.map=new o(v.x,v.y,{minFilter:1003,magFilter:1003,format:1023}),n.map.texture.name=s.name+".shadowMap",c.updateProjectionMatrix()),n.isSpotLightShadow&&n.update(s),_=n.map,x=n.matrix,b.setFromMatrixPosition(s.matrixWorld),c.position.copy(b),u?(n=6,x.makeTranslation(-b.x,-b.y,-b.z)):(n=1,g.setFromMatrixPosition(s.target.matrixWorld),c.lookAt(g),c.updateMatrixWorld(),x.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),x.multiply(c.projectionMatrix),x.multiply(c.matrixWorldInverse)),e.setRenderTarget(_),e.clear(),s=0;s<n;s++)u&&(g.copy(c.position),g.add(S[s]),c.up.copy(T[s]),c.lookAt(g),c.updateMatrixWorld(),p.viewport(E[s])),d.multiplyMatrices(c.projectionMatrix,c.matrixWorldInverse),f.setFromMatrix(d),l(t,r,c,u)}}i=e.getClearColor(),a=e.getClearAlpha(),e.setClearColor(i,a),A.needsUpdate=!1}}}function re(e){var t={};return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t[e.uuid]},remove:function(r){r.isInterleavedBufferAttribute&&(r=r.data);var n=t[r.uuid];n&&(e.deleteBuffer(n.buffer),delete t[r.uuid])},update:function(r,n){if(r.isInterleavedBufferAttribute&&(r=r.data),void 0===(i=t[r.uuid])){var i=r.uuid,o=r,a=o.array,s=o.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW,u=e.createBuffer();e.bindBuffer(n,u),e.bufferData(n,a,s),o.onUploadCallback(),s=e.FLOAT,a instanceof Float32Array?s=e.FLOAT:a instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):a instanceof Uint16Array?s=e.UNSIGNED_SHORT:a instanceof Int16Array?s=e.SHORT:a instanceof Uint32Array?s=e.UNSIGNED_INT:a instanceof Int32Array?s=e.INT:a instanceof Int8Array?s=e.BYTE:a instanceof Uint8Array&&(s=e.UNSIGNED_BYTE),t[i]={buffer:u,type:s,bytesPerElement:a.BYTES_PER_ELEMENT,version:o.version}}else i.version<r.version&&(o=r,a=o.array,u=o.updateRange,e.bindBuffer(n,i.buffer),!1===o.dynamic?e.bufferData(n,a,e.STATIC_DRAW):-1===u.count?e.bufferSubData(n,0,a):0===u.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(e.bufferSubData(n,u.offset*a.BYTES_PER_ELEMENT,a.subarray(u.offset,u.offset+u.count)),u.count=-1),i.version=r.version)}}}function ne(e,t,r,n){this._x=e||0,this._y=t||0,this._z=r||0,this._order=n||ne.DefaultOrder}function ie(){this.mask=1}function oe(){Object.defineProperty(this,"id",{value:ki++}),this.uuid=xi.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=oe.DefaultUp.clone();var e=new u,t=new ne,r=new s,n=new u(1,1,1);t.onChange(function(){r.setFromEuler(t,!1)}),r.onChange(function(){t.setFromQuaternion(r,void 0,!1)}),Object.defineProperties(this,{position:{enumerable:!0,value:e},rotation:{enumerable:!0,value:t},quaternion:{enumerable:!0,value:r},scale:{enumerable:!0,value:n},modelViewMatrix:{value:new c},normalMatrix:{value:new Z}}),this.matrix=new c,this.matrixWorld=new c,this.matrixAutoUpdate=oe.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new ie,this.visible=!0,this.receiveShadow=this.castShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function ae(){oe.call(this),this.type="Camera",this.matrixWorldInverse=new c,this.projectionMatrix=new c}function se(e,t,r,n,i,o){ae.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=n,this.near=void 0!==i?i:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function ue(e,t,r,n){ae.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==r?r:.1,this.far=void 0!==n?n:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function ce(e,t,r,n,i,o){this.a=e,this.b=t,this.c=r,this.normal=n&&n.isVector3?n:new u,this.vertexNormals=Array.isArray(n)?n:[],this.color=i&&i.isColor?i:new z,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==o?o:0}function le(){Object.defineProperty(this,"id",{value:Di++}),this.uuid=xi.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingSphere=this.boundingBox=null,this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.verticesNeedUpdate=this.elementsNeedUpdate=!1}function he(e,t,r){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=xi.generateUUID(),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===r,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function pe(e,t){he.call(this,new Int8Array(e),t)}function fe(e,t){he.call(this,new Uint8Array(e),t)}function de(e,t){he.call(this,new Uint8ClampedArray(e),t)}function me(e,t){he.call(this,new Int16Array(e),t)}function ve(e,t){he.call(this,new Uint16Array(e),t)}function ye(e,t){he.call(this,new Int32Array(e),t)}function ge(e,t){he.call(this,new Uint32Array(e),t)}function be(e,t){he.call(this,new Float32Array(e),t)}function _e(e,t){he.call(this,new Float64Array(e),t)}function xe(){this.indices=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingSphere=this.boundingBox=null,this.groupsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=!1}function we(e){if(0===e.length)return-1/0;for(var t=e[0],r=1,n=e.length;r<n;++r)e[r]>t&&(t=e[r]);return t}function Se(){Object.defineProperty(this,"id",{value:Di++}),this.uuid=xi.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingSphere=this.boundingBox=null,this.drawRange={start:0,count:1/0}}function Te(e,t,r,n,i,o){le.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:n,heightSegments:i,depthSegments:o},this.fromBufferGeometry(new Ee(e,t,r,n,i,o)),this.mergeVertices()}function Ee(e,t,r,n,i,o){function a(e,t,r,n,i,o,a,m,v,y,g){var b=o/v,_=a/y,x=o/2,w=a/2,S=m/2;a=v+1;var T,E,O=y+1,M=o=0,C=new u;for(E=0;E<O;E++){var j=E*_-w;for(T=0;T<a;T++)C[e]=(T*b-x)*n,C[t]=j*i,C[r]=S,l.push(C.x,C.y,C.z),C[e]=0,C[t]=0,C[r]=0<m?1:-1,h.push(C.x,C.y,C.z),p.push(T/v),p.push(1-E/y),o+=1}for(E=0;E<y;E++)for(T=0;T<v;T++)e=f+T+a*(E+1),t=f+(T+1)+a*(E+1),r=f+(T+1)+a*E,c.push(f+T+a*E,e,r),c.push(e,t,r),M+=6;s.addGroup(d,M,g),d+=M,f+=o}Se.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:n,heightSegments:i,depthSegments:o};var s=this;n=Math.floor(n)||1,i=Math.floor(i)||1;var c=[],l=[],h=[],p=[],f=0,d=0;a("z","y","x",-1,-1,r,t,e,o=Math.floor(o)||1,i,0),a("z","y","x",1,-1,r,t,-e,o,i,1),a("x","z","y",1,1,e,r,t,n,o,2),a("x","z","y",1,-1,e,r,-t,n,o,3),a("x","y","z",1,-1,e,t,r,n,i,4),a("x","y","z",-1,-1,e,t,-r,n,i,5),this.setIndex(c),this.addAttribute("position",new be(l,3)),this.addAttribute("normal",new be(h,3)),this.addAttribute("uv",new be(p,2))}function Oe(e,t,r,n){le.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:r,heightSegments:n},this.fromBufferGeometry(new Me(e,t,r,n)),this.mergeVertices()}function Me(e,t,r,n){Se.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:r,heightSegments:n};var i=e/2,o=t/2,a=(r=Math.floor(r)||1)+1,s=(n=Math.floor(n)||1)+1,u=e/r,c=t/n,l=[],h=[],p=[],f=[];for(e=0;e<s;e++){var d=e*c-o;for(t=0;t<a;t++)h.push(t*u-i,-d,0),p.push(0,0,1),f.push(t/r),f.push(1-e/n)}for(e=0;e<n;e++)for(t=0;t<r;t++)i=t+a*(e+1),o=t+1+a*(e+1),s=t+1+a*e,l.push(t+a*e,i,s),l.push(i,o,s);this.setIndex(l),this.addAttribute("position",new be(h,3)),this.addAttribute("normal",new be(p,3)),this.addAttribute("uv",new be(f,2))}function Ce(e){W.call(this),this.type="MeshBasicMaterial",this.color=new z(16777215),this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.envMap=this.alphaMap=this.specularMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.lights=this.morphTargets=this.skinning=!1,this.setValues(e)}function je(e,t){this.origin=void 0!==e?e:new u,this.direction=void 0!==t?t:new u}function Pe(e,t){this.start=void 0!==e?e:new u,this.end=void 0!==t?t:new u}function Ae(e,t,r){this.a=void 0!==e?e:new u,this.b=void 0!==t?t:new u,this.c=void 0!==r?r:new u}function Ne(e,t){oe.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new Se,this.material=void 0!==t?t:new Ce({color:16777215*Math.random()}),this.drawMode=0,this.updateMorphTargets()}function Le(e,t,r,n){function i(e,r){t.buffers.color.setClear(e.r,e.g,e.b,r,n)}var o,a,s,u,c=new z(0),l=0;return{getClearColor:function(){return c},setClearColor:function(e,t){c.set(e),i(c,l=void 0!==t?t:1)},getClearAlpha:function(){return l},setClearAlpha:function(e){i(c,l=e)},render:function(t,n,h){null===(t=t.background)?i(c,l):t&&t.isColor&&(i(t,1),h=!0),(e.autoClear||h)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),t&&t.isCubeTexture?(void 0===s&&(s=new ue,u=new Ne(new Ee(5,5,5),new Q({uniforms:Ii.cube.uniforms,vertexShader:Ii.cube.vertexShader,fragmentShader:Ii.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))),s.projectionMatrix.copy(n.projectionMatrix),s.matrixWorld.extractRotation(n.matrixWorld),s.matrixWorldInverse.getInverse(s.matrixWorld),u.material.uniforms.tCube.value=t,u.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,u.matrixWorld),r.update(u),e.renderBufferDirect(s,null,u.geometry,u.material,u,null)):t&&t.isTexture&&(void 0===o&&(o=new se(-1,1,1,-1,0,1),a=new Ne(new Me(2,2),new Ce({depthTest:!1,depthWrite:!1,fog:!1}))),a.material.map=t,r.update(a),e.renderBufferDirect(o,null,a.geometry,a.material,a,null))}}}function Ie(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program&&t.program&&e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Re(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function ke(){var e=[],t=-1,r=[],n=-1;return{opaque:e,transparent:r,init:function(){n=t=-1},push:function(i,o,a,s,u){var c,l;a.transparent?(c=r,l=++n):(c=e,l=++t),(l=c[l])?(l.id=i.id,l.object=i,l.geometry=o,l.material=a,l.program=a.program,l.renderOrder=i.renderOrder,l.z=s,l.group=u):(l={id:i.id,object:i,geometry:o,material:a,program:a.program,renderOrder:i.renderOrder,z:s,group:u},c.push(l))},finish:function(){e.length=t+1,r.length=n+1},sort:function(){e.sort(Ie),r.sort(Re)}}}function De(){var e={};return{get:function(t,r){var n=t.id+","+r.id,i=e[n];return void 0===i&&(i=new ke,e[n]=i),i},dispose:function(){e={}}}}function Fe(e,t,r){var n,i,o;this.setMode=function(e){n=e},this.setIndex=function(e){i=e.type,o=e.bytesPerElement},this.render=function(t,a){e.drawElements(n,a,i,t*o),r.calls++,r.vertices+=a,n===e.TRIANGLES&&(r.faces+=a/3)},this.renderInstances=function(a,s,u){var c=t.get("ANGLE_instanced_arrays");null===c?console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):(c.drawElementsInstancedANGLE(n,u,i,s*o,a.maxInstancedCount),r.calls++,r.vertices+=u*a.maxInstancedCount,n===e.TRIANGLES&&(r.faces+=a.maxInstancedCount*u/3))}}function Ve(e,t,r){var n;this.setMode=function(e){n=e},this.render=function(t,i){e.drawArrays(n,t,i),r.calls++,r.vertices+=i,n===e.TRIANGLES&&(r.faces+=i/3)},this.renderInstances=function(i,o,a){var s=t.get("ANGLE_instanced_arrays");if(null===s)console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{var u=i.attributes.position;u.isInterleavedBufferAttribute?(a=u.data.count,s.drawArraysInstancedANGLE(n,0,a,i.maxInstancedCount)):s.drawArraysInstancedANGLE(n,o,a,i.maxInstancedCount),r.calls++,r.vertices+=a*i.maxInstancedCount,n===e.TRIANGLES&&(r.faces+=i.maxInstancedCount*a/3)}}}function Be(e,t,r){function n(e){e=e.target;var a=i[e.id];null!==a.index&&t.remove(a.index);for(var s in a.attributes)t.remove(a.attributes[s]);e.removeEventListener("dispose",n),delete i[e.id],(s=o[e.id])&&(t.remove(s),delete o[e.id]),(s=o[a.id])&&(t.remove(s),delete o[a.id]),r.geometries--}var i={},o={};return{get:function(e,t){var o=i[t.id];return o||(t.addEventListener("dispose",n),t.isBufferGeometry?o=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new Se).setFromObject(e)),o=t._bufferGeometry),i[t.id]=o,r.geometries++,o)},update:function(r){var n=r.index,i=r.attributes;null!==n&&t.update(n,e.ELEMENT_ARRAY_BUFFER);for(var o in i)t.update(i[o],e.ARRAY_BUFFER);r=r.morphAttributes;for(o in r)for(var n=r[o],i=0,a=n.length;i<a;i++)t.update(n[i],e.ARRAY_BUFFER)},getWireframeAttribute:function(r){if(n=o[r.id])return n;var n=[],i=r.index,a=r.attributes;if(null!==i)for(var i=i.array,a=0,s=i.length;a<s;a+=3){var u=i[a+0],c=i[a+1],l=i[a+2];n.push(u,c,c,l,l,u)}else for(i=a.position.array,a=0,s=i.length/3-1;a<s;a+=3)u=a+0,c=a+1,l=a+2,n.push(u,c,c,l,l,u);return n=new(65535<we(n)?ge:ve)(n,1),t.update(n,e.ELEMENT_ARRAY_BUFFER),o[r.id]=n}}}function Ue(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new u,color:new z,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new r};break;case"SpotLight":n={position:new u,direction:new u,color:new z,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new r};break;case"PointLight":n={position:new u,color:new z,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new r};break;case"HemisphereLight":n={direction:new u,skyColor:new z,groundColor:new z};break;case"RectAreaLight":n={color:new z,position:new u,halfWidth:new u,halfHeight:new u}}return e[t.id]=n}}}function Ge(e,t,r){var n={};return{update:function(e){var i=r.frame,o=e.geometry,a=t.get(e,o);return n[a.id]!==i&&(o.isGeometry&&a.updateFromObject(e),t.update(a),n[a.id]=i),a},clear:function(){n={}}}}function ze(e){e=e.split("\n");for(var t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join("\n")}function qe(e,t,r){var n=e.createShader(t);return e.shaderSource(n,r),e.compileShader(n),!1===e.getShaderParameter(n,e.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(n)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",t===e.VERTEX_SHADER?"vertex":"fragment",e.getShaderInfoLog(n),ze(r)),n}function $e(e){switch(e){case 3e3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw Error("unsupported encoding: "+e)}}function He(e,t){var r=$e(t);return"vec4 "+e+"( vec4 value ) { return "+r[0]+"ToLinear"+r[1]+"; }"}function We(e,t){var r=$e(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+r[0]+r[1]+"; }"}function Qe(e,t){var r;switch(t){case 1:r="Linear";break;case 2:r="Reinhard";break;case 3:r="Uncharted2";break;case 4:r="OptimizedCineon";break;default:throw Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}function Ke(e,t,r){return e=e||{},[e.derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&r.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&r.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&r.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Ye).join("\n")}function Xe(e){var t,r=[];for(t in e){var n=e[t];!1!==n&&r.push("#define "+t+" "+n)}return r.join("\n")}function Ye(e){return""!==e}function Ze(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights)}function Je(e){return e.replace(/^[ \t]*#include +<([\w\d.]+)>/gm,function(e,t){var r=Li[t];if(void 0===r)throw Error("Can not resolve #include <"+t+">");return Je(r)})}function et(e){return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(e,t,r,n){for(e="",t=parseInt(t);t<parseInt(r);t++)e+=n.replace(/\[ i \]/g,"[ "+t+" ]");return e})}function tt(e,t,r,n,i){var o=e.context,a=r.extensions,s=r.defines,u=n.vertexShader,c=n.fragmentShader,l="SHADOWMAP_TYPE_BASIC";1===i.shadowMapType?l="SHADOWMAP_TYPE_PCF":2===i.shadowMapType&&(l="SHADOWMAP_TYPE_PCF_SOFT");var h="ENVMAP_TYPE_CUBE",p="ENVMAP_MODE_REFLECTION",f="ENVMAP_BLENDING_MULTIPLY";if(i.envMap){switch(r.envMap.mapping){case 301:case 302:h="ENVMAP_TYPE_CUBE";break;case 306:case 307:h="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:h="ENVMAP_TYPE_EQUIREC";break;case 305:h="ENVMAP_TYPE_SPHERE"}switch(r.envMap.mapping){case 302:case 304:p="ENVMAP_MODE_REFRACTION"}switch(r.combine){case 0:f="ENVMAP_BLENDING_MULTIPLY";break;case 1:f="ENVMAP_BLENDING_MIX";break;case 2:f="ENVMAP_BLENDING_ADD"}}var d=0<e.gammaFactor?e.gammaFactor:1,a=Ke(a,i,e.extensions),m=Xe(s),v=o.createProgram();r.isRawShaderMaterial?(s=[m,"\n"].filter(Ye).join("\n"),n=[a,m,"\n"].filter(Ye).join("\n")):(s=["precision "+i.precision+" float;","precision "+i.precision+" int;","#define SHADER_NAME "+n.name,m,i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+i.maxBones,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+p:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.vertexColors?"#define USE_COLOR":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.useVertexTexture?"#define BONE_TEXTURE":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+i.numClippingPlanes,i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&e.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Ye).join("\n"),n=[a,"precision "+i.precision+" float;","precision "+i.precision+" int;","#define SHADER_NAME "+n.name,m,i.alphaTest?"#define ALPHATEST "+i.alphaTest:"","#define GAMMA_FACTOR "+d,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+h:"",i.envMap?"#define "+p:"",i.envMap?"#define "+f:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.vertexColors?"#define USE_COLOR":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+i.numClippingPlanes,"#define UNION_CLIPPING_PLANES "+(i.numClippingPlanes-i.numClipIntersection),i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&e.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",i.envMap&&e.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",0!==i.toneMapping?"#define TONE_MAPPING":"",0!==i.toneMapping?Li.tonemapping_pars_fragment:"",0!==i.toneMapping?Qe("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.outputEncoding||i.mapEncoding||i.envMapEncoding||i.emissiveMapEncoding?Li.encodings_pars_fragment:"",i.mapEncoding?He("mapTexelToLinear",i.mapEncoding):"",i.envMapEncoding?He("envMapTexelToLinear",i.envMapEncoding):"",i.emissiveMapEncoding?He("emissiveMapTexelToLinear",i.emissiveMapEncoding):"",i.outputEncoding?We("linearToOutputTexel",i.outputEncoding):"",i.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(Ye).join("\n")),u=Ze(u=Je(u),i),c=Ze(c=Je(c),i),r.isShaderMaterial||(u=et(u),c=et(c)),c=n+c,u=qe(o,o.VERTEX_SHADER,s+u),c=qe(o,o.FRAGMENT_SHADER,c),o.attachShader(v,u),o.attachShader(v,c),void 0!==r.index0AttributeName?o.bindAttribLocation(v,0,r.index0AttributeName):!0===i.morphTargets&&o.bindAttribLocation(v,0,"position"),o.linkProgram(v),i=o.getProgramInfoLog(v),l=o.getShaderInfoLog(u),h=o.getShaderInfoLog(c),f=p=!0,!1===o.getProgramParameter(v,o.LINK_STATUS)?(p=!1,console.error("THREE.WebGLProgram: shader error: ",o.getError(),"gl.VALIDATE_STATUS",o.getProgramParameter(v,o.VALIDATE_STATUS),"gl.getProgramInfoLog",i,l,h)):""!==i?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",i):""!==l&&""!==h||(f=!1),f&&(this.diagnostics={runnable:p,material:r,programLog:i,vertexShader:{log:l,prefix:s},fragmentShader:{log:h,prefix:n}}),o.deleteShader(u),o.deleteShader(c);var y;this.getUniforms=function(){return void 0===y&&(y=new G(o,v,e)),y};var g;return this.getAttributes=function(){if(void 0===g){for(var e={},t=o.getProgramParameter(v,o.ACTIVE_ATTRIBUTES),r=0;r<t;r++){var n=o.getActiveAttrib(v,r).name;e[n]=o.getAttribLocation(v,n)}g=e}return g},this.destroy=function(){o.deleteProgram(v),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=Fi++,this.code=t,this.usedTimes=1,this.program=v,this.vertexShader=u,this.fragmentShader=c,this}function rt(e,t){function r(e,t){var r;return e?e.isTexture?r=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),r=e.texture.encoding):r=3e3,3e3===r&&t&&(r=3007),r}var n=[],i={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},o="precision supportsVertexTextures map mapEncoding envMap envMapMode envMapEncoding lightMap aoMap emissiveMap emissiveMapEncoding bumpMap normalMap displacementMap specularMap roughnessMap metalnessMap gradientMap alphaMap combine vertexColors fog useFog fogExp flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals premultipliedAlpha numDirLights numPointLights numSpotLights numHemiLights numRectAreaLights shadowMapEnabled shadowMapType toneMapping physicallyCorrectLights alphaTest doubleSided flipSided numClippingPlanes numClipIntersection depthPacking dithering".split(" ");this.getParameters=function(n,o,a,s,u,c){var l,h=i[n.type];if(c.isSkinnedMesh)if(l=c.skeleton.bones,t.floatVertexTextures)l=1024;else{var p=Math.min(Math.floor((t.maxVertexUniforms-20)/4),l.length);p<l.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+l.length+" bones. This GPU supports "+p+"."),l=0):l=p}else l=0;p=e.getPrecision(),null!==n.precision&&(p=t.getMaxPrecision(n.precision))!==n.precision&&console.warn("THREE.WebGLProgram.getParameters:",n.precision,"not supported, using",p,"instead.");var f=e.getRenderTarget();return{shaderID:h,precision:p,supportsVertexTextures:t.vertexTextures,outputEncoding:r(f?f.texture:null,e.gammaOutput),map:!!n.map,mapEncoding:r(n.map,e.gammaInput),envMap:!!n.envMap,envMapMode:n.envMap&&n.envMap.mapping,envMapEncoding:r(n.envMap,e.gammaInput),envMapCubeUV:!!n.envMap&&(306===n.envMap.mapping||307===n.envMap.mapping),lightMap:!!n.lightMap,aoMap:!!n.aoMap,emissiveMap:!!n.emissiveMap,emissiveMapEncoding:r(n.emissiveMap,e.gammaInput),bumpMap:!!n.bumpMap,normalMap:!!n.normalMap,displacementMap:!!n.displacementMap,roughnessMap:!!n.roughnessMap,metalnessMap:!!n.metalnessMap,specularMap:!!n.specularMap,alphaMap:!!n.alphaMap,gradientMap:!!n.gradientMap,combine:n.combine,vertexColors:n.vertexColors,fog:!!a,useFog:n.fog,fogExp:a&&a.isFogExp2,flatShading:1===n.shading,sizeAttenuation:n.sizeAttenuation,logarithmicDepthBuffer:t.logarithmicDepthBuffer,skinning:n.skinning&&0<l,maxBones:l,useVertexTexture:t.floatVertexTextures,morphTargets:n.morphTargets,morphNormals:n.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numClippingPlanes:s,numClipIntersection:u,dithering:n.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.receiveShadow&&0<o.shadows.length,shadowMapType:e.shadowMap.type,toneMapping:e.toneMapping,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:n.premultipliedAlpha,alphaTest:n.alphaTest,doubleSided:2===n.side,flipSided:1===n.side,depthPacking:void 0!==n.depthPacking&&n.depthPacking}},this.getProgramCode=function(t,r){var n=[];if(r.shaderID?n.push(r.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var i in t.defines)n.push(i),n.push(t.defines[i]);for(i=0;i<o.length;i++)n.push(r[o[i]]);return n.push(t.onBeforeCompile.toString()),n.push(e.gammaOutput),n.join()},this.acquireProgram=function(t,r,i,o){for(var a,s=0,u=n.length;s<u;s++){var c=n[s];if(c.code===o){++(a=c).usedTimes;break}}return void 0===a&&(a=new tt(e,o,t,r,i),n.push(a)),a},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=n.indexOf(e);n[t]=n[n.length-1],n.pop(),e.destroy()}},this.programs=n}function nt(e,t,r,n,i,o,a){function s(e,t){if(e.width>t||e.height>t){var r=t/Math.max(e.width,e.height),n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.width=Math.floor(e.width*r),n.height=Math.floor(e.height*r),n.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,n.width,n.height),console.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+n.width+"x"+n.height,e),n}return e}function u(e){return xi.isPowerOfTwo(e.width)&&xi.isPowerOfTwo(e.height)}function c(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function l(t){return 1003===t||1004===t||1005===t?e.NEAREST:e.LINEAR}function h(t){(t=t.target).removeEventListener("dispose",h);e:{var r=n.get(t);if(t.image&&r.__image__webglTextureCube)e.deleteTexture(r.__image__webglTextureCube);else{if(void 0===r.__webglInit)break e;e.deleteTexture(r.__webglTexture)}n.remove(t)}a.textures--}function p(t){(t=t.target).removeEventListener("dispose",p);var r=n.get(t),i=n.get(t.texture);if(t){if(void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLRenderTargetCube)for(i=0;6>i;i++)e.deleteFramebuffer(r.__webglFramebuffer[i]),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer[i]);else e.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer);n.remove(t.texture),n.remove(t)}a.textures--}function f(t,l){var p=n.get(t);if(0<t.version&&p.__version!==t.version)if(void 0===(m=t.image))console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t);else{if(!1!==m.complete){void 0===p.__webglInit&&(p.__webglInit=!0,t.addEventListener("dispose",h),p.__webglTexture=e.createTexture(),a.textures++),r.activeTexture(e.TEXTURE0+l),r.bindTexture(e.TEXTURE_2D,p.__webglTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,t.unpackAlignment);var f=s(t.image,i.maxTextureSize);(1001!==t.wrapS||1001!==t.wrapT||1003!==t.minFilter&&1006!==t.minFilter)&&!1===u(f)&&((m=f)instanceof HTMLImageElement||m instanceof HTMLCanvasElement?((v=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")).width=xi.nearestPowerOfTwo(m.width),v.height=xi.nearestPowerOfTwo(m.height),v.getContext("2d").drawImage(m,0,0,v.width,v.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+m.width+"x"+m.height+"). Resized to "+v.width+"x"+v.height,m),f=v):f=m);var m=u(f),v=o(t.format),g=o(t.type);d(e.TEXTURE_2D,t,m);var b=t.mipmaps;if(t.isDepthTexture){if(b=e.DEPTH_COMPONENT,1015===t.type){if(!y)throw Error("Float Depth Texture only supported in WebGL2.0");b=e.DEPTH_COMPONENT32F}else y&&(b=e.DEPTH_COMPONENT16);1026===t.format&&b===e.DEPTH_COMPONENT&&1012!==t.type&&1014!==t.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),t.type=1012,g=o(t.type)),1027===t.format&&(b=e.DEPTH_STENCIL,1020!==t.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),t.type=1020,g=o(t.type))),r.texImage2D(e.TEXTURE_2D,0,b,f.width,f.height,0,v,g,null)}else if(t.isDataTexture)if(0<b.length&&m){for(var _=0,x=b.length;_<x;_++)f=b[_],r.texImage2D(e.TEXTURE_2D,_,v,f.width,f.height,0,v,g,f.data);t.generateMipmaps=!1}else r.texImage2D(e.TEXTURE_2D,0,v,f.width,f.height,0,v,g,f.data);else if(t.isCompressedTexture)for(_=0,x=b.length;_<x;_++)f=b[_],1023!==t.format&&1022!==t.format?-1<r.getCompressedTextureFormats().indexOf(v)?r.compressedTexImage2D(e.TEXTURE_2D,_,v,f.width,f.height,0,f.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):r.texImage2D(e.TEXTURE_2D,_,v,f.width,f.height,0,v,g,f.data);else if(0<b.length&&m){for(_=0,x=b.length;_<x;_++)f=b[_],r.texImage2D(e.TEXTURE_2D,_,v,v,g,f);t.generateMipmaps=!1}else r.texImage2D(e.TEXTURE_2D,0,v,v,g,f);return c(t,m)&&e.generateMipmap(e.TEXTURE_2D),p.__version=t.version,void(t.onUpdate&&t.onUpdate(t))}console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t)}r.activeTexture(e.TEXTURE0+l),r.bindTexture(e.TEXTURE_2D,p.__webglTexture)}function d(r,a,s){s?(e.texParameteri(r,e.TEXTURE_WRAP_S,o(a.wrapS)),e.texParameteri(r,e.TEXTURE_WRAP_T,o(a.wrapT)),e.texParameteri(r,e.TEXTURE_MAG_FILTER,o(a.magFilter)),e.texParameteri(r,e.TEXTURE_MIN_FILTER,o(a.minFilter))):(e.texParameteri(r,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(r,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),1001===a.wrapS&&1001===a.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",a),e.texParameteri(r,e.TEXTURE_MAG_FILTER,l(a.magFilter)),e.texParameteri(r,e.TEXTURE_MIN_FILTER,l(a.minFilter)),1003!==a.minFilter&&1006!==a.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",a)),!(s=t.get("EXT_texture_filter_anisotropic"))||1015===a.type&&null===t.get("OES_texture_float_linear")||1016===a.type&&null===t.get("OES_texture_half_float_linear")||!(1<a.anisotropy||n.get(a).__currentAnisotropy)||(e.texParameterf(r,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),n.get(a).__currentAnisotropy=a.anisotropy)}function m(t,i,a,s){var u=o(i.texture.format),c=o(i.texture.type);r.texImage2D(s,0,u,i.width,i.height,0,u,c,null),e.bindFramebuffer(e.FRAMEBUFFER,t),e.framebufferTexture2D(e.FRAMEBUFFER,a,s,n.get(i.texture).__webglTexture,0),e.bindFramebuffer(e.FRAMEBUFFER,null)}function v(t,r){e.bindRenderbuffer(e.RENDERBUFFER,t),r.depthBuffer&&!r.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,r.width,r.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)):r.depthBuffer&&r.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,r.width,r.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)):e.renderbufferStorage(e.RENDERBUFFER,e.RGBA4,r.width,r.height),e.bindRenderbuffer(e.RENDERBUFFER,null)}var y="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext;this.setTexture2D=f,this.setTextureCube=function(t,l){var p=n.get(t);if(6===t.image.length)if(0<t.version&&p.__version!==t.version){p.__image__webglTextureCube||(t.addEventListener("dispose",h),p.__image__webglTextureCube=e.createTexture(),a.textures++),r.activeTexture(e.TEXTURE0+l),r.bindTexture(e.TEXTURE_CUBE_MAP,p.__image__webglTextureCube),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var f=t&&t.isCompressedTexture,m=t.image[0]&&t.image[0].isDataTexture,v=[],y=0;6>y;y++)v[y]=f||m?m?t.image[y].image:t.image[y]:s(t.image[y],i.maxCubemapSize);var g=u(v[0]),b=o(t.format),_=o(t.type);for(d(e.TEXTURE_CUBE_MAP,t,g),y=0;6>y;y++)if(f)for(var x,w=v[y].mipmaps,S=0,T=w.length;S<T;S++)x=w[S],1023!==t.format&&1022!==t.format?-1<r.getCompressedTextureFormats().indexOf(b)?r.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+y,S,b,x.width,x.height,0,x.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+y,S,b,x.width,x.height,0,b,_,x.data);else m?r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+y,0,b,v[y].width,v[y].height,0,b,_,v[y].data):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+y,0,b,b,_,v[y]);c(t,g)&&e.generateMipmap(e.TEXTURE_CUBE_MAP),p.__version=t.version,t.onUpdate&&t.onUpdate(t)}else r.activeTexture(e.TEXTURE0+l),r.bindTexture(e.TEXTURE_CUBE_MAP,p.__image__webglTextureCube)},this.setTextureCubeDynamic=function(t,i){r.activeTexture(e.TEXTURE0+i),r.bindTexture(e.TEXTURE_CUBE_MAP,n.get(t).__webglTexture)},this.setupRenderTarget=function(t){var i=n.get(t),o=n.get(t.texture);t.addEventListener("dispose",p),o.__webglTexture=e.createTexture(),a.textures++;var s=!0===t.isWebGLRenderTargetCube,l=u(t);if(s){i.__webglFramebuffer=[];for(var h=0;6>h;h++)i.__webglFramebuffer[h]=e.createFramebuffer()}else i.__webglFramebuffer=e.createFramebuffer();if(s){for(r.bindTexture(e.TEXTURE_CUBE_MAP,o.__webglTexture),d(e.TEXTURE_CUBE_MAP,t.texture,l),h=0;6>h;h++)m(i.__webglFramebuffer[h],t,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+h);c(t.texture,l)&&e.generateMipmap(e.TEXTURE_CUBE_MAP),r.bindTexture(e.TEXTURE_CUBE_MAP,null)}else r.bindTexture(e.TEXTURE_2D,o.__webglTexture),d(e.TEXTURE_2D,t.texture,l),m(i.__webglFramebuffer,t,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),c(t.texture,l)&&e.generateMipmap(e.TEXTURE_2D),r.bindTexture(e.TEXTURE_2D,null);if(t.depthBuffer){if(i=n.get(t),o=!0===t.isWebGLRenderTargetCube,t.depthTexture){if(o)throw Error("target.depthTexture not supported in Cube render targets");if(t&&t.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported!");if(e.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),!t.depthTexture||!t.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(n.get(t.depthTexture).__webglTexture&&t.depthTexture.image.width===t.width&&t.depthTexture.image.height===t.height||(t.depthTexture.image.width=t.width,t.depthTexture.image.height=t.height,t.depthTexture.needsUpdate=!0),f(t.depthTexture,0),i=n.get(t.depthTexture).__webglTexture,1026===t.depthTexture.format)e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,i,0);else{if(1027!==t.depthTexture.format)throw Error("Unknown depthTexture format");e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,i,0)}}else if(o)for(i.__webglDepthbuffer=[],o=0;6>o;o++)e.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[o]),i.__webglDepthbuffer[o]=e.createRenderbuffer(),v(i.__webglDepthbuffer[o],t);else e.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),v(i.__webglDepthbuffer,t);e.bindFramebuffer(e.FRAMEBUFFER,null)}},this.updateRenderTargetMipmap=function(t){var i=t.texture;c(i,u(t))&&(t=t.isWebGLRenderTargetCube?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,i=n.get(i).__webglTexture,r.bindTexture(t,i),e.generateMipmap(t),r.bindTexture(t,null))}}function it(){var e={};return{get:function(t){t=t.uuid;var r=e[t];return void 0===r&&(r={},e[t]=r),r},remove:function(t){delete e[t.uuid]},clear:function(){e={}}}}function ot(e,t,r){function n(t,r,n){var i=new Uint8Array(4),o=e.createTexture();for(e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST),t=0;t<n;t++)e.texImage2D(r+t,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i);return o}function o(t){!0!==b[t]&&(e.enable(t),b[t]=!0)}function a(t){!1!==b[t]&&(e.disable(t),b[t]=!1)}function s(t,n,i,s,u,c,l,h){0!==t?o(e.BLEND):a(e.BLEND),5===t||t===x&&h===C||(2===t?h?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE)):3===t?h?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR)):4===t?h?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.SRC_COLOR)):h?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)),x=t,C=h),5===t?(u=u||n,c=c||i,l=l||s,n===w&&u===E||(e.blendEquationSeparate(r(n),r(u)),w=n,E=u),i===S&&s===T&&c===O&&l===M||(e.blendFuncSeparate(r(i),r(s),r(c),r(l)),S=i,T=s,O=c,M=l)):M=O=E=T=S=w=null}function u(t){j!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),j=t)}function c(t){0!==t?(o(e.CULL_FACE),t!==P&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):a(e.CULL_FACE),P=t}function l(t,r,n){t?(o(e.POLYGON_OFFSET_FILL),(N!==r||L!==n)&&(e.polygonOffset(r,n),N=r,L=n)):a(e.POLYGON_OFFSET_FILL)}function h(t){void 0===t&&(t=e.TEXTURE0+R-1),D!==t&&(e.activeTexture(t),D=t)}var p=new function(){var t=!1,r=new i,n=null,o=new i;return{setMask:function(r){n===r||t||(e.colorMask(r,r,r,r),n=r)},setLocked:function(e){t=e},setClear:function(t,n,i,a,s){!0===s&&(t*=a,n*=a,i*=a),r.set(t,n,i,a),!1===o.equals(r)&&(e.clearColor(t,n,i,a),o.copy(r))},reset:function(){t=!1,n=null,o.set(0,0,0,1)}}},f=new function(){var t=!1,r=null,n=null,i=null;return{setTest:function(t){t?o(e.DEPTH_TEST):a(e.DEPTH_TEST)},setMask:function(n){r===n||t||(e.depthMask(n),r=n)},setFunc:function(t){if(n!==t){if(t)switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}else e.depthFunc(e.LEQUAL);n=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,i=n=r=null}}},d=new function(){var t=!1,r=null,n=null,i=null,s=null,u=null,c=null,l=null,h=null;return{setTest:function(t){t?o(e.STENCIL_TEST):a(e.STENCIL_TEST)},setMask:function(n){r===n||t||(e.stencilMask(n),r=n)},setFunc:function(t,r,o){n===t&&i===r&&s===o||(e.stencilFunc(t,r,o),n=t,i=r,s=o)},setOp:function(t,r,n){u===t&&c===r&&l===n||(e.stencilOp(t,r,n),u=t,c=r,l=n)},setLocked:function(e){t=e},setClear:function(t){h!==t&&(e.clearStencil(t),h=t)},reset:function(){t=!1,h=l=c=u=s=i=n=r=null}}},m=e.getParameter(e.MAX_VERTEX_ATTRIBS),v=new Uint8Array(m),y=new Uint8Array(m),g=new Uint8Array(m),b={},_=null,x=null,w=null,S=null,T=null,E=null,O=null,M=null,C=!1,j=null,P=null,A=null,N=null,L=null,I=null,R=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),m=parseFloat(/^WebGL\ ([0-9])/.exec(e.getParameter(e.VERSION))[1]),k=1<=parseFloat(m),D=null,F={},V=new i,B=new i,U={};return U[e.TEXTURE_2D]=n(e.TEXTURE_2D,e.TEXTURE_2D,1),U[e.TEXTURE_CUBE_MAP]=n(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),{buffers:{color:p,depth:f,stencil:d},init:function(){p.setClear(0,0,0,1),f.setClear(1),d.setClear(0),o(e.DEPTH_TEST),f.setFunc(3),u(!1),c(1),o(e.CULL_FACE),o(e.BLEND),s(1)},initAttributes:function(){for(var e=0,t=v.length;e<t;e++)v[e]=0},enableAttribute:function(r){v[r]=1,0===y[r]&&(e.enableVertexAttribArray(r),y[r]=1),0!==g[r]&&(t.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(r,0),g[r]=0)},enableAttributeAndDivisor:function(r,n){v[r]=1,0===y[r]&&(e.enableVertexAttribArray(r),y[r]=1),g[r]!==n&&(t.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(r,n),g[r]=n)},disableUnusedAttributes:function(){for(var t=0,r=y.length;t!==r;++t)y[t]!==v[t]&&(e.disableVertexAttribArray(t),y[t]=0)},enable:o,disable:a,getCompressedTextureFormats:function(){if(null===_&&(_=[],t.get("WEBGL_compressed_texture_pvrtc")||t.get("WEBGL_compressed_texture_s3tc")||t.get("WEBGL_compressed_texture_etc1")))for(var r=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS),n=0;n<r.length;n++)_.push(r[n]);return _},setBlending:s,setMaterial:function(t){2===t.side?a(e.CULL_FACE):o(e.CULL_FACE),u(1===t.side),!0===t.transparent?s(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):s(0),f.setFunc(t.depthFunc),f.setTest(t.depthTest),f.setMask(t.depthWrite),p.setMask(t.colorWrite),l(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:u,setCullFace:c,setLineWidth:function(t){t!==A&&(k&&e.lineWidth(t),A=t)},setPolygonOffset:l,getScissorTest:function(){return I},setScissorTest:function(t){(I=t)?o(e.SCISSOR_TEST):a(e.SCISSOR_TEST)},activeTexture:h,bindTexture:function(t,r){null===D&&h();var n=F[D];void 0===n&&(n={type:void 0,texture:void 0},F[D]=n),n.type===t&&n.texture===r||(e.bindTexture(t,r||U[t]),n.type=t,n.texture=r)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===V.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),V.copy(t))},viewport:function(t){!1===B.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),B.copy(t))},reset:function(){for(var t=0;t<y.length;t++)1===y[t]&&(e.disableVertexAttribArray(t),y[t]=0);b={},D=_=null,F={},P=j=x=null,p.reset(),f.reset(),d.reset()}}}function at(e,t,r){function n(t){if("highp"===t){if(0<e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision&&0<e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision)return"highp";t="mediump"}return"mediump"===t&&0<e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision&&0<e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision?"mediump":"lowp"}var i,o=void 0!==r.precision?r.precision:"highp";(a=n(o))!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a),r=!0===r.logarithmicDepthBuffer&&!!t.get("EXT_frag_depth");var a=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),s=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_TEXTURE_SIZE),c=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),l=e.getParameter(e.MAX_VERTEX_ATTRIBS),h=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),p=e.getParameter(e.MAX_VARYING_VECTORS),f=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),d=0<s,m=!!t.get("OES_texture_float");return{getMaxAnisotropy:function(){if(void 0!==i)return i;var r=t.get("EXT_texture_filter_anisotropic");return i=null!==r?e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:n,precision:o,logarithmicDepthBuffer:r,maxTextures:a,maxVertexTextures:s,maxTextureSize:u,maxCubemapSize:c,maxAttributes:l,maxVertexUniforms:h,maxVaryings:p,maxFragmentUniforms:f,vertexTextures:d,floatFragmentTextures:m,floatVertexTextures:d&&m}}function st(e){ue.call(this),this.cameras=e||[]}function ut(e){var t=this,r=null,n=null;"VRFrameData"in window&&(n=new window.VRFrameData);var o=new c,a=new c,s=new c,u=new ue;u.bounds=new i(0,0,.5,1),u.layers.enable(1);var l=new ue;l.bounds=new i(.5,0,.5,1),l.layers.enable(2);var h=new st([u,l]);h.layers.enable(1),h.layers.enable(2);var p,f;window.addEventListener("vrdisplaypresentchange",function(){if(r.isPresenting){var n=(i=r.getEyeParameters("left")).renderWidth,i=i.renderHeight;f=e.getPixelRatio(),p=e.getSize(),e.setDrawingBufferSize(2*n,i,1)}else t.enabled&&e.setDrawingBufferSize(p.width,p.height,f)},!1),this.standing=this.enabled=!1,this.getDevice=function(){return r},this.setDevice=function(e){void 0!==e&&(r=e)},this.getCamera=function(e){if(null===r)return e;r.depthNear=e.near,r.depthFar=e.far,r.getFrameData(n);var t=n.pose;return null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0),null!==t.orientation&&e.quaternion.fromArray(t.orientation),e.updateMatrixWorld(),t=r.stageParameters,this.standing&&t&&(a.fromArray(t.sittingToStandingTransform),s.getInverse(a),e.matrixWorld.multiply(a),e.matrixWorldInverse.multiply(s)),!1===r.isPresenting?e:(h.matrixWorld.copy(e.matrixWorld),h.matrixWorldInverse.copy(e.matrixWorldInverse),u.matrixWorldInverse.fromArray(n.leftViewMatrix),l.matrixWorldInverse.fromArray(n.rightViewMatrix),this.standing&&t&&(u.matrixWorldInverse.multiply(s),l.matrixWorldInverse.multiply(s)),null!==(e=e.parent)&&(o.getInverse(e.matrixWorld),u.matrixWorldInverse.multiply(o),l.matrixWorldInverse.multiply(o)),u.matrixWorld.getInverse(u.matrixWorldInverse),l.matrixWorld.getInverse(l.matrixWorldInverse),u.projectionMatrix.fromArray(n.leftProjectionMatrix),l.projectionMatrix.fromArray(n.rightProjectionMatrix),h.projectionMatrix.copy(u.projectionMatrix),(e=r.getLayers()).length&&(null!==(e=e[0]).leftBounds&&4===e.leftBounds.length&&u.bounds.fromArray(e.leftBounds),null!==e.rightBounds&&4===e.rightBounds.length&&l.bounds.fromArray(e.rightBounds)),h)},this.getStandingMatrix=function(){return a},this.submitFrame=function(){r&&r.isPresenting&&r.submitFrame()}}function ct(e){var t={};return{get:function(r){if(void 0!==t[r])return t[r];var n;switch(r){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":n=e.getExtension("WEBGL_compressed_texture_etc1");break;default:n=e.getExtension(r)}return null===n&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),t[r]=n}}}function lt(){function e(){c.value!==n&&(c.value=n,c.needsUpdate=0<i),r.numPlanes=i,r.numIntersection=0}function t(e,t,n,i){var o=null!==e?e.length:0,a=null;if(0!==o){if(a=c.value,!0!==i||null===a)for(i=n+4*o,t=t.matrixWorldInverse,u.getNormalMatrix(t),(null===a||a.length<i)&&(a=new Float32Array(i)),i=0;i!==o;++i,n+=4)s.copy(e[i]).applyMatrix4(t,u),s.normal.toArray(a,n),a[n+3]=s.constant;c.value=a,c.needsUpdate=!0}return r.numPlanes=o,a}var r=this,n=null,i=0,o=!1,a=!1,s=new J,u=new Z,c={value:null,needsUpdate:!1};this.uniform=c,this.numIntersection=this.numPlanes=0,this.init=function(e,r,a){var s=0!==e.length||r||0!==i||o;return o=r,n=t(e,a,0),i=e.length,s},this.beginShadows=function(){a=!0,t(null)},this.endShadows=function(){a=!1,e()},this.setState=function(r,s,u,l,h,p){if(!o||null===r||0===r.length||a&&!u)a?t(null):e();else{var f=4*(u=a?0:i),d=h.clippingState||null;for(c.value=d,d=t(r,l,f,p),r=0;r!==f;++r)d[r]=n[r];h.clippingState=d,this.numIntersection=s?this.numPlanes:0,this.numPlanes+=u}}}function ht(e){function t(){ge.init(),ge.scissor(z.copy(Z).multiplyScalar(Y)),ge.viewport(W.copy(ne).multiplyScalar(Y))}function r(){B=R=null,V="",F=-1,ge.reset()}function n(e){e.preventDefault(),r(),t(),be.clear(),Te.clear()}function o(e){(e=e.target).removeEventListener("dispose",o),a(e),be.remove(e)}function a(e){var t=be.get(e).program;e.program=void 0,void 0!==t&&Ee.releaseProgram(t)}function s(e,t,r){e.render(function(e){I.renderBufferImmediate(e,t,r)})}function h(e,t){return Math.abs(t[0])-Math.abs(e[0])}function p(e,t,r){if(e.visible){if(e.layers.test(t.layers))if(e.isLight)j.push(e);else if(e.isSprite)e.frustumCulled&&!ie.intersectsSprite(e)||N.push(e);else if(e.isLensFlare)L.push(e);else if(e.isImmediateRenderObject)r&&ce.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ue),P.push(e,null,e.material,ce.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.update(),!e.frustumCulled||ie.intersectsObject(e))){r&&ce.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ue);var n=Te.update(e),i=e.material;if(Array.isArray(i))for(var o=n.groups,a=0,s=o.length;a<s;a++){var u=o[a],c=i[u.materialIndex];c&&c.visible&&P.push(e,n,c,ce.z,u)}else i.visible&&P.push(e,n,i,ce.z,null)}for(a=0,s=(e=e.children).length;a<s;a++)p(e[a],t,r)}}function f(e,t,r,n){for(var i=0,o=e.length;i<o;i++){var a=(c=e[i]).object,s=c.geometry,u=void 0===n?c.material:n,c=c.group;if(r.isArrayCamera){U=r;for(var l=r.cameras,h=0,p=l.length;h<p;h++){var f=l[h];if(a.layers.test(f.layers)){var m=(g=f.bounds).x*K,v=g.y*X,y=g.z*K,g=g.w*X;I.setViewport(m,v,y,g),I.setScissor(m,v,y,g),I.setScissorTest(!0),d(a,t,f,s,u,c)}}}else U=null,d(a,t,r,s,u,c)}}function d(e,t,r,n,i,o){if(e.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.onBeforeRender(I,t,r,n,i,o),e.isImmediateRenderObject){ge.setMaterial(i);var a=v(r,t.fog,i,e);V="",s(e,a,i)}else I.renderBufferDirect(r,t.fog,n,i,e,o);e.onAfterRender(I,t,r,n,i,o)}function m(e,t,r){var n=be.get(e);r=Ee.getParameters(e,pe,t,oe.numPlanes,oe.numIntersection,r);var i=Ee.getProgramCode(e,r),s=n.program,u=!0;if(void 0===s)e.addEventListener("dispose",o);else if(s.code!==i)a(e);else{if(void 0!==r.shaderID)return;u=!1}if(u&&(r.shaderID?(s=Ii[r.shaderID],n.shader={name:e.type,uniforms:Ni.clone(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader}):n.shader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader},e.onBeforeCompile(n.shader),s=Ee.acquireProgram(e,n.shader,r,i),n.program=s,e.program=s),r=s.getAttributes(),e.morphTargets)for(i=e.numSupportedMorphTargets=0;i<I.maxMorphTargets;i++)0<=r["morphTarget"+i]&&e.numSupportedMorphTargets++;if(e.morphNormals)for(i=e.numSupportedMorphNormals=0;i<I.maxMorphNormals;i++)0<=r["morphNormal"+i]&&e.numSupportedMorphNormals++;r=n.shader.uniforms,(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(n.numClippingPlanes=oe.numPlanes,n.numIntersection=oe.numIntersection,r.clippingPlanes=oe.uniform),n.fog=t,n.lightsHash=pe.hash,e.lights&&(r.ambientLightColor.value=pe.ambient,r.directionalLights.value=pe.directional,r.spotLights.value=pe.spot,r.rectAreaLights.value=pe.rectArea,r.pointLights.value=pe.point,r.hemisphereLights.value=pe.hemi,r.directionalShadowMap.value=pe.directionalShadowMap,r.directionalShadowMatrix.value=pe.directionalShadowMatrix,r.spotShadowMap.value=pe.spotShadowMap,r.spotShadowMatrix.value=pe.spotShadowMatrix,r.pointShadowMap.value=pe.pointShadowMap,r.pointShadowMatrix.value=pe.pointShadowMatrix),e=n.program.getUniforms(),e=G.seqWithValue(e.seq,r),n.uniformsList=e}function v(e,t,r,n){Q=0;var i=be.get(r);ae&&(se||e!==B)&&oe.setState(r.clippingPlanes,r.clipIntersection,r.clipShadows,e,i,e===B&&r.id===F),!1===r.needsUpdate&&(void 0===i.program?r.needsUpdate=!0:r.fog&&i.fog!==t?r.needsUpdate=!0:r.lights&&i.lightsHash!==pe.hash?r.needsUpdate=!0:void 0===i.numClippingPlanes||i.numClippingPlanes===oe.numPlanes&&i.numIntersection===oe.numIntersection||(r.needsUpdate=!0)),r.needsUpdate&&(m(r,t,n),r.needsUpdate=!1);var o=!1,a=!1,s=!1,u=i.program,c=u.getUniforms(),h=i.shader.uniforms;if(u.id!==R&&(me.useProgram(u.program),R=u.id,s=a=o=!0),r.id!==F&&(F=r.id,a=!0),(o||e!==B)&&(c.setValue(me,"projectionMatrix",e.projectionMatrix),ye.logarithmicDepthBuffer&&c.setValue(me,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),B!==(U||e)&&(B=U||e,s=a=!0),(r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshStandardMaterial||r.envMap)&&void 0!==(o=c.map.cameraPosition)&&o.setValue(me,ce.setFromMatrixPosition(e.matrixWorld)),(r.isMeshPhongMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.skinning)&&c.setValue(me,"viewMatrix",e.matrixWorldInverse)),r.skinning&&(c.setOptional(me,n,"bindMatrix"),c.setOptional(me,n,"bindMatrixInverse"),e=n.skeleton))if(o=e.bones,ye.floatVertexTextures){if(void 0===e.boneTexture){var o=Math.sqrt(4*o.length),o=xi.nextPowerOfTwo(Math.ceil(o)),o=Math.max(o,4),p=new Float32Array(o*o*4);p.set(e.boneMatrices);var f=new l(p,o,o,1023,1015);e.boneMatrices=p,e.boneTexture=f,e.boneTextureSize=o}c.setValue(me,"boneTexture",e.boneTexture),c.setValue(me,"boneTextureSize",e.boneTextureSize)}else c.setOptional(me,e,"boneMatrices");if(a){if(c.setValue(me,"toneMappingExposure",I.toneMappingExposure),c.setValue(me,"toneMappingWhitePoint",I.toneMappingWhitePoint),r.lights&&(a=s,h.ambientLightColor.needsUpdate=a,h.directionalLights.needsUpdate=a,h.pointLights.needsUpdate=a,h.spotLights.needsUpdate=a,h.rectAreaLights.needsUpdate=a,h.hemisphereLights.needsUpdate=a),t&&r.fog&&(h.fogColor.value=t.color,t.isFog?(h.fogNear.value=t.near,h.fogFar.value=t.far):t.isFogExp2&&(h.fogDensity.value=t.density)),r.isMeshBasicMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial||r.isMeshStandardMaterial||r.isMeshNormalMaterial||r.isMeshDepthMaterial){h.opacity.value=r.opacity,h.diffuse.value=r.color,r.emissive&&h.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),h.map.value=r.map,h.specularMap.value=r.specularMap,h.alphaMap.value=r.alphaMap,r.lightMap&&(h.lightMap.value=r.lightMap,h.lightMapIntensity.value=r.lightMapIntensity),r.aoMap&&(h.aoMap.value=r.aoMap,h.aoMapIntensity.value=r.aoMapIntensity);var d;r.map?d=r.map:r.specularMap?d=r.specularMap:r.displacementMap?d=r.displacementMap:r.normalMap?d=r.normalMap:r.bumpMap?d=r.bumpMap:r.roughnessMap?d=r.roughnessMap:r.metalnessMap?d=r.metalnessMap:r.alphaMap?d=r.alphaMap:r.emissiveMap&&(d=r.emissiveMap),void 0!==d&&(d.isWebGLRenderTarget&&(d=d.texture),t=d.offset,d=d.repeat,h.offsetRepeat.value.set(t.x,t.y,d.x,d.y)),h.envMap.value=r.envMap,h.flipEnvMap.value=r.envMap&&r.envMap.isCubeTexture?-1:1,h.reflectivity.value=r.reflectivity,h.refractionRatio.value=r.refractionRatio}r.isLineBasicMaterial?(h.diffuse.value=r.color,h.opacity.value=r.opacity):r.isLineDashedMaterial?(h.diffuse.value=r.color,h.opacity.value=r.opacity,h.dashSize.value=r.dashSize,h.totalSize.value=r.dashSize+r.gapSize,h.scale.value=r.scale):r.isPointsMaterial?(h.diffuse.value=r.color,h.opacity.value=r.opacity,h.size.value=r.size*Y,h.scale.value=.5*X,h.map.value=r.map,null!==r.map&&(d=r.map.offset,r=r.map.repeat,h.offsetRepeat.value.set(d.x,d.y,r.x,r.y))):r.isMeshLambertMaterial?r.emissiveMap&&(h.emissiveMap.value=r.emissiveMap):r.isMeshToonMaterial?(y(h,r),r.gradientMap&&(h.gradientMap.value=r.gradientMap)):r.isMeshPhongMaterial?y(h,r):r.isMeshPhysicalMaterial?(h.clearCoat.value=r.clearCoat,h.clearCoatRoughness.value=r.clearCoatRoughness,g(h,r)):r.isMeshStandardMaterial?g(h,r):r.isMeshDepthMaterial?r.displacementMap&&(h.displacementMap.value=r.displacementMap,h.displacementScale.value=r.displacementScale,h.displacementBias.value=r.displacementBias):r.isMeshNormalMaterial&&(r.bumpMap&&(h.bumpMap.value=r.bumpMap,h.bumpScale.value=r.bumpScale),r.normalMap&&(h.normalMap.value=r.normalMap,h.normalScale.value.copy(r.normalScale)),r.displacementMap&&(h.displacementMap.value=r.displacementMap,h.displacementScale.value=r.displacementScale,h.displacementBias.value=r.displacementBias)),void 0!==h.ltcMat&&(h.ltcMat.value=Ai.LTC_MAT_TEXTURE),void 0!==h.ltcMag&&(h.ltcMag.value=Ai.LTC_MAG_TEXTURE),G.upload(me,i.uniformsList,h,I)}return c.setValue(me,"modelViewMatrix",n.modelViewMatrix),c.setValue(me,"normalMatrix",n.normalMatrix),c.setValue(me,"modelMatrix",n.matrixWorld),u}function y(e,t){e.specular.value=t.specular,e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function g(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function b(e,t){var r,n,i,o,a,s,u,c=0,l=0,h=0,p=t.matrixWorldInverse,f=0,d=0,m=0,v=0,y=0;for(r=0,n=e.length;r<n;r++)if(i=e[r],o=i.color,a=i.intensity,s=i.distance,u=i.shadow&&i.shadow.map?i.shadow.map.texture:null,i.isAmbientLight)c+=o.r*a,l+=o.g*a,h+=o.b*a;else if(i.isDirectionalLight){var g=Oe.get(i);g.color.copy(i.color).multiplyScalar(i.intensity),g.direction.setFromMatrixPosition(i.matrixWorld),ce.setFromMatrixPosition(i.target.matrixWorld),g.direction.sub(ce),g.direction.transformDirection(p),(g.shadow=i.castShadow)&&(o=i.shadow,g.shadowBias=o.bias,g.shadowRadius=o.radius,g.shadowMapSize=o.mapSize),pe.directionalShadowMap[f]=u,pe.directionalShadowMatrix[f]=i.shadow.matrix,pe.directional[f]=g,f++}else i.isSpotLight?((g=Oe.get(i)).position.setFromMatrixPosition(i.matrixWorld),g.position.applyMatrix4(p),g.color.copy(o).multiplyScalar(a),g.distance=s,g.direction.setFromMatrixPosition(i.matrixWorld),ce.setFromMatrixPosition(i.target.matrixWorld),g.direction.sub(ce),g.direction.transformDirection(p),g.coneCos=Math.cos(i.angle),g.penumbraCos=Math.cos(i.angle*(1-i.penumbra)),g.decay=0===i.distance?0:i.decay,(g.shadow=i.castShadow)&&(o=i.shadow,g.shadowBias=o.bias,g.shadowRadius=o.radius,g.shadowMapSize=o.mapSize),pe.spotShadowMap[m]=u,pe.spotShadowMatrix[m]=i.shadow.matrix,pe.spot[m]=g,m++):i.isRectAreaLight?((g=Oe.get(i)).color.copy(o).multiplyScalar(a/(i.width*i.height)),g.position.setFromMatrixPosition(i.matrixWorld),g.position.applyMatrix4(p),he.identity(),le.copy(i.matrixWorld),le.premultiply(p),he.extractRotation(le),g.halfWidth.set(.5*i.width,0,0),g.halfHeight.set(0,.5*i.height,0),g.halfWidth.applyMatrix4(he),g.halfHeight.applyMatrix4(he),pe.rectArea[v]=g,v++):i.isPointLight?((g=Oe.get(i)).position.setFromMatrixPosition(i.matrixWorld),g.position.applyMatrix4(p),g.color.copy(i.color).multiplyScalar(i.intensity),g.distance=i.distance,g.decay=0===i.distance?0:i.decay,(g.shadow=i.castShadow)&&(o=i.shadow,g.shadowBias=o.bias,g.shadowRadius=o.radius,g.shadowMapSize=o.mapSize),pe.pointShadowMap[d]=u,pe.pointShadowMatrix[d]=i.shadow.matrix,pe.point[d]=g,d++):i.isHemisphereLight&&((g=Oe.get(i)).direction.setFromMatrixPosition(i.matrixWorld),g.direction.transformDirection(p),g.direction.normalize(),g.skyColor.copy(i.color).multiplyScalar(a),g.groundColor.copy(i.groundColor).multiplyScalar(a),pe.hemi[y]=g,y++);pe.ambient[0]=c,pe.ambient[1]=l,pe.ambient[2]=h,pe.directional.length=f,pe.spot.length=m,pe.rectArea.length=v,pe.point.length=d,pe.hemi.length=y,pe.hash=f+","+d+","+m+","+v+","+y+","+pe.shadows.length}function _(e){var t;if(1e3===e)return me.REPEAT;if(1001===e)return me.CLAMP_TO_EDGE;if(1002===e)return me.MIRRORED_REPEAT;if(1003===e)return me.NEAREST;if(1004===e)return me.NEAREST_MIPMAP_NEAREST;if(1005===e)return me.NEAREST_MIPMAP_LINEAR;if(1006===e)return me.LINEAR;if(1007===e)return me.LINEAR_MIPMAP_NEAREST;if(1008===e)return me.LINEAR_MIPMAP_LINEAR;if(1009===e)return me.UNSIGNED_BYTE;if(1017===e)return me.UNSIGNED_SHORT_4_4_4_4;if(1018===e)return me.UNSIGNED_SHORT_5_5_5_1;if(1019===e)return me.UNSIGNED_SHORT_5_6_5;if(1010===e)return me.BYTE;if(1011===e)return me.SHORT;if(1012===e)return me.UNSIGNED_SHORT;if(1013===e)return me.INT;if(1014===e)return me.UNSIGNED_INT;if(1015===e)return me.FLOAT;if(1016===e&&null!==(t=ve.get("OES_texture_half_float")))return t.HALF_FLOAT_OES;if(1021===e)return me.ALPHA;if(1022===e)return me.RGB;if(1023===e)return me.RGBA;if(1024===e)return me.LUMINANCE;if(1025===e)return me.LUMINANCE_ALPHA;if(1026===e)return me.DEPTH_COMPONENT;if(1027===e)return me.DEPTH_STENCIL;if(100===e)return me.FUNC_ADD;if(101===e)return me.FUNC_SUBTRACT;if(102===e)return me.FUNC_REVERSE_SUBTRACT;if(200===e)return me.ZERO;if(201===e)return me.ONE;if(202===e)return me.SRC_COLOR;if(203===e)return me.ONE_MINUS_SRC_COLOR;if(204===e)return me.SRC_ALPHA;if(205===e)return me.ONE_MINUS_SRC_ALPHA;if(206===e)return me.DST_ALPHA;if(207===e)return me.ONE_MINUS_DST_ALPHA;if(208===e)return me.DST_COLOR;if(209===e)return me.ONE_MINUS_DST_COLOR;if(210===e)return me.SRC_ALPHA_SATURATE;if((2001===e||2002===e||2003===e||2004===e)&&null!==(t=ve.get("WEBGL_compressed_texture_s3tc"))){if(2001===e)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(2002===e)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(2003===e)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(2004===e)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((2100===e||2101===e||2102===e||2103===e)&&null!==(t=ve.get("WEBGL_compressed_texture_pvrtc"))){if(2100===e)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(2101===e)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(2102===e)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(2103===e)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(2151===e&&null!==(t=ve.get("WEBGL_compressed_texture_etc1")))return t.COMPRESSED_RGB_ETC1_WEBGL;if((103===e||104===e)&&null!==(t=ve.get("EXT_blend_minmax"))){if(103===e)return t.MIN_EXT;if(104===e)return t.MAX_EXT}return 1020===e&&null!==(t=ve.get("WEBGL_depth_texture"))?t.UNSIGNED_INT_24_8_WEBGL:0}console.log("THREE.WebGLRenderer","86");var x=void 0!==(e=e||{}).canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),w=void 0!==e.context?e.context:null,S=void 0!==e.alpha&&e.alpha,T=void 0===e.depth||e.depth,E=void 0===e.stencil||e.stencil,O=void 0!==e.antialias&&e.antialias,M=void 0===e.premultipliedAlpha||e.premultipliedAlpha,C=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,j=[],P=null,A=new Float32Array(8),N=[],L=[];this.domElement=x,this.context=null,this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.physicallyCorrectLights=this.gammaOutput=this.gammaInput=!1,this.toneMappingWhitePoint=this.toneMappingExposure=this.toneMapping=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var I=this,R=null,k=null,D=null,F=-1,V="",B=null,U=null,z=new i,q=null,W=new i,Q=0,K=x.width,X=x.height,Y=1,Z=new i(0,0,K,X),J=!1,ne=new i(0,0,K,X),ie=new ee,oe=new lt,ae=!1,se=!1,ue=new c,ce=new u,le=new c,he=new c,pe={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],shadows:[]},fe={geometries:0,textures:0},de={frame:0,calls:0,vertices:0,faces:0,points:0};this.info={render:de,memory:fe,programs:null};var me;try{if(S={alpha:S,depth:T,stencil:E,antialias:O,premultipliedAlpha:M,preserveDrawingBuffer:C},null===(me=w||x.getContext("webgl",S)||x.getContext("experimental-webgl",S))){if(null!==x.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context."}void 0===me.getShaderPrecisionFormat&&(me.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}),x.addEventListener("webglcontextlost",n,!1)}catch(e){console.error("THREE.WebGLRenderer: "+e)}var ve=new ct(me);ve.get("WEBGL_depth_texture"),ve.get("OES_texture_float"),ve.get("OES_texture_float_linear"),ve.get("OES_texture_half_float"),ve.get("OES_texture_half_float_linear"),ve.get("OES_standard_derivatives"),ve.get("ANGLE_instanced_arrays"),ve.get("OES_element_index_uint")&&(Se.MaxIndex=4294967296);var ye=new at(me,ve,e),ge=new ot(me,ve,_),be=new it,_e=new nt(me,ve,ge,be,ye,_,fe),xe=new re(me),we=new Be(me,xe,fe),Te=new Ge(me,we,de),Ee=new rt(this,ye),Oe=new Ue,Me=new De,Ce=new Le(this,ge,Te,M),je=new ut(this);this.info.programs=Ee.programs;var Pe=new Ve(me,ve,de),Ae=new Fe(me,ve,de);t(),this.context=me,this.capabilities=ye,this.extensions=ve,this.properties=be,this.renderLists=Me,this.state=ge,this.vr=je;var Ne=new te(this,pe,Te,ye);this.shadowMap=Ne;var Ie=new H(this,N),Re=new $(this,L);this.getContext=function(){return me},this.getContextAttributes=function(){return me.getContextAttributes()},this.forceContextLoss=function(){var e=ve.get("WEBGL_lose_context");e&&e.loseContext()},this.getMaxAnisotropy=function(){return ye.getMaxAnisotropy()},this.getPrecision=function(){return ye.precision},this.getPixelRatio=function(){return Y},this.setPixelRatio=function(e){void 0!==e&&(Y=e,this.setSize(K,X,!1))},this.getSize=function(){return{width:K,height:X}},this.setSize=function(e,t,r){var n=je.getDevice();n&&n.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(K=e,X=t,x.width=e*Y,x.height=t*Y,!1!==r&&(x.style.width=e+"px",x.style.height=t+"px"),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(){return{width:K*Y,height:X*Y}},this.setDrawingBufferSize=function(e,t,r){K=e,X=t,Y=r,x.width=e*r,x.height=t*r,this.setViewport(0,0,e,t)},this.setViewport=function(e,t,r,n){ne.set(e,X-t-n,r,n),ge.viewport(W.copy(ne).multiplyScalar(Y))},this.setScissor=function(e,t,r,n){Z.set(e,X-t-n,r,n),ge.scissor(z.copy(Z).multiplyScalar(Y))},this.setScissorTest=function(e){ge.setScissorTest(J=e)},this.getClearColor=Ce.getClearColor,this.setClearColor=Ce.setClearColor,this.getClearAlpha=Ce.getClearAlpha,this.setClearAlpha=Ce.setClearAlpha,this.clear=function(e,t,r){var n=0;(void 0===e||e)&&(n|=me.COLOR_BUFFER_BIT),(void 0===t||t)&&(n|=me.DEPTH_BUFFER_BIT),(void 0===r||r)&&(n|=me.STENCIL_BUFFER_BIT),me.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(e,t,r,n){this.setRenderTarget(e),this.clear(t,r,n)},this.resetGLState=r,this.dispose=function(){x.removeEventListener("webglcontextlost",n,!1),Me.dispose()},this.renderBufferImmediate=function(e,t,r){ge.initAttributes();var n=be.get(e);if(e.hasPositions&&!n.position&&(n.position=me.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=me.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=me.createBuffer()),e.hasColors&&!n.color&&(n.color=me.createBuffer()),t=t.getAttributes(),e.hasPositions&&(me.bindBuffer(me.ARRAY_BUFFER,n.position),me.bufferData(me.ARRAY_BUFFER,e.positionArray,me.DYNAMIC_DRAW),ge.enableAttribute(t.position),me.vertexAttribPointer(t.position,3,me.FLOAT,!1,0,0)),e.hasNormals){if(me.bindBuffer(me.ARRAY_BUFFER,n.normal),!r.isMeshPhongMaterial&&!r.isMeshStandardMaterial&&!r.isMeshNormalMaterial&&1===r.shading)for(var i=0,o=3*e.count;i<o;i+=9){var a=e.normalArray,s=(a[i+0]+a[i+3]+a[i+6])/3,u=(a[i+1]+a[i+4]+a[i+7])/3,c=(a[i+2]+a[i+5]+a[i+8])/3;a[i+0]=s,a[i+1]=u,a[i+2]=c,a[i+3]=s,a[i+4]=u,a[i+5]=c,a[i+6]=s,a[i+7]=u,a[i+8]=c}me.bufferData(me.ARRAY_BUFFER,e.normalArray,me.DYNAMIC_DRAW),ge.enableAttribute(t.normal),me.vertexAttribPointer(t.normal,3,me.FLOAT,!1,0,0)}e.hasUvs&&r.map&&(me.bindBuffer(me.ARRAY_BUFFER,n.uv),me.bufferData(me.ARRAY_BUFFER,e.uvArray,me.DYNAMIC_DRAW),ge.enableAttribute(t.uv),me.vertexAttribPointer(xe.uv,2,me.FLOAT,!1,0,0)),e.hasColors&&0!==r.vertexColors&&(me.bindBuffer(me.ARRAY_BUFFER,n.color),me.bufferData(me.ARRAY_BUFFER,e.colorArray,me.DYNAMIC_DRAW),ge.enableAttribute(t.color),me.vertexAttribPointer(t.color,3,me.FLOAT,!1,0,0)),ge.disableUnusedAttributes(),me.drawArrays(me.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,r,n,i,o){ge.setMaterial(n);var a=v(e,t,n,i),s=!1;if((e=r.id+"_"+a.id+"_"+(!0===n.wireframe))!==V&&(V=e,s=!0),void 0!==(t=i.morphTargetInfluences)){var u=[];e=0;for(var c=t.length;e<c;e++)s=t[e],u.push([s,e]);u.sort(h),8<u.length&&(u.length=8);f=r.morphAttributes;for(e=0,c=u.length;e<c;e++)s=u[e],A[e]=s[0],0!==s[0]?(t=s[1],!0===n.morphTargets&&f.position&&r.addAttribute("morphTarget"+e,f.position[t]),!0===n.morphNormals&&f.normal&&r.addAttribute("morphNormal"+e,f.normal[t])):(!0===n.morphTargets&&r.removeAttribute("morphTarget"+e),!0===n.morphNormals&&r.removeAttribute("morphNormal"+e));for(e=u.length,t=A.length;e<t;e++)A[e]=0;a.getUniforms().setValue(me,"morphTargetInfluences",A),s=!0}t=r.index,c=r.attributes.position,u=1,!0===n.wireframe&&(t=we.getWireframeAttribute(r),u=2);var l;if(e=Pe,null!==t&&(l=xe.get(t),(e=Ae).setIndex(l)),s){if(s=void 0,r&&r.isInstancedBufferGeometry&&null===ve.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{void 0===s&&(s=0),ge.initAttributes();var p,f=r.attributes,a=a.getAttributes(),d=n.defaultAttributeValues;for(p in a){var m=a[p];if(0<=m)if(void 0!==(T=f[p])){var y=T.normalized,g=T.itemSize,b=(x=xe.get(T)).buffer,_=x.type,x=x.bytesPerElement;if(T.isInterleavedBufferAttribute){var w=T.data,S=w.stride,T=T.offset;w&&w.isInstancedInterleavedBuffer?(ge.enableAttributeAndDivisor(m,w.meshPerAttribute),void 0===r.maxInstancedCount&&(r.maxInstancedCount=w.meshPerAttribute*w.count)):ge.enableAttribute(m),me.bindBuffer(me.ARRAY_BUFFER,b),me.vertexAttribPointer(m,g,_,y,S*x,(s*S+T)*x)}else T.isInstancedBufferAttribute?(ge.enableAttributeAndDivisor(m,T.meshPerAttribute),void 0===r.maxInstancedCount&&(r.maxInstancedCount=T.meshPerAttribute*T.count)):ge.enableAttribute(m),me.bindBuffer(me.ARRAY_BUFFER,b),me.vertexAttribPointer(m,g,_,y,0,s*g*x)}else if(void 0!==d&&void 0!==(y=d[p]))switch(y.length){case 2:me.vertexAttrib2fv(m,y);break;case 3:me.vertexAttrib3fv(m,y);break;case 4:me.vertexAttrib4fv(m,y);break;default:me.vertexAttrib1fv(m,y)}}ge.disableUnusedAttributes()}null!==t&&me.bindBuffer(me.ELEMENT_ARRAY_BUFFER,l.buffer)}if(l=0,null!==t?l=t.count:void 0!==c&&(l=c.count),t=r.drawRange.start*u,c=null!==o?o.start*u:0,p=Math.max(t,c),0!==(o=Math.max(0,Math.min(l,t+r.drawRange.count*u,c+(null!==o?o.count*u:1/0))-1-p+1))){if(i.isMesh)if(!0===n.wireframe)ge.setLineWidth(n.wireframeLinewidth*(null===k?Y:1)),e.setMode(me.LINES);else switch(i.drawMode){case 0:e.setMode(me.TRIANGLES);break;case 1:e.setMode(me.TRIANGLE_STRIP);break;case 2:e.setMode(me.TRIANGLE_FAN)}else i.isLine?(void 0===(n=n.linewidth)&&(n=1),ge.setLineWidth(n*(null===k?Y:1)),i.isLineSegments?e.setMode(me.LINES):i.isLineLoop?e.setMode(me.LINE_LOOP):e.setMode(me.LINE_STRIP)):i.isPoints&&e.setMode(me.POINTS);r&&r.isInstancedBufferGeometry?0<r.maxInstancedCount&&e.renderInstances(r,p,o):e.render(p,o)}},this.compile=function(e,t){j=[],e.traverse(function(e){e.isLight&&j.push(e)}),b(j,t),e.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var r=0;r<t.material.length;r++)m(t.material[r],e.fog,t);else m(t.material,e.fog,t)})},this.animate=function(e){function t(){e(),(je.getDevice()||window).requestAnimationFrame(t)}(je.getDevice()||window).requestAnimationFrame(t)},this.render=function(e,t,r,n){if(t&&t.isCamera){V="",F=-1,B=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),je.enabled&&(t=je.getCamera(t)),ue.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),ie.setFromMatrix(ue),j.length=0,N.length=0,L.length=0,se=this.localClippingEnabled,ae=oe.init(this.clippingPlanes,se,t),(P=Me.get(e,t)).init(),p(e,t,I.sortObjects),P.finish(),!0===I.sortObjects&&P.sort(),ae&&oe.beginShadows();for(var i=j,o=0,a=0,s=i.length;a<s;a++){var u=i[a];u.castShadow&&(pe.shadows[o]=u,o++)}pe.shadows.length=o,Ne.render(e,t),b(j,t),ae&&oe.endShadows(),de.frame++,de.calls=0,de.vertices=0,de.faces=0,de.points=0,void 0===r&&(r=null),this.setRenderTarget(r),Ce.render(e,t,n),n=P.opaque,i=P.transparent,e.overrideMaterial?(o=e.overrideMaterial,n.length&&f(n,e,t,o),i.length&&f(i,e,t,o)):(n.length&&f(n,e,t),i.length&&f(i,e,t)),Ie.render(e,t),Re.render(e,t,W),r&&_e.updateRenderTargetMipmap(r),ge.buffers.depth.setTest(!0),ge.buffers.depth.setMask(!0),ge.buffers.color.setMask(!0),t.isArrayCamera&&I.setScissorTest(!1),je.enabled&&je.submitFrame()}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFaceCulling=function(e,t){ge.setCullFace(e),ge.setFlipSided(0===t)},this.allocTextureUnit=function(){var e=Q;return e>=ye.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+e+" texture units while this GPU supports only "+ye.maxTextures),Q+=1,e},this.setTexture2D=function(){var e=!1;return function(t,r){t&&t.isWebGLRenderTarget&&(e||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),e=!0),t=t.texture),_e.setTexture2D(t,r)}}(),this.setTexture=function(){var e=!1;return function(t,r){e||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),e=!0),_e.setTexture2D(t,r)}}(),this.setTextureCube=function(){var e=!1;return function(t,r){t&&t.isWebGLRenderTargetCube&&(e||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),e=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?_e.setTextureCube(t,r):_e.setTextureCubeDynamic(t,r)}}(),this.getRenderTarget=function(){return k},this.setRenderTarget=function(e){(k=e)&&void 0===be.get(e).__webglFramebuffer&&_e.setupRenderTarget(e);var t,r=e&&e.isWebGLRenderTargetCube;e?(t=be.get(e),t=r?t.__webglFramebuffer[e.activeCubeFace]:t.__webglFramebuffer,z.copy(e.scissor),q=e.scissorTest,W.copy(e.viewport)):(t=null,z.copy(Z).multiplyScalar(Y),q=J,W.copy(ne).multiplyScalar(Y)),D!==t&&(me.bindFramebuffer(me.FRAMEBUFFER,t),D=t),ge.scissor(z),ge.setScissorTest(q),ge.viewport(W),r&&(r=be.get(e.texture),me.framebufferTexture2D(me.FRAMEBUFFER,me.COLOR_ATTACHMENT0,me.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,r.__webglTexture,e.activeMipMapLevel))},this.readRenderTargetPixels=function(e,t,r,n,i,o){if(e&&e.isWebGLRenderTarget){var a=be.get(e).__webglFramebuffer;if(a){var s=!1;a!==D&&(me.bindFramebuffer(me.FRAMEBUFFER,a),s=!0);try{var u=e.texture,c=u.format,l=u.type;1023!==c&&_(c)!==me.getParameter(me.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):1009===l||_(l)===me.getParameter(me.IMPLEMENTATION_COLOR_READ_TYPE)||1015===l&&(ve.get("OES_texture_float")||ve.get("WEBGL_color_buffer_float"))||1016===l&&ve.get("EXT_color_buffer_half_float")?me.checkFramebufferStatus(me.FRAMEBUFFER)===me.FRAMEBUFFER_COMPLETE?0<=t&&t<=e.width-n&&0<=r&&r<=e.height-i&&me.readPixels(t,r,n,i,_(c),_(l),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{s&&me.bindFramebuffer(me.FRAMEBUFFER,D)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")}}function pt(e,t){this.name="",this.color=new z(e),this.density=void 0!==t?t:25e-5}function ft(e,t,r){this.name="",this.color=new z(e),this.near=void 0!==t?t:1,this.far=void 0!==r?r:1e3}function dt(){oe.call(this),this.type="Scene",this.overrideMaterial=this.fog=this.background=null,this.autoUpdate=!0}function mt(e,t,r,n,i){oe.call(this),this.lensFlares=[],this.positionScreen=new u,this.customUpdateCallback=void 0,void 0!==e&&this.add(e,t,r,n,i)}function vt(e){W.call(this),this.type="SpriteMaterial",this.color=new z(16777215),this.map=null,this.rotation=0,this.lights=this.fog=!1,this.setValues(e)}function yt(e){oe.call(this),this.type="Sprite",this.material=void 0!==e?e:new vt}function gt(){oe.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function bt(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var r=0,n=this.bones.length;r<n;r++)this.boneInverses.push(new c)}}function _t(){oe.call(this),this.type="Bone"}function xt(e,t){Ne.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new c,this.bindMatrixInverse=new c;var r=new bt(r=this.initBones());this.bind(r,this.matrixWorld),this.normalizeSkinWeights()}function wt(e){W.call(this),this.type="LineBasicMaterial",this.color=new z(16777215),this.linewidth=1,this.linejoin=this.linecap="round",this.lights=!1,this.setValues(e)}function St(e,t,r){if(1===r)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new Tt(e,t);oe.call(this),this.type="Line",this.geometry=void 0!==e?e:new Se,this.material=void 0!==t?t:new wt({color:16777215*Math.random()})}function Tt(e,t){St.call(this,e,t),this.type="LineSegments"}function Et(e,t){St.call(this,e,t),this.type="LineLoop"}function Ot(e){W.call(this),this.type="PointsMaterial",this.color=new z(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(e)}function Mt(e,t){oe.call(this),this.type="Points",this.geometry=void 0!==e?e:new Se,this.material=void 0!==t?t:new Ot({color:16777215*Math.random()})}function Ct(){oe.call(this),this.type="Group"}function jt(e,t,r,i,o,a,s,u,c){function l(){requestAnimationFrame(l),e.readyState>=e.HAVE_CURRENT_DATA&&(h.needsUpdate=!0)}n.call(this,e,t,r,i,o,a,s,u,c),this.generateMipmaps=!1;var h=this;l()}function Pt(e,t,r,i,o,a,s,u,c,l,h,p){n.call(this,null,a,s,u,c,l,i,o,h,p),this.image={width:t,height:r},this.mipmaps=e,this.generateMipmaps=this.flipY=!1}function At(e,t,r,i,o,a,s,u,c){n.call(this,e,t,r,i,o,a,s,u,c),this.needsUpdate=!0}function Nt(e,t,r,i,o,a,s,u,c,l){if(1026!==(l=void 0!==l?l:1026)&&1027!==l)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===r&&1026===l&&(r=1012),void 0===r&&1027===l&&(r=1020),n.call(this,null,i,o,a,s,u,l,r,c),this.image={width:e,height:t},this.magFilter=void 0!==s?s:1003,this.minFilter=void 0!==u?u:1003,this.generateMipmaps=this.flipY=!1}function Lt(e){Se.call(this),this.type="WireframeGeometry";var t,r,n,i,o,a,s=[],c=[0,0],l={},h=["a","b","c"];if(e&&e.isGeometry){var p=e.faces;for(t=0,n=p.length;t<n;t++){var f=p[t];for(r=0;3>r;r++)o=f[h[r]],a=f[h[(r+1)%3]],c[0]=Math.min(o,a),c[1]=Math.max(o,a),o=c[0]+","+c[1],void 0===l[o]&&(l[o]={index1:c[0],index2:c[1]})}for(o in l)t=l[o],h=e.vertices[t.index1],s.push(h.x,h.y,h.z),h=e.vertices[t.index2],s.push(h.x,h.y,h.z)}else if(e&&e.isBufferGeometry){var d,h=new u;if(null!==e.index){for(p=e.attributes.position,f=e.index,0===(d=e.groups).length&&(d=[{start:0,count:f.count,materialIndex:0}]),e=0,i=d.length;e<i;++e)for(t=d[e],r=t.start,n=t.count,t=r,n=r+n;t<n;t+=3)for(r=0;3>r;r++)o=f.getX(t+r),a=f.getX(t+(r+1)%3),c[0]=Math.min(o,a),c[1]=Math.max(o,a),o=c[0]+","+c[1],void 0===l[o]&&(l[o]={index1:c[0],index2:c[1]});for(o in l)t=l[o],h.fromBufferAttribute(p,t.index1),s.push(h.x,h.y,h.z),h.fromBufferAttribute(p,t.index2),s.push(h.x,h.y,h.z)}else for(p=e.attributes.position,t=0,n=p.count/3;t<n;t++)for(r=0;3>r;r++)l=3*t+r,h.fromBufferAttribute(p,l),s.push(h.x,h.y,h.z),l=3*t+(r+1)%3,h.fromBufferAttribute(p,l),s.push(h.x,h.y,h.z)}this.addAttribute("position",new be(s,3))}function It(e,t,r){le.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:r},this.fromBufferGeometry(new Rt(e,t,r)),this.mergeVertices()}function Rt(e,t,r){Se.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:r};var n,i,o=[],a=[],s=[],c=[],l=new u,h=new u,p=new u,f=new u,d=new u,m=t+1;for(n=0;n<=r;n++){var v=n/r;for(i=0;i<=t;i++){var y=i/t,h=e(y,v,h);a.push(h.x,h.y,h.z),0<=y-1e-5?(p=e(y-1e-5,v,p),f.subVectors(h,p)):(p=e(y+1e-5,v,p),f.subVectors(p,h)),0<=v-1e-5?(p=e(y,v-1e-5,p),d.subVectors(h,p)):(p=e(y,v+1e-5,p),d.subVectors(p,h)),l.crossVectors(f,d).normalize(),s.push(l.x,l.y,l.z),c.push(y,v)}}for(n=0;n<r;n++)for(i=0;i<t;i++)e=n*m+i+1,l=(n+1)*m+i+1,h=(n+1)*m+i,o.push(n*m+i,e,h),o.push(e,l,h);this.setIndex(o),this.addAttribute("position",new be(a,3)),this.addAttribute("normal",new be(s,3)),this.addAttribute("uv",new be(c,2))}function kt(e,t,r,n){le.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:r,detail:n},this.fromBufferGeometry(new Dt(e,t,r,n)),this.mergeVertices()}function Dt(e,t,n,i){function o(e){c.push(e.x,e.y,e.z)}function a(t,r){var n=3*t;r.x=e[n+0],r.y=e[n+1],r.z=e[n+2]}function s(e,t,r,n){0>n&&1===e.x&&(l[t]=e.x-1),0===r.x&&0===r.z&&(l[t]=n/2/Math.PI+.5)}Se.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i},n=n||1;var c=[],l=[];!function(e){for(var r=new u,n=new u,i=new u,s=0;s<t.length;s+=3){a(t[s+0],r),a(t[s+1],n),a(t[s+2],i);var c,l,h=r,p=n,f=i,d=Math.pow(2,e),m=[];for(c=0;c<=d;c++){m[c]=[];var v=h.clone().lerp(f,c/d),y=p.clone().lerp(f,c/d),g=d-c;for(l=0;l<=g;l++)m[c][l]=0===l&&c===d?v:v.clone().lerp(y,l/g)}for(c=0;c<d;c++)for(l=0;l<2*(d-c)-1;l++)h=Math.floor(l/2),0==l%2?(o(m[c][h+1]),o(m[c+1][h]),o(m[c][h])):(o(m[c][h+1]),o(m[c+1][h+1]),o(m[c+1][h]))}}(i=i||0),function(e){for(var t=new u,r=0;r<c.length;r+=3)t.x=c[r+0],t.y=c[r+1],t.z=c[r+2],t.normalize().multiplyScalar(e),c[r+0]=t.x,c[r+1]=t.y,c[r+2]=t.z}(n),function(){for(var e=new u,t=0;t<c.length;t+=3)e.x=c[t+0],e.y=c[t+1],e.z=c[t+2],l.push(Math.atan2(e.z,-e.x)/2/Math.PI+.5,1-(Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+.5));for(var e=new u,t=new u,n=new u,i=new u,o=new r,a=new r,h=new r,p=0,f=0;p<c.length;p+=9,f+=6){e.set(c[p+0],c[p+1],c[p+2]),t.set(c[p+3],c[p+4],c[p+5]),n.set(c[p+6],c[p+7],c[p+8]),o.set(l[f+0],l[f+1]),a.set(l[f+2],l[f+3]),h.set(l[f+4],l[f+5]),i.copy(e).add(t).add(n).divideScalar(3);var d=Math.atan2(i.z,-i.x);s(o,f+0,e,d),s(a,f+2,t,d),s(h,f+4,n,d)}for(e=0;e<l.length;e+=6)t=l[e+0],n=l[e+2],i=l[e+4],o=Math.min(t,n,i),.9<Math.max(t,n,i)&&.1>o&&(.2>t&&(l[e+0]+=1),.2>n&&(l[e+2]+=1),.2>i&&(l[e+4]+=1))}(),this.addAttribute("position",new be(c,3)),this.addAttribute("normal",new be(c.slice(),3)),this.addAttribute("uv",new be(l,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}function Ft(e,t){le.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Vt(e,t)),this.mergeVertices()}function Vt(e,t){Dt.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Bt(e,t){le.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Ut(e,t)),this.mergeVertices()}function Ut(e,t){Dt.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Gt(e,t){le.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new zt(e,t)),this.mergeVertices()}function zt(e,t){var r=(1+Math.sqrt(5))/2;Dt.call(this,[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function qt(e,t){le.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new $t(e,t)),this.mergeVertices()}function $t(e,t){var r=(1+Math.sqrt(5))/2,n=1/r;Dt.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-r,0,-n,r,0,n,-r,0,n,r,-n,-r,0,-n,r,0,n,-r,0,n,r,0,-r,0,-n,r,0,-n,-r,0,n,r,0,n],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Ht(e,t,r,n,i,o){le.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:r,radialSegments:n,closed:i},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed."),e=new Wt(e,t,r,n,i),this.tangents=e.tangents,this.normals=e.normals,this.binormals=e.binormals,this.fromBufferGeometry(e),this.mergeVertices()}function Wt(e,t,n,i,o){function a(r){var o=e.getPointAt(r/t),a=s.normals[r];for(r=s.binormals[r],l=0;l<=i;l++){var u=l/i*Math.PI*2,c=Math.sin(u),u=-Math.cos(u);p.x=u*a.x+c*r.x,p.y=u*a.y+c*r.y,p.z=u*a.z+c*r.z,p.normalize(),m.push(p.x,p.y,p.z),h.x=o.x+n*p.x,h.y=o.y+n*p.y,h.z=o.z+n*p.z,d.push(h.x,h.y,h.z)}}Se.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:o},t=t||64,n=n||1,i=i||8,o=o||!1;var s=e.computeFrenetFrames(t,o);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;var c,l,h=new u,p=new u,f=new r,d=[],m=[],v=[],y=[];for(c=0;c<t;c++)a(c);for(a(!1===o?t:0),c=0;c<=t;c++)for(l=0;l<=i;l++)f.x=c/t,f.y=l/i,v.push(f.x,f.y);!function(){for(l=1;l<=t;l++)for(c=1;c<=i;c++){var e=(i+1)*l+(c-1),r=(i+1)*l+c,n=(i+1)*(l-1)+c;y.push((i+1)*(l-1)+(c-1),e,n),y.push(e,r,n)}}(),this.setIndex(y),this.addAttribute("position",new be(d,3)),this.addAttribute("normal",new be(m,3)),this.addAttribute("uv",new be(v,2))}function Qt(e,t,r,n,i,o,a){le.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:r,radialSegments:n,p:i,q:o},void 0!==a&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Kt(e,t,r,n,i,o)),this.mergeVertices()}function Kt(e,t,r,n,i,o){function a(e,t,r,n,i){var o=Math.sin(e);t=r/t*e,r=Math.cos(t),i.x=n*(2+r)*.5*Math.cos(e),i.y=n*(2+r)*o*.5,i.z=n*Math.sin(t)*.5}Se.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:r,radialSegments:n,p:i,q:o},e=e||100,t=t||40,r=Math.floor(r)||64,n=Math.floor(n)||8,i=i||2,o=o||3;var s,c,l=[],h=[],p=[],f=[],d=new u,m=new u,v=new u,y=new u,g=new u,b=new u,_=new u;for(s=0;s<=r;++s)for(c=s/r*i*Math.PI*2,a(c,i,o,e,v),a(c+.01,i,o,e,y),b.subVectors(y,v),_.addVectors(y,v),g.crossVectors(b,_),_.crossVectors(g,b),g.normalize(),_.normalize(),c=0;c<=n;++c){var x=c/n*Math.PI*2,w=-t*Math.cos(x),x=t*Math.sin(x);d.x=v.x+(w*_.x+x*g.x),d.y=v.y+(w*_.y+x*g.y),d.z=v.z+(w*_.z+x*g.z),h.push(d.x,d.y,d.z),m.subVectors(d,v).normalize(),p.push(m.x,m.y,m.z),f.push(s/r),f.push(c/n)}for(c=1;c<=r;c++)for(s=1;s<=n;s++)e=(n+1)*c+(s-1),t=(n+1)*c+s,i=(n+1)*(c-1)+s,l.push((n+1)*(c-1)+(s-1),e,i),l.push(e,t,i);this.setIndex(l),this.addAttribute("position",new be(h,3)),this.addAttribute("normal",new be(p,3)),this.addAttribute("uv",new be(f,2))}function Xt(e,t,r,n,i){le.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:r,tubularSegments:n,arc:i},this.fromBufferGeometry(new Yt(e,t,r,n,i)),this.mergeVertices()}function Yt(e,t,r,n,i){Se.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:r,tubularSegments:n,arc:i},e=e||100,t=t||40,r=Math.floor(r)||8,n=Math.floor(n)||6,i=i||2*Math.PI;var o,a,s=[],c=[],l=[],h=[],p=new u,f=new u,d=new u;for(o=0;o<=r;o++)for(a=0;a<=n;a++){var m=a/n*i,v=o/r*Math.PI*2;f.x=(e+t*Math.cos(v))*Math.cos(m),f.y=(e+t*Math.cos(v))*Math.sin(m),f.z=t*Math.sin(v),c.push(f.x,f.y,f.z),p.x=e*Math.cos(m),p.y=e*Math.sin(m),d.subVectors(f,p).normalize(),l.push(d.x,d.y,d.z),h.push(a/n),h.push(o/r)}for(o=1;o<=r;o++)for(a=1;a<=n;a++)e=(n+1)*(o-1)+a-1,t=(n+1)*(o-1)+a,i=(n+1)*o+a,s.push((n+1)*o+a-1,e,i),s.push(e,t,i);this.setIndex(s),this.addAttribute("position",new be(c,3)),this.addAttribute("normal",new be(l,3)),this.addAttribute("uv",new be(h,2))}function Zt(e,t){le.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new Jt(e,t)),this.mergeVertices()}function Jt(e,t){void 0!==e&&(Se.call(this),this.type="ExtrudeBufferGeometry",e=Array.isArray(e)?e:[e],this.addShapeList(e,t),this.computeVertexNormals())}function er(e,t){le.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new tr(e,t)),this.mergeVertices()}function tr(e,t){var r=(t=t||{}).font;if(!r||!r.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new le;r=r.generateShapes(e,t.size,t.curveSegments),t.amount=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),Jt.call(this,r,t),this.type="TextBufferGeometry"}function rr(e,t,r,n,i,o,a){le.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:r,phiStart:n,phiLength:i,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new nr(e,t,r,n,i,o,a)),this.mergeVertices()}function nr(e,t,r,n,i,o,a){Se.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:r,phiStart:n,phiLength:i,thetaStart:o,thetaLength:a},e=e||50,t=Math.max(3,Math.floor(t)||8),r=Math.max(2,Math.floor(r)||6),n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var s,c,l=(o=void 0!==o?o:0)+(a=void 0!==a?a:Math.PI),h=0,p=[],f=new u,d=new u,m=[],v=[],y=[],g=[];for(c=0;c<=r;c++){var b=[],_=c/r;for(s=0;s<=t;s++){var x=s/t;f.x=-e*Math.cos(n+x*i)*Math.sin(o+_*a),f.y=e*Math.cos(o+_*a),f.z=e*Math.sin(n+x*i)*Math.sin(o+_*a),v.push(f.x,f.y,f.z),d.set(f.x,f.y,f.z).normalize(),y.push(d.x,d.y,d.z),g.push(x,1-_),b.push(h++)}p.push(b)}for(c=0;c<r;c++)for(s=0;s<t;s++)e=p[c][s+1],n=p[c][s],i=p[c+1][s],a=p[c+1][s+1],(0!==c||0<o)&&m.push(e,n,a),(c!==r-1||l<Math.PI)&&m.push(n,i,a);this.setIndex(m),this.addAttribute("position",new be(v,3)),this.addAttribute("normal",new be(y,3)),this.addAttribute("uv",new be(g,2))}function ir(e,t,r,n,i,o){le.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:r,phiSegments:n,thetaStart:i,thetaLength:o},this.fromBufferGeometry(new or(e,t,r,n,i,o)),this.mergeVertices()}function or(e,t,n,i,o,a){Se.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:o,thetaLength:a},e=e||20,t=t||50,o=void 0!==o?o:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var s,c,l=[],h=[],p=[],f=[],d=e,m=(t-e)/(i=void 0!==i?Math.max(1,i):1),v=new u,y=new r;for(s=0;s<=i;s++){for(c=0;c<=n;c++)e=o+c/n*a,v.x=d*Math.cos(e),v.y=d*Math.sin(e),h.push(v.x,v.y,v.z),p.push(0,0,1),y.x=(v.x/t+1)/2,y.y=(v.y/t+1)/2,f.push(y.x,y.y);d+=m}for(s=0;s<i;s++)for(t=s*(n+1),c=0;c<n;c++)e=c+t,o=e+n+1,a=e+n+2,d=e+1,l.push(e,o,d),l.push(o,a,d);this.setIndex(l),this.addAttribute("position",new be(h,3)),this.addAttribute("normal",new be(p,3)),this.addAttribute("uv",new be(f,2))}function ar(e,t,r,n){le.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:n},this.fromBufferGeometry(new sr(e,t,r,n)),this.mergeVertices()}function sr(e,t,n,i){Se.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t)||12,n=n||0,i=i||2*Math.PI,i=xi.clamp(i,0,2*Math.PI);var o,a,s=[],c=[],l=[],h=1/t,p=new u,f=new r;for(o=0;o<=t;o++){a=n+o*h*i;var d=Math.sin(a),m=Math.cos(a);for(a=0;a<=e.length-1;a++)p.x=e[a].x*d,p.y=e[a].y,p.z=e[a].x*m,c.push(p.x,p.y,p.z),f.x=o/t,f.y=a/(e.length-1),l.push(f.x,f.y)}for(o=0;o<t;o++)for(a=0;a<e.length-1;a++)n=a+o*e.length,h=n+e.length,p=n+e.length+1,f=n+1,s.push(n,h,f),s.push(h,p,f);if(this.setIndex(s),this.addAttribute("position",new be(c,3)),this.addAttribute("uv",new be(l,2)),this.computeVertexNormals(),i===2*Math.PI)for(i=this.attributes.normal.array,s=new u,c=new u,l=new u,n=t*e.length*3,a=o=0;o<e.length;o++,a+=3)s.x=i[a+0],s.y=i[a+1],s.z=i[a+2],c.x=i[n+a+0],c.y=i[n+a+1],c.z=i[n+a+2],l.addVectors(s,c).normalize(),i[a+0]=i[n+a+0]=l.x,i[a+1]=i[n+a+1]=l.y,i[a+2]=i[n+a+2]=l.z}function ur(e,t){le.call(this),this.type="ShapeGeometry","object"==typeof t&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new cr(e,t)),this.mergeVertices()}function cr(e,t){function r(e){var r,s,c=i.length/3,l=(e=e.extractPoints(t)).shape,h=e.holes;if(!1===Vi.isClockWise(l))for(l=l.reverse(),e=0,r=h.length;e<r;e++)s=h[e],!0===Vi.isClockWise(s)&&(h[e]=s.reverse());var p=Vi.triangulateShape(l,h);for(e=0,r=h.length;e<r;e++)s=h[e],l=l.concat(s);for(e=0,r=l.length;e<r;e++)s=l[e],i.push(s.x,s.y,0),o.push(0,0,1),a.push(s.x,s.y);for(e=0,r=p.length;e<r;e++)l=p[e],n.push(l[0]+c,l[1]+c,l[2]+c),u+=3}Se.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var n=[],i=[],o=[],a=[],s=0,u=0;if(!1===Array.isArray(e))r(e);else for(var c=0;c<e.length;c++)r(e[c]),this.addGroup(s,u,c),s+=u,u=0;this.setIndex(n),this.addAttribute("position",new be(i,3)),this.addAttribute("normal",new be(o,3)),this.addAttribute("uv",new be(a,2))}function lr(e,t){Se.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t};var r,n,i,o=[],a=Math.cos(xi.DEG2RAD*(void 0!==t?t:1)),s=[0,0],u={},c=["a","b","c"];e.isBufferGeometry?(i=new le).fromBufferGeometry(e):i=e.clone(),i.mergeVertices(),i.computeFaceNormals();for(var l=i.vertices,h=0,p=(i=i.faces).length;h<p;h++)for(var f=i[h],d=0;3>d;d++)r=f[c[d]],n=f[c[(d+1)%3]],s[0]=Math.min(r,n),s[1]=Math.max(r,n),r=s[0]+","+s[1],void 0===u[r]?u[r]={index1:s[0],index2:s[1],face1:h,face2:void 0}:u[r].face2=h;for(r in u)(void 0===(s=u[r]).face2||i[s.face1].normal.dot(i[s.face2].normal)<=a)&&(c=l[s.index1],o.push(c.x,c.y,c.z),c=l[s.index2],o.push(c.x,c.y,c.z));this.addAttribute("position",new be(o,3))}function hr(e,t,r,n,i,o,a,s){le.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:r,radialSegments:n,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new pr(e,t,r,n,i,o,a,s)),this.mergeVertices()}function pr(e,t,n,i,o,a,s,c){function l(n){var o,a,l,y=new r,_=new u,x=0,w=!0===n?e:t,S=!0===n?1:-1;for(a=v,o=1;o<=i;o++)f.push(0,g*S,0),d.push(0,S,0),m.push(.5,.5),v++;for(l=v,o=0;o<=i;o++){var T=o/i*c+s,E=Math.cos(T),T=Math.sin(T);_.x=w*T,_.y=g*S,_.z=w*E,f.push(_.x,_.y,_.z),d.push(0,S,0),y.x=.5*E+.5,y.y=.5*T*S+.5,m.push(y.x,y.y),v++}for(o=0;o<i;o++)y=a+o,_=l+o,!0===n?p.push(_,_+1,y):p.push(_+1,_,y),x+=3;h.addGroup(b,x,!0===n?1:2),b+=x}Se.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:c};var h=this;e=void 0!==e?e:20,t=void 0!==t?t:20,n=void 0!==n?n:100,i=Math.floor(i)||8,o=Math.floor(o)||1,a=void 0!==a&&a,s=void 0!==s?s:0,c=void 0!==c?c:2*Math.PI;var p=[],f=[],d=[],m=[],v=0,y=[],g=n/2,b=0;!function(){var r,a,l=new u,_=new u,x=0,w=(t-e)/n;for(a=0;a<=o;a++){var S=[],T=a/o,E=T*(t-e)+e;for(r=0;r<=i;r++){var O=r/i,M=O*c+s,C=Math.sin(M),M=Math.cos(M);_.x=E*C,_.y=-T*n+g,_.z=E*M,f.push(_.x,_.y,_.z),l.set(C,w,M).normalize(),d.push(l.x,l.y,l.z),m.push(O,1-T),S.push(v++)}y.push(S)}for(r=0;r<i;r++)for(a=0;a<o;a++)l=y[a+1][r],_=y[a+1][r+1],w=y[a][r+1],p.push(y[a][r],l,w),p.push(l,_,w),x+=6;h.addGroup(b,x,0),b+=x}(),!1===a&&(0<e&&l(!0),0<t&&l(!1)),this.setIndex(p),this.addAttribute("position",new be(f,3)),this.addAttribute("normal",new be(d,3)),this.addAttribute("uv",new be(m,2))}function fr(e,t,r,n,i,o,a){hr.call(this,0,e,t,r,n,i,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:o,thetaLength:a}}function dr(e,t,r,n,i,o,a){pr.call(this,0,e,t,r,n,i,o,a),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:o,thetaLength:a}}function mr(e,t,r,n){le.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:n},this.fromBufferGeometry(new vr(e,t,r,n)),this.mergeVertices()}function vr(e,t,n,i){Se.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},e=e||50,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var o,a,s=[],c=[],l=[],h=[],p=new u,f=new r;for(c.push(0,0,0),l.push(0,0,1),h.push(.5,.5),a=0,o=3;a<=t;a++,o+=3){var d=n+a/t*i;p.x=e*Math.cos(d),p.y=e*Math.sin(d),c.push(p.x,p.y,p.z),l.push(0,0,1),f.x=(c[o]/e+1)/2,f.y=(c[o+1]/e+1)/2,h.push(f.x,f.y)}for(o=1;o<=t;o++)s.push(o,o+1,0);this.setIndex(s),this.addAttribute("position",new be(c,3)),this.addAttribute("normal",new be(l,3)),this.addAttribute("uv",new be(h,2))}function yr(e){Q.call(this,{uniforms:Ni.merge([Ai.lights,{opacity:{value:1}}]),vertexShader:Li.shadow_vert,fragmentShader:Li.shadow_frag}),this.transparent=this.lights=!0,Object.defineProperties(this,{opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}}}),this.setValues(e)}function gr(e){Q.call(this,e),this.type="RawShaderMaterial"}function br(e){W.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new z(16777215),this.metalness=this.roughness=.5,this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new z(0),this.emissiveIntensity=1,this.bumpMap=this.emissiveMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new r(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.envMap=this.alphaMap=this.metalnessMap=this.roughnessMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(e)}function _r(e){br.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoatRoughness=this.clearCoat=0,this.setValues(e)}function xr(e){W.call(this),this.type="MeshPhongMaterial",this.color=new z(16777215),this.specular=new z(1118481),this.shininess=30,this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new z(0),this.emissiveIntensity=1,this.bumpMap=this.emissiveMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new r(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.envMap=this.alphaMap=this.specularMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(e)}function wr(e){xr.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(e)}function Sr(e){W.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new r(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.morphNormals=this.morphTargets=this.skinning=this.lights=this.fog=!1,this.setValues(e)}function Tr(e){W.call(this),this.type="MeshLambertMaterial",this.color=new z(16777215),this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new z(0),this.emissiveIntensity=1,this.envMap=this.alphaMap=this.specularMap=this.emissiveMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(e)}function Er(e){W.call(this),this.type="LineDashedMaterial",this.color=new z(16777215),this.scale=this.linewidth=1,this.dashSize=3,this.gapSize=1,this.lights=!1,this.setValues(e)}function Or(e,t,r){var n=this,i=!1,o=0,a=0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r,this.itemStart=function(e){a++,!1===i&&void 0!==n.onStart&&n.onStart(e,o,a),i=!0},this.itemEnd=function(e){o++,void 0!==n.onProgress&&n.onProgress(e,o,a),o===a&&(i=!1,void 0!==n.onLoad)&&n.onLoad()},this.itemError=function(e){void 0!==n.onError&&n.onError(e)}}function Mr(e){this.manager=void 0!==e?e:zi}function Cr(e){this.manager=void 0!==e?e:zi,this._parser=null}function jr(e){this.manager=void 0!==e?e:zi,this._parser=null}function Pr(e){this.manager=void 0!==e?e:zi}function Ar(e){this.manager=void 0!==e?e:zi}function Nr(e){this.manager=void 0!==e?e:zi}function Lr(e,t){oe.call(this),this.type="Light",this.color=new z(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function Ir(e,t,r){Lr.call(this,e,r),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(oe.DefaultUp),this.updateMatrix(),this.groundColor=new z(t)}function Rr(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new r(512,512),this.map=null,this.matrix=new c}function kr(){Rr.call(this,new ue(50,1,.5,500))}function Dr(e,t,r,n,i,o){Lr.call(this,e,t),this.type="SpotLight",this.position.copy(oe.DefaultUp),this.updateMatrix(),this.target=new oe,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==r?r:0,this.angle=void 0!==n?n:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==o?o:1,this.shadow=new kr}function Fr(e,t,r,n){Lr.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==r?r:0,this.decay=void 0!==n?n:1,this.shadow=new Rr(new ue(90,1,.5,500))}function Vr(){Rr.call(this,new se(-5,5,5,-5,.5,500))}function Br(e,t){Lr.call(this,e,t),this.type="DirectionalLight",this.position.copy(oe.DefaultUp),this.updateMatrix(),this.target=new oe,this.shadow=new Vr}function Ur(e,t){Lr.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function Gr(e,t,r,n){Lr.call(this,e,t),this.type="RectAreaLight",this.position.set(0,1,0),this.updateMatrix(),this.width=void 0!==r?r:10,this.height=void 0!==n?n:10}function zr(e,t,r,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new t.constructor(r),this.sampleValues=t,this.valueSize=r}function qr(e,t,r,n){zr.call(this,e,t,r,n),this._offsetNext=this._weightNext=this._offsetPrev=this._weightPrev=-0}function $r(e,t,r,n){zr.call(this,e,t,r,n)}function Hr(e,t,r,n){zr.call(this,e,t,r,n)}function Wr(e,t,r,n){if(void 0===e)throw Error("track name is undefined");if(void 0===t||0===t.length)throw Error("no keyframes in track named "+e);this.name=e,this.times=qi.convertArray(t,this.TimeBufferType),this.values=qi.convertArray(r,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation),this.validate(),this.optimize()}function Qr(e,t,r,n){Wr.call(this,e,t,r,n)}function Kr(e,t,r,n){zr.call(this,e,t,r,n)}function Xr(e,t,r,n){Wr.call(this,e,t,r,n)}function Yr(e,t,r,n){Wr.call(this,e,t,r,n)}function Zr(e,t,r,n){Wr.call(this,e,t,r,n)}function Jr(e,t,r){Wr.call(this,e,t,r)}function en(e,t,r,n){Wr.call(this,e,t,r,n)}function tn(e,t,r,n){Wr.apply(this,arguments)}function rn(e,t,r){this.name=e,this.tracks=r,this.duration=void 0!==t?t:-1,this.uuid=xi.generateUUID(),0>this.duration&&this.resetDuration(),this.optimize()}function nn(e){this.manager=void 0!==e?e:zi,this.textures={}}function on(e){this.manager=void 0!==e?e:zi}function an(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}function sn(e){"boolean"==typeof e&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),e=void 0),this.manager=void 0!==e?e:zi,this.withCredentials=!1}function un(e){this.manager=void 0!==e?e:zi,this.texturePath=""}function cn(e,t,r,n,i){var o=e*e;return(2*r-2*n+(t=.5*(n-t))+(i=.5*(i-r)))*e*o+(-3*r+3*n-2*t-i)*o+t*e+r}function ln(e,t,r,n){var i=1-e;return i*i*t+2*(1-e)*e*r+e*e*n}function hn(e,t,r,n,i){var o=1-e,a=1-e;return o*o*o*t+3*a*a*e*r+3*(1-e)*e*e*n+e*e*e*i}function pn(){this.arcLengthDivisions=200}function fn(e,t){this.arcLengthDivisions=200,this.v1=e,this.v2=t}function dn(){this.arcLengthDivisions=200,this.curves=[],this.autoClose=!1}function mn(e,t,r,n,i,o,a,s){this.arcLengthDivisions=200,this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=n,this.aStartAngle=i,this.aEndAngle=o,this.aClockwise=a,this.aRotation=s||0}function vn(e){this.arcLengthDivisions=200,this.points=void 0===e?[]:e}function yn(e,t,r,n){this.arcLengthDivisions=200,this.v0=e,this.v1=t,this.v2=r,this.v3=n}function gn(e,t,r){this.arcLengthDivisions=200,this.v0=e,this.v1=t,this.v2=r}function bn(e){dn.call(this),this.currentPoint=new r,e&&this.fromPoints(e)}function _n(){bn.apply(this,arguments),this.holes=[]}function xn(){this.subPaths=[],this.currentPath=null}function wn(e){this.data=e}function Sn(e){this.manager=void 0!==e?e:zi}function Tn(e){this.manager=void 0!==e?e:zi}function En(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ue,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ue,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function On(e,t,r){oe.call(this),this.type="CubeCamera";var n=new ue(90,1,e,t);n.up.set(0,-1,0),n.lookAt(new u(1,0,0)),this.add(n);var i=new ue(90,1,e,t);i.up.set(0,-1,0),i.lookAt(new u(-1,0,0)),this.add(i);var o=new ue(90,1,e,t);o.up.set(0,0,1),o.lookAt(new u(0,1,0)),this.add(o);var s=new ue(90,1,e,t);s.up.set(0,0,-1),s.lookAt(new u(0,-1,0)),this.add(s);var c=new ue(90,1,e,t);c.up.set(0,-1,0),c.lookAt(new u(0,0,1)),this.add(c);var l=new ue(90,1,e,t);l.up.set(0,-1,0),l.lookAt(new u(0,0,-1)),this.add(l),this.renderTarget=new a(r,r,{format:1022,magFilter:1006,minFilter:1006}),this.renderTarget.texture.name="CubeCamera",this.updateCubeMap=function(e,t){null===this.parent&&this.updateMatrixWorld();var r=this.renderTarget,a=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,r.activeCubeFace=0,e.render(t,n,r),r.activeCubeFace=1,e.render(t,i,r),r.activeCubeFace=2,e.render(t,o,r),r.activeCubeFace=3,e.render(t,s,r),r.activeCubeFace=4,e.render(t,c,r),r.texture.generateMipmaps=a,r.activeCubeFace=5,e.render(t,l,r),e.setRenderTarget(null)}}function Mn(){oe.call(this),this.type="AudioListener",this.context=Zi.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function Cn(e){oe.call(this),this.type="Audio",this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.loop=!1,this.startTime=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function jn(e){Cn.call(this,e),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function Pn(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function An(e,t,r){switch(this.binding=e,this.valueSize=r,e=Float64Array,t){case"quaternion":t=this._slerp;break;case"string":case"bool":e=Array,t=this._select;break;default:t=this._lerp}this.buffer=new e(4*r),this._mixBufferRegion=t,this.referenceCount=this.useCount=this.cumulativeWeight=0}function Nn(e,t,r){r=r||Ln.parseTrackName(t),this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function Ln(e,t,r){this.path=t,this.parsedPath=r||Ln.parseTrackName(t),this.node=Ln.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function In(e){this.uuid=xi.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var r=0,n=arguments.length;r!==n;++r)t[arguments[r].uuid]=r;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}function Rn(e,t,r){this._mixer=e,this._clip=t,this._localRoot=r||null,t=(e=t.tracks).length,r=Array(t);for(var n={endingStart:2400,endingEnd:2400},i=0;i!==t;++i){var o=e[i].createInterpolant(null);r[i]=o,o.settings=n}this._interpolantSettings=n,this._interpolants=r,this._propertyBindings=Array(t),this._weightInterpolant=this._timeScaleInterpolant=this._byClipCacheIndex=this._cacheIndex=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this._effectiveWeight=this.weight=this._effectiveTimeScale=this.timeScale=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtEnd=this.zeroSlopeAtStart=!0}function kn(e){this._root=e,this._initMemoryManager(),this.time=this._accuIndex=0,this.timeScale=1}function Dn(e,t){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=t),this.value=e}function Fn(){Se.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Vn(e,t,r,n){this.uuid=xi.generateUUID(),this.data=e,this.itemSize=t,this.offset=r,this.normalized=!0===n}function Bn(e,t){this.uuid=xi.generateUUID(),this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function Un(e,t,r){Bn.call(this,e,t),this.meshPerAttribute=r||1}function Gn(e,t,r){he.call(this,e,t),this.meshPerAttribute=r||1}function zn(e,t,r,n){this.ray=new je(e,t),this.near=r||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function qn(e,t){return e.distance-t.distance}function $n(e,t,r,n){if(!1!==e.visible&&(e.raycast(t,r),!0===n)){n=0;for(var i=(e=e.children).length;n<i;n++)$n(e[n],t,r,!0)}}function Hn(e){this.autoStart=void 0===e||e,this.elapsedTime=this.oldTime=this.startTime=0,this.running=!1}function Wn(e,t,r){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==r?r:0,this}function Qn(e,t,r){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==r?r:0,this}function Kn(e,t){Ne.call(this,e,t),this.animationsMap={},this.animationsList=[];var r=this.geometry.morphTargets.length;this.createAnimation("__default",0,r-1,r/1),this.setAnimationWeight("__default",1)}function Xn(e){oe.call(this),this.material=e,this.render=function(e){}}function Yn(e,t,r,n){this.object=e,this.size=void 0!==t?t:1,e=void 0!==r?r:16711680,n=void 0!==n?n:1,t=0,(r=this.object.geometry)&&r.isGeometry?t=3*r.faces.length:r&&r.isBufferGeometry&&(t=r.attributes.normal.count),r=new Se,t=new be(6*t,3),r.addAttribute("position",t),Tt.call(this,r,new wt({color:e,linewidth:n})),this.matrixAutoUpdate=!1,this.update()}function Zn(e){oe.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,e=new Se;for(var t=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,n=1;32>r;r++,n++){var i=r/32*Math.PI*2,o=n/32*Math.PI*2;t.push(Math.cos(i),Math.sin(i),1,Math.cos(o),Math.sin(o),1)}e.addAttribute("position",new be(t,3)),t=new wt({fog:!1}),this.cone=new Tt(e,t),this.add(this.cone),this.update()}function Jn(e){var t=[];e&&e.isBone&&t.push(e);for(var r=0;r<e.children.length;r++)t.push.apply(t,Jn(e.children[r]));return t}function ei(e){for(var t=Jn(e),r=new Se,n=[],i=[],o=new z(0,0,1),a=new z(0,1,0),s=0;s<t.length;s++){var u=t[s];u.parent&&u.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),i.push(o.r,o.g,o.b),i.push(a.r,a.g,a.b))}r.addAttribute("position",new be(n,3)),r.addAttribute("color",new be(i,3)),n=new wt({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0}),Tt.call(this,r,n),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.onBeforeRender()}function ti(e,t){this.light=e,this.light.updateMatrixWorld();var r=new nr(t,4,2),n=new Ce({wireframe:!0,fog:!1});n.color.copy(this.light.color),Ne.call(this,r,n),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1}function ri(e){oe.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,e=new wt({color:e.color});var t=new Se;t.addAttribute("position",new he(new Float32Array(15),3)),this.add(new St(t,e)),this.update()}function ni(e,t){oe.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;var r=new Ut(t);r.rotateY(.5*Math.PI);var n=new Ce({vertexColors:2,wireframe:!0}),i=r.getAttribute("position"),i=new Float32Array(3*i.count);r.addAttribute("color",new he(i,3)),this.add(new Ne(r,n)),this.update()}function ii(e,t,r,n){e=e||10,t=t||10,r=new z(void 0!==r?r:4473924),n=new z(void 0!==n?n:8947848);var i=t/2,o=e/t,a=e/2;e=[];for(var s=[],u=0,c=0,l=-a;u<=t;u++,l+=o){e.push(-a,0,l,a,0,l),e.push(l,0,-a,l,0,a);var h=u===i?r:n;h.toArray(s,c),c+=3,h.toArray(s,c),c+=3,h.toArray(s,c),c+=3,h.toArray(s,c),c+=3}(t=new Se).addAttribute("position",new be(e,3)),t.addAttribute("color",new be(s,3)),r=new wt({vertexColors:2}),Tt.call(this,t,r)}function oi(e,t,r,n,i,o){e=e||10,t=t||16,r=r||8,n=n||64,i=new z(void 0!==i?i:4473924),o=new z(void 0!==o?o:8947848);var a,s,u,c,l,h=[],p=[];for(u=0;u<=t;u++)s=u/t*2*Math.PI,a=Math.sin(s)*e,s=Math.cos(s)*e,h.push(0,0,0),h.push(a,0,s),l=1&u?i:o,p.push(l.r,l.g,l.b),p.push(l.r,l.g,l.b);for(u=0;u<=r;u++)for(l=1&u?i:o,c=e-e/r*u,t=0;t<n;t++)s=t/n*2*Math.PI,a=Math.sin(s)*c,s=Math.cos(s)*c,h.push(a,0,s),p.push(l.r,l.g,l.b),s=(t+1)/n*2*Math.PI,a=Math.sin(s)*c,s=Math.cos(s)*c,h.push(a,0,s),p.push(l.r,l.g,l.b);(e=new Se).addAttribute("position",new be(h,3)),e.addAttribute("color",new be(p,3)),h=new wt({vertexColors:2}),Tt.call(this,e,h)}function ai(e,t,r,n){this.object=e,this.size=void 0!==t?t:1,e=void 0!==r?r:16776960,n=void 0!==n?n:1,t=0,(r=this.object.geometry)&&r.isGeometry?t=r.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead."),r=new Se,t=new be(6*t,3),r.addAttribute("position",t),Tt.call(this,r,new wt({color:e,linewidth:n})),this.matrixAutoUpdate=!1,this.update()}function si(e,t){oe.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,void 0===t&&(t=1);var r=new Se;r.addAttribute("position",new be([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var n=new wt({fog:!1});this.add(new St(r,n)),(r=new Se).addAttribute("position",new be([0,0,0,0,0,1],3)),this.add(new St(r,n)),this.update()}function ui(e){function t(e,t,n){r(e,n),r(t,n)}function r(e,t){o.push(0,0,0),a.push(t.r,t.g,t.b),void 0===s[e]&&(s[e]=[]),s[e].push(o.length/3-1)}var n=new Se,i=new wt({color:16777215,vertexColors:1}),o=[],a=[],s={},u=new z(16755200),c=new z(16711680),l=new z(43775),h=new z(16777215),p=new z(3355443);t("n1","n2",u),t("n2","n4",u),t("n4","n3",u),t("n3","n1",u),t("f1","f2",u),t("f2","f4",u),t("f4","f3",u),t("f3","f1",u),t("n1","f1",u),t("n2","f2",u),t("n3","f3",u),t("n4","f4",u),t("p","n1",c),t("p","n2",c),t("p","n3",c),t("p","n4",c),t("u1","u2",l),t("u2","u3",l),t("u3","u1",l),t("c","t",h),t("p","c",p),t("cn1","cn2",p),t("cn3","cn4",p),t("cf1","cf2",p),t("cf3","cf4",p),n.addAttribute("position",new be(o,3)),n.addAttribute("color",new be(a,3)),Tt.call(this,n,i),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}function ci(e,t){this.object=e,void 0===t&&(t=16776960);var r=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=new Float32Array(24),i=new Se;i.setIndex(new he(r,1)),i.addAttribute("position",new he(n,3)),Tt.call(this,i,new wt({color:t})),this.matrixAutoUpdate=!1,this.update()}function li(e,t,r,n,i,o){oe.call(this),void 0===n&&(n=16776960),void 0===r&&(r=1),void 0===i&&(i=.2*r),void 0===o&&(o=.2*i),void 0===Ji&&((Ji=new Se).addAttribute("position",new be([0,0,0,0,1,0],3)),(eo=new pr(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new St(Ji,new wt({color:n})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Ne(eo,new Ce({color:n})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(r,i,o)}function hi(e){var t=[0,0,0,e=e||1,0,0,0,0,0,0,e,0,0,0,0,0,0,e];(e=new Se).addAttribute("position",new be(t,3)),e.addAttribute("color",new be([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),t=new wt({vertexColors:2}),Tt.call(this,e,t)}function pi(){var e=0,t=0,r=0,n=0;return{initCatmullRom:function(i,o,a,s,u){e=o,t=i=u*(a-i),r=-3*o+3*a-2*i-(s=u*(s-o)),n=2*o-2*a+i+s},initNonuniformCatmullRom:function(i,o,a,s,u,c,l){e=o,t=i=((o-i)/u-(a-i)/(u+c)+(a-o)/c)*c,r=-3*o+3*a-2*i-(s=((a-o)/c-(s-o)/(c+l)+(s-a)/l)*c),n=2*o-2*a+i+s},calc:function(i){var o=i*i;return e+t*i+r*o+n*o*i}}}function fi(e){this.arcLengthDivisions=200,2>e.length&&console.warn("THREE.CatmullRomCurve3: Points array needs at least two entries."),this.points=e||[],this.closed=!1}function di(e,t,r,n){this.arcLengthDivisions=200,this.v0=e,this.v1=t,this.v2=r,this.v3=n}function mi(e,t,r){this.arcLengthDivisions=200,this.v0=e,this.v1=t,this.v2=r}function vi(e,t){this.arcLengthDivisions=200,this.v1=e,this.v2=t}function yi(e,t,r,n,i,o){mn.call(this,e,t,r,r,n,i,o)}function gi(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),fi.call(this,e),this.type="catmullrom",this.closed=!0}function bi(e){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),fi.call(this,e),this.type="catmullrom"}function _i(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),fi.call(this,e),this.type="catmullrom"}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return 0>e?-1:0<e?1:+e}),void 0===Function.prototype.name&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;r<arguments.length;r++){var n=arguments[r];if(void 0!==n&&null!==n)for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}),Object.assign(t.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var r=this._listeners[e];if(void 0!==r){var n=r.indexOf(t);-1!==n&&r.splice(n,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var r=0,n=(t=t.slice(0)).length;r<n;r++)t[r].call(this,e)}}}});var xi={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=Array(36),n=0;return function(){for(var i=0;36>i;i++)8===i||13===i||18===i||23===i?r[i]="-":14===i?r[i]="4":(2>=n&&(n=33554432+16777216*Math.random()|0),e=15&n,n>>=4,r[i]=t[19===i?3&e|8:e]);return r.join("")}}(),clamp:function(e,t,r){return Math.max(t,Math.min(r,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,r,n,i){return n+(e-t)*(i-n)/(r-t)},lerp:function(e,t,r){return(1-r)*e+r*t},smoothstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*(3-2*e)},smootherstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*xi.DEG2RAD},radToDeg:function(e){return e*xi.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},nearestPowerOfTwo:function(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))},nextPowerOfTwo:function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e}};Object.defineProperties(r.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(r.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.y=this.x=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(){var e=new r,t=new r;return function(r,n){return e.set(r,r),t.set(n,n),this.clamp(e,t)}}(),clampLength:function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(this.y,this.x);return 0>e&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x;return e=this.y-e.y,t*t+e*e},distanceToManhattan:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,r){return this.subVectors(t,e).multiplyScalar(r).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,r){return void 0!==r&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var r=Math.cos(t),n=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*r-o*n+e.x,this.y=i*n+o*r+e.y,this}});var wi=0;n.DEFAULT_IMAGE=void 0,n.DEFAULT_MAPPING=300,Object.defineProperty(n.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(n.prototype,t.prototype,{constructor:n,isTexture:!0,clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){if(void 0!==e.textures[this.uuid])return e.textures[this.uuid];var t={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=xi.generateUUID()),void 0===e.images[r.uuid]){var n,i=e.images,o=r.uuid,a=r.uuid;void 0!==r.toDataURL?n=r:(n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n.width=r.width,n.height=r.height,n.getContext("2d").drawImage(r,0,0,r.width,r.height)),n=2048<n.width||2048<n.height?n.toDataURL("image/jpeg",.6):n.toDataURL("image/png"),i[o]={uuid:a,url:n}}t.image=r.uuid}return e.textures[this.uuid]=t},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(300===this.mapping){if(e.multiply(this.repeat),e.add(this.offset),0>e.x||1<e.x)switch(this.wrapS){case 1e3:e.x-=Math.floor(e.x);break;case 1001:e.x=0>e.x?0:1;break;case 1002:e.x=1===Math.abs(Math.floor(e.x)%2)?Math.ceil(e.x)-e.x:e.x-Math.floor(e.x)}if(0>e.y||1<e.y)switch(this.wrapT){case 1e3:e.y-=Math.floor(e.y);break;case 1001:e.y=0>e.y?0:1;break;case 1002:e.y=1===Math.abs(Math.floor(e.y)%2)?Math.ceil(e.y)-e.y:e.y-Math.floor(e.y)}this.flipY&&(e.y=1-e.y)}}}),Object.assign(i.prototype,{isVector4:!0,set:function(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this},setScalar:function(e){return this.w=this.z=this.y=this.x=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,r=this.y,n=this.z,i=this.w;return e=e.elements,this.x=e[0]*t+e[4]*r+e[8]*n+e[12]*i,this.y=e[1]*t+e[5]*r+e[9]*n+e[13]*i,this.z=e[2]*t+e[6]*r+e[10]*n+e[14]*i,this.w=e[3]*t+e[7]*r+e[11]*n+e[15]*i,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return 1e-4>t?(this.x=1,this.z=this.y=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,r,n,i=(e=e.elements)[0];n=e[4];var o=e[8],a=e[1],s=e[5],u=e[9];r=e[2],t=e[6];var c=e[10];return.01>Math.abs(n-a)&&.01>Math.abs(o-r)&&.01>Math.abs(u-t)?.1>Math.abs(n+a)&&.1>Math.abs(o+r)&&.1>Math.abs(u+t)&&.1>Math.abs(i+s+c-3)?(this.set(1,0,0,0),this):(e=Math.PI,i=(i+1)/2,s=(s+1)/2,c=(c+1)/2,n=(n+a)/4,o=(o+r)/4,u=(u+t)/4,i>s&&i>c?.01>i?(t=0,n=r=.707106781):(t=Math.sqrt(i),r=n/t,n=o/t):s>c?.01>s?(t=.707106781,r=0,n=.707106781):(r=Math.sqrt(s),t=n/r,n=u/r):.01>c?(r=t=.707106781,n=0):(n=Math.sqrt(c),t=o/n,r=u/n),this.set(t,r,n,e),this):(e=Math.sqrt((t-u)*(t-u)+(o-r)*(o-r)+(a-n)*(a-n)),.001>Math.abs(e)&&(e=1),this.x=(t-u)/e,this.y=(o-r)/e,this.z=(a-n)/e,this.w=Math.acos((i+s+c-1)/2),this)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(){var e,t;return function(r,n){return void 0===e&&(e=new i,t=new i),e.set(r,r,r,r),t.set(n,n,n,n),this.clamp(e,t)}}(),clampLength:function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z),this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,r){return this.subVectors(t,e).multiplyScalar(r).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,r){return void 0!==r&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),Object.assign(o.prototype,t.prototype,{isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),a.prototype=Object.create(o.prototype),a.prototype.constructor=a,a.prototype.isWebGLRenderTargetCube=!0,Object.assign(s,{slerp:function(e,t,r,n){return r.copy(e).slerp(t,n)},slerpFlat:function(e,t,r,n,i,o,a){var s=r[n+0],u=r[n+1],c=r[n+2];r=r[n+3],n=i[o+0];var l=i[o+1],h=i[o+2];if(i=i[o+3],r!==i||s!==n||u!==l||c!==h){o=1-a;var p=s*n+u*l+c*h+r*i,f=0<=p?1:-1,d=1-p*p;d>Number.EPSILON&&(d=Math.sqrt(d),p=Math.atan2(d,p*f),o=Math.sin(o*p)/d,a=Math.sin(a*p)/d),s=s*o+n*(f*=a),u=u*o+l*f,c=c*o+h*f,r=r*o+i*f,o===1-a&&(a=1/Math.sqrt(s*s+u*u+c*c+r*r),s*=a,u*=a,c*=a,r*=a)}e[t]=s,e[t+1]=u,e[t+2]=c,e[t+3]=r}}),Object.defineProperties(s.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this.onChangeCallback()}}}),Object.assign(s.prototype,{set:function(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._w=n,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var r=e._x,n=e._y,i=e._z,o=e.order,a=Math.cos,s=Math.sin,u=a(r/2),c=a(n/2),a=a(i/2),r=s(r/2),n=s(n/2),i=s(i/2);return"XYZ"===o?(this._x=r*c*a+u*n*i,this._y=u*n*a-r*c*i,this._z=u*c*i+r*n*a,this._w=u*c*a-r*n*i):"YXZ"===o?(this._x=r*c*a+u*n*i,this._y=u*n*a-r*c*i,this._z=u*c*i-r*n*a,this._w=u*c*a+r*n*i):"ZXY"===o?(this._x=r*c*a-u*n*i,this._y=u*n*a+r*c*i,this._z=u*c*i+r*n*a,this._w=u*c*a-r*n*i):"ZYX"===o?(this._x=r*c*a-u*n*i,this._y=u*n*a+r*c*i,this._z=u*c*i-r*n*a,this._w=u*c*a+r*n*i):"YZX"===o?(this._x=r*c*a+u*n*i,this._y=u*n*a+r*c*i,this._z=u*c*i-r*n*a,this._w=u*c*a-r*n*i):"XZY"===o&&(this._x=r*c*a-u*n*i,this._y=u*n*a-r*c*i,this._z=u*c*i+r*n*a,this._w=u*c*a+r*n*i),!1!==t&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var r=t/2,n=Math.sin(r);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(r),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t=e.elements,r=t[0];e=t[4];var n=t[8],i=t[1],o=t[5],a=t[9],s=t[2],u=t[6],c=r+o+(t=t[10]);return 0<c?(r=.5/Math.sqrt(c+1),this._w=.25/r,this._x=(u-a)*r,this._y=(n-s)*r,this._z=(i-e)*r):r>o&&r>t?(r=2*Math.sqrt(1+r-o-t),this._w=(u-a)/r,this._x=.25*r,this._y=(e+i)/r,this._z=(n+s)/r):o>t?(r=2*Math.sqrt(1+o-r-t),this._w=(n-s)/r,this._x=(e+i)/r,this._y=.25*r,this._z=(a+u)/r):(r=2*Math.sqrt(1+t-r-o),this._w=(i-e)/r,this._x=(n+s)/r,this._y=(a+u)/r,this._z=.25*r),this.onChangeCallback(),this},setFromUnitVectors:function(){var e,t=new u;return function(r,n){return void 0===t&&(t=new u),1e-6>(e=r.dot(n)+1)?(e=0,Math.abs(r.x)>Math.abs(r.z)?t.set(-r.y,r.x,0):t.set(0,-r.z,r.y)):t.crossVectors(r,n),this._x=t.x,this._y=t.y,this._z=t.z,this._w=e,this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._z=this._y=this._x=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this.onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var r=e._x,n=e._y,i=e._z,o=e._w,a=t._x,s=t._y,u=t._z,c=t._w;return this._x=r*c+o*a+n*u-i*s,this._y=n*c+o*s+i*a-r*u,this._z=i*c+o*u+r*s-n*a,this._w=o*c-r*a-n*s-i*u,this.onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var r=this._x,n=this._y,i=this._z,o=this._w;if(0>(s=o*e._w+r*e._x+n*e._y+i*e._z)?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),1<=s)return this._w=o,this._x=r,this._y=n,this._z=i,this;u=Math.sqrt(1-s*s);if(.001>Math.abs(u))return this._w=.5*(o+this._w),this._x=.5*(r+this._x),this._y=.5*(n+this._y),this._z=.5*(i+this._z),this;var a=Math.atan2(u,s),s=Math.sin((1-t)*a)/u,u=Math.sin(t*a)/u;return this._w=o*s+this._w*u,this._x=r*s+this._x*u,this._y=n*s+this._y*u,this._z=i*s+this._z*u,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(u.prototype,{isVector3:!0,set:function(e,t,r){return this.x=e,this.y=t,this.z=r,this},setScalar:function(e){return this.z=this.y=this.x=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(){var e=new s;return function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(e.setFromEuler(t))}}(),applyAxisAngle:function(){var e=new s;return function(t,r){return this.applyQuaternion(e.setFromAxisAngle(t,r))}}(),applyMatrix3:function(e){var t=this.x,r=this.y,n=this.z;return e=e.elements,this.x=e[0]*t+e[3]*r+e[6]*n,this.y=e[1]*t+e[4]*r+e[7]*n,this.z=e[2]*t+e[5]*r+e[8]*n,this},applyMatrix4:function(e){var t=this.x,r=this.y,n=this.z,i=1/((e=e.elements)[3]*t+e[7]*r+e[11]*n+e[15]);return this.x=(e[0]*t+e[4]*r+e[8]*n+e[12])*i,this.y=(e[1]*t+e[5]*r+e[9]*n+e[13])*i,this.z=(e[2]*t+e[6]*r+e[10]*n+e[14])*i,this},applyQuaternion:function(e){var t=this.x,r=this.y,n=this.z,i=e.x,o=e.y,a=e.z,s=(e=e.w)*t+o*n-a*r,u=e*r+a*t-i*n,c=e*n+i*r-o*t,t=-i*t-o*r-a*n;return this.x=s*e+t*-i+u*-a-c*-o,this.y=u*e+t*-o+c*-i-s*-a,this.z=c*e+t*-a+s*-o-u*-i,this},project:function(){var e=new c;return function(t){return e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyMatrix4(e)}}(),unproject:function(){var e=new c;return function(t){return e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyMatrix4(e)}}(),transformDirection:function(e){var t=this.x,r=this.y,n=this.z;return e=e.elements,this.x=e[0]*t+e[4]*r+e[8]*n,this.y=e[1]*t+e[5]*r+e[9]*n,this.z=e[2]*t+e[6]*r+e[10]*n,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(){var e=new u,t=new u;return function(r,n){return e.set(r,r,r),t.set(n,n,n),this.clamp(e,t)}}(),clampLength:function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,r){return this.subVectors(t,e).multiplyScalar(r).add(e)},cross:function(e,t){if(void 0!==t)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t);var r=this.x,n=this.y,i=this.z;return this.x=n*e.z-i*e.y,this.y=i*e.x-r*e.z,this.z=r*e.y-n*e.x,this},crossVectors:function(e,t){var r=e.x,n=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=n*s-i*a,this.y=i*o-r*s,this.z=r*a-n*o,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(){var e=new u;return function(t){return e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e=new u;return function(t){return this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){return e=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq()),Math.acos(xi.clamp(e,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,r=this.y-e.y;return e=this.z-e.z,t*t+r*r+e*e},distanceToManhattan:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){var t=Math.sin(e.phi)*e.radius;return this.x=t*Math.sin(e.theta),this.y=Math.cos(e.phi)*e.radius,this.z=t*Math.cos(e.theta),this},setFromCylindrical:function(e){return this.x=e.radius*Math.sin(e.theta),this.y=e.y,this.z=e.radius*Math.cos(e.theta),this},setFromMatrixPosition:function(e){return e=e.elements,this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length();return e=this.setFromMatrixColumn(e,2).length(),this.x=t,this.y=r,this.z=e,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,r){return void 0!==r&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}}),Object.assign(c.prototype,{isMatrix4:!0,set:function(e,t,r,n,i,o,a,s,u,c,l,h,p,f,d,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=r,v[12]=n,v[1]=i,v[5]=o,v[9]=a,v[13]=s,v[2]=u,v[6]=c,v[10]=l,v[14]=h,v[3]=p,v[7]=f,v[11]=d,v[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new c).fromArray(this.elements)},copy:function(e){var t=this.elements;return e=e.elements,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],this},copyPosition:function(e){var t=this.elements;return e=e.elements,t[12]=e[12],t[13]=e[13],t[14]=e[14],this},extractBasis:function(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this},extractRotation:function(){var e=new u;return function(t){var r=this.elements,n=t.elements,i=1/e.setFromMatrixColumn(t,0).length(),o=1/e.setFromMatrixColumn(t,1).length();return t=1/e.setFromMatrixColumn(t,2).length(),r[0]=n[0]*i,r[1]=n[1]*i,r[2]=n[2]*i,r[4]=n[4]*o,r[5]=n[5]*o,r[6]=n[6]*o,r[8]=n[8]*t,r[9]=n[9]*t,r[10]=n[10]*t,this}}(),makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,r=e.x,n=e.y,i=e.z,o=Math.cos(r),r=Math.sin(r),a=Math.cos(n),n=Math.sin(n),s=Math.cos(i),i=Math.sin(i);if("XYZ"===e.order){e=o*s;var u=o*i,c=r*s,l=r*i;t[0]=a*s,t[4]=-a*i,t[8]=n,t[1]=u+c*n,t[5]=e-l*n,t[9]=-r*a,t[2]=l-e*n,t[6]=c+u*n,t[10]=o*a}else"YXZ"===e.order?(e=a*s,u=a*i,c=n*s,l=n*i,t[0]=e+l*r,t[4]=c*r-u,t[8]=o*n,t[1]=o*i,t[5]=o*s,t[9]=-r,t[2]=u*r-c,t[6]=l+e*r,t[10]=o*a):"ZXY"===e.order?(e=a*s,u=a*i,c=n*s,l=n*i,t[0]=e-l*r,t[4]=-o*i,t[8]=c+u*r,t[1]=u+c*r,t[5]=o*s,t[9]=l-e*r,t[2]=-o*n,t[6]=r,t[10]=o*a):"ZYX"===e.order?(e=o*s,u=o*i,c=r*s,l=r*i,t[0]=a*s,t[4]=c*n-u,t[8]=e*n+l,t[1]=a*i,t[5]=l*n+e,t[9]=u*n-c,t[2]=-n,t[6]=r*a,t[10]=o*a):"YZX"===e.order?(e=o*a,u=o*n,c=r*a,l=r*n,t[0]=a*s,t[4]=l-e*i,t[8]=c*i+u,t[1]=i,t[5]=o*s,t[9]=-r*s,t[2]=-n*s,t[6]=u*i+c,t[10]=e-l*i):"XZY"===e.order&&(e=o*a,u=o*n,c=r*a,l=r*n,t[0]=a*s,t[4]=-i,t[8]=n*s,t[1]=e*i+l,t[5]=o*s,t[9]=u*i-c,t[2]=c*i-u,t[6]=r*s,t[10]=l*i+e);return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){var t=this.elements,r=e._x,n=e._y,i=e._z,o=e._w,a=i+i;e=r*(c=r+r);var s=r*(l=n+n),r=r*a,u=n*l,n=n*a,i=i*a,c=o*c,l=o*l,o=o*a;return t[0]=1-(u+i),t[4]=s-o,t[8]=r+l,t[1]=s+o,t[5]=1-(e+i),t[9]=n-c,t[2]=r-l,t[6]=n+c,t[10]=1-(e+u),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:function(){var e=new u,t=new u,r=new u;return function(n,i,o){var a=this.elements;return r.subVectors(n,i),0===r.lengthSq()&&(r.z=1),r.normalize(),e.crossVectors(o,r),0===e.lengthSq()&&(1===Math.abs(o.z)?r.x+=1e-4:r.z+=1e-4,r.normalize(),e.crossVectors(o,r)),e.normalize(),t.crossVectors(r,e),a[0]=e.x,a[4]=t.x,a[8]=r.x,a[1]=e.y,a[5]=t.y,a[9]=r.y,a[2]=e.z,a[6]=t.z,a[10]=r.z,this}}(),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var r=e.elements,n=t.elements,i=this.elements,o=r[0],a=r[4],s=r[8],u=r[12],c=r[1],l=r[5],h=r[9],p=r[13],f=r[2],d=r[6],m=r[10],v=r[14],y=r[3],g=r[7],b=r[11],r=r[15],_=n[0],x=n[4],w=n[8],S=n[12],T=n[1],E=n[5],O=n[9],M=n[13],C=n[2],j=n[6],P=n[10],A=n[14],N=n[3],L=n[7],I=n[11],n=n[15];return i[0]=o*_+a*T+s*C+u*N,i[4]=o*x+a*E+s*j+u*L,i[8]=o*w+a*O+s*P+u*I,i[12]=o*S+a*M+s*A+u*n,i[1]=c*_+l*T+h*C+p*N,i[5]=c*x+l*E+h*j+p*L,i[9]=c*w+l*O+h*P+p*I,i[13]=c*S+l*M+h*A+p*n,i[2]=f*_+d*T+m*C+v*N,i[6]=f*x+d*E+m*j+v*L,i[10]=f*w+d*O+m*P+v*I,i[14]=f*S+d*M+m*A+v*n,i[3]=y*_+g*T+b*C+r*N,i[7]=y*x+g*E+b*j+r*L,i[11]=y*w+g*O+b*P+r*I,i[15]=y*S+g*M+b*A+r*n,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},applyToBufferAttribute:function(){var e=new u;return function(t){for(var r=0,n=t.count;r<n;r++)e.x=t.getX(r),e.y=t.getY(r),e.z=t.getZ(r),e.applyMatrix4(this),t.setXYZ(r,e.x,e.y,e.z);return t}}(),determinant:function(){var e=this.elements,t=e[0],r=e[4],n=e[8],i=e[12],o=e[1],a=e[5],s=e[9],u=e[13],c=e[2],l=e[6],h=e[10],p=e[14];return e[3]*(+i*s*l-n*u*l-i*a*h+r*u*h+n*a*p-r*s*p)+e[7]*(+t*s*p-t*u*h+i*o*h-n*o*p+n*u*c-i*s*c)+e[11]*(+t*u*l-t*a*p-i*o*l+r*o*p+i*a*c-r*u*c)+e[15]*(-n*a*c-t*s*l+t*a*h+n*o*l-r*o*h+r*s*c)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var r=this.elements,n=e.elements,i=n[0],o=n[1],a=n[2],s=n[3],u=n[4],c=n[5],l=n[6],h=n[7],p=n[8],f=n[9],d=n[10],m=n[11],v=n[12],y=n[13],g=n[14],b=f*g*h-y*d*h+y*l*m-c*g*m-f*l*(n=n[15])+c*d*n,_=v*d*h-p*g*h-v*l*m+u*g*m+p*l*n-u*d*n,x=p*y*h-v*f*h+v*c*m-u*y*m-p*c*n+u*f*n,w=v*f*l-p*y*l-v*c*d+u*y*d+p*c*g-u*f*g,S=i*b+o*_+a*x+s*w;if(0===S){if(!0===t)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");return console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"),this.identity()}return S=1/S,r[0]=b*S,r[1]=(y*d*s-f*g*s-y*a*m+o*g*m+f*a*n-o*d*n)*S,r[2]=(c*g*s-y*l*s+y*a*h-o*g*h-c*a*n+o*l*n)*S,r[3]=(f*l*s-c*d*s-f*a*h+o*d*h+c*a*m-o*l*m)*S,r[4]=_*S,r[5]=(p*g*s-v*d*s+v*a*m-i*g*m-p*a*n+i*d*n)*S,r[6]=(v*l*s-u*g*s-v*a*h+i*g*h+u*a*n-i*l*n)*S,r[7]=(u*d*s-p*l*s+p*a*h-i*d*h-u*a*m+i*l*m)*S,r[8]=x*S,r[9]=(v*f*s-p*y*s-v*o*m+i*y*m+p*o*n-i*f*n)*S,r[10]=(u*y*s-v*c*s+v*o*h-i*y*h-u*o*n+i*c*n)*S,r[11]=(p*c*s-u*f*s-p*o*h+i*f*h+u*o*m-i*c*m)*S,r[12]=w*S,r[13]=(p*y*a-v*f*a+v*o*d-i*y*d-p*o*g+i*f*g)*S,r[14]=(v*c*a-u*y*a-v*o*l+i*y*l+u*o*g-i*c*g)*S,r[15]=(u*f*a-p*c*a+p*o*l-i*f*l-u*o*d+i*c*d)*S,this},scale:function(e){var t=this.elements,r=e.x,n=e.y;return e=e.z,t[0]*=r,t[4]*=n,t[8]*=e,t[1]*=r,t[5]*=n,t[9]*=e,t[2]*=r,t[6]*=n,t[10]*=e,t[3]*=r,t[7]*=n,t[11]*=e,this},getMaxScaleOnAxis:function(){var e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))},makeTranslation:function(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e);return e=Math.sin(e),this.set(1,0,0,0,0,t,-e,0,0,e,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e);return e=Math.sin(e),this.set(t,0,e,0,0,1,0,0,-e,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e);return e=Math.sin(e),this.set(t,-e,0,0,e,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var r=Math.cos(t),n=Math.sin(t),i=1-r,o=e.x,a=e.y,s=e.z,u=i*o,c=i*a;return this.set(u*o+r,u*a-n*s,u*s+n*a,0,u*a+n*s,c*a+r,c*s-n*o,0,u*s-n*a,c*s+n*o,i*s*s+r,0,0,0,0,1),this},makeScale:function(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this},makeShear:function(e,t,r){return this.set(1,t,r,0,e,1,r,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,r){return this.makeRotationFromQuaternion(t),this.scale(r),this.setPosition(e),this},decompose:function(){var e=new u,t=new c;return function(r,n,i){var o=this.elements,a=e.set(o[0],o[1],o[2]).length(),s=e.set(o[4],o[5],o[6]).length(),u=e.set(o[8],o[9],o[10]).length();0>this.determinant()&&(a=-a),r.x=o[12],r.y=o[13],r.z=o[14],t.copy(this),r=1/a;var o=1/s,c=1/u;return t.elements[0]*=r,t.elements[1]*=r,t.elements[2]*=r,t.elements[4]*=o,t.elements[5]*=o,t.elements[6]*=o,t.elements[8]*=c,t.elements[9]*=c,t.elements[10]*=c,n.setFromRotationMatrix(t),i.x=a,i.y=s,i.z=u,this}}(),makePerspective:function(e,t,r,n,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements;return a[0]=2*i/(t-e),a[4]=0,a[8]=(t+e)/(t-e),a[12]=0,a[1]=0,a[5]=2*i/(r-n),a[9]=(r+n)/(r-n),a[13]=0,a[2]=0,a[6]=0,a[10]=-(o+i)/(o-i),a[14]=-2*o*i/(o-i),a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(e,t,r,n,i,o){var a=this.elements,s=1/(t-e),u=1/(r-n),c=1/(o-i);return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-(t+e)*s,a[1]=0,a[5]=2*u,a[9]=0,a[13]=-(r+n)*u,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-(o+i)*c,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(e){var t=this.elements;e=e.elements;for(var r=0;16>r;r++)if(t[r]!==e[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var r=0;16>r;r++)this.elements[r]=e[r+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}),l.prototype=Object.create(n.prototype),l.prototype.constructor=l,l.prototype.isDataTexture=!0,(h.prototype=Object.create(n.prototype)).constructor=h,h.prototype.isCubeTexture=!0,Object.defineProperty(h.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});var Si=new n,Ti=new h,Ei=[],Oi=[],Mi=new Float32Array(16),Ci=new Float32Array(9);U.prototype.setValue=function(e,t){for(var r=this.seq,n=0,i=r.length;n!==i;++n){var o=r[n];o.setValue(e,t[o.id])}};var ji=/([\w\d_]+)(\])?(\[|\.)?/g;G.prototype.setValue=function(e,t,r){void 0!==(t=this.map[t])&&t.setValue(e,r,this.renderer)},G.prototype.setOptional=function(e,t,r){void 0!==(t=t[r])&&this.setValue(e,r,t)},G.upload=function(e,t,r,n){for(var i=0,o=t.length;i!==o;++i){var a=t[i],s=r[a.id];!1!==s.needsUpdate&&a.setValue(e,s.value,n)}},G.seqWithValue=function(e,t){for(var r=[],n=0,i=e.length;n!==i;++n){var o=e[n];o.id in t&&r.push(o)}return r};var Pi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Object.assign(z.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.b=this.g=this.r=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,r){return this.r=e,this.g=t,this.b=r,this},setHSL:function(){function e(e,t,r){return 0>r&&(r+=1),1<r&&--r,r<1/6?e+6*(t-e)*r:.5>r?t:r<2/3?e+6*(t-e)*(2/3-r):e}return function(t,r,n){return t=xi.euclideanModulo(t,1),r=xi.clamp(r,0,1),n=xi.clamp(n,0,1),0===r?this.r=this.g=this.b=n:(r=.5>=n?n*(1+r):n+r-n*r,n=2*n-r,this.r=e(n,r,t+1/3),this.g=e(n,r,t),this.b=e(n,r,t-1/3)),this}}(),setStyle:function(e){function t(t){void 0!==t&&1>parseFloat(t)&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var r;if(r=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){n=r[2];switch(r[1]){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(n))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(n))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(n)){var n=parseFloat(r[1])/360,i=parseInt(r[2],10)/100,o=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(n,i,o)}}}else if(r=/^\#([A-Fa-f0-9]+)$/.exec(e)){if(r=r[1],3===(n=r.length))return this.r=parseInt(r.charAt(0)+r.charAt(0),16)/255,this.g=parseInt(r.charAt(1)+r.charAt(1),16)/255,this.b=parseInt(r.charAt(2)+r.charAt(2),16)/255,this;if(6===n)return this.r=parseInt(r.charAt(0)+r.charAt(1),16)/255,this.g=parseInt(r.charAt(2)+r.charAt(3),16)/255,this.b=parseInt(r.charAt(4)+r.charAt(5),16)/255,this}return e&&0<e.length&&(void 0!==(r=Pi[e])?this.setHex(r):console.warn("THREE.Color: Unknown color "+e)),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var r=0<t?1/t:1;return this.r=Math.pow(e.r,r),this.g=Math.pow(e.g,r),this.b=Math.pow(e.b,r),this},convertGammaToLinear:function(){var e=this.r,t=this.g,r=this.b;return this.r=e*e,this.g=t*t,this.b=r*r,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){e=e||{h:0,s:0,l:0};var t,r=this.r,n=this.g,i=this.b,o=Math.max(r,n,i),a=((u=Math.min(r,n,i))+o)/2;if(u===o)u=t=0;else{var s=o-u,u=.5>=a?s/(o+u):s/(2-o-u);switch(o){case r:t=(n-i)/s+(n<i?6:0);break;case n:t=(i-r)/s+2;break;case i:t=(r-n)/s+4}t/=6}return e.h=t,e.s=u,e.l=a,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,r){var n=this.getHSL();return n.h+=e,n.s+=t,n.l+=r,this.setHSL(n.h,n.s,n.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}});var Ai={common:{diffuse:{value:new z(15658734)},opacity:{value:1},map:{value:null},offsetRepeat:{value:new i(0,0,1,1)},specularMap:{value:null},alphaMap:{value:null},envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new r(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new z(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new z(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},offsetRepeat:{value:new i(0,0,1,1)}}},Ni={merge:function(e){for(var t={},r=0;r<e.length;r++){var n,i=this.clone(e[r]);for(n in i)t[n]=i[n]}return t},clone:function(e){var t,r={};for(t in e){r[t]={};for(var n in e[t]){var i=e[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?r[t][n]=i.clone():Array.isArray(i)?r[t][n]=i.slice():r[t][n]=i}}return r}},Li={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n",bsdfs:"float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t}\n\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_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}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * 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 theta = acos( dot( N, V ) );\n\tvec2 uv = vec2(\n\t\tsqrt( saturate( roughness ) ),\n\t\tsaturate( theta / ( 0.5 * PI ) ) );\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.86267 + (0.49788 + 0.01436 * y ) * y;\n\tfloat b = 3.45068 + (4.18814 + y) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = (x > 0.0) ? v : 0.5 * inversesqrt( 1.0 - x * x ) - 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 * transpose( 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\tvec3 result = vec3( LTC_ClippedSphereFormFactor( vectorFormFactor ) );\n\treturn result;\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.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 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat 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_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\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 );\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",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\t\tvec4 plane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float 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 average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\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}\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};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\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}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transpose( const in mat3 v ) {\n\tmat3 tmp;\n\ttmp[0] = vec3(v[0].x, v[1].x, v[2].x);\n\ttmp[1] = vec3(v[0].y, v[1].y, v[2].y);\n\ttmp[2] = vec3(v[0].z, v[1].z, v[2].z);\n\treturn tmp;\n}\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( 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.w );\n}\nvec4 LinearTosRGB( 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.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract(Le);\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max(vRGB, 0.0), 1.0 );\n}\n",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, 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, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = asin( flipNormal * reflectVec.y ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\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",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\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",fog_vertex:"\n#ifdef USE_FOG\nfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float fogDepth;\n#endif\n",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\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",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",lights_pars:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.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\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.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\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.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 ltcMat;\tuniform sampler2D ltcMag;\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 GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\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.specularRoughness;\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\tfloat norm = texture2D( ltcMag, uv ).a;\n\t\tvec4 t = texture2D( ltcMat, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( 1, 0, t.y ),\n\t\t\tvec3( 0, t.z, 0 ),\n\t\t\tvec3( t.w, 0, t.x )\n\t\t);\n\t\treflectedLight.directSpecular += lightColor * material.specularColor * norm * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\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\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\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",lights_template:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",logdepthbuf_fragment:"#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",map_particle_fragment:"#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",normal_flip:"#ifdef DOUBLE_SIDED\n\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n#else\n\tfloat flipNormal = 1.0;\n#endif\n",normal_fragment:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal ) * flipNormal;\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 1.0 - 2.0 * rgb.xyz;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\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 linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( 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 invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n",dithering_pars_fragment:"#if defined( 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",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, 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\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\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\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( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, 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( 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 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\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\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\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 shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",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",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#endif\n",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",tonemapping_pars_fragment:"#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( 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}\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif\n",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",cube_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\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 <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",depth_vert:"#include <common>\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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_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}\n",distanceRGBA_frag:"uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\n#include <packing>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n",distanceRGBA_vert:"varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition;\n}\n",equirect_frag:"uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n",equirect_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}\n",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\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 <normal_flip>\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_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 <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\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 <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}\n",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <normal_flip>\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <fog_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 <uv2_vertex>\n\t#include <color_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 <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 <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <specularmap_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_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 <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_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#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#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\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",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_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 <uv2_vertex>\n\t#include <color_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#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#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\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\n",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\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>\nvoid main() {\n\t#include <uv_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#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#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#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",shadow_frag:"uniform float opacity;\n#include <common>\n#include <packing>\n#include <bsdfs>\n#include <lights_pars>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0 - getShadowMask() ) );\n}\n",shadow_vert:"#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n"},Ii={basic:{uniforms:Ni.merge([Ai.common,Ai.aomap,Ai.lightmap,Ai.fog]),vertexShader:Li.meshbasic_vert,fragmentShader:Li.meshbasic_frag},lambert:{uniforms:Ni.merge([Ai.common,Ai.aomap,Ai.lightmap,Ai.emissivemap,Ai.fog,Ai.lights,{emissive:{value:new z(0)}}]),vertexShader:Li.meshlambert_vert,fragmentShader:Li.meshlambert_frag},phong:{uniforms:Ni.merge([Ai.common,Ai.aomap,Ai.lightmap,Ai.emissivemap,Ai.bumpmap,Ai.normalmap,Ai.displacementmap,Ai.gradientmap,Ai.fog,Ai.lights,{emissive:{value:new z(0)},specular:{value:new z(1118481)},shininess:{value:30}}]),vertexShader:Li.meshphong_vert,fragmentShader:Li.meshphong_frag},standard:{uniforms:Ni.merge([Ai.common,Ai.aomap,Ai.lightmap,Ai.emissivemap,Ai.bumpmap,Ai.normalmap,Ai.displacementmap,Ai.roughnessmap,Ai.metalnessmap,Ai.fog,Ai.lights,{emissive:{value:new z(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Li.meshphysical_vert,fragmentShader:Li.meshphysical_frag},points:{uniforms:Ni.merge([Ai.points,Ai.fog]),vertexShader:Li.points_vert,fragmentShader:Li.points_frag},dashed:{uniforms:Ni.merge([Ai.common,Ai.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Li.linedashed_vert,fragmentShader:Li.linedashed_frag},depth:{uniforms:Ni.merge([Ai.common,Ai.displacementmap]),vertexShader:Li.depth_vert,fragmentShader:Li.depth_frag},normal:{uniforms:Ni.merge([Ai.common,Ai.bumpmap,Ai.normalmap,Ai.displacementmap,{opacity:{value:1}}]),vertexShader:Li.normal_vert,fragmentShader:Li.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Li.cube_vert,fragmentShader:Li.cube_frag},equirect:{uniforms:{tEquirect:{value:null},tFlip:{value:-1}},vertexShader:Li.equirect_vert,fragmentShader:Li.equirect_frag},distanceRGBA:{uniforms:{lightPos:{value:new u}},vertexShader:Li.distanceRGBA_vert,fragmentShader:Li.distanceRGBA_frag}};Ii.physical={uniforms:Ni.merge([Ii.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:Li.meshphysical_vert,fragmentShader:Li.meshphysical_frag},Object.assign(q.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new r;return function(t,r){var n=e.copy(r).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){return e=e||new r,this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return e=e||new r,this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return(t||new r).set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return(t||new r).copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new r;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var Ri=0;Object.assign(W.prototype,t.prototype,{isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var r=e[t];if(void 0===r)console.warn("THREE.Material: '"+t+"' parameter is undefined.");else{var n=this[t];void 0===n?console.warn("THREE."+this.type+": '"+t+"' is not a property of this material."):n&&n.isColor?n.set(r):n&&n.isVector3&&r&&r.isVector3?n.copy(r):this[t]="overdraw"===t?Number(r):r}}},toJSON:function(e){function t(e){var t,r=[];for(t in e){var n=e[t];delete n.metadata,r.push(n)}return r}var r=void 0===e;r&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};return n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),2!==this.shading&&(n.shading=this.shading),0!==this.side&&(n.side=this.side),0!==this.vertexColors&&(n.vertexColors=this.vertexColors),1>this.opacity&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,0<this.alphaTest&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),1<this.wireframeLinewidth&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),n.skinning=this.skinning,n.morphTargets=this.morphTargets,n.dithering=this.dithering,r&&(r=t(e.textures),e=t(e.images),0<r.length&&(n.textures=r),0<e.length&&(n.images=e)),n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.lights=e.lights,this.blending=e.blending,this.side=e.side,this.shading=e.shading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.overdraw=e.overdraw,this.visible=e.visible,this.clipShadows=e.clipShadows,this.clipIntersection=e.clipIntersection;r=null;if(null!==(e=e.clippingPlanes))for(var t=e.length,r=Array(t),n=0;n!==t;++n)r[n]=e[n].clone();return this.clippingPlanes=r,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Q.prototype=Object.create(W.prototype),Q.prototype.constructor=Q,Q.prototype.isShaderMaterial=!0,Q.prototype.copy=function(e){return W.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Ni.clone(e.uniforms),this.defines=e.defines,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},Q.prototype.toJSON=function(e){return e=W.prototype.toJSON.call(this,e),e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e},K.prototype=Object.create(W.prototype),K.prototype.constructor=K,K.prototype.isMeshDepthMaterial=!0,K.prototype.copy=function(e){return W.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},Object.assign(X.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=e.length;s<u;s+=3){var c=e[s],l=e[s+1],h=e[s+2];c<t&&(t=c),l<r&&(r=l),h<n&&(n=h),c>i&&(i=c),l>o&&(o=l),h>a&&(a=h)}return this.min.set(t,r,n),this.max.set(i,o,a),this},setFromBufferAttribute:function(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=e.count;s<u;s++){var c=e.getX(s),l=e.getY(s),h=e.getZ(s);c<t&&(t=c),l<r&&(r=l),h<n&&(n=h),c>i&&(i=c),l>o&&(o=l),h>a&&(a=h)}return this.min.set(t,r,n),this.max.set(i,o,a),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new u;return function(t,r){var n=e.copy(r).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}}(),setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){return e=e||new u,this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return e=e||new u,this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(){var e=new u;return function(t){var r=this;return t.updateMatrixWorld(!0),t.traverse(function(t){var n,i;if(void 0!==(n=t.geometry))if(n.isGeometry){var o=n.vertices;for(n=0,i=o.length;n<i;n++)e.copy(o[n]),e.applyMatrix4(t.matrixWorld),r.expandByPoint(e)}else if(n.isBufferGeometry&&void 0!==(o=n.attributes.position))for(n=0,i=o.count;n<i;n++)e.fromBufferAttribute(o,n).applyMatrix4(t.matrixWorld),r.expandByPoint(e)}),this}}(),containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return(t||new u).set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:function(){var e=new u;return function(t){return this.clampPoint(t.center,e),e.distanceToSquared(t.center)<=t.radius*t.radius}}(),intersectsPlane:function(e){var t,r;return 0<e.normal.x?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),0<e.normal.y?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),0<e.normal.z?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=e.constant&&r>=e.constant},clampPoint:function(e,t){return(t||new u).copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new u;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),getBoundingSphere:function(){var e=new u;return function(t){return t=t||new Y,this.getCenter(t.center),t.radius=.5*this.getSize(e).length(),t}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(){var e=[new u,new u,new u,new u,new u,new u,new u,new u];return function(t){return this.isEmpty()?this:(e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(e),this)}}(),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Object.assign(Y.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(){var e=new X;return function(t,r){var n=this.center;void 0!==r?n.copy(r):e.setFromPoints(t).getCenter(n);for(var i=0,o=0,a=t.length;o<a;o++)i=Math.max(i,n.distanceToSquared(t[o]));return this.radius=Math.sqrt(i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return 0>=this.radius},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(this.center.dot(e.normal)-e.constant)<=this.radius},clampPoint:function(e,t){var r=this.center.distanceToSquared(e),n=t||new u;return n.copy(e),r>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n},getBoundingBox:function(e){return(e=e||new X).set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}),Object.assign(Z.prototype,{isMatrix3:!0,set:function(e,t,r,n,i,o,a,s,u){var c=this.elements;return c[0]=e,c[1]=n,c[2]=a,c[3]=t,c[4]=i,c[5]=s,c[6]=r,c[7]=o,c[8]=u,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=this.elements;return e=e.elements,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],this},setFromMatrix4:function(e){return e=e.elements,this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:function(){var e=new u;return function(t){for(var r=0,n=t.count;r<n;r++)e.x=t.getX(r),e.y=t.getY(r),e.z=t.getZ(r),e.applyMatrix3(this),t.setXYZ(r,e.x,e.y,e.z);return t}}(),multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var r=e.elements,n=t.elements,i=this.elements,o=r[0],a=r[3],s=r[6],u=r[1],c=r[4],l=r[7],h=r[2],p=r[5],r=r[8],f=n[0],d=n[3],m=n[6],v=n[1],y=n[4],g=n[7],b=n[2],_=n[5],n=n[8];return i[0]=o*f+a*v+s*b,i[3]=o*d+a*y+s*_,i[6]=o*m+a*g+s*n,i[1]=u*f+c*v+l*b,i[4]=u*d+c*y+l*_,i[7]=u*m+c*g+l*n,i[2]=h*f+p*v+r*b,i[5]=h*d+p*y+r*_,i[8]=h*m+p*g+r*n,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7];return t*o*(e=e[8])-t*a*u-r*i*e+r*a*s+n*i*u-n*o*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");var r=e.elements,n=this.elements,i=r[0],o=r[1],a=r[2],s=r[3],u=r[4],c=r[5],l=r[6],h=r[7],p=(r=r[8])*u-c*h,f=c*l-r*s,d=h*s-u*l,m=i*p+o*f+a*d;if(0===m){if(!0===t)throw Error("THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0");return console.warn("THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0"),this.identity()}return m=1/m,n[0]=p*m,n[1]=(a*h-r*o)*m,n[2]=(c*o-a*u)*m,n[3]=f*m,n[4]=(r*i-a*l)*m,n[5]=(a*s-c*i)*m,n[6]=d*m,n[7]=(o*l-h*i)*m,n[8]=(u*i-o*s)*m,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},equals:function(e){var t=this.elements;e=e.elements;for(var r=0;9>r;r++)if(t[r]!==e[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var r=0;9>r;r++)this.elements[r]=e[r+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}}),Object.assign(J.prototype,{set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,r,n){return this.normal.set(e,t,r),this.constant=n,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new u,t=new u;return function(r,n,i){return n=e.subVectors(i,n).cross(t.subVectors(r,n)).normalize(),this.setFromNormalAndCoplanarPoint(n,r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return this.orthoPoint(e,t).sub(e).negate()},orthoPoint:function(e,t){var r=this.distanceToPoint(e);return(t||new u).copy(this.normal).multiplyScalar(r)},intersectLine:function(){var e=new u;return function(t,r){var n=r||new u,i=t.delta(e),o=this.normal.dot(i);return 0!==o?0>(o=-(t.start.dot(this.normal)+this.constant)/o)||1<o?void 0:n.copy(i).multiplyScalar(o).add(t.start):0===this.distanceToPoint(t.start)?n.copy(t.start):void 0}}(),intersectsLine:function(e){var t=this.distanceToPoint(e.start);return e=this.distanceToPoint(e.end),0>t&&0<e||0>e&&0<t},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return(e||new u).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new u,t=new Z;return function(r,n){var i=this.coplanarPoint(e).applyMatrix4(r),o=n||t.getNormalMatrix(r),o=this.normal.applyMatrix3(o).normalize();return this.constant=-i.dot(o),this}}(),translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}),Object.assign(ee.prototype,{set:function(e,t,r,n,i,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(r),a[3].copy(n),a[4].copy(i),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,r=0;6>r;r++)t[r].copy(e.planes[r]);return this},setFromMatrix:function(e){var t=this.planes;e=(v=e.elements)[0];var r=v[1],n=v[2],i=v[3],o=v[4],a=v[5],s=v[6],u=v[7],c=v[8],l=v[9],h=v[10],p=v[11],f=v[12],d=v[13],m=v[14],v=v[15];return t[0].setComponents(i-e,u-o,p-c,v-f).normalize(),t[1].setComponents(i+e,u+o,p+c,v+f).normalize(),t[2].setComponents(i+r,u+a,p+l,v+d).normalize(),t[3].setComponents(i-r,u-a,p-l,v-d).normalize(),t[4].setComponents(i-n,u-s,p-h,v-m).normalize(),t[5].setComponents(i+n,u+s,p+h,v+m).normalize(),this},intersectsObject:function(){var e=new Y;return function(t){var r=t.geometry;return null===r.boundingSphere&&r.computeBoundingSphere(),e.copy(r.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSprite:function(){var e=new Y;return function(t){return e.center.set(0,0,0),e.radius=.7071067811865476,e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){var t=this.planes,r=e.center;e=-e.radius;for(var n=0;6>n;n++)if(t[n].distanceToPoint(r)<e)return!1;return!0},intersectsBox:function(){var e=new u,t=new u;return function(r){for(var n=this.planes,i=0;6>i;i++){a=n[i];e.x=0<a.normal.x?r.min.x:r.max.x,t.x=0<a.normal.x?r.max.x:r.min.x,e.y=0<a.normal.y?r.min.y:r.max.y,t.y=0<a.normal.y?r.max.y:r.min.y,e.z=0<a.normal.z?r.min.z:r.max.z,t.z=0<a.normal.z?r.max.z:r.min.z;var o=a.distanceToPoint(e),a=a.distanceToPoint(t);if(0>o&&0>a)return!1}return!0}}(),containsPoint:function(e){for(var t=this.planes,r=0;6>r;r++)if(0>t[r].distanceToPoint(e))return!1;return!0}}),ne.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" "),ne.DefaultOrder="XYZ",Object.defineProperties(ne.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this.onChangeCallback()}}}),Object.assign(ne.prototype,{isEuler:!0,set:function(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._order=n||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,r){var n=xi.clamp;e=(h=e.elements)[0];var i=h[4],o=h[8],a=h[1],s=h[5],u=h[9],c=h[2],l=h[6],h=h[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(n(o,-1,1)),.99999>Math.abs(o)?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-i,e)):(this._x=Math.atan2(l,s),this._z=0)):"YXZ"===t?(this._x=Math.asin(-n(u,-1,1)),.99999>Math.abs(u)?(this._y=Math.atan2(o,h),this._z=Math.atan2(a,s)):(this._y=Math.atan2(-c,e),this._z=0)):"ZXY"===t?(this._x=Math.asin(n(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(-c,h),this._z=Math.atan2(-i,s)):(this._y=0,this._z=Math.atan2(a,e))):"ZYX"===t?(this._y=Math.asin(-n(c,-1,1)),.99999>Math.abs(c)?(this._x=Math.atan2(l,h),this._z=Math.atan2(a,e)):(this._x=0,this._z=Math.atan2(-i,s))):"YZX"===t?(this._z=Math.asin(n(a,-1,1)),.99999>Math.abs(a)?(this._x=Math.atan2(-u,s),this._y=Math.atan2(-c,e)):(this._x=0,this._y=Math.atan2(o,h))):"XZY"===t?(this._z=Math.asin(-n(i,-1,1)),.99999>Math.abs(i)?(this._x=Math.atan2(l,s),this._y=Math.atan2(o,e)):(this._x=Math.atan2(-u,h),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==r&&this.onChangeCallback(),this},setFromQuaternion:function(){var e=new c;return function(t,r,n){return e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,r,n)}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(){var e=new s;return function(t){return e.setFromEuler(this),this.setFromQuaternion(e,t)}}(),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new u(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(ie.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask=this.mask|1<<e|0},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},test:function(e){return 0!=(this.mask&e.mask)}});var ki=0;oe.DefaultUp=new u(0,1,0),oe.DefaultMatrixAutoUpdate=!0,Object.assign(oe.prototype,t.prototype,{isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(e){this.matrix.multiplyMatrices(e,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(){var e=new s;return function(t,r){return e.setFromAxisAngle(t,r),this.quaternion.multiply(e),this}}(),rotateX:function(){var e=new u(1,0,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateY:function(){var e=new u(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new u(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new u;return function(t,r){return e.copy(t).applyQuaternion(this.quaternion),this.position.add(e.multiplyScalar(r)),this}}(),translateX:function(){var e=new u(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new u(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new u(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var e=new c;return function(t){return t.applyMatrix4(e.getInverse(this.matrixWorld))}}(),lookAt:function(){var e=new c;return function(t){this.isCamera?e.lookAt(this.position,t,this.up):e.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(e)}}(),add:function(e){if(1<arguments.length){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,e.dispatchEvent({type:"added"}),this.children.push(e)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(1<arguments.length){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}return-1!==(t=this.children.indexOf(e))&&(e.parent=null,e.dispatchEvent({type:"removed"}),this.children.splice(t,1)),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var r=0,n=this.children.length;r<n;r++){var i=this.children[r].getObjectByProperty(e,t);if(void 0!==i)return i}},getWorldPosition:function(e){return e=e||new u,this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var e=new u,t=new u;return function(r){return r=r||new s,this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,r,t),r}}(),getWorldRotation:function(){var e=new s;return function(t){return t=t||new ne,this.getWorldQuaternion(e),t.setFromQuaternion(e,this.rotation.order,!1)}}(),getWorldScale:function(){var e=new u,t=new s;return function(r){return r=r||new u,this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,r),r}}(),getWorldDirection:function(){var e=new s;return function(t){return t=t||new u,this.getWorldQuaternion(e),t.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(e){e(this);for(var t=this.children,r=0,n=t.length;r<n;r++)t[r].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,r=0,n=t.length;r<n;r++)t[r].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,r=0,n=t.length;r<n;r++)t[r].updateMatrixWorld(e)},toJSON:function(e){function t(t,r){return void 0===t[r.uuid]&&(t[r.uuid]=r.toJSON(e)),r.uuid}function r(e){var t,r=[];for(t in e){var n=e[t];delete n.metadata,r.push(n)}return r}var n=void 0===e||""===e,i={};n&&(e={geometries:{},materials:{},textures:{},images:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var o={};if(o.uuid=this.uuid,o.type=this.type,""!==this.name&&(o.name=this.name),"{}"!==JSON.stringify(this.userData)&&(o.userData=this.userData),!0===this.castShadow&&(o.castShadow=!0),!0===this.receiveShadow&&(o.receiveShadow=!0),!1===this.visible&&(o.visible=!1),o.matrix=this.matrix.toArray(),void 0!==this.geometry&&(o.geometry=t(e.geometries,this.geometry)),void 0!==this.material)if(Array.isArray(this.material)){for(var a=[],s=0,u=this.material.length;s<u;s++)a.push(t(e.materials,this.material[s]));o.material=a}else o.material=t(e.materials,this.material);if(0<this.children.length)for(o.children=[],s=0;s<this.children.length;s++)o.children.push(this.children[s].toJSON(e).object);return n&&(n=r(e.geometries),a=r(e.materials),s=r(e.textures),u=r(e.images),0<n.length&&(i.geometries=n),0<a.length&&(i.materials=a),0<s.length&&(i.textures=s),0<u.length&&(i.images=u)),i.object=o,i},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var r=0;r<e.children.length;r++)this.add(e.children[r].clone());return this}}),ae.prototype=Object.assign(Object.create(oe.prototype),{constructor:ae,isCamera:!0,copy:function(e,t){return oe.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this},getWorldDirection:function(){var e=new s;return function(t){return t=t||new u,this.getWorldQuaternion(e),t.set(0,0,-1).applyQuaternion(e)}}(),updateMatrixWorld:function(e){oe.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),se.prototype=Object.assign(Object.create(ae.prototype),{constructor:se,isOrthographicCamera:!0,copy:function(e,t){return ae.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,r,n,i,o){this.view={fullWidth:e,fullHeight:t,offsetX:r,offsetY:n,width:i,height:o},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(n=(this.right+this.left)/2)-e,n=n+e,e=(o=(this.top+this.bottom)/2)+t,t=o-t;if(null!==this.view)var n=this.zoom/(this.view.width/this.view.fullWidth),t=this.zoom/(this.view.height/this.view.fullHeight),i=(this.right-this.left)/this.view.width,o=(this.top-this.bottom)/this.view.height,r=r+this.view.offsetX/n*i,n=r+this.view.width/n*i,e=e-this.view.offsetY/t*o,t=e-this.view.height/t*o;this.projectionMatrix.makeOrthographic(r,n,e,t,this.near,this.far)},toJSON:function(e){return e=oe.prototype.toJSON.call(this,e),e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),ue.prototype=Object.assign(Object.create(ae.prototype),{constructor:ue,isPerspectiveCamera:!0,copy:function(e,t){return ae.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){e=.5*this.getFilmHeight()/e,this.fov=2*xi.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*xi.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*xi.RAD2DEG*Math.atan(Math.tan(.5*xi.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,r,n,i,o){this.aspect=e/t,this.view={fullWidth:e,fullHeight:t,offsetX:r,offsetY:n,width:i,height:o},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=2*(a=e*Math.tan(.5*xi.DEG2RAD*this.fov)/this.zoom),r=-.5*(s=this.aspect*t),n=this.view;if(null!==n)var i=n.fullWidth,o=n.fullHeight,r=r+n.offsetX*s/i,a=a-n.offsetY*t/o,s=n.width/i*s,t=n.height/o*t;0!==(n=this.filmOffset)&&(r+=e*n/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,a,a-t,e,this.far)},toJSON:function(e){return e=oe.prototype.toJSON.call(this,e),e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),Object.assign(ce.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,r=e.vertexNormals.length;t<r;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,r=e.vertexColors.length;t<r;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var Di=0;Object.assign(le.prototype,t.prototype,{isGeometry:!0,applyMatrix:function(e){for(var t=(new Z).getNormalMatrix(e),r=0,n=this.vertices.length;r<n;r++)this.vertices[r].applyMatrix4(e);for(r=0,n=this.faces.length;r<n;r++){(e=this.faces[r]).normal.applyMatrix3(t).normalize();for(var i=0,o=e.vertexNormals.length;i<o;i++)e.vertexNormals[i].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.normalsNeedUpdate=this.verticesNeedUpdate=!0,this},rotateX:function(){var e=new c;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new c;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new c;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new c;return function(t,r,n){return e.makeTranslation(t,r,n),this.applyMatrix(e),this}}(),scale:function(){var e=new c;return function(t,r,n){return e.makeScale(t,r,n),this.applyMatrix(e),this}}(),lookAt:function(){var e=new oe;return function(t){e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),fromBufferGeometry:function(e){function t(e,t,r,i){i=new ce(e,t,r,void 0!==s?[p[e].clone(),p[t].clone(),p[r].clone()]:[],void 0!==c?[n.colors[e].clone(),n.colors[t].clone(),n.colors[r].clone()]:[],i),n.faces.push(i),void 0!==l&&n.faceVertexUvs[0].push([f[e].clone(),f[t].clone(),f[r].clone()]),void 0!==h&&n.faceVertexUvs[1].push([d[e].clone(),d[t].clone(),d[r].clone()])}var n=this,i=null!==e.index?e.index.array:void 0,o=e.attributes,a=o.position.array,s=void 0!==o.normal?o.normal.array:void 0,c=void 0!==o.color?o.color.array:void 0,l=void 0!==o.uv?o.uv.array:void 0,h=void 0!==o.uv2?o.uv2.array:void 0;void 0!==h&&(this.faceVertexUvs[1]=[]);for(var p=[],f=[],d=[],m=o=0;o<a.length;o+=3,m+=2)n.vertices.push(new u(a[o],a[o+1],a[o+2])),void 0!==s&&p.push(new u(s[o],s[o+1],s[o+2])),void 0!==c&&n.colors.push(new z(c[o],c[o+1],c[o+2])),void 0!==l&&f.push(new r(l[m],l[m+1])),void 0!==h&&d.push(new r(h[m],h[m+1]));var v=e.groups;if(0<v.length)for(o=0;o<v.length;o++)for(var a=v[o],y=a.start,g=a.count,m=y,y=y+g;m<y;m+=3)void 0!==i?t(i[m],i[m+1],i[m+2],a.materialIndex):t(m,m+1,m+2,a.materialIndex);else if(void 0!==i)for(o=0;o<i.length;o+=3)t(i[o],i[o+1],i[o+2]);else for(o=0;o<a.length/3;o+=3)t(o,o+1,o+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.translate(e.x,e.y,e.z),e},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=0===(t=this.boundingSphere.radius)?1:1/t,r=new c;return r.set(t,0,0,-t*e.x,0,t,0,-t*e.y,0,0,t,-t*e.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var e=new u,t=new u,r=0,n=this.faces.length;r<n;r++){var i=this.faces[r],o=this.vertices[i.a],a=this.vertices[i.b];e.subVectors(this.vertices[i.c],a),t.subVectors(o,a),e.cross(t),e.normalize(),i.normal.copy(e)}},computeVertexNormals:function(e){void 0===e&&(e=!0);var t,r,n;for(n=Array(this.vertices.length),t=0,r=this.vertices.length;t<r;t++)n[t]=new u;if(e){var i,o,a,s=new u,c=new u;for(e=0,t=this.faces.length;e<t;e++)r=this.faces[e],i=this.vertices[r.a],o=this.vertices[r.b],a=this.vertices[r.c],s.subVectors(a,o),c.subVectors(i,o),s.cross(c),n[r.a].add(s),n[r.b].add(s),n[r.c].add(s)}else for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++)r=this.faces[e],n[r.a].add(r.normal),n[r.b].add(r.normal),n[r.c].add(r.normal);for(t=0,r=this.vertices.length;t<r;t++)n[t].normalize();for(e=0,t=this.faces.length;e<t;e++)r=this.faces[e],3===(i=r.vertexNormals).length?(i[0].copy(n[r.a]),i[1].copy(n[r.b]),i[2].copy(n[r.c])):(i[0]=n[r.a].clone(),i[1]=n[r.b].clone(),i[2]=n[r.c].clone());0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,r;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){var n=(r=this.faces[e]).vertexNormals;3===n.length?(n[0].copy(r.normal),n[1].copy(r.normal),n[2].copy(r.normal)):(n[0]=r.normal.clone(),n[1]=r.normal.clone(),n[2]=r.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,r,n,i;for(r=0,n=this.faces.length;r<n;r++)for((i=this.faces[r]).__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),e=0,t=i.vertexNormals.length;e<t;e++)i.__originalVertexNormals[e]?i.__originalVertexNormals[e].copy(i.vertexNormals[e]):i.__originalVertexNormals[e]=i.vertexNormals[e].clone();var o=new le;for(o.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[],i=this.morphNormals[e].faceNormals;var a,s,c=this.morphNormals[e].vertexNormals;for(r=0,n=this.faces.length;r<n;r++)a=new u,s={a:new u,b:new u,c:new u},i.push(a),c.push(s)}for(c=this.morphNormals[e],o.vertices=this.morphTargets[e].vertices,o.computeFaceNormals(),o.computeVertexNormals(),r=0,n=this.faces.length;r<n;r++)i=this.faces[r],a=c.faceNormals[r],s=c.vertexNormals[r],a.copy(i.normal),s.a.copy(i.vertexNormals[0]),s.b.copy(i.vertexNormals[1]),s.c.copy(i.vertexNormals[2])}for(r=0,n=this.faces.length;r<n;r++)i=this.faces[r],i.normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeLineDistances:function(){for(var e=0,t=this.vertices,r=0,n=t.length;r<n;r++)0<r&&(e+=t[r].distanceTo(t[r-1])),this.lineDistances[r]=e},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new X),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Y),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,r){if(e&&e.isGeometry){var n,i=this.vertices.length,o=this.vertices,a=e.vertices,s=this.faces,u=e.faces,c=this.faceVertexUvs[0],l=e.faceVertexUvs[0],h=this.colors,p=e.colors;void 0===r&&(r=0),void 0!==t&&(n=(new Z).getNormalMatrix(t)),e=0;for(var f=a.length;e<f;e++){var d=a[e].clone();void 0!==t&&d.applyMatrix4(t),o.push(d)}for(e=0,f=p.length;e<f;e++)h.push(p[e].clone());for(e=0,f=u.length;e<f;e++){var m=(a=u[e]).vertexNormals,p=a.vertexColors;for((h=new ce(a.a+i,a.b+i,a.c+i)).normal.copy(a.normal),void 0!==n&&h.normal.applyMatrix3(n).normalize(),t=0,o=m.length;t<o;t++)d=m[t].clone(),void 0!==n&&d.applyMatrix3(n).normalize(),h.vertexNormals.push(d);for(h.color.copy(a.color),t=0,o=p.length;t<o;t++)d=p[t],h.vertexColors.push(d.clone());h.materialIndex=a.materialIndex+r,s.push(h)}for(e=0,f=l.length;e<f;e++)if(r=l[e],n=[],void 0!==r){for(t=0,o=r.length;t<o;t++)n.push(r[t].clone());c.push(n)}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,r,n={},i=[],o=[],a=Math.pow(10,4);for(t=0,r=this.vertices.length;t<r;t++)e=this.vertices[t],e=Math.round(e.x*a)+"_"+Math.round(e.y*a)+"_"+Math.round(e.z*a),void 0===n[e]?(n[e]=t,i.push(this.vertices[t]),o[t]=i.length-1):o[t]=o[n[e]];for(n=[],t=0,r=this.faces.length;t<r;t++)for(a=this.faces[t],a.a=o[a.a],a.b=o[a.b],a.c=o[a.c],a=[a.a,a.b,a.c],e=0;3>e;e++)if(a[e]===a[(e+1)%3]){n.push(t);break}for(t=n.length-1;0<=t;t--)for(a=n[t],this.faces.splice(a,1),o=0,r=this.faceVertexUvs.length;o<r;o++)this.faceVertexUvs[o].splice(a,1);return t=this.vertices.length-i.length,this.vertices=i,t},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,r=0;r<t;r++)e[r]._id=r;e.sort(function(e,t){return e.materialIndex-t.materialIndex});var n,i,o=this.faceVertexUvs[0],a=this.faceVertexUvs[1];for(o&&o.length===t&&(n=[]),a&&a.length===t&&(i=[]),r=0;r<t;r++){var s=e[r]._id;n&&n.push(o[s]),i&&i.push(a[s])}n&&(this.faceVertexUvs[0]=n),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){function e(e,t,r){return r?e|1<<t:e&~(1<<t)}function t(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==c[t]?c[t]:(c[t]=u.length/3,u.push(e.x,e.y,e.z),c[t])}function r(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==h[t]?h[t]:(h[t]=l.length,l.push(e.getHex()),h[t])}function n(e){var t=e.x.toString()+e.y.toString();return void 0!==f[t]?f[t]:(f[t]=p.length/2,p.push(e.x,e.y),f[t])}var i={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),void 0!==this.parameters){var o,a=this.parameters;for(o in a)void 0!==a[o]&&(i[o]=a[o]);return i}for(a=[],o=0;o<this.vertices.length;o++){s=this.vertices[o];a.push(s.x,s.y,s.z)}var s=[],u=[],c={},l=[],h={},p=[],f={};for(o=0;o<this.faces.length;o++){var d=this.faces[o],m=void 0!==this.faceVertexUvs[0][o],v=0<d.normal.length(),y=0<d.vertexNormals.length,g=1!==d.color.r||1!==d.color.g||1!==d.color.b,b=0<d.vertexColors.length,_=e(_=e(_=e(_=e(_=e(_=e(_=e(_=e(_=0,0,0),1,!0),2,!1),3,m),4,v),5,y),6,g),7,b);s.push(_),s.push(d.a,d.b,d.c),s.push(d.materialIndex),m&&(m=this.faceVertexUvs[0][o],s.push(n(m[0]),n(m[1]),n(m[2]))),v&&s.push(t(d.normal)),y&&(v=d.vertexNormals,s.push(t(v[0]),t(v[1]),t(v[2]))),g&&s.push(r(d.color)),b&&(d=d.vertexColors,s.push(r(d[0]),r(d[1]),r(d[2])))}return i.data={},i.data.vertices=a,i.data.normals=u,0<l.length&&(i.data.colors=l),0<p.length&&(i.data.uvs=[p]),i.data.faces=s,i},clone:function(){return(new le).copy(this)},copy:function(e){var t,r,n,i,o,a;for(this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingSphere=this.boundingBox=null,this.name=e.name,t=0,r=(n=e.vertices).length;t<r;t++)this.vertices.push(n[t].clone());for(t=0,r=(n=e.colors).length;t<r;t++)this.colors.push(n[t].clone());for(t=0,r=(n=e.faces).length;t<r;t++)this.faces.push(n[t].clone());for(t=0,r=e.faceVertexUvs.length;t<r;t++){var s=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),n=0,i=s.length;n<i;n++){var u=s[n],c=[];for(o=0,a=u.length;o<a;o++)c.push(u[o].clone());this.faceVertexUvs[t].push(c)}}for(t=0,r=(o=e.morphTargets).length;t<r;t++){if(a={},a.name=o[t].name,void 0!==o[t].vertices)for(a.vertices=[],n=0,i=o[t].vertices.length;n<i;n++)a.vertices.push(o[t].vertices[n].clone());if(void 0!==o[t].normals)for(a.normals=[],n=0,i=o[t].normals.length;n<i;n++)a.normals.push(o[t].normals[n].clone());this.morphTargets.push(a)}for(t=0,r=(o=e.morphNormals).length;t<r;t++){if(a={},void 0!==o[t].vertexNormals)for(a.vertexNormals=[],n=0,i=o[t].vertexNormals.length;n<i;n++)s=o[t].vertexNormals[n],u={},u.a=s.a.clone(),u.b=s.b.clone(),u.c=s.c.clone(),a.vertexNormals.push(u);if(void 0!==o[t].faceNormals)for(a.faceNormals=[],n=0,i=o[t].faceNormals.length;n<i;n++)a.faceNormals.push(o[t].faceNormals[n].clone());this.morphNormals.push(a)}for(t=0,r=(n=e.skinWeights).length;t<r;t++)this.skinWeights.push(n[t].clone());for(t=0,r=(n=e.skinIndices).length;t<r;t++)this.skinIndices.push(n[t].clone());for(t=0,r=(n=e.lineDistances).length;t<r;t++)this.lineDistances.push(n[t]);return null!==(t=e.boundingBox)&&(this.boundingBox=t.clone()),null!==(t=e.boundingSphere)&&(this.boundingSphere=t.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(he.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(he.prototype,{isBufferAttribute:!0,setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==e?e.length/this.itemSize:0,this.array=e},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.dynamic=e.dynamic,this},copyAt:function(e,t,r){e*=this.itemSize,r*=t.itemSize;for(var n=0,i=this.itemSize;n<i;n++)this.array[e+n]=t.array[r+n];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,r=0,n=0,i=e.length;n<i;n++){var o=e[n];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),o=new z),t[r++]=o.r,t[r++]=o.g,t[r++]=o.b}return this},copyIndicesArray:function(e){for(var t=this.array,r=0,n=0,i=e.length;n<i;n++){var o=e[n];t[r++]=o.a,t[r++]=o.b,t[r++]=o.c}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,i=0,o=e.length;i<o;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),a=new r),t[n++]=a.x,t[n++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,r=0,n=0,i=e.length;n<i;n++){var o=e[n];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),o=new u),t[r++]=o.x,t[r++]=o.y,t[r++]=o.z}return this},copyVector4sArray:function(e){for(var t=this.array,r=0,n=0,o=e.length;n<o;n++){var a=e[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),a=new i),t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r++]=a.w}return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=r,this},setXYZ:function(e,t,r,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=n,this},setXYZW:function(e,t,r,n,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=n,this.array[e+3]=i,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),(pe.prototype=Object.create(he.prototype)).constructor=pe,(fe.prototype=Object.create(he.prototype)).constructor=fe,(de.prototype=Object.create(he.prototype)).constructor=de,(me.prototype=Object.create(he.prototype)).constructor=me,ve.prototype=Object.create(he.prototype),ve.prototype.constructor=ve,(ye.prototype=Object.create(he.prototype)).constructor=ye,ge.prototype=Object.create(he.prototype),ge.prototype.constructor=ge,be.prototype=Object.create(he.prototype),be.prototype.constructor=be,(_e.prototype=Object.create(he.prototype)).constructor=_e,Object.assign(xe.prototype,{computeGroups:function(e){var t,r=[],n=void 0;e=e.faces;for(var i=0;i<e.length;i++){var o=e[i];o.materialIndex!==n&&(n=o.materialIndex,void 0!==t&&(t.count=3*i-t.start,r.push(t)),t={start:3*i,materialIndex:n})}void 0!==t&&(t.count=3*i-t.start,r.push(t)),this.groups=r},fromGeometry:function(e){var t,n=e.faces,i=e.vertices,o=e.faceVertexUvs,a=o[0]&&0<o[0].length,s=o[1]&&0<o[1].length,u=e.morphTargets,c=u.length;if(0<c){t=[];for(y=0;y<c;y++)t[y]=[];this.morphTargets.position=t}var l,h=e.morphNormals,p=h.length;if(0<p){for(l=[],y=0;y<p;y++)l[y]=[];this.morphTargets.normal=l}for(var f=e.skinIndices,d=e.skinWeights,m=f.length===i.length,v=d.length===i.length,y=0;y<n.length;y++){var g=n[y];this.vertices.push(i[g.a],i[g.b],i[g.c]);var b=g.vertexNormals;for(3===b.length?this.normals.push(b[0],b[1],b[2]):(b=g.normal,this.normals.push(b,b,b)),3===(b=g.vertexColors).length?this.colors.push(b[0],b[1],b[2]):(b=g.color,this.colors.push(b,b,b)),!0===a&&(void 0!==(b=o[0][y])?this.uvs.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",y),this.uvs.push(new r,new r,new r))),!0===s&&(void 0!==(b=o[1][y])?this.uvs2.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",y),this.uvs2.push(new r,new r,new r))),b=0;b<c;b++){var _=u[b].vertices;t[b].push(_[g.a],_[g.b],_[g.c])}for(b=0;b<p;b++)_=h[b].vertexNormals[y],l[b].push(_.a,_.b,_.c);m&&this.skinIndices.push(f[g.a],f[g.b],f[g.c]),v&&this.skinWeights.push(d[g.a],d[g.b],d[g.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this}}),Se.MaxIndex=65535,Object.assign(Se.prototype,t.prototype,{isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(65535<we(e)?ge:ve)(e,1):this.index=e},addAttribute:function(e,t,r){if(t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute){if("index"!==e)return this.attributes[e]=t,this;console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t)}else console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(e,new he(t,r))},getAttribute:function(e){return this.attributes[e]},removeAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,r){this.groups.push({start:e,count:t,materialIndex:void 0!==r?r:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;return void 0!==t&&(e.applyToBufferAttribute(t),t.needsUpdate=!0),void 0!==(t=this.attributes.normal)&&((new Z).getNormalMatrix(e).applyToBufferAttribute(t),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var e=new c;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new c;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new c;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new c;return function(t,r,n){return e.makeTranslation(t,r,n),this.applyMatrix(e),this}}(),scale:function(){var e=new c;return function(t,r,n){return e.makeScale(t,r,n),this.applyMatrix(e),this}}(),lookAt:function(){var e=new oe;return function(t){e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.translate(e.x,e.y,e.z),e},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){e=new be(3*t.vertices.length,3);var r=new be(3*t.colors.length,3);this.addAttribute("position",e.copyVector3sArray(t.vertices)),this.addAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length&&(e=new be(t.lineDistances.length,1),this.addAttribute("lineDistance",e.copyArray(t.lineDistances))),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},updateFromObject:function(e){var t=e.geometry;if(e.isMesh){var r=t.__directGeometry;if(!0===t.elementsNeedUpdate&&(r=void 0,t.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(t);r.verticesNeedUpdate=t.verticesNeedUpdate,r.normalsNeedUpdate=t.normalsNeedUpdate,r.colorsNeedUpdate=t.colorsNeedUpdate,r.uvsNeedUpdate=t.uvsNeedUpdate,r.groupsNeedUpdate=t.groupsNeedUpdate,t.verticesNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.groupsNeedUpdate=!1,t=r}return!0===t.verticesNeedUpdate&&(void 0!==(r=this.attributes.position)&&(r.copyVector3sArray(t.vertices),r.needsUpdate=!0),t.verticesNeedUpdate=!1),!0===t.normalsNeedUpdate&&(void 0!==(r=this.attributes.normal)&&(r.copyVector3sArray(t.normals),r.needsUpdate=!0),t.normalsNeedUpdate=!1),!0===t.colorsNeedUpdate&&(void 0!==(r=this.attributes.color)&&(r.copyColorsArray(t.colors),r.needsUpdate=!0),t.colorsNeedUpdate=!1),t.uvsNeedUpdate&&(void 0!==(r=this.attributes.uv)&&(r.copyVector2sArray(t.uvs),r.needsUpdate=!0),t.uvsNeedUpdate=!1),t.lineDistancesNeedUpdate&&(void 0!==(r=this.attributes.lineDistance)&&(r.copyArray(t.lineDistances),r.needsUpdate=!0),t.lineDistancesNeedUpdate=!1),t.groupsNeedUpdate&&(t.computeGroups(e.geometry),this.groups=t.groups,t.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new xe).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){r=new Float32Array(3*e.vertices.length);this.addAttribute("position",new he(r,3).copyVector3sArray(e.vertices)),0<e.normals.length&&(r=new Float32Array(3*e.normals.length),this.addAttribute("normal",new he(r,3).copyVector3sArray(e.normals))),0<e.colors.length&&(r=new Float32Array(3*e.colors.length),this.addAttribute("color",new he(r,3).copyColorsArray(e.colors))),0<e.uvs.length&&(r=new Float32Array(2*e.uvs.length),this.addAttribute("uv",new he(r,2).copyVector2sArray(e.uvs))),0<e.uvs2.length&&(r=new Float32Array(2*e.uvs2.length),this.addAttribute("uv2",new he(r,2).copyVector2sArray(e.uvs2))),0<e.indices.length&&(r=new(65535<we(e.indices)?Uint32Array:Uint16Array)(3*e.indices.length),this.setIndex(new he(r,1).copyIndicesArray(e.indices))),this.groups=e.groups;for(var t in e.morphTargets){for(var r=[],n=e.morphTargets[t],i=0,o=n.length;i<o;i++){var a=n[i],s=new be(3*a.length,3);r.push(s.copyVector3sArray(a))}this.morphAttributes[t]=r}return 0<e.skinIndices.length&&(t=new be(4*e.skinIndices.length,4),this.addAttribute("skinIndex",t.copyVector4sArray(e.skinIndices))),0<e.skinWeights.length&&(t=new be(4*e.skinWeights.length,4),this.addAttribute("skinWeight",t.copyVector4sArray(e.skinWeights))),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new X);var e=this.attributes.position;void 0!==e?this.boundingBox.setFromBufferAttribute(e):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var e=new X,t=new u;return function(){null===this.boundingSphere&&(this.boundingSphere=new Y);var r=this.attributes.position;if(r){var n=this.boundingSphere.center;e.setFromBufferAttribute(r),e.getCenter(n);for(var i=0,o=0,a=r.count;o<a;o++)t.x=r.getX(o),t.y=r.getY(o),t.z=r.getZ(o),i=Math.max(i,n.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes,r=this.groups;if(t.position){var n=t.position.array;if(void 0===t.normal)this.addAttribute("normal",new he(new Float32Array(n.length),3));else for(var i=t.normal.array,o=0,a=i.length;o<a;o++)i[o]=0;var s,c,l,i=t.normal.array,h=new u,p=new u,f=new u,d=new u,m=new u;if(e){e=e.array,0===r.length&&this.addGroup(0,e.length);for(var v=0,y=r.length;v<y;++v)for(o=r[v],a=o.start,s=o.count,o=a,a+=s;o<a;o+=3)s=3*e[o+0],c=3*e[o+1],l=3*e[o+2],h.fromArray(n,s),p.fromArray(n,c),f.fromArray(n,l),d.subVectors(f,p),m.subVectors(h,p),d.cross(m),i[s]+=d.x,i[s+1]+=d.y,i[s+2]+=d.z,i[c]+=d.x,i[c+1]+=d.y,i[c+2]+=d.z,i[l]+=d.x,i[l+1]+=d.y,i[l+2]+=d.z}else for(o=0,a=n.length;o<a;o+=9)h.fromArray(n,o),p.fromArray(n,o+3),f.fromArray(n,o+6),d.subVectors(f,p),m.subVectors(h,p),d.cross(m),i[o]=d.x,i[o+1]=d.y,i[o+2]=d.z,i[o+3]=d.x,i[o+4]=d.y,i[o+5]=d.z,i[o+6]=d.x,i[o+7]=d.y,i[o+8]=d.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0);var r,n=this.attributes;for(r in n)if(void 0!==e.attributes[r])for(var i=n[r].array,o=e.attributes[r],a=o.array,s=0,o=o.itemSize*t;s<a.length;s++,o++)i[o]=a[s];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){for(var e,t,r,n,i=this.attributes.normal,o=0,a=i.count;o<a;o++)e=i.getX(o),t=i.getY(o),r=i.getZ(o),n=1/Math.sqrt(e*e+t*t+r*r),i.setXYZ(o,e*n,t*n,r*n)},toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e,t=new Se,r=this.index.array,n=this.attributes;for(e in n){for(var i,o=(a=n[e]).array,a=a.itemSize,s=new o.constructor(r.length*a),u=0,c=0,l=r.length;c<l;c++){i=r[c]*a;for(var h=0;h<a;h++)s[u++]=o[i++]}t.addAttribute(e,new he(s,a))}return t},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t,r=this.parameters;for(t in r)void 0!==r[t]&&(e[t]=r[t]);return e}e.data={attributes:{}};var n=this.index;null!==n&&(r=Array.prototype.slice.call(n.array),e.data.index={type:n.array.constructor.name,array:r}),n=this.attributes;for(t in n){var i=n[t],r=Array.prototype.slice.call(i.array);e.data.attributes[t]={itemSize:i.itemSize,type:i.array.constructor.name,array:r,normalized:i.normalized}}return 0<(t=this.groups).length&&(e.data.groups=JSON.parse(JSON.stringify(t))),null!==(t=this.boundingSphere)&&(e.data.boundingSphere={center:t.center.toArray(),radius:t.radius}),e},clone:function(){return(new Se).copy(this)},copy:function(e){var t,r,n;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingSphere=this.boundingBox=null,this.name=e.name,null!==(r=e.index)&&this.setIndex(r.clone()),r=e.attributes;for(t in r)this.addAttribute(t,r[t].clone());var i=e.morphAttributes;for(t in i){var o=[],a=i[t];for(r=0,n=a.length;r<n;r++)o.push(a[r].clone());this.morphAttributes[t]=o}for(r=0,n=(t=e.groups).length;r<n;r++)i=t[r],this.addGroup(i.start,i.count,i.materialIndex);return null!==(t=e.boundingBox)&&(this.boundingBox=t.clone()),null!==(t=e.boundingSphere)&&(this.boundingSphere=t.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),(Te.prototype=Object.create(le.prototype)).constructor=Te,Ee.prototype=Object.create(Se.prototype),Ee.prototype.constructor=Ee,(Oe.prototype=Object.create(le.prototype)).constructor=Oe,Me.prototype=Object.create(Se.prototype),Me.prototype.constructor=Me,Ce.prototype=Object.create(W.prototype),Ce.prototype.constructor=Ce,Ce.prototype.isMeshBasicMaterial=!0,Ce.prototype.copy=function(e){return W.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this},Object.assign(je.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return(t||new u).copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(){var e=new u;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){var r=t||new u;r.subVectors(e,this.origin);var n=r.dot(this.direction);return 0>n?r.copy(this.origin):r.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new u;return function(t){var r=e.subVectors(t,this.origin).dot(this.direction);return 0>r?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(r).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:function(){var e=new u,t=new u,r=new u;return function(n,i,o,a){e.copy(n).add(i).multiplyScalar(.5),t.copy(i).sub(n).normalize(),r.copy(this.origin).sub(e);var s,u=.5*n.distanceTo(i),c=-this.direction.dot(t),l=r.dot(this.direction),h=-r.dot(t),p=r.lengthSq(),f=Math.abs(1-c*c);return 0<f?(n=c*h-l,i=c*l-h,s=u*f,0<=n?i>=-s?i<=s?(u=1/f,n*=u,i*=u,c=n*(n+c*i+2*l)+i*(c*n+i+2*h)+p):(i=u,n=Math.max(0,-(c*i+l)),c=-n*n+i*(i+2*h)+p):(i=-u,n=Math.max(0,-(c*i+l)),c=-n*n+i*(i+2*h)+p):i<=-s?(n=Math.max(0,-(-c*u+l)),i=0<n?-u:Math.min(Math.max(-u,-h),u),c=-n*n+i*(i+2*h)+p):i<=s?(n=0,i=Math.min(Math.max(-u,-h),u),c=i*(i+2*h)+p):(n=Math.max(0,-(c*u+l)),i=0<n?u:Math.min(Math.max(-u,-h),u),c=-n*n+i*(i+2*h)+p)):(i=0<c?-u:u,n=Math.max(0,-(c*i+l)),c=-n*n+i*(i+2*h)+p),o&&o.copy(this.direction).multiplyScalar(n).add(this.origin),a&&a.copy(t).multiplyScalar(i).add(e),c}}(),intersectSphere:function(){var e=new u;return function(t,r){e.subVectors(t.center,this.origin);var n=e.dot(this.direction),i=e.dot(e)-n*n,o=t.radius*t.radius;return i>o?null:(o=Math.sqrt(o-i),i=n-o,n+=o,0>i&&0>n?null:0>i?this.at(n,r):this.at(i,r))}}(),intersectsSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);return 0===t?0===e.distanceToPoint(this.origin)?0:null:0<=(e=-(this.origin.dot(e.normal)+e.constant)/t)?e:null},intersectPlane:function(e,t){var r=this.distanceToPlane(e);return null===r?null:this.at(r,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||0>e.normal.dot(this.direction)*t},intersectBox:function(e,t){var r,n,i,o,a;n=1/this.direction.x,o=1/this.direction.y,a=1/this.direction.z;var s=this.origin;return 0<=n?(r=(e.min.x-s.x)*n,n*=e.max.x-s.x):(r=(e.max.x-s.x)*n,n*=e.min.x-s.x),0<=o?(i=(e.min.y-s.y)*o,o*=e.max.y-s.y):(i=(e.max.y-s.y)*o,o*=e.min.y-s.y),r>o||i>n?null:((i>r||r!==r)&&(r=i),(o<n||n!==n)&&(n=o),0<=a?(i=(e.min.z-s.z)*a,a*=e.max.z-s.z):(i=(e.max.z-s.z)*a,a*=e.min.z-s.z),r>a||i>n?null:((i>r||r!==r)&&(r=i),(a<n||n!==n)&&(n=a),0>n?null:this.at(0<=r?r:n,t)))},intersectsBox:function(){var e=new u;return function(t){return null!==this.intersectBox(t,e)}}(),intersectTriangle:function(){var e=new u,t=new u,r=new u,n=new u;return function(i,o,a,s,u){if(t.subVectors(o,i),r.subVectors(a,i),n.crossVectors(t,r),0<(o=this.direction.dot(n))){if(s)return null;s=1}else{if(!(0>o))return null;s=-1,o=-o}return e.subVectors(this.origin,i),0>(i=s*this.direction.dot(r.crossVectors(e,r)))?null:0>(a=s*this.direction.dot(t.cross(e)))||i+a>o?null:0>(i=-s*e.dot(n))?null:this.at(i/o,u)}}(),applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}),Object.assign(Pe.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return(e||new u).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return(e||new u).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var r=t||new u;return this.delta(r).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(){var e=new u,t=new u;return function(r,n){e.subVectors(r,this.start),t.subVectors(this.end,this.start);var i=t.dot(t),i=t.dot(e)/i;return n&&(i=xi.clamp(i,0,1)),i}}(),closestPointToPoint:function(e,t,r){return e=this.closestPointToPointParameter(e,t),r=r||new u,this.delta(r).multiplyScalar(e).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),Object.assign(Ae,{normal:function(){var e=new u;return function(t,r,n,i){return(i=i||new u).subVectors(n,r),e.subVectors(t,r),i.cross(e),0<(t=i.lengthSq())?i.multiplyScalar(1/Math.sqrt(t)):i.set(0,0,0)}}(),barycoordFromPoint:function(){var e=new u,t=new u,r=new u;return function(n,i,o,a,s){e.subVectors(a,i),t.subVectors(o,i),r.subVectors(n,i),n=e.dot(e),i=e.dot(t),o=e.dot(r);var c=t.dot(t);a=t.dot(r);var l=n*c-i*i;return s=s||new u,0===l?s.set(-2,-1,-1):(l=1/l,c=(c*o-i*a)*l,n=(n*a-i*o)*l,s.set(1-c-n,n,c))}}(),containsPoint:function(){var e=new u;return function(t,r,n,i){return 0<=(t=Ae.barycoordFromPoint(t,r,n,i,e)).x&&0<=t.y&&1>=t.x+t.y}}()}),Object.assign(Ae.prototype,{set:function(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this},setFromPointsAndIndices:function(e,t,r,n){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},area:function(){var e=new u,t=new u;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),midpoint:function(e){return(e||new u).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return Ae.normal(this.a,this.b,this.c,e)},plane:function(e){return(e||new J).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return Ae.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return Ae.containsPoint(e,this.a,this.b,this.c)},closestPointToPoint:function(){var e=new J,t=[new Pe,new Pe,new Pe],r=new u,n=new u;return function(i,o){var a=o||new u,s=1/0;if(e.setFromCoplanarPoints(this.a,this.b,this.c),e.projectPoint(i,r),!0===this.containsPoint(r))a.copy(r);else{t[0].set(this.a,this.b),t[1].set(this.b,this.c),t[2].set(this.c,this.a);for(var c=0;c<t.length;c++){t[c].closestPointToPoint(r,!0,n);var l=r.distanceToSquared(n);l<s&&(s=l,a.copy(n))}}return a}}(),equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}),Ne.prototype=Object.assign(Object.create(oe.prototype),{constructor:Ne,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return oe.prototype.copy.call(this,e),this.drawMode=e.drawMode,this},updateMorphTargets:function(){var e,t,r=this.geometry;if(r.isBufferGeometry){if(r=r.morphAttributes,0<(e=Object.keys(r)).length){var n=r[e[0]];if(void 0!==n)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},r=0,e=n.length;r<e;r++)t=n[r].name||String(r),this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=r}}else if(void 0!==(n=r.morphTargets)&&0<n.length)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},r=0,e=n.length;r<e;r++)t=n[r].name||String(r),this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=r},raycast:function(){function e(e,t,r,n,i,o,a){return Ae.barycoordFromPoint(e,t,r,n,g),i.multiplyScalar(g.x),o.multiplyScalar(g.y),a.multiplyScalar(g.z),i.add(o).add(a),i.clone()}function t(e,t,r,n,i,o,a){var s=e.material;return null===(1===s.side?r.intersectTriangle(o,i,n,!0,a):r.intersectTriangle(n,i,o,2!==s.side,a))?null:(_.copy(a),_.applyMatrix4(e.matrixWorld),(r=t.ray.origin.distanceTo(_))<t.near||r>t.far?null:{distance:r,point:_.clone(),object:e})}function n(r,n,i,o,a,u,c,p){return s.fromBufferAttribute(o,u),l.fromBufferAttribute(o,c),h.fromBufferAttribute(o,p),(r=t(r,n,i,s,l,h,b))&&(a&&(m.fromBufferAttribute(a,u),v.fromBufferAttribute(a,c),y.fromBufferAttribute(a,p),r.uv=e(b,s,l,h,m,v,y)),r.face=new ce(u,c,p,Ae.normal(s,l,h)),r.faceIndex=u),r}var i=new c,o=new je,a=new Y,s=new u,l=new u,h=new u,p=new u,f=new u,d=new u,m=new r,v=new r,y=new r,g=new u,b=new u,_=new u;return function(r,u){var c=this.geometry,g=this.material,_=this.matrixWorld;if(void 0!==g&&(null===c.boundingSphere&&c.computeBoundingSphere(),a.copy(c.boundingSphere),a.applyMatrix4(_),!1!==r.ray.intersectsSphere(a)&&(i.getInverse(_),o.copy(r.ray).applyMatrix4(i),null===c.boundingBox||!1!==o.intersectsBox(c.boundingBox)))){var x;if(c.isBufferGeometry){var w,S,T,E,g=c.index,O=c.attributes.position,_=c.attributes.uv;if(null!==g)for(T=0,E=g.count;T<E;T+=3)c=g.getX(T),w=g.getX(T+1),S=g.getX(T+2),(x=n(this,r,o,O,_,c,w,S))&&(x.faceIndex=Math.floor(T/3),u.push(x));else for(T=0,E=O.count;T<E;T+=3)c=T,w=T+1,S=T+2,(x=n(this,r,o,O,_,c,w,S))&&(x.index=c,u.push(x))}else if(c.isGeometry){var M,_=Array.isArray(g);T=c.vertices,E=c.faces,0<(w=c.faceVertexUvs[0]).length&&(O=w);for(var C=0,j=E.length;C<j;C++){var P=E[C];if(void 0!==(x=_?g[P.materialIndex]:g)){if(w=T[P.a],S=T[P.b],M=T[P.c],!0===x.morphTargets){x=c.morphTargets;var A=this.morphTargetInfluences;s.set(0,0,0),l.set(0,0,0),h.set(0,0,0);for(var N=0,L=x.length;N<L;N++){var I=A[N];if(0!==I){var R=x[N].vertices;s.addScaledVector(p.subVectors(R[P.a],w),I),l.addScaledVector(f.subVectors(R[P.b],S),I),h.addScaledVector(d.subVectors(R[P.c],M),I)}}s.add(w),l.add(S),h.add(M),w=s,S=l,M=h}(x=t(this,r,o,w,S,M,b))&&(O&&O[C]&&(A=O[C],m.copy(A[0]),v.copy(A[1]),y.copy(A[2]),x.uv=e(b,w,S,M,m,v,y)),x.face=P,x.faceIndex=C,u.push(x))}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Fi=0;st.prototype=Object.assign(Object.create(ue.prototype),{constructor:st,isArrayCamera:!0}),pt.prototype.isFogExp2=!0,pt.prototype.clone=function(){return new pt(this.color.getHex(),this.density)},pt.prototype.toJSON=function(e){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},ft.prototype.isFog=!0,ft.prototype.clone=function(){return new ft(this.color.getHex(),this.near,this.far)},ft.prototype.toJSON=function(e){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},dt.prototype=Object.assign(Object.create(oe.prototype),{constructor:dt,copy:function(e,t){return oe.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=oe.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}),mt.prototype=Object.assign(Object.create(oe.prototype),{constructor:mt,isLensFlare:!0,copy:function(e){oe.prototype.copy.call(this,e),this.positionScreen.copy(e.positionScreen),this.customUpdateCallback=e.customUpdateCallback;for(var t=0,r=e.lensFlares.length;t<r;t++)this.lensFlares.push(e.lensFlares[t]);return this},add:function(e,t,r,n,i,o){void 0===t&&(t=-1),void 0===r&&(r=0),void 0===o&&(o=1),void 0===i&&(i=new z(16777215)),void 0===n&&(n=1),r=Math.min(r,Math.max(0,r)),this.lensFlares.push({texture:e,size:t,distance:r,x:0,y:0,z:0,scale:1,rotation:0,opacity:o,color:i,blending:n})},updateLensFlares:function(){var e,t,r=this.lensFlares.length,n=2*-this.positionScreen.x,i=2*-this.positionScreen.y;for(e=0;e<r;e++)t=this.lensFlares[e],t.x=this.positionScreen.x+n*t.distance,t.y=this.positionScreen.y+i*t.distance,t.wantedRotation=t.x*Math.PI*.25,t.rotation+=.25*(t.wantedRotation-t.rotation)}}),vt.prototype=Object.create(W.prototype),vt.prototype.constructor=vt,vt.prototype.isSpriteMaterial=!0,vt.prototype.copy=function(e){return W.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.rotation=e.rotation,this},yt.prototype=Object.assign(Object.create(oe.prototype),{constructor:yt,isSprite:!0,raycast:function(){var e=new u,t=new u,r=new u;return function(n,i){t.setFromMatrixPosition(this.matrixWorld),n.ray.closestPointToPoint(t,e),r.setFromMatrixScale(this.matrixWorld);var o=r.x*r.y/4;t.distanceToSquared(e)>o||(o=n.ray.origin.distanceTo(e))<n.near||o>n.far||i.push({distance:o,point:e.clone(),face:null,object:this})}}(),clone:function(){return new this.constructor(this.material).copy(this)}}),gt.prototype=Object.assign(Object.create(oe.prototype),{constructor:gt,copy:function(e){oe.prototype.copy.call(this,e,!1);for(var t=0,r=(e=e.levels).length;t<r;t++){var n=e[t];this.addLevel(n.object.clone(),n.distance)}return this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var r=this.levels,n=0;n<r.length&&!(t<r[n].distance);n++);r.splice(n,0,{distance:t,object:e}),this.add(e)},getObjectForDistance:function(e){for(var t=this.levels,r=1,n=t.length;r<n&&!(e<t[r].distance);r++);return t[r-1].object},raycast:function(){var e=new u;return function(t,r){e.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(e);this.getObjectForDistance(n).raycast(t,r)}}(),update:function(){var e=new u,t=new u;return function(r){var n=this.levels;if(1<n.length){e.setFromMatrixPosition(r.matrixWorld),t.setFromMatrixPosition(this.matrixWorld),r=e.distanceTo(t),n[0].object.visible=!0;for(var i=1,o=n.length;i<o&&r>=n[i].distance;i++)n[i-1].object.visible=!1,n[i].object.visible=!0;for(;i<o;i++)n[i].object.visible=!1}}}(),toJSON:function(e){(e=oe.prototype.toJSON.call(this,e)).object.levels=[];for(var t=this.levels,r=0,n=t.length;r<n;r++){var i=t[r];e.object.levels.push({object:i.object.uuid,distance:i.distance})}return e}}),Object.assign(bt.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var r=new c;this.bones[e]&&r.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(r)}},pose:function(){var e,t,r;for(t=0,r=this.bones.length;t<r;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,r=this.bones.length;t<r;t++)(e=this.bones[t])&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:function(){var e=new c,t=new c;return function(){for(var r=this.bones,n=this.boneInverses,i=this.boneMatrices,o=this.boneTexture,a=0,s=r.length;a<s;a++)e.multiplyMatrices(r[a]?r[a].matrixWorld:t,n[a]),e.toArray(i,16*a);void 0!==o&&(o.needsUpdate=!0)}}(),clone:function(){return new bt(this.bones,this.boneInverses)}}),_t.prototype=Object.assign(Object.create(oe.prototype),{constructor:_t,isBone:!0}),xt.prototype=Object.assign(Object.create(Ne.prototype),{constructor:xt,isSkinnedMesh:!0,initBones:function(){var e,t,r,n,i=[];if(this.geometry&&void 0!==this.geometry.bones){for(r=0,n=this.geometry.bones.length;r<n;r++)t=this.geometry.bones[r],e=new _t,i.push(e),e.name=t.name,e.position.fromArray(t.pos),e.quaternion.fromArray(t.rotq),void 0!==t.scl&&e.scale.fromArray(t.scl);for(r=0,n=this.geometry.bones.length;r<n;r++)-1!==(t=this.geometry.bones[r]).parent&&null!==t.parent&&void 0!==i[t.parent]?i[t.parent].add(i[r]):this.add(i[r])}return this.updateMatrixWorld(!0),i},bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var e,t;if(this.geometry&&this.geometry.isGeometry)for(t=0;t<this.geometry.skinWeights.length;t++)1/0!==(e=1/(r=this.geometry.skinWeights[t]).lengthManhattan())?r.multiplyScalar(e):r.set(1,0,0,0);else if(this.geometry&&this.geometry.isBufferGeometry){var r=new i,n=this.geometry.attributes.skinWeight;for(t=0;t<n.count;t++)r.x=n.getX(t),r.y=n.getY(t),r.z=n.getZ(t),r.w=n.getW(t),e=1/r.lengthManhattan(),1/0!==e?r.multiplyScalar(e):r.set(1,0,0,0),n.setXYZW(t,r.x,r.y,r.z,r.w)}},updateMatrixWorld:function(e){Ne.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),wt.prototype=Object.create(W.prototype),wt.prototype.constructor=wt,wt.prototype.isLineBasicMaterial=!0,wt.prototype.copy=function(e){return W.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this},St.prototype=Object.assign(Object.create(oe.prototype),{constructor:St,isLine:!0,raycast:function(){var e=new c,t=new je,r=new Y;return function(n,i){var o=(o=n.linePrecision)*o,a=this.geometry,s=this.matrixWorld;if(null===a.boundingSphere&&a.computeBoundingSphere(),r.copy(a.boundingSphere),r.applyMatrix4(s),!1!==n.ray.intersectsSphere(r)){e.getInverse(s),t.copy(n.ray).applyMatrix4(e);var c=new u,l=new u,s=new u,h=new u,p=this&&this.isLineSegments?2:1;if(a.isBufferGeometry){var f=a.index,d=a.attributes.position.array;if(null!==f)for(var f=f.array,a=0,m=f.length-1;a<m;a+=p){var v=f[a+1];c.fromArray(d,3*f[a]),l.fromArray(d,3*v),(v=t.distanceSqToSegment(c,l,h,s))>o||(h.applyMatrix4(this.matrixWorld),(v=n.ray.origin.distanceTo(h))<n.near||v>n.far||i.push({distance:v,point:s.clone().applyMatrix4(this.matrixWorld),index:a,face:null,faceIndex:null,object:this}))}else for(a=0,m=d.length/3-1;a<m;a+=p)c.fromArray(d,3*a),l.fromArray(d,3*a+3),(v=t.distanceSqToSegment(c,l,h,s))>o||(h.applyMatrix4(this.matrixWorld),(v=n.ray.origin.distanceTo(h))<n.near||v>n.far||i.push({distance:v,point:s.clone().applyMatrix4(this.matrixWorld),index:a,face:null,faceIndex:null,object:this}))}else if(a.isGeometry)for(c=a.vertices,l=c.length,a=0;a<l-1;a+=p)(v=t.distanceSqToSegment(c[a],c[a+1],h,s))>o||(h.applyMatrix4(this.matrixWorld),(v=n.ray.origin.distanceTo(h))<n.near||v>n.far||i.push({distance:v,point:s.clone().applyMatrix4(this.matrixWorld),index:a,face:null,faceIndex:null,object:this}))}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Tt.prototype=Object.assign(Object.create(St.prototype),{constructor:Tt,isLineSegments:!0}),Et.prototype=Object.assign(Object.create(St.prototype),{constructor:Et,isLineLoop:!0}),Ot.prototype=Object.create(W.prototype),Ot.prototype.constructor=Ot,Ot.prototype.isPointsMaterial=!0,Ot.prototype.copy=function(e){return W.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this},Mt.prototype=Object.assign(Object.create(oe.prototype),{constructor:Mt,isPoints:!0,raycast:function(){var e=new c,t=new je,r=new Y;return function(n,i){function o(e,r){var o=t.distanceSqToPoint(e);if(o<h){var s=t.closestPointToPoint(e);s.applyMatrix4(c);var u=n.ray.origin.distanceTo(s);u<n.near||u>n.far||i.push({distance:u,distanceToRay:Math.sqrt(o),point:s.clone(),index:r,face:null,object:a})}}var a=this,s=this.geometry,c=this.matrixWorld,l=n.params.Points.threshold;if(null===s.boundingSphere&&s.computeBoundingSphere(),r.copy(s.boundingSphere),r.applyMatrix4(c),r.radius+=l,!1!==n.ray.intersectsSphere(r)){e.getInverse(c),t.copy(n.ray).applyMatrix4(e);var h=(l=l/((this.scale.x+this.scale.y+this.scale.z)/3))*l,l=new u;if(s.isBufferGeometry){var p=s.index,s=s.attributes.position.array;if(null!==p)for(var f=p.array,p=0,d=f.length;p<d;p++){var m=f[p];l.fromArray(s,3*m),o(l,m)}else for(p=0,f=s.length/3;p<f;p++)l.fromArray(s,3*p),o(l,p)}else for(l=s.vertices,p=0,f=l.length;p<f;p++)o(l[p],p)}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ct.prototype=Object.assign(Object.create(oe.prototype),{constructor:Ct}),(jt.prototype=Object.create(n.prototype)).constructor=jt,(Pt.prototype=Object.create(n.prototype)).constructor=Pt,Pt.prototype.isCompressedTexture=!0,(At.prototype=Object.create(n.prototype)).constructor=At,(Nt.prototype=Object.create(n.prototype)).constructor=Nt,Nt.prototype.isDepthTexture=!0,(Lt.prototype=Object.create(Se.prototype)).constructor=Lt,(It.prototype=Object.create(le.prototype)).constructor=It,(Rt.prototype=Object.create(Se.prototype)).constructor=Rt,(kt.prototype=Object.create(le.prototype)).constructor=kt,Dt.prototype=Object.create(Se.prototype),Dt.prototype.constructor=Dt,(Ft.prototype=Object.create(le.prototype)).constructor=Ft,(Vt.prototype=Object.create(Dt.prototype)).constructor=Vt,(Bt.prototype=Object.create(le.prototype)).constructor=Bt,Ut.prototype=Object.create(Dt.prototype),Ut.prototype.constructor=Ut,(Gt.prototype=Object.create(le.prototype)).constructor=Gt,(zt.prototype=Object.create(Dt.prototype)).constructor=zt,(qt.prototype=Object.create(le.prototype)).constructor=qt,($t.prototype=Object.create(Dt.prototype)).constructor=$t,(Ht.prototype=Object.create(le.prototype)).constructor=Ht,(Wt.prototype=Object.create(Se.prototype)).constructor=Wt,(Qt.prototype=Object.create(le.prototype)).constructor=Qt,(Kt.prototype=Object.create(Se.prototype)).constructor=Kt,(Xt.prototype=Object.create(le.prototype)).constructor=Xt,(Yt.prototype=Object.create(Se.prototype)).constructor=Yt;var Vi={area:function(e){for(var t=e.length,r=0,n=t-1,i=0;i<t;n=i++)r+=e[n].x*e[i].y-e[i].x*e[n].y;return.5*r},triangulate:function(e,t){var r=e.length;if(3>r)return null;var n,i,o,a=[],s=[],u=[];if(0<Vi.area(e))for(i=0;i<r;i++)s[i]=i;else for(i=0;i<r;i++)s[i]=r-1-i;var c=2*r;for(i=r-1;2<r;){if(0>=c--){console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()");break}r<=(n=i)&&(n=0),r<=(i=n+1)&&(i=0),r<=(o=i+1)&&(o=0);var l;e:{var h,p,f,d,m,v,y,g;if(h=e[s[n]].x,p=e[s[n]].y,f=e[s[i]].x,d=e[s[i]].y,m=e[s[o]].x,v=e[s[o]].y,0>=(f-h)*(v-p)-(d-p)*(m-h))l=!1;else{var b,_,x,w,S,T,E,O,M,C;for(b=m-f,_=v-d,x=h-m,w=p-v,S=f-h,T=d-p,l=0;l<r;l++)if(y=e[s[l]].x,g=e[s[l]].y,!(y===h&&g===p||y===f&&g===d||y===m&&g===v)&&(E=y-h,O=g-p,M=y-f,C=g-d,y-=m,g-=v,M=b*C-_*M,E=S*O-T*E,O=x*g-w*y,M>=-Number.EPSILON&&O>=-Number.EPSILON&&E>=-Number.EPSILON)){l=!1;break e}l=!0}}if(l){for(a.push([e[s[n]],e[s[i]],e[s[o]]]),u.push([s[n],s[i],s[o]]),n=i,o=i+1;o<r;n++,o++)s[n]=s[o];c=2*--r}}return t?u:a},triangulateShape:function(e,t){function r(e){var t=e.length;2<t&&e[t-1].equals(e[0])&&e.pop()}function n(e,t,r){return e.x!==t.x?e.x<t.x?e.x<=r.x&&r.x<=t.x:t.x<=r.x&&r.x<=e.x:e.y<t.y?e.y<=r.y&&r.y<=t.y:t.y<=r.y&&r.y<=e.y}function i(e,t,r,i,o){var a=t.x-e.x,s=t.y-e.y,u=i.x-r.x,c=i.y-r.y,l=e.x-r.x,h=e.y-r.y,p=s*u-a*c,f=s*l-a*h;if(Math.abs(p)>Number.EPSILON){if(0<p){if(0>f||f>p)return[];if(0>(u=c*l-u*h)||u>p)return[]}else{if(0<f||f<p)return[];if(0<(u=c*l-u*h)||u<p)return[]}return 0===u?!o||0!==f&&f!==p?[e]:[]:u===p?!o||0!==f&&f!==p?[t]:[]:0===f?[r]:f===p?[i]:(o=u/p,[{x:e.x+o*a,y:e.y+o*s}])}return 0!==f||c*l!=u*h?[]:(s=0===a&&0===s,u=0===u&&0===c,s&&u?e.x!==r.x||e.y!==r.y?[]:[e]:s?n(r,i,e)?[e]:[]:u?n(e,t,r)?[r]:[]:(0!==a?(e.x<t.x?(a=e,u=e.x,s=t,e=t.x):(a=t,u=t.x,s=e,e=e.x),r.x<i.x?(t=r,p=r.x,c=i,r=i.x):(t=i,p=i.x,c=r,r=r.x)):(e.y<t.y?(a=e,u=e.y,s=t,e=t.y):(a=t,u=t.y,s=e,e=e.y),r.y<i.y?(t=r,p=r.y,c=i,r=i.y):(t=i,p=i.y,c=r,r=r.y)),u<=p?e<p?[]:e===p?o?[]:[t]:e<=r?[t,s]:[t,c]:u>r?[]:u===r?o?[]:[a]:e<=r?[a,s]:[a,c]))}function o(e,t,r,n){var i=t.x-e.x,o=t.y-e.y;t=r.x-e.x,r=r.y-e.y;var a=n.x-e.x;return n=n.y-e.y,e=i*r-o*t,i=i*n-o*a,Math.abs(e)>Number.EPSILON?(t=a*r-n*t,0<e?0<=i&&0<=t:0<=i||0<=t):0<i}r(e),t.forEach(r);var a,s,u,c,l,h={};for(u=e.concat(),a=0,s=t.length;a<s;a++)Array.prototype.push.apply(u,t[a]);for(a=0,s=u.length;a<s;a++)l=u[a].x+":"+u[a].y,void 0!==h[l]&&console.warn("THREE.ShapeUtils: Duplicate point",l,a),h[l]=a;a=function(e,t){var r,n,a,s,u,c,l,h,p,f=e.concat(),d=[],m=[],v=0;for(n=t.length;v<n;v++)d.push(v);l=0;for(var y=2*d.length;0<d.length;){if(0>--y){console.log("Infinite Loop! Holes left:"+d.length+", Probably Hole outside Shape!");break}for(a=l;a<f.length;a++){for(s=f[a],n=-1,v=0;v<d.length;v++)if(u=d[v],c=s.x+":"+s.y+":"+u,void 0===m[c]){for(r=t[u],h=0;h<r.length;h++)if(u=r[h],function(e,t){var n=f.length-1,i=e-1;0>i&&(i=n);var a=e+1;return a>n&&(a=0),!!(n=o(f[e],f[i],f[a],r[t]))&&(n=r.length-1,0>(i=t-1)&&(i=n),(a=t+1)>n&&(a=0),!!(n=o(r[t],r[i],r[a],f[e])))}(a,h)&&!function(e,t){var r,n;for(r=0;r<f.length;r++)if(n=r+1,n%=f.length,0<(n=i(e,t,f[r],f[n],!0)).length)return!0;return!1}(s,u)&&!function(e,r){var n,o,a,s;for(n=0;n<d.length;n++)for(o=t[d[n]],a=0;a<o.length;a++)if(s=a+1,s%=o.length,0<(s=i(e,r,o[a],o[s],!0)).length)return!0;return!1}(s,u)){n=h,d.splice(v,1),l=f.slice(0,a+1),u=f.slice(a),h=r.slice(n),p=r.slice(0,n+1),f=l.concat(h).concat(p).concat(u),l=a;break}if(0<=n)break;m[c]=!0}if(0<=n)break}}return f}(e,t);var p=Vi.triangulate(a,!1);for(a=0,s=p.length;a<s;a++)for(c=p[a],u=0;3>u;u++)l=c[u].x+":"+c[u].y,void 0!==(l=h[l])&&(c[u]=l);return p.concat()},isClockWise:function(e){return 0>Vi.area(e)}};(Zt.prototype=Object.create(le.prototype)).constructor=Zt,Jt.prototype=Object.create(Se.prototype),Jt.prototype.constructor=Jt,Jt.prototype.getArrays=function(){var e=(e=this.getAttribute("position"))?Array.prototype.slice.call(e.array):[],t=(t=this.getAttribute("uv"))?Array.prototype.slice.call(t.array):[],r=this.index;return{position:e,uv:t,index:r=r?Array.prototype.slice.call(r.array):[]}},Jt.prototype.addShapeList=function(e,t){var r=e.length;t.arrays=this.getArrays();for(var n=0;n<r;n++)this.addShape(e[n],t);this.setIndex(t.arrays.index),this.addAttribute("position",new be(t.arrays.position,3)),this.addAttribute("uv",new be(t.arrays.uv,2))},Jt.prototype.addShape=function(e,t){function n(e,t,r){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(r).add(e)}function i(e,t,n){var i,o,a;o=e.x-t.x,a=e.y-t.y,i=n.x-e.x;var s=n.y-e.y,u=o*o+a*a;if(Math.abs(o*s-a*i)>Number.EPSILON){var c=Math.sqrt(u),l=Math.sqrt(i*i+s*s),u=t.x-a/c;if(t=t.y+o/c,s=((n.x-s/l-u)*s-(n.y+i/l-t)*i)/(o*s-a*i),i=u+o*s-e.x,o=t+a*s-e.y,2>=(a=i*i+o*o))return new r(i,o);a=Math.sqrt(a/2)}else e=!1,o>Number.EPSILON?i>Number.EPSILON&&(e=!0):o<-Number.EPSILON?i<-Number.EPSILON&&(e=!0):Math.sign(a)===Math.sign(s)&&(e=!0),e?(i=-a,a=Math.sqrt(u)):(i=o,o=a,a=Math.sqrt(u/2));return new r(i/a,o/a)}function o(e,t){var r,n;for($=e.length;0<=--$;){r=$,0>(n=$-1)&&(n=e.length-1);var i,o=O+2*S;for(i=0;i<o;i++){var a=z*i,s=t+n+a,u=t+n+(h=z*(i+1)),h=t+r+h;c(t+r+a),c(s),c(h),c(s),c(u),c(h),a=v.length/3,l((a=j.generateSideWallUV(L,v,a-6,a-3,a-2,a-1))[0]),l(a[1]),l(a[3]),l(a[1]),l(a[2]),l(a[3])}}}function a(e,t,r){b.push(e),b.push(t),b.push(r)}function s(e,t,r){c(e),c(t),c(r),e=v.length/3,l((e=j.generateTopUV(L,v,e-3,e-2,e-1))[0]),l(e[1]),l(e[2])}function c(e){y.push(v.length/3),v.push(b[3*e+0]),v.push(b[3*e+1]),v.push(b[3*e+2])}function l(e){g.push(e.x),g.push(e.y)}var h,p,f,d,m,v=(_=t.arrays?t.arrays:this.getArrays()).position,y=_.index,g=_.uv,b=[],_=void 0!==t.amount?t.amount:100,x=void 0!==t.bevelThickness?t.bevelThickness:6,w=void 0!==t.bevelSize?t.bevelSize:x-2,S=void 0!==t.bevelSegments?t.bevelSegments:3,T=void 0===t.bevelEnabled||t.bevelEnabled,E=void 0!==t.curveSegments?t.curveSegments:12,O=void 0!==t.steps?t.steps:1,M=t.extrudePath,C=!1,j=void 0!==t.UVGenerator?t.UVGenerator:Zt.WorldUVGenerator;M&&(h=M.getSpacedPoints(O),C=!0,T=!1,p=void 0!==t.frames?t.frames:M.computeFrenetFrames(O,!1),f=new u,d=new u,m=new u),T||(w=x=S=0);var P,A,N,L=this,E=(M=e.extractPoints(E)).shape,I=M.holes;if(!Vi.isClockWise(E))for(E=E.reverse(),A=0,N=I.length;A<N;A++)P=I[A],Vi.isClockWise(P)&&(I[A]=P.reverse());var R=Vi.triangulateShape(E,I),k=E;for(A=0,N=I.length;A<N;A++)P=I[A],E=E.concat(P);var D,F,V,B,U,G,z=E.length,q=R.length,M=[],$=0;for(D=(V=k.length)-1,F=$+1;$<V;$++,D++,F++)D===V&&(D=0),F===V&&(F=0),M[$]=i(k[$],k[D],k[F]);var H,W=[],Q=M.concat();for(A=0,N=I.length;A<N;A++){for(P=I[A],H=[],$=0,D=(V=P.length)-1,F=$+1;$<V;$++,D++,F++)D===V&&(D=0),F===V&&(F=0),H[$]=i(P[$],P[D],P[F]);W.push(H),Q=Q.concat(H)}for(D=0;D<S;D++){for(V=D/S,B=x*Math.cos(V*Math.PI/2),F=w*Math.sin(V*Math.PI/2),$=0,V=k.length;$<V;$++)U=n(k[$],M[$],F),a(U.x,U.y,-B);for(A=0,N=I.length;A<N;A++)for(P=I[A],H=W[A],$=0,V=P.length;$<V;$++)U=n(P[$],H[$],F),a(U.x,U.y,-B)}for(F=w,$=0;$<z;$++)U=T?n(E[$],Q[$],F):E[$],C?(d.copy(p.normals[0]).multiplyScalar(U.x),f.copy(p.binormals[0]).multiplyScalar(U.y),m.copy(h[0]).add(d).add(f),a(m.x,m.y,m.z)):a(U.x,U.y,0);for(V=1;V<=O;V++)for($=0;$<z;$++)U=T?n(E[$],Q[$],F):E[$],C?(d.copy(p.normals[V]).multiplyScalar(U.x),f.copy(p.binormals[V]).multiplyScalar(U.y),m.copy(h[V]).add(d).add(f),a(m.x,m.y,m.z)):a(U.x,U.y,_/O*V);for(D=S-1;0<=D;D--){for(V=D/S,B=x*Math.cos(V*Math.PI/2),F=w*Math.sin(V*Math.PI/2),$=0,V=k.length;$<V;$++)U=n(k[$],M[$],F),a(U.x,U.y,_+B);for(A=0,N=I.length;A<N;A++)for(P=I[A],H=W[A],$=0,V=P.length;$<V;$++)U=n(P[$],H[$],F),C?a(U.x,U.y+h[O-1].y,h[O-1].x+B):a(U.x,U.y,_+B)}!function(){var e=v.length/3;if(T){var r=0*z;for($=0;$<q;$++)G=R[$],s(G[2]+r,G[1]+r,G[0]+r);for(r=z*(O+2*S),$=0;$<q;$++)G=R[$],s(G[0]+r,G[1]+r,G[2]+r)}else{for($=0;$<q;$++)G=R[$],s(G[2],G[1],G[0]);for($=0;$<q;$++)G=R[$],s(G[0]+z*O,G[1]+z*O,G[2]+z*O)}L.addGroup(e,v.length/3-e,void 0!==t.material?t.material:0)}(),function(){var e=v.length/3,r=0;for(o(k,r),r+=k.length,A=0,N=I.length;A<N;A++)P=I[A],o(P,r),r+=P.length;L.addGroup(e,v.length/3-e,void 0!==t.extrudeMaterial?t.extrudeMaterial:1)}(),t.arrays||(this.setIndex(y),this.addAttribute("position",new be(v,3)),this.addAttribute("uv",new be(t.arrays.uv,2)))},Zt.WorldUVGenerator={generateTopUV:function(e,t,n,i,o){e=t[3*i],i=t[3*i+1];var a=t[3*o];return o=t[3*o+1],[new r(t[3*n],t[3*n+1]),new r(e,i),new r(a,o)]},generateSideWallUV:function(e,t,n,i,o,a){e=t[3*n];var s=t[3*n+1];n=t[3*n+2];var u=t[3*i],c=t[3*i+1];i=t[3*i+2];var l=t[3*o],h=t[3*o+1];o=t[3*o+2];var p=t[3*a],f=t[3*a+1];return t=t[3*a+2],.01>Math.abs(s-c)?[new r(e,1-n),new r(u,1-i),new r(l,1-o),new r(p,1-t)]:[new r(s,1-n),new r(c,1-i),new r(h,1-o),new r(f,1-t)]}},(er.prototype=Object.create(le.prototype)).constructor=er,(tr.prototype=Object.create(Jt.prototype)).constructor=tr,(rr.prototype=Object.create(le.prototype)).constructor=rr,nr.prototype=Object.create(Se.prototype),nr.prototype.constructor=nr,(ir.prototype=Object.create(le.prototype)).constructor=ir,(or.prototype=Object.create(Se.prototype)).constructor=or,(ar.prototype=Object.create(le.prototype)).constructor=ar,(sr.prototype=Object.create(Se.prototype)).constructor=sr,(ur.prototype=Object.create(le.prototype)).constructor=ur,(cr.prototype=Object.create(Se.prototype)).constructor=cr,(lr.prototype=Object.create(Se.prototype)).constructor=lr,hr.prototype=Object.create(le.prototype),hr.prototype.constructor=hr,pr.prototype=Object.create(Se.prototype),pr.prototype.constructor=pr,(fr.prototype=Object.create(hr.prototype)).constructor=fr,(dr.prototype=Object.create(pr.prototype)).constructor=dr,(mr.prototype=Object.create(le.prototype)).constructor=mr,(vr.prototype=Object.create(Se.prototype)).constructor=vr;var Bi=Object.freeze({WireframeGeometry:Lt,ParametricGeometry:It,ParametricBufferGeometry:Rt,TetrahedronGeometry:Ft,TetrahedronBufferGeometry:Vt,OctahedronGeometry:Bt,OctahedronBufferGeometry:Ut,IcosahedronGeometry:Gt,IcosahedronBufferGeometry:zt,DodecahedronGeometry:qt,DodecahedronBufferGeometry:$t,PolyhedronGeometry:kt,PolyhedronBufferGeometry:Dt,TubeGeometry:Ht,TubeBufferGeometry:Wt,TorusKnotGeometry:Qt,TorusKnotBufferGeometry:Kt,TorusGeometry:Xt,TorusBufferGeometry:Yt,TextGeometry:er,TextBufferGeometry:tr,SphereGeometry:rr,SphereBufferGeometry:nr,RingGeometry:ir,RingBufferGeometry:or,PlaneGeometry:Oe,PlaneBufferGeometry:Me,LatheGeometry:ar,LatheBufferGeometry:sr,ShapeGeometry:ur,ShapeBufferGeometry:cr,ExtrudeGeometry:Zt,ExtrudeBufferGeometry:Jt,EdgesGeometry:lr,ConeGeometry:fr,ConeBufferGeometry:dr,CylinderGeometry:hr,CylinderBufferGeometry:pr,CircleGeometry:mr,CircleBufferGeometry:vr,BoxGeometry:Te,BoxBufferGeometry:Ee});(yr.prototype=Object.create(Q.prototype)).constructor=yr,yr.prototype.isShadowMaterial=!0,(gr.prototype=Object.create(Q.prototype)).constructor=gr,gr.prototype.isRawShaderMaterial=!0,br.prototype=Object.create(W.prototype),br.prototype.constructor=br,br.prototype.isMeshStandardMaterial=!0,br.prototype.copy=function(e){return W.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},(_r.prototype=Object.create(br.prototype)).constructor=_r,_r.prototype.isMeshPhysicalMaterial=!0,_r.prototype.copy=function(e){return br.prototype.copy.call(this,e),this.defines={PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearCoat=e.clearCoat,this.clearCoatRoughness=e.clearCoatRoughness,this},xr.prototype=Object.create(W.prototype),xr.prototype.constructor=xr,xr.prototype.isMeshPhongMaterial=!0,xr.prototype.copy=function(e){return W.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},(wr.prototype=Object.create(xr.prototype)).constructor=wr,wr.prototype.isMeshToonMaterial=!0,wr.prototype.copy=function(e){return xr.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},(Sr.prototype=Object.create(W.prototype)).constructor=Sr,Sr.prototype.isMeshNormalMaterial=!0,Sr.prototype.copy=function(e){return W.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},(Tr.prototype=Object.create(W.prototype)).constructor=Tr,Tr.prototype.isMeshLambertMaterial=!0,Tr.prototype.copy=function(e){return W.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},(Er.prototype=Object.create(W.prototype)).constructor=Er,Er.prototype.isLineDashedMaterial=!0,Er.prototype.copy=function(e){return W.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Ui=Object.freeze({ShadowMaterial:yr,SpriteMaterial:vt,RawShaderMaterial:gr,ShaderMaterial:Q,PointsMaterial:Ot,MeshPhysicalMaterial:_r,MeshStandardMaterial:br,MeshPhongMaterial:xr,MeshToonMaterial:wr,MeshNormalMaterial:Sr,MeshLambertMaterial:Tr,MeshDepthMaterial:K,MeshBasicMaterial:Ce,LineDashedMaterial:Er,LineBasicMaterial:wt,Material:W}),Gi={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},zi=new Or;Object.assign(Mr.prototype,{load:function(e,t,r,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e);var i=this,o=Gi.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout(function(){t&&t(o),i.manager.itemEnd(e)},0),o;if(u=e.match(/^data:(.*?)(;base64)?,(.*)$/)){var a=u[1],s=!!u[2],u=u[3],u=window.decodeURIComponent(u);s&&(u=window.atob(u));try{var c,l=(this.responseType||"").toLowerCase();switch(l){case"arraybuffer":case"blob":c=new ArrayBuffer(u.length);for(var h=new Uint8Array(c),s=0;s<u.length;s++)h[s]=u.charCodeAt(s);"blob"===l&&(c=new Blob([c],{type:a}));break;case"document":c=(new DOMParser).parseFromString(u,a);break;case"json":c=JSON.parse(u);break;default:c=u}window.setTimeout(function(){t&&t(c),i.manager.itemEnd(e)},0)}catch(t){window.setTimeout(function(){n&&n(t),i.manager.itemEnd(e),i.manager.itemError(e)},0)}}else{var p=new XMLHttpRequest;p.open("GET",e,!0),p.addEventListener("load",function(r){var o=r.target.response;Gi.add(e,o),200===this.status?(t&&t(o),i.manager.itemEnd(e)):0===this.status?(console.warn("THREE.FileLoader: HTTP Status 0 received."),t&&t(o),i.manager.itemEnd(e)):(n&&n(r),i.manager.itemEnd(e),i.manager.itemError(e))},!1),void 0!==r&&p.addEventListener("progress",function(e){r(e)},!1),p.addEventListener("error",function(t){n&&n(t),i.manager.itemEnd(e),i.manager.itemError(e)},!1),void 0!==this.responseType&&(p.responseType=this.responseType),void 0!==this.withCredentials&&(p.withCredentials=this.withCredentials),p.overrideMimeType&&p.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain");for(a in this.requestHeader)p.setRequestHeader(a,this.requestHeader[a]);p.send(null)}return i.manager.itemStart(e),p},setPath:function(e){return this.path=e,this},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),Object.assign(Cr.prototype,{load:function(e,t,r,n){var i=this,o=[],a=new Pt;a.image=o;var s=new Mr(this.manager);if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(e))for(var u=0,c=0,l=e.length;c<l;++c)!function(c){s.load(e[c],function(e){e=i._parser(e,!0),o[c]={width:e.width,height:e.height,format:e.format,mipmaps:e.mipmaps},6===(u+=1)&&(1===e.mipmapCount&&(a.minFilter=1006),a.format=e.format,a.needsUpdate=!0,t&&t(a))},r,n)}(c);else s.load(e,function(e){if((e=i._parser(e,!0)).isCubemap)for(var r=e.mipmaps.length/e.mipmapCount,n=0;n<r;n++){o[n]={mipmaps:[]};for(var s=0;s<e.mipmapCount;s++)o[n].mipmaps.push(e.mipmaps[n*e.mipmapCount+s]),o[n].format=e.format,o[n].width=e.width,o[n].height=e.height}else a.image.width=e.width,a.image.height=e.height,a.mipmaps=e.mipmaps;1===e.mipmapCount&&(a.minFilter=1006),a.format=e.format,a.needsUpdate=!0,t&&t(a)},r,n);return a},setPath:function(e){return this.path=e,this}}),Object.assign(jr.prototype,{load:function(e,t,r,n){var i=this,o=new l,a=new Mr(this.manager);return a.setResponseType("arraybuffer"),a.load(e,function(e){(e=i._parser(e))&&(void 0!==e.image?o.image=e.image:void 0!==e.data&&(o.image.width=e.width,o.image.height=e.height,o.image.data=e.data),o.wrapS=void 0!==e.wrapS?e.wrapS:1001,o.wrapT=void 0!==e.wrapT?e.wrapT:1001,o.magFilter=void 0!==e.magFilter?e.magFilter:1006,o.minFilter=void 0!==e.minFilter?e.minFilter:1008,o.anisotropy=void 0!==e.anisotropy?e.anisotropy:1,void 0!==e.format&&(o.format=e.format),void 0!==e.type&&(o.type=e.type),void 0!==e.mipmaps&&(o.mipmaps=e.mipmaps),1===e.mipmapCount&&(o.minFilter=1006),o.needsUpdate=!0,t&&t(o,e))},r,n),o}}),Object.assign(Pr.prototype,{load:function(e,t,r,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e);var i=this,o=Gi.get(e);return void 0!==o?(i.manager.itemStart(e),setTimeout(function(){t&&t(o),i.manager.itemEnd(e)},0),o):((r=document.createElementNS("http://www.w3.org/1999/xhtml","img")).addEventListener("load",function(){Gi.add(e,this),t&&t(this),i.manager.itemEnd(e)},!1),r.addEventListener("error",function(t){n&&n(t),i.manager.itemEnd(e),i.manager.itemError(e)},!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(r.crossOrigin=this.crossOrigin),i.manager.itemStart(e),r.src=e,r)},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(Ar.prototype,{load:function(e,t,r,n){var i=new h,o=new Pr(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=0;for(r=0;r<e.length;++r)!function(r){o.load(e[r],function(e){i.images[r]=e,6==++a&&(i.needsUpdate=!0,t&&t(i))},void 0,n)}(r);return i},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(Nr.prototype,{load:function(e,t,r,i){var o=new Pr(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=new n;return a.image=o.load(e,function(){var r=0<e.search(/\.(jpg|jpeg)$/)||0===e.search(/^data\:image\/jpeg/);a.format=r?1022:1023,a.needsUpdate=!0,void 0!==t&&t(a)},r,i),a},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Lr.prototype=Object.assign(Object.create(oe.prototype),{constructor:Lr,isLight:!0,copy:function(e){return oe.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){return e=oe.prototype.toJSON.call(this,e),e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),Ir.prototype=Object.assign(Object.create(Lr.prototype),{constructor:Ir,isHemisphereLight:!0,copy:function(e){return Lr.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(Rr.prototype,{copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),kr.prototype=Object.assign(Object.create(Rr.prototype),{constructor:kr,isSpotLightShadow:!0,update:function(e){var t=this.camera,r=2*xi.RAD2DEG*e.angle,n=this.mapSize.width/this.mapSize.height;e=e.distance||t.far,r===t.fov&&n===t.aspect&&e===t.far||(t.fov=r,t.aspect=n,t.far=e,t.updateProjectionMatrix())}}),Dr.prototype=Object.assign(Object.create(Lr.prototype),{constructor:Dr,isSpotLight:!0,copy:function(e){return Lr.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Fr.prototype=Object.assign(Object.create(Lr.prototype),{constructor:Fr,isPointLight:!0,copy:function(e){return Lr.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),Vr.prototype=Object.assign(Object.create(Rr.prototype),{constructor:Vr}),Br.prototype=Object.assign(Object.create(Lr.prototype),{constructor:Br,isDirectionalLight:!0,copy:function(e){return Lr.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Ur.prototype=Object.assign(Object.create(Lr.prototype),{constructor:Ur,isAmbientLight:!0}),Gr.prototype=Object.assign(Object.create(Lr.prototype),{constructor:Gr,isRectAreaLight:!0,copy:function(e){return Lr.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){return e=Lr.prototype.toJSON.call(this,e),e.object.width=this.width,e.object.height=this.height,e}});var qi={arraySlice:function(e,t,r){return qi.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==r?r:e.length)):e.slice(t,r)},convertArray:function(e,t,r){return!e||!r&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,r=Array(t),n=0;n!==t;++n)r[n]=n;return r.sort(function(t,r){return e[t]-e[r]}),r},sortedArray:function(e,t,r){for(var n=e.length,i=new e.constructor(n),o=0,a=0;a!==n;++o)for(var s=r[o]*t,u=0;u!==t;++u)i[a++]=e[s+u];return i},flattenJSON:function(e,t,r,n){for(var i=1,o=e[0];void 0!==o&&void 0===o[n];)o=e[i++];if(void 0!==o){var a=o[n];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[n])&&(t.push(o.time),r.push.apply(r,a)),o=e[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[n])&&(t.push(o.time),a.toArray(r,r.length)),o=e[i++]}while(void 0!==o);else do{void 0!==(a=o[n])&&(t.push(o.time),r.push(a)),o=e[i++]}while(void 0!==o)}}};Object.assign(zr.prototype,{evaluate:function(e){var t=this.parameterPositions,r=this._cachedIndex,n=t[r],i=t[r-1];e:{t:{r:{n:if(!(e<n)){for(var o=r+2;;){if(void 0===n){if(e<i)break n;return this._cachedIndex=r=t.length,this.afterEnd_(r-1,e,i)}if(r===o)break;if(i=n,n=t[++r],e<n)break t}n=t.length;break r}if(e>=i)break e;for(e<(o=t[1])&&(r=2,i=o),o=r-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,n);if(r===o)break;if(n=i,i=t[--r-1],e>=i)break t}n=r,r=0}for(;r<n;)i=r+n>>>1,e<t[i]?n=i:r=i+1;if(n=t[r],void 0===(i=t[r-1]))return this._cachedIndex=0,this.beforeStart_(0,e,n);if(void 0===n)return this._cachedIndex=r=t.length,this.afterEnd_(r-1,i,e)}this._cachedIndex=r,this.intervalChanged_(r,i,n)}return this.interpolate_(r,i,e,n)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){var t=this.resultBuffer,r=this.sampleValues,n=this.valueSize;e*=n;for(var i=0;i!==n;++i)t[i]=r[e+i];return t},interpolate_:function(e,t,r,n){throw Error("call to abstract method")},intervalChanged_:function(e,t,r){}}),Object.assign(zr.prototype,{beforeStart_:zr.prototype.copySampleValue_,afterEnd_:zr.prototype.copySampleValue_}),qr.prototype=Object.assign(Object.create(zr.prototype),{constructor:qr,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(e,t,r){var n=this.parameterPositions,i=e-2,o=e+1,a=n[i],s=n[o];if(void 0===a)switch(this.getSettings_().endingStart){case 2401:i=e,a=2*t-r;break;case 2402:a=t+n[i=n.length-2]-n[i+1];break;default:i=e,a=r}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:o=e,s=2*r-t;break;case 2402:o=1,s=r+n[1]-n[0];break;default:o=e-1,s=t}e=.5*(r-t),n=this.valueSize,this._weightPrev=e/(t-a),this._weightNext=e/(s-r),this._offsetPrev=i*n,this._offsetNext=o*n},interpolate_:function(e,t,r,n){var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(e*=a)-a,u=this._offsetPrev,c=this._offsetNext,l=this._weightPrev,h=this._weightNext,p=(r-t)/(n-t);for(t=-l*(n=(r=p*p)*p)+2*l*r-l*p,l=(1+l)*n+(-1.5-2*l)*r+(-.5+l)*p+1,p=(-1-h)*n+(1.5+h)*r+.5*p,h=h*n-h*r,r=0;r!==a;++r)i[r]=t*o[u+r]+l*o[s+r]+p*o[e+r]+h*o[c+r];return i}}),$r.prototype=Object.assign(Object.create(zr.prototype),{constructor:$r,interpolate_:function(e,t,r,n){var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(e*=a)-a;for(r=1-(t=(r-t)/(n-t)),n=0;n!==a;++n)i[n]=o[s+n]*r+o[e+n]*t;return i}}),Hr.prototype=Object.assign(Object.create(zr.prototype),{constructor:Hr,interpolate_:function(e,t,r,n){return this.copySampleValue_(e-1)}});var $i;$i={TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(e){return new Hr(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new $r(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new qr(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){if(t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name,void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw Error(t);this.setInterpolation(this.DefaultInterpolation)}console.warn("THREE.KeyframeTrackPrototype:",t)}else this.createInterpolant=t},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,r=0,n=t.length;r!==n;++r)t[r]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,r=0,n=t.length;r!==n;++r)t[r]*=e;return this},trim:function(e,t){for(var r=this.times,n=r.length,i=0,o=n-1;i!==n&&r[i]<e;)++i;for(;-1!==o&&r[o]>t;)--o;return++o,0===i&&o===n||(i>=o&&(o=Math.max(o,1),i=o-1),n=this.getValueSize(),this.times=qi.arraySlice(r,i,o),this.values=qi.arraySlice(this.values,i*n,o*n)),this},validate:function(){var e=!0;0!=(r=this.getValueSize())-Math.floor(r)&&(console.error("THREE.KeyframeTrackPrototype: Invalid value size in track.",this),e=!1);var t=this.times,r=this.values,n=t.length;0===n&&(console.error("THREE.KeyframeTrackPrototype: Track is empty.",this),e=!1);for(var i=null,o=0;o!==n;o++){var a=t[o];if("number"==typeof a&&isNaN(a)){console.error("THREE.KeyframeTrackPrototype: Time is not a valid number.",this,o,a),e=!1;break}if(null!==i&&i>a){console.error("THREE.KeyframeTrackPrototype: Out of order keys.",this,o,a,i),e=!1;break}i=a}if(void 0!==r&&qi.isTypedArray(r))for(o=0,t=r.length;o!==t;++o)if(n=r[o],isNaN(n)){console.error("THREE.KeyframeTrackPrototype: Value is not a valid number.",this,o,n),e=!1;break}return e},optimize:function(){for(var e=this.times,t=this.values,r=this.getValueSize(),n=2302===this.getInterpolation(),i=1,o=e.length-1,a=1;a<o;++a){var s=!1;if((h=e[a])!==e[a+1]&&(1!==a||h!==h[0]))if(n)s=!0;else for(var u=a*r,c=u-r,l=u+r,h=0;h!==r;++h){var p=t[u+h];if(p!==t[c+h]||p!==t[l+h]){s=!0;break}}if(s){if(a!==i)for(e[i]=e[a],s=a*r,u=i*r,h=0;h!==r;++h)t[u+h]=t[s+h];++i}}if(0<o){for(e[i]=e[o],s=o*r,u=i*r,h=0;h!==r;++h)t[u+h]=t[s+h];++i}return i!==e.length&&(this.times=qi.arraySlice(e,0,i),this.values=qi.arraySlice(t,0,i*r)),this}},Qr.prototype=Object.assign(Object.create($i),{constructor:Qr,ValueTypeName:"vector"}),Kr.prototype=Object.assign(Object.create(zr.prototype),{constructor:Kr,interpolate_:function(e,t,r,n){var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize;for(t=(r-t)/(n-t),r=(e*=a)+a;e!==r;e+=4)s.slerpFlat(i,0,o,e-a,o,e,t);return i}}),Xr.prototype=Object.assign(Object.create($i),{constructor:Xr,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new Kr(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),Yr.prototype=Object.assign(Object.create($i),{constructor:Yr,ValueTypeName:"number"}),Zr.prototype=Object.assign(Object.create($i),{constructor:Zr,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Jr.prototype=Object.assign(Object.create($i),{constructor:Jr,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),en.prototype=Object.assign(Object.create($i),{constructor:en,ValueTypeName:"color"}),tn.prototype=$i,$i.constructor=tn,Object.assign(tn,{parse:function(e){if(void 0===e.type)throw Error("track type undefined, can not parse");var t=tn._getTrackTypeForValueTypeName(e.type);if(void 0===e.times){var r=[],n=[];qi.flattenJSON(e.keys,r,n,"value"),e.times=r,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)},toJSON:function(e){if(void 0!==(t=e.constructor).toJSON)t=t.toJSON(e);else{var t={name:e.name,times:qi.convertArray(e.times,Array),values:qi.convertArray(e.values,Array)},r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t},_getTrackTypeForValueTypeName:function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Yr;case"vector":case"vector2":case"vector3":case"vector4":return Qr;case"color":return en;case"quaternion":return Xr;case"bool":case"boolean":return Jr;case"string":return Zr}throw Error("Unsupported typeName: "+e)}}),Object.assign(rn,{parse:function(e){for(var t=[],r=e.tracks,n=1/(e.fps||1),i=0,o=r.length;i!==o;++i)t.push(tn.parse(r[i]).scale(n));return new rn(e.name,e.duration,t)},toJSON:function(e){var t=[],r=e.tracks;e={name:e.name,duration:e.duration,tracks:t};for(var n=0,i=r.length;n!==i;++n)t.push(tn.toJSON(r[n]));return e},CreateFromMorphTargetSequence:function(e,t,r,n){for(var i=t.length,o=[],a=0;a<i;a++){c=[];(u=[]).push((a+i-1)%i,a,(a+1)%i),c.push(0,1,0);var s=qi.getKeyframeOrder(u),u=qi.sortedArray(u,1,s),c=qi.sortedArray(c,1,s);n||0!==u[0]||(u.push(i),c.push(c[0])),o.push(new Yr(".morphTargetInfluences["+t[a].name+"]",u,c).scale(1/r))}return new rn(e,-1,o)},findByName:function(e,t){var r=e;Array.isArray(e)||(r=e.geometry&&e.geometry.animations||e.animations);for(var n=0;n<r.length;n++)if(r[n].name===t)return r[n];return null},CreateClipsFromMorphTargetSequences:function(e,t,r){for(var n={},i=/^([\w-]*?)([\d]+)$/,o=0,a=e.length;o<a;o++){var s=e[o],u=s.name.match(i);if(u&&1<u.length){var c=u[1];(u=n[c])||(n[c]=u=[]),u.push(s)}}e=[];for(c in n)e.push(rn.CreateFromMorphTargetSequence(c,n[c],t,r));return e},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var r=function(e,t,r,n,i){if(0!==r.length){var o=[],a=[];qi.flattenJSON(r,o,a,n),0!==o.length&&i.push(new e(t,o,a))}},n=[],i=e.name||"default",o=e.length||-1,a=e.fps||30,s=e.hierarchy||[],u=0;u<s.length;u++){var c=s[u].keys;if(c&&0!==c.length)if(c[0].morphTargets){for(var o={},l=0;l<c.length;l++)if(c[l].morphTargets)for(d=0;d<c[l].morphTargets.length;d++)o[c[l].morphTargets[d]]=-1;for(var h in o){for(var p=[],f=[],d=0;d!==c[l].morphTargets.length;++d){var m=c[l];p.push(m.time),f.push(m.morphTarget===h?1:0)}n.push(new Yr(".morphTargetInfluence["+h+"]",p,f))}o=o.length*(a||1)}else l=".bones["+t[u].name+"]",r(Qr,l+".position",c,"pos",n),r(Xr,l+".quaternion",c,"rot",n),r(Qr,l+".scale",c,"scl",n)}return 0===n.length?null:new rn(i,o,n)}}),Object.assign(rn.prototype,{resetDuration:function(){for(var e=0,t=0,r=this.tracks.length;t!==r;++t)var n=this.tracks[t],e=Math.max(e,n.times[n.times.length-1]);this.duration=e},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}}),Object.assign(nn.prototype,{load:function(e,t,r,n){var i=this;new Mr(i.manager).load(e,function(e){t(i.parse(JSON.parse(e)))},r,n)},setTextures:function(e){this.textures=e},parse:function(e){function t(e){return void 0===n[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),n[e]}var n=this.textures,i=new Ui[e.type];if(void 0!==e.uuid&&(i.uuid=e.uuid),void 0!==e.name&&(i.name=e.name),void 0!==e.color&&i.color.setHex(e.color),void 0!==e.roughness&&(i.roughness=e.roughness),void 0!==e.metalness&&(i.metalness=e.metalness),void 0!==e.emissive&&i.emissive.setHex(e.emissive),void 0!==e.specular&&i.specular.setHex(e.specular),void 0!==e.shininess&&(i.shininess=e.shininess),void 0!==e.clearCoat&&(i.clearCoat=e.clearCoat),void 0!==e.clearCoatRoughness&&(i.clearCoatRoughness=e.clearCoatRoughness),void 0!==e.uniforms&&(i.uniforms=e.uniforms),void 0!==e.vertexShader&&(i.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(i.fragmentShader=e.fragmentShader),void 0!==e.vertexColors&&(i.vertexColors=e.vertexColors),void 0!==e.fog&&(i.fog=e.fog),void 0!==e.shading&&(i.shading=e.shading),void 0!==e.blending&&(i.blending=e.blending),void 0!==e.side&&(i.side=e.side),void 0!==e.opacity&&(i.opacity=e.opacity),void 0!==e.transparent&&(i.transparent=e.transparent),void 0!==e.alphaTest&&(i.alphaTest=e.alphaTest),void 0!==e.depthTest&&(i.depthTest=e.depthTest),void 0!==e.depthWrite&&(i.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(i.colorWrite=e.colorWrite),void 0!==e.wireframe&&(i.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(i.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(i.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(i.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.skinning&&(i.skinning=e.skinning),void 0!==e.morphTargets&&(i.morphTargets=e.morphTargets),void 0!==e.size&&(i.size=e.size),void 0!==e.sizeAttenuation&&(i.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(i.map=t(e.map)),void 0!==e.alphaMap&&(i.alphaMap=t(e.alphaMap),i.transparent=!0),void 0!==e.bumpMap&&(i.bumpMap=t(e.bumpMap)),void 0!==e.bumpScale&&(i.bumpScale=e.bumpScale),void 0!==e.normalMap&&(i.normalMap=t(e.normalMap)),void 0!==e.normalScale){var o=e.normalScale;!1===Array.isArray(o)&&(o=[o,o]),i.normalScale=(new r).fromArray(o)}return void 0!==e.displacementMap&&(i.displacementMap=t(e.displacementMap)),void 0!==e.displacementScale&&(i.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(i.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(i.roughnessMap=t(e.roughnessMap)),void 0!==e.metalnessMap&&(i.metalnessMap=t(e.metalnessMap)),void 0!==e.emissiveMap&&(i.emissiveMap=t(e.emissiveMap)),void 0!==e.emissiveIntensity&&(i.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(i.specularMap=t(e.specularMap)),void 0!==e.envMap&&(i.envMap=t(e.envMap)),void 0!==e.reflectivity&&(i.reflectivity=e.reflectivity),void 0!==e.lightMap&&(i.lightMap=t(e.lightMap)),void 0!==e.lightMapIntensity&&(i.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(i.aoMap=t(e.aoMap)),void 0!==e.aoMapIntensity&&(i.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(i.gradientMap=t(e.gradientMap)),i}}),Object.assign(on.prototype,{load:function(e,t,r,n){var i=this;new Mr(i.manager).load(e,function(e){t(i.parse(JSON.parse(e)))},r,n)},parse:function(e){var t=new Se;void 0!==(o=e.data.index)&&(o=new Hi[o.type](o.array),t.setIndex(new he(o,1)));var r,n=e.data.attributes;for(r in n){var i=n[r],o=new Hi[i.type](i.array);t.addAttribute(r,new he(o,i.itemSize,i.normalized))}if(void 0!==(r=e.data.groups||e.data.drawcalls||e.data.offsets))for(o=0,n=r.length;o!==n;++o)i=r[o],t.addGroup(i.start,i.count,i.materialIndex);return void 0!==(e=e.data.boundingSphere)&&(r=new u,void 0!==e.center&&r.fromArray(e.center),t.boundingSphere=new Y(r,e.radius)),t}});var Hi={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};an.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=this.handlers,r=0,n=t.length;r<n;r+=2){var i=t[r+1];if(t[r].test(e))return i}return null}},Object.assign(an.prototype,{crossOrigin:void 0,extractUrlBase:function(e){return 1===(e=e.split("/")).length?"./":(e.pop(),e.join("/")+"/")},initMaterials:function(e,t,r){for(var n=[],i=0;i<e.length;++i)n[i]=this.createMaterial(e[i],t,r);return n},createMaterial:function(){var e={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},t=new z,r=new Nr,n=new nn;return function(i,o,a){function s(e,t,n,i,s){e=o+e;var u=an.Handlers.get(e);return null!==u?e=u.load(e):(r.setCrossOrigin(a),e=r.load(e)),void 0!==t&&(e.repeat.fromArray(t),1!==t[0]&&(e.wrapS=1e3),1!==t[1]&&(e.wrapT=1e3)),void 0!==n&&e.offset.fromArray(n),void 0!==i&&("repeat"===i[0]&&(e.wrapS=1e3),"mirror"===i[0]&&(e.wrapS=1002),"repeat"===i[1]&&(e.wrapT=1e3),"mirror"===i[1]&&(e.wrapT=1002)),void 0!==s&&(e.anisotropy=s),t=xi.generateUUID(),c[t]=e,t}var u,c={},l={uuid:xi.generateUUID(),type:"MeshLambertMaterial"};for(u in i){var h=i[u];switch(u){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":l.name=h;break;case"blending":l.blending=e[h];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",u,"is no longer supported.");break;case"colorDiffuse":l.color=t.fromArray(h).getHex();break;case"colorSpecular":l.specular=t.fromArray(h).getHex();break;case"colorEmissive":l.emissive=t.fromArray(h).getHex();break;case"specularCoef":l.shininess=h;break;case"shading":"basic"===h.toLowerCase()&&(l.type="MeshBasicMaterial"),"phong"===h.toLowerCase()&&(l.type="MeshPhongMaterial"),"standard"===h.toLowerCase()&&(l.type="MeshStandardMaterial");break;case"mapDiffuse":l.map=s(h,i.mapDiffuseRepeat,i.mapDiffuseOffset,i.mapDiffuseWrap,i.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":l.emissiveMap=s(h,i.mapEmissiveRepeat,i.mapEmissiveOffset,i.mapEmissiveWrap,i.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":l.lightMap=s(h,i.mapLightRepeat,i.mapLightOffset,i.mapLightWrap,i.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":l.aoMap=s(h,i.mapAORepeat,i.mapAOOffset,i.mapAOWrap,i.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":l.bumpMap=s(h,i.mapBumpRepeat,i.mapBumpOffset,i.mapBumpWrap,i.mapBumpAnisotropy);break;case"mapBumpScale":l.bumpScale=h;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":l.normalMap=s(h,i.mapNormalRepeat,i.mapNormalOffset,i.mapNormalWrap,i.mapNormalAnisotropy);break;case"mapNormalFactor":l.normalScale=[h,h];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":l.specularMap=s(h,i.mapSpecularRepeat,i.mapSpecularOffset,i.mapSpecularWrap,i.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":l.metalnessMap=s(h,i.mapMetalnessRepeat,i.mapMetalnessOffset,i.mapMetalnessWrap,i.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":l.roughnessMap=s(h,i.mapRoughnessRepeat,i.mapRoughnessOffset,i.mapRoughnessWrap,i.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":l.alphaMap=s(h,i.mapAlphaRepeat,i.mapAlphaOffset,i.mapAlphaWrap,i.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":l.side=1;break;case"doubleSided":l.side=2;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),l.opacity=h;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":l[u]=h;break;case"vertexColors":!0===h&&(l.vertexColors=2),"face"===h&&(l.vertexColors=1);break;default:console.error("THREE.Loader.createMaterial: Unsupported",u,h)}}return"MeshBasicMaterial"===l.type&&delete l.emissive,"MeshPhongMaterial"!==l.type&&delete l.specular,1>l.opacity&&(l.transparent=!0),n.setTextures(c),n.parse(l)}}()}),Object.assign(sn.prototype,{load:function(e,t,r,n){var i=this,o=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:an.prototype.extractUrlBase(e),a=new Mr(this.manager);a.setWithCredentials(this.withCredentials),a.load(e,function(r){var n=(r=JSON.parse(r)).metadata;if(void 0!==n&&void 0!==(n=n.type)){if("object"===n.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.ObjectLoader instead.");if("scene"===n.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.SceneLoader instead.")}r=i.parse(r,o),t(r.geometry,r.materials)},r,n)},setTexturePath:function(e){this.texturePath=e},parse:function(e,t){void 0!==e.data&&(e=e.data),e.scale=void 0!==e.scale?1/e.scale:1;var n,o,a,s,c,l,h,p,f,d,m,v,y,g,b=new le,_=e,x=_.faces;f=_.vertices;var w=_.normals,S=_.colors;l=_.scale;var T=0;if(void 0!==_.uvs){for(n=0;n<_.uvs.length;n++)_.uvs[n].length&&T++;for(n=0;n<T;n++)b.faceVertexUvs[n]=[]}for(s=0,c=f.length;s<c;)n=new u,n.x=f[s++]*l,n.y=f[s++]*l,n.z=f[s++]*l,b.vertices.push(n);for(s=0,c=x.length;s<c;)if(f=x[s++],d=1&f,a=2&f,n=8&f,h=16&f,m=32&f,l=64&f,f&=128,d){if(d=new ce,d.a=x[s],d.b=x[s+1],d.c=x[s+3],v=new ce,v.a=x[s+1],v.b=x[s+2],v.c=x[s+3],s+=4,a&&(a=x[s++],d.materialIndex=a,v.materialIndex=a),a=b.faces.length,n)for(n=0;n<T;n++)for(y=_.uvs[n],b.faceVertexUvs[n][a]=[],b.faceVertexUvs[n][a+1]=[],o=0;4>o;o++)p=x[s++],g=y[2*p],p=y[2*p+1],g=new r(g,p),2!==o&&b.faceVertexUvs[n][a].push(g),0!==o&&b.faceVertexUvs[n][a+1].push(g);if(h&&(h=3*x[s++],d.normal.set(w[h++],w[h++],w[h]),v.normal.copy(d.normal)),m)for(n=0;4>n;n++)h=3*x[s++],m=new u(w[h++],w[h++],w[h]),2!==n&&d.vertexNormals.push(m),0!==n&&v.vertexNormals.push(m);if(l&&(l=x[s++],l=S[l],d.color.setHex(l),v.color.setHex(l)),f)for(n=0;4>n;n++)l=x[s++],l=S[l],2!==n&&d.vertexColors.push(new z(l)),0!==n&&v.vertexColors.push(new z(l));b.faces.push(d),b.faces.push(v)}else{if(d=new ce,d.a=x[s++],d.b=x[s++],d.c=x[s++],a&&(a=x[s++],d.materialIndex=a),a=b.faces.length,n)for(n=0;n<T;n++)for(y=_.uvs[n],b.faceVertexUvs[n][a]=[],o=0;3>o;o++)p=x[s++],g=y[2*p],p=y[2*p+1],g=new r(g,p),b.faceVertexUvs[n][a].push(g);if(h&&(h=3*x[s++],d.normal.set(w[h++],w[h++],w[h])),m)for(n=0;3>n;n++)h=3*x[s++],m=new u(w[h++],w[h++],w[h]),d.vertexNormals.push(m);if(l&&(l=x[s++],d.color.setHex(S[l])),f)for(n=0;3>n;n++)l=x[s++],d.vertexColors.push(new z(S[l]));b.faces.push(d)}if(_=e,s=void 0!==_.influencesPerVertex?_.influencesPerVertex:2,_.skinWeights)for(c=0,x=_.skinWeights.length;c<x;c+=s)b.skinWeights.push(new i(_.skinWeights[c],1<s?_.skinWeights[c+1]:0,2<s?_.skinWeights[c+2]:0,3<s?_.skinWeights[c+3]:0));if(_.skinIndices)for(c=0,x=_.skinIndices.length;c<x;c+=s)b.skinIndices.push(new i(_.skinIndices[c],1<s?_.skinIndices[c+1]:0,2<s?_.skinIndices[c+2]:0,3<s?_.skinIndices[c+3]:0));if(b.bones=_.bones,b.bones&&0<b.bones.length&&(b.skinWeights.length!==b.skinIndices.length||b.skinIndices.length!==b.vertices.length)&&console.warn("When skinning, number of vertices ("+b.vertices.length+"), skinIndices ("+b.skinIndices.length+"), and skinWeights ("+b.skinWeights.length+") should match."),c=e,x=c.scale,void 0!==c.morphTargets)for(_=0,s=c.morphTargets.length;_<s;_++)for(b.morphTargets[_]={},b.morphTargets[_].name=c.morphTargets[_].name,b.morphTargets[_].vertices=[],w=b.morphTargets[_].vertices,S=c.morphTargets[_].vertices,T=0,f=S.length;T<f;T+=3)l=new u,l.x=S[T]*x,l.y=S[T+1]*x,l.z=S[T+2]*x,w.push(l);if(void 0!==c.morphColors&&0<c.morphColors.length)for(console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'),x=b.faces,c=c.morphColors[0].colors,_=0,s=x.length;_<s;_++)x[_].color.fromArray(c,3*_);for(_=[],s=[],void 0!==(c=e).animation&&s.push(c.animation),void 0!==c.animations&&(c.animations.length?s=s.concat(c.animations):s.push(c.animations)),c=0;c<s.length;c++)(x=rn.parseAnimation(s[c],b.bones))&&_.push(x);return b.morphTargets&&(s=rn.CreateClipsFromMorphTargetSequences(b.morphTargets,10),_=_.concat(s)),0<_.length&&(b.animations=_),b.computeFaceNormals(),b.computeBoundingSphere(),void 0===e.materials||0===e.materials.length?{geometry:b}:(_=an.prototype.initMaterials(e.materials,t,this.crossOrigin),{geometry:b,materials:_})}}),Object.assign(un.prototype,{load:function(e,t,r,n){""===this.texturePath&&(this.texturePath=e.substring(0,e.lastIndexOf("/")+1));var i=this;new Mr(i.manager).load(e,function(r){var o=null;try{o=JSON.parse(r)}catch(t){return void 0!==n&&n(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}void 0===(r=o.metadata)||void 0===r.type||"geometry"===r.type.toLowerCase()?console.error("THREE.ObjectLoader: Can't load "+e+". Use THREE.JSONLoader instead."):i.parse(o,t)},r,n)},setTexturePath:function(e){this.texturePath=e},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){var r=this.parseGeometries(e.geometries),n=this.parseImages(e.images,function(){void 0!==t&&t(i)}),n=this.parseTextures(e.textures,n),n=this.parseMaterials(e.materials,n),i=this.parseObject(e.object,r,n);return e.animations&&(i.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0===t||t(i),i},parseGeometries:function(e){var t={};if(void 0!==e)for(var r=new sn,n=new on,i=0,o=e.length;i<o;i++){var a,s=e[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":a=new Bi[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":a=new Bi[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":a=new Bi[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":a=new Bi[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":a=new Bi[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":a=new Bi[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"IcosahedronGeometry":case"OctahedronGeometry":case"TetrahedronGeometry":a=new Bi[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":a=new Bi[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":a=new Bi[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":a=new Bi[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"LatheGeometry":case"LatheBufferGeometry":a=new Bi[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"BufferGeometry":a=n.parse(s);break;case"Geometry":a=r.parse(s,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),t[s.uuid]=a}return t},parseMaterials:function(e,t){var r={};if(void 0!==e){var n=new nn;n.setTextures(t);for(var i=0,o=e.length;i<o;i++){var a=e[i];if("MultiMaterial"===a.type){for(var s=[],u=0;u<a.materials.length;u++)s.push(n.parse(a.materials[u]));r[a.uuid]=s}else r[a.uuid]=n.parse(a)}}return r},parseAnimations:function(e){for(var t=[],r=0;r<e.length;r++){var n=rn.parse(e[r]);t.push(n)}return t},parseImages:function(e,t){var r=this,n={};if(void 0!==e&&0<e.length){var i=new Pr(o=new Or(t));i.setCrossOrigin(this.crossOrigin);for(var o=0,a=e.length;o<a;o++){var s=e[o],u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(s.url)?s.url:r.texturePath+s.url;n[s.uuid]=function(e){return r.manager.itemStart(e),i.load(e,function(){r.manager.itemEnd(e)},void 0,function(){r.manager.itemEnd(e),r.manager.itemError(e)})}(u)}}return n},parseTextures:function(e,t){function r(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var i={};if(void 0!==e)for(var o=0,a=e.length;o<a;o++){var s=e[o];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);var u=new n(t[s.image]);u.needsUpdate=!0,u.uuid=s.uuid,void 0!==s.name&&(u.name=s.name),void 0!==s.mapping&&(u.mapping=r(s.mapping,Wi)),void 0!==s.offset&&u.offset.fromArray(s.offset),void 0!==s.repeat&&u.repeat.fromArray(s.repeat),void 0!==s.wrap&&(u.wrapS=r(s.wrap[0],Qi),u.wrapT=r(s.wrap[1],Qi)),void 0!==s.minFilter&&(u.minFilter=r(s.minFilter,Ki)),void 0!==s.magFilter&&(u.magFilter=r(s.magFilter,Ki)),void 0!==s.anisotropy&&(u.anisotropy=s.anisotropy),void 0!==s.flipY&&(u.flipY=s.flipY),i[s.uuid]=u}return i},parseObject:function(){var e=new c;return function(t,r,n){function i(e){return void 0===r[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),r[e]}function o(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],r=0,i=e.length;r<i;r++){var o=e[r];void 0===n[o]&&console.warn("THREE.ObjectLoader: Undefined material",o),t.push(n[o])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}var a;switch(t.type){case"Scene":a=new dt,void 0!==t.background&&Number.isInteger(t.background)&&(a.background=new z(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?a.fog=new ft(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(a.fog=new pt(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":a=new ue(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(a.focus=t.focus),void 0!==t.zoom&&(a.zoom=t.zoom),void 0!==t.filmGauge&&(a.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(a.filmOffset=t.filmOffset),void 0!==t.view&&(a.view=Object.assign({},t.view));break;case"OrthographicCamera":a=new se(t.left,t.right,t.top,t.bottom,t.near,t.far);break;case"AmbientLight":a=new Ur(t.color,t.intensity);break;case"DirectionalLight":a=new Br(t.color,t.intensity);break;case"PointLight":a=new Fr(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":a=new Gr(t.color,t.intensity,t.width,t.height);break;case"SpotLight":a=new Dr(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":a=new Ir(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":a=i(t.geometry);var s=o(t.material);a=a.bones&&0<a.bones.length?new xt(a,s):new Ne(a,s);break;case"LOD":a=new gt;break;case"Line":a=new St(i(t.geometry),o(t.material),t.mode);break;case"LineLoop":a=new Et(i(t.geometry),o(t.material));break;case"LineSegments":a=new Tt(i(t.geometry),o(t.material));break;case"PointCloud":case"Points":a=new Mt(i(t.geometry),o(t.material));break;case"Sprite":a=new yt(o(t.material));break;case"Group":a=new Ct;break;default:a=new oe}if(a.uuid=t.uuid,void 0!==t.name&&(a.name=t.name),void 0!==t.matrix?(e.fromArray(t.matrix),e.decompose(a.position,a.quaternion,a.scale)):(void 0!==t.position&&a.position.fromArray(t.position),void 0!==t.rotation&&a.rotation.fromArray(t.rotation),void 0!==t.quaternion&&a.quaternion.fromArray(t.quaternion),void 0!==t.scale&&a.scale.fromArray(t.scale)),void 0!==t.castShadow&&(a.castShadow=t.castShadow),void 0!==t.receiveShadow&&(a.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(a.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(a.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&a.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(a.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(a.visible=t.visible),void 0!==t.userData&&(a.userData=t.userData),void 0!==t.children)for(var u in t.children)a.add(this.parseObject(t.children[u],r,n));if("LOD"===t.type)for(t=t.levels,s=0;s<t.length;s++){var c=t[s];void 0!==(u=a.getObjectByProperty("uuid",c.object))&&a.addLevel(u,c.distance)}return a}}()});var Wi={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},Qi={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},Ki={NearestFilter:1003,NearestMipMapNearestFilter:1004,NearestMipMapLinearFilter:1005,LinearFilter:1006,LinearMipMapNearestFilter:1007,LinearMipMapLinearFilter:1008};Object.assign(pn.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e){return e=this.getUtoTmapping(e),this.getPoint(e)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],r=0;r<=e;r++)t.push(this.getPoint(r/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,r,n=[],i=this.getPoint(0),o=0;for(n.push(0),r=1;r<=e;r++)t=this.getPoint(r/e),o+=t.distanceTo(i),n.push(o),i=t;return this.cacheArcLengths=n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var r,n,i=this.getLengths(),o=i.length;n=t||e*i[o-1];for(var a,s=0,u=o-1;s<=u;)if(r=Math.floor(s+(u-s)/2),0>(a=i[r]-n))s=r+1;else{if(!(0<a)){u=r;break}u=r-1}return r=u,i[r]===n?r/(o-1):(s=i[r],(r+(n-s)/(i[r+1]-s))/(o-1))},getTangent:function(e){var t=e-1e-4;return e+=1e-4,0>t&&(t=0),1<e&&(e=1),t=this.getPoint(t),this.getPoint(e).clone().sub(t).normalize()},getTangentAt:function(e){return e=this.getUtoTmapping(e),this.getTangent(e)},computeFrenetFrames:function(e,t){var r,n,i=new u,o=[],a=[],s=[],l=new u,h=new c;for(r=0;r<=e;r++)n=r/e,o[r]=this.getTangentAt(n),o[r].normalize();a[0]=new u,s[0]=new u,r=Number.MAX_VALUE,n=Math.abs(o[0].x);var p=Math.abs(o[0].y),f=Math.abs(o[0].z);for(n<=r&&(r=n,i.set(1,0,0)),p<=r&&(r=p,i.set(0,1,0)),f<=r&&i.set(0,0,1),l.crossVectors(o[0],i).normalize(),a[0].crossVectors(o[0],l),s[0].crossVectors(o[0],a[0]),r=1;r<=e;r++)a[r]=a[r-1].clone(),s[r]=s[r-1].clone(),l.crossVectors(o[r-1],o[r]),l.length()>Number.EPSILON&&(l.normalize(),i=Math.acos(xi.clamp(o[r-1].dot(o[r]),-1,1)),a[r].applyMatrix4(h.makeRotationAxis(l,i))),s[r].crossVectors(o[r],a[r]);if(!0===t)for(i=Math.acos(xi.clamp(a[0].dot(a[e]),-1,1)),i/=e,0<o[0].dot(l.crossVectors(a[0],a[e]))&&(i=-i),r=1;r<=e;r++)a[r].applyMatrix4(h.makeRotationAxis(o[r],i*r)),s[r].crossVectors(o[r],a[r]);return{tangents:o,normals:a,binormals:s}}}),(fn.prototype=Object.create(pn.prototype)).constructor=fn,fn.prototype.isLineCurve=!0,fn.prototype.getPoint=function(e){if(1===e)return this.v2.clone();var t=this.v2.clone().sub(this.v1);return t.multiplyScalar(e).add(this.v1),t},fn.prototype.getPointAt=function(e){return this.getPoint(e)},fn.prototype.getTangent=function(e){return this.v2.clone().sub(this.v1).normalize()},dn.prototype=Object.assign(Object.create(pn.prototype),{constructor:dn,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new fn(t,e))},getPoint:function(e){var t=e*this.getLength(),r=this.getCurveLengths();for(e=0;e<r.length;){if(r[e]>=t)return t=r[e]-t,e=this.curves[e],r=e.getLength(),e.getPointAt(0===r?0:1-t/r);e++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,r=0,n=this.curves.length;r<n;r++)t+=this.curves[r].getLength(),e.push(t);return this.cacheLengths=e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],r=0;r<=e;r++)t.push(this.getPoint(r/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,r=[],n=0,i=this.curves;n<i.length;n++)for(var o=i[n],o=o.getPoints(o&&o.isEllipseCurve?2*e:o&&o.isLineCurve?1:o&&o.isSplineCurve?e*o.points.length:e),a=0;a<o.length;a++){var s=o[a];t&&t.equals(s)||(r.push(s),t=s)}return this.autoClose&&1<r.length&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r},createPointsGeometry:function(e){return e=this.getPoints(e),this.createGeometry(e)},createSpacedPointsGeometry:function(e){return e=this.getSpacedPoints(e),this.createGeometry(e)},createGeometry:function(e){for(var t=new le,r=0,n=e.length;r<n;r++){var i=e[r];t.vertices.push(new u(i.x,i.y,i.z||0))}return t}}),mn.prototype=Object.create(pn.prototype),mn.prototype.constructor=mn,mn.prototype.isEllipseCurve=!0,mn.prototype.getPoint=function(e){for(var t=2*Math.PI,n=this.aEndAngle-this.aStartAngle,i=Math.abs(n)<Number.EPSILON;0>n;)n+=t;for(;n>t;)n-=t;n<Number.EPSILON&&(n=i?0:t),!0!==this.aClockwise||i||(n=n===t?-t:n-t),t=this.aStartAngle+e*n,e=this.aX+this.xRadius*Math.cos(t);var o=this.aY+this.yRadius*Math.sin(t);return 0!==this.aRotation&&(t=Math.cos(this.aRotation),n=Math.sin(this.aRotation),i=e-this.aX,o-=this.aY,e=i*t-o*n+this.aX,o=i*n+o*t+this.aY),new r(e,o)},(vn.prototype=Object.create(pn.prototype)).constructor=vn,vn.prototype.isSplineCurve=!0,vn.prototype.getPoint=function(e){var t=(t=((a=this.points).length-1)*e)-(e=Math.floor(t)),n=a[0===e?e:e-1],i=a[e],o=a[e>a.length-2?a.length-1:e+1],a=a[e>a.length-3?a.length-1:e+2];return new r(cn(t,n.x,i.x,o.x,a.x),cn(t,n.y,i.y,o.y,a.y))},(yn.prototype=Object.create(pn.prototype)).constructor=yn,yn.prototype.getPoint=function(e){var t=this.v0,n=this.v1,i=this.v2,o=this.v3;return new r(hn(e,t.x,n.x,i.x,o.x),hn(e,t.y,n.y,i.y,o.y))},(gn.prototype=Object.create(pn.prototype)).constructor=gn,gn.prototype.getPoint=function(e){var t=this.v0,n=this.v1,i=this.v2;return new r(ln(e,t.x,n.x,i.x),ln(e,t.y,n.y,i.y))};var Xi=Object.assign(Object.create(dn.prototype),{fromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,r=e.length;t<r;t++)this.lineTo(e[t].x,e[t].y)},moveTo:function(e,t){this.currentPoint.set(e,t)},lineTo:function(e,t){var n=new fn(this.currentPoint.clone(),new r(e,t));this.curves.push(n),this.currentPoint.set(e,t)},quadraticCurveTo:function(e,t,n,i){e=new gn(this.currentPoint.clone(),new r(e,t),new r(n,i)),this.curves.push(e),this.currentPoint.set(n,i)},bezierCurveTo:function(e,t,n,i,o,a){e=new yn(this.currentPoint.clone(),new r(e,t),new r(n,i),new r(o,a)),this.curves.push(e),this.currentPoint.set(o,a)},splineThru:function(e){var t=new vn(t=[this.currentPoint.clone()].concat(e));this.curves.push(t),this.currentPoint.copy(e[e.length-1])},arc:function(e,t,r,n,i,o){this.absarc(e+this.currentPoint.x,t+this.currentPoint.y,r,n,i,o)},absarc:function(e,t,r,n,i,o){this.absellipse(e,t,r,r,n,i,o)},ellipse:function(e,t,r,n,i,o,a,s){this.absellipse(e+this.currentPoint.x,t+this.currentPoint.y,r,n,i,o,a,s)},absellipse:function(e,t,r,n,i,o,a,s){e=new mn(e,t,r,n,i,o,a,s),0<this.curves.length&&((t=e.getPoint(0)).equals(this.currentPoint)||this.lineTo(t.x,t.y)),this.curves.push(e),e=e.getPoint(1),this.currentPoint.copy(e)}});bn.prototype=Xi,Xi.constructor=bn,_n.prototype=Object.assign(Object.create(Xi),{constructor:_n,getPointsHoles:function(e){for(var t=[],r=0,n=this.holes.length;r<n;r++)t[r]=this.holes[r].getPoints(e);return t},extractAllPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},extractPoints:function(e){return this.extractAllPoints(e)}}),Object.assign(xn.prototype,{moveTo:function(e,t){this.currentPath=new bn,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t)},lineTo:function(e,t){this.currentPath.lineTo(e,t)},quadraticCurveTo:function(e,t,r,n){this.currentPath.quadraticCurveTo(e,t,r,n)},bezierCurveTo:function(e,t,r,n,i,o){this.currentPath.bezierCurveTo(e,t,r,n,i,o)},splineThru:function(e){this.currentPath.splineThru(e)},toShapes:function(e,t){function r(e){for(var t=[],r=0,n=e.length;r<n;r++){var i=e[r],o=new _n;o.curves=i.curves,t.push(o)}return t}var n=Vi.isClockWise,i=this.subPaths;if(0===i.length)return[];if(!0===t)return r(i);var o,a,s,u=[];if(1===i.length)return a=i[0],s=new _n,s.curves=a.curves,u.push(s),u;var c=!n(i[0].getPoints()),c=e?!c:c;s=[];var l,h=[],p=[],f=0;h[f]=void 0,p[f]=[];for(var d=0,m=i.length;d<m;d++)a=i[d],l=a.getPoints(),o=n(l),(o=e?!o:o)?(!c&&h[f]&&f++,h[f]={s:new _n,p:l},h[f].s.curves=a.curves,c&&f++,p[f]=[]):p[f].push({h:a,p:l[0]});if(!h[0])return r(i);if(1<h.length){for(d=!1,a=[],n=0,i=h.length;n<i;n++)s[n]=[];for(n=0,i=h.length;n<i;n++)for(o=p[n],c=0;c<o.length;c++){for(f=o[c],l=!0,m=0;m<h.length;m++)(function(e,t){for(var r=t.length,n=!1,i=r-1,o=0;o<r;i=o++){var a=t[i],s=t[o],u=s.x-a.x,c=s.y-a.y;if(Math.abs(c)>Number.EPSILON){if(0>c&&(a=t[o],u=-u,s=t[i],c=-c),!(e.y<a.y||e.y>s.y))if(e.y===a.y){if(e.x===a.x)return!0}else{if(0==(i=c*(e.x-a.x)-u*(e.y-a.y)))return!0;0>i||(n=!n)}}else if(e.y===a.y&&(s.x<=e.x&&e.x<=a.x||a.x<=e.x&&e.x<=s.x))return!0}return n})(f.p,h[m].p)&&(n!==m&&a.push({froms:n,tos:m,hole:c}),l?(l=!1,s[m].push(f)):d=!0);l&&s[n].push(f)}0<a.length&&(d||(p=s))}for(d=0,n=h.length;d<n;d++)for(s=h[d].s,u.push(s),a=p[d],i=0,o=a.length;i<o;i++)s.holes.push(a[i].h);return u}}),Object.assign(wn.prototype,{isFont:!0,generateShapes:function(e,t,r){void 0===t&&(t=100),void 0===r&&(r=4);var n=this.data;e=String(e).split("");var i=t/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,a=0,s=0;t=[];for(var u=0;u<e.length;u++){var c=e[u];if("\n"===c)a=0,s-=o;else{var l;l=i;var h=a,p=s;if(c=n.glyphs[c]||n.glyphs["?"]){var f,d,m,v,y,g,b,_,x=new xn,w=[];if(c.o)for(var S=c._cachedOutline||(c._cachedOutline=c.o.split(" ")),T=0,E=S.length;T<E;)switch(S[T++]){case"m":f=S[T++]*l+h,d=S[T++]*l+p,x.moveTo(f,d);break;case"l":f=S[T++]*l+h,d=S[T++]*l+p,x.lineTo(f,d);break;case"q":if(f=S[T++]*l+h,d=S[T++]*l+p,y=S[T++]*l+h,g=S[T++]*l+p,x.quadraticCurveTo(y,g,f,d),v=w[w.length-1]){m=v.x,v=v.y;for(var O=1;O<=r;O++){var M=O/r;ln(M,m,y,f),ln(M,v,g,d)}}break;case"b":if(f=S[T++]*l+h,d=S[T++]*l+p,y=S[T++]*l+h,g=S[T++]*l+p,b=S[T++]*l+h,_=S[T++]*l+p,x.bezierCurveTo(y,g,b,_,f,d),v=w[w.length-1])for(m=v.x,v=v.y,O=1;O<=r;O++)M=O/r,hn(M,m,y,b,f),hn(M,v,g,_,d)}l={offsetX:c.ha*l,path:x}}else l=void 0;a+=l.offsetX,t.push(l.path)}}for(r=[],n=0,e=t.length;n<e;n++)Array.prototype.push.apply(r,t[n].toShapes());return r}}),Object.assign(Sn.prototype,{load:function(e,t,r,n){var i=this;new Mr(this.manager).load(e,function(e){var r;try{r=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),r=JSON.parse(e.substring(65,e.length-2))}e=i.parse(r),t&&t(e)},r,n)},parse:function(e){return new wn(e)}});var Yi,Zi={getContext:function(){return void 0===Yi&&(Yi=new(window.AudioContext||window.webkitAudioContext)),Yi},setContext:function(e){Yi=e}};Object.assign(Tn.prototype,{load:function(e,t,r,n){var i=new Mr(this.manager);i.setResponseType("arraybuffer"),i.load(e,function(e){Zi.getContext().decodeAudioData(e,function(e){t(e)})},r,n)}}),Object.assign(En.prototype,{update:function(){var e,t,r,n,i,o,a,s,u=new c,l=new c;return function(c){if(e!==this||t!==c.focus||r!==c.fov||n!==c.aspect*this.aspect||i!==c.near||o!==c.far||a!==c.zoom||s!==this.eyeSep){e=this,t=c.focus,r=c.fov,n=c.aspect*this.aspect,i=c.near,o=c.far,a=c.zoom;var h,p,f=c.projectionMatrix.clone(),d=(s=this.eyeSep/2)*i/t,m=i*Math.tan(xi.DEG2RAD*r*.5)/a;l.elements[12]=-s,u.elements[12]=s,h=-m*n+d,p=m*n+d,f.elements[0]=2*i/(p-h),f.elements[8]=(p+h)/(p-h),this.cameraL.projectionMatrix.copy(f),h=-m*n-d,p=m*n-d,f.elements[0]=2*i/(p-h),f.elements[8]=(p+h)/(p-h),this.cameraR.projectionMatrix.copy(f)}this.cameraL.matrixWorld.copy(c.matrixWorld).multiply(l),this.cameraR.matrixWorld.copy(c.matrixWorld).multiply(u)}}()}),(On.prototype=Object.create(oe.prototype)).constructor=On,Mn.prototype=Object.assign(Object.create(oe.prototype),{constructor:Mn,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},getFilter:function(){return this.filter},setFilter:function(e){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){this.gain.gain.value=e},updateMatrixWorld:function(){var e=new u,t=new s,r=new u,n=new u;return function(i){oe.prototype.updateMatrixWorld.call(this,i),i=this.context.listener;var o=this.up;this.matrixWorld.decompose(e,t,r),n.set(0,0,-1).applyQuaternion(t),i.positionX?(i.positionX.setValueAtTime(e.x,this.context.currentTime),i.positionY.setValueAtTime(e.y,this.context.currentTime),i.positionZ.setValueAtTime(e.z,this.context.currentTime),i.forwardX.setValueAtTime(n.x,this.context.currentTime),i.forwardY.setValueAtTime(n.y,this.context.currentTime),i.forwardZ.setValueAtTime(n.z,this.context.currentTime),i.upX.setValueAtTime(o.x,this.context.currentTime),i.upY.setValueAtTime(o.y,this.context.currentTime),i.upZ.setValueAtTime(o.z,this.context.currentTime)):(i.setPosition(e.x,e.y,e.z),i.setOrientation(n.x,n.y,n.z,o.x,o.y,o.z))}}()}),Cn.prototype=Object.assign(Object.create(oe.prototype),{constructor:Cn,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else{if(!1!==this.hasPlaybackControl){var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.onended=this.onEnded.bind(this),e.playbackRate.setValueAtTime(this.playbackRate,this.startTime),e.start(0,this.startTime),this.isPlaying=!0,this.source=e,this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}},pause:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.startTime=this.context.currentTime,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.startTime=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.value=e,this}}),jn.prototype=Object.assign(Object.create(Cn.prototype),{constructor:jn,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){this.panner.refDistance=e},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){this.panner.rolloffFactor=e},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){this.panner.distanceModel=e},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){this.panner.maxDistance=e},updateMatrixWorld:function(){var e=new u;return function(t){oe.prototype.updateMatrixWorld.call(this,t),e.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(e.x,e.y,e.z)}}()}),Object.assign(Pn.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),r=0;r<t.length;r++)e+=t[r];return e/t.length}}),Object.assign(An.prototype,{accumulate:function(e,t){var r=this.buffer,n=this.valueSize,i=e*n+n,o=this.cumulativeWeight;if(0===o){for(o=0;o!==n;++o)r[i+o]=r[o];o=t}else o+=t,this._mixBufferRegion(r,i,0,t/o,n);this.cumulativeWeight=o},apply:function(e){var t=this.valueSize,r=this.buffer;e=e*t+t;var n=this.cumulativeWeight,i=this.binding;this.cumulativeWeight=0,1>n&&this._mixBufferRegion(r,e,3*t,1-n,t);for(var n=t,o=t+t;n!==o;++n)if(r[n]!==r[n+t]){i.setValue(r,e);break}},saveOriginalState:function(){var e=this.buffer,t=this.valueSize,r=3*t;this.binding.getValue(e,r);for(var n=t;n!==r;++n)e[n]=e[r+n%t];this.cumulativeWeight=0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_select:function(e,t,r,n,i){if(.5<=n)for(n=0;n!==i;++n)e[t+n]=e[r+n]},_slerp:function(e,t,r,n){s.slerpFlat(e,t,e,t,e,r,n)},_lerp:function(e,t,r,n,i){for(var o=1-n,a=0;a!==i;++a){var s=t+a;e[s]=e[s]*o+e[r+a]*n}}}),Object.assign(Nn.prototype,{getValue:function(e,t){this.bind();var r=this._bindings[this._targetGroup.nCachedObjects_];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var r=this._bindings,n=this._targetGroup.nCachedObjects_,i=r.length;n!==i;++n)r[n].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}}),Object.assign(Ln,{Composite:Nn,create:function(e,t,r){return e&&e.isAnimationObjectGroup?new Ln.Composite(e,t,r):new Ln(e,t,r)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(/[^\w-]/g,"")},parseTrackName:function(){var e=new RegExp("^"+/((?:[\w-]+[\/:])*)/.source+/([\w-\.]+)?/.source+/(?:\.([\w-]+)(?:\[(.+)\])?)?/.source+/\.([\w-]+)(?:\[(.+)\])?/.source+"$"),t=["material","materials","bones"];return function(r){var n=e.exec(r);if(!n)throw Error("PropertyBinding: Cannot parse trackName: "+r);var i=(n={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]}).nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var o=n.nodeName.substring(i+1);-1!==t.indexOf(o)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=o)}if(null===n.propertyName||0===n.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+r);return n}}(),findNode:function(e,t){if(!t||""===t||"root"===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var r=function(e){for(var r=0;r<e.bones.length;r++){var n=e.bones[r];if(n.name===t)return n}return null}(e.skeleton);if(r)return r}if(e.children){var n=function(e){for(var r=0;r<e.length;r++){var i=e[r];if(i.name===t||i.uuid===t||(i=n(i.children)))return i}return null};if(r=n(e.children))return r}return null}}),Object.assign(Ln.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)e[t++]=r[n]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.node[this.propertyName]=e[t]},function(e,t){this.node[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.node[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)r[n]=e[t++]},function(e,t){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)r[n]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)r[n]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,r=t.objectName,n=t.propertyName,i=t.propertyIndex;if(e||(this.node=e=Ln.findNode(this.rootNode,t.nodeName)||this.rootNode),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(r){var o=t.objectIndex;switch(r){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);for(e=e.skeleton.bones,r=0;r<e.length;r++)if(e[r].name===o){o=r;break}break;default:if(void 0===e[r])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[r]}if(void 0!==o){if(void 0===e[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[o]}}if(void 0===(o=e[n]))console.error("THREE.PropertyBinding: Trying to update property for track: "+t.nodeName+"."+n+" but it wasn't found.",e);else{if(t=this.Versioning.None,void 0!==e.needsUpdate?(t=this.Versioning.NeedsUpdate,this.targetObject=e):void 0!==e.matrixWorldNeedsUpdate&&(t=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=e),r=this.BindingType.Direct,void 0!==i){if("morphTargetInfluences"===n){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(r=0;r<this.node.geometry.morphAttributes.position.length;r++)if(e.geometry.morphAttributes.position[r].name===i){i=r;break}}else{if(!e.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(r=0;r<this.node.geometry.morphTargets.length;r++)if(e.geometry.morphTargets[r].name===i){i=r;break}}}r=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=i}else void 0!==o.fromArray&&void 0!==o.toArray?(r=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(r=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=n;this.getValue=this.GetterByBindingType[r],this.setValue=this.SetterByBindingTypeAndVersioning[r][t]}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Ln.prototype,{_getValue_unbound:Ln.prototype.getValue,_setValue_unbound:Ln.prototype.setValue}),Object.assign(In.prototype,{isAnimationObjectGroup:!0,add:function(e){for(var t=this._objects,r=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,o=this._paths,a=this._parsedPaths,s=this._bindings,u=s.length,c=0,l=arguments.length;c!==l;++c){var h=arguments[c],p=i[f=h.uuid];if(void 0===p){p=r++,i[f]=p,t.push(h);for(var f=0,d=u;f!==d;++f)s[f].push(new Ln(h,o[f],a[f]))}else if(p<n){var m=--n;for(i[(d=t[m]).uuid]=p,t[p]=d,i[f]=m,t[m]=h,f=0,d=u;f!==d;++f){var v=s[f],y=v[p];v[p]=v[m],void 0===y&&(y=new Ln(h,o[f],a[f])),v[m]=y}}else void 0!==t[p]&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(e){for(var t=this._objects,r=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,o=i.length,a=0,s=arguments.length;a!==s;++a){var u=arguments[a],c=u.uuid,l=n[c];if(void 0!==l&&l>=r){var h=r++,p=t[h];for(n[p.uuid]=l,t[l]=p,n[c]=h,t[h]=u,u=0,c=o;u!==c;++u){var f=(p=i[u])[l];p[l]=p[h],p[h]=f}}}this.nCachedObjects_=r},uncache:function(e){for(var t=this._objects,r=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,o=this._bindings,a=o.length,s=0,u=arguments.length;s!==u;++s){var c=arguments[s].uuid,l=i[c];if(void 0!==l)if(delete i[c],l<n){var h=t[c=--n],p=--r,f=t[p];for(i[h.uuid]=l,t[l]=h,i[f.uuid]=c,t[c]=f,t.pop(),h=0,f=a;h!==f;++h){var d=o[h],m=d[p];d[l]=d[c],d[c]=m,d.pop()}}else for(p=--r,f=t[p],i[f.uuid]=l,t[l]=f,t.pop(),h=0,f=a;h!==f;++h)d=o[h],d[l]=d[p],d.pop()}this.nCachedObjects_=n},subscribe_:function(e,t){var r=this._bindingsIndicesByPath,n=r[e],i=this._bindings;if(void 0!==n)return i[n];var o=this._paths,a=this._parsedPaths,s=this._objects,u=this.nCachedObjects_,c=Array(s.length),n=i.length;for(r[e]=n,o.push(e),a.push(t),i.push(c),r=u,n=s.length;r!==n;++r)c[r]=new Ln(s[r],e,t);return c},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,r=t[e];if(void 0!==r){var n=this._paths,i=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];t[e[a]]=r,o[r]=s,o.pop(),i[r]=i[a],i.pop(),n[r]=n[a],n.pop()}}}),Object.assign(Rn.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,r){if(e.fadeOut(t),this.fadeIn(t),r){r=this._clip.duration;var n=e._clip.duration,i=r/n;e.warp(1,n/r,t),this.warp(i,1,t)}return this},crossFadeTo:function(e,t,r){return e.crossFadeFrom(this,t,r)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,r){var n=this._mixer,i=n.time,o=this._timeScaleInterpolant,a=this.timeScale;return null===o&&(this._timeScaleInterpolant=o=n._lendControlInterpolant()),n=o.parameterPositions,o=o.sampleValues,n[0]=i,n[1]=i+r,o[0]=e/a,o[1]=t/a,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,r,n){if(this.enabled){if(null!==(i=this._startTime)){if(0>(t=(e-i)*r)||0===r)return;this._startTime=null,t*=r}if(t*=this._updateTimeScale(e),r=this._updateTime(t),0<(e=this._updateWeight(e))){t=this._interpolants;for(var i=this._propertyBindings,o=0,a=t.length;o!==a;++o)t[o].evaluate(r),i[o].accumulate(n,e)}}else this._updateWeight(e)},_updateWeight:function(e){t=0;if(this.enabled){var t=this.weight,r=this._weightInterpolant;if(null!==r){var n=r.evaluate(e)[0],t=t*n;e>r.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t},_updateTimeScale:function(e){t=0;if(!this.paused){var t=this.timeScale,r=this._timeScaleInterpolant;if(null!==r){t=t*r.evaluate(e)[0];e>r.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t},_updateTime:function(e){o=this.time+e;if(0===e)return o;var t=this._clip.duration,r=this.loop,n=this._loopCount;if(2200===r)e:{if(-1===n&&(this._loopCount=0,this._setEndings(!0,!0,!1)),o>=t)o=t;else{if(!(0>o))break e;o=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:0>e?-1:1})}else{if(r=2202===r,-1===n&&(0<=e?(n=0,this._setEndings(!0,0===this.repetitions,r)):this._setEndings(0===this.repetitions,!0,r)),o>=t||0>o){var i=Math.floor(o/t),o=o-t*i,n=n+Math.abs(i),a=this.repetitions-n;0>a?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,o=0<e?t:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<e?1:-1})):(0===a?(e=0>e,this._setEndings(e,!e,r)):this._setEndings(!1,!1,r),this._loopCount=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i}))}if(r&&1==(1&n))return this.time=o,t-o}return this.time=o},_setEndings:function(e,t,r){var n=this._interpolantSettings;r?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,n.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(e,t,r){var n=this._mixer,i=n.time,o=this._weightInterpolant;return null===o&&(this._weightInterpolant=o=n._lendControlInterpolant()),n=o.parameterPositions,o=o.sampleValues,n[0]=i,o[0]=t,n[1]=i+e,o[1]=r,this}}),Object.assign(kn.prototype,t.prototype,{_bindAction:function(e,t){var r=e._localRoot||this._root,n=e._clip.tracks,i=n.length,o=e._propertyBindings,a=e._interpolants,s=r.uuid,u=this._bindingsByRootAndName,c=u[s];for(void 0===c&&(c={},u[s]=c),u=0;u!==i;++u){var l=n[u],h=l.name,p=c[h];if(void 0===p){if(void 0!==(p=o[u])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,h));continue}++(p=new An(Ln.create(r,h,t&&t._propertyBindings[u].binding.parsedPath),l.ValueTypeName,l.getValueSize())).referenceCount,this._addInactiveBinding(p,s,h)}o[u]=p,a[u].resultBuffer=p.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,r=e._clip.uuid,n=this._actionsByClip[r];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,r,t)}for(r=0,n=(t=e._propertyBindings).length;r!==n;++r){var i=t[r];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,r=0,n=t.length;r!==n;++r){var i=t[r];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){return null!==(e=e._cacheIndex)&&e<this._nActiveActions},_addInactiveAction:function(e,t,r){var n=this._actions,i=this._actionsByClip,o=i[t];void 0===o?(o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=o):(t=o.knownActions,e._byClipCacheIndex=t.length,t.push(e)),e._cacheIndex=n.length,n.push(e),o.actionByRoot[r]=e},_removeInactiveAction:function(e){var t=(n=this._actions)[n.length-1],r=e._cacheIndex;t._cacheIndex=r,n[r]=t,n.pop(),e._cacheIndex=null;var n=e._clip.uuid,i=(r=(t=this._actionsByClip)[n]).knownActions,o=i[i.length-1],a=e._byClipCacheIndex;o._byClipCacheIndex=a,i[a]=o,i.pop(),e._byClipCacheIndex=null,delete r.actionByRoot[(e._localRoot||this._root).uuid],0===i.length&&delete t[n],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=0,r=(e=e._propertyBindings).length;t!==r;++t){var n=e[t];0==--n.referenceCount&&this._removeInactiveBinding(n)}},_lendAction:function(e){var t=this._actions,r=e._cacheIndex,n=this._nActiveActions++,i=t[n];e._cacheIndex=n,t[n]=e,i._cacheIndex=r,t[r]=i},_takeBackAction:function(e){var t=this._actions,r=e._cacheIndex,n=--this._nActiveActions,i=t[n];e._cacheIndex=n,t[n]=e,i._cacheIndex=r,t[r]=i},_addInactiveBinding:function(e,t,r){var n=this._bindingsByRootAndName,i=n[t],o=this._bindings;void 0===i&&(i={},n[t]=i),i[r]=e,e._cacheIndex=o.length,o.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,r=(n=e.binding).rootNode.uuid,n=n.path,i=this._bindingsByRootAndName,o=i[r],a=t[t.length-1];e=e._cacheIndex,a._cacheIndex=e,t[e]=a,t.pop(),delete o[n];e:{for(var s in o)break e;delete i[r]}},_lendBinding:function(e){var t=this._bindings,r=e._cacheIndex,n=this._nActiveBindings++,i=t[n];e._cacheIndex=n,t[n]=e,i._cacheIndex=r,t[r]=i},_takeBackBinding:function(e){var t=this._bindings,r=e._cacheIndex,n=--this._nActiveBindings,i=t[n];e._cacheIndex=n,t[n]=e,i._cacheIndex=r,t[r]=i},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,r=e[t];return void 0===r&&(r=new $r(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),r.__cacheIndex=t,e[t]=r),r},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,r=e.__cacheIndex,n=--this._nActiveControlInterpolants,i=t[n];e.__cacheIndex=n,t[n]=e,i.__cacheIndex=r,t[r]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var r=(i=t||this._root).uuid,n="string"==typeof e?rn.findByName(i,e):e,i=null!==n?n.uuid:e,o=this._actionsByClip[i],a=null;if(void 0!==o){if(void 0!==(a=o.actionByRoot[r]))return a;a=o.knownActions[0],null===n&&(n=a._clip)}return null===n?null:(n=new Rn(this,n,t),this._bindAction(n,a),this._addInactiveAction(n,i,r),n)},existingAction:function(e,t){var r=(n=t||this._root).uuid,n="string"==typeof e?rn.findByName(n,e):e;return void 0!==(n=this._actionsByClip[n?n.uuid:e])?n.actionByRoot[r]||null:null},stopAllAction:function(){for(var e=this._actions,t=this._nActiveActions,r=this._bindings,n=this._nActiveBindings,i=this._nActiveBindings=this._nActiveActions=0;i!==t;++i)e[i].reset();for(i=0;i!==n;++i)r[i].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,r=this._nActiveActions,n=this.time+=e,i=Math.sign(e),o=this._accuIndex^=1,a=0;a!==r;++a)t[a]._update(n,e,i,o);for(e=this._bindings,t=this._nActiveBindings,a=0;a!==t;++a)e[a].apply(o);return this},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions;e=e.uuid;var r=this._actionsByClip,n=r[e];if(void 0!==n){for(var i=0,o=(n=n.knownActions).length;i!==o;++i){var a=n[i];this._deactivateAction(a);var s=a._cacheIndex,u=t[t.length-1];a._cacheIndex=null,a._byClipCacheIndex=null,u._cacheIndex=s,t[s]=u,t.pop(),this._removeInactiveBindingsForAction(a)}delete r[e]}},uncacheRoot:function(e){e=e.uuid;var t,r=this._actionsByClip;for(t in r){var n=r[t].actionByRoot[e];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}if(void 0!==(t=this._bindingsByRootAndName[e]))for(var i in t)(e=t[i]).restoreOriginalState(),this._removeInactiveBinding(e)},uncacheAction:function(e,t){var r=this.existingAction(e,t);null!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}}),Dn.prototype.clone=function(){return new Dn(void 0===this.value.clone?this.value:this.value.clone())},Fn.prototype=Object.assign(Object.create(Se.prototype),{constructor:Fn,isInstancedBufferGeometry:!0,addGroup:function(e,t,r){this.groups.push({start:e,count:t,materialIndex:r})},copy:function(e){null!==(r=e.index)&&this.setIndex(r.clone());var t,r=e.attributes;for(t in r)this.addAttribute(t,r[t].clone());for(t=0,r=(e=e.groups).length;t<r;t++){var n=e[t];this.addGroup(n.start,n.count,n.materialIndex)}return this}}),Object.defineProperties(Vn.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Vn.prototype,{isInterleavedBufferAttribute:!0,setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=r,this},setXYZ:function(e,t,r,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=n,this},setXYZW:function(e,t,r,n,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=n,this.data.array[e+3]=i,this}}),Object.defineProperty(Bn.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Bn.prototype,{isInterleavedBuffer:!0,setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==e?e.length/this.stride:0,this.array=e},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.dynamic=e.dynamic,this},copyAt:function(e,t,r){e*=this.stride,r*=t.stride;for(var n=0,i=this.stride;n<i;n++)this.array[e+n]=t.array[r+n];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}}),Un.prototype=Object.assign(Object.create(Bn.prototype),{constructor:Un,isInstancedInterleavedBuffer:!0,copy:function(e){return Bn.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Gn.prototype=Object.assign(Object.create(he.prototype),{constructor:Gn,isInstancedBufferAttribute:!0,copy:function(e){return he.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(zn.prototype,{linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize()):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t){var r=[];return $n(e,this,r,t),r.sort(qn),r},intersectObjects:function(e,t){var r=[];if(!1===Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var n=0,i=e.length;n<i;n++)$n(e[n],this,r,t);return r.sort(qn),r}}),Object.assign(Hn.prototype,{start:function(){this.oldTime=this.startTime=("undefined"==typeof performance?Date:performance).now(),this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.autoStart=this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now(),t=(e-this.oldTime)/1e3;this.oldTime=e,this.elapsedTime+=t}return t}}),Object.assign(Wn.prototype,{set:function(e,t,r){return this.radius=e,this.phi=t,this.theta=r,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(e){return this.radius=e.length(),0===this.radius?this.phi=this.theta=0:(this.theta=Math.atan2(e.x,e.z),this.phi=Math.acos(xi.clamp(e.y/this.radius,-1,1))),this}}),Object.assign(Qn.prototype,{set:function(e,t,r){return this.radius=e,this.theta=t,this.y=r,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.radius=Math.sqrt(e.x*e.x+e.z*e.z),this.theta=Math.atan2(e.x,e.z),this.y=e.y,this}}),(Kn.prototype=Object.create(Ne.prototype)).constructor=Kn,Kn.prototype.createAnimation=function(e,t,r,n){t={start:t,end:r,length:r-t+1,fps:n,duration:(r-t)/n,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1},this.animationsMap[e]=t,this.animationsList.push(t)},Kn.prototype.autoCreateAnimations=function(e){for(var t,r=/([a-z]+)_?(\d+)/i,n={},i=this.geometry,o=0,a=i.morphTargets.length;o<a;o++){var s=i.morphTargets[o].name.match(r);if(s&&1<s.length){var u=s[1];n[u]||(n[u]={start:1/0,end:-1/0}),o<(s=n[u]).start&&(s.start=o),o>s.end&&(s.end=o),t||(t=u)}}for(u in n)s=n[u],this.createAnimation(u,s.start,s.end,e);this.firstAnimation=t},Kn.prototype.setAnimationDirectionForward=function(e){(e=this.animationsMap[e])&&(e.direction=1,e.directionBackwards=!1)},Kn.prototype.setAnimationDirectionBackward=function(e){(e=this.animationsMap[e])&&(e.direction=-1,e.directionBackwards=!0)},Kn.prototype.setAnimationFPS=function(e,t){var r=this.animationsMap[e];r&&(r.fps=t,r.duration=(r.end-r.start)/r.fps)},Kn.prototype.setAnimationDuration=function(e,t){var r=this.animationsMap[e];r&&(r.duration=t,r.fps=(r.end-r.start)/r.duration)},Kn.prototype.setAnimationWeight=function(e,t){var r=this.animationsMap[e];r&&(r.weight=t)},Kn.prototype.setAnimationTime=function(e,t){var r=this.animationsMap[e];r&&(r.time=t)},Kn.prototype.getAnimationTime=function(e){var t=0;return(e=this.animationsMap[e])&&(t=e.time),t},Kn.prototype.getAnimationDuration=function(e){var t=-1;return(e=this.animationsMap[e])&&(t=e.duration),t},Kn.prototype.playAnimation=function(e){var t=this.animationsMap[e];t?(t.time=0,t.active=!0):console.warn("THREE.MorphBlendMesh: animation["+e+"] undefined in .playAnimation()")},Kn.prototype.stopAnimation=function(e){(e=this.animationsMap[e])&&(e.active=!1)},Kn.prototype.update=function(e){for(var t=0,r=this.animationsList.length;t<r;t++){var n=this.animationsList[t];if(n.active){var i=n.duration/n.length;n.time+=n.direction*e,n.mirroredLoop?(n.time>n.duration||0>n.time)&&(n.direction*=-1,n.time>n.duration&&(n.time=n.duration,n.directionBackwards=!0),0>n.time&&(n.time=0,n.directionBackwards=!1)):(n.time%=n.duration,0>n.time&&(n.time+=n.duration));var o=n.start+xi.clamp(Math.floor(n.time/i),0,n.length-1),a=n.weight;o!==n.currentFrame&&(this.morphTargetInfluences[n.lastFrame]=0,this.morphTargetInfluences[n.currentFrame]=1*a,this.morphTargetInfluences[o]=0,n.lastFrame=n.currentFrame,n.currentFrame=o),i=n.time%i/i,n.directionBackwards&&(i=1-i),n.currentFrame!==n.lastFrame?(this.morphTargetInfluences[n.currentFrame]=i*a,this.morphTargetInfluences[n.lastFrame]=(1-i)*a):this.morphTargetInfluences[n.currentFrame]=a}}},(Xn.prototype=Object.create(oe.prototype)).constructor=Xn,Xn.prototype.isImmediateRenderObject=!0,(Yn.prototype=Object.create(Tt.prototype)).constructor=Yn,Yn.prototype.update=function(){var e=new u,t=new u,r=new Z;return function(){var n=["a","b","c"];this.object.updateMatrixWorld(!0),r.getNormalMatrix(this.object.matrixWorld);var i=this.object.matrixWorld,o=this.geometry.attributes.position,a=this.object.geometry;if(a&&a.isGeometry)for(var s=a.vertices,u=a.faces,c=a=0,l=u.length;c<l;c++)for(var h=u[c],p=0,f=h.vertexNormals.length;p<f;p++){var d=h.vertexNormals[p];e.copy(s[h[n[p]]]).applyMatrix4(i),t.copy(d).applyMatrix3(r).normalize().multiplyScalar(this.size).add(e),o.setXYZ(a,e.x,e.y,e.z),a+=1,o.setXYZ(a,t.x,t.y,t.z),a+=1}else if(a&&a.isBufferGeometry)for(n=a.attributes.position,s=a.attributes.normal,p=a=0,f=n.count;p<f;p++)e.set(n.getX(p),n.getY(p),n.getZ(p)).applyMatrix4(i),t.set(s.getX(p),s.getY(p),s.getZ(p)),t.applyMatrix3(r).normalize().multiplyScalar(this.size).add(e),o.setXYZ(a,e.x,e.y,e.z),a+=1,o.setXYZ(a,t.x,t.y,t.z),a+=1;o.needsUpdate=!0}}(),(Zn.prototype=Object.create(oe.prototype)).constructor=Zn,Zn.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Zn.prototype.update=function(){var e=new u,t=new u;return function(){this.light.updateMatrixWorld();var r=this.light.distance?this.light.distance:1e3,n=r*Math.tan(this.light.angle);this.cone.scale.set(n,n,r),e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(t.sub(e)),this.cone.material.color.copy(this.light.color)}}(),(ei.prototype=Object.create(Tt.prototype)).constructor=ei,ei.prototype.onBeforeRender=function(){var e=new u,t=new c,r=new c;return function(){var n=this.bones,i=this.geometry,o=i.getAttribute("position");r.getInverse(this.root.matrixWorld);for(var a=0,s=0;a<n.length;a++){var u=n[a];u.parent&&u.parent.isBone&&(t.multiplyMatrices(r,u.matrixWorld),e.setFromMatrixPosition(t),o.setXYZ(s,e.x,e.y,e.z),t.multiplyMatrices(r,u.parent.matrixWorld),e.setFromMatrixPosition(t),o.setXYZ(s+1,e.x,e.y,e.z),s+=2)}i.getAttribute("position").needsUpdate=!0}}(),(ti.prototype=Object.create(Ne.prototype)).constructor=ti,ti.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},ti.prototype.update=function(){this.material.color.copy(this.light.color)},(ri.prototype=Object.create(oe.prototype)).constructor=ri,ri.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},ri.prototype.update=function(){var e=this.children[0];e.material.color.copy(this.light.color);var t=.5*this.light.width,r=.5*this.light.height,n=(e=e.geometry.attributes.position).array;n[0]=t,n[1]=-r,n[2]=0,n[3]=t,n[4]=r,n[5]=0,n[6]=-t,n[7]=r,n[8]=0,n[9]=-t,n[10]=-r,n[11]=0,n[12]=t,n[13]=-r,n[14]=0,e.needsUpdate=!0},(ni.prototype=Object.create(oe.prototype)).constructor=ni,ni.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},ni.prototype.update=function(){var e=new u,t=new z,r=new z;return function(){var n=this.children[0],i=n.geometry.getAttribute("color");t.copy(this.light.color),r.copy(this.light.groundColor);for(var o=0,a=i.count;o<a;o++){var s=o<a/2?t:r;i.setXYZ(o,s.r,s.g,s.b)}n.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),i.needsUpdate=!0}}(),(ii.prototype=Object.create(Tt.prototype)).constructor=ii,(oi.prototype=Object.create(Tt.prototype)).constructor=oi,(ai.prototype=Object.create(Tt.prototype)).constructor=ai,ai.prototype.update=function(){var e=new u,t=new u,r=new Z;return function(){this.object.updateMatrixWorld(!0),r.getNormalMatrix(this.object.matrixWorld);for(var n=this.object.matrixWorld,i=this.geometry.attributes.position,o=this.object.geometry,a=o.vertices,s=0,u=0,c=(o=o.faces).length;u<c;u++){var l=o[u],h=l.normal;e.copy(a[l.a]).add(a[l.b]).add(a[l.c]).divideScalar(3).applyMatrix4(n),t.copy(h).applyMatrix3(r).normalize().multiplyScalar(this.size).add(e),i.setXYZ(s,e.x,e.y,e.z),s+=1,i.setXYZ(s,t.x,t.y,t.z),s+=1}i.needsUpdate=!0}}(),(si.prototype=Object.create(oe.prototype)).constructor=si,si.prototype.dispose=function(){var e=this.children[0],t=this.children[1];e.geometry.dispose(),e.material.dispose(),t.geometry.dispose(),t.material.dispose()},si.prototype.update=function(){var e=new u,t=new u,r=new u;return function(){e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),r.subVectors(t,e);var n=this.children[0],i=this.children[1];n.lookAt(r),n.material.color.copy(this.light.color),i.lookAt(r),i.scale.z=r.length()}}(),(ui.prototype=Object.create(Tt.prototype)).constructor=ui,ui.prototype.update=function(){function e(e,o,a,s){if(n.set(o,a,s).unproject(i),void 0!==(e=r[e]))for(o=t.getAttribute("position"),a=0,s=e.length;a<s;a++)o.setXYZ(e[a],n.x,n.y,n.z)}var t,r,n=new u,i=new ae;return function(){t=this.geometry,r=this.pointMap,i.projectionMatrix.copy(this.camera.projectionMatrix),e("c",0,0,-1),e("t",0,0,1),e("n1",-1,-1,-1),e("n2",1,-1,-1),e("n3",-1,1,-1),e("n4",1,1,-1),e("f1",-1,-1,1),e("f2",1,-1,1),e("f3",-1,1,1),e("f4",1,1,1),e("u1",.7,1.1,-1),e("u2",-.7,1.1,-1),e("u3",0,2,-1),e("cf1",-1,0,1),e("cf2",1,0,1),e("cf3",0,-1,1),e("cf4",0,1,1),e("cn1",-1,0,-1),e("cn2",1,0,-1),e("cn3",0,-1,-1),e("cn4",0,1,-1),t.getAttribute("position").needsUpdate=!0}}(),(ci.prototype=Object.create(Tt.prototype)).constructor=ci,ci.prototype.update=function(){var e=new X;return function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&e.setFromObject(this.object),!e.isEmpty()){t=e.min;var r=e.max,n=this.geometry.attributes.position,i=n.array;i[0]=r.x,i[1]=r.y,i[2]=r.z,i[3]=t.x,i[4]=r.y,i[5]=r.z,i[6]=t.x,i[7]=t.y,i[8]=r.z,i[9]=r.x,i[10]=t.y,i[11]=r.z,i[12]=r.x,i[13]=r.y,i[14]=t.z,i[15]=t.x,i[16]=r.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=r.x,i[22]=t.y,i[23]=t.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),ci.prototype.setFromObject=function(e){return this.object=e,this.update(),this};var Ji,eo;(li.prototype=Object.create(oe.prototype)).constructor=li,li.prototype.setDirection=function(){var e,t=new u;return function(r){.99999<r.y?this.quaternion.set(0,0,0,1):-.99999>r.y?this.quaternion.set(1,0,0,0):(t.set(r.z,0,-r.x).normalize(),e=Math.acos(r.y),this.quaternion.setFromAxisAngle(t,e))}}(),li.prototype.setLength=function(e,t,r){void 0===t&&(t=.2*e),void 0===r&&(r=.2*t),this.line.scale.set(1,Math.max(0,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),this.cone.position.y=e,this.cone.updateMatrix()},li.prototype.setColor=function(e){this.line.material.color.copy(e),this.cone.material.color.copy(e)},(hi.prototype=Object.create(Tt.prototype)).constructor=hi;var to=new u,ro=new pi,no=new pi,io=new pi;fi.prototype=Object.create(pn.prototype),fi.prototype.constructor=fi,fi.prototype.getPoint=function(e){var t=this.points;e*=(a=t.length)-(this.closed?0:1),e-=s=Math.floor(e),this.closed?s+=0<s?0:(Math.floor(Math.abs(s)/t.length)+1)*t.length:0===e&&s===a-1&&(s=a-2,e=1);var r,n,i;if(this.closed||0<s?r=t[(s-1)%a]:(to.subVectors(t[0],t[1]).add(t[0]),r=to),n=t[s%a],i=t[(s+1)%a],this.closed||s+2<a?t=t[(s+2)%a]:(to.subVectors(t[a-1],t[a-2]).add(t[a-1]),t=to),void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var o="chordal"===this.type?.5:.25,a=Math.pow(r.distanceToSquared(n),o),s=Math.pow(n.distanceToSquared(i),o),o=Math.pow(i.distanceToSquared(t),o);1e-4>s&&(s=1),1e-4>a&&(a=s),1e-4>o&&(o=s),ro.initNonuniformCatmullRom(r.x,n.x,i.x,t.x,a,s,o),no.initNonuniformCatmullRom(r.y,n.y,i.y,t.y,a,s,o),io.initNonuniformCatmullRom(r.z,n.z,i.z,t.z,a,s,o)}else"catmullrom"===this.type&&(a=void 0!==this.tension?this.tension:.5,ro.initCatmullRom(r.x,n.x,i.x,t.x,a),no.initCatmullRom(r.y,n.y,i.y,t.y,a),io.initCatmullRom(r.z,n.z,i.z,t.z,a));return new u(ro.calc(e),no.calc(e),io.calc(e))},(di.prototype=Object.create(pn.prototype)).constructor=di,di.prototype.getPoint=function(e){var t=this.v0,r=this.v1,n=this.v2,i=this.v3;return new u(hn(e,t.x,r.x,n.x,i.x),hn(e,t.y,r.y,n.y,i.y),hn(e,t.z,r.z,n.z,i.z))},(mi.prototype=Object.create(pn.prototype)).constructor=mi,mi.prototype.getPoint=function(e){var t=this.v0,r=this.v1,n=this.v2;return new u(ln(e,t.x,r.x,n.x),ln(e,t.y,r.y,n.y),ln(e,t.z,r.z,n.z))},(vi.prototype=Object.create(pn.prototype)).constructor=vi,vi.prototype.getPoint=function(e){if(1===e)return this.v2.clone();var t=new u;return t.subVectors(this.v2,this.v1),t.multiplyScalar(e),t.add(this.v1),t},(yi.prototype=Object.create(mn.prototype)).constructor=yi,pn.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(pn.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},gi.prototype=Object.create(fi.prototype),bi.prototype=Object.create(fi.prototype),_i.prototype=Object.create(fi.prototype),Object.assign(_i.prototype,{initFromArray:function(e){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(e){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(e){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),ii.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},ei.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(q.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(X.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Pe.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},xi.random16=function(){return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),Math.random()},Object.assign(Z.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(e){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(e,t,r){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(e,t,r){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(c.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){var e;return function(){return void 0===e&&(e=new u),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),e.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(e){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(e,t,r){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(e,t,r){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,r,n,i,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,n,r,i,o)}}),J.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},s.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(je.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(_n.prototype,{extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Zt(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ur(this,e)}}),Object.assign(r.prototype,{fromAttribute:function(e,t,r){return console.error("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,r)}}),Object.assign(u.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,r){return console.error("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,r)}}),Object.assign(i.prototype,{fromAttribute:function(e,t,r){return console.error("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,r)}}),le.prototype.computeTangents=function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},Object.assign(oe.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)}}),Object.defineProperties(oe.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(gt.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(bt.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Object.defineProperty(pn.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),ue.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Lr.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(he.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}}}),Object.assign(Se.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addDrawCall:function(e,t,r){void 0!==r&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(Se.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Dn.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(W.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new z}}}),Object.defineProperties(xr.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Q.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(ht.prototype,{getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}}),Object.defineProperties(ht.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){return this.shadowMap.cullFace},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),this.shadowMap.cullFace=e}}}),Object.defineProperties(te.prototype,{cullFace:{get:function(){return this.renderReverseSided?2:1},set:function(e){e=1!==e,console.warn("WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to "+e+"."),this.renderReverseSided=e}}}),Object.defineProperties(o.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Cn.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new Tn).load(e,function(e){t.setBuffer(e)}),this},Pn.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},e.WebGLRenderTargetCube=a,e.WebGLRenderTarget=o,e.WebGLRenderer=ht,e.ShaderLib=Ii,e.UniformsLib=Ai,e.UniformsUtils=Ni,e.ShaderChunk=Li,e.FogExp2=pt,e.Fog=ft,e.Scene=dt,e.LensFlare=mt,e.Sprite=yt,e.LOD=gt,e.SkinnedMesh=xt,e.Skeleton=bt,e.Bone=_t,e.Mesh=Ne,e.LineSegments=Tt,e.LineLoop=Et,e.Line=St,e.Points=Mt,e.Group=Ct,e.VideoTexture=jt,e.DataTexture=l,e.CompressedTexture=Pt,e.CubeTexture=h,e.CanvasTexture=At,e.DepthTexture=Nt,e.Texture=n,e.CompressedTextureLoader=Cr,e.DataTextureLoader=jr,e.CubeTextureLoader=Ar,e.TextureLoader=Nr,e.ObjectLoader=un,e.MaterialLoader=nn,e.BufferGeometryLoader=on,e.DefaultLoadingManager=zi,e.LoadingManager=Or,e.JSONLoader=sn,e.ImageLoader=Pr,e.FontLoader=Sn,e.FileLoader=Mr,e.Loader=an,e.Cache=Gi,e.AudioLoader=Tn,e.SpotLightShadow=kr,e.SpotLight=Dr,e.PointLight=Fr,e.RectAreaLight=Gr,e.HemisphereLight=Ir,e.DirectionalLightShadow=Vr,e.DirectionalLight=Br,e.AmbientLight=Ur,e.LightShadow=Rr,e.Light=Lr,e.StereoCamera=En,e.PerspectiveCamera=ue,e.OrthographicCamera=se,e.CubeCamera=On,e.ArrayCamera=st,e.Camera=ae,e.AudioListener=Mn,e.PositionalAudio=jn,e.AudioContext=Zi,e.AudioAnalyser=Pn,e.Audio=Cn,e.VectorKeyframeTrack=Qr,e.StringKeyframeTrack=Zr,e.QuaternionKeyframeTrack=Xr,e.NumberKeyframeTrack=Yr,e.ColorKeyframeTrack=en,e.BooleanKeyframeTrack=Jr,e.PropertyMixer=An,e.PropertyBinding=Ln,e.KeyframeTrack=tn,e.AnimationUtils=qi,e.AnimationObjectGroup=In,e.AnimationMixer=kn,e.AnimationClip=rn,e.Uniform=Dn,e.InstancedBufferGeometry=Fn,e.BufferGeometry=Se,e.GeometryIdCount=function(){return Di++},e.Geometry=le,e.InterleavedBufferAttribute=Vn,e.InstancedInterleavedBuffer=Un,e.InterleavedBuffer=Bn,e.InstancedBufferAttribute=Gn,e.Face3=ce,e.Object3D=oe,e.Raycaster=zn,e.Layers=ie,e.EventDispatcher=t,e.Clock=Hn,e.QuaternionLinearInterpolant=Kr,e.LinearInterpolant=$r,e.DiscreteInterpolant=Hr,e.CubicInterpolant=qr,e.Interpolant=zr,e.Triangle=Ae,e.Math=xi,e.Spherical=Wn,e.Cylindrical=Qn,e.Plane=J,e.Frustum=ee,e.Sphere=Y,e.Ray=je,e.Matrix4=c,e.Matrix3=Z,e.Box3=X,e.Box2=q,e.Line3=Pe,e.Euler=ne,e.Vector4=i,e.Vector3=u,e.Vector2=r,e.Quaternion=s,e.Color=z,e.MorphBlendMesh=Kn,e.ImmediateRenderObject=Xn,e.VertexNormalsHelper=Yn,e.SpotLightHelper=Zn,e.SkeletonHelper=ei,e.PointLightHelper=ti,e.RectAreaLightHelper=ri,e.HemisphereLightHelper=ni,e.GridHelper=ii,e.PolarGridHelper=oi,e.FaceNormalsHelper=ai,e.DirectionalLightHelper=si,e.CameraHelper=ui,e.BoxHelper=ci,e.ArrowHelper=li,e.AxisHelper=hi,e.CatmullRomCurve3=fi,e.CubicBezierCurve3=di,e.QuadraticBezierCurve3=mi,e.LineCurve3=vi,e.ArcCurve=yi,e.EllipseCurve=mn,e.SplineCurve=vn,e.CubicBezierCurve=yn,e.QuadraticBezierCurve=gn,e.LineCurve=fn,e.Shape=_n,e.Path=bn,e.ShapePath=xn,e.Font=wn,e.CurvePath=dn,e.Curve=pn,e.ShapeUtils=Vi,e.SceneUtils={createMultiMaterialObject:function(e,t){for(var r=new Ct,n=0,i=t.length;n<i;n++)r.add(new Ne(e,t[n]));return r},detach:function(e,t,r){e.applyMatrix(t.matrixWorld),t.remove(e),r.add(e)},attach:function(e,t,r){e.applyMatrix((new c).getInverse(r.matrixWorld)),t.remove(e),r.add(e)}},e.WireframeGeometry=Lt,e.ParametricGeometry=It,e.ParametricBufferGeometry=Rt,e.TetrahedronGeometry=Ft,e.TetrahedronBufferGeometry=Vt,e.OctahedronGeometry=Bt,e.OctahedronBufferGeometry=Ut,e.IcosahedronGeometry=Gt,e.IcosahedronBufferGeometry=zt,e.DodecahedronGeometry=qt,e.DodecahedronBufferGeometry=$t,e.PolyhedronGeometry=kt,e.PolyhedronBufferGeometry=Dt,e.TubeGeometry=Ht,e.TubeBufferGeometry=Wt,e.TorusKnotGeometry=Qt,e.TorusKnotBufferGeometry=Kt,e.TorusGeometry=Xt,e.TorusBufferGeometry=Yt,e.TextGeometry=er,e.TextBufferGeometry=tr,e.SphereGeometry=rr,e.SphereBufferGeometry=nr,e.RingGeometry=ir,e.RingBufferGeometry=or,e.PlaneGeometry=Oe,e.PlaneBufferGeometry=Me,e.LatheGeometry=ar,e.LatheBufferGeometry=sr,e.ShapeGeometry=ur,e.ShapeBufferGeometry=cr,e.ExtrudeGeometry=Zt,e.ExtrudeBufferGeometry=Jt,e.EdgesGeometry=lr,e.ConeGeometry=fr,e.ConeBufferGeometry=dr,e.CylinderGeometry=hr,e.CylinderBufferGeometry=pr,e.CircleGeometry=mr,e.CircleBufferGeometry=vr,e.BoxGeometry=Te,e.BoxBufferGeometry=Ee,e.ShadowMaterial=yr,e.SpriteMaterial=vt,e.RawShaderMaterial=gr,e.ShaderMaterial=Q,e.PointsMaterial=Ot,e.MeshPhysicalMaterial=_r,e.MeshStandardMaterial=br,e.MeshPhongMaterial=xr,e.MeshToonMaterial=wr,e.MeshNormalMaterial=Sr,e.MeshLambertMaterial=Tr,e.MeshDepthMaterial=K,e.MeshBasicMaterial=Ce,e.LineDashedMaterial=Er,e.LineBasicMaterial=wt,e.Material=W,e.Float64BufferAttribute=_e,e.Float32BufferAttribute=be,e.Uint32BufferAttribute=ge,e.Int32BufferAttribute=ye,e.Uint16BufferAttribute=ve,e.Int16BufferAttribute=me,e.Uint8ClampedBufferAttribute=de,e.Uint8BufferAttribute=fe,e.Int8BufferAttribute=pe,e.BufferAttribute=he,e.REVISION="86",e.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},e.CullFaceNone=0,e.CullFaceBack=1,e.CullFaceFront=2,e.CullFaceFrontBack=3,e.FrontFaceDirectionCW=0,e.FrontFaceDirectionCCW=1,e.BasicShadowMap=0,e.PCFShadowMap=1,e.PCFSoftShadowMap=2,e.FrontSide=0,e.BackSide=1,e.DoubleSide=2,e.FlatShading=1,e.SmoothShading=2,e.NoColors=0,e.FaceColors=1,e.VertexColors=2,e.NoBlending=0,e.NormalBlending=1,e.AdditiveBlending=2,e.SubtractiveBlending=3,e.MultiplyBlending=4,e.CustomBlending=5,e.AddEquation=100,e.SubtractEquation=101,e.ReverseSubtractEquation=102,e.MinEquation=103,e.MaxEquation=104,e.ZeroFactor=200,e.OneFactor=201,e.SrcColorFactor=202,e.OneMinusSrcColorFactor=203,e.SrcAlphaFactor=204,e.OneMinusSrcAlphaFactor=205,e.DstAlphaFactor=206,e.OneMinusDstAlphaFactor=207,e.DstColorFactor=208,e.OneMinusDstColorFactor=209,e.SrcAlphaSaturateFactor=210,e.NeverDepth=0,e.AlwaysDepth=1,e.LessDepth=2,e.LessEqualDepth=3,e.EqualDepth=4,e.GreaterEqualDepth=5,e.GreaterDepth=6,e.NotEqualDepth=7,e.MultiplyOperation=0,e.MixOperation=1,e.AddOperation=2,e.NoToneMapping=0,e.LinearToneMapping=1,e.ReinhardToneMapping=2,e.Uncharted2ToneMapping=3,e.CineonToneMapping=4,e.UVMapping=300,e.CubeReflectionMapping=301,e.CubeRefractionMapping=302,e.EquirectangularReflectionMapping=303,e.EquirectangularRefractionMapping=304,e.SphericalReflectionMapping=305,e.CubeUVReflectionMapping=306,e.CubeUVRefractionMapping=307,e.RepeatWrapping=1e3,e.ClampToEdgeWrapping=1001,e.MirroredRepeatWrapping=1002,e.NearestFilter=1003,e.NearestMipMapNearestFilter=1004,e.NearestMipMapLinearFilter=1005,e.LinearFilter=1006,e.LinearMipMapNearestFilter=1007,e.LinearMipMapLinearFilter=1008,e.UnsignedByteType=1009,e.ByteType=1010,e.ShortType=1011,e.UnsignedShortType=1012,e.IntType=1013,e.UnsignedIntType=1014,e.FloatType=1015,e.HalfFloatType=1016,e.UnsignedShort4444Type=1017,e.UnsignedShort5551Type=1018,e.UnsignedShort565Type=1019,e.UnsignedInt248Type=1020,e.AlphaFormat=1021,e.RGBFormat=1022,e.RGBAFormat=1023,e.LuminanceFormat=1024,e.LuminanceAlphaFormat=1025,e.RGBEFormat=1023,e.DepthFormat=1026,e.DepthStencilFormat=1027,e.RGB_S3TC_DXT1_Format=2001,e.RGBA_S3TC_DXT1_Format=2002,e.RGBA_S3TC_DXT3_Format=2003,e.RGBA_S3TC_DXT5_Format=2004,e.RGB_PVRTC_4BPPV1_Format=2100,e.RGB_PVRTC_2BPPV1_Format=2101,e.RGBA_PVRTC_4BPPV1_Format=2102,e.RGBA_PVRTC_2BPPV1_Format=2103,e.RGB_ETC1_Format=2151,e.LoopOnce=2200,e.LoopRepeat=2201,e.LoopPingPong=2202,e.InterpolateDiscrete=2300,e.InterpolateLinear=2301,e.InterpolateSmooth=2302,e.ZeroCurvatureEnding=2400,e.ZeroSlopeEnding=2401,e.WrapAroundEnding=2402,e.TrianglesDrawMode=0,e.TriangleStripDrawMode=1,e.TriangleFanDrawMode=2,e.LinearEncoding=3e3,e.sRGBEncoding=3001,e.GammaEncoding=3007,e.RGBEEncoding=3002,e.LogLuvEncoding=3003,e.RGBM7Encoding=3004,e.RGBM16Encoding=3005,e.RGBDEncoding=3006,e.BasicDepthPacking=3200,e.RGBADepthPacking=3201,e.CubeGeometry=Te,e.Face4=function(e,t,r,n,i,o,a){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new ce(e,t,r,i,o,a)},e.LineStrip=0,e.LinePieces=1,e.MeshFaceMaterial=function(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e},e.MultiMaterial=function(e){return void 0===e&&(e=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e},e.PointCloud=function(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Mt(e,t)},e.Particle=function(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new yt(e)},e.ParticleSystem=function(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Mt(e,t)},e.PointCloudMaterial=function(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Ot(e)},e.ParticleBasicMaterial=function(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Ot(e)},e.ParticleSystemMaterial=function(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Ot(e)},e.Vertex=function(e,t,r){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new u(e,t,r)},e.DynamicBufferAttribute=function(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new he(e,t).setDynamic(!0)},e.Int8Attribute=function(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new pe(e,t)},e.Uint8Attribute=function(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new fe(e,t)},e.Uint8ClampedAttribute=function(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new de(e,t)},e.Int16Attribute=function(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new me(e,t)},e.Uint16Attribute=function(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new ve(e,t)},e.Int32Attribute=function(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new ye(e,t)},e.Uint32Attribute=function(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new ge(e,t)},e.Float32Attribute=function(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new be(e,t)},e.Float64Attribute=function(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new _e(e,t)},e.ClosedSplineCurve3=gi,e.SplineCurve3=bi,e.Spline=_i,e.BoundingBoxHelper=function(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new ci(e,t)},e.EdgesHelper=function(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Tt(new lr(e.geometry),new wt({color:void 0!==t?t:16777215}))},e.WireframeHelper=function(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Tt(new Lt(e.geometry),new wt({color:void 0!==t?t:16777215}))},e.XHRLoader=function(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Mr(e)},e.BinaryTextureLoader=function(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new jr(e)},e.GeometryUtils={merge:function(e,t,r){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var n;t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),n=t.matrix,t=t.geometry),e.merge(t,n,r)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}},e.ImageUtils={crossOrigin:void 0,loadTexture:function(e,t,r,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new Nr;return i.setCrossOrigin(this.crossOrigin),e=i.load(e,r,void 0,n),t&&(e.mapping=t),e},loadTextureCube:function(e,t,r,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new Ar;return i.setCrossOrigin(this.crossOrigin),e=i.load(e,r,void 0,n),t&&(e.mapping=t),e},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")}},e.Projector=function(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(e,t){console.warn("THREE.Projector: .projectVector() is now vector.project()."),e.project(t)},this.unprojectVector=function(e,t){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),e.unproject(t)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},e.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},Object.defineProperty(e,"__esModule",{value:!0})})},{}],312:[function(e,t,r){"use strict";function n(e,t){if(!(this instanceof n))return new n(e,t);if(this.data=e||[],this.length=this.data.length,this.compare=t||i,this.length>0)for(var r=this.length>>1;r>=0;r--)this._down(r)}function i(e,t){return e<t?-1:e>t?1:0}t.exports=n,n.prototype={push:function(e){this.data.push(e),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var e=this.data[0];return--this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),e}},peek:function(){return this.data[0]},_up:function(e){for(var t=this.data,r=this.compare,n=t[e];e>0;){var i=e-1>>1,o=t[i];if(r(n,o)>=0)break;t[e]=o,e=i}t[e]=n},_down:function(e){for(var t=this.data,r=this.compare,n=this.length,i=n>>1,o=t[e];e<i;){var a=1+(e<<1),s=a+1,u=t[a];if(s<n&&r(t[s],u)<0&&(a=s,u=t[s]),r(u,o)>=0)break;t[e]=u,e=a}t[e]=o}}},{}],313:[function(e,t,r){(function(){function e(e){function t(t,r,n,i,o,a){for(;o>=0&&o<a;o+=e){var s=i?i[o]:o;n=r(n,t[s],s,t)}return n}return function(r,n,i,o){n=x(n,o,4);var a=!C(r)&&_.keys(r),s=(a||r).length,u=e>0?0:s-1;return arguments.length<3&&(i=r[a?a[u]:u],u+=e),t(r,n,i,a,u,s)}}function n(e){return function(t,r,n){r=w(r,n);for(var i=M(t),o=e>0?0:i-1;o>=0&&o<i;o+=e)if(r(t[o],o,t))return o;return-1}}function i(e,t,r){return function(n,i,o){var a=0,s=M(n);if("number"==typeof o)e>0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(r&&o&&s)return o=r(n,i),n[o]===i?o:-1;if(i!==i)return(o=t(p.call(n,a,s),_.isNaN))>=0?o+a:-1;for(o=e>0?a:s-1;o>=0&&o<s;o+=e)if(n[o]===i)return o;return-1}}function o(e,t){var r=L.length,n=e.constructor,i=_.isFunction(n)&&n.prototype||c,o="constructor";for(_.has(e,o)&&!_.contains(t,o)&&t.push(o);r--;)(o=L[r])in e&&e[o]!==i[o]&&!_.contains(t,o)&&t.push(o)}var a=this,s=a._,u=Array.prototype,c=Object.prototype,l=Function.prototype,h=u.push,p=u.slice,f=c.toString,d=c.hasOwnProperty,m=Array.isArray,v=Object.keys,y=l.bind,g=Object.create,b=function(){},_=function(e){return e instanceof _?e:this instanceof _?void(this._wrapped=e):new _(e)};void 0!==r?(void 0!==t&&t.exports&&(r=t.exports=_),r._=_):a._=_,_.VERSION="1.8.3";var x=function(e,t,r){if(void 0===t)return e;switch(null==r?3:r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)};case 4:return function(r,n,i,o){return e.call(t,r,n,i,o)}}return function(){return e.apply(t,arguments)}},w=function(e,t,r){return null==e?_.identity:_.isFunction(e)?x(e,t,r):_.isObject(e)?_.matcher(e):_.property(e)};_.iteratee=function(e,t){return w(e,t,1/0)};var S=function(e,t){return function(r){var n=arguments.length;if(n<2||null==r)return r;for(var i=1;i<n;i++)for(var o=arguments[i],a=e(o),s=a.length,u=0;u<s;u++){var c=a[u];t&&void 0!==r[c]||(r[c]=o[c])}return r}},T=function(e){if(!_.isObject(e))return{};if(g)return g(e);b.prototype=e;var t=new b;return b.prototype=null,t},E=function(e){return function(t){return null==t?void 0:t[e]}},O=Math.pow(2,53)-1,M=E("length"),C=function(e){var t=M(e);return"number"==typeof t&&t>=0&&t<=O};_.each=_.forEach=function(e,t,r){t=x(t,r);var n,i;if(C(e))for(n=0,i=e.length;n<i;n++)t(e[n],n,e);else{var o=_.keys(e);for(n=0,i=o.length;n<i;n++)t(e[o[n]],o[n],e)}return e},_.map=_.collect=function(e,t,r){t=w(t,r);for(var n=!C(e)&&_.keys(e),i=(n||e).length,o=Array(i),a=0;a<i;a++){var s=n?n[a]:a;o[a]=t(e[s],s,e)}return o},_.reduce=_.foldl=_.inject=e(1),_.reduceRight=_.foldr=e(-1),_.find=_.detect=function(e,t,r){var n;if(void 0!==(n=C(e)?_.findIndex(e,t,r):_.findKey(e,t,r))&&-1!==n)return e[n]},_.filter=_.select=function(e,t,r){var n=[];return t=w(t,r),_.each(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n},_.reject=function(e,t,r){return _.filter(e,_.negate(w(t)),r)},_.every=_.all=function(e,t,r){t=w(t,r);for(var n=!C(e)&&_.keys(e),i=(n||e).length,o=0;o<i;o++){var a=n?n[o]:o;if(!t(e[a],a,e))return!1}return!0},_.some=_.any=function(e,t,r){t=w(t,r);for(var n=!C(e)&&_.keys(e),i=(n||e).length,o=0;o<i;o++){var a=n?n[o]:o;if(t(e[a],a,e))return!0}return!1},_.contains=_.includes=_.include=function(e,t,r,n){return C(e)||(e=_.values(e)),("number"!=typeof r||n)&&(r=0),_.indexOf(e,t,r)>=0},_.invoke=function(e,t){var r=p.call(arguments,2),n=_.isFunction(t);return _.map(e,function(e){var i=n?t:e[t];return null==i?i:i.apply(e,r)})},_.pluck=function(e,t){return _.map(e,_.property(t))},_.where=function(e,t){return _.filter(e,_.matcher(t))},_.findWhere=function(e,t){return _.find(e,_.matcher(t))},_.max=function(e,t,r){var n,i,o=-1/0,a=-1/0;if(null==t&&null!=e)for(var s=0,u=(e=C(e)?e:_.values(e)).length;s<u;s++)(n=e[s])>o&&(o=n);else t=w(t,r),_.each(e,function(e,r,n){((i=t(e,r,n))>a||i===-1/0&&o===-1/0)&&(o=e,a=i)});return o},_.min=function(e,t,r){var n,i,o=1/0,a=1/0;if(null==t&&null!=e)for(var s=0,u=(e=C(e)?e:_.values(e)).length;s<u;s++)(n=e[s])<o&&(o=n);else t=w(t,r),_.each(e,function(e,r,n){((i=t(e,r,n))<a||i===1/0&&o===1/0)&&(o=e,a=i)});return o},_.shuffle=function(e){for(var t,r=C(e)?e:_.values(e),n=r.length,i=Array(n),o=0;o<n;o++)(t=_.random(0,o))!==o&&(i[o]=i[t]),i[t]=r[o];return i},_.sample=function(e,t,r){return null==t||r?(C(e)||(e=_.values(e)),e[_.random(e.length-1)]):_.shuffle(e).slice(0,Math.max(0,t))},_.sortBy=function(e,t,r){return t=w(t,r),_.pluck(_.map(e,function(e,r,n){return{value:e,index:r,criteria:t(e,r,n)}}).sort(function(e,t){var r=e.criteria,n=t.criteria;if(r!==n){if(r>n||void 0===r)return 1;if(r<n||void 0===n)return-1}return e.index-t.index}),"value")};var j=function(e){return function(t,r,n){var i={};return r=w(r,n),_.each(t,function(n,o){var a=r(n,o,t);e(i,n,a)}),i}};_.groupBy=j(function(e,t,r){_.has(e,r)?e[r].push(t):e[r]=[t]}),_.indexBy=j(function(e,t,r){e[r]=t}),_.countBy=j(function(e,t,r){_.has(e,r)?e[r]++:e[r]=1}),_.toArray=function(e){return e?_.isArray(e)?p.call(e):C(e)?_.map(e,_.identity):_.values(e):[]},_.size=function(e){return null==e?0:C(e)?e.length:_.keys(e).length},_.partition=function(e,t,r){t=w(t,r);var n=[],i=[];return _.each(e,function(e,r,o){(t(e,r,o)?n:i).push(e)}),[n,i]},_.first=_.head=_.take=function(e,t,r){if(null!=e)return null==t||r?e[0]:_.initial(e,e.length-t)},_.initial=function(e,t,r){return p.call(e,0,Math.max(0,e.length-(null==t||r?1:t)))},_.last=function(e,t,r){if(null!=e)return null==t||r?e[e.length-1]:_.rest(e,Math.max(0,e.length-t))},_.rest=_.tail=_.drop=function(e,t,r){return p.call(e,null==t||r?1:t)},_.compact=function(e){return _.filter(e,_.identity)};var P=function(e,t,r,n){for(var i=[],o=0,a=n||0,s=M(e);a<s;a++){var u=e[a];if(C(u)&&(_.isArray(u)||_.isArguments(u))){t||(u=P(u,t,r));var c=0,l=u.length;for(i.length+=l;c<l;)i[o++]=u[c++]}else r||(i[o++]=u)}return i};_.flatten=function(e,t){return P(e,t,!1)},_.without=function(e){return _.difference(e,p.call(arguments,1))},_.uniq=_.unique=function(e,t,r,n){_.isBoolean(t)||(n=r,r=t,t=!1),null!=r&&(r=w(r,n));for(var i=[],o=[],a=0,s=M(e);a<s;a++){var u=e[a],c=r?r(u,a,e):u;t?(a&&o===c||i.push(u),o=c):r?_.contains(o,c)||(o.push(c),i.push(u)):_.contains(i,u)||i.push(u)}return i},_.union=function(){return _.uniq(P(arguments,!0,!0))},_.intersection=function(e){for(var t=[],r=arguments.length,n=0,i=M(e);n<i;n++){var o=e[n];if(!_.contains(t,o)){for(var a=1;a<r&&_.contains(arguments[a],o);a++);a===r&&t.push(o)}}return t},_.difference=function(e){var t=P(arguments,!0,!0,1);return _.filter(e,function(e){return!_.contains(t,e)})},_.zip=function(){return _.unzip(arguments)},_.unzip=function(e){for(var t=e&&_.max(e,M).length||0,r=Array(t),n=0;n<t;n++)r[n]=_.pluck(e,n);return r},_.object=function(e,t){for(var r={},n=0,i=M(e);n<i;n++)t?r[e[n]]=t[n]:r[e[n][0]]=e[n][1];return r},_.findIndex=n(1),_.findLastIndex=n(-1),_.sortedIndex=function(e,t,r,n){for(var i=(r=w(r,n,1))(t),o=0,a=M(e);o<a;){var s=Math.floor((o+a)/2);r(e[s])<i?o=s+1:a=s}return o},_.indexOf=i(1,_.findIndex,_.sortedIndex),_.lastIndexOf=i(-1,_.findLastIndex),_.range=function(e,t,r){null==t&&(t=e||0,e=0),r=r||1;for(var n=Math.max(Math.ceil((t-e)/r),0),i=Array(n),o=0;o<n;o++,e+=r)i[o]=e;return i};var A=function(e,t,r,n,i){if(!(n instanceof t))return e.apply(r,i);var o=T(e.prototype),a=e.apply(o,i);return _.isObject(a)?a:o};_.bind=function(e,t){if(y&&e.bind===y)return y.apply(e,p.call(arguments,1));if(!_.isFunction(e))throw new TypeError("Bind must be called on a function");var r=p.call(arguments,2),n=function(){return A(e,n,t,this,r.concat(p.call(arguments)))};return n},_.partial=function(e){var t=p.call(arguments,1),r=function(){for(var n=0,i=t.length,o=Array(i),a=0;a<i;a++)o[a]=t[a]===_?arguments[n++]:t[a];for(;n<arguments.length;)o.push(arguments[n++]);return A(e,r,this,this,o)};return r},_.bindAll=function(e){var t,r,n=arguments.length;if(n<=1)throw new Error("bindAll must be passed function names");for(t=1;t<n;t++)e[r=arguments[t]]=_.bind(e[r],e);return e},_.memoize=function(e,t){var r=function(n){var i=r.cache,o=""+(t?t.apply(this,arguments):n);return _.has(i,o)||(i[o]=e.apply(this,arguments)),i[o]};return r.cache={},r},_.delay=function(e,t){var r=p.call(arguments,2);return setTimeout(function(){return e.apply(null,r)},t)},_.defer=_.partial(_.delay,_,1),_.throttle=function(e,t,r){var n,i,o,a=null,s=0;r||(r={});var u=function(){s=!1===r.leading?0:_.now(),a=null,o=e.apply(n,i),a||(n=i=null)};return function(){var c=_.now();s||!1!==r.leading||(s=c);var l=t-(c-s);return n=this,i=arguments,l<=0||l>t?(a&&(clearTimeout(a),a=null),s=c,o=e.apply(n,i),a||(n=i=null)):a||!1===r.trailing||(a=setTimeout(u,l)),o}},_.debounce=function(e,t,r){var n,i,o,a,s,u=function(){var c=_.now()-a;c<t&&c>=0?n=setTimeout(u,t-c):(n=null,r||(s=e.apply(o,i),n||(o=i=null)))};return function(){o=this,i=arguments,a=_.now();var c=r&&!n;return n||(n=setTimeout(u,t)),c&&(s=e.apply(o,i),o=i=null),s}},_.wrap=function(e,t){return _.partial(t,e)},_.negate=function(e){return function(){return!e.apply(this,arguments)}},_.compose=function(){var e=arguments,t=e.length-1;return function(){for(var r=t,n=e[t].apply(this,arguments);r--;)n=e[r].call(this,n);return n}},_.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},_.before=function(e,t){var r;return function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=null),r}},_.once=_.partial(_.before,2);var N=!{toString:null}.propertyIsEnumerable("toString"),L=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];_.keys=function(e){if(!_.isObject(e))return[];if(v)return v(e);var t=[];for(var r in e)_.has(e,r)&&t.push(r);return N&&o(e,t),t},_.allKeys=function(e){if(!_.isObject(e))return[];var t=[];for(var r in e)t.push(r);return N&&o(e,t),t},_.values=function(e){for(var t=_.keys(e),r=t.length,n=Array(r),i=0;i<r;i++)n[i]=e[t[i]];return n},_.mapObject=function(e,t,r){t=w(t,r);for(var n,i=_.keys(e),o=i.length,a={},s=0;s<o;s++)a[n=i[s]]=t(e[n],n,e);return a},_.pairs=function(e){for(var t=_.keys(e),r=t.length,n=Array(r),i=0;i<r;i++)n[i]=[t[i],e[t[i]]];return n},_.invert=function(e){for(var t={},r=_.keys(e),n=0,i=r.length;n<i;n++)t[e[r[n]]]=r[n];return t},_.functions=_.methods=function(e){var t=[];for(var r in e)_.isFunction(e[r])&&t.push(r);return t.sort()},_.extend=S(_.allKeys),_.extendOwn=_.assign=S(_.keys),_.findKey=function(e,t,r){t=w(t,r);for(var n,i=_.keys(e),o=0,a=i.length;o<a;o++)if(n=i[o],t(e[n],n,e))return n},_.pick=function(e,t,r){var n,i,o={},a=e;if(null==a)return o;_.isFunction(t)?(i=_.allKeys(a),n=x(t,r)):(i=P(arguments,!1,!1,1),n=function(e,t,r){return t in r},a=Object(a));for(var s=0,u=i.length;s<u;s++){var c=i[s],l=a[c];n(l,c,a)&&(o[c]=l)}return o},_.omit=function(e,t,r){if(_.isFunction(t))t=_.negate(t);else{var n=_.map(P(arguments,!1,!1,1),String);t=function(e,t){return!_.contains(n,t)}}return _.pick(e,t,r)},_.defaults=S(_.allKeys,!0),_.create=function(e,t){var r=T(e);return t&&_.extendOwn(r,t),r},_.clone=function(e){return _.isObject(e)?_.isArray(e)?e.slice():_.extend({},e):e},_.tap=function(e,t){return t(e),e},_.isMatch=function(e,t){var r=_.keys(t),n=r.length;if(null==e)return!n;for(var i=Object(e),o=0;o<n;o++){var a=r[o];if(t[a]!==i[a]||!(a in i))return!1}return!0};var I=function(e,t,r,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;e instanceof _&&(e=e._wrapped),t instanceof _&&(t=t._wrapped);var i=f.call(e);if(i!==f.call(t))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t}var o="[object Array]"===i;if(!o){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!(_.isFunction(a)&&a instanceof a&&_.isFunction(s)&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}r=r||[],n=n||[];for(var u=r.length;u--;)if(r[u]===e)return n[u]===t;if(r.push(e),n.push(t),o){if((u=e.length)!==t.length)return!1;for(;u--;)if(!I(e[u],t[u],r,n))return!1}else{var c,l=_.keys(e);if(u=l.length,_.keys(t).length!==u)return!1;for(;u--;)if(c=l[u],!_.has(t,c)||!I(e[c],t[c],r,n))return!1}return r.pop(),n.pop(),!0};_.isEqual=function(e,t){return I(e,t)},_.isEmpty=function(e){return null==e||(C(e)&&(_.isArray(e)||_.isString(e)||_.isArguments(e))?0===e.length:0===_.keys(e).length)},_.isElement=function(e){return!(!e||1!==e.nodeType)},_.isArray=m||function(e){return"[object Array]"===f.call(e)},_.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},_.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(e){_["is"+e]=function(t){return f.call(t)==="[object "+e+"]"}}),_.isArguments(arguments)||(_.isArguments=function(e){return _.has(e,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(_.isFunction=function(e){return"function"==typeof e||!1}),_.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},_.isNaN=function(e){return _.isNumber(e)&&e!==+e},_.isBoolean=function(e){return!0===e||!1===e||"[object Boolean]"===f.call(e)},_.isNull=function(e){return null===e},_.isUndefined=function(e){return void 0===e},_.has=function(e,t){return null!=e&&d.call(e,t)},_.noConflict=function(){return a._=s,this},_.identity=function(e){return e},_.constant=function(e){return function(){return e}},_.noop=function(){},_.property=E,_.propertyOf=function(e){return null==e?function(){}:function(t){return e[t]}},_.matcher=_.matches=function(e){return e=_.extendOwn({},e),function(t){return _.isMatch(t,e)}},_.times=function(e,t,r){var n=Array(Math.max(0,e));t=x(t,r,1);for(var i=0;i<e;i++)n[i]=t(i);return n},_.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},_.now=Date.now||function(){return(new Date).getTime()};var R={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},k=_.invert(R),D=function(e){var t=function(t){return e[t]},r="(?:"+_.keys(e).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return function(e){return e=null==e?"":""+e,n.test(e)?e.replace(i,t):e}};_.escape=D(R),_.unescape=D(k),_.result=function(e,t,r){var n=null==e?void 0:e[t];return void 0===n&&(n=r),_.isFunction(n)?n.call(e):n};var F=0;_.uniqueId=function(e){var t=++F+"";return e?e+t:t},_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var V=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\u2028|\u2029/g,G=function(e){return"\\"+B[e]};_.template=function(e,t,r){!t&&r&&(t=r),t=_.defaults({},t,_.templateSettings);var n=RegExp([(t.escape||V).source,(t.interpolate||V).source,(t.evaluate||V).source].join("|")+"|$","g"),i=0,o="__p+='";e.replace(n,function(t,r,n,a,s){return o+=e.slice(i,s).replace(U,G),i=s+t.length,r?o+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?o+="'+\n((__t=("+n+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),t}),o+="';\n",t.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(t.variable||"obj","_",o)}catch(e){throw e.source=o,e}var s=function(e){return a.call(this,e,_)},u=t.variable||"obj";return s.source="function("+u+"){\n"+o+"}",s},_.chain=function(e){var t=_(e);return t._chain=!0,t};var z=function(e,t){return e._chain?_(t).chain():t};_.mixin=function(e){_.each(_.functions(e),function(t){var r=_[t]=e[t];_.prototype[t]=function(){var e=[this._wrapped];return h.apply(e,arguments),z(this,r.apply(_,e))}})},_.mixin(_),_.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=u[e];_.prototype[e]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==e&&"splice"!==e||0!==r.length||delete r[0],z(this,r)}}),_.each(["concat","join","slice"],function(e){var t=u[e];_.prototype[e]=function(){return z(this,t.apply(this._wrapped,arguments))}}),_.prototype.value=function(){return this._wrapped},_.prototype.valueOf=_.prototype.toJSON=_.prototype.value,_.prototype.toString=function(){return""+this._wrapped}}).call(this)},{}],314:[function(e,t,r){var n=e("./vdom/create-element.js");t.exports=n},{"./vdom/create-element.js":320}],315:[function(e,t,r){var n=e("./vtree/diff.js");t.exports=n},{"./vtree/diff.js":340}],316:[function(e,t,r){var n=e("./virtual-hyperscript/index.js");t.exports=n},{"./virtual-hyperscript/index.js":327}],317:[function(e,t,r){var n=e("./diff.js"),i=e("./patch.js"),o=e("./h.js"),a=e("./create-element.js"),s=e("./vnode/vnode.js"),u=e("./vnode/vtext.js");t.exports={diff:n,patch:i,h:o,create:a,VNode:s,VText:u}},{"./create-element.js":314,"./diff.js":315,"./h.js":316,"./patch.js":318,"./vnode/vnode.js":336,"./vnode/vtext.js":338}],318:[function(e,t,r){var n=e("./vdom/patch.js");t.exports=n},{"./vdom/patch.js":323}],319:[function(e,t,r){function n(e,t,r,n){if(n){var i=n[t];if(s(i))i.unhook&&i.unhook(e,t,r);else if("attributes"===t)for(var o in i)e.removeAttribute(o);else if("style"===t)for(var a in i)e.style[a]="";else e[t]="string"==typeof i?"":null}}function i(e,t,r,n,i){var s=r?r[n]:void 0;if("attributes"!==n)if(s&&a(s)&&o(s)!==o(i))e[n]=i;else{a(e[n])||(e[n]={});var u="style"===n?"":void 0;for(var c in i){var l=i[c];e[n][c]=void 0===l?u:l}}else for(var h in i){var p=i[h];void 0===p?e.removeAttribute(h):e.setAttribute(h,p)}}function o(e){return Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__?e.__proto__:e.constructor?e.constructor.prototype:void 0}var a=e("is-object"),s=e("../vnode/is-vhook.js");t.exports=function(e,t,r){for(var o in t){var u=t[o];void 0===u?n(e,o,u,r):s(u)?(n(e,o,u,r),u.hook&&u.hook(e,o,r?r[o]:void 0)):a(u)?i(e,0,r,o,u):e[o]=u}}},{"../vnode/is-vhook.js":331,"is-object":143}],320:[function(e,t,r){function n(e,t){var r=t?t.document||i:i,l=t?t.warn:null;if(e=c(e).a,u(e))return e.init();if(s(e))return r.createTextNode(e.text);if(!a(e))return l&&l("Item is not a valid virtual dom node",e),null;var h=null===e.namespace?r.createElement(e.tagName):r.createElementNS(e.namespace,e.tagName),p=e.properties;o(h,p);for(var f=e.children,d=0;d<f.length;d++){var m=n(f[d],t);m&&h.appendChild(m)}return h}var i=e("global/document"),o=e("./apply-properties"),a=e("../vnode/is-vnode.js"),s=e("../vnode/is-vtext.js"),u=e("../vnode/is-widget.js"),c=e("../vnode/handle-thunk.js");t.exports=n},{"../vnode/handle-thunk.js":329,"../vnode/is-vnode.js":332,"../vnode/is-vtext.js":333,"../vnode/is-widget.js":334,"./apply-properties":319,"global/document":29}],321:[function(e,t,r){function n(e,t,r,o,s){if(o=o||{},e){i(r,s,s)&&(o[s]=e);var u=t.children;if(u)for(var c=e.childNodes,l=0;l<t.children.length;l++){s+=1;var h=u[l]||a,p=s+(h.count||0);i(r,s,p)&&n(c[l],h,r,o,s),s=p}}return o}function i(e,t,r){if(0===e.length)return!1;for(var n,i,o=0,a=e.length-1;o<=a;){if(n=(a+o)/2>>0,i=e[n],o===a)return i>=t&&i<=r;if(i<t)o=n+1;else{if(!(i>r))return!0;a=n-1}}return!1}function o(e,t){return e>t?1:-1}var a={};t.exports=function(e,t,r,i){return r&&0!==r.length?(r.sort(o),n(e,t,r,i,0)):{}}},{}],322:[function(e,t,r){function n(e,t){var r=e.parentNode;return r&&r.removeChild(e),u(e,t),null}function i(e,t,r){var n=r.render(t,r);return e&&e.appendChild(n),e}function o(e,t,r,n){var i;if(3===e.nodeType)e.replaceData(0,e.length,r.text),i=e;else{var o=e.parentNode;i=n.render(r,n),o&&i!==e&&o.replaceChild(i,e)}return i}function a(e,t,r,n){var i,o=d(t,r);i=o?r.update(t,e)||e:n.render(r,n);var a=e.parentNode;return a&&i!==e&&a.replaceChild(i,e),o||u(e,t),i}function s(e,t,r,n){var i=e.parentNode,o=n.render(r,n);return i&&o!==e&&i.replaceChild(o,e),o}function u(e,t){"function"==typeof t.destroy&&p(t)&&t.destroy(e)}function c(e,t){for(var r,n,i,o=e.childNodes,a={},s=0;s<t.removes.length;s++)r=o[(n=t.removes[s]).from],n.key&&(a[n.key]=r),e.removeChild(r);for(var u=o.length,c=0;c<t.inserts.length;c++)r=a[(i=t.inserts[c]).key],e.insertBefore(r,i.to>=u++?null:o[i.to])}function l(e,t){return e&&t&&e!==t&&e.parentNode&&e.parentNode.replaceChild(t,e),t}var h=e("./apply-properties"),p=e("../vnode/is-widget.js"),f=e("../vnode/vpatch.js"),d=e("./update-widget");t.exports=function(e,t,r){var u=e.type,p=e.vNode,d=e.patch;switch(u){case f.REMOVE:return n(t,p);case f.INSERT:return i(t,d,r);case f.VTEXT:return o(t,0,d,r);case f.WIDGET:return a(t,p,d,r);case f.VNODE:return s(t,0,d,r);case f.ORDER:return c(t,d),t;case f.PROPS:return h(t,d,p.properties),t;case f.THUNK:return l(t,r.patch(t,d,r));default:return t}}},{"../vnode/is-widget.js":334,"../vnode/vpatch.js":337,"./apply-properties":319,"./update-widget":324}],323:[function(e,t,r){function n(e,t,r){return r=r||{},r.patch=r.patch&&r.patch!==n?r.patch:i,r.render=r.render||c,r.patch(e,t,r)}function i(e,t,r){var n=a(t);if(0===n.length)return e;var i=l(e,t.a,n),u=e.ownerDocument;r.document||u===s||(r.document=u);for(var c=0;c<n.length;c++){var h=n[c];e=o(e,i[h],t[h],r)}return e}function o(e,t,r,n){if(!t)return e;var i;if(u(r))for(var o=0;o<r.length;o++)i=h(r[o],t,n),t===e&&(e=i);else i=h(r,t,n),t===e&&(e=i);return e}function a(e){var t=[];for(var r in e)"a"!==r&&t.push(Number(r));return t}var s=e("global/document"),u=e("x-is-array"),c=e("./create-element"),l=e("./dom-index"),h=e("./patch-op");t.exports=n},{"./create-element":320,"./dom-index":321,"./patch-op":322,"global/document":29,"x-is-array":359}],324:[function(e,t,r){var n=e("../vnode/is-widget.js");t.exports=function(e,t){return!(!n(e)||!n(t))&&("name"in e&&"name"in t?e.id===t.id:e.init===t.init)}},{"../vnode/is-widget.js":334}],325:[function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.value=e}var i=e("ev-store");t.exports=n,n.prototype.hook=function(e,t){i(e)[t.substr(3)]=this.value},n.prototype.unhook=function(e,t){i(e)[t.substr(3)]=void 0}},{"ev-store":20}],326:[function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.value=e}t.exports=n,n.prototype.hook=function(e,t){e[t]!==this.value&&(e[t]=this.value)}},{}],327:[function(e,t,r){"use strict";function n(e,t,r,i){if("string"==typeof e)t.push(new h(e));else if("number"==typeof e)t.push(new h(String(e)));else if(o(e))t.push(e);else{if(!c(e)){if(null===e||void 0===e)return;throw s({foreignObject:e,parentVnode:{tagName:r,properties:i}})}for(var a=0;a<e.length;a++)n(e[a],t,r,i)}}function i(e){for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];if(m(r))continue;"ev-"===t.substr(0,3)&&(e[t]=b(r))}}function o(e){return p(e)||f(e)||d(e)||v(e)}function a(e){return"string"==typeof e||c(e)||o(e)}function s(e){var t=new Error;return t.type="virtual-hyperscript.unexpected.virtual-element",t.message="Unexpected virtual child passed to h().\nExpected a VNode / Vthunk / VWidget / string but:\ngot:\n"+u(e.foreignObject)+".\nThe parent vnode is:\n"+u(e.parentVnode),t.foreignObject=e.foreignObject,t.parentVnode=e.parentVnode,t}function u(e){try{return JSON.stringify(e,null," ")}catch(t){return String(e)}}var c=e("x-is-array"),l=e("../vnode/vnode.js"),h=e("../vnode/vtext.js"),p=e("../vnode/is-vnode"),f=e("../vnode/is-vtext"),d=e("../vnode/is-widget"),m=e("../vnode/is-vhook"),v=e("../vnode/is-thunk"),y=e("./parse-tag.js"),g=e("./hooks/soft-set-hook.js"),b=e("./hooks/ev-hook.js");t.exports=function(e,t,r){var o,s,u,c,h=[];return!r&&a(t)&&(r=t,s={}),s=s||t||{},o=y(e,s),s.hasOwnProperty("key")&&(u=s.key,s.key=void 0),s.hasOwnProperty("namespace")&&(c=s.namespace,s.namespace=void 0),"INPUT"!==o||c||!s.hasOwnProperty("value")||void 0===s.value||m(s.value)||(s.value=g(s.value)),i(s),void 0!==r&&null!==r&&n(r,h,o,s),new l(o,s,h,u,c)}},{"../vnode/is-thunk":330,"../vnode/is-vhook":331,"../vnode/is-vnode":332,"../vnode/is-vtext":333,"../vnode/is-widget":334,"../vnode/vnode.js":336,"../vnode/vtext.js":338,"./hooks/ev-hook.js":325,"./hooks/soft-set-hook.js":326,"./parse-tag.js":328,"x-is-array":359}],328:[function(e,t,r){"use strict";var n=e("browser-split"),i=/([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/,o=/^\.|#/;t.exports=function(e,t){if(!e)return"DIV";var r=!t.hasOwnProperty("id"),a=n(e,i),s=null;o.test(a[1])&&(s="DIV");var u,c,l,h;for(h=0;h<a.length;h++)(c=a[h])&&(l=c.charAt(0),s?"."===l?(u=u||[]).push(c.substring(1,c.length)):"#"===l&&r&&(t.id=c.substring(1,c.length)):s=c);return u&&(t.className&&u.push(t.className),t.className=u.join(" ")),t.namespace?s:s.toUpperCase()}},{"browser-split":16}],329:[function(e,t,r){function n(e,t){var r=e.vnode;if(r||(r=e.vnode=e.render(t)),!(i(r)||o(r)||a(r)))throw new Error("thunk did not return a valid node");return r}var i=e("./is-vnode"),o=e("./is-vtext"),a=e("./is-widget"),s=e("./is-thunk");t.exports=function(e,t){var r=e,i=t;return s(t)&&(i=n(t,e)),s(e)&&(r=n(e,null)),{a:r,b:i}}},{"./is-thunk":330,"./is-vnode":332,"./is-vtext":333,"./is-widget":334}],330:[function(e,t,r){t.exports=function(e){return e&&"Thunk"===e.type}},{}],331:[function(e,t,r){t.exports=function(e){return e&&("function"==typeof e.hook&&!e.hasOwnProperty("hook")||"function"==typeof e.unhook&&!e.hasOwnProperty("unhook"))}},{}],332:[function(e,t,r){var n=e("./version");t.exports=function(e){return e&&"VirtualNode"===e.type&&e.version===n}},{"./version":335}],333:[function(e,t,r){var n=e("./version");t.exports=function(e){return e&&"VirtualText"===e.type&&e.version===n}},{"./version":335}],334:[function(e,t,r){t.exports=function(e){return e&&"Widget"===e.type}},{}],335:[function(e,t,r){t.exports="2"},{}],336:[function(e,t,r){function n(e,t,r,n,i){this.tagName=e,this.properties=t||c,this.children=r||l,this.key=null!=n?String(n):void 0,this.namespace="string"==typeof i?i:null;var h,p=r&&r.length||0,f=0,d=!1,m=!1,v=!1;for(var y in t)if(t.hasOwnProperty(y)){var g=t[y];u(g)&&g.unhook&&(h||(h={}),h[y]=g)}for(var b=0;b<p;b++){var _=r[b];o(_)?(f+=_.count||0,!d&&_.hasWidgets&&(d=!0),!m&&_.hasThunks&&(m=!0),v||!_.hooks&&!_.descendantHooks||(v=!0)):!d&&a(_)?"function"==typeof _.destroy&&(d=!0):!m&&s(_)&&(m=!0)}this.count=p+f,this.hasWidgets=d,this.hasThunks=m,this.hooks=h,this.descendantHooks=v}var i=e("./version"),o=e("./is-vnode"),a=e("./is-widget"),s=e("./is-thunk"),u=e("./is-vhook");t.exports=n;var c={},l=[];n.prototype.version=i,n.prototype.type="VirtualNode"},{"./is-thunk":330,"./is-vhook":331,"./is-vnode":332,"./is-widget":334,"./version":335}],337:[function(e,t,r){function n(e,t,r){this.type=Number(e),this.vNode=t,this.patch=r}var i=e("./version");n.NONE=0,n.VTEXT=1,n.VNODE=2,n.WIDGET=3,n.PROPS=4,n.ORDER=5,n.INSERT=6,n.REMOVE=7,n.THUNK=8,t.exports=n,n.prototype.version=i,n.prototype.type="VirtualPatch"},{"./version":335}],338:[function(e,t,r){function n(e){this.text=String(e)}var i=e("./version");t.exports=n,n.prototype.version=i,n.prototype.type="VirtualText"},{"./version":335}],339:[function(e,t,r){function n(e,t){var r;for(var s in e){s in t||((r=r||{})[s]=void 0);var u=e[s],c=t[s];if(u!==c)if(o(u)&&o(c))if(i(c)!==i(u))(r=r||{})[s]=c;else if(a(c))(r=r||{})[s]=c;else{var l=n(u,c);l&&((r=r||{})[s]=l)}else(r=r||{})[s]=c}for(var h in t)h in e||((r=r||{})[h]=t[h]);return r}function i(e){return Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__?e.__proto__:e.constructor?e.constructor.prototype:void 0}var o=e("is-object"),a=e("../vnode/is-vhook");t.exports=n},{"../vnode/is-vhook":331,"is-object":143}],340:[function(e,t,r){function n(e,t){var r={a:e};return i(e,t,r,0),r}function i(e,t,r,n){if(e!==t){var i=r[n],s=!1;if(x(e)||x(t))u(e,t,r,n);else if(null==t)_(e)||(a(e,r,n),i=r[n]),i=m(i,new y(y.REMOVE,e,t));else if(g(t))if(g(e))if(e.tagName===t.tagName&&e.namespace===t.namespace&&e.key===t.key){var c=S(e.properties,t.properties);c&&(i=m(i,new y(y.PROPS,e,c))),i=o(e,t,r,i,n)}else i=m(i,new y(y.VNODE,e,t)),s=!0;else i=m(i,new y(y.VNODE,e,t)),s=!0;else b(t)?b(e)?e.text!==t.text&&(i=m(i,new y(y.VTEXT,e,t))):(i=m(i,new y(y.VTEXT,e,t)),s=!0):_(t)&&(_(e)||(s=!0),i=m(i,new y(y.WIDGET,e,t)));i&&(r[n]=i),s&&a(e,r,n)}}function o(e,t,r,n,o){for(var a=e.children,s=p(a,t.children),u=s.children,c=a.length,l=u.length,h=c>l?c:l,f=0;f<h;f++){var d=a[f],v=u[f];o+=1,d?i(d,v,r,o):v&&(n=m(n,new y(y.INSERT,null,v))),g(d)&&d.count&&(o+=d.count)}return s.moves&&(n=m(n,new y(y.ORDER,e,s.moves))),n}function a(e,t,r){l(e,t,r),s(e,t,r)}function s(e,t,r){if(_(e))"function"==typeof e.destroy&&(t[r]=m(t[r],new y(y.REMOVE,e,null)));else if(g(e)&&(e.hasWidgets||e.hasThunks))for(var n=e.children,i=n.length,o=0;o<i;o++){var a=n[o];s(a,t,r+=1),g(a)&&a.count&&(r+=a.count)}else x(e)&&u(e,null,t,r)}function u(e,t,r,i){var o=w(e,t),a=n(o.a,o.b);c(a)&&(r[i]=new y(y.THUNK,null,a))}function c(e){for(var t in e)if("a"!==t)return!0;return!1}function l(e,t,r){if(g(e)){if(e.hooks&&(t[r]=m(t[r],new y(y.PROPS,e,h(e.hooks)))),e.descendantHooks||e.hasThunks)for(var n=e.children,i=n.length,o=0;o<i;o++){var a=n[o];l(a,t,r+=1),g(a)&&a.count&&(r+=a.count)}}else x(e)&&u(e,null,t,r)}function h(e){var t={};for(var r in e)t[r]=void 0;return t}function p(e,t){var r=d(t),n=r.keys,i=r.free;if(i.length===t.length)return{children:t,moves:null};var o=d(e),a=o.keys;if(o.free.length===e.length)return{children:t,moves:null};for(var s=[],u=0,c=i.length,l=0,h=0;h<e.length;h++){var p,m=e[h];m.key?n.hasOwnProperty(m.key)?(p=n[m.key],s.push(t[p])):(p=h-l++,s.push(null)):u<c?(p=i[u++],s.push(t[p])):(p=h-l++,s.push(null))}for(var v=u>=i.length?t.length:i[u],y=0;y<t.length;y++){var g=t[y];g.key?a.hasOwnProperty(g.key)||s.push(g):y>=v&&s.push(g)}for(var b,_=s.slice(),x=0,w=[],S=[],T=0;T<t.length;){var E=t[T];for(b=_[x];null===b&&_.length;)w.push(f(_,x,null)),b=_[x];b&&b.key===E.key?(x++,T++):E.key?(b&&b.key&&n[b.key]!==T+1?(w.push(f(_,x,b.key)),(b=_[x])&&b.key===E.key?x++:S.push({key:E.key,to:T})):S.push({key:E.key,to:T}),T++):b&&b.key&&w.push(f(_,x,b.key))}for(;x<_.length;)b=_[x],w.push(f(_,x,b&&b.key));return w.length!==l||S.length?{children:s,moves:{removes:w,inserts:S}}:{children:s,moves:null}}function f(e,t,r){return e.splice(t,1),{from:t,key:r}}function d(e){for(var t={},r=[],n=e.length,i=0;i<n;i++){var o=e[i];o.key?t[o.key]=i:r.push(i)}return{keys:t,free:r}}function m(e,t){return e?(v(e)?e.push(t):e=[e,t],e):t}var v=e("x-is-array"),y=e("../vnode/vpatch"),g=e("../vnode/is-vnode"),b=e("../vnode/is-vtext"),_=e("../vnode/is-widget"),x=e("../vnode/is-thunk"),w=e("../vnode/handle-thunk"),S=e("./diff-props");t.exports=n},{"../vnode/handle-thunk":329,"../vnode/is-thunk":330,"../vnode/is-vnode":332,"../vnode/is-vtext":333,"../vnode/is-widget":334,"../vnode/vpatch":337,"./diff-props":339,"x-is-array":359}],341:[function(e,t,r){!function(e){"use strict";e(function(e){return e("./makePromise")({scheduler:new(e("./Scheduler"))(e("./env").asap)})})}(function(r){t.exports=r(e)})},{"./Scheduler":342,"./env":354,"./makePromise":356}],342:[function(e,t,r){!function(e){"use strict";e(function(){function e(e){this._async=e,this._running=!1,this._queue=this,this._queueLen=0,this._afterQueue={},this._afterQueueLen=0;var t=this;this.drain=function(){t._drain()}}return e.prototype.enqueue=function(e){this._queue[this._queueLen++]=e,this.run()},e.prototype.afterQueue=function(e){this._afterQueue[this._afterQueueLen++]=e,this.run()},e.prototype.run=function(){this._running||(this._running=!0,this._async(this.drain))},e.prototype._drain=function(){for(var e=0;e<this._queueLen;++e)this._queue[e].run(),this._queue[e]=void 0;for(this._queueLen=0,this._running=!1,e=0;e<this._afterQueueLen;++e)this._afterQueue[e].run(),this._afterQueue[e]=void 0;this._afterQueueLen=0},e})}(function(e){t.exports=e()})},{}],343:[function(e,t,r){!function(e){"use strict";e(function(){function e(t){Error.call(this),this.message=t,this.name=e.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e})}(function(e){t.exports=e()})},{}],344:[function(e,t,r){!function(e){"use strict";e(function(){function e(e,r){function n(t,n){if(t.i<0)return r(t.f,t.thisArg,t.params,n);e._handler(t.args[t.i]).fold(i,t,void 0,n)}function i(e,t,r){e.params[e.i]=t,e.i-=1,n(e,r)}return arguments.length<2&&(r=t),function(t,i,o){var a=e._defer(),s=o.length;return n({f:t,thisArg:i,args:o,params:new Array(s),i:s-1,call:r},a._handler),a}}function t(e,t,r,n){try{n.resolve(e.apply(t,r))}catch(e){n.reject(e)}}return e.tryCatchResolve=t,e})}(function(e){t.exports=e()})},{}],345:[function(e,t,r){!function(e){"use strict";e(function(e){var t=e("../state"),r=e("../apply");return function(e){function n(t,r){for(var n=r.length,i=new Array(n),o=0,a=0;o<n;++o)r[o]&&(i[a++]=e._handler(t[o]).value);return i.length=a,i}function i(r){var n;return r instanceof e&&(n=r._handler.join()),n&&0===n.state()||!n?s(r).then(t.fulfilled,t.rejected):(n._unreport(),t.inspect(n))}function o(e){return function(t,r,n){return a(e,void 0,[t,r,n])}}var a=r(e),s=e.resolve,u=e.all,c=Array.prototype.reduce,l=Array.prototype.reduceRight,h=Array.prototype.slice;return e.any=function(t){for(var r,n,i=e._defer(),o=i._handler,a=t.length>>>0,s=a,u=[],c=0;c<a;++c)if(void 0!==(n=t[c])||c in t){if((r=e._handler(n)).state()>0){o.become(r),e._visitRemaining(t,c,r);break}r.visit(o,function(e){u=null,this.resolve(e)},function(e){this.resolved||(u.push(e),0==--s&&this.reject(u))})}else--s;return 0===s&&o.reject(new RangeError("any(): array must not be empty")),i},e.some=function(t,r){var n,i,o,a=e._defer(),s=a._handler,u=[],c=[],l=t.length>>>0,h=0;for(o=0;o<l;++o)(void 0!==(i=t[o])||o in t)&&++h;for(r=Math.max(r,0),n=h-r+1,r>(h=Math.min(r,h))?s.reject(new RangeError("some(): array must contain at least "+r+" item(s), but had "+h)):0===h&&s.resolve(u),o=0;o<l;++o)(void 0!==(i=t[o])||o in t)&&e._handler(i).visit(s,function(e){this.resolved||(u.push(e),0==--h&&(c=null,this.resolve(u)))},function(e){this.resolved||(c.push(e),0==--n&&(u=null,this.reject(c)))},s.notify);return a},e.settle=function(e){return u(e.map(i))},e.map=function(t,r){return e._traverse(r,t)},e.filter=function(t,r){var i=h.call(t);return e._traverse(r,i).then(function(e){return n(i,e)})},e.reduce=function(e,t){return arguments.length>2?c.call(e,o(t),arguments[2]):c.call(e,o(t))},e.reduceRight=function(e,t){return arguments.length>2?l.call(e,o(t),arguments[2]):l.call(e,o(t))},e.prototype.spread=function(e){return this.then(u).then(function(t){return e.apply(this,t)})},e}})}(function(r){t.exports=r(e)})},{"../apply":344,"../state":357}],346:[function(e,t,r){!function(e){"use strict";e(function(){function e(){throw new TypeError("catch predicate must be a function")}function t(e,t){return r(t)?e instanceof t:t(e)}function r(e){return e===Error||null!=e&&e.prototype instanceof Error}function n(e){return("object"==typeof e||"function"==typeof e)&&null!==e}function i(e){return e}return function(r){function o(e,r){return function(n){return t(n,r)?e.call(this,n):c(n)}}function a(e,t,r,i){var o=e.call(t);return n(o)?s(o,r,i):r(i)}function s(e,t,r){return u(e).then(function(){return t(r)})}var u=r.resolve,c=r.reject,l=r.prototype.catch;return r.prototype.done=function(e,t){this._handler.visit(this._handler.receiver,e,t)},r.prototype.catch=r.prototype.otherwise=function(t){return arguments.length<2?l.call(this,t):"function"!=typeof t?this.ensure(e):l.call(this,o(arguments[1],t))},r.prototype.finally=r.prototype.ensure=function(e){return"function"!=typeof e?this:this.then(function(t){return a(e,this,i,t)},function(t){return a(e,this,c,t)})},r.prototype.else=r.prototype.orElse=function(e){return this.then(void 0,function(){return e})},r.prototype.yield=function(e){return this.then(function(){return e})},r.prototype.tap=function(e){return this.then(e).yield(this)},r}})}(function(e){t.exports=e()})},{}],347:[function(e,t,r){!function(e){"use strict";e(function(){return function(e){return e.prototype.fold=function(t,r){var n=this._beget();return this._handler.fold(function(r,n,i){e._handler(r).fold(function(e,r,n){n.resolve(t.call(this,r,e))},n,this,i)},r,n._handler.receiver,n._handler),n},e}})}(function(e){t.exports=e()})},{}],348:[function(e,t,r){!function(e){"use strict";e(function(e){var t=e("../state").inspect;return function(e){return e.prototype.inspect=function(){return t(e._handler(this))},e}})}(function(r){t.exports=r(e)})},{"../state":357}],349:[function(e,t,r){!function(e){"use strict";e(function(){return function(e){function t(e,n,i,o){function a(o,a){return r(i(o)).then(function(){return t(e,n,i,a)})}return r(o).then(function(t){return r(n(t)).then(function(n){return n?t:r(e(t)).spread(a)})})}var r=e.resolve;return e.iterate=function(e,r,n,i){return t(function(t){return[t,e(t)]},r,n,i)},e.unfold=t,e}})}(function(e){t.exports=e()})},{}],350:[function(e,t,r){!function(e){"use strict";e(function(){return function(e){return e.prototype.progress=function(e){return this.then(void 0,void 0,e)},e}})}(function(e){t.exports=e()})},{}],351:[function(e,t,r){!function(e){"use strict";e(function(e){function t(e,t,n,i){return r.setTimer(function(){e(n,i,t)},t)}var r=e("../env"),n=e("../TimeoutError");return function(e){function i(e,r,n){t(o,e,r,n)}function o(e,t){t.resolve(e)}function a(e,t,r){var i=void 0===e?new n("timed out after "+r+"ms"):e;t.reject(i)}return e.prototype.delay=function(e){var t=this._beget();return this._handler.fold(i,e,void 0,t._handler),t},e.prototype.timeout=function(e,n){var i=this._beget(),o=i._handler,s=t(a,e,n,i._handler);return this._handler.visit(o,function(e){r.clearTimer(s),this.resolve(e)},function(e){r.clearTimer(s),this.reject(e)},o.notify),i},e}})}(function(r){t.exports=r(e)})},{"../TimeoutError":343,"../env":354}],352:[function(e,t,r){!function(e){"use strict";e(function(e){function t(e){throw e}function r(){}var n=e("../env").setTimer,i=e("../format");return function(e){function o(e){e.handled||(f.push(e),l("Potentially unhandled rejection ["+e.id+"] "+i.formatError(e.value)))}function a(e){var t=f.indexOf(e);t>=0&&(f.splice(t,1),h("Handled previous rejection ["+e.id+"] "+i.formatObject(e.value)))}function s(e,t){p.push(e,t),null===d&&(d=n(u,0))}function u(){for(d=null;p.length>0;)p.shift()(p.shift())}var c,l=r,h=r;"undefined"!=typeof console&&(c=console,l=void 0!==c.error?function(e){c.error(e)}:function(e){c.log(e)},h=void 0!==c.info?function(e){c.info(e)}:function(e){c.log(e)}),e.onPotentiallyUnhandledRejection=function(e){s(o,e)},e.onPotentiallyUnhandledRejectionHandled=function(e){s(a,e)},e.onFatalRejection=function(e){s(t,e.value)};var p=[],f=[],d=null;return e}})}(function(r){t.exports=r(e)})},{"../env":354,"../format":355}],353:[function(e,t,r){!function(e){"use strict";e(function(){return function(e){return e.prototype.with=e.prototype.withThis=function(e){var t=this._beget(),r=t._handler;return r.receiver=e,this._handler.chain(r,e),t},e}})}(function(e){t.exports=e()})},{}],354:[function(e,t,r){(function(r){!function(e){"use strict";e(function(e){var t,n="undefined"!=typeof setTimeout&&setTimeout,i=function(e,t){return setTimeout(e,t)},o=function(e){return clearTimeout(e)},a=function(e){return n(e,0)};if(void 0!==r&&"[object process]"===Object.prototype.toString.call(r))a=function(e){return r.nextTick(e)};else if(t="undefined"!=typeof MutationObserver&&MutationObserver||"undefined"!=typeof WebKitMutationObserver&&WebKitMutationObserver)a=function(e){var t,r=document.createTextNode("");new e(function(){var e=t;t=void 0,e()}).observe(r,{characterData:!0});var n=0;return function(e){t=e,r.data=n^=1}}(t);else if(!n){var s=e("vertx");i=function(e,t){return s.setTimer(t,e)},o=s.cancelTimer,a=s.runOnLoop||s.runOnContext}return{setTimer:i,clearTimer:o,asap:a}})}(function(r){t.exports=r(e)})}).call(this,e("_process"))},{_process:17}],355:[function(e,t,r){!function(e){"use strict";e(function(){function e(e){var r=String(e);return"[object Object]"===r&&"undefined"!=typeof JSON&&(r=t(e,r)),r}function t(e,t){try{return JSON.stringify(e)}catch(e){return t}}return{formatError:function(t){var r="object"==typeof t&&null!==t&&(t.stack||t.message)?t.stack||t.message:e(t);return t instanceof Error?r:r+" (WARNING: non-Error used)"},formatObject:e,tryStringify:t}})}(function(e){t.exports=e()})},{}],356:[function(e,t,r){(function(e){!function(t){"use strict";t(function(){return function(t){function r(e,t){this._handler=e===v?t:n(e)}function n(e){function t(e){r.reject(e)}var r=new g;try{e(function(e){r.resolve(e)},t,function(e){r.notify(e)})}catch(e){t(e)}return r}function i(e){return A(e)?e:new r(v,new b(f(e)))}function o(e){return new r(v,new b(new w(e)))}function a(){return X}function s(e,t){return new t(v,new g(e.receiver,e.join().context))}function u(e,t,n){function i(e,t,r){l[e]=t,0==--u&&r.become(new x(l))}for(var o,a="function"==typeof t?function(r,o,a){a.resolved||c(n,i,r,e(t,o,r),a)}:i,s=new g,u=n.length>>>0,l=new Array(u),h=0;h<n.length&&!s.resolved;++h)void 0!==(o=n[h])||h in n?c(n,a,h,o,s):--u;return 0===u&&s.become(new x(l)),new r(v,s)}function c(e,t,r,n,i){if(N(n)){var o=d(n),a=o.state();0===a?o.fold(t,r,void 0,i):a>0?t(r,o.value,i):(i.become(o),l(e,r+1,o))}else t(r,n,i)}function l(e,t,r){for(var n=t;n<e.length;++n)h(f(e[n]),r)}function h(e,t){if(e!==t){var r=e.state();0===r?e.visit(e,void 0,e._unreport):r<0&&e._unreport()}}function p(e){var t,n,i,o=new g;for(t=0;t<e.length;++t)if(void 0!==(n=e[t])||t in e){if(0!==(i=f(n)).state()){o.become(i),l(e,t+1,i);break}i.visit(o,o.resolve,o.reject)}return new r(v,o)}function f(e){return A(e)?e._handler.join():N(e)?m(e):new x(e)}function d(e){return A(e)?e._handler.join():m(e)}function m(e){try{var t=e.then;return"function"==typeof t?new _(t,e):new x(e)}catch(e){return new w(e)}}function v(){}function y(){}function g(e,t){r.createContext(this,t),this.consumers=void 0,this.receiver=e,this.handler=void 0,this.resolved=!1}function b(e){this.handler=e}function _(e,t){g.call(this),$.enqueue(new C(e,t,this))}function x(e){r.createContext(this),this.value=e}function w(e){r.createContext(this),this.id=++K,this.value=e,this.handled=!1,this.reported=!1,this._report()}function S(e,t){this.rejection=e,this.context=t}function T(e){this.rejection=e}function E(){return new w(new TypeError("Promise cycle"))}function O(e,t){this.continuation=e,this.handler=t}function M(e,t){this.handler=t,this.value=e}function C(e,t,r){this._then=e,this.thenable=t,this.resolver=r}function j(e,t,r,n,i){try{e.call(t,r,n,i)}catch(e){n(e)}}function P(e,t,r,n){this.f=e,this.z=t,this.c=r,this.to=n,this.resolver=Q,this.receiver=this}function A(e){return e instanceof r}function N(e){return("object"==typeof e||"function"==typeof e)&&null!==e}function L(e,t,n,i){if("function"!=typeof e)return i.become(t);r.enterContext(t),D(e,t.value,n,i),r.exitContext()}function I(e,t,n,i,o){if("function"!=typeof e)return o.become(n);r.enterContext(n),F(e,t,n.value,i,o),r.exitContext()}function R(e,t,n,i,o){if("function"!=typeof e)return o.notify(t);r.enterContext(n),V(e,t,i,o),r.exitContext()}function k(e,t,r){try{return e(t,r)}catch(e){return o(e)}}function D(e,t,r,n){try{n.become(f(e.call(r,t)))}catch(e){n.become(new w(e))}}function F(e,t,r,n,i){try{e.call(n,t,r,i)}catch(e){i.become(new w(e))}}function V(e,t,r,n){try{n.notify(e.call(r,t))}catch(e){n.notify(e)}}function B(e,t){t.prototype=W(e.prototype),t.prototype.constructor=t}function U(e,t){return t}function G(){}function z(){if("function"==typeof CustomEvent)try{return new CustomEvent("unhandledRejection")instanceof CustomEvent}catch(e){}return!1}function q(){if("undefined"!=typeof document&&"function"==typeof document.createEvent)try{return document.createEvent("CustomEvent").initCustomEvent("eventType",!1,!0,{}),!0}catch(e){}return!1}var $=t.scheduler,H=void 0!==e&&null!==e&&"function"==typeof e.emit?function(t,r){return"unhandledRejection"===t?e.emit(t,r.value,r):e.emit(t,r)}:"undefined"!=typeof self&&z()?function(e,t){return function(r,n){var i=new t(r,{detail:{reason:n.value,key:n},bubbles:!1,cancelable:!0});return!e.dispatchEvent(i)}}(self,CustomEvent):"undefined"!=typeof self&&q()?function(e,t){return function(r,n){var i=t.createEvent("CustomEvent");return i.initCustomEvent(r,!1,!0,{reason:n.value,key:n}),!e.dispatchEvent(i)}}(self,document):G,W=Object.create||function(e){function t(){}return t.prototype=e,new t};r.resolve=i,r.reject=o,r.never=a,r._defer=function(){return new r(v,new g)},r._handler=f,r.prototype.then=function(e,t,r){var n=this._handler,i=n.join().state();if("function"!=typeof e&&i>0||"function"!=typeof t&&i<0)return new this.constructor(v,n);var o=this._beget(),a=o._handler;return n.chain(a,n.receiver,e,t,r),o},r.prototype.catch=function(e){return this.then(void 0,e)},r.prototype._beget=function(){return s(this._handler,this.constructor)},r.all=function(e){return u(U,null,e)},r.race=function(e){return"object"!=typeof e||null===e?o(new TypeError("non-iterable passed to race()")):0===e.length?a():1===e.length?i(e[0]):p(e)},r._traverse=function(e,t){return u(k,e,t)},r._visitRemaining=l,v.prototype.when=v.prototype.become=v.prototype.notify=v.prototype.fail=v.prototype._unreport=v.prototype._report=G,v.prototype._state=0,v.prototype.state=function(){return this._state},v.prototype.join=function(){for(var e=this;void 0!==e.handler;)e=e.handler;return e},v.prototype.chain=function(e,t,r,n,i){this.when({resolver:e,receiver:t,fulfilled:r,rejected:n,progress:i})},v.prototype.visit=function(e,t,r,n){this.chain(Q,e,t,r,n)},v.prototype.fold=function(e,t,r,n){this.when(new P(e,t,r,n))},B(v,y),y.prototype.become=function(e){e.fail()};var Q=new y;B(v,g),g.prototype._state=0,g.prototype.resolve=function(e){this.become(f(e))},g.prototype.reject=function(e){this.resolved||this.become(new w(e))},g.prototype.join=function(){if(!this.resolved)return this;for(var e=this;void 0!==e.handler;)if((e=e.handler)===this)return this.handler=E();return e},g.prototype.run=function(){var e=this.consumers,t=this.handler;this.handler=this.handler.join(),this.consumers=void 0;for(var r=0;r<e.length;++r)t.when(e[r])},g.prototype.become=function(e){this.resolved||(this.resolved=!0,this.handler=e,void 0!==this.consumers&&$.enqueue(this),void 0!==this.context&&e._report(this.context))},g.prototype.when=function(e){this.resolved?$.enqueue(new O(e,this.handler)):void 0===this.consumers?this.consumers=[e]:this.consumers.push(e)},g.prototype.notify=function(e){this.resolved||$.enqueue(new M(e,this))},g.prototype.fail=function(e){var t=void 0===e?this.context:e;this.resolved&&this.handler.join().fail(t)},g.prototype._report=function(e){this.resolved&&this.handler.join()._report(e)},g.prototype._unreport=function(){this.resolved&&this.handler.join()._unreport()},B(v,b),b.prototype.when=function(e){$.enqueue(new O(e,this))},b.prototype._report=function(e){this.join()._report(e)},b.prototype._unreport=function(){this.join()._unreport()},B(g,_),B(v,x),x.prototype._state=1,x.prototype.fold=function(e,t,r,n){I(e,t,this,r,n)},x.prototype.when=function(e){L(e.fulfilled,this,e.receiver,e.resolver)};var K=0;B(v,w),w.prototype._state=-1,w.prototype.fold=function(e,t,r,n){n.become(this)},w.prototype.when=function(e){"function"==typeof e.rejected&&this._unreport(),L(e.rejected,this,e.receiver,e.resolver)},w.prototype._report=function(e){$.afterQueue(new S(this,e))},w.prototype._unreport=function(){this.handled||(this.handled=!0,$.afterQueue(new T(this)))},w.prototype.fail=function(e){this.reported=!0,H("unhandledRejection",this),r.onFatalRejection(this,void 0===e?this.context:e)},S.prototype.run=function(){this.rejection.handled||this.rejection.reported||(this.rejection.reported=!0,H("unhandledRejection",this.rejection)||r.onPotentiallyUnhandledRejection(this.rejection,this.context))},T.prototype.run=function(){this.rejection.reported&&(H("rejectionHandled",this.rejection)||r.onPotentiallyUnhandledRejectionHandled(this.rejection))},r.createContext=r.enterContext=r.exitContext=r.onPotentiallyUnhandledRejection=r.onPotentiallyUnhandledRejectionHandled=r.onFatalRejection=G;var X=new r(v,new v);return O.prototype.run=function(){this.handler.join().when(this.continuation)},M.prototype.run=function(){var e=this.handler.consumers;if(void 0!==e)for(var t,r=0;r<e.length;++r)R((t=e[r]).progress,this.value,this.handler,t.receiver,t.resolver)},C.prototype.run=function(){var e=this.resolver;j(this._then,this.thenable,function(t){e.resolve(t)},function(t){e.reject(t)},function(t){e.notify(t)})},P.prototype.fulfilled=function(e){this.f.call(this.c,this.z,e,this.to)},P.prototype.rejected=function(e){this.to.reject(e)},P.prototype.progress=function(e){this.to.notify(e)},r}})}(function(e){t.exports=e()})}).call(this,e("_process"))},{_process:17}],357:[function(e,t,r){!function(e){"use strict";e(function(){function e(){return{state:"pending"}}function t(e){return{state:"rejected",reason:e}}function r(e){return{state:"fulfilled",value:e}}return{pending:e,fulfilled:r,rejected:t,inspect:function(n){var i=n.state();return 0===i?e():i>0?r(n.value):t(n.value)}}})}(function(e){t.exports=e()})},{}],358:[function(e,t,r){!function(e){"use strict";e(function(e){function t(e,t,r,n){var i=m.resolve(e);return arguments.length<2?i:i.then(t,r,n)}function r(e){return function(){for(var t=0,r=arguments.length,n=new Array(r);t<r;++t)n[t]=arguments[t];return v(e,this,n)}}function n(e){for(var t=0,r=arguments.length-1,n=new Array(r);t<r;++t)n[t]=arguments[t+1];return v(e,this,n)}function i(){function e(e){n._handler.resolve(e)}function t(e){n._handler.reject(e)}function r(e){n._handler.notify(e)}var n=m._defer();this.promise=n,this.resolve=e,this.reject=t,this.notify=r,this.resolver={resolve:e,reject:t,notify:r}}var o=e("./lib/decorators/timed"),a=e("./lib/decorators/array"),s=e("./lib/decorators/flow"),u=e("./lib/decorators/fold"),c=e("./lib/decorators/inspect"),l=e("./lib/decorators/iterate"),h=e("./lib/decorators/progress"),p=e("./lib/decorators/with"),f=e("./lib/decorators/unhandledRejection"),d=e("./lib/TimeoutError"),m=[a,s,u,l,h,c,p,o,f].reduce(function(e,t){return t(e)},e("./lib/Promise")),v=e("./lib/apply")(m);return t.promise=function(e){return new m(e)},t.resolve=m.resolve,t.reject=m.reject,t.lift=r,t.try=n,t.attempt=n,t.iterate=m.iterate,t.unfold=m.unfold,t.join=function(){return m.all(arguments)},t.all=function(e){return t(e,m.all)},t.settle=function(e){return t(e,m.settle)},t.any=r(m.any),t.some=r(m.some),t.race=r(m.race),t.map=function(e,r){return t(e,function(e){return m.map(e,r)})},t.filter=function(e,r){return t(e,function(e){return m.filter(e,r)})},t.reduce=r(m.reduce),t.reduceRight=r(m.reduceRight),t.isPromiseLike=function(e){return e&&"function"==typeof e.then},t.Promise=m,t.defer=function(){return new i},t.TimeoutError=d,t})}(function(r){t.exports=r(e)})},{"./lib/Promise":341,"./lib/TimeoutError":343,"./lib/apply":344,"./lib/decorators/array":345,"./lib/decorators/flow":346,"./lib/decorators/fold":347,"./lib/decorators/inspect":348,"./lib/decorators/iterate":349,"./lib/decorators/progress":350,"./lib/decorators/timed":351,"./lib/decorators/unhandledRejection":352,"./lib/decorators/with":353}],359:[function(e,t,r){var n=Array.isArray,i=Object.prototype.toString;t.exports=n||function(e){return"[object Array]"===i.call(e)}},{}],360:[function(e,t,r){!function(n,i){"object"==typeof r&&void 0!==t?i(r,e("zen-observable")):i((n.apolloLink=n.apolloLink||{},n.apolloLink.zenObservable={}),n.Observable)}(this,function(e,t){"use strict";var r=t=t&&t.hasOwnProperty("default")?t.default:t;e.default=r,e.Observable=r,Object.defineProperty(e,"__esModule",{value:!0})})},{"zen-observable":361}],361:[function(e,t,r){t.exports=e("./lib/Observable.js").Observable},{"./lib/Observable.js":362}],362:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function o(e){var t=e.constructor;return void 0!==t&&null===(t=t[y("species")])&&(t=void 0),void 0!==t?t:_}function a(e){return e instanceof _}function s(e){s.log?s.log(e):setTimeout(function(){throw e})}function u(e){Promise.resolve().then(function(){try{e()}catch(e){s(e)}})}function c(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=i(t,"unsubscribe");r&&r.call(t)}}catch(e){s(e)}}function l(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function h(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(p(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}function p(e,t,r){e._state="running";var n=e._observer;try{var o=i(n,t);switch(t){case"next":o&&o.call(n,r);break;case"error":if(l(e),!o)throw r;o.call(n,r);break;case"complete":l(e),o&&o.call(n)}}catch(e){s(e)}"closed"===e._state?c(e):"running"===e._state&&(e._state="ready")}function f(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void u(function(){return h(e)})):void p(e,t,r);e._queue.push({type:t,value:r})}}Object.defineProperty(r,"__esModule",{value:!0});var d=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),m=function(){return"function"==typeof Symbol},v=function(e){return m()&&Boolean(Symbol[e])},y=function(e){return v(e)?Symbol[e]:"@@"+e};m()&&!v("observable")&&(Symbol.observable=Symbol("observable"));var g=function(){function e(t,r){n(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new b(this);try{this._cleanup=r.call(void 0,i)}catch(e){i.error(e)}"initializing"===this._state&&(this._state="ready")}return d(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(l(this),c(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),b=function(){function e(t){n(this,e),this._subscription=t}return d(e,[{key:"next",value:function(e){f(this._subscription,"next",e)}},{key:"error",value:function(e){f(this._subscription,"error",e)}},{key:"complete",value:function(){f(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),_=r.Observable=function(){function e(t){if(n(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return d(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new g(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise(function(r,n){function i(){o.unsubscribe(),r()}if("function"==typeof e)var o=t.subscribe({next:function(t){try{e(t,i)}catch(e){n(e),o.unsubscribe()}},error:n,complete:r});else n(new TypeError(e+" is not a function"))})}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(o(this))(function(r){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})})}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(o(this))(function(r){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})})}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=o(this),n=arguments.length>1,i=!1,a=arguments[1];return new r(function(r){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||n)try{a=e(a,t)}catch(e){return r.error(e)}else a=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(a),r.complete()}})})}},{key:"concat",value:function(){for(var e=this,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=o(this);return new i(function(t){function n(e){o=e.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){0===r.length?(o=void 0,t.complete()):n(i.from(r.shift()))}})}var o=void 0;return n(e),function(){o&&(o.unsubscribe(),o=void 0)}})}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=o(this);return new r(function(n){function i(){a.closed&&0===o.length&&n.complete()}var o=[],a=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return n.error(e)}var a=r.from(t).subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){var e=o.indexOf(a);e>=0&&o.splice(e,1),i()}});o.push(a)},error:function(e){n.error(e)},complete:function(){i()}});return function(){o.forEach(function(e){return e.unsubscribe()}),a.unsubscribe()}})}},{key:y("observable"),value:function(){return this}}],[{key:"from",value:function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=i(t,y("observable"));if(n){var o=n.call(t);if(Object(o)!==o)throw new TypeError(o+" is not an object");return a(o)&&o.constructor===r?o:new r(function(e){return o.subscribe(e)})}if(v("iterator")&&(n=i(t,y("iterator"))))return new r(function(e){u(function(){if(!e.closed){var r=!0,i=!1,o=void 0;try{for(var a,s=n.call(t)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var u=a.value;if(e.next(u),e.closed)return}}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}e.complete()}})});if(Array.isArray(t))return new r(function(e){u(function(){if(!e.closed){for(var r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}})});throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return new("function"==typeof this?this:e)(function(e){u(function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}})})}},{key:y("species"),get:function(){return this}}]),e}();m()&&Object.defineProperty(_,Symbol("extensions"),{value:{symbol:y("observable"),hostReportError:s},configurabe:!0})},{}],363:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./api/APIv3");r.APIv3=n.APIv3;var i=e("./api/ModelCreator");r.ModelCreator=i.ModelCreator},{"./api/APIv3":376,"./api/ModelCreator":377}],364:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}(e("./Support"));var n=e("./Edge");r.EdgeDirection=n.EdgeDirection;var i=e("./Render");r.RenderMode=i.RenderMode;var o=e("./Viewer");r.Alignment=o.Alignment,r.ImageSize=o.ImageSize,r.Viewer=o.Viewer;var a=e("./component/tag/Tag");r.TagComponent=a;var s=e("./component/marker/Marker");r.MarkerComponent=s;var u=e("./component/popup/Popup");r.PopupComponent=u},{"./Edge":366,"./Render":370,"./Support":372,"./Viewer":375,"./component/marker/Marker":405,"./component/popup/Popup":423,"./component/tag/Tag":429}],365:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./component/Component");r.Component=n.Component;var i=e("./component/ComponentService");r.ComponentService=i.ComponentService;var o=e("./component/utils/HandlerBase");r.HandlerBase=o.HandlerBase;var a=e("./component/BackgroundComponent");r.BackgroundComponent=a.BackgroundComponent;var s=e("./component/BearingComponent");r.BearingComponent=s.BearingComponent;var u=e("./component/CacheComponent");r.CacheComponent=u.CacheComponent;var c=e("./component/CoverComponent");r.CoverComponent=c.CoverComponent;var l=e("./component/DebugComponent");r.DebugComponent=l.DebugComponent;var h=e("./component/direction/DirectionComponent");r.DirectionComponent=h.DirectionComponent;var p=e("./component/direction/DirectionDOMCalculator");r.DirectionDOMCalculator=p.DirectionDOMCalculator;var f=e("./component/direction/DirectionDOMRenderer");r.DirectionDOMRenderer=f.DirectionDOMRenderer;var d=e("./component/ImageComponent");r.ImageComponent=d.ImageComponent;var m=e("./component/keyboard/KeyboardComponent");r.KeyboardComponent=m.KeyboardComponent;var v=e("./component/keyboard/KeyZoomHandler");r.KeyZoomHandler=v.KeyZoomHandler;var y=e("./component/keyboard/KeySequenceNavigationHandler");r.KeySequenceNavigationHandler=y.KeySequenceNavigationHandler;var g=e("./component/keyboard/KeySpatialNavigationHandler");r.KeySpatialNavigationHandler=g.KeySpatialNavigationHandler;var b=e("./component/LoadingComponent");r.LoadingComponent=b.LoadingComponent;var _=e("./component/marker/marker/Marker");r.Marker=_.Marker;var x=e("./component/marker/MarkerComponent");r.MarkerComponent=x.MarkerComponent;var w=e("./component/marker/MarkerScene");r.MarkerScene=w.MarkerScene;var S=e("./component/marker/MarkerSet");r.MarkerSet=S.MarkerSet;var T=e("./component/mouse/MouseComponent");r.MouseComponent=T.MouseComponent;var E=e("./component/mouse/BounceHandler");r.BounceHandler=E.BounceHandler;var O=e("./component/mouse/DragPanHandler");r.DragPanHandler=O.DragPanHandler;var M=e("./component/mouse/DoubleClickZoomHandler");r.DoubleClickZoomHandler=M.DoubleClickZoomHandler;var C=e("./component/mouse/ScrollZoomHandler");r.ScrollZoomHandler=C.ScrollZoomHandler;var j=e("./component/mouse/TouchZoomHandler");r.TouchZoomHandler=j.TouchZoomHandler;var P=e("./component/popup/popup/Popup");r.Popup=P.Popup;var A=e("./component/popup/PopupComponent");r.PopupComponent=A.PopupComponent;var N=e("./component/NavigationComponent");r.NavigationComponent=N.NavigationComponent;var L=e("./component/RouteComponent");r.RouteComponent=L.RouteComponent;var I=e("./component/sequence/SequenceComponent");r.SequenceComponent=I.SequenceComponent;var R=e("./component/sequence/SequenceDOMRenderer");r.SequenceDOMRenderer=R.SequenceDOMRenderer;var k=e("./component/sequence/SequenceDOMInteraction");r.SequenceDOMInteraction=k.SequenceDOMInteraction;var D=e("./component/imageplane/ImagePlaneComponent");r.ImagePlaneComponent=D.ImagePlaneComponent;var F=e("./component/imageplane/ImagePlaneFactory");r.ImagePlaneFactory=F.ImagePlaneFactory;var V=e("./component/imageplane/ImagePlaneGLRenderer");r.ImagePlaneGLRenderer=V.ImagePlaneGLRenderer;var B=e("./component/imageplane/ImagePlaneScene");r.ImagePlaneScene=B.ImagePlaneScene;var U=e("./component/imageplane/ImagePlaneShaders");r.ImagePlaneShaders=U.ImagePlaneShaders;var G=e("./component/marker/marker/SimpleMarker");r.SimpleMarker=G.SimpleMarker;var z=e("./component/marker/marker/CircleMarker");r.CircleMarker=z.CircleMarker;var q=e("./component/imageplane/SliderComponent");r.SliderComponent=q.SliderComponent;var $=e("./component/StatsComponent");r.StatsComponent=$.StatsComponent;var H=e("./component/path/PathComponent");r.PathComponent=H.PathComponent;var W=e("./component/tag/handlers/TagHandlerBase");r.TagHandlerBase=W.TagHandlerBase;var Q=e("./component/tag/handlers/CreateHandlerBase");r.CreateHandlerBase=Q.CreateHandlerBase;var K=e("./component/tag/handlers/CreatePointHandler");r.CreatePointHandler=K.CreatePointHandler;var X=e("./component/tag/handlers/CreateVertexHandler");r.CreateVertexHandler=X.CreateVertexHandler;var Y=e("./component/tag/handlers/CreatePolygonHandler");r.CreatePolygonHandler=Y.CreatePolygonHandler;var Z=e("./component/tag/handlers/CreateRectHandler");r.CreateRectHandler=Z.CreateRectHandler;var J=e("./component/tag/handlers/CreateRectDragHandler");r.CreateRectDragHandler=J.CreateRectDragHandler;var ee=e("./component/tag/handlers/EditVertexHandler");r.EditVertexHandler=ee.EditVertexHandler;var te=e("./component/tag/tag/Tag");r.Tag=te.Tag;var re=e("./component/tag/tag/OutlineTag");r.OutlineTag=re.OutlineTag;var ne=e("./component/tag/tag/RenderTag");r.RenderTag=ne.RenderTag;var ie=e("./component/tag/tag/OutlineRenderTag");r.OutlineRenderTag=ie.OutlineRenderTag;var oe=e("./component/tag/tag/OutlineCreateTag");r.OutlineCreateTag=oe.OutlineCreateTag;var ae=e("./component/tag/tag/SpotTag");r.SpotTag=ae.SpotTag;var se=e("./component/tag/tag/SpotRenderTag");r.SpotRenderTag=se.SpotRenderTag;var ue=e("./component/tag/TagComponent");r.TagComponent=ue.TagComponent;var ce=e("./component/tag/TagCreator");r.TagCreator=ce.TagCreator;var le=e("./component/tag/TagDOMRenderer");r.TagDOMRenderer=le.TagDOMRenderer;var he=e("./component/tag/TagMode");r.TagMode=he.TagMode;var pe=e("./component/tag/TagOperation");r.TagOperation=pe.TagOperation;var fe=e("./component/tag/TagScene");r.TagScene=fe.TagScene;var de=e("./component/tag/TagSet");r.TagSet=de.TagSet;var me=e("./component/tag/geometry/Geometry");r.Geometry=me.Geometry;var ve=e("./component/tag/geometry/VertexGeometry");r.VertexGeometry=ve.VertexGeometry;var ye=e("./component/tag/geometry/RectGeometry");r.RectGeometry=ye.RectGeometry;var ge=e("./component/tag/geometry/PointGeometry");r.PointGeometry=ge.PointGeometry;var be=e("./component/tag/geometry/PolygonGeometry");r.PolygonGeometry=be.PolygonGeometry;var _e=e("./component/tag/error/GeometryTagError");r.GeometryTagError=_e.GeometryTagError,function(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}(e("./component/interfaces/interfaces"))},{"./component/BackgroundComponent":378,"./component/BearingComponent":379,"./component/CacheComponent":380,"./component/Component":381,"./component/ComponentService":382,"./component/CoverComponent":383,"./component/DebugComponent":384,"./component/ImageComponent":385,"./component/LoadingComponent":386,"./component/NavigationComponent":387,"./component/RouteComponent":388,"./component/StatsComponent":389,"./component/direction/DirectionComponent":390,"./component/direction/DirectionDOMCalculator":391,"./component/direction/DirectionDOMRenderer":392,"./component/imageplane/ImagePlaneComponent":393,"./component/imageplane/ImagePlaneFactory":394,"./component/imageplane/ImagePlaneGLRenderer":395,"./component/imageplane/ImagePlaneScene":396,"./component/imageplane/ImagePlaneShaders":397,"./component/imageplane/SliderComponent":398,"./component/interfaces/interfaces":400,"./component/keyboard/KeySequenceNavigationHandler":401,"./component/keyboard/KeySpatialNavigationHandler":402,"./component/keyboard/KeyZoomHandler":403,"./component/keyboard/KeyboardComponent":404,"./component/marker/MarkerComponent":406,"./component/marker/MarkerScene":407,"./component/marker/MarkerSet":408,"./component/marker/marker/CircleMarker":410,"./component/marker/marker/Marker":411,"./component/marker/marker/SimpleMarker":412,"./component/mouse/BounceHandler":413,"./component/mouse/DoubleClickZoomHandler":414,"./component/mouse/DragPanHandler":415,"./component/mouse/MouseComponent":416,"./component/mouse/ScrollZoomHandler":417,"./component/mouse/TouchZoomHandler":418,"./component/path/PathComponent":419,"./component/popup/PopupComponent":424,"./component/popup/popup/Popup":425,"./component/sequence/SequenceComponent":426,"./component/sequence/SequenceDOMInteraction":427,"./component/sequence/SequenceDOMRenderer":428,"./component/tag/TagComponent":430,"./component/tag/TagCreator":431,"./component/tag/TagDOMRenderer":432,"./component/tag/TagMode":433,"./component/tag/TagOperation":434,"./component/tag/TagScene":435,"./component/tag/TagSet":436,"./component/tag/error/GeometryTagError":437,"./component/tag/geometry/Geometry":438,"./component/tag/geometry/PointGeometry":439,"./component/tag/geometry/PolygonGeometry":440,"./component/tag/geometry/RectGeometry":441,"./component/tag/geometry/VertexGeometry":442,"./component/tag/handlers/CreateHandlerBase":443,"./component/tag/handlers/CreatePointHandler":444,"./component/tag/handlers/CreatePolygonHandler":445,"./component/tag/handlers/CreateRectDragHandler":446,"./component/tag/handlers/CreateRectHandler":447,"./component/tag/handlers/CreateVertexHandler":448,"./component/tag/handlers/EditVertexHandler":449,"./component/tag/handlers/TagHandlerBase":450,"./component/tag/tag/OutlineCreateTag":451,"./component/tag/tag/OutlineRenderTag":452,"./component/tag/tag/OutlineTag":453,"./component/tag/tag/RenderTag":454,"./component/tag/tag/SpotRenderTag":455,"./component/tag/tag/SpotTag":456,"./component/tag/tag/Tag":457,"./component/utils/HandlerBase":458}],366:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./graph/edge/EdgeDirection");r.EdgeDirection=n.EdgeDirection;var i=e("./graph/edge/EdgeCalculatorSettings");r.EdgeCalculatorSettings=i.EdgeCalculatorSettings;var o=e("./graph/edge/EdgeCalculatorDirections");r.EdgeCalculatorDirections=o.EdgeCalculatorDirections;var a=e("./graph/edge/EdgeCalculatorCoefficients");r.EdgeCalculatorCoefficients=a.EdgeCalculatorCoefficients;var s=e("./graph/edge/EdgeCalculator");r.EdgeCalculator=s.EdgeCalculator},{"./graph/edge/EdgeCalculator":476,"./graph/edge/EdgeCalculatorCoefficients":477,"./graph/edge/EdgeCalculatorDirections":478,"./graph/edge/EdgeCalculatorSettings":479,"./graph/edge/EdgeDirection":480}],367:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./error/ArgumentBeeviewError");r.ArgumentBeeviewError=n.ArgumentBeeviewError;var i=e("./error/GraphBeeviewError");r.GraphBeeviewError=i.GraphBeeviewError;var o=e("./error/BeeviewError");r.BeeviewError=o.BeeviewError},{"./error/ArgumentBeeviewError":459,"./error/BeeviewError":460,"./error/GraphBeeviewError":461}],368:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./geo/Camera");r.Camera=n.Camera;var i=e("./geo/GeoCoords");r.GeoCoords=i.GeoCoords;var o=e("./geo/ViewportCoords");r.ViewportCoords=o.ViewportCoords;var a=e("./geo/Spatial");r.Spatial=a.Spatial;var s=e("./geo/Transform");r.Transform=s.Transform},{"./geo/Camera":462,"./geo/GeoCoords":463,"./geo/Spatial":464,"./geo/Transform":465,"./geo/ViewportCoords":466}],369:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./graph/FilterCreator");r.FilterCreator=n.FilterCreator;var i=e("./graph/Graph");r.Graph=i.Graph;var o=e("./graph/GraphCalculator");r.GraphCalculator=o.GraphCalculator;var a=e("./graph/GraphService");r.GraphService=a.GraphService;var s=e("./graph/ImageLoadingService");r.ImageLoadingService=s.ImageLoadingService;var u=e("./graph/MeshReader");r.MeshReader=u.MeshReader;var c=e("./graph/Node");r.Node=c.Node;var l=e("./graph/NodeCache");r.NodeCache=l.NodeCache;var h=e("./graph/Sequence");r.Sequence=h.Sequence},{"./graph/FilterCreator":467,"./graph/Graph":468,"./graph/GraphCalculator":469,"./graph/GraphService":470,"./graph/ImageLoadingService":471,"./graph/MeshReader":472,"./graph/Node":473,"./graph/NodeCache":474,"./graph/Sequence":475}],370:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./render/DOMRenderer");r.DOMRenderer=n.DOMRenderer;var i=e("./render/GLRenderer");r.GLRenderer=i.GLRenderer;var o=e("./render/GLRenderStage");r.GLRenderStage=o.GLRenderStage;var a=e("./render/RenderCamera");r.RenderCamera=a.RenderCamera;var s=e("./render/RenderMode");r.RenderMode=s.RenderMode;var u=e("./render/RenderService");r.RenderService=u.RenderService},{"./render/DOMRenderer":481,"./render/GLRenderStage":482,"./render/GLRenderer":483,"./render/RenderCamera":484,"./render/RenderMode":485,"./render/RenderService":486}],371:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./state/State");r.State=n.State;var i=e("./state/states/StateBase");r.StateBase=i.StateBase;var o=e("./state/StateContext");r.StateContext=o.StateContext;var a=e("./state/StateService");r.StateService=a.StateService;var s=e("./state/states/TraversingState");r.TraversingState=s.TraversingState;var u=e("./state/states/WaitingState");r.WaitingState=u.WaitingState},{"./state/State":487,"./state/StateContext":488,"./state/StateService":489,"./state/states/StateBase":490,"./state/states/TraversingState":491,"./state/states/WaitingState":492}],372:[function(e,t,r){"use strict";function n(){return i.isBrowser()&&i.isArraySupported()&&i.isFunctionSupported()&&i.isJSONSupported()&&i.isObjectSupported()}Object.defineProperty(r,"__esModule",{value:!0});var i=e("./utils/Support");r.isSupported=function(){return n()&&i.isWebGLSupportedCached()},r.isFallbackSupported=n},{"./utils/Support":500}],373:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./tiles/ImageTileLoader");r.ImageTileLoader=n.ImageTileLoader;var i=e("./tiles/ImageTileStore");r.ImageTileStore=i.ImageTileStore;var o=e("./tiles/TextureProvider");r.TextureProvider=o.TextureProvider;var a=e("./tiles/RegionOfInterestCalculator");r.RegionOfInterestCalculator=a.RegionOfInterestCalculator},{"./tiles/ImageTileLoader":493,"./tiles/ImageTileStore":494,"./tiles/RegionOfInterestCalculator":495,"./tiles/TextureProvider":496}],374:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./utils/DOM");r.DOM=n.DOM;var i=e("./utils/EventEmitter");r.EventEmitter=i.EventEmitter;var o=e("./utils/Settings");r.Settings=o.Settings,function(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}(e("./utils/Support"));var a=e("./utils/Urls");r.Urls=a.Urls},{"./utils/DOM":497,"./utils/EventEmitter":498,"./utils/Settings":499,"./utils/Support":500,"./utils/Urls":501}],375:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./viewer/Alignment");r.Alignment=n.Alignment;var i=e("./viewer/CacheService");r.CacheService=i.CacheService;var o=e("./viewer/ComponentController");r.ComponentController=o.ComponentController;var a=e("./viewer/Container");r.Container=a.Container;var s=e("./viewer/Observer");r.Observer=s.Observer;var u=e("./viewer/ImageSize");r.ImageSize=u.ImageSize;var c=e("./viewer/KeyboardService");r.KeyboardService=c.KeyboardService;var l=e("./viewer/LoadingService");r.LoadingService=l.LoadingService;var h=e("./viewer/MouseService");r.MouseService=h.MouseService;var p=e("./viewer/Navigator");r.Navigator=p.Navigator;var f=e("./viewer/Projection");r.Projection=f.Projection;var d=e("./viewer/SpriteService");r.SpriteService=d.SpriteService;var m=e("./viewer/TouchService");r.TouchService=m.TouchService;var v=e("./viewer/Viewer");r.Viewer=v.Viewer},{"./viewer/Alignment":502,"./viewer/CacheService":503,"./viewer/ComponentController":504,"./viewer/Container":505,"./viewer/ImageSize":506,"./viewer/KeyboardService":507,"./viewer/LoadingService":508,"./viewer/MouseService":509,"./viewer/Navigator":510,"./viewer/Observer":511,"./viewer/Projection":512,"./viewer/SpriteService":513,"./viewer/TouchService":514,"./viewer/Viewer":515}],376:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/Observable");e("rxjs/add/observable/defer"),e("rxjs/add/observable/fromPromise"),e("rxjs/add/operator/catch"),e("rxjs/add/operator/map");var i=e("../API"),o=e("../utils/Urls"),a=function(){function e(e,t,r){this._clientId=e,this._modelCreator=null!=r?r:new i.ModelCreator,this._model=this._modelCreator.createModel(e,t),this._graphQL=this._modelCreator.createGraphQL(),this._pageCount=1,this._pathImageByKey="imageByKey",this._pathImageCloseTo="imageCloseTo",this._pathImagesByH="imagesByH",this._pathImageViewAdd="imageViewAdd",this._pathSequenceByKey="sequenceByKey",this._pathSequenceViewAdd="sequenceViewAdd",this._pathFetchSequences="fetchSequences",this._propertiesCore=["cl","l","sequence"],this._propertiesFill=["captured_at","user","project"],this._propertiesKey=["key"],this._propertiesSequence=["keys"],this._propertiesBuilding=["country","city","building","floor","loop_line","tags"],this._propertiesSpatial=["atomic_scale","ca","calt","cca","cfocal","gpano","height","merge_cc","merge_version","c_rotation","c_translation","orientation","width"],this._propertiesUser=["username"]}return e.prototype.pathByBuildingId$=function(e){return this._wrapPromise$(fetch(o.Urls.fetchBuildings()+"/"+e).then(function(e){return e.json()}))},e.prototype.imageByKeyFill$=function(e){return this._catchInvalidateGet$(this._wrapPromise$(this._model.get([this._pathImageByKey,e,this._propertiesKey.concat(this._propertiesFill).concat(this._propertiesSpatial).concat(this._propertiesBuilding),this._propertiesKey.concat(this._propertiesUser)])).map(function(t){if(!t)throw new Error("Images ("+e.join(", ")+") could not be found.");return t.json.imageByKey}),this._pathImageByKey,e)},e.prototype.imageByKeyFull$=function(e){return this._catchInvalidateGet$(this._wrapPromise$(this._model.get([this._pathImageByKey,e,this._propertiesKey.concat(this._propertiesCore).concat(this._propertiesFill).concat(this._propertiesSpatial).concat(this._propertiesBuilding),this._propertiesKey.concat(this._propertiesUser)])).map(function(t){if(!t)throw new Error("Images ("+e.join(", ")+") could not be found.");return t.json.imageByKey}),this._pathImageByKey,e)},e.prototype.imageCloseTo$=function(e,t){var r=t+":"+e;return this._catchInvalidateGet$(this._wrapPromise$(this._model.get([this._pathImageCloseTo,[r],this._propertiesKey.concat(this._propertiesCore).concat(this._propertiesFill).concat(this._propertiesSpatial).concat(this._propertiesBuilding),this._propertiesKey.concat(this._propertiesUser)])).map(function(e){return null!=e?e.json.imageCloseTo[r]:null}),this._pathImageCloseTo,[r])},e.prototype.imagesByH$=function(e){var t=this;return this._catchInvalidateGet$(this._wrapPromise$(this._model.get([this._pathImagesByH,e,{from:0,to:this._pageCount},this._propertiesKey.concat(this._propertiesCore).concat(this._propertiesBuilding),this._propertiesKey])).map(function(r){if(null==r){r={json:{imagesByH:{}}};for(var n=0,i=e;n<i.length;n++){var o=i[n];r.json.imagesByH[o]={};for(var a=0;a<=t._pageCount;a++)r.json.imagesByH[o][a]=null}}return r.json.imagesByH}),this._pathImagesByH,e)},e.prototype.imageViewAdd$=function(e){return this._catchInvalidateCall$(this._wrapPromise$(this._model.call([this._pathImageViewAdd],[e])),this._pathImageViewAdd,e)},e.prototype.invalidateImageByKey=function(e){this._invalidateGet(this._pathImageByKey,e)},e.prototype.invalidateImagesByH=function(e){this._invalidateGet(this._pathImagesByH,e)},e.prototype.invalidateSequenceByKey=function(e){this._invalidateGet(this._pathSequenceByKey,e)},e.prototype.setToken=function(e){this._model.invalidate([]),this._model=null,this._model=this._modelCreator.createModel(this._clientId,e)},e.prototype.sequenceByKey$=function(e){return this._catchInvalidateGet$(this._wrapPromise$(this._model.get([this._pathSequenceByKey,e,this._propertiesKey.concat(this._propertiesSequence).concat(this._propertiesBuilding)])).map(function(e){return e.json.sequenceByKey}),this._pathSequenceByKey,e)},e.prototype.fetchSequences$=function(e){var t=this;return this._catchInvalidateGet$(this._wrapPromise$(this._model.get([this._pathFetchSequences,[JSON.stringify(e)],{from:0,to:this._pageCount},this._propertiesKey.concat(this._propertiesSequence).concat(this._propertiesBuilding)])).map(function(r){for(var n=r.json.fetchSequences[JSON.stringify(e)],i=[],o=0;o<t._pageCount;o++)null!=n[o]&&i.push(n[o]);return i}),this._pathFetchSequences,[])},e.prototype.sequenceViewAdd$=function(e){return this._catchInvalidateCall$(this._wrapPromise$(this._model.call([this._pathSequenceViewAdd],[e])),this._pathSequenceViewAdd,e)},Object.defineProperty(e.prototype,"clientId",{get:function(){return this._clientId},enumerable:!0,configurable:!0}),e.prototype._catchInvalidateGet$=function(e,t,r){var n=this;return e.catch(function(e){throw n._invalidateGet(t,r),e})},e.prototype._catchInvalidateCall$=function(e,t,r){var n=this;return e.catch(function(e){throw n._invalidateCall(t,r),e})},e.prototype._invalidateGet=function(e,t){this._model.invalidate([e,t])},e.prototype._invalidateCall=function(e,t){this._model.invalidate([e],[t])},e.prototype._wrapPromise$=function(e){return n.Observable.defer(function(){return n.Observable.fromPromise(e)})},e}();r.APIv3=a,r.default=a},{"../API":363,"../utils/Urls":501,"rxjs/Observable":157,"rxjs/add/observable/defer":167,"rxjs/add/observable/fromPromise":171,"rxjs/add/operator/catch":180,"rxjs/add/operator/map":193}],377:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("falcor"),i=e("falcor-http-datasource"),o=e("apollo-boost"),a=e("../Utils"),s=function(){function e(){}return e.prototype.createModel=function(e,t){var r={crossDomain:!0,withCredentials:!1};return null!=t&&(r.headers={Authorization:"Bearer "+t}),new n.Model({maxSize:1677721600,source:new i(a.Urls.falcorModel(e),r)})},e.prototype.createGraphQL=function(){return new o.default({uri:a.Urls.fetchGraphql()})},e}();r.ModelCreator=s,r.default=s},{"../Utils":374,"apollo-boost":3,falcor:26,"falcor-http-datasource":21}],378:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("virtual-dom"),o=e("../Component"),a=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}return n(t,e),t.prototype._activate=function(){this._container.domRenderer.render$.next({name:this._name,vnode:this._getBackgroundNode("The viewer can't display the given photo.")})},t.prototype._deactivate=function(){},t.prototype._getDefaultConfiguration=function(){return{}},t.prototype._getBackgroundNode=function(e){return i.h("div.BackgroundWrapper",{},[i.h("p",{textContent:e},[])])},t.componentName="background",t}(o.Component);r.BackgroundComponent=a,o.ComponentService.register(a),r.default=a},{"../Component":365,"virtual-dom":317}],379:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("virtual-dom"),o=e("rxjs/Observable"),a=e("../Component"),s=e("../Geo"),u=function(e){function t(t,r,n){var i=e.call(this,t,r,n)||this;return i._spatial=new s.Spatial,i._svgNamespace="http://www.w3.org/2000/svg",i._distinctThreshold=Math.PI/90,i}return n(t,e),t.prototype._activate=function(){var e=this,t=this._navigator.stateService.currentState$.distinctUntilChanged(void 0,function(e){return e.state.currentNode.key}).map(function(t){var r=t.state.currentNode,n=t.state.currentTransform;if(r.pano){var i=2*Math.PI*r.gpano.CroppedAreaImageWidthPixels/r.gpano.FullPanoWidthPixels;return[e._spatial.degToRad(r.ca),i]}var o=Math.max(n.basicWidth,n.basicHeight);o<=0&&console.warn("Original image size ("+n.basicWidth+", "+n.basicHeight+") is invalid ("+r.key+". Not showing available fov.");var a=o>0?2*Math.atan(.5*n.basicWidth/(o*n.focal)):0;return[e._spatial.degToRad(r.ca),a]}).distinctUntilChanged(function(t,r){return Math.abs(r[0]-t[0])<e._distinctThreshold&&Math.abs(r[1]-t[1])<e._distinctThreshold}),r=this._container.renderService.renderCamera$.map(function(t){var r=e._spatial.degToRad(t.perspective.fov),n=t.perspective.aspect===Number.POSITIVE_INFINITY?Math.PI:2*Math.atan(t.perspective.aspect*Math.tan(.5*r));return[e._spatial.azimuthalToBearing(t.rotation.phi),n]}).distinctUntilChanged(function(t,r){return Math.abs(r[0]-t[0])<e._distinctThreshold&&Math.abs(r[1]-t[1])<e._distinctThreshold});this._renderSubscription=o.Observable.combineLatest(t,r).map(function(t){var r=i.h("div.BearingIndicatorBackground",{oncontextmenu:function(e){e.preventDefault()}},[i.h("div.BearingIndicatorBackgroundRectangle",{},[]),i.h("div.BearingIndicatorBackgroundCircle",{},[])]),n=i.h("div.BearingIndicatorNorth",{},[]),o=e._createCircleSector(t[0][0],t[0][1],"#fff"),a=e._createCircleSector(t[1][0],t[1][1],"#49b1d3"),s=e._createCircleSectorCompass(o,a),u=60*t[1][0],c=i.h("div.TransformDeg",{attributes:{style:"transform:rotate("+u+"deg)"}},[]);return{name:e._name,vnode:i.h("div.BearingIndicator",{},[r,n,s,c])}}).subscribe(this._container.domRenderer.render$)},t.prototype._deactivate=function(){this._renderSubscription.unsubscribe()},t.prototype._getDefaultConfiguration=function(){return{}},t.prototype._createCircleSectorCompass=function(e,t){var r=i.h("g",{attributes:{transform:"translate(1,1)"},namespace:this._svgNamespace},[e,t]),n=i.h("circle",{attributes:{cx:"1",cy:"1",fill:"#fff",r:"0.291667",stroke:"#fff","stroke-width":"0.0833333"},namespace:this._svgNamespace},[]);return i.h("svg",{attributes:{viewBox:"0 0 2 2"},namespace:this._svgNamespace,style:{bottom:"4px",height:"48px",left:"4px",position:"absolute",width:"48px"}},[r,n])},t.prototype._createCircleSector=function(e,t,r){if(t>2*Math.PI-Math.PI/90)return i.h("circle",{attributes:{cx:"0",cy:"0",fill:r,r:"1"},namespace:this._svgNamespace},[]);var n=e-t/2-Math.PI/2,o=n+t,a=Math.cos(n),s=Math.sin(n),u=Math.cos(o),c=Math.sin(o),l="M 0 0 "+a+" "+s+" A 1 1 0 "+(t>=Math.PI?1:0)+" 1 "+u+" "+c;return i.h("path",{attributes:{d:l,fill:r},namespace:this._svgNamespace},[])},t.componentName="bearing",t}(a.Component);r.BearingComponent=u,a.ComponentService.register(u),r.default=u},{"../Component":365,"../Geo":368,"rxjs/Observable":157,"virtual-dom":317}],380:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("rxjs/Observable");e("rxjs/add/observable/combineLatest"),e("rxjs/add/observable/from"),e("rxjs/add/observable/merge"),e("rxjs/add/observable/of"),e("rxjs/add/observable/zip"),e("rxjs/add/operator/catch"),e("rxjs/add/operator/combineLatest"),e("rxjs/add/operator/distinct"),e("rxjs/add/operator/expand"),e("rxjs/add/operator/filter"),e("rxjs/add/operator/map"),e("rxjs/add/operator/merge"),e("rxjs/add/operator/mergeMap"),e("rxjs/add/operator/mergeAll"),e("rxjs/add/operator/skip"),e("rxjs/add/operator/switchMap");var o=e("../Edge"),a=e("../Component"),s=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}return n(t,e),t.prototype.setDepth=function(e){this.configure({depth:e})},t.prototype._activate=function(){var e=this;this._sequenceSubscription=i.Observable.combineLatest(this._navigator.stateService.currentNode$.switchMap(function(e){return e.sequenceEdges$}).filter(function(e){return e.cached}),this._configuration$).switchMap(function(t){var r=t[0],n=t[1],a=Math.max(0,Math.min(4,n.depth.sequence)),s=e._cache$(r.edges,o.EdgeDirection.Next,a),u=e._cache$(r.edges,o.EdgeDirection.Prev,a);return i.Observable.merge(s,u).catch(function(e,t){return console.error("Failed to cache sequence edges.",e),i.Observable.empty()})}).subscribe(function(){}),this._spatialSubscription=this._navigator.stateService.currentNode$.switchMap(function(e){return i.Observable.combineLatest(i.Observable.of(e),e.spatialEdges$.filter(function(e){return e.cached}))}).combineLatest(this._configuration$,function(e,t){return[e[0],e[1],t]}).switchMap(function(t){var r=t[0],n=t[1].edges,a=t[2].depth,s=Math.max(0,Math.min(2,a.pano)),u=r.pano?0:Math.max(0,Math.min(3,a.step)),c=r.pano?0:Math.max(0,Math.min(1,a.turn)),l=e._cache$(n,o.EdgeDirection.Pano,s),h=e._cache$(n,o.EdgeDirection.StepForward,u),p=e._cache$(n,o.EdgeDirection.StepBackward,u),f=e._cache$(n,o.EdgeDirection.StepLeft,u),d=e._cache$(n,o.EdgeDirection.StepRight,u),m=e._cache$(n,o.EdgeDirection.TurnLeft,c),v=e._cache$(n,o.EdgeDirection.TurnRight,c),y=e._cache$(n,o.EdgeDirection.TurnU,c);return i.Observable.merge(h,p,f,d,l,m,v,y).catch(function(e,t){return console.error("Failed to cache spatial edges.",e),i.Observable.empty()})}).subscribe(function(){})},t.prototype._deactivate=function(){this._sequenceSubscription.unsubscribe(),this._spatialSubscription.unsubscribe()},t.prototype._getDefaultConfiguration=function(){return{depth:{pano:1,sequence:2,step:1,turn:0}}},t.prototype._cache$=function(e,t,r){var n=this;return i.Observable.zip(i.Observable.of(e),i.Observable.of(r)).expand(function(e){var r=e[0],o=e[1],a=[];if(o>0)for(var s=0,u=r;s<u.length;s++){var c=u[s];c.data.direction===t&&a.push(i.Observable.zip(n._navigator.graphService.cacheNode$(c.to).mergeMap(function(e){return n._nodeToEdges$(e,t)}),i.Observable.of(o-1)))}return i.Observable.from(a).mergeAll()}).skip(1)},t.prototype._nodeToEdges$=function(e,t){return([o.EdgeDirection.Next,o.EdgeDirection.Prev].indexOf(t)>-1?e.sequenceEdges$:e.spatialEdges$).first(function(e){return e.cached}).map(function(e){return e.edges})},t.componentName="cache",t}(a.Component);r.CacheComponent=s,a.ComponentService.register(s),r.default=s},{"../Component":365,"../Edge":366,"rxjs/Observable":157,"rxjs/add/observable/combineLatest":166,"rxjs/add/observable/from":169,"rxjs/add/observable/merge":172,"rxjs/add/observable/of":173,"rxjs/add/observable/zip":176,"rxjs/add/operator/catch":180,"rxjs/add/operator/combineLatest":181,"rxjs/add/operator/distinct":185,"rxjs/add/operator/expand":188,"rxjs/add/operator/filter":189,"rxjs/add/operator/map":193,"rxjs/add/operator/merge":194,"rxjs/add/operator/mergeAll":195,"rxjs/add/operator/mergeMap":196,"rxjs/add/operator/skip":204,"rxjs/add/operator/switchMap":208}],381:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("rxjs/BehaviorSubject"),o=e("rxjs/Subject");e("rxjs/add/operator/publishReplay"),e("rxjs/add/operator/scan"),e("rxjs/add/operator/startWith");var a=function(e){function t(t,r,n){var a=e.call(this)||this;return a._activated$=new i.BehaviorSubject(!1),a._configurationSubject$=new o.Subject,a._activated=!1,a._container=r,a._name=t,a._navigator=n,a._configuration$=a._configurationSubject$.startWith(a.defaultConfiguration).scan(function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}).publishReplay(1).refCount(),a._configuration$.subscribe(function(){}),a}return n(t,e),Object.defineProperty(t.prototype,"activated",{get:function(){return this._activated},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activated$",{get:function(){return this._activated$},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultConfiguration",{get:function(){return this._getDefaultConfiguration()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"configuration$",{get:function(){return this._configuration$},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),t.prototype.activate=function(e){this._activated||(void 0!==e&&this._configurationSubject$.next(e),this._activated=!0,this._activate(),this._activated$.next(!0))},t.prototype.configure=function(e){this._configurationSubject$.next(e)},t.prototype.deactivate=function(){this._activated&&(this._activated=!1,this._deactivate(),this._container.domRenderer.clear(this._name),this._container.glRenderer.clear(this._name),this._activated$.next(!1))},t.prototype.resize=function(){},t.componentName="not_worthy",t}(e("../Utils").EventEmitter);r.Component=a,r.default=a},{"../Utils":374,"rxjs/BehaviorSubject":154,"rxjs/Subject":162,"rxjs/add/operator/publishReplay":200,"rxjs/add/operator/scan":202,"rxjs/add/operator/startWith":207}],382:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("underscore"),i=e("../Error"),o=function(){function e(t,r){this._components={},this._container=t,this._navigator=r;for(var i=0,o=n.values(e.registeredComponents);i<o.length;i++){var a=o[i];this._components[a.componentName]={active:!1,component:new a(a.componentName,t,r)}}this._coverComponent=new e.registeredCoverComponent("cover",t,r),this._coverComponent.activate(),this._coverActivated=!0}return e.register=function(t){void 0===e.registeredComponents[t.componentName]&&(e.registeredComponents[t.componentName]=t)},e.registerCover=function(t){e.registeredCoverComponent=t},Object.defineProperty(e.prototype,"coverActivated",{get:function(){return this._coverActivated},enumerable:!0,configurable:!0}),e.prototype.activateCover=function(){if(!this._coverActivated){this._coverActivated=!0;for(var e=0,t=n.values(this._components);e<t.length;e++){var r=t[e];r.active&&r.component.deactivate()}}},e.prototype.deactivateCover=function(){if(this._coverActivated){this._coverActivated=!1;for(var e=0,t=n.values(this._components);e<t.length;e++){var r=t[e];r.active&&r.component.activate()}}},e.prototype.activate=function(e){this._checkName(e),this._components[e].active=!0,this._coverActivated||this.get(e).activate()},e.prototype.configure=function(e,t){this._checkName(e),this.get(e).configure(t)},e.prototype.deactivate=function(e){this._checkName(e),this._components[e].active=!1,this._coverActivated||this.get(e).deactivate()},e.prototype.resize=function(){for(var e=0,t=n.values(this._components);e<t.length;e++)t[e].component.resize()},e.prototype.get=function(e){return this._components[e].component},e.prototype.getCover=function(){return this._coverComponent},e.prototype._checkName=function(e){if(!(e in this._components))throw new i.ArgumentBeeviewError("Component does not exist: "+e)},e.registeredComponents={},e}();r.ComponentService=o,r.default=o},{"../Error":367,underscore:313}],383:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("virtual-dom");e("rxjs/add/operator/filter"),e("rxjs/add/operator/map"),e("rxjs/add/operator/withLatestFrom");var o=e("../Component"),a=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}return n(t,e),t.prototype._activate=function(){var e=this;this._keyDisposable=this._navigator.stateService.currentNode$.withLatestFrom(this._configuration$,function(e,t){return[e,t]}).filter(function(e){var t=e[0],r=e[1];return t.key!==r.key}).map(function(e){var t=e[0];e[1];return t}).map(function(e){return{key:e.key,src:e.image.src}}).subscribe(this._configurationSubject$),this._disposable=this._configuration$.map(function(t){return t.key?t.state===o.CoverState.Hidden?{name:e._name,vnode:i.h("div.Cover.CoverDone",[e._getCoverBackgroundVNode(t)])}:{name:e._name,vnode:e._getCoverButtonVNode(t)}:{name:e._name,vnode:i.h("div",[])}}).subscribe(this._container.domRenderer.render$)},t.prototype._deactivate=function(){this._disposable.unsubscribe(),this._keyDisposable.unsubscribe()},t.prototype._getDefaultConfiguration=function(){return{state:o.CoverState.Visible}},t.prototype._getCoverButtonVNode=function(e){var t=this,r=e.state===o.CoverState.Loading?"div.Cover.CoverLoading":"div.Cover";return i.h(r,[this._getCoverBackgroundVNode(e),i.h("button.CoverButton",{onclick:function(){t.configure({state:o.CoverState.Loading})}},["Explore"]),i.h("a.CoverLogo",{href:"",target:""},[])])},t.prototype._getCoverBackgroundVNode=function(e){var t={style:{backgroundImage:null!=e.src?"url("+e.src+")":"url(http://d2uvyvbnnia8tb.cloudfront.net/images/"+e.key+"/thumb-640.jpg)"}},r=[];return e.state===o.CoverState.Loading&&(r.push(i.h("div.maphive_logo",{},[])),r.push(i.h("div.maphive_text",{},[]))),r.push(i.h("div.CoverBackgroundGradient",{},[])),i.h("div.CoverBackground",t,r)},t.componentName="cover",t}(o.Component);r.CoverComponent=a,o.ComponentService.registerCover(a),r.default=a},{"../Component":365,"rxjs/add/operator/filter":189,"rxjs/add/operator/map":193,"rxjs/add/operator/withLatestFrom":213,"virtual-dom":317}],384:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("underscore"),o=e("virtual-dom"),a=e("rxjs/BehaviorSubject");e("rxjs/add/operator/combineLatest");var s=e("../Component"),u=function(e){function t(t,r,n){var i=e.call(this,t,r,n)||this;return i._open$=new a.BehaviorSubject(!1),i._displaying=!1,i}return n(t,e),t.prototype._activate=function(){var e=this;this._disposable=this._navigator.stateService.currentState$.combineLatest(this._open$,this._navigator.imageLoadingService.loadstatus$,function(t,r,n){return{name:e._name,vnode:e._getDebugVNode(r,e._getDebugInfo(t,n))}}).subscribe(this._container.domRenderer.render$)},t.prototype._deactivate=function(){this._disposable.unsubscribe()},t.prototype._getDefaultConfiguration=function(){return{}},t.prototype._getDebugInfo=function(e,t){var r=[];r.push(o.h("h2","Node")),e.state.currentNode&&r.push(o.h("p","currentNode: "+e.state.currentNode.key)),e.state.previousNode&&r.push(o.h("p","previousNode: "+e.state.previousNode.key)),r.push(o.h("h2","Loading"));for(var n=0,a=0,s=0,u=0,c=i.values(t);u<c.length;u++){var l=c[u];n+=l.loaded,l.loaded!==l.total?s++:a++}return r.push(o.h("p","Loaded Images: "+a)),r.push(o.h("p","Loading Images: "+s)),r.push(o.h("p","Total bytes loaded: "+n)),r.push(o.h("h2","Camera")),r.push(o.h("p","camera.position.x: "+e.state.camera.position.x)),r.push(o.h("p","camera.position.y: "+e.state.camera.position.y)),r.push(o.h("p","camera.position.z: "+e.state.camera.position.z)),r.push(o.h("p","camera.lookat.x: "+e.state.camera.lookat.x)),r.push(o.h("p","camera.lookat.y: "+e.state.camera.lookat.y)),r.push(o.h("p","camera.lookat.z: "+e.state.camera.lookat.z)),r.push(o.h("p","camera.up.x: "+e.state.camera.up.x)),r.push(o.h("p","camera.up.y: "+e.state.camera.up.y)),r.push(o.h("p","camera.up.z: "+e.state.camera.up.z)),r},t.prototype._getDebugVNode=function(e,t){return e?o.h("div.Debug",{},[o.h("h2",{},["Debug"]),this._getDebugVNodeButton(e),o.h("pre",{},t)]):this._getDebugVNodeButton(e)},t.prototype._getDebugVNodeButton=function(e){var t=e?"Disable Debug":"D",r=e?"":".DebugButtonFixed";return e?o.h("button.DebugButton"+r,{onclick:this._closeDebugElement.bind(this)},[t]):o.h("button.DebugButton"+r,{onclick:this._openDebugElement.bind(this)},[t])},t.prototype._closeDebugElement=function(e){this._open$.next(!1)},t.prototype._openDebugElement=function(){this._open$.next(!0)},t.componentName="debug",t}(s.Component);r.DebugComponent=u,s.ComponentService.register(u),r.default=u},{"../Component":365,"rxjs/BehaviorSubject":154,"rxjs/add/operator/combineLatest":181,underscore:313,"virtual-dom":317}],385:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("virtual-dom"),o=e("rxjs/Observable");e("rxjs/add/operator/combineLatest");var a=e("../Component"),s=e("../Utils"),u=function(e){function t(t,r,n,i){var o=e.call(this,t,r,n)||this;return o._canvasId=r.id+"-"+o._name,o._dom=i||new s.DOM,o}return n(t,e),t.prototype._activate=function(){var e=this,t=this._container.domRenderer.element$.map(function(t){return e._dom.document.getElementById(e._canvasId)}).filter(function(e){return!!e}).map(function(e){var t=e.parentElement,r=t.offsetWidth;return[e,{height:t.offsetHeight,width:r}]}).distinctUntilChanged(function(e,t){return e.height===t.height&&e.width===t.width},function(e){e[0];return e[1]});this.drawSubscription=o.Observable.combineLatest(t,this._navigator.stateService.currentNode$).subscribe(function(e){var t=e[0],r=t[0],n=t[1],i=e[1];r.width=n.width,r.height=n.height,r.getContext("2d").drawImage(i.image,0,0,n.width,n.height)}),this._container.domRenderer.renderAdaptive$.next({name:this._name,vnode:i.h("canvas#"+this._canvasId,[])})},t.prototype._deactivate=function(){this.drawSubscription.unsubscribe()},t.prototype._getDefaultConfiguration=function(){return{}},t.componentName="image",t}(a.Component);r.ImageComponent=u,a.ComponentService.register(u),r.default=u},{"../Component":365,"../Utils":374,"rxjs/Observable":157,"rxjs/add/operator/combineLatest":181,"virtual-dom":317}],386:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("underscore"),o=e("virtual-dom");e("rxjs/add/operator/combineLatest");var a=e("../Component"),s=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}return n(t,e),t.prototype._activate=function(){var e=this;this._loadingSubscription=this._navigator.loadingService.loading$.combineLatest(this._navigator.imageLoadingService.loadstatus$,function(t,r){if(!t)return{name:"loading",vnode:e._getBarVNode(100)};for(var n=0,o=0,a=0,s=i.values(r);a<s.length;a++){var u=s[a];u.loaded!==u.total&&(o+=u.loaded,n+=u.total)}var c=100;return 0!==n&&(c=o/n*100),{name:e._name,vnode:e._getBarVNode(c)}}).subscribe(this._container.domRenderer.render$)},t.prototype._deactivate=function(){this._loadingSubscription.unsubscribe()},t.prototype._getDefaultConfiguration=function(){return{}},t.prototype._getBarVNode=function(e){var t={},r={};return 100!==e?(t.width=e.toFixed(0)+"%",t.opacity="1"):(t.width="100%",t.opacity="0"),o.h("div.Loading",{style:r},[o.h("div.LoadingBar",{style:t},[])])},t.componentName="loading",t}(a.Component);r.LoadingComponent=s,a.ComponentService.register(s),r.default=s},{"../Component":365,"rxjs/add/operator/combineLatest":181,underscore:313,"virtual-dom":317}],387:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("virtual-dom"),o=e("rxjs/Observable");e("rxjs/add/operator/map"),e("rxjs/add/operator/first");var a=e("../Edge"),s=e("../Component"),u=function(e){function t(t,r,n){var i=e.call(this,t,r,n)||this;return i._seqNames={},i._seqNames[a.EdgeDirection[a.EdgeDirection.Prev]]="Prev",i._seqNames[a.EdgeDirection[a.EdgeDirection.Next]]="Next",i._spaTopNames={},i._spaTopNames[a.EdgeDirection[a.EdgeDirection.TurnLeft]]="Turnleft",i._spaTopNames[a.EdgeDirection[a.EdgeDirection.StepLeft]]="Left",i._spaTopNames[a.EdgeDirection[a.EdgeDirection.StepForward]]="Forward",i._spaTopNames[a.EdgeDirection[a.EdgeDirection.StepRight]]="Right",i._spaTopNames[a.EdgeDirection[a.EdgeDirection.TurnRight]]="Turnright",i._spaBottomNames={},i._spaBottomNames[a.EdgeDirection[a.EdgeDirection.TurnU]]="Turnaround",i._spaBottomNames[a.EdgeDirection[a.EdgeDirection.StepBackward]]="Backward",i}return n(t,e),t.prototype._activate=function(){var e=this;this._renderSubscription=o.Observable.combineLatest(this._navigator.stateService.currentNode$,this._configuration$).switchMap(function(e){var t=e[0],r=e[1],n=r.sequence?t.sequenceEdges$.map(function(e){return e.edges.map(function(e){return e.data.direction})}):o.Observable.of([]),i=!t.pano&&r.spatial?t.spatialEdges$.map(function(e){return e.edges.map(function(e){return e.data.direction})}):o.Observable.of([]);return o.Observable.combineLatest(n,i).map(function(e){var t=e[0],r=e[1];return t.concat(r)})}).map(function(t){var r=e._createArrowRow(e._seqNames,t),n=e._createArrowRow(e._spaTopNames,t),o=e._createArrowRow(e._spaBottomNames,t),a=i.h("div.NavigationSequence",r),s=i.h("div.NavigationSpatialTop",n),u=i.h("div.NavigationSpatialBottom",o),c=i.h("div.NavigationSpatial",[s,u]);return{name:e._name,vnode:i.h("div.NavigationContainer",[a,c])}}).subscribe(this._container.domRenderer.render$)},t.prototype._deactivate=function(){this._renderSubscription.unsubscribe()},t.prototype._getDefaultConfiguration=function(){return{sequence:!0,spatial:!0}},t.prototype._createArrowRow=function(e,t){var r=[];for(var n in e)if(e.hasOwnProperty(n)){var i=a.EdgeDirection[n];-1!==t.indexOf(i)?r.push(this._createVNode(i,e[n],"visible")):r.push(this._createVNode(i,e[n],"hidden"))}return r},t.prototype._createVNode=function(e,t,r){var n=this;return i.h("span.Direction.Direction"+t,{onclick:function(t){n._navigator.moveDir$(e).subscribe(function(e){},function(e){console.error(e)})},style:{visibility:r}},[])},t.componentName="navigation",t}(s.Component);r.NavigationComponent=u,s.ComponentService.register(u),r.default=u},{"../Component":365,"../Edge":366,"rxjs/Observable":157,"rxjs/add/operator/first":191,"rxjs/add/operator/map":193,"virtual-dom":317}],388:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("underscore"),o=e("virtual-dom"),a=e("rxjs/Observable");e("rxjs/add/observable/fromPromise"),e("rxjs/add/observable/of"),e("rxjs/add/operator/combineLatest"),e("rxjs/add/operator/distinct"),e("rxjs/add/operator/distinctUntilChanged"),e("rxjs/add/operator/filter"),e("rxjs/add/operator/map"),e("rxjs/add/operator/mergeMap"),e("rxjs/add/operator/pluck"),e("rxjs/add/operator/scan");var s=e("../Component"),u=function(){return function(){}}(),c=function(){return function(){}}(),l=function(){return function(){this.nodeInstructions=[],this.nodeInstructionsOrdered=[]}}(),h=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}return n(t,e),t.prototype._activate=function(){var e,t=this;e=this._navigator.stateService.currentState$.filter(function(e){return e.id%2==0}).filter(function(e){return e.state.nodesAhead<15}).distinctUntilChanged(void 0,function(e){return e.state.lastNode.key});var r;r=this.configuration$.mergeMap(function(e){return a.Observable.from(e.paths)}).distinct(function(e){return e.sequenceKey}).mergeMap(function(e){return t._navigator.apiV3.sequenceByKey$([e.sequenceKey]).map(function(t){return t[e.sequenceKey]})}).combineLatest(this.configuration$,function(e,t){for(var r=0,n=[],i=0,o=t.paths;i<o.length;i++){var a=o[i];if(a.sequenceKey===e.key){for(var s=[],u=!1,c=0,l=e.keys;c<l.length;c++){var h=l[c];if(a.startKey===h&&(u=!0),u){for(var p=null,f=0,d=a.infoKeys;f<d.length;f++){var m=d[f];m.key===h&&(p=m.description)}s.push({description:p,key:h})}a.stopKey===h&&(u=!1)}n.push({nodeInstructions:s,place:r})}r++}return n}).scan(function(e,t){for(var r=0,n=t;r<n.length;r++){var o=n[r];e.nodeInstructionsOrdered[o.place]=o.nodeInstructions}return e.nodeInstructions=i.flatten(e.nodeInstructionsOrdered),e},new l),this._disposable=e.combineLatest(r,this.configuration$,function(e,t,r){return{conf:r,frame:e,routeTrack:t}}).scan(function(e,r){return void 0===r.conf.playing||r.conf.playing?(e.routeTrack=r.routeTrack,e.currentNode=r.frame.state.currentNode,e.lastNode=r.frame.state.lastNode,e.playing=!0):(t._navigator.stateService.cutNodes(),e.playing=!1),e},new c).filter(function(e){return e.playing}).filter(function(e){for(var t=0,r=e.routeTrack.nodeInstructions;t<r.length;t++){var n=r[t];if(n&&n.key===e.lastNode.key)return!0}return!1}).distinctUntilChanged(void 0,function(e){return e.lastNode.key}).mergeMap(function(e){for(var r=0,n=0,i=e.routeTrack.nodeInstructions;n<i.length&&i[n].key!==e.lastNode.key;n++)r++;var o=e.routeTrack.nodeInstructions[r+1];return o?t._navigator.graphService.cacheNode$(o.key):a.Observable.of(null)}).combineLatest(this.configuration$,function(e,t){return{conf:t,node:e}}).filter(function(e){return null!==e.node&&e.conf.playing}).pluck("node").subscribe(this._navigator.stateService.appendNode$),this._disposableDescription=this._navigator.stateService.currentNode$.combineLatest(r,this.configuration$,function(e,t,r){if(void 0!==r.playing&&!r.playing)return"quit";for(var n=null,i=0,o=t.nodeInstructions;i<o.length;i++){var a=o[i];if(a.key===e.key){n=a.description;break}}return n}).scan(function(e,t){return t!==e.description&&null!==t?(e.description=t,e.showsLeft=6):e.showsLeft--,"quit"===t&&(e.description=null),e},new u).map(function(e){return e.showsLeft>0&&e.description?{name:t._name,vnode:t._getRouteAnnotationNode(e.description)}:{name:t._name,vnode:o.h("div",[])}}).subscribe(this._container.domRenderer.render$)},t.prototype._deactivate=function(){this._disposable.unsubscribe(),this._disposableDescription.unsubscribe()},t.prototype._getDefaultConfiguration=function(){return{}},t.prototype.play=function(){this.configure({playing:!0})},t.prototype.stop=function(){this.configure({playing:!1})},t.prototype._getRouteAnnotationNode=function(e){return o.h("div.RouteFrame",{},[o.h("p",{textContent:e},[])])},t.componentName="route",t}(s.Component);r.RouteComponent=h,s.ComponentService.register(h),r.default=h},{"../Component":365,"rxjs/Observable":157,"rxjs/add/observable/fromPromise":171,"rxjs/add/observable/of":173,"rxjs/add/operator/combineLatest":181,"rxjs/add/operator/distinct":185,"rxjs/add/operator/distinctUntilChanged":186,"rxjs/add/operator/filter":189,"rxjs/add/operator/map":193,"rxjs/add/operator/mergeMap":196,"rxjs/add/operator/pluck":198,"rxjs/add/operator/scan":202,underscore:313,"virtual-dom":317}],389:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("rxjs/Observable");e("rxjs/add/operator/buffer"),e("rxjs/add/operator/debounceTime"),e("rxjs/add/operator/filter"),e("rxjs/add/operator/map"),e("rxjs/add/operator/scan");var o=e("../Component"),a=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}return n(t,e),t.prototype._activate=function(){var e=this;this._sequenceSubscription=this._navigator.stateService.currentNode$.scan(function(e,t){var r=t.sequenceKey;return e.report=[],r in e.reported||(e.report=[r],e.reported[r]=!0),e},{report:[],reported:{}}).filter(function(e){return e.report.length>0}).mergeMap(function(t){return e._navigator.apiV3.sequenceViewAdd$(t.report).catch(function(e,r){return console.error("Failed to report sequence stats ("+t.report+")",e),i.Observable.empty()})}).subscribe(function(){}),this._imageSubscription=this._navigator.stateService.currentNode$.map(function(e){return e.key}).buffer(this._navigator.stateService.currentNode$.debounceTime(5e3)).scan(function(e,t){e.report=[];for(var r=0,n=t;r<n.length;r++){var i=n[r];i in e.reported||(e.report.push(i),e.reported[i]=!0)}return e},{report:[],reported:{}}).filter(function(e){return e.report.length>0}).mergeMap(function(t){return e._navigator.apiV3.imageViewAdd$(t.report).catch(function(e,r){return console.error("Failed to report image stats ("+t.report+")",e),i.Observable.empty()})}).subscribe(function(){})},t.prototype._deactivate=function(){this._sequenceSubscription.unsubscribe(),this._imageSubscription.unsubscribe()},t.prototype._getDefaultConfiguration=function(){return{}},t.componentName="stats",t}(o.Component);r.StatsComponent=a,o.ComponentService.register(a),r.default=a},{"../Component":365,"rxjs/Observable":157,"rxjs/add/operator/buffer":177,"rxjs/add/operator/debounceTime":183,"rxjs/add/operator/filter":189,"rxjs/add/operator/map":193,"rxjs/add/operator/scan":202}],390:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("virtual-dom"),o=e("rxjs/Observable"),a=e("rxjs/Subject");e("rxjs/add/observable/combineLatest"),e("rxjs/add/operator/do"),e("rxjs/add/operator/distinctUntilChanged"),e("rxjs/add/operator/filter"),e("rxjs/add/operator/map"),e("rxjs/add/operator/share");var s=e("../../Component"),u=function(e){function t(t,r,n,i){var o=e.call(this,t,r,n)||this;return o._renderer=i||new s.DirectionDOMRenderer(o.defaultConfiguration,r.element),o._hoveredKeySubject$=new a.Subject,o._hoveredKey$=o._hoveredKeySubject$.share(),o}return n(t,e),Object.defineProperty(t.prototype,"hoveredKey$",{get:function(){return this._hoveredKey$},enumerable:!0,configurable:!0}),t.prototype.setHighlightKey=function(e){this.configure({highlightKey:e})},t.prototype.setMinWidth=function(e){this.configure({minWidth:e})},t.prototype.setMaxWidth=function(e){this.configure({maxWidth:e})},t.prototype.resize=function(){this._renderer.resize(this._container.element)},t.prototype._activate=function(){var e=this;this._configurationSubscription=this._configuration$.subscribe(function(t){e._renderer.setConfiguration(t)}),this._nodeSubscription=this._navigator.stateService.currentNode$.do(function(t){e._container.domRenderer.render$.next({name:e._name,vnode:i.h("div",{},[])}),e._renderer.setNode(t)}).withLatestFrom(this._configuration$).switchMap(function(t){var r=t[0],n=t[1];return o.Observable.combineLatest(r.spatialEdges$,n.distinguishSequence?e._navigator.graphService.cacheSequence$(r.sequenceKey).catch(function(e,t){return console.error("Failed to cache sequence ("+r.sequenceKey+")",e),o.Observable.of(null)}):o.Observable.of(null))}).subscribe(function(t){var r=t[0],n=t[1];e._renderer.setEdges(r,n)}),this._renderCameraSubscription=this._container.renderService.renderCameraFrame$.do(function(t){e._renderer.setRenderCamera(t)}).map(function(t){return e._renderer}).filter(function(e){return e.needsRender}).map(function(t){return{name:e._name,vnode:t.render(e._navigator)}}).subscribe(this._container.domRenderer.render$),this._hoveredKeySubscription=o.Observable.combineLatest([this._container.domRenderer.element$,this._container.renderService.renderCamera$,this._container.mouseService.mouseMove$.startWith(null),this._container.mouseService.mouseUp$.startWith(null)],function(e,t,r,n){return e}).map(function(e){for(var t=e.getElementsByClassName("DirectionsPerspective"),r=0;r<t.length;r++){var n=t.item(r).querySelector(":hover");if(null!=n&&n.hasAttribute("data-key"))return n.getAttribute("data-key")}return null}).distinctUntilChanged().subscribe(this._hoveredKeySubject$)},t.prototype._deactivate=function(){this._configurationSubscription.unsubscribe(),this._nodeSubscription.unsubscribe(),this._renderCameraSubscription.unsubscribe(),this._hoveredKeySubscription.unsubscribe()},t.prototype._getDefaultConfiguration=function(){return{distinguishSequence:!1,maxWidth:460,minWidth:260}},t.componentName="direction",t}(s.Component);r.DirectionComponent=u,s.ComponentService.register(u),r.default=u},{"../../Component":365,"rxjs/Observable":157,"rxjs/Subject":162,"rxjs/add/observable/combineLatest":166,"rxjs/add/operator/distinctUntilChanged":186,"rxjs/add/operator/do":187,"rxjs/add/operator/filter":189,"rxjs/add/operator/map":193,"rxjs/add/operator/share":203,"virtual-dom":317}],391:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("../../Geo"),i=function(){function e(e,t){this._spatial=new n.Spatial,this._minThresholdWidth=320,this._maxThresholdWidth=1480,this._minThresholdHeight=240,this._maxThresholdHeight=820,this._configure(e),this._resize(t),this._reset()}return Object.defineProperty(e.prototype,"minWidth",{get:function(){return this._minWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxWidth",{get:function(){return this._maxWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"containerWidth",{get:function(){return this._containerWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"containerWidthCss",{get:function(){return this._containerWidthCss},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"containerMarginCss",{get:function(){return this._containerMarginCss},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"containerLeftCss",{get:function(){return this._containerLeftCss},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"containerHeight",{get:function(){return this._containerHeight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"containerHeightCss",{get:function(){return this._containerHeightCss},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"containerBottomCss",{get:function(){return this._containerBottomCss},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepCircleSize",{get:function(){return this._stepCircleSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepCircleSizeCss",{get:function(){return this._stepCircleSizeCss},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepCircleMarginCss",{get:function(){return this._stepCircleMarginCss},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"turnCircleSize",{get:function(){return this._turnCircleSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"turnCircleSizeCss",{get:function(){return this._turnCircleSizeCss},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outerRadius",{get:function(){return this._outerRadius},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"innerRadius",{get:function(){return this._innerRadius},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shadowOffset",{get:function(){return this._shadowOffset},enumerable:!0,configurable:!0}),e.prototype.configure=function(e){this._configure(e),this._reset()},e.prototype.resize=function(e){this._resize(e),this._reset()},e.prototype.angleToCoordinates=function(e){return[Math.cos(e),Math.sin(e)]},e.prototype.relativeAngleToCoordiantes=function(e,t){var r=this._spatial.wrapAngle(e-t);return this.angleToCoordinates(r)},e.prototype._configure=function(e){this._minWidth=e.minWidth,this._maxWidth=this._getMaxWidth(e.minWidth,e.maxWidth)},e.prototype._resize=function(e){this._elementWidth=e.offsetWidth,this._elementHeight=e.offsetHeight},e.prototype._reset=function(){this._containerWidth=this._getContainerWidth(this._elementWidth,this._elementHeight),this._containerHeight=this._getContainerHeight(this.containerWidth),this._stepCircleSize=this._getStepCircleDiameter(this._containerHeight),this._turnCircleSize=this._getTurnCircleDiameter(this.containerHeight),this._outerRadius=this._getOuterRadius(this._containerHeight),this._innerRadius=this._getInnerRadius(this._containerHeight),this._shadowOffset=3,this._containerWidthCss=this._numberToCssPixels(this._containerWidth),this._containerMarginCss=this._numberToCssPixels(-.5*this._containerWidth),this._containerLeftCss=this._numberToCssPixels(Math.floor(.5*this._elementWidth)),this._containerHeightCss=this._numberToCssPixels(this._containerHeight),this._containerBottomCss=this._numberToCssPixels(Math.floor(-.08*this._containerHeight)),this._stepCircleSizeCss=this._numberToCssPixels(this._stepCircleSize),this._stepCircleMarginCss=this._numberToCssPixels(-.5*this._stepCircleSize),this._turnCircleSizeCss=this._numberToCssPixels(this._turnCircleSize)},e.prototype._getContainerWidth=function(e,t){var r=(e-this._minThresholdWidth)/(this._maxThresholdWidth-this._minThresholdWidth),n=(t-this._minThresholdHeight)/(this._maxThresholdHeight-this._minThresholdHeight),i=Math.max(0,Math.min(1,Math.min(r,n)));return i=.04*Math.round(25*i),this._minWidth+i*(this._maxWidth-this._minWidth)},e.prototype._getContainerHeight=function(e){return.77*e},e.prototype._getStepCircleDiameter=function(e){return.34*e},e.prototype._getTurnCircleDiameter=function(e){return.3*e},e.prototype._getOuterRadius=function(e){return.31*e},e.prototype._getInnerRadius=function(e){return.125*e},e.prototype._numberToCssPixels=function(e){return e+"px"},e.prototype._getMaxWidth=function(e,t){return e>t?e:t},e}();r.DirectionDOMCalculator=i,r.default=i},{"../../Geo":368}],392:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("virtual-dom"),i=e("../../Component"),o=e("../../Edge"),a=e("../../Geo"),s=function(){function e(e,t){this._isEdge=!1,this._spatial=new a.Spatial,this._calculator=new i.DirectionDOMCalculator(e,t),this._node=null,this._rotation={phi:0,theta:0},this._epsilon=.5*Math.PI/180,this._highlightKey=null,this._distinguishSequence=!1,this._needsRender=!1,this._stepEdges=[],this._turnEdges=[],this._panoEdges=[],this._sequenceEdgeKeys=[],this._stepDirections=[o.EdgeDirection.StepForward,o.EdgeDirection.StepBackward,o.EdgeDirection.StepLeft,o.EdgeDirection.StepRight],this._turnDirections=[o.EdgeDirection.TurnLeft,o.EdgeDirection.TurnRight,o.EdgeDirection.TurnU],this._turnNames={},this._turnNames[o.EdgeDirection.TurnLeft]="TurnLeft",this._turnNames[o.EdgeDirection.TurnRight]="TurnRight",this._turnNames[o.EdgeDirection.TurnU]="TurnAround";var r=!!document.documentMode;this._isEdge=!r&&!!window.StyleMedia}return Object.defineProperty(e.prototype,"needsRender",{get:function(){return this._needsRender},enumerable:!0,configurable:!0}),e.prototype.render=function(e){this._needsRender=!1;var t=this._rotation,r=[],n=[];return this._node.pano?r=r.concat(this._createPanoArrows(e,t)):(r=(r=r.concat(this._createPerspectiveToPanoArrows(e,t))).concat(this._createStepArrows(e,t)),n=n.concat(this._createTurnArrows(e))),this._getContainer(r,n,t)},e.prototype.setEdges=function(e,t){this._setEdges(e,t),this._setNeedsRender()},e.prototype.setNode=function(e){this._node=e,this._clearEdges(),this._setNeedsRender()},e.prototype.setRenderCamera=function(e){var t=e.rotation;Math.abs(t.phi-this._rotation.phi)<this._epsilon||(this._rotation=t,this._setNeedsRender())},e.prototype.setConfiguration=function(e){var t=!1;this._highlightKey===e.highlightKey&&this._distinguishSequence===e.distinguishSequence||(this._highlightKey=e.highlightKey,this._distinguishSequence=e.distinguishSequence,t=!0),this._calculator.minWidth===e.minWidth&&this._calculator.maxWidth===e.maxWidth||(this._calculator.configure(e),t=!0),t&&this._setNeedsRender()},e.prototype.resize=function(e){this._calculator.resize(e),this._setNeedsRender()},e.prototype._setNeedsRender=function(){null!=this._node&&(this._needsRender=!0)},e.prototype._clearEdges=function(){this._stepEdges=[],this._turnEdges=[],this._panoEdges=[],this._sequenceEdgeKeys=[]},e.prototype._setEdges=function(e,t){this._stepEdges=[],this._turnEdges=[],this._panoEdges=[],this._sequenceEdgeKeys=[];for(var r=0,n=e.edges;r<n.length;r++){var i=(u=n[r]).data.direction;this._stepDirections.indexOf(i)>-1?this._stepEdges.push(u):this._turnDirections.indexOf(i)>-1?this._turnEdges.push(u):u.data.direction===o.EdgeDirection.Pano&&this._panoEdges.push(u)}if(this._distinguishSequence&&null!=t)for(var a=0,s=this._panoEdges.concat(this._stepEdges).concat(this._turnEdges);a<s.length;a++)for(var u=s[a],c=u.to,l=0,h=t.keys;l<h.length;l++)if(h[l]===c){this._sequenceEdgeKeys.push(c);break}},e.prototype._createPanoArrows=function(e,t){for(var r=[],n=0,i=this._panoEdges;n<i.length;n++){var o=i[n];r.push(this._createVNodeByKey(e,o.to,o.data.worldMotionAzimuth,t,this._calculator.outerRadius,"DirectionsArrowPano"))}for(var a=0,s=this._stepEdges;a<s.length;a++){var u=s[a];r.push(this._createPanoToPerspectiveArrow(e,u.to,u.data.worldMotionAzimuth,t,u.data.direction))}return r},e.prototype._createPanoToPerspectiveArrow=function(e,t,r,n,i){var a=Math.PI/8,s=n.phi;switch(i){case o.EdgeDirection.StepBackward:s=n.phi-Math.PI;break;case o.EdgeDirection.StepLeft:s=n.phi+Math.PI/2;break;case o.EdgeDirection.StepRight:s=n.phi-Math.PI/2}return Math.abs(this._spatial.wrapAngle(r-s))<a?this._createVNodeByKey(e,t,r,n,this._calculator.outerRadius,"DirectionsArrowStep"):this._createVNodeDisabled(t,r,n)},e.prototype._createPerspectiveToPanoArrows=function(e,t){for(var r=[],n=0,i=this._panoEdges;n<i.length;n++){var o=i[n];r.push(this._createVNodeByKey(e,o.to,o.data.worldMotionAzimuth,t,this._calculator.innerRadius,"DirectionsArrowPano",!0))}return r},e.prototype._createStepArrows=function(e,t){for(var r=[],n=0,i=this._stepEdges;n<i.length;n++){var o=i[n];r.push(this._createVNodeByDirection(e,o.to,o.data.worldMotionAzimuth,t,o.data.direction))}return r},e.prototype._createTurnArrows=function(e){for(var t=[],r=0,n=this._turnEdges;r<n.length;r++){var i=n[r],o=i.data.direction,a=this._turnNames[o];t.push(this._createVNodeByTurn(e,i.to,a,o))}return t},e.prototype._createVNodeByKey=function(e,t,r,n,i,o,a){return this._createVNode(t,r,n,i,o,"DirectionsCircle",function(r){e.moveToKey$(t).subscribe(function(e){},function(e){console.error(e)})},a)},e.prototype._createVNodeByDirection=function(e,t,r,n,i){return this._createVNode(t,r,n,this._calculator.outerRadius,"DirectionsArrowStep","DirectionsCircle",function(t){e.moveDir$(i).subscribe(function(e){},function(e){console.error(e)})})},e.prototype._createVNodeByTurn=function(e,t,r,i){var a={height:this._calculator.turnCircleSizeCss,transform:"rotate(0)",width:this._calculator.turnCircleSizeCss};switch(i){case o.EdgeDirection.TurnLeft:a.left="5px",a.top="5px";break;case o.EdgeDirection.TurnRight:a.right="5px",a.top="5px";break;case o.EdgeDirection.TurnU:a.left="5px",a.bottom="5px"}var s={attributes:{"data-key":t},onclick:function(t){e.moveDir$(i).subscribe(function(e){},function(e){console.error(e)})},style:a},u="TurnCircle";this._sequenceEdgeKeys.indexOf(t)>-1&&(u+="Sequence"),this._highlightKey===t&&(u+="Highlight");var c=n.h("div."+r,{},[]);return n.h("div."+u,s,[c])},e.prototype._createVNodeDisabled=function(e,t,r){return this._createVNode(e,t,r,this._calculator.outerRadius,"DirectionsArrowDisabled","DirectionsCircleDisabled")},e.prototype._createVNode=function(e,t,r,i,o,a,s,u){var c=this._calculator.angleToCoordinates(t-r.phi),l=Math.round(-i*c[1]+.5*this._calculator.containerWidth),h=Math.round(-i*c[0]+.5*this._calculator.containerHeight),p=this._calculator.relativeAngleToCoordiantes(t,r.phi),f=this._calculator.shadowOffset,d="drop-shadow("+-f*p[1]+"px "+f*p[0]+"px 1px rgba(0,0,0,0.8))",m={style:{"-webkit-filter":d,filter:d}},v=n.h("div."+o,m,[]),y=-this._spatial.radToDeg(t-r.phi),g=u?"translate("+l+"px, "+h+"px) rotate("+y+"deg) translateZ(-0.01px)":"translate("+l+"px, "+h+"px) rotate("+y+"deg)",b={attributes:{"data-key":e},onclick:s,style:{height:this._calculator.stepCircleSizeCss,marginLeft:this._calculator.stepCircleMarginCss,marginTop:this._calculator.stepCircleMarginCss,transform:g,width:this._calculator.stepCircleSizeCss}};return this._sequenceEdgeKeys.indexOf(e)>-1&&(a+="Sequence"),this._highlightKey===e&&(a+="Highlight"),n.h("div."+a,b,[v])},e.prototype._getContainer=function(e,t,r){var i=this._isEdge?"rotateX(60deg)":"perspective("+this._calculator.containerWidthCss+") rotateX(60deg)",o={oncontextmenu:function(e){e.preventDefault()},style:{bottom:this._calculator.containerBottomCss,height:this._calculator.containerHeightCss,left:this._calculator.containerLeftCss,marginLeft:this._calculator.containerMarginCss,transform:i,width:this._calculator.containerWidthCss}};return n.h("div.DirectionsPerspective",o,t.concat(e))},e}();r.DirectionDOMRenderer=s,r.default=s},{"../../Component":365,"../../Edge":366,"../../Geo":368,"virtual-dom":317}],393:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("rxjs/Observable"),o=e("rxjs/Subject");e("rxjs/add/operator/catch"),e("rxjs/add/operator/combineLatest"),e("rxjs/add/operator/debounceTime"),e("rxjs/add/operator/distinctUntilChanged"),e("rxjs/add/operator/filter"),e("rxjs/add/operator/map"),e("rxjs/add/operator/pairwise"),e("rxjs/add/operator/publish"),e("rxjs/add/operator/publishReplay"),e("rxjs/add/operator/scan"),e("rxjs/add/operator/skipWhile"),e("rxjs/add/operator/startWith"),e("rxjs/add/operator/switchMap"),e("rxjs/add/operator/takeUntil"),e("rxjs/add/operator/withLatestFrom");var a=e("../../Component"),s=e("../../Render"),u=e("../../Tiles"),c=e("../../Utils"),l=function(e){function t(t,r,n){var i=e.call(this,t,r,n)||this;return i._imageTileLoader=new u.ImageTileLoader(c.Urls.tileScheme,c.Urls.tileDomain,c.Urls.origin),i._roiCalculator=new u.RegionOfInterestCalculator,i._rendererOperation$=new o.Subject,i._rendererCreator$=new o.Subject,i._rendererDisposer$=new o.Subject,i._renderer$=i._rendererOperation$.scan(function(e,t){return t(e)},null).filter(function(e){return null!=e}).distinctUntilChanged(void 0,function(e){return e.frameId}),i._rendererCreator$.map(function(){return function(e){if(null!=e)throw new Error("Multiple image plane states can not be created at the same time");return new a.ImagePlaneGLRenderer}}).subscribe(i._rendererOperation$),i._rendererDisposer$.map(function(){return function(e){return e.dispose(),null}}).subscribe(i._rendererOperation$),i}return n(t,e),t.prototype._activate=function(){var e=this;this._rendererSubscription=this._renderer$.map(function(t){var r={name:e._name,render:{frameId:t.frameId,needsRender:t.needsRender,render:t.render.bind(t),stage:s.GLRenderStage.Background}};return t.clearNeedsRender(),r}).subscribe(this._container.glRenderer.render$),this._rendererCreator$.next(null),this._stateSubscription=this._navigator.stateService.currentState$.map(function(e){return function(t){return t.updateFrame(e),t}}).subscribe(this._rendererOperation$);var t=this._navigator.stateService.currentState$.distinctUntilChanged(void 0,function(e){return e.state.currentNode.key}).combineLatest(this._configuration$).filter(function(e){return!0===e[1].imageTiling}).map(function(e){return e[0]}).withLatestFrom(this._container.glRenderer.webGLRenderer$,this._container.renderService.size$).map(function(t){var r=t[0],n=t[1],i=t[2],o=r.state,a=Math.max(i.width,i.height),s=o.currentNode,c=o.currentTransform,l=a>2048?2048:a>1024?1024:512;return new u.TextureProvider(s.key,c.basicWidth,c.basicHeight,l,s.image,e._imageTileLoader,new u.ImageTileStore,n)}).publishReplay(1).refCount();this._textureProviderSubscription=t.subscribe(function(){}),this._setTextureProviderSubscription=t.map(function(e){return function(t){return t.setTextureProvider(e.key,e),t}}).subscribe(this._rendererOperation$),this._setTileSizeSubscription=this._container.renderService.size$.switchMap(function(e){return i.Observable.combineLatest(t,i.Observable.of(e)).first()}).subscribe(function(e){var t=e[0],r=e[1],n=Math.max(r.width,r.height),i=n>2048?2048:n>1024?1024:512;t.setTileSize(i)}),this._abortTextureProviderSubscription=t.pairwise().subscribe(function(e){e[0].abort()});var r=i.Observable.combineLatest(this._container.renderService.renderCameraFrame$,this._container.renderService.size$.debounceTime(250)).map(function(e){var t=e[0],r=e[1];return[t.camera.position.clone(),t.camera.lookat.clone(),t.zoom.valueOf(),r.height.valueOf(),r.width.valueOf()]}).pairwise().skipWhile(function(e){return e[1][2]-e[0][2]<0||0===e[1][2]}).map(function(e){var t=e[0][0].equals(e[1][0]),r=e[0][1].equals(e[1][1]),n=e[0][2]===e[1][2],i=e[0][3]===e[1][3],o=e[0][4]===e[1][4];return t&&r&&n&&i&&o}).distinctUntilChanged().filter(function(e){return e}).switchMap(function(t){return e._container.renderService.renderCameraFrame$.first()}).withLatestFrom(this._container.renderService.size$,this._navigator.stateService.currentTransform$);this._setRegionOfInterestSubscription=t.switchMap(function(t){return r.map(function(r){var n=r[0],i=r[1],o=r[2];return[e._roiCalculator.computeRegionOfInterest(n,i,o),t]})}).filter(function(e){return!e[1].disposed}).subscribe(function(e){var t=e[0];e[1].setRegionOfInterest(t)});var n=t.switchMap(function(e){return e.hasTexture$}).startWith(!1).publishReplay(1).refCount();this._hasTextureSubscription=n.subscribe(function(){});var o=this._navigator.stateService.currentNode$.debounceTime(1e3).withLatestFrom(n).filter(function(e){return!e[1]}).map(function(e){return e[0]}).filter(function(e){return e.pano?c.Settings.maxImageSize>c.Settings.basePanoramaSize:c.Settings.maxImageSize>c.Settings.baseImageSize}).switchMap(function(e){var t=e.pano?c.Settings.basePanoramaSize:c.Settings.baseImageSize;return Math.max(e.image.width,e.image.height)>t?i.Observable.empty():e.cacheImage$(c.Settings.maxImageSize).map(function(e){return[e.image,e]}).takeUntil(n.filter(function(e){return e})).catch(function(t,r){return console.error("Failed to fetch high res image ("+e.key+")",t),i.Observable.empty()})}).publish().refCount();this._updateBackgroundSubscription=o.withLatestFrom(t).subscribe(function(e){e[0][1].key!==e[1].key||e[1].disposed||e[1].updateBackground(e[0][0])}),this._updateTextureImageSubscription=o.map(function(e){return function(t){return t.updateTextureImage(e[0],e[1]),t}}).subscribe(this._rendererOperation$)},t.prototype._deactivate=function(){this._rendererDisposer$.next(null),this._abortTextureProviderSubscription.unsubscribe(),this._hasTextureSubscription.unsubscribe(),this._rendererSubscription.unsubscribe(),this._setRegionOfInterestSubscription.unsubscribe(),this._setTextureProviderSubscription.unsubscribe(),this._setTileSizeSubscription.unsubscribe(),this._stateSubscription.unsubscribe(),this._textureProviderSubscription.unsubscribe(),this._updateBackgroundSubscription.unsubscribe(),this._updateTextureImageSubscription.unsubscribe()},t.prototype._getDefaultConfiguration=function(){return{imageTiling:!1}},t.componentName="imagePlane",t}(a.Component);r.ImagePlaneComponent=l,a.ComponentService.register(l),r.default=l},{"../../Component":365,"../../Render":370,"../../Tiles":373,"../../Utils":374,"rxjs/Observable":157,"rxjs/Subject":162,"rxjs/add/operator/catch":180,"rxjs/add/operator/combineLatest":181,"rxjs/add/operator/debounceTime":183,"rxjs/add/operator/distinctUntilChanged":186,"rxjs/add/operator/filter":189,"rxjs/add/operator/map":193,"rxjs/add/operator/pairwise":197,"rxjs/add/operator/publish":199,"rxjs/add/operator/publishReplay":200,"rxjs/add/operator/scan":202,"rxjs/add/operator/skipWhile":206,"rxjs/add/operator/startWith":207,"rxjs/add/operator/switchMap":208,"rxjs/add/operator/takeUntil":210,"rxjs/add/operator/withLatestFrom":213}],394:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("three"),i=e("../../Component"),o=function(){function e(e,t){this._imagePlaneDepth=null!=e?e:200,this._imageSphereRadius=null!=t?t:200}return e.prototype.createMesh=function(e,t){return e.pano?this._createImageSphere(e,t):this._createImagePlane(e,t)},e.prototype._createImageSphere=function(e,t){var r=this._createTexture(e.image),i=this._createSphereMaterialParameters(t,r),o=new n.ShaderMaterial(i);return this._useMesh(t,e)?new n.Mesh(this._getImageSphereGeo(t,e),o):new n.Mesh(this._getFlatImageSphereGeo(t),o)},e.prototype._createImagePlane=function(e,t){var r=this._createTexture(e.image),i=this._createPlaneMaterialParameters(t,r),o=new n.ShaderMaterial(i),a=this._useMesh(t,e)?this._getImagePlaneGeo(t,e):this._getFlatImagePlaneGeo(t);return new n.Mesh(a,o)},e.prototype._createSphereMaterialParameters=function(e,t){var r=e.gpano,o=(r.FullPanoWidthPixels-r.CroppedAreaImageWidthPixels)/2,a=2*Math.PI*(r.CroppedAreaLeftPixels-o)/r.FullPanoWidthPixels,s=2*Math.PI*r.CroppedAreaImageWidthPixels/r.FullPanoWidthPixels,u=(r.FullPanoHeightPixels-r.CroppedAreaImageHeightPixels)/2,c=Math.PI*(u-r.CroppedAreaTopPixels)/r.FullPanoHeightPixels,l=Math.PI*r.CroppedAreaImageHeightPixels/r.FullPanoHeightPixels;return{depthWrite:!1,fragmentShader:i.ImagePlaneShaders.equirectangular.fragment,side:n.DoubleSide,transparent:!0,uniforms:{opacity:{type:"f",value:1},phiLength:{type:"f",value:s},phiShift:{type:"f",value:a},projectorMat:{type:"m4",value:e.rt},projectorTex:{type:"t",value:t},thetaLength:{type:"f",value:l},thetaShift:{type:"f",value:c}},vertexShader:i.ImagePlaneShaders.equirectangular.vertex}},e.prototype._createPlaneMaterialParameters=function(e,t){return{depthWrite:!1,fragmentShader:i.ImagePlaneShaders.perspective.fragment,side:n.DoubleSide,transparent:!0,uniforms:{bbox:{type:"v4",value:new n.Vector4(0,0,1,1)},opacity:{type:"f",value:1},projectorMat:{type:"m4",value:e.projectorMatrix()},projectorTex:{type:"t",value:t}},vertexShader:i.ImagePlaneShaders.perspective.vertex}},e.prototype._createTexture=function(e){var t=new n.Texture(e);return t.minFilter=n.LinearFilter,t.needsUpdate=!0,t},e.prototype._useMesh=function(e,t){return t.mesh.vertices.length&&e.hasValidScale},e.prototype._getImageSphereGeo=function(e,t){for(var r=new n.Geometry,i=t.mesh.vertices,o=t.mesh.faces,a=i.length/3,s=0;s<a;++s){var u=i[(p=3*s)+0],c=i[p+1],l=i[p+2];r.vertices.push(new n.Vector3(u,c,l))}for(var h=o.length/3,s=0;s<h;++s){var p=3*s,u=o[p+0],c=o[p+1],l=o[p+2];r.faces.push(new n.Face3(u,c,l))}return r},e.prototype._getImagePlaneGeo=function(e,t){for(var r=(new n.Matrix4).getInverse(e.srt),i=5*e.scale,o=this._imagePlaneDepth*e.scale,a=t.mesh.vertices,s=a.length/3,u=new Float32Array(a.length),c=0;c<s;++c){var l=3*c,h=a[l+0],p=a[l+1],f=a[l+2],d=Math.max(i,Math.min(f,o)),m=d/f,v=new n.Vector3(h*m,p*m,d);v.applyMatrix4(r),u[l+0]=v.x,u[l+1]=v.y,u[l+2]=v.z}for(var y=t.mesh.faces,g=new Uint16Array(y.length),c=0;c<y.length;++c)g[c]=y[c];var b=new n.BufferGeometry;return b.addAttribute("position",new n.BufferAttribute(u,3)),b.setIndex(new n.BufferAttribute(g,1)),b},e.prototype._getFlatImageSphereGeo=function(e){var t=e.gpano,r=2*Math.PI*t.CroppedAreaLeftPixels/t.FullPanoWidthPixels,i=2*Math.PI*t.CroppedAreaImageWidthPixels/t.FullPanoWidthPixels,o=Math.PI*(t.FullPanoHeightPixels-t.CroppedAreaImageHeightPixels-t.CroppedAreaTopPixels)/t.FullPanoHeightPixels,a=Math.PI*t.CroppedAreaImageHeightPixels/t.FullPanoHeightPixels;return new n.SphereGeometry(this._imageSphereRadius,20,40,r-Math.PI/2,i,o,a)},e.prototype._getFlatImagePlaneGeo=function(e){var t=e.width,r=e.height,i=Math.max(t,r),o=t/2/i,a=r/2/i,s=[];s.push(e.unprojectSfM([-o,-a],this._imagePlaneDepth)),s.push(e.unprojectSfM([o,-a],this._imagePlaneDepth)),s.push(e.unprojectSfM([o,a],this._imagePlaneDepth)),s.push(e.unprojectSfM([-o,a],this._imagePlaneDepth));for(var u=new Float32Array(12),c=0;c<s.length;c++){var l=3*c;u[l+0]=s[c][0],u[l+1]=s[c][1],u[l+2]=s[c][2]}var h=new Uint16Array(6);h[0]=0,h[1]=1,h[2]=3,h[3]=1,h[4]=2,h[5]=3;var p=new n.BufferGeometry;return p.addAttribute("position",new n.BufferAttribute(u,3)),p.setIndex(new n.BufferAttribute(h,1)),p},e}();r.ImagePlaneFactory=o,r.default=o},{"../../Component":365,three:311}],395:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("../../Component"),i=e("../../Geo"),o=function(){function e(){this._imagePlaneFactory=new n.ImagePlaneFactory,this._imagePlaneScene=new n.ImagePlaneScene,this._alpha=0,this._alphaOld=0,this._fadeOutSpeed=.05,this._lastCamera=new i.Camera,this._epsilon=1e-6,this._currentKey=null,this._previousKey=null,this._providerDisposers={},this._frameId=0,this._needsRender=!1}return Object.defineProperty(e.prototype,"frameId",{get:function(){return this._frameId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"needsRender",{get:function(){return this._needsRender},enumerable:!0,configurable:!0}),e.prototype.indicateNeedsRender=function(){this._needsRender=!0},e.prototype.updateFrame=function(e){this._updateFrameId(e.id),this._needsRender=this._updateAlpha(e.state.alpha)||this._needsRender,this._needsRender=this._updateAlphaOld(e.state.alpha)||this._needsRender,this._needsRender=this._updateImagePlanes(e.state)||this._needsRender},e.prototype.setTextureProvider=function(e,t){var r=this;if(e===this._currentKey){var n=t.textureCreated$.subscribe(function(e){r._updateTexture(e)}),i=t.textureUpdated$.subscribe(function(e){r._needsRender=!0});e in this._providerDisposers&&((0,this._providerDisposers[e])(),delete this._providerDisposers[e]),this._providerDisposers[e]=function(){n.unsubscribe(),i.unsubscribe(),t.dispose()}}},e.prototype._updateTexture=function(e){this._needsRender=!0;for(var t=0,r=this._imagePlaneScene.imagePlanes;t<r.length;t++){var n=r[t].material,i=n.uniforms.projectorTex.value;n.uniforms.projectorTex.value=null,i.dispose(),n.uniforms.projectorTex.value=e}},e.prototype.updateTextureImage=function(e,t){if(this._currentKey===t.key){this._needsRender=!0;for(var r=0,n=this._imagePlaneScene.imagePlanes;r<n.length;r++){var i=n[r].material.uniforms.projectorTex.value;i.image=e,i.needsUpdate=!0}}},e.prototype.render=function(e,t){for(var r=this._imagePlaneScene.imagePlanesOld.length?1:this._alpha,n=0,i=this._imagePlaneScene.imagePlanes;n<i.length;n++)(c=i[n]).material.uniforms.opacity.value=r;for(var o=0,a=this._imagePlaneScene.imagePlanesOld;o<a.length;o++)(c=a[o]).material.uniforms.opacity.value=this._alphaOld;t.render(this._imagePlaneScene.scene,e),t.render(this._imagePlaneScene.sceneOld,e);for(var s=0,u=this._imagePlaneScene.imagePlanes;s<u.length;s++){var c=u[s];c.material.uniforms.opacity.value=this._alpha}t.render(this._imagePlaneScene.scene,e)},e.prototype.clearNeedsRender=function(){this._needsRender=!1},e.prototype.dispose=function(){this._imagePlaneScene.clear()},e.prototype._updateFrameId=function(e){this._frameId=e},e.prototype._updateAlpha=function(e){return e!==this._alpha&&(this._alpha=e,!0)},e.prototype._updateAlphaOld=function(e){return!(e<1||0===this._alphaOld)&&(this._alphaOld=Math.max(0,this._alphaOld-this._fadeOutSpeed),!0)},e.prototype._updateImagePlanes=function(e){if(null==e.currentNode||e.currentNode.key===this._currentKey)return!1;var t=null!=e.previousNode?e.previousNode.key:null,r=e.currentNode.key;if(this._previousKey!==t&&this._previousKey!==r&&this._previousKey in this._providerDisposers&&((0,this._providerDisposers[this._previousKey])(),delete this._providerDisposers[this._previousKey]),null!=t){if(t!==this._currentKey&&t!==this._previousKey){var n=this._imagePlaneFactory.createMesh(e.previousNode,e.previousTransform);this._imagePlaneScene.updateImagePlanes([n])}this._previousKey=t}this._currentKey=r;var i=this._imagePlaneFactory.createMesh(e.currentNode,e.currentTransform);return this._imagePlaneScene.updateImagePlanes([i]),this._alphaOld=1,!0},e}();r.ImagePlaneGLRenderer=o,r.default=o},{"../../Component":365,"../../Geo":368}],396:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("three"),i=function(){function e(){this.scene=new n.Scene,this.sceneOld=new n.Scene,this.imagePlanes=[],this.imagePlanesOld=[]}return e.prototype.updateImagePlanes=function(e){this._dispose(this.imagePlanesOld,this.sceneOld);for(var t=0,r=this.imagePlanes;t<r.length;t++){o=r[t];this.scene.remove(o),this.sceneOld.add(o)}for(var n=0,i=e;n<i.length;n++){var o=i[n];this.scene.add(o)}this.imagePlanesOld=this.imagePlanes,this.imagePlanes=e},e.prototype.addImagePlanes=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];this.scene.add(n),this.imagePlanes.push(n)}},e.prototype.addImagePlanesOld=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];this.sceneOld.add(n),this.imagePlanesOld.push(n)}},e.prototype.setImagePlanes=function(e){this._clear(),this.addImagePlanes(e)},e.prototype.setImagePlanesOld=function(e){this._clearOld(),this.addImagePlanesOld(e)},e.prototype.clear=function(){this._clear(),this._clearOld()},e.prototype._clear=function(){this._dispose(this.imagePlanes,this.scene),this.imagePlanes.length=0},e.prototype._clearOld=function(){this._dispose(this.imagePlanesOld,this.sceneOld),this.imagePlanesOld.length=0},e.prototype._dispose=function(e,t){for(var r=0,n=e;r<n.length;r++){var i=n[r];t.remove(i),i.geometry.dispose(),i.material.dispose();var o=i.material.uniforms.projectorTex.value;null!=o&&o.dispose()}},e}();r.ImagePlaneScene=i,r.default=i},{three:311}],397:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});e("path");var n=function(){function e(){}return e.equirectangular={fragment:"#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D projectorTex;\nuniform float opacity;\nuniform float phiLength;\nuniform float phiShift;\nuniform float thetaLength;\nuniform float thetaShift;\n\nvarying vec4 vRstq;\n\nvoid main()\n{\n vec3 b = normalize(vRstq.xyz);\n float lat = -asin(b.y);\n float lon = atan(b.x, b.z);\n float x = (lon - phiShift) / phiLength + 0.5;\n float y = (lat - thetaShift) / thetaLength + 0.5;\n vec4 baseColor = texture2D(projectorTex, vec2(x, y));\n baseColor.a = opacity;\n gl_FragColor = baseColor;\n}",vertex:"#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform mat4 projectorMat;\n\nvarying vec4 vRstq;\n\nvoid main()\n{\n vRstq = projectorMat * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}"},e.perspective={fragment:"#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D projectorTex;\nuniform float opacity;\nuniform vec4 bbox;\n\nvarying vec4 vRstq;\n\nvoid main()\n{\n float x = vRstq.x / vRstq.w;\n float y = vRstq.y / vRstq.w;\n\n vec4 baseColor;\n if (x > bbox[0] && y > bbox[1] && x < bbox[2] && y < bbox[3]) {\n baseColor = texture2D(projectorTex, vec2(x, y));\n baseColor.a = opacity;\n } else {\n baseColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n\n gl_FragColor = baseColor;\n}",vertex:"#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform mat4 projectorMat;\n\nvarying vec4 vRstq;\n\nvoid main()\n{\n vRstq = projectorMat * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}"},e}();r.ImagePlaneShaders=n},{path:150}],398:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("rxjs/Observable"),o=e("rxjs/Subject");e("rxjs/add/observable/combineLatest"),e("rxjs/add/observable/fromEvent"),e("rxjs/add/observable/of"),e("rxjs/add/observable/zip"),e("rxjs/add/operator/distinctUntilChanged"),e("rxjs/add/operator/filter"),e("rxjs/add/operator/first"),e("rxjs/add/operator/map"),e("rxjs/add/operator/merge"),e("rxjs/add/operator/mergeMap"),e("rxjs/add/operator/scan"),e("rxjs/add/operator/switchMap"),e("rxjs/add/operator/withLatestFrom"),e("rxjs/add/operator/zip");var a=e("../../State"),s=e("../../Render"),u=e("../../Utils"),c=e("../../Component"),l=function(){function e(){this._imagePlaneFactory=new c.ImagePlaneFactory,this._imagePlaneScene=new c.ImagePlaneScene,this._currentKey=null,this._previousKey=null,this._currentPano=!1,this._frameId=0,this._glNeedsRender=!1,this._domNeedsRender=!0,this._curtain=1}return Object.defineProperty(e.prototype,"frameId",{get:function(){return this._frameId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"curtain",{get:function(){return this._curtain},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"glNeedsRender",{get:function(){return this._glNeedsRender},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"domNeedsRender",{get:function(){return this._domNeedsRender},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sliderVisible",{get:function(){return this._sliderVisible},set:function(e){this._sliderVisible=e,this._domNeedsRender=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return null==this._currentKey||null==this._previousKey||this._currentPano},enumerable:!0,configurable:!0}),e.prototype.update=function(e){this._updateFrameId(e.id);var t=this._updateImagePlanes(e.state);this._domNeedsRender=t||this._domNeedsRender,t=this._updateCurtain(e.state.alpha)||t,this._glNeedsRender=t||this._glNeedsRender},e.prototype.updateTexture=function(e,t){var r=t.key===this._currentKey?this._imagePlaneScene.imagePlanes:t.key===this._previousKey?this._imagePlaneScene.imagePlanesOld:[];if(0!==r.length){this._glNeedsRender=!0;for(var n=0,i=r;n<i.length;n++){var o=i[n].material.uniforms.projectorTex.value;o.image=e,o.needsUpdate=!0}}},e.prototype.render=function(e,t){this.disabled||t.render(this._imagePlaneScene.sceneOld,e),t.render(this._imagePlaneScene.scene,e)},e.prototype.dispose=function(){this._imagePlaneScene.clear()},e.prototype.clearGLNeedsRender=function(){this._glNeedsRender=!1},e.prototype.clearDomNeedsRender=function(){this._domNeedsRender=!1},e.prototype._updateFrameId=function(e){this._frameId=e},e.prototype._updateImagePlanes=function(e){if(null!=e.currentNode){var t=!1;return null!=e.previousNode&&this._previousKey!==e.previousNode.key&&(t=!0,this._previousKey=e.previousNode.key,this._imagePlaneScene.setImagePlanesOld([this._imagePlaneFactory.createMesh(e.previousNode,e.previousTransform)])),this._currentKey!==e.currentNode.key&&(t=!0,this._currentKey=e.currentNode.key,this._currentPano=e.currentNode.pano,this._imagePlaneScene.setImagePlanes([this._imagePlaneFactory.createMesh(e.currentNode,e.currentTransform)]),this.disabled||this._updateBbox()),t}},e.prototype._updateCurtain=function(e){return!(this.disabled||Math.abs(this._curtain-e)<.001)&&(this._curtain=e,this._updateBbox(),!0)},e.prototype._updateBbox=function(){for(var e=0,t=this._imagePlaneScene.imagePlanes;e<t.length;e++)t[e].material.uniforms.bbox.value.z=this._curtain},e}(),h=function(e){function t(t,r,n,i){var a=e.call(this,t,r,n)||this;return a._dom=i||new u.DOM,a._sliderStateOperation$=new o.Subject,a._sliderStateCreator$=new o.Subject,a._sliderStateDisposer$=new o.Subject,a._sliderState$=a._sliderStateOperation$.scan(function(e,t){return t(e)},null).filter(function(e){return null!=e}).distinctUntilChanged(void 0,function(e){return e.frameId}),a._sliderStateCreator$.map(function(){return function(e){if(null!=e)throw new Error("Multiple slider states can not be created at the same time");return new l}}).subscribe(a._sliderStateOperation$),a._sliderStateDisposer$.map(function(){return function(e){return e.dispose(),null}}).subscribe(a._sliderStateOperation$),a}return n(t,e),t.prototype.setKeys=function(e){this.configure({keys:e})},t.prototype.setInitialPosition=function(e){this.configure({initialPosition:e})},t.prototype.setSliderVisible=function(e){this.configure({sliderVisible:e})},t.prototype._activate=function(){var e=this;this._sliderContainer=this._dom.createElement("div","beeview-js-slider-container",this._container.element),this._sliderWrapper=this._dom.createElement("div","SliderWrapper",this._sliderContainer),this._sliderControl=this._dom.createElement("input","SliderControl",this._sliderWrapper),this._sliderControl.setAttribute("type","range"),this._sliderControl.setAttribute("min","0"),this._sliderControl.setAttribute("max","1000"),this._sliderControl.style.visibility="hidden",this._moveToHandler=function(t){var r=Number(t.target.value)/1e3;e._navigator.stateService.moveTo(r)},this._sliderControl.addEventListener("input",this._moveToHandler),this._sliderControl.addEventListener("change",this._moveToHandler),i.Observable.combineLatest(this._navigator.stateService.state$,this._configuration$).first().subscribe(function(t){var r=t[0],n=t[1];if(r===a.State.Traversing){e._navigator.stateService.wait();var i=null!=n.initialPosition?n.initialPosition:1;e._sliderControl.value=(1e3*i).toString(),e._navigator.stateService.moveTo(i)}}),this._glRenderSubscription=this._sliderState$.map(function(t){var r={name:e._name,render:{frameId:t.frameId,needsRender:t.glNeedsRender,render:t.render.bind(t),stage:s.GLRenderStage.Background}};return t.clearGLNeedsRender(),r}).subscribe(this._container.glRenderer.render$),this._domRenderSubscription=this._sliderState$.filter(function(e){return e.domNeedsRender}).subscribe(function(t){e._sliderControl.value=(1e3*t.curtain).toString();var r=t.disabled||!t.sliderVisible?"hidden":"visible";e._sliderControl.style.visibility=r,t.clearDomNeedsRender()}),this._sliderStateCreator$.next(null),this._stateSubscription=this._navigator.stateService.currentState$.map(function(e){return function(t){return t.update(e),t}}).subscribe(this._sliderStateOperation$),this._setSliderVisibleSubscription=this._configuration$.map(function(e){return null==e.sliderVisible||e.sliderVisible}).distinctUntilChanged().map(function(e){return function(t){return t.sliderVisible=e,t}}).subscribe(this._sliderStateOperation$),this._setKeysSubscription=this._configuration$.filter(function(e){return null!=e.keys}).switchMap(function(t){return i.Observable.zip(e._catchCacheNode$(t.keys.background),e._catchCacheNode$(t.keys.foreground)).map(function(e){return{background:e[0],foreground:e[1]}}).zip(e._navigator.stateService.currentState$.first()).map(function(e){return{nodes:e[0],state:e[1].state}})}).subscribe(function(t){null!=t.state.currentNode&&null!=t.state.previousNode&&t.state.currentNode.key===t.nodes.foreground.key&&t.state.previousNode.key===t.nodes.background.key||(t.state.currentNode.key!==t.nodes.background.key?t.state.currentNode.key!==t.nodes.foreground.key||1!==t.state.trajectory.length?(e._navigator.stateService.setNodes([t.nodes.background]),e._navigator.stateService.setNodes([t.nodes.foreground])):e._navigator.stateService.prependNodes([t.nodes.background]):e._navigator.stateService.setNodes([t.nodes.foreground]))},function(e){console.error(e)});var t=this._navigator.stateService.currentState$.map(function(e){return e.state.previousNode}).filter(function(e){return null!=e}).distinctUntilChanged(void 0,function(e){return e.key});this._nodeSubscription=i.Observable.merge(t,this._navigator.stateService.currentNode$).filter(function(e){return e.pano?u.Settings.maxImageSize>u.Settings.basePanoramaSize:u.Settings.maxImageSize>u.Settings.baseImageSize}).mergeMap(function(e){var t=e.pano?u.Settings.basePanoramaSize:u.Settings.baseImageSize;return Math.max(e.image.width,e.image.height)>t?i.Observable.empty():e.cacheImage$(u.Settings.maxImageSize).map(function(e){return[e.image,e]}).catch(function(t,r){return console.error("Failed to fetch high res slider image ("+e.key+")",t),i.Observable.empty()})}).map(function(e){var t=e[0],r=e[1];return function(e){return e.updateTexture(t,r),e}}).subscribe(this._sliderStateOperation$)},t.prototype._deactivate=function(){var e=this;this._navigator.stateService.state$.first().subscribe(function(t){t===a.State.Waiting&&e._navigator.stateService.traverse()}),this._sliderStateDisposer$.next(null),this._setKeysSubscription.unsubscribe(),this._setSliderVisibleSubscription.unsubscribe(),this._stateSubscription.unsubscribe(),this._glRenderSubscription.unsubscribe(),this._domRenderSubscription.unsubscribe(),this._nodeSubscription.unsubscribe(),this.configure({keys:null}),this._sliderControl.removeEventListener("input",this._moveToHandler),this._sliderControl.removeEventListener("change",this._moveToHandler),this._container.element.removeChild(this._sliderContainer),this._moveToHandler=null,this._sliderControl=null,this._sliderWrapper=null,this._sliderContainer=null},t.prototype._getDefaultConfiguration=function(){return{}},t.prototype._catchCacheNode$=function(e){return this._navigator.graphService.cacheNode$(e).catch(function(t,r){return console.error("Failed to cache slider node ("+e+")",t),i.Observable.empty()})},t.componentName="slider",t}(c.Component);r.SliderComponent=h,c.ComponentService.register(h),r.default=h},{"../../Component":365,"../../Render":370,"../../State":371,"../../Utils":374,"rxjs/Observable":157,"rxjs/Subject":162,"rxjs/add/observable/combineLatest":166,"rxjs/add/observable/fromEvent":170,"rxjs/add/observable/of":173,"rxjs/add/observable/zip":176,"rxjs/add/operator/distinctUntilChanged":186,"rxjs/add/operator/filter":189,"rxjs/add/operator/first":191,"rxjs/add/operator/map":193,"rxjs/add/operator/merge":194,"rxjs/add/operator/mergeMap":196,"rxjs/add/operator/scan":202,"rxjs/add/operator/switchMap":208,"rxjs/add/operator/withLatestFrom":213,"rxjs/add/operator/zip":214}],399:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});!function(e){e[e.Hidden=0]="Hidden",e[e.Loading=1]="Loading",e[e.Visible=2]="Visible"}(r.CoverState||(r.CoverState={}))},{}],400:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./ICoverConfiguration");r.CoverState=n.CoverState},{"./ICoverConfiguration":399}],401:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0}),e("rxjs/add/operator/switchMap"),e("rxjs/add/operator/withLatestFrom");var i=e("../../Component"),o=e("../../Edge"),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype._enable=function(){var e=this,t=this._navigator.stateService.currentNode$.switchMap(function(e){return e.sequenceEdges$});this._keyDownSubscription=this._container.keyboardService.keyDown$.withLatestFrom(t).subscribe(function(t){var r=t[0],n=t[1],i=null;switch(r.keyCode){case 38:i=o.EdgeDirection.Next;break;case 40:i=o.EdgeDirection.Prev;break;default:return}if(r.preventDefault(),r.altKey&&!r.shiftKey&&n.cached)for(var a=0,s=n.edges;a<s.length;a++){var u=s[a];if(u.data.direction===i)return void e._navigator.moveToKey$(u.to).subscribe(function(e){},function(e){console.error(e)})}})},t.prototype._disable=function(){this._keyDownSubscription.unsubscribe()},t.prototype._getConfiguration=function(e){return{keySequenceNavigation:e}},t}(i.HandlerBase);r.KeySequenceNavigationHandler=a,r.default=a},{"../../Component":365,"../../Edge":366,"rxjs/add/operator/switchMap":208,"rxjs/add/operator/withLatestFrom":213}],402:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0}),e("rxjs/add/operator/switchMap"),e("rxjs/add/operator/withLatestFrom");var i=e("../../Component"),o=e("../../Edge"),a=function(e){function t(t,r,n,i){var o=e.call(this,t,r,n)||this;return o._spatial=i,o}return n(t,e),t.prototype._enable=function(){var e=this,t=this._navigator.stateService.currentNode$.switchMap(function(e){return e.spatialEdges$});this._keyDownSubscription=this._container.keyboardService.keyDown$.withLatestFrom(t,this._navigator.stateService.currentState$).subscribe(function(t){var r=t[0],n=t[1],i=t[2],a=i.state.currentNode.pano,s=null;switch(r.keyCode){case 37:s=r.shiftKey&&!a?o.EdgeDirection.TurnLeft:o.EdgeDirection.StepLeft;break;case 38:s=r.shiftKey&&!a?o.EdgeDirection.Pano:o.EdgeDirection.StepForward;break;case 39:s=r.shiftKey&&!a?o.EdgeDirection.TurnRight:o.EdgeDirection.StepRight;break;case 40:s=r.shiftKey&&!a?o.EdgeDirection.TurnU:o.EdgeDirection.StepBackward;break;default:return}if(r.preventDefault(),!(r.altKey||!n.cached||r.shiftKey&&a))if(a){var u={};u[o.EdgeDirection.StepBackward]=Math.PI,u[o.EdgeDirection.StepForward]=0,u[o.EdgeDirection.StepLeft]=Math.PI/2,u[o.EdgeDirection.StepRight]=-Math.PI/2;for(var c=e._rotationFromCamera(i.state.camera).phi,l=e._spatial.wrapAngle(c+u[s]),h=Math.PI/4,p=n.edges.filter(function(e){return e.data.direction===o.EdgeDirection.Pano||e.data.direction===s}),f=Number.MAX_VALUE,d=null,m=0,v=p;m<v.length;m++){var y=v[m],g=Math.abs(e._spatial.wrapAngle(y.data.worldMotionAzimuth-l));g<Math.min(f,h)&&(f=g,d=y.to)}if(null==d)return;e._moveToKey(d)}else e._moveDir(s,n)})},t.prototype._disable=function(){this._keyDownSubscription.unsubscribe()},t.prototype._getConfiguration=function(e){return{keySpatialNavigation:e}},t.prototype._moveDir=function(e,t){for(var r=0,n=t.edges;r<n.length;r++){var i=n[r];if(i.data.direction===e)return void this._moveToKey(i.to)}},t.prototype._moveToKey=function(e){this._navigator.moveToKey$(e).subscribe(function(e){},function(e){console.error(e)})},t.prototype._rotationFromCamera=function(e){var t=e.lookat.clone().sub(e.position),r=t.clone().dot(e.up),n=t.clone().sub(e.up.clone().multiplyScalar(r));return{phi:Math.atan2(n.y,n.x),theta:Math.PI/2-this._spatial.angleToPlane(t.toArray(),[0,0,1])}},t}(i.HandlerBase);r.KeySpatialNavigationHandler=a,r.default=a},{"../../Component":365,"../../Edge":366,"rxjs/add/operator/switchMap":208,"rxjs/add/operator/withLatestFrom":213}],403:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0}),e("rxjs/add/operator/withLatestFrom");var i=function(e){function t(t,r,n,i){var o=e.call(this,t,r,n)||this;return o._viewportCoords=i,o}return n(t,e),t.prototype._enable=function(){var e=this;this._keyDownSubscription=this._container.keyboardService.keyDown$.withLatestFrom(this._container.renderService.renderCamera$,this._navigator.stateService.currentTransform$).subscribe(function(t){var r=t[0],n=t[1],i=t[2];if(!(r.altKey||r.shiftKey||r.ctrlKey||r.metaKey)){var o=0;switch(r.key){case"+":o=1;break;case"-":o=-1;break;default:return}r.preventDefault();var a=e._viewportCoords.unprojectFromViewport(0,0,n.perspective),s=i.projectBasic(a.toArray());e._navigator.stateService.zoomIn(o,s)}})},t.prototype._disable=function(){this._keyDownSubscription.unsubscribe()},t.prototype._getConfiguration=function(e){return{keyZoom:e}},t}(e("../../Component").HandlerBase);r.KeyZoomHandler=i,r.default=i},{"../../Component":365,"rxjs/add/operator/withLatestFrom":213}],404:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("../../Component"),o=e("../../Geo"),a=function(e){function t(t,r,n){var a=e.call(this,t,r,n)||this;return a._keyZoomHandler=new i.KeyZoomHandler(a,r,n,new o.ViewportCoords),a._keySequenceNavigationHandler=new i.KeySequenceNavigationHandler(a,r,n),a._keySpatialNavigationHandler=new i.KeySpatialNavigationHandler(a,r,n,new o.Spatial),a}return n(t,e),Object.defineProperty(t.prototype,"keyZoom",{get:function(){return this._keyZoomHandler},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keySequenceNavigation",{get:function(){return this._keySequenceNavigationHandler},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keySpatialNavigation",{get:function(){return this._keySpatialNavigationHandler},enumerable:!0,configurable:!0}),t.prototype._activate=function(){var e=this;this._configurationSubscription=this._configuration$.subscribe(function(t){t.keyZoom?e._keyZoomHandler.enable():e._keyZoomHandler.disable(),t.keySequenceNavigation?e._keySequenceNavigationHandler.enable():e._keySequenceNavigationHandler.disable(),t.keySpatialNavigation?e._keySpatialNavigationHandler.enable():e._keySpatialNavigationHandler.disable()})},t.prototype._deactivate=function(){this._configurationSubscription.unsubscribe()},t.prototype._getDefaultConfiguration=function(){return{keySequenceNavigation:!0,keySpatialNavigation:!0,keyZoom:!0}},t.componentName="keyboard",t}(i.Component);r.KeyboardComponent=a,i.ComponentService.register(a),r.default=a},{"../../Component":365,"../../Geo":368}],405:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./MarkerComponent");r.MarkerComponent=n.MarkerComponent;var i=e("./marker/SimpleMarker");r.SimpleMarker=i.SimpleMarker;var o=e("./marker/CircleMarker");r.CircleMarker=o.CircleMarker;var a=e("./marker/ArrowMarker");r.ArrowMarker=a.ArrowMarker},{"./MarkerComponent":406,"./marker/ArrowMarker":409,"./marker/CircleMarker":410,"./marker/SimpleMarker":412}],406:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("three"),o=e("when"),a=e("rxjs/Observable");e("rxjs/add/observable/combineLatest"),e("rxjs/add/operator/distinctUntilChanged"),e("rxjs/add/operator/map");var s=e("../../Component"),u=e("../../Render"),c=e("../../Graph"),l=e("../../Geo"),h=function(e){function t(t,r,n){var i=e.call(this,t,r,n)||this;return i._relativeGroundAltitude=-2,i._geoCoords=new l.GeoCoords,i._graphCalculator=new c.GraphCalculator,i._markerScene=new s.MarkerScene,i._markerSet=new s.MarkerSet,i._viewportCoords=new l.ViewportCoords,i}return n(t,e),Object.defineProperty(t.prototype,"mouseMove$",{get:function(){return this._mouseMove$},enumerable:!0,configurable:!0}),t.prototype.add=function(e){this._markerSet.add(e)},t.prototype.get=function(e){return this._markerSet.get(e)},t.prototype.getAll=function(){return this._markerSet.getAll()},t.prototype.getMarkerIdAt=function(e){var t=this;return o.promise(function(r,n){t._container.renderService.renderCamera$.first().map(function(r){var n=t._viewportCoords.canvasToViewport(e[0],e[1],t._container.element);return t._markerScene.intersectObjects(n,r.perspective)}).subscribe(function(e){r(e)},function(e){n(e)})})},t.prototype.has=function(e){return this._markerSet.has(e)},t.prototype.remove=function(e){this._markerSet.remove(e)},t.prototype.removeAll=function(){this._markerSet.removeAll()},t.prototype._activate=function(){var e=this,r=this._navigator.stateService.currentState$.map(function(t){return t.state.camera.position.z+e._relativeGroundAltitude}).distinctUntilChanged(function(e,t){return Math.abs(e-t)<.01}).publishReplay(1).refCount(),n=a.Observable.combineLatest(r,this._navigator.stateService.reference$).first().map(function(){}).publishReplay(1).refCount(),o=this._configuration$.map(function(e){return{visibleBBoxSize:Math.max(1,Math.min(200,e.visibleBBoxSize))}}),s=this._navigator.stateService.currentNode$.map(function(e){return e.latLon}).publishReplay(1).refCount(),c=a.Observable.combineLatest(o,s).map(function(t){var r=t[0],n=t[1];return e._graphCalculator.boundingBoxCorners(n,r.visibleBBoxSize/2)}).publishReplay(1).refCount(),l=a.Observable.combineLatest(a.Observable.of(this._markerSet).concat(this._markerSet.changed$),c).map(function(e){var t=e[0],r=e[1];return t.search(r)});this._setChangedSubscription=n.switchMap(function(){return l.withLatestFrom(e._navigator.stateService.reference$,r)}).subscribe(function(t){for(var r=t[0],n=t[1],i=t[2],o=e._geoCoords,a=e._markerScene,s=a.markers,u=Object.assign({},s),c=0,l=r;c<l.length;c++){var h=l[c];if(h.id in s)delete u[h.id];else{var p=o.geodeticToEnu(h.latLon.lat,h.latLon.lon,n.alt+i,n.lat,n.lon,n.alt);a.add(h,p)}}for(var f in u)u.hasOwnProperty(f)&&a.remove(f)}),this._markersUpdatedSubscription=n.switchMap(function(){return e._markerSet.updated$.withLatestFrom(c,e._navigator.stateService.reference$,r)}).subscribe(function(t){for(var r=t[0],n=t[1],i=n[0],o=n[1],a=t[2],s=t[3],u=e._geoCoords,c=e._markerScene,l=0,h=r;l<h.length;l++){var p=h[l],f=c.has(p.id),d=p.latLon.lat>i.lat&&p.latLon.lat<o.lat&&p.latLon.lon>i.lon&&p.latLon.lon<o.lon;if(d){var m=u.geodeticToEnu(p.latLon.lat,p.latLon.lon,a.alt+s,a.lat,a.lon,a.alt);c.add(p,m)}else!d&&f&&c.remove(p.id)}}),this._referenceSubscription=this._navigator.stateService.reference$.skip(1).withLatestFrom(r).subscribe(function(t){for(var r=t[0],n=t[1],i=e._geoCoords,o=e._markerScene,a=0,s=o.getAll();a<s.length;a++){var u=s[a],c=i.geodeticToEnu(u.latLon.lat,u.latLon.lon,r.alt+n,r.lat,r.lon,r.alt);o.update(u.id,c)}}),this._adjustHeightSubscription=r.skip(1).withLatestFrom(this._navigator.stateService.reference$,s).subscribe(function(t){for(var r=t[0],n=t[1],i=t[2],o=e._geoCoords,a=e._markerScene,s=o.geodeticToEnu(i.lat,i.lon,n.alt+r,n.lat,n.lon,n.alt),u=0,c=a.getAll();u<c.length;u++){var l=c[u],h=o.geodeticToEnu(l.latLon.lat,l.latLon.lon,n.alt+r,n.lat,n.lon,n.alt),p=h[0]-s[0],f=h[1]-s[1],d=Math.sqrt(p*p+f*f);d>50||a.lerpAltitude(l.id,r,Math.min(1,Math.max(0,1.2-1.2*d/50)))}}),this._renderSubscription=this._navigator.stateService.currentState$.map(function(t){var r=e._markerScene;return{name:e._name,render:{frameId:t.id,needsRender:r.needsRender,render:r.render.bind(r),stage:u.GLRenderStage.Foreground}}}).subscribe(this._container.glRenderer.render$),this._mouseMove$=a.Observable.combineLatest(this._container.renderService.renderCamera$,this._container.mouseService.mouseMove$).map(function(t){var r=t[0],n=t[1],i=e._container.element,o=e._viewportCoords.canvasPosition(n,i),a=o[0],s=o[1],u=e._viewportCoords.canvasToViewport(a,s,i);return[n,e._markerScene.intersectObjects(u,r.perspective)]}).publishReplay(1).refCount();var h=this._mouseMove$.map(function(e){e[0];return e[1]}).publishReplay(1).refCount(),p=this._container.mouseService.filtered$(this._name,this._container.mouseService.mouseDragStart$).map(function(e){return!0}),f=this._container.mouseService.filtered$(this._name,this._container.mouseService.mouseDragEnd$).map(function(e){return!1}),d=a.Observable.merge(p,f).startWith(!1);this._dragEventSubscription=p.withLatestFrom(h).merge(a.Observable.combineLatest(f,a.Observable.of(null))).startWith([!1,null]).pairwise().subscribe(function(r){var n=r[0],i=r[1],o=i[0],a=o?t.dragstart:t.dragend,s=o?i[1]:n[1],u={marker:e._markerScene.get(s),target:e,type:a};e.fire(a,u)});var m=a.Observable.merge(this._container.mouseService.mouseDown$.map(function(e){return!0}),this._container.mouseService.documentMouseUp$.map(function(e){return!1})).startWith(!1);this._mouseClaimSubscription=a.Observable.combineLatest(this._container.mouseService.active$,h.distinctUntilChanged(),m,d).map(function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return!t&&null!=r&&n||i}).distinctUntilChanged().subscribe(function(t){t?(e._container.mouseService.claimMouse(e._name,1),e._container.mouseService.claimWheel(e._name,1)):(e._container.mouseService.unclaimMouse(e._name),e._container.mouseService.unclaimWheel(e._name))});var v=this._container.mouseService.filtered$(this._name,this._container.mouseService.mouseDragStart$).withLatestFrom(h,this._container.renderService.renderCamera$).map(function(t){var r=t[0],n=t[1],i=t[2],o=e._markerScene.get(n),a=e._container.element,s=e._viewportCoords.projectToCanvas(o.geometry.position.toArray(),a,i.perspective),u=s[0],c=s[1],l=e._viewportCoords.canvasPosition(r,a);return[o,[l[0]-u,l[1]-c],i]}).publishReplay(1).refCount();this._updateMarkerSubscription=this._container.mouseService.filtered$(this._name,this._container.mouseService.mouseDrag$).withLatestFrom(v,this._navigator.stateService.reference$,o).subscribe(function(r){var n=r[0],o=r[1],a=o[0],s=o[1],u=o[2],c=r[2],l=r[3];if(e._markerScene.has(a.id)){var h=e._container.element,p=e._viewportCoords.canvasPosition(n,h),f=p[0],d=p[1],m=f-s[0],v=d-s[1],y=e._viewportCoords.canvasToViewport(m,v,h),g=y[0],b=y[1],_=new i.Vector3(g,b,1).unproject(u.perspective).sub(u.perspective.position).normalize(),x=Math.min(e._relativeGroundAltitude/_.z,l.visibleBBoxSize/2-.1);if(!(x<0)){var w=_.clone().multiplyScalar(x).add(u.perspective.position);w.z=u.perspective.position.z+e._relativeGroundAltitude;var S=e._geoCoords.enuToGeodetic(w.x,w.y,w.z,c.lat,c.lon,c.alt),T=S[0],E=S[1];e._markerScene.update(a.id,w.toArray(),{lat:T,lon:E}),e._markerSet.update(a);var O={marker:a,target:e,type:t.changed};e.fire(t.changed,O)}}})},t.prototype._deactivate=function(){this._adjustHeightSubscription.unsubscribe(),this._dragEventSubscription.unsubscribe(),this._markersUpdatedSubscription.unsubscribe(),this._mouseClaimSubscription.unsubscribe(),this._referenceSubscription.unsubscribe(),this._renderSubscription.unsubscribe(),this._setChangedSubscription.unsubscribe(),this._updateMarkerSubscription.unsubscribe(),this._markerScene.clear()},t.prototype._getDefaultConfiguration=function(){return{visibleBBoxSize:100}},t.componentName="marker",t.changed="changed",t.dragstart="dragstart",t.dragend="dragend",t}(s.Component);r.MarkerComponent=h,s.ComponentService.register(h),r.default=h},{"../../Component":365,"../../Geo":368,"../../Graph":369,"../../Render":370,"rxjs/Observable":157,"rxjs/add/observable/combineLatest":166,"rxjs/add/operator/distinctUntilChanged":186,"rxjs/add/operator/map":193,three:311,when:358}],407:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("three"),i=function(){function e(e,t){this._needsRender=!1,this._interactiveObjects=[],this._markers={},this._objectMarkers={},this._raycaster=t||new n.Raycaster,this._scene=e||new n.Scene}return Object.defineProperty(e.prototype,"markers",{get:function(){return this._markers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"needsRender",{get:function(){return this._needsRender},enumerable:!0,configurable:!0}),e.prototype.add=function(e,t){e.id in this._markers&&this._dispose(e.id),e.createGeometry(t),this._scene.add(e.geometry),this._markers[e.id]=e;for(var r=0,n=e.getInteractiveObjects();r<n.length;r++){var i=n[r];this._interactiveObjects.push(i),this._objectMarkers[i.uuid]=e.id}this._needsRender=!0},e.prototype.clear=function(){for(var e in this._markers)this._markers.hasOwnProperty&&this._dispose(e);this._needsRender=!0},e.prototype.get=function(e){return this._markers[e]},e.prototype.getAll=function(){var e=this;return Object.keys(this._markers).map(function(t){return e._markers[t]})},e.prototype.has=function(e){return e in this._markers},e.prototype.intersectObjects=function(e,t){var r=e[0],i=e[1];this._raycaster.setFromCamera(new n.Vector2(r,i),t);for(var o=0,a=this._raycaster.intersectObjects(this._interactiveObjects);o<a.length;o++){var s=a[o];if(s.object.uuid in this._objectMarkers)return this._objectMarkers[s.object.uuid]}return null},e.prototype.lerpAltitude=function(e,t,r){e in this._markers&&(this._markers[e].lerpAltitude(t,r),this._needsRender=!0)},e.prototype.remove=function(e){e in this._markers&&(this._dispose(e),this._needsRender=!0)},e.prototype.render=function(e,t){t.render(this._scene,e),this._needsRender=!1},e.prototype.update=function(e,t,r){e in this._markers&&(this._markers[e].updatePosition(t,r),this._needsRender=!0)},e.prototype._dispose=function(e){var t=this._markers[e];this._scene.remove(t.geometry);for(var r=0,n=t.getInteractiveObjects();r<n.length;r++){var i=n[r],o=this._interactiveObjects.indexOf(i);-1!==o?this._interactiveObjects.splice(o,1):console.warn("Object does not exist ("+i.id+") for "+e),delete this._objectMarkers[i.uuid]}t.disposeGeometry(),delete this._markers[e]},e}();r.MarkerScene=i,r.default=i},{three:311}],408:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rbush"),i=e("rxjs/Subject");e("rxjs/add/operator/map"),e("rxjs/add/operator/publishReplay"),e("rxjs/add/operator/scan");var o=function(){function e(){this._hash={},this._index=n(16,[".lon",".lat",".lon",".lat"]),this._indexChanged$=new i.Subject,this._updated$=new i.Subject}return Object.defineProperty(e.prototype,"changed$",{get:function(){return this._indexChanged$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updated$",{get:function(){return this._updated$},enumerable:!0,configurable:!0}),e.prototype.add=function(e){for(var t=[],r=this._hash,n=this._index,i=0,o=e;i<o.length;i++){var a=o[i],s=a.id;s in r&&(n.remove(r[s]),t.push(a));var u={lat:a.latLon.lat,lon:a.latLon.lon,marker:a};r[s]=u,n.insert(u)}t.length>0&&this._updated$.next(t),e.length>t.length&&this._indexChanged$.next(this)},e.prototype.has=function(e){return e in this._hash},e.prototype.get=function(e){return this.has(e)?this._hash[e].marker:void 0},e.prototype.getAll=function(){return this._index.all().map(function(e){return e.marker})},e.prototype.remove=function(e){for(var t=this._hash,r=this._index,n=!1,i=0,o=e;i<o.length;i++){var a=o[i];if(a in t){var s=t[a];r.remove(s),delete t[a],n=!0}}n&&this._indexChanged$.next(this)},e.prototype.removeAll=function(){this._hash={},this._index.clear(),this._indexChanged$.next(this)},e.prototype.search=function(e){var t=e[0],r=e[1];return this._index.search({maxX:r.lon,maxY:r.lat,minX:t.lon,minY:t.lat}).map(function(e){return e.marker})},e.prototype.update=function(e){var t=this._hash,r=this._index,n=e.id;if(n in t){r.remove(t[n]);var i={lat:e.latLon.lat,lon:e.latLon.lon,marker:e};t[n]=i,r.insert(i)}},e}();r.MarkerSet=o,r.default=o},{rbush:153,"rxjs/Subject":162,"rxjs/add/operator/map":193,"rxjs/add/operator/publishReplay":200,"rxjs/add/operator/scan":202}],409:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("three"),o=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return n=n||{},i._color=null!=n.color?n.color:16777215,i._opacity=null!=n.opacity?n.opacity:.4,i._radius=null!=n.radius?n.radius:1,i._interactive=null==n.interactive||n.interactive,i}return n(t,e),t.prototype._createGeometry=function(e){var t=new i.Mesh(new i.CircleGeometry(this._radius,100),new i.MeshBasicMaterial({color:this._color,opacity:this._opacity,transparent:!0}));t.up.fromArray([0,0,1]),t.renderOrder=-1;var r=new i.Object3D;r.add(t),r.position.fromArray(e),this._geometry=r},t.prototype._disposeGeometry=function(){for(var e=0,t=this._geometry.children;e<t.length;e++){var r=t[e];r.geometry.dispose(),r.material.dispose()}},t.prototype._getInteractiveObjects=function(){return this._interactive?[this._geometry.children[0]]:[]},t}(e("../../../Component").Marker);r.ArrowMarker=o,r.default=o},{"../../../Component":365,three:311}],410:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("three"),o=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return n=n||{},i._color=null!=n.color?n.color:16777215,i._opacity=null!=n.opacity?n.opacity:.4,i._radius=null!=n.radius?n.radius:.4,i}return n(t,e),t.prototype._createGeometry=function(e){var t=new i.Mesh(new i.CircleGeometry(this._radius,100),new i.MeshBasicMaterial({color:this._color,opacity:this._opacity,transparent:!0}));t.up.fromArray([0,0,1]),t.renderOrder=-1,t.position.z=1e-4;var r=new i.Object3D;r.add(t),r.position.fromArray(e),this._geometry=r},t.prototype._disposeGeometry=function(){for(var e=0,t=this._geometry.children;e<t.length;e++){var r=t[e];r.geometry.dispose(),r.material.dispose()}},t.prototype._getInteractiveObjects=function(){return[]},t}(e("../../../Component").Marker);r.CircleMarker=o,r.default=o},{"../../../Component":365,three:311}],411:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){this._id=e,this._latLon=t}return Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"latLon",{get:function(){return this._latLon},enumerable:!0,configurable:!0}),e.prototype.createGeometry=function(e){this._geometry||(this._createGeometry(e),this._geometry.updateMatrixWorld(!0))},e.prototype.disposeGeometry=function(){this._geometry&&(this._disposeGeometry(),this._geometry=void 0)},e.prototype.getInteractiveObjects=function(){return this._geometry?this._getInteractiveObjects():[]},e.prototype.lerpAltitude=function(e,t){this._geometry&&(this._geometry.position.z=(1-t)*this._geometry.position.z+t*e)},e.prototype.updatePosition=function(e,t){t&&(this._latLon.lat=t.lat,this._latLon.lon=t.lon),this._geometry&&(this._geometry.position.fromArray(e),this._geometry.updateMatrixWorld(!0))},e}();r.Marker=n,r.default=n},{}],412:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("three"),o=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return n=n||{},i._ballColor=null!=n.ballColor?n.ballColor:16711680,i._ballOpacity=null!=n.ballOpacity?n.ballOpacity:.8,i._circleToRayAngle=2,i._color=null!=n.color?n.color:16711680,i._interactive=!!n.interactive,i._opacity=null!=n.opacity?n.opacity:.4,i._radius=null!=n.radius?n.radius:1,i}return n(t,e),t.prototype._createGeometry=function(e){var t=this._radius,r=new i.Mesh(this._markerGeometry(t,8,8),new i.MeshBasicMaterial({color:this._color,opacity:this._opacity,shading:i.SmoothShading,transparent:!0}));r.renderOrder=1;var n=new i.Mesh(new i.SphereGeometry(t/2,8,8),new i.MeshBasicMaterial({color:this._ballColor,opacity:this._ballOpacity,shading:i.SmoothShading,transparent:!0}));n.position.z=this._markerHeight(t);var o=new i.Object3D;o.add(n),o.add(r),o.position.fromArray(e),this._geometry=o},t.prototype._disposeGeometry=function(){for(var e=0,t=this._geometry.children;e<t.length;e++){var r=t[e];r.geometry.dispose(),r.material.dispose()}},t.prototype._getInteractiveObjects=function(){return this._interactive?[this._geometry.children[0]]:[]},t.prototype._markerHeight=function(e){var t=Math.tan(Math.PI-this._circleToRayAngle);return e*Math.sqrt(1+t*t)},t.prototype._markerGeometry=function(e,t,r){var n=new i.Geometry;t=Math.max(3,Math.floor(t)||8),r=Math.max(2,Math.floor(r)||6);for(var o=this._markerHeight(e),a=[],s=0;s<=r;++s){for(var u=[],c=0;c<=t;++c){var l=c/t*Math.PI*2,h=s/r*Math.PI,p=void 0;if(h<this._circleToRayAngle)p=e;else{var f=Math.tan(h-this._circleToRayAngle);p=e*Math.sqrt(1+f*f)}var d=new i.Vector3;d.x=p*Math.cos(l)*Math.sin(h),d.y=p*Math.sin(l)*Math.sin(h),d.z=p*Math.cos(h)+o,n.vertices.push(d),u.push(n.vertices.length-1)}a.push(u)}for(s=0;s<r;++s)for(c=0;c<t;++c){var m=a[s][c+1],v=a[s][c],y=a[s+1][c],g=a[s+1][c+1],b=n.vertices[m].clone().normalize(),_=n.vertices[v].clone().normalize(),x=n.vertices[y].clone().normalize(),w=n.vertices[g].clone().normalize();n.faces.push(new i.Face3(m,v,g,[b,_,w])),n.faces.push(new i.Face3(v,y,g,[_.clone(),x,w.clone()]))}return n.computeFaceNormals(),n.boundingSphere=new i.Sphere(new i.Vector3,e+o),n},t}(e("../../../Component").Marker);r.SimpleMarker=o,r.default=o},{"../../../Component":365,three:311}],413:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("rxjs/Observable"),o=function(e){function t(t,r,n,i,o){var a=e.call(this,t,r,n)||this;return a._spatial=o,a._viewportCoords=i,a._basicDistanceThreshold=.001,a._basicRotationThreshold=.05,a._bounceCoeff=.1,a}return n(t,e),t.prototype._enable=function(){var e=this,t=this._navigator.stateService.currentState$.map(function(e){return e.state.alpha<1});this._bounceSubscription=i.Observable.combineLatest(t,this._navigator.stateService.inTranslation$,this._container.mouseService.active$,this._container.touchService.active$).map(function(e){return e[0]||e[1]||e[2]||e[3]}).distinctUntilChanged().switchMap(function(t){return t?i.Observable.empty():i.Observable.combineLatest(e._container.renderService.renderCamera$,e._navigator.stateService.currentTransform$.first())}).subscribe(function(t){var r=t[0],n=r.perspective,i=t[1];if((i.hasValidScale||!(r.camera.focal<.1))&&0!==r.perspective.aspect&&r.perspective.aspect!==Number.POSITIVE_INFINITY){var o=e._basicDistanceThreshold/Math.pow(2,r.zoom),a=e._viewportCoords.viewportToBasic(0,0,i,n);if(!(Math.abs(a[0]-.5)<o&&Math.abs(a[1]-.5)<o)){var s=e._viewportCoords.getBasicDistances(i,n),u=0,c=0;if(!(s[0]<o&&s[1]<o&&s[2]<o&&s[3]<o||Math.abs(s[0]-s[2])<o&&Math.abs(s[1]-s[3])<o)){var l=e._bounceCoeff;s[1]>0&&0===s[3]?u=-l*s[1]:0===s[1]&&s[3]>0?u=l*s[3]:s[1]>0&&s[3]>0&&(u=l*(s[3]-s[1])/2),s[0]>0&&0===s[2]?c=l*s[0]:0===s[0]&&s[2]>0?c=-l*s[2]:s[0]>0&&s[2]>0&&(c=l*(s[0]-s[2])/2);var h=e._basicRotationThreshold;u=e._spatial.clamp(u,-h,h),c=e._spatial.clamp(c,-h,h),e._navigator.stateService.rotateBasicUnbounded([u,c])}}}})},t.prototype._disable=function(){this._bounceSubscription.unsubscribe()},t.prototype._getConfiguration=function(e){return{}},t}(e("../../Component").HandlerBase);r.BounceHandler=o,r.default=o},{"../../Component":365,"rxjs/Observable":157}],414:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("rxjs/Observable"),o=function(e){function t(t,r,n,i){var o=e.call(this,t,r,n)||this;return o._viewportCoords=i,o}return n(t,e),t.prototype._enable=function(){var e=this;this._zoomSubscription=i.Observable.merge(this._container.mouseService.filtered$(this._component.name,this._container.mouseService.dblClick$),this._container.touchService.doubleTap$.map(function(e){var t=e.touches[0];return{clientX:t.clientX,clientY:t.clientY,shiftKey:e.shiftKey}})).withLatestFrom(this._container.renderService.renderCamera$,this._navigator.stateService.currentTransform$).subscribe(function(t){var r=t[0],n=t[1],i=t[2],o=e._container.element,a=e._viewportCoords.canvasPosition(r,o),s=a[0],u=a[1],c=e._viewportCoords.unprojectFromCanvas(s,u,o,n.perspective),l=i.projectBasic(c.toArray()),h=r.shiftKey?-1:1;e._navigator.stateService.zoomIn(h,l)})},t.prototype._disable=function(){this._zoomSubscription.unsubscribe()},t.prototype._getConfiguration=function(e){return{doubleClickZoom:e}},t}(e("../../Component").HandlerBase);r.DoubleClickZoomHandler=o,r.default=o},{"../../Component":365,"rxjs/Observable":157}],415:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("three"),o=e("rxjs/Observable");e("rxjs/add/operator/concat"),e("rxjs/add/operator/sample"),e("rxjs/add/operator/takeWhile");var a=function(e){function t(t,r,n,i,o){var a=e.call(this,t,r,n)||this;return a._spatial=o,a._viewportCoords=i,a._basicRotationThreshold=.05,a._forceCoeff=.2,a}return n(t,e),t.prototype._enable=function(){var e=this,t=this._container.mouseService.filtered$(this._component.name,this._container.mouseService.mouseDragStart$).map(function(e){return!0}),r=this._container.mouseService.filtered$(this._component.name,this._container.mouseService.mouseDragEnd$).map(function(e){return!1});this._activeMouseSubscription=o.Observable.merge(t,r).subscribe(this._container.mouseService.activate$),this._preventDefaultSubscription=o.Observable.merge(t,r).switchMap(function(t){return t?e._container.mouseService.documentMouseMove$:o.Observable.empty()}).merge(this._container.touchService.touchMove$).subscribe(function(e){e.preventDefault()});var n=this._container.touchService.singleTouchDragStart$.map(function(e){return!0}),a=this._container.touchService.singleTouchDragEnd$.map(function(e){return!1});this._activeTouchSubscription=o.Observable.merge(n,a).subscribe(this._container.touchService.activate$);var s=this._navigator.stateService.currentState$.map(function(e){return e.state.currentNode.fullPano||e.state.nodesAhead<1}).distinctUntilChanged().switchMap(function(t){if(!t)return o.Observable.empty();var r=e._container.mouseService.filtered$(e._component.name,e._container.mouseService.mouseDragStart$).switchMap(function(t){return o.Observable.of(t).concat(e._container.mouseService.filtered$(e._component.name,e._container.mouseService.mouseDrag$)).merge(e._container.mouseService.filtered$(e._component.name,e._container.mouseService.mouseDragEnd$).map(function(e){return null})).takeWhile(function(e){return!!e}).startWith(null)}).pairwise().filter(function(e){return null!=e[0]&&null!=e[1]}),n=o.Observable.merge(e._container.touchService.singleTouchDragStart$,e._container.touchService.singleTouchDrag$,e._container.touchService.singleTouchDragEnd$.map(function(e){return null})).map(function(e){return null!=e&&e.touches.length>0?e.touches[0]:null}).pairwise().filter(function(e){return null!=e[0]&&null!=e[1]});return o.Observable.merge(r,n)}).withLatestFrom(this._container.renderService.renderCamera$,this._navigator.stateService.currentTransform$,this._navigator.stateService.currentCamera$).map(function(t){var r=t[0],n=t[1],o=t[2],a=t[3].clone(),s=r[0],u=r[1],c=u.clientX-s.clientX,l=u.clientY-s.clientY,h=e._container.element,p=e._viewportCoords.canvasPosition(u,h),f=p[0],d=p[1],m=e._viewportCoords.unprojectFromCanvas(f,d,h,n.perspective).sub(n.perspective.position),v=e._viewportCoords.unprojectFromCanvas(f-c,d,h,n.perspective).sub(n.perspective.position),y=e._viewportCoords.unprojectFromCanvas(f,d-l,h,n.perspective).sub(n.perspective.position),g=(c>0?1:-1)*v.angleTo(m),b=(l>0?-1:1)*y.angleTo(m),_=(new i.Quaternion).setFromUnitVectors(a.up,new i.Vector3(0,0,1)),x=_.clone().inverse(),w=new i.Vector3;w.copy(a.lookat).sub(a.position),w.applyQuaternion(_);var S=w.length(),T=Math.atan2(w.y,w.x);T+=g;var E=Math.atan2(Math.sqrt(w.x*w.x+w.y*w.y),w.z);E+=b,E=Math.max(.01,Math.min(Math.PI-1.5,E)),w.x=Math.sin(E)*Math.cos(T),w.y=Math.sin(E)*Math.sin(T),w.z=Math.cos(E),w.applyQuaternion(x);var O=(new i.Vector3).copy(a.position).add(w.multiplyScalar(S)),M=o.projectBasic(O.toArray()),C=o.projectBasic(a.lookat.toArray()),j=M[0]-C[0],P=M[1]-C[1];Math.abs(j)>1?j=0:j>.5?j-=1:j<-.5&&(j+=1);var A=e._basicRotationThreshold;if(j=e._spatial.clamp(j,-A,A),P=e._spatial.clamp(P,-A,A),o.fullPano)return[j,P];var N=e._viewportCoords.getPixelDistances(e._container.element,o,n.perspective),L=e._forceCoeff;return N[0]>0&&P<0&&M[1]<.5&&(P/=Math.max(1,L*N[0])),N[1]>0&&j>0&&M[0]>.5&&(j/=Math.max(1,L*N[1])),N[2]>0&&P>0&&M[1]>.5&&(P/=Math.max(1,L*N[2])),N[3]>0&&j<0&&M[0]<.5&&(j/=Math.max(1,L*N[3])),[j,P]}).share();this._rotateBasicWithoutInertiaSubscription=s.subscribe(function(t){e._navigator.stateService.rotateBasicWithoutInertia(t)}),this._rotateBasicSubscription=s.scan(function(t,r){return e._drainBuffer(t),t.push([Date.now(),r]),t},[]).sample(o.Observable.merge(this._container.mouseService.filtered$(this._component.name,this._container.mouseService.mouseDragEnd$),this._container.touchService.singleTouchDragEnd$)).map(function(t){for(var r=e._drainBuffer(t.slice()),n=[0,0],i=0,o=r;i<o.length;i++){var a=o[i];n[0]+=a[1][0],n[1]+=a[1][1]}var s=r.length;return s>0&&(n[0]/=s,n[1]/=s),n}).subscribe(function(t){e._navigator.stateService.rotateBasic(t)})},t.prototype._disable=function(){this._activeMouseSubscription.unsubscribe(),this._activeTouchSubscription.unsubscribe(),this._preventDefaultSubscription.unsubscribe(),this._rotateBasicSubscription.unsubscribe(),this._rotateBasicWithoutInertiaSubscription.unsubscribe(),this._activeMouseSubscription=null,this._activeTouchSubscription=null,this._preventDefaultSubscription=null,this._rotateBasicSubscription=null},t.prototype._getConfiguration=function(e){return{dragPan:e}},t.prototype._drainBuffer=function(e){for(var t=Date.now();e.length>0&&t-e[0][0]>50;)e.shift();return e},t}(e("../../Component").HandlerBase);r.DragPanHandler=a,r.default=a},{"../../Component":365,"rxjs/Observable":157,"rxjs/add/operator/concat":182,"rxjs/add/operator/sample":201,"rxjs/add/operator/takeWhile":211,three:311}],416:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0}),e("rxjs/add/observable/merge"),e("rxjs/add/operator/filter"),e("rxjs/add/operator/map"),e("rxjs/add/operator/withLatestFrom");var i=e("../../Component"),o=e("../../Geo"),a=function(e){function t(t,r,n){var a=e.call(this,t,r,n)||this,s=new o.Spatial,u=new o.ViewportCoords;return a._spatial=s,a._viewportCoords=u,a._bounceHandler=new i.BounceHandler(a,r,n,u,s),a._doubleClickZoomHandler=new i.DoubleClickZoomHandler(a,r,n,u),a._dragPanHandler=new i.DragPanHandler(a,r,n,u,s),a._scrollZoomHandler=new i.ScrollZoomHandler(a,r,n,u),a._touchZoomHandler=new i.TouchZoomHandler(a,r,n,u),a}return n(t,e),Object.defineProperty(t.prototype,"doubleClickZoom",{get:function(){return this._doubleClickZoomHandler},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dragPan",{get:function(){return this._dragPanHandler},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrollZoom",{get:function(){return this._scrollZoomHandler},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"touchZoom",{get:function(){return this._touchZoomHandler},enumerable:!0,configurable:!0}),t.prototype._activate=function(){var e=this;this._bounceHandler.enable(),this._configurationSubscription=this._configuration$.subscribe(function(t){t.doubleClickZoom?e._doubleClickZoomHandler.enable():e._doubleClickZoomHandler.disable(),t.dragPan?e._dragPanHandler.enable():e._dragPanHandler.disable(),t.scrollZoom?e._scrollZoomHandler.enable():e._scrollZoomHandler.disable(),t.touchZoom?e._touchZoomHandler.enable():e._touchZoomHandler.disable()}),this._container.mouseService.claimMouse(this._name,0)},t.prototype._deactivate=function(){this._container.mouseService.unclaimMouse(this._name),this._configurationSubscription.unsubscribe(),this._bounceHandler.disable(),this._doubleClickZoomHandler.disable(),this._dragPanHandler.disable(),this._scrollZoomHandler.disable(),this._touchZoomHandler.disable()},t.prototype._getDefaultConfiguration=function(){return{doubleClickZoom:!0,dragPan:!0,scrollZoom:!0,touchZoom:!0}},t.componentName="mouse",t}(i.Component);r.MouseComponent=a,i.ComponentService.register(a),r.default=a},{"../../Component":365,"../../Geo":368,"rxjs/add/observable/merge":172,"rxjs/add/operator/filter":189,"rxjs/add/operator/map":193,"rxjs/add/operator/withLatestFrom":213}],417:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=function(e){function t(t,r,n,i){var o=e.call(this,t,r,n)||this;return o._viewportCoords=i,o}return n(t,e),t.prototype._enable=function(){var e=this;this._container.mouseService.claimWheel(this._component.name,0),this._preventDefaultSubscription=this._container.mouseService.mouseWheel$.subscribe(function(e){e.preventDefault()}),this._zoomSubscription=this._container.mouseService.filteredWheel$(this._component.name,this._container.mouseService.mouseWheel$).withLatestFrom(this._navigator.stateService.currentState$,function(e,t){return[e,t]}).filter(function(e){var t=e[1].state;return t.currentNode.fullPano||t.nodesAhead<1}).map(function(e){return e[0]}).withLatestFrom(this._container.renderService.renderCamera$,this._navigator.stateService.currentTransform$,function(e,t,r){return[e,t,r]}).subscribe(function(t){var r=t[0],n=t[1],i=t[2],o=e._container.element,a=e._viewportCoords.canvasPosition(r,o),s=a[0],u=a[1],c=e._viewportCoords.unprojectFromCanvas(s,u,o,n.perspective),l=i.projectBasic(c.toArray()),h=r.deltaY;1===r.deltaMode?h*=40:2===r.deltaMode&&(h*=800);var p=-3*h/e._viewportCoords.containerToCanvas(o)[1];e._navigator.stateService.zoomIn(p,l)})},t.prototype._disable=function(){this._container.mouseService.unclaimWheel(this._component.name),this._preventDefaultSubscription.unsubscribe(),this._zoomSubscription.unsubscribe(),this._preventDefaultSubscription=null,this._zoomSubscription=null},t.prototype._getConfiguration=function(e){return{scrollZoom:e}},t}(e("../../Component").HandlerBase);r.ScrollZoomHandler=i,r.default=i},{"../../Component":365}],418:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("rxjs/Observable"),o=function(e){function t(t,r,n,i){var o=e.call(this,t,r,n)||this;return o._viewportCoords=i,o}return n(t,e),t.prototype._enable=function(){var e=this;this._preventDefaultSubscription=this._container.touchService.pinch$.subscribe(function(e){e.originalEvent.preventDefault()});var t=this._container.touchService.pinchStart$.map(function(e){return!0}),r=this._container.touchService.pinchEnd$.map(function(e){return!1});this._activeSubscription=i.Observable.merge(t,r).subscribe(this._container.touchService.activate$),this._zoomSubscription=this._container.touchService.pinch$.withLatestFrom(this._navigator.stateService.currentState$).filter(function(e){var t=e[1].state;return t.currentNode.fullPano||t.nodesAhead<1}).map(function(e){return e[0]}).withLatestFrom(this._container.renderService.renderCamera$,this._navigator.stateService.currentTransform$).subscribe(function(t){var r=t[0],n=t[1],i=t[2],o=e._container.element,a=e._viewportCoords.canvasPosition(r,o),s=a[0],u=a[1],c=e._viewportCoords.unprojectFromCanvas(s,u,o,n.perspective),l=i.projectBasic(c.toArray()),h=e._viewportCoords.containerToCanvas(o),p=h[0],f=h[1],d=3*r.distanceChange/Math.min(p,f);e._navigator.stateService.zoomIn(d,l)})},t.prototype._disable=function(){this._activeSubscription.unsubscribe(),this._preventDefaultSubscription.unsubscribe(),this._zoomSubscription.unsubscribe(),this._preventDefaultSubscription=null,this._zoomSubscription=null},t.prototype._getConfiguration=function(e){return{touchZoom:e}},t}(e("../../Component").HandlerBase);r.TouchZoomHandler=o,r.default=o},{"../../Component":365,"rxjs/Observable":157}],419:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("../../Component"),o=e("../marker/Marker"),a=e("./PathRender"),s=e("./PathMarker"),u=e("./PathEvent"),c=e("rxjs/Observable"),l=function(e){function t(t,r,n){var i=e.call(this,t,r,n)||this;i._markerComponent=new o.MarkerComponent(t,r,n);var c=new s.PathMarker;return i._pathRender=new a.PathRender(i._markerComponent,c),i._pathEvent=new u.PathEvent(i._markerComponent,c,r,n),i}return n(t,e),t.prototype._activate=function(){var e=this;this._markerComponent.activate(),this._pathEvent.bind(),this._disposable=c.Observable.combineLatest(this._navigator.stateService.currentNodeExternal$,this._navigator.imageLoadingService.loadpath$).do(function(t){var r=t[0],n=t[1];e._pathRender.render(r,n)}).subscribe(function(){})},t.prototype._deactivate=function(){this._disposable.unsubscribe(),this._pathEvent.unbind(),this._markerComponent.deactivate()},t.prototype._getDefaultConfiguration=function(){return{}},t.componentName="path",t}(i.Component);r.PathComponent=l,i.ComponentService.register(l),r.default=l},{"../../Component":365,"../marker/Marker":405,"./PathEvent":420,"./PathMarker":421,"./PathRender":422,"rxjs/Observable":157}],420:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/Observable"),i=e("../../viewer/Viewer"),o=e("../../viewer/Projection"),a=function(){function e(e,t,r,n){this._markerComponent=e,this._pathMarker=t,this._container=r,this._navigator=n,this._projection=new o.Projection,this._defaultColor="#fff",this._hoverColor="#f80",this._movingMarkerId="moving-path"}return e.prototype.bind=function(){var e=this;return this._disposable=n.Observable.merge(this._mapMouseEvent$(i.Viewer.mousedown,this._container.mouseService.mouseDown$),this._mapMouseEvent$(i.Viewer.mousemove,this._container.mouseService.mouseMove$)).withLatestFrom(this._container.renderService.renderCamera$,this._navigator.stateService.reference$,this._navigator.stateService.currentTransform$).map(function(t){var r=t[0],n=r[0],i=r[1],o=t[1],a=t[2],s=t[3],u=e._projection.eventToUnprojection(i,e._container.element,o,a,s);return{basicPoint:u.basicPoint,latLon:u.latLon,originalEvent:i,pixelPoint:u.pixelPoint,target:null,type:n}}).subscribe(function(t){switch(t.type){case"mousemove":e._mouseMove(t);break;case"mousedown":e._mouseDown(t)}}),this},e.prototype.unbind=function(){return this._disposable.unsubscribe(),this},e.prototype._mapMouseEvent$=function(e,t){return t.map(function(t){return[e,t]})},e.prototype._mouseDown=function(e){this._markerComponent.getMarkerIdAt(e.pixelPoint).then(this._updateClickState.bind(this))},e.prototype._updateClickState=function(e){null!==e&&e!==this._movingMarkerId&&this._navigator.moveToKey$(e)},e.prototype._mouseMove=function(e){null===e.latLon?this._removeMovingMarker():(this._markerComponent.getMarkerIdAt(e.pixelPoint).then(this._updateHoverState.bind(this)),this._createMovingMarker(e.latLon))},e.prototype._updateHoverState=function(e){e?this._hoveredMarker||(this._hoveredMarker=this._pathMarker.createArrowMarker(e,this._markerComponent.get(e).latLon,this._hoverColor),this._markerComponent.add([this._hoveredMarker])):this._hoveredMarker&&(this._markerComponent.add([this._pathMarker.createArrowMarker(this._hoveredMarker.id,this._hoveredMarker.latLon,this._defaultColor)]),this._hoveredMarker=null)},e.prototype._createMovingMarker=function(e){return this._markerComponent.add([this._movingMarker=this._pathMarker.createCircleMarker(this._movingMarkerId,e,this._defaultColor)]),this},e.prototype._removeMovingMarker=function(){return this._movingMarker=null,this},e}();r.PathEvent=a},{"../../viewer/Projection":512,"../../viewer/Viewer":515,"rxjs/Observable":157}],421:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("../marker/Marker"),i=function(){function e(){this._defaultOpacity=.5}return e.prototype.createArrowMarker=function(e,t,r){return new n.ArrowMarker(e,{lat:t.lat,lon:t.lon},{color:r,interactive:!0,opacity:this._defaultOpacity,radius:.4})},e.prototype.createCircleMarker=function(e,t,r){return new n.CircleMarker(e,{lat:t.lat,lon:t.lon},{color:r,opacity:this._defaultOpacity,radius:.4})},e}();r.PathMarker=i},{"../marker/Marker":405}],422:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("../marker/Marker"),i=function(){function e(e,t){this._meter=20,this._markerComponent=e,this._pathMarker=t,this._defaultColor="#fff"}return e.prototype.render=function(e,t){var r=this,i=this._markerComponent.getAll().filter(function(e){return!(e instanceof n.CircleMarker)}).map(function(e){return e.id});this._markerComponent.remove(i);var o=t.slice().filter(function(t){return t.floor_id===e.floor.id}).filter(function(t){if(r._getDisance(e.latLon,t.l)<r._meter)return t});return this._markerComponent.add(this._getMarkerArr(o,this._defaultColor)),this},e.prototype._toRad=function(e){return e*Math.PI/180},e.prototype._getDisance=function(e,t){var r=this._toRad(e.lat),n=this._toRad(t.lat),i=r-n,o=this._toRad(e.lon)-this._toRad(t.lon);return 6378137*(2*Math.asin(Math.sqrt(Math.pow(Math.sin(i/2),2)+Math.cos(r)*Math.cos(n)*Math.pow(Math.sin(o/2),2))))},e.prototype._getMarkerArr=function(e,t){var r=this;return e.map(function(e){return r._pathMarker.createArrowMarker(e.key,e.l,t)})},e}();r.PathRender=i},{"../marker/Marker":405}],423:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./popup/Popup");r.Popup=n.Popup;var i=e("./PopupComponent");r.PopupComponent=i.PopupComponent},{"./PopupComponent":424,"./popup/Popup":425}],424:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("rxjs/Observable"),o=e("rxjs/Subject"),a=e("../../Component"),s=e("../../Utils"),u=function(e){function t(t,r,n,i){var a=e.call(this,t,r,n)||this;return a._dom=i||new s.DOM,a._popups=[],a._added$=new o.Subject,a._popups$=new o.Subject,a}return n(t,e),t.prototype.add=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];-1===this._popups.indexOf(n)&&(this._popups.push(n),this._activated&&n.setParentContainer(this._popupContainer))}this._added$.next(e),this._popups$.next(this._popups)},t.prototype.getAll=function(){return this._popups.slice()},t.prototype.remove=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];this._remove(n)}this._popups$.next(this._popups)},t.prototype.removeAll=function(){for(var e=0,t=this._popups.slice();e<t.length;e++){var r=t[e];this._remove(r)}this._popups$.next(this._popups)},t.prototype._activate=function(){var e=this;this._popupContainer=this._dom.createElement("div","Beeview-js-popup-container",this._container.element);for(var t=0,r=this._popups;t<r.length;t++)r[t].setParentContainer(this._popupContainer);this._updateAllSubscription=i.Observable.combineLatest(this._container.renderService.renderCamera$,this._container.renderService.size$,this._navigator.stateService.currentTransform$).subscribe(function(t){for(var r=t[0],n=t[1],i=t[2],o=0,a=e._popups;o<a.length;o++)a[o].update(r,n,i)});var n=this._popups$.startWith(this._popups).switchMap(function(e){return i.Observable.from(e).mergeMap(function(e){return e.changed$})}).map(function(e){return[e]});this._updateAddedChangedSubscription=this._added$.merge(n).withLatestFrom(this._container.renderService.renderCamera$,this._container.renderService.size$,this._navigator.stateService.currentTransform$).subscribe(function(e){for(var t=e[0],r=e[1],n=e[2],i=e[3],o=0,a=t;o<a.length;o++)a[o].update(r,n,i)})},t.prototype._deactivate=function(){this._updateAllSubscription.unsubscribe(),this._updateAddedChangedSubscription.unsubscribe();for(var e=0,t=this._popups;e<t.length;e++)t[e].remove();this._container.element.removeChild(this._popupContainer),delete this._popupContainer},t.prototype._getDefaultConfiguration=function(){return{}},t.prototype._remove=function(e){var t=this._popups.indexOf(e);if(-1!==t){var r=this._popups.splice(t,1)[0];this._activated&&r.remove()}},t.componentName="popup",t}(a.Component);r.PopupComponent=u,a.ComponentService.register(u),r.default=u},{"../../Component":365,"../../Utils":374,"rxjs/Observable":157,"rxjs/Subject":162}],425:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/Subject"),i=e("../../../Geo"),o=e("../../../Utils"),a=e("../../../Viewer"),s=function(){function e(e,t,r){this._options={},e&&(this._options.capturePointer=null==e.capturePointer||e.capturePointer,this._options.clean=e.clean,this._options.float=e.float,this._options.offset=e.offset,this._options.opacity=e.opacity,this._options.position=e.position),this._dom=r||new o.DOM,this._viewportCoords=t||new i.ViewportCoords,this._notifyChanged$=new n.Subject}return Object.defineProperty(e.prototype,"changed$",{get:function(){return this._notifyChanged$},enumerable:!0,configurable:!0}),e.prototype.remove=function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._parentContainer&&delete this._parentContainer},e.prototype.setBasicPoint=function(e){this._point=e.slice(),this._rect=null,this._notifyChanged$.next(this)},e.prototype.setBasicRect=function(e){this._rect=e.slice(),this._point=null,this._notifyChanged$.next(this)},e.prototype.setDOMContent=function(e){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content);var t="beeviewjs-popup-content"+(!0===this._options.clean?"-clean":"")+(!0===this._options.capturePointer?" beeviewjs-popup-capture-pointer":"");this._content=this._dom.createElement("div",t,this._container),this._content.appendChild(e),this._notifyChanged$.next(this)},e.prototype.setHTML=function(e){var t,r=this._dom.document.createDocumentFragment(),n=this._dom.createElement("body");for(n.innerHTML=e;;){if(!(t=n.firstChild))break;r.appendChild(t)}this.setDOMContent(r)},e.prototype.setText=function(e){this.setDOMContent(this._dom.document.createTextNode(e))},e.prototype.setParentContainer=function(e){this._parentContainer=e},e.prototype.update=function(e,t,r){var n;if(this._parentContainer&&this._content&&(this._point||this._rect)){if(!this._container){if(this._container=this._dom.createElement("div","beeviewjs-popup",this._parentContainer),!0!==this._options.clean&&this._options.float!==a.Alignment.Center){var i="beeviewjs-popup-tip"+(!0===this._options.capturePointer?" beeviewjs-popup-capture-pointer":"");this._tip=this._dom.createElement("div",i,this._container),this._dom.createElement("div","beeviewjs-popup-tip-inner",this._tip)}this._container.appendChild(this._content),this._parentContainer.appendChild(this._container),null!=this._options.opacity&&(this._container.style.opacity=this._options.opacity.toString())}var o=null,s=this._alignmentToPopupAligment(this._options.position),u=this._alignmentToPopupAligment(this._options.float);if(null!=this._point)o=this._viewportCoords.basicToCanvasSafe(this._point[0],this._point[1],{offsetHeight:t.height,offsetWidth:t.width},r,e.perspective);else{for(var c=this._container.classList,l=null,h=0,p=["center","top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"];h<p.length;h++){var f=p[h];if(c.contains("beeviewjs-popup-float-"+f)){l=f;break}}o=(n=this._rectToPixel(this._rect,s,l,e,t,r))[0],s=n[1],u||(u=s)}if(null!=o){if(this._container.style.visibility="visible",!u){var d=this._container.offsetWidth,m=this._container.offsetHeight,v=this._pixelToFloats(o,t,d,m);u=0===v.length?"top":v.join("-")}var y=this._normalizeOffset(this._options.offset);o=[o[0]+y[u][0],o[1]+y[u][1]],o=[Math.round(o[0]),Math.round(o[1])];var g={bottom:"translate(-50%,0)","bottom-left":"translate(-100%,0)","bottom-right":"translate(0,0)",center:"translate(-50%,-50%)",left:"translate(-100%,-50%)",right:"translate(0,-50%)",top:"translate(-50%,-100%)","top-left":"translate(-100%,-100%)","top-right":"translate(0,-100%)"},b=this._container.classList;for(var _ in g)g.hasOwnProperty(_)&&b.remove("beeviewjs-popup-float-"+_);b.add("beeviewjs-popup-float-"+u),this._container.style.transform=g[u]+" translate("+o[0]+"px,"+o[1]+"px)"}else this._container.style.visibility="hidden"}},e.prototype._rectToPixel=function(e,t,r,n,i,o){if(!t){for(var a=this._container.offsetWidth,s=this._container.offsetHeight,u={bottom:[0,s/2],"bottom-left":[-a/2,s/2],"bottom-right":[a/2,s/2],left:[-a/2,0],right:[a/2,0],top:[0,-s/2],"top-left":[-a/2,-s/2],"top-right":[a/2,-s/2]},c=[0,null,null],l=0,h=["top","bottom","left","right"];l<h.length;l++){var p=h[l],f=this._pointFromRectPosition(e,p),d=this._viewportCoords.basicToCanvasSafe(f[0],f[1],{offsetHeight:i.height,offsetWidth:i.width},o,n.perspective);if(null!=d){var m=u[p],v=[d[0]+m[0],d[1]+m[1]],y=null!=r&&r===p?1:.7;if(0===this._pixelToFloats(v,i,a/y,s/(2*y)).length&&d[0]>0&&d[0]<i.width&&d[1]>0&&d[1]<i.height)return[d,p];var g=Math.max(v[0]-a/2,0),b=Math.min(v[0]+a/2,i.width),_=Math.max(v[1]-s/2,0),x=Math.min(v[1]+s/2,i.height),w=y*Math.max(0,b-g)*Math.max(0,x-_);w>c[0]&&(c[0]=w,c[1]=d,c[2]=p)}}if(c[0]>0)return[c[1],c[2]]}var S=this._pointFromRectPosition(e,t);return[this._viewportCoords.basicToCanvasSafe(S[0],S[1],{offsetHeight:i.height,offsetWidth:i.width},o,n.perspective),null!=t?t:"top"]},e.prototype._alignmentToPopupAligment=function(e){switch(e){case a.Alignment.Bottom:return"bottom";case a.Alignment.BottomLeft:return"bottom-left";case a.Alignment.BottomRight:return"bottom-right";case a.Alignment.Center:return"center";case a.Alignment.Left:return"left";case a.Alignment.Right:return"right";case a.Alignment.Top:return"top";case a.Alignment.TopLeft:return"top-left";case a.Alignment.TopRight:return"top-right";default:return null}},e.prototype._normalizeOffset=function(e){if(null==e)return this._normalizeOffset(0);if("number"==typeof e){var t=e,r=(t>=0?1:-1)*Math.round(Math.sqrt(.5*Math.pow(t,2)));return{bottom:[0,t],"bottom-left":[-r,r],"bottom-right":[r,r],center:[0,0],left:[-t,0],right:[t,0],top:[0,-t],"top-left":[-r,-r],"top-right":[r,-r]}}return{bottom:e.bottom||[0,0],"bottom-left":e.bottomLeft||[0,0],"bottom-right":e.bottomRight||[0,0],center:e.center||[0,0],left:e.left||[0,0],right:e.right||[0,0],top:e.top||[0,0],"top-left":e.topLeft||[0,0],"top-right":e.topRight||[0,0]}},e.prototype._pixelToFloats=function(e,t,r,n){var i=[];return e[1]<n?i.push("bottom"):e[1]>t.height-n&&i.push("top"),e[0]<r/2?i.push("right"):e[0]>t.width-r/2&&i.push("left"),i},e.prototype._pointFromRectPosition=function(e,t){switch(t){case"bottom":return[(e[0]+e[2])/2,e[3]];case"bottom-left":return[e[0],e[3]];case"bottom-right":return[e[2],e[3]];case"center":return[(e[0]+e[2])/2,(e[1]+e[3])/2];case"left":return[e[0],(e[1]+e[3])/2];case"right":return[e[2],(e[1]+e[3])/2];case"top":return[(e[0]+e[2])/2,e[1]];case"top-left":return[e[0],e[1]];case"top-right":return[e[2],e[1]];default:return[(e[0]+e[2])/2,e[3]]}},e}();r.Popup=s,r.default=s},{"../../../Geo":368,"../../../Utils":374,"../../../Viewer":375,"rxjs/Subject":162}],426:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("rxjs/Observable"),o=e("rxjs/Subject");e("rxjs/add/observable/combineLatest"),e("rxjs/add/observable/of"),e("rxjs/add/operator/bufferCount"),e("rxjs/add/operator/concat"),e("rxjs/add/operator/distinctUntilChanged"),e("rxjs/add/operator/filter"),e("rxjs/add/operator/finally"),e("rxjs/add/operator/first"),e("rxjs/add/operator/map"),e("rxjs/add/operator/publishReplay"),e("rxjs/add/operator/scan"),e("rxjs/add/operator/share"),e("rxjs/add/operator/switchMap"),e("rxjs/add/operator/takeUntil"),e("rxjs/add/operator/withLatestFrom");var a=e("../../Component"),s=e("../../Edge"),u=function(e){function t(t,r,n){var i=e.call(this,t,r,n)||this;return i._nodesAhead=5,i._configurationOperation$=new o.Subject,i._sequenceDOMRenderer=new a.SequenceDOMRenderer(r.element),i._sequenceDOMInteraction=new a.SequenceDOMInteraction,i._containerWidth$=new o.Subject,i._hoveredKeySubject$=new o.Subject,i._hoveredKey$=i._hoveredKeySubject$.share(),i._edgeStatus$=i._navigator.stateService.currentNode$.switchMap(function(e){return e.sequenceEdges$}).publishReplay(1).refCount(),i}return n(t,e),Object.defineProperty(t.prototype,"hoveredKey$",{get:function(){return this._hoveredKey$},enumerable:!0,configurable:!0}),t.prototype.play=function(){this.configure({playing:!0})},t.prototype.stop=function(){this.configure({playing:!1})},t.prototype.setDirection=function(e){this.configure({direction:e})},t.prototype.setHighlightKey=function(e){this.configure({highlightKey:e})},t.prototype.setMaxWidth=function(e){this.configure({maxWidth:e})},t.prototype.setMinWidth=function(e){this.configure({minWidth:e})},t.prototype.setVisible=function(e){this.configure({visible:e})},t.prototype.resize=function(){var e=this;this._configuration$.first().map(function(t){return e._sequenceDOMRenderer.getContainerWidth(e._container.element,t)}).subscribe(function(t){e._containerWidth$.next(t)})},t.prototype._activate=function(){var e=this;this._renderSubscription=i.Observable.combineLatest(this._edgeStatus$,this._configuration$,this._containerWidth$).map(function(t){var r=t[0],n=t[1],i=t[2],o=e._sequenceDOMRenderer.render(r,n,i,e,e._sequenceDOMInteraction,e._navigator);return{name:e._name,vnode:o}}).subscribe(this._container.domRenderer.render$),this._containerWidthSubscription=this._configuration$.distinctUntilChanged(function(e,t){return e[0]===t[0]&&e[1]===t[1]},function(e){return[e.minWidth,e.maxWidth]}).map(function(t){return e._sequenceDOMRenderer.getContainerWidth(e._container.element,t)}).subscribe(this._containerWidth$),this._configurationSubscription=this._configurationOperation$.scan(function(e,t){return t(e)},{playing:!1}).finally(function(){null!=e._playingSubscription&&(e._navigator.stateService.cutNodes(),e._stop())}).subscribe(function(){}),this._configuration$.map(function(t){return function(r){return t.playing!==r.playing&&(e._navigator.stateService.cutNodes(),t.playing?e._play():e._stop()),r.playing=t.playing,r}}).subscribe(this._configurationOperation$),this._stopSubscription=this._configuration$.switchMap(function(t){var r=t.playing?e._edgeStatus$:i.Observable.empty(),n=i.Observable.of(t.direction);return i.Observable.combineLatest(r,n)}).map(function(e){var t=e[0],r=e[1];if(!t.cached)return!0;for(var n=0,i=t.edges;n<i.length;n++)if(i[n].data.direction===r)return!0;return!1}).filter(function(e){return!e}).map(function(e){return{playing:!1}}).subscribe(this._configurationSubject$),this._hoveredKeySubscription=this._sequenceDOMInteraction.mouseEnterDirection$.switchMap(function(t){return e._edgeStatus$.map(function(e){for(var r=0,n=e.edges;r<n.length;r++){var i=n[r];if(i.data.direction===t)return i.to}return null}).takeUntil(e._sequenceDOMInteraction.mouseLeaveDirection$).concat(i.Observable.of(null))}).distinctUntilChanged().subscribe(this._hoveredKeySubject$)},t.prototype._deactivate=function(){this._stopSubscription.unsubscribe(),this._renderSubscription.unsubscribe(),this._configurationSubscription.unsubscribe(),this._containerWidthSubscription.unsubscribe(),this._hoveredKeySubscription.unsubscribe(),this.stop()},t.prototype._getDefaultConfiguration=function(){return{direction:s.EdgeDirection.Next,maxWidth:117,minWidth:70,playing:!1,visible:!0}},t.prototype._play=function(){var e=this;this._playingSubscription=this._navigator.stateService.currentState$.filter(function(t){return t.state.nodesAhead<e._nodesAhead}).map(function(e){return e.state.lastNode}).distinctUntilChanged(void 0,function(e){return e.key}).withLatestFrom(this._configuration$,function(e,t){return[e,t.direction]}).switchMap(function(e){return([s.EdgeDirection.Next,s.EdgeDirection.Prev].indexOf(e[1])>-1?e[0].sequenceEdges$:e[0].spatialEdges$).filter(function(e){return e.cached}).zip(i.Observable.of(e[1]),function(e,t){return[e,t]})}).map(function(e){for(var t=e[1],r=0,n=e[0].edges;r<n.length;r++){var i=n[r];if(i.data.direction===t)return i.to}return null}).filter(function(e){return null!=e}).switchMap(function(t){return e._navigator.graphService.cacheNode$(t)}).subscribe(function(t){e._navigator.stateService.appendNodes([t])},function(t){console.error(t),e.stop()}),this._clearSubscription=this._navigator.stateService.currentNode$.bufferCount(1,7).subscribe(function(t){e._navigator.stateService.clearPriorNodes()}),this.fire(t.playingchanged,!0)},t.prototype._stop=function(){this._playingSubscription.unsubscribe(),this._playingSubscription=null,this._clearSubscription.unsubscribe(),this._clearSubscription=null,this.fire(t.playingchanged,!1)},t.componentName="sequence",t.playingchanged="playingchanged",t}(a.Component);r.SequenceComponent=u,a.ComponentService.register(u),r.default=u},{"../../Component":365,"../../Edge":366,"rxjs/Observable":157,"rxjs/Subject":162,"rxjs/add/observable/combineLatest":166,"rxjs/add/observable/of":173,"rxjs/add/operator/bufferCount":178,"rxjs/add/operator/concat":182,"rxjs/add/operator/distinctUntilChanged":186,"rxjs/add/operator/filter":189,"rxjs/add/operator/finally":190,"rxjs/add/operator/first":191,"rxjs/add/operator/map":193,"rxjs/add/operator/publishReplay":200,"rxjs/add/operator/scan":202,"rxjs/add/operator/share":203,"rxjs/add/operator/switchMap":208,"rxjs/add/operator/takeUntil":210,"rxjs/add/operator/withLatestFrom":213}],427:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/Subject"),i=function(){function e(){this._mouseEnterDirection$=new n.Subject,this._mouseLeaveDirection$=new n.Subject}return Object.defineProperty(e.prototype,"mouseEnterDirection$",{get:function(){return this._mouseEnterDirection$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mouseLeaveDirection$",{get:function(){return this._mouseLeaveDirection$},enumerable:!0,configurable:!0}),e}();r.SequenceDOMInteraction=i,r.default=i},{"rxjs/Subject":162}],428:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("virtual-dom"),i=e("../../Edge"),o=function(){function e(e){this._minThresholdWidth=320,this._maxThresholdWidth=1480,this._minThresholdHeight=240,this._maxThresholdHeight=820}return e.prototype.render=function(e,t,r,o,a,s){if(!1===t.visible)return n.h("div.SequenceContainer",{},[]);for(var u=null,c=null,l=0,h=e.edges;l<h.length;l++){var p=h[l];p.data.direction===i.EdgeDirection.Next&&(u=p.to),p.data.direction===i.EdgeDirection.Prev&&(c=p.to)}var f=this._createPlayingButton(u,c,t,o),d=this._createSequenceArrows(u,c,t,a,s),m={oncontextmenu:function(e){e.preventDefault()},style:{height:.27*r+"px",width:r+"px"}};return n.h("div.SequenceContainer",m,d.concat([f]))},e.prototype.getContainerWidth=function(e,t){var r=e.offsetWidth,n=e.offsetHeight,i=t.minWidth,o=t.maxWidth;o<i&&(o=i);var a=(r-this._minThresholdWidth)/(this._maxThresholdWidth-this._minThresholdWidth),s=(n-this._minThresholdHeight)/(this._maxThresholdHeight-this._minThresholdHeight);return i+Math.max(0,Math.min(1,Math.min(a,s)))*(o-i)},e.prototype._createPlayingButton=function(e,t,r,o){var a=r.direction===i.EdgeDirection.Next&&null!=e||r.direction===i.EdgeDirection.Prev&&null!=t,s={onclick:r.playing?function(e){o.stop()}:a?function(e){o.play()}:null,style:{}},u=r.playing?"Stop":a?"Play":"PlayDisabled",c=n.h("div.SequenceComponentIcon",{className:u},[]),l=a?"SequencePlay":"SequencePlayDisabled";return n.h("div."+l,s,[c])},e.prototype._createSequenceArrows=function(e,t,r,o,a){var s={onclick:null!=e?function(e){a.moveDir$(i.EdgeDirection.Next).subscribe(function(e){},function(e){console.error(e)})}:null,onmouseenter:function(e){o.mouseEnterDirection$.next(i.EdgeDirection.Next)},onmouseleave:function(e){o.mouseLeaveDirection$.next(i.EdgeDirection.Next)},style:{}},u={onclick:null!=t?function(e){a.moveDir$(i.EdgeDirection.Prev).subscribe(function(e){},function(e){console.error(e)})}:null,onmouseenter:function(e){o.mouseEnterDirection$.next(i.EdgeDirection.Prev)},onmouseleave:function(e){o.mouseLeaveDirection$.next(i.EdgeDirection.Prev)},style:{}},c=this._getStepClassName(i.EdgeDirection.Next,e,r.highlightKey),l=this._getStepClassName(i.EdgeDirection.Prev,t,r.highlightKey),h=n.h("div.SequenceComponentIcon",[]),p=n.h("div.SequenceComponentIcon",[]);return[n.h("div."+c,s,[h]),n.h("div."+l,u,[p])]},e.prototype._getStepClassName=function(e,t,r){var n=e===i.EdgeDirection.Next?"SequenceStepNext":"SequenceStepPrev";return null==t?n+="Disabled":r===t&&(n+="Highlight"),n},e}();r.SequenceDOMRenderer=o,r.default=o},{"../../Edge":366,"virtual-dom":317}],429:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./error/GeometryTagError");r.GeometryTagError=n.GeometryTagError;var i=e("./geometry/PointGeometry");r.PointGeometry=i.PointGeometry;var o=e("./geometry/RectGeometry");r.RectGeometry=o.RectGeometry;var a=e("./geometry/PolygonGeometry");r.PolygonGeometry=a.PolygonGeometry;var s=e("./tag/OutlineTag");r.OutlineTag=s.OutlineTag;var u=e("./tag/SpotTag");r.SpotTag=u.SpotTag;var c=e("./TagComponent");r.TagComponent=c.TagComponent;var l=e("./TagMode");r.TagMode=l.TagMode},{"./TagComponent":430,"./TagMode":433,"./error/GeometryTagError":437,"./geometry/PointGeometry":439,"./geometry/PolygonGeometry":440,"./geometry/RectGeometry":441,"./tag/OutlineTag":453,"./tag/SpotTag":456}],430:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("when"),o=e("rxjs/Observable");e("rxjs/add/observable/combineLatest"),e("rxjs/add/observable/empty"),e("rxjs/add/observable/from"),e("rxjs/add/observable/merge"),e("rxjs/add/observable/of"),e("rxjs/add/operator/combineLatest"),e("rxjs/add/operator/concat"),e("rxjs/add/operator/distinctUntilChanged"),e("rxjs/add/operator/do"),e("rxjs/add/operator/filter"),e("rxjs/add/operator/map"),e("rxjs/add/operator/merge"),e("rxjs/add/operator/mergeMap"),e("rxjs/add/operator/publishReplay"),e("rxjs/add/operator/scan"),e("rxjs/add/operator/share"),e("rxjs/add/operator/skip"),e("rxjs/add/operator/skipUntil"),e("rxjs/add/operator/startWith"),e("rxjs/add/operator/switchMap"),e("rxjs/add/operator/take"),e("rxjs/add/operator/takeUntil"),e("rxjs/add/operator/withLatestFrom");var a=e("../../Component"),s=e("../../Geo"),u=e("../../Render"),c=function(e){function t(r,n,i){var u=e.call(this,r,n,i)||this;return u._tagDomRenderer=new a.TagDOMRenderer,u._tagScene=new a.TagScene,u._tagSet=new a.TagSet,u._tagCreator=new a.TagCreator(u,i),u._viewportCoords=new s.ViewportCoords,u._createHandlers={CreatePoint:new a.CreatePointHandler(u,n,i,u._viewportCoords,u._tagCreator),CreatePolygon:new a.CreatePolygonHandler(u,n,i,u._viewportCoords,u._tagCreator),CreateRect:new a.CreateRectHandler(u,n,i,u._viewportCoords,u._tagCreator),CreateRectDrag:new a.CreateRectDragHandler(u,n,i,u._viewportCoords,u._tagCreator),Default:void 0},u._editVertexHandler=new a.EditVertexHandler(u,n,i,u._viewportCoords,u._tagSet),u._renderTags$=u._tagSet.changed$.map(function(e){var t=e.getAll();return t.sort(function(e,t){var r=e.tag.id,n=t.tag.id;return r<n?-1:r>n?1:0}),t}).share(),u._tagChanged$=u._renderTags$.switchMap(function(e){return o.Observable.from(e).mergeMap(function(e){return o.Observable.merge(e.tag.changed$,e.tag.geometryChanged$)})}).share(),u._renderTagGLChanged$=u._renderTags$.switchMap(function(e){return o.Observable.from(e).mergeMap(function(e){return e.glObjectsChanged$})}).share(),u._createGeometryChanged$=u._tagCreator.tag$.switchMap(function(e){return null!=e?e.geometryChanged$:o.Observable.empty()}).share(),u._createGLObjectsChanged$=u._tagCreator.tag$.switchMap(function(e){return null!=e?e.glObjectsChanged$:o.Observable.empty()}).share(),u._creatingConfiguration$=u._configuration$.distinctUntilChanged(function(e,t){return e.mode===t.mode},function(e){return{createColor:e.createColor,mode:e.mode}}).publishReplay(1).refCount(),u._creatingConfiguration$.subscribe(function(e){u.fire(t.modechanged,e.mode)}),u}return n(t,e),t.prototype.add=function(e){var t=this;this._activated?this._navigator.stateService.currentTransform$.first().subscribe(function(r){t._tagSet.add(e,r);var n=e.map(function(e){return t._tagSet.get(e.id)});t._tagScene.add(n)}):this._tagSet.addDeactivated(e)},t.prototype.changeMode=function(e){this.configure({mode:e})},t.prototype.get=function(e){if(this._activated){var t=this._tagSet.get(e);return void 0!==t?t.tag:void 0}return this._tagSet.getDeactivated(e)},t.prototype.getAll=function(){return this.activated?this._tagSet.getAll().map(function(e){return e.tag}):this._tagSet.getAllDeactivated()},t.prototype.getTagIdsAt=function(e){var t=this;return i.promise(function(r,n){t._container.renderService.renderCamera$.first().map(function(r){var n=t._viewportCoords.canvasToViewport(e[0],e[1],t._container.element);return t._tagScene.intersectObjects(n,r.perspective)}).subscribe(function(e){r(e)},function(e){n(e)})})},t.prototype.has=function(e){return this._activated?this._tagSet.has(e):this._tagSet.hasDeactivated(e)},t.prototype.remove=function(e){this._activated?(this._tagSet.remove(e),this._tagScene.remove(e)):this._tagSet.removeDeactivated(e)},t.prototype.removeAll=function(){this._activated?(this._tagSet.removeAll(),this._tagScene.removeAll()):this._tagSet.removeAllDeactivated()},t.prototype._activate=function(){var e=this;this._editVertexHandler.enable();var r=o.Observable.from(Object.keys(this._createHandlers)).map(function(t){return e._createHandlers[t]}).filter(function(e){return!!e}).mergeMap(function(e){return e.geometryCreated$}).share();this._fireGeometryCreatedSubscription=r.subscribe(function(r){e.fire(t.geometrycreated,r)}),this._fireCreateGeometryEventSubscription=this._tagCreator.tag$.skipWhile(function(e){return null==e}).distinctUntilChanged().subscribe(function(r){var n=null!=r?t.creategeometrystart:t.creategeometryend;e.fire(n,e)}),this._handlerStopCreateSubscription=r.subscribe(function(){e.changeMode(a.TagMode.Default)}),this._handlerEnablerSubscription=this._creatingConfiguration$.subscribe(function(t){e._disableCreateHandlers();var r=a.TagMode[t.mode],n=e._createHandlers[r];n&&n.enable()}),this._fireTagsChangedSubscription=this._renderTags$.subscribe(function(r){e.fire(t.tagschanged,e)}),this._stopCreateSubscription=this._tagCreator.tag$.switchMap(function(e){return null!=e?e.aborted$.map(function(e){return null}):o.Observable.empty()}).subscribe(function(){e.changeMode(a.TagMode.Default)}),this._setGLCreateTagSubscription=this._tagCreator.tag$.subscribe(function(t){e._tagScene.hasCreateTag()&&e._tagScene.removeCreateTag(),null!=t&&e._tagScene.addCreateTag(t)}),this._createGLObjectsChangedSubscription=this._createGLObjectsChanged$.subscribe(function(t){e._tagScene.updateCreateTagObjects(t)}),this._updateGLObjectsSubscription=this._renderTagGLChanged$.subscribe(function(t){e._tagScene.updateObjects(t)}),this._updateTagSceneSubscription=this._tagChanged$.subscribe(function(t){e._tagScene.update()}),this._domSubscription=this._renderTags$.startWith([]).do(function(t){e._container.domRenderer.render$.next({name:e._name,vnode:e._tagDomRenderer.clear()})}).combineLatest(this._container.renderService.renderCamera$,this._container.spriteService.spriteAtlas$,this._container.renderService.size$,this._tagChanged$.startWith(null),this._tagCreator.tag$.merge(this._createGeometryChanged$).startWith(null),function(e,t,r,n,i,o){return[t,r,n,e,i,o]}).map(function(t){return{name:e._name,vnode:e._tagDomRenderer.render(t[3],t[5],t[1],t[0].perspective,t[2])}}).subscribe(this._container.domRenderer.render$),this._glSubscription=this._navigator.stateService.currentState$.map(function(t){var r=e._tagScene;return{name:e._name,render:{frameId:t.id,needsRender:r.needsRender,render:r.render.bind(r),stage:u.GLRenderStage.Foreground}}}).subscribe(this._container.glRenderer.render$),this._navigator.stateService.currentTransform$.first().subscribe(function(t){e._tagSet.activate(t),e._tagScene.add(e._tagSet.getAll())})},t.prototype._deactivate=function(){this._editVertexHandler.disable(),this._disableCreateHandlers(),this._tagScene.clear(),this._tagSet.deactivate(),this._tagCreator.delete$.next(null),this._updateGLObjectsSubscription.unsubscribe(),this._updateTagSceneSubscription.unsubscribe(),this._stopCreateSubscription.unsubscribe(),this._setGLCreateTagSubscription.unsubscribe(),this._createGLObjectsChangedSubscription.unsubscribe(),this._domSubscription.unsubscribe(),this._glSubscription.unsubscribe(),this._fireCreateGeometryEventSubscription.unsubscribe(),this._fireGeometryCreatedSubscription.unsubscribe(),this._fireTagsChangedSubscription.unsubscribe(),this._handlerStopCreateSubscription.unsubscribe(),this._handlerEnablerSubscription.unsubscribe(),this._container.element.classList.remove("component-tag-create")},t.prototype._getDefaultConfiguration=function(){return{createColor:16777215,mode:a.TagMode.Default}},t.prototype._disableCreateHandlers=function(){var e=this._createHandlers;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];r&&r.disable()}},t.componentName="tag",t.creategeometryend="creategeometryend",t.creategeometrystart="creategeometrystart",t.modechanged="modechanged",t.geometrycreated="geometrycreated",t.tagschanged="tagschanged",t}(a.Component);r.TagComponent=c,a.ComponentService.register(c),r.default=c},{"../../Component":365,"../../Geo":368,"../../Render":370,"rxjs/Observable":157,"rxjs/add/observable/combineLatest":166,"rxjs/add/observable/empty":168,"rxjs/add/observable/from":169,"rxjs/add/observable/merge":172,"rxjs/add/observable/of":173,"rxjs/add/operator/combineLatest":181,"rxjs/add/operator/concat":182,"rxjs/add/operator/distinctUntilChanged":186,"rxjs/add/operator/do":187,"rxjs/add/operator/filter":189,"rxjs/add/operator/map":193,"rxjs/add/operator/merge":194,"rxjs/add/operator/mergeMap":196,"rxjs/add/operator/publishReplay":200,"rxjs/add/operator/scan":202,"rxjs/add/operator/share":203,"rxjs/add/operator/skip":204,"rxjs/add/operator/skipUntil":205,"rxjs/add/operator/startWith":207,"rxjs/add/operator/switchMap":208,"rxjs/add/operator/take":209,"rxjs/add/operator/takeUntil":210,"rxjs/add/operator/withLatestFrom":213,when:358}],431:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/Subject");e("rxjs/add/operator/map"),e("rxjs/add/operator/scan"),e("rxjs/add/operator/share"),e("rxjs/add/operator/withLatestFrom");var i=e("../../Component"),o=function(){function e(e,t){this._component=e,this._navigator=t,this._tagOperation$=new n.Subject,this._createPolygon$=new n.Subject,this._createRect$=new n.Subject,this._delete$=new n.Subject,this._tag$=this._tagOperation$.scan(function(e,t){return t(e)},null).share(),this._createRect$.withLatestFrom(this._component.configuration$,this._navigator.stateService.currentTransform$).map(function(e){var t=e[0],r=e[1],n=e[2];return function(e){var o=new i.RectGeometry([t[0],t[1],t[0],t[1]]);return new i.OutlineCreateTag(o,{color:r.createColor},n)}}).subscribe(this._tagOperation$),this._createPolygon$.withLatestFrom(this._component.configuration$,this._navigator.stateService.currentTransform$).map(function(e){var t=e[0],r=e[1],n=e[2];return function(e){var o=new i.PolygonGeometry([[t[0],t[1]],[t[0],t[1]],[t[0],t[1]]]);return new i.OutlineCreateTag(o,{color:r.createColor},n)}}).subscribe(this._tagOperation$),this._delete$.map(function(){return function(e){return null}}).subscribe(this._tagOperation$)}return Object.defineProperty(e.prototype,"createRect$",{get:function(){return this._createRect$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"createPolygon$",{get:function(){return this._createPolygon$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delete$",{get:function(){return this._delete$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tag$",{get:function(){return this._tag$},enumerable:!0,configurable:!0}),e}();r.TagCreator=o,r.default=o},{"../../Component":365,"rxjs/Subject":162,"rxjs/add/operator/map":193,"rxjs/add/operator/scan":202,"rxjs/add/operator/share":203,"rxjs/add/operator/withLatestFrom":213}],432:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("virtual-dom"),i=function(){function e(){}return e.prototype.render=function(e,t,r,i,o){for(var a=[],s=0,u=e;s<u.length;s++){var c=u[s];a=a.concat(c.getDOMObjects(r,i,o))}return null!=t&&(a=a.concat(t.getDOMObjects(i,o))),n.h("div.TagContainer",{},a)},e.prototype.clear=function(){return n.h("div",{},[])},e}();r.TagDOMRenderer=i},{"virtual-dom":317}],433:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n;!function(e){e[e.Default=0]="Default",e[e.CreatePoint=1]="CreatePoint",e[e.CreatePolygon=2]="CreatePolygon",e[e.CreateRect=3]="CreateRect",e[e.CreateRectDrag=4]="CreateRectDrag"}(n=r.TagMode||(r.TagMode={})),r.default=n},{}],434:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n;!function(e){e[e.None=0]="None",e[e.Centroid=1]="Centroid",e[e.Vertex=2]="Vertex"}(n=r.TagOperation||(r.TagOperation={})),r.default=n},{}],435:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("three"),i=function(){function e(e,t){this._createTag=null,this._needsRender=!1,this._raycaster=t||new n.Raycaster,this._scene=e||new n.Scene,this._objectTags={},this._retrievableObjects=[],this._tags={}}return Object.defineProperty(e.prototype,"needsRender",{get:function(){return this._needsRender},enumerable:!0,configurable:!0}),e.prototype.add=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];n.tag.id in this._tags&&this._remove(n.tag.id),this._add(n)}this._needsRender=!0},e.prototype.addCreateTag=function(e){for(var t=0,r=e.glObjects;t<r.length;t++){var n=r[t];this._scene.add(n)}this._createTag={tag:e,objects:e.glObjects},this._needsRender=!0},e.prototype.clear=function(){for(var e=0,t=Object.keys(this._tags);e<t.length;e++){var r=t[e];this._remove(r)}this._needsRender=!1},e.prototype.get=function(e){return this.has(e)?this._tags[e].tag:void 0},e.prototype.has=function(e){return e in this._tags},e.prototype.hasCreateTag=function(){return null!=this._createTag},e.prototype.intersectObjects=function(e,t){var r=e[0],i=e[1];this._raycaster.setFromCamera(new n.Vector2(r,i),t);for(var o=[],a=0,s=this._raycaster.intersectObjects(this._retrievableObjects);a<s.length;a++){var u=s[a];u.object.uuid in this._objectTags&&o.push(this._objectTags[u.object.uuid])}return o},e.prototype.remove=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];this._remove(n)}this._needsRender=!0},e.prototype.removeAll=function(){for(var e=0,t=Object.keys(this._tags);e<t.length;e++){var r=t[e];this._remove(r)}this._needsRender=!0},e.prototype.removeCreateTag=function(){if(null!=this._createTag){for(var e=0,t=this._createTag.objects;e<t.length;e++){var r=t[e];this._scene.remove(r)}this._createTag.tag.dispose(),this._createTag=null,this._needsRender=!0}},e.prototype.render=function(e,t){t.render(this._scene,e),this._needsRender=!1},e.prototype.update=function(){this._needsRender=!0},e.prototype.updateCreateTagObjects=function(e){if(this._createTag.tag!==e)throw new Error("Create tags do not have the same reference.");for(var t=0,r=this._createTag.objects;t<r.length;t++){o=r[t];this._scene.remove(o)}for(var n=0,i=e.glObjects;n<i.length;n++){var o=i[n];this._scene.add(o)}this._createTag.objects=e.glObjects,this._needsRender=!0},e.prototype.updateObjects=function(e){var t=e.tag.id;if(this._tags[t].tag!==e)throw new Error("Tags do not have the same reference.");var r=this._tags[t];this._removeObjects(r),delete this._tags[t],this._add(e),this._needsRender=!0},e.prototype._add=function(e){var t=e.tag.id,r={tag:e,objects:[],retrievableObjects:[]};this._tags[t]=r;for(var n=0,i=e.getGLObjects();n<i.length;n++){var o=i[n];r.objects.push(o),this._scene.add(o)}for(var a=0,s=e.getRetrievableObjects();a<s.length;a++){var u=s[a];r.retrievableObjects.push(u),this._retrievableObjects.push(u),this._objectTags[u.uuid]=e.tag.id}},e.prototype._remove=function(e){var t=this._tags[e];this._removeObjects(t),t.tag.dispose(),delete this._tags[e]},e.prototype._removeObjects=function(e){for(var t=0,r=e.objects;t<r.length;t++){var n=r[t];this._scene.remove(n)}for(var i=0,o=e.retrievableObjects;i<o.length;i++){var a=o[i],s=this._retrievableObjects.indexOf(a);-1!==s&&this._retrievableObjects.splice(s,1)}},e}();r.TagScene=i,r.default=i},{three:311}],436:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/Subject");e("rxjs/add/operator/map"),e("rxjs/add/operator/scan"),e("rxjs/add/operator/share");var i=e("../../Component"),o=function(){function e(){this._active=!1,this._hash={},this._hashDeactivated={},this._notifyChanged$=new n.Subject}return Object.defineProperty(e.prototype,"active",{get:function(){return this._active},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"changed$",{get:function(){return this._notifyChanged$},enumerable:!0,configurable:!0}),e.prototype.activate=function(e){if(!this._active){for(var t in this._hashDeactivated)if(this._hashDeactivated.hasOwnProperty(t)){var r=this._hashDeactivated[t];this._add(r,e)}this._hashDeactivated={},this._active=!0,this._notifyChanged$.next(this)}},e.prototype.deactivate=function(){if(this._active){for(var e in this._hash)this._hash.hasOwnProperty(e)&&(this._hashDeactivated[e]=this._hash[e].tag);this._hash={},this._active=!1}},e.prototype.add=function(e,t){this._assertActivationState(!0);for(var r=0,n=e;r<n.length;r++){var i=n[r];this._add(i,t)}this._notifyChanged$.next(this)},e.prototype.addDeactivated=function(e){this._assertActivationState(!1);for(var t=0,r=e;t<r.length;t++){var n=r[t];if(!(n instanceof i.OutlineTag||n instanceof i.SpotTag))throw new Error("Tag type not supported");this._hashDeactivated[n.id]=n}},e.prototype.get=function(e){return this.has(e)?this._hash[e]:void 0},e.prototype.getAll=function(){var e=this._hash;return Object.keys(e).map(function(t){return e[t]})},e.prototype.getAllDeactivated=function(){var e=this._hashDeactivated;return Object.keys(e).map(function(t){return e[t]})},e.prototype.getDeactivated=function(e){return this.hasDeactivated(e)?this._hashDeactivated[e]:void 0},e.prototype.has=function(e){return e in this._hash},e.prototype.hasDeactivated=function(e){return e in this._hashDeactivated},e.prototype.remove=function(e){this._assertActivationState(!0);for(var t=this._hash,r=0,n=e;r<n.length;r++){var i=n[r];i in t&&delete t[i]}this._notifyChanged$.next(this)},e.prototype.removeAll=function(){this._assertActivationState(!0),this._hash={},this._notifyChanged$.next(this)},e.prototype.removeAllDeactivated=function(){this._assertActivationState(!1),this._hashDeactivated={}},e.prototype.removeDeactivated=function(e){this._assertActivationState(!1);for(var t=this._hashDeactivated,r=0,n=e;r<n.length;r++){var i=n[r];i in t&&delete t[i]}},e.prototype._add=function(e,t){if(e instanceof i.OutlineTag)this._hash[e.id]=new i.OutlineRenderTag(e,t);else{if(!(e instanceof i.SpotTag))throw new Error("Tag type not supported");this._hash[e.id]=new i.SpotRenderTag(e,t)}},e.prototype._assertActivationState=function(e){if(e!==this._active)throw new Error("Tag set not in correct state for operation.")},e}();r.TagSet=o,r.default=o},{"../../Component":365,"rxjs/Subject":162,"rxjs/add/operator/map":193,"rxjs/add/operator/scan":202,"rxjs/add/operator/share":203}],437:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("../../../Error"),o=function(e){function t(t){var r=e.call(this,null!=t?t:"The provided geometry value is incorrect")||this;return r.name="GeometryTagError",r}return n(t,e),t}(i.BeeviewError);r.GeometryTagError=o,r.default=i.BeeviewError},{"../../../Error":367}],438:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/Subject"),i=function(){function e(){this._notifyChanged$=new n.Subject}return Object.defineProperty(e.prototype,"changed$",{get:function(){return this._notifyChanged$},enumerable:!0,configurable:!0}),e}();r.Geometry=i,r.default=i},{"rxjs/Subject":162}],439:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("../../../Component"),o=function(e){function t(t){var r=e.call(this)||this,n=t[0],o=t[1];if(n<0||n>1||o<0||o>1)throw new i.GeometryTagError("Basic coordinates must be on the interval [0, 1].");return r._point=t.slice(),r}return n(t,e),Object.defineProperty(t.prototype,"point",{get:function(){return this._point},enumerable:!0,configurable:!0}),t.prototype.getCentroid2d=function(){return this._point.slice()},t.prototype.getCentroid3d=function(e){return e.unprojectBasic(this._point,200)},t.prototype.setCentroid2d=function(e,t){var r=[Math.max(0,Math.min(1,e[0])),Math.max(0,Math.min(1,e[1]))];this._point[0]=r[0],this._point[1]=r[1],this._notifyChanged$.next(this)},t}(i.Geometry);r.PointGeometry=o},{"../../../Component":365}],440:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("../../../Component"),o=function(e){function t(t,r){var n=e.call(this)||this,o=t.length;if(o<3)throw new i.GeometryTagError("A polygon must have three or more positions.");if(t[0][0]!==t[o-1][0]||t[0][1]!==t[o-1][1])throw new i.GeometryTagError("First and last positions must be equivalent.");n._polygon=[];for(var a=0,s=t;a<s.length;a++){if((f=s[a])[0]<0||f[0]>1||f[1]<0||f[1]>1)throw new i.GeometryTagError("Basic coordinates of polygon must be on the interval [0, 1].");n._polygon.push(f.slice())}if(n._holes=[],null==r)return n;for(var u=0;u<r.length;u++){var c=r[u],l=c.length;if(l<3)throw new i.GeometryTagError("A polygon hole must have three or more positions.");if(c[0][0]!==c[l-1][0]||c[0][1]!==c[l-1][1])throw new i.GeometryTagError("First and last positions of hole must be equivalent.");n._holes.push([]);for(var h=0,p=c;h<p.length;h++){var f=p[h];if(f[0]<0||f[0]>1||f[1]<0||f[1]>1)throw new i.GeometryTagError("Basic coordinates of hole must be on the interval [0, 1].");n._holes[u].push(f.slice())}}return n}return n(t,e),Object.defineProperty(t.prototype,"polygon",{get:function(){return this._polygon},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"holes",{get:function(){return this._holes},enumerable:!0,configurable:!0}),t.prototype.addVertex2d=function(e){var t=[Math.max(0,Math.min(1,e[0])),Math.max(0,Math.min(1,e[1]))];this._polygon.splice(this._polygon.length-1,0,t),this._notifyChanged$.next(this)},t.prototype.getVertex2d=function(e){return this._polygon[e].slice()},t.prototype.removeVertex2d=function(e){if(e<0||e>=this._polygon.length||this._polygon.length<4)throw new i.GeometryTagError("Index for removed vertex must be valid.");if(e>0&&e<this._polygon.length-1)this._polygon.splice(e,1);else{this._polygon.splice(0,1),this._polygon.pop();var t=this._polygon[0].slice();this._polygon.push(t)}this._notifyChanged$.next(this)},t.prototype.setVertex2d=function(e,t,r){var n=[Math.max(0,Math.min(1,t[0])),Math.max(0,Math.min(1,t[1]))];0===e||e===this._polygon.length-1?(this._polygon[0]=n.slice(),this._polygon[this._polygon.length-1]=n.slice()):this._polygon[e]=n.slice(),this._notifyChanged$.next(this)},t.prototype.setCentroid2d=function(e,t){for(var r=this._polygon.map(function(e){return e[0]}),n=this._polygon.map(function(e){return e[1]}),i=Math.min.apply(Math,r),o=Math.max.apply(Math,r),a=Math.min.apply(Math,n),s=Math.max.apply(Math,n),u=this.getCentroid2d(),c=-i,l=1-o,h=-a,p=1-s,f=Math.max(c,Math.min(l,e[0]-u[0])),d=Math.max(h,Math.min(p,e[1]-u[1])),m=0,v=this._polygon;m<v.length;m++){var y=v[m];y[0]+=f,y[1]+=d}this._notifyChanged$.next(this)},t.prototype.getPoints3d=function(e){return this.getVertices3d(e)},t.prototype.getVertex3d=function(e,t){return t.unprojectBasic(this._polygon[e],200)},t.prototype.getVertices2d=function(){return this._polygon.slice()},t.prototype.getVertices3d=function(e){return this._polygon.map(function(t){return e.unprojectBasic(t,200)})},t.prototype.getHoleVertices3d=function(e){for(var t=[],r=0,n=this._holes;r<n.length;r++){var i=n[r].map(function(t){return e.unprojectBasic(t,200)});t.push(i)}return t},t.prototype.getCentroid2d=function(){for(var e=this._polygon,t=0,r=0,n=0,i=0;i<e.length-1;i++){var o=e[i][0],a=e[i][1],s=e[i+1][0],u=e[i+1][1],c=o*u-s*a;t+=c,r+=(o+s)*c,n+=(a+u)*c}return t/=2,r/=6*t,n/=6*t,[r,n]},t.prototype.getCentroid3d=function(e){var t=this.getCentroid2d();return e.unprojectBasic(t,200)},t.prototype.getTriangles3d=function(e){return this._triangulate(this._polygon,this.getPoints3d(e),this._holes,this.getHoleVertices3d(e))},t.prototype.getPoleOfAccessibility2d=function(){return this._getPoleOfInaccessibility2d(this._polygon.slice())},t.prototype.getPoleOfAccessibility3d=function(e){var t=this._getPoleOfInaccessibility2d(this._polygon.slice());return e.unprojectBasic(t,200)},t}(i.VertexGeometry);r.PolygonGeometry=o,r.default=o},{"../../../Component":365}],441:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("../../../Component"),o=function(e){function t(t){var r=e.call(this)||this;if(t[1]>t[3])throw new i.GeometryTagError("Basic Y coordinates values can not be inverted.");for(var n=0,o=t;n<o.length;n++){var a=o[n];if(a<0||a>1)throw new i.GeometryTagError("Basic coordinates must be on the interval [0, 1].")}return r._anchorIndex=void 0,r._rect=t.slice(0,4),r._inverted=r._rect[0]>r._rect[2],r}return n(t,e),Object.defineProperty(t.prototype,"anchorIndex",{get:function(){return this._anchorIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inverted",{get:function(){return this._inverted},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rect",{get:function(){return this._rect},enumerable:!0,configurable:!0}),t.prototype.initializeAnchorIndexing=function(e){if(void 0!==this._anchorIndex)throw new Error("Anchor indexing is already initialized.");if(e<0||e>3)throw new Error("Invalid anchor index: "+e+".");this._anchorIndex=void 0===e?0:e},t.prototype.terminateAnchorIndexing=function(){this._anchorIndex=void 0},t.prototype.setOppositeVertex2d=function(e,t){if(void 0===this._anchorIndex)throw new Error("Anchor indexing needs to be initialized.");var r=[Math.max(0,Math.min(1,e[0])),Math.max(0,Math.min(1,e[1]))],n=this._rect.slice(),i=0===this._anchorIndex?[n[0],n[3]]:1===this._anchorIndex?[n[0],n[1]]:2===this._anchorIndex?[n[2],n[1]]:[n[2],n[3]];if(t.fullPano){var o=this._anchorIndex<2?r[0]-n[2]:r[0]-n[0];!this._inverted&&this._anchorIndex<2&&r[0]<.25&&n[2]>.75&&o<-.5?(this._inverted=!0,this._anchorIndex=i[1]>r[1]?0:1):!this._inverted&&this._anchorIndex>=2&&r[0]<.25&&n[2]>.75&&o<-.5?(this._inverted=!0,this._anchorIndex=i[1]>r[1]?0:1):this._inverted&&this._anchorIndex>=2&&r[0]<.25&&n[0]>.75&&o<-.5?(this._inverted=!1,this._anchorIndex=i[0]>r[0]?i[1]>r[1]?3:2:i[1]>r[1]?0:1):!this._inverted&&this._anchorIndex>=2&&r[0]>.75&&n[0]<.25&&o>.5?(this._inverted=!0,this._anchorIndex=i[1]>r[1]?3:2):!this._inverted&&this._anchorIndex<2&&r[0]>.75&&n[0]<.25&&o>.5?(this._inverted=!0,this._anchorIndex=i[1]>r[1]?3:2):this._inverted&&this._anchorIndex<2&&r[0]>.75&&n[2]<.25&&o>.5?(this._inverted=!1,this._anchorIndex=i[0]>r[0]?i[1]>r[1]?3:2:i[1]>r[1]?0:1):this._inverted&&this._anchorIndex<2&&r[0]>n[0]?(this._inverted=!1,this._anchorIndex=i[1]>r[1]?0:1):this._inverted&&this._anchorIndex>=2&&r[0]<n[2]?(this._inverted=!1,this._anchorIndex=i[1]>r[1]?3:2):this._inverted?this._anchorIndex<2?this._anchorIndex=i[1]>r[1]?0:1:this._anchorIndex=i[1]>r[1]?3:2:this._anchorIndex=i[0]<=r[0]&&i[1]>r[1]?0:i[0]<=r[0]&&i[1]<=r[1]?1:i[0]>r[0]&&i[1]<=r[1]?2:3;a=[];0===this._anchorIndex?(a[0]=i[0],a[1]=r[1],a[2]=r[0],a[3]=i[1]):1===this._anchorIndex?(a[0]=i[0],a[1]=i[1],a[2]=r[0],a[3]=r[1]):2===this._anchorIndex?(a[0]=r[0],a[1]=i[1],a[2]=i[0],a[3]=r[1]):(a[0]=r[0],a[1]=r[1],a[2]=i[0],a[3]=i[1]),(!this._inverted&&a[0]>a[2]||this._inverted&&a[0]<a[2])&&(a[0]=n[0],a[2]=n[2]),a[1]>a[3]&&(a[1]=n[1],a[3]=n[3]),this._rect[0]=a[0],this._rect[1]=a[1],this._rect[2]=a[2],this._rect[3]=a[3]}else{this._anchorIndex=i[0]<=r[0]&&i[1]>r[1]?0:i[0]<=r[0]&&i[1]<=r[1]?1:i[0]>r[0]&&i[1]<=r[1]?2:3;var a=[];0===this._anchorIndex?(a[0]=i[0],a[1]=r[1],a[2]=r[0],a[3]=i[1]):1===this._anchorIndex?(a[0]=i[0],a[1]=i[1],a[2]=r[0],a[3]=r[1]):2===this._anchorIndex?(a[0]=r[0],a[1]=i[1],a[2]=i[0],a[3]=r[1]):(a[0]=r[0],a[1]=r[1],a[2]=i[0],a[3]=i[1]),a[0]>a[2]&&(a[0]=n[0],a[2]=n[2]),a[1]>a[3]&&(a[1]=n[1],a[3]=n[3]),this._rect[0]=a[0],this._rect[1]=a[1],this._rect[2]=a[2],this._rect[3]=a[3]}this._notifyChanged$.next(this)},t.prototype.setVertex2d=function(e,t,r){var n=this._rect.slice(),i=[Math.max(0,Math.min(1,t[0])),Math.max(0,Math.min(1,t[1]))],o=[];if(0===e?(o[0]=i[0],o[1]=n[1],o[2]=n[2],o[3]=i[1]):1===e?(o[0]=i[0],o[1]=i[1],o[2]=n[2],o[3]=n[3]):2===e?(o[0]=n[0],o[1]=i[1],o[2]=i[0],o[3]=n[3]):3===e&&(o[0]=n[0],o[1]=n[1],o[2]=i[0],o[3]=i[1]),r.fullPano){var a=e<2&&i[0]>.75&&n[0]<.25||e>=2&&this._inverted&&i[0]>.75&&n[2]<.25,s=e<2&&this._inverted&&i[0]<.25&&n[0]>.75||e>=2&&i[0]<.25&&n[2]>.75;a||s?this._inverted=!this._inverted:(o[0]-n[0]<-.25&&(o[0]=n[0]),o[2]-n[2]>.25&&(o[2]=n[2])),(!this._inverted&&o[0]>o[2]||this._inverted&&o[0]<o[2])&&(o[0]=n[0],o[2]=n[2])}else o[0]>o[2]&&(o[0]=n[0],o[2]=n[2]);o[1]>o[3]&&(o[1]=n[1],o[3]=n[3]),this._rect[0]=o[0],this._rect[1]=o[1],this._rect[2]=o[2],this._rect[3]=o[3],this._notifyChanged$.next(this)},t.prototype.setCentroid2d=function(e,t){var r=this._rect.slice(),n=r[0],i=this._inverted?r[2]+1:r[2],o=r[1],a=r[3],s=n+(i-n)/2,u=o+(a-o)/2,c=0;if(null!=t.gpano&&t.gpano.CroppedAreaImageWidthPixels===t.gpano.FullPanoWidthPixels)c=this._inverted?e[0]+1-s:e[0]-s;else{var l=-n,h=1-i;c=Math.max(l,Math.min(h,e[0]-s))}var p=-o,f=1-a,d=Math.max(p,Math.min(f,e[1]-u));this._rect[0]=r[0]+c,this._rect[1]=r[1]+d,this._rect[2]=r[2]+c,this._rect[3]=r[3]+d,this._rect[0]<0?(this._rect[0]+=1,this._inverted=!this._inverted):this._rect[0]>1&&(this._rect[0]-=1,this._inverted=!this._inverted),this._rect[2]<0?(this._rect[2]+=1,this._inverted=!this._inverted):this._rect[2]>1&&(this._rect[2]-=1,this._inverted=!this._inverted),this._notifyChanged$.next(this)},t.prototype.getPoints3d=function(e){return this._getPoints2d(e).map(function(t){return e.unprojectBasic(t,200)})},t.prototype.getVertex2d=function(e){return this._rectToVertices2d(this._rect)[e]},t.prototype.getNonAdjustedVertex2d=function(e){return this._rectToNonAdjustedVertices2d(this._rect)[e]},t.prototype.getVertex3d=function(e,t){return t.unprojectBasic(this._rectToVertices2d(this._rect)[e],200)},t.prototype.getVertices2d=function(){return this._rectToVertices2d(this._rect)},t.prototype.getVertices3d=function(e){return this._rectToVertices2d(this._rect).map(function(t){return e.unprojectBasic(t,200)})},t.prototype.getCentroid2d=function(){var e=this._rect,t=e[0],r=this._inverted?e[2]+1:e[2],n=e[1];return[t+(r-t)/2,n+(e[3]-n)/2]},t.prototype.getCentroid3d=function(e){var t=this.getCentroid2d();return e.unprojectBasic(t,200)},t.prototype.getPoleOfAccessibility2d=function(){return this._getPoleOfInaccessibility2d(this._rectToVertices2d(this._rect))},t.prototype.getPoleOfAccessibility3d=function(e){var t=this._getPoleOfInaccessibility2d(this._rectToVertices2d(this._rect));return e.unprojectBasic(t,200)},t.prototype.getTriangles3d=function(e){return this._triangulate(this._rectToVertices2d(this._rect),this.getVertices3d(e))},t.prototype.validate=function(e){var t=this._rect;return!(!this._inverted&&e[0]<t[0]||e[0]-t[2]>.25||e[1]<t[1])},t.prototype._getPoints2d=function(e){for(var t=this._rectToVertices2d(this._rect),r=t.length-1,n=[],i=0;i<r;++i)for(var o=t[i][0],a=t[i][1],s=(t[i+1][0]-o)/9,u=(t[i+1][1]-a)/9,c=0;c<10;++c){var l=[o+c*s,a+c*u];n.push(l)}return n},t.prototype._rectToVertices2d=function(e){return[[e[0],e[3]],[e[0],e[1]],[this._inverted?e[2]+1:e[2],e[1]],[this._inverted?e[2]+1:e[2],e[3]],[e[0],e[3]]]},t.prototype._rectToNonAdjustedVertices2d=function(e){return[[e[0],e[3]],[e[0],e[1]],[e[2],e[1]],[e[2],e[3]],[e[0],e[3]]]},t}(i.VertexGeometry);r.RectGeometry=o,r.default=o},{"../../../Component":365}],442:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("earcut"),o=e("@mapbox/polylabel"),a=function(e){function t(){return e.call(this)||this}return n(t,e),t.prototype._getPoleOfInaccessibility2d=function(e){return o([e],.03)},t.prototype._triangulate=function(e,t,r,n){for(var o=[e.slice(0,-1)],a=0,s=null!=r?r:[];a<s.length;a++){var u=s[a];o.push(u.slice(0,-1))}for(var c=t.slice(0,-1),l=0,h=null!=n?n:[];l<h.length;l++){var p=h[l];c=c.concat(p.slice(0,-1))}for(var f=i.flatten(o),d=i(f.vertices,f.holes,f.dimensions),m=[],v=0;v<d.length;++v){var y=c[d[v]];m.push(y[0]),m.push(y[1]),m.push(y[2])}return m},t}(e("../../../Component").Geometry);r.VertexGeometry=a,r.default=a},{"../../../Component":365,"@mapbox/polylabel":1,earcut:19}],443:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("rxjs/Subject"),o=function(e){function t(t,r,n,o,a){var s=e.call(this,t,r,n,o)||this;return s._tagCreator=a,s._geometryCreated$=new i.Subject,s}return n(t,e),Object.defineProperty(t.prototype,"geometryCreated$",{get:function(){return this._geometryCreated$},enumerable:!0,configurable:!0}),t.prototype._enable=function(){this._enableCreate(),this._container.element.classList.add("component-tag-create")},t.prototype._disable=function(){this._container.element.classList.remove("component-tag-create"),this._disableCreate()},t.prototype._validateBasic=function(e){var t=e[0],r=e[1];return 0<=t&&t<=1&&0<=r&&r<=1},t.prototype._mouseEventToBasic$=function(e){var t=this;return e.withLatestFrom(this._container.renderService.renderCamera$,this._navigator.stateService.currentTransform$).map(function(e){var r=e[0],n=e[1],i=e[2];return t._mouseEventToBasic(r,t._container.element,n,i)})},t}(e("../../../Component").TagHandlerBase);r.CreateHandlerBase=o,r.default=o},{"../../../Component":365,"rxjs/Subject":162}],444:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("../../../Component"),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype._enableCreate=function(){this._container.mouseService.deferPixels(this._name,4),this._geometryCreatedSubscription=this._mouseEventToBasic$(this._container.mouseService.proximateClick$).filter(this._validateBasic).map(function(e){return new i.PointGeometry(e)}).subscribe(this._geometryCreated$)},t.prototype._disableCreate=function(){this._container.mouseService.undeferPixels(this._name),this._geometryCreatedSubscription.unsubscribe()},t.prototype._getNameExtension=function(){return"create-point"},t}(i.CreateHandlerBase);r.CreatePointHandler=o,r.default=o},{"../../../Component":365}],445:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype._addPoint=function(e,t){e.addPoint(t)},Object.defineProperty(t.prototype,"_create$",{get:function(){return this._tagCreator.createPolygon$},enumerable:!0,configurable:!0}),t.prototype._getNameExtension=function(){return"create-polygon"},t.prototype._setVertex2d=function(e,t,r){e.geometry.setVertex2d(e.geometry.polygon.length-2,t,r)},t}(e("../../../Component").CreateVertexHandler);r.CreatePolygonHandler=i,r.default=i},{"../../../Component":365}],446:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("rxjs/Observable"),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype._enableCreate=function(){var e=this;this._container.mouseService.claimMouse(this._name,2),this._deleteSubscription=this._navigator.stateService.currentTransform$.map(function(e){return null}).skip(1).subscribe(this._tagCreator.delete$),this._createSubscription=this._mouseEventToBasic$(this._container.mouseService.filtered$(this._name,this._container.mouseService.mouseDragStart$)).filter(this._validateBasic).subscribe(this._tagCreator.createRect$),this._initializeAnchorIndexingSubscription=this._tagCreator.tag$.filter(function(e){return!!e}).subscribe(function(e){e.geometry.initializeAnchorIndexing()});var t=i.Observable.merge(this._container.mouseService.filtered$(this._name,this._container.mouseService.mouseMove$),this._container.mouseService.filtered$(this._name,this._container.mouseService.domMouseMove$)).combineLatest(this._container.renderService.renderCamera$).withLatestFrom(this._navigator.stateService.currentTransform$).map(function(t){var r=t[0],n=r[0],i=r[1],o=t[1];return e._mouseEventToBasic(n,e._container.element,i,o)});this._setVertexSubscription=this._tagCreator.tag$.switchMap(function(r){return r?i.Observable.combineLatest(i.Observable.of(r),t,e._navigator.stateService.currentTransform$):i.Observable.empty()}).subscribe(function(e){var t=e[0],r=e[1],n=e[2];t.geometry.setOppositeVertex2d(r,n)});var r=this._container.mouseService.mouseDragEnd$.withLatestFrom(this._mouseEventToBasic$(this._container.mouseService.filtered$(this._name,this._container.mouseService.mouseDrag$)).filter(this._validateBasic),function(e,t){return t}).share();this._addPointSubscription=this._tagCreator.tag$.switchMap(function(e){return e?i.Observable.combineLatest(i.Observable.of(e),r):i.Observable.empty()}).subscribe(function(e){var t=e[0],r=e[1],n=t.geometry;n.validate(r)||(r=n.getNonAdjustedVertex2d(3)),t.addPoint(r)}),this._geometryCreatedSubscription=this._tagCreator.tag$.switchMap(function(e){return e?e.created$.map(function(e){return e.geometry}):i.Observable.empty()}).subscribe(this._geometryCreated$)},t.prototype._disableCreate=function(){this._container.mouseService.unclaimMouse(this._name),this._tagCreator.delete$.next(null),this._addPointSubscription.unsubscribe(),this._createSubscription.unsubscribe(),this._deleteSubscription.unsubscribe(),this._geometryCreatedSubscription.unsubscribe(),this._initializeAnchorIndexingSubscription.unsubscribe(),this._setVertexSubscription.unsubscribe()},t.prototype._getNameExtension=function(){return"create-rect-drag"},t}(e("../../../Component").CreateHandlerBase);r.CreateRectDragHandler=o,r.default=o},{"../../../Component":365,"rxjs/Observable":157}],447:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),Object.defineProperty(t.prototype,"_create$",{get:function(){return this._tagCreator.createRect$},enumerable:!0,configurable:!0}),t.prototype._addPoint=function(e,t){var r=e.geometry;r.validate(t)||(t=r.getNonAdjustedVertex2d(3)),e.addPoint(t)},t.prototype._enable=function(){e.prototype._enable.call(this),this._initializeAnchorIndexingSubscription=this._tagCreator.tag$.filter(function(e){return!!e}).subscribe(function(e){e.geometry.initializeAnchorIndexing()})},t.prototype._disable=function(){e.prototype._disable.call(this),this._initializeAnchorIndexingSubscription.unsubscribe()},t.prototype._getNameExtension=function(){return"create-rect"},t.prototype._setVertex2d=function(e,t,r){e.geometry.setOppositeVertex2d(t,r)},t}(e("../../../Component").CreateVertexHandler);r.CreateRectHandler=i,r.default=i},{"../../../Component":365}],448:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("rxjs/Observable"),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype._enableCreate=function(){var e=this;this._container.mouseService.deferPixels(this._name,4);var t=this._navigator.stateService.currentTransform$.map(function(e){}).publishReplay(1).refCount();this._deleteSubscription=t.skip(1).subscribe(this._tagCreator.delete$);var r=this._mouseEventToBasic$(this._container.mouseService.proximateClick$).share();this._createSubscription=t.switchMap(function(){return r.filter(e._validateBasic).take(1)}).subscribe(this._create$),this._setVertexSubscription=this._tagCreator.tag$.switchMap(function(t){return t?i.Observable.combineLatest(i.Observable.of(t),i.Observable.merge(e._container.mouseService.mouseMove$,e._container.mouseService.domMouseMove$),e._container.renderService.renderCamera$,e._navigator.stateService.currentTransform$):i.Observable.empty()}).subscribe(function(t){var r=t[0],n=t[1],i=t[2],o=t[3],a=e._mouseEventToBasic(n,e._container.element,i,o);e._setVertex2d(r,a,o)}),this._addPointSubscription=this._tagCreator.tag$.switchMap(function(e){return e?i.Observable.combineLatest(i.Observable.of(e),r):i.Observable.empty()}).subscribe(function(t){var r=t[0],n=t[1];e._addPoint(r,n)}),this._geometryCreateSubscription=this._tagCreator.tag$.switchMap(function(e){return e?e.created$.map(function(e){return e.geometry}):i.Observable.empty()}).subscribe(this._geometryCreated$)},t.prototype._disableCreate=function(){this._container.mouseService.undeferPixels(this._name),this._tagCreator.delete$.next(null),this._addPointSubscription.unsubscribe(),this._createSubscription.unsubscribe(),this._deleteSubscription.unsubscribe(),this._geometryCreateSubscription.unsubscribe(),this._setVertexSubscription.unsubscribe()},t}(e("../../../Component").CreateHandlerBase);r.CreateVertexHandler=o,r.default=o},{"../../../Component":365,"rxjs/Observable":157}],449:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("rxjs/Observable"),o=e("../../../Component"),a=function(e){function t(t,r,n,i,o){var a=e.call(this,t,r,n,i)||this;return a._tagSet=o,a}return n(t,e),t.prototype._enable=function(){var e=this,t=this._tagSet.changed$.map(function(e){return e.getAll()}).switchMap(function(e){return i.Observable.from(e).mergeMap(function(e){return e.interact$})}).switchMap(function(t){return i.Observable.of(t).concat(e._container.mouseService.documentMouseUp$.map(function(){return{offsetX:0,offsetY:0,operation:o.TagOperation.None,tag:null}}).first())}).share(),r=i.Observable.merge(this._container.mouseService.mouseMove$,this._container.mouseService.domMouseMove$).share();this._claimMouseSubscription=t.switchMap(function(t){return t.tag?e._container.mouseService.domMouseDragStart$:i.Observable.empty()}).subscribe(function(){e._container.mouseService.claimMouse(e._name,3)}),this._cursorSubscription=t.map(function(e){return e.cursor}).distinctUntilChanged().subscribe(function(t){for(var r=0,n=["crosshair","move","nesw-resize","nwse-resize"];r<n.length;r++){var i=n[r];e._container.element.classList.remove("component-tag-edit-"+i)}t&&e._container.element.classList.add("component-tag-edit-"+t)}),this._unclaimMouseSubscription=this._container.mouseService.filtered$(this._name,this._container.mouseService.domMouseDragEnd$).subscribe(function(t){e._container.mouseService.unclaimMouse(e._name)}),this._preventDefaultSubscription=t.switchMap(function(t){return t.tag?e._container.mouseService.documentMouseMove$:i.Observable.empty()}).subscribe(function(e){e.preventDefault()}),this._updateGeometrySubscription=t.withLatestFrom(r).switchMap(function(t){var r=t[0],n=t[1];if(r.operation===o.TagOperation.None||!r.tag)return i.Observable.empty();var a=i.Observable.of(n).concat(e._container.mouseService.filtered$(e._name,e._container.mouseService.domMouseDrag$).filter(function(t){return e._viewportCoords.insideElement(t,e._container.element)}));return i.Observable.combineLatest(a,e._container.renderService.renderCamera$).withLatestFrom(i.Observable.of(r),e._navigator.stateService.currentTransform$,function(e,t,r){return[e[0],e[1],t,r]})}).subscribe(function(t){var r=t[0],n=t[1],i=t[2],a=t[3],s=e._mouseEventToBasic(r,e._container.element,n,a,i.offsetX,i.offsetY),u=i.tag.geometry;i.operation===o.TagOperation.Centroid?u.setCentroid2d(s,a):i.operation===o.TagOperation.Vertex&&u.setVertex2d(i.vertexIndex,s,a)})},t.prototype._disable=function(){this._claimMouseSubscription.unsubscribe(),this._cursorSubscription.unsubscribe(),this._preventDefaultSubscription.unsubscribe(),this._unclaimMouseSubscription.unsubscribe(),this._updateGeometrySubscription.unsubscribe()},t.prototype._getNameExtension=function(){return"edit-vertex"},t}(o.TagHandlerBase);r.EditVertexHandler=a,r.default=a},{"../../../Component":365,"rxjs/Observable":157}],450:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=function(e){function t(t,r,n,i){var o=e.call(this,t,r,n)||this;return o._name=o._component.name+"-"+o._getNameExtension(),o._viewportCoords=i,o}return n(t,e),t.prototype._getConfiguration=function(e){return{}},t.prototype._mouseEventToBasic=function(e,t,r,n,i,o){i=null!=i?i:0,o=null!=o?o:0;var a=this._viewportCoords.canvasPosition(e,t),s=a[0],u=a[1];return this._viewportCoords.canvasToBasic(s-i,u-o,t,n,r.perspective)},t}(e("../../../Component").HandlerBase);r.TagHandlerBase=i,r.default=i},{"../../../Component":365}],451:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("three"),i=e("virtual-dom"),o=e("rxjs/Subject"),a=e("../../../Component"),s=e("../../../Geo"),u=function(){function e(e,t,r,n){var i=this;this._geometry=e,this._options={color:null==t.color?16777215:t.color},this._transform=r,this._viewportCoords=n||new s.ViewportCoords,this._outline=this._createOutine(),this._glObjects=[this._outline],this._aborted$=new o.Subject,this._created$=new o.Subject,this._glObjectsChanged$=new o.Subject,this._geometryChangedSubscription=this._geometry.changed$.subscribe(function(e){i._disposeOutline(),i._outline=i._createOutine(),i._glObjects=[i._outline],i._glObjectsChanged$.next(i)})}return Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"glObjects",{get:function(){return this._glObjects},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"aborted$",{get:function(){return this._aborted$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"created$",{get:function(){return this._created$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"glObjectsChanged$",{get:function(){return this._glObjectsChanged$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"geometryChanged$",{get:function(){var e=this;return this._geometry.changed$.map(function(t){return e})},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._disposeOutline(),this._geometryChangedSubscription.unsubscribe()},e.prototype.getDOMObjects=function(e,t){var r=this,n=[],o={offsetHeight:t.height,offsetWidth:t.width},s=function(e){e.stopPropagation(),r._aborted$.next(r)};if(this._geometry instanceof a.RectGeometry){var u=this._geometry.anchorIndex,c=void 0===u?1:u,l=this._geometry.getVertex2d(c),h=l[0],p=l[1],f=this._viewportCoords.basicToCanvasSafe(h,p,o,this._transform,e);if(null!=f){var d={style:{background:A=this._colorToBackground(this._options.color),transform:N=this._canvasToTransform(f)}},m={onclick:s,style:{transform:N}};n.push(i.h("div.TagInteractor",m,[])),n.push(i.h("div.TagVertex",d,[]))}}else if(this._geometry instanceof a.PolygonGeometry){var v=this._geometry,y=v.getVertex2d(0),g=y[0],b=y[1],_=this._viewportCoords.basicToCanvasSafe(g,b,o,this._transform,e);if(null!=_){var m={onclick:v.polygon.length>4?function(e){e.stopPropagation(),v.removeVertex2d(v.polygon.length-2),r._created$.next(r)}:s,style:{transform:N=this._canvasToTransform(_)}},x=v.polygon.length>4?"TagCompleter":"TagInteractor";n.push(i.h("div."+x,m,[]))}if(v.polygon.length>3){var w=v.getVertex2d(v.polygon.length-3),S=w[0],T=w[1],E=this._viewportCoords.basicToCanvasSafe(S,T,o,this._transform,e);if(null!=E){m={onclick:function(e){e.stopPropagation(),v.removeVertex2d(v.polygon.length-3)},style:{transform:N=this._canvasToTransform(E)}};n.push(i.h("div.TagInteractor",m,[]))}}var O=v.polygon.slice();O.splice(-2,2);for(var M=0,C=O;M<C.length;M++){var j=C[M],P=this._viewportCoords.basicToCanvasSafe(j[0],j[1],o,this._transform,e);if(null!=P){var A=this._colorToBackground(this._options.color),N=this._canvasToTransform(P),d={style:{background:A,transform:N}};n.push(i.h("div.TagVertex",d,[]))}}}return n},e.prototype.addPoint=function(e){if(this._geometry instanceof a.RectGeometry){if(!this._geometry.validate(e))return;this._created$.next(this)}else this._geometry instanceof a.PolygonGeometry&&this._geometry.addVertex2d(e)},e.prototype._canvasToTransform=function(e){return"translate(-50%,-50%) translate("+Math.round(e[0])+"px,"+Math.round(e[1])+"px)"},e.prototype._colorToBackground=function(e){return"#"+("000000"+e.toString(16)).substr(-6)},e.prototype._createOutine=function(){var e=this._geometry.getPoints3d(this._transform),t=this._getLinePositions(e),r=new n.BufferGeometry;r.addAttribute("position",new n.BufferAttribute(t,3));var i=new n.LineBasicMaterial({color:this._options.color,linewidth:1});return new n.Line(r,i)},e.prototype._disposeOutline=function(){if(null!=this._outline){var e=this._outline;e.geometry.dispose(),e.material.dispose(),this._outline=null,this._glObjects=[]}},e.prototype._getLinePositions=function(e){for(var t=e.length,r=new Float32Array(3*t),n=0;n<t;++n){var i=3*n,o=e[n];r[i]=o[0],r[i+1]=o[1],r[i+2]=o[2]}return r},e}();r.OutlineCreateTag=u,r.default=u},{"../../../Component":365,"../../../Geo":368,"rxjs/Subject":162,three:311,"virtual-dom":317}],452:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("three"),o=e("virtual-dom"),a=e("../../../Component"),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n._fill=r.gpano?null:n._createFill(),n._holes=n._tag.lineWidth>=1?n._createHoles():[],n._outline=n._tag.lineWidth>=1?n._createOutline():null,n._geometryChangedSubscription=n._tag.geometry.changed$.subscribe(function(e){null!=n._fill&&n._updateFillGeometry(),n._holes.length>0&&n._updateHoleGeometries(),null!=n._outline&&n._updateOulineGeometry()}),n._changedSubscription=n._tag.changed$.subscribe(function(e){var t=!1;null!=n._fill&&n._updateFillMaterial(n._fill.material),null==n._outline?n._tag.lineWidth>=1&&(n._holes=n._createHoles(),n._outline=n._createOutline(),t=!0):(n._updateHoleMaterials(),n._updateOutlineMaterial()),t&&n._glObjectsChanged$.next(n)}),n}return n(t,e),t.prototype.dispose=function(){this._disposeFill(),this._disposeHoles(),this._disposeOutline(),this._changedSubscription.unsubscribe(),this._geometryChangedSubscription.unsubscribe()},t.prototype.getDOMObjects=function(e,t,r){var n=this,i=[],s=this._tag.geometry instanceof a.RectGeometry,u=!this._transform.gpano,c={offsetHeight:r.height,offsetWidth:r.width};if(null!=this._tag.icon&&(s||u)){var l=this._tag.geometry instanceof a.RectGeometry?this._tag.geometry.getVertex2d(this._tag.iconIndex):this._tag.geometry.getPoleOfAccessibility2d(),h=l[0],p=l[1],f=this._viewportCoords.basicToCanvasSafe(h,p,c,this._transform,t);if(null!=f){var d=function(e){n._interact$.next({offsetX:0,offsetY:0,operation:a.TagOperation.None,tag:n._tag})};if(e.loaded){var m=e.getDOMSprite(this._tag.icon,this._tag.iconFloat),v={onclick:function(e){e.stopPropagation(),n._tag.click$.next(n._tag)},onmousedown:d,style:{transform:S="translate("+Math.round(f[0])+"px,"+Math.round(f[1])+"px)"}};i.push(o.h("div.TagSymbol",v,[m]))}}}else if(null!=this._tag.text&&(s||u)){var y=this._tag.geometry instanceof a.RectGeometry?this._tag.geometry.getVertex2d(3):this._tag.geometry.getPoleOfAccessibility2d(),g=y[0],b=y[1],_=this._viewportCoords.basicToCanvasSafe(g,b,c,this._transform,t);if(null!=_){var x=Math.round(_[0]),w=Math.round(_[1]),S=this._tag.geometry instanceof a.RectGeometry?"translate("+x+"px,"+w+"px)":"translate(-50%, -50%) translate("+x+"px,"+w+"px)",v={onmousedown:d=function(e){n._interact$.next({offsetX:0,offsetY:0,operation:a.TagOperation.None,tag:n._tag})},style:{color:this._colorToCss(this._tag.textColor),transform:S},textContent:this._tag.text};i.push(o.h("span.TagSymbol",v,[]))}}if(!this._tag.editable)return i;var T=this._colorToCss(this._tag.lineColor);if(this._tag.geometry instanceof a.RectGeometry){var E=this._tag.geometry.getCentroid2d(),O=E[0],M=E[1],C=this._viewportCoords.basicToCanvasSafe(O,M,c,this._transform,t);if(null!=C){v={onmousedown:d=this._interact(a.TagOperation.Centroid,"move"),style:{background:T,transform:S="translate(-50%, -50%) translate("+Math.round(C[0])+"px,"+Math.round(C[1])+"px)"}};i.push(o.h("div.TagMover",v,[]))}}for(var j=this._tag.geometry.getVertices2d(),P=0;P<j.length-1;P++)if(!s||!(null!=this._tag.icon&&P===this._tag.iconIndex||null==this._tag.icon&&null!=this._tag.text&&3===P)){var A=j[P],N=A[0],L=A[1],I=this._viewportCoords.basicToCanvasSafe(N,L,c,this._transform,t);if(null!=I){var R=s?P%2==0?"nesw-resize":"nwse-resize":"crosshair",v={onmousedown:d=this._interact(a.TagOperation.Vertex,R,P),style:{background:T,transform:S="translate(-50%, -50%) translate("+Math.round(I[0])+"px,"+Math.round(I[1])+"px)",cursor:R}};if(i.push(o.h("div.TagResizer",v,[])),this._tag.indicateVertices){var k={style:{background:T,transform:S}};i.push(o.h("div.TagVertex",k,[]))}}}return i},t.prototype.getGLObjects=function(){var e=[];null!=this._fill&&e.push(this._fill);for(var t=0,r=this._holes;t<r.length;t++){var n=r[t];e.push(n)}return null!=this._outline&&e.push(this._outline),e},t.prototype.getRetrievableObjects=function(){return null!=this._fill?[this._fill]:[]},t.prototype._colorToCss=function(e){return"#"+("000000"+e.toString(16)).substr(-6)},t.prototype._createFill=function(){var e=this._tag.geometry.getTriangles3d(this._transform),t=new Float32Array(e),r=new i.BufferGeometry;r.addAttribute("position",new i.BufferAttribute(t,3)),r.computeBoundingSphere();var n=new i.MeshBasicMaterial({side:i.DoubleSide,transparent:!0});return this._updateFillMaterial(n),new i.Mesh(r,n)},t.prototype._createHoles=function(){var e=[];if(this._tag.geometry instanceof a.PolygonGeometry)for(var t=0,r=this._tag.geometry.getHoleVertices3d(this._transform);t<r.length;t++){var n=r[t],i=this._createLine(n);e.push(i)}return e},t.prototype._createLine=function(e){var t=this._getLinePositions(e),r=new i.BufferGeometry;r.addAttribute("position",new i.BufferAttribute(t,3)),r.computeBoundingSphere();var n=new i.LineBasicMaterial;this._updateLineBasicMaterial(n);var o=new i.Line(r,n);return o.renderOrder=1,o},t.prototype._createOutline=function(){var e=this._tag.geometry.getPoints3d(this._transform);return this._createLine(e)},t.prototype._disposeFill=function(){null!=this._fill&&(this._fill.geometry.dispose(),this._fill.material.dispose(),this._fill=null)},t.prototype._disposeHoles=function(){for(var e=0,t=this._holes;e<t.length;e++){var r=t[e];r.geometry.dispose(),r.material.dispose()}this._holes=[]},t.prototype._disposeOutline=function(){null!=this._outline&&(this._outline.geometry.dispose(),this._outline.material.dispose(),this._outline=null)},t.prototype._getLinePositions=function(e){for(var t=e.length,r=new Float32Array(3*t),n=0;n<t;++n){var i=3*n,o=e[n];r[i+0]=o[0],r[i+1]=o[1],r[i+2]=o[2]}return r},t.prototype._interact=function(e,t,r){var n=this;return function(i){var o=i.offsetX-i.target.offsetWidth/2,a=i.offsetY-i.target.offsetHeight/2;n._interact$.next({cursor:t,offsetX:o,offsetY:a,operation:e,tag:n._tag,vertexIndex:r})}},t.prototype._updateFillGeometry=function(){var e=this._tag.geometry.getTriangles3d(this._transform),t=new Float32Array(e),r=this._fill.geometry,n=r.getAttribute("position");n.array.length===t.length?(n.set(t),n.needsUpdate=!0):(r.removeAttribute("position"),r.addAttribute("position",new i.BufferAttribute(t,3))),r.computeBoundingSphere()},t.prototype._updateFillMaterial=function(e){e.color=new i.Color(this._tag.fillColor),e.opacity=this._tag.fillOpacity,e.needsUpdate=!0},t.prototype._updateHoleGeometries=function(){var e=this._tag.geometry.getHoleVertices3d(this._transform);if(e.length!==this._holes.length)throw new Error("Changing the number of holes is not supported.");for(var t=0;t<this._holes.length;t++){var r=e[t],n=this._holes[t];this._updateLine(n,r)}},t.prototype._updateHoleMaterials=function(){for(var e=0,t=this._holes;e<t.length;e++){var r=t[e].material;this._updateLineBasicMaterial(r)}},t.prototype._updateLine=function(e,t){var r=this._getLinePositions(t),n=e.geometry,i=n.getAttribute("position");i.set(r),i.needsUpdate=!0,n.computeBoundingSphere()},t.prototype._updateOulineGeometry=function(){var e=this._tag.geometry.getPoints3d(this._transform);this._updateLine(this._outline,e)},t.prototype._updateOutlineMaterial=function(){var e=this._outline.material;this._updateLineBasicMaterial(e)},t.prototype._updateLineBasicMaterial=function(e){e.color=new i.Color(this._tag.lineColor),e.linewidth=Math.max(this._tag.lineWidth,1),e.visible=this._tag.lineWidth>=1&&this._tag.lineOpacity>0,e.opacity=this._tag.lineOpacity,e.transparent=this._tag.lineOpacity<1,e.needsUpdate=!0},t}(a.RenderTag);r.OutlineRenderTag=s},{"../../../Component":365,three:311,"virtual-dom":317}],453:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("rxjs/Subject"),o=e("../../../Component"),a=e("../../../Viewer"),s=function(e){function t(r,n,o){var s=e.call(this,r,n)||this;return o=o||{},s._editable=null!=o.editable&&o.editable,s._fillColor=null==o.fillColor?16777215:o.fillColor,s._fillOpacity=null==o.fillOpacity?0:o.fillOpacity,s._icon=void 0===o.icon?null:o.icon,s._iconFloat=null==o.iconFloat?a.Alignment.Center:o.iconFloat,s._iconIndex=null==o.iconIndex?3:o.iconIndex,s._indicateVertices=null==o.indicateVertices||o.indicateVertices,s._lineColor=null==o.lineColor?16777215:o.lineColor,s._lineOpacity=null==o.lineOpacity?1:o.lineOpacity,s._lineWidth=null==o.lineWidth?1:o.lineWidth,s._text=void 0===o.text?null:o.text,s._textColor=null==o.textColor?16777215:o.textColor,s._click$=new i.Subject,s._click$.subscribe(function(e){s.fire(t.click,s)}),s}return n(t,e),Object.defineProperty(t.prototype,"click$",{get:function(){return this._click$},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"editable",{get:function(){return this._editable},set:function(e){this._editable=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fillColor",{get:function(){return this._fillColor},set:function(e){this._fillColor=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fillOpacity",{get:function(){return this._fillOpacity},set:function(e){this._fillOpacity=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"geometry",{get:function(){return this._geometry},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return this._icon},set:function(e){this._icon=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconFloat",{get:function(){return this._iconFloat},set:function(e){this._iconFloat=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconIndex",{get:function(){return this._iconIndex},set:function(e){this._iconIndex=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"indicateVertices",{get:function(){return this._indicateVertices},set:function(e){this._indicateVertices=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineColor",{get:function(){return this._lineColor},set:function(e){this._lineColor=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineOpacity",{get:function(){return this._lineOpacity},set:function(e){this._lineOpacity=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineWidth",{get:function(){return this._lineWidth},set:function(e){this._lineWidth=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){this._text=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"textColor",{get:function(){return this._textColor},set:function(e){this._textColor=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),t.prototype.setOptions=function(e){this._editable=null==e.editable?this._editable:e.editable,this._icon=void 0===e.icon?this._icon:e.icon,this._iconFloat=null==e.iconFloat?this._iconFloat:e.iconFloat,this._iconIndex=null==e.iconIndex?this._iconIndex:e.iconIndex,this._indicateVertices=null==e.indicateVertices?this._indicateVertices:e.indicateVertices,this._lineColor=null==e.lineColor?this._lineColor:e.lineColor,this._lineWidth=null==e.lineWidth?this._lineWidth:e.lineWidth,this._fillColor=null==e.fillColor?this._fillColor:e.fillColor,this._fillOpacity=null==e.fillOpacity?this._fillOpacity:e.fillOpacity,this._text=void 0===e.text?this._text:e.text,this._textColor=null==e.textColor?this._textColor:e.textColor,this._notifyChanged$.next(this)},t.click="click",t}(o.Tag);r.OutlineTag=s,r.default=s},{"../../../Component":365,"../../../Viewer":375,"rxjs/Subject":162}],454:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/Subject"),i=e("../../../Geo"),o=function(){function e(e,t,r){this._tag=e,this._transform=t,this._viewportCoords=r||new i.ViewportCoords,this._glObjectsChanged$=new n.Subject,this._interact$=new n.Subject}return Object.defineProperty(e.prototype,"glObjectsChanged$",{get:function(){return this._glObjectsChanged$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"interact$",{get:function(){return this._interact$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tag",{get:function(){return this._tag},enumerable:!0,configurable:!0}),e}();r.RenderTag=o,r.default=o},{"../../../Geo":368,"rxjs/Subject":162}],455:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("virtual-dom"),o=e("../../../Component"),a=e("../../../Viewer"),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.dispose=function(){},t.prototype.getDOMObjects=function(e,t,r){var n=this,s=this._tag,u={offsetHeight:r.height,offsetWidth:r.width},c=[],l=s.geometry.getCentroid2d(),h=l[0],p=l[1],f=this._viewportCoords.basicToCanvasSafe(h,p,u,this._transform,t);if(null!=f){var d=function(e){n._interact$.next({offsetX:0,offsetY:0,operation:o.TagOperation.None,tag:s})},m=Math.round(f[0]),v=Math.round(f[1]);if(null!=s.icon){if(e.loaded){var y=e.getDOMSprite(s.icon,a.Alignment.Bottom),g={onmousedown:d,style:{pointerEvents:"all",transform:"translate("+m+"px,"+(v+8)+"px)"}};c.push(i.h("div",g,[y]))}}else if(null!=s.text){var b="translate(-50%,0%) translate("+m+"px,"+(v+8)+"px)",g={onmousedown:d,style:{color:this._colorToCss(s.textColor),transform:b},textContent:s.text};c.push(i.h("span.TagSymbol",g,[]))}var _=this._interact(o.TagOperation.Centroid,s,"move"),x=this._colorToCss(s.color),w="translate(-50%,-50%) translate("+m+"px,"+v+"px)";if(s.editable){var S={onmousedown:_,style:{background:x,transform:w}};c.push(i.h("div.TagSpotInteractor",S,[]))}var T={style:{background:x,transform:w}};c.push(i.h("div.TagVertex",T,[]))}return c},t.prototype.getGLObjects=function(){return[]},t.prototype.getRetrievableObjects=function(){return[]},t.prototype._colorToCss=function(e){return"#"+("000000"+e.toString(16)).substr(-6)},t.prototype._interact=function(e,t,r,n){var i=this;return function(o){var a=o.offsetX-o.target.offsetWidth/2,s=o.offsetY-o.target.offsetHeight/2;i._interact$.next({cursor:r,offsetX:a,offsetY:s,operation:e,tag:t,vertexIndex:n})}},t}(o.RenderTag);r.SpotRenderTag=s},{"../../../Component":365,"../../../Viewer":375,"virtual-dom":317}],456:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return n=n||{},i._color=null==n.color?16777215:n.color,i._editable=null!=n.editable&&n.editable,i._icon=void 0===n.icon?null:n.icon,i._text=void 0===n.text?null:n.text,i._textColor=null==n.textColor?16777215:n.textColor,i}return n(t,e),Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(e){this._color=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"editable",{get:function(){return this._editable},set:function(e){this._editable=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return this._icon},set:function(e){this._icon=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){this._text=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"textColor",{get:function(){return this._textColor},set:function(e){this._textColor=e,this._notifyChanged$.next(this)},enumerable:!0,configurable:!0}),t.prototype.setOptions=function(e){this._color=null==e.color?this._color:e.color,this._editable=null==e.editable?this._editable:e.editable,this._icon=void 0===e.icon?this._icon:e.icon,this._text=void 0===e.text?this._text:e.text,this._textColor=null==e.textColor?this._textColor:e.textColor,this._notifyChanged$.next(this)},t}(e("../../../Component").Tag);r.SpotTag=i,r.default=i},{"../../../Component":365}],457:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("rxjs/Subject");e("rxjs/add/operator/map"),e("rxjs/add/operator/share");var o=function(e){function t(r,n){var o=e.call(this)||this;return o._id=r,o._geometry=n,o._notifyChanged$=new i.Subject,o._notifyChanged$.subscribe(function(e){o.fire(t.changed,o)}),o._geometry.changed$.subscribe(function(e){o.fire(t.geometrychanged,o)}),o}return n(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"geometry",{get:function(){return this._geometry},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"changed$",{get:function(){return this._notifyChanged$},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"geometryChanged$",{get:function(){var e=this;return this._geometry.changed$.map(function(t){return e}).share()},enumerable:!0,configurable:!0}),t.changed="changed",t.geometrychanged="geometrychanged",t}(e("../../../Utils").EventEmitter);r.Tag=o,r.default=o},{"../../../Utils":374,"rxjs/Subject":162,"rxjs/add/operator/map":193,"rxjs/add/operator/share":203}],458:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t,r){this._component=e,this._container=t,this._navigator=r,this._enabled=!1}return Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._enabled},enumerable:!0,configurable:!0}),e.prototype.enable=function(){!this._enabled&&this._component.activated&&(this._enable(),this._enabled=!0,this._component.configure(this._getConfiguration(!0)))},e.prototype.disable=function(){this._enabled&&(this._disable(),this._enabled=!1,this._component.activated&&this._component.configure(this._getConfiguration(!1)))},e}();r.HandlerBase=n,r.default=n},{}],459:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=function(e){function t(t){var r=e.call(this,null!=t?t:"The argument is not valid.")||this;return r.name="ArgumentBeeviewError",r}return n(t,e),t}(e("./BeeviewError").BeeviewError);r.ArgumentBeeviewError=i,r.default=i},{"./BeeviewError":460}],460:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=function(e){function t(t){var r=e.call(this,t)||this;return r.name="BeeviewError",r}return n(t,e),t}(Error);r.BeeviewError=i,r.default=i},{}],461:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=function(e){function t(t){var r=e.call(this,t)||this;return r.name="GraphBeeviewError",r}return n(t,e),t}(e("./BeeviewError").BeeviewError);r.GraphBeeviewError=i,r.default=i},{"./BeeviewError":460}],462:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("three"),i=function(){function e(e){null!=e?(this._position=(new n.Vector3).fromArray(e.unprojectSfM([0,0],0)),this._lookat=(new n.Vector3).fromArray(e.unprojectSfM([0,0],10)),this._up=e.upVector(),this._focal=this._getFocal(e)):(this._position=new n.Vector3(0,0,0),this._lookat=new n.Vector3(0,0,1),this._up=new n.Vector3(0,-1,0),this._focal=1)}return Object.defineProperty(e.prototype,"position",{get:function(){return this._position},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lookat",{get:function(){return this._lookat},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"up",{get:function(){return this._up},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"focal",{get:function(){return this._focal},set:function(e){this._focal=e},enumerable:!0,configurable:!0}),e.prototype.lerpCameras=function(e,t,r){this._position.subVectors(t.position,e.position).multiplyScalar(r).add(e.position),this._lookat.subVectors(t.lookat,e.lookat).multiplyScalar(r).add(e.lookat),this._up.subVectors(t.up,e.up).multiplyScalar(r).add(e.up),this._focal=(1-r)*e.focal+r*t.focal},e.prototype.copy=function(e){this._position.copy(e.position),this._lookat.copy(e.lookat),this._up.copy(e.up),this._focal=e.focal},e.prototype.clone=function(){var t=new e;return t.position.copy(this._position),t.lookat.copy(this._lookat),t.up.copy(this._up),t.focal=this._focal,t},e.prototype.diff=function(e){var t=this._position.distanceToSquared(e.position),r=this._lookat.distanceToSquared(e.lookat),n=this._up.distanceToSquared(e.up),i=100*Math.abs(this._focal-e.focal);return Math.max(t,r,n,i)},e.prototype._getFocal=function(e){if(null==e.gpano)return e.focal;var t=Math.PI*e.gpano.CroppedAreaImageHeightPixels/e.gpano.FullPanoHeightPixels,r=.5/Math.tan(t/2);return Math.min(1/(2*(Math.sqrt(2)-1)),Math.max(.5,r))},e}();r.Camera=i},{three:311}],463:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(){this._wgs84a=6378137,this._wgs84b=6356752.31424518}return e.prototype.geodeticToEnu=function(e,t,r,n,i,o){var a=this.geodeticToEcef(e,t,r);return this.ecefToEnu(a[0],a[1],a[2],n,i,o)},e.prototype.enuToGeodetic=function(e,t,r,n,i,o){var a=this.enuToEcef(e,t,r,n,i,o);return this.ecefToGeodetic(a[0],a[1],a[2])},e.prototype.ecefToEnu=function(e,t,r,n,i,o){var a=this.geodeticToEcef(n,i,o),s=[e-a[0],t-a[1],r-a[2]];n=n*Math.PI/180,i=i*Math.PI/180;var u=Math.cos(n),c=Math.sin(n),l=Math.cos(i),h=Math.sin(i);return[-h*s[0]+l*s[1],-c*l*s[0]-c*h*s[1]+u*s[2],u*l*s[0]+u*h*s[1]+c*s[2]]},e.prototype.enuToEcef=function(e,t,r,n,i,o){var a=this.geodeticToEcef(n,i,o);n=n*Math.PI/180,i=i*Math.PI/180;var s=Math.cos(n),u=Math.sin(n),c=Math.cos(i),l=Math.sin(i);return[-l*e-u*c*t+s*c*r+a[0],c*e-u*l*t+s*l*r+a[1],s*t+u*r+a[2]]},e.prototype.geodeticToEcef=function(e,t,r){var n=this._wgs84a,i=this._wgs84b;e=e*Math.PI/180,t=t*Math.PI/180;var o=Math.cos(e),a=Math.sin(e),s=Math.cos(t),u=Math.sin(t),c=n*n,l=i*i,h=1/Math.sqrt(c*o*o+l*a*a),p=(c*h+r)*o;return[p*s,p*u,(l*h+r)*a]},e.prototype.ecefToGeodetic=function(e,t,r){var n=this._wgs84a,i=this._wgs84b,o=n*n,a=i*i,s=o-a,u=Math.sqrt(s/o),c=Math.sqrt(s/a),l=Math.sqrt(e*e+t*t),h=Math.atan2(r*n,l*i),p=Math.sin(h),f=Math.cos(h),d=Math.atan2(t,e),m=Math.atan2(r+c*c*i*p*p*p,l-u*u*n*f*f*f),v=Math.sin(m),y=l/Math.cos(m)-n/Math.sqrt(1-u*u*v*v);return[180*m/Math.PI,180*d/Math.PI,y]},e}();r.GeoCoords=n,r.default=n},{}],464:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("three"),i=function(){function e(){this._epsilon=1e-9}return e.prototype.azimuthalToBearing=function(e){return-e+Math.PI/2},e.prototype.degToRad=function(e){return Math.PI*e/180},e.prototype.radToDeg=function(e){return 180*e/Math.PI},e.prototype.rotationMatrix=function(e){var t=new n.Vector3(e[0],e[1],e[2]),r=t.length();return r>0&&t.normalize(),(new n.Matrix4).makeRotationAxis(t,r)},e.prototype.rotate=function(e,t){var r=new n.Vector3(e[0],e[1],e[2]),i=this.rotationMatrix(t);return r.applyMatrix4(i),r},e.prototype.opticalCenter=function(e,t){var r=[-e[0],-e[1],-e[2]],n=[-t[0],-t[1],-t[2]];return this.rotate(n,r)},e.prototype.viewingDirection=function(e){var t=[-e[0],-e[1],-e[2]];return this.rotate([0,0,1],t)},e.prototype.wrap=function(e,t,r){if(r<t)throw new Error("Invalid arguments: max must be larger than min.");for(var n=r-t;e>r||e<t;)e>r?e-=n:e<t&&(e+=n);return e},e.prototype.wrapAngle=function(e){return this.wrap(e,-Math.PI,Math.PI)},e.prototype.clamp=function(e,t,r){return e<t?t:e>r?r:e},e.prototype.angleBetweenVector2=function(e,t,r,n){var i=Math.atan2(n,r)-Math.atan2(t,e);return this.wrapAngle(i)},e.prototype.angleDifference=function(e,t){var r=t-e;return this.wrapAngle(r)},e.prototype.relativeRotationAngle=function(e,t){var r=this.rotationMatrix([-e[0],-e[1],-e[2]]),n=this.rotationMatrix(t),i=r.multiply(n).elements;return Math.acos((i[0]+i[5]+i[10]-1)/2)},e.prototype.angleToPlane=function(e,t){var r=(new n.Vector3).fromArray(e),i=r.length();if(i<this._epsilon)return 0;var o=r.dot((new n.Vector3).fromArray(t));return Math.asin(o/i)},e.prototype.distanceFromLatLon=function(e,t,r,n){var i=this.degToRad(r-e),o=this.degToRad(n-t),a=Math.sin(i/2)*Math.sin(i/2)+Math.cos(e)*Math.cos(r)*Math.sin(o/2)*Math.sin(o/2);return 12742e3*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))},e}();r.Spatial=i,r.default=i},{three:311}],465:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("three"),i=function(){function e(e,t,r){this._orientation=this._getValue(e.orientation,1);var n=null!=t?t.width:4,i=null!=t?t.height:3,o=this._orientation<5;this._width=this._getValue(e.width,o?n:i),this._height=this._getValue(e.height,o?i:n),this._basicAspect=o?this._width/this._height:this._height/this._width,this._basicWidth=o?e.width:e.height,this._basicHeight=o?e.height:e.width,this._focal=this._getValue(e.focal,1),this._scale=this._getValue(e.scale,0),this._gpano=null!=e.gpano?e.gpano:null,this._rt=this._getRt(e.rotation,r)}return Object.defineProperty(e.prototype,"basicAspect",{get:function(){return this._basicAspect},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"basicHeight",{get:function(){return this._basicHeight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"basicWidth",{get:function(){return this._basicWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"focal",{get:function(){return this._focal},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fullPano",{get:function(){return null!=this._gpano&&0===this._gpano.CroppedAreaLeftPixels&&0===this._gpano.CroppedAreaTopPixels&&this._gpano.CroppedAreaImageWidthPixels===this._gpano.FullPanoWidthPixels&&this._gpano.CroppedAreaImageHeightPixels===this._gpano.FullPanoHeightPixels},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gpano",{get:function(){return this._gpano},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rt",{get:function(){return this._rt},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"srt",{get:function(){return this._srt},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this._scale},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasValidScale",{get:function(){return this._scale>.01&&this._scale<50},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),e.prototype.upVector=function(){var e=this._rt.elements;switch(this._orientation){case 1:return new n.Vector3(-e[1],-e[5],-e[9]);case 3:return new n.Vector3(e[1],e[5],e[9]);case 6:return new n.Vector3(-e[0],-e[4],-e[8]);case 8:return new n.Vector3(e[0],e[4],e[8]);default:return new n.Vector3(-e[1],-e[5],-e[9])}},e.prototype.projectorMatrix=function(){var e=this._normalizedToTextureMatrix(),t=this._focal,r=(new n.Matrix4).set(t,0,0,0,0,t,0,0,0,0,0,0,0,0,1,0);return e.multiply(r),e.multiply(this._rt),e},e.prototype.projectBasic=function(e){var t=this.projectSfM(e);return this._sfmToBasic(t)},e.prototype.unprojectBasic=function(e,t){var r=this._basicToSfm(e);return this.unprojectSfM(r,t)},e.prototype.projectSfM=function(e){var t=new n.Vector4(e[0],e[1],e[2],1);return t.applyMatrix4(this._rt),this._bearingToSfm([t.x,t.y,t.z])},e.prototype.unprojectSfM=function(e,t){var r=this._sfmToBearing(e),i=new n.Vector4(t*r[0],t*r[1],t*r[2],1);return i.applyMatrix4((new n.Matrix4).getInverse(this._rt)),[i.x/i.w,i.y/i.w,i.z/i.w]},e.prototype._sfmToBearing=function(e){if(this._fullPano()){var t=2*e[0]*Math.PI,r=2*-e[1]*Math.PI;return[a=Math.cos(r)*Math.sin(t),s=-Math.sin(r),u=Math.cos(r)*Math.cos(t)]}if(this._gpano){var i=Math.max(this.gpano.CroppedAreaImageWidthPixels,this.gpano.CroppedAreaImageHeightPixels),o=[e[0]*i+this.gpano.CroppedAreaImageWidthPixels/2+this.gpano.CroppedAreaLeftPixels,e[1]*i+this.gpano.CroppedAreaImageHeightPixels/2+this.gpano.CroppedAreaTopPixels],t=2*Math.PI*(o[0]/this.gpano.FullPanoWidthPixels-.5),r=-Math.PI*(o[1]/this.gpano.FullPanoHeightPixels-.5),a=Math.cos(r)*Math.sin(t),s=-Math.sin(r),u=Math.cos(r)*Math.cos(t);return[a,s,u]}var c=new n.Vector3(e[0],e[1],this._focal);return c.normalize(),[c.x,c.y,c.z]},e.prototype._bearingToSfm=function(e){if(this._fullPano()){var t=e[0],r=e[1],n=e[2],i=Math.atan2(t,n),o=Math.atan2(-r,Math.sqrt(t*t+n*n));return[i/(2*Math.PI),-o/(2*Math.PI)]}if(this._gpano){var t=e[0],r=e[1],n=e[2],i=Math.atan2(t,n),o=Math.atan2(-r,Math.sqrt(t*t+n*n)),a=[(i/(2*Math.PI)+.5)*this.gpano.FullPanoWidthPixels,(-o/Math.PI+.5)*this.gpano.FullPanoHeightPixels],s=Math.max(this.gpano.CroppedAreaImageWidthPixels,this.gpano.CroppedAreaImageHeightPixels);return[(a[0]-this.gpano.CroppedAreaLeftPixels-this.gpano.CroppedAreaImageWidthPixels/2)/s,(a[1]-this.gpano.CroppedAreaTopPixels-this.gpano.CroppedAreaImageHeightPixels/2)/s]}return e[2]>0?[e[0]*this._focal/e[2],e[1]*this._focal/e[2]]:[e[0]<0?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,e[1]<0?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY]},e.prototype._basicToSfm=function(e){var t,r;switch(this._orientation){case 1:t=e[0],r=e[1];break;case 3:t=1-e[0],r=1-e[1];break;case 6:t=e[1],r=1-e[0];break;case 8:t=1-e[1],r=e[0];break;default:t=e[0],r=e[1]}var n=this._width,i=this._height,o=Math.max(n,i);return[t*n/o-n/o/2,r*i/o-i/o/2]},e.prototype._sfmToBasic=function(e){var t,r,n=this._width,i=this._height,o=Math.max(n,i),a=(e[0]+n/o/2)/n*o,s=(e[1]+i/o/2)/i*o;switch(this._orientation){case 1:t=a,r=s;break;case 3:t=1-a,r=1-s;break;case 6:t=1-s,r=a;break;case 8:t=s,r=1-a;break;default:t=a,r=s}return[t,r]},e.prototype._fullPano=function(){return null!=this.gpano&&0===this.gpano.CroppedAreaLeftPixels&&0===this.gpano.CroppedAreaTopPixels&&this.gpano.CroppedAreaImageWidthPixels===this.gpano.FullPanoWidthPixels&&this.gpano.CroppedAreaImageHeightPixels===this.gpano.FullPanoHeightPixels},e.prototype._getValue=function(e,t){return null!=e&&e>0?e:t},e.prototype._getRt=function(e,t){var r=new n.Vector3(e[0],e[1],e[2]),i=r.length();i>0&&r.normalize();var o=new n.Matrix4;return o.makeRotationAxis(r,i),o.setPosition(new n.Vector3(t[0],t[1],t[2])),o},e.prototype._getSrt=function(e,t){var r=e.clone(),i=r.elements;return i[12]=t*i[12],i[13]=t*i[13],i[14]=t*i[14],r.scale(new n.Vector3(t,t,t)),r},e.prototype._normalizedToTextureMatrix=function(){var e=Math.max(this._width,this._height),t=e/this._width,r=e/this._height;switch(this._orientation){case 1:return(new n.Matrix4).set(t,0,0,.5,0,-r,0,.5,0,0,1,0,0,0,0,1);case 3:return(new n.Matrix4).set(-t,0,0,.5,0,r,0,.5,0,0,1,0,0,0,0,1);case 6:return(new n.Matrix4).set(0,-r,0,.5,-t,0,0,.5,0,0,1,0,0,0,0,1);case 8:return(new n.Matrix4).set(0,r,0,.5,t,0,0,.5,0,0,1,0,0,0,0,1);default:return(new n.Matrix4).set(t,0,0,.5,0,-r,0,.5,0,0,1,0,0,0,0,1)}},e}();r.Transform=i},{three:311}],466:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("three"),i=function(){function e(){this._unprojectDepth=200}return e.prototype.basicToCanvas=function(e,t,r,n,i){var o=n.unprojectBasic([e,t],this._unprojectDepth);return this.projectToCanvas(o,r,i)},e.prototype.basicToCanvasSafe=function(e,t,r,n,i){var o=n.unprojectBasic([e,t],this._unprojectDepth),a=this.worldToCamera(o,i);if(a[2]>0)return null;var s=this.cameraToViewport(a,i),u=s[0],c=s[1];return this.viewportToCanvas(u,c,r)},e.prototype.basicToViewport=function(e,t,r,n){var i=r.unprojectBasic([e,t],this._unprojectDepth);return this.projectToViewport(i,n)},e.prototype.cameraToViewport=function(e,t){var r=(new n.Vector3).fromArray(e).applyMatrix4(t.projectionMatrix);return[r.x,r.y]},e.prototype.canvasPosition=function(e,t){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]},e.prototype.canvasToBasic=function(e,t,r,n,i){var o=this.unprojectFromCanvas(e,t,r,i).toArray();return n.projectBasic(o)},e.prototype.canvasToViewport=function(e,t,r){var n=this.containerToCanvas(r);return[2*e/n[0]-1,1-2*t/n[1]]},e.prototype.containerToCanvas=function(e){return[e.offsetWidth,e.offsetHeight]},e.prototype.getBasicDistances=function(e,t){var r=this.viewportToBasic(-1,1,e,t),n=this.viewportToBasic(1,1,e,t),i=this.viewportToBasic(1,-1,e,t),o=this.viewportToBasic(-1,-1,e,t),a=0,s=0,u=0,c=0;return r[1]<0&&n[1]<0&&(a=r[1]>n[1]?-r[1]:-n[1]),n[0]>1&&i[0]>1&&(s=n[0]<i[0]?n[0]-1:i[0]-1),i[1]>1&&o[1]>1&&(u=i[1]<o[1]?i[1]-1:o[1]-1),o[0]<0&&r[0]<0&&(c=o[0]>r[0]?-o[0]:-r[0]),[a,s,u,c]},e.prototype.getPixelDistances=function(e,t,r){var n=this.viewportToBasic(-1,1,t,r),i=this.viewportToBasic(1,1,t,r),o=this.viewportToBasic(1,-1,t,r),a=this.viewportToBasic(-1,-1,t,r),s=0,u=0,c=0,l=0,h=this.containerToCanvas(e),p=h[0],f=h[1];if(n[1]<0&&i[1]<0){d=n[1]>i[1]?n[0]:i[0];s=(v=this.basicToCanvas(d,0,e,t,r))[1]>0?v[1]:0}if(i[0]>1&&o[0]>1){m=i[0]<o[0]?i[1]:o[1];u=(v=this.basicToCanvas(1,m,e,t,r))[0]<p?p-v[0]:0}if(o[1]>1&&a[1]>1){var d=o[1]<a[1]?o[0]:a[0];c=(v=this.basicToCanvas(d,1,e,t,r))[1]<f?f-v[1]:0}if(a[0]<0&&n[0]<0){var m=a[0]>n[0]?a[1]:n[1],v=this.basicToCanvas(0,m,e,t,r);l=v[0]>0?v[0]:0}return[s,u,c,l]},e.prototype.insideElement=function(e,t){var r=t.getBoundingClientRect(),n=r.left+t.clientLeft,i=n+t.clientWidth,o=r.top+t.clientTop,a=o+t.clientHeight;return e.clientX>n&&e.clientX<i&&e.clientY>o&&e.clientY<a},e.prototype.projectToCanvas=function(e,t,r){var n=this.projectToViewport(e,r);return this.viewportToCanvas(n[0],n[1],t)},e.prototype.projectToViewport=function(e,t){var r=new n.Vector3(e[0],e[1],e[2]).project(t);return[r.x,r.y]},e.prototype.unprojectFromCanvas=function(e,t,r,n){var i=this.canvasToViewport(e,t,r);return this.unprojectFromViewport(i[0],i[1],n)},e.prototype.unprojectFromViewport=function(e,t,r){return new n.Vector3(e,t,1).unproject(r)},e.prototype.viewportToBasic=function(e,t,r,i){var o=new n.Vector3(e,t,1).unproject(i).toArray();return r.projectBasic(o)},e.prototype.viewportToCanvas=function(e,t,r){var n=this.containerToCanvas(r);return[n[0]*(e+1)/2,-n[1]*(t-1)/2]},e.prototype.worldToCamera=function(e,t){return new n.Vector3(e[0],e[1],e[2]).applyMatrix4(t.matrixWorldInverse).toArray()},e}();r.ViewportCoords=i,r.default=i},{three:311}],467:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.createFilter=function(e){return new Function("node","return "+this._compile(e)+";")},e.prototype._compile=function(e){if(null==e||e.length<=1)return"true";var t=e[0];return"("+("=="===t?this._compileComparisonOp("===",e[1],e[2],!1):"!="===t?this._compileComparisonOp("!==",e[1],e[2],!1):">"===t||">="===t||"<"===t||"<="===t?this._compileComparisonOp(t,e[1],e[2],!0):"in"===t?this._compileInOp(e[1],e.slice(2)):"!in"===t?this._compileNegation(this._compileInOp(e[1],e.slice(2))):"all"===t?this._compileLogicalOp(e.slice(1),"&&"):"true")+")"},e.prototype._compare=function(e,t){return e<t?-1:e>t?1:0},e.prototype._compileComparisonOp=function(e,t,r,n){var i=this._compilePropertyReference(t),o=JSON.stringify(r);return(n?"typeof "+i+"===typeof "+o+"&&":"")+i+e+o},e.prototype._compileInOp=function(e,t){var r=this._compare;return JSON.stringify(t.sort(r))+".indexOf("+this._compilePropertyReference(e)+")!==-1"},e.prototype._compileLogicalOp=function(e,t){var r=this._compile.bind(this);return e.map(r).join(t)},e.prototype._compileNegation=function(e){return"!("+e+")"},e.prototype._compilePropertyReference=function(e){return"node["+JSON.stringify(e)+"]"},e}();r.FilterCreator=n,r.default=n},{}],468:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rbush"),i=e("underscore"),o=e("rxjs/Subject");e("rxjs/add/observable/from"),e("rxjs/add/operator/catch"),e("rxjs/add/operator/do"),e("rxjs/add/operator/finally"),e("rxjs/add/operator/map"),e("rxjs/add/operator/publish");var a=e("../Edge"),s=e("../Error"),u=e("../Graph"),c=function(){function e(e,t,r,i,s,c){this._apiV3=e,this._cachedPaths={},this._cachedNodes={},this._cachedNodeTiles={},this._cachedSpatialEdges={},this._cachedTiles={},this._cachingFill$={},this._cachingFull$={},this._cachingSequences$={},this._cachingSpatialArea$={},this._cachingTiles$={},this._changed$=new o.Subject,this._defaultAlt=2,this._edgeCalculator=null!=i?i:new a.EdgeCalculator,this._filterCreator=null!=s?s:new u.FilterCreator,this._filter=this._filterCreator.createFilter(void 0),this._graphCalculator=null!=r?r:new u.GraphCalculator,this._configuration=null!=c?c:{maxSequences:50,maxUnusedNodes:100,maxUnusedTiles:20},this._nodes={},this._nodeIndex=null!=t?t:n(16,[".lat",".lon",".lat",".lon"]),this._nodeIndexTiles={},this._nodeToTile={},this._preStored={},this._requiredNodeTiles={},this._requiredSpatialArea={},this._sequences={},this._tilePrecision=7,this._tileThreshold=20}return Object.defineProperty(e.prototype,"changed$",{get:function(){return this._changed$},enumerable:!0,configurable:!0}),e.prototype.cachePath$=function(e){var t=this,r=this.getNode(e);return this._apiV3.pathByBuildingId$(r.building.id).map(function(e){return t._cachedPaths[r.building.id]=i.values(e).map(function(e){return i.values(e)}).reduce(function(e,t){return e.concat(t)},[]).reduce(function(e,t){return e.concat(t)},[]),t._cachedPaths[r.building.id]})},e.prototype.cacheFill$=function(e){var t=this;if(e in this._cachingFull$)throw new s.GraphBeeviewError("Cannot fill node while caching full ("+e+").");if(!this.hasNode(e))throw new s.GraphBeeviewError("Cannot fill node that does not exist in graph ("+e+").");if(e in this._cachingFill$)return this._cachingFill$[e];var r=this.getNode(e);if(r.full)throw new s.GraphBeeviewError("Cannot fill node that is already full ("+e+").");return this._cachingFill$[e]=this._apiV3.imageByKeyFill$([e]).do(function(n){r.full||t._makeFull(r,n[e]),delete t._cachingFill$[e]}).map(function(e){return t}).finally(function(){e in t._cachingFill$&&delete t._cachingFill$[e],t._changed$.next(t)}).publish().refCount(),this._cachingFill$[e]},e.prototype.cacheFull$=function(e){var t=this;if(e in this._cachingFull$)return this._cachingFull$[e];if(this.hasNode(e))throw new s.GraphBeeviewError("Cannot cache full node that already exist in graph ("+e+").");return this._cachingFull$[e]=this._apiV3.imageByKeyFull$([e]).do(function(r){var n=r[e];if(t.hasNode(e))(i=t.getNode(e)).full||t._makeFull(i,n);else{if(null==n.sequence||null==n.sequence.key)throw new s.GraphBeeviewError("Node has no sequence ("+e+").");var i=new u.Node(n);t._makeFull(i,n);var o=t._graphCalculator.encodeH(i.originalLatLon,t._tilePrecision);t._preStore(o,i),t._setNode(i),delete t._cachingFull$[e]}}).map(function(e){return t}).finally(function(){e in t._cachingFull$&&delete t._cachingFull$[e],t._changed$.next(t)}).publish().refCount(),this._cachingFull$[e]},e.prototype.cacheNodeSequence$=function(e){if(!this.hasNode(e))throw new s.GraphBeeviewError("Cannot cache sequence edges of node that does not exist in graph ("+e+").");var t=this.getNode(e);if(t.sequenceKey in this._sequences)throw new s.GraphBeeviewError("Sequence already cached ("+e+"), ("+t.sequenceKey+").");return this._cacheSequence$(t.sequenceKey)},e.prototype.cacheSequence$=function(e){if(e in this._sequences)throw new s.GraphBeeviewError("Sequence already cached ("+e+")");return this._cacheSequence$(e)},e.prototype.cacheSequenceEdges=function(e){var t=this.getNode(e);if(!(t.sequenceKey in this._sequences))throw new s.GraphBeeviewError("Sequence is not cached ("+e+"), ("+t.sequenceKey+")");var r=this._sequences[t.sequenceKey].sequence,n=this._edgeCalculator.computeSequenceEdges(t,r);t.cacheSequenceEdges(n)},e.prototype.cacheSpatialArea$=function(e){var t=this;if(!this.hasNode(e))throw new s.GraphBeeviewError("Cannot cache spatial area of node that does not exist in graph ("+e+").");if(e in this._cachedSpatialEdges)throw new s.GraphBeeviewError("Node already spatially cached ("+e+").");if(!(e in this._requiredSpatialArea))throw new s.GraphBeeviewError("Spatial area not determined ("+e+").");var r=this._requiredSpatialArea[e];if(0===Object.keys(r.cacheNodes).length)throw new s.GraphBeeviewError("Spatial nodes already cached ("+e+").");if(e in this._cachingSpatialArea$)return this._cachingSpatialArea$[e];for(var n=[];r.cacheKeys.length>0;)n.push(r.cacheKeys.splice(0,200));for(var i=n.length,o=[],a=this,u=0,c=n;u<c.length;u++)!function(n){var s=a._apiV3.imageByKeyFill$(n).do(function(n){for(var o in n)if(n.hasOwnProperty(o)){var a=r.cacheNodes[o];if(a.full)delete r.cacheNodes[o];else{var s=n[o];t._makeFull(a,s),delete r.cacheNodes[o]}}0==--i&&delete t._cachingSpatialArea$[e]}).map(function(e){return t}).catch(function(o){for(var a=0,s=n;a<s.length;a++){var u=s[a];u in r.all&&delete r.all[u],u in r.cacheNodes&&delete r.cacheNodes[u]}throw 0==--i&&delete t._cachingSpatialArea$[e],o}).finally(function(){0===Object.keys(r.cacheNodes).length&&t._changed$.next(t)}).publish().refCount();o.push(s)}(c[u]);return this._cachingSpatialArea$[e]=o,o},e.prototype.cacheSpatialEdges=function(e){if(e in this._cachedSpatialEdges)throw new s.GraphBeeviewError("Spatial edges already cached ("+e+").");var t=this.getNode(e),r=this._sequences[t.sequenceKey].sequence,n=[],i=r.findPrevKey(t.key);null!=i&&n.push(i);var o=r.findNextKey(t.key);null!=o&&n.push(o);var a=this._requiredSpatialArea[e].all,u=[],c=this._filter;for(var l in a)if(a.hasOwnProperty(l)){var h=a[l];c(h)&&u.push(h)}var p=this._edgeCalculator.getPotentialEdges(t,u,n),f=this._edgeCalculator.computeStepEdges(t,p,i,o);f=(f=(f=(f=f.concat(this._edgeCalculator.computeTurnEdges(t,p))).concat(this._edgeCalculator.computePanoEdges(t,p))).concat(this._edgeCalculator.computePerspectiveToPanoEdges(t,p))).concat(this._edgeCalculator.computeSimilarEdges(t,p)),t.cacheSpatialEdges(f),this._cachedSpatialEdges[e]=t,delete this._requiredSpatialArea[e],delete this._cachedNodeTiles[e]},e.prototype.cacheTiles$=function(e){var t=this;if(e in this._cachedNodeTiles)throw new s.GraphBeeviewError("Tiles already cached ("+e+").");if(e in this._cachedSpatialEdges)throw new s.GraphBeeviewError("Spatial edges already cached so tiles considered cached ("+e+").");if(!(e in this._requiredNodeTiles))throw new s.GraphBeeviewError("Tiles have not been determined ("+e+").");var r=this._requiredNodeTiles[e];if(0===r.cache.length&&0===r.caching.length)throw new s.GraphBeeviewError("Tiles already cached ("+e+").");if(!this.hasNode(e))throw new s.GraphBeeviewError("Cannot cache tiles of node that does not exist in graph ("+e+").");var n=r.cache.slice();r.caching=this._requiredNodeTiles[e].caching.concat(n),r.cache=[];for(var i=[],o=this,a=0,c=r.caching;a<c.length;a++)!function(n){var a=null;n in o._cachingTiles$?a=o._cachingTiles$[n]:(a=o._apiV3.imagesByH$([n]).do(function(e){var r=e[n];if(!(n in t._cachedTiles)){t._nodeIndexTiles[n]=[],t._cachedTiles[n]={accessed:(new Date).getTime(),nodes:[]};var i=t._cachedTiles[n].nodes,o=t._removeFromPreStore(n);for(var a in r)if(r.hasOwnProperty(a)){var s=r[a];if(null==s)break;if(null!=s.sequence&&null!=s.sequence.key)if(null!=o&&s.key in o){var c=o[s.key];delete o[s.key],i.push(c);var l={lat:c.latLon.lat,lon:c.latLon.lon,node:c};t._nodeIndex.insert(l),t._nodeIndexTiles[n].push(l),t._nodeToTile[c.key]=n}else{var h=new u.Node(s);i.push(h);var p={lat:h.latLon.lat,lon:h.latLon.lon,node:h};t._nodeIndex.insert(p),t._nodeIndexTiles[n].push(p),t._nodeToTile[h.key]=n,t._setNode(h)}else console.warn("Sequence missing, discarding ("+s.key+")")}delete t._cachingTiles$[n]}}).map(function(e){return t}).catch(function(e){throw delete t._cachingTiles$[n],e}).publish().refCount(),o._cachingTiles$[n]=a),i.push(a.do(function(i){var o=r.caching.indexOf(n);o>-1&&r.caching.splice(o,1),0===r.caching.length&&0===r.cache.length&&(delete t._requiredNodeTiles[e],t._cachedNodeTiles[e]=!0)}).catch(function(i){var o=r.caching.indexOf(n);throw o>-1&&r.caching.splice(o,1),0===r.caching.length&&0===r.cache.length&&(delete t._requiredNodeTiles[e],t._cachedNodeTiles[e]=!0),i}).finally(function(){t._changed$.next(t)}).publish().refCount())}(c[a]);return i},e.prototype.initializeCache=function(e){if(e in this._cachedNodes)throw new s.GraphBeeviewError("Node already in cache ("+e+").");var t=this.getNode(e);t.initializeCache(new u.NodeCache);var r=(new Date).getTime();this._cachedNodes[e]={accessed:r,node:t},this._updateCachedTileAccess(e,r)},e.prototype.isCachingFill=function(e){return e in this._cachingFill$},e.prototype.isCachingFull=function(e){return e in this._cachingFull$},e.prototype.isCachingNodeSequence=function(e){return this.getNode(e).sequenceKey in this._cachingSequences$},e.prototype.isCachingSequence=function(e){return e in this._cachingSequences$},e.prototype.isCachingTiles=function(e){return e in this._requiredNodeTiles&&0===this._requiredNodeTiles[e].cache.length&&this._requiredNodeTiles[e].caching.length>0},e.prototype.hasInitializedCache=function(e){return e in this._cachedNodes},e.prototype.hasCachedPaths=function(e){return e in this._cachedPaths},e.prototype.getCachedPaths=function(e){return this._cachedPaths[e]},e.prototype.hasNode=function(e){var t=(new Date).getTime();return this._updateCachedNodeAccess(e,t),this._updateCachedTileAccess(e,t),e in this._nodes},e.prototype.hasNodeSequence=function(e){var t=this.getNode(e).sequenceKey,r=t in this._sequences;return r&&(this._sequences[t].accessed=(new Date).getTime()),r},e.prototype.hasSequence=function(e){var t=e in this._sequences;return t&&(this._sequences[e].accessed=(new Date).getTime()),t},e.prototype.hasSpatialArea=function(e){if(!this.hasNode(e))throw new s.GraphBeeviewError("Spatial area nodes cannot be determined if node not in graph ("+e+").");if(e in this._cachedSpatialEdges)return!0;if(e in this._requiredSpatialArea)return 0===Object.keys(this._requiredSpatialArea[e].cacheNodes).length;for(var t=this.getNode(e),r=this._graphCalculator.boundingBoxCorners(t.latLon,this._tileThreshold),n={all:{},cacheKeys:[],cacheNodes:{}},i=0,o=this._nodeIndex.search({maxX:r[1].lat,maxY:r[1].lon,minX:r[0].lat,minY:r[0].lon});i<o.length;i++){var a=o[i];n.all[a.node.key]=a.node,a.node.full||(n.cacheKeys.push(a.node.key),n.cacheNodes[a.node.key]=a.node)}return this._requiredSpatialArea[e]=n,0===n.cacheKeys.length},e.prototype.hasTiles=function(e){var t=this;if(e in this._cachedNodeTiles)return!0;if(e in this._cachedSpatialEdges)return!0;if(!this.hasNode(e))throw new s.GraphBeeviewError("Node does not exist in graph ("+e+").");var r={cache:[],caching:[]};if(e in this._requiredNodeTiles)r=this._requiredNodeTiles[e];else{var n=this.getNode(e);r.cache=this._graphCalculator.encodeHs(n.latLon,this._tilePrecision,this._tileThreshold).filter(function(e){return!(e in t._cachedTiles)}),r.cache.length>0&&(this._requiredNodeTiles[e]=r)}return 0===r.cache.length&&0===r.caching.length},e.prototype.getNode=function(e){var t=(new Date).getTime();return this._updateCachedNodeAccess(e,t),this._updateCachedTileAccess(e,t),this._nodes[e]},e.prototype.getSequence=function(e){var t=this._sequences[e];return t.accessed=(new Date).getTime(),t.sequence},e.prototype.resetSpatialEdges=function(){for(var e=0,t=Object.keys(this._cachedSpatialEdges);e<t.length;e++){var r=t[e];this._cachedSpatialEdges[r].resetSpatialEdges(),delete this._cachedSpatialEdges[r]}},e.prototype.reset=function(e){for(var t=[],r=0,n=e;r<n.length;r++){var i=n[r];if(!this.hasNode(i))throw new Error("Node does not exist "+i);(l=this.getNode(i)).resetSequenceEdges(),l.resetSpatialEdges(),t.push(l)}for(var o=0,a=Object.keys(this._cachedNodes);o<a.length;o++){var s=a[o];-1===e.indexOf(s)&&(this._cachedNodes[s].node.dispose(),delete this._cachedNodes[s])}this._cachedNodeTiles={},this._cachedSpatialEdges={},this._cachedTiles={},this._cachingFill$={},this._cachingFull$={},this._cachingSequences$={},this._cachingSpatialArea$={},this._cachingTiles$={},this._nodes={},this._nodeToTile={},this._preStored={};for(var u=0,c=t;u<c.length;u++){var l=c[u];this._nodes[l.key]=l;var h=this._graphCalculator.encodeH(l.originalLatLon,this._tilePrecision);this._preStore(h,l)}this._requiredNodeTiles={},this._requiredSpatialArea={},this._sequences={},this._nodeIndexTiles={},this._nodeIndex.clear()},e.prototype.setFilter=function(e){this._filter=this._filterCreator.createFilter(e)},e.prototype.uncache=function(e){var t={};this._addNewKeys(t,this._cachingFull$),this._addNewKeys(t,this._cachingFill$),this._addNewKeys(t,this._cachingTiles$),this._addNewKeys(t,this._cachingSpatialArea$),this._addNewKeys(t,this._requiredNodeTiles),this._addNewKeys(t,this._requiredSpatialArea);for(var r=0,n=e;r<n.length;r++)(o=n[r])in t||(t[o]=!0);var i={};for(var o in t)if(t.hasOwnProperty(o))for(var a=this._nodes[o],s=0,u=this._graphCalculator.encodeHs(a.latLon);s<u.length;s++){var c=u[s];c in i||(i[c]=!0)}var l=[];for(var h in this._cachedTiles)!this._cachedTiles.hasOwnProperty(h)||h in i||l.push([h,this._cachedTiles[h]]);for(var p=0,f=l.sort(function(e,t){return t[1].accessed-e[1].accessed}).slice(this._configuration.maxUnusedTiles).map(function(e){return e[0]});p<f.length;p++){var d=f[p];this._uncacheTile(d)}var m=[];for(var o in this._cachedNodes)!this._cachedNodes.hasOwnProperty(o)||o in t||m.push(this._cachedNodes[o]);for(var v=0,y=m.sort(function(e,t){return t.accessed-e.accessed}).slice(this._configuration.maxUnusedNodes);v<y.length;v++){var g=y[v];g.node.uncache();o=g.node.key;delete this._cachedNodes[o],o in this._cachedNodeTiles&&delete this._cachedNodeTiles[o],o in this._cachedSpatialEdges&&delete this._cachedSpatialEdges[o]}var b=[];for(var _ in this._sequences)!this._sequences.hasOwnProperty(_)||_ in this._cachingSequences$||b.push(this._sequences[_]);for(var x=0,w=b.sort(function(e,t){return t.accessed-e.accessed}).slice(this._configuration.maxSequences);x<w.length;x++){var S=w[x],_=S.sequence.key;delete this._sequences[_],S.sequence.dispose()}},e.prototype._addNewKeys=function(e,t){for(var r in t)t.hasOwnProperty(r)&&this.hasNode(r)&&(r in e||(e[r]=!0))},e.prototype._cacheSequence$=function(e){var t=this;return e in this._cachingSequences$?this._cachingSequences$[e]:(this._cachingSequences$[e]=this._apiV3.sequenceByKey$([e]).do(function(r){e in t._sequences||(t._sequences[e]={accessed:(new Date).getTime(),sequence:new u.Sequence(r[e])}),delete t._cachingSequences$[e]}).map(function(e){return t}).finally(function(){e in t._cachingSequences$&&delete t._cachingSequences$[e],t._changed$.next(t)}).publish().refCount(),this._cachingSequences$[e])},e.prototype._makeFull=function(e,t){null==t.calt&&(t.calt=this._defaultAlt),null==t.c_rotation&&(t.c_rotation=this._graphCalculator.rotationFromCompass(t.ca,t.orientation)),e.makeFull(t)},e.prototype._preStore=function(e,t){e in this._preStored||(this._preStored[e]={}),this._preStored[e][t.key]=t},e.prototype._removeFromPreStore=function(e){var t=null;return e in this._preStored&&(t=this._preStored[e],delete this._preStored[e]),t},e.prototype._setNode=function(e){var t=e.key;this.hasNode(t)||(this._nodes[t]=e)},e.prototype._uncacheTile=function(e){for(var t=0,r=this._cachedTiles[e].nodes;t<r.length;t++){var n=r[t],i=n.key;delete this._nodes[i],delete this._nodeToTile[i],i in this._cachedNodes&&delete this._cachedNodes[i],i in this._cachedNodeTiles&&delete this._cachedNodeTiles[i],i in this._cachedSpatialEdges&&delete this._cachedSpatialEdges[i],n.dispose()}for(var o=0,a=this._nodeIndexTiles[e];o<a.length;o++){var s=a[o];this._nodeIndex.remove(s)}delete this._nodeIndexTiles[e],delete this._cachedTiles[e]},e.prototype._updateCachedTileAccess=function(e,t){e in this._nodeToTile&&(this._cachedTiles[this._nodeToTile[e]].accessed=t)},e.prototype._updateCachedNodeAccess=function(e,t){e in this._cachedNodes&&(this._cachedNodes[e].accessed=t)},e}();r.Graph=c,r.default=c},{"../Edge":366,"../Error":367,"../Graph":369,rbush:153,"rxjs/Subject":162,"rxjs/add/observable/from":169,"rxjs/add/operator/catch":180,"rxjs/add/operator/do":187,"rxjs/add/operator/finally":190,"rxjs/add/operator/map":193,"rxjs/add/operator/publish":199,underscore:313}],469:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("latlon-geohash"),i=e("three"),o=e("../Geo"),a=function(){function e(){}return e.n="n",e.nw="nw",e.w="w",e.sw="sw",e.s="s",e.se="se",e.e="e",e.ne="ne",e}(),s=function(){function e(e){this._geoCoords=null!=e?e:new o.GeoCoords}return e.prototype.encodeH=function(e,t){return void 0===t&&(t=7),n.encode(e.lat,e.lon,t)},e.prototype.encodeHs=function(e,t,r){void 0===t&&(t=7),void 0===r&&(r=20);var i=n.encode(e.lat,e.lon,t),o=n.bounds(i),s=o.ne,u=o.sw,c=n.neighbours(i),l=[0,0,0],h=this._geoCoords.geodeticToEnu(s.lat,s.lon,0,u.lat,u.lon,0),p=this._geoCoords.geodeticToEnu(e.lat,e.lon,0,u.lat,u.lon,0),f=p[0]-l[0]<r,d=h[0]-p[0]<r,m=p[1]-l[1]<r,v=h[1]-p[1]<r,y=[i];return v&&y.push(c[a.n]),v&&f&&y.push(c[a.nw]),f&&y.push(c[a.w]),f&&m&&y.push(c[a.sw]),m&&y.push(c[a.s]),m&&d&&y.push(c[a.se]),d&&y.push(c[a.e]),d&&v&&y.push(c[a.ne]),y},e.prototype.boundingBoxCorners=function(e,t){var r=this._geoCoords.enuToGeodetic(-t,-t,0,e.lat,e.lon,0),n=this._geoCoords.enuToGeodetic(t,t,0,e.lat,e.lon,0);return[{lat:r[0],lon:r[1]},{lat:n[0],lon:n[1]}]},e.prototype.rotationFromCompass=function(e,t){var r=0,n=0,o=0;switch(t){case 1:r=Math.PI/2;break;case 3:r=-Math.PI/2,o=Math.PI;break;case 6:n=-Math.PI/2,o=-Math.PI/2;break;case 8:n=Math.PI/2,o=Math.PI/2}var a=(new i.Matrix4).makeRotationZ(o),s=new i.Euler(r,n,e*Math.PI/180,"XYZ"),u=(new i.Matrix4).makeRotationFromEuler(s),c=(new i.Vector4).setAxisAngleFromRotationMatrix(u.multiply(a));return c.multiplyScalar(c.w).toArray().slice(0,3)},e}();r.GraphCalculator=s,r.default=s},{"../Geo":368,"latlon-geohash":145,three:311}],470:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/Observable"),i=e("rxjs/Subject");e("rxjs/add/operator/catch"),e("rxjs/add/operator/concat"),e("rxjs/add/operator/do"),e("rxjs/add/operator/expand"),e("rxjs/add/operator/finally"),e("rxjs/add/operator/first"),e("rxjs/add/operator/last"),e("rxjs/add/operator/map"),e("rxjs/add/operator/mergeMap"),e("rxjs/add/operator/publishReplay");var o=function(){function e(e,t){this._graph$=n.Observable.of(e).concat(e.changed$).publishReplay(1).refCount(),this._graph$.subscribe(function(){}),this._imageLoadingService=t,this._firstGraphSubjects$=[],this._initializeCacheSubscriptions=[],this._sequenceSubscriptions=[],this._spatialSubscriptions=[]}return e.prototype.cachePath$=function(e){var t=this,r=this._graph$.first().mergeMap(function(t){var r=t.getNode(e);return t.hasCachedPaths(r.building.id)?n.Observable.of(t.getCachedPaths(r.building.id)):t.cachePath$(e)}).publishReplay(1).refCount();return r.subscribe(function(e){t._imageLoadingService.loadpath$.next(e)},function(t){console.error("Failed to cache path ("+e+")",t)}),r},e.prototype.cacheNode$=function(e){var t=this,r=new i.Subject;this._firstGraphSubjects$.push(r);var o=r.publishReplay(1).refCount(),a=o.map(function(t){return t.getNode(e)}).mergeMap(function(e){return e.assetsCached?n.Observable.of(e):e.cacheAssets$()}).publishReplay(1).refCount();a.subscribe(function(e){t._imageLoadingService.loadnode$.next(e)},function(t){console.error("Failed to cache node ("+e+")",t)});var s=this._graph$.first().mergeMap(function(t){return t.isCachingFull(e)||!t.hasNode(e)?t.cacheFull$(e):t.isCachingFill(e)||!t.getNode(e).full?t.cacheFill$(e):n.Observable.of(t)}).do(function(t){t.hasInitializedCache(e)||t.initializeCache(e)}).finally(function(){null!=s&&(t._removeFromArray(s,t._initializeCacheSubscriptions),t._removeFromArray(r,t._firstGraphSubjects$))}).subscribe(function(e){r.next(e),r.complete()},function(e){r.error(e)});s.closed||this._initializeCacheSubscriptions.push(s);var u=o.mergeMap(function(t){return t.isCachingNodeSequence(e)||!t.hasNodeSequence(e)?t.cacheNodeSequence$(e):n.Observable.of(t)}).do(function(t){t.getNode(e).sequenceEdges.cached||t.cacheSequenceEdges(e)}).finally(function(){null!=u&&t._removeFromArray(u,t._sequenceSubscriptions)}).subscribe(function(e){},function(t){console.error("Failed to cache sequence edges ("+e+").",t)});u.closed||this._sequenceSubscriptions.push(u);var c=o.expand(function(t){return t.hasTiles(e)?n.Observable.empty():n.Observable.from(t.cacheTiles$(e)).mergeMap(function(t){return t.mergeMap(function(t){return t.isCachingTiles(e)?n.Observable.empty():n.Observable.of(t)}).catch(function(t,r){return console.error("Failed to cache tile data ("+e+").",t),n.Observable.empty()})})}).last().mergeMap(function(t){return t.hasSpatialArea(e)?n.Observable.of(t):n.Observable.from(t.cacheSpatialArea$(e)).mergeMap(function(t){return t.catch(function(t,r){return console.error("Failed to cache spatial nodes ("+e+").",t),n.Observable.empty()})})}).last().mergeMap(function(t){return t.hasNodeSequence(e)?n.Observable.of(t):t.cacheNodeSequence$(e)}).do(function(t){t.getNode(e).spatialEdges.cached||t.cacheSpatialEdges(e)}).finally(function(){null!=c&&t._removeFromArray(c,t._spatialSubscriptions)}).subscribe(function(e){},function(t){console.error("Failed to cache spatial edges ("+e+").",t)});return c.closed||this._spatialSubscriptions.push(c),a.first(function(e){return e.assetsCached})},e.prototype.cacheSequence$=function(e){return this._graph$.first().mergeMap(function(t){return t.isCachingSequence(e)||!t.hasSequence(e)?t.cacheSequence$(e):n.Observable.of(t)}).map(function(t){return t.getSequence(e)})},e.prototype.setFilter$=function(e){return this._resetSubscriptions(this._spatialSubscriptions),this._graph$.first().do(function(t){t.resetSpatialEdges(),t.setFilter(e)})},e.prototype.reset$=function(e){return this._abortSubjects(this._firstGraphSubjects$),this._resetSubscriptions(this._initializeCacheSubscriptions),this._resetSubscriptions(this._sequenceSubscriptions),this._resetSubscriptions(this._spatialSubscriptions),this._graph$.first().do(function(t){t.reset(e)})},e.prototype.uncache$=function(e){return this._graph$.first().do(function(t){t.uncache(e)})},e.prototype._abortSubjects=function(e){for(var t=0,r=e.slice();t<r.length;t++){var n=r[t];this._removeFromArray(n,e),n.error(new Error("Cache node request was aborted."))}},e.prototype._removeFromArray=function(e,t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)},e.prototype._resetSubscriptions=function(e){for(var t=0,r=e.slice();t<r.length;t++){var n=r[t];this._removeFromArray(n,e),n.closed||n.unsubscribe()}},e}();r.GraphService=o,r.default=o},{"rxjs/Observable":157,"rxjs/Subject":162,"rxjs/add/operator/catch":180,"rxjs/add/operator/concat":182,"rxjs/add/operator/do":187,"rxjs/add/operator/expand":188,"rxjs/add/operator/finally":190,"rxjs/add/operator/first":191,"rxjs/add/operator/last":192,"rxjs/add/operator/map":193,"rxjs/add/operator/mergeMap":196,"rxjs/add/operator/publishReplay":200}],471:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/Subject"),i=function(){function e(){this._loadnode$=new n.Subject,this._loadpath$=new n.Subject,this._loadstatus$=this._loadnode$.scan(function(e,t){return e[t.key]=t.loadStatus,e},{}).publishReplay(1).refCount(),this._loadpath$.subscribe(function(){}),this._loadstatus$.subscribe(function(){})}return Object.defineProperty(e.prototype,"loadpath$",{get:function(){return this._loadpath$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loadnode$",{get:function(){return this._loadnode$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loadstatus$",{get:function(){return this._loadstatus$},enumerable:!0,configurable:!0}),e}();r.ImageLoadingService=i},{"rxjs/Subject":162}],472:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("pbf"),i=function(){function e(){}return e.read=function(t){return new n(t).readFields(e._readMeshField,{faces:[],vertices:[]})},e._readMeshField=function(e,t,r){1===e?t.vertices.push(r.readFloat()):2===e&&t.faces.push(r.readVarint())},e}();r.MeshReader=i},{pbf:151}],473:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),e("rxjs/add/observable/combineLatest"),e("rxjs/add/operator/map");var n=function(){function e(e){this._cache=null,this._core=e,this._fill=null}return Object.defineProperty(e.prototype,"assetsCached",{get:function(){return null!=this._core&&null!=this._fill&&null!=this._cache&&null!=this._cache.image&&null!=this._cache.mesh},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cache",{get:function(){return this._cache},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alt",{get:function(){return this._fill.calt},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ca",{get:function(){return null!=this._fill.cca?this._fill.cca:this._fill.ca},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"capturedAt",{get:function(){return this._fill.captured_at},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"computedCA",{get:function(){return this._fill.cca},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"computedLatLon",{get:function(){return this._core.cl},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"focal",{get:function(){return this._fill.cfocal},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"full",{get:function(){return null!=this._fill},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fullPano",{get:function(){return null!=this._fill.gpano&&0===this._fill.gpano.CroppedAreaLeftPixels&&0===this._fill.gpano.CroppedAreaTopPixels&&this._fill.gpano.CroppedAreaImageWidthPixels===this._fill.gpano.FullPanoWidthPixels&&this._fill.gpano.CroppedAreaImageHeightPixels===this._fill.gpano.FullPanoHeightPixels},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gpano",{get:function(){return this._fill.gpano},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._fill.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"image",{get:function(){return this._cache.image},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return this._core.key},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"latLon",{get:function(){return null!=this._core.l?this._core.l:this._core.cl},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loadStatus",{get:function(){return this._cache.loadStatus},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"merged",{get:function(){return null!=this._fill&&null!=this._fill.merge_version&&this._fill.merge_version>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mergeCC",{get:function(){return this._fill.merge_cc},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mergeVersion",{get:function(){return this._fill.merge_version},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mesh",{get:function(){return this._cache.mesh},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._fill.orientation},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalCA",{get:function(){return this._fill.ca},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalLatLon",{get:function(){return this._core.l},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pano",{get:function(){return null!=this._fill.gpano&&null!=this._fill.gpano.FullPanoWidthPixels},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"projectKey",{get:function(){return null!=this._fill.project?this._fill.project.key:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this._fill.c_rotation},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"translation",{get:function(){return this._fill.c_translation},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this._fill.atomic_scale},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sequenceKey",{get:function(){return this._core.sequence.key},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sequenceEdges",{get:function(){return this._cache.sequenceEdges},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sequenceEdges$",{get:function(){return this._cache.sequenceEdges$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spatialEdges",{get:function(){return this._cache.spatialEdges},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spatialEdges$",{get:function(){return this._cache.spatialEdges$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"userKey",{get:function(){return this._fill.user.key},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"username",{get:function(){return this._fill.user.username},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tags",{get:function(){return this._fill.tags},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this._fill.width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"floor",{get:function(){return this._fill.floor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"building",{get:function(){return this._fill.building},enumerable:!0,configurable:!0}),e.prototype.cacheAssets$=function(){var e=this;return this._cache.cacheAssets$(this.key,this.pano,this.merged).map(function(t){return e})},e.prototype.cacheImage$=function(e){var t=this;return this._cache.cacheImage$(this.key,e).map(function(e){return t})},e.prototype.cacheSequenceEdges=function(e){this._cache.cacheSequenceEdges(e)},e.prototype.cacheSpatialEdges=function(e){this._cache.cacheSpatialEdges(e)},e.prototype.dispose=function(){null!=this._cache&&(this._cache.dispose(),this._cache=null),this._core=null,this._fill=null},e.prototype.initializeCache=function(e){if(null!=this._cache)throw new Error("Node cache already initialized ("+this.key+").");this._cache=e},e.prototype.makeFull=function(e){if(null==e)throw new Error("Fill can not be null.");this._fill=e},e.prototype.resetSequenceEdges=function(){this._cache.resetSequenceEdges()},e.prototype.resetSpatialEdges=function(){this._cache.resetSpatialEdges()},e.prototype.uncache=function(){null!=this._cache&&(this._cache.dispose(),this._cache=null)},e}();r.Node=n,r.default=n},{"rxjs/add/observable/combineLatest":166,"rxjs/add/operator/map":193}],474:[function(e,t,r){(function(t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/Subject"),i=e("rxjs/Observable");e("rxjs/add/observable/combineLatest"),e("rxjs/add/operator/publishReplay");var o=e("../Graph"),a=e("../Utils"),s=function(){function e(){this._disposed=!1,this._image=null,this._loadStatus={loaded:0,total:0},this._mesh=null,this._sequenceEdges={cached:!1,edges:[]},this._spatialEdges={cached:!1,edges:[]},this._sequenceEdgesChanged$=new n.Subject,this._sequenceEdges$=this._sequenceEdgesChanged$.startWith(this._sequenceEdges).publishReplay(1).refCount(),this._sequenceEdgesSubscription=this._sequenceEdges$.subscribe(function(){}),this._spatialEdgesChanged$=new n.Subject,this._spatialEdges$=this._spatialEdgesChanged$.startWith(this._spatialEdges).publishReplay(1).refCount(),this._spatialEdgesSubscription=this._spatialEdges$.subscribe(function(){}),this._cachingAssets$=null}return Object.defineProperty(e.prototype,"image",{get:function(){return this._image},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loadStatus",{get:function(){return this._loadStatus},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mesh",{get:function(){return this._mesh},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sequenceEdges",{get:function(){return this._sequenceEdges},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sequenceEdges$",{get:function(){return this._sequenceEdges$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spatialEdges",{get:function(){return this._spatialEdges},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spatialEdges$",{get:function(){return this._spatialEdges$},enumerable:!0,configurable:!0}),e.prototype.cacheAssets$=function(e,t,r){var n=this;if(null!=this._cachingAssets$)return this._cachingAssets$;var o=t?a.Settings.basePanoramaSize:a.Settings.baseImageSize;return this._cachingAssets$=i.Observable.combineLatest(this._cacheImage$(e,o),function(e){return n._loadStatus.loaded=0,n._loadStatus.total=0,n._mesh={faces:[],vertices:[]},e&&(n._image=e.object,n._loadStatus.loaded+=e.loaded.loaded,n._loadStatus.total+=e.loaded.total),n}).finally(function(){n._cachingAssets$=null}).publishReplay(1).refCount(),this._cachingAssets$},e.prototype.cacheImage$=function(e,t){var r=this;return null!=this._image&&t<=Math.max(this._image.width,this._image.height)?i.Observable.of(this):this._cacheImage$(e,t).first(function(e){return null!=e.object}).do(function(e){r._disposeImage(),r._image=e.object}).map(function(e){return r})},e.prototype.cacheSequenceEdges=function(e){this._sequenceEdges={cached:!0,edges:e},this._sequenceEdgesChanged$.next(this._sequenceEdges)},e.prototype.cacheSpatialEdges=function(e){this._spatialEdges={cached:!0,edges:e},this._spatialEdgesChanged$.next(this._spatialEdges)},e.prototype.dispose=function(){this._sequenceEdgesSubscription.unsubscribe(),this._spatialEdgesSubscription.unsubscribe(),this._disposeImage(),this._mesh=null,this._loadStatus.loaded=0,this._loadStatus.total=0,this._sequenceEdges={cached:!1,edges:[]},this._spatialEdges={cached:!1,edges:[]},this._sequenceEdgesChanged$.next(this._sequenceEdges),this._spatialEdgesChanged$.next(this._spatialEdges),this._disposed=!0,null!=this._imageRequest&&this._imageRequest.abort(),null!=this._meshRequest&&this._meshRequest.abort()},e.prototype.resetSequenceEdges=function(){this._sequenceEdges={cached:!1,edges:[]},this._sequenceEdgesChanged$.next(this._sequenceEdges)},e.prototype.resetSpatialEdges=function(){this._spatialEdges={cached:!1,edges:[]},this._spatialEdgesChanged$.next(this._spatialEdges)},e.prototype._cacheImage$=function(e,t){var r=this;return i.Observable.create(function(n){var i=new XMLHttpRequest;i.open("GET",a.Urls.thumbnail(e,t),!0),i.responseType="arraybuffer",i.timeout=15e3,i.onload=function(t){if(200!==i.status)return r._imageRequest=null,void n.error(new Error("Failed to fetch image ("+e+"). Status: "+i.status+", "+i.statusText));var o=new Image;o.crossOrigin="Anonymous",o.onload=function(i){if(r._imageRequest=null,r._disposed)return window.URL.revokeObjectURL(o.src),void n.error(new Error("Image load was aborted ("+e+")"));n.next({loaded:{loaded:t.loaded,total:t.total},object:o}),n.complete()},o.onerror=function(t){r._imageRequest=null,n.error(new Error("Failed to load image ("+e+")"))};var a=new Blob([i.response]);o.src=window.URL.createObjectURL(a)},i.onprogress=function(e){r._disposed||n.next({loaded:{loaded:e.loaded,total:e.total},object:null})},i.onerror=function(t){r._imageRequest=null,n.error(new Error("Failed to fetch image ("+e+")"))},i.ontimeout=function(t){r._imageRequest=null,n.error(new Error("Image request timed out ("+e+")"))},i.onabort=function(t){r._imageRequest=null,n.error(new Error("Image request was aborted ("+e+")"))},r._imageRequest=i,i.send(null)})},e.prototype._cacheMesh$=function(e,r){var n=this;return i.Observable.create(function(i){if(!r)return i.next(n._createEmptyMeshLoadStatus()),void i.complete();var s=new XMLHttpRequest;s.open("GET",a.Urls.protoMesh(e),!0),s.responseType="arraybuffer",s.timeout=15e3,s.onload=function(e){if(n._meshRequest=null,!n._disposed){200===s.status&&o.MeshReader.read(new t(s.response));i.next({loaded:{loaded:e.loaded,total:e.total},object:{faces:[],vertices:[]}}),i.complete()}},s.onprogress=function(e){n._disposed||i.next({loaded:{loaded:e.loaded,total:e.total},object:null})},s.onerror=function(e){n._meshRequest=null,i.next(n._createEmptyMeshLoadStatus()),i.complete()},s.ontimeout=function(e){n._meshRequest=null,i.next(n._createEmptyMeshLoadStatus()),i.complete()},s.onabort=function(e){n._meshRequest=null},n._meshRequest=s,s.send(null)})},e.prototype._createEmptyMeshLoadStatus=function(){return{loaded:{loaded:0,total:0},object:{faces:[],vertices:[]}}},e.prototype._disposeImage=function(){null!=this._image&&window.URL.revokeObjectURL(this._image.src),this._image=null},e}();r.NodeCache=s,r.default=s}).call(this,e("buffer").Buffer)},{"../Graph":369,"../Utils":374,buffer:18,"rxjs/Observable":157,"rxjs/Subject":162,"rxjs/add/observable/combineLatest":166,"rxjs/add/operator/publishReplay":200}],475:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("underscore"),i=function(){function e(e){this._key=e.key,this._keys=e.keys,this._country=e.country,this._city=e.city,this._building=e.building,this._floor=e.floor,this._loopLine=e.loop_line}return Object.defineProperty(e.prototype,"key",{get:function(){return this._key},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"keys",{get:function(){return this._keys},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"country",{get:function(){return this._country},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"city",{get:function(){return this._city},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"building",{get:function(){return this._building},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"floor",{get:function(){return this._floor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"floorVersion",{get:function(){return this._loopLine},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._key=null,this._keys=null},e.prototype.findNextKey=function(e){var t=n.indexOf(this._keys,e);return t+1>=this._keys.length||-1===t?null:this._keys[t+1]},e.prototype.findPrevKey=function(e){var t=n.indexOf(this._keys,e);return 0===t||-1===t?null:this._keys[t-1]},e}();r.Sequence=i,r.default=i},{underscore:313}],476:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("three"),i=e("../../Edge"),o=e("../../Error"),a=e("../../Geo"),s=function(){function e(e,t,r){this._spatial=new a.Spatial,this._geoCoords=new a.GeoCoords,this._settings=null!=e?e:new i.EdgeCalculatorSettings,this._directions=null!=t?t:new i.EdgeCalculatorDirections,this._coefficients=null!=r?r:new i.EdgeCalculatorCoefficients}return e.prototype.getPotentialEdges=function(e,t,r){if(!e.full)throw new o.ArgumentBeeviewError("Node has to be full.");if(!e.merged)return[];for(var i=this._spatial.viewingDirection(e.rotation),a=this._spatial.angleToPlane(i.toArray(),[0,0,1]),s=[],u=0,c=t;u<c.length;u++){var l=c[u];if(l.merged&&l.key!==e.key){var h=this._geoCoords.geodeticToEnu(l.latLon.lat,l.latLon.lon,l.alt,e.latLon.lat,e.latLon.lon,e.alt),p=new n.Vector3(h[0],h[1],h[2]),f=p.length();if(!(f>this._settings.maxDistance&&r.indexOf(l.key)<0)){var d=this._spatial.angleBetweenVector2(i.x,i.y,p.x,p.y),m=this._spatial.angleToPlane(p.toArray(),[0,0,1]),v=this._spatial.viewingDirection(l.rotation),y=this._spatial.angleBetweenVector2(i.x,i.y,v.x,v.y),g=this._spatial.angleToPlane(v.toArray(),[0,0,1])-a,b=this._spatial.relativeRotationAngle(e.rotation,l.rotation),_=this._spatial.angleBetweenVector2(1,0,p.x,p.y),x=null!=l.sequenceKey&&null!=e.sequenceKey&&l.sequenceKey===e.sequenceKey,w=null==l.mergeCC&&null==e.mergeCC||l.mergeCC===e.mergeCC,S=l.userKey===e.userKey,T={capturedAt:l.capturedAt,croppedPano:l.pano&&!l.fullPano,directionChange:y,distance:f,fullPano:l.fullPano,key:l.key,motionChange:d,rotation:b,sameMergeCC:w,sameSequence:x,sameUser:S,sequenceKey:l.sequenceKey,verticalDirectionChange:g,verticalMotion:m,worldMotionAzimuth:_};s.push(T)}}}return s},e.prototype.computeSequenceEdges=function(e,t){if(!e.full)throw new o.ArgumentBeeviewError("Node has to be full.");if(e.sequenceKey!==t.key)throw new o.ArgumentBeeviewError("Node and sequence does not correspond.");var r=[],n=t.findNextKey(e.key);null!=n&&r.push({data:{direction:i.EdgeDirection.Next,worldMotionAzimuth:Number.NaN},from:e.key,to:n});var a=t.findPrevKey(e.key);return null!=a&&r.push({data:{direction:i.EdgeDirection.Prev,worldMotionAzimuth:Number.NaN},from:e.key,to:a}),r},e.prototype.computeSimilarEdges=function(e,t){var r=this;if(!e.full)throw new o.ArgumentBeeviewError("Node has to be full.");for(var n=e.fullPano,a={},s=0,u=t;s<u.length;s++)if(null!=(v=u[s]).sequenceKey&&!v.sameSequence&&v.sameMergeCC){if(n){if(!v.fullPano)continue}else if(!v.fullPano&&Math.abs(v.directionChange)>this._settings.similarMaxDirectionChange)continue;v.distance>this._settings.similarMaxDistance||v.sameUser&&Math.abs(v.capturedAt-e.capturedAt)<this._settings.similarMinTimeDifference||(null==a[v.sequenceKey]&&(a[v.sequenceKey]=[]),a[v.sequenceKey].push(v))}var c=[],l=e.fullPano?function(e){return e.distance}:function(e){return r._coefficients.similarDistance*e.distance+r._coefficients.similarRotation*e.rotation};for(var h in a)if(a.hasOwnProperty(h)){for(var p=Number.MAX_VALUE,f=null,d=0,m=a[h];d<m.length;d++){var v=m[d],y=l(v);y<p&&(p=y,f=v)}null!=f&&c.push(f)}return c.map(function(t){return{data:{direction:i.EdgeDirection.Similar,worldMotionAzimuth:t.worldMotionAzimuth},from:e.key,to:t.key}})},e.prototype.computeStepEdges=function(e,t,r,n){if(!e.full)throw new o.ArgumentBeeviewError("Node has to be full.");var i=[];if(e.pano)return i;for(var a in this._directions.steps)if(this._directions.steps.hasOwnProperty(a)){for(var s=this._directions.steps[a],u=Number.MAX_VALUE,c=null,l=null,h=0,p=t;h<p.length;h++){var f=p[h];if(!f.croppedPano&&!f.fullPano&&!(Math.abs(f.directionChange)>this._settings.stepMaxDirectionChange)){var d=this._spatial.angleDifference(s.motionChange,f.motionChange),m=this._spatial.angleDifference(f.directionChange,d),v=Math.max(Math.abs(d),Math.abs(m));if(!(Math.abs(v)>this._settings.stepMaxDrift)){var y=f.key;if(!s.useFallback||y!==r&&y!==n||(l=f),!(f.distance>this._settings.stepMaxDistance)){d=Math.sqrt(d*d+f.verticalMotion*f.verticalMotion);var g=this._coefficients.stepPreferredDistance*Math.abs(f.distance-this._settings.stepPreferredDistance)/this._settings.stepMaxDistance+this._coefficients.stepMotion*d/this._settings.stepMaxDrift+this._coefficients.stepRotation*f.rotation/this._settings.stepMaxDirectionChange+this._coefficients.stepSequencePenalty*(f.sameSequence?0:1)+this._coefficients.stepMergeCCPenalty*(f.sameMergeCC?0:1);g<u&&(u=g,c=f)}}}}null!=(c=null==c?l:c)&&i.push({data:{direction:s.direction,worldMotionAzimuth:c.worldMotionAzimuth},from:e.key,to:c.key})}return i},e.prototype.computeTurnEdges=function(e,t){if(!e.full)throw new o.ArgumentBeeviewError("Node has to be full.");var r=[];if(e.pano)return r;for(var n in this._directions.turns)if(this._directions.turns.hasOwnProperty(n)){for(var a=this._directions.turns[n],s=Number.MAX_VALUE,u=null,c=0,l=t;c<l.length;c++){var h=l[c];if(!h.croppedPano&&!h.fullPano&&!(h.distance>this._settings.turnMaxDistance)){var p=a.direction!==i.EdgeDirection.TurnU&&h.distance<this._settings.turnMaxRigDistance&&Math.abs(h.directionChange)>this._settings.turnMinRigDirectionChange,f=this._spatial.angleDifference(a.directionChange,h.directionChange),d=void 0;if(p&&h.directionChange*a.directionChange>0&&Math.abs(h.directionChange)<Math.abs(a.directionChange))d=-Math.PI/2+Math.abs(h.directionChange);else{if(Math.abs(f)>this._settings.turnMaxDirectionChange)continue;var m=a.motionChange?this._spatial.angleDifference(a.motionChange,h.motionChange):0;m=Math.sqrt(m*m+h.verticalMotion*h.verticalMotion),d=this._coefficients.turnDistance*h.distance/this._settings.turnMaxDistance+this._coefficients.turnMotion*m/Math.PI+this._coefficients.turnSequencePenalty*(h.sameSequence?0:1)+this._coefficients.turnMergeCCPenalty*(h.sameMergeCC?0:1)}d<s&&(s=d,u=h)}}null!=u&&r.push({data:{direction:a.direction,worldMotionAzimuth:u.worldMotionAzimuth},from:e.key,to:u.key})}return r},e.prototype.computePerspectiveToPanoEdges=function(e,t){if(!e.full)throw new o.ArgumentBeeviewError("Node has to be full.");if(e.pano)return[];for(var r=Number.MAX_VALUE,n=null,a=0,s=t;a<s.length;a++){var u=s[a];if(u.fullPano){var c=this._coefficients.panoPreferredDistance*Math.abs(u.distance-this._settings.panoPreferredDistance)/this._settings.panoMaxDistance+this._coefficients.panoMotion*Math.abs(u.motionChange)/Math.PI+this._coefficients.panoMergeCCPenalty*(u.sameMergeCC?0:1);c<r&&(r=c,n=u)}}return null==n?[]:[{data:{direction:i.EdgeDirection.Pano,worldMotionAzimuth:n.worldMotionAzimuth},from:e.key,to:n.key}]},e.prototype.computePanoEdges=function(e,t){if(!e.full)throw new o.ArgumentBeeviewError("Node has to be full.");if(!e.fullPano)return[];for(var r=[],n=[],a=[],s=0,u=t;s<u.length;s++)if(!((w=u[s]).distance>this._settings.panoMaxDistance))if(w.fullPano){if(w.distance<this._settings.panoMinDistance)continue;n.push(w)}else{if(w.croppedPano)continue;for(var c in this._directions.panos)if(this._directions.panos.hasOwnProperty(c)){var l=this._directions.panos[c],h=this._spatial.angleDifference(w.directionChange,w.motionChange),p=this._spatial.angleDifference(l.directionChange,h);if(!(Math.abs(p)>this._settings.panoMaxStepTurnChange)){a.push([l.direction,w]);break}}}for(var f=Math.PI/this._settings.panoMaxItems,d=[],m=[],v=0;v<this._settings.panoMaxItems;v++){for(var y=v/this._settings.panoMaxItems*2*Math.PI,g=Number.MAX_VALUE,b=null,_=0,x=n;_<x.length;_++){var w=x[_],S=this._spatial.angleDifference(y,w.motionChange);if(!(Math.abs(S)>f)){for(var T=Number.MAX_VALUE,E=0,O=d;E<O.length;E++){var M=O[E],C=Math.abs(this._spatial.angleDifference(M,w.motionChange));C<T&&(T=C)}T<=f||(U=this._coefficients.panoPreferredDistance*Math.abs(w.distance-this._settings.panoPreferredDistance)/this._settings.panoMaxDistance+this._coefficients.panoMotion*Math.abs(S)/f+this._coefficients.panoSequencePenalty*(w.sameSequence?0:1)+this._coefficients.panoMergeCCPenalty*(w.sameMergeCC?0:1))<g&&(g=U,b=w)}}null!=b?(d.push(b.motionChange),r.push({data:{direction:i.EdgeDirection.Pano,worldMotionAzimuth:b.worldMotionAzimuth},from:e.key,to:b.key})):m.push(y)}var j={};j[i.EdgeDirection.Pano]=d,j[i.EdgeDirection.StepForward]=[],j[i.EdgeDirection.StepLeft]=[],j[i.EdgeDirection.StepBackward]=[],j[i.EdgeDirection.StepRight]=[];for(var P=0,A=m;P<A.length;P++){var N=A[P],L=[];for(var c in this._directions.panos)if(this._directions.panos.hasOwnProperty(c)){for(var l=this._directions.panos[c],I=j[i.EdgeDirection.Pano].concat(j[l.direction]).concat(j[l.prev]).concat(j[l.next]),g=Number.MAX_VALUE,b=null,R=0,k=a;R<k.length;R++)if((w=k[R])[0]===l.direction){var D=this._spatial.angleDifference(N,w[1].motionChange);if(!(Math.abs(D)>f)){for(var F=Number.MAX_VALUE,V=0,B=I;V<B.length;V++){M=B[V];(T=Math.abs(this._spatial.angleDifference(M,w[1].motionChange)))<F&&(F=T)}if(!(F<=f)){var U=this._coefficients.panoPreferredDistance*Math.abs(w[1].distance-this._settings.panoPreferredDistance)/this._settings.panoMaxDistance+this._coefficients.panoMotion*Math.abs(D)/f+this._coefficients.panoMergeCCPenalty*(w[1].sameMergeCC?0:1);U<g&&(g=U,b=w)}}}null!=b&&(L.push(b),r.push({data:{direction:b[0],worldMotionAzimuth:b[1].worldMotionAzimuth},from:e.key,to:b[1].key}))}for(var G=0,z=L;G<z.length;G++){var q=z[G];j[q[0]].push(q[1].motionChange)}}return r},e}();r.EdgeCalculator=s,r.default=s},{"../../Edge":366,"../../Error":367,"../../Geo":368,three:311}],477:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){return function(){this.panoPreferredDistance=2,this.panoMotion=2,this.panoSequencePenalty=1,this.panoMergeCCPenalty=4,this.stepPreferredDistance=4,this.stepMotion=3,this.stepRotation=4,this.stepSequencePenalty=2,this.stepMergeCCPenalty=6,this.similarDistance=2,this.similarRotation=3,this.turnDistance=4,this.turnMotion=2,this.turnSequencePenalty=1,this.turnMergeCCPenalty=4}}();r.EdgeCalculatorCoefficients=n,r.default=n},{}],478:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("../../Edge"),i=function(){return function(){this.steps={},this.turns={},this.panos={},this.steps[n.EdgeDirection.StepForward]={direction:n.EdgeDirection.StepForward,motionChange:0,useFallback:!0},this.steps[n.EdgeDirection.StepBackward]={direction:n.EdgeDirection.StepBackward,motionChange:Math.PI,useFallback:!0},this.steps[n.EdgeDirection.StepLeft]={direction:n.EdgeDirection.StepLeft,motionChange:Math.PI/2,useFallback:!1},this.steps[n.EdgeDirection.StepRight]={direction:n.EdgeDirection.StepRight,motionChange:-Math.PI/2,useFallback:!1},this.turns[n.EdgeDirection.TurnLeft]={direction:n.EdgeDirection.TurnLeft,directionChange:Math.PI/2,motionChange:Math.PI/4},this.turns[n.EdgeDirection.TurnRight]={direction:n.EdgeDirection.TurnRight,directionChange:-Math.PI/2,motionChange:-Math.PI/4},this.turns[n.EdgeDirection.TurnU]={direction:n.EdgeDirection.TurnU,directionChange:Math.PI,motionChange:null},this.panos[n.EdgeDirection.StepForward]={direction:n.EdgeDirection.StepForward,directionChange:0,next:n.EdgeDirection.StepLeft,prev:n.EdgeDirection.StepRight},this.panos[n.EdgeDirection.StepBackward]={direction:n.EdgeDirection.StepBackward,directionChange:Math.PI,next:n.EdgeDirection.StepRight,prev:n.EdgeDirection.StepLeft},this.panos[n.EdgeDirection.StepLeft]={direction:n.EdgeDirection.StepLeft,directionChange:Math.PI/2,next:n.EdgeDirection.StepBackward,prev:n.EdgeDirection.StepForward},this.panos[n.EdgeDirection.StepRight]={direction:n.EdgeDirection.StepRight,directionChange:-Math.PI/2,next:n.EdgeDirection.StepForward,prev:n.EdgeDirection.StepBackward}}}();r.EdgeCalculatorDirections=i},{"../../Edge":366}],479:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(){this.panoMinDistance=.1,this.panoMaxDistance=20,this.panoPreferredDistance=5,this.panoMaxItems=4,this.panoMaxStepTurnChange=Math.PI/8,this.rotationMaxDistance=this.turnMaxRigDistance,this.rotationMaxDirectionChange=Math.PI/6,this.rotationMaxVerticalDirectionChange=Math.PI/8,this.similarMaxDirectionChange=Math.PI/8,this.similarMaxDistance=12,this.similarMinTimeDifference=432e5,this.stepMaxDistance=20,this.stepMaxDirectionChange=Math.PI/6,this.stepMaxDrift=Math.PI/6,this.stepPreferredDistance=4,this.turnMaxDistance=15,this.turnMaxDirectionChange=2*Math.PI/9,this.turnMaxRigDistance=.65,this.turnMinRigDirectionChange=Math.PI/6}return Object.defineProperty(e.prototype,"maxDistance",{get:function(){return Math.max(this.panoMaxDistance,this.similarMaxDistance,this.stepMaxDistance,this.turnMaxDistance)},enumerable:!0,configurable:!0}),e}();r.EdgeCalculatorSettings=n,r.default=n},{}],480:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});!function(e){e[e.Next=0]="Next",e[e.Prev=1]="Prev",e[e.StepLeft=2]="StepLeft",e[e.StepRight=3]="StepRight",e[e.StepForward=4]="StepForward",e[e.StepBackward=5]="StepBackward",e[e.TurnLeft=6]="TurnLeft",e[e.TurnRight=7]="TurnRight",e[e.TurnU=8]="TurnU",e[e.Pano=9]="Pano",e[e.Similar=10]="Similar"}(r.EdgeDirection||(r.EdgeDirection={}))},{}],481:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("underscore"),i=e("virtual-dom"),o=e("rxjs/Subject");e("rxjs/add/operator/combineLatest"),e("rxjs/add/operator/distinctUntilChanged"),e("rxjs/add/operator/filter"),e("rxjs/add/operator/map"),e("rxjs/add/operator/pluck"),e("rxjs/add/operator/scan");var a=e("../Render"),s=function(){function e(e,t,r){this._adaptiveOperation$=new o.Subject,this._render$=new o.Subject,this._renderAdaptive$=new o.Subject,this._renderService=t,this._currentFrame$=r;var s=i.create(i.h("div.domRenderer",[]));e.appendChild(s),this._offset$=this._adaptiveOperation$.scan(function(e,t){return t(e)},{elementHeight:e.offsetHeight,elementWidth:e.offsetWidth,imageAspect:0,renderMode:a.RenderMode.Fill}).filter(function(e){return e.imageAspect>0&&e.elementWidth>0&&e.elementHeight>0}).map(function(e){var t=e.elementWidth/e.elementHeight,r=e.imageAspect/t,n=0,i=0;return e.renderMode===a.RenderMode.Letterbox?e.imageAspect>t?n=e.elementHeight*(1-1/r)/2:i=e.elementWidth*(1-r)/2:e.imageAspect>t?i=-e.elementWidth*(r-1)/2:n=-e.elementHeight*(1/r-1)/2,{bottom:n,left:i,right:i,top:n}}),this._currentFrame$.filter(function(e){return null!=e.state.currentNode}).distinctUntilChanged(function(e,t){return e===t},function(e){return e.state.currentNode.key}).map(function(e){return e.state.currentTransform.basicAspect}).map(function(e){return function(t){return t.imageAspect=e,t}}).subscribe(this._adaptiveOperation$),this._renderAdaptive$.scan(function(e,t){return null==t.vnode?delete e[t.name]:e[t.name]=t.vnode,e},{}).combineLatest(this._offset$).map(function(e){var t=n.values(e[0]),r=e[1],o={style:{bottom:r.bottom+"px",left:r.left+"px","pointer-events":"none",position:"absolute",right:r.right+"px",top:r.top+"px"}};return{name:"adaptiveDomRenderer",vnode:i.h("div.adaptiveDomRenderer",o,t)}}).subscribe(this._render$),this._vNode$=this._render$.scan(function(e,t){return null==t.vnode?delete e[t.name]:e[t.name]=t.vnode,e},{}).map(function(e){var t=n.values(e);return i.h("div.domRenderer",t)}),this._vPatch$=this._vNode$.scan(function(e,t){return e.vpatch=i.diff(e.vnode,t),e.vnode=t,e},{vnode:i.h("div.domRenderer",[]),vpatch:null}).pluck("vpatch"),this._element$=this._vPatch$.scan(function(e,t){return i.patch(e,t)},s).publishReplay(1).refCount(),this._element$.subscribe(function(){}),this._renderService.size$.map(function(e){return function(t){return t.elementWidth=e.width,t.elementHeight=e.height,t}}).subscribe(this._adaptiveOperation$),this._renderService.renderMode$.map(function(e){return function(t){return t.renderMode=e,t}}).subscribe(this._adaptiveOperation$)}return Object.defineProperty(e.prototype,"element$",{get:function(){return this._element$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"render$",{get:function(){return this._render$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderAdaptive$",{get:function(){return this._renderAdaptive$},enumerable:!0,configurable:!0}),e.prototype.clear=function(e){this._renderAdaptive$.next({name:e,vnode:null}),this._render$.next({name:e,vnode:null})},e}();r.DOMRenderer=s,r.default=s},{"../Render":370,"rxjs/Subject":162,"rxjs/add/operator/combineLatest":181,"rxjs/add/operator/distinctUntilChanged":186,"rxjs/add/operator/filter":189,"rxjs/add/operator/map":193,"rxjs/add/operator/pluck":198,"rxjs/add/operator/scan":202,underscore:313,"virtual-dom":317}],482:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n;!function(e){e[e.Background=0]="Background",e[e.Foreground=1]="Foreground"}(n=r.GLRenderStage||(r.GLRenderStage={})),r.default=n},{}],483:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("three"),i=e("rxjs/Observable"),o=e("rxjs/Subject");e("rxjs/add/observable/combineLatest"),e("rxjs/add/operator/distinctUntilChanged"),e("rxjs/add/operator/filter"),e("rxjs/add/operator/first"),e("rxjs/add/operator/map"),e("rxjs/add/operator/merge"),e("rxjs/add/operator/mergeMap"),e("rxjs/add/operator/scan"),e("rxjs/add/operator/share"),e("rxjs/add/operator/startWith");var a=e("../Render"),s=e("../Utils"),u=function(){function e(e,t,r){var u=this;this._renderFrame$=new o.Subject,this._renderCameraOperation$=new o.Subject,this._render$=new o.Subject,this._clear$=new o.Subject,this._renderOperation$=new o.Subject,this._rendererOperation$=new o.Subject,this._eraserOperation$=new o.Subject,this._renderService=t,this._dom=r||new s.DOM,this._renderer$=this._rendererOperation$.scan(function(e,t){return t(e)},{needsRender:!1,renderer:null}),this._renderCollection$=this._renderOperation$.scan(function(e,t){return t(e)},{}).share(),this._renderCamera$=this._renderCameraOperation$.scan(function(e,t){return t(e)},{frameId:-1,needsRender:!1,perspective:null}),this._eraser$=this._eraserOperation$.startWith(function(e){return e}).scan(function(e,t){return t(e)},{needsRender:!1}),i.Observable.combineLatest([this._renderer$,this._renderCollection$,this._renderCamera$,this._eraser$],function(e,t,r,n){return{camera:r,eraser:n,renderer:e,renders:Object.keys(t).map(function(e){return t[e]})}}).filter(function(e){for(var t=e.renderer.needsRender||e.camera.needsRender||e.eraser.needsRender,r=e.camera.frameId,n=0,i=e.renders;n<i.length;n++){var o=i[n];if(o.frameId!==r)return!1;t=t||o.needsRender}return t}).distinctUntilChanged(function(e,t){return e===t},function(e){return e.eraser.needsRender?-1:e.camera.frameId}).subscribe(function(e){e.renderer.needsRender=!1,e.camera.needsRender=!1,e.eraser.needsRender=!1;for(var t=e.camera.perspective,r=[],n=[],i=0,o=e.renders;i<o.length;i++)(p=o[i]).stage===a.GLRenderStage.Background?r.push(p.render):p.stage===a.GLRenderStage.Foreground&&n.push(p.render);var s=e.renderer.renderer;s.clear();for(var u=0,c=r;u<c.length;u++)(p=c[u])(t,s);s.clearDepth();for(var l=0,h=n;l<h.length;l++){var p=h[l];p(t,s)}}),this._renderFrame$.map(function(e){return function(t){return t.frameId=e.frameId,t.perspective=e.perspective,!0===e.changed&&(t.needsRender=!0),t}}).subscribe(this._renderCameraOperation$),this._renderFrameSubscribe();var c=this._render$.map(function(e){return function(t){return t[e.name]=e.render,t}}),l=this._clear$.map(function(e){return function(t){return delete t[e],t}});i.Observable.merge(c,l).subscribe(this._renderOperation$),this._webGLRenderer$=this._render$.first().map(function(r){var i=u._dom.createElement("canvas","Beeview-js-canvas");i.style.position="absolute",i.setAttribute("tabindex","0"),e.appendChild(i);var o=t.element,a=new n.WebGLRenderer({canvas:i});return a.setPixelRatio(window.devicePixelRatio),a.setSize(o.offsetWidth,o.offsetHeight),a.setClearColor(new n.Color(2105376),1),a.autoClear=!1,a}).publishReplay(1).refCount(),this._webGLRenderer$.subscribe(function(){});var h=this._webGLRenderer$.first().map(function(e){return function(t){return t.needsRender=!0,t.renderer=e,t}}),p=this._renderService.size$.map(function(e){return function(t){return null==t.renderer?t:(t.renderer.setSize(e.width,e.height),t.needsRender=!0,t)}}),f=this._clear$.map(function(e){return function(e){return null==e.renderer?e:(e.needsRender=!0,e)}});i.Observable.merge(h,p,f).subscribe(this._rendererOperation$);var d=this._renderCollection$.filter(function(e){return 0===Object.keys(e).length}).share();d.subscribe(function(e){null!=u._renderFrameSubscription&&(u._renderFrameSubscription.unsubscribe(),u._renderFrameSubscription=null,u._renderFrameSubscribe())}),d.map(function(e){return function(e){return e.needsRender=!0,e}}).subscribe(this._eraserOperation$)}return Object.defineProperty(e.prototype,"render$",{get:function(){return this._render$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"webGLRenderer$",{get:function(){return this._webGLRenderer$},enumerable:!0,configurable:!0}),e.prototype.clear=function(e){this._clear$.next(e)},e.prototype._renderFrameSubscribe=function(){var e=this;this._render$.first().map(function(e){return function(e){return e.needsRender=!0,e}}).subscribe(function(t){e._renderCameraOperation$.next(t)}),this._renderFrameSubscription=this._render$.first().mergeMap(function(t){return e._renderService.renderCameraFrame$}).subscribe(this._renderFrame$)},e}();r.GLRenderer=u,r.default=u},{"../Render":370,"../Utils":374,"rxjs/Observable":157,"rxjs/Subject":162,"rxjs/add/observable/combineLatest":166,"rxjs/add/operator/distinctUntilChanged":186,"rxjs/add/operator/filter":189,"rxjs/add/operator/first":191,"rxjs/add/operator/map":193,"rxjs/add/operator/merge":194,"rxjs/add/operator/mergeMap":196,"rxjs/add/operator/scan":202,"rxjs/add/operator/share":203,"rxjs/add/operator/startWith":207,three:311}],484:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("three"),i=e("../Geo"),o=e("../Render"),a=function(){function e(e,t,r){this.alpha=-1,this.zoom=0,this._frameId=-1,this._changed=!1,this._changedForFrame=-1,this.currentAspect=1,this.currentPano=!1,this.previousAspect=1,this.previousPano=!1,this.renderMode=r,this._spatial=new i.Spatial,this._camera=new i.Camera;var o=this._getPerspectiveCameraAspect(e,t);this._perspective=new n.PerspectiveCamera(50,o,.4,1e4),this._perspective.matrixAutoUpdate=!1,this._rotation={phi:0,theta:0}}return Object.defineProperty(e.prototype,"camera",{get:function(){return this._camera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"changed",{get:function(){return this.frameId===this._changedForFrame},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"frameId",{get:function(){return this._frameId},set:function(e){this._frameId=e,this._changed&&(this._changed=!1,this._changedForFrame=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"perspective",{get:function(){return this._perspective},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this._rotation},enumerable:!0,configurable:!0}),e.prototype.updateAspect=function(e,t){var r=this._getPerspectiveCameraAspect(e,t);this._perspective.aspect=r,this._changed=!0},e.prototype.updateProjection=function(){var e=this._getAspect(this.currentAspect,this.currentPano,this.perspective.aspect),t=this._getAspect(this.previousAspect,this.previousPano,this.perspective.aspect),r=(1-this.alpha)*t+this.alpha*e,n=this._getVerticalFov(r,this._camera.focal,this.zoom);this._perspective.fov=n,this._perspective.updateProjectionMatrix(),this._changed=!0},e.prototype.updatePerspective=function(e){this._perspective.up.copy(e.up),this._perspective.position.copy(e.position),this._perspective.lookAt(e.lookat),this._perspective.updateMatrix(),this._perspective.updateMatrixWorld(!1),this._changed=!0},e.prototype.updateRotation=function(e){this._rotation=this._getRotation(e)},e.prototype._getVerticalFov=function(e,t,r){return 2*Math.atan(.5/(Math.pow(2,r)*e*t))*180/Math.PI},e.prototype._getAspect=function(e,t,r){if(t)return 1;var n=Math.max(1,1/e);return(this.renderMode===o.RenderMode.Letterbox?e>r:e<r)?n*r:n*e},e.prototype._getPerspectiveCameraAspect=function(e,t){return 0===e?0:e/t},e.prototype._getRotation=function(e){var t=e.lookat.clone().sub(e.position),r=e.up.clone(),n=t.clone().dot(r),i=t.clone().sub(r.clone().multiplyScalar(n));return{phi:Math.atan2(i.y,i.x),theta:Math.PI/2-this._spatial.angleToPlane(t.toArray(),[0,0,1])}},e}();r.RenderCamera=a,r.default=a},{"../Geo":368,"../Render":370,three:311}],485:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n;!function(e){e[e.Letterbox=0]="Letterbox",e[e.Fill=1]="Fill"}(n=r.RenderMode||(r.RenderMode={})),r.default=n},{}],486:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/Subject"),i=e("rxjs/BehaviorSubject");e("rxjs/add/observable/combineLatest"),e("rxjs/add/operator/do"),e("rxjs/add/operator/filter"),e("rxjs/add/operator/map"),e("rxjs/add/operator/publishReplay"),e("rxjs/add/operator/scan"),e("rxjs/add/operator/skip"),e("rxjs/add/operator/startWith"),e("rxjs/add/operator/withLatestFrom");var o=e("../Geo"),a=e("../Render"),s=function(){function e(e,t,r){var s=this;this._element=e,this._currentFrame$=t,this._spatial=new o.Spatial,r=null!=r?r:a.RenderMode.Fill,this._resize$=new n.Subject,this._renderCameraOperation$=new n.Subject,this._size$=new i.BehaviorSubject({height:this._element.offsetHeight,width:this._element.offsetWidth}),this._resize$.map(function(){return{height:s._element.offsetHeight,width:s._element.offsetWidth}}).subscribe(this._size$),this._renderMode$=new i.BehaviorSubject(r),this._renderCameraHolder$=this._renderCameraOperation$.startWith(function(e){return e}).scan(function(e,t){return t(e)},new a.RenderCamera(this._element.offsetWidth,this._element.offsetHeight,r)).publishReplay(1).refCount(),this._renderCameraFrame$=this._currentFrame$.withLatestFrom(this._renderCameraHolder$,function(e,t){return[e,t]}).do(function(e){var t=e[0],r=e[1],n=t.state.camera;if(r.alpha!==t.state.alpha||r.zoom!==t.state.zoom||r.camera.diff(n)>1e-9){var i=t.state.currentTransform,o=null!=t.state.previousTransform?t.state.previousTransform:t.state.currentTransform,a=null!=t.state.previousNode?t.state.previousNode:t.state.currentNode;r.currentAspect=i.basicAspect,r.currentPano=t.state.currentNode.pano,r.previousAspect=o.basicAspect,r.previousPano=a.pano,r.alpha=t.state.alpha,r.zoom=t.state.zoom,r.camera.copy(n),r.updatePerspective(n),r.updateRotation(n),r.updateProjection()}r.frameId=t.id}).map(function(e){return e[1]}).publishReplay(1).refCount(),this._renderCamera$=this._renderCameraFrame$.filter(function(e){return e.changed}).publishReplay(1).refCount(),this._bearing$=this._renderCamera$.map(function(e){var t=s._spatial.radToDeg(s._spatial.azimuthalToBearing(e.rotation.phi));return s._spatial.wrap(t,0,360)}).publishReplay(1).refCount(),this._size$.skip(1).map(function(e){return function(t){return t.updateAspect(e.width,e.height),t.updateProjection(),t}}).subscribe(this._renderCameraOperation$),this._renderMode$.skip(1).map(function(e){return function(t){return t.renderMode=e,t.updateProjection(),t}}).subscribe(this._renderCameraOperation$),this._bearing$.subscribe(function(){}),this._renderCameraHolder$.subscribe(function(){}),this._size$.subscribe(function(){}),this._renderMode$.subscribe(function(){}),this._renderCamera$.subscribe(function(){}),this._renderCameraFrame$.subscribe(function(){})}return Object.defineProperty(e.prototype,"bearing$",{get:function(){return this._bearing$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this._element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resize$",{get:function(){return this._resize$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size$",{get:function(){return this._size$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderMode$",{get:function(){return this._renderMode$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderCameraFrame$",{get:function(){return this._renderCameraFrame$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderCamera$",{get:function(){return this._renderCamera$},enumerable:!0,configurable:!0}),e}();r.RenderService=s,r.default=s},{"../Geo":368,"../Render":370,"rxjs/BehaviorSubject":154,"rxjs/Subject":162,"rxjs/add/observable/combineLatest":166,"rxjs/add/operator/do":187,"rxjs/add/operator/filter":189,"rxjs/add/operator/map":193,"rxjs/add/operator/publishReplay":200,"rxjs/add/operator/scan":202,"rxjs/add/operator/skip":204,"rxjs/add/operator/startWith":207,"rxjs/add/operator/withLatestFrom":213}],487:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n;!function(e){e[e.Traversing=0]="Traversing",e[e.Waiting=1]="Waiting"}(n=r.State||(r.State={})),r.default=n},{}],488:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("../State"),i=e("../Geo"),o=function(){function e(){this._state=new n.TraversingState({alpha:1,camera:new i.Camera,currentIndex:-1,reference:{alt:0,lat:0,lon:0},trajectory:[],zoom:0})}return e.prototype.traverse=function(){this._state=this._state.traverse()},e.prototype.wait=function(){this._state=this._state.wait()},Object.defineProperty(e.prototype,"state",{get:function(){if(this._state instanceof n.TraversingState)return n.State.Traversing;if(this._state instanceof n.WaitingState)return n.State.Waiting;throw new Error("Invalid state")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"reference",{get:function(){return this._state.reference},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._state.alpha},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"camera",{get:function(){return this._state.camera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"zoom",{get:function(){return this._state.zoom},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentNode",{get:function(){return this._state.currentNode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousNode",{get:function(){return this._state.previousNode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentCamera",{get:function(){return this._state.currentCamera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTransform",{get:function(){return this._state.currentTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousTransform",{get:function(){return this._state.previousTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trajectory",{get:function(){return this._state.trajectory},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this._state.currentIndex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastNode",{get:function(){return this._state.trajectory[this._state.trajectory.length-1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nodesAhead",{get:function(){return this._state.trajectory.length-1-this._state.currentIndex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"motionless",{get:function(){return this._state.motionless},enumerable:!0,configurable:!0}),e.prototype.getCenter=function(){return this._state.getCenter()},e.prototype.setCenter=function(e){this._state.setCenter(e)},e.prototype.setZoom=function(e){this._state.setZoom(e)},e.prototype.update=function(e){this._state.update(e)},e.prototype.append=function(e){this._state.append(e)},e.prototype.prepend=function(e){this._state.prepend(e)},e.prototype.remove=function(e){this._state.remove(e)},e.prototype.clear=function(){this._state.clear()},e.prototype.clearPrior=function(){this._state.clearPrior()},e.prototype.cut=function(){this._state.cut()},e.prototype.set=function(e){this._state.set(e)},e.prototype.rotate=function(e){this._state.rotate(e)},e.prototype.rotateBasic=function(e){this._state.rotateBasic(e)},e.prototype.rotateBasicUnbounded=function(e){this._state.rotateBasicUnbounded(e)},e.prototype.rotateBasicWithoutInertia=function(e){this._state.rotateBasicWithoutInertia(e)},e.prototype.rotateToBasic=function(e){this._state.rotateToBasic(e)},e.prototype.move=function(e){this._state.move(e)},e.prototype.moveTo=function(e){this._state.moveTo(e)},e.prototype.zoomIn=function(e,t){this._state.zoomIn(e,t)},e}();r.StateContext=o},{"../Geo":368,"../State":371}],489:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/BehaviorSubject"),i=e("rxjs/Subject"),o=e("rxjs/util/AnimationFrame");e("rxjs/add/operator/bufferCount"),e("rxjs/add/operator/distinctUntilChanged"),e("rxjs/add/operator/do"),e("rxjs/add/operator/filter"),e("rxjs/add/operator/first"),e("rxjs/add/operator/map"),e("rxjs/add/operator/pairwise"),e("rxjs/add/operator/publishReplay"),e("rxjs/add/operator/scan"),e("rxjs/add/operator/startWith"),e("rxjs/add/operator/switchMap"),e("rxjs/add/operator/withLatestFrom");var a=e("../State"),s=function(){function e(){var e=this;this._appendNode$=new i.Subject,this._start$=new i.Subject,this._frame$=new i.Subject,this._fpsSampleRate=30,this._contextOperation$=new n.BehaviorSubject(function(e){return e}),this._context$=this._contextOperation$.scan(function(e,t){return t(e)},new a.StateContext).publishReplay(1).refCount(),this._state$=this._context$.map(function(e){return e.state}).distinctUntilChanged().publishReplay(1).refCount(),this._fps$=this._start$.switchMap(function(){return e._frame$.bufferCount(1,e._fpsSampleRate).map(function(e){return(new Date).getTime()}).pairwise().map(function(t){return Math.max(20,1e3*e._fpsSampleRate/(t[1]-t[0]))}).startWith(60)}).share(),this._currentState$=this._frame$.withLatestFrom(this._fps$,this._context$,function(e,t,r){return[e,t,r]}).filter(function(e){return null!=e[2].currentNode}).do(function(e){e[2].update(e[1])}).map(function(e){return{fps:e[1],id:e[0],state:e[2]}}).share(),this._lastState$=this._currentState$.publishReplay(1).refCount();var t=this._currentState$.distinctUntilChanged(void 0,function(e){return e.state.currentNode.key}).publishReplay(1).refCount(),r=new i.Subject;t.subscribe(r),this._currentKey$=new n.BehaviorSubject(null),r.map(function(e){return e.state.currentNode.key}).subscribe(this._currentKey$),this._currentNode$=r.map(function(e){return e.state.currentNode}).publishReplay(1).refCount(),this._currentCamera$=r.map(function(e){return e.state.currentCamera}).publishReplay(1).refCount(),this._currentTransform$=r.map(function(e){return e.state.currentTransform}).publishReplay(1).refCount(),this._reference$=r.map(function(e){return e.state.reference}).distinctUntilChanged(function(e,t){return e.lat===t.lat&&e.lon===t.lon},function(e){return{lat:e.lat,lon:e.lon}}).publishReplay(1).refCount(),this._currentNodeExternal$=t.map(function(e){return e.state.currentNode}).publishReplay(1).refCount(),this._appendNode$.map(function(e){return function(t){return t.append([e]),t}}).subscribe(this._contextOperation$),this._inMotionOperation$=new i.Subject,t.map(function(e){return!0}).subscribe(this._inMotionOperation$),this._inMotionOperation$.distinctUntilChanged().filter(function(e){return e}).switchMap(function(t){return e._currentState$.filter(function(e){return 0===e.state.nodesAhead}).map(function(e){return[e.state.camera.clone(),e.state.zoom]}).pairwise().map(function(e){var t=e[0][0],r=e[1][0],n=e[0][1],i=e[1][1];return t.diff(r)>1e-5||Math.abs(n-i)>1e-5}).first(function(e){return!e})}).subscribe(this._inMotionOperation$),this._inMotion$=this._inMotionOperation$.distinctUntilChanged().publishReplay(1).refCount(),this._inTranslationOperation$=new i.Subject,t.map(function(e){return!0}).subscribe(this._inTranslationOperation$),this._inTranslationOperation$.distinctUntilChanged().filter(function(e){return e}).switchMap(function(t){return e._currentState$.filter(function(e){return 0===e.state.nodesAhead}).map(function(e){return e.state.camera.position.clone()}).pairwise().map(function(e){return 0!==e[0].distanceToSquared(e[1])}).first(function(e){return!e})}).subscribe(this._inTranslationOperation$),this._inTranslation$=this._inTranslationOperation$.distinctUntilChanged().publishReplay(1).refCount(),this._state$.subscribe(function(){}),this._currentNode$.subscribe(function(){}),this._currentCamera$.subscribe(function(){}),this._currentTransform$.subscribe(function(){}),this._reference$.subscribe(function(){}),this._currentNodeExternal$.subscribe(function(){}),this._lastState$.subscribe(function(){}),this._inMotion$.subscribe(function(){}),this._inTranslation$.subscribe(function(){}),this._frameId=null,this._frameGenerator=new o.RequestAnimationFrameDefinition(window)}return Object.defineProperty(e.prototype,"currentState$",{get:function(){return this._currentState$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentNode$",{get:function(){return this._currentNode$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentKey$",{get:function(){return this._currentKey$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentNodeExternal$",{get:function(){return this._currentNodeExternal$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentCamera$",{get:function(){return this._currentCamera$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTransform$",{get:function(){return this._currentTransform$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"state$",{get:function(){return this._state$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"reference$",{get:function(){return this._reference$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inMotion$",{get:function(){return this._inMotion$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inTranslation$",{get:function(){return this._inTranslation$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"appendNode$",{get:function(){return this._appendNode$},enumerable:!0,configurable:!0}),e.prototype.traverse=function(){this._inMotionOperation$.next(!0),this._invokeContextOperation(function(e){e.traverse()})},e.prototype.wait=function(){this._invokeContextOperation(function(e){e.wait()})},e.prototype.appendNodes=function(e){this._invokeContextOperation(function(t){t.append(e)})},e.prototype.prependNodes=function(e){this._invokeContextOperation(function(t){t.prepend(e)})},e.prototype.removeNodes=function(e){this._invokeContextOperation(function(t){t.remove(e)})},e.prototype.clearNodes=function(){this._invokeContextOperation(function(e){e.clear()})},e.prototype.clearPriorNodes=function(){this._invokeContextOperation(function(e){e.clearPrior()})},e.prototype.cutNodes=function(){this._invokeContextOperation(function(e){e.cut()})},e.prototype.setNodes=function(e){this._invokeContextOperation(function(t){t.set(e)})},e.prototype.rotate=function(e){this._inMotionOperation$.next(!0),this._invokeContextOperation(function(t){t.rotate(e)})},e.prototype.rotateBasic=function(e){this._inMotionOperation$.next(!0),this._invokeContextOperation(function(t){t.rotateBasic(e)})},e.prototype.rotateBasicUnbounded=function(e){this._inMotionOperation$.next(!0),this._invokeContextOperation(function(t){t.rotateBasicUnbounded(e)})},e.prototype.rotateBasicWithoutInertia=function(e){this._inMotionOperation$.next(!0),this._invokeContextOperation(function(t){t.rotateBasicWithoutInertia(e)})},e.prototype.rotateToBasic=function(e){this._inMotionOperation$.next(!0),this._invokeContextOperation(function(t){t.rotateToBasic(e)})},e.prototype.move=function(e){this._inMotionOperation$.next(!0),this._invokeContextOperation(function(t){t.move(e)})},e.prototype.moveTo=function(e){this._inMotionOperation$.next(!0),this._invokeContextOperation(function(t){t.moveTo(e)})},e.prototype.zoomIn=function(e,t){this._inMotionOperation$.next(!0),this._invokeContextOperation(function(r){r.zoomIn(e,t)})},e.prototype.getCenter=function(){return this._lastState$.first().map(function(e){return e.state.getCenter()})},e.prototype.getZoom=function(){return this._lastState$.first().map(function(e){return e.state.zoom})},e.prototype.setCenter=function(e){this._inMotionOperation$.next(!0),this._invokeContextOperation(function(t){t.setCenter(e)})},e.prototype.setZoom=function(e){this._inMotionOperation$.next(!0),this._invokeContextOperation(function(t){t.setZoom(e)})},e.prototype.start=function(){null==this._frameId&&(this._start$.next(null),this._frameId=this._frameGenerator.requestAnimationFrame(this._frame.bind(this)),this._frame$.next(this._frameId))},e.prototype.stop=function(){null!=this._frameId&&(this._frameGenerator.cancelAnimationFrame(this._frameId),this._frameId=null)},e.prototype._invokeContextOperation=function(e){this._contextOperation$.next(function(t){return e(t),t})},e.prototype._frame=function(e){this._frameId=this._frameGenerator.requestAnimationFrame(this._frame.bind(this)),this._frame$.next(this._frameId)},e}();r.StateService=s},{"../State":371,"rxjs/BehaviorSubject":154,"rxjs/Subject":162,"rxjs/add/operator/bufferCount":178,"rxjs/add/operator/distinctUntilChanged":186,"rxjs/add/operator/do":187,"rxjs/add/operator/filter":189,"rxjs/add/operator/first":191,"rxjs/add/operator/map":193,"rxjs/add/operator/pairwise":197,"rxjs/add/operator/publishReplay":200,"rxjs/add/operator/scan":202,"rxjs/add/operator/startWith":207,"rxjs/add/operator/switchMap":208,"rxjs/add/operator/withLatestFrom":213,"rxjs/util/AnimationFrame":289}],490:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("../../Error"),i=e("../../Geo"),o=function(){function e(e){this._spatial=new i.Spatial,this._geoCoords=new i.GeoCoords,this._referenceThreshold=.01,this._reference=e.reference,this._alpha=e.alpha,this._camera=e.camera.clone(),this._zoom=e.zoom,this._currentIndex=e.currentIndex,this._trajectory=e.trajectory.slice(),this._trajectoryTransforms=[],this._trajectoryCameras=[];for(var t=0,r=this._trajectory;t<r.length;t++){var n=r[t],o=this._nodeToTranslation(n),a=new i.Transform(n,n.image,o);this._trajectoryTransforms.push(a),this._trajectoryCameras.push(new i.Camera(a))}this._currentNode=this._trajectory.length>0?this._trajectory[this._currentIndex]:null,this._previousNode=this._trajectory.length>1&&this.currentIndex>0?this._trajectory[this._currentIndex-1]:null,this._currentCamera=this._trajectoryCameras.length>0?this._trajectoryCameras[this._currentIndex].clone():new i.Camera,this._previousCamera=this._trajectoryCameras.length>1&&this.currentIndex>0?this._trajectoryCameras[this._currentIndex-1].clone():this._currentCamera.clone()}return Object.defineProperty(e.prototype,"reference",{get:function(){return this._reference},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._getAlpha()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"camera",{get:function(){return this._camera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"zoom",{get:function(){return this._zoom},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trajectory",{get:function(){return this._trajectory},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this._currentIndex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentNode",{get:function(){return this._currentNode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousNode",{get:function(){return this._previousNode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentCamera",{get:function(){return this._currentCamera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTransform",{get:function(){return this._trajectoryTransforms.length>0?this._trajectoryTransforms[this.currentIndex]:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousTransform",{get:function(){return this._trajectoryTransforms.length>1&&this.currentIndex>0?this._trajectoryTransforms[this.currentIndex-1]:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"motionless",{get:function(){return this._motionless},enumerable:!0,configurable:!0}),e.prototype.append=function(e){if(e.length<1)throw Error("Trajectory can not be empty");this._currentIndex<0?this.set(e):(this._trajectory=this._trajectory.concat(e),this._appendToTrajectories(e))},e.prototype.prepend=function(e){if(e.length<1)throw Error("Trajectory can not be empty");this._trajectory=e.slice().concat(this._trajectory),this._currentIndex+=e.length,this._setCurrentNode(),this._setReference(this._currentNode)?this._setTrajectories():this._prependToTrajectories(e),this._setCurrentCamera()},e.prototype.remove=function(e){if(e<0)throw Error("n must be a positive integer");if(this._currentIndex-1<e)throw Error("Current and previous nodes can not be removed");for(var t=0;t<e;t++)this._trajectory.shift(),this._trajectoryTransforms.shift(),this._trajectoryCameras.shift(),this._currentIndex--;this._setCurrentNode()},e.prototype.clearPrior=function(){this._currentIndex>0&&this.remove(this._currentIndex-1)},e.prototype.clear=function(){this.cut(),this._currentIndex>0&&this.remove(this._currentIndex-1)},e.prototype.cut=function(){for(;this._trajectory.length-1>this._currentIndex;)this._trajectory.pop(),this._trajectoryTransforms.pop(),this._trajectoryCameras.pop()},e.prototype.set=function(e){this._setTrajectory(e),this._setCurrentNode(),this._setReference(this._currentNode),this._setTrajectories(),this._setCurrentCamera()},e.prototype.getCenter=function(){return null!=this._currentNode?this.currentTransform.projectBasic(this._camera.lookat.toArray()):[.5,.5]},e.prototype._setCurrent=function(){this._setCurrentNode(),this._setReference(this._currentNode)&&this._setTrajectories(),this._setCurrentCamera()},e.prototype._setCurrentCamera=function(){this._currentCamera=this._trajectoryCameras[this._currentIndex].clone(),this._previousCamera=this._currentIndex>0?this._trajectoryCameras[this._currentIndex-1].clone():this._currentCamera.clone()},e.prototype._motionlessTransition=function(){return null!=this._currentNode&&null!=this._previousNode&&!(this._currentNode.merged&&this._previousNode.merged&&this._withinOriginalDistance()&&this._sameConnectedComponent())},e.prototype._setReference=function(e){return!(Math.abs(e.latLon.lat-this.reference.lat)<this._referenceThreshold&&Math.abs(e.latLon.lon-this.reference.lon)<this._referenceThreshold)&&(!(null!=this._previousNode&&!this._motionlessTransition())&&(this._reference.lat=e.latLon.lat,this._reference.lon=e.latLon.lon,this._reference.alt=e.alt,!0))},e.prototype._setCurrentNode=function(){this._currentNode=this._trajectory.length>0?this._trajectory[this._currentIndex]:null,this._previousNode=this._currentIndex>0?this._trajectory[this._currentIndex-1]:null},e.prototype._setTrajectory=function(e){if(e.length<1)throw new n.ArgumentBeeviewError("Trajectory can not be empty");null!=this._currentNode?(this._trajectory=[this._currentNode].concat(e),this._currentIndex=1):(this._trajectory=e.slice(),this._currentIndex=0)},e.prototype._setTrajectories=function(){this._trajectoryTransforms.length=0,this._trajectoryCameras.length=0,this._appendToTrajectories(this._trajectory)},e.prototype._appendToTrajectories=function(e){for(var t=0,r=e;t<r.length;t++){var o=r[t];if(!o.assetsCached)throw new n.ArgumentBeeviewError("Assets must be cached when node is added to trajectory");var a=this._nodeToTranslation(o),s=new i.Transform(o,o.image,a);this._trajectoryTransforms.push(s),this._trajectoryCameras.push(new i.Camera(s))}},e.prototype._prependToTrajectories=function(e){for(var t=0,r=e.reverse();t<r.length;t++){var o=r[t];if(!o.assetsCached)throw new n.ArgumentBeeviewError("Assets must be cached when added to trajectory");var a=this._nodeToTranslation(o),s=new i.Transform(o,o.image,a);this._trajectoryTransforms.unshift(s),this._trajectoryCameras.unshift(new i.Camera(s))}},e.prototype._nodeToTranslation=function(e){var t=this._geoCoords.geodeticToEnu(e.latLon.lat,e.latLon.lon,e.alt,this._reference.lat,this._reference.lon,this._reference.alt),r=this._spatial.rotate(t,e.rotation);return[-r.x,-r.y,-r.z]},e.prototype._sameConnectedComponent=function(){var e=this._currentNode,t=this._previousNode;return!(e&&e.mergeCC&&t&&t.mergeCC)||e.mergeCC===t.mergeCC},e.prototype._withinOriginalDistance=function(){var e=this._currentNode,t=this._previousNode;return!e||!t||this._spatial.distanceFromLatLon(e.originalLatLon.lat,e.originalLatLon.lon,t.originalLatLon.lat,t.originalLatLon.lon)<25},e}();r.StateBase=o},{"../../Error":367,"../../Geo":368}],491:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("three"),o=e("@mapbox/unitbezier"),a=e("../../State"),s=function(){function e(e,t){this._phi=e,this._theta=t}return Object.defineProperty(e.prototype,"phi",{get:function(){return this._phi},set:function(e){this._phi=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"theta",{get:function(){return this._theta},set:function(e){this._theta=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isZero",{get:function(){return 0===this._phi&&0===this._theta},enumerable:!0,configurable:!0}),e.prototype.copy=function(e){this._phi=e.phi,this._theta=e.theta},e.prototype.lerp=function(e,t){this._phi=(1-t)*this._phi+t*e.phi,this._theta=(1-t)*this._theta+t*e.theta},e.prototype.multiply=function(e){this._phi*=e,this._theta*=e},e.prototype.threshold=function(e){this._phi=Math.abs(this._phi)>e?this._phi:0,this._theta=Math.abs(this._theta)>e?this._theta:0},e.prototype.lengthSquared=function(){return this._phi*this._phi+this._theta*this._theta},e.prototype.reset=function(){this._phi=0,this._theta=0},e}(),u=function(e){function t(t){var r=e.call(this,t)||this;return r._adjustCameras(),r._motionless=r._motionlessTransition(),r._baseAlpha=r._alpha,r._animationSpeed=.025,r._unitBezier=new o(.74,.67,.38,.96),r._useBezier=!1,r._rotationDelta=new s(0,0),r._requestedRotationDelta=null,r._basicRotation=[0,0],r._requestedBasicRotation=null,r._requestedBasicRotationUnbounded=null,r._rotationAcceleration=.86,r._rotationIncreaseAlpha=.97,r._rotationDecreaseAlpha=.9,r._rotationThreshold=.001,r._unboundedRotationAlpha=.8,r._desiredZoom=t.zoom,r._minZoom=0,r._maxZoom=3,r._lookatDepth=10,r._desiredLookat=null,r._desiredCenter=null,r}return n(t,e),t.prototype.traverse=function(){throw new Error("Not implemented")},t.prototype.wait=function(){return new a.WaitingState(this)},t.prototype.append=function(t){var r=0===this._trajectory.length;r&&this._resetTransition(),e.prototype.append.call(this,t),r&&(this._setDesiredCenter(),this._setDesiredZoom())},t.prototype.prepend=function(t){var r=0===this._trajectory.length;r&&this._resetTransition(),e.prototype.prepend.call(this,t),r&&(this._setDesiredCenter(),this._setDesiredZoom())},t.prototype.set=function(t){e.prototype.set.call(this,t),this._desiredLookat=null,this._resetTransition(),this._clearRotation(),this._setDesiredCenter(),this._setDesiredZoom(),this._trajectory.length<3&&(this._useBezier=!0)},t.prototype.move=function(e){throw new Error("Not implemented")},t.prototype.moveTo=function(e){throw new Error("Not implemented")},t.prototype.rotate=function(e){null!=this._currentNode&&(this._desiredZoom=this._zoom,this._desiredLookat=null,this._requestedBasicRotation=null,null!=this._requestedRotationDelta?(this._requestedRotationDelta.phi=this._requestedRotationDelta.phi+e.phi,this._requestedRotationDelta.theta=this._requestedRotationDelta.theta+e.theta):this._requestedRotationDelta=new s(e.phi,e.theta))},t.prototype.rotateBasic=function(e){if(null!=this._currentNode)if(this._desiredZoom=this._zoom,this._desiredLookat=null,this._requestedRotationDelta=null,null!=this._requestedBasicRotation){this._requestedBasicRotation[0]+=e[0],this._requestedBasicRotation[1]+=e[1];var t=.05/Math.pow(2,this._zoom);this._requestedBasicRotation[0]=this._spatial.clamp(this._requestedBasicRotation[0],-t,t),this._requestedBasicRotation[1]=this._spatial.clamp(this._requestedBasicRotation[1],-t,t)}else this._requestedBasicRotation=e.slice()},t.prototype.rotateBasicUnbounded=function(e){null!=this._currentNode&&(null!=this._requestedBasicRotationUnbounded?(this._requestedBasicRotationUnbounded[0]+=e[0],this._requestedBasicRotationUnbounded[1]+=e[1]):this._requestedBasicRotationUnbounded=e.slice())},t.prototype.rotateBasicWithoutInertia=function(e){if(null!=this._currentNode){this._desiredZoom=this._zoom,this._desiredLookat=null,this._requestedRotationDelta=null,this._requestedBasicRotation=null;var t=.05/Math.pow(2,this._zoom),r=e.slice();r[0]=this._spatial.clamp(r[0],-t,t),r[1]=this._spatial.clamp(r[1],-t,t),this._applyRotationBasic(r)}},t.prototype.rotateToBasic=function(e){if(null!=this._currentNode){this._desiredZoom=this._zoom,this._desiredLookat=null,e[0]=this._spatial.clamp(e[0],0,1),e[1]=this._spatial.clamp(e[1],0,1);var t=this.currentTransform.unprojectBasic(e,this._lookatDepth);this._currentCamera.lookat.fromArray(t)}},t.prototype.zoomIn=function(e,t){if(null!=this._currentNode){this._desiredZoom=Math.max(this._minZoom,Math.min(this._maxZoom,this._desiredZoom+e));var r=this.currentTransform.projectBasic(this._currentCamera.lookat.toArray()),n=r[0],o=r[1],a=Math.pow(2,this._zoom),s=Math.pow(2,this._desiredZoom),u=t[0],c=t[1];null!=this.currentTransform.gpano&&this.currentTransform.gpano.CroppedAreaImageWidthPixels===this.currentTransform.gpano.FullPanoWidthPixels&&(u-n>.5?u-=1:n-u>.5&&(u=1+u));var l=u-a/s*(u-n),h=c-a/s*(c-o),p=this.currentTransform.gpano;this._currentNode.fullPano?(l=this._spatial.wrap(l+this._basicRotation[0],0,1),h=this._spatial.clamp(h+this._basicRotation[1],.05,.95)):null!=p&&this.currentTransform.gpano.CroppedAreaImageWidthPixels===this.currentTransform.gpano.FullPanoWidthPixels?(l=this._spatial.wrap(l+this._basicRotation[0],0,1),h=this._spatial.clamp(h+this._basicRotation[1],0,1)):(l=this._spatial.clamp(l,0,1),h=this._spatial.clamp(h,0,1)),this._desiredLookat=(new i.Vector3).fromArray(this.currentTransform.unprojectBasic([l,h],this._lookatDepth))}},t.prototype.setCenter=function(e){this._desiredLookat=null,this._requestedRotationDelta=null,this._requestedBasicRotation=null,this._desiredZoom=this._zoom;var t=[this._spatial.clamp(e[0],0,1),this._spatial.clamp(e[1],0,1)];if(null!=this._currentNode){this._desiredCenter=null;var r=(new i.Vector3).fromArray(this.currentTransform.unprojectBasic(t,this._lookatDepth)),n=null!=this.previousTransform?this.previousTransform:this.currentTransform,o=(new i.Vector3).fromArray(n.unprojectBasic(t,this._lookatDepth));this._currentCamera.lookat.copy(r),this._previousCamera.lookat.copy(o)}else this._desiredCenter=t},t.prototype.setZoom=function(e){this._desiredLookat=null,this._requestedRotationDelta=null,this._requestedBasicRotation=null,this._zoom=this._spatial.clamp(e,this._minZoom,this._maxZoom),this._desiredZoom=this._zoom},t.prototype.update=function(e){1===this._alpha&&this._currentIndex+this._alpha<this._trajectory.length&&(this._currentIndex+=1,this._useBezier=this._trajectory.length<3&&this._currentIndex+1===this._trajectory.length,this._setCurrent(),this._resetTransition(),this._clearRotation(),this._desiredZoom=this._currentNode.fullPano?this._zoom:0,this._desiredLookat=null);var t=this._animationSpeed*(60/e);this._baseAlpha=Math.min(1,this._baseAlpha+t),this._useBezier?this._alpha=this._unitBezier.solve(this._baseAlpha):this._alpha=this._baseAlpha,this._updateRotation(),this._rotationDelta.isZero||(this._applyRotation(this._previousCamera),this._applyRotation(this._currentCamera)),this._updateRotationBasic(),0===this._basicRotation[0]&&0===this._basicRotation[1]||this._applyRotationBasic(this._basicRotation),this._updateZoom(t),this._updateLookat(t),this._camera.lerpCameras(this._previousCamera,this._currentCamera,this.alpha)},t.prototype._getAlpha=function(){return this._motionless?Math.ceil(this._alpha):this._alpha},t.prototype._setCurrentCamera=function(){e.prototype._setCurrentCamera.call(this),this._adjustCameras()},t.prototype._adjustCameras=function(){if(null!=this._previousNode){var e=this._camera.lookat.clone().sub(this._camera.position);this._previousCamera.lookat.copy(e.clone().add(this._previousCamera.position)),this._currentNode.fullPano&&this._currentCamera.lookat.copy(e.clone().add(this._currentCamera.position))}},t.prototype._resetTransition=function(){this._alpha=0,this._baseAlpha=0,this._motionless=this._motionlessTransition()},t.prototype._applyRotation=function(e){if(null!=e){var t=(new i.Quaternion).setFromUnitVectors(e.up,new i.Vector3(0,0,1)),r=t.clone().inverse(),n=new i.Vector3;n.copy(e.lookat).sub(e.position),n.applyQuaternion(t);var o=n.length(),a=Math.atan2(n.y,n.x);a+=this._rotationDelta.phi;var s=Math.atan2(Math.sqrt(n.x*n.x+n.y*n.y),n.z);s+=this._rotationDelta.theta,s=Math.max(.1,Math.min(Math.PI-.1,s)),n.x=Math.sin(s)*Math.cos(a),n.y=Math.sin(s)*Math.sin(a),n.z=Math.cos(s),n.applyQuaternion(r),e.lookat.copy(e.position).add(n.multiplyScalar(o))}},t.prototype._applyRotationBasic=function(e){var t=this._currentNode,r=null!=this._previousNode?this.previousNode:this.currentNode,n=this._currentCamera,i=this._previousCamera,o=this.currentTransform,a=null!=this.previousTransform?this.previousTransform:this.currentTransform,s=o.projectBasic(n.lookat.toArray()),u=a.projectBasic(i.lookat.toArray()),c=o.gpano,l=a.gpano;t.fullPano?(s[0]=this._spatial.wrap(s[0]+e[0],0,1),s[1]=this._spatial.clamp(s[1]+e[1],.05,.95)):null!=c&&o.gpano.CroppedAreaImageWidthPixels===o.gpano.FullPanoWidthPixels?(s[0]=this._spatial.wrap(s[0]+e[0],0,1),s[1]=this._spatial.clamp(s[1]+e[1],0,1)):(s[0]=this._spatial.clamp(s[0]+e[0],0,1),s[1]=this._spatial.clamp(s[1]+e[1],0,1)),r.fullPano?(u[0]=this._spatial.wrap(u[0]+e[0],0,1),u[1]=this._spatial.clamp(u[1]+e[1],.05,.95)):null!=l&&a.gpano.CroppedAreaImageWidthPixels===a.gpano.FullPanoWidthPixels?(u[0]=this._spatial.wrap(u[0]+e[0],0,1),u[1]=this._spatial.clamp(u[1]+e[1],0,1)):(u[0]=this._spatial.clamp(u[0]+e[0],0,1),u[1]=this._spatial.clamp(s[1]+e[1],0,1));var h=o.unprojectBasic(s,this._lookatDepth);n.lookat.fromArray(h);var p=a.unprojectBasic(u,this._lookatDepth);i.lookat.fromArray(p)},t.prototype._updateZoom=function(e){var t=this._desiredZoom-this._zoom,r=t>0?1:t<0?-1:0;0!==t&&(Math.abs(t)<.002?(this._zoom=this._desiredZoom,null!=this._desiredLookat&&(this._desiredLookat=null)):this._zoom+=r*Math.max(Math.abs(5*e*t),.002))},t.prototype._updateLookat=function(e){if(null!==this._desiredLookat){var t=this._desiredLookat.distanceToSquared(this._currentCamera.lookat);Math.abs(t)<1e-6?(this._currentCamera.lookat.copy(this._desiredLookat),this._desiredLookat=null):this._currentCamera.lookat.lerp(this._desiredLookat,5*e)}},t.prototype._updateRotation=function(){if(null!=this._requestedRotationDelta){var e=this._rotationDelta.lengthSquared();return this._requestedRotationDelta.lengthSquared()>e?this._rotationDelta.lerp(this._requestedRotationDelta,this._rotationIncreaseAlpha):this._rotationDelta.lerp(this._requestedRotationDelta,this._rotationDecreaseAlpha),void(this._requestedRotationDelta=null)}this._rotationDelta.isZero||(this._rotationDelta.multiply(this._rotationAcceleration),this._rotationDelta.threshold(this._rotationThreshold))},t.prototype._updateRotationBasic=function(){if(null!=this._requestedBasicRotation){var e=this._basicRotation[0],t=this._basicRotation[1],r=this._requestedBasicRotation[0],n=this._requestedBasicRotation[1];return Math.abs(r)>Math.abs(e)?this._basicRotation[0]=(1-this._rotationIncreaseAlpha)*e+this._rotationIncreaseAlpha*r:this._basicRotation[0]=(1-this._rotationDecreaseAlpha)*e+this._rotationDecreaseAlpha*r,Math.abs(n)>Math.abs(t)?this._basicRotation[1]=(1-this._rotationIncreaseAlpha)*t+this._rotationIncreaseAlpha*n:this._basicRotation[1]=(1-this._rotationDecreaseAlpha)*t+this._rotationDecreaseAlpha*n,void(this._requestedBasicRotation=null)}if(null!=this._requestedBasicRotationUnbounded){var r=this._requestedBasicRotationUnbounded[0],n=this._requestedBasicRotationUnbounded[1];if(Math.abs(r)>0&&(this._basicRotation[0]=(1-this._unboundedRotationAlpha)*this._basicRotation[0]+this._unboundedRotationAlpha*r),Math.abs(n)>0&&(this._basicRotation[1]=(1-this._unboundedRotationAlpha)*this._basicRotation[1]+this._unboundedRotationAlpha*n),null!=this._desiredLookat){var o=this.currentTransform.projectBasic(this._desiredLookat.toArray());o[0]+=r,o[1]+=n,this._desiredLookat=(new i.Vector3).fromArray(this.currentTransform.unprojectBasic(o,this._lookatDepth))}this._requestedBasicRotationUnbounded=null}0===this._basicRotation[0]&&0===this._basicRotation[1]||(this._basicRotation[0]=this._rotationAcceleration*this._basicRotation[0],this._basicRotation[1]=this._rotationAcceleration*this._basicRotation[1],Math.abs(this._basicRotation[0])<this._rotationThreshold/Math.pow(2,this._zoom)&&Math.abs(this._basicRotation[1])<this._rotationThreshold/Math.pow(2,this._zoom)&&(this._basicRotation=[0,0]))},t.prototype._clearRotation=function(){this._currentNode.fullPano||(null!=this._requestedRotationDelta&&(this._requestedRotationDelta=null),this._rotationDelta.isZero||this._rotationDelta.reset(),null!=this._requestedBasicRotation&&(this._requestedBasicRotation=null),(this._basicRotation[0]>0||this._basicRotation[1]>0)&&(this._basicRotation=[0,0]))},t.prototype._setDesiredCenter=function(){if(null!=this._desiredCenter){var e=(new i.Vector3).fromArray(this.currentTransform.unprojectBasic(this._desiredCenter,this._lookatDepth)).sub(this._currentCamera.position);this._currentCamera.lookat.copy(this._currentCamera.position.clone().add(e)),this._previousCamera.lookat.copy(this._previousCamera.position.clone().add(e)),this._desiredCenter=null}},t.prototype._setDesiredZoom=function(){this._desiredZoom=this._currentNode.fullPano||null==this._previousNode?this._zoom:0},t}(a.StateBase);r.TraversingState=u},{"../../State":371,"@mapbox/unitbezier":2,three:311}],492:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("../../State"),o=function(e){function t(t){var r=e.call(this,t)||this;return r._zoom=0,r._adjustCameras(),r._motionless=r._motionlessTransition(),r}return n(t,e),t.prototype.traverse=function(){return new i.TraversingState(this)},t.prototype.wait=function(){throw new Error("Not implemented")},t.prototype.prepend=function(t){e.prototype.prepend.call(this,t),this._motionless=this._motionlessTransition()},t.prototype.set=function(t){e.prototype.set.call(this,t),this._motionless=this._motionlessTransition()},t.prototype.rotate=function(e){},t.prototype.rotateBasic=function(e){},t.prototype.rotateBasicUnbounded=function(e){},t.prototype.rotateBasicWithoutInertia=function(e){},t.prototype.rotateToBasic=function(e){},t.prototype.zoomIn=function(e,t){},t.prototype.move=function(e){this._alpha=Math.max(0,Math.min(1,this._alpha+e))},t.prototype.moveTo=function(e){this._alpha=Math.max(0,Math.min(1,e))},t.prototype.update=function(e){this._camera.lerpCameras(this._previousCamera,this._currentCamera,this.alpha)},t.prototype.setCenter=function(e){},t.prototype.setZoom=function(e){},t.prototype._getAlpha=function(){return this._motionless?Math.round(this._alpha):this._alpha},t.prototype._setCurrentCamera=function(){e.prototype._setCurrentCamera.call(this),this._adjustCameras()},t.prototype._adjustCameras=function(){if(null!=this._previousNode){if(this._currentNode.fullPano){e=this._camera.lookat.clone().sub(this._camera.position);this._currentCamera.lookat.copy(e.clone().add(this._currentCamera.position))}if(this._previousNode.fullPano){var e=this._currentCamera.lookat.clone().sub(this._currentCamera.position);this._previousCamera.lookat.copy(e.clone().add(this._previousCamera.position))}}},t}(i.StateBase);r.WaitingState=o},{"../../State":371}],493:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/Observable"),i=function(){function e(e,t,r){this._scheme=e,this._host=t,this._origin=null!=r?"?origin="+r:""}return e.prototype.getTile=function(e,t,r,i,o,a,s){var u="/"+e+"/"+t+","+r+","+i+","+o+"/"+a+","+s+"/0/default.jpg",c=this._scheme+"://"+this._host+u+this._origin,l=null;return[n.Observable.create(function(n){(l=new XMLHttpRequest).open("GET",c,!0),l.responseType="arraybuffer",l.timeout=15e3,l.onload=function(a){if(200===l.status){var s=new Image;s.crossOrigin="Anonymous",s.onload=function(e){n.next(s),n.complete()},s.onerror=function(a){n.error(new Error("Failed to load tile image ("+e+": "+t+","+r+","+i+","+o+")"))};var u=new Blob([l.response]);s.src=window.URL.createObjectURL(u)}else n.error(new Error("Failed to fetch tile ("+e+": "+t+","+r+","+i+","+o+"). Status: "+l.status+", "+l.statusText))},l.onerror=function(a){n.error(new Error("Failed to fetch tile ("+e+": "+t+","+r+","+i+","+o+")"))},l.ontimeout=function(a){n.error(new Error("Tile request timed out ("+e+": "+t+","+r+","+i+","+o+")"))},l.onabort=function(a){n.error(new Error("Tile request was aborted ("+e+": "+t+","+r+","+i+","+o+")"))},l.send(null)}),function(){null!=l&&l.abort()}]},e}();r.ImageTileLoader=i,r.default=i},{"rxjs/Observable":157}],494:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(){this._images={}}return e.prototype.addImage=function(e,t,r){r in this._images||(this._images[r]={}),this._images[r][t]=e},e.prototype.dispose=function(){for(var e=0,t=Object.keys(this._images);e<t.length;e++){for(var r=t[e],n=this._images[r],i=0,o=Object.keys(n);i<o.length;i++){var a=o[i];window.URL.revokeObjectURL(n[a].src),delete n[a]}delete this._images[r]}},e.prototype.getImage=function(e,t){return this._images[t][e]},e.prototype.hasImage=function(e,t){return t in this._images&&e in this._images[t]},e}();r.ImageTileStore=n,r.default=n},{}],495:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("../Geo"),i=function(){function e(){this._viewportCoords=new n.ViewportCoords}return e.prototype.computeRegionOfInterest=function(e,t,r){var n=this._viewportBoundaryPoints(4),i=this._viewportPointsBoundingBox(n,e,r);this._clipBoundingBox(i);var o=2/t.width,a=2/t.height,s=[[-.5*o,.5*a],[.5*o,.5*a],[.5*o,-.5*a],[-.5*o,-.5*a]],u=this._viewportPointsBoundingBox(s,e,r);return{bbox:i,pixelHeight:u.maxY-u.minY,pixelWidth:u.maxX-u.minX+(u.minX<u.maxX?0:1)}},e.prototype._viewportBoundaryPoints=function(e){for(var t=[],r=[[-1,1],[1,1],[1,-1],[-1,-1]],n=[[2,0],[0,-2],[-2,0],[0,2]],i=0;i<4;++i)for(var o=r[i],a=n[i],s=0;s<e;++s)t.push([o[0]+a[0]*s/e,o[1]+a[1]*s/e]);return t},e.prototype._viewportPointsBoundingBox=function(e,t,r){var n=this,i=e.map(function(e){return n._viewportCoords.viewportToBasic(e[0],e[1],r,t.perspective)});return null!=r.gpano?this._boundingBoxPano(i):this._boundingBox(i)},e.prototype._boundingBox=function(e){for(var t={maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY},r=0;r<e.length;++r)t.minX=Math.min(t.minX,e[r][0]),t.maxX=Math.max(t.maxX,e[r][0]),t.minY=Math.min(t.minY,e[r][1]),t.maxY=Math.max(t.maxY,e[r][1]);return t},e.prototype._boundingBoxPano=function(e){for(var t=this,r=[],n=[],i=0;i<e.length;++i)r.push(e[i][0]),n.push(e[i][1]);r.sort(function(e,r){return t._sign(e-r)}),n.sort(function(e,r){return t._sign(e-r)});var o=this._intervalPano(r);return{maxX:o[1],maxY:n[n.length-1],minX:o[0],minY:n[0]}},e.prototype._intervalPano=function(e){for(var t=0,r=-1,n=0;n<e.length-1;++n){var i=e[n+1]-e[n];i>t&&(t=i,r=n)}return e[0]+1-e[e.length-1]>t?[e[0],e[e.length-1]]:[e[r+1],e[r]]},e.prototype._clipBoundingBox=function(e){e.minX=Math.max(0,Math.min(1,e.minX)),e.maxX=Math.max(0,Math.min(1,e.maxX)),e.minY=Math.max(0,Math.min(1,e.minY)),e.maxY=Math.max(0,Math.min(1,e.maxY))},e.prototype._sign=function(e){return e>0?1:e<0?-1:0},e}();r.RegionOfInterestCalculator=i,r.default=i},{"../Geo":368}],496:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("three"),i=e("rxjs/Subject"),o=function(){function e(e,t,r,n,o,a,s,u){this._disposed=!1,this._key=e,(t<=0||r<=0)&&console.warn("Original image size ("+t+", "+r+") is invalid ("+e+"). Tiles will not be loaded."),this._width=t,this._height=r,this._maxLevel=Math.ceil(Math.log(Math.max(r,t))/Math.log(2)),this._currentLevel=-1,this._tileSize=n,this._updated$=new i.Subject,this._createdSubject$=new i.Subject,this._created$=this._createdSubject$.publishReplay(1).refCount(),this._createdSubscription=this._created$.subscribe(function(){}),this._hasSubject$=new i.Subject,this._has$=this._hasSubject$.startWith(!1).publishReplay(1).refCount(),this._hasSubscription=this._has$.subscribe(function(){}),this._abortFunctions=[],this._tileSubscriptions={},this._renderedCurrentLevelTiles={},this._renderedTiles={},this._background=o,this._camera=null,this._imageTileLoader=a,this._imageTileStore=s,this._renderer=u,this._renderTarget=null,this._roi=null}return Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasTexture$",{get:function(){return this._has$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return this._key},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textureUpdated$",{get:function(){return this._updated$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textureCreated$",{get:function(){return this._created$},enumerable:!0,configurable:!0}),e.prototype.abort=function(){for(var e in this._tileSubscriptions)this._tileSubscriptions.hasOwnProperty(e)&&this._tileSubscriptions[e].unsubscribe();this._tileSubscriptions={};for(var t=0,r=this._abortFunctions;t<r.length;t++)(0,r[t])();this._abortFunctions=[]},e.prototype.dispose=function(){this._disposed?console.warn("Texture already disposed ("+this._key+")"):(this.abort(),null!=this._renderTarget&&(this._renderTarget.dispose(),this._renderTarget=null),this._imageTileStore.dispose(),this._imageTileStore=null,this._background=null,this._camera=null,this._imageTileLoader=null,this._renderer=null,this._roi=null,this._createdSubscription.unsubscribe(),this._hasSubscription.unsubscribe(),this._disposed=!0)},e.prototype.setRegionOfInterest=function(e){if(!(this._width<=0||this._height<=0)){this._roi=e;var t=1/this._roi.pixelWidth,r=1/this._roi.pixelHeight,i=Math.max(r,t),o=Math.max(0,Math.min(this._maxLevel,Math.ceil(Math.log(i)/Math.log(2))));if(o!==this._currentLevel){this.abort(),this._currentLevel=o,this._currentLevel in this._renderedTiles||(this._renderedTiles[this._currentLevel]=[]),this._renderedCurrentLevelTiles={};for(var a=0,s=this._renderedTiles[this._currentLevel];a<s.length;a++){var u=s[a];this._renderedCurrentLevelTiles[this._tileKey(this._tileSize,u)]=!0}}var c=this._getTileCoords([this._roi.bbox.minX,this._roi.bbox.minY]),l=this._getTileCoords([this._roi.bbox.maxX,this._roi.bbox.maxY]),h=this._getTiles(c,l);if(null==this._camera){this._camera=new n.OrthographicCamera(-this._width/2,this._width/2,this._height/2,-this._height/2,-1,1),this._camera.position.z=1;var p=this._renderer.getContext(),f=p.getParameter(p.MAX_TEXTURE_SIZE),d=Math.max(this._width,this._height),m=f>d?1:f/d,v=Math.floor(m*this._width),y=Math.floor(m*this._height);this._renderTarget=new n.WebGLRenderTarget(v,y,{depthBuffer:!1,format:n.RGBFormat,magFilter:n.LinearFilter,minFilter:n.LinearFilter,stencilBuffer:!1}),this._renderToTarget(0,0,this._width,this._height,this._background),this._createdSubject$.next(this._renderTarget.texture),this._hasSubject$.next(!0)}this._fetchTiles(h)}},e.prototype.setTileSize=function(e){this._tileSize=e},e.prototype.updateBackground=function(e){this._background=e},e.prototype._fetchTile=function(e,t,r,n,i,o,a,s){var u=this,c=this._imageTileLoader.getTile(this._key,r,n,i,o,a,s),l=c[0],h=c[1];this._abortFunctions.push(h);var p=this._tileKey(this._tileSize,e),f=l.subscribe(function(a){u._renderToTarget(r,n,i,o,a),u._removeFromDictionary(p,u._tileSubscriptions),u._removeFromArray(h,u._abortFunctions),u._setTileRendered(e,u._currentLevel),u._imageTileStore.addImage(a,p,t),u._updated$.next(!0)},function(e){u._removeFromDictionary(p,u._tileSubscriptions),u._removeFromArray(h,u._abortFunctions),console.error(e)});f.closed||(this._tileSubscriptions[p]=f)},e.prototype._fetchTiles=function(e){for(var t=this._tileSize*Math.pow(2,this._maxLevel-this._currentLevel),r=0,n=e;r<n.length;r++){var i=n[r],o=this._tileKey(this._tileSize,i);if(!(o in this._renderedCurrentLevelTiles||o in this._tileSubscriptions)){var a=t*i[0],s=t*i[1],u=a+t>this._width?this._width-a:t,c=s+t>this._height?this._height-s:t;if(this._imageTileStore.hasImage(o,this._currentLevel))this._renderToTarget(a,s,u,c,this._imageTileStore.getImage(o,this._currentLevel)),this._setTileRendered(i,this._currentLevel),this._updated$.next(!0);else{var l=Math.floor(u/t*this._tileSize),h=Math.floor(c/t*this._tileSize);this._fetchTile(i,this._currentLevel,a,s,u,c,l,h)}}}},e.prototype._getTileCoords=function(e){var t=this._tileSize*Math.pow(2,this._maxLevel-this._currentLevel),r=Math.ceil(this._width/t)-1,n=Math.ceil(this._height/t)-1;return[Math.min(Math.floor(this._width*e[0]/t),r),Math.min(Math.floor(this._height*e[1]/t),n)]},e.prototype._getTiles=function(e,t){var r=[];if(e[0]>t[0]){for(var n=this._tileSize*Math.pow(2,this._maxLevel-this._currentLevel),i=Math.ceil(this._width/n)-1,o=e[0];o<=i;o++)r.push(o);for(o=0;o<=t[0];o++)r.push(o)}else for(o=e[0];o<=t[0];o++)r.push(o);for(var a=[],s=0,u=r;s<u.length;s++)for(var o=u[s],c=e[1];c<=t[1];c++)a.push([o,c]);return a},e.prototype._removeFromArray=function(e,t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)},e.prototype._removeFromDictionary=function(e,t){e in t&&delete t[e]},e.prototype._renderToTarget=function(e,t,r,i,o){var a=new n.Texture(o);a.minFilter=n.LinearFilter,a.needsUpdate=!0;var s=new n.PlaneGeometry(r,i),u=new n.MeshBasicMaterial({map:a,side:n.FrontSide}),c=new n.Mesh(s,u);c.position.x=-this._width/2+e+r/2,c.position.y=this._height/2-t-i/2;var l=new n.Scene;l.add(c),this._renderer.render(l,this._camera,this._renderTarget),this._renderer.setRenderTarget(void 0),l.remove(c),s.dispose(),u.dispose(),a.dispose()},e.prototype._setTileRendered=function(e,t){for(var r=0,n=Object.keys(this._renderedTiles).map(function(e){return parseInt(e,10)}).filter(function(e){return e!==t});r<n.length;r++){var i=n[r],o=Math.pow(2,i-t);if(i<t){for(var a=Math.floor(o*e[0]),s=Math.floor(o*e[1]),u=0,c=this._renderedTiles[i].slice();u<c.length;u++)if((v=c[u])[0]===a&&v[1]===s){y=this._renderedTiles[i].indexOf(v);this._renderedTiles[i].splice(y,1)}}else for(var l=o*e[0],h=l+o-1,p=o*e[1],f=p+o-1,d=0,m=this._renderedTiles[i].slice();d<m.length;d++){var v=m[d];if(v[0]>=l&&v[0]<=h&&v[1]>=p&&v[1]<=f){var y=this._renderedTiles[i].indexOf(v);this._renderedTiles[i].splice(y,1)}}0===this._renderedTiles[i].length&&delete this._renderedTiles[i]}this._renderedTiles[t].push(e),this._renderedCurrentLevelTiles[this._tileKey(this._tileSize,e)]=!0},e.prototype._tileKey=function(e,t){return e+"-"+t[0]+"-"+t[1]},e}();r.TextureProvider=o,r.default=o},{"rxjs/Subject":162,three:311}],497:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e){this._document=e||document}return Object.defineProperty(e.prototype,"document",{get:function(){return this._document},enumerable:!0,configurable:!0}),e.prototype.createElement=function(e,t,r){var n=this._document.createElement(e);return t&&(n.className=t),r&&r.appendChild(n),n},e}();r.DOM=n,r.default=n},{}],498:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(){this._events={}}return e.prototype.on=function(e,t){this._events[e]=this._events[e]||[],this._events[e].push(t)},e.prototype.off=function(e,t){if(e)if(this._listens(e))delete this._events[e];else{var r=this._events[e].indexOf(t);r>=0&&this._events[e].splice(r,1),this._events[e].length&&delete this._events[e]}else this._events={}},e.prototype.fire=function(e,t){if(this._listens(e))for(var r=0,n=this._events[e];r<n.length;r++)n[r].call(this,t)},e.prototype._listens=function(e){return!(!this._events||!this._events[e])},e}();r.EventEmitter=n,r.default=n},{}],499:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("../Viewer"),i=function(){function e(){}return e.setOptions=function(t){e._baseImageSize=null!=t.baseImageSize?t.baseImageSize:n.ImageSize.Size640,e._basePanoramaSize=null!=t.basePanoramaSize?t.basePanoramaSize:n.ImageSize.Size2048,e._maxImageSize=null!=t.maxImageSize?t.maxImageSize:n.ImageSize.Size2048},Object.defineProperty(e,"baseImageSize",{get:function(){return e._baseImageSize},enumerable:!0,configurable:!0}),Object.defineProperty(e,"basePanoramaSize",{get:function(){return e._basePanoramaSize},enumerable:!0,configurable:!0}),Object.defineProperty(e,"maxImageSize",{get:function(){return e._maxImageSize},enumerable:!0,configurable:!0}),e}();r.Settings=i,r.default=i},{"../Viewer":375}],500:[function(e,t,r){"use strict";function n(){var e={alpha:!1,antialias:!1,depth:!0,failIfMajorPerformanceCaveat:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,stencil:!0},t=document.createElement("canvas"),r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e);if(!r)return!1;for(var n=["OES_standard_derivatives"],i=r.getSupportedExtensions(),o=0,a=n;o<a.length;o++){var s=a[o];if(-1===i.indexOf(s))return!1}return!0}Object.defineProperty(r,"__esModule",{value:!0}),r.isBrowser=function(){return"undefined"!=typeof window&&"undefined"!=typeof document},r.isArraySupported=function(){return!!(Array.prototype&&Array.prototype.filter&&Array.prototype.indexOf&&Array.prototype.map)},r.isFunctionSupported=function(){return!(!Function.prototype||!Function.prototype.bind)},r.isJSONSupported=function(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON},r.isObjectSupported=function(){return!(!Object.keys||!Object.assign)};var i=void 0;r.isWebGLSupportedCached=function(){return void 0===i&&(i=n()),i},r.isWebGLSupported=n},{}],501:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n="https://vms-dev.maphive.io",i=function(){function e(){}return Object.defineProperty(e,"tileScheme",{get:function(){return"https"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"tileDomain",{get:function(){return"d2qb1440i7l50o.cloudfront.net"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"origin",{get:function(){return"beeview.webgl"},enumerable:!0,configurable:!0}),e.thumbnail=function(e,t){return"https://d2uvyvbnnia8tb.cloudfront.net/images/"+e+"/thumb-"+t+".jpg?origin="+this.origin},e.falcorModel=function(e){return n+"/model.json?client_id="+e},e.protoMesh=function(e){return"https://d2uvyvbnnia8tb.cloudfront.net/meshs/"+e},e.fetchGraphql=function(){return n+"/graphql"},e.fetchBuildings=function(){return n+"/buildings"},e}();r.Urls=i,r.default=i},{}],502:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n;!function(e){e[e.Bottom=0]="Bottom",e[e.BottomLeft=1]="BottomLeft",e[e.BottomRight=2]="BottomRight",e[e.Center=3]="Center",e[e.Left=4]="Left",e[e.Right=5]="Right",e[e.Top=6]="Top",e[e.TopLeft=7]="TopLeft",e[e.TopRight=8]="TopRight"}(n=r.Alignment||(r.Alignment={})),r.default=n},{}],503:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),e("rxjs/add/operator/bufferCount"),e("rxjs/add/operator/delay"),e("rxjs/add/operator/distinctUntilChanged"),e("rxjs/add/operator/map"),e("rxjs/add/operator/switchMap");var n=function(){function e(e,t){this._graphService=e,this._stateService=t,this._started=!1}return Object.defineProperty(e.prototype,"started",{get:function(){return this._started},enumerable:!0,configurable:!0}),e.prototype.start=function(){var e=this;this._started||(this._uncacheSubscription=this._stateService.currentState$.distinctUntilChanged(void 0,function(e){return e.state.currentNode.key}).map(function(e){return e.state.trajectory.map(function(e){return e.key})}).bufferCount(1,5).switchMap(function(t){var r=t[0];return e._graphService.uncache$(r)}).subscribe(function(){}),this._started=!0)},e.prototype.stop=function(){this._started&&(this._uncacheSubscription.unsubscribe(),this._uncacheSubscription=null,this._started=!1)},e}();r.CacheService=n,r.default=n},{"rxjs/add/operator/bufferCount":178,"rxjs/add/operator/delay":184,"rxjs/add/operator/distinctUntilChanged":186,"rxjs/add/operator/map":193,"rxjs/add/operator/switchMap":208}],504:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("../Component"),i=function(){function e(e,t,r,i,o,a){var s=this;this._container=e,this._observer=r,this._navigator=t,this._options=null!=o?o:{},this._key=i,this._navigable=null==i,this._componentService=a||new n.ComponentService(this._container,this._navigator),this._coverComponent=this._componentService.getCover(),this._initializeComponents(),i?(this._initilizeCoverComponent(),this._subscribeCoverComponent()):this._navigator.movedToKey$.first(function(e){return null!=e}).subscribe(function(e){s._key=e,s._componentService.deactivateCover(),s._coverComponent.configure({key:s._key,state:n.CoverState.Hidden}),s._subscribeCoverComponent(),s._navigator.stateService.start(),s._observer.startEmit()})}return Object.defineProperty(e.prototype,"navigable",{get:function(){return this._navigable},enumerable:!0,configurable:!0}),e.prototype.get=function(e){return this._componentService.get(e)},e.prototype.activate=function(e){this._componentService.activate(e)},e.prototype.activateCover=function(){this._coverComponent.configure({state:n.CoverState.Visible})},e.prototype.deactivate=function(e){this._componentService.deactivate(e)},e.prototype.deactivateCover=function(){this._coverComponent.configure({state:n.CoverState.Loading})},e.prototype.resize=function(){this._componentService.resize()},e.prototype._initializeComponents=function(){var e=this._options;this._uFalse(e.background,"background"),this._uFalse(e.debug,"debug"),this._uFalse(e.image,"image"),this._uFalse(e.navigation,"navigation"),this._uFalse(e.popup,"popup"),this._uFalse(e.route,"route"),this._uFalse(e.slider,"slider"),this._uFalse(e.tag,"tag"),this._uFalse(e.sequence,"sequence"),this._uFalse(e.direction,"direction"),this._uTrue(e.path,"path"),this._uTrue(e.bearing,"bearing"),this._uTrue(e.cache,"cache"),this._uTrue(e.imagePlane,"imagePlane"),this._uTrue(e.keyboard,"keyboard"),this._uTrue(e.loading,"loading"),this._uTrue(e.mouse,"mouse"),this._uTrue(e.stats,"stats")},e.prototype._initilizeCoverComponent=function(){var e=this._options;this._coverComponent.configure({key:this._key}),void 0===e.cover||e.cover?this.activateCover():this.deactivateCover()},e.prototype._setNavigable=function(e){this._navigable!==e&&(this._navigable=e,this._observer.navigable$.next(e))},e.prototype._subscribeCoverComponent=function(){var e=this;this._coverComponent.configuration$.subscribe(function(t){t.state===n.CoverState.Loading?e._navigator.stateService.currentKey$.first().switchMap(function(r){var n=null==r||r!==t.key;return n&&e._setNavigable(!1),n?e._navigator.moveToKey$(t.key):e._navigator.stateService.currentNode$.first()}).subscribe(function(t){e._navigator.stateService.start(),e._observer.startEmit(),e._coverComponent.configure({state:n.CoverState.Hidden}),e._componentService.deactivateCover(),e._setNavigable(!0)},function(t){console.error("Failed to deactivate cover.",t),e._coverComponent.configure({state:n.CoverState.Visible})}):t.state===n.CoverState.Visible&&(e._observer.stopEmit(),e._navigator.stateService.stop(),e._componentService.activateCover(),e._setNavigable(null==t.key))})},e.prototype._uFalse=function(e,t){void 0!==e?"boolean"!=typeof e?(this._componentService.configure(t,e),this._componentService.activate(t)):e?this._componentService.activate(t):this._componentService.deactivate(t):this._componentService.deactivate(t)},e.prototype._uTrue=function(e,t){void 0!==e?"boolean"!=typeof e?(this._componentService.configure(t,e),this._componentService.activate(t)):e?this._componentService.activate(t):this._componentService.deactivate(t):this._componentService.activate(t)},e}();r.ComponentController=i},{"../Component":365}],505:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("../Render"),i=e("../Utils"),o=e("../Viewer"),a=function(){function e(e,t,r,a){if(this.id=e,this._dom=a||new i.DOM,this._container=this._dom.document.getElementById(e),!this._container)throw new Error("Container '"+e+"' not found.");this._container.classList.add("beeview-js"),this._canvasContainer=this._dom.createElement("div","beeview-js-interactive",this._container),this._domContainer=this._dom.createElement("div","beeview-js-dom",this._container),this.renderService=new n.RenderService(this._container,t.currentState$,r.renderMode),this.glRenderer=new n.GLRenderer(this._canvasContainer,this.renderService,this._dom),this.domRenderer=new n.DOMRenderer(this._domContainer,this.renderService,t.currentState$),this.keyboardService=new o.KeyboardService(this._canvasContainer),this.mouseService=new o.MouseService(this._container,this._canvasContainer,this._domContainer,document),this.touchService=new o.TouchService(this._canvasContainer,this._domContainer),this.spriteService=new o.SpriteService(r.sprite)}return Object.defineProperty(e.prototype,"element",{get:function(){return this._container},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canvasContainer",{get:function(){return this._canvasContainer},enumerable:!0,configurable:!0}),e}();r.Container=a,r.default=a},{"../Render":370,"../Utils":374,"../Viewer":375}],506:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});!function(e){e[e.Size320=320]="Size320",e[e.Size640=640]="Size640",e[e.Size1024=1024]="Size1024",e[e.Size2048=2048]="Size2048"}(r.ImageSize||(r.ImageSize={}))},{}],507:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/Observable"),i=function(){function e(e){this._keyDown$=n.Observable.fromEvent(e,"keydown")}return Object.defineProperty(e.prototype,"keyDown$",{get:function(){return this._keyDown$},enumerable:!0,configurable:!0}),e}();r.KeyboardService=i,r.default=i},{"rxjs/Observable":157}],508:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("underscore"),i=e("rxjs/Subject");e("rxjs/add/operator/debounceTime"),e("rxjs/add/operator/distinctUntilChanged"),e("rxjs/add/operator/map"),e("rxjs/add/operator/publishReplay"),e("rxjs/add/operator/scan"),e("rxjs/add/operator/startWith");var o=function(){function e(){this._loadersSubject$=new i.Subject,this._loaders$=this._loadersSubject$.scan(function(e,t){return void 0!==t.task&&(e[t.task]=t.loading),e},{}).startWith({}).publishReplay(1).refCount()}return Object.defineProperty(e.prototype,"loading$",{get:function(){return this._loaders$.map(function(e){return n.reduce(e,function(e,t){return e||t},!1)}).debounceTime(100).distinctUntilChanged()},enumerable:!0,configurable:!0}),e.prototype.taskLoading$=function(e){return this._loaders$.map(function(t){return!!t[e]}).debounceTime(100).distinctUntilChanged()},e.prototype.startLoading=function(e){this._loadersSubject$.next({loading:!0,task:e})},e.prototype.stopLoading=function(e){this._loadersSubject$.next({loading:!1,task:e})},e}();r.LoadingService=o,r.default=o},{"rxjs/Subject":162,"rxjs/add/operator/debounceTime":183,"rxjs/add/operator/distinctUntilChanged":186,"rxjs/add/operator/map":193,"rxjs/add/operator/publishReplay":200,"rxjs/add/operator/scan":202,"rxjs/add/operator/startWith":207,underscore:313}],509:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/BehaviorSubject"),i=e("rxjs/Observable"),o=e("rxjs/Subject");e("rxjs/add/observable/fromEvent"),e("rxjs/add/operator/distinctUntilChanged"),e("rxjs/add/operator/filter"),e("rxjs/add/operator/map"),e("rxjs/add/operator/merge"),e("rxjs/add/operator/mergeMap"),e("rxjs/add/operator/publishReplay"),e("rxjs/add/operator/scan"),e("rxjs/add/operator/switchMap"),e("rxjs/add/operator/withLatestFrom");var a=e("../Geo"),s=function(){function e(e,t,r,s,u){var c=this;this._canvasContainer=t,this._domContainer=r,this._viewportCoords=null!=u?u:new a.ViewportCoords,this._activeSubject$=new n.BehaviorSubject(!1),this._active$=this._activeSubject$.distinctUntilChanged().publishReplay(1).refCount(),this._claimMouse$=new o.Subject,this._claimWheel$=new o.Subject,this._deferPixelClaims$=new o.Subject,this._deferPixels$=this._deferPixelClaims$.scan(function(e,t){return null==t.deferPixels?delete e[t.name]:e[t.name]=t.deferPixels,e},{}).map(function(e){var t=-1;for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];n>t&&(t=n)}return t}).startWith(-1).publishReplay(1).refCount(),this._deferPixels$.subscribe(function(){}),this._documentMouseMove$=i.Observable.fromEvent(s,"mousemove"),this._documentMouseUp$=i.Observable.fromEvent(s,"mouseup"),this._mouseDown$=i.Observable.fromEvent(t,"mousedown"),this._mouseLeave$=i.Observable.fromEvent(t,"mouseleave"),this._mouseMove$=i.Observable.fromEvent(t,"mousemove"),this._mouseUp$=i.Observable.fromEvent(t,"mouseup"),this._mouseOut$=i.Observable.fromEvent(t,"mouseout"),this._mouseOver$=i.Observable.fromEvent(t,"mouseover"),this._domMouseDown$=i.Observable.fromEvent(r,"mousedown"),this._domMouseMove$=i.Observable.fromEvent(r,"mousemove"),this._click$=i.Observable.fromEvent(t,"click"),this._contextMenu$=i.Observable.fromEvent(t,"contextmenu"),this._dblClick$=i.Observable.merge(i.Observable.fromEvent(e,"click"),i.Observable.fromEvent(t,"dblclick")).bufferCount(3,1).filter(function(e){var r=e[0],n=e[1],i=e[2];return"click"===r.type&&"click"===n.type&&"dblclick"===i.type&&r.target.parentNode===t&&n.target.parentNode===t}).map(function(e){return e[2]}).share(),i.Observable.merge(this._domMouseDown$,this._domMouseMove$,this._dblClick$,this._contextMenu$).subscribe(function(e){e.preventDefault()}),this._mouseWheel$=i.Observable.merge(i.Observable.fromEvent(t,"wheel"),i.Observable.fromEvent(r,"wheel")).share(),this._consistentContextMenu$=i.Observable.merge(this._mouseDown$,this._mouseMove$,this._mouseOut$,this._mouseUp$,this._contextMenu$).bufferCount(3,1).filter(function(e){return"mousedown"===e[0].type&&"contextmenu"===e[1].type&&"mouseup"===e[2].type}).map(function(e){return e[1]}).share();var l=i.Observable.merge(i.Observable.fromEvent(window,"blur"),this._documentMouseUp$.filter(function(e){return 0===e.button})).share(),h=this._createMouseDragInitiate$(this._mouseDown$,l,!0).share();this._mouseDragStart$=this._createMouseDragStart$(h).share(),this._mouseDrag$=this._createMouseDrag$(h,l).share(),this._mouseDragEnd$=this._createMouseDragEnd$(this._mouseDragStart$,l).share();var p=this._createMouseDragInitiate$(this._domMouseDown$,l,!1).share();this._domMouseDragStart$=this._createMouseDragStart$(p).share(),this._domMouseDrag$=this._createMouseDrag$(p,l).share(),this._domMouseDragEnd$=this._createMouseDragEnd$(this._domMouseDragStart$,l).share(),this._proximateClick$=this._mouseDown$.switchMap(function(e){return c._click$.takeUntil(c._createDeferredMouseMove$(e,c._documentMouseMove$)).take(1)}).share(),this._staticClick$=this._mouseDown$.switchMap(function(e){return c._click$.takeUntil(c._documentMouseMove$).take(1)}).share(),this._mouseDragStart$.subscribe(),this._mouseDrag$.subscribe(),this._mouseDragEnd$.subscribe(),this._domMouseDragStart$.subscribe(),this._domMouseDrag$.subscribe(),this._domMouseDragEnd$.subscribe(),this._staticClick$.subscribe(),this._mouseOwner$=this._createOwner$(this._claimMouse$).publishReplay(1).refCount(),this._wheelOwner$=this._createOwner$(this._claimWheel$).publishReplay(1).refCount(),this._mouseOwner$.subscribe(function(){}),this._wheelOwner$.subscribe(function(){})}return Object.defineProperty(e.prototype,"active$",{get:function(){return this._active$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activate$",{get:function(){return this._activeSubject$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"documentMouseMove$",{get:function(){return this._documentMouseMove$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"documentMouseUp$",{get:function(){return this._documentMouseUp$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"domMouseDragStart$",{get:function(){return this._domMouseDragStart$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"domMouseDrag$",{get:function(){return this._domMouseDrag$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"domMouseDragEnd$",{get:function(){return this._domMouseDragEnd$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"domMouseDown$",{get:function(){return this._domMouseDown$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"domMouseMove$",{get:function(){return this._domMouseMove$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mouseOwner$",{get:function(){return this._mouseOwner$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mouseDown$",{get:function(){return this._mouseDown$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mouseMove$",{get:function(){return this._mouseMove$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mouseLeave$",{get:function(){return this._mouseLeave$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mouseOut$",{get:function(){return this._mouseOut$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mouseOver$",{get:function(){return this._mouseOver$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mouseUp$",{get:function(){return this._mouseUp$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"click$",{get:function(){return this._click$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dblClick$",{get:function(){return this._dblClick$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contextMenu$",{get:function(){return this._consistentContextMenu$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mouseWheel$",{get:function(){return this._mouseWheel$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mouseDragStart$",{get:function(){return this._mouseDragStart$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mouseDrag$",{get:function(){return this._mouseDrag$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mouseDragEnd$",{get:function(){return this._mouseDragEnd$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"proximateClick$",{get:function(){return this._proximateClick$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"staticClick$",{get:function(){return this._staticClick$},enumerable:!0,configurable:!0}),e.prototype.claimMouse=function(e,t){this._claimMouse$.next({name:e,zindex:t})},e.prototype.unclaimMouse=function(e){this._claimMouse$.next({name:e,zindex:null})},e.prototype.deferPixels=function(e,t){this._deferPixelClaims$.next({name:e,deferPixels:t})},e.prototype.undeferPixels=function(e){this._deferPixelClaims$.next({name:e,deferPixels:null})},e.prototype.claimWheel=function(e,t){this._claimWheel$.next({name:e,zindex:t})},e.prototype.unclaimWheel=function(e){this._claimWheel$.next({name:e,zindex:null})},e.prototype.filtered$=function(e,t){return this._filtered(e,t,this._mouseOwner$)},e.prototype.filteredWheel$=function(e,t){return this._filtered(e,t,this._wheelOwner$)},e.prototype._createDeferredMouseMove$=function(e,t){return t.map(function(t){var r=t.clientX-e.clientX,n=t.clientY-e.clientY;return[t,Math.sqrt(r*r+n*n)]}).withLatestFrom(this._deferPixels$).filter(function(e){var t=e[0];t[0];return t[1]>e[1]}).map(function(e){var t=e[0],r=t[0];t[1],e[1];return r})},e.prototype._createMouseDrag$=function(e,t){var r=this;return e.map(function(e){e[0];return e[1]}).switchMap(function(e){return i.Observable.of(e).concat(r._documentMouseMove$).takeUntil(t)})},e.prototype._createMouseDragEnd$=function(e,t){return e.switchMap(function(e){return t.first()})},e.prototype._createMouseDragStart$=function(e){return e.map(function(e){var t=e[0];e[1];return t})},e.prototype._createMouseDragInitiate$=function(e,t,r){var n=this;return e.filter(function(e){return 0===e.button}).switchMap(function(e){return i.Observable.combineLatest(i.Observable.of(e),r?n._createDeferredMouseMove$(e,n._documentMouseMove$):n._documentMouseMove$).takeUntil(t).take(1)})},e.prototype._createOwner$=function(e){return e.scan(function(e,t){return null==t.zindex?delete e[t.name]:e[t.name]=t.zindex,e},{}).map(function(e){var t=null,r=-1;for(var n in e)e.hasOwnProperty(n)&&e[n]>r&&(r=e[n],t=n);return t}).startWith(null)},e.prototype._filtered=function(e,t,r){return t.withLatestFrom(r).filter(function(t){t[0];return t[1]===e}).map(function(e){var t=e[0];e[1];return t})},e}();r.MouseService=s,r.default=s},{"../Geo":368,"rxjs/BehaviorSubject":154,"rxjs/Observable":157,"rxjs/Subject":162,"rxjs/add/observable/fromEvent":170,"rxjs/add/operator/distinctUntilChanged":186,"rxjs/add/operator/filter":189,"rxjs/add/operator/map":193,"rxjs/add/operator/merge":194,"rxjs/add/operator/mergeMap":196,"rxjs/add/operator/publishReplay":200,"rxjs/add/operator/scan":202,"rxjs/add/operator/switchMap":208,"rxjs/add/operator/withLatestFrom":213}],510:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/BehaviorSubject"),i=e("rxjs/Observable"),o=e("rxjs/ReplaySubject");e("rxjs/add/observable/throw"),e("rxjs/add/operator/do"),e("rxjs/add/operator/finally"),e("rxjs/add/operator/first"),e("rxjs/add/operator/map"),e("rxjs/add/operator/mergeMap");var a=e("../API"),s=e("../Graph"),u=e("../Edge"),c=e("../State"),l=e("../Viewer"),h=function(){function e(e,t,r,i,o,u,h,p){this._apiV3=null!=r?r:new a.APIv3(e,t),this._imageLoadingService=null!=o?o:new s.ImageLoadingService,this._graphService=null!=i?i:new s.GraphService(new s.Graph(this.apiV3),this._imageLoadingService),this._loadingService=null!=u?u:new l.LoadingService,this._loadingName="navigator",this._stateService=null!=h?h:new c.StateService,this._cacheService=null!=p?p:new l.CacheService(this._graphService,this._stateService),this._cacheService.start(),this._keyRequested$=new n.BehaviorSubject(null),this._movedToKey$=new n.BehaviorSubject(null),this._request$=null,this._requestSubscription=null,this._nodeRequestSubscription=null}return Object.defineProperty(e.prototype,"apiV3",{get:function(){return this._apiV3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphService",{get:function(){return this._graphService},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageLoadingService",{get:function(){return this._imageLoadingService},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loadingService",{get:function(){return this._loadingService},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"movedToKey$",{get:function(){return this._movedToKey$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stateService",{get:function(){return this._stateService},enumerable:!0,configurable:!0}),e.prototype.moveToKey$=function(e){this._abortRequest("to key "+e),this._loadingService.startLoading(this._loadingName);var t=this._moveToKey$(e);return this._makeRequest$(t)},e.prototype.moveDir$=function(e){var t=this;this._abortRequest("in dir "+u.EdgeDirection[e]),this._loadingService.startLoading(this._loadingName);var r=this.stateService.currentNode$.first().mergeMap(function(t){return([u.EdgeDirection.Next,u.EdgeDirection.Prev].indexOf(e)>-1?t.sequenceEdges$:t.spatialEdges$).first().map(function(t){for(var r=0,n=t.edges;r<n.length;r++){var i=n[r];if(i.data.direction===e)return i.to}return null})}).mergeMap(function(r){return null==r?(t._loadingService.stopLoading(t._loadingName),i.Observable.throw(new Error("Direction ("+e+") does not exist for current node."))):t._moveToKey$(r)});return this._makeRequest$(r)},e.prototype.moveCloseTo$=function(e,t){var r=this;this._abortRequest("to lat "+e+", lon "+t),this._loadingService.startLoading(this._loadingName);var n=this.apiV3.imageCloseTo$(e,t).mergeMap(function(n){return null==n?(r._loadingService.stopLoading(r._loadingName),i.Observable.throw(new Error("No image found close to lat "+e+", lon "+t+"."))):r._moveToKey$(n.key)});return this._makeRequest$(n)},e.prototype.setFilter$=function(e){var t=this;return this._stateService.clearNodes(),this._movedToKey$.first().mergeMap(function(r){return null!=r?t._trajectoryKeys$().mergeMap(function(r){return t._graphService.setFilter$(e).mergeMap(function(e){return t._cacheKeys$(r)})}).last():t._keyRequested$.first().mergeMap(function(r){return null!=r?t._graphService.setFilter$(e).mergeMap(function(e){return t._graphService.cacheNode$(r)}):t._graphService.setFilter$(e).map(function(e){})})}).map(function(e){})},e.prototype.setToken$=function(e){var t=this;return this._abortRequest("to set token"),this._stateService.clearNodes(),this._movedToKey$.first().do(function(r){t._apiV3.setToken(e)}).mergeMap(function(e){return null==e?t._graphService.reset$([]).map(function(e){}):t._trajectoryKeys$().mergeMap(function(e){return t._graphService.reset$(e).mergeMap(function(r){return t._cacheKeys$(e)})}).last().map(function(e){})})},e.prototype._cacheKeys$=function(e){var t=this,r=e.map(function(e){return t._graphService.cacheNode$(e)});return i.Observable.from(r).mergeAll()},e.prototype._abortRequest=function(e){null!=this._requestSubscription&&(this._requestSubscription.unsubscribe(),this._requestSubscription=null),null!=this._nodeRequestSubscription&&(this._nodeRequestSubscription.unsubscribe(),this._nodeRequestSubscription=null),null!=this._request$&&(this._request$.error(new Error("Request aborted by a subsequent request "+e+".")),this._request$=null)},e.prototype._makeRequest$=function(e){var t=this;return this._request$=new o.ReplaySubject(1),this._requestSubscription=this._request$.subscribe(void 0,function(e){}),this._nodeRequestSubscription=e.subscribe(function(e){t._request$.next(e),t._request$.complete()},function(e){t._request$.error(e)}),this._request$},e.prototype._moveToKey$=function(e){var t=this;return this._keyRequested$.next(e),this._graphService.cacheNode$(e).do(function(r){t._graphService.cachePath$(e),t._stateService.setNodes([r]),t._movedToKey$.next(r.key)}).finally(function(){t._loadingService.stopLoading(t._loadingName)})},e.prototype._trajectoryKeys$=function(){return this._stateService.currentState$.first().map(function(e){return e.state.trajectory.map(function(e){return e.key})})},e}();r.Navigator=h,r.default=h},{"../API":363,"../Edge":366,"../Graph":369,"../State":371,"../Viewer":375,"rxjs/BehaviorSubject":154,"rxjs/Observable":157,"rxjs/ReplaySubject":160,"rxjs/add/observable/throw":174,"rxjs/add/operator/do":187,"rxjs/add/operator/finally":190,"rxjs/add/operator/first":191,"rxjs/add/operator/map":193,"rxjs/add/operator/mergeMap":196}],511:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/Observable"),i=e("rxjs/Subject");e("rxjs/add/observable/combineLatest"),e("rxjs/add/operator/distinctUntilChanged"),e("rxjs/add/operator/map"),e("rxjs/add/operator/throttleTime");var o=e("../component/marker/Marker");r.MarkerComponent=o;var a=e("../Viewer"),s=e("when"),u=function(){function e(e,t,r){var n=this;this._container=r,this._eventEmitter=e,this._navigator=t,this._projection=new a.Projection,this._started=!1,this._navigable$=new i.Subject,this._navigable$.subscribe(function(e){n._eventEmitter.fire(a.Viewer.navigablechanged,e)}),this._navigator.loadingService.loading$.subscribe(function(e){n._eventEmitter.fire(a.Viewer.loadingchanged,e)})}return Object.defineProperty(e.prototype,"started",{get:function(){return this._started},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"navigable$",{get:function(){return this._navigable$},enumerable:!0,configurable:!0}),e.prototype.projectBasic$=function(e){var t=this;return n.Observable.combineLatest(this._container.renderService.renderCamera$,this._navigator.stateService.currentTransform$).first().map(function(r){var n=r[0],i=r[1],o=t._projection.basicToCanvas(e,t._container.element,n,i);return[Math.round(o[0]),Math.round(o[1])]})},e.prototype.startEmit=function(){var e=this;if(!this._started){this._started=!0,this._currentNodeSubscription=this._navigator.stateService.currentNodeExternal$.subscribe(function(t){e.setFilter(["==","floor",t.floor.id]),e._eventEmitter.fire(a.Viewer.nodechanged,t)}),this._sequenceEdgesSubscription=this._navigator.stateService.currentNodeExternal$.switchMap(function(e){return e.sequenceEdges$}).subscribe(function(t){e._eventEmitter.fire(a.Viewer.sequenceedgeschanged,t)}),this._spatialEdgesSubscription=this._navigator.stateService.currentNodeExternal$.switchMap(function(e){return e.spatialEdges$}).subscribe(function(t){e._eventEmitter.fire(a.Viewer.spatialedgeschanged,t)}),this._moveSubscription=n.Observable.combineLatest(this._navigator.stateService.inMotion$,this._container.mouseService.active$,this._container.touchService.active$).map(function(e){return e[0]||e[1]||e[2]}).distinctUntilChanged().subscribe(function(t){t?e._eventEmitter.fire(a.Viewer.movestart,null):e._eventEmitter.fire(a.Viewer.moveend,null)}),this._bearingSubscription=this._container.renderService.bearing$.throttleTime(100).distinctUntilChanged(function(e,t){return Math.abs(t-e)<1}).subscribe(function(t){e._eventEmitter.fire(a.Viewer.bearingchanged,t)});var t=this._container.mouseService.active$.switchMap(function(t){return t?n.Observable.empty():e._container.mouseService.mouseMove$});this._viewerMouseEventSubscription=n.Observable.merge(this._mapMouseEvent$(a.Viewer.click,this._container.mouseService.staticClick$),this._mapMouseEvent$(a.Viewer.contextmenu,this._container.mouseService.contextMenu$),this._mapMouseEvent$(a.Viewer.dblclick,this._container.mouseService.dblClick$),this._mapMouseEvent$(a.Viewer.mousedown,this._container.mouseService.mouseDown$),this._mapMouseEvent$(a.Viewer.mousemove,t),this._mapMouseEvent$(a.Viewer.mouseout,this._container.mouseService.mouseOut$),this._mapMouseEvent$(a.Viewer.mouseover,this._container.mouseService.mouseOver$),this._mapMouseEvent$(a.Viewer.mouseup,this._container.mouseService.mouseUp$)).withLatestFrom(this._container.renderService.renderCamera$,this._navigator.stateService.reference$,this._navigator.stateService.currentTransform$).map(function(t){var r=t[0],n=r[0],i=r[1],o=t[1],a=t[2],s=t[3],u=e._projection.eventToUnprojection(i,e._container.element,o,a,s);return{basicPoint:u.basicPoint,latLon:u.latLon,originalEvent:i,pixelPoint:u.pixelPoint,target:e._eventEmitter,type:n}}).subscribe(function(t){e._eventEmitter.fire(t.type,t)})}},e.prototype.stopEmit=function(){this.started&&(this._started=!1,this._bearingSubscription.unsubscribe(),this._currentNodeSubscription.unsubscribe(),this._moveSubscription.unsubscribe(),this._sequenceEdgesSubscription.unsubscribe(),this._spatialEdgesSubscription.unsubscribe(),this._viewerMouseEventSubscription.unsubscribe(),this._bearingSubscription=null,this._currentNodeSubscription=null,this._moveSubscription=null,this._sequenceEdgesSubscription=null,this._spatialEdgesSubscription=null,this._viewerMouseEventSubscription=null)},e.prototype.unproject$=function(e){var t=this;return n.Observable.combineLatest(this._container.renderService.renderCamera$,this._navigator.stateService.reference$,this._navigator.stateService.currentTransform$).first().map(function(r){var n=r[0],i=r[1],o=r[2];return t._projection.canvasToUnprojection(e,t._container.element,n,i,o).latLon})},e.prototype.unprojectBasic$=function(e){var t=this;return n.Observable.combineLatest(this._container.renderService.renderCamera$,this._navigator.stateService.currentTransform$).first().map(function(r){var n=r[0],i=r[1];return t._projection.canvasToBasic(e,t._container.element,n,i)})},e.prototype.setFilter=function(e){var t=this;return s.promise(function(r,n){t._navigator.setFilter$(e).subscribe(function(){r(void 0)},function(e){n(e)})})},e.prototype._mapMouseEvent$=function(e,t){return t.map(function(t){return[e,t]})},e}();r.Observer=u,r.default=u},{"../Viewer":375,"../component/marker/Marker":405,"rxjs/Observable":157,"rxjs/Subject":162,"rxjs/add/observable/combineLatest":166,"rxjs/add/operator/distinctUntilChanged":186,"rxjs/add/operator/map":193,"rxjs/add/operator/throttleTime":212,when:358}],512:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("three"),i=e("../Geo"),o=function(){function e(e,t){this._geoCoords=e||new i.GeoCoords,this._viewportCoords=t||new i.ViewportCoords}return e.prototype.basicToCanvas=function(e,t,r,n){return this._viewportCoords.basicToCanvas(e[0],e[1],t,n,r.perspective)},e.prototype.canvasToBasic=function(e,t,r,n){var i=this._viewportCoords.canvasToBasic(e[0],e[1],t,n,r.perspective);return(i[0]<0||i[0]>1||i[1]<0||i[1]>1)&&(i=null),i},e.prototype.eventToUnprojection=function(e,t,r,n,i){var o=this._viewportCoords.canvasPosition(e,t);return this.canvasToUnprojection(o,t,r,n,i)},e.prototype.canvasToUnprojection=function(e,t,r,i,o){var a=e[0],s=e[1],u=this._viewportCoords.canvasToViewport(a,s,t),c=u[0],l=u[1],h=new n.Vector3(c,l,1).unproject(r.perspective),p=o.projectBasic(h.toArray());(p[0]<0||p[0]>1||p[1]<0||p[1]>1)&&(p=null);var f=h.clone().sub(r.camera.position).normalize(),d=-2/f.z,m=null;if(d>0&&d<100&&p){var v=f.clone().multiplyScalar(d).add(r.camera.position),y=this._geoCoords.enuToGeodetic(v.x,v.y,v.z,i.lat,i.lon,i.alt).slice(0,2);m={lat:y[0],lon:y[1]}}return{basicPoint:p,latLon:m,pixelPoint:[a,s]}},e}();r.Projection=o,r.default=o},{"../Geo":368,three:311}],513:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("three"),i=e("virtual-dom"),o=e("rxjs/Subject");e("rxjs/add/operator/publishReplay"),e("rxjs/add/operator/scan"),e("rxjs/add/operator/startWith");var a=e("../Viewer"),s=function(){function e(){}return Object.defineProperty(e.prototype,"json",{set:function(e){this._json=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"image",{set:function(e){this._image=e,this._texture=new n.Texture(this._image),this._texture.minFilter=n.NearestFilter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loaded",{get:function(){return!(!this._image||!this._json)},enumerable:!0,configurable:!0}),e.prototype.getGLSprite=function(e){if(!this.loaded)throw new Error("Sprites cannot be retrieved before the atlas is loaded.");var t=this._json[e];if(!t)return console.warn("Sprite with key"+e+"does not exist in sprite definition."),new n.Object3D;var r=this._texture.clone();r.needsUpdate=!0;var i=this._image.width,o=this._image.height;r.offset.x=t.x/i,r.offset.y=(o-t.y-t.height)/o,r.repeat.x=t.width/i,r.repeat.y=t.height/o;var a=new n.SpriteMaterial({map:r});return new n.Sprite(a)},e.prototype.getDOMSprite=function(e,t){if(!this.loaded)throw new Error("Sprites cannot be retrieved before the atlas is loaded.");null==t&&(t=a.Alignment.Center);var r=this._json[e];if(!r)return console.warn("Sprite with key"+e+"does not exist in sprite definition."),i.h("div",{},[]);var n=r.y,o=r.x+r.width,s=r.y+r.height,u=r.x,c=-r.x,l=-r.y,h=this._image.height,p=this._image.width;switch(t){case a.Alignment.Bottom:case a.Alignment.Center:case a.Alignment.Top:c-=r.width/2;break;case a.Alignment.BottomLeft:case a.Alignment.Left:case a.Alignment.TopLeft:c-=r.width;break;case a.Alignment.BottomRight:case a.Alignment.Right:case a.Alignment.BottomRight:}switch(t){case a.Alignment.Center:case a.Alignment.Left:case a.Alignment.Right:l-=r.height/2;break;case a.Alignment.Top:case a.Alignment.TopLeft:case a.Alignment.TopRight:l-=r.height;break;case a.Alignment.Bottom:case a.Alignment.BottomLeft:case a.Alignment.BottomRight:}var f=1/r.pixelRatio;n*=f,o*=f,s*=f,u*=f,c*=f,l*=f,h*=f,p*=f;var d={src:this._image.src,style:{clip:"rect("+n+"px, "+o+"px, "+s+"px, "+u+"px)",height:h+"px",left:c+"px",position:"absolute",top:l+"px",width:p+"px"}};return i.h("img",d,[])},e}(),u=function(){function e(e){var t=this;if(this._retina=window.devicePixelRatio>1,this._spriteAtlasOperation$=new o.Subject,this._spriteAtlas$=this._spriteAtlasOperation$.startWith(function(e){return e}).scan(function(e,t){return t(e)},new s).publishReplay(1).refCount(),this._spriteAtlas$.subscribe(function(){}),null!=e){var r=this._retina?"@2x":"",n=new XMLHttpRequest;n.open("GET",e+r+".png",!0),n.responseType="arraybuffer",n.onload=function(){var e=new Image;e.onload=function(){t._spriteAtlasOperation$.next(function(t){return t.image=e,t})};var r=new Blob([n.response]);e.src=window.URL.createObjectURL(r)},n.onerror=function(t){console.error(new Error("Failed to fetch sprite sheet ("+e+r+".png)"))},n.send();var i=new XMLHttpRequest;i.open("GET",e+r+".json",!0),i.responseType="text",i.onload=function(){var e=JSON.parse(i.response);t._spriteAtlasOperation$.next(function(t){return t.json=e,t})},i.onerror=function(t){console.error(new Error("Failed to fetch sheet ("+e+r+".json)"))},i.send()}}return Object.defineProperty(e.prototype,"spriteAtlas$",{get:function(){return this._spriteAtlas$},enumerable:!0,configurable:!0}),e}();r.SpriteService=u,r.default=u},{"../Viewer":375,"rxjs/Subject":162,"rxjs/add/operator/publishReplay":200,"rxjs/add/operator/scan":202,"rxjs/add/operator/startWith":207,three:311,"virtual-dom":317}],514:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("rxjs/BehaviorSubject"),i=e("rxjs/Observable"),o=e("rxjs/Subject");e("rxjs/add/observable/timer"),e("rxjs/add/operator/bufferWhen"),e("rxjs/add/operator/filter"),e("rxjs/add/operator/map"),e("rxjs/add/operator/merge"),e("rxjs/add/operator/scan"),e("rxjs/add/operator/switchMap");var a=function(){function e(e,t){var r=this;this._canvasContainer=e,this._domContainer=t,this._activeSubject$=new n.BehaviorSubject(!1),this._active$=this._activeSubject$.distinctUntilChanged().publishReplay(1).refCount(),i.Observable.fromEvent(t,"touchmove").subscribe(function(e){e.preventDefault()}),this._touchStart$=i.Observable.fromEvent(e,"touchstart"),this._touchMove$=i.Observable.fromEvent(e,"touchmove"),this._touchEnd$=i.Observable.fromEvent(e,"touchend"),this._touchCancel$=i.Observable.fromEvent(e,"touchcancel");var a=this._touchStart$.filter(function(e){return 1===e.touches.length&&1===e.targetTouches.length}).share();this._doubleTap$=a.bufferWhen(function(){return a.first().switchMap(function(e){return i.Observable.timer(300).merge(a).take(1)})}).filter(function(e){return 2===e.length}).map(function(e){return e[e.length-1]}).share(),this._doubleTap$.subscribe(function(e){e.preventDefault()}),this._singleTouchMove$=this._touchMove$.filter(function(e){return 1===e.touches.length&&1===e.targetTouches.length}).share();var s=i.Observable.merge(this._touchStart$,this._touchEnd$,this._touchCancel$).filter(function(e){return 1===e.touches.length&&1===e.targetTouches.length}),u=i.Observable.merge(this._touchStart$,this._touchEnd$,this._touchCancel$).filter(function(e){return e.touches.length>=1}),c=i.Observable.merge(this._touchEnd$,this._touchCancel$).filter(function(e){return 0===e.touches.length});this._singleTouchDragStart$=s.mergeMap(function(e){return r._singleTouchMove$.takeUntil(i.Observable.merge(c,u)).take(1)}),this._singleTouchDragEnd$=s.mergeMap(function(e){return i.Observable.merge(c,u).first()}),this._singleTouchDrag$=s.switchMap(function(e){return r._singleTouchMove$.skip(1).takeUntil(i.Observable.merge(u,c))});var l=i.Observable.merge(this._touchStart$,this._touchEnd$,this._touchCancel$);this._pinchStart$=l.filter(function(e){return 2===e.touches.length&&2===e.targetTouches.length}),this._pinchEnd$=l.filter(function(e){return 2!==e.touches.length||2!==e.targetTouches.length}),this._pinchOperation$=new o.Subject,this._pinch$=this._pinchOperation$.scan(function(e,t){return t(e)},{changeX:0,changeY:0,clientX:0,clientY:0,distance:0,distanceChange:0,distanceX:0,distanceY:0,originalEvent:null,pageX:0,pageY:0,screenX:0,screenY:0,touch1:null,touch2:null}),this._touchMove$.filter(function(e){return 2===e.touches.length&&2===e.targetTouches.length}).map(function(e){return function(t){var r=e.touches[0],n=e.touches[1],i=Math.min(r.clientX,n.clientX),o=Math.max(r.clientX,n.clientX),a=Math.min(r.clientY,n.clientY),s=i+(o-i)/2,u=a+(Math.max(r.clientY,n.clientY)-a)/2,c=s+r.pageX-r.clientX,l=u+r.pageY-r.clientY,h=s+r.screenX-r.clientX,p=u+r.screenY-r.clientY,f=Math.abs(r.clientX-n.clientX),d=Math.abs(r.clientY-n.clientY),m=Math.sqrt(f*f+d*d),v=m-t.distance;return{changeX:f-t.distanceX,changeY:d-t.distanceY,clientX:s,clientY:u,distance:m,distanceChange:v,distanceX:f,distanceY:d,originalEvent:e,pageX:c,pageY:l,screenX:h,screenY:p,touch1:r,touch2:n}}}).subscribe(this._pinchOperation$),this._pinchChange$=this._pinchStart$.switchMap(function(e){return r._pinch$.skip(1).takeUntil(r._pinchEnd$)})}return Object.defineProperty(e.prototype,"active$",{get:function(){return this._active$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activate$",{get:function(){return this._activeSubject$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"doubleTap$",{get:function(){return this._doubleTap$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"touchStart$",{get:function(){return this._touchStart$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"touchMove$",{get:function(){return this._touchMove$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"touchEnd$",{get:function(){return this._touchEnd$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"touchCancel$",{get:function(){return this._touchCancel$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"singleTouchDragStart$",{get:function(){return this._singleTouchDragStart$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"singleTouchDrag$",{get:function(){return this._singleTouchDrag$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"singleTouchDragEnd$",{get:function(){return this._singleTouchDragEnd$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pinch$",{get:function(){return this._pinchChange$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pinchStart$",{get:function(){return this._pinchStart$},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pinchEnd$",{get:function(){return this._pinchEnd$},enumerable:!0,configurable:!0}),e}();r.TouchService=a},{"rxjs/BehaviorSubject":154,"rxjs/Observable":157,"rxjs/Subject":162,"rxjs/add/observable/timer":175,"rxjs/add/operator/bufferWhen":179,"rxjs/add/operator/filter":189,"rxjs/add/operator/map":193,"rxjs/add/operator/merge":194,"rxjs/add/operator/scan":202,"rxjs/add/operator/switchMap":208}],515:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=e("when"),o=e("rxjs/Observable"),a=e("../Viewer"),s=e("../Utils"),u=function(e){function t(t,r,n,i,o){var u=e.call(this)||this;return i=null!=i?i:{},s.Settings.setOptions(i),u._navigator=new a.Navigator(r,o),u._container=new a.Container(t,u._navigator.stateService,i),u._observer=new a.Observer(u,u._navigator,u._container),u._componentController=new a.ComponentController(u._container,u._navigator,u._observer,n,i.component),u}return n(t,e),Object.defineProperty(t.prototype,"isNavigable",{get:function(){return this._componentController.navigable},enumerable:!0,configurable:!0}),t.prototype.activateComponent=function(e){this._componentController.activate(e)},t.prototype.activateCover=function(){this._componentController.activateCover()},t.prototype.deactivateComponent=function(e){this._componentController.deactivate(e)},t.prototype.deactivateCover=function(){this._componentController.deactivateCover()},t.prototype.getBearing=function(){var e=this;return i.promise(function(t,r){e._container.renderService.bearing$.first().subscribe(function(e){t(e)},function(e){r(e)})})},t.prototype.getCenter=function(){var e=this;return i.promise(function(t,r){e._navigator.stateService.getCenter().subscribe(function(e){t(e)},function(e){r(e)})})},t.prototype.getComponent=function(e){return this._componentController.get(e)},t.prototype.getContainer=function(){return this._container.element},t.prototype.getZoom=function(){var e=this;return i.promise(function(t,r){e._navigator.stateService.getZoom().subscribe(function(e){t(e)},function(e){r(e)})})},t.prototype.moveCloseTo=function(e,t){var r=this.isNavigable?this._navigator.moveCloseTo$(e,t):o.Observable.throw(new Error("Calling moveCloseTo is not supported when viewer is not navigable."));return i.promise(function(e,t){r.subscribe(function(t){e(t)},function(e){t(e)})})},t.prototype.moveDir=function(e){var t=this.isNavigable?this._navigator.moveDir$(e):o.Observable.throw(new Error("Calling moveDir is not supported when viewer is not navigable."));return i.promise(function(e,r){t.subscribe(function(t){e(t)},function(e){r(e)})})},t.prototype.moveToKey=function(e){var t=this.isNavigable?this._navigator.moveToKey$(e):o.Observable.throw(new Error("Calling moveToKey is not supported when viewer is not navigable."));return i.promise(function(e,r){t.subscribe(function(t){e(t)},function(e){r(e)})})},t.prototype.projectFromBasic=function(e){var t=this;return i.promise(function(r,n){t._observer.projectBasic$(e).subscribe(function(e){r(e)},function(e){n(e)})})},t.prototype.resize=function(){this._container.renderService.resize$.next(null),this._componentController.resize()},t.prototype.setAuthToken=function(e){var t=this.isNavigable?this._navigator.setToken$(e):o.Observable.throw(new Error("Calling setAuthToken is not supported when viewer is not navigable."));return i.promise(function(e,r){t.subscribe(function(){e(void 0)},function(e){r(e)})})},t.prototype.setCenter=function(e){this._navigator.stateService.setCenter(e)},t.prototype.setFilter=function(e){var t=this;return i.promise(function(r,n){t._navigator.setFilter$(e).subscribe(function(){r(void 0)},function(e){n(e)})})},t.prototype.setRenderMode=function(e){this._container.renderService.renderMode$.next(e)},t.prototype.setZoom=function(e){this._navigator.stateService.setZoom(e)},t.prototype.setBearing=function(e){var t=this,r=setInterval(function(){t.getBearing().then(function(n){Math.floor(Math.abs(n-e))<15?clearInterval(r):t._navigator.stateService.rotateBasicWithoutInertia([1,0])})})},t.prototype.unproject=function(e){var t=this;return i.promise(function(r,n){t._observer.unproject$(e).subscribe(function(e){r(e)},function(e){n(e)})})},t.prototype.unprojectToBasic=function(e){var t=this;return i.promise(function(r,n){t._observer.unprojectBasic$(e).subscribe(function(e){r(e)},function(e){n(e)})})},t.prototype.fetchSequences=function(e){return this._navigator.apiV3.fetchSequences$(e)},t.bearingchanged="bearingchanged",t.click="click",t.contextmenu="contextmenu",t.dblclick="dblclick",t.loadingchanged="loadingchanged",t.mousedown="mousedown",t.mousemove="mousemove",t.mouseout="mouseout",t.mouseover="mouseover",t.mouseup="mouseup",t.moveend="moveend",t.movestart="movestart",t.navigablechanged="navigablechanged",t.nodechanged="nodechanged",t.sequenceedgeschanged="sequenceedgeschanged",t.spatialedgeschanged="spatialedgeschanged",t}(s.EventEmitter);r.Viewer=u},{"../Utils":374,"../Viewer":375,"rxjs/Observable":157,when:358}]},{},[364])(364)});
|