@arcgis/core 4.34.0-next.74 → 4.34.0-next.76

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 (248) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/applications/Components/QuantityFormatter.js +1 -1
  3. package/applications/Components/arcadeEditorUtils.d.ts +4 -0
  4. package/applications/Components/arcadeEditorUtils.js +5 -0
  5. package/applications/Components/featureUtils.d.ts +1 -0
  6. package/applications/Components/featureUtils.js +1 -1
  7. package/arcade/Feature.js +1 -1
  8. package/arcade/Pixel.js +5 -0
  9. package/arcade/Voxel.js +1 -1
  10. package/arcade/arcadeAsyncRuntime.js +1 -1
  11. package/arcade/arcadeCompiler.js +1 -1
  12. package/arcade/arcadeRuntime.js +1 -1
  13. package/arcade/featureSetUtils.js +1 -1
  14. package/arcade/featureset/actions/GroupBy.js +1 -1
  15. package/arcade/featureset/actions/OrderBy.js +1 -1
  16. package/arcade/featureset/support/FeatureSetIterator.js +1 -1
  17. package/arcade/functions/feature.js +1 -1
  18. package/arcade/functions/featuresetbase.js +1 -1
  19. package/arcade/functions/featuresetstring.js +1 -1
  20. package/arcade/functions/fieldStats.js +1 -1
  21. package/arcade/functions/geometry.js +1 -1
  22. package/arcade/functions/maths.js +1 -1
  23. package/arcade/functions/string.js +1 -1
  24. package/arcade/languageUtils.js +1 -1
  25. package/arcade.js +1 -1
  26. package/assets/esri/core/workers/RemoteClient.js +1 -1
  27. package/assets/esri/core/workers/chunks/009556f323e58271bc7a.js +1 -0
  28. package/assets/esri/core/workers/chunks/{11acefc48c0354e675df.js → 0309d008e50e55c7ff1d.js} +1 -1
  29. package/assets/esri/core/workers/chunks/13de06e614adf92239fe.js +1 -0
  30. package/assets/esri/core/workers/chunks/14a22d1a0eefa970efa1.js +1 -0
  31. package/assets/esri/core/workers/chunks/16d66770ef841564ee3f.js +1 -0
  32. package/assets/esri/core/workers/chunks/17103e6542aae53c7301.js +1 -0
  33. package/assets/esri/core/workers/chunks/{dd447dfc50ee7f511b84.js → 19c1f1431c0b2f4525a2.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{5c30252c1bb8350cae5f.js → 1c52999a6392370844a6.js} +1 -1
  35. package/assets/esri/core/workers/chunks/21bfad7283620766d9cd.js +1 -0
  36. package/assets/esri/core/workers/chunks/{7219ceab0b6fae2e69b6.js → 280af3640f8e93c1024e.js} +2 -2
  37. package/assets/esri/core/workers/chunks/{49f7a5523462aebf90fc.js.LICENSE.txt → 280af3640f8e93c1024e.js.LICENSE.txt} +1 -1
  38. package/assets/esri/core/workers/chunks/3064320d54a9b48bd697.js +1 -0
  39. package/assets/esri/core/workers/chunks/3a5f0c759dd2f4638343.js +1 -0
  40. package/assets/esri/core/workers/chunks/{d12f373fcf5848ddcd8a.js → 3f523bc8551e712c9bd4.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{5b7e5ec6aea1f7f9b005.js → 3fecfe4f8ca2a5fd7360.js} +1 -1
  42. package/assets/esri/core/workers/chunks/4832faefd3b7edc17c84.js +1 -0
  43. package/assets/esri/core/workers/chunks/{78b33c6d73824085c6d1.js → 48449abe795cb7a831eb.js} +1 -1
  44. package/assets/esri/core/workers/chunks/4d47187bc0821413492d.js +1 -0
  45. package/assets/esri/core/workers/chunks/5102c20645d9708c34b4.js +1 -0
  46. package/assets/esri/core/workers/chunks/541bffd61006d0e36166.js +1 -0
  47. package/assets/esri/core/workers/chunks/58cc06ed86301f4cee75.js +1 -0
  48. package/assets/esri/core/workers/chunks/{e12e8d69c05c182b6a69.js → 61bb39597ccf89f99a72.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{f4e9640306f64b1af7a3.js → 65ec21d29e8563fdbc55.js} +1 -1
  50. package/assets/esri/core/workers/chunks/67d9cfe02613cb73ee37.js.LICENSE.txt +1 -1
  51. package/assets/esri/core/workers/chunks/{6dc62c170e9583222df2.js → 70367da4ba916376f40c.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{fb669a2e50ca7aacac25.js → 71fef0a33b7ed9456e47.js} +1 -1
  53. package/assets/esri/core/workers/chunks/7430c462c350fdd26349.js +1 -0
  54. package/assets/esri/core/workers/chunks/{ff3fe5c97a98c8cab4ac.js → 7a23b127f551bf13ef54.js} +2 -2
  55. package/assets/esri/core/workers/chunks/{ff3fe5c97a98c8cab4ac.js.LICENSE.txt → 7a23b127f551bf13ef54.js.LICENSE.txt} +1 -1
  56. package/assets/esri/core/workers/chunks/7b73a808922b52755abd.js +1 -0
  57. package/assets/esri/core/workers/chunks/{d682dd49bb9ee7f48f93.js → 9304c3cdf732745577fd.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{8d642b34d40edfe02d8e.js → 9c64b78c5c9b35b31d98.js} +2 -2
  59. package/assets/esri/core/workers/chunks/{8d642b34d40edfe02d8e.js.LICENSE.txt → 9c64b78c5c9b35b31d98.js.LICENSE.txt} +1 -1
  60. package/assets/esri/core/workers/chunks/a0edff37fd4a3f2cb2eb.js +1 -0
  61. package/assets/esri/core/workers/chunks/a6533bab3b2fbc1e2a47.js +1 -0
  62. package/assets/esri/core/workers/chunks/a9f6054d86982b9e5a7c.js +1 -0
  63. package/assets/esri/core/workers/chunks/{10ec10ca361842efce92.js → ab005fe84952f0676020.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{5c53deb45bc142219c76.js → b15ff6c9ef2de8a49853.js} +2 -2
  65. package/assets/esri/core/workers/chunks/{5a476e6743902e35f81a.js.LICENSE.txt → b15ff6c9ef2de8a49853.js.LICENSE.txt} +1 -1
  66. package/assets/esri/core/workers/chunks/b70d71144a060f7eeeeb.js +1 -0
  67. package/assets/esri/core/workers/chunks/b8d02f1b73c374767a5f.js +1 -0
  68. package/assets/esri/core/workers/chunks/ba6452acee3d6defb37e.js +1 -0
  69. package/assets/esri/core/workers/chunks/bccecd678faff927ac76.js +1 -0
  70. package/assets/esri/core/workers/chunks/{ce1f4508487298ab57b6.js → bd2dc1282c49125ede89.js} +1 -1
  71. package/assets/esri/core/workers/chunks/bfbbf180c2c8fdbb6731.js +1 -0
  72. package/assets/esri/core/workers/chunks/{f542bdc994a5ea3aa9d1.js → c38360d912f256519e06.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{e3ad0a390387c5847aca.js → c6fecf2bbd2a711f15d3.js} +1 -1
  74. package/assets/esri/core/workers/chunks/c86f5bb199cf046b8952.js +1 -0
  75. package/assets/esri/core/workers/chunks/cd1869e183001266c4c1.js +2 -0
  76. package/assets/esri/core/workers/chunks/{626c18c1bbc50b3b16b2.js.LICENSE.txt → cd1869e183001266c4c1.js.LICENSE.txt} +1 -1
  77. package/assets/esri/core/workers/chunks/{90321feb56f3a84f6e58.js → d153b29c542c37ae1636.js} +2 -2
  78. package/assets/esri/core/workers/chunks/{90321feb56f3a84f6e58.js.LICENSE.txt → d153b29c542c37ae1636.js.LICENSE.txt} +1 -1
  79. package/assets/esri/core/workers/chunks/{b5f197e24982f6e14468.js → d1f181f91b36351f1d3b.js} +2 -2
  80. package/assets/esri/core/workers/chunks/d55c55d39a253630d228.js +1 -0
  81. package/assets/esri/core/workers/chunks/{49f7a5523462aebf90fc.js → d66cdb9bb494da19696b.js} +2 -2
  82. package/assets/esri/core/workers/chunks/{5c53deb45bc142219c76.js.LICENSE.txt → d66cdb9bb494da19696b.js.LICENSE.txt} +1 -1
  83. package/assets/esri/core/workers/chunks/{9c00c2263e52ad51c2a2.js → d95554f43694b4769675.js} +1 -1
  84. package/assets/esri/core/workers/chunks/dd587d51dad2d82708d1.js +1 -0
  85. package/assets/esri/core/workers/chunks/ecac5ca00c742bfb5898.js +1 -0
  86. package/assets/esri/core/workers/chunks/ed773dab5965e42a2879.js +2 -0
  87. package/assets/esri/core/workers/chunks/{7219ceab0b6fae2e69b6.js.LICENSE.txt → ed773dab5965e42a2879.js.LICENSE.txt} +1 -1
  88. package/assets/esri/core/workers/chunks/{0d946a226b846b3c0849.js → fc06014fb484fc8c697e.js} +1 -1
  89. package/assets/esri/images/portal/xrexperience16.png +0 -0
  90. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  91. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  92. package/chunks/Compositing.glsl.js +4 -3
  93. package/chunks/Fog.glsl.js +6 -6
  94. package/chunks/GlowComposition.glsl.js +31 -12
  95. package/chunks/LineMarker.glsl.js +37 -36
  96. package/chunks/RibbonLine.glsl.js +83 -83
  97. package/chunks/array.js +1 -1
  98. package/chunks/cameraUtilsSpherical.js +1 -1
  99. package/chunks/languageUtils.js +1 -1
  100. package/chunks/lyr3DMain.js +1 -1
  101. package/chunks/lyr3DWorker.js +1 -1
  102. package/config.js +1 -1
  103. package/core/quantityFormatUtils.js +1 -1
  104. package/core/sql.d.ts +1 -0
  105. package/core/unitFormatUtils.js +1 -1
  106. package/core/unitUtils.js +1 -1
  107. package/form/FormTemplate.js +1 -1
  108. package/geometry/support/curves/circleUtils.js +1 -1
  109. package/geometry/support/curves/circularArcUtils.js +1 -1
  110. package/geometry/support/curves/closestPointOnCurve.js +1 -1
  111. package/geometry/support/curves/curveExtent.js +1 -1
  112. package/geometry/support/curves/lineUtils.js +5 -0
  113. package/geometry/support/heightModelInfoUtils.js +1 -1
  114. package/geometry/support/normalizeUtils.js +1 -1
  115. package/geometry/support/spatialReferenceUtils.js +1 -1
  116. package/interfaces.d.ts +315 -18
  117. package/kernel.js +1 -1
  118. package/layers/GaussianSplatLayer.js +1 -1
  119. package/layers/ImageryLayer.js +1 -1
  120. package/layers/ImageryTileLayer.js +1 -1
  121. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  122. package/layers/Lyr3DWorkerHandle.js +1 -1
  123. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  124. package/layers/support/fieldUtils.js +1 -1
  125. package/layers/support/tiles3DUtils.js +1 -1
  126. package/networks/CircuitManager.js +1 -1
  127. package/networks/support/Circuit.js +1 -1
  128. package/networks/support/CircuitSection.js +1 -1
  129. package/networks/support/Subcircuit.js +1 -1
  130. package/package.json +2 -2
  131. package/portal/PortalItem.js +1 -1
  132. package/renderers/ClassBreaksRenderer.js +1 -1
  133. package/renderers/DictionaryRenderer.js +1 -1
  134. package/renderers/DotDensityRenderer.js +1 -1
  135. package/renderers/HeatmapRenderer.js +1 -1
  136. package/renderers/PieChartRenderer.js +1 -1
  137. package/renderers/UniqueValueRenderer.js +1 -1
  138. package/renderers/mixins/VisualVariablesMixin.js +1 -1
  139. package/support/arcadeUtils.js +1 -1
  140. package/support/loadArcade.js +1 -1
  141. package/support/modeUtils.js +1 -1
  142. package/support/revision.js +1 -1
  143. package/symbols/CIMSymbol.js +1 -1
  144. package/symbols/support/FeatureExpressionInfo.js +1 -1
  145. package/views/2d/layers/LayerView2D.js +1 -1
  146. package/views/2d/layers/MediaLayerView2D.js +1 -1
  147. package/views/2d/layers/TileLayerView2D.js +1 -1
  148. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  149. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  150. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  151. package/views/3d/analysis/Slice/ResizeManipulator.js +1 -1
  152. package/views/3d/analysis/Slice/RotateManipulator.js +1 -1
  153. package/views/3d/analysis/Slice/ShiftManipulator.js +1 -1
  154. package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
  155. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  156. package/views/3d/environment/Fog.js +1 -1
  157. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  158. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  159. package/views/3d/interactive/visualElements/MarkerVisualElement.js +1 -1
  160. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  161. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  162. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  163. package/views/3d/layers/FlowSubView3D.js +1 -1
  164. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  165. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  166. package/views/3d/layers/Lyr3DWorker.js +1 -1
  167. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  168. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  169. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  170. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  171. package/views/3d/state/SurfaceCollisionConstraint.js +1 -1
  172. package/views/3d/state/ViewStateManager.js +1 -1
  173. package/views/3d/state/controllers/SurfaceCollisionCorrectionController.js +1 -1
  174. package/views/3d/support/cameraUtils.js +1 -1
  175. package/views/3d/support/cameraUtilsSpherical.js +1 -1
  176. package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
  177. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  178. package/views/3d/support/flow/FlowWorker.js +1 -1
  179. package/views/3d/support/flow/geometryUtils.js +1 -1
  180. package/views/3d/support/flow/loadUtils.js +1 -1
  181. package/{layers/support/GaussianSplatAtlasPageAllocator.js → views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js} +1 -1
  182. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +5 -0
  183. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +5 -0
  184. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +5 -0
  185. package/views/3d/support/gaussianSplatting/GaussianTile.js +5 -0
  186. package/views/3d/terrain/OverlayManager.js +1 -1
  187. package/views/3d/terrain/TerrainSurface.js +1 -1
  188. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +23 -13
  189. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +37 -25
  190. package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +11 -11
  191. package/views/3d/webgl-engine/core/shaderLibrary/util/NoPerspective.glsl.js +5 -0
  192. package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
  193. package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +1 -1
  194. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  195. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  196. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  197. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  198. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  199. package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
  200. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  201. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  202. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  203. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  204. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  205. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  206. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  207. package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
  208. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  209. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  210. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +10 -11
  211. package/views/GroundView.js +1 -1
  212. package/views/VideoView.js +1 -1
  213. package/views/interactive/snapping/allLayerSnapping.js +1 -1
  214. package/views/layers/ImageryLayerView.js +1 -1
  215. package/views/support/LayerViewManager.js +1 -1
  216. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  217. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  218. package/widgets/support/widget.js +1 -1
  219. package/assets/esri/core/workers/chunks/06bd58c219678315cf5c.js +0 -1
  220. package/assets/esri/core/workers/chunks/0751f539db31bdb5caec.js +0 -1
  221. package/assets/esri/core/workers/chunks/19228ab0fe7944c554e5.js +0 -1
  222. package/assets/esri/core/workers/chunks/2a19a4d7d1c580121065.js +0 -1
  223. package/assets/esri/core/workers/chunks/3d2629357242492afcfa.js +0 -1
  224. package/assets/esri/core/workers/chunks/5a476e6743902e35f81a.js +0 -2
  225. package/assets/esri/core/workers/chunks/5a95688651d7e8b7101d.js +0 -1
  226. package/assets/esri/core/workers/chunks/5c4ba165816809e06340.js +0 -1
  227. package/assets/esri/core/workers/chunks/5f239972cb95afdfa77a.js +0 -1
  228. package/assets/esri/core/workers/chunks/626c18c1bbc50b3b16b2.js +0 -2
  229. package/assets/esri/core/workers/chunks/6963ded8428cc8d51d85.js +0 -1
  230. package/assets/esri/core/workers/chunks/6c3ae96c6ef764fb9552.js +0 -1
  231. package/assets/esri/core/workers/chunks/6da298da2ec09cced0b5.js +0 -1
  232. package/assets/esri/core/workers/chunks/76ec3d2646ba64e3442f.js +0 -1
  233. package/assets/esri/core/workers/chunks/8b1d2bbb2b2eb1830921.js +0 -1
  234. package/assets/esri/core/workers/chunks/925ad2665c2fe0f47cc3.js +0 -1
  235. package/assets/esri/core/workers/chunks/a2f4b6d8da93f106852c.js +0 -1
  236. package/assets/esri/core/workers/chunks/ada8e07ff12bc5d4a1d9.js +0 -1
  237. package/assets/esri/core/workers/chunks/b03dcbc31bccb9fdf9fe.js +0 -1
  238. package/assets/esri/core/workers/chunks/b0de01f8c9b1c3182e0c.js +0 -1
  239. package/assets/esri/core/workers/chunks/c7ba8f2aca0fbd6ceded.js +0 -1
  240. package/assets/esri/core/workers/chunks/c908184d747d33366881.js +0 -1
  241. package/assets/esri/core/workers/chunks/d1711256493d55eca523.js +0 -1
  242. package/assets/esri/core/workers/chunks/d305ca524837c5dc81c8.js +0 -1
  243. package/assets/esri/core/workers/chunks/e6e4e2fb9568319c6207.js +0 -1
  244. package/assets/esri/core/workers/chunks/e6f2ac738df16fb5e13a.js +0 -1
  245. package/assets/esri/core/workers/chunks/e8d25d4ca9b335883f34.js +0 -1
  246. package/assets/esri/core/workers/chunks/ee391a41144855fc625d.js +0 -1
  247. package/assets/esri/core/workers/chunks/f060a52a9b69eb250d63.js +0 -1
  248. package/layers/support/gaussianSplatUtils.js +0 -5
package/kernel.js CHANGED
@@ -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 has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.74",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
5
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.76",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -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"../request.js";import o from"../core/Error.js";import r from"../core/Logger.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import l from"../geometry/Extent.js";import n from"./Layer.js";import{APIKeyMixin as m}from"./mixins/APIKeyMixin.js";import{CustomParametersMixin as y}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as c}from"./mixins/OperationalLayer.js";import{PortalLayer as d}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as u}from"./mixins/ScaleRangeLayer.js";import{url as h,elevationInfo as f}from"./support/commonProperties.js";import{initFullExtent as v}from"./support/tiles3DUtils.js";import{logInvalidElevationInfoWarning as j,elevationModeRequiredMessage as g,featureExpressionUnsupportedMessage as x}from"../support/elevationInfoUtils.js";let S=class extends(c(d(u(i(y(m(n))))))){constructor(e){super(e),this.operationalLayerType="GaussianSplatLayer",this.type="gaussian-splat",this.opacity=1,this.minScale=0,this.maxScale=0,this.url=null,this.rootTilesetJSON=null,this.fullExtent=new l(-180,-90,180,90,this.spatialReference)}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const r=null!=e?e.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{throw new o("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service"})}},e)}catch(i){s(i)}if(this.url){const e=t(this.url,{query:{...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(e=>{this.rootTilesetJSON=e.data,this.fullExtent=v(this.rootTilesetJSON),this.spatialReference=this.fullExtent.spatialReference},e=>{s(e)});await e}}_validateElevationInfo(e){const t="Gaussian Splat layers";j(r.getLogger(this),g(t,"absolute-height",e)),j(r.getLogger(this),x(t,e))}};e([a({type:["GaussianSplatLayer"]})],S.prototype,"operationalLayerType",void 0),e([a({readOnly:!0})],S.prototype,"type",void 0),e([a({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],S.prototype,"opacity",void 0),e([a({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],S.prototype,"minScale",void 0),e([a({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],S.prototype,"maxScale",void 0),e([a(h)],S.prototype,"url",void 0),e([a({type:l})],S.prototype,"fullExtent",void 0),e([a({type:["show","hide"]})],S.prototype,"listMode",void 0),e([a(f)],S.prototype,"elevationInfo",null),S=e([p("esri.layers.GaussianSplatLayer")],S);const w=S;export{w as default};
5
+ import{__decorate as e}from"tslib";import t from"../request.js";import i from"../core/Error.js";import r from"../core/Logger.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as o}from"../core/promiseUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import p from"../geometry/Extent.js";import n from"../geometry/SpatialReference.js";import m from"./Layer.js";import{APIKeyMixin as c}from"./mixins/APIKeyMixin.js";import{CustomParametersMixin as u}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as y}from"./mixins/OperationalLayer.js";import{PortalLayer as h}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as f}from"./mixins/ScaleRangeLayer.js";import{url as d,elevationInfo as x}from"./support/commonProperties.js";import{hasEsriCrs as S,initFullExtent as v}from"./support/tiles3DUtils.js";import{logInvalidElevationInfoWarning as j,elevationModeRequiredMessage as g,featureExpressionUnsupportedMessage as R}from"../support/elevationInfoUtils.js";let w=class extends(y(h(f(s(u(c(m))))))){constructor(e){super(e),this.operationalLayerType="GaussianSplatLayer",this.type="gaussian-splat",this.opacity=1,this.minScale=0,this.maxScale=0,this.url=null,this.rootTilesetJSON=null,this.fullExtent=new p(-180,-90,180,90,this.spatialReference),this.spatialReference=new n({wkid:4326,vcsWkid:115700}),this.esriCrsSpatialReference=null,this.esriCrsFullExtent=null}get supportedSpatialReferences(){return this.initialized&&this.esriCrsSpatialReference?[this.spatialReference,this.esriCrsSpatialReference]:[this.spatialReference]}get fullExtents(){return this.initialized&&this.esriCrsFullExtent?[this.fullExtent,this.esriCrsFullExtent]:[this.fullExtent]}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const r=null!=e?e.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{throw new i("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service"})}},e)}catch(s){o(s)}if(this.url){const e=t(this.url,{query:{...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(e=>{this.rootTilesetJSON=e.data;const t=S(this.rootTilesetJSON);this.fullExtent=v(this.rootTilesetJSON,!1),this.spatialReference=this.fullExtent.spatialReference,t&&(this.esriCrsFullExtent=v(this.rootTilesetJSON,!0),this.esriCrsSpatialReference=this.esriCrsFullExtent.spatialReference)},e=>{o(e)});await e}}_validateElevationInfo(e){const t="Gaussian Splat layers";j(r.getLogger(this),g(t,"absolute-height",e)),j(r.getLogger(this),R(t,e))}};e([a({type:["GaussianSplatLayer"]})],w.prototype,"operationalLayerType",void 0),e([a({readOnly:!0})],w.prototype,"type",void 0),e([a({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],w.prototype,"opacity",void 0),e([a({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],w.prototype,"minScale",void 0),e([a({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],w.prototype,"maxScale",void 0),e([a(d)],w.prototype,"url",void 0),e([a({type:p})],w.prototype,"fullExtent",void 0),e([a({type:n})],w.prototype,"spatialReference",void 0),e([a({readOnly:!0})],w.prototype,"supportedSpatialReferences",null),e([a({type:[p]})],w.prototype,"fullExtents",null),e([a({type:["show","hide"]})],w.prototype,"listMode",void 0),e([a(x)],w.prototype,"elevationInfo",null),w=e([l("esri.layers.GaussianSplatLayer")],w);const E=w;export{E 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 r from"../PopupTemplate.js";import{ClonableMixin as t}from"../core/Clonable.js";import o from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{debounce as a,throwIfAbortError as p}from"../core/promiseUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../core/accessorSupport/decorators/writer.js";import c from"../graphic/ImageryGraphicOrigin.js";import y from"./Layer.js";import{ArcGISImageService as u}from"./mixins/ArcGISImageService.js";import{ArcGISService as d}from"./mixins/ArcGISService.js";import{BlendLayer as f}from"./mixins/BlendLayer.js";import{CustomParametersMixin as h}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as j}from"./mixins/RasterJobHandlerMixin.js";import{RasterPresetRendererMixin as I}from"./mixins/RasterPresetRendererMixin.js";import{RefreshableLayer as L}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as w}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as S}from"./mixins/TemporalLayer.js";import{legendEnabled as b,popupEnabled as P}from"./support/commonProperties.js";import{commonRasterFieldNames as x,rasterDimensionFieldPrefix as O,setDefaultRasterFieldFormats as T}from"./support/rasterFieldUtils.js";import{serviceSupportsSpatialReference as _}from"./support/versionUtils.js";import{logInvalidElevationInfoWarning as C,elevationModeUnsupportedMessage as R,featureExpressionUnsupportedMessage as A}from"../support/elevationInfoUtils.js";import{createPopupTemplate as E}from"../support/popupUtils.js";import G from"../symbols/support/ElevationInfo.js";let M=class extends(f(S(w(g(v(I(u(j(L(h(d(s(t(y)))))))))))))){constructor(...e){super(...e),this.graphicOrigin=new c(this),this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery",this._debouncedSaveOperations=a(async(e,r,t)=>{const{save:o,saveAs:i}=await import("./save/imageryUtils.js");switch(e){case 0:return o(this,r);case 1:return i(this,t,r)}})}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(p).then(()=>this._fetchService(r))),Promise.resolve(this)}set elevationInfo(e){"relative-to-scene"!==e?.mode&&this._set("elevationInfo",e),this._validateElevationInfo(e)}get legendEnabled(){return!this._isPreviewLayer&&(this._get("legendEnabled")??!0)}set legendEnabled(e){this._set("legendEnabled",e)}get listMode(){return this._isPreviewLayer?"hide":this._get("listMode")}set listMode(e){this._set("listMode",e)}writeOperationalLayerType(e,r,t){const o="vector-field"===this.renderer?.type;r[t]=o?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}get _isPreviewLayer(){return!(!this.raster||!this.url?.toLowerCase().includes("/rasterrendering/imageserver"))}createPopupTemplate(e){const{rasterFields:r}=this,t=new Set,o=x.itemPixelValue.toLowerCase(),i="raster-dataset"===this.sourceType,s=O.toLowerCase(),a=`${x.servicePixelValue.toLowerCase()}.`;for(const l of r){const e=l.name.toLowerCase();e===o||e.startsWith(a)||i&&e.startsWith(s)||t.add(l.name)}const p=E({fields:r,title:this.title},{...e,visibleFieldNames:t}),{rasterInfo:n}=this;return p?.fieldInfos&&n&&T(p.fieldInfos,n),p}queryFeatures(e,r){return this.queryRasters(e,r).then(e=>{if(e?.features)for(const r of e.features)r.layer=r.sourceLayer=this,r.origin=this.graphicOrigin;return e})}queryFeatureCount(e,r){return this.queryRasterCount(e,r)}redraw(){this.emit("redraw")}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}serviceSupportsSpatialReference(e){return _(this,e)}write(e,r){if(!this._isPreviewLayer)return super.write(e,r);if(r?.messages){const e=`${r.origin}/${r.layerContainerType||"operational-layers"}`;r.messages.push(new o("layer:unsupported",`Imagery preview layer (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}_validateElevationInfo(e){C(i.getLogger(this),R("Imagery layers","relative-to-scene",e)),C(i.getLogger(this),A("Imagery layers",e))}};e([n({type:G,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],M.prototype,"elevationInfo",null),e([n({readOnly:!0,clonable:!1})],M.prototype,"graphicOrigin",void 0),e([n(b)],M.prototype,"legendEnabled",null),e([n({type:["show","hide"]})],M.prototype,"listMode",null),e([n({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],M.prototype,"isReference",void 0),e([n({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],M.prototype,"operationalLayerType",void 0),e([m("web-map","operationalLayerType")],M.prototype,"writeOperationalLayerType",null),e([n(P)],M.prototype,"popupEnabled",void 0),e([n({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],M.prototype,"popupTemplate",void 0),e([n({readOnly:!0})],M.prototype,"defaultPopupTemplate",null),e([n({readOnly:!0,json:{read:!1}})],M.prototype,"type",void 0),e([n({readOnly:!0})],M.prototype,"_isPreviewLayer",null),M=e([l("esri.layers.ImageryLayer")],M);const $=M;export{$ as default};
5
+ import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import{ClonableMixin as t}from"../core/Clonable.js";import o from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{debounce as a,throwIfAbortError as p}from"../core/promiseUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../core/accessorSupport/decorators/writer.js";import c from"../graphic/ImageryGraphicOrigin.js";import y from"./Layer.js";import{ArcGISImageService as u}from"./mixins/ArcGISImageService.js";import{ArcGISService as d}from"./mixins/ArcGISService.js";import{BlendLayer as f}from"./mixins/BlendLayer.js";import{CustomParametersMixin as h}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as j}from"./mixins/RasterJobHandlerMixin.js";import{RasterPresetRendererMixin as w}from"./mixins/RasterPresetRendererMixin.js";import{RefreshableLayer as I}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as L}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as S}from"./mixins/TemporalLayer.js";import{legendEnabled as b,popupEnabled as P,screenSizePerspectiveEnabled as x}from"./support/commonProperties.js";import{commonRasterFieldNames as O,rasterDimensionFieldPrefix as T,setDefaultRasterFieldFormats as _}from"./support/rasterFieldUtils.js";import{serviceSupportsSpatialReference as C}from"./support/versionUtils.js";import{logInvalidElevationInfoWarning as E,elevationModeUnsupportedMessage as R,featureExpressionUnsupportedMessage as A}from"../support/elevationInfoUtils.js";import{createPopupTemplate as G}from"../support/popupUtils.js";import M from"../symbols/support/ElevationInfo.js";let $=class extends(f(S(L(g(v(w(u(j(I(h(d(s(t(y)))))))))))))){constructor(...e){super(...e),this.graphicOrigin=new c(this),this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.type="imagery",this._debouncedSaveOperations=a(async(e,r,t)=>{const{save:o,saveAs:i}=await import("./save/imageryUtils.js");switch(e){case 0:return o(this,r);case 1:return i(this,t,r)}})}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(p).then(()=>this._fetchService(r))),Promise.resolve(this)}set elevationInfo(e){"relative-to-scene"!==e?.mode&&this._set("elevationInfo",e),this._validateElevationInfo(e)}get legendEnabled(){return!this._isPreviewLayer&&(this._get("legendEnabled")??!0)}set legendEnabled(e){this._set("legendEnabled",e)}get listMode(){return this._isPreviewLayer?"hide":this._get("listMode")}set listMode(e){this._set("listMode",e)}writeOperationalLayerType(e,r,t){const o="vector-field"===this.renderer?.type;r[t]=o?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}get _isPreviewLayer(){return!(!this.raster||!this.url?.toLowerCase().includes("/rasterrendering/imageserver"))}createPopupTemplate(e){const{rasterFields:r}=this,t=new Set,o=O.itemPixelValue.toLowerCase(),i="raster-dataset"===this.sourceType,s=T.toLowerCase(),a=`${O.servicePixelValue.toLowerCase()}.`;for(const l of r){const e=l.name.toLowerCase();e===o||e.startsWith(a)||i&&e.startsWith(s)||t.add(l.name)}const p=G({fields:r,title:this.title},{...e,visibleFieldNames:t}),{rasterInfo:n}=this;return p?.fieldInfos&&n&&_(p.fieldInfos,n),p}queryFeatures(e,r){return this.queryRasters(e,r).then(e=>{if(e?.features)for(const r of e.features)r.layer=r.sourceLayer=this,r.origin=this.graphicOrigin;return e})}queryFeatureCount(e,r){return this.queryRasterCount(e,r)}redraw(){this.emit("redraw")}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}serviceSupportsSpatialReference(e){return C(this,e)}write(e,r){if(!this._isPreviewLayer)return super.write(e,r);if(r?.messages){const e=`${r.origin}/${r.layerContainerType||"operational-layers"}`;r.messages.push(new o("layer:unsupported",`Imagery preview layer (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}_validateElevationInfo(e){E(i.getLogger(this),R("Imagery layers","relative-to-scene",e)),E(i.getLogger(this),A("Imagery layers",e))}};e([n({type:M,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],$.prototype,"elevationInfo",null),e([n({readOnly:!0,clonable:!1})],$.prototype,"graphicOrigin",void 0),e([n(b)],$.prototype,"legendEnabled",null),e([n({type:["show","hide"]})],$.prototype,"listMode",null),e([n({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],$.prototype,"isReference",void 0),e([n({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],$.prototype,"operationalLayerType",void 0),e([m("web-map","operationalLayerType")],$.prototype,"writeOperationalLayerType",null),e([n(P)],$.prototype,"popupEnabled",void 0),e([n({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],$.prototype,"popupTemplate",void 0),e([n({readOnly:!0})],$.prototype,"defaultPopupTemplate",null),e([n({json:{read:!1,write:!1}}),n(x)],$.prototype,"screenSizePerspectiveEnabled",void 0),e([n({readOnly:!0,json:{read:!1}})],$.prototype,"type",void 0),e([n({readOnly:!0})],$.prototype,"_isPreviewLayer",null),$=e([l("esri.layers.ImageryLayer")],$);const F=$;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{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import{ClonableMixin as r}from"../core/Clonable.js";import s from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{debounce as a,throwIfAbortError as n}from"../core/promiseUtils.js";import{watch as p}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{ensureClass as m}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import u from"../graphic/ImageryTileGraphicOrigin.js";import h from"./Layer.js";import{ArcGISService as d}from"./mixins/ArcGISService.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as f}from"./mixins/CustomParametersMixin.js";import{ImageryTileMixin as g}from"./mixins/ImageryTileMixin.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as R}from"./mixins/RasterJobHandlerMixin.js";import{RasterPresetRendererMixin as j}from"./mixins/RasterPresetRendererMixin.js";import{RefreshableLayer as F}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as _}from"./mixins/TemporalLayer.js";import{legendEnabled as I}from"./support/commonProperties.js";import O from"./support/Field.js";import{getServicePixelValueField as b,getRawServicePixelValueField as P,getRasterAttributeTableFields as x,getMagnitudeField as T,getDirectionField as N,getMultidimensionalFields as L,commonRasterFieldNames as J,setDefaultRasterFieldFormats as C}from"./support/rasterFieldUtils.js";import M from"./support/RasterFunction.js";import{isFunctionRaster as E,getPrimaryRasters as U}from"./support/rasterDatasets/datasetUtils.js";import $ from"./support/rasterDatasets/FunctionRaster.js";import D from"./support/rasterDatasets/RasterFactory.js";import{getPrimaryRasterUrls as B,create as A}from"./support/rasterFunctions/rasterFunctionHelper.js";import{logInvalidElevationInfoWarning as W,elevationModeUnsupportedMessage as z,featureExpressionUnsupportedMessage as G}from"../support/elevationInfoUtils.js";import{createPopupTemplate as k}from"../support/popupUtils.js";import V from"../symbols/support/ElevationInfo.js";let H=class extends(y(S(v(w(j(f(g(R(_(d(F(o(r(h)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.graphicOrigin=new u(this),this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this.source=void 0,this._debouncedSaveOperations=a(async(e,t,r)=>{const{save:s,saveAs:i}=await import("./save/imageryUtils.js");switch(e){case 0:return s(this,t);case 1:return i(this,r,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(n).then(()=>this._openRaster(t))),Promise.resolve(this)}set elevationInfo(e){"relative-to-scene"!==e?.mode&&this._set("elevationInfo",e),this._validateElevationInfo(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[b("Pixel Value"),P("Raw Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,r=t?.attributeTable;if(r){const t=x(r);e.push(...t)}const s=t?.dataType,i=t?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=i){const t=i.variables[0].unit?.trim(),r=T(t),s=N();e.push(r,s)}if(i){const t=L(i);e.push(...t)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){const{rasterFields:t}=this,r=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==J.rawServicePixelValue)),s=k({fields:t,title:this.title},{...e,visibleFieldNames:r}),{rasterInfo:i}=this.raster;return s?.fieldInfos&&i&&C(s.fieldInfos,i),s}async generateRasterInfo(e,t){if(e=m(M,e),await this.load(),!e||"none"===e.functionName?.toLowerCase())return this.serviceRasterInfo;try{const{rasterInfo:r}=await this._openFunctionRaster(e,t);return r}catch(r){if(r instanceof s)throw r;throw new s("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}write(e,t){const r=this._primaryRasters[0]??this.raster;if(this.loaded?"RasterTileServer"===r.datasetFormat&&("Raster"===r.tileType||"Map"===r.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t?.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new s("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t=E(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:t,rasterFunction:r,source:i}=this;if(!t&&!i)throw new s("imagery-tile-layer:open","missing url or source parameter");i?await this._openFromSource(i,e):r?await this._openFromUrlWithRasterFunction(t,r,e):await this._openFromUrl(t,e)}const r=this.raster.rasterInfo;if(!r)throw new s("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?r:this._primaryRasters[0].rasterInfo),this._set("spatialReference",r.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(p(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters=U(e),this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,t,r){const i=[e];t&&B(t.toJSON(),i);const o=await Promise.all(i.map(e=>D.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:r}))),a=o.findIndex(e=>null==e);if(a>-1)throw new s("imagery-tile-layer:open",`cannot open raster: ${i[a]}`);return this._primaryRasters=o,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){const r=await D.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==r)throw new s("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[r],this.raster=r}async _openFromSource(e,t){const r="the tiled imagery data source is not supported",i="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!i)throw new s("imagery-tile-layer:open",r);"MEMORY"===i&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});const o=await D.open({url:"",source:e,datasetFormat:i,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==o)throw new s("imagery-tile-layer:open",r);this._primaryRasters=[o],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=o}async _openFunctionRaster(e,t){const r={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>r[e.url]=e);const s=A(e.functionDefinition?.toJSON()??e.toJSON(),r),i=new $({rasterFunction:s});return await i.open(t),i}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(r){r instanceof s&&i.getLogger(this).error("imagery-tile-layer:open",r.message),i.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(e){W(i.getLogger(this),z("ImageryTile layers","relative-to-scene",e)),W(i.getLogger(this),G("ImageryTile layers",e))}};e([l({clonable:!1})],H.prototype,"_primaryRasters",void 0),e([l({type:V,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],H.prototype,"elevationInfo",null),e([l({readOnly:!0,clonable:!1})],H.prototype,"graphicOrigin",void 0),e([l(I)],H.prototype,"legendEnabled",void 0),e([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],H.prototype,"isReference",void 0),e([l({type:["show","hide"]})],H.prototype,"listMode",void 0),e([l({json:{read:!0,write:!0}})],H.prototype,"blendMode",void 0),e([l({type:M,json:{name:"renderingRule",write:!0}})],H.prototype,"rasterFunction",void 0),e([l()],H.prototype,"sourceJSON",void 0),e([l({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],H.prototype,"version",void 0),e([l({readOnly:!0,json:{read:!1}})],H.prototype,"type",void 0),e([l({type:["ArcGISTiledImageServiceLayer"]})],H.prototype,"operationalLayerType",void 0),e([l({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,r){t[r]=!e}}}})],H.prototype,"popupEnabled",void 0),e([l({type:t,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],H.prototype,"popupTemplate",void 0),e([l({readOnly:!0})],H.prototype,"defaultPopupTemplate",null),e([l({readOnly:!0,type:[O]})],H.prototype,"fields",void 0),e([l({readOnly:!0,type:[O]})],H.prototype,"rasterFields",null),e([l({constructOnly:!0})],H.prototype,"source",void 0),H=e([c("esri.layers.ImageryTileLayer")],H);const Y=H;export{Y as default};
5
+ import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import{ClonableMixin as r}from"../core/Clonable.js";import s from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{debounce as a,throwIfAbortError as n}from"../core/promiseUtils.js";import{watch as p}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{ensureClass as c}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import u from"../graphic/ImageryTileGraphicOrigin.js";import h from"./Layer.js";import{ArcGISService as d}from"./mixins/ArcGISService.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as f}from"./mixins/CustomParametersMixin.js";import{ImageryTileMixin as g}from"./mixins/ImageryTileMixin.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as R}from"./mixins/RasterJobHandlerMixin.js";import{RasterPresetRendererMixin as j}from"./mixins/RasterPresetRendererMixin.js";import{RefreshableLayer as S}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as F}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as _}from"./mixins/TemporalLayer.js";import{legendEnabled as I,screenSizePerspectiveEnabled as O}from"./support/commonProperties.js";import b from"./support/Field.js";import{getServicePixelValueField as P,getRawServicePixelValueField as x,getRasterAttributeTableFields as T,getMagnitudeField as N,getDirectionField as L,getMultidimensionalFields as J,commonRasterFieldNames as C,setDefaultRasterFieldFormats as M}from"./support/rasterFieldUtils.js";import E from"./support/RasterFunction.js";import{isFunctionRaster as U,getPrimaryRasters as $}from"./support/rasterDatasets/datasetUtils.js";import D from"./support/rasterDatasets/FunctionRaster.js";import z from"./support/rasterDatasets/RasterFactory.js";import{getPrimaryRasterUrls as B,create as A}from"./support/rasterFunctions/rasterFunctionHelper.js";import{logInvalidElevationInfoWarning as W,elevationModeUnsupportedMessage as G,featureExpressionUnsupportedMessage as k}from"../support/elevationInfoUtils.js";import{createPopupTemplate as V}from"../support/popupUtils.js";import H from"../symbols/support/ElevationInfo.js";let Y=class extends(y(F(v(w(j(f(g(R(_(d(S(o(r(h)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.graphicOrigin=new u(this),this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.fields=null,this.source=void 0,this._debouncedSaveOperations=a(async(e,t,r)=>{const{save:s,saveAs:i}=await import("./save/imageryUtils.js");switch(e){case 0:return s(this,t);case 1:return i(this,r,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(n).then(()=>this._openRaster(t))),Promise.resolve(this)}set elevationInfo(e){"relative-to-scene"!==e?.mode&&this._set("elevationInfo",e),this._validateElevationInfo(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[P("Pixel Value"),x("Raw Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,r=t?.attributeTable;if(r){const t=T(r);e.push(...t)}const s=t?.dataType,i=t?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=i){const t=i.variables[0].unit?.trim(),r=N(t),s=L();e.push(r,s)}if(i){const t=J(i);e.push(...t)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){const{rasterFields:t}=this,r=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==C.rawServicePixelValue)),s=V({fields:t,title:this.title},{...e,visibleFieldNames:r}),{rasterInfo:i}=this.raster;return s?.fieldInfos&&i&&M(s.fieldInfos,i),s}async generateRasterInfo(e,t){if(e=c(E,e),await this.load(),!e||"none"===e.functionName?.toLowerCase())return this.serviceRasterInfo;try{const{rasterInfo:r}=await this._openFunctionRaster(e,t);return r}catch(r){if(r instanceof s)throw r;throw new s("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}write(e,t){const r=this._primaryRasters[0]??this.raster;if(this.loaded?"RasterTileServer"===r.datasetFormat&&("Raster"===r.tileType||"Map"===r.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t?.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new s("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t=U(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:t,rasterFunction:r,source:i}=this;if(!t&&!i)throw new s("imagery-tile-layer:open","missing url or source parameter");i?await this._openFromSource(i,e):r?await this._openFromUrlWithRasterFunction(t,r,e):await this._openFromUrl(t,e)}const r=this.raster.rasterInfo;if(!r)throw new s("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?r:this._primaryRasters[0].rasterInfo),this._set("spatialReference",r.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(p(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters=$(e),this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,t,r){const i=[e];t&&B(t.toJSON(),i);const o=await Promise.all(i.map(e=>z.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:r}))),a=o.findIndex(e=>null==e);if(a>-1)throw new s("imagery-tile-layer:open",`cannot open raster: ${i[a]}`);return this._primaryRasters=o,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){const r=await z.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==r)throw new s("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[r],this.raster=r}async _openFromSource(e,t){const r="the tiled imagery data source is not supported",i="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!i)throw new s("imagery-tile-layer:open",r);"MEMORY"===i&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});const o=await z.open({url:"",source:e,datasetFormat:i,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==o)throw new s("imagery-tile-layer:open",r);this._primaryRasters=[o],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=o}async _openFunctionRaster(e,t){const r={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>r[e.url]=e);const s=A(e.functionDefinition?.toJSON()??e.toJSON(),r),i=new D({rasterFunction:s});return await i.open(t),i}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(r){r instanceof s&&i.getLogger(this).error("imagery-tile-layer:open",r.message),i.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(e){W(i.getLogger(this),G("ImageryTile layers","relative-to-scene",e)),W(i.getLogger(this),k("ImageryTile layers",e))}};e([l({clonable:!1})],Y.prototype,"_primaryRasters",void 0),e([l({type:H,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],Y.prototype,"elevationInfo",null),e([l({readOnly:!0,clonable:!1})],Y.prototype,"graphicOrigin",void 0),e([l(I)],Y.prototype,"legendEnabled",void 0),e([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Y.prototype,"isReference",void 0),e([l({type:["show","hide"]})],Y.prototype,"listMode",void 0),e([l({json:{read:!0,write:!0}})],Y.prototype,"blendMode",void 0),e([l({type:E,json:{name:"renderingRule",write:!0}})],Y.prototype,"rasterFunction",void 0),e([l()],Y.prototype,"sourceJSON",void 0),e([l({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],Y.prototype,"version",void 0),e([l({readOnly:!0,json:{read:!1}})],Y.prototype,"type",void 0),e([l({type:["ArcGISTiledImageServiceLayer"]})],Y.prototype,"operationalLayerType",void 0),e([l({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,r){t[r]=!e}}}})],Y.prototype,"popupEnabled",void 0),e([l({type:t,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],Y.prototype,"popupTemplate",void 0),e([l({readOnly:!0})],Y.prototype,"defaultPopupTemplate",null),e([l({json:{read:!1,write:!1}}),l(O)],Y.prototype,"screenSizePerspectiveEnabled",void 0),e([l({readOnly:!0,type:[b]})],Y.prototype,"fields",void 0),e([l({readOnly:!0,type:[b]})],Y.prototype,"rasterFields",null),e([l({constructOnly:!0})],Y.prototype,"source",void 0),Y=e([m("esri.layers.ImageryTileLayer")],Y);const q=Y;export{q 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"../request.js";import i from"../core/Accessor.js";import r from"../core/Logger.js";import{isAbortError as s}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{wasmFailedToInit as d,invalidLayerView as h}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as _}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as u}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as y}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as g}from"../views/3d/layers/support/makeScheduleFunction.js";let m=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._debugFlags=new Set,this._debugLevel=0,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,t,i,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=s?`[js] ${i}`:`${i}`;0===t||1===t?r.getLogger(this).error(e):2===t&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}initialize(){this._debugLevel>2&&(r.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([a(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera())]),this._pulseTaskHandle=n({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:d})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(t=>{t.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0,i.needFrame=!0,i.layerView.updatingFlagChanged())}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}setMeshModifications(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const r=this._layers.get(e.wasmLayerId);if(r){const s=this._lyr3DMain._malloc(8*t.length),a=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,t.length);for(let e=0;e<t.length;++e)a[e]=t[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,t.length,i),this._lyr3DMain._free(s),r.needFrame=!0,r.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0||t.needFrame)}initializeWasm(e,t){return this._lyr3DMain?Promise.resolve():(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=u().then(i=>{this._lyr3DMain=i,this._lyr3DMainPromise=null;const r=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),s=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l="global"===this.view.viewingMode,d=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1,h=this.view.heightModelInfo?.heightModel,u=!h||"gravity-related-height"===h;return this._lyr3DMain.initialize_lyr3d_wasm(o,r,s,a,n,e,t,l,u,d,Math.max(this._debugLevel,0))?(this._workerHandle=new _(g(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise)}_pulseTask(){if(this._lyr3DMain){let e=0,t=0;this._layers.forEach(i=>{e+=i.layerView.usedMemory,t+=i.layerView.cachedMemory}),e/=1048576,t/=1048576;const i=this.view.resourceController.memoryController,r=i.usedMemory*i.maxMemory-e;this._lyr3DMain.frame_pulse(i.memoryFactor,e,t,r,i.maxMemory),this._layers.forEach(e=>{!0===e.needFrame&&(e.needFrame=!1,e.layerView.updatingFlagChanged())})}}_incrementJobCount(e){e.outstandingJobCount+=1,1===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_decrementJobCount(e){e.outstandingJobCount-=1,0===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){e.outstandingRenderableCount+=1,e.outstandingJobCount<1&&1===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){e.outstandingRenderableCount-=1,e.outstandingJobCount<1&&0===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_onJobFailed(e,t,i){t.error.length&&this._debugLog(1,1,t.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc),this._decrementJobCount(e)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){const e=t.data.byteLength,r=this._lyr3DMain._malloc(e);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,r,e).set(t.data),this._lyr3DMain.on_job_completed(i.jobId,t.jobDescJson,r,e),this._lyr3DMain._free(r)}this._decrementJobCount(e)}_getRequestPromises(e,i,r,s){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===s.type){if(e.origin===r.origin&&e.pathname===r.pathname){if(s.rootTileset){a.push(Promise.resolve(s.rootTileset.slice()));continue}}else s.session&&e.searchParams.append("session",s.session)}a.push(t(e.toString(),i).then(e=>e.data))}return a}_getInitialPromise(e,t,i,r,a,n,o){const l=this._getRequestPromises(e.urls,t,i,r);return Promise.all(l).then(e=>(a.inputs=e,this._workerHandle.invoke(a,n))).then(e=>e).catch(t=>{let i=1;return s(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):o&&400===t.details?.httpStatus?(i=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),{status:i,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t);const i=t.abortController.signal,r=t.layerView.layer,a="integrated-mesh-3dtiles"===r.type?r.key:null,n="integrated-mesh-3dtiles"===r.type?r.session:null,o={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey,key:a}},l={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(r.url),h=a=>{if(1===a.status)this._onJobFailed(t,a,e);else if(0===a.status)this._onJobSucceeded(t,a,e);else if(2===a.status){const n=this._getRequestPromises(a.missingInputUrls,o,d,r);Promise.all(n).then(e=>{l.jobDescJson=a.jobDescJson,a.originalInputs?l.inputs=a.originalInputs:l.inputs=[],l.isMissingResourceCase=!0;for(const t of e)l.inputs.push(t);return this._workerHandle.invoke(l,i)}).then(i=>{1===i.status?this._onJobFailed(t,i,e):0===i.status&&this._onJobSucceeded(t,i,e)}).catch(i=>{this._decrementJobCount(t),s(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)})}};try{const t=await this._getInitialPromise(e,o,d,r,l,i,n);if(3===t.status&&"integrated-mesh-3dtiles"===r.type&&n===r.session&&null!==r.session){await r.requestRootAndSession(i);h(await this._getInitialPromise(e,o,d,r,l,i,n))}else h(t)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc),this._decrementJobCount(t)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),t=e.meshData;if(t.data&&t.data.byteLength>0){const e=t.data.slice();t.data=e}const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then(t=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,t.memUsageBytes),this._decrementRenderableCount(i)}).catch(t=>{s(t)||this._debugLog(2,1,`createRenderable failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0),this._decrementRenderableCount(i)}))}_freeRenderables(e,t,i){if(i<1)return;const r=this._layers.get(e);if(!r)return;const s=r.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)a.push(n[o]);for(let o=0;o<i;++o)s.freeRenderable(a[o])}_setRenderableVisibility(e,t,i,r){if(r<1)return;const s=this._layers.get(e);if(!s)return;const a=s.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,r),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,r);for(let h=0;h<r;++h)n.push(l[h]),o.push(1===d[h]);a.setRenderableVisibility(n,o,r)}_onWasmError(e,t,i,r){this._lyr3DMain&&this._debugLog(i,r,this._lyr3DMain.UTF8ToString(e,t),!1)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_addLayerView(e){const t=e.layer,i="integrated-mesh-3dtiles"===t.type?0:2;if(!t.url)return{wasmLayerId:h};if(0===i){if(!t.rootTilesetJSON)return{wasmLayerId:h};const e=this._lyr3DMain.validate_root_tileset(JSON.stringify(t.rootTilesetJSON),i);if(0!==e.errorCode)return{wasmLayerId:h,check:e}}const r=this._lyr3DMain.get_next_layer_id(),s=new AbortController;this._layers.set(r,{layerView:e,abortController:s,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey,needFrame:!1});const a=y(t.elevationInfo);return this._lyr3DMain.add_layer(t.url,r,i,a)?(this._updateWasmCamera(),{wasmLayerId:r}):(this._layers.delete(r),{wasmLayerId:h})}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:t,center:i,up:r,near:s,far:a,fovY:n}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:t,center:i,up:r,near:s,far:a,fov:n,aspectRatio:l,viewport:o})}};e([o({constructOnly:!0})],m.prototype,"view",void 0),m=e([l("esri.layers.Lyr3DWasmPerSceneView")],m);const c=m;export{c as default};
5
+ import{__decorate as e}from"tslib";import t from"../request.js";import i from"../core/Accessor.js";import s from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{isGeographic as d}from"../geometry/support/spatialReferenceUtils.js";import h from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as _,invalidLayerView as u}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as y}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as c}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as g}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as m}from"../views/3d/layers/support/makeScheduleFunction.js";let w=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._debugFlags=new Set,this._debugLevel=0,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,t,i,r=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=r?`[js] ${i}`:`${i}`;0===t||1===t?s.getLogger(this).error(e):2===t&&s.getLogger(this).warn(e),s.getLogger(this).info(e)}}initialize(){this._debugLevel>2&&(s.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([a(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera())]),this._pulseTaskHandle=n({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:_})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(t=>{t.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0,i.needFrame=!0,i.layerView.updatingFlagChanged())}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}setMeshModifications(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const s=this._layers.get(e.wasmLayerId);if(s){const r=this._lyr3DMain._malloc(8*t.length),a=new Float64Array(this._lyr3DMain.HEAPF64.buffer,r,t.length);for(let e=0;e<t.length;++e)a[e]=t[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,r,t.length,i),this._lyr3DMain._free(r),s.needFrame=!0,s.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0||t.needFrame)}initializeWasm(e,t){return this._lyr3DMain?Promise.resolve():this.view.renderSpatialReference?(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=c().then(i=>{this._lyr3DMain=i,this._lyr3DMainPromise=null;const s=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),r=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();const l="global"===this.view.viewingMode?5:3;5===l?this._viewSR.wkid=this._viewSR.latestWkid=4326:this.view.renderSpatialReference?.isWebMercator?this._viewSR.wkid=this._viewSR.latestWkid=3857:32662===this.view.renderSpatialReference?.wkid&&(this._viewSR.wkid=this._viewSR.latestWkid=4326);const d=this.view.heightModelInfo?.heightModel,h=!d||"gravity-related-height"===d;this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=h?5773:115700;return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,e,t,l,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0))?(this._workerHandle=new y(m(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise):Promise.reject()}_pulseTask(){if(this._lyr3DMain){let e=0,t=0;this._layers.forEach(i=>{e+=i.layerView.usedMemory,t+=i.layerView.cachedMemory}),e/=1048576,t/=1048576;const i=this.view.resourceController.memoryController,s=i.usedMemory*i.maxMemory-e;this._lyr3DMain.frame_pulse(i.memoryFactor,e,t,s,i.maxMemory),this._layers.forEach(e=>{!0===e.needFrame&&(e.needFrame=!1,e.layerView.updatingFlagChanged())})}}_incrementJobCount(e){e.outstandingJobCount+=1,1===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_decrementJobCount(e){e.outstandingJobCount-=1,0===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){e.outstandingRenderableCount+=1,e.outstandingJobCount<1&&1===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){e.outstandingRenderableCount-=1,e.outstandingJobCount<1&&0===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_onJobFailed(e,t,i){t.error.length&&this._debugLog(1,1,t.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc),this._decrementJobCount(e)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){const e=t.data.byteLength,s=this._lyr3DMain._malloc(e);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,s,e).set(t.data),this._lyr3DMain.on_job_completed(i.jobId,t.jobDescJson,s,e),this._lyr3DMain._free(s)}this._decrementJobCount(e)}_getRequestPromises(e,i,s,r){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===r.type){if(e.origin===s.origin&&e.pathname===s.pathname){if(r.rootTileset){a.push(Promise.resolve(r.rootTileset.slice()));continue}}else r.session&&e.searchParams.append("session",r.session)}a.push(t(e.toString(),i).then(e=>e.data))}return a}_getInitialPromise(e,t,i,s,a,n,o){const l=this._getRequestPromises(e.urls,t,i,s);return Promise.all(l).then(e=>(a.inputs=e,this._workerHandle.invoke(a,n))).then(e=>e).catch(t=>{let i=1;return r(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):o&&400===t.details?.httpStatus?(i=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),{status:i,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t);const i=t.abortController.signal,s=t.layerView.layer,a="integrated-mesh-3dtiles"===s.type?s.key:null,n="integrated-mesh-3dtiles"===s.type?s.session:null,o={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey,key:a}},l={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=a=>{if(1===a.status)this._onJobFailed(t,a,e);else if(0===a.status)this._onJobSucceeded(t,a,e);else if(2===a.status){const n=this._getRequestPromises(a.missingInputUrls,o,d,s);Promise.all(n).then(e=>{l.jobDescJson=a.jobDescJson,a.originalInputs?l.inputs=a.originalInputs:l.inputs=[],l.isMissingResourceCase=!0;for(const t of e)l.inputs.push(t);return this._workerHandle.invoke(l,i)}).then(i=>{1===i.status?this._onJobFailed(t,i,e):0===i.status&&this._onJobSucceeded(t,i,e)}).catch(i=>{this._decrementJobCount(t),r(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)})}};try{const t=await this._getInitialPromise(e,o,d,s,l,i,n);if(3===t.status&&"integrated-mesh-3dtiles"===s.type&&n===s.session&&null!==s.session){await s.requestRootAndSession(i);h(await this._getInitialPromise(e,o,d,s,l,i,n))}else h(t)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc),this._decrementJobCount(t)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),t=e.meshData;if(t.data&&t.data.byteLength>0){const e=t.data.slice();t.data=e}const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then(t=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,t.memUsageBytes),this._decrementRenderableCount(i)}).catch(t=>{r(t)||this._debugLog(2,1,`createRenderable failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0),this._decrementRenderableCount(i)}))}_freeRenderables(e,t,i){if(i<1)return;const s=this._layers.get(e);if(!s)return;const r=s.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)a.push(n[o]);for(let o=0;o<i;++o)r.freeRenderable(a[o])}_setRenderableVisibility(e,t,i,s){if(s<1)return;const r=this._layers.get(e);if(!r)return;const a=r.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,s),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,s);for(let h=0;h<s;++h)n.push(l[h]),o.push(1===d[h]);a.setRenderableVisibility(n,o,s)}_onWasmError(e,t,i,s){this._lyr3DMain&&this._debugLog(i,s,this._lyr3DMain.UTF8ToString(e,t),!1)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_isGaussianSplatLayerView(e){return"gaussian-splat"===e.layer.type}_isGaussianSplatLayer(e){return"gaussian-splat"===e.type}_addLayerView(e){const t=e.layer;if(!t.url||!t.rootTilesetJSON)return{wasmLayerId:u};const i="integrated-mesh-3dtiles"===t.type?0:2,r=this._lyr3DMain.validate_root_tileset(JSON.stringify(t.rootTilesetJSON),i);if(0!==r.errorCode)return{wasmLayerId:u,check:r};const a=this._lyr3DMain.get_next_layer_id(),n=new AbortController;this._layers.set(a,{layerView:e,abortController:n,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey,needFrame:!1});const o=g(t.elevationInfo),l=e=>s.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let _=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(t)){let i=t.spatialReference;if(e.useEsriCrs&&t.esriCrsSpatialReference){i=t.esriCrsSpatialReference;const e=d(i);let s=1,r=1;!e&&i.wkid&&-1!==i.wkid&&(s=h.values[h[i.wkid]],r=s),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(i)),e,s,r).catch(l)}_=this._lyr3DMain.add_gaussian_splat_layer(t.url,a,o)}else _=this._lyr3DMain.add_3dtiles_layer(t.url,a,o);return _?(this._updateWasmCamera(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:u})}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:t,center:i,up:s,near:r,far:a,fovY:n}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:t,center:i,up:s,near:r,far:a,fov:n,aspectRatio:l,viewport:o})}_makeSRWasmSerializable(e){return{wkid:e?.wkid??-1,latestWkid:e?.latestWkid??-1,vcsWkid:e?.vcsWkid??-1,latestVcsWkid:e?.latestVcsWkid??-1,wkt:e?.wkt??""}}_cleanUpSR(e){return-1===e?.wkid&&e.latestWkid&&-1!==e.latestWkid?e.wkid=e.latestWkid:-1===e?.latestWkid&&e.wkid&&-1!==e.wkid&&(e.latestWkid=e.wkid),-1===e?.vcsWkid&&e.latestVcsWkid&&-1!==e.latestVcsWkid?e.vcsWkid=e.latestVcsWkid:-1===e?.latestVcsWkid&&e.vcsWkid&&-1!==e.vcsWkid&&(e.latestVcsWkid=e.vcsWkid),e}};e([o({constructOnly:!0})],w.prototype,"view",void 0),w=e([l("esri.layers.Lyr3DWasmPerSceneView")],w);const b=w;export{b 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{WorkerHandle as r}from"../core/workers/WorkerHandle.js";class s extends r{constructor(r){super("Lyr3DWorker","process",{process:r=>r.inputs},r,{hasInitialize:!0})}destroyWasm(){return this.broadcast({},"destroyWasm")}}export{s as Lyr3DWorkerHandle};
5
+ import{WorkerHandle as r}from"../core/workers/WorkerHandle.js";class e extends r{constructor(r){super("Lyr3DWorker","process",{process:r=>r.inputs},r,{hasInitialize:!0})}destroyWasm(){return this.broadcast({},"destroyWasm")}addSpatialReferenceInfo(r,e,s,t){const o={sr:r,isGCS:e,toMetersXY:s,toMetersZ:t};return this.broadcast(o,"addSpatialReferenceInfo")}}export{e as Lyr3DWorkerHandle};
@@ -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 has from"../../../core/has.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import r from"../../../core/PooledArray.js";import{EsriPromiseMixin as a}from"../../../core/Promise.js";import{isAbortError as d}from"../../../core/promiseUtils.js";import{watch as n,sync as o,initial as l}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{q as _}from"../../../chunks/vec32.js";import{UpdatingHandles as c}from"../../../core/support/UpdatingHandles.js";import{projectBoundingRect as p}from"../../../geometry/projection/projectBoundingRect.js";import{create as g}from"../../../geometry/support/aaBoundingRect.js";import{viewingModeFromString as m}from"../../../views/ViewingMode.js";import{I3SClientNodeLoader as y}from"../../../views/3d/layers/i3s/I3SClientNodeLoader.js";import{addCallback as f}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as x}from"../../../views/3d/layers/i3s/I3SIndex.js";import b from"../../../views/3d/layers/i3s/I3SLodHandling.js";import N from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as w}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as v,getIndexCrs as C,findIntersectingNodes as L}from"../../../views/3d/layers/i3s/I3SUtil.js";import D from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{maxDownloadSlots as V}from"../../../views/3d/support/downloadSlots.js";import{toBoundingRect as A}from"../../../views/3d/support/extentUtils.js";import{minQuality as I}from"../../../views/3d/support/MemoryController.js";import{PromiseQueue as S}from"../../../views/support/PromiseQueue.js";import{noBudget as M}from"../../../views/support/Scheduler.js";const F=100,P=2,O=1e4,q=1e-4,R=1.2,G=500,U=1.5;let H=class extends(a(t)){get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store?.lodType}get isGraphics3D(){return"points"===this.layer.profile}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&(null==this.layer.priority||"High"===this.layer.priority)}get indexStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(2);return new w(e,this.layer.customParameters,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(3);return new w(e,this.layer.customParameters,this.layer.apiKey)}get crsVertex(){return v(this.layer)}get crsIndex(){return C(this.layer)}get layer(){return this.layerView.i3slayer}get updating(){return this.running||this._updatingHandles.updating}get rootNodeVisible(){if(this._index){const e=this._index.rootNode;if(e)return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}get requiredAttributes(){return this._requiredAttributes}constructor(e){super(e),this.featureTarget=5e4,this.fixedFeatureTarget=!1,this._updatingHandles=new c,this.running=!0,this.updatingProgress=1,this.leavesReached=!1,this.worker=null,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._idleStateCallbacks=null,this._newLoadingNodes=new r({deallocator:null}),this._modificationsNodeFilteringArray=new r,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._idleQueue=new S,this._elevationUpdateNodes=new r({deallocator:null}),this._errorCount=0}initialize(){const{layerView:e,layer:t}=this;this._disableMemCache=!e.loadCachedGPUData||!e.addCachedGPUData,this._lodHandling=new b(e),this._defaultGeometrySchema=t.store.defaultGeometrySchema,this.disableIDBCache=!!has("disable-feature:idb-cache"),"fields"in t&&(this._fields=t.fields,this._attributeStorageInfo=t.attributeStorageInfo),this.addResolvingPromise(Promise.all([t.indexInfo,t.when(),e.when()]).then(([s])=>{if(this.destroyed||!e||e.destroyed||!s)return;const{view:r,clientGeometry:a}=e,{resourceController:d}=r;if(this._setClippingArea(r.clippingArea),this.addHandles([this._updatingHandles.add(()=>r?.pointsOfInterest?.focus?.renderLocation,e=>this._pointOfInterestChanged(e),{initial:!0,equals:_}),n(()=>r.quality,()=>this._setCameraDirty(),o),this._updatingHandles.add(()=>e.contentVisible,e=>{const t=e?()=>this._updateIdleState(!0):()=>this._updateViewData(),i=e?()=>this._updateIdleState(!1):()=>{};e&&null!=this._index&&this._index.invalidateAllElevationRanges(),this._idleStateCallbacks?(e||this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=t,this._idleStateCallbacks.idleEnd=i):this._idleStateCallbacks=d.scheduler.registerIdleStateCallbacks(t,i)},l),f(e.view.resourceController.scheduler,this),this._updatingHandles.add(()=>[this.featureTarget,this.fixedFeatureTarget],()=>{this._setCameraDirty(),this._stableFeatureLOD=!1}),this._updatingHandles.add(()=>r.state?.contentCamera,()=>this._setCameraDirty()),this._updatingHandles.add(()=>t.elevationInfo,e=>this._elevationInfoChanged(e)),this._updatingHandles.add(()=>e.lodFactor,()=>this._setCameraDirty()),this._updatingHandles.add(()=>e.availableFields,()=>this._requiredFieldsChange()),this._updatingHandles.add(()=>e.availableFields,()=>console.log("available fields changed",(new Error).stack),{sync:!0}),this._updatingHandles.add(()=>e.holeFilling,e=>null!=this._index&&(this._index.holeFilling=e))]),this._viewportQueries=new D(this.crsIndex,r.renderCoordsHelper,r.state.contentCamera,!r.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?r.basemapTerrain:r.elevationProvider,m(r.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new y(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:r.renderCoordsHelper.spatialReference},r.resourceController.memoryController,this.worker),this._index=new x(m(r.viewingMode),t,s,this.indexStreamController,this._clientNodeLoader,this._viewportQueries,i.getLogger(this),e.holeFilling,t=>e.isNodeLoaded(t),t=>e.isNodeReloading(t),e=>this._shouldLoadNode(e),e=>this._enableFromGPUCache(e,1),e=>this._needsUpdate(e),()=>!this.indexStreamController.busy,t=>e.computeVisibilityObb?.(t)??null,e?.computeNodeFiltering?t=>e.computeNodeFiltering(t):void 0),this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D),this._index.imModificationsChanged(!!e.hasModifications),this._index.layerFilterChanged(!!e.hasGeometryFilter),null!=a){for(const e of a)this._addMesh(e.mesh,e.oid);this.addHandles(a.on("change",e=>{for(const t of e.removed)this._removeMesh(t.oid);for(const t of e.added)this._addMesh(t.mesh,t.oid)}))}this._startNodeLoading()}))}updateNodeModificationStatus(e){const t=this._index,i=this.layerView;null!=t&&i?.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll(e=>{const i=t.getNode(e);null!=i&&this._modificationsNodeFilteringArray.push(i)}),i.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._updatingHandles.destroy(),this._nodeLoader=null,Q.prune(),this._newLoadingNodes.prune(),this._modificationsNodeFilteringArray.prune(),this._elevationUpdateNodes.prune(),this._index=null,this._lodHandling=s(this._lodHandling),this._nodeLoader=null,this._clientNodeLoader=null,this._viewportQueries=null,this._set("worker",null)}get viewportQueries(){return this._viewportQueries}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const e=this._attributeStorageInfo,t=this._fields,i=this.layer.objectIdField;return this.layerView.availableFields.map(i=>{const s=k(e,i),r=k(t,i);return s>=0&&r>=0?{index:s,name:t[r].name,field:t[r],attributeStorageInfo:e[s]}:null}).filter(e=>null!=e&&e.name!==i)}_requiredFieldsChange(){const e=this._getRequiredAttributes();j(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=g();A(e,t,this.layerView.view.renderSpatialReference)?this._clippingArea=t:this._clippingArea=null}_pointOfInterestChanged(e){null!=this._viewportQueries&&(this._viewportQueries.setPointOfInterest(e),null!=this._index&&(this._index.progressiveLoadPenalty=T.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(e){this._setClippingArea(e),null!=this._viewportQueries&&null!=this._index&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}_addMesh(e,t){if(null==this._index)return;const i=this._clientNodeLoader.createMeshNodeInfo(e,t),s=this._index.addClientNodeToIndex(i.id,i.mbs);this._clientNodeLoader.addMeshNode(s,i),this._evaluateRunning(),this.notifyChange("rootNodeVisible")}_removeMesh(e){const t=this._clientNodeLoader.getMeshNodeIndex(e);if(null!=t){if(null==this._index)throw new Error("delayed removal of client side i3s node geometry not supported yet.");{const e=(e,t)=>{this.layerView.removeNode(t),this._clientNodeLoader.removeNode(e),this.layerView.deleteCachedNodeData&&null!=e&&this.layerView.deleteCachedNodeData(e),this.layerView.deleteCachedGPUData?.(this.layerView.loadCachedGPUData?.(t))},i=(e,t,i)=>{this._clientNodeLoader.updateNodeIndex(e,t,i),this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(t,i)};this._index.removeClientNodeFromIndex(t,e,i),this.notifyChange("rootNodeVisible")}}}updateElevationChanged(e,t){const i=this._index;if(null==i?.rootNode||null==t)return null;this.crsIndex.equals(t)||(p(e,t,E,this.crsIndex),e=E);const s=this._elevationUpdateNodes;return s.clear(),L(e,i.rootNode,i,e=>s.push(e.index)),s.length&&(s.forAll(e=>i.updateElevationChanged(e)),this._setCameraDirty()),s}removeAllGeometryObbs(){null!=this._index&&this._index.removeAllGeometryObbs()}getRenderMbs(e){return null!=this._viewportQueries?this._viewportQueries.getServiceMbsInRenderSR(e):null}_elevationInfoChanged(e){null!=this._index&&(this._index.updateElevationInfo(e,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateRunning()}schedule(e,t){const i=this._idleQueue.push(e,t);return this._evaluateRunning(),i}reschedule(e,t){const i=this._idleQueue.unshift(e,t);return this._evaluateRunning(),i}get _isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get unloadedMemoryEstimate(){return null!=this._index&&this.layerView.contentVisible?this._index.unloadedMemoryEstimate*this._lodDropFactor:0}async _loadNodeData(e,t){return e.index<0?this._clientNodeLoader.loadNodeData(e.id,t):this._nodeLoader.loadNodeData(e,t)}async _loadAttributes(e,t,i){return(e.index<0?this._clientNodeLoader:this._nodeLoader).loadAttributes(e,t,i)}get indexDepth(){return null!=this._index?this._index.maxLevel:0}set disableMemCache(e){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData?this._disableMemCache=e:this._disableMemCache=!0}runTask(e,t){return this.layerView.contentVisible?this.layerView.visible&&null!=this._index?(this._processWithErrorLogging(e,t),this._index.maxPriority):-1/0:(this._updateViewData(),this._evaluateRunning(),-1/0)}_processWithErrorLogging(e,t){try{this._process(e,t)}catch(s){this._errorCount<50?i.getLogger(this).error(`Error during processing: ${s} at ${s.stack}`):50===this._errorCount&&i.getLogger(this).error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),null!=this._nodeLoader&&null!=this._index&&(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this._isIntegratedMesh&&(e.enabled=!1),e.run(()=>this._processIndex(e)),this._updateFeatureLOD(),e.run(()=>this._processCache(e)),this._isIntegratedMesh&&(e.enabled=!0),e.run(()=>this._processNodes(e,t)),this._idleQueue.runTask(e),e.run(()=>this._prefetchIndex()),t.numIndexLoading+=this._index.indexLoading,t.numNodesLoading+=this._downloadingCount,e.run(()=>this._lodHandling.lodGlobalHandling(e)),this._evaluateRunning())}_processIndex(e){if(null==this._index)return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update(Array.from(this._loadingNodes.keys()),e,e=>this.updateNodeModificationStatus(e)),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const t=this._index.featureEstimate.leavesReached;this._index.isLoading||t===this._get("leavesReached")||this._set("leavesReached",t)}return this._index.load()}_prefetchIndex(){return!(null==this._index||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.useMaximumNumberOfFeatures||null==this._index||null==this._viewportQueries)return;const e=!this._index.isLoading,t=this.featureTarget*this._baseLOD,i=this._index.featureEstimate;if(i.estimate=i.estimate||t/2,this._index.indexMissing>G){if(this._featureLOD<=q)return;this._featureLOD/=U,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=O||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this._lod,r=this._index.checkFeatureTarget(t,s);r!==s&&(this._featureLOD=r/this._baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*R||e&&i.estimate>t))return;if(this._featureLOD<=q)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(O,Math.max(q,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.requestUpdate()}_processCache(e){const t=this._index;if(null==t)return!1;for(;this._newLoadingNodes.length>0&&!e.done;){const i=this._newLoadingNodes.pop();for(let s=t.getParent(i);null!=s&&!this.layerView.isNodeLoaded(s.index);s=t.getParent(s.index))if(this._enableFromGPUCache(s,0)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(null==this._index)return!1;let i=(this._isIdle?F:P)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!e.done;)this.layerView.removeNode(s.remove.pop()),e.madeProgress();for(;s.update.length>0&&!e.done;){const t=this._index.getNode(s.update.pop());null!=t&&(this._updateLoadedNode(t),e.madeProgress())}for(;s.add.length>0&&!e.done&&i>0;){--i;const r=this._index.getNode(s.add.back());if(null==r||2!==r.cacheState&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(r),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach(e=>e.abort()),this._loadingNodes.clear(),this._updatingNodes.forEach(e=>e.abort()),this._updatingNodes.clear()}_cancelNode(e){const t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!(!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=P)&&(this._downloadingCount<V&&!this.dataStreamController.busy)}_evaluateRunning(){let e=!1,t=0;if(this.layerView){if(this.layerView.contentVisible){const i=(this._index?.indexMissing??0)+3*(this._index?.updates.add.length??0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.updating||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||null!=this._index&&this._index.isPrefetching),0===i&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(i,this._progressMaxNumNodes),t=1-i/this._progressMaxNumNodes}else e=this._cameraDirty,t=e?0:1;this.running=e,this.updatingProgress=t}}_updateViewData(){if(!this._cameraDirty||null==this._index||null==this._viewportQueries)return;const e=this.layerView.view,{contentCamera:t,fixedContentCamera:i}=e.state;this._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=T.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.quality<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){const e=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*this.layerView.view.quality}get _lodDropFactor(){if(this.fixedFeatureTarget)return 1;return(Math.min(this.layerView.view.quality,.5)-I)/(.5-I)}isGeometryVisible(e){return!!this._index?.isGeometryVisible(e.index)}updateVisibility(e){this._index?.invalidateNodeVisibilityCache(e)}invalidateGeometryVisibility(e){this._index?.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){this._index?.invalidateVisibilityObbs()}modificationsChanged(){this._index?.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e))&&!(null==this._index||!this._index.isGeometryVisible(e.index))}_shouldDropNode(e){if(null==this._viewportQueries)return!1;const t=this._lodDropFactor;if(t>=1||!this._lodHandling.hasNoVisibleChildren(e))return!1;return Math.abs(this._viewportQueries.calcCameraDistanceToCenter(e))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;const e=this._index;if(this._updatesDisabled||null==e||null==this._viewportQueries)return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const t={textureEncodings:this.layerView.supportedTextureEncodings,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new N(this.layer,this.dataStreamController,i.getLogger(this),this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e,t)=>this._removeNodes(e,t,1),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateRunning()}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateRunning())}_removeInvisibleNodes(e){const t=this._index;if(null==t||null==this._viewportQueries)return!1;Q.clear(),this.layerView.getLoadedNodeIndices(Q);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return Q.filterInPlace(e=>{const i=t.getNode(e);return null==i||!t.isGeometryVisible(e)||s(i)}),Q.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(Q,e,0),!(i&&this._lodDropFactor<1)&&(0===Q.length||(Q.clear(),!1))}markNodeToRemove(e){Q.push(e)}removeMarkedNodes(){this._removeNodes(Q,M,0)}_removeNodes(e,t,i){if(0!==e.length&&!t.done)for(null!=this._index&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),r=this._index;1===i&&this.layerView.nodeFadeoutEnabled&&null!=r&&r.isGeometryVisible(s)?this.layerView.fadeNode(s,1,!0):this.layerView.removeNode(s),t.madeProgress()}}_needsUpdate(e){if(e.resources.isEmpty||this._updatingNodes.has(e.index))return!1;const t=this.layerView.getLoadedAttributes(e.index);return null!=t&&t!==this._requiredAttributes}async _updateLoadedNode(e){const t=new AbortController;this._updatingNodes.set(e.index,t),this._evaluateRunning();try{const i=this.layerView.getLoadedAttributes(e.index),s=j(i,this._requiredAttributes)?this.layerView.getAttributeData(e.index):await this._loadAttributes(e,this._requiredAttributes,t.signal);await this.schedule(()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:s},t.signal),t.signal)}catch(i){if(!d(i))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)}this._updatingNodes.delete(e.index),this._evaluateRunning()}_loadNode(e){if(this._loadingNodes.has(e.index))return void i.getLogger(this).error("already loading node "+e.index);const t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateRunning(),this._loadAndAddNode(e,t.signal).then(i=>{i&&null!=this._index&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())}).catch(e=>{if(!d(e))throw e}).finally(()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateRunning()})}_loadAndAddNode(e,t){return 1===e.cacheState?this._loadUncached(e,t).then(()=>!1):this._loadCached(e,t).then(t=>!t&&(e.cacheState=1,!0)).catch(t=>!d(t)&&(e.cacheState=1,!0))}_enableFromGPUCache(e,t){if(this._disableMemCache||null==this._index)return!1;if(0===t&&!this._index.useNodeAsHole(e.index))return!0;const i=this._loadCachedGPUData(e);return!!i&&(this.layerView.addCachedGPUData(e,i,t),this._nodeAdded(),!0)}_loadCachedGPUData(e){const t=this.layerView.loadCachedGPUData(e.index);return null!=t?.attributeInfo&&j(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){null!=this._index&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}updateLoadStatus(e,t){const i=this._index;null!=i&&i.updateChildrenLoaded(e,t?1:-1)}async _loadCached(e,t){if(this._enableFromGPUCache(e,1))return!0;const i=this.layerView;if(this.disableIDBCache||!i.loadCachedNodeData||!i.addCachedNodeData)return!1;const s=(t,i)=>this._nodeLoader.loadTextures(e,t,i),r=(t,i)=>this._clientNodeLoader.loadTextures(e,t,i),a=e.index>=0?s:r,d=await this.schedule(()=>i.loadCachedNodeData(e,t,a),t);if(null==d)return!1;const n=this._requiredAttributes,o=await this.reschedule(()=>this._loadAttributes(e,n,t),t);return await this.reschedule(()=>i.addCachedNodeData(e,d,{loadedAttributes:n,attributeData:o},t),t),this._nodeAdded(),!0}_loadUncached(e,t){return this._downloadingCount++,this._loadNodeData(e,t).catch(e=>{throw this._downloadingCount--,e}).then(i=>(this._downloadingCount--,this.schedule(()=>this.layerView.addNode(e,i,t),t))).then(()=>{this._nodeAdded(),e.cacheState=2}).catch(t=>{if(!d(t))throw i.getLogger(this).error("#loadNodeData()",this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,null!=this._index&&this._index.requestUpdate(),t})}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateRunning(),e&&this._index&&null!=this._index&&this._index.resetFailedNodes())}get test(){}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateRunning(),null!=this._index&&this._index.requestUpdate()}geometryFilterChanged(e){const t=this._index;null!=t&&t.layerFilterChanged(e),this._setCameraDirty()}};e([h({readOnly:!0})],H.prototype,"isMeshPyramid",null),e([h({readOnly:!0})],H.prototype,"isGraphics3D",null),e([h({readOnly:!0})],H.prototype,"useMaximumNumberOfFeatures",null),e([h({readOnly:!0})],H.prototype,"indexStreamController",null),e([h({readOnly:!0})],H.prototype,"dataStreamController",null),e([h({readOnly:!0})],H.prototype,"crsVertex",null),e([h({readOnly:!0})],H.prototype,"crsIndex",null),e([h()],H.prototype,"featureTarget",void 0),e([h()],H.prototype,"fixedFeatureTarget",void 0),e([h()],H.prototype,"layerView",void 0),e([h()],H.prototype,"layer",null),e([h()],H.prototype,"_updatingHandles",void 0),e([h()],H.prototype,"updating",null),e([h()],H.prototype,"running",void 0),e([h()],H.prototype,"updatingProgress",void 0),e([h({readOnly:!0})],H.prototype,"leavesReached",void 0),e([h({constructOnly:!0})],H.prototype,"worker",void 0),e([h({readOnly:!0,dependsOn:[]})],H.prototype,"rootNodeVisible",null),H=e([u("esri.layers.graphics.controllers.I3SOnDemandController")],H);const Q=new r({deallocator:null});function j(e,t){return null!=e&&e.length===t.length&&e.every(e=>k(t,e.name)>=0)}function k(e,t){const i=t.toLowerCase();for(let s=0;s<e.length;s++)if(e[s].name.toLowerCase()===i)return s;return-1}const T={distancePenalty:10},E=g();export{H as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import r from"../../../core/PooledArray.js";import{EsriPromiseMixin as a}from"../../../core/Promise.js";import{isAbortError as d}from"../../../core/promiseUtils.js";import{watch as o,sync as n,initial as l}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{q as _}from"../../../chunks/vec32.js";import{UpdatingHandles as c}from"../../../core/support/UpdatingHandles.js";import{projectBoundingRect as p}from"../../../geometry/projection/projectBoundingRect.js";import{create as g}from"../../../geometry/support/aaBoundingRect.js";import{viewingModeFromString as m}from"../../../views/ViewingMode.js";import{I3SClientNodeLoader as y}from"../../../views/3d/layers/i3s/I3SClientNodeLoader.js";import{addCallback as f}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as x}from"../../../views/3d/layers/i3s/I3SIndex.js";import N from"../../../views/3d/layers/i3s/I3SLodHandling.js";import b from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as w}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as v,getIndexCrs as C,findIntersectingNodes as L}from"../../../views/3d/layers/i3s/I3SUtil.js";import D from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{maxDownloadSlots as V}from"../../../views/3d/support/downloadSlots.js";import{toBoundingRect as A}from"../../../views/3d/support/extentUtils.js";import{minQuality as I}from"../../../views/3d/support/MemoryController.js";import{PromiseQueue as S}from"../../../views/support/PromiseQueue.js";import{noBudget as M}from"../../../views/support/Scheduler.js";const F=100,P=2,O=1e4,q=1e-4,R=1.2,G=500,U=1.5;let Q=class extends(a(t)){get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store?.lodType}get isGraphics3D(){return"points"===this.layer.profile}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&(null==this.layer.priority||"High"===this.layer.priority)}get indexStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(2);return new w(e,this.layer.customParameters,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(3);return new w(e,this.layer.customParameters,this.layer.apiKey)}get crsVertex(){return v(this.layer)}get crsIndex(){return C(this.layer)}get layer(){return this.layerView.i3slayer}get updating(){return this.running||this._updatingHandles.updating}get rootNodeVisible(){if(this._index){const e=this._index.rootNode;if(e)return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}get requiredAttributes(){return this._requiredAttributes}constructor(e){super(e),this.featureTarget=5e4,this.fixedFeatureTarget=!1,this._updatingHandles=new c,this.running=!0,this.updatingProgress=1,this.leavesReached=!1,this.worker=null,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._idleStateCallbacks=null,this._newLoadingNodes=new r({deallocator:null}),this._modificationsNodeFilteringArray=new r,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._idleQueue=new S,this._elevationUpdateNodes=new r({deallocator:null}),this._errorCount=0}initialize(){const{layerView:e,layer:t}=this;this._disableMemCache=!e.loadCachedGPUData||!e.addCachedGPUData,this._lodHandling=new N(e),this._defaultGeometrySchema=t.store.defaultGeometrySchema,this.disableIDBCache=!!has("disable-feature:idb-cache"),"fields"in t&&(this._fields=t.fields,this._attributeStorageInfo=t.attributeStorageInfo),this.addResolvingPromise(Promise.all([t.indexInfo,t.when(),e.when()]).then(([s])=>{if(this.destroyed||!e||e.destroyed||!s)return;const{view:r,clientGeometry:a}=e,{resourceController:d}=r;if(this._setClippingArea(r.clippingArea),this.addHandles([this._updatingHandles.add(()=>r?.pointsOfInterest?.focus?.renderLocation,e=>this._pointOfInterestChanged(e),{initial:!0,equals:_}),o(()=>r.quality,()=>this._setCameraDirty(),n),this._updatingHandles.add(()=>e.contentVisible,e=>{const t=e?()=>this._updateIdleState(!0):()=>this._updateViewData(),i=e?()=>this._updateIdleState(!1):()=>{};e&&null!=this._index&&this._index.invalidateAllElevationRanges(),this._idleStateCallbacks?(e||this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=t,this._idleStateCallbacks.idleEnd=i):this._idleStateCallbacks=d.scheduler.registerIdleStateCallbacks(t,i)},l),f(e.view.resourceController.scheduler,this),this._updatingHandles.add(()=>[this.featureTarget,this.fixedFeatureTarget],()=>{this._setCameraDirty(),this._stableFeatureLOD=!1}),this._updatingHandles.add(()=>r.state?.contentCamera,()=>this._setCameraDirty()),this._updatingHandles.add(()=>t.elevationInfo,e=>this._elevationInfoChanged(e)),this._updatingHandles.add(()=>e.lodFactor,()=>this._setCameraDirty()),this._updatingHandles.add(()=>e.availableFields,()=>this._requiredFieldsChange()),this._updatingHandles.add(()=>e.holeFilling,e=>null!=this._index&&(this._index.holeFilling=e))]),this._viewportQueries=new D(this.crsIndex,r.renderCoordsHelper,r.state.contentCamera,!r.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?r.basemapTerrain:r.elevationProvider,m(r.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new y(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:r.renderCoordsHelper.spatialReference},r.resourceController.memoryController,this.worker),this._index=new x(m(r.viewingMode),t,s,this.indexStreamController,this._clientNodeLoader,this._viewportQueries,i.getLogger(this),e.holeFilling,t=>e.isNodeLoaded(t),t=>e.isNodeReloading(t),e=>this._shouldLoadNode(e),e=>this._enableFromGPUCache(e,1),e=>this._needsUpdate(e),()=>!this.indexStreamController.busy,t=>e.computeVisibilityObb?.(t)??null,e?.computeNodeFiltering?t=>e.computeNodeFiltering(t):void 0),this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D),this._index.imModificationsChanged(!!e.hasModifications),this._index.layerFilterChanged(!!e.hasGeometryFilter),null!=a){for(const e of a)this._addMesh(e.mesh,e.oid);this.addHandles(a.on("change",e=>{for(const t of e.removed)this._removeMesh(t.oid);for(const t of e.added)this._addMesh(t.mesh,t.oid)}))}this._startNodeLoading()}))}updateNodeModificationStatus(e){const t=this._index,i=this.layerView;null!=t&&i?.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll(e=>{const i=t.getNode(e);null!=i&&this._modificationsNodeFilteringArray.push(i)}),i.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._updatingHandles.destroy(),this._nodeLoader=null,H.prune(),this._newLoadingNodes.prune(),this._modificationsNodeFilteringArray.prune(),this._elevationUpdateNodes.prune(),this._index=null,this._lodHandling=s(this._lodHandling),this._nodeLoader=null,this._clientNodeLoader=null,this._viewportQueries=null,this._set("worker",null)}get viewportQueries(){return this._viewportQueries}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const e=this._attributeStorageInfo,t=this._fields,i=this.layer.objectIdField;return this.layerView.availableFields.map(i=>{const s=k(e,i),r=k(t,i);return s>=0&&r>=0?{index:s,name:t[r].name,field:t[r],attributeStorageInfo:e[s]}:null}).filter(e=>null!=e&&e.name!==i)}_requiredFieldsChange(){const e=this._getRequiredAttributes();j(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=g();A(e,t,this.layerView.view.renderSpatialReference)?this._clippingArea=t:this._clippingArea=null}_pointOfInterestChanged(e){null!=this._viewportQueries&&(this._viewportQueries.setPointOfInterest(e),null!=this._index&&(this._index.progressiveLoadPenalty=T.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(e){this._setClippingArea(e),null!=this._viewportQueries&&null!=this._index&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}_addMesh(e,t){if(null==this._index)return;const i=this._clientNodeLoader.createMeshNodeInfo(e,t),s=this._index.addClientNodeToIndex(i.id,i.mbs);this._clientNodeLoader.addMeshNode(s,i),this._evaluateRunning(),this.notifyChange("rootNodeVisible")}_removeMesh(e){const t=this._clientNodeLoader.getMeshNodeIndex(e);if(null!=t){if(null==this._index)throw new Error("delayed removal of client side i3s node geometry not supported yet.");{const e=(e,t)=>{this.layerView.removeNode(t),this._clientNodeLoader.removeNode(e),this.layerView.deleteCachedNodeData&&null!=e&&this.layerView.deleteCachedNodeData(e),this.layerView.deleteCachedGPUData?.(this.layerView.loadCachedGPUData?.(t))},i=(e,t,i)=>{this._clientNodeLoader.updateNodeIndex(e,t,i),this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(t,i)};this._index.removeClientNodeFromIndex(t,e,i),this.notifyChange("rootNodeVisible")}}}updateElevationChanged(e,t){const i=this._index;if(null==i?.rootNode||null==t)return null;this.crsIndex.equals(t)||(p(e,t,E,this.crsIndex),e=E);const s=this._elevationUpdateNodes;return s.clear(),L(e,i.rootNode,i,e=>s.push(e.index)),s.length&&(s.forAll(e=>i.updateElevationChanged(e)),this._setCameraDirty()),s}removeAllGeometryObbs(){null!=this._index&&this._index.removeAllGeometryObbs()}getRenderMbs(e){return null!=this._viewportQueries?this._viewportQueries.getServiceMbsInRenderSR(e):null}_elevationInfoChanged(e){null!=this._index&&(this._index.updateElevationInfo(e,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateRunning()}schedule(e,t){const i=this._idleQueue.push(e,t);return this._evaluateRunning(),i}reschedule(e,t){const i=this._idleQueue.unshift(e,t);return this._evaluateRunning(),i}get _isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get unloadedMemoryEstimate(){return null!=this._index&&this.layerView.contentVisible?this._index.unloadedMemoryEstimate*this._lodDropFactor:0}async _loadNodeData(e,t){return e.index<0?this._clientNodeLoader.loadNodeData(e.id,t):this._nodeLoader.loadNodeData(e,t)}async _loadAttributes(e,t,i){return(e.index<0?this._clientNodeLoader:this._nodeLoader).loadAttributes(e,t,i)}get indexDepth(){return null!=this._index?this._index.maxLevel:0}set disableMemCache(e){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData?this._disableMemCache=e:this._disableMemCache=!0}runTask(e,t){return this.layerView.contentVisible?this.layerView.visible&&null!=this._index?(this._processWithErrorLogging(e,t),this._index.maxPriority):-1/0:(this._updateViewData(),this._evaluateRunning(),-1/0)}_processWithErrorLogging(e,t){try{this._process(e,t)}catch(s){this._errorCount<50?i.getLogger(this).error(`Error during processing: ${s} at ${s.stack}`):50===this._errorCount&&i.getLogger(this).error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),null!=this._nodeLoader&&null!=this._index&&(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this._isIntegratedMesh&&(e.enabled=!1),e.run(()=>this._processIndex(e)),this._updateFeatureLOD(),e.run(()=>this._processCache(e)),this._isIntegratedMesh&&(e.enabled=!0),e.run(()=>this._processNodes(e,t)),this._idleQueue.runTask(e),e.run(()=>this._prefetchIndex()),t.numIndexLoading+=this._index.indexLoading,t.numNodesLoading+=this._downloadingCount,e.run(()=>this._lodHandling.lodGlobalHandling(e)),this._evaluateRunning())}_processIndex(e){if(null==this._index)return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update(Array.from(this._loadingNodes.keys()),e,e=>this.updateNodeModificationStatus(e)),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const t=this._index.featureEstimate.leavesReached;this._index.isLoading||t===this._get("leavesReached")||this._set("leavesReached",t)}return this._index.load()}_prefetchIndex(){return!(null==this._index||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.useMaximumNumberOfFeatures||null==this._index||null==this._viewportQueries)return;const e=!this._index.isLoading,t=this.featureTarget*this._baseLOD,i=this._index.featureEstimate;if(i.estimate=i.estimate||t/2,this._index.indexMissing>G){if(this._featureLOD<=q)return;this._featureLOD/=U,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=O||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this._lod,r=this._index.checkFeatureTarget(t,s);r!==s&&(this._featureLOD=r/this._baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*R||e&&i.estimate>t))return;if(this._featureLOD<=q)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(O,Math.max(q,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.requestUpdate()}_processCache(e){const t=this._index;if(null==t)return!1;for(;this._newLoadingNodes.length>0&&!e.done;){const i=this._newLoadingNodes.pop();for(let s=t.getParent(i);null!=s&&!this.layerView.isNodeLoaded(s.index);s=t.getParent(s.index))if(this._enableFromGPUCache(s,0)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(null==this._index)return!1;let i=(this._isIdle?F:P)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!e.done;)this.layerView.removeNode(s.remove.pop()),e.madeProgress();for(;s.update.length>0&&!e.done;){const t=this._index.getNode(s.update.pop());null!=t&&(this._updateLoadedNode(t),e.madeProgress())}for(;s.add.length>0&&!e.done&&i>0;){--i;const r=this._index.getNode(s.add.back());if(null==r||2!==r.cacheState&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(r),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach(e=>e.abort()),this._loadingNodes.clear(),this._updatingNodes.forEach(e=>e.abort()),this._updatingNodes.clear()}_cancelNode(e){const t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!(!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=P)&&(this._downloadingCount<V&&!this.dataStreamController.busy)}_evaluateRunning(){let e=!1,t=0;if(this.layerView){if(this.layerView.contentVisible){const i=(this._index?.indexMissing??0)+3*(this._index?.updates.add.length??0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.updating||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||null!=this._index&&this._index.isPrefetching),0===i&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(i,this._progressMaxNumNodes),t=1-i/this._progressMaxNumNodes}else e=this._cameraDirty,t=e?0:1;this.running=e,this.updatingProgress=t}}_updateViewData(){if(!this._cameraDirty||null==this._index||null==this._viewportQueries)return;const e=this.layerView.view,{contentCamera:t,fixedContentCamera:i}=e.state;this._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=T.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.quality<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){const e=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*this.layerView.view.quality}get _lodDropFactor(){if(this.fixedFeatureTarget)return 1;return(Math.min(this.layerView.view.quality,.5)-I)/(.5-I)}isGeometryVisible(e){return!!this._index?.isGeometryVisible(e.index)}updateVisibility(e){this._index?.invalidateNodeVisibilityCache(e)}invalidateGeometryVisibility(e){this._index?.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){this._index?.invalidateVisibilityObbs()}modificationsChanged(){this._index?.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e))&&!(null==this._index||!this._index.isGeometryVisible(e.index))}_shouldDropNode(e){if(null==this._viewportQueries)return!1;const t=this._lodDropFactor;if(t>=1||!this._lodHandling.hasNoVisibleChildren(e))return!1;return Math.abs(this._viewportQueries.calcCameraDistanceToCenter(e))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;const e=this._index;if(this._updatesDisabled||null==e||null==this._viewportQueries)return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const t={textureEncodings:this.layerView.supportedTextureEncodings,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new b(this.layer,this.dataStreamController,i.getLogger(this),this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e,t)=>this._removeNodes(e,t,1),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateRunning()}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateRunning())}_removeInvisibleNodes(e){const t=this._index;if(null==t||null==this._viewportQueries)return!1;H.clear(),this.layerView.getLoadedNodeIndices(H);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return H.filterInPlace(e=>{const i=t.getNode(e);return null==i||!t.isGeometryVisible(e)||s(i)}),H.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(H,e,0),!(i&&this._lodDropFactor<1)&&(0===H.length||(H.clear(),!1))}markNodeToRemove(e){H.push(e)}removeMarkedNodes(){this._removeNodes(H,M,0)}_removeNodes(e,t,i){if(0!==e.length&&!t.done)for(null!=this._index&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),r=this._index;1===i&&this.layerView.nodeFadeoutEnabled&&null!=r&&r.isGeometryVisible(s)?this.layerView.fadeNode(s,1,!0):this.layerView.removeNode(s),t.madeProgress()}}_needsUpdate(e){if(e.resources.isEmpty||this._updatingNodes.has(e.index))return!1;const t=this.layerView.getLoadedAttributes(e.index);return null!=t&&t!==this._requiredAttributes}async _updateLoadedNode(e){const t=new AbortController;this._updatingNodes.set(e.index,t),this._evaluateRunning();try{const i=this.layerView.getLoadedAttributes(e.index),s=j(i,this._requiredAttributes)?this.layerView.getAttributeData(e.index):await this._loadAttributes(e,this._requiredAttributes,t.signal);await this.schedule(()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:s},t.signal),t.signal)}catch(i){if(!d(i))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)}this._updatingNodes.delete(e.index),this._evaluateRunning()}_loadNode(e){if(this._loadingNodes.has(e.index))return void i.getLogger(this).error("already loading node "+e.index);const t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateRunning(),this._loadAndAddNode(e,t.signal).then(i=>{i&&null!=this._index&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())}).catch(e=>{if(!d(e))throw e}).finally(()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateRunning()})}_loadAndAddNode(e,t){return 1===e.cacheState?this._loadUncached(e,t).then(()=>!1):this._loadCached(e,t).then(t=>!t&&(e.cacheState=1,!0)).catch(t=>!d(t)&&(e.cacheState=1,!0))}_enableFromGPUCache(e,t){if(this._disableMemCache||null==this._index)return!1;if(0===t&&!this._index.useNodeAsHole(e.index))return!0;const i=this._loadCachedGPUData(e);return!!i&&(this.layerView.addCachedGPUData(e,i,t),this._nodeAdded(),!0)}_loadCachedGPUData(e){const t=this.layerView.loadCachedGPUData(e.index);return null!=t?.attributeInfo&&j(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){null!=this._index&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}updateLoadStatus(e,t){const i=this._index;null!=i&&i.updateChildrenLoaded(e,t?1:-1)}async _loadCached(e,t){if(this._enableFromGPUCache(e,1))return!0;const i=this.layerView;if(this.disableIDBCache||!i.loadCachedNodeData||!i.addCachedNodeData)return!1;const s=(t,i)=>this._nodeLoader.loadTextures(e,t,i),r=(t,i)=>this._clientNodeLoader.loadTextures(e,t,i),a=e.index>=0?s:r,d=await this.schedule(()=>i.loadCachedNodeData(e,t,a),t);if(null==d)return!1;const o=this._requiredAttributes,n=await this.reschedule(()=>this._loadAttributes(e,o,t),t);return await this.reschedule(()=>i.addCachedNodeData(e,d,{loadedAttributes:o,attributeData:n},t),t),this._nodeAdded(),!0}_loadUncached(e,t){return this._downloadingCount++,this._loadNodeData(e,t).catch(e=>{throw this._downloadingCount--,e}).then(i=>(this._downloadingCount--,this.schedule(()=>this.layerView.addNode(e,i,t),t))).then(()=>{this._nodeAdded(),e.cacheState=2}).catch(t=>{if(!d(t))throw i.getLogger(this).error("#loadNodeData()",this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,null!=this._index&&this._index.requestUpdate(),t})}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateRunning(),e&&this._index&&null!=this._index&&this._index.resetFailedNodes())}get test(){}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateRunning(),null!=this._index&&this._index.requestUpdate()}geometryFilterChanged(e){const t=this._index;null!=t&&t.layerFilterChanged(e),this._setCameraDirty()}};e([h({readOnly:!0})],Q.prototype,"isMeshPyramid",null),e([h({readOnly:!0})],Q.prototype,"isGraphics3D",null),e([h({readOnly:!0})],Q.prototype,"useMaximumNumberOfFeatures",null),e([h({readOnly:!0})],Q.prototype,"indexStreamController",null),e([h({readOnly:!0})],Q.prototype,"dataStreamController",null),e([h({readOnly:!0})],Q.prototype,"crsVertex",null),e([h({readOnly:!0})],Q.prototype,"crsIndex",null),e([h()],Q.prototype,"featureTarget",void 0),e([h()],Q.prototype,"fixedFeatureTarget",void 0),e([h()],Q.prototype,"layerView",void 0),e([h()],Q.prototype,"layer",null),e([h()],Q.prototype,"_updatingHandles",void 0),e([h()],Q.prototype,"updating",null),e([h()],Q.prototype,"running",void 0),e([h()],Q.prototype,"updatingProgress",void 0),e([h({readOnly:!0})],Q.prototype,"leavesReached",void 0),e([h({constructOnly:!0})],Q.prototype,"worker",void 0),e([h({readOnly:!0,dependsOn:[]})],Q.prototype,"rootNodeVisible",null),Q=e([u("esri.layers.graphics.controllers.I3SOnDemandController")],Q);const H=new r({deallocator:null});function j(e,t){return null!=e&&e.length===t.length&&e.every(e=>k(t,e.name)>=0)}function k(e,t){const i=t.toLowerCase();for(let s=0;s<e.length;s++)if(e[s].name.toLowerCase()===i)return s;return-1}const T={distancePenalty:10},E=g();export{Q 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 e from"../../core/Error.js";import{getDeepValue as n,setDeepValue as i}from"../../core/object.js";import{union as t}from"../../core/SetUtils.js";import{parseWhereClause as r}from"../../core/sql.js";import{getDomainRange as o}from"./domainUtils.js";import{getFieldNameFromSimpleExpression as l}from"../../support/arcadeExpressionUtils.js";import{isStringOrNull as s,isString as a}from"../../support/guards.js";import{loadArcade as u}from"../../support/loadArcade.js";const f=/^([0-9_])/,d=/[^a-z0-9_\u0080-\uffff]+/gi;function c(e){if(null==e)return null;return e.trim().replaceAll(d,"_").replace(f,"F$1")||null}const p=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],m=["field","normalizationField"];function y(e,n){if(null!=e&&null!=n)for(const i of Array.isArray(e)?e:[e])if(g(p,i,n),"visualVariables"in i&&i.visualVariables)for(const e of i.visualVariables)g(m,e,n)}function g(e,t,r){if(e)for(const o of e){const e=n(o,t),l=e&&"function"!=typeof e&&r.get(e);l&&i(o,l.name,t)}}function F(e,n){if(null!=e&&n?.fields?.length)if("startField"in e){const i=n.get(e.startField),t=n.get(e.endField);e.startField=i?.name??null,e.endField=t?.name??null}else{const i=n.get(e.startTimeField),t=n.get(e.endTimeField);e.startTimeField=i?.name??null,e.endTimeField=t?.name??null}}const I=new Set;function b(e,n){return e&&n?(I.clear(),w(I,e,n),Array.from(I).sort()):[]}function w(e,n,i){if(i)if(n?.fields?.length)if(i.includes("*"))for(const{name:t}of n.fields)e.add(t);else for(const t of i)x(e,n,t);else{if(i.includes("*"))return e.clear(),void e.add("*");for(const n of i)null!=n&&e.add(n)}}function x(e,n,i){if("string"==typeof i)if(n){const t=n.get(i);t&&e.add(t.name)}else e.add(i)}function T(e,n){return null==n||null==e?[]:n.includes("*")?(e.fields??[]).map(e=>e.name):n}function h(e,n,i=1){if(!n||!e)return[];if(n.includes("*"))return["*"];const t=b(e,n);return t.length/e.fields.length>=i?["*"]:t}async function v(e,n,i){if(!i)return;let t;const r=l(i);if(r)t=[r];else{const{arcadeUtils:e}=await u();t=e.extractFieldNames(i,n?.fields?.map(e=>e.name))}for(const o of t)x(e,n,o)}async function S(n,i,t){if(t&&"1=1"!==t){const o=await r(t,i);if(!o.isStandardized)throw new e("fieldUtils:collectFilterFields","Where clause is not standardized",{where:t});w(n,i,o.fieldNames)}}function E({displayField:e,fields:n}){return e||(n?.length?$(n,"name-or-title")||$(n,"unique-identifier")||$(n,"type-or-category")||A(n):null)}function A(e){for(const n of e){if(!n?.name)continue;const e=n.name.toLowerCase();if(e.includes("name")||e.includes("title"))return n.name}return null}function $(e,n){for(const i of e)if(i?.valueType&&i.valueType===n)return i.name;return null}async function _(e){if(!e)return[];const n=new Set;return await N(n,e),Array.from(n).sort()}async function N(e,n){if(!n)return;const i=n.elevationInfo?.featureExpressionInfo;return i?i.collectRequiredFields(e,n.fieldsIndex):void 0}function L(e,n,i){i.onStatisticExpression?v(e,n,i.onStatisticExpression.expression):e.add(i.onStatisticField)}async function M(e,n,i){if(!n||!i||!("fields"in i))return;const t=[],r=i.popupTemplate;t.push(D(e,n,r)),i.fields&&t.push(...i.fields.map(async i=>L(e,n.fieldsIndex,i))),await Promise.all(t)}async function j(e,n){const{fieldsIndex:i,trackInfo:t}=n;if(!n||!t||!i)return;const r=[t.latestObservations.renderer?.collectRequiredFields(e,i),t.previousObservations.renderer?.collectRequiredFields(e,i),t.trackLines.renderer?.collectRequiredFields(e,i)];t.popupTemplate&&r.push(D(e,n,t.popupTemplate));for(const o of[t.latestObservations.labelingInfo,t.previousObservations.labelingInfo,t.trackLines.labelingInfo])if(o)for(const n of o)r.push(Y(e,i,n));await Promise.all(r)}async function D(e,n,i){const t=[];i?.expressionInfos&&t.push(...i.expressionInfos.map(i=>v(e,n.fieldsIndex,i.expression)));const r=i?.content;if(Array.isArray(r))for(const o of r)"expression"===o.type&&o.expressionInfo&&t.push(v(e,n.fieldsIndex,o.expressionInfo.expression));await Promise.all(t)}async function O(e,n,i){n&&(n.timeInfo&&i?.timeExtent&&w(e,n.fieldsIndex,[n.timeInfo.startField,n.timeInfo.endField]),n.floorInfo&&w(e,n.fieldsIndex,[n.floorInfo.floorField]),null!=i?.where&&await S(e,n.fieldsIndex,i.where))}async function R(e,n,i){n&&i&&await Promise.all(i.map(i=>V(e,n,i)))}async function V(e,n,i){n&&i&&(i.valueExpression?await v(e,n.fieldsIndex,i.valueExpression):i.field&&x(e,n.fieldsIndex,i.field))}async function k(e){if(!e)return[];const n="timeInfo"in e&&e.timeInfo;return n?b(e.fieldsIndex,[e.trackIdField,n.startField,n.endField]):[]}function C(e){return e?b(e.fieldsIndex,G(e)):[]}function U(e){if(!e)return[];const n=e.geometryFieldsInfo;return n?b(e.fieldsIndex,[n.shapeAreaField,n.shapeLengthField]):[]}async function q(e,n,i){if(!n||!i)return;const t=n.fieldsIndex;await Promise.all(i.filters.map(n=>S(e,t,n.where)))}const X=new Set(["oid","global-id","guid"]),z=new Set(["oid","global-id"]),P=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/objectid/i,/^perimeter_/i,/_perimeter$/i,/_i$/i];function B(e){const n=new Set;J(e).forEach(e=>n.add(e)),U(e).forEach(e=>n.add(e.toLowerCase()));const i=e&&"infoFor3D"in e?e.infoFor3D:void 0;return i&&(Object.values(i.assetMapFieldRoles).forEach(e=>n.add(e.toLowerCase())),Object.values(i.transformFieldRoles).forEach(e=>n.add(e.toLowerCase()))),Array.from(n)}function G(e){if(!e)return[];const n="editFieldsInfo"in e&&e.editFieldsInfo;if(!n)return[];const{creationDateField:i,creatorField:t,editDateField:r,editorField:o}=n;return[i,t,r,o].filter(Boolean)}function J(e){return G(e).map(e=>e.toLowerCase())}function W(e,n){return e.editable&&!X.has(e.type)&&!J(n).includes(e.name?.toLowerCase()??"")}function H(e,n){const i=e.name?.toLowerCase()??"";return!(null!=n?.objectIdField&&i===n.objectIdField.toLowerCase()||null!=n?.globalIdField&&i===n.globalIdField.toLowerCase()||B(n).includes(i)||z.has(e.type)||P.some(e=>e.test(i)))}async function K(e){if(!e)return[];const n=new Set;return await Q(n,e),Array.from(n).sort()}async function Q(e,n){const{labelingInfo:i,fieldsIndex:t}=n;i?.length&&await Promise.all(i.map(n=>Y(e,t,n)))}async function Y(e,n,i){if(!i)return;const t=i.getLabelExpression(),r=i.where;if("arcade"===t.type)await v(e,n,t.expression);else{const i=t.expression.match(/{[^}]*}/g);i&&i.forEach(i=>{x(e,n,i.slice(1,-1))})}await S(e,n,r)}function Z(e){const n=e.defaultValue;return void 0!==n&&oe(e,n)?n:e.nullable?null:void 0}function ee(e){const n="string"==typeof e?{type:e}:e;return ge(n)?255:"esriFieldTypeDate"===n.type||"date"===n.type?8:void 0}function ne(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function ie(e){return null===e||ne(e)}function te(e){return null===e||Number.isInteger(e)}function re(){return!0}function oe(e,n){let i;switch(e.type){case"date":case"integer":case"long":case"small-integer":case"big-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":case"esriFieldTypeBigInteger":i=e.nullable?te:Number.isInteger;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":i=e.nullable?ie:ne;break;case"string":case"esriFieldTypeString":i=e.nullable?s:a;break;default:i=re}return 1===arguments.length?i:i(n)}const le=["integer","small-integer","big-integer","long"],se=["single","double"],ae=[...le,...se],ue=["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeLong","esriFieldTypeBigInteger"],fe=["esriFieldTypeSingle","esriFieldTypeDouble"],de=new Set([...le,...ue]),ce=new Set([...se,...fe]),pe=t(de,ce);function me(e){return null!=e&&de.has(e.type)}function ye(e){return null!=e&&pe.has(e.type)}function ge(e){return null!=e&&("string"===e.type||"esriFieldTypeString"===e.type)}function Fe(e){return null!=e&&("date"===e.type||"esriFieldTypeDate"===e.type)}function Ie(e){return null!=e&&("date-only"===e.type||"esriFieldTypeDateOnly"===e.type)}function be(e){return null!=e&&("timestamp-offset"===e.type||"esriFieldTypeTimestampOffset"===e.type)}function we(e){return null!=e&&("time-only"===e.type||"esriFieldTypeTimeOnly"===e.type)}function xe(e){return null!=e&&("oid"===e.type||"esriFieldTypeOID"===e.type)}function Te(e){return null!=e&&("global-id"===e.type||"esriFieldTypeGlobalID"===e.type)}function he(e,n){return null===Se(e,n)}function ve(e){return null==e||"number"==typeof e&&isNaN(e)?null:e}function Se(e,n){return null==e||e.nullable&&null===n?null:oe(e,n)?ye(e)&&!Ee(e.type,Number(n))?"numeric-range-validation-error::out-of-range":null:"type-validation-error::invalid-type"}function Ee(e,n){const i="string"==typeof e?$e(e):e;if(!i)return!1;const t=i.min,r=i.max;return i.isInteger?Number.isInteger(n)&&n>=t&&n<=r:n>=t&&n<=r}function Ae(e,n){const i=o(e,n);return i||(ye(e)?$e(e.type):void 0)}function $e(e){switch(e){case"esriFieldTypeSmallInteger":case"small-integer":return Ne;case"esriFieldTypeInteger":case"esriFieldTypeLong":case"integer":case"long":return Le;case"esriFieldTypeBigInteger":case"big-integer":return Me;case"esriFieldTypeSingle":case"single":return je;case"esriFieldTypeDouble":case"double":return De}}function _e(e){if(!ne(e))return null;if(Number.isInteger(e)){if(e>=Ne.min&&e<=Ne.max)return"esriFieldTypeSmallInteger";if(e>=Le.min&&e<=Le.max)return"esriFieldTypeInteger";if(e>=Me.min&&e<=Me.max)return"esriFieldTypeBigInteger"}return e>=je.min&&e<=je.max?"esriFieldTypeSingle":"esriFieldTypeDouble"}const Ne={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},Le={min:-2147483648,max:2147483647,isInteger:!0,rawMin:-2147483648,rawMax:2147483647},Me={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},je={min:-34e37,max:12e37,isInteger:!1,rawMin:-34e37,rawMax:12e37},De={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function Oe(e,n,i){switch(e){case"domain-validation-error::invalid-coded-value":return`Value ${i} is not in the coded domain - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case"domain-validation-error::value-out-of-range":return`Value ${i} is out of the range of valid values - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case"type-validation-error::invalid-type":return`Value ${i} is not a valid value for the field type - field: ${n.name}, type: ${n.type}, nullable: ${n.nullable}`;case"numeric-range-validation-error::out-of-range":{const{min:e,max:t}=$e(n.type);return`Value ${i} is out of range for the number type - field: ${n.name}, type: ${n.type}, value range is ${e} to ${t}`}}}function Re(e,n){return!Ve(e,n,null)}function Ve(e,n,i){if(!e?.attributes||!n){if(null!=i)for(const e of n??[])i.add(e);return!0}const t=new Set(Object.keys(e.attributes));let r=!1;for(const o of n)if(!t.has(o)){if(r=!0,null==i)break;i.add(o)}return r}async function ke(e,n){const i=new Set;for(const t of n)await v(i,e.fieldsIndex,t);return Array.from(i).sort()}function Ce(e){return!!e&&["raster.itempixelvalue","raster.servicepixelvalue"].some(n=>e.toLowerCase().startsWith(n))}async function Ue(e,n){const i=new Set;return e?.collectRequiredFields&&await e.collectRequiredFields(i,n),Array.from(i).sort()}function qe(e){const n=e?.match(/{[^}]+}/g);return n?n.map(e=>e.slice(1,-1).split(":")[0].trim()):[]}export{Me as bigIntegerRange,v as collectArcadeFieldNames,q as collectDisplayFilterFields,N as collectElevationFields,M as collectFeatureReductionFields,x as collectField,w as collectFields,O as collectFilterFields,Q as collectLabelingFields,R as collectOrderByInfos,D as collectPopupTemplateFields,S as collectSQLFieldNames,j as collectTrackInfoFields,De as doubleRange,qe as extractSubstitutionTemplatesFromString,Re as featureHasFields,b as fixFields,y as fixRendererFields,F as fixTimeInfoFields,fe as floatJSONTypes,se as floatTypes,E as getDisplayFieldName,G as getEditTrackingFields,_ as getElevationFields,ke as getExpressionFields,C as getFeatureEditFields,U as getFeatureGeometryFields,ee as getFieldDefaultLength,Z as getFieldDefaultValue,Ae as getFieldRange,K as getLabelingFields,B as getLowerCaseDefaultHiddenFields,J as getLowerCaseEditTrackingFields,_e as getNumericTypeForValue,Ue as getRendererFields,k as getTimeFields,ue as integerJSONTypes,Le as integerRange,le as integerTypes,Fe as isDateField,Ie as isDateOnlyField,W as isFieldEditable,H as isFieldVisibleByDefault,Te as isGlobalIDField,me as isIntegerField,Ee as isNumberInRange,ye as isNumericField,xe as isObjectIDField,Ce as isRasterPixelValueField,ge as isStringField,we as isTimeOnlyField,be as isTimestampOffsetField,he as isValidFieldValue,oe as isValueMatchingFieldType,c as normalizeFieldName,ae as numericTypes,h as packFields,Ve as populateMissingFields,p as rendererFields,ve as sanitizeNullFieldValue,je as singleRange,Ne as smallIntegerRange,T as unpackFieldNames,Se as validateFieldValue,Oe as validationErrorToString,m as visualVariableFields};
5
+ import e from"../../core/Error.js";import{getDeepValue as n,setDeepValue as i}from"../../core/object.js";import{union as t}from"../../core/SetUtils.js";import{parseWhereClause as r}from"../../core/sql.js";import{getDomainRange as l}from"./domainUtils.js";import{getFieldNameFromSimpleExpression as o}from"../../support/arcadeExpressionUtils.js";import{isStringOrNull as s,isString as a}from"../../support/guards.js";import{loadArcade as u}from"../../support/loadArcade.js";const f=/^([0-9_])/,d=/[^a-z0-9_\u0080-\uffff]+/gi;function c(e){if(null==e)return null;return e.trim().replaceAll(d,"_").replace(f,"F$1")||null}const p=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],m=["field","normalizationField"];function y(e,n){if(null!=e&&null!=n)for(const i of Array.isArray(e)?e:[e])if(g(p,i,n),"visualVariables"in i&&i.visualVariables)for(const e of i.visualVariables)g(m,e,n)}function g(e,t,r){if(e)for(const l of e){const e=n(l,t),o=e&&"function"!=typeof e&&r.get(e);o&&i(l,o.name,t)}}function F(e,n){if(null!=e&&n?.fields?.length)if("startField"in e){const i=n.get(e.startField),t=n.get(e.endField);e.startField=i?.name??null,e.endField=t?.name??null}else{const i=n.get(e.startTimeField),t=n.get(e.endTimeField);e.startTimeField=i?.name??null,e.endTimeField=t?.name??null}}const I=new Set;function b(e,n){return e&&n?(I.clear(),w(I,e,n),Array.from(I).sort()):[]}function w(e,n,i){if(i)if(n?.fields?.length)if(i.includes("*"))for(const{name:t}of n.fields)e.add(t);else for(const t of i)x(e,n,t);else{if(i.includes("*"))return e.clear(),void e.add("*");for(const n of i)null!=n&&e.add(n)}}function x(e,n,i){if("string"==typeof i)if(n){const t=n.get(i);t&&e.add(t.name)}else e.add(i)}function T(e,n){return null==n||null==e?[]:n.includes("*")?(e.fields??[]).map(e=>e.name):n}function h(e,n,i=1){if(!n||!e)return[];if(n.includes("*"))return["*"];const t=b(e,n);return t.length/e.fields.length>=i?["*"]:t}async function v(e,n,i,t){if(!t)return;const r=o(t);if(r)x(e,n,r);else{const{arcadeUtils:r}=await u(),l=r.extractFieldNames(t,i?.partitions??n?.fields?.map(e=>e.name));for(const t of l)x(e,i?.index??n,t)}}async function S(n,i,t){if(t&&"1=1"!==t){const l=await r(t,i);if(!l.isStandardized)throw new e("fieldUtils:collectFilterFields","Where clause is not standardized",{where:t});w(n,i,l.fieldNames)}}function E({displayField:e,fields:n}){return e||(n?.length?$(n,"name-or-title")||$(n,"unique-identifier")||$(n,"type-or-category")||A(n):null)}function A(e){for(const n of e){if(!n?.name)continue;const e=n.name.toLowerCase();if(e.includes("name")||e.includes("title"))return n.name}return null}function $(e,n){for(const i of e)if(i?.valueType&&i.valueType===n)return i.name;return null}async function _(e){if(!e)return[];const n=new Set;return await N(n,e),Array.from(n).sort()}async function N(e,n){if(!n)return;const i=n.elevationInfo?.featureExpressionInfo;return i?i.collectRequiredFields(e,n.fieldsIndex):void 0}function L(e,n,i){i.onStatisticExpression?v(e,n,null,i.onStatisticExpression.expression):e.add(i.onStatisticField)}async function M(e,n,i){if(!n||!i||!("fields"in i))return;const t=[],r=i.popupTemplate;t.push(D(e,n,r)),i.fields&&t.push(...i.fields.map(async i=>L(e,n.fieldsIndex,i))),await Promise.all(t)}async function j(e,n){const{fieldsIndex:i,trackInfo:t}=n;if(!n||!t||!i)return;const r=[t.latestObservations.renderer?.collectRequiredFields(e,i),t.previousObservations.renderer?.collectRequiredFields(e,i),t.trackLines.renderer?.collectRequiredFields(e,i)];t.popupTemplate&&r.push(D(e,n,t.popupTemplate));for(const l of[t.latestObservations.labelingInfo,t.previousObservations.labelingInfo,t.trackLines.labelingInfo])if(l)for(const n of l)r.push(Y(e,i,n));await Promise.all(r)}async function D(e,n,i){const t=[];i?.expressionInfos&&t.push(...i.expressionInfos.map(i=>v(e,n.fieldsIndex,null,i.expression)));const r=i?.content;if(Array.isArray(r))for(const l of r)"expression"===l.type&&l.expressionInfo&&t.push(v(e,n.fieldsIndex,null,l.expressionInfo.expression));await Promise.all(t)}async function O(e,n,i){n&&(n.timeInfo&&i?.timeExtent&&w(e,n.fieldsIndex,[n.timeInfo.startField,n.timeInfo.endField]),n.floorInfo&&w(e,n.fieldsIndex,[n.floorInfo.floorField]),null!=i?.where&&await S(e,n.fieldsIndex,i.where))}async function R(e,n,i){n&&i&&await Promise.all(i.map(i=>V(e,n,i)))}async function V(e,n,i){n&&i&&(i.valueExpression?await v(e,n.fieldsIndex,null,i.valueExpression):i.field&&x(e,n.fieldsIndex,i.field))}async function k(e){if(!e)return[];const n="timeInfo"in e&&e.timeInfo;return n?b(e.fieldsIndex,[e.trackIdField,n.startField,n.endField]):[]}function C(e){return e?b(e.fieldsIndex,G(e)):[]}function U(e){if(!e)return[];const n=e.geometryFieldsInfo;return n?b(e.fieldsIndex,[n.shapeAreaField,n.shapeLengthField]):[]}async function q(e,n,i){if(!n||!i)return;const t=n.fieldsIndex;await Promise.all(i.filters.map(n=>S(e,t,n.where)))}const X=new Set(["oid","global-id","guid"]),z=new Set(["oid","global-id"]),P=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/objectid/i,/^perimeter_/i,/_perimeter$/i,/_i$/i];function B(e){const n=new Set;J(e).forEach(e=>n.add(e)),U(e).forEach(e=>n.add(e.toLowerCase()));const i=e&&"infoFor3D"in e?e.infoFor3D:void 0;return i&&(Object.values(i.assetMapFieldRoles).forEach(e=>n.add(e.toLowerCase())),Object.values(i.transformFieldRoles).forEach(e=>n.add(e.toLowerCase()))),Array.from(n)}function G(e){if(!e)return[];const n="editFieldsInfo"in e&&e.editFieldsInfo;if(!n)return[];const{creationDateField:i,creatorField:t,editDateField:r,editorField:l}=n;return[i,t,r,l].filter(Boolean)}function J(e){return G(e).map(e=>e.toLowerCase())}function W(e,n){return e.editable&&!X.has(e.type)&&!J(n).includes(e.name?.toLowerCase()??"")}function H(e,n){const i=e.name?.toLowerCase()??"";return!(null!=n?.objectIdField&&i===n.objectIdField.toLowerCase()||null!=n?.globalIdField&&i===n.globalIdField.toLowerCase()||B(n).includes(i)||z.has(e.type)||P.some(e=>e.test(i)))}async function K(e){if(!e)return[];const n=new Set;return await Q(n,e),Array.from(n).sort()}async function Q(e,n){const{labelingInfo:i,fieldsIndex:t}=n;i?.length&&await Promise.all(i.map(n=>Y(e,t,n)))}async function Y(e,n,i){if(!i)return;const t=i.getLabelExpression(),r=i.where;if("arcade"===t.type)await v(e,n,null,t.expression);else{const i=t.expression.match(/{[^}]*}/g);i&&i.forEach(i=>{x(e,n,i.slice(1,-1))})}await S(e,n,r)}function Z(e){const n=e.defaultValue;return void 0!==n&&le(e,n)?n:e.nullable?null:void 0}function ee(e){const n="string"==typeof e?{type:e}:e;return ge(n)?255:"esriFieldTypeDate"===n.type||"date"===n.type?8:void 0}function ne(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function ie(e){return null===e||ne(e)}function te(e){return null===e||Number.isInteger(e)}function re(){return!0}function le(e,n){let i;switch(e.type){case"date":case"integer":case"long":case"small-integer":case"big-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":case"esriFieldTypeBigInteger":i=e.nullable?te:Number.isInteger;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":i=e.nullable?ie:ne;break;case"string":case"esriFieldTypeString":i=e.nullable?s:a;break;default:i=re}return 1===arguments.length?i:i(n)}const oe=["integer","small-integer","big-integer","long"],se=["single","double"],ae=[...oe,...se],ue=["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeLong","esriFieldTypeBigInteger"],fe=["esriFieldTypeSingle","esriFieldTypeDouble"],de=new Set([...oe,...ue]),ce=new Set([...se,...fe]),pe=t(de,ce);function me(e){return null!=e&&de.has(e.type)}function ye(e){return null!=e&&pe.has(e.type)}function ge(e){return null!=e&&("string"===e.type||"esriFieldTypeString"===e.type)}function Fe(e){return null!=e&&("date"===e.type||"esriFieldTypeDate"===e.type)}function Ie(e){return null!=e&&("date-only"===e.type||"esriFieldTypeDateOnly"===e.type)}function be(e){return null!=e&&("timestamp-offset"===e.type||"esriFieldTypeTimestampOffset"===e.type)}function we(e){return null!=e&&("time-only"===e.type||"esriFieldTypeTimeOnly"===e.type)}function xe(e){return null!=e&&("oid"===e.type||"esriFieldTypeOID"===e.type)}function Te(e){return null!=e&&("global-id"===e.type||"esriFieldTypeGlobalID"===e.type)}function he(e,n){return null===Se(e,n)}function ve(e){return null==e||"number"==typeof e&&isNaN(e)?null:e}function Se(e,n){return null==e||e.nullable&&null===n?null:le(e,n)?ye(e)&&!Ee(e.type,Number(n))?"numeric-range-validation-error::out-of-range":null:"type-validation-error::invalid-type"}function Ee(e,n){const i="string"==typeof e?$e(e):e;if(!i)return!1;const t=i.min,r=i.max;return i.isInteger?Number.isInteger(n)&&n>=t&&n<=r:n>=t&&n<=r}function Ae(e,n){const i=l(e,n);return i||(ye(e)?$e(e.type):void 0)}function $e(e){switch(e){case"esriFieldTypeSmallInteger":case"small-integer":return Ne;case"esriFieldTypeInteger":case"esriFieldTypeLong":case"integer":case"long":return Le;case"esriFieldTypeBigInteger":case"big-integer":return Me;case"esriFieldTypeSingle":case"single":return je;case"esriFieldTypeDouble":case"double":return De}}function _e(e){if(!ne(e))return null;if(Number.isInteger(e)){if(e>=Ne.min&&e<=Ne.max)return"esriFieldTypeSmallInteger";if(e>=Le.min&&e<=Le.max)return"esriFieldTypeInteger";if(e>=Me.min&&e<=Me.max)return"esriFieldTypeBigInteger"}return e>=je.min&&e<=je.max?"esriFieldTypeSingle":"esriFieldTypeDouble"}const Ne={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},Le={min:-2147483648,max:2147483647,isInteger:!0,rawMin:-2147483648,rawMax:2147483647},Me={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},je={min:-34e37,max:12e37,isInteger:!1,rawMin:-34e37,rawMax:12e37},De={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function Oe(e,n,i){switch(e){case"domain-validation-error::invalid-coded-value":return`Value ${i} is not in the coded domain - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case"domain-validation-error::value-out-of-range":return`Value ${i} is out of the range of valid values - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case"type-validation-error::invalid-type":return`Value ${i} is not a valid value for the field type - field: ${n.name}, type: ${n.type}, nullable: ${n.nullable}`;case"numeric-range-validation-error::out-of-range":{const{min:e,max:t}=$e(n.type);return`Value ${i} is out of range for the number type - field: ${n.name}, type: ${n.type}, value range is ${e} to ${t}`}}}function Re(e,n){return!Ve(e,n,null)}function Ve(e,n,i){if(!e?.attributes||!n){if(null!=i)for(const e of n??[])i.add(e);return!0}const t=new Set(Object.keys(e.attributes));let r=!1;for(const l of n)if(!t.has(l)){if(r=!0,null==i)break;i.add(l)}return r}async function ke(e,n){const i=new Set;for(const t of n)await v(i,e.fieldsIndex,null,t);return Array.from(i).sort()}function Ce(e){return!!e&&["raster.itempixelvalue","raster.servicepixelvalue"].some(n=>e.toLowerCase().startsWith(n))}async function Ue(e,n){const i=new Set;return e?.collectRequiredFields&&await e.collectRequiredFields(i,n),Array.from(i).sort()}function qe(e){const n=e?.match(/{[^}]+}/g);return n?n.map(e=>e.slice(1,-1).split(":")[0].trim()):[]}export{Me as bigIntegerRange,v as collectArcadeFieldNames,q as collectDisplayFilterFields,N as collectElevationFields,M as collectFeatureReductionFields,x as collectField,w as collectFields,O as collectFilterFields,Q as collectLabelingFields,R as collectOrderByInfos,D as collectPopupTemplateFields,S as collectSQLFieldNames,j as collectTrackInfoFields,De as doubleRange,qe as extractSubstitutionTemplatesFromString,Re as featureHasFields,b as fixFields,y as fixRendererFields,F as fixTimeInfoFields,fe as floatJSONTypes,se as floatTypes,E as getDisplayFieldName,G as getEditTrackingFields,_ as getElevationFields,ke as getExpressionFields,C as getFeatureEditFields,U as getFeatureGeometryFields,ee as getFieldDefaultLength,Z as getFieldDefaultValue,Ae as getFieldRange,K as getLabelingFields,B as getLowerCaseDefaultHiddenFields,J as getLowerCaseEditTrackingFields,_e as getNumericTypeForValue,Ue as getRendererFields,k as getTimeFields,ue as integerJSONTypes,Le as integerRange,oe as integerTypes,Fe as isDateField,Ie as isDateOnlyField,W as isFieldEditable,H as isFieldVisibleByDefault,Te as isGlobalIDField,me as isIntegerField,Ee as isNumberInRange,ye as isNumericField,xe as isObjectIDField,Ce as isRasterPixelValueField,ge as isStringField,we as isTimeOnlyField,be as isTimestampOffsetField,he as isValidFieldValue,le as isValueMatchingFieldType,c as normalizeFieldName,ae as numericTypes,h as packFields,Ve as populateMissingFields,p as rendererFields,ve as sanitizeNullFieldValue,je as singleRange,Ne as smallIntegerRange,T as unpackFieldNames,Se as validateFieldValue,Oe as validationErrorToString,m as visualVariableFields};
@@ -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{rad2deg as e}from"../../core/mathUtils.js";import{d as r,f as o,t as n,c as t,A as s,z as i,a as m}from"../../chunks/vec32.js";import{fromValues as a,create as f}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{WGS84ECEFSpatialReferenceLike as x}from"../../geometry/ellipsoidUtils.js";import c from"../../geometry/Extent.js";import u from"../../geometry/SpatialReference.js";import{projectBuffer as l}from"../../geometry/projection/projectBuffer.js";function p(e,r){if(!Array.isArray(e)||e.length<r)return!1;for(const o of e)if("number"!=typeof o)return!1;return!0}const b=7645211,y={xmin:-180,ymin:-90,zmin:-450,xmax:180,ymax:90,zmax:8850};function A(A){let E=new u({wkid:4326,vcsWkid:115700}),g=A.root?.boundingVolume,_=!1,w=A?.root?.transform;if((A.extensions?.ESRI_crs?.wkid||A.extensions?.ESRI_crs?.latestWkid||A.extensions?.ESRI_crs?.wkt)&&(A.root?.extensions?.ESRI_crs?.boundingVolume?.box||A.root?.extensions?.ESRI_crs?.boundingVolume?.sphere))E=new u(A.extensions?.ESRI_crs),g=A.root?.extensions?.ESRI_crs?.boundingVolume,w=A.root?.transform,_=!0;else if(!g)return new c(-180,-90,180,90,E);if(g.box){const e=g?.box;if(e[3]>b&&e[7]>b&&e[11]>b)return new c({...y,sr:E})}const R=f();if(!_&&g.region&&p(g.region,6)){const r=g.region,o=e(r[0]),n=e(r[1]),t=r[4],s=e(r[2]),i=e(r[3]),m=r[5];return new c({xmin:o,ymin:n,zmin:t,xmax:s,ymax:i,zmax:m,spatialReference:E})}if(g.sphere&&p(g.sphere,4)){const e=g.sphere,m=a(e[0],e[1],e[2]),b=e[3]/Math.sqrt(3),y=f();r(y,m,a(b,b,b));const A=f();if(o(A,m,a(b,b,b)),w&&p(w,16)){const e=w;n(R,y,e),t(y,R),n(R,A,e),t(A,R)}_||(l(y,x,0,y,u.WGS84,0),l(A,x,0,A,u.WGS84,0));const S=f(),d=f();return s(S,y,A),i(d,y,A),new c({xmin:S[0],ymin:S[1],zmin:S[2],xmax:d[0],ymax:d[1],zmax:d[2],spatialReference:E})}if(g.box&&p(g.box,12)){const e=g.box,r=a(e[0],e[1],e[2]),t=a(e[3],e[4],e[5]),b=a(e[6],e[7],e[8]),y=a(e[9],e[10],e[11]),A=[];for(let o=0;o<8;++o)A.push(f());if(o(A[0],r,t),o(A[0],A[0],b),o(A[0],A[0],y),m(A[1],r,t),o(A[1],A[1],b),o(A[1],A[1],y),o(A[2],r,t),m(A[2],A[2],b),o(A[2],A[2],y),m(A[3],r,t),m(A[3],A[3],b),o(A[3],A[3],y),o(A[4],r,t),o(A[4],A[4],b),m(A[4],A[4],y),m(A[5],r,t),o(A[5],A[5],b),m(A[5],A[5],y),o(A[6],r,t),m(A[6],A[6],b),m(A[6],A[6],y),m(A[7],r,t),m(A[7],A[7],b),m(A[7],A[7],y),w&&p(w,16)){const e=w;for(let r=0;r<8;++r)n(A[r],A[r],e)}const R=a(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),S=a(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let o=0;o<8;++o)_||l(A[o],x,0,A[o],u.WGS84,0),s(S,S,A[o]),i(R,R,A[o]);return new c({xmin:S[0],ymin:S[1],zmin:S[2],xmax:R[0],ymax:R[1],zmax:R[2],spatialReference:E})}return new c(-180,-90,180,90,E)}export{A as initFullExtent,p as verifyArray};
5
+ import{rad2deg as e}from"../../core/mathUtils.js";import{d as t,f as r,t as n,c as o,A as i,z as s,a as m}from"../../chunks/vec32.js";import{fromValues as a,create as c}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{WGS84ECEFSpatialReferenceLike as f}from"../../geometry/ellipsoidUtils.js";import l from"../../geometry/Extent.js";import x from"../../geometry/HeightModelInfo.js";import u from"../../geometry/SpatialReference.js";import{projectBuffer as h}from"../../geometry/projection/projectBuffer.js";function g(e,t){if(!Array.isArray(e)||e.length<t)return!1;for(const r of e)if("number"!=typeof r)return!1;return!0}const d=7645211,p={xmin:-180,ymin:-90,zmin:-450,xmax:180,ymax:90,zmax:8850},E=new Map([[5773,new x({heightModel:"gravity-related-height",heightUnit:"meters",vertCRS:"EGM96_Geoid"})],[3855,new x({heightModel:"gravity-related-height",heightUnit:"meters",vertCRS:"EGM2008_Geoid"})],[115700,new x({heightModel:"ellipsoidal",heightUnit:"meters",vertCRS:"WGS_1984"})],[115701,new x({heightModel:"ellipsoidal",heightUnit:"meters",vertCRS:"ETRS_1989"})]]);function R(e){if(!e)return null;const t=e.vcsWkid||e.latestVcsWkid;return t?E.get(t):null}function S(e){return!(!(e.extensions?.ESRI_crs?.wkid||e.extensions?.ESRI_crs?.latestWkid||e.extensions?.ESRI_crs?.wkt)||!e.root?.extensions?.ESRI_crs?.boundingVolume?.box&&!e.root?.extensions?.ESRI_crs?.boundingVolume?.sphere)}function _(x,E=!1){let R=new u({wkid:4326,vcsWkid:115700}),S=x.root?.boundingVolume,_=!1,b=x?.root?.transform;if(E&&(x.extensions?.ESRI_crs?.wkid||x.extensions?.ESRI_crs?.latestWkid||x.extensions?.ESRI_crs?.wkt)&&(x.root?.extensions?.ESRI_crs?.boundingVolume?.box||x.root?.extensions?.ESRI_crs?.boundingVolume?.sphere))R=new u(x.extensions?.ESRI_crs),S=x.root?.extensions?.ESRI_crs?.boundingVolume,b=x.root?.transform,_=!0;else if(!S)return new l(-180,-90,180,90,R);if(S.box){const e=S?.box;if(e[3]>d&&e[7]>d&&e[11]>d)return new l({...p,spatialReference:R})}const w=c();if(!_&&S.region&&g(S.region,6)){const t=S.region,r=e(t[0]),n=e(t[1]),o=t[4],i=e(t[2]),s=e(t[3]),m=t[5];return new l({xmin:r,ymin:n,zmin:o,xmax:i,ymax:s,zmax:m,spatialReference:R})}if(S.sphere&&g(S.sphere,4)){const e=S.sphere,m=a(e[0],e[1],e[2]),x=e[3]/Math.sqrt(3),d=c();t(d,m,a(x,x,x));const p=c();if(r(p,m,a(x,x,x)),b&&g(b,16)){const e=b;n(w,d,e),o(d,w),n(w,p,e),o(p,w)}_||(h(d,f,0,d,u.WGS84,0),h(p,f,0,p,u.WGS84,0));const E=c(),y=c();return i(E,d,p),s(y,d,p),new l({xmin:E[0],ymin:E[1],zmin:E[2],xmax:y[0],ymax:y[1],zmax:y[2],spatialReference:R})}if(S.box&&g(S.box,12)){const e=S.box,t=a(e[0],e[1],e[2]),o=a(e[3],e[4],e[5]),x=a(e[6],e[7],e[8]),d=a(e[9],e[10],e[11]),p=[];for(let r=0;r<8;++r)p.push(c());if(r(p[0],t,o),r(p[0],p[0],x),r(p[0],p[0],d),m(p[1],t,o),r(p[1],p[1],x),r(p[1],p[1],d),r(p[2],t,o),m(p[2],p[2],x),r(p[2],p[2],d),m(p[3],t,o),m(p[3],p[3],x),r(p[3],p[3],d),r(p[4],t,o),r(p[4],p[4],x),m(p[4],p[4],d),m(p[5],t,o),r(p[5],p[5],x),m(p[5],p[5],d),r(p[6],t,o),m(p[6],p[6],x),m(p[6],p[6],d),m(p[7],t,o),m(p[7],p[7],x),m(p[7],p[7],d),b&&g(b,16)){const e=b;for(let t=0;t<8;++t)n(p[t],p[t],e)}const E=a(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),w=a(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let r=0;r<8;++r)_||h(p[r],f,0,p[r],u.WGS84,0),i(w,w,p[r]),s(E,E,p[r]);return new l({xmin:w[0],ymin:w[1],zmin:w[2],xmax:E[0],ymax:E[1],zmax:E[2],spatialReference:R})}return new l(-180,-90,180,90,R)}export{R as getHeightModelInfoFromVCS,S as hasEsriCrs,_ as initFullExtent,g as verifyArray};
@@ -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/Error.js";import{JSONSupport as r}from"../core/JSONSupport.js";import{property as i}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{emitApplyEditsEvent as o}from"../layers/mixins/EditBusLayer.js";import a from"./UtilityNetwork.js";import{isVersionInEditSession as n,currentSessionId as c,isSafeToEditVersion as d}from"../versionManagement/support/versionManagementUtils.js";let u=class extends r{constructor(e){super(e),this.telecomDomainNetwork=null,this.utilityNetwork=null}get networkServiceUrl(){return this.utilityNetwork?.networkServiceUrl??null}get featureServiceUrl(){return this.utilityNetwork?.featureServiceUrl??null}get gdbVersion(){return this.utilityNetwork?.gdbVersion??null}get historicMoment(){return this.utilityNetwork?.historicMoment??null}get telecomDomainNetworkName(){return this.telecomDomainNetwork?.domainNetworkName??null}async create(e){const[{createCircuit:t},{default:r}]=await Promise.all([import("../rest/networks/circuits/createCircuit.js"),import("../rest/networks/circuits/support/CreateAlterCircuitParameters.js")]),i=r.from({circuit:e,domainNetworkName:this.telecomDomainNetworkName});n(this.featureServiceUrl,this.gdbVersion||null)?(i.sessionId=c,await d(this.featureServiceUrl,this.gdbVersion,!0)):i.sessionId=null,i.gdbVersion=this.gdbVersion;const s=o(this.featureServiceUrl,null,this.gdbVersion,!1),a=await t(this.networkServiceUrl,i);s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:a.exceededTransferLimit,historicMoment:a.moment,editedFeatures:a.serviceEdits||void 0})}async alter(e){if(null==e.globalId)throw new t("circuit-manager:alter-without-globalid","A circuit being altered must have a globalId","To ensure the circuit has a globalId, query the circuit first");const[{alterCircuit:r},{default:i}]=await Promise.all([import("../rest/networks/circuits/alterCircuit.js"),import("../rest/networks/circuits/support/CreateAlterCircuitParameters.js")]),s=i.from({circuit:e,domainNetworkName:this.telecomDomainNetworkName});n(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=c,await d(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.gdbVersion=this.gdbVersion;const a=o(this.featureServiceUrl,null,this.gdbVersion,!1),u=await r(this.networkServiceUrl,s);a.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:u.exceededTransferLimit,historicMoment:u.moment,editedFeatures:u.serviceEdits||void 0})}async delete(e){const[{deleteCircuits:t},{default:r}]=await Promise.all([import("../rest/networks/circuits/deleteCircuits.js"),import("../rest/networks/circuits/support/DeleteCircuitsParameters.js")]),i=r.from({circuits:e,domainNetworkName:this.telecomDomainNetworkName});n(this.featureServiceUrl,this.gdbVersion||null)?(i.sessionId=c,await d(this.featureServiceUrl,this.gdbVersion,!0)):i.sessionId=null,i.gdbVersion=this.gdbVersion;const s=o(this.featureServiceUrl,null,this.gdbVersion,!1),a=await t(this.networkServiceUrl,i);s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:a.exceededTransferLimit,historicMoment:a.moment,editedFeatures:a.serviceEdits||void 0})}async export(e){const[{exportCircuits:t},{default:r}]=await Promise.all([import("../rest/networks/circuits/exportCircuits.js"),import("../rest/networks/circuits/support/ExportCircuitsParameters.js")]),i=r.from(e);n(this.featureServiceUrl,this.gdbVersion||null)?(i.sessionId=c,await d(this.featureServiceUrl,this.gdbVersion,!0)):i.sessionId=null,i.domainNetworkName=this.telecomDomainNetworkName,i.gdbVersion=this.gdbVersion,i.moment=this.historicMoment;const s=o(this.featureServiceUrl,null,this.gdbVersion,!1),a=await t(this.networkServiceUrl,i);return s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:a.exceededTransferLimit,historicMoment:a.moment,editedFeatures:a.serviceEdits||void 0}),a.circuits}async verify(e,t=!1){const[{verifyCircuits:r},{default:i}]=await Promise.all([import("../rest/networks/circuits/verifyCircuits.js"),import("../rest/networks/circuits/support/VerifyCircuitsParameters.js")]),s=i.from({circuits:e,synthesizeGeometries:t,domainNetworkName:this.telecomDomainNetworkName});n(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=c,await d(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.gdbVersion=this.gdbVersion;const a=o(this.featureServiceUrl,null,this.gdbVersion,!1),u=await r(this.networkServiceUrl,s);return a.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:u.exceededTransferLimit,historicMoment:u.moment,editedFeatures:u.serviceEdits||void 0}),u.circuits}async queryCircuits(e){const[{queryCircuits:t},{default:r}]=await Promise.all([import("../rest/networks/circuits/queryCircuits.js"),import("../rest/networks/circuits/support/QueryCircuitsParameters.js")]),i=Array.isArray(e)?{circuits:e}:e,s=r.from(i);n(this.featureServiceUrl,this.gdbVersion||null)?s.sessionId=c:s.sessionId=null,s.domainNetworkName=this.telecomDomainNetworkName,s.resultTypes=["circuit"],s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;return(await t(this.networkServiceUrl,s)).circuits||[]}async queryCircuitNames(e){const[{queryCircuits:t},{default:r}]=await Promise.all([import("../rest/networks/circuits/queryCircuits.js"),import("../rest/networks/circuits/support/QueryCircuitsParameters.js")]),i=r.from(e);n(this.featureServiceUrl,this.gdbVersion||null)?i.sessionId=c:i.sessionId=null,i.domainNetworkName=this.telecomDomainNetworkName,i.resultTypes=["name"],i.gdbVersion=this.gdbVersion,i.moment=this.historicMoment;return(await t(this.networkServiceUrl,i)).circuitNames||[]}};e([i({constructOnly:!0})],u.prototype,"telecomDomainNetwork",void 0),e([i({type:a,constructOnly:!0})],u.prototype,"utilityNetwork",void 0),e([i()],u.prototype,"networkServiceUrl",null),e([i()],u.prototype,"featureServiceUrl",null),e([i()],u.prototype,"gdbVersion",null),e([i()],u.prototype,"historicMoment",null),e([i()],u.prototype,"telecomDomainNetworkName",null),u=e([s("esri.networks.CircuitManager")],u);const l=u;export{l as default};
5
+ import{__decorate as e}from"tslib";import t from"../core/Error.js";import{JSONSupport as i}from"../core/JSONSupport.js";import{watch as r}from"../core/reactiveUtils.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 o}from"../core/accessorSupport/decorators/subclass.js";import c from"../layers/FeatureLayer.js";import{emitApplyEditsEvent as n}from"../layers/mixins/EditBusLayer.js";import a from"./UtilityNetwork.js";import l from"./support/Circuit.js";import{isVersionInEditSession as u,currentSessionId as d,isSafeToEditVersion as m}from"../versionManagement/support/versionManagementUtils.js";let h=class extends i{constructor(e){super(e),this._circuitTable=null,this._circuitSectionTable=null,this._subcircuitTable=null,this.telecomDomainNetwork=null,this.utilityNetwork=null}initialize(){this.addHandles([r(()=>[this.gdbVersion,this.historicMoment],()=>{this._setLayerVersionAndMoment(this._circuitTable),this._setLayerVersionAndMoment(this._circuitSectionTable),this._setLayerVersionAndMoment(this._subcircuitTable)})])}get _circuitTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTCircuit"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get _circuitSectionTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTCircuitSection"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get _subcircuitTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTSubcircuit"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get networkServiceUrl(){return this.utilityNetwork?.networkServiceUrl??null}get featureServiceUrl(){return this.utilityNetwork?.featureServiceUrl??null}get gdbVersion(){return this.utilityNetwork?.gdbVersion??null}get historicMoment(){return this.utilityNetwork?.historicMoment??null}get telecomDomainNetworkName(){return this.telecomDomainNetwork?.domainNetworkName??null}get circuitTable(){if(null!=this._circuitTable)return this._circuitTable;if(null==this._circuitTableUrl)throw new t("circuit-manager:missing-circuit-table-url","Unable to load the circuit table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._circuitTable=new c({url:this._circuitTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._circuitTable}get circuitSectionTable(){if(null!=this._circuitSectionTable)return this._circuitSectionTable;if(null==this._circuitSectionTableUrl)throw new t("circuit-manager:missing-circuit-section-table-url","Unable to load the circuit section table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._circuitSectionTable=new c({url:this._circuitSectionTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._circuitSectionTable}get subcircuitTable(){if(null!=this._subcircuitTable)return this._subcircuitTable;if(null==this._subcircuitTableUrl)throw new t("circuit-manager:missing-subcircuit-table-url","Unable to load the subcircuit table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._subcircuitTable=new c({url:this._subcircuitTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._subcircuitTable}async loadCircuitTable(){return this.circuitTable.load()}async loadCircuitSectionTable(){return this.circuitSectionTable.load()}async loadSubcircuitTable(){return this.subcircuitTable.load()}getCircuit(e,t=!1){return new l({circuitManager:this,name:e,sections:t?new Map:null})}async create(e){const[{createCircuit:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/createCircuit.js"),import("../rest/networks/circuits/support/CreateAlterCircuitParameters.js")]),r=i.from({circuit:e,domainNetworkName:this.telecomDomainNetworkName});u(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.gdbVersion=this.gdbVersion;const s=n(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);e.circuitManager=this,s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0})}async alter(e){if(null==e.globalId)throw new t("circuit-manager:alter-without-globalid","A circuit being altered must have a globalId","To ensure the circuit has a globalId, query the circuit first");const[{alterCircuit:i},{default:r}]=await Promise.all([import("../rest/networks/circuits/alterCircuit.js"),import("../rest/networks/circuits/support/CreateAlterCircuitParameters.js")]),s=r.from({circuit:e,domainNetworkName:this.telecomDomainNetworkName});u(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.gdbVersion=this.gdbVersion;const o=n(this.featureServiceUrl,null,this.gdbVersion,!1),c=await i(this.networkServiceUrl,s);e.circuitManager=this,o.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:c.exceededTransferLimit,historicMoment:c.moment,editedFeatures:c.serviceEdits||void 0})}async delete(e){const[{deleteCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/deleteCircuits.js"),import("../rest/networks/circuits/support/DeleteCircuitsParameters.js")]),r=i.from({circuits:e,domainNetworkName:this.telecomDomainNetworkName});u(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.gdbVersion=this.gdbVersion;const s=n(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0})}async export(e){const[{exportCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/exportCircuits.js"),import("../rest/networks/circuits/support/ExportCircuitsParameters.js")]),r=i.from(e);u(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.domainNetworkName=this.telecomDomainNetworkName,r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment;const s=n(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);return s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0}),o.circuits}async verify(e,t=!1){const[{verifyCircuits:i},{default:r}]=await Promise.all([import("../rest/networks/circuits/verifyCircuits.js"),import("../rest/networks/circuits/support/VerifyCircuitsParameters.js")]),s=r.from({circuits:e,synthesizeGeometries:t,domainNetworkName:this.telecomDomainNetworkName});u(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.gdbVersion=this.gdbVersion;const o=n(this.featureServiceUrl,null,this.gdbVersion,!1),c=await i(this.networkServiceUrl,s);return o.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:c.exceededTransferLimit,historicMoment:c.moment,editedFeatures:c.serviceEdits||void 0}),c.circuits}async queryCircuits(e){const[{queryCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/queryCircuits.js"),import("../rest/networks/circuits/support/QueryCircuitsParameters.js")]),r=Array.isArray(e)?{circuits:e}:e,s=i.from(r);u(this.featureServiceUrl,this.gdbVersion||null)?s.sessionId=d:s.sessionId=null,s.domainNetworkName=this.telecomDomainNetworkName,s.resultTypes=["circuit"],s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=await t(this.networkServiceUrl,s);return o.circuits?.forEach(e=>e.circuitManager=this),o.circuits||[]}async queryCircuitNames(e){const[{queryCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/queryCircuits.js"),import("../rest/networks/circuits/support/QueryCircuitsParameters.js")]),r=i.from(e);u(this.featureServiceUrl,this.gdbVersion||null)?r.sessionId=d:r.sessionId=null,r.domainNetworkName=this.telecomDomainNetworkName,r.resultTypes=["name"],r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment;return(await t(this.networkServiceUrl,r)).circuitNames||[]}_setLayerVersionAndMoment(e){null!=e&&(e.gdbVersion!==this.gdbVersion&&(e.gdbVersion=this.gdbVersion),e.historicMoment!==this.historicMoment&&(e.historicMoment=this.historicMoment))}};e([s()],h.prototype,"_circuitTable",void 0),e([s()],h.prototype,"_circuitSectionTable",void 0),e([s()],h.prototype,"_subcircuitTable",void 0),e([s({constructOnly:!0})],h.prototype,"telecomDomainNetwork",void 0),e([s({type:a,constructOnly:!0})],h.prototype,"utilityNetwork",void 0),e([s()],h.prototype,"networkServiceUrl",null),e([s()],h.prototype,"featureServiceUrl",null),e([s()],h.prototype,"gdbVersion",null),e([s()],h.prototype,"historicMoment",null),e([s()],h.prototype,"telecomDomainNetworkName",null),e([s()],h.prototype,"circuitTable",null),e([s()],h.prototype,"circuitSectionTable",null),e([s()],h.prototype,"subcircuitTable",null),h=e([o("esri.networks.CircuitManager")],h);const b=h;export{b 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{isSome as o}from"../../core/arrayUtils.js";import{JSONSupport as e}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{watch as i,initial as r}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{reader as c}from"../../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import l from"./CircuitLocation.js";import u from"./CircuitSection.js";import d from"./Subcircuit.js";import{CircuitTypeKebabDict as h,CircuitStatusKebabDict as y}from"./typeUtils.js";let m=class extends e{constructor(t){super(t),this._sectionIdLookup=new Map,this.circuitType="physical",this.globalId=null,this.isDeleted=!1,this.lastExportedTime=null,this.lastVerifiedTime=null,this.name=null,this.sections=null,this.startLocation=null,this.status="dirty",this.stopLocation=null,this.subcircuits=[]}initialize(){this.addHandles([i(()=>this.sections,t=>{this._sectionIdLookup.clear(),null!=t&&Array.from(t.keys()).forEach(t=>this._sectionIdLookup.set(t.sectionId,t))},r)])}normalizeCtorArgs(t){if(void 0===t)return t;const{name:o,startLocation:e,stopLocation:i,sections:r}=t;return(e||i)&&r?(delete t.startLocation,delete t.stopLocation,s.getLogger(this).warn("Cannot instantiate Circuit with both start/stop locations and sections.",`Circuit '${o}' was defaulted to having sections only.`)):(e&&!i||!e&&i)&&!r&&s.getLogger(this).warn(`Non-sectioned circuit '${o}' must have both start and stop locations.`,"Create/alter operations involving this circuit will fail unless both are populated."),t}get isSectioned(){return null==this.startLocation&&null==this.stopLocation&&null!=this.sections}readSections(t,e){const{sectionOrder:s,sections:i}=e,r=new Map;if(null==i)return null;if(this._sectionIdLookup.clear(),i.forEach(t=>this._sectionIdLookup.set(t.sectionId,u.fromJSON(t))),null==s)return Array.from(this._sectionIdLookup.values()).forEach(t=>r.set(t,[])),r;for(const[n,c]of Object.entries(s)){const t=Number(n),e=this._sectionIdLookup.get(t);if(null==e)continue;const s=c.map(t=>this._sectionIdLookup.get(t)).filter(o);r.set(e,s)}return r}writeSections(t,o){const e={},s=[];t?.forEach((t,o)=>{const i=o.sectionId.toString(),r=t.map(t=>t.sectionId);e[i]=r,s.push(o.toJSON())}),o.sectionOrder=e,o.sections=s}getSectionById(t){return this._sectionIdLookup.get(t)??null}setStartStopLocations(t,o){this.startLocation=t,this.stopLocation=o,this.sections=null}setSections(t){this.sections=t,this.startLocation=null,this.stopLocation=null}};t([n({type:h.apiValues,json:{type:h.jsonValues,read:h.read,write:h.write}})],m.prototype,"circuitType",void 0),t([n({type:String,json:{write:!0}})],m.prototype,"globalId",void 0),t([n({type:Boolean,readOnly:!0})],m.prototype,"isDeleted",void 0),t([n({type:Boolean,json:{write:!0},readOnly:!0})],m.prototype,"isSectioned",null),t([n({type:Date,json:{read:{reader:t=>"number"==typeof t?new Date(t):null}},readOnly:!0})],m.prototype,"lastExportedTime",void 0),t([n({type:Date,json:{read:{reader:t=>"number"==typeof t?new Date(t):null}},readOnly:!0})],m.prototype,"lastVerifiedTime",void 0),t([n({type:String,json:{write:!0}})],m.prototype,"name",void 0),t([n({json:{read:{source:["sectionOrder","sections"]},write:!0}})],m.prototype,"sections",void 0),t([c("sections")],m.prototype,"readSections",null),t([p("sections")],m.prototype,"writeSections",null),t([n({type:l,json:{write:!0}})],m.prototype,"startLocation",void 0),t([n({type:y.apiValues,json:{type:y.jsonValues,read:y.read}})],m.prototype,"status",void 0),t([n({type:l,json:{write:!0}})],m.prototype,"stopLocation",void 0),t([n({type:[d],json:{write:!0}})],m.prototype,"subcircuits",void 0),m=t([a("esri.networks.support.Circuit")],m);const f=m;export{f as default};
5
+ import{__decorate as t}from"tslib";import{isSome as o}from"../../core/arrayUtils.js";import{JSONSupport as e}from"../../core/JSONSupport.js";import i from"../../core/Logger.js";import{watch as s,initial as r}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import l from"./CircuitLocation.js";import u from"./CircuitSection.js";import d from"./Subcircuit.js";import{CircuitTypeKebabDict as h,CircuitStatusKebabDict as y}from"./typeUtils.js";let m=class extends e{constructor(t){super(t),this._sectionIdLookup=new Map,this.attributes=null,this.circuitManager=null,this.circuitType="physical",this.globalId=null,this.isDeleted=!1,this.lastExportedTime=null,this.lastVerifiedTime=null,this.name=null,this.sections=null,this.startLocation=null,this.status="dirty",this.stopLocation=null,this.subcircuits=[]}initialize(){this.addHandles([s(()=>this.sections,t=>{this._sectionIdLookup.clear(),null!=t&&Array.from(t.keys()).forEach(t=>this._sectionIdLookup.set(t.sectionId,t))},r)])}normalizeCtorArgs(t){if(void 0===t)return t;const{name:o,startLocation:e,stopLocation:s,sections:r}=t;return(e||s)&&r?(delete t.startLocation,delete t.stopLocation,i.getLogger(this).warn("Cannot instantiate Circuit with both start/stop locations and sections.",`Circuit '${o}' was defaulted to having sections only.`)):(e&&!s||!e&&s)&&!r&&i.getLogger(this).warn(`Non-sectioned circuit '${o}' must have both start and stop locations.`,"Create/alter operations involving this circuit will fail unless both are populated."),t}get isSectioned(){return null==this.startLocation&&null==this.stopLocation&&null!=this.sections}readSections(t,e){const{sectionOrder:i,sections:s}=e,r=new Map;if(null==s)return null;if(this._sectionIdLookup.clear(),s.forEach(t=>this._sectionIdLookup.set(t.sectionId,u.fromJSON(t))),null==i)return Array.from(this._sectionIdLookup.values()).forEach(t=>r.set(t,[])),r;for(const[n,a]of Object.entries(i)){const t=Number(n),e=this._sectionIdLookup.get(t);if(null==e)continue;const i=a.map(t=>this._sectionIdLookup.get(t)).filter(o);r.set(e,i)}return r}writeSections(t,o){const e={},i=[];t?.forEach((t,o)=>{const s=o.sectionId.toString(),r=t.map(t=>t.sectionId);e[s]=r,i.push(o.toJSON())}),o.sectionOrder=e,o.sections=i}getSectionById(t){return this._sectionIdLookup.get(t)??null}setStartStopLocations(t,o){this.startLocation=t,this.stopLocation=o,this.sections=null}setSections(t){this.sections=t,this.startLocation=null,this.stopLocation=null}getAttribute(t){return this.attributes?.[t]}setAttribute(t,o){this.attributes?this.attributes[t]=o:this.attributes={[t]:o}}};t([n({json:{write:{allowNull:!0,writer:(t,o)=>o.attributes=t??{}}}})],m.prototype,"attributes",void 0),t([n()],m.prototype,"circuitManager",void 0),t([n({type:h.apiValues,json:{type:h.jsonValues,read:h.read,write:h.write}})],m.prototype,"circuitType",void 0),t([n({type:String,json:{write:!0}})],m.prototype,"globalId",void 0),t([n({type:Boolean,readOnly:!0})],m.prototype,"isDeleted",void 0),t([n({type:Boolean,json:{write:!0},readOnly:!0})],m.prototype,"isSectioned",null),t([n({type:Date,json:{read:{reader:t=>"number"==typeof t?new Date(t):null}},readOnly:!0})],m.prototype,"lastExportedTime",void 0),t([n({type:Date,json:{read:{reader:t=>"number"==typeof t?new Date(t):null}},readOnly:!0})],m.prototype,"lastVerifiedTime",void 0),t([n({type:String,json:{write:!0}})],m.prototype,"name",void 0),t([n({json:{read:{source:["sectionOrder","sections"]},write:!0}})],m.prototype,"sections",void 0),t([a("sections")],m.prototype,"readSections",null),t([p("sections")],m.prototype,"writeSections",null),t([n({type:l,json:{write:!0}})],m.prototype,"startLocation",void 0),t([n({type:y.apiValues,json:{type:y.jsonValues,read:y.read}})],m.prototype,"status",void 0),t([n({type:l,json:{write:!0}})],m.prototype,"stopLocation",void 0),t([n({type:[d],json:{write:!0}})],m.prototype,"subcircuits",void 0),m=t([c("esri.networks.support.Circuit")],m);export{m 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{JSONSupport as o}from"../../core/JSONSupport.js";import i from"../../core/Logger.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import e from"./CircuitLocation.js";import a from"./CircuitPath.js";import c from"./Subcircuit.js";import{CircuitSectionRoleKebabDict as n,CircuitTypeKebabDict as p}from"./typeUtils.js";let u=class extends o{constructor(t){super(t),this.sectionId=null,this.role="start-and-end",this.sectionType="physical",this.startLocation=null,this.stopLocation=null,this.subcircuit=null,this.path=null}normalizeCtorArgs(t){if(void 0===t)return t;const{sectionId:o,startLocation:r,stopLocation:s,subcircuit:e}=t;return(r||s)&&e?(delete t.startLocation,delete t.stopLocation,i.getLogger(this).warn("Cannot instantiate CircuitSection with both start/stop locations and subcircuit.",`CircuitSection with ID '${o}' was defaulted to having a subcircuit only.`)):(r&&!s||!r&&s)&&!e&&i.getLogger(this).warn(`CircuitSection with ID '${o}' must have both start and stop locations.`,"Create/alter operations involving this section will fail unless both are populated."),t}setStartStopLocations(t,o){this.startLocation=t,this.stopLocation=o,this.subcircuit=null}setSubcircuit(t){this.subcircuit=t,this.startLocation=null,this.stopLocation=null}};t([r({type:Number,json:{write:!0}})],u.prototype,"sectionId",void 0),t([r({type:n.apiValues,json:{type:n.jsonValues,read:n.read},readOnly:!0})],u.prototype,"role",void 0),t([r({type:p.apiValues,json:{type:p.jsonValues,read:p.read,write:p.write}})],u.prototype,"sectionType",void 0),t([r({type:e,json:{write:!0}})],u.prototype,"startLocation",void 0),t([r({type:e,json:{write:!0}})],u.prototype,"stopLocation",void 0),t([r({type:c,json:{write:!0}})],u.prototype,"subcircuit",void 0),t([r({type:a,readOnly:!0})],u.prototype,"path",void 0),u=t([s("esri.networks.support.CircuitSection")],u);const l=u;export{l as default};
5
+ import{__decorate as t}from"tslib";import{JSONSupport as o}from"../../core/JSONSupport.js";import i from"../../core/Logger.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import e from"./CircuitLocation.js";import a from"./CircuitPath.js";import c from"./Subcircuit.js";import{CircuitSectionRoleKebabDict as n,CircuitTypeKebabDict as p}from"./typeUtils.js";let u=class extends o{constructor(t){super(t),this.sectionId=null,this.role="start-and-end",this.sectionType="physical",this.startLocation=null,this.stopLocation=null,this.subcircuit=null,this.path=null}normalizeCtorArgs(t){if(void 0===t)return t;const{sectionId:o,startLocation:r,stopLocation:s,subcircuit:e}=t;return(r||s)&&e?(delete t.startLocation,delete t.stopLocation,i.getLogger(this).warn("Cannot instantiate CircuitSection with both start/stop locations and subcircuit.",`CircuitSection with ID '${o}' was defaulted to having a subcircuit only.`)):(r&&!s||!r&&s)&&!e&&i.getLogger(this).warn(`CircuitSection with ID '${o}' must have both start and stop locations.`,"Create/alter operations involving this section will fail unless both are populated."),t}setStartStopLocations(t,o){this.startLocation=t,this.stopLocation=o,this.subcircuit=null}setSubcircuit(t){this.subcircuit=t,this.startLocation=null,this.stopLocation=null}};t([r({type:Number,json:{write:!0}})],u.prototype,"sectionId",void 0),t([r({type:n.apiValues,json:{type:n.jsonValues,read:n.read},readOnly:!0})],u.prototype,"role",void 0),t([r({type:p.apiValues,json:{type:p.jsonValues,read:p.read,write:p.write}})],u.prototype,"sectionType",void 0),t([r({type:e,json:{write:!0}})],u.prototype,"startLocation",void 0),t([r({type:e,json:{write:!0}})],u.prototype,"stopLocation",void 0),t([r({type:c,json:{write:!0}})],u.prototype,"subcircuit",void 0),t([r({type:a,readOnly:!0})],u.prototype,"path",void 0),u=t([s("esri.networks.support.CircuitSection")],u);export{u 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 o}from"tslib";import{JSONSupport as r}from"../../core/JSONSupport.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends r{constructor(o){super(o),this.name=null,this.globalId=null,this.providerId=null,this.consumerId=null,this.isReserved=!1}};o([t({type:String,json:{write:!0}})],s.prototype,"name",void 0),o([t({type:String,json:{write:!0}})],s.prototype,"globalId",void 0),o([t({type:String})],s.prototype,"providerId",void 0),o([t({type:String})],s.prototype,"consumerId",void 0),o([t({type:Boolean,json:{write:!0}})],s.prototype,"isReserved",void 0),s=o([e("esri.networks.support.Subcircuit")],s);const p=s;export{p as default};
5
+ import{__decorate as t}from"tslib";import{JSONSupport as r}from"../../core/JSONSupport.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 e}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends r{constructor(t){super(t),this.name=null,this.globalId=null,this.providerId=null,this.consumerId=null,this.isReserved=!1,this.attributes=null}getAttribute(t){return this.attributes?.[t]}setAttribute(t,r){this.attributes?this.attributes[t]=r:this.attributes={[t]:r}}};t([o({type:String,json:{write:!0}})],s.prototype,"name",void 0),t([o({type:String,json:{write:!0}})],s.prototype,"globalId",void 0),t([o({type:String})],s.prototype,"providerId",void 0),t([o({type:String})],s.prototype,"consumerId",void 0),t([o({type:Boolean,json:{write:!0}})],s.prototype,"isReserved",void 0),t([o({json:{write:{allowNull:!0,writer:(t,r)=>r.attributes=t??{}}}})],s.prototype,"attributes",void 0),s=t([e("esri.networks.support.Subcircuit")],s);const i=s;export{i as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.34.0-next.74",
3
+ "version": "4.34.0-next.76",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -18,7 +18,7 @@
18
18
  ],
19
19
  "license": "SEE LICENSE IN copyright.txt",
20
20
  "dependencies": {
21
- "@arcgis/toolkit": "^4.34.0-next.119",
21
+ "@arcgis/toolkit": "^4.34.0-next.121",
22
22
  "@esri/arcgis-html-sanitizer": "~4.1.0",
23
23
  "@esri/calcite-components": "^3.3.0-next.95",
24
24
  "@vaadin/grid": "~24.8.6",