@arcgis/core 5.0.0-next.45 → 5.0.0-next.47

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 (332) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/063045ac5553e91c0c4c.js +1 -0
  3. package/assets/esri/core/workers/chunks/{20ad34f9d45c64392022.js → 08c1ea29678da27136f3.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{5dc2f2e28c30386efadf.js → 10094eb2b94e98dd4a8a.js} +1 -1
  5. package/assets/esri/core/workers/chunks/108675a17e432a02cf66.js +1 -0
  6. package/assets/esri/core/workers/chunks/169be08394c5e7703628.js +1 -0
  7. package/assets/esri/core/workers/chunks/19270a2de33f2662005b.js +1 -0
  8. package/assets/esri/core/workers/chunks/1a6f3531ef3d671e0289.js +1 -0
  9. package/assets/esri/core/workers/chunks/{b809d499ff050976d9ed.js → 1c58064ea80e6a4a4a3b.js} +1 -1
  10. package/assets/esri/core/workers/chunks/1c816aff8613d1e4bf38.js +1 -0
  11. package/assets/esri/core/workers/chunks/{ee67c8a7c1f8b482cd99.js → 1ced78750c61600b2d4e.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{c5d6b416baf24e74b9ba.js → 1dfa949cc4f4c18ed4cf.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{98175b454e807b1a3c5f.js → 1e152a34e368bd810a0f.js} +1 -1
  14. package/assets/esri/core/workers/chunks/1e17ad6cdffa5016a3db.js +1 -0
  15. package/assets/esri/core/workers/chunks/1e2d42e9984ed3437ba2.js +1 -0
  16. package/assets/esri/core/workers/chunks/2008b22f76071a2dde4e.js +1 -0
  17. package/assets/esri/core/workers/chunks/2107c93d1fe87f3b8dfa.js +1 -0
  18. package/assets/esri/core/workers/chunks/2209550b6510e25da375.js +1 -0
  19. package/assets/esri/core/workers/chunks/229e1ed4282005aa0b83.js +1 -0
  20. package/assets/esri/core/workers/chunks/22b8eaa6afab0e5ffc47.js +1 -0
  21. package/assets/esri/core/workers/chunks/{1c0fb4795a52204882a8.js → 2550d2ba935cfdf30236.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{49e6219dd08cb6c27023.js → 273ac1066095d63d6a6f.js} +1 -1
  23. package/assets/esri/core/workers/chunks/2e2867bc66c94aba7dc7.js +1 -0
  24. package/assets/esri/core/workers/chunks/{cda5c95fd49b8901f7d4.js → 3298e96d3f2e49e338d2.js} +1 -1
  25. package/assets/esri/core/workers/chunks/34613b288cf174983f8b.js +1 -0
  26. package/assets/esri/core/workers/chunks/{e5baa30944061418cb13.js → 35f086a2ae0585348ae6.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{f441fc74451330384fb0.js → 37ea150dec5e491f691e.js} +1 -1
  28. package/assets/esri/core/workers/chunks/3c94db7ecdcd38eeb1b1.js +1 -0
  29. package/assets/esri/core/workers/chunks/3f7749f06ae54a4437d9.js +1 -0
  30. package/assets/esri/core/workers/chunks/404229f10aef5ac23c87.js +1 -0
  31. package/assets/esri/core/workers/chunks/40a722933af28823953b.js +1 -0
  32. package/assets/esri/core/workers/chunks/{7aa730e5ac7b268e3c98.js → 424daef7b5dec1b99aba.js} +1 -1
  33. package/assets/esri/core/workers/chunks/456684b1c1417ed0e611.js +1 -0
  34. package/assets/esri/core/workers/chunks/{d14e75b160aa432233c6.js → 461093ce28ceadd7853d.js} +1 -1
  35. package/assets/esri/core/workers/chunks/46b63a65484b102e9ccb.js +1 -0
  36. package/assets/esri/core/workers/chunks/4a48b8ec5f3f2fd139b5.js +1 -0
  37. package/assets/esri/core/workers/chunks/4b084f985bc4100e7aec.js +1 -0
  38. package/assets/esri/core/workers/chunks/4b1de1fcd13677b615a8.js +1 -0
  39. package/assets/esri/core/workers/chunks/{31186e83fe009aa0fd36.js → 4d933de84afb2e3b7d18.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{83aa39fbb1fad3b9d143.js → 4ff771942531fb2755c4.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{e0017c6739d2532793e6.js → 513a4ef960e27500f986.js} +1 -1
  42. package/assets/esri/core/workers/chunks/56b693baa376bb990925.js +1 -0
  43. package/assets/esri/core/workers/chunks/{1d4ea8db272655c0608c.js → 57fd5e1260269002d18a.js} +1 -1
  44. package/assets/esri/core/workers/chunks/5fe40bb0e9ab333f6854.js +1 -0
  45. package/assets/esri/core/workers/chunks/{9f6c63a580b28ab715bd.js → 5ffeb8fb58d59bad68c3.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{b56c07c0b43cb1999070.js → 60362c5651ef41fa7e5f.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{e8a9971c8354569cb81d.js → 609919428305d8c8c243.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{ab88577987cf2fe1cb32.js → 61373d2fa7e7638d3395.js} +1 -1
  49. package/assets/esri/core/workers/chunks/6202922b1c2637e9aaa5.js +1 -0
  50. package/assets/esri/core/workers/chunks/633368ae6fbb46373328.js +1 -0
  51. package/assets/esri/core/workers/chunks/657602e6a84e8b4576fb.js +1 -0
  52. package/assets/esri/core/workers/chunks/6d3ae7969ea86a2e0b13.js +1 -0
  53. package/assets/esri/core/workers/chunks/6d702cb26cef46a76963.js +1 -0
  54. package/assets/esri/core/workers/chunks/{35272810c2ed04eb403d.js → 6f3943bebe2d5f4994f7.js} +1 -1
  55. package/assets/esri/core/workers/chunks/708aba69a1870ea41a61.js +1 -0
  56. package/assets/esri/core/workers/chunks/{7ba13b52fce1060fbb2a.js → 7147fc7502b385b302b2.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{9ba8a2e1c0fb4e1efc7c.js → 7364fb5e99933533890d.js} +1 -1
  58. package/assets/esri/core/workers/chunks/74b1028e95f7cfff387b.js +1 -0
  59. package/assets/esri/core/workers/chunks/75d8244b725a2aee2003.js +1 -0
  60. package/assets/esri/core/workers/chunks/78fccea3445fb2f9120a.js +1 -0
  61. package/assets/esri/core/workers/chunks/7ba31425caa404f86424.js +1 -0
  62. package/assets/esri/core/workers/chunks/{a4f492aa5444e6381063.js → 7d631ebf8f79225cf0f6.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{040f3d8e1099c4843390.js → 81a60dfa600b690098f9.js} +1 -1
  64. package/assets/esri/core/workers/chunks/833fd2bc42c5cb459084.js +1 -0
  65. package/assets/esri/core/workers/chunks/{75643711d9585ee26a15.js → 83c8e5a92d8d6193cb32.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{e537e1d37f3fcb14fce2.js → 870022661376442411e4.js} +1 -1
  67. package/assets/esri/core/workers/chunks/898ab7db220e81e921c6.js +1 -0
  68. package/assets/esri/core/workers/chunks/{31b074ae2162a3508d2a.js → 8b578ffc3a83089aa782.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{48c8ef4170e803a564d6.js → 8b75861196d1ce5cba63.js} +1 -1
  70. package/assets/esri/core/workers/chunks/8be61e13530fd0dc2fd1.js +1 -0
  71. package/assets/esri/core/workers/chunks/90b8ccee883738917a6d.js +1 -0
  72. package/assets/esri/core/workers/chunks/90bc9c299ae0e8b8b5e5.js +1 -0
  73. package/assets/esri/core/workers/chunks/91d9ade78854f40a962d.js +1 -0
  74. package/assets/esri/core/workers/chunks/9319d57494482668ab19.js +1 -0
  75. package/assets/esri/core/workers/chunks/{74881340e040bfd0580f.js → 934bc1028b287f8df4aa.js} +1 -1
  76. package/assets/esri/core/workers/chunks/96055de47831e59a28bf.js +1 -0
  77. package/assets/esri/core/workers/chunks/963ba863e0f87abfca25.js +1 -0
  78. package/assets/esri/core/workers/chunks/9aa8d60483ad905fe13b.js +1 -0
  79. package/assets/esri/core/workers/chunks/9fed9946241bb2a5cfa4.js +1 -0
  80. package/assets/esri/core/workers/chunks/a2662e98857f0abf8e82.js +1 -0
  81. package/assets/esri/core/workers/chunks/a5a9b0a35849b9f2e86d.js +1 -0
  82. package/assets/esri/core/workers/chunks/a60006c9ccf6817fc0d2.js +1 -0
  83. package/assets/esri/core/workers/chunks/a627b7eb94b7fca33210.js +1 -0
  84. package/assets/esri/core/workers/chunks/a651dc3b8f1fc1ab34cc.js +1 -0
  85. package/assets/esri/core/workers/chunks/{bf5f9da0837ed09729c6.js → aab93e885b6c7c6aa76e.js} +1 -1
  86. package/assets/esri/core/workers/chunks/adfe28c1c1619cdd3ca1.js +1019 -0
  87. package/assets/esri/core/workers/chunks/b88dc7d8ae105747e6a4.js +1 -0
  88. package/assets/esri/core/workers/chunks/b90c786dd474ea1a409c.js +1 -0
  89. package/assets/esri/core/workers/chunks/b92e9e5df8154a128982.js +1 -0
  90. package/assets/esri/core/workers/chunks/{9a855a10798348a21bab.js → bff814d34b38ec80c44d.js} +1 -1
  91. package/assets/esri/core/workers/chunks/c36d699a75b6e8fb93eb.js +1 -0
  92. package/assets/esri/core/workers/chunks/c50fdf723f2d4316862e.js +1 -0
  93. package/assets/esri/core/workers/chunks/{9461cc37ab3397265270.js → c5e8ff4721b15ac3c6eb.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{4cda42b94e9cb58dd372.js → ca61077e0a598654f33f.js} +1 -1
  95. package/assets/esri/core/workers/chunks/{61a9ffd4cf07d8bb7a9b.js → ca81be5bdb88ef557bf3.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{ca1c65eb7f5900c60170.js → cd8fec3500e6503ae020.js} +1 -1
  97. package/assets/esri/core/workers/chunks/ce90e8489143228262e7.js +1 -0
  98. package/assets/esri/core/workers/chunks/d0320ca67abca4f8b0d2.js +1 -0
  99. package/assets/esri/core/workers/chunks/{4b6a44c6265c8959abd8.js → d3db7244fac7398cc700.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{19820cddba13a3585c0b.js → d561624ddb9388732b25.js} +1 -1
  101. package/assets/esri/core/workers/chunks/d65ca3b8fccae8c3c3fa.js +1 -0
  102. package/assets/esri/core/workers/chunks/{630eba99f48ea79a9560.js → d705410c369bd03b1875.js} +1 -1
  103. package/assets/esri/core/workers/chunks/{9c7682b300b877f60095.js → d76513a6260d9ec4ea25.js} +1 -1
  104. package/assets/esri/core/workers/chunks/d82e17522ed946c2d809.js +1 -0
  105. package/assets/esri/core/workers/chunks/d8dc130ea559be1f68c6.js +1 -0
  106. package/assets/esri/core/workers/chunks/dae715b2b0094641e42f.js +1 -0
  107. package/assets/esri/core/workers/chunks/{768ae52b4e5c3e571ef5.js → dc29cb16704e2e4d0a46.js} +1 -1
  108. package/assets/esri/core/workers/chunks/e8c2e2fbe9cef4c8a8c6.js +1 -0
  109. package/assets/esri/core/workers/chunks/ecb4c223c0278971cdc9.js +1 -0
  110. package/assets/esri/core/workers/chunks/{3f33708eb39c7169a226.js → f2ba50eb29f93df885d6.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{6e5d41f51572e3e7cf92.js → f7163048146ddaedfc36.js} +1 -1
  112. package/assets/esri/core/workers/chunks/f92a78ce5510e0d0d0f7.js +1 -0
  113. package/assets/esri/core/workers/chunks/fa92a7c11befbad8739f.js +1 -0
  114. package/assets/esri/core/workers/chunks/fdaa10a588db394e2f65.js +1 -0
  115. package/chunks/Laserlines.glsl.js +1 -1
  116. package/chunks/boundedPlane.js +1 -1
  117. package/chunks/cameraUtilsSpherical.js +1 -1
  118. package/chunks/vec32.js +1 -1
  119. package/config.js +1 -1
  120. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  121. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  122. package/geometry/FlatGeometry.js +1 -1
  123. package/geometry/operators/support/apiConverter.js +1 -1
  124. package/geometry/operators/support/jsonConverter.js +1 -1
  125. package/geometry/support/curves/circleUtils.js +1 -1
  126. package/geometry/support/lineSegment.js +1 -1
  127. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  128. package/geometry/support/meshUtils/merge.js +1 -1
  129. package/geometry/support/sphere.js +1 -1
  130. package/interfaces.d.ts +179 -71
  131. package/kernel.js +1 -1
  132. package/layers/ParquetLayer.js +1 -1
  133. package/layers/VoxelWasmPerSceneView.js +1 -1
  134. package/layers/graphics/sources/ParquetSource.js +1 -1
  135. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  136. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  137. package/layers/support/{ParquetEncodingBase.js → ParquetGeometryEncodingBase.js} +1 -1
  138. package/layers/support/ParquetGeometryEncodingLocation.d.ts +4 -0
  139. package/layers/support/ParquetGeometryEncodingLocation.js +5 -0
  140. package/layers/support/ParquetGeometryEncodingWkb.d.ts +4 -0
  141. package/layers/support/ParquetGeometryEncodingWkb.js +5 -0
  142. package/layers/support/parquetEncodingUtils.js +1 -1
  143. package/layers/support/parquetUtils.js +1 -1
  144. package/layers/support/tiles3DUtils.js +1 -1
  145. package/layers/voxel/VoxelVolume.js +1 -1
  146. package/libs/parquet/parquet.js +1 -1
  147. package/package.json +2 -2
  148. package/support/revision.js +1 -1
  149. package/symbols/cim/effects/EffectSuppress.js +1 -1
  150. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  151. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  152. package/views/2d/interactive/SegmentLabels2D.js +1 -1
  153. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  154. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  155. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  156. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  157. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  158. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  159. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  160. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  161. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  162. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  163. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  164. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  165. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  166. package/views/3d/camera/constraintUtils/distance.js +1 -1
  167. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  168. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  169. package/views/3d/environment/CloudsParameters.js +1 -1
  170. package/views/3d/environment/EnvironmentManager.js +1 -1
  171. package/views/3d/environment/MarsAtmosphere.js +1 -1
  172. package/views/3d/glTF/internal/Resource.js +1 -1
  173. package/views/3d/glTF/loader.js +1 -1
  174. package/views/3d/interactive/SegmentLabels3D.js +1 -1
  175. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  176. package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
  177. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  178. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  179. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  180. package/views/3d/layers/I3SMeshView3D.js +1 -1
  181. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  182. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  183. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  184. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  185. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  186. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  187. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  188. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  189. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  190. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  191. package/views/3d/state/Frustum.js +1 -1
  192. package/views/3d/state/controllers/FovController.js +1 -1
  193. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  194. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  195. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  196. package/views/3d/support/cameraUtils.js +1 -1
  197. package/views/3d/support/intersectionUtils.js +1 -1
  198. package/views/3d/support/orientedBoundingBox.js +1 -1
  199. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  200. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  201. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  202. package/views/3d/support/viewpointUtils.js +1 -1
  203. package/views/3d/terrain/OverlayManager.js +1 -1
  204. package/views/3d/terrain/PatchRenderData.js +1 -1
  205. package/views/3d/terrain/SphericalPatch.js +1 -1
  206. package/views/3d/terrain/Tile.js +1 -1
  207. package/views/3d/webgl/RenderCamera.js +1 -1
  208. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  209. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  210. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  211. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  212. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  213. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  214. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  215. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  216. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  217. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  218. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  219. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  220. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  221. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  222. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  223. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  224. package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
  225. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
  226. package/views/SelectionManager.js +1 -1
  227. package/views/draw/support/Reshape.js +1 -1
  228. package/views/interactive/GraphicManipulator.js +1 -1
  229. package/views/interactive/coordinateHelper.js +1 -1
  230. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  231. package/views/interactive/sketch/constraints.js +1 -1
  232. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  233. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  234. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  235. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  236. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  237. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  238. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  239. package/views/support/geometry3dUtils.js +1 -1
  240. package/views/support/selectionUtils.js +1 -1
  241. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  242. package/widgets/BatchAttributeForm/css.js +1 -1
  243. package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.d.ts +4 -0
  244. package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.js +5 -0
  245. package/widgets/BatchAttributeForm/inputs/TextElementInput.d.ts +4 -0
  246. package/widgets/BatchAttributeForm/inputs/TextElementInput.js +5 -0
  247. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  248. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  249. package/widgets/BatchAttributeForm/templates/GroupElementTemplate.js +1 -1
  250. package/widgets/BatchAttributeForm/templates/TextElementTemplate.js +5 -0
  251. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  252. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  253. package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
  254. package/widgets/BatchAttributeForm.js +1 -1
  255. package/widgets/Editor/support/SketchController.js +1 -1
  256. package/widgets/FeatureForm/TextElementInput.d.ts +2 -2
  257. package/widgets/FeatureForm/TextElementInput.js +1 -1
  258. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  259. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  260. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  261. package/widgets/OrientedImageryViewer.js +1 -1
  262. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  263. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  264. package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
  265. package/widgets/PanoramicViewer/support/PanoramicMedia.js +5 -0
  266. package/widgets/PanoramicViewer/support/PanoramicMediaCollection.js +5 -0
  267. package/widgets/PanoramicViewer/support/PanoramicMediaError.js +5 -0
  268. package/widgets/PanoramicViewer/utils.js +1 -1
  269. package/widgets/PanoramicViewer.js +1 -1
  270. package/widgets/Search/SearchViewModel.js +1 -1
  271. package/widgets/Search.js +1 -1
  272. package/widgets/Sketch.js +1 -1
  273. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  274. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  275. package/assets/esri/core/workers/chunks/024104997daea0d74b38.js +0 -1
  276. package/assets/esri/core/workers/chunks/04a0685ee53ef74883aa.js +0 -1
  277. package/assets/esri/core/workers/chunks/08ef90e3fcfd4eda4301.js +0 -1
  278. package/assets/esri/core/workers/chunks/1e0e7cef7ef947894bbe.js +0 -1019
  279. package/assets/esri/core/workers/chunks/20988e116f3723228f36.js +0 -1
  280. package/assets/esri/core/workers/chunks/2613e482450b57f2d4f5.js +0 -1
  281. package/assets/esri/core/workers/chunks/274f2b5e6dbc58505142.js +0 -1
  282. package/assets/esri/core/workers/chunks/27dfbe3d903b95d4c67a.js +0 -1
  283. package/assets/esri/core/workers/chunks/28a5a7c6b3d6902146f6.js +0 -1
  284. package/assets/esri/core/workers/chunks/2c4218306747f5d15575.js +0 -1
  285. package/assets/esri/core/workers/chunks/2d3ae187f8aa3495d4ae.js +0 -1
  286. package/assets/esri/core/workers/chunks/2db7a7607657f1d669f7.js +0 -1
  287. package/assets/esri/core/workers/chunks/2f8cf7d9ff1f4de19a4c.js +0 -1
  288. package/assets/esri/core/workers/chunks/338570424337be05cef5.js +0 -1
  289. package/assets/esri/core/workers/chunks/36130910ba141f34531b.js +0 -1
  290. package/assets/esri/core/workers/chunks/3767617c0dfc7d801441.js +0 -1
  291. package/assets/esri/core/workers/chunks/44b6b7418cbf7f778bef.js +0 -1
  292. package/assets/esri/core/workers/chunks/4675ed3ca3e0104d00bf.js +0 -1
  293. package/assets/esri/core/workers/chunks/4df7cc3477bc46fc39af.js +0 -1
  294. package/assets/esri/core/workers/chunks/538ddb267aa328814865.js +0 -1
  295. package/assets/esri/core/workers/chunks/555a0ea44ba77819d493.js +0 -1
  296. package/assets/esri/core/workers/chunks/55818fe7a7aa1e5c8bbd.js +0 -1
  297. package/assets/esri/core/workers/chunks/59889855d23baec1adf9.js +0 -1
  298. package/assets/esri/core/workers/chunks/5f781ef46ce7c4048c2f.js +0 -1
  299. package/assets/esri/core/workers/chunks/60f2de8dd8876bfd715a.js +0 -1
  300. package/assets/esri/core/workers/chunks/679088064420a906aa7f.js +0 -1
  301. package/assets/esri/core/workers/chunks/706423d801fa9cbf2e90.js +0 -1
  302. package/assets/esri/core/workers/chunks/71dd80231ea656a6380c.js +0 -1
  303. package/assets/esri/core/workers/chunks/725819839434c59102f3.js +0 -1
  304. package/assets/esri/core/workers/chunks/72cebf18da5ec5eeb666.js +0 -1
  305. package/assets/esri/core/workers/chunks/768d9b6eaba7bfa18dde.js +0 -1
  306. package/assets/esri/core/workers/chunks/77b45957cfe42523c1c8.js +0 -1
  307. package/assets/esri/core/workers/chunks/852de585a72d902344a6.js +0 -1
  308. package/assets/esri/core/workers/chunks/871dd5e1f016a04b8d98.js +0 -1
  309. package/assets/esri/core/workers/chunks/892c417f5130b003889d.js +0 -1
  310. package/assets/esri/core/workers/chunks/8d4cc5f1d07b4aa3aea0.js +0 -1
  311. package/assets/esri/core/workers/chunks/907083c427d7fb4354e9.js +0 -1
  312. package/assets/esri/core/workers/chunks/93c5f097bb7b380bb175.js +0 -1
  313. package/assets/esri/core/workers/chunks/9f0172b83f25ef5f8d40.js +0 -1
  314. package/assets/esri/core/workers/chunks/a00bba1c7cbf8cd7892c.js +0 -1
  315. package/assets/esri/core/workers/chunks/a34a14fd989dbbd3c2d0.js +0 -1
  316. package/assets/esri/core/workers/chunks/ae793d814cf32db9fbde.js +0 -1
  317. package/assets/esri/core/workers/chunks/b21cf62652ca772108c8.js +0 -1
  318. package/assets/esri/core/workers/chunks/c5c02ace54fe4ab9214b.js +0 -1
  319. package/assets/esri/core/workers/chunks/c82a974c8448407885e6.js +0 -1
  320. package/assets/esri/core/workers/chunks/d0014b4a8c013f59b113.js +0 -1
  321. package/assets/esri/core/workers/chunks/d08ee45c501102deea20.js +0 -1
  322. package/assets/esri/core/workers/chunks/d239a4ef60e348cfb05a.js +0 -1
  323. package/assets/esri/core/workers/chunks/da2ba40bc017bff0fe49.js +0 -1
  324. package/assets/esri/core/workers/chunks/dc3a4ad62bc041a4f899.js +0 -1
  325. package/assets/esri/core/workers/chunks/e093e745708f722bc1b9.js +0 -1
  326. package/assets/esri/core/workers/chunks/e501d68a1464805c4b4e.js +0 -1
  327. package/assets/esri/core/workers/chunks/e6784251bbb8b71ead93.js +0 -1
  328. package/assets/esri/core/workers/chunks/f3c232fc56a29d51196a.js +0 -1
  329. package/layers/support/ParquetEncodingLocation.d.ts +0 -4
  330. package/layers/support/ParquetEncodingLocation.js +0 -5
  331. package/layers/support/ParquetEncodingWkb.d.ts +0 -4
  332. package/layers/support/ParquetEncodingWkb.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{d as e,a as t,g as n,q as r,p as i,G as s,t as a}from"../../../chunks/Geometry.js";import{aJ as o,i as u,d as m,P as l,b as c,aK as d,m as _}from"../../../chunks/Point2D.js";import{q as h,b as f,p,aX as k,c as b,e as y,a as N,f as T,aY as g}from"../../../chunks/UnitFactory.js";import{a2 as v,a5 as x,P as A,E as S,a0 as w,a1 as C,a6 as D,a7 as F,Y as j}from"../../../chunks/Envelope.js";import{a as O,P as z,S as I,M as E,J as P,a5 as B,a6 as R,a7 as V,a8 as M,a9 as U}from"../../../chunks/MultiPathImpl.js";import W from"../../SpatialReference.js";import"./initNoPeFactory.js";function X(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function Y(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}class L{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter(t=>void 0!==e[t]),m_i:-1,m_bReturnKey:!0,next:X}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:Y}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=o()&&this.m_currentValue<=u()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;e("unrecognized json element type")}return e("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt64Value(){return n(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&t("invalid token"),this.m_currentValue}isError(){return 0}}class G{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){n(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class q{constructor(t){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==t.sz?(this.m_sz=t.sz,t.buffer?(this.m_sz<0&&r("size out of range"),this.m_buffer=t.buffer,this.m_offset=void 0!==t.offset?t.offset:0,this.m_view=void 0!==t.offset?new DataView(t.buffer,t.offset,t.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&r("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):t.move?(this.m_sz=t.move.m_sz,this.m_buffer=t.move.m_buffer,this.m_view=t.move.m_view,this.m_bOwnsBuffer=t.move.m_bOwnsBuffer,this.m_bLittleEndian=t.move.m_bLittleEndian,t.move.m_buffer=null,t.move.m_view=null,t.move.m_sz=0,void(t.move.m_bOwnsBuffer=!0)):void e("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===q.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===q.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||i("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){n(e>=0&&e<=this.m_sz),this.m_sz=e}}function K(e,r,i,a,o,u){let m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=!1,y=!1,N=!1,T=!1,g=!1,w=!1,C=!1,D=!1,F=!1,j=!1,O=!1,z=!1,I=!1,E=!1,P=!1,B=Number.NaN,R=Number.NaN,V=Number.NaN,M=Number.NaN,U=0,W=Number.NaN,X=Number.NaN,Y=Number.NaN,L=Number.NaN,G=Number.NaN,q=Number.NaN,K=Number.NaN,J=Number.NaN,re=0,ie=0,se=!1,ae=!1,oe=null,ue=null,me=null,le=null,ce=null;for(;3!==i.nextToken();){const u=i.currentString();if(i.nextToken(),"spatialReference"===u){if(o&&!m){m=!0,1===i.currentToken()?le=Q(i):10!==i.currentToken()&&t("failed to parse spatial reference: object or null is expected");continue}}else if(a)if("hasZ"===u){if(!l){l=!0,se=11===i.currentToken();continue}}else if("hasM"===u){if(!c){c=!0,ae=11===i.currentToken();continue}}else if("rings"===u){if(!(_||h||e!==s.enumUnknown&&e!==s.enumPolygon)){_=!0,({geometry:ce,as:oe,bs:ue}=Z(!0,!1,r,i));continue}}else if("curveRings"===u){if(!h&&(e===s.enumUnknown||e===s.enumPolygon)){h=!0,({geometry:ce,as:oe,bs:ue}=Z(!0,!0,r,i));continue}}else if("paths"===u){if(!(f||p||e!==s.enumUnknown&&e!==s.enumPolyline)){f=!0,({geometry:ce,as:oe,bs:ue}=Z(!1,!1,r,i));continue}}else if("curvePaths"===u){if(!p&&(e===s.enumUnknown||e===s.enumPolyline)){p=!0,({geometry:ce,as:oe,bs:ue}=Z(!1,!0,r,i));continue}}else if("points"===u){if(!k&&(e===s.enumUnknown||e===s.enumMultiPoint)){k=!0,({geometry:ce,as:oe,bs:ue}=H(r,i));continue}}else if("ids"===u){if(!d){d=!0,me=$(r,i);continue}}else if("x"===u){if(!b&&(e===s.enumUnknown||e===s.enumPoint)){b=!0,B=ee(i);continue}}else if("y"===u){if(!y&&(e===s.enumUnknown||e===s.enumPoint)){y=!0,R=ee(i);continue}}else if("z"===u){if(!N&&(e===s.enumUnknown||e===s.enumPoint)){N=!0,V=ee(i);continue}}else if("m"===u){if(!T&&(e===s.enumUnknown||e===s.enumPoint)){T=!0,M=ee(i);continue}}else if("id"===u){if(!g&&(e===s.enumUnknown||e===s.enumPoint)){g=!0,U=te(i);continue}}else if("xmin"===u){if(!w&&(e===s.enumUnknown||e===s.enumEnvelope)){w=!0,W=ee(i);continue}}else if("ymin"===u){if(!C&&(e===s.enumUnknown||e===s.enumEnvelope)){C=!0,X=ee(i);continue}}else if("mmin"===u){if(!z&&(e===s.enumUnknown||e===s.enumEnvelope)){z=!0,K=ee(i);continue}}else if("zmin"===u){if(!j&&(e===s.enumUnknown||e===s.enumEnvelope)){j=!0,G=ee(i);continue}}else if("idmin"===u){if(!E&&(e===s.enumUnknown||e===s.enumEnvelope)){E=!0,re=te(i);continue}}else if("xmax"===u){if(!D&&(e===s.enumUnknown||e===s.enumEnvelope)){D=!0,Y=ee(i);continue}}else if("ymax"===u){if(!F&&(e===s.enumUnknown||e===s.enumEnvelope)){F=!0,L=ee(i);continue}}else if("mmax"===u){if(!I&&(e===s.enumUnknown||e===s.enumEnvelope)){I=!0,J=ee(i);continue}}else if("zmax"===u){if(!O&&(e===s.enumUnknown||e===s.enumEnvelope)){O=!0,q=ee(i);continue}}else if("idmax"===u){if(!P&&(e===s.enumUnknown||e===s.enumEnvelope)){P=!0,ie=te(i);continue}}else"materials"===u&&n(0);i.skipChildren()}if(_||h||f||p||k){let e=null,t=null;const n=ce;se&&(ce.addAttribute(1),e=oe,e||(e=v(n.getPointCount(),Number.NaN))),ae&&(ce.addAttribute(2),t=se?ue:oe),null!=me&&ce.addAttribute(3),se&&null!=e&&n.setAttributeStreamRef(1,e),ae&&null!=t&&n.setAttributeStreamRef(2,t),null!=me&&ne(n,me)}else if(b||y||T||N||g){x(B,R)||t("failed to parse point: x and y must be finite or nan"),(Number.isNaN(R)||Number.isNaN(B))&&(B=Number.NaN,R=Number.NaN);const e=new A({x:B,y:R});N&&e.setZ(V),T&&e.setM(M),g&&e.setID(U),ce=e}else if(w||C||D||F||j||O||z||I||E||P){(Number.isNaN(X)||Number.isNaN(Y)||Number.isNaN(L))&&(W=Number.NaN);const e=new S({xmin:W,ymin:X,xmax:Y,ymax:L});j&&O&&e.setInterval(1,0,G,q),z&&I&&e.setInterval(2,0,K,J),E&&P&&e.setInterval(3,0,re,ie),ce=e}return{...ce?{geom:ce}:{},...le?{sr:le}:{}}}function J(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function Q(e){let t=!1,n=!1,r=!1,i=!1,s=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,_=!1,g=!1,v=!1,x=!1,A=!1,S=-1,w=-1,C=-1,D=-1,F=0,j=0,O=0,z=0,I=0,E=0,P=0,B=0,R=0,V=0,M="",U="",W=null;for(;3!==e.nextToken();){const h=e.currentString();e.nextToken(),"wkid"===h?t||(t=!0,8===e.currentToken()&&(S=e.currentInt32Value())):"latestWkid"===h?n||(n=!0,8===e.currentToken()&&(w=e.currentInt32Value())):"wkt"===h?s||(s=!0,6===e.currentToken()&&(M=e.currentString())):"wkt2"===h?s||6===e.currentToken()&&(U=e.currentString()):"vcsWkid"===h?r||(r=!0,8===e.currentToken()&&(C=e.currentInt32Value())):"latestVcsWkid"===h?i||(i=!0,8===e.currentToken()&&(D=e.currentInt32Value())):"xyTolerance"===h?o||(o=!0,a=!0,F=e.currentDoubleValue()):"zTolerance"===h?u||(u=!0,a=!0,j=e.currentDoubleValue()):"mTolerance"===h?m||(m=!0,a=!0,O=e.currentDoubleValue()):"falseX"===h?l||(l=!0,a=!0,P=e.currentDoubleValue()):"falseY"===h?c||(c=!0,a=!0,B=e.currentDoubleValue()):"falseZ"===h?d||(d=!0,a=!0,R=e.currentDoubleValue()):"falseM"===h?_||(_=!0,a=!0,V=e.currentDoubleValue()):"xyUnits"===h?g||(g=!0,a=!0,z=e.currentDoubleValue()):"zUnits"===h?v||(v=!0,a=!0,I=e.currentDoubleValue()):"mUnits"===h?x||(x=!0,a=!0,E=e.currentDoubleValue()):"unit"===h?A||(A=!0,W=J(e)):e.skipChildren()}D<=0&&C>0&&(D=C),C<=0&&D>0&&(C=D);let X=null,Y=!0;if(0!==M.length&&(Y=!1,h(M)&&(X=f(M))),X||0===U.length||(Y=!1,h(U)&&(X=f(U))),!X&&w>0&&(Y=!1,p(w)&&(D<=0||k())&&(X=b(w,D))),!X&&S>0&&(Y=!1,p(S)&&(C<=0||k())&&(X=b(S,C))),Y&&(X=y(W)),a&&X){const e=new N;X.queryPrecisionDescriptorWithoutFalseXY(e),o&&e.setTolerance(0,F),u&&e.setTolerance(1,j),m&&e.setTolerance(2,O),g&&l&&c&&e.setGridParams(P,B,z),v&&d&&e.setZParams(R,I),x&&_&&e.setMParams(V,E),X=T(X,e)}return X}function Z(e,n,r,i){2!==i.currentToken()&&t("failed to parse multipath: array of array of vertices is expected");const s=e?new O:new z,a=s,o=w(0),u=v(2,0),_=C(0);let h=null,f=null,p=null,k=null,b=null,y=0,N=0,T=0;const g=new I,x=l.getNAN();let A=0,S=0;const F=e?1:0;for(;4!==i.nextToken();){2!==i.currentToken()&&t("failed to parse multipath: ring/path array is expected");let r=2,s=0,j=!0;const O=4;let z=0,I=0;const E=l.getNAN(),P=m(O,Number.NaN),B=m(O,Number.NaN);let R=!1;for(i.nextToken();4!==i.currentToken();){if(n&&1===i.currentToken())j&&t("failed to parse multipath: starting vertex array is expected"),p||(p=C(A-1,1),k=w(A-1,-1),b=v(0)),R=!0,r=1,({segFlag:T,toPointSz:z}=me(g,P,x,i));else{for(R=!1,2!==i.currentToken()&&t("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),z=0;4!==i.nextToken();)z===O&&t("failed to parse multipath: each vertex array has to have at most 4 elements"),P[z++]=ee(i);z<2&&t("failed to parse multipath: each vertex array has to have at least 2 elements"),D(P[0],P[1])||t("failed to parse multipath: x and y must be finite")}i.nextToken();do{if(u.size()===2*A&&u.resize(re(A)),u.writePoint2D(2*A,E.setCoords(P[0],P[1])),h&&h.size()===A&&h.resize(ie(A)),z>2?(h||(h=v(A+1,Number.NaN)),h.write(A,P[2])):h&&h.write(A,Number.NaN),f&&f.size()===A&&f.resize(ie(A)),z>3?(f||(f=v(A+1,Number.NaN)),f.write(A,P[3])):f&&f.write(A,Number.NaN),j)S++,o.add(A),_.add(F),j=!1,I=z,c(B,P,0,0,I);else if(null!==p)if(R){const e=U(T),t=b.size();b.resize(t+e),p.add(T),k.add(y),g.get().writeInBufferStream(b,y),y+=e,a.incCurveType(T,1),N++}else p.add(1),k.add(-1);A++,s++,x.setCoords(P[0],P[1])}while(s<r&&4===i.currentToken())}0!==s&&(e&&s>r&&z===I&&0===d(P,B,z)?(A--,s--):null!==p&&(p.add(1),k.add(-1)))}return A&&(o.resize(S),_.resize(S),A>0&&(o.add(A),_.add(0)),a.setAttributeStreamRef(0,u),a.setPathFlagsStreamRef(_),a.setPathStreamRef(o),null!==p&&(a.updateCurveCounter(N),a.setSegmentData(k,b,p,y)),a.notifyModifiedFlags(65535)),{geometry:s,as:h,bs:f}}function H(e,n){2!==n.currentToken()&&t("failed to parse multipoint: array of vertices is expected");let r=0;const i=new E,s=v(2,0);let a=0;const o=4,u=m(o,Number.NaN),c=new l;let d=null,_=null;for(;4!==n.nextToken();){for(2!==n.currentToken()&&t("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),a=0;4!==n.nextToken();)a===o&&t("failed to parse multipoint: each vertex array has to have at most 4 elements"),u[a++]=ee(n);a<2&&t("failed to parse multipoint: each vertex array has to have at least 2 elements"),D(u[0],u[1])||t("failed to parse multipoint: x and y must be finite"),s.size()===2*r&&s.resize(re(r)),s.writePoint2D(2*r,c.setCoords(u[0],u[1])),d&&d.size()===r&&d.resize(ie(r)),a>2?(d||(d=v(r+1,Number.NaN)),d.write(r,u[2])):d&&d.write(r,Number.NaN),_&&_.size()===r&&_.resize(ie(r)),a>3?(_||(_=v(r+1,Number.NaN)),_.write(r,u[3])):_&&_.write(r,Number.NaN),r++}if(r){const e=i.getImpl();e.setAttributeStreamRef(0,s),e.resizeNoInit(r),e.notifyModifiedFlags(65535)}return{geometry:i,as:d,bs:_}}function $(e,n){2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected");const r=F(2,0);let i=0,s=-1;for(;4!==n.nextToken();){const e=i;r.size()===i&&r.resize(ie(i)),i++;let a=0;for(-1===s?s=2===n.currentToken()?1:0:1===s&&2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected"),0===s&&(r.size()===i&&r.resize(ie(i)),r.write(i,te(n)),a++,i++);4!==n.nextToken();)r.size()===i&&r.resize(ie(i)),r.write(i,te(n)),a++,i++;if(r.write(e,a),0===s)break}return r.resize(i),r}function ee(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function te(e){return e.currentInt32Value()}function ne(t,n){if(t.isEmpty())return;const r=F(2,0),i=t.getGeometryType();let s=0;i===E.type?s=1:i===z.type||i===O.type?s=t.getPathCount():e("not implemented"),r.resize(t.getPointCount(),0);let a=0;for(let o=0;o<s;++o){const s=n.read(a);a++;const u=a+s;let m=0,l=0;i===E.type?m=t.getPointCount():i===z.type||i===O.type?(m=t.getPathSize(o),l=t.getPathStart(o)):e("not implemented");for(let e=0,t=Math.min(s,m);e<t;++e)r.write(l,n.read(a)),a++,l++;a=u}t.getImpl().setAttributeStreamRef(3,r)}function re(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function ie(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function se(e,t,n,i,s){s>=i.size()&&r("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const a=l.getNAN();a.x=i.readDouble(s),a.y=i.readDouble(s+8);const o=i.readInt32(s+16);if(!!(1&o))return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),!1;let u=!!(64&o);const m=!!(128&o);let c=!!(32&o);const d=!!(8&o),_=!!(16&o),h=t.equals(n);return u&&!h&&(u=!1,c=!0),c&&h&&(u=!0,c=!1,a.setCoords(0,0)),u||(m?c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,a),h&&d===e.isClockwise()&&e.reverse()):c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),e.queryCoord2D(.5,e.m_interior)):V(e,t,n,a,d,_)),u&&(e.m_center.assign(t),e.m_startAngle=a.x,e.m_sweepAngle=a.y,M(e,Number.NaN,d,_),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),R(e),!0}function ae(e,t,n,r,i){e.m_bits=0,e.m_center.x=r.readDouble(i),e.m_center.y=r.readDouble(i+8),e.m_rotation=r.readDouble(i+16),e.m_semiMajorAxis=r.readDouble(i+24),e.m_minorMajorRatio=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const s=r.readInt32(i+40);if(1&s)return!1;let a=!!(64&s),o=!!(128&s);const u=!!(2048&s),m=!!(4096&s);return!!!(512&s)&&!!!(1024&s)||o||(a=!0),o&&!t.equals(n)?(o=!1,a=!0):a&&t.equals(n)&&(o=!0,a=!1),o?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,M(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),R(e),!0}function oe(e,t,r,i,s){return n(s+32<=i.size()),e.m_cp=_(l,2),e.m_cp[0].x=i.readDouble(s),e.m_cp[0].y=i.readDouble(s+8),e.m_cp[1].x=i.readDouble(s+16),e.m_cp[1].y=i.readDouble(s+24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=r.x,e.m_YEnd=r.y,!0}function ue(e,t,n,r,i){return e.m_cp.x=r.readDouble(i),e.m_cp.y=r.readDouble(i+8),e.m_weights[0]=r.readDouble(i+16),e.m_weights[1]=r.readDouble(i+24),e.m_weights[2]=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function me(e,n,r,i,s){const a={segFlag:0,toPointSz:0};let o=i.currentToken();o=i.nextToken();const u=i.currentString(),m=u[0];for((1!==u.length||"a"!==m&&"b"!==m&&"c"!==m&&"n"!==m&&"q"!==m)&&t('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for curve parameters"),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for to point"),a.toPointSz=0;4!==i.nextToken();)4===a.toPointSz&&t("failed to parse curve: vertex array cannot have more than 4 elements"),n[a.toPointSz++]=ee(i);a.toPointSz<2&&t("failed to parse curve: vertex array must have at least 2 elements");const c=l.construct(n[0],n[1]),d=l.getNAN();let _=-1,h=-1,f=!1,p=Number.NaN,k=Number.NaN,b=Number.NaN;const y=[l.getNAN(),l.getNAN(),l.getNAN()],N=l.getNAN();if("a"===m){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for center point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for center point"),d.setCoords(e,n),o=i.nextToken(),_=i.currentInt32Value(),o=i.nextToken(),h=i.currentInt32Value(),o=i.nextToken(),4!==o?(f=!1,p=ee(i),o=i.nextToken(),k=ee(i),o=i.nextToken(),b=ee(i),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters")):f=!0,a.segFlag=4}else if("b"===m){for(let e=0;e<2;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=2}else if("n"===m){{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[0].setCoords(e,n)}o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);y[1].setCoords(e,n),y[2].setCoords(r,r),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=8}else if("q"===m){for(let e=0;e<1;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=16}else{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for interior point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for interior point"),N.setCoords(e,n),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=4}if(o=i.nextToken(),3!==o&&t("failed to parse curve: end object is expected for curve"),"a"===m)if(e.createEllipticArc(),f){const t=!0;le(e.get(),r,c,d,t,_,h)}else ce(e.get(),r,c,d,_,h,p,k,b);else if("b"===m)e.createCubicBezier(),de(e.get(),r,c,y);else if("n"===m)e.createQuadraticRationalBezier(),_e(e.get(),r,c,y[0],y[1].x,y[1].y,y[2].x);else if("q"===m)e.createQuadraticBezier(),e.get().construct(r,y[0],c);else{e.createEllipticArc();const t=!1;le(e.get(),r,c,N,t,-1,-1)}return a}function le(e,t,n,r,i,s,a){e.dropAllAttributes();const o=20,u=new ArrayBuffer(o),m=new q({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8;let c=0;i?(a||(c|=8),s&&(c|=16)):c|=128,m.writeInt32(l,c),l+=4,se(e,t,n,m,0)}function ce(e,t,n,r,i,s,a,o,u){e.dropAllAttributes();const m=44,l=new ArrayBuffer(m),c=new q({sz:m,buffer:l});let d=0;c.writeDouble(d,r.x),d+=8,c.writeDouble(d,r.y),d+=8,c.writeDouble(d,a),d+=8,c.writeDouble(d,o),d+=8,c.writeDouble(d,u),d+=8;let _=0;s||(_|=2048),i&&(_|=4096),c.writeInt32(d,_),d+=4,ae(e,t,n,c,0)}function de(e,t,n,r){e.dropAllAttributes();const i=32,s=new ArrayBuffer(i),a=new q({sz:i,buffer:s});let o=0;a.writeDouble(o,r[0].x),o+=8,a.writeDouble(o,r[0].y),o+=8,a.writeDouble(o,r[1].x),o+=8,a.writeDouble(o,r[1].y),o+=8,oe(e,t,n,a,0)}function _e(e,t,n,r,i,s,a){e.dropAllAttributes();const o=40,u=new ArrayBuffer(o),m=new q({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8,m.writeDouble(l,i),l+=8,m.writeDouble(l,s),l+=8,m.writeDouble(l,a),l+=8,ue(e,t,n,m,0)}function he(e,t,n,r,i){const o=e.getGeometryType();if(o===s.enumEllipticArc)return fe(e,t,n,r,i);if(o===s.enumBezier)return pe(e,t,n,r,i);if(o===s.enumRationalBezier2)return ke(e,t,n,r,i);if(o===s.enumBezier2){const s=new P;return s.constructFromQuadraticSegment(e),pe(s,t,n,r,i)}a("")}function fe(e,t,r,i,s){n(!B(e));const a=e.getEndXY(),o=e.hasAttribute(1)&&!t,u=e.hasAttribute(2)&&!r;let m=Number.NaN,l=Number.NaN;if(o&&(m=e.getEndAttributeAsDbl(1,0)),u&&(l=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return be(o,u,a.x,a.y,m,l,i,s),!0;const c=0===e.projectionBehavior(),d=!!c&&e.isClosed();if(c&&!d)s.startObject(),s.addFieldName("c"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s),ye(e.m_interior.x,e.m_interior.y,17,s),s.endArray(),s.endObject();else if(c){s.startObject(),s.addFieldName("a"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s);const t=0,n=0;ye(e.m_center.x+t,e.m_center.y+n,17,s);const r=!e.isMajor();s.addInt32(r?1:0);const c=e.isClockwise();s.addInt32(c?1:0),s.endArray(),s.endObject()}else{s.startObject(),s.addFieldName("a"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s);const t=e;ye(t.m_center.x,t.m_center.y,17,s);const n=!t.isMajor();s.addInt32(n?1:0);const r=t.isClockwise();s.addInt32(r?1:0),s.addDouble(t.m_rotation,17),s.addDouble(t.m_semiMajorAxis,17),s.addDouble(t.m_minorMajorRatio,17),s.endArray(),s.endObject()}return!1}function pe(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),be(a,o,s.x,s.y,u,m,r,i),ye(e.m_cp[0].x,e.m_cp[0].y,r,i),ye(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function ke(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),be(a,o,s.x,s.y,u,m,r,i),ye(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}function be(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function ye(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}class Ne{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s){Te(e,t,n,r)}exportSpatialReference(e,t,r,i){n(0)}exportProjectionTransformation(e,t,r,i){n(0)}exportDatumTransformation(e,t,r,i){n(0)}static geometryTypeToString(e){return n(0),""}}function Te(t,r,i,a,o){if(r||i){if(a.startObject(),null!==r){switch(r.getGeometryType()){case s.enumPolygon:ge(!0,t,r,a);break;case s.enumPolyline:ge(!1,t,r,a);break;case s.enumMultiPoint:ve(t,r,a);break;case s.enumPoint:xe(t,r,a);break;case s.enumEnvelope:Ae(t,r,a);break;case s.enumMultipatch:n(0);break;default:e("exportToJSON")}}null!==i&&(a.addFieldName("spatialReference"),we(t,i,a)),a.endObject()}}function ge(e,t,r,i){const s=r.getImpl(),o=!!(2&t),u=!!(4&t),m=!!(8&t),l=s.hasAttribute(1)&&!o,c=s.hasAttribute(2)&&!u,d=s.hasAttribute(3)&&!m,_=s.hasNonLinearSegments();l&&(i.addFieldName("hasZ"),i.addBool(!0)),c&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let h=null;const f=[];if(r.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const n=r.getPathCount();let m=0;const p=s.getAttributeStreamRef(0);let k=null,b=null,y=null;const N=new I;let T=null,g=null,v=null;_&&(T=s.getSegmentFlagsStreamRef(),g=s.getSegmentIndexStreamRef(),v=s.getSegmentDataStreamRef()),l&&(k=s.getAttributeStreamRef(1)),c&&(b=s.getAttributeStreamRef(2)),d&&(y=s.getAttributeStreamRef(3),h=j(3,0));for(let t=0;t<n;t++){i.startArray(),d&&f.push(0);const n=r.getPathEnd(t);if(m===n){i.endArray();continue}const s=r.isClosedPath(t);let _=p.read(2*m),x=p.read(2*m+1),A=l?k.read(m):Number.NaN,S=c?b.read(m):Number.NaN,w=d?y.read(m):0;Ce(l,c,_,x,A,S,e,i);let C=1;d&&(h.add(w),f[f.length-1]++);const D=_,F=x,j=A,O=S,z=w;let I=!1,E=0,P=Number.NaN,B=Number.NaN,R=0;for(let t=m+1,r=m,V=s?n+1:n;t<V;t++,r++){const s=null!==T?31&T.read(r):1;let m,V;if(t<n?(m=p.read(2*t),V=p.read(2*t+1),l&&(P=k.read(t)),c&&(B=b.read(t)),d&&(R=y.read(t))):(m=D,V=F,P=j,B=O,R=z),1!==s){I=!0,4===s?N.createEllipticArc():2===s?N.createCubicBezier():16===s?N.createQuadraticBezier():8===s?N.createQuadraticRationalBezier():a("JSON export.unsupported curve");const t=N.get(),n=g.read(r);t.setStartXYCoords(_,x),t.setEndXYCoords(m,V),l&&(t.setStartAttribute(1,0,A),t.setEndAttribute(1,0,P)),c&&(t.setStartAttribute(2,0,S),t.setEndAttribute(2,0,B)),t.readFromBufferStream(v,n);he(N.get(),o,u,e,i)&&E++}else Ce(l,c,m,V,P,B,e,i);d&&(h.add(R),f[f.length-1]++),C++,_=m,x=V,A=P,S=B,w=R}I&&0===E||(C<2&&E<1&&(Ce(l,c,_,x,A,S,e,i),C++,d&&(h.add(w),f[f.length-1]++)),s&&C<3&&E<2&&(Ce(l,c,D,F,j,O,e,i),C++,_=D,x=F,A=j,S=O,w=z,d&&(h.add(z),f[f.length-1]++))),i.endArray(),m=n}i.endArray()}if(d){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,r=f.length;t<r;++t){const r=f[t];n(0===r||null!==h&&e+r<=h.size()),i.startArray();for(let t=0;t<r;++t)i.addInt32(h.read(e)),e++;i.endArray()}i.endArray()}}function ve(e,t,r){const i=t.getImpl(),s=i.hasAttribute(1)&&!(2&e),a=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);s&&(r.addFieldName("hasZ"),r.addBool(!0)),a&&(r.addFieldName("hasM"),r.addBool(!0)),r.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())r.startArray(),r.endArray();else{const t=17-(31&e>>13);r.startArray();const n=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=n.read(2*e),u=n.read(2*e+1);let l=Number.NaN,c=Number.NaN;s&&(l=o.read(e)),a&&(c=m.read(e)),Ce(s,a,i,u,l,c,t,r)}r.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),n(0===u||null!==e&&e.size()>=u),r.addFieldName("ids"),r.startArray();for(let t=0;t<u;t++)r.addInt32(e.read(t));r.endArray()}}function xe(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}function Ae(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}function Se(e,n,r){r.startObject();const i=n.getID();i<=0&&t("cannot export unit that has no valid WKID"),r.addFieldName("uwkid"),r.addInt32(i),r.endObject()}function we(e,t,n){n.startObject();let r=0;t.isCustomWkid()||(r=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(r=0)),r>0){n.addFieldName("wkid"),n.addInt32(r);const e=t.getLatestID();if(e>0&&e!==r&&(n.addFieldName("latestWkid"),n.addInt32(e)),i>0){n.addFieldName("vcsWkid"),n.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),Se(e,t.getUnit(),n));else if(r<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new N;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}function Ce(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const De={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_r:"r".charCodeAt(0),s_t:"t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class Fe{constructor(t){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===t?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push(()=>this.accept_()),this.m_jsonString=null,this.m_bHasEscapes=!1):t.jsonString?this.resetParserFromString(t.jsonString):t.jsonStream?a("streaming json parsing not yet impl"):e("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){a("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push(()=>this.start_()),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){a("streaming json parsing not yet impl")}resetToPosition(e){return!!this.m_jsonString&&(this.m_endToken=e,this.m_startToken=Number.MAX_VALUE,this.m_currentTokenType=0,this.m_functionStack.length=0,e>=this.m_jsonString.length?(this.m_functionStack.push(()=>this.accept_()),!1):(this.m_functionStack.push(()=>this.start_()),!0))}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return n(0),""}childrenAsString(){return n(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e);return}if(2===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e);return}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}t("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===De.s_backslash&&t.charCodeAt(r+1)===De.s_u;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===De.s_backslash&&t.charCodeAt(r+1)===De.s_u;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==De.s_backslash)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case De.s_doubleQuote:e+='"';break;case De.s_u:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case De.s_backslash:e+="\\";break;case De.s_forwardslash:e+="/";break;case De.s_b:e+="\b";break;case De.s_f:e+="\f";break;case De.s_n:e+="\n";break;case De.s_r:e+="\r";break;case De.s_t:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&t("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),n-=2,0===n&&t("invalid token")}const r=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(r)&&t("invalid token");else if(Number.isNaN(r))return Number.NaN;return r}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&t("invalid token");let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),n-=2,0===n&&t("invalid token"));const r=parseInt(e);return Number.isNaN(r)&&t("invalid token"),r}currentInt64Value(){return n(0),0n}currentBoolValue(){return n(0),!1}isError(){return 0}JSONString(){return n(0),""}pushPosition(){return n(0),!1}popPosition(){return n(0),!1}skipCStyleComments_(){n(0)}skipCppStyleComments_(){n(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e===De.s_asterisk?this.skipCStyleComments_():e===De.s_forwardslash?this.skipCppStyleComments_():t("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&t("invalid token");let n=this.m_peekChar();for(;n>=9&&n<=13||32===n;)this.m_increment(),this.m_eof()&&t("invalid token"),n=this.m_peekChar();n===De.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===De.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===De.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&t("invalid token");let e=this.m_peekChar();for(;e!==De.s_doubleQuote;){const n=e===De.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),n)if(this.m_bHasEscapes=!0,e===De.s_doubleQuote||e===De.s_backslash||e===De.s_forwardslash||e===De.s_b||e===De.s_f||e===De.s_n||e===De.s_r||e===De.s_t)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar();else if(e===De.s_u)for(let r=0;r<4;r++)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=De.s_zero&&e<=De.s_nine||e>=De.s_a&&e<=De.s_f||e>=De.s_A&&e<=De.s_F||t("invalid token");else t("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===De.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===De.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):t("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==De.s_doubleQuote&&t("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push(()=>this.fieldNameEnd_())}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():t("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push(()=>this.elementEnd_()),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():t("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push(()=>this.pairEnd_()),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push(()=>this.objectStart_())}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push(()=>this.arrayStart_())}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==De.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()}while(e>=De.s_zero&&e<=De.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=De.s_zero&&e<=De.s_nine||t("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e!==De.s_plus&&e!==De.s_minus||(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()),e>=De.s_zero&&e<=De.s_nine||t("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,n=this.m_peekChar();if(n===De.s_minus?(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),n=this.m_peekChar(),e=!0,n>=De.s_zero&&n<=De.s_nine||t("invalid token"),this.int_()):this.int_(),n=this.m_peekChar(),n===De.s_period)this.m_currentTokenType=7,this.frac_(),n=this.m_peekChar(),n!==De.s_e&&n!==De.s_E||this.exp_();else if(n===De.s_e||n===De.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"null"!==e&&t("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"true"!==e&&t("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:n}=this.m_get(6);n&&t("invalid token"),"false"!==e&&t("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:n}=this.m_get(4);n&&t("invalid token"),"NaN"!==e&&t("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===De.s_beginObject?this.valueStartObject_():e===De.s_beginArray?this.valueStartArray_():e===De.s_doubleQuote?this.valueString_():e===De.s_minus||e>=De.s_zero&&e<=De.s_zero+9?this.valueNumber_():e===De.s_n?this.valueNull_():e===De.s_t?this.valueTrue_():e===De.s_f?this.valueFalse_():e===De.s_N?this.valueNan_():t("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push(()=>this.accept_());const e=this.m_peekChar();e!==De.s_beginObject&&e!==De.s_beginArray&&t("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class je{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,n,r,i,s,a,o){let u;"string"==typeof r?(u=new Fe({jsonString:r}),u.nextToken()):u=r,1!==u.currentToken()&&t("failed to import map geometry: start of object is expected");const m=K(n,e,u,i,s);return new g(m)}importSpatialReference(t){const n=Q(t);return null===n&&e("failed to import spatial reference"),n}importProjectionTransformation(e,t){return n(0),{}}importDatumTransformation(e,t){return n(0),{}}static stringToGeometryType(e){return(e=e.toLowerCase()).startsWith("esrigeometry")||t("string_to_geometry_type"),e.endsWith("point")?s.enumPoint:e.endsWith("envelope")?s.enumEnvelope:e.endsWith("multipoint")?s.enumMultiPoint:e.endsWith("polyline")?s.enumPolyline:e.endsWith("polygon")?s.enumPolygon:void t("string_to_geometry_type")}}const Oe=new G,ze=new Ne,Ie=new je;function Ee(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function Pe(e,t){const{includeGeometry:n=!0,includeSpatialReference:r=!0}=t??{};r&&(e.spatialReference?.latestVcsWkid||e.spatialReference?.vcsWkid)&&(e={...e,spatialReference:{...e.spatialReference}},delete e.spatialReference?.latestVcsWkid,delete e.spatialReference?.vcsWkid);const i=new L(e,{strict:!1});return i.nextToken(),Ie.execute(0,s.enumUnknown,i,n,r)}function Be(e){let t=null;return[e.map(e=>{if(null==t){const n=Re(e);return t=n.getSpatialReference(),n.getGeometry()}return Ve(e)}),t]}function Re(e){if(e.spatialReference instanceof W){const{wkt2:t}=e.spatialReference;e={...e,spatialReference:e.spatialReference.toJSON()},e.spatialReference.wkt2??=t}return Pe(e)}function Ve(e){return Pe(e,{includeSpatialReference:!1}).getGeometry()}function Me(e){if(e instanceof W){const{wkt2:t}=e;e=e.toJSON(),e.wkt2??=t}const t=Pe({x:0,y:0,spatialReference:e},{includeGeometry:!1}).getSpatialReference();return 0!==t?.getCoordinateSystemType()?t:null}function Ue(e,t){return e instanceof g&&(t=e.getSpatialReference(),e=e.getGeometry()),e?.isEmpty()?null:(Oe.reset(),ze.execute(0,e,t,Oe),Oe.getObject())}export{Be as fromGeometries,Re as fromGeometry,Ve as fromGeometryToGXGeometry,Me as fromSpatialReference,Ee as getSpatialReference,Ue as toGeometry};
5
+ import{P as e,D as t,A as n,n as r,a2 as i,a5 as s,E as a,a0 as o,a1 as u,a6 as m,a7 as l,Y as c}from"../../../chunks/Envelope.js";import{a as d,P as _,M as h,S as f,J as p,a5 as k,a6 as b,a7 as y,a8 as g,a9 as N}from"../../../chunks/MultiPathImpl.js";import{d as T,a as v,g as x,q as A,p as S,G as w,t as C}from"../../../chunks/Geometry.js";import{aJ as D,i as F,d as j,P as z,b as O,aK as I,m as E}from"../../../chunks/Point2D.js";import{q as P,b as B,p as V,aX as R,c as M,e as U,a as W,f as X,aY as Y}from"../../../chunks/UnitFactory.js";import{convertGeometryxToFlat as G,convertGeometryToFlat as L}from"../../FlatGeometry.js";import q from"../../SpatialReference.js";import"./initNoPeFactory.js";import{isPoint as K,isMultipoint as J,isPolyline as Z,isPolygon as Q}from"../../support/jsonUtils.js";function H({type:i,vertexCount:s,vertexXY:a,vertexZ:o,vertexM:u,partCount:m,partOffsets:l,partFlags:c,segmentFlags:d,segmentIndices:_,segmentParams:f,segmentCountArc:p,segmentCountBezier:k}){const b=new $[i];if(b instanceof e)return b.setXYCoords(a[0],a[1]),o&&b.setZ(o[0]),u&&b.setM(u[0]),b;const y=new t({fromArray:a});if(b.setAttributeStreamRef(0,y),o){const e=new t({fromArray:o});b.setAttributeStreamRef(1,e)}if(u){const e=new t({fromArray:u});b.setAttributeStreamRef(2,e)}if(b instanceof h)return b.resizeNoInit(s),b;{const e=m+1,t=new n({fromArray:l,size:e}),i=new r({fromArray:c,size:e});b.setPathStreamRef(t),b.setPathFlagsStreamRef(i)}if(null==d)return b.resizeImpl(s),b;const g=new r({fromArray:d}),N=new n({fromArray:_}),T=new t({fromArray:f});return b.setSegmentData(N,T,g,f.length),b.incCurveType(4,p),b.incCurveType(2,k),b.modifyCurveCounter(p+k),b.resizeImpl(s),b}const $={point:e,multipoint:h,polyline:_,polygon:d};function ee(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function te(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}class ne{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter(t=>void 0!==e[t]),m_i:-1,m_bReturnKey:!0,next:ee}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:te}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=D()&&this.m_currentValue<=F()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;T("unrecognized json element type")}return T("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&v("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&v("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&v("invalid token"),this.m_currentValue}currentInt64Value(){return x(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&v("invalid token"),this.m_currentValue}isError(){return 0}}class re{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){x(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class ie{constructor(e){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==e.sz?(this.m_sz=e.sz,e.buffer?(this.m_sz<0&&A("size out of range"),this.m_buffer=e.buffer,this.m_offset=void 0!==e.offset?e.offset:0,this.m_view=void 0!==e.offset?new DataView(e.buffer,e.offset,e.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&A("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):e.move?(this.m_sz=e.move.m_sz,this.m_buffer=e.move.m_buffer,this.m_view=e.move.m_view,this.m_bOwnsBuffer=e.move.m_bOwnsBuffer,this.m_bLittleEndian=e.move.m_bLittleEndian,e.move.m_buffer=null,e.move.m_view=null,e.move.m_sz=0,void(e.move.m_bOwnsBuffer=!0)):void T("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===ie.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===ie.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||S("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){x(e>=0&&e<=this.m_sz),this.m_sz=e}}function se(t,n,r,o,u,m){let l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=!1,y=!1,g=!1,N=!1,T=!1,A=!1,S=!1,C=!1,D=!1,F=!1,j=!1,z=!1,O=!1,I=!1,E=!1,P=!1,B=Number.NaN,V=Number.NaN,R=Number.NaN,M=Number.NaN,U=0,W=Number.NaN,X=Number.NaN,Y=Number.NaN,G=Number.NaN,L=Number.NaN,q=Number.NaN,K=Number.NaN,J=Number.NaN,Z=0,Q=0,H=!1,$=!1,ee=null,te=null,ne=null,re=null,ie=null;for(;3!==r.nextToken();){const e=r.currentString();if(r.nextToken(),"spatialReference"===e){if(u&&!l){l=!0,1===r.currentToken()?re=oe(r):10!==r.currentToken()&&v("failed to parse spatial reference: object or null is expected");continue}}else if(o)if("hasZ"===e){if(!c){c=!0,H=11===r.currentToken();continue}}else if("hasM"===e){if(!d){d=!0,$=11===r.currentToken();continue}}else if("rings"===e){if(!(h||f||t!==w.enumUnknown&&t!==w.enumPolygon)){h=!0,({geometry:ie,as:ee,bs:te}=ue(!0,!1,n,r));continue}}else if("curveRings"===e){if(!f&&(t===w.enumUnknown||t===w.enumPolygon)){f=!0,({geometry:ie,as:ee,bs:te}=ue(!0,!0,n,r));continue}}else if("paths"===e){if(!(p||k||t!==w.enumUnknown&&t!==w.enumPolyline)){p=!0,({geometry:ie,as:ee,bs:te}=ue(!1,!1,n,r));continue}}else if("curvePaths"===e){if(!k&&(t===w.enumUnknown||t===w.enumPolyline)){k=!0,({geometry:ie,as:ee,bs:te}=ue(!1,!0,n,r));continue}}else if("points"===e){if(!b&&(t===w.enumUnknown||t===w.enumMultiPoint)){b=!0,({geometry:ie,as:ee,bs:te}=me(n,r));continue}}else if("ids"===e){if(!_){_=!0,ne=le(n,r);continue}}else if("x"===e){if(!y&&(t===w.enumUnknown||t===w.enumPoint)){y=!0,B=ce(r);continue}}else if("y"===e){if(!g&&(t===w.enumUnknown||t===w.enumPoint)){g=!0,V=ce(r);continue}}else if("z"===e){if(!N&&(t===w.enumUnknown||t===w.enumPoint)){N=!0,R=ce(r);continue}}else if("m"===e){if(!T&&(t===w.enumUnknown||t===w.enumPoint)){T=!0,M=ce(r);continue}}else if("id"===e){if(!A&&(t===w.enumUnknown||t===w.enumPoint)){A=!0,U=de(r);continue}}else if("xmin"===e){if(!S&&(t===w.enumUnknown||t===w.enumEnvelope)){S=!0,W=ce(r);continue}}else if("ymin"===e){if(!C&&(t===w.enumUnknown||t===w.enumEnvelope)){C=!0,X=ce(r);continue}}else if("mmin"===e){if(!O&&(t===w.enumUnknown||t===w.enumEnvelope)){O=!0,K=ce(r);continue}}else if("zmin"===e){if(!j&&(t===w.enumUnknown||t===w.enumEnvelope)){j=!0,L=ce(r);continue}}else if("idmin"===e){if(!E&&(t===w.enumUnknown||t===w.enumEnvelope)){E=!0,Z=de(r);continue}}else if("xmax"===e){if(!D&&(t===w.enumUnknown||t===w.enumEnvelope)){D=!0,Y=ce(r);continue}}else if("ymax"===e){if(!F&&(t===w.enumUnknown||t===w.enumEnvelope)){F=!0,G=ce(r);continue}}else if("mmax"===e){if(!I&&(t===w.enumUnknown||t===w.enumEnvelope)){I=!0,J=ce(r);continue}}else if("zmax"===e){if(!z&&(t===w.enumUnknown||t===w.enumEnvelope)){z=!0,q=ce(r);continue}}else if("idmax"===e){if(!P&&(t===w.enumUnknown||t===w.enumEnvelope)){P=!0,Q=de(r);continue}}else"materials"===e&&x(0);r.skipChildren()}if(h||f||p||k||b){let e=null,t=null;const n=ie;H&&(ie.addAttribute(1),e=ee,e||(e=i(n.getPointCount(),Number.NaN))),$&&(ie.addAttribute(2),t=H?te:ee),null!=ne&&ie.addAttribute(3),H&&null!=e&&n.setAttributeStreamRef(1,e),$&&null!=t&&n.setAttributeStreamRef(2,t),null!=ne&&_e(n,ne)}else if(y||g||T||N||A){s(B,V)||v("failed to parse point: x and y must be finite or nan"),(Number.isNaN(V)||Number.isNaN(B))&&(B=Number.NaN,V=Number.NaN);const t=new e({x:B,y:V});N&&t.setZ(R),T&&t.setM(M),A&&t.setID(U),ie=t}else if(S||C||D||F||j||z||O||I||E||P){(Number.isNaN(X)||Number.isNaN(Y)||Number.isNaN(G))&&(W=Number.NaN);const e=new a({xmin:W,ymin:X,xmax:Y,ymax:G});j&&z&&e.setInterval(1,0,L,q),O&&I&&e.setInterval(2,0,K,J),E&&P&&e.setInterval(3,0,Z,Q),ie=e}return{...ie?{geom:ie}:{},...re?{sr:re}:{}}}function ae(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function oe(e){let t=!1,n=!1,r=!1,i=!1,s=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=-1,y=-1,g=-1,N=-1,T=0,v=0,x=0,A=0,S=0,w=0,C=0,D=0,F=0,j=0,z="",O="",I=null;for(;3!==e.nextToken();){const E=e.currentString();e.nextToken(),"wkid"===E?t||(t=!0,8===e.currentToken()&&(b=e.currentInt32Value())):"latestWkid"===E?n||(n=!0,8===e.currentToken()&&(y=e.currentInt32Value())):"wkt"===E?s||(s=!0,6===e.currentToken()&&(z=e.currentString())):"wkt2"===E?s||6===e.currentToken()&&(O=e.currentString()):"vcsWkid"===E?r||(r=!0,8===e.currentToken()&&(g=e.currentInt32Value())):"latestVcsWkid"===E?i||(i=!0,8===e.currentToken()&&(N=e.currentInt32Value())):"xyTolerance"===E?o||(o=!0,a=!0,T=e.currentDoubleValue()):"zTolerance"===E?u||(u=!0,a=!0,v=e.currentDoubleValue()):"mTolerance"===E?m||(m=!0,a=!0,x=e.currentDoubleValue()):"falseX"===E?l||(l=!0,a=!0,C=e.currentDoubleValue()):"falseY"===E?c||(c=!0,a=!0,D=e.currentDoubleValue()):"falseZ"===E?d||(d=!0,a=!0,F=e.currentDoubleValue()):"falseM"===E?_||(_=!0,a=!0,j=e.currentDoubleValue()):"xyUnits"===E?h||(h=!0,a=!0,A=e.currentDoubleValue()):"zUnits"===E?f||(f=!0,a=!0,S=e.currentDoubleValue()):"mUnits"===E?p||(p=!0,a=!0,w=e.currentDoubleValue()):"unit"===E?k||(k=!0,I=ae(e)):e.skipChildren()}N<=0&&g>0&&(N=g),g<=0&&N>0&&(g=N);let E=null,Y=!0;if(0!==z.length&&(Y=!1,P(z)&&(E=B(z))),E||0===O.length||(Y=!1,P(O)&&(E=B(O))),!E&&y>0&&(Y=!1,V(y)&&(N<=0||R())&&(E=M(y,N))),!E&&b>0&&(Y=!1,V(b)&&(g<=0||R())&&(E=M(b,g))),Y&&(E=U(I)),a&&E){const e=new W;E.queryPrecisionDescriptorWithoutFalseXY(e),o&&e.setTolerance(0,T),u&&e.setTolerance(1,v),m&&e.setTolerance(2,x),h&&l&&c&&e.setGridParams(C,D,A),f&&d&&e.setZParams(F,S),p&&_&&e.setMParams(j,w),E=X(E,e)}return E}function ue(e,t,n,r){2!==r.currentToken()&&v("failed to parse multipath: array of array of vertices is expected");const s=e?new d:new _,a=s,l=o(0),c=i(2,0),h=u(0);let p=null,k=null,b=null,y=null,g=null,T=0,x=0,A=0;const S=new f,w=z.getNAN();let C=0,D=0;const F=e?1:0;for(;4!==r.nextToken();){2!==r.currentToken()&&v("failed to parse multipath: ring/path array is expected");let n=2,s=0,d=!0;const _=4;let f=0,E=0;const P=z.getNAN(),B=j(_,Number.NaN),V=j(_,Number.NaN);let R=!1;for(r.nextToken();4!==r.currentToken();){if(t&&1===r.currentToken())d&&v("failed to parse multipath: starting vertex array is expected"),b||(b=u(C-1,1),y=o(C-1,-1),g=i(0)),R=!0,n=1,({segFlag:A,toPointSz:f}=ge(S,B,w,r));else{for(R=!1,2!==r.currentToken()&&v("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),f=0;4!==r.nextToken();)f===_&&v("failed to parse multipath: each vertex array has to have at most 4 elements"),B[f++]=ce(r);f<2&&v("failed to parse multipath: each vertex array has to have at least 2 elements"),m(B[0],B[1])||v("failed to parse multipath: x and y must be finite")}r.nextToken();do{if(c.size()===2*C&&c.resize(he(C)),c.writePoint2D(2*C,P.setCoords(B[0],B[1])),p&&p.size()===C&&p.resize(fe(C)),f>2?(p||(p=i(C+1,Number.NaN)),p.write(C,B[2])):p&&p.write(C,Number.NaN),k&&k.size()===C&&k.resize(fe(C)),f>3?(k||(k=i(C+1,Number.NaN)),k.write(C,B[3])):k&&k.write(C,Number.NaN),d)D++,l.add(C),h.add(F),d=!1,E=f,O(V,B,0,0,E);else if(null!==b)if(R){const e=N(A),t=g.size();g.resize(t+e),b.add(A),y.add(T),S.get().writeInBufferStream(g,T),T+=e,a.incCurveType(A,1),x++}else b.add(1),y.add(-1);C++,s++,w.setCoords(B[0],B[1])}while(s<n&&4===r.currentToken())}0!==s&&(e&&s>n&&f===E&&0===I(B,V,f)?(C--,s--):null!==b&&(b.add(1),y.add(-1)))}return C&&(l.resize(D),h.resize(D),C>0&&(l.add(C),h.add(0)),a.setAttributeStreamRef(0,c),a.setPathFlagsStreamRef(h),a.setPathStreamRef(l),null!==b&&(a.updateCurveCounter(x),a.setSegmentData(y,g,b,T)),a.notifyModifiedFlags(65535)),{geometry:s,as:p,bs:k}}function me(e,t){2!==t.currentToken()&&v("failed to parse multipoint: array of vertices is expected");let n=0;const r=new h,s=i(2,0);let a=0;const o=4,u=j(o,Number.NaN),l=new z;let c=null,d=null;for(;4!==t.nextToken();){for(2!==t.currentToken()&&v("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),a=0;4!==t.nextToken();)a===o&&v("failed to parse multipoint: each vertex array has to have at most 4 elements"),u[a++]=ce(t);a<2&&v("failed to parse multipoint: each vertex array has to have at least 2 elements"),m(u[0],u[1])||v("failed to parse multipoint: x and y must be finite"),s.size()===2*n&&s.resize(he(n)),s.writePoint2D(2*n,l.setCoords(u[0],u[1])),c&&c.size()===n&&c.resize(fe(n)),a>2?(c||(c=i(n+1,Number.NaN)),c.write(n,u[2])):c&&c.write(n,Number.NaN),d&&d.size()===n&&d.resize(fe(n)),a>3?(d||(d=i(n+1,Number.NaN)),d.write(n,u[3])):d&&d.write(n,Number.NaN),n++}if(n){const e=r.getImpl();e.setAttributeStreamRef(0,s),e.resizeNoInit(n),e.notifyModifiedFlags(65535)}return{geometry:r,as:c,bs:d}}function le(e,t){2!==t.currentToken()&&v("failed to parse array of IDs: array of array of integers is expected");const n=l(2,0);let r=0,i=-1;for(;4!==t.nextToken();){const e=r;n.size()===r&&n.resize(fe(r)),r++;let s=0;for(-1===i?i=2===t.currentToken()?1:0:1===i&&2!==t.currentToken()&&v("failed to parse array of IDs: array of array of integers is expected"),0===i&&(n.size()===r&&n.resize(fe(r)),n.write(r,de(t)),s++,r++);4!==t.nextToken();)n.size()===r&&n.resize(fe(r)),n.write(r,de(t)),s++,r++;if(n.write(e,s),0===i)break}return n.resize(r),n}function ce(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function de(e){return e.currentInt32Value()}function _e(e,t){if(e.isEmpty())return;const n=l(2,0),r=e.getGeometryType();let i=0;r===h.type?i=1:r===_.type||r===d.type?i=e.getPathCount():T("not implemented"),n.resize(e.getPointCount(),0);let s=0;for(let a=0;a<i;++a){const i=t.read(s);s++;const o=s+i;let u=0,m=0;r===h.type?u=e.getPointCount():r===_.type||r===d.type?(u=e.getPathSize(a),m=e.getPathStart(a)):T("not implemented");for(let e=0,r=Math.min(i,u);e<r;++e)n.write(m,t.read(s)),s++,m++;s=o}e.getImpl().setAttributeStreamRef(3,n)}function he(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function fe(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function pe(e,t,n,r,i){i>=r.size()&&A("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const s=z.getNAN();s.x=r.readDouble(i),s.y=r.readDouble(i+8);const a=r.readInt32(i+16);if(!!(1&a))return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(s),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,b(e),!1;let o=!!(64&a);const u=!!(128&a);let m=!!(32&a);const l=!!(8&a),c=!!(16&a),d=t.equals(n);return o&&!d&&(o=!1,m=!0),m&&d&&(o=!0,m=!1,s.setCoords(0,0)),o||(u?m?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(s),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,s),d&&l===e.isClockwise()&&e.reverse()):m?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,b(e),e.queryCoord2D(.5,e.m_interior)):y(e,t,n,s,l,c)),o&&(e.m_center.assign(t),e.m_startAngle=s.x,e.m_sweepAngle=s.y,g(e,Number.NaN,l,c),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),b(e),!0}function ke(e,t,n,r,i){e.m_bits=0,e.m_center.x=r.readDouble(i),e.m_center.y=r.readDouble(i+8),e.m_rotation=r.readDouble(i+16),e.m_semiMajorAxis=r.readDouble(i+24),e.m_minorMajorRatio=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const s=r.readInt32(i+40);if(1&s)return!1;let a=!!(64&s),o=!!(128&s);const u=!!(2048&s),m=!!(4096&s);return!!!(512&s)&&!!!(1024&s)||o||(a=!0),o&&!t.equals(n)?(o=!1,a=!0):a&&t.equals(n)&&(o=!0,a=!1),o?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,g(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,b(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),b(e),!0}function be(e,t,n,r,i){return x(i+32<=r.size()),e.m_cp=E(z,2),e.m_cp[0].x=r.readDouble(i),e.m_cp[0].y=r.readDouble(i+8),e.m_cp[1].x=r.readDouble(i+16),e.m_cp[1].y=r.readDouble(i+24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function ye(e,t,n,r,i){return e.m_cp.x=r.readDouble(i),e.m_cp.y=r.readDouble(i+8),e.m_weights[0]=r.readDouble(i+16),e.m_weights[1]=r.readDouble(i+24),e.m_weights[2]=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function ge(e,t,n,r,i){const s={segFlag:0,toPointSz:0};let a=r.currentToken();a=r.nextToken();const o=r.currentString(),u=o[0];for((1!==o.length||"a"!==u&&"b"!==u&&"c"!==u&&"n"!==u&&"q"!==u)&&v('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),a=r.nextToken(),2!==a&&v("failed to parse curve: start array is expected for curve parameters"),a=r.nextToken(),2!==a&&v("failed to parse curve: start array is expected for to point"),s.toPointSz=0;4!==r.nextToken();)4===s.toPointSz&&v("failed to parse curve: vertex array cannot have more than 4 elements"),t[s.toPointSz++]=ce(r);s.toPointSz<2&&v("failed to parse curve: vertex array must have at least 2 elements");const m=z.construct(t[0],t[1]),l=z.getNAN();let c=-1,d=-1,_=!1,h=Number.NaN,f=Number.NaN,p=Number.NaN;const k=[z.getNAN(),z.getNAN(),z.getNAN()],b=z.getNAN();if("a"===u){a=r.nextToken(),2!==a&&v("failed to parse curve: start array is expected for center point"),a=r.nextToken();const e=ce(r);a=r.nextToken();const t=ce(r);a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for center point"),l.setCoords(e,t),a=r.nextToken(),c=r.currentInt32Value(),a=r.nextToken(),d=r.currentInt32Value(),a=r.nextToken(),4!==a?(_=!1,h=ce(r),a=r.nextToken(),f=ce(r),a=r.nextToken(),p=ce(r),a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for curve parameters")):_=!0,s.segFlag=4}else if("b"===u){for(let e=0;e<2;e++){a=r.nextToken(),2!==a&&v("failed to parse curve: start array is expected for control point"),a=r.nextToken();const t=ce(r);a=r.nextToken();const n=ce(r);a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for control point"),k[e].setCoords(t,n)}a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for curve parameters"),s.segFlag=2}else if("n"===u){{a=r.nextToken(),2!==a&&v("failed to parse curve: start array is expected for control point"),a=r.nextToken();const e=ce(r);a=r.nextToken();const t=ce(r);a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for control point"),k[0].setCoords(e,t)}a=r.nextToken();const e=ce(r);a=r.nextToken();const t=ce(r);a=r.nextToken();const n=ce(r);k[1].setCoords(e,t),k[2].setCoords(n,n),a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for curve parameters"),s.segFlag=8}else if("q"===u){for(let e=0;e<1;e++){a=r.nextToken(),2!==a&&v("failed to parse curve: start array is expected for control point"),a=r.nextToken();const t=ce(r);a=r.nextToken();const n=ce(r);a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for control point"),k[e].setCoords(t,n)}a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for curve parameters"),s.segFlag=16}else{a=r.nextToken(),2!==a&&v("failed to parse curve: start array is expected for interior point"),a=r.nextToken();const e=ce(r);a=r.nextToken();const t=ce(r);a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for interior point"),b.setCoords(e,t),a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for curve parameters"),s.segFlag=4}if(a=r.nextToken(),3!==a&&v("failed to parse curve: end object is expected for curve"),"a"===u)if(e.createEllipticArc(),_){const t=!0;Ne(e.get(),n,m,l,t,c,d)}else Te(e.get(),n,m,l,c,d,h,f,p);else if("b"===u)e.createCubicBezier(),ve(e.get(),n,m,k);else if("n"===u)e.createQuadraticRationalBezier(),xe(e.get(),n,m,k[0],k[1].x,k[1].y,k[2].x);else if("q"===u)e.createQuadraticBezier(),e.get().construct(n,k[0],m);else{e.createEllipticArc();const t=!1;Ne(e.get(),n,m,b,t,-1,-1)}return s}function Ne(e,t,n,r,i,s,a){e.dropAllAttributes();const o=20,u=new ArrayBuffer(o),m=new ie({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8;let c=0;i?(a||(c|=8),s&&(c|=16)):c|=128,m.writeInt32(l,c),l+=4,pe(e,t,n,m,0)}function Te(e,t,n,r,i,s,a,o,u){e.dropAllAttributes();const m=44,l=new ArrayBuffer(m),c=new ie({sz:m,buffer:l});let d=0;c.writeDouble(d,r.x),d+=8,c.writeDouble(d,r.y),d+=8,c.writeDouble(d,a),d+=8,c.writeDouble(d,o),d+=8,c.writeDouble(d,u),d+=8;let _=0;s||(_|=2048),i&&(_|=4096),c.writeInt32(d,_),d+=4,ke(e,t,n,c,0)}function ve(e,t,n,r){e.dropAllAttributes();const i=32,s=new ArrayBuffer(i),a=new ie({sz:i,buffer:s});let o=0;a.writeDouble(o,r[0].x),o+=8,a.writeDouble(o,r[0].y),o+=8,a.writeDouble(o,r[1].x),o+=8,a.writeDouble(o,r[1].y),o+=8,be(e,t,n,a,0)}function xe(e,t,n,r,i,s,a){e.dropAllAttributes();const o=40,u=new ArrayBuffer(o),m=new ie({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8,m.writeDouble(l,i),l+=8,m.writeDouble(l,s),l+=8,m.writeDouble(l,a),l+=8,ye(e,t,n,m,0)}function Ae(e,t,n,r,i){const s=e.getGeometryType();if(s===w.enumEllipticArc)return Se(e,t,n,r,i);if(s===w.enumBezier)return we(e,t,n,r,i);if(s===w.enumRationalBezier2)return Ce(e,t,n,r,i);if(s===w.enumBezier2){const s=new p;return s.constructFromQuadraticSegment(e),we(s,t,n,r,i)}C("")}function Se(e,t,n,r,i){x(!k(e));const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;if(a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return De(a,o,s.x,s.y,u,m,r,i),!0;const l=0===e.projectionBehavior(),c=!!l&&e.isClosed();if(l&&!c)i.startObject(),i.addFieldName("c"),i.startArray(),De(a,o,s.x,s.y,u,m,r,i),Fe(e.m_interior.x,e.m_interior.y,17,i),i.endArray(),i.endObject();else if(l){i.startObject(),i.addFieldName("a"),i.startArray(),De(a,o,s.x,s.y,u,m,r,i);const t=0,n=0;Fe(e.m_center.x+t,e.m_center.y+n,17,i);const l=!e.isMajor();i.addInt32(l?1:0);const c=e.isClockwise();i.addInt32(c?1:0),i.endArray(),i.endObject()}else{i.startObject(),i.addFieldName("a"),i.startArray(),De(a,o,s.x,s.y,u,m,r,i);const t=e;Fe(t.m_center.x,t.m_center.y,17,i);const n=!t.isMajor();i.addInt32(n?1:0);const l=t.isClockwise();i.addInt32(l?1:0),i.addDouble(t.m_rotation,17),i.addDouble(t.m_semiMajorAxis,17),i.addDouble(t.m_minorMajorRatio,17),i.endArray(),i.endObject()}return!1}function we(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),De(a,o,s.x,s.y,u,m,r,i),Fe(e.m_cp[0].x,e.m_cp[0].y,r,i),Fe(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function Ce(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),De(a,o,s.x,s.y,u,m,r,i),Fe(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}function De(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function Fe(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}class je{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s){ze(e,t,n,r)}exportSpatialReference(e,t,n,r){x(0)}exportProjectionTransformation(e,t,n,r){x(0)}exportDatumTransformation(e,t,n,r){x(0)}static geometryTypeToString(e){return x(0),""}}function ze(e,t,n,r,i){if(t||n){if(r.startObject(),null!==t){switch(t.getGeometryType()){case w.enumPolygon:Oe(!0,e,t,r);break;case w.enumPolyline:Oe(!1,e,t,r);break;case w.enumMultiPoint:Ie(e,t,r);break;case w.enumPoint:Ee(e,t,r);break;case w.enumEnvelope:Pe(e,t,r);break;case w.enumMultipatch:x(0);break;default:T("exportToJSON")}}null!==n&&(r.addFieldName("spatialReference"),Ve(e,n,r)),r.endObject()}}function Oe(e,t,n,r){const i=n.getImpl(),s=!!(2&t),a=!!(4&t),o=!!(8&t),u=i.hasAttribute(1)&&!s,m=i.hasAttribute(2)&&!a,l=i.hasAttribute(3)&&!o,d=i.hasNonLinearSegments();u&&(r.addFieldName("hasZ"),r.addBool(!0)),m&&(r.addFieldName("hasM"),r.addBool(!0)),e?d?r.addFieldName("curveRings"):r.addFieldName("rings"):d?r.addFieldName("curvePaths"):r.addFieldName("paths");let _=null;const h=[];if(n.isEmpty())r.startArray(),r.endArray();else{const e=17-(31&t>>13);r.startArray();const o=n.getPathCount();let p=0;const k=i.getAttributeStreamRef(0);let b=null,y=null,g=null;const N=new f;let T=null,v=null,x=null;d&&(T=i.getSegmentFlagsStreamRef(),v=i.getSegmentIndexStreamRef(),x=i.getSegmentDataStreamRef()),u&&(b=i.getAttributeStreamRef(1)),m&&(y=i.getAttributeStreamRef(2)),l&&(g=i.getAttributeStreamRef(3),_=c(3,0));for(let t=0;t<o;t++){r.startArray(),l&&h.push(0);const i=n.getPathEnd(t);if(p===i){r.endArray();continue}const o=n.isClosedPath(t);let c=k.read(2*p),d=k.read(2*p+1),f=u?b.read(p):Number.NaN,A=m?y.read(p):Number.NaN,S=l?g.read(p):0;Re(u,m,c,d,f,A,e,r);let w=1;l&&(_.add(S),h[h.length-1]++);const D=c,F=d,j=f,z=A,O=S;let I=!1,E=0,P=Number.NaN,B=Number.NaN,V=0;for(let t=p+1,n=p,R=o?i+1:i;t<R;t++,n++){const o=null!==T?31&T.read(n):1;let p,R;if(t<i?(p=k.read(2*t),R=k.read(2*t+1),u&&(P=b.read(t)),m&&(B=y.read(t)),l&&(V=g.read(t))):(p=D,R=F,P=j,B=z,V=O),1!==o){I=!0,4===o?N.createEllipticArc():2===o?N.createCubicBezier():16===o?N.createQuadraticBezier():8===o?N.createQuadraticRationalBezier():C("JSON export.unsupported curve");const t=N.get(),i=v.read(n);t.setStartXYCoords(c,d),t.setEndXYCoords(p,R),u&&(t.setStartAttribute(1,0,f),t.setEndAttribute(1,0,P)),m&&(t.setStartAttribute(2,0,A),t.setEndAttribute(2,0,B)),t.readFromBufferStream(x,i);Ae(N.get(),s,a,e,r)&&E++}else Re(u,m,p,R,P,B,e,r);l&&(_.add(V),h[h.length-1]++),w++,c=p,d=R,f=P,A=B,S=V}I&&0===E||(w<2&&E<1&&(Re(u,m,c,d,f,A,e,r),w++,l&&(_.add(S),h[h.length-1]++)),o&&w<3&&E<2&&(Re(u,m,D,F,j,z,e,r),w++,c=D,d=F,f=j,A=z,S=O,l&&(_.add(O),h[h.length-1]++))),r.endArray(),p=i}r.endArray()}if(l){r.addFieldName("ids"),r.startArray();let e=0;for(let t=0,n=h.length;t<n;++t){const n=h[t];x(0===n||null!==_&&e+n<=_.size()),r.startArray();for(let t=0;t<n;++t)r.addInt32(_.read(e)),e++;r.endArray()}r.endArray()}}function Ie(e,t,n){const r=t.getImpl(),i=r.hasAttribute(1)&&!(2&e),s=r.hasAttribute(2)&&!(4&e),a=r.hasAttribute(3)&&!(8&e);i&&(n.addFieldName("hasZ"),n.addBool(!0)),s&&(n.addFieldName("hasM"),n.addBool(!0)),n.addFieldName("points");const o=t.getPointCount();if(t.isEmpty())n.startArray(),n.endArray();else{const t=17-(31&e>>13);n.startArray();const a=r.getAttributeStreamRef(0);let u=null,m=null;i&&(u=r.getAttributeStreamRef(1)),s&&(m=r.getAttributeStreamRef(2));for(let e=0;e<o;e++){const r=a.read(2*e),o=a.read(2*e+1);let l=Number.NaN,c=Number.NaN;i&&(l=u.read(e)),s&&(c=m.read(e)),Re(i,s,r,o,l,c,t,n)}n.endArray()}if(a){let e=null;r.isEmpty()||(e=r.getAttributeStreamRef(3)),x(0===o||null!==e&&e.size()>=o),n.addFieldName("ids"),n.startArray();for(let t=0;t<o;t++)n.addInt32(e.read(t));n.endArray()}}function Ee(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}function Pe(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}function Be(e,t,n){n.startObject();const r=t.getID();r<=0&&v("cannot export unit that has no valid WKID"),n.addFieldName("uwkid"),n.addInt32(r),n.endObject()}function Ve(e,t,n){n.startObject();let r=0;t.isCustomWkid()||(r=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(r=0)),r>0){n.addFieldName("wkid"),n.addInt32(r);const e=t.getLatestID();if(e>0&&e!==r&&(n.addFieldName("latestWkid"),n.addInt32(e)),i>0){n.addFieldName("vcsWkid"),n.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),Be(e,t.getUnit(),n));else if(r<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new W;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}function Re(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const Me={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_r:"r".charCodeAt(0),s_t:"t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class Ue{constructor(e){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===e?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push(()=>this.accept_()),this.m_jsonString=null,this.m_bHasEscapes=!1):e.jsonString?this.resetParserFromString(e.jsonString):e.jsonStream?C("streaming json parsing not yet impl"):T("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){C("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push(()=>this.start_()),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){C("streaming json parsing not yet impl")}resetToPosition(e){return!!this.m_jsonString&&(this.m_endToken=e,this.m_startToken=Number.MAX_VALUE,this.m_currentTokenType=0,this.m_functionStack.length=0,e>=this.m_jsonString.length?(this.m_functionStack.push(()=>this.accept_()),!1):(this.m_functionStack.push(()=>this.start_()),!0))}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return x(0),""}childrenAsString(){return x(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e);return}if(2===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e);return}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}v("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===Me.s_backslash&&t.charCodeAt(r+1)===Me.s_u;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===Me.s_backslash&&t.charCodeAt(r+1)===Me.s_u;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==Me.s_backslash)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case Me.s_doubleQuote:e+='"';break;case Me.s_u:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case Me.s_backslash:e+="\\";break;case Me.s_forwardslash:e+="/";break;case Me.s_b:e+="\b";break;case Me.s_f:e+="\f";break;case Me.s_n:e+="\n";break;case Me.s_r:e+="\r";break;case Me.s_t:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&v("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),t-=2,0===t&&v("invalid token")}const n=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(n)&&v("invalid token");else if(Number.isNaN(n))return Number.NaN;return n}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&v("invalid token");let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),t-=2,0===t&&v("invalid token"));const n=parseInt(e);return Number.isNaN(n)&&v("invalid token"),n}currentInt64Value(){return x(0),0n}currentBoolValue(){return x(0),!1}isError(){return 0}JSONString(){return x(0),""}pushPosition(){return x(0),!1}popPosition(){return x(0),!1}skipCStyleComments_(){x(0)}skipCppStyleComments_(){x(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&v("invalid token"),e=this.m_peekChar(),e===Me.s_asterisk?this.skipCStyleComments_():e===Me.s_forwardslash?this.skipCppStyleComments_():v("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&v("invalid token");let t=this.m_peekChar();for(;t>=9&&t<=13||32===t;)this.m_increment(),this.m_eof()&&v("invalid token"),t=this.m_peekChar();t===Me.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===Me.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===Me.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&v("invalid token");let e=this.m_peekChar();for(;e!==Me.s_doubleQuote;){const t=e===Me.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&v("invalid token"),e=this.m_peekChar(),t)if(this.m_bHasEscapes=!0,e===Me.s_doubleQuote||e===Me.s_backslash||e===Me.s_forwardslash||e===Me.s_b||e===Me.s_f||e===Me.s_n||e===Me.s_r||e===Me.s_t)this.m_stepOverChar(),this.m_eof()&&v("invalid token"),e=this.m_peekChar();else if(e===Me.s_u)for(let n=0;n<4;n++)this.m_stepOverChar(),this.m_eof()&&v("invalid token"),e=this.m_peekChar(),e>=Me.s_zero&&e<=Me.s_nine||e>=Me.s_a&&e<=Me.s_f||e>=Me.s_A&&e<=Me.s_F||v("invalid token");else v("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===Me.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===Me.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):v("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==Me.s_doubleQuote&&v("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push(()=>this.fieldNameEnd_())}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():v("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push(()=>this.elementEnd_()),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():v("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push(()=>this.pairEnd_()),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push(()=>this.objectStart_())}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push(()=>this.arrayStart_())}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==Me.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&v("invalid token"),e=this.m_peekChar()}while(e>=Me.s_zero&&e<=Me.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&v("invalid token"),e=this.m_peekChar(),e>=Me.s_zero&&e<=Me.s_nine||v("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&v("invalid token"),e=this.m_peekChar(),e!==Me.s_plus&&e!==Me.s_minus||(this.m_stepOverChar(),this.m_eof()&&v("invalid token"),e=this.m_peekChar()),e>=Me.s_zero&&e<=Me.s_nine||v("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,t=this.m_peekChar();if(t===Me.s_minus?(this.m_stepOverChar(),this.m_eof()&&v("invalid token"),t=this.m_peekChar(),e=!0,t>=Me.s_zero&&t<=Me.s_nine||v("invalid token"),this.int_()):this.int_(),t=this.m_peekChar(),t===Me.s_period)this.m_currentTokenType=7,this.frac_(),t=this.m_peekChar(),t!==Me.s_e&&t!==Me.s_E||this.exp_();else if(t===Me.s_e||t===Me.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:t}=this.m_get(5);t&&v("invalid token"),"null"!==e&&v("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:t}=this.m_get(5);t&&v("invalid token"),"true"!==e&&v("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:t}=this.m_get(6);t&&v("invalid token"),"false"!==e&&v("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:t}=this.m_get(4);t&&v("invalid token"),"NaN"!==e&&v("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===Me.s_beginObject?this.valueStartObject_():e===Me.s_beginArray?this.valueStartArray_():e===Me.s_doubleQuote?this.valueString_():e===Me.s_minus||e>=Me.s_zero&&e<=Me.s_zero+9?this.valueNumber_():e===Me.s_n?this.valueNull_():e===Me.s_t?this.valueTrue_():e===Me.s_f?this.valueFalse_():e===Me.s_N?this.valueNan_():v("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push(()=>this.accept_());const e=this.m_peekChar();e!==Me.s_beginObject&&e!==Me.s_beginArray&&v("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class We{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s,a){let o;"string"==typeof n?(o=new Ue({jsonString:n}),o.nextToken()):o=n,1!==o.currentToken()&&v("failed to import map geometry: start of object is expected");const u=se(t,e,o,r,i);return new Y(u)}importSpatialReference(e){const t=oe(e);return null===t&&T("failed to import spatial reference"),t}importProjectionTransformation(e,t){return x(0),{}}importDatumTransformation(e,t){return x(0),{}}static stringToGeometryType(e){return(e=e.toLowerCase()).startsWith("esrigeometry")||v("string_to_geometry_type"),e.endsWith("point")?w.enumPoint:e.endsWith("envelope")?w.enumEnvelope:e.endsWith("multipoint")?w.enumMultiPoint:e.endsWith("polyline")?w.enumPolyline:e.endsWith("polygon")?w.enumPolygon:void v("string_to_geometry_type")}}const Xe=new re,Ye=new je,Ge=new We;function Le(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function qe(e,t=!1){if(!t&&(K(e)||J(e)||Z(e)||Q(e))){const t=new Y;return t.setGeometry(H(L(e))),t}const n=new ne(e,{strict:!1});return n.nextToken(),Ge.execute(0,w.enumUnknown,n,!0,!1)}function Ke(e){let t=null;return[e.map(e=>{if(null==t){const n=Je(e);return t=n.getSpatialReference(),n.getGeometry()}return Ze(e)}),t]}function Je(e){const t=qe(e),n=He(e.spatialReference);return n&&t.setSpatialReference(n),t}function Ze(e){return qe(e).getGeometry()}function Qe(e){return qe(e,!0).getGeometry()}function He(e){if(null==e)return null;let t=!1;if(e instanceof q){const{wkt2:n}=e;e=e.toJSON(),e.wkt2??=n,t=!0}(e.latestVcsWkid||e.vcsWkid)&&(t||(e={...e}),delete e?.latestVcsWkid,delete e?.vcsWkid);const n=new ne(e,{strict:!1});n.nextToken();const r=Ge.importSpatialReference(n);return 0===r.getCoordinateSystemType()?null:r}function $e(e,t){if(e instanceof Y&&(t=e.getSpatialReference(),e=e.getGeometry()),null==e||e.isEmpty())return null;switch(e.getGeometryType()){case w.enumPoint:case w.enumMultiPoint:case w.enumPolyline:case w.enumPolygon:{const n=G(e,et(t)??void 0).toGeometryJSON();return null==n.spatialReference&&delete n.spatialReference,n}}return Xe.reset(),Ye.execute(0,e,t??null,Xe),Xe.getObject()}function et(e){return null==e||0===e.getCoordinateSystemType()?null:(Xe.reset(),Ye.execute(0,null,e,Xe),Xe.getObject().spatialReference)}export{Ke as fromGeometries,Je as fromGeometry,Ze as fromGeometryToGXGeometry,Qe as fromGeometryToGXGeometryUsingImportOperator,He as fromSpatialReference,Le as getSpatialReference,$e as toGeometry,et as toSpatialReference};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{expandPointInPlace as t}from"../aaBoundingRect.js";import{closestPointOnLine as n}from"./lineUtils.js";import{angularRange as i,angularRangeClamp as a,distance2 as r,interpolateSegment as s,angularRangeWrap as o}from"./mathUtils.js";class c{constructor(t,n,i,a,r,s){this.cx=t,this.cy=n,this.radius=i,this.thetaStart=a,this.thetaEnd=r,this.isInvalid=s}get startPoint(){const{cx:t,cy:n,radius:i,thetaStart:a}=this;return[t+i*Math.cos(a),n+i*Math.sin(a)]}get endPoint(){const{cx:t,cy:n,radius:i,thetaEnd:a}=this;return[t+i*Math.cos(a),n+i*Math.sin(a)]}}function e(t,n){const{cx:i,cy:a,radius:r}=t;return[i+r*Math.cos(n),a+r*Math.sin(n)]}function h(t,n){if(t.isInvalid)return s([0,0],t.startPoint,t.endPoint,n);const{thetaStart:i,thetaEnd:a}=t;return e(t,i*(1-n)+a*n)}function u(t,s){if(t.isInvalid)return n(t.startPoint,t.endPoint,s);const{cx:o,cy:c,thetaStart:h,thetaEnd:u}=t,[d,f]=s,l=a(i(h,u),Math.atan2(f-c,d-o)),M=e(t,l);return{t:(l-h)/(u-h),curvePoint:M,distance:Math.sqrt(r(s,M))}}function d(n,a){if(a.isInvalid)return t(n,a.startPoint),t(n,a.endPoint),n;const{cx:r,cy:s,radius:c,thetaStart:h,thetaEnd:u}=a;t(n,e(a,h)),t(n,e(a,u));const d=i(h,u),f=Math.PI/2;let l=0;for(const i of[[r+c,s],[r,s+c],[r-c,s],[r,s-c]])l=o(d,l),l>d.min&&l<d.max&&t(n,i),l+=f;return n}function f(t){if(t.isInvalid)return 2*t.radius;const{radius:n,thetaStart:i,thetaEnd:a}=t;return n*Math.abs(a-i)}export{c as DerivedCircle,d as circularCurveExtent,f as circularCurveLength,u as closestPointOnCircle,h as interpolateCircle};
5
+ import{expandPointInPlace as t}from"../aaBoundingRect.js";import{closestPointOnLine as n}from"./lineUtils.js";import{angularRange as i,interpolateSegment as a,angularRangeClamp as r,distance2 as s,angularRangeWrap as o}from"./mathUtils.js";class c{constructor(t,n,i,a,r,s){this.cx=t,this.cy=n,this.radius=i,this.thetaStart=a,this.thetaEnd=r,this.isInvalid=s}get startPoint(){const{cx:t,cy:n,radius:i,thetaStart:a}=this;return[t+i*Math.cos(a),n+i*Math.sin(a)]}get endPoint(){const{cx:t,cy:n,radius:i,thetaEnd:a}=this;return[t+i*Math.cos(a),n+i*Math.sin(a)]}}function e(t,n){const{cx:i,cy:a,radius:r}=t;return[i+r*Math.cos(n),a+r*Math.sin(n)]}function h(t,n){if(t.isInvalid)return a([0,0],t.startPoint,t.endPoint,n);const{thetaStart:i,thetaEnd:r}=t;return e(t,i*(1-n)+r*n)}function u(t,a){if(t.isInvalid)return n(t.startPoint,t.endPoint,a);const{cx:o,cy:c,thetaStart:h,thetaEnd:u}=t,[d,f]=a,l=r(i(h,u),Math.atan2(f-c,d-o)),M=e(t,l);return{t:(l-h)/(u-h),curvePoint:M,distance:Math.sqrt(s(a,M))}}function d(n,a){if(a.isInvalid)return t(n,a.startPoint),t(n,a.endPoint),n;const{cx:r,cy:s,radius:c,thetaStart:h,thetaEnd:u}=a;t(n,e(a,h)),t(n,e(a,u));const d=i(h,u),f=Math.PI/2;let l=0;for(const i of[[r+c,s],[r,s+c],[r-c,s],[r,s-c]])l=o(d,l),l>d.min&&l<d.max&&t(n,i),l+=f;return n}function f(t){if(t.isInvalid)return 2*t.radius;const{radius:n,thetaStart:i,thetaEnd:a}=t;return n*Math.abs(a-i)}export{c as DerivedCircle,d as circularCurveExtent,f as circularCurveLength,u as closestPointOnCircle,h as interpolateCircle};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t}from"../../core/mathUtils.js";import{ObjectStack as r}from"../../core/ObjectStack.js";import{d as n,e as o,g as e,E as i,j as c,i as s,s as u}from"../../chunks/vec32.js";import{create as a,clone as g}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as f}from"./vectorStacks.js";function v(t){return t?{origin:g(t.origin),vector:g(t.vector)}:{origin:a(),vector:a()}}function m(t,r){const n=S.get();return n.origin=t,n.vector=r,n}function p(t,r=v()){return b(t.origin,t.vector,r)}function b(t,r,o=v()){return n(o.origin,t),n(o.vector,r),o}function h(t,r,e=v()){return n(e.origin,t),o(e.vector,r,t),e}function j(r,n){const i=o(f.get(),n,r.origin),s=e(r.vector,i),u=e(r.vector,r.vector),a=t(s/u,0,1),g=o(f.get(),c(f.get(),r.vector,a),i);return e(g,g)}function M(t,r,n){return A(t,r,0,1,n)}function l(t,r,n){return s(n,t.origin,c(n,t.vector,r))}function A(r,n,u,a,g){const{vector:v,origin:m}=r,p=o(f.get(),n,m),b=e(v,p)/i(v);return c(g,v,t(b,u,a)),s(g,g,r.origin)}function d(t,r){if(k(t,m(r.origin,r.direction),!1,x)){const{tA:r,pB:n,distance2:o}=x;if(r>=0&&r<=1)return o;if(r<0)return u(t.origin,n);if(r>1)return u(s(f.get(),t.origin,t.vector),n)}return null}function B(t,r,o){return!!k(t,r,!0,x)&&(n(o,x.pA),!0)}function k(r,n,o,e){const i=1e-6,c=r.origin,a=s(f.get(),c,r.vector),g=n.origin,v=s(f.get(),g,n.vector),m=f.get(),p=f.get();if(m[0]=c[0]-g[0],m[1]=c[1]-g[1],m[2]=c[2]-g[2],p[0]=v[0]-g[0],p[1]=v[1]-g[1],p[2]=v[2]-g[2],Math.abs(p[0])<i&&Math.abs(p[1])<i&&Math.abs(p[2])<i)return!1;const b=f.get();if(b[0]=a[0]-c[0],b[1]=a[1]-c[1],b[2]=a[2]-c[2],Math.abs(b[0])<i&&Math.abs(b[1])<i&&Math.abs(b[2])<i)return!1;const h=m[0]*p[0]+m[1]*p[1]+m[2]*p[2],j=p[0]*b[0]+p[1]*b[1]+p[2]*b[2],M=m[0]*b[0]+m[1]*b[1]+m[2]*b[2],l=p[0]*p[0]+p[1]*p[1]+p[2]*p[2],A=(b[0]*b[0]+b[1]*b[1]+b[2]*b[2])*l-j*j;if(Math.abs(A)<i)return!1;let d=(h*j-M*l)/A,B=(h+j*d)/l;o&&(d=t(d,0,1),B=t(B,0,1));const k=f.get(),x=f.get();return k[0]=c[0]+d*b[0],k[1]=c[1]+d*b[1],k[2]=c[2]+d*b[2],x[0]=g[0]+B*p[0],x[1]=g[1]+B*p[1],x[2]=g[2]+B*p[2],e.tA=d,e.tB=B,e.pA=k,e.pB=x,e.distance2=u(k,x),!0}const x={tA:0,tB:0,pA:a(),pB:a(),distance2:0},S=new r(()=>v());export{B as closestLineSegmentPoint,d as closestRayDistance2,p as copy,v as create,j as distance2,h as fromPoints,b as fromValues,l as pointAt,M as projectPoint,A as projectPointClamp,m as wrap};
5
+ import{clamp as t}from"../../core/mathUtils.js";import{ObjectStack as r}from"../../core/ObjectStack.js";import{d as n,e as o,g as e,F as i,j as c,i as s,s as u}from"../../chunks/vec32.js";import{create as a,clone as g}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as f}from"./vectorStacks.js";function v(t){return t?{origin:g(t.origin),vector:g(t.vector)}:{origin:a(),vector:a()}}function m(t,r){const n=S.get();return n.origin=t,n.vector=r,n}function p(t,r=v()){return b(t.origin,t.vector,r)}function b(t,r,o=v()){return n(o.origin,t),n(o.vector,r),o}function h(t,r,e=v()){return n(e.origin,t),o(e.vector,r,t),e}function j(r,n){const i=o(f.get(),n,r.origin),s=e(r.vector,i),u=e(r.vector,r.vector),a=t(s/u,0,1),g=o(f.get(),c(f.get(),r.vector,a),i);return e(g,g)}function M(t,r,n){return A(t,r,0,1,n)}function l(t,r,n){return s(n,t.origin,c(n,t.vector,r))}function A(r,n,u,a,g){const{vector:v,origin:m}=r,p=o(f.get(),n,m),b=e(v,p)/i(v);return c(g,v,t(b,u,a)),s(g,g,r.origin)}function d(t,r){if(k(t,m(r.origin,r.direction),!1,x)){const{tA:r,pB:n,distance2:o}=x;if(r>=0&&r<=1)return o;if(r<0)return u(t.origin,n);if(r>1)return u(s(f.get(),t.origin,t.vector),n)}return null}function B(t,r,o){return!!k(t,r,!0,x)&&(n(o,x.pA),!0)}function k(r,n,o,e){const i=1e-6,c=r.origin,a=s(f.get(),c,r.vector),g=n.origin,v=s(f.get(),g,n.vector),m=f.get(),p=f.get();if(m[0]=c[0]-g[0],m[1]=c[1]-g[1],m[2]=c[2]-g[2],p[0]=v[0]-g[0],p[1]=v[1]-g[1],p[2]=v[2]-g[2],Math.abs(p[0])<i&&Math.abs(p[1])<i&&Math.abs(p[2])<i)return!1;const b=f.get();if(b[0]=a[0]-c[0],b[1]=a[1]-c[1],b[2]=a[2]-c[2],Math.abs(b[0])<i&&Math.abs(b[1])<i&&Math.abs(b[2])<i)return!1;const h=m[0]*p[0]+m[1]*p[1]+m[2]*p[2],j=p[0]*b[0]+p[1]*b[1]+p[2]*b[2],M=m[0]*b[0]+m[1]*b[1]+m[2]*b[2],l=p[0]*p[0]+p[1]*p[1]+p[2]*p[2],A=(b[0]*b[0]+b[1]*b[1]+b[2]*b[2])*l-j*j;if(Math.abs(A)<i)return!1;let d=(h*j-M*l)/A,B=(h+j*d)/l;o&&(d=t(d,0,1),B=t(B,0,1));const k=f.get(),x=f.get();return k[0]=c[0]+d*b[0],k[1]=c[1]+d*b[1],k[2]=c[2]+d*b[2],x[0]=g[0]+B*p[0],x[1]=g[1]+B*p[1],x[2]=g[2]+B*p[2],e.tA=d,e.tB=B,e.pA=k,e.pB=x,e.distance2=u(k,x),!0}const x={tA:0,tB:0,pA:a(),pB:a(),distance2:0},S=new r(()=>v());export{B as closestLineSegmentPoint,d as closestRayDistance2,p as copy,v as create,j as distance2,h as fromPoints,b as fromValues,l as pointAt,M as projectPoint,A as projectPointClamp,m as wrap};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../Color.js";import{colorGamma as t}from"../../../colorUtils.js";import r from"../../../core/Error.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{rad2deg as n,hasScaling as s}from"../../../core/mathUtils.js";import{normalFromMat4 as i,fromMat4 as a}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromValues as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import u from"../MeshComponent.js";import m from"../MeshMaterialMetallicRoughness.js";import p from"../MeshTexture.js";import d from"../MeshTextureTransform.js";import{MeshVertexAttributes as x}from"../MeshVertexAttributes.js";import{selectVertexSpace as g}from"../meshVertexSpaceUtils.js";import{BufferViewVec4f as h,BufferViewVec4u8 as T,BufferViewVec4u16 as v,BufferViewVec3u8 as w,BufferViewVec3f as j,BufferViewVec3u16 as b,BufferViewVec2f as y,BufferViewVec3f64 as C}from"../buffer/BufferView.js";import{d as M,c as R,e as S,l as B}from"../../../chunks/vec3.js";import{a as F,n as $,l as A}from"../../../chunks/vec4.js";import{createBuffer as U}from"../buffer/utils.js";import{convertVertexSpace as k}from"./vertexSpaceConversion.js";import{DefaultLoadingContext as V}from"../../../views/3d/glTF/DefaultLoadingContext.js";import{loadGLTF as E}from"../../../views/3d/glTF/loader.js";import{convertPrimitiveToTriangles as D}from"../../../views/3d/glTF/internal/indexUtils.js";import{isEncodedMeshTexture as I}from"../../../views/3d/glTF/internal/resourceUtils.js";import{f as L}from"../../../chunks/vec33.js";import{f as z}from"../../../chunks/vec43.js";import{n as K,f as N}from"../../../chunks/vec2.js";async function O(e,t,o){const n=new V(o?.resolveFile),s=await E(n,t,o,!0),i=s.model,a=i.lods.shift(),l=new Map,c=new Map;i.textures.forEach((e,t)=>l.set(t,P(e))),i.materials.forEach((e,t)=>c.set(t,Q(e,l)));const f=H(a);for(const r of f.parts)J(f,r,c);const{position:u,normal:m,tangent:p,color:d,texCoord0:h}=f.vertexAttributes,T=g(e,o),v=e.spatialReference.isGeographic?g(e):T,w=k({vertexAttributes:{position:u.typedBuffer,normal:m?.typedBuffer,tangent:p?.typedBuffer},vertexSpace:v,spatialReference:e.spatialReference},T,{allowBufferReuse:!0,sourceUnit:o?.unitConversionDisabled?void 0:"meters"});if(!w)throw new r("load-gltf-mesh:vertex-space-projection",`Failed to load mesh from glTF because we could not convert the vertex space from ${v.type} to ${T.type}`);return{mesh:{transform:null,vertexSpace:T,components:f.components,spatialReference:e.spatialReference,vertexAttributes:new x({...w,color:d?.typedBuffer,uv:h?.typedBuffer})},meta:s.meta}}function q(e,t){if(null==e)return"-";const r=e.typedBuffer;return`${o(t,r.buffer,()=>t.size)}/${r.byteOffset}/${r.byteLength}`}function G(e){return null!=e?e.toString():"-"}function H(e){let t=0;const has={color:!1,tangent:!1,normal:!1,texCoord0:!1},r=new Map,n=new Map,s=[];for(const i of e.parts){const{position:e,normal:a,color:l,tangent:c,texCoord0:f}=i.attributes,u=`\n ${q(e,r)}/\n ${q(a,r)}/\n ${q(l,r)}/\n ${q(c,r)}/\n ${q(f,r)}/\n ${G(i.transform)}\n `;let m=!1;const p=o(n,u,()=>(m=!0,{start:t,length:e.count}));m&&(t+=e.count),a&&(has.normal=!0),l&&(has.color=!0),c&&(has.tangent=!0),f&&(has.texCoord0=!0),s.push({gltf:i,writeVertices:m,region:p})}return{vertexAttributes:{position:U(C,t),normal:has.normal?U(j,t):null,tangent:has.tangent?U(h,t):null,color:has.color?U(T,t):null,texCoord0:has.texCoord0?U(y,t):null},parts:s,components:[]}}function P(e){return new p({data:(I(e.data),e.data),wrap:Y(e.parameters.wrap)})}function Q(t,r){const o=new e(ee(t.color,t.opacity)),s=t.emissiveFactor?new e(te(t.emissiveFactor)):null,i=e=>e?new d({scale:e.scale?[e.scale[0],e.scale[1]]:[1,1],rotation:n(e.rotation??0),offset:e.offset?[e.offset[0],e.offset[1]]:[0,0]}):null;return new m({color:o,colorTexture:r.get(t.colorTexture),normalTexture:r.get(t.normalTexture),emissiveColor:s,emissiveStrength:t.emissiveStrengthKHR,emissiveTexture:r.get(t.emissiveTexture),occlusionTexture:r.get(t.occlusionTexture),alphaMode:X(t.alphaMode),alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,metallic:t.metallicFactor,roughness:t.roughnessFactor,metallicRoughnessTexture:r.get(t.metallicRoughnessTexture),colorTextureTransform:i(t.colorTextureTransform),normalTextureTransform:i(t.normalTextureTransform),occlusionTextureTransform:i(t.occlusionTextureTransform),emissiveTextureTransform:i(t.emissiveTextureTransform),metallicRoughnessTextureTransform:i(t.metallicRoughnessTextureTransform)})}function J(e,t,r){t.writeVertices&&W(e,t);const{indices:o,attributes:n,primitiveType:s,material:i}=t.gltf;let a=D(o||n.position.count,s);const l=t.region.start;if(l){const e=new Uint32Array(a);for(let t=0;t<a.length;t++)e[t]+=l;a=e}e.components.push(new u({name:t.gltf.name,faces:a,material:r.get(i),shading:n.normal?"source":"flat",trustSourceNormals:!0}))}function W(e,t){const{position:r,normal:o,tangent:n,color:c,texCoord0:f}=e.vertexAttributes,u=t.region.start,{attributes:m,transform:p}=t.gltf,d=m.position.count;if(M(r.slice(u,d),m.position,p),null!=m.normal&&null!=o){const e=i(l(),p),t=o.slice(u,d);R(t,m.normal,e),s(e)&&S(t,t)}else null!=o&&L(o,0,0,1,{dstIndex:u,count:d});if(null!=m.tangent&&null!=n){const e=a(l(),p),t=n.slice(u,d);F(t,m.tangent,e),s(e)&&$(t,t)}else null!=n&&z(n,0,0,1,1,{dstIndex:u,count:d});if(null!=m.texCoord0&&null!=f?K(f.slice(u,d),m.texCoord0):null!=f&&N(f,0,0,{dstIndex:u,count:d}),null!=m.color&&null!=c){const e=m.color,t=c.slice(u,d);if(4===e.elementCount)e instanceof h?A(t,e,1,255):(e instanceof T||e instanceof v)&&A(t,e,1/255,255);else{z(t,255,255,255,255);const r=w.fromTypedArray(t.typedBuffer,t.typedBufferStride);e instanceof j?B(r,e,1,255):(e instanceof w||e instanceof b)&&B(r,e,1/255,255)}}else null!=c&&z(c.slice(u,d),255,255,255,255)}function X(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend"}}function Y(e){return{horizontal:Z(e.s),vertical:Z(e.t)}}function Z(e){switch(e){case 33071:return"clamp";case 33648:return"mirror";case 10497:return"repeat"}}function _(e){return e**(1/t)*255}function ee(e,t){return f(_(e[0]),_(e[1]),_(e[2]),t)}function te(e){return c(_(e[0]),_(e[1]),_(e[2]))}export{O as loadGLTFMesh};
5
+ import e from"../../../Color.js";import{colorGamma as t}from"../../../colorUtils.js";import r from"../../../core/Error.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{rad2deg as n,hasScaling as s}from"../../../core/mathUtils.js";import{normalFromMat4 as i,fromMat4 as a}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromValues as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import u from"../MeshComponent.js";import m from"../MeshMaterialMetallicRoughness.js";import p from"../MeshTexture.js";import d from"../MeshTextureTransform.js";import{MeshVertexAttributes as x}from"../MeshVertexAttributes.js";import{selectVertexSpace as g}from"../meshVertexSpaceUtils.js";import{BufferViewVec4f as h,BufferViewVec4u8 as T,BufferViewVec4u16 as v,BufferViewVec3u8 as w,BufferViewVec3f as j,BufferViewVec3u16 as b,BufferViewVec2f as y,BufferViewVec3f64 as C}from"../buffer/BufferView.js";import{d as M,c as R,e as S,l as B}from"../../../chunks/vec3.js";import{a as F,n as $,l as A}from"../../../chunks/vec4.js";import{createBuffer as U}from"../buffer/utils.js";import{convertVertexSpace as k}from"./vertexSpaceConversion.js";import{DefaultLoadingContext as V}from"../../../views/3d/glTF/DefaultLoadingContext.js";import{loadGLTF as E}from"../../../views/3d/glTF/loader.js";import{convertPrimitiveToTriangles as D}from"../../../views/3d/glTF/internal/indexUtils.js";import{isEncodedMeshTexture as I}from"../../../views/3d/glTF/internal/resourceUtils.js";import{f as L}from"../../../chunks/vec33.js";import{f as z}from"../../../chunks/vec43.js";import{n as K,f as N}from"../../../chunks/vec2.js";async function O(e,t,o){const n=new V(o?.resolveFile),s=await E(n,t,o),i=s.model,a=i.lods.shift(),l=new Map,c=new Map;i.textures.forEach((e,t)=>l.set(t,P(e))),i.materials.forEach((e,t)=>c.set(t,Q(e,l)));const f=H(a);for(const r of f.parts)J(f,r,c);const{position:u,normal:m,tangent:p,color:d,texCoord0:h}=f.vertexAttributes,T=g(e,o),v=e.spatialReference.isGeographic?g(e):T,w=k({vertexAttributes:{position:u.typedBuffer,normal:m?.typedBuffer,tangent:p?.typedBuffer},vertexSpace:v,spatialReference:e.spatialReference},T,{allowBufferReuse:!0,sourceUnit:o?.unitConversionDisabled?void 0:"meters"});if(!w)throw new r("load-gltf-mesh:vertex-space-projection",`Failed to load mesh from glTF because we could not convert the vertex space from ${v.type} to ${T.type}`);return{mesh:{transform:null,vertexSpace:T,components:f.components,spatialReference:e.spatialReference,vertexAttributes:new x({...w,color:d?.typedBuffer,uv:h?.typedBuffer})},meta:s.meta}}function q(e,t){if(null==e)return"-";const r=e.typedBuffer;return`${o(t,r.buffer,()=>t.size)}/${r.byteOffset}/${r.byteLength}`}function G(e){return null!=e?e.toString():"-"}function H(e){let t=0;const has={color:!1,tangent:!1,normal:!1,texCoord0:!1},r=new Map,n=new Map,s=[];for(const i of e.parts){const{position:e,normal:a,color:l,tangent:c,texCoord0:f}=i.attributes,u=`\n ${q(e,r)}/\n ${q(a,r)}/\n ${q(l,r)}/\n ${q(c,r)}/\n ${q(f,r)}/\n ${G(i.transform)}\n `;let m=!1;const p=o(n,u,()=>(m=!0,{start:t,length:e.count}));m&&(t+=e.count),a&&(has.normal=!0),l&&(has.color=!0),c&&(has.tangent=!0),f&&(has.texCoord0=!0),s.push({gltf:i,writeVertices:m,region:p})}return{vertexAttributes:{position:U(C,t),normal:has.normal?U(j,t):null,tangent:has.tangent?U(h,t):null,color:has.color?U(T,t):null,texCoord0:has.texCoord0?U(y,t):null},parts:s,components:[]}}function P(e){return new p({data:(I(e.data),e.data),wrap:Y(e.parameters.wrap)})}function Q(t,r){const o=new e(ee(t.color,t.opacity)),s=t.emissiveFactor?new e(te(t.emissiveFactor)):null,i=e=>e?new d({scale:e.scale?[e.scale[0],e.scale[1]]:[1,1],rotation:n(e.rotation??0),offset:e.offset?[e.offset[0],e.offset[1]]:[0,0]}):null;return new m({color:o,colorTexture:r.get(t.colorTexture),normalTexture:r.get(t.normalTexture),emissiveColor:s,emissiveStrength:t.emissiveStrengthKHR,emissiveTexture:r.get(t.emissiveTexture),occlusionTexture:r.get(t.occlusionTexture),alphaMode:X(t.alphaMode),alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,metallic:t.metallicFactor,roughness:t.roughnessFactor,metallicRoughnessTexture:r.get(t.metallicRoughnessTexture),colorTextureTransform:i(t.colorTextureTransform),normalTextureTransform:i(t.normalTextureTransform),occlusionTextureTransform:i(t.occlusionTextureTransform),emissiveTextureTransform:i(t.emissiveTextureTransform),metallicRoughnessTextureTransform:i(t.metallicRoughnessTextureTransform)})}function J(e,t,r){t.writeVertices&&W(e,t);const{indices:o,attributes:n,primitiveType:s,material:i}=t.gltf;let a=D(o||n.position.count,s);const l=t.region.start;if(l){const e=new Uint32Array(a);for(let t=0;t<a.length;t++)e[t]+=l;a=e}e.components.push(new u({name:t.gltf.name,faces:a,material:r.get(i),shading:n.normal?"source":"flat",trustSourceNormals:!0}))}function W(e,t){const{position:r,normal:o,tangent:n,color:c,texCoord0:f}=e.vertexAttributes,u=t.region.start,{attributes:m,transform:p}=t.gltf,d=m.position.count;if(M(r.slice(u,d),m.position,p),null!=m.normal&&null!=o){const e=i(l(),p),t=o.slice(u,d);R(t,m.normal,e),s(e)&&S(t,t)}else null!=o&&L(o,0,0,1,{dstIndex:u,count:d});if(null!=m.tangent&&null!=n){const e=a(l(),p),t=n.slice(u,d);F(t,m.tangent,e),s(e)&&$(t,t)}else null!=n&&z(n,0,0,1,1,{dstIndex:u,count:d});if(null!=m.texCoord0&&null!=f?K(f.slice(u,d),m.texCoord0):null!=f&&N(f,0,0,{dstIndex:u,count:d}),null!=m.color&&null!=c){const e=m.color,t=c.slice(u,d);if(4===e.elementCount)e instanceof h?A(t,e,1,255):(e instanceof T||e instanceof v)&&A(t,e,1/255,255);else{z(t,255,255,255,255);const r=w.fromTypedArray(t.typedBuffer,t.typedBufferStride);e instanceof j?B(r,e,1,255):(e instanceof w||e instanceof b)&&B(r,e,1/255,255)}}else null!=c&&z(c.slice(u,d),255,255,255,255)}function X(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend"}}function Y(e){return{horizontal:Z(e.s),vertical:Z(e.t)}}function Z(e){switch(e){case 33071:return"clamp";case 33648:return"mirror";case 10497:return"repeat"}}function _(e){return e**(1/t)*255}function ee(e,t){return f(_(e[0]),_(e[1]),_(e[2]),t)}function te(e){return c(_(e[0]),_(e[1]),_(e[2]))}export{O as loadGLTFMesh};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Logger.js";import{F as t,i as r,j as o}from"../../../chunks/vec32.js";import{create as n}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../MeshComponent.js";import{MeshVertexAttributes as i}from"../MeshVertexAttributes.js";import{addMeshMaterialCloneContext as l,addMeshTextureCloneContext as a,getMeshMaterialCloneContext as c}from"./meshCloneUtils.js";import{convertVertexSpace as u}from"./vertexSpaceConversion.js";const f=()=>e.getLogger("esri.geometry.support.triangleMeshMerge");function p(e,t){if(0===e.length)return f().error("merge()","Must specify one more geometries to merge"),null;const r=e[0].spatialReference;for(const l of e){if(!l.spatialReference.equals(r))return f().error("merge()","Geometries must all be in the same spatial reference"),null;if(!l.loaded)return f().error("merge()","Geometries must all be loaded before merging"),null}const o=m(e);if(null==o)return null;const n=w(e),s=[],i={position:0,uv:0,normal:0,tangent:0,color:0},p=l(a()),g=c(p);for(const l of e){const e=o.rebake?u(l,o.vertexSpace,{allowBufferReuse:!0}):l.vertexAttributes;if(!e)return f().error("merge()","Failed to convert vertex space due to projection errors"),null;if(t&&t.reuseMaterials&&l.components)for(const t of l.components)t.material&&g?.materialMap?.set(t.material,t.material);h(l,i,p,s),x("position",e,n,i,0),x("normal",e,n,i,0),x("tangent",e,n,i,0),x("uv",l.vertexAttributes,n,i,0),x("color",l.vertexAttributes,n,i,255)}return{vertexAttributes:n,components:s,vertexSpace:o.vertexSpace,transform:o.rebake?null:o.transform,spatialReference:r}}function m(e){let s=null,i=null,l=!0,a=!0,c=null;const u=n();let p=0;for(const o of e){const{vertexSpace:e,transform:n}=o;if(null==i){i=e;const t=i.origin;t&&(c=t)}if(i.type!==e.type)return f().error("merge()",`Inconsistent mesh vertex space for provided geometries. One was ${i.type} while another is ${e.type}. Unable to merge geometries.`),null;null==s||null!=n&&n.equals(s)||(l=!1),null!=n&&null==s&&(s=n);const m=e.origin;m&&(c&&!t(m,c)&&(a=!1),p++,r(u,u,m))}if(null==i)throw new Error;const m=i.clone();if(null==m.origin)return{rebake:!1,vertexSpace:m};if(a&&l)return{rebake:!1,vertexSpace:m,transform:s?.clone()};const g=o(u,u,1/p);return m.origin=g,{rebake:!0,vertexSpace:m}}function g(e,t){return t.normal>0&&!e.vertexAttributes.normal}function v(e,t,r){g(e,t)&&"source"===r.shading&&(r.shading="flat")}function h(e,t,r,o){if(e.components)for(const n of e.components){const s=n.clone(r),i=t.position/3;if(s.faces)for(let e=0;e<s.faces.length;e++)s.faces[e]+=i;else{s.faces=new Uint32Array(e.vertexAttributes.position.length/3);for(let e=0;e<s.faces.length;e++)s.faces[e]=e+i}v(e,t,s),o.push(s)}else if(e.vertexAttributes&&e.vertexAttributes.position){const r=e.vertexAttributes.position.length/3,n=new Uint32Array(r),i=t.position/3;for(let e=0;e<r;e++)n[e]=e+i;const l=new s({faces:n});v(e,t,l),o.push(l)}}function x(e,t,r,o,n){if(!t)return;const s=t.position;if(!s)return;const i=t[e],l=r[e];if(null==i){let t=o[e];const r=y[e];if(null!=l){for(let e=0;e<s.length;e+=3)for(let o=0;o<r;o++)l[t++]=n;o[e]=t}}else null!=l&&null!=i&&(b(i,0,l,o[e],i.length),o[e]+=i.length)}function b(e,t,r,o,n){for(let s=0;s<n;s++)r[o++]=e[t++];return r}function A(e){let t=!1,r=!1,o=!1,n=!1;for(const s of e){const e=s.vertexAttributes;if(e?.position&&(e.uv&&(t=!0),e.normal&&(r=!0),e.tangent&&(n=!0),e.color&&(o=!0),r&&t&&o&&n))break}return{normal:r,uv:t,color:o,tangent:n}}function w(e){let t=0,r=0,o=0,n=0,s=0;const l=A(e);for(const i of e){const e=i.vertexAttributes;e?.position&&(t+=e.position.length,l.uv&&(r+=e.position.length/y.position*y.uv),l.normal&&(o+=e.position.length/y.position*y.normal),l.color&&(n+=e.position.length/y.position*y.color),l.tangent&&(s+=e.position.length/y.position*y.tangent))}return new i({position:new Float64Array(t),uv:r?new Float32Array(r):null,normal:o?new Float32Array(o):null,tangent:s?new Float32Array(s):null,color:n?new Uint8Array(n):null})}const y={position:3,normal:3,tangent:4,uv:2,color:4};export{p as merge};
5
+ import e from"../../../core/Logger.js";import{G as t,i as r,j as o}from"../../../chunks/vec32.js";import{create as n}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../MeshComponent.js";import{MeshVertexAttributes as i}from"../MeshVertexAttributes.js";import{addMeshMaterialCloneContext as l,addMeshTextureCloneContext as a,getMeshMaterialCloneContext as c}from"./meshCloneUtils.js";import{convertVertexSpace as u}from"./vertexSpaceConversion.js";const f=()=>e.getLogger("esri.geometry.support.triangleMeshMerge");function p(e,t){if(0===e.length)return f().error("merge()","Must specify one more geometries to merge"),null;const r=e[0].spatialReference;for(const l of e){if(!l.spatialReference.equals(r))return f().error("merge()","Geometries must all be in the same spatial reference"),null;if(!l.loaded)return f().error("merge()","Geometries must all be loaded before merging"),null}const o=m(e);if(null==o)return null;const n=w(e),s=[],i={position:0,uv:0,normal:0,tangent:0,color:0},p=l(a()),g=c(p);for(const l of e){const e=o.rebake?u(l,o.vertexSpace,{allowBufferReuse:!0}):l.vertexAttributes;if(!e)return f().error("merge()","Failed to convert vertex space due to projection errors"),null;if(t&&t.reuseMaterials&&l.components)for(const t of l.components)t.material&&g?.materialMap?.set(t.material,t.material);h(l,i,p,s),x("position",e,n,i,0),x("normal",e,n,i,0),x("tangent",e,n,i,0),x("uv",l.vertexAttributes,n,i,0),x("color",l.vertexAttributes,n,i,255)}return{vertexAttributes:n,components:s,vertexSpace:o.vertexSpace,transform:o.rebake?null:o.transform,spatialReference:r}}function m(e){let s=null,i=null,l=!0,a=!0,c=null;const u=n();let p=0;for(const o of e){const{vertexSpace:e,transform:n}=o;if(null==i){i=e;const t=i.origin;t&&(c=t)}if(i.type!==e.type)return f().error("merge()",`Inconsistent mesh vertex space for provided geometries. One was ${i.type} while another is ${e.type}. Unable to merge geometries.`),null;null==s||null!=n&&n.equals(s)||(l=!1),null!=n&&null==s&&(s=n);const m=e.origin;m&&(c&&!t(m,c)&&(a=!1),p++,r(u,u,m))}if(null==i)throw new Error;const m=i.clone();if(null==m.origin)return{rebake:!1,vertexSpace:m};if(a&&l)return{rebake:!1,vertexSpace:m,transform:s?.clone()};const g=o(u,u,1/p);return m.origin=g,{rebake:!0,vertexSpace:m}}function g(e,t){return t.normal>0&&!e.vertexAttributes.normal}function v(e,t,r){g(e,t)&&"source"===r.shading&&(r.shading="flat")}function h(e,t,r,o){if(e.components)for(const n of e.components){const s=n.clone(r),i=t.position/3;if(s.faces)for(let e=0;e<s.faces.length;e++)s.faces[e]+=i;else{s.faces=new Uint32Array(e.vertexAttributes.position.length/3);for(let e=0;e<s.faces.length;e++)s.faces[e]=e+i}v(e,t,s),o.push(s)}else if(e.vertexAttributes&&e.vertexAttributes.position){const r=e.vertexAttributes.position.length/3,n=new Uint32Array(r),i=t.position/3;for(let e=0;e<r;e++)n[e]=e+i;const l=new s({faces:n});v(e,t,l),o.push(l)}}function x(e,t,r,o,n){if(!t)return;const s=t.position;if(!s)return;const i=t[e],l=r[e];if(null==i){let t=o[e];const r=y[e];if(null!=l){for(let e=0;e<s.length;e+=3)for(let o=0;o<r;o++)l[t++]=n;o[e]=t}}else null!=l&&null!=i&&(b(i,0,l,o[e],i.length),o[e]+=i.length)}function b(e,t,r,o,n){for(let s=0;s<n;s++)r[o++]=e[t++];return r}function A(e){let t=!1,r=!1,o=!1,n=!1;for(const s of e){const e=s.vertexAttributes;if(e?.position&&(e.uv&&(t=!0),e.normal&&(r=!0),e.tangent&&(n=!0),e.color&&(o=!0),r&&t&&o&&n))break}return{normal:r,uv:t,color:o,tangent:n}}function w(e){let t=0,r=0,o=0,n=0,s=0;const l=A(e);for(const i of e){const e=i.vertexAttributes;e?.position&&(t+=e.position.length,l.uv&&(r+=e.position.length/y.position*y.uv),l.normal&&(o+=e.position.length/y.position*y.normal),l.color&&(n+=e.position.length/y.position*y.color),l.tangent&&(s+=e.position.length/y.position*y.tangent))}return new i({position:new Float64Array(t),uv:r?new Float32Array(r):null,normal:o?new Float32Array(o):null,tangent:s?new Float32Array(s):null,color:n?new Uint8Array(n):null})}const y={position:3,normal:3,tangent:4,uv:2,color:4};export{p as merge};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import"../../core/Logger.js";import{acosClamped as t}from"../../core/mathUtils.js";import{getEpsilon as e}from"../../core/libs/gl-matrix-2/math/common.js";import{fromRotation as r}from"../../core/libs/gl-matrix-2/math/mat4.js";import{d as s,F as i,s as n,e as o,j as c,b as a,i as h,f as u,p as l,C as m,l as d,c as g,E as f,n as p,h as M}from"../../chunks/vec32.js";import{fromValues as j,fromArray as y,clone as _,create as x}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as b}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isVec3 as S}from"../../core/libs/gl-matrix-2/types/vec3.js";import{isVec4 as v}from"../../core/libs/gl-matrix-2/types/vec4.js";import{fromPoints as P,closestPoint as A}from"./ray.js";import{cartesianToSpherical as R}from"./sphereUtils.js";import{angle as q}from"./vector.js";import{sv3d as O,sm4d as w}from"./vectorStacks.js";class E{constructor(t=0,e=0,r=0,s=0){this.radius=s,"number"==typeof t?this._center=j(t,e,r):S(t)||v(t)?(this._center=y(t),this.radius=4===t.length?t[3]:e):(this._center=_(t.center),this.radius=t.radius)}get center(){return this._center}set center(t){s(this.center,t)}exactEquals(t){return i(this._center,t.center)&&this.radius===t.radius}copy(t){return t!==this&&(s(this._center,t.center),this.radius=t.radius),this}clone(){return new E(this.center,this.radius)}toVec4(){return b(this.center[0],this.center[1],this.center[2],this.radius)}contains(t){return n(this.center,t)<=this.radius**2}intersectRay(t,e){if(null==t)return!1;if(!this._intersect(t,k))return!1;let{t0:r,t1:s}=k;if((r<0||s<r&&s>0)&&(r=s),r<0)return!1;if(e){const{origin:s,direction:i}=t;e[0]=s[0]+i[0]*r,e[1]=s[1]+i[1]*r,e[2]=s[2]+i[2]*r}return!0}intersectLine(t,r){const s=P(t,r);if(!this._intersect(s,k))return[];const{origin:i,direction:n}=s,{t0:o,t1:c}=k,a=t=>{const e=x();return g(e,i,n,t),this.projectPoint(e,e)};return Math.abs(o-c)<e()?[a(o)]:[a(o),a(c)]}_intersect(t,e){const{origin:r,direction:s}=t,i=L;i[0]=r[0]-this.center[0],i[1]=r[1]-this.center[1],i[2]=r[2]-this.center[2];const n=s[0]*s[0]+s[1]*s[1]+s[2]*s[2];if(0===n)return!1;const o=2*(s[0]*i[0]+s[1]*i[1]+s[2]*i[2]),c=o*o-4*n*(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]-this.radius**2);if(c<0)return!1;const a=Math.sqrt(c);return e.t0=(-o-a)/(2*n),e.t1=(-o+a)/(2*n),!0}projectPoint(t,e){const r=o(O.get(),t,this.center),s=c(O.get(),r,this.radius/a(r));return h(e,s,this.center)}closestPointOnSilhouette(t,e){const s=O.get(),i=w.get();u(s,t.origin,t.direction),u(e,s,t.origin),c(e,e,1/a(e)*this.radius);const n=this._angleToSilhouette(t.origin),o=q(t.origin,e);return r(i,o+n,s),l(e,e,i),e}frustumCoverage(t,e,r){const s=this.radius,i=s*s,n=t+.5*Math.PI,o=e*e+i-2*Math.cos(n)*e*s,c=Math.sqrt(o),a=o-i;if(a<=0)return.5;const h=Math.sqrt(a),u=Math.acos(h/c)-Math.asin(s/(c/Math.sin(n)));return Math.min(1,(u+.5*r)/r)}_angleToSilhouette(e){const r=o(O.get(),e,this.center),s=a(r),i=this.radius,n=i+Math.abs(i-s);return t(i/n)}union(t){const e=m(this._center,t.center),r=this.radius,s=t.radius;return e+s<r?this:e+r<s?(this.copy(t),this):(d(this._center,this._center,t.center,(e+s-r)/(2*e)),this.radius=(e+r+s)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}}const C={create:t=>new E(t),copy:(t,e)=>e.copy(t),setExtent:(t,e,r)=>r.copy(t),getExtent:(t,e)=>e,elevate:(t,e,r)=>(r.copy(t),r.radius+=e,r),axisAt(t,e,r,s){const i=o(U,e,t.center);switch(r){case 0:{const t=R(i,U)[2];return M(s,-Math.sin(t),Math.cos(t),0)}case 1:{const t=R(i,U),e=t[1],r=t[2],n=Math.sin(e);return M(s,-n*Math.cos(r),-n*Math.sin(r),Math.cos(e))}case 2:return p(s,i);default:return}},altitudeAt(t,e){const r=o(V,e,t.center);return a(r)-t.radius},setAltitudeAt(t,e,r,s){const i=C.altitudeAt(t,e),n=C.axisAt(t,e,2,V),o=c(V,n,r-i);return h(s,e,o)},intersectRay:(t,e,r)=>t.intersectRay(e,r),closestPoint:(t,e,r)=>t.intersectRay(e,r)?r:(A(e,t.center,r),t.projectPoint(r,r)),intersectRayClosestSilhouette(t,e,r){if(t.intersectRay(e,r))return r;const s=t.closestPointOnSilhouette(e,O.get());return h(r,e.origin,c(O.get(),e.direction,m(e.origin,s)/a(e.direction))),r},closestPointOnSilhouette:(t,e,r)=>t.closestPointOnSilhouette(e,r),distanceToSilhouette(t,e){const r=o(O.get(),e,t.center),s=f(r),i=t.radius**2;return Math.sqrt(Math.abs(s-i))}},T=new E,k={t0:0,t1:0},L=x(),U=x(),V=x();export{T as NullSphere,E as Sphere,C as sphereCSO};
5
+ import"../../core/has.js";import"../../core/Logger.js";import{acosClamped as t}from"../../core/mathUtils.js";import{getEpsilon as e}from"../../core/libs/gl-matrix-2/math/common.js";import{fromRotation as r}from"../../core/libs/gl-matrix-2/math/mat4.js";import{d as s,G as i,s as n,e as o,j as c,b as a,i as h,f as u,p as l,D as m,l as d,c as g,F as f,n as p,h as M}from"../../chunks/vec32.js";import{fromValues as j,fromArray as y,clone as _,create as x}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as b}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isVec3 as S}from"../../core/libs/gl-matrix-2/types/vec3.js";import{isVec4 as v}from"../../core/libs/gl-matrix-2/types/vec4.js";import{fromPoints as P,closestPoint as A}from"./ray.js";import{cartesianToSpherical as R}from"./sphereUtils.js";import{angle as q}from"./vector.js";import{sv3d as O,sm4d as w}from"./vectorStacks.js";class E{constructor(t=0,e=0,r=0,s=0){this.radius=s,"number"==typeof t?this._center=j(t,e,r):S(t)||v(t)?(this._center=y(t),this.radius=4===t.length?t[3]:e):(this._center=_(t.center),this.radius=t.radius)}get center(){return this._center}set center(t){s(this.center,t)}exactEquals(t){return i(this._center,t.center)&&this.radius===t.radius}copy(t){return t!==this&&(s(this._center,t.center),this.radius=t.radius),this}clone(){return new E(this.center,this.radius)}toVec4(){return b(this.center[0],this.center[1],this.center[2],this.radius)}contains(t){return n(this.center,t)<=this.radius**2}intersectRay(t,e){if(null==t)return!1;if(!this._intersect(t,C))return!1;let{t0:r,t1:s}=C;if((r<0||s<r&&s>0)&&(r=s),r<0)return!1;if(e){const{origin:s,direction:i}=t;e[0]=s[0]+i[0]*r,e[1]=s[1]+i[1]*r,e[2]=s[2]+i[2]*r}return!0}intersectLine(t,r){const s=P(t,r);if(!this._intersect(s,C))return[];const{origin:i,direction:n}=s,{t0:o,t1:c}=C,a=t=>{const e=x();return g(e,i,n,t),this.projectPoint(e,e)};return Math.abs(o-c)<e()?[a(o)]:[a(o),a(c)]}_intersect(t,e){const{origin:r,direction:s}=t,i=L;i[0]=r[0]-this.center[0],i[1]=r[1]-this.center[1],i[2]=r[2]-this.center[2];const n=s[0]*s[0]+s[1]*s[1]+s[2]*s[2];if(0===n)return!1;const o=2*(s[0]*i[0]+s[1]*i[1]+s[2]*i[2]),c=o*o-4*n*(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]-this.radius**2);if(c<0)return!1;const a=Math.sqrt(c);return e.t0=(-o-a)/(2*n),e.t1=(-o+a)/(2*n),!0}projectPoint(t,e){const r=o(O.get(),t,this.center),s=c(O.get(),r,this.radius/a(r));return h(e,s,this.center)}closestPointOnSilhouette(t,e){const s=O.get(),i=w.get();u(s,t.origin,t.direction),u(e,s,t.origin),c(e,e,1/a(e)*this.radius);const n=this._angleToSilhouette(t.origin),o=q(t.origin,e);return r(i,o+n,s),l(e,e,i),e}frustumCoverage(t,e,r){const s=this.radius,i=s*s,n=t+.5*Math.PI,o=e*e+i-2*Math.cos(n)*e*s,c=Math.sqrt(o),a=o-i;if(a<=0)return.5;const h=Math.sqrt(a),u=Math.acos(h/c)-Math.asin(s/(c/Math.sin(n)));return Math.min(1,(u+.5*r)/r)}_angleToSilhouette(e){const r=o(O.get(),e,this.center),s=a(r),i=this.radius,n=i+Math.abs(i-s);return t(i/n)}union(t){const e=m(this._center,t.center),r=this.radius,s=t.radius;return e+s<r?this:e+r<s?(this.copy(t),this):(d(this._center,this._center,t.center,(e+s-r)/(2*e)),this.radius=(e+r+s)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}}const T={create:t=>new E(t),copy:(t,e)=>e.copy(t),setExtent:(t,e,r)=>r.copy(t),getExtent:(t,e)=>e,elevate:(t,e,r)=>(r.copy(t),r.radius+=e,r),axisAt(t,e,r,s){const i=o(U,e,t.center);switch(r){case 0:{const t=R(i,U)[2];return M(s,-Math.sin(t),Math.cos(t),0)}case 1:{const t=R(i,U),e=t[1],r=t[2],n=Math.sin(e);return M(s,-n*Math.cos(r),-n*Math.sin(r),Math.cos(e))}case 2:return p(s,i);default:return}},altitudeAt(t,e){const r=o(V,e,t.center);return a(r)-t.radius},setAltitudeAt(t,e,r,s){const i=T.altitudeAt(t,e),n=T.axisAt(t,e,2,V),o=c(V,n,r-i);return h(s,e,o)},intersectRay:(t,e,r)=>t.intersectRay(e,r),closestPoint:(t,e,r)=>t.intersectRay(e,r)?r:(A(e,t.center,r),t.projectPoint(r,r)),intersectRayClosestSilhouette(t,e,r){if(t.intersectRay(e,r))return r;const s=t.closestPointOnSilhouette(e,O.get());return h(r,e.origin,c(O.get(),e.direction,m(e.origin,s)/a(e.direction))),r},closestPointOnSilhouette:(t,e,r)=>t.closestPointOnSilhouette(e,r),distanceToSilhouette(t,e){const r=o(O.get(),e,t.center),s=f(r),i=t.radius**2;return Math.sqrt(Math.abs(s-i))}},k=new E,C={t0:0,t1:0},L=x(),U=x(),V=x();export{k as NullSphere,E as Sphere,T as sphereCSO};