@arcgis/core 4.34.0-next.91 → 4.34.0-next.93

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 (212) hide show
  1. package/Color.js +1 -1
  2. package/Ground.js +1 -1
  3. package/WebScene.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/004b13c1db79c9e668b1.js +1 -0
  6. package/assets/esri/core/workers/chunks/{700b5a536f97233bc4af.js → 03b455e9405a8b6fec68.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{a244afea77127e54dd3a.js → 08b0fc6bfe9640ee2525.js} +1 -1
  8. package/assets/esri/core/workers/chunks/0a981061df08da19372c.js +1 -0
  9. package/assets/esri/core/workers/chunks/20003728a679479b14dc.js +1 -0
  10. package/assets/esri/core/workers/chunks/352511dbc67166face40.js +1 -0
  11. package/assets/esri/core/workers/chunks/3acd79a6a0572926a799.js +1 -0
  12. package/assets/esri/core/workers/chunks/3d7923d25734d03a4d27.js +1 -0
  13. package/assets/esri/core/workers/chunks/48133effac2eacc2196e.js +1 -0
  14. package/assets/esri/core/workers/chunks/4dfcd03082be83600f3a.js +1 -0
  15. package/assets/esri/core/workers/chunks/503c81dda242e6077317.js +1 -0
  16. package/assets/esri/core/workers/chunks/{06aed0a5464965be8d52.js → 56b3bb68b61b77138186.js} +1 -1
  17. package/assets/esri/core/workers/chunks/5746c4861af83c1d57a8.js +1 -0
  18. package/assets/esri/core/workers/chunks/5aacd1c6b171c99b41f5.js +1 -0
  19. package/assets/esri/core/workers/chunks/5eb7f6f5121c8830c561.js +1 -0
  20. package/assets/esri/core/workers/chunks/6810ecdeccf4b7eae5e2.js +1 -0
  21. package/assets/esri/core/workers/chunks/6b208f5d423da64c8559.js +1 -0
  22. package/assets/esri/core/workers/chunks/{8bdbd94a59269e216fba.js → 6c3b585b9cb6bb640fb0.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{7a240ab31d9ff2d2c5af.js → 73db6c070b049fe05147.js} +1 -1
  24. package/assets/esri/core/workers/chunks/801451fb572bc5f1f270.js +1 -0
  25. package/assets/esri/core/workers/chunks/82e0d22619dc26920ca9.js +1 -0
  26. package/assets/esri/core/workers/chunks/{6aa349e1adf844df4b5b.js → 8b9a50cfaa5a7df02dad.js} +1 -1
  27. package/assets/esri/core/workers/chunks/8de9e50de0ac66ae1573.js +1 -0
  28. package/assets/esri/core/workers/chunks/8f426cb210a4250517d5.js +1 -0
  29. package/assets/esri/core/workers/chunks/94ddf029698991d853b9.js +1 -0
  30. package/assets/esri/core/workers/chunks/97eb2cfc1f036feea9a9.js +1 -0
  31. package/assets/esri/core/workers/chunks/{a85acb948cc7d22be592.js → 992b1389710d716d3450.js} +1 -1
  32. package/assets/esri/core/workers/chunks/9adecee0ed2f1df3b0d2.js +1 -0
  33. package/assets/esri/core/workers/chunks/a0fab8cd791c33d3895d.js +1 -0
  34. package/assets/esri/core/workers/chunks/{e99fc64b67bb0c71dc34.js → ad67e5eb4b8c0c14cea6.js} +1 -1
  35. package/assets/esri/core/workers/chunks/b5c829e904bc9cb5347d.js +1 -0
  36. package/assets/esri/core/workers/chunks/bec9ddd38c9ab9f2561b.js +1 -0
  37. package/assets/esri/core/workers/chunks/bf9031749d10e7d457b6.js +1 -0
  38. package/assets/esri/core/workers/chunks/bf9d09493fd849ea69fd.js +1 -0
  39. package/assets/esri/core/workers/chunks/{58e2652810143f509fe1.js → c473b15d4d52f0a63d20.js} +1 -1
  40. package/assets/esri/core/workers/chunks/c8e4fe0e3b109eb80e8e.js +1 -0
  41. package/assets/esri/core/workers/chunks/cd0c222a36caa7f80860.js +1 -0
  42. package/assets/esri/core/workers/chunks/ce175801937e80e3c487.js +1 -0
  43. package/assets/esri/core/workers/chunks/{100a0041ee42b0b2fa32.js → e5d974593043d5e2b502.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{1194c2432c31def87db1.js → f71b76c9506178124fa3.js} +1 -1
  45. package/assets/esri/themes/base/_core.scss +0 -2
  46. package/assets/esri/themes/base/widgets/_OrientedImageryViewerNavigationUI.scss +10 -7
  47. package/assets/esri/themes/dark/main.css +1 -1
  48. package/assets/esri/themes/light/main.css +1 -1
  49. package/assets/esri/themes/light/view.css +1 -1
  50. package/chunks/CutFillComposition.glsl.js +15 -3
  51. package/chunks/CutFillMask.glsl.js +1 -1
  52. package/chunks/languageUtils.js +1 -1
  53. package/config.js +1 -1
  54. package/core/CollectionFlattener.js +1 -1
  55. package/editing/sharedTemplates/executor/support/createPresetServiceEdit.js +1 -1
  56. package/geometry/operators/json/graphicBufferOperator.js +1 -1
  57. package/geometry/support/aaBoundingRect.js +1 -1
  58. package/geometry/support/geometryUtils.js +1 -1
  59. package/geometry/support/meshUtils/elevationSampler.js +1 -1
  60. package/geometry/support/meshUtils.js +1 -1
  61. package/geometry/support/triangle.js +1 -1
  62. package/interfaces.d.ts +52 -261
  63. package/kernel.js +1 -1
  64. package/layers/BaseElevationLayer.js +1 -1
  65. package/layers/BaseTileLayer.js +1 -1
  66. package/layers/ElevationLayer.js +1 -1
  67. package/layers/FeatureLayer.js +1 -1
  68. package/layers/GaussianSplatLayer.js +1 -1
  69. package/layers/ImageryTileLayer.js +1 -1
  70. package/layers/ParquetLayer.js +1 -1
  71. package/layers/graphics/sources/ParquetSource.js +1 -1
  72. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  73. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  74. package/layers/support/ElevationQuery.js +1 -1
  75. package/layers/support/ElevationQueryContext.js +5 -0
  76. package/layers/support/ElevationSampler.js +1 -1
  77. package/layers/support/ElevationTile.js +1 -1
  78. package/layers/support/GeometryDescriptor.js +1 -1
  79. package/layers/support/ParquetEncodingLocation.js +1 -1
  80. package/layers/support/ParquetEncodingWkb.js +1 -1
  81. package/layers/support/RasterBandInfo.js +1 -1
  82. package/layers/support/TileElevationSampler.js +5 -0
  83. package/layers/support/TileInfo.js +1 -1
  84. package/layers/support/TileKey.js +1 -1
  85. package/layers/support/TilemapCache.js +1 -1
  86. package/layers/support/layerUtils.js +1 -1
  87. package/layers/support/parquetEncodingUtils.js +5 -0
  88. package/layers/support/parquetUtils.js +1 -1
  89. package/networks/UtilityNetwork.js +1 -1
  90. package/networks/support/typeUtils.js +1 -1
  91. package/package.json +2 -2
  92. package/popup/FieldInfo.js +1 -1
  93. package/rest/networks/support/Association.js +1 -1
  94. package/rest/print.js +1 -1
  95. package/support/revision.js +1 -1
  96. package/symbols/cim/CIMSymbolHelper.js +1 -1
  97. package/symbols/cim/cimAnalyzer.js +1 -1
  98. package/symbols/cim/effects/EffectOffset.js +1 -1
  99. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  100. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  101. package/views/2d/engine/Stage.js +1 -1
  102. package/views/2d/engine/flow/BrushFlow.js +1 -1
  103. package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
  104. package/views/2d/engine/webgl/Overlay.js +1 -1
  105. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  106. package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
  107. package/views/2d/engine/webgl/TextureManager.js +1 -1
  108. package/views/2d/engine/webgl/animatedFormats/AnimatableTextureResource.js +1 -1
  109. package/views/2d/engine/webgl/animatedFormats/utils.js +1 -1
  110. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  111. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  112. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
  113. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
  114. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  115. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  116. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  117. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  118. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  119. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  120. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  121. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  122. package/views/2d/engine/webgl/shaderGraph/utils.js +1 -1
  123. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  124. package/views/2d/layers/VideoLayerView2D.js +1 -1
  125. package/views/2d/navigation/actions/Pan.js +1 -1
  126. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  127. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  128. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
  129. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  130. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  131. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  132. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  133. package/views/3d/support/hitTest.js +1 -1
  134. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  135. package/views/3d/support/popupHitTest.js +1 -1
  136. package/views/3d/terrain/ExtentHelper.js +1 -1
  137. package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
  138. package/views/3d/webgl-engine/shaders/CutFillComposition.glsl.js +1 -1
  139. package/views/SceneView.js +1 -1
  140. package/views/View2D.js +1 -1
  141. package/views/Viewport2DMixin.js +1 -1
  142. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  143. package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +1 -1
  144. package/views/analysis/ElevationProfile/ElevationProfileLineQueryComputation.js +1 -1
  145. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  146. package/views/analysis/ExclusiveOperationManager.js +5 -0
  147. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  148. package/views/interactive/snapping/featureSources/WorkerTileTreeDebugger.js +1 -1
  149. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  150. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  151. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  152. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  153. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  154. package/views/interactive/snapping/featureSources/featureServiceSource/PendingFeatureTile.js +1 -1
  155. package/views/interactive/snapping/featureSources/queryEngineUtils.js +1 -1
  156. package/views/navigation/Navigation.js +1 -1
  157. package/views/support/GroundViewElevationSampler.js +1 -1
  158. package/views/video/VideoOperationalDataView.js +1 -1
  159. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  160. package/widgets/Feature/FeatureExpression.js +1 -1
  161. package/widgets/Feature/FeatureMedia.js +1 -1
  162. package/widgets/Feature/FeatureViewModel.js +1 -1
  163. package/widgets/Feature.js +1 -1
  164. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  165. package/widgets/FeatureTable.js +1 -1
  166. package/widgets/Legend/LegendViewModel.js +1 -1
  167. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  168. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  169. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  170. package/widgets/OrientedImageryViewer/components/NavigationUIPanoramicViewModel.js +1 -1
  171. package/widgets/OrientedImageryViewer/services/DepthImageService.js +5 -0
  172. package/widgets/PanoramicViewer.js +1 -1
  173. package/widgets/Search/SearchViewModel.js +1 -1
  174. package/widgets/Sketch/SketchViewModel.js +1 -1
  175. package/widgets/support/decorators/vmEvent.js +1 -1
  176. package/assets/esri/core/workers/chunks/08374e5805fcedc1cb57.js +0 -1
  177. package/assets/esri/core/workers/chunks/14114be3afd6d292f89c.js +0 -1
  178. package/assets/esri/core/workers/chunks/2605062e44f2d4e73f14.js +0 -1
  179. package/assets/esri/core/workers/chunks/282c4f3484c605ce7d5e.js +0 -1
  180. package/assets/esri/core/workers/chunks/2e1cc11462846febb3b2.js +0 -1
  181. package/assets/esri/core/workers/chunks/37b5007660535f1c91c6.js +0 -1
  182. package/assets/esri/core/workers/chunks/393274af1804e5b6046a.js +0 -1
  183. package/assets/esri/core/workers/chunks/3ff3e1507220d3869c76.js +0 -1
  184. package/assets/esri/core/workers/chunks/4133ab8720e7e4afa9a6.js +0 -1
  185. package/assets/esri/core/workers/chunks/4d807bfe75108438db83.js +0 -1
  186. package/assets/esri/core/workers/chunks/5ad1985a9e66fb2232ae.js +0 -1
  187. package/assets/esri/core/workers/chunks/5b7a2ee44883b1fb2a5f.js +0 -1
  188. package/assets/esri/core/workers/chunks/614a00a3179f8fe23f45.js +0 -1
  189. package/assets/esri/core/workers/chunks/83065bef261314f9b2c5.js +0 -1
  190. package/assets/esri/core/workers/chunks/8cae725e631d922853c8.js +0 -1
  191. package/assets/esri/core/workers/chunks/8f4cfef97716c3502b0f.js +0 -1
  192. package/assets/esri/core/workers/chunks/9bb6984f24cd5461a754.js +0 -1
  193. package/assets/esri/core/workers/chunks/9f2a3f37fe9b19ef1209.js +0 -1
  194. package/assets/esri/core/workers/chunks/a1196637268b89281780.js +0 -1
  195. package/assets/esri/core/workers/chunks/b240298b8b643a323d34.js +0 -1
  196. package/assets/esri/core/workers/chunks/b47f26d6aa9a2848a677.js +0 -1
  197. package/assets/esri/core/workers/chunks/b661ea374fe38c8e29ca.js +0 -1
  198. package/assets/esri/core/workers/chunks/b8997ae5893afa0298d1.js +0 -1
  199. package/assets/esri/core/workers/chunks/baa48614d9567d5f240d.js +0 -1
  200. package/assets/esri/core/workers/chunks/c20862fe15295a294bbd.js +0 -1
  201. package/assets/esri/core/workers/chunks/c3020747f9001ca6a6e7.js +0 -1
  202. package/assets/esri/core/workers/chunks/c7c76a8a1c47eb62bef1.js +0 -1
  203. package/assets/esri/core/workers/chunks/eea9d49d55c2d1355497.js +0 -1
  204. package/assets/esri/core/workers/chunks/fb6ebb780bb59e252887.js +0 -1
  205. package/assets/esri/core/workers/chunks/ff6d189ba78980d40bb5.js +0 -1
  206. package/assets/esri/themes/base/widgets/_ButtonMenu.scss +0 -87
  207. package/widgets/FeatureTable/Grid/support/ButtonMenu.d.ts +0 -4
  208. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +0 -5
  209. package/widgets/FeatureTable/Grid/support/ButtonMenuItem.d.ts +0 -4
  210. package/widgets/FeatureTable/Grid/support/ButtonMenuItem.js +0 -5
  211. package/widgets/FeatureTable/Grid/support/ButtonMenuViewModel.d.ts +0 -4
  212. package/widgets/FeatureTable/Grid/support/ButtonMenuViewModel.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../config.js";import t from"../../../../request.js";import{bidiText as i}from"../../../../core/BidiText.js";import r from"../../../../core/Error.js";import{getFullyQualifiedFontName as s}from"../../../../core/fontUtils.js";import has from"../../../../core/has.js";import a from"../../../../core/Logger.js";import{throwIfAborted as n,isAbortError as o}from"../../../../core/promiseUtils.js";import{QueueProcessor as c}from"../../../../core/QueueProcessor.js";import{pt2px as h}from"../../../../core/screenUtils.js";import{numericHash as l}from"../../../../core/string.js";import u from"../../../../symbols/cim/CIMResourceManager.js";import{CIMSymbolHelper as p}from"../../../../symbols/cim/CIMSymbolHelper.js";import m from"../../../../symbols/cim/Rasterizer.js";import{normalizeDashTemplate as d}from"../../../../symbols/cim/utils.js";import{svgSdfTextureInnerSize as g,textureBindingSpriteAtlas as f,textureBindingGlyphAtlas as y}from"./definitions.js";import _ from"./GlyphMosaic.js";import M from"./GlyphSource.js";import I from"./Rect.js";import w from"./SDFConverter.js";import S from"./SpriteMosaic.js";import{discardUrlIfHasUrlHash as z}from"./urlUtils.js";import{charCodes as C,getCIMMarkerPlacementHash as T,isSVGImage as R}from"./Utils.js";import{AnimatableTextureResource as x}from"./animatedFormats/AnimatableTextureResource.js";import{AnimationStore as P}from"./animations/store/AnimationStore.js";const b="arial-unicode-ms-regular",$=()=>a.getLogger("esri.views.MapView"),j=(e,t,i)=>$().error(new r(e,t,i)),v=(e,t="")=>$().warnOnce(e,t);class k{static fromMosaic(e,t){return new k(e,t.page,t.sdf,t.samplingMode)}constructor(e,t,i,r){this.mosaicType=e,this.page=t,this.sdf=i,this.samplingMode=r}}class F{constructor(i){this._requestRender=i,this._resourceManager=new u,this._invalidFonts=new Set,this._sdfConverter=new w(g),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new c({concurrency:10,process:async(e,i)=>{n(i);try{return await t(e,{responseType:"image",signal:i})}catch(s){if(!o(s))throw new r("mapview-invalid-resource",`Could not fetch requested resource at ${e}`,s);throw s}}}),this.animationStore=new P,this._spriteMosaic=new S(2048,2048,500),this._glyphSource=new M(`${e.fontsUrl}/{fontstack}/{range}.pbf`),this._glyphMosaic=new _(1024,1024,this._glyphSource),this._rasterizer=new m(this.resourceManager)}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingIndex.clear(),this._hashToBindingIndex=null,this._bindingInfos=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null,this._resourceManager.destroy(),this.animationStore.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}async rasterizeItem(e,t){if(null==e)return j("mapview-null-resource","Unable to rasterize null resource"),null;if("animation-info"===e.type){const{resource:t}=e,i=this.animationStore.add(t),{location:r}=i;return{rect:new I(r.column,r.row,t.length,1),page:r.page,type:"sprite",width:t.length,height:1,rasterizationScale:1,sdfPaddingRatio:.5,samplingMode:"Linear",sdfDecodeCoeff:1,simplePattern:!1}}if("cim-rasterization-info"!==e.type)return j("mapview-unexpected-resource","Unable to rasterize resource"),null;const{resource:i}=e;if("text"===i.type){const e=await this._rasterizeText(i,t);for(const t of e.glyphs)this._setTextureBinding(1,t);return e}const r=await this._rasterizeSprite(i,t);return r&&this._setTextureBinding(0,r),r}getMosaicInfo(e,t,i=!1){const r=this._getTextureBindingInfo(e,t,i);return r?{size:r.size,texture:{texture:r.texture,unit:"sprite"===r.type?f:y}}:(j("mapview-invalid-resource",`Unable to find resource for ${t}`),{size:[0,0],texture:{texture:null,unit:0}})}_getTextureBindingInfo(e,t,i){const r=this._bindingInfos[t-1],s=r.page,a="Nearest"===r.samplingMode?9728:i?9987:9729;switch(r.mosaicType){case 0:{const t=[this.sprites.getWidth(s),this.sprites.getHeight(s)],i=this._spriteMosaic.getTexture(e,s);return i.setSamplingMode(a),{type:"sprite",texture:i,size:t}}case 1:{const t=[this.glyphs.width,this.glyphs.height],i=this._glyphMosaic.getTexture(e,s);return this._glyphMosaic.bind(e,a,s,y),i.setSamplingMode(a),{type:"glyph",texture:i,size:t}}default:return j("mapview-texture-manager",`Cannot handle unknown type ${r.mosaicType}`),null}}_hashMosaic(e,t){return 1|e<<1|(t.sdf?1:0)<<2|("Nearest"===t.samplingMode?1:0)<<3|t.page<<4}_setTextureBinding(e,t){const i=this._hashMosaic(e,t);if(!this._hashToBindingIndex.has(i)){const r=k.fromMosaic(e,t),s=this._bindingInfos.length+1;this._hashToBindingIndex.set(i,s),this._bindingInfos.push(r)}t.textureBinding=this._hashToBindingIndex.get(i)}async _rasterizeText(e,t){const{font:r,textString:a}=e,n=s(r),o=this._invalidFonts.has(n),[c,h]=i(a),l=C(c);try{const e=o?b:n;has("esri-2d-stabilize-glyphs")&&await this._glyphMosaic.preloadASCIIGlyphCache(e);return{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(e,l,t),isRightToLeft:h}}catch(u){v(`Font ${n} is not available on the web, using "Arial Unicode MS Regular"`),this._invalidFonts.add(n);return{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(b,l,t),isRightToLeft:h}}}_hashSpriteResource(e){switch(e.type){case"path":return`path:${e.path}.${e.asFill?1:0}`;case"CIMPictureMarker":return`${e.type}:${e.url}:${e.size}:${T(e.markerPlacement)}`;case"CIMPictureFill":return`${e.type}:${e.url}:${e.height}`;case"CIMPictureStroke":return`${e.type}:${e.url}:${e.width}`;case"dash":return`dash:${e.capStyle}.${d(e.dashTemplate).join("")}`;case"sdf":return`sdf:${JSON.stringify(e.geom)}.${e.asFill?1:0}`;case"fill-style":return`fill_style:${e.style}`;case"animated":return JSON.stringify(z(e));case"CIMGradientFill":case"CIMGradientStroke":return`gradient:${JSON.stringify(e.colorRamp)}.${e.gradientType}.${e.interval}`;case"CIMHatchFill":case"CIMVectorMarker":return JSON.stringify(e)}}async _rasterizeSprite(e,t){if(!e)return null;const i=l(this._hashSpriteResource(e));if(this._spriteMosaic.has(i))return this._spriteMosaic.getSpriteItem(i);if("url"in e&&e.url||"CIMPictureFill"===e.type||"CIMPictureStroke"===e.type||"CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type){const t=[];p.fetchResources({type:"CIMPointSymbol",symbolLayers:[e]},this._resourceManager,t),t.length>0&&await Promise.all(t)}switch(e.type){case"CIMPictureMarker":return"CIMMarkerPlacementInsidePolygon"===e.markerPlacement?.type?this._rasterizeJSONResource(i,e):this._handleAsyncResource(i,e,t);case"animated":case"CIMPictureFill":case"CIMPictureStroke":case"path":return this._handleAsyncResource(i,e,t);case"CIMGradientFill":case"CIMGradientStroke":case"CIMHatchFill":case"CIMVectorMarker":case"dash":case"fill-style":case"sdf":return this._rasterizeJSONResource(i,e)}}_rasterizeJSONResource(e,t){const i=this._rasterizer.rasterizeJSONResource(t);if(i){const{size:r,image:s,sdf:a,simplePattern:n,rasterizationScale:o,samplingMode:c,sdfPaddingRatio:h,sdfDecodeCoeff:l}=i;return this._addItemToMosaic(e,r,{type:"static",data:s},A(t),a,n,o,c,h,l)}return null}async _handleAsyncResource(e,t,i){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let r;return r="path"===t.type?this._handleSVG(t,e,i):this._handleImage(t,e,i),this._ongoingRasterizations.set(e,r),r.finally(()=>this._ongoingRasterizations.delete(e)),r}async _handleSVG(e,t,i){const r=[g,g],{asFill:s}=e,a=await this._sdfConverter.draw(e.path,s,i);return this._addItemToMosaic(t,r,{type:"static",data:new Uint32Array(a.buffer)},!1,!0,!0)}_handleGIFOrPNG(e,t,i){const r=e.url,s=this.resourceManager.getResource(r);if(null==s)return null;const{width:a,height:n}=s;if(s instanceof HTMLImageElement){if("animated"===e.type)return j("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;const i="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:r,sdf:o,image:c}=this._rasterizer.rasterizeImageResource(a,n,s,i);return this._addItemToMosaic(t,r,{type:"static",data:c},A(e),o,!1)}let o,c,h;"animated"===e.type?(o=!1,c={type:"CIMAnimatedSymbolProperties",playAnimation:e.playAnimation,reverseAnimation:e.reverseAnimation,randomizeStartTime:e.randomizeStartTime,randomizeStartSeed:e.randomizeStartSeed,startTimeOffset:e.startTimeOffset,duration:e.duration,repeatType:e.repeatType,repeatDelay:e.repeatDelay},h=e.startGroup||0):(o=A(e),c={type:"CIMAnimatedSymbolProperties"},h=0);const l=new x(s,this._requestRender,c,h);return this._addItemToMosaic(t,[l.width,l.height],{type:"animated",data:l},o,!1,!1)}async _handleImage(e,t,i){const s=e.url;if(B(s)||N(s))return this._handleGIFOrPNG(e,t,i);if("animated"===e.type)return j("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;try{let r;const a=this.resourceManager.getResource(s);if(null!=a&&a instanceof HTMLImageElement)r=a;else{const{data:e}=await this._imageRequestQueue.push(s,{...i});r=e}if(R(s))if("width"in e&&"height"in e)r.width=h(e.width),r.height=h(e.height);else if("cim"in e){const t=e;r.width=h(t.width??t.scaleX*t.size),r.height=h(t.size)}if(!r.width||!r.height)return null;const n=r.width,o=r.height,c="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:l,sdf:u,image:p}=this._rasterizer.rasterizeImageResource(n,o,r,c);return this._addItemToMosaic(t,l,{type:"static",data:p},A(e),u,!1)}catch(j){if(!o(j))throw new r("mapview-invalid-resource",`Could not fetch requested resource at ${s}. ${j.message}`);throw j}}_addItemToMosaic(e,t,i,r,s,a,n,o,c,h){return this._spriteMosaic.addSpriteItem(e,t,i,r,s,a,n,o,c,h)}}function A(e){switch(e.type){case"CIMVectorMarker":case"CIMPictureMarker":return U(e);default:return!0}}const G=e=>null!=e&&e.startsWith("data:image/gif"),B=e=>e&&(e.includes(".gif")||G(e)),O=e=>null!=e&&e.startsWith("data:image/png"),N=e=>e&&(e.includes(".png")||O(e)),U=e=>e&&"markerPlacement"in e&&e.markerPlacement&&"CIMMarkerPlacementInsidePolygon"===e.markerPlacement.type;export{F as default};
