@arcgis/core 6.0.0-next.41 → 6.0.0-next.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/Camera.js +1 -1
  2. package/arcgisGlobal.d.ts +0 -2
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/075fe33152fd79fe6d72.js +1 -0
  5. package/assets/esri/core/workers/chunks/0d87cb6417672de95d53.js +1 -0
  6. package/assets/esri/core/workers/chunks/11877d4dc97f756e4711.js +1 -0
  7. package/assets/esri/core/workers/chunks/1860104c2b33f68785dd.js +1 -0
  8. package/assets/esri/core/workers/chunks/1980fd7ae1617ef4d19d.js +1 -0
  9. package/assets/esri/core/workers/chunks/{14d81280807a3d3c1b7e.js → 244ffdb91237d1cbade3.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{059cda6f11a91dbc9e28.js → 2690d5fcd9d5ca92ebf6.js} +1 -1
  11. package/assets/esri/core/workers/chunks/348f28d7ab46df878c6f.js +1 -0
  12. package/assets/esri/core/workers/chunks/{8b0efcc30184593a0812.js → 36bafcc29ac133a05558.js} +24 -24
  13. package/assets/esri/core/workers/chunks/36e5f070009b29b7ac3d.js +1 -0
  14. package/assets/esri/core/workers/chunks/39c23a52d7c3e1ee121c.js +1 -0
  15. package/assets/esri/core/workers/chunks/{5504ec9bd9ee4d10af07.js → 3f74c61359b4bd6dcf00.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{6738b3d6bce34a1e8be2.js → 446d172834f8675f1202.js} +1 -1
  17. package/assets/esri/core/workers/chunks/48c6230b8a6d3a8a7906.js +1 -0
  18. package/assets/esri/core/workers/chunks/4c73c493dabe949c2512.js +1 -0
  19. package/assets/esri/core/workers/chunks/{46504fc81f357bc7465a.js → 4d62877f521cc9663535.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{54de7dc0597fc80d7a52.js → 5dea74fe52583e77f3ce.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{1ec772eaa63eb6937231.js → 8140ed6e44c3d8536d3e.js} +1 -1
  22. package/assets/esri/core/workers/chunks/867502158997cb2d6406.js +1 -0
  23. package/assets/esri/core/workers/chunks/8ceb6697e8adbeffe019.js +1 -0
  24. package/assets/esri/core/workers/chunks/8fe22c2370219f25c15b.js +1 -0
  25. package/assets/esri/core/workers/chunks/91586bf29492735e692d.js +1 -0
  26. package/assets/esri/core/workers/chunks/{123541f79be7adff0818.js → a422a801e55fa125546e.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{fd967a9f3cf0e2890dbb.js → a91dc05a6a609d04ed04.js} +1 -1
  28. package/assets/esri/core/workers/chunks/a99c50b4e1c7568210e1.js +1 -0
  29. package/assets/esri/core/workers/chunks/ab48faea5432e2dbd45c.js +1 -0
  30. package/assets/esri/core/workers/chunks/bbddeb1c893ff8bbae5d.js +1 -0
  31. package/assets/esri/core/workers/chunks/bc2e2bdf1194e6e9eb5e.js +1 -0
  32. package/assets/esri/core/workers/chunks/c3ba1a3247e14f6b7b3a.js +1 -0
  33. package/assets/esri/core/workers/chunks/c5d0a034ff31d5954571.js +1 -0
  34. package/assets/esri/core/workers/chunks/{efc1a90742813b55602e.js → c8057b47c7c6c02a0bda.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{b386e921c273de3ac7a5.js → d4c8673ca65df874a7ce.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{947f3a1cad976bba9738.js → d5e251cddd41d643510c.js} +1 -1
  37. package/assets/esri/core/workers/chunks/fbe3a3b9d6c8c0b52f65.js +1 -0
  38. package/assets/esri/core/workers/chunks/fe7184993ef5713d13fb.js +1 -0
  39. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  40. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  41. package/assets/esri/themes/base/_core.scss +0 -2
  42. package/assets/esri/themes/dark/main.css +1 -1
  43. package/assets/esri/themes/light/main.css +1 -1
  44. package/assets/esri/themes/light/view.css +1 -1
  45. package/chunks/lyr3DMain.js +1 -1
  46. package/chunks/lyr3DWorker.js +1 -1
  47. package/config.js +1 -1
  48. package/core/Logger.js +1 -1
  49. package/core/deprecate.js +1 -1
  50. package/core/types.d.ts +0 -5
  51. package/interfaces.d.ts +0 -17
  52. package/kernel.js +1 -1
  53. package/layers/BuildingSceneLayer.js +1 -1
  54. package/layers/ElevationLayer.d.ts +1 -1
  55. package/layers/ElevationLayer.js +1 -1
  56. package/layers/FeatureLayer.js +1 -1
  57. package/layers/GeoRSSLayer.js +1 -1
  58. package/layers/ImageryLayer.js +1 -1
  59. package/layers/ImageryTileLayer.js +1 -1
  60. package/layers/IntegratedMesh3DTilesLayer.d.ts +4 -3
  61. package/layers/IntegratedMeshLayer.d.ts +4 -3
  62. package/layers/IntegratedMeshLayer.js +1 -1
  63. package/layers/KMLLayer.js +1 -1
  64. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  65. package/layers/MapImageLayer.js +1 -1
  66. package/layers/PointCloudLayer.js +1 -1
  67. package/layers/SceneLayer.js +1 -1
  68. package/layers/StreamLayer.js +1 -1
  69. package/layers/SubtypeGroupLayer.js +1 -1
  70. package/layers/TileLayer.js +1 -1
  71. package/layers/VectorTileLayer.js +1 -1
  72. package/layers/WCSLayer.js +1 -1
  73. package/layers/WMSLayer.js +1 -1
  74. package/layers/WMTSLayer.js +1 -1
  75. package/layers/WebTileLayer.js +1 -1
  76. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  77. package/layers/raster/datasets/ImageServerRaster.js +1 -1
  78. package/layers/raster/datasets/RasterFactory.js +1 -1
  79. package/layers/raster/datasets/ZarrRaster.js +2 -0
  80. package/layers/raster/datasets/datasetUtils.js +1 -1
  81. package/layers/raster/datasets/zarrParser.js +2 -0
  82. package/layers/raster/datasets/zarrUtils.js +2 -0
  83. package/layers/raster/formats/pixelRangeUtils.js +1 -1
  84. package/layers/support/SceneModifications.d.ts +1 -3
  85. package/layers/support/SceneModifications.js +1 -1
  86. package/legend/ActiveLayerInfo.js +1 -1
  87. package/package.json +3 -3
  88. package/portal/Portal.js +1 -1
  89. package/support/LayersMixin.d.ts +2 -2
  90. package/symbols/PictureFillSymbol.js +1 -1
  91. package/symbols/PictureMarkerSymbol.js +1 -1
  92. package/symbols/SimpleFillSymbol.js +1 -1
  93. package/symbols/SimpleLineSymbol.js +1 -1
  94. package/symbols/SimpleMarkerSymbol.js +1 -1
  95. package/symbols/Symbol3D.js +1 -1
  96. package/symbols/TextSymbol.js +1 -1
  97. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  98. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  99. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  100. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  101. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  102. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  103. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  104. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  105. package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +2 -0
  106. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  107. package/views/3d/layers/support/createTileBVHForLayer.js +2 -0
  108. package/views/3d/layers/support/tileBoundingVolumeUtils.js +2 -0
  109. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  110. package/views/3d/support/engineContent/line.js +1 -1
  111. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  112. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  113. package/views/3d/support/gaussianSplatting/GaussianSplatSortCoordinator.js +2 -0
  114. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  115. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  116. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  117. package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
  118. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  119. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  120. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  121. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  122. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  123. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  124. package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
  125. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  126. package/views/3d/webgl-engine/shaders/ShadedMaterialConfiguration.js +2 -0
  127. package/views/SceneView.d.ts +2 -4
  128. package/views/View.d.ts +1 -3
  129. package/views/View2D.d.ts +2 -2
  130. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  131. package/views/interactive/options/ViewOptions.d.ts +0 -2
  132. package/widgets/Editor/EditorViewModel.d.ts +0 -1
  133. package/widgets/Editor.d.ts +0 -1
  134. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  135. package/widgets/Sketch/SketchViewModel.d.ts +0 -1
  136. package/widgets/Sketch.d.ts +0 -1
  137. package/assets/esri/core/workers/chunks/073f0232135f71b6c7a5.js +0 -1
  138. package/assets/esri/core/workers/chunks/0bf43d80cb40c2b43333.js +0 -1
  139. package/assets/esri/core/workers/chunks/1866f832e5f52958bc97.js +0 -1
  140. package/assets/esri/core/workers/chunks/19e51cbb354954ddafbd.js +0 -1
  141. package/assets/esri/core/workers/chunks/1deca3de77b1a9a07da4.js +0 -1
  142. package/assets/esri/core/workers/chunks/1fd82fcba2758741996a.js +0 -1
  143. package/assets/esri/core/workers/chunks/23f3692c7426173e8352.js +0 -1
  144. package/assets/esri/core/workers/chunks/2dfe6af28cd1b29d5ebc.js +0 -1
  145. package/assets/esri/core/workers/chunks/305eeaac0b4d5b79ebde.js +0 -1
  146. package/assets/esri/core/workers/chunks/353976c812ebf0c98549.js +0 -1
  147. package/assets/esri/core/workers/chunks/4caebb64a365da18453f.js +0 -1
  148. package/assets/esri/core/workers/chunks/4d8833f48348cbbcc947.js +0 -1
  149. package/assets/esri/core/workers/chunks/598ba405e93ebccf7b2d.js +0 -1
  150. package/assets/esri/core/workers/chunks/8b0be232723424dda320.js +0 -1
  151. package/assets/esri/core/workers/chunks/8b38fad017c4c0d9e1ec.js +0 -1
  152. package/assets/esri/core/workers/chunks/8c3779de09291170497f.js +0 -1
  153. package/assets/esri/core/workers/chunks/98958203a5ca45b24d72.js +0 -1
  154. package/assets/esri/core/workers/chunks/af2087b75225d7d7dbd8.js +0 -1
  155. package/assets/esri/core/workers/chunks/b3aa29589dcfb5b93106.js +0 -1
  156. package/assets/esri/core/workers/chunks/c5364ff8dd1358af3603.js +0 -1
  157. package/assets/esri/core/workers/chunks/f6f5937a1308f28bb959.js +0 -1
  158. package/assets/esri/core/workers/chunks/fe24e039385473bf77f9.js +0 -1
  159. package/assets/esri/themes/base/widgets/_UtilityNetworkValidateTopology.scss +0 -46
  160. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ar.json +0 -1
  161. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.bg.json +0 -1
  162. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.bs.json +0 -1
  163. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ca.json +0 -1
  164. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.cs.json +0 -1
  165. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.da.json +0 -1
  166. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.de.json +0 -1
  167. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.el.json +0 -1
  168. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.en.json +0 -1
  169. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.es.json +0 -1
  170. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.et.json +0 -1
  171. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.fi.json +0 -1
  172. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.fr.json +0 -1
  173. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.he.json +0 -1
  174. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.hr.json +0 -1
  175. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.hu.json +0 -1
  176. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.id.json +0 -1
  177. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.it.json +0 -1
  178. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ja.json +0 -1
  179. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ko.json +0 -1
  180. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.lt.json +0 -1
  181. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.lv.json +0 -1
  182. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.nl.json +0 -1
  183. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.no.json +0 -1
  184. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.pl.json +0 -1
  185. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.pt-BR.json +0 -1
  186. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.pt-PT.json +0 -1
  187. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ro.json +0 -1
  188. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ru.json +0 -1
  189. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sk.json +0 -1
  190. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sl.json +0 -1
  191. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sr.json +0 -1
  192. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sv.json +0 -1
  193. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.th.json +0 -1
  194. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.tr.json +0 -1
  195. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.uk.json +0 -1
  196. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.vi.json +0 -1
  197. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.zh-CN.json +0 -1
  198. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.zh-HK.json +0 -1
  199. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.zh-TW.json +0 -1
  200. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.d.ts +0 -72
  201. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +0 -2
  202. package/widgets/UtilityNetworkValidateTopology.d.ts +0 -130
  203. package/widgets/UtilityNetworkValidateTopology.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as n,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as i,Seconds as a}from"../../../../core/time.js";import{copy as o,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as l,subtract as u,dot as d,scale as f,add as p,copy as m,length as h,distance as g,lerp as _,transformMat4 as v,normalize as y,applyTranslation as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as x}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as ee}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as S,distance2 as te,closestLineSegmentPoint as ne,projectPoint as re,projectPointFraction as ie,create as ae}from"../../../../geometry/support/lineSegment.js";import{fromPoints as C,signedDistance as w,getNormal as oe,create as T}from"../../../../geometry/support/plane.js";import{BufferViewUint32 as E,BufferViewVec3f as se}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as ce,isColor as D,isDepth as le,isColorHighlightOLIDOrDepth as ue,is2DGeometryOutput as de}from"../core/shaderLibrary/ShaderOutput.js";import{getScalarAttributeView as fe}from"../lib/attributeViewUtils.js";import pe from"../lib/GLMaterial.js";import{LineMaterial as me}from"../lib/LineMaterial.js";import{ribbonLineVertexInfoPacking as O}from"../lib/RibbonLineVertexInfo.js";import{projectWorldLineSegmentToRenderScreen as he,screenPolygonIntersectsBufferedSegment as ge}from"../lib/screenPolygonOverlapUtils.js";import{Hit as _e,DrapedHit as ve}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as ye}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as be,assert as k}from"../lib/Util.js";import{createVerticesView as xe}from"../lib/VerticesView.js";import{isImagePattern as Se}from"./lineStippleUtils.js";import{VisualVariablePassParameters as Ce}from"./VisualVariablePassParameters.js";import{getNumJoinSubdivisions as we,getRibbonLinePositions as A,isClosed as j,ribbonLineVertexCount as Te,writeRibbonLineTextureBuffer as Ee,writeRibbonLineVertices as De}from"./internal/ribbonLineBufferUtils.js";import{intersectRayWithWorldSizedLineSegment as Oe,intersectScreenPolygonWithWorldSizedLineSegment as ke}from"./internal/worldSizedRibbonLineIntersectionUtils.js";import{getLayout as Ae,getTextureBufferLayout as je}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as Me}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Ne}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as Pe}from"../../../../webscene/support/AlphaCutoff.js";class Fe extends me{constructor(e,t){super(e,Le),this.produces=new Map([[2,e=>ce(e)||D(e)&&this.parameters.renderOccluded===8],[3,e=>le(e)],[10,e=>ue(e)&&this.parameters.renderOccluded===8],[11,e=>ue(e)&&this.parameters.renderOccluded===8],[4,e=>D(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[8,e=>D(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[18,e=>de(e)]]),this._configuration=new Ne(t.state.isGlobal),this._isAssumedMetalDriver=t.stage.renderer.renderContext.rctx.isAssumedMetalDriver}updateConfiguration(e){super.updateConfiguration(e),this._configuration.useFlatJoinVarying=!this._isAssumedMetalDriver;let t=this.parameters.stipplePattern!=null&&this.parameters.stippleTexture!=null&&e.output!==10,n=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(n);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=we(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins=this.parameters.join===`round`,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&Be(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=+!!this.emissions,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=n,this._configuration.hasVertexColor=this.parameters.hasVertexColor,this._configuration.hasVertexSize=this.parameters.hasVertexSize,this._configuration.hasLineDistance=this.parameters.hasLineDistance}get visible(){return this.parameters.color[3]>=Pe||this.parameters.stipplePattern!=null&&(this.parameters.stippleOffColor?.[3]??0)>Pe}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped(e,n,r,i,a,o,s){if(!n.options.selectionMode)return;let c=this._getLineSize(e,!0),l=A(e,!!this.parameters.isClosed),u=r[0],d=r[1],f=M(c,o,s,this.parameters.usesWorldSizedWidth()),p=Number.MAX_VALUE,m=0;for(let e of ze(F,I,l,j(this.parameters,l.count))){let n=u-F[0],r=d-F[1],i=I[0]-F[0],a=I[1]-F[1],o=i*n+a*r,s=i*i+a*a,c=t(o/s,0,1),l=i*c-n,f=a*c-r,h=l*l+f*f;h<p&&(p=h,m=e)}p<f*f&&i(a.distance,a.renderDistance,a.normal,m)}intersectRay(t,n,r,i,a,o){let{options:s,camera:c}=r;if(!s.selectionMode||!t.visible||!c)return;if(!be(n)){e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`);return}let l=this._getLineSize(t);this.parameters.worldSized?this._intersectRayWithWorldSizedLine(t,n,r,l,o):this._intersectRayWithScreenSizedLine(t,n,r,l,o)}_intersectRayWithScreenSizedLine(e,t,n,r,i){let{camera:a}=n,s=A(e,!!this.parameters.isClosed),c=V;o(c,n.point);let _=r*a.pixelRatio,v=$*a.pixelRatio,y=_/2+v;l(q[0],c[0]-y,c[1]+y,0),l(q[1],c[0]+y,c[1]+y,0),l(q[2],c[0]+y,c[1]-y,0),l(q[3],c[0]-y,c[1]-y,0);for(let e=0;e<4;e++)if(!a.unprojectFromRenderScreen(q[e],J[e]))return;C(a.eye,J[0],J[1],Y),C(a.eye,J[1],J[2],X),C(a.eye,J[2],J[3],Z),C(a.eye,J[3],J[0],Q);let b=Number.MAX_VALUE,x=0;for(let e of this._forEachTransformedLineSegment(N,P,s,t,j(this.parameters,s.count))){if(w(Y,N)<0&&w(Y,P)<0||w(X,N)<0&&w(X,P)<0||w(Z,N)<0&&w(Z,P)<0||w(Q,N)<0&&w(Q,P)<0)continue;let t=a.projectToRenderScreen(N,H),n=a.projectToRenderScreen(P,U);if(t==null||n==null)continue;if(t[2]<0&&n[2]>0){u(z,N,P);let e=a.frustum,n=-w(e[4],N)/d(z,oe(e[4]));if(f(z,z,n),p(N,N,z),!a.projectToRenderScreen(N,t))continue}else if(t[2]>0&&n[2]<0){u(z,P,N);let e=a.frustum,t=-w(e[4],P)/d(z,oe(e[4]));if(f(z,z,t),p(P,P,z),!a.projectToRenderScreen(P,n))continue}else if(t[2]<0&&n[2]<0)continue;t[2]=0,n[2]=0;let i=S(t,n,G),o=te(i,c);if(!(o>=b)){if(this.parameters.screenSizePerspective){let e=this.computeScreenSizePerspectiveWidth(i,N,P,c,a,r,v);if(o>=e*e)continue}b=o,m(Ge,N),m(Ke,P),x=e}}if(b<y*y){let{rayBegin:e,rayEnd:t}=n,r=Number.MAX_VALUE;if(ne(S(Ge,Ke,G),S(e,t,K),B)){u(B,B,e);let n=h(B);f(B,B,1/n),r=n/g(e,t)}i(r,r,B,x)}}_intersectRayWithWorldSizedLine(e,t,n,r,i){let{camera:a,ray:o,metersPerRenderUnit:s}=n,c=A(e,!!this.parameters.isClosed),l=r/(2*s),u=1/0,d=0;for(let e of this._forEachTransformedLineSegment(N,P,c,t,j(this.parameters,c.count))){let t=Oe(N,P,l,a,o,W);if(t!=null&&t<u&&(u=t,d=e,m(B,W),t===0))break}u<1/0&&i(u,u,B,d)}intersectScreenPolygon(t,n,r,i){let{options:a}=r;if(!a.selectionMode||!t.visible)return null;if(!be(n))return e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`),null;let o=this._getLineSize(t);return this.parameters.worldSized?this._intersectWorldSizedPolygon(t,n,r,i,o):this._intersectScreenSizedPolygon(t,n,r,i,o)}_intersectScreenSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o}=n,s=A(e,!!this.parameters.isClosed),c=$,l=c*a.pixelRatio,u=new _e(4);for(let e of this._forEachTransformedLineSegment(N,P,s,t,j(this.parameters,s.count)))for(let[t,n]of o.processLineSegment(Je,N,P)){if(!he(a,t,n,H,U))continue;let o=S(H,U,G),s=i/2+c;this.parameters.screenSizePerspective&&(_(V,H,U,.5),s=Math.max(s,this.computeScreenSizePerspectiveWidth(o,t,n,V,a,i,l)/a.pixelRatio)),a.renderToScreen(H,Ue),a.renderToScreen(U,We),ge(r,Ue,We,s)&&(re(S(t,n,K),a.eye,L),u.updateIfCloserFromValues(g(a.eye,L),e,L,null))}return u}_intersectWorldSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o,metersPerRenderUnit:s}=n,c=A(e,!!this.parameters.isClosed),l=i/(2*s),u=new _e(4);for(let e of this._forEachTransformedLineSegment(N,P,c,t,j(this.parameters,c.count)))for(let[t,n]of o.processLineSegment(Je,N,P)){re(S(t,n,K),a.eye,L);let i=g(a.eye,L);u.valid&&i>=u.distance||ke(t,n,l,a,r)&&u.updateIfCloserFromValues(i,e,L,null)}return u}intersectScreenPolygonDraped(e,t,n,r,i,a){if(!n.options.selectionMode)return null;let o=this._getLineSize(e,!0),s=A(e,!!this.parameters.isClosed),c=M(o,i,a,this.parameters.usesWorldSizedWidth());for(let e of ze(F,I,s,j(this.parameters,s.count),t))if(ge(r,F,I,c))return new ve(e);return null}createPrimitivePositionReader(e){let t=e.vertex.getField(`ribbonLineVertexInfo`,E),n=e.storage.getField(`position`,se),r=O.getField(0);return(e,i)=>n.getVec(r.get(t.get(i)),e)}computeAttachmentOrigin(e,t,n){return!this.parameters.wireframe&&super.computeAttachmentOrigin(e,t,n)}createBufferWriter(){return new Re(Ae(this.parameters),je(this.parameters),this.parameters)}createGLMaterial(e){return new Ie(e)}validateParameters(e){k(e.hasLineDistance||e.stipplePattern==null,`Patterned ribbon lines require line distances`),e.join!==`miter`&&(e.miterLimit=0),e.markerParameters!=null&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return this.parameters.hasAnimation?(this.setParameters({timeElapsed:i(e.time)},!1),e.dt!==0):!1}computeScreenSizePerspectiveWidth(e,t,n,r,i,a,o){let s=ie(e,r);_(L,t,n,s),v(He,L,i.viewMatrix);let c=h(He),l=this.computeCameraAbsCosAngle(L,i,this._configuration.spherical);return Ve.update(l,c,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Ve.apply(a)*i.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,n){return n?y(B,e):l(B,0,0,1),u(R,e,t.eye),y(R,R),Math.abs(d(B,R))}_getLineSize(e,n=!1){let r=this.parameters.width;if(this.parameters.vvSize){let i=fe(e,`sizeFeatureAttribute`).get(0);Number.isNaN(i)?n&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else if(this.parameters.hasVertexSize){let t=fe(e,`size`);t!=null&&(r*=t.get(0))}return r}*_forEachTransformedLineSegment(e,t,n,r,i){let a=i?n.count:n.count-1;for(let i=0;i<a;i++)n.getVec(i,e),b(e,e,r),n.getVec((i+1)%n.count,t),b(t,t,r),yield i}}class Ie extends pe{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){let{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Me,e)}}class Le extends Ce{constructor(){super(...arguments),this._width=0,this.color=ee,this.hasVertexColor=!0,this.hasVertexSize=!0,this.hasLineDistance=!0,this.join=`miter`,this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||this.stipplePattern!=null&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==0}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return Se(this.stipplePattern)&&this.stippleTexture!=null}}class Re{constructor(e,t,n){this.layout=e,this.textureBufferLayout=t,this._parameters=n,this.maxTextureBufferItemIndex=O.getField(0).max}_isClosed(e){return j(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){let t=e.get(`position`);return t.data.length/3+(this._isClosed(t.data.length/t.stride)?3:2)}elementCount(e){let t=e.get(`position`),n=t.indices.length/2+1;return Te(n,this._isClosed(t.data.length/t.stride),this._parameters)}rebaseBuffers(e,t,n,r){if(r?.buffer.copyFrom(e.storage,0,r.offset),t!=null){let r=n.from,i=e.vertex.getField(`ribbonLineVertexInfo`,E),a=t.buffer.getField(`ribbonLineVertexInfo`,E),o=O.getField(0);for(let e=0;e<i.count;e++){let n=i.get(e),s=o.get(n)+r;a.set(t.offset+e,n===0?0:o.set(n,s))}}}write(e,t,n,r,i,a){a!=null&&this._writeTextureBuffer(e,n,a),r!=null&&this._writeVertexBuffer(n,r,i)}_writeTextureBuffer(e,t,n){let r=xe(t.get(`position`),3),i=t.get(`timeStamps`);i!=null&&n.buffer.layout.fields.has(`timeStamps`)&&k(i.size===4),Ee({position:r,color:t.get(`color`)?.data,size:t.get(`size`)?.data,colorFeature:t.get(`colorFeatureAttribute`)?.data,sizeFeature:t.get(`sizeFeatureAttribute`)?.data,opacityFeature:t.get(`opacityFeatureAttribute`)?.data,distancesToStart:t.get(`distanceToStart`)?.data,timeStamps:i?.data,olidColor:t.get(`olidColor`)?.data},this._isClosed(r.count),n,e)}_writeVertexBuffer(e,t,n){let r=e.get(`position`),i=r.indices,a=r.data.length/3,o=this._isClosed(r.data.length/r.stride),s=a+(o?3:2);i&&i.length!==2*(a-1)&&console.warn(`RibbonLineMaterial does not support indices`),k(n!=null,`Using a texture layout, but the texture range for this instance was not provided`);let c=n.from;k(n.numElements===s,`Expected number of elements in TextureBuffer to equal number of points`),De(a,o,this._parameters,t,c)}}function M(e,t,n,r){return r?e/(2*n)+$*t:(e/2+$)*t}function*ze(e,t,n,r,i){let a=r?n.count:n.count-1,c=i?.[0]??0,l=i?.[1]??0;s(e,n.get(0,0)+c,n.get(0,1)+l);for(let r=1;r<=a;r++){let i=r%n.count;s(t,n.get(i,0)+c,n.get(i,1)+l),yield r,o(e,t)}}function Be(e){return e.anchor===1&&e.hideOnShortSegments&&e.placement===`begin-end`&&e.worldSpace}const Ve=new ye,N=x(),P=x(),F=c(),I=c(),L=x(),He=x(),R=x(),z=x(),B=x(),V=x(),H=n(),U=n(),Ue=r(),We=r(),Ge=x(),Ke=x(),W=x(),G=ae(),K=ae(),q=[n(),n(),n(),n()],J=[x(),x(),x(),x()],Y=T(),X=T(),Z=T(),Q=T(),$=4,qe={getDrapedRibbonLineMaxDistance:M},Je=[x(),x()];export{Le as Parameters,Fe as RibbonLineMaterial,qe as test};
2
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as n,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as i,Seconds as a}from"../../../../core/time.js";import{copy as o,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as l,subtract as u,dot as d,scale as f,add as p,copy as m,length as h,distance as g,lerp as _,transformMat4 as v,normalize as y,applyTranslation as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as x}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as ee}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as S,distance2 as te,closestLineSegmentPoint as ne,projectPoint as re,projectPointFraction as ie,create as ae}from"../../../../geometry/support/lineSegment.js";import{fromPoints as C,signedDistance as w,getNormal as oe,create as T}from"../../../../geometry/support/plane.js";import{BufferViewUint32 as E,BufferViewVec3f as se}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as ce,isColor as D,isDepth as le,isColorHighlightOLIDOrDepth as ue,is2DGeometryOutput as de}from"../core/shaderLibrary/ShaderOutput.js";import{getScalarAttributeView as fe}from"../lib/attributeViewUtils.js";import pe from"../lib/GLMaterial.js";import{LineMaterial as me}from"../lib/LineMaterial.js";import{ribbonLineVertexInfoPacking as O}from"../lib/RibbonLineVertexInfo.js";import{projectWorldLineSegmentToRenderScreen as he,screenPolygonIntersectsBufferedSegment as ge}from"../lib/screenPolygonOverlapUtils.js";import{Hit as _e,DrapedHit as ve}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as ye}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as be,assert as k}from"../lib/Util.js";import{createVerticesView as xe}from"../lib/VerticesView.js";import{isImagePattern as Se}from"./lineStippleUtils.js";import{VisualVariablePassParameters as Ce}from"./VisualVariablePassParameters.js";import{getNumJoinSubdivisions as we,getRibbonLinePositions as A,isClosed as j,ribbonLineVertexCount as Te,writeRibbonLineTextureBuffer as Ee,writeRibbonLineVertices as De}from"./internal/ribbonLineBufferUtils.js";import{intersectRayWithWorldSizedLineSegment as Oe,intersectScreenPolygonWithWorldSizedLineSegment as ke}from"./internal/worldSizedRibbonLineIntersectionUtils.js";import{getLayout as Ae,getTextureBufferLayout as je}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as Me}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Ne}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as Pe}from"../../../../webscene/support/AlphaCutoff.js";class Fe extends me{constructor(e,t){super(e,Le),this.produces=new Map([[2,e=>ce(e)||D(e)&&this.parameters.renderOccluded===8],[3,e=>le(e)],[10,e=>ue(e)&&this.parameters.renderOccluded===8],[11,e=>ue(e)&&this.parameters.renderOccluded===8],[4,e=>D(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[8,e=>D(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[18,e=>de(e)]]),this._configuration=new Ne(t.state.isGlobal),this._isAssumedMetalDriver=t.stage.renderer.renderContext.rctx.isAssumedMetalDriver}updateConfiguration(e){super.updateConfiguration(e),this._configuration.useFlatJoinVarying=!this._isAssumedMetalDriver;let t=this.parameters.stipplePattern!=null&&this.parameters.stippleTexture!=null&&e.output!==10,n=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(n);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=we(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins=this.parameters.join===`round`,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&Be(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=+!!this.emissions,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=n,this._configuration.hasVertexColor=this.parameters.hasVertexColor,this._configuration.hasVertexSize=this.parameters.hasVertexSize,this._configuration.hasLineDistance=this.parameters.hasLineDistance}get visible(){return this.parameters.color[3]>=Pe||this.parameters.stipplePattern!=null&&(this.parameters.stippleOffColor?.[3]??0)>Pe}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped(e,n,r,i,a,o,s){if(!n.options.selectionMode)return;let c=this._getLineSize(e,!0),l=A(e,!!this.parameters.isClosed),u=r[0],d=r[1],f=M(c,o,s,this.parameters.usesWorldSizedWidth()),p=Number.MAX_VALUE,m=0;for(let e of ze(F,I,l,j(this.parameters,l.count))){let n=u-F[0],r=d-F[1],i=I[0]-F[0],a=I[1]-F[1],o=i*n+a*r,s=i*i+a*a,c=t(o/s,0,1),l=i*c-n,f=a*c-r,h=l*l+f*f;h<p&&(p=h,m=e)}p<f*f&&i(a.distance,a.renderDistance,a.normal,m)}intersectRay(t,n,r,i,a,o){let{options:s,camera:c}=r;if(!s.selectionMode||!t.visible||!c)return;if(!be(n)){e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`);return}let l=this._getLineSize(t);this.parameters.worldSized?this._intersectRayWithWorldSizedLine(t,n,r,l,o):this._intersectRayWithScreenSizedLine(t,n,r,l,o)}_intersectRayWithScreenSizedLine(e,t,n,r,i){let{camera:a}=n,s=A(e,!!this.parameters.isClosed),c=V;o(c,n.point);let _=r*a.pixelRatio,v=$*a.pixelRatio,y=_/2+v;l(q[0],c[0]-y,c[1]+y,0),l(q[1],c[0]+y,c[1]+y,0),l(q[2],c[0]+y,c[1]-y,0),l(q[3],c[0]-y,c[1]-y,0);for(let e=0;e<4;e++)if(!a.unprojectFromRenderScreen(q[e],J[e]))return;C(a.eye,J[0],J[1],Y),C(a.eye,J[1],J[2],X),C(a.eye,J[2],J[3],Z),C(a.eye,J[3],J[0],Q);let b=Number.MAX_VALUE,x=0;for(let e of this._forEachTransformedLineSegment(N,P,s,t,j(this.parameters,s.count))){if(w(Y,N)<0&&w(Y,P)<0||w(X,N)<0&&w(X,P)<0||w(Z,N)<0&&w(Z,P)<0||w(Q,N)<0&&w(Q,P)<0)continue;let t=a.projectToRenderScreen(N,H),n=a.projectToRenderScreen(P,U);if(t==null||n==null)continue;if(t[2]<0&&n[2]>0){u(z,N,P);let e=a.frustum,n=-w(e[4],N)/d(z,oe(e[4]));if(f(z,z,n),p(N,N,z),!a.projectToRenderScreen(N,t))continue}else if(t[2]>0&&n[2]<0){u(z,P,N);let e=a.frustum,t=-w(e[4],P)/d(z,oe(e[4]));if(f(z,z,t),p(P,P,z),!a.projectToRenderScreen(P,n))continue}else if(t[2]<0&&n[2]<0)continue;t[2]=0,n[2]=0;let i=S(t,n,G),o=te(i,c);if(!(o>=b)){if(this.parameters.screenSizePerspective){let e=this.computeScreenSizePerspectiveWidth(i,N,P,c,a,r,v);if(o>=e*e)continue}b=o,m(Ge,N),m(Ke,P),x=e}}if(b<y*y){let{rayBegin:e,rayEnd:t}=n,r=Number.MAX_VALUE;if(ne(S(Ge,Ke,G),S(e,t,K),B)){u(B,B,e);let n=h(B);f(B,B,1/n),r=n/g(e,t)}i(r,r,B,x)}}_intersectRayWithWorldSizedLine(e,t,n,r,i){let{camera:a,ray:o,metersPerRenderUnit:s}=n,c=A(e,!!this.parameters.isClosed),l=r/(2*s),u=1/0,d=0;for(let e of this._forEachTransformedLineSegment(N,P,c,t,j(this.parameters,c.count))){let t=Oe(N,P,l,a,o,W);if(t!=null&&t<u&&(u=t,d=e,m(B,W),t===0))break}u<1/0&&i(u,u,B,d)}intersectScreenPolygon(t,n,r,i){let{options:a}=r;if(!a.selectionMode||!t.visible)return null;if(!be(n))return e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`),null;let o=this._getLineSize(t);return this.parameters.worldSized?this._intersectWorldSizedPolygon(t,n,r,i,o):this._intersectScreenSizedPolygon(t,n,r,i,o)}_intersectScreenSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o}=n,s=A(e,!!this.parameters.isClosed),c=$,l=c*a.pixelRatio,u=new _e(4);for(let e of this._forEachTransformedLineSegment(N,P,s,t,j(this.parameters,s.count)))for(let[t,n]of o.processLineSegment(Je,N,P)){if(!he(a,t,n,H,U))continue;let o=S(H,U,G),s=i/2+c;this.parameters.screenSizePerspective&&(_(V,H,U,.5),s=Math.max(s,this.computeScreenSizePerspectiveWidth(o,t,n,V,a,i,l)/a.pixelRatio)),a.renderToScreen(H,Ue),a.renderToScreen(U,We),ge(r,Ue,We,s)&&(re(S(t,n,K),a.eye,L),u.updateIfCloserFromValues(g(a.eye,L),e,L,null))}return u}_intersectWorldSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o,metersPerRenderUnit:s}=n,c=A(e,!!this.parameters.isClosed),l=i/(2*s),u=new _e(4);for(let e of this._forEachTransformedLineSegment(N,P,c,t,j(this.parameters,c.count)))for(let[t,n]of o.processLineSegment(Je,N,P)){re(S(t,n,K),a.eye,L);let i=g(a.eye,L);u.valid&&i>=u.distance||ke(t,n,l,a,r)&&u.updateIfCloserFromValues(i,e,L,null)}return u}intersectScreenPolygonDraped(e,t,n,r,i,a){if(!n.options.selectionMode)return null;let o=this._getLineSize(e,!0),s=A(e,!!this.parameters.isClosed),c=M(o,i,a,this.parameters.usesWorldSizedWidth());for(let e of ze(F,I,s,j(this.parameters,s.count),t))if(ge(r,F,I,c))return new ve(e);return null}createPrimitivePositionReader(e){let t=e.vertex.getField(`ribbonLineVertexInfo`,E),n=e.storage.getField(`position`,se),r=O.getField(0);return(e,i)=>n.getVec(r.get(t.get(i)),e)}computeAttachmentOrigin(e,t,n){return!this.parameters.wireframe&&super.computeAttachmentOrigin(e,t,n)}createBufferWriter(){return new Re(Ae(this.parameters),je(this.parameters),this.parameters)}createGLMaterial(e){return new Ie(e)}validateParameters(e){k(e.hasLineDistance||e.stipplePattern==null,`Patterned ribbon lines require line distances`),e.join!==`miter`&&(e.miterLimit=0),e.markerParameters!=null&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return this.parameters.hasAnimation?(this.setParameters({timeElapsed:i(e.time)},!1),e.dt!==0):!1}computeScreenSizePerspectiveWidth(e,t,n,r,i,a,o){let s=ie(e,r);_(L,t,n,s),v(He,L,i.viewMatrix);let c=h(He),l=this.computeCameraAbsCosAngle(L,i,this._configuration.spherical);return Ve.update(l,c,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Ve.apply(a)*i.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,n){return n?y(B,e):l(B,0,0,1),u(R,e,t.eye),y(R,R),Math.abs(d(B,R))}_getLineSize(e,n=!1){let r=this.parameters.width;if(this.parameters.vvSize){let i=fe(e,`sizeFeatureAttribute`).get(0);Number.isNaN(i)?n&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else if(this.parameters.hasVertexSize){let t=fe(e,`size`);t!=null&&(r*=t.get(0))}return r}*_forEachTransformedLineSegment(e,t,n,r,i){let a=i?n.count:n.count-1;for(let i=0;i<a;i++)n.getVec(i,e),b(e,e,r),n.getVec((i+1)%n.count,t),b(t,t,r),yield i}}class Ie extends pe{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){let{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Me,e)}}class Le extends Ce{constructor(){super(...arguments),this._width=0,this.color=ee,this.hasVertexColor=!0,this.hasVertexSize=!0,this.hasLineDistance=!0,this.join=`miter`,this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||this.stipplePattern!=null&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==0}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return Se(this.stipplePattern)&&this.stippleTexture!=null}}class Re{constructor(e,t,n){this.layout=e,this.textureBufferLayout=t,this._parameters=n,this.maxTextureBufferItemIndex=O.getField(0).max}_isClosed(e){return j(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){let t=e.get(`position`);return t.data.length/3+(this._isClosed(t.data.length/t.stride)?3:2)}elementCount(e){let t=e.get(`position`),n=t.indices.length/2+1;return Te(n,this._isClosed(t.data.length/t.stride),this._parameters)}rebaseBuffers(e,t,n,r){if(r?.buffer.copyFrom(e.storage,0,r.offset),t!=null){let r=n.from,i=e.vertex.getField(`ribbonLineVertexInfo`,E),a=t.buffer.getField(`ribbonLineVertexInfo`,E),o=O.getField(0);for(let e=0;e<i.count;e++){let n=i.get(e),s=o.get(n)+r;a.set(t.offset+e,n===0?0:o.set(n,s))}}}write(e,t,n,r,i,a){a!=null&&this._writeTextureBuffer(e,n,a),r!=null&&this._writeVertexBuffer(n,r,i)}_writeTextureBuffer(e,t,n){let r=xe(t.get(`position`),3),i=t.get(`timeStamps`);i!=null&&n.buffer.layout.fields.has(`timeStamps`)&&k(i.size===4),Ee({position:r,color:t.get(`color`)?.data,size:t.get(`size`)?.data,colorFeature:t.get(`colorFeatureAttribute`)?.data,sizeFeature:t.get(`sizeFeatureAttribute`)?.data,opacityFeature:t.get(`opacityFeatureAttribute`)?.data,distancesToStart:t.get(`distanceToStart`)?.data,timeStamps:i?.data,olidColor:t.get(`olidColor`)?.data},this._isClosed(r.count),n,e)}_writeVertexBuffer(e,t,n){let r=e.get(`position`),i=r.indices,a=r.data.length/3,o=this._isClosed(r.data.length/r.stride),s=a+(o?3:2);i&&i.length!==2*(a-1)&&console.warn(`RibbonLineMaterial does not support indices`),k(n!=null,`Using a texture layout, but the texture range for this instance was not provided`);let c=n.from;k(n.numElements===s,`Expected number of elements in TextureBuffer to equal number of points`),De(a,o,this._parameters,t,c)}}function M(e,t,n,r){return r?e/(2*n)+$*t:(e/2+$)*t}function*ze(e,t,n,r,i){let a=r?n.count:n.count-1,c=i?.[0]??0,l=i?.[1]??0;s(e,n.get(0,0)+c,n.get(0,1)+l);for(let r=1;r<=a;r++){let i=r%n.count;s(t,n.get(i,0)+c,n.get(i,1)+l),yield r,o(e,t)}}function Be(e){return e.anchor===1&&e.hideOnShortSegments&&e.placement===`begin-end`&&e.worldSpace}const Ve=new ye,N=x(),P=x(),F=c(),I=c(),L=x(),He=x(),R=x(),z=x(),B=x(),V=x(),H=n(),U=n(),Ue=r(),We=r(),Ge=x(),Ke=x(),W=x(),G=ae(),K=ae(),q=[n(),n(),n(),n()],J=[x(),x(),x(),x()],Y=T(),X=T(),Z=T(),Q=T(),$=4,qe={getDrapedRibbonLineMaxDistance:M},Je=[x(),x()];export{Le as Parameters,Fe as RibbonLineMaterial,qe as test};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"../../../../core/has.js";import{secondsFromMilliseconds as e}from"../../../../core/time.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewVec3f as i}from"../../../../geometry/support/buffer/BufferView.js";import{is3DGeometry as a,isColor as o,isNormals as s}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as c}from"../effects/geometry/olidUtils.js";import{createPositionReader as l}from"../lib/PositionReader.js";import{PositionUvf32OlidLayout as u,PositionUvf32Layout as d}from"./DefaultLayouts.js";import{TriangleMaterialParameters as f,TriangleMaterial as p}from"./TriangleMaterial.js";import{WaterGLMaterial as m}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as h}from"./WaterTechniqueConfiguration.js";import{hasShadowHighlights as g}from"../shaders/ReceiveShadowsConfiguration.js";class _ extends p{constructor(e,t){super(e,v),this.visible=!0,this.produces=new Map([[2,e=>a(e)&&!this.transparent],[4,e=>a(e)&&this.transparent],[18,e=>this.parameters.draped&&a(e)],[19,e=>e===4]]),this._configuration=new h(t.spherical)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.receiveShadows=o(e.output)&&e.shadowMap.enabled,this._configuration.hasShadowHighlights=g(this._configuration,e),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.screenSpaceReflections=e.hasScreenSpaceReflections,this._configuration.cloudReflections=e.clouds.data!=null,this._configuration.draped=this.parameters.draped,this._configuration.drapedNormals=s(e.output)&&e.slot===19}update(t){return this.setParameters({timeElapsed:e(t.time)*this.parameters.animationSpeed},!1),this._animationEnabled(t.camera)&&t.dt>0}_animationEnabled(e){let t=Math.min(e.relativeElevation,e.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*t<y}get transparent(){return this.parameters.transparent}createGLMaterial(e){return new m(e)}createBufferWriter(){return new x}createPrimitivePositionReader(e){let t=e.vertex.getField(`position`,i);return l(t.typedBuffer,e.index,t.typedBufferStride)}get test(){}}class v extends f{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=t(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=r(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=n(),this.modelTransformation=null}}const y=35e3;function b(){return c()?u:d}class x{constructor(){this.layout=b()}elementCount(){throw Error(`WaterMaterial only supports BufferGeometry`)}write(){throw Error(`WaterMaterial only supports BufferGeometry`)}rebaseBuffers(e,t){t?.buffer.copyFrom(e.vertex,0,t.offset)}}export{v as Parameters,_ as WaterMaterial,b as getWaterLayout};
2
+ import"../../../../core/has.js";import{secondsFromMilliseconds as e}from"../../../../core/time.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewVec3f as i}from"../../../../geometry/support/buffer/BufferView.js";import{is3DGeometry as a,isNormals as o}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as s}from"../effects/geometry/olidUtils.js";import{createPositionReader as c}from"../lib/PositionReader.js";import{PositionUvf32OlidLayout as l,PositionUvf32Layout as u}from"./DefaultLayouts.js";import{TriangleMaterialParameters as d,TriangleMaterial as f}from"./TriangleMaterial.js";import{WaterGLMaterial as p}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as m}from"./WaterTechniqueConfiguration.js";import{configureShadedMaterial as h}from"../shaders/ShadedMaterialConfiguration.js";class g extends f{constructor(e,t){super(e,_),this.visible=!0,this.produces=new Map([[2,e=>a(e)&&!this.transparent],[4,e=>a(e)&&this.transparent],[18,e=>this.parameters.draped&&a(e)],[19,e=>e===4]]),this._configuration=new m(t.spherical)}updateConfiguration(e){super.updateConfiguration(e),h(this._configuration,e,this.parameters),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.screenSpaceReflections=e.hasScreenSpaceReflections,this._configuration.cloudReflections=e.clouds.data!=null,this._configuration.draped=this.parameters.draped,this._configuration.drapedNormals=o(e.output)&&e.slot===19}update(t){return this.setParameters({timeElapsed:e(t.time)*this.parameters.animationSpeed},!1),this._animationEnabled(t.camera)&&t.dt>0}_animationEnabled(e){let t=Math.min(e.relativeElevation,e.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*t<v}get transparent(){return this.parameters.transparent}createGLMaterial(e){return new p(e)}createBufferWriter(){return new b}createPrimitivePositionReader(e){let t=e.vertex.getField(`position`,i);return c(t.typedBuffer,e.index,t.typedBufferStride)}get test(){}}class _ extends d{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=t(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=r(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=n(),this.modelTransformation=null,this.shadingEnabled=!0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0}}const v=35e3;function y(){return s()?l:u}class b{constructor(){this.layout=y()}elementCount(){throw Error(`WaterMaterial only supports BufferGeometry`)}write(){throw Error(`WaterMaterial only supports BufferGeometry`)}rebaseBuffers(e,t){t?.buffer.copyFrom(e.vertex,0,t.offset)}}export{_ as Parameters,g as WaterMaterial,y as getWaterLayout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as n}from"./TriangleTechniqueConfiguration.js";class r extends n{constructor(e){super(),this.spherical=e,this.receiveGlobalIllumination=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.draped=!1,this.drapedNormals=!1,this.textureCoordinateType=0,this.emissionSource=0,this.pbrMode=3,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!0,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=150,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.useFillLights=!1,this.overlayEnabled=!1,this.snowCover=!1,this.renderOccluded=!1}}e([t()],r.prototype,`receiveGlobalIllumination`,void 0),e([t()],r.prototype,`receiveShadows`,void 0),e([t()],r.prototype,`hasShadowHighlights`,void 0),e([t()],r.prototype,`screenSpaceReflections`,void 0),e([t()],r.prototype,`cloudReflections`,void 0),e([t()],r.prototype,`draped`,void 0),e([t()],r.prototype,`drapedNormals`,void 0);export{r as WaterTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as n}from"./TriangleTechniqueConfiguration.js";class r extends n{constructor(e){super(),this.spherical=e,this.receiveGlobalIllumination=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.draped=!1,this.drapedNormals=!1,this.textureCoordinateType=0,this.emissionSource=0,this.pbrMode=3,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!0,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=150,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.useFillLights=!1,this.overlayEnabled=!1,this.snowCover=!1,this.renderOccluded=!1,this.receiveAmbientOcclusion=!1}}e([t()],r.prototype,`receiveGlobalIllumination`,void 0),e([t()],r.prototype,`receiveShadows`,void 0),e([t()],r.prototype,`hasShadowHighlights`,void 0),e([t()],r.prototype,`screenSpaceReflections`,void 0),e([t()],r.prototype,`cloudReflections`,void 0),e([t()],r.prototype,`draped`,void 0),e([t()],r.prototype,`drapedNormals`,void 0);export{r as WaterTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as n,freeze as r,create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as o}from"../../support/buffer/glUtil.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{VertexNormalPassParameters as c,VertexNormalDrawParameters as l}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{ReloadableShader as u}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as d}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as f}from"../effects/geometry/olidUtils.js";import{depthWrite as p,depthTest as m,blending as h}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBase as g,stencilBaseAllZeros as _,stencilWriteMaskOn as v}from"../lib/StencilUtils.js";import{getRenderInstanceDataLayout as y}from"../lib/lodRendering/RenderInstanceData.js";import{advancedMRRFactors as b}from"../materials/pbrUtils.js";import{polygonOffset as x}from"../materials/PolygonOffset.js";import{D as S}from"../../../../chunks/DefaultMaterial.glsl.js";import{makePipelineState as C,defaultColorWrite as w,cullingParams as T}from"../../../webgl/renderState.js";import{alphaCutoff as E}from"../../../../webscene/support/AlphaCutoff.js";class D extends c{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=b,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType=`normal`,this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=n,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=r(.2,.2,.2),this.diffuse=r(.8,.8,.8),this.externalColor=a(1,1,1,1),this.colorMixMode=`multiply`,this.opacity=1,this.layerOpacity=1,this.origin=i(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=E,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class O extends l{constructor(){super(...arguments),this.origin=i(),this.slicePlaneLocalOrigin=this.origin}get localOrigin(){return this.origin}}let k=class extends d{constructor(e,t){let n=o(M(t));t.instanced&&t.instancedDoublePrecision&&(n=n.concat(o(y(t)))),super(e,t,n),this.shader=new u(S,()=>import(`./DefaultMaterial.glsl.js`)),this.ignoreUnused=!0}_makePipeline(e,t){let{output:n,transparent:r,cullFace:i,customDepthTest:a,hasOccludees:o}=e;return C({blending:r?h(n,!1,e.emissionDimmingPass):null,culling:j(e)?T(i):null,depthTest:m(n,A(a)),depthWrite:p(e),colorWrite:w,stencilWrite:o?v:null,stencilTest:o?t?g:_:null,polygonOffset:x(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t,n){return n?this._occludeePipelineState:super.getPipeline(e,t,n)}};k=e([t(`esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique`)],k);function A(e){switch(e){case 1:return 515;case 0:return 513;case 2:return 516;case 3:return 514;case 4:return 513}}function j(e){return e.cullFace!==0||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function M(e){let t=s().vec3f(`position`);return e.normalType===1?t.vec2i16(`normalCompressed`,{glNormalized:!0}):t.vec3f(`normal`),e.hasVertexTangents&&t.vec4f(`tangent`),e.hasTextures&&t.vec2f16(`uv0`),e.hasVertexColors&&t.vec4u8(`color`,{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8(`symbolColor`),!e.instanced&&f()&&t.vec4u8(`olidColor`),t}export{O as DefaultMaterialDrawParameters,D as DefaultMaterialPassParameters,k as DefaultMaterialTechnique,M as getLayout,j as isCullingRequired};
2
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as n,freeze as r,create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as o}from"../../support/buffer/glUtil.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{VertexNormalPassParameters as c,VertexNormalDrawParameters as l}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{ReloadableShader as u}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as d}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as f}from"../effects/geometry/olidUtils.js";import{depthWrite as p,depthTest as m,blending as h}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBase as g,stencilBaseAllZeros as _,stencilWriteMaskOn as v}from"../lib/StencilUtils.js";import{getRenderInstanceDataLayout as y}from"../lib/lodRendering/RenderInstanceData.js";import{advancedMRRFactors as b}from"../materials/pbrUtils.js";import{polygonOffset as x}from"../materials/PolygonOffset.js";import{D as S}from"../../../../chunks/DefaultMaterial.glsl.js";import{makePipelineState as C,defaultColorWrite as w,cullingParams as T}from"../../../webgl/renderState.js";import{alphaCutoff as E}from"../../../../webscene/support/AlphaCutoff.js";class D extends c{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=b,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType=`normal`,this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=n,this.instancedDoublePrecision=!1,this.normalType=0,this.shadingEnabled=!0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=r(.2,.2,.2),this.diffuse=r(.8,.8,.8),this.externalColor=a(1,1,1,1),this.colorMixMode=`multiply`,this.opacity=1,this.layerOpacity=1,this.origin=i(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=E,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class O extends l{constructor(){super(...arguments),this.origin=i(),this.slicePlaneLocalOrigin=this.origin}get localOrigin(){return this.origin}}let k=class extends d{constructor(e,t){let n=o(M(t));t.instanced&&t.instancedDoublePrecision&&(n=n.concat(o(y(t)))),super(e,t,n),this.shader=new u(S,()=>import(`./DefaultMaterial.glsl.js`)),this.ignoreUnused=!0}_makePipeline(e,t){let{output:n,transparent:r,cullFace:i,customDepthTest:a,hasOccludees:o}=e;return C({blending:r?h(n,!1,e.emissionDimmingPass):null,culling:j(e)?T(i):null,depthTest:m(n,A(a)),depthWrite:p(e),colorWrite:w,stencilWrite:o?v:null,stencilTest:o?t?g:_:null,polygonOffset:x(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t,n){return n?this._occludeePipelineState:super.getPipeline(e,t,n)}};k=e([t(`esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique`)],k);function A(e){switch(e){case 1:return 515;case 0:return 513;case 2:return 516;case 3:return 514;case 4:return 513}}function j(e){return e.cullFace!==0||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function M(e){let t=s().vec3f(`position`);return e.normalType===1?t.vec2i16(`normalCompressed`,{glNormalized:!0}):t.vec3f(`normal`),e.hasVertexTangents&&t.vec4f(`tangent`),e.hasTextures&&t.vec2f16(`uv0`),e.hasVertexColors&&t.vec4u8(`color`,{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8(`symbolColor`),!e.instanced&&f()&&t.vec4u8(`olidColor`),t}export{O as DefaultMaterialDrawParameters,D as DefaultMaterialPassParameters,k as DefaultMaterialTechnique,M as getLayout,j as isCullingRequired};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import{isColor as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReadShadowMapConfiguration as n}from"../core/shaderLibrary/shading/readShadow.glsl.js";import{parameter as r}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{MaterialParameters as i}from"../lib/Material.js";import{hasShadowHighlights as a}from"./ReceiveShadowsConfiguration.js";class o extends n{constructor(){super(...arguments),this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1}}e([r()],o.prototype,`receiveAmbientOcclusion`,void 0),e([r()],o.prototype,`receiveGlobalIllumination`,void 0);class s extends i{constructor(){super(...arguments),this.shadingEnabled=!0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0}}function c(e,n,r,i=!0){i&&t(n.output)&&r.shadingEnabled?(e.receiveShadows=r.receiveShadows&&n.shadowMap.enabled,e.hasShadowHighlights=a(e,n),e.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&n.ssao!=null,e.receiveGlobalIllumination=r.receiveAmbientOcclusion&&n.globalIlluminationEnabled):e.receiveShadows=e.hasShadowHighlights=e.receiveAmbientOcclusion=e.receiveGlobalIllumination=!1}export{o as ShadedMaterialConfiguration,s as ShadedMaterialParameters,c as configureShadedMaterial};
@@ -307,7 +307,6 @@ export interface SceneViewProperties extends ViewProperties, DOMContainerPropert
307
307
  * >
308
308
  * > These options are not saved in a [WebScene](https://developers.arcgis.com/javascript/latest/references/core/WebScene/).
309
309
  *
310
- * @beta
311
310
  * @since 5.2
312
311
  */
313
312
  options?: ViewOptions;
@@ -1127,7 +1126,6 @@ export default class SceneView extends SceneViewSuperclass {
1127
1126
  * >
1128
1127
  * > These options are not saved in a [WebScene](https://developers.arcgis.com/javascript/latest/references/core/WebScene/).
1129
1128
  *
1130
- * @beta
1131
1129
  * @since 5.2
1132
1130
  */
1133
1131
  accessor options: ViewOptions;
@@ -1722,7 +1720,7 @@ export default class SceneView extends SceneViewSuperclass {
1722
1720
  * @see [Sample - StreamLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-streamlayer/)
1723
1721
  * @example
1724
1722
  * // Create a feature layer from a url pointing to a Feature Service
1725
- * let layer = new FeatureLayer(url);
1723
+ * let layer = new FeatureLayer({ url });
1726
1724
  *
1727
1725
  * map.add(layer);
1728
1726
  *
@@ -1736,7 +1734,7 @@ export default class SceneView extends SceneViewSuperclass {
1736
1734
  * @see [Sample - StreamLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-streamlayer/)
1737
1735
  * @example
1738
1736
  * // Create a feature layer from a url pointing to a Feature Service
1739
- * let layer = new FeatureLayer(url);
1737
+ * let layer = new FeatureLayer({ url });
1740
1738
  *
1741
1739
  * map.add(layer);
1742
1740
  *
package/views/View.d.ts CHANGED
@@ -169,7 +169,6 @@ export interface ViewProperties<TLayerView extends LayerView = LayerView> extend
169
169
  * >
170
170
  * > These options are not saved in a [WebMap](https://developers.arcgis.com/javascript/latest/references/core/WebMap/) or [WebScene](https://developers.arcgis.com/javascript/latest/references/core/WebScene/).
171
171
  *
172
- * @beta
173
172
  * @since 5.2
174
173
  */
175
174
  options?: ViewOptionsProperties;
@@ -616,7 +615,6 @@ export default abstract class View<TLayerView extends LayerView = LayerView> ext
616
615
  * >
617
616
  * > These options are not saved in a [WebMap](https://developers.arcgis.com/javascript/latest/references/core/WebMap/) or [WebScene](https://developers.arcgis.com/javascript/latest/references/core/WebScene/).
618
617
  *
619
- * @beta
620
618
  * @since 5.2
621
619
  */
622
620
  get options(): ViewOptions;
@@ -857,7 +855,7 @@ export default abstract class View<TLayerView extends LayerView = LayerView> ext
857
855
  * @see [Sample - StreamLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-streamlayer/)
858
856
  * @example
859
857
  * // Create a feature layer from a url pointing to a Feature Service
860
- * let layer = new FeatureLayer(url);
858
+ * let layer = new FeatureLayer({ url });
861
859
  *
862
860
  * map.add(layer);
863
861
  *
package/views/View2D.d.ts CHANGED
@@ -1098,7 +1098,7 @@ export default abstract class View2D extends View2DSuperclass {
1098
1098
  * [LayerView](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/) for the specified layer.
1099
1099
  * @example
1100
1100
  * // Create a feature layer from a url pointing to a Feature Service
1101
- * let layer = new FeatureLayer(url);
1101
+ * let layer = new FeatureLayer({ url });
1102
1102
  *
1103
1103
  * map.add(layer);
1104
1104
  *
@@ -1112,7 +1112,7 @@ export default abstract class View2D extends View2DSuperclass {
1112
1112
  * @see [Sample - StreamLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-streamlayer/)
1113
1113
  * @example
1114
1114
  * // Create a feature layer from a url pointing to a Feature Service
1115
- * let layer = new FeatureLayer(url);
1115
+ * let layer = new FeatureLayer({ url });
1116
1116
  *
1117
1117
  * map.add(layer);
1118
1118
  *
@@ -1,3 +1,3 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import*as t from"@amcharts/amcharts5/index.js";import{XYChart as n,ValueAxis as r,AxisRendererX as i,AxisRendererY as a,XYCursor as o,LineSeries as s}from"@amcharts/amcharts5/xy.js";import c from"@amcharts/amcharts5/themes/Dark.js";import l from"@amcharts/amcharts5/themes/Responsive.js";import{fetchMessageBundle as u,substitute as d,formatNumber as f}from"../../../intl.js";import p from"../../../core/Accessor.js";import{createTask as m}from"../../../core/asyncUtils.js";import{makeHandle as h,handlesGroup as g}from"../../../core/handleUtils.js";import"../../../core/has.js";import{throwIfAborted as _}from"../../../core/promiseUtils.js";import{watch as v,initial as y}from"../../../core/reactiveUtils.js";import{throttle as b}from"../../../core/throttle.js";import{formatDecimal as x,unitName as S}from"../../../core/unitFormatUtils.js";import{property as C,subclass as w}from"../../../core/accessorSupport/decorators.js";import{getEpsilon as T}from"../../../core/libs/gl-matrix-2/math/common.js";import{isDarkMode as E}from"../../../support/modeUtils.js";import{getConfig as D,notAvailable as O}from"./constants.js";import{getAdjustedBounds as k}from"./elevationProfileChartBoundsUtils.js";import{themeLight as A,themeDark as j}from"./elevationProfileChartTheme.js";import{binaryFindClosest as M}from"./elevationProfileGenerationUtils.js";import{createRoot as N}from"../../../widgets/support/chartUtilsAm5.js";let P=class extends p{get chartVisible(){let e=this._chartData;if(e==null)return!1;let t=0;for(let{samples:n}of e.lines)t+=n?.length??0;return e.refined||t<=D().largeChartSamples}get spinnerVisible(){return this._chartData!=null&&(this.analysisView?.progress??0)<1}get _updateParameters(){let{messages:e,_unitsMessages:t}=this;if(e&&t)return{data:this._chartData,messages:e,unitsMessages:t}}get _chartData(){let{analysisView:e,uniformScaling:t}=this;if(!this._hasGeometry||!e)return;let{effectiveDisplayUnits:n,progress:r,results:i,statistics:a}=e;return{lines:this._lineData,statistics:a,effectiveUnits:n,refined:r===1,uniformScaling:t,dynamicElevationRange:i.some(({profile:e})=>e.type===`scene`)}}get _hasGeometry(){return this.analysisView?.analysis.geometry!=null}get _lineData(){let{analysisView:e}=this;if(!e)return[];let t=[];for(let n of e.results){let e=n.profile;if(!n.available||!n.rawResult?.hasZ||!e.chartOptions.lineVisible)continue;let r=e.type!==`input`;t.push({id:e.id,type:e.type,title:e.title,color:e.color,samples:n.samples,fillEnabled:r,strokeOffsetY:r?-1:0,strokeWidth:1.5})}return t}constructor(e){super(e),this.view=null,this.analysisView=null,this.messages=null,this.uniformScaling=!1,this.hideGridLines=!1,this.hideAxisLabels=!1,this._theme=A,this._data=null,this._seriesInfos=new Map,this._pointerIsOver=!1,this._rtl=!1,this._chartInfo=null,this._unitsMessages=null,this._throttledUpdate=b(e=>{this._update(e)},D().updateThrottleMillis),this._onCursorMove=()=>{let e=this._chartInfo;if(!e||!this._pointerIsOver)return;let{chart:t,xAxis:n,yAxis:r}=e;this._updateTooltips();let i=t.get(`cursor`),a=i?.getPrivate(`positionX`)??0,o=i?.getPrivate(`positionY`)??0,s=this._data;if(s?.statistics!=null){let{maxDistance:e,minElevation:t,maxElevation:i}=s.statistics,c,l;e!=null&&(R(n)===1?(c=0,l=e):(c=V(n),l=H(n)),a=z(a,c,l,0,e)),t!=null&&i!=null&&(R(r)===1?(c=t,l=i):(c=V(r),l=H(r)),o=z(o,c,l,t,i))}this.onCursorPositionChange?.(a,o)}}initialize(){this.addHandles(m(e=>this._initializeChart(e)))}destroy(){this._chartInfo=null,this._seriesInfos.clear(),this._data=null}zoomOut(){this._chartInfo?.xAxis.zoom(0,1),this._chartInfo?.yAxis.zoom(0,1)}async _initializeChart(e){let[t,r]=await Promise.all([N(this.container),u(`esri/core/t9n/Units`)]);_(e);let i=W(this.container),a=E(this.container),o=a?j:A;t.setThemes(a?[l.new(t),c.new(t)]:[l.new(t)]),this._rtl=i,this._theme=o,this._unitsMessages=r;let s=t.container.children.push(n.new(t,{panX:!0,panY:!0,paddingTop:o.paddingTop,paddingBottom:o.paddingBottom,paddingLeft:i?o.paddingRight:o.paddingLeft,paddingRight:i?o.paddingLeft:o.paddingRight,maxTooltipDistance:-1}));s.zoomOutButton.set(`forceHidden`,!0);let d=s.xAxes.push(this._createXAxis(t)),f=s.yAxes.push(this._createYAxis(t));this._chartInfo={chart:s,xAxis:d,yAxis:f},this._updateAxisVisibility(),this._initializeTest(s),this.addHandles([this._setupZoomHandling(),this._setupCursorHandling(),K(t),v(()=>this._updateParameters,e=>this._throttledUpdate(e),y),v(()=>[this.hideAxisLabels,this.hideGridLines],()=>this._updateAxisVisibility(),y),this._throttledUpdate])}_initializeTest(e){}_update(e){if(!e||this.destroyed)return;let t=this._data,n=e.data;if(n===t&&e.messages===this.messages&&e.unitsMessages===this._unitsMessages)return;let r=t!==n,i=t?.effectiveUnits!==n?.effectiveUnits,a=t?.uniformScaling!==n?.uniformScaling;this._data=n,(r||i)&&(this._updateAxes(),this._updateSeries()),a&&this.zoomOut(),this._updateTooltips()}_createXAxis(e){let n=this._theme,a=r.new(e,{renderer:i.new(e,{})});a.setAll({extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:this._makeFormatter(e,`distance`),strictMinMax:!0,strictMinMaxSelection:!0}),a.axisHeader.set(`forceHidden`,!0);let o=a.get(`renderer`);o.setAll({inside:!1,minGridDistance:n.xAxisMinGridDistance}),o.labels.template.setAll({centerX:t.p0,centerY:t.p0,fill:t.color(n.axisLabelsColor),fontFamily:n.fontFamily,fontSize:n.axisLabelsFontSize,fontWeight:n.axisLabelsFontWeight,forceHidden:this.hideAxisLabels,maxPosition:n.xAxisMaxLabelPosition,minPosition:n.xAxisMinLabelPosition,paddingLeft:0,paddingRight:0,paddingTop:n.xAxisLabelsSpacing,visible:!this.hideAxisLabels});let s=a.set(`tooltip`,t.Tooltip.new(e,{paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0}));return s.get(`background`)?.setAll({fill:t.color(n.axisTooltipBackgroundColor),stroke:void 0}),s.label.setAll({fill:t.color(n.axisTooltipLabelColor),fontFamily:n.fontFamily,fontSize:n.axisTooltipFontSize,paddingBottom:n.axisTooltipPaddingBottom,paddingLeft:n.axisTooltipPaddingHorizontal,paddingRight:n.axisTooltipPaddingHorizontal,paddingTop:n.axisTooltipPaddingTop,direction:this._rtl?`rtl`:`ltr`}),o.grid.template.setAll({forceHidden:this.hideGridLines,stroke:t.color(n.axisGridStroke),strokeOpacity:1,visible:!this.hideGridLines}),a}_createYAxis(e){let n=this._theme,i=this._rtl,o=r.new(e,{renderer:a.new(e,{})});o.setAll({baseValue:D().noDataValue,extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:this._makeFormatter(e,`elevation`),strictMinMax:!0,strictMinMaxSelection:!0,tooltip:void 0}),o.axisHeader.set(`visible`,!1);let s=o.get(`renderer`);return s.setAll({minGridDistance:n.yAxisMinGridDistance,opposite:i,inside:!0}),s.labels.template.setAll({centerX:t.p0,centerY:t.p100,fill:t.color(n.axisLabelsColor),fontFamily:n.fontFamily,fontSize:n.axisLabelsFontSize,fontWeight:n.axisLabelsFontWeight,forceHidden:this.hideAxisLabels,maxPosition:n.yAxisMaxLabelPosition,minPosition:n.yAxisMinLabelPosition,paddingBottom:0,paddingLeft:i?0:n.yAxisLabelSpacing,paddingRight:i?n.yAxisLabelSpacing:0,paddingTop:0,textAlign:`start`,visible:!this.hideAxisLabels}),s.grid.template.setAll({forceHidden:this.hideGridLines,stroke:t.color(n.axisGridStroke),strokeOpacity:1,visible:!this.hideGridLines}),o}_updateAxisVisibility(){let e=this._chartInfo;if(!e)return;let t=!this.hideAxisLabels,n=!this.hideGridLines,r=e.xAxis.get(`renderer`);r.labels.template.set(`visible`,t),r.labels.template.set(`forceHidden`,!t),r.grid.template.set(`visible`,n),r.grid.template.set(`forceHidden`,!n);let i=e.yAxis.get(`renderer`);i.labels.template.set(`visible`,t),i.labels.template.set(`forceHidden`,!t),i.grid.template.set(`visible`,n),i.grid.template.set(`forceHidden`,!n)}_setupZoomHandling(){let e=this._chartInfo;if(!e)return h();let{xAxis:t,yAxis:n}=e,r=()=>{this.onRangeChange?.(R(t),R(n))},i=e=>[e.on(`start`,r),e.on(`end`,r)];return G([...i(t),...i(n)])}_setupCursorHandling(){let e=this._chartInfo?.chart;if(!e)return h();let t=e.plotContainer.events,n=e=>{this._pointerIsOver=e,this._updateTooltips()},r=()=>{n(!1),this.onCursorPositionChange?.(null,null)};return G([t.on(`pointerover`,()=>n(!0)),t.on(`pointerout`,r),t.on(`blur`,r)])}_updateAxes(){let e=this._chartInfo;if(!e)return;let{chart:t,xAxis:n,yAxis:r}=e,i=this._data,{minX:a,maxX:o,minY:s,maxY:c}=k({data:i,pixelWidth:n.width(),pixelHeight:r.height()}),l=!!i?.uniformScaling,u=!!i?.refined;t.setAll({panX:!0,panY:l,pinchZoomX:u,pinchZoomY:u&&l,wheelX:`panX`,wheelY:u?l?`zoomXY`:`zoomX`:`none`}),n.setAll({max:o,min:a,panX:!0,panY:!1,zoomX:!0,zoomY:l}),r.setAll({max:c,min:s,panX:!1,panY:l,zoomX:l,zoomY:l})}_updateSeries(){let e=this._seriesInfos,t=this._chartInfo;if(!t)return;let{chart:n,xAxis:r,yAxis:i}=t,a=this._data;if(!a||a.lines.length===0){this._seriesInfos.clear(),n.series.clear();return}let o=new Map,s=new Set(n.series.values),c=a.lines.length;for(let r=0;r<c;r++){let i=a.lines[r],l=e.get(i.id);l?(l.fill&&s.delete(l.fill),s.delete(l.line)):(l=F(t,i),l.fill&&n.series.push(l.fill),n.series.push(l.line)),o.set(l.id,l);let u=c-r-1;l.fill?.set(`layer`,u),l.line.set(`layer`,c+u),this._updateLineSeries(l,i)}this._seriesInfos=o;for(let e of s)n.series.removeValue(e);r.set(`layer`,c+1),i.set(`layer`,c+2)}_updateLineSeries(e,n){let r=t.color(n.color.toCss()),i=n.samples??[],a=i.length>0,{line:o,fill:s}=e;o.set(`visible`,a),o.set(`stroke`,r),s?.set(`visible`,a),s?.set(`fill`,t.Color.lighten(r,this._theme.seriesFillLighten)),o.data.setAll(i),s?.data.setAll(i)}_updateTooltips(){let e=this._chartInfo;if(!e)return;let{chart:t,xAxis:n,yAxis:r}=e,i=t.get(`cursor`);if(!this._data?.refined){i?.events.removeType(`cursormoved`),i?.dispose(),t.set(`cursor`,void 0);return}if(!i){let e=o.new(t.root,{behavior:`none`,xAxis:n,yAxis:r,snapToSeriesBy:`y`});e.lineY.set(`visible`,!1),e.events.on(`cursormoved`,this._onCursorMove),t.set(`cursor`,e)}let a=this._getSeriesTooltipText();a?this._seriesInfos.forEach(t=>{let n=t.line.get(`tooltip`)??L(e,this._theme,this._rtl);n.label.set(`text`,a),t.line.set(`tooltip`,n)}):this._seriesInfos.forEach(e=>{e.line.get(`tooltip`)?.dispose(),e.line.set(`tooltip`,void 0)}),this._chartInfo?.xAxis.getTooltip()?.setAll({tooltipText:this._getAxisTooltipText()})}_getSeriesTooltipText(){let e=this._data?.lines.map(e=>({line:e,y:this._getPointNearestToCursor(e)?.elevation})).sort(B);return!e||e.length===0||e[0].y==null?null:e.map(({y:e,line:t})=>this._getTooltipTextForLine(t,e)).join(`
2
+ import{__decorate as e}from"tslib";import*as t from"@amcharts/amcharts5/index.js";import{XYChart as n,ValueAxis as r,AxisRendererX as i,AxisRendererY as a,XYCursor as o,LineSeries as s}from"@amcharts/amcharts5/xy.js";import c from"@amcharts/amcharts5/themes/Dark.js";import l from"@amcharts/amcharts5/themes/Responsive.js";import{fetchMessageBundle as u,substitute as d,formatNumber as f}from"../../../intl.js";import p from"../../../core/Accessor.js";import{createTask as m}from"../../../core/asyncUtils.js";import{makeHandle as h,handlesGroup as g}from"../../../core/handleUtils.js";import"../../../core/has.js";import{throwIfAborted as _}from"../../../core/promiseUtils.js";import{watch as v,initial as y}from"../../../core/reactiveUtils.js";import{throttle as b}from"../../../core/throttle.js";import{formatDecimal as x,unitName as S}from"../../../core/unitFormatUtils.js";import{property as C,subclass as w}from"../../../core/accessorSupport/decorators.js";import{getEpsilon as T}from"../../../core/libs/gl-matrix-2/math/common.js";import{isDarkMode as E}from"../../../support/modeUtils.js";import{getConfig as D,notAvailable as O}from"./constants.js";import{getAdjustedBounds as k}from"./elevationProfileChartBoundsUtils.js";import{themeLight as A,themeDark as j}from"./elevationProfileChartTheme.js";import{binaryFindClosest as M}from"./elevationProfileGenerationUtils.js";import{createRoot as N}from"../../../widgets/support/chartUtilsAm5.js";let P=class extends p{get chartVisible(){let e=this._chartData;if(e==null)return!1;let t=0;for(let{samples:n}of e.lines)t+=n?.length??0;return e.refined||t<=D().largeChartSamples}get spinnerVisible(){return this._chartData!=null&&(this.analysisView?.progress??0)<1}get _updateParameters(){let{messages:e,_unitsMessages:t}=this;if(e&&t)return{data:this._chartData,messages:e,unitsMessages:t}}get _chartData(){let{analysisView:e,uniformScaling:t}=this;if(!this._hasGeometry||!e)return;let{effectiveDisplayUnits:n,progress:r,results:i,statistics:a}=e;return{lines:this._lineData,statistics:a,effectiveUnits:n,refined:r===1,uniformScaling:t,dynamicElevationRange:i.some(({profile:e})=>e.type===`scene`)}}get _hasGeometry(){return this.analysisView?.analysis.geometry!=null}get _lineData(){let{analysisView:e}=this;if(!e)return[];let t=[];for(let n of e.results){let e=n.profile;if(!n.available||!n.rawResult?.hasZ||!e.chartOptions.lineVisible)continue;let r=e.type!==`input`;t.push({id:e.id,type:e.type,title:e.title,color:e.color,samples:n.samples,fillEnabled:r,strokeOffsetY:r?-1:0,strokeWidth:1.5})}return t}constructor(e){super(e),this.view=null,this.analysisView=null,this.messages=null,this.uniformScaling=!1,this.hideGridLines=!1,this.hideAxisLabels=!1,this._theme=A,this._data=null,this._seriesInfos=new Map,this._pointerIsOver=!1,this._rtl=!1,this._chartInfo=null,this._unitsMessages=null,this._throttledUpdate=b(e=>{this._update(e)},D().updateThrottleMillis),this._onCursorMove=()=>{let e=this._chartInfo;if(!e||!this._pointerIsOver)return;let{chart:t,xAxis:n,yAxis:r}=e;this._updateTooltips();let i=t.get(`cursor`),a=i?.getPrivate(`positionX`)??0,o=i?.getPrivate(`positionY`)??0,s=this._data;if(s?.statistics!=null){let{maxDistance:e,minElevation:t,maxElevation:i}=s.statistics,c,l;e!=null&&(R(n)===1?(c=0,l=e):(c=V(n),l=H(n)),a=z(a,c,l,0,e)),t!=null&&i!=null&&(R(r)===1?(c=t,l=i):(c=V(r),l=H(r)),o=z(o,c,l,t,i))}this.onCursorPositionChange?.(a,o)}}initialize(){this.addHandles(m(e=>this._initializeChart(e)))}destroy(){this._chartInfo=null,this._seriesInfos.clear(),this._data=null}zoomOut(){this._chartInfo?.xAxis.zoom(0,1),this._chartInfo?.yAxis.zoom(0,1)}async _initializeChart(e){let[t,r]=await Promise.all([N(this.container),u(`esri/core/t9n/Units`)]);_(e);let i=W(this.container),a=E(this.container),o=a?j:A;t.setThemes(a?[l.new(t),c.new(t)]:[l.new(t)]),this._rtl=i,this._theme=o,this._unitsMessages=r;let s=t.container.children.push(n.new(t,{panX:!0,panY:!0,paddingTop:o.paddingTop,paddingBottom:o.paddingBottom,paddingLeft:i?o.paddingRight:o.paddingLeft,paddingRight:i?o.paddingLeft:o.paddingRight,maxTooltipDistance:-1}));s.zoomOutButton.set(`forceHidden`,!0);let d=s.xAxes.push(this._createXAxis(t)),f=s.yAxes.push(this._createYAxis(t));this._chartInfo={chart:s,xAxis:d,yAxis:f},this._updateAxisVisibility(),this._initializeTest(s),this.addHandles([this._setupZoomHandling(),this._setupCursorHandling(),K(t),v(()=>this._updateParameters,e=>this._throttledUpdate(e),y),v(()=>[this.hideAxisLabels,this.hideGridLines],()=>this._updateAxisVisibility(),y),this._throttledUpdate])}_initializeTest(e){}_update(e){if(!e||this.destroyed)return;let t=this._data,n=e.data;if(n===t&&e.messages===this.messages&&e.unitsMessages===this._unitsMessages)return;let r=t!==n,i=t?.effectiveUnits!==n?.effectiveUnits,a=t?.uniformScaling!==n?.uniformScaling;this._data=n,(r||i)&&(this._updateAxes(),this._updateSeries()),a&&this.zoomOut(),this._updateTooltips()}_createXAxis(e){let n=this._theme,a=r.new(e,{renderer:i.new(e,{})});a.setAll({extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:this._makeFormatter(e,`distance`),strictMinMax:!0,strictMinMaxSelection:!0}),a.axisHeader.set(`forceHidden`,!0);let o=a.get(`renderer`);o.setAll({inside:!1,minGridDistance:n.xAxisMinGridDistance}),o.labels.template.setAll({centerX:this._rtl?t.p100:t.p0,centerY:t.p0,fill:t.color(n.axisLabelsColor),fontFamily:n.fontFamily,fontSize:n.axisLabelsFontSize,fontWeight:n.axisLabelsFontWeight,forceHidden:this.hideAxisLabels,maxPosition:n.xAxisMaxLabelPosition,minPosition:n.xAxisMinLabelPosition,paddingLeft:0,paddingRight:0,paddingTop:n.xAxisLabelsSpacing,visible:!this.hideAxisLabels});let s=a.set(`tooltip`,t.Tooltip.new(e,{paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0}));return s.get(`background`)?.setAll({fill:t.color(n.axisTooltipBackgroundColor),stroke:void 0}),s.label.setAll({fill:t.color(n.axisTooltipLabelColor),fontFamily:n.fontFamily,fontSize:n.axisTooltipFontSize,paddingBottom:n.axisTooltipPaddingBottom,paddingLeft:n.axisTooltipPaddingHorizontal,paddingRight:n.axisTooltipPaddingHorizontal,paddingTop:n.axisTooltipPaddingTop,direction:this._rtl?`rtl`:`ltr`}),o.grid.template.setAll({forceHidden:this.hideGridLines,stroke:t.color(n.axisGridStroke),strokeOpacity:1,visible:!this.hideGridLines}),a}_createYAxis(e){let n=this._theme,i=this._rtl,o=r.new(e,{renderer:a.new(e,{})});o.setAll({baseValue:D().noDataValue,extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:this._makeFormatter(e,`elevation`),strictMinMax:!0,strictMinMaxSelection:!0,tooltip:void 0}),o.axisHeader.set(`visible`,!1);let s=o.get(`renderer`);return s.setAll({minGridDistance:n.yAxisMinGridDistance,opposite:i,inside:!0}),s.labels.template.setAll({centerX:i?t.p100:t.p0,centerY:t.p100,fill:t.color(n.axisLabelsColor),fontFamily:n.fontFamily,fontSize:n.axisLabelsFontSize,fontWeight:n.axisLabelsFontWeight,forceHidden:this.hideAxisLabels,maxPosition:n.yAxisMaxLabelPosition,minPosition:n.yAxisMinLabelPosition,paddingBottom:0,paddingLeft:n.yAxisLabelSpacing,paddingRight:0,paddingTop:0,textAlign:`start`,visible:!this.hideAxisLabels}),s.grid.template.setAll({forceHidden:this.hideGridLines,stroke:t.color(n.axisGridStroke),strokeOpacity:1,visible:!this.hideGridLines}),o}_updateAxisVisibility(){let e=this._chartInfo;if(!e)return;let t=!this.hideAxisLabels,n=!this.hideGridLines,r=e.xAxis.get(`renderer`);r.labels.template.set(`visible`,t),r.labels.template.set(`forceHidden`,!t),r.grid.template.set(`visible`,n),r.grid.template.set(`forceHidden`,!n);let i=e.yAxis.get(`renderer`);i.labels.template.set(`visible`,t),i.labels.template.set(`forceHidden`,!t),i.grid.template.set(`visible`,n),i.grid.template.set(`forceHidden`,!n)}_setupZoomHandling(){let e=this._chartInfo;if(!e)return h();let{xAxis:t,yAxis:n}=e,r=()=>{this.onRangeChange?.(R(t),R(n))},i=e=>[e.on(`start`,r),e.on(`end`,r)];return G([...i(t),...i(n)])}_setupCursorHandling(){let e=this._chartInfo?.chart;if(!e)return h();let t=e.plotContainer.events,n=e=>{this._pointerIsOver=e,this._updateTooltips()},r=()=>{n(!1),this.onCursorPositionChange?.(null,null)};return G([t.on(`pointerover`,()=>n(!0)),t.on(`pointerout`,r),t.on(`blur`,r)])}_updateAxes(){let e=this._chartInfo;if(!e)return;let{chart:t,xAxis:n,yAxis:r}=e,i=this._data,{minX:a,maxX:o,minY:s,maxY:c}=k({data:i,pixelWidth:n.width(),pixelHeight:r.height()}),l=!!i?.uniformScaling,u=!!i?.refined;t.setAll({panX:!0,panY:l,pinchZoomX:u,pinchZoomY:u&&l,wheelX:`panX`,wheelY:u?l?`zoomXY`:`zoomX`:`none`}),n.setAll({max:o,min:a,panX:!0,panY:!1,zoomX:!0,zoomY:l}),r.setAll({max:c,min:s,panX:!1,panY:l,zoomX:l,zoomY:l})}_updateSeries(){let e=this._seriesInfos,t=this._chartInfo;if(!t)return;let{chart:n,xAxis:r,yAxis:i}=t,a=this._data;if(!a||a.lines.length===0){this._seriesInfos.clear(),n.series.clear();return}let o=new Map,s=new Set(n.series.values),c=a.lines.length;for(let r=0;r<c;r++){let i=a.lines[r],l=e.get(i.id);l?(l.fill&&s.delete(l.fill),s.delete(l.line)):(l=F(t,i),l.fill&&n.series.push(l.fill),n.series.push(l.line)),o.set(l.id,l);let u=c-r-1;l.fill?.set(`layer`,u),l.line.set(`layer`,c+u),this._updateLineSeries(l,i)}this._seriesInfos=o;for(let e of s)n.series.removeValue(e);r.set(`layer`,c+1),i.set(`layer`,c+2)}_updateLineSeries(e,n){let r=t.color(n.color.toCss()),i=n.samples??[],a=i.length>0,{line:o,fill:s}=e;o.set(`visible`,a),o.set(`stroke`,r),s?.set(`visible`,a),s?.set(`fill`,t.Color.lighten(r,this._theme.seriesFillLighten)),o.data.setAll(i),s?.data.setAll(i)}_updateTooltips(){let e=this._chartInfo;if(!e)return;let{chart:t,xAxis:n,yAxis:r}=e,i=t.get(`cursor`);if(!this._data?.refined){i?.events.removeType(`cursormoved`),i?.dispose(),t.set(`cursor`,void 0);return}if(!i){let e=o.new(t.root,{behavior:`none`,xAxis:n,yAxis:r,snapToSeriesBy:`y`});e.lineY.set(`visible`,!1),e.events.on(`cursormoved`,this._onCursorMove),t.set(`cursor`,e)}let a=this._getSeriesTooltipText();a?this._seriesInfos.forEach(t=>{let n=t.line.get(`tooltip`)??L(e,this._theme,this._rtl);n.label.set(`text`,a),t.line.set(`tooltip`,n)}):this._seriesInfos.forEach(e=>{e.line.get(`tooltip`)?.dispose(),e.line.set(`tooltip`,void 0)}),this._chartInfo?.xAxis.getTooltip()?.setAll({tooltipText:this._getAxisTooltipText()})}_getSeriesTooltipText(){let e=this._data?.lines.map(e=>({line:e,y:this._getPointNearestToCursor(e)?.elevation})).sort(B);return!e||e.length===0||e[0].y==null?null:e.map(({y:e,line:t})=>this._getTooltipTextForLine(t,e)).join(`
3
3
  `)}_getPointNearestToCursor(e){let t=e.samples??[];if(t.length===0)return null;let n=this._chartInfo;if(!n)return null;let{chart:r,xAxis:i}=n,a=r.get(`cursor`)?.getPrivate(`positionX`)??0,o=i.toAxisPosition(a),s=i.positionToValue(o);return M(t,s,e=>e.distance)}_getTooltipTextForLine(e,t){let n=this._data,r=this.messages,i=this._unitsMessages;if(!n||!r||!i)return``;let a=`[${e.color.toHex()}]●[/]`,o=D().formatPrecision,s=d(r.chartTooltip,{name:U(e,r),elevation:t==null?O:x(i,t,n.effectiveUnits.elevation,o)});return this._rtl?s+` `+a:a+` `+s}_getAxisTooltipText(){let e=this._data,t=this._unitsMessages;if(!e||!t)return``;let n=e.lines[0],r=n?this._getPointNearestToCursor(n):null,i=D().formatPrecision;return r==null?`-`:x(t,r.distance,e.effectiveUnits.distance,i)}_makeFormatter(e,n){let r=t.NumberFormatter.new(e,{}),i=n===`distance`?new Intl.NumberFormat(void 0,{notation:`compact`,compactDisplay:`short`,maximumSignificantDigits:3}):null;return r.format=(e,t,r)=>{let a=this._data,o=this._unitsMessages;if(!a||!o||typeof e==`string`)return``;let s;return s=i&&Math.abs(e)>=1e6?i.format(e):f(e,{maximumFractionDigits:r}),`${s} ${S(o,a.effectiveUnits[n],`abbr`)}`},r}};e([C()],P.prototype,`view`,void 0),e([C()],P.prototype,`analysisView`,void 0),e([C()],P.prototype,`container`,void 0),e([C()],P.prototype,`messages`,void 0),e([C()],P.prototype,`onRangeChange`,void 0),e([C()],P.prototype,`onCursorPositionChange`,void 0),e([C()],P.prototype,`uniformScaling`,void 0),e([C()],P.prototype,`hideGridLines`,void 0),e([C()],P.prototype,`hideAxisLabels`,void 0),e([C()],P.prototype,`chartVisible`,null),e([C()],P.prototype,`spinnerVisible`,null),e([C()],P.prototype,`test`,void 0),e([C()],P.prototype,`_theme`,void 0),e([C()],P.prototype,`_data`,void 0),e([C()],P.prototype,`_seriesInfos`,void 0),e([C()],P.prototype,`_pointerIsOver`,void 0),e([C()],P.prototype,`_rtl`,void 0),e([C()],P.prototype,`_chartInfo`,void 0),e([C()],P.prototype,`_unitsMessages`,void 0),e([C()],P.prototype,`_updateParameters`,null),e([C()],P.prototype,`_chartData`,null),e([C()],P.prototype,`_hasGeometry`,null),e([C()],P.prototype,`_lineData`,null),P=e([w(`esri.views.analysis.ElevationProfile.ElevationProfileChart`)],P);function F(e,t){let{id:n}=t,r=I(e,`line-${n}`);r.setAll({dy:t.strokeOffsetY,tooltip:void 0}),r.strokes.template.setAll({strokeWidth:t.strokeWidth});let i=null;return t.fillEnabled&&(i=I(e,`fill-${n}`),i.fills.template.setAll({fillOpacity:1,visible:!0})),{id:n,line:r,fill:i}}function I({chart:e,xAxis:t,yAxis:n},r){return s.new(e.root,{connect:!1,excludeFromTotal:!0,fill:void 0,id:r,stroke:void 0,valueXField:`distance`,valueYField:`elevation`,xAxis:t,yAxis:n})}function L({chart:e},n,r){let i=t.Tooltip.new(e.root,{autoTextColor:!1,getFillFromSprite:!1,getLabelFillFromSprite:!1,pointerOrientation:`vertical`,visible:!1}),a=n.seriesTooltipPaddingHorizontal,o=n.seriesTooltipPaddingVertical;return i.label.setAll({fill:t.color(n.seriesTooltipLabelColor),fontFamily:n.fontFamily,fontSize:n.seriesTooltipFontSize,paddingBottom:o,paddingLeft:a,paddingRight:a,paddingTop:o,textAlign:r?`end`:`start`,direction:`ltr`}),i.get(`background`)?.setAll({stroke:void 0,fill:t.color(n.seriesTooltipBackgroundColor)}),i.adapters.add(`dy`,e=>{let t=n.seriesTooltipSpacing,r=i.get(`pointTo`)?.y??0;return(e??0)+(i.y()>r?t:-t)}),i}function R(e){let t=Math.abs((e.get(`end`)??0)-(e.get(`start`)??0)),n=t===0?1:1/t;return Math.abs(1-n)<T()?1:n}function z(e,t,n,r,i){return(t+e*(n-t)-r)/(i-r)}function B({y:e},{y:t}){return e==null?1:t==null?-1:t-e}function V(e){return e.positionToValue(e.get(`start`)??0)}function H(e){return e.positionToValue(e.get(`end`)??1)}function U(e,t){let n=e.title;if(n!=null)return n;switch(e.type){case`ground`:return t.profiles.ground;case`input`:return t.profiles.input;case`query`:return t.profiles.query;case`scene`:return t.profiles.scene;default:return``}}function W(e){let t=e?.closest(`[dir]`);return t!==null&&t instanceof HTMLElement&&t.dir===`rtl`||document.dir===`rtl`}function G(e){return g(e.map(K))}function K(e){return h(()=>e?.dispose())}export{P as ElevationProfileChart};
@@ -9,7 +9,6 @@ import type { UnitsProperties } from "../support/Units.js";
9
9
  /**
10
10
  * Properties used to configure [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/).
11
11
  *
12
- * @beta
13
12
  * @since 5.2
14
13
  */
15
14
  export interface ViewOptionsProperties {
@@ -122,7 +121,6 @@ export interface ViewOptionsProperties {
122
121
  * - Where unit properties are exposed, explicit units override those configured through `view.options` per measurement type.
123
122
  * - Set an explicit unit to `null` or `undefined` to use the unit from `view.options` for that measurement type again.
124
123
  *
125
- * @beta
126
124
  * @since 5.2
127
125
  * @see [Sample - View options for snapping, tooltips and units](https://developers.arcgis.com/javascript/latest/sample-code/view-options/)
128
126
  */
@@ -334,7 +334,6 @@ export default class EditorViewModel extends EventedAccessor {
334
334
  * in progress.
335
335
  *
336
336
  * @default false
337
- * @beta
338
337
  * @since 5.2
339
338
  */
340
339
  accessor useViewOptions: boolean;
@@ -605,7 +605,6 @@ export default class Editor extends Widget {
605
605
  * in progress.
606
606
  *
607
607
  * @default false
608
- * @beta
609
608
  * @since 5.2
610
609
  */
611
610
  accessor useViewOptions: boolean;
@@ -1,3 +1,3 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import*as e from"@amcharts/amcharts5/index.js";import{XYChart as t,ValueAxis as n,AxisRendererX as r,AxisRendererY as i,XYCursor as a,LineSeries as o}from"@amcharts/amcharts5/xy.js";import s from"@amcharts/amcharts5/themes/Dark.js";import c from"@amcharts/amcharts5/themes/Responsive.js";import{formatNumber as l,substitute as u}from"../../../intl.js";import{handlesGroup as d,makeHandle as f}from"../../../core/handleUtils.js";import"../../../core/has.js";import{throwIfAborted as p}from"../../../core/promiseUtils.js";import{signal as m}from"../../../core/signal.js";import{unitName as h,formatDecimal as g}from"../../../core/unitFormatUtils.js";import{convertUnit as _}from"../../../core/units.js";import{getEpsilon as v}from"../../../core/libs/gl-matrix-2/math/common.js";import{isDarkMode as ee}from"../../../support/modeUtils.js";import{getConfig as y,notAvailable as b}from"./constants.js";import{getTranslatedLineTitle as x}from"./intlUtils.js";import{niceScale as S}from"./niceScale.js";import{binaryFindClosest as te}from"./profileUtils.js";import{createRoot as ne}from"../../support/chartUtilsAm5.js";import{isRTL as C}from"../../support/widget.js";const w=`#f8f8f8`,T=`#a9a9a9`,E=`#323232`,D=.001,O={fontFamily:`Avenir Next`,paddingBottom:6,paddingLeft:0,paddingRight:0,paddingTop:0,axisGridStroke:`#f4f4f4`,axisLabelsFontSize:9,axisLabelsFontWeight:`400`,axisLabelsColor:T,axisTooltipFontSize:12,axisTooltipBackgroundColor:E,axisTooltipLabelColor:w,axisTooltipPaddingTop:3,axisTooltipPaddingBottom:3,axisTooltipPaddingHorizontal:4,xAxisMinGridDistance:50,xAxisLabelsSpacing:6,xAxisMinLabelPosition:.05,xAxisMaxLabelPosition:.9,yAxisMinGridDistance:30,yAxisLabelSpacing:4,yAxisMinLabelPosition:0,yAxisMaxLabelPosition:.8,seriesTooltipFontSize:12,seriesTooltipBackgroundColor:w,seriesTooltipLabelColor:E,seriesFillLighten:.9,seriesTooltipSpacing:6,seriesTooltipPaddingVertical:4,seriesTooltipPaddingHorizontal:4},k={...O,axisGridStroke:E,axisLabelsColor:T,axisTooltipBackgroundColor:E,axisTooltipLabelColor:w,seriesTooltipBackgroundColor:E,seriesTooltipLabelColor:w,seriesFillLighten:-.75},A={minX:void 0,maxX:void 0,minY:void 0,maxY:void 0};async function re(e){let a=await ne(e.container);p(e.abortOptions);let o=ee(e.container),l=o?k:O;a.setThemes(o?[c.new(a),s.new(a)]:[c.new(a)]);let u=C(e.container),f=a.container.children.push(t.new(a,{panX:!0,panY:!0,paddingTop:l.paddingTop,paddingBottom:l.paddingBottom,paddingLeft:u?l.paddingRight:l.paddingLeft,paddingRight:u?l.paddingLeft:l.paddingRight,maxTooltipDistance:-1}));f.zoomOutButton.set(`forceHidden`,!0);let h=f.xAxes.push(n.new(a,{renderer:r.new(a,{})})),g=f.yAxes.push(n.new(a,{renderer:i.new(a,{})})),_=m(null),v=m(`loading`),y={params:e,chart:f,xAxis:h,yAxis:g,seriesInfos:new Map,messages:null,theme:l,pointerIsOver:!1,rtl:u,onCursorPositionChange:e.onCursorPositionChange,onRangeChange:e.onRangeChange,get state(){return v.value},get data(){return _.value},set data(e){_.value=e}};N(y),ie(y),M(y);let b=d([U(y),G(y),$(a.events.once(`frameended`,()=>{v.value=`ready`})),$(a)]),x;return{destroy:()=>{b.remove(),v.value=`destroyed`},update:e=>{e.data===y.data&&e.messages===y.messages||j(y)||ae(y,e)},zoomOut:()=>P(y),test:x}}function j(e){return e.state===`destroyed`}function M({chart:e,xAxis:t,yAxis:n}){let r=a.new(e.root,{behavior:`none`,xAxis:t,yAxis:n,snapToSeriesBy:`y`});r.lineY.set(`visible`,!1),e.set(`cursor`,r)}function N(t){let{chart:n,xAxis:r,theme:i}=t;r.setAll({extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:J(t,`distance`),strictMinMax:!0,strictMinMaxSelection:!0}),r.axisHeader.set(`forceHidden`,!0);let a=r.get(`renderer`);a.setAll({inside:!1,minGridDistance:i.xAxisMinGridDistance}),a.labels.template.setAll({centerX:e.p0,centerY:e.p0,fill:e.color(i.axisLabelsColor),fontFamily:i.fontFamily,fontSize:i.axisLabelsFontSize,fontWeight:i.axisLabelsFontWeight,maxPosition:i.xAxisMaxLabelPosition,minPosition:i.xAxisMinLabelPosition,paddingLeft:0,paddingRight:0,paddingTop:i.xAxisLabelsSpacing});let o=r.set(`tooltip`,e.Tooltip.new(n.root,{paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0}));o.get(`background`)?.setAll({fill:e.color(i.axisTooltipBackgroundColor),stroke:void 0}),o.label.setAll({fill:e.color(i.axisTooltipLabelColor),fontFamily:i.fontFamily,fontSize:i.axisTooltipFontSize,paddingBottom:i.axisTooltipPaddingBottom,paddingLeft:i.axisTooltipPaddingHorizontal,paddingRight:i.axisTooltipPaddingHorizontal,paddingTop:i.axisTooltipPaddingTop,direction:t.rtl?`rtl`:`ltr`}),a.grid.template.setAll({strokeOpacity:1,stroke:e.color(i.axisGridStroke)})}function ie(t){let{yAxis:n,theme:r,rtl:i}=t;n.setAll({baseValue:y().noDataValue,extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:J(t,`elevation`),strictMinMax:!0,strictMinMaxSelection:!0,tooltip:void 0}),n.axisHeader.set(`visible`,!1);let a=n.get(`renderer`);a.setAll({minGridDistance:r.yAxisMinGridDistance,opposite:i,inside:!0}),a.labels.template.setAll({centerX:e.p0,centerY:e.p100,fill:e.color(r.axisLabelsColor),fontFamily:r.fontFamily,fontSize:r.axisLabelsFontSize,fontWeight:r.axisLabelsFontWeight,maxPosition:r.yAxisMaxLabelPosition,minPosition:r.yAxisMinLabelPosition,paddingBottom:0,paddingLeft:i?0:r.yAxisLabelSpacing,paddingRight:i?r.yAxisLabelSpacing:0,paddingTop:0,textAlign:`start`}),a.grid.template.setAll({strokeOpacity:1,stroke:e.color(r.axisGridStroke)})}function ae(e,t){if(j(e))return;let n=e.data??void 0,r=t.data??void 0,i=n!==r,a=n?.effectiveUnits!==r?.effectiveUnits,o=n?.uniformScaling!==r?.uniformScaling;e.data=r,e.messages=t.messages,(i||a)&&(oe(e),R(e)),o&&P(e),K(e)}function P(e){j(e)||(e.xAxis.zoom(0,1),e.yAxis.zoom(0,1))}function oe(e){let{chart:t,data:n,xAxis:r,yAxis:i}=e,{minX:a,maxX:o,minY:s,maxY:c}=F({data:n,pixelWidth:r.width(),pixelHeight:i.height()}),l=!!n?.uniformScaling,u=!!n?.refined;t.setAll({panX:!0,panY:l,pinchZoomX:u,pinchZoomY:u&&l,wheelX:`panX`,wheelY:u?l?`zoomXY`:`zoomX`:`none`}),r.setAll({max:o,min:a,panX:!0,panY:!1,zoomX:!0,zoomY:l}),i.setAll({max:c,min:s,panX:!1,panY:l,zoomX:l,zoomY:l})}function F({data:e,pixelWidth:t,pixelHeight:n}){if(e==null)return A;let r=e.statistics,i=r?.maxDistance,a=r?.minElevation,o=r?.maxElevation;if(i==null||a==null||o==null)return A;let s=Math.max(i-0,D),c=Math.max(o-a,D),l=e.effectiveUnits;if(e.dynamicElevationRange){let e=_(s,l.distance,l.elevation);c=Math.max(c,e/y().maxChartRatio)}return a-=.02*c,o=a+c+.1*c,[a,o]=S(a,o,10),c=o-a,e.uniformScaling?I({data:e,bounds:{minX:0,maxX:i,minY:a,maxY:o},pixelWidth:t,pixelHeight:n,centered:!0}):{minX:0,maxX:0+s,minY:a,maxY:a+c}}function I({data:e,bounds:t,pixelWidth:n,pixelHeight:r,centered:i}){if(e==null)return t;let{minX:a,maxX:o,minY:s,maxY:c}=t;if(a==null||o==null||s==null||c==null)return A;let l=o-a,u=c-s,d=e.effectiveUnits,f=_(u,d.elevation,d.distance),p=l/n,m=f/r/p;return m>=1?[a,o]=L([a,o],m):[s,c]=L([s,c],1/m),{minX:a,maxX:o,minY:s,maxY:c}}function L([e,t],n,r){let i=(t-e)*n;{let n=(e+t)/2-i/2;return[n,n+i]}}function R(e){let{chart:t,data:n,seriesInfos:r,xAxis:i,yAxis:a}=e;if(n==null||n.lines.length===0){t.series.clear();return}let o=new Map,s=new Set(t.series.values),c=n.lines.length;for(let i=0;i<c;i++){let a=n.lines[i],l=r.get(a.id);l?(l.fill&&s.delete(l.fill),s.delete(l.line)):(l=B(e,a),l.fill&&t.series.push(l.fill),t.series.push(l.line)),o.set(l.id,l);let u=c-i-1;l.fill?.set(`layer`,u),l.line.set(`layer`,c+u),z(e,l,a)}e.seriesInfos=o;for(let e of s)t.series.removeValue(e);i.set(`layer`,c+1),a.set(`layer`,c+2)}function z({theme:t},n,r){let i=e.color(r.color.toCss()),a=r.samples??[],o=a.length>0,{line:s,fill:c}=n;s.set(`visible`,o),s.set(`stroke`,i),c?.set(`visible`,o),c?.set(`fill`,e.Color.lighten(i,t.seriesFillLighten)),s.data.setAll(a),c?.data.setAll(a)}function B(e,t){let{id:n}=t,r=V(e,`line-${n}`);r.setAll({dy:t.chartStrokeOffsetY,tooltip:void 0}),r.strokes.template.setAll({strokeWidth:t.chartStrokeWidth});let i=null;return t.chartFillEnabled&&(i=V(e,`fill-${n}`),i.fills.template.setAll({fillOpacity:1,visible:!0})),{id:n,line:r,fill:i}}function V(e,t){return o.new(e.chart.root,{connect:!1,excludeFromTotal:!0,fill:void 0,id:t,stroke:void 0,valueXField:`distance`,valueYField:`elevation`,xAxis:e.xAxis,yAxis:e.yAxis})}function H({theme:t,chart:n,rtl:r}){let i=e.Tooltip.new(n.root,{autoTextColor:!1,getFillFromSprite:!1,getLabelFillFromSprite:!1,pointerOrientation:`vertical`,visible:!1}),a=t.seriesTooltipPaddingHorizontal,o=t.seriesTooltipPaddingVertical;return i.label.setAll({fill:e.color(t.seriesTooltipLabelColor),fontFamily:t.fontFamily,fontSize:t.seriesTooltipFontSize,paddingBottom:o,paddingLeft:a,paddingRight:a,paddingTop:o,textAlign:r?`end`:`start`,direction:`ltr`}),i.get(`background`)?.setAll({stroke:void 0,fill:e.color(t.seriesTooltipBackgroundColor)}),i.adapters.add(`dy`,e=>{let n=t.seriesTooltipSpacing,r=i.get(`pointTo`)?.y??0;return(e??0)+(i.y()>r?n:-n)}),i}function U(e){let{xAxis:t,yAxis:n}=e,r=()=>{e.onRangeChange(W(t),W(n))},i=e=>[e.on(`start`,r),e.on(`end`,r)];return Q([...i(t),...i(n)])}function W(e){let t=Math.abs((e.get(`end`)??0)-(e.get(`start`)??0)),n=t===0?1:1/t;return Math.abs(1-n)<v()?1:n}function G(e){let{chart:t}=e,n=t.plotContainer.events,r=t=>{e.pointerIsOver=t,K(e)},i=()=>{r(!1),e.onCursorPositionChange(null,null)};return Q([n.on(`pointerover`,()=>r(!0)),n.on(`pointerout`,i),n.on(`blur`,i)])}function K(e){let{chart:t,data:n,xAxis:r,yAxis:i}=e,o=t.get(`cursor`);if(!n?.refined){o?.events.removeType(`cursormoved`),o?.dispose(),t.set(`cursor`,void 0);return}if(!o){let n=a.new(t.root,{behavior:`none`,xAxis:r,yAxis:i,snapToSeriesBy:`y`});n.lineY.set(`visible`,!1),n.events.on(`cursormoved`,se(e)),t.set(`cursor`,n)}let s=ce(e);s?e.seriesInfos.forEach(t=>{let n=t.line.get(`tooltip`)??H(e);n.label.set(`text`,s),t.line.set(`tooltip`,n)}):e.seriesInfos.forEach(e=>{e.line.get(`tooltip`)?.dispose(),e.line.set(`tooltip`,void 0)}),e.xAxis.getTooltip().setAll({tooltipText:de(e)})}function se(e){return()=>{if(!e.pointerIsOver)return;K(e);let{chart:t,xAxis:n,yAxis:r}=e,i=t.get(`cursor`),a=i?.getPrivate(`positionX`)??0,o=i?.getPrivate(`positionY`)??0,s=e.data;if(s?.statistics!=null){let{maxDistance:e,minElevation:t,maxElevation:i}=s.statistics,c,l;e!=null&&(W(n)===1?(c=0,l=e):(c=X(n),l=Z(n)),a=q(a,c,l,0,e)),t!=null&&i!=null&&(W(r)===1?(c=t,l=i):(c=X(r),l=Z(r)),o=q(o,c,l,t,i))}e.onCursorPositionChange(a,o)}}function q(e,t,n,r,i){return(t+e*(n-t)-r)/(i-r)}function ce(e){let{data:t}=e,n=t?.lines.map(t=>({line:t,y:Y(e,t)?.elevation})).sort(le);return!n||n.length===0||n[0].y==null?null:n.map(({y:t,line:n})=>ue(e,n,t)).join(`
2
+ import*as e from"@amcharts/amcharts5/index.js";import{XYChart as t,ValueAxis as n,AxisRendererX as r,AxisRendererY as i,XYCursor as a,LineSeries as o}from"@amcharts/amcharts5/xy.js";import s from"@amcharts/amcharts5/themes/Dark.js";import c from"@amcharts/amcharts5/themes/Responsive.js";import{formatNumber as l,substitute as u}from"../../../intl.js";import{handlesGroup as d,makeHandle as f}from"../../../core/handleUtils.js";import"../../../core/has.js";import{throwIfAborted as p}from"../../../core/promiseUtils.js";import{signal as m}from"../../../core/signal.js";import{unitName as h,formatDecimal as g}from"../../../core/unitFormatUtils.js";import{convertUnit as _}from"../../../core/units.js";import{getEpsilon as v}from"../../../core/libs/gl-matrix-2/math/common.js";import{isDarkMode as ee}from"../../../support/modeUtils.js";import{getConfig as y,notAvailable as b}from"./constants.js";import{getTranslatedLineTitle as x}from"./intlUtils.js";import{niceScale as S}from"./niceScale.js";import{binaryFindClosest as te}from"./profileUtils.js";import{createRoot as ne}from"../../support/chartUtilsAm5.js";import{isRTL as C}from"../../support/widget.js";const w=`#f8f8f8`,T=`#a9a9a9`,E=`#323232`,D=.001,O={fontFamily:`Avenir Next`,paddingBottom:6,paddingLeft:0,paddingRight:0,paddingTop:0,axisGridStroke:`#f4f4f4`,axisLabelsFontSize:9,axisLabelsFontWeight:`400`,axisLabelsColor:T,axisTooltipFontSize:12,axisTooltipBackgroundColor:E,axisTooltipLabelColor:w,axisTooltipPaddingTop:3,axisTooltipPaddingBottom:3,axisTooltipPaddingHorizontal:4,xAxisMinGridDistance:50,xAxisLabelsSpacing:6,xAxisMinLabelPosition:.05,xAxisMaxLabelPosition:.9,yAxisMinGridDistance:30,yAxisLabelSpacing:4,yAxisMinLabelPosition:0,yAxisMaxLabelPosition:.8,seriesTooltipFontSize:12,seriesTooltipBackgroundColor:w,seriesTooltipLabelColor:E,seriesFillLighten:.9,seriesTooltipSpacing:6,seriesTooltipPaddingVertical:4,seriesTooltipPaddingHorizontal:4},k={...O,axisGridStroke:E,axisLabelsColor:T,axisTooltipBackgroundColor:E,axisTooltipLabelColor:w,seriesTooltipBackgroundColor:E,seriesTooltipLabelColor:w,seriesFillLighten:-.75},A={minX:void 0,maxX:void 0,minY:void 0,maxY:void 0};async function re(e){let a=await ne(e.container);p(e.abortOptions);let o=ee(e.container),l=o?k:O;a.setThemes(o?[c.new(a),s.new(a)]:[c.new(a)]);let u=C(e.container),f=a.container.children.push(t.new(a,{panX:!0,panY:!0,paddingTop:l.paddingTop,paddingBottom:l.paddingBottom,paddingLeft:u?l.paddingRight:l.paddingLeft,paddingRight:u?l.paddingLeft:l.paddingRight,maxTooltipDistance:-1}));f.zoomOutButton.set(`forceHidden`,!0);let h=f.xAxes.push(n.new(a,{renderer:r.new(a,{})})),g=f.yAxes.push(n.new(a,{renderer:i.new(a,{})})),_=m(null),v=m(`loading`),y={params:e,chart:f,xAxis:h,yAxis:g,seriesInfos:new Map,messages:null,theme:l,pointerIsOver:!1,rtl:u,onCursorPositionChange:e.onCursorPositionChange,onRangeChange:e.onRangeChange,get state(){return v.value},get data(){return _.value},set data(e){_.value=e}};N(y),ie(y),M(y);let b=d([U(y),G(y),$(a.events.once(`frameended`,()=>{v.value=`ready`})),$(a)]),x;return{destroy:()=>{b.remove(),v.value=`destroyed`},update:e=>{e.data===y.data&&e.messages===y.messages||j(y)||ae(y,e)},zoomOut:()=>P(y),test:x}}function j(e){return e.state===`destroyed`}function M({chart:e,xAxis:t,yAxis:n}){let r=a.new(e.root,{behavior:`none`,xAxis:t,yAxis:n,snapToSeriesBy:`y`});r.lineY.set(`visible`,!1),e.set(`cursor`,r)}function N(t){let{chart:n,xAxis:r,theme:i,rtl:a}=t;r.setAll({extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:J(t,`distance`),strictMinMax:!0,strictMinMaxSelection:!0}),r.axisHeader.set(`forceHidden`,!0);let o=r.get(`renderer`);o.setAll({inside:!1,minGridDistance:i.xAxisMinGridDistance}),o.labels.template.setAll({centerX:a?e.p100:e.p0,centerY:e.p0,fill:e.color(i.axisLabelsColor),fontFamily:i.fontFamily,fontSize:i.axisLabelsFontSize,fontWeight:i.axisLabelsFontWeight,maxPosition:i.xAxisMaxLabelPosition,minPosition:i.xAxisMinLabelPosition,paddingLeft:0,paddingRight:0,paddingTop:i.xAxisLabelsSpacing});let s=r.set(`tooltip`,e.Tooltip.new(n.root,{paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0}));s.get(`background`)?.setAll({fill:e.color(i.axisTooltipBackgroundColor),stroke:void 0}),s.label.setAll({fill:e.color(i.axisTooltipLabelColor),fontFamily:i.fontFamily,fontSize:i.axisTooltipFontSize,paddingBottom:i.axisTooltipPaddingBottom,paddingLeft:i.axisTooltipPaddingHorizontal,paddingRight:i.axisTooltipPaddingHorizontal,paddingTop:i.axisTooltipPaddingTop,direction:t.rtl?`rtl`:`ltr`}),o.grid.template.setAll({strokeOpacity:1,stroke:e.color(i.axisGridStroke)})}function ie(t){let{yAxis:n,theme:r,rtl:i}=t;n.setAll({baseValue:y().noDataValue,extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:J(t,`elevation`),strictMinMax:!0,strictMinMaxSelection:!0,tooltip:void 0}),n.axisHeader.set(`visible`,!1);let a=n.get(`renderer`);a.setAll({minGridDistance:r.yAxisMinGridDistance,opposite:i,inside:!0}),a.labels.template.setAll({centerX:i?e.p100:e.p0,centerY:e.p100,fill:e.color(r.axisLabelsColor),fontFamily:r.fontFamily,fontSize:r.axisLabelsFontSize,fontWeight:r.axisLabelsFontWeight,maxPosition:r.yAxisMaxLabelPosition,minPosition:r.yAxisMinLabelPosition,paddingBottom:0,paddingLeft:r.yAxisLabelSpacing,paddingRight:0,paddingTop:0,textAlign:`start`}),a.grid.template.setAll({strokeOpacity:1,stroke:e.color(r.axisGridStroke)})}function ae(e,t){if(j(e))return;let n=e.data??void 0,r=t.data??void 0,i=n!==r,a=n?.effectiveUnits!==r?.effectiveUnits,o=n?.uniformScaling!==r?.uniformScaling;e.data=r,e.messages=t.messages,(i||a)&&(oe(e),R(e)),o&&P(e),K(e)}function P(e){j(e)||(e.xAxis.zoom(0,1),e.yAxis.zoom(0,1))}function oe(e){let{chart:t,data:n,xAxis:r,yAxis:i}=e,{minX:a,maxX:o,minY:s,maxY:c}=F({data:n,pixelWidth:r.width(),pixelHeight:i.height()}),l=!!n?.uniformScaling,u=!!n?.refined;t.setAll({panX:!0,panY:l,pinchZoomX:u,pinchZoomY:u&&l,wheelX:`panX`,wheelY:u?l?`zoomXY`:`zoomX`:`none`}),r.setAll({max:o,min:a,panX:!0,panY:!1,zoomX:!0,zoomY:l}),i.setAll({max:c,min:s,panX:!1,panY:l,zoomX:l,zoomY:l})}function F({data:e,pixelWidth:t,pixelHeight:n}){if(e==null)return A;let r=e.statistics,i=r?.maxDistance,a=r?.minElevation,o=r?.maxElevation;if(i==null||a==null||o==null)return A;let s=Math.max(i-0,D),c=Math.max(o-a,D),l=e.effectiveUnits;if(e.dynamicElevationRange){let e=_(s,l.distance,l.elevation);c=Math.max(c,e/y().maxChartRatio)}return a-=.02*c,o=a+c+.1*c,[a,o]=S(a,o,10),c=o-a,e.uniformScaling?I({data:e,bounds:{minX:0,maxX:i,minY:a,maxY:o},pixelWidth:t,pixelHeight:n,centered:!0}):{minX:0,maxX:0+s,minY:a,maxY:a+c}}function I({data:e,bounds:t,pixelWidth:n,pixelHeight:r,centered:i}){if(e==null)return t;let{minX:a,maxX:o,minY:s,maxY:c}=t;if(a==null||o==null||s==null||c==null)return A;let l=o-a,u=c-s,d=e.effectiveUnits,f=_(u,d.elevation,d.distance),p=l/n,m=f/r/p;return m>=1?[a,o]=L([a,o],m):[s,c]=L([s,c],1/m),{minX:a,maxX:o,minY:s,maxY:c}}function L([e,t],n,r){let i=(t-e)*n;{let n=(e+t)/2-i/2;return[n,n+i]}}function R(e){let{chart:t,data:n,seriesInfos:r,xAxis:i,yAxis:a}=e;if(n==null||n.lines.length===0){t.series.clear();return}let o=new Map,s=new Set(t.series.values),c=n.lines.length;for(let i=0;i<c;i++){let a=n.lines[i],l=r.get(a.id);l?(l.fill&&s.delete(l.fill),s.delete(l.line)):(l=B(e,a),l.fill&&t.series.push(l.fill),t.series.push(l.line)),o.set(l.id,l);let u=c-i-1;l.fill?.set(`layer`,u),l.line.set(`layer`,c+u),z(e,l,a)}e.seriesInfos=o;for(let e of s)t.series.removeValue(e);i.set(`layer`,c+1),a.set(`layer`,c+2)}function z({theme:t},n,r){let i=e.color(r.color.toCss()),a=r.samples??[],o=a.length>0,{line:s,fill:c}=n;s.set(`visible`,o),s.set(`stroke`,i),c?.set(`visible`,o),c?.set(`fill`,e.Color.lighten(i,t.seriesFillLighten)),s.data.setAll(a),c?.data.setAll(a)}function B(e,t){let{id:n}=t,r=V(e,`line-${n}`);r.setAll({dy:t.chartStrokeOffsetY,tooltip:void 0}),r.strokes.template.setAll({strokeWidth:t.chartStrokeWidth});let i=null;return t.chartFillEnabled&&(i=V(e,`fill-${n}`),i.fills.template.setAll({fillOpacity:1,visible:!0})),{id:n,line:r,fill:i}}function V(e,t){return o.new(e.chart.root,{connect:!1,excludeFromTotal:!0,fill:void 0,id:t,stroke:void 0,valueXField:`distance`,valueYField:`elevation`,xAxis:e.xAxis,yAxis:e.yAxis})}function H({theme:t,chart:n,rtl:r}){let i=e.Tooltip.new(n.root,{autoTextColor:!1,getFillFromSprite:!1,getLabelFillFromSprite:!1,pointerOrientation:`vertical`,visible:!1}),a=t.seriesTooltipPaddingHorizontal,o=t.seriesTooltipPaddingVertical;return i.label.setAll({fill:e.color(t.seriesTooltipLabelColor),fontFamily:t.fontFamily,fontSize:t.seriesTooltipFontSize,paddingBottom:o,paddingLeft:a,paddingRight:a,paddingTop:o,textAlign:r?`end`:`start`,direction:`ltr`}),i.get(`background`)?.setAll({stroke:void 0,fill:e.color(t.seriesTooltipBackgroundColor)}),i.adapters.add(`dy`,e=>{let n=t.seriesTooltipSpacing,r=i.get(`pointTo`)?.y??0;return(e??0)+(i.y()>r?n:-n)}),i}function U(e){let{xAxis:t,yAxis:n}=e,r=()=>{e.onRangeChange(W(t),W(n))},i=e=>[e.on(`start`,r),e.on(`end`,r)];return Q([...i(t),...i(n)])}function W(e){let t=Math.abs((e.get(`end`)??0)-(e.get(`start`)??0)),n=t===0?1:1/t;return Math.abs(1-n)<v()?1:n}function G(e){let{chart:t}=e,n=t.plotContainer.events,r=t=>{e.pointerIsOver=t,K(e)},i=()=>{r(!1),e.onCursorPositionChange(null,null)};return Q([n.on(`pointerover`,()=>r(!0)),n.on(`pointerout`,i),n.on(`blur`,i)])}function K(e){let{chart:t,data:n,xAxis:r,yAxis:i}=e,o=t.get(`cursor`);if(!n?.refined){o?.events.removeType(`cursormoved`),o?.dispose(),t.set(`cursor`,void 0);return}if(!o){let n=a.new(t.root,{behavior:`none`,xAxis:r,yAxis:i,snapToSeriesBy:`y`});n.lineY.set(`visible`,!1),n.events.on(`cursormoved`,se(e)),t.set(`cursor`,n)}let s=ce(e);s?e.seriesInfos.forEach(t=>{let n=t.line.get(`tooltip`)??H(e);n.label.set(`text`,s),t.line.set(`tooltip`,n)}):e.seriesInfos.forEach(e=>{e.line.get(`tooltip`)?.dispose(),e.line.set(`tooltip`,void 0)}),e.xAxis.getTooltip().setAll({tooltipText:de(e)})}function se(e){return()=>{if(!e.pointerIsOver)return;K(e);let{chart:t,xAxis:n,yAxis:r}=e,i=t.get(`cursor`),a=i?.getPrivate(`positionX`)??0,o=i?.getPrivate(`positionY`)??0,s=e.data;if(s?.statistics!=null){let{maxDistance:e,minElevation:t,maxElevation:i}=s.statistics,c,l;e!=null&&(W(n)===1?(c=0,l=e):(c=X(n),l=Z(n)),a=q(a,c,l,0,e)),t!=null&&i!=null&&(W(r)===1?(c=t,l=i):(c=X(r),l=Z(r)),o=q(o,c,l,t,i))}e.onCursorPositionChange(a,o)}}function q(e,t,n,r,i){return(t+e*(n-t)-r)/(i-r)}function ce(e){let{data:t}=e,n=t?.lines.map(t=>({line:t,y:Y(e,t)?.elevation})).sort(le);return!n||n.length===0||n[0].y==null?null:n.map(({y:t,line:n})=>ue(e,n,t)).join(`
3
3
  `)}function le({y:e},{y:t}){return e==null?1:t==null?-1:t-e}function ue(e,t,n){let{data:r,messages:i}=e;if(r==null||i==null)return``;let a=`[${t.color.toHex()}]●[/]`,o=y().formatPrecision,s=u(i.chartTooltip,{name:x(t,i),elevation:n==null?b:g(i,n,r.effectiveUnits.elevation,o)});return e.rtl?s+` `+a:a+` `+s}function de(e){let{data:t,messages:n}=e;if(t==null||n==null)return``;let r=t.lines[0],i=r?Y(e,r):null,a=y().formatPrecision;return i==null?`-`:g(n,i.distance,t.effectiveUnits.distance,a)}function J(t,n){let r=e.NumberFormatter.new(t.chart.root,{});return r.format=(e,r,i)=>{let{data:a,messages:o}=t;return o==null||a==null||typeof e==`string`?``:`${l(e,{maximumFractionDigits:i})} ${h(o,a.effectiveUnits[n],`abbr`)}`},r}function Y({chart:e,xAxis:t},n){let r=n.samples??[];if(r.length===0)return null;let i=e.get(`cursor`)?.getPrivate(`positionX`)??0,a=t.toAxisPosition(i),o=t.positionToValue(a);return te(r,o,e=>e.distance)}function X(e){return e.positionToValue(e.get(`start`)??0)}function Z(e){return e.positionToValue(e.get(`end`)??1)}function Q(e){return d(e.map($))}function $(e){return f(()=>{e?.dispose()})}export{re as createChart,F as getAdjustedBounds};
@@ -955,7 +955,6 @@ export default class SketchViewModel extends EventedAccessor {
955
955
  * in progress.
956
956
  *
957
957
  * @default false
958
- * @beta
959
958
  * @since 5.2
960
959
  * @example
961
960
  * ```js
@@ -692,7 +692,6 @@ export default class Sketch extends Widget<SketchProperties> {
692
692
  * in progress.
693
693
  *
694
694
  * @default false
695
- * @beta
696
695
  * @since 5.2
697
696
  */
698
697
  accessor useViewOptions: boolean;
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6023],{52106(e,t,r){r.d(t,{A:()=>C});var i,s,l=r(32198),a=r(40124),o=r(69540),n=r(51447),u=r(25482),p=r(53966),h=r(36708),y=r(24326),d=r(91429),m=r(12195),g=r(65864),f=r(50498),c=r(55156),b=r(60950),v=r(54339),M=r(94128),x=r(33910);const S=Symbol("meshGeometryHandles");function w(e){if(null==e)return null;let t={};for(let r in e){let i=e[r];i&&(t[r]=i.toJSON())}return 0===Object.keys(t).length?null:t}let C=class extends((0,o.OU)(u.o)){static{i=M.Z}static{s=this}constructor(e){super(e),this[i]=!0,this.distance=null,this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this.statisticsAggregatedIds=void 0,this._version=0,Object.defineProperty(this,"uid",{value:(0,y.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,n.eF)(p.A.getLogger(this),"Graphic",{version:"4.30"})}set aggregateGeometries(e){let t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){let t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){let t=this._get("geometry");t!==e&&(this._set("geometry",e),this._watchMeshGeometryChanges(),this._notifyLayer("geometry",t,e))}set popupTemplate(e){let t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){let t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){let t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new s({aggregateGeometries:this.aggregateGeometries,statisticsAggregatedIds:this.statisticsAggregatedIds,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;let t=(0,b.E_)(this.origin);if(t)return t.popupTemplate??(e?t.defaultPopupTemplate:null)??null;let r=this.origin&&"layer"in this.origin?this.origin.layer:null;for(let t of[r,this.sourceLayer,this.layer])if(t&&"object"==typeof t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&null!=t.defaultPopupTemplate)return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){let r=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",r,t,e)}else this.attributes={[e]:t}}getObjectId(){let e=(0,c.I)(this.origin);if(e)return(0,v.r)(this,e);let t=this.sourceLayer??this.layer;return t?(0,v.r)(this,t):null}getGlobalId(){let e=(0,c.I)(this.origin);if(e?.globalIdField)return this.getAttribute(e.globalIdField);let t=this.sourceLayer??this.layer;return t&&"globalIdField"in t&&t.globalIdField?this.getAttribute(t.globalIdField):null}toJSON(){let e={aggregateGeometries:w(this.aggregateGeometries),geometry:this.geometry?.toJSON()??null,symbol:this.symbol?.toJSON()??null,attributes:(0,m.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null};return this.statisticsAggregatedIds?.length&&(e.aggregateIds=[...this.statisticsAggregatedIds]),null!=this.distance&&(e.distance=this.distance),e}notifyMeshTransformChanged(e={}){let{geometry:t}=this;if("mesh"===t?.type){let r={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",r,r,e.action)}}_notifyLayer(e,t,r,i){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;let s={graphic:this,property:e,oldValue:t,newValue:r};"origin-transform"===e&&(s.action=i),"attributes"===e&&(s.attributeName=i),this.layer.graphicChanged(s)}_watchMeshGeometryChanges(){this.removeHandles(S);let e=this.geometry;"mesh"===e?.type&&this.addHandles([(0,h.z7)(()=>e.vertexSpace.origin?{localMatrix:e.transform?.localMatrix,origin:e.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{(this._lastMeshTransform.localMatrix!==e||this._lastMeshTransform.origin!==t)&&(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,h.z7)(()=>({vertexAttributes:e.vertexAttributes}),()=>{e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",e,e)},{equals:(e,t)=>e===t,sync:!0})],S)}};(0,l.Cg)([(0,d.MZ)({value:null,json:{read:function(e){if(!e)return null;let t={};for(let r in e){let i=(0,g.rS)(e[r]);i&&(t[r]=i)}return 0===Object.keys(t).length?null:t}}})],C.prototype,"aggregateGeometries",null),(0,l.Cg)([(0,d.MZ)({value:null})],C.prototype,"attributes",null),(0,l.Cg)([(0,d.MZ)({value:null,types:f.yR,json:{read:g.rS}})],C.prototype,"geometry",null),(0,l.Cg)([(0,d.MZ)()],C.prototype,"distance",void 0),(0,l.Cg)([(0,d.MZ)({type:Boolean})],C.prototype,"isAggregate",void 0),(0,l.Cg)([(0,d.MZ)({clonable:!1})],C.prototype,"layer",void 0),(0,l.Cg)([(0,d.MZ)({clonable:"reference"})],C.prototype,"origin",void 0),(0,l.Cg)([(0,d.MZ)({type:a.A,value:null})],C.prototype,"popupTemplate",null),(0,l.Cg)([(0,d.MZ)({clonable:"reference"})],C.prototype,"sourceLayer",void 0),(0,l.Cg)([(0,d.MZ)({json:{name:"aggregateIds",read:e=>e?.map(e=>Array.isArray(e)?JSON.stringify(e):e)}})],C.prototype,"statisticsAggregatedIds",void 0),(0,l.Cg)([(0,d.MZ)({value:null,types:x.Es})],C.prototype,"symbol",null),(0,l.Cg)([(0,d.MZ)({clonable:!1,json:{read:!1,write:!1}})],C.prototype,"_version",void 0),(0,l.Cg)([(0,d.MZ)({type:Boolean,value:!0})],C.prototype,"visible",null),C=s=(0,l.Cg)([(0,d.$K)("esri.Graphic")],C)},69052(e,t,r){r.d(t,{hr:()=>s});var i=r(34727);class s{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return l(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,i.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+a(this.range,e-t,r)}minimalMonotonic(e,t,r){return l(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);let r=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(i)?r:i}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function l(e,t,r,i,s=0,l=!1){return(i-=s)<t?i+=a(e,t-i):i>r&&(i-=a(e,i-r)),l&&i===r&&(i=t),i+s}function a(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const o=new s(0,2*Math.PI),n=(new s(-Math.PI,Math.PI),new s(0,360));r.d(t,["ie",0,n,"uC",0,o])},18370(e,t,r){r.d(t,{z:()=>s});class i{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return this._promise??=this._import().then(async e=>(this.module=e,e)),this._promise}}function s(e){return new i(e)}},52039(e,t,r){r.d(t,{O7:()=>y,el:()=>u});var i=r(69052),s=(r(49186),r(18370)),l=r(17676),a=(r(5443),r(39829)),o=(r(82799),r(16930)),n=(r(80754),r(21325));async function u(e,t,r){Array.isArray(e)||(e=[e]),"object"==typeof t&&t&&"authMode"in t&&(r=t);let i=null;for(let t of e)i??=t?.spatialReference;if(!i)return e;let s=(0,n.Vp)(i);if(!s)return e;if(1===e.length&&"extent"===e[0]?.type){let t=e[0].clone().normalizeAsSingleGeometry(s);return["xmin"in t?t:new a.A(t)]}let[o,u]=s.valid,y=!1;for(let t of e){if(!t)continue;if("point"===t.type){y||=t.x>=u,y||=t.x<=o;continue}let{extent:e}=t;if(null==e){y=!0;break}y||=e.xmin>=u,y||=e.xmin<=o,y||=e.xmax>=u,y||=e.xmax<=o}if(!y)return e;let[{foldInto360Range:d},m]=await(0,l.qr)(Promise.all([p.getImportPromise(),h.getImportPromise()]),r),g=m.fromSpatialReference(i);return e.map(e=>{if(null==e||"mesh"===e.type)return e;let t=m.fromGeometry(e),r=m.toGeometry(d(t,g),i);return"extent"===e.type&&1===r?.rings.length?r.extent:r})}const p=(0,s.z)(()=>r.e(4144).then(()=>r(4144)).then(e=>e.load().then(()=>e))),h=(0,s.z)(()=>Promise.all([r.e(9187),r.e(8885),r.e(9117),r.e(3299),r.e(1550)]).then(()=>r(78125)));function y(e,t,r){let i=(0,n.Vp)(r);if(null==i)return e;let[s,l]=i.valid,a=2*l,o=0,u=0;t>l?o=Math.ceil(Math.abs(t-l)/a):t<s&&(o=-Math.ceil(Math.abs(t-s)/a)),e>l?u=Math.ceil(Math.abs(e-l)/a):e<s&&(u=-Math.ceil(Math.abs(e-s)/a));let p=e+(o-u)*a,h=p-t;return h>l?p-=a:h<s&&(p+=a),p}function d(e){let t=(0,n.Vp)(e);if(null==t)return null;let[r,s]=t.valid;return new i.hr(r,s)}const m=d(o.A.WGS84);d(o.A.WebMercator),r.d(t,["Y_",0,m])},80754(e,t,r){r.d(t,{kS:()=>u,kd:()=>n});var i=r(82799),s=r(16930),l=r(60408),a=r(52006);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:s.A.WebMercator}),minus180Line:new i.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:s.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.A({paths:[[[180,-180],[180,180]]],spatialReference:s.A.WGS84}),minus180Line:new i.A({paths:[[[-180,-180],[-180,180]]],spatialReference:s.A.WGS84})}};function n(e,t){return Math.ceil((e-t)/(2*t))}function u(e,t){if((0,a.Ed)(e))for(let r of function(e){return(0,l.Bi)(e)?e.curveRings:e.curvePaths}(e))for(let e of r)if((0,a.aO)(e)){let[r,i]=e.c;r[0]+=t,i[0]+=t}else if((0,a.FG)(e)){let[r,i]=e.a;r[0]+=t,i[0]+=t}else if((0,a.n1)(e)){let[r,i,s]=e.b;r[0]+=t,i[0]+=t,s[0]+=t}else e[0]+=t;for(let r of function(e){return(0,l.Bi)(e)?e.rings:e.paths}(e))for(let e of r)e[0]+=t;return e}r.d(t,["j7",0,o])},55156(e,t,r){r.d(t,{I:()=>s});const i=Symbol("idFieldsProviderSymbol");function s(e){return(t=e)&&i in t?e[i]:void 0;var t}r.d(t,["e",0,i])},7656(e,t,r){r.r(t),r.d(t,{default:()=>B});var i=r(32198),s=r(56507),l=r(7762),a=r(49186),o=r(81583),n=r(34727),u=r(25728),p=r(17676),h=r(91429),y=r(78888),d=r(35666),m=r(5443),g=r(83960),f=r(21325),c=r(4146),b=r(52136),v=r(98534),M=r(18768),x=r(63074),S=r(69208),w=r(34287),C=r(8303),I=r(54310),A=r(25036),O=r(91921),_=r(82935),Z=r(10873),T=r(69622),P=r(39516);function L(e,t){return"floorInfo"in t&&t.floorInfo?.floorField?function(e,t){if(!e?.length)return null;let r=e.filter(e=>""!==e).map(e=>`'${e}'`);return r.push("''"),`${t} IN (${r.join(",")}) OR ${t} IS NULL`}(e,t.floorInfo.floorField):null}var N=r(63389);const F={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let j=class extends T.A{constructor(e){super(e),this.floors=null,this.scale=0}destroy(){this.layer=null}get dynamicLayers(){if(!this.hasDynamicLayers)return null;let e=this.visibleSublayers.map(e=>{let t=L(this.floors,e);return e.toExportImageJSON(t)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&(0,N.Sk)(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",e=>this.notifyChange(F[e.propertyName]))],"layer"))}get layers(){let e=this.visibleSublayers;return e?e.length?"show:"+e.map(e=>e.id).join(","):"show:-1":null}get layerDefs(){let e=!!this.floors?.length,t=this.visibleSublayers.filter(t=>null!=t.definitionExpression||e&&null!=t.floorInfo);return t.length?JSON.stringify(t.reduce((e,t)=>{let r=L(this.floors,t),i=(0,P.mA)(r,t.definitionExpression);return null!=i&&(e[t.id]=i),e},{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers");let e=this.layer;return e&&(e.commitProperty("dpi"),e.commitProperty("imageFormat"),e.commitProperty("imageTransparency"),e.commitProperty("gdbVersion")),(this._get("version")||0)+1}get visibleSublayers(){let e=[];if(!this.layer)return e;let t=this.layer.sublayers,r=this.scale,i=t=>{t.visible&&(0===r||(0,g.zx)(r,t.minScale,t.maxScale))&&(t.sublayers?t.sublayers.forEach(i):e.unshift(t))};t?.forEach(i);let s=this._get("visibleSublayers");return!s||s.length!==e.length||s.some((t,r)=>e[r]!==t)?e:s}toJSON(){let e=this.layer,t={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?t.dynamicLayers=this.dynamicLayers:t={...t,layers:this.layers,layerDefs:this.layerDefs},t}};(0,i.Cg)([(0,h.MZ)({readOnly:!0})],j.prototype,"dynamicLayers",null),(0,i.Cg)([(0,h.MZ)()],j.prototype,"floors",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],j.prototype,"hasDynamicLayers",null),(0,i.Cg)([(0,h.MZ)()],j.prototype,"layer",null),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],j.prototype,"layers",null),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],j.prototype,"layerDefs",null),(0,i.Cg)([(0,h.MZ)({type:Number})],j.prototype,"scale",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],j.prototype,"version",null),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],j.prototype,"visibleSublayers",null),j=(0,i.Cg)([(0,h.$K)("esri.layers.support.ExportImageParameters")],j);var R=r(33446),J=r(15775),G=r(91908),q=r(88625),z=r(79677),E=r(56400),D=r(36005),V=r(43937);let k=class extends((0,x.dM)((0,_.e)((0,A.j)((0,O.I)((0,v.V)((0,M.b)((0,w.q)((0,C.A)((0,u.M)((0,I.J)((0,b.p)((0,S.d)(c.A))))))))))))){constructor(e){super(e),this._exportImageParameters=new j({layer:this}),this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.elevationInfo=new q.A({mode:"on-the-ground"}),this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null,this._debouncedSaveOperations=(0,p.sg)(async(e,t,i)=>{let{save:s,saveAs:l}=await r.e(390).then(()=>r(10390));switch(e){case 0:return s(this,t);case 1:return l(this,i,t)}})}normalizeCtorArgs(e){return"string"==typeof e?{url:e}:e}load(e){let t=null==e?null:e.signal;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(p.QP).then(()=>this._fetchService(t))),Promise.resolve(this)}destroy(){this._exportImageParameters.destroy()}readImageFormat(e,t){let r=t.supportedImageFormatTypes;return r&&r.includes("PNG32")?"png32":"png24"}get loaded(){return super.loaded}get portalItem(){return super.portalItem}set portalItem(e){super.portalItem=e}writeSublayers(e,t,r,i){if(!this.loaded||!e)return;let s,l=e.slice().reverse().flatten(({sublayers:e})=>e&&e.toArray().reverse()).toArray(),a=!1,o=(0,d.aB)(i.origin);if(this.capabilities?.operations.supportsExportMap&&this.capabilities?.exportMap?.supportsDynamicLayers)if(3===o){let e=this.createSublayersForOrigin("service").sublayers;a=(0,N.Zx)(l,e,2)}else if(o>3){let e=this.createSublayersForOrigin("portal-item");a=(0,N.Zx)(l,e.sublayers,(0,d.aB)(e.origin)),s=e.originWithPartialOverrides}let n=[],u={writeSublayerStructure:a,...i,minimumWritableOrigin:s},p=a||this.hasVisibleLayersForOrigin(o);l.forEach(e=>{let t=e.write({},u);n.push(t),p||="user"===e.originOf("visible")}),n.some(e=>Object.keys(e).length>1)&&(t.layers=n),p&&(t.visibleLayers=l.filter(e=>e.visible).map(e=>e.id))}createExportImageParameters(e,t,r,i){let s=i?.pixelRatio??1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian()),this._exportImageParameters.floors=i?.floors??null,this._exportImageParameters.scale=i?.scale??(0,g.X_)({extent:e,width:t})*s;let l=this._exportImageParameters.toJSON(),a=!i?.rotation||this.version<10.3?{}:{rotation:-i.rotation},o=e?.spatialReference,u=(0,f.YX)(o),p=this._exportImageParameters.scale/(0,g.X_)({extent:e,width:t});p=(0,n.Sp)(p,s)?s:p,l.dpi*=p;let h={};if(i?.timeExtent){let{start:e,end:t}=i.timeExtent.toJSON();h.time=e&&t&&e===t?""+e:`${e??"null"},${t??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(h.time="null,null");return{bbox:e?e.xmin+","+e.ymin+","+e.xmax+","+e.ymax:void 0,bboxSR:u,imageSR:u,size:t+","+r,mapScale:this._exportImageParameters.scale,...l,...a,...h}}async fetchImage(e,t,r,i){let{data:s}=await this._fetchImage("image",e,t,r,i);return s}async fetchImageBitmap(e,t,r,i){let{data:s,url:l}=await this._fetchImage("blob",e,t,r,i);return(0,R.mn)(s,l,i)}async fetchRecomputedExtents(e={}){let t={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:r}=await(0,s.A)(this.url,t),{extent:i,fullExtent:l,timeExtent:a}=r,o=i||l;return{fullExtent:o&&m.A.fromJSON(o),timeExtent:a&&z.A.fromJSON({start:a[0],end:a[1]})}}loadAll(){return(0,o.g)(this,e=>{e(this.allSublayers),e(this.subtables)})}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}serviceSupportsSpatialReference(e){return(0,G.D)(this,e)}async _fetchImage(e,t,r,i,l){let o={responseType:e,signal:l?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(t,r,i,l),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},n=this.parsedUrl.path+"/export";if(null!=o.query?.dynamicLayers&&!this.capabilities?.exportMap?.supportsDynamicLayers)throw new a.A("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:o.query});try{let{data:e}=await(0,s.A)(n,o);return{data:e,url:n}}catch(e){throw(0,p.zf)(e)?e:new a.A("mapimagelayer:image-fetch-error",`Unable to load image: ${n}`,{error:e})}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});let{data:t,ssl:r}=await(0,s.A)(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:e});r&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})}hasVisibleLayersForOrigin(e){return!(null==e||!this.sublayersSourceJSON[e]?.visibleLayers)}};(0,i.Cg)([(0,h.MZ)((0,E.P6)("dateFieldsTimeReference"))],k.prototype,"dateFieldsTimeZone",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean})],k.prototype,"datesInUnknownTimezone",void 0),(0,i.Cg)([(0,h.MZ)()],k.prototype,"dpi",void 0),(0,i.Cg)([(0,h.MZ)()],k.prototype,"elevationInfo",void 0),(0,i.Cg)([(0,h.MZ)()],k.prototype,"gdbVersion",void 0),(0,i.Cg)([(0,h.MZ)()],k.prototype,"imageFormat",void 0),(0,i.Cg)([(0,D.w)("imageFormat",["supportedImageFormatTypes"])],k.prototype,"readImageFormat",null),(0,i.Cg)([(0,h.MZ)({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],k.prototype,"imageMaxHeight",void 0),(0,i.Cg)([(0,h.MZ)({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],k.prototype,"imageMaxWidth",void 0),(0,i.Cg)([(0,h.MZ)()],k.prototype,"imageTransparency",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],k.prototype,"isReference",void 0),(0,i.Cg)([(0,h.MZ)({json:{read:!1,write:!1}})],k.prototype,"labelsVisible",void 0),(0,i.Cg)([(0,h.MZ)({type:["ArcGISMapServiceLayer"]})],k.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,h.MZ)({json:{read:!1,write:!1}})],k.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,h.MZ)((0,E.P6)("preferredTimeReference"))],k.prototype,"preferredTimeZone",void 0),(0,i.Cg)([(0,h.MZ)()],k.prototype,"sourceJSON",void 0),(0,i.Cg)([(0,h.MZ)({type:l.A.ofType(J.A),json:{write:{ignoreOrigin:!0}}})],k.prototype,"sublayers",void 0),(0,i.Cg)([(0,V.K)("sublayers",{layers:{type:[J.A]},visibleLayers:{type:[y.jz]}})],k.prototype,"writeSublayers",null),(0,i.Cg)([(0,h.MZ)({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],k.prototype,"listMode",void 0),(0,i.Cg)([(0,h.MZ)({json:{read:!1},readOnly:!0,value:"map-image"})],k.prototype,"type",void 0),(0,i.Cg)([(0,h.MZ)(Z.OZ)],k.prototype,"url",void 0),k=(0,i.Cg)([(0,h.$K)("esri.layers.MapImageLayer")],k);const B=k},54339(e,t,r){function i(e,t){switch(t.type){case"object-id":case"unique-id-simple":return e.attributes[t.fieldName];case"unique-id-composite":{let r=[];for(let i of t.fieldNames)r.push(e.attributes[i]??null);return JSON.stringify(r)}}}function s(e,t){if("uniqueIdFields"in t&&t.uniqueIdFields?.length){if(1===t.uniqueIdFields.length)return e.attributes?.[t.uniqueIdFields[0]];let r=t.uniqueIdFields.map(t=>e.attributes?.[t]);return JSON.stringify(r)}return"objectIdField"in t&&t.objectIdField?e.attributes?.[t.objectIdField]:null}r.d(t,{W:()=>i,r:()=>s})},82935(e,t,r){var i=r(32198),s=r(91429),l=r(30524),a=r(96184),o=r(73133),n=r(79677),u=r(10184),p=r(36005);const h={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation"}}};r.d(t,["B",0,h,"e",0,e=>{let t=e,r=class extends t{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(e,t){let r=t.timeInfo.exportOptions;if(!r)return null;let i=r.timeOffset,s=o.j.fromJSON(r.timeOffsetUnits);return i&&s?new u.A({value:i,unit:s}):null}get timeInfo(){return this._get("timeInfo")}set timeInfo(e){(0,l.sv)(e,this.fieldsIndex),this._set("timeInfo",e)}};return(0,i.Cg)([(0,s.MZ)({type:n.A,json:{write:!1}})],r.prototype,"timeExtent",void 0),(0,i.Cg)([(0,s.MZ)({type:u.A})],r.prototype,"timeOffset",void 0),(0,i.Cg)([(0,p.w)("service","timeOffset",["timeInfo.exportOptions"])],r.prototype,"readOffset",null),(0,i.Cg)([(0,s.MZ)({value:null,type:a.A,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],r.prototype,"timeInfo",null),(0,i.Cg)([(0,s.MZ)(h)],r.prototype,"useViewTime",void 0),r=(0,i.Cg)([(0,s.$K)("esri.layers.mixins.TemporalLayer")],r),r}])},91908(e,t,r){r.d(t,{D:()=>l});var i=r(60694);const s=[];function l(e,t){if((0,i.Wo)(e.url??""))return!0;let{wkid:r}=t;for(let t of s){if((e.version??0)>=t[0])return!0;if("function"==typeof t[1]&&(t[1]=t[1]()),t[1].has(r))return!1}return!0}s.push([10.91,()=>{let e=new Set([9709,9716,9741,9761,9766]);for(let t=9712;t<=9713;t++)e.add(t);for(let t=9748;t<=9749;t++)e.add(t);for(let t=20904;t<=20932;t++)e.add(t);for(let t=21004;t<=21032;t++)e.add(t);for(let t=21207;t<=21264;t++)e.add(t);for(let t=21307;t<=21364;t++)e.add(t);for(let t=23301;t<=23333;t++)e.add(t);for(let t=102759;t<=102760;t++)e.add(t);for(let t=102934;t<=102955;t++)e.add(t);return e}]),s.push([10.9,()=>{let e=new Set([9300,9354,9364,9367,9373,9377,9387,9456,9473,9498,9678,9680,29874,103599,103872,104028]);for(let t=9356;t<=9360;t++)e.add(t);for(let t=9404;t<=9407;t++)e.add(t);for(let t=9476;t<=9482;t++)e.add(t);for(let t=9487;t<=9494;t++)e.add(t);for(let t=9697;t<=9699;t++)e.add(t);return e}]),s.push([10.81,()=>{let e=new Set([9265,9333,103598,103699]);for(let t=9248;t<=9254;t++)e.add(t);for(let t=9271;t<=9273;t++)e.add(t);for(let t=9284;t<=9285;t++)e.add(t);for(let t=21453;t<=21463;t++)e.add(t);return e}]),s.push([10.8,()=>{let e=new Set([8088,8395,8428,8433,8531,8687,8692,8694,8699,8900,9003,9006,9009,9012,9017,9191]);for(let t=8035;t<=8036;t++)e.add(t);for(let t=8455;t<=8456;t++)e.add(t);for(let t=8518;t<=8529;t++)e.add(t);for(let t=8533;t<=8536;t++)e.add(t);for(let t=8538;t<=8540;t++)e.add(t);for(let t=8677;t<=8679;t++)e.add(t);for(let t=8902;t<=8903;t++)e.add(t);for(let t=8907;t<=8910;t++)e.add(t);for(let t=8949;t<=8951;t++)e.add(t);for(let t=8972;t<=8987;t++)e.add(t);for(let t=9039;t<=9040;t++)e.add(t);for(let t=9068;t<=9069;t++)e.add(t);for(let t=9140;t<=9141;t++)e.add(t);for(let t=9148;t<=9150;t++)e.add(t);for(let t=9153;t<=9159;t++)e.add(t);for(let t=9205;t<=9218;t++)e.add(t);for(let t=9221;t<=9222;t++)e.add(t);for(let t=54098;t<=54101;t++)e.add(t);return e}]),s.push([10.71,()=>{let e=new Set([6316]);for(let t=8351;t<=8353;t++)e.add(t);for(let t=9294;t<=9297;t++)e.add(t);for(let t=22619;t<=22621;t++)e.add(t);for(let t=103586;t<=103594;t++)e.add(t);return e}])},22671(e,t,r){r.d(t,{A:()=>b});var i,s=r(32198),l=r(52106),a=r(66552),o=r(25482),n=r(4718),u=r(91429),p=r(16930),h=r(60408),y=r(65864),d=r(50498),m=r(20437),g=r(36005),f=r(43937);const c=new a.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let b=i=class extends o.o{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,l.A)}writeGeometryType(e,t,r,i){if(e)return void c.write(e,t,r,i);let{features:s}=this;if(s)for(let e of s)if(null!=e?.geometry)return void c.write(e.geometry.type,t,r,i)}readQueryGeometry(e,t){if(!e)return null;let r=!!e.spatialReference,i=(0,y.rS)(e);return i&&!r&&t.spatialReference&&(i.spatialReference=p.A.fromJSON(t.spatialReference)),i}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());let{features:r}=this;if(r)for(let e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new i(this.cloneProperties())}cloneProperties(){return(0,n.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){let t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){let i=t.features[r];i.geometry&&=(e?.[r])?.toJSON()||i.geometry}return t}quantize(e){let{scale:[t,r],translate:[i,s]}=e,l=this.features,a=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-i)/t),e=>Math.round((s-e)/r));for(let e=0,t=l.length;e<t;e++)a?.(l[e].geometry)||(l.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){let{geometryType:e,features:t,transform:r}=this;if(!r)return this;let{translate:[i,s],scale:[l,a]}=r,o=null,n=null;if(this.hasZ&&null!=r?.scale?.[2]){let{translate:[,,e],scale:[,,t]}=r;o=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){let{translate:[,,,e],scale:[,,,t]}=r;n=r=>null==r?r:r*t+e}let u=this._getHydrationFunction(e,e=>e*l+i,e=>s-e*a,o,n);for(let{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){let i=p.A.fromJSON(t.spatialReference),s=[];for(let t=0;t<e.length;t++){let l=e[t],a=r.fromJSON(l),o=l.geometry?.spatialReference;null!=a.geometry&&!o&&(a.geometry.spatialReference=i);let n=l.aggregateGeometries,u=a.aggregateGeometries;if(n&&null!=u)for(let e in u){let t=u[e],r=n[e]?.spatialReference;null!=t&&!r&&(t.spatialReference=i)}s.push(a)}return s}_quantizePoints(e,t,r){let i,s,l=[];for(let a=0,o=e.length;a<o;a++){let o=e[a];if(a>0){let e=t(o[0]),a=r(o[1]);(e!==i||a!==s)&&(l.push([e-i,a-s]),i=e,s=a)}else i=t(o[0]),s=r(o[1]),l.push([i,s])}return l.length>0?l:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{let i=(0,h.Bi)(e)?e.rings:e.paths,s=[];for(let e=0,l=i.length;e<l;e++){let l=i[e],a=this._quantizePoints(l,t,r);a&&s.push(a)}return s.length>0?((0,h.Bi)(e)?e.rings=s:e.paths=s,e):null}:"multipoint"===e?e=>{let i=this._quantizePoints(e.points,t,r);return i&&i.length>0?(e.points=i,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,i,s){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),i&&(e.z=i(e.z))}:"polyline"===e||"polygon"===e?e=>{let l,a,o=(0,h.Bi)(e)?e.rings:e.paths;for(let e=0,i=o.length;e<i;e++){let i=o[e];for(let e=0,s=i.length;e<s;e++){let s=i[e];e>0?(l+=s[0],a+=s[1]):(l=s[0],a=s[1]),s[0]=t(l),s[1]=r(a)}}if(i&&s)for(let e=0,t=o.length;e<t;e++){let t=o[e];for(let e=0,r=t.length;e<r;e++){let r=t[e];r[2]=i(r[2]),r[3]=s(r[3])}}else if(i)for(let e=0,t=o.length;e<t;e++){let t=o[e];for(let e=0,r=t.length;e<r;e++){let r=t[e];r[2]=i(r[2])}}else if(s)for(let e=0,t=o.length;e<t;e++){let t=o[e];for(let e=0,r=t.length;e<r;e++){let r=t[e];r[2]=s(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),i&&null!=e.zmax&&null!=e.zmin&&(e.zmax=i(e.zmax),e.zmin=i(e.zmin)),s&&null!=e.mmax&&null!=e.mmin&&(e.mmax=s(e.mmax),e.mmin=s(e.mmin))}:"multipoint"===e?e=>{let l,a,o=e.points;for(let e=0,i=o.length;e<i;e++){let i=o[e];e>0?(l+=i[0],a+=i[1]):(l=i[0],a=i[1]),i[0]=t(l),i[1]=r(a)}if(i&&s)for(let e=0,t=o.length;e<t;e++){let t=o[e];t[2]=i(t[2]),t[3]=s(t[3])}else if(i)for(let e=0,t=o.length;e<t;e++){let t=o[e];t[2]=i(t[2])}else if(s)for(let e=0,t=o.length;e<t;e++){let t=o[e];t[2]=s(t[2])}}:null}};(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],b.prototype,"displayFieldName",void 0),(0,s.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"exceededTransferLimit",void 0),(0,s.Cg)([(0,u.MZ)({type:[l.A],json:{write:!0}})],b.prototype,"features",void 0),(0,s.Cg)([(0,g.w)("features")],b.prototype,"readFeatures",null),(0,s.Cg)([(0,u.MZ)({type:[m.A],json:{write:!0}})],b.prototype,"fields",void 0),(0,s.Cg)([(0,u.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:c.read}}})],b.prototype,"geometryType",void 0),(0,s.Cg)([(0,f.K)("geometryType")],b.prototype,"writeGeometryType",null),(0,s.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasM",void 0),(0,s.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasZ",void 0),(0,s.Cg)([(0,u.MZ)({types:d.yR,json:{write:!0}})],b.prototype,"queryGeometry",void 0),(0,s.Cg)([(0,g.w)("queryGeometry")],b.prototype,"readQueryGeometry",null),(0,s.Cg)([(0,u.MZ)({type:p.A,json:{write:!0}})],b.prototype,"spatialReference",void 0),(0,s.Cg)([(0,f.K)("spatialReference")],b.prototype,"writeSpatialReference",null),(0,s.Cg)([(0,u.MZ)({json:{write:!0}})],b.prototype,"transform",void 0),b=i=(0,s.Cg)([(0,u.$K)("esri.rest.support.FeatureSet")],b),b.prototype.toJSON.isDefaultToJSON=!0},2272(e,t,r){r.d(t,{Dl:()=>u,gf:()=>h,jV:()=>n,lF:()=>p});var i=r(92602),s=r(70333),l=r(4718),a=r(84952),o=r(926);function n(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function u(e){return"string"==typeof e?(0,a.An)(e):(0,l.o8)(e)}function p(e,t,r){let i={};for(let s in e){if("declaredClass"===s)continue;let l=e[s];if(null!=l&&"function"!=typeof l)if(Array.isArray(l))i[s]=l.map(e=>p(e));else if("object"==typeof l)if(l.toJSON){let e=l.toJSON(r?.[s]);i[s]=t?e:JSON.stringify(e)}else i[s]=t?l:JSON.stringify(l);else i[s]=l}return i}async function h(e,t,l){return function(e,t){return e?t&&(0,o.Qc)(e)?t:(0,o.getApiKey)(e)??s.id?.findCredential(e)?.token:null}(e,t)||(!s.id&&i.A.request.useIdentity&&await Promise.all([r.e(8673),r.e(7956),r.e(4189)]).then(()=>r(98232)),(await s.id.getCredential(e,l))?.token)}}}]);