@arcgis/core 6.0.0-next.14 → 6.0.0-next.16

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 (398) hide show
  1. package/analysis/LineOfSightAnalysis.d.ts +49 -32
  2. package/analysis/LineOfSightAnalysisObserver.d.ts +19 -3
  3. package/analysis/LineOfSightAnalysisTarget.d.ts +19 -3
  4. package/analysis/Viewshed.d.ts +23 -3
  5. package/analysis/ViewshedAnalysis.d.ts +33 -13
  6. package/arcade/geometry/operatorsWorkerConnection.js +1 -1
  7. package/assets/esri/core/workers/RemoteClient.js +1 -1
  8. package/assets/esri/core/workers/chunks/00d66e3fba5ab4d2aa3c.js +1 -0
  9. package/assets/esri/core/workers/chunks/{d994bcf0a65d1c07160f.js → 0320cbd825f9a4222042.js} +1 -1
  10. package/assets/esri/core/workers/chunks/08fe248e412bb170210d.js +1 -0
  11. package/assets/esri/core/workers/chunks/{fb444954be74c1962ced.js → 10d80e793019dfb45ca2.js} +1 -1
  12. package/assets/esri/core/workers/chunks/14d5d219e7fe017f23f0.js +1 -0
  13. package/assets/esri/core/workers/chunks/164e74d586297946a717.js +1 -0
  14. package/assets/esri/core/workers/chunks/{1bca39e0e651426bdbb5.js → 1b1d3f6916d2cb751435.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{ed6e9d7f71bfd2691717.js → 1c77de1e79860f8d2228.js} +1 -1
  16. package/assets/esri/core/workers/chunks/1e40a26dcce4d1dadc28.js +1 -0
  17. package/assets/esri/core/workers/chunks/237a1f68a0efbfe5b77c.js +1 -0
  18. package/assets/esri/core/workers/chunks/23c43f09c4a4749516e1.js +1 -0
  19. package/assets/esri/core/workers/chunks/{3418877328f4f0830300.js → 24dac4970526a4e0ae63.js} +1 -1
  20. package/assets/esri/core/workers/chunks/26ceb0ff8d93dbb9b84f.js +1 -0
  21. package/assets/esri/core/workers/chunks/2acf2952cef69e382a35.js +1 -0
  22. package/assets/esri/core/workers/chunks/{481589c3eddad6e026ad.js → 369780276b2755361f7d.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{4df6cb1bee5d0720a43e.js → 36cbd614454581aaf334.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{1e0d2715d603f48a7e0b.js → 370aad23df597db80d65.js} +1 -1
  25. package/assets/esri/core/workers/chunks/3baa4a9c52f41bfd6abb.js +1 -0
  26. package/assets/esri/core/workers/chunks/42d44c7d532df5ee70e9.js +1 -0
  27. package/assets/esri/core/workers/chunks/42e985a576d7aaeed0cf.js +1 -0
  28. package/assets/esri/core/workers/chunks/{6400446b7615b97c3521.js → 45f826554499c38968c6.js} +1 -1
  29. package/assets/esri/core/workers/chunks/48cc58890fddbcf69cef.js +1 -0
  30. package/assets/esri/core/workers/chunks/494bd434fee9032e1d02.js +1 -0
  31. package/assets/esri/core/workers/chunks/{33e4ff228a8c81b99022.js → 4abd3753cd9b80e4d937.js} +1 -1
  32. package/assets/esri/core/workers/chunks/4bbe1f28f5f16a6bef05.js +1 -0
  33. package/assets/esri/core/workers/chunks/4c389472b8cdb0c55154.js +1 -0
  34. package/assets/esri/core/workers/chunks/4e4f747de424941a0bfa.js +1 -0
  35. package/assets/esri/core/workers/chunks/5529831dd891382c79df.js +1 -0
  36. package/assets/esri/core/workers/chunks/5736feefa261589b6273.js +1 -0
  37. package/assets/esri/core/workers/chunks/576248e9ae2654569420.js +1 -0
  38. package/assets/esri/core/workers/chunks/5acb422fe3cf693d9d4f.js +1 -0
  39. package/assets/esri/core/workers/chunks/{aeaaff7a4b1a99540f52.js → 5cb26bbaa08114aec5ce.js} +1 -1
  40. package/assets/esri/core/workers/chunks/661c6324529dd17b297e.js +1 -0
  41. package/assets/esri/core/workers/chunks/68dd1fd2025c7125ead1.js +1 -0
  42. package/assets/esri/core/workers/chunks/{89e76de5ae3328d821a4.js → 69f6d5997b8ff1326e39.js} +1 -1
  43. package/assets/esri/core/workers/chunks/6a8dd8b18b0b825b0c1b.js +1 -0
  44. package/assets/esri/core/workers/chunks/{a40b6d8b5c73e06e14d4.js → 6c255c029d67423e4dac.js} +1 -1
  45. package/assets/esri/core/workers/chunks/7446d0dfebf93e86c098.js +1 -0
  46. package/assets/esri/core/workers/chunks/{688f2dbf784e66082308.js → 74c866e0b66e61751861.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{3ffda5bf0b91700dc308.js → 78643f116677950ea29a.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{916b363c342b61ba5461.js → 787c1a8bda7d745633f2.js} +1 -1
  49. package/assets/esri/core/workers/chunks/7b5f3c79e0605c32b267.js +1 -0
  50. package/assets/esri/core/workers/chunks/7bbfe9ff352afc566367.js +1 -0
  51. package/assets/esri/core/workers/chunks/{ac5a6603f7fa78d3e4c8.js → 7e8611cb709f105946f5.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{05cd33d41d91f8d09633.js → 7fb7493f483cd9878bfa.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{acfa03c65ba3ca6c5685.js → 8715661a838361d4211a.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{601e1d020b8115497944.js → 8a485130781b49dbf608.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{0ccab50877b24f862d6e.js → 8ac2098ecdc40ad41055.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{a655ebdb4bf0660615a2.js → 8b4e9fd88c0c313416d4.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{4e544de61f07ca660236.js → 8c12269d26f5a4c753cb.js} +1 -1
  58. package/assets/esri/core/workers/chunks/8e19629899a5becf8e19.js +1 -0
  59. package/assets/esri/core/workers/chunks/91dd65cf877c8f2e01a7.js +1 -0
  60. package/assets/esri/core/workers/chunks/{46b4fb6a7fe4877b0efc.js → 94baa354e50c03b82b25.js} +2 -2
  61. package/assets/esri/core/workers/chunks/950d4578dc450467404c.js +1 -0
  62. package/assets/esri/core/workers/chunks/{68be3fb88ca61f82fb90.js → 95dbbddac6581b9d671f.js} +1 -1
  63. package/assets/esri/core/workers/chunks/98be2f621801e230aa01.js +1 -0
  64. package/assets/esri/core/workers/chunks/9b051745d24d1f43480b.js +1 -0
  65. package/assets/esri/core/workers/chunks/9d61740ef8bdcc162be1.js +1 -0
  66. package/assets/esri/core/workers/chunks/{eb04e1717a1002cda3ab.js → 9f06ec95bdf0d0b52b41.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{fafb92ca2c5e4b0b2c23.js → a09d2e1e2540921e4717.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{3b3e519f15ed52c83f0c.js → a49fe94933b65b4b64f8.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{1819c45655c836b9a8d7.js → a4d3944700f1cc240176.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{90bdf86f553e2742d67c.js → a7bd5ba4d7d97411fd33.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{900181f68449d8f82eeb.js → aa1ac7954e4f0fefe15b.js} +1 -1
  72. package/assets/esri/core/workers/chunks/ac24b4370dc7194a3107.js +1 -0
  73. package/assets/esri/core/workers/chunks/{b8337492e2b753aefac4.js → ace41659a5ca0e5abfc3.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{3c0ed15b544df6fb0903.js → b48952e1fb4cb7360dd0.js} +1 -1
  75. package/assets/esri/core/workers/chunks/b5e7475cc5fbf31289d3.js +1 -0
  76. package/assets/esri/core/workers/chunks/{f3da30d7300b92bd8bb0.js → befa32b9e7b3fbdd431e.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{0f617980c7dd9ad0444f.js → bf35927979fc5e7e0478.js} +1 -1
  78. package/assets/esri/core/workers/chunks/c4ddac23bd649d24f3f2.js +1 -0
  79. package/assets/esri/core/workers/chunks/{4e6f40cbdb8c508e6df1.js → c5a9e77977e867a75ff2.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{25f19fc929f25ddd628c.js → c79934cd6883307203f8.js} +1 -1
  81. package/assets/esri/core/workers/chunks/cddc3e285f763ccf33c2.js +1 -0
  82. package/assets/esri/core/workers/chunks/d08ff41e2a9bcd58b64a.js +1 -0
  83. package/assets/esri/core/workers/chunks/d311ff96a5a2791d8cfc.js +1 -0
  84. package/assets/esri/core/workers/chunks/d62afb71f4ece4283994.js +1 -0
  85. package/assets/esri/core/workers/chunks/dc1761cba0454fda3cf9.js +1 -0
  86. package/assets/esri/core/workers/chunks/{4ac1d3e49e242e373a92.js → e0650b1408197d3ac862.js} +1 -1
  87. package/assets/esri/core/workers/chunks/{3ff6d1ed3c0f1285f3e7.js → e0d9dc97985561320bd4.js} +1 -1
  88. package/assets/esri/core/workers/chunks/eaddffcc7004101fc230.js +1 -0
  89. package/assets/esri/core/workers/chunks/eb2652ec48faa78de3c5.js +1 -0
  90. package/assets/esri/core/workers/chunks/eca44e53bcee9b08d70a.js +1 -0
  91. package/assets/esri/core/workers/chunks/f00458654c7c34c369ef.js +1 -0
  92. package/assets/esri/core/workers/chunks/f3cd610084e3f4d8656b.js +1 -0
  93. package/assets/esri/core/workers/chunks/f47fe4433b05fca5c3ad.js +1 -0
  94. package/assets/esri/core/workers/chunks/f7bfa3d33b05b250ce33.js +1 -0
  95. package/assets/esri/core/workers/chunks/f91bc1cb1014e05be763.js +1 -0
  96. package/assets/esri/core/workers/chunks/{aadfe34a99c9ec7a0e11.js → f9c5aa0bbf23e780fecc.js} +1 -1
  97. package/assets/esri/core/workers/chunks/f9ff27cfcf0538ac5e26.js +1 -0
  98. package/assets/esri/core/workers/chunks/{19676b2c5f8b0a5ee680.js → facd1ff23203fed67686.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{40a584cb952e94326e9e.js → fcb86d24fc7e0666b564.js} +1 -1
  100. package/assets/esri/libs/pdfjs/wasm/openjpeg_nowasm_fallback.js +1 -0
  101. package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
  102. package/chunks/Envelope.js +1 -1
  103. package/chunks/MultiPathImpl.js +1 -1
  104. package/chunks/OperatorGeodeticArea.js +1 -1
  105. package/chunks/OperatorShapePreservingLength.js +1 -1
  106. package/chunks/OperatorShapePreservingProject.js +1 -1
  107. package/chunks/UnitFactory.js +1 -1
  108. package/chunks/basis_encoder.js +1 -1
  109. package/chunks/basis_transcoder.js +1 -1
  110. package/chunks/index.js +1 -1
  111. package/chunks/lclayout.js +1 -1
  112. package/config.d.ts +2 -0
  113. package/config.js +1 -1
  114. package/core/ObjectPool.js +1 -1
  115. package/core/PooledArray.js +1 -1
  116. package/core/accessorSupport/DefaultsStore.js +1 -1
  117. package/core/accessorSupport/MultiOriginStore.js +1 -1
  118. package/core/accessorSupport/Store.js +1 -1
  119. package/core/accessorSupport/decorators/reader.js +1 -1
  120. package/core/accessorSupport/decorators/writer.js +1 -1
  121. package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
  122. package/core/workers/WorkerOwner.js +1 -1
  123. package/core/workers/workerFactory.js +1 -1
  124. package/core/workers/workers.js +2 -2
  125. package/core/workers.d.ts +9 -0
  126. package/form/elements/inputs/DynamicChoiceInput.d.ts +4 -2
  127. package/geometry/Mesh.js +1 -1
  128. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  129. package/geometry/operators/gx/operatorOffset.js +1 -1
  130. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  131. package/geometry/operators/support/jsonConverter.js +1 -1
  132. package/geometry/support/buffer/BufferPool.js +1 -1
  133. package/geometry/support/coordsUtils.js +1 -1
  134. package/geometry/support/curves/bezierCurveUtils.js +1 -1
  135. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  136. package/geometry/support/meshUtils/merge.js +1 -1
  137. package/geometry/support/meshUtils/rotate.js +1 -1
  138. package/geometry/support/meshUtils.d.ts +5 -6
  139. package/geometry/support/polygonExtentClipping.js +1 -1
  140. package/identity/Credential.js +1 -1
  141. package/interfaces.d.ts +18 -9
  142. package/kernel.js +1 -1
  143. package/layers/AnnotationFeatureLayer.d.ts +2 -2
  144. package/layers/AnnotationFeatureLayer.js +1 -1
  145. package/layers/CatalogLayer.d.ts +2 -2
  146. package/layers/CatalogLayer.js +1 -1
  147. package/layers/DimensionFeatureLayer.d.ts +2 -2
  148. package/layers/DimensionFeatureLayer.js +1 -1
  149. package/layers/FeatureLayer.d.ts +4 -4
  150. package/layers/FeatureLayer.js +1 -1
  151. package/layers/GeospatialPDFLayer.d.ts +154 -4
  152. package/layers/ImageryTileLayer.js +1 -1
  153. package/layers/Layer.d.ts +2 -0
  154. package/layers/LineOfSightLayer.d.ts +10 -8
  155. package/layers/SceneLayer.js +1 -1
  156. package/layers/SubtypeGroupLayer.d.ts +2 -2
  157. package/layers/SubtypeGroupLayer.js +1 -1
  158. package/layers/ViewshedLayer.d.ts +1 -1
  159. package/layers/VoxelLayer.js +1 -1
  160. package/layers/WMSLayer.js +1 -1
  161. package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
  162. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +9 -9
  163. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
  164. package/layers/geospatialPDF/LGIDictMapFrame.js +1 -1
  165. package/layers/geospatialPDF/ViewportMeasureFrame.js +1 -1
  166. package/layers/geospatialPDF/geospatialPDFParserUtils.js +1 -1
  167. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  168. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  169. package/layers/graphics/data/QueryEngineResult.js +1 -1
  170. package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
  171. package/layers/graphics/sources/parquet/FileProvider.js +1 -1
  172. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  173. package/layers/mixins/{FeatureLayerReload.d.ts → ReloadableLayer.d.ts} +5 -3
  174. package/layers/mixins/ReloadableLayer.js +2 -0
  175. package/layers/raster/datasets/BaseRaster.js +1 -1
  176. package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
  177. package/layers/raster/datasets/ImageAuxRaster.js +2 -2
  178. package/layers/raster/datasets/ImageServerRaster.js +1 -1
  179. package/layers/raster/datasets/InMemoryRaster.js +1 -1
  180. package/layers/raster/datasets/MRFRaster.js +1 -1
  181. package/layers/raster/datasets/TIFFRaster.js +1 -1
  182. package/layers/raster/datasets/WCSRaster.js +1 -1
  183. package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
  184. package/layers/raster/formats/RasterCodec.js +1 -1
  185. package/layers/raster/formats/TiffDecoder.js +1 -1
  186. package/layers/raster/formats/Zlib.js +1 -1
  187. package/layers/raster/functions/stretchUtils.js +1 -1
  188. package/layers/raster/functions/vectorFieldUtils.js +1 -1
  189. package/layers/support/FieldsIndex.js +1 -1
  190. package/layers/support/LabelClass.d.ts +3 -2
  191. package/layers/support/PortalItemData.d.ts +31 -8
  192. package/layers/support/RasterWorker.js +1 -1
  193. package/layers/support/featureReductionProperties.js +1 -1
  194. package/layers/support/kmlUtils.js +1 -1
  195. package/layers/support/types.d.ts +4 -1
  196. package/layers/video/VideoController.js +10 -10
  197. package/libs/maquette/projection.js +1 -1
  198. package/networks/UtilityNetworkTraceAnalysis.js +1 -1
  199. package/package.json +5 -5
  200. package/popup/FeatureModel.js +1 -1
  201. package/popup/FeaturesModel.js +1 -1
  202. package/portal/Portal.js +1 -1
  203. package/request/process.js +1 -1
  204. package/request/types.d.ts +7 -0
  205. package/rest/knowledgeGraph/ObjectValue.js +1 -1
  206. package/rest/knowledgeGraphService.js +1 -1
  207. package/rest/networks/trace.js +1 -1
  208. package/rest/query/executeQuery.js +1 -1
  209. package/smartMapping/raster/renderers/shadedRelief.js +1 -1
  210. package/smartMapping/renderers/univariateColorSize.js +1 -1
  211. package/smartMapping/statistics/support/statsWorker.js +1 -1
  212. package/smartMapping/statistics/support/utils.js +1 -1
  213. package/smartMapping/support/clusterUtils.js +1 -1
  214. package/statistics/utils.js +1 -1
  215. package/symbols/cim/CIMCursor.js +1 -1
  216. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  217. package/symbols/cim/cimAnalyzer.js +1 -1
  218. package/symbols/support/ElevationInfo.d.ts +4 -3
  219. package/undoredo/support/Services.js +1 -1
  220. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +2 -2
  221. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  222. package/views/2d/grid/GridView2D.js +1 -1
  223. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  224. package/views/2d/layers/features/sources/strategies/FeatureHybridTileLoadStrategy.js +1 -1
  225. package/views/2d/layers/features/sources/strategies/FeaturePagedTileLoadStrategy.js +1 -1
  226. package/views/2d/layers/features/sources/strategies/FeatureSnapshotLoadStrategy.js +1 -1
  227. package/views/2d/viewpointUtils.js +1 -1
  228. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  229. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  230. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  231. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  232. package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
  233. package/views/3d/analysis/LineOfSight/{LineOfSightRootPlugin.js → LineOfSightPlacementRootPlugin.js} +1 -1
  234. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  235. package/views/3d/analysis/LineOfSight/types.d.ts +14 -3
  236. package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +39 -13
  237. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
  238. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  239. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  240. package/views/3d/analysis/Viewshed/types.d.ts +7 -0
  241. package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +43 -15
  242. package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
  243. package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
  244. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  245. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  246. package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
  247. package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
  248. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  249. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  250. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  251. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  252. package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
  253. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  254. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  255. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  256. package/views/3d/layers/graphics/SpatialIndex2D.js +1 -1
  257. package/views/3d/layers/i3s/I3SNode.js +1 -1
  258. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  259. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  260. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  261. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  262. package/views/3d/layers/support/FeatureTileFetcher3DDebugger.js +1 -1
  263. package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
  264. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  265. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  266. package/views/3d/support/MemoryController.js +1 -1
  267. package/views/3d/support/elevationUpdateExtentUtils.js +1 -1
  268. package/views/3d/support/elevationUpdateUtils.js +1 -1
  269. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  270. package/views/3d/support/sphereExtentUtils.js +2 -0
  271. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  272. package/views/3d/terrain/OverlayRenderer.js +1 -1
  273. package/views/3d/terrain/PatchRenderData.js +1 -1
  274. package/views/3d/terrain/TerrainData.js +1 -1
  275. package/views/3d/terrain/terrainUtils.js +1 -1
  276. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  277. package/views/3d/webgl-engine/effects/geometry/RenderOccluded.js +1 -1
  278. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  279. package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
  280. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  281. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  282. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  283. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  284. package/views/3d/webgl-engine/lib/PathProfile.js +1 -1
  285. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  286. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  287. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  288. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  289. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  290. package/views/SceneView.js +1 -1
  291. package/views/ToolViewManager.js +1 -1
  292. package/views/draw/DrawOperation.js +1 -1
  293. package/views/draw/support/InteractiveHandle.js +1 -1
  294. package/views/draw/support/Reshape.js +1 -1
  295. package/views/draw/support/createUtils.js +1 -1
  296. package/views/draw/support/editingSessionUtils.js +1 -1
  297. package/views/draw/support/managers/InteractiveHandleManager.js +1 -1
  298. package/views/interactive/SegmentLabels.js +1 -1
  299. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  300. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  301. package/views/interactive/editGeometry/operations/SetAllVertexPositions.js +1 -1
  302. package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
  303. package/views/interactive/options/TooltipOptions.d.ts +2 -0
  304. package/views/interactive/sketch/SketchTooltipOptions.d.ts +2 -0
  305. package/views/interactive/sketch/constraintUtils.js +1 -1
  306. package/views/interactive/snapping/SnappingDragPipelineStep.js +1 -1
  307. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  308. package/views/layers/LayerView.js +1 -1
  309. package/views/layers/LineOfSightLayerView.d.ts +35 -13
  310. package/views/layers/SketchLayerView.d.ts +1 -0
  311. package/views/layers/ViewshedLayerView.d.ts +36 -12
  312. package/views/webgl/Program.js +1 -1
  313. package/views/webgl/Texture.js +1 -1
  314. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  315. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
  316. package/widgets/BatchAttributeForm.js +1 -1
  317. package/widgets/Directions.js +1 -1
  318. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  319. package/widgets/Editor/EditorViewModel.d.ts +10 -1
  320. package/widgets/Editor/legacy/CreateFeaturesWorkflow.js +1 -1
  321. package/widgets/Editor.d.ts +10 -1
  322. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  323. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  324. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  325. package/widgets/FeatureTable/support/GroupColumnTemplate.js +1 -1
  326. package/widgets/FeatureTable/support/TableTemplate.js +1 -1
  327. package/widgets/HistogramRangeSlider.d.ts +2 -2
  328. package/widgets/HistogramRangeSlider.js +1 -1
  329. package/widgets/Legend.d.ts +1 -0
  330. package/widgets/Print.js +1 -1
  331. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.d.ts +5 -2
  332. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  333. package/widgets/ScaleRangeSlider.js +1 -1
  334. package/widgets/Slice.js +1 -1
  335. package/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel.js +1 -1
  336. package/widgets/ValuePicker/ValuePickerBaseComponent.d.ts +5 -1
  337. package/widgets/ValuePicker/ValuePickerCollection.d.ts +2 -0
  338. package/widgets/ValuePicker/ValuePickerCombobox.d.ts +7 -1
  339. package/widgets/ValuePicker/ValuePickerLabel.d.ts +7 -1
  340. package/widgets/ValuePicker/ValuePickerSlider.d.ts +2 -0
  341. package/widgets/ValuePicker/ValuePickerSliderVisibleElements.d.ts +5 -1
  342. package/widgets/ValuePicker/ValuePickerVisibleElements.d.ts +5 -1
  343. package/widgets/ValuePicker/types.d.ts +2 -0
  344. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  345. package/widgets/support/SelectionList.js +1 -1
  346. package/widgets/support/componentsUtils.js +1 -1
  347. package/assets/esri/core/workers/chunks/024b44c0c8876627f904.js +0 -1
  348. package/assets/esri/core/workers/chunks/02c5d027bdaee67869cf.js +0 -1
  349. package/assets/esri/core/workers/chunks/03261b9451e293a0fac8.js +0 -1
  350. package/assets/esri/core/workers/chunks/037a8cc19debbaaa4e10.js +0 -1
  351. package/assets/esri/core/workers/chunks/0c8c01097847617261b9.js +0 -1
  352. package/assets/esri/core/workers/chunks/0d931c7579b6409a696d.js +0 -1
  353. package/assets/esri/core/workers/chunks/12c154342fff876f2f1e.js +0 -1
  354. package/assets/esri/core/workers/chunks/1c65ab9ed611c322ce27.js +0 -1
  355. package/assets/esri/core/workers/chunks/1e11d2e97d17685b878a.js +0 -1
  356. package/assets/esri/core/workers/chunks/1f339247b68b061ab0a4.js +0 -1
  357. package/assets/esri/core/workers/chunks/21ddb26526bcb2b122c3.js +0 -1
  358. package/assets/esri/core/workers/chunks/22e8c0aad2fe75943865.js +0 -1
  359. package/assets/esri/core/workers/chunks/2eae542fe7f0f6576ac1.js +0 -1
  360. package/assets/esri/core/workers/chunks/408e81c8f1eff8a7b379.js +0 -1
  361. package/assets/esri/core/workers/chunks/444e5f214abce3d607cd.js +0 -1
  362. package/assets/esri/core/workers/chunks/46a7da93a63663878583.js +0 -1
  363. package/assets/esri/core/workers/chunks/4a1e23e021bac37a88ab.js +0 -1
  364. package/assets/esri/core/workers/chunks/4c4117e28ea358a32088.js +0 -1
  365. package/assets/esri/core/workers/chunks/54b18559280a7d2a8d93.js +0 -1
  366. package/assets/esri/core/workers/chunks/59b216b60464611742d4.js +0 -1
  367. package/assets/esri/core/workers/chunks/5bfea0c55aca826de536.js +0 -1
  368. package/assets/esri/core/workers/chunks/62ac588f7dd1d24d0c9d.js +0 -1
  369. package/assets/esri/core/workers/chunks/62c8c9ad09e0166207fd.js +0 -1
  370. package/assets/esri/core/workers/chunks/62d6e101e9bd9557a410.js +0 -1
  371. package/assets/esri/core/workers/chunks/6558488ea96620439f34.js +0 -1
  372. package/assets/esri/core/workers/chunks/665e31c494d2af505acc.js +0 -1
  373. package/assets/esri/core/workers/chunks/6f4e6022a52de0c54aab.js +0 -1
  374. package/assets/esri/core/workers/chunks/7267b17de212207142c9.js +0 -1
  375. package/assets/esri/core/workers/chunks/7ef182e24cad50815b4e.js +0 -1
  376. package/assets/esri/core/workers/chunks/8293600f94553afc8c38.js +0 -1
  377. package/assets/esri/core/workers/chunks/8431ca60ad33d594e323.js +0 -1
  378. package/assets/esri/core/workers/chunks/876f7633c15f1e31078d.js +0 -1
  379. package/assets/esri/core/workers/chunks/8ca9648eacb894283513.js +0 -1
  380. package/assets/esri/core/workers/chunks/91ebb2ccab1889eb7e81.js +0 -1
  381. package/assets/esri/core/workers/chunks/9ce91a909eccc4dfe388.js +0 -1
  382. package/assets/esri/core/workers/chunks/9e1a3b6a08c96dcefdde.js +0 -1
  383. package/assets/esri/core/workers/chunks/9e3e442a9874ed23a043.js +0 -1
  384. package/assets/esri/core/workers/chunks/ad76f7ab2f3e6d5a5b3c.js +0 -1
  385. package/assets/esri/core/workers/chunks/aff32980d91dab07dfb7.js +0 -1
  386. package/assets/esri/core/workers/chunks/bbf993dba74850bbf9d7.js +0 -1
  387. package/assets/esri/core/workers/chunks/d8f1cefcad02d7353d4b.js +0 -1
  388. package/assets/esri/core/workers/chunks/d938987344bce83cc660.js +0 -1
  389. package/assets/esri/core/workers/chunks/ddf0671976648f621269.js +0 -1
  390. package/assets/esri/core/workers/chunks/de02f60258e6985ef676.js +0 -1
  391. package/assets/esri/core/workers/chunks/e10b57aefcc89671116e.js +0 -1
  392. package/assets/esri/core/workers/chunks/e65dfa19f030ec298437.js +0 -1
  393. package/assets/esri/core/workers/chunks/f122c18af10e56f9ec2b.js +0 -1
  394. package/assets/esri/core/workers/chunks/f92364afaefbac7e8f77.js +0 -1
  395. package/assets/esri/core/workers/chunks/fd9663952d5a94f3a83f.js +0 -1
  396. package/assets/esri/core/workers/chunks/fe9879ecd69ac4329291.js +0 -1
  397. package/layers/mixins/FeatureLayerReload.js +0 -2
  398. /package/views/3d/analysis/LineOfSight/{lineOfSightPlacementUtils.js → placementUtils.js} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{b as e,t,G as n,d as r,g as i}from"./Geometry.js";import{P as a,x as o,L as s}from"./MultiPathImpl.js";import{O as c}from"./OperatorDensify.js";import{D as l,J as u,r as d,aD as f,O as p,aN as m,j as h,b as g,ag as _,aF as v,aX as y,aY as b,an as x,ao as S,av as C,aZ as w,aC as T,ay as E}from"./UnitFactory.js";import{P as D,K as O,c as k,o as A,l as j,e as M,E as N,q as ee,j as P,s as F,y as I,z as L,A as R}from"./Point2D.js";import{Envelope2D as z}from"./Envelope2D.js";import{c as B,k as V}from"./Envelope.js";import{O as H}from"./OperatorClip.js";import{O as U}from"./OperatorShapePreservingLength.js";import{__addDisposableResource as W,__disposeResources as G}from"tslib";import{T as K}from"./Transformation2D.js";import{a as q}from"./GeodeticDistanceCalculator-zRp89-dW.js";class te{m_startPt;m_endPt;m_cE2;m_cE;m_c1By2e;m_cRpu;isPcs;PEProjcs;m_points;constructor(e,t,n,r,i=100){this.m_startPt=e.clone(),this.m_endPt=t.clone(),this.m_cE2=r,this.m_cE=Math.sqrt(this.m_cE2),this.m_c1By2e=1/(2*this.m_cE),this.m_cRpu=n.getGCS().getUnit().getUnitToBaseFactor(),this.isPcs=n.getCoordinateSystemType()===2,this.PEProjcs=n.getPECoordSys(),this.m_points=k(i*2,NaN)}setSegmentEndPoints(e,t){this.m_startPt.assign(e),this.m_endPt.assign(t)}makeFunctor(){return e=>{let t=[0,0];t[0]=this.m_startPt.x*(1-e)+this.m_endPt.x*e,t[1]=this.m_startPt.y*(1-e)+this.m_endPt.y*e,this.isPcs&&f.projToGeogCenter(this.PEProjcs,1,t,0);let n=Math.sin(t[1]*this.m_cRpu);return this.m_cE2===0?n:-(Math.log((1-this.m_cE*n)/(1+this.m_cE*n))*this.m_c1By2e)+n/(1-this.m_cE2*n*n)}}}function ne(e,t,n){let r=new z;e.queryEnvelope(r);let i=B(t,r,!0).total(),a=t.getPannableExtent();a.xmin=r.xmin-10*i,a.xmax=r.xmax+10*i;let s=new H().execute(e,a,t,n).getImpl().querySegmentIterator();s.stripAttributes();let c=d();t.querySpheroidData(c);let l=c.e2,u=l===0?2:1,f=new D(0,0),p=new D(0,0),m=new O(0),h=new te(f,p,t,l,100);for(;s.nextPath();)for(;s.hasNextSegment();){let e=s.nextSegment();f.assign(e.getStartXY()),p.assign(e.getEndXY()),h.setSegmentEndPoints(f,p);let t=o(6,0,1,1e-12,1e-15,h.makeFunctor());m.pe((p.x-f.x)*t)}let g=c.majorSemiAxis;return u*g*g*(1-l)*Math.PI*m.getResult()/t.getPannableExtent().width()}function re(e,t,n,r,i){let a=oe(e,t,i),o=J(e,a.first,n,r,i),s=1,c=0,l=0;do{if(s++,a.first*=.5,a.first<t.getTolerance(0)*50)return o;a.second*=2,l=J(e,a.first,n,r,i),c=Math.abs(l-o),o=l}while(Math.abs(o)>1&&c>1e-8*Math.abs(o)&&(a.second<65e3&&s<8||s<4));return l}function J(e,t,n,r,i){let a=new c().execute(e,t,0,0,i),o;o=r?new p().execute(a,r,i):a;let s=n.getUnit().getUnitToBaseFactor()===1?Math.PI/180:1,l=new z;o.queryEnvelope(l);let u=new z,d=new z,f=new z;u.setCoords({xmin:l.xmin,ymin:75*s,xmax:l.xmax,ymax:90*s}),d.setCoords({xmin:l.xmin,ymin:-60*s,xmax:l.xmax,ymax:75*s}),f.setCoords({xmin:l.xmin,ymin:-90*s,xmax:l.xmax,ymax:-60*s}),u.inflateCoords(u.width()*.01,0),d.inflateCoords(d.width()*.01,0),f.inflateCoords(f.width()*.01,0);let m=0;return m+=Y(o,u,n,i),m+=Y(o,d,n,i),m+=Y(o,f,n,i),m}function Y(e,t,n,r){let i=new H().execute(e,t,n,r);if(i!==null&&!i.isEmpty()){let e=new z;i.queryEnvelope(e);let{first:t,second:a}=ae(n,e,!1),o=l(n,t,null),s=new p().execute(i,o,r).calculateArea2D();return a&&t.destroy(),s}return 0}const X=[null,null,null,null,null,null,null];function ie(e,t,n){let a=e.getUnit().getUnitToBaseFactor(),o=t.getCenter();o.scale(a*180/Math.PI);let s=new D;s.x=0,s.y=0;let c=0;if(c===0){o.y>45?(s.y=j,c=0):o.y<-45?(s.y=-j,c=1):o.x>=45&&o.x<135?(s.x=j,c=2):o.x>=135||o.x<-135?(s.x=j,c=3):o.x<-45&&o.x>=-135?(s.x=-j,c=4):(s.x=0,c=5);let e=a*Math.sqrt(M(t.xmin-t.xmax)+M(t.ymin-t.ymax)),n=s.clone(),r=t.getCenter();if(r.scale(a),c<2&&(n.x=r.x),D.distance(n,r)+e*.5>j)return null}let l=X[c];if(l!==null&&l.getGCS().equalHorizontal(e))return l;let u=e.getText(),d=s.x,f=s.y,p=0,_=-1;c===6?(i(n),p=0,_=m.PE_PRJ_CYLINDRICAL_EQAREA):_=m.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA;let v=h(`EqualAreaPCS`),y;_===m.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA?y=`PROJCS["${v}",${u},PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",${d}],PARAMETER["Latitude_of_Origin",${f}],UNIT["Meter",1.0]]`:_===m.PE_PRJ_CYLINDRICAL_EQAREA?y=`PROJCS["${v}",${u},PROJECTION["Cylindrical_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",${d}],PARAMETER["Standard_Parallel_1",${p}],PARAMETER["Latitude_of_Origin",${f}],UNIT["Meter",1.0]]`:r(`getEqualAreaPcsFixed`);let b=g(y);return X[c]&&X[c].destroy(),X[c]=b,b}function ae(e,t,n){let i=ie(e,t,n);if(i!==null)return A(i,!1);let a=e.getText(),o=e.getUnit().getUnitToBaseFactor(),s=(t.xmin+t.width()/2)*o,c=(t.ymin+t.height()/2)*o,l=0,u=0,d=-1;t.ymin*o>=75*Math.PI/180||t.ymax*o<=-60*Math.PI/180?d=m.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA:t.ymin>0||t.ymax<0?(l=(t.ymin+1/3*t.height())*o,u=(t.ymin+2/3*t.height())*o,d=m.PE_PRJ_ALBERS):(l=(t.ymin+2/3*t.height())*o,d=m.PE_PRJ_CYLINDRICAL_EQAREA);let f=h(`EqualAreaPCS`),p;return d===m.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA?p=`PROJCS["${f}",${a},PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",${s}],PARAMETER["Latitude_of_Origin",${c}],UNIT["Meter",1.0]]`:d===m.PE_PRJ_ALBERS?p=`PROJCS["${f}",${a},PROJECTION["Albers"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",${s}],PARAMETER["Standard_Parallel_1",${l}],PARAMETER["Standard_Parallel_2",${u}],PARAMETER["Latitude_of_Origin",${c}],UNIT["Meter",1.0]]`:d===m.PE_PRJ_CYLINDRICAL_EQAREA?p=`PROJCS["${f}",${a},PROJECTION["Cylindrical_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",${s}],PARAMETER["Standard_Parallel_1",${l}],PARAMETER["Latitude_of_Origin",${c}],UNIT["Meter",1.0]]`:r(`getEqualAreaPCSInstance`),A(g(p),!0)}function oe(e,t,n){let r=e.calculateLength2D(),i=new U().execute(e,t,n)/25e3,a=r/e.getSegmentCount()*2,o=Math.min(a,r/i);return o===0&&(o=1),A(o,r/o)}class se{getOperatorType(){return 10314}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}execute(r,i,o){if(i.getCoordinateSystemType()===0&&e(``),r.isEmpty()||r.getDimension()<2)return 0;if(t(r),r.getGeometryType()===n.enumEnvelope){let e=new a;return e.addEnvelope(r,!1),this.execute(e,i,o)}let s=r;r.getDescription().getAttributeCount()>1&&(s=r.clone(),s.dropAllAttributes());let d=new c().execute(s,0,i.getTolerance(0),0,o),f=null,p=i.getGCS();p!==i&&(f=l(i,p));let m=new u().execute(d,i,!1,o);return m.isEmpty()?0:(m===r&&(m=r.clone()),i.isPannable()?ne(m,i,o):re(m,i,p,f,o))}}function Z(){return{m_p_PCS:new D,m_factor:NaN,setValues:Q,assign:ce}}function Q(e,t){this.m_factor=e,this.m_p_PCS.assign(t)}function ce(e){this.m_factor=e.m_factor,this.m_p_PCS.assign(e.m_p_PCS)}class le{m_ptStart=new V;m_ptEnd=new V;m_deltaX;m_deltaY;m_e;m_e2;m_c1MinusE2;m_baseA;constructor(e,t,n,r){this.m_ptStart.assign(t),this.m_ptEnd.assign(n),this.m_deltaX=this.m_ptEnd.x-this.m_ptStart.x,this.m_deltaY=this.m_ptEnd.y-this.m_ptStart.y,this.m_e=Math.sqrt(e),this.m_e2=e,this.m_c1MinusE2=1-e;let i=Math.sin(r),a;a=this.m_e2===0?2*i:i*(L(this.m_e*i)+1/(1-this.m_e2*i*i)),this.m_baseA=a}setSegmentEndPoints(e,t){this.m_ptStart.assign(e),this.m_ptEnd.assign(t),this.m_deltaX=this.m_ptEnd.x-this.m_ptStart.x,this.m_deltaY=this.m_ptEnd.y-this.m_ptStart.y}makeFunctor(){return e=>{let t=1-e,n=t*this.m_ptStart.x+e*this.m_ptEnd.x,r=t*this.m_ptStart.y+e*this.m_ptEnd.y,i=t*this.m_ptStart.z+e*this.m_ptEnd.z,a=n*n+r*r,o=i/Math.sqrt(i*i+this.m_c1MinusE2*this.m_c1MinusE2*a),s;return s=this.m_e2===0?2*o:o*(L(this.m_e*o)+1/(1-this.m_e2*o*o)),(this.m_deltaY*n-this.m_deltaX*r)/a*(s-this.m_baseA)}}}function ue(){return{e:NaN,one_p_e:NaN,one_m_e:NaN,one_m_e_2:NaN,atanh_e_over_e:NaN,half_qp:NaN,f:NaN,z:NaN}}function $(){return{sin_phi:NaN,one_p_sin_phi:NaN,one_m_sin_phi:NaN,one_m_e_2_sin_2_phi:NaN,sin_half_phi_pf:NaN,sin_half_phi_pz:NaN,sin_half_asin_e_sin_phi_pf:NaN,sin_half_asin_e_sin_phi_pz:NaN,atanh_sin_phi:NaN,atanh_esin_phi:NaN,make_negative:!1,initialize:de,changeSign:fe,assign:pe,clone:me}}function de(e,t,n,r){let i=.5*e;this.sin_phi=Math.sin(e);let a=t*this.sin_phi,o=.5*Math.asin(a);this.one_p_sin_phi=1+this.sin_phi,this.one_m_sin_phi=1-this.sin_phi,this.one_m_e_2_sin_2_phi=(1+a)*(1-a),this.sin_half_phi_pf=Math.sin(i+n),this.sin_half_phi_pz=Math.sin(i+r),this.sin_half_asin_e_sin_phi_pf=Math.sin(o+n),this.sin_half_asin_e_sin_phi_pz=Math.sin(o+r),this.atanh_sin_phi=Math.log(this.sin_half_phi_pf/this.sin_half_phi_pz),this.atanh_esin_phi=Math.log(this.sin_half_asin_e_sin_phi_pf/this.sin_half_asin_e_sin_phi_pz)}function fe(){this.sin_phi=-this.sin_phi;let e=this.one_p_sin_phi;this.one_p_sin_phi=this.one_m_sin_phi,this.one_m_sin_phi=e,e=this.sin_half_phi_pf,this.sin_half_phi_pf=this.sin_half_phi_pz,this.sin_half_phi_pz=e,e=this.sin_half_asin_e_sin_phi_pf,this.sin_half_asin_e_sin_phi_pf=this.sin_half_asin_e_sin_phi_pz,this.sin_half_asin_e_sin_phi_pz=e,this.atanh_sin_phi=-this.atanh_sin_phi,this.atanh_esin_phi=-this.atanh_esin_phi}function pe(e){this.sin_phi=e.sin_phi,this.one_p_sin_phi=e.one_p_sin_phi,this.one_m_sin_phi=e.one_m_sin_phi,this.one_m_e_2_sin_2_phi=e.one_m_e_2_sin_2_phi,this.sin_half_phi_pf=e.sin_half_phi_pf,this.sin_half_phi_pz=e.sin_half_phi_pz,this.sin_half_asin_e_sin_phi_pf=e.sin_half_asin_e_sin_phi_pf,this.sin_half_asin_e_sin_phi_pz=e.sin_half_asin_e_sin_phi_pz,this.atanh_sin_phi=e.atanh_sin_phi,this.atanh_esin_phi=e.atanh_esin_phi,this.make_negative=e.make_negative}function me(){return{...this}}class he{m_a;m_b;m_eSquared;m_inputSR;m_inputGCS;m_transformPCS2GCS=null;m_curveType;m_progressTracker;m_scaleToRadians=new K;m_scaleToDegrees=new K;m_rpu;constructor(t,n,r){this.m_progressTracker=r,i(n!==4),this.m_curveType=n,this.m_inputSR=t,(!t||t.getCoordinateSystemType()===0)&&e(``),this.m_inputGCS=t.getGCS(),this.m_a=0,this.m_eSquared=0,this.m_b=0,this.m_rpu=0}executePolygonGeodeticArea(e){let t=e.clone();if(t.dropAllAttributes(),e.hasNonLinearSegments()&&(t=new c().execute(t,0,this.m_inputSR.getTolerance(0),0,this.m_progressTracker)),this.m_inputSR.isPannable()){let e=new z;t.queryEnvelope(e);let n=this.m_inputSR.getPannableExtent();if(!n.containsEnvelope(e)){let r=n.getCenterX()-e.getCenterX(),i=new K;i.setShiftCoords(r,0),t.applyTransformation(i),e.move(r,0);let a=new N;n.queryIntervalX(a);let o=new N;e.queryIntervalX(o),t=a.contains(o)?_(t,this.m_inputSR):new p().foldInto360RangeGeodetic(t,this.m_inputSR,this.m_curveType)}}let n;if(this.m_transformPCS2GCS?(t=new u().execute(t,this.m_inputSR,!1,this.m_progressTracker),n=t.createInstance(),v(this.m_transformPCS2GCS,t,n,this.m_progressTracker)||(n=new p().execute(t,this.m_transformPCS2GCS,this.m_progressTracker))):n=new u().execute(t,this.m_inputGCS,!1,this.m_progressTracker),n.isEmpty())return 0;if(this.m_curveType===1){let e=d();return this.m_inputGCS.querySpheroidData(e),this.m_a=e.majorSemiAxis,this.m_eSquared=e.e2,this.loxodromeArea(n)}let r=n.getImpl();this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_scaleToRadians.setScale(this.m_rpu),r.applyTransformation(this.m_scaleToRadians),this.m_scaleToDegrees=this.m_scaleToRadians,this.m_scaleToDegrees.invertThis();let i=d();if(this.m_inputGCS.querySpheroidData(i),this.m_a=i.majorSemiAxis,this.m_b=i.minorSemiAxis,this.m_eSquared=i.e2,this.m_curveType===2)return this.executeClippedPolygonGreatEllipticArea(n);{let e={stack:[],error:void 0,hasError:!1};try{let t=y.unit(9101),r=this.m_inputGCS.getPECoordSys(),i=W(e,r.cloneAlterUnits(t),!1),a=this.executeClippedPolygonGeodeticArea(n,i,0),o,s,c=0;do c++,o=this.executeClippedPolygonGeodeticArea(n,i,c),s=Math.abs(o-a),a=o;while(Math.abs(o)>1&&s>1e-8*Math.abs(o)&&c<7);return o}catch(t){e.error=t,e.hasError=!0}finally{G(e)}}}executeClippedPolygonGeodeticArea(e,t,n){let r={stack:[],error:void 0,hasError:!1};try{let i=new z;e.queryEnvelope(i);let a=W(r,this.getEqualAreaPCSInstance(t,i),!1),o=e.clone();b(a,o);let s=o.getImpl().getAttributeStreamRef(0),c=e.getImpl().getAttributeStreamRef(0),l=W(r,new x,!1),u=W(r,new x,!1),d=[0,0],p=ee(Z,40),m=k(40,-1),h=Z(),g=Z(),_,v,y=a,C=o.calculateArea2D(),w=new O(0),T=Math.PI*.5,E=Math.abs(C)*1e-10+1e-6,A=e.getPathCount(),j,M,N,F,I=new D,L=new D,R=new D,B=new D,V=new D,H=new D,U,G;for(M=e.getPathStart(0),j=0;j<A;j++,M=N)for(N=e.getPathEnd(j),s.queryPoint2D(N-1<<1,R),c.queryPoint2D(N-1<<1,I),Math.abs(I.y)>T&&(I.y=P(T,I.y)),F=M;F<N;F++,R.assign(B),I.assign(L)){if(s.queryPoint2D(F<<1,B),c.queryPoint2D(F<<1,L),Math.abs(L.y)>T&&(L.y=P(T,L.y)),U=D.distance(R,B),U<50||I.y===0&&L.y===0)continue;S.geodeticDistance(this.m_a,this.m_eSquared,I.x,I.y,L.x,L.y,l,u,null,this.m_curveType);let e=l.val,t=u.val;for(h.setValues(0,R),g.setValues(1,B),v=n,p[0].assign(g),m[0]=n,_=0;_>=0;){G=(h.m_factor+g.m_factor)*.5,S.geodeticCoordinate(this.m_a,this.m_eSquared,I.x,I.y,e*G,t,l,u,this.m_curveType),V.x=l.val,V.y=u.val,d[0]=V.x,d[1]=V.y,f.geogToProj(y,1,d),H.x=d[0],H.y=d[1];let n=-H.offset(h.m_p_PCS,g.m_p_PCS),r=D.distance(h.m_p_PCS,g.m_p_PCS),i=.5*n*r;if(w.pe(i),Math.abs(i)>E||Math.abs(i)>0&&v>0)g.setValues(G,H),_++,p[_].assign(g),Math.abs(i)<=E?(v--,m[_-1]=v,m[_]=v):(v=m[_-1],m[_]=v);else{if(_<=0)break;h.assign(g),_--,g.assign(p[_]),v=m[_]}}}return C+=w.getResult(),Math.abs(C)}catch(e){r.error=e,r.hasError=!0}finally{G(r)}}executeClippedPolygonGreatEllipticArea(e){let t=[],n=[],r=new D,i=new D,a=C(1,this.m_eSquared,new D(0,Math.PI*.5)),o=new O(0),s=new O(0),c=new O(0),l=new V,u=new V,d=new z;e.queryLooseEnvelope(d);let f=0;d.containsCoords(d.xmin,0)||(f=Math.abs(d.ymin)<Math.abs(d.ymax)?d.ymin:d.ymax);let p=new le(this.m_eSquared,l,u,f),m=this.m_a*this.m_a,h=e.getImpl().querySegmentIterator();for(h.stripAttributes();h.nextPath();)for(;h.hasNextSegment();){let e=h.nextSegment();r.assign(e.getStartXY()),i.assign(e.getEndXY()),i.x-r.x>Math.PI?r.x+=Math.PI*2:i.x-r.x<-Math.PI&&(i.x+=Math.PI*2),this.splitSegmentCrossingItegralThreshold(e,t,n);for(let e of t)l.assign(C(this.m_a,this.m_eSquared,e.getStartXY())),u.assign(C(this.m_a,this.m_eSquared,e.getEndXY())),p.setSegmentEndPoints(l,u),this.adaptiveIntegrationWithRomberg(p,o);for(let e of n){let t=e.getStartXY(),n=e.getEndXY(),r=f;t.y<0&&(n=F(t,t=n),t.y=-t.y,n.y=-n.y,r=-r);let i=C(1,this.m_eSquared,t),o=C(1,this.m_eSquared,n),l=Math.min(t.y,n.y),u=w(this.m_eSquared,t.x,n.x,r,l);s.pe(u);let d=Math.abs(w(this.m_eSquared,t.x,n.x,l,j)),p=new V;p.setSub(i,a);let h=new V;h.setSub(o,a);let g=new V;g.setCrossProductVector(p,h);let _=m*(d-.5*g.length());_=P(_,n.x-t.x),c.pe(_)}t.length=0,n.length=0}return c.getResult()+m*(.5*(1-this.m_eSquared)*o.getResult()+s.getResult())}getEqualAreaPCSInstance(e,t){let n=t.getCenterX(),r,i,a=t.height(),o;(o=t.ymin>Math.PI*45/180||t.ymax<-Math.PI*45/180)?r=P(Math.PI*.5,t.getCenterY()):(r=t.getCenterY(),i=t.ymin+2/3*a);let s,c=h(`EqualAreaPCS`),l=e.toString();return s=o?y.fromString(m.PE_TYPE_PROJCS,`PROJCS["${c}", ${l}, PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing", 0],PARAMETER["Central_Meridian", ${n}], PARAMETER["Latitude_of_Origin", ${r}], UNIT["Meter",1.0]]`,!0):y.fromString(m.PE_TYPE_PROJCS,`PROJCS["${c}", ${l}, PROJECTION["Cylindrical_Equal_Area"],PARAMETER["False_Easting", 0],PARAMETER["False_Northing", 0],PARAMETER["Central_Meridian", ${n}],PARAMETER["Standard_Parallel_1", ${i}],PARAMETER["Latitude_of_Origin", ${r}],UNIT["Meter",1.0]]`,!0),s}splitSegmentCrossingItegralThreshold(e,t,n){let r=C(this.m_a,this.m_eSquared,new D(0,j)),i=C(this.m_a,this.m_eSquared,new D(0,-j)),a=this.splitSegmentPassingThroughPole(e);for(let e of a){let a=e.getStartXY(),o=e.getEndXY(),c=C(this.m_a,this.m_eSquared,a),l=C(this.m_a,this.m_eSquared,o),u=new D,d=new V,f=V.sqrDistance(r,c),p=V.sqrDistance(c,l);if(f<=100){if(p>400)d.assign(l.sub(c)),d.normalizeThis(),d.assign(c.add(d.mul(20))),u.assign(T(this.m_a,this.m_eSquared,d));else{n.push(new s({start:a,end:o}));continue}n.push(new s({start:a,end:u})),a.assign(u)}if(c.assign(C(this.m_a,this.m_eSquared,a)),f=V.sqrDistance(r,l),p=V.sqrDistance(c,l),f<=100){if(p>400)d.assign(l.sub(c)),d.normalizeThis(),d.assign(l.sub(d.mul(20))),u.assign(T(this.m_a,this.m_eSquared,d));else{n.push(new s({start:a,end:o}));continue}n.push(new s({start:u,end:o})),o.assign(u)}if(c.assign(C(this.m_a,this.m_eSquared,a)),l.assign(C(this.m_a,this.m_eSquared,o)),f=V.sqrDistance(i,c),p=V.sqrDistance(c,l),f<=100){if(p>400)d.assign(l.sub(c)),d.normalizeThis(),d.assign(c.add(d.mul(20))),u.assign(T(this.m_a,this.m_eSquared,d));else{n.push(new s({start:a,end:o}));continue}n.push(new s({start:a,end:u})),a.assign(u)}if(c.assign(C(this.m_a,this.m_eSquared,a)),l.assign(C(this.m_a,this.m_eSquared,o)),f=V.sqrDistance(i,l),p=V.sqrDistance(c,l),f<=100){if(p>400)d.assign(l.sub(c)),d.normalizeThis(),d.assign(l.sub(d.mul(20))),u.assign(T(this.m_a,this.m_eSquared,d));else{n.push(new s({start:a,end:o}));continue}n.push(new s({start:u,end:o})),o.assign(u)}t.push(new s({start:a,end:o}))}}splitSegmentPassingThroughPole(e){let t={stack:[],error:void 0,hasError:!1};try{let n=[],r=new V,i=new V,a=new V,o=new D,c=e.getStartXY(),l=e.getEndXY(),u=W(t,new x,!1);if(S.geodeticDistance(this.m_a,this.m_eSquared,c.x,c.y,l.x,l.y,u,null,null,2),Math.abs(l.x-c.x)>3.124139361&&u.val>20){let e=new q(new D(0,90),c.divide(this.m_rpu),l.divide(this.m_rpu),this.m_inputGCS,2,2),t=E(e.makeFunctor(),0,1,1e-10);if(t.second<=10&&t.first>0&&t.first<1||(e.setPointDistFrom(new D(0,-90)),t=E(e.makeFunctor(),0,1,1e-10),t.second<=10&&t.first>0&&t.first<1))return r.assign(C(this.m_a,this.m_eSquared,c)),i.assign(C(this.m_a,this.m_eSquared,l)),I(r,i,t.first,a),o.assign(T(this.m_a,this.m_eSquared,a)),n.push(new s({start:c,end:o})),n.push(new s({start:o,end:l})),n}return n.push(new s({start:c,end:l})),n}catch(e){t.error=e,t.hasError=!0}finally{G(t)}}adaptiveIntegrationWithRomberg(e,t){let n=e.makeFunctor(),r=0,i=1,a=n(r),s=n(i),c=1e-17,l=1e-14,u=(r+i)/2,d=n(u),f=Math.abs(d-a),p=Math.abs(s-d),m=0;for(;m++<32&&(f/p<.1||p/f<.1);)f<p?(t.pe(o(5,r,u,l,c,n)),r=u,a=d):(t.pe(o(5,u,i,l,c,n)),i=u,s=d),u=(r+i)/2,d=Math.abs(n(u)),f=Math.abs(d-a),p=Math.abs(s-d);t.pe(o(5,r,i,l,c,n))}loxodromeAreaHemi(e,t,n,r,i){let a=n.clone(),o=i.clone(),s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S;return a.make_negative&&a.changeSign(),o.make_negative&&o.changeSign(),_=r-t,Math.abs(a.sin_phi)===1||Math.abs(o.sin_phi)===1?e.half_qp*_:a.sin_phi===o.sin_phi?(g=e.one_m_e_2*.5*a.sin_phi*(1/a.one_m_e_2_sin_2_phi+L(e.e*a.sin_phi))*_,g):(x=Math.log(o.sin_half_phi_pf*a.sin_half_phi_pz/(o.sin_half_phi_pz*a.sin_half_phi_pf)),S=Math.log(o.sin_half_asin_e_sin_phi_pf*a.sin_half_asin_e_sin_phi_pz/(o.sin_half_asin_e_sin_phi_pz*a.sin_half_asin_e_sin_phi_pf)),this.m_eSquared===1?(d=0,s=.5*(x+o.sin_phi/o.one_m_e_2_sin_2_phi-a.sin_phi/a.one_m_e_2_sin_2_phi),c=0):(d=-2*e.atanh_e_over_e*(Math.log(o.one_p_sin_phi/a.one_p_sin_phi)-e.e*S),s=(x-e.e*S)/e.one_m_e_2,c=(Math.log(o.one_m_e_2_sin_2_phi/a.one_m_e_2_sin_2_phi)+d/e.atanh_e_over_e)/e.one_m_e_2),l=-S*(a.atanh_esin_phi+o.atanh_esin_phi),u=1/a.one_m_e_2_sin_2_phi-1/o.one_m_e_2_sin_2_phi,f=R(o.one_m_sin_phi/e.one_p_e,e.e)-R(a.one_m_sin_phi/e.one_p_e,e.e),p=R(o.one_p_sin_phi/e.one_p_e,e.e)-R(a.one_p_sin_phi/e.one_p_e,e.e),m=R(a.one_m_sin_phi/-e.one_m_e,e.e)-R(o.one_m_sin_phi/-e.one_m_e,e.e),h=R(a.one_p_sin_phi/-e.one_m_e,e.e)-R(o.one_p_sin_phi/-e.one_m_e,e.e),g=.25/s*(c+l+u+d+.5*(f+p+m+h)),g+=e.half_qp,v=e.one_m_e_2*.5*a.sin_phi*(1/a.one_m_e_2_sin_2_phi+L(e.e*a.sin_phi)),y=e.one_m_e_2*.5*o.sin_phi*(1/o.one_m_e_2_sin_2_phi+L(e.e*o.sin_phi)),y<v&&(b=v,v=y,y=b),g<v&&(g=v),g>y&&(g=y),g*=_,g)}loxodromeArea(e){let t=Math.PI/180,n=0,r=ue(),i=$(),a=$();r.e=Math.sqrt(this.m_eSquared),r.one_p_e=1+r.e,r.one_m_e=1-r.e,r.one_m_e_2=1-this.m_eSquared,r.atanh_e_over_e=L(r.e),r.half_qp=this.m_eSquared>=1?1:.5*(1+r.atanh_e_over_e*r.one_m_e_2),r.f=.25*Math.PI,r.z=.75*Math.PI,a.initialize(0,r.e,r.f,r.z);let o=e.getPathCount(),s=new D,c=new D,l=e.getImpl().getAttributeStreamRef(0);for(let u=0;u<o;u++){let o=e.getPathStart(u),d=e.getPathEnd(u);if(!(d-o<=1)){l.queryPoint2D((d-1)*2,s);for(let e=o;e<d;e++){l.queryPoint2D(e*2,c);let u=s.y*t,d=c.y*t;if(e===o?(i.initialize(u,r.e,r.f,r.z),i.make_negative=!1):i.assign(a),a.initialize(d,r.e,r.f,r.z),a.make_negative=!1,s.y*c.y<0){if(s.y>=90&&c.y<=-90||c.y>=90&&s.y<=-90)return NaN;let e=$();e.initialize(0,r.e,r.f,r.z),e.make_negative=!1;let o=i.atanh_sin_phi-r.e*i.atanh_esin_phi,l=a.atanh_sin_phi-r.e*a.atanh_esin_phi,d=(l*s.x-o*c.x)/(l-o);u<0?(i.make_negative=!0,n-=this.loxodromeAreaHemi(r,s.x*t,i,d*t,e),i.make_negative=!1,n+=this.loxodromeAreaHemi(r,d*t,e,c.x*t,a)):(n+=this.loxodromeAreaHemi(r,s.x*t,i,d*t,e),a.make_negative=!0,n-=this.loxodromeAreaHemi(r,d*t,e,c.x*t,a),a.make_negative=!1)}else s.y>=0?n+=this.loxodromeAreaHemi(r,s.x*t,i,c.x*t,a):(i.make_negative=!0,a.make_negative=!0,n-=this.loxodromeAreaHemi(r,s.x*t,i,c.x*t,a),i.make_negative=!1,a.make_negative=!1);s.assign(c)}}}return this.m_a*n*this.m_a}calculate(e){if(e.isEmpty()||e.getDimension()<2)return 0;if(e.getGeometryType()===n.enumEnvelope){let t=new a;return t.addEnvelope(e,!1),this.calculate(t)}return this.m_inputSR!==this.m_inputGCS&&this.m_transformPCS2GCS===null&&(this.m_transformPCS2GCS=l(this.m_inputSR,this.m_inputGCS,null)),this.executePolygonGeodeticArea(e)}}class ge{getOperatorType(){return 10311}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}execute(e,n,r,i){return t(e),r===4?new se().execute(e,n,i):new he(n,r,i).calculate(e)}}export{ge as OperatorGeodeticArea};
2
+ import{b as e,t,G as n,d as r,g as i}from"./Geometry.js";import{P as a,x as o,L as s}from"./MultiPathImpl.js";import{O as c}from"./OperatorDensify.js";import{D as l,J as u,r as d,aD as f,O as p,aN as m,j as h,b as g,ag as _,aF as v,aX as y,aY as b,an as x,ao as S,av as C,aZ as w,aC as T,ay as E}from"./UnitFactory.js";import{P as D,K as O,c as k,o as A,l as j,e as M,E as N,q as ee,j as P,s as F,y as I,z as L,A as R}from"./Point2D.js";import{Envelope2D as z}from"./Envelope2D.js";import{c as B,k as V}from"./Envelope.js";import{O as H}from"./OperatorClip.js";import{O as U}from"./OperatorShapePreservingLength.js";import{__addDisposableResource as W,__disposeResources as G}from"tslib";import{T as K}from"./Transformation2D.js";import{a as q}from"./GeodeticDistanceCalculator-zRp89-dW.js";class te{m_startPt;m_endPt;m_cE2;m_cE;m_c1By2e;m_cRpu;isPcs;PEProjcs;m_points;constructor(e,t,n,r,i=100){this.m_startPt=e.clone(),this.m_endPt=t.clone(),this.m_cE2=r,this.m_cE=Math.sqrt(this.m_cE2),this.m_c1By2e=1/(2*this.m_cE),this.m_cRpu=n.getGCS().getUnit().getUnitToBaseFactor(),this.isPcs=n.getCoordinateSystemType()===2,this.PEProjcs=n.getPECoordSys(),this.m_points=k(i*2,NaN)}setSegmentEndPoints(e,t){this.m_startPt.assign(e),this.m_endPt.assign(t)}makeFunctor(){return e=>{let t=[0,0];t[0]=this.m_startPt.x*(1-e)+this.m_endPt.x*e,t[1]=this.m_startPt.y*(1-e)+this.m_endPt.y*e,this.isPcs&&f.projToGeogCenter(this.PEProjcs,1,t,0);let n=Math.sin(t[1]*this.m_cRpu);return this.m_cE2===0?n:-(Math.log((1-this.m_cE*n)/(1+this.m_cE*n))*this.m_c1By2e)+n/(1-this.m_cE2*n*n)}}}function ne(e,t,n){let r=new z;e.queryEnvelope(r);let i=B(t,r,!0).total(),a=t.getPannableExtent();a.xmin=r.xmin-10*i,a.xmax=r.xmax+10*i;let s=new H().execute(e,a,t,n).getImpl().querySegmentIterator();s.stripAttributes();let c=d();t.querySpheroidData(c);let l=c.e2,u=l===0?2:1,f=new D(0,0),p=new D(0,0),m=new O(0),h=new te(f,p,t,l,100);for(;s.nextPath();)for(;s.hasNextSegment();){let e=s.nextSegment();f.assign(e.getStartXY()),p.assign(e.getEndXY()),h.setSegmentEndPoints(f,p);let t=o(6,0,1,1e-12,1e-15,h.makeFunctor());m.pe((p.x-f.x)*t)}let g=c.majorSemiAxis;return u*g*g*(1-l)*Math.PI*m.getResult()/t.getPannableExtent().width()}function re(e,t,n,r,i){let a=oe(e,t,i),o=J(e,a.first,n,r,i),s=1,c=0,l=0;do{if(s++,a.first*=.5,a.first<t.getTolerance(0)*50)return o;a.second*=2,l=J(e,a.first,n,r,i),c=Math.abs(l-o),o=l}while(Math.abs(o)>1&&c>1e-8*Math.abs(o)&&(a.second<65e3&&s<8||s<4));return l}function J(e,t,n,r,i){let a=new c().execute(e,t,0,0,i),o;o=r?new p().execute(a,r,i):a;let s=n.getUnit().getUnitToBaseFactor()===1?Math.PI/180:1,l=new z;o.queryEnvelope(l);let u=new z,d=new z,f=new z;u.setCoords({xmin:l.xmin,ymin:75*s,xmax:l.xmax,ymax:90*s}),d.setCoords({xmin:l.xmin,ymin:-60*s,xmax:l.xmax,ymax:75*s}),f.setCoords({xmin:l.xmin,ymin:-90*s,xmax:l.xmax,ymax:-60*s}),u.inflateCoords(u.width()*.01,0),d.inflateCoords(d.width()*.01,0),f.inflateCoords(f.width()*.01,0);let m=0;return m+=Y(o,u,n,i),m+=Y(o,d,n,i),m+=Y(o,f,n,i),m}function Y(e,t,n,r){let i=new H().execute(e,t,n,r);if(i!==null&&!i.isEmpty()){let e=new z;i.queryEnvelope(e);let{first:t,second:a}=ae(n,e,!1),o=l(n,t,null),s=new p().execute(i,o,r).calculateArea2D();return a&&t.destroy(),s}return 0}const X=[null,null,null,null,null,null,null];function ie(e,t,n){let a=e.getUnit().getUnitToBaseFactor(),o=t.getCenter();o.scale(a*180/Math.PI);let s=new D;s.x=0,s.y=0;let c=0;if(c===0){o.y>45?(s.y=j,c=0):o.y<-45?(s.y=-j,c=1):o.x>=45&&o.x<135?(s.x=j,c=2):o.x>=135||o.x<-135?(s.x=j,c=3):o.x<-45&&o.x>=-135?(s.x=-j,c=4):(s.x=0,c=5);let e=a*Math.sqrt(M(t.xmin-t.xmax)+M(t.ymin-t.ymax)),n=s.clone(),r=t.getCenter();if(r.scale(a),c<2&&(n.x=r.x),D.distance(n,r)+e*.5>j)return null}let l=X[c];if(l!==null&&l.getGCS().equalHorizontal(e))return l;let u=e.getText(),d=s.x,f=s.y,p=0,_=-1;c===6?(i(n),p=0,_=m.PE_PRJ_CYLINDRICAL_EQAREA):_=m.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA;let v=h(`EqualAreaPCS`),y;_===m.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA?y=`PROJCS["${v}",${u},PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",${d}],PARAMETER["Latitude_of_Origin",${f}],UNIT["Meter",1.0]]`:_===m.PE_PRJ_CYLINDRICAL_EQAREA?y=`PROJCS["${v}",${u},PROJECTION["Cylindrical_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",${d}],PARAMETER["Standard_Parallel_1",${p}],PARAMETER["Latitude_of_Origin",${f}],UNIT["Meter",1.0]]`:r(`getEqualAreaPcsFixed`);let b=g(y);return X[c]&&X[c].destroy(),X[c]=b,b}function ae(e,t,n){let i=ie(e,t,n);if(i!==null)return A(i,!1);let a=e.getText(),o=e.getUnit().getUnitToBaseFactor(),s=(t.xmin+t.width()/2)*o,c=(t.ymin+t.height()/2)*o,l=0,u=0,d=-1;t.ymin*o>=75*Math.PI/180||t.ymax*o<=-60*Math.PI/180?d=m.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA:t.ymin>0||t.ymax<0?(l=(t.ymin+1/3*t.height())*o,u=(t.ymin+2/3*t.height())*o,d=m.PE_PRJ_ALBERS):(l=(t.ymin+2/3*t.height())*o,d=m.PE_PRJ_CYLINDRICAL_EQAREA);let f=h(`EqualAreaPCS`),p;return d===m.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA?p=`PROJCS["${f}",${a},PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",${s}],PARAMETER["Latitude_of_Origin",${c}],UNIT["Meter",1.0]]`:d===m.PE_PRJ_ALBERS?p=`PROJCS["${f}",${a},PROJECTION["Albers"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",${s}],PARAMETER["Standard_Parallel_1",${l}],PARAMETER["Standard_Parallel_2",${u}],PARAMETER["Latitude_of_Origin",${c}],UNIT["Meter",1.0]]`:d===m.PE_PRJ_CYLINDRICAL_EQAREA?p=`PROJCS["${f}",${a},PROJECTION["Cylindrical_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",${s}],PARAMETER["Standard_Parallel_1",${l}],PARAMETER["Latitude_of_Origin",${c}],UNIT["Meter",1.0]]`:r(`getEqualAreaPCSInstance`),A(g(p),!0)}function oe(e,t,n){let r=e.calculateLength2D(),i=new U().execute(e,t,n)/25e3,a=r/e.getSegmentCount()*2,o=Math.min(a,r/i);return o===0&&(o=1),A(o,r/o)}class se{getOperatorType(){return 10314}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}execute(r,i,o){if(i.getCoordinateSystemType()===0&&e(``),r.isEmpty()||r.getDimension()<2)return 0;if(t(r),r.getGeometryType()===n.enumEnvelope){let e=new a;return e.addEnvelope(r,!1),this.execute(e,i,o)}let s=r;r.getDescription().getAttributeCount()>1&&(s=r.clone(),s.dropAllAttributes());let d=new c().execute(s,0,i.getTolerance(0),0,o),f=null,p=i.getGCS();p!==i&&(f=l(i,p));let m=new u().execute(d,i,!1,o);return m.isEmpty()?0:(m===r&&(m=r.clone()),i.isPannable()?ne(m,i,o):re(m,i,p,f,o))}}function Z(){return{m_p_PCS:new D,m_factor:NaN,setValues:Q,assign:ce}}function Q(e,t){this.m_factor=e,this.m_p_PCS.assign(t)}function ce(e){this.m_factor=e.m_factor,this.m_p_PCS.assign(e.m_p_PCS)}class le{m_ptStart=new V;m_ptEnd=new V;m_deltaX;m_deltaY;m_e;m_e2;m_c1MinusE2;m_baseA;constructor(e,t,n,r){this.m_ptStart.assign(t),this.m_ptEnd.assign(n),this.m_deltaX=this.m_ptEnd.x-this.m_ptStart.x,this.m_deltaY=this.m_ptEnd.y-this.m_ptStart.y,this.m_e=Math.sqrt(e),this.m_e2=e,this.m_c1MinusE2=1-e;let i=Math.sin(r),a;a=this.m_e2===0?2*i:i*(L(this.m_e*i)+1/(1-this.m_e2*i*i)),this.m_baseA=a}setSegmentEndPoints(e,t){this.m_ptStart.assign(e),this.m_ptEnd.assign(t),this.m_deltaX=this.m_ptEnd.x-this.m_ptStart.x,this.m_deltaY=this.m_ptEnd.y-this.m_ptStart.y}makeFunctor(){return e=>{let t=1-e,n=t*this.m_ptStart.x+e*this.m_ptEnd.x,r=t*this.m_ptStart.y+e*this.m_ptEnd.y,i=t*this.m_ptStart.z+e*this.m_ptEnd.z,a=n*n+r*r,o=i/Math.sqrt(i*i+this.m_c1MinusE2*this.m_c1MinusE2*a),s;return s=this.m_e2===0?2*o:o*(L(this.m_e*o)+1/(1-this.m_e2*o*o)),(this.m_deltaY*n-this.m_deltaX*r)/a*(s-this.m_baseA)}}}function ue(){return{e:NaN,one_p_e:NaN,one_m_e:NaN,one_m_e_2:NaN,atanh_e_over_e:NaN,half_qp:NaN,f:NaN,z:NaN}}function $(){return{sin_phi:NaN,one_p_sin_phi:NaN,one_m_sin_phi:NaN,one_m_e_2_sin_2_phi:NaN,sin_half_phi_pf:NaN,sin_half_phi_pz:NaN,sin_half_asin_e_sin_phi_pf:NaN,sin_half_asin_e_sin_phi_pz:NaN,atanh_sin_phi:NaN,atanh_esin_phi:NaN,make_negative:!1,initialize:de,changeSign:fe,assign:pe,clone:me}}function de(e,t,n,r){let i=.5*e;this.sin_phi=Math.sin(e);let a=t*this.sin_phi,o=.5*Math.asin(a);this.one_p_sin_phi=1+this.sin_phi,this.one_m_sin_phi=1-this.sin_phi,this.one_m_e_2_sin_2_phi=(1+a)*(1-a),this.sin_half_phi_pf=Math.sin(i+n),this.sin_half_phi_pz=Math.sin(i+r),this.sin_half_asin_e_sin_phi_pf=Math.sin(o+n),this.sin_half_asin_e_sin_phi_pz=Math.sin(o+r),this.atanh_sin_phi=Math.log(this.sin_half_phi_pf/this.sin_half_phi_pz),this.atanh_esin_phi=Math.log(this.sin_half_asin_e_sin_phi_pf/this.sin_half_asin_e_sin_phi_pz)}function fe(){this.sin_phi=-this.sin_phi;let e=this.one_p_sin_phi;this.one_p_sin_phi=this.one_m_sin_phi,this.one_m_sin_phi=e,e=this.sin_half_phi_pf,this.sin_half_phi_pf=this.sin_half_phi_pz,this.sin_half_phi_pz=e,e=this.sin_half_asin_e_sin_phi_pf,this.sin_half_asin_e_sin_phi_pf=this.sin_half_asin_e_sin_phi_pz,this.sin_half_asin_e_sin_phi_pz=e,this.atanh_sin_phi=-this.atanh_sin_phi,this.atanh_esin_phi=-this.atanh_esin_phi}function pe(e){this.sin_phi=e.sin_phi,this.one_p_sin_phi=e.one_p_sin_phi,this.one_m_sin_phi=e.one_m_sin_phi,this.one_m_e_2_sin_2_phi=e.one_m_e_2_sin_2_phi,this.sin_half_phi_pf=e.sin_half_phi_pf,this.sin_half_phi_pz=e.sin_half_phi_pz,this.sin_half_asin_e_sin_phi_pf=e.sin_half_asin_e_sin_phi_pf,this.sin_half_asin_e_sin_phi_pz=e.sin_half_asin_e_sin_phi_pz,this.atanh_sin_phi=e.atanh_sin_phi,this.atanh_esin_phi=e.atanh_esin_phi,this.make_negative=e.make_negative}function me(){return{...this}}class he{m_a;m_b;m_eSquared;m_inputSR;m_inputGCS;m_transformPCS2GCS=null;m_curveType;m_progressTracker;m_scaleToRadians=new K;m_scaleToDegrees=new K;m_rpu;constructor(t,n,r){this.m_progressTracker=r,i(n!==4),this.m_curveType=n,this.m_inputSR=t,t&&t.getCoordinateSystemType()!==0||e(``),this.m_inputGCS=t.getGCS(),this.m_a=0,this.m_eSquared=0,this.m_b=0,this.m_rpu=0}executePolygonGeodeticArea(e){let t=e.clone();if(t.dropAllAttributes(),e.hasNonLinearSegments()&&(t=new c().execute(t,0,this.m_inputSR.getTolerance(0),0,this.m_progressTracker)),this.m_inputSR.isPannable()){let e=new z;t.queryEnvelope(e);let n=this.m_inputSR.getPannableExtent();if(!n.containsEnvelope(e)){let r=n.getCenterX()-e.getCenterX(),i=new K;i.setShiftCoords(r,0),t.applyTransformation(i),e.move(r,0);let a=new N;n.queryIntervalX(a);let o=new N;e.queryIntervalX(o),t=a.contains(o)?_(t,this.m_inputSR):new p().foldInto360RangeGeodetic(t,this.m_inputSR,this.m_curveType)}}let n;if(this.m_transformPCS2GCS?(t=new u().execute(t,this.m_inputSR,!1,this.m_progressTracker),n=t.createInstance(),v(this.m_transformPCS2GCS,t,n,this.m_progressTracker)||(n=new p().execute(t,this.m_transformPCS2GCS,this.m_progressTracker))):n=new u().execute(t,this.m_inputGCS,!1,this.m_progressTracker),n.isEmpty())return 0;if(this.m_curveType===1){let e=d();return this.m_inputGCS.querySpheroidData(e),this.m_a=e.majorSemiAxis,this.m_eSquared=e.e2,this.loxodromeArea(n)}let r=n.getImpl();this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_scaleToRadians.setScale(this.m_rpu),r.applyTransformation(this.m_scaleToRadians),this.m_scaleToDegrees=this.m_scaleToRadians,this.m_scaleToDegrees.invertThis();let i=d();if(this.m_inputGCS.querySpheroidData(i),this.m_a=i.majorSemiAxis,this.m_b=i.minorSemiAxis,this.m_eSquared=i.e2,this.m_curveType===2)return this.executeClippedPolygonGreatEllipticArea(n);{let e={stack:[],error:void 0,hasError:!1};try{let t=y.unit(9101),r=this.m_inputGCS.getPECoordSys(),i=W(e,r.cloneAlterUnits(t),!1),a=this.executeClippedPolygonGeodeticArea(n,i,0),o,s,c=0;do c++,o=this.executeClippedPolygonGeodeticArea(n,i,c),s=Math.abs(o-a),a=o;while(Math.abs(o)>1&&s>1e-8*Math.abs(o)&&c<7);return o}catch(t){e.error=t,e.hasError=!0}finally{G(e)}}}executeClippedPolygonGeodeticArea(e,t,n){let r={stack:[],error:void 0,hasError:!1};try{let i=new z;e.queryEnvelope(i);let a=W(r,this.getEqualAreaPCSInstance(t,i),!1),o=e.clone();b(a,o);let s=o.getImpl().getAttributeStreamRef(0),c=e.getImpl().getAttributeStreamRef(0),l=W(r,new x,!1),u=W(r,new x,!1),d=[0,0],p=ee(Z,40),m=k(40,-1),h=Z(),g=Z(),_,v,y=a,C=o.calculateArea2D(),w=new O(0),T=Math.PI*.5,E=Math.abs(C)*1e-10+1e-6,A=e.getPathCount(),j,M,N,F,I=new D,L=new D,R=new D,B=new D,V=new D,H=new D,U,G;for(M=e.getPathStart(0),j=0;j<A;j++,M=N)for(N=e.getPathEnd(j),s.queryPoint2D(N-1<<1,R),c.queryPoint2D(N-1<<1,I),Math.abs(I.y)>T&&(I.y=P(T,I.y)),F=M;F<N;F++,R.assign(B),I.assign(L)){if(s.queryPoint2D(F<<1,B),c.queryPoint2D(F<<1,L),Math.abs(L.y)>T&&(L.y=P(T,L.y)),U=D.distance(R,B),U<50||I.y===0&&L.y===0)continue;S.geodeticDistance(this.m_a,this.m_eSquared,I.x,I.y,L.x,L.y,l,u,null,this.m_curveType);let e=l.val,t=u.val;for(h.setValues(0,R),g.setValues(1,B),v=n,p[0].assign(g),m[0]=n,_=0;_>=0;){G=(h.m_factor+g.m_factor)*.5,S.geodeticCoordinate(this.m_a,this.m_eSquared,I.x,I.y,e*G,t,l,u,this.m_curveType),V.x=l.val,V.y=u.val,d[0]=V.x,d[1]=V.y,f.geogToProj(y,1,d),H.x=d[0],H.y=d[1];let n=-H.offset(h.m_p_PCS,g.m_p_PCS),r=D.distance(h.m_p_PCS,g.m_p_PCS),i=.5*n*r;if(w.pe(i),Math.abs(i)>E||Math.abs(i)>0&&v>0)g.setValues(G,H),_++,p[_].assign(g),Math.abs(i)<=E?(v--,m[_-1]=v,m[_]=v):(v=m[_-1],m[_]=v);else{if(_<=0)break;h.assign(g),_--,g.assign(p[_]),v=m[_]}}}return C+=w.getResult(),Math.abs(C)}catch(e){r.error=e,r.hasError=!0}finally{G(r)}}executeClippedPolygonGreatEllipticArea(e){let t=[],n=[],r=new D,i=new D,a=C(1,this.m_eSquared,new D(0,Math.PI*.5)),o=new O(0),s=new O(0),c=new O(0),l=new V,u=new V,d=new z;e.queryLooseEnvelope(d);let f=0;d.containsCoords(d.xmin,0)||(f=Math.abs(d.ymin)<Math.abs(d.ymax)?d.ymin:d.ymax);let p=new le(this.m_eSquared,l,u,f),m=this.m_a*this.m_a,h=e.getImpl().querySegmentIterator();for(h.stripAttributes();h.nextPath();)for(;h.hasNextSegment();){let e=h.nextSegment();r.assign(e.getStartXY()),i.assign(e.getEndXY()),i.x-r.x>Math.PI?r.x+=Math.PI*2:i.x-r.x<-Math.PI&&(i.x+=Math.PI*2),this.splitSegmentCrossingItegralThreshold(e,t,n);for(let e of t)l.assign(C(this.m_a,this.m_eSquared,e.getStartXY())),u.assign(C(this.m_a,this.m_eSquared,e.getEndXY())),p.setSegmentEndPoints(l,u),this.adaptiveIntegrationWithRomberg(p,o);for(let e of n){let t=e.getStartXY(),n=e.getEndXY(),r=f;t.y<0&&(n=F(t,t=n),t.y=-t.y,n.y=-n.y,r=-r);let i=C(1,this.m_eSquared,t),o=C(1,this.m_eSquared,n),l=Math.min(t.y,n.y),u=w(this.m_eSquared,t.x,n.x,r,l);s.pe(u);let d=Math.abs(w(this.m_eSquared,t.x,n.x,l,j)),p=new V;p.setSub(i,a);let h=new V;h.setSub(o,a);let g=new V;g.setCrossProductVector(p,h);let _=m*(d-.5*g.length());_=P(_,n.x-t.x),c.pe(_)}t.length=0,n.length=0}return c.getResult()+m*(.5*(1-this.m_eSquared)*o.getResult()+s.getResult())}getEqualAreaPCSInstance(e,t){let n=t.getCenterX(),r,i,a=t.height(),o;(o=t.ymin>Math.PI*45/180||t.ymax<-Math.PI*45/180)?r=P(Math.PI*.5,t.getCenterY()):(r=t.getCenterY(),i=t.ymin+2/3*a);let s,c=h(`EqualAreaPCS`),l=e.toString();return s=o?y.fromString(m.PE_TYPE_PROJCS,`PROJCS["${c}", ${l}, PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing", 0],PARAMETER["Central_Meridian", ${n}], PARAMETER["Latitude_of_Origin", ${r}], UNIT["Meter",1.0]]`,!0):y.fromString(m.PE_TYPE_PROJCS,`PROJCS["${c}", ${l}, PROJECTION["Cylindrical_Equal_Area"],PARAMETER["False_Easting", 0],PARAMETER["False_Northing", 0],PARAMETER["Central_Meridian", ${n}],PARAMETER["Standard_Parallel_1", ${i}],PARAMETER["Latitude_of_Origin", ${r}],UNIT["Meter",1.0]]`,!0),s}splitSegmentCrossingItegralThreshold(e,t,n){let r=C(this.m_a,this.m_eSquared,new D(0,j)),i=C(this.m_a,this.m_eSquared,new D(0,-j)),a=this.splitSegmentPassingThroughPole(e);for(let e of a){let a=e.getStartXY(),o=e.getEndXY(),c=C(this.m_a,this.m_eSquared,a),l=C(this.m_a,this.m_eSquared,o),u=new D,d=new V,f=V.sqrDistance(r,c),p=V.sqrDistance(c,l);if(f<=100){if(p>400)d.assign(l.sub(c)),d.normalizeThis(),d.assign(c.add(d.mul(20))),u.assign(T(this.m_a,this.m_eSquared,d));else{n.push(new s({start:a,end:o}));continue}n.push(new s({start:a,end:u})),a.assign(u)}if(c.assign(C(this.m_a,this.m_eSquared,a)),f=V.sqrDistance(r,l),p=V.sqrDistance(c,l),f<=100){if(p>400)d.assign(l.sub(c)),d.normalizeThis(),d.assign(l.sub(d.mul(20))),u.assign(T(this.m_a,this.m_eSquared,d));else{n.push(new s({start:a,end:o}));continue}n.push(new s({start:u,end:o})),o.assign(u)}if(c.assign(C(this.m_a,this.m_eSquared,a)),l.assign(C(this.m_a,this.m_eSquared,o)),f=V.sqrDistance(i,c),p=V.sqrDistance(c,l),f<=100){if(p>400)d.assign(l.sub(c)),d.normalizeThis(),d.assign(c.add(d.mul(20))),u.assign(T(this.m_a,this.m_eSquared,d));else{n.push(new s({start:a,end:o}));continue}n.push(new s({start:a,end:u})),a.assign(u)}if(c.assign(C(this.m_a,this.m_eSquared,a)),l.assign(C(this.m_a,this.m_eSquared,o)),f=V.sqrDistance(i,l),p=V.sqrDistance(c,l),f<=100){if(p>400)d.assign(l.sub(c)),d.normalizeThis(),d.assign(l.sub(d.mul(20))),u.assign(T(this.m_a,this.m_eSquared,d));else{n.push(new s({start:a,end:o}));continue}n.push(new s({start:u,end:o})),o.assign(u)}t.push(new s({start:a,end:o}))}}splitSegmentPassingThroughPole(e){let t={stack:[],error:void 0,hasError:!1};try{let n=[],r=new V,i=new V,a=new V,o=new D,c=e.getStartXY(),l=e.getEndXY(),u=W(t,new x,!1);if(S.geodeticDistance(this.m_a,this.m_eSquared,c.x,c.y,l.x,l.y,u,null,null,2),Math.abs(l.x-c.x)>3.124139361&&u.val>20){let e=new q(new D(0,90),c.divide(this.m_rpu),l.divide(this.m_rpu),this.m_inputGCS,2,2),t=E(e.makeFunctor(),0,1,1e-10);if(t.second<=10&&t.first>0&&t.first<1||(e.setPointDistFrom(new D(0,-90)),t=E(e.makeFunctor(),0,1,1e-10),t.second<=10&&t.first>0&&t.first<1))return r.assign(C(this.m_a,this.m_eSquared,c)),i.assign(C(this.m_a,this.m_eSquared,l)),I(r,i,t.first,a),o.assign(T(this.m_a,this.m_eSquared,a)),n.push(new s({start:c,end:o})),n.push(new s({start:o,end:l})),n}return n.push(new s({start:c,end:l})),n}catch(e){t.error=e,t.hasError=!0}finally{G(t)}}adaptiveIntegrationWithRomberg(e,t){let n=e.makeFunctor(),r=0,i=1,a=n(r),s=n(i),c=1e-17,l=1e-14,u=(r+i)/2,d=n(u),f=Math.abs(d-a),p=Math.abs(s-d),m=0;for(;m++<32&&(f/p<.1||p/f<.1);)f<p?(t.pe(o(5,r,u,l,c,n)),r=u,a=d):(t.pe(o(5,u,i,l,c,n)),i=u,s=d),u=(r+i)/2,d=Math.abs(n(u)),f=Math.abs(d-a),p=Math.abs(s-d);t.pe(o(5,r,i,l,c,n))}loxodromeAreaHemi(e,t,n,r,i){let a=n.clone(),o=i.clone(),s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S;return a.make_negative&&a.changeSign(),o.make_negative&&o.changeSign(),_=r-t,Math.abs(a.sin_phi)===1||Math.abs(o.sin_phi)===1?e.half_qp*_:a.sin_phi===o.sin_phi?(g=e.one_m_e_2*.5*a.sin_phi*(1/a.one_m_e_2_sin_2_phi+L(e.e*a.sin_phi))*_,g):(x=Math.log(o.sin_half_phi_pf*a.sin_half_phi_pz/(o.sin_half_phi_pz*a.sin_half_phi_pf)),S=Math.log(o.sin_half_asin_e_sin_phi_pf*a.sin_half_asin_e_sin_phi_pz/(o.sin_half_asin_e_sin_phi_pz*a.sin_half_asin_e_sin_phi_pf)),this.m_eSquared===1?(d=0,s=.5*(x+o.sin_phi/o.one_m_e_2_sin_2_phi-a.sin_phi/a.one_m_e_2_sin_2_phi),c=0):(d=-2*e.atanh_e_over_e*(Math.log(o.one_p_sin_phi/a.one_p_sin_phi)-e.e*S),s=(x-e.e*S)/e.one_m_e_2,c=(Math.log(o.one_m_e_2_sin_2_phi/a.one_m_e_2_sin_2_phi)+d/e.atanh_e_over_e)/e.one_m_e_2),l=-S*(a.atanh_esin_phi+o.atanh_esin_phi),u=1/a.one_m_e_2_sin_2_phi-1/o.one_m_e_2_sin_2_phi,f=R(o.one_m_sin_phi/e.one_p_e,e.e)-R(a.one_m_sin_phi/e.one_p_e,e.e),p=R(o.one_p_sin_phi/e.one_p_e,e.e)-R(a.one_p_sin_phi/e.one_p_e,e.e),m=R(a.one_m_sin_phi/-e.one_m_e,e.e)-R(o.one_m_sin_phi/-e.one_m_e,e.e),h=R(a.one_p_sin_phi/-e.one_m_e,e.e)-R(o.one_p_sin_phi/-e.one_m_e,e.e),g=.25/s*(c+l+u+d+.5*(f+p+m+h)),g+=e.half_qp,v=e.one_m_e_2*.5*a.sin_phi*(1/a.one_m_e_2_sin_2_phi+L(e.e*a.sin_phi)),y=e.one_m_e_2*.5*o.sin_phi*(1/o.one_m_e_2_sin_2_phi+L(e.e*o.sin_phi)),y<v&&(b=v,v=y,y=b),g<v&&(g=v),g>y&&(g=y),g*=_,g)}loxodromeArea(e){let t=Math.PI/180,n=0,r=ue(),i=$(),a=$();r.e=Math.sqrt(this.m_eSquared),r.one_p_e=1+r.e,r.one_m_e=1-r.e,r.one_m_e_2=1-this.m_eSquared,r.atanh_e_over_e=L(r.e),r.half_qp=this.m_eSquared>=1?1:.5*(1+r.atanh_e_over_e*r.one_m_e_2),r.f=.25*Math.PI,r.z=.75*Math.PI,a.initialize(0,r.e,r.f,r.z);let o=e.getPathCount(),s=new D,c=new D,l=e.getImpl().getAttributeStreamRef(0);for(let u=0;u<o;u++){let o=e.getPathStart(u),d=e.getPathEnd(u);if(!(d-o<=1)){l.queryPoint2D((d-1)*2,s);for(let e=o;e<d;e++){l.queryPoint2D(e*2,c);let u=s.y*t,d=c.y*t;if(e===o?(i.initialize(u,r.e,r.f,r.z),i.make_negative=!1):i.assign(a),a.initialize(d,r.e,r.f,r.z),a.make_negative=!1,s.y*c.y<0){if(s.y>=90&&c.y<=-90||c.y>=90&&s.y<=-90)return NaN;let e=$();e.initialize(0,r.e,r.f,r.z),e.make_negative=!1;let o=i.atanh_sin_phi-r.e*i.atanh_esin_phi,l=a.atanh_sin_phi-r.e*a.atanh_esin_phi,d=(l*s.x-o*c.x)/(l-o);u<0?(i.make_negative=!0,n-=this.loxodromeAreaHemi(r,s.x*t,i,d*t,e),i.make_negative=!1,n+=this.loxodromeAreaHemi(r,d*t,e,c.x*t,a)):(n+=this.loxodromeAreaHemi(r,s.x*t,i,d*t,e),a.make_negative=!0,n-=this.loxodromeAreaHemi(r,d*t,e,c.x*t,a),a.make_negative=!1)}else s.y>=0?n+=this.loxodromeAreaHemi(r,s.x*t,i,c.x*t,a):(i.make_negative=!0,a.make_negative=!0,n-=this.loxodromeAreaHemi(r,s.x*t,i,c.x*t,a),i.make_negative=!1,a.make_negative=!1);s.assign(c)}}}return this.m_a*n*this.m_a}calculate(e){if(e.isEmpty()||e.getDimension()<2)return 0;if(e.getGeometryType()===n.enumEnvelope){let t=new a;return t.addEnvelope(e,!1),this.calculate(t)}return this.m_inputSR!==this.m_inputGCS&&this.m_transformPCS2GCS===null&&(this.m_transformPCS2GCS=l(this.m_inputSR,this.m_inputGCS,null)),this.executePolygonGeodeticArea(e)}}class ge{getOperatorType(){return 10311}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}execute(e,n,r,i){return t(e),r===4?new se().execute(e,n,i):new he(n,r,i).calculate(e)}}export{ge as OperatorGeodeticArea};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{b as e,G as t,h as n,d as r}from"./Geometry.js";import{aD as i,a4 as a,D as o,r as s,av as c}from"./UnitFactory.js";import{P as l,a as u}from"./MultiPathImpl.js";import{q as d,c as f,P as p}from"./Point2D.js";import{k as m}from"./Envelope.js";import{Envelope2D as h}from"./Envelope2D.js";import{O as g}from"./OperatorDensify.js";import{O as _}from"./OperatorClip.js";function v(){return{m_pGcs:new p,m_xyz:new m,m_factor:NaN,m_geoLength:NaN,setValues:y,setLength:b,assign:x}}function y(e,t,n,r){this.m_factor=e,this.m_pGcs.assign(t),this.m_xyz.assign(r),this.m_geoLength=n}function b(e){this.m_geoLength=e}function x(e){this.m_pGcs.assign(e.m_pGcs),this.m_xyz.assign(e.m_xyz),this.m_factor=e.m_factor,this.m_geoLength=e.m_geoLength}class S{getOperatorType(){return 10315}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}_ExecuteShapePreservingLength(e,t,n,r,o){if(e.hasNonLinearSegments()&&(e=new g().execute(e,0,t.getTolerance(0),0,o)),t.isPannable()){let r=90,a=-90;if(n.getUnit().getUnitToBaseFactor()===1&&(r*=Math.PI/180,a*=Math.PI/180),t.getCoordinateSystemType()===2){let e=null,n=[0,0,0,0];e=t.getPECoordSys(),n[0]=0,n[1]=r,n[2]=0,n[3]=a,i.geogToProj(e,2,n),r=n[1],a=n[3]}let s=new h;e.queryEnvelope(s),s.ymin=a,s.ymax=r,e=new _().execute(e,s,t,o)}else{let n=t.getPCSHorizon();e=new a().execute(e,n,t,o),e===n&&(e=e.clone())}return e.isEmpty()?0:this._ExecuteIterativeApproach(e,t,n,r,1,o)}_ExecuteIterativeApproach(e,t,n,a,o,c){let l=s();n.querySpheroidData(l);let u=l.majorSemiAxis,h=l.e2,g=n.getUnit().getUnitToBaseFactor(),_=d(v,40),y=f(40,NaN),b=v(),x=v(),S,T=[0,0,0,0],E=t.getPECoordSys(),D=new p,O=new p,k=new p,A=new p,j=new p,M=0,N=e.querySegmentIterator();for(;N.nextPath();)for(;N.hasNextSegment();){let e=N.nextSegment();D.assign(e.getStartXY()),O.assign(e.getEndXY()),t.getCoordinateSystemType()===2?(T[0]=D.x,T[1]=D.y,T[2]=O.x,T[3]=O.y,i.projToGeog(E,2,T),k.x=T[0]*g,k.y=T[1]*g,A.x=T[2]*g,A.y=T[3]*g):(k.setCoordsPoint2D(D),A.setCoordsPoint2D(O),k.scale(g),A.scale(g));let n=new m,a=new m;C(u,h,k,n),C(u,h,A,a);let s=w(u,n,a);b.setValues(0,k,NaN,n),x.setValues(1,A,s,a),S=o,_[0].assign(x),y[0]=o;let c=0;for(;;){c>128&&r(`iterations exceeded`);let n=(b.m_factor+x.m_factor)*.5,a=e.getCoord2D(n);t.getCoordinateSystemType()===2?(T[0]=a.x,T[1]=a.y,i.projToGeog(E,1,T),j.x=T[0]*g,j.y=T[1]*g):(j.setCoordsPoint2D(a),j.scale(g)),k.setCoordsPoint2D(b.m_pGcs),A.setCoordsPoint2D(x.m_pGcs);let l=new m;C(u,h,j,l);let d=w(u,b.m_xyz,l),f=w(u,x.m_xyz,l);s=x.m_geoLength,Number.isNaN(s)&&(s=w(u,b.m_xyz,x.m_xyz));let p=d+f,v=S===o&&p>=20&&Math.abs(p-s)>1e-8*(s+p);if(c+2<40&&(v||Math.abs(p-s)>0&&S>0))x.setLength(f),_[c].assign(x),x.setValues(n,j,d,l),_[++c].assign(x),v?(S=o,y[c]=o):(S--,y[c-1]=S,y[c]=S);else{if(M+=p,c===0)break;b.assign(x),x.assign(_[--c]),S=y[c]}}}return M}execute(r,i,a){if((!i||i.getCoordinateSystemType()===0)&&e(``),r.isEmpty()||r.getDimension()<1)return 0;let s=null,c=i.getGCS();c!==i&&(s=o(i,c,null));let d=r.getGeometryType();if(d===t.enumEnvelope){let e=new l;return e.addEnvelope(r,!1),this._ExecuteShapePreservingLength(e,i,c,s,a)}if(n(d)){let e=new u;return e.addSegment(r,!0),this._ExecuteShapePreservingLength(e,i,c,s,a)}return this._ExecuteShapePreservingLength(r,i,c,s,a)}}function C(e,t,n,r){r.assign(c(e,t,n))}function w(e,t,n){let r=e,i=new m;i.setSub(t,n);let a=i.length();return 2*r*Math.asin(a/(2*r))}export{S as O};
2
+ import{b as e,G as t,h as n,d as r}from"./Geometry.js";import{aD as i,a4 as a,D as o,r as s,av as c}from"./UnitFactory.js";import{P as l,a as u}from"./MultiPathImpl.js";import{q as d,c as f,P as p}from"./Point2D.js";import{k as m}from"./Envelope.js";import{Envelope2D as h}from"./Envelope2D.js";import{O as g}from"./OperatorDensify.js";import{O as _}from"./OperatorClip.js";function v(){return{m_pGcs:new p,m_xyz:new m,m_factor:NaN,m_geoLength:NaN,setValues:y,setLength:b,assign:x}}function y(e,t,n,r){this.m_factor=e,this.m_pGcs.assign(t),this.m_xyz.assign(r),this.m_geoLength=n}function b(e){this.m_geoLength=e}function x(e){this.m_pGcs.assign(e.m_pGcs),this.m_xyz.assign(e.m_xyz),this.m_factor=e.m_factor,this.m_geoLength=e.m_geoLength}class S{getOperatorType(){return 10315}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}_ExecuteShapePreservingLength(e,t,n,r,o){if(e.hasNonLinearSegments()&&(e=new g().execute(e,0,t.getTolerance(0),0,o)),t.isPannable()){let r=90,a=-90;if(n.getUnit().getUnitToBaseFactor()===1&&(r*=Math.PI/180,a*=Math.PI/180),t.getCoordinateSystemType()===2){let e=null,n=[0,0,0,0];e=t.getPECoordSys(),n[0]=0,n[1]=r,n[2]=0,n[3]=a,i.geogToProj(e,2,n),r=n[1],a=n[3]}let s=new h;e.queryEnvelope(s),s.ymin=a,s.ymax=r,e=new _().execute(e,s,t,o)}else{let n=t.getPCSHorizon();e=new a().execute(e,n,t,o),e===n&&(e=e.clone())}return e.isEmpty()?0:this._ExecuteIterativeApproach(e,t,n,r,1,o)}_ExecuteIterativeApproach(e,t,n,a,o,c){let l=s();n.querySpheroidData(l);let u=l.majorSemiAxis,h=l.e2,g=n.getUnit().getUnitToBaseFactor(),_=d(v,40),y=f(40,NaN),b=v(),x=v(),S,T=[0,0,0,0],E=t.getPECoordSys(),D=new p,O=new p,k=new p,A=new p,j=new p,M=0,N=e.querySegmentIterator();for(;N.nextPath();)for(;N.hasNextSegment();){let e=N.nextSegment();D.assign(e.getStartXY()),O.assign(e.getEndXY()),t.getCoordinateSystemType()===2?(T[0]=D.x,T[1]=D.y,T[2]=O.x,T[3]=O.y,i.projToGeog(E,2,T),k.x=T[0]*g,k.y=T[1]*g,A.x=T[2]*g,A.y=T[3]*g):(k.setCoordsPoint2D(D),A.setCoordsPoint2D(O),k.scale(g),A.scale(g));let n=new m,a=new m;C(u,h,k,n),C(u,h,A,a);let s=w(u,n,a);b.setValues(0,k,NaN,n),x.setValues(1,A,s,a),S=o,_[0].assign(x),y[0]=o;let c=0;for(;;){c>128&&r(`iterations exceeded`);let n=(b.m_factor+x.m_factor)*.5,a=e.getCoord2D(n);t.getCoordinateSystemType()===2?(T[0]=a.x,T[1]=a.y,i.projToGeog(E,1,T),j.x=T[0]*g,j.y=T[1]*g):(j.setCoordsPoint2D(a),j.scale(g)),k.setCoordsPoint2D(b.m_pGcs),A.setCoordsPoint2D(x.m_pGcs);let l=new m;C(u,h,j,l);let d=w(u,b.m_xyz,l),f=w(u,x.m_xyz,l);s=x.m_geoLength,Number.isNaN(s)&&(s=w(u,b.m_xyz,x.m_xyz));let p=d+f,v=S===o&&p>=20&&Math.abs(p-s)>1e-8*(s+p);if(c+2<40&&(v||Math.abs(p-s)>0&&S>0))x.setLength(f),_[c].assign(x),x.setValues(n,j,d,l),_[++c].assign(x),v?(S=o,y[c]=o):(S--,y[c-1]=S,y[c]=S);else{if(M+=p,c===0)break;b.assign(x),x.assign(_[--c]),S=y[c]}}}return M}execute(r,i,a){if(i&&i.getCoordinateSystemType()!==0||e(``),r.isEmpty()||r.getDimension()<1)return 0;let s=null,c=i.getGCS();c!==i&&(s=o(i,c,null));let d=r.getGeometryType();if(d===t.enumEnvelope){let e=new l;return e.addEnvelope(r,!1),this._ExecuteShapePreservingLength(e,i,c,s,a)}if(n(d)){let e=new u;return e.addSegment(r,!0),this._ExecuteShapePreservingLength(e,i,c,s,a)}return this._ExecuteShapePreservingLength(r,i,c,s,a)}}function C(e,t,n,r){r.assign(c(e,t,n))}function w(e,t,n){let r=e,i=new m;i.setSub(t,n);let a=i.length();return 2*r*Math.asin(a/(2*r))}export{S as O};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{G as e}from"./GeometryCursor.js";import{b as t,t as n,p as r,q as i,g as a,G as o,h as s,j as c,a as l}from"./Geometry.js";import{E as u,P as d}from"./Envelope.js";import{Envelope2D as f}from"./Envelope2D.js";import{a as p,S as m,L as h}from"./MultiPathImpl.js";import{n as g,P as _,c as v}from"./Point2D.js";import{T as y}from"./Transformation2D.js";import{O as b,F as x,ag as S,aO as C,J as w,I as T,H as E,K as D,a4 as O,a3 as k,_ as A,ax as ee,aP as te,aw as ne}from"./UnitFactory.js";import{c as j}from"./OperatorClip.js";function M(e){let t=e.getInputSR(),n=e.getOutputSR(),r=!1;do{if(t.equals(n)||!L(t)||!L(n)){r=!1;break}if(t.getCoordinateSystemType()===2||n.getCoordinateSystemType()===2){r=!0;break}let i=e.getGeographicTransformations();i!==null&&i.count()>0&&(r=!0)}while(0);return r}class re{m_horizon2;m_sr;m_bInclusive2;m_pannableExtent;m_horizon2Env=new f;m_gcs360;m_gcs180;m_gcs90;m_pannableFactor;m_period;m_gcsTolerance;m_qtIter;m_segIter;constructor(e,t,n,r){this.m_horizon2=e,this.m_sr=t,this.m_bInclusive2=n,this.m_pannableExtent=r.clone(),this.m_segIter=null,this.m_qtIter=null,e===null?(this.m_horizon2Env.setEmpty(),this.m_gcs360=NaN,this.m_gcs180=NaN,this.m_gcs90=NaN,this.m_pannableFactor=NaN,this.m_period=NaN):(e.queryEnvelope(this.m_horizon2Env),this.m_gcs360=r.width(),this.m_gcs180=.5*this.m_gcs360,this.m_gcs90=.25*this.m_gcs360,this.m_pannableFactor=1,this.m_horizon2Env.width()-this.m_gcs360>0&&(this.m_pannableFactor+=Math.ceil((this.m_horizon2Env.width()-this.m_gcs360)/this.m_gcs360)),this.m_period=this.m_gcs360),this.m_gcsTolerance=t==null?NaN:t.getTolerance(0)}isPointStartInHorizon(e,t){if(!this.m_horizon2)return!0;let n=q(new d(e),this.m_horizon2,!0,this.m_period);do{let t=e.clone();if(t.x-=n*this.m_period,this.m_horizon2.getGeometryType()===o.enumPolygon){let e;if(e=this.m_horizon2Env.contains(t)?D(this.m_horizon2,t,0):0,this.m_bInclusive2){if(e===0)return!1}else if(e===1)return!1}else{let e=this.m_horizon2Env.contains(t);if(this.m_bInclusive2){if(!e)return!1}else if(e)return!1}}while(this.m_horizon2Env.xmin+ ++n*this.m_period<e.x);return!0}isAdjoiningLineInHorizon(e,t,n){if(!this.m_horizon2)return!0;let r=new _,i=new _;Y(e,t,this.m_gcs90,this.m_gcs180,this.m_gcs360,r,i);let s=Math.max(r.x,i.x),c=new h;c.setStart2D(r),c.setEnd2D(i);let l=q(c,this.m_horizon2,!0,this.m_period);do{let e=r.clone(),t=i.clone();if(e.x-=l*this.m_period,t.x-=l*this.m_period,this.m_horizon2.getGeometryType()===o.enumPolygon){let n=new h;n.setStartXY(e),n.setEndXY(t);let r=new f,i=new f;if(n.queryEnvelope(r),i.setCoords({env2D:r}),i.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance),this.m_horizon2Env.isIntersecting(i)){let e=this.m_horizon2.getImpl(),t=e.getAccelerators();t!==null&&t.getRasterizedGeometry()!==null&&a(0);{let r=null;if(t!==null&&(r=t.getQuadTree()),r!==null){this.m_qtIter||=r.getIteratorForQT(),this.m_qtIter.resetIterator(n,this.m_gcsTolerance),this.m_segIter||=e.querySegmentIterator();for(let e=this.m_qtIter.next();e!==-1;e=this.m_qtIter.next()){let t=r.getElement(e);if(this.m_segIter.resetToVertex(t,-1),this.m_segIter.nextSegment().isIntersecting(n,this.m_gcsTolerance))return!1}}else for(this.m_segIter||=e.querySegmentIterator(),this.m_segIter.resetToFirstPath();this.m_segIter.nextPath();)for(;this.m_segIter.hasNextSegment();){let e=this.m_segIter.nextSegment(),t=new f;if(e.queryEnvelope(t),t.isIntersecting(i)&&e.isIntersecting(n,this.m_gcsTolerance))return!1}}}}else if(this.m_bInclusive2){let n=this.m_horizon2Env.contains(e),r=this.m_horizon2Env.contains(t);if(n&&r)return!0}else{let n=this.m_horizon2Env.clone();if(n.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance),n.clipLine(e,t)!==0)return!1}}while(this.m_horizon2Env.xmin+ ++l*this.m_period<s);return!this.m_bInclusive2}isEnvelopeInHorizon(e,t){if(!this.m_horizon2)return!0;let n=new u({env2D:e}),r=q(n,this.m_horizon2,!0,this.m_period);do{let i=e.clone();if(i.move(-r*this.m_period,0),n.setCoords(i.xmin,i.ymin,i.xmax,i.ymax),!K(n,this.m_horizon2,this.m_sr,this.m_bInclusive2,t))return!1}while(this.m_horizon2Env.xmin+ ++r*this.m_period<e.xmax);return!0}}class ie{m_splitLines2=null;m_transform1;m_pannableExtent;m_gcs360;m_gcs180;m_gcs90;m_gcsTolerance;m_halfGcsTolerance;m_gcsToleranceSq;m_scalars=[];m_splitIter=null;constructor(e,t,n){this.m_splitLines2=e,this.m_transform1=t,this.m_pannableExtent=n.clone(),this.m_gcs360=n.width(),this.m_gcs180=.5*this.m_gcs360,this.m_gcs90=.25*this.m_gcs360,t===null?(this.m_gcsTolerance=NaN,this.m_halfGcsTolerance=NaN,this.m_gcsToleranceSq=NaN):(this.m_gcsTolerance=this.m_transform1.getOutputSR().getTolerance(0),this.m_halfGcsTolerance=.5*this.m_gcsTolerance,this.m_gcsToleranceSq=this.m_gcsTolerance*this.m_gcsTolerance)}hasSplitLines(){return this.m_splitLines2!=null}getSplitLineFactorEx(e,t,n,r,i,a){let o=new _,s=new _;Y(r,i,this.m_gcs90,this.m_gcs180,this.m_gcs360,o,s);let c=new h;for(c.setStartXY(o),c.setEndXY(s),this.m_splitIter?this.m_splitIter.resetToFirstPath():this.m_splitIter=this.m_splitLines2.getImpl().querySegmentIterator();this.m_splitIter.nextPath();)for(;this.m_splitIter.hasNextSegment();){let r=this.m_splitIter.nextSegment(),i=.5*(r.getStartX()+r.getEndX());U(this.m_gcs180,this.m_gcs360,i,c);let o=new f;c.queryEnvelope(o),o.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance);let s=new f;if(r.queryEnvelope(s),!(!o.isIntersecting(s)||(this.m_scalars.length<2&&(this.m_scalars.length=2),c.intersect(r,null,this.m_scalars,null,this.m_gcsTolerance)!==1))&&this.m_scalars[0]>0&&this.m_scalars[0]<1){let i=$(t,n,this.m_scalars[0]),o=V(e.getCoord2D(i),this.m_transform1);return r.isIntersectingPoint(o,this.m_halfGcsTolerance)?i:this.getSplitLineFactor(e,t,n,r,a)}}return-1}getSplitLineFactor(e,t,n,r,i){let a=t,o=n,s=.5*(r.getStartX()+r.getEndX()),c=new h,l=e.getCoord2D(a),u=e.getCoord2D(o),d=V(l,this.m_transform1),f=V(u,this.m_transform1);for(;a<o;){let t=new _,n=new _;Y(d,f,this.m_gcs90,this.m_gcs180,this.m_gcs360,t,n),c.setStartXY(t),c.setEndXY(n),U(this.m_gcs180,this.m_gcs360,s,c);let i=_.sqrDistance(c.getStartXY(),c.getEndXY());if(i<=this.m_gcsToleranceSq)break;if(Number.isNaN(i))return NaN;let p=$(a,o,this.m_scalars[0]);if(a<p&&p<o||(p=.5*(o+a)),a===p||p===o)return p;let m=e.getCoord2D(p),h=V(m,this.m_transform1),g=new _;Y(d,h,this.m_gcs90,this.m_gcs180,this.m_gcs360,t,g),c.setStartXY(t),c.setEndXY(g),U(this.m_gcs180,this.m_gcs360,s,c);let v=c.intersect(r,null,this.m_scalars,null,this.m_halfGcsTolerance);if(v!==0){if(this.m_scalars[0]===1)return p;o=p,u.setCoordsPoint2D(m),f.setCoordsPoint2D(h)}else{if(Y(h,f,this.m_gcs90,this.m_gcs180,this.m_gcs360,g,n),c.setStartXY(g),c.setEndXY(n),U(this.m_gcs180,this.m_gcs360,s,c),v=c.intersect(r,null,this.m_scalars,null,this.m_halfGcsTolerance),v===0||this.m_scalars[0]===0)return p;a=p,l.setCoordsPoint2D(m),d.setCoordsPoint2D(h)}}return .5*(o+a)}}class N{m_bPrepared=!1;m_bNeedsShapePreservingProject=!1;m_inputTransform=null;m_transform1=null;m_transform2=null;m_extentFrom=null;m_horizon1=null;m_horizon2=null;m_pannableExtentFrom=new f;m_pannableExtentTo=new f;m_pannableExtentGcsTo=new f;m_bClipTopBottomFrom=!1;m_bNeedsGeoTransform=!1;m_bIsPannableFrom=!1;m_bIsPannableTo=!1;m_bInclusive1=!1;m_bInclusive2=!1;m_bSrFromIsPcs=!1;m_bSrToIsPcs=!1;m_fromTolerance=NaN;m_toTolerance=NaN;m_gcsToTolerance=NaN;m_aFrom=NaN;m_mpuFrom=NaN;m_rpuFrom=NaN;m_rpuGcsTo=NaN;m_aTo=NaN;m_mpuTo=NaN;m_stages=0;constructor(){}prepare(e,n,r){this.m_bPrepared&&i(``),e||t(``);let o=e.getInputSR(),s=e.getOutputSR();(!L(o)||!L(s))&&t(`shape preserving project requires PCS or GCS`);let c=o.getCoordinateSystemType(),l=s.getCoordinateSystemType();this.m_bSrFromIsPcs=c===2,this.m_bSrToIsPcs=l===2;let u=null,d=null,f=null,p=null;this.m_bSrFromIsPcs?(u=o,f=o.getGCS(),this.m_aFrom=Q(f),this.m_mpuFrom=Z(u),this.m_rpuFrom=NaN):(f=o,this.m_rpuFrom=X(f),this.m_aFrom=NaN),this.m_bSrToIsPcs?(d=s,p=s.getGCS(),this.m_aTo=Q(p),this.m_mpuTo=Z(d)):(p=s,this.m_aTo=NaN,this.m_mpuTo=NaN),this.m_rpuGcsTo=X(p);let m=e.getGeographicTransformations();this.m_bNeedsGeoTransform=m!==null&&m.count()>0;let h=o.equals(s);if(this.m_bNeedsShapePreservingProject=!h&&(this.m_bSrFromIsPcs||this.m_bSrToIsPcs||this.m_bNeedsGeoTransform),!this.m_bNeedsShapePreservingProject){this.m_inputTransform=e,this.m_extentFrom=n?n.clone():null,this.m_bPrepared=!0;return}if(this.m_bIsPannableFrom=o.isPannable(),this.m_bIsPannableTo=s.isPannable(),this.m_bIsPannableFrom&&(this.m_pannableExtentFrom=o.getPannableExtent()),this.m_bIsPannableTo&&(this.m_pannableExtentTo=s.getPannableExtent()),!this.m_bSrToIsPcs)this.m_pannableExtentGcsTo=this.m_pannableExtentTo.clone();else{this.m_pannableExtentGcsTo=p.getPannableExtent();let e=d.getCentralMeridian(),t=this.m_pannableExtentGcsTo.getCenter();t.x=e,this.m_pannableExtentGcsTo.centerAt(t)}this.m_fromTolerance=o.getTolerance(0),this.m_toTolerance=s.getTolerance(0),this.m_gcsToTolerance=p.getTolerance(0);{let t=e.getExtendedParams(),i=t.clipWithInputHorizon,a=t.clipWithOutputHorizon;i&&this.setHorizon1(e,n,r),a&&this.setHorizon2(e,r),this.checkAndSetStages(e,r)}let g=T();g.setFlag(1073741824,!0),g.setFlag(536870912,!0);let _=E();if(_.clipWithInputHorizon=!1,_.clipWithOutputHorizon=!1,this.m_stages===1)this.m_transform1=x(!1,o,s,m,_,g);else if(this.m_stages===2){g.setFlag(2147483648,!0),this.m_transform1=x(!1,o,p,m,_,g);let e=T();this.m_transform2=x(!1,p,s,null,_,e)}else{a(d!=null),_.centralMeridianOfOutputGCS=d.getCentralMeridian(),this.m_transform1=x(!1,o,p,m,_,g);let e=T();e.setFlag(2147483648,!0),this.m_transform2=x(!1,p,s,null,_,e)}this.m_inputTransform=e,this.m_extentFrom=n?n.clone():null,this.m_bPrepared=!0}execute(e,t,n,r){return this.m_bPrepared||i(``),a(!e.hasAttribute(10)),this.execute_(e,t,n,r)}checkIfNeedsReset(e,t){return a(0),!1}setHorizon1(e,t,n){let r=e.getInputSR(),i=null,a,o=new f;if(this.m_bSrFromIsPcs){a=!0,i=r.getPCSHorizon(),i.queryEnvelope(o),this.m_bIsPannableFrom&&(i=new u({xmin:this.m_pannableExtentFrom.xmin,ymin:o.ymin,xmax:this.m_pannableExtentFrom.xmax,ymax:o.ymax}));let e=!1;t!=null&&(e=ce(t,i,r,a,this.m_bIsPannableFrom,this.m_pannableExtentFrom,n)),e||(this.m_horizon1=i,this.m_bInclusive1=a)}else this.m_bClipTopBottomFrom=!0,this.m_bInclusive1=!0}setHorizon2(e,t){let n=e.getOutputSR();if(n.getCoordinateSystemType()===1){this.m_horizon2=null,this.m_bInclusive2=!1;return}let r=null,i=new f,a=n.getGCSHorisonIsInclusive();r=n.getGCSHorizon(),r.queryEnvelope(i);let o=n.getCentralMeridian();if(this.m_bIsPannableTo){let e=new u({xmin:this.m_pannableExtentGcsTo.xmin,ymin:i.ymin,xmax:this.m_pannableExtentGcsTo.xmax,ymax:i.ymax});e.centerAt(o,0),r=e}this.m_horizon2=r,this.m_bInclusive2=a}checkAndSetStages(e,t){let n=e.getOutputSR().getGCSSplitLines();if(!this.m_horizon2&&!n)this.m_stages=1;else{if(this.m_horizon2.getGeometryType()===o.enumEnvelope){let e=new f;this.m_horizon2.queryEnvelope(e);let t=e.width(),n=e.height();t>=g/this.m_rpuGcsTo&&n>=Math.PI/this.m_rpuGcsTo&&(this.m_horizon2=null)}if(!this.m_horizon2&&!n)this.m_stages=1;else if(this.m_horizon2!==null&&!this.m_bNeedsGeoTransform&&!this.m_bSrFromIsPcs){let t=e.getOutputSR().getGCS();if(e.getInputSR().equals(t)){this.m_horizon1=this.m_horizon2,this.m_bInclusive1=this.m_bInclusive2,this.m_bClipTopBottomFrom=!1,this.m_horizon2=null,this.m_bInclusive2=!1,this.m_stages=1;return}this.m_stages=2}else this.m_stages=3}}execute_(e,t,i,a){if(!this.m_bNeedsShapePreservingProject)return new b().execute(e,this.m_inputTransform,a);if(!e)return null;n(e),r(e);let l=e.getGeometryType(),u;return s(l)?(u=ae(e),l=o.enumPolyline):u=e,u.isEmpty()?u:c(l)?this.executeEx(e,t,i,a):new b().execute(e,this.m_inputTransform,a)}executeEx(e,t,n,r){e.hasNonLinearSegments()&&l(``);let i;i=this.m_bIsPannableFrom?new b().foldInto360Range(e,this.m_transform1.getInputSR()):e;let a=n;a>0||(a=100*this.m_toTolerance);let o;return o=this.m_stages===1?this.executeGood(i,t,a,r):this.m_stages===2?this.executeBad(i,t,a,r):this.executeUgly(i,t,a,r),this.filterOverDensification(o,this.m_inputTransform.getOutputSR(),a,r)}executeGood(e,t,n,r){let i=n*n,a;a=t>0?this.getMinLengthInSrFrom(t):this.getMinLengthInSrFrom(1e-5);let o;return o=this.m_bClipTopBottomFrom?S(e,this.m_transform1.getInputSR()):W(e,this.m_transform1.getInputSR(),this.m_horizon1,this.m_bInclusive1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,NaN,r),o=C(o,this.m_transform1.getOutputSR(),r),o=R(o,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,a,i,r),o=new b().execute(o,this.m_transform1,r),o}executeBad(e,t,n,r){let i;i=t>0?t*(Math.PI/180/this.m_rpuGcsTo):1e-5*(Math.PI/180/this.m_rpuGcsTo);let a=n*n,o;return o=this.m_bClipTopBottomFrom?S(e,this.m_transform1.getInputSR()):e,o=new b().execute(o,this.m_transform1,r),o=W(o,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!0,NaN,r),o=C(o,this.m_transform2.getOutputSR(),r),o=R(o,this.m_transform2,!0,this.m_pannableExtentGcsTo,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,i,a,r),o=new b().execute(o,this.m_transform2,r),o}executeUgly(e,t,n,r){let i=n*n,a;a=t>0?this.getMinLengthInSrFrom(t):this.getMinLengthInSrFrom(1e-5);let o=null;o=this.m_bClipTopBottomFrom?S(e,this.m_transform1.getInputSR()):W(e,this.m_transform1.getInputSR(),this.m_horizon1,this.m_bInclusive1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,NaN,r);let s=o,c=new re(this.m_horizon2,this.m_transform2.getInputSR(),this.m_bInclusive2,this.m_pannableExtentGcsTo),l=this.m_transform2.getOutputSR().getGCSSplitLines(),u=new ie(l,this.m_transform1,this.m_pannableExtentGcsTo);if(o=R(o,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,this.m_bIsPannableTo,this.m_pannableExtentTo,this.m_transform2,c,this.m_pannableExtentGcsTo,u,a,i,r),o!==null){s=null,o=new b().execute(o,this.m_transform1,r);let e=2*(Math.PI/180/this.m_rpuGcsTo);return o=W(o,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!1,e,r),o=new b().execute(o,this.m_transform2,r),o}let d=NaN;d=n>0?n:100*this.m_toTolerance,d/=this.m_rpuGcsTo*this.m_aTo/this.m_mpuTo;let f=d*d;o=R(s,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,this.m_pannableExtentGcsTo,null,null,null,null,a,f,r),s=null,o=new b().execute(o,this.m_transform1,r);let p;return p=t>0?t*(Math.PI/180/this.m_rpuGcsTo):1e-5*(Math.PI/180/this.m_rpuGcsTo),o=W(o,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!1,NaN,r),o=C(o,this.m_transform2.getOutputSR(),r),o=R(o,this.m_transform2,!0,this.m_pannableExtentGcsTo,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,p,i,r),o=new b().execute(o,this.m_transform2,r),o}getMinLengthInSrFrom(e){let t;return t=this.m_bSrFromIsPcs?this.m_aFrom*(e*Math.PI/180)/this.m_mpuFrom:e*Math.PI/180*(1/this.m_rpuFrom),t}filterOverDensification(e,t,n,r){let i=P(e,n);return i.dropAttribute(10),i!==e&&i.getGeometryType()===o.enumPolygon&&(i=new w().execute(i,t,!1,r)),i}}function P(e,t){if(e.isEmpty()||!e.hasAttribute(10))return e;let n=t*t,r=e.getAttributeStreamRef(10),i=!1,a=new h,o=[],s=!1;for(let t=0,c=e.getPathCount();t<c;t++){let c=e.getPathStart(t),l=e.getPathEnd(t),u=e.isClosedPath(t);if(l>c){let e=u?c:l-1;(r.read(c)!==0||r.read(e)!==0)&&(i||=(r=r.clone(),!0),r.write(c,0),r.write(e,0))}else continue;let d=u?l+1:l,f=c;for(let t=c;t<d;t++){let u=t===l?c:t;if(r.read(u)===0){if(t-f>1){o.push({from:f,to:t});let u=new _;for(;o.length>0;){let t=o.at(-1);o.pop(),a.setStartXY(e.getXY(t.from));let d=t.to===l?c:t.to;a.setEndXY(e.getXY(d));let f=n,p=-1;for(let n=t.from+1,r=t.to;n<r;n++){let t=e.getXY(n),r=a.getClosestCoordinate(t,!1);a.queryCoord2D(r,u);let i=_.sqrDistance(u,t);f<i&&(f=i,p=n)}p>=0?(i||=(r=r.clone(),!0),r.write(p,0),p-t.from>1&&o.push({from:t.from,to:p}),t.to-p>1&&o.push({from:p,to:t.to})):s=!0}}f=u}}}if(!s)return e;let c=F(e,r,1);return c.dropAttribute(10),c}function F(e,t,n){let r=e.createInstance(),i=new d;for(let a=0,o=e.getPathCount();a<o;a++){let o=!0,s=0,c=0,l=e.getPathStart(a),u=e.getPathEnd(a),d=!0;for(let f=l;f<u;f++)t.read(f)===n?(!d&&c>0&&(r.addSegmentsFromPath(e,a,s-l,c,o),c=0),d=!0):d?(d=!1,e.getPointByVal(f,i),o?(r.startPathPoint(i),o=!1):r.lineToPoint(i),s=f):c++;c>0&&r.addSegmentsFromPath(e,a,s-l,c,o)}return r}function I(e,t){for(let n=0;n<e;n++){let r=Math.ceil(n/2)/(e+1);n%2!=0&&(r=-r);let i=.5+r;t[n]=i}}function L(e){if(!e)return!1;let t=e.getCoordinateSystemType();return t===2||t===1}function R(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=e.createInstance();p.addAttribute(10);let h=e.querySegmentIterator(),g=[],_=[],v=new m,y=e.getDescription().getAttributeCount()>1,b=new ue(t,n,r,i,a,o,s,l,u,d,y?_:null,g,f);for(;h.nextPath();)for(;h.hasNextSegment();){let e=h.nextSegment(),t=e.getStartXY(),n=e.getEndXY(),r=t.compare(n)>0,i=H(r,e,v);if(g.length=0,_.length=0,!b.densifySegment(h.isFirstSegmentInPath(),i))return null;r&&se(y?_:null,g),g.at(-1).setCoordsPoint2D(e.getEndXY());let a=p.getPointCount();if(!y)z(h.isFirstSegmentInPath(),h.isLastSegmentInPath()&&!h.isPathClosed(),g,p);else{let t=H(r,e,v);B(h.isFirstSegmentInPath(),h.isLastSegmentInPath()&&!h.isPathClosed(),e,t,_,g,p)}if(b.needsPostFiltering()){p.addAttribute(10);let e=p.getAttributeStreamRef(10);for(let t=1,n=g.length-1;t<n;t++)e.write(t+a,1)}}return p}function z(e,t,n,r){e&&r.insertPath2D(-1,null,0,0,!0);let i=r.getPathCount()-1;t?r.insertPointsFromPoints(i,-1,n,0,n.length,!0):r.insertPointsFromPoints(i,-1,n,0,n.length-1,!0)}function B(e,t,n,r,i,a,o){o.reserve(o.getPointCount()+a.length-1);let s=new d;if(n.queryStart(s),e?o.startPathPoint(s):o.lineToPoint(s),a.length>2){let e=r.calculateLength2D();for(let t=1;t<a.length-1;t++){let n=r.lengthToT(i[t]*e);r.queryCoord(n,s),s.setXY(a[t]),o.lineToPoint(s)}}t&&(n.queryEnd(s),o.lineToPoint(s))}function ae(e){let t=new p({vd:e.getDescription()});return t.addSegment(e,!0),t}function V(e,t){let n=t.getInputSR(),r=t.getOutputSR(),i=new _;n.getCoordinateSystemType()===2?(i.setCoordsPoint2D(e),ee(n,0,[i],1)):i.setCoordsPoint2D(e);let a=new _;a.setCoordsPoint2D(i),te(t,[a],null,1,!1);let o=new _;return r.getCoordinateSystemType()===2?(o.setCoordsPoint2D(a),ne(r,[o],1,!1)):o.setCoordsPoint2D(a),o}function oe(e,t,n,r,i,a,o,s){if(i){let i=a.width(),c=.5*i;if(r){let r=.25*i,a=!1,l=new _,u=new _;if(Math.abs(e.y)===r?(l.setCoords(n.x,e.y),u.setCoordsPoint2D(n),a=!0):Math.abs(n.y)===r&&(u.setCoords(e.x,n.y),l.setCoordsPoint2D(e),a=!0),Math.abs(t.y)===r&&(a||=(l.setCoordsPoint2D(e),u.setCoordsPoint2D(n),!0),l.x=t.x),a)return J(t,l,c,i,o),J(t,u,c,i,s),!0}let l=0;e.x-t.x>c&&n.x-t.x>c?l-=i:t.x-e.x>c&&t.x-n.x>c&&(l+=i),Math.abs(t.x-(e.x+l))<c?(o.setCoordsPoint2D(e),J(o,n,c,i,s),o.x+=l,s.x+=l):(o.setCoordsPoint2D(n),J(o,e,c,i,s),o.x+=l,s.x+=l)}else o.setCoordsPoint2D(e),s.setCoordsPoint2D(n);return!1}function H(e,t,n){return e?(n.create(t.getGeometryType()),t.copyTo(n.get()),n.get().reverse(),n.get()):t}function se(e,t){t.reverse(),e!==null&&e.reverse()}function U(e,t,n,r){let i=.5*(r.getStartX()+r.getEndX());if(i-n>e){let e=new y;e.setShiftCoords(-t,0),r.applyTransformation(e)}else if(n-i>e){let e=new y;e.setShiftCoords(t,0),r.applyTransformation(e)}}function W(e,t,n,r,i,a,o,s,c){let l=[!1];o&&G(e,t,n,r,i,a,!0,s,l,c);let u=e;return l[0]||(u=G(u,t,n,r,i,a,!1,s,null,c)),u=le(u,i,a,u!==e),u}function G(e,t,n,r,i,a,s,c,l,u){if(s&&(l[0]=!1),n==null)return e;let d=new f,p=new f;n.queryEnvelope(d),e.queryEnvelope(p);let m=e.getGeometryType(),h=n.getGeometryType(),g=t.getTolerance(0);if(!i){if(s)return l[0]=K(e,n,t,r,u),null;let i;return i=r?h===o.enumEnvelope?j(e,d,g,c,u):new O().execute(e,n,t,u):new k().execute(e,n,t,u),i===n&&(i=n.clone()),i}let _=a.width(),v=_*Math.ceil(d.width()/_),b=null;if(r){let a=q(e,n,i,v),x=0,S=new y;do{let i=null;if(h===o.enumEnvelope){let o=n.clone();if(S.setShiftCoords(a*v,0),o.applyTransformation(S),s){if(l[0]=K(e,o,t,r,u),!l[0])return null}else{let t=new f;o.queryEnvelope(t),i=j(e,t,g,c,u)}}else{let o=e.clone();if(S.setShiftCoords(-a*v,0),o.applyTransformation(S),s){if(l[0]=K(o,n,t,r,u),!l[0])return null}else i=new O().execute(o,n,t,u),i===n&&(i=n.clone())}if(!s){if(i.isEmpty())continue;if(m===o.enumPolygon){let e=new f;if(i.queryEnvelope(e),e.width()<=g)continue}h===o.enumEnvelope&&(S.setShiftCoords(-a*v,0),i===e&&(i=i.clone()),i.applyTransformation(S)),b===null?b=i===e?i.clone():i:b.add(i,!1)}x++}while(d.xmin+ ++a*v<p.xmax);if(s)return null;b===null&&(b=e.createInstance()),m===o.enumPolygon&&x>1&&_-p.width()<=10*g&&(b=new w().execute(b,t,!0,u))}else{let a=q(e,n,i,v);if(b=e.clone(),a!==0){let e=new y;e.setShiftCoords(-a*v,0),b.applyTransformation(e)}do{if(s){if(l[0]=K(b,n,t,r,u),!l[0])return null}else if(b=new k().execute(b,n,t,u),b===n&&(b=n.clone()),b.isEmpty())break;let e=new y;e.setShiftCoords(-v,0),b.applyTransformation(e)}while(d.xmin+ ++a*v<p.xmax);if(s)return null;if(!b.isEmpty()&&a!==0){let e=new y;e.setShiftCoords(a*v,0),b.applyTransformation(e)}}return b}function ce(e,t,n,r,i,a,o){let s=[!1];return G(e,n,t,r,i,a,!0,NaN,s,o),s[0]}function K(e,t,n,r,i){let a;if(t.getGeometryType()===o.enumPolygon)a=r?A(t,e,n,64,i):A(t,e,n,4,i);else if(r){let n=new f,r=new f;t.queryEnvelope(n),e.queryEnvelope(r),a=n.containsEnvelope(r)}else a=A(t,e,n,4,i);return a}function le(e,t,n,r){let i;if(!t)return e;let a=n.getCenter().x,o=n.width(),s=.5*o,c=new f;e.queryEnvelope(c);let l=c.getCenter().x,u=0;if(l-a>s?u=-Math.ceil((l-a-s)/o)*o:a-l>s&&(u=Math.ceil((a-l-s)/o)*o),u!==0){i=r?e:e.clone();let t=new y;t.setShiftCoords(u,0),i.applyTransformation(t)}else i=e;return i}function q(e,t,n,r){if(!n)return 0;let i=0,a=new f;t.queryEnvelope(a);let o=new f;e.queryEnvelope(o);let s=a.xmin+r;for(;s+r+i*r>o.xmin;)i--;for(;s+i*r<o.xmin;)i++;return i}function J(e,t,n,r,i){t.x-e.x>n?i.setCoords(t.x-r,t.y):e.x-t.x>n?i.setCoords(t.x+r,t.y):i.setCoordsPoint2D(t)}function Y(e,t,n,r,i,a,o){Math.abs(e.y)===n?(a.setCoords(t.x,e.y),o.setCoordsPoint2D(t)):Math.abs(t.y)===n?(a.setCoordsPoint2D(e),o.setCoords(e.x,t.y)):(a.setCoordsPoint2D(e),J(a,t,r,i,o))}function X(e){return e.getUnit().getUnitToBaseFactor()}function Z(e){return e.getUnit().getUnitToBaseFactor()}function Q(e){return e.getPECoordSys().getDatum().getSpheroid().getAxis()}function $(e,t,n){return n<=.5?e+(t-e)*n:t-(t-e)*(1-n)}class ue{leftFromDensifiedPoint=new _;rightFromDensifiedPoint=new _;cutFromDensifiedPoint=new _;midFromDensifiedPoint=new _;leftToDensifiedPoint=new _;rightToDensifiedPoint=new _;cutToDensifiedPoint=new _;midToDensifiedPoint=new _;line=new h;leftGcsToDensifiedPoint=new _;rightGcsToDensifiedPoint=new _;cutGcsToDensifiedPoint=new _;midGcsToDensifiedPoint=new _;bSrToIsGcs=!1;bIsCurve=!1;leftFactor=0;rightFactor=0;bIsFirstInPath=!1;rectifiedSegment=null;transform=null;bIsPannableFrom=!1;pannableExtentFrom=new f;bIsPannableTo=!1;bNeedPostFiltering=!1;pannableExtentTo=new f;transform2=null;pHorizon2Info=null;pSplitLines2Info=null;minLengthInSrFrom=0;maxDeviationInSrToSq=0;cutFactor=0;midFactor=0;pDensifiedFactors=null;pDensifiedPoints=[];progressTracker;rightFromDensifiedPointsStack=[];rightToDensifiedPointsStack=[];rightGcsToDensifiedPointsStack=[];rightFactorsStack=[];projCurveSegment=new m;n=0;bCheckIfNoDensificationNeededForCurve=!1;scalars=v(7,NaN);checkSegment(){for(let e=0;e<this.n;e++){if(this.pSplitLines2Info!==null&&this.pSplitLines2Info.hasSplitLines()&&!this.bCheckIfNoDensificationNeededForCurve){let e=this.pSplitLines2Info.getSplitLineFactorEx(this.rectifiedSegment,this.leftFactor,this.rightFactor,this.leftGcsToDensifiedPoint,this.rightGcsToDensifiedPoint,this.progressTracker);if(Number.isNaN(e))return-1;if(e!==-1&&this.leftFactor<e&&e<this.rightFactor)return this.cutFactor=e,this.cutFromDensifiedPoint.assign(this.rectifiedSegment.getCoord2D(this.cutFactor)),this.cutToDensifiedPoint.assign(V(this.cutFromDensifiedPoint,this.transform)),this.cutGcsToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.cutToDensifiedPoint.assign(V(this.cutGcsToDensifiedPoint,this.transform2)),this.midFactor=this.cutFactor,this.midFromDensifiedPoint.setCoordsPoint2D(this.cutFromDensifiedPoint),this.midToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.midGcsToDensifiedPoint.setCoordsPoint2D(this.cutGcsToDensifiedPoint),1}if(this.cutFactor=$(this.leftFactor,this.rightFactor,this.scalars[e]),this.cutFromDensifiedPoint.assign(this.rectifiedSegment.getCoord2D(this.cutFactor)),this.cutToDensifiedPoint.assign(V(this.cutFromDensifiedPoint,this.transform)),this.transform2!==null&&(this.cutGcsToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.cutToDensifiedPoint.assign(V(this.cutGcsToDensifiedPoint,this.transform2))),e===0&&(this.midFactor=this.cutFactor,this.midFromDensifiedPoint.setCoordsPoint2D(this.cutFromDensifiedPoint),this.midToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.midGcsToDensifiedPoint.setCoordsPoint2D(this.cutGcsToDensifiedPoint)),this.bIsPannableFrom&&!this.bCheckIfNoDensificationNeededForCurve&&Math.abs(this.leftFromDensifiedPoint.x-this.rightFromDensifiedPoint.x)>=.25*this.pannableExtentFrom.width())return 1;let t;if(this.bCheckIfNoDensificationNeededForCurve){let e=this.projCurveSegment.get().getClosestCoordinate(this.cutToDensifiedPoint,!1),n=this.projCurveSegment.get().getCoord2D(e);t=_.sqrDistance(this.cutToDensifiedPoint,n)}else{let n=new _,r=new _,i=oe(this.leftToDensifiedPoint,this.cutToDensifiedPoint,this.rightToDensifiedPoint,this.bSrToIsGcs,this.bIsPannableTo,this.pannableExtentTo,n,r);this.line.setStartXY(n),this.line.setEndXY(r);let a=this.line.getClosestCoordinate(this.cutToDensifiedPoint,!0);if(i||e>0||Math.abs(a-this.scalars[e])<.3){let e=this.line.getCoord2D(a);t=_.sqrDistance(this.cutToDensifiedPoint,e)}else t=this.maxDeviationInSrToSq*2,this.bNeedPostFiltering=!0}if(t>this.maxDeviationInSrToSq)return this.bCheckIfNoDensificationNeededForCurve=!1,1}return 0}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f){this.progressTracker=f,this.transform=e,this.bIsPannableFrom=t,this.pannableExtentFrom.assign(n),this.bIsPannableTo=r,this.pannableExtentTo.assign(i),this.transform2=a,this.pHorizon2Info=o,this.pSplitLines2Info=s,this.minLengthInSrFrom=c,this.maxDeviationInSrToSq=l,this.pDensifiedFactors=u,this.pDensifiedPoints=d,this.progressTracker=f,this.bNeedPostFiltering=!1}needsPostFiltering(){return this.bNeedPostFiltering}densifySegment(e,t){if(this.bIsFirstInPath=e,this.rectifiedSegment=t,this.leftGcsToDensifiedPoint.setNAN(),this.rightGcsToDensifiedPoint.setNAN(),this.cutGcsToDensifiedPoint.setNAN(),this.midGcsToDensifiedPoint.setNAN(),this.bSrToIsGcs=this.transform2==null?this.transform.getOutputSR().getCoordinateSystemType()===1:this.transform2.getOutputSR().getCoordinateSystemType()===1,this.bIsCurve=this.rectifiedSegment.isCurve(),this.leftFactor=0,this.rightFactor=1,this.leftFromDensifiedPoint.assign(this.rectifiedSegment.getStartXY()),this.rightFromDensifiedPoint.assign(this.rectifiedSegment.getEndXY()),this.leftToDensifiedPoint.assign(V(this.leftFromDensifiedPoint,this.transform)),this.rightToDensifiedPoint.assign(V(this.rightFromDensifiedPoint,this.transform)),this.transform2!==null&&(this.leftGcsToDensifiedPoint.setCoordsPoint2D(this.leftToDensifiedPoint),this.rightGcsToDensifiedPoint.setCoordsPoint2D(this.rightToDensifiedPoint),this.leftToDensifiedPoint.assign(V(this.leftGcsToDensifiedPoint,this.transform2)),this.rightToDensifiedPoint.assign(V(this.rightGcsToDensifiedPoint,this.transform2)),this.bIsFirstInPath&&!this.pHorizon2Info.isPointStartInHorizon(this.leftGcsToDensifiedPoint,this.progressTracker)))return!1;this.rightFromDensifiedPointsStack.length=0,this.rightToDensifiedPointsStack.length=0,this.rightGcsToDensifiedPointsStack.length=0,this.rightFactorsStack.length=0,this.rightFromDensifiedPointsStack.push(this.rightFromDensifiedPoint.clone()),this.rightToDensifiedPointsStack.push(this.rightToDensifiedPoint.clone()),this.rightFactorsStack.push(this.rightFactor),this.transform2!=null&&this.rightGcsToDensifiedPointsStack.push(this.rightGcsToDensifiedPoint.clone()),this.pDensifiedPoints!==null&&this.pDensifiedPoints.push(this.leftFromDensifiedPoint.clone()),this.pDensifiedFactors!==null&&this.pDensifiedFactors.push(this.leftFactor),this.n=this.bIsCurve?this.rectifiedSegment.getGeometryType()===o.enumBezier?7:5:3,I(this.n,this.scalars);let n=this.rectifiedSegment.calculateLength2D();if(this.bCheckIfNoDensificationNeededForCurve=!1,this.bIsCurve){let e=new p({vd:this.rectifiedSegment.getDescription()}),t=new b().execute(e,this.transform,this.progressTracker);if(this.transform2!==null){let e=new f;if(t.queryEnvelope(e),!this.pHorizon2Info.isEnvelopeInHorizon(e,this.progressTracker))return!1;t=new b().execute(t,this.transform2,this.progressTracker)}t.getSegmentBuffer(0,this.projCurveSegment,!1),this.bCheckIfNoDensificationNeededForCurve=!0}for(;this.rightFromDensifiedPointsStack.length>0;){let e=!1;if(this.cutFactor=NaN,this.midFactor=NaN,this.midFromDensifiedPoint.setNAN(),this.midToDensifiedPoint.setNAN(),(this.rightFactor-this.leftFactor)*n>this.minLengthInSrFrom){let t=this.checkSegment();if(t===-1)return!1;e=t!==0}if(e)this.rightFromDensifiedPoint.setCoordsPoint2D(this.midFromDensifiedPoint),this.rightToDensifiedPoint.setCoordsPoint2D(this.midToDensifiedPoint),this.rightFactor=this.midFactor,this.rightFromDensifiedPointsStack.push(this.rightFromDensifiedPoint.clone()),this.rightToDensifiedPointsStack.push(this.rightToDensifiedPoint.clone()),this.rightFactorsStack.push(this.rightFactor),this.transform2!==null&&(this.rightGcsToDensifiedPoint.setCoordsPoint2D(this.midGcsToDensifiedPoint),this.rightGcsToDensifiedPointsStack.push(this.rightGcsToDensifiedPoint.clone()));else{if(this.transform2!==null&&!this.pHorizon2Info.isAdjoiningLineInHorizon(this.leftGcsToDensifiedPoint,this.rightGcsToDensifiedPoint,this.progressTracker))return!1;if(this.rightFromDensifiedPointsStack.pop(),this.rightToDensifiedPointsStack.pop(),this.rightFactorsStack.pop(),this.transform2!==null&&this.rightGcsToDensifiedPointsStack.pop(),this.pDensifiedPoints!==null&&this.pDensifiedPoints.push(this.rightFromDensifiedPoint.clone()),this.pDensifiedFactors!==null&&this.pDensifiedFactors.push(this.rightFactor),this.rightFromDensifiedPointsStack.length>0){this.leftFromDensifiedPoint.setCoordsPoint2D(this.rightFromDensifiedPoint),this.leftToDensifiedPoint.setCoordsPoint2D(this.rightToDensifiedPoint),this.leftFactor=this.rightFactor;let e=this.rightFromDensifiedPointsStack.at(-1),t=this.rightToDensifiedPointsStack.at(-1);if(this.rightFromDensifiedPoint.setCoordsPoint2D(e),this.rightToDensifiedPoint.setCoordsPoint2D(t),this.rightFactor=this.rightFactorsStack.at(-1),this.transform2!==null){this.leftGcsToDensifiedPoint.setCoordsPoint2D(this.rightGcsToDensifiedPoint);let e=this.rightGcsToDensifiedPointsStack.at(-1);this.rightGcsToDensifiedPoint.setCoordsPoint2D(e)}}}}return!0}}class de{getOperatorType(){return 10315}supportsCurves(){return!1}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,n,r,i,a){return M(n)?new fe(e,t,n,r,i,a):new b().executeMany(e,n,a)}execute(e,t,n,r,i){if(!M(t))return new b().execute(e,t,i);let a=new N;return a.prepare(t,null,i),a.execute(e,n,r,i)}}class fe extends e{m_geometries;m_geometriesExtent;m_transform;m_spp=null;m_minSegmentLengthInDegrees;m_maxDeviationInSrTo;m_progressTracker;m_index=-1;constructor(e,n,r,i,a,o){super(),e||t(``),this.m_progressTracker=o,this.m_geometries=e,this.m_geometriesExtent=n?n.clone():null,this.m_transform=r,this.m_minSegmentLengthInDegrees=i,this.m_maxDeviationInSrTo=a}tock(){return!0}getRank(){return 1}next(){this.m_spp||(this.m_spp=new N,this.m_spp.prepare(this.m_transform,this.m_geometriesExtent,this.m_progressTracker));let e=this.m_geometries.next();return n(e),r(e),e==null?null:(this.m_index=this.m_geometries.getGeometryID(),this.m_spp.execute(e,this.m_minSegmentLengthInDegrees,this.m_maxDeviationInSrTo,this.m_progressTracker))}getGeometryID(){return this.m_index}}export{de as OperatorShapePreservingProject};
2
+ import{G as e}from"./GeometryCursor.js";import{b as t,t as n,p as r,q as i,g as a,G as o,h as s,j as c,a as l}from"./Geometry.js";import{E as u,P as d}from"./Envelope.js";import{Envelope2D as f}from"./Envelope2D.js";import{a as p,S as m,L as h}from"./MultiPathImpl.js";import{n as g,P as _,c as v}from"./Point2D.js";import{T as y}from"./Transformation2D.js";import{O as b,F as x,ag as S,aO as C,J as w,I as T,H as E,K as D,a4 as O,a3 as k,_ as A,ax as ee,aP as te,aw as ne}from"./UnitFactory.js";import{c as j}from"./OperatorClip.js";function M(e){let t=e.getInputSR(),n=e.getOutputSR(),r=!1;do{if(t.equals(n)||!L(t)||!L(n)){r=!1;break}if(t.getCoordinateSystemType()===2||n.getCoordinateSystemType()===2){r=!0;break}let i=e.getGeographicTransformations();i!==null&&i.count()>0&&(r=!0)}while(0);return r}class re{m_horizon2;m_sr;m_bInclusive2;m_pannableExtent;m_horizon2Env=new f;m_gcs360;m_gcs180;m_gcs90;m_pannableFactor;m_period;m_gcsTolerance;m_qtIter;m_segIter;constructor(e,t,n,r){this.m_horizon2=e,this.m_sr=t,this.m_bInclusive2=n,this.m_pannableExtent=r.clone(),this.m_segIter=null,this.m_qtIter=null,e===null?(this.m_horizon2Env.setEmpty(),this.m_gcs360=NaN,this.m_gcs180=NaN,this.m_gcs90=NaN,this.m_pannableFactor=NaN,this.m_period=NaN):(e.queryEnvelope(this.m_horizon2Env),this.m_gcs360=r.width(),this.m_gcs180=.5*this.m_gcs360,this.m_gcs90=.25*this.m_gcs360,this.m_pannableFactor=1,this.m_horizon2Env.width()-this.m_gcs360>0&&(this.m_pannableFactor+=Math.ceil((this.m_horizon2Env.width()-this.m_gcs360)/this.m_gcs360)),this.m_period=this.m_gcs360),this.m_gcsTolerance=t==null?NaN:t.getTolerance(0)}isPointStartInHorizon(e,t){if(!this.m_horizon2)return!0;let n=q(new d(e),this.m_horizon2,!0,this.m_period);do{let t=e.clone();if(t.x-=n*this.m_period,this.m_horizon2.getGeometryType()===o.enumPolygon){let e;if(e=this.m_horizon2Env.contains(t)?D(this.m_horizon2,t,0):0,this.m_bInclusive2){if(e===0)return!1}else if(e===1)return!1}else{let e=this.m_horizon2Env.contains(t);if(this.m_bInclusive2){if(!e)return!1}else if(e)return!1}}while(this.m_horizon2Env.xmin+ ++n*this.m_period<e.x);return!0}isAdjoiningLineInHorizon(e,t,n){if(!this.m_horizon2)return!0;let r=new _,i=new _;Y(e,t,this.m_gcs90,this.m_gcs180,this.m_gcs360,r,i);let s=Math.max(r.x,i.x),c=new h;c.setStart2D(r),c.setEnd2D(i);let l=q(c,this.m_horizon2,!0,this.m_period);do{let e=r.clone(),t=i.clone();if(e.x-=l*this.m_period,t.x-=l*this.m_period,this.m_horizon2.getGeometryType()===o.enumPolygon){let n=new h;n.setStartXY(e),n.setEndXY(t);let r=new f,i=new f;if(n.queryEnvelope(r),i.setCoords({env2D:r}),i.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance),this.m_horizon2Env.isIntersecting(i)){let e=this.m_horizon2.getImpl(),t=e.getAccelerators();t!==null&&t.getRasterizedGeometry()!==null&&a(0);{let r=null;if(t!==null&&(r=t.getQuadTree()),r!==null){this.m_qtIter||=r.getIteratorForQT(),this.m_qtIter.resetIterator(n,this.m_gcsTolerance),this.m_segIter||=e.querySegmentIterator();for(let e=this.m_qtIter.next();e!==-1;e=this.m_qtIter.next()){let t=r.getElement(e);if(this.m_segIter.resetToVertex(t,-1),this.m_segIter.nextSegment().isIntersecting(n,this.m_gcsTolerance))return!1}}else for(this.m_segIter||=e.querySegmentIterator(),this.m_segIter.resetToFirstPath();this.m_segIter.nextPath();)for(;this.m_segIter.hasNextSegment();){let e=this.m_segIter.nextSegment(),t=new f;if(e.queryEnvelope(t),t.isIntersecting(i)&&e.isIntersecting(n,this.m_gcsTolerance))return!1}}}}else if(this.m_bInclusive2){let n=this.m_horizon2Env.contains(e),r=this.m_horizon2Env.contains(t);if(n&&r)return!0}else{let n=this.m_horizon2Env.clone();if(n.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance),n.clipLine(e,t)!==0)return!1}}while(this.m_horizon2Env.xmin+ ++l*this.m_period<s);return!this.m_bInclusive2}isEnvelopeInHorizon(e,t){if(!this.m_horizon2)return!0;let n=new u({env2D:e}),r=q(n,this.m_horizon2,!0,this.m_period);do{let i=e.clone();if(i.move(-r*this.m_period,0),n.setCoords(i.xmin,i.ymin,i.xmax,i.ymax),!K(n,this.m_horizon2,this.m_sr,this.m_bInclusive2,t))return!1}while(this.m_horizon2Env.xmin+ ++r*this.m_period<e.xmax);return!0}}class ie{m_splitLines2=null;m_transform1;m_pannableExtent;m_gcs360;m_gcs180;m_gcs90;m_gcsTolerance;m_halfGcsTolerance;m_gcsToleranceSq;m_scalars=[];m_splitIter=null;constructor(e,t,n){this.m_splitLines2=e,this.m_transform1=t,this.m_pannableExtent=n.clone(),this.m_gcs360=n.width(),this.m_gcs180=.5*this.m_gcs360,this.m_gcs90=.25*this.m_gcs360,t===null?(this.m_gcsTolerance=NaN,this.m_halfGcsTolerance=NaN,this.m_gcsToleranceSq=NaN):(this.m_gcsTolerance=this.m_transform1.getOutputSR().getTolerance(0),this.m_halfGcsTolerance=.5*this.m_gcsTolerance,this.m_gcsToleranceSq=this.m_gcsTolerance*this.m_gcsTolerance)}hasSplitLines(){return this.m_splitLines2!=null}getSplitLineFactorEx(e,t,n,r,i,a){let o=new _,s=new _;Y(r,i,this.m_gcs90,this.m_gcs180,this.m_gcs360,o,s);let c=new h;for(c.setStartXY(o),c.setEndXY(s),this.m_splitIter?this.m_splitIter.resetToFirstPath():this.m_splitIter=this.m_splitLines2.getImpl().querySegmentIterator();this.m_splitIter.nextPath();)for(;this.m_splitIter.hasNextSegment();){let r=this.m_splitIter.nextSegment(),i=.5*(r.getStartX()+r.getEndX());U(this.m_gcs180,this.m_gcs360,i,c);let o=new f;c.queryEnvelope(o),o.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance);let s=new f;if(r.queryEnvelope(s),!(!o.isIntersecting(s)||(this.m_scalars.length<2&&(this.m_scalars.length=2),c.intersect(r,null,this.m_scalars,null,this.m_gcsTolerance)!==1))&&this.m_scalars[0]>0&&this.m_scalars[0]<1){let i=$(t,n,this.m_scalars[0]),o=V(e.getCoord2D(i),this.m_transform1);return r.isIntersectingPoint(o,this.m_halfGcsTolerance)?i:this.getSplitLineFactor(e,t,n,r,a)}}return-1}getSplitLineFactor(e,t,n,r,i){let a=t,o=n,s=.5*(r.getStartX()+r.getEndX()),c=new h,l=e.getCoord2D(a),u=e.getCoord2D(o),d=V(l,this.m_transform1),f=V(u,this.m_transform1);for(;a<o;){let t=new _,n=new _;Y(d,f,this.m_gcs90,this.m_gcs180,this.m_gcs360,t,n),c.setStartXY(t),c.setEndXY(n),U(this.m_gcs180,this.m_gcs360,s,c);let i=_.sqrDistance(c.getStartXY(),c.getEndXY());if(i<=this.m_gcsToleranceSq)break;if(Number.isNaN(i))return NaN;let p=$(a,o,this.m_scalars[0]);if(a<p&&p<o||(p=.5*(o+a)),a===p||p===o)return p;let m=e.getCoord2D(p),h=V(m,this.m_transform1),g=new _;Y(d,h,this.m_gcs90,this.m_gcs180,this.m_gcs360,t,g),c.setStartXY(t),c.setEndXY(g),U(this.m_gcs180,this.m_gcs360,s,c);let v=c.intersect(r,null,this.m_scalars,null,this.m_halfGcsTolerance);if(v!==0){if(this.m_scalars[0]===1)return p;o=p,u.setCoordsPoint2D(m),f.setCoordsPoint2D(h)}else{if(Y(h,f,this.m_gcs90,this.m_gcs180,this.m_gcs360,g,n),c.setStartXY(g),c.setEndXY(n),U(this.m_gcs180,this.m_gcs360,s,c),v=c.intersect(r,null,this.m_scalars,null,this.m_halfGcsTolerance),v===0||this.m_scalars[0]===0)return p;a=p,l.setCoordsPoint2D(m),d.setCoordsPoint2D(h)}}return .5*(o+a)}}class N{m_bPrepared=!1;m_bNeedsShapePreservingProject=!1;m_inputTransform=null;m_transform1=null;m_transform2=null;m_extentFrom=null;m_horizon1=null;m_horizon2=null;m_pannableExtentFrom=new f;m_pannableExtentTo=new f;m_pannableExtentGcsTo=new f;m_bClipTopBottomFrom=!1;m_bNeedsGeoTransform=!1;m_bIsPannableFrom=!1;m_bIsPannableTo=!1;m_bInclusive1=!1;m_bInclusive2=!1;m_bSrFromIsPcs=!1;m_bSrToIsPcs=!1;m_fromTolerance=NaN;m_toTolerance=NaN;m_gcsToTolerance=NaN;m_aFrom=NaN;m_mpuFrom=NaN;m_rpuFrom=NaN;m_rpuGcsTo=NaN;m_aTo=NaN;m_mpuTo=NaN;m_stages=0;constructor(){}prepare(e,n,r){this.m_bPrepared&&i(``),e||t(``);let o=e.getInputSR(),s=e.getOutputSR();L(o)&&L(s)||t(`shape preserving project requires PCS or GCS`);let c=o.getCoordinateSystemType(),l=s.getCoordinateSystemType();this.m_bSrFromIsPcs=c===2,this.m_bSrToIsPcs=l===2;let u=null,d=null,f=null,p=null;this.m_bSrFromIsPcs?(u=o,f=o.getGCS(),this.m_aFrom=Q(f),this.m_mpuFrom=Z(u),this.m_rpuFrom=NaN):(f=o,this.m_rpuFrom=X(f),this.m_aFrom=NaN),this.m_bSrToIsPcs?(d=s,p=s.getGCS(),this.m_aTo=Q(p),this.m_mpuTo=Z(d)):(p=s,this.m_aTo=NaN,this.m_mpuTo=NaN),this.m_rpuGcsTo=X(p);let m=e.getGeographicTransformations();this.m_bNeedsGeoTransform=m!==null&&m.count()>0;let h=o.equals(s);if(this.m_bNeedsShapePreservingProject=!h&&(this.m_bSrFromIsPcs||this.m_bSrToIsPcs||this.m_bNeedsGeoTransform),!this.m_bNeedsShapePreservingProject){this.m_inputTransform=e,this.m_extentFrom=n?n.clone():null,this.m_bPrepared=!0;return}if(this.m_bIsPannableFrom=o.isPannable(),this.m_bIsPannableTo=s.isPannable(),this.m_bIsPannableFrom&&(this.m_pannableExtentFrom=o.getPannableExtent()),this.m_bIsPannableTo&&(this.m_pannableExtentTo=s.getPannableExtent()),!this.m_bSrToIsPcs)this.m_pannableExtentGcsTo=this.m_pannableExtentTo.clone();else{this.m_pannableExtentGcsTo=p.getPannableExtent();let e=d.getCentralMeridian(),t=this.m_pannableExtentGcsTo.getCenter();t.x=e,this.m_pannableExtentGcsTo.centerAt(t)}this.m_fromTolerance=o.getTolerance(0),this.m_toTolerance=s.getTolerance(0),this.m_gcsToTolerance=p.getTolerance(0);{let t=e.getExtendedParams(),i=t.clipWithInputHorizon,a=t.clipWithOutputHorizon;i&&this.setHorizon1(e,n,r),a&&this.setHorizon2(e,r),this.checkAndSetStages(e,r)}let g=T();g.setFlag(1073741824,!0),g.setFlag(536870912,!0);let _=E();if(_.clipWithInputHorizon=!1,_.clipWithOutputHorizon=!1,this.m_stages===1)this.m_transform1=x(!1,o,s,m,_,g);else if(this.m_stages===2){g.setFlag(2147483648,!0),this.m_transform1=x(!1,o,p,m,_,g);let e=T();this.m_transform2=x(!1,p,s,null,_,e)}else{a(d!=null),_.centralMeridianOfOutputGCS=d.getCentralMeridian(),this.m_transform1=x(!1,o,p,m,_,g);let e=T();e.setFlag(2147483648,!0),this.m_transform2=x(!1,p,s,null,_,e)}this.m_inputTransform=e,this.m_extentFrom=n?n.clone():null,this.m_bPrepared=!0}execute(e,t,n,r){return this.m_bPrepared||i(``),a(!e.hasAttribute(10)),this.execute_(e,t,n,r)}checkIfNeedsReset(e,t){return a(0),!1}setHorizon1(e,t,n){let r=e.getInputSR(),i=null,a,o=new f;if(this.m_bSrFromIsPcs){a=!0,i=r.getPCSHorizon(),i.queryEnvelope(o),this.m_bIsPannableFrom&&(i=new u({xmin:this.m_pannableExtentFrom.xmin,ymin:o.ymin,xmax:this.m_pannableExtentFrom.xmax,ymax:o.ymax}));let e=!1;t!=null&&(e=ce(t,i,r,a,this.m_bIsPannableFrom,this.m_pannableExtentFrom,n)),e||(this.m_horizon1=i,this.m_bInclusive1=a)}else this.m_bClipTopBottomFrom=!0,this.m_bInclusive1=!0}setHorizon2(e,t){let n=e.getOutputSR();if(n.getCoordinateSystemType()===1){this.m_horizon2=null,this.m_bInclusive2=!1;return}let r=null,i=new f,a=n.getGCSHorisonIsInclusive();r=n.getGCSHorizon(),r.queryEnvelope(i);let o=n.getCentralMeridian();if(this.m_bIsPannableTo){let e=new u({xmin:this.m_pannableExtentGcsTo.xmin,ymin:i.ymin,xmax:this.m_pannableExtentGcsTo.xmax,ymax:i.ymax});e.centerAt(o,0),r=e}this.m_horizon2=r,this.m_bInclusive2=a}checkAndSetStages(e,t){let n=e.getOutputSR().getGCSSplitLines();if(!this.m_horizon2&&!n)this.m_stages=1;else{if(this.m_horizon2.getGeometryType()===o.enumEnvelope){let e=new f;this.m_horizon2.queryEnvelope(e);let t=e.width(),n=e.height();t>=g/this.m_rpuGcsTo&&n>=Math.PI/this.m_rpuGcsTo&&(this.m_horizon2=null)}if(!this.m_horizon2&&!n)this.m_stages=1;else if(this.m_horizon2!==null&&!this.m_bNeedsGeoTransform&&!this.m_bSrFromIsPcs){let t=e.getOutputSR().getGCS();if(e.getInputSR().equals(t)){this.m_horizon1=this.m_horizon2,this.m_bInclusive1=this.m_bInclusive2,this.m_bClipTopBottomFrom=!1,this.m_horizon2=null,this.m_bInclusive2=!1,this.m_stages=1;return}this.m_stages=2}else this.m_stages=3}}execute_(e,t,i,a){if(!this.m_bNeedsShapePreservingProject)return new b().execute(e,this.m_inputTransform,a);if(!e)return null;n(e),r(e);let l=e.getGeometryType(),u;return s(l)?(u=ae(e),l=o.enumPolyline):u=e,u.isEmpty()?u:c(l)?this.executeEx(e,t,i,a):new b().execute(e,this.m_inputTransform,a)}executeEx(e,t,n,r){e.hasNonLinearSegments()&&l(``);let i;i=this.m_bIsPannableFrom?new b().foldInto360Range(e,this.m_transform1.getInputSR()):e;let a=n;a>0||(a=100*this.m_toTolerance);let o;return o=this.m_stages===1?this.executeGood(i,t,a,r):this.m_stages===2?this.executeBad(i,t,a,r):this.executeUgly(i,t,a,r),this.filterOverDensification(o,this.m_inputTransform.getOutputSR(),a,r)}executeGood(e,t,n,r){let i=n*n,a;a=t>0?this.getMinLengthInSrFrom(t):this.getMinLengthInSrFrom(1e-5);let o;return o=this.m_bClipTopBottomFrom?S(e,this.m_transform1.getInputSR()):W(e,this.m_transform1.getInputSR(),this.m_horizon1,this.m_bInclusive1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,NaN,r),o=C(o,this.m_transform1.getOutputSR(),r),o=R(o,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,a,i,r),o=new b().execute(o,this.m_transform1,r),o}executeBad(e,t,n,r){let i;i=t>0?t*(Math.PI/180/this.m_rpuGcsTo):1e-5*(Math.PI/180/this.m_rpuGcsTo);let a=n*n,o;return o=this.m_bClipTopBottomFrom?S(e,this.m_transform1.getInputSR()):e,o=new b().execute(o,this.m_transform1,r),o=W(o,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!0,NaN,r),o=C(o,this.m_transform2.getOutputSR(),r),o=R(o,this.m_transform2,!0,this.m_pannableExtentGcsTo,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,i,a,r),o=new b().execute(o,this.m_transform2,r),o}executeUgly(e,t,n,r){let i=n*n,a;a=t>0?this.getMinLengthInSrFrom(t):this.getMinLengthInSrFrom(1e-5);let o=null;o=this.m_bClipTopBottomFrom?S(e,this.m_transform1.getInputSR()):W(e,this.m_transform1.getInputSR(),this.m_horizon1,this.m_bInclusive1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,NaN,r);let s=o,c=new re(this.m_horizon2,this.m_transform2.getInputSR(),this.m_bInclusive2,this.m_pannableExtentGcsTo),l=this.m_transform2.getOutputSR().getGCSSplitLines(),u=new ie(l,this.m_transform1,this.m_pannableExtentGcsTo);if(o=R(o,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,this.m_bIsPannableTo,this.m_pannableExtentTo,this.m_transform2,c,this.m_pannableExtentGcsTo,u,a,i,r),o!==null){s=null,o=new b().execute(o,this.m_transform1,r);let e=2*(Math.PI/180/this.m_rpuGcsTo);return o=W(o,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!1,e,r),o=new b().execute(o,this.m_transform2,r),o}let d=NaN;d=n>0?n:100*this.m_toTolerance,d/=this.m_rpuGcsTo*this.m_aTo/this.m_mpuTo;let f=d*d;o=R(s,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,this.m_pannableExtentGcsTo,null,null,null,null,a,f,r),s=null,o=new b().execute(o,this.m_transform1,r);let p;return p=t>0?t*(Math.PI/180/this.m_rpuGcsTo):1e-5*(Math.PI/180/this.m_rpuGcsTo),o=W(o,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!1,NaN,r),o=C(o,this.m_transform2.getOutputSR(),r),o=R(o,this.m_transform2,!0,this.m_pannableExtentGcsTo,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,p,i,r),o=new b().execute(o,this.m_transform2,r),o}getMinLengthInSrFrom(e){let t;return t=this.m_bSrFromIsPcs?this.m_aFrom*(e*Math.PI/180)/this.m_mpuFrom:e*Math.PI/180*(1/this.m_rpuFrom),t}filterOverDensification(e,t,n,r){let i=P(e,n);return i.dropAttribute(10),i!==e&&i.getGeometryType()===o.enumPolygon&&(i=new w().execute(i,t,!1,r)),i}}function P(e,t){if(e.isEmpty()||!e.hasAttribute(10))return e;let n=t*t,r=e.getAttributeStreamRef(10),i=!1,a=new h,o=[],s=!1;for(let t=0,c=e.getPathCount();t<c;t++){let c=e.getPathStart(t),l=e.getPathEnd(t),u=e.isClosedPath(t);if(l>c){let e=u?c:l-1;(r.read(c)!==0||r.read(e)!==0)&&(i||=(r=r.clone(),!0),r.write(c,0),r.write(e,0))}else continue;let d=u?l+1:l,f=c;for(let t=c;t<d;t++){let u=t===l?c:t;if(r.read(u)===0){if(t-f>1){o.push({from:f,to:t});let u=new _;for(;o.length>0;){let t=o.at(-1);o.pop(),a.setStartXY(e.getXY(t.from));let d=t.to===l?c:t.to;a.setEndXY(e.getXY(d));let f=n,p=-1;for(let n=t.from+1,r=t.to;n<r;n++){let t=e.getXY(n),r=a.getClosestCoordinate(t,!1);a.queryCoord2D(r,u);let i=_.sqrDistance(u,t);f<i&&(f=i,p=n)}p>=0?(i||=(r=r.clone(),!0),r.write(p,0),p-t.from>1&&o.push({from:t.from,to:p}),t.to-p>1&&o.push({from:p,to:t.to})):s=!0}}f=u}}}if(!s)return e;let c=F(e,r,1);return c.dropAttribute(10),c}function F(e,t,n){let r=e.createInstance(),i=new d;for(let a=0,o=e.getPathCount();a<o;a++){let o=!0,s=0,c=0,l=e.getPathStart(a),u=e.getPathEnd(a),d=!0;for(let f=l;f<u;f++)t.read(f)===n?(!d&&c>0&&(r.addSegmentsFromPath(e,a,s-l,c,o),c=0),d=!0):d?(d=!1,e.getPointByVal(f,i),o?(r.startPathPoint(i),o=!1):r.lineToPoint(i),s=f):c++;c>0&&r.addSegmentsFromPath(e,a,s-l,c,o)}return r}function I(e,t){for(let n=0;n<e;n++){let r=Math.ceil(n/2)/(e+1);n%2!=0&&(r=-r);let i=.5+r;t[n]=i}}function L(e){if(!e)return!1;let t=e.getCoordinateSystemType();return t===2||t===1}function R(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=e.createInstance();p.addAttribute(10);let h=e.querySegmentIterator(),g=[],_=[],v=new m,y=e.getDescription().getAttributeCount()>1,b=new ue(t,n,r,i,a,o,s,l,u,d,y?_:null,g,f);for(;h.nextPath();)for(;h.hasNextSegment();){let e=h.nextSegment(),t=e.getStartXY(),n=e.getEndXY(),r=t.compare(n)>0,i=H(r,e,v);if(g.length=0,_.length=0,!b.densifySegment(h.isFirstSegmentInPath(),i))return null;r&&se(y?_:null,g),g.at(-1).setCoordsPoint2D(e.getEndXY());let a=p.getPointCount();if(!y)z(h.isFirstSegmentInPath(),h.isLastSegmentInPath()&&!h.isPathClosed(),g,p);else{let t=H(r,e,v);B(h.isFirstSegmentInPath(),h.isLastSegmentInPath()&&!h.isPathClosed(),e,t,_,g,p)}if(b.needsPostFiltering()){p.addAttribute(10);let e=p.getAttributeStreamRef(10);for(let t=1,n=g.length-1;t<n;t++)e.write(t+a,1)}}return p}function z(e,t,n,r){e&&r.insertPath2D(-1,null,0,0,!0);let i=r.getPathCount()-1;t?r.insertPointsFromPoints(i,-1,n,0,n.length,!0):r.insertPointsFromPoints(i,-1,n,0,n.length-1,!0)}function B(e,t,n,r,i,a,o){o.reserve(o.getPointCount()+a.length-1);let s=new d;if(n.queryStart(s),e?o.startPathPoint(s):o.lineToPoint(s),a.length>2){let e=r.calculateLength2D();for(let t=1;t<a.length-1;t++){let n=r.lengthToT(i[t]*e);r.queryCoord(n,s),s.setXY(a[t]),o.lineToPoint(s)}}t&&(n.queryEnd(s),o.lineToPoint(s))}function ae(e){let t=new p({vd:e.getDescription()});return t.addSegment(e,!0),t}function V(e,t){let n=t.getInputSR(),r=t.getOutputSR(),i=new _;n.getCoordinateSystemType()===2?(i.setCoordsPoint2D(e),ee(n,0,[i],1)):i.setCoordsPoint2D(e);let a=new _;a.setCoordsPoint2D(i),te(t,[a],null,1,!1);let o=new _;return r.getCoordinateSystemType()===2?(o.setCoordsPoint2D(a),ne(r,[o],1,!1)):o.setCoordsPoint2D(a),o}function oe(e,t,n,r,i,a,o,s){if(i){let i=a.width(),c=.5*i;if(r){let r=.25*i,a=!1,l=new _,u=new _;if(Math.abs(e.y)===r?(l.setCoords(n.x,e.y),u.setCoordsPoint2D(n),a=!0):Math.abs(n.y)===r&&(u.setCoords(e.x,n.y),l.setCoordsPoint2D(e),a=!0),Math.abs(t.y)===r&&(a||=(l.setCoordsPoint2D(e),u.setCoordsPoint2D(n),!0),l.x=t.x),a)return J(t,l,c,i,o),J(t,u,c,i,s),!0}let l=0;e.x-t.x>c&&n.x-t.x>c?l-=i:t.x-e.x>c&&t.x-n.x>c&&(l+=i),Math.abs(t.x-(e.x+l))<c?(o.setCoordsPoint2D(e),J(o,n,c,i,s),o.x+=l,s.x+=l):(o.setCoordsPoint2D(n),J(o,e,c,i,s),o.x+=l,s.x+=l)}else o.setCoordsPoint2D(e),s.setCoordsPoint2D(n);return!1}function H(e,t,n){return e?(n.create(t.getGeometryType()),t.copyTo(n.get()),n.get().reverse(),n.get()):t}function se(e,t){t.reverse(),e!==null&&e.reverse()}function U(e,t,n,r){let i=.5*(r.getStartX()+r.getEndX());if(i-n>e){let e=new y;e.setShiftCoords(-t,0),r.applyTransformation(e)}else if(n-i>e){let e=new y;e.setShiftCoords(t,0),r.applyTransformation(e)}}function W(e,t,n,r,i,a,o,s,c){let l=[!1];o&&G(e,t,n,r,i,a,!0,s,l,c);let u=e;return l[0]||(u=G(u,t,n,r,i,a,!1,s,null,c)),u=le(u,i,a,u!==e),u}function G(e,t,n,r,i,a,s,c,l,u){if(s&&(l[0]=!1),n==null)return e;let d=new f,p=new f;n.queryEnvelope(d),e.queryEnvelope(p);let m=e.getGeometryType(),h=n.getGeometryType(),g=t.getTolerance(0);if(!i){if(s)return l[0]=K(e,n,t,r,u),null;let i;return i=r?h===o.enumEnvelope?j(e,d,g,c,u):new O().execute(e,n,t,u):new k().execute(e,n,t,u),i===n&&(i=n.clone()),i}let _=a.width(),v=_*Math.ceil(d.width()/_),b=null;if(r){let a=q(e,n,i,v),x=0,S=new y;do{let i=null;if(h===o.enumEnvelope){let o=n.clone();if(S.setShiftCoords(a*v,0),o.applyTransformation(S),s){if(l[0]=K(e,o,t,r,u),!l[0])return null}else{let t=new f;o.queryEnvelope(t),i=j(e,t,g,c,u)}}else{let o=e.clone();if(S.setShiftCoords(-a*v,0),o.applyTransformation(S),s){if(l[0]=K(o,n,t,r,u),!l[0])return null}else i=new O().execute(o,n,t,u),i===n&&(i=n.clone())}if(!s){if(i.isEmpty())continue;if(m===o.enumPolygon){let e=new f;if(i.queryEnvelope(e),e.width()<=g)continue}h===o.enumEnvelope&&(S.setShiftCoords(-a*v,0),i===e&&(i=i.clone()),i.applyTransformation(S)),b===null?b=i===e?i.clone():i:b.add(i,!1)}x++}while(d.xmin+ ++a*v<p.xmax);if(s)return null;b===null&&(b=e.createInstance()),m===o.enumPolygon&&x>1&&_-p.width()<=10*g&&(b=new w().execute(b,t,!0,u))}else{let a=q(e,n,i,v);if(b=e.clone(),a!==0){let e=new y;e.setShiftCoords(-a*v,0),b.applyTransformation(e)}do{if(s){if(l[0]=K(b,n,t,r,u),!l[0])return null}else if(b=new k().execute(b,n,t,u),b===n&&(b=n.clone()),b.isEmpty())break;let e=new y;e.setShiftCoords(-v,0),b.applyTransformation(e)}while(d.xmin+ ++a*v<p.xmax);if(s)return null;if(!b.isEmpty()&&a!==0){let e=new y;e.setShiftCoords(a*v,0),b.applyTransformation(e)}}return b}function ce(e,t,n,r,i,a,o){let s=[!1];return G(e,n,t,r,i,a,!0,NaN,s,o),s[0]}function K(e,t,n,r,i){let a;if(t.getGeometryType()===o.enumPolygon)a=r?A(t,e,n,64,i):A(t,e,n,4,i);else if(r){let n=new f,r=new f;t.queryEnvelope(n),e.queryEnvelope(r),a=n.containsEnvelope(r)}else a=A(t,e,n,4,i);return a}function le(e,t,n,r){let i;if(!t)return e;let a=n.getCenter().x,o=n.width(),s=.5*o,c=new f;e.queryEnvelope(c);let l=c.getCenter().x,u=0;if(l-a>s?u=-Math.ceil((l-a-s)/o)*o:a-l>s&&(u=Math.ceil((a-l-s)/o)*o),u!==0){i=r?e:e.clone();let t=new y;t.setShiftCoords(u,0),i.applyTransformation(t)}else i=e;return i}function q(e,t,n,r){if(!n)return 0;let i=0,a=new f;t.queryEnvelope(a);let o=new f;e.queryEnvelope(o);let s=a.xmin+r;for(;s+r+i*r>o.xmin;)i--;for(;s+i*r<o.xmin;)i++;return i}function J(e,t,n,r,i){t.x-e.x>n?i.setCoords(t.x-r,t.y):e.x-t.x>n?i.setCoords(t.x+r,t.y):i.setCoordsPoint2D(t)}function Y(e,t,n,r,i,a,o){Math.abs(e.y)===n?(a.setCoords(t.x,e.y),o.setCoordsPoint2D(t)):Math.abs(t.y)===n?(a.setCoordsPoint2D(e),o.setCoords(e.x,t.y)):(a.setCoordsPoint2D(e),J(a,t,r,i,o))}function X(e){return e.getUnit().getUnitToBaseFactor()}function Z(e){return e.getUnit().getUnitToBaseFactor()}function Q(e){return e.getPECoordSys().getDatum().getSpheroid().getAxis()}function $(e,t,n){return n<=.5?e+(t-e)*n:t-(t-e)*(1-n)}class ue{leftFromDensifiedPoint=new _;rightFromDensifiedPoint=new _;cutFromDensifiedPoint=new _;midFromDensifiedPoint=new _;leftToDensifiedPoint=new _;rightToDensifiedPoint=new _;cutToDensifiedPoint=new _;midToDensifiedPoint=new _;line=new h;leftGcsToDensifiedPoint=new _;rightGcsToDensifiedPoint=new _;cutGcsToDensifiedPoint=new _;midGcsToDensifiedPoint=new _;bSrToIsGcs=!1;bIsCurve=!1;leftFactor=0;rightFactor=0;bIsFirstInPath=!1;rectifiedSegment=null;transform=null;bIsPannableFrom=!1;pannableExtentFrom=new f;bIsPannableTo=!1;bNeedPostFiltering=!1;pannableExtentTo=new f;transform2=null;pHorizon2Info=null;pSplitLines2Info=null;minLengthInSrFrom=0;maxDeviationInSrToSq=0;cutFactor=0;midFactor=0;pDensifiedFactors=null;pDensifiedPoints=[];progressTracker;rightFromDensifiedPointsStack=[];rightToDensifiedPointsStack=[];rightGcsToDensifiedPointsStack=[];rightFactorsStack=[];projCurveSegment=new m;n=0;bCheckIfNoDensificationNeededForCurve=!1;scalars=v(7,NaN);checkSegment(){for(let e=0;e<this.n;e++){if(this.pSplitLines2Info!==null&&this.pSplitLines2Info.hasSplitLines()&&!this.bCheckIfNoDensificationNeededForCurve){let e=this.pSplitLines2Info.getSplitLineFactorEx(this.rectifiedSegment,this.leftFactor,this.rightFactor,this.leftGcsToDensifiedPoint,this.rightGcsToDensifiedPoint,this.progressTracker);if(Number.isNaN(e))return-1;if(e!==-1&&this.leftFactor<e&&e<this.rightFactor)return this.cutFactor=e,this.cutFromDensifiedPoint.assign(this.rectifiedSegment.getCoord2D(this.cutFactor)),this.cutToDensifiedPoint.assign(V(this.cutFromDensifiedPoint,this.transform)),this.cutGcsToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.cutToDensifiedPoint.assign(V(this.cutGcsToDensifiedPoint,this.transform2)),this.midFactor=this.cutFactor,this.midFromDensifiedPoint.setCoordsPoint2D(this.cutFromDensifiedPoint),this.midToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.midGcsToDensifiedPoint.setCoordsPoint2D(this.cutGcsToDensifiedPoint),1}if(this.cutFactor=$(this.leftFactor,this.rightFactor,this.scalars[e]),this.cutFromDensifiedPoint.assign(this.rectifiedSegment.getCoord2D(this.cutFactor)),this.cutToDensifiedPoint.assign(V(this.cutFromDensifiedPoint,this.transform)),this.transform2!==null&&(this.cutGcsToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.cutToDensifiedPoint.assign(V(this.cutGcsToDensifiedPoint,this.transform2))),e===0&&(this.midFactor=this.cutFactor,this.midFromDensifiedPoint.setCoordsPoint2D(this.cutFromDensifiedPoint),this.midToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.midGcsToDensifiedPoint.setCoordsPoint2D(this.cutGcsToDensifiedPoint)),this.bIsPannableFrom&&!this.bCheckIfNoDensificationNeededForCurve&&Math.abs(this.leftFromDensifiedPoint.x-this.rightFromDensifiedPoint.x)>=.25*this.pannableExtentFrom.width())return 1;let t;if(this.bCheckIfNoDensificationNeededForCurve){let e=this.projCurveSegment.get().getClosestCoordinate(this.cutToDensifiedPoint,!1),n=this.projCurveSegment.get().getCoord2D(e);t=_.sqrDistance(this.cutToDensifiedPoint,n)}else{let n=new _,r=new _,i=oe(this.leftToDensifiedPoint,this.cutToDensifiedPoint,this.rightToDensifiedPoint,this.bSrToIsGcs,this.bIsPannableTo,this.pannableExtentTo,n,r);this.line.setStartXY(n),this.line.setEndXY(r);let a=this.line.getClosestCoordinate(this.cutToDensifiedPoint,!0);if(i||e>0||Math.abs(a-this.scalars[e])<.3){let e=this.line.getCoord2D(a);t=_.sqrDistance(this.cutToDensifiedPoint,e)}else t=this.maxDeviationInSrToSq*2,this.bNeedPostFiltering=!0}if(t>this.maxDeviationInSrToSq)return this.bCheckIfNoDensificationNeededForCurve=!1,1}return 0}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f){this.progressTracker=f,this.transform=e,this.bIsPannableFrom=t,this.pannableExtentFrom.assign(n),this.bIsPannableTo=r,this.pannableExtentTo.assign(i),this.transform2=a,this.pHorizon2Info=o,this.pSplitLines2Info=s,this.minLengthInSrFrom=c,this.maxDeviationInSrToSq=l,this.pDensifiedFactors=u,this.pDensifiedPoints=d,this.progressTracker=f,this.bNeedPostFiltering=!1}needsPostFiltering(){return this.bNeedPostFiltering}densifySegment(e,t){if(this.bIsFirstInPath=e,this.rectifiedSegment=t,this.leftGcsToDensifiedPoint.setNAN(),this.rightGcsToDensifiedPoint.setNAN(),this.cutGcsToDensifiedPoint.setNAN(),this.midGcsToDensifiedPoint.setNAN(),this.bSrToIsGcs=this.transform2==null?this.transform.getOutputSR().getCoordinateSystemType()===1:this.transform2.getOutputSR().getCoordinateSystemType()===1,this.bIsCurve=this.rectifiedSegment.isCurve(),this.leftFactor=0,this.rightFactor=1,this.leftFromDensifiedPoint.assign(this.rectifiedSegment.getStartXY()),this.rightFromDensifiedPoint.assign(this.rectifiedSegment.getEndXY()),this.leftToDensifiedPoint.assign(V(this.leftFromDensifiedPoint,this.transform)),this.rightToDensifiedPoint.assign(V(this.rightFromDensifiedPoint,this.transform)),this.transform2!==null&&(this.leftGcsToDensifiedPoint.setCoordsPoint2D(this.leftToDensifiedPoint),this.rightGcsToDensifiedPoint.setCoordsPoint2D(this.rightToDensifiedPoint),this.leftToDensifiedPoint.assign(V(this.leftGcsToDensifiedPoint,this.transform2)),this.rightToDensifiedPoint.assign(V(this.rightGcsToDensifiedPoint,this.transform2)),this.bIsFirstInPath&&!this.pHorizon2Info.isPointStartInHorizon(this.leftGcsToDensifiedPoint,this.progressTracker)))return!1;this.rightFromDensifiedPointsStack.length=0,this.rightToDensifiedPointsStack.length=0,this.rightGcsToDensifiedPointsStack.length=0,this.rightFactorsStack.length=0,this.rightFromDensifiedPointsStack.push(this.rightFromDensifiedPoint.clone()),this.rightToDensifiedPointsStack.push(this.rightToDensifiedPoint.clone()),this.rightFactorsStack.push(this.rightFactor),this.transform2!=null&&this.rightGcsToDensifiedPointsStack.push(this.rightGcsToDensifiedPoint.clone()),this.pDensifiedPoints!==null&&this.pDensifiedPoints.push(this.leftFromDensifiedPoint.clone()),this.pDensifiedFactors!==null&&this.pDensifiedFactors.push(this.leftFactor),this.n=this.bIsCurve?this.rectifiedSegment.getGeometryType()===o.enumBezier?7:5:3,I(this.n,this.scalars);let n=this.rectifiedSegment.calculateLength2D();if(this.bCheckIfNoDensificationNeededForCurve=!1,this.bIsCurve){let e=new p({vd:this.rectifiedSegment.getDescription()}),t=new b().execute(e,this.transform,this.progressTracker);if(this.transform2!==null){let e=new f;if(t.queryEnvelope(e),!this.pHorizon2Info.isEnvelopeInHorizon(e,this.progressTracker))return!1;t=new b().execute(t,this.transform2,this.progressTracker)}t.getSegmentBuffer(0,this.projCurveSegment,!1),this.bCheckIfNoDensificationNeededForCurve=!0}for(;this.rightFromDensifiedPointsStack.length>0;){let e=!1;if(this.cutFactor=NaN,this.midFactor=NaN,this.midFromDensifiedPoint.setNAN(),this.midToDensifiedPoint.setNAN(),(this.rightFactor-this.leftFactor)*n>this.minLengthInSrFrom){let t=this.checkSegment();if(t===-1)return!1;e=t!==0}if(e)this.rightFromDensifiedPoint.setCoordsPoint2D(this.midFromDensifiedPoint),this.rightToDensifiedPoint.setCoordsPoint2D(this.midToDensifiedPoint),this.rightFactor=this.midFactor,this.rightFromDensifiedPointsStack.push(this.rightFromDensifiedPoint.clone()),this.rightToDensifiedPointsStack.push(this.rightToDensifiedPoint.clone()),this.rightFactorsStack.push(this.rightFactor),this.transform2!==null&&(this.rightGcsToDensifiedPoint.setCoordsPoint2D(this.midGcsToDensifiedPoint),this.rightGcsToDensifiedPointsStack.push(this.rightGcsToDensifiedPoint.clone()));else{if(this.transform2!==null&&!this.pHorizon2Info.isAdjoiningLineInHorizon(this.leftGcsToDensifiedPoint,this.rightGcsToDensifiedPoint,this.progressTracker))return!1;if(this.rightFromDensifiedPointsStack.pop(),this.rightToDensifiedPointsStack.pop(),this.rightFactorsStack.pop(),this.transform2!==null&&this.rightGcsToDensifiedPointsStack.pop(),this.pDensifiedPoints!==null&&this.pDensifiedPoints.push(this.rightFromDensifiedPoint.clone()),this.pDensifiedFactors!==null&&this.pDensifiedFactors.push(this.rightFactor),this.rightFromDensifiedPointsStack.length>0){this.leftFromDensifiedPoint.setCoordsPoint2D(this.rightFromDensifiedPoint),this.leftToDensifiedPoint.setCoordsPoint2D(this.rightToDensifiedPoint),this.leftFactor=this.rightFactor;let e=this.rightFromDensifiedPointsStack.at(-1),t=this.rightToDensifiedPointsStack.at(-1);if(this.rightFromDensifiedPoint.setCoordsPoint2D(e),this.rightToDensifiedPoint.setCoordsPoint2D(t),this.rightFactor=this.rightFactorsStack.at(-1),this.transform2!==null){this.leftGcsToDensifiedPoint.setCoordsPoint2D(this.rightGcsToDensifiedPoint);let e=this.rightGcsToDensifiedPointsStack.at(-1);this.rightGcsToDensifiedPoint.setCoordsPoint2D(e)}}}}return!0}}class de{getOperatorType(){return 10315}supportsCurves(){return!1}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,n,r,i,a){return M(n)?new fe(e,t,n,r,i,a):new b().executeMany(e,n,a)}execute(e,t,n,r,i){if(!M(t))return new b().execute(e,t,i);let a=new N;return a.prepare(t,null,i),a.execute(e,n,r,i)}}class fe extends e{m_geometries;m_geometriesExtent;m_transform;m_spp=null;m_minSegmentLengthInDegrees;m_maxDeviationInSrTo;m_progressTracker;m_index=-1;constructor(e,n,r,i,a,o){super(),e||t(``),this.m_progressTracker=o,this.m_geometries=e,this.m_geometriesExtent=n?n.clone():null,this.m_transform=r,this.m_minSegmentLengthInDegrees=i,this.m_maxDeviationInSrTo=a}tock(){return!0}getRank(){return 1}next(){this.m_spp||(this.m_spp=new N,this.m_spp.prepare(this.m_transform,this.m_geometriesExtent,this.m_progressTracker));let e=this.m_geometries.next();return n(e),r(e),e==null?null:(this.m_index=this.m_geometries.getGeometryID(),this.m_spp.execute(e,this.m_minSegmentLengthInDegrees,this.m_maxDeviationInSrTo,this.m_progressTracker))}getGeometryID(){return this.m_index}}export{de as OperatorShapePreservingProject};