@baidumap/mapv-three 1.3.2 → 1.4.0

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 (233) hide show
  1. package/dist/assets/textures/cloud/stbn.bin +0 -0
  2. package/dist/assets/wasm/lanelet.js +3296 -165
  3. package/dist/assets/wasm/lanelet.wasm +0 -0
  4. package/dist/assets/workers/{BaiduVectorParser.worker-d550338e.js → BaiduVectorParser.worker-f7fcc351.js} +915 -865
  5. package/dist/assets/workers/{CesiumTerrainParser.worker-20119751.js → CesiumTerrainParser.worker-fcae0cc9.js} +1081 -998
  6. package/dist/assets/workers/{MVTParser.worker-7dc8b0e4.js → MVTParser.worker-0dd27c39.js} +746 -685
  7. package/dist/devtool/panel.js +99 -29
  8. package/dist/mapvthree.module.js +26026 -44996
  9. package/dist/mapvthree.umd.js +13 -7
  10. package/dist/types/Internal.d.ts +1 -0
  11. package/dist/types/index.d.ts +2 -2
  12. package/dist/types/index.open.d.ts +4 -0
  13. package/dist/types/threejs/controls/PointerLockControls.d.ts +2 -0
  14. package/dist/types/threejs/loaders/utilities/BatchTableHierarchyExtension.d.ts +4 -4
  15. package/dist/types/threejs/loaders/utilities/FeatureTable.d.ts +1 -1
  16. package/dist/types/threejs/materials/effects/LightningMaterial.d.ts +9 -0
  17. package/dist/types/threejs/materials/extend/ExtendMeshStandardMaterial.d.ts +1 -0
  18. package/dist/types/threejs/materials/natural/DynamicSkyMaterial.d.ts +1 -0
  19. package/dist/types/threejs/materials/natural/StaticSkyMaterial.d.ts +1 -0
  20. package/dist/types/threejs/materials/natural/VerticalGradientSkyMaterial.d.ts +1 -0
  21. package/dist/types/threejs/materials/polygon/PolygonMaterial.d.ts +1 -0
  22. package/dist/types/threejs/objects/GeoInstancedMesh.d.ts +1 -0
  23. package/dist/types/threejs/objects/line/Polyline.d.ts +1 -1
  24. package/dist/types/threejs/objects/point/Icon.d.ts +1 -0
  25. package/dist/types/threejs/objects/point/Label.d.ts +5 -1
  26. package/dist/types/threejs/objects/point/label/GeometryBufferBuilder.d.ts +3 -0
  27. package/dist/types/threejs/objects/point/label/TextBoxCalculator.d.ts +5 -3
  28. package/dist/types/threejs/objects/text/utils.d.ts +1 -1
  29. package/dist/types/threemap/3dtiles/HDMap3DTiles.d.ts +26 -0
  30. package/dist/types/threemap/3dtiles/materials/Default3DTilesMaterialManager.d.ts +51 -3
  31. package/dist/types/threemap/Engine.d.ts +6 -0
  32. package/dist/types/threemap/animations/ObjectTracker.d.ts +82 -43
  33. package/dist/types/threemap/animations/ObjectTracker_deprecated.d.ts +56 -0
  34. package/dist/types/threemap/animations/PathTracker.d.ts +92 -29
  35. package/dist/types/threemap/animations/RotateTracker.d.ts +123 -0
  36. package/dist/types/threemap/animations/TrackerAbstract.d.ts +26 -8
  37. package/dist/types/threemap/controls/PointerLockControls.d.ts +8 -2
  38. package/dist/types/threemap/controls/controller/ColumbusController.d.ts +10 -0
  39. package/dist/types/threemap/controls/controller/Scene3DController.d.ts +9 -0
  40. package/dist/types/threemap/controls/editors/Editor.d.ts +3 -0
  41. package/dist/types/threemap/engine/Clock.d.ts +156 -0
  42. package/dist/types/threemap/engine/Map.d.ts +20 -2
  43. package/dist/types/threemap/engine/Rendering.d.ts +15 -0
  44. package/dist/types/threemap/engine/rendering/Label.d.ts +2 -0
  45. package/dist/types/threemap/engine/rendering/MainNew.d.ts +1 -1
  46. package/dist/types/threemap/engine/rendering/postprocessing/OpaquePostprocessings.d.ts +1 -1
  47. package/dist/types/threemap/engine/rendering/postprocessing/SkyAtmospherePass.d.ts +1 -0
  48. package/dist/types/threemap/engine/rendering/scene/DirectSceneRendering.d.ts +5 -0
  49. package/dist/types/threemap/mapView/geo/terrainData/QuantizedMeshTerrainData.d.ts +1 -1
  50. package/dist/types/threemap/mapView/grid/BaiduVectorOfflineGrid.d.ts +5 -0
  51. package/dist/types/threemap/mapView/map/MapView.d.ts +3 -0
  52. package/dist/types/threemap/mapView/parser/baidulane/ElementParser.d.ts +86 -0
  53. package/dist/types/threemap/mapView/parser/baidulane/StyleParser.d.ts +28 -0
  54. package/dist/types/threemap/mapView/parser/baidulane/constants/index.d.ts +25 -0
  55. package/dist/types/threemap/mapView/parser/baidulane/constants/types.d.ts +47 -0
  56. package/dist/types/threemap/mapView/parser/baidulane/core/GeometryBuilder.d.ts +40 -0
  57. package/dist/types/threemap/mapView/parser/baidulane/core/LayerManager.d.ts +41 -0
  58. package/dist/types/threemap/mapView/parser/baidulane/core/MaterialFactory.d.ts +71 -0
  59. package/dist/types/threemap/mapView/parser/baidulane/core/StyleManager.d.ts +50 -0
  60. package/dist/types/threemap/mapView/parser/baidulane/core/TextureManager.d.ts +65 -0
  61. package/dist/types/threemap/mapView/parser/baidulane/core/wasmManager.d.ts +18 -0
  62. package/dist/types/threemap/mapView/parser/baidulane/generators/Base.d.ts +46 -0
  63. package/dist/types/threemap/mapView/parser/baidulane/generators/Building3d.d.ts +15 -0
  64. package/dist/types/threemap/mapView/parser/baidulane/generators/FlatSymbol.d.ts +15 -0
  65. package/dist/types/threemap/mapView/parser/baidulane/generators/LabelLine.d.ts +29 -0
  66. package/dist/types/threemap/mapView/parser/baidulane/generators/Line.d.ts +15 -0
  67. package/dist/types/threemap/mapView/parser/baidulane/generators/Line3d.d.ts +15 -0
  68. package/dist/types/threemap/mapView/parser/baidulane/generators/Line3dTexture.d.ts +3 -0
  69. package/dist/types/threemap/mapView/parser/baidulane/generators/LineDash.d.ts +7 -0
  70. package/dist/types/threemap/mapView/parser/baidulane/generators/LineTexture.d.ts +7 -0
  71. package/dist/types/threemap/mapView/parser/baidulane/generators/Poi.d.ts +26 -0
  72. package/dist/types/threemap/mapView/parser/baidulane/generators/Polygon.d.ts +15 -0
  73. package/dist/types/threemap/mapView/parser/baidulane/generators/Polygon3d.d.ts +40 -0
  74. package/dist/types/threemap/mapView/parser/baidulane/generators/PolygonExtrude.d.ts +15 -0
  75. package/dist/types/threemap/mapView/parser/baidulane/generators/PolygonExtrudeTexture.d.ts +18 -0
  76. package/dist/types/threemap/mapView/parser/baidulane/generators/PolygonOpacity.d.ts +7 -0
  77. package/dist/types/threemap/mapView/parser/baidulane/generators/SimplePoint.d.ts +39 -0
  78. package/dist/types/threemap/mapView/parser/baidulane/processors/Background.d.ts +11 -0
  79. package/dist/types/threemap/mapView/parser/baidulane/processors/Base.d.ts +27 -0
  80. package/dist/types/threemap/mapView/parser/baidulane/processors/BridgePier.d.ts +20 -0
  81. package/dist/types/threemap/mapView/parser/baidulane/processors/DebugLine.d.ts +16 -0
  82. package/dist/types/threemap/mapView/parser/baidulane/processors/DebugPoint.d.ts +5 -0
  83. package/dist/types/threemap/mapView/parser/baidulane/processors/DebugPolygon.d.ts +20 -0
  84. package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingGradient.d.ts +16 -0
  85. package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingGuide.d.ts +11 -0
  86. package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingLine.d.ts +11 -0
  87. package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingPoly.d.ts +15 -0
  88. package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingRoad.d.ts +13 -0
  89. package/dist/types/threemap/mapView/parser/baidulane/processors/HRegion.d.ts +11 -0
  90. package/dist/types/threemap/mapView/parser/baidulane/processors/LineName.d.ts +48 -0
  91. package/dist/types/threemap/mapView/parser/baidulane/processors/Link.d.ts +10 -0
  92. package/dist/types/threemap/mapView/parser/baidulane/processors/Poi.d.ts +7 -0
  93. package/dist/types/threemap/mapView/parser/baidulane/processors/Poly.d.ts +11 -0
  94. package/dist/types/threemap/mapView/parser/baidulane/processors/Texture.d.ts +10 -0
  95. package/dist/types/threemap/mapView/parser/baidulane/utils/color.d.ts +13 -0
  96. package/dist/types/threemap/mapView/parser/baidulane/utils/coordinate.d.ts +18 -0
  97. package/dist/types/threemap/mapView/parser/baidulane/utils/geometry.d.ts +3 -0
  98. package/dist/types/threemap/mapView/parser/baidulane/utils/icon.d.ts +8 -0
  99. package/dist/types/threemap/mapView/parser/baidulane/utils/merge.d.ts +7 -0
  100. package/dist/types/threemap/mapView/parser/baidulane/utils/tracer.d.ts +7 -0
  101. package/dist/types/{util/mapbox.d.ts → threemap/mapView/parser/mapbox/util.d.ts} +1 -1
  102. package/dist/types/threemap/mapView/surface/GroundSceneRenderer.d.ts +7 -2
  103. package/dist/types/threemap/mapView/surface/MapSurface.d.ts +2 -0
  104. package/dist/types/threemap/mapView/tileProvider/terrain/CesiumTerrainTileProvider.d.ts +3 -0
  105. package/dist/types/threemap/mapView/tileProvider/vector/BaiduLaneVectorTileProvider.d.ts +7 -0
  106. package/dist/types/threemap/mapView/tileProvider/vector/MapboxVectorTileProvider.d.ts +6 -10
  107. package/dist/types/threemap/mapView/utils/createGroundTileMesh.d.ts +2 -1
  108. package/dist/types/threemap/mapView/utils/projectVertices.d.ts +1 -1
  109. package/dist/types/threemap/materials/BatchBuildingMaterial.d.ts +9 -11
  110. package/dist/types/threemap/materials/RoadMarkingMaterial.d.ts +2 -11
  111. package/dist/types/threemap/materials/TerrainClassificationMaterial.d.ts +9 -7
  112. package/dist/types/threemap/natural/DynamicSky.d.ts +68 -22
  113. package/dist/types/threemap/natural/DynamicWeather.d.ts +15 -105
  114. package/dist/types/threemap/natural/EmptySky.d.ts +48 -62
  115. package/dist/types/threemap/natural/PhysicalSky.d.ts +220 -0
  116. package/dist/types/threemap/natural/Rain.d.ts +5 -2
  117. package/dist/types/threemap/natural/Snow.d.ts +5 -2
  118. package/dist/types/threemap/natural/StaticSky.d.ts +1 -0
  119. package/dist/types/threemap/natural/Thunderstorm.d.ts +31 -0
  120. package/dist/types/threemap/natural/clouds/CascadedShadowMaps.d.ts +31 -0
  121. package/dist/types/threemap/natural/clouds/CloudLayer.d.ts +19 -0
  122. package/dist/types/threemap/natural/clouds/CloudLayers.d.ts +13 -0
  123. package/dist/types/threemap/natural/clouds/CloudShape.d.ts +4 -0
  124. package/dist/types/threemap/natural/clouds/CloudShapeDetail.d.ts +4 -0
  125. package/dist/types/threemap/natural/clouds/CloudsEffect.d.ts +173 -0
  126. package/dist/types/threemap/natural/clouds/CloudsMaterial.d.ts +35 -0
  127. package/dist/types/threemap/natural/clouds/CloudsPass.d.ts +39 -0
  128. package/dist/types/threemap/natural/clouds/CloudsPostPass.d.ts +10 -0
  129. package/dist/types/threemap/natural/clouds/CloudsResolveMaterial.d.ts +13 -0
  130. package/dist/types/threemap/natural/clouds/DensityProfile.d.ts +10 -0
  131. package/dist/types/threemap/natural/clouds/LocalWeather.d.ts +4 -0
  132. package/dist/types/threemap/natural/clouds/PassBase.d.ts +7 -0
  133. package/dist/types/threemap/natural/clouds/Procedural3DTexture.d.ts +15 -0
  134. package/dist/types/threemap/natural/clouds/ProceduralTexture.d.ts +15 -0
  135. package/dist/types/threemap/natural/clouds/ShaderArrayPass.d.ts +3 -0
  136. package/dist/types/threemap/natural/clouds/ShadowMaterial.d.ts +14 -0
  137. package/dist/types/threemap/natural/clouds/ShadowPass.d.ts +31 -0
  138. package/dist/types/threemap/natural/clouds/ShadowResolveMaterial.d.ts +8 -0
  139. package/dist/types/threemap/natural/clouds/Turbulence.d.ts +4 -0
  140. package/dist/types/threemap/natural/clouds/bayer.d.ts +2 -0
  141. package/dist/types/threemap/natural/clouds/constants.d.ts +6 -0
  142. package/dist/types/threemap/natural/clouds/helpers/FrustumCorners.d.ts +10 -0
  143. package/dist/types/threemap/natural/clouds/helpers/setArrayRenderTargetLayers.d.ts +1 -0
  144. package/dist/types/threemap/natural/clouds/helpers/splitFrustum.d.ts +6 -0
  145. package/dist/types/threemap/natural/clouds/qualityPresets.d.ts +130 -0
  146. package/dist/types/threemap/natural/clouds/uniforms.d.ts +44 -0
  147. package/dist/types/threemap/natural/core/ArrayBufferLoader.d.ts +3 -0
  148. package/dist/types/threemap/natural/core/DataTextureLoader.d.ts +11 -0
  149. package/dist/types/threemap/natural/core/Ellipsoid.d.ts +17 -0
  150. package/dist/types/threemap/natural/core/Geodetic.d.ts +23 -0
  151. package/dist/types/threemap/natural/core/TypedArrayLoader.d.ts +5 -0
  152. package/dist/types/threemap/natural/core/capabilities.d.ts +1 -0
  153. package/dist/types/threemap/natural/core/celestialDirections.d.ts +5 -0
  154. package/dist/types/threemap/natural/core/decorators.d.ts +61 -0
  155. package/dist/types/threemap/natural/core/defineShorthand.d.ts +2 -0
  156. package/dist/types/threemap/natural/core/helpers/projectOnEllipsoidSurface.d.ts +1 -0
  157. package/dist/types/threemap/natural/core/math.d.ts +15 -0
  158. package/dist/types/threemap/natural/core/requestIdleCallback.d.ts +2 -0
  159. package/dist/types/threemap/natural/core/resolveIncludes.d.ts +1 -0
  160. package/dist/types/threemap/natural/core/shaders/index.d.ts +10 -0
  161. package/dist/types/threemap/natural/core/unrollLoops.d.ts +1 -0
  162. package/dist/types/threemap/natural/effects/DepthEffect.d.ts +15 -0
  163. package/dist/types/threemap/natural/effects/DitheringEffect.d.ts +6 -0
  164. package/dist/types/threemap/natural/effects/DownsampleThresholdMaterial.d.ts +14 -0
  165. package/dist/types/threemap/natural/effects/GeometryEffect.d.ts +11 -0
  166. package/dist/types/threemap/natural/effects/GeometryPass.d.ts +6 -0
  167. package/dist/types/threemap/natural/effects/LensFlareEffect.d.ts +31 -0
  168. package/dist/types/threemap/natural/effects/LensFlareFeaturesMaterial.d.ts +17 -0
  169. package/dist/types/threemap/natural/effects/NormalEffect.d.ts +16 -0
  170. package/dist/types/threemap/natural/effects/createHaldLookupTexture.d.ts +1 -0
  171. package/dist/types/threemap/natural/effects/index.d.ts +7 -0
  172. package/dist/types/threemap/natural/effects/setupMaterialsForGeometryPass.d.ts +1 -0
  173. package/dist/types/threemap/natural/sky/AerialPerspectiveEffect.d.ts +95 -0
  174. package/dist/types/threemap/natural/sky/AtmosphereMaterialBase.d.ts +40 -0
  175. package/dist/types/threemap/natural/sky/AtmosphereParameters.d.ts +32 -0
  176. package/dist/types/threemap/natural/sky/AtmospherePostPass.d.ts +10 -0
  177. package/dist/types/threemap/natural/sky/PrecomputedTexturesGenerator.d.ts +66 -0
  178. package/dist/types/threemap/natural/sky/SkyMaterial.d.ts +26 -0
  179. package/dist/types/threemap/natural/sky/constants.d.ts +14 -0
  180. package/dist/types/threemap/natural/sky/getAltitudeCorrectionOffset.d.ts +1 -0
  181. package/dist/types/threemap/video/VideoConfig.d.ts +2 -2
  182. package/dist/types/util/graphics/line.d.ts +2 -2
  183. package/dist/types/util/request.d.ts +1 -1
  184. package/package.json +6 -3
  185. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/color.d.ts +0 -0
  186. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/background.d.ts +0 -0
  187. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/fill-extrusion.d.ts +0 -0
  188. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/fill.d.ts +0 -0
  189. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/index.d.ts +0 -0
  190. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/line.d.ts +0 -0
  191. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/symbol.d.ts +0 -0
  192. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/compound_expression.d.ts +0 -0
  193. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/assertion.d.ts +0 -0
  194. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/at.d.ts +0 -0
  195. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/case.d.ts +0 -0
  196. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/coalesce.d.ts +0 -0
  197. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/coercion.d.ts +0 -0
  198. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/collator.d.ts +0 -0
  199. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/comparison.d.ts +0 -0
  200. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/format.d.ts +0 -0
  201. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/image.d.ts +0 -0
  202. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/in.d.ts +0 -0
  203. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/index.d.ts +0 -0
  204. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/index_of.d.ts +0 -0
  205. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/interpolate.d.ts +0 -0
  206. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/length.d.ts +0 -0
  207. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/let.d.ts +0 -0
  208. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/literal.d.ts +0 -0
  209. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/match.d.ts +0 -0
  210. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/number_format.d.ts +0 -0
  211. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/slice.d.ts +0 -0
  212. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/step.d.ts +0 -0
  213. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/var.d.ts +0 -0
  214. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/within.d.ts +0 -0
  215. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/evaluation_context.d.ts +0 -0
  216. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/expression.d.ts +0 -0
  217. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/index.d.ts +0 -0
  218. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/is_constant.d.ts +0 -0
  219. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/parsing_context.d.ts +0 -0
  220. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/parsing_error.d.ts +0 -0
  221. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/scope.d.ts +0 -0
  222. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/stops.d.ts +0 -0
  223. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/types/collator.d.ts +0 -0
  224. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/types/formatted.d.ts +0 -0
  225. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/types/resolved_image.d.ts +0 -0
  226. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/types.d.ts +0 -0
  227. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/values.d.ts +0 -0
  228. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/feature_filter/index.d.ts +0 -0
  229. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/function/convert.d.ts +0 -0
  230. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/function/index.d.ts +0 -0
  231. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/sourceLayer.d.ts +0 -0
  232. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/sprite.d.ts +0 -0
  233. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/style.d.ts +0 -0
@@ -9,10 +9,10 @@ function clamp$1(t, e, s) {
9
9
  }
10
10
  /**
11
11
  * @license
12
- * Copyright 2010-2023 Three.js Authors
12
+ * Copyright 2010-2025 Three.js Authors
13
13
  * SPDX-License-Identifier: MIT
14
14
  */
15
- const REVISION = "158", WebGLCoordinateSystem = 2e3, WebGPUCoordinateSystem = 2001, _lut = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
15
+ const REVISION = "179", WebGLCoordinateSystem = 2e3, WebGPUCoordinateSystem = 2001, _lut = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
16
16
  let _seed = 1234567;
17
17
  const DEG2RAD = Math.PI / 180, RAD2DEG = 180 / Math.PI;
18
18
  function generateUUID() {
@@ -242,14 +242,14 @@ class Vector2 {
242
242
  return this.x = Math.max(this.x, t.x), this.y = Math.max(this.y, t.y), this;
243
243
  }
244
244
  clamp(t, e) {
245
- return this.x = Math.max(t.x, Math.min(e.x, this.x)), this.y = Math.max(t.y, Math.min(e.y, this.y)), this;
245
+ return this.x = clamp(this.x, t.x, e.x), this.y = clamp(this.y, t.y, e.y), this;
246
246
  }
247
247
  clampScalar(t, e) {
248
- return this.x = Math.max(t, Math.min(e, this.x)), this.y = Math.max(t, Math.min(e, this.y)), this;
248
+ return this.x = clamp(this.x, t, e), this.y = clamp(this.y, t, e), this;
249
249
  }
250
250
  clampLength(t, e) {
251
251
  const s = this.length();
252
- return this.divideScalar(s || 1).multiplyScalar(Math.max(t, Math.min(e, s)));
252
+ return this.divideScalar(s || 1).multiplyScalar(clamp(s, t, e));
253
253
  }
254
254
  floor() {
255
255
  return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this;
@@ -336,130 +336,219 @@ class Vector2 {
336
336
  yield this.x, yield this.y;
337
337
  }
338
338
  }
339
- class Matrix3 {
340
- constructor(t, e, s, i, r, a, n, o, h) {
341
- Matrix3.prototype.isMatrix3 = true, this.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1], void 0 !== t && this.set(t, e, s, i, r, a, n, o, h);
339
+ class Quaternion$1 {
340
+ constructor(t = 0, e = 0, s = 0, i = 1) {
341
+ this.isQuaternion = true, this._x = t, this._y = e, this._z = s, this._w = i;
342
342
  }
343
- set(t, e, s, i, r, a, n, o, h) {
344
- const c = this.elements;
345
- return c[0] = t, c[1] = i, c[2] = n, c[3] = e, c[4] = r, c[5] = o, c[6] = s, c[7] = a, c[8] = h, this;
343
+ static slerpFlat(t, e, s, i, r, a, n) {
344
+ let o = s[i + 0], h = s[i + 1], c = s[i + 2], l = s[i + 3];
345
+ const u = r[a + 0], d = r[a + 1], _ = r[a + 2], m = r[a + 3];
346
+ if (0 === n)
347
+ return t[e + 0] = o, t[e + 1] = h, t[e + 2] = c, void (t[e + 3] = l);
348
+ if (1 === n)
349
+ return t[e + 0] = u, t[e + 1] = d, t[e + 2] = _, void (t[e + 3] = m);
350
+ if (l !== m || o !== u || h !== d || c !== _) {
351
+ let t2 = 1 - n;
352
+ const e2 = o * u + h * d + c * _ + l * m, s2 = e2 >= 0 ? 1 : -1, i2 = 1 - e2 * e2;
353
+ if (i2 > Number.EPSILON) {
354
+ const r3 = Math.sqrt(i2), a2 = Math.atan2(r3, e2 * s2);
355
+ t2 = Math.sin(t2 * a2) / r3, n = Math.sin(n * a2) / r3;
356
+ }
357
+ const r2 = n * s2;
358
+ if (o = o * t2 + u * r2, h = h * t2 + d * r2, c = c * t2 + _ * r2, l = l * t2 + m * r2, t2 === 1 - n) {
359
+ const t3 = 1 / Math.sqrt(o * o + h * h + c * c + l * l);
360
+ o *= t3, h *= t3, c *= t3, l *= t3;
361
+ }
362
+ }
363
+ t[e] = o, t[e + 1] = h, t[e + 2] = c, t[e + 3] = l;
346
364
  }
347
- identity() {
348
- return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this;
365
+ static multiplyQuaternionsFlat(t, e, s, i, r, a) {
366
+ const n = s[i], o = s[i + 1], h = s[i + 2], c = s[i + 3], l = r[a], u = r[a + 1], d = r[a + 2], _ = r[a + 3];
367
+ return t[e] = n * _ + c * l + o * d - h * u, t[e + 1] = o * _ + c * u + h * l - n * d, t[e + 2] = h * _ + c * d + n * u - o * l, t[e + 3] = c * _ - n * l - o * u - h * d, t;
368
+ }
369
+ get x() {
370
+ return this._x;
371
+ }
372
+ set x(t) {
373
+ this._x = t, this._onChangeCallback();
374
+ }
375
+ get y() {
376
+ return this._y;
377
+ }
378
+ set y(t) {
379
+ this._y = t, this._onChangeCallback();
380
+ }
381
+ get z() {
382
+ return this._z;
383
+ }
384
+ set z(t) {
385
+ this._z = t, this._onChangeCallback();
386
+ }
387
+ get w() {
388
+ return this._w;
389
+ }
390
+ set w(t) {
391
+ this._w = t, this._onChangeCallback();
392
+ }
393
+ set(t, e, s, i) {
394
+ return this._x = t, this._y = e, this._z = s, this._w = i, this._onChangeCallback(), this;
395
+ }
396
+ clone() {
397
+ return new this.constructor(this._x, this._y, this._z, this._w);
349
398
  }
350
399
  copy(t) {
351
- const e = this.elements, s = t.elements;
352
- return e[0] = s[0], e[1] = s[1], e[2] = s[2], e[3] = s[3], e[4] = s[4], e[5] = s[5], e[6] = s[6], e[7] = s[7], e[8] = s[8], this;
400
+ return this._x = t.x, this._y = t.y, this._z = t.z, this._w = t.w, this._onChangeCallback(), this;
353
401
  }
354
- extractBasis(t, e, s) {
355
- return t.setFromMatrix3Column(this, 0), e.setFromMatrix3Column(this, 1), s.setFromMatrix3Column(this, 2), this;
402
+ setFromEuler(t, e = true) {
403
+ const s = t._x, i = t._y, r = t._z, a = t._order, n = Math.cos, o = Math.sin, h = n(s / 2), c = n(i / 2), l = n(r / 2), u = o(s / 2), d = o(i / 2), _ = o(r / 2);
404
+ switch (a) {
405
+ case "XYZ":
406
+ this._x = u * c * l + h * d * _, this._y = h * d * l - u * c * _, this._z = h * c * _ + u * d * l, this._w = h * c * l - u * d * _;
407
+ break;
408
+ case "YXZ":
409
+ this._x = u * c * l + h * d * _, this._y = h * d * l - u * c * _, this._z = h * c * _ - u * d * l, this._w = h * c * l + u * d * _;
410
+ break;
411
+ case "ZXY":
412
+ this._x = u * c * l - h * d * _, this._y = h * d * l + u * c * _, this._z = h * c * _ + u * d * l, this._w = h * c * l - u * d * _;
413
+ break;
414
+ case "ZYX":
415
+ this._x = u * c * l - h * d * _, this._y = h * d * l + u * c * _, this._z = h * c * _ - u * d * l, this._w = h * c * l + u * d * _;
416
+ break;
417
+ case "YZX":
418
+ this._x = u * c * l + h * d * _, this._y = h * d * l + u * c * _, this._z = h * c * _ - u * d * l, this._w = h * c * l - u * d * _;
419
+ break;
420
+ case "XZY":
421
+ this._x = u * c * l - h * d * _, this._y = h * d * l - u * c * _, this._z = h * c * _ + u * d * l, this._w = h * c * l + u * d * _;
422
+ break;
423
+ default:
424
+ console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + a);
425
+ }
426
+ return true === e && this._onChangeCallback(), this;
356
427
  }
357
- setFromMatrix4(t) {
358
- const e = t.elements;
359
- return this.set(e[0], e[4], e[8], e[1], e[5], e[9], e[2], e[6], e[10]), this;
428
+ setFromAxisAngle(t, e) {
429
+ const s = e / 2, i = Math.sin(s);
430
+ return this._x = t.x * i, this._y = t.y * i, this._z = t.z * i, this._w = Math.cos(s), this._onChangeCallback(), this;
360
431
  }
361
- multiply(t) {
362
- return this.multiplyMatrices(this, t);
432
+ setFromRotationMatrix(t) {
433
+ const e = t.elements, s = e[0], i = e[4], r = e[8], a = e[1], n = e[5], o = e[9], h = e[2], c = e[6], l = e[10], u = s + n + l;
434
+ if (u > 0) {
435
+ const t2 = 0.5 / Math.sqrt(u + 1);
436
+ this._w = 0.25 / t2, this._x = (c - o) * t2, this._y = (r - h) * t2, this._z = (a - i) * t2;
437
+ } else if (s > n && s > l) {
438
+ const t2 = 2 * Math.sqrt(1 + s - n - l);
439
+ this._w = (c - o) / t2, this._x = 0.25 * t2, this._y = (i + a) / t2, this._z = (r + h) / t2;
440
+ } else if (n > l) {
441
+ const t2 = 2 * Math.sqrt(1 + n - s - l);
442
+ this._w = (r - h) / t2, this._x = (i + a) / t2, this._y = 0.25 * t2, this._z = (o + c) / t2;
443
+ } else {
444
+ const t2 = 2 * Math.sqrt(1 + l - s - n);
445
+ this._w = (a - i) / t2, this._x = (r + h) / t2, this._y = (o + c) / t2, this._z = 0.25 * t2;
446
+ }
447
+ return this._onChangeCallback(), this;
363
448
  }
364
- premultiply(t) {
365
- return this.multiplyMatrices(t, this);
449
+ setFromUnitVectors(t, e) {
450
+ let s = t.dot(e) + 1;
451
+ return s < 1e-8 ? (s = 0, Math.abs(t.x) > Math.abs(t.z) ? (this._x = -t.y, this._y = t.x, this._z = 0, this._w = s) : (this._x = 0, this._y = -t.z, this._z = t.y, this._w = s)) : (this._x = t.y * e.z - t.z * e.y, this._y = t.z * e.x - t.x * e.z, this._z = t.x * e.y - t.y * e.x, this._w = s), this.normalize();
366
452
  }
367
- multiplyMatrices(t, e) {
368
- const s = t.elements, i = e.elements, r = this.elements, a = s[0], n = s[3], o = s[6], h = s[1], c = s[4], l = s[7], u = s[2], d = s[5], _ = s[8], m = i[0], f = i[3], p = i[6], y = i[1], g = i[4], M = i[7], x = i[2], w = i[5], S = i[8];
369
- return r[0] = a * m + n * y + o * x, r[3] = a * f + n * g + o * w, r[6] = a * p + n * M + o * S, r[1] = h * m + c * y + l * x, r[4] = h * f + c * g + l * w, r[7] = h * p + c * M + l * S, r[2] = u * m + d * y + _ * x, r[5] = u * f + d * g + _ * w, r[8] = u * p + d * M + _ * S, this;
453
+ angleTo(t) {
454
+ return 2 * Math.acos(Math.abs(clamp(this.dot(t), -1, 1)));
370
455
  }
371
- multiplyScalar(t) {
372
- const e = this.elements;
373
- return e[0] *= t, e[3] *= t, e[6] *= t, e[1] *= t, e[4] *= t, e[7] *= t, e[2] *= t, e[5] *= t, e[8] *= t, this;
456
+ rotateTowards(t, e) {
457
+ const s = this.angleTo(t);
458
+ if (0 === s)
459
+ return this;
460
+ const i = Math.min(1, e / s);
461
+ return this.slerp(t, i), this;
374
462
  }
375
- determinant() {
376
- const t = this.elements, e = t[0], s = t[1], i = t[2], r = t[3], a = t[4], n = t[5], o = t[6], h = t[7], c = t[8];
377
- return e * a * c - e * n * h - s * r * c + s * n * o + i * r * h - i * a * o;
463
+ identity() {
464
+ return this.set(0, 0, 0, 1);
378
465
  }
379
466
  invert() {
380
- const t = this.elements, e = t[0], s = t[1], i = t[2], r = t[3], a = t[4], n = t[5], o = t[6], h = t[7], c = t[8], l = c * a - n * h, u = n * o - c * r, d = h * r - a * o, _ = e * l + s * u + i * d;
381
- if (0 === _)
382
- return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
383
- const m = 1 / _;
384
- return t[0] = l * m, t[1] = (i * h - c * s) * m, t[2] = (n * s - i * a) * m, t[3] = u * m, t[4] = (c * e - i * o) * m, t[5] = (i * r - n * e) * m, t[6] = d * m, t[7] = (s * o - h * e) * m, t[8] = (a * e - s * r) * m, this;
467
+ return this.conjugate();
385
468
  }
386
- transpose() {
387
- let t;
388
- const e = this.elements;
389
- return t = e[1], e[1] = e[3], e[3] = t, t = e[2], e[2] = e[6], e[6] = t, t = e[5], e[5] = e[7], e[7] = t, this;
469
+ conjugate() {
470
+ return this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this;
390
471
  }
391
- getNormalMatrix(t) {
392
- return this.setFromMatrix4(t).invert().transpose();
472
+ dot(t) {
473
+ return this._x * t._x + this._y * t._y + this._z * t._z + this._w * t._w;
393
474
  }
394
- transposeIntoArray(t) {
395
- const e = this.elements;
396
- return t[0] = e[0], t[1] = e[3], t[2] = e[6], t[3] = e[1], t[4] = e[4], t[5] = e[7], t[6] = e[2], t[7] = e[5], t[8] = e[8], this;
475
+ lengthSq() {
476
+ return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
397
477
  }
398
- setUvTransform(t, e, s, i, r, a, n) {
399
- const o = Math.cos(r), h = Math.sin(r);
400
- return this.set(s * o, s * h, -s * (o * a + h * n) + a + t, -i * h, i * o, -i * (-h * a + o * n) + n + e, 0, 0, 1), this;
478
+ length() {
479
+ return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);
401
480
  }
402
- scale(t, e) {
403
- return this.premultiply(_m3.makeScale(t, e)), this;
481
+ normalize() {
482
+ let t = this.length();
483
+ return 0 === t ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (t = 1 / t, this._x = this._x * t, this._y = this._y * t, this._z = this._z * t, this._w = this._w * t), this._onChangeCallback(), this;
404
484
  }
405
- rotate(t) {
406
- return this.premultiply(_m3.makeRotation(-t)), this;
485
+ multiply(t) {
486
+ return this.multiplyQuaternions(this, t);
407
487
  }
408
- translate(t, e) {
409
- return this.premultiply(_m3.makeTranslation(t, e)), this;
488
+ premultiply(t) {
489
+ return this.multiplyQuaternions(t, this);
410
490
  }
411
- makeTranslation(t, e) {
412
- return t.isVector2 ? this.set(1, 0, t.x, 0, 1, t.y, 0, 0, 1) : this.set(1, 0, t, 0, 1, e, 0, 0, 1), this;
491
+ multiplyQuaternions(t, e) {
492
+ const s = t._x, i = t._y, r = t._z, a = t._w, n = e._x, o = e._y, h = e._z, c = e._w;
493
+ return this._x = s * c + a * n + i * h - r * o, this._y = i * c + a * o + r * n - s * h, this._z = r * c + a * h + s * o - i * n, this._w = a * c - s * n - i * o - r * h, this._onChangeCallback(), this;
413
494
  }
414
- makeRotation(t) {
415
- const e = Math.cos(t), s = Math.sin(t);
416
- return this.set(e, -s, 0, s, e, 0, 0, 0, 1), this;
495
+ slerp(t, e) {
496
+ if (0 === e)
497
+ return this;
498
+ if (1 === e)
499
+ return this.copy(t);
500
+ const s = this._x, i = this._y, r = this._z, a = this._w;
501
+ let n = a * t._w + s * t._x + i * t._y + r * t._z;
502
+ if (n < 0 ? (this._w = -t._w, this._x = -t._x, this._y = -t._y, this._z = -t._z, n = -n) : this.copy(t), n >= 1)
503
+ return this._w = a, this._x = s, this._y = i, this._z = r, this;
504
+ const o = 1 - n * n;
505
+ if (o <= Number.EPSILON) {
506
+ const t2 = 1 - e;
507
+ return this._w = t2 * a + e * this._w, this._x = t2 * s + e * this._x, this._y = t2 * i + e * this._y, this._z = t2 * r + e * this._z, this.normalize(), this;
508
+ }
509
+ const h = Math.sqrt(o), c = Math.atan2(h, n), l = Math.sin((1 - e) * c) / h, u = Math.sin(e * c) / h;
510
+ return this._w = a * l + this._w * u, this._x = s * l + this._x * u, this._y = i * l + this._y * u, this._z = r * l + this._z * u, this._onChangeCallback(), this;
417
511
  }
418
- makeScale(t, e) {
419
- return this.set(t, 0, 0, 0, e, 0, 0, 0, 1), this;
512
+ slerpQuaternions(t, e, s) {
513
+ return this.copy(t).slerp(e, s);
514
+ }
515
+ random() {
516
+ const t = 2 * Math.PI * Math.random(), e = 2 * Math.PI * Math.random(), s = Math.random(), i = Math.sqrt(1 - s), r = Math.sqrt(s);
517
+ return this.set(i * Math.sin(t), i * Math.cos(t), r * Math.sin(e), r * Math.cos(e));
420
518
  }
421
519
  equals(t) {
422
- const e = this.elements, s = t.elements;
423
- for (let t2 = 0; t2 < 9; t2++)
424
- if (e[t2] !== s[t2])
425
- return false;
426
- return true;
520
+ return t._x === this._x && t._y === this._y && t._z === this._z && t._w === this._w;
427
521
  }
428
522
  fromArray(t, e = 0) {
429
- for (let s = 0; s < 9; s++)
430
- this.elements[s] = t[s + e];
431
- return this;
523
+ return this._x = t[e], this._y = t[e + 1], this._z = t[e + 2], this._w = t[e + 3], this._onChangeCallback(), this;
432
524
  }
433
525
  toArray(t = [], e = 0) {
434
- const s = this.elements;
435
- return t[e] = s[0], t[e + 1] = s[1], t[e + 2] = s[2], t[e + 3] = s[3], t[e + 4] = s[4], t[e + 5] = s[5], t[e + 6] = s[6], t[e + 7] = s[7], t[e + 8] = s[8], t;
526
+ return t[e] = this._x, t[e + 1] = this._y, t[e + 2] = this._z, t[e + 3] = this._w, t;
436
527
  }
437
- clone() {
438
- return new this.constructor().fromArray(this.elements);
528
+ fromBufferAttribute(t, e) {
529
+ return this._x = t.getX(e), this._y = t.getY(e), this._z = t.getZ(e), this._w = t.getW(e), this._onChangeCallback(), this;
439
530
  }
440
- }
441
- const _m3 = new Matrix3();
442
- class Vector4 {
443
- constructor(t = 0, e = 0, s = 0, i = 1) {
444
- Vector4.prototype.isVector4 = true, this.x = t, this.y = e, this.z = s, this.w = i;
531
+ toJSON() {
532
+ return this.toArray();
445
533
  }
446
- get width() {
447
- return this.z;
534
+ _onChange(t) {
535
+ return this._onChangeCallback = t, this;
448
536
  }
449
- set width(t) {
450
- this.z = t;
537
+ _onChangeCallback() {
451
538
  }
452
- get height() {
453
- return this.w;
539
+ *[Symbol.iterator]() {
540
+ yield this._x, yield this._y, yield this._z, yield this._w;
454
541
  }
455
- set height(t) {
456
- this.w = t;
542
+ }
543
+ class Vector3$1 {
544
+ constructor(t = 0, e = 0, s = 0) {
545
+ Vector3$1.prototype.isVector3 = true, this.x = t, this.y = e, this.z = s;
457
546
  }
458
- set(t, e, s, i) {
459
- return this.x = t, this.y = e, this.z = s, this.w = i, this;
547
+ set(t, e, s) {
548
+ return void 0 === s && (s = this.z), this.x = t, this.y = e, this.z = s, this;
460
549
  }
461
550
  setScalar(t) {
462
- return this.x = t, this.y = t, this.z = t, this.w = t, this;
551
+ return this.x = t, this.y = t, this.z = t, this;
463
552
  }
464
553
  setX(t) {
465
554
  return this.x = t, this;
@@ -470,9 +559,6 @@ class Vector4 {
470
559
  setZ(t) {
471
560
  return this.z = t, this;
472
561
  }
473
- setW(t) {
474
- return this.w = t, this;
475
- }
476
562
  setComponent(t, e) {
477
563
  switch (t) {
478
564
  case 0:
@@ -484,9 +570,6 @@ class Vector4 {
484
570
  case 2:
485
571
  this.z = e;
486
572
  break;
487
- case 3:
488
- this.w = e;
489
- break;
490
573
  default:
491
574
  throw new Error("index is out of range: " + t);
492
575
  }
@@ -500,112 +583,125 @@ class Vector4 {
500
583
  return this.y;
501
584
  case 2:
502
585
  return this.z;
503
- case 3:
504
- return this.w;
505
586
  default:
506
587
  throw new Error("index is out of range: " + t);
507
588
  }
508
589
  }
509
590
  clone() {
510
- return new this.constructor(this.x, this.y, this.z, this.w);
591
+ return new this.constructor(this.x, this.y, this.z);
511
592
  }
512
593
  copy(t) {
513
- return this.x = t.x, this.y = t.y, this.z = t.z, this.w = void 0 !== t.w ? t.w : 1, this;
594
+ return this.x = t.x, this.y = t.y, this.z = t.z, this;
514
595
  }
515
596
  add(t) {
516
- return this.x += t.x, this.y += t.y, this.z += t.z, this.w += t.w, this;
597
+ return this.x += t.x, this.y += t.y, this.z += t.z, this;
517
598
  }
518
599
  addScalar(t) {
519
- return this.x += t, this.y += t, this.z += t, this.w += t, this;
600
+ return this.x += t, this.y += t, this.z += t, this;
520
601
  }
521
602
  addVectors(t, e) {
522
- return this.x = t.x + e.x, this.y = t.y + e.y, this.z = t.z + e.z, this.w = t.w + e.w, this;
603
+ return this.x = t.x + e.x, this.y = t.y + e.y, this.z = t.z + e.z, this;
523
604
  }
524
605
  addScaledVector(t, e) {
525
- return this.x += t.x * e, this.y += t.y * e, this.z += t.z * e, this.w += t.w * e, this;
606
+ return this.x += t.x * e, this.y += t.y * e, this.z += t.z * e, this;
526
607
  }
527
608
  sub(t) {
528
- return this.x -= t.x, this.y -= t.y, this.z -= t.z, this.w -= t.w, this;
609
+ return this.x -= t.x, this.y -= t.y, this.z -= t.z, this;
529
610
  }
530
611
  subScalar(t) {
531
- return this.x -= t, this.y -= t, this.z -= t, this.w -= t, this;
612
+ return this.x -= t, this.y -= t, this.z -= t, this;
532
613
  }
533
614
  subVectors(t, e) {
534
- return this.x = t.x - e.x, this.y = t.y - e.y, this.z = t.z - e.z, this.w = t.w - e.w, this;
615
+ return this.x = t.x - e.x, this.y = t.y - e.y, this.z = t.z - e.z, this;
535
616
  }
536
617
  multiply(t) {
537
- return this.x *= t.x, this.y *= t.y, this.z *= t.z, this.w *= t.w, this;
618
+ return this.x *= t.x, this.y *= t.y, this.z *= t.z, this;
538
619
  }
539
620
  multiplyScalar(t) {
540
- return this.x *= t, this.y *= t, this.z *= t, this.w *= t, this;
621
+ return this.x *= t, this.y *= t, this.z *= t, this;
622
+ }
623
+ multiplyVectors(t, e) {
624
+ return this.x = t.x * e.x, this.y = t.y * e.y, this.z = t.z * e.z, this;
625
+ }
626
+ applyEuler(t) {
627
+ return this.applyQuaternion(_quaternion$4.setFromEuler(t));
628
+ }
629
+ applyAxisAngle(t, e) {
630
+ return this.applyQuaternion(_quaternion$4.setFromAxisAngle(t, e));
631
+ }
632
+ applyMatrix3(t) {
633
+ const e = this.x, s = this.y, i = this.z, r = t.elements;
634
+ return this.x = r[0] * e + r[3] * s + r[6] * i, this.y = r[1] * e + r[4] * s + r[7] * i, this.z = r[2] * e + r[5] * s + r[8] * i, this;
635
+ }
636
+ applyNormalMatrix(t) {
637
+ return this.applyMatrix3(t).normalize();
541
638
  }
542
639
  applyMatrix4(t) {
543
- const e = this.x, s = this.y, i = this.z, r = this.w, a = t.elements;
544
- return this.x = a[0] * e + a[4] * s + a[8] * i + a[12] * r, this.y = a[1] * e + a[5] * s + a[9] * i + a[13] * r, this.z = a[2] * e + a[6] * s + a[10] * i + a[14] * r, this.w = a[3] * e + a[7] * s + a[11] * i + a[15] * r, this;
640
+ const e = this.x, s = this.y, i = this.z, r = t.elements, a = 1 / (r[3] * e + r[7] * s + r[11] * i + r[15]);
641
+ return this.x = (r[0] * e + r[4] * s + r[8] * i + r[12]) * a, this.y = (r[1] * e + r[5] * s + r[9] * i + r[13]) * a, this.z = (r[2] * e + r[6] * s + r[10] * i + r[14]) * a, this;
545
642
  }
546
- divideScalar(t) {
547
- return this.multiplyScalar(1 / t);
643
+ applyQuaternion(t) {
644
+ const e = this.x, s = this.y, i = this.z, r = t.x, a = t.y, n = t.z, o = t.w, h = 2 * (a * i - n * s), c = 2 * (n * e - r * i), l = 2 * (r * s - a * e);
645
+ return this.x = e + o * h + a * l - n * c, this.y = s + o * c + n * h - r * l, this.z = i + o * l + r * c - a * h, this;
548
646
  }
549
- setAxisAngleFromQuaternion(t) {
550
- this.w = 2 * Math.acos(t.w);
551
- const e = Math.sqrt(1 - t.w * t.w);
552
- return e < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = t.x / e, this.y = t.y / e, this.z = t.z / e), this;
647
+ project(t) {
648
+ return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix);
553
649
  }
554
- setAxisAngleFromRotationMatrix(t) {
555
- let e, s, i, r;
556
- const a = 0.01, n = 0.1, o = t.elements, h = o[0], c = o[4], l = o[8], u = o[1], d = o[5], _ = o[9], m = o[2], f = o[6], p = o[10];
557
- if (Math.abs(c - u) < a && Math.abs(l - m) < a && Math.abs(_ - f) < a) {
558
- if (Math.abs(c + u) < n && Math.abs(l + m) < n && Math.abs(_ + f) < n && Math.abs(h + d + p - 3) < n)
559
- return this.set(1, 0, 0, 0), this;
560
- e = Math.PI;
561
- const t2 = (h + 1) / 2, o2 = (d + 1) / 2, y2 = (p + 1) / 2, g = (c + u) / 4, M = (l + m) / 4, x = (_ + f) / 4;
562
- return t2 > o2 && t2 > y2 ? t2 < a ? (s = 0, i = 0.707106781, r = 0.707106781) : (s = Math.sqrt(t2), i = g / s, r = M / s) : o2 > y2 ? o2 < a ? (s = 0.707106781, i = 0, r = 0.707106781) : (i = Math.sqrt(o2), s = g / i, r = x / i) : y2 < a ? (s = 0.707106781, i = 0.707106781, r = 0) : (r = Math.sqrt(y2), s = M / r, i = x / r), this.set(s, i, r, e), this;
563
- }
564
- let y = Math.sqrt((f - _) * (f - _) + (l - m) * (l - m) + (u - c) * (u - c));
565
- return Math.abs(y) < 1e-3 && (y = 1), this.x = (f - _) / y, this.y = (l - m) / y, this.z = (u - c) / y, this.w = Math.acos((h + d + p - 1) / 2), this;
650
+ unproject(t) {
651
+ return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld);
652
+ }
653
+ transformDirection(t) {
654
+ const e = this.x, s = this.y, i = this.z, r = t.elements;
655
+ return this.x = r[0] * e + r[4] * s + r[8] * i, this.y = r[1] * e + r[5] * s + r[9] * i, this.z = r[2] * e + r[6] * s + r[10] * i, this.normalize();
656
+ }
657
+ divide(t) {
658
+ return this.x /= t.x, this.y /= t.y, this.z /= t.z, this;
659
+ }
660
+ divideScalar(t) {
661
+ return this.multiplyScalar(1 / t);
566
662
  }
567
663
  min(t) {
568
- return this.x = Math.min(this.x, t.x), this.y = Math.min(this.y, t.y), this.z = Math.min(this.z, t.z), this.w = Math.min(this.w, t.w), this;
664
+ return this.x = Math.min(this.x, t.x), this.y = Math.min(this.y, t.y), this.z = Math.min(this.z, t.z), this;
569
665
  }
570
666
  max(t) {
571
- return this.x = Math.max(this.x, t.x), this.y = Math.max(this.y, t.y), this.z = Math.max(this.z, t.z), this.w = Math.max(this.w, t.w), this;
667
+ return this.x = Math.max(this.x, t.x), this.y = Math.max(this.y, t.y), this.z = Math.max(this.z, t.z), this;
572
668
  }
573
669
  clamp(t, e) {
574
- return this.x = Math.max(t.x, Math.min(e.x, this.x)), this.y = Math.max(t.y, Math.min(e.y, this.y)), this.z = Math.max(t.z, Math.min(e.z, this.z)), this.w = Math.max(t.w, Math.min(e.w, this.w)), this;
670
+ return this.x = clamp(this.x, t.x, e.x), this.y = clamp(this.y, t.y, e.y), this.z = clamp(this.z, t.z, e.z), this;
575
671
  }
576
672
  clampScalar(t, e) {
577
- return this.x = Math.max(t, Math.min(e, this.x)), this.y = Math.max(t, Math.min(e, this.y)), this.z = Math.max(t, Math.min(e, this.z)), this.w = Math.max(t, Math.min(e, this.w)), this;
673
+ return this.x = clamp(this.x, t, e), this.y = clamp(this.y, t, e), this.z = clamp(this.z, t, e), this;
578
674
  }
579
675
  clampLength(t, e) {
580
676
  const s = this.length();
581
- return this.divideScalar(s || 1).multiplyScalar(Math.max(t, Math.min(e, s)));
677
+ return this.divideScalar(s || 1).multiplyScalar(clamp(s, t, e));
582
678
  }
583
679
  floor() {
584
- return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this.w = Math.floor(this.w), this;
680
+ return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this;
585
681
  }
586
682
  ceil() {
587
- return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this.w = Math.ceil(this.w), this;
683
+ return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this;
588
684
  }
589
685
  round() {
590
- return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this.w = Math.round(this.w), this;
686
+ return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this;
591
687
  }
592
688
  roundToZero() {
593
- return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this.w = Math.trunc(this.w), this;
689
+ return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this;
594
690
  }
595
691
  negate() {
596
- return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this;
692
+ return this.x = -this.x, this.y = -this.y, this.z = -this.z, this;
597
693
  }
598
694
  dot(t) {
599
- return this.x * t.x + this.y * t.y + this.z * t.z + this.w * t.w;
695
+ return this.x * t.x + this.y * t.y + this.z * t.z;
600
696
  }
601
697
  lengthSq() {
602
- return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
698
+ return this.x * this.x + this.y * this.y + this.z * this.z;
603
699
  }
604
700
  length() {
605
- return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
701
+ return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
606
702
  }
607
703
  manhattanLength() {
608
- return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);
704
+ return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
609
705
  }
610
706
  normalize() {
611
707
  return this.divideScalar(this.length() || 1);
@@ -614,243 +710,229 @@ class Vector4 {
614
710
  return this.normalize().multiplyScalar(t);
615
711
  }
616
712
  lerp(t, e) {
617
- return this.x += (t.x - this.x) * e, this.y += (t.y - this.y) * e, this.z += (t.z - this.z) * e, this.w += (t.w - this.w) * e, this;
713
+ return this.x += (t.x - this.x) * e, this.y += (t.y - this.y) * e, this.z += (t.z - this.z) * e, this;
618
714
  }
619
715
  lerpVectors(t, e, s) {
620
- return this.x = t.x + (e.x - t.x) * s, this.y = t.y + (e.y - t.y) * s, this.z = t.z + (e.z - t.z) * s, this.w = t.w + (e.w - t.w) * s, this;
621
- }
622
- equals(t) {
623
- return t.x === this.x && t.y === this.y && t.z === this.z && t.w === this.w;
716
+ return this.x = t.x + (e.x - t.x) * s, this.y = t.y + (e.y - t.y) * s, this.z = t.z + (e.z - t.z) * s, this;
624
717
  }
625
- fromArray(t, e = 0) {
626
- return this.x = t[e], this.y = t[e + 1], this.z = t[e + 2], this.w = t[e + 3], this;
718
+ cross(t) {
719
+ return this.crossVectors(this, t);
627
720
  }
628
- toArray(t = [], e = 0) {
629
- return t[e] = this.x, t[e + 1] = this.y, t[e + 2] = this.z, t[e + 3] = this.w, t;
721
+ crossVectors(t, e) {
722
+ const s = t.x, i = t.y, r = t.z, a = e.x, n = e.y, o = e.z;
723
+ return this.x = i * o - r * n, this.y = r * a - s * o, this.z = s * n - i * a, this;
630
724
  }
631
- fromBufferAttribute(t, e) {
632
- return this.x = t.getX(e), this.y = t.getY(e), this.z = t.getZ(e), this.w = t.getW(e), this;
725
+ projectOnVector(t) {
726
+ const e = t.lengthSq();
727
+ if (0 === e)
728
+ return this.set(0, 0, 0);
729
+ const s = t.dot(this) / e;
730
+ return this.copy(t).multiplyScalar(s);
633
731
  }
634
- random() {
635
- return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this.w = Math.random(), this;
732
+ projectOnPlane(t) {
733
+ return _vector$c.copy(this).projectOnVector(t), this.sub(_vector$c);
636
734
  }
637
- *[Symbol.iterator]() {
638
- yield this.x, yield this.y, yield this.z, yield this.w;
735
+ reflect(t) {
736
+ return this.sub(_vector$c.copy(t).multiplyScalar(2 * this.dot(t)));
639
737
  }
640
- }
641
- class Quaternion$1 {
642
- constructor(t = 0, e = 0, s = 0, i = 1) {
643
- this.isQuaternion = true, this._x = t, this._y = e, this._z = s, this._w = i;
738
+ angleTo(t) {
739
+ const e = Math.sqrt(this.lengthSq() * t.lengthSq());
740
+ if (0 === e)
741
+ return Math.PI / 2;
742
+ const s = this.dot(t) / e;
743
+ return Math.acos(clamp(s, -1, 1));
644
744
  }
645
- static slerpFlat(t, e, s, i, r, a, n) {
646
- let o = s[i + 0], h = s[i + 1], c = s[i + 2], l = s[i + 3];
647
- const u = r[a + 0], d = r[a + 1], _ = r[a + 2], m = r[a + 3];
648
- if (0 === n)
649
- return t[e + 0] = o, t[e + 1] = h, t[e + 2] = c, void (t[e + 3] = l);
650
- if (1 === n)
651
- return t[e + 0] = u, t[e + 1] = d, t[e + 2] = _, void (t[e + 3] = m);
652
- if (l !== m || o !== u || h !== d || c !== _) {
653
- let t2 = 1 - n;
654
- const e2 = o * u + h * d + c * _ + l * m, s2 = e2 >= 0 ? 1 : -1, i2 = 1 - e2 * e2;
655
- if (i2 > Number.EPSILON) {
656
- const r3 = Math.sqrt(i2), a2 = Math.atan2(r3, e2 * s2);
657
- t2 = Math.sin(t2 * a2) / r3, n = Math.sin(n * a2) / r3;
658
- }
659
- const r2 = n * s2;
660
- if (o = o * t2 + u * r2, h = h * t2 + d * r2, c = c * t2 + _ * r2, l = l * t2 + m * r2, t2 === 1 - n) {
661
- const t3 = 1 / Math.sqrt(o * o + h * h + c * c + l * l);
662
- o *= t3, h *= t3, c *= t3, l *= t3;
663
- }
664
- }
665
- t[e] = o, t[e + 1] = h, t[e + 2] = c, t[e + 3] = l;
745
+ distanceTo(t) {
746
+ return Math.sqrt(this.distanceToSquared(t));
666
747
  }
667
- static multiplyQuaternionsFlat(t, e, s, i, r, a) {
668
- const n = s[i], o = s[i + 1], h = s[i + 2], c = s[i + 3], l = r[a], u = r[a + 1], d = r[a + 2], _ = r[a + 3];
669
- return t[e] = n * _ + c * l + o * d - h * u, t[e + 1] = o * _ + c * u + h * l - n * d, t[e + 2] = h * _ + c * d + n * u - o * l, t[e + 3] = c * _ - n * l - o * u - h * d, t;
748
+ distanceToSquared(t) {
749
+ const e = this.x - t.x, s = this.y - t.y, i = this.z - t.z;
750
+ return e * e + s * s + i * i;
670
751
  }
671
- get x() {
672
- return this._x;
752
+ manhattanDistanceTo(t) {
753
+ return Math.abs(this.x - t.x) + Math.abs(this.y - t.y) + Math.abs(this.z - t.z);
673
754
  }
674
- set x(t) {
675
- this._x = t, this._onChangeCallback();
755
+ setFromSpherical(t) {
756
+ return this.setFromSphericalCoords(t.radius, t.phi, t.theta);
676
757
  }
677
- get y() {
678
- return this._y;
758
+ setFromSphericalCoords(t, e, s) {
759
+ const i = Math.sin(e) * t;
760
+ return this.x = i * Math.sin(s), this.y = Math.cos(e) * t, this.z = i * Math.cos(s), this;
679
761
  }
680
- set y(t) {
681
- this._y = t, this._onChangeCallback();
762
+ setFromCylindrical(t) {
763
+ return this.setFromCylindricalCoords(t.radius, t.theta, t.y);
682
764
  }
683
- get z() {
684
- return this._z;
765
+ setFromCylindricalCoords(t, e, s) {
766
+ return this.x = t * Math.sin(e), this.y = s, this.z = t * Math.cos(e), this;
685
767
  }
686
- set z(t) {
687
- this._z = t, this._onChangeCallback();
768
+ setFromMatrixPosition(t) {
769
+ const e = t.elements;
770
+ return this.x = e[12], this.y = e[13], this.z = e[14], this;
688
771
  }
689
- get w() {
690
- return this._w;
772
+ setFromMatrixScale(t) {
773
+ const e = this.setFromMatrixColumn(t, 0).length(), s = this.setFromMatrixColumn(t, 1).length(), i = this.setFromMatrixColumn(t, 2).length();
774
+ return this.x = e, this.y = s, this.z = i, this;
691
775
  }
692
- set w(t) {
693
- this._w = t, this._onChangeCallback();
776
+ setFromMatrixColumn(t, e) {
777
+ return this.fromArray(t.elements, 4 * e);
694
778
  }
695
- set(t, e, s, i) {
696
- return this._x = t, this._y = e, this._z = s, this._w = i, this._onChangeCallback(), this;
779
+ setFromMatrix3Column(t, e) {
780
+ return this.fromArray(t.elements, 3 * e);
697
781
  }
698
- clone() {
699
- return new this.constructor(this._x, this._y, this._z, this._w);
782
+ setFromEuler(t) {
783
+ return this.x = t._x, this.y = t._y, this.z = t._z, this;
700
784
  }
701
- copy(t) {
702
- return this._x = t.x, this._y = t.y, this._z = t.z, this._w = t.w, this._onChangeCallback(), this;
785
+ setFromColor(t) {
786
+ return this.x = t.r, this.y = t.g, this.z = t.b, this;
703
787
  }
704
- setFromEuler(t, e) {
705
- const s = t._x, i = t._y, r = t._z, a = t._order, n = Math.cos, o = Math.sin, h = n(s / 2), c = n(i / 2), l = n(r / 2), u = o(s / 2), d = o(i / 2), _ = o(r / 2);
706
- switch (a) {
707
- case "XYZ":
708
- this._x = u * c * l + h * d * _, this._y = h * d * l - u * c * _, this._z = h * c * _ + u * d * l, this._w = h * c * l - u * d * _;
709
- break;
710
- case "YXZ":
711
- this._x = u * c * l + h * d * _, this._y = h * d * l - u * c * _, this._z = h * c * _ - u * d * l, this._w = h * c * l + u * d * _;
712
- break;
713
- case "ZXY":
714
- this._x = u * c * l - h * d * _, this._y = h * d * l + u * c * _, this._z = h * c * _ + u * d * l, this._w = h * c * l - u * d * _;
715
- break;
716
- case "ZYX":
717
- this._x = u * c * l - h * d * _, this._y = h * d * l + u * c * _, this._z = h * c * _ - u * d * l, this._w = h * c * l + u * d * _;
718
- break;
719
- case "YZX":
720
- this._x = u * c * l + h * d * _, this._y = h * d * l + u * c * _, this._z = h * c * _ - u * d * l, this._w = h * c * l - u * d * _;
721
- break;
722
- case "XZY":
723
- this._x = u * c * l - h * d * _, this._y = h * d * l - u * c * _, this._z = h * c * _ + u * d * l, this._w = h * c * l + u * d * _;
724
- break;
725
- default:
726
- console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + a);
727
- }
728
- return false !== e && this._onChangeCallback(), this;
788
+ equals(t) {
789
+ return t.x === this.x && t.y === this.y && t.z === this.z;
729
790
  }
730
- setFromAxisAngle(t, e) {
731
- const s = e / 2, i = Math.sin(s);
732
- return this._x = t.x * i, this._y = t.y * i, this._z = t.z * i, this._w = Math.cos(s), this._onChangeCallback(), this;
791
+ fromArray(t, e = 0) {
792
+ return this.x = t[e], this.y = t[e + 1], this.z = t[e + 2], this;
733
793
  }
734
- setFromRotationMatrix(t) {
735
- const e = t.elements, s = e[0], i = e[4], r = e[8], a = e[1], n = e[5], o = e[9], h = e[2], c = e[6], l = e[10], u = s + n + l;
736
- if (u > 0) {
737
- const t2 = 0.5 / Math.sqrt(u + 1);
738
- this._w = 0.25 / t2, this._x = (c - o) * t2, this._y = (r - h) * t2, this._z = (a - i) * t2;
739
- } else if (s > n && s > l) {
740
- const t2 = 2 * Math.sqrt(1 + s - n - l);
741
- this._w = (c - o) / t2, this._x = 0.25 * t2, this._y = (i + a) / t2, this._z = (r + h) / t2;
742
- } else if (n > l) {
743
- const t2 = 2 * Math.sqrt(1 + n - s - l);
744
- this._w = (r - h) / t2, this._x = (i + a) / t2, this._y = 0.25 * t2, this._z = (o + c) / t2;
745
- } else {
746
- const t2 = 2 * Math.sqrt(1 + l - s - n);
747
- this._w = (a - i) / t2, this._x = (r + h) / t2, this._y = (o + c) / t2, this._z = 0.25 * t2;
748
- }
749
- return this._onChangeCallback(), this;
794
+ toArray(t = [], e = 0) {
795
+ return t[e] = this.x, t[e + 1] = this.y, t[e + 2] = this.z, t;
750
796
  }
751
- setFromUnitVectors(t, e) {
752
- let s = t.dot(e) + 1;
753
- return s < Number.EPSILON ? (s = 0, Math.abs(t.x) > Math.abs(t.z) ? (this._x = -t.y, this._y = t.x, this._z = 0, this._w = s) : (this._x = 0, this._y = -t.z, this._z = t.y, this._w = s)) : (this._x = t.y * e.z - t.z * e.y, this._y = t.z * e.x - t.x * e.z, this._z = t.x * e.y - t.y * e.x, this._w = s), this.normalize();
797
+ fromBufferAttribute(t, e) {
798
+ return this.x = t.getX(e), this.y = t.getY(e), this.z = t.getZ(e), this;
754
799
  }
755
- angleTo(t) {
756
- return 2 * Math.acos(Math.abs(clamp(this.dot(t), -1, 1)));
800
+ random() {
801
+ return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;
757
802
  }
758
- rotateTowards(t, e) {
759
- const s = this.angleTo(t);
760
- if (0 === s)
761
- return this;
762
- const i = Math.min(1, e / s);
763
- return this.slerp(t, i), this;
803
+ randomDirection() {
804
+ const t = Math.random() * Math.PI * 2, e = 2 * Math.random() - 1, s = Math.sqrt(1 - e * e);
805
+ return this.x = s * Math.cos(t), this.y = e, this.z = s * Math.sin(t), this;
764
806
  }
765
- identity() {
766
- return this.set(0, 0, 0, 1);
807
+ *[Symbol.iterator]() {
808
+ yield this.x, yield this.y, yield this.z;
767
809
  }
768
- invert() {
769
- return this.conjugate();
810
+ }
811
+ const _vector$c = new Vector3$1(), _quaternion$4 = new Quaternion$1();
812
+ class Matrix3 {
813
+ constructor(t, e, s, i, r, a, n, o, h) {
814
+ Matrix3.prototype.isMatrix3 = true, this.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1], void 0 !== t && this.set(t, e, s, i, r, a, n, o, h);
770
815
  }
771
- conjugate() {
772
- return this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this;
816
+ set(t, e, s, i, r, a, n, o, h) {
817
+ const c = this.elements;
818
+ return c[0] = t, c[1] = i, c[2] = n, c[3] = e, c[4] = r, c[5] = o, c[6] = s, c[7] = a, c[8] = h, this;
773
819
  }
774
- dot(t) {
775
- return this._x * t._x + this._y * t._y + this._z * t._z + this._w * t._w;
820
+ identity() {
821
+ return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this;
776
822
  }
777
- lengthSq() {
778
- return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
823
+ copy(t) {
824
+ const e = this.elements, s = t.elements;
825
+ return e[0] = s[0], e[1] = s[1], e[2] = s[2], e[3] = s[3], e[4] = s[4], e[5] = s[5], e[6] = s[6], e[7] = s[7], e[8] = s[8], this;
779
826
  }
780
- length() {
781
- return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);
827
+ extractBasis(t, e, s) {
828
+ return t.setFromMatrix3Column(this, 0), e.setFromMatrix3Column(this, 1), s.setFromMatrix3Column(this, 2), this;
782
829
  }
783
- normalize() {
784
- let t = this.length();
785
- return 0 === t ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (t = 1 / t, this._x = this._x * t, this._y = this._y * t, this._z = this._z * t, this._w = this._w * t), this._onChangeCallback(), this;
830
+ setFromMatrix4(t) {
831
+ const e = t.elements;
832
+ return this.set(e[0], e[4], e[8], e[1], e[5], e[9], e[2], e[6], e[10]), this;
786
833
  }
787
834
  multiply(t) {
788
- return this.multiplyQuaternions(this, t);
835
+ return this.multiplyMatrices(this, t);
789
836
  }
790
837
  premultiply(t) {
791
- return this.multiplyQuaternions(t, this);
838
+ return this.multiplyMatrices(t, this);
792
839
  }
793
- multiplyQuaternions(t, e) {
794
- const s = t._x, i = t._y, r = t._z, a = t._w, n = e._x, o = e._y, h = e._z, c = e._w;
795
- return this._x = s * c + a * n + i * h - r * o, this._y = i * c + a * o + r * n - s * h, this._z = r * c + a * h + s * o - i * n, this._w = a * c - s * n - i * o - r * h, this._onChangeCallback(), this;
840
+ multiplyMatrices(t, e) {
841
+ const s = t.elements, i = e.elements, r = this.elements, a = s[0], n = s[3], o = s[6], h = s[1], c = s[4], l = s[7], u = s[2], d = s[5], _ = s[8], m = i[0], p = i[3], f = i[6], y = i[1], g = i[4], M = i[7], x = i[2], w = i[5], S = i[8];
842
+ return r[0] = a * m + n * y + o * x, r[3] = a * p + n * g + o * w, r[6] = a * f + n * M + o * S, r[1] = h * m + c * y + l * x, r[4] = h * p + c * g + l * w, r[7] = h * f + c * M + l * S, r[2] = u * m + d * y + _ * x, r[5] = u * p + d * g + _ * w, r[8] = u * f + d * M + _ * S, this;
796
843
  }
797
- slerp(t, e) {
798
- if (0 === e)
799
- return this;
800
- if (1 === e)
801
- return this.copy(t);
802
- const s = this._x, i = this._y, r = this._z, a = this._w;
803
- let n = a * t._w + s * t._x + i * t._y + r * t._z;
804
- if (n < 0 ? (this._w = -t._w, this._x = -t._x, this._y = -t._y, this._z = -t._z, n = -n) : this.copy(t), n >= 1)
805
- return this._w = a, this._x = s, this._y = i, this._z = r, this;
806
- const o = 1 - n * n;
807
- if (o <= Number.EPSILON) {
808
- const t2 = 1 - e;
809
- return this._w = t2 * a + e * this._w, this._x = t2 * s + e * this._x, this._y = t2 * i + e * this._y, this._z = t2 * r + e * this._z, this.normalize(), this._onChangeCallback(), this;
810
- }
811
- const h = Math.sqrt(o), c = Math.atan2(h, n), l = Math.sin((1 - e) * c) / h, u = Math.sin(e * c) / h;
812
- return this._w = a * l + this._w * u, this._x = s * l + this._x * u, this._y = i * l + this._y * u, this._z = r * l + this._z * u, this._onChangeCallback(), this;
844
+ multiplyScalar(t) {
845
+ const e = this.elements;
846
+ return e[0] *= t, e[3] *= t, e[6] *= t, e[1] *= t, e[4] *= t, e[7] *= t, e[2] *= t, e[5] *= t, e[8] *= t, this;
813
847
  }
814
- slerpQuaternions(t, e, s) {
815
- return this.copy(t).slerp(e, s);
848
+ determinant() {
849
+ const t = this.elements, e = t[0], s = t[1], i = t[2], r = t[3], a = t[4], n = t[5], o = t[6], h = t[7], c = t[8];
850
+ return e * a * c - e * n * h - s * r * c + s * n * o + i * r * h - i * a * o;
851
+ }
852
+ invert() {
853
+ const t = this.elements, e = t[0], s = t[1], i = t[2], r = t[3], a = t[4], n = t[5], o = t[6], h = t[7], c = t[8], l = c * a - n * h, u = n * o - c * r, d = h * r - a * o, _ = e * l + s * u + i * d;
854
+ if (0 === _)
855
+ return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
856
+ const m = 1 / _;
857
+ return t[0] = l * m, t[1] = (i * h - c * s) * m, t[2] = (n * s - i * a) * m, t[3] = u * m, t[4] = (c * e - i * o) * m, t[5] = (i * r - n * e) * m, t[6] = d * m, t[7] = (s * o - h * e) * m, t[8] = (a * e - s * r) * m, this;
858
+ }
859
+ transpose() {
860
+ let t;
861
+ const e = this.elements;
862
+ return t = e[1], e[1] = e[3], e[3] = t, t = e[2], e[2] = e[6], e[6] = t, t = e[5], e[5] = e[7], e[7] = t, this;
863
+ }
864
+ getNormalMatrix(t) {
865
+ return this.setFromMatrix4(t).invert().transpose();
866
+ }
867
+ transposeIntoArray(t) {
868
+ const e = this.elements;
869
+ return t[0] = e[0], t[1] = e[3], t[2] = e[6], t[3] = e[1], t[4] = e[4], t[5] = e[7], t[6] = e[2], t[7] = e[5], t[8] = e[8], this;
870
+ }
871
+ setUvTransform(t, e, s, i, r, a, n) {
872
+ const o = Math.cos(r), h = Math.sin(r);
873
+ return this.set(s * o, s * h, -s * (o * a + h * n) + a + t, -i * h, i * o, -i * (-h * a + o * n) + n + e, 0, 0, 1), this;
874
+ }
875
+ scale(t, e) {
876
+ return this.premultiply(_m3.makeScale(t, e)), this;
877
+ }
878
+ rotate(t) {
879
+ return this.premultiply(_m3.makeRotation(-t)), this;
880
+ }
881
+ translate(t, e) {
882
+ return this.premultiply(_m3.makeTranslation(t, e)), this;
883
+ }
884
+ makeTranslation(t, e) {
885
+ return t.isVector2 ? this.set(1, 0, t.x, 0, 1, t.y, 0, 0, 1) : this.set(1, 0, t, 0, 1, e, 0, 0, 1), this;
816
886
  }
817
- random() {
818
- const t = Math.random(), e = Math.sqrt(1 - t), s = Math.sqrt(t), i = 2 * Math.PI * Math.random(), r = 2 * Math.PI * Math.random();
819
- return this.set(e * Math.cos(i), s * Math.sin(r), s * Math.cos(r), e * Math.sin(i));
887
+ makeRotation(t) {
888
+ const e = Math.cos(t), s = Math.sin(t);
889
+ return this.set(e, -s, 0, s, e, 0, 0, 0, 1), this;
890
+ }
891
+ makeScale(t, e) {
892
+ return this.set(t, 0, 0, 0, e, 0, 0, 0, 1), this;
820
893
  }
821
894
  equals(t) {
822
- return t._x === this._x && t._y === this._y && t._z === this._z && t._w === this._w;
895
+ const e = this.elements, s = t.elements;
896
+ for (let t2 = 0; t2 < 9; t2++)
897
+ if (e[t2] !== s[t2])
898
+ return false;
899
+ return true;
823
900
  }
824
901
  fromArray(t, e = 0) {
825
- return this._x = t[e], this._y = t[e + 1], this._z = t[e + 2], this._w = t[e + 3], this._onChangeCallback(), this;
902
+ for (let s = 0; s < 9; s++)
903
+ this.elements[s] = t[s + e];
904
+ return this;
826
905
  }
827
906
  toArray(t = [], e = 0) {
828
- return t[e] = this._x, t[e + 1] = this._y, t[e + 2] = this._z, t[e + 3] = this._w, t;
907
+ const s = this.elements;
908
+ return t[e] = s[0], t[e + 1] = s[1], t[e + 2] = s[2], t[e + 3] = s[3], t[e + 4] = s[4], t[e + 5] = s[5], t[e + 6] = s[6], t[e + 7] = s[7], t[e + 8] = s[8], t;
829
909
  }
830
- fromBufferAttribute(t, e) {
831
- return this._x = t.getX(e), this._y = t.getY(e), this._z = t.getZ(e), this._w = t.getW(e), this;
910
+ clone() {
911
+ return new this.constructor().fromArray(this.elements);
832
912
  }
833
- toJSON() {
834
- return this.toArray();
913
+ }
914
+ const _m3 = new Matrix3();
915
+ class Vector4 {
916
+ constructor(t = 0, e = 0, s = 0, i = 1) {
917
+ Vector4.prototype.isVector4 = true, this.x = t, this.y = e, this.z = s, this.w = i;
835
918
  }
836
- _onChange(t) {
837
- return this._onChangeCallback = t, this;
919
+ get width() {
920
+ return this.z;
838
921
  }
839
- _onChangeCallback() {
922
+ set width(t) {
923
+ this.z = t;
840
924
  }
841
- *[Symbol.iterator]() {
842
- yield this._x, yield this._y, yield this._z, yield this._w;
925
+ get height() {
926
+ return this.w;
843
927
  }
844
- }
845
- class Vector3$1 {
846
- constructor(t = 0, e = 0, s = 0) {
847
- Vector3$1.prototype.isVector3 = true, this.x = t, this.y = e, this.z = s;
928
+ set height(t) {
929
+ this.w = t;
848
930
  }
849
- set(t, e, s) {
850
- return void 0 === s && (s = this.z), this.x = t, this.y = e, this.z = s, this;
931
+ set(t, e, s, i) {
932
+ return this.x = t, this.y = e, this.z = s, this.w = i, this;
851
933
  }
852
934
  setScalar(t) {
853
- return this.x = t, this.y = t, this.z = t, this;
935
+ return this.x = t, this.y = t, this.z = t, this.w = t, this;
854
936
  }
855
937
  setX(t) {
856
938
  return this.x = t, this;
@@ -861,6 +943,9 @@ class Vector3$1 {
861
943
  setZ(t) {
862
944
  return this.z = t, this;
863
945
  }
946
+ setW(t) {
947
+ return this.w = t, this;
948
+ }
864
949
  setComponent(t, e) {
865
950
  switch (t) {
866
951
  case 0:
@@ -872,6 +957,9 @@ class Vector3$1 {
872
957
  case 2:
873
958
  this.z = e;
874
959
  break;
960
+ case 3:
961
+ this.w = e;
962
+ break;
875
963
  default:
876
964
  throw new Error("index is out of range: " + t);
877
965
  }
@@ -885,125 +973,119 @@ class Vector3$1 {
885
973
  return this.y;
886
974
  case 2:
887
975
  return this.z;
976
+ case 3:
977
+ return this.w;
888
978
  default:
889
979
  throw new Error("index is out of range: " + t);
890
980
  }
891
981
  }
892
982
  clone() {
893
- return new this.constructor(this.x, this.y, this.z);
983
+ return new this.constructor(this.x, this.y, this.z, this.w);
894
984
  }
895
985
  copy(t) {
896
- return this.x = t.x, this.y = t.y, this.z = t.z, this;
986
+ return this.x = t.x, this.y = t.y, this.z = t.z, this.w = void 0 !== t.w ? t.w : 1, this;
897
987
  }
898
988
  add(t) {
899
- return this.x += t.x, this.y += t.y, this.z += t.z, this;
989
+ return this.x += t.x, this.y += t.y, this.z += t.z, this.w += t.w, this;
900
990
  }
901
991
  addScalar(t) {
902
- return this.x += t, this.y += t, this.z += t, this;
992
+ return this.x += t, this.y += t, this.z += t, this.w += t, this;
903
993
  }
904
994
  addVectors(t, e) {
905
- return this.x = t.x + e.x, this.y = t.y + e.y, this.z = t.z + e.z, this;
995
+ return this.x = t.x + e.x, this.y = t.y + e.y, this.z = t.z + e.z, this.w = t.w + e.w, this;
906
996
  }
907
997
  addScaledVector(t, e) {
908
- return this.x += t.x * e, this.y += t.y * e, this.z += t.z * e, this;
998
+ return this.x += t.x * e, this.y += t.y * e, this.z += t.z * e, this.w += t.w * e, this;
909
999
  }
910
1000
  sub(t) {
911
- return this.x -= t.x, this.y -= t.y, this.z -= t.z, this;
1001
+ return this.x -= t.x, this.y -= t.y, this.z -= t.z, this.w -= t.w, this;
912
1002
  }
913
1003
  subScalar(t) {
914
- return this.x -= t, this.y -= t, this.z -= t, this;
1004
+ return this.x -= t, this.y -= t, this.z -= t, this.w -= t, this;
915
1005
  }
916
1006
  subVectors(t, e) {
917
- return this.x = t.x - e.x, this.y = t.y - e.y, this.z = t.z - e.z, this;
1007
+ return this.x = t.x - e.x, this.y = t.y - e.y, this.z = t.z - e.z, this.w = t.w - e.w, this;
918
1008
  }
919
1009
  multiply(t) {
920
- return this.x *= t.x, this.y *= t.y, this.z *= t.z, this;
1010
+ return this.x *= t.x, this.y *= t.y, this.z *= t.z, this.w *= t.w, this;
921
1011
  }
922
1012
  multiplyScalar(t) {
923
- return this.x *= t, this.y *= t, this.z *= t, this;
924
- }
925
- multiplyVectors(t, e) {
926
- return this.x = t.x * e.x, this.y = t.y * e.y, this.z = t.z * e.z, this;
927
- }
928
- applyEuler(t) {
929
- return this.applyQuaternion(_quaternion$4.setFromEuler(t));
930
- }
931
- applyAxisAngle(t, e) {
932
- return this.applyQuaternion(_quaternion$4.setFromAxisAngle(t, e));
933
- }
934
- applyMatrix3(t) {
935
- const e = this.x, s = this.y, i = this.z, r = t.elements;
936
- return this.x = r[0] * e + r[3] * s + r[6] * i, this.y = r[1] * e + r[4] * s + r[7] * i, this.z = r[2] * e + r[5] * s + r[8] * i, this;
937
- }
938
- applyNormalMatrix(t) {
939
- return this.applyMatrix3(t).normalize();
1013
+ return this.x *= t, this.y *= t, this.z *= t, this.w *= t, this;
940
1014
  }
941
1015
  applyMatrix4(t) {
942
- const e = this.x, s = this.y, i = this.z, r = t.elements, a = 1 / (r[3] * e + r[7] * s + r[11] * i + r[15]);
943
- return this.x = (r[0] * e + r[4] * s + r[8] * i + r[12]) * a, this.y = (r[1] * e + r[5] * s + r[9] * i + r[13]) * a, this.z = (r[2] * e + r[6] * s + r[10] * i + r[14]) * a, this;
944
- }
945
- applyQuaternion(t) {
946
- const e = this.x, s = this.y, i = this.z, r = t.x, a = t.y, n = t.z, o = t.w, h = 2 * (a * i - n * s), c = 2 * (n * e - r * i), l = 2 * (r * s - a * e);
947
- return this.x = e + o * h + a * l - n * c, this.y = s + o * c + n * h - r * l, this.z = i + o * l + r * c - a * h, this;
948
- }
949
- project(t) {
950
- return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix);
951
- }
952
- unproject(t) {
953
- return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld);
954
- }
955
- transformDirection(t) {
956
- const e = this.x, s = this.y, i = this.z, r = t.elements;
957
- return this.x = r[0] * e + r[4] * s + r[8] * i, this.y = r[1] * e + r[5] * s + r[9] * i, this.z = r[2] * e + r[6] * s + r[10] * i, this.normalize();
1016
+ const e = this.x, s = this.y, i = this.z, r = this.w, a = t.elements;
1017
+ return this.x = a[0] * e + a[4] * s + a[8] * i + a[12] * r, this.y = a[1] * e + a[5] * s + a[9] * i + a[13] * r, this.z = a[2] * e + a[6] * s + a[10] * i + a[14] * r, this.w = a[3] * e + a[7] * s + a[11] * i + a[15] * r, this;
958
1018
  }
959
1019
  divide(t) {
960
- return this.x /= t.x, this.y /= t.y, this.z /= t.z, this;
1020
+ return this.x /= t.x, this.y /= t.y, this.z /= t.z, this.w /= t.w, this;
961
1021
  }
962
1022
  divideScalar(t) {
963
1023
  return this.multiplyScalar(1 / t);
964
1024
  }
1025
+ setAxisAngleFromQuaternion(t) {
1026
+ this.w = 2 * Math.acos(t.w);
1027
+ const e = Math.sqrt(1 - t.w * t.w);
1028
+ return e < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = t.x / e, this.y = t.y / e, this.z = t.z / e), this;
1029
+ }
1030
+ setAxisAngleFromRotationMatrix(t) {
1031
+ let e, s, i, r;
1032
+ const a = 0.01, n = 0.1, o = t.elements, h = o[0], c = o[4], l = o[8], u = o[1], d = o[5], _ = o[9], m = o[2], p = o[6], f = o[10];
1033
+ if (Math.abs(c - u) < a && Math.abs(l - m) < a && Math.abs(_ - p) < a) {
1034
+ if (Math.abs(c + u) < n && Math.abs(l + m) < n && Math.abs(_ + p) < n && Math.abs(h + d + f - 3) < n)
1035
+ return this.set(1, 0, 0, 0), this;
1036
+ e = Math.PI;
1037
+ const t2 = (h + 1) / 2, o2 = (d + 1) / 2, y2 = (f + 1) / 2, g = (c + u) / 4, M = (l + m) / 4, x = (_ + p) / 4;
1038
+ return t2 > o2 && t2 > y2 ? t2 < a ? (s = 0, i = 0.707106781, r = 0.707106781) : (s = Math.sqrt(t2), i = g / s, r = M / s) : o2 > y2 ? o2 < a ? (s = 0.707106781, i = 0, r = 0.707106781) : (i = Math.sqrt(o2), s = g / i, r = x / i) : y2 < a ? (s = 0.707106781, i = 0.707106781, r = 0) : (r = Math.sqrt(y2), s = M / r, i = x / r), this.set(s, i, r, e), this;
1039
+ }
1040
+ let y = Math.sqrt((p - _) * (p - _) + (l - m) * (l - m) + (u - c) * (u - c));
1041
+ return Math.abs(y) < 1e-3 && (y = 1), this.x = (p - _) / y, this.y = (l - m) / y, this.z = (u - c) / y, this.w = Math.acos((h + d + f - 1) / 2), this;
1042
+ }
1043
+ setFromMatrixPosition(t) {
1044
+ const e = t.elements;
1045
+ return this.x = e[12], this.y = e[13], this.z = e[14], this.w = e[15], this;
1046
+ }
965
1047
  min(t) {
966
- return this.x = Math.min(this.x, t.x), this.y = Math.min(this.y, t.y), this.z = Math.min(this.z, t.z), this;
1048
+ return this.x = Math.min(this.x, t.x), this.y = Math.min(this.y, t.y), this.z = Math.min(this.z, t.z), this.w = Math.min(this.w, t.w), this;
967
1049
  }
968
1050
  max(t) {
969
- return this.x = Math.max(this.x, t.x), this.y = Math.max(this.y, t.y), this.z = Math.max(this.z, t.z), this;
1051
+ return this.x = Math.max(this.x, t.x), this.y = Math.max(this.y, t.y), this.z = Math.max(this.z, t.z), this.w = Math.max(this.w, t.w), this;
970
1052
  }
971
1053
  clamp(t, e) {
972
- return this.x = Math.max(t.x, Math.min(e.x, this.x)), this.y = Math.max(t.y, Math.min(e.y, this.y)), this.z = Math.max(t.z, Math.min(e.z, this.z)), this;
1054
+ return this.x = clamp(this.x, t.x, e.x), this.y = clamp(this.y, t.y, e.y), this.z = clamp(this.z, t.z, e.z), this.w = clamp(this.w, t.w, e.w), this;
973
1055
  }
974
1056
  clampScalar(t, e) {
975
- return this.x = Math.max(t, Math.min(e, this.x)), this.y = Math.max(t, Math.min(e, this.y)), this.z = Math.max(t, Math.min(e, this.z)), this;
1057
+ return this.x = clamp(this.x, t, e), this.y = clamp(this.y, t, e), this.z = clamp(this.z, t, e), this.w = clamp(this.w, t, e), this;
976
1058
  }
977
1059
  clampLength(t, e) {
978
1060
  const s = this.length();
979
- return this.divideScalar(s || 1).multiplyScalar(Math.max(t, Math.min(e, s)));
1061
+ return this.divideScalar(s || 1).multiplyScalar(clamp(s, t, e));
980
1062
  }
981
1063
  floor() {
982
- return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this;
1064
+ return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this.w = Math.floor(this.w), this;
983
1065
  }
984
1066
  ceil() {
985
- return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this;
1067
+ return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this.w = Math.ceil(this.w), this;
986
1068
  }
987
1069
  round() {
988
- return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this;
1070
+ return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this.w = Math.round(this.w), this;
989
1071
  }
990
1072
  roundToZero() {
991
- return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this;
1073
+ return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this.w = Math.trunc(this.w), this;
992
1074
  }
993
1075
  negate() {
994
- return this.x = -this.x, this.y = -this.y, this.z = -this.z, this;
1076
+ return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this;
995
1077
  }
996
1078
  dot(t) {
997
- return this.x * t.x + this.y * t.y + this.z * t.z;
1079
+ return this.x * t.x + this.y * t.y + this.z * t.z + this.w * t.w;
998
1080
  }
999
1081
  lengthSq() {
1000
- return this.x * this.x + this.y * this.y + this.z * this.z;
1082
+ return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
1001
1083
  }
1002
1084
  length() {
1003
- return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
1085
+ return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
1004
1086
  }
1005
1087
  manhattanLength() {
1006
- return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
1088
+ return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);
1007
1089
  }
1008
1090
  normalize() {
1009
1091
  return this.divideScalar(this.length() || 1);
@@ -1012,105 +1094,30 @@ class Vector3$1 {
1012
1094
  return this.normalize().multiplyScalar(t);
1013
1095
  }
1014
1096
  lerp(t, e) {
1015
- return this.x += (t.x - this.x) * e, this.y += (t.y - this.y) * e, this.z += (t.z - this.z) * e, this;
1097
+ return this.x += (t.x - this.x) * e, this.y += (t.y - this.y) * e, this.z += (t.z - this.z) * e, this.w += (t.w - this.w) * e, this;
1016
1098
  }
1017
1099
  lerpVectors(t, e, s) {
1018
- return this.x = t.x + (e.x - t.x) * s, this.y = t.y + (e.y - t.y) * s, this.z = t.z + (e.z - t.z) * s, this;
1019
- }
1020
- cross(t) {
1021
- return this.crossVectors(this, t);
1022
- }
1023
- crossVectors(t, e) {
1024
- const s = t.x, i = t.y, r = t.z, a = e.x, n = e.y, o = e.z;
1025
- return this.x = i * o - r * n, this.y = r * a - s * o, this.z = s * n - i * a, this;
1026
- }
1027
- projectOnVector(t) {
1028
- const e = t.lengthSq();
1029
- if (0 === e)
1030
- return this.set(0, 0, 0);
1031
- const s = t.dot(this) / e;
1032
- return this.copy(t).multiplyScalar(s);
1033
- }
1034
- projectOnPlane(t) {
1035
- return _vector$b.copy(this).projectOnVector(t), this.sub(_vector$b);
1036
- }
1037
- reflect(t) {
1038
- return this.sub(_vector$b.copy(t).multiplyScalar(2 * this.dot(t)));
1039
- }
1040
- angleTo(t) {
1041
- const e = Math.sqrt(this.lengthSq() * t.lengthSq());
1042
- if (0 === e)
1043
- return Math.PI / 2;
1044
- const s = this.dot(t) / e;
1045
- return Math.acos(clamp(s, -1, 1));
1046
- }
1047
- distanceTo(t) {
1048
- return Math.sqrt(this.distanceToSquared(t));
1049
- }
1050
- distanceToSquared(t) {
1051
- const e = this.x - t.x, s = this.y - t.y, i = this.z - t.z;
1052
- return e * e + s * s + i * i;
1053
- }
1054
- manhattanDistanceTo(t) {
1055
- return Math.abs(this.x - t.x) + Math.abs(this.y - t.y) + Math.abs(this.z - t.z);
1056
- }
1057
- setFromSpherical(t) {
1058
- return this.setFromSphericalCoords(t.radius, t.phi, t.theta);
1059
- }
1060
- setFromSphericalCoords(t, e, s) {
1061
- const i = Math.sin(e) * t;
1062
- return this.x = i * Math.sin(s), this.y = Math.cos(e) * t, this.z = i * Math.cos(s), this;
1063
- }
1064
- setFromCylindrical(t) {
1065
- return this.setFromCylindricalCoords(t.radius, t.theta, t.y);
1066
- }
1067
- setFromCylindricalCoords(t, e, s) {
1068
- return this.x = t * Math.sin(e), this.y = s, this.z = t * Math.cos(e), this;
1069
- }
1070
- setFromMatrixPosition(t) {
1071
- const e = t.elements;
1072
- return this.x = e[12], this.y = e[13], this.z = e[14], this;
1073
- }
1074
- setFromMatrixScale(t) {
1075
- const e = this.setFromMatrixColumn(t, 0).length(), s = this.setFromMatrixColumn(t, 1).length(), i = this.setFromMatrixColumn(t, 2).length();
1076
- return this.x = e, this.y = s, this.z = i, this;
1077
- }
1078
- setFromMatrixColumn(t, e) {
1079
- return this.fromArray(t.elements, 4 * e);
1080
- }
1081
- setFromMatrix3Column(t, e) {
1082
- return this.fromArray(t.elements, 3 * e);
1083
- }
1084
- setFromEuler(t) {
1085
- return this.x = t._x, this.y = t._y, this.z = t._z, this;
1086
- }
1087
- setFromColor(t) {
1088
- return this.x = t.r, this.y = t.g, this.z = t.b, this;
1100
+ return this.x = t.x + (e.x - t.x) * s, this.y = t.y + (e.y - t.y) * s, this.z = t.z + (e.z - t.z) * s, this.w = t.w + (e.w - t.w) * s, this;
1089
1101
  }
1090
1102
  equals(t) {
1091
- return t.x === this.x && t.y === this.y && t.z === this.z;
1103
+ return t.x === this.x && t.y === this.y && t.z === this.z && t.w === this.w;
1092
1104
  }
1093
1105
  fromArray(t, e = 0) {
1094
- return this.x = t[e], this.y = t[e + 1], this.z = t[e + 2], this;
1106
+ return this.x = t[e], this.y = t[e + 1], this.z = t[e + 2], this.w = t[e + 3], this;
1095
1107
  }
1096
1108
  toArray(t = [], e = 0) {
1097
- return t[e] = this.x, t[e + 1] = this.y, t[e + 2] = this.z, t;
1109
+ return t[e] = this.x, t[e + 1] = this.y, t[e + 2] = this.z, t[e + 3] = this.w, t;
1098
1110
  }
1099
1111
  fromBufferAttribute(t, e) {
1100
- return this.x = t.getX(e), this.y = t.getY(e), this.z = t.getZ(e), this;
1112
+ return this.x = t.getX(e), this.y = t.getY(e), this.z = t.getZ(e), this.w = t.getW(e), this;
1101
1113
  }
1102
1114
  random() {
1103
- return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;
1104
- }
1105
- randomDirection() {
1106
- const t = 2 * (Math.random() - 0.5), e = Math.random() * Math.PI * 2, s = Math.sqrt(1 - t ** 2);
1107
- return this.x = s * Math.cos(e), this.y = s * Math.sin(e), this.z = t, this;
1115
+ return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this.w = Math.random(), this;
1108
1116
  }
1109
1117
  *[Symbol.iterator]() {
1110
- yield this.x, yield this.y, yield this.z;
1118
+ yield this.x, yield this.y, yield this.z, yield this.w;
1111
1119
  }
1112
1120
  }
1113
- const _vector$b = new Vector3$1(), _quaternion$4 = new Quaternion$1();
1114
1121
  class Box3 {
1115
1122
  constructor(t = new Vector3$1(1 / 0, 1 / 0, 1 / 0), e = new Vector3$1(-1 / 0, -1 / 0, -1 / 0)) {
1116
1123
  this.isBox3 = true, this.min = t, this.max = e;
@@ -1121,13 +1128,13 @@ class Box3 {
1121
1128
  setFromArray(t) {
1122
1129
  this.makeEmpty();
1123
1130
  for (let e = 0, s = t.length; e < s; e += 3)
1124
- this.expandByPoint(_vector$a.fromArray(t, e));
1131
+ this.expandByPoint(_vector$b.fromArray(t, e));
1125
1132
  return this;
1126
1133
  }
1127
1134
  setFromBufferAttribute(t) {
1128
1135
  this.makeEmpty();
1129
1136
  for (let e = 0, s = t.count; e < s; e++)
1130
- this.expandByPoint(_vector$a.fromBufferAttribute(t, e));
1137
+ this.expandByPoint(_vector$b.fromBufferAttribute(t, e));
1131
1138
  return this;
1132
1139
  }
1133
1140
  setFromPoints(t) {
@@ -1137,7 +1144,7 @@ class Box3 {
1137
1144
  return this;
1138
1145
  }
1139
1146
  setFromCenterAndSize(t, e) {
1140
- const s = _vector$a.copy(e).multiplyScalar(0.5);
1147
+ const s = _vector$b.copy(e).multiplyScalar(0.5);
1141
1148
  return this.min.copy(t).sub(s), this.max.copy(t).add(s), this;
1142
1149
  }
1143
1150
  setFromObject(t, e = false) {
@@ -1177,9 +1184,9 @@ class Box3 {
1177
1184
  const i2 = s.getAttribute("position");
1178
1185
  if (true === e && void 0 !== i2 && true !== t.isInstancedMesh)
1179
1186
  for (let e2 = 0, s2 = i2.count; e2 < s2; e2++)
1180
- true === t.isMesh ? t.getVertexPosition(e2, _vector$a) : _vector$a.fromBufferAttribute(i2, e2), _vector$a.applyMatrix4(t.matrixWorld), this.expandByPoint(_vector$a);
1187
+ true === t.isMesh ? t.getVertexPosition(e2, _vector$b) : _vector$b.fromBufferAttribute(i2, e2), _vector$b.applyMatrix4(t.matrixWorld), this.expandByPoint(_vector$b);
1181
1188
  else
1182
- void 0 !== t.boundingBox ? (null === t.boundingBox && t.computeBoundingBox(), _box$3.copy(t.boundingBox)) : (null === s.boundingBox && s.computeBoundingBox(), _box$3.copy(s.boundingBox)), _box$3.applyMatrix4(t.matrixWorld), this.union(_box$3);
1189
+ void 0 !== t.boundingBox ? (null === t.boundingBox && t.computeBoundingBox(), _box$4.copy(t.boundingBox)) : (null === s.boundingBox && s.computeBoundingBox(), _box$4.copy(s.boundingBox)), _box$4.applyMatrix4(t.matrixWorld), this.union(_box$4);
1183
1190
  }
1184
1191
  const i = t.children;
1185
1192
  for (let t2 = 0, s2 = i.length; t2 < s2; t2++)
@@ -1187,7 +1194,7 @@ class Box3 {
1187
1194
  return this;
1188
1195
  }
1189
1196
  containsPoint(t) {
1190
- return !(t.x < this.min.x || t.x > this.max.x || t.y < this.min.y || t.y > this.max.y || t.z < this.min.z || t.z > this.max.z);
1197
+ return t.x >= this.min.x && t.x <= this.max.x && t.y >= this.min.y && t.y <= this.max.y && t.z >= this.min.z && t.z <= this.max.z;
1191
1198
  }
1192
1199
  containsBox(t) {
1193
1200
  return this.min.x <= t.min.x && t.max.x <= this.max.x && this.min.y <= t.min.y && t.max.y <= this.max.y && this.min.z <= t.min.z && t.max.z <= this.max.z;
@@ -1196,10 +1203,10 @@ class Box3 {
1196
1203
  return e.set((t.x - this.min.x) / (this.max.x - this.min.x), (t.y - this.min.y) / (this.max.y - this.min.y), (t.z - this.min.z) / (this.max.z - this.min.z));
1197
1204
  }
1198
1205
  intersectsBox(t) {
1199
- return !(t.max.x < this.min.x || t.min.x > this.max.x || t.max.y < this.min.y || t.min.y > this.max.y || t.max.z < this.min.z || t.min.z > this.max.z);
1206
+ return t.max.x >= this.min.x && t.min.x <= this.max.x && t.max.y >= this.min.y && t.min.y <= this.max.y && t.max.z >= this.min.z && t.min.z <= this.max.z;
1200
1207
  }
1201
1208
  intersectsSphere(t) {
1202
- return this.clampPoint(t.center, _vector$a), _vector$a.distanceToSquared(t.center) <= t.radius * t.radius;
1209
+ return this.clampPoint(t.center, _vector$b), _vector$b.distanceToSquared(t.center) <= t.radius * t.radius;
1203
1210
  }
1204
1211
  intersectsPlane(t) {
1205
1212
  let e, s;
@@ -1216,10 +1223,10 @@ class Box3 {
1216
1223
  return e.copy(t).clamp(this.min, this.max);
1217
1224
  }
1218
1225
  distanceToPoint(t) {
1219
- return this.clampPoint(t, _vector$a).distanceTo(t);
1226
+ return this.clampPoint(t, _vector$b).distanceTo(t);
1220
1227
  }
1221
1228
  getBoundingSphere(t) {
1222
- return this.isEmpty() ? t.makeEmpty() : (this.getCenter(t.center), t.radius = 0.5 * this.getSize(_vector$a).length()), t;
1229
+ return this.isEmpty() ? t.makeEmpty() : (this.getCenter(t.center), t.radius = 0.5 * this.getSize(_vector$b).length()), t;
1223
1230
  }
1224
1231
  intersect(t) {
1225
1232
  return this.min.max(t.min), this.max.min(t.max), this.isEmpty() && this.makeEmpty(), this;
@@ -1236,8 +1243,14 @@ class Box3 {
1236
1243
  equals(t) {
1237
1244
  return t.min.equals(this.min) && t.max.equals(this.max);
1238
1245
  }
1246
+ toJSON() {
1247
+ return { min: this.min.toArray(), max: this.max.toArray() };
1248
+ }
1249
+ fromJSON(t) {
1250
+ return this.min.fromArray(t.min), this.max.fromArray(t.max), this;
1251
+ }
1239
1252
  }
1240
- const _points = [new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1()], _vector$a = new Vector3$1(), _box$3 = new Box3(), _v0$2 = new Vector3$1(), _v1$7 = new Vector3$1(), _v2$4 = new Vector3$1(), _f0 = new Vector3$1(), _f1 = new Vector3$1(), _f2 = new Vector3$1(), _center$1 = new Vector3$1(), _extents = new Vector3$1(), _triangleNormal = new Vector3$1(), _testAxis = new Vector3$1();
1253
+ const _points = [new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1(), new Vector3$1()], _vector$b = new Vector3$1(), _box$4 = new Box3(), _v0$2 = new Vector3$1(), _v1$7 = new Vector3$1(), _v2$4 = new Vector3$1(), _f0 = new Vector3$1(), _f1 = new Vector3$1(), _f2 = new Vector3$1(), _center$1 = new Vector3$1(), _extents = new Vector3$1(), _triangleNormal = new Vector3$1(), _testAxis = new Vector3$1();
1241
1254
  function satForAxes(t, e, s, i, r) {
1242
1255
  for (let a = 0, n = t.length - 3; a <= n; a += 3) {
1243
1256
  _testAxis.fromArray(t, a);
@@ -1247,7 +1260,7 @@ function satForAxes(t, e, s, i, r) {
1247
1260
  }
1248
1261
  return true;
1249
1262
  }
1250
- const _vector$9 = new Vector3$1(), _segCenter = new Vector3$1(), _segDir = new Vector3$1(), _diff = new Vector3$1(), _edge1 = new Vector3$1(), _edge2 = new Vector3$1(), _normal$1 = new Vector3$1();
1263
+ const _vector$a = new Vector3$1(), _segCenter = new Vector3$1(), _segDir = new Vector3$1(), _diff = new Vector3$1(), _edge1 = new Vector3$1(), _edge2 = new Vector3$1(), _normal$1 = new Vector3$1();
1251
1264
  class Ray {
1252
1265
  constructor(t = new Vector3$1(), e = new Vector3$1(0, 0, -1)) {
1253
1266
  this.origin = t, this.direction = e;
@@ -1265,7 +1278,7 @@ class Ray {
1265
1278
  return this.direction.copy(t).sub(this.origin).normalize(), this;
1266
1279
  }
1267
1280
  recast(t) {
1268
- return this.origin.copy(this.at(t, _vector$9)), this;
1281
+ return this.origin.copy(this.at(t, _vector$a)), this;
1269
1282
  }
1270
1283
  closestPointToPoint(t, e) {
1271
1284
  e.subVectors(t, this.origin);
@@ -1276,8 +1289,8 @@ class Ray {
1276
1289
  return Math.sqrt(this.distanceSqToPoint(t));
1277
1290
  }
1278
1291
  distanceSqToPoint(t) {
1279
- const e = _vector$9.subVectors(t, this.origin).dot(this.direction);
1280
- return e < 0 ? this.origin.distanceToSquared(t) : (_vector$9.copy(this.origin).addScaledVector(this.direction, e), _vector$9.distanceToSquared(t));
1292
+ const e = _vector$a.subVectors(t, this.origin).dot(this.direction);
1293
+ return e < 0 ? this.origin.distanceToSquared(t) : (_vector$a.copy(this.origin).addScaledVector(this.direction, e), _vector$a.distanceToSquared(t));
1281
1294
  }
1282
1295
  distanceSqToSegment(t, e, s, i) {
1283
1296
  _segCenter.copy(t).add(e).multiplyScalar(0.5), _segDir.copy(e).sub(t).normalize(), _diff.copy(this.origin).sub(_segCenter);
@@ -1300,15 +1313,15 @@ class Ray {
1300
1313
  return s && s.copy(this.origin).addScaledVector(this.direction, l), i && i.copy(_segCenter).addScaledVector(_segDir, u), d;
1301
1314
  }
1302
1315
  intersectSphere(t, e) {
1303
- _vector$9.subVectors(t.center, this.origin);
1304
- const s = _vector$9.dot(this.direction), i = _vector$9.dot(_vector$9) - s * s, r = t.radius * t.radius;
1316
+ _vector$a.subVectors(t.center, this.origin);
1317
+ const s = _vector$a.dot(this.direction), i = _vector$a.dot(_vector$a) - s * s, r = t.radius * t.radius;
1305
1318
  if (i > r)
1306
1319
  return null;
1307
1320
  const a = Math.sqrt(r - i), n = s - a, o = s + a;
1308
1321
  return o < 0 ? null : n < 0 ? this.at(o, e) : this.at(n, e);
1309
1322
  }
1310
1323
  intersectsSphere(t) {
1311
- return this.distanceSqToPoint(t.center) <= t.radius * t.radius;
1324
+ return !(t.radius < 0) && this.distanceSqToPoint(t.center) <= t.radius * t.radius;
1312
1325
  }
1313
1326
  distanceToPlane(t) {
1314
1327
  const e = t.normal.dot(this.direction);
@@ -1333,7 +1346,7 @@ class Ray {
1333
1346
  return h >= 0 ? (s = (t.min.x - u.x) * h, i = (t.max.x - u.x) * h) : (s = (t.max.x - u.x) * h, i = (t.min.x - u.x) * h), c >= 0 ? (r = (t.min.y - u.y) * c, a = (t.max.y - u.y) * c) : (r = (t.max.y - u.y) * c, a = (t.min.y - u.y) * c), s > a || r > i ? null : ((r > s || isNaN(s)) && (s = r), (a < i || isNaN(i)) && (i = a), l >= 0 ? (n = (t.min.z - u.z) * l, o = (t.max.z - u.z) * l) : (n = (t.max.z - u.z) * l, o = (t.min.z - u.z) * l), s > o || n > i ? null : ((n > s || s != s) && (s = n), (o < i || i != i) && (i = o), i < 0 ? null : this.at(s >= 0 ? s : i, e)));
1334
1347
  }
1335
1348
  intersectsBox(t) {
1336
- return null !== this.intersectBox(t, _vector$9);
1349
+ return null !== this.intersectBox(t, _vector$a);
1337
1350
  }
1338
1351
  intersectTriangle(t, e, s, i, r) {
1339
1352
  _edge1.subVectors(e, t), _edge2.subVectors(s, t), _normal$1.crossVectors(_edge1, _edge2);
@@ -1370,12 +1383,12 @@ class Ray {
1370
1383
  }
1371
1384
  }
1372
1385
  class Matrix4 {
1373
- constructor(t, e, s, i, r, a, n, o, h, c, l, u, d, _, m, f) {
1374
- Matrix4.prototype.isMatrix4 = true, this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], void 0 !== t && this.set(t, e, s, i, r, a, n, o, h, c, l, u, d, _, m, f);
1386
+ constructor(t, e, s, i, r, a, n, o, h, c, l, u, d, _, m, p) {
1387
+ Matrix4.prototype.isMatrix4 = true, this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], void 0 !== t && this.set(t, e, s, i, r, a, n, o, h, c, l, u, d, _, m, p);
1375
1388
  }
1376
- set(t, e, s, i, r, a, n, o, h, c, l, u, d, _, m, f) {
1377
- const p = this.elements;
1378
- return p[0] = t, p[4] = e, p[8] = s, p[12] = i, p[1] = r, p[5] = a, p[9] = n, p[13] = o, p[2] = h, p[6] = c, p[10] = l, p[14] = u, p[3] = d, p[7] = _, p[11] = m, p[15] = f, this;
1389
+ set(t, e, s, i, r, a, n, o, h, c, l, u, d, _, m, p) {
1390
+ const f = this.elements;
1391
+ return f[0] = t, f[4] = e, f[8] = s, f[12] = i, f[1] = r, f[5] = a, f[9] = n, f[13] = o, f[2] = h, f[6] = c, f[10] = l, f[14] = u, f[3] = d, f[7] = _, f[11] = m, f[15] = p, this;
1379
1392
  }
1380
1393
  identity() {
1381
1394
  return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;
@@ -1442,8 +1455,8 @@ class Matrix4 {
1442
1455
  return this.multiplyMatrices(t, this);
1443
1456
  }
1444
1457
  multiplyMatrices(t, e) {
1445
- const s = t.elements, i = e.elements, r = this.elements, a = s[0], n = s[4], o = s[8], h = s[12], c = s[1], l = s[5], u = s[9], d = s[13], _ = s[2], m = s[6], f = s[10], p = s[14], y = s[3], g = s[7], M = s[11], x = s[15], w = i[0], S = i[4], C = i[8], E = i[12], P = i[1], b = i[5], v = i[9], A2 = i[13], T = i[2], I = i[6], z = i[10], O = i[14], N = i[3], G = i[7], R = i[11], L = i[15];
1446
- return r[0] = a * w + n * P + o * T + h * N, r[4] = a * S + n * b + o * I + h * G, r[8] = a * C + n * v + o * z + h * R, r[12] = a * E + n * A2 + o * O + h * L, r[1] = c * w + l * P + u * T + d * N, r[5] = c * S + l * b + u * I + d * G, r[9] = c * C + l * v + u * z + d * R, r[13] = c * E + l * A2 + u * O + d * L, r[2] = _ * w + m * P + f * T + p * N, r[6] = _ * S + m * b + f * I + p * G, r[10] = _ * C + m * v + f * z + p * R, r[14] = _ * E + m * A2 + f * O + p * L, r[3] = y * w + g * P + M * T + x * N, r[7] = y * S + g * b + M * I + x * G, r[11] = y * C + g * v + M * z + x * R, r[15] = y * E + g * A2 + M * O + x * L, this;
1458
+ const s = t.elements, i = e.elements, r = this.elements, a = s[0], n = s[4], o = s[8], h = s[12], c = s[1], l = s[5], u = s[9], d = s[13], _ = s[2], m = s[6], p = s[10], f = s[14], y = s[3], g = s[7], M = s[11], x = s[15], w = i[0], S = i[4], C = i[8], E = i[12], P = i[1], b = i[5], v = i[9], A2 = i[13], T = i[2], I = i[6], z = i[10], O = i[14], N = i[3], G = i[7], R = i[11], L = i[15];
1459
+ return r[0] = a * w + n * P + o * T + h * N, r[4] = a * S + n * b + o * I + h * G, r[8] = a * C + n * v + o * z + h * R, r[12] = a * E + n * A2 + o * O + h * L, r[1] = c * w + l * P + u * T + d * N, r[5] = c * S + l * b + u * I + d * G, r[9] = c * C + l * v + u * z + d * R, r[13] = c * E + l * A2 + u * O + d * L, r[2] = _ * w + m * P + p * T + f * N, r[6] = _ * S + m * b + p * I + f * G, r[10] = _ * C + m * v + p * z + f * R, r[14] = _ * E + m * A2 + p * O + f * L, r[3] = y * w + g * P + M * T + x * N, r[7] = y * S + g * b + M * I + x * G, r[11] = y * C + g * v + M * z + x * R, r[15] = y * E + g * A2 + M * O + x * L, this;
1447
1460
  }
1448
1461
  multiplyScalar(t) {
1449
1462
  const e = this.elements;
@@ -1463,11 +1476,11 @@ class Matrix4 {
1463
1476
  return t.isVector3 ? (i[12] = t.x, i[13] = t.y, i[14] = t.z) : (i[12] = t, i[13] = e, i[14] = s), this;
1464
1477
  }
1465
1478
  invert() {
1466
- const t = this.elements, e = t[0], s = t[1], i = t[2], r = t[3], a = t[4], n = t[5], o = t[6], h = t[7], c = t[8], l = t[9], u = t[10], d = t[11], _ = t[12], m = t[13], f = t[14], p = t[15], y = l * f * h - m * u * h + m * o * d - n * f * d - l * o * p + n * u * p, g = _ * u * h - c * f * h - _ * o * d + a * f * d + c * o * p - a * u * p, M = c * m * h - _ * l * h + _ * n * d - a * m * d - c * n * p + a * l * p, x = _ * l * o - c * m * o - _ * n * u + a * m * u + c * n * f - a * l * f, w = e * y + s * g + i * M + r * x;
1479
+ const t = this.elements, e = t[0], s = t[1], i = t[2], r = t[3], a = t[4], n = t[5], o = t[6], h = t[7], c = t[8], l = t[9], u = t[10], d = t[11], _ = t[12], m = t[13], p = t[14], f = t[15], y = l * p * h - m * u * h + m * o * d - n * p * d - l * o * f + n * u * f, g = _ * u * h - c * p * h - _ * o * d + a * p * d + c * o * f - a * u * f, M = c * m * h - _ * l * h + _ * n * d - a * m * d - c * n * f + a * l * f, x = _ * l * o - c * m * o - _ * n * u + a * m * u + c * n * p - a * l * p, w = e * y + s * g + i * M + r * x;
1467
1480
  if (0 === w)
1468
1481
  return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
1469
1482
  const S = 1 / w;
1470
- return t[0] = y * S, t[1] = (m * u * r - l * f * r - m * i * d + s * f * d + l * i * p - s * u * p) * S, t[2] = (n * f * r - m * o * r + m * i * h - s * f * h - n * i * p + s * o * p) * S, t[3] = (l * o * r - n * u * r - l * i * h + s * u * h + n * i * d - s * o * d) * S, t[4] = g * S, t[5] = (c * f * r - _ * u * r + _ * i * d - e * f * d - c * i * p + e * u * p) * S, t[6] = (_ * o * r - a * f * r - _ * i * h + e * f * h + a * i * p - e * o * p) * S, t[7] = (a * u * r - c * o * r + c * i * h - e * u * h - a * i * d + e * o * d) * S, t[8] = M * S, t[9] = (_ * l * r - c * m * r - _ * s * d + e * m * d + c * s * p - e * l * p) * S, t[10] = (a * m * r - _ * n * r + _ * s * h - e * m * h - a * s * p + e * n * p) * S, t[11] = (c * n * r - a * l * r - c * s * h + e * l * h + a * s * d - e * n * d) * S, t[12] = x * S, t[13] = (c * m * i - _ * l * i + _ * s * u - e * m * u - c * s * f + e * l * f) * S, t[14] = (_ * n * i - a * m * i - _ * s * o + e * m * o + a * s * f - e * n * f) * S, t[15] = (a * l * i - c * n * i + c * s * o - e * l * o - a * s * u + e * n * u) * S, this;
1483
+ return t[0] = y * S, t[1] = (m * u * r - l * p * r - m * i * d + s * p * d + l * i * f - s * u * f) * S, t[2] = (n * p * r - m * o * r + m * i * h - s * p * h - n * i * f + s * o * f) * S, t[3] = (l * o * r - n * u * r - l * i * h + s * u * h + n * i * d - s * o * d) * S, t[4] = g * S, t[5] = (c * p * r - _ * u * r + _ * i * d - e * p * d - c * i * f + e * u * f) * S, t[6] = (_ * o * r - a * p * r - _ * i * h + e * p * h + a * i * f - e * o * f) * S, t[7] = (a * u * r - c * o * r + c * i * h - e * u * h - a * i * d + e * o * d) * S, t[8] = M * S, t[9] = (_ * l * r - c * m * r - _ * s * d + e * m * d + c * s * f - e * l * f) * S, t[10] = (a * m * r - _ * n * r + _ * s * h - e * m * h - a * s * f + e * n * f) * S, t[11] = (c * n * r - a * l * r - c * s * h + e * l * h + a * s * d - e * n * d) * S, t[12] = x * S, t[13] = (c * m * i - _ * l * i + _ * s * u - e * m * u - c * s * p + e * l * p) * S, t[14] = (_ * n * i - a * m * i - _ * s * o + e * m * o + a * s * p - e * n * p) * S, t[15] = (a * l * i - c * n * i + c * s * o - e * l * o - a * s * u + e * n * u) * S, this;
1471
1484
  }
1472
1485
  scale(t) {
1473
1486
  const e = this.elements, s = t.x, i = t.y, r = t.z;
@@ -1503,8 +1516,8 @@ class Matrix4 {
1503
1516
  return this.set(1, s, r, 0, t, 1, a, 0, e, i, 1, 0, 0, 0, 0, 1), this;
1504
1517
  }
1505
1518
  compose(t, e, s) {
1506
- const i = this.elements, r = e._x, a = e._y, n = e._z, o = e._w, h = r + r, c = a + a, l = n + n, u = r * h, d = r * c, _ = r * l, m = a * c, f = a * l, p = n * l, y = o * h, g = o * c, M = o * l, x = s.x, w = s.y, S = s.z;
1507
- return i[0] = (1 - (m + p)) * x, i[1] = (d + M) * x, i[2] = (_ - g) * x, i[3] = 0, i[4] = (d - M) * w, i[5] = (1 - (u + p)) * w, i[6] = (f + y) * w, i[7] = 0, i[8] = (_ + g) * S, i[9] = (f - y) * S, i[10] = (1 - (u + m)) * S, i[11] = 0, i[12] = t.x, i[13] = t.y, i[14] = t.z, i[15] = 1, this;
1519
+ const i = this.elements, r = e._x, a = e._y, n = e._z, o = e._w, h = r + r, c = a + a, l = n + n, u = r * h, d = r * c, _ = r * l, m = a * c, p = a * l, f = n * l, y = o * h, g = o * c, M = o * l, x = s.x, w = s.y, S = s.z;
1520
+ return i[0] = (1 - (m + f)) * x, i[1] = (d + M) * x, i[2] = (_ - g) * x, i[3] = 0, i[4] = (d - M) * w, i[5] = (1 - (u + f)) * w, i[6] = (p + y) * w, i[7] = 0, i[8] = (_ + g) * S, i[9] = (p - y) * S, i[10] = (1 - (u + m)) * S, i[11] = 0, i[12] = t.x, i[13] = t.y, i[14] = t.z, i[15] = 1, this;
1508
1521
  }
1509
1522
  decompose(t, e, s) {
1510
1523
  const i = this.elements;
@@ -1514,29 +1527,33 @@ class Matrix4 {
1514
1527
  const o = 1 / r, h = 1 / a, c = 1 / n;
1515
1528
  return _m1$2.elements[0] *= o, _m1$2.elements[1] *= o, _m1$2.elements[2] *= o, _m1$2.elements[4] *= h, _m1$2.elements[5] *= h, _m1$2.elements[6] *= h, _m1$2.elements[8] *= c, _m1$2.elements[9] *= c, _m1$2.elements[10] *= c, e.setFromRotationMatrix(_m1$2), s.x = r, s.y = a, s.z = n, this;
1516
1529
  }
1517
- makePerspective(t, e, s, i, r, a, n = WebGLCoordinateSystem) {
1518
- const o = this.elements, h = 2 * r / (e - t), c = 2 * r / (s - i), l = (e + t) / (e - t), u = (s + i) / (s - i);
1519
- let d, _;
1520
- if (n === WebGLCoordinateSystem)
1521
- d = -(a + r) / (a - r), _ = -2 * a * r / (a - r);
1530
+ makePerspective(t, e, s, i, r, a, n = WebGLCoordinateSystem, o = false) {
1531
+ const h = this.elements, c = 2 * r / (e - t), l = 2 * r / (s - i), u = (e + t) / (e - t), d = (s + i) / (s - i);
1532
+ let _, m;
1533
+ if (o)
1534
+ _ = r / (a - r), m = a * r / (a - r);
1535
+ else if (n === WebGLCoordinateSystem)
1536
+ _ = -(a + r) / (a - r), m = -2 * a * r / (a - r);
1522
1537
  else {
1523
1538
  if (n !== WebGPUCoordinateSystem)
1524
1539
  throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: " + n);
1525
- d = -a / (a - r), _ = -a * r / (a - r);
1540
+ _ = -a / (a - r), m = -a * r / (a - r);
1526
1541
  }
1527
- return o[0] = h, o[4] = 0, o[8] = l, o[12] = 0, o[1] = 0, o[5] = c, o[9] = u, o[13] = 0, o[2] = 0, o[6] = 0, o[10] = d, o[14] = _, o[3] = 0, o[7] = 0, o[11] = -1, o[15] = 0, this;
1542
+ return h[0] = c, h[4] = 0, h[8] = u, h[12] = 0, h[1] = 0, h[5] = l, h[9] = d, h[13] = 0, h[2] = 0, h[6] = 0, h[10] = _, h[14] = m, h[3] = 0, h[7] = 0, h[11] = -1, h[15] = 0, this;
1528
1543
  }
1529
- makeOrthographic(t, e, s, i, r, a, n = WebGLCoordinateSystem) {
1530
- const o = this.elements, h = 1 / (e - t), c = 1 / (s - i), l = 1 / (a - r), u = (e + t) * h, d = (s + i) * c;
1544
+ makeOrthographic(t, e, s, i, r, a, n = WebGLCoordinateSystem, o = false) {
1545
+ const h = this.elements, c = 2 / (e - t), l = 2 / (s - i), u = -(e + t) / (e - t), d = -(s + i) / (s - i);
1531
1546
  let _, m;
1532
- if (n === WebGLCoordinateSystem)
1533
- _ = (a + r) * l, m = -2 * l;
1547
+ if (o)
1548
+ _ = 1 / (a - r), m = a / (a - r);
1549
+ else if (n === WebGLCoordinateSystem)
1550
+ _ = -2 / (a - r), m = -(a + r) / (a - r);
1534
1551
  else {
1535
1552
  if (n !== WebGPUCoordinateSystem)
1536
1553
  throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: " + n);
1537
- _ = r * l, m = -1 * l;
1554
+ _ = -1 / (a - r), m = -r / (a - r);
1538
1555
  }
1539
- return o[0] = 2 * h, o[4] = 0, o[8] = 0, o[12] = -u, o[1] = 0, o[5] = 2 * c, o[9] = 0, o[13] = -d, o[2] = 0, o[6] = 0, o[10] = m, o[14] = -_, o[3] = 0, o[7] = 0, o[11] = 0, o[15] = 1, this;
1556
+ return h[0] = c, h[4] = 0, h[8] = 0, h[12] = u, h[1] = 0, h[5] = l, h[9] = 0, h[13] = d, h[2] = 0, h[6] = 0, h[10] = _, h[14] = m, h[3] = 0, h[7] = 0, h[11] = 0, h[15] = 1, this;
1540
1557
  }
1541
1558
  equals(t) {
1542
1559
  const e = this.elements, s = t.elements;
@@ -1690,7 +1707,7 @@ class Quaternion {
1690
1707
  copy(t) {
1691
1708
  return this._x = t.x, this._y = t.y, this._z = t.z, this._w = t.w, this._onChangeCallback(), this;
1692
1709
  }
1693
- setFromEuler(t, e) {
1710
+ setFromEuler(t, e = true) {
1694
1711
  const s = t._x, i = t._y, r = t._z, a = t._order, n = Math.cos, o = Math.sin, h = n(s / 2), c = n(i / 2), l = n(r / 2), u = o(s / 2), d = o(i / 2), _ = o(r / 2);
1695
1712
  switch (a) {
1696
1713
  case "XYZ":
@@ -1714,7 +1731,7 @@ class Quaternion {
1714
1731
  default:
1715
1732
  console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + a);
1716
1733
  }
1717
- return false !== e && this._onChangeCallback(), this;
1734
+ return true === e && this._onChangeCallback(), this;
1718
1735
  }
1719
1736
  setFromAxisAngle(t, e) {
1720
1737
  const s = e / 2, i = Math.sin(s);
@@ -1739,7 +1756,7 @@ class Quaternion {
1739
1756
  }
1740
1757
  setFromUnitVectors(t, e) {
1741
1758
  let s = t.dot(e) + 1;
1742
- return s < Number.EPSILON ? (s = 0, Math.abs(t.x) > Math.abs(t.z) ? (this._x = -t.y, this._y = t.x, this._z = 0, this._w = s) : (this._x = 0, this._y = -t.z, this._z = t.y, this._w = s)) : (this._x = t.y * e.z - t.z * e.y, this._y = t.z * e.x - t.x * e.z, this._z = t.x * e.y - t.y * e.x, this._w = s), this.normalize();
1759
+ return s < 1e-8 ? (s = 0, Math.abs(t.x) > Math.abs(t.z) ? (this._x = -t.y, this._y = t.x, this._z = 0, this._w = s) : (this._x = 0, this._y = -t.z, this._z = t.y, this._w = s)) : (this._x = t.y * e.z - t.z * e.y, this._y = t.z * e.x - t.x * e.z, this._z = t.x * e.y - t.y * e.x, this._w = s), this.normalize();
1743
1760
  }
1744
1761
  angleTo(t) {
1745
1762
  return 2 * Math.acos(Math.abs(clamp$1(this.dot(t), -1, 1)));
@@ -1795,7 +1812,7 @@ class Quaternion {
1795
1812
  const o = 1 - n * n;
1796
1813
  if (o <= Number.EPSILON) {
1797
1814
  const t2 = 1 - e;
1798
- return this._w = t2 * a + e * this._w, this._x = t2 * s + e * this._x, this._y = t2 * i + e * this._y, this._z = t2 * r + e * this._z, this.normalize(), this._onChangeCallback(), this;
1815
+ return this._w = t2 * a + e * this._w, this._x = t2 * s + e * this._x, this._y = t2 * i + e * this._y, this._z = t2 * r + e * this._z, this.normalize(), this;
1799
1816
  }
1800
1817
  const h = Math.sqrt(o), c = Math.atan2(h, n), l = Math.sin((1 - e) * c) / h, u = Math.sin(e * c) / h;
1801
1818
  return this._w = a * l + this._w * u, this._x = s * l + this._x * u, this._y = i * l + this._y * u, this._z = r * l + this._z * u, this._onChangeCallback(), this;
@@ -1804,8 +1821,8 @@ class Quaternion {
1804
1821
  return this.copy(t).slerp(e, s);
1805
1822
  }
1806
1823
  random() {
1807
- const t = Math.random(), e = Math.sqrt(1 - t), s = Math.sqrt(t), i = 2 * Math.PI * Math.random(), r = 2 * Math.PI * Math.random();
1808
- return this.set(e * Math.cos(i), s * Math.sin(r), s * Math.cos(r), e * Math.sin(i));
1824
+ const t = 2 * Math.PI * Math.random(), e = 2 * Math.PI * Math.random(), s = Math.random(), i = Math.sqrt(1 - s), r = Math.sqrt(s);
1825
+ return this.set(i * Math.sin(t), i * Math.cos(t), r * Math.sin(e), r * Math.cos(e));
1809
1826
  }
1810
1827
  equals(t) {
1811
1828
  return t._x === this._x && t._y === this._y && t._z === this._z && t._w === this._w;
@@ -1817,7 +1834,7 @@ class Quaternion {
1817
1834
  return t[e] = this._x, t[e + 1] = this._y, t[e + 2] = this._z, t[e + 3] = this._w, t;
1818
1835
  }
1819
1836
  fromBufferAttribute(t, e) {
1820
- return this._x = t.getX(e), this._y = t.getY(e), this._z = t.getZ(e), this._w = t.getW(e), this;
1837
+ return this._x = t.getX(e), this._y = t.getY(e), this._z = t.getZ(e), this._w = t.getW(e), this._onChangeCallback(), this;
1821
1838
  }
1822
1839
  toJSON() {
1823
1840
  return this.toArray();
@@ -1958,14 +1975,14 @@ class Vector3 {
1958
1975
  return this.x = Math.max(this.x, t.x), this.y = Math.max(this.y, t.y), this.z = Math.max(this.z, t.z), this;
1959
1976
  }
1960
1977
  clamp(t, e) {
1961
- return this.x = Math.max(t.x, Math.min(e.x, this.x)), this.y = Math.max(t.y, Math.min(e.y, this.y)), this.z = Math.max(t.z, Math.min(e.z, this.z)), this;
1978
+ return this.x = clamp$1(this.x, t.x, e.x), this.y = clamp$1(this.y, t.y, e.y), this.z = clamp$1(this.z, t.z, e.z), this;
1962
1979
  }
1963
1980
  clampScalar(t, e) {
1964
- return this.x = Math.max(t, Math.min(e, this.x)), this.y = Math.max(t, Math.min(e, this.y)), this.z = Math.max(t, Math.min(e, this.z)), this;
1981
+ return this.x = clamp$1(this.x, t, e), this.y = clamp$1(this.y, t, e), this.z = clamp$1(this.z, t, e), this;
1965
1982
  }
1966
1983
  clampLength(t, e) {
1967
1984
  const s = this.length();
1968
- return this.divideScalar(s || 1).multiplyScalar(Math.max(t, Math.min(e, s)));
1985
+ return this.divideScalar(s || 1).multiplyScalar(clamp$1(s, t, e));
1969
1986
  }
1970
1987
  floor() {
1971
1988
  return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this;
@@ -2092,8 +2109,8 @@ class Vector3 {
2092
2109
  return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;
2093
2110
  }
2094
2111
  randomDirection() {
2095
- const t = 2 * (Math.random() - 0.5), e = Math.random() * Math.PI * 2, s = Math.sqrt(1 - t ** 2);
2096
- return this.x = s * Math.cos(e), this.y = s * Math.sin(e), this.z = t, this;
2112
+ const t = Math.random() * Math.PI * 2, e = 2 * Math.random() - 1, s = Math.sqrt(1 - e * e);
2113
+ return this.x = s * Math.cos(t), this.y = e, this.z = s * Math.sin(t), this;
2097
2114
  }
2098
2115
  *[Symbol.iterator]() {
2099
2116
  yield this.x, yield this.y, yield this.z;
@@ -2213,30 +2230,41 @@ function isAOConcaveAngle(t, e, s) {
2213
2230
  return (i[0] * r[0] + i[1] * r[1]) / Math.sqrt((i[0] * i[0] + i[1] * i[1]) * (r[0] * r[0] + r[1] * r[1])) > -0.866 && -i[1] * r[0] + i[0] * r[1] < 0;
2214
2231
  }
2215
2232
  new Vector3(), new Vector3(), new Vector3(), new Vector3(), new Vector3(), new Vector3(), new Vector3(), new Vector3(), new Vector3(), new Vector3();
2216
- const _centerIn = new Vector3$1(), _lastPosition = new Vector3$1(), _currentPosition = new Vector3$1(), _lineNormal = new Vector3$1(), _offset = new Vector3$1(), _segmentLines3D = (t, e, s, i, r, a, n, o, h, c, l, u, d, _) => {
2217
- const m = d.targetCenter, f = d.targetProjection, { sourceProjectionName: p, targetProjectionName: y } = d;
2218
- let g = 0;
2219
- _centerIn.fromArray(m), _lastPosition.fromArray(n), _currentPosition.fromArray(o);
2220
- let M = u.value;
2221
- r.push(M, M), a.push(M, 1, M, 0);
2222
- const x = f.getProjectedSurfaceNormal(_lastPosition, _lineNormal), w = _offset.copy(_currentPosition).sub(_lastPosition), S = _lineNormal.crossVectors(x, w).normalize();
2223
- return p !== y && (_lastPosition.sub(_centerIn), _currentPosition.sub(_centerIn)), s.push(S.x, S.y, S.z, -S.x, -S.y, -S.z), t.push(_lastPosition.x, _lastPosition.y, _lastPosition.z, _lastPosition.x, _lastPosition.y, _lastPosition.z), e.push(h, h), g += 2, l || (i.push(c + 0 - 2, c + 1 - 2, c + 2 - 2), i.push(c + 2 - 2, c + 1 - 2, c + 3 - 2)), i.push(c, c + 1, c + 2), s.push(S.x, S.y, S.z, -S.x, -S.y, -S.z), t.push(_currentPosition.x, _currentPosition.y, _currentPosition.z, _currentPosition.x, _currentPosition.y, _currentPosition.z), e.push(h, h), M += getDistance(n, o) / _, r.push(M, M), a.push(M, 1, M, 0), u.value = M, g += 2, i.push(c + 2, c + 1, c + 3), 4;
2233
+ const _centerIn = new Vector3$1(), _lastPosition = new Vector3$1(), _currentPosition = new Vector3$1(), _lineNormal = new Vector3$1(), _offset = new Vector3$1(), _segmentLines3D = (t, e, s, i, r, a, n, o, h, c, l, u, d, _, m, p) => {
2234
+ const f = d.targetCenter, y = d.targetProjection, { sourceProjectionName: g, targetProjectionName: M } = d;
2235
+ let x = 0;
2236
+ _centerIn.fromArray(f), _lastPosition.fromArray(n), _currentPosition.fromArray(o);
2237
+ let w = u.value;
2238
+ r.push(w, w), a.push(w, 1, w, 0);
2239
+ const S = y.getProjectedSurfaceNormal(_lastPosition, _lineNormal), C = _offset.copy(_currentPosition).sub(_lastPosition), E = _lineNormal.crossVectors(S, C).normalize();
2240
+ g !== M && (_lastPosition.sub(_centerIn), _currentPosition.sub(_centerIn)), s.push(E.x, E.y, E.z, -E.x, -E.y, -E.z), t.push(_lastPosition.x, _lastPosition.y, _lastPosition.z, _lastPosition.x, _lastPosition.y, _lastPosition.z), e.push(h, h), x += 2, l || (i.push(c + 0 - 2, c + 1 - 2, c + 2 - 2), i.push(c + 2 - 2, c + 1 - 2, c + 3 - 2)), i.push(c, c + 1, c + 2), s.push(E.x, E.y, E.z, -E.x, -E.y, -E.z), t.push(_currentPosition.x, _currentPosition.y, _currentPosition.z, _currentPosition.x, _currentPosition.y, _currentPosition.z), e.push(h, h);
2241
+ return w += (m && p ? getDistance(m, p) : getDistance(n, o)) / _, r.push(w, w), a.push(w, 1, w, 0), u.value = w, x += 2, i.push(c + 2, c + 1, c + 3), 4;
2224
2242
  };
2225
- function lineToMesh(t, e, s, i, r = 1) {
2226
- let a = 0, n = null, o = null, h = null, c = null;
2227
- const l = [], u = [], d = [], _ = [], m = [], f = [];
2228
- let p;
2229
- const y = { value: 0 };
2230
- let g = true;
2231
- for (let i2 = 1, p2 = t.length - 1; i2 <= p2; i2++) {
2232
- if (n = c || t[i2 - 1], o = t[i2], h = t[i2 + 1], h && isPointEqual(o, h)) {
2233
- c = n;
2243
+ function lineToMesh(t, e, s, i, r = 1, a) {
2244
+ let n = t;
2245
+ if (!Array.isArray(t[0])) {
2246
+ n = [];
2247
+ for (let e2 = 0; e2 < t.length; e2 += 3)
2248
+ n.push([t[e2], t[e2 + 1], t[e2 + 2]]);
2249
+ }
2250
+ let o = 0, h = null, c = null, l = null;
2251
+ const u = [], d = [], _ = [], m = [], p = [], f = [];
2252
+ let y;
2253
+ const g = { value: 0 }, M = a || n;
2254
+ let x = true;
2255
+ for (let t2 = 1, i2 = n.length - 1; t2 <= i2; t2++) {
2256
+ h = l || n[t2 - 1], c = n[t2];
2257
+ const i3 = l ? a ? a[n.indexOf(l)] : l : M[t2 - 1], y2 = M[t2], w = M[t2 + 1];
2258
+ if (w && isPointEqual(y2, w)) {
2259
+ l = h;
2234
2260
  continue;
2235
2261
  }
2236
- let p3 = 0;
2237
- p3 = _segmentLines3D(l, _, u, d, m, f, n, o, e, a, g, y, s, r), -1 !== p3 && (a += p3, c = null), g = false;
2262
+ let S = 0;
2263
+ S = _segmentLines3D(u, m, d, _, p, f, h, c, e, o, x, g, s, r, i3, y2), -1 !== S && (o += S, l = null), x = false;
2238
2264
  }
2239
- return i && (p = new Array(m.length).fill(y.value)), { vertices: l, indices: d, normals: u, widths: _, lengths: m, totalLengths: p, uvs: f };
2265
+ for (let t2 = 0; t2 < f.length; t2++)
2266
+ t2 % 2 == 0 && (f[t2] = g.value - f[t2]);
2267
+ return i && (y = new Array(p.length).fill(g.value)), { vertices: u, indices: _, normals: d, widths: m, lengths: p, totalLengths: y, uvs: f };
2240
2268
  }
2241
2269
  function fillFlatArray(t, e, s) {
2242
2270
  s || (s = e.length);
@@ -2251,11 +2279,14 @@ function reFetch(t = "", e = {}, s = 3) {
2251
2279
  return s--, fetch(e2, i).then((t3) => {
2252
2280
  if (200 === t3.status)
2253
2281
  return t3;
2282
+ if (404 === t3.status)
2283
+ throw new Error("404");
2254
2284
  }).catch((r) => {
2255
2285
  if (i.signal && "AbortError" === r.name)
2256
2286
  throw r;
2257
2287
  if (s > 0)
2258
2288
  return t2(e2, i);
2289
+ throw r;
2259
2290
  });
2260
2291
  }(t, e);
2261
2292
  }
@@ -2666,12 +2697,12 @@ Rectangle.fromBox = function(t, e, s = false) {
2666
2697
  }, Rectangle.MAX_VALUE = Object.freeze(new Rectangle(-Math.PI, -CesiumMath.PI_OVER_TWO, Math.PI, CesiumMath.PI_OVER_TWO));
2667
2698
  const scaleToGeodeticSurfaceIntersection = new Vector3$1(), scaleToGeodeticSurfaceGradient = new Vector3$1();
2668
2699
  function scaleToGeodeticSurface(t, e, s, i, r) {
2669
- const a = t.x, n = t.y, o = t.z, h = e.x, c = e.y, l = e.z, u = a * a * h * h, d = n * n * c * c, _ = o * o * l * l, m = u + d + _, f = Math.sqrt(1 / m), p = scaleToGeodeticSurfaceIntersection.copy(t).multiplyScalar(f);
2700
+ const a = t.x, n = t.y, o = t.z, h = e.x, c = e.y, l = e.z, u = a * a * h * h, d = n * n * c * c, _ = o * o * l * l, m = u + d + _, p = Math.sqrt(1 / m), f = scaleToGeodeticSurfaceIntersection.copy(t).multiplyScalar(p);
2670
2701
  if (m < i)
2671
- return r || (r = new Vector3$1()), isFinite(f) ? r.copy(p) : void 0;
2702
+ return r || (r = new Vector3$1()), isFinite(p) ? r.copy(f) : void 0;
2672
2703
  const y = s.x, g = s.y, M = s.z, x = scaleToGeodeticSurfaceGradient;
2673
- x.x = p.x * y * 2, x.y = p.y * g * 2, x.z = p.z * M * 2;
2674
- let w, S, C, E, P, b, v, A2, T, I, z, O = (1 - f) * t.length() / (0.5 * x.length()), N = 0;
2704
+ x.x = f.x * y * 2, x.y = f.y * g * 2, x.z = f.z * M * 2;
2705
+ let w, S, C, E, P, b, v, A2, T, I, z, O = (1 - p) * t.length() / (0.5 * x.length()), N = 0;
2675
2706
  do {
2676
2707
  O -= N, C = 1 / (1 + O * y), E = 1 / (1 + O * g), P = 1 / (1 + O * M), b = C * C, v = E * E, A2 = P * P, T = b * C, I = v * E, z = A2 * P, w = u * b + d * v + _ * A2 - 1, S = u * T * y + d * I * g + _ * z * M, N = w / (-2 * S);
2677
2708
  } while (Math.abs(w) > 1e-12);
@@ -2832,8 +2863,8 @@ class StaticMatrix4 {
2832
2863
  defined$1(i) || (i = new Matrix4()), t = defaultValue(t, defaultValue.EMPTY_OBJECT);
2833
2864
  const r = defaultValue(t.x, 0), a = defaultValue(t.y, 0), n = defaultValue(t.width, 0), o = defaultValue(t.height, 0);
2834
2865
  e = defaultValue(e, 0);
2835
- const h = 0.5 * n, c = 0.5 * o, l = 0.5 * ((s = defaultValue(s, 1)) - e), u = h, d = c, _ = l, m = r + h, f = a + c, p = e + l, y = i.elements;
2836
- return y[0] = u, y[1] = 0, y[2] = 0, y[3] = 0, y[4] = 0, y[5] = d, y[6] = 0, y[7] = 0, y[8] = 0, y[9] = 0, y[10] = _, y[11] = 0, y[12] = m, y[13] = f, y[14] = p, y[15] = 1, i;
2866
+ const h = 0.5 * n, c = 0.5 * o, l = 0.5 * ((s = defaultValue(s, 1)) - e), u = h, d = c, _ = l, m = r + h, p = a + c, f = e + l, y = i.elements;
2867
+ return y[0] = u, y[1] = 0, y[2] = 0, y[3] = 0, y[4] = 0, y[5] = d, y[6] = 0, y[7] = 0, y[8] = 0, y[9] = 0, y[10] = _, y[11] = 0, y[12] = m, y[13] = p, y[14] = f, y[15] = 1, i;
2837
2868
  }
2838
2869
  static equals(t, e) {
2839
2870
  return t.equals(e);
@@ -2847,7 +2878,7 @@ class StaticMatrix4 {
2847
2878
  }
2848
2879
  static fromTranslationQuaternionRotationScale(t, e, s, i) {
2849
2880
  i || (i = new Matrix4());
2850
- const r = s.x, a = s.y, n = s.z, o = e.x * e.x, h = e.x * e.y, c = e.x * e.z, l = e.x * e.w, u = e.y * e.y, d = e.y * e.z, _ = e.y * e.w, m = e.z * e.z, f = e.z * e.w, p = e.w * e.w, y = o - u - m + p, g = 2 * (h - f), M = 2 * (c + _), x = 2 * (h + f), w = -o + u - m + p, S = 2 * (d - l), C = 2 * (c - _), E = 2 * (d + l), P = -o - u + m + p, b = i.elements;
2881
+ const r = s.x, a = s.y, n = s.z, o = e.x * e.x, h = e.x * e.y, c = e.x * e.z, l = e.x * e.w, u = e.y * e.y, d = e.y * e.z, _ = e.y * e.w, m = e.z * e.z, p = e.z * e.w, f = e.w * e.w, y = o - u - m + f, g = 2 * (h - p), M = 2 * (c + _), x = 2 * (h + p), w = -o + u - m + f, S = 2 * (d - l), C = 2 * (c - _), E = 2 * (d + l), P = -o - u + m + f, b = i.elements;
2851
2882
  return b[0] = y * r, b[1] = x * r, b[2] = C * r, b[3] = 0, b[4] = g * a, b[5] = w * a, b[6] = E * a, b[7] = 0, b[8] = M * n, b[9] = S * n, b[10] = P * n, b[11] = 0, b[12] = t.x, b[13] = t.y, b[14] = t.z, b[15] = 1, i;
2852
2883
  }
2853
2884
  }
@@ -2891,8 +2922,8 @@ Transforms.lnglatToEcef = lnglatToEcef, Transforms.radianToEcef = radianToEcef,
2891
2922
  }, Transforms.northEastDownToFixedFrame = Transforms.localFrameToFixedFrameGenerator("north", "east"), Transforms.northUpEastToFixedFrame = Transforms.localFrameToFixedFrameGenerator("north", "up"), Transforms.northWestUpToFixedFrame = Transforms.localFrameToFixedFrameGenerator("north", "west");
2892
2923
  class StaticMatrix3 {
2893
2924
  static fromQuaternion(t, e) {
2894
- const s = t.x * t.x, i = t.x * t.y, r = t.x * t.z, a = t.x * t.w, n = t.y * t.y, o = t.y * t.z, h = t.y * t.w, c = t.z * t.z, l = t.z * t.w, u = t.w * t.w, d = s - n - c + u, _ = 2 * (i - l), m = 2 * (r + h), f = 2 * (i + l), p = -s + n - c + u, y = 2 * (o - a), g = 2 * (r - h), M = 2 * (o + a), x = -s - n + c + u;
2895
- return e || (e = new Matrix3()), e.set(d, _, m, f, p, y, g, M, x), e;
2925
+ const s = t.x * t.x, i = t.x * t.y, r = t.x * t.z, a = t.x * t.w, n = t.y * t.y, o = t.y * t.z, h = t.y * t.w, c = t.z * t.z, l = t.z * t.w, u = t.w * t.w, d = s - n - c + u, _ = 2 * (i - l), m = 2 * (r + h), p = 2 * (i + l), f = -s + n - c + u, y = 2 * (o - a), g = 2 * (r - h), M = 2 * (o + a), x = -s - n + c + u;
2926
+ return e || (e = new Matrix3()), e.set(d, _, m, p, f, y, g, M, x), e;
2896
2927
  }
2897
2928
  static getColumn(t, e, s) {
2898
2929
  const i = t.elements, r = 3 * e, a = i[r], n = i[r + 1], o = i[r + 2];
@@ -2916,8 +2947,8 @@ class StaticMatrix3 {
2916
2947
  }
2917
2948
  static multiply(t, e, s) {
2918
2949
  s || (s = new Matrix3());
2919
- const i = t.elements, r = e.elements, a = s.elements, n = i[0], o = i[3], h = i[6], c = i[1], l = i[4], u = i[7], d = i[2], _ = i[5], m = i[8], f = r[0], p = r[3], y = r[6], g = r[1], M = r[4], x = r[7], w = r[2], S = r[5], C = r[8];
2920
- return a[0] = n * f + o * g + h * w, a[3] = n * p + o * M + h * S, a[6] = n * y + o * x + h * C, a[1] = c * f + l * g + u * w, a[4] = c * p + l * M + u * S, a[7] = c * y + l * x + u * C, a[2] = d * f + _ * g + m * w, a[5] = d * p + _ * M + m * S, a[8] = d * y + _ * x + m * C, s;
2950
+ const i = t.elements, r = e.elements, a = s.elements, n = i[0], o = i[3], h = i[6], c = i[1], l = i[4], u = i[7], d = i[2], _ = i[5], m = i[8], p = r[0], f = r[3], y = r[6], g = r[1], M = r[4], x = r[7], w = r[2], S = r[5], C = r[8];
2951
+ return a[0] = n * p + o * g + h * w, a[3] = n * f + o * M + h * S, a[6] = n * y + o * x + h * C, a[1] = c * p + l * g + u * w, a[4] = c * f + l * M + u * S, a[7] = c * y + l * x + u * C, a[2] = d * p + _ * g + m * w, a[5] = d * f + _ * M + m * S, a[8] = d * y + _ * x + m * C, s;
2921
2952
  }
2922
2953
  static clone(t, e) {
2923
2954
  if (defined$1(t))
@@ -2975,14 +3006,14 @@ QuadraticRealPolynomial.computeDiscriminant = function(t, e, s) {
2975
3006
  };
2976
3007
  var CubicRealPolynomial = {};
2977
3008
  function computeRealRoots(t, e, s, i) {
2978
- var r, a, n = t, o = e / 3, h = s / 3, c = i, l = n * h, u = o * c, d = o * o, _ = h * h, m = n * h - d, f = n * c - o * h, p = o * c - _, y = 4 * m * p - f * f;
3009
+ var r, a, n = t, o = e / 3, h = s / 3, c = i, l = n * h, u = o * c, d = o * o, _ = h * h, m = n * h - d, p = n * c - o * h, f = o * c - _, y = 4 * m * f - p * p;
2979
3010
  if (y < 0) {
2980
3011
  var g, M, x;
2981
- d * u >= l * _ ? (g = n, M = m, x = -2 * o * m + n * f) : (g = c, M = p, x = -c * f + 2 * h * p);
3012
+ d * u >= l * _ ? (g = n, M = m, x = -2 * o * m + n * p) : (g = c, M = f, x = -c * p + 2 * h * f);
2982
3013
  var w = -(x < 0 ? -1 : 1) * Math.abs(g) * Math.sqrt(-y), S = (a = -x + w) / 2, C = S < 0 ? -Math.pow(-S, 1 / 3) : Math.pow(S, 1 / 3), E = a === w ? -C : -M / C;
2983
3014
  return r = M <= 0 ? C + E : -x / (C * C + E * E + M), d * u >= l * _ ? [(r - o) / n] : [-c / (r + h)];
2984
3015
  }
2985
- var P = m, b = -2 * o * m + n * f, v = p, A2 = -c * f + 2 * h * p, T = Math.sqrt(y), I = Math.sqrt(3) / 2, z = Math.abs(Math.atan2(n * T, -b) / 3);
3016
+ var P = m, b = -2 * o * m + n * p, v = f, A2 = -c * p + 2 * h * f, T = Math.sqrt(y), I = Math.sqrt(3) / 2, z = Math.abs(Math.atan2(n * T, -b) / 3);
2986
3017
  r = 2 * Math.sqrt(-P);
2987
3018
  var O = Math.cos(z);
2988
3019
  a = r * O;
@@ -3035,8 +3066,8 @@ function original(t, e, s, i) {
3035
3066
  if (2 === u.length) {
3036
3067
  var d, _ = u[0], m = u[1];
3037
3068
  if (_ >= 0 && m >= 0) {
3038
- var f = Math.sqrt(_), p = Math.sqrt(m);
3039
- return [c - p, c - f, c + f, c + p];
3069
+ var p = Math.sqrt(_), f = Math.sqrt(m);
3070
+ return [c - f, c - p, c + p, c + f];
3040
3071
  }
3041
3072
  if (_ >= 0 && m < 0)
3042
3073
  return [c - (d = Math.sqrt(_)), c + d];
@@ -3055,15 +3086,15 @@ function original(t, e, s, i) {
3055
3086
  function neumark(t, e, s, i) {
3056
3087
  var r = t * t, a = -2 * e, n = s * t + e * e - 4 * i, o = r * i - s * e * t + s * s, h = CubicRealPolynomial.computeRealRoots(1, a, n, o);
3057
3088
  if (h.length > 0) {
3058
- var c, l, u, d, _, m, f = h[0], p = e - f, y = p * p, g = t / 2, M = p / 2, x = y - 4 * i, w = y + 4 * Math.abs(i), S = r - 4 * f, C = r + 4 * Math.abs(f);
3059
- if (f < 0 || x * C < S * w) {
3089
+ var c, l, u, d, _, m, p = h[0], f = e - p, y = f * f, g = t / 2, M = f / 2, x = y - 4 * i, w = y + 4 * Math.abs(i), S = r - 4 * p, C = r + 4 * Math.abs(p);
3090
+ if (p < 0 || x * C < S * w) {
3060
3091
  var E = Math.sqrt(S);
3061
3092
  c = E / 2, l = 0 === E ? 0 : (t * M - s) / E;
3062
3093
  } else {
3063
3094
  var P = Math.sqrt(x);
3064
3095
  c = 0 === P ? 0 : (t * M - s) / P, l = P / 2;
3065
3096
  }
3066
- 0 === g && 0 === c ? (u = 0, d = 0) : CesiumMath.sign(g) === CesiumMath.sign(c) ? d = f / (u = g + c) : u = f / (d = g - c), 0 === M && 0 === l ? (_ = 0, m = 0) : CesiumMath.sign(M) === CesiumMath.sign(l) ? m = i / (_ = M + l) : _ = i / (m = M - l);
3097
+ 0 === g && 0 === c ? (u = 0, d = 0) : CesiumMath.sign(g) === CesiumMath.sign(c) ? d = p / (u = g + c) : u = p / (d = g - c), 0 === M && 0 === l ? (_ = 0, m = 0) : CesiumMath.sign(M) === CesiumMath.sign(l) ? m = i / (_ = M + l) : _ = i / (m = M - l);
3067
3098
  var b = QuadraticRealPolynomial.computeRealRoots(1, u, _), v = QuadraticRealPolynomial.computeRealRoots(1, d, m);
3068
3099
  if (0 !== b.length)
3069
3100
  return 0 !== v.length ? b[1] <= v[0] ? [b[0], b[1], v[0], v[1]] : v[1] <= b[0] ? [v[0], v[1], b[0], b[1]] : b[0] >= v[0] && b[1] <= v[1] ? [v[0], b[0], b[1], v[1]] : v[0] >= b[0] && v[1] <= b[1] ? [b[0], v[0], v[1], b[1]] : b[0] > v[0] && b[0] < v[1] ? [v[0], b[0], v[1], b[1]] : [b[0], v[0], b[1], v[1]] : b;
@@ -3145,24 +3176,24 @@ IntersectionTests.rayTriangleParametric = function(t, e, s, i, r) {
3145
3176
  if (!defined$1(i))
3146
3177
  throw new DeveloperError("p2 is required.");
3147
3178
  r = defaultValue(r, false);
3148
- var a, n, o, h, c, l = t.origin, u = t.direction, d = Cartesian3.subtract(s, e, scratchEdge0), _ = Cartesian3.subtract(i, e, scratchEdge1), m = Cartesian3.cross(u, _, scratchPVec), f = Cartesian3.dot(d, m);
3179
+ var a, n, o, h, c, l = t.origin, u = t.direction, d = Cartesian3.subtract(s, e, scratchEdge0), _ = Cartesian3.subtract(i, e, scratchEdge1), m = Cartesian3.cross(u, _, scratchPVec), p = Cartesian3.dot(d, m);
3149
3180
  if (r) {
3150
- if (f < CesiumMath.EPSILON6)
3181
+ if (p < CesiumMath.EPSILON6)
3151
3182
  return;
3152
- if (a = Cartesian3.subtract(l, e, scratchTVec), (o = Cartesian3.dot(a, m)) < 0 || o > f)
3183
+ if (a = Cartesian3.subtract(l, e, scratchTVec), (o = Cartesian3.dot(a, m)) < 0 || o > p)
3153
3184
  return;
3154
- if (n = Cartesian3.cross(a, d, scratchQVec), (h = Cartesian3.dot(u, n)) < 0 || o + h > f)
3185
+ if (n = Cartesian3.cross(a, d, scratchQVec), (h = Cartesian3.dot(u, n)) < 0 || o + h > p)
3155
3186
  return;
3156
- c = Cartesian3.dot(_, n) / f;
3187
+ c = Cartesian3.dot(_, n) / p;
3157
3188
  } else {
3158
- if (Math.abs(f) < CesiumMath.EPSILON6)
3189
+ if (Math.abs(p) < CesiumMath.EPSILON6)
3159
3190
  return;
3160
- var p = 1 / f;
3161
- if (a = Cartesian3.subtract(l, e, scratchTVec), (o = Cartesian3.dot(a, m) * p) < 0 || o > 1)
3191
+ var f = 1 / p;
3192
+ if (a = Cartesian3.subtract(l, e, scratchTVec), (o = Cartesian3.dot(a, m) * f) < 0 || o > 1)
3162
3193
  return;
3163
- if (n = Cartesian3.cross(a, d, scratchQVec), (h = Cartesian3.dot(u, n) * p) < 0 || o + h > 1)
3194
+ if (n = Cartesian3.cross(a, d, scratchQVec), (h = Cartesian3.dot(u, n) * f) < 0 || o + h > 1)
3164
3195
  return;
3165
- c = Cartesian3.dot(_, n) * p;
3196
+ c = Cartesian3.dot(_, n) * f;
3166
3197
  }
3167
3198
  return c;
3168
3199
  }, IntersectionTests.rayTriangle = function(t, e, s, i, r, a) {
@@ -3239,10 +3270,10 @@ function quadraticVectorExpression(t, e, s, i, r) {
3239
3270
  if (0 === d && 0 === u) {
3240
3271
  if (0 === (a = QuadraticRealPolynomial.computeRealRoots(h, c, l)).length)
3241
3272
  return _;
3242
- var m = a[0], f = Math.sqrt(Math.max(1 - m * m, 0));
3243
- if (_.push(new Vector3$1(i, r * m, r * -f)), _.push(new Vector3$1(i, r * m, r * f)), 2 === a.length) {
3244
- var p = a[1], y = Math.sqrt(Math.max(1 - p * p, 0));
3245
- _.push(new Vector3$1(i, r * p, r * -y)), _.push(new Vector3$1(i, r * p, r * y));
3273
+ var m = a[0], p = Math.sqrt(Math.max(1 - m * m, 0));
3274
+ if (_.push(new Vector3$1(i, r * m, r * -p)), _.push(new Vector3$1(i, r * m, r * p)), 2 === a.length) {
3275
+ var f = a[1], y = Math.sqrt(Math.max(1 - f * f, 0));
3276
+ _.push(new Vector3$1(i, r * f, r * -y)), _.push(new Vector3$1(i, r * f, r * y));
3246
3277
  }
3247
3278
  return _;
3248
3279
  }
@@ -3275,8 +3306,8 @@ IntersectionTests.rayEllipsoid = function(t, e) {
3275
3306
  var _ = (n = -u + Math.sqrt(a)) / i, m = s / n;
3276
3307
  return _ < m ? new Interval(_, m) : { start: m, stop: _ };
3277
3308
  }
3278
- var f = Math.sqrt(s / i);
3279
- return new Interval(f, f);
3309
+ var p = Math.sqrt(s / i);
3310
+ return new Interval(p, p);
3280
3311
  }
3281
3312
  return l < 1 ? (s = l - 1, a = u * u - (r = (i = Cartesian3.magnitudeSquared(c)) * s), new Interval(0, (n = -u + Math.sqrt(a)) / i)) : u < 0 ? new Interval(0, -u / (i = Cartesian3.magnitudeSquared(c))) : void 0;
3282
3313
  };
@@ -3294,14 +3325,14 @@ IntersectionTests.grazingAltitudeLocation = function(t, e) {
3294
3325
  }
3295
3326
  var a = defined$1(this.rayEllipsoid(t, e)), n = e.transformPositionToScaledSpace(i, firstAxisScratch), o = Cartesian3.normalize(n, n), h = Cartesian3.mostOrthogonalAxis(n, referenceScratch), c = Cartesian3.normalize(Cartesian3.cross(h, o, secondAxisScratch), secondAxisScratch), l = Cartesian3.normalize(Cartesian3.cross(o, c, thirdAxisScratch), thirdAxisScratch), u = bScratch;
3296
3327
  u[0] = o.x, u[1] = o.y, u[2] = o.z, u[3] = c.x, u[4] = c.y, u[5] = c.z, u[6] = l.x, u[7] = l.y, u[8] = l.z;
3297
- var d = StaticMatrix3.transpose(u, btScratch), _ = StaticMatrix3.fromScale(e.radii, diScratch), m = StaticMatrix3.fromScale(e.oneOverRadii, dScratch), f = cScratch;
3298
- f[0] = 0, f[1] = -i.z, f[2] = i.y, f[3] = i.z, f[4] = 0, f[5] = -i.x, f[6] = -i.y, f[7] = i.x, f[8] = 0;
3299
- var p, y, g = StaticMatrix3.multiply(StaticMatrix3.multiply(d, m, tempMatrix), f, tempMatrix), M = StaticMatrix3.multiply(StaticMatrix3.multiply(g, _, aScratch), u, aScratch), x = StaticMatrix3.multiplyByVector(g, s, bCart), w = quadraticVectorExpression(M, Cartesian3.negate(x, firstAxisScratch), 0, 0, 1), S = w.length;
3328
+ var d = StaticMatrix3.transpose(u, btScratch), _ = StaticMatrix3.fromScale(e.radii, diScratch), m = StaticMatrix3.fromScale(e.oneOverRadii, dScratch), p = cScratch;
3329
+ p[0] = 0, p[1] = -i.z, p[2] = i.y, p[3] = i.z, p[4] = 0, p[5] = -i.x, p[6] = -i.y, p[7] = i.x, p[8] = 0;
3330
+ var f, y, g = StaticMatrix3.multiply(StaticMatrix3.multiply(d, m, tempMatrix), p, tempMatrix), M = StaticMatrix3.multiply(StaticMatrix3.multiply(g, _, aScratch), u, aScratch), x = StaticMatrix3.multiplyByVector(g, s, bCart), w = quadraticVectorExpression(M, Cartesian3.negate(x, firstAxisScratch), 0, 0, 1), S = w.length;
3300
3331
  if (S > 0) {
3301
3332
  for (var C = Cartesian3.clone(Cartesian3.ZERO, closestScratch), E = Number.NEGATIVE_INFINITY, P = 0; P < S; ++P) {
3302
- p = StaticMatrix3.multiplyByVector(_, StaticMatrix3.multiplyByVector(u, w[P], sScratch), sScratch);
3303
- var b = Cartesian3.normalize(Cartesian3.subtract(p, s, referenceScratch), referenceScratch), v = Cartesian3.dot(b, i);
3304
- v > E && (E = v, C = Cartesian3.clone(p, C));
3333
+ f = StaticMatrix3.multiplyByVector(_, StaticMatrix3.multiplyByVector(u, w[P], sScratch), sScratch);
3334
+ var b = Cartesian3.normalize(Cartesian3.subtract(f, s, referenceScratch), referenceScratch), v = Cartesian3.dot(b, i);
3335
+ v > E && (E = v, C = Cartesian3.clone(f, C));
3305
3336
  }
3306
3337
  var A2 = e.cartesianToCartographic(C, surfPointScratch);
3307
3338
  return E = CesiumMath.clamp(E, 0, 1), y = Cartesian3.magnitude(Cartesian3.subtract(C, s, referenceScratch)) * Math.sqrt(1 - E * E), y = a ? -y : y, A2.z = y, e.cartographicToCartesian(A2, new Vector3$1());
@@ -3543,8 +3574,8 @@ function getLineIntersection(t, e, s, i, r, a) {
3543
3574
  const n = t.x, o = t.y, h = e.x, c = e.y, l = s.x, u = s.y, d = i.x, _ = i.y, m = (n - h) * (u - _) - (o - c) * (l - d);
3544
3575
  if (Math.abs(m) < 1e-4)
3545
3576
  return null;
3546
- const f = ((n - l) * (u - _) - (o - u) * (l - d)) / m, p = -((n - h) * (o - u) - (o - c) * (n - l)) / m;
3547
- return f >= 0 && f <= 1 && p >= 0 && p <= 1 ? { point: t.clone().lerp(e, f), uv: r.clone().lerp(a, f) } : null;
3577
+ const p = ((n - l) * (u - _) - (o - u) * (l - d)) / m, f = -((n - h) * (o - u) - (o - c) * (n - l)) / m;
3578
+ return p >= 0 && p <= 1 && f >= 0 && f <= 1 ? { point: t.clone().lerp(e, p), uv: r.clone().lerp(a, p) } : null;
3548
3579
  }
3549
3580
  function isPointInTriangle(t, e, s, i) {
3550
3581
  const r = s.x - e.x, a = s.y - e.y, n = i.x - e.x, o = i.y - e.y, h = t.x - e.x, c = t.y - e.y, l = r * o - a * n, u = (h * o - c * n) / l, d = (r * c - a * h) / l;
@@ -3567,19 +3598,19 @@ function calculateIntersection(t, e, s) {
3567
3598
  i[s2] || (i[s2] = { point: t2, uv: e[r2] });
3568
3599
  }
3569
3600
  });
3570
- const r = Math.min(t[0].x, Math.min(t[1].x, t[2].x)), a = Math.max(t[0].x, Math.max(t[1].x, t[2].x)), n = Math.min(t[0].y, Math.min(t[1].y, t[2].y)), o = Math.max(t[0].y, Math.max(t[1].y, t[2].y)), h = Math.min(e[0].x, Math.min(e[1].x, e[2].x)), c = Math.max(e[0].x, Math.max(e[1].x, e[2].x)), l = Math.min(e[0].y, Math.min(e[1].y, e[2].y)), u = Math.max(e[0].y, Math.max(e[1].y, e[2].y)), d = a - r, _ = o - n, m = c - h, f = u - l;
3601
+ const r = Math.min(t[0].x, Math.min(t[1].x, t[2].x)), a = Math.max(t[0].x, Math.max(t[1].x, t[2].x)), n = Math.min(t[0].y, Math.min(t[1].y, t[2].y)), o = Math.max(t[0].y, Math.max(t[1].y, t[2].y)), h = Math.min(e[0].x, Math.min(e[1].x, e[2].x)), c = Math.max(e[0].x, Math.max(e[1].x, e[2].x)), l = Math.min(e[0].y, Math.min(e[1].y, e[2].y)), u = Math.max(e[0].y, Math.max(e[1].y, e[2].y)), d = a - r, _ = o - n, m = c - h, p = u - l;
3571
3602
  s.forEach((e2) => {
3572
3603
  if (isPointInTriangle(e2, ...t)) {
3573
3604
  const t2 = e2.x + "," + e2.y + "," + e2.z;
3574
3605
  if (!i[t2]) {
3575
- const s2 = h + m * (e2.x - r) / d, a2 = l + f * (e2.y - n) / _;
3606
+ const s2 = h + m * (e2.x - r) / d, a2 = l + p * (e2.y - n) / _;
3576
3607
  i[t2] = { point: e2, uv: new Vector2(s2, a2) };
3577
3608
  }
3578
3609
  }
3579
3610
  });
3580
- const p = getRectangleEdges(s);
3611
+ const f = getRectangleEdges(s);
3581
3612
  return [[0, 1], [1, 2], [2, 0]].forEach(([s2, r2]) => {
3582
- p.forEach(([a2, n2]) => {
3613
+ f.forEach(([a2, n2]) => {
3583
3614
  const o2 = getLineIntersection(t[s2], t[r2], a2, n2, e[s2], e[r2]);
3584
3615
  if (o2) {
3585
3616
  const { point: t2 } = o2, e2 = t2.x + "," + t2.y + "," + t2.z;
@@ -3637,17 +3668,17 @@ const subdivisionMidScratch = new Vector3$1(), subdivisionT0Scratch = new Vector
3637
3668
  } else
3638
3669
  u = s.slice(0);
3639
3670
  }
3640
- const d = [], _ = {}, m = {}, f = i * i;
3671
+ const d = [], _ = {}, m = {}, p = i * i;
3641
3672
  for (; o.length > 0; ) {
3642
- const t2 = o.pop(), e2 = o.pop(), s2 = o.pop(), i2 = subdivisionV0Scratch.fromArray(l, 3 * s2), c2 = subdivisionV1Scratch.fromArray(l, 3 * e2), p = subdivisionV2Scratch.fromArray(l, 3 * t2);
3673
+ const t2 = o.pop(), e2 = o.pop(), s2 = o.pop(), i2 = subdivisionV0Scratch.fromArray(l, 3 * s2), c2 = subdivisionV1Scratch.fromArray(l, 3 * e2), f = subdivisionV2Scratch.fromArray(l, 3 * t2);
3643
3674
  let y, g, M;
3644
3675
  n && (y = subdivisionT0Scratch.fromArray(u, 2 * s2), g = subdivisionT1Scratch.fromArray(u, 2 * e2), M = subdivisionT2Scratch.fromArray(u, 2 * t2));
3645
- const x = Cartesian3.magnitudeSquared(Cartesian3.subtract(i2, c2, subdivisionMidScratch)), w = Cartesian3.magnitudeSquared(Cartesian3.subtract(c2, p, subdivisionMidScratch)), S = Cartesian3.magnitudeSquared(Cartesian3.subtract(p, i2, subdivisionMidScratch)), C = Math.max(x, w, S);
3676
+ const x = Cartesian3.magnitudeSquared(Cartesian3.subtract(i2, c2, subdivisionMidScratch)), w = Cartesian3.magnitudeSquared(Cartesian3.subtract(c2, f, subdivisionMidScratch)), S = Cartesian3.magnitudeSquared(Cartesian3.subtract(f, i2, subdivisionMidScratch)), C = Math.max(x, w, S);
3646
3677
  let E, P, b;
3647
- if (C > f)
3648
- x === C ? (E = `${Math.min(s2, e2)} ${Math.max(s2, e2)}`, h = _[E], null == h && (P = Cartesian3.add(i2, c2, subdivisionMidScratch), Cartesian3.multiplyByScalar(P, 0.5, P), l.push(P.x, P.y, P.z), h = l.length / 3 - 1, _[E] = h, n && (b = Cartesian2.add(y, g, subdivisionMidScratch), Cartesian2.multiplyByScalar(b, 0.5, b), u.push(b.x, b.y))), o.push(s2, h, t2), o.push(h, e2, t2)) : w === C ? (E = `${Math.min(e2, t2)} ${Math.max(e2, t2)}`, h = _[E], h || (P = Cartesian3.add(c2, p, subdivisionMidScratch), Cartesian3.multiplyByScalar(P, 0.5, P), l.push(P.x, P.y, P.z), h = l.length / 3 - 1, _[E] = h, n && (b = Cartesian2.add(g, M, subdivisionMidScratch), Cartesian2.multiplyByScalar(b, 0.5, b), u.push(b.x, b.y))), o.push(e2, h, s2), o.push(h, t2, s2)) : S === C && (E = `${Math.min(t2, s2)} ${Math.max(t2, s2)}`, h = _[E], h || (P = Cartesian3.add(p, i2, subdivisionMidScratch), Cartesian3.multiplyByScalar(P, 0.5, P), l.push(P.x, P.y, P.z), h = l.length / 3 - 1, _[E] = h, n && (b = Cartesian2.add(M, y, subdivisionMidScratch), Cartesian2.multiplyByScalar(b, 0.5, b), u.push(b.x, b.y))), o.push(t2, h, e2), o.push(h, s2, e2));
3678
+ if (C > p)
3679
+ x === C ? (E = `${Math.min(s2, e2)} ${Math.max(s2, e2)}`, h = _[E], null == h && (P = Cartesian3.add(i2, c2, subdivisionMidScratch), Cartesian3.multiplyByScalar(P, 0.5, P), l.push(P.x, P.y, P.z), h = l.length / 3 - 1, _[E] = h, n && (b = Cartesian2.add(y, g, subdivisionMidScratch), Cartesian2.multiplyByScalar(b, 0.5, b), u.push(b.x, b.y))), o.push(s2, h, t2), o.push(h, e2, t2)) : w === C ? (E = `${Math.min(e2, t2)} ${Math.max(e2, t2)}`, h = _[E], h || (P = Cartesian3.add(c2, f, subdivisionMidScratch), Cartesian3.multiplyByScalar(P, 0.5, P), l.push(P.x, P.y, P.z), h = l.length / 3 - 1, _[E] = h, n && (b = Cartesian2.add(g, M, subdivisionMidScratch), Cartesian2.multiplyByScalar(b, 0.5, b), u.push(b.x, b.y))), o.push(e2, h, s2), o.push(h, t2, s2)) : S === C && (E = `${Math.min(t2, s2)} ${Math.max(t2, s2)}`, h = _[E], h || (P = Cartesian3.add(f, i2, subdivisionMidScratch), Cartesian3.multiplyByScalar(P, 0.5, P), l.push(P.x, P.y, P.z), h = l.length / 3 - 1, _[E] = h, n && (b = Cartesian2.add(M, y, subdivisionMidScratch), Cartesian2.multiplyByScalar(b, 0.5, b), u.push(b.x, b.y))), o.push(t2, h, e2), o.push(h, s2, e2));
3649
3680
  else {
3650
- if (subdivideWithRange([i2, c2, p], [y, g, M], [s2, e2, t2], n, l, u, o, a, m))
3681
+ if (subdivideWithRange([i2, c2, f], [y, g, M], [s2, e2, t2], n, l, u, o, a, m))
3651
3682
  continue;
3652
3683
  d.push(s2 + r), d.push(e2 + r), d.push(t2 + r);
3653
3684
  }
@@ -3656,26 +3687,26 @@ const subdivisionMidScratch = new Vector3$1(), subdivisionT0Scratch = new Vector
3656
3687
  }, _pointIn$1 = new Vector3$1(), _pointOut$1 = new Vector3$1(), reprojectCoordinate = (t, e, s, i, r, a) => {
3657
3688
  let n = CoordTransformer.canTransform(t, e);
3658
3689
  return s !== i && s && i || n ? (s.unprojectCoordinate(r, _pointOut$1), n ? CoordTransformer.transform(t, e, _pointOut$1, _pointIn$1) : _pointIn$1.copy(_pointOut$1), i.projectCoordinate(_pointIn$1, a), a) : (a.copy(r), a);
3659
- }, projectVertices = (t, e, s = true, i = true) => {
3660
- if (!e.forceProjectCoordinates && e.targetProjectionName === e.sourceProjectionName)
3690
+ }, projectVertices = (t, e, s = true, i = true, r = false) => {
3691
+ if (!e.forceProjectCoordinates && !r && e.targetProjectionName === e.sourceProjectionName)
3661
3692
  return;
3662
- const r = e.sourceProjection, a = e.targetProjection, n = e.sourceCoordType, o = e.targetCoordType, [h, c, l] = e.targetCenter, u = e.forceUseGeoBoundingBox || r.isGeo, d = u ? e.geoBoundingBox : e.projectedBoundingBox;
3663
- let _, m, f, p;
3664
- if (d.isBox3) {
3665
- const t2 = d.min, e2 = d.max;
3666
- _ = t2.x, m = t2.y, f = e2.x, p = e2.y;
3693
+ const a = e.sourceProjection, n = e.targetProjection, o = e.sourceCoordType, h = e.targetCoordType, [c, l, u] = e.targetCenter, d = e.forceUseGeoBoundingBox || a.isGeo, _ = d ? e.geoBoundingBox : e.projectedBoundingBox;
3694
+ let m, p, f, y;
3695
+ if (_.isBox3) {
3696
+ const t2 = _.min, e2 = _.max;
3697
+ m = t2.x, p = t2.y, f = e2.x, y = e2.y;
3667
3698
  } else
3668
- [_, m, , f, p] = d;
3669
- const y = f - _, g = p - m;
3699
+ [m, p, , f, y] = _;
3700
+ const g = f - m, M = y - p;
3670
3701
  if (s)
3671
3702
  for (let e2 = 0, s2 = t.length - 2; e2 < s2; e2 += 3) {
3672
- const s3 = t[e2], d2 = t[e2 + 1], f2 = t[e2 + 2];
3673
- _pointIn$1.set(_ + (s3 + 0.5) * y, m + (d2 + 0.5) * g, f2), u ? (n !== o && CoordTransformer.transform(n, o, _pointIn$1, _pointIn$1), a.projectCoordinate(_pointIn$1, _pointOut$1)) : reprojectCoordinate(n, o, r, a, _pointIn$1, _pointOut$1), t[e2] = _pointOut$1.x, t[e2 + 1] = _pointOut$1.y, t[e2 + 2] = _pointOut$1.z, i && (t[e2] -= h, t[e2 + 1] -= c, t[e2 + 2] -= l);
3703
+ const s3 = t[e2], r2 = t[e2 + 1], _2 = t[e2 + 2];
3704
+ _pointIn$1.set(m + (s3 + 0.5) * g, p + (r2 + 0.5) * M, _2), d ? (o !== h && CoordTransformer.transform(o, h, _pointIn$1, _pointIn$1), n.projectCoordinate(_pointIn$1, _pointOut$1)) : reprojectCoordinate(o, h, a, n, _pointIn$1, _pointOut$1), t[e2] = _pointOut$1.x, t[e2 + 1] = _pointOut$1.y, t[e2 + 2] = _pointOut$1.z, i && (t[e2] -= c, t[e2 + 1] -= l, t[e2 + 2] -= u);
3674
3705
  }
3675
3706
  else
3676
3707
  for (let e2 = 0, s2 = t.length; e2 < s2; e2 += 1) {
3677
- const s3 = t[e2], d2 = s3[0], f2 = s3[1], p2 = s3[2];
3678
- _pointIn$1.set(_ + (d2 + 0.5) * y, m + (f2 + 0.5) * g, p2), u ? (n !== o && CoordTransformer.transform(n, o, _pointIn$1, _pointIn$1), a.projectCoordinate(_pointIn$1, _pointOut$1)) : reprojectCoordinate(n, o, r, a, _pointIn$1, _pointOut$1), s3[0] = _pointOut$1.x, s3[1] = _pointOut$1.y, s3[2] = _pointOut$1.z, i && (s3[0] -= h, s3[1] -= c, s3[2] -= l);
3708
+ const s3 = t[e2], r2 = s3[0], _2 = s3[1], f2 = s3[2];
3709
+ _pointIn$1.set(m + (r2 + 0.5) * g, p + (_2 + 0.5) * M, f2), d ? (o !== h && CoordTransformer.transform(o, h, _pointIn$1, _pointIn$1), n.projectCoordinate(_pointIn$1, _pointOut$1)) : reprojectCoordinate(o, h, a, n, _pointIn$1, _pointOut$1), s3[0] = _pointOut$1.x, s3[1] = _pointOut$1.y, s3[2] = _pointOut$1.z, i && (s3[0] -= c, s3[1] -= l, s3[2] -= u);
3679
3710
  }
3680
3711
  }, subdivideVertices = (t, e, s, i) => {
3681
3712
  if (i.sourceProjectionName === i.targetProjectionName)
@@ -3798,9 +3829,9 @@ class OrientedBoundingBox {
3798
3829
  intersectsObb(t) {
3799
3830
  const e = this.center, s = t.center, i = this.halfAxes, r = t.halfAxes, a = new Vector3$1().subVectors(s, e), n = new Vector3$1(i.elements[0], i.elements[1], i.elements[2]), o = new Vector3$1(i.elements[3], i.elements[4], i.elements[5]), h = new Vector3$1(i.elements[6], i.elements[7], i.elements[8]), c = new Vector3$1(r.elements[0], r.elements[1], r.elements[2]), l = new Vector3$1(r.elements[3], r.elements[4], r.elements[5]), u = new Vector3$1(r.elements[6], r.elements[7], r.elements[8]), d = n.length(), _ = o.length(), m = h.length();
3800
3831
  n.normalize(), o.normalize(), h.normalize();
3801
- const f = c.length(), p = l.length(), y = u.length();
3832
+ const p = c.length(), f = l.length(), y = u.length();
3802
3833
  let g, M, x;
3803
- return c.normalize(), l.normalize(), u.normalize(), g = d, M = f * Math.abs(n.dot(c)) + p * Math.abs(n.dot(l)) + y * Math.abs(n.dot(u)), x = Math.abs(a.dot(n)), !(x > g + M) && (g = _, M = f * Math.abs(o.dot(c)) + p * Math.abs(o.dot(l)) + y * Math.abs(o.dot(u)), x = Math.abs(a.dot(o)), !(x > g + M) && (g = m, M = f * Math.abs(h.dot(c)) + p * Math.abs(h.dot(l)) + y * Math.abs(h.dot(u)), x = Math.abs(a.dot(h)), !(x > g + M) && (g = d * Math.abs(c.dot(n)) + _ * Math.abs(c.dot(o)) + m * Math.abs(c.dot(h)), M = f, x = Math.abs(a.dot(c)), !(x > g + M) && (g = d * Math.abs(l.dot(n)) + _ * Math.abs(l.dot(o)) + m * Math.abs(l.dot(h)), M = p, x = Math.abs(a.dot(l)), !(x > g + M) && (g = d * Math.abs(u.dot(n)) + _ * Math.abs(u.dot(o)) + m * Math.abs(u.dot(h)), M = y, x = Math.abs(a.dot(u)), !(x > g + M))))));
3834
+ return c.normalize(), l.normalize(), u.normalize(), g = d, M = p * Math.abs(n.dot(c)) + f * Math.abs(n.dot(l)) + y * Math.abs(n.dot(u)), x = Math.abs(a.dot(n)), !(x > g + M) && (g = _, M = p * Math.abs(o.dot(c)) + f * Math.abs(o.dot(l)) + y * Math.abs(o.dot(u)), x = Math.abs(a.dot(o)), !(x > g + M) && (g = m, M = p * Math.abs(h.dot(c)) + f * Math.abs(h.dot(l)) + y * Math.abs(h.dot(u)), x = Math.abs(a.dot(h)), !(x > g + M) && (g = d * Math.abs(c.dot(n)) + _ * Math.abs(c.dot(o)) + m * Math.abs(c.dot(h)), M = p, x = Math.abs(a.dot(c)), !(x > g + M) && (g = d * Math.abs(l.dot(n)) + _ * Math.abs(l.dot(o)) + m * Math.abs(l.dot(h)), M = f, x = Math.abs(a.dot(l)), !(x > g + M) && (g = d * Math.abs(u.dot(n)) + _ * Math.abs(u.dot(o)) + m * Math.abs(u.dot(h)), M = y, x = Math.abs(a.dot(u)), !(x > g + M))))));
3804
3835
  }
3805
3836
  }
3806
3837
  const scratchOffset = new Vector3$1(), scratchScale = new Vector3$1();
@@ -3831,21 +3862,21 @@ OrientedBoundingBox.fromRectangle = function(t, e, s, i, r) {
3831
3862
  if (e = defaultValue(e, 0), s = defaultValue(s, 0), i = defaultValue(i, Ellipsoid.WGS84), t.width <= CesiumMath.PI) {
3832
3863
  const d2 = Rectangle.center(t, scratchRectangleCenterCartographic), _2 = i.cartographicToCartesian(d2, scratchRectangleCenter), m2 = new EllipsoidTangentPlane(_2, i);
3833
3864
  u = m2.plane;
3834
- const f2 = d2.x, p2 = t.south < 0 && t.north > 0 ? 0 : d2.y, y2 = Cartographic.fromRadians(f2, t.north, s, scratchPerimeterCartographicNC), g2 = Cartographic.fromRadians(t.west, t.north, s, scratchPerimeterCartographicNW), M2 = Cartographic.fromRadians(t.west, p2, s, scratchPerimeterCartographicCW), x2 = Cartographic.fromRadians(t.west, t.south, s, scratchPerimeterCartographicSW), w2 = Cartographic.fromRadians(f2, t.south, s, scratchPerimeterCartographicSC), S = i.cartographicToCartesian(y2, scratchPerimeterCartesianNC);
3865
+ const p2 = d2.x, f2 = t.south < 0 && t.north > 0 ? 0 : d2.y, y2 = Cartographic.fromRadians(p2, t.north, s, scratchPerimeterCartographicNC), g2 = Cartographic.fromRadians(t.west, t.north, s, scratchPerimeterCartographicNW), M2 = Cartographic.fromRadians(t.west, f2, s, scratchPerimeterCartographicCW), x2 = Cartographic.fromRadians(t.west, t.south, s, scratchPerimeterCartographicSW), w2 = Cartographic.fromRadians(p2, t.south, s, scratchPerimeterCartographicSC), S = i.cartographicToCartesian(y2, scratchPerimeterCartesianNC);
3835
3866
  let C = i.cartographicToCartesian(g2, scratchPerimeterCartesianNW);
3836
3867
  const E = i.cartographicToCartesian(M2, scratchPerimeterCartesianCW);
3837
3868
  let P = i.cartographicToCartesian(x2, scratchPerimeterCartesianSW);
3838
3869
  const b = i.cartographicToCartesian(w2, scratchPerimeterCartesianSC), v = m2.projectPointToNearestOnPlane(S, scratchPerimeterProjectedNC), A2 = m2.projectPointToNearestOnPlane(C, scratchPerimeterProjectedNW), T = m2.projectPointToNearestOnPlane(E, scratchPerimeterProjectedCW), I = m2.projectPointToNearestOnPlane(P, scratchPerimeterProjectedSW), z = m2.projectPointToNearestOnPlane(b, scratchPerimeterProjectedSC);
3839
3870
  return a = Math.min(A2.x, T.x, I.x), n = -a, h = Math.max(A2.y, v.y), o = Math.min(I.y, z.y), g2.z = x2.z = e, C = i.cartographicToCartesian(g2, scratchPerimeterCartesianNW), P = i.cartographicToCartesian(x2, scratchPerimeterCartesianSW), c = Math.min(StaticPlane.getPointDistance(u, C), StaticPlane.getPointDistance(u, P)), l = s, fromPlaneExtents(m2.origin, m2.xAxis, m2.yAxis, m2.zAxis, a, n, o, h, c, l, r);
3840
3871
  }
3841
- const d = t.south > 0, _ = t.north < 0, m = d ? t.south : _ ? t.north : 0, f = Rectangle.center(t, scratchRectangleCenterCartographic).x, p = Cartesian3.fromRadians(f, m, s, i, scratchPlaneOrigin);
3842
- p.z = 0;
3843
- const y = Math.abs(p.x) < CesiumMath.EPSILON10 && Math.abs(p.y) < CesiumMath.EPSILON10 ? Cartesian3.UNIT_X : Cartesian3.normalize(p, scratchPlaneNormal), g = Cartesian3.UNIT_Z, M = Cartesian3.cross(y, g, scratchPlaneXAxis);
3844
- u = StaticPlane.fromPointNormal(p, y, scratchPlane);
3845
- const x = Cartesian3.fromRadians(f + CesiumMath.PI_OVER_TWO, m, s, i, scratchHorizonCartesian);
3872
+ const d = t.south > 0, _ = t.north < 0, m = d ? t.south : _ ? t.north : 0, p = Rectangle.center(t, scratchRectangleCenterCartographic).x, f = Cartesian3.fromRadians(p, m, s, i, scratchPlaneOrigin);
3873
+ f.z = 0;
3874
+ const y = Math.abs(f.x) < CesiumMath.EPSILON10 && Math.abs(f.y) < CesiumMath.EPSILON10 ? Cartesian3.UNIT_X : Cartesian3.normalize(f, scratchPlaneNormal), g = Cartesian3.UNIT_Z, M = Cartesian3.cross(y, g, scratchPlaneXAxis);
3875
+ u = StaticPlane.fromPointNormal(f, y, scratchPlane);
3876
+ const x = Cartesian3.fromRadians(p + CesiumMath.PI_OVER_TWO, m, s, i, scratchHorizonCartesian);
3846
3877
  n = Cartesian3.dot(StaticPlane.projectPointOntoPlane(u, x, scratchHorizonProjected), M), a = -n, h = Cartesian3.fromRadians(0, t.north, _ ? e : s, i, scratchMaxY).z, o = Cartesian3.fromRadians(0, t.south, d ? e : s, i, scratchMinY).z;
3847
3878
  const w = Cartesian3.fromRadians(t.east, m, s, i, scratchZ);
3848
- return c = StaticPlane.getPointDistance(u, w), l = 0, fromPlaneExtents(p, M, g, y, a, n, o, h, c, l, r);
3879
+ return c = StaticPlane.getPointDistance(u, w), l = 0, fromPlaneExtents(f, M, g, y, a, n, o, h, c, l, r);
3849
3880
  };
3850
3881
  const scratchCartesianU = new Vector3$1(), scratchCartesianV = new Vector3$1(), scratchCartesianW = new Vector3$1(), scratchValidAxis2 = new Vector3$1(), scratchValidAxis3 = new Vector3$1(), scratchPPrime = new Vector3$1();
3851
3882
  OrientedBoundingBox.distanceSquaredTo = function(t, e) {
@@ -3859,14 +3890,14 @@ OrientedBoundingBox.distanceSquaredTo = function(t, e) {
3859
3890
  let l = true, u = true, d = true;
3860
3891
  o > 0 ? Cartesian3.divideByScalar(r, o, r) : l = false, h > 0 ? Cartesian3.divideByScalar(a, h, a) : u = false, c > 0 ? Cartesian3.divideByScalar(n, c, n) : d = false;
3861
3892
  const _ = !l + !u + !d;
3862
- let m, f, p;
3893
+ let m, p, f;
3863
3894
  if (1 === _) {
3864
3895
  let t2 = r;
3865
- m = a, f = n, u ? d || (t2 = n, f = r) : (t2 = a, m = r), p = Cartesian3.cross(m, f, scratchValidAxis3), t2 === r ? r = p : t2 === a ? a = p : t2 === n && (n = p);
3896
+ m = a, p = n, u ? d || (t2 = n, p = r) : (t2 = a, m = r), f = Cartesian3.cross(m, p, scratchValidAxis3), t2 === r ? r = f : t2 === a ? a = f : t2 === n && (n = f);
3866
3897
  } else if (2 === _) {
3867
3898
  m = r, u ? m = a : d && (m = n);
3868
3899
  let t2 = Cartesian3.UNIT_Y;
3869
- Cartesian3.equalsEpsilon(t2, m, CesiumMath.EPSILON3) && (t2 = Cartesian3.UNIT_X), f = Cartesian3.cross(m, t2, scratchValidAxis2), Cartesian3.normalize(f, f), p = Cartesian3.cross(m, f, scratchValidAxis3), Cartesian3.normalize(p, p), m === r ? (a = f, n = p) : m === a ? (n = f, r = p) : m === n && (r = f, a = p);
3900
+ Cartesian3.equalsEpsilon(t2, m, CesiumMath.EPSILON3) && (t2 = Cartesian3.UNIT_X), p = Cartesian3.cross(m, t2, scratchValidAxis2), Cartesian3.normalize(p, p), f = Cartesian3.cross(m, p, scratchValidAxis3), Cartesian3.normalize(f, f), m === r ? (a = p, n = f) : m === a ? (n = p, r = f) : m === n && (r = p, a = f);
3870
3901
  } else
3871
3902
  3 === _ && (r = Cartesian3.UNIT_X, a = Cartesian3.UNIT_Y, n = Cartesian3.UNIT_Z);
3872
3903
  const y = scratchPPrime;
@@ -4094,7 +4125,7 @@ proj4Src.exports = function() {
4094
4125
  t2("EPSG:" + (32600 + e2), "+proj=utm +zone=" + e2 + " +datum=WGS84 +units=m"), t2("EPSG:" + (32700 + e2), "+proj=utm +zone=" + e2 + " +south +datum=WGS84 +units=m");
4095
4126
  t2.WGS84 = t2["EPSG:4326"], t2["EPSG:3785"] = t2["EPSG:3857"], t2.GOOGLE = t2["EPSG:3857"], t2["EPSG:900913"] = t2["EPSG:3857"], t2["EPSG:102113"] = t2["EPSG:3857"];
4096
4127
  }
4097
- var e = 1, s = 2, i = 3, r = 4, a = 5, n = 6378137, o = 6356752314e-3, h = 0.0066943799901413165, c = 484813681109536e-20, l = Math.PI / 2, u = 0.16666666666666666, d = 0.04722222222222222, _ = 0.022156084656084655, m = 1e-10, f = 0.017453292519943295, p = 57.29577951308232, y = Math.PI / 4, g = 2 * Math.PI, M = 3.14159265359, x = { greenwich: 0, lisbon: -9.131906111111, paris: 2.337229166667, bogota: -74.080916666667, madrid: -3.687938888889, rome: 12.452333333333, bern: 7.439583333333, jakarta: 106.807719444444, ferro: -17.666666666667, brussels: 4.367975, stockholm: 18.058277777778, athens: 23.7163375, oslo: 10.722916666667 }, w = { mm: { to_meter: 1e-3 }, cm: { to_meter: 0.01 }, ft: { to_meter: 0.3048 }, "us-ft": { to_meter: 1200 / 3937 }, fath: { to_meter: 1.8288 }, kmi: { to_meter: 1852 }, "us-ch": { to_meter: 20.1168402336805 }, "us-mi": { to_meter: 1609.34721869444 }, km: { to_meter: 1e3 }, "ind-ft": { to_meter: 0.30479841 }, "ind-yd": { to_meter: 0.91439523 }, mi: { to_meter: 1609.344 }, yd: { to_meter: 0.9144 }, ch: { to_meter: 20.1168 }, link: { to_meter: 0.201168 }, dm: { to_meter: 0.1 }, in: { to_meter: 0.0254 }, "ind-ch": { to_meter: 20.11669506 }, "us-in": { to_meter: 0.025400050800101 }, "us-yd": { to_meter: 0.914401828803658 } }, S = /[\s_\-\/\(\)]/g;
4128
+ var e = 1, s = 2, i = 3, r = 4, a = 5, n = 6378137, o = 6356752314e-3, h = 0.0066943799901413165, c = 484813681109536e-20, l = Math.PI / 2, u = 0.16666666666666666, d = 0.04722222222222222, _ = 0.022156084656084655, m = 1e-10, p = 0.017453292519943295, f = 57.29577951308232, y = Math.PI / 4, g = 2 * Math.PI, M = 3.14159265359, x = { greenwich: 0, lisbon: -9.131906111111, paris: 2.337229166667, bogota: -74.080916666667, madrid: -3.687938888889, rome: 12.452333333333, bern: 7.439583333333, jakarta: 106.807719444444, ferro: -17.666666666667, brussels: 4.367975, stockholm: 18.058277777778, athens: 23.7163375, oslo: 10.722916666667 }, w = { mm: { to_meter: 1e-3 }, cm: { to_meter: 0.01 }, ft: { to_meter: 0.3048 }, "us-ft": { to_meter: 1200 / 3937 }, fath: { to_meter: 1.8288 }, kmi: { to_meter: 1852 }, "us-ch": { to_meter: 20.1168402336805 }, "us-mi": { to_meter: 1609.34721869444 }, km: { to_meter: 1e3 }, "ind-ft": { to_meter: 0.30479841 }, "ind-yd": { to_meter: 0.91439523 }, mi: { to_meter: 1609.344 }, yd: { to_meter: 0.9144 }, ch: { to_meter: 20.1168 }, link: { to_meter: 0.201168 }, dm: { to_meter: 0.1 }, in: { to_meter: 0.0254 }, "ind-ch": { to_meter: 20.11669506 }, "us-in": { to_meter: 0.025400050800101 }, "us-yd": { to_meter: 0.914401828803658 } }, S = /[\s_\-\/\(\)]/g;
4098
4129
  function C(t2, e2) {
4099
4130
  if (t2[e2])
4100
4131
  return t2[e2];
@@ -4113,25 +4144,25 @@ proj4Src.exports = function() {
4113
4144
  }, {}), n2 = { proj: "projName", datum: "datumCode", rf: function(t3) {
4114
4145
  r2.rf = parseFloat(t3);
4115
4146
  }, lat_0: function(t3) {
4116
- r2.lat0 = t3 * f;
4147
+ r2.lat0 = t3 * p;
4117
4148
  }, lat_1: function(t3) {
4118
- r2.lat1 = t3 * f;
4149
+ r2.lat1 = t3 * p;
4119
4150
  }, lat_2: function(t3) {
4120
- r2.lat2 = t3 * f;
4151
+ r2.lat2 = t3 * p;
4121
4152
  }, lat_ts: function(t3) {
4122
- r2.lat_ts = t3 * f;
4153
+ r2.lat_ts = t3 * p;
4123
4154
  }, lon_0: function(t3) {
4124
- r2.long0 = t3 * f;
4155
+ r2.long0 = t3 * p;
4125
4156
  }, lon_1: function(t3) {
4126
- r2.long1 = t3 * f;
4157
+ r2.long1 = t3 * p;
4127
4158
  }, lon_2: function(t3) {
4128
- r2.long2 = t3 * f;
4159
+ r2.long2 = t3 * p;
4129
4160
  }, alpha: function(t3) {
4130
- r2.alpha = parseFloat(t3) * f;
4161
+ r2.alpha = parseFloat(t3) * p;
4131
4162
  }, gamma: function(t3) {
4132
- r2.rectified_grid_angle = parseFloat(t3) * f;
4163
+ r2.rectified_grid_angle = parseFloat(t3) * p;
4133
4164
  }, lonc: function(t3) {
4134
- r2.longc = t3 * f;
4165
+ r2.longc = t3 * p;
4135
4166
  }, x_0: function(t3) {
4136
4167
  r2.x0 = parseFloat(t3);
4137
4168
  }, y_0: function(t3) {
@@ -4163,10 +4194,10 @@ proj4Src.exports = function() {
4163
4194
  var e3 = C(w, t3);
4164
4195
  e3 && (r2.to_meter = e3.to_meter);
4165
4196
  }, from_greenwich: function(t3) {
4166
- r2.from_greenwich = t3 * f;
4197
+ r2.from_greenwich = t3 * p;
4167
4198
  }, pm: function(t3) {
4168
4199
  var e3 = C(x, t3);
4169
- r2.from_greenwich = (e3 || parseFloat(t3)) * f;
4200
+ r2.from_greenwich = (e3 || parseFloat(t3)) * p;
4170
4201
  }, nadgrids: function(t3) {
4171
4202
  "@null" === t3 ? r2.datumCode = "none" : r2.nadgrids = t3;
4172
4203
  }, axis: function(t3) {
@@ -4656,11 +4687,11 @@ proj4Src.exports = function() {
4656
4687
  var i2 = t2 * e2;
4657
4688
  return s2 / Math.sqrt(1 - i2 * i2);
4658
4689
  }
4659
- function ft(t2) {
4690
+ function pt(t2) {
4660
4691
  return t2 < 0 ? -1 : 1;
4661
4692
  }
4662
- function pt(t2) {
4663
- return Math.abs(t2) <= M ? t2 : t2 - ft(t2) * g;
4693
+ function ft(t2) {
4694
+ return Math.abs(t2) <= M ? t2 : t2 - pt(t2) * g;
4664
4695
  }
4665
4696
  function yt(t2, e2, s2) {
4666
4697
  var i2 = t2 * s2, r2 = 0.5 * t2;
@@ -4678,15 +4709,15 @@ proj4Src.exports = function() {
4678
4709
  }
4679
4710
  function xt(t2) {
4680
4711
  var e2, s2, i2 = t2.x, r2 = t2.y;
4681
- if (r2 * p > 90 && r2 * p < -90 && i2 * p > 180 && i2 * p < -180)
4712
+ if (r2 * f > 90 && r2 * f < -90 && i2 * f > 180 && i2 * f < -180)
4682
4713
  return null;
4683
4714
  if (Math.abs(Math.abs(r2) - l) <= m)
4684
4715
  return null;
4685
4716
  if (this.sphere)
4686
- e2 = this.x0 + this.a * this.k0 * pt(i2 - this.long0), s2 = this.y0 + this.a * this.k0 * Math.log(Math.tan(y + 0.5 * r2));
4717
+ e2 = this.x0 + this.a * this.k0 * ft(i2 - this.long0), s2 = this.y0 + this.a * this.k0 * Math.log(Math.tan(y + 0.5 * r2));
4687
4718
  else {
4688
4719
  var a2 = Math.sin(r2), n2 = yt(this.e, r2, a2);
4689
- e2 = this.x0 + this.a * this.k0 * pt(i2 - this.long0), s2 = this.y0 - this.a * this.k0 * Math.log(n2);
4720
+ e2 = this.x0 + this.a * this.k0 * ft(i2 - this.long0), s2 = this.y0 - this.a * this.k0 * Math.log(n2);
4690
4721
  }
4691
4722
  return t2.x = e2, t2.y = s2, t2;
4692
4723
  }
@@ -4699,7 +4730,7 @@ proj4Src.exports = function() {
4699
4730
  if (-9999 === (s2 = gt(this.e, a2)))
4700
4731
  return null;
4701
4732
  }
4702
- return e2 = pt(this.long0 + i2 / (this.a * this.k0)), t2.x = e2, t2.y = s2, t2;
4733
+ return e2 = ft(this.long0 + i2 / (this.a * this.k0)), t2.x = e2, t2.y = s2, t2;
4703
4734
  }
4704
4735
  function St() {
4705
4736
  }
@@ -4762,13 +4793,13 @@ proj4Src.exports = function() {
4762
4793
  var a2 = await e2.getImage(r2), n2 = await a2.readRasters(), o2 = [a2.getWidth(), a2.getHeight()], h2 = a2.getBoundingBox().map(Wt), c2 = [a2.fileDirectory.ModelPixelScale[0], a2.fileDirectory.ModelPixelScale[1]].map(Wt), l2 = h2[0] + (o2[0] - 1) * c2[0], u2 = h2[3] - (o2[1] - 1) * c2[1], d2 = n2[0], _2 = n2[1], m2 = [];
4763
4794
  for (let t3 = o2[1] - 1; t3 >= 0; t3--)
4764
4795
  for (let e3 = o2[0] - 1; e3 >= 0; e3--) {
4765
- var f2 = t3 * o2[0] + e3;
4766
- m2.push([-Yt(_2[f2]), Yt(d2[f2])]);
4796
+ var p2 = t3 * o2[0] + e3;
4797
+ m2.push([-Yt(_2[p2]), Yt(d2[p2])]);
4767
4798
  }
4768
4799
  s2.push({ del: c2, lim: o2, ll: [-l2, u2], cvs: m2 });
4769
4800
  }
4770
- var p2 = { header: { nSubgrids: i2 }, subgrids: s2 };
4771
- return jt[t2] = p2, p2;
4801
+ var f2 = { header: { nSubgrids: i2 }, subgrids: s2 };
4802
+ return jt[t2] = f2, f2;
4772
4803
  }
4773
4804
  function Ft(t2) {
4774
4805
  return void 0 === t2 ? null : t2.split(",").map(Ut);
@@ -4862,16 +4893,16 @@ proj4Src.exports = function() {
4862
4893
  return o2 > Math.PI && (o2 -= 2 * Math.PI), r2 = Math.sin(h2), n2 = Math.cos(h2), a2 = r2 * r2, { x: ((i2 = s2 / Math.sqrt(1 - e2 * a2)) + c2) * n2 * Math.cos(o2), y: (i2 + c2) * n2 * Math.sin(o2), z: (i2 * (1 - e2) + c2) * r2 };
4863
4894
  }
4864
4895
  function re(t2, e2, s2, i2) {
4865
- var r2, a2, n2, o2, h2, c2, l2, u2, d2, _2, m2, f2, p2, y2, g2, M2 = 1e-12, x2 = M2 * M2, w2 = 30, S2 = t2.x, C2 = t2.y, E2 = t2.z ? t2.z : 0;
4896
+ var r2, a2, n2, o2, h2, c2, l2, u2, d2, _2, m2, p2, f2, y2, g2, M2 = 1e-12, x2 = M2 * M2, w2 = 30, S2 = t2.x, C2 = t2.y, E2 = t2.z ? t2.z : 0;
4866
4897
  if (r2 = Math.sqrt(S2 * S2 + C2 * C2), a2 = Math.sqrt(S2 * S2 + C2 * C2 + E2 * E2), r2 / s2 < M2) {
4867
4898
  if (y2 = 0, a2 / s2 < M2)
4868
4899
  return g2 = -i2, { x: t2.x, y: t2.y, z: t2.z };
4869
4900
  } else
4870
4901
  y2 = Math.atan2(C2, S2);
4871
- n2 = E2 / a2, u2 = (o2 = r2 / a2) * (1 - e2) * (h2 = 1 / Math.sqrt(1 - e2 * (2 - e2) * o2 * o2)), d2 = n2 * h2, p2 = 0;
4902
+ n2 = E2 / a2, u2 = (o2 = r2 / a2) * (1 - e2) * (h2 = 1 / Math.sqrt(1 - e2 * (2 - e2) * o2 * o2)), d2 = n2 * h2, f2 = 0;
4872
4903
  do {
4873
- p2++, c2 = e2 * (l2 = s2 / Math.sqrt(1 - e2 * d2 * d2)) / (l2 + (g2 = r2 * u2 + E2 * d2 - l2 * (1 - e2 * d2 * d2))), f2 = (m2 = n2 * (h2 = 1 / Math.sqrt(1 - c2 * (2 - c2) * o2 * o2))) * u2 - (_2 = o2 * (1 - c2) * h2) * d2, u2 = _2, d2 = m2;
4874
- } while (f2 * f2 > x2 && p2 < w2);
4904
+ f2++, c2 = e2 * (l2 = s2 / Math.sqrt(1 - e2 * d2 * d2)) / (l2 + (g2 = r2 * u2 + E2 * d2 - l2 * (1 - e2 * d2 * d2))), p2 = (m2 = n2 * (h2 = 1 / Math.sqrt(1 - c2 * (2 - c2) * o2 * o2))) * u2 - (_2 = o2 * (1 - c2) * h2) * d2, u2 = _2, d2 = m2;
4905
+ } while (p2 * p2 > x2 && f2 < w2);
4875
4906
  return { x: y2, y: Math.atan(m2 / Math.abs(_2)), z: g2 };
4876
4907
  }
4877
4908
  function ae(t2, i2, r2) {
@@ -4920,21 +4951,21 @@ proj4Src.exports = function() {
4920
4951
  }
4921
4952
  if (null !== o2.grid)
4922
4953
  for (var h2 = o2.grid.subgrids, c2 = 0, l2 = h2.length; c2 < l2; c2++) {
4923
- var u2 = h2[c2], d2 = (Math.abs(u2.del[1]) + Math.abs(u2.del[0])) / 1e4, _2 = u2.ll[0] - d2, m2 = u2.ll[1] - d2, f2 = u2.ll[0] + (u2.lim[0] - 1) * u2.del[0] + d2, y2 = u2.ll[1] + (u2.lim[1] - 1) * u2.del[1] + d2;
4924
- if (!(m2 > i2.y || _2 > i2.x || y2 < i2.y || f2 < i2.x || (r2 = le(i2, e2, u2), isNaN(r2.x))))
4954
+ var u2 = h2[c2], d2 = (Math.abs(u2.del[1]) + Math.abs(u2.del[0])) / 1e4, _2 = u2.ll[0] - d2, m2 = u2.ll[1] - d2, p2 = u2.ll[0] + (u2.lim[0] - 1) * u2.del[0] + d2, y2 = u2.ll[1] + (u2.lim[1] - 1) * u2.del[1] + d2;
4955
+ if (!(m2 > i2.y || _2 > i2.x || y2 < i2.y || p2 < i2.x || (r2 = le(i2, e2, u2), isNaN(r2.x))))
4925
4956
  break t;
4926
4957
  }
4927
4958
  else if (o2.mandatory)
4928
4959
  return console.log("Unable to find mandatory grid '" + o2.name + "'"), -1;
4929
4960
  }
4930
- return isNaN(r2.x) ? (console.log("Failed to find a grid shift table for location '" + -i2.x * p + " " + i2.y * p + " tried: '" + a2 + "'"), -1) : (s2.x = -r2.x, s2.y = r2.y, 0);
4961
+ return isNaN(r2.x) ? (console.log("Failed to find a grid shift table for location '" + -i2.x * f + " " + i2.y * f + " tried: '" + a2 + "'"), -1) : (s2.x = -r2.x, s2.y = r2.y, 0);
4931
4962
  }
4932
4963
  function le(t2, e2, s2) {
4933
4964
  var i2 = { x: Number.NaN, y: Number.NaN };
4934
4965
  if (isNaN(t2.x))
4935
4966
  return i2;
4936
4967
  var r2 = { x: t2.x, y: t2.y };
4937
- r2.x -= s2.ll[0], r2.y -= s2.ll[1], r2.x = pt(r2.x - Math.PI) + Math.PI;
4968
+ r2.x -= s2.ll[0], r2.y -= s2.ll[1], r2.x = ft(r2.x - Math.PI) + Math.PI;
4938
4969
  var a2 = ue(r2, s2);
4939
4970
  if (e2) {
4940
4971
  if (isNaN(a2.x))
@@ -4950,7 +4981,7 @@ proj4Src.exports = function() {
4950
4981
  } while (h2-- && Math.abs(n2.x) > c2 && Math.abs(n2.y) > c2);
4951
4982
  if (h2 < 0)
4952
4983
  return console.log("Inverse grid shift iterator failed to converge."), i2;
4953
- i2.x = pt(a2.x + s2.ll[0]), i2.y = a2.y + s2.ll[1];
4984
+ i2.x = ft(a2.x + s2.ll[0]), i2.y = a2.y + s2.ll[1];
4954
4985
  } else
4955
4986
  isNaN(a2.x) || (i2.x = t2.x + a2.x, i2.y = t2.y + a2.y);
4956
4987
  return i2;
@@ -5000,9 +5031,9 @@ proj4Src.exports = function() {
5000
5031
  return t2.length > 2 && (e2.z = t2[2]), t2.length > 3 && (e2.m = t2[3]), e2;
5001
5032
  }
5002
5033
  function me(t2) {
5003
- fe(t2.x), fe(t2.y);
5034
+ pe(t2.x), pe(t2.y);
5004
5035
  }
5005
- function fe(t2) {
5036
+ function pe(t2) {
5006
5037
  if ("function" == typeof Number.isFinite) {
5007
5038
  if (Number.isFinite(t2))
5008
5039
  return;
@@ -5011,17 +5042,17 @@ proj4Src.exports = function() {
5011
5042
  if ("number" != typeof t2 || t2 != t2 || !isFinite(t2))
5012
5043
  throw new TypeError("coordinates must be finite numbers");
5013
5044
  }
5014
- function pe(t2, r2) {
5045
+ function fe(t2, r2) {
5015
5046
  return (t2.datum.datum_type === e || t2.datum.datum_type === s || t2.datum.datum_type === i) && "WGS84" !== r2.datumCode || (r2.datum.datum_type === e || r2.datum.datum_type === s || r2.datum.datum_type === i) && "WGS84" !== t2.datumCode;
5016
5047
  }
5017
5048
  function ye(t2, e2, s2, i2) {
5018
5049
  var r2, a2 = void 0 !== (s2 = Array.isArray(s2) ? _e(s2) : { x: s2.x, y: s2.y, z: s2.z, m: s2.m }).z;
5019
- if (me(s2), t2.datum && e2.datum && pe(t2, e2) && (s2 = ye(t2, r2 = new ee("WGS84"), s2, i2), t2 = r2), i2 && "enu" !== t2.axis && (s2 = de(t2, false, s2)), "longlat" === t2.projName)
5020
- s2 = { x: s2.x * f, y: s2.y * f, z: s2.z || 0 };
5050
+ if (me(s2), t2.datum && e2.datum && fe(t2, e2) && (s2 = ye(t2, r2 = new ee("WGS84"), s2, i2), t2 = r2), i2 && "enu" !== t2.axis && (s2 = de(t2, false, s2)), "longlat" === t2.projName)
5051
+ s2 = { x: s2.x * p, y: s2.y * p, z: s2.z || 0 };
5021
5052
  else if (t2.to_meter && (s2 = { x: s2.x * t2.to_meter, y: s2.y * t2.to_meter, z: s2.z || 0 }), !(s2 = t2.inverse(s2)))
5022
5053
  return;
5023
5054
  if (t2.from_greenwich && (s2.x += t2.from_greenwich), s2 = he(t2.datum, e2.datum, s2))
5024
- return e2.from_greenwich && (s2 = { x: s2.x - e2.from_greenwich, y: s2.y, z: s2.z || 0 }), "longlat" === e2.projName ? s2 = { x: s2.x * p, y: s2.y * p, z: s2.z || 0 } : (s2 = e2.forward(s2), e2.to_meter && (s2 = { x: s2.x / e2.to_meter, y: s2.y / e2.to_meter, z: s2.z || 0 })), i2 && "enu" !== e2.axis ? de(e2, true, s2) : (s2 && !a2 && delete s2.z, s2);
5055
+ return e2.from_greenwich && (s2 = { x: s2.x - e2.from_greenwich, y: s2.y, z: s2.z || 0 }), "longlat" === e2.projName ? s2 = { x: s2.x * f, y: s2.y * f, z: s2.z || 0 } : (s2 = e2.forward(s2), e2.to_meter && (s2 = { x: s2.x / e2.to_meter, y: s2.y / e2.to_meter, z: s2.z || 0 })), i2 && "enu" !== e2.axis ? de(e2, true, s2) : (s2 && !a2 && delete s2.z, s2);
5025
5056
  }
5026
5057
  ee.projections = zt, ee.projections.start();
5027
5058
  var ge = ee("WGS84");
@@ -5069,15 +5100,15 @@ proj4Src.exports = function() {
5069
5100
  function Le(t2) {
5070
5101
  var e2, s2, i2, r2, a2, n2, o2, h2 = t2.lat, c2 = t2.lon, l2 = 6378137, u2 = 669438e-8, d2 = 0.9996, _2 = Ge(h2), m2 = Ge(c2);
5071
5102
  o2 = Math.floor((c2 + 180) / 6) + 1, 180 === c2 && (o2 = 60), h2 >= 56 && h2 < 64 && c2 >= 3 && c2 < 12 && (o2 = 32), h2 >= 72 && h2 < 84 && (c2 >= 0 && c2 < 9 ? o2 = 31 : c2 >= 9 && c2 < 21 ? o2 = 33 : c2 >= 21 && c2 < 33 ? o2 = 35 : c2 >= 33 && c2 < 42 && (o2 = 37)), n2 = Ge(6 * (o2 - 1) - 180 + 3), e2 = u2 / (1 - u2), s2 = l2 / Math.sqrt(1 - u2 * Math.sin(_2) * Math.sin(_2)), i2 = Math.tan(_2) * Math.tan(_2), r2 = e2 * Math.cos(_2) * Math.cos(_2);
5072
- var f2 = d2 * s2 * ((a2 = Math.cos(_2) * (m2 - n2)) + (1 - i2 + r2) * a2 * a2 * a2 / 6 + (5 - 18 * i2 + i2 * i2 + 72 * r2 - 58 * e2) * a2 * a2 * a2 * a2 * a2 / 120) + 5e5, p2 = d2 * (l2 * ((1 - u2 / 4 - 3 * u2 * u2 / 64 - 5 * u2 * u2 * u2 / 256) * _2 - (3 * u2 / 8 + 3 * u2 * u2 / 32 + 45 * u2 * u2 * u2 / 1024) * Math.sin(2 * _2) + (15 * u2 * u2 / 256 + 45 * u2 * u2 * u2 / 1024) * Math.sin(4 * _2) - 35 * u2 * u2 * u2 / 3072 * Math.sin(6 * _2)) + s2 * Math.tan(_2) * (a2 * a2 / 2 + (5 - i2 + 9 * r2 + 4 * r2 * r2) * a2 * a2 * a2 * a2 / 24 + (61 - 58 * i2 + i2 * i2 + 600 * r2 - 330 * e2) * a2 * a2 * a2 * a2 * a2 * a2 / 720));
5073
- return h2 < 0 && (p2 += 1e7), { northing: Math.round(p2), easting: Math.round(f2), zoneNumber: o2, zoneLetter: Ve(h2) };
5103
+ var p2 = d2 * s2 * ((a2 = Math.cos(_2) * (m2 - n2)) + (1 - i2 + r2) * a2 * a2 * a2 / 6 + (5 - 18 * i2 + i2 * i2 + 72 * r2 - 58 * e2) * a2 * a2 * a2 * a2 * a2 / 120) + 5e5, f2 = d2 * (l2 * ((1 - u2 / 4 - 3 * u2 * u2 / 64 - 5 * u2 * u2 * u2 / 256) * _2 - (3 * u2 / 8 + 3 * u2 * u2 / 32 + 45 * u2 * u2 * u2 / 1024) * Math.sin(2 * _2) + (15 * u2 * u2 / 256 + 45 * u2 * u2 * u2 / 1024) * Math.sin(4 * _2) - 35 * u2 * u2 * u2 / 3072 * Math.sin(6 * _2)) + s2 * Math.tan(_2) * (a2 * a2 / 2 + (5 - i2 + 9 * r2 + 4 * r2 * r2) * a2 * a2 * a2 * a2 / 24 + (61 - 58 * i2 + i2 * i2 + 600 * r2 - 330 * e2) * a2 * a2 * a2 * a2 * a2 * a2 / 720));
5104
+ return h2 < 0 && (f2 += 1e7), { northing: Math.round(f2), easting: Math.round(p2), zoneNumber: o2, zoneLetter: Ve(h2) };
5074
5105
  }
5075
5106
  function $e(t2) {
5076
5107
  var e2 = t2.northing, s2 = t2.easting, i2 = t2.zoneLetter, r2 = t2.zoneNumber;
5077
5108
  if (r2 < 0 || r2 > 60)
5078
5109
  return null;
5079
- var a2, n2, o2, h2, c2, l2, u2, d2, _2, m2 = 0.9996, f2 = 6378137, p2 = 669438e-8, y2 = (1 - Math.sqrt(1 - p2)) / (1 + Math.sqrt(1 - p2)), g2 = s2 - 5e5, M2 = e2;
5080
- i2 < "N" && (M2 -= 1e7), u2 = 6 * (r2 - 1) - 180 + 3, a2 = p2 / (1 - p2), _2 = (d2 = M2 / m2 / (f2 * (1 - p2 / 4 - 3 * p2 * p2 / 64 - 5 * p2 * p2 * p2 / 256))) + (3 * y2 / 2 - 27 * y2 * y2 * y2 / 32) * Math.sin(2 * d2) + (21 * y2 * y2 / 16 - 55 * y2 * y2 * y2 * y2 / 32) * Math.sin(4 * d2) + 151 * y2 * y2 * y2 / 96 * Math.sin(6 * d2), n2 = f2 / Math.sqrt(1 - p2 * Math.sin(_2) * Math.sin(_2)), o2 = Math.tan(_2) * Math.tan(_2), h2 = a2 * Math.cos(_2) * Math.cos(_2), c2 = f2 * (1 - p2) / Math.pow(1 - p2 * Math.sin(_2) * Math.sin(_2), 1.5), l2 = g2 / (n2 * m2);
5110
+ var a2, n2, o2, h2, c2, l2, u2, d2, _2, m2 = 0.9996, p2 = 6378137, f2 = 669438e-8, y2 = (1 - Math.sqrt(1 - f2)) / (1 + Math.sqrt(1 - f2)), g2 = s2 - 5e5, M2 = e2;
5111
+ i2 < "N" && (M2 -= 1e7), u2 = 6 * (r2 - 1) - 180 + 3, a2 = f2 / (1 - f2), _2 = (d2 = M2 / m2 / (p2 * (1 - f2 / 4 - 3 * f2 * f2 / 64 - 5 * f2 * f2 * f2 / 256))) + (3 * y2 / 2 - 27 * y2 * y2 * y2 / 32) * Math.sin(2 * d2) + (21 * y2 * y2 / 16 - 55 * y2 * y2 * y2 * y2 / 32) * Math.sin(4 * d2) + 151 * y2 * y2 * y2 / 96 * Math.sin(6 * d2), n2 = p2 / Math.sqrt(1 - f2 * Math.sin(_2) * Math.sin(_2)), o2 = Math.tan(_2) * Math.tan(_2), h2 = a2 * Math.cos(_2) * Math.cos(_2), c2 = p2 * (1 - f2) / Math.pow(1 - f2 * Math.sin(_2) * Math.sin(_2), 1.5), l2 = g2 / (n2 * m2);
5081
5112
  var x2 = _2 - n2 * Math.tan(_2) / c2 * (l2 * l2 / 2 - (5 + 3 * o2 + 10 * h2 - 4 * h2 * h2 - 9 * a2) * l2 * l2 * l2 * l2 / 24 + (61 + 90 * o2 + 298 * h2 + 45 * o2 * o2 - 252 * a2 - 3 * h2 * h2) * l2 * l2 * l2 * l2 * l2 * l2 / 720);
5082
5113
  x2 = Re(x2);
5083
5114
  var w2, S2 = (l2 - (1 + 2 * o2 + h2) * l2 * l2 * l2 / 6 + (5 - 2 * h2 + 28 * o2 - 3 * h2 * h2 + 8 * a2 + 24 * o2 * o2) * l2 * l2 * l2 * l2 * l2 / 120) / Math.cos(_2);
@@ -5128,8 +5159,8 @@ proj4Src.exports = function() {
5128
5159
  var u2 = s2 - a2;
5129
5160
  if (u2 % 2 != 0)
5130
5161
  throw "MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters" + t2;
5131
- var d2, _2, m2, f2 = u2 / 2, p2 = 0, y2 = 0;
5132
- return f2 > 0 && (d2 = 1e5 / Math.pow(10, f2), _2 = t2.substring(a2, a2 + f2), p2 = parseFloat(_2) * d2, m2 = t2.substring(a2 + f2), y2 = parseFloat(m2) * d2), { easting: p2 + c2, northing: y2 + l2, zoneLetter: o2, zoneNumber: n2, accuracy: d2 };
5162
+ var d2, _2, m2, p2 = u2 / 2, f2 = 0, y2 = 0;
5163
+ return p2 > 0 && (d2 = 1e5 / Math.pow(10, p2), _2 = t2.substring(a2, a2 + p2), f2 = parseFloat(_2) * d2, m2 = t2.substring(a2 + p2), y2 = parseFloat(m2) * d2), { easting: f2 + c2, northing: y2 + l2, zoneLetter: o2, zoneNumber: n2, accuracy: d2 };
5133
5164
  }
5134
5165
  function Fe(t2, e2) {
5135
5166
  for (var s2 = Ce.charCodeAt(e2 - 1), i2 = 1e5, r2 = false; s2 !== t2.charCodeAt(0); ) {
@@ -5267,12 +5298,12 @@ proj4Src.exports = function() {
5267
5298
  this.x0 = void 0 !== this.x0 ? this.x0 : 0, this.y0 = void 0 !== this.y0 ? this.y0 : 0, this.long0 = void 0 !== this.long0 ? this.long0 : 0, this.lat0 = void 0 !== this.lat0 ? this.lat0 : 0, this.es && (this.en = ns(this.es), this.ml0 = os(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en));
5268
5299
  }
5269
5300
  function us(t2) {
5270
- var e2, s2, i2, r2 = t2.x, a2 = t2.y, n2 = pt(r2 - this.long0), o2 = Math.sin(a2), h2 = Math.cos(a2);
5301
+ var e2, s2, i2, r2 = t2.x, a2 = t2.y, n2 = ft(r2 - this.long0), o2 = Math.sin(a2), h2 = Math.cos(a2);
5271
5302
  if (this.es) {
5272
- var c2 = h2 * n2, l2 = Math.pow(c2, 2), u2 = this.ep2 * Math.pow(h2, 2), d2 = Math.pow(u2, 2), _2 = Math.abs(h2) > m ? Math.tan(a2) : 0, f2 = Math.pow(_2, 2), p2 = Math.pow(f2, 2);
5303
+ var c2 = h2 * n2, l2 = Math.pow(c2, 2), u2 = this.ep2 * Math.pow(h2, 2), d2 = Math.pow(u2, 2), _2 = Math.abs(h2) > m ? Math.tan(a2) : 0, p2 = Math.pow(_2, 2), f2 = Math.pow(p2, 2);
5273
5304
  e2 = 1 - this.es * Math.pow(o2, 2), c2 /= Math.sqrt(e2);
5274
5305
  var y2 = os(a2, o2, h2, this.en);
5275
- s2 = this.a * (this.k0 * c2 * (1 + l2 / 6 * (1 - f2 + u2 + l2 / 20 * (5 - 18 * f2 + p2 + 14 * u2 - 58 * f2 * u2 + l2 / 42 * (61 + 179 * p2 - p2 * f2 - 479 * f2))))) + this.x0, i2 = this.a * (this.k0 * (y2 - this.ml0 + o2 * n2 * c2 / 2 * (1 + l2 / 12 * (5 - f2 + 9 * u2 + 4 * d2 + l2 / 30 * (61 + p2 - 58 * f2 + 270 * u2 - 330 * f2 * u2 + l2 / 56 * (1385 + 543 * p2 - p2 * f2 - 3111 * f2)))))) + this.y0;
5306
+ s2 = this.a * (this.k0 * c2 * (1 + l2 / 6 * (1 - p2 + u2 + l2 / 20 * (5 - 18 * p2 + f2 + 14 * u2 - 58 * p2 * u2 + l2 / 42 * (61 + 179 * f2 - f2 * p2 - 479 * p2))))) + this.x0, i2 = this.a * (this.k0 * (y2 - this.ml0 + o2 * n2 * c2 / 2 * (1 + l2 / 12 * (5 - p2 + 9 * u2 + 4 * d2 + l2 / 30 * (61 + f2 - 58 * p2 + 270 * u2 - 330 * p2 * u2 + l2 / 56 * (1385 + 543 * f2 - f2 * p2 - 3111 * p2)))))) + this.y0;
5276
5307
  } else {
5277
5308
  var g2 = h2 * Math.sin(n2);
5278
5309
  if (Math.abs(Math.abs(g2) - 1) < m)
@@ -5291,15 +5322,15 @@ proj4Src.exports = function() {
5291
5322
  var e2, s2, i2, r2, a2 = (t2.x - this.x0) * (1 / this.a), n2 = (t2.y - this.y0) * (1 / this.a);
5292
5323
  if (this.es)
5293
5324
  if (s2 = cs(e2 = this.ml0 + n2 / this.k0, this.es, this.en), Math.abs(s2) < l) {
5294
- var o2 = Math.sin(s2), h2 = Math.cos(s2), c2 = Math.abs(h2) > m ? Math.tan(s2) : 0, u2 = this.ep2 * Math.pow(h2, 2), d2 = Math.pow(u2, 2), _2 = Math.pow(c2, 2), f2 = Math.pow(_2, 2);
5325
+ var o2 = Math.sin(s2), h2 = Math.cos(s2), c2 = Math.abs(h2) > m ? Math.tan(s2) : 0, u2 = this.ep2 * Math.pow(h2, 2), d2 = Math.pow(u2, 2), _2 = Math.pow(c2, 2), p2 = Math.pow(_2, 2);
5295
5326
  e2 = 1 - this.es * Math.pow(o2, 2);
5296
- var p2 = a2 * Math.sqrt(e2) / this.k0, y2 = Math.pow(p2, 2);
5297
- i2 = s2 - (e2 *= c2) * y2 / (1 - this.es) * 0.5 * (1 - y2 / 12 * (5 + 3 * _2 - 9 * u2 * _2 + u2 - 4 * d2 - y2 / 30 * (61 + 90 * _2 - 252 * u2 * _2 + 45 * f2 + 46 * u2 - y2 / 56 * (1385 + 3633 * _2 + 4095 * f2 + 1574 * f2 * _2)))), r2 = pt(this.long0 + p2 * (1 - y2 / 6 * (1 + 2 * _2 + u2 - y2 / 20 * (5 + 28 * _2 + 24 * f2 + 8 * u2 * _2 + 6 * u2 - y2 / 42 * (61 + 662 * _2 + 1320 * f2 + 720 * f2 * _2)))) / h2);
5327
+ var f2 = a2 * Math.sqrt(e2) / this.k0, y2 = Math.pow(f2, 2);
5328
+ i2 = s2 - (e2 *= c2) * y2 / (1 - this.es) * 0.5 * (1 - y2 / 12 * (5 + 3 * _2 - 9 * u2 * _2 + u2 - 4 * d2 - y2 / 30 * (61 + 90 * _2 - 252 * u2 * _2 + 45 * p2 + 46 * u2 - y2 / 56 * (1385 + 3633 * _2 + 4095 * p2 + 1574 * p2 * _2)))), r2 = ft(this.long0 + f2 * (1 - y2 / 6 * (1 + 2 * _2 + u2 - y2 / 20 * (5 + 28 * _2 + 24 * p2 + 8 * u2 * _2 + 6 * u2 - y2 / 42 * (61 + 662 * _2 + 1320 * p2 + 720 * p2 * _2)))) / h2);
5298
5329
  } else
5299
- i2 = l * ft(n2), r2 = 0;
5330
+ i2 = l * pt(n2), r2 = 0;
5300
5331
  else {
5301
5332
  var g2 = Math.exp(a2 / this.k0), M2 = 0.5 * (g2 - 1 / g2), x2 = this.lat0 + n2 / this.k0, w2 = Math.cos(x2);
5302
- e2 = Math.sqrt((1 - Math.pow(w2, 2)) / (1 + Math.pow(M2, 2))), i2 = Math.asin(e2), n2 < 0 && (i2 = -i2), r2 = 0 === M2 && 0 === w2 ? 0 : pt(Math.atan2(M2, w2) + this.long0);
5333
+ e2 = Math.sqrt((1 - Math.pow(w2, 2)) / (1 + Math.pow(M2, 2))), i2 = Math.asin(e2), n2 < 0 && (i2 = -i2), r2 = 0 === M2 && 0 === w2 ? 0 : ft(Math.atan2(M2, w2) + this.long0);
5303
5334
  }
5304
5335
  return t2.x = r2, t2.y = i2, t2;
5305
5336
  }
@@ -5308,18 +5339,18 @@ proj4Src.exports = function() {
5308
5339
  var e2 = Math.exp(t2);
5309
5340
  return e2 = (e2 - 1 / e2) / 2;
5310
5341
  }
5311
- function fs(t2, e2) {
5342
+ function ps(t2, e2) {
5312
5343
  t2 = Math.abs(t2), e2 = Math.abs(e2);
5313
5344
  var s2 = Math.max(t2, e2), i2 = Math.min(t2, e2) / (s2 || 1);
5314
5345
  return s2 * Math.sqrt(1 + Math.pow(i2, 2));
5315
5346
  }
5316
- function ps(t2) {
5347
+ function fs(t2) {
5317
5348
  var e2 = 1 + t2, s2 = e2 - 1;
5318
5349
  return 0 === s2 ? t2 : t2 * Math.log(e2) / s2;
5319
5350
  }
5320
5351
  function ys(t2) {
5321
5352
  var e2 = Math.abs(t2);
5322
- return e2 = ps(e2 * (1 + e2 / (fs(1, e2) + 1))), t2 < 0 ? -e2 : e2;
5353
+ return e2 = fs(e2 * (1 + e2 / (ps(1, e2) + 1))), t2 < 0 ? -e2 : e2;
5323
5354
  }
5324
5355
  function gs(t2, e2) {
5325
5356
  for (var s2, i2 = 2 * Math.cos(2 * e2), r2 = t2.length - 1, a2 = t2[r2], n2 = 0; --r2 >= 0; )
@@ -5336,9 +5367,9 @@ proj4Src.exports = function() {
5336
5367
  return e2 = (e2 + 1 / e2) / 2;
5337
5368
  }
5338
5369
  function ws(t2, e2, s2) {
5339
- for (var i2, r2, a2 = Math.sin(e2), n2 = Math.cos(e2), o2 = ms(s2), h2 = xs(s2), c2 = 2 * n2 * h2, l2 = -2 * a2 * o2, u2 = t2.length - 1, d2 = t2[u2], _2 = 0, m2 = 0, f2 = 0; --u2 >= 0; )
5340
- i2 = m2, r2 = _2, d2 = c2 * (m2 = d2) - i2 - l2 * (_2 = f2) + t2[u2], f2 = l2 * m2 - r2 + c2 * _2;
5341
- return [(c2 = a2 * h2) * d2 - (l2 = n2 * o2) * f2, c2 * f2 + l2 * d2];
5370
+ for (var i2, r2, a2 = Math.sin(e2), n2 = Math.cos(e2), o2 = ms(s2), h2 = xs(s2), c2 = 2 * n2 * h2, l2 = -2 * a2 * o2, u2 = t2.length - 1, d2 = t2[u2], _2 = 0, m2 = 0, p2 = 0; --u2 >= 0; )
5371
+ i2 = m2, r2 = _2, d2 = c2 * (m2 = d2) - i2 - l2 * (_2 = p2) + t2[u2], p2 = l2 * m2 - r2 + c2 * _2;
5372
+ return [(c2 = a2 * h2) * d2 - (l2 = n2 * o2) * p2, c2 * p2 + l2 * d2];
5342
5373
  }
5343
5374
  function Ss() {
5344
5375
  if (!this.approx && (isNaN(this.es) || this.es <= 0))
@@ -5350,10 +5381,10 @@ proj4Src.exports = function() {
5350
5381
  this.Zb = -this.Qn * (i2 + Ms(this.gtu, 2 * i2));
5351
5382
  }
5352
5383
  function Cs(t2) {
5353
- var e2 = pt(t2.x - this.long0), s2 = t2.y;
5384
+ var e2 = ft(t2.x - this.long0), s2 = t2.y;
5354
5385
  s2 = gs(this.cbg, s2);
5355
5386
  var i2 = Math.sin(s2), r2 = Math.cos(s2), a2 = Math.sin(e2), n2 = Math.cos(e2);
5356
- s2 = Math.atan2(i2, n2 * r2), e2 = Math.atan2(a2 * r2, fs(i2, r2 * n2)), e2 = ys(Math.tan(e2));
5387
+ s2 = Math.atan2(i2, n2 * r2), e2 = Math.atan2(a2 * r2, ps(i2, r2 * n2)), e2 = ys(Math.tan(e2));
5357
5388
  var o2, h2, c2 = ws(this.gtu, 2 * s2, 2 * e2);
5358
5389
  return s2 += c2[0], e2 += c2[1], Math.abs(e2) <= 2.623395162778 ? (o2 = this.a * (this.Qn * e2) + this.x0, h2 = this.a * (this.Qn * s2 + this.Zb) + this.y0) : (o2 = 1 / 0, h2 = 1 / 0), t2.x = o2, t2.y = h2, t2;
5359
5390
  }
@@ -5363,7 +5394,7 @@ proj4Src.exports = function() {
5363
5394
  var a2 = ws(this.utg, 2 * r2, 2 * i2);
5364
5395
  r2 += a2[0], i2 += a2[1], i2 = Math.atan(ms(i2));
5365
5396
  var n2 = Math.sin(r2), o2 = Math.cos(r2), h2 = Math.sin(i2), c2 = Math.cos(i2);
5366
- r2 = Math.atan2(n2 * c2, fs(h2, c2 * o2)), e2 = pt((i2 = Math.atan2(h2, c2 * o2)) + this.long0), s2 = gs(this.cgb, r2);
5397
+ r2 = Math.atan2(n2 * c2, ps(h2, c2 * o2)), e2 = ft((i2 = Math.atan2(h2, c2 * o2)) + this.long0), s2 = gs(this.cgb, r2);
5367
5398
  } else
5368
5399
  e2 = 1 / 0, s2 = 1 / 0;
5369
5400
  return t2.x = e2, t2.y = s2, t2;
@@ -5371,7 +5402,7 @@ proj4Src.exports = function() {
5371
5402
  var Ps = { init: Ss, forward: Cs, inverse: Es, names: ["Extended_Transverse_Mercator", "Extended Transverse Mercator", "etmerc", "Transverse_Mercator", "Transverse Mercator", "Gauss Kruger", "Gauss_Kruger", "tmerc"] };
5372
5403
  function bs(t2, e2) {
5373
5404
  if (void 0 === t2) {
5374
- if ((t2 = Math.floor(30 * (pt(e2) + Math.PI) / Math.PI) + 1) < 0)
5405
+ if ((t2 = Math.floor(30 * (ft(e2) + Math.PI) / Math.PI) + 1) < 0)
5375
5406
  return 0;
5376
5407
  if (t2 > 60)
5377
5408
  return 60;
@@ -5382,7 +5413,7 @@ proj4Src.exports = function() {
5382
5413
  var t2 = bs(this.zone, this.long0);
5383
5414
  if (void 0 === t2)
5384
5415
  throw new Error("unknown utm zone");
5385
- this.lat0 = 0, this.long0 = (6 * Math.abs(t2) - 183) * f, this.x0 = 5e5, this.y0 = this.utmSouth ? 1e7 : 0, this.k0 = 0.9996, Ps.init.apply(this), this.forward = Ps.forward, this.inverse = Ps.inverse;
5416
+ this.lat0 = 0, this.long0 = (6 * Math.abs(t2) - 183) * p, this.x0 = 5e5, this.y0 = this.utmSouth ? 1e7 : 0, this.k0 = 0.9996, Ps.init.apply(this), this.forward = Ps.forward, this.inverse = Ps.inverse;
5386
5417
  }
5387
5418
  var As = { init: vs, names: ["Universal Transverse Mercator System", "utm"], dependsOn: "etmerc" };
5388
5419
  function Ts(t2, e2) {
@@ -5408,26 +5439,26 @@ proj4Src.exports = function() {
5408
5439
  }
5409
5440
  function Ls(t2) {
5410
5441
  var e2, s2, i2, r2;
5411
- return t2.x = pt(t2.x - this.long0), Gs.forward.apply(this, [t2]), e2 = Math.sin(t2.y), s2 = Math.cos(t2.y), i2 = Math.cos(t2.x), r2 = this.k0 * this.R2 / (1 + this.sinc0 * e2 + this.cosc0 * s2 * i2), t2.x = r2 * s2 * Math.sin(t2.x), t2.y = r2 * (this.cosc0 * e2 - this.sinc0 * s2 * i2), t2.x = this.a * t2.x + this.x0, t2.y = this.a * t2.y + this.y0, t2;
5442
+ return t2.x = ft(t2.x - this.long0), Gs.forward.apply(this, [t2]), e2 = Math.sin(t2.y), s2 = Math.cos(t2.y), i2 = Math.cos(t2.x), r2 = this.k0 * this.R2 / (1 + this.sinc0 * e2 + this.cosc0 * s2 * i2), t2.x = r2 * s2 * Math.sin(t2.x), t2.y = r2 * (this.cosc0 * e2 - this.sinc0 * s2 * i2), t2.x = this.a * t2.x + this.x0, t2.y = this.a * t2.y + this.y0, t2;
5412
5443
  }
5413
5444
  function $s(t2) {
5414
5445
  var e2, s2, i2, r2, a2;
5415
- if (t2.x = (t2.x - this.x0) / this.a, t2.y = (t2.y - this.y0) / this.a, t2.x /= this.k0, t2.y /= this.k0, a2 = fs(t2.x, t2.y)) {
5446
+ if (t2.x = (t2.x - this.x0) / this.a, t2.y = (t2.y - this.y0) / this.a, t2.x /= this.k0, t2.y /= this.k0, a2 = ps(t2.x, t2.y)) {
5416
5447
  var n2 = 2 * Math.atan2(a2, this.R2);
5417
5448
  e2 = Math.sin(n2), s2 = Math.cos(n2), r2 = Math.asin(s2 * this.sinc0 + t2.y * e2 * this.cosc0 / a2), i2 = Math.atan2(t2.x * e2, a2 * this.cosc0 * s2 - t2.y * this.sinc0 * e2);
5418
5449
  } else
5419
5450
  r2 = this.phic0, i2 = 0;
5420
- return t2.x = i2, t2.y = r2, Gs.inverse.apply(this, [t2]), t2.x = pt(t2.x + this.long0), t2;
5451
+ return t2.x = i2, t2.y = r2, Gs.inverse.apply(this, [t2]), t2.x = ft(t2.x + this.long0), t2;
5421
5452
  }
5422
5453
  var Vs = { init: Rs, forward: Ls, inverse: $s, names: ["Stereographic_North_Pole", "Oblique_Stereographic", "sterea", "Oblique Stereographic Alternative", "Double_Stereographic"] };
5423
5454
  function qs(t2, e2, s2) {
5424
5455
  return e2 *= s2, Math.tan(0.5 * (l + t2)) * Math.pow((1 - e2) / (1 + e2), 0.5 * s2);
5425
5456
  }
5426
5457
  function js() {
5427
- this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.coslat0 = Math.cos(this.lat0), this.sinlat0 = Math.sin(this.lat0), this.sphere ? 1 === this.k0 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= m && (this.k0 = 0.5 * (1 + ft(this.lat0) * Math.sin(this.lat_ts))) : (Math.abs(this.coslat0) <= m && (this.lat0 > 0 ? this.con = 1 : this.con = -1), this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e)), 1 === this.k0 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= m && Math.abs(Math.cos(this.lat_ts)) > m && (this.k0 = 0.5 * this.cons * mt(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / yt(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts))), this.ms1 = mt(this.e, this.sinlat0, this.coslat0), this.X0 = 2 * Math.atan(this.ssfn_(this.lat0, this.sinlat0, this.e)) - l, this.cosX0 = Math.cos(this.X0), this.sinX0 = Math.sin(this.X0));
5458
+ this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.coslat0 = Math.cos(this.lat0), this.sinlat0 = Math.sin(this.lat0), this.sphere ? 1 === this.k0 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= m && (this.k0 = 0.5 * (1 + pt(this.lat0) * Math.sin(this.lat_ts))) : (Math.abs(this.coslat0) <= m && (this.lat0 > 0 ? this.con = 1 : this.con = -1), this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e)), 1 === this.k0 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= m && Math.abs(Math.cos(this.lat_ts)) > m && (this.k0 = 0.5 * this.cons * mt(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / yt(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts))), this.ms1 = mt(this.e, this.sinlat0, this.coslat0), this.X0 = 2 * Math.atan(this.ssfn_(this.lat0, this.sinlat0, this.e)) - l, this.cosX0 = Math.cos(this.X0), this.sinX0 = Math.sin(this.X0));
5428
5459
  }
5429
5460
  function Ds(t2) {
5430
- var e2, s2, i2, r2, a2, n2, o2 = t2.x, h2 = t2.y, c2 = Math.sin(h2), u2 = Math.cos(h2), d2 = pt(o2 - this.long0);
5461
+ var e2, s2, i2, r2, a2, n2, o2 = t2.x, h2 = t2.y, c2 = Math.sin(h2), u2 = Math.cos(h2), d2 = ft(o2 - this.long0);
5431
5462
  return Math.abs(Math.abs(o2 - this.long0) - Math.PI) <= m && Math.abs(h2 + this.lat0) <= m ? (t2.x = NaN, t2.y = NaN, t2) : this.sphere ? (e2 = 2 * this.k0 / (1 + this.sinlat0 * c2 + this.coslat0 * u2 * Math.cos(d2)), t2.x = this.a * e2 * u2 * Math.sin(d2) + this.x0, t2.y = this.a * e2 * (this.coslat0 * c2 - this.sinlat0 * u2 * Math.cos(d2)) + this.y0, t2) : (s2 = 2 * Math.atan(this.ssfn_(h2, c2, this.e)) - l, r2 = Math.cos(s2), i2 = Math.sin(s2), Math.abs(this.coslat0) <= m ? (a2 = yt(this.e, h2 * this.con, this.con * c2), n2 = 2 * this.a * this.k0 * a2 / this.cons, t2.x = this.x0 + n2 * Math.sin(o2 - this.long0), t2.y = this.y0 - this.con * n2 * Math.cos(o2 - this.long0), t2) : (Math.abs(this.sinlat0) < m ? (e2 = 2 * this.a * this.k0 / (1 + r2 * Math.cos(d2)), t2.y = e2 * i2) : (e2 = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * i2 + this.cosX0 * r2 * Math.cos(d2))), t2.y = e2 * (this.cosX0 * i2 - this.sinX0 * r2 * Math.cos(d2)) + this.y0), t2.x = e2 * r2 * Math.sin(d2) + this.x0, t2));
5432
5463
  }
5433
5464
  function Bs(t2) {
@@ -5436,14 +5467,14 @@ proj4Src.exports = function() {
5436
5467
  var n2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y);
5437
5468
  if (this.sphere) {
5438
5469
  var o2 = 2 * Math.atan(n2 / (2 * this.a * this.k0));
5439
- return e2 = this.long0, s2 = this.lat0, n2 <= m ? (t2.x = e2, t2.y = s2, t2) : (s2 = Math.asin(Math.cos(o2) * this.sinlat0 + t2.y * Math.sin(o2) * this.coslat0 / n2), e2 = Math.abs(this.coslat0) < m ? this.lat0 > 0 ? pt(this.long0 + Math.atan2(t2.x, -1 * t2.y)) : pt(this.long0 + Math.atan2(t2.x, t2.y)) : pt(this.long0 + Math.atan2(t2.x * Math.sin(o2), n2 * this.coslat0 * Math.cos(o2) - t2.y * this.sinlat0 * Math.sin(o2))), t2.x = e2, t2.y = s2, t2);
5470
+ return e2 = this.long0, s2 = this.lat0, n2 <= m ? (t2.x = e2, t2.y = s2, t2) : (s2 = Math.asin(Math.cos(o2) * this.sinlat0 + t2.y * Math.sin(o2) * this.coslat0 / n2), e2 = Math.abs(this.coslat0) < m ? this.lat0 > 0 ? ft(this.long0 + Math.atan2(t2.x, -1 * t2.y)) : ft(this.long0 + Math.atan2(t2.x, t2.y)) : ft(this.long0 + Math.atan2(t2.x * Math.sin(o2), n2 * this.coslat0 * Math.cos(o2) - t2.y * this.sinlat0 * Math.sin(o2))), t2.x = e2, t2.y = s2, t2);
5440
5471
  }
5441
5472
  if (Math.abs(this.coslat0) <= m) {
5442
5473
  if (n2 <= m)
5443
5474
  return s2 = this.lat0, e2 = this.long0, t2.x = e2, t2.y = s2, t2;
5444
- t2.x *= this.con, t2.y *= this.con, i2 = n2 * this.cons / (2 * this.a * this.k0), s2 = this.con * gt(this.e, i2), e2 = this.con * pt(this.con * this.long0 + Math.atan2(t2.x, -1 * t2.y));
5475
+ t2.x *= this.con, t2.y *= this.con, i2 = n2 * this.cons / (2 * this.a * this.k0), s2 = this.con * gt(this.e, i2), e2 = this.con * ft(this.con * this.long0 + Math.atan2(t2.x, -1 * t2.y));
5445
5476
  } else
5446
- r2 = 2 * Math.atan(n2 * this.cosX0 / (2 * this.a * this.k0 * this.ms1)), e2 = this.long0, n2 <= m ? a2 = this.X0 : (a2 = Math.asin(Math.cos(r2) * this.sinX0 + t2.y * Math.sin(r2) * this.cosX0 / n2), e2 = pt(this.long0 + Math.atan2(t2.x * Math.sin(r2), n2 * this.cosX0 * Math.cos(r2) - t2.y * this.sinX0 * Math.sin(r2)))), s2 = -1 * gt(this.e, Math.tan(0.5 * (l + a2)));
5477
+ r2 = 2 * Math.atan(n2 * this.cosX0 / (2 * this.a * this.k0 * this.ms1)), e2 = this.long0, n2 <= m ? a2 = this.X0 : (a2 = Math.asin(Math.cos(r2) * this.sinX0 + t2.y * Math.sin(r2) * this.cosX0 / n2), e2 = ft(this.long0 + Math.atan2(t2.x * Math.sin(r2), n2 * this.cosX0 * Math.cos(r2) - t2.y * this.sinX0 * Math.sin(r2)))), s2 = -1 * gt(this.e, Math.tan(0.5 * (l + a2)));
5447
5478
  return t2.x = e2, t2.y = s2, t2;
5448
5479
  }
5449
5480
  var ks = { init: js, forward: Ds, inverse: Bs, names: ["stere", "Stereographic_South_Pole", "Polar_Stereographic_variant_A", "Polar_Stereographic_variant_B", "Polar_Stereographic"], ssfn_: qs };
@@ -5473,17 +5504,17 @@ proj4Src.exports = function() {
5473
5504
  return "no_uoff" in t2 || "no_off" in t2 || -1 !== e2.indexOf(s2) || -1 !== e2.indexOf(At(s2));
5474
5505
  }
5475
5506
  function Hs() {
5476
- var t2, e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2 = 0, _2 = 0, f2 = 0, p2 = 0, M2 = 0, x2 = 0, w2 = 0;
5507
+ var t2, e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2 = 0, _2 = 0, p2 = 0, f2 = 0, M2 = 0, x2 = 0, w2 = 0;
5477
5508
  this.no_off = Xs(this), this.no_rot = "no_rot" in this;
5478
5509
  var S2 = false;
5479
5510
  "alpha" in this && (S2 = true);
5480
5511
  var C2 = false;
5481
5512
  if ("rectified_grid_angle" in this && (C2 = true), S2 && (w2 = this.alpha), C2 && (d2 = this.rectified_grid_angle), S2 || C2)
5482
5513
  _2 = this.longc;
5483
- else if (f2 = this.long1, M2 = this.lat1, p2 = this.long2, x2 = this.lat2, Math.abs(M2 - x2) <= Qs || (t2 = Math.abs(M2)) <= Qs || Math.abs(t2 - l) <= Qs || Math.abs(Math.abs(this.lat0) - l) <= Qs || Math.abs(Math.abs(x2) - l) <= Qs)
5514
+ else if (p2 = this.long1, M2 = this.lat1, f2 = this.long2, x2 = this.lat2, Math.abs(M2 - x2) <= Qs || (t2 = Math.abs(M2)) <= Qs || Math.abs(t2 - l) <= Qs || Math.abs(Math.abs(this.lat0) - l) <= Qs || Math.abs(Math.abs(x2) - l) <= Qs)
5484
5515
  throw new Error();
5485
5516
  var E2 = 1 - this.es;
5486
- e2 = Math.sqrt(E2), Math.abs(this.lat0) > m ? (o2 = Math.sin(this.lat0), s2 = Math.cos(this.lat0), t2 = 1 - this.es * o2 * o2, this.B = s2 * s2, this.B = Math.sqrt(1 + this.es * this.B * this.B / E2), this.A = this.B * this.k0 * e2 / t2, (r2 = (i2 = this.B * e2 / (s2 * Math.sqrt(t2))) * i2 - 1) <= 0 ? r2 = 0 : (r2 = Math.sqrt(r2), this.lat0 < 0 && (r2 = -r2)), this.E = r2 += i2, this.E *= Math.pow(yt(this.e, this.lat0, o2), this.B)) : (this.B = 1 / e2, this.A = this.k0, this.E = i2 = r2 = 1), S2 || C2 ? (S2 ? (u2 = Math.asin(Math.sin(w2) / i2), C2 || (d2 = w2)) : (u2 = d2, w2 = Math.asin(i2 * Math.sin(u2))), this.lam0 = _2 - Math.asin(0.5 * (r2 - 1 / r2) * Math.tan(u2)) / this.B) : (a2 = Math.pow(yt(this.e, M2, Math.sin(M2)), this.B), n2 = Math.pow(yt(this.e, x2, Math.sin(x2)), this.B), r2 = this.E / a2, h2 = (n2 - a2) / (n2 + a2), c2 = ((c2 = this.E * this.E) - n2 * a2) / (c2 + n2 * a2), (t2 = f2 - p2) < -Math.pi ? p2 -= g : t2 > Math.pi && (p2 += g), this.lam0 = pt(0.5 * (f2 + p2) - Math.atan(c2 * Math.tan(0.5 * this.B * (f2 - p2)) / h2) / this.B), u2 = Math.atan(2 * Math.sin(this.B * pt(f2 - this.lam0)) / (r2 - 1 / r2)), d2 = w2 = Math.asin(i2 * Math.sin(u2))), this.singam = Math.sin(u2), this.cosgam = Math.cos(u2), this.sinrot = Math.sin(d2), this.cosrot = Math.cos(d2), this.rB = 1 / this.B, this.ArB = this.A * this.rB, this.BrA = 1 / this.ArB, this.no_off ? this.u_0 = 0 : (this.u_0 = Math.abs(this.ArB * Math.atan(Math.sqrt(i2 * i2 - 1) / Math.cos(w2))), this.lat0 < 0 && (this.u_0 = -this.u_0)), r2 = 0.5 * u2, this.v_pole_n = this.ArB * Math.log(Math.tan(y - r2)), this.v_pole_s = this.ArB * Math.log(Math.tan(y + r2));
5517
+ e2 = Math.sqrt(E2), Math.abs(this.lat0) > m ? (o2 = Math.sin(this.lat0), s2 = Math.cos(this.lat0), t2 = 1 - this.es * o2 * o2, this.B = s2 * s2, this.B = Math.sqrt(1 + this.es * this.B * this.B / E2), this.A = this.B * this.k0 * e2 / t2, (r2 = (i2 = this.B * e2 / (s2 * Math.sqrt(t2))) * i2 - 1) <= 0 ? r2 = 0 : (r2 = Math.sqrt(r2), this.lat0 < 0 && (r2 = -r2)), this.E = r2 += i2, this.E *= Math.pow(yt(this.e, this.lat0, o2), this.B)) : (this.B = 1 / e2, this.A = this.k0, this.E = i2 = r2 = 1), S2 || C2 ? (S2 ? (u2 = Math.asin(Math.sin(w2) / i2), C2 || (d2 = w2)) : (u2 = d2, w2 = Math.asin(i2 * Math.sin(u2))), this.lam0 = _2 - Math.asin(0.5 * (r2 - 1 / r2) * Math.tan(u2)) / this.B) : (a2 = Math.pow(yt(this.e, M2, Math.sin(M2)), this.B), n2 = Math.pow(yt(this.e, x2, Math.sin(x2)), this.B), r2 = this.E / a2, h2 = (n2 - a2) / (n2 + a2), c2 = ((c2 = this.E * this.E) - n2 * a2) / (c2 + n2 * a2), (t2 = p2 - f2) < -Math.pi ? f2 -= g : t2 > Math.pi && (f2 += g), this.lam0 = ft(0.5 * (p2 + f2) - Math.atan(c2 * Math.tan(0.5 * this.B * (p2 - f2)) / h2) / this.B), u2 = Math.atan(2 * Math.sin(this.B * ft(p2 - this.lam0)) / (r2 - 1 / r2)), d2 = w2 = Math.asin(i2 * Math.sin(u2))), this.singam = Math.sin(u2), this.cosgam = Math.cos(u2), this.sinrot = Math.sin(d2), this.cosrot = Math.cos(d2), this.rB = 1 / this.B, this.ArB = this.A * this.rB, this.BrA = 1 / this.ArB, this.no_off ? this.u_0 = 0 : (this.u_0 = Math.abs(this.ArB * Math.atan(Math.sqrt(i2 * i2 - 1) / Math.cos(w2))), this.lat0 < 0 && (this.u_0 = -this.u_0)), r2 = 0.5 * u2, this.v_pole_n = this.ArB * Math.log(Math.tan(y - r2)), this.v_pole_s = this.ArB * Math.log(Math.tan(y + r2));
5487
5518
  }
5488
5519
  function Zs(t2) {
5489
5520
  var e2, s2, i2, r2, a2, n2, o2, h2, c2 = {};
@@ -5517,7 +5548,7 @@ proj4Src.exports = function() {
5517
5548
  }
5518
5549
  function ei(t2) {
5519
5550
  var e2 = t2.x, s2 = t2.y;
5520
- Math.abs(2 * Math.abs(s2) - Math.PI) <= m && (s2 = ft(s2) * (l - 2 * m));
5551
+ Math.abs(2 * Math.abs(s2) - Math.PI) <= m && (s2 = pt(s2) * (l - 2 * m));
5521
5552
  var i2, r2, a2 = Math.abs(Math.abs(s2) - l);
5522
5553
  if (a2 > m)
5523
5554
  i2 = yt(this.e, s2, Math.sin(s2)), r2 = this.a * this.f0 * Math.pow(i2, this.ns);
@@ -5526,7 +5557,7 @@ proj4Src.exports = function() {
5526
5557
  return null;
5527
5558
  r2 = 0;
5528
5559
  }
5529
- var n2 = this.ns * pt(e2 - this.long0);
5560
+ var n2 = this.ns * ft(e2 - this.long0);
5530
5561
  return t2.x = this.k0 * (r2 * Math.sin(n2)) + this.x0, t2.y = this.k0 * (this.rh - r2 * Math.cos(n2)) + this.y0, t2;
5531
5562
  }
5532
5563
  function si(t2) {
@@ -5538,14 +5569,14 @@ proj4Src.exports = function() {
5538
5569
  return null;
5539
5570
  } else
5540
5571
  r2 = -l;
5541
- return a2 = pt(h2 / this.ns + this.long0), t2.x = a2, t2.y = r2, t2;
5572
+ return a2 = ft(h2 / this.ns + this.long0), t2.x = a2, t2.y = r2, t2;
5542
5573
  }
5543
5574
  var ii = { init: ti, forward: ei, inverse: si, names: ["Lambert Tangential Conformal Conic Projection", "Lambert_Conformal_Conic", "Lambert_Conformal_Conic_1SP", "Lambert_Conformal_Conic_2SP", "lcc", "Lambert Conic Conformal (1SP)", "Lambert Conic Conformal (2SP)"] };
5544
5575
  function ri() {
5545
5576
  this.a = 6377397155e-3, this.es = 0.006674372230614, this.e = Math.sqrt(this.es), this.lat0 || (this.lat0 = 0.863937979737193), this.long0 || (this.long0 = 0.4334234309119251), this.k0 || (this.k0 = 0.9999), this.s45 = 0.785398163397448, this.s90 = 2 * this.s45, this.fi0 = this.lat0, this.e2 = this.es, this.e = Math.sqrt(this.e2), this.alfa = Math.sqrt(1 + this.e2 * Math.pow(Math.cos(this.fi0), 4) / (1 - this.e2)), this.uq = 1.04216856380474, this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa), this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2), this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g, this.k1 = this.k0, this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2)), this.s0 = 1.37008346281555, this.n = Math.sin(this.s0), this.ro0 = this.k1 * this.n0 / Math.tan(this.s0), this.ad = this.s90 - this.uq;
5546
5577
  }
5547
5578
  function ai(t2) {
5548
- var e2, s2, i2, r2, a2, n2, o2, h2 = t2.x, c2 = t2.y, l2 = pt(h2 - this.long0);
5579
+ var e2, s2, i2, r2, a2, n2, o2, h2 = t2.x, c2 = t2.y, l2 = ft(h2 - this.long0);
5549
5580
  return e2 = Math.pow((1 + this.e * Math.sin(c2)) / (1 - this.e * Math.sin(c2)), this.alfa * this.e / 2), s2 = 2 * (Math.atan(this.k * Math.pow(Math.tan(c2 / 2 + this.s45), this.alfa) / e2) - this.s45), i2 = -l2 * this.alfa, r2 = Math.asin(Math.cos(this.ad) * Math.sin(s2) + Math.sin(this.ad) * Math.cos(s2) * Math.cos(i2)), a2 = Math.asin(Math.cos(s2) * Math.sin(i2) / Math.cos(r2)), n2 = this.n * a2, o2 = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(r2 / 2 + this.s45), this.n), t2.y = o2 * Math.cos(n2) / 1, t2.x = o2 * Math.sin(n2) / 1, this.czech || (t2.y *= -1, t2.x *= -1), t2;
5550
5581
  }
5551
5582
  function ni(t2) {
@@ -5578,9 +5609,9 @@ proj4Src.exports = function() {
5578
5609
  return t2 / Math.sqrt(1 - i2 * i2);
5579
5610
  }
5580
5611
  function mi(t2) {
5581
- return Math.abs(t2) < l ? t2 : t2 - ft(t2) * Math.PI;
5612
+ return Math.abs(t2) < l ? t2 : t2 - pt(t2) * Math.PI;
5582
5613
  }
5583
- function fi(t2, e2, s2, i2, r2) {
5614
+ function pi(t2, e2, s2, i2, r2) {
5584
5615
  var a2, n2;
5585
5616
  a2 = t2 / e2;
5586
5617
  for (var o2 = 0; o2 < 15; o2++)
@@ -5588,12 +5619,12 @@ proj4Src.exports = function() {
5588
5619
  return a2;
5589
5620
  return NaN;
5590
5621
  }
5591
- function pi() {
5622
+ function fi() {
5592
5623
  this.sphere || (this.e0 = ci(this.es), this.e1 = li(this.es), this.e2 = ui(this.es), this.e3 = di(this.es), this.ml0 = this.a * hi(this.e0, this.e1, this.e2, this.e3, this.lat0));
5593
5624
  }
5594
5625
  function yi(t2) {
5595
5626
  var e2, s2, i2 = t2.x, r2 = t2.y;
5596
- if (i2 = pt(i2 - this.long0), this.sphere)
5627
+ if (i2 = ft(i2 - this.long0), this.sphere)
5597
5628
  e2 = this.a * Math.asin(Math.cos(r2) * Math.sin(i2)), s2 = this.a * (Math.atan2(Math.tan(r2), Math.cos(i2)) - this.lat0);
5598
5629
  else {
5599
5630
  var a2 = Math.sin(r2), n2 = Math.cos(r2), o2 = _i(this.a, this.e, a2), h2 = Math.tan(r2) * Math.tan(r2), c2 = i2 * Math.cos(r2), l2 = c2 * c2, u2 = this.es * n2 * n2 / (1 - this.es);
@@ -5608,15 +5639,15 @@ proj4Src.exports = function() {
5608
5639
  var a2 = r2 + this.lat0;
5609
5640
  e2 = Math.asin(Math.sin(a2) * Math.cos(i2)), s2 = Math.atan2(Math.tan(i2), Math.cos(a2));
5610
5641
  } else {
5611
- var n2 = fi(this.ml0 / this.a + r2, this.e0, this.e1, this.e2, this.e3);
5642
+ var n2 = pi(this.ml0 / this.a + r2, this.e0, this.e1, this.e2, this.e3);
5612
5643
  if (Math.abs(Math.abs(n2) - l) <= m)
5613
5644
  return t2.x = this.long0, t2.y = l, r2 < 0 && (t2.y *= -1), t2;
5614
5645
  var o2 = _i(this.a, this.e, Math.sin(n2)), h2 = o2 * o2 * o2 / this.a / this.a * (1 - this.es), c2 = Math.pow(Math.tan(n2), 2), u2 = i2 * this.a / o2, d2 = u2 * u2;
5615
5646
  e2 = n2 - o2 * Math.tan(n2) / h2 * u2 * u2 * (0.5 - (1 + 3 * c2) * u2 * u2 / 24), s2 = u2 * (1 - d2 * (c2 / 3 + (1 + 3 * c2) * c2 * d2 / 15)) / Math.cos(n2);
5616
5647
  }
5617
- return t2.x = pt(s2 + this.long0), t2.y = mi(e2), t2;
5648
+ return t2.x = ft(s2 + this.long0), t2.y = mi(e2), t2;
5618
5649
  }
5619
- var Mi = { init: pi, forward: yi, inverse: gi, names: ["Cassini", "Cassini_Soldner", "cass"] };
5650
+ var Mi = { init: fi, forward: yi, inverse: gi, names: ["Cassini", "Cassini_Soldner", "cass"] };
5620
5651
  function xi(t2, e2) {
5621
5652
  var s2;
5622
5653
  return t2 > 1e-7 ? (1 - t2 * t2) * (e2 / (1 - (s2 = t2 * e2) * s2) - 0.5 / t2 * Math.log((1 - s2) / (1 + s2))) : 2 * e2;
@@ -5640,7 +5671,7 @@ proj4Src.exports = function() {
5640
5671
  }
5641
5672
  function Si(t2) {
5642
5673
  var e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2 = t2.x, _2 = t2.y;
5643
- if (d2 = pt(d2 - this.long0), this.sphere) {
5674
+ if (d2 = ft(d2 - this.long0), this.sphere) {
5644
5675
  if (a2 = Math.sin(_2), u2 = Math.cos(_2), i2 = Math.cos(d2), this.mode === this.OBLIQ || this.mode === this.EQUIT) {
5645
5676
  if ((s2 = this.mode === this.EQUIT ? 1 + u2 * i2 : 1 + this.sinph0 * a2 + this.cosph0 * u2 * i2) <= m)
5646
5677
  return null;
@@ -5711,7 +5742,7 @@ proj4Src.exports = function() {
5711
5742
  }
5712
5743
  e2 = Math.atan2(h2, c2), s2 = zi(Math.asin(o2), this.apa);
5713
5744
  }
5714
- return t2.x = pt(this.long0 + e2), t2.y = s2, t2;
5745
+ return t2.x = ft(this.long0 + e2), t2.y = s2, t2;
5715
5746
  }
5716
5747
  var Ei = 0.3333333333333333, Pi = 0.17222222222222222, bi = 0.10257936507936508, vi = 0.06388888888888888, Ai = 0.0664021164021164, Ti = 0.016415012942191543;
5717
5748
  function Ii(t2) {
@@ -5732,12 +5763,12 @@ proj4Src.exports = function() {
5732
5763
  function Ri(t2) {
5733
5764
  var e2 = t2.x, s2 = t2.y;
5734
5765
  this.sin_phi = Math.sin(s2), this.cos_phi = Math.cos(s2);
5735
- var i2 = xi(this.e3, this.sin_phi), r2 = this.a * Math.sqrt(this.c - this.ns0 * i2) / this.ns0, a2 = this.ns0 * pt(e2 - this.long0), n2 = r2 * Math.sin(a2) + this.x0, o2 = this.rh - r2 * Math.cos(a2) + this.y0;
5766
+ var i2 = xi(this.e3, this.sin_phi), r2 = this.a * Math.sqrt(this.c - this.ns0 * i2) / this.ns0, a2 = this.ns0 * ft(e2 - this.long0), n2 = r2 * Math.sin(a2) + this.x0, o2 = this.rh - r2 * Math.cos(a2) + this.y0;
5736
5767
  return t2.x = n2, t2.y = o2, t2;
5737
5768
  }
5738
5769
  function Li(t2) {
5739
5770
  var e2, s2, i2, r2, a2, n2;
5740
- return t2.x -= this.x0, t2.y = this.rh - t2.y + this.y0, this.ns0 >= 0 ? (e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y), i2 = 1) : (e2 = -Math.sqrt(t2.x * t2.x + t2.y * t2.y), i2 = -1), r2 = 0, 0 !== e2 && (r2 = Math.atan2(i2 * t2.x, i2 * t2.y)), i2 = e2 * this.ns0 / this.a, this.sphere ? n2 = Math.asin((this.c - i2 * i2) / (2 * this.ns0)) : (s2 = (this.c - i2 * i2) / this.ns0, n2 = this.phi1z(this.e3, s2)), a2 = pt(r2 / this.ns0 + this.long0), t2.x = a2, t2.y = n2, t2;
5771
+ return t2.x -= this.x0, t2.y = this.rh - t2.y + this.y0, this.ns0 >= 0 ? (e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y), i2 = 1) : (e2 = -Math.sqrt(t2.x * t2.x + t2.y * t2.y), i2 = -1), r2 = 0, 0 !== e2 && (r2 = Math.atan2(i2 * t2.x, i2 * t2.y)), i2 = e2 * this.ns0 / this.a, this.sphere ? n2 = Math.asin((this.c - i2 * i2) / (2 * this.ns0)) : (s2 = (this.c - i2 * i2) / this.ns0, n2 = this.phi1z(this.e3, s2)), a2 = ft(r2 / this.ns0 + this.long0), t2.x = a2, t2.y = n2, t2;
5741
5772
  }
5742
5773
  function $i(t2, e2) {
5743
5774
  var s2, i2, r2, a2, n2 = Ni(0.5 * e2);
@@ -5754,11 +5785,11 @@ proj4Src.exports = function() {
5754
5785
  }
5755
5786
  function ji(t2) {
5756
5787
  var e2, s2, i2, r2, a2, n2, o2, h2, c2 = t2.x, l2 = t2.y;
5757
- return i2 = pt(c2 - this.long0), e2 = Math.sin(l2), s2 = Math.cos(l2), r2 = Math.cos(i2), a2 = 1, (n2 = this.sin_p14 * e2 + this.cos_p14 * s2 * r2) > 0 || Math.abs(n2) <= m ? (o2 = this.x0 + this.a * a2 * s2 * Math.sin(i2) / n2, h2 = this.y0 + this.a * a2 * (this.cos_p14 * e2 - this.sin_p14 * s2 * r2) / n2) : (o2 = this.x0 + this.infinity_dist * s2 * Math.sin(i2), h2 = this.y0 + this.infinity_dist * (this.cos_p14 * e2 - this.sin_p14 * s2 * r2)), t2.x = o2, t2.y = h2, t2;
5788
+ return i2 = ft(c2 - this.long0), e2 = Math.sin(l2), s2 = Math.cos(l2), r2 = Math.cos(i2), a2 = 1, (n2 = this.sin_p14 * e2 + this.cos_p14 * s2 * r2) > 0 || Math.abs(n2) <= m ? (o2 = this.x0 + this.a * a2 * s2 * Math.sin(i2) / n2, h2 = this.y0 + this.a * a2 * (this.cos_p14 * e2 - this.sin_p14 * s2 * r2) / n2) : (o2 = this.x0 + this.infinity_dist * s2 * Math.sin(i2), h2 = this.y0 + this.infinity_dist * (this.cos_p14 * e2 - this.sin_p14 * s2 * r2)), t2.x = o2, t2.y = h2, t2;
5758
5789
  }
5759
5790
  function Di(t2) {
5760
5791
  var e2, s2, i2, r2, a2, n2;
5761
- return t2.x = (t2.x - this.x0) / this.a, t2.y = (t2.y - this.y0) / this.a, t2.x /= this.k0, t2.y /= this.k0, (e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y)) ? (r2 = Math.atan2(e2, this.rc), s2 = Math.sin(r2), n2 = Ni((i2 = Math.cos(r2)) * this.sin_p14 + t2.y * s2 * this.cos_p14 / e2), a2 = Math.atan2(t2.x * s2, e2 * this.cos_p14 * i2 - t2.y * this.sin_p14 * s2), a2 = pt(this.long0 + a2)) : (n2 = this.phic0, a2 = 0), t2.x = a2, t2.y = n2, t2;
5792
+ return t2.x = (t2.x - this.x0) / this.a, t2.y = (t2.y - this.y0) / this.a, t2.x /= this.k0, t2.y /= this.k0, (e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y)) ? (r2 = Math.atan2(e2, this.rc), s2 = Math.sin(r2), n2 = Ni((i2 = Math.cos(r2)) * this.sin_p14 + t2.y * s2 * this.cos_p14 / e2), a2 = Math.atan2(t2.x * s2, e2 * this.cos_p14 * i2 - t2.y * this.sin_p14 * s2), a2 = ft(this.long0 + a2)) : (n2 = this.phic0, a2 = 0), t2.x = a2, t2.y = n2, t2;
5762
5793
  }
5763
5794
  var Bi = { init: qi, forward: ji, inverse: Di, names: ["gnom"] };
5764
5795
  function ki(t2, e2) {
@@ -5774,7 +5805,7 @@ proj4Src.exports = function() {
5774
5805
  this.sphere || (this.k0 = mt(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)));
5775
5806
  }
5776
5807
  function Ui(t2) {
5777
- var e2, s2, i2 = t2.x, r2 = t2.y, a2 = pt(i2 - this.long0);
5808
+ var e2, s2, i2 = t2.x, r2 = t2.y, a2 = ft(i2 - this.long0);
5778
5809
  if (this.sphere)
5779
5810
  e2 = this.x0 + this.a * a2 * Math.cos(this.lat_ts), s2 = this.y0 + this.a * Math.sin(r2) / Math.cos(this.lat_ts);
5780
5811
  else {
@@ -5785,26 +5816,26 @@ proj4Src.exports = function() {
5785
5816
  }
5786
5817
  function Wi(t2) {
5787
5818
  var e2, s2;
5788
- return t2.x -= this.x0, t2.y -= this.y0, this.sphere ? (e2 = pt(this.long0 + t2.x / this.a / Math.cos(this.lat_ts)), s2 = Math.asin(t2.y / this.a * Math.cos(this.lat_ts))) : (s2 = ki(this.e, 2 * t2.y * this.k0 / this.a), e2 = pt(this.long0 + t2.x / (this.a * this.k0))), t2.x = e2, t2.y = s2, t2;
5819
+ return t2.x -= this.x0, t2.y -= this.y0, this.sphere ? (e2 = ft(this.long0 + t2.x / this.a / Math.cos(this.lat_ts)), s2 = Math.asin(t2.y / this.a * Math.cos(this.lat_ts))) : (s2 = ki(this.e, 2 * t2.y * this.k0 / this.a), e2 = ft(this.long0 + t2.x / (this.a * this.k0))), t2.x = e2, t2.y = s2, t2;
5789
5820
  }
5790
5821
  var Yi = { init: Fi, forward: Ui, inverse: Wi, names: ["cea"] };
5791
5822
  function Qi() {
5792
5823
  this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.lat_ts = this.lat_ts || 0, this.title = this.title || "Equidistant Cylindrical (Plate Carre)", this.rc = Math.cos(this.lat_ts);
5793
5824
  }
5794
5825
  function Xi(t2) {
5795
- var e2 = t2.x, s2 = t2.y, i2 = pt(e2 - this.long0), r2 = mi(s2 - this.lat0);
5826
+ var e2 = t2.x, s2 = t2.y, i2 = ft(e2 - this.long0), r2 = mi(s2 - this.lat0);
5796
5827
  return t2.x = this.x0 + this.a * i2 * this.rc, t2.y = this.y0 + this.a * r2, t2;
5797
5828
  }
5798
5829
  function Hi(t2) {
5799
5830
  var e2 = t2.x, s2 = t2.y;
5800
- return t2.x = pt(this.long0 + (e2 - this.x0) / (this.a * this.rc)), t2.y = mi(this.lat0 + (s2 - this.y0) / this.a), t2;
5831
+ return t2.x = ft(this.long0 + (e2 - this.x0) / (this.a * this.rc)), t2.y = mi(this.lat0 + (s2 - this.y0) / this.a), t2;
5801
5832
  }
5802
5833
  var Zi = { init: Qi, forward: Xi, inverse: Hi, names: ["Equirectangular", "Equidistant_Cylindrical", "Equidistant_Cylindrical_Spherical", "eqc"] }, Ki = 20;
5803
5834
  function Ji() {
5804
5835
  this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = ci(this.es), this.e1 = li(this.es), this.e2 = ui(this.es), this.e3 = di(this.es), this.ml0 = this.a * hi(this.e0, this.e1, this.e2, this.e3, this.lat0);
5805
5836
  }
5806
5837
  function tr(t2) {
5807
- var e2, s2, i2, r2 = t2.x, a2 = t2.y, n2 = pt(r2 - this.long0);
5838
+ var e2, s2, i2, r2 = t2.x, a2 = t2.y, n2 = ft(r2 - this.long0);
5808
5839
  if (i2 = n2 * Math.sin(a2), this.sphere)
5809
5840
  Math.abs(a2) <= m ? (e2 = this.a * n2, s2 = -1 * this.a * this.lat0) : (e2 = this.a * Math.sin(i2) / Math.tan(a2), s2 = this.a * (mi(a2 - this.lat0) + (1 - Math.cos(i2)) / Math.tan(a2)));
5810
5841
  else if (Math.abs(a2) <= m)
@@ -5819,7 +5850,7 @@ proj4Src.exports = function() {
5819
5850
  var e2, s2, i2, r2, a2, n2, o2, h2, c2;
5820
5851
  if (i2 = t2.x - this.x0, r2 = t2.y - this.y0, this.sphere)
5821
5852
  if (Math.abs(r2 + this.a * this.lat0) <= m)
5822
- e2 = pt(i2 / this.a + this.long0), s2 = 0;
5853
+ e2 = ft(i2 / this.a + this.long0), s2 = 0;
5823
5854
  else {
5824
5855
  var l2;
5825
5856
  for (n2 = this.lat0 + r2 / this.a, o2 = i2 * i2 / this.a / this.a + n2 * n2, h2 = n2, a2 = Ki; a2; --a2)
@@ -5827,18 +5858,18 @@ proj4Src.exports = function() {
5827
5858
  s2 = h2;
5828
5859
  break;
5829
5860
  }
5830
- e2 = pt(this.long0 + Math.asin(i2 * Math.tan(h2) / this.a) / Math.sin(s2));
5861
+ e2 = ft(this.long0 + Math.asin(i2 * Math.tan(h2) / this.a) / Math.sin(s2));
5831
5862
  }
5832
5863
  else if (Math.abs(r2 + this.ml0) <= m)
5833
- s2 = 0, e2 = pt(this.long0 + i2 / this.a);
5864
+ s2 = 0, e2 = ft(this.long0 + i2 / this.a);
5834
5865
  else {
5835
- var u2, d2, _2, f2, p2;
5866
+ var u2, d2, _2, p2, f2;
5836
5867
  for (n2 = (this.ml0 + r2) / this.a, o2 = i2 * i2 / this.a / this.a + n2 * n2, h2 = n2, a2 = Ki; a2; --a2)
5837
- if (p2 = this.e * Math.sin(h2), u2 = Math.sqrt(1 - p2 * p2) * Math.tan(h2), d2 = this.a * hi(this.e0, this.e1, this.e2, this.e3, h2), _2 = this.e0 - 2 * this.e1 * Math.cos(2 * h2) + 4 * this.e2 * Math.cos(4 * h2) - 6 * this.e3 * Math.cos(6 * h2), h2 -= c2 = (n2 * (u2 * (f2 = d2 / this.a) + 1) - f2 - 0.5 * u2 * (f2 * f2 + o2)) / (this.es * Math.sin(2 * h2) * (f2 * f2 + o2 - 2 * n2 * f2) / (4 * u2) + (n2 - f2) * (u2 * _2 - 2 / Math.sin(2 * h2)) - _2), Math.abs(c2) <= m) {
5868
+ if (f2 = this.e * Math.sin(h2), u2 = Math.sqrt(1 - f2 * f2) * Math.tan(h2), d2 = this.a * hi(this.e0, this.e1, this.e2, this.e3, h2), _2 = this.e0 - 2 * this.e1 * Math.cos(2 * h2) + 4 * this.e2 * Math.cos(4 * h2) - 6 * this.e3 * Math.cos(6 * h2), h2 -= c2 = (n2 * (u2 * (p2 = d2 / this.a) + 1) - p2 - 0.5 * u2 * (p2 * p2 + o2)) / (this.es * Math.sin(2 * h2) * (p2 * p2 + o2 - 2 * n2 * p2) / (4 * u2) + (n2 - p2) * (u2 * _2 - 2 / Math.sin(2 * h2)) - _2), Math.abs(c2) <= m) {
5838
5869
  s2 = h2;
5839
5870
  break;
5840
5871
  }
5841
- u2 = Math.sqrt(1 - this.es * Math.pow(Math.sin(s2), 2)) * Math.tan(s2), e2 = pt(this.long0 + Math.asin(i2 * u2 / this.a) / Math.sin(s2));
5872
+ u2 = Math.sqrt(1 - this.es * Math.pow(Math.sin(s2), 2)) * Math.tan(s2), e2 = ft(this.long0 + Math.asin(i2 * u2 / this.a) / Math.sin(s2));
5842
5873
  }
5843
5874
  return t2.x = e2, t2.y = s2, t2;
5844
5875
  }
@@ -5850,23 +5881,23 @@ proj4Src.exports = function() {
5850
5881
  var e2, s2 = t2.x, i2 = t2.y - this.lat0, r2 = s2 - this.long0, a2 = i2 / c * 1e-5, n2 = r2, o2 = 1, h2 = 0;
5851
5882
  for (e2 = 1; e2 <= 10; e2++)
5852
5883
  o2 *= a2, h2 += this.A[e2] * o2;
5853
- var l2, u2 = h2, d2 = n2, _2 = 1, m2 = 0, f2 = 0, p2 = 0;
5884
+ var l2, u2 = h2, d2 = n2, _2 = 1, m2 = 0, p2 = 0, f2 = 0;
5854
5885
  for (e2 = 1; e2 <= 6; e2++)
5855
- l2 = m2 * u2 + _2 * d2, _2 = _2 * u2 - m2 * d2, m2 = l2, f2 = f2 + this.B_re[e2] * _2 - this.B_im[e2] * m2, p2 = p2 + this.B_im[e2] * _2 + this.B_re[e2] * m2;
5856
- return t2.x = p2 * this.a + this.x0, t2.y = f2 * this.a + this.y0, t2;
5886
+ l2 = m2 * u2 + _2 * d2, _2 = _2 * u2 - m2 * d2, m2 = l2, p2 = p2 + this.B_re[e2] * _2 - this.B_im[e2] * m2, f2 = f2 + this.B_im[e2] * _2 + this.B_re[e2] * m2;
5887
+ return t2.x = f2 * this.a + this.x0, t2.y = p2 * this.a + this.y0, t2;
5857
5888
  }
5858
5889
  function ar(t2) {
5859
5890
  var e2, s2, i2 = t2.x, r2 = t2.y, a2 = i2 - this.x0, n2 = (r2 - this.y0) / this.a, o2 = a2 / this.a, h2 = 1, l2 = 0, u2 = 0, d2 = 0;
5860
5891
  for (e2 = 1; e2 <= 6; e2++)
5861
5892
  s2 = l2 * n2 + h2 * o2, h2 = h2 * n2 - l2 * o2, l2 = s2, u2 = u2 + this.C_re[e2] * h2 - this.C_im[e2] * l2, d2 = d2 + this.C_im[e2] * h2 + this.C_re[e2] * l2;
5862
5893
  for (var _2 = 0; _2 < this.iterations; _2++) {
5863
- var m2, f2 = u2, p2 = d2, y2 = n2, g2 = o2;
5894
+ var m2, p2 = u2, f2 = d2, y2 = n2, g2 = o2;
5864
5895
  for (e2 = 2; e2 <= 6; e2++)
5865
- m2 = p2 * u2 + f2 * d2, f2 = f2 * u2 - p2 * d2, p2 = m2, y2 += (e2 - 1) * (this.B_re[e2] * f2 - this.B_im[e2] * p2), g2 += (e2 - 1) * (this.B_im[e2] * f2 + this.B_re[e2] * p2);
5866
- f2 = 1, p2 = 0;
5896
+ m2 = f2 * u2 + p2 * d2, p2 = p2 * u2 - f2 * d2, f2 = m2, y2 += (e2 - 1) * (this.B_re[e2] * p2 - this.B_im[e2] * f2), g2 += (e2 - 1) * (this.B_im[e2] * p2 + this.B_re[e2] * f2);
5897
+ p2 = 1, f2 = 0;
5867
5898
  var M2 = this.B_re[1], x2 = this.B_im[1];
5868
5899
  for (e2 = 2; e2 <= 6; e2++)
5869
- m2 = p2 * u2 + f2 * d2, f2 = f2 * u2 - p2 * d2, p2 = m2, M2 += e2 * (this.B_re[e2] * f2 - this.B_im[e2] * p2), x2 += e2 * (this.B_im[e2] * f2 + this.B_re[e2] * p2);
5900
+ m2 = f2 * u2 + p2 * d2, p2 = p2 * u2 - f2 * d2, f2 = m2, M2 += e2 * (this.B_re[e2] * p2 - this.B_im[e2] * f2), x2 += e2 * (this.B_im[e2] * p2 + this.B_re[e2] * f2);
5870
5901
  var w2 = M2 * M2 + x2 * x2;
5871
5902
  u2 = (y2 * M2 + g2 * x2) / w2, d2 = (g2 * M2 - y2 * x2) / w2;
5872
5903
  }
@@ -5880,12 +5911,12 @@ proj4Src.exports = function() {
5880
5911
  function or() {
5881
5912
  }
5882
5913
  function hr(t2) {
5883
- var e2 = t2.x, s2 = t2.y, i2 = pt(e2 - this.long0), r2 = this.x0 + this.a * i2, a2 = this.y0 + this.a * Math.log(Math.tan(Math.PI / 4 + s2 / 2.5)) * 1.25;
5914
+ var e2 = t2.x, s2 = t2.y, i2 = ft(e2 - this.long0), r2 = this.x0 + this.a * i2, a2 = this.y0 + this.a * Math.log(Math.tan(Math.PI / 4 + s2 / 2.5)) * 1.25;
5884
5915
  return t2.x = r2, t2.y = a2, t2;
5885
5916
  }
5886
5917
  function cr(t2) {
5887
5918
  t2.x -= this.x0, t2.y -= this.y0;
5888
- var e2 = pt(this.long0 + t2.x / this.a), s2 = 2.5 * (Math.atan(Math.exp(0.8 * t2.y / this.a)) - Math.PI / 4);
5919
+ var e2 = ft(this.long0 + t2.x / this.a), s2 = 2.5 * (Math.atan(Math.exp(0.8 * t2.y / this.a)) - Math.PI / 4);
5889
5920
  return t2.x = e2, t2.y = s2, t2;
5890
5921
  }
5891
5922
  var lr = { init: or, forward: hr, inverse: cr, names: ["Miller_Cylindrical", "mill"] }, ur = 20;
@@ -5894,7 +5925,7 @@ proj4Src.exports = function() {
5894
5925
  }
5895
5926
  function _r(t2) {
5896
5927
  var e2, s2, i2 = t2.x, r2 = t2.y;
5897
- if (i2 = pt(i2 - this.long0), this.sphere) {
5928
+ if (i2 = ft(i2 - this.long0), this.sphere) {
5898
5929
  if (this.m)
5899
5930
  for (var a2 = this.n * Math.sin(r2), n2 = ur; n2; --n2) {
5900
5931
  var o2 = (this.m * r2 + Math.sin(r2) - a2) / (this.m + Math.cos(r2));
@@ -5912,13 +5943,13 @@ proj4Src.exports = function() {
5912
5943
  }
5913
5944
  function mr(t2) {
5914
5945
  var e2, s2, i2;
5915
- return t2.x -= this.x0, s2 = t2.x / this.a, t2.y -= this.y0, e2 = t2.y / this.a, this.sphere ? (e2 /= this.C_y, s2 /= this.C_x * (this.m + Math.cos(e2)), this.m ? e2 = Ni((this.m * e2 + Math.sin(e2)) / this.n) : 1 !== this.n && (e2 = Ni(Math.sin(e2) / this.n)), s2 = pt(s2 + this.long0), e2 = mi(e2)) : (e2 = cs(t2.y / this.a, this.es, this.en), (i2 = Math.abs(e2)) < l ? (i2 = Math.sin(e2), s2 = pt(this.long0 + t2.x * Math.sqrt(1 - this.es * i2 * i2) / (this.a * Math.cos(e2)))) : i2 - m < l && (s2 = this.long0)), t2.x = s2, t2.y = e2, t2;
5946
+ return t2.x -= this.x0, s2 = t2.x / this.a, t2.y -= this.y0, e2 = t2.y / this.a, this.sphere ? (e2 /= this.C_y, s2 /= this.C_x * (this.m + Math.cos(e2)), this.m ? e2 = Ni((this.m * e2 + Math.sin(e2)) / this.n) : 1 !== this.n && (e2 = Ni(Math.sin(e2) / this.n)), s2 = ft(s2 + this.long0), e2 = mi(e2)) : (e2 = cs(t2.y / this.a, this.es, this.en), (i2 = Math.abs(e2)) < l ? (i2 = Math.sin(e2), s2 = ft(this.long0 + t2.x * Math.sqrt(1 - this.es * i2 * i2) / (this.a * Math.cos(e2)))) : i2 - m < l && (s2 = this.long0)), t2.x = s2, t2.y = e2, t2;
5916
5947
  }
5917
- var fr = { init: dr, forward: _r, inverse: mr, names: ["Sinusoidal", "sinu"] };
5918
- function pr() {
5948
+ var pr = { init: dr, forward: _r, inverse: mr, names: ["Sinusoidal", "sinu"] };
5949
+ function fr() {
5919
5950
  }
5920
5951
  function yr(t2) {
5921
- for (var e2 = t2.x, s2 = t2.y, i2 = pt(e2 - this.long0), r2 = s2, a2 = Math.PI * Math.sin(s2); ; ) {
5952
+ for (var e2 = t2.x, s2 = t2.y, i2 = ft(e2 - this.long0), r2 = s2, a2 = Math.PI * Math.sin(s2); ; ) {
5922
5953
  var n2 = -(r2 + Math.sin(r2) - a2) / (1 + Math.cos(r2));
5923
5954
  if (r2 += n2, Math.abs(n2) < m)
5924
5955
  break;
@@ -5930,12 +5961,12 @@ proj4Src.exports = function() {
5930
5961
  function gr(t2) {
5931
5962
  var e2, s2;
5932
5963
  t2.x -= this.x0, t2.y -= this.y0, s2 = t2.y / (1.4142135623731 * this.a), Math.abs(s2) > 0.999999999999 && (s2 = 0.999999999999), e2 = Math.asin(s2);
5933
- var i2 = pt(this.long0 + t2.x / (0.900316316158 * this.a * Math.cos(e2)));
5964
+ var i2 = ft(this.long0 + t2.x / (0.900316316158 * this.a * Math.cos(e2)));
5934
5965
  i2 < -Math.PI && (i2 = -Math.PI), i2 > Math.PI && (i2 = Math.PI), s2 = (2 * e2 + Math.sin(2 * e2)) / Math.PI, Math.abs(s2) > 1 && (s2 = 1);
5935
5966
  var r2 = Math.asin(s2);
5936
5967
  return t2.x = i2, t2.y = r2, t2;
5937
5968
  }
5938
- var Mr = { init: pr, forward: yr, inverse: gr, names: ["Mollweide", "moll"] };
5969
+ var Mr = { init: fr, forward: yr, inverse: gr, names: ["Mollweide", "moll"] };
5939
5970
  function xr() {
5940
5971
  Math.abs(this.lat1 + this.lat2) < m || (this.lat2 = this.lat2 || this.lat1, this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = ci(this.es), this.e1 = li(this.es), this.e2 = ui(this.es), this.e3 = di(this.es), this.sinphi = Math.sin(this.lat1), this.cosphi = Math.cos(this.lat1), this.ms1 = mt(this.e, this.sinphi, this.cosphi), this.ml1 = hi(this.e0, this.e1, this.e2, this.e3, this.lat1), Math.abs(this.lat1 - this.lat2) < m ? this.ns = this.sinphi : (this.sinphi = Math.sin(this.lat2), this.cosphi = Math.cos(this.lat2), this.ms2 = mt(this.e, this.sinphi, this.cosphi), this.ml2 = hi(this.e0, this.e1, this.e2, this.e3, this.lat2), this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1)), this.g = this.ml1 + this.ms1 / this.ns, this.ml0 = hi(this.e0, this.e1, this.e2, this.e3, this.lat0), this.rh = this.a * (this.g - this.ml0));
5941
5972
  }
@@ -5947,32 +5978,32 @@ proj4Src.exports = function() {
5947
5978
  var r2 = hi(this.e0, this.e1, this.e2, this.e3, i2);
5948
5979
  e2 = this.a * (this.g - r2);
5949
5980
  }
5950
- var a2 = this.ns * pt(s2 - this.long0), n2 = this.x0 + e2 * Math.sin(a2), o2 = this.y0 + this.rh - e2 * Math.cos(a2);
5981
+ var a2 = this.ns * ft(s2 - this.long0), n2 = this.x0 + e2 * Math.sin(a2), o2 = this.y0 + this.rh - e2 * Math.cos(a2);
5951
5982
  return t2.x = n2, t2.y = o2, t2;
5952
5983
  }
5953
5984
  function Sr(t2) {
5954
5985
  var e2, s2, i2, r2;
5955
5986
  t2.x -= this.x0, t2.y = this.rh - t2.y + this.y0, this.ns >= 0 ? (s2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y), e2 = 1) : (s2 = -Math.sqrt(t2.x * t2.x + t2.y * t2.y), e2 = -1);
5956
5987
  var a2 = 0;
5957
- return 0 !== s2 && (a2 = Math.atan2(e2 * t2.x, e2 * t2.y)), this.sphere ? (r2 = pt(this.long0 + a2 / this.ns), i2 = mi(this.g - s2 / this.a), t2.x = r2, t2.y = i2, t2) : (i2 = fi(this.g - s2 / this.a, this.e0, this.e1, this.e2, this.e3), r2 = pt(this.long0 + a2 / this.ns), t2.x = r2, t2.y = i2, t2);
5988
+ return 0 !== s2 && (a2 = Math.atan2(e2 * t2.x, e2 * t2.y)), this.sphere ? (r2 = ft(this.long0 + a2 / this.ns), i2 = mi(this.g - s2 / this.a), t2.x = r2, t2.y = i2, t2) : (i2 = pi(this.g - s2 / this.a, this.e0, this.e1, this.e2, this.e3), r2 = ft(this.long0 + a2 / this.ns), t2.x = r2, t2.y = i2, t2);
5958
5989
  }
5959
5990
  var Cr = { init: xr, forward: wr, inverse: Sr, names: ["Equidistant_Conic", "eqdc"] };
5960
5991
  function Er() {
5961
5992
  this.R = this.a;
5962
5993
  }
5963
5994
  function Pr(t2) {
5964
- var e2, s2, i2 = t2.x, r2 = t2.y, a2 = pt(i2 - this.long0);
5995
+ var e2, s2, i2 = t2.x, r2 = t2.y, a2 = ft(i2 - this.long0);
5965
5996
  Math.abs(r2) <= m && (e2 = this.x0 + this.R * a2, s2 = this.y0);
5966
5997
  var n2 = Ni(2 * Math.abs(r2 / Math.PI));
5967
5998
  (Math.abs(a2) <= m || Math.abs(Math.abs(r2) - l) <= m) && (e2 = this.x0, s2 = r2 >= 0 ? this.y0 + Math.PI * this.R * Math.tan(0.5 * n2) : this.y0 + Math.PI * this.R * -Math.tan(0.5 * n2));
5968
- var o2 = 0.5 * Math.abs(Math.PI / a2 - a2 / Math.PI), h2 = o2 * o2, c2 = Math.sin(n2), u2 = Math.cos(n2), d2 = u2 / (c2 + u2 - 1), _2 = d2 * d2, f2 = d2 * (2 / c2 - 1), p2 = f2 * f2, y2 = Math.PI * this.R * (o2 * (d2 - p2) + Math.sqrt(h2 * (d2 - p2) * (d2 - p2) - (p2 + h2) * (_2 - p2))) / (p2 + h2);
5999
+ var o2 = 0.5 * Math.abs(Math.PI / a2 - a2 / Math.PI), h2 = o2 * o2, c2 = Math.sin(n2), u2 = Math.cos(n2), d2 = u2 / (c2 + u2 - 1), _2 = d2 * d2, p2 = d2 * (2 / c2 - 1), f2 = p2 * p2, y2 = Math.PI * this.R * (o2 * (d2 - f2) + Math.sqrt(h2 * (d2 - f2) * (d2 - f2) - (f2 + h2) * (_2 - f2))) / (f2 + h2);
5969
6000
  a2 < 0 && (y2 = -y2), e2 = this.x0 + y2;
5970
6001
  var g2 = h2 + d2;
5971
- return y2 = Math.PI * this.R * (f2 * g2 - o2 * Math.sqrt((p2 + h2) * (h2 + 1) - g2 * g2)) / (p2 + h2), s2 = r2 >= 0 ? this.y0 + y2 : this.y0 - y2, t2.x = e2, t2.y = s2, t2;
6002
+ return y2 = Math.PI * this.R * (p2 * g2 - o2 * Math.sqrt((f2 + h2) * (h2 + 1) - g2 * g2)) / (f2 + h2), s2 = r2 >= 0 ? this.y0 + y2 : this.y0 - y2, t2.x = e2, t2.y = s2, t2;
5972
6003
  }
5973
6004
  function br(t2) {
5974
6005
  var e2, s2, i2, r2, a2, n2, o2, h2, c2, l2, u2, d2;
5975
- return t2.x -= this.x0, t2.y -= this.y0, u2 = Math.PI * this.R, a2 = (i2 = t2.x / u2) * i2 + (r2 = t2.y / u2) * r2, u2 = 3 * (r2 * r2 / (h2 = -2 * (n2 = -Math.abs(r2) * (1 + a2)) + 1 + 2 * r2 * r2 + a2 * a2) + (2 * (o2 = n2 - 2 * r2 * r2 + i2 * i2) * o2 * o2 / h2 / h2 / h2 - 9 * n2 * o2 / h2 / h2) / 27) / (c2 = (n2 - o2 * o2 / 3 / h2) / h2) / (l2 = 2 * Math.sqrt(-c2 / 3)), Math.abs(u2) > 1 && (u2 = u2 >= 0 ? 1 : -1), d2 = Math.acos(u2) / 3, s2 = t2.y >= 0 ? (-l2 * Math.cos(d2 + Math.PI / 3) - o2 / 3 / h2) * Math.PI : -(-l2 * Math.cos(d2 + Math.PI / 3) - o2 / 3 / h2) * Math.PI, e2 = Math.abs(i2) < m ? this.long0 : pt(this.long0 + Math.PI * (a2 - 1 + Math.sqrt(1 + 2 * (i2 * i2 - r2 * r2) + a2 * a2)) / 2 / i2), t2.x = e2, t2.y = s2, t2;
6006
+ return t2.x -= this.x0, t2.y -= this.y0, u2 = Math.PI * this.R, a2 = (i2 = t2.x / u2) * i2 + (r2 = t2.y / u2) * r2, u2 = 3 * (r2 * r2 / (h2 = -2 * (n2 = -Math.abs(r2) * (1 + a2)) + 1 + 2 * r2 * r2 + a2 * a2) + (2 * (o2 = n2 - 2 * r2 * r2 + i2 * i2) * o2 * o2 / h2 / h2 / h2 - 9 * n2 * o2 / h2 / h2) / 27) / (c2 = (n2 - o2 * o2 / 3 / h2) / h2) / (l2 = 2 * Math.sqrt(-c2 / 3)), Math.abs(u2) > 1 && (u2 = u2 >= 0 ? 1 : -1), d2 = Math.acos(u2) / 3, s2 = t2.y >= 0 ? (-l2 * Math.cos(d2 + Math.PI / 3) - o2 / 3 / h2) * Math.PI : -(-l2 * Math.cos(d2 + Math.PI / 3) - o2 / 3 / h2) * Math.PI, e2 = Math.abs(i2) < m ? this.long0 : ft(this.long0 + Math.PI * (a2 - 1 + Math.sqrt(1 + 2 * (i2 * i2 - r2 * r2) + a2 * a2)) / 2 / i2), t2.x = e2, t2.y = s2, t2;
5976
6007
  }
5977
6008
  var vr, Ar = { init: Er, forward: Pr, inverse: br, names: ["Van_der_Grinten_I", "VanDerGrinten", "Van_der_Grinten", "vandg"] }, Tr = { exports: {} };
5978
6009
  function Ir() {
@@ -6077,15 +6108,15 @@ proj4Src.exports = function() {
6077
6108
  this._s = e3.remainder(this._s, t4), this.Add(0);
6078
6109
  };
6079
6110
  }(r2.Accumulator, r2.Math), r2.Geodesic = {}, r2.GeodesicLine = {}, r2.PolygonArea = {}, function(t3, e3, s3, i3, r3) {
6080
- var a2, n2, o2, h2, c2, l2, u2, d2, _2, m2, f2, p2 = 6, y2 = p2, g2 = p2, M2 = p2, x2 = M2, w2 = 20, S2 = w2 + i3.digits + 10, C2 = i3.epsilon, E2 = 200 * C2, P2 = Math.sqrt(C2), b2 = C2, v2 = 1e3 * P2, A3 = 0, T2 = 31, I2 = 32640;
6081
- t3.tiny_ = Math.sqrt(Number.MIN_VALUE / Number.EPSILON), t3.nC1_ = p2, t3.nC1p_ = p2, t3.nC2_ = p2, t3.nC3_ = p2, t3.nC4_ = p2, a2 = t3.nC3_ * (t3.nC3_ - 1) / 2, n2 = t3.nC4_ * (t3.nC4_ + 1) / 2, t3.CAP_C1 = 1, t3.CAP_C1p = 2, t3.CAP_C2 = 4, t3.CAP_C3 = 8, t3.CAP_C4 = 16, t3.NONE = 0, t3.ARC = 64, t3.LATITUDE = 128 | A3, t3.LONGITUDE = 256 | t3.CAP_C3, t3.AZIMUTH = 512 | A3, t3.DISTANCE = 1024 | t3.CAP_C1, t3.STANDARD = t3.LATITUDE | t3.LONGITUDE | t3.AZIMUTH | t3.DISTANCE, t3.DISTANCE_IN = 2048 | t3.CAP_C1 | t3.CAP_C1p, t3.REDUCEDLENGTH = 4096 | t3.CAP_C1 | t3.CAP_C2, t3.GEODESICSCALE = 8192 | t3.CAP_C1 | t3.CAP_C2, t3.AREA = 16384 | t3.CAP_C4, t3.ALL = I2 | T2, t3.LONG_UNROLL = 32768, t3.OUT_MASK = I2 | t3.LONG_UNROLL, t3.SinCosSeries = function(t4, e4, s4, i4) {
6111
+ var a2, n2, o2, h2, c2, l2, u2, d2, _2, m2, p2, f2 = 6, y2 = f2, g2 = f2, M2 = f2, x2 = M2, w2 = 20, S2 = w2 + i3.digits + 10, C2 = i3.epsilon, E2 = 200 * C2, P2 = Math.sqrt(C2), b2 = C2, v2 = 1e3 * P2, A3 = 0, T2 = 31, I2 = 32640;
6112
+ t3.tiny_ = Math.sqrt(Number.MIN_VALUE / Number.EPSILON), t3.nC1_ = f2, t3.nC1p_ = f2, t3.nC2_ = f2, t3.nC3_ = f2, t3.nC4_ = f2, a2 = t3.nC3_ * (t3.nC3_ - 1) / 2, n2 = t3.nC4_ * (t3.nC4_ + 1) / 2, t3.CAP_C1 = 1, t3.CAP_C1p = 2, t3.CAP_C2 = 4, t3.CAP_C3 = 8, t3.CAP_C4 = 16, t3.NONE = 0, t3.ARC = 64, t3.LATITUDE = 128 | A3, t3.LONGITUDE = 256 | t3.CAP_C3, t3.AZIMUTH = 512 | A3, t3.DISTANCE = 1024 | t3.CAP_C1, t3.STANDARD = t3.LATITUDE | t3.LONGITUDE | t3.AZIMUTH | t3.DISTANCE, t3.DISTANCE_IN = 2048 | t3.CAP_C1 | t3.CAP_C1p, t3.REDUCEDLENGTH = 4096 | t3.CAP_C1 | t3.CAP_C2, t3.GEODESICSCALE = 8192 | t3.CAP_C1 | t3.CAP_C2, t3.AREA = 16384 | t3.CAP_C4, t3.ALL = I2 | T2, t3.LONG_UNROLL = 32768, t3.OUT_MASK = I2 | t3.LONG_UNROLL, t3.SinCosSeries = function(t4, e4, s4, i4) {
6082
6113
  var r4 = i4.length, a3 = r4 - (t4 ? 1 : 0), n3 = 2 * (s4 - e4) * (s4 + e4), o3 = 1 & a3 ? i4[--r4] : 0, h3 = 0;
6083
6114
  for (a3 = Math.floor(a3 / 2); a3--; )
6084
6115
  o3 = n3 * (h3 = n3 * o3 - h3 + i4[--r4]) - o3 + i4[--r4];
6085
6116
  return t4 ? 2 * e4 * s4 * o3 : s4 * (o3 - h3);
6086
6117
  }, o2 = function(t4, e4) {
6087
- var s4, r4, a3, n3, o3, h3, c3, l3, u3, d3, _3, m3, f3 = i3.sq(t4), p3 = i3.sq(e4), y3 = (f3 + p3 - 1) / 6;
6088
- return 0 === p3 && y3 <= 0 ? s4 = 0 : (h3 = y3, (o3 = (r4 = f3 * p3 / 4) * (r4 + 2 * (n3 = y3 * (a3 = i3.sq(y3))))) >= 0 ? (c3 = r4 + n3, c3 += c3 < 0 ? -Math.sqrt(o3) : Math.sqrt(o3), h3 += (l3 = i3.cbrt(c3)) + (0 !== l3 ? a3 / l3 : 0)) : (u3 = Math.atan2(Math.sqrt(-o3), -(r4 + n3)), h3 += 2 * y3 * Math.cos(u3 / 3)), d3 = Math.sqrt(i3.sq(h3) + p3), m3 = ((_3 = h3 < 0 ? p3 / (d3 - h3) : h3 + d3) - p3) / (2 * d3), s4 = _3 / (Math.sqrt(_3 + i3.sq(m3)) + m3)), s4;
6118
+ var s4, r4, a3, n3, o3, h3, c3, l3, u3, d3, _3, m3, p3 = i3.sq(t4), f3 = i3.sq(e4), y3 = (p3 + f3 - 1) / 6;
6119
+ return 0 === f3 && y3 <= 0 ? s4 = 0 : (h3 = y3, (o3 = (r4 = p3 * f3 / 4) * (r4 + 2 * (n3 = y3 * (a3 = i3.sq(y3))))) >= 0 ? (c3 = r4 + n3, c3 += c3 < 0 ? -Math.sqrt(o3) : Math.sqrt(o3), h3 += (l3 = i3.cbrt(c3)) + (0 !== l3 ? a3 / l3 : 0)) : (u3 = Math.atan2(Math.sqrt(-o3), -(r4 + n3)), h3 += 2 * y3 * Math.cos(u3 / 3)), d3 = Math.sqrt(i3.sq(h3) + f3), m3 = ((_3 = h3 < 0 ? f3 / (d3 - h3) : h3 + d3) - f3) / (2 * d3), s4 = _3 / (Math.sqrt(_3 + i3.sq(m3)) + m3)), s4;
6089
6120
  }, h2 = [1, 4, 64, 0, 256], t3.A1m1f = function(t4) {
6090
6121
  var e4 = Math.floor(y2 / 2);
6091
6122
  return (i3.polyval(e4, h2, 0, i3.sq(t4)) / h2[e4 + 1] + t4) / (1 - t4);
@@ -6119,11 +6150,11 @@ proj4Src.exports = function() {
6119
6150
  for (e4 = 1; e4 < t3.nC3_; ++e4)
6120
6151
  for (s4 = t3.nC3_ - 1; s4 >= e4; --s4)
6121
6152
  r4 = Math.min(t3.nC3_ - s4 - 1, s4), this._C3x[n3++] = i3.polyval(r4, m2, a3, this._n) / m2[a3 + r4 + 1], a3 += r4 + 2;
6122
- }, f2 = [97, 15015, 1088, 156, 45045, -224, -4784, 1573, 45045, -10656, 14144, -4576, -858, 45045, 64, 624, -4576, 6864, -3003, 15015, 100, 208, 572, 3432, -12012, 30030, 45045, 1, 9009, -2944, 468, 135135, 5792, 1040, -1287, 135135, 5952, -11648, 9152, -2574, 135135, -64, -624, 4576, -6864, 3003, 135135, 8, 10725, 1856, -936, 225225, -8448, 4992, -1144, 225225, -1440, 4160, -4576, 1716, 225225, -136, 63063, 1024, -208, 105105, 3584, -3328, 1144, 315315, -128, 135135, -2560, 832, 405405, 128, 99099], t3.Geodesic.prototype.C4coeff = function() {
6153
+ }, p2 = [97, 15015, 1088, 156, 45045, -224, -4784, 1573, 45045, -10656, 14144, -4576, -858, 45045, 64, 624, -4576, 6864, -3003, 15015, 100, 208, 572, 3432, -12012, 30030, 45045, 1, 9009, -2944, 468, 135135, 5792, 1040, -1287, 135135, 5952, -11648, 9152, -2574, 135135, -64, -624, 4576, -6864, 3003, 135135, 8, 10725, 1856, -936, 225225, -8448, 4992, -1144, 225225, -1440, 4160, -4576, 1716, 225225, -136, 63063, 1024, -208, 105105, 3584, -3328, 1144, 315315, -128, 135135, -2560, 832, 405405, 128, 99099], t3.Geodesic.prototype.C4coeff = function() {
6123
6154
  var e4, s4, r4, a3 = 0, n3 = 0;
6124
6155
  for (e4 = 0; e4 < t3.nC4_; ++e4)
6125
6156
  for (s4 = t3.nC4_ - 1; s4 >= e4; --s4)
6126
- r4 = t3.nC4_ - s4 - 1, this._C4x[n3++] = i3.polyval(r4, f2, a3, this._n) / f2[a3 + r4 + 1], a3 += r4 + 2;
6157
+ r4 = t3.nC4_ - s4 - 1, this._C4x[n3++] = i3.polyval(r4, p2, a3, this._n) / p2[a3 + r4 + 1], a3 += r4 + 2;
6127
6158
  }, t3.Geodesic.prototype.A3f = function(t4) {
6128
6159
  return i3.polyval(x2 - 1, this._A3x, 0, t4);
6129
6160
  }, t3.Geodesic.prototype.C3f = function(e4, s4) {
@@ -6135,37 +6166,37 @@ proj4Src.exports = function() {
6135
6166
  for (r4 = 0; r4 < t3.nC4_; ++r4)
6136
6167
  a3 = t3.nC4_ - r4 - 1, s4[r4] = n3 * i3.polyval(a3, this._C4x, o3, e4), o3 += a3 + 1, n3 *= e4;
6137
6168
  }, t3.Geodesic.prototype.Lengths = function(e4, s4, i4, r4, a3, n3, o3, h3, c3, l3, u3, d3, _3) {
6138
- var m3, f3, p3, y3, g3 = {}, M3 = 0, x3 = 0, w3 = 0, S3 = 0;
6169
+ var m3, p3, f3, y3, g3 = {}, M3 = 0, x3 = 0, w3 = 0, S3 = 0;
6139
6170
  if ((u3 &= t3.OUT_MASK) & (t3.DISTANCE | t3.REDUCEDLENGTH | t3.GEODESICSCALE) && (w3 = t3.A1m1f(e4), t3.C1f(e4, d3), u3 & (t3.REDUCEDLENGTH | t3.GEODESICSCALE) && (S3 = t3.A2m1f(e4), t3.C2f(e4, _3), M3 = w3 - S3, S3 = 1 + S3), w3 = 1 + w3), u3 & t3.DISTANCE)
6140
6171
  m3 = t3.SinCosSeries(true, n3, o3, d3) - t3.SinCosSeries(true, i4, r4, d3), g3.s12b = w3 * (s4 + m3), u3 & (t3.REDUCEDLENGTH | t3.GEODESICSCALE) && (x3 = M3 * s4 + (w3 * m3 - S3 * (t3.SinCosSeries(true, n3, o3, _3) - t3.SinCosSeries(true, i4, r4, _3))));
6141
6172
  else if (u3 & (t3.REDUCEDLENGTH | t3.GEODESICSCALE)) {
6142
- for (f3 = 1; f3 <= t3.nC2_; ++f3)
6143
- _3[f3] = w3 * d3[f3] - S3 * _3[f3];
6173
+ for (p3 = 1; p3 <= t3.nC2_; ++p3)
6174
+ _3[p3] = w3 * d3[p3] - S3 * _3[p3];
6144
6175
  x3 = M3 * s4 + (t3.SinCosSeries(true, n3, o3, _3) - t3.SinCosSeries(true, i4, r4, _3));
6145
6176
  }
6146
- return u3 & t3.REDUCEDLENGTH && (g3.m0 = M3, g3.m12b = h3 * (r4 * n3) - a3 * (i4 * o3) - r4 * o3 * x3), u3 & t3.GEODESICSCALE && (p3 = r4 * o3 + i4 * n3, y3 = this._ep2 * (c3 - l3) * (c3 + l3) / (a3 + h3), g3.M12 = p3 + (y3 * n3 - o3 * x3) * i4 / a3, g3.M21 = p3 - (y3 * i4 - r4 * x3) * n3 / h3), g3;
6177
+ return u3 & t3.REDUCEDLENGTH && (g3.m0 = M3, g3.m12b = h3 * (r4 * n3) - a3 * (i4 * o3) - r4 * o3 * x3), u3 & t3.GEODESICSCALE && (f3 = r4 * o3 + i4 * n3, y3 = this._ep2 * (c3 - l3) * (c3 + l3) / (a3 + h3), g3.M12 = f3 + (y3 * n3 - o3 * x3) * i4 / a3, g3.M21 = f3 - (y3 * i4 - r4 * x3) * n3 / h3), g3;
6147
6178
  }, t3.Geodesic.prototype.InverseStart = function(e4, s4, r4, a3, n3, h3, c3, l3, u3, d3, _3) {
6148
- var m3, f3, p3, y3, g3, M3, x3, w3, S3, C3, P3, b3, A4, T3, I3, z2, O2, N2, G2, R2, L2 = {}, $2 = a3 * s4 - n3 * e4, V2 = n3 * s4 + a3 * e4;
6149
- return L2.sig12 = -1, m3 = a3 * s4, m3 += n3 * e4, (f3 = V2 >= 0 && $2 < 0.5 && n3 * c3 < 0.5) ? (y3 = i3.sq(e4 + a3), y3 /= y3 + i3.sq(s4 + n3), L2.dnm = Math.sqrt(1 + this._ep2 * y3), p3 = c3 / (this._f1 * L2.dnm), g3 = Math.sin(p3), M3 = Math.cos(p3)) : (g3 = l3, M3 = u3), L2.salp1 = n3 * g3, L2.calp1 = M3 >= 0 ? $2 + n3 * e4 * i3.sq(g3) / (1 + M3) : m3 - n3 * e4 * i3.sq(g3) / (1 - M3), w3 = i3.hypot(L2.salp1, L2.calp1), S3 = e4 * a3 + s4 * n3 * M3, f3 && w3 < this._etol2 ? (L2.salp2 = s4 * g3, L2.calp2 = $2 - s4 * a3 * (M3 >= 0 ? i3.sq(g3) / (1 + M3) : 1 - M3), x3 = i3.hypot(L2.salp2, L2.calp2), L2.salp2 /= x3, L2.calp2 /= x3, L2.sig12 = Math.atan2(w3, S3)) : Math.abs(this._n) > 0.1 || S3 >= 0 || w3 >= 6 * Math.abs(this._n) * Math.PI * i3.sq(s4) || (R2 = Math.atan2(-l3, -u3), this.f >= 0 ? (T3 = (A4 = i3.sq(e4) * this._ep2) / (2 * (1 + Math.sqrt(1 + A4)) + A4), C3 = R2 / (b3 = this.f * s4 * this.A3f(T3) * Math.PI), P3 = m3 / (b3 * s4)) : (I3 = n3 * s4 - a3 * e4, z2 = Math.atan2(m3, I3), P3 = c3 / (b3 = ((C3 = (O2 = this.Lengths(this._n, Math.PI + z2, e4, -s4, r4, a3, n3, h3, s4, n3, t3.REDUCEDLENGTH, d3, _3)).m12b / (s4 * n3 * O2.m0 * Math.PI) - 1) < -0.01 ? m3 / C3 : -this.f * i3.sq(s4) * Math.PI) / s4)), P3 > -E2 && C3 > -1 - v2 ? this.f >= 0 ? (L2.salp1 = Math.min(1, -C3), L2.calp1 = -Math.sqrt(1 - i3.sq(L2.salp1))) : (L2.calp1 = Math.max(C3 > -E2 ? 0 : -1, C3), L2.salp1 = Math.sqrt(1 - i3.sq(L2.calp1))) : (N2 = o2(C3, P3), G2 = b3 * (this.f >= 0 ? -C3 * N2 / (1 + N2) : -P3 * (1 + N2) / N2), g3 = Math.sin(G2), M3 = -Math.cos(G2), L2.salp1 = n3 * g3, L2.calp1 = m3 - n3 * e4 * i3.sq(g3) / (1 - M3))), L2.salp1 <= 0 ? (L2.salp1 = 1, L2.calp1 = 0) : (x3 = i3.hypot(L2.salp1, L2.calp1), L2.salp1 /= x3, L2.calp1 /= x3), L2;
6150
- }, t3.Geodesic.prototype.Lambda12 = function(e4, s4, r4, a3, n3, o3, h3, c3, l3, u3, d3, _3, m3, f3) {
6151
- var p3, y3, g3, M3, x3, w3, S3, C3, E3, P3, b3, v3, A4, T3 = {};
6152
- return 0 === e4 && 0 === c3 && (c3 = -t3.tiny_), y3 = h3 * s4, g3 = i3.hypot(c3, h3 * e4), T3.ssig1 = e4, M3 = y3 * e4, T3.csig1 = x3 = c3 * s4, p3 = i3.hypot(T3.ssig1, T3.csig1), T3.ssig1 /= p3, T3.csig1 /= p3, T3.salp2 = n3 !== s4 ? y3 / n3 : h3, T3.calp2 = n3 !== s4 || Math.abs(a3) !== -e4 ? Math.sqrt(i3.sq(c3 * s4) + (s4 < -e4 ? (n3 - s4) * (s4 + n3) : (e4 - a3) * (e4 + a3))) / n3 : Math.abs(c3), T3.ssig2 = a3, w3 = y3 * a3, T3.csig2 = S3 = T3.calp2 * n3, p3 = i3.hypot(T3.ssig2, T3.csig2), T3.ssig2 /= p3, T3.csig2 /= p3, T3.sig12 = Math.atan2(Math.max(0, T3.csig1 * T3.ssig2 - T3.ssig1 * T3.csig2), T3.csig1 * T3.csig2 + T3.ssig1 * T3.ssig2), C3 = Math.max(0, x3 * w3 - M3 * S3), E3 = x3 * S3 + M3 * w3, b3 = Math.atan2(C3 * u3 - E3 * l3, E3 * u3 + C3 * l3), v3 = i3.sq(g3) * this._ep2, T3.eps = v3 / (2 * (1 + Math.sqrt(1 + v3)) + v3), this.C3f(T3.eps, f3), P3 = t3.SinCosSeries(true, T3.ssig2, T3.csig2, f3) - t3.SinCosSeries(true, T3.ssig1, T3.csig1, f3), T3.domg12 = -this.f * this.A3f(T3.eps) * y3 * (T3.sig12 + P3), T3.lam12 = b3 + T3.domg12, d3 && (0 === T3.calp2 ? T3.dlam12 = -2 * this._f1 * r4 / e4 : (A4 = this.Lengths(T3.eps, T3.sig12, T3.ssig1, T3.csig1, r4, T3.ssig2, T3.csig2, o3, s4, n3, t3.REDUCEDLENGTH, _3, m3), T3.dlam12 = A4.m12b, T3.dlam12 *= this._f1 / (T3.calp2 * n3))), T3;
6179
+ var m3, p3, f3, y3, g3, M3, x3, w3, S3, C3, P3, b3, A4, T3, I3, z2, O2, N2, G2, R2, L2 = {}, $2 = a3 * s4 - n3 * e4, V2 = n3 * s4 + a3 * e4;
6180
+ return L2.sig12 = -1, m3 = a3 * s4, m3 += n3 * e4, (p3 = V2 >= 0 && $2 < 0.5 && n3 * c3 < 0.5) ? (y3 = i3.sq(e4 + a3), y3 /= y3 + i3.sq(s4 + n3), L2.dnm = Math.sqrt(1 + this._ep2 * y3), f3 = c3 / (this._f1 * L2.dnm), g3 = Math.sin(f3), M3 = Math.cos(f3)) : (g3 = l3, M3 = u3), L2.salp1 = n3 * g3, L2.calp1 = M3 >= 0 ? $2 + n3 * e4 * i3.sq(g3) / (1 + M3) : m3 - n3 * e4 * i3.sq(g3) / (1 - M3), w3 = i3.hypot(L2.salp1, L2.calp1), S3 = e4 * a3 + s4 * n3 * M3, p3 && w3 < this._etol2 ? (L2.salp2 = s4 * g3, L2.calp2 = $2 - s4 * a3 * (M3 >= 0 ? i3.sq(g3) / (1 + M3) : 1 - M3), x3 = i3.hypot(L2.salp2, L2.calp2), L2.salp2 /= x3, L2.calp2 /= x3, L2.sig12 = Math.atan2(w3, S3)) : Math.abs(this._n) > 0.1 || S3 >= 0 || w3 >= 6 * Math.abs(this._n) * Math.PI * i3.sq(s4) || (R2 = Math.atan2(-l3, -u3), this.f >= 0 ? (T3 = (A4 = i3.sq(e4) * this._ep2) / (2 * (1 + Math.sqrt(1 + A4)) + A4), C3 = R2 / (b3 = this.f * s4 * this.A3f(T3) * Math.PI), P3 = m3 / (b3 * s4)) : (I3 = n3 * s4 - a3 * e4, z2 = Math.atan2(m3, I3), P3 = c3 / (b3 = ((C3 = (O2 = this.Lengths(this._n, Math.PI + z2, e4, -s4, r4, a3, n3, h3, s4, n3, t3.REDUCEDLENGTH, d3, _3)).m12b / (s4 * n3 * O2.m0 * Math.PI) - 1) < -0.01 ? m3 / C3 : -this.f * i3.sq(s4) * Math.PI) / s4)), P3 > -E2 && C3 > -1 - v2 ? this.f >= 0 ? (L2.salp1 = Math.min(1, -C3), L2.calp1 = -Math.sqrt(1 - i3.sq(L2.salp1))) : (L2.calp1 = Math.max(C3 > -E2 ? 0 : -1, C3), L2.salp1 = Math.sqrt(1 - i3.sq(L2.calp1))) : (N2 = o2(C3, P3), G2 = b3 * (this.f >= 0 ? -C3 * N2 / (1 + N2) : -P3 * (1 + N2) / N2), g3 = Math.sin(G2), M3 = -Math.cos(G2), L2.salp1 = n3 * g3, L2.calp1 = m3 - n3 * e4 * i3.sq(g3) / (1 - M3))), L2.salp1 <= 0 ? (L2.salp1 = 1, L2.calp1 = 0) : (x3 = i3.hypot(L2.salp1, L2.calp1), L2.salp1 /= x3, L2.calp1 /= x3), L2;
6181
+ }, t3.Geodesic.prototype.Lambda12 = function(e4, s4, r4, a3, n3, o3, h3, c3, l3, u3, d3, _3, m3, p3) {
6182
+ var f3, y3, g3, M3, x3, w3, S3, C3, E3, P3, b3, v3, A4, T3 = {};
6183
+ return 0 === e4 && 0 === c3 && (c3 = -t3.tiny_), y3 = h3 * s4, g3 = i3.hypot(c3, h3 * e4), T3.ssig1 = e4, M3 = y3 * e4, T3.csig1 = x3 = c3 * s4, f3 = i3.hypot(T3.ssig1, T3.csig1), T3.ssig1 /= f3, T3.csig1 /= f3, T3.salp2 = n3 !== s4 ? y3 / n3 : h3, T3.calp2 = n3 !== s4 || Math.abs(a3) !== -e4 ? Math.sqrt(i3.sq(c3 * s4) + (s4 < -e4 ? (n3 - s4) * (s4 + n3) : (e4 - a3) * (e4 + a3))) / n3 : Math.abs(c3), T3.ssig2 = a3, w3 = y3 * a3, T3.csig2 = S3 = T3.calp2 * n3, f3 = i3.hypot(T3.ssig2, T3.csig2), T3.ssig2 /= f3, T3.csig2 /= f3, T3.sig12 = Math.atan2(Math.max(0, T3.csig1 * T3.ssig2 - T3.ssig1 * T3.csig2), T3.csig1 * T3.csig2 + T3.ssig1 * T3.ssig2), C3 = Math.max(0, x3 * w3 - M3 * S3), E3 = x3 * S3 + M3 * w3, b3 = Math.atan2(C3 * u3 - E3 * l3, E3 * u3 + C3 * l3), v3 = i3.sq(g3) * this._ep2, T3.eps = v3 / (2 * (1 + Math.sqrt(1 + v3)) + v3), this.C3f(T3.eps, p3), P3 = t3.SinCosSeries(true, T3.ssig2, T3.csig2, p3) - t3.SinCosSeries(true, T3.ssig1, T3.csig1, p3), T3.domg12 = -this.f * this.A3f(T3.eps) * y3 * (T3.sig12 + P3), T3.lam12 = b3 + T3.domg12, d3 && (0 === T3.calp2 ? T3.dlam12 = -2 * this._f1 * r4 / e4 : (A4 = this.Lengths(T3.eps, T3.sig12, T3.ssig1, T3.csig1, r4, T3.ssig2, T3.csig2, o3, s4, n3, t3.REDUCEDLENGTH, _3, m3), T3.dlam12 = A4.m12b, T3.dlam12 *= this._f1 / (T3.calp2 * n3))), T3;
6153
6184
  }, t3.Geodesic.prototype.Inverse = function(e4, s4, r4, a3, n3) {
6154
6185
  var o3, h3;
6155
6186
  return n3 || (n3 = t3.STANDARD), n3 === t3.LONG_UNROLL && (n3 |= t3.STANDARD), n3 &= t3.OUT_MASK, h3 = (o3 = this.InverseInt(e4, s4, r4, a3, n3)).vals, n3 & t3.AZIMUTH && (h3.azi1 = i3.atan2d(o3.salp1, o3.calp1), h3.azi2 = i3.atan2d(o3.salp2, o3.calp2)), h3;
6156
6187
  }, t3.Geodesic.prototype.InverseInt = function(e4, s4, r4, a3, n3) {
6157
- var o3, h3, c3, l3, u3, d3, _3, m3, f3, p3, y3, g3, M3, x3, E3, P3, v3, A4, T3, I3, z2, O2, N2, G2, R2, L2, $2, V2, q2, j2, D2, B2, k2, F2, U2, W2, Y2, Q2, X2, H2, Z2, K2, J2, tt2, et2, st2, it2, rt2, at2, nt2, ot2, ht2, ct2, lt2, ut2, dt2, _t2, mt2, ft2, pt2, yt2, gt2, Mt2, xt2, wt2, St2 = {};
6158
- if (St2.lat1 = e4 = i3.LatFix(e4), St2.lat2 = r4 = i3.LatFix(r4), e4 = i3.AngRound(e4), r4 = i3.AngRound(r4), h3 = (o3 = i3.AngDiff(s4, a3)).e, o3 = o3.d, n3 & t3.LONG_UNROLL ? (St2.lon1 = s4, St2.lon2 = s4 + o3 + h3) : (St2.lon1 = i3.AngNormalize(s4), St2.lon2 = i3.AngNormalize(a3)), h3 *= c3 = i3.copysign(1, o3), E3 = (o3 *= c3) * i3.degree, P3 = (l3 = i3.sincosde(o3, h3)).s, v3 = l3.c, h3 = 180 - o3 - h3, (u3 = Math.abs(e4) < Math.abs(r4) || isNaN(r4) ? -1 : 1) < 0 && (c3 *= -1, [r4, e4] = [e4, r4]), e4 *= d3 = i3.copysign(1, -e4), r4 *= d3, l3 = i3.sincosd(e4), _3 = this._f1 * l3.s, m3 = l3.c, _3 /= l3 = i3.hypot(_3, m3), m3 /= l3, m3 = Math.max(t3.tiny_, m3), l3 = i3.sincosd(r4), f3 = this._f1 * l3.s, p3 = l3.c, f3 /= l3 = i3.hypot(f3, p3), p3 /= l3, p3 = Math.max(t3.tiny_, p3), m3 < -_3 ? p3 === m3 && (f3 = i3.copysign(_3, f3)) : Math.abs(f3) === -_3 && (p3 = m3), M3 = Math.sqrt(1 + this._ep2 * i3.sq(_3)), x3 = Math.sqrt(1 + this._ep2 * i3.sq(f3)), N2 = new Array(t3.nC1_ + 1), G2 = new Array(t3.nC2_ + 1), R2 = new Array(t3.nC3_), (L2 = -90 === e4 || 0 === P3) && (I3 = P3, O2 = 0, V2 = _3, q2 = (T3 = v3) * m3, j2 = f3, D2 = (z2 = 1) * p3, A4 = Math.atan2(Math.max(0, q2 * j2 - V2 * D2), q2 * D2 + V2 * j2), y3 = ($2 = this.Lengths(this._n, A4, V2, q2, M3, j2, D2, x3, m3, p3, n3 | t3.DISTANCE | t3.REDUCEDLENGTH, N2, G2)).s12b, g3 = $2.m12b, n3 & t3.GEODESICSCALE && (St2.M12 = $2.M12, St2.M21 = $2.M21), A4 < 1 || g3 >= 0 ? ((A4 < 3 * t3.tiny_ || A4 < C2 && (y3 < 0 || g3 < 0)) && (A4 = g3 = y3 = 0), g3 *= this._b, y3 *= this._b, St2.a12 = A4 / i3.degree) : L2 = false), _t2 = 2, !L2 && 0 === _3 && (this.f <= 0 || h3 >= 180 * this.f))
6188
+ var o3, h3, c3, l3, u3, d3, _3, m3, p3, f3, y3, g3, M3, x3, E3, P3, v3, A4, T3, I3, z2, O2, N2, G2, R2, L2, $2, V2, q2, j2, D2, B2, k2, F2, U2, W2, Y2, Q2, X2, H2, Z2, K2, J2, tt2, et2, st2, it2, rt2, at2, nt2, ot2, ht2, ct2, lt2, ut2, dt2, _t2, mt2, pt2, ft2, yt2, gt2, Mt2, xt2, wt2, St2 = {};
6189
+ if (St2.lat1 = e4 = i3.LatFix(e4), St2.lat2 = r4 = i3.LatFix(r4), e4 = i3.AngRound(e4), r4 = i3.AngRound(r4), h3 = (o3 = i3.AngDiff(s4, a3)).e, o3 = o3.d, n3 & t3.LONG_UNROLL ? (St2.lon1 = s4, St2.lon2 = s4 + o3 + h3) : (St2.lon1 = i3.AngNormalize(s4), St2.lon2 = i3.AngNormalize(a3)), h3 *= c3 = i3.copysign(1, o3), E3 = (o3 *= c3) * i3.degree, P3 = (l3 = i3.sincosde(o3, h3)).s, v3 = l3.c, h3 = 180 - o3 - h3, (u3 = Math.abs(e4) < Math.abs(r4) || isNaN(r4) ? -1 : 1) < 0 && (c3 *= -1, [r4, e4] = [e4, r4]), e4 *= d3 = i3.copysign(1, -e4), r4 *= d3, l3 = i3.sincosd(e4), _3 = this._f1 * l3.s, m3 = l3.c, _3 /= l3 = i3.hypot(_3, m3), m3 /= l3, m3 = Math.max(t3.tiny_, m3), l3 = i3.sincosd(r4), p3 = this._f1 * l3.s, f3 = l3.c, p3 /= l3 = i3.hypot(p3, f3), f3 /= l3, f3 = Math.max(t3.tiny_, f3), m3 < -_3 ? f3 === m3 && (p3 = i3.copysign(_3, p3)) : Math.abs(p3) === -_3 && (f3 = m3), M3 = Math.sqrt(1 + this._ep2 * i3.sq(_3)), x3 = Math.sqrt(1 + this._ep2 * i3.sq(p3)), N2 = new Array(t3.nC1_ + 1), G2 = new Array(t3.nC2_ + 1), R2 = new Array(t3.nC3_), (L2 = -90 === e4 || 0 === P3) && (I3 = P3, O2 = 0, V2 = _3, q2 = (T3 = v3) * m3, j2 = p3, D2 = (z2 = 1) * f3, A4 = Math.atan2(Math.max(0, q2 * j2 - V2 * D2), q2 * D2 + V2 * j2), y3 = ($2 = this.Lengths(this._n, A4, V2, q2, M3, j2, D2, x3, m3, f3, n3 | t3.DISTANCE | t3.REDUCEDLENGTH, N2, G2)).s12b, g3 = $2.m12b, n3 & t3.GEODESICSCALE && (St2.M12 = $2.M12, St2.M21 = $2.M21), A4 < 1 || g3 >= 0 ? ((A4 < 3 * t3.tiny_ || A4 < C2 && (y3 < 0 || g3 < 0)) && (A4 = g3 = y3 = 0), g3 *= this._b, y3 *= this._b, St2.a12 = A4 / i3.degree) : L2 = false), _t2 = 2, !L2 && 0 === _3 && (this.f <= 0 || h3 >= 180 * this.f))
6159
6190
  T3 = z2 = 0, I3 = O2 = 1, y3 = this.a * E3, A4 = k2 = E3 / this._f1, g3 = this._b * Math.sin(A4), n3 & t3.GEODESICSCALE && (St2.M12 = St2.M21 = Math.cos(A4)), St2.a12 = o3 / this._f1;
6160
6191
  else if (!L2)
6161
- if (A4 = ($2 = this.InverseStart(_3, m3, M3, f3, p3, x3, E3, P3, v3, N2, G2)).sig12, I3 = $2.salp1, T3 = $2.calp1, A4 >= 0)
6192
+ if (A4 = ($2 = this.InverseStart(_3, m3, M3, p3, f3, x3, E3, P3, v3, N2, G2)).sig12, I3 = $2.salp1, T3 = $2.calp1, A4 >= 0)
6162
6193
  O2 = $2.salp2, z2 = $2.calp2, F2 = $2.dnm, y3 = A4 * this._b * F2, g3 = i3.sq(F2) * this._b * Math.sin(A4 / F2), n3 & t3.GEODESICSCALE && (St2.M12 = St2.M21 = Math.cos(A4 / F2)), St2.a12 = A4 / i3.degree, k2 = E3 / (this._f1 * F2);
6163
6194
  else {
6164
- for (U2 = 0, W2 = t3.tiny_, Y2 = 1, Q2 = t3.tiny_, X2 = -1, H2 = false, Z2 = false; K2 = ($2 = this.Lambda12(_3, m3, M3, f3, p3, x3, I3, T3, P3, v3, U2 < w2, N2, G2, R2)).lam12, O2 = $2.salp2, z2 = $2.calp2, A4 = $2.sig12, V2 = $2.ssig1, q2 = $2.csig1, j2 = $2.ssig2, D2 = $2.csig2, B2 = $2.eps, ft2 = $2.domg12, J2 = $2.dlam12, !Z2 && Math.abs(K2) >= (H2 ? 8 : 1) * C2 && U2 != S2; ++U2)
6195
+ for (U2 = 0, W2 = t3.tiny_, Y2 = 1, Q2 = t3.tiny_, X2 = -1, H2 = false, Z2 = false; K2 = ($2 = this.Lambda12(_3, m3, M3, p3, f3, x3, I3, T3, P3, v3, U2 < w2, N2, G2, R2)).lam12, O2 = $2.salp2, z2 = $2.calp2, A4 = $2.sig12, V2 = $2.ssig1, q2 = $2.csig1, j2 = $2.ssig2, D2 = $2.csig2, B2 = $2.eps, pt2 = $2.domg12, J2 = $2.dlam12, !Z2 && Math.abs(K2) >= (H2 ? 8 : 1) * C2 && U2 != S2; ++U2)
6165
6196
  K2 > 0 && (U2 < w2 || T3 / I3 > X2 / Q2) ? (Q2 = I3, X2 = T3) : K2 < 0 && (U2 < w2 || T3 / I3 < Y2 / W2) && (W2 = I3, Y2 = T3), U2 < w2 && J2 > 0 && (tt2 = -K2 / J2, Math.abs(tt2) < Math.PI && (et2 = Math.sin(tt2), (it2 = I3 * (st2 = Math.cos(tt2)) + T3 * et2) > 0)) ? (T3 = T3 * st2 - I3 * et2, I3 = it2, I3 /= l3 = i3.hypot(I3, T3), T3 /= l3, H2 = Math.abs(K2) <= 16 * C2) : (I3 = (W2 + Q2) / 2, T3 = (Y2 + X2) / 2, I3 /= l3 = i3.hypot(I3, T3), T3 /= l3, H2 = false, Z2 = Math.abs(W2 - I3) + (Y2 - T3) < b2 || Math.abs(I3 - Q2) + (T3 - X2) < b2);
6166
- rt2 = n3 | (n3 & (t3.REDUCEDLENGTH | t3.GEODESICSCALE) ? t3.DISTANCE : t3.NONE), y3 = ($2 = this.Lengths(B2, A4, V2, q2, M3, j2, D2, x3, m3, p3, rt2, N2, G2)).s12b, g3 = $2.m12b, n3 & t3.GEODESICSCALE && (St2.M12 = $2.M12, St2.M21 = $2.M21), g3 *= this._b, y3 *= this._b, St2.a12 = A4 / i3.degree, n3 & t3.AREA && (xt2 = Math.sin(ft2), _t2 = P3 * (wt2 = Math.cos(ft2)) - v3 * xt2, mt2 = v3 * wt2 + P3 * xt2);
6197
+ rt2 = n3 | (n3 & (t3.REDUCEDLENGTH | t3.GEODESICSCALE) ? t3.DISTANCE : t3.NONE), y3 = ($2 = this.Lengths(B2, A4, V2, q2, M3, j2, D2, x3, m3, f3, rt2, N2, G2)).s12b, g3 = $2.m12b, n3 & t3.GEODESICSCALE && (St2.M12 = $2.M12, St2.M21 = $2.M21), g3 *= this._b, y3 *= this._b, St2.a12 = A4 / i3.degree, n3 & t3.AREA && (xt2 = Math.sin(pt2), _t2 = P3 * (wt2 = Math.cos(pt2)) - v3 * xt2, mt2 = v3 * wt2 + P3 * xt2);
6167
6198
  }
6168
- return n3 & t3.DISTANCE && (St2.s12 = 0 + y3), n3 & t3.REDUCEDLENGTH && (St2.m12 = 0 + g3), n3 & t3.AREA && (at2 = I3 * m3, 0 !== (nt2 = i3.hypot(T3, I3 * _3)) && 0 !== at2 ? (V2 = _3, q2 = T3 * m3, j2 = f3, D2 = z2 * p3, B2 = (ht2 = i3.sq(nt2) * this._ep2) / (2 * (1 + Math.sqrt(1 + ht2)) + ht2), ct2 = i3.sq(this.a) * nt2 * at2 * this._e2, V2 /= l3 = i3.hypot(V2, q2), q2 /= l3, j2 /= l3 = i3.hypot(j2, D2), D2 /= l3, lt2 = new Array(t3.nC4_), this.C4f(B2, lt2), ut2 = t3.SinCosSeries(false, V2, q2, lt2), dt2 = t3.SinCosSeries(false, j2, D2, lt2), St2.S12 = ct2 * (dt2 - ut2)) : St2.S12 = 0, L2 || 2 != _t2 || (_t2 = Math.sin(k2), mt2 = Math.cos(k2)), !L2 && mt2 > -0.7071 && f3 - _3 < 1.75 ? (ft2 = 1 + mt2, pt2 = 1 + m3, yt2 = 1 + p3, ot2 = 2 * Math.atan2(_t2 * (_3 * yt2 + f3 * pt2), ft2 * (_3 * f3 + pt2 * yt2))) : (Mt2 = z2 * T3 + O2 * I3, 0 === (gt2 = O2 * T3 - z2 * I3) && Mt2 < 0 && (gt2 = t3.tiny_ * T3, Mt2 = -1), ot2 = Math.atan2(gt2, Mt2)), St2.S12 += this._c2 * ot2, St2.S12 *= u3 * c3 * d3, St2.S12 += 0), u3 < 0 && ([O2, I3] = [I3, O2], [z2, T3] = [T3, z2], n3 & t3.GEODESICSCALE && ([St2.M21, St2.M12] = [St2.M12, St2.M21])), { vals: St2, salp1: I3 *= u3 * c3, calp1: T3 *= u3 * d3, salp2: O2 *= u3 * c3, calp2: z2 *= u3 * d3 };
6199
+ return n3 & t3.DISTANCE && (St2.s12 = 0 + y3), n3 & t3.REDUCEDLENGTH && (St2.m12 = 0 + g3), n3 & t3.AREA && (at2 = I3 * m3, 0 !== (nt2 = i3.hypot(T3, I3 * _3)) && 0 !== at2 ? (V2 = _3, q2 = T3 * m3, j2 = p3, D2 = z2 * f3, B2 = (ht2 = i3.sq(nt2) * this._ep2) / (2 * (1 + Math.sqrt(1 + ht2)) + ht2), ct2 = i3.sq(this.a) * nt2 * at2 * this._e2, V2 /= l3 = i3.hypot(V2, q2), q2 /= l3, j2 /= l3 = i3.hypot(j2, D2), D2 /= l3, lt2 = new Array(t3.nC4_), this.C4f(B2, lt2), ut2 = t3.SinCosSeries(false, V2, q2, lt2), dt2 = t3.SinCosSeries(false, j2, D2, lt2), St2.S12 = ct2 * (dt2 - ut2)) : St2.S12 = 0, L2 || 2 != _t2 || (_t2 = Math.sin(k2), mt2 = Math.cos(k2)), !L2 && mt2 > -0.7071 && p3 - _3 < 1.75 ? (pt2 = 1 + mt2, ft2 = 1 + m3, yt2 = 1 + f3, ot2 = 2 * Math.atan2(_t2 * (_3 * yt2 + p3 * ft2), pt2 * (_3 * p3 + ft2 * yt2))) : (Mt2 = z2 * T3 + O2 * I3, 0 === (gt2 = O2 * T3 - z2 * I3) && Mt2 < 0 && (gt2 = t3.tiny_ * T3, Mt2 = -1), ot2 = Math.atan2(gt2, Mt2)), St2.S12 += this._c2 * ot2, St2.S12 *= u3 * c3 * d3, St2.S12 += 0), u3 < 0 && ([O2, I3] = [I3, O2], [z2, T3] = [T3, z2], n3 & t3.GEODESICSCALE && ([St2.M21, St2.M12] = [St2.M12, St2.M21])), { vals: St2, salp1: I3 *= u3 * c3, calp1: T3 *= u3 * d3, salp2: O2 *= u3 * c3, calp2: z2 *= u3 * d3 };
6169
6200
  }, t3.Geodesic.prototype.GenDirect = function(s4, i4, r4, a3, n3, o3) {
6170
6201
  return o3 ? o3 === t3.LONG_UNROLL && (o3 |= t3.STANDARD) : o3 = t3.STANDARD, a3 || (o3 |= t3.DISTANCE_IN), new e3.GeodesicLine(this, s4, i4, r4, o3).GenPosition(a3, n3, o3);
6171
6202
  }, t3.Geodesic.prototype.Direct = function(t4, e4, s4, i4, r4) {
@@ -6192,8 +6223,8 @@ proj4Src.exports = function() {
6192
6223
  var c2, l2, u2, d2, _2, m2;
6193
6224
  n2 || (n2 = t3.STANDARD | t3.DISTANCE_IN), this.a = e4.a, this.f = e4.f, this._b = e4._b, this._c2 = e4._c2, this._f1 = e4._f1, this.caps = n2 | t3.LATITUDE | t3.AZIMUTH | t3.LONG_UNROLL, this.lat1 = s3.LatFix(i3), this.lon1 = r3, void 0 === o2 || void 0 === h2 ? (this.azi1 = s3.AngNormalize(a2), c2 = s3.sincosd(s3.AngRound(this.azi1)), this.salp1 = c2.s, this.calp1 = c2.c) : (this.azi1 = a2, this.salp1 = o2, this.calp1 = h2), c2 = s3.sincosd(s3.AngRound(this.lat1)), u2 = this._f1 * c2.s, l2 = c2.c, u2 /= c2 = s3.hypot(u2, l2), l2 /= c2, l2 = Math.max(t3.tiny_, l2), this._dn1 = Math.sqrt(1 + e4._ep2 * s3.sq(u2)), this._salp0 = this.salp1 * l2, this._calp0 = s3.hypot(this.calp1, this.salp1 * u2), this._ssig1 = u2, this._somg1 = this._salp0 * u2, this._csig1 = this._comg1 = 0 !== u2 || 0 !== this.calp1 ? l2 * this.calp1 : 1, c2 = s3.hypot(this._ssig1, this._csig1), this._ssig1 /= c2, this._csig1 /= c2, this._k2 = s3.sq(this._calp0) * e4._ep2, d2 = this._k2 / (2 * (1 + Math.sqrt(1 + this._k2)) + this._k2), this.caps & t3.CAP_C1 && (this._A1m1 = t3.A1m1f(d2), this._C1a = new Array(t3.nC1_ + 1), t3.C1f(d2, this._C1a), this._B11 = t3.SinCosSeries(true, this._ssig1, this._csig1, this._C1a), _2 = Math.sin(this._B11), m2 = Math.cos(this._B11), this._stau1 = this._ssig1 * m2 + this._csig1 * _2, this._ctau1 = this._csig1 * m2 - this._ssig1 * _2), this.caps & t3.CAP_C1p && (this._C1pa = new Array(t3.nC1p_ + 1), t3.C1pf(d2, this._C1pa)), this.caps & t3.CAP_C2 && (this._A2m1 = t3.A2m1f(d2), this._C2a = new Array(t3.nC2_ + 1), t3.C2f(d2, this._C2a), this._B21 = t3.SinCosSeries(true, this._ssig1, this._csig1, this._C2a)), this.caps & t3.CAP_C3 && (this._C3a = new Array(t3.nC3_), e4.C3f(d2, this._C3a), this._A3c = -this.f * this._salp0 * e4.A3f(d2), this._B31 = t3.SinCosSeries(true, this._ssig1, this._csig1, this._C3a)), this.caps & t3.CAP_C4 && (this._C4a = new Array(t3.nC4_), e4.C4f(d2, this._C4a), this._A4 = s3.sq(this.a) * this._calp0 * this._salp0 * e4._e2, this._B41 = t3.SinCosSeries(false, this._ssig1, this._csig1, this._C4a)), this.a13 = this.s13 = NaN;
6194
6225
  }, e3.GeodesicLine.prototype.GenPosition = function(e4, i3, r3) {
6195
- var a2, n2, o2, h2, c2, l2, u2, d2, _2, m2, f2, p2, y2, g2, M2, x2, w2, S2, C2, E2, P2, b2, v2, A3, T2, I2, z2 = {};
6196
- return r3 ? r3 === t3.LONG_UNROLL && (r3 |= t3.STANDARD) : r3 = t3.STANDARD, r3 &= this.caps & t3.OUT_MASK, z2.lat1 = this.lat1, z2.azi1 = this.azi1, z2.lon1 = r3 & t3.LONG_UNROLL ? this.lon1 : s3.AngNormalize(this.lon1), e4 ? z2.a12 = i3 : z2.s12 = i3, e4 || this.caps & t3.DISTANCE_IN & t3.OUT_MASK ? (h2 = 0, c2 = 0, e4 ? (a2 = i3 * s3.degree, n2 = (v2 = s3.sincosd(i3)).s, o2 = v2.c) : (d2 = i3 / (this._b * (1 + this._A1m1)), _2 = Math.sin(d2), m2 = Math.cos(d2), a2 = d2 - ((h2 = -t3.SinCosSeries(true, this._stau1 * m2 + this._ctau1 * _2, this._ctau1 * m2 - this._stau1 * _2, this._C1pa)) - this._B11), n2 = Math.sin(a2), o2 = Math.cos(a2), Math.abs(this.f) > 0.01 && (l2 = this._ssig1 * o2 + this._csig1 * n2, u2 = this._csig1 * o2 - this._ssig1 * n2, h2 = t3.SinCosSeries(true, l2, u2, this._C1a), a2 -= ((1 + this._A1m1) * (a2 + (h2 - this._B11)) - i3 / this._b) / Math.sqrt(1 + this._k2 * s3.sq(l2)), n2 = Math.sin(a2), o2 = Math.cos(a2))), l2 = this._ssig1 * o2 + this._csig1 * n2, u2 = this._csig1 * o2 - this._ssig1 * n2, C2 = Math.sqrt(1 + this._k2 * s3.sq(l2)), r3 & (t3.DISTANCE | t3.REDUCEDLENGTH | t3.GEODESICSCALE) && ((e4 || Math.abs(this.f) > 0.01) && (h2 = t3.SinCosSeries(true, l2, u2, this._C1a)), c2 = (1 + this._A1m1) * (h2 - this._B11)), y2 = this._calp0 * l2, 0 === (g2 = s3.hypot(this._salp0, this._calp0 * u2)) && (g2 = u2 = t3.tiny_), w2 = this._salp0, S2 = this._calp0 * u2, e4 && r3 & t3.DISTANCE && (z2.s12 = this._b * ((1 + this._A1m1) * a2 + c2)), r3 & t3.LONGITUDE && (M2 = this._salp0 * l2, x2 = u2, p2 = s3.copysign(1, this._salp0), f2 = ((r3 & t3.LONG_UNROLL ? p2 * (a2 - (Math.atan2(l2, u2) - Math.atan2(this._ssig1, this._csig1)) + (Math.atan2(p2 * M2, x2) - Math.atan2(p2 * this._somg1, this._comg1))) : Math.atan2(M2 * this._comg1 - x2 * this._somg1, x2 * this._comg1 + M2 * this._somg1)) + this._A3c * (a2 + (t3.SinCosSeries(true, l2, u2, this._C3a) - this._B31))) / s3.degree, z2.lon2 = r3 & t3.LONG_UNROLL ? this.lon1 + f2 : s3.AngNormalize(s3.AngNormalize(this.lon1) + s3.AngNormalize(f2))), r3 & t3.LATITUDE && (z2.lat2 = s3.atan2d(y2, this._f1 * g2)), r3 & t3.AZIMUTH && (z2.azi2 = s3.atan2d(w2, S2)), r3 & (t3.REDUCEDLENGTH | t3.GEODESICSCALE) && (E2 = t3.SinCosSeries(true, l2, u2, this._C2a), P2 = (1 + this._A2m1) * (E2 - this._B21), b2 = (this._A1m1 - this._A2m1) * a2 + (c2 - P2), r3 & t3.REDUCEDLENGTH && (z2.m12 = this._b * (C2 * (this._csig1 * l2) - this._dn1 * (this._ssig1 * u2) - this._csig1 * u2 * b2)), r3 & t3.GEODESICSCALE && (v2 = this._k2 * (l2 - this._ssig1) * (l2 + this._ssig1) / (this._dn1 + C2), z2.M12 = o2 + (v2 * l2 - u2 * b2) * this._ssig1 / this._dn1, z2.M21 = o2 - (v2 * this._ssig1 - this._csig1 * b2) * l2 / C2)), r3 & t3.AREA && (A3 = t3.SinCosSeries(false, l2, u2, this._C4a), 0 === this._calp0 || 0 === this._salp0 ? (T2 = w2 * this.calp1 - S2 * this.salp1, I2 = S2 * this.calp1 + w2 * this.salp1) : (T2 = this._calp0 * this._salp0 * (o2 <= 0 ? this._csig1 * (1 - o2) + n2 * this._ssig1 : n2 * (this._csig1 * n2 / (1 + o2) + this._ssig1)), I2 = s3.sq(this._salp0) + s3.sq(this._calp0) * this._csig1 * u2), z2.S12 = this._c2 * Math.atan2(T2, I2) + this._A4 * (A3 - this._B41)), e4 || (z2.a12 = a2 / s3.degree), z2) : (z2.a12 = NaN, z2);
6226
+ var a2, n2, o2, h2, c2, l2, u2, d2, _2, m2, p2, f2, y2, g2, M2, x2, w2, S2, C2, E2, P2, b2, v2, A3, T2, I2, z2 = {};
6227
+ return r3 ? r3 === t3.LONG_UNROLL && (r3 |= t3.STANDARD) : r3 = t3.STANDARD, r3 &= this.caps & t3.OUT_MASK, z2.lat1 = this.lat1, z2.azi1 = this.azi1, z2.lon1 = r3 & t3.LONG_UNROLL ? this.lon1 : s3.AngNormalize(this.lon1), e4 ? z2.a12 = i3 : z2.s12 = i3, e4 || this.caps & t3.DISTANCE_IN & t3.OUT_MASK ? (h2 = 0, c2 = 0, e4 ? (a2 = i3 * s3.degree, n2 = (v2 = s3.sincosd(i3)).s, o2 = v2.c) : (d2 = i3 / (this._b * (1 + this._A1m1)), _2 = Math.sin(d2), m2 = Math.cos(d2), a2 = d2 - ((h2 = -t3.SinCosSeries(true, this._stau1 * m2 + this._ctau1 * _2, this._ctau1 * m2 - this._stau1 * _2, this._C1pa)) - this._B11), n2 = Math.sin(a2), o2 = Math.cos(a2), Math.abs(this.f) > 0.01 && (l2 = this._ssig1 * o2 + this._csig1 * n2, u2 = this._csig1 * o2 - this._ssig1 * n2, h2 = t3.SinCosSeries(true, l2, u2, this._C1a), a2 -= ((1 + this._A1m1) * (a2 + (h2 - this._B11)) - i3 / this._b) / Math.sqrt(1 + this._k2 * s3.sq(l2)), n2 = Math.sin(a2), o2 = Math.cos(a2))), l2 = this._ssig1 * o2 + this._csig1 * n2, u2 = this._csig1 * o2 - this._ssig1 * n2, C2 = Math.sqrt(1 + this._k2 * s3.sq(l2)), r3 & (t3.DISTANCE | t3.REDUCEDLENGTH | t3.GEODESICSCALE) && ((e4 || Math.abs(this.f) > 0.01) && (h2 = t3.SinCosSeries(true, l2, u2, this._C1a)), c2 = (1 + this._A1m1) * (h2 - this._B11)), y2 = this._calp0 * l2, 0 === (g2 = s3.hypot(this._salp0, this._calp0 * u2)) && (g2 = u2 = t3.tiny_), w2 = this._salp0, S2 = this._calp0 * u2, e4 && r3 & t3.DISTANCE && (z2.s12 = this._b * ((1 + this._A1m1) * a2 + c2)), r3 & t3.LONGITUDE && (M2 = this._salp0 * l2, x2 = u2, f2 = s3.copysign(1, this._salp0), p2 = ((r3 & t3.LONG_UNROLL ? f2 * (a2 - (Math.atan2(l2, u2) - Math.atan2(this._ssig1, this._csig1)) + (Math.atan2(f2 * M2, x2) - Math.atan2(f2 * this._somg1, this._comg1))) : Math.atan2(M2 * this._comg1 - x2 * this._somg1, x2 * this._comg1 + M2 * this._somg1)) + this._A3c * (a2 + (t3.SinCosSeries(true, l2, u2, this._C3a) - this._B31))) / s3.degree, z2.lon2 = r3 & t3.LONG_UNROLL ? this.lon1 + p2 : s3.AngNormalize(s3.AngNormalize(this.lon1) + s3.AngNormalize(p2))), r3 & t3.LATITUDE && (z2.lat2 = s3.atan2d(y2, this._f1 * g2)), r3 & t3.AZIMUTH && (z2.azi2 = s3.atan2d(w2, S2)), r3 & (t3.REDUCEDLENGTH | t3.GEODESICSCALE) && (E2 = t3.SinCosSeries(true, l2, u2, this._C2a), P2 = (1 + this._A2m1) * (E2 - this._B21), b2 = (this._A1m1 - this._A2m1) * a2 + (c2 - P2), r3 & t3.REDUCEDLENGTH && (z2.m12 = this._b * (C2 * (this._csig1 * l2) - this._dn1 * (this._ssig1 * u2) - this._csig1 * u2 * b2)), r3 & t3.GEODESICSCALE && (v2 = this._k2 * (l2 - this._ssig1) * (l2 + this._ssig1) / (this._dn1 + C2), z2.M12 = o2 + (v2 * l2 - u2 * b2) * this._ssig1 / this._dn1, z2.M21 = o2 - (v2 * this._ssig1 - this._csig1 * b2) * l2 / C2)), r3 & t3.AREA && (A3 = t3.SinCosSeries(false, l2, u2, this._C4a), 0 === this._calp0 || 0 === this._salp0 ? (T2 = w2 * this.calp1 - S2 * this.salp1, I2 = S2 * this.calp1 + w2 * this.salp1) : (T2 = this._calp0 * this._salp0 * (o2 <= 0 ? this._csig1 * (1 - o2) + n2 * this._ssig1 : n2 * (this._csig1 * n2 / (1 + o2) + this._ssig1)), I2 = s3.sq(this._salp0) + s3.sq(this._calp0) * this._csig1 * u2), z2.S12 = this._c2 * Math.atan2(T2, I2) + this._A4 * (A3 - this._B41)), e4 || (z2.a12 = a2 / s3.degree), z2) : (z2.a12 = NaN, z2);
6197
6228
  }, e3.GeodesicLine.prototype.Position = function(t4, e4) {
6198
6229
  return this.GenPosition(false, t4, e4);
6199
6230
  }, e3.GeodesicLine.prototype.ArcPosition = function(t4, e4) {
@@ -6250,17 +6281,17 @@ proj4Src.exports = function() {
6250
6281
  this.sin_p12 = Math.sin(this.lat0), this.cos_p12 = Math.cos(this.lat0), this.g = new zr.Geodesic.Geodesic(this.a, this.es / (1 + Math.sqrt(1 - this.es)));
6251
6282
  }
6252
6283
  function Nr(t2) {
6253
- var e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2, _2, p2, y2, g2, M2 = t2.x, x2 = t2.y, w2 = Math.sin(t2.y), S2 = Math.cos(t2.y), C2 = pt(M2 - this.long0);
6254
- return this.sphere ? Math.abs(this.sin_p12 - 1) <= m ? (t2.x = this.x0 + this.a * (l - x2) * Math.sin(C2), t2.y = this.y0 - this.a * (l - x2) * Math.cos(C2), t2) : Math.abs(this.sin_p12 + 1) <= m ? (t2.x = this.x0 + this.a * (l + x2) * Math.sin(C2), t2.y = this.y0 + this.a * (l + x2) * Math.cos(C2), t2) : (c2 = this.sin_p12 * w2 + this.cos_p12 * S2 * Math.cos(C2), h2 = (o2 = Math.acos(c2)) ? o2 / Math.sin(o2) : 1, t2.x = this.x0 + this.a * h2 * S2 * Math.sin(C2), t2.y = this.y0 + this.a * h2 * (this.cos_p12 * w2 - this.sin_p12 * S2 * Math.cos(C2)), t2) : (e2 = ci(this.es), s2 = li(this.es), i2 = ui(this.es), r2 = di(this.es), Math.abs(this.sin_p12 - 1) <= m ? (a2 = this.a * hi(e2, s2, i2, r2, l), n2 = this.a * hi(e2, s2, i2, r2, x2), t2.x = this.x0 + (a2 - n2) * Math.sin(C2), t2.y = this.y0 - (a2 - n2) * Math.cos(C2), t2) : Math.abs(this.sin_p12 + 1) <= m ? (a2 = this.a * hi(e2, s2, i2, r2, l), n2 = this.a * hi(e2, s2, i2, r2, x2), t2.x = this.x0 + (a2 + n2) * Math.sin(C2), t2.y = this.y0 + (a2 + n2) * Math.cos(C2), t2) : Math.abs(M2) < m && Math.abs(x2 - this.lat0) < m ? (t2.x = t2.y = 0, t2) : (u2 = this.lat0 / f, d2 = this.long0 / f, _2 = x2 / f, p2 = M2 / f, g2 = (y2 = this.g.Inverse(u2, d2, _2, p2, this.g.AZIMUTH)).azi1 * f, t2.x = y2.s12 * Math.sin(g2), t2.y = y2.s12 * Math.cos(g2), t2));
6284
+ var e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2, _2, f2, y2, g2, M2 = t2.x, x2 = t2.y, w2 = Math.sin(t2.y), S2 = Math.cos(t2.y), C2 = ft(M2 - this.long0);
6285
+ return this.sphere ? Math.abs(this.sin_p12 - 1) <= m ? (t2.x = this.x0 + this.a * (l - x2) * Math.sin(C2), t2.y = this.y0 - this.a * (l - x2) * Math.cos(C2), t2) : Math.abs(this.sin_p12 + 1) <= m ? (t2.x = this.x0 + this.a * (l + x2) * Math.sin(C2), t2.y = this.y0 + this.a * (l + x2) * Math.cos(C2), t2) : (c2 = this.sin_p12 * w2 + this.cos_p12 * S2 * Math.cos(C2), h2 = (o2 = Math.acos(c2)) ? o2 / Math.sin(o2) : 1, t2.x = this.x0 + this.a * h2 * S2 * Math.sin(C2), t2.y = this.y0 + this.a * h2 * (this.cos_p12 * w2 - this.sin_p12 * S2 * Math.cos(C2)), t2) : (e2 = ci(this.es), s2 = li(this.es), i2 = ui(this.es), r2 = di(this.es), Math.abs(this.sin_p12 - 1) <= m ? (a2 = this.a * hi(e2, s2, i2, r2, l), n2 = this.a * hi(e2, s2, i2, r2, x2), t2.x = this.x0 + (a2 - n2) * Math.sin(C2), t2.y = this.y0 - (a2 - n2) * Math.cos(C2), t2) : Math.abs(this.sin_p12 + 1) <= m ? (a2 = this.a * hi(e2, s2, i2, r2, l), n2 = this.a * hi(e2, s2, i2, r2, x2), t2.x = this.x0 + (a2 + n2) * Math.sin(C2), t2.y = this.y0 + (a2 + n2) * Math.cos(C2), t2) : Math.abs(M2) < m && Math.abs(x2 - this.lat0) < m ? (t2.x = t2.y = 0, t2) : (u2 = this.lat0 / p, d2 = this.long0 / p, _2 = x2 / p, f2 = M2 / p, g2 = (y2 = this.g.Inverse(u2, d2, _2, f2, this.g.AZIMUTH)).azi1 * p, t2.x = y2.s12 * Math.sin(g2), t2.y = y2.s12 * Math.cos(g2), t2));
6255
6286
  }
6256
6287
  function Gr(t2) {
6257
- var e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2, _2, p2, y2, g2, M2, x2;
6288
+ var e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2, _2, f2, y2, g2, M2, x2;
6258
6289
  if (t2.x -= this.x0, t2.y -= this.y0, this.sphere) {
6259
6290
  if ((e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y)) > 2 * l * this.a)
6260
6291
  return;
6261
- return s2 = e2 / this.a, i2 = Math.sin(s2), r2 = Math.cos(s2), a2 = this.long0, Math.abs(e2) <= m ? n2 = this.lat0 : (n2 = Ni(r2 * this.sin_p12 + t2.y * i2 * this.cos_p12 / e2), o2 = Math.abs(this.lat0) - l, a2 = Math.abs(o2) <= m ? this.lat0 >= 0 ? pt(this.long0 + Math.atan2(t2.x, -t2.y)) : pt(this.long0 - Math.atan2(-t2.x, t2.y)) : pt(this.long0 + Math.atan2(t2.x * i2, e2 * this.cos_p12 * r2 - t2.y * this.sin_p12 * i2))), t2.x = a2, t2.y = n2, t2;
6292
+ return s2 = e2 / this.a, i2 = Math.sin(s2), r2 = Math.cos(s2), a2 = this.long0, Math.abs(e2) <= m ? n2 = this.lat0 : (n2 = Ni(r2 * this.sin_p12 + t2.y * i2 * this.cos_p12 / e2), o2 = Math.abs(this.lat0) - l, a2 = Math.abs(o2) <= m ? this.lat0 >= 0 ? ft(this.long0 + Math.atan2(t2.x, -t2.y)) : ft(this.long0 - Math.atan2(-t2.x, t2.y)) : ft(this.long0 + Math.atan2(t2.x * i2, e2 * this.cos_p12 * r2 - t2.y * this.sin_p12 * i2))), t2.x = a2, t2.y = n2, t2;
6262
6293
  }
6263
- return h2 = ci(this.es), c2 = li(this.es), u2 = ui(this.es), d2 = di(this.es), Math.abs(this.sin_p12 - 1) <= m ? (n2 = fi(((_2 = this.a * hi(h2, c2, u2, d2, l)) - (e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y))) / this.a, h2, c2, u2, d2), a2 = pt(this.long0 + Math.atan2(t2.x, -1 * t2.y)), t2.x = a2, t2.y = n2, t2) : Math.abs(this.sin_p12 + 1) <= m ? (_2 = this.a * hi(h2, c2, u2, d2, l), n2 = fi(((e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y)) - _2) / this.a, h2, c2, u2, d2), a2 = pt(this.long0 + Math.atan2(t2.x, t2.y)), t2.x = a2, t2.y = n2, t2) : (p2 = this.lat0 / f, y2 = this.long0 / f, g2 = Math.atan2(t2.x, t2.y) / f, M2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y), x2 = this.g.Direct(p2, y2, g2, M2, this.g.STANDARD), t2.x = x2.lon2 * f, t2.y = x2.lat2 * f, t2);
6294
+ return h2 = ci(this.es), c2 = li(this.es), u2 = ui(this.es), d2 = di(this.es), Math.abs(this.sin_p12 - 1) <= m ? (n2 = pi(((_2 = this.a * hi(h2, c2, u2, d2, l)) - (e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y))) / this.a, h2, c2, u2, d2), a2 = ft(this.long0 + Math.atan2(t2.x, -1 * t2.y)), t2.x = a2, t2.y = n2, t2) : Math.abs(this.sin_p12 + 1) <= m ? (_2 = this.a * hi(h2, c2, u2, d2, l), n2 = pi(((e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y)) - _2) / this.a, h2, c2, u2, d2), a2 = ft(this.long0 + Math.atan2(t2.x, t2.y)), t2.x = a2, t2.y = n2, t2) : (f2 = this.lat0 / p, y2 = this.long0 / p, g2 = Math.atan2(t2.x, t2.y) / p, M2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y), x2 = this.g.Direct(f2, y2, g2, M2, this.g.STANDARD), t2.x = x2.lon2 * p, t2.y = x2.lat2 * p, t2);
6264
6295
  }
6265
6296
  var Rr = { init: Or, forward: Nr, inverse: Gr, names: ["Azimuthal_Equidistant", "aeqd"] };
6266
6297
  function Lr() {
@@ -6268,11 +6299,11 @@ proj4Src.exports = function() {
6268
6299
  }
6269
6300
  function $r(t2) {
6270
6301
  var e2, s2, i2, r2, a2, n2, o2, h2, c2 = t2.x, l2 = t2.y;
6271
- return i2 = pt(c2 - this.long0), e2 = Math.sin(l2), s2 = Math.cos(l2), r2 = Math.cos(i2), a2 = 1, ((n2 = this.sin_p14 * e2 + this.cos_p14 * s2 * r2) > 0 || Math.abs(n2) <= m) && (o2 = this.a * a2 * s2 * Math.sin(i2), h2 = this.y0 + this.a * a2 * (this.cos_p14 * e2 - this.sin_p14 * s2 * r2)), t2.x = o2, t2.y = h2, t2;
6302
+ return i2 = ft(c2 - this.long0), e2 = Math.sin(l2), s2 = Math.cos(l2), r2 = Math.cos(i2), a2 = 1, ((n2 = this.sin_p14 * e2 + this.cos_p14 * s2 * r2) > 0 || Math.abs(n2) <= m) && (o2 = this.a * a2 * s2 * Math.sin(i2), h2 = this.y0 + this.a * a2 * (this.cos_p14 * e2 - this.sin_p14 * s2 * r2)), t2.x = o2, t2.y = h2, t2;
6272
6303
  }
6273
6304
  function Vr(t2) {
6274
6305
  var e2, s2, i2, r2, a2, n2, o2;
6275
- return t2.x -= this.x0, t2.y -= this.y0, s2 = Ni((e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y)) / this.a), i2 = Math.sin(s2), r2 = Math.cos(s2), n2 = this.long0, Math.abs(e2) <= m ? (o2 = this.lat0, t2.x = n2, t2.y = o2, t2) : (o2 = Ni(r2 * this.sin_p14 + t2.y * i2 * this.cos_p14 / e2), a2 = Math.abs(this.lat0) - l, Math.abs(a2) <= m ? (n2 = this.lat0 >= 0 ? pt(this.long0 + Math.atan2(t2.x, -t2.y)) : pt(this.long0 - Math.atan2(-t2.x, t2.y)), t2.x = n2, t2.y = o2, t2) : (n2 = pt(this.long0 + Math.atan2(t2.x * i2, e2 * this.cos_p14 * r2 - t2.y * this.sin_p14 * i2)), t2.x = n2, t2.y = o2, t2));
6306
+ return t2.x -= this.x0, t2.y -= this.y0, s2 = Ni((e2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y)) / this.a), i2 = Math.sin(s2), r2 = Math.cos(s2), n2 = this.long0, Math.abs(e2) <= m ? (o2 = this.lat0, t2.x = n2, t2.y = o2, t2) : (o2 = Ni(r2 * this.sin_p14 + t2.y * i2 * this.cos_p14 / e2), a2 = Math.abs(this.lat0) - l, Math.abs(a2) <= m ? (n2 = this.lat0 >= 0 ? ft(this.long0 + Math.atan2(t2.x, -t2.y)) : ft(this.long0 - Math.atan2(-t2.x, t2.y)), t2.x = n2, t2.y = o2, t2) : (n2 = ft(this.long0 + Math.atan2(t2.x * i2, e2 * this.cos_p14 * r2 - t2.y * this.sin_p14 * i2)), t2.x = n2, t2.y = o2, t2));
6276
6307
  }
6277
6308
  var qr = { init: Lr, forward: $r, inverse: Vr, names: ["ortho"] }, jr = { FRONT: 1, RIGHT: 2, BACK: 3, LEFT: 4, TOP: 5, BOTTOM: 6 }, Dr = { AREA_0: 1, AREA_1: 2, AREA_2: 3, AREA_3: 4 };
6278
6309
  function Br() {
@@ -6285,20 +6316,20 @@ proj4Src.exports = function() {
6285
6316
  else if (this.face === jr.BOTTOM)
6286
6317
  r2 = l + e2, s2 >= y && s2 <= l + y ? (h2.value = Dr.AREA_0, i2 = -s2 + l) : s2 < y && s2 >= -y ? (h2.value = Dr.AREA_1, i2 = -s2) : s2 < -y && s2 >= -(l + y) ? (h2.value = Dr.AREA_2, i2 = -s2 - l) : (h2.value = Dr.AREA_3, i2 = s2 > 0 ? -s2 + M : -s2 - M);
6287
6318
  else {
6288
- var c2, u2, d2, _2, m2, f2;
6289
- this.face === jr.RIGHT ? s2 = Wr(s2, +l) : this.face === jr.BACK ? s2 = Wr(s2, 3.14159265359) : this.face === jr.LEFT && (s2 = Wr(s2, -l)), _2 = Math.sin(e2), m2 = Math.cos(e2), f2 = Math.sin(s2), c2 = m2 * Math.cos(s2), u2 = m2 * f2, d2 = _2, this.face === jr.FRONT ? i2 = Ur(r2 = Math.acos(c2), d2, u2, h2) : this.face === jr.RIGHT ? i2 = Ur(r2 = Math.acos(u2), d2, -c2, h2) : this.face === jr.BACK ? i2 = Ur(r2 = Math.acos(-c2), d2, -u2, h2) : this.face === jr.LEFT ? i2 = Ur(r2 = Math.acos(-u2), d2, c2, h2) : (r2 = i2 = 0, h2.value = Dr.AREA_0);
6319
+ var c2, u2, d2, _2, m2, p2;
6320
+ this.face === jr.RIGHT ? s2 = Wr(s2, +l) : this.face === jr.BACK ? s2 = Wr(s2, 3.14159265359) : this.face === jr.LEFT && (s2 = Wr(s2, -l)), _2 = Math.sin(e2), m2 = Math.cos(e2), p2 = Math.sin(s2), c2 = m2 * Math.cos(s2), u2 = m2 * p2, d2 = _2, this.face === jr.FRONT ? i2 = Ur(r2 = Math.acos(c2), d2, u2, h2) : this.face === jr.RIGHT ? i2 = Ur(r2 = Math.acos(u2), d2, -c2, h2) : this.face === jr.BACK ? i2 = Ur(r2 = Math.acos(-c2), d2, -u2, h2) : this.face === jr.LEFT ? i2 = Ur(r2 = Math.acos(-u2), d2, c2, h2) : (r2 = i2 = 0, h2.value = Dr.AREA_0);
6290
6321
  }
6291
6322
  return n2 = Math.atan(12 / M * (i2 + Math.acos(Math.sin(i2) * Math.cos(y)) - l)), a2 = Math.sqrt((1 - Math.cos(r2)) / (Math.cos(n2) * Math.cos(n2)) / (1 - Math.cos(Math.atan(1 / Math.cos(i2))))), h2.value === Dr.AREA_1 ? n2 += l : h2.value === Dr.AREA_2 ? n2 += M : h2.value === Dr.AREA_3 && (n2 += 1.5 * M), o2.x = a2 * Math.cos(n2), o2.y = a2 * Math.sin(n2), o2.x = o2.x * this.a + this.x0, o2.y = o2.y * this.a + this.y0, t2.x = o2.x, t2.y = o2.y, t2;
6292
6323
  }
6293
6324
  function Fr(t2) {
6294
- var e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2, _2, m2 = { lam: 0, phi: 0 }, f2 = { value: 0 };
6295
- if (t2.x = (t2.x - this.x0) / this.a, t2.y = (t2.y - this.y0) / this.a, s2 = Math.atan(Math.sqrt(t2.x * t2.x + t2.y * t2.y)), e2 = Math.atan2(t2.y, t2.x), t2.x >= 0 && t2.x >= Math.abs(t2.y) ? f2.value = Dr.AREA_0 : t2.y >= 0 && t2.y >= Math.abs(t2.x) ? (f2.value = Dr.AREA_1, e2 -= l) : t2.x < 0 && -t2.x >= Math.abs(t2.y) ? (f2.value = Dr.AREA_2, e2 = e2 < 0 ? e2 + M : e2 - M) : (f2.value = Dr.AREA_3, e2 += l), c2 = M / 12 * Math.tan(e2), a2 = Math.sin(c2) / (Math.cos(c2) - 1 / Math.sqrt(2)), n2 = Math.atan(a2), (o2 = 1 - (i2 = Math.cos(e2)) * i2 * (r2 = Math.tan(s2)) * r2 * (1 - Math.cos(Math.atan(1 / Math.cos(n2))))) < -1 ? o2 = -1 : o2 > 1 && (o2 = 1), this.face === jr.TOP)
6296
- h2 = Math.acos(o2), m2.phi = l - h2, f2.value === Dr.AREA_0 ? m2.lam = n2 + l : f2.value === Dr.AREA_1 ? m2.lam = n2 < 0 ? n2 + M : n2 - M : f2.value === Dr.AREA_2 ? m2.lam = n2 - l : m2.lam = n2;
6325
+ var e2, s2, i2, r2, a2, n2, o2, h2, c2, u2, d2, _2, m2 = { lam: 0, phi: 0 }, p2 = { value: 0 };
6326
+ if (t2.x = (t2.x - this.x0) / this.a, t2.y = (t2.y - this.y0) / this.a, s2 = Math.atan(Math.sqrt(t2.x * t2.x + t2.y * t2.y)), e2 = Math.atan2(t2.y, t2.x), t2.x >= 0 && t2.x >= Math.abs(t2.y) ? p2.value = Dr.AREA_0 : t2.y >= 0 && t2.y >= Math.abs(t2.x) ? (p2.value = Dr.AREA_1, e2 -= l) : t2.x < 0 && -t2.x >= Math.abs(t2.y) ? (p2.value = Dr.AREA_2, e2 = e2 < 0 ? e2 + M : e2 - M) : (p2.value = Dr.AREA_3, e2 += l), c2 = M / 12 * Math.tan(e2), a2 = Math.sin(c2) / (Math.cos(c2) - 1 / Math.sqrt(2)), n2 = Math.atan(a2), (o2 = 1 - (i2 = Math.cos(e2)) * i2 * (r2 = Math.tan(s2)) * r2 * (1 - Math.cos(Math.atan(1 / Math.cos(n2))))) < -1 ? o2 = -1 : o2 > 1 && (o2 = 1), this.face === jr.TOP)
6327
+ h2 = Math.acos(o2), m2.phi = l - h2, p2.value === Dr.AREA_0 ? m2.lam = n2 + l : p2.value === Dr.AREA_1 ? m2.lam = n2 < 0 ? n2 + M : n2 - M : p2.value === Dr.AREA_2 ? m2.lam = n2 - l : m2.lam = n2;
6297
6328
  else if (this.face === jr.BOTTOM)
6298
- h2 = Math.acos(o2), m2.phi = h2 - l, f2.value === Dr.AREA_0 ? m2.lam = -n2 + l : f2.value === Dr.AREA_1 ? m2.lam = -n2 : f2.value === Dr.AREA_2 ? m2.lam = -n2 - l : m2.lam = n2 < 0 ? -n2 - M : -n2 + M;
6329
+ h2 = Math.acos(o2), m2.phi = h2 - l, p2.value === Dr.AREA_0 ? m2.lam = -n2 + l : p2.value === Dr.AREA_1 ? m2.lam = -n2 : p2.value === Dr.AREA_2 ? m2.lam = -n2 - l : m2.lam = n2 < 0 ? -n2 - M : -n2 + M;
6299
6330
  else {
6300
- var p2, y2, g2;
6301
- c2 = (p2 = o2) * p2, y2 = (c2 += (g2 = c2 >= 1 ? 0 : Math.sqrt(1 - c2) * Math.sin(n2)) * g2) >= 1 ? 0 : Math.sqrt(1 - c2), f2.value === Dr.AREA_1 ? (c2 = y2, y2 = -g2, g2 = c2) : f2.value === Dr.AREA_2 ? (y2 = -y2, g2 = -g2) : f2.value === Dr.AREA_3 && (c2 = y2, y2 = g2, g2 = -c2), this.face === jr.RIGHT ? (c2 = p2, p2 = -y2, y2 = c2) : this.face === jr.BACK ? (p2 = -p2, y2 = -y2) : this.face === jr.LEFT && (c2 = p2, p2 = y2, y2 = -c2), m2.phi = Math.acos(-g2) - l, m2.lam = Math.atan2(y2, p2), this.face === jr.RIGHT ? m2.lam = Wr(m2.lam, -l) : this.face === jr.BACK ? m2.lam = Wr(m2.lam, -3.14159265359) : this.face === jr.LEFT && (m2.lam = Wr(m2.lam, +l));
6331
+ var f2, y2, g2;
6332
+ c2 = (f2 = o2) * f2, y2 = (c2 += (g2 = c2 >= 1 ? 0 : Math.sqrt(1 - c2) * Math.sin(n2)) * g2) >= 1 ? 0 : Math.sqrt(1 - c2), p2.value === Dr.AREA_1 ? (c2 = y2, y2 = -g2, g2 = c2) : p2.value === Dr.AREA_2 ? (y2 = -y2, g2 = -g2) : p2.value === Dr.AREA_3 && (c2 = y2, y2 = g2, g2 = -c2), this.face === jr.RIGHT ? (c2 = f2, f2 = -y2, y2 = c2) : this.face === jr.BACK ? (f2 = -f2, y2 = -y2) : this.face === jr.LEFT && (c2 = f2, f2 = y2, y2 = -c2), m2.phi = Math.acos(-g2) - l, m2.lam = Math.atan2(y2, f2), this.face === jr.RIGHT ? m2.lam = Wr(m2.lam, -l) : this.face === jr.BACK ? m2.lam = Wr(m2.lam, -3.14159265359) : this.face === jr.LEFT && (m2.lam = Wr(m2.lam, +l));
6302
6333
  }
6303
6334
  return 0 !== this.es && (u2 = m2.phi < 0 ? 1 : 0, d2 = Math.tan(m2.phi), _2 = this.b / Math.sqrt(d2 * d2 + this.one_minus_f_squared), m2.phi = Math.atan(Math.sqrt(this.a * this.a - _2 * _2) / (this.one_minus_f * _2)), u2 && (m2.phi = -m2.phi)), m2.lam += this.long0, t2.x = m2.lam, t2.y = m2.phi, t2;
6304
6335
  }
@@ -6310,7 +6341,7 @@ proj4Src.exports = function() {
6310
6341
  var s2 = t2 + e2;
6311
6342
  return s2 < -3.14159265359 ? s2 += g : s2 > 3.14159265359 && (s2 -= g), s2;
6312
6343
  }
6313
- var Yr = { init: Br, forward: kr, inverse: Fr, names: ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"] }, Qr = [[1, 22199e-21, -715515e-10, 31103e-10], [0.9986, -482243e-9, -24897e-9, -13309e-10], [0.9954, -83103e-8, -448605e-10, -986701e-12], [0.99, -135364e-8, -59661e-9, 36777e-10], [0.9822, -167442e-8, -449547e-11, -572411e-11], [0.973, -214868e-8, -903571e-10, 18736e-12], [0.96, -305085e-8, -900761e-10, 164917e-11], [0.9427, -382792e-8, -653386e-10, -26154e-10], [0.9216, -467746e-8, -10457e-8, 481243e-11], [0.8962, -536223e-8, -323831e-10, -543432e-11], [0.8679, -609363e-8, -113898e-9, 332484e-11], [0.835, -698325e-8, -640253e-10, 934959e-12], [0.7986, -755338e-8, -500009e-10, 935324e-12], [0.7597, -798324e-8, -35971e-9, -227626e-11], [0.7186, -851367e-8, -701149e-10, -86303e-10], [0.6732, -986209e-8, -199569e-9, 191974e-10], [0.6213, -0.010418, 883923e-10, 624051e-11], [0.5722, -906601e-8, 182e-6, 624051e-11], [0.5322, -677797e-8, 275608e-9, 624051e-11]], Xr = [[-520417e-23, 0.0124, 121431e-23, -845284e-16], [0.062, 0.0124, -126793e-14, 422642e-15], [0.124, 0.0124, 507171e-14, -160604e-14], [0.186, 0.0123999, -190189e-13, 600152e-14], [0.248, 0.0124002, 710039e-13, -224e-10], [0.31, 0.0123992, -264997e-12, 835986e-13], [0.372, 0.0124029, 988983e-12, -311994e-12], [0.434, 0.0123893, -369093e-11, -435621e-12], [0.4958, 0.0123198, -102252e-10, -345523e-12], [0.5571, 0.0121916, -154081e-10, -582288e-12], [0.6176, 0.0119938, -241424e-10, -525327e-12], [0.6769, 0.011713, -320223e-10, -516405e-12], [0.7346, 0.0113541, -397684e-10, -609052e-12], [0.7903, 0.0109107, -489042e-10, -104739e-11], [0.8435, 0.0103431, -64615e-9, -140374e-14], [0.8936, 969686e-8, -64636e-9, -8547e-9], [0.9394, 840947e-8, -192841e-9, -42106e-10], [0.9761, 616527e-8, -256e-6, -42106e-10], [1, 328947e-8, -319159e-9, -42106e-10]], Hr = 0.8487, Zr = 1.3523, Kr = p / 5, Jr = 1 / Kr, ta = 18, ea = function(t2, e2) {
6344
+ var Yr = { init: Br, forward: kr, inverse: Fr, names: ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"] }, Qr = [[1, 22199e-21, -715515e-10, 31103e-10], [0.9986, -482243e-9, -24897e-9, -13309e-10], [0.9954, -83103e-8, -448605e-10, -986701e-12], [0.99, -135364e-8, -59661e-9, 36777e-10], [0.9822, -167442e-8, -449547e-11, -572411e-11], [0.973, -214868e-8, -903571e-10, 18736e-12], [0.96, -305085e-8, -900761e-10, 164917e-11], [0.9427, -382792e-8, -653386e-10, -26154e-10], [0.9216, -467746e-8, -10457e-8, 481243e-11], [0.8962, -536223e-8, -323831e-10, -543432e-11], [0.8679, -609363e-8, -113898e-9, 332484e-11], [0.835, -698325e-8, -640253e-10, 934959e-12], [0.7986, -755338e-8, -500009e-10, 935324e-12], [0.7597, -798324e-8, -35971e-9, -227626e-11], [0.7186, -851367e-8, -701149e-10, -86303e-10], [0.6732, -986209e-8, -199569e-9, 191974e-10], [0.6213, -0.010418, 883923e-10, 624051e-11], [0.5722, -906601e-8, 182e-6, 624051e-11], [0.5322, -677797e-8, 275608e-9, 624051e-11]], Xr = [[-520417e-23, 0.0124, 121431e-23, -845284e-16], [0.062, 0.0124, -126793e-14, 422642e-15], [0.124, 0.0124, 507171e-14, -160604e-14], [0.186, 0.0123999, -190189e-13, 600152e-14], [0.248, 0.0124002, 710039e-13, -224e-10], [0.31, 0.0123992, -264997e-12, 835986e-13], [0.372, 0.0124029, 988983e-12, -311994e-12], [0.434, 0.0123893, -369093e-11, -435621e-12], [0.4958, 0.0123198, -102252e-10, -345523e-12], [0.5571, 0.0121916, -154081e-10, -582288e-12], [0.6176, 0.0119938, -241424e-10, -525327e-12], [0.6769, 0.011713, -320223e-10, -516405e-12], [0.7346, 0.0113541, -397684e-10, -609052e-12], [0.7903, 0.0109107, -489042e-10, -104739e-11], [0.8435, 0.0103431, -64615e-9, -140374e-14], [0.8936, 969686e-8, -64636e-9, -8547e-9], [0.9394, 840947e-8, -192841e-9, -42106e-10], [0.9761, 616527e-8, -256e-6, -42106e-10], [1, 328947e-8, -319159e-9, -42106e-10]], Hr = 0.8487, Zr = 1.3523, Kr = f / 5, Jr = 1 / Kr, ta = 18, ea = function(t2, e2) {
6314
6345
  return t2[0] + e2 * (t2[1] + e2 * (t2[2] + e2 * t2[3]));
6315
6346
  }, sa = function(t2, e2) {
6316
6347
  return t2[1] + e2 * (2 * t2[2] + 3 * e2 * t2[3]);
@@ -6327,8 +6358,8 @@ proj4Src.exports = function() {
6327
6358
  this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.long0 = this.long0 || 0, this.es = 0, this.title = this.title || "Robinson";
6328
6359
  }
6329
6360
  function aa(t2) {
6330
- var e2 = pt(t2.x - this.long0), s2 = Math.abs(t2.y), i2 = Math.floor(s2 * Kr);
6331
- i2 < 0 ? i2 = 0 : i2 >= ta && (i2 = ta - 1), s2 = p * (s2 - Jr * i2);
6361
+ var e2 = ft(t2.x - this.long0), s2 = Math.abs(t2.y), i2 = Math.floor(s2 * Kr);
6362
+ i2 < 0 ? i2 = 0 : i2 >= ta && (i2 = ta - 1), s2 = f * (s2 - Jr * i2);
6332
6363
  var r2 = { x: ea(Qr[i2], s2) * e2, y: ea(Xr[i2], s2) };
6333
6364
  return t2.y < 0 && (r2.y = -r2.y), r2.x = r2.x * this.a * Hr + this.x0, r2.y = r2.y * this.a * Zr + this.y0, r2;
6334
6365
  }
@@ -6349,9 +6380,9 @@ proj4Src.exports = function() {
6349
6380
  var i2 = Xr[s2], r2 = 5 * (e2.y - i2[0]) / (Xr[s2 + 1][0] - i2[0]);
6350
6381
  r2 = ia(function(t3) {
6351
6382
  return (ea(i2, t3) - e2.y) / sa(i2, t3);
6352
- }, r2, m, 100), e2.x /= ea(Qr[s2], r2), e2.y = (5 * s2 + r2) * f, t2.y < 0 && (e2.y = -e2.y);
6383
+ }, r2, m, 100), e2.x /= ea(Qr[s2], r2), e2.y = (5 * s2 + r2) * p, t2.y < 0 && (e2.y = -e2.y);
6353
6384
  }
6354
- return e2.x = pt(e2.x + this.long0), e2;
6385
+ return e2.x = ft(e2.x + this.long0), e2;
6355
6386
  }
6356
6387
  var oa = { init: ra, forward: aa, inverse: na, names: ["Robinson", "robin"] };
6357
6388
  function ha() {
@@ -6373,14 +6404,14 @@ proj4Src.exports = function() {
6373
6404
  throw new Error("Invalid parameter value, must be numeric " + t3 + " = " + this[t3]);
6374
6405
  _a[t3].num && (this[t3] = parseFloat(this[t3]));
6375
6406
  }
6376
- _a[t3].degrees && (this[t3] = this[t3] * f);
6407
+ _a[t3].degrees && (this[t3] = this[t3] * p);
6377
6408
  }.bind(this)), Math.abs(Math.abs(this.lat0) - l) < m ? this.mode = this.lat0 < 0 ? da.S_POLE : da.N_POLE : Math.abs(this.lat0) < m ? this.mode = da.EQUIT : (this.mode = da.OBLIQ, this.sinph0 = Math.sin(this.lat0), this.cosph0 = Math.cos(this.lat0)), this.pn1 = this.h / this.a, this.pn1 <= 0 || this.pn1 > 1e10)
6378
6409
  throw new Error("Invalid height");
6379
6410
  this.p = 1 + this.pn1, this.rp = 1 / this.p, this.h1 = 1 / this.pn1, this.pfact = (this.p + 1) * this.h1, this.es = 0;
6380
6411
  var t2 = this.tilt, e2 = this.azi;
6381
6412
  this.cg = Math.cos(e2), this.sg = Math.sin(e2), this.cw = Math.cos(t2), this.sw = Math.sin(t2);
6382
6413
  }
6383
- function fa(t2) {
6414
+ function pa(t2) {
6384
6415
  t2.x -= this.long0;
6385
6416
  var e2, s2, i2, r2, a2 = Math.sin(t2.y), n2 = Math.cos(t2.y), o2 = Math.cos(t2.x);
6386
6417
  switch (this.mode) {
@@ -6411,11 +6442,11 @@ proj4Src.exports = function() {
6411
6442
  }
6412
6443
  return r2 = 1 / ((i2 = s2 * this.cg + e2 * this.sg) * this.sw * this.h1 + this.cw), e2 = (e2 * this.cg - s2 * this.sg) * this.cw * r2, s2 = i2 * r2, t2.x = e2 * this.a, t2.y = s2 * this.a, t2;
6413
6444
  }
6414
- function pa(t2) {
6445
+ function fa(t2) {
6415
6446
  t2.x /= this.a, t2.y /= this.a;
6416
6447
  var e2, s2, i2, r2 = { x: t2.x, y: t2.y };
6417
6448
  i2 = 1 / (this.pn1 - t2.y * this.sw), e2 = this.pn1 * t2.x * i2, s2 = this.pn1 * t2.y * this.cw * i2, t2.x = e2 * this.cg + s2 * this.sg, t2.y = s2 * this.cg - e2 * this.sg;
6418
- var a2 = fs(t2.x, t2.y);
6449
+ var a2 = ps(t2.x, t2.y);
6419
6450
  if (Math.abs(a2) < m)
6420
6451
  r2.x = 0, r2.y = t2.y;
6421
6452
  else {
@@ -6437,7 +6468,7 @@ proj4Src.exports = function() {
6437
6468
  }
6438
6469
  return t2.x = r2.x + this.long0, t2.y = r2.y, t2;
6439
6470
  }
6440
- var ya = { init: ma, forward: fa, inverse: pa, names: ["Tilted_Perspective", "tpers"] };
6471
+ var ya = { init: ma, forward: pa, inverse: fa, names: ["Tilted_Perspective", "tpers"] };
6441
6472
  function ga() {
6442
6473
  if (this.flip_axis = "x" === this.sweep ? 1 : 0, this.h = Number(this.h), this.radius_g_1 = this.h / this.a, this.radius_g_1 <= 0 || this.radius_g_1 > 1e10)
6443
6474
  throw new Error();
@@ -6452,18 +6483,18 @@ proj4Src.exports = function() {
6452
6483
  var e2, s2, i2, r2, a2 = t2.x, n2 = t2.y;
6453
6484
  if (a2 -= this.long0, "ellipse" === this.shape) {
6454
6485
  n2 = Math.atan(this.radius_p2 * Math.tan(n2));
6455
- var o2 = this.radius_p / fs(this.radius_p * Math.cos(n2), Math.sin(n2));
6486
+ var o2 = this.radius_p / ps(this.radius_p * Math.cos(n2), Math.sin(n2));
6456
6487
  if (s2 = o2 * Math.cos(a2) * Math.cos(n2), i2 = o2 * Math.sin(a2) * Math.cos(n2), r2 = o2 * Math.sin(n2), (this.radius_g - s2) * s2 - i2 * i2 - r2 * r2 * this.radius_p_inv2 < 0)
6457
6488
  return t2.x = Number.NaN, t2.y = Number.NaN, t2;
6458
- e2 = this.radius_g - s2, this.flip_axis ? (t2.x = this.radius_g_1 * Math.atan(i2 / fs(r2, e2)), t2.y = this.radius_g_1 * Math.atan(r2 / e2)) : (t2.x = this.radius_g_1 * Math.atan(i2 / e2), t2.y = this.radius_g_1 * Math.atan(r2 / fs(i2, e2)));
6489
+ e2 = this.radius_g - s2, this.flip_axis ? (t2.x = this.radius_g_1 * Math.atan(i2 / ps(r2, e2)), t2.y = this.radius_g_1 * Math.atan(r2 / e2)) : (t2.x = this.radius_g_1 * Math.atan(i2 / e2), t2.y = this.radius_g_1 * Math.atan(r2 / ps(i2, e2)));
6459
6490
  } else
6460
- "sphere" === this.shape && (e2 = Math.cos(n2), s2 = Math.cos(a2) * e2, i2 = Math.sin(a2) * e2, r2 = Math.sin(n2), e2 = this.radius_g - s2, this.flip_axis ? (t2.x = this.radius_g_1 * Math.atan(i2 / fs(r2, e2)), t2.y = this.radius_g_1 * Math.atan(r2 / e2)) : (t2.x = this.radius_g_1 * Math.atan(i2 / e2), t2.y = this.radius_g_1 * Math.atan(r2 / fs(i2, e2))));
6491
+ "sphere" === this.shape && (e2 = Math.cos(n2), s2 = Math.cos(a2) * e2, i2 = Math.sin(a2) * e2, r2 = Math.sin(n2), e2 = this.radius_g - s2, this.flip_axis ? (t2.x = this.radius_g_1 * Math.atan(i2 / ps(r2, e2)), t2.y = this.radius_g_1 * Math.atan(r2 / e2)) : (t2.x = this.radius_g_1 * Math.atan(i2 / e2), t2.y = this.radius_g_1 * Math.atan(r2 / ps(i2, e2))));
6461
6492
  return t2.x = t2.x * this.a, t2.y = t2.y * this.a, t2;
6462
6493
  }
6463
6494
  function xa(t2) {
6464
6495
  var e2, s2, i2, r2, a2 = -1, n2 = 0, o2 = 0;
6465
6496
  if (t2.x = t2.x / this.a, t2.y = t2.y / this.a, "ellipse" === this.shape) {
6466
- this.flip_axis ? (o2 = Math.tan(t2.y / this.radius_g_1), n2 = Math.tan(t2.x / this.radius_g_1) * fs(1, o2)) : (n2 = Math.tan(t2.x / this.radius_g_1), o2 = Math.tan(t2.y / this.radius_g_1) * fs(1, n2));
6497
+ this.flip_axis ? (o2 = Math.tan(t2.y / this.radius_g_1), n2 = Math.tan(t2.x / this.radius_g_1) * ps(1, o2)) : (n2 = Math.tan(t2.x / this.radius_g_1), o2 = Math.tan(t2.y / this.radius_g_1) * ps(1, n2));
6467
6498
  var h2 = o2 / this.radius_p;
6468
6499
  if (e2 = n2 * n2 + h2 * h2 + a2 * a2, (i2 = (s2 = 2 * this.radius_g * a2) * s2 - 4 * e2 * this.C) < 0)
6469
6500
  return t2.x = Number.NaN, t2.y = Number.NaN, t2;
@@ -6480,7 +6511,7 @@ proj4Src.exports = function() {
6480
6511
  this.es = 0, this.long0 = void 0 !== this.long0 ? this.long0 : 0;
6481
6512
  }
6482
6513
  function Aa(t2) {
6483
- var e2 = pt(t2.x - this.long0), s2 = t2.y, i2 = Math.asin(ba * Math.sin(s2)), r2 = i2 * i2, a2 = r2 * r2 * r2;
6514
+ var e2 = ft(t2.x - this.long0), s2 = t2.y, i2 = Math.asin(ba * Math.sin(s2)), r2 = i2 * i2, a2 = r2 * r2 * r2;
6484
6515
  return t2.x = e2 * Math.cos(i2) / (ba * (Sa + 3 * Ca * r2 + a2 * (7 * Ea + 9 * Pa * r2))), t2.y = i2 * (Sa + Ca * r2 + a2 * (Ea + Pa * r2)), t2.x = this.a * t2.x + this.x0, t2.y = this.a * t2.y + this.y0, t2;
6485
6516
  }
6486
6517
  function Ta(t2) {
@@ -6488,7 +6519,7 @@ proj4Src.exports = function() {
6488
6519
  var e2, s2, i2, r2, a2 = 1e-9, n2 = 12, o2 = t2.y;
6489
6520
  for (r2 = 0; r2 < n2 && (o2 -= i2 = (o2 * (Sa + Ca * (e2 = o2 * o2) + (s2 = e2 * e2 * e2) * (Ea + Pa * e2)) - t2.y) / (Sa + 3 * Ca * e2 + s2 * (7 * Ea + 9 * Pa * e2)), !(Math.abs(i2) < a2)); ++r2)
6490
6521
  ;
6491
- return s2 = (e2 = o2 * o2) * e2 * e2, t2.x = ba * t2.x * (Sa + 3 * Ca * e2 + s2 * (7 * Ea + 9 * Pa * e2)) / Math.cos(o2), t2.y = Math.asin(Math.sin(o2) / ba), t2.x = pt(t2.x + this.long0), t2;
6522
+ return s2 = (e2 = o2 * o2) * e2 * e2, t2.x = ba * t2.x * (Sa + 3 * Ca * e2 + s2 * (7 * Ea + 9 * Pa * e2)) / Math.cos(o2), t2.y = Math.asin(Math.sin(o2) / ba), t2.x = ft(t2.x + this.long0), t2;
6492
6523
  }
6493
6524
  var Ia = { init: va, forward: Aa, inverse: Ta, names: ["eqearth", "Equal Earth", "Equal_Earth"] }, za = 1e-10;
6494
6525
  function Oa() {
@@ -6498,35 +6529,35 @@ proj4Src.exports = function() {
6498
6529
  this.es ? (this.en = ns(this.es), this.m1 = os(this.phi1, this.am1 = Math.sin(this.phi1), t2 = Math.cos(this.phi1), this.en), this.am1 = t2 / (Math.sqrt(1 - this.es * this.am1 * this.am1) * this.am1), this.inverse = Ga, this.forward = Na) : (Math.abs(this.phi1) + za >= l ? this.cphi1 = 0 : this.cphi1 = 1 / Math.tan(this.phi1), this.inverse = La, this.forward = Ra);
6499
6530
  }
6500
6531
  function Na(t2) {
6501
- var e2, s2, i2, r2 = pt(t2.x - (this.long0 || 0)), a2 = t2.y;
6532
+ var e2, s2, i2, r2 = ft(t2.x - (this.long0 || 0)), a2 = t2.y;
6502
6533
  return e2 = this.am1 + this.m1 - os(a2, s2 = Math.sin(a2), i2 = Math.cos(a2), this.en), s2 = i2 * r2 / (e2 * Math.sqrt(1 - this.es * s2 * s2)), t2.x = e2 * Math.sin(s2), t2.y = this.am1 - e2 * Math.cos(s2), t2.x = this.a * t2.x + (this.x0 || 0), t2.y = this.a * t2.y + (this.y0 || 0), t2;
6503
6534
  }
6504
6535
  function Ga(t2) {
6505
6536
  var e2, s2, i2, r2;
6506
- if (t2.x = (t2.x - (this.x0 || 0)) / this.a, t2.y = (t2.y - (this.y0 || 0)) / this.a, s2 = fs(t2.x, t2.y = this.am1 - t2.y), r2 = cs(this.am1 + this.m1 - s2, this.es, this.en), (e2 = Math.abs(r2)) < l)
6537
+ if (t2.x = (t2.x - (this.x0 || 0)) / this.a, t2.y = (t2.y - (this.y0 || 0)) / this.a, s2 = ps(t2.x, t2.y = this.am1 - t2.y), r2 = cs(this.am1 + this.m1 - s2, this.es, this.en), (e2 = Math.abs(r2)) < l)
6507
6538
  e2 = Math.sin(r2), i2 = s2 * Math.atan2(t2.x, t2.y) * Math.sqrt(1 - this.es * e2 * e2) / Math.cos(r2);
6508
6539
  else {
6509
6540
  if (!(Math.abs(e2 - l) <= za))
6510
6541
  throw new Error();
6511
6542
  i2 = 0;
6512
6543
  }
6513
- return t2.x = pt(i2 + (this.long0 || 0)), t2.y = mi(r2), t2;
6544
+ return t2.x = ft(i2 + (this.long0 || 0)), t2.y = mi(r2), t2;
6514
6545
  }
6515
6546
  function Ra(t2) {
6516
- var e2, s2, i2 = pt(t2.x - (this.long0 || 0)), r2 = t2.y;
6547
+ var e2, s2, i2 = ft(t2.x - (this.long0 || 0)), r2 = t2.y;
6517
6548
  return s2 = this.cphi1 + this.phi1 - r2, Math.abs(s2) > za ? (t2.x = s2 * Math.sin(e2 = i2 * Math.cos(r2) / s2), t2.y = this.cphi1 - s2 * Math.cos(e2)) : t2.x = t2.y = 0, t2.x = this.a * t2.x + (this.x0 || 0), t2.y = this.a * t2.y + (this.y0 || 0), t2;
6518
6549
  }
6519
6550
  function La(t2) {
6520
6551
  var e2, s2;
6521
6552
  t2.x = (t2.x - (this.x0 || 0)) / this.a, t2.y = (t2.y - (this.y0 || 0)) / this.a;
6522
- var i2 = fs(t2.x, t2.y = this.cphi1 - t2.y);
6553
+ var i2 = ps(t2.x, t2.y = this.cphi1 - t2.y);
6523
6554
  if (s2 = this.cphi1 + this.phi1 - i2, Math.abs(s2) > l)
6524
6555
  throw new Error();
6525
- return e2 = Math.abs(Math.abs(s2) - l) <= za ? 0 : i2 * Math.atan2(t2.x, t2.y) / Math.cos(s2), t2.x = pt(e2 + (this.long0 || 0)), t2.y = mi(s2), t2;
6556
+ return e2 = Math.abs(Math.abs(s2) - l) <= za ? 0 : i2 * Math.atan2(t2.x, t2.y) / Math.cos(s2), t2.x = ft(e2 + (this.long0 || 0)), t2.y = mi(s2), t2;
6526
6557
  }
6527
6558
  var $a = { init: Oa, names: ["bonne", "Bonne (Werner lat_1=90)"] };
6528
6559
  function Va(t2) {
6529
- t2.Proj.projections.add(_s), t2.Proj.projections.add(Ps), t2.Proj.projections.add(As), t2.Proj.projections.add(Vs), t2.Proj.projections.add(ks), t2.Proj.projections.add(Ys), t2.Proj.projections.add(Js), t2.Proj.projections.add(ii), t2.Proj.projections.add(oi), t2.Proj.projections.add(Mi), t2.Proj.projections.add(Oi), t2.Proj.projections.add(Vi), t2.Proj.projections.add(Bi), t2.Proj.projections.add(Yi), t2.Proj.projections.add(Zi), t2.Proj.projections.add(sr), t2.Proj.projections.add(nr), t2.Proj.projections.add(lr), t2.Proj.projections.add(fr), t2.Proj.projections.add(Mr), t2.Proj.projections.add(Cr), t2.Proj.projections.add(Ar), t2.Proj.projections.add(Rr), t2.Proj.projections.add(qr), t2.Proj.projections.add(Yr), t2.Proj.projections.add(oa), t2.Proj.projections.add(ua), t2.Proj.projections.add(ya), t2.Proj.projections.add(wa), t2.Proj.projections.add(Ia), t2.Proj.projections.add($a);
6560
+ t2.Proj.projections.add(_s), t2.Proj.projections.add(Ps), t2.Proj.projections.add(As), t2.Proj.projections.add(Vs), t2.Proj.projections.add(ks), t2.Proj.projections.add(Ys), t2.Proj.projections.add(Js), t2.Proj.projections.add(ii), t2.Proj.projections.add(oi), t2.Proj.projections.add(Mi), t2.Proj.projections.add(Oi), t2.Proj.projections.add(Vi), t2.Proj.projections.add(Bi), t2.Proj.projections.add(Yi), t2.Proj.projections.add(Zi), t2.Proj.projections.add(sr), t2.Proj.projections.add(nr), t2.Proj.projections.add(lr), t2.Proj.projections.add(pr), t2.Proj.projections.add(Mr), t2.Proj.projections.add(Cr), t2.Proj.projections.add(Ar), t2.Proj.projections.add(Rr), t2.Proj.projections.add(qr), t2.Proj.projections.add(Yr), t2.Proj.projections.add(oa), t2.Proj.projections.add(ua), t2.Proj.projections.add(ya), t2.Proj.projections.add(wa), t2.Proj.projections.add(Ia), t2.Proj.projections.add($a);
6530
6561
  }
6531
6562
  return we.defaultDatum = "WGS84", we.Proj = ee, we.WGS84 = new we.Proj("WGS84"), we.Point = Ye, we.toPoint = _e, we.defs = rt, we.nadgrid = Dt, we.transform = ye, we.mgrs = Ie, we.version = "2.17.0", Va(we), we;
6532
6563
  }();
@@ -6607,25 +6638,45 @@ const normalizeProjectionName = (t) => "EPSG:900913" === (t = t.toUpperCase().tr
6607
6638
  _cache[t] = e;
6608
6639
  }
6609
6640
  return _cache[t];
6610
- }, createGroundTileMesh = (t, e) => {
6611
- const { vertices: s, uvs: i, indices: r } = subdivideVertices([-0.5, -0.5, 0, -0.5, 0.5, 0, 0.5, 0.5, 0, 0.5, -0.5, 0], [0, 2, 1, 0, 3, 2], [0, 0, 0, 1, 1, 1, 1, 0], t);
6612
- projectVertices(s, t);
6613
- const a = { vertices: s, uvs: i, indices: r };
6641
+ }, computeNormals = (t, e = 3, s = 0) => {
6642
+ const { vertices: i, indices: r } = t, a = i.length / e, n = new Array(3 * a).fill(0), o = new Array(a).fill(0);
6643
+ for (let t2 = 0; t2 < r.length; t2 += 3) {
6644
+ const a2 = r[t2], h = r[t2 + 1], c = r[t2 + 2], l = i[a2 * e + s], u = i[a2 * e + s + 1], d = i[a2 * e + s + 2], _ = i[h * e + s] - l, m = i[h * e + s + 1] - u, p = i[h * e + s + 2] - d, f = i[c * e + s] - l, y = i[c * e + s + 1] - u, g = i[c * e + s + 2] - d, M = m * g - p * y, x = p * f - _ * g, w = _ * y - m * f;
6645
+ n[3 * a2] += M, n[3 * a2 + 1] += x, n[3 * a2 + 2] += w, o[a2]++, n[3 * h] += M, n[3 * h + 1] += x, n[3 * h + 2] += w, o[h]++, n[3 * c] += M, n[3 * c + 1] += x, n[3 * c + 2] += w, o[c]++;
6646
+ }
6647
+ for (let t2 = 0; t2 < a; t2++) {
6648
+ const e2 = o[t2];
6649
+ if (e2 > 0) {
6650
+ let s2 = n[3 * t2] / e2, i2 = n[3 * t2 + 1] / e2, r2 = n[3 * t2 + 2] / e2;
6651
+ const a2 = Math.sqrt(s2 * s2 + i2 * i2 + r2 * r2);
6652
+ if (a2 > 0) {
6653
+ const t3 = 1 / a2;
6654
+ s2 *= t3, i2 *= t3, r2 *= t3;
6655
+ } else
6656
+ s2 = 0, i2 = 0, r2 = 1;
6657
+ n[3 * t2] = s2, n[3 * t2 + 1] = i2, n[3 * t2 + 2] = r2;
6658
+ }
6659
+ }
6660
+ t.normals = n;
6661
+ }, createGroundTileMesh = (t, e, s = true) => {
6662
+ const { vertices: i, uvs: r, indices: a } = subdivideVertices([-0.5, -0.5, 0, -0.5, 0.5, 0, 0.5, 0.5, 0, 0.5, -0.5, 0], [0, 2, 1, 0, 3, 2], [0, 0, 0, 1, 1, 1, 1, 0], t);
6663
+ projectVertices(i, t);
6664
+ const n = { vertices: i, uvs: r, indices: a };
6614
6665
  if (e) {
6615
- const t2 = s.length / 3;
6666
+ const t2 = i.length / 3;
6616
6667
  for (const s2 of Object.keys(e)) {
6617
- const i2 = e[s2], r2 = Array.isArray(i2), n = r2 ? i2.length : 1, o = [];
6668
+ const i2 = e[s2], r2 = Array.isArray(i2), a2 = r2 ? i2.length : 1, o = [];
6618
6669
  if (r2)
6619
6670
  for (let e2 = 0; e2 < t2; e2++)
6620
- for (let t3 = 0; t3 < n; t3++)
6671
+ for (let t3 = 0; t3 < a2; t3++)
6621
6672
  o.push(i2[t3]);
6622
6673
  else
6623
6674
  for (let e2 = 0; e2 < t2; e2++)
6624
6675
  o.push(i2);
6625
- a[s2] = o;
6676
+ n[s2] = o;
6626
6677
  }
6627
6678
  }
6628
- return a;
6679
+ return s && computeNormals(n), n;
6629
6680
  }, _pointIn = new Vector3$1(), _pointOut = new Vector3$1(), _vector = new Vector3$1(), _normal = new Vector3$1(), _projectedStart = [0, 0, 0], _projectedEnd = [0, 0, 0], _center = [0, 0, 0];
6630
6681
  function sRGBToLinear(t) {
6631
6682
  return t < 0.04045 ? 0.0773993808 * t : Math.pow(0.9478672986 * t + 0.0521327014, 2.4);
@@ -6687,13 +6738,12 @@ function mergePrimitives(t) {
6687
6738
  return t.polygon3ds && t.polygon3ds.length > 0 && (e.polygon3d = mergePolygons(t.polygon3ds)), t.building3ds && t.building3ds.length > 0 && (e.building3d = mergePolygons(t.building3ds, { isBuilding: true })), t.arrows && t.arrows.length > 0 && (e.arrow = mergePolygons(t.arrows, { isArrow: true })), t.pois && t.pois.length > 0 && (e.poi = t.pois), e;
6688
6739
  }
6689
6740
  function mergePolygons(t, e = {}) {
6690
- t.sort((t2, e2) => t2.rank - e2.rank);
6691
6741
  const s = [], i = [];
6692
- let r = null, a = null, n = null, o = null, h = null, c = null, l = null, u = null, d = null, _ = null, m = null, f = null, p = 0, y = 0;
6742
+ let r = null, a = null, n = null, o = null, h = null, c = null, l = null, u = null, d = null, _ = null, m = null, p = null, f = 0, y = 0;
6693
6743
  for (let g = 0; g < t.length; g++)
6694
- if (r = t[g], a = r.vertices, n = r.normals, o = r.flatNormals, h = r.uvs, c = r.diffs, l = r.indices, u = r.colors, d = r.layerIndices, _ = r.widths, f = r.totalLengths, m = r.heightAndConcaves, l && l.length) {
6744
+ if (r = t[g], r.normals || computeNormals(r), a = r.vertices, n = r.normals, o = r.flatNormals, h = r.uvs, c = r.diffs, l = r.indices, u = r.colors, d = r.layerIndices, _ = r.widths, p = r.totalLengths, m = r.heightAndConcaves, l && l.length) {
6695
6745
  for (let t2 = 0, i2 = a.length - 2; t2 < i2; t2 += 3)
6696
- s.push(a[t2], a[t2 + 1], a[t2 + 2]), e.isArrow ? (p = t2 / 3 * 2, s.push(o[t2], o[t2 + 1], o[t2 + 2]), s.push(h[p], h[p + 1]), s.push(c[t2], c[t2 + 1], c[t2 + 2])) : (s.push(n[t2], n[t2 + 1], n[t2 + 2]), e.isColor4 ? (p = t2 / 3 * 4, s.push(u[p], u[p + 1], u[p + 2], u[p + 3])) : s.push(u[t2], u[t2 + 1], u[t2 + 2])), e.isBuilding ? (p = t2 / 3 * 2, s.push(m[p], m[p + 1])) : s.push(d[t2 / 3]), e.isLine && (p = t2 / 3 * 2, s.push(_[t2 / 3]), e.isDashLine && s.push(h[p], h[p + 1]), e.isTextureLine && s.push(f[t2 / 3]));
6746
+ s.push(a[t2], a[t2 + 1], a[t2 + 2]), e.isArrow ? (f = t2 / 3 * 2, s.push(o[t2], o[t2 + 1], o[t2 + 2]), s.push(h[f], h[f + 1]), s.push(c[t2], c[t2 + 1], c[t2 + 2])) : (s.push(n[t2], n[t2 + 1], n[t2 + 2]), e.isColor4 ? (f = t2 / 3 * 4, s.push(u[f], u[f + 1], u[f + 2], u[f + 3])) : s.push(u[t2], u[t2 + 1], u[t2 + 2])), e.isBuilding ? (f = t2 / 3 * 2, s.push(m[f], m[f + 1])) : s.push(d[t2 / 3]), e.isLine && (f = t2 / 3 * 2, s.push(_[t2 / 3]), e.isDashLine && s.push(h[f], h[f + 1]), e.isTextureLine && s.push(p[t2 / 3]));
6697
6747
  for (let t2 = 0, e2 = l.length; t2 < e2; t2++)
6698
6748
  i.push(l[t2] + y);
6699
6749
  y += a.length / 3;
@@ -6743,17 +6793,17 @@ self.addEventListener("message", (t) => {
6743
6793
  };
6744
6794
  let layerIndex = 0;
6745
6795
  function parseGeoLayers(t, e, s) {
6746
- const i = self.displayOptions, r = i && false === i.base, a = i && false === i.link, n = i && false === i.building, o = i && false === i.poi, h = i && true === i.flat, c = t.geolayer, l = e.polygons, u = e.polygonOpacitys, d = e.polygon3ds, _ = e.lines, m = e.building3ds, f = e.pois, p = e.arrows, y = Math.floor(s.useZoom) || s.z;
6796
+ const i = self.displayOptions, r = i && false === i.base, a = i && false === i.link, n = i && false === i.building, o = i && false === i.poi, h = i && true === i.flat, c = t.geolayer, l = e.polygons, u = e.polygonOpacitys, d = e.polygon3ds, _ = e.lines, m = e.building3ds, p = e.pois, f = e.arrows, y = Math.floor(s.useZoom) || s.z;
6747
6797
  let g = 0, M = 0, x = null, w = null, S = null, C = null, E = null;
6748
6798
  layerIndex = 20 * LAYER_INDEX_DELTA;
6749
6799
  const P = s.z < 9 ? getStyleConfig(M, 1522, y, POLYGON_STYLE, s) : getStyleConfig(M, 72, y, POLYGON_STYLE, s);
6750
- !r && P && l.push(createBgPolygon(P, s)), layerIndex += 1 * LAYER_INDEX_DELTA;
6800
+ !r && P && l.push(createBgPolygon(P, s)), layerIndex += 1 * LAYER_INDEX_DELTA, c.sort((t2, e2) => t2.rank - e2.rank);
6751
6801
  for (const t2 of c) {
6752
6802
  M = t2.catalogType, g = t2.rank;
6753
6803
  const e2 = t2.arrowp;
6754
6804
  if (M === GAOQING_ARROW_TYPE && e2) {
6755
6805
  const e3 = createArrow(t2, y, s);
6756
- e3 && (e3.rank = g, p.push(e3), layerIndex += LAYER_INDEX_DELTA);
6806
+ e3 && (e3.rank = g, f.push(e3), layerIndex += LAYER_INDEX_DELTA);
6757
6807
  continue;
6758
6808
  }
6759
6809
  const i2 = t2.geoobjectsetSet;
@@ -6804,7 +6854,7 @@ function parseGeoLayers(t, e, s) {
6804
6854
  if (!o && M === POI_TYPE) {
6805
6855
  if (!i3.name)
6806
6856
  continue;
6807
- E = createPOI(i3, t3.styleId, s, e3), E && f.push(E);
6857
+ E = createPOI(i3, t3.styleId, s, e3), E && p.push(E);
6808
6858
  }
6809
6859
  } else
6810
6860
  x = createGradientPolygon(i3, e3.startPtStyle, e3.endPtStyle, s), x && (x.rank = g, l.push(x), layerIndex += LAYER_INDEX_DELTA);
@@ -6861,7 +6911,7 @@ function parseGeoLayers(t, e, s) {
6861
6911
  for (let t2 = 0; t2 < e2.length; t2++) {
6862
6912
  const i2 = e2[t2];
6863
6913
  let r2 = null;
6864
- o || (r2 = getStyleConfig(POI_TYPE, i2.styleId, y, POINT_TEXT_STYLE, s)), r2 && createLabelPoi(f, i2, y, s, r2);
6914
+ o || (r2 = getStyleConfig(POI_TYPE, i2.styleId, y, POINT_TEXT_STYLE, s)), r2 && createLabelPoi(p, i2, y, s, r2);
6865
6915
  }
6866
6916
  }
6867
6917
  return layerIndex;
@@ -6869,7 +6919,7 @@ function parseGeoLayers(t, e, s) {
6869
6919
  function createArrow(t, e, s) {
6870
6920
  const i = t.arrowp, r = parseFeature(i.x), a = s.targetProjection, [n, o, h] = s.targetCenter, c = i.tracer, l = i.zvector, u = 1 / 256, d = -0.5 + u, _ = 0.5 - u;
6871
6921
  let m = getTileMaxValueByZ(s.z, s);
6872
- const f = [], p = [], y = [], g = [], M = [], x = [], w = parseFeature(l, 1);
6922
+ const p = [], f = [], y = [], g = [], M = [], x = [], w = parseFeature(l, 1);
6873
6923
  let S = [];
6874
6924
  1 === w.length && w[0] ? (S = new Array(r.length), S.fill(w[0])) : S = w;
6875
6925
  for (let t2 = 0; t2 < r.length; t2++)
@@ -6890,9 +6940,9 @@ function createArrow(t, e, s) {
6890
6940
  const t3 = Math.hypot(l2, u2);
6891
6941
  _center[0] = (_projectedEnd[0] + _projectedStart[0]) / 2 - n, _center[1] = (_projectedEnd[1] + _projectedStart[1]) / 2 - o, _center[2] = (_projectedEnd[2] + _projectedStart[2]) / 2 - h, a.getProjectedSurfaceNormal(_vector.fromArray(_projectedStart), _normal), _vector.set(_projectedEnd[0] - _projectedStart[0], _projectedEnd[1] - _projectedStart[1], _projectedEnd[2] - _projectedStart[2]).normalize().multiplyScalar(t3), _normal.crossVectors(_normal, _vector).normalize().multiplyScalar(t3 / 2);
6892
6942
  }
6893
- f[f.length] = _center[0], f[f.length] = _center[1], f[f.length] = _center[2], y[y.length] = -_vector.x, y[y.length] = -_vector.y, y[y.length] = -_vector.z, M[M.length] = _normal.x, M[M.length] = _normal.y, M[M.length] = _normal.z, g[g.length] = 0.125, g[g.length] = 0.3125, x[x.length] = layerIndex, f[f.length] = _center[0], f[f.length] = _center[1], f[f.length] = _center[2], y[y.length] = -_vector.x, y[y.length] = -_vector.y, y[y.length] = -_vector.z, M[M.length] = -_normal.x, M[M.length] = -_normal.y, M[M.length] = -_normal.z, g[g.length] = 0.125, g[g.length] = 0.6875, x[x.length] = layerIndex, f[f.length] = _center[0], f[f.length] = _center[1], f[f.length] = _center[2], y[y.length] = _vector.x, y[y.length] = _vector.y, y[y.length] = _vector.z, M[M.length] = _normal.x, M[M.length] = _normal.y, M[M.length] = _normal.z, g[g.length] = 1, g[g.length] = 0.3125, x[x.length] = layerIndex, f[f.length] = _center[0], f[f.length] = _center[1], f[f.length] = _center[2], y[y.length] = _vector.x, y[y.length] = _vector.y, y[y.length] = _vector.z, M[M.length] = -_normal.x, M[M.length] = -_normal.y, M[M.length] = -_normal.z, g[g.length] = 1, g[g.length] = 0.6875, x[x.length] = layerIndex, p[p.length] = w2, p[p.length] = w2 + 1, p[p.length] = w2 + 2, p[p.length] = w2 + 2, p[p.length] = w2 + 1, p[p.length] = w2 + 3;
6943
+ p[p.length] = _center[0], p[p.length] = _center[1], p[p.length] = _center[2], y[y.length] = -_vector.x, y[y.length] = -_vector.y, y[y.length] = -_vector.z, M[M.length] = _normal.x, M[M.length] = _normal.y, M[M.length] = _normal.z, g[g.length] = 0.125, g[g.length] = 0.3125, x[x.length] = layerIndex, p[p.length] = _center[0], p[p.length] = _center[1], p[p.length] = _center[2], y[y.length] = -_vector.x, y[y.length] = -_vector.y, y[y.length] = -_vector.z, M[M.length] = -_normal.x, M[M.length] = -_normal.y, M[M.length] = -_normal.z, g[g.length] = 0.125, g[g.length] = 0.6875, x[x.length] = layerIndex, p[p.length] = _center[0], p[p.length] = _center[1], p[p.length] = _center[2], y[y.length] = _vector.x, y[y.length] = _vector.y, y[y.length] = _vector.z, M[M.length] = _normal.x, M[M.length] = _normal.y, M[M.length] = _normal.z, g[g.length] = 1, g[g.length] = 0.3125, x[x.length] = layerIndex, p[p.length] = _center[0], p[p.length] = _center[1], p[p.length] = _center[2], y[y.length] = _vector.x, y[y.length] = _vector.y, y[y.length] = _vector.z, M[M.length] = -_normal.x, M[M.length] = -_normal.y, M[M.length] = -_normal.z, g[g.length] = 1, g[g.length] = 0.6875, x[x.length] = layerIndex, f[f.length] = w2, f[f.length] = w2 + 1, f[f.length] = w2 + 2, f[f.length] = w2 + 2, f[f.length] = w2 + 1, f[f.length] = w2 + 3;
6894
6944
  }
6895
- return { vertices: f, indices: p, flatNormals: M, instanceRotationMatrices: [], diffs: y, uvs: g, layerIndices: x };
6945
+ return { vertices: p, indices: f, flatNormals: M, instanceRotationMatrices: [], diffs: y, uvs: g, layerIndices: x };
6896
6946
  }
6897
6947
  function createLine(t, e, s, i = {}, r) {
6898
6948
  var _a;
@@ -6912,13 +6962,13 @@ function createLine(t, e, s, i = {}, r) {
6912
6962
  }
6913
6963
  }
6914
6964
  c && u > 1 && (_ = getIconInfo(c), _ && _[1] && (u = Math.max(_[1] / 7, 1)));
6915
- let f = 0;
6916
- /guojietianqiaojieti/.test(c) && (f = 0.04), /weidingguojie_guonei/.test(c) && (s *= 1.1);
6965
+ let p = 0;
6966
+ /guojietianqiaojieti/.test(c) && (p = 0.04), /weidingguojie_guonei/.test(c) && (s *= 1.1);
6917
6967
  for (let t2 = 0; t2 < d.length; t2++)
6918
- m && m[t2] && (d[t2][2] += f + m[t2] / 100 / ATTACH_SCALE);
6968
+ m && m[t2] && (d[t2][2] += p + m[t2] / 100 / ATTACH_SCALE);
6919
6969
  projectVertices(d, r, false, false);
6920
- const p = lineToMesh(d, s, r, l, u);
6921
- return p.colors = fillFlatArray(p.vertices.length / 3, [e[0], e[1], e[2], (_a = e[3]) != null ? _a : 1]), p.layerIndices = fillFlatArray(p.vertices.length / 3, [layerIndex]), c && (p.fillTextureStyle = { fillTexture: c, textureInfo: _, isSingle: l ? 1 : 0 }), p;
6970
+ const f = lineToMesh(d, s, r, l, u);
6971
+ return f.colors = fillFlatArray(f.vertices.length / 3, [e[0], e[1], e[2], (_a = e[3]) != null ? _a : 1]), f.layerIndices = fillFlatArray(f.vertices.length / 3, [layerIndex]), c && (f.fillTextureStyle = { fillTexture: c, textureInfo: _, isSingle: l ? 1 : 0 }), f;
6922
6972
  }
6923
6973
  function tileNormalizedPositionToMeter(t, e, s) {
6924
6974
  const [i, r, a, n, o, h] = e.projectedBoundingBox, c = n - i, l = o - r;
@@ -6926,7 +6976,7 @@ function tileNormalizedPositionToMeter(t, e, s) {
6926
6976
  }
6927
6977
  function createBgPolygon(t, e) {
6928
6978
  const s = t.color;
6929
- return createGroundTileMesh(e, { colors: [s[0], s[1], s[2]], layerIndices: [0], normals: [0, 0, 1] });
6979
+ return createGroundTileMesh(e, { colors: [s[0], s[1], s[2]], layerIndices: [0] });
6930
6980
  }
6931
6981
  function getSubDivisionMaxLength(t) {
6932
6982
  if (t.targetProjectionName === t.sourceProjectionName)
@@ -6942,7 +6992,7 @@ function createPolygon(t, e, s = {}, i) {
6942
6992
  if (!a || !r)
6943
6993
  return;
6944
6994
  const l = [], u = [], d = [], _ = [], m = [];
6945
- let f = [], p = [], y = [], g = [], M = [];
6995
+ let p = [], f = [], y = [], g = [], M = [];
6946
6996
  const x = l.length / 3;
6947
6997
  let w = parseMidPoints(r, 100 * LAND_OFFSETZ, i), S = false, C = false;
6948
6998
  if (o) {
@@ -6970,7 +7020,7 @@ function createPolygon(t, e, s = {}, i) {
6970
7020
  E = w[t2], l.push(E[0], E[1], E[2]), d.push(0, 0, 1), c ? _.push(e[0], e[1], e[2], e[3] || 1) : _.push(e[0], e[1], e[2]), m.push(layerIndex);
6971
7021
  for (let t2 = 0, e2 = a.length; t2 < e2; t2++)
6972
7022
  u.push(x + a[t2]);
6973
- h || (f = l, p = u, g = _, y = d, M = m);
7023
+ h || (p = l, f = u, g = _, y = d, M = m);
6974
7024
  let P = S && !C;
6975
7025
  if (S && !C) {
6976
7026
  const t2 = s.borderRgba || e;
@@ -6978,22 +7028,22 @@ function createPolygon(t, e, s = {}, i) {
6978
7028
  for (let e2 = 0, s2 = w.length; e2 < s2; e2 += 1) {
6979
7029
  E = w[e2];
6980
7030
  let r2 = E[2], a2 = r2 - 280;
6981
- a2 < 0 && (a2 = 0), f.push(E[0], E[1], r2, E[0], E[1], a2), g.push(t2[0], t2[1], t2[2], t2[0], t2[1], t2[2]), M.push(layerIndex, layerIndex);
7031
+ a2 < 0 && (a2 = 0), p.push(E[0], E[1], r2, E[0], E[1], a2), g.push(t2[0], t2[1], t2[2], t2[0], t2[1], t2[2]), M.push(layerIndex, layerIndex);
6982
7032
  let n2 = e2 === s2 - 1 ? 0 : e2 + 1, o2 = E[0], h2 = E[1], c2 = w[n2][0], l2 = w[n2][1], u2 = crossVectors3([0, 0, a2 - r2], [c2 - o2, l2 - h2, 0]);
6983
7033
  u2[0] || u2[1] || u2[2] || (u2 = [d[d.length - 3], d[d.length - 2], d[d.length - 1]]), y.push(u2[0], u2[1], u2[2], u2[0], u2[1], u2[2]);
6984
7034
  let _2 = false;
6985
- o2 === c2 ? (Math.abs(o2 + 0.5) < DELTA || Math.abs(o2 - 0.5) < DELTA) && (_2 = true) : h2 === l2 && (Math.abs(h2 + 0.5) < DELTA || Math.abs(h2 - 0.5) < DELTA) && (_2 = true), _2 || (e2 === s2 - 1 ? p.push(i2 + 2 * e2, i2 + 2 * e2 + 1, i2, i2, i2 + 2 * e2 + 1, i2 + 1) : p.push(i2 + 2 * e2, i2 + 2 * e2 + 1, i2 + 2 * e2 + 2, i2 + 2 * e2 + 2, i2 + 2 * e2 + 1, i2 + 2 * e2 + 3));
7035
+ o2 === c2 ? (Math.abs(o2 + 0.5) < DELTA || Math.abs(o2 - 0.5) < DELTA) && (_2 = true) : h2 === l2 && (Math.abs(h2 + 0.5) < DELTA || Math.abs(h2 - 0.5) < DELTA) && (_2 = true), _2 || (e2 === s2 - 1 ? f.push(i2 + 2 * e2, i2 + 2 * e2 + 1, i2, i2, i2 + 2 * e2 + 1, i2 + 1) : f.push(i2 + 2 * e2, i2 + 2 * e2 + 1, i2 + 2 * e2 + 2, i2 + 2 * e2 + 2, i2 + 2 * e2 + 1, i2 + 2 * e2 + 3));
6986
7036
  }
6987
7037
  }
6988
7038
  for (let t2 = 0; t2 < l.length; t2 += 3)
6989
7039
  l[t2 + 2] = l[t2 + 2] / 100 / ATTACH_SCALE;
6990
7040
  if (projectVertices(l, i), h && P) {
6991
- for (let t2 = 0; t2 < f.length; t2 += 3)
6992
- f[t2 + 2] = f[t2 + 2] / 100 / ATTACH_SCALE;
6993
- projectVertices(f, i);
6994
- return { delayObject: { vertices: f, indices: p, normals: y, colors: g, layerIndices: M }, object: { vertices: l, indices: u, normals: d, colors: _, layerIndices: m } };
7041
+ for (let t2 = 0; t2 < p.length; t2 += 3)
7042
+ p[t2 + 2] = p[t2 + 2] / 100 / ATTACH_SCALE;
7043
+ projectVertices(p, i);
7044
+ return { delayObject: { vertices: p, indices: f, colors: g, layerIndices: M }, object: { vertices: l, indices: u, colors: _, layerIndices: m } };
6995
7045
  }
6996
- return { vertices: l, indices: u, normals: d, colors: _, layerIndices: m };
7046
+ return { vertices: l, indices: u, colors: _, layerIndices: m };
6997
7047
  }
6998
7048
  function createGradientPolygon(t, e, s, i) {
6999
7049
  const r = t.midPoints;
@@ -7010,15 +7060,15 @@ function createGradientPolygon(t, e, s, i) {
7010
7060
  h[t2] = n[t2] || 1;
7011
7061
  }
7012
7062
  const c = [], l = [], u = [], d = [], _ = [], m = c.length / 3;
7013
- let f = parseFeature(r);
7014
- const p = 1 / 256, y = -0.5 + p, g = 0.5 - p;
7063
+ let p = parseFeature(r);
7064
+ const f = 1 / 256, y = -0.5 + f, g = 0.5 - f;
7015
7065
  let M = getTileMaxValueByZ(i.z, i);
7016
7066
  const x = [o[0] / 100, o[1] / 100], w = [o[2] / 100, o[3] / 100], S = e.color, C = s.color, E = [w[0] - x[0], w[1] - x[1]], P = Math.sqrt(Math.pow(E[0], 2) + Math.pow(E[1], 2));
7017
- for (let t2 = 0, e2 = f.length; t2 < e2; t2++) {
7018
- const e3 = f[t2];
7067
+ for (let t2 = 0, e2 = p.length; t2 < e2; t2++) {
7068
+ const e3 = p[t2];
7019
7069
  let s2, i2;
7020
7070
  if (0 === E[0])
7021
- s2 = x, i2 = e3[1];
7071
+ s2 = x[0], i2 = e3[1];
7022
7072
  else {
7023
7073
  const t3 = -((x[0] - e3[0]) * E[0] + (x[1] - e3[1]) * E[1]) / (E[0] * E[0] + E[1] * E[1]);
7024
7074
  s2 = t3 * E[0] + x[0], i2 = t3 * E[1] + x[1];
@@ -7042,24 +7092,24 @@ function createBuilding3d(t, e, s, i) {
7042
7092
  const r = t.midPoints, a = t.indices, n = t.altitude / ATTACH_SCALE;
7043
7093
  if (!a || !r)
7044
7094
  return;
7045
- const o = [], h = [], c = [], l = [], u = [], d = parseMidPoints(r, n + LAND_OFFSETZ, i);
7046
- let _ = null;
7047
- for (let t2 = 0, s2 = d.length; t2 < s2; t2 += 1)
7048
- _ = d[t2], o.push(_[0], _[1], _[2]), c.push(0, 0, 1), l.push(e[0], e[1], e[2]), u.push(_[2], encodeConcave(false, false, false));
7095
+ const o = [], h = [], c = [], l = [], u = parseMidPoints(r, n + LAND_OFFSETZ, i);
7096
+ let d = null;
7097
+ for (let t2 = 0, s2 = u.length; t2 < s2; t2 += 1)
7098
+ d = u[t2], o.push(d[0], d[1], d[2]), c.push(e[0], e[1], e[2]), l.push(d[2], encodeConcave(false, false, false));
7049
7099
  for (let t2 = 0, e2 = a.length; t2 < e2; t2++)
7050
7100
  h.push(a[t2]);
7051
- const m = o.length / 3;
7052
- for (let t2 = 0, e2 = isClosed(d) ? d.length - 1 : d.length; t2 < e2; t2 += 1) {
7053
- let i2 = [d[t2][0], d[t2][1], LAND_OFFSETZ], r2 = [d[t2][0], d[t2][1], d[t2][2]], a2 = t2 + 1;
7101
+ const _ = o.length / 3;
7102
+ for (let t2 = 0, e2 = isClosed(u) ? u.length - 1 : u.length; t2 < e2; t2 += 1) {
7103
+ let i2 = [u[t2][0], u[t2][1], LAND_OFFSETZ], r2 = [u[t2][0], u[t2][1], u[t2][2]], a2 = t2 + 1;
7054
7104
  t2 === e2 - 1 && (a2 = 0);
7055
- let n2 = [d[a2][0], d[a2][1], LAND_OFFSETZ], _2 = [d[a2][0], d[a2][1], d[a2][2]], f = 0 === t2 ? e2 - 1 : t2 - 1, p = [d[f][0], d[f][1], LAND_OFFSETZ], y = crossVectors3([n2[0] - i2[0], n2[1] - i2[1], n2[2] - i2[2]], [r2[0] - i2[0], r2[1] - i2[1], r2[2] - i2[2]]);
7056
- o.push(i2[0], i2[1], i2[2], r2[0], r2[1], r2[2], n2[0], n2[1], n2[2], _2[0], _2[1], _2[2]), c.push(y[0], y[1], y[2], y[0], y[1], y[2], y[0], y[1], y[2], y[0], y[1], y[2]), l.push(s[0], s[1], s[2], s[0], s[1], s[2], s[0], s[1], s[2], s[0], s[1], s[2]);
7057
- let g = isAOConcaveAngle(p, i2, n2);
7058
- 0 === t2 ? u.push(0, encodeConcave(true, g, false), r2[2], encodeConcave(false, g, false)) : u.push(0, encodeConcave(true, g, true), r2[2], encodeConcave(false, g, true), 0, encodeConcave(true, g, false), r2[2], encodeConcave(false, g, false)), t2 === e2 - 1 && (g = isAOConcaveAngle(i2, n2, d[a2 + 1]), u.push(0, encodeConcave(true, g, true), r2[2], encodeConcave(false, g, true)));
7059
- const M = m + 4 * t2;
7060
- h.push(M, M + 2, M + 3, M, M + 3, M + 1);
7061
- }
7062
- return projectVertices(o, i), { vertices: o, indices: h, normals: c, colors: l, heightAndConcaves: u };
7105
+ let n2 = [u[a2][0], u[a2][1], LAND_OFFSETZ], d2 = [u[a2][0], u[a2][1], u[a2][2]], m = 0 === t2 ? e2 - 1 : t2 - 1, p = [u[m][0], u[m][1], LAND_OFFSETZ];
7106
+ o.push(i2[0], i2[1], i2[2], r2[0], r2[1], r2[2], n2[0], n2[1], n2[2], d2[0], d2[1], d2[2]), c.push(s[0], s[1], s[2], s[0], s[1], s[2], s[0], s[1], s[2], s[0], s[1], s[2]);
7107
+ let f = isAOConcaveAngle(p, i2, n2);
7108
+ 0 === t2 ? l.push(0, encodeConcave(true, f, false), r2[2], encodeConcave(false, f, false)) : l.push(0, encodeConcave(true, f, true), r2[2], encodeConcave(false, f, true), 0, encodeConcave(true, f, false), r2[2], encodeConcave(false, f, false)), t2 === e2 - 1 && (f = isAOConcaveAngle(i2, n2, u[a2 + 1]), l.push(0, encodeConcave(true, f, true), r2[2], encodeConcave(false, f, true)));
7109
+ const y = _ + 4 * t2;
7110
+ h.push(y, y + 2, y + 3, y, y + 3, y + 1);
7111
+ }
7112
+ return projectVertices(o, i), { vertices: o, indices: h, colors: c, heightAndConcaves: l };
7063
7113
  }
7064
7114
  function getIconVertexData(t, e) {
7065
7115
  const s = getIconInfo(t);
@@ -7107,12 +7157,12 @@ function createLabelPoi(t, e, s, i, r) {
7107
7157
  let u2 = l[s2], m = c[s2];
7108
7158
  if (!isVisible(u2, i))
7109
7159
  continue;
7110
- let f = s2 * n * 2;
7111
- h = _.slice(f, f + 2 * n);
7112
- let p = 0;
7113
- o.length > 0 && (p = d[s2 * n] / a);
7160
+ let p = s2 * n * 2;
7161
+ h = _.slice(p, p + 2 * n);
7162
+ let f = 0;
7163
+ o.length > 0 && (f = d[s2 * n] / a);
7114
7164
  let y = [0, 0, 0];
7115
- y = convertPOIPosition(h[0], h[1], p + (self.zIndex || 0), i, y);
7165
+ y = convertPOIPosition(h[0], h[1], f + (self.zIndex || 0), i, y);
7116
7166
  let g = h[2 * (n - 1)] - h[0], M = h[2 * (n - 1) + 1] - h[1], x = Math.atan2(-M, -g) + Math.PI;
7117
7167
  1 === m && (x += Math.PI), t.push({ type: "labelp", position: y, text: e.name, rotateZ: x, styleConfig: r, hasText: true, ...e });
7118
7168
  }