@arcgis/core 4.34.0-next.58 → 4.34.0-next.59

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 (229) hide show
  1. package/Basemap.js +1 -1
  2. package/LICENSE.md +19 -0
  3. package/README.md +2 -18
  4. package/applications/KnowledgeStudio/reshape.d.ts +5 -0
  5. package/applications/KnowledgeStudio/reshape.js +5 -0
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/{26975e5b3fb7f2ed45a4.js → 03fe4164abd12abc7921.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{893e5eb5c028c4704317.js → 0427f66b56ec6601deb0.js} +1 -1
  9. package/assets/esri/core/workers/chunks/0cb2f7172190babb4139.js +1 -0
  10. package/assets/esri/core/workers/chunks/0e28cb5d8d89ae29cdd0.js +1 -0
  11. package/assets/esri/core/workers/chunks/{1776ef96c9f4636f8838.js → 138c11b5eca621e51396.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{57c438bb0da6410df525.js → 1bf17c6548ac4cd5a166.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{043bb97e38e3a54aa2ab.js → 1ed7a8f4a0058d3b69ef.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{827bebb4bcdde23adc91.js → 251b7f2e295ce191eb62.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{02a31483e09652a1a1a2.js → 2b7f9a57a2cfbc108673.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{7c86af4f60cea383ed96.js → 39a1f361bb69073af765.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{327b0da744426ce40e60.js → 3a7ac10a6614fe5745f7.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{8c79945909069733558f.js → 4094cebc4b92c52f4e27.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{82de1b50ae286f1e6c44.js → 451761c7bd2da530e1d0.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{cc748d4f4adb9c584aa4.js → 45aeff2f751f124f8e53.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{d20af70b23f175fb5442.js → 48b9ba825856a0c843ff.js} +1 -1
  22. package/assets/esri/core/workers/chunks/4dee2f05508e90410f13.js +1 -0
  23. package/assets/esri/core/workers/chunks/{d630fc3acd2552c98dc0.js → 547af4ffbeeccba9d187.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{ff14b632f147cb68ed59.js → 58422c616a824ab49218.js} +1 -1
  25. package/assets/esri/core/workers/chunks/589a0e244ef5f1b84ab6.js +1 -0
  26. package/assets/esri/core/workers/chunks/{2c7e7895c4dda176220e.js → 5d4b24c864ebb68ae61e.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{a1ff4c252012d5026133.js → 65eb183b5d001dfc42c8.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{f1b6d6ee03635d985c3e.js → 6688efc71d9d8f4d2559.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{d5faf3ddf9a39de826be.js → 672c04d48aa51f16e9b7.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{17e203e4680c07bd02f1.js → 7aa7aff6d42be7c2d1d2.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{549e073fe276363a9896.js → 7db105f6b688b6da8106.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{945c5a477940ebd23a4c.js → 7f0c78bcba0aed3c4eff.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{3eb792863a789b97ec58.js → 831a69e5a87e92830fbe.js} +1 -1
  34. package/assets/esri/core/workers/chunks/83dfaa6e3bd58d544f35.js +1 -0
  35. package/assets/esri/core/workers/chunks/8bbae8ac586e5c0819d2.js +1 -0
  36. package/assets/esri/core/workers/chunks/{9275313e0f1f521b2658.js → 9325000c87295c473291.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{944d1608f935516951c4.js → 94b9948ec628187c19fc.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{757717416d909059df2f.js → 981275b6f008431c983a.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{c71dac67f95d694bf67e.js → 9f4e23bae621ff3ecea3.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{989251f5e0d6a08b1afa.js → a17ed7ce97e69466d730.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{319fe6a02ec630a827ea.js → a7ea2e3895046e566bc6.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{5cfec58c7c31e6d8c6ea.js → abe60d92e0219ee97036.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{4193691ca076948f4f90.js → b53008c1461dd6bacc63.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{1d234c057a6671acc59f.js → b605dfdfed8ff8eda4f3.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{0fb2dcbd54175e75d94d.js → b68b54be3d67595a9446.js} +4 -6
  46. package/assets/esri/core/workers/chunks/{7eda1c400658b6a99be8.js → ba0c7339fa19cc7cbde7.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{724de82d101eb59c2834.js → bd451668c4ce9f7d7128.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{91ede8c62a7b1e8b8023.js → be06c8a58c217a17451b.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{08c0c016787caa169492.js → c24214666d10cb648428.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{a3a23a56df4e5ee86bb2.js → c5fe356fc5b8b7be0d31.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{64fab4e1e28c06c83403.js → c779c8b98e07fa881c1d.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{4a0257c449f31bdadf26.js → cef9ff811221a7c3812c.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{b1982490762972ae023d.js → d0296368ae143de4d5ce.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{3d5954478864a975e65e.js → d07d3b0e06f12aee4a8b.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{e1472dbf0795d737d6f8.js → d2371f5034b2a32e2523.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{2f65081bfedeab44d6cb.js → d35cadfb78ac9803069b.js} +1 -1
  57. package/assets/esri/core/workers/chunks/d7ce68667bb355ef8e5d.js +1 -0
  58. package/assets/esri/core/workers/chunks/{8c2fcfcfbb6b70f7bada.js → d823277612f971a9c2f0.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{c4ff5c78fc8668af9c05.js → d91b80aa4f847c2e2a33.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{c4ceb267d4004d8da8cc.js → e0bbfbe1ed39c82f1bd4.js} +1 -1
  61. package/assets/esri/core/workers/chunks/e58c5c8639aa837c84d1.js +1 -0
  62. package/assets/esri/core/workers/chunks/{a24762e976c1459b12de.js → e689a4849f5af3f2f641.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{5787101b2b814c5d2439.js → eacc7fccdc3fb670ac8f.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{0df1f56df6d47dfbb6ea.js → eada3483116a5ea8baed.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{47682247910271077333.js → ee78a38a0cacb19b2fd4.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{f4061587ff5789fa4e1f.js → f594df2f5ce6ca41a254.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{d7b3e81cc313fd0a33b0.js → f5c821ca2911a5103c9a.js} +1 -1
  68. package/assets/esri/core/workers/chunks/f711aeba1a2c184ddb43.js +1 -0
  69. package/assets/esri/core/workers/chunks/fdae43a97537093e4b97.js +1 -0
  70. package/chunks/BloomComposition.glsl.js +36 -18
  71. package/chunks/ComponentShader.glsl.js +1 -1
  72. package/chunks/CompositeGeographicTransformation.js +1 -1
  73. package/chunks/DefaultMaterial.glsl.js +1 -1
  74. package/chunks/GeodeticDistanceCalculator-Ce-woMPw.js +1 -1
  75. package/chunks/GeographicTransformation.js +1 -1
  76. package/chunks/MultiPathImpl.js +1 -1
  77. package/chunks/OperatorGeodesicBuffer.js +1 -1
  78. package/chunks/OperatorGeodeticArea.js +1 -1
  79. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  80. package/chunks/OperatorGeodeticLength.js +1 -1
  81. package/chunks/OperatorProximityGeodesic.js +1 -1
  82. package/chunks/OperatorShapePreservingLength.js +1 -1
  83. package/chunks/OperatorShapePreservingProject.js +1 -1
  84. package/chunks/Path.glsl.js +1 -1
  85. package/chunks/Point2D.js +1 -1
  86. package/chunks/ProjectionTransformation.js +1 -1
  87. package/chunks/RealisticTree.glsl.js +1 -1
  88. package/chunks/SpatialReference.js +1 -1
  89. package/chunks/UnitFactory.js +1 -1
  90. package/chunks/sphere.js +1 -1
  91. package/chunks/vec42.js +1 -1
  92. package/config.js +1 -1
  93. package/copyright.txt +2 -20
  94. package/core/accessorSupport/layerContainerType.js +1 -1
  95. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  96. package/core/libs/gl-matrix-2/math/vec4.js +1 -1
  97. package/core/quantityFormatUtils.js +1 -1
  98. package/core/unitFormatUtils.js +1 -1
  99. package/editing/geometry/coordUtils.js +5 -0
  100. package/editing/geometry/lineUtils.js +5 -0
  101. package/editing/sharedTemplates/executor/builders/equallySpaced.js +1 -1
  102. package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
  103. package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
  104. package/editing/sharedTemplates/executor/builders/support/offsetUtils.js +1 -1
  105. package/editing/sharedTemplates/executor/builders/support/shapeUtils.js +1 -1
  106. package/geometry/coordinateFormatter.js +1 -1
  107. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  108. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  109. package/geometry/operators/gx/operatorOffset.js +1 -1
  110. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  111. package/geometry/operators/support/apiConverter.js +1 -1
  112. package/geometry/operators/support/initNoPeFactory.js +1 -1
  113. package/geometry/operators/support/jsonConverter.js +1 -1
  114. package/geometry/support/sphere.js +1 -1
  115. package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
  116. package/graphic/LinkChartGraphicOrigin.js +5 -0
  117. package/graphic/isLinkChartGraphicOrigin.js +5 -0
  118. package/interfaces.d.ts +129 -10
  119. package/kernel.js +1 -1
  120. package/layers/FeatureLayer.js +1 -1
  121. package/layers/GroundLayer.js +1 -1
  122. package/layers/ParquetLayer.js +1 -1
  123. package/layers/catalog/catalogUtils.js +1 -1
  124. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  125. package/layers/knowledgeGraph/nodeMovementUtils.js +5 -0
  126. package/layers/mixins/ImageryTileMixin.js +1 -1
  127. package/layers/mixins/operationalLayers.js +1 -1
  128. package/layers/support/RasterStorageInfo.js +1 -1
  129. package/layers/support/Sublayer.js +1 -1
  130. package/layers/support/layersCreator.js +1 -1
  131. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  132. package/layers/support/rasterFunctions/BandArithmeticFunction.js +1 -1
  133. package/layers/support/rasterFunctions/BaseRasterFunction.js +1 -1
  134. package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
  135. package/layers/support/rasterFunctions/NDVIFunction.js +1 -1
  136. package/package.json +1 -1
  137. package/portal/schemas/definitions.js +1 -1
  138. package/renderers/support/RasterSymbolizer.js +1 -1
  139. package/support/basemapUtils.js +1 -1
  140. package/support/revision.js +1 -1
  141. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  142. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  143. package/views/3d/camera/constraintUtils/distance.js +1 -1
  144. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  145. package/views/3d/layers/I3SMeshView3D.js +1 -1
  146. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  147. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  148. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  149. package/views/3d/layers/graphics/ElevationContext.js +1 -1
  150. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  151. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  152. package/views/3d/layers/graphics/pointUtils.js +1 -1
  153. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  154. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  155. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  156. package/views/3d/layers/support/FlowTileTree3DDebugger.js +1 -1
  157. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  158. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  159. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  160. package/views/3d/state/utils/navigationUtils.js +1 -1
  161. package/views/3d/support/CombinedElevationProvider.js +1 -1
  162. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  163. package/views/3d/terrain/OverlayManager.js +1 -1
  164. package/views/3d/terrain/SphericalPatch.js +1 -1
  165. package/views/3d/terrain/TerrainSurface.js +1 -1
  166. package/views/3d/terrain/Tile.js +1 -1
  167. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  168. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +2 -4
  169. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  170. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  171. package/views/3d/webgl-engine/effects/bloom/BloomComposition.glsl.js +1 -1
  172. package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechniqueConfiguration.js +5 -0
  173. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  174. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  175. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  176. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  177. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  178. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  179. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  180. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  181. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  182. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  183. package/views/3d/webgl-engine/lib/octreeUtils.js +1 -1
  184. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  185. package/views/LinkChartView.js +1 -1
  186. package/views/draw/DrawOperation.js +1 -1
  187. package/views/draw/support/GraphicMover.js +1 -1
  188. package/views/draw/support/HighlightHelper.js +1 -1
  189. package/views/draw/support/Reshape.js +1 -1
  190. package/views/draw/support/drawUtils.js +1 -1
  191. package/views/interactive/Tooltip.js +1 -1
  192. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  193. package/views/interactive/sketch/SketchLabelOptions.js +1 -1
  194. package/views/interactive/sketch/SketchOptions.js +1 -1
  195. package/views/interactive/sketch/SketchTooltipOptions.js +1 -1
  196. package/views/interactive/sketch/SketchTooltipVisibleElements.js +1 -1
  197. package/views/interactive/sketch/SketchValueOptions.js +1 -1
  198. package/views/interactive/sketch/Units.js +1 -1
  199. package/views/interactive/sketch/constraints.js +1 -1
  200. package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
  201. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  202. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  203. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  204. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  205. package/views/interactive/tooltip/fields/fields.js +1 -1
  206. package/views/interactive/tooltip/fields/parsingAndFormattingUtils.js +1 -1
  207. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  208. package/views/support/angularMeasurementUtils.js +1 -1
  209. package/webdoc/support/writeUtils.js +1 -1
  210. package/webscene/spec-certification/api.js +1 -1
  211. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  212. package/widgets/Editor/support/splitFeatureUtils.js +5 -0
  213. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  214. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  215. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  216. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  217. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
  218. package/widgets/OrientedImageryViewer.js +1 -1
  219. package/EULA.pdf +0 -0
  220. package/assets/esri/core/workers/chunks/00ee6f84119bc55a222f.js +0 -1
  221. package/assets/esri/core/workers/chunks/0569698a3e4eaf2bac8e.js +0 -1
  222. package/assets/esri/core/workers/chunks/0e4976f92b66793137c4.js +0 -1
  223. package/assets/esri/core/workers/chunks/171ce8c64f322cd5d6d1.js +0 -1
  224. package/assets/esri/core/workers/chunks/1ae15163af8875148fb8.js +0 -1
  225. package/assets/esri/core/workers/chunks/373c9e17e2834dfc1839.js +0 -1
  226. package/assets/esri/core/workers/chunks/55bb794bcdd9cc788322.js +0 -1
  227. package/assets/esri/core/workers/chunks/6acffacbb4a03af52e3b.js +0 -1
  228. package/assets/esri/core/workers/chunks/b457b7dd907f06278bee.js +0 -1
  229. package/assets/esri/core/workers/chunks/e7ccf067bea8f4766424.js +0 -1
package/chunks/sphere.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../core/has.js";import"../core/Logger.js";import{acosClamped as t}from"../core/mathUtils.js";import{fromRotation as n}from"../core/libs/gl-matrix-2/math/mat4.js";import{i as r,s as e,t as o,f as s,g as i,j as a,l as c,h as u,d as f,k as m,n as l,m as g,b as h}from"./vec32.js";import{create as p}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as d}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{getEpsilon as M}from"../core/libs/gl-matrix-2/math/common.js";import{fromPoints as j,closestPoint as y}from"../geometry/support/ray.js";import{cartesianToSpherical as b}from"../geometry/support/sphereUtils.js";import{angle as C}from"../geometry/support/vector.js";import{sv3d as x,sm4d as v}from"../geometry/support/vectorStacks.js";const S=P();function A(t,n,r,e){return new Array(t,n,r,e)}function P(){return A(0,0,0,0)}function q(t,n){return A(t[0],t[1],t[2],n)}function R(t){return A(t[0],t[1],t[2],t[3])}function V(t,n,r){return F(t,n[0],n[1],n[2],r)}function F(t,n,r,e,o){return t[0]=n,t[1]=r,t[2]=e,t[3]=o,t}function T(t,n){return E(t,n)}function E(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}function O(t,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n}function _(t){return A(t[0],t[1],t[2],t[3])}function k(t){t[0]=0,t[1]=0,t[2]=0,t[3]=0}function w(t,n){return t[0]=0,t[1]=0,t[2]=0,t[3]=n,t}function L(t){return t[3]}function z(t,n){return r(n,t[0],t[1],t[2])}function I(t){return r(ht,t[0],t[1],t[2])}function N(t,n){t[0]=n[0],t[1]=n[1],t[2]=n[2]}function U(t,n){t[0]=n[0],t[1]=n[1],t[2]=n[2]}function B(t,n,r,e){t[0]=n,t[1]=r,t[2]=e}function D(t,n,r){N(t,o(ht,n,r))}function G(t,n,r,e,o){t[0]=n,t[1]=r,t[2]=e,t[3]=o}function H(t){return d(t[0],t[1],t[2],t[3])}function J(t,n,r){return t!==r&&(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=t[3]+n,r}function K(t,n,r){return t!==r&&O(t,r),r}function Q(t,n){return n}function W(t,n,r){if(null==n)return!1;if(!Z(t,n,Y))return!1;let{t0:e,t1:o}=Y;if((e<0||o<e&&o>0)&&(e=o),e<0)return!1;if(r){const{origin:t,direction:o}=n;r[0]=t[0]+o[0]*e,r[1]=t[1]+o[1]*e,r[2]=t[2]+o[2]*e}return!0}function X(t,n,r){const e=j(n,r);if(!Z(t,e,Y))return[];const{origin:o,direction:s}=e,{t0:i,t1:a}=Y,c=n=>{const r=p();return h(r,o,s,n),st(t,r,r)};return Math.abs(i-a)<M()?[c(i)]:[c(i),c(a)]}const Y={t0:0,t1:0};function Z(t,n,r){const{origin:e,direction:o}=n,s=$;s[0]=e[0]-t[0],s[1]=e[1]-t[1],s[2]=e[2]-t[2];const i=o[0]*o[0]+o[1]*o[1]+o[2]*o[2];if(0===i)return!1;const a=2*(o[0]*s[0]+o[1]*s[1]+o[2]*s[2]),c=a*a-4*i*(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]-t[3]*t[3]);if(c<0)return!1;const u=Math.sqrt(c);return r.t0=(-a-u)/(2*i),r.t1=(-a+u)/(2*i),!0}const $=p();function tt(t,n){return W(t,n,null)}function nt(t,n,r){if(W(t,n,r))return r;const e=rt(t,n,x.get());return s(r,n.origin,i(x.get(),n.direction,a(n.origin,e)/c(n.direction))),r}function rt(t,r,e){const s=x.get(),a=v.get();u(s,r.origin,r.direction);const f=L(t);u(e,s,r.origin),i(e,e,1/c(e)*f);const m=at(t,r.origin),l=C(r.origin,e);return n(a,l+m,s),o(e,e,a),e}function et(t,n,r,e){const o=L(t),s=o*o,i=n+.5*Math.PI,a=r*r+s-2*Math.cos(i)*r*o,c=Math.sqrt(a),u=a-s;if(u<=0)return.5;const f=Math.sqrt(u),m=Math.acos(f/c)-Math.asin(o/(c/Math.sin(i)));return Math.min(1,(m+.5*e)/e)}function ot(t,n,r){return W(t,n,r)?r:(y(n,I(t),r),st(t,r,r))}function st(t,n,r){const e=f(x.get(),n,I(t)),o=i(x.get(),e,t[3]/c(e));return s(r,o,I(t))}function it(t,n){const r=f(x.get(),n,I(t)),e=m(r),o=t[3]*t[3];return Math.sqrt(Math.abs(e-o))}function at(n,r){const e=f(x.get(),r,I(n)),o=c(e),s=L(n),i=s+Math.abs(s-o);return t(s/i)}const ct=p();function ut(t,n,e,o){const s=f(ct,n,I(t));switch(e){case 0:{const t=b(s,ct)[2];return r(o,-Math.sin(t),Math.cos(t),0)}case 1:{const t=b(s,ct),n=t[1],e=t[2],i=Math.sin(n);return r(o,-i*Math.cos(e),-i*Math.sin(e),Math.cos(n))}case 2:return l(o,s);default:return}}function ft(t,n){const r=f(Mt,n,I(t));return c(r)-t[3]}function mt(t,n,r,e){const o=ft(t,n),a=ut(t,n,2,Mt),c=i(Mt,a,r-o);return s(e,n,c)}function lt(t,n){const r=e(I(t),n),o=L(t);return r<=o*o}function gt(t,n,r=P()){const e=a(I(t),z(n,pt)),o=t[3],s=n[3];return e+s<o?(O(t,r),r):e+o<s?(O(n,r),r):(g(ht,I(t),z(n,pt),(e+s-o)/(2*e)),V(r,ht,(e+o+s)/2),r)}const ht=p(),pt=p(),dt=P(),Mt=p(),jt=Object.freeze(Object.defineProperty({__proto__:null,NullSphere:S,altitudeAt:ft,angleToSilhouette:at,axisAt:ut,cameraFrustumCoverage:et,clear:k,clone:_,closestPoint:ot,closestPointOnSilhouette:rt,containsPoint:lt,copy:O,copyCenter:U,create:P,distanceToSilhouette:it,elevate:J,equals:E,exactEquals:T,fromCenterAndRadius:q,fromRadius:w,fromValues:A,fromVec4:R,getCenter:z,getCenterTemp:I,getExtent:Q,getRadius:L,intersectLine:X,intersectRay:W,intersectRayClosestSilhouette:nt,intersectsRay:tt,projectPoint:st,set:F,setAltitudeAt:mt,setCenter:N,setCenterFromValues:B,setExtent:K,setFromCenterAndRadius:V,setFromValues:G,setTransformedCenter:D,tmpSphere:dt,toVec4:H,union:gt},Symbol.toStringTag,{value:"Module"}));export{R as A,lt as B,F as C,E as D,_ as E,k as F,J as G,K as H,Q as I,nt as J,ot as K,at as L,ut as M,S as N,ft as O,mt as P,I as a,w as b,P as c,et as d,V as e,A as f,L as g,rt as h,W as i,O as j,z as k,N as l,D as m,it as n,B as o,G as p,tt as q,U as r,jt as s,dt as t,q as u,X as v,T as w,st as x,H as y,gt as z};
5
+ import"../core/has.js";import"../core/Logger.js";import{acosClamped as t}from"../core/mathUtils.js";import{fromRotation as n}from"../core/libs/gl-matrix-2/math/mat4.js";import{i as r,s as e,t as o,f as s,g as i,j as a,l as c,h as u,d as f,k as m,n as l,m as g,b as h}from"./vec32.js";import{create as p}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as d}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{getEpsilon as M}from"../core/libs/gl-matrix-2/math/common.js";import{fromPoints as j,closestPoint as y}from"../geometry/support/ray.js";import{cartesianToSpherical as b}from"../geometry/support/sphereUtils.js";import{angle as C}from"../geometry/support/vector.js";import{sv3d as x,sm4d as v}from"../geometry/support/vectorStacks.js";const S=P();function A(t,n,r,e){return new Array(t,n,r,e)}function P(){return A(0,0,0,0)}function q(t,n){return A(t[0],t[1],t[2],n)}function R(t){return A(t[0],t[1],t[2],t[3])}function V(t,n,r){return F(t,n[0],n[1],n[2],r)}function F(t,n,r,e,o){return t[0]=n,t[1]=r,t[2]=e,t[3]=o,t}function T(t,n){return E(t,n)}function E(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}function O(t,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n}function _(t){return A(t[0],t[1],t[2],t[3])}function k(t){t[0]=0,t[1]=0,t[2]=0,t[3]=0}function w(t,n){return t[0]=0,t[1]=0,t[2]=0,t[3]=n,t}function L(t){return t[3]}function z(t,n){return r(n,t[0],t[1],t[2])}function I(t){return r(ht,t[0],t[1],t[2])}function N(t,n){t[0]=n[0],t[1]=n[1],t[2]=n[2]}function U(t,n){t[0]=n[0],t[1]=n[1],t[2]=n[2]}function B(t,n,r,e){t[0]=n,t[1]=r,t[2]=e}function D(t,n,r){N(t,o(ht,n,r))}function G(t,n,r,e,o){t[0]=n,t[1]=r,t[2]=e,t[3]=o}function H(t){return d(t[0],t[1],t[2],t[3])}function J(t,n,r){return t!==r&&(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=t[3]+n,r}function K(t,n,r){return t!==r&&O(t,r),r}function Q(t,n){return n}function W(t,n,r){if(null==n)return!1;if(!Z(t,n,Y))return!1;let{t0:e,t1:o}=Y;if((e<0||o<e&&o>0)&&(e=o),e<0)return!1;if(r){const{origin:t,direction:o}=n;r[0]=t[0]+o[0]*e,r[1]=t[1]+o[1]*e,r[2]=t[2]+o[2]*e}return!0}function X(t,n,r){const e=j(n,r);if(!Z(t,e,Y))return[];const{origin:o,direction:s}=e,{t0:i,t1:a}=Y,c=n=>{const r=p();return h(r,o,s,n),st(t,r,r)};return Math.abs(i-a)<M()?[c(i)]:[c(i),c(a)]}const Y={t0:0,t1:0};function Z(t,n,r){const{origin:e,direction:o}=n,s=$;s[0]=e[0]-t[0],s[1]=e[1]-t[1],s[2]=e[2]-t[2];const i=o[0]*o[0]+o[1]*o[1]+o[2]*o[2];if(0===i)return!1;const a=2*(o[0]*s[0]+o[1]*s[1]+o[2]*s[2]),c=a*a-4*i*(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]-t[3]*t[3]);if(c<0)return!1;const u=Math.sqrt(c);return r.t0=(-a-u)/(2*i),r.t1=(-a+u)/(2*i),!0}const $=p();function tt(t,n){return W(t,n,null)}function nt(t,n,r){if(W(t,n,r))return r;const e=rt(t,n,x.get());return s(r,n.origin,i(x.get(),n.direction,a(n.origin,e)/c(n.direction))),r}function rt(t,r,e){const s=x.get(),a=v.get();u(s,r.origin,r.direction);const f=L(t);u(e,s,r.origin),i(e,e,1/c(e)*f);const m=at(t,r.origin),l=C(r.origin,e);return n(a,l+m,s),o(e,e,a),e}function et(t,n,r,e){const o=L(t),s=o*o,i=n+.5*Math.PI,a=r*r+s-2*Math.cos(i)*r*o,c=Math.sqrt(a),u=a-s;if(u<=0)return.5;const f=Math.sqrt(u),m=Math.acos(f/c)-Math.asin(o/(c/Math.sin(i)));return Math.min(1,(m+.5*e)/e)}function ot(t,n,r){return W(t,n,r)?r:(y(n,I(t),r),st(t,r,r))}function st(t,n,r){const e=f(x.get(),n,I(t)),o=i(x.get(),e,t[3]/c(e));return s(r,o,I(t))}function it(t,n){const r=f(x.get(),n,I(t)),e=m(r),o=t[3]*t[3];return Math.sqrt(Math.abs(e-o))}function at(n,r){const e=f(x.get(),r,I(n)),o=c(e),s=L(n),i=s+Math.abs(s-o);return t(s/i)}const ct=p();function ut(t,n,e,o){const s=f(ct,n,I(t));switch(e){case 0:{const t=b(s,ct)[2];return r(o,-Math.sin(t),Math.cos(t),0)}case 1:{const t=b(s,ct),n=t[1],e=t[2],i=Math.sin(n);return r(o,-i*Math.cos(e),-i*Math.sin(e),Math.cos(n))}case 2:return l(o,s);default:return}}function ft(t,n){const r=f(Mt,n,I(t));return c(r)-t[3]}function mt(t,n,r,e){const o=ft(t,n),a=ut(t,n,2,Mt),c=i(Mt,a,r-o);return s(e,n,c)}function lt(t,n){const r=e(I(t),n),o=L(t);return r<=o*o}function gt(t,n,r=P()){const e=a(I(t),z(n,pt)),o=t[3],s=n[3];return e+s<o?(O(t,r),r):e+o<s?(O(n,r),r):(g(ht,I(t),z(n,pt),(e+s-o)/(2*e)),V(r,ht,(e+o+s)/2),r)}const ht=p(),pt=p(),dt=P(),Mt=p(),jt=Object.freeze(Object.defineProperty({__proto__:null,NullSphere:S,altitudeAt:ft,angleToSilhouette:at,axisAt:ut,cameraFrustumCoverage:et,clear:k,clone:_,closestPoint:ot,closestPointOnSilhouette:rt,containsPoint:lt,copy:O,copyCenter:U,create:P,distanceToSilhouette:it,elevate:J,equals:E,exactEquals:T,fromCenterAndRadius:q,fromRadius:w,fromValues:A,fromVec4:R,getCenter:z,getCenterTemp:I,getExtent:Q,getRadius:L,intersectLine:X,intersectRay:W,intersectRayClosestSilhouette:nt,intersectsRay:tt,projectPoint:st,set:F,setAltitudeAt:mt,setCenter:N,setCenterFromValues:B,setExtent:K,setFromCenterAndRadius:V,setFromValues:G,setTransformedCenter:D,tmpSphere:dt,toVec4:H,union:gt},Symbol.toStringTag,{value:"Module"}));export{R as A,lt as B,F as C,E as D,_ as E,k as F,J as G,K as H,Q as I,nt as J,ot as K,at as L,ut as M,S as N,ft as O,mt as P,I as a,w as b,P as c,et as d,V as e,A as f,L as g,X as h,W as i,q as j,T as k,rt as l,O as m,z as n,N as o,st as p,D as q,it as r,jt as s,dt as t,B as u,G as v,tt as w,U as x,H as y,gt as z};
package/chunks/vec42.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{getEpsilon as t,RANDOM as n}from"../core/libs/gl-matrix-2/math/common.js";function a(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}function r(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function s(t,n,a,r,s){return t[0]=n,t[1]=a,t[2]=r,t[3]=s,t}function o(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t}function u(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t}function e(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t[2]=n[2]*a[2],t[3]=n[3]*a[3],t}function c(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t[2]=n[2]/a[2],t[3]=n[3]/a[3],t}function i(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t[3]=Math.ceil(n[3]),t}function h(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t[3]=Math.floor(n[3]),t}function M(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1]=Math.min(n[1],a[1]),t[2]=Math.min(n[2],a[2]),t[3]=Math.min(n[3],a[3]),t}function f(t,n,a){return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t[2]=Math.max(n[2],a[2]),t[3]=Math.max(n[3],a[3]),t}function l(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t[3]=Math.round(n[3]),t}function m(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t}function d(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t}function b(t,n){const a=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2],o=n[3]-t[3];return Math.sqrt(a*a+r*r+s*s+o*o)}function x(t,n){const a=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2],o=n[3]-t[3];return a*a+r*r+s*s+o*o}function q(t){const n=t[0],a=t[1],r=t[2],s=t[3];return Math.sqrt(n*n+a*a+r*r+s*s)}function p(t){const n=t[0],a=t[1],r=t[2],s=t[3];return n*n+a*a+r*r+s*s}function g(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=-n[3],t}function v(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t[3]=1/n[3],t}function y(t,n){const a=n[0],r=n[1],s=n[2],o=n[3];let u=a*a+r*r+s*s+o*o;return u>0&&(u=1/Math.sqrt(u),t[0]=a*u,t[1]=r*u,t[2]=s*u,t[3]=o*u),t}function j(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function _(t,n,a,r){const s=n[0],o=n[1],u=n[2],e=n[3];return t[0]=s+r*(a[0]-s),t[1]=o+r*(a[1]-o),t[2]=u+r*(a[2]-u),t[3]=e+r*(a[3]-e),t}function w(t,a=1){const r=n;let s,o,u,e,c,i;do{s=2*r()-1,o=2*r()-1,c=s*s+o*o}while(c>=1);do{u=2*r()-1,e=2*r()-1,i=u*u+e*e}while(i>=1);const h=Math.sqrt((1-c)/i);return t[0]=a*s,t[1]=a*o,t[2]=a*u*h,t[3]=a*e*h,t}function z(t,n,a){const r=n[0],s=n[1],o=n[2],u=n[3];return t[0]=a[0]*r+a[4]*s+a[8]*o+a[12]*u,t[1]=a[1]*r+a[5]*s+a[9]*o+a[13]*u,t[2]=a[2]*r+a[6]*s+a[10]*o+a[14]*u,t[3]=a[3]*r+a[7]*s+a[11]*o+a[15]*u,t}function A(t,n,a){const r=n[0],s=n[1],o=n[2],u=a[0],e=a[1],c=a[2],i=a[3],h=i*r+e*o-c*s,M=i*s+c*r-u*o,f=i*o+u*s-e*r,l=-u*r-e*s-c*o;return t[0]=h*i+l*-u+M*-c-f*-e,t[1]=M*i+l*-e+f*-u-h*-c,t[2]=f*i+l*-c+h*-e-M*-u,t[3]=n[3],t}function D(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function E(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}function L(n,a){const r=n[0],s=n[1],o=n[2],u=n[3],e=a[0],c=a[1],i=a[2],h=a[3],M=t();return Math.abs(r-e)<=M*Math.max(1,Math.abs(r),Math.abs(e))&&Math.abs(s-c)<=M*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(o-i)<=M*Math.max(1,Math.abs(o),Math.abs(i))&&Math.abs(u-h)<=M*Math.max(1,Math.abs(u),Math.abs(h))}const O=u,S=e,k=c,B=b,C=x,F=q,G=p,H=Object.freeze(Object.defineProperty({__proto__:null,add:o,ceil:i,copy:a,copyVec3:r,dist:B,distance:b,div:k,divide:c,dot:j,equals:L,exactEquals:E,floor:h,inverse:v,len:F,length:q,lerp:_,max:f,min:M,mul:S,multiply:e,negate:g,normalize:y,random:w,round:l,scale:m,scaleAndAdd:d,set:s,sqrDist:C,sqrLen:G,squaredDistance:x,squaredLength:p,str:D,sub:O,subtract:u,transformMat4:z,transformQuat:A},Symbol.toStringTag,{value:"Module"}));export{v as A,w as B,A as C,D,O as E,S as F,k as G,B as H,C as I,F as J,G as K,E as a,p as b,m as c,a as d,L as e,x as f,o as g,j as h,q as i,r as j,u as k,_ as l,e as m,y as n,c as o,i as p,h as q,M as r,s,z as t,f as u,H as v,l as w,d as x,b as y,g as z};
5
+ import{getEpsilon as t,RANDOM as n}from"../core/libs/gl-matrix-2/math/common.js";function a(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}function r(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function s(t,n,a,r,s){return t[0]=n,t[1]=a,t[2]=r,t[3]=s,t}function o(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t}function u(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t}function e(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t[2]=n[2]*a[2],t[3]=n[3]*a[3],t}function c(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t[2]=n[2]/a[2],t[3]=n[3]/a[3],t}function i(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t[3]=Math.ceil(n[3]),t}function h(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t[3]=Math.floor(n[3]),t}function M(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1]=Math.min(n[1],a[1]),t[2]=Math.min(n[2],a[2]),t[3]=Math.min(n[3],a[3]),t}function f(t,n,a){return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t[2]=Math.max(n[2],a[2]),t[3]=Math.max(n[3],a[3]),t}function l(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t[3]=Math.round(n[3]),t}function m(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t}function d(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t}function b(t,n){const a=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2],o=n[3]-t[3];return Math.sqrt(a*a+r*r+s*s+o*o)}function x(t,n){const a=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2],o=n[3]-t[3];return a*a+r*r+s*s+o*o}function q(t){const n=t[0],a=t[1],r=t[2],s=t[3];return Math.sqrt(n*n+a*a+r*r+s*s)}function p(t){const n=t[0],a=t[1],r=t[2],s=t[3];return n*n+a*a+r*r+s*s}function g(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=-n[3],t}function v(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t[3]=1/n[3],t}function y(t,n){const a=n[0],r=n[1],s=n[2],o=n[3];let u=a*a+r*r+s*s+o*o;return u>0&&(u=1/Math.sqrt(u),t[0]=a*u,t[1]=r*u,t[2]=s*u,t[3]=o*u),t}function j(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function _(t,n,a,r){const s=n[0],o=n[1],u=n[2],e=n[3];return t[0]=s+r*(a[0]-s),t[1]=o+r*(a[1]-o),t[2]=u+r*(a[2]-u),t[3]=e+r*(a[3]-e),t}function w(t,a=1){const r=n;let s,o,u,e,c,i;do{s=2*r()-1,o=2*r()-1,c=s*s+o*o}while(c>=1);do{u=2*r()-1,e=2*r()-1,i=u*u+e*e}while(i>=1);const h=Math.sqrt((1-c)/i);return t[0]=a*s,t[1]=a*o,t[2]=a*u*h,t[3]=a*e*h,t}function z(t,n,a){const r=n[0],s=n[1],o=n[2],u=n[3];return t[0]=a[0]*r+a[4]*s+a[8]*o+a[12]*u,t[1]=a[1]*r+a[5]*s+a[9]*o+a[13]*u,t[2]=a[2]*r+a[6]*s+a[10]*o+a[14]*u,t[3]=a[3]*r+a[7]*s+a[11]*o+a[15]*u,t}function A(t,n,a){const r=n[0],s=n[1],o=n[2],u=a[0],e=a[1],c=a[2],i=a[3],h=i*r+e*o-c*s,M=i*s+c*r-u*o,f=i*o+u*s-e*r,l=-u*r-e*s-c*o;return t[0]=h*i+l*-u+M*-c-f*-e,t[1]=M*i+l*-e+f*-u-h*-c,t[2]=f*i+l*-c+h*-e-M*-u,t[3]=n[3],t}function D(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function E(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}function L(n,a){const r=n[0],s=n[1],o=n[2],u=n[3],e=a[0],c=a[1],i=a[2],h=a[3],M=t();return Math.abs(r-e)<=M*Math.max(1,Math.abs(r),Math.abs(e))&&Math.abs(s-c)<=M*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(o-i)<=M*Math.max(1,Math.abs(o),Math.abs(i))&&Math.abs(u-h)<=M*Math.max(1,Math.abs(u),Math.abs(h))}const O=u,S=e,k=c,B=b,C=x,F=q,G=p,H=Object.freeze(Object.defineProperty({__proto__:null,add:o,ceil:i,copy:a,copyVec3:r,dist:B,distance:b,div:k,divide:c,dot:j,equals:L,exactEquals:E,floor:h,inverse:v,len:F,length:q,lerp:_,max:f,min:M,mul:S,multiply:e,negate:g,normalize:y,random:w,round:l,scale:m,scaleAndAdd:d,set:s,sqrDist:C,sqrLen:G,squaredDistance:x,squaredLength:p,str:D,sub:O,subtract:u,transformMat4:z,transformQuat:A},Symbol.toStringTag,{value:"Module"}));export{v as A,w as B,A as C,D,O as E,S as F,k as G,B as H,C as I,F as J,G as K,E as a,p as b,m as c,a as d,L as e,x as f,j as g,o as h,q as i,r as j,u as k,_ as l,e as m,y as n,c as o,i as p,h as q,M as r,s,z as t,f as u,H as v,l as w,d as x,b as y,g as z};
package/config.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.34.0-next.58";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.34.0-next.59";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
package/copyright.txt CHANGED
@@ -1,24 +1,6 @@
1
- COPYRIGHT © 2025 Esri
1
+ COPYRIGHT © Esri
2
2
 
3
- All rights reserved under the copyright laws of the United States
4
- and applicable international laws, treaties, and conventions.
5
-
6
- This material is licensed for use under the Esri Master License
7
- Agreement (MLA), and is bound by the terms of that agreement.
8
- You may redistribute and use this code without modification,
9
- provided you adhere to the terms of the MLA and include this
10
- copyright notice.
11
-
12
- See use restrictions at https://www.esri.com/legal/pdfs/mla_e204_e300/english
13
-
14
- For additional information, contact:
15
- Environmental Systems Research Institute, Inc.
16
- Attn: Contracts and Legal Services Department
17
- 380 New York Street
18
- Redlands, California, USA 92373
19
- USA
20
-
21
- email: contracts@esri.com
3
+ This material is licensed under the terms described in the LICENSE.txt file: https://js.arcgis.com/4.34/esri/LICENSE.txt
22
4
 
23
5
  -----------------------------------------------------------------
24
6
 
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- const a=(a=>a)(["operational-layers","basemap","ground"]);export{a as excludeTables};
5
+ const a=(a=>a)(["operational-layers","basemap-base-layers","basemap-ground-layers","ground"]);export{a as excludeTables};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{create as t}from"../factories/mat3f64.js";import{create as n}from"../factories/quatf64.js";import{fromValues as s,create as o}from"../factories/vec3f64.js";import{getEpsilon as a,RANDOM as r}from"./common.js";import{e,h as c,H as i,n as u}from"../../../../chunks/vec32.js";import{s as h,a as M,n as f,d as l,g as m,c as p,h as q,l as d,i as g,b as j,e as P}from"../../../../chunks/vec42.js";function I(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function b(t,n,s){s*=.5;const o=Math.sin(s);return t[0]=o*n[0],t[1]=o*n[1],t[2]=o*n[2],t[3]=Math.cos(s),t}function v(t,n){const s=2*Math.acos(n[3]),o=Math.sin(s/2);return o>a()?(t[0]=n[0]/o,t[1]=n[1]/o,t[2]=n[2]/o):(t[0]=1,t[1]=0,t[2]=0),s}function x(t,n,s){const o=n[0],a=n[1],r=n[2],e=n[3],c=s[0],i=s[1],u=s[2],h=s[3];return t[0]=o*h+e*c+a*u-r*i,t[1]=a*h+e*i+r*c-o*u,t[2]=r*h+e*u+o*i-a*c,t[3]=e*h-o*c-a*i-r*u,t}function y(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i+e*c,t[1]=a*i+r*c,t[2]=r*i-a*c,t[3]=e*i-o*c,t}function A(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i-r*c,t[1]=a*i+e*c,t[2]=r*i+o*c,t[3]=e*i-a*c,t}function _(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i+a*c,t[1]=a*i-o*c,t[2]=r*i+e*c,t[3]=e*i-r*c,t}function k(t,n){const s=n[0],o=n[1],a=n[2];return t[0]=s,t[1]=o,t[2]=a,t[3]=Math.sqrt(Math.abs(1-s*s-o*o-a*a)),t}function z(t,n,s,o){const r=n[0],e=n[1],c=n[2],i=n[3];let u,h,M,f,l,m=s[0],p=s[1],q=s[2],d=s[3];return h=r*m+e*p+c*q+i*d,h<0&&(h=-h,m=-m,p=-p,q=-q,d=-d),1-h>a()?(u=Math.acos(h),M=Math.sin(u),f=Math.sin((1-o)*u)/M,l=Math.sin(o*u)/M):(f=1-o,l=o),t[0]=f*r+l*m,t[1]=f*e+l*p,t[2]=f*c+l*q,t[3]=f*i+l*d,t}function E(t){const n=r,s=n(),o=n(),a=n(),e=Math.sqrt(1-s),c=Math.sqrt(s);return t[0]=e*Math.sin(2*Math.PI*o),t[1]=e*Math.cos(2*Math.PI*o),t[2]=c*Math.sin(2*Math.PI*a),t[3]=c*Math.cos(2*Math.PI*a),t}function L(t,n){const s=n[0],o=n[1],a=n[2],r=n[3],e=s*s+o*o+a*a+r*r,c=e?1/e:0;return t[0]=-s*c,t[1]=-o*c,t[2]=-a*c,t[3]=r*c,t}function O(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function S(t,n){const s=n[0]+n[4]+n[8];let o;if(s>0)o=Math.sqrt(s+1),t[3]=.5*o,o=.5/o,t[0]=(n[5]-n[7])*o,t[1]=(n[6]-n[2])*o,t[2]=(n[1]-n[3])*o;else{let s=0;n[4]>n[0]&&(s=1),n[8]>n[3*s+s]&&(s=2);const a=(s+1)%3,r=(s+2)%3;o=Math.sqrt(n[3*s+s]-n[3*a+a]-n[3*r+r]+1),t[s]=.5*o,o=.5/o,t[3]=(n[3*a+r]-n[3*r+a])*o,t[a]=(n[3*a+s]+n[3*s+a])*o,t[r]=(n[3*r+s]+n[3*s+r])*o}return t}function T(t,n,s,o){const a=.5*Math.PI/180;n*=a,s*=a,o*=a;const r=Math.sin(n),e=Math.cos(n),c=Math.sin(s),i=Math.cos(s),u=Math.sin(o),h=Math.cos(o);return t[0]=r*i*h-e*c*u,t[1]=e*c*h+r*i*u,t[2]=e*i*u-r*c*h,t[3]=e*i*h+r*c*u,t}function H(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}const W=l,X=h,Y=m,Z=x,w=p,B=q,C=d,D=g,F=D,G=j,J=G,K=f,N=M,Q=P;function R(t,n,s){const o=e(n,s);return o<-.999999?(c(U,V,n),i(U)<1e-6&&c(U,$,n),u(U,U),b(t,U,Math.PI),t):o>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(c(U,n,s),t[0]=U[0],t[1]=U[1],t[2]=U[2],t[3]=1+o,K(t,t))}const U=o(),V=s(1,0,0),$=s(0,1,0);function tt(t,n,s,o,a,r){return z(nt,n,a,r),z(st,s,o,r),z(t,nt,st,2*r*(1-r)),t}const nt=n(),st=n();function ot(t,n,s,o){const a=at;return a[0]=s[0],a[3]=s[1],a[6]=s[2],a[1]=o[0],a[4]=o[1],a[7]=o[2],a[2]=-n[0],a[5]=-n[1],a[8]=-n[2],K(t,S(t,a))}const at=t(),rt=Object.freeze(Object.defineProperty({__proto__:null,add:Y,calculateW:k,conjugate:O,copy:W,dot:B,equals:Q,exactEquals:N,fromEuler:T,fromMat3:S,getAxisAngle:v,identity:I,invert:L,len:F,length:D,lerp:C,mul:Z,multiply:x,normalize:K,random:E,rotateX:y,rotateY:A,rotateZ:_,rotationTo:R,scale:w,set:X,setAxes:ot,setAxisAngle:b,slerp:z,sqlerp:tt,sqrLen:J,squaredLength:G,str:H},Symbol.toStringTag,{value:"Module"}));export{Y as add,k as calculateW,O as conjugate,W as copy,B as dot,Q as equals,N as exactEquals,T as fromEuler,S as fromMat3,v as getAxisAngle,I as identity,L as invert,F as len,D as length,C as lerp,Z as mul,x as multiply,K as normalize,rt as q,E as random,y as rotateX,A as rotateY,_ as rotateZ,R as rotationTo,w as scale,X as set,ot as setAxes,b as setAxisAngle,z as slerp,tt as sqlerp,J as sqrLen,G as squaredLength,H as str};
5
+ import{create as t}from"../factories/mat3f64.js";import{create as n}from"../factories/quatf64.js";import{fromValues as s,create as o}from"../factories/vec3f64.js";import{getEpsilon as a,RANDOM as r}from"./common.js";import{e,h as c,H as i,n as u}from"../../../../chunks/vec32.js";import{s as h,a as M,n as f,d as l,h as m,c as p,g as q,l as d,i as g,b as j,e as P}from"../../../../chunks/vec42.js";function I(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function b(t,n,s){s*=.5;const o=Math.sin(s);return t[0]=o*n[0],t[1]=o*n[1],t[2]=o*n[2],t[3]=Math.cos(s),t}function v(t,n){const s=2*Math.acos(n[3]),o=Math.sin(s/2);return o>a()?(t[0]=n[0]/o,t[1]=n[1]/o,t[2]=n[2]/o):(t[0]=1,t[1]=0,t[2]=0),s}function x(t,n,s){const o=n[0],a=n[1],r=n[2],e=n[3],c=s[0],i=s[1],u=s[2],h=s[3];return t[0]=o*h+e*c+a*u-r*i,t[1]=a*h+e*i+r*c-o*u,t[2]=r*h+e*u+o*i-a*c,t[3]=e*h-o*c-a*i-r*u,t}function y(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i+e*c,t[1]=a*i+r*c,t[2]=r*i-a*c,t[3]=e*i-o*c,t}function A(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i-r*c,t[1]=a*i+e*c,t[2]=r*i+o*c,t[3]=e*i-a*c,t}function _(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i+a*c,t[1]=a*i-o*c,t[2]=r*i+e*c,t[3]=e*i-r*c,t}function k(t,n){const s=n[0],o=n[1],a=n[2];return t[0]=s,t[1]=o,t[2]=a,t[3]=Math.sqrt(Math.abs(1-s*s-o*o-a*a)),t}function z(t,n,s,o){const r=n[0],e=n[1],c=n[2],i=n[3];let u,h,M,f,l,m=s[0],p=s[1],q=s[2],d=s[3];return h=r*m+e*p+c*q+i*d,h<0&&(h=-h,m=-m,p=-p,q=-q,d=-d),1-h>a()?(u=Math.acos(h),M=Math.sin(u),f=Math.sin((1-o)*u)/M,l=Math.sin(o*u)/M):(f=1-o,l=o),t[0]=f*r+l*m,t[1]=f*e+l*p,t[2]=f*c+l*q,t[3]=f*i+l*d,t}function E(t){const n=r,s=n(),o=n(),a=n(),e=Math.sqrt(1-s),c=Math.sqrt(s);return t[0]=e*Math.sin(2*Math.PI*o),t[1]=e*Math.cos(2*Math.PI*o),t[2]=c*Math.sin(2*Math.PI*a),t[3]=c*Math.cos(2*Math.PI*a),t}function L(t,n){const s=n[0],o=n[1],a=n[2],r=n[3],e=s*s+o*o+a*a+r*r,c=e?1/e:0;return t[0]=-s*c,t[1]=-o*c,t[2]=-a*c,t[3]=r*c,t}function O(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function S(t,n){const s=n[0]+n[4]+n[8];let o;if(s>0)o=Math.sqrt(s+1),t[3]=.5*o,o=.5/o,t[0]=(n[5]-n[7])*o,t[1]=(n[6]-n[2])*o,t[2]=(n[1]-n[3])*o;else{let s=0;n[4]>n[0]&&(s=1),n[8]>n[3*s+s]&&(s=2);const a=(s+1)%3,r=(s+2)%3;o=Math.sqrt(n[3*s+s]-n[3*a+a]-n[3*r+r]+1),t[s]=.5*o,o=.5/o,t[3]=(n[3*a+r]-n[3*r+a])*o,t[a]=(n[3*a+s]+n[3*s+a])*o,t[r]=(n[3*r+s]+n[3*s+r])*o}return t}function T(t,n,s,o){const a=.5*Math.PI/180;n*=a,s*=a,o*=a;const r=Math.sin(n),e=Math.cos(n),c=Math.sin(s),i=Math.cos(s),u=Math.sin(o),h=Math.cos(o);return t[0]=r*i*h-e*c*u,t[1]=e*c*h+r*i*u,t[2]=e*i*u-r*c*h,t[3]=e*i*h+r*c*u,t}function H(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}const W=l,X=h,Y=m,Z=x,w=p,B=q,C=d,D=g,F=D,G=j,J=G,K=f,N=M,Q=P;function R(t,n,s){const o=e(n,s);return o<-.999999?(c(U,V,n),i(U)<1e-6&&c(U,$,n),u(U,U),b(t,U,Math.PI),t):o>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(c(U,n,s),t[0]=U[0],t[1]=U[1],t[2]=U[2],t[3]=1+o,K(t,t))}const U=o(),V=s(1,0,0),$=s(0,1,0);function tt(t,n,s,o,a,r){return z(nt,n,a,r),z(st,s,o,r),z(t,nt,st,2*r*(1-r)),t}const nt=n(),st=n();function ot(t,n,s,o){const a=at;return a[0]=s[0],a[3]=s[1],a[6]=s[2],a[1]=o[0],a[4]=o[1],a[7]=o[2],a[2]=-n[0],a[5]=-n[1],a[8]=-n[2],K(t,S(t,a))}const at=t(),rt=Object.freeze(Object.defineProperty({__proto__:null,add:Y,calculateW:k,conjugate:O,copy:W,dot:B,equals:Q,exactEquals:N,fromEuler:T,fromMat3:S,getAxisAngle:v,identity:I,invert:L,len:F,length:D,lerp:C,mul:Z,multiply:x,normalize:K,random:E,rotateX:y,rotateY:A,rotateZ:_,rotationTo:R,scale:w,set:X,setAxes:ot,setAxisAngle:b,slerp:z,sqlerp:tt,sqrLen:J,squaredLength:G,str:H},Symbol.toStringTag,{value:"Module"}));export{Y as add,k as calculateW,O as conjugate,W as copy,B as dot,Q as equals,N as exactEquals,T as fromEuler,S as fromMat3,v as getAxisAngle,I as identity,L as invert,F as len,D as length,C as lerp,Z as mul,x as multiply,K as normalize,rt as q,E as random,y as rotateX,A as rotateY,_ as rotateZ,R as rotationTo,w as scale,X as set,ot as setAxes,b as setAxisAngle,z as slerp,tt as sqlerp,J as sqrLen,G as squaredLength,H as str};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"./common.js";export{g as add,p as ceil,d as copy,j as copyVec3,H as dist,y as distance,G as div,o as divide,h as dot,e as equals,a as exactEquals,q as floor,A as inverse,J as len,i as length,l as lerp,u as max,r as min,F as mul,m as multiply,z as negate,n as normalize,B as random,w as round,c as scale,x as scaleAndAdd,s as set,I as sqrDist,K as sqrLen,f as squaredDistance,b as squaredLength,D as str,E as sub,k as subtract,t as transformMat4,C as transformQuat}from"../../../../chunks/vec42.js";
5
+ import"./common.js";export{h as add,p as ceil,d as copy,j as copyVec3,H as dist,y as distance,G as div,o as divide,g as dot,e as equals,a as exactEquals,q as floor,A as inverse,J as len,i as length,l as lerp,u as max,r as min,F as mul,m as multiply,z as negate,n as normalize,B as random,w as round,c as scale,x as scaleAndAdd,s as set,I as sqrDist,K as sqrLen,f as squaredDistance,b as squaredLength,D as str,E as sub,k as subtract,t as transformMat4,C as transformQuat}from"../../../../chunks/vec42.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{cyclicalDegrees as t}from"./Cyclical.js";import{toUnit as r}from"./quantityUtils.js";import{formatDecimal as e,formatMetricLength as a,formatImperialLength as n,formatAngleDegrees as i,formatRelativeDecimal as u,formatMetricRelativeVerticalLength as c,formatImperialRelativeVerticalLength as o,formatMetricVerticalLength as l,formatImperialVerticalLength as f,formatMetricRelativeLength as m,formatImperialRelativeLength as b,formatMetricArea as s,formatImperialArea as v,formatDMS as p,formatRelativeAngleDegrees as h}from"./unitFormatUtils.js";function g(t,a,n,i=2,u="abbr"){return e(t,r(a,n).value,n,i,u)}function L(t,e,a,n=2,i="abbr"){return u(t,r(e,a).value,a,n,i)}function d(t,r,e=2,n="abbr"){return a(t,r.value,r.unit,e,n)}function M(t,r,e=2,a="abbr"){return m(t,r.value,r.unit,e,a)}function w(t,r,e=2,a="abbr"){return l(t,r.value,r.unit,e,a)}function I(t,r,e=2,a="abbr"){return c(t,r.value,r.unit,e,a)}function R(t,r,e=2,a="abbr"){return s(t,r.value,r.unit,e,a)}function y(t,r,e=2,a="abbr"){return n(t,r.value,r.unit,e,a)}function V(t,r,e=2,a="abbr"){return b(t,r.value,r.unit,e,a)}function j(t,r,e=2,a="abbr"){return f(t,r.value,r.unit,e,a)}function D(t,r,e=2,a="abbr"){return o(t,r.value,r.unit,e,a)}function A(t,r,e=2,a="abbr"){return v(t,r.value,r.unit,e,a)}function T(t){return p(t.value,t.unit)}function U(r,e,a,n=t,u=!0){return i(r.value,r.unit,r.rotationType,e,a,n,u)}function q(t,r,e){return h(t.value,t.unit,t.rotationType,r,e??void 0)}function x(t,r,e,a,n="abbr"){switch(a=a??2,e){case"imperial":return y(t,r,a,n);case"metric":return d(t,r,a,n);default:return g(t,r,e,a,n)}}function C(t,r,e,a=2,n="abbr"){switch(e){case"imperial":return V(t,r,a,n);case"metric":return M(t,r,a,n);default:return L(t,r,e,a,n)}}function F(t,r,e,a=2,n="abbr"){switch(e){case"imperial":return j(t,r,a,n);case"metric":return w(t,r,a,n);default:return g(t,r,e,a,n)}}function S(t,r,e,a=2,n="abbr"){switch(e){case"imperial":return D(t,r,a,n);case"metric":return I(t,r,a,n);default:return L(t,r,e,a,n)}}function k(t,r,e,a=2,n="abbr"){switch(e){case"imperial":return A(t,r,a,n);case"metric":return R(t,r,a,n);default:return g(t,r,e,a,n)}}export{U as formatAngle,k as formatArea,T as formatDMS,g as formatDecimal,A as formatImperialArea,y as formatImperialLength,V as formatImperialRelativeLength,D as formatImperialRelativeVerticalLength,j as formatImperialVerticalLength,x as formatLength,R as formatMetricArea,d as formatMetricLength,M as formatMetricRelativeLength,I as formatMetricRelativeVerticalLength,w as formatMetricVerticalLength,q as formatRelativeAngle,L as formatRelativeDecimal,C as formatRelativeLength,S as formatRelativeVerticalLength,F as formatVerticalLength};
5
+ import{cyclicalDegrees as t}from"./Cyclical.js";import{toUnit as r}from"./quantityUtils.js";import{formatAngleDegrees as e,formatDecimal as a,formatMetricLength as n,formatImperialLength as i,formatImperialVerticalLength as u,formatMetricVerticalLength as c,formatMetricArea as o,formatImperialArea as l,formatRelativeDecimal as f,formatMetricRelativeLength as m,formatMetricRelativeVerticalLength as b,formatImperialRelativeLength as s,formatImperialRelativeVerticalLength as v,formatDMS as p,formatRelativeAngleDegrees as h}from"./unitFormatUtils.js";function g(t,e,n,i=2,u="abbr"){return a(t,r(e,n).value,n,i,u)}function L(t,e,a,n=2,i="abbr"){return f(t,r(e,a).value,a,n,i)}function d(t,r,e=2,a="abbr"){return n(t,r.value,r.unit,e,a)}function M(t,r,e=2,a="abbr"){return m(t,r.value,r.unit,e,a)}function w(t,r,e=2,a="abbr"){return c(t,r.value,r.unit,e,a)}function I(t,r,e=2,a="abbr"){return b(t,r.value,r.unit,e,a)}function R(t,r,e=2,a="abbr"){return o(t,r.value,r.unit,e,a)}function y(t,r,e=2,a="abbr"){return i(t,r.value,r.unit,e,a)}function V(t,r,e=2,a="abbr"){return s(t,r.value,r.unit,e,a)}function j(t,r,e=2,a="abbr"){return u(t,r.value,r.unit,e,a)}function D(t,r,e=2,a="abbr"){return v(t,r.value,r.unit,e,a)}function A(t,r,e=2,a="abbr"){return l(t,r.value,r.unit,e,a)}function T(t){return p(t.value,t.unit)}function U(r,a,n,i=t,u=!0){return e(r.value,r.unit,r.rotationType,a,n,i,u)}function q(t,r,e){return h(t.value,t.unit,t.rotationType,r,e??void 0)}function x(t,r,e,a,n="abbr"){switch(a=a??2,e){case"imperial":return y(t,r,a,n);case"metric":return d(t,r,a,n);default:return g(t,r,e,a,n)}}function C(t,r,e,a=2,n="abbr"){switch(e){case"imperial":return V(t,r,a,n);case"metric":return M(t,r,a,n);default:return L(t,r,e,a,n)}}function F(t,r,e,a=2,n="abbr"){switch(e){case"imperial":return j(t,r,a,n);case"metric":return w(t,r,a,n);default:return g(t,r,e,a,n)}}function S(t,r,e,a=2,n="abbr"){switch(e){case"imperial":return D(t,r,a,n);case"metric":return I(t,r,a,n);default:return L(t,r,e,a,n)}}function k(t,r,e,a=2,n="abbr"){switch(e){case"imperial":return A(t,r,a,n);case"metric":return R(t,r,a,n);default:return g(t,r,e,a,n)}}export{U as formatAngle,k as formatArea,T as formatDMS,g as formatDecimal,A as formatImperialArea,y as formatImperialLength,V as formatImperialRelativeLength,D as formatImperialRelativeVerticalLength,j as formatImperialVerticalLength,x as formatLength,R as formatMetricArea,d as formatMetricLength,M as formatMetricRelativeLength,I as formatMetricRelativeVerticalLength,w as formatMetricVerticalLength,q as formatRelativeAngle,L as formatRelativeDecimal,C as formatRelativeLength,S as formatRelativeVerticalLength,F as formatVerticalLength};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{cyclicalDegrees as t}from"./Cyclical.js";import{clamp as n}from"./mathUtils.js";import{convertRotationType as i}from"./quantityUtils.js";import{replace as r}from"./string.js";import{adaptiveMetricLengthUnit as o,convertUnit as e,adaptiveImperialLengthUnit as u,adaptiveMetricVerticalLengthUnit as s,adaptiveImperialVerticalLengthUnit as c,adaptiveMetricAreaUnit as a,adaptiveImperialAreaUnit as m}from"./unitUtils.js";import{formatNumber as f}from"../intl/number.js";function l(t,n,i){return t.units[n][i]}function b(t,n,i,r=2,o="abbr"){return`${f(n,{minimumFractionDigits:r,maximumFractionDigits:r,signDisplay:n>0?"never":"exceptZero"})} ${l(t,i,o)}`}function g(t,n,i,r=2,o="abbr"){return`${f(n,{minimumFractionDigits:r,maximumFractionDigits:r,signDisplay:"exceptZero"})} ${l(t,i,o)}`}function p(t,n,i,r=2,u="abbr"){const s=o(n,i);return b(t,e(n,i,s),s,r,u)}function D(t,n,i,r=2,u="abbr"){const s=o(n,i);return g(t,e(n,i,s),s,r,u)}function x(t,n,i,r=2,o="abbr"){const u=s(n,i);return b(t,e(n,i,u),u,r,o)}function F(t,n,i,r=2,o="abbr"){const u=s(n,i);return g(t,e(n,i,u),u,r,o)}function y(t,n,i,r=2,o="abbr"){const s=u(n,i);return b(t,e(n,i,s),s,r,o)}function d(t,n,i,r=2,o="abbr"){const s=u(n,i);return g(t,e(n,i,s),s,r,o)}function h(t,n,i,r=2,o="abbr"){const u=c(n,i);return b(t,e(n,i,u),u,r,o)}function M(t,n,i,r=2,o="abbr"){const u=c(n,i);return g(t,e(n,i,u),u,r,o)}function $(t,n,i,r=2,o="abbr"){const u=a(n,i);return b(t,e(n,i,u),u,r,o)}function j(t,n,i,r=2,o="abbr"){const u=m(n,i);return b(t,e(n,i,u),u,r,o)}function B(t,n,i=2){let r=e(t,n,"degrees"),o=r-Math.floor(r);r-=o,o*=60;let u=o-Math.floor(o);return o-=u,u*=60,`${r.toFixed()}° ${o.toFixed()}' ${u.toFixed(i)}"`}const w=(t,n)=>({style:"unit",unitDisplay:"narrow",unit:"degree",maximumFractionDigits:n,minimumFractionDigits:n,signDisplay:t>0?"never":"exceptZero"});function U(n,r,o,u,s,c=t,a=!0){let m=c.normalize(i(e(n,r,"degrees"),o,u),0,a);const l=w(m,s??2);return m=v(m,l),f(m,l)}function Z(t,n,i,r,o=2){i!==r&&(t=-t);const u={style:"unit",unitDisplay:"narrow",unit:"degree",maximumFractionDigits:o,minimumFractionDigits:o,signDisplay:"exceptZero"};let s=e(t,n,"degrees")%360;return s=v(s,u),f(s,u)}const S=new Map;function v(t,n){const i=JSON.stringify(n);let r=S.get(i);return r||(r=new Intl.NumberFormat("en-US",n),S.set(i,r)),/^[-+]?360\.?0*°?$/.test(r.format(t))?0:t}const z=["B","kB","MB","GB","TB"];function N(t,i){let o=0===(i=Math.round(i))?0:Math.floor(Math.log(i)/Math.log(1024));o=n(o,0,z.length-1);const e=f(i/1024**o,{maximumFractionDigits:2});return r(t.units.bytes[z[o]],{fileSize:e})}export{U as formatAngleDegrees,B as formatDMS,b as formatDecimal,N as formatFileSize,j as formatImperialArea,y as formatImperialLength,d as formatImperialRelativeLength,M as formatImperialRelativeVerticalLength,h as formatImperialVerticalLength,$ as formatMetricArea,p as formatMetricLength,D as formatMetricRelativeLength,F as formatMetricRelativeVerticalLength,x as formatMetricVerticalLength,Z as formatRelativeAngleDegrees,g as formatRelativeDecimal,l as unitName};
5
+ import{cyclicalDegrees as t}from"./Cyclical.js";import{clamp as n}from"./mathUtils.js";import{convertRotationType as i}from"./quantityUtils.js";import{replace as r}from"./string.js";import{convertUnit as o,adaptiveMetricLengthUnit as e,adaptiveImperialLengthUnit as u,adaptiveImperialVerticalLengthUnit as s,adaptiveMetricVerticalLengthUnit as c,adaptiveImperialAreaUnit as a,adaptiveMetricAreaUnit as m}from"./unitUtils.js";import{formatNumber as f}from"../intl/number.js";function l(t,n,i){return t.units[n][i]}function b(t,n,i,r=2,o="abbr"){return`${f(n,{minimumFractionDigits:r,maximumFractionDigits:r,signDisplay:n>0?"never":"exceptZero"})} ${l(t,i,o)}`}function g(t,n,i,r=2,o="abbr"){return`${f(n,{minimumFractionDigits:r,maximumFractionDigits:r,signDisplay:"exceptZero"})} ${l(t,i,o)}`}function p(t,n,i,r=2,u="abbr"){const s=e(n,i);return b(t,o(n,i,s),s,r,u)}function D(t,n,i,r=2,u="abbr"){const s=e(n,i);return g(t,o(n,i,s),s,r,u)}function x(t,n,i,r=2,e="abbr"){const u=c(n,i);return b(t,o(n,i,u),u,r,e)}function F(t,n,i,r=2,e="abbr"){const u=c(n,i);return g(t,o(n,i,u),u,r,e)}function y(t,n,i,r=2,e="abbr"){const s=u(n,i);return b(t,o(n,i,s),s,r,e)}function d(t,n,i,r=2,e="abbr"){const s=u(n,i);return g(t,o(n,i,s),s,r,e)}function h(t,n,i,r=2,e="abbr"){const u=s(n,i);return b(t,o(n,i,u),u,r,e)}function M(t,n,i,r=2,e="abbr"){const u=s(n,i);return g(t,o(n,i,u),u,r,e)}function $(t,n,i,r=2,e="abbr"){const u=m(n,i);return b(t,o(n,i,u),u,r,e)}function j(t,n,i,r=2,e="abbr"){const u=a(n,i);return b(t,o(n,i,u),u,r,e)}function B(t,n,i=2){let r=o(t,n,"degrees"),e=r-Math.floor(r);r-=e,e*=60;let u=e-Math.floor(e);return e-=u,u*=60,`${r.toFixed()}° ${e.toFixed()}' ${u.toFixed(i)}"`}const w=(t,n)=>({style:"unit",unitDisplay:"narrow",unit:"degree",maximumFractionDigits:n,minimumFractionDigits:n,signDisplay:t>0?"never":"exceptZero"});function U(n,r,e,u,s,c=t,a=!0){let m=c.normalize(i(o(n,r,"degrees"),e,u),0,a);const l=w(m,s??2);return m=v(m,l),f(m,l)}function Z(t,n,i,r,e=2){i!==r&&(t=-t);const u={style:"unit",unitDisplay:"narrow",unit:"degree",maximumFractionDigits:e,minimumFractionDigits:e,signDisplay:"exceptZero"};let s=o(t,n,"degrees")%360;return s=v(s,u),f(s,u)}const S=new Map;function v(t,n){const i=JSON.stringify(n);let r=S.get(i);return r||(r=new Intl.NumberFormat("en-US",n),S.set(i,r)),/^[-+]?360\.?0*°?$/.test(r.format(t))?0:t}const z=["B","kB","MB","GB","TB"];function N(t,i){let o=0===(i=Math.round(i))?0:Math.floor(Math.log(i)/Math.log(1024));o=n(o,0,z.length-1);const e=f(i/1024**o,{maximumFractionDigits:2});return r(t.units.bytes[z[o]],{fileSize:e})}export{U as formatAngleDegrees,B as formatDMS,b as formatDecimal,N as formatFileSize,j as formatImperialArea,y as formatImperialLength,d as formatImperialRelativeLength,M as formatImperialRelativeVerticalLength,h as formatImperialVerticalLength,$ as formatMetricArea,p as formatMetricLength,D as formatMetricRelativeLength,F as formatMetricRelativeVerticalLength,x as formatMetricVerticalLength,Z as formatRelativeAngleDegrees,g as formatRelativeDecimal,l as unitName};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{getMetersPerVerticalUnitForSR as t,getMetersPerUnitForSR as n}from"../../core/unitUtils.js";function r(t,n){if(t[0]!==n[0]||t[1]!==n[1])return!1;const r=Math.max(t.length,n.length);if(r<3)return!0;for(let u=2;u<r;u++)if((t.at(u)??0)!==(n.at(u)??0))return!1;return!0}function u(r){if(r.vcsWkid||r.latestVcsWkid){return t(r)/n(r)}return 1}function e(t,n,r,u){if(null==t||null==n)return null;return t+(n-t)/r*u}export{r as equivalent,u as getHeightUnitCorrectionFactor,e as interpolateM};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import e from"../../core/Logger.js";import{fromArray as t,fromValues as n,create as r}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{n as a,b as s}from"../../chunks/vec32.js";import{interpolateM as o,getHeightUnitCorrectionFactor as i,equivalent as l}from"./coordUtils.js";import c from"../../geometry/Point.js";import f from"../../geometry/Polyline.js";import{getLength as h}from"../../geometry/support/coordsUtils.js";const p=()=>e.getLogger("esri.editing.geometry.lineUtils");function u(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],a=t.at(-1);null!=a&&l(r,a)||t.push(r)}return t.length===e.length?e:u(t)}function m(e,t,n){let r=t[0]-e[0],a=t[1]-e[1];const s=Math.hypot(r,a);return r/=s,a/=s,r*=n,a*=n,[e[0]+r,e[1]+a]}function g(e,t,o,i){const l=n(t[0]-e[0],t[1]-e[1],t[2]*i-e[2]*i);return a(l,l),s(r(),e,l,o)}function y(e,t,n,r){const a=t>n,s=a?n:t,o=a?t:n,l=new f({spatialReference:e.spatialReference,hasZ:r.hasZ(),hasM:r.hasM()});if(s===o){const t=R(e,s);return t?(l.addPath([r.pointToArray(t),r.pointToArray(t)]),l):(p().warn("editing:empty-line-section","Returning an empty line section."),l)}const c=r.hasZ()?i(e.spatialReference):1;let h=null,m=null,y=0;for(let i=0;i<e.paths.length;i++){const t=e.paths[i];null!==h&&h.push([r.arrayToVector(t[0])]);for(let e=0;e<t.length-1;e++){let n=!1;const a=r.arrayToVector(t[e]),i=r.arrayToVector(t[e+1]),l=r.hasZ()?M(a,i,c):r.distance(a,i),f=y+l;if(null===h)if(f>s){h=[[r.hasZ()?g(a,i,s-y,c):r.lerp(a,i,(s-y)/l,r.createVector())]]}else f===s&&(h=[[i]],n=!0);if(f>o?m=r.hasZ()?g(a,i,o-y,c):r.lerp(a,i,(o-y)/l,r.createVector()):f===o?m=i:null===h||n||h.at(-1)?.push(i),m)break;y+=l}if(m)break}if(!h||0===h.length)return p().warn("editing:empty-line-section","Returning an empty line section."),l;m?h.at(-1)?.push(m):p().warn("editing:line-section-end-measure-not-reached","The end measure was greater than the line's total length. Returning the section up to the end of the line.");for(const i of h)l.addPath(u(i));return a?w(l):l}function R(e,t){let n=0,r=null;const a=e.hasM,s=e.hasZ?3:2;for(const i of e.paths){if(0===t){r=new c({x:i[0][0],y:i[0][1],...a?{m:i[0][s]}:{},spatialReference:e.spatialReference,hasM:a});break}for(let l=0;l<i.length-1;l++){const f=h(i[l],i[l+1]),p=n+f;if(p===t){r=new c({x:i[l+1][0],y:i[l+1][1],...a?{m:i[l+1][s]}:{},spatialReference:e.spatialReference,hasM:a});break}if(p>t){const h=m(i[l],i[l+1],t-n);r=new c({x:h[0],y:h[1],...a?{m:o(i[l][s],i[l+1][s],f,t-n)??void 0}:{},spatialReference:e.spatialReference,hasM:a});break}n+=f}if(null!==r)break}return r}function d(e,n,r){let a=0;const s=e.hasM;for(const i of e.paths){if(0===n)return new c({x:i[0][0],y:i[0][1],z:i[0][2],...s?{m:i[0][3]}:{},hasZ:!0,hasM:s,spatialReference:e.spatialReference});for(let l=0;l<i.length-1;l++){const f=M(i[l],i[l+1],r),h=a+f;if(h===n)return new c({x:i[l+1][0],y:i[l+1][1],z:i[l+1][2],...s?{m:i[l+1][3]}:{},hasZ:!0,hasM:s,spatialReference:e.spatialReference});if(h>n){const h=g(t(i[l]),t(i[l+1]),n-a,r);return new c({x:h[0],y:h[1],z:h[2],...s?{m:o(i[l][3],i[l+1][3],f,n-a)??void 0}:{},hasZ:!0,hasM:s,spatialReference:e.spatialReference})}a+=f}}return null}function w(e){const t=e.paths.map(e=>e.slice().reverse());return t.reverse(),new f({paths:t,spatialReference:e.spatialReference})}function M(e,t,n){return Math.hypot(e[0]-t[0],e[1]-t[1],void 0!==e[2]&&void 0!==t[2]?e[2]*n-t[2]*n:0)}export{m as distanceAlongLineSegment,g as distanceAlongLineSegmentWithZ,y as lineSection,R as pointAlongLine,d as pointAlongLineWithZ,w as reverseLine,M as segmentLength3d};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{readOffsetDistance as t,readVertexBeforeOffset as r,readByNumber as e,readDistance as i,getHeightUnitCorrectionFactor as o,makeFeatureFromGroupPart as s,readCount as l}from"./support/builderUtils.js";import{offset as n}from"./support/offsetUtils.js";import{computedTotalLength as p,pointAlongLineWithZAndOffset as f,pointAlongLineAndOffset as u,pointAlongLineWithZ as a,pointAlongLine as m}from"./support/shapeUtils.js";import{isPolyline as h,maxDigitizingDisplayEdits as d}from"../support/executorUtils.js";function c({templatePart:c,shape:g,edits:j,relationships:U,mode:b}){if(!h(g))return;const x=g,{builderConfig:P}=c,S=t(P),Z=r(P),k=e(P);let z=k?l(P):0,C=k?0:i(P,!1);const E=o(x),M=Z||0===S?x:n(x,S);if(null===M||!h(M))return;const $=p(M);if(k){if(z<=1)return;if(C=$/(z+1),C<=0)return}else{if(C<0)return;if(z=Math.floor($/C),0===z)return}let q=C,v=0;for(;v<z;){let t=null;if(t=Z?M.hasZ?f(M,q,S,E):u(M,q,S):M.hasZ?a(M,q,E):m(M,q),t&&s({templatePart:c,shape:t,edits:j,relationships:U,mode:b},`ES${v.toString()}`),"digitizing"===b&&j.length>d)break;q+=C,v++}}const g=!1;export{c as execute,g as isAsync};
5
+ import{getHeightUnitCorrectionFactor as t}from"../../../geometry/coordUtils.js";import{pointAlongLineWithZ as r,pointAlongLine as e}from"../../../geometry/lineUtils.js";import{readOffsetDistance as i,readVertexBeforeOffset as o,readByNumber as s,readDistance as l,makeFeatureFromGroupPart as p,readCount as n}from"./support/builderUtils.js";import{offset as f}from"./support/offsetUtils.js";import{computedTotalLength as m,pointAlongLineWithZAndOffset as u,pointAlongLineAndOffset as a}from"./support/shapeUtils.js";import{isPolyline as h,maxDigitizingDisplayEdits as c}from"../support/executorUtils.js";function d({templatePart:d,shape:g,edits:j,relationships:U,mode:b}){if(!h(g))return;const x=g,{builderConfig:y}=d,P=i(y),S=o(y),Z=s(y);let k=Z?n(y):0,z=Z?0:l(y,!1);const C=t(x.spatialReference),E=S||0===P?x:f(x,P);if(null===E||!h(E))return;const M=m(E);if(Z){if(k<=1)return;if(z=M/(k+1),z<=0)return}else{if(z<0)return;if(k=Math.floor(M/z),0===k)return}let R=z,$=0;for(;$<k;){let t=null;if(t=S?E.hasZ?u(E,R,P,C):a(E,R,P):E.hasZ?r(E,R,C):e(E,R),t&&p({templatePart:d,shape:t,edits:j,relationships:U,mode:b},`ES${$.toString()}`),"digitizing"===b&&j.length>c)break;R+=z,$++}}const g=!1;export{d as execute,g as isAsync};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{readOffsetDistance as t,readIsProportional as e,readVertexBeforeOffset as r,readDistance as s,getHeightUnitCorrectionFactor as o,makeFeatureFromGroupPart as n}from"./support/builderUtils.js";import{offset as a}from"./support/offsetUtils.js";import{getSegmentLength3d as i,getSegmentLength as p,pointAlongLineWithZAndOffset as l,pointAlongLineAndOffset as f,offsetPointFromSegment as c}from"./support/shapeUtils.js";import{isPolyline as h,maxDigitizingDisplayEdits as u}from"../support/executorUtils.js";import m from"../../../../geometry/Multipoint.js";import{e as g}from"../../../../chunks/intersectsOperator.js";import{fromSpatialReference as y}from"../../../../geometry/operators/support/apiConverter.js";function d(t){if(b(t)&&"digitizing"!==t.mode)return j(t)}async function j({templatePart:h,parentTemplate:m,shape:d,edits:j,relationships:b,mode:M}){const{builderConfig:U}=h,Z=t(U),P=e(U),T=r(U),V=s(U,P),k=T||0===Z?d:a(d,Z);if(null===k)return;const w=m.layer.createQuery();w.geometry=k,w.spatialRelationship="intersects",w.returnM=!0,w.returnZ=!0,w.outSpatialReference=k.spatialReference,w.cacheHint=!1,w.returnGeometry=!0,w.historicMoment=m.layer.historicMoment,w.gdbVersion=m.layer.gdbVersion;const x=2*(y(k.spatialReference)?.getTolerance()??.001);w.distance=x;const{features:C}=await m.layer.queryFeatures(w);if(0===C.length)return;const S=[];for(const t of C)S.push(R(t.geometry));const q=o(k);let v=0,z=0;for(let t=0;t<k.paths.length&&!(j.length>u);t++){const e=k.paths[t].length;for(let r=0;r<e;r++){let s=k.getPoint(t,r);if(null!=s){for(const o of S)if(g(s,o)){if(r>0&&0!==V&&(v+=k.hasZ?i(k.paths[t][r-1],k.paths[t][r],q):p(k.paths[t][r-1],k.paths[t][r])),0!==V){let o=1;if(P){const s=V<0?r-1:r+1;if(s>=e||s<0)return;o=k.hasZ?i(k.paths[t][r],k.paths[t][s],q):p(k.paths[t][r],k.paths[t][s])}const n=v+o*V;s=k.hasZ?l(k,n,Z,q):f(k,n,Z)}else 0!==Z&&(s=c(s,r===e-1?[k.paths[t][r-1],k.paths[t][r]]:[k.paths[t][r],k.paths[t][r+1]],Z));s&&n({templatePart:h,shape:s,edits:j,relationships:b,mode:M},`V${z.toString()}`);break}z++}}}}function R(t){const e=[];for(const r of t.paths)for(const t of r)e.push([...t]);return new m({spatialReference:t.spatialReference,points:e})}function b(t){return null!=t.parentTemplate&&h(t.shape)}const M=!0;export{d as execute,M as isAsync};
5
+ import{getHeightUnitCorrectionFactor as t}from"../../../geometry/coordUtils.js";import{segmentLength3d as e}from"../../../geometry/lineUtils.js";import{readOffsetDistance as r,readIsProportional as s,readVertexBeforeOffset as o,readDistance as n,makeFeatureFromGroupPart as i}from"./support/builderUtils.js";import{offset as a}from"./support/offsetUtils.js";import{pointAlongLineWithZAndOffset as p,pointAlongLineAndOffset as l,offsetPointFromSegment as f}from"./support/shapeUtils.js";import{isPolyline as c,maxDigitizingDisplayEdits as m}from"../support/executorUtils.js";import h from"../../../../geometry/Multipoint.js";import{e as u}from"../../../../chunks/intersectsOperator.js";import{fromSpatialReference as g}from"../../../../geometry/operators/support/apiConverter.js";import{getLength as y}from"../../../../geometry/support/coordsUtils.js";function d(t){if(U(t)&&"digitizing"!==t.mode)return j(t)}async function j({templatePart:c,parentTemplate:h,shape:d,edits:j,relationships:U,mode:b}){const{builderConfig:M}=c,Z=r(M),P=s(M),T=o(M),V=n(M,P),k=T||0===Z?d:a(d,Z);if(null===k)return;const w=h.layer.createQuery();w.geometry=k,w.spatialRelationship="intersects",w.returnM=!0,w.returnZ=!0,w.outSpatialReference=k.spatialReference,w.cacheHint=!1,w.returnGeometry=!0,w.historicMoment=h.layer.historicMoment,w.gdbVersion=h.layer.gdbVersion;const x=2*(g(k.spatialReference)?.getTolerance()??.001);w.distance=x;const{features:C}=await h.layer.queryFeatures(w);if(0===C.length)return;const S=[];for(const t of C)S.push(R(t.geometry));const q=t(k.spatialReference);let v=0,z=0;for(let t=0;t<k.paths.length&&!(j.length>m);t++){const r=k.paths[t].length;for(let s=0;s<r;s++){let o=k.getPoint(t,s);if(null!=o){for(const n of S)if(u(o,n)){if(s>0&&0!==V&&(v+=k.hasZ?e(k.paths[t][s-1],k.paths[t][s],q):y(k.paths[t][s-1],k.paths[t][s])),0!==V){let n=1;if(P){const o=V<0?s-1:s+1;if(o>=r||o<0)return;n=k.hasZ?e(k.paths[t][s],k.paths[t][o],q):y(k.paths[t][s],k.paths[t][o])}const i=v+n*V;o=k.hasZ?p(k,i,Z,q):l(k,i,Z)}else 0!==Z&&(o=f(o,s===r-1?[k.paths[t][s-1],k.paths[t][s]]:[k.paths[t][s],k.paths[t][s+1]],Z));o&&i({templatePart:c,shape:o,edits:j,relationships:U,mode:b},`V${z.toString()}`);break}z++}}}}function R(t){const e=[];for(const r of t.paths)for(const t of r)e.push([...t]);return new h({spatialReference:t.spatialReference,points:e})}function U(t){return null!=t.parentTemplate&&c(t.shape)}const b=!0;export{d as execute,b as isAsync};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Error.js";import{getMetersPerVerticalUnitForSR as t,getMetersPerUnitForSR as o}from"../../../../../core/unitUtils.js";import{isLoadedSharedTemplate as r,isSharedPresetTemplate as n,isSharedFeatureTemplate as s}from"../../../../templateUtils.js";import{createFeatureServiceEdit as i}from"../../support/createFeatureServiceEdit.js";import{createPresetServiceEdit as a}from"../../support/createPresetServiceEdit.js";import l from"../../../../../geometry/Polygon.js";import{isPoint as u,isPolygon as p}from"../../../../../geometry/support/jsonUtils.js";function f({edits:t,mode:o,relationships:l,shape:p,templatePart:f},c=""){if(null===f)return;const{template:m}=f;if(!r(m))throw new e("shared-template:template-not-loaded","A template part's template must be loaded before use");if(n(m)){if(!u(p))throw new e("shared-template:invalid-geometry","Preset templates must have a point geometry");a({geometry:p,template:m,edits:t,relationships:l,rotation:0,mode:o,tag:c})}else s(m)&&i({geometry:p,template:m,edits:t,relationships:l,tag:c})}function c(e,t){if(!e||!p(e))return null;if(!t.hasZ&&!t.hasM)return e;let o=null,r=null;const n=t.hasZ&&t.hasM?3:2;switch(t.type){case"point":o=t.hasZ?t.z:null,r=t.hasM?t.m:null;break;case"polygon":case"polyline":{const e="polygon"===t.type?t.rings:t.paths;for(const s of e)for(const e of s)t.hasZ&&(null===o||e[2]>o)&&(o=e[2]),t.hasM&&(null===r||e[n]>r)&&(r=e[n])}break;case"multipoint":for(const e of t.points)t.hasZ&&(null===o||e[2]>o)&&(o=e[2]),t.hasM&&(null===r||e[n]>r)&&(r=e[n]);break;default:return e}const s=M(e.rings,t.hasZ,t.hasM,o,r);return new l({rings:s,spatialReference:e.spatialReference,hasZ:t.hasZ,hasM:t.hasM})}function m(e){let r=1;if(e.spatialReference.vcsWkid||e.spatialReference.latestVcsWkid){r=t(e.spatialReference)/o(e.spatialReference)}return r}function h(e){let t=!1;return void 0!==e.byNumber&&(t=!0===e.byNumber),t}function d(e){let t=0;return void 0!==e.count&&(t=e.count),t}function g(e,t){let o=0;return t?void 0!==e.proportional&&(o=e.proportional):void 0!==e.distanceValue&&(o=e.distanceValue),t&&(o/=100),o}function y(e){return!0===e.isProportional}function v(e){return!1!==e.createUnique}function b(e){let t=0;return void 0!==e.offsetDistance&&(t=e.offsetDistance),void 0!==e.side&&1===e.side&&(t*=-1),t}function j(e){return!0===e.vertexBeforeOffset}function M(e,t,o,r,n){const s=[];for(const i of e)s.push(Z(i,t,o,r,n));return s}function Z(e,t,o,r,n){const s=[];for(const i of e){const e=[i[0],i[1]];t&&(e[2]=r),o&&(e[t?3:2]=n),s.push(e)}return s}export{c as correctZandMFollowingBuffer,m as getHeightUnitCorrectionFactor,f as makeFeatureFromGroupPart,h as readByNumber,d as readCount,g as readDistance,y as readIsProportional,v as readIsUnique,b as readOffsetDistance,j as readVertexBeforeOffset};
5
+ import t from"../../../../../core/Error.js";import{isLoadedSharedTemplate as e,isSharedPresetTemplate as o,isSharedFeatureTemplate as r}from"../../../../templateUtils.js";import{createFeatureServiceEdit as n}from"../../support/createFeatureServiceEdit.js";import{createPresetServiceEdit as s}from"../../support/createPresetServiceEdit.js";import i from"../../../../../geometry/Polygon.js";import{isPoint as a,isPolygon as l}from"../../../../../geometry/support/jsonUtils.js";function u({edits:i,mode:l,relationships:u,shape:p,templatePart:f},c=""){if(null===f)return;const{template:m}=f;if(!e(m))throw new t("shared-template:template-not-loaded","A template part's template must be loaded before use");if(o(m)){if(!a(p))throw new t("shared-template:invalid-geometry","Preset templates must have a point geometry");s({geometry:p,template:m,edits:i,relationships:u,rotation:0,mode:l,tag:c})}else r(m)&&n({geometry:p,template:m,edits:i,relationships:u,tag:c})}function p(t,e){if(!t||!l(t))return null;if(!e.hasZ&&!e.hasM)return t;let o=null,r=null;const n=e.hasZ&&e.hasM?3:2;switch(e.type){case"point":o=e.hasZ?e.z:null,r=e.hasM?e.m:null;break;case"polygon":case"polyline":{const t="polygon"===e.type?e.rings:e.paths;for(const s of t)for(const t of s)e.hasZ&&(null===o||t[2]>o)&&(o=t[2]),e.hasM&&(null===r||t[n]>r)&&(r=t[n])}break;case"multipoint":for(const t of e.points)e.hasZ&&(null===o||t[2]>o)&&(o=t[2]),e.hasM&&(null===r||t[n]>r)&&(r=t[n]);break;default:return t}const s=v(t.rings,e.hasZ,e.hasM,o,r);return new i({rings:s,spatialReference:t.spatialReference,hasZ:e.hasZ,hasM:e.hasM})}function f(t){let e=!1;return void 0!==t.byNumber&&(e=!0===t.byNumber),e}function c(t){let e=0;return void 0!==t.count&&(e=t.count),e}function m(t,e){let o=0;return e?void 0!==t.proportional&&(o=t.proportional):void 0!==t.distanceValue&&(o=t.distanceValue),e&&(o/=100),o}function h(t){return!0===t.isProportional}function d(t){return!1!==t.createUnique}function g(t){let e=0;return void 0!==t.offsetDistance&&(e=t.offsetDistance),void 0!==t.side&&1===t.side&&(e*=-1),e}function y(t){return!0===t.vertexBeforeOffset}function v(t,e,o,r,n){const s=[];for(const i of t)s.push(b(i,e,o,r,n));return s}function b(t,e,o,r,n){const s=[];for(const i of t){const t=[i[0],i[1]];e&&(t[2]=r),o&&(t[e?3:2]=n),s.push(t)}return s}export{p as correctZandMFollowingBuffer,u as makeFeatureFromGroupPart,f as readByNumber,c as readCount,m as readDistance,h as readIsProportional,d as readIsUnique,g as readOffsetDistance,y as readVertexBeforeOffset};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{getHeightUnitCorrectionFactor as t,makeFeatureFromGroupPart as e}from"./builderUtils.js";import{getSegmentLength3d as s,getSegmentLength as n,pointAlongLineWithZAndOffset as h,pointAlongLineAndOffset as a,pointFromPolylineVertex as i,offsetPointFromSegment as o,computedTotalLength as p}from"./shapeUtils.js";import{maxDigitizingDisplayEdits as r}from"../../support/executorUtils.js";import{e as l}from"../../../../../chunks/offsetOperator.js";import{isPolyline as f}from"../../../../../geometry/support/jsonUtils.js";function g({templatePart:p,edits:l,relationships:g,shape:m,distance:u,isProportional:d,offsetDistance:P,vertexBeforeOffset:j,vertexPlacement:x,mode:V}){const Z=j||0===P?m:c(m,P);if(null===Z||!f(Z))return;const v=t(Z);P=j?P:0;let U=0,O=null,S=0;for(let t=0;t<Z.paths.length;t++){if(l.length>r&&"digitizing"===V)return;const f=Z.paths[t].length,c=t===Z.paths.length-1;for(let m=0;m<f;m++){if(l.length>r&&"digitizing"===V)return;if(m>0&&0!==u&&(U+=Z.hasZ?s(Z.paths[t][m-1],Z.paths[t][m],v):n(Z.paths[t][m-1],Z.paths[t][m])),(0!==m||1!==x)&&!(m===f-1&&2===x&&c||(0===m||m===f-1&&c)&&3===x||0===m&&u<0&&d||m===f-1&&u>0&&d)){if(0!==u){let e=1;if(d){const h=u<0?m-1:m+1;if(h>=f||h<0)continue;e=Z.hasZ?s(Z.paths[t][m],Z.paths[t][h],v):n(Z.paths[t][m],Z.paths[t][h])}const i=U+e*u;O=Z.hasZ?h(Z,i,P,v):a(Z,i,0)}else O=i(Z,t,m),0!==P&&(O=o(O,m===f-1?[Z.paths[t][m-1],Z.paths[t][m]]:[Z.paths[t][m],Z.paths[t][m+1]],P));O&&e({templatePart:p,shape:O,edits:l,relationships:g,mode:V},`V${(S+m).toString()}`)}}S+=f}}function c(t,e){return l(t,e,{unit:"meters",joins:"miter",miterLimit:2})}function m(t){let e=0;for(const s of t.paths)e+=s.length;return e}function u({templatePart:r,edits:l,relationships:g,shape:u,distance:d,isProportional:P,offsetDistance:j,vertexBeforeOffset:x,vertexPlacement:V,mode:Z}){const v=x||0===j?u:c(u,j);if(null===v||!f(v))return;const U=t(v);j=x?j:0;let O=null,S="";if(0!==d){const t=4===V?0:v.paths.length-1,e=4===V?0:v.paths[v.paths.length-1].length-1,i=4===V?0:p(v),o=4===V?v.paths[0].length:v.paths[v.paths.length-1].length;let r=1;if(P){const h=d<0?e-1:e+1;if(h>=o||h<0)return;r=v.hasZ?s(v.paths[t][e],v.paths[t][h],U):n(v.paths[t][e],v.paths[t][h])}const l=i+r*d;O=v.hasZ?h(v,l,j,U):a(v,l,j),S=4===V?"V0":`V${(m(v)-1).toString()}`}else{if(O=4===V?i(v,0,0):i(v,v.paths.length-1,v.paths[v.paths.length-1].length-1),0!==j)if(4===V)O=o(O,[v.paths[0][0],v.paths[0][1]],j);else{const t=v.paths[v.paths.length-1];O=o(O,[t[t.length-2],t[t.length-1]],j)}S=4===V?"V0":`V${(m(v)-1).toString()}`}O&&e({templatePart:r,shape:O,edits:l,relationships:g,mode:Z},S)}export{g as lineVerticesOffset,c as offset,u as vertexOffsetFromStartOrEndOfLine};
5
+ import{getHeightUnitCorrectionFactor as t}from"../../../../geometry/coordUtils.js";import{segmentLength3d as e}from"../../../../geometry/lineUtils.js";import{makeFeatureFromGroupPart as s}from"./builderUtils.js";import{pointAlongLineWithZAndOffset as n,pointAlongLineAndOffset as o,pointFromPolylineVertex as i,offsetPointFromSegment as r,computedTotalLength as a}from"./shapeUtils.js";import{maxDigitizingDisplayEdits as h}from"../../support/executorUtils.js";import{e as p}from"../../../../../chunks/offsetOperator.js";import{getLength as l}from"../../../../../geometry/support/coordsUtils.js";import{isPolyline as f}from"../../../../../geometry/support/jsonUtils.js";function m({templatePart:a,edits:p,relationships:m,shape:g,distance:u,isProportional:d,offsetDistance:j,vertexBeforeOffset:P,vertexPlacement:U,mode:x}){const V=P||0===j?g:c(g,j);if(null===V||!f(V))return;const Z=t(V.spatialReference);j=P?j:0;let v=0,y=null,O=0;for(let t=0;t<V.paths.length;t++){if(p.length>h&&"digitizing"===x)return;const f=V.paths[t].length,c=t===V.paths.length-1;for(let g=0;g<f;g++){if(p.length>h&&"digitizing"===x)return;if(g>0&&0!==u&&(v+=V.hasZ?e(V.paths[t][g-1],V.paths[t][g],Z):l(V.paths[t][g-1],V.paths[t][g])),(0!==g||1!==U)&&!(g===f-1&&2===U&&c||(0===g||g===f-1&&c)&&3===U||0===g&&u<0&&d||g===f-1&&u>0&&d)){if(0!==u){let s=1;if(d){const n=u<0?g-1:g+1;if(n>=f||n<0)continue;s=V.hasZ?e(V.paths[t][g],V.paths[t][n],Z):l(V.paths[t][g],V.paths[t][n])}const i=v+s*u;y=V.hasZ?n(V,i,j,Z):o(V,i,0)}else y=i(V,t,g),0!==j&&(y=r(y,g===f-1?[V.paths[t][g-1],V.paths[t][g]]:[V.paths[t][g],V.paths[t][g+1]],j));y&&s({templatePart:a,shape:y,edits:p,relationships:m,mode:x},`V${(O+g).toString()}`)}}O+=f}}function c(t,e){return p(t,e,{unit:"meters",joins:"miter",miterLimit:2})}function g(t){let e=0;for(const s of t.paths)e+=s.length;return e}function u({templatePart:h,edits:p,relationships:m,shape:u,distance:d,isProportional:j,offsetDistance:P,vertexBeforeOffset:U,vertexPlacement:x,mode:V}){const Z=U||0===P?u:c(u,P);if(null===Z||!f(Z))return;const v=t(Z.spatialReference);P=U?P:0;let y=null,O="";if(0!==d){const t=4===x?0:Z.paths.length-1,s=4===x?0:Z.paths[Z.paths.length-1].length-1,i=4===x?0:a(Z),r=4===x?Z.paths[0].length:Z.paths[Z.paths.length-1].length;let h=1;if(j){const n=d<0?s-1:s+1;if(n>=r||n<0)return;h=Z.hasZ?e(Z.paths[t][s],Z.paths[t][n],v):l(Z.paths[t][s],Z.paths[t][n])}const p=i+h*d;y=Z.hasZ?n(Z,p,P,v):o(Z,p,P),O=4===x?"V0":`V${(g(Z)-1).toString()}`}else{if(y=4===x?i(Z,0,0):i(Z,Z.paths.length-1,Z.paths[Z.paths.length-1].length-1),0!==P)if(4===x)y=r(y,[Z.paths[0][0],Z.paths[0][1]],P);else{const t=Z.paths[Z.paths.length-1];y=r(y,[t[t.length-2],t[t.length-1]],P)}O=4===x?"V0":`V${(g(Z)-1).toString()}`}y&&s({templatePart:h,shape:y,edits:p,relationships:m,mode:V},O)}export{m as lineVerticesOffset,c as offset,u as vertexOffsetFromStartOrEndOfLine};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{equals as e}from"../../../../../core/arrayUtils.js";import{fromArray as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getHeightUnitCorrectionFactor as n}from"./builderUtils.js";import s from"../../../../../geometry/Point.js";import a from"../../../../../geometry/Polyline.js";function r(e){let t=0;const s=n(e);for(let n=0;n<e.paths.length;n++){const a=e.paths[n].length;for(let r=0;r<a;r++)r>0&&(t+=e.hasZ?m(e.paths[n][r-1],e.paths[n][r],s):u(e.paths[n][r-1],e.paths[n][r]))}return t}function o(e){const t=e.geometry.clone();return t.paths.map(n=>new a({spatialReference:e.geometry.spatialReference,paths:[n],hasZ:t.hasZ,hasM:t.hasM}))}function i(e){const t=[];for(const n of e.paths)for(let s=1;s<n.length;s++){const r=[[n[s-1].slice(),n[s].slice()]];t.push(new a({paths:r,spatialReference:e.spatialReference,hasZ:e.hasZ,hasM:e.hasM}))}return t}function c(e,t,n){let s=t[0]-e[0],a=t[1]-e[1];const r=Math.sqrt(s*s+a*a);return s/=r,a/=r,s*=n,a*=n,[e[0]+s,e[1]+a]}function f(e,t,n,s){const a=R([t[0]-e[0],t[1]-e[1],t[2]*s-e[2]*s]);return[e[0]+a[0]*n,e[1]+a[1]*n,e[2]+a[2]*n]}function l(e,t,n){const a=u(t[0],t[1]),r=e.x+n*((t[1][0]-t[0][0])/a),o=e.y+n*((t[1][1]-t[0][1])/a),i={};return e.hasM&&(i.m=e.m),new s({x:r,y:o,spatialReference:e.spatialReference,...i})}function h(e,t,n,a){const r=m(t[0],t[1],a),o=e.x+n*((t[1][0]-t[0][0])/r),i=e.y+n*((t[1][1]-t[0][1])/r),c=e.z+n*((t[1][2]-t[0][2])/r),f={};return e.hasM&&(f.m=e.m),new s({x:o,y:i,z:c,spatialReference:e.spatialReference,...f})}function p(e,t,n,s){if(void 0===e||void 0===t)return null;if(null===e||null===t)return null;return e+(t-e)/n*s}function u(e,t){const n=t[0]-e[0],s=t[1]-e[1];return Math.sqrt(n*n+s*s)}function m(e,t,n){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(void 0!==e[2]&&void 0!==t[2]?(e[2]*n-t[2]*n)**2:0))}function R(e){const t=z(e);return[e[0]/t,e[1]/t,e[2]/t]}function M(e,t,n){const s=t[0],a=t[1],r=[a[0]-s[0],a[1]-s[1]],o=Math.sqrt(r[0]**2+r[1]**2),i=[r[0]/o,r[1]/o];return e.x+=n*i[0],e.y+=n*i[1],e}function y(e,t){let n=0,a=null;const r=e.hasM,o=e.hasZ?3:2;for(const i of e.paths){if(0===t){a=new s({x:i[0][0],y:i[0][1],...r?{m:i[0][o]}:{},spatialReference:e.spatialReference,hasM:r});break}for(let f=0;f<i.length-1;f++){const l=u(i[f],i[f+1]),h=n+l;if(h===t){a=new s({x:i[f+1][0],y:i[f+1][1],...r?{m:i[f+1][o]}:{},spatialReference:e.spatialReference,hasM:r});break}if(h>t){const h=c(i[f],i[f+1],t-n);a=new s({x:h[0],y:h[1],...r?{m:p(i[f][o],i[f+1][o],l,t-n)??void 0}:{},spatialReference:e.spatialReference,hasM:r});break}n+=l}if(null!==a)break}return a}function Z(e,n,a){let r=0;const o=e.hasM;for(const i of e.paths){if(0===n)return new s({x:i[0][0],y:i[0][1],z:i[0][2],...o?{m:i[0][3]}:{},hasZ:!0,hasM:o,spatialReference:e.spatialReference});for(let c=0;c<i.length-1;c++){const l=m(i[c],i[c+1],a),h=r+l;if(h===n)return new s({x:i[c+1][0],y:i[c+1][1],z:i[c+1][2],...o?{m:i[c+1][3]}:{},hasZ:!0,hasM:o,spatialReference:e.spatialReference});if(h>n){const h=f(t(i[c]),t(i[c+1]),n-r,a);return new s({x:h[0],y:h[1],z:h[2],...o?{m:p(i[c][3],i[c+1][3],l,n-r)??void 0}:{},hasZ:!0,hasM:o,spatialReference:e.spatialReference})}r+=l}}return null}function x(e,t,n){let a=0,r=null;if(t<=0){const s=[e.paths[0][0],e.paths[0][1]];let a=d(e,0,0);return a=l(a,s,t),M(a,s,n)}const o=e.hasM?e.hasZ?3:2:-1;for(const l of e.paths)for(let i=0;i<l.length-1;i++){const f=u(l[i],l[i+1]),h=a+f;if(h===t)return r=new s({x:l[i+1][0],y:l[i+1][1],...e.hasM?{m:l[i+1][o]}:{},spatialReference:e.spatialReference}),0===n?r:M(r,[l[i],l[i+1]],n);if(h>t){const h=c(l[i],l[i+1],t-a);return r=new s({x:h[0],y:h[1],...o>-1?{m:p(l[i][o],l[i+1][o],f,t-a)??void 0}:{},spatialReference:e.spatialReference}),0===n?r:M(r,[l[i],l[i+1]],n)}a+=f}if(0===a)return null;const i=e.paths.length-1,f=e.paths[i].length-1,h=[e.paths[i][f-1],e.paths[i][f]];let m=d(e,i,f);return m=l(m,h,t-a),M(m,h,n)}function g(e,n,a,r){let o=0;if(n<=0){const t=[e.paths[0][0],e.paths[0][1]];let s=d(e,0,0);return s=h(s,t,n,r),M(s,t,a)}const i=e.hasM?e.hasZ?3:2:-1;for(const h of e.paths)for(let c=0;c<h.length-1;c++){const l=m(h[c],h[c+1],r),u=o+l;if(u===n){const t=new s({x:h[c+1][0],y:h[c+1][1],z:h[c+1][2],...e.hasM?{m:h[c+1][i]}:{},hasZ:!0,spatialReference:e.spatialReference});return 0===a?t:M(t,[h[c],h[c+1]],a)}if(u>n){const u=f(t(h[c]),t(h[c+1]),n-o,r),m=new s({x:u[0],y:u[1],z:u[2],...i>-1?{m:p(h[c][i],h[c+1][i],l,n-o)}:{},hasZ:!0,spatialReference:e.spatialReference});return 0===a?m:M(m,[h[c],h[c+1]],a)}o+=l}if(0===o)return null;const c=e.paths.length-1,l=e.paths[c].length-1,u=[e.paths[c][l-1],e.paths[c][l]];let R=d(e,c,l);return R=h(R,u,n-o,r),M(R,u,a)}function w(e,t,n){const a=e.rings[t][n];return new s({spatialReference:e.spatialReference,x:a[0],y:a[1],hasZ:e.hasZ,hasM:e.hasM,z:e.hasZ?a[2]:void 0,m:e.hasM?e.hasZ?a[3]:a[2]:void 0})}function d(e,t,n){const a=e.paths[t][n];return new s({spatialReference:e.spatialReference,x:a[0],y:a[1],hasZ:e.hasZ,hasM:e.hasM,z:e.hasZ?a[2]:void 0,m:e.hasM?e.hasZ?a[3]:a[2]:void 0})}function v(t){return e(t.at(0),t.at(-1))}function z(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}export{r as computedTotalLength,o as convertRadialToPolylines,i as convertToTwoPoint,c as distanceAlongLineSegment,f as distanceAlongLineSegmentWithZ,u as getSegmentLength,m as getSegmentLength3d,M as offsetPointFromSegment,y as pointAlongLine,x as pointAlongLineAndOffset,Z as pointAlongLineWithZ,g as pointAlongLineWithZAndOffset,w as pointFromPolygonVertex,d as pointFromPolylineVertex,v as sameStartEndPoint};
5
+ import{equals as e}from"../../../../../core/arrayUtils.js";import{fromArray as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getHeightUnitCorrectionFactor as s,interpolateM as n}from"../../../../geometry/coordUtils.js";import{segmentLength3d as a,distanceAlongLineSegmentWithZ as r,distanceAlongLineSegment as o}from"../../../../geometry/lineUtils.js";import h from"../../../../../geometry/Point.js";import c from"../../../../../geometry/Polyline.js";import{getLength as i}from"../../../../../geometry/support/coordsUtils.js";function f(e){let t=0;const n=s(e.spatialReference);for(let s=0;s<e.paths.length;s++){const r=e.paths[s].length;for(let o=0;o<r;o++)o>0&&(t+=e.hasZ?a(e.paths[s][o-1],e.paths[s][o],n):i(e.paths[s][o-1],e.paths[s][o]))}return t}function l(e){const t=e.geometry.clone();return t.paths.map(s=>new c({spatialReference:e.geometry.spatialReference,paths:[s],hasZ:t.hasZ,hasM:t.hasM}))}function p(e){const t=[];for(const s of e.paths)for(let n=1;n<s.length;n++){const a=[[s[n-1].slice(),s[n].slice()]];t.push(new c({paths:a,spatialReference:e.spatialReference,hasZ:e.hasZ,hasM:e.hasM}))}return t}function u(e,t,s){const n=t[0],a=t[1],r=i(n,a),o=e.x+s*((t[1][0]-t[0][0])/r),c=e.y+s*((t[1][1]-t[0][1])/r),f={};return e.hasM&&(f.m=e.m),new h({x:o,y:c,spatialReference:e.spatialReference,...f})}function m(e,t,s,n){const r=t[0],o=t[1],c=a(r,o,n),i=e.x+s*((t[1][0]-t[0][0])/c),f=e.y+s*((t[1][1]-t[0][1])/c),l=e.z+s*((t[1][2]-t[0][2])/c),p={};return e.hasM&&(p.m=e.m),new h({x:i,y:f,z:l,spatialReference:e.spatialReference,...p})}function R(e,t,s){const n=t[0],a=t[1],r=[a[0]-n[0],a[1]-n[1]],o=Math.sqrt(r[0]**2+r[1]**2),h=[r[0]/o,r[1]/o];return e.x+=s*h[0],e.y+=s*h[1],e}function y(e,t,s){let a=0,r=null;if(t<=0){const n=[e.paths[0][0],e.paths[0][1]];let a=Z(e,0,0);return a=u(a,n,t),R(a,n,s)}const c=e.hasM?e.hasZ?3:2:-1;for(const u of e.paths)for(let f=0;f<u.length-1;f++){const l=i(u[f],u[f+1]),p=a+l;if(p===t)return r=new h({x:u[f+1][0],y:u[f+1][1],...e.hasM?{m:u[f+1][c]}:{},spatialReference:e.spatialReference}),0===s?r:R(r,[u[f],u[f+1]],s);if(p>t){const i=o(u[f],u[f+1],t-a);return r=new h({x:i[0],y:i[1],...c>-1?{m:n(u[f][c],u[f+1][c],l,t-a)??void 0}:{},spatialReference:e.spatialReference}),0===s?r:R(r,[u[f],u[f+1]],s)}a+=l}if(0===a)return null;const f=e.paths.length-1,l=e.paths[f].length-1,p=[e.paths[f][l-1],e.paths[f][l]];let m=Z(e,f,l);return m=u(m,p,t-a),R(m,p,s)}function g(e,s,o,c){let i=0;if(s<=0){const t=[e.paths[0][0],e.paths[0][1]];let n=Z(e,0,0);return n=m(n,t,s,c),R(n,t,o)}const f=e.hasM?e.hasZ?3:2:-1;for(const m of e.paths)for(let l=0;l<m.length-1;l++){const p=a(m[l],m[l+1],c),u=i+p;if(u===s){const t=new h({x:m[l+1][0],y:m[l+1][1],z:m[l+1][2],...e.hasM?{m:m[l+1][f]}:{},hasZ:!0,spatialReference:e.spatialReference});return 0===o?t:R(t,[m[l],m[l+1]],o)}if(u>s){const a=r(t(m[l]),t(m[l+1]),s-i,c),u=new h({x:a[0],y:a[1],z:a[2],...f>-1?{m:n(m[l][f],m[l+1][f],p,s-i)}:{},hasZ:!0,spatialReference:e.spatialReference});return 0===o?u:R(u,[m[l],m[l+1]],o)}i+=p}if(0===i)return null;const l=e.paths.length-1,p=e.paths[l].length-1,u=[e.paths[l][p-1],e.paths[l][p]];let y=Z(e,l,p);return y=m(y,u,s-i,c),R(y,u,o)}function M(e,t,s){const n=e.rings[t][s];return new h({spatialReference:e.spatialReference,x:n[0],y:n[1],hasZ:e.hasZ,hasM:e.hasM,z:e.hasZ?n[2]:void 0,m:e.hasM?e.hasZ?n[3]:n[2]:void 0})}function Z(e,t,s){const n=e.paths[t][s];return new h({spatialReference:e.spatialReference,x:n[0],y:n[1],hasZ:e.hasZ,hasM:e.hasM,z:e.hasZ?n[2]:void 0,m:e.hasM?e.hasZ?n[3]:n[2]:void 0})}function x(t){return e(t.at(0),t.at(-1))}export{f as computedTotalLength,l as convertRadialToPolylines,p as convertToTwoPoint,R as offsetPointFromSegment,y as pointAlongLineAndOffset,g as pointAlongLineWithZAndOffset,M as pointFromPolygonVertex,Z as pointFromPolylineVertex,x as sameStartEndPoint};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import n from"../core/Error.js";import{l as e,i as t,b as r,P as o,a as i,c as l,d as u,e as a,f as s}from"../chunks/pe.js";import c from"./Point.js";import d from"./SpatialReference.js";import{parseNumber as f}from"../intl/number.js";function _(){return t()}function S(){return s()}function E(){return e()}function w(n,e){const t=k(e),o=n.replaceAll(/[\u00B0\u00BA]/g,"^").replaceAll("′","'").replaceAll("″",'"'),i=[];return r.dmsToGeog(t,1,[o],i)?new c(i[0][0],i[0][1],e||d.WGS84):null}function g(n){return n&&_()?f(n)??w(`0° 0' 0" N | ${n}`)?.longitude??w(`0 N | ${n}`)?.longitude??null:null}function m(n){return n&&_()?f(n)??w(`${n} | 0° 0' 0" E`)?.latitude??w(`${n} | 0 E`)?.latitude??null:null}function T(n,e,t){const r=[],o=A(t);if(-1===o)return console.warn(`invalid conversionMode: ${t}`),null;const i=k(e);return a.mgrsToGeogExtended(i,1,[n],o,r)?new c(r[0][0],r[0][1],e||d.WGS84):null}function P(n,e){const t=[];!e&&/\(.+27/.test(n)&&(e=d.GCS_NAD_1927);const r=k(e);return l.usngToGeog(r,1,[n],t)?new c(t[0][0],t[0][1],e||d.WGS84):null}function G(n,e,t){const r=[],o=D(t);if(-1===o)return console.warn(`invalid conversionMode: ${t}`),null;const i=k(e);return u.utmToGeog(i,1,[n],o,r)?new c(r[0][0],r[0][1],e||d.WGS84):null}function p(n,e,t=0){const o=[[n.x,n.y]],i=[],l=k(n.spatialReference);let u=0;switch(e){case"dd":u=r.geogToDd(l,1,o,t,i);break;case"ddm":u=r.geogToDdm(l,1,o,t,i);break;case"dms":u=r.geogToDms(l,1,o,t,i);break;default:return console.warn(`invalid format: ${e}`),null}return u?i[0]:null}function M(n,e,t=0,r=!1){const o=[[n.x,n.y]],i=[],l=k(n.spatialReference);let u=A(e);if(-1===u)return console.warn(`invalid conversionMode: ${e}`),null;r&&(u|=a.PE_MGRS_ADD_SPACES);return a.geogToMgrsExtended(l,1,o,t,!1,u,i)?i[0]:null}function v(n,e=0,t=!1){const r=[[n.x,n.y]],o=[],i=k(n.spatialReference);return l.geogToUsng(i,1,r,e,!1,t,o)?o[0]:null}function R(n,e,t=!1){const r=[[n.x,n.y]],o=[],i=k(n.spatialReference);let l=D(e);if(-1===l)return console.warn(`invalid conversionMode: ${e}`),null;t&&(l|=u.PE_UTM_OPTS_ADD_SPACES);return u.geogToUtm(i,1,r,l,o)?o[0]:null}function k(e){if(e??=d.WGS84,e.wkid){const t=o.geogcs(e.wkid);if(!t)throw new n("coordinate-formatter:invalid-spatial-reference","wkid is not valid");return t}const t=e.wkt2??e.wkt;if(t){const e=o.fromString(i.PE_TYPE_GEOGCS,t);if(!e)throw new n("coordinate-formatter:invalid-spatial-reference","wkt is not valid");return e}throw new n("coordinate-formatter:invalid-spatial-reference","wkid and wkt are missing")}function A(n){switch(n){case"automatic":return a.PE_MGRS_STYLE_AUTO;case"new-180-in-zone-01":return a.PE_MGRS_STYLE_NEW|a.PE_MGRS_180_ZONE_1_PLUS;case"new-180-in-zone-60":return a.PE_MGRS_STYLE_NEW;case"old-180-in-zone-01":return a.PE_MGRS_STYLE_OLD|a.PE_MGRS_180_ZONE_1_PLUS;case"old-180-in-zone-60":return a.PE_MGRS_STYLE_OLD;default:return-1}}function D(n){switch(n){case"latitude-band-indicators":return u.PE_UTM_OPTS_NONE;case"north-south-indicators":return u.PE_UTM_OPTS_NS;default:return-1}}export{m as fromLatitude,w as fromLatitudeLongitude,g as fromLongitude,T as fromMgrs,P as fromUsng,G as fromUtm,_ as isLoaded,S as isSupported,E as load,p as toLatitudeLongitude,M as toMgrs,v as toUsng,R as toUtm};
5
+ import n from"../core/Error.js";import{i as e,b as t,P as r,a as o,l as i,c as l,d as u,e as a,f as s}from"../chunks/pe.js";import c from"./Point.js";import d from"./SpatialReference.js";import{parseNumber as f}from"../intl/number.js";function _(){return e()}function S(){return s()}function E(){return i()}function w(n,e){const r=k(e),o=n.replaceAll(/[\u00B0\u00BA]/g,"^").replaceAll("′","'").replaceAll("″",'"'),i=[];return t.dmsToGeog(r,1,[o],i)?new c(i[0][0],i[0][1],e||d.WGS84):null}function g(n){return n&&_()?f(n)??w(`0° 0' 0" N | ${n}`)?.longitude??w(`0 N | ${n}`)?.longitude??null:null}function m(n){return n&&_()?f(n)??w(`${n} | 0° 0' 0" E`)?.latitude??w(`${n} | 0 E`)?.latitude??null:null}function T(n,e,t){const r=[],o=A(t);if(-1===o)return console.warn(`invalid conversionMode: ${t}`),null;const i=k(e);return a.mgrsToGeogExtended(i,1,[n],o,r)?new c(r[0][0],r[0][1],e||d.WGS84):null}function P(n,e){const t=[];!e&&/\(.+27/.test(n)&&(e=d.GCS_NAD_1927);const r=k(e);return l.usngToGeog(r,1,[n],t)?new c(t[0][0],t[0][1],e||d.WGS84):null}function G(n,e,t){const r=[],o=D(t);if(-1===o)return console.warn(`invalid conversionMode: ${t}`),null;const i=k(e);return u.utmToGeog(i,1,[n],o,r)?new c(r[0][0],r[0][1],e||d.WGS84):null}function p(n,e,r=0){const o=[[n.x,n.y]],i=[],l=k(n.spatialReference);let u=0;switch(e){case"dd":u=t.geogToDd(l,1,o,r,i);break;case"ddm":u=t.geogToDdm(l,1,o,r,i);break;case"dms":u=t.geogToDms(l,1,o,r,i);break;default:return console.warn(`invalid format: ${e}`),null}return u?i[0]:null}function M(n,e,t=0,r=!1){const o=[[n.x,n.y]],i=[],l=k(n.spatialReference);let u=A(e);if(-1===u)return console.warn(`invalid conversionMode: ${e}`),null;r&&(u|=a.PE_MGRS_ADD_SPACES);return a.geogToMgrsExtended(l,1,o,t,!1,u,i)?i[0]:null}function v(n,e=0,t=!1){const r=[[n.x,n.y]],o=[],i=k(n.spatialReference);return l.geogToUsng(i,1,r,e,!1,t,o)?o[0]:null}function R(n,e,t=!1){const r=[[n.x,n.y]],o=[],i=k(n.spatialReference);let l=D(e);if(-1===l)return console.warn(`invalid conversionMode: ${e}`),null;t&&(l|=u.PE_UTM_OPTS_ADD_SPACES);return u.geogToUtm(i,1,r,l,o)?o[0]:null}function k(e){if(e??=d.WGS84,e.wkid){const t=r.geogcs(e.wkid);if(!t)throw new n("coordinate-formatter:invalid-spatial-reference","wkid is not valid");return t}const t=e.wkt2??e.wkt;if(t){const e=r.fromString(o.PE_TYPE_GEOGCS,t);if(!e)throw new n("coordinate-formatter:invalid-spatial-reference","wkt is not valid");return e}throw new n("coordinate-formatter:invalid-spatial-reference","wkid and wkt are missing")}function A(n){switch(n){case"automatic":return a.PE_MGRS_STYLE_AUTO;case"new-180-in-zone-01":return a.PE_MGRS_STYLE_NEW|a.PE_MGRS_180_ZONE_1_PLUS;case"new-180-in-zone-60":return a.PE_MGRS_STYLE_NEW;case"old-180-in-zone-01":return a.PE_MGRS_STYLE_OLD|a.PE_MGRS_180_ZONE_1_PLUS;case"old-180-in-zone-60":return a.PE_MGRS_STYLE_OLD;default:return-1}}function D(n){switch(n){case"latitude-band-indicators":return u.PE_UTM_OPTS_NONE;case"north-south-indicators":return u.PE_UTM_OPTS_NS;default:return-1}}export{m as fromLatitude,w as fromLatitudeLongitude,g as fromLongitude,T as fromMgrs,P as fromUsng,G as fromUtm,_ as isLoaded,S as isSupported,E as load,p as toLatitudeLongitude,M as toMgrs,v as toUsng,R as toUtm};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{G as t,S as e}from"../../../chunks/SimpleGeometryCursor.js";import{o as i,c as n,i as s,G as o,a as r,g as h}from"../../../chunks/Geometry.js";import{m as d,P as g,i as a,d as c,k as l,u,c as f,v as m}from"../../../chunks/Point2D.js";import{a as p,M as E,r as x,h as P}from"../../../chunks/MultiPathImpl.js";function _(t,e,i,n,s,o){const r=n-e;if(r<=o)return P(t,e,i,n,s),i;const h=w(t,e,n,s,Math.min(Math.max(r>>1,3),100)),d=t[h];t[e]=f(t[h],t[h]=t[e]);let g=e+1,a=!1;for(let c=e+1;c!==n;++c)s(t[c],d)&&(t[g]=f(t[c],t[c]=t[g]),++g,a=!0);if(!a)for(let c=e+1;c<i;++c)s(d,t[c])||(c!==g&&(t[g]=f(t[c],t[c]=t[g])),++g);return--g,t[g]=f(t[e],t[e]=t[g]),g}function F(t,e,i){const n=Math.trunc(e/2);let s=BigInt(n);const o=BigInt(e);for(let h=0;h<i;++h)t.push(Number(s%o)),s=6364136223846793005n*s+1442695040888963407n&0x7fffffffffffffffn,s=BigInt.asUintN(64,s);m(t);const r=u(t,(t,e)=>t===e);t.length=r}function w(t,e,i,n,s){const o=[];F(o,i-e,s);const r=[];for(let d=0,g=o.length;d<g;d++){const i=o[d];r.push(l(t[e+i],i))}const h=Math.trunc(r.length/2);return r.sort((t,e)=>n(t.first,e.first)?-1:1),e+r[h].second}function k(){return{p:new g,userData:Number.NaN,edge:null}}class T{constructor(){this.info=0,this.mask=!1,this.p=null,this.a=[null,null],this.twin=null}nextFreeEdge(){return this.twin}setIndex(t){this.info=t,this.mask=!1}getIndex(){return this.info}setMask(){this.mask=!0}getMask(){return this.mask}}function y(t,e){return{first:t,second:e}}function C(t,e){t.first=e.first,t.second=e.second}function b(){return this.i1-this.i0}function D(){return{i0:Number.NaN,i1:Number.NaN,nextFreeEdgeIndex:[-1],box:[y(null,null),y(null,null)],size:b}}function I(){return{k:0,pTask:null,pTask0:null,pTask1:null}}function X(){return{p:[new g,new g],points:[null,null]}}function Y(){return{p:[null,null,null]}}class N{constructor(){this.m_nextFreePairEdge=y(null,null),this.m_points=[],this.m_pointZero=null,this.m_edges=[],this.m_voronoiToEdge=[],this.m_nextFreeEdge=0}clear(){this.m_nextFreePairEdge=y(null,null),this.m_points.length=0,this.m_pointZero=null,this.m_edges.length=0,this.m_voronoiToEdge.length=0,this.m_nextFreeEdge=0}reservePoints(t){h(t>1)}prepare(t){{const e=k();e.p.x=Number.POSITIVE_INFINITY,e.p.y=Number.POSITIVE_INFINITY,e.userData=t,this.m_points.push(e)}}addVertex(t,e){const i=k();i.p.assign(t),i.userData=e,i.edge=null,this.m_points.push(i)}removeDuplicates(){const t=this.m_points.shift();this.m_points.sort((t,e)=>t.p.compareX(e.p));const e=u(this.m_points,(t,e)=>t.p.equals(e.p)),i=e!==this.m_points.length;return this.m_points.length=e,this.m_points.unshift(t),i}boundVoronoiCells(t,e){const i=this.m_points.length;if(i<2)return!1;const n=[this.m_points[1].p.clone(),this.m_points[1].p.clone()];for(let d=2;d<i;d++){const t=this.m_points[d].p;t.x<n[0].x&&(n[0].x=t.x),n[1].x<t.x&&(n[1].x=t.x),t.y<n[0].y&&(n[0].y=t.y),n[1].y<t.y&&(n[1].y=t.y)}const s=new g;s.x=.5*(n[0].x+n[1].x),s.y=.5*(n[0].y+n[1].y);let o=0;for(let d=1;d<i;d++){const t=this.m_points[d].p,e=g.sqrDistanceCoords(t.x,t.y,s.x,s.y);o<e&&(o=e)}const r=Math.sqrt(o),h=Math.max(r+2*t,1.5*r);{const t=.8660254037844386,i=.5;let n=1,o=0;for(let r=0;r<12;r++){const r=new g;r.x=s.x+h*n,r.y=s.y+h*o,this.addVertex(r,e);const d=n*i+o*t;n=n*t-o*i,o=d}}return!0}construct(){const t=D();return!!this.constructTask(t)&&(this.solveTask(t),!0)}constructTask(t){if(this.m_pointZero=this.createZeroHandle(),h(void 0!==this.m_pointZero),this.m_points.length<3)return!1;const e=6*(this.m_points.length-2);this.m_edges=d(T,e);for(let i=0;i<e;i++)this.m_edges[i].setIndex(i);return t.i0=1,t.i1=this.m_points.length,t.nextFreeEdgeIndex[0]=0,!0}splitTask(t,e,i,n){const s=t,o=e,r=i,h=n;s.k=this.findMaxSide(h.i0,h.i1);let d=h.i0+h.i1>>1;const g=1250;if(0===s.k){d=_(this.m_points,h.i0,d,h.i1,(t,e)=>t.p[0]!==e.p[0]?t.p[0]<e.p[0]:t.p[1]<e.p[1],g)}else{d=_(this.m_points,h.i0,d,h.i1,(t,e)=>t.p[1]!==e.p[1]?t.p[1]<e.p[1]:t.p[0]<e.p[0],g)}o.i0=h.i0,o.i1=d,o.nextFreeEdgeIndex[0]=h.nextFreeEdgeIndex[0],h.nextFreeEdgeIndex[0]+=6*(o.i1-o.i0-1)+2,r.i0=d,r.i1=h.i1,r.nextFreeEdgeIndex[0]=h.nextFreeEdgeIndex[0],h.nextFreeEdgeIndex[0]+=6*(r.i1-r.i0-1)+2,s.pTask=h,s.pTask0=o,s.pTask1=r}solveMergeTask(t){const e=this.newPairEdgeEx(t.pTask.nextFreeEdgeIndex,!1);if(t.pTask.box[t.k]=y(t.pTask0.box[t.k].first,t.pTask1.box[t.k].second),t.pTask.box[1-t.k]=y(A(this.getPointXYFromEdge(t.pTask0.box[1-t.k].first),this.getPointXYFromEdge(t.pTask1.box[1-t.k].first),1-t.k)?t.pTask0.box[1-t.k].first:t.pTask1.box[1-t.k].first,A(this.getPointXYFromEdge(t.pTask0.box[1-t.k].second),this.getPointXYFromEdge(t.pTask1.box[1-t.k].second),1-t.k)?t.pTask1.box[1-t.k].second:t.pTask0.box[1-t.k].second),t.pTask.i0+2===t.pTask.i1){const i=t.pTask0.box[t.k].second,n=i.twin,s=t.pTask1.box[t.k].first,o=s.twin;return this.joinEdges2(n,o),this.joinEdges2(o,n),void this.join(i,s,0,1,e)}const i=[new Array(2),new Array(2)];i[0][0]=i[1][0]=y(t.pTask0.box[t.k].second,t.pTask0.box[t.k].second.twin),i[0][1]=i[1][1]=y(t.pTask1.box[t.k].first,t.pTask1.box[t.k].first.twin);const n=[!1,!1];if(t.pTask0.i0+1===t.pTask0.i1?(this.findEdgeSide(i[0],n,1,0),this.findEdgeSide(i[1],n,1,1)):(this.findEdge(i[0],n,0),this.findEdge(i[1],n,1)),n[0]||n[1]){if(n[0]){const e=this.newPairEdgeEx(t.pTask0.nextFreeEdgeIndex,!1);this.insertEdge(i[0][0].first,e.first,0),this.insertEdge(i[0][0].second,e.second,1)}if(n[1]){const e=this.newPairEdgeEx(t.pTask1.nextFreeEdgeIndex,!1);this.insertEdge(i[0][1].first,e.first,1),this.insertEdge(i[0][1].second,e.second,0)}}else this.getNextDEdge(i[0][0].first,0)!==i[0][0].first&&(i[1][0]=this.newPairEdgeEx(t.pTask0.nextFreeEdgeIndex,!1),this.insertEdge(i[0][0].first,i[1][0].first,0),this.insertEdge(i[0][0].second,i[1][0].second,1)),this.getNextDEdge(i[0][1].first,0)!==i[0][1].first&&(i[1][1]=this.newPairEdgeEx(t.pTask1.nextFreeEdgeIndex,!1),this.insertEdge(i[0][1].first,i[1][1].first,1),this.insertEdge(i[0][1].second,i[1][1].second,0));this.merge(i[1][0],i[0][0],i[0][1],i[1][1],e)}solveTask(t){const e=t;switch(e.i1-e.i0){case 1:{this.insertPoint(e.i0,e.nextFreeEdgeIndex);const t=this.m_points[e.i0].edge;e.box[0]=e.box[1]=l(t,t)}break;case 2:{const t=e.i0,i=t+1;this.insertPoint(t,e.nextFreeEdgeIndex),this.insertPoint(i,e.nextFreeEdgeIndex);const n=this.m_points[t],s=this.m_points[i],o=n.edge,r=s.edge,h=o.twin,d=r.twin;this.joinEdges2(h,d),this.joinEdges2(d,h);const g=this.newPairEdgeEx(e.nextFreeEdgeIndex,!1);this.join(o,r,0,1,g);for(let a=0;a<2;a++)e.box[a]=A(this.getPointXY(n),this.getPointXY(s),a)?y(o,r):y(r,o)}break;case 3:{const t=[e.i0,e.i0+1,e.i0+2];this.insertPoint(t[0],e.nextFreeEdgeIndex),this.insertPoint(t[1],e.nextFreeEdgeIndex),this.insertPoint(t[2],e.nextFreeEdgeIndex);const i=[this.m_points[t[0]],this.m_points[t[1]],this.m_points[t[2]]],n=this.caseFromCompare(i[0].p,i[1].p,i[2].p),s=[i[0].edge,i[1].edge,i[2].edge],o=N.c_aTableDelaunayTriangulationSolution[n],r=v(19*v(1+(7&o))),h=v(19*v(1+(o>>5)));let d=v(o<<3)>>6;const g=3&r,a=r>>6,c=3&h,l=h>>6;e.box[0]=y(s[g],s[a]),e.box[1]=y(s[c],s[l]);const u=[s[0].twin,s[1].twin,s[2].twin],m=[this.newPairEdgeEx(e.nextFreeEdgeIndex,!1),this.newPairEdgeEx(e.nextFreeEdgeIndex,!1),this.newPairEdgeEx(e.nextFreeEdgeIndex,!1)];switch(3===d&&(d=this.orientation(i[0].p,i[1].p,i[2].p)+1),d){case 0:this.joinEdges2(u[0],u[2]),this.joinEdges2(u[2],u[1]),this.joinEdges2(u[1],u[0]),this.join(s[0],s[2],0,1,m[0]),this.join(s[2],s[1],0,1,m[1]),this.join(s[1],s[0],0,1,m[2]);break;case 1:{const t=[0,1,2];t[3-(g+a)]=f(t[1],t[1]=t[3-(g+a)]),this.joinEdges2(u[t[0]],u[t[1]]),this.joinEdges2(u[t[1]],u[t[2]]),this.joinEdges2(u[t[2]],u[t[0]]),this.join(s[t[0]],s[t[1]],0,1,m[0]),this.join(s[t[1]],s[t[2]],0,1,m[1]),this.join(m[1].first,u[t[2]],0,1,m[2])}break;case 2:this.joinEdges2(u[0],u[1]),this.joinEdges2(u[1],u[2]),this.joinEdges2(u[2],u[0]),this.join(s[0],s[1],0,1,m[0]),this.join(s[1],s[2],0,1,m[1]),this.join(s[2],s[0],0,1,m[2])}}break;default:{const e=I(),i=D(),n=D();this.splitTask(e,i,n,t),this.solveTask(i),this.solveTask(n),this.solveMergeTask(e)}}}getOutsideHull(){const t=[],e=this.m_points[0].edge;let i=e;do{t.push(this.getPointFromEdge(this.getTwinEdge(i))),i=this.getNextDEdge(i,0)}while(i!==e);return t}getConvexHull(){const t=[],e=this.m_points[0].edge;let i=e;do{const e=this.getPointFromEdge(this.getTwinEdge(i));t.length<2||!this.insideLine(this.getPointXY(t.at(-2)),this.getPointXY(t.at(-1)),this.getPointXY(e))?t.push(e):t[t.length-1]=e,i=this.getNextDEdge(i,0)}while(i!==e);return 2<t.length&&this.insideLine(this.getPointXY(t[0]),this.getPointXY(t.at(-1)),this.getPointXY(t.at(-2)))&&t.pop(),2<t.length&&this.insideLine(this.getPointXY(t[1]),this.getPointXY(t[0]),this.getPointXY(t.at(-1)))&&(t[0]=t.at(-1),t.pop()),t}getVoronoiPolygon(t,e){t.length=0;const i=this.getEdgeFromPoint(e);let n=i;for(;;){const e=this.calculateCircleCenter(n);t.push(e);const s=this.getNextDEdge(n,1);if(s===i)break;n=s}}getNearestPoint(t){this.isInfinitePointFromPoint(t)&&r("Not supported for the infinite point");const e=this.getPointXY(t);let i=this.m_pointZero,n=Number.MAX_VALUE;const s=this.getEdgeFromPoint(t);let o=s;do{const t=this.getPointFromEdge(this.getTwinEdge(o));if(!this.isInfinitePointFromPoint(t)){const s=g.sqrDistance(e,this.getPointXY(t));s<n&&(i=t,n=s)}o=this.getCounterClockwiseEdge(o)}while(o!==s);return i}addConstraint(t,e){const i=[null],n=[null];if(!this.constraintFindFirstEdge(i,n,t,e))return y(n[0],i[0]);i[0]=this.getTwinEdge(i[0]);const s=this.getPointXY(t),o=this.getPointXY(e),h=[new Array(0),new Array(0)],d=i[0];for(;;){const t=this.getClockwiseEdge(n[0]);t.getMask()&&r("add_constraint");const d=y(t,this.getTwinEdge(t));this.deleteTwinEdges(d,!0);const g=this.getCounterClockwiseEdge(this.getTwinEdge(i[0])),a=this.getTwinEdge(this.getClockwiseEdge(n[0])),c=this.getPointFromEdge(a);if(c===e){h[0].push(i[0]),i[0]=g,h[1].push(n[0]),n[0]=a;break}const l=this.orientation(s,o,this.getPointXY(c));0===l&&r("add_constraint - point on constraint"),0<l?(h[0].push(i[0]),i[0]=g):(h[1].push(n[0]),n[0]=a)}h[0].push(i[0]),h[1].push(n[0]);const g=this.newPairEdge();g.first.setMask(),g.second.setMask(),this.join(n[0],d,1,1,g),this.triangulateConstraint(h[0],1,h[0].length-1,g),h[1].reverse();const a=y(g.second,g.first);return this.triangulateConstraint(h[1],1,h[1].length-1,a),a}verify(){for(let t=0,e=this.m_edges.length;t<e;t++){const e=this.m_edges[t];if(!e.getMask()&&!this.testEdge(e))return!1}return!0}getDelaunayTriangleCount(){return this.m_points.length-2<<1}getVoronoiSegments(t=Number.MAX_VALUE){const e=[];for(let i=0,n=this.m_edges.length;i<n;i+=2){const n=y(null,null);if(n.first=this.m_edges[i],n.second=n.first.twin,this.isInfinitePointFromEdge(n.first)&&(n.second=f(n.first,n.first=n.second)),this.isInfinitePointFromEdge(n.second)){const i=d(g,3);i[0]=this.calculateCircleCenter(this.getNextDEdge(n.first,0).twin,1),i[2]=this.calculateCircleCenter(this.getNextDEdge(n.first,1),1);const s=d(g,2);s[0].assign(i[0]),s[1].assign(i[2]),s[0].rightPerpendicularThis(),s[1].leftPerpendicularThis(),i[1]=i[0].add(s[0]).add(i[2].add(s[1])),i[1].normalize();for(const e of i)e.mulThis(t);const o=X();o.points[0]=n.first.p,o.points[1]=n.second.p;for(let t=0;t<i.length-1;t++){for(let e=0;e<2;e++)o.p[e]=i[t+e];o.p[0].equals(o.p[1])||e.push(o)}}else if(this.isInfinitePointFromEdge(this.getNextDEdge(n.first,0).twin)&&this.isInfinitePointFromEdge(this.getNextDEdge(n.first,1).twin)){const t=d(g,3);t[0]=this.calculateCircleCenter(n.first),t[1]=this.getPointXY(this.getPointFromEdge(n.first)).add(this.getPointXY(this.getPointFromEdge(n.second))).mul(.5),t[2]=this.calculateCircleCenter(n.second);const i=X();i.points[0]=n.first.p,i.points[1]=n.second.p;for(let n=0;n<t.length-1;n++){for(let e=0;e<2;e++)i.p[e]=t[n+e];i.p[0].equals(i.p[1])||e.push(i)}}else{const t=X();t.p[0]=this.calculateCircleCenter(n.first),t.p[1]=this.calculateCircleCenter(n.second),t.points[0]=n.first.p,t.points[1]=n.second.p,t.p[0].equals(t.p[1])||e.push(t)}}return e}startDelaunayTriangles(){return-1}nextDelaunayTriangle(t,e){for(;;){if(++e[0],e[0]===this.m_edges.length)return!1;const i=this.m_edges[e[0]];if(t.p[0]=this.getPointFromEdge(i),this.isInfinitePointFromPoint(t.p[0]))continue;const n=this.getTwinEdge(i);if(t.p[1]=this.getPointFromEdge(n),this.isInfinitePointFromPoint(t.p[1]))continue;if(this.getPointXY(t.p[1]).lt(this.getPointXY(t.p[0])))continue;const s=this.getTwinEdge(this.getNextDEdge(i,1));if(t.p[2]=this.getPointFromEdge(s),!this.isInfinitePointFromPoint(t.p[2])&&!this.getPointXY(t.p[2]).lt(this.getPointXY(t.p[0])))return!0}}getPointCount(){return this.m_points.length-1}getPoint(t){return this.m_points[t+1]}getInfinitePoint(){return this.m_pointZero}isInfinitePointFromPoint(t){return t===this.m_pointZero}getPointXY(t){return t.p}getPointIndex(t){return t.userData}setPointIndex(t,e){t.userData=e}getEdgeFromPoint(t){return t.edge}isInfinitePointFromEdge(t){return t.p===this.m_pointZero}getEdgeCount(){return this.m_edges.length}getEdge(t){return this.m_edges[t]}getEdgeIndex(t){return t.getIndex()}getPointFromEdge(t){return t.p}getPointXYFromEdge(t){return t.p.p}getCounterClockwiseEdge(t){return t.a[0]}getClockwiseEdge(t){return t.a[1]}getTwinEdge(t){return t.twin}getPreviousEdge(t){return this.getTwinEdge(this.getCounterClockwiseEdge(t))}getNextEdge(t){return this.getClockwiseEdge(this.getTwinEdge(t))}getNextDEdge(t,e=1){return t.a[e]}newPairEdge(){const t=y(this.m_nextFreePairEdge.first,this.m_nextFreePairEdge.second);return this.m_nextFreePairEdge.first=this.m_nextFreePairEdge.first.nextFreeEdge(),this.m_nextFreePairEdge.second=this.m_nextFreePairEdge.second.nextFreeEdge(),t.first.twin=t.second,t.second.twin=t.first,t}newPairEdgeEx(t,e){let i;if(e&&null!==this.m_nextFreePairEdge.first)i=y(this.m_nextFreePairEdge.first,this.m_nextFreePairEdge.second),this.m_nextFreePairEdge.first=this.m_nextFreePairEdge.first.nextFreeEdge(),this.m_nextFreePairEdge.second=this.m_nextFreePairEdge.second.nextFreeEdge();else{const e=t[0]++,n=t[0]++;i=y(this.m_edges[e],this.m_edges[n])}return i.first.twin=i.second,i.second.twin=i.first,i}insertEdge(t,e,i){e.p=t.p;const n=t.a[i],s=e.a;s[i]=n,s[1-i]=t,t.a[i]=e,n.a[1-i]=e}insertPoint(t,e){const i=this.m_points[t],n=this.newPairEdgeEx(e,!1),s=n.first,o=n.second;i.edge=n.first,s.p=this.m_points[t],s.a[0]=n.first,s.a[1]=n.first,o.p=this.m_pointZero,o.a[0]=n.second,o.a[1]=n.second,null===this.m_points[0].edge&&(this.m_points[0].edge=n.second)}deleteTwinEdges(t,e){this.deleteEdge(t.first),this.deleteEdge(t.second),e&&(t.first.twin=this.m_nextFreePairEdge.first,t.second.twin=this.m_nextFreePairEdge.second,this.m_nextFreePairEdge=t)}join(t,e,i,n,s){this.insertEdge(t,s.first,i),this.insertEdge(e,s.second,n)}joinEdges2(t,e){t.a[1]=e,e.a[0]=t}checkEdge(t,e,i,n,s){for(;;){const o=y(null,null);if(o.first=this.getNextDEdge(t.first,n),o.second=o.first.twin,this.isInfinitePointFromEdge(o.second))return t;const r=this.getPointXYFromEdge(t.second),h=this.getPointXYFromEdge(o.second);if(this.inCircle(e,i,r,h)<=0)return t;if(this.deleteTwinEdges(t,s),!s){const e=this.getNextDEdge(t.second,n).twin;this.join(o.second,e,n,n,t)}t=o}}calculateCircleCenter(t,e=Number.MAX_VALUE){const i=this.getPointXYFromEdge(t),n=this.getPointXYFromEdge(t.twin),s=this.getNextDEdge(t,0);if(this.isInfinitePointFromEdge(s.twin)){const t=new g;if(Number.isNaN(e))t.setNAN();else{const s=n.sub(i);s.leftPerpendicularThis(),t.assign(s),t.divThis(Math.max(Math.abs(t.x),Math.abs(t.y))),t.normalize(),t.mulThis(e)}return t}const o=this.getPointXYFromEdge(s.twin);return this.calculateCircleCenterFromThreePoints(i,n,o)}createZeroHandle(){return this.m_points[0]}deleteEdge(t){const e=t,i=e.p;i.edge===t&&(i.edge=e.a[0]),e.a[0].a[1]=e.a[1],e.a[1].a[0]=e.a[0]}testEdge(t){if(this.isInfinitePointFromEdge(t))return!0;const e=t.twin;if(this.isInfinitePointFromEdge(e))return!0;const i=this.getNextDEdge(t,0).twin,n=this.getNextDEdge(e,0).twin;if(this.isInfinitePointFromEdge(i)||this.isInfinitePointFromEdge(n))return!0;const s=this.getPointXYFromEdge(t),o=this.getPointXYFromEdge(e),r=this.getPointXYFromEdge(i),h=this.getPointXYFromEdge(n);return!(this.orientation(s,o,r)<=0)&&(!(0<=this.orientation(s,o,h))&&this.inCircle(s,o,r,h)<=0)}findMaxSide(t,e){const i=[this.m_points[t].p.clone(),this.m_points[t].p.clone()];for(t++;t!==e;t++){const e=this.m_points[t].p;e.x<i[0].x&&(i[0].x=e.x),i[1].x<e.x&&(i[1].x=e.x),e.y<i[0].y&&(i[0].y=e.y),i[1].y<e.y&&(i[1].y=e.y)}return i[1].x-i[0].x<i[1].y-i[0].y?1:0}findEdge(t,e,i){let n=!1,s=0;for(;;){const o=y(null,null);if(o.second=this.getNextDEdge(t[s].second,i^s),o.first=o.second.twin,0===i&&this.orientation(this.getPointXYFromEdge(t[0].first),this.getPointXYFromEdge(t[1].first),this.getPointXYFromEdge(o.first))<0||1===i&&0<this.orientation(this.getPointXYFromEdge(t[0].first),this.getPointXYFromEdge(t[1].first),this.getPointXYFromEdge(o.first)))t[s]=o,e[s]=!0,n=!1;else{if(n)return;s^=1,n=!0}}}findEdgeSide(t,e,i,n){for(;;){const s=y(null,null);if(s.second=this.getNextDEdge(t[i].second,n^i),s.first=s.second.twin,!(0===n&&this.orientation(this.getPointXYFromEdge(t[0].first),this.getPointXYFromEdge(t[1].first),this.getPointXYFromEdge(s.first))<0||1===n&&0<this.orientation(this.getPointXYFromEdge(t[0].first),this.getPointXYFromEdge(t[1].first),this.getPointXYFromEdge(s.first))))return;t[i]=s,e[i]=!0}}merge(t,e,i,n,s){const o={...t},r={...n},h={...s};let d={...e},g={...i};const a=d.second,c=g.second;for(;;){if(this.join(d.first,g.first,0,1,h),d.first=this.getNextDEdge(h.first,0),g.first=this.getNextDEdge(h.second,1),d.first===o.first&&g.first===r.first){this.joinEdges2(a,c),this.joinEdges2(r.second,o.second);break}d.second=d.first.twin,g.second=g.first.twin;const t=this.getPointXYFromEdge(h.first),e=this.getPointXYFromEdge(h.second);if(d.first===o.first){let i=y(null,null);i.first=this.getNextDEdge(g.first,1),i.second=i.first.twin,i=this.checkEdge(i,t,e,1,!1),C(d,h),C(h,g),g=y(i.second,i.first)}else if(g.first===r.first){let i=y(null,null);i.first=this.getNextDEdge(d.first,0),i.second=i.first.twin,i=this.checkEdge(i,t,e,0,!1),g=y(h.second,h.first),C(h,d),d=y(i.second,i.first)}else{let i=y(null,null);i.first=this.getNextDEdge(d.first,0),i.second=i.first.twin,i=this.checkEdge(i,t,e,0,!1);let n=y(null,null);n.first=this.getNextDEdge(g.first,1),n.second=n.first.twin,n=this.checkEdge(n,t,e,1,!1);const s=this.getPointXYFromEdge(i.second),o=this.getPointXYFromEdge(n.second);let r=this.inCircle(t,e,s,o);0===r&&(r=this.orientation(t,e,o)),0<r?(C(d,h),C(h,g),g=y(n.second,n.first)):(g=y(h.second,h.first),C(h,d),d=y(i.second,i.first))}this.deleteTwinEdges(h,!1)}}findEdgeClockwise(t,e,i,n,s,o){for(t[0]=n;;){e[0]=t[0],++e[0]===i.length&&(e[0]=0);const n=this.orientation(s,o,this.getPointXYFromEdge(i[e[0]]));if(n<=0)return n<0;t[0]=e[0]}}findEdgeCounterClockwise(t,e,i,n,s,o){for(e[0]=n;;){t[0]=0!==e[0]?e[0]:i.length,t[0]--;const n=this.orientation(s,o,this.getPointXYFromEdge(i[t[0]]));if(0<=n)return 0<n;e[0]=t[0]}}constraintFindFirstEdge(t,e,i,n){const s=[];{const o=this.getEdgeFromPoint(i);let r=o;do{const i=this.getTwinEdge(r);if(this.getPointFromEdge(i)===n)return t[0]=i,e[0]=r,t[0].setMask(),e[0].setMask(),!1;s.push(i),r=this.getClockwiseEdge(r)}while(r!==o)}s.length<3&&r("add_constraint");let o=-1;for(let c=0,l=s.length;c<l;c++)this.isInfinitePointFromEdge(s[c])&&(-1!==o&&r("add_constraint"),o=c);const h=this.getPointXY(i),d=this.getPointXY(n);let g,a;if(-1!==o){x(s,0,o+1,s.length),s.pop();0===this.orientation(h,d,this.getPointXYFromEdge(s[0]))&&r("add_constraint - point on constraint");for(0===this.orientation(h,d,this.getPointXYFromEdge(s.at(-1)))&&r("add_constraint - point on constraint"),g=0,a=s.length-1;g+1!==a;){const t=g+a>>1,e=this.orientation(h,d,this.getPointXYFromEdge(s[t]));0===e&&r("add_constraint - point on constraint"),0<e?g=t:a=t}}else{let t=0,e=this.orientation(h,d,this.getPointXYFromEdge(s[t]));if(0!==e)if(0<e){const e=[0],i=[0];this.findEdgeClockwise(e,i,s,t,h,d)||r("add_constraint"),g=e[0],a=i[0]}else{const e=[0],i=[0];this.findEdgeCounterClockwise(e,i,s,t,h,d)||r("add_constraint"),g=e[0],a=i[0]}else{t++,e=this.orientation(h,d,this.getPointXYFromEdge(s[t])),e<=0&&r("add_constraint");const i=[0],n=[0];this.findEdgeClockwise(i,n,s,t,h,d)||r("add_constraint"),g=i[0],a=n[0]}}return t[0]=s[g],e[0]=s[a],!0}triangulateConstraint(t,e,i,n){if(e===i)return;let s=i;for(let o=e;o!==i;++o)this.inCircle(this.getPointXYFromEdge(n.first),this.getPointXYFromEdge(n.second),this.getPointXYFromEdge(t[s]),this.getPointXYFromEdge(t[o]))<0&&(s=o);if(s!==i){const e=this.newPairEdge();this.join(n.first,t[s],1,1,e),t[s]=e.second,this.triangulateConstraint(t,s+1,i,e)}if(s!==e){const i=this.newPairEdge();this.join(t[s],n.second,1,0,i),this.triangulateConstraint(t,e,s-1,i)}}insideLine(t,e,i){return 0===this.orientation(t,e,i)&&(e.x<t.x!=e.x<i.x||e.y<t.y!=e.y<i.y)}orientation(t,e,i){return g.orientationRobust(t,e,i)}inCircle(t,e,i,n){return g.inCircleRobust(t,e,i,n)}calculateCircleCenterFromThreePoints(t,e,i){return e.lt(t)&&(e=f(t,t=e)),i.lt(e)&&(i=f(e,e=i)),e.lt(t)&&(e=f(t,t=e)),g.calculateCircleCenterFromThreePoints(t,e,i)}compare(t,e){return 3*((j(t[0]<e[0])<<1)+j(t[0]>e[0]))+(j(t[1]<e[1])<<1)+j(t[1]>e[1])-1}caseFromCompare(t,e,i){return(this.compare(t,e)<<6)+(this.compare(t,i)<<3)+this.compare(e,i)}}function j(t){return t?1:0}function A(t,e,i){return t[i]!==e[i]?t[i]<e[i]:t[1-i]<e[1-i]}function v(t){return 255&t}N.c_aTableDelaunayTriangulationSolution=Uint8Array.from([41,74,0,0,0,0,0,0,0,206,0,0,0,0,0,0,0,0,0,0,65,0,0,0,0,0,33,33,65,0,0,0,0,0,0,0,193,0,0,0,0,0,0,0,0,0,0,214,0,0,0,0,0,86,54,86,0,0,0,0,0,0,0,214,173,0,0,0,0,0,0,0,107,239,0,0,0,0,0,0,0,0,0,181,0,0,0,0,0,0,0,181,0,0,0,0,0,0,117,117,245,0,0,0,0,0,0,0,0,0,103,0,0,0,0,0,0,0,167,0,0,0,0,0,0,231,103,231,0,0,0,0,0,0,50,0,0,0,0,0,0,0,0,198,0,0,41,0,0,74,0,0,49,0,0,49,0,0,50,0,0,194,0,0,193,0,0,194,0,0,0,0,0,206,0,0,0,0,0,0,0,0,54,0,0,0,0,0,0,0,0,198,0,0,0,0,0,82,50,82,0,0,0,0,0,0,0,198,0,66,0,0,65,0,0,66,49,66,33,57,65,82,50,90,0,194,0,0,193,0,0,194,0,0,0,0,0,0,0,214,0,0,0,0,0,86,54,86,0,0,0,0,0,0,0,222,0,0,0,0,0,0,178,0,0,0,0,0,0,230,102,230,177,0,0,177,0,0,178,0,177,0,0,177,0,0,178,0,113,226,113,113,249,226,122,226,0,0,0,0,0,0,102,0,0,0,0,0,0,0,190,0,0,0,0,0,0,230,102,230,0,0,0,165,0,0,0,0,0,0,0,0,243,0,0,0,0,0,173,0,0,0,0,0,0,0,0,165,0,0,0,0,0,0,0,0,245,0,0,0,0,0,107,0,0,239,0,0,163,0,0,163,0,0,167,0,0,247,0,0,243,0,0,247,0,0,37,37,69,0,0,0,0,0,0,0,211,0,0,0,0,0,0,0,69,0,0,0,0,0,37,37,69,0,0,0,0,0,0,0,221,0,0,0,0,215,0,0,211,0,0,215,35,87,35,35,91,87,63,87,0,215,0,0,211,0,0,215,0,0,0,165,0,0,0,0,0,0,115,115,243,0,0,0,0,0,0,181,0,0,0,0,0,0,0,189,0,0,0,0,0,0,117,117,245,0,0,0,99,0,0,99,0,0,103,0,163,0,0,163,0,0,167,0,99,247,115,123,243,231,103,255]);class M{constructor(t){this.m_numberOfSets=t,this.m_elements=Array.from({length:t},(t,e)=>e),this.m_sizes=c(t,1)}getNumberOfSets(){return this.m_numberOfSets}connected(t,e){return this.findRoot(t)===this.findRoot(e)}connect(t,e){const i=this.findRoot(t),n=this.findRoot(e);return i!==n&&(this.m_sizes[i]<this.m_sizes[n]?(this.m_sizes[n]+=this.m_sizes[i],this.m_elements[i]=n):(this.m_sizes[i]+=this.m_sizes[n],this.m_elements[n]=i),--this.m_numberOfSets,!0)}connectRange(t,e,i){if(e!==i)for(let n=e;n<i;++n)this.connect(t[e],t[n])}size(){return this.m_elements.length}size1(t){return h(0),0}findRoot(t){let e=t;if(this.m_elements[e]!==e)do{this.m_elements[e]=this.m_elements[this.m_elements[e]],e=this.m_elements[e]}while(this.m_elements[e]!==e);return e}}function S(){return l(Number.NaN,l([0,0,0],[0,0,0]))}function G(t,e){if(t.first!==e.first)return t.first-e.first;let i=t.second.first,n=e.second.first;for(let s=0;s<3;++s)if(i[s]!==n[s])return i[s]-n[s];i=t.second.second,n=e.second.second;for(let s=0;s<3;++s)if(i[s]!==n[s])return i[s]-n[s];return 0}class q{getOperatorType(){return 10112}accelerateGeometry(t,e,i){return!1}canAccelerateGeometry(t){return!1}supportsCurves(){return!1}executeMany(t,e,i,n){return new V(t,e,i,n)}execute(t,e,i,n=null){const s=new V(null,e,!1,i);s.addGeometry(t);return s.buildAlphaShape(n)}}class V extends t{alphaShapeConstruct(t,e){const i=t.getEdgeCount(),n=new p({vd:this.m_vertexDescription});if(!n)throw new Error("alphaShapeConstruct");for(let s=0;s<i;++s){if(2!==e[s])continue;const i=y(null,null);i.first=t.getEdge(s),i.second=t.getTwinEdge(i.first);if(1!==e[t.getEdgeIndex(i.second)])continue;t.getPointXYFromEdge(i.first),n.startPath(t.getPointXYFromEdge(i.first));let o=s,r=i.second;for(;;){for(e[o]=3,r=t.getCounterClockwiseEdge(r);1===e[t.getEdgeIndex(r)];)r=t.getCounterClockwiseEdge(r);if(r===i.first)break;n.lineTo(t.getPointXYFromEdge(r)),o=t.getEdgeIndex(r),r=t.getTwinEdge(r)}}return n}alphaShape(t,e){const i=t.getEdgeCount(),n=new Uint8Array(i);for(let s=0;s<i;++s){if(0!==n[s])continue;const i=Y(),o=t.getEdge(s);i.p[0]=t.getPointFromEdge(o);const r=t.getClockwiseEdge(t.getTwinEdge(o));i.p[1]=t.getPointFromEdge(r);const h=t.getEdgeIndex(r),a=t.getClockwiseEdge(t.getTwinEdge(r));i.p[2]=t.getPointFromEdge(a);const c=t.getEdgeIndex(a);let l=1;for(let e=0;e<3;++e)if(t.isInfinitePointFromPoint(i.p[e])){l=2;break}if(1===l){const n=d(g,3);for(let e=0;e<3;++e)n[e]=t.getPointXY(i.p[e]);const s=g.sqrDistance(n[0],n[1]),o=g.sqrDistance(n[1],n[2]),r=g.sqrDistance(n[2],n[0]),h=2*n[1].sub(n[0]).crossProduct(n[2].sub(n[0]));e<s*o*r/(h*h)&&(l=2)}n[s]=n[h]=n[c]=l}return this.alphaShapeConstruct(t,n)}alphaShapeAlphaOut(t,e){const i=t.getEdgeCount(),n=new Uint8Array(i),s=[],o=new M(t.getPointCount());for(let h=0;h<i;++h){if(0!==n[h])continue;const e=Y(),i=t.getEdge(h);e.p[0]=t.getPointFromEdge(i);const o=t.getClockwiseEdge(t.getTwinEdge(i));e.p[1]=t.getPointFromEdge(o);const r=t.getEdgeIndex(o),d=t.getClockwiseEdge(t.getTwinEdge(o));e.p[2]=t.getPointFromEdge(d);const a=t.getEdgeIndex(d);let c=1;for(let n=0;n<3;++n)if(t.isInfinitePointFromPoint(e.p[n])){c=2;break}if(1===c){const i=new Array(3);for(let s=0;s<3;++s)i[s]=t.getPointXY(e.p[s]);const n=g.sqrDistance(i[0],i[1]),o=g.sqrDistance(i[1],i[2]),d=g.sqrDistance(i[2],i[0]),l=i[1].sub(i[0]).crossProduct(i[2].sub(i[0])),u=S();u.first=n*o*d/(l*l),u.second.first[0]=h,u.second.first[1]=r,u.second.first[2]=a,u.second.second[0]=t.getPointIndex(e.p[0]),u.second.second[1]=t.getPointIndex(e.p[1]),u.second.second[2]=t.getPointIndex(e.p[2]),s.push(u),c=2}n[h]=n[r]=n[a]=c}s.sort((t,e)=>G(t,e));let r=0;for(const h of s){if(1===o.getNumberOfSets()&&h.first!==r)break;n[h.second.first[0]]=n[h.second.first[1]]=n[h.second.first[2]]=1;const t=[h.second.second[0],h.second.second[1],h.second.second[2]];o.connectRange(t,0,3),r=h.first}return e&&(e[0]=.25*r),this.alphaShapeConstruct(t,n)}constructor(t,e,i,n){super(),this.m_multiPointForAttributes=null,this.m_inputGeometryCursor=null,this.m_index=-1,this.m_nDelaunayPoints=0,this.m_cDelaunay=new N,this.m_vertexDescription=null,this.m_progressTracker=n,this.m_alpha=Number.isNaN(e)||!Number.isFinite(e)||e<0?-1:e<Number.MIN_VALUE?0:e,this.m_bMerge=i,this.m_bDone=!1,this.m_inputGeometryCursor=t,this.prepareDelaunay()}prepareDelaunay(){this.m_nDelaunayPoints=0,this.m_cDelaunay.clear(),0!==this.m_alpha&&this.m_cDelaunay.prepare(a())}next(){if(this.m_bMerge){if(!this.m_bDone){const t=this.calculateAlphaShapeMerging(this.m_inputGeometryCursor,this.m_progressTracker);return this.m_bDone=!0,t}return null}if(!this.m_bDone){const t=this.m_inputGeometryCursor.next();if(null!==t)return i(t),n(t),this.m_index=this.m_inputGeometryCursor.getGeometryID(),this.calculateAlphaShape(t,this.m_progressTracker);this.m_bDone=!0}return null}tock(){return!0}getRank(){return 1}getGeometryID(){return this.m_index}calculateAlphaShapeMerging(t,e){let s;for(;s=t.next();)i(s),n(s),this.addGeometry(s);return this.buildAlphaShape()}calculateAlphaShape(t,e){return t.isEmpty()?new p({vd:t.getDescription()}):(this.prepareDelaunay(),this.addGeometry(t),this.buildAlphaShape())}buildAlphaShape(t=null){if(t&&(t[0]=this.m_alpha),0===this.m_alpha)return this.m_vertexDescription?new p({vd:this.m_vertexDescription}):new p;if(this.m_cDelaunay.removeDuplicates())for(let e=0,i=this.m_cDelaunay.getPointCount();e<i;++e)this.m_cDelaunay.setPointIndex(this.m_cDelaunay.getPoint(e),e);if(!this.m_cDelaunay.construct())return this.m_vertexDescription?new p({vd:this.m_vertexDescription}):new p;return this.m_alpha<0?this.alphaShapeAlphaOut(this.m_cDelaunay,t):this.alphaShape(this.m_cDelaunay,this.m_alpha)}addGeometry(t){if(i(t),n(t),0===this.m_alpha)return;if(this.m_vertexDescription&&this.m_bMerge||(this.m_vertexDescription=t.getDescription(),this.m_vertexDescription.getAttributeCount()>1?this.m_multiPointForAttributes=new E({vd:this.m_vertexDescription}):this.m_multiPointForAttributes=null),t.isEmpty())return;const e=t.getGeometryType();if(s(e)){const e=t,i=new g;for(let t=0,n=e.getPointCount();t<n;t++)e.queryXY(t,i),this.m_cDelaunay.addVertex(i,this.m_nDelaunayPoints++);this.m_multiPointForAttributes&&this.m_multiPointForAttributes.addPoints(e,0,-1)}else if(e===o.enumPoint){const e=t,i=e.getXY();this.m_cDelaunay.addVertex(i,this.m_nDelaunayPoints++),this.m_multiPointForAttributes&&this.m_multiPointForAttributes.add(e)}else r("bad geometry type")}}const z=new q;function O(t,e,i){return z.execute(t,e,null,i)}function Z(t,i,n){const s=z.executeMany(new e(t),i,n,null);return Array.from(s)}function R(){return z.supportsCurves()}export{O as execute,Z as executeMany,R as supportsCurves};
5
+ import{G as t,S as e}from"../../../chunks/SimpleGeometryCursor.js";import{o as i,c as n,i as s,G as o,a as r,g as h}from"../../../chunks/Geometry.js";import{m as d,P as g,i as a,d as c,l,u,c as f,v as m}from"../../../chunks/Point2D.js";import{a as p,M as E,r as x,h as P}from"../../../chunks/MultiPathImpl.js";function _(t,e,i,n,s,o){const r=n-e;if(r<=o)return P(t,e,i,n,s),i;const h=w(t,e,n,s,Math.min(Math.max(r>>1,3),100)),d=t[h];t[e]=f(t[h],t[h]=t[e]);let g=e+1,a=!1;for(let c=e+1;c!==n;++c)s(t[c],d)&&(t[g]=f(t[c],t[c]=t[g]),++g,a=!0);if(!a)for(let c=e+1;c<i;++c)s(d,t[c])||(c!==g&&(t[g]=f(t[c],t[c]=t[g])),++g);return--g,t[g]=f(t[e],t[e]=t[g]),g}function F(t,e,i){const n=Math.trunc(e/2);let s=BigInt(n);const o=BigInt(e);for(let h=0;h<i;++h)t.push(Number(s%o)),s=6364136223846793005n*s+1442695040888963407n&0x7fffffffffffffffn,s=BigInt.asUintN(64,s);m(t);const r=u(t,(t,e)=>t===e);t.length=r}function w(t,e,i,n,s){const o=[];F(o,i-e,s);const r=[];for(let d=0,g=o.length;d<g;d++){const i=o[d];r.push(l(t[e+i],i))}const h=Math.trunc(r.length/2);return r.sort((t,e)=>n(t.first,e.first)?-1:1),e+r[h].second}function k(){return{p:new g,userData:Number.NaN,edge:null}}class T{constructor(){this.info=0,this.mask=!1,this.p=null,this.a=[null,null],this.twin=null}nextFreeEdge(){return this.twin}setIndex(t){this.info=t,this.mask=!1}getIndex(){return this.info}setMask(){this.mask=!0}getMask(){return this.mask}}function y(t,e){return{first:t,second:e}}function C(t,e){t.first=e.first,t.second=e.second}function b(){return this.i1-this.i0}function D(){return{i0:Number.NaN,i1:Number.NaN,nextFreeEdgeIndex:[-1],box:[y(null,null),y(null,null)],size:b}}function I(){return{k:0,pTask:null,pTask0:null,pTask1:null}}function X(){return{p:[new g,new g],points:[null,null]}}function Y(){return{p:[null,null,null]}}class N{constructor(){this.m_nextFreePairEdge=y(null,null),this.m_points=[],this.m_pointZero=null,this.m_edges=[],this.m_voronoiToEdge=[],this.m_nextFreeEdge=0}clear(){this.m_nextFreePairEdge=y(null,null),this.m_points.length=0,this.m_pointZero=null,this.m_edges.length=0,this.m_voronoiToEdge.length=0,this.m_nextFreeEdge=0}reservePoints(t){h(t>1)}prepare(t){{const e=k();e.p.x=Number.POSITIVE_INFINITY,e.p.y=Number.POSITIVE_INFINITY,e.userData=t,this.m_points.push(e)}}addVertex(t,e){const i=k();i.p.assign(t),i.userData=e,i.edge=null,this.m_points.push(i)}removeDuplicates(){const t=this.m_points.shift();this.m_points.sort((t,e)=>t.p.compareX(e.p));const e=u(this.m_points,(t,e)=>t.p.equals(e.p)),i=e!==this.m_points.length;return this.m_points.length=e,this.m_points.unshift(t),i}boundVoronoiCells(t,e){const i=this.m_points.length;if(i<2)return!1;const n=[this.m_points[1].p.clone(),this.m_points[1].p.clone()];for(let d=2;d<i;d++){const t=this.m_points[d].p;t.x<n[0].x&&(n[0].x=t.x),n[1].x<t.x&&(n[1].x=t.x),t.y<n[0].y&&(n[0].y=t.y),n[1].y<t.y&&(n[1].y=t.y)}const s=new g;s.x=.5*(n[0].x+n[1].x),s.y=.5*(n[0].y+n[1].y);let o=0;for(let d=1;d<i;d++){const t=this.m_points[d].p,e=g.sqrDistanceCoords(t.x,t.y,s.x,s.y);o<e&&(o=e)}const r=Math.sqrt(o),h=Math.max(r+2*t,1.5*r);{const t=.8660254037844386,i=.5;let n=1,o=0;for(let r=0;r<12;r++){const r=new g;r.x=s.x+h*n,r.y=s.y+h*o,this.addVertex(r,e);const d=n*i+o*t;n=n*t-o*i,o=d}}return!0}construct(){const t=D();return!!this.constructTask(t)&&(this.solveTask(t),!0)}constructTask(t){if(this.m_pointZero=this.createZeroHandle(),h(void 0!==this.m_pointZero),this.m_points.length<3)return!1;const e=6*(this.m_points.length-2);this.m_edges=d(T,e);for(let i=0;i<e;i++)this.m_edges[i].setIndex(i);return t.i0=1,t.i1=this.m_points.length,t.nextFreeEdgeIndex[0]=0,!0}splitTask(t,e,i,n){const s=t,o=e,r=i,h=n;s.k=this.findMaxSide(h.i0,h.i1);let d=h.i0+h.i1>>1;const g=1250;if(0===s.k){d=_(this.m_points,h.i0,d,h.i1,(t,e)=>t.p[0]!==e.p[0]?t.p[0]<e.p[0]:t.p[1]<e.p[1],g)}else{d=_(this.m_points,h.i0,d,h.i1,(t,e)=>t.p[1]!==e.p[1]?t.p[1]<e.p[1]:t.p[0]<e.p[0],g)}o.i0=h.i0,o.i1=d,o.nextFreeEdgeIndex[0]=h.nextFreeEdgeIndex[0],h.nextFreeEdgeIndex[0]+=6*(o.i1-o.i0-1)+2,r.i0=d,r.i1=h.i1,r.nextFreeEdgeIndex[0]=h.nextFreeEdgeIndex[0],h.nextFreeEdgeIndex[0]+=6*(r.i1-r.i0-1)+2,s.pTask=h,s.pTask0=o,s.pTask1=r}solveMergeTask(t){const e=this.newPairEdgeEx(t.pTask.nextFreeEdgeIndex,!1);if(t.pTask.box[t.k]=y(t.pTask0.box[t.k].first,t.pTask1.box[t.k].second),t.pTask.box[1-t.k]=y(A(this.getPointXYFromEdge(t.pTask0.box[1-t.k].first),this.getPointXYFromEdge(t.pTask1.box[1-t.k].first),1-t.k)?t.pTask0.box[1-t.k].first:t.pTask1.box[1-t.k].first,A(this.getPointXYFromEdge(t.pTask0.box[1-t.k].second),this.getPointXYFromEdge(t.pTask1.box[1-t.k].second),1-t.k)?t.pTask1.box[1-t.k].second:t.pTask0.box[1-t.k].second),t.pTask.i0+2===t.pTask.i1){const i=t.pTask0.box[t.k].second,n=i.twin,s=t.pTask1.box[t.k].first,o=s.twin;return this.joinEdges2(n,o),this.joinEdges2(o,n),void this.join(i,s,0,1,e)}const i=[new Array(2),new Array(2)];i[0][0]=i[1][0]=y(t.pTask0.box[t.k].second,t.pTask0.box[t.k].second.twin),i[0][1]=i[1][1]=y(t.pTask1.box[t.k].first,t.pTask1.box[t.k].first.twin);const n=[!1,!1];if(t.pTask0.i0+1===t.pTask0.i1?(this.findEdgeSide(i[0],n,1,0),this.findEdgeSide(i[1],n,1,1)):(this.findEdge(i[0],n,0),this.findEdge(i[1],n,1)),n[0]||n[1]){if(n[0]){const e=this.newPairEdgeEx(t.pTask0.nextFreeEdgeIndex,!1);this.insertEdge(i[0][0].first,e.first,0),this.insertEdge(i[0][0].second,e.second,1)}if(n[1]){const e=this.newPairEdgeEx(t.pTask1.nextFreeEdgeIndex,!1);this.insertEdge(i[0][1].first,e.first,1),this.insertEdge(i[0][1].second,e.second,0)}}else this.getNextDEdge(i[0][0].first,0)!==i[0][0].first&&(i[1][0]=this.newPairEdgeEx(t.pTask0.nextFreeEdgeIndex,!1),this.insertEdge(i[0][0].first,i[1][0].first,0),this.insertEdge(i[0][0].second,i[1][0].second,1)),this.getNextDEdge(i[0][1].first,0)!==i[0][1].first&&(i[1][1]=this.newPairEdgeEx(t.pTask1.nextFreeEdgeIndex,!1),this.insertEdge(i[0][1].first,i[1][1].first,1),this.insertEdge(i[0][1].second,i[1][1].second,0));this.merge(i[1][0],i[0][0],i[0][1],i[1][1],e)}solveTask(t){const e=t;switch(e.i1-e.i0){case 1:{this.insertPoint(e.i0,e.nextFreeEdgeIndex);const t=this.m_points[e.i0].edge;e.box[0]=e.box[1]=l(t,t)}break;case 2:{const t=e.i0,i=t+1;this.insertPoint(t,e.nextFreeEdgeIndex),this.insertPoint(i,e.nextFreeEdgeIndex);const n=this.m_points[t],s=this.m_points[i],o=n.edge,r=s.edge,h=o.twin,d=r.twin;this.joinEdges2(h,d),this.joinEdges2(d,h);const g=this.newPairEdgeEx(e.nextFreeEdgeIndex,!1);this.join(o,r,0,1,g);for(let a=0;a<2;a++)e.box[a]=A(this.getPointXY(n),this.getPointXY(s),a)?y(o,r):y(r,o)}break;case 3:{const t=[e.i0,e.i0+1,e.i0+2];this.insertPoint(t[0],e.nextFreeEdgeIndex),this.insertPoint(t[1],e.nextFreeEdgeIndex),this.insertPoint(t[2],e.nextFreeEdgeIndex);const i=[this.m_points[t[0]],this.m_points[t[1]],this.m_points[t[2]]],n=this.caseFromCompare(i[0].p,i[1].p,i[2].p),s=[i[0].edge,i[1].edge,i[2].edge],o=N.c_aTableDelaunayTriangulationSolution[n],r=v(19*v(1+(7&o))),h=v(19*v(1+(o>>5)));let d=v(o<<3)>>6;const g=3&r,a=r>>6,c=3&h,l=h>>6;e.box[0]=y(s[g],s[a]),e.box[1]=y(s[c],s[l]);const u=[s[0].twin,s[1].twin,s[2].twin],m=[this.newPairEdgeEx(e.nextFreeEdgeIndex,!1),this.newPairEdgeEx(e.nextFreeEdgeIndex,!1),this.newPairEdgeEx(e.nextFreeEdgeIndex,!1)];switch(3===d&&(d=this.orientation(i[0].p,i[1].p,i[2].p)+1),d){case 0:this.joinEdges2(u[0],u[2]),this.joinEdges2(u[2],u[1]),this.joinEdges2(u[1],u[0]),this.join(s[0],s[2],0,1,m[0]),this.join(s[2],s[1],0,1,m[1]),this.join(s[1],s[0],0,1,m[2]);break;case 1:{const t=[0,1,2];t[3-(g+a)]=f(t[1],t[1]=t[3-(g+a)]),this.joinEdges2(u[t[0]],u[t[1]]),this.joinEdges2(u[t[1]],u[t[2]]),this.joinEdges2(u[t[2]],u[t[0]]),this.join(s[t[0]],s[t[1]],0,1,m[0]),this.join(s[t[1]],s[t[2]],0,1,m[1]),this.join(m[1].first,u[t[2]],0,1,m[2])}break;case 2:this.joinEdges2(u[0],u[1]),this.joinEdges2(u[1],u[2]),this.joinEdges2(u[2],u[0]),this.join(s[0],s[1],0,1,m[0]),this.join(s[1],s[2],0,1,m[1]),this.join(s[2],s[0],0,1,m[2])}}break;default:{const e=I(),i=D(),n=D();this.splitTask(e,i,n,t),this.solveTask(i),this.solveTask(n),this.solveMergeTask(e)}}}getOutsideHull(){const t=[],e=this.m_points[0].edge;let i=e;do{t.push(this.getPointFromEdge(this.getTwinEdge(i))),i=this.getNextDEdge(i,0)}while(i!==e);return t}getConvexHull(){const t=[],e=this.m_points[0].edge;let i=e;do{const e=this.getPointFromEdge(this.getTwinEdge(i));t.length<2||!this.insideLine(this.getPointXY(t.at(-2)),this.getPointXY(t.at(-1)),this.getPointXY(e))?t.push(e):t[t.length-1]=e,i=this.getNextDEdge(i,0)}while(i!==e);return 2<t.length&&this.insideLine(this.getPointXY(t[0]),this.getPointXY(t.at(-1)),this.getPointXY(t.at(-2)))&&t.pop(),2<t.length&&this.insideLine(this.getPointXY(t[1]),this.getPointXY(t[0]),this.getPointXY(t.at(-1)))&&(t[0]=t.at(-1),t.pop()),t}getVoronoiPolygon(t,e){t.length=0;const i=this.getEdgeFromPoint(e);let n=i;for(;;){const e=this.calculateCircleCenter(n);t.push(e);const s=this.getNextDEdge(n,1);if(s===i)break;n=s}}getNearestPoint(t){this.isInfinitePointFromPoint(t)&&r("Not supported for the infinite point");const e=this.getPointXY(t);let i=this.m_pointZero,n=Number.MAX_VALUE;const s=this.getEdgeFromPoint(t);let o=s;do{const t=this.getPointFromEdge(this.getTwinEdge(o));if(!this.isInfinitePointFromPoint(t)){const s=g.sqrDistance(e,this.getPointXY(t));s<n&&(i=t,n=s)}o=this.getCounterClockwiseEdge(o)}while(o!==s);return i}addConstraint(t,e){const i=[null],n=[null];if(!this.constraintFindFirstEdge(i,n,t,e))return y(n[0],i[0]);i[0]=this.getTwinEdge(i[0]);const s=this.getPointXY(t),o=this.getPointXY(e),h=[new Array(0),new Array(0)],d=i[0];for(;;){const t=this.getClockwiseEdge(n[0]);t.getMask()&&r("add_constraint");const d=y(t,this.getTwinEdge(t));this.deleteTwinEdges(d,!0);const g=this.getCounterClockwiseEdge(this.getTwinEdge(i[0])),a=this.getTwinEdge(this.getClockwiseEdge(n[0])),c=this.getPointFromEdge(a);if(c===e){h[0].push(i[0]),i[0]=g,h[1].push(n[0]),n[0]=a;break}const l=this.orientation(s,o,this.getPointXY(c));0===l&&r("add_constraint - point on constraint"),0<l?(h[0].push(i[0]),i[0]=g):(h[1].push(n[0]),n[0]=a)}h[0].push(i[0]),h[1].push(n[0]);const g=this.newPairEdge();g.first.setMask(),g.second.setMask(),this.join(n[0],d,1,1,g),this.triangulateConstraint(h[0],1,h[0].length-1,g),h[1].reverse();const a=y(g.second,g.first);return this.triangulateConstraint(h[1],1,h[1].length-1,a),a}verify(){for(let t=0,e=this.m_edges.length;t<e;t++){const e=this.m_edges[t];if(!e.getMask()&&!this.testEdge(e))return!1}return!0}getDelaunayTriangleCount(){return this.m_points.length-2<<1}getVoronoiSegments(t=Number.MAX_VALUE){const e=[];for(let i=0,n=this.m_edges.length;i<n;i+=2){const n=y(null,null);if(n.first=this.m_edges[i],n.second=n.first.twin,this.isInfinitePointFromEdge(n.first)&&(n.second=f(n.first,n.first=n.second)),this.isInfinitePointFromEdge(n.second)){const i=d(g,3);i[0]=this.calculateCircleCenter(this.getNextDEdge(n.first,0).twin,1),i[2]=this.calculateCircleCenter(this.getNextDEdge(n.first,1),1);const s=d(g,2);s[0].assign(i[0]),s[1].assign(i[2]),s[0].rightPerpendicularThis(),s[1].leftPerpendicularThis(),i[1]=i[0].add(s[0]).add(i[2].add(s[1])),i[1].normalize();for(const e of i)e.mulThis(t);const o=X();o.points[0]=n.first.p,o.points[1]=n.second.p;for(let t=0;t<i.length-1;t++){for(let e=0;e<2;e++)o.p[e]=i[t+e];o.p[0].equals(o.p[1])||e.push(o)}}else if(this.isInfinitePointFromEdge(this.getNextDEdge(n.first,0).twin)&&this.isInfinitePointFromEdge(this.getNextDEdge(n.first,1).twin)){const t=d(g,3);t[0]=this.calculateCircleCenter(n.first),t[1]=this.getPointXY(this.getPointFromEdge(n.first)).add(this.getPointXY(this.getPointFromEdge(n.second))).mul(.5),t[2]=this.calculateCircleCenter(n.second);const i=X();i.points[0]=n.first.p,i.points[1]=n.second.p;for(let n=0;n<t.length-1;n++){for(let e=0;e<2;e++)i.p[e]=t[n+e];i.p[0].equals(i.p[1])||e.push(i)}}else{const t=X();t.p[0]=this.calculateCircleCenter(n.first),t.p[1]=this.calculateCircleCenter(n.second),t.points[0]=n.first.p,t.points[1]=n.second.p,t.p[0].equals(t.p[1])||e.push(t)}}return e}startDelaunayTriangles(){return-1}nextDelaunayTriangle(t,e){for(;;){if(++e[0],e[0]===this.m_edges.length)return!1;const i=this.m_edges[e[0]];if(t.p[0]=this.getPointFromEdge(i),this.isInfinitePointFromPoint(t.p[0]))continue;const n=this.getTwinEdge(i);if(t.p[1]=this.getPointFromEdge(n),this.isInfinitePointFromPoint(t.p[1]))continue;if(this.getPointXY(t.p[1]).lt(this.getPointXY(t.p[0])))continue;const s=this.getTwinEdge(this.getNextDEdge(i,1));if(t.p[2]=this.getPointFromEdge(s),!this.isInfinitePointFromPoint(t.p[2])&&!this.getPointXY(t.p[2]).lt(this.getPointXY(t.p[0])))return!0}}getPointCount(){return this.m_points.length-1}getPoint(t){return this.m_points[t+1]}getInfinitePoint(){return this.m_pointZero}isInfinitePointFromPoint(t){return t===this.m_pointZero}getPointXY(t){return t.p}getPointIndex(t){return t.userData}setPointIndex(t,e){t.userData=e}getEdgeFromPoint(t){return t.edge}isInfinitePointFromEdge(t){return t.p===this.m_pointZero}getEdgeCount(){return this.m_edges.length}getEdge(t){return this.m_edges[t]}getEdgeIndex(t){return t.getIndex()}getPointFromEdge(t){return t.p}getPointXYFromEdge(t){return t.p.p}getCounterClockwiseEdge(t){return t.a[0]}getClockwiseEdge(t){return t.a[1]}getTwinEdge(t){return t.twin}getPreviousEdge(t){return this.getTwinEdge(this.getCounterClockwiseEdge(t))}getNextEdge(t){return this.getClockwiseEdge(this.getTwinEdge(t))}getNextDEdge(t,e=1){return t.a[e]}newPairEdge(){const t=y(this.m_nextFreePairEdge.first,this.m_nextFreePairEdge.second);return this.m_nextFreePairEdge.first=this.m_nextFreePairEdge.first.nextFreeEdge(),this.m_nextFreePairEdge.second=this.m_nextFreePairEdge.second.nextFreeEdge(),t.first.twin=t.second,t.second.twin=t.first,t}newPairEdgeEx(t,e){let i;if(e&&null!==this.m_nextFreePairEdge.first)i=y(this.m_nextFreePairEdge.first,this.m_nextFreePairEdge.second),this.m_nextFreePairEdge.first=this.m_nextFreePairEdge.first.nextFreeEdge(),this.m_nextFreePairEdge.second=this.m_nextFreePairEdge.second.nextFreeEdge();else{const e=t[0]++,n=t[0]++;i=y(this.m_edges[e],this.m_edges[n])}return i.first.twin=i.second,i.second.twin=i.first,i}insertEdge(t,e,i){e.p=t.p;const n=t.a[i],s=e.a;s[i]=n,s[1-i]=t,t.a[i]=e,n.a[1-i]=e}insertPoint(t,e){const i=this.m_points[t],n=this.newPairEdgeEx(e,!1),s=n.first,o=n.second;i.edge=n.first,s.p=this.m_points[t],s.a[0]=n.first,s.a[1]=n.first,o.p=this.m_pointZero,o.a[0]=n.second,o.a[1]=n.second,null===this.m_points[0].edge&&(this.m_points[0].edge=n.second)}deleteTwinEdges(t,e){this.deleteEdge(t.first),this.deleteEdge(t.second),e&&(t.first.twin=this.m_nextFreePairEdge.first,t.second.twin=this.m_nextFreePairEdge.second,this.m_nextFreePairEdge=t)}join(t,e,i,n,s){this.insertEdge(t,s.first,i),this.insertEdge(e,s.second,n)}joinEdges2(t,e){t.a[1]=e,e.a[0]=t}checkEdge(t,e,i,n,s){for(;;){const o=y(null,null);if(o.first=this.getNextDEdge(t.first,n),o.second=o.first.twin,this.isInfinitePointFromEdge(o.second))return t;const r=this.getPointXYFromEdge(t.second),h=this.getPointXYFromEdge(o.second);if(this.inCircle(e,i,r,h)<=0)return t;if(this.deleteTwinEdges(t,s),!s){const e=this.getNextDEdge(t.second,n).twin;this.join(o.second,e,n,n,t)}t=o}}calculateCircleCenter(t,e=Number.MAX_VALUE){const i=this.getPointXYFromEdge(t),n=this.getPointXYFromEdge(t.twin),s=this.getNextDEdge(t,0);if(this.isInfinitePointFromEdge(s.twin)){const t=new g;if(Number.isNaN(e))t.setNAN();else{const s=n.sub(i);s.leftPerpendicularThis(),t.assign(s),t.divThis(Math.max(Math.abs(t.x),Math.abs(t.y))),t.normalize(),t.mulThis(e)}return t}const o=this.getPointXYFromEdge(s.twin);return this.calculateCircleCenterFromThreePoints(i,n,o)}createZeroHandle(){return this.m_points[0]}deleteEdge(t){const e=t,i=e.p;i.edge===t&&(i.edge=e.a[0]),e.a[0].a[1]=e.a[1],e.a[1].a[0]=e.a[0]}testEdge(t){if(this.isInfinitePointFromEdge(t))return!0;const e=t.twin;if(this.isInfinitePointFromEdge(e))return!0;const i=this.getNextDEdge(t,0).twin,n=this.getNextDEdge(e,0).twin;if(this.isInfinitePointFromEdge(i)||this.isInfinitePointFromEdge(n))return!0;const s=this.getPointXYFromEdge(t),o=this.getPointXYFromEdge(e),r=this.getPointXYFromEdge(i),h=this.getPointXYFromEdge(n);return!(this.orientation(s,o,r)<=0)&&(!(0<=this.orientation(s,o,h))&&this.inCircle(s,o,r,h)<=0)}findMaxSide(t,e){const i=[this.m_points[t].p.clone(),this.m_points[t].p.clone()];for(t++;t!==e;t++){const e=this.m_points[t].p;e.x<i[0].x&&(i[0].x=e.x),i[1].x<e.x&&(i[1].x=e.x),e.y<i[0].y&&(i[0].y=e.y),i[1].y<e.y&&(i[1].y=e.y)}return i[1].x-i[0].x<i[1].y-i[0].y?1:0}findEdge(t,e,i){let n=!1,s=0;for(;;){const o=y(null,null);if(o.second=this.getNextDEdge(t[s].second,i^s),o.first=o.second.twin,0===i&&this.orientation(this.getPointXYFromEdge(t[0].first),this.getPointXYFromEdge(t[1].first),this.getPointXYFromEdge(o.first))<0||1===i&&0<this.orientation(this.getPointXYFromEdge(t[0].first),this.getPointXYFromEdge(t[1].first),this.getPointXYFromEdge(o.first)))t[s]=o,e[s]=!0,n=!1;else{if(n)return;s^=1,n=!0}}}findEdgeSide(t,e,i,n){for(;;){const s=y(null,null);if(s.second=this.getNextDEdge(t[i].second,n^i),s.first=s.second.twin,!(0===n&&this.orientation(this.getPointXYFromEdge(t[0].first),this.getPointXYFromEdge(t[1].first),this.getPointXYFromEdge(s.first))<0||1===n&&0<this.orientation(this.getPointXYFromEdge(t[0].first),this.getPointXYFromEdge(t[1].first),this.getPointXYFromEdge(s.first))))return;t[i]=s,e[i]=!0}}merge(t,e,i,n,s){const o={...t},r={...n},h={...s};let d={...e},g={...i};const a=d.second,c=g.second;for(;;){if(this.join(d.first,g.first,0,1,h),d.first=this.getNextDEdge(h.first,0),g.first=this.getNextDEdge(h.second,1),d.first===o.first&&g.first===r.first){this.joinEdges2(a,c),this.joinEdges2(r.second,o.second);break}d.second=d.first.twin,g.second=g.first.twin;const t=this.getPointXYFromEdge(h.first),e=this.getPointXYFromEdge(h.second);if(d.first===o.first){let i=y(null,null);i.first=this.getNextDEdge(g.first,1),i.second=i.first.twin,i=this.checkEdge(i,t,e,1,!1),C(d,h),C(h,g),g=y(i.second,i.first)}else if(g.first===r.first){let i=y(null,null);i.first=this.getNextDEdge(d.first,0),i.second=i.first.twin,i=this.checkEdge(i,t,e,0,!1),g=y(h.second,h.first),C(h,d),d=y(i.second,i.first)}else{let i=y(null,null);i.first=this.getNextDEdge(d.first,0),i.second=i.first.twin,i=this.checkEdge(i,t,e,0,!1);let n=y(null,null);n.first=this.getNextDEdge(g.first,1),n.second=n.first.twin,n=this.checkEdge(n,t,e,1,!1);const s=this.getPointXYFromEdge(i.second),o=this.getPointXYFromEdge(n.second);let r=this.inCircle(t,e,s,o);0===r&&(r=this.orientation(t,e,o)),0<r?(C(d,h),C(h,g),g=y(n.second,n.first)):(g=y(h.second,h.first),C(h,d),d=y(i.second,i.first))}this.deleteTwinEdges(h,!1)}}findEdgeClockwise(t,e,i,n,s,o){for(t[0]=n;;){e[0]=t[0],++e[0]===i.length&&(e[0]=0);const n=this.orientation(s,o,this.getPointXYFromEdge(i[e[0]]));if(n<=0)return n<0;t[0]=e[0]}}findEdgeCounterClockwise(t,e,i,n,s,o){for(e[0]=n;;){t[0]=0!==e[0]?e[0]:i.length,t[0]--;const n=this.orientation(s,o,this.getPointXYFromEdge(i[t[0]]));if(0<=n)return 0<n;e[0]=t[0]}}constraintFindFirstEdge(t,e,i,n){const s=[];{const o=this.getEdgeFromPoint(i);let r=o;do{const i=this.getTwinEdge(r);if(this.getPointFromEdge(i)===n)return t[0]=i,e[0]=r,t[0].setMask(),e[0].setMask(),!1;s.push(i),r=this.getClockwiseEdge(r)}while(r!==o)}s.length<3&&r("add_constraint");let o=-1;for(let c=0,l=s.length;c<l;c++)this.isInfinitePointFromEdge(s[c])&&(-1!==o&&r("add_constraint"),o=c);const h=this.getPointXY(i),d=this.getPointXY(n);let g,a;if(-1!==o){x(s,0,o+1,s.length),s.pop();0===this.orientation(h,d,this.getPointXYFromEdge(s[0]))&&r("add_constraint - point on constraint");for(0===this.orientation(h,d,this.getPointXYFromEdge(s.at(-1)))&&r("add_constraint - point on constraint"),g=0,a=s.length-1;g+1!==a;){const t=g+a>>1,e=this.orientation(h,d,this.getPointXYFromEdge(s[t]));0===e&&r("add_constraint - point on constraint"),0<e?g=t:a=t}}else{let t=0,e=this.orientation(h,d,this.getPointXYFromEdge(s[t]));if(0!==e)if(0<e){const e=[0],i=[0];this.findEdgeClockwise(e,i,s,t,h,d)||r("add_constraint"),g=e[0],a=i[0]}else{const e=[0],i=[0];this.findEdgeCounterClockwise(e,i,s,t,h,d)||r("add_constraint"),g=e[0],a=i[0]}else{t++,e=this.orientation(h,d,this.getPointXYFromEdge(s[t])),e<=0&&r("add_constraint");const i=[0],n=[0];this.findEdgeClockwise(i,n,s,t,h,d)||r("add_constraint"),g=i[0],a=n[0]}}return t[0]=s[g],e[0]=s[a],!0}triangulateConstraint(t,e,i,n){if(e===i)return;let s=i;for(let o=e;o!==i;++o)this.inCircle(this.getPointXYFromEdge(n.first),this.getPointXYFromEdge(n.second),this.getPointXYFromEdge(t[s]),this.getPointXYFromEdge(t[o]))<0&&(s=o);if(s!==i){const e=this.newPairEdge();this.join(n.first,t[s],1,1,e),t[s]=e.second,this.triangulateConstraint(t,s+1,i,e)}if(s!==e){const i=this.newPairEdge();this.join(t[s],n.second,1,0,i),this.triangulateConstraint(t,e,s-1,i)}}insideLine(t,e,i){return 0===this.orientation(t,e,i)&&(e.x<t.x!=e.x<i.x||e.y<t.y!=e.y<i.y)}orientation(t,e,i){return g.orientationRobust(t,e,i)}inCircle(t,e,i,n){return g.inCircleRobust(t,e,i,n)}calculateCircleCenterFromThreePoints(t,e,i){return e.lt(t)&&(e=f(t,t=e)),i.lt(e)&&(i=f(e,e=i)),e.lt(t)&&(e=f(t,t=e)),g.calculateCircleCenterFromThreePoints(t,e,i)}compare(t,e){return 3*((j(t[0]<e[0])<<1)+j(t[0]>e[0]))+(j(t[1]<e[1])<<1)+j(t[1]>e[1])-1}caseFromCompare(t,e,i){return(this.compare(t,e)<<6)+(this.compare(t,i)<<3)+this.compare(e,i)}}function j(t){return t?1:0}function A(t,e,i){return t[i]!==e[i]?t[i]<e[i]:t[1-i]<e[1-i]}function v(t){return 255&t}N.c_aTableDelaunayTriangulationSolution=Uint8Array.from([41,74,0,0,0,0,0,0,0,206,0,0,0,0,0,0,0,0,0,0,65,0,0,0,0,0,33,33,65,0,0,0,0,0,0,0,193,0,0,0,0,0,0,0,0,0,0,214,0,0,0,0,0,86,54,86,0,0,0,0,0,0,0,214,173,0,0,0,0,0,0,0,107,239,0,0,0,0,0,0,0,0,0,181,0,0,0,0,0,0,0,181,0,0,0,0,0,0,117,117,245,0,0,0,0,0,0,0,0,0,103,0,0,0,0,0,0,0,167,0,0,0,0,0,0,231,103,231,0,0,0,0,0,0,50,0,0,0,0,0,0,0,0,198,0,0,41,0,0,74,0,0,49,0,0,49,0,0,50,0,0,194,0,0,193,0,0,194,0,0,0,0,0,206,0,0,0,0,0,0,0,0,54,0,0,0,0,0,0,0,0,198,0,0,0,0,0,82,50,82,0,0,0,0,0,0,0,198,0,66,0,0,65,0,0,66,49,66,33,57,65,82,50,90,0,194,0,0,193,0,0,194,0,0,0,0,0,0,0,214,0,0,0,0,0,86,54,86,0,0,0,0,0,0,0,222,0,0,0,0,0,0,178,0,0,0,0,0,0,230,102,230,177,0,0,177,0,0,178,0,177,0,0,177,0,0,178,0,113,226,113,113,249,226,122,226,0,0,0,0,0,0,102,0,0,0,0,0,0,0,190,0,0,0,0,0,0,230,102,230,0,0,0,165,0,0,0,0,0,0,0,0,243,0,0,0,0,0,173,0,0,0,0,0,0,0,0,165,0,0,0,0,0,0,0,0,245,0,0,0,0,0,107,0,0,239,0,0,163,0,0,163,0,0,167,0,0,247,0,0,243,0,0,247,0,0,37,37,69,0,0,0,0,0,0,0,211,0,0,0,0,0,0,0,69,0,0,0,0,0,37,37,69,0,0,0,0,0,0,0,221,0,0,0,0,215,0,0,211,0,0,215,35,87,35,35,91,87,63,87,0,215,0,0,211,0,0,215,0,0,0,165,0,0,0,0,0,0,115,115,243,0,0,0,0,0,0,181,0,0,0,0,0,0,0,189,0,0,0,0,0,0,117,117,245,0,0,0,99,0,0,99,0,0,103,0,163,0,0,163,0,0,167,0,99,247,115,123,243,231,103,255]);class M{constructor(t){this.m_numberOfSets=t,this.m_elements=Array.from({length:t},(t,e)=>e),this.m_sizes=c(t,1)}getNumberOfSets(){return this.m_numberOfSets}connected(t,e){return this.findRoot(t)===this.findRoot(e)}connect(t,e){const i=this.findRoot(t),n=this.findRoot(e);return i!==n&&(this.m_sizes[i]<this.m_sizes[n]?(this.m_sizes[n]+=this.m_sizes[i],this.m_elements[i]=n):(this.m_sizes[i]+=this.m_sizes[n],this.m_elements[n]=i),--this.m_numberOfSets,!0)}connectRange(t,e,i){if(e!==i)for(let n=e;n<i;++n)this.connect(t[e],t[n])}size(){return this.m_elements.length}size1(t){return h(0),0}findRoot(t){let e=t;if(this.m_elements[e]!==e)do{this.m_elements[e]=this.m_elements[this.m_elements[e]],e=this.m_elements[e]}while(this.m_elements[e]!==e);return e}}function S(){return l(Number.NaN,l([0,0,0],[0,0,0]))}function G(t,e){if(t.first!==e.first)return t.first-e.first;let i=t.second.first,n=e.second.first;for(let s=0;s<3;++s)if(i[s]!==n[s])return i[s]-n[s];i=t.second.second,n=e.second.second;for(let s=0;s<3;++s)if(i[s]!==n[s])return i[s]-n[s];return 0}class q{getOperatorType(){return 10112}accelerateGeometry(t,e,i){return!1}canAccelerateGeometry(t){return!1}supportsCurves(){return!1}executeMany(t,e,i,n){return new V(t,e,i,n)}execute(t,e,i,n=null){const s=new V(null,e,!1,i);s.addGeometry(t);return s.buildAlphaShape(n)}}class V extends t{alphaShapeConstruct(t,e){const i=t.getEdgeCount(),n=new p({vd:this.m_vertexDescription});if(!n)throw new Error("alphaShapeConstruct");for(let s=0;s<i;++s){if(2!==e[s])continue;const i=y(null,null);i.first=t.getEdge(s),i.second=t.getTwinEdge(i.first);if(1!==e[t.getEdgeIndex(i.second)])continue;t.getPointXYFromEdge(i.first),n.startPath(t.getPointXYFromEdge(i.first));let o=s,r=i.second;for(;;){for(e[o]=3,r=t.getCounterClockwiseEdge(r);1===e[t.getEdgeIndex(r)];)r=t.getCounterClockwiseEdge(r);if(r===i.first)break;n.lineTo(t.getPointXYFromEdge(r)),o=t.getEdgeIndex(r),r=t.getTwinEdge(r)}}return n}alphaShape(t,e){const i=t.getEdgeCount(),n=new Uint8Array(i);for(let s=0;s<i;++s){if(0!==n[s])continue;const i=Y(),o=t.getEdge(s);i.p[0]=t.getPointFromEdge(o);const r=t.getClockwiseEdge(t.getTwinEdge(o));i.p[1]=t.getPointFromEdge(r);const h=t.getEdgeIndex(r),a=t.getClockwiseEdge(t.getTwinEdge(r));i.p[2]=t.getPointFromEdge(a);const c=t.getEdgeIndex(a);let l=1;for(let e=0;e<3;++e)if(t.isInfinitePointFromPoint(i.p[e])){l=2;break}if(1===l){const n=d(g,3);for(let e=0;e<3;++e)n[e]=t.getPointXY(i.p[e]);const s=g.sqrDistance(n[0],n[1]),o=g.sqrDistance(n[1],n[2]),r=g.sqrDistance(n[2],n[0]),h=2*n[1].sub(n[0]).crossProduct(n[2].sub(n[0]));e<s*o*r/(h*h)&&(l=2)}n[s]=n[h]=n[c]=l}return this.alphaShapeConstruct(t,n)}alphaShapeAlphaOut(t,e){const i=t.getEdgeCount(),n=new Uint8Array(i),s=[],o=new M(t.getPointCount());for(let h=0;h<i;++h){if(0!==n[h])continue;const e=Y(),i=t.getEdge(h);e.p[0]=t.getPointFromEdge(i);const o=t.getClockwiseEdge(t.getTwinEdge(i));e.p[1]=t.getPointFromEdge(o);const r=t.getEdgeIndex(o),d=t.getClockwiseEdge(t.getTwinEdge(o));e.p[2]=t.getPointFromEdge(d);const a=t.getEdgeIndex(d);let c=1;for(let n=0;n<3;++n)if(t.isInfinitePointFromPoint(e.p[n])){c=2;break}if(1===c){const i=new Array(3);for(let s=0;s<3;++s)i[s]=t.getPointXY(e.p[s]);const n=g.sqrDistance(i[0],i[1]),o=g.sqrDistance(i[1],i[2]),d=g.sqrDistance(i[2],i[0]),l=i[1].sub(i[0]).crossProduct(i[2].sub(i[0])),u=S();u.first=n*o*d/(l*l),u.second.first[0]=h,u.second.first[1]=r,u.second.first[2]=a,u.second.second[0]=t.getPointIndex(e.p[0]),u.second.second[1]=t.getPointIndex(e.p[1]),u.second.second[2]=t.getPointIndex(e.p[2]),s.push(u),c=2}n[h]=n[r]=n[a]=c}s.sort((t,e)=>G(t,e));let r=0;for(const h of s){if(1===o.getNumberOfSets()&&h.first!==r)break;n[h.second.first[0]]=n[h.second.first[1]]=n[h.second.first[2]]=1;const t=[h.second.second[0],h.second.second[1],h.second.second[2]];o.connectRange(t,0,3),r=h.first}return e&&(e[0]=.25*r),this.alphaShapeConstruct(t,n)}constructor(t,e,i,n){super(),this.m_multiPointForAttributes=null,this.m_inputGeometryCursor=null,this.m_index=-1,this.m_nDelaunayPoints=0,this.m_cDelaunay=new N,this.m_vertexDescription=null,this.m_progressTracker=n,this.m_alpha=Number.isNaN(e)||!Number.isFinite(e)||e<0?-1:e<Number.MIN_VALUE?0:e,this.m_bMerge=i,this.m_bDone=!1,this.m_inputGeometryCursor=t,this.prepareDelaunay()}prepareDelaunay(){this.m_nDelaunayPoints=0,this.m_cDelaunay.clear(),0!==this.m_alpha&&this.m_cDelaunay.prepare(a())}next(){if(this.m_bMerge){if(!this.m_bDone){const t=this.calculateAlphaShapeMerging(this.m_inputGeometryCursor,this.m_progressTracker);return this.m_bDone=!0,t}return null}if(!this.m_bDone){const t=this.m_inputGeometryCursor.next();if(null!==t)return i(t),n(t),this.m_index=this.m_inputGeometryCursor.getGeometryID(),this.calculateAlphaShape(t,this.m_progressTracker);this.m_bDone=!0}return null}tock(){return!0}getRank(){return 1}getGeometryID(){return this.m_index}calculateAlphaShapeMerging(t,e){let s;for(;s=t.next();)i(s),n(s),this.addGeometry(s);return this.buildAlphaShape()}calculateAlphaShape(t,e){return t.isEmpty()?new p({vd:t.getDescription()}):(this.prepareDelaunay(),this.addGeometry(t),this.buildAlphaShape())}buildAlphaShape(t=null){if(t&&(t[0]=this.m_alpha),0===this.m_alpha)return this.m_vertexDescription?new p({vd:this.m_vertexDescription}):new p;if(this.m_cDelaunay.removeDuplicates())for(let e=0,i=this.m_cDelaunay.getPointCount();e<i;++e)this.m_cDelaunay.setPointIndex(this.m_cDelaunay.getPoint(e),e);if(!this.m_cDelaunay.construct())return this.m_vertexDescription?new p({vd:this.m_vertexDescription}):new p;return this.m_alpha<0?this.alphaShapeAlphaOut(this.m_cDelaunay,t):this.alphaShape(this.m_cDelaunay,this.m_alpha)}addGeometry(t){if(i(t),n(t),0===this.m_alpha)return;if(this.m_vertexDescription&&this.m_bMerge||(this.m_vertexDescription=t.getDescription(),this.m_vertexDescription.getAttributeCount()>1?this.m_multiPointForAttributes=new E({vd:this.m_vertexDescription}):this.m_multiPointForAttributes=null),t.isEmpty())return;const e=t.getGeometryType();if(s(e)){const e=t,i=new g;for(let t=0,n=e.getPointCount();t<n;t++)e.queryXY(t,i),this.m_cDelaunay.addVertex(i,this.m_nDelaunayPoints++);this.m_multiPointForAttributes&&this.m_multiPointForAttributes.addPoints(e,0,-1)}else if(e===o.enumPoint){const e=t,i=e.getXY();this.m_cDelaunay.addVertex(i,this.m_nDelaunayPoints++),this.m_multiPointForAttributes&&this.m_multiPointForAttributes.add(e)}else r("bad geometry type")}}const z=new q;function O(t,e,i){return z.execute(t,e,null,i)}function Z(t,i,n){const s=z.executeMany(new e(t),i,n,null);return Array.from(s)}function R(){return z.supportsCurves()}export{O as execute,Z as executeMany,R as supportsCurves};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{G as e,S as t}from"../../../chunks/SimpleGeometryCursor.js";import{r as s,G as r,c as i}from"../../../chunks/Geometry.js";import{E as m,n as o}from"../../../chunks/MultiPathImpl.js";import{Envelope2D as h}from"../../../chunks/Envelope2D.js";import{c as n,P as _}from"../../../chunks/Envelope.js";import{x as p,aQ as a,H as u,_ as l,Z as c,$ as y,aR as G,aS as g,a2 as d,aT as f}from"../../../chunks/UnitFactory.js";class x{getOperatorType(){return 10009}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,r=0){return new T(e,t,s,r)}}class T extends e{constructor(e,t,r,i){super(),this.m_shape=new m,this.m_currentGeom=o,this.m_progressCounter=0,this.m_geomIndex=-1,this.m_geomTypeIndex=-1,this.m_index=-1,this.m_bBuilt=!1,this.m_bOutputOnlyModified=!1,this.m_bSimplifyPolygons=!1,this.m_bSnapToSr=!1,this.m_progressTracker=r,this.m_inputGeometries=e,this.m_sr=t,this.m_options=i,1===i||2===i?(this.m_bOutputOnlyModified=!0,this.m_options=0,this.m_bSimplifyPolygons=!0,this.m_bSnapToSr=null!=t&&2===i,this.m_bSnapToSr&&!p()&&s("PE is required for snapping to spatial reference operation")):0===i&&(this.m_bSimplifyPolygons=!0)}progress_(e=!1){}tock(){return!0}getRank(){return 1}moveToNextGeom(){for(;;){if(this.m_bBuilt?this.m_currentGeom=this.m_shape.getNextGeometry(this.m_currentGeom):(this.m_currentGeom=this.m_shape.getFirstGeometry(),this.m_bBuilt=!0),this.m_currentGeom!==o){let e=!1;if(this.m_bSimplifyPolygons&&this.m_shape.getGeometryType(this.m_currentGeom)===r.enumPolygon&&(e=a(this.m_shape,this.m_currentGeom,-1,!1,o,this.m_progressTracker)),this.m_bOutputOnlyModified&&!e&&!this.m_shape.getGeometryModified(this.m_currentGeom))continue}break}}next(){if(this.m_bBuilt)this.moveToNextGeom();else{this.m_geomIndex=this.m_shape.createGeometryUserIndex();const e=new h;for(let o=this.m_inputGeometries.next();null!=o;o=this.m_inputGeometries.next()){this.progress_(),i(o);let t=!1;this.m_bSnapToSr&&(o=o.clone(),t=u(this.m_sr,o));const s=this.m_shape.addGeometry(o);this.m_shape.setGeometryUserIndex(s,this.m_geomIndex,this.m_inputGeometries.getGeometryID());const m=o.getGeometryType();m===r.enumPoint&&(-1===this.m_geomTypeIndex&&(this.m_geomTypeIndex=this.m_shape.createGeometryUserIndex()),this.m_shape.setGeometryUserIndex(s,this.m_geomTypeIndex,m));const n=new h;o.queryLooseEnvelope(n),e.mergeEnvelope2D(n),t&&this.m_shape.setGeometryModified(s,!0)}const t=n(this.m_sr,e,!0),s=n(this.m_sr,e,!1);e.inflate(10*t.total()),this.m_shape.forceSetEnvelope2D(e);let m=null,_=0,p=0;if(this.m_shape.hasCurves()){m=new d;const s=l(t.total(),e);_=c(t.total()),p=f(s,_),y(this.m_shape,s,t.total(),12e3,m,null,this.m_progressTracker)}if(G(this.m_shape,s,this.m_progressTracker)){if(g(this.m_shape,t.add(p),this.m_progressTracker,0===this.m_options,this.m_bOutputOnlyModified),null!==m){if(this.m_bSimplifyPolygons){for(let e=this.m_shape.getFirstGeometry();e!==o;e=this.m_shape.getNextGeometry(e))if(this.m_shape.getGeometryType(e)===r.enumPolygon){a(this.m_shape,e,-1,!1,o,this.m_progressTracker)&&this.m_shape.setGeometryModified(e,!0)}this.m_bSimplifyPolygons=!1}m.stitchCurves(this.m_shape,o,_,!0),m.clearStitcher(this.m_shape)}}else this.m_bSimplifyPolygons=!1,null!==m&&(m.stitchCurves(this.m_shape,o,_,!0),m.clearStitcher(this.m_shape));this.moveToNextGeom()}if(this.m_currentGeom!==o){if(this.m_index=this.m_shape.getGeometryUserIndex(this.m_currentGeom,this.m_geomIndex),-1!==this.m_geomTypeIndex&&this.m_shape.getGeometryUserIndex(this.m_currentGeom,this.m_geomTypeIndex)===r.enumPoint){const e=new _({vd:this.m_shape.getVertexDescription()});return this.m_shape.queryPointGeometryOnly(this.m_currentGeom,e),this.m_bSnapToSr&&u(this.m_sr,e),e}{const e=this.m_shape.getGeometry(this.m_currentGeom);return this.m_bSnapToSr&&u(this.m_sr,e),e}}return null}getGeometryID(){return this.m_index}}const S=new x;function b(e,s,r){const i=S.executeMany(new t(e),s,null,r);return Array.from(i)}function I(){return S.supportsCurves()}export{b as executeMany,I as supportsCurves};
5
+ import{G as e,S as t}from"../../../chunks/SimpleGeometryCursor.js";import{r as s,G as r,c as i}from"../../../chunks/Geometry.js";import{E as m,n as o}from"../../../chunks/MultiPathImpl.js";import{Envelope2D as h}from"../../../chunks/Envelope2D.js";import{c as n,P as _}from"../../../chunks/Envelope.js";import{k as p,aQ as a,s as u,_ as l,Z as c,$ as y,aR as G,aS as g,a2 as d,aT as f}from"../../../chunks/UnitFactory.js";class x{getOperatorType(){return 10009}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,r=0){return new T(e,t,s,r)}}class T extends e{constructor(e,t,r,i){super(),this.m_shape=new m,this.m_currentGeom=o,this.m_progressCounter=0,this.m_geomIndex=-1,this.m_geomTypeIndex=-1,this.m_index=-1,this.m_bBuilt=!1,this.m_bOutputOnlyModified=!1,this.m_bSimplifyPolygons=!1,this.m_bSnapToSr=!1,this.m_progressTracker=r,this.m_inputGeometries=e,this.m_sr=t,this.m_options=i,1===i||2===i?(this.m_bOutputOnlyModified=!0,this.m_options=0,this.m_bSimplifyPolygons=!0,this.m_bSnapToSr=null!=t&&2===i,this.m_bSnapToSr&&!p()&&s("PE is required for snapping to spatial reference operation")):0===i&&(this.m_bSimplifyPolygons=!0)}progress_(e=!1){}tock(){return!0}getRank(){return 1}moveToNextGeom(){for(;;){if(this.m_bBuilt?this.m_currentGeom=this.m_shape.getNextGeometry(this.m_currentGeom):(this.m_currentGeom=this.m_shape.getFirstGeometry(),this.m_bBuilt=!0),this.m_currentGeom!==o){let e=!1;if(this.m_bSimplifyPolygons&&this.m_shape.getGeometryType(this.m_currentGeom)===r.enumPolygon&&(e=a(this.m_shape,this.m_currentGeom,-1,!1,o,this.m_progressTracker)),this.m_bOutputOnlyModified&&!e&&!this.m_shape.getGeometryModified(this.m_currentGeom))continue}break}}next(){if(this.m_bBuilt)this.moveToNextGeom();else{this.m_geomIndex=this.m_shape.createGeometryUserIndex();const e=new h;for(let o=this.m_inputGeometries.next();null!=o;o=this.m_inputGeometries.next()){this.progress_(),i(o);let t=!1;this.m_bSnapToSr&&(o=o.clone(),t=u(this.m_sr,o));const s=this.m_shape.addGeometry(o);this.m_shape.setGeometryUserIndex(s,this.m_geomIndex,this.m_inputGeometries.getGeometryID());const m=o.getGeometryType();m===r.enumPoint&&(-1===this.m_geomTypeIndex&&(this.m_geomTypeIndex=this.m_shape.createGeometryUserIndex()),this.m_shape.setGeometryUserIndex(s,this.m_geomTypeIndex,m));const n=new h;o.queryLooseEnvelope(n),e.mergeEnvelope2D(n),t&&this.m_shape.setGeometryModified(s,!0)}const t=n(this.m_sr,e,!0),s=n(this.m_sr,e,!1);e.inflate(10*t.total()),this.m_shape.forceSetEnvelope2D(e);let m=null,_=0,p=0;if(this.m_shape.hasCurves()){m=new d;const s=l(t.total(),e);_=c(t.total()),p=f(s,_),y(this.m_shape,s,t.total(),12e3,m,null,this.m_progressTracker)}if(G(this.m_shape,s,this.m_progressTracker)){if(g(this.m_shape,t.add(p),this.m_progressTracker,0===this.m_options,this.m_bOutputOnlyModified),null!==m){if(this.m_bSimplifyPolygons){for(let e=this.m_shape.getFirstGeometry();e!==o;e=this.m_shape.getNextGeometry(e))if(this.m_shape.getGeometryType(e)===r.enumPolygon){a(this.m_shape,e,-1,!1,o,this.m_progressTracker)&&this.m_shape.setGeometryModified(e,!0)}this.m_bSimplifyPolygons=!1}m.stitchCurves(this.m_shape,o,_,!0),m.clearStitcher(this.m_shape)}}else this.m_bSimplifyPolygons=!1,null!==m&&(m.stitchCurves(this.m_shape,o,_,!0),m.clearStitcher(this.m_shape));this.moveToNextGeom()}if(this.m_currentGeom!==o){if(this.m_index=this.m_shape.getGeometryUserIndex(this.m_currentGeom,this.m_geomIndex),-1!==this.m_geomTypeIndex&&this.m_shape.getGeometryUserIndex(this.m_currentGeom,this.m_geomTypeIndex)===r.enumPoint){const e=new _({vd:this.m_shape.getVertexDescription()});return this.m_shape.queryPointGeometryOnly(this.m_currentGeom,e),this.m_bSnapToSr&&u(this.m_sr,e),e}{const e=this.m_shape.getGeometry(this.m_currentGeom);return this.m_bSnapToSr&&u(this.m_sr,e),e}}return null}getGeometryID(){return this.m_index}}const S=new x;function b(e,s,r){const i=S.executeMany(new t(e),s,null,r);return Array.from(i)}function I(){return S.supportsCurves()}export{b as executeMany,I as supportsCurves};