@arcgis/core 5.2.0-next.61 → 5.2.0-next.63
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/WebDocument2D.d.ts +17 -1
- package/WebDocument2D.js +1 -1
- package/WebLinkChart.js +1 -1
- package/WebMap.js +1 -1
- package/WebScene.js +1 -1
- package/applications/Components/imageryUtils.d.ts +10 -0
- package/applications/Components/imageryUtils.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcgisGlobal.d.ts +7 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02dd79beb13eff6be85e.js +1 -0
- package/assets/esri/core/workers/chunks/04ffe788d2efc0a076dd.js +1 -0
- package/assets/esri/core/workers/chunks/0623acb2bd14a61b65c9.js +29 -0
- package/assets/esri/core/workers/chunks/08c2bf9defcece9e049a.js +1 -0
- package/assets/esri/core/workers/chunks/0d61c8d348b09179777a.js +1 -0
- package/assets/esri/core/workers/chunks/{3abc12d2407e4214963d.js → 13033178de9f637a2356.js} +1 -1
- package/assets/esri/core/workers/chunks/14cd8bb1ad4da8d1d2ca.js +1 -0
- package/assets/esri/core/workers/chunks/23a3d8f91caf3136b2aa.js +1 -0
- package/assets/esri/core/workers/chunks/{3157f85bb319294878ca.js → 2426601b8cae7f06af4d.js} +2 -2
- package/assets/esri/core/workers/chunks/2a1c6df073e6ca6a6365.js +1 -0
- package/assets/esri/core/workers/chunks/{a615a644086e98a90579.js → 3f775deea48e268411f1.js} +3 -3
- package/assets/esri/core/workers/chunks/{e3623e557ab463580fd2.js → 41e821ce229bc56dc1a1.js} +1 -1
- package/assets/esri/core/workers/chunks/{17acbf40e7c1cb42d9bd.js → 44b1cdf28269b4fa8a39.js} +1 -1
- package/assets/esri/core/workers/chunks/44e8cd4b3dad777ab0c9.js +1 -0
- package/assets/esri/core/workers/chunks/456e616f32e7de696d38.js +1 -0
- package/assets/esri/core/workers/chunks/{127b111ee53e4b9184f8.js → 4dcd4a052b40047a9230.js} +1 -1
- package/assets/esri/core/workers/chunks/54b9667450d066c6f6ce.js +1 -0
- package/assets/esri/core/workers/chunks/{aaa66a04b882b0ba2961.js → 5600fc334d20c4f0c83d.js} +1 -1
- package/assets/esri/core/workers/chunks/5dbd8ca7e7b8eb9a0bf7.js +1 -0
- package/assets/esri/core/workers/chunks/5e3d5347223f0111f40f.js +1 -0
- package/assets/esri/core/workers/chunks/62f3ca0719ac6bc76512.js +1 -0
- package/assets/esri/core/workers/chunks/{14c066c31fe37b7f6e63.js → 638ed1297efdb24f4711.js} +1 -1
- package/assets/esri/core/workers/chunks/63ede7295938f7010808.js +1 -0
- package/assets/esri/core/workers/chunks/687cf21e027f49b44d22.js +1 -0
- package/assets/esri/core/workers/chunks/6c98a64d92c9bca78203.js +1 -0
- package/assets/esri/core/workers/chunks/{e7402dfd683f82878360.js → 752343d92ed48e674351.js} +1 -1
- package/assets/esri/core/workers/chunks/7538a0fe0cec3156769e.js +1 -0
- package/assets/esri/core/workers/chunks/{42692a4ce3fb364e321e.js → 763cbb6716e398436a6d.js} +1 -1
- package/assets/esri/core/workers/chunks/{d6aad815fc0ee8e24bb5.js → 7ce52b850dd785bfa33f.js} +1 -1
- package/assets/esri/core/workers/chunks/{64247e439ef3e1f712e9.js → 7fdd6a5fa062778be55d.js} +1 -1
- package/assets/esri/core/workers/chunks/8369edafab7bdc59b95a.js +1 -0
- package/assets/esri/core/workers/chunks/{94e9cf8e729ec36de5be.js → 8c535c6a39d2be2ed655.js} +1 -1
- package/assets/esri/core/workers/chunks/8e1d4867406753c5483c.js +1 -0
- package/assets/esri/core/workers/chunks/92696cce2b980373f9ad.js +1 -0
- package/assets/esri/core/workers/chunks/{580451761cadfe308919.js → 9954149def644c371894.js} +1 -1
- package/assets/esri/core/workers/chunks/9f65cc6d9f7390bb1d5b.js +1 -0
- package/assets/esri/core/workers/chunks/a09ce34fc7c8abe64ed5.js +1 -0
- package/assets/esri/core/workers/chunks/{81659d121ed732bda907.js → a12803108c3b12808698.js} +2 -2
- package/assets/esri/core/workers/chunks/{83991475aa54fd5aa008.js → a965d151515b76dd7566.js} +1 -1
- package/assets/esri/core/workers/chunks/{128799741dd3c6fc69b9.js → ac4131121230cfc14f21.js} +1 -1
- package/assets/esri/core/workers/chunks/afeeb11b39e140303b5a.js +1 -0
- package/assets/esri/core/workers/chunks/b13d2da33ec07e9d41ff.js +1 -0
- package/assets/esri/core/workers/chunks/{33bd9785bd0b6ccef21b.js → b2cf1d3f0d48eac23a84.js} +1 -1
- package/assets/esri/core/workers/chunks/{498d29e8c8be4a12ba12.js → b958f87f23f984131d09.js} +1 -1
- package/assets/esri/core/workers/chunks/c53b2be005721591e29b.js +1 -0
- package/assets/esri/core/workers/chunks/{edf87407dd20685c82ab.js → c82ab4f0908290e70ee9.js} +1 -1
- package/assets/esri/core/workers/chunks/{4e2f3dd158a5228c87ba.js → c85ba0700eafdc8d6f9e.js} +1 -1
- package/assets/esri/core/workers/chunks/d456520e4b119a2816b6.js +1 -0
- package/assets/esri/core/workers/chunks/d83ea3e4e9ab45334068.js +1 -0
- package/assets/esri/core/workers/chunks/{4f59357f535f30a6b5cc.js → d9b83d7dd7d1f7729a91.js} +1 -1
- package/assets/esri/core/workers/chunks/dbcec48c4ba104a6d0b5.js +1 -0
- package/assets/esri/core/workers/chunks/e02f02040b63d9c2e654.js +1 -0
- package/assets/esri/core/workers/chunks/e08c64e4ae5a68eae2be.js +1 -0
- package/assets/esri/core/workers/chunks/e2ddfc96ddba92302e0c.js +1 -0
- package/assets/esri/core/workers/chunks/{61d3fcb419d6bf7e355e.js → e65ee26feca0564aeb9b.js} +1 -1
- package/assets/esri/core/workers/chunks/{35cbf00f0c37a86517af.js → ed1de8b7406269e217b9.js} +1 -1
- package/assets/esri/core/workers/chunks/ed4ac5568dc2815b066d.js +1 -0
- package/assets/esri/core/workers/chunks/f029c12f1afee0e9b2a1.js +1 -0
- package/assets/esri/core/workers/chunks/{461c2de938bf4c9b1442.js → f6715b8765cd36d81ec8.js} +1 -1
- package/assets/esri/core/workers/chunks/{4fb549f11e176fc2f24a.js → f7fa932ade85cb2847b6.js} +1 -1
- package/assets/esri/core/workers/chunks/f9a4f4efd63b8189a4eb.js +1 -0
- package/assets/esri/core/workers/chunks/{26a2d4b95cda0a41d980.js → fa1c58e5b582d61a03ab.js} +1 -1
- package/assets/esri/core/workers/chunks/fa377112ef3b78f6ed18.js +1 -0
- package/chunks/VolumeMask.glsl.js +3 -0
- package/chunks/persistableUrlUtils.js +1 -1
- package/config.js +1 -1
- package/core/Collection.d.ts +42 -6
- package/core/Collection.js +1 -1
- package/core/screenUtils.js +1 -1
- package/geometry/SpatialReference.d.ts +1 -4
- package/geometry/support/intersectsBase.js +1 -1
- package/interfaces.d.ts +14 -0
- package/kernel.js +1 -1
- package/layers/BaseElevationLayer.js +1 -1
- package/layers/ElevationLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/graphics/sources/connections/createConnection.js +1 -1
- package/layers/graphics/sources/parquet/ParquetFileStatistics.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/SceneService.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/save/groupLayerUtils.js +1 -1
- package/layers/save/mediaLayerUtils.js +1 -1
- package/layers/support/ElevationQueryTileCache.js +1 -1
- package/layers/video/types.d.ts +17 -1
- package/linkChart/LinkChartProperties.js +1 -1
- package/package.json +3 -3
- package/popup/FeatureContent.d.ts +311 -0
- package/popup/FeatureContent.js +2 -0
- package/popup/FeatureContentCollection.d.ts +569 -0
- package/popup/FeatureContentCollection.js +2 -0
- package/portal/support/jsonContext.js +1 -1
- package/support/persistableUrlUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/views/2d/layers/BaseLayerView2D.d.ts +2 -2
- package/views/2d/layers/BaseLayerViewGL2D.d.ts +2 -2
- package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureHybridTileLoadStrategy.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/buffer/glUtil.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatHeaderTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectFixedBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheUsage.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +11 -11
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillVisualization.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/IntersectorResult.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
- package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/intersectWithPolygonOffset.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastMaskTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/{CutFillMask.glsl.js → VolumeMask.glsl.js} +1 -1
- package/views/3d/webgl-engine/shaders/VolumeMaskTechnique.js +2 -0
- package/views/View2D.d.ts +2 -2
- package/views/interactive/snapping/featureSources/WorkerTileTreeDebugger.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/webdoc/support/resourceUtils.js +1 -1
- package/webdoc/support/types.d.ts +2 -0
- package/webdoc/support/utils.js +2 -0
- package/webdoc/support/webdocLoadUtils.js +1 -1
- package/webdoc/support/webdocSaveUtils.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ArcadeExecutorProvider.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/rendered-content/RelationshipDetails.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/Grid/Column.d.ts +6 -0
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend/support/heatmapRampUtils.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/support/SelectionList/FeatureItem.d.ts +116 -0
- package/widgets/support/SelectionList/GroupLayerItem.d.ts +94 -0
- package/widgets/support/SelectionList/ItemBase.d.ts +70 -0
- package/widgets/support/SelectionList/LayerItem.d.ts +140 -0
- package/widgets/support/SelectionList/LayerItem.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.d.ts +265 -0
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList/types.d.ts +42 -0
- package/widgets/support/forms/formUtils.js +1 -1
- package/assets/esri/core/workers/chunks/003a87b16f8a4b476e14.js +0 -1
- package/assets/esri/core/workers/chunks/0a50efb07eee36237e21.js +0 -1
- package/assets/esri/core/workers/chunks/129fdd1636e67997337c.js +0 -1
- package/assets/esri/core/workers/chunks/12e0c5b7cc5c3f9e6f0f.js +0 -1
- package/assets/esri/core/workers/chunks/26f1fd3f2be5102aae1d.js +0 -1
- package/assets/esri/core/workers/chunks/34fbeeeeef4bd01672c6.js +0 -1
- package/assets/esri/core/workers/chunks/36fe6adf6517d8f80125.js +0 -1
- package/assets/esri/core/workers/chunks/403f08e0c1a9203f7fba.js +0 -1
- package/assets/esri/core/workers/chunks/4f2170609742b51bd7b8.js +0 -1
- package/assets/esri/core/workers/chunks/5133083222588799493f.js +0 -1
- package/assets/esri/core/workers/chunks/52993a9dc0c56e9bda19.js +0 -1
- package/assets/esri/core/workers/chunks/5527b2da4abe0faa98bb.js +0 -1
- package/assets/esri/core/workers/chunks/5e35828216020f33e26b.js +0 -1
- package/assets/esri/core/workers/chunks/5f0d6c853873a7f32527.js +0 -1
- package/assets/esri/core/workers/chunks/6121cd0264b6841a5bac.js +0 -1
- package/assets/esri/core/workers/chunks/6823ba1688dfedba0107.js +0 -1
- package/assets/esri/core/workers/chunks/705d6b108fd121cea887.js +0 -1
- package/assets/esri/core/workers/chunks/73aa1bfa6e1dc271c9d7.js +0 -1
- package/assets/esri/core/workers/chunks/825eb845216762a1ed2f.js +0 -1
- package/assets/esri/core/workers/chunks/88df19742edb0cdc3e67.js +0 -1
- package/assets/esri/core/workers/chunks/8977c85aecc7e08ab13c.js +0 -1
- package/assets/esri/core/workers/chunks/8bdca809dd88eab9e5d8.js +0 -29
- package/assets/esri/core/workers/chunks/8c5726c7ce40a92901e6.js +0 -1
- package/assets/esri/core/workers/chunks/8c5e65982c3f9295e844.js +0 -1
- package/assets/esri/core/workers/chunks/8ce649e55fefc8eca55c.js +0 -1
- package/assets/esri/core/workers/chunks/90ae80b797642bff0efa.js +0 -1
- package/assets/esri/core/workers/chunks/97c758f736f28c5dab84.js +0 -1
- package/assets/esri/core/workers/chunks/a8ade34612e73862de6f.js +0 -1
- package/assets/esri/core/workers/chunks/a9d391071803b1e9e8a0.js +0 -1
- package/assets/esri/core/workers/chunks/aa3abc07de2921ef6ca1.js +0 -1
- package/assets/esri/core/workers/chunks/b03f09ee2224f0cc526a.js +0 -1
- package/assets/esri/core/workers/chunks/b3f1a442d6b7826e917f.js +0 -1
- package/assets/esri/core/workers/chunks/b819a9187426d0c146df.js +0 -1
- package/assets/esri/core/workers/chunks/d205edd949f3e6e24eb9.js +0 -1
- package/assets/esri/core/workers/chunks/f0225829f7d941914815.js +0 -1
- package/assets/esri/core/workers/chunks/fb34d6d96c8c0d53fcf6.js +0 -1
- package/chunks/CutFillMask.glsl.js +0 -3
- package/chunks/FocusAreaMask.glsl.js +0 -3
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.glsl.js +0 -2
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +0 -2
- package/views/3d/webgl-engine/shaders/CutFillMaskTechnique.js +0 -2
- /package/assets/esri/core/workers/chunks/{81659d121ed732bda907.js.LICENSE.txt → a12803108c3b12808698.js.LICENSE.txt} +0 -0
|
@@ -241,7 +241,7 @@ screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
|
|
|
241
241
|
return size * clamp(mix(factor.x, 1.0, factor.y), factor.z, 1.0);
|
|
242
242
|
}`),t.vertex.code.add(o.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
|
|
243
243
|
return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
|
|
244
|
-
}`)}function c(t){t.uniforms.add(new s.t("screenSizePerspective",t=>l(t.screenSizePerspective,t.screenSizePerspectiveMinPixelReferenceSize)))}function h(t){t.uniforms.add(new s.t("screenSizePerspectiveAlignment",t=>l(t.screenSizePerspectiveAlignment||t.screenSizePerspective,t.screenSizePerspectiveAlignment?null:t.screenSizePerspectiveMinPixelReferenceSize)))}function l(t,e){const i=null!=e&&null!=t?Math.min(t.minPixelSize/e,1):0;return t?(0,r.hZ)(u,t.divisor,t.offset,i):(0,r.hZ)(u,0,0,0)}const u=(0,n.vt)()},77949(t,e,i){i.d(e,{NB:()=>f,Nz:()=>_,S7:()=>g,yu:()=>d});var r=i(58083),n=i(9093),s=i(35522),o=i(51850),a=i(23205),c=i(40710),h=i(33094),l=i(58029),u=i(97102);function d(t,e){e.instancedDoublePrecision?t.constants.add("cameraPosition","vec3",o.uY):t.uniforms.add(new c.W("cameraPosition",(t,e)=>(0,s.hZ)(m,e.camera.viewInverseTransposeMatrix[3]-t.origin[0],e.camera.viewInverseTransposeMatrix[7]-t.origin[1],e.camera.viewInverseTransposeMatrix[11]-t.origin[2])))}function f(t,e){if(!e.instancedDoublePrecision)return void t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new u.S("view",(t,e)=>(0,r.Tl)(p,e.camera.viewMatrix,t.origin)),new c.W("localOrigin",t=>t.origin));const i=({camera:t})=>(0,s.hZ)(m,t.viewInverseTransposeMatrix[3],t.viewInverseTransposeMatrix[7],t.viewInverseTransposeMatrix[11]);t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new l.F("view",t=>(0,r.Tl)(p,t.camera.viewMatrix,i(t))),new a.d("localOrigin",t=>i(t)))}const p=(0,n.vt)(),m=(0,o.vt)();function g(t){t.uniforms.add(new l.F("viewNormal",t=>t.camera.viewInverseTransposeMatrix))}function _(t){t.uniforms.add(new h.U("pixelRatio",t=>t.camera.pixelRatio/t.overlayStretch))}},77108(t,e,i){i.d(e,{E:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",0,(r,n)=>r.setUniform2fv(t,e(n),i))}}},68259(t,e,i){i.d(e,{t:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",2,(r,n,s,o)=>r.setUniform2fv(t,e(n,s,o),i))}}},47286(t,e,i){i.d(e,{G:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",1,(r,n,s)=>r.setUniform2fv(t,e(n,s),i))}}},23205(t,e,i){i.d(e,{d:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec3",0,(r,n)=>r.setUniform3fv(t,e(n),i))}}},14314(t,e,i){i.d(e,{I:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec4",0,(r,n)=>r.setUniform4fv(t,e(n),i))}}},71988(t,e,i){i.d(e,{E:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec4",1,(r,n,s)=>r.setUniform4fv(t,e(n,s),i))}}},33094(t,e,i){i.d(e,{U:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"float",0,(r,n)=>r.setUniform1f(t,e(n),i))}}},44887(t,e,i){i.d(e,{x:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i,r){super(t,"float",1,(e,n,s)=>e.setUniform1fv(t,i(n,s),r),e)}}},35818(t,e,i){i.d(e,{W:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"int",0,(i,r)=>i.setUniform1i(t,e(r)))}}},93588(t,e,i){i.d(e,{c:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"int",1,(i,r,n)=>i.setUniform1i(t,e(r,n)))}}},35644(t,e,i){i.d(e,{k:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat3",1,(r,n,s)=>r.setUniformMatrix3fv(t,e(n,s),i))}}},58029(t,e,i){i.d(e,{F:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat4",0,(r,n)=>r.setUniformMatrix4fv(t,e(n),i))}}},97102(t,e,i){i.d(e,{S:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat4",2,(r,n,s)=>r.setUniformMatrix4fv(t,e(n,s),i))}}},12791(t,e,i){i.d(e,{x:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"sampler2D",0,(i,r)=>i.bindTexture(t,e(r)))}}},13840(t,e,i){i.d(e,{r:()=>r});class r{constructor(t,e){this._module=t,this._load=e}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98958(t,e,i){i.d(e,{w:()=>p});var r=i(5482),n=i(69622),s=i(53966),o=i(91429),a=i(41976),c=(i(44208),i(26857)),h=i(94656);class l{constructor(t,e,i){this._context=t,this.locations=i,this._textures=new Map,this.source=(0,h.en)()?e:null,e.attributeNames.forEach(t=>{i.has(t)||s.A.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${t} used in shader`)}),this._glProgram=t.programCache.get(e.generate("vertex",!0),e.generate("fragment",!0),i),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=e.generateBind(this),this.bindPass=e.generateBindPass(this),this.bindDraw=e.generateBindDraw(this)}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(t,e){this._glProgram.setUniform1i(t,e?1:0)}setUniform1i(t,e){this._glProgram.setUniform1i(t,e)}setUniform1f(t,e,i){this._glProgram.setUniform1f(t,e,i)}setUniform2fv(t,e,i){this._glProgram.setUniform2fv(t,e,i)}setUniform3fv(t,e,i){this._glProgram.setUniform3fv(t,e,i)}setUniform4fv(t,e,i){this._glProgram.setUniform4fv(t,e,i)}setUniformMatrix3fv(t,e,i){this._glProgram.setUniformMatrix3fv(t,e,!1,i)}setUniformMatrix4fv(t,e,i){this._glProgram.setUniformMatrix4fv(t,e,!1,i)}setUniformMatrices4fv(t,e,i){this._glProgram.setUniformMatrices4fv(t,e,!1,i)}setUniform1fv(t,e,i){this._glProgram.setUniform1fv(t,e,i)}setUniform1iv(t,e){this._glProgram.setUniform1iv(t,e)}setUniform2iv(t,e){this._glProgram.setUniform2iv(t,e)}setUniform3iv(t,e){this._glProgram.setUniform3iv(t,e)}setUniform4iv(t,e){this._glProgram.setUniform4iv(t,e)}assertCompatibleVertexAttributeLocations(t,e){if(c.b.ENABLE_OPTIMIZATIONS)return;let i=t.locations;if(e){const t=new Map(i);e.forEach((e,r)=>t.set(r,i.size+e)),i=t}i.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${i}, ${this.locations}`),this.locations.forEach((t,e)=>{i.get(e)!==t&&console.error(`VertexAttributeLocations are incompatible: Program has ${e} at position ${t}, VAO has it at position ${i.get(e)}.`)})}stop(){this._textures.clear()}bindTexture(t,e,i){if(!e?.glName){const i=`Texture sampler ${t} in ${this._context.debugBoundTechnique} has no given Texture in ${(new Error).stack}`;(0,h.en)()&&console.error(i),e=this._context.emptyTexture}const r=this._ensureTextureUnit(t,e);this._context.useProgram(this);const n=r.unit;this.setUniform1i(t,n),this._context.bindTexture(e,n,!1,i)}_ensureTextureUnit(t,e){let i=this._textures.get(t);return null==i?(i={texture:e,unit:this._textures.size},this._textures.set(t,i)):i.texture=e,i}}var u=i(63907),d=i(90644),f=i(85079);let p=class extends n.A{constructor(t,e,i){super({}),this._context=t,this._configuration=e,this.primitiveType=u.WR.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=e.key,this.locations=(0,f.Xk)(i??a.lK),this._pipeline=this.initializePipeline(e),this.reload=async i=>{if(i&&await this.shader.reload(),!this.key.equals(e.key))return void s.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);const r=this.shader.get().build(e);r.debugName=this.declaredClass,this._program=new l(t.rctx,r,this.locations),this._pipeline=this.initializePipeline(e)}}initialize(){const t=this.shader.get().build(this._configuration);t.debugName=this.declaredClass,this._program=new l(this._context.rctx,t,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(t){this.program.assertCompatibleVertexAttributeLocations(t)}getPipeline(t,e,i){return this._pipeline}initializePipeline(t){return(0,d.Ey)({blending:d.RC,colorWrite:d.kn})}};p=(0,r.Cg)([(0,o.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],p)},16943(t,e,i){i.d(e,{E:()=>n});var r=i(44208);function n(){return!!(0,r.A)("enable-feature:objectAndLayerId-rendering")}},41976(t,e,i){var r=i(63907),n=i(85079),s=i(74038);new s._("position",3,r.pe.FLOAT,0,12);const o=[new s._("position",2,r.pe.FLOAT,0,8)];(0,n.Xk)(o),new s._("position",2,r.pe.FLOAT,0,12),new s._("uv0",2,r.pe.HALF_FLOAT,8,12),new s._("position",2,r.pe.FLOAT,0,16),new s._("uv0",2,r.pe.FLOAT,8,16),i.d(e,["lK",0,o,"wR",0,[]])},92130(t,e,i){i.d(e,{A:()=>r});class r{constructor(t){this._material=t.material,this._techniques=t.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(t,e){return this._techniques.get(t,this._material.getConfiguration(e))}ensureResources(t){return 2}}},67499(t,e,i){i.d(e,{V:()=>E});var r=i(9093),n=i(35522),s=i(97146),o=i(34275),a=i(20498);function c(t){if(t.length<1024)return Array.from(t);if(Array.isArray(t))return Float64Array.from(t);if(!("BYTES_PER_ELEMENT"in t))return Array.from(t);switch(t.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(t);case 2:return(0,o.LW)(t)?(0,a.pX)().from(t):(0,o.jq)(t)?Uint16Array.from(t):Int16Array.from(t);case 4:return(0,o.vZ)(t)?Float32Array.from(t):Uint32Array.from(t);default:return Float64Array.from(t)}}var h=i(15142),l=i(51850),u=i(70328),d=i(94008),f=i(620);class p{constructor(t,e,i){this.primitiveIndices=t,this._numIndexPerPrimitive=e,this._readPosition=i,this._children=void 0,(0,f.vA)(t.length>=1);const r=t.length;v.clear();const s=(0,u.Ie)();for(let n=0;n<r;++n){const r=e*t[n];for(let t=0;t<e;++t){const e=r+t;v.push(e),(0,u.iT)(s,i(m,e))}}this.box=s;const o=new d.iy,a=(0,u.gX)(s,o.center);let c=.5*Math.max((0,u.VL)(s),(0,u.yr)(s),(0,u.uJ)(s)),h=c*c;for(let t=0;t<v.length;++t){const e=i(m,v.at(t)),r=(0,n.Re)(e,e,a),s=(0,n.uE)(r);if(s<=h)continue;const o=Math.sqrt(s),l=.5*(o-c);c+=l,h=c*c,(0,n.Ln)(a,a,r,l/o)}o.radius=c,this.sphere=o,v.clear()}get children(){if(this._children)return this._children;const t=this.box;if((0,u.TF)(t)<=1)return;const{_readPosition:e,_numIndexPerPrimitive:i,primitiveIndices:r}=this,s=(0,u.gX)(t,m),o=r.length,a=new Uint8Array(o),c=[0,0,0,0,0,0,0,0];for(let t=0;t<o;++t){const o=i*r[t],h=e(g,o);for(let t=1;t<i;++t)(0,n.jk)(h,h,e(_,o+t));const l=(h[0]<s[0]?1:0)|(h[1]<s[1]?2:0)|(h[2]<s[2]?4:0);a[t]=l,++c[l]}let h=0;for(let t=0;t<8;++t)c[t]>0&&++h;if(h<2)return;const l=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0];for(let t=0;t<8;++t)c[t]>0&&(l[t]=new Uint32Array(c[t]));c.fill(0);for(let t=0;t<o;++t){const e=a[t];l[e][c[e]++]=r[t]}const d=new Array;for(let t=0;t<8;++t){const r=l[t];void 0!==r&&d.push(new p(r,i,e))}return this._children=d,this._children}static prune(){v.prune()}}const m=(0,l.vt)(),g=(0,l.vt)(),_=(0,l.vt)(),v=new h.A({deallocator:null});var y=i(24326);class x{constructor(t){this.id=(0,y.c)(),this._attributes=new Map;for(const[e,i]of t)this._attributes.set(e,{...i,indices:(0,s.Dg)(i.indices)})}get attributes(){return this._attributes}}var b=i(48295);const w=(0,l.vt)(),T=(0,l.vt)(),M=(0,l.vt)(),A=(0,l.vt)();var S=i(17478),C=i(94656);class E extends x{constructor(t,e,i=null,r=0,n=null,s=-1,o,a){super(e),this.material=t,this.mapPositions=i,this.type=r,this.olidColor=n,this.edgeIndicesLength=s,this.baseGeometry=o,this.drawIndices=a,this._readPrimitivePosition=null,this._vertexPositionIndicesCache=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null,(0,f.vA)((t?.useIndexing??!1)===(null!=a),"Material index requirement and Geometry must match"),this.edgeIndicesLength<0&&(this.edgeIndicesLength=this.indexCount)}get readPrimitivePosition(){return this._readPrimitivePosition??=function(t,e){const{data:i,indices:r,size:n,stride:s}=t;return(0,f.vA)(3===n||4===n,"Position attribute must have 3 or 4 components"),null!=e?(t,n)=>{const o=r[e[n]]*s;return t[0]=i[o],t[1]=i[o+1],t[2]=i[o+2],t}:function(t,e,i){return(r,n)=>{const s=e[n]*i;return r[0]=t[s],r[1]=t[s+1],r[2]=t[s+2],r}}(i,r,s)}(this.positionAttribute,this.drawIndices),this._readPrimitivePosition}_invalidateReadPrimitivePosition(){this._readPrimitivePosition=null}instantiate(t={}){const e=new E(t.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((t,i)=>{t.exclusive=!1,e._attributes.set(i,t)}),e._boundingInfo=this._boundingInfo,e.transformation=t.transformation||this.transformation,e}getMutableAttribute(t){let e=this._attributes.get(t);return e&&!e.exclusive&&(e={...e,exclusive:!0,data:c(e.data)},this._attributes.set(t,e),"position"===t&&this._invalidateReadPrimitivePosition()),e}setAttributeData(t,e){const i=this._attributes.get(t);i?(this._attributes.set(t,{...i,exclusive:!0,data:e}),"position"===t&&this._invalidateReadPrimitivePosition()):(0,C.en)()&&console.warn(`Setting undefined attribute ${t} data`)}get primitivePositionIndices(){return void 0!==this._vertexPositionIndicesCache||(this._vertexPositionIndicesCache=this._computePrimitivePositionIndices()),this._vertexPositionIndicesCache}_computePrimitivePositionIndices(){const{drawIndices:t}=this,e=this.positionAttribute;if(null!=t&&null!=e){const i=new Array;for(const r of t)i.push(e.indices[r]);return i}return e?.indices??null}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const t=this.drawIndices??this.positionAttribute?.indices;return t?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(t){return!!this._calculateAttachmentOrigin(t)&&(null!=this._transformation&&(0,n.Z0)(t,t,this._transformation),!0)}_calculateAttachmentOrigin(t){return 0===this.type?this._computeAttachmentOriginTriangles(t):2===this.type?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t)}_computeAttachmentOriginTriangles(t){return function(t,e,i){if(i<=0)return!1;(0,n.hZ)(t,0,0,0),(0,n.hZ)(A,0,0,0);let r=0,s=0;for(let o=0;o<i;++o){const i=3*o;e(w,i),e(T,i+1),e(M,i+2);const a=(0,b.BU)(w,T,M);a?((0,n.WQ)(w,w,T),(0,n.WQ)(w,w,M),(0,n.hs)(w,w,1/3*a),(0,n.WQ)(t,t,w),r+=a):((0,n.WQ)(A,A,w),(0,n.WQ)(A,A,T),(0,n.WQ)(A,A,M),s+=3)}return!(0===s&&0===r||(0!==r?((0,n.hs)(t,t,1/r),0):0===s||((0,n.hs)(t,A,1/s),0)))}(t,this.readPrimitivePosition,this.indexCount/3)}_computeAttachmentOriginLines(t){const{indexCount:e}=this;return function(t,e,i,r){if(i<=0)return!1;(0,n.hZ)(t,0,0,0),(0,n.hZ)(A,0,0,0);let s=0,o=0;const a=i-1,c=a+(r?2:0);for(let i=0;i<c;i+=2){const r=i<a?i+1:0;e(w,i<a?i:a),e(T,r),(0,n.hs)(w,(0,n.WQ)(w,w,T),.5);const c=(0,n.xg)(w,T);c>0?((0,n.WQ)(t,t,(0,n.hs)(w,w,c)),s+=c):0===s&&((0,n.WQ)(A,A,w),o++)}return 0!==s?((0,n.hs)(t,t,1/s),!0):0!==o&&((0,n.hs)(t,A,1/o),!0)}(t,this.readPrimitivePosition,e,function(t,e){return!(!("isClosed"in t)||!t.isClosed)&&e>2}(this.material.parameters,e))}_computeAttachmentOriginPoints(t){return function(t,e,i){if(i<=0)return!1;(0,n.hZ)(t,0,0,0);let r=NaN,s=NaN,o=NaN,a=0;for(let n=0;n<i;n++){const i=e(w,n);i[0]===r&&i[1]===s&&i[2]===o||(t[0]+=i[0],t[1]+=i[1],t[2]+=i[2],a++),r=i[0],s=i[1],o=i[2]}return a>1&&(0,n.hs)(t,t,1/a),a>0}(t,this.readPrimitivePosition,this.indexCount)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const t=this.positionAttribute,e=this.indexCount;if(!t||0===e)return null;const i=0===this.type?3:1;(0,f.vA)(e%i===0,"Indexing error: "+e+" not divisible by "+i);const r=(0,s.tM)(e/i);return new p(r,i,this.readPrimitivePosition)}get transformation(){return this._transformation??r.zK}set transformation(t){this._transformation=t&&t!==r.zK?(0,r.o8)(t):null}get highlights(){return this._highlights||R}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(t){this._highlightOptionsCounts?.forEach((e,i)=>t(i))}allocateIdAndHighlight(t){const e=new S.h(t);return this.addHighlight(e)}addHighlight(t){this._ensureHighlights().add(t);const{highlightName:e}=t,i=(this._highlightOptionsCounts?.get(e)??0)+1;return this._ensureHighlightOptionsCounts().set(e,i),t}_ensureHighlights(){let t=this._highlights;return t||(t=new Set,this._highlights=t),t}_ensureHighlightOptionsCounts(){let t=this._highlightOptionsCounts;return t||(t=new Map,this._highlightOptionsCounts=t),t}removeHighlight(t){if(this._highlights?.delete(t)){const{highlightName:e}=t,i=this._highlightOptionsCounts?.get(e)??0;i<=1?this._highlightOptionsCounts?.delete(e):this._ensureHighlightOptionsCounts().set(e,i-1)}}}const R=new Set},49718(t,e,i){i(51850),i(6867).w_},6867(t,e,i){i.d(e,{w_:()=>u});var r=i(58083),n=i(9093),s=i(35522),o=i(51850),a=i(78955),c=i(91829),h=i(71351);class l{constructor(){this.intersector=4}_init(){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4}_setBase(t,e,i,r,n){this.intersector=t,this.distance=i,this.target=e,this.drapedLayerOrder=r,this.renderPriority=n}}class u extends l{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,s.hs)(f,this.ray.direction,this.distance),(0,s.Bw)(f))}withinDistance(t){return!!d(this)&&null!=this.distanceInRenderSpace&&this.distanceInRenderSpace<=t}getIntersectionPoint(t){return!!d(this)&&((0,s.hs)(f,this.ray.direction,this.distance),(0,s.WQ)(t,this.ray.origin,f),!0)}getTransformedNormal(t){return(0,s.C)(p,this.normal),p[3]=0,(0,a.Z0)(p,p,this.transformation),(0,s.C)(t,p),(0,s.S8)(t,t)}constructor(t){super(),this.normal=(0,o.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,h.vt)(),this.init(t)}init(t){super._init(),t&&(0,h.C)(t,this._ray)}set(t,e,i,a,c,h,l){this._setBase(t,e,i,h,l),(0,s.C)(this.normal,a??o.Cb),(0,r.C)(this.transformation,c??n.zK)}copy(t){this._setBase(t.intersector,t.target,t.distance,t.drapedLayerOrder,t.renderPriority),(0,h.C)(t.ray,this._ray),(0,s.C)(this.normal,t.normal),(0,r.C)(this.transformation,t.transformation)}}function d(t){return null!=t?.distance}const f=(0,o.vt)(),p=(0,c.vt)()},18845(t,e,i){i.d(e,{h:()=>U});var r=i(49186),n=i(65529),s=i(97768),o=i(17676),a=i(34275),c=i(24326),h=i(84952),l=i(38969),u=i(31217),d=i(95117),f=i(2741);let p;var m=i(63907),g=i(21231),_=i(42293);let v=null,y=null;async function x(){return null==y&&(p??=(async()=>{const t=await i.e(9321).then(i.bind(i,49321)),e=await t.default({locateFile:t=>(0,f.s)(`esri/libs/basisu/${t}`)});return e.initializeBasis(),e})(),y=p,v=await y),y}function b(t,e){if(null==v)return t.byteLength;const i=new v.BasisFile(new Uint8Array(t)),r=M(i)?T(i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),e):0;return i.close(),i.delete(),r}function w(t,e){if(null==v)return t.byteLength;const i=new v.KTX2File(new Uint8Array(t)),r=A(i)?T(i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),e):0;return i.close(),i.delete(),r}function T(t,e,i,r,n){const s=(0,_.MW)(e?m.CQ.COMPRESSED_RGBA8_ETC2_EAC:m.CQ.COMPRESSED_RGB8_ETC2),o=n&&t>1?(4**t-1)/(3*4**(t-1)):1;return Math.ceil(i*r*s*o)}function M(t){return t.getNumImages()>=1&&!t.isUASTC()}function A(t){return t.getFaces()>=1&&(t.isETC1S()||t.isUASTC())}function S(t,e,i,r,n,s,o,a){const{compressedTextureETC:c,compressedTextureS3TC:h}=t.capabilities,[l,u]=c?r?[1,m.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,m.CQ.COMPRESSED_RGB8_ETC2]:h?r?[3,m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],d=e.hasMipmap?i:Math.min(1,i),f=[];for(let t=0;t<d;t++)f.push(new Uint8Array(o(t,l))),a(t,l,f[t]);return e.internalFormat=u,e.hasMipmap=f.length>1,e.samplingMode=e.hasMipmap?9987:9729,e.width=n,e.height=s,new g.A(t,e,{type:"compressed",levels:f})}var C=i(53966);const E=()=>C.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function R(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}const I=R("DXT1"),D=R("DXT3"),O=R("DXT5");function P(t,e){const i=new Int32Array(t.buffer,t.byteOffset,31);if(542327876!==i[0])return E().error("Invalid magic number in DDS header"),null;if(!(4&i[20]))return E().error("Unsupported format, must contain a FourCC code"),null;const r=i[21];let n,s;switch(r){case I:n=8,s=m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case D:n=16,s=m.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case O:n=16,s=m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return E().error("Unsupported FourCC code:",function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)}(r)),null}let o=1,a=i[4],c=i[3];(3&a||3&c)&&(E().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,c=c+3&-4);const h=a,l=c;let u,d;131072&i[2]&&!1!==e&&(o=Math.max(1,i[7]));let f=t.byteOffset+i[1]+4;const p=[];for(let e=0;e<o;++e)d=(a+3>>2)*(c+3>>2)*n,u=new Uint8Array(t.buffer,f,d),p.push(u),f+=d,a=Math.max(1,a>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:p},internalFormat:s,width:h,height:l}}var F=i(78988),N=i(620),B=i(67171),L=i(12541);class U{constructor(t,e){this._data=t,this.id=(0,c.c)(),this.events=new n.bk,this._parameters={...V,...e},this._startPreload(t)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(t){t instanceof HTMLVideoElement?(this.update=e=>this._update(t,e),this._startPreloadVideoElement(t)):t instanceof HTMLImageElement&&this._startPreloadImageElement(t)}_startPreloadVideoElement(t){if(!((0,h.w8)(t.src)||"auto"===t.preload&&t.crossOrigin)&&(t.preload="auto",t.crossOrigin="anonymous",t.src=t.src,t.paused&&t.autoplay)){const e=[];(0,l.i)(t,t=>e.push(t)).then(()=>{t.play()}).finally(()=>e.forEach(t=>t.remove()))}}_startPreloadImageElement(t){(0,h.DB)(t.src)||(0,h.w8)(t.src)||t.crossOrigin||(t.crossOrigin="anonymous",t.src=t.src)}_createDescriptor(t){const e=new B.R;return e.wrapMode=this._parameters.wrap??10497,e.flipped=!this._parameters.noUnpackFlip,e.samplingMode=this._parameters.mipmap?9987:9729,e.hasMipmap=!!this._parameters.mipmap,e.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,e.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?t.parameters.maxMaxAnisotropy:1),e.dataType=this._parameters.dataType??e.dataType,e.pixelFormat=this._parameters.pixelFormat??e.pixelFormat,e.internalFormat=this._parameters.internalFormat??e.internalFormat,e.isImmutable=!0===this._parameters.immutable&&function(t){return null!=t&&((0,L.tl)(t)||(0,L.tr)(t)||(0,L.CR)(t)||(0,L.QJ)(t))}(this._parameters.internalFormat),e}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(t,e){if(null==t)return 0;if((0,a.mw)(t)||(0,a.mg)(t))return"image/ktx2"===e.encoding?w(t,!!e.mipmap):"image/x.basis"===e.encoding?b(t,!!e.mipmap):t.byteLength;const{width:i,height:r}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?H(t):e,n=e.pixelFormat??6408,s=(0,_.wH)(n);return(e.mipmap?4/3:1)*i*r*s||0}(this._data,this._parameters)}load(t){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const e=this._data;return null==e?(this._texture=new g.A(t,this._createDescriptor(t),null),this._texture):(this._emptyTexture=t.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof e?this._loadFromURL(t,e):e instanceof Image?this._loadFromImageElement(t,e):e instanceof HTMLVideoElement?this._loadFromVideoElement(t,e):e instanceof ImageData||e instanceof HTMLCanvasElement?this._loadFromImage(t,e):(0,a.mg)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,e):(0,a.mw)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,new Uint8Array(e)):((0,a.mw)(e)||(0,a.mg)(e))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(t,e):((0,a.mw)(e)||(0,a.mg)(e))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(t,e):(0,a.mw)(e)?this._loadFromPixelData(t,new Uint8Array(e)):(0,a.iu)(e)?this._loadFromPixelData(t,e):null)}_update(t,e){return null==this._texture||t.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||e===t.currentTime?e:(this._texture.setData(t),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),t.currentTime)}_loadFromDDSData(t,e){return this._texture=function(t,e,i){const r=P(i,e.hasMipmap??!1);if(null==r)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:s,width:o,height:a}=r;return e.samplingMode=n.levels.length>1?9987:9729,e.hasMipmap=n.levels.length>1,e.internalFormat=s,e.width=o,e.height=a,new g.A(t,e,n)}(t,this._createDescriptor(t),e),this._emptyTexture=null,this._texture}_loadFromKTX2(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await x());const r=new v.KTX2File(new Uint8Array(i));if(!A(r))return null;r.startTranscoding();const n=S(t,e,r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),(t,e)=>r.getImageTranscodedSizeInBytes(t,0,0,e),(t,e,i)=>r.transcodeImage(i,t,0,0,e,0,-1,-1));return r.close(),r.delete(),n}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromBasis(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await x());const r=new v.BasisFile(new Uint8Array(i));if(!M(r))return null;r.startTranscoding();const n=S(t,e,r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),(t,e)=>r.getImageTranscodedSizeInBytes(0,t,e),(t,e,i)=>r.transcodeImage(i,0,t,e,0,0));return r.close(),r.delete(),n}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromPixelData(t,e){(0,N.vA)(this._parameters.width>0&&this._parameters.height>0);const i=this._createDescriptor(t);return 6407!==i.pixelFormat&&6408!==i.pixelFormat||(i.compress=this._parameters.compressionOptions),i.width=this._parameters.width??0,i.height=this._parameters.height??0,this._texture=new g.A(t,i,e),this._texture}_loadFromURL(t,e){return this._loadAsync(async i=>{const r=await(0,u.D)(e,{signal:i});return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromImageElement(t,e){return e.complete?this._loadFromImage(t,e):this._loadAsync(async i=>{const r=await(0,d.y)(e,e.src,!1,i);return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromVideoElement(t,e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(t,e):this._loadFromVideoElementAsync(t,e)}_loadFromVideoElementAsync(t,e){return this._loadAsync(i=>new Promise((n,a)=>{const c=()=>{e.removeEventListener("loadeddata",h),e.removeEventListener("error",l),(0,s.xt)(u)},h=()=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(c(),n(this._loadFromImage(t,e)))},l=t=>{c(),a(t||new r.A("texture:load-error","Failed to load video"))};e.addEventListener("loadeddata",h),e.addEventListener("error",l);const u=(0,o.u7)(i,()=>l((0,o.NK)()))}))}_loadFromImage(t,e){let i=e;i instanceof HTMLVideoElement||(i=(0,F.vM)(i,t.parameters));const r=H(i);this._parameters.width=r.width,this._parameters.height=r.height;const n=this._createDescriptor(t);return n.width=r.width,n.height=r.height,n.compress=this._parameters.compressionOptions,this._texture=new g.A(t,n,i),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(t){const e=new AbortController;this._loadingController=e;const i=t(e.signal);this._loadingPromise=i;const r=()=>{this._loadingController===e&&(this._loadingController=null),this._loadingPromise===i&&(this._loadingPromise=null),this._emptyTexture=null};return i.then(r,r),i}unload(){if(this._texture=(0,s.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const t=this._loadingController;this._loadingController=null,this._loadingPromise=null,t.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function H(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}const V={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},11725(t,e,i){i.d(e,{i:()=>a});var r=i(24326),n=i(49255),s=i(43616),o=i(65786);class a{constructor(t,e){this.id=(0,r.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new e,(0,s.MB)(this._parameters,t),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(t){return!1}setParameters(t,e=!0){(0,s.MB)(this._parameters,t)&&(this.validateParameters(this._parameters),e&&this._parametersChanged())}validateParameters(t){}shouldRender(t){return this.visible&&this.isVisibleForOutput(t.output)&&(!this.parameters.isDecoration||t.bind.decorations)&&0!==(this.parameters.renderOccluded&t.renderOccludedMask)}isVisibleForOutput(t){return!0}get renderPriority(){return this._renderPriority}set renderPriority(t){t!==this._renderPriority&&(this._renderPriority=t,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get emissions(){return 0}getConfiguration(t){return this.updateConfiguration(t),this._configuration}updateConfiguration(t){this._configuration.output=t.output,this._configuration.hasEmission=t.hasEmission&&(0,n._o)(t.output),this._configuration.hasHighlightMixTexture=10===t.output&&null!=t.highlightMixTexture,this._configuration.useFloatBlend=t.useFloatBlend.value,this._configuration.emissionDimmingPass=t.transparentWithoutDepthEmissionDimmingPass&&(0,n._o)(t.output)}}o.Y},17478(t,e,i){i.d(e,{h:()=>s,p:()=>o});var r=i(24326);class n{constructor(){this.uid=(0,r.c)()}}class s extends n{constructor(t){super(),this.highlightName=t,this.channel=0}}class o extends n{constructor(){super(...arguments),this.channel=1}}},33524(t,e,i){i.d(e,{Yf:()=>a,mt:()=>h,z5:()=>c});var r=i(91829),n=i(49255),s=i(90644);const o=(0,s.p3)(1,0,1,771);function a(t,e=!1,i=!1){if(i)return s.uR;switch(t){case 0:return e?s.RC:s.T8;case 1:return o;default:return null}}function c(t){if(t.draped)return null;switch(t.output){case 0:case 2:default:return t.writeDepth?s.Uy:null;case 1:return null}}function h(t,e=513){return{func:(0,n._$)(t)?515:e}}(0,r._Y)()},56133(t,e,i){var r=i(90644);const n=(0,r.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:0}),s=(0,r.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:7681}),o=(0,r.nk)(2,2,{compare:514,fail:7680,zFail:7680,zPass:7680}),a=(0,r.nk)(2,2,{compare:517,fail:7680,zFail:7680,zPass:7680});i.d(e,["Ax",0,s,"Q0",0,a,"cP",0,n,"iB",0,o,"m",0,{func:513},"r8",0,{mask:0},"sf",0,{func:519},"v0",0,{mask:255}])},58964(t,e,i){i.d(e,{Vh:()=>u,jP:()=>d,q6:()=>f});var r=i(90629),n=i(35522),s=i(51850),o=i(19419),a=i(11964),c=i(27921),h=i(48295);function l(t,e){return t.isRectangle?(0,o.Uc)(t.bounds,e):m(e,t.points)}function u(t,e,i,r){const n=Math.min(e[0],i[0],r[0]),s=Math.min(e[1],i[1],r[1]),a=Math.max(e[0],i[0],r[0]),c=Math.max(e[1],i[1],r[1]);if(!function(t,e){if(!(0,o.HY)(t.bounds,e))return!1;if(t.isRectangle)return!0;for(const i of t.points)if((0,o.Uc)(e,i))return!0;for(let i=0;i<4;i++)if(m(b(T,e,i),t.points))return!0;for(let i=0;i<t.points.length;i++){const r=t.points[i],n=i===t.points.length-1?t.points[0]:t.points[i+1];for(let t=0;t<4;t++)if(g(r,n,b(T,e,t),b(M,e,(t+1)%4)))return!0}return!1}(t,(0,o.fA)(n,s,a,c,w)))return!1;if(l(t,e)||l(t,i)||l(t,r))return!0;for(const n of t.points)if((0,h.cq)(e,i,r,n,D))return!0;for(let n=0;n<t.points.length;n++){const s=t.points[n],o=t.points[(n+1)%t.points.length];if(g(e,i,s,o)||g(i,r,s,o)||g(r,e,s,o))return!0}return!1}function d(t,e,i,r){const n=Math.min(e[0],i[0])-r,s=Math.min(e[1],i[1])-r,a=Math.max(e[0],i[0])+r,c=Math.max(e[1],i[1])+r;if(!(0,o.HY)(t.bounds,(0,o.fA)(n,s,a,c,w)))return!1;if(l(t,e)||l(t,i))return!0;const h=r*r;for(const r of t.points)if(v(r,e,i)<=h)return!0;for(let r=0;r<t.points.length;r++){const n=t.points[r],s=t.points[(r+1)%t.points.length];if(g(e,i,n,s)||_(e,i,n,s)<=h)return!0}return!1}function f(t,e,i,r,s){(0,n.C)(C,e),(0,n.C)(E,i);const o=t.projectToRenderScreen(C,A),h=t.projectToRenderScreen(E,S);if(null==o||null==h)return!1;const l=p(t,C),u=p(t,E);if(l&&u)return!1;if(l!==u){const e=l?C:E,i=l?o:h;if(!function(t,e,i){return function(t,e,i,r){return(0,c.T7)(t.frustum[4],(0,a.Cr)(e,i,I),r)}(t,e,i,e)}(t,e,l?E:C))return!1;if(!t.projectToRenderScreen(e,i))return!1}return r[0]=o[0],r[1]=o[1],r[2]=0,s[0]=h[0],s[1]=h[1],s[2]=0,!0}function p(t,e){return function(t,e){return(0,c.mN)(t.frustum[4],e)}(t,e)>0}function m(t,e){let i=!1;for(let r=0,n=e.length-1;r<e.length;n=r++){const s=e[r],o=e[n];if(s[1]>t[1]==o[1]>t[1])continue;const a=(o[0]-s[0])*(t[1]-s[1])/(o[1]-s[1])+s[0];t[0]<a&&(i=!i)}return i}function g(t,e,i,r){const n=y(t,e,i),s=y(t,e,r),o=y(i,r,t),a=y(i,r,e);return n!==s&&o!==a||0===n&&x(t,e,i)||0===s&&x(t,e,r)||0===o&&x(i,r,t)||0===a&&x(i,r,e)}function _(t,e,i,r){return g(t,e,i,r)?0:Math.min(v(t,i,r),v(e,i,r),v(i,t,e),v(r,t,e))}function v(t,e,i){return(0,a.kb)((0,a.Cr)((0,n.hZ)(C,e[0],e[1],0),(0,n.hZ)(E,i[0],i[1],0),I),(0,n.hZ)(R,t[0],t[1],0))}function y(t,e,i){const r=(e[1]-t[1])*(i[0]-e[0])-(e[0]-t[0])*(i[1]-e[1]);return Math.abs(r)<=D?0:Math.sign(r)}function x(t,e,i){return i[0]>=Math.min(t[0],e[0])-D&&i[0]<=Math.max(t[0],e[0])+D&&i[1]>=Math.min(t[1],e[1])-D&&i[1]<=Math.max(t[1],e[1])+D}function b(t,e,i){return t[0]=0===i||3===i?e[0]:e[2],t[1]=i<2?e[1]:e[3],t}const w=(0,o.vt)(),T=(0,r.gs)(),M=(0,r.gs)(),A=(0,r.r_)(),S=(0,r.r_)(),C=(0,s.vt)(),E=(0,s.vt)(),R=(0,s.vt)(),I=(0,a.vt)(),D=1e-9},75956(t,e,i){i.d(e,{IV:()=>d,MJ:()=>p,Uq:()=>f});var r=i(15142),n=i(90629),s=i(35522),o=i(51850),a=i(70328),c=i(82919),h=i(27921),l=i(48295),u=i(58964);class d{constructor(t){this.primitiveIndex=t}}class f{constructor(t){this.type=t,this.distance=Number.POSITIVE_INFINITY,this.primitiveIndex=0,this.hasNormal=!1,this.point=(0,o.vt)(),this.normal=(0,o.vt)()}reset(){this.distance=Number.POSITIVE_INFINITY,this.hasNormal=!1}update(t,e,i,r){this.distance=t,this.primitiveIndex=e,(0,s.C)(this.point,i),this.hasNormal=null!=r,null!=r&&(0,s.C)(this.normal,r)}updateIfCloserFromValues(t,e,i,r){t<this.distance&&this.update(t,e,i,r)}updateIfCloser(t){const{distance:e,primitiveIndex:i,point:r,normal:n}=t;this.updateIfCloserFromValues(e,i,r,t.hasNormal?n:null)}get valid(){return Number.isFinite(this.distance)}}function p(t,e,i,r,n){if(!t.visible||0!==t.type)return null;const s=new f(4);let o;o=t.boundingInfo?g(t.readPrimitivePosition,t.boundingInfo,e,i,r,n):m(e,i,r,0,t.faceCount,t.readPrimitivePosition,n,null,0);for(const t of o)s.updateIfCloser(t);return s.valid?s:null}function*m(t,e,i,r,n,o,a,c=null,u=0){return yield*function*(t,e,i,r,n){if(null==t.camera)return;const{camera:o,screenPolygonPrimitiveProcessor:a}=t;for(let t=i;t<r;++t){const i=n(b[0],b[1],b[2],t),r=A;let c;C.reset();const u=w;for(const t of a.processTriangle(b))if(u.length=0,(0,h.H)(o.frustum[4],t,()=>u.pushNew(),!1),!(u.length<3)){for(let t=0;t<u.length;t++)o.projectToScreen(u.at(t),T[t]);v(e,T,u.length)&&(y(o.eye,u,M),null==c&&(c=(0,l.rb)(A,b[0],b[1],b[2])),C.updateIfCloserFromValues((0,s.Io)(o.eye,M),i,M,c?r:null))}C.valid&&(yield C)}}(t,i,r,n,(t,i,r,n)=>{const s=(c?.[n]??n)+u,h=null==c?s:n,l=3*s;return _(t,o,l+0,a,h,e),_(i,o,l+1,a,h,e),_(r,o,l+2,a,h,e),s})}function*g(t,e,i,r,n,s){let o;if(null!=s?((0,a.C)(x,e.box),s.applyToAabb(x),o=(0,c.GH)(n.broadPhaseFrustum,x,r)):o=(0,c.GH)(n.broadPhaseFrustum,e.box,r),!o)return;const{primitiveIndices:h}=e,l=h.length;if(l>1e3){const o=e.children;if(void 0!==o){for(const e of o)yield*g(t,e,i,r,n,s);return}}yield*m(i,r,n,0,l,t,s,h,0)}function _(t,e,i,r,n,o){const[a,c,h]=e(t,i);null!=r?r.applyToVertex(t,a,c,h,n):(0,s.hZ)(t,a,c,h),o&&(0,s.Z0)(t,t,o)}function v(t,e,i){for(let r=1;r<i-1;r++)if((0,u.Vh)(t,e[0],e[r],e[r+1]))return!0;return!1}function y(t,e,i){let r=Number.POSITIVE_INFINITY;const n=e.at(0);for(let o=1;o<e.length-1;o++){(0,l.k3)(S,t,n,e.at(o),e.at(o+1));const a=(0,s.hG)(t,S);a<r&&(r=a,(0,s.C)(i,S))}}const x=(0,a.vt)(),b=[(0,o.vt)(),(0,o.vt)(),(0,o.vt)()],w=new r.A({allocator:t=>t??(0,o.vt)()}),T=Array.from({length:12},()=>(0,n.gs)()),M=(0,o.vt)(),A=(0,o.vt)(),S=(0,o.vt)(),C=new f(4)},77194(t,e,i){i.d(e,{PS:()=>n}),i(44208);var r=i(34727);class n{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(t,e,i,r){i?(this._scale=Math.min(i.divisor/(e-i.offset),1),this._angleFactor=function(t){return Math.abs(t)**3}(t),this._minScale=null!=r?Math.min(i.minPixelSize/r,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(t){const{_scale:e,_angleFactor:i,_minScale:n}=this;return t*(0,r.qE)((0,r.Cc)(e,1,i),n,1)}applyVec2(t,e){t[0]=this.apply(e[0]),t[1]=this.apply(e[1])}}},78988(t,e,i){i.d(e,{Mv:()=>n,vM:()=>s});var r=i(49186);function n(t,e){return e=16*Math.floor(e/16),Math.min(16*Math.round(t/16),e)}function s(t,e){const[i,r]=o(t,e);return t.width===i&&t.height===r?t:a(t,i,r)}function o({width:t,height:e},{maxPreferredTexturePixels:i,maxTextureSize:r}){const s=Math.max(t,e),o=t*e;if(s<=r&&o<=i)return[t,e];const a=Math.min(Math.sqrt(i/o),r/s);return[n(Math.round(t*a),r),n(Math.round(e*a),r)]}function a(t,e,i){if(t instanceof ImageData)return a(function(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");if(null==i)throw new r.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return i.putImageData(t,0,0),e}(t),e,i);const n=document.createElement("canvas");return n.width=e,n.height=i,n.getContext("2d").drawImage(t,0,0,n.width,n.height),n}},16396(t,e,i){i.d(e,{ou:()=>c}),i(77690),i(29242),i(58083),i(9093);var r=i(35522),n=i(51850),s=i(94008),o=i(57005);const a=new class{constructor(t=0){this.offset=t,this._tmpSphere=new s.iy}applyToVertex(t,e,i,n){const s=this.objectTransform.transform,o=(0,r.hZ)(h,e,i,n),a=(0,r.Z0)(o,o,s),c=this.offset/(0,r.Bw)(a);(0,r.Ln)(a,a,a,c);const l=this.objectTransform.inverse;return(0,r.Z0)(t,a,l),t}applyToMinMax(t,e){const i=this.offset/(0,r.Bw)(t);(0,r.Ln)(t,t,t,i);const n=this.offset/(0,r.Bw)(e);(0,r.Ln)(e,e,e,n)}applyToAabb(t){const e=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*e,t[1]+=t[1]*e,t[2]+=t[2]*e;const i=this.offset/Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]);return t[3]+=t[3]*i,t[4]+=t[4]*i,t[5]+=t[5]*i,t}applyToBoundingSphere(t){const e=t.center,i=(0,r.Bw)(e),n=this.offset/i;return(0,r.Ln)(this._tmpSphere.center,e,e,n),this._tmpSphere.radius=t.radius+t.radius*this.offset/i,this._tmpSphere}};function c(t){return null!=t?(a.offset=t,a):null}new class{constructor(t=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpMbs=new s.iy,this._tmpObb=new o.ab,this._resetOffset(t)}_resetOffset(t){this._offset=t,this._totalOffset=t}set offset(t){this._resetOffset(t)}get offset(){return this._offset}set componentOffset(t){this._totalOffset=this._offset+t}set localOrigin(t){this.componentLocalOriginLength=(0,r.Bw)(t)}applyToVertex(t,e,i,n){const s=(0,r.hZ)(h,e,i,n),o=(0,r.hZ)(l,e,i,n+this.componentLocalOriginLength),a=this._totalOffset/(0,r.Bw)(o);return(0,r.Ln)(t,s,o,a),t}applyToAabb(t){const e=this.componentLocalOriginLength,i=t[0],r=t[1],n=t[2]+e,s=t[3],o=t[4],a=t[5]+e,c=Math.abs(i),h=Math.abs(r),l=Math.abs(n),u=Math.abs(s),d=Math.abs(o),f=Math.abs(a),p=.5*(1+Math.sign(i*s))*Math.min(c,u),m=.5*(1+Math.sign(r*o))*Math.min(h,d),g=.5*(1+Math.sign(n*a))*Math.min(l,f),_=Math.sqrt(p*p+m*m+g*g),v=Math.sign(c+i),y=Math.sign(h+r),x=Math.sign(l+n),b=Math.sign(u+s),w=Math.sign(d+o),T=Math.sign(f+a),M=this._totalOffset;if(_<M)return t[0]-=(1-v)*M,t[1]-=(1-y)*M,t[2]-=(1-x)*M,t[3]+=b*M,t[4]+=w*M,t[5]+=T*M,t;const A=Math.max(c,u),S=Math.max(h,d),C=Math.max(l,f),E=M/Math.sqrt(A*A+S*S+C*C),R=M/_,I=R-E,D=-I;return t[0]+=i*(v*D+R),t[1]+=r*(y*D+R),t[2]+=n*(x*D+R),t[3]+=s*(b*I+E),t[4]+=o*(w*I+E),t[5]+=a*(T*I+E),t}applyToMbs(t){const e=t.center,i=(0,r.Bw)(e),n=this._totalOffset/i;return(0,r.Ln)(this._tmpMbs.center,e,e,n),this._tmpMbs.radius=t.radius+t.radius*this._totalOffset/i,this._tmpMbs}applyToObb(t){return(0,o.gm)(t,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(t=0){this.offset=t,this._tmpVertex=(0,n.vt)()}applyToVertex(t,e,i,n){const s=(0,r.hZ)(h,e,i,n),o=(0,r.WQ)(l,s,this.localOrigin),a=this.offset/(0,r.Bw)(o);return(0,r.Ln)(t,s,o,a),t}applyToAabb(t){const e=u,i=d,r=f;for(let n=0;n<3;++n)e[n]=t[0+n]+this.localOrigin[n],i[n]=t[3+n]+this.localOrigin[n],r[n]=e[n];const n=this.applyToVertex(this._tmpVertex,e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=n[e],t[e+3]=n[e];const s=e=>{const i=this.applyToVertex(this._tmpVertex,e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=Math.min(t[e],i[e]),t[e+3]=Math.max(t[e+3],i[e])};for(let t=1;t<8;++t){for(let n=0;n<3;++n)r[n]=t&1<<n?i[n]:e[n];s(r)}let o=0;for(let t=0;t<3;++t)e[t]*i[t]<0&&(o|=1<<t);if(0!==o&&7!==o)for(let t=0;t<8;++t)if(0===(o&t)){for(let n=0;n<3;++n)r[n]=o&1<<n?0:t&1<<n?e[n]:i[n];s(r)}for(let e=0;e<3;++e)t[e]-=this.localOrigin[e],t[e+3]-=this.localOrigin[e];return t}};const h=(0,n.vt)(),l=(0,n.vt)(),u=(0,n.vt)(),d=(0,n.vt)(),f=(0,n.vt)()},75497(t,e,i){i.d(e,{$p:()=>s,Qx:()=>o,e_:()=>a});var r=i(51850),n=i(37957);class s{constructor(t=(0,r.Ul)()){this.intensity=t}}class o{constructor(t=(0,r.Ul)(),e=(0,r.fA)(.57735,.57735,.57735),i=!0,n=1,s=1){this.intensity=t,this.direction=e,this.castShadows=i,this.specularStrength=n,this.environmentStrength=s}}class a{constructor(){this.r=n.P.create(),this.g=n.P.create(),this.b=n.P.create()}clear(){this.r.fill(0),this.g.fill(0),this.b.fill(0)}}},57226(t,e,i){i.d(e,{T:()=>y});var r=i(34727),n=i(35522),s=i(51850),o=i(75497);function a(t,e,i){i.length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e;return i}function c(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]+e[r];return i}var h=i(37957);const l=.28209479177;function u(t,e){(0,n.ze)(m,t.direction),function(t,e){const i=t[0],r=t[1],n=t[2],s=e||h.P.create();s[0]=l,s[1]=.4886025119*i,s[2]=.4886025119*n,s[3]=.4886025119*r,s[4]=1.09254843059*i*r,s[5]=1.09254843059*r*n,s[6]=.31539156525*(3*n*n-1),s[7]=1.09254843059*i*n,s[8]=.54627421529*(i*i-r*r)}(m,f),function(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e[r]}(f,g),a(f,t.intensity[0],p),c(e.r,p),a(f,t.intensity[1],p),c(e.g,p),a(f,t.intensity[2],p),c(e.b,p)}function d(t,e){e.r[0]+=l*g[0]*t.intensity[0]*4*Math.PI,e.g[0]+=l*g[0]*t.intensity[1]*4*Math.PI,e.b[0]+=l*g[0]*t.intensity[2]*4*Math.PI}const f=h.P.create(),p=h.P.create(),m=(0,s.vt)(),g=[3.141593,2.094395,2.094395,2.094395,.785398,.785398,.785398,.785398,.785398];class _{constructor(){this.color=(0,s.vt)(),this.intensity=1}}class v{constructor(){this.direction=(0,s.vt)(),this.ambient=new _,this.diffuse=new _}}class y{constructor(){this._legacy=new v,this.globalFactor=.5,this.noonFactor=.5,this._sphericalHarmonics=new o.e_,this._mainLight=new o.Qx((0,s.vt)(),(0,s.fA)(1,0,0),!1)}get legacy(){return this._legacy}get sh(){return this._sphericalHarmonics}get mainLight(){return this._mainLight}set(t){(function(t,e,i){var r;i.clear(),(0,n.hZ)(e.intensity,0,0,0),r=t,Array.isArray(r)?Array.isArray(t)&&((0,n.C)(e.direction,t[0].direction),(0,n.C)(e.intensity,t[0].intensity),e.specularStrength=t[0].specularStrength,e.environmentStrength=t[0].environmentStrength,e.castShadows=t[0].castShadows,u(t[2],i),d(t[1],i)):d(t,i)})(t,this._mainLight,this._sphericalHarmonics),this.updateLegacy()}updateLegacy(){(0,n.C)(this._legacy.direction,this._mainLight.direction);const t=1/Math.PI;this._legacy.ambient.color[0]=.282095*this._sphericalHarmonics.r[0]*t,this._legacy.ambient.color[1]=.282095*this._sphericalHarmonics.g[0]*t,this._legacy.ambient.color[2]=.282095*this._sphericalHarmonics.b[0]*t,(0,n.hs)(this._legacy.diffuse.color,this._mainLight.intensity,t),(0,n.C)(x,this._legacy.diffuse.color),(0,n.hs)(x,x,.4*this.globalFactor),(0,n.WQ)(this._legacy.ambient.color,this._legacy.ambient.color,x)}copyFrom(t){h.P.copy(this._sphericalHarmonics.r,t.sh.r),h.P.copy(this._sphericalHarmonics.g,t.sh.g),h.P.copy(this._sphericalHarmonics.b,t.sh.b),(0,n.C)(this._mainLight.direction,t.mainLight.direction),(0,n.C)(this._mainLight.intensity,t.mainLight.intensity),this._mainLight.castShadows=t.mainLight.castShadows,this._mainLight.specularStrength=t.mainLight.specularStrength,this._mainLight.environmentStrength=t.mainLight.environmentStrength,this.globalFactor=t.globalFactor,this.noonFactor=t.noonFactor}lerpLighting(t,e,i){if((0,n.Cc)(this._mainLight.intensity,t.mainLight.intensity,e.mainLight.intensity,i),this._mainLight.environmentStrength=(0,r.Cc)(t.mainLight.environmentStrength,e.mainLight.environmentStrength,i),this._mainLight.specularStrength=(0,r.Cc)(t.mainLight.specularStrength,e.mainLight.specularStrength,i),(0,n.C)(this._mainLight.direction,e.mainLight.direction),this._mainLight.castShadows=e.mainLight.castShadows,this.globalFactor=(0,r.Cc)(t.globalFactor,e.globalFactor,i),this.noonFactor=(0,r.Cc)(t.noonFactor,e.noonFactor,i),t.sh.r.length===e.sh.r.length)for(let n=0;n<e.sh.r.length;n++)this._sphericalHarmonics.r[n]=(0,r.Cc)(t.sh.r[n],e.sh.r[n],i),this._sphericalHarmonics.g[n]=(0,r.Cc)(t.sh.g[n],e.sh.g[n],i),this._sphericalHarmonics.b[n]=(0,r.Cc)(t.sh.b[n],e.sh.b[n],i);else for(let t=0;t<e.sh.r.length;t++)this._sphericalHarmonics.r[t]=e.sh.r[t],this._sphericalHarmonics.g[t]=e.sh.g[t],this._sphericalHarmonics.b[t]=e.sh.b[t];this.updateLegacy()}}const x=(0,s.vt)()},33442(t,e,i){i.d(e,{T:()=>u,s:()=>h});var r=i(49255);const n=l(-1),s=l(1),o=n,a=new Array;a[0]=null,a[1]=s,a[2]=n,a[3]=l(-2),a[4]=l(-3);const c=a.map(t=>function(t,e){return e?{factor:t.factor+e.factor,units:t.units+e.units}:t}(o,t));function h({output:t,enableOITOffset:e,polygonOffset:i}){return(0,r._$)(t)&&e?c[i]:a[i]}function l(t){return{factor:1*t,units:2*t}}function u(t){const e=h(t)??{factor:0,units:0};return{factor:e.factor+n.factor*t.polygonOffsetIndex,units:e.units+n.units*t.polygonOffsetIndex}}a[1]=s},47724(t,e,i){i.d(e,{L:()=>a});var r=i(5482),n=i(51976),s=i(34711);class o extends s.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,r.Cg)([(0,n.W)()],o.prototype,"hasHighlightMixTexture",void 0),(0,r.Cg)([(0,n.W)()],o.prototype,"emissionDimmingPass",void 0);class a extends o{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,r.Cg)([(0,n.W)({count:5})],a.prototype,"polygonOffset",void 0),(0,r.Cg)([(0,n.W)()],a.prototype,"transparent",void 0),(0,r.Cg)([(0,n.W)()],a.prototype,"enableOITOffset",void 0)},46606(t,e,i){i.d(e,{S:()=>a,p:()=>c}),i(34727),i(77690),i(29242),i(58083);var r=i(9093),n=(i(35522),i(51850)),s=(i(78955),i(91829),i(31756),i(26857),i(16943),i(65786));class o extends s.Y{constructor(t){super(),this.vvSize=t?.size??null,this.vvColor=t?.color??null,this.vvOpacity=t?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}(0,r.vt)(),(0,n.vt)(),(0,r.vt)();class a extends o{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}const c=8},43616(t,e,i){i.d(e,{MB:()=>c,kE:()=>o});var r=i(4576),n=i(34727),s=i(77194);function o(t,e,i,r,s,o){let a=i.screenLength*t.pixelRatio;null!=s&&(h.update(r,e,s,o),a=h.apply(a));const c=a*Math.tan(.5*t.fovY)/(.5*t.fullHeight);return(0,n.qE)(c*e,i.minWorldLength,i.maxWorldLength)}const a=(0,r.VO)();function c(t,e){let i=!1;for(const r in e){const n=e[r];void 0!==n&&(Array.isArray(n)?Array.isArray(t[r])&&a(n,t[r])||(t[r]=n.slice(),i=!0):t[r]!==n&&(i=!0,t[r]=n))}return i}const h=new s.PS;i.d(e,["Um",0,{multiply:1,ignore:2,replace:3,tint:4}])},59907(t,e,i){i.d(e,{vJ:()=>l,vx:()=>h}),i(35522);var r=i(51850),n=i(58083),s=i(13030),o=i(620);function a(t,e,i){const{data:r,indices:n}=t,s=e.typedBuffer,o=e.typedBufferStride,a=n.length;i*=o;for(let t=0;t<a;++t){const e=2*n[t];s[i]=r[e],s[i+1]=r[e+1],i+=o}}function c(t,e,i,r=1){const{data:n,indices:s}=t,o=e.typedBuffer,a=e.typedBufferStride,c=s.length;if(i*=a,1===r)for(let t=0;t<c;++t){const e=3*s[t];o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],i+=a}else for(let t=0;t<c;++t){const e=3*s[t];for(let t=0;t<r;++t)o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],i+=a}}function h(t,e,i,r,n=1){const s=e.typedBuffer,o=e.typedBufferStride;if(r*=o,1===n)for(let e=0;e<i;++e)s[r]=t[0],s[r+1]=t[1],s[r+2]=t[2],s[r+3]=t[3],r+=o;else for(let e=0;e<i;++e)for(let e=0;e<n;++e)s[r]=t[0],s[r+1]=t[1],s[r+2]=t[2],s[r+3]=t[3],r+=o}function l(t,e,i,r,n,o){const{buffer:a,offset:c}=o;for(const o of i.fields.keys()){const i=t.get(o),l=i?.indices;if(i&&l)u(o,i,r,n,a,c);else if("olidColor"===o&&null!=e){const i=t.get("position")?.indices;if(i){const t=i.length;h(e,a.getField(o,s.XP),t,c)}}}}function u(t,e,i,r,h,l){switch(t){case"position":{(0,o.vA)(3===e.size);const r=h.getField(t,s.xs);(0,o.vA)(!!r,`No buffer view for ${t}`),function(t,e,i,r,s=1){if(!e)return void c(t,i,r,s);const{data:o,indices:a}=t,h=i.typedBuffer,l=i.typedBufferStride,u=a.length,d=e[0],f=e[1],p=e[2],m=e[4],g=e[5],_=e[6],v=e[8],y=e[9],x=e[10],b=e[12],w=e[13],T=e[14];r*=l;let M=0,A=0,S=0;const C=(0,n.tZ)(e)?t=>{M=o[t]+b,A=o[t+1]+w,S=o[t+2]+T}:t=>{const e=o[t],i=o[t+1],r=o[t+2];M=d*e+m*i+v*r+b,A=f*e+g*i+y*r+w,S=p*e+_*i+x*r+T};if(1===s)for(let t=0;t<u;++t)C(3*a[t]),h[r]=M,h[r+1]=A,h[r+2]=S,r+=l;else for(let t=0;t<u;++t){C(3*a[t]);for(let t=0;t<s;++t)h[r]=M,h[r+1]=A,h[r+2]=S,r+=l}}(e,i,r,l);break}case"normal":{(0,o.vA)(3===e.size);const i=h.getField(t,s.xs);(0,o.vA)(!!i,`No buffer view for ${t}`),function(t,e,i,r,s=1){if(!e)return void c(t,i,r,s);const{data:o,indices:a}=t,h=e,l=i.typedBuffer,u=i.typedBufferStride,d=a.length,f=h[0],p=h[1],m=h[2],g=h[4],_=h[5],v=h[6],y=h[8],x=h[9],b=h[10],w=!(0,n.ut)(h),T=1e-6,M=1-T;r*=u;let A=0,S=0,C=0;const E=(0,n.tZ)(h)?t=>{A=o[t],S=o[t+1],C=o[t+2]}:t=>{const e=o[t],i=o[t+1],r=o[t+2];A=f*e+g*i+y*r,S=p*e+_*i+x*r,C=m*e+v*i+b*r};if(1===s)if(w)for(let t=0;t<d;++t){E(3*a[t]);const e=A*A+S*S+C*C;if(e<M&&e>T){const t=1/Math.sqrt(e);l[r]=A*t,l[r+1]=S*t,l[r+2]=C*t}else l[r]=A,l[r+1]=S,l[r+2]=C;r+=u}else for(let t=0;t<d;++t)E(3*a[t]),l[r]=A,l[r+1]=S,l[r+2]=C,r+=u;else for(let t=0;t<d;++t){if(E(3*a[t]),w){const t=A*A+S*S+C*C;if(t<M&&t>T){const e=1/Math.sqrt(t);A*=e,S*=e,C*=e}}for(let t=0;t<s;++t)l[r]=A,l[r+1]=S,l[r+2]=C,r+=u}}(e,r,i,l);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,o.vA)(2===e.size);const i=h.getField(t,s.mJ);(0,o.vA)(!!i,`No buffer view for ${t}`),a(e,i,l);break}case"uv0":{(0,o.vA)(2===e.size);const i=h.getField(t,s.ZD)??h.getField(t,s.gH);(0,o.vA)(!!i,`No buffer view for ${t}`),a(e,i,l);break}case"uvi":{(0,o.vA)(2===e.size);const i=h.getField(t,s.mJ);(0,o.vA)(!!i,`No buffer view for ${t}`),a(e,i,l);break}case"color":case"symbolColor":{const i=h.getField(t,s.XP);(0,o.vA)(!!i,`No buffer view for ${t}`),(0,o.vA)(3===e.size||4===e.size),function(t,e,i,r,n=1){const{data:s,indices:o}=t,a=i.typedBuffer,c=i.typedBufferStride,h=o.length;if(r*=c,e===s.length&&4===e){a[r]=s[0],a[r+1]=s[1],a[r+2]=s[2],a[r+3]=s[3];const t=new Uint32Array(i.typedBuffer.buffer,i.start),e=c/4,o=t[r/=4];r+=e;const l=h*n;for(let i=1;i<l;++i)t[r]=o,r+=e;return}if(1!==n)if(4!==e)for(let t=0;t<h;++t){const e=3*o[t];for(let t=0;t<n;++t)a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=255,r+=c}else for(let t=0;t<h;++t){const e=4*o[t];for(let t=0;t<n;++t)a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=s[e+3],r+=c}else{if(4===e){for(let t=0;t<h;++t){const e=4*o[t];a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=s[e+3],r+=c}return}for(let t=0;t<h;++t){const e=3*o[t];a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=255,r+=c}}}(e,e.size,i,l);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const i=h.getField(t,s.Y$)??h.getField(t,s.Y$);(0,o.vA)(!!i,`No buffer view for ${t}`),(0,o.vA)(1===e.size),function(t,e,i){const{data:r,indices:n}=t,s=e.typedBuffer,o=e.typedBufferStride,a=n.length,c=r[0];i*=o;for(let t=0;t<a;++t)s[i]=c,i+=o}(e,i,l);break}case"tangent":{(0,o.vA)(4===e.size);const r=h.getField(t,s.Eq);(0,o.vA)(!!r,`No buffer view for ${t}`),function(t,e,i,r,s=1){if(!e)return void function(t,e,i,r=1){const{data:n,indices:s}=t,o=e.typedBuffer,a=e.typedBufferStride,c=s.length;if(i*=a,1===r)for(let t=0;t<c;++t){const e=4*s[t];o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],o[i+3]=n[e+3],i+=a}else for(let t=0;t<c;++t){const e=4*s[t];for(let t=0;t<r;++t)o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],o[i+3]=n[e+3],i+=a}}(t,i,r,s);const{data:o,indices:a}=t,c=e,h=i.typedBuffer,l=i.typedBufferStride,u=a.length,d=c[0],f=c[1],p=c[2],m=c[4],g=c[5],_=c[6],v=c[8],y=c[9],x=c[10],b=!(0,n.ut)(c),w=1e-6,T=1-w;if(r*=l,1===s)for(let t=0;t<u;++t){const e=4*a[t],i=o[e],n=o[e+1],s=o[e+2],c=o[e+3];let u=d*i+m*n+v*s,M=f*i+g*n+y*s,A=p*i+_*n+x*s;if(b){const t=u*u+M*M+A*A;if(t<T&&t>w){const e=1/Math.sqrt(t);u*=e,M*=e,A*=e}}h[r]=u,h[r+1]=M,h[r+2]=A,h[r+3]=c,r+=l}else for(let t=0;t<u;++t){const e=4*a[t],i=o[e],n=o[e+1],c=o[e+2],u=o[e+3];let M=d*i+m*n+v*c,A=f*i+g*n+y*c,S=p*i+_*n+x*c;if(b){const t=M*M+A*A+S*S;if(t<T&&t>w){const e=1/Math.sqrt(t);M*=e,A*=e,S*=e}}for(let t=0;t<s;++t)h[r]=M,h[r+1]=A,h[r+2]=S,h[r+3]=u,r+=l}}(e,i,r,l);break}}}(0,r.vt)()},47630(t,e,i){i.d(e,{D:()=>d});var r=i(49255),n=i(47187),s=i(3871),o=i(63365);function a(t){t.code.add("\n vec3 emissionFilter(in vec3 srcColor, float srcAlpha) {\n vec3 color = min(srcColor + vec3(1.0 - srcAlpha), 1.0);\n float m = max(color.r, max(color.g, color.b));\n return m > 0.0 ? color / m : vec3(1.0);\n }\n ")}var c=i(31821),h=i(26934),l=i(58243),u=i(72458);function d(t,e){t.include(s.Q,e),t.include(n.zp,e);const{fragment:i,outputs:d}=t;i.include(o.a);const{output:f,hasEmission:p,oitPremultipliedAlpha:m,snowCover:g,emissionDimmingPass:_,renderOccluded:v}=e,y=11===f,x=(0,r._$)(f),b=(0,r.Rb)(f),w=(0,r._o)(f)&&!x,T=0!==f||v;let M=0;(w||x)&&d.add("fragColor","vec4",M++),x&&d.add("fragAlpha","float",M++),p&&d.add("fragEmission","vec4",M++),i.include(o.a),i.include(h.Q),i.include(u.O,e),i.include(l.t,e),_&&i.include(a),i.code.add(c.H`
|
|
244
|
+
}`)}function c(t){t.uniforms.add(new s.t("screenSizePerspective",t=>l(t.screenSizePerspective,t.screenSizePerspectiveMinPixelReferenceSize)))}function h(t){t.uniforms.add(new s.t("screenSizePerspectiveAlignment",t=>l(t.screenSizePerspectiveAlignment||t.screenSizePerspective,t.screenSizePerspectiveAlignment?null:t.screenSizePerspectiveMinPixelReferenceSize)))}function l(t,e){const i=null!=e&&null!=t?Math.min(t.minPixelSize/e,1):0;return t?(0,r.hZ)(u,t.divisor,t.offset,i):(0,r.hZ)(u,0,0,0)}const u=(0,n.vt)()},77949(t,e,i){i.d(e,{NB:()=>f,Nz:()=>_,S7:()=>g,yu:()=>d});var r=i(58083),n=i(9093),s=i(35522),o=i(51850),a=i(23205),c=i(40710),h=i(33094),l=i(58029),u=i(97102);function d(t,e){e.instancedDoublePrecision?t.constants.add("cameraPosition","vec3",o.uY):t.uniforms.add(new c.W("cameraPosition",(t,e)=>(0,s.hZ)(m,e.camera.viewInverseTransposeMatrix[3]-t.origin[0],e.camera.viewInverseTransposeMatrix[7]-t.origin[1],e.camera.viewInverseTransposeMatrix[11]-t.origin[2])))}function f(t,e){if(!e.instancedDoublePrecision)return void t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new u.S("view",(t,e)=>(0,r.Tl)(p,e.camera.viewMatrix,t.origin)),new c.W("localOrigin",t=>t.origin));const i=({camera:t})=>(0,s.hZ)(m,t.viewInverseTransposeMatrix[3],t.viewInverseTransposeMatrix[7],t.viewInverseTransposeMatrix[11]);t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new l.F("view",t=>(0,r.Tl)(p,t.camera.viewMatrix,i(t))),new a.d("localOrigin",t=>i(t)))}const p=(0,n.vt)(),m=(0,o.vt)();function g(t){t.uniforms.add(new l.F("viewNormal",t=>t.camera.viewInverseTransposeMatrix))}function _(t){t.uniforms.add(new h.U("pixelRatio",t=>t.camera.pixelRatio/t.overlayStretch))}},77108(t,e,i){i.d(e,{E:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",0,(r,n)=>r.setUniform2fv(t,e(n),i))}}},68259(t,e,i){i.d(e,{t:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",2,(r,n,s,o)=>r.setUniform2fv(t,e(n,s,o),i))}}},47286(t,e,i){i.d(e,{G:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",1,(r,n,s)=>r.setUniform2fv(t,e(n,s),i))}}},23205(t,e,i){i.d(e,{d:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec3",0,(r,n)=>r.setUniform3fv(t,e(n),i))}}},14314(t,e,i){i.d(e,{I:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec4",0,(r,n)=>r.setUniform4fv(t,e(n),i))}}},71988(t,e,i){i.d(e,{E:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec4",1,(r,n,s)=>r.setUniform4fv(t,e(n,s),i))}}},33094(t,e,i){i.d(e,{U:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"float",0,(r,n)=>r.setUniform1f(t,e(n),i))}}},44887(t,e,i){i.d(e,{x:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i,r){super(t,"float",1,(e,n,s)=>e.setUniform1fv(t,i(n,s),r),e)}}},35818(t,e,i){i.d(e,{W:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"int",0,(i,r)=>i.setUniform1i(t,e(r)))}}},93588(t,e,i){i.d(e,{c:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"int",1,(i,r,n)=>i.setUniform1i(t,e(r,n)))}}},35644(t,e,i){i.d(e,{k:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat3",1,(r,n,s)=>r.setUniformMatrix3fv(t,e(n,s),i))}}},58029(t,e,i){i.d(e,{F:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat4",0,(r,n)=>r.setUniformMatrix4fv(t,e(n),i))}}},97102(t,e,i){i.d(e,{S:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat4",2,(r,n,s)=>r.setUniformMatrix4fv(t,e(n,s),i))}}},12791(t,e,i){i.d(e,{x:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"sampler2D",0,(i,r)=>i.bindTexture(t,e(r)))}}},13840(t,e,i){i.d(e,{r:()=>r});class r{constructor(t,e){this._module=t,this._load=e}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98958(t,e,i){i.d(e,{w:()=>p});var r=i(5482),n=i(69622),s=i(53966),o=i(91429),a=i(41976),c=(i(44208),i(26857)),h=i(94656);class l{constructor(t,e,i){this._context=t,this.locations=i,this._textures=new Map,this.source=(0,h.en)()?e:null,e.attributeNames.forEach(t=>{i.has(t)||s.A.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${t} used in shader`)}),this._glProgram=t.programCache.get(e.generate("vertex",!0),e.generate("fragment",!0),i),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=e.generateBind(this),this.bindPass=e.generateBindPass(this),this.bindDraw=e.generateBindDraw(this)}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(t,e){this._glProgram.setUniform1i(t,e?1:0)}setUniform1i(t,e){this._glProgram.setUniform1i(t,e)}setUniform1f(t,e,i){this._glProgram.setUniform1f(t,e,i)}setUniform2fv(t,e,i){this._glProgram.setUniform2fv(t,e,i)}setUniform3fv(t,e,i){this._glProgram.setUniform3fv(t,e,i)}setUniform4fv(t,e,i){this._glProgram.setUniform4fv(t,e,i)}setUniformMatrix3fv(t,e,i){this._glProgram.setUniformMatrix3fv(t,e,!1,i)}setUniformMatrix4fv(t,e,i){this._glProgram.setUniformMatrix4fv(t,e,!1,i)}setUniformMatrices4fv(t,e,i){this._glProgram.setUniformMatrices4fv(t,e,!1,i)}setUniform1fv(t,e,i){this._glProgram.setUniform1fv(t,e,i)}setUniform1iv(t,e){this._glProgram.setUniform1iv(t,e)}setUniform2iv(t,e){this._glProgram.setUniform2iv(t,e)}setUniform3iv(t,e){this._glProgram.setUniform3iv(t,e)}setUniform4iv(t,e){this._glProgram.setUniform4iv(t,e)}assertCompatibleVertexAttributeLocations(t,e){if(c.b.ENABLE_OPTIMIZATIONS)return;let i=t.locations;if(e){const t=new Map(i);e.forEach((e,r)=>t.set(r,i.size+e)),i=t}i.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${i}, ${this.locations}`),this.locations.forEach((t,e)=>{i.get(e)!==t&&console.error(`VertexAttributeLocations are incompatible: Program has ${e} at position ${t}, VAO has it at position ${i.get(e)}.`)})}stop(){this._textures.clear()}bindTexture(t,e,i){if(!e?.glName){const i=`Texture sampler ${t} in ${this._context.debugBoundTechnique} has no given Texture in ${(new Error).stack}`;(0,h.en)()&&console.error(i),e=this._context.emptyTexture}const r=this._ensureTextureUnit(t,e);this._context.useProgram(this);const n=r.unit;this.setUniform1i(t,n),this._context.bindTexture(e,n,!1,i)}_ensureTextureUnit(t,e){let i=this._textures.get(t);return null==i?(i={texture:e,unit:this._textures.size},this._textures.set(t,i)):i.texture=e,i}}var u=i(63907),d=i(90644),f=i(85079);let p=class extends n.A{constructor(t,e,i){super({}),this._context=t,this._configuration=e,this.primitiveType=u.WR.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=e.key,this.locations=(0,f.Xk)(i??a.lK),this._pipeline=this.initializePipeline(e),this.reload=async i=>{if(i&&await this.shader.reload(),!this.key.equals(e.key))return void s.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);const r=this.shader.get().build(e);r.debugName=this.declaredClass,this._program=new l(t.rctx,r,this.locations),this._pipeline=this.initializePipeline(e)}}initialize(){const t=this.shader.get().build(this._configuration);t.debugName=this.declaredClass,this._program=new l(this._context.rctx,t,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(t){this.program.assertCompatibleVertexAttributeLocations(t)}getPipeline(t,e,i){return this._pipeline}initializePipeline(t){return(0,d.Ey)({blending:d.RC,colorWrite:d.kn})}};p=(0,r.Cg)([(0,o.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],p)},16943(t,e,i){i.d(e,{E:()=>n});var r=i(44208);function n(){return!!(0,r.A)("enable-feature:objectAndLayerId-rendering")}},41976(t,e,i){var r=i(63907),n=i(85079),s=i(74038);new s._("position",3,r.pe.FLOAT,0,12);const o=[new s._("position",2,r.pe.FLOAT,0,8)];(0,n.Xk)(o),new s._("position",2,r.pe.FLOAT,0,12),new s._("uv0",2,r.pe.HALF_FLOAT,8,12),new s._("position",2,r.pe.FLOAT,0,16),new s._("uv0",2,r.pe.FLOAT,8,16),i.d(e,["lK",0,o,"wR",0,[]])},92130(t,e,i){i.d(e,{A:()=>r});class r{constructor(t){this._material=t.material,this._techniques=t.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(t,e){return this._techniques.get(t,this._material.getConfiguration(e))}ensureResources(t){return 2}}},67499(t,e,i){i.d(e,{V:()=>E});var r=i(9093),n=i(35522),s=i(97146),o=i(34275),a=i(20498);function c(t){if(t.length<1024)return Array.from(t);if(Array.isArray(t))return Float64Array.from(t);if(!("BYTES_PER_ELEMENT"in t))return Array.from(t);switch(t.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(t);case 2:return(0,o.LW)(t)?(0,a.pX)().from(t):(0,o.jq)(t)?Uint16Array.from(t):Int16Array.from(t);case 4:return(0,o.vZ)(t)?Float32Array.from(t):Uint32Array.from(t);default:return Float64Array.from(t)}}var h=i(15142),l=i(51850),u=i(70328),d=i(94008),f=i(620);class p{constructor(t,e,i){this.primitiveIndices=t,this._numIndexPerPrimitive=e,this._readPosition=i,this._children=void 0,(0,f.vA)(t.length>=1);const r=t.length;v.clear();const s=(0,u.Ie)();for(let n=0;n<r;++n){const r=e*t[n];for(let t=0;t<e;++t){const e=r+t;v.push(e),(0,u.iT)(s,i(m,e))}}this.box=s;const o=new d.iy,a=(0,u.gX)(s,o.center);let c=.5*Math.max((0,u.VL)(s),(0,u.yr)(s),(0,u.uJ)(s)),h=c*c;for(let t=0;t<v.length;++t){const e=i(m,v.at(t)),r=(0,n.Re)(e,e,a),s=(0,n.uE)(r);if(s<=h)continue;const o=Math.sqrt(s),l=.5*(o-c);c+=l,h=c*c,(0,n.Ln)(a,a,r,l/o)}o.radius=c,this.sphere=o,v.clear()}get children(){if(this._children)return this._children;const t=this.box;if((0,u.TF)(t)<=1)return;const{_readPosition:e,_numIndexPerPrimitive:i,primitiveIndices:r}=this,s=(0,u.gX)(t,m),o=r.length,a=new Uint8Array(o),c=[0,0,0,0,0,0,0,0];for(let t=0;t<o;++t){const o=i*r[t],h=e(g,o);for(let t=1;t<i;++t)(0,n.jk)(h,h,e(_,o+t));const l=(h[0]<s[0]?1:0)|(h[1]<s[1]?2:0)|(h[2]<s[2]?4:0);a[t]=l,++c[l]}let h=0;for(let t=0;t<8;++t)c[t]>0&&++h;if(h<2)return;const l=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0];for(let t=0;t<8;++t)c[t]>0&&(l[t]=new Uint32Array(c[t]));c.fill(0);for(let t=0;t<o;++t){const e=a[t];l[e][c[e]++]=r[t]}const d=new Array;for(let t=0;t<8;++t){const r=l[t];void 0!==r&&d.push(new p(r,i,e))}return this._children=d,this._children}static prune(){v.prune()}}const m=(0,l.vt)(),g=(0,l.vt)(),_=(0,l.vt)(),v=new h.A({deallocator:null});var y=i(24326);class x{constructor(t){this.id=(0,y.c)(),this._attributes=new Map;for(const[e,i]of t)this._attributes.set(e,{...i,indices:(0,s.Dg)(i.indices)})}get attributes(){return this._attributes}}var b=i(48295);const w=(0,l.vt)(),T=(0,l.vt)(),M=(0,l.vt)(),A=(0,l.vt)();var S=i(17478),C=i(94656);class E extends x{constructor(t,e,i=null,r=0,n=null,s=-1,o,a){super(e),this.material=t,this.mapPositions=i,this.type=r,this.olidColor=n,this.edgeIndicesLength=s,this.baseGeometry=o,this.drawIndices=a,this._readPrimitivePosition=null,this._vertexPositionIndicesCache=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null,(0,f.vA)((t?.useIndexing??!1)===(null!=a),"Material index requirement and Geometry must match"),this.edgeIndicesLength<0&&(this.edgeIndicesLength=this.indexCount)}get readPrimitivePosition(){return this._readPrimitivePosition??=function(t,e){const{data:i,indices:r,size:n,stride:s}=t;return(0,f.vA)(3===n||4===n,"Position attribute must have 3 or 4 components"),null!=e?(t,n)=>{const o=r[e[n]]*s;return t[0]=i[o],t[1]=i[o+1],t[2]=i[o+2],t}:function(t,e,i){return(r,n)=>{const s=e[n]*i;return r[0]=t[s],r[1]=t[s+1],r[2]=t[s+2],r}}(i,r,s)}(this.positionAttribute,this.drawIndices),this._readPrimitivePosition}_invalidateReadPrimitivePosition(){this._readPrimitivePosition=null}instantiate(t={}){const e=new E(t.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((t,i)=>{t.exclusive=!1,e._attributes.set(i,t)}),e._boundingInfo=this._boundingInfo,e.transformation=t.transformation||this.transformation,e}getMutableAttribute(t){let e=this._attributes.get(t);return e&&!e.exclusive&&(e={...e,exclusive:!0,data:c(e.data)},this._attributes.set(t,e),"position"===t&&this._invalidateReadPrimitivePosition()),e}setAttributeData(t,e){const i=this._attributes.get(t);i?(this._attributes.set(t,{...i,exclusive:!0,data:e}),"position"===t&&this._invalidateReadPrimitivePosition()):(0,C.en)()&&console.warn(`Setting undefined attribute ${t} data`)}get primitivePositionIndices(){return void 0!==this._vertexPositionIndicesCache||(this._vertexPositionIndicesCache=this._computePrimitivePositionIndices()),this._vertexPositionIndicesCache}_computePrimitivePositionIndices(){const{drawIndices:t}=this,e=this.positionAttribute;if(null!=t&&null!=e){const i=new Array;for(const r of t)i.push(e.indices[r]);return i}return e?.indices??null}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const t=this.drawIndices??this.positionAttribute?.indices;return t?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(t){return!!this._calculateAttachmentOrigin(t)&&(null!=this._transformation&&(0,n.Z0)(t,t,this._transformation),!0)}_calculateAttachmentOrigin(t){return 0===this.type?this._computeAttachmentOriginTriangles(t):2===this.type?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t)}_computeAttachmentOriginTriangles(t){return function(t,e,i){if(i<=0)return!1;(0,n.hZ)(t,0,0,0),(0,n.hZ)(A,0,0,0);let r=0,s=0;for(let o=0;o<i;++o){const i=3*o;e(w,i),e(T,i+1),e(M,i+2);const a=(0,b.BU)(w,T,M);a?((0,n.WQ)(w,w,T),(0,n.WQ)(w,w,M),(0,n.hs)(w,w,1/3*a),(0,n.WQ)(t,t,w),r+=a):((0,n.WQ)(A,A,w),(0,n.WQ)(A,A,T),(0,n.WQ)(A,A,M),s+=3)}return!(0===s&&0===r||(0!==r?((0,n.hs)(t,t,1/r),0):0===s||((0,n.hs)(t,A,1/s),0)))}(t,this.readPrimitivePosition,this.indexCount/3)}_computeAttachmentOriginLines(t){const{indexCount:e}=this;return function(t,e,i,r){if(i<=0)return!1;(0,n.hZ)(t,0,0,0),(0,n.hZ)(A,0,0,0);let s=0,o=0;const a=i-1,c=a+(r?2:0);for(let i=0;i<c;i+=2){const r=i<a?i+1:0;e(w,i<a?i:a),e(T,r),(0,n.hs)(w,(0,n.WQ)(w,w,T),.5);const c=(0,n.xg)(w,T);c>0?((0,n.WQ)(t,t,(0,n.hs)(w,w,c)),s+=c):0===s&&((0,n.WQ)(A,A,w),o++)}return 0!==s?((0,n.hs)(t,t,1/s),!0):0!==o&&((0,n.hs)(t,A,1/o),!0)}(t,this.readPrimitivePosition,e,function(t,e){return!(!("isClosed"in t)||!t.isClosed)&&e>2}(this.material.parameters,e))}_computeAttachmentOriginPoints(t){return function(t,e,i){if(i<=0)return!1;(0,n.hZ)(t,0,0,0);let r=NaN,s=NaN,o=NaN,a=0;for(let n=0;n<i;n++){const i=e(w,n);i[0]===r&&i[1]===s&&i[2]===o||(t[0]+=i[0],t[1]+=i[1],t[2]+=i[2],a++),r=i[0],s=i[1],o=i[2]}return a>1&&(0,n.hs)(t,t,1/a),a>0}(t,this.readPrimitivePosition,this.indexCount)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const t=this.positionAttribute,e=this.indexCount;if(!t||0===e)return null;const i=0===this.type?3:1;(0,f.vA)(e%i===0,"Indexing error: "+e+" not divisible by "+i);const r=(0,s.tM)(e/i);return new p(r,i,this.readPrimitivePosition)}get transformation(){return this._transformation??r.zK}set transformation(t){this._transformation=t&&t!==r.zK?(0,r.o8)(t):null}get highlights(){return this._highlights||R}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(t){this._highlightOptionsCounts?.forEach((e,i)=>t(i))}allocateIdAndHighlight(t){const e=new S.h(t);return this.addHighlight(e)}addHighlight(t){this._ensureHighlights().add(t);const{highlightName:e}=t,i=(this._highlightOptionsCounts?.get(e)??0)+1;return this._ensureHighlightOptionsCounts().set(e,i),t}_ensureHighlights(){let t=this._highlights;return t||(t=new Set,this._highlights=t),t}_ensureHighlightOptionsCounts(){let t=this._highlightOptionsCounts;return t||(t=new Map,this._highlightOptionsCounts=t),t}removeHighlight(t){if(this._highlights?.delete(t)){const{highlightName:e}=t,i=this._highlightOptionsCounts?.get(e)??0;i<=1?this._highlightOptionsCounts?.delete(e):this._ensureHighlightOptionsCounts().set(e,i-1)}}}const R=new Set},49718(t,e,i){i(51850),i(6867).w_},6867(t,e,i){i.d(e,{w_:()=>u});var r=i(58083),n=i(9093),s=i(35522),o=i(51850),a=i(78955),c=i(91829),h=i(71351);class l{constructor(){this.intersector=4}get distance(){return this._distance}get renderDistance(){return this._renderDistance}_init(){this._distance=this._renderDistance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4}_setBase(t,e,i,r=null,n=null,s=null){this.intersector=t,this._distance=i,this._renderDistance=r,this.target=e,this.drapedLayerOrder=n,this.renderPriority=s}}class u extends l{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,s.hs)(f,this.ray.direction,this.distance),(0,s.Bw)(f))}withinDistance(t){return!!d(this)&&null!=this.distanceInRenderSpace&&this.distanceInRenderSpace<=t}getIntersectionPoint(t){return!!d(this)&&((0,s.hs)(f,this.ray.direction,this.distance),(0,s.WQ)(t,this.ray.origin,f),!0)}getTransformedNormal(t){return(0,s.C)(p,this.normal),p[3]=0,(0,a.Z0)(p,p,this.transformation),(0,s.C)(t,p),(0,s.S8)(t,t)}constructor(t){super(),this.normal=(0,o.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,h.vt)(),this.init(t)}init(t){super._init(),t&&(0,h.C)(t,this._ray)}set(t,e,i,a,c,h,l,u){this._setBase(t,e,i,a,l,u),(0,s.C)(this.normal,c??o.Cb),(0,r.C)(this.transformation,h??n.zK)}copy(t){this._setBase(t.intersector,t.target,t.distance,t.renderDistance,t.drapedLayerOrder,t.renderPriority),(0,h.C)(t.ray,this._ray),(0,s.C)(this.normal,t.normal),(0,r.C)(this.transformation,t.transformation)}}function d(t){return null!=t?.distance&&null!=t?.renderDistance}const f=(0,o.vt)(),p=(0,c.vt)()},18845(t,e,i){i.d(e,{h:()=>U});var r=i(49186),n=i(65529),s=i(97768),o=i(17676),a=i(34275),c=i(24326),h=i(84952),l=i(38969),u=i(31217),d=i(95117),f=i(2741);let p;var m=i(63907),g=i(21231),_=i(42293);let v=null,y=null;async function x(){return null==y&&(p??=(async()=>{const t=await i.e(9321).then(i.bind(i,49321)),e=await t.default({locateFile:t=>(0,f.s)(`esri/libs/basisu/${t}`)});return e.initializeBasis(),e})(),y=p,v=await y),y}function b(t,e){if(null==v)return t.byteLength;const i=new v.BasisFile(new Uint8Array(t)),r=M(i)?T(i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),e):0;return i.close(),i.delete(),r}function w(t,e){if(null==v)return t.byteLength;const i=new v.KTX2File(new Uint8Array(t)),r=A(i)?T(i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),e):0;return i.close(),i.delete(),r}function T(t,e,i,r,n){const s=(0,_.MW)(e?m.CQ.COMPRESSED_RGBA8_ETC2_EAC:m.CQ.COMPRESSED_RGB8_ETC2),o=n&&t>1?(4**t-1)/(3*4**(t-1)):1;return Math.ceil(i*r*s*o)}function M(t){return t.getNumImages()>=1&&!t.isUASTC()}function A(t){return t.getFaces()>=1&&(t.isETC1S()||t.isUASTC())}function S(t,e,i,r,n,s,o,a){const{compressedTextureETC:c,compressedTextureS3TC:h}=t.capabilities,[l,u]=c?r?[1,m.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,m.CQ.COMPRESSED_RGB8_ETC2]:h?r?[3,m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],d=e.hasMipmap?i:Math.min(1,i),f=[];for(let t=0;t<d;t++)f.push(new Uint8Array(o(t,l))),a(t,l,f[t]);return e.internalFormat=u,e.hasMipmap=f.length>1,e.samplingMode=e.hasMipmap?9987:9729,e.width=n,e.height=s,new g.A(t,e,{type:"compressed",levels:f})}var C=i(53966);const E=()=>C.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function R(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}const I=R("DXT1"),D=R("DXT3"),O=R("DXT5");function P(t,e){const i=new Int32Array(t.buffer,t.byteOffset,31);if(542327876!==i[0])return E().error("Invalid magic number in DDS header"),null;if(!(4&i[20]))return E().error("Unsupported format, must contain a FourCC code"),null;const r=i[21];let n,s;switch(r){case I:n=8,s=m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case D:n=16,s=m.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case O:n=16,s=m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return E().error("Unsupported FourCC code:",function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)}(r)),null}let o=1,a=i[4],c=i[3];(3&a||3&c)&&(E().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,c=c+3&-4);const h=a,l=c;let u,d;131072&i[2]&&!1!==e&&(o=Math.max(1,i[7]));let f=t.byteOffset+i[1]+4;const p=[];for(let e=0;e<o;++e)d=(a+3>>2)*(c+3>>2)*n,u=new Uint8Array(t.buffer,f,d),p.push(u),f+=d,a=Math.max(1,a>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:p},internalFormat:s,width:h,height:l}}var F=i(78988),N=i(620),B=i(67171),L=i(12541);class U{constructor(t,e){this._data=t,this.id=(0,c.c)(),this.events=new n.bk,this._parameters={...V,...e},this._startPreload(t)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(t){t instanceof HTMLVideoElement?(this.update=e=>this._update(t,e),this._startPreloadVideoElement(t)):t instanceof HTMLImageElement&&this._startPreloadImageElement(t)}_startPreloadVideoElement(t){if(!((0,h.w8)(t.src)||"auto"===t.preload&&t.crossOrigin)&&(t.preload="auto",t.crossOrigin="anonymous",t.src=t.src,t.paused&&t.autoplay)){const e=[];(0,l.i)(t,t=>e.push(t)).then(()=>{t.play()}).finally(()=>e.forEach(t=>t.remove()))}}_startPreloadImageElement(t){(0,h.DB)(t.src)||(0,h.w8)(t.src)||t.crossOrigin||(t.crossOrigin="anonymous",t.src=t.src)}_createDescriptor(t){const e=new B.R;return e.wrapMode=this._parameters.wrap??10497,e.flipped=!this._parameters.noUnpackFlip,e.samplingMode=this._parameters.mipmap?9987:9729,e.hasMipmap=!!this._parameters.mipmap,e.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,e.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?t.parameters.maxMaxAnisotropy:1),e.dataType=this._parameters.dataType??e.dataType,e.pixelFormat=this._parameters.pixelFormat??e.pixelFormat,e.internalFormat=this._parameters.internalFormat??e.internalFormat,e.isImmutable=!0===this._parameters.immutable&&function(t){return null!=t&&((0,L.tl)(t)||(0,L.tr)(t)||(0,L.CR)(t)||(0,L.QJ)(t))}(this._parameters.internalFormat),e}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(t,e){if(null==t)return 0;if((0,a.mw)(t)||(0,a.mg)(t))return"image/ktx2"===e.encoding?w(t,!!e.mipmap):"image/x.basis"===e.encoding?b(t,!!e.mipmap):t.byteLength;const{width:i,height:r}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?H(t):e,n=e.pixelFormat??6408,s=(0,_.wH)(n);return(e.mipmap?4/3:1)*i*r*s||0}(this._data,this._parameters)}load(t){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const e=this._data;return null==e?(this._texture=new g.A(t,this._createDescriptor(t),null),this._texture):(this._emptyTexture=t.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof e?this._loadFromURL(t,e):e instanceof Image?this._loadFromImageElement(t,e):e instanceof HTMLVideoElement?this._loadFromVideoElement(t,e):e instanceof ImageData||e instanceof HTMLCanvasElement?this._loadFromImage(t,e):(0,a.mg)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,e):(0,a.mw)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,new Uint8Array(e)):((0,a.mw)(e)||(0,a.mg)(e))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(t,e):((0,a.mw)(e)||(0,a.mg)(e))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(t,e):(0,a.mw)(e)?this._loadFromPixelData(t,new Uint8Array(e)):(0,a.iu)(e)?this._loadFromPixelData(t,e):null)}_update(t,e){return null==this._texture||t.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||e===t.currentTime?e:(this._texture.setData(t),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),t.currentTime)}_loadFromDDSData(t,e){return this._texture=function(t,e,i){const r=P(i,e.hasMipmap??!1);if(null==r)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:s,width:o,height:a}=r;return e.samplingMode=n.levels.length>1?9987:9729,e.hasMipmap=n.levels.length>1,e.internalFormat=s,e.width=o,e.height=a,new g.A(t,e,n)}(t,this._createDescriptor(t),e),this._emptyTexture=null,this._texture}_loadFromKTX2(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await x());const r=new v.KTX2File(new Uint8Array(i));if(!A(r))return null;r.startTranscoding();const n=S(t,e,r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),(t,e)=>r.getImageTranscodedSizeInBytes(t,0,0,e),(t,e,i)=>r.transcodeImage(i,t,0,0,e,0,-1,-1));return r.close(),r.delete(),n}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromBasis(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await x());const r=new v.BasisFile(new Uint8Array(i));if(!M(r))return null;r.startTranscoding();const n=S(t,e,r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),(t,e)=>r.getImageTranscodedSizeInBytes(0,t,e),(t,e,i)=>r.transcodeImage(i,0,t,e,0,0));return r.close(),r.delete(),n}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromPixelData(t,e){(0,N.vA)(this._parameters.width>0&&this._parameters.height>0);const i=this._createDescriptor(t);return 6407!==i.pixelFormat&&6408!==i.pixelFormat||(i.compress=this._parameters.compressionOptions),i.width=this._parameters.width??0,i.height=this._parameters.height??0,this._texture=new g.A(t,i,e),this._texture}_loadFromURL(t,e){return this._loadAsync(async i=>{const r=await(0,u.D)(e,{signal:i});return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromImageElement(t,e){return e.complete?this._loadFromImage(t,e):this._loadAsync(async i=>{const r=await(0,d.y)(e,e.src,!1,i);return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromVideoElement(t,e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(t,e):this._loadFromVideoElementAsync(t,e)}_loadFromVideoElementAsync(t,e){return this._loadAsync(i=>new Promise((n,a)=>{const c=()=>{e.removeEventListener("loadeddata",h),e.removeEventListener("error",l),(0,s.xt)(u)},h=()=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(c(),n(this._loadFromImage(t,e)))},l=t=>{c(),a(t||new r.A("texture:load-error","Failed to load video"))};e.addEventListener("loadeddata",h),e.addEventListener("error",l);const u=(0,o.u7)(i,()=>l((0,o.NK)()))}))}_loadFromImage(t,e){let i=e;i instanceof HTMLVideoElement||(i=(0,F.vM)(i,t.parameters));const r=H(i);this._parameters.width=r.width,this._parameters.height=r.height;const n=this._createDescriptor(t);return n.width=r.width,n.height=r.height,n.compress=this._parameters.compressionOptions,this._texture=new g.A(t,n,i),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(t){const e=new AbortController;this._loadingController=e;const i=t(e.signal);this._loadingPromise=i;const r=()=>{this._loadingController===e&&(this._loadingController=null),this._loadingPromise===i&&(this._loadingPromise=null),this._emptyTexture=null};return i.then(r,r),i}unload(){if(this._texture=(0,s.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const t=this._loadingController;this._loadingController=null,this._loadingPromise=null,t.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function H(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}const V={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},11725(t,e,i){i.d(e,{i:()=>a});var r=i(24326),n=i(49255),s=i(43616),o=i(65786);class a{constructor(t,e){this.id=(0,r.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new e,(0,s.MB)(this._parameters,t),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(t){return!1}setParameters(t,e=!0){(0,s.MB)(this._parameters,t)&&(this.validateParameters(this._parameters),e&&this._parametersChanged())}validateParameters(t){}shouldRender(t){return this.visible&&this.isVisibleForOutput(t.output)&&(!this.parameters.isDecoration||t.bind.decorations)&&0!==(this.parameters.renderOccluded&t.renderOccludedMask)}isVisibleForOutput(t){return!0}get renderPriority(){return this._renderPriority}set renderPriority(t){t!==this._renderPriority&&(this._renderPriority=t,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get emissions(){return 0}getConfiguration(t){return this.updateConfiguration(t),this._configuration}updateConfiguration(t){this._configuration.output=t.output,this._configuration.hasEmission=t.hasEmission&&(0,n._o)(t.output),this._configuration.hasHighlightMixTexture=10===t.output&&null!=t.highlightMixTexture,this._configuration.useFloatBlend=t.useFloatBlend.value,this._configuration.emissionDimmingPass=t.transparentWithoutDepthEmissionDimmingPass&&(0,n._o)(t.output)}}o.Y},17478(t,e,i){i.d(e,{h:()=>s,p:()=>o});var r=i(24326);class n{constructor(){this.uid=(0,r.c)()}}class s extends n{constructor(t){super(),this.highlightName=t,this.channel=0}}class o extends n{constructor(){super(...arguments),this.channel=1}}},33524(t,e,i){i.d(e,{Yf:()=>a,mt:()=>h,z5:()=>c});var r=i(91829),n=i(49255),s=i(90644);const o=(0,s.p3)(1,0,1,771);function a(t,e=!1,i=!1){if(i)return s.uR;switch(t){case 0:return e?s.RC:s.T8;case 1:return o;default:return null}}function c(t){if(t.draped)return null;switch(t.output){case 0:case 2:default:return t.writeDepth?s.Uy:null;case 1:return null}}function h(t,e=513){return{func:(0,n._$)(t)?515:e}}(0,r._Y)()},56133(t,e,i){var r=i(90644);const n=(0,r.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:0}),s=(0,r.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:7681}),o=(0,r.nk)(2,2,{compare:514,fail:7680,zFail:7680,zPass:7680}),a=(0,r.nk)(2,2,{compare:517,fail:7680,zFail:7680,zPass:7680});i.d(e,["Ax",0,s,"Q0",0,a,"cP",0,n,"iB",0,o,"m",0,{func:513},"r8",0,{mask:0},"sf",0,{func:519},"v0",0,{mask:255}])},58964(t,e,i){i.d(e,{Vh:()=>u,jP:()=>d,q6:()=>f});var r=i(90629),n=i(35522),s=i(51850),o=i(19419),a=i(11964),c=i(27921),h=i(48295);function l(t,e){return t.isRectangle?(0,o.Uc)(t.bounds,e):m(e,t.points)}function u(t,e,i,r){const n=Math.min(e[0],i[0],r[0]),s=Math.min(e[1],i[1],r[1]),a=Math.max(e[0],i[0],r[0]),c=Math.max(e[1],i[1],r[1]);if(!function(t,e){if(!(0,o.HY)(t.bounds,e))return!1;if(t.isRectangle)return!0;for(const i of t.points)if((0,o.Uc)(e,i))return!0;for(let i=0;i<4;i++)if(m(b(T,e,i),t.points))return!0;for(let i=0;i<t.points.length;i++){const r=t.points[i],n=i===t.points.length-1?t.points[0]:t.points[i+1];for(let t=0;t<4;t++)if(g(r,n,b(T,e,t),b(M,e,(t+1)%4)))return!0}return!1}(t,(0,o.fA)(n,s,a,c,w)))return!1;if(l(t,e)||l(t,i)||l(t,r))return!0;for(const n of t.points)if((0,h.cq)(e,i,r,n,D))return!0;for(let n=0;n<t.points.length;n++){const s=t.points[n],o=t.points[(n+1)%t.points.length];if(g(e,i,s,o)||g(i,r,s,o)||g(r,e,s,o))return!0}return!1}function d(t,e,i,r){const n=Math.min(e[0],i[0])-r,s=Math.min(e[1],i[1])-r,a=Math.max(e[0],i[0])+r,c=Math.max(e[1],i[1])+r;if(!(0,o.HY)(t.bounds,(0,o.fA)(n,s,a,c,w)))return!1;if(l(t,e)||l(t,i))return!0;const h=r*r;for(const r of t.points)if(v(r,e,i)<=h)return!0;for(let r=0;r<t.points.length;r++){const n=t.points[r],s=t.points[(r+1)%t.points.length];if(g(e,i,n,s)||_(e,i,n,s)<=h)return!0}return!1}function f(t,e,i,r,s){(0,n.C)(C,e),(0,n.C)(E,i);const o=t.projectToRenderScreen(C,A),h=t.projectToRenderScreen(E,S);if(null==o||null==h)return!1;const l=p(t,C),u=p(t,E);if(l&&u)return!1;if(l!==u){const e=l?C:E,i=l?o:h;if(!function(t,e,i){return function(t,e,i,r){return(0,c.T7)(t.frustum[4],(0,a.Cr)(e,i,I),r)}(t,e,i,e)}(t,e,l?E:C))return!1;if(!t.projectToRenderScreen(e,i))return!1}return r[0]=o[0],r[1]=o[1],r[2]=0,s[0]=h[0],s[1]=h[1],s[2]=0,!0}function p(t,e){return function(t,e){return(0,c.mN)(t.frustum[4],e)}(t,e)>0}function m(t,e){let i=!1;for(let r=0,n=e.length-1;r<e.length;n=r++){const s=e[r],o=e[n];if(s[1]>t[1]==o[1]>t[1])continue;const a=(o[0]-s[0])*(t[1]-s[1])/(o[1]-s[1])+s[0];t[0]<a&&(i=!i)}return i}function g(t,e,i,r){const n=y(t,e,i),s=y(t,e,r),o=y(i,r,t),a=y(i,r,e);return n!==s&&o!==a||0===n&&x(t,e,i)||0===s&&x(t,e,r)||0===o&&x(i,r,t)||0===a&&x(i,r,e)}function _(t,e,i,r){return g(t,e,i,r)?0:Math.min(v(t,i,r),v(e,i,r),v(i,t,e),v(r,t,e))}function v(t,e,i){return(0,a.kb)((0,a.Cr)((0,n.hZ)(C,e[0],e[1],0),(0,n.hZ)(E,i[0],i[1],0),I),(0,n.hZ)(R,t[0],t[1],0))}function y(t,e,i){const r=(e[1]-t[1])*(i[0]-e[0])-(e[0]-t[0])*(i[1]-e[1]);return Math.abs(r)<=D?0:Math.sign(r)}function x(t,e,i){return i[0]>=Math.min(t[0],e[0])-D&&i[0]<=Math.max(t[0],e[0])+D&&i[1]>=Math.min(t[1],e[1])-D&&i[1]<=Math.max(t[1],e[1])+D}function b(t,e,i){return t[0]=0===i||3===i?e[0]:e[2],t[1]=i<2?e[1]:e[3],t}const w=(0,o.vt)(),T=(0,r.gs)(),M=(0,r.gs)(),A=(0,r.r_)(),S=(0,r.r_)(),C=(0,s.vt)(),E=(0,s.vt)(),R=(0,s.vt)(),I=(0,a.vt)(),D=1e-9},75956(t,e,i){i.d(e,{IV:()=>d,MJ:()=>p,Uq:()=>f});var r=i(15142),n=i(90629),s=i(35522),o=i(51850),a=i(70328),c=i(82919),h=i(27921),l=i(48295),u=i(58964);class d{constructor(t){this.primitiveIndex=t}}class f{constructor(t){this.type=t,this.distance=Number.POSITIVE_INFINITY,this.primitiveIndex=0,this.hasNormal=!1,this.point=(0,o.vt)(),this.normal=(0,o.vt)()}reset(){this.distance=Number.POSITIVE_INFINITY,this.hasNormal=!1}update(t,e,i,r){this.distance=t,this.primitiveIndex=e,(0,s.C)(this.point,i),this.hasNormal=null!=r,null!=r&&(0,s.C)(this.normal,r)}updateIfCloserFromValues(t,e,i,r){t<this.distance&&this.update(t,e,i,r)}updateIfCloser(t){const{distance:e,primitiveIndex:i,point:r,normal:n}=t;this.updateIfCloserFromValues(e,i,r,t.hasNormal?n:null)}get valid(){return Number.isFinite(this.distance)}}function p(t,e,i,r,n){if(!t.visible||0!==t.type)return null;const s=new f(4);let o;o=t.boundingInfo?g(t.readPrimitivePosition,t.boundingInfo,e,i,r,n):m(e,i,r,0,t.faceCount,t.readPrimitivePosition,n,null,0);for(const t of o)s.updateIfCloser(t);return s.valid?s:null}function*m(t,e,i,r,n,o,a,c=null,u=0){if(null==t.camera)return;const{camera:d,screenPolygonPrimitiveProcessor:f}=t;for(let t=r;t<n;++t){const r=(c?.[t]??t)+u,n=null==c?r:t,p=3*r;_(b[0],o,p+0,a,n,e),_(b[1],o,p+1,a,n,e),_(b[2],o,p+2,a,n,e);const m=A;let g;C.reset();const x=w;for(const t of f.processTriangle(b))if(x.length=0,(0,h.H)(d.frustum[4],t,()=>x.pushNew(),!1),!(x.length<3)){for(let t=0;t<x.length;t++)d.projectToScreen(x.at(t),T[t]);v(i,T,x.length)&&(y(d.eye,x,M),null==g&&(g=(0,l.rb)(A,b[0],b[1],b[2])),C.updateIfCloserFromValues((0,s.Io)(d.eye,M),r,M,g?m:null))}C.valid&&(yield C)}}function*g(t,e,i,r,n,s){let o;if(null!=s?((0,a.C)(x,e.box),s.applyToAabb(x),o=(0,c.GH)(n.broadPhaseFrustum,x,r)):o=(0,c.GH)(n.broadPhaseFrustum,e.box,r),!o)return;const{primitiveIndices:h}=e,l=h.length;if(l>1e3){const o=e.children;if(void 0!==o){for(const e of o)yield*g(t,e,i,r,n,s);return}}yield*m(i,r,n,0,l,t,s,h,0)}function _(t,e,i,r,n,o){const[a,c,h]=e(t,i);null!=r?r.applyToVertex(t,a,c,h,n):(0,s.hZ)(t,a,c,h),o&&(0,s.Z0)(t,t,o)}function v(t,e,i){for(let r=1;r<i-1;r++)if((0,u.Vh)(t,e[0],e[r],e[r+1]))return!0;return!1}function y(t,e,i){let r=Number.POSITIVE_INFINITY;const n=e.at(0);for(let o=1;o<e.length-1;o++){(0,l.k3)(S,t,n,e.at(o),e.at(o+1));const a=(0,s.hG)(t,S);a<r&&(r=a,(0,s.C)(i,S))}}const x=(0,a.vt)(),b=[(0,o.vt)(),(0,o.vt)(),(0,o.vt)()],w=new r.A({allocator:t=>t??(0,o.vt)()}),T=Array.from({length:12},()=>(0,n.gs)()),M=(0,o.vt)(),A=(0,o.vt)(),S=(0,o.vt)(),C=new f(4)},77194(t,e,i){i.d(e,{PS:()=>n}),i(44208);var r=i(34727);class n{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(t,e,i,r){i?(this._scale=Math.min(i.divisor/(e-i.offset),1),this._angleFactor=function(t){return Math.abs(t)**3}(t),this._minScale=null!=r?Math.min(i.minPixelSize/r,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(t){const{_scale:e,_angleFactor:i,_minScale:n}=this;return t*(0,r.qE)((0,r.Cc)(e,1,i),n,1)}applyVec2(t,e){t[0]=this.apply(e[0]),t[1]=this.apply(e[1])}}},78988(t,e,i){i.d(e,{Mv:()=>n,vM:()=>s});var r=i(49186);function n(t,e){return e=16*Math.floor(e/16),Math.min(16*Math.round(t/16),e)}function s(t,e){const[i,r]=o(t,e);return t.width===i&&t.height===r?t:a(t,i,r)}function o({width:t,height:e},{maxPreferredTexturePixels:i,maxTextureSize:r}){const s=Math.max(t,e),o=t*e;if(s<=r&&o<=i)return[t,e];const a=Math.min(Math.sqrt(i/o),r/s);return[n(Math.round(t*a),r),n(Math.round(e*a),r)]}function a(t,e,i){if(t instanceof ImageData)return a(function(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");if(null==i)throw new r.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return i.putImageData(t,0,0),e}(t),e,i);const n=document.createElement("canvas");return n.width=e,n.height=i,n.getContext("2d").drawImage(t,0,0,n.width,n.height),n}},16396(t,e,i){i.d(e,{ou:()=>c}),i(77690),i(29242),i(58083),i(9093);var r=i(35522),n=i(51850),s=i(94008),o=i(57005);const a=new class{constructor(t=0){this.offset=t,this._tmpSphere=new s.iy}applyToVertex(t,e,i,n){const s=this.objectTransform.transform,o=(0,r.hZ)(h,e,i,n),a=(0,r.Z0)(o,o,s),c=this.offset/(0,r.Bw)(a);(0,r.Ln)(a,a,a,c);const l=this.objectTransform.inverse;return(0,r.Z0)(t,a,l),t}applyToMinMax(t,e){const i=this.offset/(0,r.Bw)(t);(0,r.Ln)(t,t,t,i);const n=this.offset/(0,r.Bw)(e);(0,r.Ln)(e,e,e,n)}applyToAabb(t){const e=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*e,t[1]+=t[1]*e,t[2]+=t[2]*e;const i=this.offset/Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]);return t[3]+=t[3]*i,t[4]+=t[4]*i,t[5]+=t[5]*i,t}applyToBoundingSphere(t){const e=t.center,i=(0,r.Bw)(e),n=this.offset/i;return(0,r.Ln)(this._tmpSphere.center,e,e,n),this._tmpSphere.radius=t.radius+t.radius*this.offset/i,this._tmpSphere}};function c(t){return null!=t?(a.offset=t,a):null}new class{constructor(t=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpMbs=new s.iy,this._tmpObb=new o.ab,this._resetOffset(t)}_resetOffset(t){this._offset=t,this._totalOffset=t}set offset(t){this._resetOffset(t)}get offset(){return this._offset}set componentOffset(t){this._totalOffset=this._offset+t}set localOrigin(t){this.componentLocalOriginLength=(0,r.Bw)(t)}applyToVertex(t,e,i,n){const s=(0,r.hZ)(h,e,i,n),o=(0,r.hZ)(l,e,i,n+this.componentLocalOriginLength),a=this._totalOffset/(0,r.Bw)(o);return(0,r.Ln)(t,s,o,a),t}applyToAabb(t){const e=this.componentLocalOriginLength,i=t[0],r=t[1],n=t[2]+e,s=t[3],o=t[4],a=t[5]+e,c=Math.abs(i),h=Math.abs(r),l=Math.abs(n),u=Math.abs(s),d=Math.abs(o),f=Math.abs(a),p=.5*(1+Math.sign(i*s))*Math.min(c,u),m=.5*(1+Math.sign(r*o))*Math.min(h,d),g=.5*(1+Math.sign(n*a))*Math.min(l,f),_=Math.sqrt(p*p+m*m+g*g),v=Math.sign(c+i),y=Math.sign(h+r),x=Math.sign(l+n),b=Math.sign(u+s),w=Math.sign(d+o),T=Math.sign(f+a),M=this._totalOffset;if(_<M)return t[0]-=(1-v)*M,t[1]-=(1-y)*M,t[2]-=(1-x)*M,t[3]+=b*M,t[4]+=w*M,t[5]+=T*M,t;const A=Math.max(c,u),S=Math.max(h,d),C=Math.max(l,f),E=M/Math.sqrt(A*A+S*S+C*C),R=M/_,I=R-E,D=-I;return t[0]+=i*(v*D+R),t[1]+=r*(y*D+R),t[2]+=n*(x*D+R),t[3]+=s*(b*I+E),t[4]+=o*(w*I+E),t[5]+=a*(T*I+E),t}applyToMbs(t){const e=t.center,i=(0,r.Bw)(e),n=this._totalOffset/i;return(0,r.Ln)(this._tmpMbs.center,e,e,n),this._tmpMbs.radius=t.radius+t.radius*this._totalOffset/i,this._tmpMbs}applyToObb(t){return(0,o.gm)(t,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(t=0){this.offset=t,this._tmpVertex=(0,n.vt)()}applyToVertex(t,e,i,n){const s=(0,r.hZ)(h,e,i,n),o=(0,r.WQ)(l,s,this.localOrigin),a=this.offset/(0,r.Bw)(o);return(0,r.Ln)(t,s,o,a),t}applyToAabb(t){const e=u,i=d,r=f;for(let n=0;n<3;++n)e[n]=t[0+n]+this.localOrigin[n],i[n]=t[3+n]+this.localOrigin[n],r[n]=e[n];const n=this.applyToVertex(this._tmpVertex,e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=n[e],t[e+3]=n[e];const s=e=>{const i=this.applyToVertex(this._tmpVertex,e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=Math.min(t[e],i[e]),t[e+3]=Math.max(t[e+3],i[e])};for(let t=1;t<8;++t){for(let n=0;n<3;++n)r[n]=t&1<<n?i[n]:e[n];s(r)}let o=0;for(let t=0;t<3;++t)e[t]*i[t]<0&&(o|=1<<t);if(0!==o&&7!==o)for(let t=0;t<8;++t)if(0===(o&t)){for(let n=0;n<3;++n)r[n]=o&1<<n?0:t&1<<n?e[n]:i[n];s(r)}for(let e=0;e<3;++e)t[e]-=this.localOrigin[e],t[e+3]-=this.localOrigin[e];return t}};const h=(0,n.vt)(),l=(0,n.vt)(),u=(0,n.vt)(),d=(0,n.vt)(),f=(0,n.vt)()},75497(t,e,i){i.d(e,{$p:()=>s,Qx:()=>o,e_:()=>a});var r=i(51850),n=i(37957);class s{constructor(t=(0,r.Ul)()){this.intensity=t}}class o{constructor(t=(0,r.Ul)(),e=(0,r.fA)(.57735,.57735,.57735),i=!0,n=1,s=1){this.intensity=t,this.direction=e,this.castShadows=i,this.specularStrength=n,this.environmentStrength=s}}class a{constructor(){this.r=n.P.create(),this.g=n.P.create(),this.b=n.P.create()}clear(){this.r.fill(0),this.g.fill(0),this.b.fill(0)}}},57226(t,e,i){i.d(e,{T:()=>y});var r=i(34727),n=i(35522),s=i(51850),o=i(75497);function a(t,e,i){i.length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e;return i}function c(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]+e[r];return i}var h=i(37957);const l=.28209479177;function u(t,e){(0,n.ze)(m,t.direction),function(t,e){const i=t[0],r=t[1],n=t[2],s=e||h.P.create();s[0]=l,s[1]=.4886025119*i,s[2]=.4886025119*n,s[3]=.4886025119*r,s[4]=1.09254843059*i*r,s[5]=1.09254843059*r*n,s[6]=.31539156525*(3*n*n-1),s[7]=1.09254843059*i*n,s[8]=.54627421529*(i*i-r*r)}(m,f),function(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e[r]}(f,g),a(f,t.intensity[0],p),c(e.r,p),a(f,t.intensity[1],p),c(e.g,p),a(f,t.intensity[2],p),c(e.b,p)}function d(t,e){e.r[0]+=l*g[0]*t.intensity[0]*4*Math.PI,e.g[0]+=l*g[0]*t.intensity[1]*4*Math.PI,e.b[0]+=l*g[0]*t.intensity[2]*4*Math.PI}const f=h.P.create(),p=h.P.create(),m=(0,s.vt)(),g=[3.141593,2.094395,2.094395,2.094395,.785398,.785398,.785398,.785398,.785398];class _{constructor(){this.color=(0,s.vt)(),this.intensity=1}}class v{constructor(){this.direction=(0,s.vt)(),this.ambient=new _,this.diffuse=new _}}class y{constructor(){this._legacy=new v,this.globalFactor=.5,this.noonFactor=.5,this._sphericalHarmonics=new o.e_,this._mainLight=new o.Qx((0,s.vt)(),(0,s.fA)(1,0,0),!1)}get legacy(){return this._legacy}get sh(){return this._sphericalHarmonics}get mainLight(){return this._mainLight}set(t){(function(t,e,i){var r;i.clear(),(0,n.hZ)(e.intensity,0,0,0),r=t,Array.isArray(r)?Array.isArray(t)&&((0,n.C)(e.direction,t[0].direction),(0,n.C)(e.intensity,t[0].intensity),e.specularStrength=t[0].specularStrength,e.environmentStrength=t[0].environmentStrength,e.castShadows=t[0].castShadows,u(t[2],i),d(t[1],i)):d(t,i)})(t,this._mainLight,this._sphericalHarmonics),this.updateLegacy()}updateLegacy(){(0,n.C)(this._legacy.direction,this._mainLight.direction);const t=1/Math.PI;this._legacy.ambient.color[0]=.282095*this._sphericalHarmonics.r[0]*t,this._legacy.ambient.color[1]=.282095*this._sphericalHarmonics.g[0]*t,this._legacy.ambient.color[2]=.282095*this._sphericalHarmonics.b[0]*t,(0,n.hs)(this._legacy.diffuse.color,this._mainLight.intensity,t),(0,n.C)(x,this._legacy.diffuse.color),(0,n.hs)(x,x,.4*this.globalFactor),(0,n.WQ)(this._legacy.ambient.color,this._legacy.ambient.color,x)}copyFrom(t){h.P.copy(this._sphericalHarmonics.r,t.sh.r),h.P.copy(this._sphericalHarmonics.g,t.sh.g),h.P.copy(this._sphericalHarmonics.b,t.sh.b),(0,n.C)(this._mainLight.direction,t.mainLight.direction),(0,n.C)(this._mainLight.intensity,t.mainLight.intensity),this._mainLight.castShadows=t.mainLight.castShadows,this._mainLight.specularStrength=t.mainLight.specularStrength,this._mainLight.environmentStrength=t.mainLight.environmentStrength,this.globalFactor=t.globalFactor,this.noonFactor=t.noonFactor}lerpLighting(t,e,i){if((0,n.Cc)(this._mainLight.intensity,t.mainLight.intensity,e.mainLight.intensity,i),this._mainLight.environmentStrength=(0,r.Cc)(t.mainLight.environmentStrength,e.mainLight.environmentStrength,i),this._mainLight.specularStrength=(0,r.Cc)(t.mainLight.specularStrength,e.mainLight.specularStrength,i),(0,n.C)(this._mainLight.direction,e.mainLight.direction),this._mainLight.castShadows=e.mainLight.castShadows,this.globalFactor=(0,r.Cc)(t.globalFactor,e.globalFactor,i),this.noonFactor=(0,r.Cc)(t.noonFactor,e.noonFactor,i),t.sh.r.length===e.sh.r.length)for(let n=0;n<e.sh.r.length;n++)this._sphericalHarmonics.r[n]=(0,r.Cc)(t.sh.r[n],e.sh.r[n],i),this._sphericalHarmonics.g[n]=(0,r.Cc)(t.sh.g[n],e.sh.g[n],i),this._sphericalHarmonics.b[n]=(0,r.Cc)(t.sh.b[n],e.sh.b[n],i);else for(let t=0;t<e.sh.r.length;t++)this._sphericalHarmonics.r[t]=e.sh.r[t],this._sphericalHarmonics.g[t]=e.sh.g[t],this._sphericalHarmonics.b[t]=e.sh.b[t];this.updateLegacy()}}const x=(0,s.vt)()},33442(t,e,i){i.d(e,{T:()=>u,s:()=>h});var r=i(49255);const n=l(-1),s=l(1),o=n,a=new Array;a[0]=null,a[1]=s,a[2]=n,a[3]=l(-2),a[4]=l(-3);const c=a.map(t=>function(t,e){return e?{factor:t.factor+e.factor,units:t.units+e.units}:t}(o,t));function h({output:t,enableOITOffset:e,polygonOffset:i}){return(0,r._$)(t)&&e?c[i]:a[i]}function l(t){return{factor:1*t,units:2*t}}function u(t){const e=h(t)??{factor:0,units:0};return{factor:e.factor+n.factor*t.polygonOffsetIndex,units:e.units+n.units*t.polygonOffsetIndex}}a[1]=s},47724(t,e,i){i.d(e,{L:()=>a});var r=i(5482),n=i(51976),s=i(34711);class o extends s.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,r.Cg)([(0,n.W)()],o.prototype,"hasHighlightMixTexture",void 0),(0,r.Cg)([(0,n.W)()],o.prototype,"emissionDimmingPass",void 0);class a extends o{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,r.Cg)([(0,n.W)({count:5})],a.prototype,"polygonOffset",void 0),(0,r.Cg)([(0,n.W)()],a.prototype,"transparent",void 0),(0,r.Cg)([(0,n.W)()],a.prototype,"enableOITOffset",void 0)},46606(t,e,i){i.d(e,{S:()=>a,p:()=>c}),i(34727),i(77690),i(29242),i(58083);var r=i(9093),n=(i(35522),i(51850)),s=(i(78955),i(91829),i(31756),i(26857),i(16943),i(65786));class o extends s.Y{constructor(t){super(),this.vvSize=t?.size??null,this.vvColor=t?.color??null,this.vvOpacity=t?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}(0,r.vt)(),(0,n.vt)(),(0,r.vt)();class a extends o{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}const c=8},43616(t,e,i){i.d(e,{MB:()=>c,kE:()=>o});var r=i(4576),n=i(34727),s=i(77194);function o(t,e,i,r,s,o){let a=i.screenLength*t.pixelRatio;null!=s&&(h.update(r,e,s,o),a=h.apply(a));const c=a*Math.tan(.5*t.fovY)/(.5*t.fullHeight);return(0,n.qE)(c*e,i.minWorldLength,i.maxWorldLength)}const a=(0,r.VO)();function c(t,e){let i=!1;for(const r in e){const n=e[r];void 0!==n&&(Array.isArray(n)?Array.isArray(t[r])&&a(n,t[r])||(t[r]=n.slice(),i=!0):t[r]!==n&&(i=!0,t[r]=n))}return i}const h=new s.PS;i.d(e,["Um",0,{multiply:1,ignore:2,replace:3,tint:4}])},59907(t,e,i){i.d(e,{vJ:()=>l,vx:()=>h}),i(35522);var r=i(51850),n=i(58083),s=i(13030),o=i(620);function a(t,e,i){const{data:r,indices:n}=t,s=e.typedBuffer,o=e.typedBufferStride,a=n.length;i*=o;for(let t=0;t<a;++t){const e=2*n[t];s[i]=r[e],s[i+1]=r[e+1],i+=o}}function c(t,e,i,r=1){const{data:n,indices:s}=t,o=e.typedBuffer,a=e.typedBufferStride,c=s.length;if(i*=a,1===r)for(let t=0;t<c;++t){const e=3*s[t];o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],i+=a}else for(let t=0;t<c;++t){const e=3*s[t];for(let t=0;t<r;++t)o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],i+=a}}function h(t,e,i,r,n=1){const s=e.typedBuffer,o=e.typedBufferStride;if(r*=o,1===n)for(let e=0;e<i;++e)s[r]=t[0],s[r+1]=t[1],s[r+2]=t[2],s[r+3]=t[3],r+=o;else for(let e=0;e<i;++e)for(let e=0;e<n;++e)s[r]=t[0],s[r+1]=t[1],s[r+2]=t[2],s[r+3]=t[3],r+=o}function l(t,e,i,r,n,o){const{buffer:a,offset:c}=o;for(const o of i.fields.keys()){const i=t.get(o),l=i?.indices;if(i&&l)u(o,i,r,n,a,c);else if("olidColor"===o&&null!=e){const i=t.get("position")?.indices;if(i){const t=i.length;h(e,a.getField(o,s.XP),t,c)}}}}function u(t,e,i,r,h,l){switch(t){case"position":{(0,o.vA)(3===e.size);const r=h.getField(t,s.xs);(0,o.vA)(!!r,`No buffer view for ${t}`),function(t,e,i,r,s=1){if(!e)return void c(t,i,r,s);const{data:o,indices:a}=t,h=i.typedBuffer,l=i.typedBufferStride,u=a.length,d=e[0],f=e[1],p=e[2],m=e[4],g=e[5],_=e[6],v=e[8],y=e[9],x=e[10],b=e[12],w=e[13],T=e[14];r*=l;let M=0,A=0,S=0;const C=(0,n.tZ)(e)?t=>{M=o[t]+b,A=o[t+1]+w,S=o[t+2]+T}:t=>{const e=o[t],i=o[t+1],r=o[t+2];M=d*e+m*i+v*r+b,A=f*e+g*i+y*r+w,S=p*e+_*i+x*r+T};if(1===s)for(let t=0;t<u;++t)C(3*a[t]),h[r]=M,h[r+1]=A,h[r+2]=S,r+=l;else for(let t=0;t<u;++t){C(3*a[t]);for(let t=0;t<s;++t)h[r]=M,h[r+1]=A,h[r+2]=S,r+=l}}(e,i,r,l);break}case"normal":{(0,o.vA)(3===e.size);const i=h.getField(t,s.xs);(0,o.vA)(!!i,`No buffer view for ${t}`),function(t,e,i,r,s=1){if(!e)return void c(t,i,r,s);const{data:o,indices:a}=t,h=e,l=i.typedBuffer,u=i.typedBufferStride,d=a.length,f=h[0],p=h[1],m=h[2],g=h[4],_=h[5],v=h[6],y=h[8],x=h[9],b=h[10],w=!(0,n.ut)(h),T=1e-6,M=1-T;r*=u;let A=0,S=0,C=0;const E=(0,n.tZ)(h)?t=>{A=o[t],S=o[t+1],C=o[t+2]}:t=>{const e=o[t],i=o[t+1],r=o[t+2];A=f*e+g*i+y*r,S=p*e+_*i+x*r,C=m*e+v*i+b*r};if(1===s)if(w)for(let t=0;t<d;++t){E(3*a[t]);const e=A*A+S*S+C*C;if(e<M&&e>T){const t=1/Math.sqrt(e);l[r]=A*t,l[r+1]=S*t,l[r+2]=C*t}else l[r]=A,l[r+1]=S,l[r+2]=C;r+=u}else for(let t=0;t<d;++t)E(3*a[t]),l[r]=A,l[r+1]=S,l[r+2]=C,r+=u;else for(let t=0;t<d;++t){if(E(3*a[t]),w){const t=A*A+S*S+C*C;if(t<M&&t>T){const e=1/Math.sqrt(t);A*=e,S*=e,C*=e}}for(let t=0;t<s;++t)l[r]=A,l[r+1]=S,l[r+2]=C,r+=u}}(e,r,i,l);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,o.vA)(2===e.size);const i=h.getField(t,s.mJ);(0,o.vA)(!!i,`No buffer view for ${t}`),a(e,i,l);break}case"uv0":{(0,o.vA)(2===e.size);const i=h.getField(t,s.ZD)??h.getField(t,s.gH);(0,o.vA)(!!i,`No buffer view for ${t}`),a(e,i,l);break}case"uvi":{(0,o.vA)(2===e.size);const i=h.getField(t,s.mJ);(0,o.vA)(!!i,`No buffer view for ${t}`),a(e,i,l);break}case"color":case"symbolColor":{const i=h.getField(t,s.XP);(0,o.vA)(!!i,`No buffer view for ${t}`),(0,o.vA)(3===e.size||4===e.size),function(t,e,i,r,n=1){const{data:s,indices:o}=t,a=i.typedBuffer,c=i.typedBufferStride,h=o.length;if(r*=c,e===s.length&&4===e){a[r]=s[0],a[r+1]=s[1],a[r+2]=s[2],a[r+3]=s[3];const t=new Uint32Array(i.typedBuffer.buffer,i.start),e=c/4,o=t[r/=4];r+=e;const l=h*n;for(let i=1;i<l;++i)t[r]=o,r+=e;return}if(1!==n)if(4!==e)for(let t=0;t<h;++t){const e=3*o[t];for(let t=0;t<n;++t)a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=255,r+=c}else for(let t=0;t<h;++t){const e=4*o[t];for(let t=0;t<n;++t)a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=s[e+3],r+=c}else{if(4===e){for(let t=0;t<h;++t){const e=4*o[t];a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=s[e+3],r+=c}return}for(let t=0;t<h;++t){const e=3*o[t];a[r]=s[e],a[r+1]=s[e+1],a[r+2]=s[e+2],a[r+3]=255,r+=c}}}(e,e.size,i,l);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const i=h.getField(t,s.Y$)??h.getField(t,s.Y$);(0,o.vA)(!!i,`No buffer view for ${t}`),(0,o.vA)(1===e.size),function(t,e,i){const{data:r,indices:n}=t,s=e.typedBuffer,o=e.typedBufferStride,a=n.length,c=r[0];i*=o;for(let t=0;t<a;++t)s[i]=c,i+=o}(e,i,l);break}case"tangent":{(0,o.vA)(4===e.size);const r=h.getField(t,s.Eq);(0,o.vA)(!!r,`No buffer view for ${t}`),function(t,e,i,r,s=1){if(!e)return void function(t,e,i,r=1){const{data:n,indices:s}=t,o=e.typedBuffer,a=e.typedBufferStride,c=s.length;if(i*=a,1===r)for(let t=0;t<c;++t){const e=4*s[t];o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],o[i+3]=n[e+3],i+=a}else for(let t=0;t<c;++t){const e=4*s[t];for(let t=0;t<r;++t)o[i]=n[e],o[i+1]=n[e+1],o[i+2]=n[e+2],o[i+3]=n[e+3],i+=a}}(t,i,r,s);const{data:o,indices:a}=t,c=e,h=i.typedBuffer,l=i.typedBufferStride,u=a.length,d=c[0],f=c[1],p=c[2],m=c[4],g=c[5],_=c[6],v=c[8],y=c[9],x=c[10],b=!(0,n.ut)(c),w=1e-6,T=1-w;if(r*=l,1===s)for(let t=0;t<u;++t){const e=4*a[t],i=o[e],n=o[e+1],s=o[e+2],c=o[e+3];let u=d*i+m*n+v*s,M=f*i+g*n+y*s,A=p*i+_*n+x*s;if(b){const t=u*u+M*M+A*A;if(t<T&&t>w){const e=1/Math.sqrt(t);u*=e,M*=e,A*=e}}h[r]=u,h[r+1]=M,h[r+2]=A,h[r+3]=c,r+=l}else for(let t=0;t<u;++t){const e=4*a[t],i=o[e],n=o[e+1],c=o[e+2],u=o[e+3];let M=d*i+m*n+v*c,A=f*i+g*n+y*c,S=p*i+_*n+x*c;if(b){const t=M*M+A*A+S*S;if(t<T&&t>w){const e=1/Math.sqrt(t);M*=e,A*=e,S*=e}}for(let t=0;t<s;++t)h[r]=M,h[r+1]=A,h[r+2]=S,h[r+3]=u,r+=l}}(e,i,r,l);break}}}(0,r.vt)()},47630(t,e,i){i.d(e,{D:()=>d});var r=i(49255),n=i(47187),s=i(3871),o=i(63365);function a(t){t.code.add("\n vec3 emissionFilter(in vec3 srcColor, float srcAlpha) {\n vec3 color = min(srcColor + vec3(1.0 - srcAlpha), 1.0);\n float m = max(color.r, max(color.g, color.b));\n return m > 0.0 ? color / m : vec3(1.0);\n }\n ")}var c=i(31821),h=i(26934),l=i(58243),u=i(72458);function d(t,e){t.include(s.Q,e),t.include(n.zp,e);const{fragment:i,outputs:d}=t;i.include(o.a);const{output:f,hasEmission:p,oitPremultipliedAlpha:m,snowCover:g,emissionDimmingPass:_,renderOccluded:v}=e,y=11===f,x=(0,r._$)(f),b=(0,r.Rb)(f),w=(0,r._o)(f)&&!x,T=0!==f||v;let M=0;(w||x)&&d.add("fragColor","vec4",M++),x&&d.add("fragAlpha","float",M++),p&&d.add("fragEmission","vec4",M++),i.include(o.a),i.include(h.Q),i.include(u.O,e),i.include(l.t,e),_&&i.include(a),i.code.add(c.H`
|
|
245
245
|
void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${(0,c.If)(g,", float snow")}) {
|
|
246
246
|
${(0,c.If)(y,"finalColor.a = 1.0;")}
|
|
247
247
|
${(0,c.If)(T,"if (finalColor.a < alphaCutoff) discard;")}
|
|
@@ -253,4 +253,4 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
|
|
|
253
253
|
calculateOcclusionAndOutputHighlight();
|
|
254
254
|
${(0,c.If)(y,"outputObjectAndLayerIdColor();")}
|
|
255
255
|
}
|
|
256
|
-
`)}},26934(t,e,i){i.d(e,{Q:()=>n});var r=i(49788);function n(t){t.constants.add("alphaCutoff","float",r.Q),t.constants.add("opacityCutoff","float",r.v)}},58243(t,e,i){function r(t,e){e.useFloatBlend?t.code.add("float ditherNoise(vec4 color) { return 0.0; }"):t.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}i.d(e,{t:()=>r})},63666(t,e,i){i.d(e,{OG:()=>Ot,gP:()=>It});var r=i(5482),n=i(69540),s=i(91429);let o=class extends n.Pw{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return null!=t&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"row",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"column",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"rows",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"columns",void 0),o=(0,r.Cg)([(0,s.$K)("esri.CameraLayout")],o);const a=o;var c=i(69052),h=i(25482),l=i(34727),u=i(56507),d=i(86738),f=i(43937),p=i(36005);let m=class extends((0,n.OU)(h.o)){constructor(...t){super(...t),this.position=new d.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new a}normalizeCtorArgs(t,e,i,r){if(t&&"object"==typeof t&&("x"in t||Array.isArray(t))){const n={position:t};return null!=e&&(n.heading=e),null!=i&&(n.tilt=i),null!=r&&(n.fov=r),n}return t}writePosition(t,e,i,r){const n=t.clone();n.x=(0,u.GB)(t.x||0),n.y=(0,u.GB)(t.y||0),n.z=t.hasZ?(0,u.GB)(t.z||0):t.z,e[i]=n.write({},r)}readPosition(t,e){const i=new d.A;return i.read(t,e),i.x=(0,u.GB)(i.x||0),i.y=(0,u.GB)(i.y||0),i.z=i.hasZ?(0,u.GB)(i.z||0):i.z,i}equals(t){return null!=t&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};(0,r.Cg)([(0,s.MZ)({type:d.A,json:{write:{isRequired:!0}}})],m.prototype,"position",void 0),(0,r.Cg)([(0,f.K)("position")],m.prototype,"writePosition",null),(0,r.Cg)([(0,p.w)("position")],m.prototype,"readPosition",null),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>c.ie.normalize((0,u.GB)(t)))],m.prototype,"heading",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t),-180,180))],m.prototype,"tilt",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t,55),1,170))],m.prototype,"fov",void 0),(0,r.Cg)([(0,s.MZ)({type:a,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"layout",void 0),m=(0,r.Cg)([(0,s.$K)("esri.Camera")],m);var g=i(9093),_=i(35522),v=i(51850),y=i(16930),x=(i(48353),i(9762),i(65806)),b=i(27993),w=i(73941),T=(i(19419),i(82919)),M=i(71351);i(91712),i(49718),i(6867),i(16396),(0,v.vt)(),(0,v.vt)(),(0,v.vt)();var A=i(58083),S=i(48163),C=i(5443),E=i(39829),R=i(95108),I=i(37585);function D(t,e,i,r){const n=function(t,e){const i=0===e||2===e?0:1,r=t[e],n=0===e||1===e?1:-1,s=0===i?1:0;return(t,e,o)=>{if(e[i]<r&&o[i]<r)return 1===n?0:1;if(e[i]>r&&o[i]>r)return 1===n?1:0;const a=(o[s]-e[s])/(o[i]-e[i]),c=e[s]+a*(r-e[i]);return t[i]=r,t[s]=c,(e[i]<r?1:-1)*n>0?2:3}}(i,r);if(t.length=0,e.length){1===n(P,e[0],e[0])&&O(t,e[0]);for(let i=0;i<e.length;i++){const r=e[i===e.length-1?0:i+1];switch(n(P,e[i],r)){case 1:O(t,r);break;case 3:O(t,(0,S.o8)(P));break;case 2:O(t,(0,S.o8)(P)),O(t,r)}}}}function O(t,e){0!==t.length&&(0,I.aI)(t.at(-1),e)||t.push(e)}const P=(0,S.vt)();var F=i(11964),N=i(27921);const B=(0,v.vt)(),L=(0,v.vt)();function U(){return{direction:(0,v.vt)(),up:(0,v.vt)()}}function H(t,e,i,r,n){let s=(0,_.S8)(B,t),o=(0,_.Om)(s,r);const a=o>0;o=Math.abs(o),o>.99&&(o=Math.abs((0,_.Om)(e,r)),o<.99?((0,_.C)(s,e),a&&(0,_.hs)(s,s,-1)):s=null);let c=0;if(s){(0,_.hs)(L,r,(0,_.Om)(r,s)),(0,_.Re)(s,s,L);const t=(0,_.Om)(s,n)/((0,_.Bw)(s)*(0,_.Bw)(n));(0,_.$A)(L,s,n),c=((0,_.Om)(L,r)>0?1:-1)*(0,l.KJ)((0,l.XM)(t))}const h=(0,l.KJ)((0,l.XM)(-(0,_.Om)(r,t)/(0,_.Bw)(t)));return i?(i.heading=c,i.tilt=h,i):{heading:c,tilt:h}}function V(t,e,i,r){(0,_.Re)(z,i,e),(0,N.T7)(r,(0,F.LV)(e,z),t)||t===i||(0,_.C)(t,i)}const z=(0,v.vt)(),G=(0,v.fA)(0,1,0),k=(0,v.fA)(0,0,1),W=(0,g.vt)(),Z=(0,v.vt)(),$=(0,v.vt)();function j(t,e,i,r=U()){const{direction:n,up:s}=r;return(0,A.N9)(W,-(0,l.kU)(e)),(0,A.eL)(W,W,(0,l.kU)(i)),(0,_.Z0)(n,k,W),(0,_.hs)(n,n,-1),(0,_.Z0)(s,G,W),r}function q(t,e,i,r,n){const s=e.lines[11].direction,o=(n-i.getAltitude(r))/s[2];(0,_.Ln)(t,r,s,o)}const X=(0,v.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){return H(e,i,r,k,G)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n=j(0,i,r),s=(0,v.vt)();return(0,_.hs)(s,n.direction,-e),(0,_.WQ)(s,s,t),{up:n.up,eye:s,heading:i,tilt:r}},eyeTiltToLookAtTilt:function(t){return(0,l.kU)(t)},headingTiltToDirectionUp:j,lookAtTiltToEyeTilt:function(t){return(0,l.KJ)(t)},toArea:function(t,e){const i=t.frustum,{renderCoordsHelper:r}=t,n=r.getAltitude(e),s=t.spatialReference,o=t.state.camera.eye,a=[],c=i.planes[5];for(let t=0;t<4;t++){const e=i.lines[t];r.intersectInfiniteManifold((0,M.LV)(e.origin,e.direction),n,X)||q(X,i,r,e.endpoint,n),V(X,o,X,c),a.push((0,S.fA)(X[0],X[1]))}return function(t,e,i){const r=t.map(t=>((0,_.hZ)(X,t[0],t[1],0),e.fromRenderCoords(X,X,i),[X[0],X[1]]));return r.length<=2?new E.A({spatialReference:i}):(r.push(r[0].slice()),(0,R.$3)(r)||r.reverse(),new E.A({rings:[r],spatialReference:i}))}(function(t,e){const i=[],r=[];return D(i,t,e,0),D(r,i,e,1),D(i,r,e,2),D(r,i,e,3),r}(a,r.extent),r,s)},toExtent:function(t,e,i,r,n){const s=t.renderSpatialReference,o=t.spatialReference??e.spatialReference;return(0,x.g)(e,Z,s),(0,x.g)(e,$,s),Z[0]-=i/2,$[0]+=i/2,Z[1]-=r/2,$[1]+=r/2,(0,b.F)(Z,s,Z,o),(0,b.F)($,s,$,o),n?(n.xmin=Z[0],n.ymin=Z[1],n.xmax=$[0],n.ymax=$[1],n.spatialReference=o):n=new C.A(Z[0],Z[1],$[0],$[1],o),n}},Symbol.toStringTag,{value:"Module"}));var Q=i(78955),Y=i(91829),K=i(34304),J=i(17136),tt=i(94008),et=i(28735);class it{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(t){this.renderCoordsHelper=t,this.frustum=(0,T.vt)(),this._points=(0,T.Qy)(),this.lines=new Array(12),this._origin=(0,v.vt)(),this._direction=(0,v.vt)(),this._boundingSphere=new tt.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let t=0;t<12;t++)this.lines[t]={origin:null,direction:(0,v.vt)(),endpoint:null}}update(t){(0,T.ui)(t.viewMatrix,t.projectionMatrix,this.frustum,this._points),(0,_.C)(this._origin,t.eye),(0,_.C)(this._direction,t.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(t){for(let e=0;e<this._points.length;e++)(0,_.C)(this._points[e],t[e]);(0,T.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(t){return(0,T.m7)(this.frustum,t)}intersectsRay(t){return(0,T.pw)(this.frustum,t)}intersectsLineSegment(t,e){return(0,T.ST)(this.frustum,t,e)}intersectsPoint(t){return(0,T.bU)(this.frustum,t)}_updateLines(){const t=this._points;for(let e=0;e<4;e++){const i=e+4;rt(this.lines[e],t[e],t[i]),rt(this.lines[e+4],t[e],3===e?t[0]:t[e+1]),rt(this.lines[e+8],t[i],3===e?t[4]:t[i+1])}}_updateBoundingSphere(){const{origin:t}=this,e=st;(0,_.S8)(e,this.direction);const i=nt;(0,_.jb)(i,this.points[4],t);const r=.5*(0,_.Om)(i,i)/(0,_.Om)(e,i),n=this._boundingSphere,s=(0,_.Ln)(ot,t,e,r);n.center=s,n.radius=r}static{this.planePointIndices=T.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function rt(t,e,i){t.origin=e,t.endpoint=i,(0,_.oW)(t.direction,e,i)}const nt=(0,v.vt)(),st=(0,v.vt)(),ot=(0,v.vt)();i(86211);const at=(0,v.fA)(5802e-9,13558e-9,331e-7),ct=(0,v.fA)(65e-8*3,5643e-9,255e-9);(0,v.fA)(at[0]+ct[0],at[1]+ct[1],at[2]+ct[2]);class ht{constructor(t=1/0,e=-1/0){this.near=t,this.far=e}set(t,e){this.near=t,this.far=e}union(t){return null!=t&&(this.near=Math.min(this.near,t.near),this.far=Math.max(this.far,t.far)),this}within(t){return this.near<=t&&t<=this.far}equals(t){return this.near===t.near&&this.far===t.far}static{this.Zero=new ht(0,0)}static{this.Infinite=new ht}}(0,v.vt)(),(0,v.vt)(),new tt.iy,(0,M.vt)(),new C.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var lt=i(32728);const ut=(0,v.fA)(0,0,1),dt=(0,_.S8)((0,v.vt)(),(0,v.fA)(1,1,1)),ft=(0,g.vt)(),pt=(0,v.vt)(),mt=(0,v.vt)();function gt(t,e,i,r=U()){(0,_.$A)(pt,t,ut),0===(0,_.Om)(pt,pt)&&(0,_.$A)(pt,t,dt),(0,A.$0)(ft,-(0,l.kU)(e),t),(0,A.e$)(ft,ft,-(0,l.kU)(i),pt);const{up:n,direction:s}=r;return(0,_.$A)(n,pt,t),(0,_.S8)(n,n),(0,_.Z0)(n,n,ft),(0,_.S8)(s,t),(0,_.ze)(s,s),(0,_.Z0)(s,s,ft),r}function _t(t){const e=t[1];t[1]=-t[2],t[2]=e}function vt(t,e){const i=gt(e,t.heading,t.tilt);return t.up=i.up,t}function yt(t,e){const{renderCoordsHelper:i,state:r}=t;if(1!==r.viewingMode)return 1;const n=i.getAltitude(e),s=i.referenceEllipsoid.radius,o=1+(0,_.Io)(r.camera.eye,e)/(s+n),a=Math.sqrt(o*o-1),{minCurvature:c,maxCurvature:h,minSamples:u,maxSamples:d}=bt,f=(0,l.qE)((a-c)/(h-c),0,1);return Math.round((0,l.Cc)(u,d,f))}function xt(t,e){const i=[],r=[],n=(0,K.FD)();for(let s=0;s<t.length;s++){const o=t[s],a=s===t.length-1?t[0]:t[s+1],c=(0,F.Cr)(o,a,Et),h=(0,N.vE)(e,c.origin,c.vector,0,St);switch(h){case 2:i.push(o);break;case 3:r.push(o);break;case 0:case 1:{const[t,s,a]=0===h?[1,i,r]:[-1,r,i],c=(0,N.Qj)(e),l=(0,_.Ln)((0,v.vt)(),St,c,t*n),u=(0,_.Ln)((0,v.vt)(),St,c,t*-n);s.push(o),s.push(l),a.push(u)}}}const s=[];return i.length&&s.push(i),r.length&&s.push(r),s}const bt={minCurvature:(0,l.kU)(5),maxCurvature:(0,l.kU)(50),minSamples:1,maxSamples:6},wt=(0,v.fA)(1,0,0),Tt=(0,v.fA)(0,1,0),Mt=(0,v.vt)(),At=(0,v.vt)(),St=(0,v.vt)(),Ct=new tt.iy,Et=(0,F.vt)(),Rt=(0,Y.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){const n=pt,s=mt;return(0,_.S8)(n,t),(0,_.$A)(mt,n,ut),0===(0,_.Om)(mt,mt)&&(0,_.$A)(mt,n,dt),(0,_.$A)(s,mt,n),H(e,i,r,n,s)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n={eye:(0,v.vt)(),up:null,tilt:r,heading:i},s=pt;s[0]=t[0],s[1]=t[2],s[2]=-t[1];const o=e,a=(0,l.kU)(i),c=(0,l.kU)(r),h=Math.sin(a),u=Math.cos(a),d=Math.sin(c),f=Math.cos(c),p=(0,_.Bw)(s);let m;if(Math.abs(c)<1e-8)m=o+p;else{const t=p/d,e=(0,l.YN)(o/t),i=Math.PI-c-e;m=t*Math.sin(i)}const g=f*o,y=o*o*(d*d),x=u*u*y,b=m-g,w=b*b,T=x*(x+w-s[1]*s[1]);if(T<0)return(0,_.hs)(n.eye,s,m/p),n.tilt=0,vt(n,t);const M=Math.sqrt(T),A=s[1]*b,S=x+w;let C;if(C=u>0?-M+A:M+A,Math.abs(S)<1e-8)return p<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=o):(0,_.hs)(n.eye,s,m/p),n.tilt=0,_t(n.eye),vt(n,t);n.eye[1]=C/S;const E=h*h*y,R=d*o,I=u*R*n.eye[1],D=n.eye[1]*n.eye[1],O=1-D,P=Math.sqrt(O),F=x*D+E-2*I*P*b+O*w;return Math.abs(F)<1e-8?((0,_.hs)(n.eye,s,m/p),n.tilt=0,_t(n.eye),vt(n,t)):(n.eye[0]=(O*(m*s[0]-g*s[0])-R*P*(s[0]*n.eye[1]*u+s[2]*h))/F,n.eye[2]=(O*(m*s[2]-g*s[2])-R*P*(s[2]*n.eye[1]*u-s[0]*h))/F,(0,_.hs)(n.eye,n.eye,m),_t(n.eye),vt(n,t))},eyeTiltToLookAtTilt:function(t,e,i){const r=(0,l.kU)(t),n=(0,_.Bw)(e);return(0,l.YN)(i/(n/Math.sin(r)))+r},getCurvatureSamples:yt,headingTiltToDirectionUp:gt,lookAtTiltToEyeTilt:function(t,e,i){const r=(0,_.Bw)(e),n=Math.sqrt(i*i+r*r-2*i*r*Math.cos(Math.PI-t)),s=(0,l.YN)(i/(n/Math.sin(t)));return(0,l.KJ)(t-s)},toArea:function(t,e){const{renderCoordsHelper:i}=t,r=t.state.camera.clone(),n=new it(i);r.near=2,n.update(r);const s=i.getAltitude(e),o=t.spatialReference,a=r.eye,c=function(t){const{renderCoordsHelper:e,state:i}=t,r=Math.abs(e.getAltitude(i.camera.center));return Ct.radius=e.referenceEllipsoid.radius+r,i.camera.sphereFrustumCoverage(Ct,e)}(t),h=yt(t,e),u=r.aboveGround,d=n.planes[5],f=[],p=(0,N.O_)(v.uY,wt,(0,N.vt)()),m=(0,N.O_)(v.uY,Tt,(0,N.vt)());(0,Q.hZ)(Rt,0,0,0,0);const g=t=>{};for(let t=0;t<4;t++){const e=1===t&&!u||3===t&&u?1-c:0,r=1===t&&u||3===t&&!u?c:1,o=n.lines[t],y=n.lines[3===t?0:t+1];for(let n=0;n<h;n++){const c=n/h,u=0===n?0:(0,l.Cc)(e,r,1===t?1-(1-c)**2:3===t?c**2:c),x=(0,_.Cc)(At,o.origin,y.origin,u),b=(0,lt.nu)(o.direction,y.direction,u,Mt);i.intersectManifoldClosestSilhouette((0,M.LV)(x,b),s,St),V(St,a,St,d),f.push((0,v.o8)(St)),0!==f.length&&g((0,_.lo)(f.at(-1),St));const w=((0,N.Tj)(p,St)?1:0)|((0,N.Tj)(m,St)?2:0);Rt[w]=1}}f.length>2&&(0,_.lo)(f[0],f.at(-1));const y=function(t,e,i){const r=2*(0,K.FD)();return t.map(t=>{const n=[];let s=!1;for(const o of t)e.fromRenderCoords(o,St,i),Math.abs(o[0])<r&&Math.abs(o[1])<r?(n.push([null,St[1]]),n.push([null,St[1]]),s=!0):n.push([St[0],St[1]]);if(s)for(let t=0;t<n.length;t++){const e=n[t];if(null!=e[0])continue;const i=n[t+1],r=n.at(0===t?-1:t-1);e[0]=r[0],t++;const s=n.at(t===n.length-1?0:t+1);i[0]=s[0]}return n.push(n[0]),(0,R.$3)(n)||n.reverse(),n})}((0,Q.m3)(Rt)>1?function(t,e){const i=[];for(const r of t)i.push(...xt(r,e));return i}(xt(f,p),m):[f],i,o);return new E.A({rings:y,spatialReference:o})},toExtent:function(t,e,i,r,n){let s,o,a,h;const u=e.latitude,d=(0,w.tO)(t.spatialReference).radius,f=e.longitude,p=function(t,e,i){const r=e/i,n=(0,l.kU)(t),s=Math.sin(r/2),o=Math.cos(n),a=2*(0,l.YN)(Math.sqrt(s*s/(o*o)));return(0,l.KJ)(a)}(u,i,d)/2;s=f-p,o=f+p;const m=(0,l.kU)(u),g=(1+Math.sin(m))/(1-Math.sin(m)),_=(g+1)*Math.tan(r/d/2),v=_*_;function x(t){const e=Math.PI/2;return(t=c.uC.normalize(t,-e))>e&&(t=Math.PI-t),t}if(a=1.5*Math.PI-2*Math.atan(.5*(_+Math.sqrt(4*g+v))),h=a+r/d,a=x(a),h=x(h),h<a){const t=h;h=a,a=t}if(a=Math.max((0,l.KJ)(a),-90),h=Math.min((0,l.KJ)(h),90),o=J.Y_.monotonic(s,o),o-s>180){const t=(o-s-180)/2;s+=t,o-=t}const b=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:y.A.WGS84;return n?(n.xmin=s,n.ymin=a,n.xmax=o,n.ymax=h,n.spatialReference=b):n=new C.A(s,a,o,h,b),t.spatialReference&&t.spatialReference.isWebMercator&&(0,et.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const It={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},Dt=[It.FINAL,It.COMPOSITE,It.OPAQUE,It.TRANSPARENT],Ot={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",TRANSPARENT_NO_DEPTH:"transparent-no-depth",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",TRANSPARENT_ENVIRONMENT:"transparent-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOWMAP:"shadowmap",SHADOW_HIGHLIGHT:"shadow-highlight",VOXEL:"voxel",VIEWSHED:"viewshed",OBJECT_AND_LAYER_ID_COLOR:"olid"};Array.from(Object.values(Ot)).concat(Dt),(0,v.vt)()},91712(t,e,i){i.d(e,{A:()=>A});var r=i(5482),n=i(69622),s=i(53966),o=i(34727),a=i(90629),c=i(91429),h=i(58083),l=i(9093),u=i(37585),d=i(48163),f=i(35522),p=i(51850),m=i(78955),g=i(91829),_=i(82919),v=i(71351),y=i(44280);function x(t,e,i){t.worldUpAtPosition(e,b),(0,f.Re)(w,i,e);const r=(0,f.Bw)(w);return 0===r?0:(0,o.XM)((0,f.Om)(w,b)/r)}const b=(0,p.vt)(),w=(0,p.vt)();var T;let M=T=class extends n.A{constructor(t){super(t),this._ray=(0,v.vt)(),this._viewport=(0,g.fA)(0,0,1,1),this._padding=(0,g.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,d.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,l.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,l.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,l.vt)(),this._frustumDirty=!0,this._frustum=(0,_.vt)(),this._fullViewport=(0,g.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,p.vt)(),this._up=(0,p.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get rows(){return this._rows}set rows(t){this._rows=Math.max(1,t)}get columns(){return this._columns}set columns(t){this._columns=Math.max(1,t)}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin,"eye")}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return(0,f.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){(0,h.C)(this._viewMatrix,t),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get inverseViewMatrix(){return(0,h.Qw)((0,l.vt)(),this.viewMatrix)||this._get("inverseViewMatrix")||(0,l.vt)()}get viewForward(){return this._ensureViewClean(),(0,f.hZ)((0,p.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,f.hZ)((0,p.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,f.hZ)((0,p.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=(0,m.hs)((0,g.vt)(),this._viewport,1/this.pixelRatio),e=this._get("screenViewport");return e&&(0,m.aI)(t,e)?e:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=(0,m.hs)((0,g.vt)(),this._padding,1/this.pixelRatio),e=this._get("screenPadding");return e&&(0,m.aI)(t,e)?e:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[3],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[2],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(t){this.width=t-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(t){this.height=t-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){(0,m.t2)(this._padding,t)||(this._viewport[0]+=t[3]-this._padding[3],this._viewport[1]+=t[2]-this._padding[2],this._viewport[2]-=t[1]+t[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=t[0]+t[2]-(this._padding[0]+this._padding[2]),(0,m.C)(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,h.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,h.B8)((0,l.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,l.vt)()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(e*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovX(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/e)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(i*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovY(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/i)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,f.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,h.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,h.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const{near:e,far:i}=this;return 2*e*i/(i+e-t*(i-e))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const t=this.width,e=this.height,i=this.near*Math.tan(this.fovY/2)*2,r=i*this._aspect,n=i/this.rows,s=r/this.columns,o=-r/2+this.column*s,a=o+s,c=-i/2+this.row*n,u=c+n,d=(0,h.$h)((0,l.vt)(),o*(1+2*this._padding[3]/t),a*(1+2*this._padding[1]/t),c*(1+2*this._padding[2]/e),u*(1+2*this._padding[0]/e),this.near,this.far),f=this._get("projectionMatrix");return f&&(0,h.t2)(f,d)?f:d}copyFrom(t){(0,f.C)(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,(0,m.C)(this._viewport,t.viewport),this.notifyChange("_viewport"),(0,m.C)(this._padding,t.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.row=t.row,this.column=t.column,this.rows=t.rows,this.columns=t.columns,this.relativeElevation=t.relativeElevation;const e=t;return this._viewDirty=e._viewDirty,this._viewDirty||((0,h.C)(this._viewMatrix,t.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=e._frustumDirty,this._frustumDirty||((0,_.C)(this._frustum,t.frustum),this._frustumDirty=!1),e._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,h.C)(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,m.C)(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up,this.fov=t.fov}clone(){return(new T).copyFrom(this)}equals(t){return(0,f.t2)(this.eye,t.eye)&&(0,f.t2)(this.center,t.center)&&(0,f.t2)(this.up,t.up)&&(0,m.t2)(this._viewport,t.viewport)&&(0,m.t2)(this._padding,t.padding)&&(0,u.t2)(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation&&this.row===t.row&&this.column===t.column&&this.rows===t.rows&&this.columns===t.columns}equalsView(t){return(0,f.t2)(this.eye,t.eye)&&(0,f.t2)(this.center,t.center)&&(0,f.t2)(this.up,t.up)&&this._fov===t.fov}almostEquals(t){const e=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||(0,m.hG)(t.screenPadding,this.screenPadding)>=e||(0,m.hG)(this.screenViewport,t.screenViewport)>=e||this.row!==t.row||this.column!==t.column||this.rows!==t.rows||this.columns!==t.columns)return!1;(0,f.jb)(E,t.eye,t.center),(0,f.jb)(R,this.eye,this.center);const i=(0,f.Om)(E,R),r=(0,f.uE)(E),n=(0,f.uE)(R),s=5e-4;return i*i>=(1-1e-10)*r*n&&(0,f.lo)(t.eye,this.eye)<Math.max(r,n)*s*s}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs((0,y.gr)(this.viewForward,(0,f.Re)(E,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,e){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(e||1)))}getScreenCenter(t=(0,a.gs)()){return t[0]=(this.padding[3]+this.width/2)/this.pixelRatio,t[1]=(this.padding[0]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,e=.5,i=.5){return t[0]=this.padding[3]+this.width*e,t[1]=this.padding[2]+this.height*i,t[2]=.5,t}setGLViewport(t){const e=this.viewport,i=this.padding;t.setViewport(e[0]-i[3],e[1]-i[2],e[2]+i[1]+i[3],e[3]+i[0]+i[2])}applyProjection(t,e){t!==S&&(0,f.C)(S,t),S[3]=1,(0,m.Z0)(S,S,this.projectionMatrix);const i=Math.abs(S[3]);(0,f.hs)(S,S,1/i);const r=this.fullViewport;e[0]=(0,o.Cc)(0,r[0]+r[2],.5+.5*S[0]),e[1]=(0,o.Cc)(0,r[1]+r[3],.5+.5*S[1]),e[2]=.5*(S[2]+1),e[3]=i}unapplyProjection(t,e){const i=this.fullViewport;S[0]=(t[0]/(i[0]+i[2])*2-1)*t[3],S[1]=(t[1]/(i[1]+i[3])*2-1)*t[3],S[2]=(2*t[2]-1)*t[3],S[3]=t[3],null!=this.inverseProjectionMatrix&&((0,m.Z0)(S,S,this.inverseProjectionMatrix),e[0]=S[0],e[1]=S[1],e[2]=S[2])}projectToScreen(t,e){return null==this.projectToRenderScreen(t,I)?null:(this.renderToScreen(I,e),e)}projectToRenderScreen(t,e){if(S[0]=t[0],S[1]=t[1],S[2]=t[2],S[3]=1,(0,m.Z0)(S,S,this.viewProjectionMatrix),0===S[3])return null;const i=S;(0,f.hs)(i,i,1/Math.abs(S[3]));const r=this.fullViewport,n=(0,o.Cc)(0,r[0]+r[2],.5+.5*i[0]),s=(0,o.Cc)(0,r[1]+r[3],.5+.5*i[1]);return"x"in e?(e.x=n,e.y=s):(e[0]=n,e[1]=s,e.length>2&&(e[2]=.5*(i[2]+1))),e}unprojectFromScreen(t,e){return this.unprojectFromRenderScreen(this.screenToRender(t,I),e)}unprojectFromRenderScreen(t,e){if((0,h.lw)(C,this.projectionMatrix,this.viewMatrix),!(0,h.B8)(C,C))return null;const i=this.fullViewport;return S[0]=2*(t[0]-i[0])/i[2]-1,S[1]=2*(t[1]-i[1])/i[3]-1,S[2]=2*t[2]-1,S[3]=1,(0,m.Z0)(S,S,C),0===S[3]?null:(e[0]=S[0]/S[3],e[1]=S[1]/S[3],e[2]=S[2]/S[3],e)}constrainWindowSize(t,e,i,r){const n=t*this.pixelRatio,s=e*this.pixelRatio,o=Math.max(n-i/2,0),a=Math.max(this.fullHeight-s-r/2,0),c=-Math.min(n-i/2,0),h=-Math.min(this.fullHeight-s-r/2,0),l=i-c- -Math.min(this.fullWidth-n-i/2,0),u=r-h- -Math.min(s-r/2,0);return[Math.round(o),Math.round(a),Math.round(l),Math.round(u)]}computeUp(t){1===t?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,e){const i=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return e[0]=i,e[1]=r,e}renderToScreen(t,e){const i=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;e[0]=i,e[1]=r}sphereFrustumCoverage(t,e){const{center:i,eye:r,distance:n,fovY:s}=this,o=Math.abs(Math.PI/2-x(e,i,r));return t.frustumCoverage(o,n,s)}_computeUpGlobal(){(0,f.Re)(E,this.center,this.eye);const t=(0,f.Bw)(this.center);t<1?(0,f.t2)(this._up,p.Cb)&&((0,f.C)(this._up,p.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,f.Om)(E,this.center))>.9999*(0,f.Bw)(E)*t||((0,f.$A)(R,E,this.center),(0,f.$A)(R,R,E),(0,f.S8)(R,R),(0,f.t2)(this._up,R)||((0,f.C)(this._up,R),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,f.oW)(E,this.eye,this.center),Math.abs(E[2])<=.9999&&((0,f.hs)(E,E,E[2]),(0,f.hZ)(E,-E[0],-E[1],1-E[2]),(0,f.S8)(E,E),(0,f.t2)(this._up,E)||((0,f.C)(this._up,E),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(t,e,i){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?(0,f.t2)(t,e)||((0,f.C)(e,t),this._markViewDirty(),this.notifyChange(i)):s.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,_.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,h.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewport",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_padding",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_fov",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_nearFar",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewDirty",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewMatrix",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_pixelRatio",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"pixelRatio",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"row",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"column",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_rows",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"rows",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_columns",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"columns",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"eye",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"center",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_center",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"up",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_up",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"inverseViewMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewForward",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewUp",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewRight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"nearFar",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"near",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"far",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"screenViewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"screenPadding",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"x",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"y",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"width",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"height",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fullWidth",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fullHeight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"_aspect",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"padding",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"projectionMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"inverseProjectionMatrix",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fov",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fovX",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fovY",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewInverseTransposeMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"_projectionMatrixInternal",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"relativeElevation",void 0),M=T=(0,r.Cg)([(0,c.$K)("esri.views.3d.webgl.RenderCamera")],M);const A=M,S=(0,g.vt)(),C=(0,l.vt)(),E=(0,p.vt)(),R=(0,p.vt)(),I=(0,a.r_)()},78607(t,e,i){i.d(e,{A:()=>O});var r=i(5482),n=i(69622),s=i(49186),o=i(36708),a=i(10107),c=i(64108),h=i(63666),l=i(44208),u=i(53966),d=(i(17676),i(94656)),f=i(63907);i(93637),i(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,l.A)("esri-tests-disable-gpu-memory-measurements"),(0,d.en)();(0,d.en)();i(90644);var p=i(21231),m=i(97768),g=i(48852),_=i(42293);const v=!!(0,l.A)("esri-tests-disable-gpu-memory-measurements");class y{constructor(t,e){this._context=t,this._descriptor=e,this.type=2,this._context.instanceCounter.increment(f.vt.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:r,height:n,internalFormat:s,multisampled:o}=e;o?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,s,r,n):i.renderbufferStorage(i.RENDERBUFFER,s,r,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const t=this._descriptor.samples,e=this._context.parameters.maxSamples;return t?Math.min(t,e):e}get usedMemory(){return v?0:(t=this._descriptor).width<=0||t.height<=0||null==t.internalFormat?0:t.width*t.height*(0,_.MW)(t.internalFormat);var t}resize(t,e){const i=this._descriptor;if(i.width===t&&i.height===e)return;i.width=t,i.height=e;const r=this._context.gl;this._context.bindRenderbuffer(this),i.multisampled?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,i.internalFormat,i.width,i.height):r.renderbufferStorage(r.RENDERBUFFER,i.internalFormat,i.width,i.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(f.vt.Renderbuffer,this),this._context=null)}}class x{constructor(t,e,i){if(this._context=t,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,t.instanceCounter.increment(f.vt.FramebufferObject,this),null!=e){const i=function(t,e){return b(e)||w(e)?e:T(e)?new p.A(t,e):function(t){return 3===M(t)||null!=t&&"samples"in t}(e)?new y(t,e):null}(t,e);null!=i&&(this._colorAttachments.set(36064,i),b(i)?this._validateTextureDescriptor(i.descriptor):this._validateRenderbufferDescriptor(i.descriptor)),this._validateColorAttachmentPoint(36064)}if(null!=i)if(function(t){return b(t)||T(t)}(i))this._depthStencilTexture=b(i)?i:new p.A(t,i),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=w(i)?i:new y(t,i);this._depthStencilBuffer=e,this._validateRenderbufferDescriptor(e.descriptor)}}get glName(){return this._glName}get colorTexture(){const t=this._colorAttachments.get(36064);return b(t)?t:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const t=this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.width??0}get height(){const t=this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,i])=>t+i.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(t){this._level!==t&&(this._level=t,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&b(e)?e:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(t,e=36064){if(!t)return;this._validateColorAttachmentPoint(e);const{descriptor:i}=t;this._validateTextureDescriptor(i),this.detachColorTexture(e)?.dispose(),this._colorAttachments.set(e,t),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e))}detachColorTexture(t=36064){const e=this._colorAttachments.get(t);if(!e)return;const i=b(e);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(i)this._framebufferTexture2D(null,t);else{const e=this._context.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}}),this._colorAttachments.delete(t),i?e:void 0}detachColorTextures(...t){if(0!==t.length){if(this._glName){const e=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{t.forEach(t=>{b(this._colorAttachments.get(t))?this._framebufferTexture2D(null,t):e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)})})}t.forEach(t=>this._colorAttachments.delete(t))}}setColorTextureTarget(t,e=36064,i=0){const r=this._colorAttachments.get(e);r&&(35866===t?this._framebufferTextureLayer(r.glName,e,36160,i):this._framebufferTexture2D(r.glName,e,t,36160))}attachDepthStencil(t){if(t)switch(t.type){case 1:return this._attachDepthStencilTexture(t);case 2:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(null==t)return;const{descriptor:e}=t,{pixelFormat:i,dataType:r}=e;34041===i||6402===i?34041!==i||r===f.ld.UNSIGNED_INT_24_8?6402!==i||r===f.ld.UNSIGNED_INT||r===f.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,C(i))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,C(t.descriptor.pixelFormat))}),this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(null==t)return;const e=t.descriptor;if(this._validateRenderbufferDescriptor(e),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);const{gl:i}=this._context,r=this._getGLAttachmentPoint(e);i.framebufferRenderbuffer(36160,r,i.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._glName){const{_context:e}=this,i=e.boundFramebuffer;e.bindFramebuffer(this);const{gl:r}=e,n=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(36160,n,r.RENDERBUFFER,null),e.bindFramebuffer(i)}return this._depthStencilBuffer=null,t}invalidateAttachments(t){const{_context:e}=this;e.temporaryBindFramebuffer(this,()=>e.gl.invalidateFramebuffer(36160,t),!0)}copyToTexture(t,e,i,r,n,s,o){(t<0||e<0||n<0||s<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");const a=o.descriptor;3553!==o.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==a?.width||null==a?.height||t+i>this.width||e+r>this.height||n+i>a.width||s+r>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,h=c.bindTexture(o,p.A.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(p.A.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,n,s,t,e,i,r),c.bindTexture(h,p.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,n,s,o){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),o||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,i,r,n,s,o)}async readPixelsAsync(t,e,i,r,n,s,o,a){const{gl:c}=this._context,h=g.g.createPixelPack(this._context,35041,o.byteLength);this._context.bindBuffer(h);const l=this._context.boundFramebuffer;this._context.bindFramebuffer(this),c.readPixels(t,e,i,r,n,s,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(l);try{await h.getSubDataAsync(o,void 0,void 0,void 0,a)}finally{h.dispose()}}resize(t,e){if(this.width===t&&this.height===e)return;const i={width:t,height:e};if(A(i,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(t=>t.resize(i.width,i.height)),this._depthStencilTexture?.resize(i.width,i.height),this._glName&&(A(i,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(i.width,i.height),(0,d.en)())){const{gl:t}=this._context;t.checkFramebufferStatus(36160)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(t=36160){const{gl:e}=this._context;this._glName?e.bindFramebuffer(t,this._glName):(this._glName&&e.deleteFramebuffer(this._glName),this._glName=e.createFramebuffer(),e.bindFramebuffer(t,this._glName),this._initializeAttachments(t))}_initializeAttachments(t=36160){const{gl:e}=this._context;if(this._colorAttachments.forEach((e,i)=>{if(b(e)){const r=S(e);35866===r?this._framebufferTextureLayer(e.glName,i,t):this._framebufferTexture2D(e.glName,i,r,t)}else if(w(e)){const r=this._context.gl;r.framebufferRenderbuffer(t,i,r.RENDERBUFFER,e.glName)}}),this._depthStencilBuffer){const i=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,i,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const e=C(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,e,S(this._depthStencilTexture),t)}(0,d.en)()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(t,e=36064,i=3553,r=36160){this._context.gl.framebufferTexture2D(r,e,i,t,this._level)}_framebufferTextureLayer(t,e=36064,i=36160,r=0){this._context.gl.framebufferTextureLayer(i,e,t,this._level,r)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(36160,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=(0,m.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,C(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,m.WD)(this._depthStencilTexture))}_validateTextureDescriptor(t){3553!==t.target&&34067!==t.target&&35866!==t.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),A(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderbufferDescriptor(t){A(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case f.SB.DEPTH_COMPONENT16:case f.SB.DEPTH_COMPONENT24:case f.SB.DEPTH_COMPONENT32F:return 36096;case f.iE.DEPTH24_STENCIL8:case f.iE.DEPTH32F_STENCIL8:return 33306;case 36168:return 36128;default:return 36064}}_validateColorAttachmentPoint(t){if(-1===x._MAX_COLOR_ATTACHMENTS){const{gl:t}=this._context;x._MAX_COLOR_ATTACHMENTS=t.getParameter(t.MAX_COLOR_ATTACHMENTS)}const e=t-36064;e+1>x._MAX_COLOR_ATTACHMENTS&&u.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${x._MAX_COLOR_ATTACHMENTS} color attachments`)}}function b(t){return 1===M(t)}function w(t){return 2===M(t)}function T(t){return 0===M(t)}function M(t){return null!=t&&"type"in t?t.type:null}function A(t,e){const i=Math.max(t.width,t.height);if(i>e){u.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const r=e/i;return t.width=Math.round(t.width*r),t.height=Math.round(t.height*r),!1}return!0}function S(t){return 34067===t.descriptor.target?34069:35866===t.descriptor.target?35866:3553}function C(t){return 6402===t?36096:33306}i(67171),i(79785);var E=i(85079);const R=[new(i(74038)._)("position",2,f.pe.UNSIGNED_SHORT,0,4)];(0,E.Xk)(R),i(66289);const I=new Image;I.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",I.width=5,I.height=5,I.decode();let D=class extends n.A{constructor(t){super(t),this.view=null,this.consumes={required:[]},this.produces=h.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,o.wB)(()=>this.view.ready,t=>{t&&this.view.stage?.renderer.addRenderNode(this)},o.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new s.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const t=this._frameBuffer?.getTexture()?.descriptor,e=this.view.stage.renderer.fboCache.acquire(t?.width??640,t?.height??480,this.produces);return this._bind(e),e}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:t}){var e;t.initializeAndBind(),this.gl.drawBuffers((e=t)?e.colorAttachments.length>0?e.colorAttachments:[0]:[1029])}requestRender(t){switch(t){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(t);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(t){return!!this._dirty&&(this._dirty=!1,!0)}doRender(t){this._frameBuffer=t.find(({name:t})=>t===this.produces);try{return this.render(t)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}queryDepthRange(t){return null}get input(){return this._frameBuffer}};(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"view",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"consumes",void 0),(0,r.Cg)([(0,a.MZ)()],D.prototype,"produces",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],D.prototype,"techniques",null),D=(0,r.Cg)([(0,c.$)("esri.views.3d.webgl.RenderNode")],D);const O=D},37957(t,e,i){const r={create:()=>[0,0,0,0,0,0,0,0,0],copy(t,e){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]}};i.d(e,["P",0,r])},48852(t,e,i){i.d(e,{g:()=>f});var r=i(4576),n=i(44208),s=i(53966),o=i(17676),a=i(78659),c=i(34275),h=i(94656),l=i(63907);const u=()=>s.A.getLogger("esri.views.webgl.BufferObject"),d=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class f{static createIndex(t,e,i){return new f(t,34963,e,i)}static createUniform(t,e,i){return new f(t,35345,e,i)}static createPixelPack(t,e=35041,i){const r=new f(t,35051,e);return i&&r.setSize(i),r}static createPixelUnpack(t,e=35040,i){return new f(t,35052,e,i)}static createTransformFeedback(t,e=35044,i){const r=new f(t,35982,e);return r.setSize(i),r}constructor(t,e,i,r){this._context=t,this.bufferType=e,this.usage=i,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,t.instanceCounter.increment(l.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,h.Y2)(this._context.gl),r&&this.setData(r)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case l.pe.UNSIGNED_INT:return this._sizeBytes/4;case l.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case l.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return d?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(l.vt.BufferObject,this),this._context=null):this._glName&&u().warn("Leaked WebGL buffer object")}setSize(t,e=null){if(34963===this.bufferType&&null!=e)switch(this._indexType=e,e){case l.pe.UNSIGNED_SHORT:t*=2;break;case l.pe.UNSIGNED_INT:t*=4;case l.pe.UNSIGNED_BYTE:}this._setBufferData(t)}setData(t){if(!t)return;const e=t.byteLength;34963===this.bufferType&&((0,c.mg)(t)?this._indexType=l.pe.UNSIGNED_BYTE:(0,c.jq)(t)?this._indexType=l.pe.UNSIGNED_SHORT:(0,c.XJ)(t)&&(this._indexType=l.pe.UNSIGNED_INT)),this._setBufferData(e,t)}setIndexType(t){34963===this.bufferType&&(this._indexType=t)}_setBufferData(t,e=null){this._sizeBytes=t;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const r=this._context.gl;null!=e?r.bufferData(this.bufferType,e,this.usage):r.bufferData(this.bufferType,t,this.usage),(0,h.Y2)(r),this._isVAOAware&&this._context.bindVAO(i)}setSubData(t,e,i,r){if(!t)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:s}=this._context;s.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,t,i,r-i),(0,h.Y2)(s),this._isVAOAware&&this._context.bindVAO(n)}getSubData(t,e=0,i,n){if(i<0||n<0)return;const s=function(t){return(0,r.Xj)(t)}(t)?t.BYTES_PER_ELEMENT:1;if(s*((i??0)+(n??0))>t.byteLength)return;e+s*(n??0)>this.usedMemory&&u().warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),o.getBufferSubData(35982,e,t,i,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),o.getBufferSubData(36662,e,t,i,n),this._context.unbindBuffer(36662))}async getSubDataAsync(t,e=0,i,r,n){if(await this._context.clientWaitAsync((0,a.l5)(10),n),!this._context||!this._glName)throw(0,o.NK)();this.getSubData(t,e,i,r)}}},14113(t,e,i){i.d(e,{Cy:()=>u,N5:()=>a});var r=i(49186),n=(i(44208),i(53966));const s=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class o{constructor(){this._includedModules=new Map}include(t,e){this._includedModules.has(t)?this._includedModules.get(t):(this._includedModules.set(t,e),t(this.builder,e))}}class a extends o{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new f,this.varyings=new p,this.outputs=new m}get attributeNames(){return this.attributes.names}get builder(){return this}generate(t,e=!1){const i=this.attributes.generateSource(t),r=this.varyings.generateSource(t),n="vertex"===t?this.vertex:this.fragment,s=n.uniforms.generateSource(),o=n.code.generateSource(),a=n.main.generateSource(e),c=this.debugName?`// ${this.debugName}\n`:"",h="vertex"===t?v:_,l=n.constants.generateSource(),u=this.outputs.generateSource(t);return`#version 300 es\n${c}\n${h}\n${l.join("\n")}\n${s.join("\n")}\n${i.join("\n")}\n${r.join("\n")}\n${u.join("\n")}\n${o.join("\n")}\n${a.join("\n")}`}generateBind(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return e=>{for(let n=0;n<r;++n)i[n](t,e)}}generateBindPass(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n)=>{for(let s=0;s<r;++s)i[s](t,n,e)}}generateBindDraw(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n,s)=>{for(let o=0;o<r;++o)i[o](t,s,e,n)}}}class c{constructor(t){this._stage=t,this._entries=new Map}add(...t){for(const e of t)this._add(e);return this._stage}get(t){return this._entries.get(t)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new r.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else s().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:t,arraySize:e,type:i})=>null!=e?`uniform ${i} ${t}[${e}];`:`uniform ${i} ${t};`)}get entries(){return Array.from(this._entries.values())}}class h{constructor(){this._entries=new Map}add(t,e){if(this._entries.has(t))throw new r.A("shaderbuilder:duplicate-input",`Duplicate input for ${t}`);this._entries.set(t,e)}get(t){const e=this._entries.get(t);if(null==e)throw new r.A("shaderbuilder:input-resolver-error",`No resolver for input ${t} found.`);return e()}}class l{constructor(t){this._stage=t,this._bodies=new Array}add(t){return this._bodies.push(t),this._stage}generateSource(t){if(this._bodies.length>0){const t=[];for(const e of this._bodies)"string"==typeof e?t.push(e):t.push(...e());return[`void main() {\n ${t.join("\n")||""} \n}`]}if(t)throw new r.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(t){this._stage=t,this._entries=new Array}add(t){return this._entries.push(t),this._stage}generateSource(){const t=[];for(const e of this._entries)"string"==typeof e?t.push(e):t.push(...e());return t}}class d extends o{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new u(this),this.constants=new g(this),this.inputs=new h}get builder(){return this}}class f{constructor(){this._entries=new Array}add(t,e){this._entries.push([t,e])}generateSource(t){return"fragment"===t?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}get names(){return this._entries.map(([t])=>t)}}class p{constructor(){this._entries=new Map}add(t,e,i){this._entries.has(t)?s().warn(`Ignoring duplicate varying ${e} ${t}`):this._entries.set(t,{type:e,invariant:i?.invariant??!1})}generateSource(t){const e=new Array;return this._entries.forEach((i,r)=>e.push((i.invariant&&"vertex"===t?"invariant ":"")+("int"===i.type?"flat ":"")+("vertex"===t?"out":"in")+` ${i.type} ${r};`)),e}}class m{constructor(){this._entries=new Map}add(t,e,i=0){const r=this._entries.get(i);r?.name!==t||r?.type!==e?this._entries.set(i,{name:t,type:e}):s().warn(`Fragment shader output location ${i} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(t){if("vertex"===t)return[];0===this._entries.size&&this._entries.set(0,{name:m.DEFAULT_NAME,type:m.DEFAULT_TYPE});const e=new Array;return this._entries.forEach((t,i)=>e.push(`layout(location = ${i}) out ${t.type} ${t.name};`)),e}}class g{constructor(t){this._stage=t,this._entries=new Set}add(t,e,i){let r="ERROR_CONSTRUCTOR_STRING";switch(e){case"float":r=g._numberToFloatStr(i);break;case"int":r=g._numberToIntStr(i);break;case"uint":r=g._numberToUintStr(i);break;case"bool":r=i.toString();break;case"vec2":r=`vec2(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])})`;break;case"vec3":r=`vec3(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])})`;break;case"vec4":r=`vec4(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])}, ${g._numberToFloatStr(i[3])})`;break;case"ivec2":r=`ivec2(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])})`;break;case"ivec3":r=`ivec3(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])})`;break;case"ivec4":r=`ivec4(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])}, ${g._numberToIntStr(i[3])})`;break;case"uvec2":r=`uvec2(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])})`;break;case"uvec3":r=`uvec3(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])})`;break;case"uvec4":r=`uvec4(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])}, ${g._numberToUintStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":r=`${e}(${Array.prototype.map.call(i,t=>g._numberToFloatStr(t)).join(", ")})`}return this._entries.add(`const ${e} ${t} = ${r};`),this._stage}static _numberToIntStr(t){return t.toFixed(0)}static _numberToUintStr(t){return`${t.toFixed(0)}u`}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",v="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},21231(t,e,i){i.d(e,{A:()=>g});var r=i(49186),n=i(44208),s=i(53966),o=i(97768),a=i(93637),c=i(17676),h=i(94656),l=i(63907),u=i(67171),d=i(12541);class f extends u.R{constructor(t,e){switch(super(),this.context=t,Object.assign(this,e),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=6403;break;case l.H0.R8I:case l.H0.R8UI:case l.H0.R16I:case l.H0.R16UI:case l.H0.R32I:case l.H0.R32UI:this.pixelFormat=36244}}static validate(t,e){return new f(t,e)}}const p=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),m=()=>s.A.getLogger("esri/views/webgl/Texture");class g{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(t,e=null,i=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in t)this._descriptor=t,i=e;else{const i=f.validate(t,e);if(!i)throw new r.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=i}34067===this._descriptor.target?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return p?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(t,e){const i=this._descriptor;if(i.width!==t||i.height!==e){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-resize","Immutable textures can't be resized!");i.width=t,i.height=e,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!(0,d.Qp)(t)&&this._descriptor.internalFormat&&(0,a.a4)(l.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!(0,d.Qp)(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(t,e,i,n,s,o,a=0){o||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=(0,d.mq)(c);const{context:h,pixelFormat:l,dataType:u,target:f,isImmutable:p}=c;if(p&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");const _=h.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES,!0);(e<0||i<0||e+n>c.width||i+s>c.height)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:v}=h;a&&(n&&s||m().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),v.pixelStorei(v.UNPACK_SKIP_ROWS,a)),(0,d.Kv)(o)?v.texSubImage2D(f,t,e,i,n,s,l,u,o):(0,d.Qp)(o)?v.compressedTexSubImage2D(f,t,e,i,n,s,c.internalFormat,o.levels[t]):v.texSubImage2D(f,t,e,i,n,s,l,u,o),a&&v.pixelStorei(v.UNPACK_SKIP_ROWS,0),h.bindTexture(_,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,e,i,n,s,o,a,c){c||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update an uninitialized texture!");const h=this._descriptor;h.internalFormat=(0,d.mq)(h);const{context:l,pixelFormat:u,dataType:f,isImmutable:p,target:_}=h;if(p&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");(0,d.re)(_)||m().warn("Attempting to set 3D texture data on a non-3D texture");const v=l.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),(e<0||i<0||n<0||e+s>h.width||i+o>h.height||n+a>h.depth)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:y}=l;if((0,d.Qp)(c))c=c.levels[t],y.compressedTexSubImage3D(_,t,e,i,n,s,o,a,h.internalFormat,c);else{const r=c;y.texSubImage3D(_,t,e,i,n,s,o,a,u,f,r)}l.bindTexture(v,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,(0,d.QE)(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const e=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(e,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const t=this._descriptor;if(t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");t.hasMipmap=!1,this._samplingModeDirty=!0,(0,d.QE)(t)}9985===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9729):9984===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,(0,d.QE)(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),(0,d.QE)(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,o.DC)(this._compressionAbortController)}_setData(t,e){const i=this._descriptor,n=i.context?.gl;if(!n)return;(0,h.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),i.context.instanceCounter.increment(l.vt.Texture,this)),(0,d.QE)(i);const s=i.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);i.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,h.Y2)(n);const o=e??i.target,a=(0,d.re)(o);if((0,d.Kv)(t))this._setDataFromTexImageSource(t,o);else{const{width:e,height:s,depth:c}=i;if(null==e||null==s)throw new r.A("texture:missing-size","Width and height must be specified!");if(a&&null==c)throw new r.A("texture:missing-depth","Depth must be specified!");if(i.internalFormat=(0,d.mq)(i),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(o,i.internalFormat,i.hasMipmap,e,s,c),(0,d.Qp)(t)){if(!(0,d.tl)(i.internalFormat))throw new r.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,i.internalFormat,o)}else this._texImage(o,0,i.internalFormat,e,s,c,t),(0,h.Y2)(n),i.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,h.Y2)(n),i.context.bindTexture(s,g.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=(0,d.mq)(r);const n=(0,d.re)(e),{width:s,height:o,depth:a}=(0,d.Eo)(t);r.width&&r.height,r.width||(r.width=s),r.height||(r.height=o),n&&r.depth,n&&(r.depth=a),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,s,o,a),this._texImage(e,0,r.internalFormat,s,o,a,t),(0,h.Y2)(i),r.hasMipmap&&(this.generateMipmap(),(0,h.Y2)(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:n,height:s,depth:o}=r,a=t.levels,c=(0,d.FV)(i,n,s,o),h=Math.min(c,a.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,h),this._forEachMipmapLevel((t,r,n,s)=>{const o=a[Math.min(t,a.length-1)];this._compressedTexImage(i,t,e,r,n,s,o)},h)}_texStorage(t,e,i,n,s,o){const{gl:a}=this._descriptor.context;if(!(0,d.tr)(e)&&!(0,d.tl)(e))throw new r.A("texture:missing-format","Immutable textures must have a sized or compressed internal format");if(!this._descriptor.isImmutable)return;const c=i?(0,d.FV)(t,n,s,o):1;if((0,d.re)(t)){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(t,c,e,n,s,o)}else a.texStorage2D(t,c,e,n,s);this._wasImmutablyAllocated=!0}_texImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t),{isImmutable:l,pixelFormat:u,dataType:f}=this._descriptor;if(l){if(null!=a){const i=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(t,e,0,0,0,n,s,o,u,f,i)}else c.texSubImage2D(t,e,0,0,n,s,u,f,i)}}else{const l=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(t,e,i,n,s,o,0,u,f,l)}else c.texImage2D(t,e,i,n,s,0,u,f,l)}}_compressedTexImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t);if(this._descriptor.isImmutable){if(null!=a)if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(t,e,0,0,0,n,s,o,i,a)}else c.compressedTexSubImage2D(t,e,0,0,n,s,i,a)}else if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(t,e,i,n,s,o,0,a)}else c.compressedTexImage2D(t,e,i,n,s,0,a)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:n,preMultiplyAlpha:s,hasMipmap:o,compress:a}=this._descriptor;if(!a)return;const{compressionTracker:h,compressionCallback:l,preserveSourceBitmap:u}=a,{compressedTextureETC:d,compressedTextureS3TC:f}=r.capabilities;if(!g.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!d&&!f)return;this.abortCompression();const p=new AbortController;let _;this._compressionAbortController=p,h?.increment();let v=!1,y=!1;try{t instanceof ImageBitmap?u?(_=await createImageBitmap(t),(0,c.Te)(p),y=!0):_=t:t instanceof Uint8Array?(_=t.buffer,v=this.descriptor.flipped):(_=await createImageBitmap(t,{imageOrientation:n?"flipY":"none"}),(0,c.Te)(p),y=!0);const r={data:_,width:e,height:i,needsFlip:v,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:s,isOpaque:this._descriptor.isOpaque,hasMipmap:o,hasETC:!!d,hasS3TC:!!f},a=await g.compressionWorkerHandle.invoke(r,p.signal,1);if((0,c.Te)(p),a.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),l?.(t-this.usedMemory)}}catch(t){(0,c.zf)(t)||m().error("Texture compression failed!")}finally{h?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),y&&_ instanceof ImageBitmap&&_.close()}}_forEachMipmapLevel(t,e=1/0){let{width:i,height:n,depth:s,hasMipmap:o,target:a}=this._descriptor;const c=32879===a;if(null==i||null==n||c&&null==s)throw new r.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let r=0;t(r,i,n,s),o&&(1!==i||1!==n||c&&1!==s)&&!(r>=e);++r)i=Math.max(1,i>>1),n=Math.max(1,n>>1),c&&(s=Math.max(1,s>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),(0,h.Y2)(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;e&&t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}},67171(t,e,i){i.d(e,{R:()=>s,e:()=>o});var r=i(63907),n=i(42293);class s{constructor(t=0,e=t){this.width=t,this.height=e,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=r.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function o(t){return t.width<=0||t.height<=0||t.depth<=0?0:Math.round(t.width*t.height*t.depth*(t.hasMipmap?4/3:1)*(null==t.internalFormat?4:(0,n.MW)(t.internalFormat))*(34067===t.target?6:1))}},42293(t,e,i){i.d(e,{MW:()=>c,wH:()=>a,yu:()=>o});var r=i(94656),n=i(63907);const s=new Set([n.pe.BYTE,n.pe.SHORT,n.pe.INT,n.pe.UNSIGNED_BYTE,n.pe.UNSIGNED_SHORT,n.pe.UNSIGNED_INT]);function o(t,e,i,n=0){const o=t.gl;t.bindBuffer(i);for(const a of i.layout){const i=e.get(a.name);if(null==i){console.warn(`There is no location for vertex attribute '${a.name}' defined.`);continue}const c=n*a.stride;if(a.count<=4)a.integer&&s.has(a.type)?o.vertexAttribIPointer(i,a.count,a.type,a.stride,a.offset+c):o.vertexAttribPointer(i,a.count,a.type,a.normalized,a.stride,a.offset+c),o.enableVertexAttribArray(i),a.divisor>0&&o.vertexAttribDivisor(i,a.divisor);else if(9===a.count)for(let t=0;t<3;t++)o.vertexAttribPointer(i+t,3,a.type,a.normalized,a.stride,a.offset+12*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else if(16===a.count)for(let t=0;t<4;t++)o.vertexAttribPointer(i+t,4,a.type,a.normalized,a.stride,a.offset+16*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count);if((0,r.en)()){const e=(0,r.u1)(t.gl);e&&console.error(`Unable to bind vertex attribute "${a.name}" with baseInstanceOffset ${c}:`,e,a)}}}function a(t){switch(t){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function c(t){switch(t){case 6406:case 6409:case 6403:case 36244:case n.H0.R8:case n.H0.R8I:case n.H0.R8UI:case n.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case n.H0.RGBA4:case n.H0.R16F:case n.H0.R16I:case n.H0.R16UI:case n.H0.RG8:case n.H0.RG8I:case n.H0.RG8UI:case n.H0.RG8_SNORM:case n.H0.RGB565:case n.H0.RGB5_A1:case n.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case n.H0.RGB8:case n.H0.RGB8I:case n.H0.RGB8UI:case n.H0.RGB8_SNORM:case n.H0.SRGB8:case n.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case n.H0.RGBA8:case n.H0.R32F:case n.H0.R11F_G11F_B10F:case n.H0.RG16F:case n.H0.R32I:case n.H0.R32UI:case n.H0.RG16I:case n.H0.RG16UI:case n.H0.RGBA8I:case n.H0.RGBA8UI:case n.H0.RGBA8_SNORM:case n.H0.SRGB8_ALPHA8:case n.H0.RGB9_E5:case n.H0.RGB10_A2UI:case n.H0.RGB10_A2:case n.SB.DEPTH_COMPONENT32F:case n.iE.DEPTH24_STENCIL8:return 4;case n.iE.DEPTH32F_STENCIL8:return 5;case n.H0.RGB16F:case n.H0.RGB16I:case n.H0.RGB16UI:return 6;case n.H0.RG32F:case n.H0.RG32I:case n.H0.RG32UI:case n.H0.RGBA16F:case n.H0.RGBA16I:case n.H0.RGBA16UI:return 8;case n.H0.RGB32F:case n.H0.RGB32I:case n.H0.RGB32UI:return 12;case n.H0.RGBA32F:case n.H0.RGBA32I:case n.H0.RGBA32UI:return 16;case n.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case n.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case n.CQ.COMPRESSED_R11_EAC:case n.CQ.COMPRESSED_SIGNED_R11_EAC:case n.CQ.COMPRESSED_RGB8_ETC2:case n.CQ.COMPRESSED_SRGB8_ETC2:case n.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case n.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case n.CQ.COMPRESSED_RG11_EAC:case n.CQ.COMPRESSED_SIGNED_RG11_EAC:case n.CQ.COMPRESSED_RGBA8_ETC2_EAC:case n.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},79785(t,e,i){i.d(e,{Z:()=>l});var r=i(21818),n=i(53966),s=i(97768),o=i(63907),a=i(42293),c=i(85079);const h=()=>n.A.getLogger("esri.views.webgl.VertexArrayObject");let l=class t{constructor(t,e,i,n,s){this._context=t,this._indexBuffer=i,this._buffers=e instanceof Map?e:new Map([["geometry",e]]),this._baseInstances=null==n?new Map:"number"==typeof n?new Map([["geometry",n]]):n,this.locations=s??(0,r.z)((0,c.Sk)(this._buffers))}get glName(){return this._glName}get context(){return this._context}get buffers(){return(0,r.z)(this._buffers)}buffer(t="geometry"){return this.buffers.get(t)}mutableBuffer(t="geometry"){return this._buffers.get(t)}get indexBuffer(){return this._indexBuffer}getByteLength(t){return this.buffer(t)?.sizeBytes??0}vertexCount(t){const e=this.buffer(t);return e?e.sizeBytes/e.layout[0].stride:0}get usedMemory(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer?.usedMemory??0+145*(this._buffers.size+(this._indexBuffer?1:0)))}dispose(){this._context?(this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=(0,s.WD)(this._indexBuffer),this.disposeVAOOnly()):(this._glName||this._buffers.size>0)&&h().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(o.vt.VertexArrayObject,this)),this._context=null):this._glName&&h().warn("Leaked WebGL VAO")}bind(t=this.locations){const e=this._context.gl;this._glName?e.bindVertexArray(this._glName):(this._context.instanceCounter.increment(o.vt.VertexArrayObject,this),this._glName=e.createVertexArray(),e.bindVertexArray(this._glName),this._bindLayout(t))}_bindLayout(t){const{_buffers:e,_indexBuffer:i}=this;if(e||h().error("Vertex buffer dictionary is empty!"),e.forEach((e,i)=>(0,a.yu)(this._context,t,e,this._baseInstances.get(i)??0)),null!=i){const t=this._context.gl;this._context.gl.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.glName)}}unbind(){this._context.gl.bindVertexArray(null)}shallowCloneWithBaseInstances(e){return new t(this._context,this._buffers,this._indexBuffer,e)}}},66289(t,e,i){i.d(e,{R:()=>n});var r=i(48852);class n extends r.g{constructor(t,e,i,r=35044){super(t,34962,r,i),this.layout=e}}},94656(t,e,i){i.d(e,{Y2:()=>h,en:()=>c,u1:()=>o});var r=i(49186),n=i(44208),s=i(53966);function o(t){switch(t.getError()){case t.NO_ERROR:return null;case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!(0,n.A)("enable-feature:webgl-debug");function c(){return a}function h(t,e=c()){if(e){const e=o(t);if(e){const t=(new Error).stack;s.A.getLogger("esri.views.webgl.checkWebGLError").error(new r.A("webgl-error","WebGL error occurred",{message:e,stack:t}))}}}},28449(t,e,i){function r(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],e[r]=s[0];return e}function n(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],s[1]=t[r]-s[0],e[r]=s[1];return e}i.d(e,{Zo:()=>r,jA:()=>n});const s=new Float32Array(2)},90644(t,e,i){function r(t,e,i=32774,r=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}function n(t,e,i,r,n=32774,s=32774,o=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:r,opRgb:n,opAlpha:s,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}i.d(e,{Ey:()=>x,nk:()=>u,p3:()=>n}),i(4718);const s=r(0,771),o=(r(1,0),r(1,1),r(1,771)),a=n(770,1,771,771),c=n(0,0,768,0),h={face:1029,mode:2305},l={face:1028,mode:2305};function u(t,e,i){return{ref:t,readMask:e,stencilFront:i,stencilBack:i}}function d(t){return T.intern(t)}function f(t){return A.intern(t)}function p(t){return C.intern(t)}function m(t){return R.intern(t)}function g(t){return D.intern(t)}function _(t){return P.intern(t)}function v(t){return N.intern(t)}function y(t){return L.intern(t)}function x(t){return H.intern(t)}class b{constructor(t,e){this._makeKey=t,this._makeRef=e,this._interns=new Map}intern(t){if(!t)return null;const e=this._makeKey(t),i=this._interns;return i.has(e)||i.set(e,this._makeRef(t)),i.get(e)??null}}function w(t){return"["+t.join(",")+"]"}const T=new b(M,t=>({__tag:"Blending",...t}));function M(t){return t?w([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const A=new b(S,t=>({__tag:"Culling",...t}));function S(t){return t?w([t.face,t.mode]):null}const C=new b(E,t=>({__tag:"PolygonOffset",...t}));function E(t){return t?w([t.factor,t.units]):null}const R=new b(I,t=>({__tag:"DepthTest",...t}));function I(t){return t?w([t.func]):null}const D=new b(O,t=>({__tag:"StencilTest",...t}));function O(t){return t?w([t.ref,t.readMask,t.stencilFront.compare,t.stencilFront.fail,t.stencilFront.zFail,t.stencilFront.zPass,t.stencilBack.compare,t.stencilBack.fail,t.stencilBack.zFail,t.stencilBack.zPass]):null}const P=new b(F,t=>({__tag:"DepthWrite",...t}));function F(t){return t?w([t.zNear,t.zFar]):null}const N=new b(B,t=>({__tag:"ColorWrite",...t}));function B(t){return t?w([t.r,t.g,t.b,t.a]):null}const L=new b(U,t=>({__tag:"StencilWrite",...t}));function U(t){return t?w([t.mask]):null}const H=new b(function(t){return t?w([M(t.blending),S(t.culling),E(t.polygonOffset),I(t.depthTest),O(t.stencilTest),F(t.depthWrite),B(t.colorWrite),U(t.stencilWrite)]):null},t=>({blending:d(t.blending),culling:f(t.culling),polygonOffset:p(t.polygonOffset),depthTest:m(t.depthTest),stencilTest:g(t.stencilTest),depthWrite:_(t.depthWrite),colorWrite:v(t.colorWrite),stencilWrite:y(t.stencilWrite)}));i.d(e,["RC",0,o,"T8",0,a,"Uy",0,{zNear:0,zFar:1},"Xt",0,t=>2===t?h:1===t?l:null,"iD",0,s,"kn",0,{r:!0,g:!0,b:!0,a:!0},"uR",0,c])},12541(t,e,i){i.d(e,{CR:()=>l,Eo:()=>v,FV:()=>g,Kv:()=>p,QE:()=>c,QJ:()=>u,Qp:()=>f,mq:()=>_,re:()=>m,tl:()=>d,tr:()=>h});var r=i(49186),n=i(53966),s=i(93637),o=i(63907);const a=()=>n.A.getLogger("esri/views/webgl/textureUtils");function c(t){const{width:e,height:i,depth:r}=t;(null!=e&&e<0||null!=i&&i<0||null!=r&&r<0)&&a().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=t;if(n&&(l(n)||u(n))){const{linearFilterDepth:e,compareEnabled:i,samplingMode:r,hasMipmap:n}=t;n&&a().error("Depth textures cannot have mipmaps"),e?9729!==r&&9728!==r&&a().error("Depth textures cannot sample mipmaps"):(9728!==r&&a().error("Depth textures without filtering must use NEAREST filtering"),i&&a().error("Depth textures without filtering cannot use compare function"))}}function h(t){return function(t){return o.XN.includes(t)}(t)||l(t)||u(t)}function l(t){return(0,s.a4)(o.SB,t)}function u(t){return(0,s.a4)(o.iE,t)}function d(t){return null!=t&&(0,s.a4)(o.CQ,t)}function f(t){return null!=t&&"type"in t&&"compressed"===t.type}function p(t){return null!=t&&!f(t)&&!function(t){return null!=t&&"byteLength"in t}(t)}function m(t){return 32879===t||35866===t}function g(t,e,i,r=1){let n=Math.max(e,i);return 32879===t&&(n=Math.max(n,r)),Math.floor(Math.log2(n))+1}function _(t){if(null!=t.internalFormat)return t.internalFormat;switch(t.dataType){case o.ld.FLOAT:switch(t.pixelFormat){case 6408:return o.H0.RGBA32F;case 6407:return o.H0.RGB32F;default:throw new r.A("texture:unknown-format","Unable to derive format")}case o.ld.UNSIGNED_BYTE:switch(t.pixelFormat){case 6408:return o.H0.RGBA8;case 6407:return o.H0.RGB8}}const{pixelFormat:e}=t;return t.internalFormat=34041===e?o.iE.DEPTH24_STENCIL8:6402===e?o.SB.DEPTH_COMPONENT24:e,t.internalFormat}function v(t){let e="width"in t?t.width:t.codedWidth,i="height"in t?t.height:t.codedHeight;return t instanceof HTMLVideoElement&&(e=t.videoWidth,i=t.videoHeight),{width:e,height:i,depth:1}}},49788(t,e,i){const r=1/255.5,n=1-r;i.d(e,["Q",0,r,"v",0,n])}}]);
|
|
256
|
+
`)}},26934(t,e,i){i.d(e,{Q:()=>n});var r=i(49788);function n(t){t.constants.add("alphaCutoff","float",r.Q),t.constants.add("opacityCutoff","float",r.v)}},58243(t,e,i){function r(t,e){e.useFloatBlend?t.code.add("float ditherNoise(vec4 color) { return 0.0; }"):t.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}i.d(e,{t:()=>r})},63666(t,e,i){i.d(e,{OG:()=>Ot,gP:()=>It});var r=i(5482),n=i(69540),s=i(91429);let o=class extends n.Pw{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return null!=t&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"row",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"column",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"rows",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"columns",void 0),o=(0,r.Cg)([(0,s.$K)("esri.CameraLayout")],o);const a=o;var c=i(69052),h=i(25482),l=i(34727),u=i(56507),d=i(86738),f=i(43937),p=i(36005);let m=class extends((0,n.OU)(h.o)){constructor(...t){super(...t),this.position=new d.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new a}normalizeCtorArgs(t,e,i,r){if(t&&"object"==typeof t&&("x"in t||Array.isArray(t))){const n={position:t};return null!=e&&(n.heading=e),null!=i&&(n.tilt=i),null!=r&&(n.fov=r),n}return t}writePosition(t,e,i,r){const n=t.clone();n.x=(0,u.GB)(t.x||0),n.y=(0,u.GB)(t.y||0),n.z=t.hasZ?(0,u.GB)(t.z||0):t.z,e[i]=n.write({},r)}readPosition(t,e){const i=new d.A;return i.read(t,e),i.x=(0,u.GB)(i.x||0),i.y=(0,u.GB)(i.y||0),i.z=i.hasZ?(0,u.GB)(i.z||0):i.z,i}equals(t){return null!=t&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};(0,r.Cg)([(0,s.MZ)({type:d.A,json:{write:{isRequired:!0}}})],m.prototype,"position",void 0),(0,r.Cg)([(0,f.K)("position")],m.prototype,"writePosition",null),(0,r.Cg)([(0,p.w)("position")],m.prototype,"readPosition",null),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>c.ie.normalize((0,u.GB)(t)))],m.prototype,"heading",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t),-180,180))],m.prototype,"tilt",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t,55),1,170))],m.prototype,"fov",void 0),(0,r.Cg)([(0,s.MZ)({type:a,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"layout",void 0),m=(0,r.Cg)([(0,s.$K)("esri.Camera")],m);var g=i(9093),_=i(35522),v=i(51850),y=i(16930),x=(i(48353),i(9762),i(65806)),b=i(27993),w=i(73941),T=(i(19419),i(82919)),M=i(71351);i(91712),i(49718),i(6867),i(16396),(0,v.vt)(),(0,v.vt)(),(0,v.vt)();var A=i(58083),S=i(48163),C=i(5443),E=i(39829),R=i(95108),I=i(37585);function D(t,e,i,r){const n=function(t,e){const i=0===e||2===e?0:1,r=t[e],n=0===e||1===e?1:-1,s=0===i?1:0;return(t,e,o)=>{if(e[i]<r&&o[i]<r)return 1===n?0:1;if(e[i]>r&&o[i]>r)return 1===n?1:0;const a=(o[s]-e[s])/(o[i]-e[i]),c=e[s]+a*(r-e[i]);return t[i]=r,t[s]=c,(e[i]<r?1:-1)*n>0?2:3}}(i,r);if(t.length=0,e.length){1===n(P,e[0],e[0])&&O(t,e[0]);for(let i=0;i<e.length;i++){const r=e[i===e.length-1?0:i+1];switch(n(P,e[i],r)){case 1:O(t,r);break;case 3:O(t,(0,S.o8)(P));break;case 2:O(t,(0,S.o8)(P)),O(t,r)}}}}function O(t,e){0!==t.length&&(0,I.aI)(t.at(-1),e)||t.push(e)}const P=(0,S.vt)();var F=i(11964),N=i(27921);const B=(0,v.vt)(),L=(0,v.vt)();function U(){return{direction:(0,v.vt)(),up:(0,v.vt)()}}function H(t,e,i,r,n){let s=(0,_.S8)(B,t),o=(0,_.Om)(s,r);const a=o>0;o=Math.abs(o),o>.99&&(o=Math.abs((0,_.Om)(e,r)),o<.99?((0,_.C)(s,e),a&&(0,_.hs)(s,s,-1)):s=null);let c=0;if(s){(0,_.hs)(L,r,(0,_.Om)(r,s)),(0,_.Re)(s,s,L);const t=(0,_.Om)(s,n)/((0,_.Bw)(s)*(0,_.Bw)(n));(0,_.$A)(L,s,n),c=((0,_.Om)(L,r)>0?1:-1)*(0,l.KJ)((0,l.XM)(t))}const h=(0,l.KJ)((0,l.XM)(-(0,_.Om)(r,t)/(0,_.Bw)(t)));return i?(i.heading=c,i.tilt=h,i):{heading:c,tilt:h}}function V(t,e,i,r){(0,_.Re)(z,i,e),(0,N.T7)(r,(0,F.LV)(e,z),t)||t===i||(0,_.C)(t,i)}const z=(0,v.vt)(),G=(0,v.fA)(0,1,0),k=(0,v.fA)(0,0,1),W=(0,g.vt)(),Z=(0,v.vt)(),$=(0,v.vt)();function j(t,e,i,r=U()){const{direction:n,up:s}=r;return(0,A.N9)(W,-(0,l.kU)(e)),(0,A.eL)(W,W,(0,l.kU)(i)),(0,_.Z0)(n,k,W),(0,_.hs)(n,n,-1),(0,_.Z0)(s,G,W),r}function q(t,e,i,r,n){const s=e.lines[11].direction,o=(n-i.getAltitude(r))/s[2];(0,_.Ln)(t,r,s,o)}const X=(0,v.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){return H(e,i,r,k,G)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n=j(0,i,r),s=(0,v.vt)();return(0,_.hs)(s,n.direction,-e),(0,_.WQ)(s,s,t),{up:n.up,eye:s,heading:i,tilt:r}},eyeTiltToLookAtTilt:function(t){return(0,l.kU)(t)},headingTiltToDirectionUp:j,lookAtTiltToEyeTilt:function(t){return(0,l.KJ)(t)},toArea:function(t,e){const i=t.frustum,{renderCoordsHelper:r}=t,n=r.getAltitude(e),s=t.spatialReference,o=t.state.camera.eye,a=[],c=i.planes[5];for(let t=0;t<4;t++){const e=i.lines[t];r.intersectInfiniteManifold((0,M.LV)(e.origin,e.direction),n,X)||q(X,i,r,e.endpoint,n),V(X,o,X,c),a.push((0,S.fA)(X[0],X[1]))}return function(t,e,i){const r=t.map(t=>((0,_.hZ)(X,t[0],t[1],0),e.fromRenderCoords(X,X,i),[X[0],X[1]]));return r.length<=2?new E.A({spatialReference:i}):(r.push(r[0].slice()),(0,R.$3)(r)||r.reverse(),new E.A({rings:[r],spatialReference:i}))}(function(t,e){const i=[],r=[];return D(i,t,e,0),D(r,i,e,1),D(i,r,e,2),D(r,i,e,3),r}(a,r.extent),r,s)},toExtent:function(t,e,i,r,n){const s=t.renderSpatialReference,o=t.spatialReference??e.spatialReference;return(0,x.g)(e,Z,s),(0,x.g)(e,$,s),Z[0]-=i/2,$[0]+=i/2,Z[1]-=r/2,$[1]+=r/2,(0,b.F)(Z,s,Z,o),(0,b.F)($,s,$,o),n?(n.xmin=Z[0],n.ymin=Z[1],n.xmax=$[0],n.ymax=$[1],n.spatialReference=o):n=new C.A(Z[0],Z[1],$[0],$[1],o),n}},Symbol.toStringTag,{value:"Module"}));var Q=i(78955),Y=i(91829),K=i(34304),J=i(17136),tt=i(94008),et=i(28735);class it{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(t){this.renderCoordsHelper=t,this.frustum=(0,T.vt)(),this._points=(0,T.Qy)(),this.lines=new Array(12),this._origin=(0,v.vt)(),this._direction=(0,v.vt)(),this._boundingSphere=new tt.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let t=0;t<12;t++)this.lines[t]={origin:null,direction:(0,v.vt)(),endpoint:null}}update(t){(0,T.ui)(t.viewMatrix,t.projectionMatrix,this.frustum,this._points),(0,_.C)(this._origin,t.eye),(0,_.C)(this._direction,t.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(t){for(let e=0;e<this._points.length;e++)(0,_.C)(this._points[e],t[e]);(0,T.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(t){return(0,T.m7)(this.frustum,t)}intersectsRay(t){return(0,T.pw)(this.frustum,t)}intersectsLineSegment(t,e){return(0,T.ST)(this.frustum,t,e)}intersectsPoint(t){return(0,T.bU)(this.frustum,t)}_updateLines(){const t=this._points;for(let e=0;e<4;e++){const i=e+4;rt(this.lines[e],t[e],t[i]),rt(this.lines[e+4],t[e],3===e?t[0]:t[e+1]),rt(this.lines[e+8],t[i],3===e?t[4]:t[i+1])}}_updateBoundingSphere(){const{origin:t}=this,e=st;(0,_.S8)(e,this.direction);const i=nt;(0,_.jb)(i,this.points[4],t);const r=.5*(0,_.Om)(i,i)/(0,_.Om)(e,i),n=this._boundingSphere,s=(0,_.Ln)(ot,t,e,r);n.center=s,n.radius=r}static{this.planePointIndices=T.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function rt(t,e,i){t.origin=e,t.endpoint=i,(0,_.oW)(t.direction,e,i)}const nt=(0,v.vt)(),st=(0,v.vt)(),ot=(0,v.vt)();i(86211);const at=(0,v.fA)(5802e-9,13558e-9,331e-7),ct=(0,v.fA)(65e-8*3,5643e-9,255e-9);(0,v.fA)(at[0]+ct[0],at[1]+ct[1],at[2]+ct[2]);class ht{constructor(t=1/0,e=-1/0){this.near=t,this.far=e}set(t,e){this.near=t,this.far=e}union(t){return null!=t&&(this.near=Math.min(this.near,t.near),this.far=Math.max(this.far,t.far)),this}within(t){return this.near<=t&&t<=this.far}equals(t){return this.near===t.near&&this.far===t.far}static{this.Zero=new ht(0,0)}static{this.Infinite=new ht}}(0,v.vt)(),(0,v.vt)(),new tt.iy,(0,M.vt)(),new C.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var lt=i(32728);const ut=(0,v.fA)(0,0,1),dt=(0,_.S8)((0,v.vt)(),(0,v.fA)(1,1,1)),ft=(0,g.vt)(),pt=(0,v.vt)(),mt=(0,v.vt)();function gt(t,e,i,r=U()){(0,_.$A)(pt,t,ut),0===(0,_.Om)(pt,pt)&&(0,_.$A)(pt,t,dt),(0,A.$0)(ft,-(0,l.kU)(e),t),(0,A.e$)(ft,ft,-(0,l.kU)(i),pt);const{up:n,direction:s}=r;return(0,_.$A)(n,pt,t),(0,_.S8)(n,n),(0,_.Z0)(n,n,ft),(0,_.S8)(s,t),(0,_.ze)(s,s),(0,_.Z0)(s,s,ft),r}function _t(t){const e=t[1];t[1]=-t[2],t[2]=e}function vt(t,e){const i=gt(e,t.heading,t.tilt);return t.up=i.up,t}function yt(t,e){const{renderCoordsHelper:i,state:r}=t;if(1!==r.viewingMode)return 1;const n=i.getAltitude(e),s=i.referenceEllipsoid.radius,o=1+(0,_.Io)(r.camera.eye,e)/(s+n),a=Math.sqrt(o*o-1),{minCurvature:c,maxCurvature:h,minSamples:u,maxSamples:d}=bt,f=(0,l.qE)((a-c)/(h-c),0,1);return Math.round((0,l.Cc)(u,d,f))}function xt(t,e){const i=[],r=[],n=(0,K.FD)();for(let s=0;s<t.length;s++){const o=t[s],a=s===t.length-1?t[0]:t[s+1],c=(0,F.Cr)(o,a,Et),h=(0,N.vE)(e,c.origin,c.vector,0,St);switch(h){case 2:i.push(o);break;case 3:r.push(o);break;case 0:case 1:{const[t,s,a]=0===h?[1,i,r]:[-1,r,i],c=(0,N.Qj)(e),l=(0,_.Ln)((0,v.vt)(),St,c,t*n),u=(0,_.Ln)((0,v.vt)(),St,c,t*-n);s.push(o),s.push(l),a.push(u)}}}const s=[];return i.length&&s.push(i),r.length&&s.push(r),s}const bt={minCurvature:(0,l.kU)(5),maxCurvature:(0,l.kU)(50),minSamples:1,maxSamples:6},wt=(0,v.fA)(1,0,0),Tt=(0,v.fA)(0,1,0),Mt=(0,v.vt)(),At=(0,v.vt)(),St=(0,v.vt)(),Ct=new tt.iy,Et=(0,F.vt)(),Rt=(0,Y.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){const n=pt,s=mt;return(0,_.S8)(n,t),(0,_.$A)(mt,n,ut),0===(0,_.Om)(mt,mt)&&(0,_.$A)(mt,n,dt),(0,_.$A)(s,mt,n),H(e,i,r,n,s)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n={eye:(0,v.vt)(),up:null,tilt:r,heading:i},s=pt;s[0]=t[0],s[1]=t[2],s[2]=-t[1];const o=e,a=(0,l.kU)(i),c=(0,l.kU)(r),h=Math.sin(a),u=Math.cos(a),d=Math.sin(c),f=Math.cos(c),p=(0,_.Bw)(s);let m;if(Math.abs(c)<1e-8)m=o+p;else{const t=p/d,e=(0,l.YN)(o/t),i=Math.PI-c-e;m=t*Math.sin(i)}const g=f*o,y=o*o*(d*d),x=u*u*y,b=m-g,w=b*b,T=x*(x+w-s[1]*s[1]);if(T<0)return(0,_.hs)(n.eye,s,m/p),n.tilt=0,vt(n,t);const M=Math.sqrt(T),A=s[1]*b,S=x+w;let C;if(C=u>0?-M+A:M+A,Math.abs(S)<1e-8)return p<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=o):(0,_.hs)(n.eye,s,m/p),n.tilt=0,_t(n.eye),vt(n,t);n.eye[1]=C/S;const E=h*h*y,R=d*o,I=u*R*n.eye[1],D=n.eye[1]*n.eye[1],O=1-D,P=Math.sqrt(O),F=x*D+E-2*I*P*b+O*w;return Math.abs(F)<1e-8?((0,_.hs)(n.eye,s,m/p),n.tilt=0,_t(n.eye),vt(n,t)):(n.eye[0]=(O*(m*s[0]-g*s[0])-R*P*(s[0]*n.eye[1]*u+s[2]*h))/F,n.eye[2]=(O*(m*s[2]-g*s[2])-R*P*(s[2]*n.eye[1]*u-s[0]*h))/F,(0,_.hs)(n.eye,n.eye,m),_t(n.eye),vt(n,t))},eyeTiltToLookAtTilt:function(t,e,i){const r=(0,l.kU)(t),n=(0,_.Bw)(e);return(0,l.YN)(i/(n/Math.sin(r)))+r},getCurvatureSamples:yt,headingTiltToDirectionUp:gt,lookAtTiltToEyeTilt:function(t,e,i){const r=(0,_.Bw)(e),n=Math.sqrt(i*i+r*r-2*i*r*Math.cos(Math.PI-t)),s=(0,l.YN)(i/(n/Math.sin(t)));return(0,l.KJ)(t-s)},toArea:function(t,e){const{renderCoordsHelper:i}=t,r=t.state.camera.clone(),n=new it(i);r.near=2,n.update(r);const s=i.getAltitude(e),o=t.spatialReference,a=r.eye,c=function(t){const{renderCoordsHelper:e,state:i}=t,r=Math.abs(e.getAltitude(i.camera.center));return Ct.radius=e.referenceEllipsoid.radius+r,i.camera.sphereFrustumCoverage(Ct,e)}(t),h=yt(t,e),u=r.aboveGround,d=n.planes[5],f=[],p=(0,N.O_)(v.uY,wt,(0,N.vt)()),m=(0,N.O_)(v.uY,Tt,(0,N.vt)());(0,Q.hZ)(Rt,0,0,0,0);const g=t=>{};for(let t=0;t<4;t++){const e=1===t&&!u||3===t&&u?1-c:0,r=1===t&&u||3===t&&!u?c:1,o=n.lines[t],y=n.lines[3===t?0:t+1];for(let n=0;n<h;n++){const c=n/h,u=0===n?0:(0,l.Cc)(e,r,1===t?1-(1-c)**2:3===t?c**2:c),x=(0,_.Cc)(At,o.origin,y.origin,u),b=(0,lt.nu)(o.direction,y.direction,u,Mt);i.intersectManifoldClosestSilhouette((0,M.LV)(x,b),s,St),V(St,a,St,d),f.push((0,v.o8)(St)),0!==f.length&&g((0,_.lo)(f.at(-1),St));const w=((0,N.Tj)(p,St)?1:0)|((0,N.Tj)(m,St)?2:0);Rt[w]=1}}f.length>2&&(0,_.lo)(f[0],f.at(-1));const y=function(t,e,i){const r=2*(0,K.FD)();return t.map(t=>{const n=[];let s=!1;for(const o of t)e.fromRenderCoords(o,St,i),Math.abs(o[0])<r&&Math.abs(o[1])<r?(n.push([null,St[1]]),n.push([null,St[1]]),s=!0):n.push([St[0],St[1]]);if(s)for(let t=0;t<n.length;t++){const e=n[t];if(null!=e[0])continue;const i=n[t+1],r=n.at(0===t?-1:t-1);e[0]=r[0],t++;const s=n.at(t===n.length-1?0:t+1);i[0]=s[0]}return n.push(n[0]),(0,R.$3)(n)||n.reverse(),n})}((0,Q.m3)(Rt)>1?function(t,e){const i=[];for(const r of t)i.push(...xt(r,e));return i}(xt(f,p),m):[f],i,o);return new E.A({rings:y,spatialReference:o})},toExtent:function(t,e,i,r,n){let s,o,a,h;const u=e.latitude,d=(0,w.tO)(t.spatialReference).radius,f=e.longitude,p=function(t,e,i){const r=e/i,n=(0,l.kU)(t),s=Math.sin(r/2),o=Math.cos(n),a=2*(0,l.YN)(Math.sqrt(s*s/(o*o)));return(0,l.KJ)(a)}(u,i,d)/2;s=f-p,o=f+p;const m=(0,l.kU)(u),g=(1+Math.sin(m))/(1-Math.sin(m)),_=(g+1)*Math.tan(r/d/2),v=_*_;function x(t){const e=Math.PI/2;return(t=c.uC.normalize(t,-e))>e&&(t=Math.PI-t),t}if(a=1.5*Math.PI-2*Math.atan(.5*(_+Math.sqrt(4*g+v))),h=a+r/d,a=x(a),h=x(h),h<a){const t=h;h=a,a=t}if(a=Math.max((0,l.KJ)(a),-90),h=Math.min((0,l.KJ)(h),90),o=J.Y_.monotonic(s,o),o-s>180){const t=(o-s-180)/2;s+=t,o-=t}const b=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:y.A.WGS84;return n?(n.xmin=s,n.ymin=a,n.xmax=o,n.ymax=h,n.spatialReference=b):n=new C.A(s,a,o,h,b),t.spatialReference&&t.spatialReference.isWebMercator&&(0,et.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const It={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},Dt=[It.FINAL,It.COMPOSITE,It.OPAQUE,It.TRANSPARENT],Ot={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",TRANSPARENT_NO_DEPTH:"transparent-no-depth",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",TRANSPARENT_ENVIRONMENT:"transparent-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOWMAP:"shadowmap",SHADOW_HIGHLIGHT:"shadow-highlight",VOXEL:"voxel",VIEWSHED:"viewshed",OBJECT_AND_LAYER_ID_COLOR:"olid"};Array.from(Object.values(Ot)).concat(Dt),(0,v.vt)()},91712(t,e,i){i.d(e,{A:()=>A});var r=i(5482),n=i(69622),s=i(53966),o=i(34727),a=i(90629),c=i(91429),h=i(58083),l=i(9093),u=i(37585),d=i(48163),f=i(35522),p=i(51850),m=i(78955),g=i(91829),_=i(82919),v=i(71351),y=i(44280);function x(t,e,i){t.worldUpAtPosition(e,b),(0,f.Re)(w,i,e);const r=(0,f.Bw)(w);return 0===r?0:(0,o.XM)((0,f.Om)(w,b)/r)}const b=(0,p.vt)(),w=(0,p.vt)();var T;let M=T=class extends n.A{constructor(t){super(t),this._ray=(0,v.vt)(),this._viewport=(0,g.fA)(0,0,1,1),this._padding=(0,g.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,d.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,l.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,l.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,l.vt)(),this._frustumDirty=!0,this._frustum=(0,_.vt)(),this._fullViewport=(0,g.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,p.vt)(),this._up=(0,p.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get rows(){return this._rows}set rows(t){this._rows=Math.max(1,t)}get columns(){return this._columns}set columns(t){this._columns=Math.max(1,t)}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin,"eye")}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return(0,f.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){(0,h.C)(this._viewMatrix,t),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get inverseViewMatrix(){return(0,h.Qw)((0,l.vt)(),this.viewMatrix)||this._get("inverseViewMatrix")||(0,l.vt)()}get viewForward(){return this._ensureViewClean(),(0,f.hZ)((0,p.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,f.hZ)((0,p.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,f.hZ)((0,p.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=(0,m.hs)((0,g.vt)(),this._viewport,1/this.pixelRatio),e=this._get("screenViewport");return e&&(0,m.aI)(t,e)?e:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=(0,m.hs)((0,g.vt)(),this._padding,1/this.pixelRatio),e=this._get("screenPadding");return e&&(0,m.aI)(t,e)?e:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[3],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[2],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(t){this.width=t-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(t){this.height=t-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){(0,m.t2)(this._padding,t)||(this._viewport[0]+=t[3]-this._padding[3],this._viewport[1]+=t[2]-this._padding[2],this._viewport[2]-=t[1]+t[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=t[0]+t[2]-(this._padding[0]+this._padding[2]),(0,m.C)(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,h.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,h.B8)((0,l.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,l.vt)()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(e*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovX(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/e)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(i*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovY(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/i)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,f.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,h.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,h.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const{near:e,far:i}=this;return 2*e*i/(i+e-t*(i-e))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const t=this.width,e=this.height,i=this.near*Math.tan(this.fovY/2)*2,r=i*this._aspect,n=i/this.rows,s=r/this.columns,o=-r/2+this.column*s,a=o+s,c=-i/2+this.row*n,u=c+n,d=(0,h.$h)((0,l.vt)(),o*(1+2*this._padding[3]/t),a*(1+2*this._padding[1]/t),c*(1+2*this._padding[2]/e),u*(1+2*this._padding[0]/e),this.near,this.far),f=this._get("projectionMatrix");return f&&(0,h.t2)(f,d)?f:d}copyFrom(t){(0,f.C)(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,(0,m.C)(this._viewport,t.viewport),this.notifyChange("_viewport"),(0,m.C)(this._padding,t.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.row=t.row,this.column=t.column,this.rows=t.rows,this.columns=t.columns,this.relativeElevation=t.relativeElevation;const e=t;return this._viewDirty=e._viewDirty,this._viewDirty||((0,h.C)(this._viewMatrix,t.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=e._frustumDirty,this._frustumDirty||((0,_.C)(this._frustum,t.frustum),this._frustumDirty=!1),e._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,h.C)(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,m.C)(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up,this.fov=t.fov}clone(){return(new T).copyFrom(this)}equals(t){return(0,f.t2)(this.eye,t.eye)&&(0,f.t2)(this.center,t.center)&&(0,f.t2)(this.up,t.up)&&(0,m.t2)(this._viewport,t.viewport)&&(0,m.t2)(this._padding,t.padding)&&(0,u.t2)(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation&&this.row===t.row&&this.column===t.column&&this.rows===t.rows&&this.columns===t.columns}equalsView(t){return(0,f.t2)(this.eye,t.eye)&&(0,f.t2)(this.center,t.center)&&(0,f.t2)(this.up,t.up)&&this._fov===t.fov}almostEquals(t){const e=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||(0,m.hG)(t.screenPadding,this.screenPadding)>=e||(0,m.hG)(this.screenViewport,t.screenViewport)>=e||this.row!==t.row||this.column!==t.column||this.rows!==t.rows||this.columns!==t.columns)return!1;(0,f.jb)(E,t.eye,t.center),(0,f.jb)(R,this.eye,this.center);const i=(0,f.Om)(E,R),r=(0,f.uE)(E),n=(0,f.uE)(R),s=5e-4;return i*i>=(1-1e-10)*r*n&&(0,f.lo)(t.eye,this.eye)<Math.max(r,n)*s*s}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs((0,y.gr)(this.viewForward,(0,f.Re)(E,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,e){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(e||1)))}getScreenCenter(t=(0,a.gs)()){return t[0]=(this.padding[3]+this.width/2)/this.pixelRatio,t[1]=(this.padding[0]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,e=.5,i=.5){return t[0]=this.padding[3]+this.width*e,t[1]=this.padding[2]+this.height*i,t[2]=.5,t}setGLViewport(t){const e=this.viewport,i=this.padding;t.setViewport(e[0]-i[3],e[1]-i[2],e[2]+i[1]+i[3],e[3]+i[0]+i[2])}applyProjection(t,e){t!==S&&(0,f.C)(S,t),S[3]=1,(0,m.Z0)(S,S,this.projectionMatrix);const i=Math.abs(S[3]);(0,f.hs)(S,S,1/i);const r=this.fullViewport;e[0]=(0,o.Cc)(0,r[0]+r[2],.5+.5*S[0]),e[1]=(0,o.Cc)(0,r[1]+r[3],.5+.5*S[1]),e[2]=.5*(S[2]+1),e[3]=i}unapplyProjection(t,e){const i=this.fullViewport;S[0]=(t[0]/(i[0]+i[2])*2-1)*t[3],S[1]=(t[1]/(i[1]+i[3])*2-1)*t[3],S[2]=(2*t[2]-1)*t[3],S[3]=t[3],null!=this.inverseProjectionMatrix&&((0,m.Z0)(S,S,this.inverseProjectionMatrix),e[0]=S[0],e[1]=S[1],e[2]=S[2])}projectToScreen(t,e){return null==this.projectToRenderScreen(t,I)?null:(this.renderToScreen(I,e),e)}projectToRenderScreen(t,e){if(S[0]=t[0],S[1]=t[1],S[2]=t[2],S[3]=1,(0,m.Z0)(S,S,this.viewProjectionMatrix),0===S[3])return null;const i=S;(0,f.hs)(i,i,1/Math.abs(S[3]));const r=this.fullViewport,n=(0,o.Cc)(0,r[0]+r[2],.5+.5*i[0]),s=(0,o.Cc)(0,r[1]+r[3],.5+.5*i[1]);return"x"in e?(e.x=n,e.y=s):(e[0]=n,e[1]=s,e.length>2&&(e[2]=.5*(i[2]+1))),e}unprojectFromScreen(t,e){return this.unprojectFromRenderScreen(this.screenToRender(t,I),e)}unprojectFromRenderScreen(t,e){if((0,h.lw)(C,this.projectionMatrix,this.viewMatrix),!(0,h.B8)(C,C))return null;const i=this.fullViewport;return S[0]=2*(t[0]-i[0])/i[2]-1,S[1]=2*(t[1]-i[1])/i[3]-1,S[2]=2*t[2]-1,S[3]=1,(0,m.Z0)(S,S,C),0===S[3]?null:(e[0]=S[0]/S[3],e[1]=S[1]/S[3],e[2]=S[2]/S[3],e)}constrainWindowSize(t,e,i,r){const n=t*this.pixelRatio,s=e*this.pixelRatio,o=Math.max(n-i/2,0),a=Math.max(this.fullHeight-s-r/2,0),c=-Math.min(n-i/2,0),h=-Math.min(this.fullHeight-s-r/2,0),l=i-c- -Math.min(this.fullWidth-n-i/2,0),u=r-h- -Math.min(s-r/2,0);return[Math.round(o),Math.round(a),Math.round(l),Math.round(u)]}computeUp(t){1===t?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,e){const i=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return e[0]=i,e[1]=r,e}renderToScreen(t,e){const i=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;e[0]=i,e[1]=r}sphereFrustumCoverage(t,e){const{center:i,eye:r,distance:n,fovY:s}=this,o=Math.abs(Math.PI/2-x(e,i,r));return t.frustumCoverage(o,n,s)}_computeUpGlobal(){(0,f.Re)(E,this.center,this.eye);const t=(0,f.Bw)(this.center);t<1?(0,f.t2)(this._up,p.Cb)&&((0,f.C)(this._up,p.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,f.Om)(E,this.center))>.9999*(0,f.Bw)(E)*t||((0,f.$A)(R,E,this.center),(0,f.$A)(R,R,E),(0,f.S8)(R,R),(0,f.t2)(this._up,R)||((0,f.C)(this._up,R),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,f.oW)(E,this.eye,this.center),Math.abs(E[2])<=.9999&&((0,f.hs)(E,E,E[2]),(0,f.hZ)(E,-E[0],-E[1],1-E[2]),(0,f.S8)(E,E),(0,f.t2)(this._up,E)||((0,f.C)(this._up,E),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(t,e,i){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?(0,f.t2)(t,e)||((0,f.C)(e,t),this._markViewDirty(),this.notifyChange(i)):s.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,_.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,h.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewport",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_padding",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_fov",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_nearFar",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewDirty",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewMatrix",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_pixelRatio",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"pixelRatio",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"row",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"column",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_rows",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"rows",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_columns",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"columns",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"eye",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"center",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_center",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"up",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_up",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"inverseViewMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewForward",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewUp",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewRight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"nearFar",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"near",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"far",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"screenViewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"screenPadding",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"x",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"y",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"width",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"height",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fullWidth",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fullHeight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"_aspect",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"padding",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"projectionMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"inverseProjectionMatrix",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fov",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fovX",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fovY",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewInverseTransposeMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"_projectionMatrixInternal",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"relativeElevation",void 0),M=T=(0,r.Cg)([(0,c.$K)("esri.views.3d.webgl.RenderCamera")],M);const A=M,S=(0,g.vt)(),C=(0,l.vt)(),E=(0,p.vt)(),R=(0,p.vt)(),I=(0,a.r_)()},78607(t,e,i){i.d(e,{A:()=>O});var r=i(5482),n=i(69622),s=i(49186),o=i(36708),a=i(10107),c=i(64108),h=i(63666),l=i(44208),u=i(53966),d=(i(17676),i(94656)),f=i(63907);i(93637),i(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,l.A)("esri-tests-disable-gpu-memory-measurements"),(0,d.en)();(0,d.en)();i(90644);var p=i(21231),m=i(97768),g=i(48852),_=i(42293);const v=!!(0,l.A)("esri-tests-disable-gpu-memory-measurements");class y{constructor(t,e){this._context=t,this._descriptor=e,this.type=2,this._context.instanceCounter.increment(f.vt.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:r,height:n,internalFormat:s,multisampled:o}=e;o?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,s,r,n):i.renderbufferStorage(i.RENDERBUFFER,s,r,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const t=this._descriptor.samples,e=this._context.parameters.maxSamples;return t?Math.min(t,e):e}get usedMemory(){return v?0:(t=this._descriptor).width<=0||t.height<=0||null==t.internalFormat?0:t.width*t.height*(0,_.MW)(t.internalFormat);var t}resize(t,e){const i=this._descriptor;if(i.width===t&&i.height===e)return;i.width=t,i.height=e;const r=this._context.gl;this._context.bindRenderbuffer(this),i.multisampled?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,i.internalFormat,i.width,i.height):r.renderbufferStorage(r.RENDERBUFFER,i.internalFormat,i.width,i.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(f.vt.Renderbuffer,this),this._context=null)}}class x{constructor(t,e,i){if(this._context=t,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,t.instanceCounter.increment(f.vt.FramebufferObject,this),null!=e){const i=function(t,e){return b(e)||w(e)?e:T(e)?new p.A(t,e):function(t){return 3===M(t)||null!=t&&"samples"in t}(e)?new y(t,e):null}(t,e);null!=i&&(this._colorAttachments.set(36064,i),b(i)?this._validateTextureDescriptor(i.descriptor):this._validateRenderbufferDescriptor(i.descriptor)),this._validateColorAttachmentPoint(36064)}if(null!=i)if(function(t){return b(t)||T(t)}(i))this._depthStencilTexture=b(i)?i:new p.A(t,i),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=w(i)?i:new y(t,i);this._depthStencilBuffer=e,this._validateRenderbufferDescriptor(e.descriptor)}}get glName(){return this._glName}get colorTexture(){const t=this._colorAttachments.get(36064);return b(t)?t:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const t=this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.width??0}get height(){const t=this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.height??0}get usedMemory(){return this._colorAttachments.values().reduce((t,e)=>t+e.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(t){this._level!==t&&(this._level=t,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&b(e)?e:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(t,e=36064){if(!t)return;this._validateColorAttachmentPoint(e);const{descriptor:i}=t;this._validateTextureDescriptor(i),this.detachColorTexture(e)?.dispose(),this._colorAttachments.set(e,t),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e))}detachColorTexture(t=36064){const e=this._colorAttachments.get(t);if(!e)return;const i=b(e);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(i)this._framebufferTexture2D(null,t);else{const e=this._context.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}}),this._colorAttachments.delete(t),i?e:void 0}detachColorTextures(...t){if(0!==t.length){if(this._glName){const e=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{t.forEach(t=>{b(this._colorAttachments.get(t))?this._framebufferTexture2D(null,t):e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)})})}t.forEach(t=>this._colorAttachments.delete(t))}}setColorTextureTarget(t,e=36064,i=0){const r=this._colorAttachments.get(e);r&&(35866===t?this._framebufferTextureLayer(r.glName,e,36160,i):this._framebufferTexture2D(r.glName,e,t,36160))}attachDepthStencil(t){if(t)switch(t.type){case 1:return this._attachDepthStencilTexture(t);case 2:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(null==t)return;const{descriptor:e}=t,{pixelFormat:i,dataType:r}=e;34041===i||6402===i?34041!==i||r===f.ld.UNSIGNED_INT_24_8?6402!==i||r===f.ld.UNSIGNED_INT||r===f.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,C(i))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,C(t.descriptor.pixelFormat))}),this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(null==t)return;const e=t.descriptor;if(this._validateRenderbufferDescriptor(e),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);const{gl:i}=this._context,r=this._getGLAttachmentPoint(e);i.framebufferRenderbuffer(36160,r,i.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._glName){const{_context:e}=this,i=e.boundFramebuffer;e.bindFramebuffer(this);const{gl:r}=e,n=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(36160,n,r.RENDERBUFFER,null),e.bindFramebuffer(i)}return this._depthStencilBuffer=null,t}invalidateAttachments(t){const{_context:e}=this;e.temporaryBindFramebuffer(this,()=>e.gl.invalidateFramebuffer(36160,t),!0)}copyToTexture(t,e,i,r,n,s,o){(t<0||e<0||n<0||s<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");const a=o.descriptor;3553!==o.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==a?.width||null==a?.height||t+i>this.width||e+r>this.height||n+i>a.width||s+r>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,h=c.bindTexture(o,p.A.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(p.A.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,n,s,t,e,i,r),c.bindTexture(h,p.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,n,s,o){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),o||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,i,r,n,s,o)}async readPixelsAsync(t,e,i,r,n,s,o,a){const{gl:c}=this._context,h=g.g.createPixelPack(this._context,35041,o.byteLength);this._context.bindBuffer(h);const l=this._context.boundFramebuffer;this._context.bindFramebuffer(this),c.readPixels(t,e,i,r,n,s,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(l);try{await h.getSubDataAsync(o,void 0,void 0,void 0,a)}finally{h.dispose()}}resize(t,e){if(this.width===t&&this.height===e)return;const i={width:t,height:e};if(A(i,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(t=>t.resize(i.width,i.height)),this._depthStencilTexture?.resize(i.width,i.height),this._glName&&(A(i,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(i.width,i.height),(0,d.en)())){const{gl:t}=this._context;t.checkFramebufferStatus(36160)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(t=36160){const{gl:e}=this._context;this._glName?e.bindFramebuffer(t,this._glName):(this._glName&&e.deleteFramebuffer(this._glName),this._glName=e.createFramebuffer(),e.bindFramebuffer(t,this._glName),this._initializeAttachments(t))}_initializeAttachments(t=36160){const{gl:e}=this._context;if(this._colorAttachments.forEach((e,i)=>{if(b(e)){const r=S(e);35866===r?this._framebufferTextureLayer(e.glName,i,t):this._framebufferTexture2D(e.glName,i,r,t)}else if(w(e)){const r=this._context.gl;r.framebufferRenderbuffer(t,i,r.RENDERBUFFER,e.glName)}}),this._depthStencilBuffer){const i=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,i,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const e=C(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,e,S(this._depthStencilTexture),t)}(0,d.en)()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(t,e=36064,i=3553,r=36160){this._context.gl.framebufferTexture2D(r,e,i,t,this._level)}_framebufferTextureLayer(t,e=36064,i=36160,r=0){this._context.gl.framebufferTextureLayer(i,e,t,this._level,r)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(36160,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=(0,m.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,C(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,m.WD)(this._depthStencilTexture))}_validateTextureDescriptor(t){3553!==t.target&&34067!==t.target&&35866!==t.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),A(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderbufferDescriptor(t){A(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case f.SB.DEPTH_COMPONENT16:case f.SB.DEPTH_COMPONENT24:case f.SB.DEPTH_COMPONENT32F:return 36096;case f.iE.DEPTH24_STENCIL8:case f.iE.DEPTH32F_STENCIL8:return 33306;case 36168:return 36128;default:return 36064}}_validateColorAttachmentPoint(t){if(-1===x._MAX_COLOR_ATTACHMENTS){const{gl:t}=this._context;x._MAX_COLOR_ATTACHMENTS=t.getParameter(t.MAX_COLOR_ATTACHMENTS)}const e=t-36064;e+1>x._MAX_COLOR_ATTACHMENTS&&u.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${x._MAX_COLOR_ATTACHMENTS} color attachments`)}}function b(t){return 1===M(t)}function w(t){return 2===M(t)}function T(t){return 0===M(t)}function M(t){return null!=t&&"type"in t?t.type:null}function A(t,e){const i=Math.max(t.width,t.height);if(i>e){u.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const r=e/i;return t.width=Math.round(t.width*r),t.height=Math.round(t.height*r),!1}return!0}function S(t){return 34067===t.descriptor.target?34069:35866===t.descriptor.target?35866:3553}function C(t){return 6402===t?36096:33306}i(67171),i(79785);var E=i(85079);const R=[new(i(74038)._)("position",2,f.pe.UNSIGNED_SHORT,0,4)];(0,E.Xk)(R),i(66289);const I=new Image;I.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",I.width=5,I.height=5,I.decode();let D=class extends n.A{constructor(t){super(t),this.view=null,this.consumes={required:[]},this.produces=h.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,o.wB)(()=>this.view.ready,t=>{t&&this.view.stage?.renderer.addRenderNode(this)},o.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new s.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const t=this._frameBuffer?.getTexture()?.descriptor,e=this.view.stage.renderer.fboCache.acquire(t?.width??640,t?.height??480,this.produces);return this._bind(e),e}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:t}){var e;t.initializeAndBind(),this.gl.drawBuffers((e=t)?e.colorAttachments.length>0?e.colorAttachments:[0]:[1029])}requestRender(t){switch(t){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(t);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(t){return!!this._dirty&&(this._dirty=!1,!0)}doRender(t){this._frameBuffer=t.find(({name:t})=>t===this.produces);try{return this.render(t)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}queryDepthRange(t){return null}get input(){return this._frameBuffer}};(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"view",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"consumes",void 0),(0,r.Cg)([(0,a.MZ)()],D.prototype,"produces",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],D.prototype,"techniques",null),D=(0,r.Cg)([(0,c.$)("esri.views.3d.webgl.RenderNode")],D);const O=D},37957(t,e,i){const r={create:()=>[0,0,0,0,0,0,0,0,0],copy(t,e){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]}};i.d(e,["P",0,r])},48852(t,e,i){i.d(e,{g:()=>f});var r=i(4576),n=i(44208),s=i(53966),o=i(17676),a=i(78659),c=i(34275),h=i(94656),l=i(63907);const u=()=>s.A.getLogger("esri.views.webgl.BufferObject"),d=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class f{static createIndex(t,e,i){return new f(t,34963,e,i)}static createUniform(t,e,i){return new f(t,35345,e,i)}static createPixelPack(t,e=35041,i){const r=new f(t,35051,e);return i&&r.setSize(i),r}static createPixelUnpack(t,e=35040,i){return new f(t,35052,e,i)}static createTransformFeedback(t,e=35044,i){const r=new f(t,35982,e);return r.setSize(i),r}constructor(t,e,i,r){this._context=t,this.bufferType=e,this.usage=i,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,t.instanceCounter.increment(l.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,h.Y2)(this._context.gl),r&&this.setData(r)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case l.pe.UNSIGNED_INT:return this._sizeBytes/4;case l.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case l.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return d?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(l.vt.BufferObject,this),this._context=null):this._glName&&u().warn("Leaked WebGL buffer object")}setSize(t,e=null){if(34963===this.bufferType&&null!=e)switch(this._indexType=e,e){case l.pe.UNSIGNED_SHORT:t*=2;break;case l.pe.UNSIGNED_INT:t*=4;case l.pe.UNSIGNED_BYTE:}this._setBufferData(t)}setData(t){if(!t)return;const e=t.byteLength;34963===this.bufferType&&((0,c.mg)(t)?this._indexType=l.pe.UNSIGNED_BYTE:(0,c.jq)(t)?this._indexType=l.pe.UNSIGNED_SHORT:(0,c.XJ)(t)&&(this._indexType=l.pe.UNSIGNED_INT)),this._setBufferData(e,t)}setIndexType(t){34963===this.bufferType&&(this._indexType=t)}_setBufferData(t,e=null){this._sizeBytes=t;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const r=this._context.gl;null!=e?r.bufferData(this.bufferType,e,this.usage):r.bufferData(this.bufferType,t,this.usage),(0,h.Y2)(r),this._isVAOAware&&this._context.bindVAO(i)}setSubData(t,e,i,r){if(!t)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:s}=this._context;s.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,t,i,r-i),(0,h.Y2)(s),this._isVAOAware&&this._context.bindVAO(n)}getSubData(t,e=0,i,n){if(i<0||n<0)return;const s=function(t){return(0,r.Xj)(t)}(t)?t.BYTES_PER_ELEMENT:1;if(s*((i??0)+(n??0))>t.byteLength)return;e+s*(n??0)>this.usedMemory&&u().warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),o.getBufferSubData(35982,e,t,i,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),o.getBufferSubData(36662,e,t,i,n),this._context.unbindBuffer(36662))}async getSubDataAsync(t,e=0,i,r,n){if(await this._context.clientWaitAsync((0,a.l5)(10),n),!this._context||!this._glName)throw(0,o.NK)();this.getSubData(t,e,i,r)}}},14113(t,e,i){i.d(e,{Cy:()=>u,N5:()=>a});var r=i(49186),n=(i(44208),i(53966));const s=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class o{constructor(){this._includedModules=new Map}include(t,e){this._includedModules.has(t)?this._includedModules.get(t):(this._includedModules.set(t,e),t(this.builder,e))}}class a extends o{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new f,this.varyings=new p,this.outputs=new m}get attributeNames(){return this.attributes.names}get builder(){return this}generate(t,e=!1){const i=this.attributes.generateSource(t),r=this.varyings.generateSource(t),n="vertex"===t?this.vertex:this.fragment,s=n.uniforms.generateSource(),o=n.code.generateSource(),a=n.main.generateSource(e),c=this.debugName?`// ${this.debugName}\n`:"",h="vertex"===t?v:_,l=n.constants.generateSource(),u=this.outputs.generateSource(t);return`#version 300 es\n${c}\n${h}\n${l.join("\n")}\n${s.join("\n")}\n${i.join("\n")}\n${r.join("\n")}\n${u.join("\n")}\n${o.join("\n")}\n${a.join("\n")}`}generateBind(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return e=>{for(let n=0;n<r;++n)i[n](t,e)}}generateBindPass(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n)=>{for(let s=0;s<r;++s)i[s](t,n,e)}}generateBindDraw(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n,s)=>{for(let o=0;o<r;++o)i[o](t,s,e,n)}}}class c{constructor(t){this._stage=t,this._entries=new Map}add(...t){for(const e of t)this._add(e);return this._stage}get(t){return this._entries.get(t)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new r.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else s().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:t,arraySize:e,type:i})=>null!=e?`uniform ${i} ${t}[${e}];`:`uniform ${i} ${t};`)}get entries(){return Array.from(this._entries.values())}}class h{constructor(){this._entries=new Map}add(t,e){if(this._entries.has(t))throw new r.A("shaderbuilder:duplicate-input",`Duplicate input for ${t}`);this._entries.set(t,e)}get(t){const e=this._entries.get(t);if(null==e)throw new r.A("shaderbuilder:input-resolver-error",`No resolver for input ${t} found.`);return e()}}class l{constructor(t){this._stage=t,this._bodies=new Array}add(t){return this._bodies.push(t),this._stage}generateSource(t){if(this._bodies.length>0){const t=[];for(const e of this._bodies)"string"==typeof e?t.push(e):t.push(...e());return[`void main() {\n ${t.join("\n")||""} \n}`]}if(t)throw new r.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(t){this._stage=t,this._entries=new Array}add(t){return this._entries.push(t),this._stage}generateSource(){const t=[];for(const e of this._entries)"string"==typeof e?t.push(e):t.push(...e());return t}}class d extends o{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new u(this),this.constants=new g(this),this.inputs=new h}get builder(){return this}}class f{constructor(){this._entries=new Array}add(t,e){this._entries.push([t,e])}generateSource(t){return"fragment"===t?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}get names(){return this._entries.map(([t])=>t)}}class p{constructor(){this._entries=new Map}add(t,e,i){this._entries.has(t)?s().warn(`Ignoring duplicate varying ${e} ${t}`):this._entries.set(t,{type:e,invariant:i?.invariant??!1})}generateSource(t){const e=new Array;return this._entries.forEach((i,r)=>e.push((i.invariant&&"vertex"===t?"invariant ":"")+("int"===i.type?"flat ":"")+("vertex"===t?"out":"in")+` ${i.type} ${r};`)),e}}class m{constructor(){this._entries=new Map}add(t,e,i=0){const r=this._entries.get(i);r?.name!==t||r?.type!==e?this._entries.set(i,{name:t,type:e}):s().warn(`Fragment shader output location ${i} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(t){if("vertex"===t)return[];0===this._entries.size&&this._entries.set(0,{name:m.DEFAULT_NAME,type:m.DEFAULT_TYPE});const e=new Array;return this._entries.forEach((t,i)=>e.push(`layout(location = ${i}) out ${t.type} ${t.name};`)),e}}class g{constructor(t){this._stage=t,this._entries=new Set}add(t,e,i){let r="ERROR_CONSTRUCTOR_STRING";switch(e){case"float":r=g._numberToFloatStr(i);break;case"int":r=g._numberToIntStr(i);break;case"uint":r=g._numberToUintStr(i);break;case"bool":r=i.toString();break;case"vec2":r=`vec2(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])})`;break;case"vec3":r=`vec3(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])})`;break;case"vec4":r=`vec4(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])}, ${g._numberToFloatStr(i[3])})`;break;case"ivec2":r=`ivec2(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])})`;break;case"ivec3":r=`ivec3(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])})`;break;case"ivec4":r=`ivec4(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])}, ${g._numberToIntStr(i[3])})`;break;case"uvec2":r=`uvec2(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])})`;break;case"uvec3":r=`uvec3(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])})`;break;case"uvec4":r=`uvec4(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])}, ${g._numberToUintStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":r=`${e}(${Array.prototype.map.call(i,t=>g._numberToFloatStr(t)).join(", ")})`}return this._entries.add(`const ${e} ${t} = ${r};`),this._stage}static _numberToIntStr(t){return t.toFixed(0)}static _numberToUintStr(t){return`${t.toFixed(0)}u`}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",v="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},21231(t,e,i){i.d(e,{A:()=>g});var r=i(49186),n=i(44208),s=i(53966),o=i(97768),a=i(93637),c=i(17676),h=i(94656),l=i(63907),u=i(67171),d=i(12541);class f extends u.R{constructor(t,e){switch(super(),this.context=t,Object.assign(this,e),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=6403;break;case l.H0.R8I:case l.H0.R8UI:case l.H0.R16I:case l.H0.R16UI:case l.H0.R32I:case l.H0.R32UI:this.pixelFormat=36244}}static validate(t,e){return new f(t,e)}}const p=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),m=()=>s.A.getLogger("esri/views/webgl/Texture");class g{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(t,e=null,i=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in t)this._descriptor=t,i=e;else{const i=f.validate(t,e);if(!i)throw new r.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=i}34067===this._descriptor.target?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return p?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(t,e){const i=this._descriptor;if(i.width!==t||i.height!==e){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-resize","Immutable textures can't be resized!");i.width=t,i.height=e,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!(0,d.Qp)(t)&&this._descriptor.internalFormat&&(0,a.a4)(l.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!(0,d.Qp)(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(t,e,i,n,s,o,a=0){o||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=(0,d.mq)(c);const{context:h,pixelFormat:l,dataType:u,target:f,isImmutable:p}=c;if(p&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");const _=h.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES,!0);(e<0||i<0||e+n>c.width||i+s>c.height)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:v}=h;a&&(n&&s||m().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),v.pixelStorei(v.UNPACK_SKIP_ROWS,a)),(0,d.Kv)(o)?v.texSubImage2D(f,t,e,i,n,s,l,u,o):(0,d.Qp)(o)?v.compressedTexSubImage2D(f,t,e,i,n,s,c.internalFormat,o.levels[t]):v.texSubImage2D(f,t,e,i,n,s,l,u,o),a&&v.pixelStorei(v.UNPACK_SKIP_ROWS,0),h.bindTexture(_,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,e,i,n,s,o,a,c){c||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update an uninitialized texture!");const h=this._descriptor;h.internalFormat=(0,d.mq)(h);const{context:l,pixelFormat:u,dataType:f,isImmutable:p,target:_}=h;if(p&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");(0,d.re)(_)||m().warn("Attempting to set 3D texture data on a non-3D texture");const v=l.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),(e<0||i<0||n<0||e+s>h.width||i+o>h.height||n+a>h.depth)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:y}=l;if((0,d.Qp)(c))c=c.levels[t],y.compressedTexSubImage3D(_,t,e,i,n,s,o,a,h.internalFormat,c);else{const r=c;y.texSubImage3D(_,t,e,i,n,s,o,a,u,f,r)}l.bindTexture(v,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,(0,d.QE)(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const e=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(e,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const t=this._descriptor;if(t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");t.hasMipmap=!1,this._samplingModeDirty=!0,(0,d.QE)(t)}9985===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9729):9984===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,(0,d.QE)(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),(0,d.QE)(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,o.DC)(this._compressionAbortController)}_setData(t,e){const i=this._descriptor,n=i.context?.gl;if(!n)return;(0,h.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),i.context.instanceCounter.increment(l.vt.Texture,this)),(0,d.QE)(i);const s=i.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);i.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,h.Y2)(n);const o=e??i.target,a=(0,d.re)(o);if((0,d.Kv)(t))this._setDataFromTexImageSource(t,o);else{const{width:e,height:s,depth:c}=i;if(null==e||null==s)throw new r.A("texture:missing-size","Width and height must be specified!");if(a&&null==c)throw new r.A("texture:missing-depth","Depth must be specified!");if(i.internalFormat=(0,d.mq)(i),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(o,i.internalFormat,i.hasMipmap,e,s,c),(0,d.Qp)(t)){if(!(0,d.tl)(i.internalFormat))throw new r.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,i.internalFormat,o)}else this._texImage(o,0,i.internalFormat,e,s,c,t),(0,h.Y2)(n),i.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,h.Y2)(n),i.context.bindTexture(s,g.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=(0,d.mq)(r);const n=(0,d.re)(e),{width:s,height:o,depth:a}=(0,d.Eo)(t);r.width&&r.height,r.width||(r.width=s),r.height||(r.height=o),n&&r.depth,n&&(r.depth=a),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,s,o,a),this._texImage(e,0,r.internalFormat,s,o,a,t),(0,h.Y2)(i),r.hasMipmap&&(this.generateMipmap(),(0,h.Y2)(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:n,height:s,depth:o}=r,a=t.levels,c=(0,d.FV)(i,n,s,o),h=Math.min(c,a.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,h),this._forEachMipmapLevel((t,r,n,s)=>{const o=a[Math.min(t,a.length-1)];this._compressedTexImage(i,t,e,r,n,s,o)},h)}_texStorage(t,e,i,n,s,o){const{gl:a}=this._descriptor.context;if(!(0,d.tr)(e)&&!(0,d.tl)(e))throw new r.A("texture:missing-format","Immutable textures must have a sized or compressed internal format");if(!this._descriptor.isImmutable)return;const c=i?(0,d.FV)(t,n,s,o):1;if((0,d.re)(t)){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(t,c,e,n,s,o)}else a.texStorage2D(t,c,e,n,s);this._wasImmutablyAllocated=!0}_texImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t),{isImmutable:l,pixelFormat:u,dataType:f}=this._descriptor;if(l){if(null!=a){const i=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(t,e,0,0,0,n,s,o,u,f,i)}else c.texSubImage2D(t,e,0,0,n,s,u,f,i)}}else{const l=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(t,e,i,n,s,o,0,u,f,l)}else c.texImage2D(t,e,i,n,s,0,u,f,l)}}_compressedTexImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t);if(this._descriptor.isImmutable){if(null!=a)if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(t,e,0,0,0,n,s,o,i,a)}else c.compressedTexSubImage2D(t,e,0,0,n,s,i,a)}else if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(t,e,i,n,s,o,0,a)}else c.compressedTexImage2D(t,e,i,n,s,0,a)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:n,preMultiplyAlpha:s,hasMipmap:o,compress:a}=this._descriptor;if(!a)return;const{compressionTracker:h,compressionCallback:l,preserveSourceBitmap:u}=a,{compressedTextureETC:d,compressedTextureS3TC:f}=r.capabilities;if(!g.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!d&&!f)return;this.abortCompression();const p=new AbortController;let _;this._compressionAbortController=p,h?.increment();let v=!1,y=!1;try{t instanceof ImageBitmap?u?(_=await createImageBitmap(t),(0,c.Te)(p),y=!0):_=t:t instanceof Uint8Array?(_=t.buffer,v=this.descriptor.flipped):(_=await createImageBitmap(t,{imageOrientation:n?"flipY":"none"}),(0,c.Te)(p),y=!0);const r={data:_,width:e,height:i,needsFlip:v,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:s,isOpaque:this._descriptor.isOpaque,hasMipmap:o,hasETC:!!d,hasS3TC:!!f},a=await g.compressionWorkerHandle.invoke(r,p.signal,1);if((0,c.Te)(p),a.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),l?.(t-this.usedMemory)}}catch(t){(0,c.zf)(t)||m().error("Texture compression failed!")}finally{h?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),y&&_ instanceof ImageBitmap&&_.close()}}_forEachMipmapLevel(t,e=1/0){let{width:i,height:n,depth:s,hasMipmap:o,target:a}=this._descriptor;const c=32879===a;if(null==i||null==n||c&&null==s)throw new r.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let r=0;t(r,i,n,s),o&&(1!==i||1!==n||c&&1!==s)&&!(r>=e);++r)i=Math.max(1,i>>1),n=Math.max(1,n>>1),c&&(s=Math.max(1,s>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),(0,h.Y2)(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;e&&t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}},67171(t,e,i){i.d(e,{R:()=>s,e:()=>o});var r=i(63907),n=i(42293);class s{constructor(t=0,e=t){this.width=t,this.height=e,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=r.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function o(t){return t.width<=0||t.height<=0||t.depth<=0?0:Math.round(t.width*t.height*t.depth*(t.hasMipmap?4/3:1)*(null==t.internalFormat?4:(0,n.MW)(t.internalFormat))*(34067===t.target?6:1))}},42293(t,e,i){i.d(e,{MW:()=>c,wH:()=>a,yu:()=>o});var r=i(94656),n=i(63907);const s=new Set([n.pe.BYTE,n.pe.SHORT,n.pe.INT,n.pe.UNSIGNED_BYTE,n.pe.UNSIGNED_SHORT,n.pe.UNSIGNED_INT]);function o(t,e,i,n=0){const o=t.gl;t.bindBuffer(i);for(const a of i.layout){const i=e.get(a.name);if(null==i){console.warn(`There is no location for vertex attribute '${a.name}' defined.`);continue}const c=n*a.stride;if(a.count<=4)a.integer&&s.has(a.type)?o.vertexAttribIPointer(i,a.count,a.type,a.stride,a.offset+c):o.vertexAttribPointer(i,a.count,a.type,a.normalized,a.stride,a.offset+c),o.enableVertexAttribArray(i),a.divisor>0&&o.vertexAttribDivisor(i,a.divisor);else if(9===a.count)for(let t=0;t<3;t++)o.vertexAttribPointer(i+t,3,a.type,a.normalized,a.stride,a.offset+12*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else if(16===a.count)for(let t=0;t<4;t++)o.vertexAttribPointer(i+t,4,a.type,a.normalized,a.stride,a.offset+16*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count);if((0,r.en)()){const e=(0,r.u1)(t.gl);e&&console.error(`Unable to bind vertex attribute "${a.name}" with baseInstanceOffset ${c}:`,e,a)}}}function a(t){switch(t){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function c(t){switch(t){case 6406:case 6409:case 6403:case 36244:case n.H0.R8:case n.H0.R8I:case n.H0.R8UI:case n.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case n.H0.RGBA4:case n.H0.R16F:case n.H0.R16I:case n.H0.R16UI:case n.H0.RG8:case n.H0.RG8I:case n.H0.RG8UI:case n.H0.RG8_SNORM:case n.H0.RGB565:case n.H0.RGB5_A1:case n.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case n.H0.RGB8:case n.H0.RGB8I:case n.H0.RGB8UI:case n.H0.RGB8_SNORM:case n.H0.SRGB8:case n.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case n.H0.RGBA8:case n.H0.R32F:case n.H0.R11F_G11F_B10F:case n.H0.RG16F:case n.H0.R32I:case n.H0.R32UI:case n.H0.RG16I:case n.H0.RG16UI:case n.H0.RGBA8I:case n.H0.RGBA8UI:case n.H0.RGBA8_SNORM:case n.H0.SRGB8_ALPHA8:case n.H0.RGB9_E5:case n.H0.RGB10_A2UI:case n.H0.RGB10_A2:case n.SB.DEPTH_COMPONENT32F:case n.iE.DEPTH24_STENCIL8:return 4;case n.iE.DEPTH32F_STENCIL8:return 5;case n.H0.RGB16F:case n.H0.RGB16I:case n.H0.RGB16UI:return 6;case n.H0.RG32F:case n.H0.RG32I:case n.H0.RG32UI:case n.H0.RGBA16F:case n.H0.RGBA16I:case n.H0.RGBA16UI:return 8;case n.H0.RGB32F:case n.H0.RGB32I:case n.H0.RGB32UI:return 12;case n.H0.RGBA32F:case n.H0.RGBA32I:case n.H0.RGBA32UI:return 16;case n.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case n.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case n.CQ.COMPRESSED_R11_EAC:case n.CQ.COMPRESSED_SIGNED_R11_EAC:case n.CQ.COMPRESSED_RGB8_ETC2:case n.CQ.COMPRESSED_SRGB8_ETC2:case n.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case n.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case n.CQ.COMPRESSED_RG11_EAC:case n.CQ.COMPRESSED_SIGNED_RG11_EAC:case n.CQ.COMPRESSED_RGBA8_ETC2_EAC:case n.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},79785(t,e,i){i.d(e,{Z:()=>l});var r=i(21818),n=i(53966),s=i(97768),o=i(63907),a=i(42293),c=i(85079);const h=()=>n.A.getLogger("esri.views.webgl.VertexArrayObject");let l=class t{constructor(t,e,i,n,s){this._context=t,this._indexBuffer=i,this._buffers=e instanceof Map?e:new Map([["geometry",e]]),this._baseInstances=null==n?new Map:"number"==typeof n?new Map([["geometry",n]]):n,this.locations=s??(0,r.z)((0,c.Sk)(this._buffers))}get glName(){return this._glName}get context(){return this._context}get buffers(){return(0,r.z)(this._buffers)}buffer(t="geometry"){return this.buffers.get(t)}mutableBuffer(t="geometry"){return this._buffers.get(t)}get indexBuffer(){return this._indexBuffer}getByteLength(t){return this.buffer(t)?.sizeBytes??0}vertexCount(t){const e=this.buffer(t);return e?e.sizeBytes/e.layout[0].stride:0}get usedMemory(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer?.usedMemory??0+145*(this._buffers.size+(this._indexBuffer?1:0)))}dispose(){this._context?(this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=(0,s.WD)(this._indexBuffer),this.disposeVAOOnly()):(this._glName||this._buffers.size>0)&&h().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(o.vt.VertexArrayObject,this)),this._context=null):this._glName&&h().warn("Leaked WebGL VAO")}bind(t=this.locations){const e=this._context.gl;this._glName?e.bindVertexArray(this._glName):(this._context.instanceCounter.increment(o.vt.VertexArrayObject,this),this._glName=e.createVertexArray(),e.bindVertexArray(this._glName),this._bindLayout(t))}_bindLayout(t){const{_buffers:e,_indexBuffer:i}=this;if(e||h().error("Vertex buffer dictionary is empty!"),e.forEach((e,i)=>(0,a.yu)(this._context,t,e,this._baseInstances.get(i)??0)),null!=i){const t=this._context.gl;this._context.gl.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.glName)}}unbind(){this._context.gl.bindVertexArray(null)}shallowCloneWithBaseInstances(e){return new t(this._context,this._buffers,this._indexBuffer,e)}}},66289(t,e,i){i.d(e,{R:()=>n});var r=i(48852);class n extends r.g{constructor(t,e,i,r=35044){super(t,34962,r,i),this.layout=e}}},94656(t,e,i){i.d(e,{Y2:()=>h,en:()=>c,u1:()=>o});var r=i(49186),n=i(44208),s=i(53966);function o(t){switch(t.getError()){case t.NO_ERROR:return null;case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!(0,n.A)("enable-feature:webgl-debug");function c(){return a}function h(t,e=c()){if(e){const e=o(t);if(e){const t=(new Error).stack;s.A.getLogger("esri.views.webgl.checkWebGLError").error(new r.A("webgl-error","WebGL error occurred",{message:e,stack:t}))}}}},28449(t,e,i){function r(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],e[r]=s[0];return e}function n(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],s[1]=t[r]-s[0],e[r]=s[1];return e}i.d(e,{Zo:()=>r,jA:()=>n});const s=new Float32Array(2)},90644(t,e,i){function r(t,e,i=32774,r=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}function n(t,e,i,r,n=32774,s=32774,o=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:r,opRgb:n,opAlpha:s,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}i.d(e,{Ey:()=>x,nk:()=>u,p3:()=>n}),i(4718);const s=r(0,771),o=(r(1,0),r(1,1),r(1,771)),a=n(770,1,771,771),c=n(0,0,768,0),h={face:1029,mode:2305},l={face:1028,mode:2305};function u(t,e,i){return{ref:t,readMask:e,stencilFront:i,stencilBack:i}}function d(t){return T.intern(t)}function f(t){return A.intern(t)}function p(t){return C.intern(t)}function m(t){return R.intern(t)}function g(t){return D.intern(t)}function _(t){return P.intern(t)}function v(t){return N.intern(t)}function y(t){return L.intern(t)}function x(t){return H.intern(t)}class b{constructor(t,e){this._makeKey=t,this._makeRef=e,this._interns=new Map}intern(t){if(!t)return null;const e=this._makeKey(t),i=this._interns;return i.has(e)||i.set(e,this._makeRef(t)),i.get(e)??null}}function w(t){return"["+t.join(",")+"]"}const T=new b(M,t=>({__tag:"Blending",...t}));function M(t){return t?w([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const A=new b(S,t=>({__tag:"Culling",...t}));function S(t){return t?w([t.face,t.mode]):null}const C=new b(E,t=>({__tag:"PolygonOffset",...t}));function E(t){return t?w([t.factor,t.units]):null}const R=new b(I,t=>({__tag:"DepthTest",...t}));function I(t){return t?w([t.func]):null}const D=new b(O,t=>({__tag:"StencilTest",...t}));function O(t){return t?w([t.ref,t.readMask,t.stencilFront.compare,t.stencilFront.fail,t.stencilFront.zFail,t.stencilFront.zPass,t.stencilBack.compare,t.stencilBack.fail,t.stencilBack.zFail,t.stencilBack.zPass]):null}const P=new b(F,t=>({__tag:"DepthWrite",...t}));function F(t){return t?w([t.zNear,t.zFar]):null}const N=new b(B,t=>({__tag:"ColorWrite",...t}));function B(t){return t?w([t.r,t.g,t.b,t.a]):null}const L=new b(U,t=>({__tag:"StencilWrite",...t}));function U(t){return t?w([t.mask]):null}const H=new b(function(t){return t?w([M(t.blending),S(t.culling),E(t.polygonOffset),I(t.depthTest),O(t.stencilTest),F(t.depthWrite),B(t.colorWrite),U(t.stencilWrite)]):null},t=>({blending:d(t.blending),culling:f(t.culling),polygonOffset:p(t.polygonOffset),depthTest:m(t.depthTest),stencilTest:g(t.stencilTest),depthWrite:_(t.depthWrite),colorWrite:v(t.colorWrite),stencilWrite:y(t.stencilWrite)}));i.d(e,["RC",0,o,"T8",0,a,"Uy",0,{zNear:0,zFar:1},"Xt",0,t=>2===t?h:1===t?l:null,"iD",0,s,"kn",0,{r:!0,g:!0,b:!0,a:!0},"uR",0,c])},12541(t,e,i){i.d(e,{CR:()=>l,Eo:()=>v,FV:()=>g,Kv:()=>p,QE:()=>c,QJ:()=>u,Qp:()=>f,mq:()=>_,re:()=>m,tl:()=>d,tr:()=>h});var r=i(49186),n=i(53966),s=i(93637),o=i(63907);const a=()=>n.A.getLogger("esri/views/webgl/textureUtils");function c(t){const{width:e,height:i,depth:r}=t;(null!=e&&e<0||null!=i&&i<0||null!=r&&r<0)&&a().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=t;if(n&&(l(n)||u(n))){const{linearFilterDepth:e,compareEnabled:i,samplingMode:r,hasMipmap:n}=t;n&&a().error("Depth textures cannot have mipmaps"),e?9729!==r&&9728!==r&&a().error("Depth textures cannot sample mipmaps"):(9728!==r&&a().error("Depth textures without filtering must use NEAREST filtering"),i&&a().error("Depth textures without filtering cannot use compare function"))}}function h(t){return function(t){return o.XN.includes(t)}(t)||l(t)||u(t)}function l(t){return(0,s.a4)(o.SB,t)}function u(t){return(0,s.a4)(o.iE,t)}function d(t){return null!=t&&(0,s.a4)(o.CQ,t)}function f(t){return null!=t&&"type"in t&&"compressed"===t.type}function p(t){return null!=t&&!f(t)&&!function(t){return null!=t&&"byteLength"in t}(t)}function m(t){return 32879===t||35866===t}function g(t,e,i,r=1){let n=Math.max(e,i);return 32879===t&&(n=Math.max(n,r)),Math.floor(Math.log2(n))+1}function _(t){if(null!=t.internalFormat)return t.internalFormat;switch(t.dataType){case o.ld.FLOAT:switch(t.pixelFormat){case 6408:return o.H0.RGBA32F;case 6407:return o.H0.RGB32F;default:throw new r.A("texture:unknown-format","Unable to derive format")}case o.ld.UNSIGNED_BYTE:switch(t.pixelFormat){case 6408:return o.H0.RGBA8;case 6407:return o.H0.RGB8}}const{pixelFormat:e}=t;return t.internalFormat=34041===e?o.iE.DEPTH24_STENCIL8:6402===e?o.SB.DEPTH_COMPONENT24:e,t.internalFormat}function v(t){let e="width"in t?t.width:t.codedWidth,i="height"in t?t.height:t.codedHeight;return t instanceof HTMLVideoElement&&(e=t.videoWidth,i=t.videoHeight),{width:e,height:i,depth:1}}},49788(t,e,i){const r=1/255.5,n=1-r;i.d(e,["Q",0,r,"v",0,n])}}]);
|