5
+ import e from"../../../../config.js";import t from"../../../../request.js";import{bidiText as i}from"../../../../core/BidiText.js";import r from"../../../../core/Error.js";import{getFullyQualifiedFontName as s}from"../../../../core/fontUtils.js";import has from"../../../../core/has.js";import a from"../../../../core/Logger.js";import{throwIfAborted as n,isAbortError as o}from"../../../../core/promiseUtils.js";import{QueueProcessor as c}from"../../../../core/QueueProcessor.js";import{pt2px as h}from"../../../../core/screenUtils.js";import{numericHash as l}from"../../../../core/string.js";import u from"../../../../symbols/cim/CIMResourceManager.js";import{CIMSymbolHelper as p}from"../../../../symbols/cim/CIMSymbolHelper.js";import m from"../../../../symbols/cim/Rasterizer.js";import{normalizeDashTemplate as d}from"../../../../symbols/cim/utils.js";import{svgSdfTextureInnerSize as g,textureBindingSpriteAtlas as f,textureBindingGlyphAtlas as y}from"./definitions.js";import _ from"./GlyphMosaic.js";import M from"./GlyphSource.js";import I from"./Rect.js";import w from"./SDFConverter.js";import S from"./SpriteMosaic.js";import{discardUrlIfHasUrlHash as z}from"./urlUtils.js";import{charCodes as C,getCIMMarkerPlacementHash as T,isSVGImage as R}from"./Utils.js";import{AnimatableTextureResource as x}from"./animatedFormats/AnimatableTextureResource.js";import{AnimationStore as P}from"./animations/store/AnimationStore.js";const b="arial-unicode-ms-regular",$=()=>a.getLogger("esri.views.MapView"),j=(e,t,i)=>$().error(new r(e,t,i)),v=(e,t="")=>$().warnOnce(e,t);class k{static fromMosaic(e,t){return new k(e,t.page,t.sdf,t.samplingMode)}constructor(e,t,i,r){this.mosaicType=e,this.page=t,this.sdf=i,this.samplingMode=r}}class F{constructor(i){this._requestRender=i,this._resourceManager=new u,this._invalidFonts=new Set,this._sdfConverter=new w(g),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new c({concurrency:10,process:async(e,i)=>{n(i);try{return await t(e,{responseType:"image",signal:i})}catch(s){if(!o(s))throw new r("mapview-invalid-resource",`Could not fetch requested resource at ${e}`,s);throw s}}}),this.animationStore=new P,this._spriteMosaic=new S(2048,2048,500),this._glyphSource=new M(`${e.fontsUrl}/{fontstack}/{range}.pbf`),this._glyphMosaic=new _(1024,1024,this._glyphSource),this._rasterizer=new m(this.resourceManager)}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingIndex.clear(),this._hashToBindingIndex=null,this._bindingInfos=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null,this._resourceManager.destroy(),this.animationStore.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}async rasterizeItem(e,t){if(null==e)return j("mapview-null-resource","Unable to rasterize null resource"),null;if("animation-info"===e.type){const{resource:t}=e,i=this.animationStore.add(t),{location:r}=i;return{rect:new I(r.column,r.row,t.length,1),page:r.page,type:"sprite",width:t.length,height:1,rasterizationScale:1,sdfPaddingRatio:.5,samplingMode:"Linear",sdfDecodeCoeff:1,simplePattern:!1}}if("cim-rasterization-info"!==e.type)return j("mapview-unexpected-resource","Unable to rasterize resource"),null;const{resource:i}=e;if("text"===i.type){const e=await this._rasterizeText(i,t);for(const t of e.glyphs)this._setTextureBinding(1,t);return e}const r=await this._rasterizeSprite(i,t);return r&&this._setTextureBinding(0,r),r}getMosaicInfo(e,t,i=!1){const r=this._getTextureBindingInfo(e,t,i);return r?{size:r.size,texture:{texture:r.texture,unit:"sprite"===r.type?f:y}}:(j("mapview-invalid-resource",`Unable to find resource for ${t}`),{size:[0,0],texture:{texture:null,unit:0}})}_getTextureBindingInfo(e,t,i){const{context:r}=e,s=this._bindingInfos[t-1],a=s.page,n="Nearest"===s.samplingMode?9728:i?9987:9729;switch(s.mosaicType){case 0:{const t=[this.sprites.getWidth(a),this.sprites.getHeight(a)],i=this._spriteMosaic.getTexture(e,a);return i.setSamplingMode(n),{type:"sprite",texture:i,size:t}}case 1:{const e=[this.glyphs.width,this.glyphs.height],t=this._glyphMosaic.getTexture(r,a);return this._glyphMosaic.bind(r,n,a,y),t.setSamplingMode(n),{type:"glyph",texture:t,size:e}}default:return j("mapview-texture-manager",`Cannot handle unknown type ${s.mosaicType}`),null}}_hashMosaic(e,t){return 1|e<<1|(t.sdf?1:0)<<2|("Nearest"===t.samplingMode?1:0)<<3|t.page<<4}_setTextureBinding(e,t){const i=this._hashMosaic(e,t);if(!this._hashToBindingIndex.has(i)){const r=k.fromMosaic(e,t),s=this._bindingInfos.length+1;this._hashToBindingIndex.set(i,s),this._bindingInfos.push(r)}t.textureBinding=this._hashToBindingIndex.get(i)}async _rasterizeText(e,t){const{font:r,textString:a}=e,n=s(r),o=this._invalidFonts.has(n),[c,h]=i(a),l=C(c);try{const e=o?b:n;has("esri-2d-stabilize-glyphs")&&await this._glyphMosaic.preloadASCIIGlyphCache(e);return{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(e,l,t),isRightToLeft:h}}catch(u){v(`Font ${n} is not available on the web, using "Arial Unicode MS Regular"`),this._invalidFonts.add(n);return{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(b,l,t),isRightToLeft:h}}}_hashSpriteResource(e){switch(e.type){case"path":return`path:${e.path}.${e.asFill?1:0}`;case"CIMPictureMarker":return`${e.type}:${e.url}:${e.size}:${T(e.markerPlacement)}`;case"CIMPictureFill":return`${e.type}:${e.url}:${e.height}`;case"CIMPictureStroke":return`${e.type}:${e.url}:${e.width}`;case"dash":return`dash:${e.capStyle}.${d(e.dashTemplate).join("")}`;case"sdf":return`sdf:${JSON.stringify(e.geom)}.${e.asFill?1:0}`;case"fill-style":return`fill_style:${e.style}`;case"animated":return JSON.stringify(z(e));case"CIMGradientFill":case"CIMGradientStroke":return`gradient:${JSON.stringify(e.colorRamp)}.${e.gradientType}.${e.interval}`;case"CIMHatchFill":case"CIMVectorMarker":return JSON.stringify(e)}}async _rasterizeSprite(e,t){if(!e)return null;const i=l(this._hashSpriteResource(e));if(this._spriteMosaic.has(i))return this._spriteMosaic.getSpriteItem(i);if("url"in e&&e.url||"CIMPictureFill"===e.type||"CIMPictureStroke"===e.type||"CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type){const t=[];p.fetchResources({type:"CIMPointSymbol",symbolLayers:[e]},this._resourceManager,t),t.length>0&&await Promise.all(t)}switch(e.type){case"CIMPictureMarker":return"CIMMarkerPlacementInsidePolygon"===e.markerPlacement?.type?this._rasterizeJSONResource(i,e):this._handleAsyncResource(i,e,t);case"animated":case"CIMPictureFill":case"CIMPictureStroke":case"path":return this._handleAsyncResource(i,e,t);case"CIMGradientFill":case"CIMGradientStroke":case"CIMHatchFill":case"CIMVectorMarker":case"dash":case"fill-style":case"sdf":return this._rasterizeJSONResource(i,e)}}_rasterizeJSONResource(e,t){const i=this._rasterizer.rasterizeJSONResource(t);if(i){const{size:r,image:s,sdf:a,simplePattern:n,rasterizationScale:o,samplingMode:c,sdfPaddingRatio:h,sdfDecodeCoeff:l}=i;return this._addItemToMosaic(e,r,{type:"static",data:s},A(t),a,n,o,c,h,l)}return null}async _handleAsyncResource(e,t,i){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let r;return r="path"===t.type?this._handleSVG(t,e,i):this._handleImage(t,e,i),this._ongoingRasterizations.set(e,r),r.finally(()=>this._ongoingRasterizations.delete(e)),r}async _handleSVG(e,t,i){const r=[g,g],{asFill:s}=e,a=await this._sdfConverter.draw(e.path,s,i);return this._addItemToMosaic(t,r,{type:"static",data:new Uint32Array(a.buffer)},!1,!0,!0)}_handleGIFOrPNG(e,t,i){const r=e.url,s=this.resourceManager.getResource(r);if(null==s)return null;const{width:a,height:n}=s;if(s instanceof HTMLImageElement){if("animated"===e.type)return j("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;const i="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:r,sdf:o,image:c}=this._rasterizer.rasterizeImageResource(a,n,s,i);return this._addItemToMosaic(t,r,{type:"static",data:c},A(e),o,!1)}let o,c,h;"animated"===e.type?(o=!1,c={type:"CIMAnimatedSymbolProperties",playAnimation:e.playAnimation,reverseAnimation:e.reverseAnimation,randomizeStartTime:e.randomizeStartTime,randomizeStartSeed:e.randomizeStartSeed,startTimeOffset:e.startTimeOffset,duration:e.duration,repeatType:e.repeatType,repeatDelay:e.repeatDelay},h=e.startGroup||0):(o=A(e),c={type:"CIMAnimatedSymbolProperties"},h=0);const l=new x(s,this._requestRender,c,h);return this._addItemToMosaic(t,[l.width,l.height],{type:"animated",data:l},o,!1,!1)}async _handleImage(e,t,i){const s=e.url;if(B(s)||N(s))return this._handleGIFOrPNG(e,t,i);if("animated"===e.type)return j("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;try{let r;const a=this.resourceManager.getResource(s);if(null!=a&&a instanceof HTMLImageElement)r=a;else{const{data:e}=await this._imageRequestQueue.push(s,{...i});r=e}if(R(s))if("width"in e&&"height"in e)r.width=h(e.width),r.height=h(e.height);else if("cim"in e){const t=e;r.width=h(t.width??t.scaleX*t.size),r.height=h(t.size)}if(!r.width||!r.height)return null;const n=r.width,o=r.height,c="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:l,sdf:u,image:p}=this._rasterizer.rasterizeImageResource(n,o,r,c);return this._addItemToMosaic(t,l,{type:"static",data:p},A(e),u,!1)}catch(j){if(!o(j))throw new r("mapview-invalid-resource",`Could not fetch requested resource at ${s}. ${j.message}`);throw j}}_addItemToMosaic(e,t,i,r,s,a,n,o,c,h){return this._spriteMosaic.addSpriteItem(e,t,i,r,s,a,n,o,c,h)}}function A(e){switch(e.type){case"CIMVectorMarker":case"CIMPictureMarker":return U(e);default:return!0}}const G=e=>null!=e&&e.startsWith("data:image/gif"),B=e=>e&&(e.includes(".gif")||G(e)),O=e=>null!=e&&e.startsWith("data:image/png"),N=e=>e&&(e.includes(".png")||O(e)),U=e=>e&&"markerPlacement"in e&&e.markerPlacement&&"CIMMarkerPlacementInsidePolygon"===e.markerPlacement.type;export{F as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{spritePadding as t}from"../definitions.js";import{play as i}from"./utils.js";class a{constructor(t,a,h,e){this._animation=t,this._frameData=null;const n=t=>{this._frameData=t,a.requestRender()};this.frameCount=this._animation.frameDurations.length,this.width=this._animation.width,this.height=this._animation.height,this._playHandle=i(this._animation,h,e,n)}destroy(){this._playHandle.remove()}loadFrame(i){const a=this._frameData;if(null==a)return;const h="width"in a?a.width:a.codedWidth,e="height"in a?a.height:a.codedHeight;i.updateData(0,t,t,h,e,a),this._frameData=null}}export{a as AnimatableTextureResource};
5
+ import{spritePadding as t}from"../definitions.js";import{createPlayer as i,updateIfNeeded as a}from"./utils.js";class e{constructor(t,a,e,h){this._animation=t,this._frameData=null;const s=t=>{this._frameData=t,a.requestRender()};this.frameCount=this._animation.frameDurations.length,this.width=this._animation.width,this.height=this._animation.height,this._player=i(this._animation,e,h,s)}destroy(){}loadFrame(i){const a=this._frameData;if(null==a)return;const e="width"in a?a.width:a.codedWidth,h="height"in a?a.height:a.codedHeight;i.updateData(0,t,t,e,h,a),this._frameData=null}get hasFrameData(){return null!=this._frameData}update(t){a(t,this._player)}}export{e as AnimatableTextureResource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{makeHandle as t}from"../../../../../core/handleUtils.js";import{Milliseconds as e}from"../../../../../core/time.js";import{getRandomValue as r}from"../grouping.js";function i(t){return e(t.frameDurations.reduce((t,e)=>t+e,0))}function a(t){const{width:e,height:r}=t,i=t.frameDurations.reverse(),a=e=>{const r=t.frameDurations.length-1-e;return t.getFrame(r)};return{frameCount:t.frameCount,duration:t.duration,frameDurations:i,getFrame:a,width:e,height:r}}function n(t,r){const{width:i,height:a,getFrame:n}=t,o=r/t.duration,s=t.frameDurations.map(t=>e(t*o));return{frameCount:t.frameCount,duration:t.duration,frameDurations:s,getFrame:n,width:i,height:a}}function o(t,r){const{width:i,height:a,getFrame:n}=t,o=t.frameDurations.slice(),s=o.shift();return o.unshift(e(s+r)),{frameCount:t.frameCount,duration:t.duration+r,frameDurations:o,getFrame:n,width:i,height:a}}function s(t,r){const{width:i,height:a,getFrame:n}=t,o=t.frameDurations.slice(),s=o.pop();return o.push(e(s+r)),{frameCount:t.frameCount,duration:t.duration+r,frameDurations:o,getFrame:n,width:i,height:a}}class m{constructor(t,e,r,i){this._animation=t,this._repeatType=r,this._onFrameData=i,this._direction=1,this._currentFrame=0,this.timeToFrame=this._animation.frameDurations[this._currentFrame];let a=0;for(;e>a;)a+=this.timeToFrame,this.nextFrame();const n=this._animation.getFrame(this._currentFrame);this._onFrameData(n)}nextFrame(){if(this._currentFrame+=this._direction,this._direction>0){if(this._currentFrame===this._animation.frameDurations.length)switch(this._repeatType){case"None":this._currentFrame-=this._direction;break;case"Loop":this._currentFrame=0;break;case"Oscillate":this._currentFrame-=this._direction,this._direction=-1}}else if(-1===this._currentFrame)switch(this._repeatType){case"None":this._currentFrame-=this._direction;break;case"Loop":this._currentFrame=this._animation.frameDurations.length-1;break;case"Oscillate":this._currentFrame-=this._direction,this._direction=1}this.timeToFrame=this._animation.frameDurations[this._currentFrame];const t=this._animation.getFrame(this._currentFrame);this._onFrameData(t)}}function u(t,u,h,c){let f,{repeatType:l}=u;if(null==l&&(l="Loop"),!0===u.reverseAnimation&&(t=a(t)),null!=u.duration&&(t=n(t,e(1e3*u.duration))),null!=u.repeatDelay){const r=1e3*u.repeatDelay;"Loop"===l?t=s(t,e(r)):"Oscillate"===l&&(t=o(s(t,e(r/2)),e(r/2)))}if(null!=u.startTimeOffset)f=e(1e3*u.startTimeOffset);else if(null!=u.randomizeStartTime){const a=82749913,n=null!=u.randomizeStartSeed?u.randomizeStartSeed:a,o=r(h,n);f=e(o*i(t))}else f=e(0);return new m(t,f,l,c)}function h(e,r,i,a){const n=null==r.playAnimation||r.playAnimation,o=u(e,r,i,a);let s,m=o.timeToFrame;function h(){s=n?setTimeout(()=>{o.nextFrame(),m=o.timeToFrame,h()},m):void 0}return h(),t(()=>n&&clearTimeout(s))}export{m as Player,n as adjustDuration,s as appendDelay,u as createPlayer,i as getDuration,h as play,o as prependDelay,a as reverse};
5
+ import{Milliseconds as t}from"../../../../../core/time.js";import{getRandomValue as e}from"../grouping.js";function r(e){return t(e.frameDurations.reduce((t,e)=>t+e,0))}function i(t){const{width:e,height:r}=t,i=t.frameDurations.reverse(),a=e=>{const r=t.frameDurations.length-1-e;return t.getFrame(r)};return{frameCount:t.frameCount,duration:t.duration,frameDurations:i,getFrame:a,width:e,height:r}}function a(e,r){const{width:i,height:a,getFrame:n}=e,s=r/e.duration,o=e.frameDurations.map(e=>t(e*s));return{frameCount:e.frameCount,duration:e.duration,frameDurations:o,getFrame:n,width:i,height:a}}function n(e,r){const{width:i,height:a,getFrame:n}=e,s=e.frameDurations.slice(),o=s.shift();return s.unshift(t(o+r)),{frameCount:e.frameCount,duration:e.duration+r,frameDurations:s,getFrame:n,width:i,height:a}}function s(e,r){const{width:i,height:a,getFrame:n}=e,s=e.frameDurations.slice(),o=s.pop();return s.push(t(o+r)),{frameCount:e.frameCount,duration:e.duration+r,frameDurations:s,getFrame:n,width:i,height:a}}class o{constructor(e,r,i,a){this._animation=e,this._repeatType=i,this._onFrameData=a,this._direction=1,this._currentFrame=0,this._lastUpdated=t(0),this.timeInFrame=0,this.timeToFrame=this._animation.frameDurations[this._currentFrame];let n=0;for(;r>n;)n+=this.timeToFrame,this.nextFrame();const s=this._animation.getFrame(this._currentFrame);this._onFrameData(s)}nextFrame(){if(this._currentFrame+=this._direction,this._direction>0){if(this._currentFrame===this._animation.frameDurations.length)switch(this._repeatType){case"None":this._currentFrame-=this._direction;break;case"Loop":this._currentFrame=0;break;case"Oscillate":this._currentFrame-=this._direction,this._direction=-1}}else if(-1===this._currentFrame)switch(this._repeatType){case"None":this._currentFrame-=this._direction;break;case"Loop":this._currentFrame=this._animation.frameDurations.length-1;break;case"Oscillate":this._currentFrame-=this._direction,this._direction=1}this.timeToFrame=this._animation.frameDurations[this._currentFrame],this.timeInFrame=0;const t=this._animation.getFrame(this._currentFrame);this._onFrameData(t)}update(e){const r=t(e-this._lastUpdated);this._lastUpdated=e,this._advance(r)}_advance(t){this.timeInFrame+=t,this.timeInFrame>this.timeToFrame&&this.nextFrame()}}function m(e,r){e.animationsEnabled&&r?.update(t(e.time))}function h(m,h,u,c){let d,{repeatType:f}=h;if(null==f&&(f="Loop"),!0===h.reverseAnimation&&(m=i(m)),null!=h.duration&&(m=a(m,t(1e3*h.duration))),null!=h.repeatDelay){const e=1e3*h.repeatDelay;"Loop"===f?m=s(m,t(e)):"Oscillate"===f&&(m=n(s(m,t(e/2)),t(e/2)))}if(null!=h.startTimeOffset)d=t(1e3*h.startTimeOffset);else if(null!=h.randomizeStartTime){const i=82749913,a=null!=h.randomizeStartSeed?h.randomizeStartSeed:i,n=e(u,a);d=t(n*r(m))}else d=t(0);return new o(m,d,f,c)}export{o as Player,a as adjustDuration,s as appendDelay,h as createPlayer,r as getDuration,n as prependDelay,i as reverse,m as updateIfNeeded};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as t}from"../../../../../../../geometry/GeometryCursor.js";import{maxTileCoordValue as i}from"../../../../../../../symbols/cim/constants.js";import{CIMMarkerPlacementHelper as r}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{spritePadding as s}from"../../../definitions.js";import{AAnimatedMeshWriter as o}from"./AnimatedMeshWriter.js";import{angle as n,sizing as a,animationPointerAndBaseSizeAndReferenceSize as c,uv as l,offset as m,pos as d,bitset as p,id as h,lineLength as u,value1Position2Value2 as f,zoomRange as y}from"./attributes.js";import{createComputedAnimatedMeshParams as x}from"./ComputedAnimatedParams.js";import{c256ToRad as P}from"../shaders/constants.js";const M=64,g=64,w=2;class v extends o{get vertexSpec(){return{createComputedParams:x,optionalAttributes:{zoomRange:y,value1Position2Value2:f,lineLength:u},attributes:{id:h,bitset:p,pos:d,offset:m.marker,uv:l.marker,animationPointerAndBaseSizeAndReferenceSize:c,sizing:a,angle:n}}}_write(e,t){const i=this.evaluatedMeshParams.sprite,{textureBinding:r}=i;e.recordStart(this.instanceId,this.attributeLayout,r);const s=t.getDisplayId();if(this.shift&&"esriGeometryPolyline"===t.geometryType)this._writeParticles(e,t);else if(null!=this.evaluatedMeshParams.placement)this._writePlacedMarkers(e,t);else if("esriGeometryPolygon"===t.geometryType){const i=t.readCentroidForDisplay();if(!i)return;const[r,o]=i.coords;this._writeQuad(e,s,r,o)}else if("esriGeometryPoint"===t.geometryType){const i=t.readXForDisplay(),r=t.readYForDisplay();this._writeQuad(e,s,i,r)}else{const i=t.readGeometryForDisplay();i&&i.forEachVertex((t,i)=>{this._writeQuad(e,s,t,i)})}e.recordEnd()}_writePlacedMarkers(s,o){const n=t.fromFeatureSetReaderCIM(o)?.clone();if(!n)return;const a=-1,c=r.getPlacement(n,a,this.evaluatedMeshParams.placement,e(1),s.id);if(!c)return;const l=o.getDisplayId();let m=c.next(),d=null;for(;null!=m;){const e=m.tx,t=-m.ty;if(Math.abs(e)>i||Math.abs(t)>i){m=c.next();continue}const r=-m.getAngle();s.recordBounds(e,t,M,g),this.shift?d&&this._writeQuad(s,l,d[0],d[1],void 0,r):this._writeQuad(s,l,e,t,void 0,r),d=[e,t],m=c.next()}}_writeParticles(e,t){const i=t.getDisplayId(),r=t.readGeometryForDisplay();if(!r)return;const s=[];r.forEachVertex((e,t)=>{s.push([e,t])});const o=_(s);let n=0;for(let l=1;l<s.length;l++){const e=s[l][0]-s[l-1][0],t=s[l][1]-s[l-1][1],i=Math.sqrt(e*e+t*t);n+=i}const a=t=>{for(const r of o){const{a:s,b:o}=r;this._writeQuad(e,i,s.position[0],s.position[1],[s.distance-t,o.position[0],o.position[1],o.distance-t],this.evaluatedMeshParams.angleToLine?Math.atan2(s.direction[1],s.direction[0]):0,n,!0)}},{placement:c}=this.evaluatedMeshParams;if(!c||"placementTemplate"in c||"CIMMarkerPlacementOnVertices"===c.type){let e;if(c&&"CIMMarkerPlacementOnVertices"!==c.type)e=c.placementTemplate;else{e=[0];for(const t of o){const{a:i,b:r}=t,s=i.position[0]-r.position[0],o=i.position[1]-r.position[1],n=Math.sqrt(s*s+o*o);e.push(n)}}let t=-1*n;for(;t<(1+w/2)*n;)for(const i of e)t+=i,a(t)}else"CIMMarkerPlacementAtExtremities"===c.type?"JustBegin"===c.extremityPlacement?a(1):"JustEnd"===c.extremityPlacement?(a(n-1),a(-1)):"Both"===c.extremityPlacement&&(a(1),a(n-1)):"CIMMarkerPlacementOnLine"===c.type&&a(n/2)}_writeQuad(e,t,i,r,o,n=0,a=0,c=!1){const l=this.evaluatedMeshParams.sprite,{rect:m}=l,d=m.x+s,p=m.y+s,h=m.x+m.width-s,u=m.y+m.height-s,f=e.vertexCount();c||e.recordBounds(i,r,M,M);const y={texXmin:d,texYmin:p,texXmax:h,texYmax:u,value1Position2Value2:o,angle:n/P,lineLength:a};for(let s=0;s<4;s++)this._writeVertex(e,t,i,r,y);e.indexEnsureSize(6),e.indexWrite(f),e.indexWrite(f+1),e.indexWrite(f+2),e.indexWrite(f+1),e.indexWrite(f+3),e.indexWrite(f+2)}}function _(e){const t=[];let i=0;for(let r=1;r<e.length;r++){const s=e[r-1],o=e[r],n=o[0]-s[0],a=o[1]-s[1],c=Math.sqrt(n*n+a*a),l=n/c,m=a/c;t.push({a:{position:s,distance:i,direction:[l,m]},b:{position:o,distance:i+c,direction:[l,m]}}),i+=c}return t}class b extends v{constructor(){super(...arguments),this.shift=!1}}class C extends v{constructor(){super(...arguments),this.shift=!0}}export{b as AnimatedMarkerMeshWriter,C as AnimatedMarkerShiftMeshWriter};
5
+ import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as t}from"../../../../../../../geometry/GeometryCursor.js";import{maxTileCoordValue as i}from"../../../../../../../symbols/cim/constants.js";import{CIMMarkerPlacementHelper as s}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{spritePadding as r}from"../../../definitions.js";import{AAnimatedMeshWriter as o}from"./AnimatedMeshWriter.js";import{angle as n,sizing as a,animationPointerAndBaseSizeAndReferenceSize as c,uv as l,offset as m,pos as d,bitset as p,id as h,lineLength as u,value1Position2Value2 as f,zoomRange as x}from"./attributes.js";import{createComputedAnimatedMeshParams as y}from"./ComputedAnimatedParams.js";import{c256ToRad as P}from"../shaders/constants.js";const M=64,g=64,w=2;class v extends o{get vertexSpec(){return{createComputedParams:y,optionalAttributes:{zoomRange:x,value1Position2Value2:f,lineLength:u},attributes:{id:h,bitset:p,pos:d,offset:m.marker,uv:l.marker,animationPointerAndBaseSizeAndReferenceSize:c,sizing:a,angle:n}}}_write(e,i,s){const r=this.evaluatedMeshParams.sprite,{textureBinding:o}=r;e.recordStart(this.instanceId,this.attributeLayout,o);const n=i.getDisplayId();if(this.shift&&"esriGeometryPolyline"===i.geometryType){if(!s){const s=t.fromFeatureSetReaderCIM(i);s&&this._writeParticles(e,i,s)}}else if(null!=this.evaluatedMeshParams.placement)this._writePlacedMarkers(e,i);else if("esriGeometryPolygon"===i.geometryType){const t=i.readCentroidForDisplay();if(!t)return;const[s,r]=t.coords;this._writeQuad(e,n,s,r)}else if("esriGeometryPoint"===i.geometryType){const t=i.readXForDisplay(),s=i.readYForDisplay();this._writeQuad(e,n,t,s)}else{const t=i.readGeometryForDisplay();t&&t.forEachVertex((t,i)=>{this._writeQuad(e,n,t,i)})}e.recordEnd()}_writePlacedMarkers(r,o){const n=t.fromFeatureSetReaderCIM(o)?.clone();if(!n)return;const a=-1,c=s.getPlacement(n,a,this.evaluatedMeshParams.placement,e(1),r.id);if(!c)return;const l=o.getDisplayId();let m=c.next(),d=null;for(;null!=m;){const e=m.tx,t=-m.ty;if(Math.abs(e)>i||Math.abs(t)>i){m=c.next();continue}const s=-m.getAngle();r.recordBounds(e,t,M,g),this.shift?d&&this._writeQuad(r,l,d[0],d[1],void 0,s):this._writeQuad(r,l,e,t,void 0,s),d=[e,t],m=c.next()}}_writeParticles(e,t,i){const s=t.getDisplayId();for(;i.nextPath();){const t=[];for(;i.nextPoint();)t.push([i.x,i.y]);const r=_(t);let o=0;for(let e=1;e<t.length;e++){const i=t[e][0]-t[e-1][0],s=t[e][1]-t[e-1][1],r=Math.sqrt(i*i+s*s);o+=r}const n=t=>{for(const i of r){const{a:r,b:n}=i;this._writeQuad(e,s,r.position[0],r.position[1],[r.distance-t,n.position[0],n.position[1],n.distance-t],this.evaluatedMeshParams.angleToLine?Math.atan2(r.direction[1],r.direction[0]):0,o,!0)}},{placement:a}=this.evaluatedMeshParams;if(!a||"placementTemplate"in a||"CIMMarkerPlacementOnVertices"===a.type){let e;if(a&&"CIMMarkerPlacementOnVertices"!==a.type)e=a.placementTemplate;else{e=[0];for(const t of r){const{a:i,b:s}=t,r=i.position[0]-s.position[0],o=i.position[1]-s.position[1],n=Math.sqrt(r*r+o*o);e.push(n)}}let t=-1*o;for(;t<(1+w/2)*o;)for(const i of e)t+=i,n(t)}else"CIMMarkerPlacementAtExtremities"===a.type?"JustBegin"===a.extremityPlacement?n(1):"JustEnd"===a.extremityPlacement?(n(o-1),n(-1)):"Both"===a.extremityPlacement&&(n(1),n(o-1)):"CIMMarkerPlacementOnLine"===a.type&&n(o/2)}}_writeQuad(e,t,i,s,o,n=0,a=0,c=!1){const l=this.evaluatedMeshParams.sprite,{rect:m}=l,d=m.x+r,p=m.y+r,h=m.x+m.width-r,u=m.y+m.height-r,f=e.vertexCount();c||e.recordBounds(i,s,M,M);const x={texXmin:d,texYmin:p,texXmax:h,texYmax:u,value1Position2Value2:o,angle:n/P,lineLength:a};for(let r=0;r<4;r++)this._writeVertex(e,t,i,s,x);e.indexEnsureSize(6),e.indexWrite(f),e.indexWrite(f+1),e.indexWrite(f+2),e.indexWrite(f+1),e.indexWrite(f+3),e.indexWrite(f+2)}}function _(e){const t=[];let i=0;for(let s=1;s<e.length;s++){const r=e[s-1],o=e[s],n=o[0]-r[0],a=o[1]-r[1],c=Math.sqrt(n*n+a*a),l=n/c,m=a/c;t.push({a:{position:r,distance:i,direction:[l,m]},b:{position:o,distance:i+c,direction:[l,m]}}),i+=c}return t}class b extends v{constructor(){super(...arguments),this.shift=!1}}class C extends v{constructor(){super(...arguments),this.shift=!0}}export{b as AnimatedMarkerMeshWriter,C as AnimatedMarkerShiftMeshWriter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{invert as e,multiply as t}from"../../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{animationDebugFlags as a}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{FeatureTechnique as r}from"../FeatureTechnique.js";import{getSelectionDefines as o,getLocalTileOffset as n,getFeatureUniforms as s,resolveDynamicUniforms as m,getFeaturePipelineState as u}from"../featureTechniqueUtils.js";class l extends r{render(r,l){const{context:c,painter:f}=r,{target:g}=l,{freezeGlobalTime:p}=a,d=0,x=f.textureManager.animationStore.getTexture(c,d),h=[2/r.state.size[0],0,0,0,-2/r.state.size[1],0,-1,1,1],b=Array.from(e(i(),h)),D=Array.from(t(i(),b,g.transforms.displayViewScreenMat3)),T=l.instance.getInput(),y=f.textureManager.getMosaicInfo(c,l.textureKey,!1),{optionalAttributes:z}=T,R=z.zoomRange,S=z.value1Position2Value2,j="accumulatedDistance"in z&&z.accumulatedDistance,A="segmentDirection"in z&&z.segmentDirection,I="normal"in z&&z.normal;f.setShader({shader:this.shaders.geometry,uniforms:{...m(r,l.target,T.uniforms),...s(r,l.target),mosaicInfo:y,animationInfo:{globalTime:!1===p?r.time/1e3:p,animationTextureSize:[x.descriptor.width,x.descriptor.height],animationTexture:{unit:6,texture:x},toScreen:D,toNdc:h,mapRotation:r.state.rotation,pixelRatio:r.state.pixelRatio},localTileOffset:n(l.target)},defines:{...o(r)},optionalAttributes:{zoomRange:R,value1Position2Value2:S,accumulatedDistance:j,segmentDirection:A,normal:I},useComputeBuffer:!0}),f.setPipelineState({...u(r)}),f.submitDraw(r,l),!1===p&&g.requestRender()}}export{l as AnimatedTechnique};
5
+ import{invert as e,multiply as t}from"../../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{animationDebugFlags as i}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{FeatureTechnique as r}from"../FeatureTechnique.js";import{getSelectionDefines as o,getLocalTileOffset as n,getFeatureUniforms as s,resolveDynamicUniforms as m,getFeaturePipelineState as l}from"../featureTechniqueUtils.js";class u extends r{render(r,u){const{context:c,painter:f}=r,{target:g}=u,{freezeGlobalTime:p}=i,d=0,x=f.textureManager.animationStore.getTexture(c,d),b=[2/r.state.size[0],0,0,0,-2/r.state.size[1],0,-1,1,1],h=Array.from(e(a(),b)),D=Array.from(t(a(),h,g.transforms.displayViewScreenMat3)),T=u.instance.getInput(),y=f.textureManager.getMosaicInfo(r,u.textureKey,!1),{optionalAttributes:z}=T,R=z.zoomRange,S=z.value1Position2Value2,j="accumulatedDistance"in z&&z.accumulatedDistance,A="segmentDirection"in z&&z.segmentDirection,I="normal"in z&&z.normal;f.setShader({shader:this.shaders.geometry,uniforms:{...m(r,u.target,T.uniforms),...s(r,u.target),mosaicInfo:y,animationInfo:{globalTime:r.animationsEnabled?!1===p?r.time/1e3:p:0,animationTextureSize:[x.descriptor.width,x.descriptor.height],animationTexture:{unit:6,texture:x},toScreen:D,toNdc:b,mapRotation:r.state.rotation,pixelRatio:r.state.pixelRatio},localTileOffset:n(u.target)},defines:{...o(r)},optionalAttributes:{zoomRange:R,value1Position2Value2:S,accumulatedDistance:j,segmentDirection:A,normal:I},useComputeBuffer:!0}),f.setPipelineState({...l(r)}),f.submitDraw(r,u),!1===p&&r.animationsEnabled&&g.requestRender()}}export{u as AnimatedTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getLocalTileOffset as s,getFeatureUniforms as o,resolveDynamicUniforms as i,getFeaturePipelineState as a}from"../featureTechniqueUtils.js";import{ComplexFillShader as n}from"../shaders/ComplexFillShader.js";class u extends e{constructor(){super(...arguments),this.type=9,this.shaders={geometry:new n}}render(e,n){const{context:u,painter:m}=e,f=n.instance.getInput();m.setShader({shader:this.shaders.geometry,uniforms:{...i(e,n.target,f.uniforms),...o(e,n.target),mosaicInfo:m.textureManager.getMosaicInfo(u,n.textureKey),localTileOffset:s(n.target)},defines:{...r(e)},optionalAttributes:f.optionalAttributes,useComputeBuffer:t(e)}),m.setPipelineState(a(e)),m.submitDraw(e,n)}}export{u as ComplexFillTechnique};
5
+ import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getLocalTileOffset as s,getFeatureUniforms as i,resolveDynamicUniforms as o,getFeaturePipelineState as a}from"../featureTechniqueUtils.js";import{ComplexFillShader as n}from"../shaders/ComplexFillShader.js";class u extends e{constructor(){super(...arguments),this.type=9,this.shaders={geometry:new n}}render(e,n){const{painter:u}=e,m=n.instance.getInput();u.setShader({shader:this.shaders.geometry,uniforms:{...o(e,n.target,m.uniforms),...i(e,n.target),mosaicInfo:u.textureManager.getMosaicInfo(e,n.textureKey),localTileOffset:s(n.target)},defines:{...r(e)},optionalAttributes:m.optionalAttributes,useComputeBuffer:t(e)}),u.setPipelineState(a(e)),u.submitDraw(e,n)}}export{u as ComplexFillTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getLocalTileOffset as s,getFeatureUniforms as i,resolveDynamicUniforms as o,getFeaturePipelineState as a}from"../featureTechniqueUtils.js";import{getAntialiasingControls as n}from"../line/utils.js";import{ComplexOutlineFillShader as u}from"../shaders/ComplexOutlineFillShader.js";class l extends e{constructor(){super(...arguments),this.type=10,this.shaders={geometry:new u}}render(e,u){const{context:l,painter:m,pixelRatio:p}=e,f=u.instance.getInput();m.setShader({shader:this.shaders.geometry,uniforms:{...o(e,u.target,f.uniforms),...i(e,u.target),antialiasingControls:n(p),mosaicInfo:m.textureManager.getMosaicInfo(l,u.textureKey),localTileOffset:s(u.target)},defines:{...r(e)},optionalAttributes:f.optionalAttributes,useComputeBuffer:t(e)}),m.setPipelineState(a(e)),m.submitDraw(e,u)}}export{l as ComplexOutlineFillTechnique};
5
+ import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getLocalTileOffset as s,getFeatureUniforms as i,resolveDynamicUniforms as o,getFeaturePipelineState as a}from"../featureTechniqueUtils.js";import{getAntialiasingControls as n}from"../line/utils.js";import{ComplexOutlineFillShader as u}from"../shaders/ComplexOutlineFillShader.js";class l extends e{constructor(){super(...arguments),this.type=10,this.shaders={geometry:new u}}render(e,u){const{painter:l,pixelRatio:m}=e,p=u.instance.getInput();l.setShader({shader:this.shaders.geometry,uniforms:{...o(e,u.target,p.uniforms),...i(e,u.target),antialiasingControls:n(m),mosaicInfo:l.textureManager.getMosaicInfo(e,u.textureKey),localTileOffset:s(u.target)},defines:{...r(e)},optionalAttributes:p.optionalAttributes,useComputeBuffer:t(e)}),l.setPipelineState(a(e)),l.submitDraw(e,u)}}export{l as ComplexOutlineFillTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getFeatureUniforms as s,resolveDynamicUniforms as i,getFeaturePipelineState as o}from"../featureTechniqueUtils.js";import{GradientFillShader as a}from"../shaders/GradientFillShader.js";class n extends e{constructor(){super(...arguments),this.type=14,this.shaders={geometry:new a},this.symbologyPlane=0}render(e,a){const{context:n,painter:u}=e,m=a.instance.getInput();u.setShader({shader:this.shaders.geometry,uniforms:{...i(e,a.target,m.uniforms),...s(e,a.target),mosaicInfo:u.textureManager.getMosaicInfo(n,a.textureKey)},defines:{...r(e)},optionalAttributes:m.optionalAttributes,useComputeBuffer:t(e)}),u.setPipelineState(o(e)),u.submitDraw(e,a)}}export{n as GradientFillTechnique};
5
+ import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getFeatureUniforms as s,resolveDynamicUniforms as i,getFeaturePipelineState as o}from"../featureTechniqueUtils.js";import{GradientFillShader as a}from"../shaders/GradientFillShader.js";class n extends e{constructor(){super(...arguments),this.type=14,this.shaders={geometry:new a},this.symbologyPlane=0}render(e,a){const{painter:n}=e,u=a.instance.getInput();n.setShader({shader:this.shaders.geometry,uniforms:{...i(e,a.target,u.uniforms),...s(e,a.target),mosaicInfo:n.textureManager.getMosaicInfo(e,a.textureKey)},defines:{...r(e)},optionalAttributes:u.optionalAttributes,useComputeBuffer:t(e)}),n.setPipelineState(o(e)),n.submitDraw(e,a)}}export{n as GradientFillTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getLocalTileOffset as s,getFeatureUniforms as i,resolveDynamicUniforms as o,getFeaturePipelineState as a}from"../featureTechniqueUtils.js";import{PatternFillShader as n}from"../shaders/PatternFillShader.js";class u extends e{constructor(){super(...arguments),this.type=26,this.shaders={geometry:new n}}render(e,n){const{context:u,painter:f}=e,m=n.instance.getInput();f.setShader({shader:this.shaders.geometry,uniforms:{...o(e,n.target,m.uniforms),...i(e,n.target),mosaicInfo:f.textureManager.getMosaicInfo(u,n.textureKey),localTileOffset:s(n.target)},defines:{...r(e)},optionalAttributes:m.optionalAttributes,useComputeBuffer:t(e)}),f.setPipelineState(a(e)),f.submitDraw(e,n)}}export{u as PatternFillTechnique};
5
+ import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getLocalTileOffset as s,getFeatureUniforms as i,resolveDynamicUniforms as a,getFeaturePipelineState as o}from"../featureTechniqueUtils.js";import{PatternFillShader as n}from"../shaders/PatternFillShader.js";class u extends e{constructor(){super(...arguments),this.type=26,this.shaders={geometry:new n}}render(e,n){const{painter:u}=e,f=n.instance.getInput();u.setShader({shader:this.shaders.geometry,uniforms:{...a(e,n.target,f.uniforms),...i(e,n.target),mosaicInfo:u.textureManager.getMosaicInfo(e,n.textureKey),localTileOffset:s(n.target)},defines:{...r(e)},optionalAttributes:f.optionalAttributes,useComputeBuffer:t(e)}),u.setPipelineState(o(e)),u.submitDraw(e,n)}}export{u as PatternFillTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getLocalTileOffset as s,getFeatureUniforms as i,resolveDynamicUniforms as o,getFeaturePipelineState as a}from"../featureTechniqueUtils.js";import{getAntialiasingControls as n}from"../line/utils.js";import{PatternOutlineFillShader as u}from"../shaders/PatternOutlineFillShader.js";class l extends e{constructor(){super(...arguments),this.type=27,this.shaders={geometry:new u}}render(e,u){const{context:l,painter:m,pixelRatio:f}=e,p=u.instance.getInput();m.setShader({shader:this.shaders.geometry,uniforms:{...o(e,u.target,p.uniforms),...i(e,u.target),antialiasingControls:n(f),mosaicInfo:m.textureManager.getMosaicInfo(l,u.textureKey),localTileOffset:s(u.target)},defines:{...r(e)},optionalAttributes:p.optionalAttributes,useComputeBuffer:t(e)}),m.setPipelineState(a(e)),m.submitDraw(e,u)}}export{l as PatternOutlineFillTechnique};
5
+ import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getLocalTileOffset as s,getFeatureUniforms as i,resolveDynamicUniforms as o,getFeaturePipelineState as a}from"../featureTechniqueUtils.js";import{getAntialiasingControls as n}from"../line/utils.js";import{PatternOutlineFillShader as u}from"../shaders/PatternOutlineFillShader.js";class l extends e{constructor(){super(...arguments),this.type=27,this.shaders={geometry:new u}}render(e,u){const{painter:l,pixelRatio:m}=e,f=u.instance.getInput();l.setShader({shader:this.shaders.geometry,uniforms:{...o(e,u.target,f.uniforms),...i(e,u.target),antialiasingControls:n(m),mosaicInfo:l.textureManager.getMosaicInfo(e,u.textureKey),localTileOffset:s(u.target)},defines:{...r(e)},optionalAttributes:f.optionalAttributes,useComputeBuffer:t(e)}),l.setPipelineState(a(e)),l.submitDraw(e,u)}}export{l as PatternOutlineFillTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as e}from"../FeatureTechnique.js";import{getSelectionDefines as t,getFeaturePipelineState as s,isHittest as r,getFeatureUniforms as a,resolveDynamicUniforms as i}from"../featureTechniqueUtils.js";import{TextShader as n}from"../text/TextShader.js";class o extends e{constructor(){super(...arguments),this.type=18,this.shaders={geometry:new n},this.drawPhase=14,this.symbologyPlane=3}render(e,n){const{context:o,painter:u}=e,d=t(e),c={...s(e),stencil:{write:!1,test:{compare:516,mask:255,op:{fail:7680,zFail:7680,zPass:7680}}}},m=n.instance.getInput(),f={shader:this.shaders.geometry,uniforms:{...i(e,n.target,m.uniforms),...a(e,n.target),mosaicInfo:u.textureManager.getMosaicInfo(o,n.textureKey)},defines:{...d,textRenderPassType:0,isBackgroundPass:!0,isLabel:!0},optionalAttributes:m.optionalAttributes,useComputeBuffer:r(e)};u.setPipelineState(c),u.setShader(f),u.submitDraw(e,n,{stencilRef:255}),u.setShader({...f,defines:{...d,textRenderPassType:2,isBackgroundPass:!1,isLabel:!0}}),u.submitDraw(e,n,{stencilRef:255}),u.setShader({...f,defines:{...d,textRenderPassType:0,isBackgroundPass:!1,isLabel:!0}}),u.submitDraw(e,n,{stencilRef:255})}}export{o as LabelTechnique};
5
+ import{FeatureTechnique as e}from"../FeatureTechnique.js";import{getSelectionDefines as s,getFeaturePipelineState as t,isHittest as r,getFeatureUniforms as a,resolveDynamicUniforms as i}from"../featureTechniqueUtils.js";import{TextShader as n}from"../text/TextShader.js";class o extends e{constructor(){super(...arguments),this.type=18,this.shaders={geometry:new n},this.drawPhase=14,this.symbologyPlane=3}render(e,n){const{painter:o}=e,u=s(e),d={...t(e),stencil:{write:!1,test:{compare:516,mask:255,op:{fail:7680,zFail:7680,zPass:7680}}}},m=n.instance.getInput(),c={shader:this.shaders.geometry,uniforms:{...i(e,n.target,m.uniforms),...a(e,n.target),mosaicInfo:o.textureManager.getMosaicInfo(e,n.textureKey)},defines:{...u,textRenderPassType:0,isBackgroundPass:!0,isLabel:!0},optionalAttributes:m.optionalAttributes,useComputeBuffer:r(e)};o.setPipelineState(d),o.setShader(c),o.submitDraw(e,n,{stencilRef:255}),o.setShader({...c,defines:{...u,textRenderPassType:2,isBackgroundPass:!1,isLabel:!0}}),o.submitDraw(e,n,{stencilRef:255}),o.setShader({...c,defines:{...u,textRenderPassType:0,isBackgroundPass:!1,isLabel:!0}}),o.submitDraw(e,n,{stencilRef:255})}}export{o as LabelTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as t}from"../FeatureTechnique.js";import{isHittest as e,getSelectionDefines as s,getFeatureUniforms as r,resolveDynamicUniforms as i,isHighlight as o,getFeaturePipelineState as a}from"../featureTechniqueUtils.js";import{getAntialiasingControls as n}from"./utils.js";import{GradientStrokeShader as p}from"../shaders/GradientStrokeShader.js";class c extends t{constructor(){super(...arguments),this.type=15,this.shaders={geometry:new p},this.symbologyPlane=1}_getShaderOptions(t,o,a){const{context:p,painter:c,pixelRatio:h}=t,l=o.instance.getInput();return{shader:this.shaders.geometry,uniforms:{...i(t,o.target,l.uniforms),...r(t,o.target),antialiasingControls:n(h),mosaicInfo:c.textureManager.getMosaicInfo(p,o.textureKey),technique:{isColorPass:a}},defines:{...s(t)},optionalAttributes:l.optionalAttributes,useComputeBuffer:e(t)}}render(t,s){const{painter:r}=t;if(e(t)||o(t)){const e=a(t);return r.setPipelineState(e),r.setShader(this._getShaderOptions(t,s,1)),void r.submitDraw(t,s)}t.context.setClearDepth(1),t.context.clear(256);const i={color:!1,depth:{write:{zNear:0,zFar:1},test:513},stencil:{write:!1,test:{compare:514,mask:255,op:{fail:7680,zFail:7680,zPass:7680}}}};r.setShader(this._getShaderOptions(t,s,0)),r.setPipelineState(i),r.submitDraw(t,s);const n={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:{write:!1,test:515},stencil:{write:!1,test:{compare:514,mask:255,op:{fail:7680,zFail:7680,zPass:7680}}}};r.setShader(this._getShaderOptions(t,s,1)),r.setPipelineState(n),r.submitDraw(t,s)}}export{c as GradientStrokeTechnique};
5
+ import{FeatureTechnique as t}from"../FeatureTechnique.js";import{isHittest as e,getSelectionDefines as s,getFeatureUniforms as r,resolveDynamicUniforms as i,isHighlight as o,getFeaturePipelineState as a}from"../featureTechniqueUtils.js";import{getAntialiasingControls as n}from"./utils.js";import{GradientStrokeShader as p}from"../shaders/GradientStrokeShader.js";class h extends t{constructor(){super(...arguments),this.type=15,this.shaders={geometry:new p},this.symbologyPlane=1}_getShaderOptions(t,o,a){const{painter:p,pixelRatio:h}=t,l=o.instance.getInput();return{shader:this.shaders.geometry,uniforms:{...i(t,o.target,l.uniforms),...r(t,o.target),antialiasingControls:n(h),mosaicInfo:p.textureManager.getMosaicInfo(t,o.textureKey),technique:{isColorPass:a}},defines:{...s(t)},optionalAttributes:l.optionalAttributes,useComputeBuffer:e(t)}}render(t,s){const{painter:r}=t;if(e(t)||o(t)){const e=a(t);return r.setPipelineState(e),r.setShader(this._getShaderOptions(t,s,1)),void r.submitDraw(t,s)}t.context.setClearDepth(1),t.context.clear(256);const i={color:!1,depth:{write:{zNear:0,zFar:1},test:513},stencil:{write:!1,test:{compare:514,mask:255,op:{fail:7680,zFail:7680,zPass:7680}}}};r.setShader(this._getShaderOptions(t,s,0)),r.setPipelineState(i),r.submitDraw(t,s);const n={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:{write:!1,test:515},stencil:{write:!1,test:{compare:514,mask:255,op:{fail:7680,zFail:7680,zPass:7680}}}};r.setShader(this._getShaderOptions(t,s,1)),r.setPipelineState(n),r.submitDraw(t,s)}}export{h as GradientStrokeTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getFeatureUniforms as s,resolveDynamicUniforms as i,getFeaturePipelineState as o}from"../featureTechniqueUtils.js";import{getAntialiasingControls as a}from"./utils.js";import{TexturedLineShader as n}from"../shaders/TexturedLineShader.js";class u extends e{constructor(){super(...arguments),this.type=31,this.shaders={geometry:new n},this.symbologyPlane=1}render(e,n){const{context:u,painter:m,pixelRatio:p}=e,f=n.instance.getInput();m.setShader({shader:this.shaders.geometry,uniforms:{...i(e,n.target,f.uniforms),...s(e,n.target),antialiasingControls:a(p),mosaicInfo:m.textureManager.getMosaicInfo(u,n.textureKey)},defines:{...r(e)},optionalAttributes:f.optionalAttributes,useComputeBuffer:t(e)}),m.setPipelineState(o(e)),m.submitDraw(e,n)}}export{u as TexturedLineTechnique};
5
+ import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getFeatureUniforms as s,resolveDynamicUniforms as i,getFeaturePipelineState as o}from"../featureTechniqueUtils.js";import{getAntialiasingControls as a}from"./utils.js";import{TexturedLineShader as n}from"../shaders/TexturedLineShader.js";class u extends e{constructor(){super(...arguments),this.type=31,this.shaders={geometry:new n},this.symbologyPlane=1}render(e,n){const{painter:u,pixelRatio:m}=e,p=n.instance.getInput();u.setShader({shader:this.shaders.geometry,uniforms:{...i(e,n.target,p.uniforms),...s(e,n.target),antialiasingControls:a(m),mosaicInfo:u.textureManager.getMosaicInfo(e,n.textureKey)},defines:{...r(e)},optionalAttributes:p.optionalAttributes,useComputeBuffer:t(e)}),u.setPipelineState(o(e)),u.submitDraw(e,n)}}export{u as TexturedLineTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getFeatureUniforms as s,resolveDynamicUniforms as o,getFeaturePipelineState as i}from"../featureTechniqueUtils.js";import{MarkerShader as a}from"./MarkerShader.js";class n extends e{constructor(){super(...arguments),this.type=21,this.shaders={geometry:new a},this.symbologyPlane=2}render(e,a){const{context:n,painter:u}=e,m=a.instance.getInput();u.setShader({shader:this.shaders.geometry,uniforms:{...o(e,a.target,m.uniforms),...s(e,a.target),mosaicInfo:u.textureManager.getMosaicInfo(n,a.textureKey,!0)},defines:{...r(e)},optionalAttributes:m.optionalAttributes,useComputeBuffer:t(e)}),u.setPipelineState(i(e)),u.submitDraw(e,a)}}export{n as MarkerTechnique};
5
+ import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getFeatureUniforms as s,resolveDynamicUniforms as o,getFeaturePipelineState as i}from"../featureTechniqueUtils.js";import{MarkerShader as a}from"./MarkerShader.js";class n extends e{constructor(){super(...arguments),this.type=21,this.shaders={geometry:new a},this.symbologyPlane=2}render(e,a){const{painter:n}=e,u=a.instance.getInput();n.setShader({shader:this.shaders.geometry,uniforms:{...o(e,a.target,u.uniforms),...s(e,a.target),mosaicInfo:n.textureManager.getMosaicInfo(e,a.textureKey,!0)},defines:{...r(e)},optionalAttributes:u.optionalAttributes,useComputeBuffer:t(e)}),n.setPipelineState(i(e)),n.submitDraw(e,a)}}export{n as MarkerTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as e}from"../FeatureTechnique.js";import{getSelectionDefines as s,isHittest as t,getFeatureUniforms as r,resolveDynamicUniforms as a,getFeaturePipelineState as i}from"../featureTechniqueUtils.js";import{TextShader as n}from"./TextShader.js";class o extends e{constructor(){super(...arguments),this.type=30,this.shaders={geometry:new n},this.symbologyPlane=3}render(e,n){const{context:o,painter:u}=e,d=s(e),m=n.instance.getInput(),p={shader:this.shaders.geometry,uniforms:{...a(e,n.target,m.uniforms),...r(e,n.target),mosaicInfo:u.textureManager.getMosaicInfo(o,n.textureKey)},defines:{...d,isBackgroundPass:!0,isLabel:!1,textRenderPassType:0},optionalAttributes:m.optionalAttributes,useComputeBuffer:t(e)};u.setShader(p),u.setPipelineState(i(e)),u.submitDraw(e,n),u.setShader({...p,defines:{...d,isBackgroundPass:!1,isLabel:!1,textRenderPassType:2}}),u.submitDraw(e,n),u.setShader({...p,defines:{...d,isBackgroundPass:!1,isLabel:!1,textRenderPassType:1}}),u.submitDraw(e,n),u.setShader({...p,defines:{...d,isBackgroundPass:!1,isLabel:!1,textRenderPassType:0}}),u.submitDraw(e,n)}}export{o as TextTechnique};
5
+ import{FeatureTechnique as e}from"../FeatureTechnique.js";import{getSelectionDefines as s,isHittest as t,getFeatureUniforms as r,resolveDynamicUniforms as a,getFeaturePipelineState as i}from"../featureTechniqueUtils.js";import{TextShader as n}from"./TextShader.js";class o extends e{constructor(){super(...arguments),this.type=30,this.shaders={geometry:new n},this.symbologyPlane=3}render(e,n){const{painter:o}=e,u=s(e),d=n.instance.getInput(),m={shader:this.shaders.geometry,uniforms:{...a(e,n.target,d.uniforms),...r(e,n.target),mosaicInfo:o.textureManager.getMosaicInfo(e,n.textureKey)},defines:{...u,isBackgroundPass:!0,isLabel:!1,textRenderPassType:0},optionalAttributes:d.optionalAttributes,useComputeBuffer:t(e)};o.setShader(m),o.setPipelineState(i(e)),o.submitDraw(e,n),o.setShader({...m,defines:{...u,isBackgroundPass:!1,isLabel:!1,textRenderPassType:2}}),o.submitDraw(e,n),o.setShader({...m,defines:{...u,isBackgroundPass:!1,isLabel:!1,textRenderPassType:1}}),o.submitDraw(e,n),o.setShader({...m,defines:{...u,isBackgroundPass:!1,isLabel:!1,textRenderPassType:0}}),o.submitDraw(e,n)}}export{o as TextTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- function o(o){return o.locationsMap}const t={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};export{o as getLocations,t as simplePipelineState};
5
+ const e={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};export{e as simplePipelineState};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../../../core/Accessor.js";import{watch as i,sync as r}from"../../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import"../../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{TileKey as l}from"../../../../../../layers/support/TileKey.js";import{distanceToTile as n}from"../../../../../interactive/snapping/featureSources/featureServiceSource/tileUtils.js";import{scaleBoundsPredicate as a}from"../../../../../support/layerViewUtils.js";let p=class extends t{get tiles(){const e=this.tilesCoveringView,t=null!=this.pointOfInterest?this.pointOfInterest:this.view.center;return e.sort((e,i)=>n(t,e)-n(t,i)),e}_scaleEnabled(){return a(this.view.scale,this.layer.minScale||0,this.layer.maxScale||0)}get tilesCoveringView(){if(!this.view.ready||!this.view.featuresTilingScheme||!this.view.state||null==this.tileInfo)return[];if(!this._scaleEnabled)return[];const{spans:e,lodInfo:t}=this.view.featuresTilingScheme.getTileCoverage(this.view.state,0),{level:i}=t,r=[];for(const{row:o,colFrom:s,colTo:n}of e)for(let e=s;e<=n;e++){const s=t.normalizeCol(e),n=new l(null,i,o,s);this.tileInfo.updateTileInfo(n),r.push(n)}return r}get tileInfo(){return this.view.featuresTilingScheme?.tileInfo??null}get tileSize(){return null!=this.tileInfo?this.tileInfo.size[0]:256}constructor(e){super(e),this.pointOfInterest=null}initialize(){this.addHandles(i(()=>this.view?.state?.viewpoint,()=>this.notifyChange("tilesCoveringView"),r))}};e([o({readOnly:!0})],p.prototype,"tiles",null),e([o({readOnly:!0})],p.prototype,"_scaleEnabled",null),e([o({readOnly:!0})],p.prototype,"tilesCoveringView",null),e([o({readOnly:!0})],p.prototype,"tileInfo",null),e([o({readOnly:!0})],p.prototype,"tileSize",null),e([o({constructOnly:!0})],p.prototype,"view",void 0),e([o({constructOnly:!0})],p.prototype,"layer",void 0),e([o()],p.prototype,"pointOfInterest",void 0),p=e([s("esri.views.2d.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiles2D")],p);export{p as FeatureServiceTiles2D};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../../core/Accessor.js";import{watch as i,sync as r}from"../../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import"../../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{TileKey as l}from"../../../../../../layers/support/TileKey.js";import{distanceToTile as n}from"../../../../../interactive/snapping/featureSources/featureServiceSource/tileUtils.js";import{scaleBoundsPredicate as a}from"../../../../../support/layerViewUtils.js";let p=class extends t{get tiles(){const e=this.tilesCoveringView,t=null!=this.pointOfInterest?this.pointOfInterest:this.view.center;return e.sort((e,i)=>n(t,e)-n(t,i)),e}_scaleEnabled(){return a(this.view.scale,this.layer.minScale||0,this.layer.maxScale||0)}get tilesCoveringView(){if(!this.view.ready||!this.view.featuresTilingScheme||!this.view.state||null==this.tileInfo)return[];if(!this._scaleEnabled)return[];const{spans:e,lodInfo:t}=this.view.featuresTilingScheme.getTileCoverage(this.view.state,0),{level:i}=t,r=[];for(const{row:o,colFrom:s,colTo:n}of e)for(let e=s;e<=n;e++){const s=t.normalizeCol(e),n=new l(i,o,s);this.tileInfo.updateTileInfo(n),r.push(n)}return r}get tileInfo(){return this.view.featuresTilingScheme?.tileInfo??null}get tileSize(){return null!=this.tileInfo?this.tileInfo.size[0]:256}constructor(e){super(e),this.pointOfInterest=null}initialize(){this.addHandles(i(()=>this.view?.state?.viewpoint,()=>this.notifyChange("tilesCoveringView"),r))}};e([o({readOnly:!0})],p.prototype,"tiles",null),e([o({readOnly:!0})],p.prototype,"_scaleEnabled",null),e([o({readOnly:!0})],p.prototype,"tilesCoveringView",null),e([o({readOnly:!0})],p.prototype,"tileInfo",null),e([o({readOnly:!0})],p.prototype,"tileSize",null),e([o({constructOnly:!0})],p.prototype,"view",void 0),e([o({constructOnly:!0})],p.prototype,"layer",void 0),e([o()],p.prototype,"pointOfInterest",void 0),p=e([s("esri.views.2d.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiles2D")],p);export{p as FeatureServiceTiles2D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../Color.js";import i from"../../../Graphic.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{watch as r,initial as l}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../../layers/GraphicsLayer.js";import m from"../../../layers/support/TelemetryDisplay.js";import{getSymbolDisplayAngle as y}from"../../../layers/video/videoUtils.js";import h from"../../../symbols/SimpleFillSymbol.js";import p from"../../../symbols/SimpleLineSymbol.js";import c from"../../../symbols/SimpleMarkerSymbol.js";import{applyCIMSymbolRotation as b}from"../../../symbols/support/cimSymbolUtils.js";import{symbolTypes as f}from"../../../symbols/support/typeUtils.js";import S from"../engine/webgl/OverlayContainer.js";import u from"../engine/webgl/OverlayMultipoint.js";import{LayerView2DMixin as d}from"./LayerView2D.js";import g from"./graphics/GraphicContainer.js";import _ from"./graphics/GraphicsView2D.js";import L from"../../layers/LayerView.js";const v=new t([255,127,0]),T=10005,w=10018;let O=class extends(d(L)){constructor(){super(...arguments),this._graphicsLayer=new n,this._frameOutlineGraphic=new i({symbol:new h({outline:{type:"simple-line",color:v}})}),this._frameCenterGraphic=new i({symbol:new c({color:v,style:"cross"})}),this._sensorTrailGraphic=new i({symbol:new p({color:v})}),this._sensorSightlineGraphic=new i({symbol:new p({color:v})}),this._sensorLocationGraphic=new i({symbol:new c({color:v})}),this._overlayContainer=null,this._sensorLocationSymbolType=null,this.layer=null,this.sensorLocationSymbol=null,this.symbolAngle=0,this.visibleTelemetryElements=null}destroy(){this._graphicsLayer=s(this._graphicsLayer)}initialize(){this._sensorLocationSymbolType=this.layer?.sensorSymbol.type,this._graphicsLayer.graphics.addMany([this._frameCenterGraphic,this._frameOutlineGraphic,this._sensorLocationGraphic,this._sensorSightlineGraphic,this._sensorTrailGraphic]),this.visibleTelemetryElements=new m({frame:this.layer.telemetryDisplay?.frame??!1,frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this._overlayContainer=new S,this.container.addChild(this._overlayContainer),this._addOverlayMultipoint(),this.graphicsView=new _({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new g(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([r(()=>[this.layer.telemetryDisplay?.frame,this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight],()=>this._updateVisibleTelemetryElements(),l),r(()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight],()=>this._updateGraphicGeometries(),l),r(()=>this.layer.metadata,()=>this._updateSensorLocationSymbolAngle(),l),r(()=>this.layer?.frameCenterSymbol,()=>this._updateFrameCenterSymbol(),l),r(()=>this.layer?.frameOutlineSymbol,()=>this._updateFrameOutlineSymbol(),l),r(()=>this.layer?.sensorSightLineSymbol,()=>this._updateSensorSightlineSymbol(),l),r(()=>this.layer?.sensorSymbol,()=>this._updateSensorLocationSymbol(),l),r(()=>this.layer?.sensorTrailSymbol,()=>this._updateSensorTrailSymbol(),l),r(()=>this.symbolAngle,()=>this._updateSensorLocationSymbol(),l)])}detach(){this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this.graphicsView=s(this.graphicsView)}supportsSpatialReference(e){return!0}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(e){this.graphicsView.processUpdate(e)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frame=this.layer.telemetryDisplay.frame,this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:e}=this.layer,{visibleTelemetryElements:t}=this;e&&t&&(t.frameOutline&&e.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,t.sensorTrail&&e.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,t.lineOfSight&&e.lineOfSight?this._sensorSightlineGraphic.geometry=this.layer.telemetry.lineOfSight:this._sensorSightlineGraphic.geometry=null,t.sensorLocation&&e.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,t.frameCenter&&e.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}_updateSensorLocationSymbolAngle(){if(!this.layer?.metadata?.size)return;const{source:e,symbolOffset:t=0}=this.layer.sensorSymbolOrientation||{};if(!e&&!t)return;const i=this.layer?.metadata?.get(T)?.value??0,s=this.layer?.metadata?.get(w)?.value??0,r=y({cameraAzimuth:s,platformHeading:i,source:this.layer.sensorSymbolOrientation?.source,symbolOffset:this.layer.sensorSymbolOrientation?.symbolOffset??0});this.symbolAngle=Math.round(Math.abs(r))}_updateSensorLocationSymbol(){switch(this._sensorLocationSymbolType){case"simple-marker":this.sensorLocationSymbol=this.layer.sensorSymbol.clone(),this.sensorLocationSymbol.angle=this.symbolAngle,this._sensorLocationGraphic.symbol=this.sensorLocationSymbol.clone();break;case"picture-marker":this.sensorLocationSymbol=this.layer.sensorSymbol,this.sensorLocationSymbol.angle=this.symbolAngle,this._sensorLocationGraphic.symbol=this.sensorLocationSymbol;break;case"cim":this.sensorLocationSymbol=this.layer.sensorSymbol,b(this.sensorLocationSymbol,this.symbolAngle,!0),this._sensorLocationGraphic.symbol=this.sensorLocationSymbol}}_updateFrameCenterSymbol(){this.layer?.frameCenterSymbol&&(this._frameCenterGraphic.symbol=this.layer.frameCenterSymbol.clone())}_updateFrameOutlineSymbol(){this.layer?.frameOutlineSymbol&&(this._frameOutlineGraphic.symbol=this.layer.frameOutlineSymbol.clone())}_updateSensorSightlineSymbol(){this.layer?.sensorSightLineSymbol&&(this._sensorSightlineGraphic.symbol=this.layer.sensorSightLineSymbol.clone())}_updateSensorTrailSymbol(){this.layer?.sensorTrailSymbol&&(this._sensorTrailGraphic.symbol=this.layer.sensorTrailSymbol.clone())}async _addOverlayMultipoint(){if(!this.layer.videoElement)return;const e=new u(this.layer.videoElement);this.addAttachHandles([r(()=>[this.layer.frameHorizonPoints,this.layer.groundControlPoints,this.layer.frameOpacity,this.layer.telemetryDisplay?.frame],()=>{const{visibleTelemetryElements:t}=this;e.frameHorizonPoints=this.layer.frameHorizonPoints,e.groundControlPoints=this.layer.groundControlPoints,e.opacity=this.layer.frameOpacity,e.visible=t?.frame??!1},l)]),this._overlayContainer.addChild(e),this.view.stage.requestRender()}};e([o()],O.prototype,"graphicsView",void 0),e([o()],O.prototype,"layer",void 0),e([o({types:f})],O.prototype,"sensorLocationSymbol",void 0),e([o()],O.prototype,"symbolAngle",void 0),e([o({type:m})],O.prototype,"visibleTelemetryElements",void 0),O=e([a("esri.views.2d.layers.VideoLayerView2D")],O);const C=O;export{C as default};
5
+ import{__decorate as e}from"tslib";import i from"../../../Color.js";import t from"../../../Graphic.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{watch as r,initial as l}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../../layers/GraphicsLayer.js";import m from"../../../layers/support/TelemetryDisplay.js";import{getSymbolDisplayAngle as y}from"../../../layers/video/videoUtils.js";import h from"../../../symbols/SimpleFillSymbol.js";import p from"../../../symbols/SimpleLineSymbol.js";import c from"../../../symbols/SimpleMarkerSymbol.js";import{applyCIMSymbolRotation as b}from"../../../symbols/support/cimSymbolUtils.js";import{symbolTypes as f}from"../../../symbols/support/typeUtils.js";import u from"../engine/webgl/OverlayContainer.js";import S from"../engine/webgl/OverlayMultipoint.js";import{LayerView2DMixin as d}from"./LayerView2D.js";import g from"./graphics/GraphicContainer.js";import _ from"./graphics/GraphicsView2D.js";import v from"../../layers/LayerView.js";const L=new i([255,127,0]),w=10005,T=10018;let O=class extends(d(v)){constructor(){super(...arguments),this._graphicsLayer=new n,this._frameOutlineGraphic=new t({symbol:new h({outline:{type:"simple-line",color:L}})}),this._frameCenterGraphic=new t({symbol:new c({color:L,style:"cross"})}),this._sensorTrailGraphic=new t({symbol:new p({color:L})}),this._sensorSightlineGraphic=new t({symbol:new p({color:L})}),this._sensorLocationGraphic=new t({symbol:new c({color:L})}),this._overlayContainer=null,this._sensorLocationSymbolType=null,this.layer=null,this.sensorLocationSymbol=null,this.symbolAngle=0,this.visibleTelemetryElements=null}destroy(){this._graphicsLayer=s(this._graphicsLayer)}initialize(){this._sensorLocationSymbolType=this.layer?.sensorSymbol.type,this._graphicsLayer.graphics.addMany([this._frameCenterGraphic,this._frameOutlineGraphic,this._sensorLocationGraphic,this._sensorSightlineGraphic,this._sensorTrailGraphic]),this.visibleTelemetryElements=new m({frame:this.layer.telemetryDisplay?.frame??!1,frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this._overlayContainer=new u,this.container.addChild(this._overlayContainer),this._addOverlayMultipoint(),this.graphicsView=new _({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new g(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([r(()=>[this.layer.telemetryDisplay?.frame,this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight],()=>this._updateVisibleTelemetryElements(),l),r(()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight],()=>this._updateGraphicGeometries(),l),r(()=>this.layer.metadata,()=>this._updateSensorLocationSymbolAngle(),l),r(()=>this.layer?.frameCenterSymbol,()=>this._updateFrameCenterSymbol(),l),r(()=>this.layer?.frameOutlineSymbol,()=>this._updateFrameOutlineSymbol(),l),r(()=>this.layer?.sensorSightLineSymbol,()=>this._updateSensorSightlineSymbol(),l),r(()=>this.layer?.sensorSymbol,()=>this._updateSensorLocationSymbol(),l),r(()=>this.layer?.sensorTrailSymbol,()=>this._updateSensorTrailSymbol(),l),r(()=>this.symbolAngle,()=>this._updateSensorLocationSymbol(),l)])}detach(){this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this.graphicsView=s(this.graphicsView)}supportsSpatialReference(e){return!0}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(e){this.graphicsView.processUpdate(e)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.view.animationsEnabled&&this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frame=this.layer.telemetryDisplay.frame,this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){if(!this.view.animationsEnabled)return;const{telemetry:e}=this.layer,{visibleTelemetryElements:i}=this;e&&i&&(i.frameOutline&&e.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,i.sensorTrail&&e.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,i.lineOfSight&&e.lineOfSight?this._sensorSightlineGraphic.geometry=this.layer.telemetry.lineOfSight:this._sensorSightlineGraphic.geometry=null,i.sensorLocation&&e.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,i.frameCenter&&e.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}_updateSensorLocationSymbolAngle(){if(!this.view.animationsEnabled)return;if(!this.layer?.metadata?.size)return;const{source:e,symbolOffset:i=0}=this.layer.sensorSymbolOrientation||{};if(!e&&!i)return;const t=this.layer?.metadata?.get(w)?.value??0,s=this.layer?.metadata?.get(T)?.value??0,r=y({cameraAzimuth:s,platformHeading:t,source:this.layer.sensorSymbolOrientation?.source,symbolOffset:this.layer.sensorSymbolOrientation?.symbolOffset??0});this.symbolAngle=Math.round(Math.abs(r))}_updateSensorLocationSymbol(){switch(this._sensorLocationSymbolType){case"simple-marker":this.sensorLocationSymbol=this.layer.sensorSymbol.clone(),this.sensorLocationSymbol.angle=this.symbolAngle,this._sensorLocationGraphic.symbol=this.sensorLocationSymbol.clone();break;case"picture-marker":this.sensorLocationSymbol=this.layer.sensorSymbol,this.sensorLocationSymbol.angle=this.symbolAngle,this._sensorLocationGraphic.symbol=this.sensorLocationSymbol;break;case"cim":this.sensorLocationSymbol=this.layer.sensorSymbol,b(this.sensorLocationSymbol,this.symbolAngle,!0),this._sensorLocationGraphic.symbol=this.sensorLocationSymbol}}_updateFrameCenterSymbol(){this.layer?.frameCenterSymbol&&(this._frameCenterGraphic.symbol=this.layer.frameCenterSymbol.clone())}_updateFrameOutlineSymbol(){this.layer?.frameOutlineSymbol&&(this._frameOutlineGraphic.symbol=this.layer.frameOutlineSymbol.clone())}_updateSensorSightlineSymbol(){this.layer?.sensorSightLineSymbol&&(this._sensorSightlineGraphic.symbol=this.layer.sensorSightLineSymbol.clone())}_updateSensorTrailSymbol(){this.layer?.sensorTrailSymbol&&(this._sensorTrailGraphic.symbol=this.layer.sensorTrailSymbol.clone())}async _addOverlayMultipoint(){if(!this.layer.videoElement)return;const e=new S(this.layer.videoElement);this.addAttachHandles([r(()=>[this.layer.frameHorizonPoints,this.layer.groundControlPoints,this.layer.frameOpacity,this.layer.telemetryDisplay?.frame],()=>{if(!this.view.animationsEnabled)return;const{visibleTelemetryElements:i}=this;e.frameHorizonPoints=this.layer.frameHorizonPoints,e.groundControlPoints=this.layer.groundControlPoints,e.opacity=this.layer.frameOpacity,e.visible=i?.frame??!1},l)]),this._overlayContainer.addChild(e),this.view.stage.requestRender()}};e([o()],O.prototype,"graphicsView",void 0),e([o()],O.prototype,"layer",void 0),e([o({types:f})],O.prototype,"sensorLocationSymbol",void 0),e([o()],O.prototype,"symbolAngle",void 0),e([o({type:m})],O.prototype,"visibleTelemetryElements",void 0),O=e([a("esri.views.2d.layers.VideoLayerView2D")],O);const C=O;export{C as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import i from"../../../../Viewpoint.js";import o from"../../../../core/Accessor.js";import{when as e}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as m}from"../../../../core/screenUtils.js";import{Seconds as s,secondsFromMilliseconds as n}from"../../../../core/time.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{g as p}from"../../../../chunks/vec32.js";import{create as c,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import u from"../../../../geometry/Point.js";import{translateBy as d}from"../../viewpointUtils.js";import{PanPlanarMomentumEstimator as v}from"../../../navigation/PanPlanarMomentumEstimator.js";let l=class extends o{constructor(t){super(t),this.animationTime=s(0),this.momentumEstimator=new v(500,6,.92),this.momentum=null,this.tmpMomentum=c(),this.momentumFinished=!1,this.viewpoint=new i({targetGeometry:new u,scale:0,rotation:0}),this._previousDrag=null,this.addHandles(e(()=>this.momentumFinished,()=>this.navigation.stop()))}begin(t,i){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(i),this._previousDrag=i}update(t,i){this.addToEstimator(i);let o=i.center.x,e=i.center.y;const m=this._previousDrag;o=m?m.center.x-o:-o,e=m?e-m.center.y:e,t.viewpoint=d(this.viewpoint,t.viewpoint,[o||0,e||0]),this._previousDrag=i}end(t,i){this.addToEstimator(i);const o=t.navigation.effectiveMomentumEnabled;this.momentum=o?this.momentumEstimator.evaluateMomentum():null,this.animationTime=s(0),this.momentum&&this.onAnimationUpdate(t),this._previousDrag=null,this.navigation.end()}addToEstimator(t){const i=t.center.x,o=t.center.y,e=m(-i,o),s=h(-i,o,0);this.momentumEstimator.add(e,s,.001*t.timestamp)}onAnimationUpdate(t){this.navigation.animationManager?.animateContinuous(t.viewpoint,(i,o)=>{const{momentum:e,animationTime:m,tmpMomentum:r}=this,a=this.momentumFinished=!e||e.isFinished(m),c=n(o);if(!a){const o=e.valueDelta(m,c);p(r,e.direction,o),d(i,i,r),t.constraints.constrainByGeometry(i)}this.animationTime=s(this.animationTime+c)})}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};t([r()],l.prototype,"momentumFinished",void 0),t([r()],l.prototype,"viewpoint",void 0),t([r()],l.prototype,"navigation",void 0),l=t([a("esri.views.2d.navigation.actions.Pan")],l);export{l as default};
5
+ import{__decorate as t}from"tslib";import i from"../../../../Viewpoint.js";import{prefersReducedMotion as o}from"../../../../core/a11yUtils.js";import e from"../../../../core/Accessor.js";import{when as m}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as s}from"../../../../core/screenUtils.js";import{Seconds as n,secondsFromMilliseconds as r}from"../../../../core/time.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{g as c}from"../../../../chunks/vec32.js";import{create as h,fromValues as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import d from"../../../../geometry/Point.js";import{translateBy as v}from"../../viewpointUtils.js";import{PanPlanarMomentumEstimator as l}from"../../../navigation/PanPlanarMomentumEstimator.js";let g=class extends e{constructor(t){super(t),this.animationTime=n(0),this.momentumEstimator=new l(500,6,.92),this.momentum=null,this.tmpMomentum=h(),this.momentumFinished=!1,this.viewpoint=new i({targetGeometry:new d,scale:0,rotation:0}),this._previousDrag=null,this.addHandles(m(()=>this.momentumFinished,()=>this.navigation.stop()))}begin(t,i){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(i),this._previousDrag=i}update(t,i){this.addToEstimator(i);let o=i.center.x,e=i.center.y;const m=this._previousDrag;o=m?m.center.x-o:-o,e=m?e-m.center.y:e,t.viewpoint=v(this.viewpoint,t.viewpoint,[o||0,e||0]),this._previousDrag=i}end(t,i){this.addToEstimator(i);const e=t.navigation.momentumEnabled&&!o();this.momentum=e?this.momentumEstimator.evaluateMomentum():null,this.animationTime=n(0),this.momentum&&this.onAnimationUpdate(t),this._previousDrag=null,this.navigation.end()}addToEstimator(t){const i=t.center.x,o=t.center.y,e=s(-i,o),m=u(-i,o,0);this.momentumEstimator.add(e,m,.001*t.timestamp)}onAnimationUpdate(t){this.navigation.animationManager?.animateContinuous(t.viewpoint,(i,o)=>{const{momentum:e,animationTime:m,tmpMomentum:s}=this,a=this.momentumFinished=!e||e.isFinished(m),p=r(o);if(!a){const o=e.valueDelta(m,p);c(s,e.direction,o),v(i,i,s),t.constraints.constrainByGeometry(i)}this.animationTime=n(this.animationTime+p)})}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};t([a()],g.prototype,"momentumFinished",void 0),t([a()],g.prototype,"viewpoint",void 0),t([a()],g.prototype,"navigation",void 0),g=t([p("esri.views.2d.navigation.actions.Pan")],g);export{g as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{isIterable as t}from"../../../../core/iteratorUtils.js";import{memoize as r}from"../../../../core/memoize.js";import{watch as i}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as o}from"../../../../core/unitUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{i as l}from"../../../../chunks/vec32.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../../geometry/ellipsoidUtils.js";import{create as p,fromPoints as u}from"../../../../geometry/support/ray.js";import{GeometryDescriptor as m}from"../../../../layers/support/GeometryDescriptor.js";import{externalToInternalIntersectOptions as d}from"../../support/hitTest.js";import{Intersector as y}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as f}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{getInputGraphic as h}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{ElevationProfileLineComputation as v}from"../../../analysis/ElevationProfile/ElevationProfileLineComputation.js";const _=2e5;let w=class extends v{constructor(){super(...arguments),this.type="scene",this.numSamplesForPreview=50,this.numSamplesPerChunk=25,this._getQueryElevationDependenciesMemoized=r((e,t,r,i,o,n,s)=>({inputGraphicUid:j(e),visibleLayers:t,maxIntersectionDistance:r,intersectOptions:i,view:o,stationary:n,spatialReference:s})),this._vecA=a(),this._vecB=a(),this._ray=p()}get minDemResolution(){const e=this._view;if(!e)return null;const t=e.pointsOfInterest?.focus?.worldUnitsPerContentPixel;return null==t?null:t*o(e.spatialReference)}initialize(){const e=()=>this.onInvalidate(this);return this.addHandles([i(()=>this._queryElevationDependencies,e),this.controller.onElevationChange(e)])}async queryElevation(e,{noDataValue:t,signal:r}){const i=this._queryElevationDependencies;if(null==i)throw new Error(`${this.declaredClass}: no dependencies`);const o=this._intersector;if(null==o)throw new Error(`${this.declaredClass}: no view`);const{intersectOptions:n,view:s,spatialReference:a}=i,c=s.renderCoordsHelper,p=s.sceneIntersectionHelper,d=this._vecA,y=this._vecA,f=this._vecB,h=this._ray;if(!a)return{geometry:e,noDataValue:t};const v=await m.fromGeometry(e).project(a,r);if(!v)return{geometry:e,noDataValue:t};const w=v.coordinates,j=w.length;for(let m=0;m<j;++m){const e=w[m];l(f,e.x,e.y,e.z??0),c.toRenderCoords(f,a,f),c.setAltitude(d,_,f);const r=u(d,f,h);p.computeIntersection(r,o,!0,n);const s=g(i,o.results.all);s?(s.getIntersectionPoint(y),c.fromRenderCoords(y,y,a),e.z=y[2]):e.z=t}return{geometry:v.export(),noDataValue:t}}get _queryElevationDependencies(){const e=this._view;return e?this._getQueryElevationDependenciesMemoized(this.controller?.analysis.input,this._visibleLayers,this._maxIntersectionDistance,this._intersectOptions,e,e.stationary,e.spatialReference):null}get _visibleLayers(){return this._view?.map?.allLayers?.filter(e=>e.visible).toArray()??[]}get _intersectOptions(){const e=this._view;if(!e||e.destroyed)return{};const{include:r,exclude:i}=this.profileLine;return d(e,{include:r,exclude:[...this._pointCloudLayers,...t(i)?i:i?[i]:[]]})}get _pointCloudLayers(){const e=this._view;return e?e.allLayerViews.toArray().filter(e=>"point-cloud"===e.layer?.type).map(e=>e.layer):[]}get _view(){const e=this.controller.view;return"3d"===e.type?e:null}get _maxIntersectionDistance(){const e=this._view;return e?.renderCoordsHelper?c(e.spatialReference).radius/e.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY}get _intersector(){const e=this._view;if(!e)return null;const t=new y(e.state.viewingMode),r=t.options;return r.hud=!1,r.invisibleTerrain=!1,r.backfacesTerrain=!1,r.selectionMode=!1,r.store=2,t}};function g({view:e,inputGraphicUid:t,maxIntersectionDistance:r},i){for(const o of i){if(!o.withinDistance(r))continue;const i=f(o,e);if(null==i||j(i)!==t)return o}return null}function j(e){const t=h(e);if(!t)return null;if(t.layer&&"objectIdField"in t.layer){const e=t.attributes[t.layer.objectIdField];if(e)return`o-${t.layer.id}-${e}`}return`u-${t.uid}`}e([n({readOnly:!0})],w.prototype,"minDemResolution",null),e([n()],w.prototype,"_queryElevationDependencies",null),e([n()],w.prototype,"_visibleLayers",null),e([n()],w.prototype,"_intersectOptions",null),e([n()],w.prototype,"_pointCloudLayers",null),e([n()],w.prototype,"_view",null),e([n()],w.prototype,"_maxIntersectionDistance",null),e([n()],w.prototype,"_intersector",null),w=e([s("esri.views.3d.analysis.ElevationProfile.ElevationProfileLineSceneComputation")],w);export{w as ElevationProfileLineSceneComputation};
5
+ import{__decorate as e}from"tslib";import{isIterable as t}from"../../../../core/iteratorUtils.js";import{memoize as r}from"../../../../core/memoize.js";import{watch as i}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as o}from"../../../../core/unitUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{i as l}from"../../../../chunks/vec32.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../../geometry/ellipsoidUtils.js";import{create as p,fromPoints as u}from"../../../../geometry/support/ray.js";import{GeometryDescriptor as m}from"../../../../layers/support/GeometryDescriptor.js";import{externalToInternalIntersectOptions as d}from"../../support/hitTest.js";import{Intersector as y}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as f}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{getInputGraphic as h}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{ElevationProfileLineComputation as v}from"../../../analysis/ElevationProfile/ElevationProfileLineComputation.js";const _=2e5;let w=class extends v{constructor(){super(...arguments),this.type="scene",this.numSamplesForPreview=50,this.numSamplesPerChunk=25,this._getQueryElevationDependenciesMemoized=r((e,t,r,i,o,n,s)=>({inputGraphicUid:j(e),visibleLayers:t,maxIntersectionDistance:r,intersectOptions:i,view:o,stationary:n,spatialReference:s})),this._vecA=a(),this._vecB=a(),this._ray=p()}get minDemResolution(){const e=this._view;if(!e)return null;const t=e.pointsOfInterest?.focus?.worldUnitsPerContentPixel;return null==t?null:t*o(e.spatialReference)}initialize(){const e=()=>this.onInvalidate(this);return this.addHandles([i(()=>this._queryElevationDependencies,e),this.controller.onElevationChange(e)])}async queryElevation(e,{noDataValue:t,signal:r}){const i=this._queryElevationDependencies;if(null==i)throw new Error(`${this.declaredClass}: no dependencies`);const o=this._intersector;if(null==o)throw new Error(`${this.declaredClass}: no view`);const{intersectOptions:n,view:s,spatialReference:a}=i,c=s.renderCoordsHelper,p=s.sceneIntersectionHelper,d=this._vecA,y=this._vecA,f=this._vecB,h=this._ray;if(!a)return{geometry:e,noDataValue:t};const v=await m.fromGeometry(e).project(a,r);if(!v)return{geometry:e,noDataValue:t};const w=v.coordinates,j=w.length;for(let m=0;m<j;++m){const e=w[m];l(f,e.x,e.y,e.z??0),c.toRenderCoords(f,a,f),c.setAltitude(d,_,f);const r=u(d,f,h);p.computeIntersection(r,o,!0,n);const s=g(i,o.results.all);s?(s.getIntersectionPoint(y),c.fromRenderCoords(y,y,a),e.z=y[2]):e.z=t}return{geometry:v.export(),noDataValue:t}}get _queryElevationDependencies(){const e=this._view;return e?this._getQueryElevationDependenciesMemoized(this.controller?.analysis.input,this._visibleLayers,this._maxIntersectionDistance,this._intersectOptions,e,e.stationary,e.spatialReference):null}get _visibleLayers(){return this._view?.map?.allLayers?.filter(e=>e.visible).toArray()??[]}get _intersectOptions(){const e=this._view;if(!e||e.destroyed)return{};const{include:r,exclude:i}=this.profile;return d(e,{include:r,exclude:[...this._pointCloudLayers,...t(i)?i:i?[i]:[]]})}get _pointCloudLayers(){const e=this._view;return e?e.allLayerViews.toArray().filter(e=>"point-cloud"===e.layer?.type).map(e=>e.layer):[]}get _view(){const e=this.controller.view;return"3d"===e.type?e:null}get _maxIntersectionDistance(){const e=this._view;return e?.renderCoordsHelper?c(e.spatialReference).radius/e.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY}get _intersector(){const e=this._view;if(!e)return null;const t=new y(e.state.viewingMode),r=t.options;return r.hud=!1,r.invisibleTerrain=!1,r.backfacesTerrain=!1,r.selectionMode=!1,r.store=2,t}};function g({view:e,inputGraphicUid:t,maxIntersectionDistance:r},i){for(const o of i){if(!o.withinDistance(r))continue;const i=f(o,e);if(null==i||j(i)!==t)return o}return null}function j(e){const t=h(e);if(!t)return null;if(t.layer&&"objectIdField"in t.layer){const e=t.attributes[t.layer.objectIdField];if(e)return`o-${t.layer.id}-${e}`}return`u-${t.uid}`}e([n({readOnly:!0})],w.prototype,"minDemResolution",null),e([n()],w.prototype,"_queryElevationDependencies",null),e([n()],w.prototype,"_visibleLayers",null),e([n()],w.prototype,"_intersectOptions",null),e([n()],w.prototype,"_pointCloudLayers",null),e([n()],w.prototype,"_view",null),e([n()],w.prototype,"_maxIntersectionDistance",null),e([n()],w.prototype,"_intersector",null),w=e([s("esri.views.3d.analysis.ElevationProfile.ElevationProfileLineSceneComputation")],w);export{w as ElevationProfileLineSceneComputation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import{watch as s,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{throttle as r}from"../../../../core/throttle.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromValues as n,fromArray as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{OutlineVisualElement as m}from"../../interactive/visualElements/OutlineVisualElement.js";import{getConfig as u}from"../../../analysis/ElevationProfile/constants.js";import{getInputGeometry as c}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{createLineGeometry as f}from"../../../analysis/ElevationProfile/elevationProfileVisualizationUtils.js";let v=class extends i{constructor(e){super(e),this._updateGeometryThrottled=r(e=>{e&&(this._visualElement.visible=!0,this._visualElement.geometry=f(e.samples,e.spatialReference))},u().profileLinesUpdateThrottleMillis)}initialize(){this._visualElement=new m({view:this.view,elevationInfo:{mode:"absolute-height",offset:0},innerWidth:0,innerColor:n(0,0,0,0),width:3,falloff:0,renderOccluded:16,isDecoration:!0}),this.addHandles([s(()=>({color:this.getResult()?.computation.profileLine.color,visible:this._effectiveVisible}),({color:e,visible:i})=>{e&&(this._visualElement.color=p(t.toUnitRGBA(e))),this._visualElement.visible=i,i||(this._visualElement.geometry=null)},o),s(()=>c(this.analysisViewData.analysis.input),()=>{this._visualElement.visible=!1,this._visualElement.geometry=null},o),s(()=>this._geometryUpdateParameters,e=>this._updateGeometryThrottled(e),o),this._updateGeometryThrottled])}destroy(){this._visualElement.destroy()}get updating(){return this._updateGeometryThrottled.hasPendingUpdates()}get _result(){return this.getResult()}get _effectiveVisible(){const{analysisViewData:e,_result:t}=this;return e.visible&&null!=t&&t.available&&t.computation.profileLine.viewOptions.lineVisible}get _geometryUpdateParameters(){if(!this._effectiveVisible)return null;const e=this._result;return 1!==e?.progress?null:{samples:e.samples,spatialReference:this.view.spatialReference}}};e([l()],v.prototype,"view",void 0),e([l()],v.prototype,"analysisViewData",void 0),e([l()],v.prototype,"getResult",void 0),e([l()],v.prototype,"updating",null),e([l()],v.prototype,"_result",null),e([l()],v.prototype,"_effectiveVisible",null),e([l()],v.prototype,"_geometryUpdateParameters",null),v=e([a("esri.views.3d.analysis.ElevationProfile.ElevationProfileLineVisualization3D")],v);export{v as ElevationProfileLineVisualization3D};
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import{watch as s,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{throttle as r}from"../../../../core/throttle.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromValues as n,fromArray as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{OutlineVisualElement as m}from"../../interactive/visualElements/OutlineVisualElement.js";import{getConfig as u}from"../../../analysis/ElevationProfile/constants.js";import{getInputGeometry as c}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{createLineGeometry as f}from"../../../analysis/ElevationProfile/elevationProfileVisualizationUtils.js";let v=class extends i{constructor(e){super(e),this._updateGeometryThrottled=r(e=>{e&&(this._visualElement.visible=!0,this._visualElement.geometry=f(e.samples,e.spatialReference))},u().profileLinesUpdateThrottleMillis)}initialize(){this._visualElement=new m({view:this.view,elevationInfo:{mode:"absolute-height",offset:0},innerWidth:0,innerColor:n(0,0,0,0),width:3,falloff:0,renderOccluded:16,isDecoration:!0}),this.addHandles([s(()=>({color:this.getResult()?.computation.profile.color,visible:this._effectiveVisible}),({color:e,visible:i})=>{e&&(this._visualElement.color=p(t.toUnitRGBA(e))),this._visualElement.visible=i,i||(this._visualElement.geometry=null)},o),s(()=>c(this.analysisViewData.analysis.input),()=>{this._visualElement.visible=!1,this._visualElement.geometry=null},o),s(()=>this._geometryUpdateParameters,e=>this._updateGeometryThrottled(e),o),this._updateGeometryThrottled])}destroy(){this._visualElement.destroy()}get updating(){return this._updateGeometryThrottled.hasPendingUpdates()}get _result(){return this.getResult()}get _effectiveVisible(){const{analysisViewData:e,_result:t}=this;return e.visible&&null!=t&&t.available&&t.computation.profile.viewOptions.lineVisible}get _geometryUpdateParameters(){if(!this._effectiveVisible)return null;const e=this._result;return 1!==e?.progress?null:{samples:e.samples,spatialReference:this.view.spatialReference}}};e([l()],v.prototype,"view",void 0),e([l()],v.prototype,"analysisViewData",void 0),e([l()],v.prototype,"getResult",void 0),e([l()],v.prototype,"updating",null),e([l()],v.prototype,"_result",null),e([l()],v.prototype,"_effectiveVisible",null),e([l()],v.prototype,"_geometryUpdateParameters",null),v=e([a("esri.views.3d.analysis.ElevationProfile.ElevationProfileLineVisualization3D")],v);export{v as ElevationProfileLineVisualization3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as i}from"tslib";import o from"../../../../core/Accessor.js";import{mapCollection as t}from"../../../../core/mapCollectionUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{ElevationProfileInputVisualization3D as e}from"./ElevationProfileInputVisualization3D.js";import{ElevationProfileLineVisualization3D as r}from"./ElevationProfileLineVisualization3D.js";import{ElevationProfileHoveredPointsVisualization as n}from"../../../analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js";let l=class extends o{constructor(i){super(i)}initialize(){const{view:i,analysisViewData:o}=this;this._hoveredPointsVisualization=new n({view:i,analysisViewData:o}),this._inputVisualization=new e({view:i,analysisViewData:o}),this._lineVisualizations=t(()=>this.analysisViewData.analysis.profiles,t=>new r({view:i,analysisViewData:o,getResult:()=>o.results.find(i=>i.computation.profileLine===t)}))}destroy(){this._inputVisualization.destroy(),this._hoveredPointsVisualization.destroy(),this._lineVisualizations.destroy()}get updating(){return this._inputVisualization.updating||this._lineVisualizations.some(i=>i.updating)}};i([s()],l.prototype,"view",void 0),i([s()],l.prototype,"analysisViewData",void 0),i([s()],l.prototype,"updating",null),l=i([a("esri.views.3d.analysis.ElevationProfile.ElevationProfileVisualization3D")],l);export{l as ElevationProfileVisualization3D};
5
+ import{__decorate as i}from"tslib";import o from"../../../../core/Accessor.js";import{mapCollection as t}from"../../../../core/mapCollectionUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{ElevationProfileInputVisualization3D as e}from"./ElevationProfileInputVisualization3D.js";import{ElevationProfileLineVisualization3D as r}from"./ElevationProfileLineVisualization3D.js";import{ElevationProfileHoveredPointsVisualization as n}from"../../../analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js";let l=class extends o{constructor(i){super(i)}initialize(){const{view:i,analysisViewData:o}=this;this._hoveredPointsVisualization=new n({view:i,analysisViewData:o}),this._inputVisualization=new e({view:i,analysisViewData:o}),this._lineVisualizations=t(()=>this.analysisViewData.analysis.profiles,t=>new r({view:i,analysisViewData:o,getResult:()=>o.results.find(i=>i.computation.profile===t)}))}destroy(){this._inputVisualization.destroy(),this._hoveredPointsVisualization.destroy(),this._lineVisualizations.destroy()}get updating(){return this._inputVisualization.updating||this._lineVisualizations.some(i=>i.updating)}};i([s()],l.prototype,"view",void 0),i([s()],l.prototype,"analysisViewData",void 0),i([s()],l.prototype,"updating",null),l=i([a("esri.views.3d.analysis.ElevationProfile.ElevationProfileVisualization3D")],l);export{l as ElevationProfileVisualization3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as r}from"./AnalysisView3D.js";import{ElevationProfileLineSceneComputation as i}from"./ElevationProfile/ElevationProfileLineSceneComputation.js";import{ElevationProfileVisualization3D as s}from"./ElevationProfile/ElevationProfileVisualization3D.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileLineGroundComputation as n}from"../../analysis/ElevationProfile/ElevationProfileLineGroundComputation.js";import{ElevationProfileLineInputComputation as a}from"../../analysis/ElevationProfile/ElevationProfileLineInputComputation.js";import{ElevationProfileLineQueryComputation as p}from"../../analysis/ElevationProfile/ElevationProfileLineQueryComputation.js";import{ElevationProfileTool as c}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let u=class extends r{constructor(t){super(t),this.type="elevation-profile-view-3d",this.analysis=null,this.hoveredPosition=null}initialize(){const{analysis:t,view:e}=this;this._controller=new l({analysis:t,analysisViewData:this,view:e,computationFactory:{create:t=>{switch(t.profileLine.type){case"ground":return new n(t);case"input":return new a(t);case"query":return new p(t);case"scene":return new i(t)}}}}),this._visualization=new s({view:e,analysisViewData:this}),this._sketchTool=new c({view:e,analysisViewData:this})}destroy(){this._controller?.destroy(),this._visualization?.destroy(),this._sketchTool?.destroy()}get effectiveUnits(){return this._controller?.effectiveUnits??{distance:"meters",elevation:"meters"}}get error(){return this._controller?.error}get hoveredPoints(){return this._controller?.hoveredPoints??[]}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller?.progress??0}get results(){return this._controller?.results??[]}get statistics(){return this._controller?.statistics}get updating(){return!0===this._controller?.updating||!0===this._visualization?.updating||!0===this._sketchTool?.updating}get visible(){return super.visible}set visible(t){super.visible=t}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??"idle"}place(t){return this._sketchTool.place(t)}pickGraphic(t){return this._sketchTool.pickGraphic(t)}};t([e({readOnly:!0})],u.prototype,"type",void 0),t([e({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",void 0),t([e({readOnly:!0})],u.prototype,"effectiveUnits",null),t([e({readOnly:!0})],u.prototype,"error",null),t([e()],u.prototype,"hoveredPosition",void 0),t([e()],u.prototype,"hoveredPoints",null),t([e({readOnly:!0})],u.prototype,"progress",null),t([e({readOnly:!0})],u.prototype,"results",null),t([e({readOnly:!0})],u.prototype,"statistics",null),t([e({readOnly:!0})],u.prototype,"updating",null),t([e()],u.prototype,"sketchGraphic",null),t([e()],u.prototype,"toolState",null),t([e()],u.prototype,"_controller",void 0),t([e()],u.prototype,"_visualization",void 0),t([e()],u.prototype,"_sketchTool",void 0),u=t([o("esri.views.3d.analysis.ElevationProfileAnalysisView3D")],u);const h=u;export{h as default};
5
+ import{__decorate as t}from"tslib";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as r}from"./AnalysisView3D.js";import{ElevationProfileLineSceneComputation as i}from"./ElevationProfile/ElevationProfileLineSceneComputation.js";import{ElevationProfileVisualization3D as s}from"./ElevationProfile/ElevationProfileVisualization3D.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileLineGroundComputation as n}from"../../analysis/ElevationProfile/ElevationProfileLineGroundComputation.js";import{ElevationProfileLineInputComputation as a}from"../../analysis/ElevationProfile/ElevationProfileLineInputComputation.js";import{ElevationProfileLineQueryComputation as p}from"../../analysis/ElevationProfile/ElevationProfileLineQueryComputation.js";import{ElevationProfileTool as c}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let u=class extends r{constructor(t){super(t),this.type="elevation-profile-view-3d",this.analysis=null,this.hoveredPosition=null}initialize(){const{analysis:t,view:e}=this;this._controller=new l({analysis:t,analysisViewData:this,view:e,computationFactory:{create:t=>{switch(t.profile.type){case"ground":return new n(t);case"input":return new a(t);case"query":return new p(t);case"scene":return new i(t)}}}}),this._visualization=new s({view:e,analysisViewData:this}),this._sketchTool=new c({view:e,analysisViewData:this})}destroy(){this._controller?.destroy(),this._visualization?.destroy(),this._sketchTool?.destroy()}get effectiveUnits(){return this._controller?.effectiveUnits??{distance:"meters",elevation:"meters"}}get error(){return this._controller?.error}get hoveredPoints(){return this._controller?.hoveredPoints??[]}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller?.progress??0}get results(){return this._controller?.results??[]}get statistics(){return this._controller?.statistics}get updating(){return!0===this._controller?.updating||!0===this._visualization?.updating||!0===this._sketchTool?.updating}get visible(){return super.visible}set visible(t){super.visible=t}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??"idle"}place(t){return this._sketchTool.place(t)}pickGraphic(t){return this._sketchTool.pickGraphic(t)}};t([e({readOnly:!0})],u.prototype,"type",void 0),t([e({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",void 0),t([e({readOnly:!0})],u.prototype,"effectiveUnits",null),t([e({readOnly:!0})],u.prototype,"error",null),t([e()],u.prototype,"hoveredPosition",void 0),t([e()],u.prototype,"hoveredPoints",null),t([e({readOnly:!0})],u.prototype,"progress",null),t([e({readOnly:!0})],u.prototype,"results",null),t([e({readOnly:!0})],u.prototype,"statistics",null),t([e({readOnly:!0})],u.prototype,"updating",null),t([e()],u.prototype,"sketchGraphic",null),t([e()],u.prototype,"toolState",null),t([e()],u.prototype,"_controller",void 0),t([e()],u.prototype,"_visualization",void 0),t([e()],u.prototype,"_sketchTool",void 0),u=t([o("esri.views.3d.analysis.ElevationProfileAnalysisView3D")],u);const h=u;export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Color.js";import"../../../../intl.js";import i from"../../../../core/Accessor.js";import{equals as s}from"../../../../core/arrayUtils.js";import{cyclicalPI as o}from"../../../../core/Cyclical.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{formatDecimal as l}from"../../../../core/quantityFormatUtils.js";import{watch as n,initial as a}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as c}from"../../../../core/unitUtils.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as h}from"../../../../chunks/earcut.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as p,n as g,d as y,h as _,e as f}from"../../../../chunks/vec32.js";import{create as v,fromValues as j}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as L}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as b}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as C}from"../../../../geometry/support/Indices.js";import{angleAroundAxis as w}from"../../../../geometry/support/vector.js";import{t as G}from"../../../../chunks/vec3.js";import P from"../../../../symbols/support/ElevationInfo.js";import{cutFillConfiguration as V}from"./VolumeMeasurementConfiguration.js";import{LabelVisualElement as F}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as A}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as R}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as x}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as O}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as S}from"../../layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{geometryToRenderInfo as D}from"../../support/renderInfoUtils/polygon.js";import{CutFillColor as M,VolumeGeometry as U}from"../../webgl-engine/lib/CutFillColor.js";import{createStipplePatternSimple as E}from"../../webgl-engine/materials/lineStippleUtils.js";import{onLocaleChange as B}from"../../../../intl/locale.js";import{fetchMessageBundle as H}from"../../../../intl/messages.js";import{substitute as T}from"../../../../intl/substitute.js";let I=class extends i{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get updating(){return this.loadingMessages}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._elevationContext=O.fromElevationInfo(new P({mode:"absolute-height"})),this._extrusionHeight=1e4,this._projectionLines=[]}initialize(){const{view:e}=this,i={view:e,isDecoration:!0},s=V,o={...i,width:s.geometryOutlineWidth};this._elevationAlignedGeometry=new R({...o,isDraped:!0,color:t.toUnitRGBA(s.geometryOutlineColor)}),this._targetGeometry=new R(o);const r={...i,attached:!0,width:s.projectionLineWidth,renderOccluded:4,polygonOffset:!0},l={...r,stipplePattern:E(s.projectionLineStippleSize)},c=t.toUnitRGBA(s.cutProjectionLineColor),u=t.toUnitRGBA(s.fillProjectionLineColor);this._cutProjectionLines=new A({...r,color:c}),this._occludedCutProjectionLines=new A({...l,color:c}),this._fillProjectionLines=new A({...r,color:u}),this._occludedFillProjectionLines=new A({...l,color:u});const m={...i,attached:!0};this._cutVolumeLabel=new F(m),this._fillVolumeLabel=new F(m),this._cutFillRenderNode=new M({view:e,cutColor:s.cutColor,fillColor:s.fillColor}),this.addHandles([n(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},a),n(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i},a),n(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i)),n(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor}),({interactive:e,accentColor:t})=>{this._updateColors(e,t)},a),n(()=>this.analysisViewData.targetGeometry,()=>this._updateCutFillGeometry(),a),n(()=>this.visible,()=>this._updateCutFillVisibility()),n(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{labelAnchors:s.labelAnchors,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i}},e=>this._updateLabels(e)),n(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e)),B(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=r(this._elevationAlignedGeometry),this._targetGeometry=r(this._targetGeometry),this._cutProjectionLines=r(this._cutProjectionLines),this._occludedCutProjectionLines=r(this._occludedCutProjectionLines),this._fillProjectionLines=r(this._fillProjectionLines),this._occludedFillProjectionLines=r(this._occludedFillProjectionLines),this._cutVolumeLabel=r(this._cutVolumeLabel),this._fillVolumeLabel=r(this._fillVolumeLabel),this._cutFillRenderNode.destroy()}get _config(){return V}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._occludedCutProjectionLines.visible=i,this._fillProjectionLines.visible=i,this._occludedFillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:o}=this.view,r=[],l=e.spatialReference,n=e.rings[0],a=n.length>1&&s(n[0],n[n.length-1]),c=n.length-(a?1:0);for(let s=0;s<c;++s){const e=n[s],i=p(v(),e[0],e[1],e[2]);o.toRenderCoords(i,l,i);const a=t.rings[0][s],c=p(v(),a[0],a[1],a[2]);o.toRenderCoords(c,l,c);const u=new x(i,c);r.push(u)}e.isClockwise(n)||r.reverse();const u=[],m=[],h=[],d=[],g=[],y=this.view.state.camera;for(let s=0;s<r.length;++s){const i=r[s],o=r[0===s?r.length-1:s-1],l=r[s===r.length-1?0:s+1],n=e.rings[0][s],a=t.rings[0][s],c=n[2]>a[2],p=new k(i,o,l,c);u.push(p),p.updateOccluded(y);const _=p.isOccluded;c?(_?h:m).push(i):(_?g:d).push(i)}this._projectionLines=u,this._cutProjectionLines.setGeometryFromSegments(m),this._occludedCutProjectionLines.setGeometryFromSegments(h),this._fillProjectionLines.setGeometryFromSegments(d),this._occludedFillProjectionLines.setGeometryFromSegments(g)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let r=!1,l=!1;for(const n of this._projectionLines){n.updateOccluded(e)&&(r||=n.isCut,l||=!n.isCut);const a=n.isOccluded;(n.isCut?a?i:t:a?o:s).push(n.segment)}l&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),r&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,i){const{geometryOutlineColor:s,cutProjectionLineColor:o,fillProjectionLineColor:r}=this._config;if(e){const e=t.toUnitRGBA(i);this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e}else{this._targetGeometry.color=t.toUnitRGBA(s);const e=t.toUnitRGBA(o);this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const i=t.toUnitRGBA(r);this._fillProjectionLines.color=i,this._occludedFillProjectionLines.color=i}}_updateLabels(e){const{labelDistance:t}=this._config,{effectiveDisplayUnits:i,labelAnchors:s,messages:o,unitsMessages:r,result:l,visible:n}=e;if(this._cutVolumeLabel.visible=n,this._fillVolumeLabel.visible=n,this._cutVolumeLabel.geometry=s.cut?{type:"point",point:s.cut,callout:{distance:t,offset:0}}:null,this._fillVolumeLabel.geometry=s.fill?{type:"point",point:s.fill,callout:{distance:-t,offset:0}}:null,null==l||null==o||null==r)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const a=i.volume,c=T(o.labels.cut,{volume:N(r,l.cutVolume,a)}),u=T(o.labels.fill,{volume:N(r,l.fillVolume,a)});this._cutVolumeLabel.text=c,this._fillVolumeLabel.text=u}_updateCutFillVisibility(){this.visible?this._cutFillRenderNode.enable():this._cutFillRenderNode.disable()}_updateCutFillGeometry(){const{renderCoordsHelper:e}=this.view,{targetGeometry:t}=this.analysisViewData;if(!t?.extent)return;const{center:i}=t.extent,s=j(i.x,i.y,0),o=v();e.toRenderCoords(s,t.spatialReference,o);const r=this._getExtrudedVolumes(t,this._extrusionHeight,s),l=this._getExtrudedVolumes(t,-this._extrusionHeight,s);this._cutFillRenderNode.updateGeometries(r,l,o)}_getExtrudedVolumes(e,t,i){const{renderCoordsHelper:s,spatialReference:o,elevationProvider:r}=this.view,l=v(),n=1===s.viewingMode;n||s.worldUpAtPosition([0,0,0],l);const a=D(e,r,s,this._elevationContext),{polygons:c,mapPositions:u,position:m}=a,p=c[0],g=p.count,y=h(p.mapPositions,p.holeIndices,3),_=y.length,f=6*g,j=C(f+_),w=C(_),P=b(3*f),V=b(3*f);S(m,u,y,p,P,null,V,null,j,w,t,l,n);const F=d(),A=d();return L(o,i,F,s.spatialReference),A[12]=-F[12],A[13]=-F[13],A[14]=-F[14],G(P,P,A),new U(P,w,j,V)}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await H("esri/core/t9n/Units"),this.messages=await H("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function N(e,t,i){return e&&t&&l(e,t,c(t.value,t.unit,i))}e([u({constructOnly:!0})],I.prototype,"view",void 0),e([u({constructOnly:!0})],I.prototype,"analysis",void 0),e([u({constructOnly:!0})],I.prototype,"analysisViewData",void 0),e([u()],I.prototype,"unitsMessages",void 0),e([u()],I.prototype,"messages",void 0),e([u()],I.prototype,"loadingMessages",void 0),e([u({readOnly:!0})],I.prototype,"visible",null),e([u()],I.prototype,"updating",null),I=e([m("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],I);class k{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=v(),this._n2=v();const r=g(z,y(z,e.endRenderSpace,e.startRenderSpace));g(this._n1,_(this._n1,r,g(W,y(W,t.startRenderSpace,e.startRenderSpace)))),g(this._n2,_(this._n2,r,g(W,y(W,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=o.normalize(w(this._n1,this._n2,r))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){y(z,this.segment.startRenderSpace,e.eye);const t=f(this._n1,z)<0,i=f(this._n2,z)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const z=v(),W=v();export{I as VolumeMeasurementCutFillVisualization};
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import"../../../../intl.js";import i from"../../../../core/Accessor.js";import{equals as s}from"../../../../core/arrayUtils.js";import{cyclicalPI as o}from"../../../../core/Cyclical.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{formatDecimal as l}from"../../../../core/quantityFormatUtils.js";import{watch as n,initial as a}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as c}from"../../../../core/unitUtils.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as d}from"../../../../chunks/earcut.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as p,n as g,d as y,h as _,e as f}from"../../../../chunks/vec32.js";import{create as v,fromValues as j}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as b}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as L}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as C}from"../../../../geometry/support/Indices.js";import{angleAroundAxis as w}from"../../../../geometry/support/vector.js";import{t as G}from"../../../../chunks/vec3.js";import P from"../../../../symbols/support/ElevationInfo.js";import{cutFillConfiguration as V}from"./VolumeMeasurementConfiguration.js";import{LabelVisualElement as F}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as R}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as A}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as O}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as x}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as S}from"../../layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{geometryToRenderInfo as D}from"../../support/renderInfoUtils/polygon.js";import{CutFillColor as M,VolumeGeometry as U}from"../../webgl-engine/lib/CutFillColor.js";import{createStipplePatternSimple as E}from"../../webgl-engine/materials/lineStippleUtils.js";import{onLocaleChange as B}from"../../../../intl/locale.js";import{fetchMessageBundle as H}from"../../../../intl/messages.js";import{substitute as N}from"../../../../intl/substitute.js";let T=class extends i{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get updating(){return this.loadingMessages}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._elevationContext=x.fromElevationInfo(new P({mode:"absolute-height"})),this._extrusionHeight=1e4,this._projectionLines=[]}initialize(){const{view:e}=this,i={view:e,isDecoration:!0},s=V,o={...i,width:s.geometryOutlineWidth};this._elevationAlignedGeometry=new A({...o,isDraped:!0,color:t.toUnitRGBA(s.geometryOutlineColor)}),this._targetGeometry=new A(o);const r={...i,attached:!0,width:s.projectionLineWidth,renderOccluded:4,polygonOffset:!0},l={...r,stipplePattern:E(s.projectionLineStippleSize)},c=t.toUnitRGBA(s.cutProjectionLineColor),u=t.toUnitRGBA(s.fillProjectionLineColor);this._cutProjectionLines=new R({...r,color:c}),this._occludedCutProjectionLines=new R({...l,color:c}),this._fillProjectionLines=new R({...r,color:u}),this._occludedFillProjectionLines=new R({...l,color:u});const m={...i,attached:!0};this._cutVolumeLabel=new F(m),this._fillVolumeLabel=new F(m),this._cutFillRenderNode=new M({view:e,cutColor:s.cutColor,fillColor:s.fillColor,borderColor:s.geometryOutlineColor}),this.addHandles([n(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},a),n(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i},a),n(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i)),n(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor}),({interactive:e,accentColor:t})=>{this._updateColors(e,t)},a),n(()=>this.analysisViewData.targetGeometry,()=>this._updateCutFillGeometry(),a),n(()=>this.visible,()=>this._updateCutFillVisibility()),n(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{labelAnchors:s.labelAnchors,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i}},e=>this._updateLabels(e)),n(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e)),B(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=r(this._elevationAlignedGeometry),this._targetGeometry=r(this._targetGeometry),this._cutProjectionLines=r(this._cutProjectionLines),this._occludedCutProjectionLines=r(this._occludedCutProjectionLines),this._fillProjectionLines=r(this._fillProjectionLines),this._occludedFillProjectionLines=r(this._occludedFillProjectionLines),this._cutVolumeLabel=r(this._cutVolumeLabel),this._fillVolumeLabel=r(this._fillVolumeLabel),this._cutFillRenderNode.destroy()}get _config(){return V}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._occludedCutProjectionLines.visible=i,this._fillProjectionLines.visible=i,this._occludedFillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:o}=this.view,r=[],l=e.spatialReference,n=e.rings[0],a=n.length>1&&s(n[0],n[n.length-1]),c=n.length-(a?1:0);for(let s=0;s<c;++s){const e=n[s],i=p(v(),e[0],e[1],e[2]);o.toRenderCoords(i,l,i);const a=t.rings[0][s],c=p(v(),a[0],a[1],a[2]);o.toRenderCoords(c,l,c);const u=new O(i,c);r.push(u)}e.isClockwise(n)||r.reverse();const u=[],m=[],d=[],h=[],g=[],y=this.view.state.camera;for(let s=0;s<r.length;++s){const i=r[s],o=r[0===s?r.length-1:s-1],l=r[s===r.length-1?0:s+1],n=e.rings[0][s],a=t.rings[0][s],c=n[2]>a[2],p=new k(i,o,l,c);u.push(p),p.updateOccluded(y);const _=p.isOccluded;c?(_?d:m).push(i):(_?g:h).push(i)}this._projectionLines=u,this._cutProjectionLines.setGeometryFromSegments(m),this._occludedCutProjectionLines.setGeometryFromSegments(d),this._fillProjectionLines.setGeometryFromSegments(h),this._occludedFillProjectionLines.setGeometryFromSegments(g)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let r=!1,l=!1;for(const n of this._projectionLines){n.updateOccluded(e)&&(r||=n.isCut,l||=!n.isCut);const a=n.isOccluded;(n.isCut?a?i:t:a?o:s).push(n.segment)}l&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),r&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,i){const{geometryOutlineColor:s,cutProjectionLineColor:o,fillProjectionLineColor:r}=this._config;if(e){const e=t.toUnitRGBA(i);this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._cutFillRenderNode.borderColor=i}else{this._targetGeometry.color=t.toUnitRGBA(s);const e=t.toUnitRGBA(o);this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const i=t.toUnitRGBA(r);this._fillProjectionLines.color=i,this._occludedFillProjectionLines.color=i,this._cutFillRenderNode.borderColor=s}}_updateLabels(e){const{labelDistance:t}=this._config,{effectiveDisplayUnits:i,labelAnchors:s,messages:o,unitsMessages:r,result:l,visible:n}=e;if(this._cutVolumeLabel.visible=n,this._fillVolumeLabel.visible=n,this._cutVolumeLabel.geometry=s.cut?{type:"point",point:s.cut,callout:{distance:t,offset:0}}:null,this._fillVolumeLabel.geometry=s.fill?{type:"point",point:s.fill,callout:{distance:-t,offset:0}}:null,null==l||null==o||null==r)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const a=i.volume,c=N(o.labels.cut,{volume:I(r,l.cutVolume,a)}),u=N(o.labels.fill,{volume:I(r,l.fillVolume,a)});this._cutVolumeLabel.text=c,this._fillVolumeLabel.text=u}_updateCutFillVisibility(){this.visible?this._cutFillRenderNode.enable():this._cutFillRenderNode.disable()}_updateCutFillGeometry(){const{renderCoordsHelper:e}=this.view,{targetGeometry:t}=this.analysisViewData;if(!t?.extent)return;const{center:i}=t.extent,s=j(i.x,i.y,0),o=v();e.toRenderCoords(s,t.spatialReference,o);const r=this._getExtrudedVolumes(t,this._extrusionHeight,s),l=this._getExtrudedVolumes(t,-this._extrusionHeight,s);this._cutFillRenderNode.updateGeometries(r,l,o)}_getExtrudedVolumes(e,t,i){const{renderCoordsHelper:s,spatialReference:o,elevationProvider:r}=this.view,l=v(),n=1===s.viewingMode;n||s.worldUpAtPosition([0,0,0],l);const a=D(e,r,s,this._elevationContext),{polygons:c,mapPositions:u,position:m}=a,p=c[0],g=p.count,y=d(p.mapPositions,p.holeIndices,3),_=y.length,f=6*g,j=C(f+_),w=C(_),P=L(3*f),V=L(3*f);S(m,u,y,p,P,null,V,null,j,w,t,l,n);const F=h(),R=h();return b(o,i,F,s.spatialReference),R[12]=-F[12],R[13]=-F[13],R[14]=-F[14],G(P,P,R),new U(P,w,j,V)}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await H("esri/core/t9n/Units"),this.messages=await H("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function I(e,t,i){return e&&t&&l(e,t,c(t.value,t.unit,i))}e([u({constructOnly:!0})],T.prototype,"view",void 0),e([u({constructOnly:!0})],T.prototype,"analysis",void 0),e([u({constructOnly:!0})],T.prototype,"analysisViewData",void 0),e([u()],T.prototype,"unitsMessages",void 0),e([u()],T.prototype,"messages",void 0),e([u()],T.prototype,"loadingMessages",void 0),e([u({readOnly:!0})],T.prototype,"visible",null),e([u()],T.prototype,"updating",null),T=e([m("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],T);class k{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=v(),this._n2=v();const r=g(z,y(z,e.endRenderSpace,e.startRenderSpace));g(this._n1,_(this._n1,r,g(W,y(W,t.startRenderSpace,e.startRenderSpace)))),g(this._n2,_(this._n2,r,g(W,y(W,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=o.normalize(w(this._n1,this._n2,r))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){y(z,this.segment.startRenderSpace,e.eye);const t=f(this._n1,z)<0,i=f(this._n2,z)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const z=v(),W=v();export{T as VolumeMeasurementCutFillVisualization};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Graphic.js";import s from"../../../../core/Accessor.js";import{isSome as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{makeHandle as a}from"../../../../core/handleUtils.js";import{ignoreAbortErrors as o,isAborted as r,createResolver as h,createAbortError as n,onAbort as c}from"../../../../core/promiseUtils.js";import{watch as p,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import u from"../../../../layers/GraphicsLayer.js";import _ from"../../../../symbols/SimpleFillSymbol.js";import{isPolygon as g,isPolygonGraphic as k}from"./volumeMeasurementGeometryUtils.js";import{VolumeMeasurementShiftTool as G}from"./VolumeMeasurementShiftTool.js";import{makeAllLayerSnappingOptions as w}from"../../../interactive/snapping/allLayerSnapping.js";import v from"../../../../widgets/Sketch/SketchViewModel.js";const b=Symbol("interactive-operation");let f=class extends s{constructor(e){super(e),this._updatingHandles=new y,this._onUndoRedo=()=>{this._updateGeometryFromSketchGraphic()}}initialize(){const{analysis:e,analysisViewData:t,view:s}=this;this._graphicsLayer=new u({listMode:"hide",internal:!0,elevationInfo:{mode:"on-the-ground"}});const i=w(s,{selfEnabled:!0,excludeInternal:!0});this._sketchViewModel=new v({layer:this._graphicsLayer,view:s,updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"none"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polygonSymbol:this._polygonSymbol,snappingOptions:i.options}),this.addHandles([this._sketchViewModel.on(["undo","redo"],this._onUndoRedo),p(()=>({map:s.map,internalGraphicsLayer:this._graphicsLayer,state:this.state}),({map:e,internalGraphicsLayer:t,state:s})=>{switch(S(e,t),s){case"idle":case"sketching":break;case"awaiting-sketch":this.analysisViewData.interactive=!0;break;case"reshaping":this._startReshape();break;case"reshaping-disabled":this._stopOperation(),this._ensureUpdatedSketchGraphic()}},l),i]),this._shiftTool=new G({analysis:e,view:s,analysisViewData:t}),this.addHandles(this._shiftTool.on("record-undo",e=>{const t=this._sketchViewModel.activeComponent;"reshape-3d"===t?.type&&t.recordUndo(e.apply,e.undo)})),s.tools.add(this._shiftTool),this.addHandles({remove:()=>s.tools.remove(this._shiftTool)})}destroy(){this._sketchViewModel.destroy();const e=this._graphicsLayer;this.view.map.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),this._updateGeometryFromSketchGraphic())}get state(){const{geometry:e}=this.analysis,{interactive:t,visible:s}=this.analysisViewData;return s?this._sketchViewModel.createGraphic?this._sketchViewModel.createGraphic===this.sketchGraphic?"sketching":"awaiting-sketch":e?t?"reshaping":"reshaping-disabled":"idle":"idle"}get updating(){return this._sketchViewModel.updating||this._updatingHandles.updating}get _polygonSymbol(){return new _({color:[0,0,0,0],outline:{color:[0,0,0,0]}})}place(e){return this._startPlaceOperation(e,(t,s)=>{const i=this.analysis.clone(),h=this._sketchViewModel.on("create",e=>{switch(e.state){case"complete":this._updateGeometryFromSketchGraphic(),this._stopOperation();break;case"cancel":this._stopOperation();break;case"active":this._updateGeometryFromSketchGraphic();break;case"start":this.sketchGraphic=e.graphic}});return this._ensureUpdatedSketchGraphic(),this._updatingHandles.addPromise(o(this._sketchViewModel.create("polygon"))),a(()=>(h.remove(),this._sketchViewModel.cancel(),this._updateGeometryFromSketchGraphic(),this.analysis.valid?r(e)||i.equals(this.analysis)?s():void t():(this._clearGeometry(),s())))})}async _startPlaceOperation(e,t){const s=h(),i=t(()=>s.resolve({}),()=>s.reject(n()));return c(e,()=>this._stopOperation()),this._replaceHandles([i,c(e,()=>this._stopOperation())],b),await s.promise}_startReshape(){this._stopOperation();const e=this._sketchViewModel.on("update",e=>{this._updateGeometryFromSketchGraphic(),"complete"===e.state&&("reshaping"===this.state?this._startReshape():this._stopOperation())});this._replaceHandles(a(()=>{e.remove(),this._sketchViewModel.cancel()}),b);const t=this._ensureUpdatedSketchGraphic();t&&this._updatingHandles.addPromise(o(this._sketchViewModel.update(t,{tool:"reshape"})))}_stopOperation(){this.removeHandles(b)}_ensureUpdatedSketchGraphic(){const{geometry:e}=this.analysis;return g(e)?(this.sketchGraphic??=new t({geometry:e,symbol:this._polygonSymbol}),this.sketchGraphic.geometry=e,this._graphicsLayer.add(this.sketchGraphic),this.sketchGraphic):(this.sketchGraphic=null,null)}_clearGeometry(){this.sketchGraphic=null,this.analysis.geometry=null}_updateGeometryFromSketchGraphic(){const e=this.sketchGraphic;this.analysis.geometry=k(e)?e.geometry:null}_replaceHandles(e,t){this.removeHandles(t),this.addHandles((Array.isArray(e)?e:[e]).filter(i),t)}get test(){}};function S(e,t){t&&(t.removeFromParent(),e?.add(t))}e([d({constructOnly:!0})],f.prototype,"analysisViewData",void 0),e([d({constructOnly:!0})],f.prototype,"view",void 0),e([d({constructOnly:!0})],f.prototype,"analysis",void 0),e([d()],f.prototype,"sketchGraphic",null),e([d({nonNullable:!0})],f.prototype,"state",null),e([d()],f.prototype,"updating",null),e([d()],f.prototype,"_polygonSymbol",null),f=e([m("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementTool")],f);export{f as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../../Graphic.js";import s from"../../../../core/Accessor.js";import"../../../../core/has.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import{ignoreAbortErrors as a,isAborted as o}from"../../../../core/promiseUtils.js";import{watch as r,syncAndInitial as h}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../layers/GraphicsLayer.js";import d from"../../../../symbols/SimpleFillSymbol.js";import{isPolygon as m,isPolygonGraphic as y}from"./volumeMeasurementGeometryUtils.js";import{VolumeMeasurementShiftTool as u}from"./VolumeMeasurementShiftTool.js";import{ExclusiveOperationManager as g}from"../../../analysis/ExclusiveOperationManager.js";import{makeAllLayerSnappingOptions as _}from"../../../interactive/snapping/allLayerSnapping.js";import k from"../../../../widgets/Sketch/SketchViewModel.js";let G=class extends s{constructor(e){super(e),this._updatingHandles=new l,this._operationManager=new g,this._onUndoRedo=()=>{this._updateGeometryFromSketchGraphic()}}initialize(){const{analysis:e,analysisViewData:t,view:s}=this;this._graphicsLayer=new p({listMode:"hide",internal:!0,elevationInfo:{mode:"on-the-ground"}});const i=_(s,{selfEnabled:!0,excludeInternal:!0});this._sketchViewModel=new k({layer:this._graphicsLayer,view:s,updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"none"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polygonSymbol:this._polygonSymbol,snappingOptions:i.options}),this.addHandles([this._sketchViewModel.on(["undo","redo"],this._onUndoRedo),r(()=>({map:s.map,internalGraphicsLayer:this._graphicsLayer,state:this.state}),({map:e,internalGraphicsLayer:t,state:s})=>{switch(w(e,t),s){case"idle":case"reshaping-disabled":this._operationManager.stop(),this._ensureUpdatedSketchGraphic();break;case"reshaping":a(this._startReshape());break;case"awaiting-sketch":this.analysisViewData.interactive=!0}},h),i]),this._shiftTool=new u({analysis:e,view:s,analysisViewData:t}),this.addHandles(this._shiftTool.on("record-undo",e=>{const t=this._sketchViewModel.activeComponent;"reshape-3d"===t?.type&&t.recordUndo(e.apply,e.undo)})),s.tools.add(this._shiftTool),this.addHandles({remove:()=>s.tools.remove(this._shiftTool)})}destroy(){this._operationManager.destroy(),this._sketchViewModel.destroy();const e=this._graphicsLayer;this.view.map.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),this._updateGeometryFromSketchGraphic())}get state(){const{geometry:e}=this.analysis,{interactive:t,visible:s}=this.analysisViewData;return s?this._sketchViewModel.createGraphic?this._sketchViewModel.createGraphic===this.sketchGraphic?"sketching":"awaiting-sketch":e?t?"reshaping":"reshaping-disabled":"idle":"idle"}get updating(){return this._sketchViewModel.updating||this._updatingHandles.updating}get _polygonSymbol(){return new d({color:[0,0,0,0],outline:{color:[0,0,0,0]}})}place(e){return this._operationManager.start(async t=>{const s=this.analysis.clone();this._ensureUpdatedSketchGraphic();const a=this._sketchViewModel.on("create",e=>{switch(e.state){case"start":this.sketchGraphic=e.graphic;break;case"active":this._updateGeometryFromSketchGraphic();break;case"complete":this._updateGeometryFromSketchGraphic(),t.stop();break;case"cancel":t.stop()}});t.handles.push(a,i(()=>(a.remove(),this._sketchViewModel.cancel(),this._updateGeometryFromSketchGraphic(),this.analysis.valid?o(e)||s.equals(this.analysis)?t.reject():void t.resolve():(this._clearGeometry(),t.reject())))),await this._updatingHandles.addPromise(this._sketchViewModel.create("polygon"))},e)}_startReshape(){return this._operationManager.start(async e=>{const t=()=>{const e=this._ensureUpdatedSketchGraphic();return e?(this._graphicsLayer.add(e),this._updatingHandles.addPromise(this._sketchViewModel.update(e,{tool:"reshape"}))):Promise.resolve()};if(!this._ensureUpdatedSketchGraphic())return;const s=this._sketchViewModel.on("update",s=>{this._updateGeometryFromSketchGraphic(),"complete"===s.state&&("reshaping"===this.state?a(t()):e.resolve())});e.handles.push(s,i(()=>{s.remove(),this._sketchViewModel.cancel(),e.resolve()})),await t()})}_ensureUpdatedSketchGraphic(){const{geometry:e}=this.analysis;return m(e)?(this.sketchGraphic??=new t({geometry:e,symbol:this._polygonSymbol}),this.sketchGraphic.geometry=e,this.sketchGraphic):(this.sketchGraphic=null,null)}_clearGeometry(){this.sketchGraphic=null,this.analysis.geometry=null}_updateGeometryFromSketchGraphic(){const e=this.sketchGraphic;this.analysis.geometry=y(e)?e.geometry:null}get test(){}};function w(e,t){t&&(t.removeFromParent(),e?.add(t))}e([n({constructOnly:!0})],G.prototype,"analysisViewData",void 0),e([n({constructOnly:!0})],G.prototype,"view",void 0),e([n({constructOnly:!0})],G.prototype,"analysis",void 0),e([n()],G.prototype,"sketchGraphic",null),e([n({nonNullable:!0})],G.prototype,"state",null),e([n()],G.prototype,"updating",null),e([n()],G.prototype,"_polygonSymbol",null),G=e([c("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementTool")],G);export{G as default};