earthsdk3 3.4.0-beta.9 → 3.4.1

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 (224) hide show
  1. package/dist/earthsdk3.iife.js +76 -76
  2. package/dist/earthsdk3.js +21925 -19864
  3. package/dist/earthsdk3.umd.cjs +73 -73
  4. package/dist/types/ESJTypes/pickedInfos/index.d.ts +0 -15
  5. package/dist/types/ESJTypes/pickedInfos/index.d.ts.map +1 -1
  6. package/dist/types/ESJTypes/properties/ESJGeoRegion.d.ts +11 -0
  7. package/dist/types/ESJTypes/properties/ESJGeoRegion.d.ts.map +1 -0
  8. package/dist/types/ESJTypes/properties/Viewer.d.ts +5 -6
  9. package/dist/types/ESJTypes/properties/Viewer.d.ts.map +1 -1
  10. package/dist/types/ESJTypes/properties/index.d.ts +1 -0
  11. package/dist/types/ESJTypes/properties/index.d.ts.map +1 -1
  12. package/dist/types/ESJTypes/props/Property.d.ts +1 -1
  13. package/dist/types/ESJTypes/props/Property.d.ts.map +1 -1
  14. package/dist/types/ESObjectManager/ESPlyarAndPathTime.d.ts +1 -1
  15. package/dist/types/ESObjectManager/ESPlyarAndPathTime.d.ts.map +1 -1
  16. package/dist/types/ESObjectManager/PathAnimationManager.d.ts +2 -3
  17. package/dist/types/ESObjectManager/PathAnimationManager.d.ts.map +1 -1
  18. package/dist/types/ESObjectManager/SceneObjectEditingManager.d.ts +1 -2
  19. package/dist/types/ESObjectManager/SceneObjectEditingManager.d.ts.map +1 -1
  20. package/dist/types/ESObjectManager/SceneObjectsListening.d.ts +1 -1
  21. package/dist/types/ESObjectManager/SceneObjectsListening.d.ts.map +1 -1
  22. package/dist/types/ESObjectManager/SceneObjectsManager.d.ts +9 -1
  23. package/dist/types/ESObjectManager/SceneObjectsManager.d.ts.map +1 -1
  24. package/dist/types/ESObjectManager/ViewersManager.d.ts +2 -1
  25. package/dist/types/ESObjectManager/ViewersManager.d.ts.map +1 -1
  26. package/dist/types/ESObjectManager/index.d.ts +10 -6
  27. package/dist/types/ESObjectManager/index.d.ts.map +1 -1
  28. package/dist/types/ESObjects/base/ESLabel.d.ts +2 -1
  29. package/dist/types/ESObjects/base/ESLabel.d.ts.map +1 -1
  30. package/dist/types/ESObjects/base/ESLocalVector.d.ts.map +1 -1
  31. package/dist/types/ESObjects/base/ESObjectWithLocation.d.ts +2 -1
  32. package/dist/types/ESObjects/base/ESObjectWithLocation.d.ts.map +1 -1
  33. package/dist/types/ESObjects/base/ESSceneObject/ESObjectsContext.d.ts +3 -1
  34. package/dist/types/ESObjects/base/ESSceneObject/ESObjectsContext.d.ts.map +1 -1
  35. package/dist/types/ESObjects/base/ESSceneObject/RefsManager.d.ts +2 -1
  36. package/dist/types/ESObjects/base/ESSceneObject/RefsManager.d.ts.map +1 -1
  37. package/dist/types/ESObjects/base/ESSceneObject/index.d.ts +6 -13
  38. package/dist/types/ESObjects/base/ESSceneObject/index.d.ts.map +1 -1
  39. package/dist/types/ESObjects/base/ESVisualObject.d.ts +15 -14
  40. package/dist/types/ESObjects/base/ESVisualObject.d.ts.map +1 -1
  41. package/dist/types/ESObjects/general/ES3DTileset/index.d.ts +2 -2
  42. package/dist/types/ESObjects/general/ES3DTileset/index.d.ts.map +1 -1
  43. package/dist/types/ESObjects/general/ESAlarm.d.ts +2 -1
  44. package/dist/types/ESObjects/general/ESAlarm.d.ts.map +1 -1
  45. package/dist/types/ESObjects/general/ESCameraView.d.ts +2 -1
  46. package/dist/types/ESObjects/general/ESCameraView.d.ts.map +1 -1
  47. package/dist/types/ESObjects/general/ESCameraViewCollection/ViewWrapper.d.ts +1 -1
  48. package/dist/types/ESObjects/general/ESCameraViewCollection/ViewWrapper.d.ts.map +1 -1
  49. package/dist/types/ESObjects/general/ESCustomDiv/index.d.ts.map +1 -1
  50. package/dist/types/ESObjects/general/ESCustomDiv/instance.d.ts +1 -1
  51. package/dist/types/ESObjects/general/ESCustomDiv/instance.d.ts.map +1 -1
  52. package/dist/types/ESObjects/general/ESCzml.d.ts +3 -2
  53. package/dist/types/ESObjects/general/ESCzml.d.ts.map +1 -1
  54. package/dist/types/ESObjects/general/ESEntityCluster.d.ts +11 -10
  55. package/dist/types/ESObjects/general/ESEntityCluster.d.ts.map +1 -1
  56. package/dist/types/ESObjects/general/ESFeatureLayer/FeatureLayer.d.ts +9 -0
  57. package/dist/types/ESObjects/general/ESFeatureLayer/FeatureLayer.d.ts.map +1 -0
  58. package/dist/types/ESObjects/general/ESFeatureLayer/PointLayer/index.d.ts +27 -0
  59. package/dist/types/ESObjects/general/ESFeatureLayer/PointLayer/index.d.ts.map +1 -0
  60. package/dist/types/ESObjects/general/ESFeatureLayer/PointLayer/utils.d.ts +40 -0
  61. package/dist/types/ESObjects/general/ESFeatureLayer/PointLayer/utils.d.ts.map +1 -0
  62. package/dist/types/ESObjects/general/ESFeatureLayer/PolyLineLayer/index.d.ts +20 -0
  63. package/dist/types/ESObjects/general/ESFeatureLayer/PolyLineLayer/index.d.ts.map +1 -0
  64. package/dist/types/ESObjects/general/ESFeatureLayer/PolygonLayer/index.d.ts +18 -0
  65. package/dist/types/ESObjects/general/ESFeatureLayer/PolygonLayer/index.d.ts.map +1 -0
  66. package/dist/types/ESObjects/general/ESFeatureLayer/PolygonLayer/utils.d.ts +9 -0
  67. package/dist/types/ESObjects/general/ESFeatureLayer/PolygonLayer/utils.d.ts.map +1 -0
  68. package/dist/types/ESObjects/general/ESFeatureLayer/index.d.ts +26 -0
  69. package/dist/types/ESObjects/general/ESFeatureLayer/index.d.ts.map +1 -0
  70. package/dist/types/ESObjects/general/ESFeatureLayer/types.d.ts +587 -0
  71. package/dist/types/ESObjects/general/ESFeatureLayer/types.d.ts.map +1 -0
  72. package/dist/types/ESObjects/general/ESFeatureLayer/utils.d.ts +392 -0
  73. package/dist/types/ESObjects/general/ESFeatureLayer/utils.d.ts.map +1 -0
  74. package/dist/types/ESObjects/general/ESGeoDiv/index.d.ts +2 -1
  75. package/dist/types/ESObjects/general/ESGeoDiv/index.d.ts.map +1 -1
  76. package/dist/types/ESObjects/general/ESGeoJson/index.d.ts +12 -10
  77. package/dist/types/ESObjects/general/ESGeoJson/index.d.ts.map +1 -1
  78. package/dist/types/ESObjects/general/ESGeoJson/type.d.ts +0 -6
  79. package/dist/types/ESObjects/general/ESGeoJson/type.d.ts.map +1 -1
  80. package/dist/types/ESObjects/general/ESGltfModel.d.ts +2 -2
  81. package/dist/types/ESObjects/general/ESGltfModel.d.ts.map +1 -1
  82. package/dist/types/ESObjects/general/ESHeightLimitAnalysis.d.ts.map +1 -1
  83. package/dist/types/ESObjects/general/ESHole.d.ts.map +1 -1
  84. package/dist/types/ESObjects/general/ESHuman.d.ts +2 -1
  85. package/dist/types/ESObjects/general/ESHuman.d.ts.map +1 -1
  86. package/dist/types/ESObjects/general/ESHumanPoi.d.ts.map +1 -1
  87. package/dist/types/ESObjects/general/ESMsTileset/index.d.ts.map +1 -1
  88. package/dist/types/ESObjects/general/ESPath/ESPathImpl/PolylineResetting.d.ts +1 -1
  89. package/dist/types/ESObjects/general/ESPath/ESPathImpl/PolylineResetting.d.ts.map +1 -1
  90. package/dist/types/ESObjects/general/ESPath/ESPathImpl/computeRotIfUndefined.d.ts.map +1 -1
  91. package/dist/types/ESObjects/general/ESPath/ESPathImpl/index.d.ts +2 -2
  92. package/dist/types/ESObjects/general/ESPath/ESPathImpl/index.d.ts.map +1 -1
  93. package/dist/types/ESObjects/general/ESPath/index.d.ts +2 -1
  94. package/dist/types/ESObjects/general/ESPath/index.d.ts.map +1 -1
  95. package/dist/types/ESObjects/general/ESPipeFence.d.ts.map +1 -1
  96. package/dist/types/ESObjects/general/ESPipeserTileset.d.ts +2 -1
  97. package/dist/types/ESObjects/general/ESPipeserTileset.d.ts.map +1 -1
  98. package/dist/types/ESObjects/general/ESPlayer/AbsolutePlayer.d.ts +2 -1
  99. package/dist/types/ESObjects/general/ESPlayer/AbsolutePlayer.d.ts.map +1 -1
  100. package/dist/types/ESObjects/general/ESPoi2D.d.ts +2 -1
  101. package/dist/types/ESObjects/general/ESPoi2D.d.ts.map +1 -1
  102. package/dist/types/ESObjects/general/ESPoi3D.d.ts.map +1 -1
  103. package/dist/types/ESObjects/general/ESRtsFeatureEditing/index.d.ts.map +1 -1
  104. package/dist/types/ESObjects/general/ESRtsTileset/index.d.ts +2 -1
  105. package/dist/types/ESObjects/general/ESRtsTileset/index.d.ts.map +1 -1
  106. package/dist/types/ESObjects/general/ESSeparateFoliage/index.d.ts +2 -1
  107. package/dist/types/ESObjects/general/ESSeparateFoliage/index.d.ts.map +1 -1
  108. package/dist/types/ESObjects/general/ESSkylineAnalysis/index.d.ts +2 -2
  109. package/dist/types/ESObjects/general/ESSkylineAnalysis/index.d.ts.map +1 -1
  110. package/dist/types/ESObjects/general/ESSubmergingAnalysis/index.d.ts +2 -1
  111. package/dist/types/ESObjects/general/ESSubmergingAnalysis/index.d.ts.map +1 -1
  112. package/dist/types/ESObjects/general/ESSunshineAnalysis/index.d.ts +2 -1
  113. package/dist/types/ESObjects/general/ESSunshineAnalysis/index.d.ts.map +1 -1
  114. package/dist/types/ESObjects/general/ESSurfaceAreaMeasurement.d.ts +3 -2
  115. package/dist/types/ESObjects/general/ESSurfaceAreaMeasurement.d.ts.map +1 -1
  116. package/dist/types/ESObjects/general/ESTerrainLayer.d.ts +2 -1
  117. package/dist/types/ESObjects/general/ESTerrainLayer.d.ts.map +1 -1
  118. package/dist/types/ESObjects/general/ESUEWidget.d.ts +2 -1
  119. package/dist/types/ESObjects/general/ESUEWidget.d.ts.map +1 -1
  120. package/dist/types/ESObjects/general/ESUnrealActor.d.ts +2 -1
  121. package/dist/types/ESObjects/general/ESUnrealActor.d.ts.map +1 -1
  122. package/dist/types/ESObjects/general/ESVideoFusion.d.ts +2 -1
  123. package/dist/types/ESObjects/general/ESVideoFusion.d.ts.map +1 -1
  124. package/dist/types/ESObjects/general/ESVolumeMeasurement.d.ts +3 -2
  125. package/dist/types/ESObjects/general/ESVolumeMeasurement.d.ts.map +1 -1
  126. package/dist/types/ESObjects/general/index.d.ts +1 -0
  127. package/dist/types/ESObjects/general/index.d.ts.map +1 -1
  128. package/dist/types/ESViewer/ContainerStyleController.d.ts +1 -1
  129. package/dist/types/ESViewer/ContainerStyleController.d.ts.map +1 -1
  130. package/dist/types/ESViewer/ESViewer.d.ts +21 -2
  131. package/dist/types/ESViewer/ESViewer.d.ts.map +1 -1
  132. package/dist/types/ESViewer/GeneralAnalysis/RollerShutterAnalysis.d.ts +1 -1
  133. package/dist/types/ESViewer/GeneralAnalysis/RollerShutterAnalysis.d.ts.map +1 -1
  134. package/dist/types/ESViewer/GeneralAnalysis/index.d.ts +1 -1
  135. package/dist/types/ESViewer/GeneralAnalysis/index.d.ts.map +1 -1
  136. package/dist/types/ESViewer/Resetting/index.d.ts +1 -1
  137. package/dist/types/ESViewer/Resetting/index.d.ts.map +1 -1
  138. package/dist/types/ESViewer/StatusContainer.d.ts +1 -1
  139. package/dist/types/ESViewer/StatusContainer.d.ts.map +1 -1
  140. package/dist/types/ESViewer/ViewerContainer.d.ts +1 -1
  141. package/dist/types/ESViewer/ViewerContainer.d.ts.map +1 -1
  142. package/dist/types/ESViewer/ViewerContext.d.ts +1 -1
  143. package/dist/types/ESViewer/ViewerContext.d.ts.map +1 -1
  144. package/dist/types/ESViewer/ViewerCustomInteraction.d.ts +1 -1
  145. package/dist/types/ESViewer/ViewerCustomInteraction.d.ts.map +1 -1
  146. package/dist/types/EngineObject/EditingObjectContext.d.ts +1 -1
  147. package/dist/types/EngineObject/EditingObjectContext.d.ts.map +1 -1
  148. package/dist/types/EngineObject/EngineObjectsContext.d.ts +3 -5
  149. package/dist/types/EngineObject/EngineObjectsContext.d.ts.map +1 -1
  150. package/dist/types/EngineObject/index.d.ts +2 -2
  151. package/dist/types/EngineObject/index.d.ts.map +1 -1
  152. package/dist/types/index.d.ts +2 -1
  153. package/dist/types/index.d.ts.map +1 -1
  154. package/dist/types/utils/PropTrees/PropUiTreeManager.d.ts +2 -1
  155. package/dist/types/utils/PropTrees/PropUiTreeManager.d.ts.map +1 -1
  156. package/dist/types/utils/SceneTrees/SceneTree.d.ts +1 -1
  157. package/dist/types/utils/SceneTrees/SceneTreeContextMenu.d.ts +1 -1
  158. package/dist/types/utils/SceneTrees/SceneTreeContextMenu.d.ts.map +1 -1
  159. package/dist/types/utils/SceneTrees/SceneTreeItem.d.ts.map +1 -1
  160. package/dist/types/utils/SceneTrees/SceneTreeJsonLoading.d.ts +1 -1
  161. package/dist/types/utils/SceneTrees/SceneTreeJsonLoading.d.ts.map +1 -1
  162. package/dist/types/utils/SmoothMoveController.d.ts +31 -0
  163. package/dist/types/utils/SmoothMoveController.d.ts.map +1 -0
  164. package/dist/types/utils/base/DragStartDataManager.d.ts +2 -1
  165. package/dist/types/utils/base/DragStartDataManager.d.ts.map +1 -1
  166. package/dist/types/utils/base/TreeItemDragDrop.d.ts +1 -1
  167. package/dist/types/utils/base/TreeItemDragDrop.d.ts.map +1 -1
  168. package/dist/types/utils/base/bindCustomEditing.d.ts +1 -2
  169. package/dist/types/utils/base/bindCustomEditing.d.ts.map +1 -1
  170. package/dist/types/utils/base/utils.d.ts +7 -1
  171. package/dist/types/utils/base/utils.d.ts.map +1 -1
  172. package/dist/types/utils/components/ESSceneObjectWithId.d.ts +2 -1
  173. package/dist/types/utils/components/ESSceneObjectWithId.d.ts.map +1 -1
  174. package/dist/types/utils/components/Player.d.ts +2 -1
  175. package/dist/types/utils/components/Player.d.ts.map +1 -1
  176. package/dist/types/utils/components/Watcher.d.ts +2 -1
  177. package/dist/types/utils/components/Watcher.d.ts.map +1 -1
  178. package/dist/types/utils/components/WatcherTools/toolsForWatcher.d.ts +2 -1
  179. package/dist/types/utils/components/WatcherTools/toolsForWatcher.d.ts.map +1 -1
  180. package/dist/types/utils/index.d.ts +7 -6
  181. package/dist/types/utils/index.d.ts.map +1 -1
  182. package/dist/types/utils/registerCreatedEventUpdate.d.ts +1 -1
  183. package/dist/types/utils/registerCreatedEventUpdate.d.ts.map +1 -1
  184. package/dist/types/utils/registerEventUpdate.d.ts +2 -1
  185. package/dist/types/utils/registerEventUpdate.d.ts.map +1 -1
  186. package/dist/types/xbsj-base/index.d.ts +3 -0
  187. package/dist/types/xbsj-base/index.d.ts.map +1 -0
  188. package/dist/types/xbsj-base/xr-base-utils/Destroyable/destroyObject.d.ts +19 -0
  189. package/dist/types/xbsj-base/xr-base-utils/Destroyable/destroyObject.d.ts.map +1 -0
  190. package/dist/types/xbsj-base/xr-base-utils/Destroyable/index.d.ts +47 -0
  191. package/dist/types/xbsj-base/xr-base-utils/Destroyable/index.d.ts.map +1 -0
  192. package/dist/types/xbsj-base/xr-base-utils/ObjPool.d.ts +39 -0
  193. package/dist/types/xbsj-base/xr-base-utils/ObjPool.d.ts.map +1 -0
  194. package/dist/types/xbsj-base/xr-base-utils/events.d.ts +28 -0
  195. package/dist/types/xbsj-base/xr-base-utils/events.d.ts.map +1 -0
  196. package/dist/types/xbsj-base/xr-base-utils/index.d.ts +8 -0
  197. package/dist/types/xbsj-base/xr-base-utils/index.d.ts.map +1 -0
  198. package/dist/types/xbsj-base/xr-base-utils/oneTimeWarning.d.ts +2 -0
  199. package/dist/types/xbsj-base/xr-base-utils/oneTimeWarning.d.ts.map +1 -0
  200. package/dist/types/xbsj-base/xr-base-utils/pipe/DoublyLinkedList.d.ts +88 -0
  201. package/dist/types/xbsj-base/xr-base-utils/pipe/DoublyLinkedList.d.ts.map +1 -0
  202. package/dist/types/xbsj-base/xr-base-utils/pipe/Event.d.ts +126 -0
  203. package/dist/types/xbsj-base/xr-base-utils/pipe/Event.d.ts.map +1 -0
  204. package/dist/types/xbsj-base/xr-base-utils/pipe/ListenerPipe.d.ts +38 -0
  205. package/dist/types/xbsj-base/xr-base-utils/pipe/ListenerPipe.d.ts.map +1 -0
  206. package/dist/types/xbsj-base/xr-base-utils/pipe/SmartListenerHandler.d.ts +9 -0
  207. package/dist/types/xbsj-base/xr-base-utils/pipe/SmartListenerHandler.d.ts.map +1 -0
  208. package/dist/types/xbsj-base/xr-base-utils/pipe/SmartListenerPipe.d.ts +22 -0
  209. package/dist/types/xbsj-base/xr-base-utils/pipe/SmartListenerPipe.d.ts.map +1 -0
  210. package/dist/types/xbsj-base/xr-base-utils/pipe/index.d.ts +6 -0
  211. package/dist/types/xbsj-base/xr-base-utils/pipe/index.d.ts.map +1 -0
  212. package/dist/types/xbsj-base/xr-base-utils/save/downloadLink.d.ts +2 -0
  213. package/dist/types/xbsj-base/xr-base-utils/save/downloadLink.d.ts.map +1 -0
  214. package/dist/types/xbsj-base/xr-base-utils/save/index.d.ts +3 -0
  215. package/dist/types/xbsj-base/xr-base-utils/save/index.d.ts.map +1 -0
  216. package/dist/types/xbsj-base/xr-base-utils/save/saveOnBrowser.d.ts +10 -0
  217. package/dist/types/xbsj-base/xr-base-utils/save/saveOnBrowser.d.ts.map +1 -0
  218. package/dist/types/xbsj-base/xr-base-utils/timeFuncs.d.ts +6 -0
  219. package/dist/types/xbsj-base/xr-base-utils/timeFuncs.d.ts.map +1 -0
  220. package/dist/types/xbsj-base/xr-utils/ObservableSet.d.ts +20 -0
  221. package/dist/types/xbsj-base/xr-utils/ObservableSet.d.ts.map +1 -0
  222. package/dist/types/xbsj-base/xr-utils/index.d.ts +2 -0
  223. package/dist/types/xbsj-base/xr-utils/index.d.ts.map +1 -0
  224. package/package.json +5 -4
@@ -1,6 +1,47 @@
1
- var EarthSDK3=function(M,d){"use strict";var BI=Object.defineProperty;var QI=(M,d,Yo)=>d in M?BI(M,d,{enumerable:!0,configurable:!0,writable:!0,value:Yo}):M[d]=Yo;var g=(M,d,Yo)=>QI(M,typeof d!="symbol"?d+"":d,Yo);class Yo extends d.Destroyable{constructor(){super(...arguments);g(this,"registerEngines",{})}register(e,n,i){const s=this.registerEngines[e]||new Map;s.has(n)&&console.warn(`register warn:${e}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,i),this.registerEngines[e]=s}getEngineObjConstructor(e,n){const i=this.registerEngines[n];if(!i)return;let s=e.constructor,o=e.typeName,a=i.get(o);if(a)return a;const u=o;for(;o!=="ESSceneObject"&&(s=s.getParentClass(),!!s);)if(o=s.type,a=i.get(o),a)return console.warn(`未找到${u}在${n}中对应的实现类! 使用父类${o}的实现类!`),a}createEngineObject(e,n){const i=this.getEngineObjConstructor(e,n.typeName);if(i){const s=new i(e,n);return s.createdEvent.emit(),s}else{const s=new eo(e,n);return s.createdEvent.emit(),s}}}class dm extends d.Destroyable{constructor(){super(...arguments);g(this,"registerEngines",{})}register(e,n,i){const s=this.registerEngines[e]||new Map;s.has(n)&&console.warn(`register warn:${e}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,i),this.registerEngines[e]=s}getEngineObjConstructor(e,n){const s=(this.registerEngines[n]||new Map).get(e);if(s)return s;console.warn(`未找到${e}在${n}中对应的实现类!`)}createEngineObject(e,n){const i=this.getEngineObjConstructor(e.typeName,n.typeName);if(i){const s=new i(e,n);return s.createdEvent.emit(),s}else{const s=new eo(e,n);return s.createdEvent.emit(),s}}}const Gn=class Gn extends d.Destroyable{constructor(e,n,i=!1){super();g(this,"_createdEvent",this.dv(new d.Event));g(this,"_id",++Gn._accumId);this._sceneObject=e,this._viewer=n;{if(i)return;const s=(o,a)=>{for(let u of o)this._viewer.delete(u);for(let u of a)u.parentID=this.sceneObject.id,this._viewer.add(u)};s([],this._sceneObject.components.values()),this.d(this._sceneObject.components.toChange.don(s)),this.d(()=>s(this._sceneObject.components.values(),[]))}}get createdEvent(){return this._createdEvent}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get id(){return this._id}};g(Gn,"context",new Yo),g(Gn,"contextEditing",new dm),g(Gn,"register",Gn.context.register.bind(Gn.context)),g(Gn,"registerEditing",Gn.contextEditing.register.bind(Gn.contextEditing)),g(Gn,"_accumId",-1);let eo=Gn;const Xh=class Xh extends d.Destroyable{constructor(e,n){super();g(this,"_id",++Xh._accumId);this._name=e,this._description=n}get id(){return this._id}get name(){return this._name}get description(){return this._description}};g(Xh,"_accumId",-1);let ys=Xh;class ec extends ys{constructor(t,e,n,i,s){super(t,e),this._withUndefined=n,this._readonly=i,this._defaultValue=s}get withUndefined(){return this._withUndefined}get readonly(){return this._readonly}get defaultValue(){return this._defaultValue instanceof Function?this._defaultValue():this._defaultValue}}class xt extends ec{constructor(t,e,n,i,s,o){const a=t instanceof d.ReactiveVariable?"未获取到属性名":t[1].toString();super(e??a,o??a,i??!1,s??!1,n),this._reactVar=t}get reactVar(){return this._reactVar}}class $ extends xt{get type(){return"BooleanProperty"}}class _t extends xt{get type(){return"StringProperty"}}class L extends xt{get type(){return"NumberProperty"}}class gm extends xt{get type(){return"MaximumScreenSpaceErrorProperty"}}class ug extends xt{get type(){return"StringsProperty"}}class pm extends xt{get type(){return"NumbersProperty"}}class vm extends xt{get type(){return"BooleansProperty"}}class mm extends xt{get type(){return"String2Property"}}class ym extends xt{get type(){return"String3Property"}}class _m extends xt{get type(){return"String4Property"}}class lg extends xt{get type(){return"String2sProperty"}}class Em extends xt{get type(){return"String3sProperty"}}class wm extends xt{get type(){return"String4sProperty"}}class Ve extends xt{get type(){return"Number2Property"}}class lr extends xt{get type(){return"Number3Property"}}class Hn extends xt{get type(){return"Number4Property"}}class Sm extends xt{get type(){return"Number4WithUndefinedProperty"}}class hg extends xt{get type(){return"Number2sProperty"}}class rc extends xt{get type(){return"Number3sProperty"}}class Cm extends xt{get type(){return"Number4sProperty"}}class Pm extends xt{get type(){return"Boolean2Property"}}class Im extends xt{get type(){return"Boolean3Property"}}class Mm extends xt{get type(){return"Boolean4Property"}}class Nm extends xt{get type(){return"Boolean2sProperty"}}class bm extends xt{get type(){return"Boolean3sProperty"}}class Tm extends xt{get type(){return"Boolean4sProperty"}}class xm extends xt{get type(){return"StringNumberProperty"}}class Om extends xt{get type(){return"StringNumbersProperty"}}class Rt extends Hn{get type(){return"ColorProperty"}}class Am extends lr{get type(){return"ColorRgbProperty"}}class Dm extends L{get type(){return"DashPatternProperty"}}class bt extends xt{constructor(t,e,n,i,s,o,a){super(t,n,i,s,o,a),this._enums=e}get type(){return"EnumProperty"}get enums(){return this._enums}}class Lm extends xt{constructor(t,e,n,i,s,o,a){super(t,n,i,s,o,a),this._enums=e}get type(){return"EnumStringsProperty"}get enums(){return this._enums}}class _s extends xt{constructor(t,e,n,i,s,o,a){super(t,e,n,s,o,a),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"EvalStringProperty"}}class cg extends xt{constructor(t,e,n,i,s){super(t,e,i,!1,!1,s),this._paramTypes=n}get type(){return"ParamsProperty"}get paramTypes(){return this._paramTypes}}class pt extends ys{constructor(e,n,i,s,o){const a=s??"Unnamed Function";super(a,o??a);g(this,"_paramsProperty");g(this,"_getValueFunc");this._func=n;const u=this.disposeVar(d.reactJson(i));this._paramsProperty=this.disposeVar(new cg(u,a+"_params",e,i));const[l]=d.getReactFuncs(this._paramsProperty.reactVar);this._getValueFunc=l}get paramsProperty(){return this._paramsProperty}exec(){this._func(...this._getValueFunc())}get type(){return"FunctionProperty"}}class gt extends ys{constructor(t,e,n){const i=e??"分组";super(i,n??i),this._children=t}get type(){return"GroupProperty"}get children(){return this._children}}class ut extends xt{constructor(t,e,n,i,s,o,a){super(t,e,n,s,o,a),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"JsonProperty"}}class nc extends xt{constructor(t,e,n,i,s,o,a){super(t,e,n,s,o,a),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"LongStringProperty"}}class Rm extends Ve{get type(){return"MinmaxProperty"}}class Fm extends Hn{get type(){return"NearFarScalerProperty"}}class fg extends ec{constructor(t,e,n,i,s,o,a){const u=n??"非响应式Json";super(u,a??u,s??!1,o??!1,i),this._getJsonStringFunc=t,this._setJsonStringFunc=e}get type(){return"NonreactiveJsonStringProperty"}get getJsonStringFunc(){return this._getJsonStringFunc}get setJsonStringFunc(){return this._setJsonStringFunc}}class Gm extends Ve{get type(){return"NumberRangeProperty"}}class Xe extends xt{constructor(t,e,n,i,s,o,a,u){super(t,i,s,o,a,u),this._step=e,this._minMax=n}get type(){return"NumberSliderProperty"}get minMax(){return this._minMax}get step(){return this._step}}function km(r,t){const[e,n,i]=d.getReactFuncs(r),[s,o,a]=d.getReactFuncs(t),u=d.react((e()??0)/(s()??3e3)),l=()=>{const h=u.value,c=s()??3e3,f=e()??0;if(!Number.isFinite(c)||!Number.isFinite(f)){console.warn(`duration || currentTime error: duration: ${c} currentTime: ${f}`);return}Math.abs(h*c-f)<.001||(c<=0?u.value=0:u.value=f/c)};return u.dispose(i.disposableOn(l)),u.dispose(a.disposableOn(l)),u.dispose(u.changed.disposableOn(()=>{const h=u.value,c=s()??3e3,f=e()??0;if(!Number.isFinite(c)||!Number.isFinite(f)){console.warn(`duration || currentTime error: duration: ${c} currentTime: ${f}`);return}Math.abs(h*c-f)<.001||n(h*c)})),u}class Dl extends ys{constructor(e,n,i,s,o,a){super(s??"播放器",a??"播放器");g(this,"_defaults",{playing:!1,ratio:0,loop:!1});this._playingReact=e,this._ratioReact=n,this._loopReact=i,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.ratio=o.ratio??this._defaults.ratio,this._defaults.loop=o.loop??this._defaults.loop)}get type(){return"PlayerProperty"}get playingReact(){return this._playingReact}get ratioReact(){return this._ratioReact}get loopReact(){return this._loopReact}get defaults(){return this._defaults}}g(Dl,"createPlayingRatio",km);class Jo extends lr{get type(){return"PositionProperty"}}class dg extends xt{get type(){return"PositionsProperty"}}class Vm extends xt{get type(){return"PositionsSetPropety"}}class ic extends lr{get type(){return"RotationProperty"}}class mu extends _t{get type(){return"UriProperty"}}class gg extends ys{constructor(e,n,i,s,o,a){const u=s??"视角播放器";super(u,a??u);g(this,"_defaults",{playing:!1,loop:!1});this._playingReact=e,this._stopFn=n,this._loopReact=i,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.loop=o.loop??this._defaults.loop)}get type(){return"ViewPlayerProperty"}get playingReact(){return this._playingReact}get loopReact(){return this._loopReact}get stopFn(){return this._stopFn}get defaults(){return this._defaults}}class pg extends xt{get type(){return"DatesProperty"}}class ro extends xt{get type(){return"DateProperty"}}var lt=(r=>(r.Place="place",r.Translation="translation",r.Rotation="rotation",r.Scale="scale",r.DoublePointsAppend="doublePointsAppend",r.DoublePointsModify="doublePointsModify",r.CircularAppend="circularAppend",r.CircularInsert="circularInsert",r.LineStringAppend="lineStringAppend",r.LineStringInsert="lineStringInsert",r.ScatterAppend="scatterAppend",r.ScatterModify="scatterModify",r.VisibilityAppend="visibilityAppend",r.VisibilityModify="visibilityModify",r.HeightModify="heightModify",r))(lt||{}),vg=(r=>(r.DECIMAL_DEGREE="DECIMAL_DEGREE",r.DEGREES_DECIMAL_MINUTES="DEGREES_DECIMAL_MINUTES",r.SEXAGESIMAL_DEGREE="SEXAGESIMAL_DEGREE",r))(vg||{});class Um{constructor(t){this.childPickedInfo=t}}class zm{constructor(t,e,n,i,s,o){this.pickResult=t,this.sceneObject=e,this.tilesetPickInfo=n,this.geojsonPickInfo=i,this.attachedInfo=s,this.screenPosition=o}assign(t){t!=null&&t.pickedResult&&(this.pickResult=t.pickedResult),t!=null&&t.sceneObject&&(this.sceneObject=t.sceneObject),t!=null&&t.tilesetPickInfo&&(this.tilesetPickInfo=t.tilesetPickInfo),t!=null&&t.geojsonPickInfo&&(this.geojsonPickInfo=t.geojsonPickInfo),t!=null&&t.attachedInfo&&(this.attachedInfo=t.attachedInfo),t!=null&&t.screenPosition&&(this.screenPosition=t.screenPosition)}}class qm extends d.Destroyable{constructor(e){super();g(this,"_sceneObjRefs",new Map);g(this,"_refs",{});g(this,"_refsChanged",this.dv(new d.Event));const n=(i,s,o)=>{if(o){const a=this.getLastSceneObject(o),u=this._sceneObjRefs.get(o);if(!u)console.warn(`this._sceneObjRefs中不存在ref(${o}), 可能系统存在逻辑问题`);else{const h=u.indexOf(i);h===-1?console.warn(`this._sceneObjRefs中不存在当前对象(id: ${i.id} type: ${i.typeName})!可能系统存在逻辑问题`):(u.splice(h,1),u.length===0&&this._sceneObjRefs.delete(o))}const l=this.getLastSceneObject(o);this._refs[o]=l,this._refsChanged.emit(l,a)}if(s){const a=this.getLastSceneObject(s),u=this._sceneObjRefs.get(s);u?(u.push(i),u.length>0&&console.warn(`同时存在多个ref${s}相同的场景对象!
1
+ var CM=Object.defineProperty;var IM=(I,g,Eo)=>g in I?CM(I,g,{enumerable:!0,configurable:!0,writable:!0,value:Eo}):I[g]=Eo;var d=(I,g,Eo)=>IM(I,typeof g!="symbol"?g+"":g,Eo);var EarthSDK3=(function(I,g){"use strict";function Eo(){const r=navigator.userAgent;let t="Unknown";/Windows/.test(r)?t="Windows":/Macintosh/.test(r)?t="MacOS":/Linux/.test(r)?t="Linux":/Android/.test(r)?t="Android":/iOS|iPhone|iPad|iPod/.test(r)&&(t="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(r)?e="x64":/x86|i686|Win32/.test(r)?e="x86":/arm64|aarch64/.test(r)?e="arm64":/arm/.test(r)&&(e="arm"),{os:t.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const hy=Date.now();function Dd(r){const{os:t,arch:e}=Eo(),n={version:r.version,commitdate:r.date,commitId:r.commitId,runningTime:(Date.now()-hy)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:t,arch:e},s={method:"GET",headers:new Headers,redirect:"follow"},o=window.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(a=>a.text()).then(a=>console.log(a)).catch(a=>console.log("error",a))}I.copyright=void 0;try{const r="earthsdk3",t="3.4.1",e="2025-09-16T08:13:00.000Z",n="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="edc6b1a5e35b2412fad91ee205c768829c64b897",a=((Date.now()-175801038e4)/36e5).toFixed(1),u=`%c🌏 ${r}%c ${t}.${s.slice(0,8)}.${e} (距今${a}个小时)
2
+ %c${i?i+`
3
+ `:""}当前网站正在使用${r},此软件版权归${n}所有
4
+ `;I.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","edc6b1a5e35b2412fad91ee205c768829c64b897")},get info(){return u},get date(){return"2025-09-16T08:13:00.000Z"},get author(){return"suplyang"},get version(){return"3.4.1"},get name(){return"earthsdk3"},get commitId(){return"edc6b1a5e35b2412fad91ee205c768829c64b897"},print(){console.info(this.info,`
5
+ font-size: 18px;
6
+ font-weight: 1000;
7
+ line-height: 1;
8
+ color: rgb(0, 120, 215);
9
+ padding-top: 20px;
10
+ padding-bottom: 10px;
11
+ `,`
12
+ font-size: 10px;
13
+ font-weight: 1000;
14
+ color: rgb(0, 120, 215);
15
+ `,`
16
+ font-size: 10px;
17
+ line-height: 1.5;
18
+ color: rgb(0, 120, 215);
19
+ padding-bottom: 2px;
20
+ padding-left: 35px;
21
+ `)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[r]=I.copyright,window.g_XE3SendProductUsageInfo=window.g_XE3SendProductUsageInfo||!0,window.g_XE3SendProductUsageInfo&&(setTimeout(()=>Dd(I.copyright),6e4),setInterval(()=>Dd(I.copyright),864e5)),window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&I.copyright.print()}catch{console.warn("版本信息有误!")}function cy(){return!0}function fy(){throw new Error("throwOnDestroyed")}function Ad(r){for(var t in r)typeof r[t]=="function"&&(r[t]=fy);r.isDestroyed=cy}const Th=class Th{constructor(){d(this,"_memId",++Th._lastMemId);d(this,"_disposers")}get __v_skip(){return!0}get memId(){return this._memId}get disposers(){return this._disposers||(this._disposers=[]),this._disposers}dispose(t){return this.disposers.push(t),t}d(t){return this.dispose(t)}disposeVar(t){return this.disposers.push(()=>t.destroy()),t}dv(t){return this.disposeVar(t)}tryDisposeVar(t){return this.disposers.push(()=>t.tryDestroy()),t}tdv(t){return this.tryDisposeVar(t)}autoDispose(t){return typeof t=="function"?this.dispose(t):this.disposeVar(t)}ad(t){return typeof t=="function"?this.dispose(t):this.disposeVar(t)}isDestroyed(){return!1}destroyImp(){}destroy(){if(this._toDestroyEvent&&this._toDestroyEvent.emit(),this.destroyImp(),this._disposers)try{const t=this._disposers,e=t.length;for(let n=e-1;n>=0;--n)t[n]();t.length=0,this._disposers=void 0}catch(t){console.error(`destroy get error! ${t}`)}return Ad(this)}tryDestory(){if(!this.isDestroyed())return this.destroy()}};d(Th,"_lastMemId",-1);let B=Th,Lh;function Ld(r){Lh=r}Object.defineProperties(B.prototype,{toDestroyEvent:{get(){if(this._toDestroyEvent===void 0){if(!Lh)throw new Error("Destroyable EventCtor not registered yet!");this._toDestroyEvent=this.disposeVar(new Lh)}return this._toDestroyEvent}}});class Rh{constructor(t,e,n=!1){d(this,"_freeElements");d(this,"_usedElementsCount");d(this,"_usedElements");d(this,"_nextCreateID");d(this,"_scratchObjs");this._createDefaultFunc=t,this._destroyFunc=e,this._freeElements=[],this._usedElementsCount=0,this._nextCreateID=1,this._scratchObjs=[],n&&(this._usedElements=[])}get usedElementsCount(){return this._usedElementsCount}get freeElementsCount(){return this._freeElements.length}_getCreateID(){return this._nextCreateID++}_create(){let t;return this._freeElements.length>0?t=this._freeElements.pop():t=this._createDefaultFunc&&this._createDefaultFunc()||{},t._cid=this._getCreateID(),t}create(){return this._create()}multiCreate(t){this._scratchObjs.length=0;for(let e=0;e<t;++e)this._scratchObjs.push(this._create());return this._scratchObjs}_destroy(t){this._destroyFunc&&this._destroyFunc(t),t._cid=void 0}destroy(...t){const e=t.length;for(let n=0;n<e;++n)this._destroy(t[n])}}function dy(){return{item:void 0,previous:void 0,next:void 0}}function py(r){r.item=void 0,r.previous=void 0,r.next=void 0}const Rd=new Rh(dy,py,!0);function Fh(r,t,e){const n=Rd.create();return n.item=r,n.previous=t,n.next=e,n}function Fd(r){if(!r)throw new Error("node is undefined!");Rd.destroy(r)}function kh(r,t){t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=void 0,r.tail=t.previous):t.next?(t.next.previous=void 0,r.head=t.next):(r.head=void 0,r.tail=void 0),t.next=void 0,t.previous=void 0}class kd{constructor(t){d(this,"head");d(this,"tail");d(this,"_length");const{needLength:e}=t||{needLength:!0};this.head=void 0,this.tail=void 0,e&&(this._length=0)}_incrementLength(){typeof this._length=="number"&&++this._length}_decrementLength(){typeof this._length=="number"&&--this._length}_setLength(t){typeof this._length=="number"&&(this._length=t)}get length(){return this._length}get empty(){return!this.head}*[Symbol.iterator](){let t=this.head;for(;t;)yield t,t=t.next}remove(t){if(!t)throw new Error("node is undefined!");kh(this,t),this._decrementLength(),Fd(t)}getNode(t){let e=this.head;for(;e!==null;){if(!e)throw new Error("current is undefined!");if(e.item===t)return e;e=e.next}}moveAfter(t,e){if(t!==e){kh(this,e);var n=t.next;t.next=e,this.tail===t?this.tail=e:n&&(n.previous=e),e.next=n,e.previous=t}}moveBefore(t,e){if(t!==e){kh(this,e);var n=t.previous;t.previous=e,this.head===t?this.head=e:n&&(n.next=e),e.previous=n,e.next=t}}insertBefore(t,e){const n=Fh(e,t.previous,t);return t.previous&&(t.previous.next=n),t.previous=n,this.head===t&&(this.head=n),this._incrementLength(),n}insertAfter(t,e){const n=Fh(e,t,t.next);return t.next&&(t.next.previous=n),t.next=n,this.tail===t&&(this.tail=n),this._incrementLength(),n}_setFirstNode(t){if(this.head||this.tail)throw new Error("_setFirstNode error!");const e=Fh(t,void 0,void 0);if(this.head=e,this.tail=e,this._incrementLength(),this._length!==1)throw new Error("_setFirstNode error! this._length !== 1");return e}push(t){return this.tail?this.insertAfter(this.tail,t):this._setFirstNode(t)}pop(){if(!this.tail)throw new Error("DoublyLinkedList is empty!");const t=this.tail.item;return this.remove(this.tail),t}shift(){if(!this.head)throw new Error("DoublyLinkedList is empty!");const t=this.head.item;return this.remove(this.head),t}unshift(t){return this.head?this.insertBefore(this.head,t):this._setFirstNode(t)}removeAll(){let t=this.head;for(;t;){const e=t.next;Fd(t),t=e}this.head=void 0,this.tail=void 0,this._setLength(0)}}const Vd=new Set;function Ud(r,t=r){Vd.has(t)||(Vd.add(t),console.warn(r))}function gy(){return{func:void 0,scope:void 0,_hasRemoved:!1,_once:!1}}function my(r){r.func=void 0,r.scope=void 0,r._hasRemoved=!1,r._once=!1}const Ns=new Rh(gy,my,!0);class Vh{constructor(){d(this,"__dll");d(this,"__currentListenerStack")}get _dll(){return this.__dll=this.__dll??new kd({needLength:!0}),this.__dll}_pushCurrentListener(t){this.__currentListenerStack?Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.push(t):this.__currentListenerStack=[this.__currentListenerStack,t]:this.__currentListenerStack=t}_popCurrentListener(){if(this.__currentListenerStack)Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.pop():this.__currentListenerStack=void 0;else throw new Error("cannot pop!")}_hasCurrentListener(t){return this.__currentListenerStack?Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.indexOf(t)!==-1:this.__currentListenerStack===t:!1}do(...t){if(this.__dll&&!this._dll.empty){let e=this._dll.head;for(;e;){const n=e.item;n._hasRemoved||(this._pushCurrentListener(n),n.func.call(n.scope,...t),this._popCurrentListener());const i=e.next;n._once&&!n._hasRemoved&&(this.remove(e),e=void 0),e&&this._clearHasRemoved(e),e=i}}}get empty(){if(!this.__dll||this._dll.empty)return!0;let t=!0,e=this._dll.head;for(;e;){if(!e.item._hasRemoved){t=!1;break}e=e.next}return t}isHandlerValid(t){return!t.item._hasRemoved}nextHandler(t){if(!t.item._hasRemoved)throw new Error("handler has removed!");let e=t.next;for(;e&&e.item._hasRemoved;)e=e.next;return e}prevHandler(t){if(!t.item._hasRemoved)throw new Error("handler has removed!");let e=t.previous;for(;e&&e.item._hasRemoved;)e=e.previous;return e}moveAfter(t,e){if(t.item._hasRemoved||e.item._hasRemoved)throw new Error("handler or nextHandler has removed!");return this._dll.moveAfter(t,e)}moveBefore(t,e){if(t.item._hasRemoved||e.item._hasRemoved)throw new Error("handler or prevHandler has removed!");return this._dll.moveBefore(t,e)}insertBefore(t,e,n,i=!1){if(t.item._hasRemoved)throw new Error("handler has removed!");const s=Ns.create();return s.func=e,s.scope=n,s._once=i,this._dll.insertBefore(t,s)}insertAfter(t,e,n,i=!1){if(t.item._hasRemoved)throw new Error("handler has removed!");const s=Ns.create();return s.func=e,s.scope=n,s._once=i,this._dll.insertAfter(t,s)}_clearHasRemoved(t){t.item._hasRemoved&&!this._hasCurrentListener(t.item)&&(Ns.destroy(t.item),this._dll.remove(t))}remove(t){if(!t.item||t.item._hasRemoved)throw new Error("handler has removed!");this._hasCurrentListener(t.item)?t.item._hasRemoved=!0:(Ns.destroy(t.item),this._dll.remove(t))}removeAll(){if(this.__dll&&!this._dll.empty){let t=this._dll.head;for(;t;){const e=t.next;t.item._hasRemoved||this.remove(t),t=e}}}destroy(){if(!this.__dll)return;let t=this._dll.head;for(;t;){const e=t.next,n=t;this._hasCurrentListener(n.item)||(console.warn("Event has remove item that on current stack!"),console.warn(`${n.item.func.toString()}`)),Ns.destroy(n.item),this._dll.remove(n),t=e}this.__dll=void 0,this.__currentListenerStack=void 0}push(t,e,n=!1){const i=Ns.create();return i.func=t,i.scope=e,i._once=n,this._dll.push(i)}pop(){const t=this.tail;if(!t)throw new Error("pop error!");this.remove(t)}shift(){const t=this.head;if(!t)throw new Error("shift error!");this.remove(t)}unshift(t,e,n=!1){const i=Ns.create();return i.func=t,i.scope=e,i._once=n,this._dll.unshift(i)}get tail(){let t=this._dll.tail;for(;t&&t.item._hasRemoved;)t=t.previous;return t}get head(){let t=this._dll.head;for(;t&&t.item._hasRemoved;)t=t.previous;return t}}class tu{constructor(){d(this,"_listenerHandler");d(this,"_cid")}_reset(t,e){this._listenerHandler=t,this._cid=e}clone(t){return t=t??new tu,t._reset(this._listenerHandler,this._cid),t}get valid(){if(typeof this._listenerHandler<"u"&&typeof this._cid=="number"){const t=this._listenerHandler._cid;if(typeof t<"u"&&this._cid===t)return!0}return!1}}class Uh extends tu{}let V=class extends B{constructor(){super(...arguments);d(this,"__pipe");d(this,"beforeCallback");d(this,"afterCallback")}get _pipe(){return this.__pipe=this.__pipe??new Vh,this.__pipe}get empty(){return!this.__pipe||this._pipe.empty}emit(...e){!this.isDestroyed()&&this.beforeCallback&&this.beforeCallback(...e),!this.isDestroyed()&&this._pipe.do(...e),!this.isDestroyed()&&this.afterCallback&&this.afterCallback(...e)}on(e,n,i=!1,s){const o=i?this._pipe.unshift(e,n,!1):this._pipe.push(e,n,!1);return s=s??new Uh,s._reset(o,o._cid),s}disposableOn(e,n,i=!1,s){const o=this.on(e,n,i,s);return()=>{o.valid&&this.off(o)}}don(e,n,i=!1,s){return this.disposableOn(e,n,i,s)}disposableWeakOn(e,n,i=!1,s){const o=new B,a=()=>{!o.isDestroyed()&&o.destroy()};return o.dispose(this.disposableOn(e,n,i,s)),o.dispose(this.toDestroyEvent.disposableOn(a)),a}dwon(e,n,i=!1,s){return this.disposableWeakOn(e,n,i,s)}once(e,n,i=!1,s){const o=i?this._pipe.unshift(e,n,!0):this._pipe.push(e,n,!0);return s=s??new Uh,s._reset(o,o._cid),s}disposableOnce(e,n,i=!1,s){const o=this.once(e,n,i,s);return()=>o.valid&&this.off(o)}donce(e,n,i=!1,s){const o=this.once(e,n,i,s);return()=>o.valid&&this.off(o)}off(e){if(!e.valid)throw new Error("handler is not valid!");this._pipe.remove(e._listenerHandler),e._reset()}reset(){this._pipe.removeAll()}destroyImp(){this.empty||(Ud("The event is destroying with listeners!"),this._pipe.removeAll())}};Ld(V);function So(r,t){return t=t??new tu,t._reset(r,r._cid),t}class vy{constructor(){d(this,"__pipe")}get _pipe(){return this.__pipe=this.__pipe??new Vh,this.__pipe}get empty(){return!this.__pipe||this._pipe.empty}do(...t){return this._pipe.do(...t)}isHandlerValid(t){return t.valid?this._pipe.isHandlerValid(t._listenerHandler):!1}moveAfter(t,e){if(!t.valid||!e.valid)throw new Error("handler or nextHander is not valid!");return this._pipe.moveAfter(t._listenerHandler,e._listenerHandler)}moveBefore(t,e){if(!t.valid||!e.valid)throw new Error("handler or nextHander is not valid!");return this._pipe.moveAfter(t._listenerHandler,e._listenerHandler)}insertBefore(t,e,n,i=!1,s){if(!t.valid)throw new Error("handler is not valid!");const o=this._pipe.insertBefore(t._listenerHandler,e,n,i);return So(o,s)}insertAfter(t,e,n,i=!1,s){if(!t.valid)throw new Error("handler is not valid!");const o=this._pipe.insertAfter(t._listenerHandler,e,n,i);return So(o,s)}remove(t){if(!t.valid)throw new Error("handler is not valid!");return this._pipe.remove(t._listenerHandler)}removeAll(){return this._pipe.removeAll()}push(t,e,n=!1,i){const s=this._pipe.push(t,e,n);return So(s,i)}pop(){return this._pipe.pop()}shift(){return this._pipe.shift()}unshift(t,e,n=!1,i){const s=this._pipe.unshift(t,e,n);return So(s,i)}getTail(t){const e=this._pipe.tail;if(e)return So(e,t)}getHead(t){const e=this._pipe.head;if(e)return So(e,t)}}function yy(r,t,...e){const n=setInterval(r,t,...e);return()=>clearInterval(n)}function _y(r,t,...e){const n=setTimeout(r,t,...e);return()=>clearTimeout(n)}function wy(r,...t){let e;const n=()=>{const i=performance.now();r(i,...t),e=requestAnimationFrame(n)};return n(),()=>typeof e<"u"&&(cancelAnimationFrame(e),e=void 0)}function zd(r,...t){let e;return e=requestAnimationFrame(()=>{const i=performance.now();r(i,...t)}),()=>typeof e<"u"&&(cancelAnimationFrame(e),e=void 0)}function Ey(r,...t){let e=!1,n;return new Promise((i,s)=>{n=s,i()}).then(()=>{!e&&r(...t)}).catch(i=>{console.error(i)}),()=>(e=!0)&&n&&(n("nextMicroTask cancelled!"),n=void 0)}class Sy extends V{constructor(e,n,...i){super();d(this,"_cancellFunc");this._nextFunc=e,this.dispose(()=>{this._cancellFunc&&(this._cancellFunc(),this._cancellFunc=void 0)}),i.forEach(s=>this.dispose(s[n?"dwon":"don"](()=>{this.next()})))}next(){this._cancellFunc||(this._cancellFunc=this._nextFunc(()=>(this._cancellFunc=void 0,this.emit())))}flush(){this._cancellFunc&&(this._cancellFunc(),this._cancellFunc=void 0,this.emit())}}class Gd extends Sy{constructor(...t){super(zd,!1,...t)}}function Co(r,t,e={time:"don",immediate:!1}){const n=new Gd(...Array.isArray(r)?r:[r]),i=n[e.time??"don"](t);return(e.immediate??!1)&&t(),()=>{i(),n.destroy()}}function Cy(r,t,e){typeof e>"u"&&(t.endsWith(".gltf")?e="model/gltf+json":t.endsWith(".bin")?e="application/octet-stream":t.endsWith(".glb")?e="model/gltf-binary":t.endsWith(".jpg")||t.endsWith(".jpeg")?e="image/jpeg":t.endsWith(".png")?e="image/png":t.endsWith(".glsl")?e="text/plain":t.endsWith(".json")?e="application/json":t.endsWith(".b3dm")||t.endsWith(".i3dm")||t.endsWith("pnts")||t.endsWith("cmpt")?e="application/octet-stream":console.warn(`save ${t}: MimeType无法确定!`));const n=new Blob([r],{type:e||""});let i=URL.createObjectURL(n);var s=document.createElement("a"),o=new MouseEvent("click");s.download=t,s.href=i,s.dispatchEvent(o),URL.revokeObjectURL(i)}function Iy(r,t){const e=document.createElement("a"),n=new MouseEvent("click");e.download=t||"下载",e.href=r,e.dispatchEvent(n)}const Oh=class Oh extends B{constructor(){super();d(this,"_set",new Set);d(this,"_toChangeEvent",this.disposeVar(new V));d(this,"_changedEvent",this.disposeVar(new V));d(this,"main");this.dispose(()=>{this._set.size!==0&&(Oh.warnOnDestroying&&console.warn("this._set.size > 0"),this.clear())})}get toChange(){return this._toChangeEvent}get changed(){return this._changedEvent}add(...e){if(e.length==2&&typeof e[1]=="boolean")e[1]&&(this.main=e[0]);else for(let n of e)this._toChangeEvent.emit([],[n]),this._set.add(n),this._changedEvent.emit([],[n])}delete(...e){for(let n of e)this.main&&this.main==n&&(this.main=void 0),this._toChangeEvent.emit([n],[]),this._set.delete(n),this._changedEvent.emit([n],[])}disposableAdd(...e){return e.length==2&&typeof e[1]=="boolean"?(e[1]&&(this.main=e[0]),this.add(e[0]),()=>this.delete(e[0])):(this.add(...e),()=>this.delete(...e))}get size(){return this._set.size}clear(){const e=[...this._set];this._toChangeEvent.emit([],e),this._set.clear(),this._changedEvent.emit([],e)}values(){return this._set.values()}};d(Oh,"warnOnDestroying",!0);let hl=Oh;class Py extends B{constructor(){super(...arguments);d(this,"registerEngines",{})}register(e,n,i){const s=this.registerEngines[e]||new Map;return s.has(n)&&console.warn(`register warn:${e}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,i),this.registerEngines[e]=s,n}getEngineObjConstructor(e,n){const i=this.registerEngines[n];if(!i)return;let s=e.constructor,o=e.typeName,a=i.get(o);if(a)return a;if(e.components.main)return;const u=o;for(;o!=="ESSceneObject"&&(s=s.getParentClass(),!!s);)if(o=s.type,a=i.get(o),a)return console.warn(`未找到${u}在${n}中对应的实现类! 使用父类${o}的实现类!`),a}createEngineObject(e,n){const i=this.getEngineObjConstructor(e,n.typeName);if(i){const s=new i(e,n);return s.createdEvent.emit(),s}else{const s=new Ts(e,n);return s.createdEvent.emit(),s}}}class My extends B{constructor(){super(...arguments);d(this,"registerEngines",{})}register(e,n,i){const s=this.registerEngines[e]||new Map;s.has(n)&&console.warn(`register warn:${e}中${n}的实现类已经被注册,再次注册会覆盖。`),s.set(n,i),this.registerEngines[e]=s}getEngineObjConstructor(e,n){const s=(this.registerEngines[n]||new Map).get(e);if(s)return s;console.warn(`未找到${e}在${n}中对应的实现类!`)}createEngineObject(e,n){const i=this.getEngineObjConstructor(e.typeName,n.typeName);if(i){const s=new i(e,n);return s.createdEvent.emit(),s}else{const s=new Ts(e,n);return s.createdEvent.emit(),s}}}const yn=class yn extends B{constructor(e,n,i=!1){super();d(this,"_createdEvent",this.dv(new V));d(this,"_id",++yn._accumId);this._sceneObject=e,this._viewer=n;{if(i)return;const s=(o,a)=>{for(let u of o)this._viewer.delete(u);for(let u of a)u.parentID=this.sceneObject.id,this._viewer.add(u)};s([],this._sceneObject.components.values()),this.d(this._sceneObject.components.toChange.don(s)),this.d(()=>s(this._sceneObject.components.values(),[]))}}get createdEvent(){return this._createdEvent}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get id(){return this._id}};d(yn,"context",new Py),d(yn,"contextEditing",new My),d(yn,"register",yn.context.register.bind(yn.context)),d(yn,"registerEditing",yn.contextEditing.register.bind(yn.contextEditing)),d(yn,"_accumId",-1);let Ts=yn;const Dh=class Dh extends B{constructor(e,n){super();d(this,"_id",++Dh._accumId);this._name=e,this._description=n}get id(){return this._id}get name(){return this._name}get description(){return this._description}};d(Dh,"_accumId",-1);let ji=Dh;class zh extends ji{constructor(t,e,n,i,s){super(t,e),this._withUndefined=n,this._readonly=i,this._defaultValue=s}get withUndefined(){return this._withUndefined}get readonly(){return this._readonly}get defaultValue(){return this._defaultValue instanceof Function?this._defaultValue():this._defaultValue}}class mt extends zh{constructor(t,e,n,i,s,o){const a=t instanceof g.ReactiveVariable?"未获取到属性名":t[1].toString();super(e??a,o??a,i??!1,s??!1,n),this._reactVar=t}get reactVar(){return this._reactVar}}class W extends mt{get type(){return"BooleanProperty"}}class ot extends mt{get type(){return"StringProperty"}}class T extends mt{get type(){return"NumberProperty"}}class by extends mt{get type(){return"MaximumScreenSpaceErrorProperty"}}class qd extends mt{get type(){return"StringsProperty"}}class xy extends mt{get type(){return"NumbersProperty"}}class Ny extends mt{get type(){return"BooleansProperty"}}class Ty extends mt{get type(){return"String2Property"}}class Oy extends mt{get type(){return"String3Property"}}class Dy extends mt{get type(){return"String4Property"}}class Wd extends mt{get type(){return"String2sProperty"}}class Ay extends mt{get type(){return"String3sProperty"}}class Ly extends mt{get type(){return"String4sProperty"}}class _e extends mt{get type(){return"Number2Property"}}class Je extends mt{get type(){return"Number3Property"}}class Pn extends mt{get type(){return"Number4Property"}}class Ry extends mt{get type(){return"Number4WithUndefinedProperty"}}class Xd extends mt{get type(){return"Number2sProperty"}}class Gh extends mt{get type(){return"Number3sProperty"}}class Fy extends mt{get type(){return"Number4sProperty"}}class ky extends mt{get type(){return"Boolean2Property"}}class Vy extends mt{get type(){return"Boolean3Property"}}class Uy extends mt{get type(){return"Boolean4Property"}}class zy extends mt{get type(){return"Boolean2sProperty"}}class Gy extends mt{get type(){return"Boolean3sProperty"}}class qy extends mt{get type(){return"Boolean4sProperty"}}class Wy extends mt{get type(){return"StringNumberProperty"}}class Xy extends mt{get type(){return"StringNumbersProperty"}}class _t extends Pn{get type(){return"ColorProperty"}}class By extends Je{get type(){return"ColorRgbProperty"}}class Hy extends T{get type(){return"DashPatternProperty"}}class pt extends mt{constructor(t,e,n,i,s,o,a){super(t,n,i,s,o,a),this._enums=e}get type(){return"EnumProperty"}get enums(){return this._enums}}class Yy extends mt{constructor(t,e,n,i,s,o,a){super(t,n,i,s,o,a),this._enums=e}get type(){return"EnumStringsProperty"}get enums(){return this._enums}}class Qi extends mt{constructor(t,e,n,i,s,o,a){super(t,e,n,s,o,a),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"EvalStringProperty"}}class Bd extends mt{constructor(t,e,n,i,s){super(t,e,i,!1,!1,s),this._paramTypes=n}get type(){return"ParamsProperty"}get paramTypes(){return this._paramTypes}}class it extends ji{constructor(e,n,i,s,o){const a=s??"Unnamed Function";super(a,o??a);d(this,"_paramsProperty");d(this,"_getValueFunc");this._func=n;const u=this.disposeVar(g.reactJson(i));this._paramsProperty=this.disposeVar(new Bd(u,a+"_params",e,i));const[l]=g.getReactFuncs(this._paramsProperty.reactVar);this._getValueFunc=l}get paramsProperty(){return this._paramsProperty}exec(){this._func(...this._getValueFunc())}get type(){return"FunctionProperty"}}class nt extends ji{constructor(t,e,n){const i=e??"分组";super(i,n??i),this._children=t}get type(){return"GroupProperty"}get children(){return this._children}}class Q extends mt{constructor(t,e,n,i,s,o,a){super(t,e,n,s,o,a),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"JsonProperty"}}class qh extends mt{constructor(t,e,n,i,s,o,a){super(t,e,n,s,o,a),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"LongStringProperty"}}class Jy extends _e{get type(){return"MinmaxProperty"}}class jy extends Pn{get type(){return"NearFarScalerProperty"}}class Hd extends zh{constructor(t,e,n,i,s,o,a){const u=n??"非响应式Json";super(u,a??u,s??!1,o??!1,i),this._getJsonStringFunc=t,this._setJsonStringFunc=e}get type(){return"NonreactiveJsonStringProperty"}get getJsonStringFunc(){return this._getJsonStringFunc}get setJsonStringFunc(){return this._setJsonStringFunc}}class Qy extends _e{get type(){return"NumberRangeProperty"}}class Pe extends mt{constructor(t,e,n,i,s,o,a,u){super(t,i,s,o,a,u),this._step=e,this._minMax=n}get type(){return"NumberSliderProperty"}get minMax(){return this._minMax}get step(){return this._step}}function $y(r,t){const[e,n,i]=g.getReactFuncs(r),[s,o,a]=g.getReactFuncs(t),u=g.react((e()??0)/(s()??3e3)),l=()=>{const h=u.value,c=s()??3e3,f=e()??0;if(!Number.isFinite(c)||!Number.isFinite(f)){console.warn(`duration || currentTime error: duration: ${c} currentTime: ${f}`);return}Math.abs(h*c-f)<.001||(c<=0?u.value=0:u.value=f/c)};return u.dispose(i.disposableOn(l)),u.dispose(a.disposableOn(l)),u.dispose(u.changed.disposableOn(()=>{const h=u.value,c=s()??3e3,f=e()??0;if(!Number.isFinite(c)||!Number.isFinite(f)){console.warn(`duration || currentTime error: duration: ${c} currentTime: ${f}`);return}Math.abs(h*c-f)<.001||n(h*c)})),u}class cl extends ji{constructor(e,n,i,s,o,a){super(s??"播放器",a??"播放器");d(this,"_defaults",{playing:!1,ratio:0,loop:!1});this._playingReact=e,this._ratioReact=n,this._loopReact=i,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.ratio=o.ratio??this._defaults.ratio,this._defaults.loop=o.loop??this._defaults.loop)}get type(){return"PlayerProperty"}get playingReact(){return this._playingReact}get ratioReact(){return this._ratioReact}get loopReact(){return this._loopReact}get defaults(){return this._defaults}}d(cl,"createPlayingRatio",$y);class Io extends Je{get type(){return"PositionProperty"}}class Yd extends mt{get type(){return"PositionsProperty"}}class Ky extends mt{get type(){return"PositionsSetPropety"}}class Wh extends Je{get type(){return"RotationProperty"}}class eu extends ot{get type(){return"UriProperty"}}class Jd extends ji{constructor(e,n,i,s,o,a){const u=s??"视角播放器";super(u,a??u);d(this,"_defaults",{playing:!1,loop:!1});this._playingReact=e,this._stopFn=n,this._loopReact=i,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.loop=o.loop??this._defaults.loop)}get type(){return"ViewPlayerProperty"}get playingReact(){return this._playingReact}get loopReact(){return this._loopReact}get stopFn(){return this._stopFn}get defaults(){return this._defaults}}class jd extends mt{get type(){return"DatesProperty"}}class Os extends mt{get type(){return"DateProperty"}}var $=(r=>(r.Place="place",r.Translation="translation",r.Rotation="rotation",r.Scale="scale",r.DoublePointsAppend="doublePointsAppend",r.DoublePointsModify="doublePointsModify",r.CircularAppend="circularAppend",r.CircularInsert="circularInsert",r.LineStringAppend="lineStringAppend",r.LineStringInsert="lineStringInsert",r.ScatterAppend="scatterAppend",r.ScatterModify="scatterModify",r.VisibilityAppend="visibilityAppend",r.VisibilityModify="visibilityModify",r.HeightModify="heightModify",r))($||{}),Qd=(r=>(r.DECIMAL_DEGREE="DECIMAL_DEGREE",r.DEGREES_DECIMAL_MINUTES="DEGREES_DECIMAL_MINUTES",r.SEXAGESIMAL_DEGREE="SEXAGESIMAL_DEGREE",r))(Qd||{});class Zy{constructor(t){this.childPickedInfo=t}}class t0{constructor(t,e,n,i,s,o){this.pickResult=t,this.sceneObject=e,this.tilesetPickInfo=n,this.geojsonPickInfo=i,this.attachedInfo=s,this.screenPosition=o}assign(t){t!=null&&t.pickedResult&&(this.pickResult=t.pickedResult),t!=null&&t.sceneObject&&(this.sceneObject=t.sceneObject),t!=null&&t.tilesetPickInfo&&(this.tilesetPickInfo=t.tilesetPickInfo),t!=null&&t.geojsonPickInfo&&(this.geojsonPickInfo=t.geojsonPickInfo),t!=null&&t.attachedInfo&&(this.attachedInfo=t.attachedInfo),t!=null&&t.screenPosition&&(this.screenPosition=t.screenPosition)}}class e0 extends B{constructor(e){super();d(this,"_sceneObjRefs",new Map);d(this,"_refs",{});d(this,"_refsChanged",this.dv(new V));const n=(i,s,o)=>{if(o){const a=this.getLastSceneObject(o),u=this._sceneObjRefs.get(o);if(!u)console.warn(`this._sceneObjRefs中不存在ref(${o}), 可能系统存在逻辑问题`);else{const h=u.indexOf(i);h===-1?console.warn(`this._sceneObjRefs中不存在当前对象(id: ${i.id} type: ${i.typeName})!可能系统存在逻辑问题`):(u.splice(h,1),u.length===0&&this._sceneObjRefs.delete(o))}const l=this.getLastSceneObject(o);this._refs[o]=l,this._refsChanged.emit(l,a)}if(s){const a=this.getLastSceneObject(s),u=this._sceneObjRefs.get(s);u?(u.push(i),u.length>0&&console.warn(`同时存在多个ref${s}相同的场景对象!
2
22
  ${u.map(h=>`${h.id} ${h.typeName}
3
- `).join(" ")}`)):this._sceneObjRefs.set(s,[i]);const l=this.getLastSceneObject(s);this._refs[s]=l,this._refsChanged.emit(l,a)}};this.d(e.sceneObjCreatedEvent.don(i=>{const s=(o,a)=>n(i,o,a);i.ref&&s(i.ref,void 0),i.refChanged.don(s)})),this.d(e.sceneObjToDestroyEvent.don(i=>{i.ref&&n(i,void 0,i.ref)}))}get sceneObjRefs(){return this._sceneObjRefs}get refs(){return this._refs}get refsChanged(){return this._refsChanged}getLastSceneObject(e){const n=this.getSceneObjects(e);if(n)return n[n.length-1]}getSceneObjects(e){const n=this._sceneObjRefs.get(e);if(!(!n||n.length===0))return n}}function mg(r,t){const[e,n,i]=d.getReactFuncs(r),s=d.react(void 0),o=()=>{const a=e()??t;s.value=a&&ht.context.getStrFromEnv(a)};return o(),i&&s.d(i.don(o)),s.d(ht.context.environmentVariablesChanged.don(o)),s}function yg(r){const t=/\${(.*?)\}/g;if(!t.test(r))return r;const e=r.replace(t,(n,i)=>{const s=ht.context.getEnv(i);return s===void 0?(console.warn(`环境变量(${i})不存在,无法进行转换`),"{env-error}"):s});return yg(e)}class Wm extends d.Destroyable{constructor(){super();g(this,"_esObjConstructors",new Map);g(this,"_sceneObjs",new Map);g(this,"_sceneObjCreatedEvent",new d.Event);g(this,"_sceneObjToDestroyEvent",new d.Event);g(this,"_refsManager",this.dv(new qm(this)));g(this,"_environmentVariables",window.ESSDK_ENV||{});g(this,"_environmentVariablesChanged",this.dv(new d.Event))}get typeNames(){return this._esObjConstructors.keys()}get sceneObjs(){return this._sceneObjs.values()}get sceneObjCreatedEvent(){return this._sceneObjCreatedEvent}get sceneObjToDestroyEvent(){return this._sceneObjToDestroyEvent}get refsManager(){return this._refsManager}get $refs(){return this._refsManager.refs}register(e,n,i){return this._esObjConstructors.has(e)&&console.warn(`register warn: ${e} has registered ! will be override!`),this._esObjConstructors.set(e,n),i&&d.setExtProp(n,"__sceneObjExtraInfo",i),e}_addSceneObject(e){this._sceneObjs.set(e.id,e),this._sceneObjCreatedEvent.emit(e),e.d(()=>this._deleteSceneObject(e))}addSceneObject(e){this._addSceneObject(e)}_deleteSceneObject(e){this._sceneObjToDestroyEvent.emit(e),this._sceneObjs.delete(e.id)}deleteSceneObject(e){this._deleteSceneObject(e)}createSceneObjectFromClass(e,n){if(!n||this._sceneObjs.has(n)){const s=d.createGuid();n&&console.warn(`已存在相同id的对象!id自动变更!${n} -> ${s} 请注意:id变更可能导致引用失效!`),n=s}if(!n)throw new Error("id不能为空!");const i=new e(n);return i.id!==n&&(console.warn(`sceneObj.id(${i.id}) !== id(${n}) sceneObjectType: ${i.typeName}`),console.warn("出现这种问题有可能是自定义的场景对象,没有在构造函数中传递id参数!示例如下:"),console.warn("class XXX extends XXX { constructor(id) { super(id); } }")),this._addSceneObject(i),i}createSceneObject(e,n){if(typeof e=="string"){const i=this._getSceneObjConstructor(e);if(!i){console.warn(`Cannot find SceneObjectType: ${e}`);return}return this.createSceneObjectFromClass(i,n)}else return this.createSceneObjectFromClass(e,n)}createSceneObjectFromJson(e){const n=this.createSceneObject(e.type,e.id);return n&&(n.json=e),n}destroySceneObject(e){return this._deleteSceneObject(e),e.destroy(),e.isDestroyed()}getSceneObjectById(e){return this._sceneObjs.get(e)}getSceneObject(e){if(!e&&e!="")return Array.from(this._sceneObjs.values());if(e.startsWith("ES")){const n=[];for(const i of this._sceneObjs.values())i.typeName===e&&n.push(i);return n}else return this._sceneObjs.get(e)}_getSceneObjConstructor(e){const n=this._esObjConstructors.get(e);if(n)return n}getProps(e){const n=this._getSceneObjConstructor(e);if(!n){console.warn(`cannot get constructor from type: ${e}`);return}return d.getExtProp(n,"__sceneObjExtraInfo")}setProps(e,n){const i=this._getSceneObjConstructor(e);if(!i){console.warn(`cannot get constructor from type: ${e}`);return}let s=d.getExtProp(i,"__sceneObjExtraInfo");s||(s={},d.setExtProp(i,"__sceneObjExtraInfo",s)),Object.assign(s,n)}getProp(e,n){const i=this.getProps(e);return i&&i[n]}setProp(e,n,i){this.setProps(e,{[n]:i})}get environmentVariables(){return this._environmentVariables}set environmentVariables(e){for(let[n,i]of Object.entries(e))this.setEnv(n,i)}get environmentVariablesChanged(){return this._environmentVariablesChanged}setEnv(e,n){if(this._environmentVariables[e]!==n){const i=this._environmentVariables[e];this._environmentVariables[e]=n,this._environmentVariablesChanged.emit(e,n,i)}window.ESSDK_ENV={...this._environmentVariables}}getEnv(e){return this._environmentVariables[e]}getStrFromEnv(e){return yg(e)}createEnvStrReact(e,n){return mg(e,n)}createEvnStrReact(e,n){return mg(e,n)}}const Pt=class Pt extends d.Destroyable{constructor(e){super();g(this,"_components",this.dv(new d.ObservableSet));g(this,"_viewerAttached",this.dv(new d.Event));g(this,"_viewerDetached",this.dv(new d.Event));g(this,"_attachedViewers",(()=>{const e=new Set;return this.d(this._viewerAttached.don(n=>{n.actived&&(this.activeViewer=n),n.ad(n.activedChanged.don(i=>{i&&e.has(n)&&(this.activeViewer=n)})),e.add(n)})),this.d(this._viewerDetached.don(n=>{e.delete(n),this.activeViewer==n&&(this.activeViewer=void 0)})),e})());g(this,"_activeViewer",this.disposeVar(d.react(void 0)));g(this,"_createdEvent",this.dv(new d.Event));g(this,"_flushEvent",this.dv(new d.Event));g(this,"_id");g(this,"_mainClass");g(this,"_updateFuncReact",this.dv(d.react(void 0)));g(this,"_toDestroyFuncReact",this.dv(d.react(void 0)));g(this,"_parentID");e!==void 0&&(typeof e!="string"?console.warn(`对象id必须是字符串类型,当前id的类型是${typeof e},值为${e}`):e.trim()===""?console.warn("场景对象创建时的id不能是空字符串!"):e.trim()!==e&&console.warn(`id前后有空字符串!id: ${e}`)),this._id=e??d.createGuid(),this._initName();{const n=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(i){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${i}`)}};n(),this.d(this.execOnceFuncStrChanged.don(n))}{const n=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(s){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};n(),this.d(this.updateFuncStrChanged.don(n));let i;this.d(()=>i&&i.destroy()),this.d(this.updateFuncChanged.don(()=>{i&&i.cancel(),this.updateFunc&&(i=i||d.createAnimateFrame(),i.restart(void 0,s=>{this.updateFunc&&this.updateFunc(this,s)}))}))}{const n=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(i){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${i}`),this.toDestroyFunc=void 0}};n(),this.d(this.toDestroyFuncStrChanged.don(n)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}}static getParentClass(){return Object.getPrototypeOf(this)}static register(e,n,i){d.extendClassProps(n.prototype,n.createDefaultProps);const s=n.createDefaultProps();for(const o of Object.keys(s))n.defaults[o]=s[o]instanceof d.ReactiveVariable?s[o].value:s[o];return this.innerRegister(e,n,i),e}static get envs(){return Pt.context.environmentVariables}static get $refs(){return Pt.context.refsManager.refs}get components(){return this._components}get viewerAttached(){return this._viewerAttached}get viewerDetached(){return this._viewerDetached}get attachedViewers(){return this._attachedViewers}get activeViewer(){return this._activeViewer.value}set activeViewer(e){this._activeViewer.value=e}get activeViewerChanged(){return this._activeViewer.changed}removefromViewer(e){this.attachedViewers.has(e)&&e.delete(this)}addToViewer(e){this.attachedViewers.has(e)||e.add(this)}registerAttachedObject(e){const n=new Map;this.d(()=>{n.size>0&&console.warn("viewerPropSceneObjects.size > 0")}),this.d(this._viewerAttached.don(i=>{const s=e(i);s&&n.set(i,s)})),this.d(this._viewerDetached.don(i=>{if(!n.has(i))return;const s=n.get(i);s&&(s.destroy(),n.delete(i))}))}createAttachedObject(e){const n=new Map,i=()=>{for(let[u,l]of n.entries())l.destroy();n.clear()},s=u=>{const l=e(u);l&&n.set(u,l)};for(let u of this.attachedViewers)s(u);const o=this._viewerAttached.don(s),a=this._viewerDetached.don(u=>{if(!n.has(u))return;const l=n.get(u);l&&(l.destroy(),n.delete(u))});return()=>{a(),o(),i()}}registerAttachedObjectForContainer(e){this.registerAttachedObject(n=>new Xm(n,e))}get createdEvent(){return this._createdEvent}get flushEvent(){return this._flushEvent}flush(){this.flushEvent.emit()}get id(){return this._id}get typeName(){return this.constructor.type}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return this.constructor.createDefaultProps()}get mainClass(){return this._mainClass??this}set mainClass(e){this._mainClass=e}_innerGetJson(e=!0){const n={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(e){let s,o=this.defaultProps[i];o instanceof d.ReactiveVariable?s=o.equals(this[i]):s=o===this[i],s||(n[i]=this[i])}else n[i]=this[i];return n}_innerSetJson(e,n,i){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in e)this[a]=e[a]===null?void 0:e[a];else if(!(i??!1)){let u=this.defaultProps[a];u instanceof d.ReactiveVariable&&(u=u.value),this[a]=u}}get json(){return this._innerGetJson()}set json(e){this._innerSetJson(e)}get _jsonStr(){return JSON.stringify(this.json,null,4)}set _jsonStr(e){this._innerSetJson(JSON.parse(e))}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get parentID(){return this._parentID??this.id}set parentID(e){this._parentID=e}getProperties(e){const n={...this.getESProperties()},i=[];return n.general.length>0&&i.push(new gt(n.general,"general")),Object.keys(n).forEach(s=>{s!=="defaultMenu"&&s!=="general"&&n[s].length>0&&i.push(new gt(n[s],s))}),i}getESProperties(){return{defaultMenu:"general",basic:[],general:[new _t([this,"typeName"],"类型",void 0,!1,!0),new _t([this,"id"],"唯一标识",void 0,!1,!0),new _t([this,"name"],"名称")],dataSource:[],location:[],coordinate:[],style:[],more:[new _t([this,"ref"],"ref",void 0,!0),new ut([this,"extras"],"extras",void 0,void 0,!0),new fg(()=>this._jsonStr,e=>e&&(this._jsonStr=e),"JSON")]}}};g(Pt,"context",new Wm),g(Pt,"innerRegister",Pt.context.register.bind(Pt.context)),g(Pt,"defaults",{}),g(Pt,"createDefaultProps",()=>({name:"未命名场景对象",ref:void 0,extras:d.reactJson(void 0),devTags:d.reactArrayWithUndefined(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})),g(Pt,"type",Pt.register("ESSceneObject",Pt,{chsName:"场景类",tags:["ESObjects"],description:""})),g(Pt,"create",Pt.context.createSceneObject.bind(Pt.context)),g(Pt,"createFromClass",Pt.context.createSceneObjectFromClass.bind(Pt.context)),g(Pt,"createFromJson",Pt.context.createSceneObjectFromJson.bind(Pt.context)),g(Pt,"destroySceneObject",Pt.context.destroySceneObject.bind(Pt.context)),g(Pt,"getSceneObjById",Pt.context.getSceneObjectById.bind(Pt.context)),g(Pt,"getSceneObj",Pt.context.getSceneObject.bind(Pt.context)),g(Pt,"getEnv",Pt.context.getEnv.bind(Pt.context)),g(Pt,"setEnv",Pt.context.setEnv.bind(Pt.context)),g(Pt,"getStrFromEnv",Pt.context.getStrFromEnv.bind(Pt.context)),g(Pt,"getSceneObjectById",Pt.context.getSceneObjectById.bind(Pt.context)),g(Pt,"getSceneObject",Pt.context.getSceneObject.bind(Pt.context));let ht=Pt;class Xm extends d.Destroyable{constructor(t,e){super(),this.dv(new d.ObjResettingWithEvent(t.subContainerChanged,()=>{if(t.subContainer)return e(t,t.subContainer)}))}}const no={distance:100,heading:0,pitch:0,flyDuration:1,hDelta:0,pDelta:0},Hm={position:[0,0,0],rotation:[0,0,0],flyDuration:1},Qr=class Qr extends ht{constructor(e){super(e);g(this,"_editing",this.dv(d.react(!1)));g(this,"editingID");g(this,"editingBindMode","singlePoint");g(this,"_deprecated",[]);g(this,"_flyInEvent",this.dv(new d.Event));g(this,"_flyToEvent",this.dv(new d.Event));g(this,"_flyOverEvent",this.disposeVar(new d.Event));g(this,"_pickedEvent",this.dv(new d.Event));g(this,"_calcFlyToParamEvent",this.dv(new d.Event));g(this,"_calcFlyInParamEvent",this.dv(new d.Event));g(this,"useCalcFlyToParamInESObjectWithLocation",!1);Nv(this,this.updateEditing)}supportEditingModes(){return this.constructor.supportEditingModes}get editing(){return this._editing.value}set editing(e){this._editing.value=e}get editingChanged(){return this._editing.changed}updateEditing(){}_deprecatedWarning(){const e=this._deprecated;for(let n=0;n<e.length;n++){const i=e[n];typeof i=="string"?Reflect.has(this,i+"Changed")&&this.d(this[i+"Changed"].don(()=>{console.warn(`注意:${this.typeName} 的 ${i} 属性下版本将会被移除!`)})):Object.keys(i).forEach(s=>{Reflect.has(this,s+"Changed")&&this.d(this[s+"Changed"].don(a=>{const u=i[s];typeof u=="string"?console.warn(`注意:${this.typeName} 的 ${s} 属性下版本将会被移除!`):Object.keys(u).forEach(l=>{a===l&&console.warn(`注意:${this.typeName} 的 ${s} 属性值 ${l} 下版本将会被移除,推荐使用属性值 ${u[l]}`)})}))})}}get flyInEvent(){return this._flyInEvent}flyIn(e=1){this._flyInEvent.emit(e,Qr._lastFlyInId)}get flyToEvent(){return this._flyToEvent}flyTo(e=1){this._flyToEvent.emit(e,Qr._lastFlyToId)}get flyOverEvent(){return this._flyOverEvent}get pickedEvent(){return this._pickedEvent}get calcFlyToParamEvent(){return this._calcFlyToParamEvent}calcFlyToParam(){this._calcFlyToParamEvent.emit()}get calcFlyInParamEvent(){return this._calcFlyInParamEvent}calcFlyInParam(){this._calcFlyInParamEvent.emit()}emptyFlyToParam(){this.flyToParam=void 0}emptyFlyInParam(){this.flyInParam=void 0}async getBoundSphere(e){return await e.getBoundSphere(this.id)}getESProperties(){const e={...super.getESProperties()};return{...e,general:[...e.general,new $([this,"show"],"是否显示",Qr.defaults.show),new $([this,"collision"],"开启碰撞",Qr.defaults.collision),new $([this,"allowPicking"],"允许拾取",Qr.defaults.allowPicking),new pt([],()=>this.calcFlyToParam(),[],"保存观察视角","保存当前flyToParam"),new pt([],()=>this.emptyFlyToParam(),[],"清空飞向参数","清空飞向参数"),new pt([],()=>this.emptyFlyInParam(),[],"清空飞入参数","清空飞入参数"),new pt([],()=>this.calcFlyInParam(),[],"保存飞入参数","保存飞入参数flyInParam")],more:[...e.more,new gt([],"飞行定位","飞向参数"),new pt(["number"],n=>this.flyTo(n),[1],"飞向"),new ut([this,"flyToParam"],"flyToParam",void 0,void 0,!0),new L([this,"flyToDistance"],"flyToDistance",void 0,!0),new L([this,"flyToHeading"],"flyToHeading",void 0,!0),new L([this,"flyToPitch"],"flyToPitch",void 0,!0),new L([this,"flyToFlyDuration"],"flyToFlyDuration",void 0,!0),new L([this,"flyToHDelta"],"flyToHDelta",void 0,!0),new L([this,"flyToPDelta"],"flyToPDelta",void 0,!0),new gt([],"飞入参数"),new pt(["number"],n=>this.flyIn(n),[1],"飞入"),new ut([this,"flyInParam"],"flyInParam",void 0,void 0,!0)]}}get flyToDistance(){return this.flyToParam&&this.flyToParam.distance}get flyToHeading(){return this.flyToParam&&this.flyToParam.heading}get flyToPitch(){return this.flyToParam&&this.flyToParam.pitch}get flyToFlyDuration(){return this.flyToParam&&this.flyToParam.flyDuration}get flyToHDelta(){return this.flyToParam&&this.flyToParam.hDelta}get flyToPDelta(){return this.flyToParam&&this.flyToParam.pDelta}get flyToDistanceChanged(){return this.flyToParamChanged}get flyToHeadingChanged(){return this.flyToParamChanged}get flyToPitchChanged(){return this.flyToParamChanged}get flyToFlyDurationChanged(){return this.flyToParamChanged}get flyToHDeltaChanged(){return this.flyToParamChanged}get flyToPDeltaChanged(){return this.flyToParamChanged}set flyToDistance(e){this.flyToParam=e!==void 0?{...this.flyToParam??no,distance:e}:void 0}set flyToHeading(e){this.flyToParam=e!==void 0?{...this.flyToParam??no,heading:e}:void 0}set flyToPitch(e){this.flyToParam=e!==void 0?{...this.flyToParam??no,pitch:e}:void 0}set flyToFlyDuration(e){this.flyToParam=e!==void 0?{...this.flyToParam??no,flyDuration:e}:void 0}set flyToHDelta(e){this.flyToParam=e!==void 0?{...this.flyToParam??no,hDelta:e}:void 0}set flyToPDelta(e){this.flyToParam=e!==void 0?{...this.flyToParam??no,pDelta:e}:void 0}};g(Qr,"createDefaultProps",()=>({...ht.createDefaultProps(),show:!0,collision:!0,allowPicking:!1,flyToParam:d.reactJsonWithUndefined(void 0),flyInParam:d.reactJsonWithUndefined(void 0)})),g(Qr,"type",Qr.register("ESVisualObject",Qr,{chsName:"可视化对象",tags:["ESObjects"],description:"可视化对象"})),g(Qr,"supportEditingModes",[]),g(Qr,"_lastFlyInId",0),g(Qr,"_lastFlyToId",0);let ee=Qr;function sc(r){return d.reactDeepArrayWithUndefined(r,(t,e)=>t[0]===e[0]&&t[1]===e[1],t=>[...t])}function _g(r,t){const e=new Array;for(let n of r)e.push(t(n));return e}function oc(r,t){return r===void 0&&t===void 0?!0:!r||!t?!1:r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]}var tr=63710088e-1,Eg={centimeters:tr*100,centimetres:tr*100,degrees:tr/111325,feet:tr*3.28084,inches:tr*39.37,kilometers:tr/1e3,kilometres:tr/1e3,meters:tr,metres:tr,miles:tr/1609.344,millimeters:tr*1e3,millimetres:tr*1e3,nauticalmiles:tr/1852,radians:1,yards:tr*1.0936};function Yn(r,t,e){e===void 0&&(e={});var n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=t||{},n.geometry=r,n}function re(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!wg(r[0])||!wg(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return Yn(n,t,e)}function hr(r,t,e){e===void 0&&(e={});for(var n=0,i=r;n<i.length;n++){var s=i[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<s[s.length-1].length;o++)if(s[s.length-1][o]!==s[0][o])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:r};return Yn(a,t,e)}function Jn(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return Yn(n,t,e)}function Bo(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}function ac(r,t,e){e===void 0&&(e={});var n={type:"MultiPolygon",coordinates:r};return Yn(n,t,e)}function uc(r,t){t===void 0&&(t="kilometers");var e=Eg[t];if(!e)throw new Error(t+" units is invalid");return r*e}function lc(r,t){t===void 0&&(t="kilometers");var e=Eg[t];if(!e)throw new Error(t+" units is invalid");return r/e}function Ll(r){var t=r%(2*Math.PI);return t*180/Math.PI}function cr(r){var t=r%360;return t*Math.PI/180}function hc(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return uc(lc(r,t),e)}function wg(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Qo(r,t,e){if(r!==null)for(var n,i,s,o,a,u,l,h=0,c=0,f,p=r.type,v=p==="FeatureCollection",_=p==="Feature",w=v?r.features.length:1,I=0;I<w;I++){l=v?r.features[I].geometry:_?r.geometry:r,f=l?l.type==="GeometryCollection":!1,a=f?l.geometries.length:1;for(var y=0;y<a;y++){var E=0,m=0;if(o=f?l.geometries[y]:l,o!==null){u=o.coordinates;var S=o.type;switch(h=e&&(S==="Polygon"||S==="MultiPolygon")?1:0,S){case null:break;case"Point":if(t(u,c,I,E,m)===!1)return!1;c++,E++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(t(u[n],c,I,E,m)===!1)return!1;c++,S==="MultiPoint"&&E++}S==="LineString"&&E++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-h;i++){if(t(u[n][i],c,I,E,m)===!1)return!1;c++}S==="MultiLineString"&&E++,S==="Polygon"&&m++}S==="Polygon"&&E++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(m=0,i=0;i<u[n].length;i++){for(s=0;s<u[n][i].length-h;s++){if(t(u[n][i][s],c,I,E,m)===!1)return!1;c++}m++}E++}break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(Qo(o.geometries[n],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Rl(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function Fl(r,t){var e,n,i,s,o,a,u,l,h,c,f=0,p=r.type==="FeatureCollection",v=r.type==="Feature",_=p?r.features.length:1;for(e=0;e<_;e++){for(a=p?r.features[e].geometry:v?r.geometry:r,l=p?r.features[e].properties:v?r.properties:{},h=p?r.features[e].bbox:v?r.bbox:void 0,c=p?r.features[e].id:v?r.id:void 0,u=a?a.type==="GeometryCollection":!1,o=u?a.geometries.length:1,i=0;i<o;i++){if(s=u?a.geometries[i]:a,s===null){if(t(null,f,l,h,c)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(s,f,l,h,c)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(t(s.geometries[n],f,l,h,c)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function Ym(r,t,e){var n=e;return Fl(r,function(i,s,o,a,u){n=t(n,i,s,o,a,u)}),n}function cc(r,t){Fl(r,function(e,n,i,s,o){var a=e===null?null:e.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return t(Yn(e,i,{bbox:s,id:o}),n,0)===!1?!1:void 0}var u;switch(a){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var l=0;l<e.coordinates.length;l++){var h=e.coordinates[l],c={type:u,coordinates:h};if(t(Yn(c,i),n,l)===!1)return!1}})}function Jm(r,t){cc(r,function(e,n,i){var s=0;if(e.geometry){var o=e.geometry.type;if(!(o==="Point"||o==="MultiPoint")){var a,u=0,l=0,h=0;if(Qo(e,function(c,f,p,v,_){if(a===void 0||n>u||v>l||_>h){a=c,u=n,l=v,h=_,s=0;return}var w=Jn([a,c],e.properties);if(t(w,n,i,_,s)===!1)return!1;s++,a=c})===!1)return!1}}})}function Bn(r){var t=[1/0,1/0,-1/0,-1/0];return Qo(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Bn.default=Bn;function Ir(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function io(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Sg(r,t,e){if(!r)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!r.geometry||r.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+r.geometry.type)}function jr(r){return r.type==="Feature"?r.geometry:r}function Bm(r,t){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}function Cg(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Qm(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var t=r.default;if(typeof t=="function"){var e=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),e}var Gl={exports:{}},kl={exports:{}},Km=kl.exports,Pg;function Ig(){return Pg||(Pg=1,function(r,t){(function(e,n){r.exports=n()})(Km,function(){function e(y,E,m,S,C){(function P(N,T,O,b,x){for(;b>O;){if(b-O>600){var R=b-O+1,V=T-O+1,Z=Math.log(R),J=.5*Math.exp(2*Z/3),it=.5*Math.sqrt(Z*J*(R-J)/R)*(V-R/2<0?-1:1),G=Math.max(O,Math.floor(T-V*J/R+it)),W=Math.min(b,Math.floor(T+(R-V)*J/R+it));P(N,T,G,W,x)}var k=N[T],U=O,A=b;for(n(N,O,T),x(N[b],k)>0&&n(N,O,b);U<A;){for(n(N,U,A),U++,A--;x(N[U],k)<0;)U++;for(;x(N[A],k)>0;)A--}x(N[O],k)===0?n(N,O,A):n(N,++A,b),A<=T&&(O=A+1),T<=A&&(b=A-1)}})(y,E,m||0,S||y.length-1,C||i)}function n(y,E,m){var S=y[E];y[E]=y[m],y[m]=S}function i(y,E){return y<E?-1:y>E?1:0}var s=function(y){y===void 0&&(y=9),this._maxEntries=Math.max(4,y),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(y,E,m){if(!m)return E.indexOf(y);for(var S=0;S<E.length;S++)if(m(y,E[S]))return S;return-1}function a(y,E){u(y,0,y.children.length,E,y)}function u(y,E,m,S,C){C||(C=w(null)),C.minX=1/0,C.minY=1/0,C.maxX=-1/0,C.maxY=-1/0;for(var P=E;P<m;P++){var N=y.children[P];l(C,y.leaf?S(N):N)}return C}function l(y,E){return y.minX=Math.min(y.minX,E.minX),y.minY=Math.min(y.minY,E.minY),y.maxX=Math.max(y.maxX,E.maxX),y.maxY=Math.max(y.maxY,E.maxY),y}function h(y,E){return y.minX-E.minX}function c(y,E){return y.minY-E.minY}function f(y){return(y.maxX-y.minX)*(y.maxY-y.minY)}function p(y){return y.maxX-y.minX+(y.maxY-y.minY)}function v(y,E){return y.minX<=E.minX&&y.minY<=E.minY&&E.maxX<=y.maxX&&E.maxY<=y.maxY}function _(y,E){return E.minX<=y.maxX&&E.minY<=y.maxY&&E.maxX>=y.minX&&E.maxY>=y.minY}function w(y){return{children:y,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(y,E,m,S,C){for(var P=[E,m];P.length;)if(!((m=P.pop())-(E=P.pop())<=S)){var N=E+Math.ceil((m-E)/S/2)*S;e(y,N,E,m,C),P.push(E,N,N,m)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(y){var E=this.data,m=[];if(!_(y,E))return m;for(var S=this.toBBox,C=[];E;){for(var P=0;P<E.children.length;P++){var N=E.children[P],T=E.leaf?S(N):N;_(y,T)&&(E.leaf?m.push(N):v(y,T)?this._all(N,m):C.push(N))}E=C.pop()}return m},s.prototype.collides=function(y){var E=this.data;if(!_(y,E))return!1;for(var m=[];E;){for(var S=0;S<E.children.length;S++){var C=E.children[S],P=E.leaf?this.toBBox(C):C;if(_(y,P)){if(E.leaf||v(y,P))return!0;m.push(C)}}E=m.pop()}return!1},s.prototype.load=function(y){if(!y||!y.length)return this;if(y.length<this._minEntries){for(var E=0;E<y.length;E++)this.insert(y[E]);return this}var m=this._build(y.slice(),0,y.length-1,0);if(this.data.children.length)if(this.data.height===m.height)this._splitRoot(this.data,m);else{if(this.data.height<m.height){var S=this.data;this.data=m,m=S}this._insert(m,this.data.height-m.height-1,!0)}else this.data=m;return this},s.prototype.insert=function(y){return y&&this._insert(y,this.data.height-1),this},s.prototype.clear=function(){return this.data=w([]),this},s.prototype.remove=function(y,E){if(!y)return this;for(var m,S,C,P=this.data,N=this.toBBox(y),T=[],O=[];P||T.length;){if(P||(P=T.pop(),S=T[T.length-1],m=O.pop(),C=!0),P.leaf){var b=o(y,P.children,E);if(b!==-1)return P.children.splice(b,1),T.push(P),this._condense(T),this}C||P.leaf||!v(P,N)?S?(m++,P=S.children[m],C=!1):P=null:(T.push(P),O.push(m),m=0,S=P,P=P.children[0])}return this},s.prototype.toBBox=function(y){return y},s.prototype.compareMinX=function(y,E){return y.minX-E.minX},s.prototype.compareMinY=function(y,E){return y.minY-E.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(y){return this.data=y,this},s.prototype._all=function(y,E){for(var m=[];y;)y.leaf?E.push.apply(E,y.children):m.push.apply(m,y.children),y=m.pop();return E},s.prototype._build=function(y,E,m,S){var C,P=m-E+1,N=this._maxEntries;if(P<=N)return a(C=w(y.slice(E,m+1)),this.toBBox),C;S||(S=Math.ceil(Math.log(P)/Math.log(N)),N=Math.ceil(P/Math.pow(N,S-1))),(C=w([])).leaf=!1,C.height=S;var T=Math.ceil(P/N),O=T*Math.ceil(Math.sqrt(N));I(y,E,m,O,this.compareMinX);for(var b=E;b<=m;b+=O){var x=Math.min(b+O-1,m);I(y,b,x,T,this.compareMinY);for(var R=b;R<=x;R+=T){var V=Math.min(R+T-1,x);C.children.push(this._build(y,R,V,S-1))}}return a(C,this.toBBox),C},s.prototype._chooseSubtree=function(y,E,m,S){for(;S.push(E),!E.leaf&&S.length-1!==m;){for(var C=1/0,P=1/0,N=void 0,T=0;T<E.children.length;T++){var O=E.children[T],b=f(O),x=(R=y,V=O,(Math.max(V.maxX,R.maxX)-Math.min(V.minX,R.minX))*(Math.max(V.maxY,R.maxY)-Math.min(V.minY,R.minY))-b);x<P?(P=x,C=b<C?b:C,N=O):x===P&&b<C&&(C=b,N=O)}E=N||E.children[0]}var R,V;return E},s.prototype._insert=function(y,E,m){var S=m?y:this.toBBox(y),C=[],P=this._chooseSubtree(S,this.data,E,C);for(P.children.push(y),l(P,S);E>=0&&C[E].children.length>this._maxEntries;)this._split(C,E),E--;this._adjustParentBBoxes(S,C,E)},s.prototype._split=function(y,E){var m=y[E],S=m.children.length,C=this._minEntries;this._chooseSplitAxis(m,C,S);var P=this._chooseSplitIndex(m,C,S),N=w(m.children.splice(P,m.children.length-P));N.height=m.height,N.leaf=m.leaf,a(m,this.toBBox),a(N,this.toBBox),E?y[E-1].children.push(N):this._splitRoot(m,N)},s.prototype._splitRoot=function(y,E){this.data=w([y,E]),this.data.height=y.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(y,E,m){for(var S,C,P,N,T,O,b,x=1/0,R=1/0,V=E;V<=m-E;V++){var Z=u(y,0,V,this.toBBox),J=u(y,V,m,this.toBBox),it=(C=Z,P=J,N=void 0,T=void 0,O=void 0,b=void 0,N=Math.max(C.minX,P.minX),T=Math.max(C.minY,P.minY),O=Math.min(C.maxX,P.maxX),b=Math.min(C.maxY,P.maxY),Math.max(0,O-N)*Math.max(0,b-T)),G=f(Z)+f(J);it<x?(x=it,S=V,R=G<R?G:R):it===x&&G<R&&(R=G,S=V)}return S||m-E},s.prototype._chooseSplitAxis=function(y,E,m){var S=y.leaf?this.compareMinX:h,C=y.leaf?this.compareMinY:c;this._allDistMargin(y,E,m,S)<this._allDistMargin(y,E,m,C)&&y.children.sort(S)},s.prototype._allDistMargin=function(y,E,m,S){y.children.sort(S);for(var C=this.toBBox,P=u(y,0,E,C),N=u(y,m-E,m,C),T=p(P)+p(N),O=E;O<m-E;O++){var b=y.children[O];l(P,y.leaf?C(b):b),T+=p(P)}for(var x=m-E-1;x>=E;x--){var R=y.children[x];l(N,y.leaf?C(R):R),T+=p(N)}return T},s.prototype._adjustParentBBoxes=function(y,E,m){for(var S=m;S>=0;S--)l(E[S],y)},s.prototype._condense=function(y){for(var E=y.length-1,m=void 0;E>=0;E--)y[E].children.length===0?E>0?(m=y[E-1].children).splice(m.indexOf(y[E]),1):this.clear():a(y[E],this.toBBox)},s})}(kl)),kl.exports}class Zm{constructor(t=[],e=$m){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:n}=this,i=e[t];for(;t>0;){const s=t-1>>1,o=e[s];if(n(i,o)>=0)break;e[t]=o,t=s}e[t]=i}_down(t){const{data:e,compare:n}=this,i=this.length>>1,s=e[t];for(;t<i;){let o=(t<<1)+1,a=e[o];const u=o+1;if(u<this.length&&n(e[u],a)<0&&(o=u,a=e[u]),n(a,s)>=0)break;e[t]=a,t=o}e[t]=s}}function $m(r,t){return r<t?-1:r>t?1:0}const jm=Qm(Object.freeze(Object.defineProperty({__proto__:null,default:Zm},Symbol.toStringTag,{value:"Module"})));var yu={exports:{}},fc,Mg;function ty(){return Mg||(Mg=1,fc=function(t,e,n,i){var s=t[0],o=t[1],a=!1;n===void 0&&(n=0),i===void 0&&(i=e.length);for(var u=(i-n)/2,l=0,h=u-1;l<u;h=l++){var c=e[n+l*2+0],f=e[n+l*2+1],p=e[n+h*2+0],v=e[n+h*2+1],_=f>o!=v>o&&s<(p-c)*(o-f)/(v-f)+c;_&&(a=!a)}return a}),fc}var dc,Ng;function ey(){return Ng||(Ng=1,dc=function(t,e,n,i){var s=t[0],o=t[1],a=!1;n===void 0&&(n=0),i===void 0&&(i=e.length);for(var u=i-n,l=0,h=u-1;l<u;h=l++){var c=e[l+n][0],f=e[l+n][1],p=e[h+n][0],v=e[h+n][1],_=f>o!=v>o&&s<(p-c)*(o-f)/(v-f)+c;_&&(a=!a)}return a}),dc}var bg;function ry(){if(bg)return yu.exports;bg=1;var r=ty(),t=ey();return yu.exports=function(n,i,s,o){return i.length>0&&Array.isArray(i[0])?t(n,i,s,o):r(n,i,s,o)},yu.exports.nested=t,yu.exports.flat=r,yu.exports}var _u={exports:{}},ny=_u.exports,Tg;function iy(){return Tg||(Tg=1,function(r,t){(function(e,n){n(t)})(ny,function(e){const i=33306690738754706e-32;function s(_,w,I,y,E){let m,S,C,P,N=w[0],T=y[0],O=0,b=0;T>N==T>-N?(m=N,N=w[++O]):(m=T,T=y[++b]);let x=0;if(O<_&&b<I)for(T>N==T>-N?(C=m-((S=N+m)-N),N=w[++O]):(C=m-((S=T+m)-T),T=y[++b]),m=S,C!==0&&(E[x++]=C);O<_&&b<I;)T>N==T>-N?(C=m-((S=m+N)-(P=S-m))+(N-P),N=w[++O]):(C=m-((S=m+T)-(P=S-m))+(T-P),T=y[++b]),m=S,C!==0&&(E[x++]=C);for(;O<_;)C=m-((S=m+N)-(P=S-m))+(N-P),N=w[++O],m=S,C!==0&&(E[x++]=C);for(;b<I;)C=m-((S=m+T)-(P=S-m))+(T-P),T=y[++b],m=S,C!==0&&(E[x++]=C);return m===0&&x!==0||(E[x++]=m),x}function o(_){return new Float64Array(_)}const a=33306690738754716e-32,u=22204460492503146e-32,l=11093356479670487e-47,h=o(4),c=o(8),f=o(12),p=o(16),v=o(4);e.orient2d=function(_,w,I,y,E,m){const S=(w-m)*(I-E),C=(_-E)*(y-m),P=S-C;if(S===0||C===0||S>0!=C>0)return P;const N=Math.abs(S+C);return Math.abs(P)>=a*N?P:-function(T,O,b,x,R,V,Z){let J,it,G,W,k,U,A,q,X,tt,at,et,mt,rt,wt,Ct,Q,yt;const It=T-R,At=b-R,qt=O-V,Wt=x-V;k=(wt=(q=It-(A=(U=134217729*It)-(U-It)))*(tt=Wt-(X=(U=134217729*Wt)-(U-Wt)))-((rt=It*Wt)-A*X-q*X-A*tt))-(at=wt-(Q=(q=qt-(A=(U=134217729*qt)-(U-qt)))*(tt=At-(X=(U=134217729*At)-(U-At)))-((Ct=qt*At)-A*X-q*X-A*tt))),h[0]=wt-(at+k)+(k-Q),k=(mt=rt-((et=rt+at)-(k=et-rt))+(at-k))-(at=mt-Ct),h[1]=mt-(at+k)+(k-Ct),k=(yt=et+at)-et,h[2]=et-(yt-k)+(at-k),h[3]=yt;let Bt=function(Ft,pe){let Te=pe[0];for(let Xn=1;Xn<Ft;Xn++)Te+=pe[Xn];return Te}(4,h),he=u*Z;if(Bt>=he||-Bt>=he||(J=T-(It+(k=T-It))+(k-R),G=b-(At+(k=b-At))+(k-R),it=O-(qt+(k=O-qt))+(k-V),W=x-(Wt+(k=x-Wt))+(k-V),J===0&&it===0&&G===0&&W===0)||(he=l*Z+i*Math.abs(Bt),(Bt+=It*W+Wt*J-(qt*G+At*it))>=he||-Bt>=he))return Bt;k=(wt=(q=J-(A=(U=134217729*J)-(U-J)))*(tt=Wt-(X=(U=134217729*Wt)-(U-Wt)))-((rt=J*Wt)-A*X-q*X-A*tt))-(at=wt-(Q=(q=it-(A=(U=134217729*it)-(U-it)))*(tt=At-(X=(U=134217729*At)-(U-At)))-((Ct=it*At)-A*X-q*X-A*tt))),v[0]=wt-(at+k)+(k-Q),k=(mt=rt-((et=rt+at)-(k=et-rt))+(at-k))-(at=mt-Ct),v[1]=mt-(at+k)+(k-Ct),k=(yt=et+at)-et,v[2]=et-(yt-k)+(at-k),v[3]=yt;const ke=s(4,h,4,v,c);k=(wt=(q=It-(A=(U=134217729*It)-(U-It)))*(tt=W-(X=(U=134217729*W)-(U-W)))-((rt=It*W)-A*X-q*X-A*tt))-(at=wt-(Q=(q=qt-(A=(U=134217729*qt)-(U-qt)))*(tt=G-(X=(U=134217729*G)-(U-G)))-((Ct=qt*G)-A*X-q*X-A*tt))),v[0]=wt-(at+k)+(k-Q),k=(mt=rt-((et=rt+at)-(k=et-rt))+(at-k))-(at=mt-Ct),v[1]=mt-(at+k)+(k-Ct),k=(yt=et+at)-et,v[2]=et-(yt-k)+(at-k),v[3]=yt;const Xt=s(ke,c,4,v,f);k=(wt=(q=J-(A=(U=134217729*J)-(U-J)))*(tt=W-(X=(U=134217729*W)-(U-W)))-((rt=J*W)-A*X-q*X-A*tt))-(at=wt-(Q=(q=it-(A=(U=134217729*it)-(U-it)))*(tt=G-(X=(U=134217729*G)-(U-G)))-((Ct=it*G)-A*X-q*X-A*tt))),v[0]=wt-(at+k)+(k-Q),k=(mt=rt-((et=rt+at)-(k=et-rt))+(at-k))-(at=mt-Ct),v[1]=mt-(at+k)+(k-Ct),k=(yt=et+at)-et,v[2]=et-(yt-k)+(at-k),v[3]=yt;const Lt=s(Xt,f,4,v,p);return p[Lt-1]}(_,w,I,y,E,m,N)},e.orient2dfast=function(_,w,I,y,E,m){return(w-m)*(I-E)-(_-E)*(y-m)},Object.defineProperty(e,"__esModule",{value:!0})})}(_u,_u.exports)),_u.exports}var xg;function sy(){if(xg)return Gl.exports;xg=1;var r=Ig(),t=jm,e=ry(),n=iy().orient2d;t.default&&(t=t.default),Gl.exports=i,Gl.exports.default=i;function i(m,S,C){S=Math.max(0,S===void 0?2:S),C=C||0;var P=p(m),N=new r(16);N.toBBox=function(A){return{minX:A[0],minY:A[1],maxX:A[0],maxY:A[1]}},N.compareMinX=function(A,q){return A[0]-q[0]},N.compareMinY=function(A,q){return A[1]-q[1]},N.load(m);for(var T=[],O=0,b;O<P.length;O++){var x=P[O];N.remove(x),b=v(x,b),T.push(b)}var R=new r(16);for(O=0;O<T.length;O++)R.insert(f(T[O]));for(var V=S*S,Z=C*C;T.length;){var J=T.shift(),it=J.p,G=J.next.p,W=_(it,G);if(!(W<Z)){var k=W/V;x=s(N,J.prev.p,it,G,J.next.next.p,k,R),x&&Math.min(_(x,it),_(x,G))<=k&&(T.push(J),T.push(v(x,J)),N.remove(x),R.remove(J),R.insert(f(J)),R.insert(f(J.next)))}}J=b;var U=[];do U.push(J.p),J=J.next;while(J!==b);return U.push(J.p),U}function s(m,S,C,P,N,T,O){for(var b=new t([],o),x=m.data;x;){for(var R=0;R<x.children.length;R++){var V=x.children[R],Z=x.leaf?w(V,C,P):a(C,P,V);Z>T||b.push({node:V,dist:Z})}for(;b.length&&!b.peek().node.children;){var J=b.pop(),it=J.node,G=w(it,S,C),W=w(it,P,N);if(J.dist<G&&J.dist<W&&l(C,it,O)&&l(P,it,O))return it}x=b.pop(),x&&(x=x.node)}return null}function o(m,S){return m.dist-S.dist}function a(m,S,C){if(u(m,C)||u(S,C))return 0;var P=I(m[0],m[1],S[0],S[1],C.minX,C.minY,C.maxX,C.minY);if(P===0)return 0;var N=I(m[0],m[1],S[0],S[1],C.minX,C.minY,C.minX,C.maxY);if(N===0)return 0;var T=I(m[0],m[1],S[0],S[1],C.maxX,C.minY,C.maxX,C.maxY);if(T===0)return 0;var O=I(m[0],m[1],S[0],S[1],C.minX,C.maxY,C.maxX,C.maxY);return O===0?0:Math.min(P,N,T,O)}function u(m,S){return m[0]>=S.minX&&m[0]<=S.maxX&&m[1]>=S.minY&&m[1]<=S.maxY}function l(m,S,C){for(var P=Math.min(m[0],S[0]),N=Math.min(m[1],S[1]),T=Math.max(m[0],S[0]),O=Math.max(m[1],S[1]),b=C.search({minX:P,minY:N,maxX:T,maxY:O}),x=0;x<b.length;x++)if(c(b[x].p,b[x].next.p,m,S))return!1;return!0}function h(m,S,C){return n(m[0],m[1],S[0],S[1],C[0],C[1])}function c(m,S,C,P){return m!==P&&S!==C&&h(m,S,C)>0!=h(m,S,P)>0&&h(C,P,m)>0!=h(C,P,S)>0}function f(m){var S=m.p,C=m.next.p;return m.minX=Math.min(S[0],C[0]),m.minY=Math.min(S[1],C[1]),m.maxX=Math.max(S[0],C[0]),m.maxY=Math.max(S[1],C[1]),m}function p(m){for(var S=m[0],C=m[0],P=m[0],N=m[0],T=0;T<m.length;T++){var O=m[T];O[0]<S[0]&&(S=O),O[0]>P[0]&&(P=O),O[1]<C[1]&&(C=O),O[1]>N[1]&&(N=O)}var b=[S,C,P,N],x=b.slice();for(T=0;T<m.length;T++)e(m[T],b)||x.push(m[T]);return E(x)}function v(m,S){var C={p:m,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return S?(C.next=S.next,C.prev=S,S.next.prev=C,S.next=C):(C.prev=C,C.next=C),C}function _(m,S){var C=m[0]-S[0],P=m[1]-S[1];return C*C+P*P}function w(m,S,C){var P=S[0],N=S[1],T=C[0]-P,O=C[1]-N;if(T!==0||O!==0){var b=((m[0]-P)*T+(m[1]-N)*O)/(T*T+O*O);b>1?(P=C[0],N=C[1]):b>0&&(P+=T*b,N+=O*b)}return T=m[0]-P,O=m[1]-N,T*T+O*O}function I(m,S,C,P,N,T,O,b){var x=C-m,R=P-S,V=O-N,Z=b-T,J=m-N,it=S-T,G=x*x+R*R,W=x*V+R*Z,k=V*V+Z*Z,U=x*J+R*it,A=V*J+Z*it,q=G*k-W*W,X,tt,at,et,mt=q,rt=q;q===0?(tt=0,mt=1,et=A,rt=k):(tt=W*A-k*U,et=G*A-W*U,tt<0?(tt=0,et=A,rt=k):tt>mt&&(tt=mt,et=A+W,rt=k)),et<0?(et=0,-U<0?tt=0:-U>G?tt=mt:(tt=-U,mt=G)):et>rt&&(et=rt,-U+W<0?tt=0:-U+W>G?tt=mt:(tt=-U+W,mt=G)),X=tt===0?0:tt/mt,at=et===0?0:et/rt;var wt=(1-X)*m+X*C,Ct=(1-X)*S+X*P,Q=(1-at)*N+at*O,yt=(1-at)*T+at*b,It=Q-wt,At=yt-Ct;return It*It+At*At}function y(m,S){return m[0]===S[0]?m[1]-S[1]:m[0]-S[0]}function E(m){m.sort(y);for(var S=[],C=0;C<m.length;C++){for(;S.length>=2&&h(S[S.length-2],S[S.length-1],m[C])<=0;)S.pop();S.push(m[C])}for(var P=[],N=m.length-1;N>=0;N--){for(;P.length>=2&&h(P[P.length-2],P[P.length-1],m[N])<=0;)P.pop();P.push(m[N])}return P.pop(),S.pop(),S.concat(P)}return Gl.exports}var oy=sy();const ay=Cg(oy);function uy(r,t){t===void 0&&(t={}),t.concavity=t.concavity||1/0;var e=[];if(Qo(r,function(i){e.push([i[0],i[1]])}),!e.length)return null;var n=ay(e,t.concavity);return n.length>3?hr([n]):null}function pn(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("point is required");if(!t)throw new Error("polygon is required");var n=Ir(r),i=jr(t),s=i.type,o=t.bbox,a=i.coordinates;if(o&&ly(n,o)===!1)return!1;s==="Polygon"&&(a=[a]);for(var u=!1,l=0;l<a.length&&!u;l++)if(Og(n,a[l][0],e.ignoreBoundary)){for(var h=!1,c=1;c<a[l].length&&!h;)Og(n,a[l][c],!e.ignoreBoundary)&&(h=!0),c++;h||(u=!0)}return u}function Og(r,t,e){var n=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var i=0,s=t.length-1;i<t.length;s=i++){var o=t[i][0],a=t[i][1],u=t[s][0],l=t[s][1],h=r[1]*(o-u)+a*(u-r[0])+l*(r[0]-o)===0&&(o-r[0])*(u-r[0])<=0&&(a-r[1])*(l-r[1])<=0;if(h)return!e;var c=a>r[1]!=l>r[1]&&r[0]<(u-o)*(r[1]-a)/(l-a)+o;c&&(n=!n)}return n}function ly(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}function Bi(r,t,e){e===void 0&&(e={});var n=Ir(r),i=Ir(t),s=cr(i[1]-n[1]),o=cr(i[0]-n[0]),a=cr(n[1]),u=cr(i[1]),l=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(a)*Math.cos(u);return uc(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),e.units)}function Ko(r,t,e,n){n===void 0&&(n={});var i=Ir(r),s=cr(i[0]),o=cr(i[1]),a=cr(e),u=lc(t,n.units),l=Math.asin(Math.sin(o)*Math.cos(u)+Math.cos(o)*Math.sin(u)*Math.cos(a)),h=s+Math.atan2(Math.sin(a)*Math.sin(u)*Math.cos(o),Math.cos(u)-Math.sin(o)*Math.sin(l)),c=Ll(h),f=Ll(l);return re([c,f],n.properties)}function hy(r,t,e){e===void 0&&(e={});for(var n=e.steps||64,i=e.properties?e.properties:!Array.isArray(r)&&r.type==="Feature"&&r.properties?r.properties:{},s=[],o=0;o<n;o++)s.push(Ko(r,t,o*-360/n,e).geometry.coordinates);return s.push(s[0]),hr([s],i)}function Eu(r,t,e){if(e===void 0&&(e={}),e.final===!0)return cy(r,t);var n=Ir(r),i=Ir(t),s=cr(n[0]),o=cr(i[0]),a=cr(n[1]),u=cr(i[1]),l=Math.sin(o-s)*Math.cos(u),h=Math.cos(a)*Math.sin(u)-Math.sin(a)*Math.cos(u)*Math.cos(o-s);return Ll(Math.atan2(l,h))}function cy(r,t){var e=Eu(t,r);return e=(e+180)%360,e}function fy(r,t){var e=Bi(r,t),n=Eu(r,t),i=Ko(r,e/2,n);return i}function dy(r,t){t===void 0&&(t={});var e=Bn(r),n=(e[0]+e[2])/2,i=(e[1]+e[3])/2;return re([n,i],t.properties,t)}function Ag(r,t){t===void 0&&(t={});var e=0,n=0,i=0;return Qo(r,function(s){e+=s[0],n+=s[1],i++},!0),re([e/i,n/i],t.properties)}function Dg(r,t){switch(t===void 0&&(t={}),Bm(r)){case"Point":return re(Ir(r),t.properties);case"Polygon":var e=[];Qo(r,function(m){e.push(m)});var n=Ag(r,{properties:t.properties}),i=n.geometry.coordinates,s=0,o=0,a=0,u,l,h,c,f,p,v,_,w=e.map(function(m){return[m[0]-i[0],m[1]-i[1]]});for(u=0;u<e.length-1;u++)l=w[u],c=l[0],p=l[1],h=w[u+1],f=h[0],v=h[1],_=c*v-f*p,a+=_,s+=(c+f)*_,o+=(p+v)*_;if(a===0)return n;var I=a*.5,y=1/(6*I);return re([i[0]+y*s,i[1]+y*o],t.properties);default:var E=uy(r);return E?Dg(E,{properties:t.properties}):Ag(r,{properties:t.properties})}}function Lg(r){if(!r)throw new Error("geojson is required");var t=[];return cc(r,function(e){gy(e,t)}),Bo(t)}function gy(r,t){var e=[],n=r.geometry;if(n!==null){switch(n.type){case"Polygon":e=io(n);break;case"LineString":e=[io(n)]}e.forEach(function(i){var s=py(i,r.properties);s.forEach(function(o){o.id=t.length,t.push(o)})})}}function py(r,t){var e=[];return r.reduce(function(n,i){var s=Jn([n,i],t);return s.bbox=vy(n,i),e.push(s),i}),e}function vy(r,t){var e=r[0],n=r[1],i=t[0],s=t[1],o=e<i?e:i,a=n<s?n:s,u=e>i?e:i,l=n>s?n:s;return[o,a,u,l]}var Vl={exports:{}},gc={},Rg;function Fg(){return Rg||(Rg=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=63710088e-1,r.factors={centimeters:r.earthRadius*100,centimetres:r.earthRadius*100,degrees:r.earthRadius/111325,feet:r.earthRadius*3.28084,inches:r.earthRadius*39.37,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:r.earthRadius*1e3,millimetres:r.earthRadius*1e3,nauticalmiles:r.earthRadius/1852,radians:1,yards:r.earthRadius*1.0936},r.unitsFactors={centimeters:100,centimetres:100,degrees:8982708286548395e-21,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:.0006213711922373339,millimeters:1e3,millimetres:1e3,nauticalmiles:.0005399568034557236,radians:1/r.earthRadius,yards:1.0936133},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function t(b,x,R){R===void 0&&(R={});var V={type:"Feature"};return(R.id===0||R.id)&&(V.id=R.id),R.bbox&&(V.bbox=R.bbox),V.properties=x||{},V.geometry=b,V}r.feature=t;function e(b,x,R){switch(b){case"Point":return n(x).geometry;case"LineString":return a(x).geometry;case"Polygon":return s(x).geometry;case"MultiPoint":return c(x).geometry;case"MultiLineString":return h(x).geometry;case"MultiPolygon":return f(x).geometry;default:throw new Error(b+" is invalid")}}r.geometry=e;function n(b,x,R){if(R===void 0&&(R={}),!b)throw new Error("coordinates is required");if(!Array.isArray(b))throw new Error("coordinates must be an Array");if(b.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!P(b[0])||!P(b[1]))throw new Error("coordinates must contain numbers");var V={type:"Point",coordinates:b};return t(V,x,R)}r.point=n;function i(b,x,R){return R===void 0&&(R={}),l(b.map(function(V){return n(V,x)}),R)}r.points=i;function s(b,x,R){R===void 0&&(R={});for(var V=0,Z=b;V<Z.length;V++){var J=Z[V];if(J.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var it=0;it<J[J.length-1].length;it++)if(J[J.length-1][it]!==J[0][it])throw new Error("First and last Position are not equivalent.")}var G={type:"Polygon",coordinates:b};return t(G,x,R)}r.polygon=s;function o(b,x,R){return R===void 0&&(R={}),l(b.map(function(V){return s(V,x)}),R)}r.polygons=o;function a(b,x,R){if(R===void 0&&(R={}),b.length<2)throw new Error("coordinates must be an array of two or more positions");var V={type:"LineString",coordinates:b};return t(V,x,R)}r.lineString=a;function u(b,x,R){return R===void 0&&(R={}),l(b.map(function(V){return a(V,x)}),R)}r.lineStrings=u;function l(b,x){x===void 0&&(x={});var R={type:"FeatureCollection"};return x.id&&(R.id=x.id),x.bbox&&(R.bbox=x.bbox),R.features=b,R}r.featureCollection=l;function h(b,x,R){R===void 0&&(R={});var V={type:"MultiLineString",coordinates:b};return t(V,x,R)}r.multiLineString=h;function c(b,x,R){R===void 0&&(R={});var V={type:"MultiPoint",coordinates:b};return t(V,x,R)}r.multiPoint=c;function f(b,x,R){R===void 0&&(R={});var V={type:"MultiPolygon",coordinates:b};return t(V,x,R)}r.multiPolygon=f;function p(b,x,R){R===void 0&&(R={});var V={type:"GeometryCollection",geometries:b};return t(V,x,R)}r.geometryCollection=p;function v(b,x){if(x===void 0&&(x=0),x&&!(x>=0))throw new Error("precision must be a positive number");var R=Math.pow(10,x||0);return Math.round(b*R)/R}r.round=v;function _(b,x){x===void 0&&(x="kilometers");var R=r.factors[x];if(!R)throw new Error(x+" units is invalid");return b*R}r.radiansToLength=_;function w(b,x){x===void 0&&(x="kilometers");var R=r.factors[x];if(!R)throw new Error(x+" units is invalid");return b/R}r.lengthToRadians=w;function I(b,x){return E(w(b,x))}r.lengthToDegrees=I;function y(b){var x=b%360;return x<0&&(x+=360),x}r.bearingToAzimuth=y;function E(b){var x=b%(2*Math.PI);return x*180/Math.PI}r.radiansToDegrees=E;function m(b){var x=b%360;return x*Math.PI/180}r.degreesToRadians=m;function S(b,x,R){if(x===void 0&&(x="kilometers"),R===void 0&&(R="kilometers"),!(b>=0))throw new Error("length must be a positive number");return _(w(b,x),R)}r.convertLength=S;function C(b,x,R){if(x===void 0&&(x="meters"),R===void 0&&(R="kilometers"),!(b>=0))throw new Error("area must be a positive number");var V=r.areaFactors[x];if(!V)throw new Error("invalid original units");var Z=r.areaFactors[R];if(!Z)throw new Error("invalid final units");return b/V*Z}r.convertArea=C;function P(b){return!isNaN(b)&&b!==null&&!Array.isArray(b)}r.isNumber=P;function N(b){return!!b&&b.constructor===Object}r.isObject=N;function T(b){if(!b)throw new Error("bbox is required");if(!Array.isArray(b))throw new Error("bbox must be an Array");if(b.length!==4&&b.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");b.forEach(function(x){if(!P(x))throw new Error("bbox must only contain numbers")})}r.validateBBox=T;function O(b){if(!b)throw new Error("id is required");if(["string","number"].indexOf(typeof b)===-1)throw new Error("id must be a number or a string")}r.validateId=O}(gc)),gc}var xe={},Gg;function kg(){if(Gg)return xe;Gg=1,Object.defineProperty(xe,"__esModule",{value:!0});var r=Fg();function t(y,E,m){if(y!==null)for(var S,C,P,N,T,O,b,x=0,R=0,V,Z=y.type,J=Z==="FeatureCollection",it=Z==="Feature",G=J?y.features.length:1,W=0;W<G;W++){b=J?y.features[W].geometry:it?y.geometry:y,V=b?b.type==="GeometryCollection":!1,T=V?b.geometries.length:1;for(var k=0;k<T;k++){var U=0,A=0;if(N=V?b.geometries[k]:b,N!==null){O=N.coordinates;var q=N.type;switch(x=m&&(q==="Polygon"||q==="MultiPolygon")?1:0,q){case null:break;case"Point":if(E(O,R,W,U,A)===!1)return!1;R++,U++;break;case"LineString":case"MultiPoint":for(S=0;S<O.length;S++){if(E(O[S],R,W,U,A)===!1)return!1;R++,q==="MultiPoint"&&U++}q==="LineString"&&U++;break;case"Polygon":case"MultiLineString":for(S=0;S<O.length;S++){for(C=0;C<O[S].length-x;C++){if(E(O[S][C],R,W,U,A)===!1)return!1;R++}q==="MultiLineString"&&U++,q==="Polygon"&&A++}q==="Polygon"&&U++;break;case"MultiPolygon":for(S=0;S<O.length;S++){for(A=0,C=0;C<O[S].length;C++){for(P=0;P<O[S][C].length-x;P++){if(E(O[S][C][P],R,W,U,A)===!1)return!1;R++}A++}U++}break;case"GeometryCollection":for(S=0;S<N.geometries.length;S++)if(t(N.geometries[S],E,m)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function e(y,E,m,S){var C=m;return t(y,function(P,N,T,O,b){N===0&&m===void 0?C=P:C=E(C,P,N,T,O,b)},S),C}function n(y,E){var m;switch(y.type){case"FeatureCollection":for(m=0;m<y.features.length&&E(y.features[m].properties,m)!==!1;m++);break;case"Feature":E(y.properties,0);break}}function i(y,E,m){var S=m;return n(y,function(C,P){P===0&&m===void 0?S=C:S=E(S,C,P)}),S}function s(y,E){if(y.type==="Feature")E(y,0);else if(y.type==="FeatureCollection")for(var m=0;m<y.features.length&&E(y.features[m],m)!==!1;m++);}function o(y,E,m){var S=m;return s(y,function(C,P){P===0&&m===void 0?S=C:S=E(S,C,P)}),S}function a(y){var E=[];return t(y,function(m){E.push(m)}),E}function u(y,E){var m,S,C,P,N,T,O,b,x,R,V=0,Z=y.type==="FeatureCollection",J=y.type==="Feature",it=Z?y.features.length:1;for(m=0;m<it;m++){for(T=Z?y.features[m].geometry:J?y.geometry:y,b=Z?y.features[m].properties:J?y.properties:{},x=Z?y.features[m].bbox:J?y.bbox:void 0,R=Z?y.features[m].id:J?y.id:void 0,O=T?T.type==="GeometryCollection":!1,N=O?T.geometries.length:1,C=0;C<N;C++){if(P=O?T.geometries[C]:T,P===null){if(E(null,V,b,x,R)===!1)return!1;continue}switch(P.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(E(P,V,b,x,R)===!1)return!1;break}case"GeometryCollection":{for(S=0;S<P.geometries.length;S++)if(E(P.geometries[S],V,b,x,R)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}V++}}function l(y,E,m){var S=m;return u(y,function(C,P,N,T,O){P===0&&m===void 0?S=C:S=E(S,C,P,N,T,O)}),S}function h(y,E){u(y,function(m,S,C,P,N){var T=m===null?null:m.type;switch(T){case null:case"Point":case"LineString":case"Polygon":return E(r.feature(m,C,{bbox:P,id:N}),S,0)===!1?!1:void 0}var O;switch(T){case"MultiPoint":O="Point";break;case"MultiLineString":O="LineString";break;case"MultiPolygon":O="Polygon";break}for(var b=0;b<m.coordinates.length;b++){var x=m.coordinates[b],R={type:O,coordinates:x};if(E(r.feature(R,C),S,b)===!1)return!1}})}function c(y,E,m){var S=m;return h(y,function(C,P,N){P===0&&N===0&&m===void 0?S=C:S=E(S,C,P,N)}),S}function f(y,E){h(y,function(m,S,C){var P=0;if(m.geometry){var N=m.geometry.type;if(!(N==="Point"||N==="MultiPoint")){var T,O=0,b=0,x=0;if(t(m,function(R,V,Z,J,it){if(T===void 0||S>O||J>b||it>x){T=R,O=S,b=J,x=it,P=0;return}var G=r.lineString([T,R],m.properties);if(E(G,S,C,it,P)===!1)return!1;P++,T=R})===!1)return!1}}})}function p(y,E,m){var S=m,C=!1;return f(y,function(P,N,T,O,b){C===!1&&m===void 0?S=P:S=E(S,P,N,T,O,b),C=!0}),S}function v(y,E){if(!y)throw new Error("geojson is required");h(y,function(m,S,C){if(m.geometry!==null){var P=m.geometry.type,N=m.geometry.coordinates;switch(P){case"LineString":if(E(m,S,C,0,0)===!1)return!1;break;case"Polygon":for(var T=0;T<N.length;T++)if(E(r.lineString(N[T],m.properties),S,C,T)===!1)return!1;break}}})}function _(y,E,m){var S=m;return v(y,function(C,P,N,T){P===0&&m===void 0?S=C:S=E(S,C,P,N,T)}),S}function w(y,E){if(E=E||{},!r.isObject(E))throw new Error("options is invalid");var m=E.featureIndex||0,S=E.multiFeatureIndex||0,C=E.geometryIndex||0,P=E.segmentIndex||0,N=E.properties,T;switch(y.type){case"FeatureCollection":m<0&&(m=y.features.length+m),N=N||y.features[m].properties,T=y.features[m].geometry;break;case"Feature":N=N||y.properties,T=y.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":T=y;break;default:throw new Error("geojson is invalid")}if(T===null)return null;var O=T.coordinates;switch(T.type){case"Point":case"MultiPoint":return null;case"LineString":return P<0&&(P=O.length+P-1),r.lineString([O[P],O[P+1]],N,E);case"Polygon":return C<0&&(C=O.length+C),P<0&&(P=O[C].length+P-1),r.lineString([O[C][P],O[C][P+1]],N,E);case"MultiLineString":return S<0&&(S=O.length+S),P<0&&(P=O[S].length+P-1),r.lineString([O[S][P],O[S][P+1]],N,E);case"MultiPolygon":return S<0&&(S=O.length+S),C<0&&(C=O[S].length+C),P<0&&(P=O[S][C].length-P-1),r.lineString([O[S][C][P],O[S][C][P+1]],N,E)}throw new Error("geojson is invalid")}function I(y,E){if(E=E||{},!r.isObject(E))throw new Error("options is invalid");var m=E.featureIndex||0,S=E.multiFeatureIndex||0,C=E.geometryIndex||0,P=E.coordIndex||0,N=E.properties,T;switch(y.type){case"FeatureCollection":m<0&&(m=y.features.length+m),N=N||y.features[m].properties,T=y.features[m].geometry;break;case"Feature":N=N||y.properties,T=y.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":T=y;break;default:throw new Error("geojson is invalid")}if(T===null)return null;var O=T.coordinates;switch(T.type){case"Point":return r.point(O,N,E);case"MultiPoint":return S<0&&(S=O.length+S),r.point(O[S],N,E);case"LineString":return P<0&&(P=O.length+P),r.point(O[P],N,E);case"Polygon":return C<0&&(C=O.length+C),P<0&&(P=O[C].length+P),r.point(O[C][P],N,E);case"MultiLineString":return S<0&&(S=O.length+S),P<0&&(P=O[S].length+P),r.point(O[S][P],N,E);case"MultiPolygon":return S<0&&(S=O.length+S),C<0&&(C=O[S].length+C),P<0&&(P=O[S][C].length-P),r.point(O[S][C][P],N,E)}throw new Error("geojson is invalid")}return xe.coordAll=a,xe.coordEach=t,xe.coordReduce=e,xe.featureEach=s,xe.featureReduce=o,xe.findPoint=I,xe.findSegment=w,xe.flattenEach=h,xe.flattenReduce=c,xe.geomEach=u,xe.geomReduce=l,xe.lineEach=v,xe.lineReduce=_,xe.propEach=n,xe.propReduce=i,xe.segmentEach=f,xe.segmentReduce=p,xe}var Ul={},Vg;function my(){if(Vg)return Ul;Vg=1,Object.defineProperty(Ul,"__esModule",{value:!0});var r=kg();function t(e){var n=[1/0,1/0,-1/0,-1/0];return r.coordEach(e,function(i){n[0]>i[0]&&(n[0]=i[0]),n[1]>i[1]&&(n[1]=i[1]),n[2]<i[0]&&(n[2]=i[0]),n[3]<i[1]&&(n[3]=i[1])}),n}return t.default=t,Ul.default=t,Ul}var Ug;function yy(){if(Ug)return Vl.exports;Ug=1;var r=Ig(),t=Fg(),e=kg(),n=my().default,i=e.featureEach;e.coordEach,t.polygon;var s=t.featureCollection;function o(a){var u=new r(a);return u.insert=function(l){if(l.type!=="Feature")throw new Error("invalid feature");return l.bbox=l.bbox?l.bbox:n(l),r.prototype.insert.call(this,l)},u.load=function(l){var h=[];return Array.isArray(l)?l.forEach(function(c){if(c.type!=="Feature")throw new Error("invalid features");c.bbox=c.bbox?c.bbox:n(c),h.push(c)}):i(l,function(c){if(c.type!=="Feature")throw new Error("invalid features");c.bbox=c.bbox?c.bbox:n(c),h.push(c)}),r.prototype.load.call(this,h)},u.remove=function(l,h){if(l.type!=="Feature")throw new Error("invalid feature");return l.bbox=l.bbox?l.bbox:n(l),r.prototype.remove.call(this,l,h)},u.clear=function(){return r.prototype.clear.call(this)},u.search=function(l){var h=r.prototype.search.call(this,this.toBBox(l));return s(h)},u.collides=function(l){return r.prototype.collides.call(this,this.toBBox(l))},u.all=function(){var l=r.prototype.all.call(this);return s(l)},u.toJSON=function(){return r.prototype.toJSON.call(this)},u.fromJSON=function(l){return r.prototype.fromJSON.call(this,l)},u.toBBox=function(l){var h;if(l.bbox)h=l.bbox;else if(Array.isArray(l)&&l.length===4)h=l;else if(Array.isArray(l)&&l.length===6)h=[l[0],l[1],l[3],l[4]];else if(l.type==="Feature")h=n(l);else if(l.type==="FeatureCollection")h=n(l);else throw new Error("invalid geojson");return{minX:h[0],minY:h[1],maxX:h[2],maxY:h[3]}},u}return Vl.exports=o,Vl.exports.default=o,Vl.exports}var _y=yy();const Ey=Cg(_y);function zg(r,t){var e={},n=[];if(r.type==="LineString"&&(r=Yn(r)),t.type==="LineString"&&(t=Yn(t)),r.type==="Feature"&&t.type==="Feature"&&r.geometry!==null&&t.geometry!==null&&r.geometry.type==="LineString"&&t.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var i=qg(r,t);return i&&n.push(i),Bo(n)}var s=Ey();return s.load(Lg(t)),Rl(Lg(r),function(o){Rl(s.search(o),function(a){var u=qg(o,a);if(u){var l=io(u).join(",");e[l]||(e[l]=!0,n.push(u))}})}),Bo(n)}function qg(r,t){var e=io(r),n=io(t);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=e[0][0],s=e[0][1],o=e[1][0],a=e[1][1],u=n[0][0],l=n[0][1],h=n[1][0],c=n[1][1],f=(c-l)*(o-i)-(h-u)*(a-s),p=(h-u)*(s-l)-(c-l)*(i-u),v=(o-i)*(s-l)-(a-s)*(i-u);if(f===0)return null;var _=p/f,w=v/f;if(_>=0&&_<=1&&w>=0&&w<=1){var I=i+_*(o-i),y=s+_*(a-s);return re([I,y])}return null}function wy(r,t,e){e===void 0&&(e={});var n=re([1/0,1/0],{dist:1/0}),i=0;return cc(r,function(s){for(var o=io(s),a=0;a<o.length-1;a++){var u=re(o[a]);u.properties.dist=Bi(t,u,e);var l=re(o[a+1]);l.properties.dist=Bi(t,l,e);var h=Bi(u,l,e),c=Math.max(u.properties.dist,l.properties.dist),f=Eu(u,l),p=Ko(t,c,f+90,e),v=Ko(t,c,f-90,e),_=zg(Jn([p.geometry.coordinates,v.geometry.coordinates]),Jn([u.geometry.coordinates,l.geometry.coordinates])),w=null;_.features.length>0&&(w=_.features[0],w.properties.dist=Bi(t,w,e),w.properties.location=i+Bi(u,w,e)),u.properties.dist<n.properties.dist&&(n=u,n.properties.index=a,n.properties.location=i),l.properties.dist<n.properties.dist&&(n=l,n.properties.index=a+1,n.properties.location=i+h),w&&w.properties.dist<n.properties.dist&&(n=w,n.properties.index=a),i+=h}}),n}function Wg(r,t,e){e===void 0&&(e={});var n=Ir(r),i=Ir(t);i[0]+=i[0]-n[0]>180?-360:n[0]-i[0]>180?360:0;var s=Sy(n,i),o=hc(s,"meters",e.units);return o}function Sy(r,t,e){e=e===void 0?tr:Number(e);var n=e,i=r[1]*Math.PI/180,s=t[1]*Math.PI/180,o=s-i,a=Math.abs(t[0]-r[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(s/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),l=Math.abs(u)>1e-11?o/u:Math.cos(i),h=Math.sqrt(o*o+l*l*a*a),c=h*n;return c}function Cy(r,t,e){if(e===void 0&&(e={}),e.method||(e.method="geodesic"),e.units||(e.units="kilometers"),!r)throw new Error("pt is required");if(Array.isArray(r)?r=re(r):r.type==="Point"?r=Yn(r):Sg(r,"Point","point"),!t)throw new Error("line is required");Array.isArray(t)?t=Jn(t):t.type==="LineString"?t=Yn(t):Sg(t,"LineString","line");var n=1/0,i=r.geometry.coordinates;return Jm(t,function(s){var o=s.geometry.coordinates[0],a=s.geometry.coordinates[1],u=Py(i,o,a,e);u<n&&(n=u)}),hc(n,"degrees",e.units)}function Py(r,t,e,n){var i=[e[0]-t[0],e[1]-t[1]],s=[r[0]-t[0],r[1]-t[1]],o=Xg(s,i);if(o<=0)return pc(r,t,{method:n.method,units:"degrees"});var a=Xg(i,i);if(a<=o)return pc(r,e,{method:n.method,units:"degrees"});var u=o/a,l=[t[0]+u*i[0],t[1]+u*i[1]];return pc(r,l,{method:n.method,units:"degrees"})}function Xg(r,t){return r[0]*t[0]+r[1]*t[1]}function pc(r,t,e){return e.method==="planar"?Wg(r,t,e):Bi(r,t,e)}var Hg=6378137;function Iy(r){return Ym(r,function(t,e){return t+My(e)},0)}function My(r){var t=0,e;switch(r.type){case"Polygon":return Yg(r.coordinates);case"MultiPolygon":for(e=0;e<r.coordinates.length;e++)t+=Yg(r.coordinates[e]);return t;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function Yg(r){var t=0;if(r&&r.length>0){t+=Math.abs(Jg(r[0]));for(var e=1;e<r.length;e++)t-=Math.abs(Jg(r[e]))}return t}function Jg(r){var t,e,n,i,s,o,a,u=0,l=r.length;if(l>2){for(a=0;a<l;a++)a===l-2?(i=l-2,s=l-1,o=0):a===l-1?(i=l-1,s=0,o=1):(i=a,s=a+1,o=a+2),t=r[i],e=r[s],n=r[o],u+=(vc(n[0])-vc(t[0]))*Math.sin(vc(e[1]));u=u*Hg*Hg/2}return u}function vc(r){return r*Math.PI/180}function Ny(r,t,e){e===void 0&&(e={});for(var n=jr(r),i=n.coordinates,s=0,o=0;o<i.length&&!(t>=s&&o===i.length-1);o++)if(s>=t){var a=t-s;if(a){var u=Eu(i[o],i[o-1])-180,l=Ko(i[o],a,u,e);return l}else return re(i[o])}else s+=Bi(i[o],i[o+1],e);return re(i[i.length-1])}function Qi(r,t,e){e===void 0&&(e={});for(var n=Ir(r),i=io(t),s=0;s<i.length-1;s++){var o=!1;if(e.ignoreEndVertices&&(s===0&&(o="start"),s===i.length-2&&(o="end"),s===0&&s+1===i.length-1&&(o="both")),by(i[s],i[s+1],n,o,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function by(r,t,e,n,i){var s=e[0],o=e[1],a=r[0],u=r[1],l=t[0],h=t[1],c=e[0]-a,f=e[1]-u,p=l-a,v=h-u,_=c*v-f*p;if(i!==null){if(Math.abs(_)>i)return!1}else if(_!==0)return!1;if(n){if(n==="start")return Math.abs(p)>=Math.abs(v)?p>0?a<s&&s<=l:l<=s&&s<a:v>0?u<o&&o<=h:h<=o&&o<u;if(n==="end")return Math.abs(p)>=Math.abs(v)?p>0?a<=s&&s<l:l<s&&s<=a:v>0?u<=o&&o<h:h<o&&o<=u;if(n==="both")return Math.abs(p)>=Math.abs(v)?p>0?a<s&&s<l:l<s&&s<a:v>0?u<o&&o<h:h<o&&o<u}else return Math.abs(p)>=Math.abs(v)?p>0?a<=s&&s<=l:l<=s&&s<=a:v>0?u<=o&&o<=h:h<=o&&o<=u;return!1}function Ty(r,t){var e=jr(r),n=jr(t),i=e.type,s=n.type;switch(i){case"Point":switch(s){case"MultiPoint":return xy(e,n);case"LineString":return Qi(e,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return pn(e,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return Oy(e,n);case"LineString":return Ay(e,n);case"Polygon":case"MultiPolygon":return Dy(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return Ly(e,n);case"Polygon":case"MultiPolygon":return Ry(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return Fy(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function xy(r,t){var e,n=!1;for(e=0;e<t.coordinates.length;e++)if(Qg(t.coordinates[e],r.coordinates)){n=!0;break}return n}function Oy(r,t){for(var e=0;e<r.coordinates.length;e++){for(var n=!1,i=0;i<t.coordinates.length;i++)Qg(r.coordinates[e],t.coordinates[i])&&(n=!0);if(!n)return!1}return!0}function Ay(r,t){for(var e=!1,n=0;n<r.coordinates.length;n++){if(!Qi(r.coordinates[n],t))return!1;e||(e=Qi(r.coordinates[n],t,{ignoreEndVertices:!0}))}return e}function Dy(r,t){for(var e=!0,n=!1,i=0;i<r.coordinates.length;i++){if(n=pn(r.coordinates[1],t),!n){e=!1;break}n=pn(r.coordinates[1],t,{ignoreBoundary:!0})}return e&&n}function Ly(r,t){for(var e=0;e<r.coordinates.length;e++)if(!Qi(r.coordinates[e],t))return!1;return!0}function Ry(r,t){var e=Bn(t),n=Bn(r);if(!Bg(e,n))return!1;for(var i=!1,s=0;s<r.coordinates.length-1;s++){if(!pn(r.coordinates[s],t))return!1;if(i||(i=pn(r.coordinates[s],t,{ignoreBoundary:!0})),!i){var o=Gy(r.coordinates[s],r.coordinates[s+1]);i=pn(o,t,{ignoreBoundary:!0})}}return i}function Fy(r,t){var e=Bn(r),n=Bn(t);if(!Bg(n,e))return!1;for(var i=0;i<r.coordinates[0].length;i++)if(!pn(r.coordinates[0][i],t))return!1;return!0}function Bg(r,t){return!(r[0]>t[0]||r[2]<t[2]||r[1]>t[1]||r[3]<t[3])}function Qg(r,t){return r[0]===t[0]&&r[1]===t[1]}function Gy(r,t){return[(r[0]+t[0])/2,(r[1]+t[1])/2]}function ky(r,t,e){e===void 0&&(e={});var n;e.final?n=Kg(Ir(t),Ir(r)):n=Kg(Ir(r),Ir(t));var i=n>180?-(360-n):n;return i}function Kg(r,t){var e=cr(r[1]),n=cr(t[1]),i=cr(t[0]-r[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var s=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(e/2+Math.PI/4)),o=Math.atan2(i,s);return(Ll(o)+360)%360}function Vy(r,t,e,n){n===void 0&&(n={});var i=t<0,s=hc(Math.abs(t),n.units,"meters");i&&(s=-Math.abs(s));var o=Ir(r),a=Uy(o,s,e);return a[0]+=a[0]-o[0]>180?-360:o[0]-a[0]>180?360:0,re(a,n.properties)}function Uy(r,t,e,n){n=n===void 0?tr:Number(n);var i=t/n,s=r[0]*Math.PI/180,o=cr(r[1]),a=cr(e),u=i*Math.cos(a),l=o+u;Math.abs(l)>Math.PI/2&&(l=l>0?Math.PI-l:-Math.PI-l);var h=Math.log(Math.tan(l/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),c=Math.abs(h)>1e-11?u/h:Math.cos(o),f=i*Math.sin(a)/c,p=s+f;return[(p*180/Math.PI+540)%360-180,l*180/Math.PI]}function zy(r,t){var e=jr(r),n=jr(t),i=e.type,s=n.type,o=e.coordinates,a=n.coordinates;switch(i){case"Point":switch(s){case"Point":return mc(o,a);default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"Point":return qy(e,n);case"MultiPoint":return Wy(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"Point":return Qi(n,e,{ignoreEndVertices:!0});case"LineString":return Yy(e,n);case"MultiPoint":return Xy(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Point":return pn(n,e,{ignoreBoundary:!0});case"LineString":return Jy(e,n);case"Polygon":return By(e,n);case"MultiPoint":return Hy(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function qy(r,t){var e,n=!1;for(e=0;e<r.coordinates.length;e++)if(mc(r.coordinates[e],t.coordinates)){n=!0;break}return n}function Wy(r,t){for(var e=0,n=t.coordinates;e<n.length;e++){for(var i=n[e],s=!1,o=0,a=r.coordinates;o<a.length;o++){var u=a[o];if(mc(i,u)){s=!0;break}}if(!s)return!1}return!0}function Xy(r,t){for(var e=!1,n=0,i=t.coordinates;n<i.length;n++){var s=i[n];if(Qi(s,r,{ignoreEndVertices:!0})&&(e=!0),!Qi(s,r))return!1}return!!e}function Hy(r,t){for(var e=0,n=t.coordinates;e<n.length;e++){var i=n[e];if(!pn(i,r,{ignoreBoundary:!0}))return!1}return!0}function Yy(r,t){for(var e=!1,n=0,i=t.coordinates;n<i.length;n++){var s=i[n];if(Qi({type:"Point",coordinates:s},r,{ignoreEndVertices:!0})&&(e=!0),!Qi({type:"Point",coordinates:s},r,{ignoreEndVertices:!1}))return!1}return e}function Jy(r,t){var e=!1,n=0,i=Bn(r),s=Bn(t);if(!Zg(i,s))return!1;for(n;n<t.coordinates.length-1;n++){var o=Qy(t.coordinates[n],t.coordinates[n+1]);if(pn({type:"Point",coordinates:o},r,{ignoreBoundary:!0})){e=!0;break}}return e}function By(r,t){if(r.type==="Feature"&&r.geometry===null||t.type==="Feature"&&t.geometry===null)return!1;var e=Bn(r),n=Bn(t);if(!Zg(e,n))return!1;for(var i=jr(t).coordinates,s=0,o=i;s<o.length;s++)for(var a=o[s],u=0,l=a;u<l.length;u++){var h=l[u];if(!pn(h,r))return!1}return!0}function Zg(r,t){return!(r[0]>t[0]||r[2]<t[2]||r[1]>t[1]||r[3]<t[3])}function mc(r,t){return r[0]===t[0]&&r[1]===t[1]}function Qy(r,t){return[(r[0]+t[0])/2,(r[1]+t[1])/2]}/**
23
+ `).join(" ")}`)):this._sceneObjRefs.set(s,[i]);const l=this.getLastSceneObject(s);this._refs[s]=l,this._refsChanged.emit(l,a)}};this.d(e.sceneObjCreatedEvent.don(i=>{const s=(o,a)=>n(i,o,a);i.ref&&s(i.ref,void 0),i.refChanged.don(s)})),this.d(e.sceneObjToDestroyEvent.don(i=>{i.ref&&n(i,void 0,i.ref)}))}get sceneObjRefs(){return this._sceneObjRefs}get refs(){return this._refs}get refsChanged(){return this._refsChanged}getLastSceneObject(e){const n=this.getSceneObjects(e);if(n)return n[n.length-1]}getSceneObjects(e){const n=this._sceneObjRefs.get(e);if(!(!n||n.length===0))return n}}function $d(r,t){const[e,n,i]=g.getReactFuncs(r),s=g.react(void 0),o=()=>{const a=e()??t;s.value=a&&K.context.getStrFromEnv(a)};return o(),i&&s.d(i.don(o)),s.d(K.context.environmentVariablesChanged.don(o)),s}function Kd(r){const t=/\${(.*?)\}/g;if(!t.test(r))return r;const e=r.replace(t,(n,i)=>{const s=K.context.getEnv(i);return s===void 0?(console.warn(`环境变量(${i})不存在,无法进行转换`),"{env-error}"):s});return Kd(e)}class r0 extends B{constructor(){super();d(this,"_esObjConstructors",new Map);d(this,"_sceneObjs",new Map);d(this,"_sceneObjCreatedEvent",new V);d(this,"_sceneObjToDestroyEvent",new V);d(this,"_refsManager",this.dv(new e0(this)));d(this,"_environmentVariables",window.ESSDK_ENV||{});d(this,"_environmentVariablesChanged",this.dv(new V))}get typeNames(){return this._esObjConstructors.keys()}get sceneObjs(){return this._sceneObjs.values()}get sceneObjCreatedEvent(){return this._sceneObjCreatedEvent}get sceneObjToDestroyEvent(){return this._sceneObjToDestroyEvent}get refsManager(){return this._refsManager}get $refs(){return this._refsManager.refs}register(e,n,i){return this._esObjConstructors.has(e)&&console.warn(`register warn: ${e} has registered ! will be override!`),this._esObjConstructors.set(e,n),i&&g.setExtProp(n,"__sceneObjExtraInfo",i),e}_addSceneObject(e){this._sceneObjs.set(e.id,e),this._sceneObjCreatedEvent.emit(e),e.d(()=>this._deleteSceneObject(e))}addSceneObject(e){this._addSceneObject(e)}_deleteSceneObject(e){this._sceneObjToDestroyEvent.emit(e),this._sceneObjs.delete(e.id)}deleteSceneObject(e){this._deleteSceneObject(e)}createSceneObjectFromClass(e,n){if(!n||this._sceneObjs.has(n)){const s=g.createGuid();n&&console.warn(`已存在相同id的对象!id自动变更!${n} -> ${s} 请注意:id变更可能导致引用失效!`),n=s}if(!n)throw new Error("id不能为空!");const i=new e(n);return i.id!==n&&(console.warn(`sceneObj.id(${i.id}) !== id(${n}) sceneObjectType: ${i.typeName}`),console.warn("出现这种问题有可能是自定义的场景对象,没有在构造函数中传递id参数!示例如下:"),console.warn("class XXX extends XXX { constructor(id) { super(id); } }")),this._addSceneObject(i),i}createSceneObject(e,n){if(typeof e=="string"){const i=this._getSceneObjConstructor(e);if(!i){console.warn(`Cannot find SceneObjectType: ${e}`);return}return this.createSceneObjectFromClass(i,n)}else return this.createSceneObjectFromClass(e,n)}createSceneObjectFromUrl(e,n){let i;const s=e.toLowerCase();if(s.includes(".gltf")||s.includes(".glb")?i="ESGltfModel":s.includes("tileset.json")?i="ES3DTileset":s.includes("layer.json")||s.includes("ion://1")?i="ESTerrainLayer":s.includes(".jpg")||s.includes(".png")||s.includes(".jpeg")||s.includes(".webp")||s.includes("image/jpg")||s.includes("image/png")||s.includes("image/jpeg")||s.includes("image/webp")?i="ESImageLabel":(s.includes("/tilemapresource.xml")||s.includes("ion://")||s.includes("wms")||s.includes("wmts")||s.includes("{x}")||s.includes("{y}")||s.includes("{z}"))&&(i="ESImageryLayer"),!!i)return this.createSceneObjectFromJson({type:i,id:n,url:e})}createSceneObjectFromJson(e){const n=this.createSceneObject(e.type,e.id);return n&&(n.json=e),n}destroySceneObject(e){return this._deleteSceneObject(e),e.destroy(),e.isDestroyed()}getSceneObjectById(e){return this._sceneObjs.get(e)}getSceneObject(e){if(!e&&e!="")return Array.from(this._sceneObjs.values());if(e.startsWith("ES")){const n=[];for(const i of this._sceneObjs.values())i.typeName===e&&n.push(i);return n}else return this._sceneObjs.get(e)}_getSceneObjConstructor(e){const n=this._esObjConstructors.get(e);if(n)return n}getProps(e){const n=this._getSceneObjConstructor(e);if(!n){console.warn(`cannot get constructor from type: ${e}`);return}return g.getExtProp(n,"__sceneObjExtraInfo")}setProps(e,n){const i=this._getSceneObjConstructor(e);if(!i){console.warn(`cannot get constructor from type: ${e}`);return}let s=g.getExtProp(i,"__sceneObjExtraInfo");s||(s={},g.setExtProp(i,"__sceneObjExtraInfo",s)),Object.assign(s,n)}getProp(e,n){const i=this.getProps(e);return i&&i[n]}setProp(e,n,i){this.setProps(e,{[n]:i})}get environmentVariables(){return this._environmentVariables}set environmentVariables(e){for(let[n,i]of Object.entries(e))this.setEnv(n,i)}get environmentVariablesChanged(){return this._environmentVariablesChanged}setEnv(e,n){if(this._environmentVariables[e]!==n){const i=this._environmentVariables[e];this._environmentVariables[e]=n,this._environmentVariablesChanged.emit(e,n,i)}window.ESSDK_ENV={...this._environmentVariables}}getEnv(e){return this._environmentVariables[e]}getStrFromEnv(e){return Kd(e)}createEnvStrReact(e,n){return $d(e,n)}createEvnStrReact(e,n){return $d(e,n)}}const lt=class lt extends B{constructor(e){super();d(this,"_components",this.dv(new hl));d(this,"_viewerAttached",this.dv(new V));d(this,"_viewerDetached",this.dv(new V));d(this,"_attachedViewers",(()=>{const e=new Set;return this.d(this._viewerAttached.don(n=>{n.actived&&(this.activeViewer=n),n.ad(n.activedChanged.don(i=>{i&&e.has(n)&&(this.activeViewer=n)})),e.add(n)})),this.d(this._viewerDetached.don(n=>{e.delete(n),this.activeViewer==n&&(this.activeViewer=void 0)})),e})());d(this,"_activeViewer",this.disposeVar(g.react(void 0)));d(this,"_createdEvent",this.dv(new V));d(this,"_flushEvent",this.dv(new V));d(this,"_id");d(this,"_updateFuncReact",this.dv(g.react(void 0)));d(this,"_toDestroyFuncReact",this.dv(g.react(void 0)));d(this,"_parentID");e!==void 0&&(typeof e!="string"?console.warn(`对象id必须是字符串类型,当前id的类型是${typeof e},值为${e}`):e.trim()===""?console.warn("场景对象创建时的id不能是空字符串!"):e.trim()!==e&&console.warn(`id前后有空字符串!id: ${e}`)),this._id=e??g.createGuid(),this._initName();{const n=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(i){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${i}`)}};n(),this.d(this.execOnceFuncStrChanged.don(n))}{const n=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(s){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};n(),this.d(this.updateFuncStrChanged.don(n));let i;this.d(()=>i&&i.destroy()),this.d(this.updateFuncChanged.don(()=>{i&&i.cancel(),this.updateFunc&&(i=i||g.createAnimateFrame(),i.restart(void 0,s=>{this.updateFunc&&this.updateFunc(this,s)}))}))}{const n=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(i){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${i}`),this.toDestroyFunc=void 0}};n(),this.d(this.toDestroyFuncStrChanged.don(n)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}}static getParentClass(){return Object.getPrototypeOf(this)}static register(e,n,i){g.extendClassProps(n.prototype,n.createDefaultProps);const s=n.createDefaultProps();n.defaults&&(n.defaults={});for(const o of Object.keys(s))n.defaults[o]=s[o]instanceof g.ReactiveVariable?s[o].value:s[o];return this.innerRegister(e,n,i),e}static get envs(){return lt.context.environmentVariables}static get $refs(){return lt.context.refsManager.refs}get components(){return this._components}get viewerAttached(){return this._viewerAttached}get viewerDetached(){return this._viewerDetached}get attachedViewers(){return this._attachedViewers}get activeViewer(){return this._activeViewer.value}set activeViewer(e){this._activeViewer.value=e}get activeViewerChanged(){return this._activeViewer.changed}removefromViewer(e){this.attachedViewers.has(e)&&e.delete(this)}addToViewer(e){this.attachedViewers.has(e)||e.add(this)}registerAttachedObject(e){const n=new Map;this.d(()=>{n.size>0&&console.warn("viewerPropSceneObjects.size > 0")}),this.d(this._viewerAttached.don(i=>{const s=e(i);s&&n.set(i,s)})),this.d(this._viewerDetached.don(i=>{if(!n.has(i))return;const s=n.get(i);s&&(s.destroy(),n.delete(i))}))}createAttachedObject(e){const n=new Map,i=(()=>{for(let[u,l]of n.entries())l.destroy();n.clear()}),s=u=>{const l=e(u);l&&n.set(u,l)};for(let u of this.attachedViewers)s(u);const o=this._viewerAttached.don(s),a=this._viewerDetached.don(u=>{if(!n.has(u))return;const l=n.get(u);l&&(l.destroy(),n.delete(u))});return()=>{a(),o(),i()}}registerAttachedObjectForContainer(e){this.registerAttachedObject(n=>new n0(n,e))}get createdEvent(){return this._createdEvent}get flushEvent(){return this._flushEvent}flush(){this.flushEvent.emit()}get id(){return this._id}get typeName(){return this.constructor.type}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return this.constructor.createDefaultProps()}_innerGetJson(e=!0){const n={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(e){let s,o=this.defaultProps[i];o instanceof g.ReactiveVariable?s=o.equals(this[i]):s=o===this[i],s||(n[i]=this[i])}else n[i]=this[i];return n}_innerSetJson(e,n,i){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in e)this[a]=e[a]===null?void 0:e[a];else if(!(i??!1)){let u=this.defaultProps[a];u instanceof g.ReactiveVariable&&(u=u.value),this[a]=u}}get json(){return this._innerGetJson()}set json(e){this._innerSetJson(e)}get _jsonStr(){return JSON.stringify(this.json,null,4)}set _jsonStr(e){this._innerSetJson(JSON.parse(e))}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get parentID(){return this._parentID??this.id}set parentID(e){this._parentID=e}getProperties(e){const n={...this.getESProperties()},i=[];return n.general.length>0&&i.push(new nt(n.general,"general")),Object.keys(n).forEach(s=>{s!=="defaultMenu"&&s!=="general"&&n[s].length>0&&i.push(new nt(n[s],s))}),i}getESProperties(){return{defaultMenu:"general",basic:[],general:[new ot([this,"typeName"],"类型",void 0,!1,!0),new ot([this,"id"],"唯一标识",void 0,!1,!0),new ot([this,"name"],"名称")],dataSource:[],location:[],coordinate:[],style:[],more:[new ot([this,"ref"],"ref",void 0,!0),new Q([this,"extras"],"extras",void 0,void 0,!0),new Hd(()=>this._jsonStr,e=>e&&(this._jsonStr=e),"JSON")]}}};d(lt,"context",new r0),d(lt,"innerRegister",lt.context.register.bind(lt.context)),d(lt,"defaults",{}),d(lt,"createDefaultProps",()=>({name:"未命名场景对象",ref:void 0,extras:g.reactJson(void 0),devTags:g.reactArrayWithUndefined(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})),d(lt,"type",lt.register("ESSceneObject",lt,{chsName:"场景类",tags:["ESObjects"],description:""})),d(lt,"create",lt.context.createSceneObject.bind(lt.context)),d(lt,"createFromUrl",lt.context.createSceneObjectFromUrl.bind(lt.context)),d(lt,"createFromClass",lt.context.createSceneObjectFromClass.bind(lt.context)),d(lt,"createFromJson",lt.context.createSceneObjectFromJson.bind(lt.context)),d(lt,"destroySceneObject",lt.context.destroySceneObject.bind(lt.context)),d(lt,"getSceneObjById",lt.context.getSceneObjectById.bind(lt.context)),d(lt,"getSceneObj",lt.context.getSceneObject.bind(lt.context)),d(lt,"getEnv",lt.context.getEnv.bind(lt.context)),d(lt,"setEnv",lt.context.setEnv.bind(lt.context)),d(lt,"getStrFromEnv",lt.context.getStrFromEnv.bind(lt.context)),d(lt,"getSceneObjectById",lt.context.getSceneObjectById.bind(lt.context)),d(lt,"getSceneObject",lt.context.getSceneObject.bind(lt.context));let K=lt;class n0 extends B{constructor(t,e){super(),this.dv(new g.ObjResettingWithEvent(t.subContainerChanged,()=>{if(t.subContainer)return e(t,t.subContainer)}))}}const oe=class oe extends K{constructor(e){super(e);d(this,"_editing",this.dv(g.react(!1)));d(this,"editingID");d(this,"editingBindMode","singlePoint");d(this,"_deprecated",[]);d(this,"_flyInEvent",this.dv(new V));d(this,"_flyToEvent",this.dv(new V));d(this,"_flyOverEvent",this.disposeVar(new V));d(this,"_pickedEvent",this.dv(new V));d(this,"_calcFlyToParamEvent",this.dv(new V));d(this,"_calcFlyInParamEvent",this.dv(new V));d(this,"useCalcFlyToParamInESObjectWithLocation",!1);np(this,this.updateEditing)}supportEditingModes(){return this.constructor.supportEditingModes}get editing(){return this._editing.value}set editing(e){this._editing.value=e}get editingChanged(){return this._editing.changed}updateEditing(){}_deprecatedWarning(){const e=this._deprecated;for(let n=0;n<e.length;n++){const i=e[n];typeof i=="string"?Reflect.has(this,i+"Changed")&&this.d(this[i+"Changed"].don(()=>{console.warn(`注意:${this.typeName} 的 ${i} 属性下版本将会被移除!`)})):Object.keys(i).forEach(s=>{Reflect.has(this,s+"Changed")&&this.d(this[s+"Changed"].don(a=>{const u=i[s];typeof u=="string"?console.warn(`注意:${this.typeName} 的 ${s} 属性下版本将会被移除!`):Object.keys(u).forEach((l=>{a===l&&console.warn(`注意:${this.typeName} 的 ${s} 属性值 ${l} 下版本将会被移除,推荐使用属性值 ${u[l]}`)}))}))})}}get flyInEvent(){return this._flyInEvent}flyIn(e=1){this._flyInEvent.emit(e,oe._lastFlyInId)}get flyToEvent(){return this._flyToEvent}flyTo(e=1){this._flyToEvent.emit(e,oe._lastFlyToId)}get flyOverEvent(){return this._flyOverEvent}get pickedEvent(){return this._pickedEvent}get calcFlyToParamEvent(){return this._calcFlyToParamEvent}calcFlyToParam(){this._calcFlyToParamEvent.emit()}get calcFlyInParamEvent(){return this._calcFlyInParamEvent}calcFlyInParam(){this._calcFlyInParamEvent.emit()}emptyFlyToParam(){this.flyToParam=void 0}emptyFlyInParam(){this.flyInParam=void 0}async getBoundSphere(e){return await e.getBoundSphere(this.id)}getESProperties(){const e={...super.getESProperties()};return{...e,general:[...e.general,new W([this,"show"],"是否显示",oe.defaults.show),new W([this,"collision"],"开启碰撞",oe.defaults.collision),new W([this,"allowPicking"],"允许拾取",oe.defaults.allowPicking),new it([],()=>this.calcFlyToParam(),[],"保存观察视角","保存当前flyToParam"),new it([],()=>this.emptyFlyToParam(),[],"清空飞向参数","清空飞向参数"),new it([],()=>this.emptyFlyInParam(),[],"清空飞入参数","清空飞入参数"),new it([],()=>this.calcFlyInParam(),[],"保存飞入参数","保存飞入参数flyInParam")],more:[...e.more,new nt([],"飞行定位","飞向参数"),new it(["number"],n=>this.flyTo(n),[1],"飞向"),new Q([this,"flyToParam"],"flyToParam",void 0,void 0,!0),new T([this,"flyToDistance"],"flyToDistance",void 0,!0),new T([this,"flyToHeading"],"flyToHeading",void 0,!0),new T([this,"flyToPitch"],"flyToPitch",void 0,!0),new T([this,"flyToFlyDuration"],"flyToFlyDuration",void 0,!0),new T([this,"flyToHDelta"],"flyToHDelta",void 0,!0),new T([this,"flyToPDelta"],"flyToPDelta",void 0,!0),new nt([],"飞入参数"),new it(["number"],n=>this.flyIn(n),[1],"飞入"),new Q([this,"flyInParam"],"flyInParam",void 0,void 0,!0)]}}get flyToDistance(){return this.flyToParam&&this.flyToParam.distance}get flyToHeading(){return this.flyToParam&&this.flyToParam.heading}get flyToPitch(){return this.flyToParam&&this.flyToParam.pitch}get flyToFlyDuration(){return this.flyToParam&&this.flyToParam.flyDuration}get flyToHDelta(){return this.flyToParam&&this.flyToParam.hDelta}get flyToPDelta(){return this.flyToParam&&this.flyToParam.pDelta}get flyToDistanceChanged(){return this.flyToParamChanged}get flyToHeadingChanged(){return this.flyToParamChanged}get flyToPitchChanged(){return this.flyToParamChanged}get flyToFlyDurationChanged(){return this.flyToParamChanged}get flyToHDeltaChanged(){return this.flyToParamChanged}get flyToPDeltaChanged(){return this.flyToParamChanged}set flyToDistance(e){this.flyToParam=e!==void 0?{...this.flyToParam??oe.defaultFlyToParam,distance:e}:void 0}set flyToHeading(e){this.flyToParam=e!==void 0?{...this.flyToParam??oe.defaultFlyToParam,heading:e}:void 0}set flyToPitch(e){this.flyToParam=e!==void 0?{...this.flyToParam??oe.defaultFlyToParam,pitch:e}:void 0}set flyToFlyDuration(e){this.flyToParam=e!==void 0?{...this.flyToParam??oe.defaultFlyToParam,flyDuration:e}:void 0}set flyToHDelta(e){this.flyToParam=e!==void 0?{...this.flyToParam??oe.defaultFlyToParam,hDelta:e}:void 0}set flyToPDelta(e){this.flyToParam=e!==void 0?{...this.flyToParam??oe.defaultFlyToParam,pDelta:e}:void 0}};d(oe,"createDefaultProps",()=>({...K.createDefaultProps(),show:!0,collision:!0,allowPicking:!1,flyToParam:g.reactJsonWithUndefined(void 0),flyInParam:g.reactJsonWithUndefined(void 0)})),d(oe,"type",oe.register("ESVisualObject",oe,{chsName:"可视化对象",tags:["ESObjects"],description:"可视化对象"})),d(oe,"supportEditingModes",[]),d(oe,"defaultFlyToParam",{distance:0,heading:0,pitch:0,flyDuration:1,hDelta:0,pDelta:0}),d(oe,"defaultFlyInParam",{position:[0,0,0],rotation:[0,0,0],flyDuration:1}),d(oe,"_lastFlyInId",0),d(oe,"_lastFlyToId",0);let Dt=oe;class Zd extends B{constructor(){super();d(this,"_data",this.dv(g.react(void 0)))}set data(e){this._data.value=e}get data(){return this._data.value}get dataChanged(){return this._data.changed}}class tp extends B{constructor(){super(...arguments);d(this,"_dragStartEvent",this.dv(new V));d(this,"_dragOverEvent",this.dv(new V));d(this,"_dragLeaveEvent",this.dv(new V));d(this,"_dropEvent",this.dv(new V))}dragStart(e){this._dragStartEvent.emit(e)}dragOver(e){this._dragOverEvent.emit(e)}dragLeave(e){this._dragLeaveEvent.emit(e)}drop(e){this._dropEvent.emit(e)}}function i0(r,t){t&&(Reflect.has(t,"editing")?t.editing=!0:Reflect.has(t,"positionEditing")&&(t.positionEditing=!0))}function s0(r){["Czm3DTiles","View","ESCameraView","OlView","GeoCameraController"].includes(r.typeName)||(Reflect.has(r,"editing")?r.editing=!0:Reflect.has(r,"positionEditing")&&(r.positionEditing=!0)),typeof r.execOnCreating=="function"&&r.execOnCreating()}function fl(r,t){g.getExtProp(r,"__treeItem")&&console.error("setSceneObjectTreeItem error!"),g.setExtProp(r,"__treeItem",t)}function o0(r){return g.getExtProp(r,"__treeItem")}function a0(r){if(!(r.startsWith("./")||r.startsWith("../")||r.startsWith("/")))return r;const t=document.createElement("a");t.href=r;const e=t.href;return t.remove(),e}function Xh(r){if(typeof r!="string")return!1;try{const t=JSON.parse(r);return typeof t=="object"&&t!==null}catch{return!1}}function u0(r){try{return new DOMParser().parseFromString(r,"application/xml").getElementsByTagName("parsererror").length===0}catch{return!1}}function l0(r){return r instanceof Function?r():r}function ep(r,t){for(let e of r)if(t.includes(e))return!0;return!1}function Pi(r,t){const e=r,n=t;return e===void 0||e.length===0||n===void 0||n.length===0?!0:ep(e,n)}function h0(r){const t=setTimeout(()=>{r(),clearTimeout(t)})}function Po(r){let t=r%360;return t=t<0?360+t:t,t}function rp(r){return Po(r+180)-180}function dl(r,t,e){let n=Po(r),i=Po(t);Math.abs(n-i)>180&&(n<i?n+=360:i+=360);const s=n*(1-e)+i*e;return rp(s)}function Bh(r,t,e,n){return n=n||[0,0,0],n[0]=dl(r[0],t[0],e),n[1]=dl(r[1],t[1],e),n[2]=dl(r[2],t[2],e),n}function np(r,t,e="editing"){const n=new B;r.ad(n);const i=t.bind(r);return n.ad(new g.ObjResettingWithEvent(r.activeViewerChanged,()=>{const s=new B;let o=r.activeViewer;return o?(s.ad(r[`${e}Changed`].don(()=>{var a;r[`${e}`]?i():(a=(r.components.main??r).editingID)!=null&&a.includes("inner")&&r.activeViewer&&r.activeViewer.stopEditing()})),s.ad(o.editingEvent.don(a=>{if(a.objectIDs.includes(r.id)&&a.type==="end"){const u=r.components.main??r;u.editingID&&a.editingID.includes(u.editingID)?r[`${e}`]=!1:r[`${e}`]=!u.editingID.includes("outer")}}))):s.ad(r[`${e}Changed`].don(()=>{r[`${e}`]=!1})),s})),r[`${e}`]&&i(),n}class c0 extends B{constructor(e,n,i,s){super();d(this,"_sceneObjectId",this.dv(new g.SceneObjectWithId));this._id=e,this._startTimeStamp=n,this._duration=i,this._parent=s,this._sceneObjectId.id=this._id;const o=()=>{if(!this.player)return;const{currentTime:a=0}=this._parent,u=a-this._startTimeStamp;this.player.currentTime=g.clamp(u,0,this._duration)*(this.player.speed??1)};o(),this.d(this._parent.currentTimeChanged.don(o)),this.d(this.playerChanged.don(o))}get player(){return this._sceneObjectId.sceneObject instanceof Mn?this._sceneObjectId.sceneObject:void 0}get playerChanged(){return this._sceneObjectId.sceneObjectChanged}}const f0=`
24
+ 用来配置子播放器,它是一个数组形式,数组的每个元素仍然是一个数组,形式是[子播放器的ID, 起始时间, 持续时间]。
25
+ 注意时间的单位是毫秒。
26
+ 示例如下:
27
+ \`\`\`
28
+ [
29
+ [
30
+ "9591a729-d90b-40d0-8d1b-f1ac4b5263c1",
31
+ 0,
32
+ 5000
33
+ ],
34
+ [
35
+ "76ad204f-58c6-4639-8713-ecfab6783b0f",
36
+ 7000.002288818359,
37
+ 5000
38
+ ]
39
+ ]
40
+ \`\`\`
41
+ `,He=class He extends B{constructor(){super();d(this,"_ratio",this.dv(g.react(0)));d(this,"_subPlayers",this.dv(new g.ObservableArray));const e=this.dv(new g.Player);{const o=()=>{e.loop=this.loop??He.defaults.loop};o(),this.d(this.loopChanged.don(o))}{const o=()=>{(this.loop??He.defaults.loop)!==e.loop&&(this.loop=e.loop)};o(),this.d(e.loopChangedEvent.don(o))}{const o=()=>{e.currentTime=this.currentTime??He.defaults.currentTime};o(),this.d(this.currentTimeChanged.don(o))}{const o=()=>{(this.currentTime??He.defaults.currentTime)!==e.currentTime&&(this.currentTime=e.currentTime)};o(),this.d(e.currentTimeChangedEvent.don(o))}{const o=()=>{e.duration=this.duration??He.defaults.duration};o(),this.d(this.durationChanged.don(o))}{const o=()=>{(this.duration??He.defaults.duration)!==e.duration&&(this.duration=e.duration)};o(),this.d(e.durationChangedEvent.don(o))}{const o=()=>{e.speed=this.speed??He.defaults.speed};o(),this.d(this.speedChanged.don(o))}{const o=()=>{(this.speed??He.defaults.speed)!==e.speed&&(this.speed=e.speed)};o(),this.d(e.speedChangedEvent.don(o))}{const o=()=>{e.playing=this.playing??He.defaults.playing};o(),this.d(this.playingChanged.don(o))}{const o=()=>{(this.playing??He.defaults.playing)!==e.playing&&(this.playing=e.playing)};o(),this.d(e.playingChangedEvent.don(o))}const n=()=>{const o=this.duration??He.defaults.duration;o>0&&(this._ratio.value=(this.currentTime??He.defaults.currentTime)/o)};n();const i=this.dv(g.createNextAnimateFrameEvent(this.currentTimeChanged,this.durationChanged));this.d(i.don(n)),this.d(()=>{const{length:o}=this._subPlayers;for(let a=0;a<o;++a)this._subPlayers.get(a).destroy();this._subPlayers.length=0});const s=()=>{for(let a of this._subPlayers)a.destroy();if(this._subPlayers.length=0,!this.channels)return;const o=this.channels.map(a=>{const[u,l,h]=a;return new c0(u,l,h,this)});this._subPlayers.splice(0,0,...o)};s(),this.d(this.channelsChanged.don(s))}get ratio(){return this._ratio.value}set ratio(e){Math.abs(this._ratio.value-e)<.001||(this.currentTime=(this.duration??He.defaults.duration)*e)}get ratioChanged(){return this._ratio.changed}};d(He,"defaults",{loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,channels:!0,ratio:0}),d(He,"channelsReadMe",f0);let Mn=He;(r=>{r.createDefaultProps=()=>({loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,channels:g.reactDeepArrayWithUndefined(void 0,(t,e)=>t==null?void 0:t.every((n,i)=>n===e[i]),t=>[...t])})})(Mn||(Mn={})),g.extendClassProps(Mn.prototype,Mn.createDefaultProps);class Hh extends B{constructor(e){super();d(this,"_sceneObject",this.dv(g.react(void 0)));this._id=e,this.d(()=>{this._sceneObject.value=void 0});const n=K.getSceneObjById(this._id);n&&(this._sceneObject.value=n),this.d(K.context.sceneObjCreatedEvent.don(i=>{i.id===this._id&&(this._sceneObject.value=i)})),this.d(K.context.sceneObjToDestroyEvent.don(i=>{i.id===this._id&&(this._sceneObject.value=void 0)}))}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}get id(){return this._id}}class d0 extends B{constructor(e,n){super();d(this,"_sofi");this._id=e,this._sofi=this.dv(new Hh(this._id));{const i=()=>{n.sceneObject=this._sofi.sceneObject};i(),this.d(this._sofi.sceneObjectChanged.don(i))}}}class p0 extends B{constructor(){super();d(this,"_id",this.dv(g.react(void 0)));d(this,"_sceneObject",this.dv(g.react(void 0)));d(this,"_resetting",this.dv(new g.ObjResettingWithEvent(this.idChanged,()=>{const{id:e}=this;if(e===void 0||e===""){this.sceneObject=void 0;return}return new d0(e,this)})))}get id(){return this._id.value}get idChanged(){return this._id.changed}set id(e){this._id.value=e}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}set sceneObject(e){this._sceneObject.value=e}get resetting(){return this._resetting}}class g0 extends B{constructor(t,e,n,i){super(),this.disposeVar(new g.ObjResettingWithEvent(t.sceneObjectChanged,()=>{let s;i.debug&&console.log("正在获取Event事件...");const o=t.sceneObject;if(o&&e){const a=e.split(".");if(a.length===0)i.debug&&console.warn("propNames.length === 0");else{let u=g.pluckProperty(o,!1,...a);(!u||!(u instanceof V))&&(a[a.length-1]=a[a.length-1]+"Changed",i.debug&&console.warn(`event未能获取,那么将属性名的最后一项加上Changed(${a[a.length-1]})再试试!`),u=g.pluckProperty(o,!1,...a),i.debug&&u&&console.warn("event仍然获取不到!")),u?u instanceof V?(s=u,i.debug&&console.log(`Event获取成功 propChangedName: ${e}`,s)):i.debug&&console.warn(`the prop is not event from ${o.id}-${o.name}-${o.ref}-${e}`):i.debug&&console.warn(`cannot get changed from ${o.id}-${o.name}-${o.ref}-${e}`)}}if(s){const a=new B;return a.d(s.dwon(()=>n.emit())),a}else{i.debug&&console.log(`未获取到Event!propChangedName: ${e}`);return}}))}}const ip=Object.freeze(Object.defineProperty({__proto__:null,WatcherObjects:class extends B{constructor(e,n,i){super();d(this,"_doEvalEvent",this.dv(new V));const s=this._doEvalEvent,o=this.disposeVar(g.createNextAnimateFrameEvent(s)),a=e.map(([u,l])=>{const h=new Hh(u),c=l&&new g0(h,l,s,n)||void 0;return[h,c]});this.d(()=>{a.forEach(([u,l])=>{l==null||l.destroy(),u.destroy()}),a.length=0}),this.d(s.don(()=>{const{evalMode:u="NextAnimateFrame",evalOnlyWhenObjsAllExist:l=!0}=n;if(u==="Immediate"){const h=a.map(([c])=>c.sceneObject);(!l||h.every(c=>c!==void 0))&&i(h)}})),this.d(o.don(()=>{const{evalMode:u="NextAnimateFrame",evalOnlyWhenObjsAllExist:l=!0}=n;if(u==="NextAnimateFrame"){const h=a.map(([c])=>c.sceneObject);(!l||h.every(c=>c!==void 0))&&i(h)}}))}forceExecute(){this._doEvalEvent.emit()}}},Symbol.toStringTag,{value:"Module"})),{WatcherObjects:m0}=ip;class ru extends B{constructor(){super();d(this,"_evalFunc");d(this,"_forceExecute",new V);const e=this.dv(g.react(void 0)),n=()=>{try{e.value=this.evalFuncStr&&Function('"use strict";return ('+this.evalFuncStr+")")(),this.debug&&console.log("evalFunc成功构建",e.value)}catch(o){console.error(`evalFunc get error! ${o}`),e.value=void 0}};n(),this.dispose(this.evalFuncStrChanged.disposableOn(n));const i=o=>{this.enabled&&(this.debug&&console.log("执行evalFunc..."),this._evalFunc&&this._evalFunc(o),e.value&&e.value(o))},s=this.disposeVar(new g.ObjResettingWithEvent(this.objIdAndPropChangedNamesChanged,()=>{if(this.objIdAndPropChangedNames.length>0)return this.debug&&console.log("监视对象发生变化,重新创建WatcherObjects"),new m0(this.objIdAndPropChangedNames,this,i)}));this.dispose(this._forceExecute.disposableOn(()=>{var o;(o=s.obj)==null||o.forceExecute()}))}get evalFunc(){return this._evalFunc}set evalFunc(e){this._evalFunc=e}forceExecute(){this._forceExecute.emit()}}(r=>{r.createDefaultProps=()=>({enabled:!1,objIdAndPropChangedNames:g.reactDeepArray([],(t,e)=>t[0]===e[0]&&t[1]===e[1],t=>[t[0],t[1]]),evalFuncStr:"",evalMode:"NextAnimateFrame",evalOnlyWhenObjsAllExist:!0,debug:!1,name:"未命名场景对象",ref:void 0,extras:g.reactJson(void 0),devTags:g.reactArrayWithUndefined(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})})(ru||(ru={})),g.extendClassProps(ru.prototype,ru.createDefaultProps);function v0(r){r("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),r("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),r("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),r.WGS84=r["EPSG:4326"],r["EPSG:3785"]=r["EPSG:3857"],r.GOOGLE=r["EPSG:3857"],r["EPSG:900913"]=r["EPSG:3857"],r["EPSG:102113"]=r["EPSG:3857"]}var Ds=1,As=2,pl=3,y0=4,Yh=5,sp=6378137,_0=6356752314e-3,op=.0066943799901413165,nu=484813681109536e-20,z=Math.PI/2,w0=.16666666666666666,E0=.04722222222222222,S0=.022156084656084655,X=1e-10,Ue=.017453292519943295,Kn=57.29577951308232,At=Math.PI/4,iu=Math.PI*2,ae=3.14159265359,Er={};Er.greenwich=0,Er.lisbon=-9.131906111111,Er.paris=2.337229166667,Er.bogota=-74.080916666667,Er.madrid=-3.687938888889,Er.rome=12.452333333333,Er.bern=7.439583333333,Er.jakarta=106.807719444444,Er.ferro=-17.666666666667,Er.brussels=4.367975,Er.stockholm=18.058277777778,Er.athens=23.7163375,Er.oslo=10.722916666667;const C0={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var ap=/[\s_\-\/\(\)]/g;function $i(r,t){if(r[t])return r[t];for(var e=Object.keys(r),n=t.toLowerCase().replace(ap,""),i=-1,s,o;++i<e.length;)if(s=e[i],o=s.toLowerCase().replace(ap,""),o===n)return r[s]}function Jh(r){var t={},e=r.split("+").map(function(a){return a.trim()}).filter(function(a){return a}).reduce(function(a,u){var l=u.split("=");return l.push(!0),a[l[0].toLowerCase()]=l[1],a},{}),n,i,s,o={proj:"projName",datum:"datumCode",rf:function(a){t.rf=parseFloat(a)},lat_0:function(a){t.lat0=a*Ue},lat_1:function(a){t.lat1=a*Ue},lat_2:function(a){t.lat2=a*Ue},lat_ts:function(a){t.lat_ts=a*Ue},lon_0:function(a){t.long0=a*Ue},lon_1:function(a){t.long1=a*Ue},lon_2:function(a){t.long2=a*Ue},alpha:function(a){t.alpha=parseFloat(a)*Ue},gamma:function(a){t.rectified_grid_angle=parseFloat(a)},lonc:function(a){t.longc=a*Ue},x_0:function(a){t.x0=parseFloat(a)},y_0:function(a){t.y0=parseFloat(a)},k_0:function(a){t.k0=parseFloat(a)},k:function(a){t.k0=parseFloat(a)},a:function(a){t.a=parseFloat(a)},b:function(a){t.b=parseFloat(a)},r_a:function(){t.R_A=!0},zone:function(a){t.zone=parseInt(a,10)},south:function(){t.utmSouth=!0},towgs84:function(a){t.datum_params=a.split(",").map(function(u){return parseFloat(u)})},to_meter:function(a){t.to_meter=parseFloat(a)},units:function(a){t.units=a;var u=$i(C0,a);u&&(t.to_meter=u.to_meter)},from_greenwich:function(a){t.from_greenwich=a*Ue},pm:function(a){var u=$i(Er,a);t.from_greenwich=(u||parseFloat(a))*Ue},nadgrids:function(a){a==="@null"?t.datumCode="none":t.nadgrids=a},axis:function(a){var u="ewnsud";a.length===3&&u.indexOf(a.substr(0,1))!==-1&&u.indexOf(a.substr(1,1))!==-1&&u.indexOf(a.substr(2,1))!==-1&&(t.axis=a)},approx:function(){t.approx=!0}};for(n in e)i=e[n],n in o?(s=o[n],typeof s=="function"?s(i):t[s]=i):t[n]=i;return typeof t.datumCode=="string"&&t.datumCode!=="WGS84"&&(t.datumCode=t.datumCode.toLowerCase()),t}class up{static getId(t){const e=t.find(n=>Array.isArray(n)&&n[0]==="ID");return e&&e.length>=3?{authority:e[1],code:parseInt(e[2],10)}:null}static convertUnit(t,e="unit"){if(!t||t.length<3)return{type:e,name:"unknown",conversion_factor:null};const n=t[1],i=parseFloat(t[2])||null,s=t.find(a=>Array.isArray(a)&&a[0]==="ID"),o=s?{authority:s[1],code:parseInt(s[2],10)}:null;return{type:e,name:n,conversion_factor:i,id:o}}static convertAxis(t){const e=t[1]||"Unknown";let n;const i=e.match(/^\((.)\)$/);if(i){const l=i[1].toUpperCase();if(l==="E")n="east";else if(l==="N")n="north";else if(l==="U")n="up";else throw new Error(`Unknown axis abbreviation: ${l}`)}else n=t[2]?t[2].toLowerCase():"unknown";const s=t.find(l=>Array.isArray(l)&&l[0]==="ORDER"),o=s?parseInt(s[1],10):null,a=t.find(l=>Array.isArray(l)&&(l[0]==="LENGTHUNIT"||l[0]==="ANGLEUNIT"||l[0]==="SCALEUNIT")),u=this.convertUnit(a);return{name:e,direction:n,unit:u,order:o}}static extractAxes(t){return t.filter(e=>Array.isArray(e)&&e[0]==="AXIS").map(e=>this.convertAxis(e)).sort((e,n)=>(e.order||0)-(n.order||0))}static convert(t,e={}){switch(t[0]){case"PROJCRS":e.type="ProjectedCRS",e.name=t[1],e.base_crs=t.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")):null,e.conversion=t.find(f=>Array.isArray(f)&&f[0]==="CONVERSION")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="CONVERSION")):null;const n=t.find(f=>Array.isArray(f)&&f[0]==="CS");n&&(e.coordinate_system={type:n[1],axis:this.extractAxes(t)});const i=t.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT");if(i){const f=this.convertUnit(i);e.coordinate_system.unit=f}e.id=this.getId(t);break;case"BASEGEOGCRS":case"GEOGCRS":e.type="GeographicCRS",e.name=t[1];const s=t.find(f=>Array.isArray(f)&&(f[0]==="DATUM"||f[0]==="ENSEMBLE"));if(s){const f=this.convert(s);s[0]==="ENSEMBLE"?e.datum_ensemble=f:e.datum=f;const p=t.find(m=>Array.isArray(m)&&m[0]==="PRIMEM");p&&p[1]!=="Greenwich"&&(f.prime_meridian={name:p[1],longitude:parseFloat(p[2])})}e.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(t)},e.id=this.getId(t);break;case"DATUM":e.type="GeodeticReferenceFrame",e.name=t[1],e.ellipsoid=t.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":e.type="DatumEnsemble",e.name=t[1],e.members=t.filter(f=>Array.isArray(f)&&f[0]==="MEMBER").map(f=>({type:"DatumEnsembleMember",name:f[1],id:this.getId(f)}));const o=t.find(f=>Array.isArray(f)&&f[0]==="ENSEMBLEACCURACY");o&&(e.accuracy=parseFloat(o[1]));const a=t.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID");a&&(e.ellipsoid=this.convert(a)),e.id=this.getId(t);break;case"ELLIPSOID":e.type="Ellipsoid",e.name=t[1],e.semi_major_axis=parseFloat(t[2]),e.inverse_flattening=parseFloat(t[3]),t.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT")&&this.convert(t.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT"),e);break;case"CONVERSION":e.type="Conversion",e.name=t[1],e.method=t.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,e.parameters=t.filter(f=>Array.isArray(f)&&f[0]==="PARAMETER").map(f=>this.convert(f));break;case"METHOD":e.type="Method",e.name=t[1],e.id=this.getId(t);break;case"PARAMETER":e.type="Parameter",e.name=t[1],e.value=parseFloat(t[2]),e.unit=this.convertUnit(t.find(f=>Array.isArray(f)&&(f[0]==="LENGTHUNIT"||f[0]==="ANGLEUNIT"||f[0]==="SCALEUNIT"))),e.id=this.getId(t);break;case"BOUNDCRS":e.type="BoundCRS";const u=t.find(f=>Array.isArray(f)&&f[0]==="SOURCECRS");if(u){const f=u.find(p=>Array.isArray(p));e.source_crs=f?this.convert(f):null}const l=t.find(f=>Array.isArray(f)&&f[0]==="TARGETCRS");if(l){const f=l.find(p=>Array.isArray(p));e.target_crs=f?this.convert(f):null}const h=t.find(f=>Array.isArray(f)&&f[0]==="ABRIDGEDTRANSFORMATION");h?e.transformation=this.convert(h):e.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(e.type="Transformation",e.name=t[1],e.method=t.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,e.parameters=t.filter(f=>Array.isArray(f)&&(f[0]==="PARAMETER"||f[0]==="PARAMETERFILE")).map(f=>{if(f[0]==="PARAMETER")return this.convert(f);if(f[0]==="PARAMETERFILE")return{name:f[1],value:f[2],id:{authority:"EPSG",code:8656}}}),e.parameters.length===7){const f=e.parameters[6];f.name==="Scale difference"&&(f.value=Math.round((f.value-1)*1e12)/1e6)}e.id=this.getId(t);break;case"AXIS":e.coordinate_system||(e.coordinate_system={type:"unspecified",axis:[]}),e.coordinate_system.axis.push(this.convertAxis(t));break;case"LENGTHUNIT":const c=this.convertUnit(t,"LinearUnit");e.coordinate_system&&e.coordinate_system.axis&&e.coordinate_system.axis.forEach(f=>{f.unit||(f.unit=c)}),c.conversion_factor&&c.conversion_factor!==1&&e.semi_major_axis&&(e.semi_major_axis={value:e.semi_major_axis,unit:c});break;default:e.keyword=t[0];break}return e}}class I0 extends up{static convert(t,e={}){return super.convert(t,e),e.coordinate_system&&e.coordinate_system.subtype==="Cartesian"&&delete e.coordinate_system,e.usage&&delete e.usage,e}}class P0 extends up{static convert(t,e={}){super.convert(t,e);const n=t.find(s=>Array.isArray(s)&&s[0]==="CS");n&&(e.coordinate_system={subtype:n[1],axis:this.extractAxes(t)});const i=t.find(s=>Array.isArray(s)&&s[0]==="USAGE");if(i){const s=i.find(u=>Array.isArray(u)&&u[0]==="SCOPE"),o=i.find(u=>Array.isArray(u)&&u[0]==="AREA"),a=i.find(u=>Array.isArray(u)&&u[0]==="BBOX");e.usage={},s&&(e.usage.scope=s[1]),o&&(e.usage.area=o[1]),a&&(e.usage.bbox=a.slice(1))}return e}}function M0(r){return r.find(t=>Array.isArray(t)&&t[0]==="USAGE")?"2019":(r.find(t=>Array.isArray(t)&&t[0]==="CS")||r[0]==="BOUNDCRS"||r[0]==="PROJCRS"||r[0]==="GEOGCRS","2015")}function b0(r){return(M0(r)==="2019"?P0:I0).convert(r)}function x0(r){const t=r.toUpperCase();return t.includes("PROJCRS")||t.includes("GEOGCRS")||t.includes("BOUNDCRS")||t.includes("VERTCRS")||t.includes("LENGTHUNIT")||t.includes("ANGLEUNIT")||t.includes("SCALEUNIT")?"WKT2":(t.includes("PROJCS")||t.includes("GEOGCS")||t.includes("LOCAL_CS")||t.includes("VERT_CS")||t.includes("UNIT"),"WKT1")}var su=1,lp=2,hp=3,gl=4,cp=5,jh=-1,N0=/\s/,T0=/[A-Za-z]/,O0=/[A-Za-z84_]/,ml=/[,\]]/,fp=/[\d\.E\-\+]/;function Mi(r){if(typeof r!="string")throw new Error("not a string");this.text=r.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=su}Mi.prototype.readCharicter=function(){var r=this.text[this.place++];if(this.state!==gl)for(;N0.test(r);){if(this.place>=this.text.length)return;r=this.text[this.place++]}switch(this.state){case su:return this.neutral(r);case lp:return this.keyword(r);case gl:return this.quoted(r);case cp:return this.afterquote(r);case hp:return this.number(r);case jh:return}},Mi.prototype.afterquote=function(r){if(r==='"'){this.word+='"',this.state=gl;return}if(ml.test(r)){this.word=this.word.trim(),this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in afterquote yet, index '+this.place)},Mi.prototype.afterItem=function(r){if(r===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=su;return}if(r==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=su,this.currentObject=this.stack.pop(),this.currentObject||(this.state=jh);return}},Mi.prototype.number=function(r){if(fp.test(r)){this.word+=r;return}if(ml.test(r)){this.word=parseFloat(this.word),this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in number yet, index '+this.place)},Mi.prototype.quoted=function(r){if(r==='"'){this.state=cp;return}this.word+=r},Mi.prototype.keyword=function(r){if(O0.test(r)){this.word+=r;return}if(r==="["){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=su;return}if(ml.test(r)){this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in keyword yet, index '+this.place)},Mi.prototype.neutral=function(r){if(T0.test(r)){this.word=r,this.state=lp;return}if(r==='"'){this.word="",this.state=gl;return}if(fp.test(r)){this.word=r,this.state=hp;return}if(ml.test(r)){this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in neutral yet, index '+this.place)},Mi.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===jh)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function D0(r){var t=new Mi(r);return t.output()}function Qh(r,t,e){Array.isArray(t)&&(e.unshift(t),t=null);var n=t?{}:r,i=e.reduce(function(s,o){return Mo(o,s),s},n);t&&(r[t]=i)}function Mo(r,t){if(!Array.isArray(r)){t[r]=!0;return}var e=r.shift();if(e==="PARAMETER"&&(e=r.shift()),r.length===1){if(Array.isArray(r[0])){t[e]={},Mo(r[0],t[e]);return}t[e]=r[0];return}if(!r.length){t[e]=!0;return}if(e==="TOWGS84"){t[e]=r;return}if(e==="AXIS"){e in t||(t[e]=[]),t[e].push(r);return}Array.isArray(e)||(t[e]={});var n;switch(e){case"UNIT":case"PRIMEM":case"VERT_DATUM":t[e]={name:r[0].toLowerCase(),convert:r[1]},r.length===3&&Mo(r[2],t[e]);return;case"SPHEROID":case"ELLIPSOID":t[e]={name:r[0],a:r[1],rf:r[2]},r.length===4&&Mo(r[3],t[e]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":r[0]=["name",r[0]],Qh(t,e,r);return;case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":r[0]=["name",r[0]],Qh(t,e,r),t[e].type=e;return;default:for(n=-1;++n<r.length;)if(!Array.isArray(r[n]))return Mo(r,t[e]);return Qh(t,e,r)}}var A0=.017453292519943295;function bn(r){return r*A0}function dp(r){const t=(r.projName||"").toLowerCase().replace(/_/g," ");!r.long0&&r.longc&&(t==="albers conic equal area"||t==="lambert azimuthal equal area")&&(r.long0=r.longc),!r.lat_ts&&r.lat1&&(t==="stereographic south pole"||t==="polar stereographic (variant b)")?(r.lat0=bn(r.lat1>0?90:-90),r.lat_ts=r.lat1,delete r.lat1):!r.lat_ts&&r.lat0&&(t==="polar stereographic"||t==="polar stereographic (variant a)")&&(r.lat_ts=r.lat0,r.lat0=bn(r.lat0>0?90:-90),delete r.lat1)}function pp(r){let t={units:null,to_meter:void 0};return typeof r=="string"?(t.units=r.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.units==="meter"&&(t.to_meter=1)):r&&r.name&&(t.units=r.name.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.to_meter=r.conversion_factor),t}function gp(r){return typeof r=="object"?r.value*r.unit.conversion_factor:r}function mp(r,t){r.ellipsoid.radius?(t.a=r.ellipsoid.radius,t.rf=0):(t.a=gp(r.ellipsoid.semi_major_axis),r.ellipsoid.inverse_flattening!==void 0?t.rf=r.ellipsoid.inverse_flattening:r.ellipsoid.semi_major_axis!==void 0&&r.ellipsoid.semi_minor_axis!==void 0&&(t.rf=t.a/(t.a-gp(r.ellipsoid.semi_minor_axis))))}function vl(r,t={}){return!r||typeof r!="object"?r:r.type==="BoundCRS"?(vl(r.source_crs,t),r.transformation&&(r.transformation.method&&r.transformation.method.name==="NTv2"?t.nadgrids=r.transformation.parameters[0].value:t.datum_params=r.transformation.parameters.map(e=>e.value)),t):(Object.keys(r).forEach(e=>{const n=r[e];if(n!==null)switch(e){case"name":if(t.srsCode)break;t.name=n,t.srsCode=n;break;case"type":n==="GeographicCRS"?t.projName="longlat":n==="ProjectedCRS"&&r.conversion&&r.conversion.method&&(t.projName=r.conversion.method.name);break;case"datum":case"datum_ensemble":n.ellipsoid&&(t.ellps=n.ellipsoid.name,mp(n,t)),n.prime_meridian&&(t.from_greenwich=n.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":t.ellps=n.name,mp(n,t);break;case"prime_meridian":t.long0=(n.longitude||0)*Math.PI/180;break;case"coordinate_system":if(n.axis){if(t.axis=n.axis.map(i=>{const s=i.direction;if(s==="east")return"e";if(s==="north")return"n";if(s==="west")return"w";if(s==="south")return"s";throw new Error(`Unknown axis direction: ${s}`)}).join("")+"u",n.unit){const{units:i,to_meter:s}=pp(n.unit);t.units=i,t.to_meter=s}else if(n.axis[0]&&n.axis[0].unit){const{units:i,to_meter:s}=pp(n.axis[0].unit);t.units=i,t.to_meter=s}}break;case"id":n.authority&&n.code&&(t.title=n.authority+":"+n.code);break;case"conversion":n.method&&n.method.name&&(t.projName=n.method.name),n.parameters&&n.parameters.forEach(i=>{const s=i.name.toLowerCase().replace(/\s+/g,"_"),o=i.value;i.unit&&i.unit.conversion_factor?t[s]=o*i.unit.conversion_factor:i.unit==="degree"?t[s]=o*Math.PI/180:t[s]=o});break;case"unit":n.name&&(t.units=n.name.toLowerCase(),t.units==="metre"&&(t.units="meter")),n.conversion_factor&&(t.to_meter=n.conversion_factor);break;case"base_crs":vl(n,t),t.datumCode=n.id?n.id.authority+"_"+n.id.code:n.name;break}}),t.latitude_of_false_origin!==void 0&&(t.lat0=t.latitude_of_false_origin),t.longitude_of_false_origin!==void 0&&(t.long0=t.longitude_of_false_origin),t.latitude_of_standard_parallel!==void 0&&(t.lat0=t.latitude_of_standard_parallel,t.lat1=t.latitude_of_standard_parallel),t.latitude_of_1st_standard_parallel!==void 0&&(t.lat1=t.latitude_of_1st_standard_parallel),t.latitude_of_2nd_standard_parallel!==void 0&&(t.lat2=t.latitude_of_2nd_standard_parallel),t.latitude_of_projection_centre!==void 0&&(t.lat0=t.latitude_of_projection_centre),t.longitude_of_projection_centre!==void 0&&(t.longc=t.longitude_of_projection_centre),t.easting_at_false_origin!==void 0&&(t.x0=t.easting_at_false_origin),t.northing_at_false_origin!==void 0&&(t.y0=t.northing_at_false_origin),t.latitude_of_natural_origin!==void 0&&(t.lat0=t.latitude_of_natural_origin),t.longitude_of_natural_origin!==void 0&&(t.long0=t.longitude_of_natural_origin),t.longitude_of_origin!==void 0&&(t.long0=t.longitude_of_origin),t.false_easting!==void 0&&(t.x0=t.false_easting),t.easting_at_projection_centre&&(t.x0=t.easting_at_projection_centre),t.false_northing!==void 0&&(t.y0=t.false_northing),t.northing_at_projection_centre&&(t.y0=t.northing_at_projection_centre),t.standard_parallel_1!==void 0&&(t.lat1=t.standard_parallel_1),t.standard_parallel_2!==void 0&&(t.lat2=t.standard_parallel_2),t.scale_factor_at_natural_origin!==void 0&&(t.k0=t.scale_factor_at_natural_origin),t.scale_factor_at_projection_centre!==void 0&&(t.k0=t.scale_factor_at_projection_centre),t.scale_factor_on_pseudo_standard_parallel!==void 0&&(t.k0=t.scale_factor_on_pseudo_standard_parallel),t.azimuth!==void 0&&(t.alpha=t.azimuth),t.azimuth_at_projection_centre!==void 0&&(t.alpha=t.azimuth_at_projection_centre),t.angle_from_rectified_to_skew_grid&&(t.rectified_grid_angle=t.angle_from_rectified_to_skew_grid),dp(t),t)}var L0=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function R0(r,t){var e=t[0],n=t[1];!(e in r)&&n in r&&(r[e]=r[n],t.length===3&&(r[e]=t[2](r[e])))}function vp(r){for(var t=Object.keys(r),e=0,n=t.length;e<n;++e){var i=t[e];L0.indexOf(i)!==-1&&F0(r[i]),typeof r[i]=="object"&&vp(r[i])}}function F0(r){if(r.AUTHORITY){var t=Object.keys(r.AUTHORITY)[0];t&&t in r.AUTHORITY&&(r.title=t+":"+r.AUTHORITY[t])}if(r.type==="GEOGCS"?r.projName="longlat":r.type==="LOCAL_CS"?(r.projName="identity",r.local=!0):typeof r.PROJECTION=="object"?r.projName=Object.keys(r.PROJECTION)[0]:r.projName=r.PROJECTION,r.AXIS){for(var e="",n=0,i=r.AXIS.length;n<i;++n){var s=[r.AXIS[n][0].toLowerCase(),r.AXIS[n][1].toLowerCase()];s[0].indexOf("north")!==-1||(s[0]==="y"||s[0]==="lat")&&s[1]==="north"?e+="n":s[0].indexOf("south")!==-1||(s[0]==="y"||s[0]==="lat")&&s[1]==="south"?e+="s":s[0].indexOf("east")!==-1||(s[0]==="x"||s[0]==="lon")&&s[1]==="east"?e+="e":(s[0].indexOf("west")!==-1||(s[0]==="x"||s[0]==="lon")&&s[1]==="west")&&(e+="w")}e.length===2&&(e+="u"),e.length===3&&(r.axis=e)}r.UNIT&&(r.units=r.UNIT.name.toLowerCase(),r.units==="metre"&&(r.units="meter"),r.UNIT.convert&&(r.type==="GEOGCS"?r.DATUM&&r.DATUM.SPHEROID&&(r.to_meter=r.UNIT.convert*r.DATUM.SPHEROID.a):r.to_meter=r.UNIT.convert));var o=r.GEOGCS;r.type==="GEOGCS"&&(o=r),o&&(o.DATUM?r.datumCode=o.DATUM.name.toLowerCase():r.datumCode=o.name.toLowerCase(),r.datumCode.slice(0,2)==="d_"&&(r.datumCode=r.datumCode.slice(2)),r.datumCode==="new_zealand_1949"&&(r.datumCode="nzgd49"),(r.datumCode==="wgs_1984"||r.datumCode==="world_geodetic_system_1984")&&(r.PROJECTION==="Mercator_Auxiliary_Sphere"&&(r.sphere=!0),r.datumCode="wgs84"),r.datumCode==="belge_1972"&&(r.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(r.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),r.ellps.toLowerCase().slice(0,13)==="international"&&(r.ellps="intl"),r.a=o.DATUM.SPHEROID.a,r.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(r.datum_params=o.DATUM.TOWGS84),~r.datumCode.indexOf("osgb_1936")&&(r.datumCode="osgb36"),~r.datumCode.indexOf("osni_1952")&&(r.datumCode="osni52"),(~r.datumCode.indexOf("tm65")||~r.datumCode.indexOf("geodetic_datum_of_1965"))&&(r.datumCode="ire65"),r.datumCode==="ch1903+"&&(r.datumCode="ch1903"),~r.datumCode.indexOf("israel")&&(r.datumCode="isr93")),r.b&&!isFinite(r.b)&&(r.b=r.a),r.rectified_grid_angle&&(r.rectified_grid_angle=bn(r.rectified_grid_angle));function a(h){var c=r.to_meter||1;return h*c}var u=function(h){return R0(r,h)},l=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",bn],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",bn],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",bn],["lat0","latitude_of_origin",bn],["lat0","standard_parallel_1",bn],["lat1","standard_parallel_1",bn],["lat2","standard_parallel_2",bn],["azimuth","Azimuth"],["alpha","azimuth",bn],["srsCode","name"]];l.forEach(u),dp(r)}function yp(r){if(typeof r=="object")return vl(r);const t=x0(r);var e=D0(r);if(t==="WKT2"){const s=b0(e);return vl(s)}var n=e[0],i={};return Mo(e,i),vp(i),i[n]}function lr(r){var t=this;if(arguments.length===2){var e=arguments[1];typeof e=="string"?e.charAt(0)==="+"?lr[r]=Jh(arguments[1]):lr[r]=yp(arguments[1]):lr[r]=e}else if(arguments.length===1){if(Array.isArray(r))return r.map(function(n){Array.isArray(n)?lr.apply(t,n):lr(n)});if(typeof r=="string"){if(r in lr)return lr[r]}else"EPSG"in r?lr["EPSG:"+r.EPSG]=r:"ESRI"in r?lr["ESRI:"+r.ESRI]=r:"IAU2000"in r?lr["IAU2000:"+r.IAU2000]=r:console.log(r);return}}v0(lr);function k0(r){return typeof r=="string"}function V0(r){return r in lr}var U0=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function z0(r){return U0.some(function(t){return r.indexOf(t)>-1})}var G0=["3857","900913","3785","102113"];function q0(r){var t=$i(r,"authority");if(t){var e=$i(t,"epsg");return e&&G0.indexOf(e)>-1}}function W0(r){var t=$i(r,"extension");if(t)return $i(t,"proj4")}function X0(r){return r[0]==="+"}function B0(r){if(k0(r)){if(V0(r))return lr[r];if(z0(r)){var t=yp(r);if(q0(t))return lr["EPSG:3857"];var e=W0(t);return e?Jh(e):t}if(X0(r))return Jh(r)}else return r}function _p(r,t){r=r||{};var e,n;if(!t)return r;for(n in t)e=t[n],e!==void 0&&(r[n]=e);return r}function Zn(r,t,e){var n=r*t;return e/Math.sqrt(1-n*n)}function ou(r){return r<0?-1:1}function Y(r){return Math.abs(r)<=ae?r:r-ou(r)*iu}function xn(r,t,e){var n=r*e,i=.5*r;return n=Math.pow((1-n)/(1+n),i),Math.tan(.5*(z-t))/n}function au(r,t){for(var e=.5*r,n,i,s=z-2*Math.atan(t),o=0;o<=15;o++)if(n=r*Math.sin(s),i=z-2*Math.atan(t*Math.pow((1-n)/(1+n),e))-s,s+=i,Math.abs(i)<=1e-10)return s;return-9999}function H0(){var r=this.b/this.a;this.es=1-r*r,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Zn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Y0(r){var t=r.x,e=r.y;if(e*Kn>90&&e*Kn<-90&&t*Kn>180&&t*Kn<-180)return null;var n,i;if(Math.abs(Math.abs(e)-z)<=X)return null;if(this.sphere)n=this.x0+this.a*this.k0*Y(t-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(At+.5*e));else{var s=Math.sin(e),o=xn(this.e,e,s);n=this.x0+this.a*this.k0*Y(t-this.long0),i=this.y0-this.a*this.k0*Math.log(o)}return r.x=n,r.y=i,r}function J0(r){var t=r.x-this.x0,e=r.y-this.y0,n,i;if(this.sphere)i=z-2*Math.atan(Math.exp(-e/(this.a*this.k0)));else{var s=Math.exp(-e/(this.a*this.k0));if(i=au(this.e,s),i===-9999)return null}return n=Y(this.long0+t/(this.a*this.k0)),r.x=n,r.y=i,r}var j0=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const Q0={init:H0,forward:Y0,inverse:J0,names:j0};function $0(){}function wp(r){return r}var K0=["longlat","identity"],Z0=[Q0,{init:$0,forward:wp,inverse:wp,names:K0}],yl={},_l=[];function Ep(r,t){var e=_l.length;return r.names?(_l[e]=r,r.names.forEach(function(n){yl[n.toLowerCase()]=e}),this):(console.log(t),!0)}function t_(r){if(!r)return!1;var t=r.toLowerCase();if(typeof yl[t]<"u"&&_l[yl[t]])return _l[yl[t]]}function e_(){Z0.forEach(Ep)}const r_={start:e_,add:Ep,get:t_};var ct={};ct.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},ct.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},ct.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},ct.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},ct.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},ct.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},ct.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},ct.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},ct.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},ct.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},ct.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},ct.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},ct.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},ct.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},ct.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},ct.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},ct.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},ct.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},ct.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},ct.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},ct.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},ct.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},ct.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},ct.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},ct.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},ct.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},ct.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},ct.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},ct.hough={a:6378270,rf:297,ellipseName:"Hough"},ct.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},ct.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},ct.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},ct.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},ct.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},ct.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},ct.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},ct.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},ct.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},ct.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},ct.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},ct.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var n_=ct.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};ct.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function i_(r,t,e,n){var i=r*r,s=t*t,o=(i-s)/i,a=0;n?(r*=1-o*(w0+o*(E0+o*S0)),i=r*r,o=0):a=Math.sqrt(o);var u=(i-s)/s;return{es:o,e:a,ep2:u}}function s_(r,t,e,n,i){if(!r){var s=$i(ct,n);s||(s=n_),r=s.a,t=s.b,e=s.rf}return e&&!t&&(t=(1-1/e)*r),(e===0||Math.abs(r-t)<X)&&(i=!0,t=r),{a:r,b:t,rf:e,sphere:i}}var Me={};Me.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},Me.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},Me.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},Me.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},Me.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},Me.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},Me.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},Me.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},Me.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},Me.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},Me.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},Me.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},Me.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},Me.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},Me.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},Me.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},Me.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function o_(r,t,e,n,i,s,o){var a={};return r===void 0||r==="none"?a.datum_type=Yh:a.datum_type=y0,t&&(a.datum_params=t.map(parseFloat),(a.datum_params[0]!==0||a.datum_params[1]!==0||a.datum_params[2]!==0)&&(a.datum_type=Ds),a.datum_params.length>3&&(a.datum_params[3]!==0||a.datum_params[4]!==0||a.datum_params[5]!==0||a.datum_params[6]!==0)&&(a.datum_type=As,a.datum_params[3]*=nu,a.datum_params[4]*=nu,a.datum_params[5]*=nu,a.datum_params[6]=a.datum_params[6]/1e6+1)),o&&(a.datum_type=pl,a.grids=o),a.a=e,a.b=n,a.es=i,a.ep2=s,a}var Sp={};function a_(r,t){var e=new DataView(t),n=h_(e),i=c_(e,n);i.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var s=f_(e,i,n),o={header:i,subgrids:s};return Sp[r]=o,o}function u_(r){if(r===void 0)return null;var t=r.split(",");return t.map(l_)}function l_(r){if(r.length===0)return null;var t=r[0]==="@";return t&&(r=r.slice(1)),r==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:r,mandatory:!t,grid:Sp[r]||null,isNull:!1}}function bo(r){return r/3600*Math.PI/180}function h_(r){var t=r.getInt32(8,!1);return t===11?!1:(t=r.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function c_(r,t){return{nFields:r.getInt32(8,t),nSubgridFields:r.getInt32(24,t),nSubgrids:r.getInt32(40,t),shiftType:$h(r,56,64).trim(),fromSemiMajorAxis:r.getFloat64(120,t),fromSemiMinorAxis:r.getFloat64(136,t),toSemiMajorAxis:r.getFloat64(152,t),toSemiMinorAxis:r.getFloat64(168,t)}}function $h(r,t,e){return String.fromCharCode.apply(null,new Uint8Array(r.buffer.slice(t,e)))}function f_(r,t,e){for(var n=176,i=[],s=0;s<t.nSubgrids;s++){var o=p_(r,n,e),a=g_(r,n,o,e),u=Math.round(1+(o.upperLongitude-o.lowerLongitude)/o.longitudeInterval),l=Math.round(1+(o.upperLatitude-o.lowerLatitude)/o.latitudeInterval);i.push({ll:[bo(o.lowerLongitude),bo(o.lowerLatitude)],del:[bo(o.longitudeInterval),bo(o.latitudeInterval)],lim:[u,l],count:o.gridNodeCount,cvs:d_(a)})}return i}function d_(r){return r.map(function(t){return[bo(t.longitudeShift),bo(t.latitudeShift)]})}function p_(r,t,e){return{name:$h(r,t+8,t+16).trim(),parent:$h(r,t+24,t+24+8).trim(),lowerLatitude:r.getFloat64(t+72,e),upperLatitude:r.getFloat64(t+88,e),lowerLongitude:r.getFloat64(t+104,e),upperLongitude:r.getFloat64(t+120,e),latitudeInterval:r.getFloat64(t+136,e),longitudeInterval:r.getFloat64(t+152,e),gridNodeCount:r.getInt32(t+168,e)}}function g_(r,t,e,n){for(var i=t+176,s=16,o=[],a=0;a<e.gridNodeCount;a++){var u={latitudeShift:r.getFloat32(i+a*s,n),longitudeShift:r.getFloat32(i+a*s+4,n),latitudeAccuracy:r.getFloat32(i+a*s+8,n),longitudeAccuracy:r.getFloat32(i+a*s+12,n)};o.push(u)}return o}function ti(r,t){if(!(this instanceof ti))return new ti(r);t=t||function(l){if(l)throw l};var e=B0(r);if(typeof e!="object"){t(r);return}var n=ti.projections.get(e.projName);if(!n){t(r);return}if(e.datumCode&&e.datumCode!=="none"){var i=$i(Me,e.datumCode);i&&(e.datum_params=e.datum_params||(i.towgs84?i.towgs84.split(","):null),e.ellps=i.ellipse,e.datumName=i.datumName?i.datumName:e.datumCode)}e.k0=e.k0||1,e.axis=e.axis||"enu",e.ellps=e.ellps||"wgs84",e.lat1=e.lat1||e.lat0;var s=s_(e.a,e.b,e.rf,e.ellps,e.sphere),o=i_(s.a,s.b,s.rf,e.R_A),a=u_(e.nadgrids),u=e.datum||o_(e.datumCode,e.datum_params,s.a,s.b,o.es,o.ep2,a);_p(this,e),_p(this,n),this.a=s.a,this.b=s.b,this.rf=s.rf,this.sphere=s.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=u,this.init(),t(null,this)}ti.projections=r_,ti.projections.start();function m_(r,t){return r.datum_type!==t.datum_type||r.a!==t.a||Math.abs(r.es-t.es)>5e-11?!1:r.datum_type===Ds?r.datum_params[0]===t.datum_params[0]&&r.datum_params[1]===t.datum_params[1]&&r.datum_params[2]===t.datum_params[2]:r.datum_type===As?r.datum_params[0]===t.datum_params[0]&&r.datum_params[1]===t.datum_params[1]&&r.datum_params[2]===t.datum_params[2]&&r.datum_params[3]===t.datum_params[3]&&r.datum_params[4]===t.datum_params[4]&&r.datum_params[5]===t.datum_params[5]&&r.datum_params[6]===t.datum_params[6]:!0}function Cp(r,t,e){var n=r.x,i=r.y,s=r.z?r.z:0,o,a,u,l;if(i<-z&&i>-1.001*z)i=-z;else if(i>z&&i<1.001*z)i=z;else{if(i<-z)return{x:-1/0,y:-1/0,z:r.z};if(i>z)return{x:1/0,y:1/0,z:r.z}}return n>Math.PI&&(n-=2*Math.PI),a=Math.sin(i),l=Math.cos(i),u=a*a,o=e/Math.sqrt(1-t*u),{x:(o+s)*l*Math.cos(n),y:(o+s)*l*Math.sin(n),z:(o*(1-t)+s)*a}}function Ip(r,t,e,n){var i=1e-12,s=i*i,o=30,a,u,l,h,c,f,p,m,_,E,C,v,y,w=r.x,S=r.y,P=r.z?r.z:0,M,b,D;if(a=Math.sqrt(w*w+S*S),u=Math.sqrt(w*w+S*S+P*P),a/e<i){if(M=0,u/e<i)return b=z,D=-n,{x:r.x,y:r.y,z:r.z}}else M=Math.atan2(S,w);l=P/u,h=a/u,c=1/Math.sqrt(1-t*(2-t)*h*h),m=h*(1-t)*c,_=l*c,y=0;do y++,p=e/Math.sqrt(1-t*_*_),D=a*m+P*_-p*(1-t*_*_),f=t*p/(p+D),c=1/Math.sqrt(1-f*(2-f)*h*h),E=h*(1-f)*c,C=l*c,v=C*m-E*_,m=E,_=C;while(v*v>s&&y<o);return b=Math.atan(C/Math.abs(E)),{x:M,y:b,z:D}}function v_(r,t,e){if(t===Ds)return{x:r.x+e[0],y:r.y+e[1],z:r.z+e[2]};if(t===As){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],l=e[6];return{x:l*(r.x-u*r.y+a*r.z)+n,y:l*(u*r.x+r.y-o*r.z)+i,z:l*(-a*r.x+o*r.y+r.z)+s}}}function y_(r,t,e){if(t===Ds)return{x:r.x-e[0],y:r.y-e[1],z:r.z-e[2]};if(t===As){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],l=e[6],h=(r.x-n)/l,c=(r.y-i)/l,f=(r.z-s)/l;return{x:h+u*c-a*f,y:-u*h+c+o*f,z:a*h-o*c+f}}}function wl(r){return r===Ds||r===As}function __(r,t,e){if(m_(r,t)||r.datum_type===Yh||t.datum_type===Yh)return e;var n=r.a,i=r.es;if(r.datum_type===pl){var s=Pp(r,!1,e);if(s!==0)return;n=sp,i=op}var o=t.a,a=t.b,u=t.es;if(t.datum_type===pl&&(o=sp,a=_0,u=op),i===u&&n===o&&!wl(r.datum_type)&&!wl(t.datum_type))return e;if(e=Cp(e,i,n),wl(r.datum_type)&&(e=v_(e,r.datum_type,r.datum_params)),wl(t.datum_type)&&(e=y_(e,t.datum_type,t.datum_params)),e=Ip(e,u,o,a),t.datum_type===pl){var l=Pp(t,!0,e);if(l!==0)return}return e}function Pp(r,t,e){if(r.grids===null||r.grids.length===0)return console.log("Grid shift grids not found"),-1;for(var n={x:-e.x,y:e.y},i={x:Number.NaN,y:Number.NaN},s=[],o=0;o<r.grids.length;o++){var a=r.grids[o];if(s.push(a.name),a.isNull){i=n;break}if(a.mandatory,a.grid===null){if(a.mandatory)return console.log("Unable to find mandatory grid '"+a.name+"'"),-1;continue}var u=a.grid.subgrids[0],l=(Math.abs(u.del[1])+Math.abs(u.del[0]))/1e4,h=u.ll[0]-l,c=u.ll[1]-l,f=u.ll[0]+(u.lim[0]-1)*u.del[0]+l,p=u.ll[1]+(u.lim[1]-1)*u.del[1]+l;if(!(c>n.y||h>n.x||p<n.y||f<n.x)&&(i=w_(n,t,u),!isNaN(i.x)))break}return isNaN(i.x)?(console.log("Failed to find a grid shift table for location '"+-n.x*Kn+" "+n.y*Kn+" tried: '"+s+"'"),-1):(e.x=-i.x,e.y=i.y,0)}function w_(r,t,e){var n={x:Number.NaN,y:Number.NaN};if(isNaN(r.x))return n;var i={x:r.x,y:r.y};i.x-=e.ll[0],i.y-=e.ll[1],i.x=Y(i.x-Math.PI)+Math.PI;var s=Mp(i,e);if(t){if(isNaN(s.x))return n;s.x=i.x-s.x,s.y=i.y-s.y;var o=9,a=1e-12,u,l;do{if(l=Mp(s,e),isNaN(l.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}u={x:i.x-(l.x+s.x),y:i.y-(l.y+s.y)},s.x+=u.x,s.y+=u.y}while(o--&&Math.abs(u.x)>a&&Math.abs(u.y)>a);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=Y(s.x+e.ll[0]),n.y=s.y+e.ll[1]}else isNaN(s.x)||(n.x=r.x+s.x,n.y=r.y+s.y);return n}function Mp(r,t){var e={x:r.x/t.del[0],y:r.y/t.del[1]},n={x:Math.floor(e.x),y:Math.floor(e.y)},i={x:e.x-1*n.x,y:e.y-1*n.y},s={x:Number.NaN,y:Number.NaN},o;if(n.x<0||n.x>=t.lim[0]||n.y<0||n.y>=t.lim[1])return s;o=n.y*t.lim[0]+n.x;var a={x:t.cvs[o][0],y:t.cvs[o][1]};o++;var u={x:t.cvs[o][0],y:t.cvs[o][1]};o+=t.lim[0];var l={x:t.cvs[o][0],y:t.cvs[o][1]};o--;var h={x:t.cvs[o][0],y:t.cvs[o][1]},c=i.x*i.y,f=i.x*(1-i.y),p=(1-i.x)*(1-i.y),m=(1-i.x)*i.y;return s.x=p*a.x+f*u.x+m*h.x+c*l.x,s.y=p*a.y+f*u.y+m*h.y+c*l.y,s}function bp(r,t,e){var n=e.x,i=e.y,s=e.z||0,o,a,u,l={};for(u=0;u<3;u++)if(!(t&&u===2&&e.z===void 0))switch(u===0?(o=n,"ew".indexOf(r.axis[u])!==-1?a="x":a="y"):u===1?(o=i,"ns".indexOf(r.axis[u])!==-1?a="y":a="x"):(o=s,a="z"),r.axis[u]){case"e":l[a]=o;break;case"w":l[a]=-o;break;case"n":l[a]=o;break;case"s":l[a]=-o;break;case"u":e[a]!==void 0&&(l.z=o);break;case"d":e[a]!==void 0&&(l.z=-o);break;default:return null}return l}function xp(r){var t={x:r[0],y:r[1]};return r.length>2&&(t.z=r[2]),r.length>3&&(t.m=r[3]),t}function E_(r){Np(r.x),Np(r.y)}function Np(r){if(typeof Number.isFinite=="function"){if(Number.isFinite(r))return;throw new TypeError("coordinates must be finite numbers")}if(typeof r!="number"||r!==r||!isFinite(r))throw new TypeError("coordinates must be finite numbers")}function S_(r,t){return(r.datum.datum_type===Ds||r.datum.datum_type===As)&&t.datumCode!=="WGS84"||(t.datum.datum_type===Ds||t.datum.datum_type===As)&&r.datumCode!=="WGS84"}function El(r,t,e,n){var i;if(Array.isArray(e)&&(e=xp(e)),E_(e),r.datum&&t.datum&&S_(r,t)&&(i=new ti("WGS84"),e=El(r,i,e,n),r=i),n&&r.axis!=="enu"&&(e=bp(r,!1,e)),r.projName==="longlat")e={x:e.x*Ue,y:e.y*Ue,z:e.z||0};else if(r.to_meter&&(e={x:e.x*r.to_meter,y:e.y*r.to_meter,z:e.z||0}),e=r.inverse(e),!e)return;if(r.from_greenwich&&(e.x+=r.from_greenwich),e=__(r.datum,t.datum,e),!!e)return t.from_greenwich&&(e={x:e.x-t.from_greenwich,y:e.y,z:e.z||0}),t.projName==="longlat"?e={x:e.x*Kn,y:e.y*Kn,z:e.z||0}:(e=t.forward(e),t.to_meter&&(e={x:e.x/t.to_meter,y:e.y/t.to_meter,z:e.z||0})),n&&t.axis!=="enu"?bp(t,!0,e):e}var Tp=ti("WGS84");function Kh(r,t,e,n){var i,s,o;return Array.isArray(e)?(i=El(r,t,e,n)||{x:NaN,y:NaN},e.length>2?typeof r.name<"u"&&r.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"?typeof i.z=="number"?[i.x,i.y,i.z].concat(e.splice(3)):[i.x,i.y,e[2]].concat(e.splice(3)):[i.x,i.y].concat(e.splice(2)):[i.x,i.y]):(s=El(r,t,e,n),o=Object.keys(e),o.length===2||o.forEach(function(a){if(typeof r.name<"u"&&r.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"){if(a==="x"||a==="y"||a==="z")return}else if(a==="x"||a==="y")return;s[a]=e[a]}),s)}function Op(r){return r instanceof ti?r:r.oProj?r.oProj:ti(r)}function Sr(r,t,e){r=Op(r);var n=!1,i;return typeof t>"u"?(t=r,r=Tp,n=!0):(typeof t.x<"u"||Array.isArray(t))&&(e=t,t=r,r=Tp,n=!0),t=Op(t),e?Kh(r,t,e):(i={forward:function(s,o){return Kh(r,t,s,o)},inverse:function(s,o){return Kh(t,r,s,o)}},n&&(i.oProj=t),i)}var Dp=6,Ap="AJSAJS",Lp="AFAFAF",xo=65,Cr=73,Jr=79,uu=86,lu=90;const C_={forward:Rp,inverse:I_,toPoint:Fp};function Rp(r,t){return t=t||5,b_(P_({lat:r[1],lon:r[0]}),t)}function I_(r){var t=tc(Up(r.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function Fp(r){var t=tc(Up(r.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function Zh(r){return r*(Math.PI/180)}function kp(r){return 180*(r/Math.PI)}function P_(r){var t=r.lat,e=r.lon,n=6378137,i=.00669438,s=.9996,o,a,u,l,h,c,f,p=Zh(t),m=Zh(e),_,E;E=Math.floor((e+180)/6)+1,e===180&&(E=60),t>=56&&t<64&&e>=3&&e<12&&(E=32),t>=72&&t<84&&(e>=0&&e<9?E=31:e>=9&&e<21?E=33:e>=21&&e<33?E=35:e>=33&&e<42&&(E=37)),o=(E-1)*6-180+3,_=Zh(o),a=i/(1-i),u=n/Math.sqrt(1-i*Math.sin(p)*Math.sin(p)),l=Math.tan(p)*Math.tan(p),h=a*Math.cos(p)*Math.cos(p),c=Math.cos(p)*(m-_),f=n*((1-i/4-3*i*i/64-5*i*i*i/256)*p-(3*i/8+3*i*i/32+45*i*i*i/1024)*Math.sin(2*p)+(15*i*i/256+45*i*i*i/1024)*Math.sin(4*p)-35*i*i*i/3072*Math.sin(6*p));var C=s*u*(c+(1-l+h)*c*c*c/6+(5-18*l+l*l+72*h-58*a)*c*c*c*c*c/120)+5e5,v=s*(f+u*Math.tan(p)*(c*c/2+(5-l+9*h+4*h*h)*c*c*c*c/24+(61-58*l+l*l+600*h-330*a)*c*c*c*c*c*c/720));return t<0&&(v+=1e7),{northing:Math.round(v),easting:Math.round(C),zoneNumber:E,zoneLetter:M_(t)}}function tc(r){var t=r.northing,e=r.easting,n=r.zoneLetter,i=r.zoneNumber;if(i<0||i>60)return null;var s=.9996,o=6378137,a=.00669438,u,l=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a)),h,c,f,p,m,_,E,C,v,y=e-5e5,w=t;n<"N"&&(w-=1e7),E=(i-1)*6-180+3,u=a/(1-a),_=w/s,C=_/(o*(1-a/4-3*a*a/64-5*a*a*a/256)),v=C+(3*l/2-27*l*l*l/32)*Math.sin(2*C)+(21*l*l/16-55*l*l*l*l/32)*Math.sin(4*C)+151*l*l*l/96*Math.sin(6*C),h=o/Math.sqrt(1-a*Math.sin(v)*Math.sin(v)),c=Math.tan(v)*Math.tan(v),f=u*Math.cos(v)*Math.cos(v),p=o*(1-a)/Math.pow(1-a*Math.sin(v)*Math.sin(v),1.5),m=y/(h*s);var S=v-h*Math.tan(v)/p*(m*m/2-(5+3*c+10*f-4*f*f-9*u)*m*m*m*m/24+(61+90*c+298*f+45*c*c-252*u-3*f*f)*m*m*m*m*m*m/720);S=kp(S);var P=(m-(1+2*c+f)*m*m*m/6+(5-2*f+28*c-3*f*f+8*u+24*c*c)*m*m*m*m*m/120)/Math.cos(v);P=E+kp(P);var M;if(r.accuracy){var b=tc({northing:r.northing+r.accuracy,easting:r.easting+r.accuracy,zoneLetter:r.zoneLetter,zoneNumber:r.zoneNumber});M={top:b.lat,right:b.lon,bottom:S,left:P}}else M={lat:S,lon:P};return M}function M_(r){var t="Z";return 84>=r&&r>=72?t="X":72>r&&r>=64?t="W":64>r&&r>=56?t="V":56>r&&r>=48?t="U":48>r&&r>=40?t="T":40>r&&r>=32?t="S":32>r&&r>=24?t="R":24>r&&r>=16?t="Q":16>r&&r>=8?t="P":8>r&&r>=0?t="N":0>r&&r>=-8?t="M":-8>r&&r>=-16?t="L":-16>r&&r>=-24?t="K":-24>r&&r>=-32?t="J":-32>r&&r>=-40?t="H":-40>r&&r>=-48?t="G":-48>r&&r>=-56?t="F":-56>r&&r>=-64?t="E":-64>r&&r>=-72?t="D":-72>r&&r>=-80&&(t="C"),t}function b_(r,t){var e="00000"+r.easting,n="00000"+r.northing;return r.zoneNumber+r.zoneLetter+x_(r.easting,r.northing,r.zoneNumber)+e.substr(e.length-5,t)+n.substr(n.length-5,t)}function x_(r,t,e){var n=Vp(e),i=Math.floor(r/1e5),s=Math.floor(t/1e5)%20;return N_(i,s,n)}function Vp(r){var t=r%Dp;return t===0&&(t=Dp),t}function N_(r,t,e){var n=e-1,i=Ap.charCodeAt(n),s=Lp.charCodeAt(n),o=i+r-1,a=s+t,u=!1;o>lu&&(o=o-lu+xo-1,u=!0),(o===Cr||i<Cr&&o>Cr||(o>Cr||i<Cr)&&u)&&o++,(o===Jr||i<Jr&&o>Jr||(o>Jr||i<Jr)&&u)&&(o++,o===Cr&&o++),o>lu&&(o=o-lu+xo-1),a>uu?(a=a-uu+xo-1,u=!0):u=!1,(a===Cr||s<Cr&&a>Cr||(a>Cr||s<Cr)&&u)&&a++,(a===Jr||s<Jr&&a>Jr||(a>Jr||s<Jr)&&u)&&(a++,a===Cr&&a++),a>uu&&(a=a-uu+xo-1);var l=String.fromCharCode(o)+String.fromCharCode(a);return l}function Up(r){if(r&&r.length===0)throw"MGRSPoint coverting from nothing";for(var t=r.length,e=null,n="",i,s=0;!/[A-Z]/.test(i=r.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+r;n+=i,s++}var o=parseInt(n,10);if(s===0||s+3>t)throw"MGRSPoint bad conversion from: "+r;var a=r.charAt(s++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O")throw"MGRSPoint zone letter "+a+" not handled: "+r;e=r.substring(s,s+=2);for(var u=Vp(o),l=T_(e.charAt(0),u),h=O_(e.charAt(1),u);h<D_(a);)h+=2e6;var c=t-s;if(c%2!==0)throw`MGRSPoint has to have an even number
42
+ of digits after the zone letter and two 100km letters - front
43
+ half for easting meters, second half for
44
+ northing meters`+r;var f=c/2,p=0,m=0,_,E,C,v,y;return f>0&&(_=1e5/Math.pow(10,f),E=r.substring(s,s+f),p=parseFloat(E)*_,C=r.substring(s+f),m=parseFloat(C)*_),v=p+l,y=m+h,{easting:v,northing:y,zoneLetter:a,zoneNumber:o,accuracy:_}}function T_(r,t){for(var e=Ap.charCodeAt(t-1),n=1e5,i=!1;e!==r.charCodeAt(0);){if(e++,e===Cr&&e++,e===Jr&&e++,e>lu){if(i)throw"Bad character: "+r;e=xo,i=!0}n+=1e5}return n}function O_(r,t){if(r>"V")throw"MGRSPoint given invalid Northing "+r;for(var e=Lp.charCodeAt(t-1),n=0,i=!1;e!==r.charCodeAt(0);){if(e++,e===Cr&&e++,e===Jr&&e++,e>uu){if(i)throw"Bad character: "+r;e=xo,i=!0}n+=1e5}return n}function D_(r){var t;switch(r){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+r}function No(r,t,e){if(!(this instanceof No))return new No(r,t,e);if(Array.isArray(r))this.x=r[0],this.y=r[1],this.z=r[2]||0;else if(typeof r=="object")this.x=r.x,this.y=r.y,this.z=r.z||0;else if(typeof r=="string"&&typeof t>"u"){var n=r.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=r,this.y=t,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}No.fromMGRS=function(r){return new No(Fp(r))},No.prototype.toMGRS=function(r){return Rp([this.x,this.y],r)};var A_=1,L_=.25,zp=.046875,Gp=.01953125,qp=.01068115234375,R_=.75,F_=.46875,k_=.013020833333333334,V_=.007120768229166667,U_=.3645833333333333,z_=.005696614583333333,G_=.3076171875;function Wp(r){var t=[];t[0]=A_-r*(L_+r*(zp+r*(Gp+r*qp))),t[1]=r*(R_-r*(zp+r*(Gp+r*qp)));var e=r*r;return t[2]=e*(F_-r*(k_+r*V_)),e*=r,t[3]=e*(U_-r*z_),t[4]=e*r*G_,t}function Sl(r,t,e,n){return e*=t,t*=t,n[0]*r-e*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}var q_=20;function Xp(r,t,e){for(var n=1/(1-t),i=r,s=q_;s;--s){var o=Math.sin(i),a=1-t*o*o;if(a=(Sl(i,o,Math.cos(i),e)-r)*(a*Math.sqrt(a))*n,i-=a,Math.abs(a)<X)return i}return i}function W_(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=Wp(this.es),this.ml0=Sl(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function X_(r){var t=r.x,e=r.y,n=Y(t-this.long0),i,s,o,a=Math.sin(e),u=Math.cos(e);if(this.es){var h=u*n,c=Math.pow(h,2),f=this.ep2*Math.pow(u,2),p=Math.pow(f,2),m=Math.abs(u)>X?Math.tan(e):0,_=Math.pow(m,2),E=Math.pow(_,2);i=1-this.es*Math.pow(a,2),h=h/Math.sqrt(i);var C=Sl(e,a,u,this.en);s=this.a*(this.k0*h*(1+c/6*(1-_+f+c/20*(5-18*_+E+14*f-58*_*f+c/42*(61+179*E-E*_-479*_)))))+this.x0,o=this.a*(this.k0*(C-this.ml0+a*n*h/2*(1+c/12*(5-_+9*f+4*p+c/30*(61+E-58*_+270*f-330*_*f+c/56*(1385+543*E-E*_-3111*_))))))+this.y0}else{var l=u*Math.sin(n);if(Math.abs(Math.abs(l)-1)<X)return 93;if(s=.5*this.a*this.k0*Math.log((1+l)/(1-l))+this.x0,o=u*Math.cos(n)/Math.sqrt(1-Math.pow(l,2)),l=Math.abs(o),l>=1){if(l-1>X)return 93;o=0}else o=Math.acos(o);e<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return r.x=s,r.y=o,r}function B_(r){var t,e,n,i,s=(r.x-this.x0)*(1/this.a),o=(r.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,e=Xp(t,this.es,this.en),Math.abs(e)<z){var c=Math.sin(e),f=Math.cos(e),p=Math.abs(f)>X?Math.tan(e):0,m=this.ep2*Math.pow(f,2),_=Math.pow(m,2),E=Math.pow(p,2),C=Math.pow(E,2);t=1-this.es*Math.pow(c,2);var v=s*Math.sqrt(t)/this.k0,y=Math.pow(v,2);t=t*p,n=e-t*y/(1-this.es)*.5*(1-y/12*(5+3*E-9*m*E+m-4*_-y/30*(61+90*E-252*m*E+45*C+46*m-y/56*(1385+3633*E+4095*C+1574*C*E)))),i=Y(this.long0+v*(1-y/6*(1+2*E+m-y/20*(5+28*E+24*C+8*m*E+6*m-y/42*(61+662*E+1320*C+720*C*E))))/f)}else n=z*ou(o),i=0;else{var a=Math.exp(s/this.k0),u=.5*(a-1/a),l=this.lat0+o/this.k0,h=Math.cos(l);t=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(u,2))),n=Math.asin(t),o<0&&(n=-n),u===0&&h===0?i=0:i=Y(Math.atan2(u,h)+this.long0)}return r.x=i,r.y=n,r}var H_=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const Cl={init:W_,forward:X_,inverse:B_,names:H_};function Bp(r){var t=Math.exp(r);return t=(t-1/t)/2,t}function Nn(r,t){r=Math.abs(r),t=Math.abs(t);var e=Math.max(r,t),n=Math.min(r,t)/(e||1);return e*Math.sqrt(1+Math.pow(n,2))}function Y_(r){var t=1+r,e=t-1;return e===0?r:r*Math.log(t)/e}function J_(r){var t=Math.abs(r);return t=Y_(t*(1+t/(Nn(1,t)+1))),r<0?-t:t}function ec(r,t){for(var e=2*Math.cos(2*t),n=r.length-1,i=r[n],s=0,o;--n>=0;)o=-s+e*i+r[n],s=i,i=o;return t+o*Math.sin(2*t)}function j_(r,t){for(var e=2*Math.cos(t),n=r.length-1,i=r[n],s=0,o;--n>=0;)o=-s+e*i+r[n],s=i,i=o;return Math.sin(t)*o}function Q_(r){var t=Math.exp(r);return t=(t+1/t)/2,t}function Hp(r,t,e){for(var n=Math.sin(t),i=Math.cos(t),s=Bp(e),o=Q_(e),a=2*i*o,u=-2*n*s,l=r.length-1,h=r[l],c=0,f=0,p=0,m,_;--l>=0;)m=f,_=c,f=h,c=p,h=-m+a*f-u*c+r[l],p=-_+u*f+a*c;return a=n*o,u=i*s,[a*h-u*p,a*p+u*h]}function $_(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Cl.init.apply(this),this.forward=Cl.forward,this.inverse=Cl.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var r=this.es/(1+Math.sqrt(1-this.es)),t=r/(2-r),e=t;this.cgb[0]=t*(2+t*(-.6666666666666666+t*(-2+t*(2.577777777777778+t*(.5777777777777777+t*-4.228148148148148))))),this.cbg[0]=t*(-2+t*(.6666666666666666+t*(1.3333333333333333+t*(-1.8222222222222222+t*(.7111111111111111+t*.9824338624338624))))),e=e*t,this.cgb[1]=e*(2.3333333333333335+t*(-1.6+t*(-5.044444444444444+t*(8.584126984126984+t*2.458201058201058)))),this.cbg[1]=e*(1.6666666666666667+t*(-1.0666666666666667+t*(-1.4444444444444444+t*(2.86984126984127+t*-1.6105820105820106)))),e=e*t,this.cgb[2]=e*(3.7333333333333334+t*(-3.8857142857142857+t*(-12.019047619047619+t*26.03668430335097))),this.cbg[2]=e*(-1.7333333333333334+t*(1.619047619047619+t*(1.6+t*-4.474779541446208))),e=e*t,this.cgb[3]=e*(6.792063492063492+t*(-9.485714285714286+t*-28.188500881834216)),this.cbg[3]=e*(1.9634920634920634+t*(-2.4+t*-1.7518165784832451)),e=e*t,this.cgb[4]=e*(13.250793650793652+t*-23.22238255571589),this.cbg[4]=e*(-2.3301587301587303+t*3.5144460477793813),e=e*t,this.cgb[5]=e*27.011268237934903,this.cbg[5]=e*2.8496841430174764,e=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+e*(.25+e*(.015625+e/256))),this.utg[0]=t*(-.5+t*(.6666666666666666+t*(-.3854166666666667+t*(.002777777777777778+t*(.158203125+t*-.15905919312169312))))),this.gtu[0]=t*(.5+t*(-.6666666666666666+t*(.3125+t*(.22777777777777777+t*(-.4409722222222222+t*.20875661375661375))))),this.utg[1]=e*(-.020833333333333332+t*(-.06666666666666667+t*(.3034722222222222+t*(-.4380952380952381+t*.2890188388723545)))),this.gtu[1]=e*(.2708333333333333+t*(-.6+t*(.38680555555555557+t*(.44603174603174606+t*-1.0248393063822752)))),e=e*t,this.utg[2]=e*(-.035416666666666666+t*(.04404761904761905+t*(.046651785714285715+t*-.06138668430335097))),this.gtu[2]=e*(.25416666666666665+t*(-.7357142857142858+t*(.5603050595238095+t*.9237378747795415))),e=e*t,this.utg[3]=e*(-.02726314484126984+t*(.021825396825396824+t*.11439745921516754)),this.gtu[3]=e*(.30729786706349205+t*(-1.0654761904761905+t*.9096203979276896)),e=e*t,this.utg[4]=e*(-.02841641865079365+t*.027268468414301746),this.gtu[4]=e*(.4306671626984127+t*-1.713007555715889),e=e*t,this.utg[5]=e*-.03233083094085698,this.gtu[5]=e*.6650675310896665;var n=ec(this.cbg,this.lat0);this.Zb=-this.Qn*(n+j_(this.gtu,2*n))}function K_(r){var t=Y(r.x-this.long0),e=r.y;e=ec(this.cbg,e);var n=Math.sin(e),i=Math.cos(e),s=Math.sin(t),o=Math.cos(t);e=Math.atan2(n,o*i),t=Math.atan2(s*i,Nn(n,i*o)),t=J_(Math.tan(t));var a=Hp(this.gtu,2*e,2*t);e=e+a[0],t=t+a[1];var u,l;return Math.abs(t)<=2.623395162778?(u=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*e+this.Zb)+this.y0):(u=1/0,l=1/0),r.x=u,r.y=l,r}function Z_(r){var t=(r.x-this.x0)*(1/this.a),e=(r.y-this.y0)*(1/this.a);e=(e-this.Zb)/this.Qn,t=t/this.Qn;var n,i;if(Math.abs(t)<=2.623395162778){var s=Hp(this.utg,2*e,2*t);e=e+s[0],t=t+s[1],t=Math.atan(Bp(t));var o=Math.sin(e),a=Math.cos(e),u=Math.sin(t),l=Math.cos(t);e=Math.atan2(o*l,Nn(u,l*a)),t=Math.atan2(u,l*a),n=Y(t+this.long0),i=ec(this.cgb,e)}else n=1/0,i=1/0;return r.x=n,r.y=i,r}var t1=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"];const Il={init:$_,forward:K_,inverse:Z_,names:t1};function e1(r,t){if(r===void 0){if(r=Math.floor((Y(t)+Math.PI)*30/Math.PI)+1,r<0)return 0;if(r>60)return 60}return r}var r1="etmerc";function n1(){var r=e1(this.zone,this.long0);if(r===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(r)-183)*Ue,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Il.init.apply(this),this.forward=Il.forward,this.inverse=Il.inverse}var i1=["Universal Transverse Mercator System","utm"];const s1={init:n1,names:i1,dependsOn:r1};function rc(r,t){return Math.pow((1-r)/(1+r),t)}var o1=20;function a1(){var r=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*r*r),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(r/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+At)/(Math.pow(Math.tan(.5*this.lat0+At),this.C)*rc(this.e*r,this.ratexp))}function u1(r){var t=r.x,e=r.y;return r.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+At),this.C)*rc(this.e*Math.sin(e),this.ratexp))-z,r.x=this.C*t,r}function l1(r){for(var t=1e-14,e=r.x/this.C,n=r.y,i=Math.pow(Math.tan(.5*n+At)/this.K,1/this.C),s=o1;s>0&&(n=2*Math.atan(i*rc(this.e*Math.sin(r.y),-.5*this.e))-z,!(Math.abs(n-r.y)<t));--s)r.y=n;return s?(r.x=e,r.y=n,r):null}const nc={init:a1,forward:u1,inverse:l1};function h1(){nc.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function c1(r){var t,e,n,i;return r.x=Y(r.x-this.long0),nc.forward.apply(this,[r]),t=Math.sin(r.y),e=Math.cos(r.y),n=Math.cos(r.x),i=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*e*n),r.x=i*e*Math.sin(r.x),r.y=i*(this.cosc0*t-this.sinc0*e*n),r.x=this.a*r.x+this.x0,r.y=this.a*r.y+this.y0,r}function f1(r){var t,e,n,i,s;if(r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,r.x/=this.k0,r.y/=this.k0,s=Math.sqrt(r.x*r.x+r.y*r.y)){var o=2*Math.atan2(s,this.R2);t=Math.sin(o),e=Math.cos(o),i=Math.asin(e*this.sinc0+r.y*t*this.cosc0/s),n=Math.atan2(r.x*t,s*this.cosc0*e-r.y*this.sinc0*t)}else i=this.phic0,n=0;return r.x=n,r.y=i,nc.inverse.apply(this,[r]),r.x=Y(r.x+this.long0),r}var d1=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const p1={init:h1,forward:c1,inverse:f1,names:d1};function g1(r,t,e){return t*=e,Math.tan(.5*(z+r))*Math.pow((1-t)/(1+t),.5*e)}function m1(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=X&&(this.k0=.5*(1+ou(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=X&&(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)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=X&&(this.k0=.5*this.cons*Zn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/xn(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Zn(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-z,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function v1(r){var t=r.x,e=r.y,n=Math.sin(e),i=Math.cos(e),s,o,a,u,l,h,c=Y(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=X&&Math.abs(e+this.lat0)<=X?(r.x=NaN,r.y=NaN,r):this.sphere?(s=2*this.k0/(1+this.sinlat0*n+this.coslat0*i*Math.cos(c)),r.x=this.a*s*i*Math.sin(c)+this.x0,r.y=this.a*s*(this.coslat0*n-this.sinlat0*i*Math.cos(c))+this.y0,r):(o=2*Math.atan(this.ssfn_(e,n,this.e))-z,u=Math.cos(o),a=Math.sin(o),Math.abs(this.coslat0)<=X?(l=xn(this.e,e*this.con,this.con*n),h=2*this.a*this.k0*l/this.cons,r.x=this.x0+h*Math.sin(t-this.long0),r.y=this.y0-this.con*h*Math.cos(t-this.long0),r):(Math.abs(this.sinlat0)<X?(s=2*this.a*this.k0/(1+u*Math.cos(c)),r.y=s*a):(s=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*u*Math.cos(c))),r.y=s*(this.cosX0*a-this.sinX0*u*Math.cos(c))+this.y0),r.x=s*u*Math.sin(c)+this.x0,r))}function y1(r){r.x-=this.x0,r.y-=this.y0;var t,e,n,i,s,o=Math.sqrt(r.x*r.x+r.y*r.y);if(this.sphere){var a=2*Math.atan(o/(2*this.a*this.k0));return t=this.long0,e=this.lat0,o<=X?(r.x=t,r.y=e,r):(e=Math.asin(Math.cos(a)*this.sinlat0+r.y*Math.sin(a)*this.coslat0/o),Math.abs(this.coslat0)<X?this.lat0>0?t=Y(this.long0+Math.atan2(r.x,-1*r.y)):t=Y(this.long0+Math.atan2(r.x,r.y)):t=Y(this.long0+Math.atan2(r.x*Math.sin(a),o*this.coslat0*Math.cos(a)-r.y*this.sinlat0*Math.sin(a))),r.x=t,r.y=e,r)}else if(Math.abs(this.coslat0)<=X){if(o<=X)return e=this.lat0,t=this.long0,r.x=t,r.y=e,r;r.x*=this.con,r.y*=this.con,n=o*this.cons/(2*this.a*this.k0),e=this.con*au(this.e,n),t=this.con*Y(this.con*this.long0+Math.atan2(r.x,-1*r.y))}else i=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=X?s=this.X0:(s=Math.asin(Math.cos(i)*this.sinX0+r.y*Math.sin(i)*this.cosX0/o),t=Y(this.long0+Math.atan2(r.x*Math.sin(i),o*this.cosX0*Math.cos(i)-r.y*this.sinX0*Math.sin(i)))),e=-1*au(this.e,Math.tan(.5*(z+s)));return r.x=t,r.y=e,r}var _1=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"];const w1={init:m1,forward:v1,inverse:y1,names:_1,ssfn_:g1};function E1(){var r=this.lat0;this.lambda0=this.long0;var t=Math.sin(r),e=this.a,n=this.rf,i=1/n,s=2*i-Math.pow(i,2),o=this.e=Math.sqrt(s);this.R=this.k0*e*Math.sqrt(1-s)/(1-s*Math.pow(t,2)),this.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(r),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),u=Math.log(Math.tan(Math.PI/4+r/2)),l=Math.log((1+o*t)/(1-o*t));this.K=a-this.alpha*u+this.alpha*o/2*l}function S1(r){var t=Math.log(Math.tan(Math.PI/4-r.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(r.y))/(1-this.e*Math.sin(r.y))),n=-this.alpha*(t+e)+this.K,i=2*(Math.atan(Math.exp(n))-Math.PI/4),s=this.alpha*(r.x-this.lambda0),o=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(s));return r.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,r.x=this.R*o+this.x0,r}function C1(r){for(var t=r.x-this.x0,e=r.y-this.y0,n=t/this.R,i=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(n)),o=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(i))),a=this.lambda0+o/this.alpha,u=0,l=s,h=-1e3,c=0;Math.abs(l-h)>1e-7;){if(++c>20)return;u=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),h=l,l=2*Math.atan(Math.exp(u))-Math.PI/2}return r.x=a,r.y=l,r}var I1=["somerc"];const P1={init:E1,forward:S1,inverse:C1,names:I1};var To=1e-7;function M1(r){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],e=typeof r.PROJECTION=="object"?Object.keys(r.PROJECTION)[0]:r.PROJECTION;return"no_uoff"in r||"no_off"in r||t.indexOf(e)!==-1}function b1(){var r,t,e,n,i,s,o,a,u,l,h=0,c,f=0,p=0,m=0,_=0,E=0,C=0;this.no_off=M1(this),this.no_rot="no_rot"in this;var v=!1;"alpha"in this&&(v=!0);var y=!1;if("rectified_grid_angle"in this&&(y=!0),v&&(C=this.alpha),y&&(h=this.rectified_grid_angle*Ue),v||y)f=this.longc;else if(p=this.long1,_=this.lat1,m=this.long2,E=this.lat2,Math.abs(_-E)<=To||(r=Math.abs(_))<=To||Math.abs(r-z)<=To||Math.abs(Math.abs(this.lat0)-z)<=To||Math.abs(Math.abs(E)-z)<=To)throw new Error;var w=1-this.es;t=Math.sqrt(w),Math.abs(this.lat0)>X?(a=Math.sin(this.lat0),e=Math.cos(this.lat0),r=1-this.es*a*a,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/w),this.A=this.B*this.k0*t/r,n=this.B*t/(e*Math.sqrt(r)),i=n*n-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=n,this.E*=Math.pow(xn(this.e,this.lat0,a),this.B)):(this.B=1/t,this.A=this.k0,this.E=n=i=1),v||y?(v?(c=Math.asin(Math.sin(C)/n),y||(h=C)):(c=h,C=Math.asin(n*Math.sin(c))),this.lam0=f-Math.asin(.5*(i-1/i)*Math.tan(c))/this.B):(s=Math.pow(xn(this.e,_,Math.sin(_)),this.B),o=Math.pow(xn(this.e,E,Math.sin(E)),this.B),i=this.E/s,u=(o-s)/(o+s),l=this.E*this.E,l=(l-o*s)/(l+o*s),r=p-m,r<-Math.pi?m-=iu:r>Math.pi&&(m+=iu),this.lam0=Y(.5*(p+m)-Math.atan(l*Math.tan(.5*this.B*(p-m))/u)/this.B),c=Math.atan(2*Math.sin(this.B*Y(p-this.lam0))/(i-1/i)),h=C=Math.asin(n*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(h),this.cosrot=Math.cos(h),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(C))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(At-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(At+i))}function x1(r){var t={},e,n,i,s,o,a,u,l;if(r.x=r.x-this.lam0,Math.abs(Math.abs(r.y)-z)>X){if(o=this.E/Math.pow(xn(this.e,r.y,Math.sin(r.y)),this.B),a=1/o,e=.5*(o-a),n=.5*(o+a),s=Math.sin(this.B*r.x),i=(e*this.singam-s*this.cosgam)/n,Math.abs(Math.abs(i)-1)<X)throw new Error;l=.5*this.ArB*Math.log((1-i)/(1+i)),a=Math.cos(this.B*r.x),Math.abs(a)<To?u=this.A*r.x:u=this.ArB*Math.atan2(e*this.cosgam+s*this.singam,a)}else l=r.y>0?this.v_pole_n:this.v_pole_s,u=this.ArB*r.y;return this.no_rot?(t.x=u,t.y=l):(u-=this.u_0,t.x=l*this.cosrot+u*this.sinrot,t.y=u*this.cosrot-l*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function N1(r){var t,e,n,i,s,o,a,u={};if(r.x=(r.x-this.x0)*(1/this.a),r.y=(r.y-this.y0)*(1/this.a),this.no_rot?(e=r.y,t=r.x):(e=r.x*this.cosrot-r.y*this.sinrot,t=r.y*this.cosrot+r.x*this.sinrot+this.u_0),n=Math.exp(-this.BrA*e),i=.5*(n-1/n),s=.5*(n+1/n),o=Math.sin(this.BrA*t),a=(o*this.cosgam+i*this.singam)/s,Math.abs(Math.abs(a)-1)<X)u.x=0,u.y=a<0?-z:z;else{if(u.y=this.E/Math.sqrt((1+a)/(1-a)),u.y=au(this.e,Math.pow(u.y,1/this.B)),u.y===1/0)throw new Error;u.x=-this.rB*Math.atan2(i*this.cosgam-o*this.singam,Math.cos(this.BrA*t))}return u.x+=this.lam0,u}var T1=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const O1={init:b1,forward:x1,inverse:N1,names:T1};function D1(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<X)){var r=this.b/this.a;this.e=Math.sqrt(1-r*r);var t=Math.sin(this.lat1),e=Math.cos(this.lat1),n=Zn(this.e,t,e),i=xn(this.e,this.lat1,t),s=Math.sin(this.lat2),o=Math.cos(this.lat2),a=Zn(this.e,s,o),u=xn(this.e,this.lat2,s),l=xn(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>X?this.ns=Math.log(n/a)/Math.log(i/u):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=n/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function A1(r){var t=r.x,e=r.y;Math.abs(2*Math.abs(e)-Math.PI)<=X&&(e=ou(e)*(z-2*X));var n=Math.abs(Math.abs(e)-z),i,s;if(n>X)i=xn(this.e,e,Math.sin(e)),s=this.a*this.f0*Math.pow(i,this.ns);else{if(n=e*this.ns,n<=0)return null;s=0}var o=this.ns*Y(t-this.long0);return r.x=this.k0*(s*Math.sin(o))+this.x0,r.y=this.k0*(this.rh-s*Math.cos(o))+this.y0,r}function L1(r){var t,e,n,i,s,o=(r.x-this.x0)/this.k0,a=this.rh-(r.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+a*a),e=1):(t=-Math.sqrt(o*o+a*a),e=-1);var u=0;if(t!==0&&(u=Math.atan2(e*o,e*a)),t!==0||this.ns>0){if(e=1/this.ns,n=Math.pow(t/(this.a*this.f0),e),i=au(this.e,n),i===-9999)return null}else i=-z;return s=Y(u/this.ns+this.long0),r.x=s,r.y=i,r}var R1=["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)"];const F1={init:D1,forward:A1,inverse:L1,names:R1};function k1(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.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}function V1(r){var t,e,n,i,s,o,a,u=r.x,l=r.y,h=Y(u-this.long0);return t=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/t)-this.s45),n=-h*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(n)),s=Math.asin(Math.cos(e)*Math.sin(n)/Math.cos(i)),o=this.n*s,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),r.y=a*Math.cos(o)/1,r.x=a*Math.sin(o)/1,this.czech||(r.y*=-1,r.x*=-1),r}function U1(r){var t,e,n,i,s,o,a,u,l=r.x;r.x=r.y,r.y=l,this.czech||(r.y*=-1,r.x*=-1),o=Math.sqrt(r.x*r.x+r.y*r.y),s=Math.atan2(r.y,r.x),i=s/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),e=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(t)),r.x=this.long0-e/this.alfa,a=t,u=0;var h=0;do r.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-r.y)<1e-10&&(u=1),a=r.y,h+=1;while(u===0&&h<15);return h>=15?null:r}var z1=["Krovak","krovak"];const G1={init:k1,forward:V1,inverse:U1,names:z1};function hr(r,t,e,n,i){return r*i-t*Math.sin(2*i)+e*Math.sin(4*i)-n*Math.sin(6*i)}function hu(r){return 1-.25*r*(1+r/16*(3+1.25*r))}function cu(r){return .375*r*(1+.25*r*(1+.46875*r))}function fu(r){return .05859375*r*r*(1+.75*r)}function du(r){return r*r*r*.011393229166666666}function Oo(r,t,e){var n=t*e;return r/Math.sqrt(1-n*n)}function Do(r){return Math.abs(r)<z?r:r-ou(r)*Math.PI}function Pl(r,t,e,n,i){var s,o;s=r/t;for(var a=0;a<15;a++)if(o=(r-(t*s-e*Math.sin(2*s)+n*Math.sin(4*s)-i*Math.sin(6*s)))/(t-2*e*Math.cos(2*s)+4*n*Math.cos(4*s)-6*i*Math.cos(6*s)),s+=o,Math.abs(o)<=1e-10)return s;return NaN}function q1(){this.sphere||(this.e0=hu(this.es),this.e1=cu(this.es),this.e2=fu(this.es),this.e3=du(this.es),this.ml0=this.a*hr(this.e0,this.e1,this.e2,this.e3,this.lat0))}function W1(r){var t,e,n=r.x,i=r.y;if(n=Y(n-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(i)*Math.sin(n)),e=this.a*(Math.atan2(Math.tan(i),Math.cos(n))-this.lat0);else{var s=Math.sin(i),o=Math.cos(i),a=Oo(this.a,this.e,s),u=Math.tan(i)*Math.tan(i),l=n*Math.cos(i),h=l*l,c=this.es*o*o/(1-this.es),f=this.a*hr(this.e0,this.e1,this.e2,this.e3,i);t=a*l*(1-h*u*(.16666666666666666-(8-u+8*c)*h/120)),e=f-this.ml0+a*s/o*h*(.5+(5-u+6*c)*h/24)}return r.x=t+this.x0,r.y=e+this.y0,r}function X1(r){r.x-=this.x0,r.y-=this.y0;var t=r.x/this.a,e=r.y/this.a,n,i;if(this.sphere){var s=e+this.lat0;n=Math.asin(Math.sin(s)*Math.cos(t)),i=Math.atan2(Math.tan(t),Math.cos(s))}else{var o=this.ml0/this.a+e,a=Pl(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-z)<=X)return r.x=this.long0,r.y=z,e<0&&(r.y*=-1),r;var u=Oo(this.a,this.e,Math.sin(a)),l=u*u*u/this.a/this.a*(1-this.es),h=Math.pow(Math.tan(a),2),c=t*this.a/u,f=c*c;n=a-u*Math.tan(a)/l*c*c*(.5-(1+3*h)*c*c/24),i=c*(1-f*(h/3+(1+3*h)*h*f/15))/Math.cos(a)}return r.x=Y(i+this.long0),r.y=Do(n),r}var B1=["Cassini","Cassini_Soldner","cass"];const H1={init:q1,forward:W1,inverse:X1,names:B1};function Ki(r,t){var e;return r>1e-7?(e=r*t,(1-r*r)*(t/(1-e*e)-.5/r*Math.log((1-e)/(1+e)))):2*t}var Y1=1,J1=2,j1=3,Q1=4;function $1(){var r=Math.abs(this.lat0);if(Math.abs(r-z)<X?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(r)<X?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var t;switch(this.qp=Ki(this.e,1),this.mmf=.5/(1-this.es),this.apa=ow(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Ki(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function K1(r){var t,e,n,i,s,o,a,u,l,h,c=r.x,f=r.y;if(c=Y(c-this.long0),this.sphere){if(s=Math.sin(f),h=Math.cos(f),n=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e=this.mode===this.EQUIT?1+h*n:1+this.sinph0*s+this.cosph0*h*n,e<=X)return null;e=Math.sqrt(2/e),t=e*h*Math.sin(c),e*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*h*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(f+this.lat0)<X)return null;e=At-f*.5,e=2*(this.mode===this.S_POLE?Math.cos(e):Math.sin(e)),t=e*Math.sin(c),e*=n}}else{switch(a=0,u=0,l=0,n=Math.cos(c),i=Math.sin(c),s=Math.sin(f),o=Ki(this.e,s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(a=o/this.qp,u=Math.sqrt(1-a*a)),this.mode){case this.OBLIQ:l=1+this.sinb1*a+this.cosb1*u*n;break;case this.EQUIT:l=1+u*n;break;case this.N_POLE:l=z+f,o=this.qp-o;break;case this.S_POLE:l=f-z,o=this.qp+o;break}if(Math.abs(l)<X)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),this.mode===this.OBLIQ?e=this.ymf*l*(this.cosb1*a-this.sinb1*u*n):e=(l=Math.sqrt(2/(1+u*n)))*a*this.ymf,t=this.xmf*l*u*i;break;case this.N_POLE:case this.S_POLE:o>=0?(t=(l=Math.sqrt(o))*i,e=n*(this.mode===this.S_POLE?l:-l)):t=e=0;break}}return r.x=this.a*t+this.x0,r.y=this.a*e+this.y0,r}function Z1(r){r.x-=this.x0,r.y-=this.y0;var t=r.x/this.a,e=r.y/this.a,n,i,s,o,a,u,l;if(this.sphere){var h=0,c,f=0;if(c=Math.sqrt(t*t+e*e),i=c*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(f=Math.sin(i),h=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(c)<=X?0:Math.asin(e*f/c),t*=f,e=h*c;break;case this.OBLIQ:i=Math.abs(c)<=X?this.lat0:Math.asin(h*this.sinph0+e*f*this.cosph0/c),t*=f*this.cosph0,e=(h-Math.sin(i)*this.sinph0)*c;break;case this.N_POLE:e=-e,i=z-i;break;case this.S_POLE:i-=z;break}n=e===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,e)}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,e*=this.dd,u=Math.sqrt(t*t+e*e),u<X)return r.x=this.long0,r.y=this.lat0,r;o=2*Math.asin(.5*u/this.rq),s=Math.cos(o),t*=o=Math.sin(o),this.mode===this.OBLIQ?(l=s*this.sinb1+e*o*this.cosb1/u,a=this.qp*l,e=u*this.cosb1*s-e*this.sinb1*o):(l=e*o/u,a=this.qp*l,e=u*s)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(e=-e),a=t*t+e*e,!a)return r.x=this.long0,r.y=this.lat0,r;l=1-a/this.qp,this.mode===this.S_POLE&&(l=-l)}n=Math.atan2(t,e),i=aw(Math.asin(l),this.apa)}return r.x=Y(this.long0+n),r.y=i,r}var tw=.3333333333333333,ew=.17222222222222222,rw=.10257936507936508,nw=.06388888888888888,iw=.0664021164021164,sw=.016415012942191543;function ow(r){var t,e=[];return e[0]=r*tw,t=r*r,e[0]+=t*ew,e[1]=t*nw,t*=r,e[0]+=t*rw,e[1]+=t*iw,e[2]=t*sw,e}function aw(r,t){var e=r+r;return r+t[0]*Math.sin(e)+t[1]*Math.sin(e+e)+t[2]*Math.sin(e+e+e)}var uw=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const lw={init:$1,forward:K1,inverse:Z1,names:uw,S_POLE:Y1,N_POLE:J1,EQUIT:j1,OBLIQ:Q1};function Zi(r){return Math.abs(r)>1&&(r=r>1?1:-1),Math.asin(r)}function hw(){Math.abs(this.lat1+this.lat2)<X||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Zn(this.e3,this.sin_po,this.cos_po),this.qs1=Ki(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Zn(this.e3,this.sin_po,this.cos_po),this.qs2=Ki(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Ki(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>X?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function cw(r){var t=r.x,e=r.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var n=Ki(this.e3,this.sin_phi,this.cos_phi),i=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,s=this.ns0*Y(t-this.long0),o=i*Math.sin(s)+this.x0,a=this.rh-i*Math.cos(s)+this.y0;return r.x=o,r.y=a,r}function fw(r){var t,e,n,i,s,o;return r.x-=this.x0,r.y=this.rh-r.y+this.y0,this.ns0>=0?(t=Math.sqrt(r.x*r.x+r.y*r.y),n=1):(t=-Math.sqrt(r.x*r.x+r.y*r.y),n=-1),i=0,t!==0&&(i=Math.atan2(n*r.x,n*r.y)),n=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-n*n)/(2*this.ns0)):(e=(this.c-n*n)/this.ns0,o=this.phi1z(this.e3,e)),s=Y(i/this.ns0+this.long0),r.x=s,r.y=o,r}function dw(r,t){var e,n,i,s,o,a=Zi(.5*t);if(r<X)return a;for(var u=r*r,l=1;l<=25;l++)if(e=Math.sin(a),n=Math.cos(a),i=r*e,s=1-i*i,o=.5*s*s/n*(t/(1-u)-e/s+.5/r*Math.log((1-i)/(1+i))),a=a+o,Math.abs(o)<=1e-7)return a;return null}var pw=["Albers_Conic_Equal_Area","Albers","aea"];const gw={init:hw,forward:cw,inverse:fw,names:pw,phi1z:dw};function mw(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function vw(r){var t,e,n,i,s,o,a,u,l=r.x,h=r.y;return n=Y(l-this.long0),t=Math.sin(h),e=Math.cos(h),i=Math.cos(n),o=this.sin_p14*t+this.cos_p14*e*i,s=1,o>0||Math.abs(o)<=X?(a=this.x0+this.a*s*e*Math.sin(n)/o,u=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*i)/o):(a=this.x0+this.infinity_dist*e*Math.sin(n),u=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*e*i)),r.x=a,r.y=u,r}function yw(r){var t,e,n,i,s,o;return r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,r.x/=this.k0,r.y/=this.k0,(t=Math.sqrt(r.x*r.x+r.y*r.y))?(i=Math.atan2(t,this.rc),e=Math.sin(i),n=Math.cos(i),o=Zi(n*this.sin_p14+r.y*e*this.cos_p14/t),s=Math.atan2(r.x*e,t*this.cos_p14*n-r.y*this.sin_p14*e),s=Y(this.long0+s)):(o=this.phic0,s=0),r.x=s,r.y=o,r}var _w=["gnom"];const ww={init:mw,forward:vw,inverse:yw,names:_w};function Ew(r,t){var e=1-(1-r*r)/(2*r)*Math.log((1-r)/(1+r));if(Math.abs(Math.abs(t)-e)<1e-6)return t<0?-1*z:z;for(var n=Math.asin(.5*t),i,s,o,a,u=0;u<30;u++)if(s=Math.sin(n),o=Math.cos(n),a=r*s,i=Math.pow(1-a*a,2)/(2*o)*(t/(1-r*r)-s/(1-a*a)+.5/r*Math.log((1-a)/(1+a))),n+=i,Math.abs(i)<=1e-10)return n;return NaN}function Sw(){this.sphere||(this.k0=Zn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Cw(r){var t=r.x,e=r.y,n,i,s=Y(t-this.long0);if(this.sphere)n=this.x0+this.a*s*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var o=Ki(this.e,Math.sin(e));n=this.x0+this.a*this.k0*s,i=this.y0+this.a*o*.5/this.k0}return r.x=n,r.y=i,r}function Iw(r){r.x-=this.x0,r.y-=this.y0;var t,e;return this.sphere?(t=Y(this.long0+r.x/this.a/Math.cos(this.lat_ts)),e=Math.asin(r.y/this.a*Math.cos(this.lat_ts))):(e=Ew(this.e,2*r.y*this.k0/this.a),t=Y(this.long0+r.x/(this.a*this.k0))),r.x=t,r.y=e,r}var Pw=["cea"];const Mw={init:Sw,forward:Cw,inverse:Iw,names:Pw};function bw(){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)}function xw(r){var t=r.x,e=r.y,n=Y(t-this.long0),i=Do(e-this.lat0);return r.x=this.x0+this.a*n*this.rc,r.y=this.y0+this.a*i,r}function Nw(r){var t=r.x,e=r.y;return r.x=Y(this.long0+(t-this.x0)/(this.a*this.rc)),r.y=Do(this.lat0+(e-this.y0)/this.a),r}var Tw=["Equirectangular","Equidistant_Cylindrical","eqc"];const Ow={init:bw,forward:xw,inverse:Nw,names:Tw};var Yp=20;function Dw(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=hu(this.es),this.e1=cu(this.es),this.e2=fu(this.es),this.e3=du(this.es),this.ml0=this.a*hr(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Aw(r){var t=r.x,e=r.y,n,i,s,o=Y(t-this.long0);if(s=o*Math.sin(e),this.sphere)Math.abs(e)<=X?(n=this.a*o,i=-1*this.a*this.lat0):(n=this.a*Math.sin(s)/Math.tan(e),i=this.a*(Do(e-this.lat0)+(1-Math.cos(s))/Math.tan(e)));else if(Math.abs(e)<=X)n=this.a*o,i=-1*this.ml0;else{var a=Oo(this.a,this.e,Math.sin(e))/Math.tan(e);n=a*Math.sin(s),i=this.a*hr(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+a*(1-Math.cos(s))}return r.x=n+this.x0,r.y=i+this.y0,r}function Lw(r){var t,e,n,i,s,o,a,u,l;if(n=r.x-this.x0,i=r.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=X)t=Y(n/this.a+this.long0),e=0;else{o=this.lat0+i/this.a,a=n*n/this.a/this.a+o*o,u=o;var h;for(s=Yp;s;--s)if(h=Math.tan(u),l=-1*(o*(u*h+1)-u-.5*(u*u+a)*h)/((u-o)/h-1),u+=l,Math.abs(l)<=X){e=u;break}t=Y(this.long0+Math.asin(n*Math.tan(u)/this.a)/Math.sin(e))}else if(Math.abs(i+this.ml0)<=X)e=0,t=Y(this.long0+n/this.a);else{o=(this.ml0+i)/this.a,a=n*n/this.a/this.a+o*o,u=o;var c,f,p,m,_;for(s=Yp;s;--s)if(_=this.e*Math.sin(u),c=Math.sqrt(1-_*_)*Math.tan(u),f=this.a*hr(this.e0,this.e1,this.e2,this.e3,u),p=this.e0-2*this.e1*Math.cos(2*u)+4*this.e2*Math.cos(4*u)-6*this.e3*Math.cos(6*u),m=f/this.a,l=(o*(c*m+1)-m-.5*c*(m*m+a))/(this.es*Math.sin(2*u)*(m*m+a-2*o*m)/(4*c)+(o-m)*(c*p-2/Math.sin(2*u))-p),u-=l,Math.abs(l)<=X){e=u;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),t=Y(this.long0+Math.asin(n*c/this.a)/Math.sin(e))}return r.x=t,r.y=e,r}var Rw=["Polyconic","poly"];const Fw={init:Dw,forward:Aw,inverse:Lw,names:Rw};function kw(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Vw(r){var t,e=r.x,n=r.y,i=n-this.lat0,s=e-this.long0,o=i/nu*1e-5,a=s,u=1,l=0;for(t=1;t<=10;t++)u=u*o,l=l+this.A[t]*u;var h=l,c=a,f=1,p=0,m,_,E=0,C=0;for(t=1;t<=6;t++)m=f*h-p*c,_=p*h+f*c,f=m,p=_,E=E+this.B_re[t]*f-this.B_im[t]*p,C=C+this.B_im[t]*f+this.B_re[t]*p;return r.x=C*this.a+this.x0,r.y=E*this.a+this.y0,r}function Uw(r){var t,e=r.x,n=r.y,i=e-this.x0,s=n-this.y0,o=s/this.a,a=i/this.a,u=1,l=0,h,c,f=0,p=0;for(t=1;t<=6;t++)h=u*o-l*a,c=l*o+u*a,u=h,l=c,f=f+this.C_re[t]*u-this.C_im[t]*l,p=p+this.C_im[t]*u+this.C_re[t]*l;for(var m=0;m<this.iterations;m++){var _=f,E=p,C,v,y=o,w=a;for(t=2;t<=6;t++)C=_*f-E*p,v=E*f+_*p,_=C,E=v,y=y+(t-1)*(this.B_re[t]*_-this.B_im[t]*E),w=w+(t-1)*(this.B_im[t]*_+this.B_re[t]*E);_=1,E=0;var S=this.B_re[1],P=this.B_im[1];for(t=2;t<=6;t++)C=_*f-E*p,v=E*f+_*p,_=C,E=v,S=S+t*(this.B_re[t]*_-this.B_im[t]*E),P=P+t*(this.B_im[t]*_+this.B_re[t]*E);var M=S*S+P*P;f=(y*S+w*P)/M,p=(w*S-y*P)/M}var b=f,D=p,F=1,N=0;for(t=1;t<=9;t++)F=F*b,N=N+this.D[t]*F;var L=this.lat0+N*nu*1e5,A=this.long0+D;return r.x=A,r.y=L,r}var zw=["New_Zealand_Map_Grid","nzmg"];const Gw={init:kw,forward:Vw,inverse:Uw,names:zw};function qw(){}function Ww(r){var t=r.x,e=r.y,n=Y(t-this.long0),i=this.x0+this.a*n,s=this.y0+this.a*Math.log(Math.tan(Math.PI/4+e/2.5))*1.25;return r.x=i,r.y=s,r}function Xw(r){r.x-=this.x0,r.y-=this.y0;var t=Y(this.long0+r.x/this.a),e=2.5*(Math.atan(Math.exp(.8*r.y/this.a))-Math.PI/4);return r.x=t,r.y=e,r}var Bw=["Miller_Cylindrical","mill"];const Hw={init:qw,forward:Ww,inverse:Xw,names:Bw};var Yw=20;function Jw(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Wp(this.es)}function jw(r){var t,e,n=r.x,i=r.y;if(n=Y(n-this.long0),this.sphere){if(!this.m)i=this.n!==1?Math.asin(this.n*Math.sin(i)):i;else for(var s=this.n*Math.sin(i),o=Yw;o;--o){var a=(this.m*i+Math.sin(i)-s)/(this.m+Math.cos(i));if(i-=a,Math.abs(a)<X)break}t=this.a*this.C_x*n*(this.m+Math.cos(i)),e=this.a*this.C_y*i}else{var u=Math.sin(i),l=Math.cos(i);e=this.a*Sl(i,u,l,this.en),t=this.a*n*l/Math.sqrt(1-this.es*u*u)}return r.x=t,r.y=e,r}function Qw(r){var t,e,n,i;return r.x-=this.x0,n=r.x/this.a,r.y-=this.y0,t=r.y/this.a,this.sphere?(t/=this.C_y,n=n/(this.C_x*(this.m+Math.cos(t))),this.m?t=Zi((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=Zi(Math.sin(t)/this.n)),n=Y(n+this.long0),t=Do(t)):(t=Xp(r.y/this.a,this.es,this.en),i=Math.abs(t),i<z?(i=Math.sin(t),e=this.long0+r.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(t)),n=Y(e)):i-X<z&&(n=this.long0)),r.x=n,r.y=t,r}var $w=["Sinusoidal","sinu"];const Kw={init:Jw,forward:jw,inverse:Qw,names:$w};function Zw(){}function tE(r){for(var t=r.x,e=r.y,n=Y(t-this.long0),i=e,s=Math.PI*Math.sin(e);;){var o=-(i+Math.sin(i)-s)/(1+Math.cos(i));if(i+=o,Math.abs(o)<X)break}i/=2,Math.PI/2-Math.abs(e)<X&&(n=0);var a=.900316316158*this.a*n*Math.cos(i)+this.x0,u=1.4142135623731*this.a*Math.sin(i)+this.y0;return r.x=a,r.y=u,r}function eE(r){var t,e;r.x-=this.x0,r.y-=this.y0,e=r.y/(1.4142135623731*this.a),Math.abs(e)>.999999999999&&(e=.999999999999),t=Math.asin(e);var n=Y(this.long0+r.x/(.900316316158*this.a*Math.cos(t)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),e=(2*t+Math.sin(2*t))/Math.PI,Math.abs(e)>1&&(e=1);var i=Math.asin(e);return r.x=n,r.y=i,r}var rE=["Mollweide","moll"];const nE={init:Zw,forward:tE,inverse:eE,names:rE};function iE(){Math.abs(this.lat1+this.lat2)<X||(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=hu(this.es),this.e1=cu(this.es),this.e2=fu(this.es),this.e3=du(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Zn(this.e,this.sinphi,this.cosphi),this.ml1=hr(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<X?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Zn(this.e,this.sinphi,this.cosphi),this.ml2=hr(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=hr(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function sE(r){var t=r.x,e=r.y,n;if(this.sphere)n=this.a*(this.g-e);else{var i=hr(this.e0,this.e1,this.e2,this.e3,e);n=this.a*(this.g-i)}var s=this.ns*Y(t-this.long0),o=this.x0+n*Math.sin(s),a=this.y0+this.rh-n*Math.cos(s);return r.x=o,r.y=a,r}function oE(r){r.x-=this.x0,r.y=this.rh-r.y+this.y0;var t,e,n,i;this.ns>=0?(e=Math.sqrt(r.x*r.x+r.y*r.y),t=1):(e=-Math.sqrt(r.x*r.x+r.y*r.y),t=-1);var s=0;if(e!==0&&(s=Math.atan2(t*r.x,t*r.y)),this.sphere)return i=Y(this.long0+s/this.ns),n=Do(this.g-e/this.a),r.x=i,r.y=n,r;var o=this.g-e/this.a;return n=Pl(o,this.e0,this.e1,this.e2,this.e3),i=Y(this.long0+s/this.ns),r.x=i,r.y=n,r}var aE=["Equidistant_Conic","eqdc"];const uE={init:iE,forward:sE,inverse:oE,names:aE};function lE(){this.R=this.a}function hE(r){var t=r.x,e=r.y,n=Y(t-this.long0),i,s;Math.abs(e)<=X&&(i=this.x0+this.R*n,s=this.y0);var o=Zi(2*Math.abs(e/Math.PI));(Math.abs(n)<=X||Math.abs(Math.abs(e)-z)<=X)&&(i=this.x0,e>=0?s=this.y0+Math.PI*this.R*Math.tan(.5*o):s=this.y0+Math.PI*this.R*-Math.tan(.5*o));var a=.5*Math.abs(Math.PI/n-n/Math.PI),u=a*a,l=Math.sin(o),h=Math.cos(o),c=h/(l+h-1),f=c*c,p=c*(2/l-1),m=p*p,_=Math.PI*this.R*(a*(c-m)+Math.sqrt(u*(c-m)*(c-m)-(m+u)*(f-m)))/(m+u);n<0&&(_=-_),i=this.x0+_;var E=u+c;return _=Math.PI*this.R*(p*E-a*Math.sqrt((m+u)*(u+1)-E*E))/(m+u),e>=0?s=this.y0+_:s=this.y0-_,r.x=i,r.y=s,r}function cE(r){var t,e,n,i,s,o,a,u,l,h,c,f,p;return r.x-=this.x0,r.y-=this.y0,c=Math.PI*this.R,n=r.x/c,i=r.y/c,s=n*n+i*i,o=-Math.abs(i)*(1+s),a=o-2*i*i+n*n,u=-2*o+1+2*i*i+s*s,p=i*i/u+(2*a*a*a/u/u/u-9*o*a/u/u)/27,l=(o-a*a/3/u)/u,h=2*Math.sqrt(-l/3),c=3*p/l/h,Math.abs(c)>1&&(c>=0?c=1:c=-1),f=Math.acos(c)/3,r.y>=0?e=(-h*Math.cos(f+Math.PI/3)-a/3/u)*Math.PI:e=-(-h*Math.cos(f+Math.PI/3)-a/3/u)*Math.PI,Math.abs(n)<X?t=this.long0:t=Y(this.long0+Math.PI*(s-1+Math.sqrt(1+2*(n*n-i*i)+s*s))/2/n),r.x=t,r.y=e,r}var fE=["Van_der_Grinten_I","VanDerGrinten","vandg"];const dE={init:lE,forward:hE,inverse:cE,names:fE};function pE(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function gE(r){var t=r.x,e=r.y,n=Math.sin(r.y),i=Math.cos(r.y),s=Y(t-this.long0),o,a,u,l,h,c,f,p,m,_,E,C,v,y,w,S,P,M,b,D,F,N,L;return this.sphere?Math.abs(this.sin_p12-1)<=X?(r.x=this.x0+this.a*(z-e)*Math.sin(s),r.y=this.y0-this.a*(z-e)*Math.cos(s),r):Math.abs(this.sin_p12+1)<=X?(r.x=this.x0+this.a*(z+e)*Math.sin(s),r.y=this.y0+this.a*(z+e)*Math.cos(s),r):(M=this.sin_p12*n+this.cos_p12*i*Math.cos(s),S=Math.acos(M),P=S?S/Math.sin(S):1,r.x=this.x0+this.a*P*i*Math.sin(s),r.y=this.y0+this.a*P*(this.cos_p12*n-this.sin_p12*i*Math.cos(s)),r):(o=hu(this.es),a=cu(this.es),u=fu(this.es),l=du(this.es),Math.abs(this.sin_p12-1)<=X?(h=this.a*hr(o,a,u,l,z),c=this.a*hr(o,a,u,l,e),r.x=this.x0+(h-c)*Math.sin(s),r.y=this.y0-(h-c)*Math.cos(s),r):Math.abs(this.sin_p12+1)<=X?(h=this.a*hr(o,a,u,l,z),c=this.a*hr(o,a,u,l,e),r.x=this.x0+(h+c)*Math.sin(s),r.y=this.y0+(h+c)*Math.cos(s),r):(f=n/i,p=Oo(this.a,this.e,this.sin_p12),m=Oo(this.a,this.e,n),_=Math.atan((1-this.es)*f+this.es*p*this.sin_p12/(m*i)),E=Math.atan2(Math.sin(s),this.cos_p12*Math.tan(_)-this.sin_p12*Math.cos(s)),E===0?b=Math.asin(this.cos_p12*Math.sin(_)-this.sin_p12*Math.cos(_)):Math.abs(Math.abs(E)-Math.PI)<=X?b=-Math.asin(this.cos_p12*Math.sin(_)-this.sin_p12*Math.cos(_)):b=Math.asin(Math.sin(s)*Math.cos(_)/Math.sin(E)),C=this.e*this.sin_p12/Math.sqrt(1-this.es),v=this.e*this.cos_p12*Math.cos(E)/Math.sqrt(1-this.es),y=C*v,w=v*v,D=b*b,F=D*b,N=F*b,L=N*b,S=p*b*(1-D*w*(1-w)/6+F/8*y*(1-2*w)+N/120*(w*(4-7*w)-3*C*C*(1-7*w))-L/48*y),r.x=this.x0+S*Math.sin(E),r.y=this.y0+S*Math.cos(E),r))}function mE(r){r.x-=this.x0,r.y-=this.y0;var t,e,n,i,s,o,a,u,l,h,c,f,p,m,_,E,C,v,y,w,S,P,M,b;return this.sphere?(t=Math.sqrt(r.x*r.x+r.y*r.y),t>2*z*this.a?void 0:(e=t/this.a,n=Math.sin(e),i=Math.cos(e),s=this.long0,Math.abs(t)<=X?o=this.lat0:(o=Zi(i*this.sin_p12+r.y*n*this.cos_p12/t),a=Math.abs(this.lat0)-z,Math.abs(a)<=X?this.lat0>=0?s=Y(this.long0+Math.atan2(r.x,-r.y)):s=Y(this.long0-Math.atan2(-r.x,r.y)):s=Y(this.long0+Math.atan2(r.x*n,t*this.cos_p12*i-r.y*this.sin_p12*n))),r.x=s,r.y=o,r)):(u=hu(this.es),l=cu(this.es),h=fu(this.es),c=du(this.es),Math.abs(this.sin_p12-1)<=X?(f=this.a*hr(u,l,h,c,z),t=Math.sqrt(r.x*r.x+r.y*r.y),p=f-t,o=Pl(p/this.a,u,l,h,c),s=Y(this.long0+Math.atan2(r.x,-1*r.y)),r.x=s,r.y=o,r):Math.abs(this.sin_p12+1)<=X?(f=this.a*hr(u,l,h,c,z),t=Math.sqrt(r.x*r.x+r.y*r.y),p=t-f,o=Pl(p/this.a,u,l,h,c),s=Y(this.long0+Math.atan2(r.x,r.y)),r.x=s,r.y=o,r):(t=Math.sqrt(r.x*r.x+r.y*r.y),E=Math.atan2(r.x,r.y),m=Oo(this.a,this.e,this.sin_p12),C=Math.cos(E),v=this.e*this.cos_p12*C,y=-v*v/(1-this.es),w=3*this.es*(1-y)*this.sin_p12*this.cos_p12*C/(1-this.es),S=t/m,P=S-y*(1+y)*Math.pow(S,3)/6-w*(1+3*y)*Math.pow(S,4)/24,M=1-y*P*P/2-S*P*P*P/6,_=Math.asin(this.sin_p12*Math.cos(P)+this.cos_p12*Math.sin(P)*C),s=Y(this.long0+Math.asin(Math.sin(E)*Math.sin(P)/Math.cos(_))),b=Math.sin(_),o=Math.atan2((b-this.es*M*this.sin_p12)*Math.tan(_),b*(1-this.es)),r.x=s,r.y=o,r))}var vE=["Azimuthal_Equidistant","aeqd"];const yE={init:pE,forward:gE,inverse:mE,names:vE};function _E(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function wE(r){var t,e,n,i,s,o,a,u,l=r.x,h=r.y;return n=Y(l-this.long0),t=Math.sin(h),e=Math.cos(h),i=Math.cos(n),o=this.sin_p14*t+this.cos_p14*e*i,s=1,(o>0||Math.abs(o)<=X)&&(a=this.a*s*e*Math.sin(n),u=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*i)),r.x=a,r.y=u,r}function EE(r){var t,e,n,i,s,o,a;return r.x-=this.x0,r.y-=this.y0,t=Math.sqrt(r.x*r.x+r.y*r.y),e=Zi(t/this.a),n=Math.sin(e),i=Math.cos(e),o=this.long0,Math.abs(t)<=X?(a=this.lat0,r.x=o,r.y=a,r):(a=Zi(i*this.sin_p14+r.y*n*this.cos_p14/t),s=Math.abs(this.lat0)-z,Math.abs(s)<=X?(this.lat0>=0?o=Y(this.long0+Math.atan2(r.x,-r.y)):o=Y(this.long0-Math.atan2(-r.x,r.y)),r.x=o,r.y=a,r):(o=Y(this.long0+Math.atan2(r.x*n,t*this.cos_p14*i-r.y*this.sin_p14*n)),r.x=o,r.y=a,r))}var SE=["ortho"];const CE={init:_E,forward:wE,inverse:EE,names:SE};var te={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Lt={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function IE(){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||"Quadrilateralized Spherical Cube",this.lat0>=z-At/2?this.face=te.TOP:this.lat0<=-(z-At/2)?this.face=te.BOTTOM:Math.abs(this.long0)<=At?this.face=te.FRONT:Math.abs(this.long0)<=z+At?this.face=this.long0>0?te.RIGHT:te.LEFT:this.face=te.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function PE(r){var t={x:0,y:0},e,n,i,s,o,a,u={value:0};if(r.x-=this.long0,this.es!==0?e=Math.atan(this.one_minus_f_squared*Math.tan(r.y)):e=r.y,n=r.x,this.face===te.TOP)s=z-e,n>=At&&n<=z+At?(u.value=Lt.AREA_0,i=n-z):n>z+At||n<=-(z+At)?(u.value=Lt.AREA_1,i=n>0?n-ae:n+ae):n>-(z+At)&&n<=-At?(u.value=Lt.AREA_2,i=n+z):(u.value=Lt.AREA_3,i=n);else if(this.face===te.BOTTOM)s=z+e,n>=At&&n<=z+At?(u.value=Lt.AREA_0,i=-n+z):n<At&&n>=-At?(u.value=Lt.AREA_1,i=-n):n<-At&&n>=-(z+At)?(u.value=Lt.AREA_2,i=-n-z):(u.value=Lt.AREA_3,i=n>0?-n+ae:-n-ae);else{var l,h,c,f,p,m,_;this.face===te.RIGHT?n=Ao(n,+z):this.face===te.BACK?n=Ao(n,+ae):this.face===te.LEFT&&(n=Ao(n,-z)),f=Math.sin(e),p=Math.cos(e),m=Math.sin(n),_=Math.cos(n),l=p*_,h=p*m,c=f,this.face===te.FRONT?(s=Math.acos(l),i=Ml(s,c,h,u)):this.face===te.RIGHT?(s=Math.acos(h),i=Ml(s,c,-l,u)):this.face===te.BACK?(s=Math.acos(-l),i=Ml(s,c,-h,u)):this.face===te.LEFT?(s=Math.acos(-h),i=Ml(s,c,l,u)):(s=i=0,u.value=Lt.AREA_0)}return a=Math.atan(12/ae*(i+Math.acos(Math.sin(i)*Math.cos(At))-z)),o=Math.sqrt((1-Math.cos(s))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(i))))),u.value===Lt.AREA_1?a+=z:u.value===Lt.AREA_2?a+=ae:u.value===Lt.AREA_3&&(a+=1.5*ae),t.x=o*Math.cos(a),t.y=o*Math.sin(a),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,r.x=t.x,r.y=t.y,r}function ME(r){var t={lam:0,phi:0},e,n,i,s,o,a,u,l,h,c={value:0};if(r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,n=Math.atan(Math.sqrt(r.x*r.x+r.y*r.y)),e=Math.atan2(r.y,r.x),r.x>=0&&r.x>=Math.abs(r.y)?c.value=Lt.AREA_0:r.y>=0&&r.y>=Math.abs(r.x)?(c.value=Lt.AREA_1,e-=z):r.x<0&&-r.x>=Math.abs(r.y)?(c.value=Lt.AREA_2,e=e<0?e+ae:e-ae):(c.value=Lt.AREA_3,e+=z),h=ae/12*Math.tan(e),o=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),a=Math.atan(o),i=Math.cos(e),s=Math.tan(n),u=1-i*i*s*s*(1-Math.cos(Math.atan(1/Math.cos(a)))),u<-1?u=-1:u>1&&(u=1),this.face===te.TOP)l=Math.acos(u),t.phi=z-l,c.value===Lt.AREA_0?t.lam=a+z:c.value===Lt.AREA_1?t.lam=a<0?a+ae:a-ae:c.value===Lt.AREA_2?t.lam=a-z:t.lam=a;else if(this.face===te.BOTTOM)l=Math.acos(u),t.phi=l-z,c.value===Lt.AREA_0?t.lam=-a+z:c.value===Lt.AREA_1?t.lam=-a:c.value===Lt.AREA_2?t.lam=-a-z:t.lam=a<0?-a-ae:-a+ae;else{var f,p,m;f=u,h=f*f,h>=1?m=0:m=Math.sqrt(1-h)*Math.sin(a),h+=m*m,h>=1?p=0:p=Math.sqrt(1-h),c.value===Lt.AREA_1?(h=p,p=-m,m=h):c.value===Lt.AREA_2?(p=-p,m=-m):c.value===Lt.AREA_3&&(h=p,p=m,m=-h),this.face===te.RIGHT?(h=f,f=-p,p=h):this.face===te.BACK?(f=-f,p=-p):this.face===te.LEFT&&(h=f,f=p,p=-h),t.phi=Math.acos(-m)-z,t.lam=Math.atan2(p,f),this.face===te.RIGHT?t.lam=Ao(t.lam,-z):this.face===te.BACK?t.lam=Ao(t.lam,-ae):this.face===te.LEFT&&(t.lam=Ao(t.lam,+z))}if(this.es!==0){var _,E,C;_=t.phi<0?1:0,E=Math.tan(t.phi),C=this.b/Math.sqrt(E*E+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-C*C)/(this.one_minus_f*C)),_&&(t.phi=-t.phi)}return t.lam+=this.long0,r.x=t.lam,r.y=t.phi,r}function Ml(r,t,e,n){var i;return r<X?(n.value=Lt.AREA_0,i=0):(i=Math.atan2(t,e),Math.abs(i)<=At?n.value=Lt.AREA_0:i>At&&i<=z+At?(n.value=Lt.AREA_1,i-=z):i>z+At||i<=-(z+At)?(n.value=Lt.AREA_2,i=i>=0?i-ae:i+ae):(n.value=Lt.AREA_3,i+=z)),i}function Ao(r,t){var e=r+t;return e<-ae?e+=iu:e>+ae&&(e-=iu),e}var bE=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const xE={init:IE,forward:PE,inverse:ME,names:bE};var ic=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],pu=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Jp=.8487,jp=1.3523,Qp=Kn/5,NE=1/Qp,Lo=18,bl=function(r,t){return r[0]+t*(r[1]+t*(r[2]+t*r[3]))},TE=function(r,t){return r[1]+t*(2*r[2]+t*3*r[3])};function OE(r,t,e,n){for(var i=t;n;--n){var s=r(i);if(i-=s,Math.abs(s)<e)break}return i}function DE(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function AE(r){var t=Y(r.x-this.long0),e=Math.abs(r.y),n=Math.floor(e*Qp);n<0?n=0:n>=Lo&&(n=Lo-1),e=Kn*(e-NE*n);var i={x:bl(ic[n],e)*t,y:bl(pu[n],e)};return r.y<0&&(i.y=-i.y),i.x=i.x*this.a*Jp+this.x0,i.y=i.y*this.a*jp+this.y0,i}function LE(r){var t={x:(r.x-this.x0)/(this.a*Jp),y:Math.abs(r.y-this.y0)/(this.a*jp)};if(t.y>=1)t.x/=ic[Lo][0],t.y=r.y<0?-z:z;else{var e=Math.floor(t.y*Lo);for(e<0?e=0:e>=Lo&&(e=Lo-1);;)if(pu[e][0]>t.y)--e;else if(pu[e+1][0]<=t.y)++e;else break;var n=pu[e],i=5*(t.y-n[0])/(pu[e+1][0]-n[0]);i=OE(function(s){return(bl(n,s)-t.y)/TE(n,s)},i,X,100),t.x/=bl(ic[e],i),t.y=(5*e+i)*Ue,r.y<0&&(t.y=-t.y)}return t.x=Y(t.x+this.long0),t}var RE=["Robinson","robin"];const FE={init:DE,forward:AE,inverse:LE,names:RE};function kE(){this.name="geocent"}function VE(r){var t=Cp(r,this.es,this.a);return t}function UE(r){var t=Ip(r,this.es,this.a,this.b);return t}var zE=["Geocentric","geocentric","geocent","Geocent"];const GE={init:kE,forward:VE,inverse:UE,names:zE};var je={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},gu={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function qE(){if(Object.keys(gu).forEach((function(e){if(typeof this[e]>"u")this[e]=gu[e].def;else{if(gu[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);gu[e].num&&(this[e]=parseFloat(this[e]))}gu[e].degrees&&(this[e]=this[e]*Ue)}).bind(this)),Math.abs(Math.abs(this.lat0)-z)<X?this.mode=this.lat0<0?je.S_POLE:je.N_POLE:Math.abs(this.lat0)<X?this.mode=je.EQUIT:(this.mode=je.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)throw new Error("Invalid height");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;var r=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(r),this.sw=Math.sin(r)}function WE(r){r.x-=this.long0;var t=Math.sin(r.y),e=Math.cos(r.y),n=Math.cos(r.x),i,s;switch(this.mode){case je.OBLIQ:s=this.sinph0*t+this.cosph0*e*n;break;case je.EQUIT:s=e*n;break;case je.S_POLE:s=-t;break;case je.N_POLE:s=t;break}switch(s=this.pn1/(this.p-s),i=s*e*Math.sin(r.x),this.mode){case je.OBLIQ:s*=this.cosph0*t-this.sinph0*e*n;break;case je.EQUIT:s*=t;break;case je.N_POLE:s*=-(e*n);break;case je.S_POLE:s*=e*n;break}var o,a;return o=s*this.cg+i*this.sg,a=1/(o*this.sw*this.h1+this.cw),i=(i*this.cg-s*this.sg)*this.cw*a,s=o*a,r.x=i*this.a,r.y=s*this.a,r}function XE(r){r.x/=this.a,r.y/=this.a;var t={x:r.x,y:r.y},e,n,i;i=1/(this.pn1-r.y*this.sw),e=this.pn1*r.x*i,n=this.pn1*r.y*this.cw*i,r.x=e*this.cg+n*this.sg,r.y=n*this.cg-e*this.sg;var s=Nn(r.x,r.y);if(Math.abs(s)<X)t.x=0,t.y=r.y;else{var o,a;switch(a=1-s*s*this.pfact,a=(this.p-Math.sqrt(a))/(this.pn1/s+s/this.pn1),o=Math.sqrt(1-a*a),this.mode){case je.OBLIQ:t.y=Math.asin(o*this.sinph0+r.y*a*this.cosph0/s),r.y=(o-this.sinph0*Math.sin(t.y))*s,r.x*=a*this.cosph0;break;case je.EQUIT:t.y=Math.asin(r.y*a/s),r.y=o*s,r.x*=a;break;case je.N_POLE:t.y=Math.asin(o),r.y=-r.y;break;case je.S_POLE:t.y=-Math.asin(o);break}t.x=Math.atan2(r.x,r.y)}return r.x=t.x+this.long0,r.y=t.y,r}var BE=["Tilted_Perspective","tpers"];const HE={init:qE,forward:WE,inverse:XE,names:BE};function YE(){if(this.flip_axis=this.sweep==="x"?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)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var r=1-this.es,t=1/r;this.radius_p=Math.sqrt(r),this.radius_p2=r,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function JE(r){var t=r.x,e=r.y,n,i,s,o;if(t=t-this.long0,this.shape==="ellipse"){e=Math.atan(this.radius_p2*Math.tan(e));var a=this.radius_p/Nn(this.radius_p*Math.cos(e),Math.sin(e));if(i=a*Math.cos(t)*Math.cos(e),s=a*Math.sin(t)*Math.cos(e),o=a*Math.sin(e),(this.radius_g-i)*i-s*s-o*o*this.radius_p_inv2<0)return r.x=Number.NaN,r.y=Number.NaN,r;n=this.radius_g-i,this.flip_axis?(r.x=this.radius_g_1*Math.atan(s/Nn(o,n)),r.y=this.radius_g_1*Math.atan(o/n)):(r.x=this.radius_g_1*Math.atan(s/n),r.y=this.radius_g_1*Math.atan(o/Nn(s,n)))}else this.shape==="sphere"&&(n=Math.cos(e),i=Math.cos(t)*n,s=Math.sin(t)*n,o=Math.sin(e),n=this.radius_g-i,this.flip_axis?(r.x=this.radius_g_1*Math.atan(s/Nn(o,n)),r.y=this.radius_g_1*Math.atan(o/n)):(r.x=this.radius_g_1*Math.atan(s/n),r.y=this.radius_g_1*Math.atan(o/Nn(s,n))));return r.x=r.x*this.a,r.y=r.y*this.a,r}function jE(r){var t=-1,e=0,n=0,i,s,o,a;if(r.x=r.x/this.a,r.y=r.y/this.a,this.shape==="ellipse"){this.flip_axis?(n=Math.tan(r.y/this.radius_g_1),e=Math.tan(r.x/this.radius_g_1)*Nn(1,n)):(e=Math.tan(r.x/this.radius_g_1),n=Math.tan(r.y/this.radius_g_1)*Nn(1,e));var u=n/this.radius_p;if(i=e*e+u*u+t*t,s=2*this.radius_g*t,o=s*s-4*i*this.C,o<0)return r.x=Number.NaN,r.y=Number.NaN,r;a=(-s-Math.sqrt(o))/(2*i),t=this.radius_g+a*t,e*=a,n*=a,r.x=Math.atan2(e,t),r.y=Math.atan(n*Math.cos(r.x)/t),r.y=Math.atan(this.radius_p_inv2*Math.tan(r.y))}else if(this.shape==="sphere"){if(this.flip_axis?(n=Math.tan(r.y/this.radius_g_1),e=Math.tan(r.x/this.radius_g_1)*Math.sqrt(1+n*n)):(e=Math.tan(r.x/this.radius_g_1),n=Math.tan(r.y/this.radius_g_1)*Math.sqrt(1+e*e)),i=e*e+n*n+t*t,s=2*this.radius_g*t,o=s*s-4*i*this.C,o<0)return r.x=Number.NaN,r.y=Number.NaN,r;a=(-s-Math.sqrt(o))/(2*i),t=this.radius_g+a*t,e*=a,n*=a,r.x=Math.atan2(e,t),r.y=Math.atan(n*Math.cos(r.x)/t)}return r.x=r.x+this.long0,r}var QE=["Geostationary Satellite View","Geostationary_Satellite","geos"];const $E={init:YE,forward:JE,inverse:jE,names:QE};function KE(r){r.Proj.projections.add(Cl),r.Proj.projections.add(Il),r.Proj.projections.add(s1),r.Proj.projections.add(p1),r.Proj.projections.add(w1),r.Proj.projections.add(P1),r.Proj.projections.add(O1),r.Proj.projections.add(F1),r.Proj.projections.add(G1),r.Proj.projections.add(H1),r.Proj.projections.add(lw),r.Proj.projections.add(gw),r.Proj.projections.add(ww),r.Proj.projections.add(Mw),r.Proj.projections.add(Ow),r.Proj.projections.add(Fw),r.Proj.projections.add(Gw),r.Proj.projections.add(Hw),r.Proj.projections.add(Kw),r.Proj.projections.add(nE),r.Proj.projections.add(uE),r.Proj.projections.add(dE),r.Proj.projections.add(yE),r.Proj.projections.add(CE),r.Proj.projections.add(xE),r.Proj.projections.add(FE),r.Proj.projections.add(GE),r.Proj.projections.add(HE),r.Proj.projections.add($E)}Sr.defaultDatum="WGS84",Sr.Proj=ti,Sr.WGS84=new Sr.Proj("WGS84"),Sr.Point=No,Sr.toPoint=xp,Sr.defs=lr,Sr.nadgrid=a_,Sr.transform=El,Sr.mgrs=C_,Sr.version="__VERSION__",KE(Sr);const $p=Sr("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=geocent +datum=WGS84");function ei(r){return $p.forward(r)}function Kp(r){return $p.inverse(r)}const Zp=Sr("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs");function ZE(r){const t=Zp.forward([r[0],r[1]]);return[t[0],t[1],r[2]]}function tS(r){const t=Zp.inverse([r[0],r[1]]);return[t[0],t[1],r[2]]}var ze=63710088e-1,tg={centimeters:ze*100,centimetres:ze*100,degrees:ze/111325,feet:ze*3.28084,inches:ze*39.37,kilometers:ze/1e3,kilometres:ze/1e3,meters:ze,metres:ze,miles:ze/1609.344,millimeters:ze*1e3,millimetres:ze*1e3,nauticalmiles:ze/1852,radians:1,yards:ze*1.0936};function jr(r,t,e){e===void 0&&(e={});var n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=t||{},n.geometry=r,n}function xt(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!eg(r[0])||!eg(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return jr(n,t,e)}function kt(r,t,e){e===void 0&&(e={});for(var n=0,i=r;n<i.length;n++){var s=i[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<s[s.length-1].length;o++)if(s[s.length-1][o]!==s[0][o])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:r};return jr(a,t,e)}function Ir(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return jr(n,t,e)}function Lr(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}function eS(r,t,e){e===void 0&&(e={});var n={type:"MultiLineString",coordinates:r};return jr(n,t,e)}function sc(r,t,e){e===void 0&&(e={});var n={type:"MultiPolygon",coordinates:r};return jr(n,t,e)}function oc(r,t){t===void 0&&(t="kilometers");var e=tg[t];if(!e)throw new Error(t+" units is invalid");return r*e}function ac(r,t){t===void 0&&(t="kilometers");var e=tg[t];if(!e)throw new Error(t+" units is invalid");return r/e}function xl(r){var t=r%(2*Math.PI);return t*180/Math.PI}function Qe(r){var t=r%360;return t*Math.PI/180}function uc(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return oc(ac(r,t),e)}function eg(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Ro(r,t,e){if(r!==null)for(var n,i,s,o,a,u,l,h=0,c=0,f,p=r.type,m=p==="FeatureCollection",_=p==="Feature",E=m?r.features.length:1,C=0;C<E;C++){l=m?r.features[C].geometry:_?r.geometry:r,f=l?l.type==="GeometryCollection":!1,a=f?l.geometries.length:1;for(var v=0;v<a;v++){var y=0,w=0;if(o=f?l.geometries[v]:l,o!==null){u=o.coordinates;var S=o.type;switch(h=e&&(S==="Polygon"||S==="MultiPolygon")?1:0,S){case null:break;case"Point":if(t(u,c,C,y,w)===!1)return!1;c++,y++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(t(u[n],c,C,y,w)===!1)return!1;c++,S==="MultiPoint"&&y++}S==="LineString"&&y++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-h;i++){if(t(u[n][i],c,C,y,w)===!1)return!1;c++}S==="MultiLineString"&&y++,S==="Polygon"&&w++}S==="Polygon"&&y++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(w=0,i=0;i<u[n].length;i++){for(s=0;s<u[n][i].length-h;s++){if(t(u[n][i][s],c,C,y,w)===!1)return!1;c++}w++}y++}break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(Ro(o.geometries[n],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Fo(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function Nl(r,t){var e,n,i,s,o,a,u,l,h,c,f=0,p=r.type==="FeatureCollection",m=r.type==="Feature",_=p?r.features.length:1;for(e=0;e<_;e++){for(a=p?r.features[e].geometry:m?r.geometry:r,l=p?r.features[e].properties:m?r.properties:{},h=p?r.features[e].bbox:m?r.bbox:void 0,c=p?r.features[e].id:m?r.id:void 0,u=a?a.type==="GeometryCollection":!1,o=u?a.geometries.length:1,i=0;i<o;i++){if(s=u?a.geometries[i]:a,s===null){if(t(null,f,l,h,c)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(s,f,l,h,c)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(t(s.geometries[n],f,l,h,c)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function rS(r,t,e){var n=e;return Nl(r,function(i,s,o,a,u){n=t(n,i,s,o,a,u)}),n}function Ls(r,t){Nl(r,function(e,n,i,s,o){var a=e===null?null:e.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return t(jr(e,i,{bbox:s,id:o}),n,0)===!1?!1:void 0}var u;switch(a){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var l=0;l<e.coordinates.length;l++){var h=e.coordinates[l],c={type:u,coordinates:h};if(t(jr(c,i),n,l)===!1)return!1}})}function rg(r,t){Ls(r,function(e,n,i){var s=0;if(e.geometry){var o=e.geometry.type;if(!(o==="Point"||o==="MultiPoint")){var a,u=0,l=0,h=0;if(Ro(e,function(c,f,p,m,_){if(a===void 0||n>u||m>l||_>h){a=c,u=n,l=m,h=_,s=0;return}var E=Ir([a,c],e.properties);if(t(E,n,i,_,s)===!1)return!1;s++,a=c})===!1)return!1}}})}function nS(r,t,e){var n=e,i=!1;return rg(r,function(s,o,a,u,l){i===!1&&e===void 0?n=s:n=t(n,s,o,a,u,l),i=!0}),n}function Qr(r){var t=[1/0,1/0,-1/0,-1/0];return Ro(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Qr.default=Qr;function cr(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Rs(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function ng(r,t,e){if(!r)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!r.geometry||r.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+r.geometry.type)}function iS(r,t,e){if(!r)throw new Error("No featureCollection passed");if(!r||r.type!=="FeatureCollection")throw new Error("Invalid input to "+e+", FeatureCollection required");for(var n=0,i=r.features;n<i.length;n++){var s=i[n];if(!s||s.type!=="Feature"||!s.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!s.geometry||s.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+s.geometry.type)}}function $e(r){return r.type==="Feature"?r.geometry:r}function sS(r,t){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}function ig(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function sg(r,t,e=0,n=r.length-1,i=oS){for(;n>e;){if(n-e>600){const u=n-e+1,l=t-e+1,h=Math.log(u),c=.5*Math.exp(2*h/3),f=.5*Math.sqrt(h*c*(u-c)/u)*(l-u/2<0?-1:1),p=Math.max(e,Math.floor(t-l*c/u+f)),m=Math.min(n,Math.floor(t+(u-l)*c/u+f));sg(r,t,p,m,i)}const s=r[t];let o=e,a=n;for(mu(r,e,t),i(r[n],s)>0&&mu(r,e,n);o<a;){for(mu(r,o,a),o++,a--;i(r[o],s)<0;)o++;for(;i(r[a],s)>0;)a--}i(r[e],s)===0?mu(r,e,a):(a++,mu(r,a,n)),a<=t&&(e=a+1),t<=a&&(n=a-1)}}function mu(r,t,e){const n=r[t];r[t]=r[e],r[e]=n}function oS(r,t){return r<t?-1:r>t?1:0}class og{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!Ol(t,e))return n;const i=this.toBBox,s=[];for(;e;){for(let o=0;o<e.children.length;o++){const a=e.children[o],u=e.leaf?i(a):a;Ol(t,u)&&(e.leaf?n.push(a):hc(t,u)?this._all(a,n):s.push(a))}e=s.pop()}return n}collides(t){let e=this.data;if(!Ol(t,e))return!1;const n=[];for(;e;){for(let i=0;i<e.children.length;i++){const s=e.children[i],o=e.leaf?this.toBBox(s):s;if(Ol(t,o)){if(e.leaf||hc(t,o))return!0;n.push(s)}}e=n.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let n=0;n<t.length;n++)this.insert(t[n]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=e;else if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const n=this.data;this.data=e,e=n}this._insert(e,this.data.height-e.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=Vo([]),this}remove(t,e){if(!t)return this;let n=this.data;const i=this.toBBox(t),s=[],o=[];let a,u,l;for(;n||s.length;){if(n||(n=s.pop(),u=s[s.length-1],a=o.pop(),l=!0),n.leaf){const h=aS(t,n.children,e);if(h!==-1)return n.children.splice(h,1),s.push(n),this._condense(s),this}!l&&!n.leaf&&hc(n,i)?(s.push(n),o.push(a),a=0,u=n,n=n.children[0]):u?(a++,n=u.children[a],l=!1):n=null}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,i){const s=n-e+1;let o=this._maxEntries,a;if(s<=o)return a=Vo(t.slice(e,n+1)),ko(a,this.toBBox),a;i||(i=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/Math.pow(o,i-1))),a=Vo([]),a.leaf=!1,a.height=i;const u=Math.ceil(s/o),l=u*Math.ceil(Math.sqrt(o));ag(t,e,n,l,this.compareMinX);for(let h=e;h<=n;h+=l){const c=Math.min(h+l-1,n);ag(t,h,c,u,this.compareMinY);for(let f=h;f<=c;f+=u){const p=Math.min(f+u-1,c);a.children.push(this._build(t,f,p,i-1))}}return ko(a,this.toBBox),a}_chooseSubtree(t,e,n,i){for(;i.push(e),!(e.leaf||i.length-1===n);){let s=1/0,o=1/0,a;for(let u=0;u<e.children.length;u++){const l=e.children[u],h=lc(l),c=hS(t,l)-h;c<o?(o=c,s=h<s?h:s,a=l):c===o&&h<s&&(s=h,a=l)}e=a||e.children[0]}return e}_insert(t,e,n){const i=n?t:this.toBBox(t),s=[],o=this._chooseSubtree(i,this.data,e,s);for(o.children.push(t),yu(o,i);e>=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(i,s,e)}_split(t,e){const n=t[e],i=n.children.length,s=this._minEntries;this._chooseSplitAxis(n,s,i);const o=this._chooseSplitIndex(n,s,i),a=Vo(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,ko(n,this.toBBox),ko(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=Vo([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ko(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let i,s=1/0,o=1/0;for(let a=e;a<=n-e;a++){const u=vu(t,0,a,this.toBBox),l=vu(t,a,n,this.toBBox),h=cS(u,l),c=lc(u)+lc(l);h<s?(s=h,i=a,o=c<o?c:o):h===s&&c<o&&(o=c,i=a)}return i||n-e}_chooseSplitAxis(t,e,n){const i=t.leaf?this.compareMinX:uS,s=t.leaf?this.compareMinY:lS,o=this._allDistMargin(t,e,n,i),a=this._allDistMargin(t,e,n,s);o<a&&t.children.sort(i)}_allDistMargin(t,e,n,i){t.children.sort(i);const s=this.toBBox,o=vu(t,0,e,s),a=vu(t,n-e,n,s);let u=Tl(o)+Tl(a);for(let l=e;l<n-e;l++){const h=t.children[l];yu(o,t.leaf?s(h):h),u+=Tl(o)}for(let l=n-e-1;l>=e;l--){const h=t.children[l];yu(a,t.leaf?s(h):h),u+=Tl(a)}return u}_adjustParentBBoxes(t,e,n){for(let i=n;i>=0;i--)yu(e[i],t)}_condense(t){for(let e=t.length-1,n;e>=0;e--)t[e].children.length===0?e>0?(n=t[e-1].children,n.splice(n.indexOf(t[e]),1)):this.clear():ko(t[e],this.toBBox)}}function aS(r,t,e){if(!e)return t.indexOf(r);for(let n=0;n<t.length;n++)if(e(r,t[n]))return n;return-1}function ko(r,t){vu(r,0,r.children.length,t,r)}function vu(r,t,e,n,i){i||(i=Vo(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let s=t;s<e;s++){const o=r.children[s];yu(i,r.leaf?n(o):o)}return i}function yu(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function uS(r,t){return r.minX-t.minX}function lS(r,t){return r.minY-t.minY}function lc(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function Tl(r){return r.maxX-r.minX+(r.maxY-r.minY)}function hS(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function cS(r,t){const e=Math.max(r.minX,t.minX),n=Math.max(r.minY,t.minY),i=Math.min(r.maxX,t.maxX),s=Math.min(r.maxY,t.maxY);return Math.max(0,i-e)*Math.max(0,s-n)}function hc(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function Ol(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function Vo(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ag(r,t,e,n,i){const s=[t,e];for(;s.length;){if(e=s.pop(),t=s.pop(),e-t<=n)continue;const o=t+Math.ceil((e-t)/n/2)*n;sg(r,o,t,e,i),s.push(t,o,o,e)}}class fS{constructor(t=[],e=(n,i)=>n<i?-1:n>i?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:n}=this,i=e[t];for(;t>0;){const s=t-1>>1,o=e[s];if(n(i,o)>=0)break;e[t]=o,t=s}e[t]=i}_down(t){const{data:e,compare:n}=this,i=this.length>>1,s=e[t];for(;t<i;){let o=(t<<1)+1;const a=o+1;if(a<this.length&&n(e[a],e[o])<0&&(o=a),n(e[o],s)>=0)break;e[t]=e[o],t=o}e[t]=s}}var _u={exports:{}},cc,ug;function dS(){return ug||(ug=1,cc=function(t,e,n,i){var s=t[0],o=t[1],a=!1;n===void 0&&(n=0),i===void 0&&(i=e.length);for(var u=(i-n)/2,l=0,h=u-1;l<u;h=l++){var c=e[n+l*2+0],f=e[n+l*2+1],p=e[n+h*2+0],m=e[n+h*2+1],_=f>o!=m>o&&s<(p-c)*(o-f)/(m-f)+c;_&&(a=!a)}return a}),cc}var fc,lg;function pS(){return lg||(lg=1,fc=function(t,e,n,i){var s=t[0],o=t[1],a=!1;n===void 0&&(n=0),i===void 0&&(i=e.length);for(var u=i-n,l=0,h=u-1;l<u;h=l++){var c=e[l+n][0],f=e[l+n][1],p=e[h+n][0],m=e[h+n][1],_=f>o!=m>o&&s<(p-c)*(o-f)/(m-f)+c;_&&(a=!a)}return a}),fc}var hg;function gS(){if(hg)return _u.exports;hg=1;var r=dS(),t=pS();return _u.exports=function(n,i,s,o){return i.length>0&&Array.isArray(i[0])?t(n,i,s,o):r(n,i,s,o)},_u.exports.nested=t,_u.exports.flat=r,_u.exports}var mS=gS();const vS=ig(mS),bi=11102230246251565e-32,Ke=134217729,yS=(3+8*bi)*bi;function dc(r,t,e,n,i){let s,o,a,u,l=t[0],h=n[0],c=0,f=0;h>l==h>-l?(s=l,l=t[++c]):(s=h,h=n[++f]);let p=0;if(c<r&&f<e)for(h>l==h>-l?(o=l+s,a=s-(o-l),l=t[++c]):(o=h+s,a=s-(o-h),h=n[++f]),s=o,a!==0&&(i[p++]=a);c<r&&f<e;)h>l==h>-l?(o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++c]):(o=s+h,u=o-s,a=s-(o-u)+(h-u),h=n[++f]),s=o,a!==0&&(i[p++]=a);for(;c<r;)o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++c],s=o,a!==0&&(i[p++]=a);for(;f<e;)o=s+h,u=o-s,a=s-(o-u)+(h-u),h=n[++f],s=o,a!==0&&(i[p++]=a);return(s!==0||p===0)&&(i[p++]=s),p}function _S(r,t){let e=t[0];for(let n=1;n<r;n++)e+=t[n];return e}function wu(r){return new Float64Array(r)}const wS=(3+16*bi)*bi,ES=(2+12*bi)*bi,SS=(9+64*bi)*bi*bi,Uo=wu(4),cg=wu(8),fg=wu(12),dg=wu(16),fr=wu(4);function CS(r,t,e,n,i,s,o){let a,u,l,h,c,f,p,m,_,E,C,v,y,w,S,P,M,b;const D=r-i,F=e-i,N=t-s,L=n-s;w=D*L,f=Ke*D,p=f-(f-D),m=D-p,f=Ke*L,_=f-(f-L),E=L-_,S=m*E-(w-p*_-m*_-p*E),P=N*F,f=Ke*N,p=f-(f-N),m=N-p,f=Ke*F,_=f-(f-F),E=F-_,M=m*E-(P-p*_-m*_-p*E),C=S-M,c=S-C,Uo[0]=S-(C+c)+(c-M),v=w+C,c=v-w,y=w-(v-c)+(C-c),C=y-P,c=y-C,Uo[1]=y-(C+c)+(c-P),b=v+C,c=b-v,Uo[2]=v-(b-c)+(C-c),Uo[3]=b;let A=_S(4,Uo),k=ES*o;if(A>=k||-A>=k||(c=r-D,a=r-(D+c)+(c-i),c=e-F,l=e-(F+c)+(c-i),c=t-N,u=t-(N+c)+(c-s),c=n-L,h=n-(L+c)+(c-s),a===0&&u===0&&l===0&&h===0)||(k=SS*o+yS*Math.abs(A),A+=D*h+L*a-(N*l+F*u),A>=k||-A>=k))return A;w=a*L,f=Ke*a,p=f-(f-a),m=a-p,f=Ke*L,_=f-(f-L),E=L-_,S=m*E-(w-p*_-m*_-p*E),P=u*F,f=Ke*u,p=f-(f-u),m=u-p,f=Ke*F,_=f-(f-F),E=F-_,M=m*E-(P-p*_-m*_-p*E),C=S-M,c=S-C,fr[0]=S-(C+c)+(c-M),v=w+C,c=v-w,y=w-(v-c)+(C-c),C=y-P,c=y-C,fr[1]=y-(C+c)+(c-P),b=v+C,c=b-v,fr[2]=v-(b-c)+(C-c),fr[3]=b;const H=dc(4,Uo,4,fr,cg);w=D*h,f=Ke*D,p=f-(f-D),m=D-p,f=Ke*h,_=f-(f-h),E=h-_,S=m*E-(w-p*_-m*_-p*E),P=N*l,f=Ke*N,p=f-(f-N),m=N-p,f=Ke*l,_=f-(f-l),E=l-_,M=m*E-(P-p*_-m*_-p*E),C=S-M,c=S-C,fr[0]=S-(C+c)+(c-M),v=w+C,c=v-w,y=w-(v-c)+(C-c),C=y-P,c=y-C,fr[1]=y-(C+c)+(c-P),b=v+C,c=b-v,fr[2]=v-(b-c)+(C-c),fr[3]=b;const et=dc(H,cg,4,fr,fg);w=a*h,f=Ke*a,p=f-(f-a),m=a-p,f=Ke*h,_=f-(f-h),E=h-_,S=m*E-(w-p*_-m*_-p*E),P=u*l,f=Ke*u,p=f-(f-u),m=u-p,f=Ke*l,_=f-(f-l),E=l-_,M=m*E-(P-p*_-m*_-p*E),C=S-M,c=S-C,fr[0]=S-(C+c)+(c-M),v=w+C,c=v-w,y=w-(v-c)+(C-c),C=y-P,c=y-C,fr[1]=y-(C+c)+(c-P),b=v+C,c=b-v,fr[2]=v-(b-c)+(C-c),fr[3]=b;const ht=dc(et,fg,4,fr,dg);return dg[ht-1]}function pg(r,t,e,n,i,s){const o=(t-s)*(e-i),a=(r-i)*(n-s),u=o-a,l=Math.abs(o+a);return Math.abs(u)>=wS*l?u:-CS(r,t,e,n,i,s,l)}function IS(r,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;const n=NS(r),i=new og(16);i.toBBox=function(f){return{minX:f[0],minY:f[1],maxX:f[0],maxY:f[1]}},i.compareMinX=function(f,p){return f[0]-p[0]},i.compareMinY=function(f,p){return f[1]-p[1]},i.load(r);const s=[];let o;for(let f=0;f<n.length;f++){const p=n[f];i.remove(p),o=vg(p,o),s.push(o)}const a=new og(16);for(let f=0;f<s.length;f++)a.insert(pc(s[f]));const u=t*t,l=e*e;for(;s.length;){const f=s.shift(),p=f.p,m=f.next.p,_=gc(p,m);if(_<l)continue;const E=_/u,C=PS(i,f.prev.p,p,m,f.next.next.p,E,a);C&&Math.min(gc(C,p),gc(C,m))<=E&&(s.push(f),s.push(vg(C,f)),i.remove(C),a.remove(f),a.insert(pc(f)),a.insert(pc(f.next)))}let h=o;const c=[];do c.push(h.p),h=h.next;while(h!==o);return c.push(h.p),c}function PS(r,t,e,n,i,s,o){const a=new fS([],MS);let u=r.data;for(;u;){for(let l=0;l<u.children.length;l++){const h=u.children[l],c=u.leaf?mc(h,e,n):bS(e,n,h);c>s||a.push({node:h,dist:c})}for(;a.length&&!a.peek().node.children;){const l=a.pop(),h=l.node,c=mc(h,t,e),f=mc(h,n,i);if(l.dist<c&&l.dist<f&&mg(e,h,o)&&mg(n,h,o))return h}u=a.pop(),u&&(u=u.node)}return null}function MS(r,t){return r.dist-t.dist}function bS(r,t,e){if(gg(r,e)||gg(t,e))return 0;const n=Dl(r[0],r[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(n===0)return 0;const i=Dl(r[0],r[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(i===0)return 0;const s=Dl(r[0],r[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(s===0)return 0;const o=Dl(r[0],r[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return o===0?0:Math.min(n,i,s,o)}function gg(r,t){return r[0]>=t.minX&&r[0]<=t.maxX&&r[1]>=t.minY&&r[1]<=t.maxY}function mg(r,t,e){const n=Math.min(r[0],t[0]),i=Math.min(r[1],t[1]),s=Math.max(r[0],t[0]),o=Math.max(r[1],t[1]),a=e.search({minX:n,minY:i,maxX:s,maxY:o});for(let u=0;u<a.length;u++)if(xS(a[u].p,a[u].next.p,r,t))return!1;return!0}function zo(r,t,e){return pg(r[0],r[1],t[0],t[1],e[0],e[1])}function xS(r,t,e,n){return r!==n&&t!==e&&zo(r,t,e)>0!=zo(r,t,n)>0&&zo(e,n,r)>0!=zo(e,n,t)>0}function pc(r){const t=r.p,e=r.next.p;return r.minX=Math.min(t[0],e[0]),r.minY=Math.min(t[1],e[1]),r.maxX=Math.max(t[0],e[0]),r.maxY=Math.max(t[1],e[1]),r}function NS(r){let t=r[0],e=r[0],n=r[0],i=r[0];for(let a=0;a<r.length;a++){const u=r[a];u[0]<t[0]&&(t=u),u[0]>n[0]&&(n=u),u[1]<e[1]&&(e=u),u[1]>i[1]&&(i=u)}const s=[t,e,n,i],o=s.slice();for(let a=0;a<r.length;a++)vS(r[a],s)||o.push(r[a]);return OS(o)}function vg(r,t){const e={p:r,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}function gc(r,t){const e=r[0]-t[0],n=r[1]-t[1];return e*e+n*n}function mc(r,t,e){let n=t[0],i=t[1],s=e[0]-n,o=e[1]-i;if(s!==0||o!==0){const a=((r[0]-n)*s+(r[1]-i)*o)/(s*s+o*o);a>1?(n=e[0],i=e[1]):a>0&&(n+=s*a,i+=o*a)}return s=r[0]-n,o=r[1]-i,s*s+o*o}function Dl(r,t,e,n,i,s,o,a){const u=e-r,l=n-t,h=o-i,c=a-s,f=r-i,p=t-s,m=u*u+l*l,_=u*h+l*c,E=h*h+c*c,C=u*f+l*p,v=h*f+c*p,y=m*E-_*_;let w,S,P=y,M=y;y===0?(w=0,P=1,S=v,M=E):(w=_*v-E*C,S=m*v-_*C,w<0?(w=0,S=v,M=E):w>P&&(w=P,S=v+_,M=E)),S<0?(S=0,-C<0?w=0:-C>m?w=P:(w=-C,P=m)):S>M&&(S=M,-C+_<0?w=0:-C+_>m?w=P:(w=-C+_,P=m));const b=w===0?0:w/P,D=S===0?0:S/M,F=(1-b)*r+b*e,N=(1-b)*t+b*n,L=(1-D)*i+D*o,A=(1-D)*s+D*a,k=L-F,H=A-N;return k*k+H*H}function TS(r,t){return r[0]===t[0]?r[1]-t[1]:r[0]-t[0]}function OS(r){r.sort(TS);const t=[];for(let n=0;n<r.length;n++){for(;t.length>=2&&zo(t[t.length-2],t[t.length-1],r[n])<=0;)t.pop();t.push(r[n])}const e=[];for(let n=r.length-1;n>=0;n--){for(;e.length>=2&&zo(e[e.length-2],e[e.length-1],r[n])<=0;)e.pop();e.push(r[n])}return e.pop(),t.pop(),t.concat(e)}function DS(r,t){t===void 0&&(t={}),t.concavity=t.concavity||1/0;var e=[];if(Ro(r,function(i){e.push([i[0],i[1]])}),!e.length)return null;var n=IS(e,t.concavity);return n.length>3?kt([n]):null}function be(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("point is required");if(!t)throw new Error("polygon is required");var n=cr(r),i=$e(t),s=i.type,o=t.bbox,a=i.coordinates;if(o&&AS(n,o)===!1)return!1;s==="Polygon"&&(a=[a]);for(var u=!1,l=0;l<a.length&&!u;l++)if(yg(n,a[l][0],e.ignoreBoundary)){for(var h=!1,c=1;c<a[l].length&&!h;)yg(n,a[l][c],!e.ignoreBoundary)&&(h=!0),c++;h||(u=!0)}return u}function yg(r,t,e){var n=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var i=0,s=t.length-1;i<t.length;s=i++){var o=t[i][0],a=t[i][1],u=t[s][0],l=t[s][1],h=r[1]*(o-u)+a*(u-r[0])+l*(r[0]-o)===0&&(o-r[0])*(u-r[0])<=0&&(a-r[1])*(l-r[1])<=0;if(h)return!e;var c=a>r[1]!=l>r[1]&&r[0]<(u-o)*(r[1]-a)/(l-a)+o;c&&(n=!n)}return n}function AS(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}function we(r,t,e){e===void 0&&(e={});var n=cr(r),i=cr(t),s=Qe(i[1]-n[1]),o=Qe(i[0]-n[0]),a=Qe(n[1]),u=Qe(i[1]),l=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(a)*Math.cos(u);return oc(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),e.units)}function LS(r){if(!r)throw new Error("geojson is required");switch(r.type){case"Feature":return _g(r);case"FeatureCollection":return RS(r);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return vc(r);default:throw new Error("unknown GeoJSON type")}}function _g(r){var t={type:"Feature"};return Object.keys(r).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:t[e]=r[e]}}),t.properties=wg(r.properties),t.geometry=vc(r.geometry),t}function wg(r){var t={};return r&&Object.keys(r).forEach(function(e){var n=r[e];typeof n=="object"?n===null?t[e]=null:Array.isArray(n)?t[e]=n.map(function(i){return i}):t[e]=wg(n):t[e]=n}),t}function RS(r){var t={type:"FeatureCollection"};return Object.keys(r).forEach(function(e){switch(e){case"type":case"features":return;default:t[e]=r[e]}}),t.features=r.features.map(function(e){return _g(e)}),t}function vc(r){var t={type:r.type};return r.bbox&&(t.bbox=r.bbox),r.type==="GeometryCollection"?(t.geometries=r.geometries.map(function(e){return vc(e)}),t):(t.coordinates=Eg(r.coordinates),t)}function Eg(r){var t=r;return typeof t[0]!="object"?t.slice():t.map(function(e){return Eg(e)})}function Go(r,t,e,n){n===void 0&&(n={});var i=cr(r),s=Qe(i[0]),o=Qe(i[1]),a=Qe(e),u=ac(t,n.units),l=Math.asin(Math.sin(o)*Math.cos(u)+Math.cos(o)*Math.sin(u)*Math.cos(a)),h=s+Math.atan2(Math.sin(a)*Math.sin(u)*Math.cos(o),Math.cos(u)-Math.sin(o)*Math.sin(l)),c=xl(h),f=xl(l);return xt([c,f],n.properties)}function FS(r,t,e){e===void 0&&(e={});for(var n=e.steps||64,i=e.properties?e.properties:!Array.isArray(r)&&r.type==="Feature"&&r.properties?r.properties:{},s=[],o=0;o<n;o++)s.push(Go(r,t,o*-360/n,e).geometry.coordinates);return s.push(s[0]),kt([s],i)}function Eu(r,t,e){if(e===void 0&&(e={}),e.final===!0)return kS(r,t);var n=cr(r),i=cr(t),s=Qe(n[0]),o=Qe(i[0]),a=Qe(n[1]),u=Qe(i[1]),l=Math.sin(o-s)*Math.cos(u),h=Math.cos(a)*Math.sin(u)-Math.sin(a)*Math.cos(u)*Math.cos(o-s);return xl(Math.atan2(l,h))}function kS(r,t){var e=Eu(t,r);return e=(e+180)%360,e}function VS(r,t){var e=we(r,t),n=Eu(r,t),i=Go(r,e/2,n);return i}function Sg(r,t){t===void 0&&(t={});var e=Qr(r),n=(e[0]+e[2])/2,i=(e[1]+e[3])/2;return xt([n,i],t.properties,t)}function yc(r,t){t===void 0&&(t={});var e=0,n=0,i=0;return Ro(r,function(s){e+=s[0],n+=s[1],i++},!0),xt([e/i,n/i],t.properties)}function Cg(r,t){switch(t===void 0&&(t={}),sS(r)){case"Point":return xt(cr(r),t.properties);case"Polygon":var e=[];Ro(r,function(w){e.push(w)});var n=yc(r,{properties:t.properties}),i=n.geometry.coordinates,s=0,o=0,a=0,u,l,h,c,f,p,m,_,E=e.map(function(w){return[w[0]-i[0],w[1]-i[1]]});for(u=0;u<e.length-1;u++)l=E[u],c=l[0],p=l[1],h=E[u+1],f=h[0],m=h[1],_=c*m-f*p,a+=_,s+=(c+f)*_,o+=(p+m)*_;if(a===0)return n;var C=a*.5,v=1/(6*C);return xt([i[0]+v*s,i[1]+v*o],t.properties);default:var y=DS(r);return y?Cg(y,{properties:t.properties}):yc(r,{properties:t.properties})}}function Ig(r){if(!r)throw new Error("geojson is required");var t=[];return Ls(r,function(e){US(e,t)}),Lr(t)}function US(r,t){var e=[],n=r.geometry;if(n!==null){switch(n.type){case"Polygon":e=Rs(n);break;case"LineString":e=[Rs(n)]}e.forEach(function(i){var s=zS(i,r.properties);s.forEach(function(o){o.id=t.length,t.push(o)})})}}function zS(r,t){var e=[];return r.reduce(function(n,i){var s=Ir([n,i],t);return s.bbox=GS(n,i),e.push(s),i}),e}function GS(r,t){var e=r[0],n=r[1],i=t[0],s=t[1],o=e<i?e:i,a=n<s?n:s,u=e>i?e:i,l=n>s?n:s;return[o,a,u,l]}var Al={exports:{}},Ll={exports:{}},qS=Ll.exports,Pg;function WS(){return Pg||(Pg=1,(function(r,t){(function(e,n){r.exports=n()})(qS,function(){function e(v,y,w,S,P){(function M(b,D,F,N,L){for(;N>F;){if(N-F>600){var A=N-F+1,k=D-F+1,H=Math.log(A),et=.5*Math.exp(2*H/3),ht=.5*Math.sqrt(H*et*(A-et)/A)*(k-A/2<0?-1:1),Rt=Math.max(F,Math.floor(D-k*et/A+ht)),Qt=Math.min(N,Math.floor(D+(A-k)*et/A+ht));M(b,D,Rt,Qt,L)}var ke=b[D],Ft=F,Ot=N;for(n(b,F,D),L(b[N],ke)>0&&n(b,F,N);Ft<Ot;){for(n(b,Ft,Ot),Ft++,Ot--;L(b[Ft],ke)<0;)Ft++;for(;L(b[Ot],ke)>0;)Ot--}L(b[F],ke)===0?n(b,F,Ot):n(b,++Ot,N),Ot<=D&&(F=Ot+1),D<=Ot&&(N=Ot-1)}})(v,y,w||0,S||v.length-1,P||i)}function n(v,y,w){var S=v[y];v[y]=v[w],v[w]=S}function i(v,y){return v<y?-1:v>y?1:0}var s=function(v){v===void 0&&(v=9),this._maxEntries=Math.max(4,v),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(v,y,w){if(!w)return y.indexOf(v);for(var S=0;S<y.length;S++)if(w(v,y[S]))return S;return-1}function a(v,y){u(v,0,v.children.length,y,v)}function u(v,y,w,S,P){P||(P=E(null)),P.minX=1/0,P.minY=1/0,P.maxX=-1/0,P.maxY=-1/0;for(var M=y;M<w;M++){var b=v.children[M];l(P,v.leaf?S(b):b)}return P}function l(v,y){return v.minX=Math.min(v.minX,y.minX),v.minY=Math.min(v.minY,y.minY),v.maxX=Math.max(v.maxX,y.maxX),v.maxY=Math.max(v.maxY,y.maxY),v}function h(v,y){return v.minX-y.minX}function c(v,y){return v.minY-y.minY}function f(v){return(v.maxX-v.minX)*(v.maxY-v.minY)}function p(v){return v.maxX-v.minX+(v.maxY-v.minY)}function m(v,y){return v.minX<=y.minX&&v.minY<=y.minY&&y.maxX<=v.maxX&&y.maxY<=v.maxY}function _(v,y){return y.minX<=v.maxX&&y.minY<=v.maxY&&y.maxX>=v.minX&&y.maxY>=v.minY}function E(v){return{children:v,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function C(v,y,w,S,P){for(var M=[y,w];M.length;)if(!((w=M.pop())-(y=M.pop())<=S)){var b=y+Math.ceil((w-y)/S/2)*S;e(v,b,y,w,P),M.push(y,b,b,w)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(v){var y=this.data,w=[];if(!_(v,y))return w;for(var S=this.toBBox,P=[];y;){for(var M=0;M<y.children.length;M++){var b=y.children[M],D=y.leaf?S(b):b;_(v,D)&&(y.leaf?w.push(b):m(v,D)?this._all(b,w):P.push(b))}y=P.pop()}return w},s.prototype.collides=function(v){var y=this.data;if(!_(v,y))return!1;for(var w=[];y;){for(var S=0;S<y.children.length;S++){var P=y.children[S],M=y.leaf?this.toBBox(P):P;if(_(v,M)){if(y.leaf||m(v,M))return!0;w.push(P)}}y=w.pop()}return!1},s.prototype.load=function(v){if(!v||!v.length)return this;if(v.length<this._minEntries){for(var y=0;y<v.length;y++)this.insert(v[y]);return this}var w=this._build(v.slice(),0,v.length-1,0);if(this.data.children.length)if(this.data.height===w.height)this._splitRoot(this.data,w);else{if(this.data.height<w.height){var S=this.data;this.data=w,w=S}this._insert(w,this.data.height-w.height-1,!0)}else this.data=w;return this},s.prototype.insert=function(v){return v&&this._insert(v,this.data.height-1),this},s.prototype.clear=function(){return this.data=E([]),this},s.prototype.remove=function(v,y){if(!v)return this;for(var w,S,P,M=this.data,b=this.toBBox(v),D=[],F=[];M||D.length;){if(M||(M=D.pop(),S=D[D.length-1],w=F.pop(),P=!0),M.leaf){var N=o(v,M.children,y);if(N!==-1)return M.children.splice(N,1),D.push(M),this._condense(D),this}P||M.leaf||!m(M,b)?S?(w++,M=S.children[w],P=!1):M=null:(D.push(M),F.push(w),w=0,S=M,M=M.children[0])}return this},s.prototype.toBBox=function(v){return v},s.prototype.compareMinX=function(v,y){return v.minX-y.minX},s.prototype.compareMinY=function(v,y){return v.minY-y.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(v){return this.data=v,this},s.prototype._all=function(v,y){for(var w=[];v;)v.leaf?y.push.apply(y,v.children):w.push.apply(w,v.children),v=w.pop();return y},s.prototype._build=function(v,y,w,S){var P,M=w-y+1,b=this._maxEntries;if(M<=b)return a(P=E(v.slice(y,w+1)),this.toBBox),P;S||(S=Math.ceil(Math.log(M)/Math.log(b)),b=Math.ceil(M/Math.pow(b,S-1))),(P=E([])).leaf=!1,P.height=S;var D=Math.ceil(M/b),F=D*Math.ceil(Math.sqrt(b));C(v,y,w,F,this.compareMinX);for(var N=y;N<=w;N+=F){var L=Math.min(N+F-1,w);C(v,N,L,D,this.compareMinY);for(var A=N;A<=L;A+=D){var k=Math.min(A+D-1,L);P.children.push(this._build(v,A,k,S-1))}}return a(P,this.toBBox),P},s.prototype._chooseSubtree=function(v,y,w,S){for(;S.push(y),!y.leaf&&S.length-1!==w;){for(var P=1/0,M=1/0,b=void 0,D=0;D<y.children.length;D++){var F=y.children[D],N=f(F),L=(A=v,k=F,(Math.max(k.maxX,A.maxX)-Math.min(k.minX,A.minX))*(Math.max(k.maxY,A.maxY)-Math.min(k.minY,A.minY))-N);L<M?(M=L,P=N<P?N:P,b=F):L===M&&N<P&&(P=N,b=F)}y=b||y.children[0]}var A,k;return y},s.prototype._insert=function(v,y,w){var S=w?v:this.toBBox(v),P=[],M=this._chooseSubtree(S,this.data,y,P);for(M.children.push(v),l(M,S);y>=0&&P[y].children.length>this._maxEntries;)this._split(P,y),y--;this._adjustParentBBoxes(S,P,y)},s.prototype._split=function(v,y){var w=v[y],S=w.children.length,P=this._minEntries;this._chooseSplitAxis(w,P,S);var M=this._chooseSplitIndex(w,P,S),b=E(w.children.splice(M,w.children.length-M));b.height=w.height,b.leaf=w.leaf,a(w,this.toBBox),a(b,this.toBBox),y?v[y-1].children.push(b):this._splitRoot(w,b)},s.prototype._splitRoot=function(v,y){this.data=E([v,y]),this.data.height=v.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(v,y,w){for(var S,P,M,b,D,F,N,L=1/0,A=1/0,k=y;k<=w-y;k++){var H=u(v,0,k,this.toBBox),et=u(v,k,w,this.toBBox),ht=(P=H,M=et,b=void 0,D=void 0,F=void 0,N=void 0,b=Math.max(P.minX,M.minX),D=Math.max(P.minY,M.minY),F=Math.min(P.maxX,M.maxX),N=Math.min(P.maxY,M.maxY),Math.max(0,F-b)*Math.max(0,N-D)),Rt=f(H)+f(et);ht<L?(L=ht,S=k,A=Rt<A?Rt:A):ht===L&&Rt<A&&(A=Rt,S=k)}return S||w-y},s.prototype._chooseSplitAxis=function(v,y,w){var S=v.leaf?this.compareMinX:h,P=v.leaf?this.compareMinY:c;this._allDistMargin(v,y,w,S)<this._allDistMargin(v,y,w,P)&&v.children.sort(S)},s.prototype._allDistMargin=function(v,y,w,S){v.children.sort(S);for(var P=this.toBBox,M=u(v,0,y,P),b=u(v,w-y,w,P),D=p(M)+p(b),F=y;F<w-y;F++){var N=v.children[F];l(M,v.leaf?P(N):N),D+=p(M)}for(var L=w-y-1;L>=y;L--){var A=v.children[L];l(b,v.leaf?P(A):A),D+=p(b)}return D},s.prototype._adjustParentBBoxes=function(v,y,w){for(var S=w;S>=0;S--)l(y[S],v)},s.prototype._condense=function(v){for(var y=v.length-1,w=void 0;y>=0;y--)v[y].children.length===0?y>0?(w=v[y-1].children).splice(w.indexOf(v[y]),1):this.clear():a(v[y],this.toBBox)},s})})(Ll)),Ll.exports}var _c={},Mg;function bg(){return Mg||(Mg=1,(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=63710088e-1,r.factors={centimeters:r.earthRadius*100,centimetres:r.earthRadius*100,degrees:r.earthRadius/111325,feet:r.earthRadius*3.28084,inches:r.earthRadius*39.37,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:r.earthRadius*1e3,millimetres:r.earthRadius*1e3,nauticalmiles:r.earthRadius/1852,radians:1,yards:r.earthRadius*1.0936},r.unitsFactors={centimeters:100,centimetres:100,degrees:8982708286548395e-21,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:.0006213711922373339,millimeters:1e3,millimetres:1e3,nauticalmiles:.0005399568034557236,radians:1/r.earthRadius,yards:1.0936133},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function t(N,L,A){A===void 0&&(A={});var k={type:"Feature"};return(A.id===0||A.id)&&(k.id=A.id),A.bbox&&(k.bbox=A.bbox),k.properties=L||{},k.geometry=N,k}r.feature=t;function e(N,L,A){switch(N){case"Point":return n(L).geometry;case"LineString":return a(L).geometry;case"Polygon":return s(L).geometry;case"MultiPoint":return c(L).geometry;case"MultiLineString":return h(L).geometry;case"MultiPolygon":return f(L).geometry;default:throw new Error(N+" is invalid")}}r.geometry=e;function n(N,L,A){if(A===void 0&&(A={}),!N)throw new Error("coordinates is required");if(!Array.isArray(N))throw new Error("coordinates must be an Array");if(N.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!M(N[0])||!M(N[1]))throw new Error("coordinates must contain numbers");var k={type:"Point",coordinates:N};return t(k,L,A)}r.point=n;function i(N,L,A){return A===void 0&&(A={}),l(N.map(function(k){return n(k,L)}),A)}r.points=i;function s(N,L,A){A===void 0&&(A={});for(var k=0,H=N;k<H.length;k++){var et=H[k];if(et.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var ht=0;ht<et[et.length-1].length;ht++)if(et[et.length-1][ht]!==et[0][ht])throw new Error("First and last Position are not equivalent.")}var Rt={type:"Polygon",coordinates:N};return t(Rt,L,A)}r.polygon=s;function o(N,L,A){return A===void 0&&(A={}),l(N.map(function(k){return s(k,L)}),A)}r.polygons=o;function a(N,L,A){if(A===void 0&&(A={}),N.length<2)throw new Error("coordinates must be an array of two or more positions");var k={type:"LineString",coordinates:N};return t(k,L,A)}r.lineString=a;function u(N,L,A){return A===void 0&&(A={}),l(N.map(function(k){return a(k,L)}),A)}r.lineStrings=u;function l(N,L){L===void 0&&(L={});var A={type:"FeatureCollection"};return L.id&&(A.id=L.id),L.bbox&&(A.bbox=L.bbox),A.features=N,A}r.featureCollection=l;function h(N,L,A){A===void 0&&(A={});var k={type:"MultiLineString",coordinates:N};return t(k,L,A)}r.multiLineString=h;function c(N,L,A){A===void 0&&(A={});var k={type:"MultiPoint",coordinates:N};return t(k,L,A)}r.multiPoint=c;function f(N,L,A){A===void 0&&(A={});var k={type:"MultiPolygon",coordinates:N};return t(k,L,A)}r.multiPolygon=f;function p(N,L,A){A===void 0&&(A={});var k={type:"GeometryCollection",geometries:N};return t(k,L,A)}r.geometryCollection=p;function m(N,L){if(L===void 0&&(L=0),L&&!(L>=0))throw new Error("precision must be a positive number");var A=Math.pow(10,L||0);return Math.round(N*A)/A}r.round=m;function _(N,L){L===void 0&&(L="kilometers");var A=r.factors[L];if(!A)throw new Error(L+" units is invalid");return N*A}r.radiansToLength=_;function E(N,L){L===void 0&&(L="kilometers");var A=r.factors[L];if(!A)throw new Error(L+" units is invalid");return N/A}r.lengthToRadians=E;function C(N,L){return y(E(N,L))}r.lengthToDegrees=C;function v(N){var L=N%360;return L<0&&(L+=360),L}r.bearingToAzimuth=v;function y(N){var L=N%(2*Math.PI);return L*180/Math.PI}r.radiansToDegrees=y;function w(N){var L=N%360;return L*Math.PI/180}r.degreesToRadians=w;function S(N,L,A){if(L===void 0&&(L="kilometers"),A===void 0&&(A="kilometers"),!(N>=0))throw new Error("length must be a positive number");return _(E(N,L),A)}r.convertLength=S;function P(N,L,A){if(L===void 0&&(L="meters"),A===void 0&&(A="kilometers"),!(N>=0))throw new Error("area must be a positive number");var k=r.areaFactors[L];if(!k)throw new Error("invalid original units");var H=r.areaFactors[A];if(!H)throw new Error("invalid final units");return N/k*H}r.convertArea=P;function M(N){return!isNaN(N)&&N!==null&&!Array.isArray(N)}r.isNumber=M;function b(N){return!!N&&N.constructor===Object}r.isObject=b;function D(N){if(!N)throw new Error("bbox is required");if(!Array.isArray(N))throw new Error("bbox must be an Array");if(N.length!==4&&N.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");N.forEach(function(L){if(!M(L))throw new Error("bbox must only contain numbers")})}r.validateBBox=D;function F(N){if(!N)throw new Error("id is required");if(["string","number"].indexOf(typeof N)===-1)throw new Error("id must be a number or a string")}r.validateId=F})(_c)),_c}var ce={},xg;function Ng(){if(xg)return ce;xg=1,Object.defineProperty(ce,"__esModule",{value:!0});var r=bg();function t(v,y,w){if(v!==null)for(var S,P,M,b,D,F,N,L=0,A=0,k,H=v.type,et=H==="FeatureCollection",ht=H==="Feature",Rt=et?v.features.length:1,Qt=0;Qt<Rt;Qt++){N=et?v.features[Qt].geometry:ht?v.geometry:v,k=N?N.type==="GeometryCollection":!1,D=k?N.geometries.length:1;for(var ke=0;ke<D;ke++){var Ft=0,Ot=0;if(b=k?N.geometries[ke]:N,b!==null){F=b.coordinates;var Ve=b.type;switch(L=w&&(Ve==="Polygon"||Ve==="MultiPolygon")?1:0,Ve){case null:break;case"Point":if(y(F,A,Qt,Ft,Ot)===!1)return!1;A++,Ft++;break;case"LineString":case"MultiPoint":for(S=0;S<F.length;S++){if(y(F[S],A,Qt,Ft,Ot)===!1)return!1;A++,Ve==="MultiPoint"&&Ft++}Ve==="LineString"&&Ft++;break;case"Polygon":case"MultiLineString":for(S=0;S<F.length;S++){for(P=0;P<F[S].length-L;P++){if(y(F[S][P],A,Qt,Ft,Ot)===!1)return!1;A++}Ve==="MultiLineString"&&Ft++,Ve==="Polygon"&&Ot++}Ve==="Polygon"&&Ft++;break;case"MultiPolygon":for(S=0;S<F.length;S++){for(Ot=0,P=0;P<F[S].length;P++){for(M=0;M<F[S][P].length-L;M++){if(y(F[S][P][M],A,Qt,Ft,Ot)===!1)return!1;A++}Ot++}Ft++}break;case"GeometryCollection":for(S=0;S<b.geometries.length;S++)if(t(b.geometries[S],y,w)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function e(v,y,w,S){var P=w;return t(v,function(M,b,D,F,N){b===0&&w===void 0?P=M:P=y(P,M,b,D,F,N)},S),P}function n(v,y){var w;switch(v.type){case"FeatureCollection":for(w=0;w<v.features.length&&y(v.features[w].properties,w)!==!1;w++);break;case"Feature":y(v.properties,0);break}}function i(v,y,w){var S=w;return n(v,function(P,M){M===0&&w===void 0?S=P:S=y(S,P,M)}),S}function s(v,y){if(v.type==="Feature")y(v,0);else if(v.type==="FeatureCollection")for(var w=0;w<v.features.length&&y(v.features[w],w)!==!1;w++);}function o(v,y,w){var S=w;return s(v,function(P,M){M===0&&w===void 0?S=P:S=y(S,P,M)}),S}function a(v){var y=[];return t(v,function(w){y.push(w)}),y}function u(v,y){var w,S,P,M,b,D,F,N,L,A,k=0,H=v.type==="FeatureCollection",et=v.type==="Feature",ht=H?v.features.length:1;for(w=0;w<ht;w++){for(D=H?v.features[w].geometry:et?v.geometry:v,N=H?v.features[w].properties:et?v.properties:{},L=H?v.features[w].bbox:et?v.bbox:void 0,A=H?v.features[w].id:et?v.id:void 0,F=D?D.type==="GeometryCollection":!1,b=F?D.geometries.length:1,P=0;P<b;P++){if(M=F?D.geometries[P]:D,M===null){if(y(null,k,N,L,A)===!1)return!1;continue}switch(M.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(y(M,k,N,L,A)===!1)return!1;break}case"GeometryCollection":{for(S=0;S<M.geometries.length;S++)if(y(M.geometries[S],k,N,L,A)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}k++}}function l(v,y,w){var S=w;return u(v,function(P,M,b,D,F){M===0&&w===void 0?S=P:S=y(S,P,M,b,D,F)}),S}function h(v,y){u(v,function(w,S,P,M,b){var D=w===null?null:w.type;switch(D){case null:case"Point":case"LineString":case"Polygon":return y(r.feature(w,P,{bbox:M,id:b}),S,0)===!1?!1:void 0}var F;switch(D){case"MultiPoint":F="Point";break;case"MultiLineString":F="LineString";break;case"MultiPolygon":F="Polygon";break}for(var N=0;N<w.coordinates.length;N++){var L=w.coordinates[N],A={type:F,coordinates:L};if(y(r.feature(A,P),S,N)===!1)return!1}})}function c(v,y,w){var S=w;return h(v,function(P,M,b){M===0&&b===0&&w===void 0?S=P:S=y(S,P,M,b)}),S}function f(v,y){h(v,function(w,S,P){var M=0;if(w.geometry){var b=w.geometry.type;if(!(b==="Point"||b==="MultiPoint")){var D,F=0,N=0,L=0;if(t(w,function(A,k,H,et,ht){if(D===void 0||S>F||et>N||ht>L){D=A,F=S,N=et,L=ht,M=0;return}var Rt=r.lineString([D,A],w.properties);if(y(Rt,S,P,ht,M)===!1)return!1;M++,D=A})===!1)return!1}}})}function p(v,y,w){var S=w,P=!1;return f(v,function(M,b,D,F,N){P===!1&&w===void 0?S=M:S=y(S,M,b,D,F,N),P=!0}),S}function m(v,y){if(!v)throw new Error("geojson is required");h(v,function(w,S,P){if(w.geometry!==null){var M=w.geometry.type,b=w.geometry.coordinates;switch(M){case"LineString":if(y(w,S,P,0,0)===!1)return!1;break;case"Polygon":for(var D=0;D<b.length;D++)if(y(r.lineString(b[D],w.properties),S,P,D)===!1)return!1;break}}})}function _(v,y,w){var S=w;return m(v,function(P,M,b,D){M===0&&w===void 0?S=P:S=y(S,P,M,b,D)}),S}function E(v,y){if(y=y||{},!r.isObject(y))throw new Error("options is invalid");var w=y.featureIndex||0,S=y.multiFeatureIndex||0,P=y.geometryIndex||0,M=y.segmentIndex||0,b=y.properties,D;switch(v.type){case"FeatureCollection":w<0&&(w=v.features.length+w),b=b||v.features[w].properties,D=v.features[w].geometry;break;case"Feature":b=b||v.properties,D=v.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":D=v;break;default:throw new Error("geojson is invalid")}if(D===null)return null;var F=D.coordinates;switch(D.type){case"Point":case"MultiPoint":return null;case"LineString":return M<0&&(M=F.length+M-1),r.lineString([F[M],F[M+1]],b,y);case"Polygon":return P<0&&(P=F.length+P),M<0&&(M=F[P].length+M-1),r.lineString([F[P][M],F[P][M+1]],b,y);case"MultiLineString":return S<0&&(S=F.length+S),M<0&&(M=F[S].length+M-1),r.lineString([F[S][M],F[S][M+1]],b,y);case"MultiPolygon":return S<0&&(S=F.length+S),P<0&&(P=F[S].length+P),M<0&&(M=F[S][P].length-M-1),r.lineString([F[S][P][M],F[S][P][M+1]],b,y)}throw new Error("geojson is invalid")}function C(v,y){if(y=y||{},!r.isObject(y))throw new Error("options is invalid");var w=y.featureIndex||0,S=y.multiFeatureIndex||0,P=y.geometryIndex||0,M=y.coordIndex||0,b=y.properties,D;switch(v.type){case"FeatureCollection":w<0&&(w=v.features.length+w),b=b||v.features[w].properties,D=v.features[w].geometry;break;case"Feature":b=b||v.properties,D=v.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":D=v;break;default:throw new Error("geojson is invalid")}if(D===null)return null;var F=D.coordinates;switch(D.type){case"Point":return r.point(F,b,y);case"MultiPoint":return S<0&&(S=F.length+S),r.point(F[S],b,y);case"LineString":return M<0&&(M=F.length+M),r.point(F[M],b,y);case"Polygon":return P<0&&(P=F.length+P),M<0&&(M=F[P].length+M),r.point(F[P][M],b,y);case"MultiLineString":return S<0&&(S=F.length+S),M<0&&(M=F[S].length+M),r.point(F[S][M],b,y);case"MultiPolygon":return S<0&&(S=F.length+S),P<0&&(P=F[S].length+P),M<0&&(M=F[S][P].length-M),r.point(F[S][P][M],b,y)}throw new Error("geojson is invalid")}return ce.coordAll=a,ce.coordEach=t,ce.coordReduce=e,ce.featureEach=s,ce.featureReduce=o,ce.findPoint=C,ce.findSegment=E,ce.flattenEach=h,ce.flattenReduce=c,ce.geomEach=u,ce.geomReduce=l,ce.lineEach=m,ce.lineReduce=_,ce.propEach=n,ce.propReduce=i,ce.segmentEach=f,ce.segmentReduce=p,ce}var Rl={},Tg;function XS(){if(Tg)return Rl;Tg=1,Object.defineProperty(Rl,"__esModule",{value:!0});var r=Ng();function t(e){var n=[1/0,1/0,-1/0,-1/0];return r.coordEach(e,function(i){n[0]>i[0]&&(n[0]=i[0]),n[1]>i[1]&&(n[1]=i[1]),n[2]<i[0]&&(n[2]=i[0]),n[3]<i[1]&&(n[3]=i[1])}),n}return t.default=t,Rl.default=t,Rl}var Og;function BS(){if(Og)return Al.exports;Og=1;var r=WS(),t=bg(),e=Ng(),n=XS().default,i=e.featureEach;e.coordEach,t.polygon;var s=t.featureCollection;function o(a){var u=new r(a);return u.insert=function(l){if(l.type!=="Feature")throw new Error("invalid feature");return l.bbox=l.bbox?l.bbox:n(l),r.prototype.insert.call(this,l)},u.load=function(l){var h=[];return Array.isArray(l)?l.forEach(function(c){if(c.type!=="Feature")throw new Error("invalid features");c.bbox=c.bbox?c.bbox:n(c),h.push(c)}):i(l,function(c){if(c.type!=="Feature")throw new Error("invalid features");c.bbox=c.bbox?c.bbox:n(c),h.push(c)}),r.prototype.load.call(this,h)},u.remove=function(l,h){if(l.type!=="Feature")throw new Error("invalid feature");return l.bbox=l.bbox?l.bbox:n(l),r.prototype.remove.call(this,l,h)},u.clear=function(){return r.prototype.clear.call(this)},u.search=function(l){var h=r.prototype.search.call(this,this.toBBox(l));return s(h)},u.collides=function(l){return r.prototype.collides.call(this,this.toBBox(l))},u.all=function(){var l=r.prototype.all.call(this);return s(l)},u.toJSON=function(){return r.prototype.toJSON.call(this)},u.fromJSON=function(l){return r.prototype.fromJSON.call(this,l)},u.toBBox=function(l){var h;if(l.bbox)h=l.bbox;else if(Array.isArray(l)&&l.length===4)h=l;else if(Array.isArray(l)&&l.length===6)h=[l[0],l[1],l[3],l[4]];else if(l.type==="Feature")h=n(l);else if(l.type==="FeatureCollection")h=n(l);else throw new Error("invalid geojson");return{minX:h[0],minY:h[1],maxX:h[2],maxY:h[3]}},u}return Al.exports=o,Al.exports.default=o,Al.exports}var HS=BS();const YS=ig(HS);function Su(r,t){var e={},n=[];if(r.type==="LineString"&&(r=jr(r)),t.type==="LineString"&&(t=jr(t)),r.type==="Feature"&&t.type==="Feature"&&r.geometry!==null&&t.geometry!==null&&r.geometry.type==="LineString"&&t.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var i=Dg(r,t);return i&&n.push(i),Lr(n)}var s=YS();return s.load(Ig(t)),Fo(Ig(r),function(o){Fo(s.search(o),function(a){var u=Dg(o,a);if(u){var l=Rs(u).join(",");e[l]||(e[l]=!0,n.push(u))}})}),Lr(n)}function Dg(r,t){var e=Rs(r),n=Rs(t);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=e[0][0],s=e[0][1],o=e[1][0],a=e[1][1],u=n[0][0],l=n[0][1],h=n[1][0],c=n[1][1],f=(c-l)*(o-i)-(h-u)*(a-s),p=(h-u)*(s-l)-(c-l)*(i-u),m=(o-i)*(s-l)-(a-s)*(i-u);if(f===0)return null;var _=p/f,E=m/f;if(_>=0&&_<=1&&E>=0&&E<=1){var C=i+_*(o-i),v=s+_*(a-s);return xt([C,v])}return null}function JS(r,t,e){e===void 0&&(e={});var n=xt([1/0,1/0],{dist:1/0}),i=0;return Ls(r,function(s){for(var o=Rs(s),a=0;a<o.length-1;a++){var u=xt(o[a]);u.properties.dist=we(t,u,e);var l=xt(o[a+1]);l.properties.dist=we(t,l,e);var h=we(u,l,e),c=Math.max(u.properties.dist,l.properties.dist),f=Eu(u,l),p=Go(t,c,f+90,e),m=Go(t,c,f-90,e),_=Su(Ir([p.geometry.coordinates,m.geometry.coordinates]),Ir([u.geometry.coordinates,l.geometry.coordinates])),E=null;_.features.length>0&&(E=_.features[0],E.properties.dist=we(t,E,e),E.properties.location=i+we(u,E,e)),u.properties.dist<n.properties.dist&&(n=u,n.properties.index=a,n.properties.location=i),l.properties.dist<n.properties.dist&&(n=l,n.properties.index=a+1,n.properties.location=i+h),E&&E.properties.dist<n.properties.dist&&(n=E,n.properties.index=a),i+=h}}),n}function Ag(r,t,e){e===void 0&&(e={});var n=cr(r),i=cr(t);i[0]+=i[0]-n[0]>180?-360:n[0]-i[0]>180?360:0;var s=jS(n,i),o=uc(s,"meters",e.units);return o}function jS(r,t,e){e=e===void 0?ze:Number(e);var n=e,i=r[1]*Math.PI/180,s=t[1]*Math.PI/180,o=s-i,a=Math.abs(t[0]-r[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(s/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),l=Math.abs(u)>1e-11?o/u:Math.cos(i),h=Math.sqrt(o*o+l*l*a*a),c=h*n;return c}function QS(r,t,e){if(e===void 0&&(e={}),e.method||(e.method="geodesic"),e.units||(e.units="kilometers"),!r)throw new Error("pt is required");if(Array.isArray(r)?r=xt(r):r.type==="Point"?r=jr(r):ng(r,"Point","point"),!t)throw new Error("line is required");Array.isArray(t)?t=Ir(t):t.type==="LineString"?t=jr(t):ng(t,"LineString","line");var n=1/0,i=r.geometry.coordinates;return rg(t,function(s){var o=s.geometry.coordinates[0],a=s.geometry.coordinates[1],u=$S(i,o,a,e);u<n&&(n=u)}),uc(n,"degrees",e.units)}function $S(r,t,e,n){var i=[e[0]-t[0],e[1]-t[1]],s=[r[0]-t[0],r[1]-t[1]],o=Lg(s,i);if(o<=0)return wc(r,t,{method:n.method,units:"degrees"});var a=Lg(i,i);if(a<=o)return wc(r,e,{method:n.method,units:"degrees"});var u=o/a,l=[t[0]+u*i[0],t[1]+u*i[1]];return wc(r,l,{method:n.method,units:"degrees"})}function Lg(r,t){return r[0]*t[0]+r[1]*t[1]}function wc(r,t,e){return e.method==="planar"?Ag(r,t,e):we(r,t,e)}var Rg=6378137;function KS(r){return rS(r,function(t,e){return t+ZS(e)},0)}function ZS(r){var t=0,e;switch(r.type){case"Polygon":return Fg(r.coordinates);case"MultiPolygon":for(e=0;e<r.coordinates.length;e++)t+=Fg(r.coordinates[e]);return t;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function Fg(r){var t=0;if(r&&r.length>0){t+=Math.abs(kg(r[0]));for(var e=1;e<r.length;e++)t-=Math.abs(kg(r[e]))}return t}function kg(r){var t,e,n,i,s,o,a,u=0,l=r.length;if(l>2){for(a=0;a<l;a++)a===l-2?(i=l-2,s=l-1,o=0):a===l-1?(i=l-1,s=0,o=1):(i=a,s=a+1,o=a+2),t=r[i],e=r[s],n=r[o],u+=(Ec(n[0])-Ec(t[0]))*Math.sin(Ec(e[1]));u=u*Rg*Rg/2}return u}function Ec(r){return r*Math.PI/180}function Sc(r,t,e){e===void 0&&(e={});for(var n=$e(r),i=n.coordinates,s=0,o=0;o<i.length&&!(t>=s&&o===i.length-1);o++)if(s>=t){var a=t-s;if(a){var u=Eu(i[o],i[o-1])-180,l=Go(i[o],a,u,e);return l}else return xt(i[o])}else s+=we(i[o],i[o+1],e);return xt(i[i.length-1])}function Vg(r,t){return t===void 0&&(t={}),nS(r,function(e,n){var i=n.geometry.coordinates;return e+we(i[0],i[1],t)},0)}function xi(r,t,e){e===void 0&&(e={});for(var n=cr(r),i=Rs(t),s=0;s<i.length-1;s++){var o=!1;if(e.ignoreEndVertices&&(s===0&&(o="start"),s===i.length-2&&(o="end"),s===0&&s+1===i.length-1&&(o="both")),tC(i[s],i[s+1],n,o,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function tC(r,t,e,n,i){var s=e[0],o=e[1],a=r[0],u=r[1],l=t[0],h=t[1],c=e[0]-a,f=e[1]-u,p=l-a,m=h-u,_=c*m-f*p;if(i!==null){if(Math.abs(_)>i)return!1}else if(_!==0)return!1;if(n){if(n==="start")return Math.abs(p)>=Math.abs(m)?p>0?a<s&&s<=l:l<=s&&s<a:m>0?u<o&&o<=h:h<=o&&o<u;if(n==="end")return Math.abs(p)>=Math.abs(m)?p>0?a<=s&&s<l:l<s&&s<=a:m>0?u<=o&&o<h:h<o&&o<=u;if(n==="both")return Math.abs(p)>=Math.abs(m)?p>0?a<s&&s<l:l<s&&s<a:m>0?u<o&&o<h:h<o&&o<u}else return Math.abs(p)>=Math.abs(m)?p>0?a<=s&&s<=l:l<=s&&s<=a:m>0?u<=o&&o<=h:h<=o&&o<=u;return!1}function Ug(r,t){var e=$e(r),n=$e(t),i=e.type,s=n.type;switch(i){case"Point":switch(s){case"MultiPoint":return eC(e,n);case"LineString":return xi(e,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return be(e,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return rC(e,n);case"LineString":return nC(e,n);case"Polygon":case"MultiPolygon":return iC(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return sC(e,n);case"Polygon":case"MultiPolygon":return oC(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return aC(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function eC(r,t){var e,n=!1;for(e=0;e<t.coordinates.length;e++)if(Gg(t.coordinates[e],r.coordinates)){n=!0;break}return n}function rC(r,t){for(var e=0;e<r.coordinates.length;e++){for(var n=!1,i=0;i<t.coordinates.length;i++)Gg(r.coordinates[e],t.coordinates[i])&&(n=!0);if(!n)return!1}return!0}function nC(r,t){for(var e=!1,n=0;n<r.coordinates.length;n++){if(!xi(r.coordinates[n],t))return!1;e||(e=xi(r.coordinates[n],t,{ignoreEndVertices:!0}))}return e}function iC(r,t){for(var e=!0,n=!1,i=0;i<r.coordinates.length;i++){if(n=be(r.coordinates[1],t),!n){e=!1;break}n=be(r.coordinates[1],t,{ignoreBoundary:!0})}return e&&n}function sC(r,t){for(var e=0;e<r.coordinates.length;e++)if(!xi(r.coordinates[e],t))return!1;return!0}function oC(r,t){var e=Qr(t),n=Qr(r);if(!zg(e,n))return!1;for(var i=!1,s=0;s<r.coordinates.length-1;s++){if(!be(r.coordinates[s],t))return!1;if(i||(i=be(r.coordinates[s],t,{ignoreBoundary:!0})),!i){var o=uC(r.coordinates[s],r.coordinates[s+1]);i=be(o,t,{ignoreBoundary:!0})}}return i}function aC(r,t){var e=Qr(r),n=Qr(t);if(!zg(n,e))return!1;for(var i=0;i<r.coordinates[0].length;i++)if(!be(r.coordinates[0][i],t))return!1;return!0}function zg(r,t){return!(r[0]>t[0]||r[2]<t[2]||r[1]>t[1]||r[3]<t[3])}function Gg(r,t){return r[0]===t[0]&&r[1]===t[1]}function uC(r,t){return[(r[0]+t[0])/2,(r[1]+t[1])/2]}function lC(r,t,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var n=[],i=r[0],s=r[1],o=r[2],a=r[3],u=t/we([i,s],[o,s],e),l=u*(o-i),h=t/we([i,s],[i,a],e),c=h*(a-s),f=o-i,p=a-s,m=Math.floor(f/l),_=Math.floor(p/c),E=(f-m*l)/2,C=(p-_*c)/2,v=i+E;v<=o;){for(var y=s+C;y<=a;){var w=xt([v,y],e.properties);e.mask?Ug(w,e.mask)&&n.push(w):n.push(w),y+=c}v+=l}return Lr(n)}function Cc(r,t){t===void 0&&(t={});var e=$e(r);switch(!t.properties&&r.type==="Feature"&&(t.properties=r.properties),e.type){case"Polygon":return hC(e,t);case"MultiPolygon":return cC(e,t);default:throw new Error("invalid poly")}}function hC(r,t){t===void 0&&(t={});var e=$e(r),n=e.coordinates,i=t.properties?t.properties:r.type==="Feature"?r.properties:{};return qg(n,i)}function cC(r,t){t===void 0&&(t={});var e=$e(r),n=e.coordinates,i=t.properties?t.properties:r.type==="Feature"?r.properties:{},s=[];return n.forEach(function(o){s.push(qg(o,i))}),Lr(s)}function qg(r,t){return r.length>1?eS(r,t):Ir(r[0],t)}function fC(r,t,e){e===void 0&&(e={});var n;e.final?n=Wg(cr(t),cr(r)):n=Wg(cr(r),cr(t));var i=n>180?-(360-n):n;return i}function Wg(r,t){var e=Qe(r[1]),n=Qe(t[1]),i=Qe(t[0]-r[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var s=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(e/2+Math.PI/4)),o=Math.atan2(i,s);return(xl(o)+360)%360}function dC(r,t,e,n){n===void 0&&(n={});var i=t<0,s=uc(Math.abs(t),n.units,"meters");i&&(s=-Math.abs(s));var o=cr(r),a=pC(o,s,e);return a[0]+=a[0]-o[0]>180?-360:o[0]-a[0]>180?360:0,xt(a,n.properties)}function pC(r,t,e,n){n=n===void 0?ze:Number(n);var i=t/n,s=r[0]*Math.PI/180,o=Qe(r[1]),a=Qe(e),u=i*Math.cos(a),l=o+u;Math.abs(l)>Math.PI/2&&(l=l>0?Math.PI-l:-Math.PI-l);var h=Math.log(Math.tan(l/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),c=Math.abs(h)>1e-11?u/h:Math.cos(o),f=i*Math.sin(a)/c,p=s+f;return[(p*180/Math.PI+540)%360-180,l*180/Math.PI]}function gC(r,t){var e=!0;return Ls(r,function(n){Ls(t,function(i){if(e===!1)return!1;e=mC(n.geometry,i.geometry)})}),e}function mC(r,t){switch(r.type){case"Point":switch(t.type){case"Point":return!wC(r.coordinates,t.coordinates);case"LineString":return!Xg(t,r);case"Polygon":return!be(r,t)}break;case"LineString":switch(t.type){case"Point":return!Xg(r,t);case"LineString":return!vC(r,t);case"Polygon":return!Bg(t,r)}break;case"Polygon":switch(t.type){case"Point":return!be(t,r);case"LineString":return!Bg(r,t);case"Polygon":return!yC(t,r)}}return!1}function Xg(r,t){for(var e=0;e<r.coordinates.length-1;e++)if(_C(r.coordinates[e],r.coordinates[e+1],t.coordinates))return!0;return!1}function vC(r,t){var e=Su(r,t);return e.features.length>0}function Bg(r,t){for(var e=0,n=t.coordinates;e<n.length;e++){var i=n[e];if(be(i,r))return!0}var s=Su(t,Cc(r));return s.features.length>0}function yC(r,t){for(var e=0,n=r.coordinates[0];e<n.length;e++){var i=n[e];if(be(i,t))return!0}for(var s=0,o=t.coordinates[0];s<o.length;s++){var a=o[s];if(be(a,r))return!0}var u=Su(Cc(r),Cc(t));return u.features.length>0}function _C(r,t,e){var n=e[0]-r[0],i=e[1]-r[1],s=t[0]-r[0],o=t[1]-r[1],a=n*o-i*s;return a!==0?!1:Math.abs(s)>=Math.abs(o)?s>0?r[0]<=e[0]&&e[0]<=t[0]:t[0]<=e[0]&&e[0]<=r[0]:o>0?r[1]<=e[1]&&e[1]<=t[1]:t[1]<=e[1]&&e[1]<=r[1]}function wC(r,t){return r[0]===t[0]&&r[1]===t[1]}function EC(r,t){var e=$e(r),n=$e(t),i=e.type,s=n.type,o=e.coordinates,a=n.coordinates;switch(i){case"Point":switch(s){case"Point":return Ic(o,a);default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"Point":return SC(e,n);case"MultiPoint":return CC(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"Point":return xi(n,e,{ignoreEndVertices:!0});case"LineString":return MC(e,n);case"MultiPoint":return IC(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Point":return be(n,e,{ignoreBoundary:!0});case"LineString":return bC(e,n);case"Polygon":return xC(e,n);case"MultiPoint":return PC(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function SC(r,t){var e,n=!1;for(e=0;e<r.coordinates.length;e++)if(Ic(r.coordinates[e],t.coordinates)){n=!0;break}return n}function CC(r,t){for(var e=0,n=t.coordinates;e<n.length;e++){for(var i=n[e],s=!1,o=0,a=r.coordinates;o<a.length;o++){var u=a[o];if(Ic(i,u)){s=!0;break}}if(!s)return!1}return!0}function IC(r,t){for(var e=!1,n=0,i=t.coordinates;n<i.length;n++){var s=i[n];if(xi(s,r,{ignoreEndVertices:!0})&&(e=!0),!xi(s,r))return!1}return!!e}function PC(r,t){for(var e=0,n=t.coordinates;e<n.length;e++){var i=n[e];if(!be(i,r,{ignoreBoundary:!0}))return!1}return!0}function MC(r,t){for(var e=!1,n=0,i=t.coordinates;n<i.length;n++){var s=i[n];if(xi({type:"Point",coordinates:s},r,{ignoreEndVertices:!0})&&(e=!0),!xi({type:"Point",coordinates:s},r,{ignoreEndVertices:!1}))return!1}return e}function bC(r,t){var e=!1,n=0,i=Qr(r),s=Qr(t);if(!Hg(i,s))return!1;for(n;n<t.coordinates.length-1;n++){var o=NC(t.coordinates[n],t.coordinates[n+1]);if(be({type:"Point",coordinates:o},r,{ignoreBoundary:!0})){e=!0;break}}return e}function xC(r,t){if(r.type==="Feature"&&r.geometry===null||t.type==="Feature"&&t.geometry===null)return!1;var e=Qr(r),n=Qr(t);if(!Hg(e,n))return!1;for(var i=$e(t).coordinates,s=0,o=i;s<o.length;s++)for(var a=o[s],u=0,l=a;u<l.length;u++){var h=l[u];if(!be(h,r))return!1}return!0}function Hg(r,t){return!(r[0]>t[0]||r[2]<t[2]||r[1]>t[1]||r[3]<t[3])}function Ic(r,t){return r[0]===t[0]&&r[1]===t[1]}function NC(r,t){return[(r[0]+t[0])/2,(r[1]+t[1])/2]}function TC(r,t){var e=!1;return Ls(r,function(n){Ls(t,function(i){if(e===!0)return!0;e=!gC(n.geometry,i.geometry)})}),e}/**
4
45
  * splaytree v3.1.2
5
46
  * Fast Splay tree for Node and browser
6
47
  *
@@ -20,35 +61,14 @@ ${u.map(h=>`${h.id} ${h.typeName}
20
61
 
21
62
  See the Apache Version 2.0 License for specific language governing permissions
22
63
  and limitations under the License.
23
- ***************************************************************************** */function Ky(r,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(h){return u([l,h])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,i=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){e.label=l[1];break}if(l[0]===6&&e.label<s[1]){e.label=s[1],s=l;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(l);break}s[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(r,e)}catch(h){l=[6,h],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var Es=function(){function r(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return r}();function Zy(r,t){return r>t?1:r<t?-1:0}function ws(r,t,e){for(var n=new Es(null,null),i=n,s=n;;){var o=e(r,t.key);if(o<0){if(t.left===null)break;if(e(r,t.left.key)<0){var a=t.left;if(t.left=a.right,a.right=t,t=a,t.left===null)break}s.left=t,s=t,t=t.left}else if(o>0){if(t.right===null)break;if(e(r,t.right.key)>0){var a=t.right;if(t.right=a.left,a.left=t,t=a,t.right===null)break}i.right=t,i=t,t=t.right}else break}return i.right=t.left,s.left=t.right,t.left=n.right,t.right=n.left,t}function yc(r,t,e,n){var i=new Es(r,t);if(e===null)return i.left=i.right=null,i;e=ws(r,e,n);var s=n(r,e.key);return s<0?(i.left=e.left,i.right=e,e.left=null):s>=0&&(i.right=e.right,i.left=e,e.right=null),i}function $g(r,t,e){var n=null,i=null;if(t){t=ws(r,t,e);var s=e(t.key,r);s===0?(n=t.left,i=t.right):s<0?(i=t.right,t.right=null,n=t):(n=t.left,t.left=null,i=t)}return{left:n,right:i}}function $y(r,t,e){return t===null?r:(r===null||(t=ws(r.key,t,e),t.left=r),t)}function _c(r,t,e,n,i){if(r){n(""+t+(e?"└── ":"├── ")+i(r)+`
24
- `);var s=t+(e?" ":"│ ");r.left&&_c(r.left,s,!1,n,i),r.right&&_c(r.right,s,!0,n,i)}}var Ec=function(){function r(t){t===void 0&&(t=Zy),this._root=null,this._size=0,this._comparator=t}return r.prototype.insert=function(t,e){return this._size++,this._root=yc(t,e,this._root,this._comparator)},r.prototype.add=function(t,e){var n=new Es(t,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,s=ws(t,this._root,i),o=i(t,s.key);return o===0?this._root=s:(o<0?(n.left=s.left,n.right=s,s.left=null):o>0&&(n.right=s.right,n.left=s,s.right=null),this._size++,this._root=n),this._root},r.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},r.prototype._remove=function(t,e,n){var i;if(e===null)return null;e=ws(t,e,n);var s=n(t,e.key);return s===0?(e.left===null?i=e.right:(i=ws(t,e.left,n),i.right=e.right),this._size--,i):e},r.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=ws(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},r.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},r.prototype.find=function(t){return this._root&&(this._root=ws(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},r.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},r.prototype.forEach=function(t,e){for(var n=this._root,i=[],s=!1;!s;)n!==null?(i.push(n),n=n.left):i.length!==0?(n=i.pop(),t.call(e,n),n=n.right):s=!0;return this},r.prototype.range=function(t,e,n,i){for(var s=[],o=this._comparator,a=this._root,u;s.length!==0||a;)if(a)s.push(a),a=a.left;else{if(a=s.pop(),u=o(a.key,e),u>0)break;if(o(a.key,t)>=0&&n.call(i,a))return this;a=a.right}return this},r.prototype.keys=function(){var t=[];return this.forEach(function(e){var n=e.key;return t.push(n)}),t},r.prototype.values=function(){var t=[];return this.forEach(function(e){var n=e.data;return t.push(n)}),t},r.prototype.min=function(){return this._root?this.minNode(this._root).key:null},r.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},r.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},r.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},r.prototype.at=function(t){for(var e=this._root,n=!1,i=0,s=[];!n;)if(e)s.push(e),e=e.left;else if(s.length>0){if(e=s.pop(),i===t)return e;i++,e=e.right}else n=!0;return null},r.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var i=this._comparator;e;){var s=i(t.key,e.key);if(s===0)break;s<0?(n=e,e=e.left):e=e.right}return n},r.prototype.prev=function(t){var e=this._root,n=null;if(t.left!==null){for(n=t.left;n.right;)n=n.right;return n}for(var i=this._comparator;e;){var s=i(t.key,e.key);if(s===0)break;s<0?e=e.left:(n=e,e=e.right)}return n},r.prototype.clear=function(){return this._root=null,this._size=0,this},r.prototype.toList=function(){return t_(this._root)},r.prototype.load=function(t,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var i=t.length,s=this._comparator;if(n&&Cc(t,e,0,i-1,s),this._root===null)this._root=wc(t,e,0,i),this._size=i;else{var o=e_(this.toList(),jy(t,e),s);i=this._size+i,this._root=Sc({head:o},0,i)}return this},r.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),r.prototype.toString=function(t){t===void 0&&(t=function(n){return String(n.key)});var e=[];return _c(this._root,"",!0,function(n){return e.push(n)},t),e.join("")},r.prototype.update=function(t,e,n){var i=this._comparator,s=$g(t,this._root,i),o=s.left,a=s.right;i(t,e)<0?a=yc(e,n,a,i):o=yc(e,n,o,i),this._root=$y(o,a,i)},r.prototype.split=function(t){return $g(t,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var t,e,n;return Ky(this,function(i){switch(i.label){case 0:t=this._root,e=[],n=!1,i.label=1;case 1:return n?[3,6]:t===null?[3,2]:(e.push(t),t=t.left,[3,5]);case 2:return e.length===0?[3,4]:(t=e.pop(),[4,t]);case 3:return i.sent(),t=t.right,[3,5];case 4:n=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},r}();function wc(r,t,e,n){var i=n-e;if(i>0){var s=e+Math.floor(i/2),o=r[s],a=t[s],u=new Es(o,a);return u.left=wc(r,t,e,s),u.right=wc(r,t,s+1,n),u}return null}function jy(r,t){for(var e=new Es(null,null),n=e,i=0;i<r.length;i++)n=n.next=new Es(r[i],t[i]);return n.next=null,e.next}function t_(r){for(var t=r,e=[],n=!1,i=new Es(null,null),s=i;!n;)t?(e.push(t),t=t.left):e.length>0?(t=s=s.next=e.pop(),t=t.right):n=!0;return s.next=null,i.next}function Sc(r,t,e){var n=e-t;if(n>0){var i=t+Math.floor(n/2),s=Sc(r,t,i),o=r.head;return o.left=s,r.head=r.head.next,o.right=Sc(r,i+1,e),o}return null}function e_(r,t,e){for(var n=new Es(null,null),i=n,s=r,o=t;s!==null&&o!==null;)e(s.key,o.key)<0?(i.next=s,s=s.next):(i.next=o,o=o.next),i=i.next;return s!==null?i.next=s:o!==null&&(i.next=o),n.next}function Cc(r,t,e,n,i){if(!(e>=n)){for(var s=r[e+n>>1],o=e-1,a=n+1;;){do o++;while(i(r[o],s)<0);do a--;while(i(r[a],s)>0);if(o>=a)break;var u=r[o];r[o]=r[a],r[a]=u,u=t[o],t[o]=t[a],t[a]=u}Cc(r,t,e,a,i),Cc(r,t,a+1,n,i)}}const Ki=11102230246251565e-32,fr=134217729,r_=(3+8*Ki)*Ki;function Pc(r,t,e,n,i){let s,o,a,u,l=t[0],h=n[0],c=0,f=0;h>l==h>-l?(s=l,l=t[++c]):(s=h,h=n[++f]);let p=0;if(c<r&&f<e)for(h>l==h>-l?(o=l+s,a=s-(o-l),l=t[++c]):(o=h+s,a=s-(o-h),h=n[++f]),s=o,a!==0&&(i[p++]=a);c<r&&f<e;)h>l==h>-l?(o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++c]):(o=s+h,u=o-s,a=s-(o-u)+(h-u),h=n[++f]),s=o,a!==0&&(i[p++]=a);for(;c<r;)o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++c],s=o,a!==0&&(i[p++]=a);for(;f<e;)o=s+h,u=o-s,a=s-(o-u)+(h-u),h=n[++f],s=o,a!==0&&(i[p++]=a);return(s!==0||p===0)&&(i[p++]=s),p}function n_(r,t){let e=t[0];for(let n=1;n<r;n++)e+=t[n];return e}function wu(r){return new Float64Array(r)}const i_=(3+16*Ki)*Ki,s_=(2+12*Ki)*Ki,o_=(9+64*Ki)*Ki*Ki,Zo=wu(4),jg=wu(8),tp=wu(12),ep=wu(16),Mr=wu(4);function a_(r,t,e,n,i,s,o){let a,u,l,h,c,f,p,v,_,w,I,y,E,m,S,C,P,N;const T=r-i,O=e-i,b=t-s,x=n-s;m=T*x,f=fr*T,p=f-(f-T),v=T-p,f=fr*x,_=f-(f-x),w=x-_,S=v*w-(m-p*_-v*_-p*w),C=b*O,f=fr*b,p=f-(f-b),v=b-p,f=fr*O,_=f-(f-O),w=O-_,P=v*w-(C-p*_-v*_-p*w),I=S-P,c=S-I,Zo[0]=S-(I+c)+(c-P),y=m+I,c=y-m,E=m-(y-c)+(I-c),I=E-C,c=E-I,Zo[1]=E-(I+c)+(c-C),N=y+I,c=N-y,Zo[2]=y-(N-c)+(I-c),Zo[3]=N;let R=n_(4,Zo),V=s_*o;if(R>=V||-R>=V||(c=r-T,a=r-(T+c)+(c-i),c=e-O,l=e-(O+c)+(c-i),c=t-b,u=t-(b+c)+(c-s),c=n-x,h=n-(x+c)+(c-s),a===0&&u===0&&l===0&&h===0)||(V=o_*o+r_*Math.abs(R),R+=T*h+x*a-(b*l+O*u),R>=V||-R>=V))return R;m=a*x,f=fr*a,p=f-(f-a),v=a-p,f=fr*x,_=f-(f-x),w=x-_,S=v*w-(m-p*_-v*_-p*w),C=u*O,f=fr*u,p=f-(f-u),v=u-p,f=fr*O,_=f-(f-O),w=O-_,P=v*w-(C-p*_-v*_-p*w),I=S-P,c=S-I,Mr[0]=S-(I+c)+(c-P),y=m+I,c=y-m,E=m-(y-c)+(I-c),I=E-C,c=E-I,Mr[1]=E-(I+c)+(c-C),N=y+I,c=N-y,Mr[2]=y-(N-c)+(I-c),Mr[3]=N;const Z=Pc(4,Zo,4,Mr,jg);m=T*h,f=fr*T,p=f-(f-T),v=T-p,f=fr*h,_=f-(f-h),w=h-_,S=v*w-(m-p*_-v*_-p*w),C=b*l,f=fr*b,p=f-(f-b),v=b-p,f=fr*l,_=f-(f-l),w=l-_,P=v*w-(C-p*_-v*_-p*w),I=S-P,c=S-I,Mr[0]=S-(I+c)+(c-P),y=m+I,c=y-m,E=m-(y-c)+(I-c),I=E-C,c=E-I,Mr[1]=E-(I+c)+(c-C),N=y+I,c=N-y,Mr[2]=y-(N-c)+(I-c),Mr[3]=N;const J=Pc(Z,jg,4,Mr,tp);m=a*h,f=fr*a,p=f-(f-a),v=a-p,f=fr*h,_=f-(f-h),w=h-_,S=v*w-(m-p*_-v*_-p*w),C=u*l,f=fr*u,p=f-(f-u),v=u-p,f=fr*l,_=f-(f-l),w=l-_,P=v*w-(C-p*_-v*_-p*w),I=S-P,c=S-I,Mr[0]=S-(I+c)+(c-P),y=m+I,c=y-m,E=m-(y-c)+(I-c),I=E-C,c=E-I,Mr[1]=E-(I+c)+(c-C),N=y+I,c=N-y,Mr[2]=y-(N-c)+(I-c),Mr[3]=N;const it=Pc(J,tp,4,Mr,ep);return ep[it-1]}function u_(r,t,e,n,i,s){const o=(t-s)*(e-i),a=(r-i)*(n-s),u=o-a,l=Math.abs(o+a);return Math.abs(u)>=i_*l?u:-a_(r,t,e,n,i,s,l)}const Su=(r,t)=>r.ll.x<=t.x&&t.x<=r.ur.x&&r.ll.y<=t.y&&t.y<=r.ur.y,Ic=(r,t)=>{if(t.ur.x<r.ll.x||r.ur.x<t.ll.x||t.ur.y<r.ll.y||r.ur.y<t.ll.y)return null;const e=r.ll.x<t.ll.x?t.ll.x:r.ll.x,n=r.ur.x<t.ur.x?r.ur.x:t.ur.x,i=r.ll.y<t.ll.y?t.ll.y:r.ll.y,s=r.ur.y<t.ur.y?r.ur.y:t.ur.y;return{ll:{x:e,y:i},ur:{x:n,y:s}}};let Ss=Number.EPSILON;Ss===void 0&&(Ss=Math.pow(2,-52));const l_=Ss*Ss,rp=(r,t)=>{if(-Ss<r&&r<Ss&&-Ss<t&&t<Ss)return 0;const e=r-t;return e*e<l_*r*t?0:r<t?-1:1};class h_{constructor(){this.reset()}reset(){this.xRounder=new np,this.yRounder=new np}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}class np{constructor(){this.tree=new Ec,this.round(0)}round(t){const e=this.tree.add(t),n=this.tree.prev(e);if(n!==null&&rp(e.key,n.key)===0)return this.tree.remove(t),n.key;const i=this.tree.next(e);return i!==null&&rp(e.key,i.key)===0?(this.tree.remove(t),i.key):t}}const Cu=new h_,zl=(r,t)=>r.x*t.y-r.y*t.x,ip=(r,t)=>r.x*t.x+r.y*t.y,sp=(r,t,e)=>{const n=u_(r.x,r.y,t.x,t.y,e.x,e.y);return n>0?-1:n<0?1:0},ql=r=>Math.sqrt(ip(r,r)),c_=(r,t,e)=>{const n={x:t.x-r.x,y:t.y-r.y},i={x:e.x-r.x,y:e.y-r.y};return zl(i,n)/ql(i)/ql(n)},f_=(r,t,e)=>{const n={x:t.x-r.x,y:t.y-r.y},i={x:e.x-r.x,y:e.y-r.y};return ip(i,n)/ql(i)/ql(n)},op=(r,t,e)=>t.y===0?null:{x:r.x+t.x/t.y*(e-r.y),y:e},ap=(r,t,e)=>t.x===0?null:{x:e,y:r.y+t.y/t.x*(e-r.x)},d_=(r,t,e,n)=>{if(t.x===0)return ap(e,n,r.x);if(n.x===0)return ap(r,t,e.x);if(t.y===0)return op(e,n,r.y);if(n.y===0)return op(r,t,e.y);const i=zl(t,n);if(i==0)return null;const s={x:e.x-r.x,y:e.y-r.y},o=zl(s,t)/i,a=zl(s,n)/i,u=r.x+a*t.x,l=e.x+o*n.x,h=r.y+a*t.y,c=e.y+o*n.y,f=(u+l)/2,p=(h+c)/2;return{x:f,y:p}};class vn{static compare(t,e){const n=vn.comparePoints(t.point,e.point);return n!==0?n:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:Cs.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}constructor(t,e){t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let n=0,i=e.length;n<i;n++){const s=e[n];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let i=e+1;i<t;i++){const s=this.point.events[i];s.consumedBy===void 0&&n.otherSE.point.events===s.otherSE.point.events&&n.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,n=this.point.events.length;e<n;e++){const i=this.point.events[e];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}getLeftmostComparator(t){const e=new Map,n=i=>{const s=i.otherSE;e.set(i,{sine:c_(this.point,t.point,s.point),cosine:f_(this.point,t.point,s.point)})};return(i,s)=>{e.has(i)||n(i),e.has(s)||n(s);const{sine:o,cosine:a}=e.get(i),{sine:u,cosine:l}=e.get(s);return o>=0&&u>=0?a<l?1:a>l?-1:0:o<0&&u<0?a<l?-1:a>l?1:0:u<o?-1:u>o?1:0}}}let g_=0;class Cs{static compare(t,e){const n=t.leftSE.point.x,i=e.leftSE.point.x,s=t.rightSE.point.x,o=e.rightSE.point.x;if(o<n)return 1;if(s<i)return-1;const a=t.leftSE.point.y,u=e.leftSE.point.y,l=t.rightSE.point.y,h=e.rightSE.point.y;if(n<i){if(u<a&&u<l)return 1;if(u>a&&u>l)return-1;const c=t.comparePoint(e.leftSE.point);if(c<0)return 1;if(c>0)return-1;const f=e.comparePoint(t.rightSE.point);return f!==0?f:-1}if(n>i){if(a<u&&a<h)return-1;if(a>u&&a>h)return 1;const c=e.comparePoint(t.leftSE.point);if(c!==0)return c;const f=t.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(a<u)return-1;if(a>u)return 1;if(s<o){const c=e.comparePoint(t.rightSE.point);if(c!==0)return c}if(s>o){const c=t.comparePoint(e.rightSE.point);if(c<0)return 1;if(c>0)return-1}if(s!==o){const c=l-a,f=s-n,p=h-u,v=o-i;if(c>f&&p<v)return 1;if(c<f&&p>v)return-1}return s>o?1:s<o||l<h?-1:l>h?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,n,i){this.id=++g_,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=i}static fromRing(t,e,n){let i,s,o;const a=vn.comparePoints(t,e);if(a<0)i=t,s=e,o=1;else if(a>0)i=e,s=t,o=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);const u=new vn(i,!0),l=new vn(s,!1);return new Cs(u,l,[n],[o])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const e=this.leftSE.point,n=this.rightSE.point,i=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;const s=(t.y-e.y)/i.y,o=e.x+s*i.x;if(t.x===o)return 0;const a=(t.x-e.x)/i.x,u=e.y+a*i.y;return t.y===u?0:t.y<u?-1:1}getIntersection(t){const e=this.bbox(),n=t.bbox(),i=Ic(e,n);if(i===null)return null;const s=this.leftSE.point,o=this.rightSE.point,a=t.leftSE.point,u=t.rightSE.point,l=Su(e,a)&&this.comparePoint(a)===0,h=Su(n,s)&&t.comparePoint(s)===0,c=Su(e,u)&&this.comparePoint(u)===0,f=Su(n,o)&&t.comparePoint(o)===0;if(h&&l)return f&&!c?o:!f&&c?u:null;if(h)return c&&s.x===u.x&&s.y===u.y?null:s;if(l)return f&&o.x===a.x&&o.y===a.y?null:a;if(f&&c)return null;if(f)return o;if(c)return u;const p=d_(s,this.vector(),a,t.vector());return p===null||!Su(i,p)?null:Cu.round(p.x,p.y)}split(t){const e=[],n=t.events!==void 0,i=new vn(t,!0),s=new vn(t,!1),o=this.rightSE;this.replaceRightSE(s),e.push(s),e.push(i);const a=new Cs(i,o,this.rings.slice(),this.windings.slice());return vn.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),vn.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),s.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(t){let e=this,n=t;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const i=Cs.compare(e,n);if(i!==0){if(i>0){const s=e;e=n,n=s}if(e.prev===n){const s=e;e=n,n=s}for(let s=0,o=n.rings.length;s<o;s++){const a=n.rings[s],u=n.windings[s],l=e.rings.indexOf(a);l===-1?(e.rings.push(a),e.windings.push(u)):e.windings[l]+=u}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,i=this._afterState.multiPolys;for(let a=0,u=this.rings.length;a<u;a++){const l=this.rings[a],h=this.windings[a],c=e.indexOf(l);c===-1?(e.push(l),n.push(h)):n[c]+=h}const s=[],o=[];for(let a=0,u=e.length;a<u;a++){if(n[a]===0)continue;const l=e[a],h=l.poly;if(o.indexOf(h)===-1)if(l.isExterior)s.push(h);else{o.indexOf(h)===-1&&o.push(h);const c=s.indexOf(l.poly);c!==-1&&s.splice(c,1)}}for(let a=0,u=s.length;a<u;a++){const l=s[a].multiPoly;i.indexOf(l)===-1&&i.push(l)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Qn.type){case"union":{const n=t.length===0,i=e.length===0;this._isInResult=n!==i;break}case"intersection":{let n,i;t.length<e.length?(n=t.length,i=e.length):(n=e.length,i=t.length),this._isInResult=i===Qn.numMultiPolys&&n<i;break}case"xor":{const n=Math.abs(t.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=i=>i.length===1&&i[0].isSubject;this._isInResult=n(t)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${Qn.type}`)}return this._isInResult}}class up{constructor(t,e,n){if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=Cu.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let s=i;for(let o=1,a=t.length;o<a;o++){if(typeof t[o][0]!="number"||typeof t[o][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let u=Cu.round(t[o][0],t[o][1]);u.x===s.x&&u.y===s.y||(this.segments.push(Cs.fromRing(s,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),s=u)}(i.x!==s.x||i.y!==s.y)&&this.segments.push(Cs.fromRing(s,i,this))}getSweepEvents(){const t=[];for(let e=0,n=this.segments.length;e<n;e++){const i=this.segments[e];t.push(i.leftSE),t.push(i.rightSE)}return t}}class p_{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new up(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,i=t.length;n<i;n++){const s=new up(t[n],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const i=this.interiorRings[e].getSweepEvents();for(let s=0,o=i.length;s<o;s++)t.push(i[s])}return t}}class lp{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,i=t.length;n<i;n++){const s=new p_(t[n],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const i=this.polys[e].getSweepEvents();for(let s=0,o=i.length;s<o;s++)t.push(i[s])}return t}}class Wl{static factory(t){const e=[];for(let n=0,i=t.length;n<i;n++){const s=t[n];if(!s.isInResult()||s.ringOut)continue;let o=null,a=s.leftSE,u=s.rightSE;const l=[a],h=a.point,c=[];for(;o=a,a=u,l.push(a),a.point!==h;)for(;;){const f=a.getAvailableLinkedEvents();if(f.length===0){const _=l[0].point,w=l[l.length-1].point;throw new Error(`Unable to complete output ring starting at [${_.x}, ${_.y}]. Last matching segment found ends at [${w.x}, ${w.y}].`)}if(f.length===1){u=f[0].otherSE;break}let p=null;for(let _=0,w=c.length;_<w;_++)if(c[_].point===a.point){p=_;break}if(p!==null){const _=c.splice(p)[0],w=l.splice(_.index);w.unshift(w[0].otherSE),e.push(new Wl(w.reverse()));continue}c.push({index:l.length,point:a.point});const v=a.getLeftmostComparator(o);u=f.sort(v)[0].otherSE;break}e.push(new Wl(l))}return e}constructor(t){this.events=t;for(let e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let l=1,h=this.events.length-1;l<h;l++){const c=this.events[l].point,f=this.events[l+1].point;sp(c,t,f)!==0&&(e.push(c),t=c)}if(e.length===1)return null;const n=e[0],i=e[1];sp(n,t,i)===0&&e.shift(),e.push(e[0]);const s=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:e.length-1,a=this.isExteriorRing()?e.length:-1,u=[];for(let l=o;l!=a;l+=s)u.push([e[l].x,e[l].y]);return u}isExteriorRing(){if(this._isExteriorRing===void 0){const t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let i=1,s=this.events.length;i<s;i++){const o=this.events[i];vn.compare(t,o)>0&&(t=o)}let e=t.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class hp{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const i=this.interiorRings[e].getGeom();i!==null&&t.push(i)}return t}}class v_{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const i=this.polys[e].getGeom();i!==null&&t.push(i)}return t}_composePolys(t){const e=[];for(let n=0,i=t.length;n<i;n++){const s=t[n];if(!s.poly)if(s.isExteriorRing())e.push(new hp(s));else{const o=s.enclosingRing();o.poly||e.push(new hp(o)),o.poly.addInterior(s)}}return e}}class m_{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Cs.compare;this.queue=t,this.tree=new Ec(e),this.segments=[]}process(t){const e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;const i=t.isLeft?this.tree.add(e):this.tree.find(e);if(!i)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let s=i,o=i,a,u;for(;a===void 0;)s=this.tree.prev(s),s===null?a=null:s.key.consumedBy===void 0&&(a=s.key);for(;u===void 0;)o=this.tree.next(o),o===null?u=null:o.key.consumedBy===void 0&&(u=o.key);if(t.isLeft){let l=null;if(a){const c=a.getIntersection(e);if(c!==null&&(e.isAnEndpoint(c)||(l=c),!a.isAnEndpoint(c))){const f=this._splitSafely(a,c);for(let p=0,v=f.length;p<v;p++)n.push(f[p])}}let h=null;if(u){const c=u.getIntersection(e);if(c!==null&&(e.isAnEndpoint(c)||(h=c),!u.isAnEndpoint(c))){const f=this._splitSafely(u,c);for(let p=0,v=f.length;p<v;p++)n.push(f[p])}}if(l!==null||h!==null){let c=null;l===null?c=h:h===null?c=l:c=vn.comparePoints(l,h)<=0?l:h,this.queue.remove(e.rightSE),n.push(e.rightSE);const f=e.split(c);for(let p=0,v=f.length;p<v;p++)n.push(f[p])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&u){const l=a.getIntersection(u);if(l!==null){if(!a.isAnEndpoint(l)){const h=this._splitSafely(a,l);for(let c=0,f=h.length;c<f;c++)n.push(h[c])}if(!u.isAnEndpoint(l)){const h=this._splitSafely(u,l);for(let c=0,f=h.length;c<f;c++)n.push(h[c])}}}this.tree.remove(e)}return n}_splitSafely(t,e){this.tree.remove(t);const n=t.rightSE;this.queue.remove(n);const i=t.split(e);return i.push(n),t.consumedBy===void 0&&this.tree.add(t),i}}const cp=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,y_=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class __{run(t,e,n){Qn.type=t,Cu.reset();const i=[new lp(e,!0)];for(let c=0,f=n.length;c<f;c++)i.push(new lp(n[c],!1));if(Qn.numMultiPolys=i.length,Qn.type==="difference"){const c=i[0];let f=1;for(;f<i.length;)Ic(i[f].bbox,c.bbox)!==null?f++:i.splice(f,1)}if(Qn.type==="intersection")for(let c=0,f=i.length;c<f;c++){const p=i[c];for(let v=c+1,_=i.length;v<_;v++)if(Ic(p.bbox,i[v].bbox)===null)return[]}const s=new Ec(vn.compare);for(let c=0,f=i.length;c<f;c++){const p=i[c].getSweepEvents();for(let v=0,_=p.length;v<_;v++)if(s.insert(p[v]),s.size>cp)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const o=new m_(s);let a=s.size,u=s.pop();for(;u;){const c=u.key;if(s.size===a){const p=c.segment;throw new Error(`Unable to pop() ${c.isLeft?"left":"right"} SweepEvent [${c.point.x}, ${c.point.y}] from segment #${p.id} [${p.leftSE.point.x}, ${p.leftSE.point.y}] -> [${p.rightSE.point.x}, ${p.rightSE.point.y}] from queue.`)}if(s.size>cp)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(o.segments.length>y_)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=o.process(c);for(let p=0,v=f.length;p<v;p++){const _=f[p];_.consumedBy===void 0&&s.insert(_)}a=s.size,u=s.pop()}Cu.reset();const l=Wl.factory(o.segments);return new v_(l).getGeom()}}const Qn=new __;var Mc={union:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Qn.run("union",r,e)},intersection:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Qn.run("intersection",r,e)},xor:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Qn.run("xor",r,e)},difference:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Qn.run("difference",r,e)}};function E_(r,t){var e=jr(r),n=jr(t),i=r.properties||{},s=Mc.difference(e.coordinates,n.coordinates);return s.length===0?null:s.length===1?hr(s[0],i):ac(s,i)}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(n+i,0):Math.min(i,n);var s=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:n;for(s=s<0?Math.max(n+arguments[2],0):Math.min(s,n);i<s;)e[i]=t,++i;return e},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!==r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var so=function(){};so.prototype.interfaces_=function(){return[]},so.prototype.getClass=function(){return so},so.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var ne=function(r){function t(e){r.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=new r().stack}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(Error),vt=function(){},fp={MAX_VALUE:{configurable:!0}};vt.isNaN=function(t){return Number.isNaN(t)},vt.doubleToLongBits=function(t){return t},vt.longBitsToDouble=function(t){return t},vt.isInfinite=function(t){return!Number.isFinite(t)},fp.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(vt,fp);var Gr=function(){},Xl=function(){},$o=function(){};function kr(){}var D=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.z=t.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},oo={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};D.prototype.setOrdinate=function(t,e){switch(t){case D.X:this.x=e;break;case D.Y:this.y=e;break;case D.Z:this.z=e;break;default:throw new ne("Invalid ordinate index: "+t)}},D.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return!(this.x!==t.x||this.y!==t.y)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return!(!so.equalsWithTolerance(this.x,e.x,n)||!so.equalsWithTolerance(this.y,e.y,n))}},D.prototype.getOrdinate=function(t){switch(t){case D.X:return this.x;case D.Y:return this.y;case D.Z:return this.z}throw new ne("Invalid ordinate index: "+t)},D.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||vt.isNaN(this.z))&&vt.isNaN(t.z)},D.prototype.equals=function(t){return t instanceof D?this.equals2D(t):!1},D.prototype.equalInZ=function(t,e){return so.equalsWithTolerance(this.z,t.z,e)},D.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},D.prototype.clone=function(){},D.prototype.copy=function(){return new D(this)},D.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},D.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+n*n+i*i)},D.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},D.prototype.hashCode=function(){var t=17;return t=37*t+D.hashCode(this.x),t=37*t+D.hashCode(this.y),t},D.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},D.prototype.interfaces_=function(){return[Gr,Xl,kr]},D.prototype.getClass=function(){return D},D.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=vt.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},oo.DimensionalComparator.get=function(){return Zi},oo.serialVersionUID.get=function(){return 6683108902428367e3},oo.NULL_ORDINATE.get=function(){return vt.NaN},oo.X.get=function(){return 0},oo.Y.get=function(){return 1},oo.Z.get=function(){return 2},Object.defineProperties(D,oo);var Zi=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new ne("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};Zi.prototype.compare=function(t,e){var n=t,i=e,s=Zi.compare(n.x,i.x);if(s!==0)return s;var o=Zi.compare(n.y,i.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var a=Zi.compare(n.z,i.z);return a},Zi.prototype.interfaces_=function(){return[$o]},Zi.prototype.getClass=function(){return Zi},Zi.compare=function(t,e){return t<e?-1:t>e?1:vt.isNaN(t)?vt.isNaN(e)?0:-1:vt.isNaN(e)?1:0};var jo=function(){};jo.prototype.create=function(){},jo.prototype.interfaces_=function(){return[]},jo.prototype.getClass=function(){return jo};var F=function(){},Pu={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};F.prototype.interfaces_=function(){return[]},F.prototype.getClass=function(){return F},F.toLocationSymbol=function(t){switch(t){case F.EXTERIOR:return"e";case F.BOUNDARY:return"b";case F.INTERIOR:return"i";case F.NONE:return"-"}throw new ne("Unknown location value: "+t)},Pu.INTERIOR.get=function(){return 0},Pu.BOUNDARY.get=function(){return 1},Pu.EXTERIOR.get=function(){return 2},Pu.NONE.get=function(){return-1},Object.defineProperties(F,Pu);var dt=function(r,t){return r.interfaces_&&r.interfaces_().indexOf(t)>-1},Nr=function(){},dp={LOG_10:{configurable:!0}};Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr},Nr.log10=function(t){var e=Math.log(t);return vt.isInfinite(e)||vt.isNaN(e)?e:e/Nr.LOG_10},Nr.min=function(t,e,n,i){var s=t;return e<s&&(s=e),n<s&&(s=n),i<s&&(s=i),s},Nr.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],s=arguments[1],o=arguments[2];return i<s?s:i>o?o:i}},Nr.wrap=function(t,e){return t<0?e- -t%e:t%e},Nr.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2],i=t;return e>i&&(i=e),n>i&&(i=n),i}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3],l=s;return o>l&&(l=o),a>l&&(l=a),u>l&&(l=u),l}},Nr.average=function(t,e){return(t+e)/2},dp.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Nr,dp);var mn=function(t){this.str=t};mn.prototype.append=function(t){this.str+=t},mn.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},mn.prototype.toString=function(t){return this.str};var yn=function(t){this.value=t};yn.prototype.intValue=function(){return this.value},yn.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},yn.isNaN=function(t){return Number.isNaN(t)};var Iu=function(){};Iu.isWhitespace=function(t){return t<=32&&t>=0||t===127},Iu.toUpperCase=function(t){return t.toUpperCase()};var z=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof r){var e=arguments[0];this.init(e)}else if(typeof arguments[0]=="string"){var n=arguments[0];r.call(this,r.parse(n))}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.init(i,s)}},tn={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};z.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},z.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),i=z.magnitude(n._hi),s=z.TEN.pow(i);n=n.divide(s),n.gt(z.TEN)?(n=n.divide(z.TEN),i+=1):n.lt(z.ONE)&&(n=n.multiply(z.TEN),i-=1);for(var o=i+1,a=new mn,u=z.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){t&&l===o&&a.append(".");var h=Math.trunc(n._hi);if(h<0)break;var c=!1,f=0;h>9?(c=!0,f="9"):f="0"+h,a.append(f),n=n.subtract(z.valueOf(h)).multiply(z.TEN),c&&n.selfAdd(z.TEN);var p=!0,v=z.magnitude(n._hi);if(v<0&&Math.abs(v)>=u-l&&(p=!1),!p)break}return e[0]=i,a.toString()},z.prototype.sqr=function(){return this.multiply(this)},z.prototype.doubleValue=function(){return this._hi+this._lo},z.prototype.subtract=function(){if(arguments[0]instanceof z){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},z.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},z.prototype.isZero=function(){return this._hi===0&&this._lo===0},z.prototype.selfSubtract=function(){if(arguments[0]instanceof z){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},z.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},z.prototype.min=function(t){return this.le(t)?this:t},z.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof z){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=null,o=null,a=null,u=null,l=null,h=null,c=null,f=null;return l=this._hi/n,h=z.SPLIT*l,s=h-l,f=z.SPLIT*n,s=h-s,o=l-s,a=f-n,c=l*n,a=f-a,u=n-a,f=s*a-c+s*u+o*a+o*u,h=(this._hi-c-f+this._lo-l*i)/n,f=l+h,this._hi=f,this._lo=l-f+h,this}},z.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},z.prototype.divide=function(){if(arguments[0]instanceof z){var t=arguments[0],e=null,n=null,i=null,s=null,o=null,a=null,u=null,l=null;o=this._hi/t._hi,a=z.SPLIT*o,e=a-o,l=z.SPLIT*t._hi,e=a-e,n=o-e,i=l-t._hi,u=o*t._hi,i=l-i,s=t._hi-i,l=e*i-u+e*s+n*i+n*s,a=(this._hi-u-l+this._lo-o*t._lo)/t._hi,l=o+a;var h=l,c=o-l+a;return new z(h,c)}else if(typeof arguments[0]=="number"){var f=arguments[0];return vt.isNaN(f)?z.createNaN():z.copy(this).selfDivide(f,0)}},z.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},z.prototype.pow=function(t){if(t===0)return z.valueOf(1);var e=new z(this),n=z.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2===1&&n.selfMultiply(e),i/=2,i>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},z.prototype.ceil=function(){if(this.isNaN())return z.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new z(t,e)},z.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},z.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()},z.prototype.setValue=function(){if(arguments[0]instanceof z){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},z.prototype.max=function(t){return this.ge(t)?this:t},z.prototype.sqrt=function(){if(this.isZero())return z.valueOf(0);if(this.isNegative())return z.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=z.valueOf(e),i=this.subtract(n.sqr()),s=i._hi*(t*.5);return n.add(s)},z.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof z){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],n=null,i=null,s=null,o=null,a=null,u=null;return s=this._hi+e,a=s-this._hi,o=s-a,o=e-a+(this._hi-o),u=o+this._lo,n=s+u,i=u+(s-n),this._hi=n+i,this._lo=i+(n-this._hi),this}}else if(arguments.length===2){var l=arguments[0],h=arguments[1],c=null,f=null,p=null,v=null,_=null,w=null,I=null,y=null;_=this._hi+l,p=this._lo+h,I=_-this._hi,y=p-this._lo,w=_-I,v=p-y,w=l-I+(this._hi-w),v=h-y+(this._lo-v),I=w+p,c=_+I,f=I+(_-c),I=v+f;var E=c+I,m=I+(c-E);return this._hi=E,this._lo=m,this}},z.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof z){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=null,o=null,a=null,u=null,l=null,h=null;l=z.SPLIT*this._hi,s=l-this._hi,h=z.SPLIT*n,s=l-s,o=this._hi-s,a=h-n,l=this._hi*n,a=h-a,u=n-a,h=s*a-l+s*u+o*a+o*u+(this._hi*i+this._lo*n);var c=l+h;s=l-c;var f=h+s;return this._hi=c,this._lo=f,this}},z.prototype.selfSqr=function(){return this.selfMultiply(this)},z.prototype.floor=function(){if(this.isNaN())return z.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new z(t,e)},z.prototype.negate=function(){return this.isNaN()?this:new z(-this._hi,-this._lo)},z.prototype.clone=function(){},z.prototype.multiply=function(){if(arguments[0]instanceof z){var t=arguments[0];return t.isNaN()?z.createNaN():z.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return vt.isNaN(e)?z.createNaN():z.copy(this).selfMultiply(e,0)}},z.prototype.isNaN=function(){return vt.isNaN(this._hi)},z.prototype.intValue=function(){return Math.trunc(this._hi)},z.prototype.toString=function(){var t=z.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},z.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),i=e[0]+1,s=n;if(n.charAt(0)===".")s="0"+n;else if(i<0)s="0."+z.stringOfChar("0",-i)+n;else if(n.indexOf(".")===-1){var o=i-n.length,a=z.stringOfChar("0",o);s=n+a+".0"}return this.isNegative()?"-"+s:s},z.prototype.reciprocal=function(){var t=null,e=null,n=null,i=null,s=null,o=null,a=null,u=null;s=1/this._hi,o=z.SPLIT*s,t=o-s,u=z.SPLIT*this._hi,t=o-t,e=s-t,n=u-this._hi,a=s*this._hi,n=u-n,i=this._hi-n,u=t*n-a+t*i+e*n+e*i,o=(1-a-u-s*this._lo)/this._hi;var l=s+o,h=s-l+o;return new z(l,h)},z.prototype.toSciNotation=function(){if(this.isZero())return z.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),i=z.SCI_NOT_EXPONENT_CHAR+e[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var s="";n.length>1&&(s=n.substring(1));var o=n.charAt(0)+"."+s;return this.isNegative()?"-"+o+i:o+i},z.prototype.abs=function(){return this.isNaN()?z.NaN:this.isNegative()?this.negate():new z(this)},z.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},z.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},z.prototype.add=function(){if(arguments[0]instanceof z){var t=arguments[0];return z.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return z.copy(this).selfAdd(e)}},z.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof z){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._hi=n,this._lo=i}},z.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},z.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},z.prototype.trunc=function(){return this.isNaN()?z.NaN:this.isPositive()?this.floor():this.ceil()},z.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},z.prototype.interfaces_=function(){return[kr,Gr,Xl]},z.prototype.getClass=function(){return z},z.sqr=function(t){return z.valueOf(t).selfMultiply(t)},z.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return z.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new z(e)}},z.sqrt=function(t){return z.valueOf(t).sqrt()},z.parse=function(t){for(var e=0,n=t.length;Iu.isWhitespace(t.charAt(e));)e++;var i=!1;if(e<n){var s=t.charAt(e);(s==="-"||s==="+")&&(e++,s==="-"&&(i=!0))}for(var o=new z,a=0,u=0,l=0;!(e>=n);){var h=t.charAt(e);if(e++,Iu.isDigit(h)){var c=h-"0";o.selfMultiply(z.TEN),o.selfAdd(c),a++;continue}if(h==="."){u=a;continue}if(h==="e"||h==="E"){var f=t.substring(e);try{l=yn.parseInt(f)}catch(I){throw I instanceof Error?new Error("Invalid exponent "+f+" in string "+t):I}finally{}break}throw new Error("Unexpected character '"+h+"' at position "+e+" in string "+t)}var p=o,v=a-u-l;if(v===0)p=o;else if(v>0){var _=z.TEN.pow(v);p=o.divide(_)}else if(v<0){var w=z.TEN.pow(-v);p=o.multiply(w)}return i?p.negate():p},z.createNaN=function(){return new z(vt.NaN,vt.NaN)},z.copy=function(t){return new z(t)},z.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(n)),s=Math.pow(10,i);return s*10<=e&&(i+=1),i},z.stringOfChar=function(t,e){for(var n=new mn,i=0;i<e;i++)n.append(t);return n.toString()},tn.PI.get=function(){return new z(3.141592653589793,12246467991473532e-32)},tn.TWO_PI.get=function(){return new z(6.283185307179586,24492935982947064e-32)},tn.PI_2.get=function(){return new z(1.5707963267948966,6123233995736766e-32)},tn.E.get=function(){return new z(2.718281828459045,14456468917292502e-32)},tn.NaN.get=function(){return new z(vt.NaN,vt.NaN)},tn.EPS.get=function(){return 123259516440783e-46},tn.SPLIT.get=function(){return 134217729},tn.MAX_PRINT_DIGITS.get=function(){return 32},tn.TEN.get=function(){return z.valueOf(10)},tn.ONE.get=function(){return z.valueOf(1)},tn.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},tn.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(z,tn);var er=function(){},gp={DP_SAFE_EPSILON:{configurable:!0}};er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er},er.orientationIndex=function(t,e,n){var i=er.orientationIndexFilter(t,e,n);if(i<=1)return i;var s=z.valueOf(e.x).selfAdd(-t.x),o=z.valueOf(e.y).selfAdd(-t.y),a=z.valueOf(n.x).selfAdd(-e.x),u=z.valueOf(n.y).selfAdd(-e.y);return s.selfMultiply(u).selfSubtract(o.selfMultiply(a)).signum()},er.signOfDet2x2=function(t,e,n,i){var s=t.multiply(i).selfSubtract(e.multiply(n));return s.signum()},er.intersection=function(t,e,n,i){var s=z.valueOf(i.y).selfSubtract(n.y).selfMultiply(z.valueOf(e.x).selfSubtract(t.x)),o=z.valueOf(i.x).selfSubtract(n.x).selfMultiply(z.valueOf(e.y).selfSubtract(t.y)),a=s.subtract(o),u=z.valueOf(i.x).selfSubtract(n.x).selfMultiply(z.valueOf(t.y).selfSubtract(n.y)),l=z.valueOf(i.y).selfSubtract(n.y).selfMultiply(z.valueOf(t.x).selfSubtract(n.x)),h=u.subtract(l),c=h.selfDivide(a).doubleValue(),f=z.valueOf(t.x).selfAdd(z.valueOf(e.x).selfSubtract(t.x).selfMultiply(c)).doubleValue(),p=z.valueOf(e.x).selfSubtract(t.x).selfMultiply(z.valueOf(t.y).selfSubtract(n.y)),v=z.valueOf(e.y).selfSubtract(t.y).selfMultiply(z.valueOf(t.x).selfSubtract(n.x)),_=p.subtract(v),w=_.selfDivide(a).doubleValue(),I=z.valueOf(n.y).selfAdd(z.valueOf(i.y).selfSubtract(n.y).selfMultiply(w)).doubleValue();return new D(f,I)},er.orientationIndexFilter=function(t,e,n){var i=null,s=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),a=s-o;if(s>0){if(o<=0)return er.signum(a);i=s+o}else if(s<0){if(o>=0)return er.signum(a);i=-s-o}else return er.signum(a);var u=er.DP_SAFE_EPSILON*i;return a>=u||-a>=u?er.signum(a):2},er.signum=function(t){return t>0?1:t<0?-1:0},gp.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(er,gp);var Ot=function(){},Mu={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Mu.X.get=function(){return 0},Mu.Y.get=function(){return 1},Mu.Z.get=function(){return 2},Mu.M.get=function(){return 3},Ot.prototype.setOrdinate=function(t,e,n){},Ot.prototype.size=function(){},Ot.prototype.getOrdinate=function(t,e){},Ot.prototype.getCoordinate=function(){},Ot.prototype.getCoordinateCopy=function(t){},Ot.prototype.getDimension=function(){},Ot.prototype.getX=function(t){},Ot.prototype.clone=function(){},Ot.prototype.expandEnvelope=function(t){},Ot.prototype.copy=function(){},Ot.prototype.getY=function(t){},Ot.prototype.toCoordinateArray=function(){},Ot.prototype.interfaces_=function(){return[Xl]},Ot.prototype.getClass=function(){return Ot},Object.defineProperties(Ot,Mu);var pp=function(){},ta=function(r){function t(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(pp),Oe=function(){};Oe.arraycopy=function(t,e,n,i,s){for(var o=0,a=e;a<e+s;a++)n[i+o]=t[a],o++},Oe.getProperty=function(t){return{"line.separator":`
25
- `}[t]};var en=function r(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],n=arguments[1];this.x=e,this.y=n,this.w=1}else if(arguments[0]instanceof r&&arguments[1]instanceof r){var i=arguments[0],s=arguments[1];this.x=i.y*s.w-s.y*i.w,this.y=s.x*i.w-i.x*s.w,this.w=i.x*s.y-s.x*i.y}else if(arguments[0]instanceof D&&arguments[1]instanceof D){var o=arguments[0],a=arguments[1];this.x=o.y-a.y,this.y=a.x-o.x,this.w=o.x*a.y-a.x*o.y}}else if(arguments.length===3){var u=arguments[0],l=arguments[1],h=arguments[2];this.x=u,this.y=l,this.w=h}else if(arguments.length===4){var c=arguments[0],f=arguments[1],p=arguments[2],v=arguments[3],_=c.y-f.y,w=f.x-c.x,I=c.x*f.y-f.x*c.y,y=p.y-v.y,E=v.x-p.x,m=p.x*v.y-v.x*p.y;this.x=w*m-E*I,this.y=y*I-_*m,this.w=_*E-y*w}};en.prototype.getY=function(){var t=this.y/this.w;if(vt.isNaN(t)||vt.isInfinite(t))throw new ta;return t},en.prototype.getX=function(){var t=this.x/this.w;if(vt.isNaN(t)||vt.isInfinite(t))throw new ta;return t},en.prototype.getCoordinate=function(){var t=new D;return t.x=this.getX(),t.y=this.getY(),t},en.prototype.interfaces_=function(){return[]},en.prototype.getClass=function(){return en},en.intersection=function(t,e,n,i){var s=t.y-e.y,o=e.x-t.x,a=t.x*e.y-e.x*t.y,u=n.y-i.y,l=i.x-n.x,h=n.x*i.y-i.x*n.y,c=o*h-l*a,f=u*a-s*h,p=s*l-u*o,v=c/p,_=f/p;if(vt.isNaN(v)||vt.isInfinite(v)||vt.isNaN(_)||vt.isInfinite(_))throw new ta;return new D(v,_)};var st=function r(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof D){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof r){var e=arguments[0];this.init(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3];this.init(s,o,a,u)}},vp={serialVersionUID:{configurable:!0}};st.prototype.getArea=function(){return this.getWidth()*this.getHeight()},st.prototype.equals=function(t){if(!(t instanceof st))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},st.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new st;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,i=this._maxx<t._maxx?this._maxx:t._maxx,s=this._maxy<t._maxy?this._maxy:t._maxy;return new st(e,i,n,s)},st.prototype.isNull=function(){return this._maxx<this._minx},st.prototype.getMaxX=function(){return this._maxx},st.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof D){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof st){var e=arguments[0];return this.isNull()||e.isNull()?!1:e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=this._maxy}},st.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof st){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}else if(arguments[0]instanceof D){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:!(n>this._maxx||n<this._minx||i>this._maxy||i<this._miny)}},st.prototype.getMinY=function(){return this._miny},st.prototype.getMinX=function(){return this._minx},st.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof D){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof st){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},st.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},st.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},st.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},st.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},st.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},st.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},st.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},st.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},st.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},st.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof st){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof D){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},st.prototype.centre=function(){return this.isNull()?null:new D((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},st.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof D){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof st){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3];s<o?(this._minx=s,this._maxx=o):(this._minx=o,this._maxx=s),a<u?(this._miny=a,this._maxy=u):(this._miny=u,this._maxy=a)}},st.prototype.getMaxY=function(){return this._maxy},st.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),e===0?n:n===0?e:Math.sqrt(e*e+n*n)},st.prototype.hashCode=function(){var t=17;return t=37*t+D.hashCode(this._minx),t=37*t+D.hashCode(this._maxx),t=37*t+D.hashCode(this._miny),t=37*t+D.hashCode(this._maxy),t},st.prototype.interfaces_=function(){return[Gr,kr]},st.prototype.getClass=function(){return st},st.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],u=Math.min(o.x,a.x),l=Math.max(o.x,a.x),h=Math.min(i.x,s.x),c=Math.max(i.x,s.x);return!(h>l||c<u||(u=Math.min(o.y,a.y),l=Math.max(o.y,a.y),h=Math.min(i.y,s.y),c=Math.max(i.y,s.y),h>l)||c<u)}},vp.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(st,vp);var _n={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},Hl=function(t){this.geometryFactory=t||new Nt};Hl.prototype.read=function(t){var e,n,i;t=t.replace(/[\n\r]/g," ");var s=_n.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(s=_n.emptyTypeStr.exec(t),s[2]=void 0),s&&(n=s[1].toLowerCase(),i=s[2],ea[n]&&(e=ea[n].apply(this,[i]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},Hl.prototype.write=function(t){return this.extractGeometry(t)},Hl.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Ei[e])return null;var n=e.toUpperCase(),i;return t.isEmpty()?i=n+" EMPTY":i=n+"("+Ei[e].apply(this,[t])+")",i};var Ei={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Ei.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,n=[],i=0,s=t._geometries.length;i<s;++i)n.push("("+Ei.point.apply(e,[t._geometries[i]])+")");return n.join(",")},linestring:function(t){for(var e=this,n=[],i=0,s=t._points._coordinates.length;i<s;++i)n.push(Ei.coordinate.apply(e,[t._points._coordinates[i]]));return n.join(",")},linearring:function(t){for(var e=this,n=[],i=0,s=t._points._coordinates.length;i<s;++i)n.push(Ei.coordinate.apply(e,[t._points._coordinates[i]]));return n.join(",")},multilinestring:function(t){for(var e=this,n=[],i=0,s=t._geometries.length;i<s;++i)n.push("("+Ei.linestring.apply(e,[t._geometries[i]])+")");return n.join(",")},polygon:function(t){var e=this,n=[];n.push("("+Ei.linestring.apply(this,[t._shell])+")");for(var i=0,s=t._holes.length;i<s;++i)n.push("("+Ei.linestring.apply(e,[t._holes[i]])+")");return n.join(",")},multipolygon:function(t){for(var e=this,n=[],i=0,s=t._geometries.length;i<s;++i)n.push("("+Ei.polygon.apply(e,[t._geometries[i]])+")");return n.join(",")},geometrycollection:function(t){for(var e=this,n=[],i=0,s=t._geometries.length;i<s;++i)n.push(e.extractGeometry(t._geometries[i]));return n.join(",")}},ea={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(_n.spaces);return this.geometryFactory.createPoint(new D(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var n,i=t.trim().split(","),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(_n.trimParens,"$1"),s.push(ea.point.apply(e,[n]));return this.geometryFactory.createMultiPoint(s)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),n=[],i,s=0,o=e.length;s<o;++s)i=e[s].trim().split(_n.spaces),n.push(new D(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(n)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),n=[],i,s=0,o=e.length;s<o;++s)i=e[s].trim().split(_n.spaces),n.push(new D(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var n,i=t.trim().split(_n.parenComma),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(_n.trimParens,"$1"),s.push(ea.linestring.apply(e,[n]));return this.geometryFactory.createMultiLineString(s)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var n,i,s,o=t.trim().split(_n.parenComma),a,u=[],l=0,h=o.length;l<h;++l)n=o[l].replace(_n.trimParens,"$1"),i=ea.linestring.apply(e,[n]),s=e.geometryFactory.createLinearRing(i._points),l===0?a=s:u.push(s);return this.geometryFactory.createPolygon(a,u)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var n,i=t.trim().split(_n.doubleParenComma),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(_n.trimParens,"$1"),s.push(ea.polygon.apply(e,[n]));return this.geometryFactory.createMultiPolygon(s)},geometrycollection:function(t){var e=this;if(t===void 0)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var n=t.trim().split("|"),i=[],s=0,o=n.length;s<o;++s)i.push(e.read(n[s]));return this.geometryFactory.createGeometryCollection(i)}},rn=function(t){this.parser=new Hl(t)};rn.prototype.write=function(t){return this.parser.write(t)},rn.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var wi=function(r){function t(e){r.call(this,e),this.name="RuntimeException",this.message=e,this.stack=new r().stack}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(Error),Yl=function(r){function t(){if(r.call(this),arguments.length===0)r.call(this);else if(arguments.length===1){var e=arguments[0];r.call(this,e)}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(wi),St=function(){};St.prototype.interfaces_=function(){return[]},St.prototype.getClass=function(){return St},St.shouldNeverReachHere=function(){if(arguments.length===0)St.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new Yl("Should never reach here"+(t!==null?": "+t:""))}},St.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],St.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new Yl:new Yl(e)},St.equals=function(){var t,e,n;if(arguments.length===2)t=arguments[0],e=arguments[1],St.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],n=arguments[2],!e.equals(t)))throw new Yl("Expected "+t+" but encountered "+e+(n!==null?": "+n:""))};var se=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new D,this._intPt[1]=new D,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},ao={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};se.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},se.prototype.getTopologySummary=function(){var t=new mn;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},se.prototype.computeIntersection=function(t,e,n,i){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=i,this._result=this.computeIntersect(t,e,n,i)},se.prototype.getIntersectionNum=function(){return this._result},se.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var t=arguments[0],e=this.getEdgeDistance(t,0),n=this.getEdgeDistance(t,1);e>n?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},se.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},se.prototype.setPrecisionModel=function(t){this._precisionModel=t},se.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],n=0;n<this._result;n++)if(!(t._intPt[n].equals2D(t._inputLines[e][0])||t._intPt[n].equals2D(t._inputLines[e][1])))return!0;return!1}},se.prototype.getIntersection=function(t){return this._intPt[t]},se.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},se.prototype.hasIntersection=function(){return this._result!==se.NO_INTERSECTION},se.prototype.getEdgeDistance=function(t,e){var n=se.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return n},se.prototype.isCollinear=function(){return this._result===se.COLLINEAR_INTERSECTION},se.prototype.toString=function(){return rn.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+rn.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},se.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},se.prototype.isIntersection=function(t){for(var e=this,n=0;n<this._result;n++)if(e._intPt[n].equals2D(t))return!0;return!1},se.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},se.prototype.interfaces_=function(){return[]},se.prototype.getClass=function(){return se},se.computeEdgeDistance=function(t,e,n){var i=Math.abs(n.x-e.x),s=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))i>s?o=i:o=s;else{var a=Math.abs(t.x-e.x),u=Math.abs(t.y-e.y);i>s?o=a:o=u,o===0&&!t.equals(e)&&(o=Math.max(a,u))}return St.isTrue(!(o===0&&!t.equals(e)),"Bad distance calculation"),o},se.nonRobustComputeEdgeDistance=function(t,e,n){var i=t.x-e.x,s=t.y-e.y,o=Math.sqrt(i*i+s*s);return St.isTrue(!(o===0&&!t.equals(e)),"Invalid distance calculation"),o},ao.DONT_INTERSECT.get=function(){return 0},ao.DO_INTERSECT.get=function(){return 1},ao.COLLINEAR.get=function(){return 2},ao.NO_INTERSECTION.get=function(){return 0},ao.POINT_INTERSECTION.get=function(){return 1},ao.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(se,ao);var Ps=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(n){var i=new st(this._inputLines[0][0],this._inputLines[0][1]),s=new st(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(n)&&s.contains(n)},t.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];if(this._isProper=!1,st.intersects(i,s,n)&&K.orientationIndex(i,s,n)===0&&K.orientationIndex(s,i,n)===0)return this._isProper=!0,(n.equals(i)||n.equals(s))&&(this._isProper=!1),this._result=r.POINT_INTERSECTION,null;this._result=r.NO_INTERSECTION}else return r.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(n,i,s,o,a){a.x=this.smallestInAbsValue(n.x,i.x,s.x,o.x),a.y=this.smallestInAbsValue(n.y,i.y,s.y,o.y),n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},t.prototype.safeHCoordinateIntersection=function(n,i,s,o){var a=null;try{a=en.intersection(n,i,s,o)}catch(u){if(u instanceof ta)a=t.nearestEndpoint(n,i,s,o);else throw u}finally{}return a},t.prototype.intersection=function(n,i,s,o){var a=this.intersectionWithNormalization(n,i,s,o);return this.isInSegmentEnvelopes(a)||(a=new D(t.nearestEndpoint(n,i,s,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},t.prototype.smallestInAbsValue=function(n,i,s,o){var a=n,u=Math.abs(a);return Math.abs(i)<u&&(a=i,u=Math.abs(i)),Math.abs(s)<u&&(a=s,u=Math.abs(s)),Math.abs(o)<u&&(a=o),a},t.prototype.checkDD=function(n,i,s,o,a){var u=er.intersection(n,i,s,o),l=this.isInSegmentEnvelopes(u);Oe.out.println("DD in env = "+l+" --------------------- "+u),a.distance(u)>1e-4&&Oe.out.println("Distance = "+a.distance(u))},t.prototype.intersectionWithNormalization=function(n,i,s,o){var a=new D(n),u=new D(i),l=new D(s),h=new D(o),c=new D;this.normalizeToEnvCentre(a,u,l,h,c);var f=this.safeHCoordinateIntersection(a,u,l,h);return f.x+=c.x,f.y+=c.y,f},t.prototype.computeCollinearIntersection=function(n,i,s,o){var a=st.intersects(n,i,s),u=st.intersects(n,i,o),l=st.intersects(s,o,n),h=st.intersects(s,o,i);return a&&u?(this._intPt[0]=s,this._intPt[1]=o,r.COLLINEAR_INTERSECTION):l&&h?(this._intPt[0]=n,this._intPt[1]=i,r.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!u&&!h?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):a&&h?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!u&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=o,this._intPt[1]=n,o.equals(n)&&!a&&!h?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&h?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!a&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):r.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(n,i,s,o,a){var u=n.x<i.x?n.x:i.x,l=n.y<i.y?n.y:i.y,h=n.x>i.x?n.x:i.x,c=n.y>i.y?n.y:i.y,f=s.x<o.x?s.x:o.x,p=s.y<o.y?s.y:o.y,v=s.x>o.x?s.x:o.x,_=s.y>o.y?s.y:o.y,w=u>f?u:f,I=h<v?h:v,y=l>p?l:p,E=c<_?c:_,m=(w+I)/2,S=(y+E)/2;a.x=m,a.y=S,n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},t.prototype.computeIntersect=function(n,i,s,o){if(this._isProper=!1,!st.intersects(n,i,s,o))return r.NO_INTERSECTION;var a=K.orientationIndex(n,i,s),u=K.orientationIndex(n,i,o);if(a>0&&u>0||a<0&&u<0)return r.NO_INTERSECTION;var l=K.orientationIndex(s,o,n),h=K.orientationIndex(s,o,i);if(l>0&&h>0||l<0&&h<0)return r.NO_INTERSECTION;var c=a===0&&u===0&&l===0&&h===0;return c?this.computeCollinearIntersection(n,i,s,o):(a===0||u===0||l===0||h===0?(this._isProper=!1,n.equals2D(s)||n.equals2D(o)?this._intPt[0]=n:i.equals2D(s)||i.equals2D(o)?this._intPt[0]=i:a===0?this._intPt[0]=new D(s):u===0?this._intPt[0]=new D(o):l===0?this._intPt[0]=new D(n):h===0&&(this._intPt[0]=new D(i))):(this._isProper=!0,this._intPt[0]=this.intersection(n,i,s,o)),r.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(n,i,s,o){var a=n,u=K.distancePointLine(n,s,o),l=K.distancePointLine(i,s,o);return l<u&&(u=l,a=i),l=K.distancePointLine(s,n,i),l<u&&(u=l,a=s),l=K.distancePointLine(o,n,i),l<u&&(u=l,a=o),a},t}(se),uo=function(){};uo.prototype.interfaces_=function(){return[]},uo.prototype.getClass=function(){return uo},uo.orientationIndex=function(t,e,n){var i=e.x-t.x,s=e.y-t.y,o=n.x-e.x,a=n.y-e.y;return uo.signOfDet2x2(i,s,o,a)},uo.signOfDet2x2=function(t,e,n,i){var s=null,o=null,a=null;if(s=1,t===0||i===0)return e===0||n===0?0:e>0?n>0?-s:s:n>0?s:-s;if(e===0||n===0)return i>0?t>0?s:-s:t>0?-s:s;if(e>0?i>0?e<=i||(s=-s,o=t,t=n,n=o,o=e,e=i,i=o):e<=-i?(s=-s,n=-n,i=-i):(o=t,t=-n,n=o,o=e,e=-i,i=o):i>0?-e<=i?(s=-s,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=i,i=o):e>=i?(t=-t,e=-e,n=-n,i=-i):(s=-s,o=-t,t=-n,n=o,o=-e,e=-i,i=o),t>0)if(n>0){if(!(t<=n))return s}else return s;else{if(n>0)return-s;if(t>=n)s=-s,t=-t,n=-n;else return-s}for(;;){if(a=Math.floor(n/t),n=n-a*t,i=i-a*e,i<0)return-s;if(i>e)return s;if(t>n+n){if(e<i+i)return s}else{if(e>i+i)return-s;n=t-n,i=e-i,s=-s}if(i===0)return n===0?0:-s;if(n===0||(a=Math.floor(t/n),t=t-a*n,e=e-a*i,e<0))return s;if(e>i)return-s;if(n>t+t){if(i<e+e)return-s}else{if(i>e+e)return s;t=n-t,e=i-e,s=-s}if(e===0)return t===0?0:s;if(t===0)return-s}};var En=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};En.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,i=e.x;return n>i&&(n=e.x,i=t.x),this._p.x>=n&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var s=t.x-this._p.x,o=t.y-this._p.y,a=e.x-this._p.x,u=e.y-this._p.y,l=uo.signOfDet2x2(s,o,a,u);if(l===0)return this._isPointOnSegment=!0,null;u<o&&(l=-l),l>0&&this._crossingCount++}},En.prototype.isPointInPolygon=function(){return this.getLocation()!==F.EXTERIOR},En.prototype.getLocation=function(){return this._isPointOnSegment?F.BOUNDARY:this._crossingCount%2===1?F.INTERIOR:F.EXTERIOR},En.prototype.isOnSegment=function(){return this._isPointOnSegment},En.prototype.interfaces_=function(){return[]},En.prototype.getClass=function(){return En},En.locatePointInRing=function(){if(arguments[0]instanceof D&&dt(arguments[1],Ot)){for(var t=arguments[0],e=arguments[1],n=new En(t),i=new D,s=new D,o=1;o<e.size();o++)if(e.getCoordinate(o,i),e.getCoordinate(o-1,s),n.countSegment(i,s),n.isOnSegment())return n.getLocation();return n.getLocation()}else if(arguments[0]instanceof D&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new En(a),h=1;h<u.length;h++){var c=u[h],f=u[h-1];if(l.countSegment(c,f),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var K=function(){},lo={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};K.prototype.interfaces_=function(){return[]},K.prototype.getClass=function(){return K},K.orientationIndex=function(t,e,n){return er.orientationIndex(t,e,n)},K.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,i=1;i<t.length-1;i++){var s=t[i].x-n,o=t[i+1].y,a=t[i-1].y;e+=s*(a-o)}return e/2}else if(dt(arguments[0],Ot)){var u=arguments[0],l=u.size();if(l<3)return 0;var h=new D,c=new D,f=new D;u.getCoordinate(0,c),u.getCoordinate(1,f);var p=c.x;f.x-=p;for(var v=0,_=1;_<l-1;_++)h.y=c.y,c.x=f.x,c.y=f.y,u.getCoordinate(_+1,f),f.x-=p,v+=c.x*(h.y-f.y);return v/2}},K.distanceLineLine=function(t,e,n,i){if(t.equals(e))return K.distancePointLine(t,n,i);if(n.equals(i))return K.distancePointLine(i,t,e);var s=!1;if(!st.intersects(t,e,n,i))s=!0;else{var o=(e.x-t.x)*(i.y-n.y)-(e.y-t.y)*(i.x-n.x);if(o===0)s=!0;else{var a=(t.y-n.y)*(i.x-n.x)-(t.x-n.x)*(i.y-n.y),u=(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y),l=u/o,h=a/o;(h<0||h>1||l<0||l>1)&&(s=!0)}}return s?Nr.min(K.distancePointLine(t,n,i),K.distancePointLine(e,n,i),K.distancePointLine(n,t,e),K.distancePointLine(i,t,e)):0},K.isPointInRing=function(t,e){return K.locatePointInRing(t,e)!==F.EXTERIOR},K.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new D;t.getCoordinate(0,i);for(var s=i.x,o=i.y,a=1;a<e;a++){t.getCoordinate(a,i);var u=i.x,l=i.y,h=u-s,c=l-o;n+=Math.sqrt(h*h+c*c),s=u,o=l}return n},K.isCCW=function(t){var e=t.length-1;if(e<3)throw new ne("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],i=0,s=1;s<=e;s++){var o=t[s];o.y>n.y&&(n=o,i=s)}var a=i;do a=a-1,a<0&&(a=e);while(t[a].equals2D(n)&&a!==i);var u=i;do u=(u+1)%e;while(t[u].equals2D(n)&&u!==i);var l=t[a],h=t[u];if(l.equals2D(n)||h.equals2D(n)||l.equals2D(h))return!1;var c=K.computeOrientation(l,n,h),f=!1;return c===0?f=l.x>h.x:f=c>0,f},K.locatePointInRing=function(t,e){return En.locatePointInRing(t,e)},K.distancePointLinePerpendicular=function(t,e,n){var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),s=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i;return Math.abs(s)*Math.sqrt(i)},K.computeOrientation=function(t,e,n){return K.orientationIndex(t,e,n)},K.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new ne("Line array must contain at least one vertex");for(var n=t.distance(e[0]),i=0;i<e.length-1;i++){var s=K.distancePointLine(t,e[i],e[i+1]);s<n&&(n=s)}return n}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];if(a.x===u.x&&a.y===u.y)return o.distance(a);var l=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),h=((o.x-a.x)*(u.x-a.x)+(o.y-a.y)*(u.y-a.y))/l;if(h<=0)return o.distance(a);if(h>=1)return o.distance(u);var c=((a.y-o.y)*(u.x-a.x)-(a.x-o.x)*(u.y-a.y))/l;return Math.abs(c)*Math.sqrt(l)}},K.isOnLine=function(t,e){for(var n=new Ps,i=1;i<e.length;i++){var s=e[i-1],o=e[i];if(n.computeIntersection(t,s,o),n.hasIntersection())return!0}return!1},lo.CLOCKWISE.get=function(){return-1},lo.RIGHT.get=function(){return K.CLOCKWISE},lo.COUNTERCLOCKWISE.get=function(){return 1},lo.LEFT.get=function(){return K.COUNTERCLOCKWISE},lo.COLLINEAR.get=function(){return 0},lo.STRAIGHT.get=function(){return K.COLLINEAR},Object.defineProperties(K,lo);var Si=function(){};Si.prototype.filter=function(t){},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si};var ft=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},Kn={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};ft.prototype.isGeometryCollection=function(){return this.getSortIndex()===ft.SORTINDEX_GEOMETRYCOLLECTION},ft.prototype.getFactory=function(){return this._factory},ft.prototype.getGeometryN=function(t){return this},ft.prototype.getArea=function(){return 0},ft.prototype.isRectangle=function(){return!1},ft.prototype.equals=function(){if(arguments[0]instanceof ft){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof ft))return!1;var n=e;return this.equalsExact(n)}},ft.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ft.prototype.geometryChanged=function(){this.apply(ft.geometryChangedFilter)},ft.prototype.geometryChangedAction=function(){this._envelope=null},ft.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())},ft.prototype.getLength=function(){return 0},ft.prototype.getNumGeometries=function(){return 1},ft.prototype.compareTo=function(){if(arguments.length===1){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,i)}},ft.prototype.getUserData=function(){return this._userData},ft.prototype.getSRID=function(){return this._SRID},ft.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ft.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ft.SORTINDEX_GEOMETRYCOLLECTION)throw new ne("This method does not support GeometryCollection arguments")},ft.prototype.equal=function(t,e,n){return n===0?t.equals(e):t.distance(e)<=n},ft.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ft.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ft.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new st(this._envelope)},ft.prototype.setSRID=function(t){this._SRID=t},ft.prototype.setUserData=function(t){this._userData=t},ft.prototype.compare=function(t,e){for(var n=t.iterator(),i=e.iterator();n.hasNext()&&i.hasNext();){var s=n.next(),o=i.next(),a=s.compareTo(o);if(a!==0)return a}return n.hasNext()?1:i.hasNext()?-1:0},ft.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ft.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ft.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ft.SORTINDEX_MULTIPOINT||this.getSortIndex()===ft.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ft.SORTINDEX_MULTIPOLYGON},ft.prototype.interfaces_=function(){return[Xl,Gr,kr]},ft.prototype.getClass=function(){return ft},ft.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},ft.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},Kn.serialVersionUID.get=function(){return 8763622679187377e3},Kn.SORTINDEX_POINT.get=function(){return 0},Kn.SORTINDEX_MULTIPOINT.get=function(){return 1},Kn.SORTINDEX_LINESTRING.get=function(){return 2},Kn.SORTINDEX_LINEARRING.get=function(){return 3},Kn.SORTINDEX_MULTILINESTRING.get=function(){return 4},Kn.SORTINDEX_POLYGON.get=function(){return 5},Kn.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Kn.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Kn.geometryChangedFilter.get=function(){return Nc},Object.defineProperties(ft,Kn);var Nc=function(){};Nc.interfaces_=function(){return[Si]},Nc.filter=function(t){t.geometryChangedAction()};var Zn=function(){};Zn.prototype.filter=function(t){},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn};var Vr=function(){},Ci={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Vr.prototype.isInBoundary=function(t){},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Ci.Mod2BoundaryNodeRule.get=function(){return ra},Ci.EndPointBoundaryNodeRule.get=function(){return na},Ci.MultiValentEndPointBoundaryNodeRule.get=function(){return ia},Ci.MonoValentEndPointBoundaryNodeRule.get=function(){return sa},Ci.MOD2_BOUNDARY_RULE.get=function(){return new ra},Ci.ENDPOINT_BOUNDARY_RULE.get=function(){return new na},Ci.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new ia},Ci.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new sa},Ci.OGC_SFS_BOUNDARY_RULE.get=function(){return Vr.MOD2_BOUNDARY_RULE},Object.defineProperties(Vr,Ci);var ra=function(){};ra.prototype.isInBoundary=function(t){return t%2===1},ra.prototype.interfaces_=function(){return[Vr]},ra.prototype.getClass=function(){return ra};var na=function(){};na.prototype.isInBoundary=function(t){return t>0},na.prototype.interfaces_=function(){return[Vr]},na.prototype.getClass=function(){return na};var ia=function(){};ia.prototype.isInBoundary=function(t){return t>1},ia.prototype.interfaces_=function(){return[Vr]},ia.prototype.getClass=function(){return ia};var sa=function(){};sa.prototype.isInBoundary=function(t){return t===1},sa.prototype.interfaces_=function(){return[Vr]},sa.prototype.getClass=function(){return sa};var Ee=function(){};Ee.prototype.add=function(){},Ee.prototype.addAll=function(){},Ee.prototype.isEmpty=function(){},Ee.prototype.iterator=function(){},Ee.prototype.size=function(){},Ee.prototype.toArray=function(){},Ee.prototype.remove=function(){};function bc(r){this.message=r||""}bc.prototype=new Error,bc.prototype.name="IndexOutOfBoundsException";var oa=function(){};oa.prototype.hasNext=function(){},oa.prototype.next=function(){},oa.prototype.remove=function(){};var nn=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(Ee);function aa(r){this.message=r||""}aa.prototype=new Error,aa.prototype.name="NoSuchElementException";var B=function(r){function t(){r.call(this),this.array_=[],arguments[0]instanceof Ee&&this.addAll(arguments[0])}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[r,Ee]},t.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(n){for(var i=this,s=n.iterator();s.hasNext();)i.add(s.next());return!0},t.prototype.set=function(n,i){var s=this.array_[n];return this.array_[n]=i,s},t.prototype.iterator=function(){return new w_(this)},t.prototype.get=function(n){if(n<0||n>=this.size())throw new bc;return this.array_[n]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var n=this,i=[],s=0,o=this.array_.length;s<o;s++)i.push(n.array_[s]);return i},t.prototype.remove=function(n){for(var i=this,s=!1,o=0,a=this.array_.length;o<a;o++)if(i.array_[o]===n){i.array_.splice(o,1),s=!0;break}return s},t}(nn),w_=function(r){function t(e){r.call(this),this.arrayList_=e,this.position_=0}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new aa;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(n){return this.arrayList_.set(this.position_-1,n)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t}(oa),Nu=function(r){function t(){if(r.call(this),arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.ensureCapacity(n.length),this.add(n,!0)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.ensureCapacity(i.length),this.add(i,s)}}}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={coordArrayType:{configurable:!0}};return e.coordArrayType.get=function(){return new Array(0).fill(null)},t.prototype.getCoordinate=function(i){return this.get(i)},t.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=!1,u=s.iterator();u.hasNext();)i.add(u.next(),o),a=!0;return a}else return r.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var i=this,s=r.prototype.clone.call(this),o=0;o<this.size();o++)s.add(o,i.get(o).copy());return s},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var i=this;if(arguments.length===1){var s=arguments[0];r.prototype.add.call(this,s)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1];return this.add(o,a,!0),!0}else if(arguments[0]instanceof D&&typeof arguments[1]=="boolean"){var u=arguments[0],l=arguments[1];if(!l&&this.size()>=1){var h=this.get(this.size()-1);if(h.equals2D(u))return null}r.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var c=arguments[0],f=arguments[1];return this.add(c,f),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var p=arguments[0],v=arguments[1],_=arguments[2];if(_)for(var w=0;w<p.length;w++)i.add(p[w],v);else for(var I=p.length-1;I>=0;I--)i.add(p[I],v);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof D){var y=arguments[0],E=arguments[1],m=arguments[2];if(!m){var S=this.size();if(S>0){if(y>0){var C=this.get(y-1);if(C.equals2D(E))return null}if(y<S){var P=this.get(y);if(P.equals2D(E))return null}}}r.prototype.add.call(this,y,E)}}else if(arguments.length===4){var N=arguments[0],T=arguments[1],O=arguments[2],b=arguments[3],x=1;O>b&&(x=-1);for(var R=O;R!==b;R+=x)i.add(N[R],T);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new D(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t}(B),Mt=function(){},Jl={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Jl.ForwardComparator.get=function(){return bu},Jl.BidirectionalComparator.get=function(){return ua},Jl.coordArrayType.get=function(){return new Array(0).fill(null)},Mt.prototype.interfaces_=function(){return[]},Mt.prototype.getClass=function(){return Mt},Mt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Mt.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(Mt.indexOf(i,e)<0)return i}return null},Mt.scroll=function(t,e){var n=Mt.indexOf(e,t);if(n<0)return null;var i=new Array(t.length).fill(null);Oe.arraycopy(t,n,i,0,t.length-n),Oe.arraycopy(t,0,i,t.length-n,n),Oe.arraycopy(i,0,t,0,t.length)},Mt.equals=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];if(i===s)return!0;if(i===null||s===null||i.length!==s.length)return!1;for(var a=0;a<i.length;a++)if(o.compare(i[a],s[a])!==0)return!1;return!0}},Mt.intersection=function(t,e){for(var n=new Nu,i=0;i<t.length;i++)e.intersects(t[i])&&n.add(t[i],!0);return n.toCoordinateArray()},Mt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Mt.removeRepeatedPoints=function(t){if(!Mt.hasRepeatedPoints(t))return t;var e=new Nu(t,!1);return e.toCoordinateArray()},Mt.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),i=0;i<=n;i++){var s=t[i];t[i]=t[e-i],t[e-i]=s}},Mt.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)t[n]!==null&&e++;var i=new Array(e).fill(null);if(e===0)return i;for(var s=0,o=0;o<t.length;o++)t[o]!==null&&(i[s++]=t[o]);return i},Mt.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new D(t[n]);return e}else if(arguments.length===5)for(var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],u=arguments[4],l=0;l<u;l++)o[a+l]=new D(i[s+l])},Mt.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],s=e[t.length-n-1];if(i.compareTo(s)!==0)return!1}return!0},Mt.envelope=function(t){for(var e=new st,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Mt.toCoordinateArray=function(t){return t.toArray(Mt.coordArrayType)},Mt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Mt.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Mt.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,i=t[e].compareTo(t[n]);if(i!==0)return i}return 1},Mt.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var i=t[n].compareTo(e[n]);if(i!==0)return i;n++}return n<e.length?-1:n<t.length?1:0},Mt.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(e===null||e.compareTo(t[n])>0)&&(e=t[n]);return e},Mt.extract=function(t,e,n){e=Nr.clamp(e,0,t.length),n=Nr.clamp(n,-1,t.length);var i=n-e+1;n<0&&(i=0),e>=t.length&&(i=0),n<e&&(i=0);var s=new Array(i).fill(null);if(i===0)return s;for(var o=0,a=e;a<=n;a++)s[o++]=t[a];return s},Object.defineProperties(Mt,Jl);var bu=function(){};bu.prototype.compare=function(t,e){var n=t,i=e;return Mt.compare(n,i)},bu.prototype.interfaces_=function(){return[$o]},bu.prototype.getClass=function(){return bu};var ua=function(){};ua.prototype.compare=function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;var s=Mt.compare(n,i),o=Mt.isEqualReversed(n,i);return o?0:s},ua.prototype.OLDcompare=function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;for(var s=Mt.increasingDirection(n),o=Mt.increasingDirection(i),a=s>0?0:n.length-1,u=o>0?0:n.length-1,l=0;l<n.length;l++){var h=n[a].compareTo(i[u]);if(h!==0)return h;a+=s,u+=o}return 0},ua.prototype.interfaces_=function(){return[$o]},ua.prototype.getClass=function(){return ua};var ho=function(){};ho.prototype.get=function(){},ho.prototype.put=function(){},ho.prototype.size=function(){},ho.prototype.values=function(){},ho.prototype.entrySet=function(){};var S_=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(ho);function Tu(r){this.message=r||""}Tu.prototype=new Error,Tu.prototype.name="OperationNotSupported";function Bl(){}Bl.prototype=new Ee,Bl.prototype.contains=function(){};var Tc=function(r){function t(){r.call(this),this.array_=[],arguments[0]instanceof Ee&&this.addAll(arguments[0])}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.contains=function(n){for(var i=this,s=0,o=this.array_.length;s<o;s++){var a=i.array_[s];if(a===n)return!0}return!1},t.prototype.add=function(n){return this.contains(n)?!1:(this.array_.push(n),!0)},t.prototype.addAll=function(n){for(var i=this,s=n.iterator();s.hasNext();)i.add(s.next());return!0},t.prototype.remove=function(n){throw new Error},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.toArray=function(){for(var n=this,i=[],s=0,o=this.array_.length;s<o;s++)i.push(n.array_[s]);return i},t.prototype.iterator=function(){return new C_(this)},t}(Bl),C_=function(r){function t(e){r.call(this),this.hashSet_=e,this.position_=0}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new aa;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new Tu},t}(oa),Pi=0,Is=1;function mp(r){return r===null?Pi:r.color}function Kt(r){return r===null?null:r.parent}function Ii(r,t){r!==null&&(r.color=t)}function xc(r){return r===null?null:r.left}function yp(r){return r===null?null:r.right}function Ue(){this.root_=null,this.size_=0}Ue.prototype=new S_,Ue.prototype.get=function(r){for(var t=this.root_;t!==null;){var e=r.compareTo(t.key);if(e<0)t=t.left;else if(e>0)t=t.right;else return t.value}return null},Ue.prototype.put=function(r,t){if(this.root_===null)return this.root_={key:r,value:t,left:null,right:null,parent:null,color:Pi,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,n,i;do if(n=e,i=r.compareTo(e.key),i<0)e=e.left;else if(i>0)e=e.right;else{var s=e.value;return e.value=t,s}while(e!==null);var o={key:r,left:null,right:null,value:t,parent:n,color:Pi,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=o:n.right=o,this.fixAfterInsertion(o),this.size_++,null},Ue.prototype.fixAfterInsertion=function(r){var t=this;for(r.color=Is;r!=null&&r!==this.root_&&r.parent.color===Is;)if(Kt(r)===xc(Kt(Kt(r)))){var e=yp(Kt(Kt(r)));mp(e)===Is?(Ii(Kt(r),Pi),Ii(e,Pi),Ii(Kt(Kt(r)),Is),r=Kt(Kt(r))):(r===yp(Kt(r))&&(r=Kt(r),t.rotateLeft(r)),Ii(Kt(r),Pi),Ii(Kt(Kt(r)),Is),t.rotateRight(Kt(Kt(r))))}else{var n=xc(Kt(Kt(r)));mp(n)===Is?(Ii(Kt(r),Pi),Ii(n,Pi),Ii(Kt(Kt(r)),Is),r=Kt(Kt(r))):(r===xc(Kt(r))&&(r=Kt(r),t.rotateRight(r)),Ii(Kt(r),Pi),Ii(Kt(Kt(r)),Is),t.rotateLeft(Kt(Kt(r))))}this.root_.color=Pi},Ue.prototype.values=function(){var r=new B,t=this.getFirstEntry();if(t!==null)for(r.add(t.value);(t=Ue.successor(t))!==null;)r.add(t.value);return r},Ue.prototype.entrySet=function(){var r=new Tc,t=this.getFirstEntry();if(t!==null)for(r.add(t);(t=Ue.successor(t))!==null;)r.add(t);return r},Ue.prototype.rotateLeft=function(r){if(r!=null){var t=r.right;r.right=t.left,t.left!=null&&(t.left.parent=r),t.parent=r.parent,r.parent===null?this.root_=t:r.parent.left===r?r.parent.left=t:r.parent.right=t,t.left=r,r.parent=t}},Ue.prototype.rotateRight=function(r){if(r!=null){var t=r.left;r.left=t.right,t.right!=null&&(t.right.parent=r),t.parent=r.parent,r.parent===null?this.root_=t:r.parent.right===r?r.parent.right=t:r.parent.left=t,t.right=r,r.parent=t}},Ue.prototype.getFirstEntry=function(){var r=this.root_;if(r!=null)for(;r.left!=null;)r=r.left;return r},Ue.successor=function(r){if(r===null)return null;if(r.right!==null){for(var t=r.right;t.left!==null;)t=t.left;return t}else{for(var e=r.parent,n=r;e!==null&&n===e.right;)n=e,e=e.parent;return e}},Ue.prototype.size=function(){return this.size_};var xu=function(){};xu.prototype.interfaces_=function(){return[]},xu.prototype.getClass=function(){return xu};function _p(){}_p.prototype=new Bl;function wn(){this.array_=[],arguments[0]instanceof Ee&&this.addAll(arguments[0])}wn.prototype=new _p,wn.prototype.contains=function(r){for(var t=this,e=0,n=this.array_.length;e<n;e++){var i=t.array_[e];if(i.compareTo(r)===0)return!0}return!1},wn.prototype.add=function(r){var t=this;if(this.contains(r))return!1;for(var e=0,n=this.array_.length;e<n;e++){var i=t.array_[e];if(i.compareTo(r)===1)return t.array_.splice(e,0,r),!0}return this.array_.push(r),!0},wn.prototype.addAll=function(r){for(var t=this,e=r.iterator();e.hasNext();)t.add(e.next());return!0},wn.prototype.remove=function(r){throw new Tu},wn.prototype.size=function(){return this.array_.length},wn.prototype.isEmpty=function(){return this.array_.length===0},wn.prototype.toArray=function(){for(var r=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(r.array_[e]);return t},wn.prototype.iterator=function(){return new Ql(this)};var Ql=function(r){this.treeSet_=r,this.position_=0};Ql.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new aa;return this.treeSet_.array_[this.position_++]},Ql.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Ql.prototype.remove=function(){throw new Tu};var Ms=function(){};Ms.sort=function(){var t=arguments[0],e,n,i,s;if(arguments.length===1)s=function(a,u){return a.compareTo(u)},t.sort(s);else if(arguments.length===2)i=arguments[1],s=function(a,u){return i.compare(a,u)},t.sort(s);else if(arguments.length===3){n=t.slice(arguments[1],arguments[2]),n.sort();var o=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length));for(t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])}else if(arguments.length===4)for(n=t.slice(arguments[1],arguments[2]),i=arguments[3],s=function(a,u){return i.compare(a,u)},n.sort(s),o=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])},Ms.asList=function(t){for(var e=new B,n=0,i=t.length;n<i;n++)e.add(t[n]);return e};var Gt=function(){},sn={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};sn.P.get=function(){return 0},sn.L.get=function(){return 1},sn.A.get=function(){return 2},sn.FALSE.get=function(){return-1},sn.TRUE.get=function(){return-2},sn.DONTCARE.get=function(){return-3},sn.SYM_FALSE.get=function(){return"F"},sn.SYM_TRUE.get=function(){return"T"},sn.SYM_DONTCARE.get=function(){return"*"},sn.SYM_P.get=function(){return"0"},sn.SYM_L.get=function(){return"1"},sn.SYM_A.get=function(){return"2"},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.toDimensionSymbol=function(t){switch(t){case Gt.FALSE:return Gt.SYM_FALSE;case Gt.TRUE:return Gt.SYM_TRUE;case Gt.DONTCARE:return Gt.SYM_DONTCARE;case Gt.P:return Gt.SYM_P;case Gt.L:return Gt.SYM_L;case Gt.A:return Gt.SYM_A}throw new ne("Unknown dimension value: "+t)},Gt.toDimensionValue=function(t){switch(Iu.toUpperCase(t)){case Gt.SYM_FALSE:return Gt.FALSE;case Gt.SYM_TRUE:return Gt.TRUE;case Gt.SYM_DONTCARE:return Gt.DONTCARE;case Gt.SYM_P:return Gt.P;case Gt.SYM_L:return Gt.L;case Gt.SYM_A:return Gt.A}throw new ne("Unknown dimension symbol: "+t)},Object.defineProperties(Gt,sn);var Sn=function(){};Sn.prototype.filter=function(t){},Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn};var on=function(){};on.prototype.filter=function(t,e){},on.prototype.isDone=function(){},on.prototype.isGeometryChanged=function(){},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on};var He=function(r){function t(n,i){if(r.call(this,i),this._geometries=n||[],r.hasNullElements(this._geometries))throw new ne("geometries must not contain null elements")}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var i=this,s=new st,o=0;o<this._geometries.length;o++)s.expandToInclude(i._geometries[o].getEnvelopeInternal());return s},t.prototype.getGeometryN=function(i){return this._geometries[i]},t.prototype.getSortIndex=function(){return r.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var i=this,s=new Array(this.getNumPoints()).fill(null),o=-1,a=0;a<this._geometries.length;a++)for(var u=i._geometries[a].getCoordinates(),l=0;l<u.length;l++)o++,s[o]=u[l];return s},t.prototype.getArea=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getArea();return s},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;if(this._geometries.length!==a._geometries.length)return!1;for(var u=0;u<this._geometries.length;u++)if(!i._geometries[u].equalsExact(a._geometries[u],o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,s=0;s<this._geometries.length;s++)i._geometries[s].normalize();Ms.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var i=this,s=Gt.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,i._geometries[o].getBoundaryDimension());return s},t.prototype.getDimension=function(){for(var i=this,s=Gt.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,i._geometries[o].getDimension());return s},t.prototype.getLength=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getLength();return s},t.prototype.getNumPoints=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getNumPoints();return s},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=i._geometries[a].reverse();return this.getFactory().createGeometryCollection(o)},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var s=arguments[0],o=new wn(Ms.asList(this._geometries)),a=new wn(Ms.asList(s._geometries));return this.compare(o,a)}else if(arguments.length===2){for(var u=arguments[0],l=arguments[1],h=u,c=this.getNumGeometries(),f=h.getNumGeometries(),p=0;p<c&&p<f;){var v=i.getGeometryN(p),_=h.getGeometryN(p),w=v.compareToSameClass(_,l);if(w!==0)return w;p++}return p<c?1:p<f?-1:0}},t.prototype.apply=function(){var i=this;if(dt(arguments[0],Zn))for(var s=arguments[0],o=0;o<this._geometries.length;o++)i._geometries[o].apply(s);else if(dt(arguments[0],on)){var a=arguments[0];if(this._geometries.length===0)return null;for(var u=0;u<this._geometries.length&&(i._geometries[u].apply(a),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(dt(arguments[0],Sn)){var l=arguments[0];l.filter(this);for(var h=0;h<this._geometries.length;h++)i._geometries[h].apply(l)}else if(dt(arguments[0],Si)){var c=arguments[0];c.filter(this);for(var f=0;f<this._geometries.length;f++)i._geometries[f].apply(c)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),St.shouldNeverReachHere(),null},t.prototype.clone=function(){var i=this,s=r.prototype.clone.call(this);s._geometries=new Array(this._geometries.length).fill(null);for(var o=0;o<this._geometries.length;o++)s._geometries[o]=i._geometries[o].clone();return s},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new t(s,this._factory)},t.prototype.isEmpty=function(){for(var i=this,s=0;s<this._geometries.length;s++)if(!i._geometries[s].isEmpty())return!1;return!0},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(t,e),t}(ft),Ns=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return ft.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Gt.FALSE:0},t.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var s=0;s<this._geometries.length;s++)if(!i._geometries[s].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[s-1-a]=i._geometries[a].reverse();return this.getFactory().createMultiLineString(o)},t.prototype.getBoundary=function(){return new Ur(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[xu]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t}(He),Ur=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=Vr.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}};Ur.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return e.length===1?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Ur.prototype.getBoundary=function(){return this._geom instanceof ue?this.boundaryLineString(this._geom):this._geom instanceof Ns?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Ur.prototype.boundaryLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this._bnRule.isInBoundary(2);return e?t.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Ur.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Ur.prototype.computeBoundaryCoordinates=function(t){var e=this,n=new B;this._endpointMap=new Ue;for(var i=0;i<t.getNumGeometries();i++){var s=t.getGeometryN(i);s.getNumPoints()!==0&&(e.addEndpoint(s.getCoordinateN(0)),e.addEndpoint(s.getCoordinateN(s.getNumPoints()-1)))}for(var o=this._endpointMap.entrySet().iterator();o.hasNext();){var a=o.next(),u=a.getValue(),l=u.count;e._bnRule.isInBoundary(l)&&n.add(a.getKey())}return Mt.toCoordinateArray(n)},Ur.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new Kl,this._endpointMap.put(t,e)),e.count++},Ur.prototype.interfaces_=function(){return[]},Ur.prototype.getClass=function(){return Ur},Ur.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new Ur(t);return e.getBoundary()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=new Ur(n,i);return s.getBoundary()}};var Kl=function(){this.count=null};Kl.prototype.interfaces_=function(){return[]},Kl.prototype.getClass=function(){return Kl};function P_(){}function I_(){}var M_=function(){};function N_(){}function b_(){}function T_(){}var zr=function(){},Oc={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.chars=function(t,e){for(var n=new Array(e).fill(null),i=0;i<e;i++)n[i]=t;return String(n)},zr.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new N_,n=new P_;return t.printStackTrace(n),e.toString()}else if(arguments.length===2){var i=arguments[0],s=arguments[1],o="";new I_(zr.getStackTrace(i));for(var a=new T_,u=0;u<s;u++)try{o+=a.readLine()+zr.NEWLINE}catch(l){if(l instanceof b_)St.shouldNeverReachHere();else throw l}finally{}return o}},zr.split=function(t,e){for(var n=e.length,i=new B,s=""+t,o=s.indexOf(e);o>=0;){var a=s.substring(0,o);i.add(a),s=s.substring(o+n),o=s.indexOf(e)}s.length>0&&i.add(s);for(var u=new Array(i.size()).fill(null),l=0;l<u.length;l++)u[l]=i.get(l);return u},zr.toString=function(){if(arguments.length===1){var t=arguments[0];return zr.SIMPLE_ORDINATE_FORMAT.format(t)}},zr.spaces=function(t){return zr.chars(" ",t)},Oc.NEWLINE.get=function(){return Oe.getProperty("line.separator")},Oc.SIMPLE_ORDINATE_FORMAT.get=function(){return new M_},Object.defineProperties(zr,Oc);var ce=function(){};ce.prototype.interfaces_=function(){return[]},ce.prototype.getClass=function(){return ce},ce.copyCoord=function(t,e,n,i){for(var s=Math.min(t.getDimension(),n.getDimension()),o=0;o<s;o++)n.setOrdinate(i,o,t.getOrdinate(e,o))},ce.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,Ot.X)===t.getOrdinate(e-1,Ot.X)&&t.getOrdinate(0,Ot.Y)===t.getOrdinate(e-1,Ot.Y)},ce.isEqual=function(t,e){var n=t.size(),i=e.size();if(n!==i)return!1;for(var s=Math.min(t.getDimension(),e.getDimension()),o=0;o<n;o++)for(var a=0;a<s;a++){var u=t.getOrdinate(o,a),l=e.getOrdinate(o,a);if(t.getOrdinate(o,a)!==e.getOrdinate(o,a)&&!(vt.isNaN(u)&&vt.isNaN(l)))return!1}return!0},ce.extend=function(t,e,n){var i=t.create(n,e.getDimension()),s=e.size();if(ce.copy(e,0,i,0,s),s>0)for(var o=s;o<n;o++)ce.copy(e,s-1,i,o,1);return i},ce.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),i=0;i<=n;i++)ce.swap(t,i,e-i)},ce.swap=function(t,e,n){if(e===n)return null;for(var i=0;i<t.getDimension();i++){var s=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(n,i)),t.setOrdinate(n,i,s)}},ce.copy=function(t,e,n,i,s){for(var o=0;o<s;o++)ce.copyCoord(t,e+o,n,i+o)},ce.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var n=t.getDimension(),i=new mn;i.append("(");for(var s=0;s<e;s++){s>0&&i.append(" ");for(var o=0;o<n;o++)o>0&&i.append(","),i.append(zr.toString(t.getOrdinate(s,o)))}return i.append(")"),i.toString()}},ce.ensureValidRing=function(t,e){var n=e.size();if(n===0)return e;if(n<=3)return ce.createClosedRing(t,e,4);var i=e.getOrdinate(0,Ot.X)===e.getOrdinate(n-1,Ot.X)&&e.getOrdinate(0,Ot.Y)===e.getOrdinate(n-1,Ot.Y);return i?e:ce.createClosedRing(t,e,n+1)},ce.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),s=e.size();ce.copy(e,0,i,0,s);for(var o=s;o<n;o++)ce.copy(e,0,i,o,1);return i};var ue=function(r){function t(n,i){r.call(this,i),this._points=null,this.init(n)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new st:this._points.expandEnvelope(new st)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return r.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;if(this._points.size()!==a._points.size())return!1;for(var u=0;u<this._points.size();u++)if(!i.equal(i._points.getCoordinate(u),a._points.getCoordinate(u),o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,s=0;s<Math.trunc(this._points.size()/2);s++){var o=i._points.size()-1-s;if(!i._points.getCoordinate(s).equals(i._points.getCoordinate(o)))return i._points.getCoordinate(s).compareTo(i._points.getCoordinate(o))>0&&ce.reverse(i._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Gt.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return K.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var i=this._points.copy();ce.reverse(i);var s=this.getFactory().createLineString(i);return s},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var s=arguments[0],o=s,a=0,u=0;a<this._points.size()&&u<o._points.size();){var l=i._points.getCoordinate(a).compareTo(o._points.getCoordinate(u));if(l!==0)return l;a++,u++}return a<this._points.size()?1:u<o._points.size()?-1:0}else if(arguments.length===2){var h=arguments[0],c=arguments[1],f=h;return c.compare(this._points,f._points)}},t.prototype.apply=function(){var i=this;if(dt(arguments[0],Zn))for(var s=arguments[0],o=0;o<this._points.size();o++)s.filter(i._points.getCoordinate(o));else if(dt(arguments[0],on)){var a=arguments[0];if(this._points.size()===0)return null;for(var u=0;u<this._points.size()&&(a.filter(i._points,u),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(dt(arguments[0],Sn)){var l=arguments[0];l.filter(this)}else if(dt(arguments[0],Si)){var h=arguments[0];h.filter(this)}},t.prototype.getBoundary=function(){return new Ur(this).getBoundary()},t.prototype.isEquivalentClass=function(i){return i instanceof t},t.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._points=this._points.clone(),i},t.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return this._points.size()===0},t.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new ne("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},t.prototype.isCoordinate=function(i){for(var s=this,o=0;o<this._points.size();o++)if(s._points.getCoordinate(o).equals(i))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},t.prototype.interfaces_=function(){return[xu]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(ft),Ou=function(){};Ou.prototype.interfaces_=function(){return[]},Ou.prototype.getClass=function(){return Ou};var dr=function(r){function t(n,i){r.call(this,i),this._coordinates=n||null,this.init(this._coordinates)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new st;var i=new st;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},t.prototype.getSortIndex=function(){return r.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),s):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){},t.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},t.prototype.getBoundaryDimension=function(){return Gt.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getNumPoints=function(){return this.isEmpty()?0:1},t.prototype.reverse=function(){return this.copy()},t.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},t.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],s=i;return this.getCoordinate().compareTo(s.getCoordinate())}else if(arguments.length===2){var o=arguments[0],a=arguments[1],u=o;return a.compare(this._coordinates,u._coordinates)}},t.prototype.apply=function(){if(dt(arguments[0],Zn)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(dt(arguments[0],on)){var s=arguments[0];if(this.isEmpty())return null;s.filter(this._coordinates,0),s.isGeometryChanged()&&this.geometryChanged()}else if(dt(arguments[0],Sn)){var o=arguments[0];o.filter(this)}else if(dt(arguments[0],Si)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},t.prototype.getGeometryType=function(){return"Point"},t.prototype.copy=function(){return new t(this._coordinates.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._coordinates},t.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},t.prototype.isEmpty=function(){return this._coordinates.size()===0},t.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),St.isTrue(i.size()<=1),this._coordinates=i},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[Ou]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t}(ft),$i=function(){};$i.prototype.interfaces_=function(){return[]},$i.prototype.getClass=function(){return $i};var we=function(r){function t(n,i,s){if(r.call(this,s),this._shell=null,this._holes=null,n===null&&(n=this.getFactory().createLinearRing()),i===null&&(i=[]),r.hasNullElements(i))throw new ne("holes must not contain null elements");if(n.isEmpty()&&r.hasNonEmptyElements(i))throw new ne("shell is empty but holes are not");this._shell=n,this._holes=i}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return r.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var s=new Array(this.getNumPoints()).fill(null),o=-1,a=this._shell.getCoordinates(),u=0;u<a.length;u++)o++,s[o]=a[u];for(var l=0;l<this._holes.length;l++)for(var h=i._holes[l].getCoordinates(),c=0;c<h.length;c++)o++,s[o]=h[c];return s},t.prototype.getArea=function(){var i=this,s=0;s+=Math.abs(K.signedArea(this._shell.getCoordinateSequence()));for(var o=0;o<this._holes.length;o++)s-=Math.abs(K.signedArea(i._holes[o].getCoordinateSequence()));return s},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),s=this.getEnvelopeInternal(),o=0;o<5;o++){var a=i.getX(o);if(!(a===s.getMinX()||a===s.getMaxX()))return!1;var u=i.getY(o);if(!(u===s.getMinY()||u===s.getMaxY()))return!1}for(var l=i.getX(0),h=i.getY(0),c=1;c<=4;c++){var f=i.getX(c),p=i.getY(c),v=f!==l,_=p!==h;if(v===_)return!1;l=f,h=p}return!0},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s,u=this._shell,l=a._shell;if(!u.equalsExact(l,o)||this._holes.length!==a._holes.length)return!1;for(var h=0;h<this._holes.length;h++)if(!i._holes[h].equalsExact(a._holes[h],o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var s=0;s<this._holes.length;s++)i.normalize(i._holes[s],!1);Ms.sort(this._holes)}else if(arguments.length===2){var o=arguments[0],a=arguments[1];if(o.isEmpty())return null;var u=new Array(o.getCoordinates().length-1).fill(null);Oe.arraycopy(o.getCoordinates(),0,u,0,u.length);var l=Mt.minCoordinate(o.getCoordinates());Mt.scroll(u,l),Oe.arraycopy(u,0,o.getCoordinates(),0,u.length),o.getCoordinates()[u.length]=u[0],K.isCCW(o.getCoordinates())===a&&Mt.reverse(o.getCoordinates())}},t.prototype.getCoordinate=function(){return this._shell.getCoordinate()},t.prototype.getNumInteriorRing=function(){return this._holes.length},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.getLength=function(){var i=this,s=0;s+=this._shell.getLength();for(var o=0;o<this._holes.length;o++)s+=i._holes[o].getLength();return s},t.prototype.getNumPoints=function(){for(var i=this,s=this._shell.getNumPoints(),o=0;o<this._holes.length;o++)s+=i._holes[o].getNumPoints();return s},t.prototype.reverse=function(){var i=this,s=this.copy();s._shell=this._shell.copy().reverse(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=i._holes[o].copy().reverse();return s},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var s=arguments[0],o=this._shell,a=s._shell;return o.compareToSameClass(a)}else if(arguments.length===2){var u=arguments[0],l=arguments[1],h=u,c=this._shell,f=h._shell,p=c.compareToSameClass(f,l);if(p!==0)return p;for(var v=this.getNumInteriorRing(),_=h.getNumInteriorRing(),w=0;w<v&&w<_;){var I=i.getInteriorRingN(w),y=h.getInteriorRingN(w),E=I.compareToSameClass(y,l);if(E!==0)return E;w++}return w<v?1:w<_?-1:0}},t.prototype.apply=function(i){var s=this;if(dt(i,Zn)){this._shell.apply(i);for(var o=0;o<this._holes.length;o++)s._holes[o].apply(i)}else if(dt(i,on)){if(this._shell.apply(i),!i.isDone())for(var a=0;a<this._holes.length&&(s._holes[a].apply(i),!i.isDone());a++);i.isGeometryChanged()&&this.geometryChanged()}else if(dt(i,Sn))i.filter(this);else if(dt(i,Si)){i.filter(this),this._shell.apply(i);for(var u=0;u<this._holes.length;u++)s._holes[u].apply(i)}},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var s=new Array(this._holes.length+1).fill(null);s[0]=this._shell;for(var o=0;o<this._holes.length;o++)s[o+1]=i._holes[o];return s.length<=1?this.getFactory().createLinearRing(s[0].getCoordinateSequence()):this.getFactory().createMultiLineString(s)},t.prototype.clone=function(){var i=this,s=r.prototype.clone.call(this);s._shell=this._shell.clone(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=i._holes[o].clone();return s},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var i=this,s=this._shell.copy(),o=new Array(this._holes.length).fill(null),a=0;a<o.length;a++)o[a]=i._holes[a].copy();return new t(s,o,this._factory)},t.prototype.getExteriorRing=function(){return this._shell},t.prototype.isEmpty=function(){return this._shell.isEmpty()},t.prototype.getInteriorRingN=function(i){return this._holes[i]},t.prototype.interfaces_=function(){return[$i]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t}(ft),la=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return ft.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return r.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return Gt.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.getGeometryType=function(){return"MultiPoint"},t.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[Ou]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t}(He),$n=function(r){function t(n,i){n instanceof D&&i instanceof Nt&&(n=i.getCoordinateSequenceFactory().create(n)),r.call(this,n,i),this.validateConstruction()}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return ft.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return Gt.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:r.prototype.isClosed.call(this)},t.prototype.reverse=function(){var i=this._points.copy();ce.reverse(i);var s=this.getFactory().createLinearRing(i);return s},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!r.prototype.isClosed.call(this))throw new ne("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new ne("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.MINIMUM_VALID_SIZE.get=function(){return 4},e.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,e),t}(ue),jn=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return ft.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=i._geometries[a].reverse();return this.getFactory().createMultiPolygon(o)},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var s=new B,o=0;o<this._geometries.length;o++)for(var a=i._geometries[o],u=a.getBoundary(),l=0;l<u.getNumGeometries();l++)s.add(u.getGeometryN(l));var h=new Array(s.size()).fill(null);return this.getFactory().createMultiLineString(s.toArray(h))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[$i]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t}(He),qr=function(t){this._factory=t||null,this._isUserDataCopied=!1},Zl={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};qr.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},qr.prototype.edit=function(t,e){if(t===null)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},qr.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof He?this.editGeometryCollection(t,e):t instanceof we?this.editPolygon(t,e):t instanceof dr?e.edit(t,this._factory):t instanceof ue?e.edit(t,this._factory):(St.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},qr.prototype.editGeometryCollection=function(t,e){for(var n=this,i=e.edit(t,this._factory),s=new B,o=0;o<i.getNumGeometries();o++){var a=n.edit(i.getGeometryN(o),e);a===null||a.isEmpty()||s.add(a)}return i.getClass()===la?this._factory.createMultiPoint(s.toArray([])):i.getClass()===Ns?this._factory.createMultiLineString(s.toArray([])):i.getClass()===jn?this._factory.createMultiPolygon(s.toArray([])):this._factory.createGeometryCollection(s.toArray([]))},qr.prototype.editPolygon=function(t,e){var n=this,i=e.edit(t,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var s=this.edit(i.getExteriorRing(),e);if(s===null||s.isEmpty())return this._factory.createPolygon();for(var o=new B,a=0;a<i.getNumInteriorRing();a++){var u=n.edit(i.getInteriorRingN(a),e);u===null||u.isEmpty()||o.add(u)}return this._factory.createPolygon(s,o.toArray([]))},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr},qr.GeometryEditorOperation=function(){},Zl.NoOpGeometryOperation.get=function(){return Au},Zl.CoordinateOperation.get=function(){return Du},Zl.CoordinateSequenceOperation.get=function(){return Lu},Object.defineProperties(qr,Zl);var Au=function(){};Au.prototype.edit=function(t,e){return t},Au.prototype.interfaces_=function(){return[qr.GeometryEditorOperation]},Au.prototype.getClass=function(){return Au};var Du=function(){};Du.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return n===null?t:t instanceof $n?e.createLinearRing(n):t instanceof ue?e.createLineString(n):t instanceof dr?n.length>0?e.createPoint(n[0]):e.createPoint():t},Du.prototype.interfaces_=function(){return[qr.GeometryEditorOperation]},Du.prototype.getClass=function(){return Du};var Lu=function(){};Lu.prototype.edit=function(t,e){return t instanceof $n?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof ue?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof dr?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},Lu.prototype.interfaces_=function(){return[qr.GeometryEditorOperation]},Lu.prototype.getClass=function(){return Lu};var fe=function(){var t=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var n=0;n<e;n++)t._coordinates[n]=new D}else if(dt(arguments[0],Ot)){var i=arguments[0];if(i===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._coordinates=new Array(i.size()).fill(null);for(var s=0;s<this._coordinates.length;s++)t._coordinates[s]=i.getCoordinateCopy(s)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var o=arguments[0],a=arguments[1];this._coordinates=o,this._dimension=a,o===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var h=0;h<u;h++)t._coordinates[h]=new D}}},Ep={serialVersionUID:{configurable:!0}};fe.prototype.setOrdinate=function(t,e,n){switch(e){case Ot.X:this._coordinates[t].x=n;break;case Ot.Y:this._coordinates[t].y=n;break;case Ot.Z:this._coordinates[t].z=n;break;default:throw new ne("invalid ordinateIndex")}},fe.prototype.size=function(){return this._coordinates.length},fe.prototype.getOrdinate=function(t,e){switch(e){case Ot.X:return this._coordinates[t].x;case Ot.Y:return this._coordinates[t].y;case Ot.Z:return this._coordinates[t].z}return vt.NaN},fe.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},fe.prototype.getCoordinateCopy=function(t){return new D(this._coordinates[t])},fe.prototype.getDimension=function(){return this._dimension},fe.prototype.getX=function(t){return this._coordinates[t].x},fe.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].clone();return new fe(e,this._dimension)},fe.prototype.expandEnvelope=function(t){for(var e=this,n=0;n<this._coordinates.length;n++)t.expandToInclude(e._coordinates[n]);return t},fe.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].copy();return new fe(e,this._dimension)},fe.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new mn(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var n=1;n<this._coordinates.length;n++)e.append(", "),e.append(t._coordinates[n]);return e.append(")"),e.toString()}else return"()"},fe.prototype.getY=function(t){return this._coordinates[t].y},fe.prototype.toCoordinateArray=function(){return this._coordinates},fe.prototype.interfaces_=function(){return[Ot,kr]},fe.prototype.getClass=function(){return fe},Ep.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(fe,Ep);var ti=function(){},Ac={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};ti.prototype.readResolve=function(){return ti.instance()},ti.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new fe(t)}else if(dt(arguments[0],Ot)){var e=arguments[0];return new fe(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new fe(n):new fe(n,i)}},ti.prototype.interfaces_=function(){return[jo,kr]},ti.prototype.getClass=function(){return ti},ti.instance=function(){return ti.instanceObject},Ac.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Ac.instanceObject.get=function(){return new ti},Object.defineProperties(ti,Ac);var wp=function(r){function t(){r.call(this),this.map_=new Map}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(n){return this.map_.get(n)||null},t.prototype.put=function(n,i){return this.map_.set(n,i),i},t.prototype.values=function(){for(var n=new B,i=this.map_.values(),s=i.next();!s.done;)n.add(s.value),s=i.next();return n},t.prototype.entrySet=function(){var n=new Tc;return this.map_.entries().forEach(function(i){return n.add(i)}),n},t.prototype.size=function(){return this.map_.size()},t}(ho),kt=function r(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=r.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof Cn){var t=arguments[0];this._modelType=t,t===r.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var e=arguments[0];this._modelType=r.FIXED,this.setScale(e)}else if(arguments[0]instanceof r){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}},Dc={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};kt.prototype.equals=function(t){if(!(t instanceof kt))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},kt.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new yn(n).compareTo(new yn(i))},kt.prototype.getScale=function(){return this._scale},kt.prototype.isFloating=function(){return this._modelType===kt.FLOATING||this._modelType===kt.FLOATING_SINGLE},kt.prototype.getType=function(){return this._modelType},kt.prototype.toString=function(){var t="UNKNOWN";return this._modelType===kt.FLOATING?t="Floating":this._modelType===kt.FLOATING_SINGLE?t="Floating-Single":this._modelType===kt.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},kt.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(vt.isNaN(t))return t;if(this._modelType===kt.FLOATING_SINGLE){var e=t;return e}return this._modelType===kt.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof D){var n=arguments[0];if(this._modelType===kt.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}},kt.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===kt.FLOATING?t=16:this._modelType===kt.FLOATING_SINGLE?t=6:this._modelType===kt.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},kt.prototype.setScale=function(t){this._scale=Math.abs(t)},kt.prototype.interfaces_=function(){return[kr,Gr]},kt.prototype.getClass=function(){return kt},kt.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Dc.serialVersionUID.get=function(){return 7777263578777804e3},Dc.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(kt,Dc);var Cn=function r(t){this._name=t||null,r.nameToTypeMap.put(t,this)},Lc={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Cn.prototype.readResolve=function(){return Cn.nameToTypeMap.get(this._name)},Cn.prototype.toString=function(){return this._name},Cn.prototype.interfaces_=function(){return[kr]},Cn.prototype.getClass=function(){return Cn},Lc.serialVersionUID.get=function(){return-552860263173159e4},Lc.nameToTypeMap.get=function(){return new wp},Object.defineProperties(Cn,Lc),kt.Type=Cn,kt.FIXED=new Cn("FIXED"),kt.FLOATING=new Cn("FLOATING"),kt.FLOATING_SINGLE=new Cn("FLOATING SINGLE");var Nt=function r(){this._precisionModel=new kt,this._SRID=0,this._coordinateSequenceFactory=r.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?dt(arguments[0],jo)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof kt&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},Sp={serialVersionUID:{configurable:!0}};Nt.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new D(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new D(t.getMinX(),t.getMinY()),new D(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new D(t.getMinX(),t.getMinY()),new D(t.getMinX(),t.getMaxY()),new D(t.getMaxX(),t.getMaxY()),new D(t.getMaxX(),t.getMinY()),new D(t.getMinX(),t.getMinY())]),null)},Nt.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new ue(this.getCoordinateSequenceFactory().create(t),this);if(dt(t,Ot))return new ue(t,this)}else return new ue(this.getCoordinateSequenceFactory().create([]),this)},Nt.prototype.createMultiLineString=function(){if(arguments.length===0)return new Ns(null,this);if(arguments.length===1){var t=arguments[0];return new Ns(t,this)}},Nt.prototype.buildGeometry=function(t){for(var e=null,n=!1,i=!1,s=t.iterator();s.hasNext();){var o=s.next(),a=o.getClass();e===null&&(e=a),a!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(e===null)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(Nt.toGeometryArray(t));var u=t.iterator().next(),l=t.size()>1;if(l){if(u instanceof we)return this.createMultiPolygon(Nt.toPolygonArray(t));if(u instanceof ue)return this.createMultiLineString(Nt.toLineStringArray(t));if(u instanceof dr)return this.createMultiPoint(Nt.toPointArray(t));St.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},Nt.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},Nt.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof D){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(dt(arguments[0],Ot)){var e=arguments[0];return new dr(e,this)}}},Nt.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},Nt.prototype.createPolygon=function(){if(arguments.length===0)return new we(null,null,this);if(arguments.length===1){if(dt(arguments[0],Ot)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof $n){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];return new we(i,s,this)}},Nt.prototype.getSRID=function(){return this._SRID},Nt.prototype.createGeometryCollection=function(){if(arguments.length===0)return new He(null,this);if(arguments.length===1){var t=arguments[0];return new He(t,this)}},Nt.prototype.createGeometry=function(t){var e=new qr(this);return e.edit(t,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})},Nt.prototype.getPrecisionModel=function(){return this._precisionModel},Nt.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(dt(arguments[0],Ot)){var e=arguments[0];return new $n(e,this)}}},Nt.prototype.createMultiPolygon=function(){if(arguments.length===0)return new jn(null,this);if(arguments.length===1){var t=arguments[0];return new jn(t,this)}},Nt.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new la(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new la(e,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(dt(arguments[0],Ot)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(i.size()).fill(null),o=0;o<i.size();o++){var a=t.getCoordinateSequenceFactory().create(1,i.getDimension());ce.copy(i,o,a,0,1),s[o]=t.createPoint(a)}return this.createMultiPoint(s)}}},Nt.prototype.interfaces_=function(){return[kr]},Nt.prototype.getClass=function(){return Nt},Nt.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Nt.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},Nt.getDefaultCoordinateSequenceFactory=function(){return ti.instance()},Nt.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Nt.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Nt.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Nt.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Nt.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Nt.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Nt.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},Sp.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(Nt,Sp);var x_=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],$l=function(t){this.geometryFactory=t||new Nt};$l.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var n=e.type;if(!Pn[n])throw new Error("Unknown GeoJSON type: "+e.type);return x_.indexOf(n)!==-1?Pn[n].apply(this,[e.coordinates]):n==="GeometryCollection"?Pn[n].apply(this,[e.geometries]):Pn[n].apply(this,[e])},$l.prototype.write=function(t){var e=t.getGeometryType();if(!Mi[e])throw new Error("Geometry is not supported");return Mi[e].apply(this,[t])};var Pn={Feature:function(r){var t={};for(var e in r)t[e]=r[e];if(r.geometry){var n=r.geometry.type;if(!Pn[n])throw new Error("Unknown GeoJSON type: "+r.type);t.geometry=this.read(r.geometry)}return r.bbox&&(t.bbox=Pn.bbox.apply(this,[r.bbox])),t},FeatureCollection:function(r){var t=this,e={};if(r.features){e.features=[];for(var n=0;n<r.features.length;++n)e.features.push(t.read(r.features[n]))}return r.bbox&&(e.bbox=this.parse.bbox.apply(this,[r.bbox])),e},coordinates:function(r){for(var t=[],e=0;e<r.length;++e){var n=r[e];t.push(new D(n[0],n[1]))}return t},bbox:function(r){return this.geometryFactory.createLinearRing([new D(r[0],r[1]),new D(r[2],r[1]),new D(r[2],r[3]),new D(r[0],r[3]),new D(r[0],r[1])])},Point:function(r){var t=new D(r[0],r[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(r){for(var t=this,e=[],n=0;n<r.length;++n)e.push(Pn.Point.apply(t,[r[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(r){var t=Pn.coordinates.apply(this,[r]);return this.geometryFactory.createLineString(t)},MultiLineString:function(r){for(var t=this,e=[],n=0;n<r.length;++n)e.push(Pn.LineString.apply(t,[r[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(r){for(var t=this,e=Pn.coordinates.apply(this,[r[0]]),n=this.geometryFactory.createLinearRing(e),i=[],s=1;s<r.length;++s){var o=r[s],a=Pn.coordinates.apply(t,[o]),u=t.geometryFactory.createLinearRing(a);i.push(u)}return this.geometryFactory.createPolygon(n,i)},MultiPolygon:function(r){for(var t=this,e=[],n=0;n<r.length;++n){var i=r[n];e.push(Pn.Polygon.apply(t,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(r){for(var t=this,e=[],n=0;n<r.length;++n){var i=r[n];e.push(t.read(i))}return this.geometryFactory.createGeometryCollection(e)}},Mi={coordinate:function(r){return[r.x,r.y]},Point:function(r){var t=Mi.coordinate.apply(this,[r.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=Mi.Point.apply(t,[i]);e.push(s.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(r){for(var t=this,e=[],n=r.getCoordinates(),i=0;i<n.length;++i){var s=n[i];e.push(Mi.coordinate.apply(t,[s]))}return{type:"LineString",coordinates:e}},MultiLineString:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=Mi.LineString.apply(t,[i]);e.push(s.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(r){var t=this,e=[],n=Mi.LineString.apply(this,[r._shell]);e.push(n.coordinates);for(var i=0;i<r._holes.length;++i){var s=r._holes[i],o=Mi.LineString.apply(t,[s]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=Mi.Polygon.apply(t,[i]);e.push(s.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=i.getGeometryType();e.push(Mi[s].apply(t,[i]))}return{type:"GeometryCollection",geometries:e}}},Rc=function(t){this.geometryFactory=t||new Nt,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new $l(this.geometryFactory)};Rc.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===kt.FIXED&&this.reducePrecision(e),e},Rc.prototype.reducePrecision=function(t){var e=this,n,i;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(n=0,i=t.points.length;n<i;n++)e.precisionModel.makePrecise(t.points[n]);else if(t.geometries)for(n=0,i=t.geometries.length;n<i;n++)e.reducePrecision(t.geometries[n])};var Cp=function(){this.parser=new $l(this.geometryFactory)};Cp.prototype.write=function(t){return this.parser.write(t)};var H=function(){},jl={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};H.prototype.interfaces_=function(){return[]},H.prototype.getClass=function(){return H},H.opposite=function(t){return t===H.LEFT?H.RIGHT:t===H.RIGHT?H.LEFT:t},jl.ON.get=function(){return 0},jl.LEFT.get=function(){return 1},jl.RIGHT.get=function(){return 2},Object.defineProperties(H,jl);function th(r){this.message=r||""}th.prototype=new Error,th.prototype.name="EmptyStackException";function In(){this.array_=[]}In.prototype=new nn,In.prototype.add=function(r){return this.array_.push(r),!0},In.prototype.get=function(r){if(r<0||r>=this.size())throw new Error;return this.array_[r]},In.prototype.push=function(r){return this.array_.push(r),r},In.prototype.pop=function(r){if(this.array_.length===0)throw new th;return this.array_.pop()},In.prototype.peek=function(){if(this.array_.length===0)throw new th;return this.array_[this.array_.length-1]},In.prototype.empty=function(){return this.array_.length===0},In.prototype.isEmpty=function(){return this.empty()},In.prototype.search=function(r){return this.array_.indexOf(r)},In.prototype.size=function(){return this.array_.length},In.prototype.toArray=function(){for(var r=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(r.array_[e]);return t};var Mn=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Mn.prototype.getCoordinate=function(){return this._minCoord},Mn.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},Mn.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();St.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],i=K.computeOrientation(this._minCoord,n,e),s=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&i===K.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&i===K.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)},Mn.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge(),i=n.getCoordinates();if(e<0||e+1>=i.length||i[e].y===i[e+1].y)return-1;var s=H.LEFT;return i[e].y<i[e+1].y&&(s=H.RIGHT),s},Mn.prototype.getEdge=function(){return this._orientedDe},Mn.prototype.checkForRightmostCoordinate=function(t){for(var e=this,n=t.getEdge().getCoordinates(),i=0;i<n.length-1;i++)(e._minCoord===null||n[i].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=i,e._minCoord=n[i])},Mn.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Mn.prototype.findEdge=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next();i.isForward()&&e.checkForRightmostCoordinate(i)}St.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var s=this.getRightmostSide(this._minDe,this._minIndex);s===H.LEFT&&(this._orientedDe=this._minDe.getSym())},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn};var Ni=function(r){function t(e,n){r.call(this,t.msgWithCoord(e,n)),this.pt=n?new D(n):null,this.name="TopologyException"}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(n,i){return i?n:n+" [ "+i+" ]"},t}(wi),eh=function(){this.array_=[]};eh.prototype.addLast=function(t){this.array_.push(t)},eh.prototype.removeFirst=function(){return this.array_.shift()},eh.prototype.isEmpty=function(){return this.array_.length===0};var Ye=function(){this._finder=null,this._dirEdgeList=new B,this._nodes=new B,this._rightMostCoord=null,this._env=null,this._finder=new Mn};Ye.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},Ye.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ye.prototype.computeNodeDepth=function(t){for(var e=this,n=null,i=t.getEdges().iterator();i.hasNext();){var s=i.next();if(s.isVisited()||s.getSym().isVisited()){n=s;break}}if(n===null)throw new Ni("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(n);for(var o=t.getEdges().iterator();o.hasNext();){var a=o.next();a.setVisited(!0),e.copySymDepths(a)}},Ye.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(H.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Ye.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ye.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(H.RIGHT)>=1&&e.getDepth(H.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Ye.prototype.computeDepths=function(t){var e=this,n=new Tc,i=new eh,s=t.getNode();for(i.addLast(s),n.add(s),t.setVisited(!0);!i.isEmpty();){var o=i.removeFirst();n.add(o),e.computeNodeDepth(o);for(var a=o.getEdges().iterator();a.hasNext();){var u=a.next(),l=u.getSym();if(!l.isVisited()){var h=l.getNode();n.contains(h)||(i.addLast(h),n.add(h))}}}},Ye.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Ye.prototype.getEnvelope=function(){if(this._env===null){for(var t=new st,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),i=n.getEdge().getCoordinates(),s=0;s<i.length-1;s++)t.expandToInclude(i[s]);this._env=t}return this._env},Ye.prototype.addReachable=function(t){var e=this,n=new In;for(n.add(t);!n.empty();){var i=n.pop();e.add(i,n)}},Ye.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(H.LEFT,t.getDepth(H.RIGHT)),e.setDepth(H.RIGHT,t.getDepth(H.LEFT))},Ye.prototype.add=function(t,e){var n=this;t.setVisited(!0),this._nodes.add(t);for(var i=t.getEdges().iterator();i.hasNext();){var s=i.next();n._dirEdgeList.add(s);var o=s.getSym(),a=o.getNode();a.isVisited()||e.push(a)}},Ye.prototype.getNodes=function(){return this._nodes},Ye.prototype.getDirectedEdges=function(){return this._dirEdgeList},Ye.prototype.interfaces_=function(){return[Gr]},Ye.prototype.getClass=function(){return Ye};var Zt=function r(){var t=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[H.ON]=n}else if(arguments[0]instanceof r){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var s=0;s<this.location.length;s++)t.location[s]=i.location[s]}}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];this.init(3),this.location[H.ON]=o,this.location[H.LEFT]=a,this.location[H.RIGHT]=u}};Zt.prototype.setAllLocations=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]=t},Zt.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==F.NONE)return!1;return!0},Zt.prototype.setAllLocationsIfNull=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]===F.NONE&&(e.location[n]=t)},Zt.prototype.isLine=function(){return this.location.length===1},Zt.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var n=new Array(3).fill(null);n[H.ON]=this.location[H.ON],n[H.LEFT]=F.NONE,n[H.RIGHT]=F.NONE,this.location=n}for(var i=0;i<this.location.length;i++)e.location[i]===F.NONE&&i<t.location.length&&(e.location[i]=t.location[i])},Zt.prototype.getLocations=function(){return this.location},Zt.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[H.LEFT];this.location[H.LEFT]=this.location[H.RIGHT],this.location[H.RIGHT]=t},Zt.prototype.toString=function(){var t=new mn;return this.location.length>1&&t.append(F.toLocationSymbol(this.location[H.LEFT])),t.append(F.toLocationSymbol(this.location[H.ON])),this.location.length>1&&t.append(F.toLocationSymbol(this.location[H.RIGHT])),t.toString()},Zt.prototype.setLocations=function(t,e,n){this.location[H.ON]=t,this.location[H.LEFT]=e,this.location[H.RIGHT]=n},Zt.prototype.get=function(t){return t<this.location.length?this.location[t]:F.NONE},Zt.prototype.isArea=function(){return this.location.length>1},Zt.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===F.NONE)return!0;return!1},Zt.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(H.ON,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.location[e]=n}},Zt.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(F.NONE)},Zt.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Zt.prototype.allPositionsEqual=function(t){for(var e=this,n=0;n<this.location.length;n++)if(e.location[n]!==t)return!1;return!0},Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt};var Ht=function r(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new Zt(t),this.elt[1]=new Zt(t)}else if(arguments[0]instanceof r){var e=arguments[0];this.elt[0]=new Zt(e.elt[0]),this.elt[1]=new Zt(e.elt[1])}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[0]=new Zt(F.NONE),this.elt[1]=new Zt(F.NONE),this.elt[n].setLocation(i)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this.elt[0]=new Zt(s,o,a),this.elt[1]=new Zt(s,o,a)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],h=arguments[2],c=arguments[3];this.elt[0]=new Zt(F.NONE,F.NONE,F.NONE),this.elt[1]=new Zt(F.NONE,F.NONE,F.NONE),this.elt[u].setLocations(l,h,c)}};Ht.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Ht.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Ht.prototype.isNull=function(t){return this.elt[t].isNull()},Ht.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},Ht.prototype.isLine=function(t){return this.elt[t].isLine()},Ht.prototype.merge=function(t){for(var e=this,n=0;n<2;n++)e.elt[n]===null&&t.elt[n]!==null?e.elt[n]=new Zt(t.elt[n]):e.elt[n].merge(t.elt[n])},Ht.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Ht.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(H.ON)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Ht.prototype.toString=function(){var t=new mn;return this.elt[0]!==null&&(t.append("A:"),t.append(this.elt[0].toString())),this.elt[1]!==null&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},Ht.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var t=arguments[0];return this.elt[t].isArea()}},Ht.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Ht.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(H.ON,e)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this.elt[n].setLocation(i,s)}},Ht.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Ht.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Ht.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Zt(this.elt[t].location[0]))},Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.toLineLabel=function(t){for(var e=new Ht(F.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var ve=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new B,this._pts=new B,this._label=new Ht(F.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new B,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};ve.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),n=0;n<this._pts.size();n++)e[n]=t._pts.get(n);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=K.isCCW(this._ring.getCoordinates())},ve.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},ve.prototype.computePoints=function(t){var e=this;this._startDe=t;var n=t,i=!0;do{if(n===null)throw new Ni("Found null DirectedEdge");if(n.getEdgeRing()===e)throw new Ni("Directed Edge visited twice during ring-building at "+n.getCoordinate());e._edges.add(n);var s=n.getLabel();St.isTrue(s.isArea()),e.mergeLabel(s),e.addPoints(n.getEdge(),n.isForward(),i),i=!1,e.setEdgeRing(n,e),n=e.getNext(n)}while(n!==this._startDe)},ve.prototype.getLinearRing=function(){return this._ring},ve.prototype.getCoordinate=function(t){return this._pts.get(t)},ve.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var n=e.getNode(),i=n.getEdges().getOutgoingDegree(t);i>t._maxNodeDegree&&(t._maxNodeDegree=i),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},ve.prototype.addPoints=function(t,e,n){var i=this,s=t.getCoordinates();if(e){var o=1;n&&(o=0);for(var a=o;a<s.length;a++)i._pts.add(s[a])}else{var u=s.length-2;n&&(u=s.length-1);for(var l=u;l>=0;l--)i._pts.add(s[l])}},ve.prototype.isHole=function(){return this._isHole},ve.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},ve.prototype.containsPoint=function(t){var e=this.getLinearRing(),n=e.getEnvelopeInternal();if(!n.contains(t)||!K.isPointInRing(t,e.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var s=i.next();if(s.containsPoint(t))return!1}return!0},ve.prototype.addHole=function(t){this._holes.add(t)},ve.prototype.isShell=function(){return this._shell===null},ve.prototype.getLabel=function(){return this._label},ve.prototype.getEdges=function(){return this._edges},ve.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},ve.prototype.getShell=function(){return this._shell},ve.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=e.getLocation(n,H.RIGHT);if(i===F.NONE)return null;if(this._label.getLocation(n)===F.NONE)return this._label.setLocation(n,i),null}},ve.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},ve.prototype.toPolygon=function(t){for(var e=this,n=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)n[i]=e._holes.get(i).getLinearRing();var s=t.createPolygon(this.getLinearRing(),n);return s},ve.prototype.interfaces_=function(){return[]},ve.prototype.getClass=function(){return ve};var O_=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(n,i){n.setMinEdgeRing(i)},t.prototype.getNext=function(n){return n.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ve),A_=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var n=this,i=new B,s=this._startDe;do{if(s.getMinEdgeRing()===null){var o=new O_(s,n._geometryFactory);i.add(o)}s=s.getNext()}while(s!==this._startDe);return i},t.prototype.setEdgeRing=function(n,i){n.setEdgeRing(i)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var n=this,i=this._startDe;do{var s=i.getNode();s.getEdges().linkMinimalDirectedEdges(n),i=i.getNext()}while(i!==this._startDe)},t.prototype.getNext=function(n){return n.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ve),br=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._label=t}}};br.prototype.setVisited=function(t){this._isVisited=t},br.prototype.setInResult=function(t){this._isInResult=t},br.prototype.isCovered=function(){return this._isCovered},br.prototype.isCoveredSet=function(){return this._isCoveredSet},br.prototype.setLabel=function(t){this._label=t},br.prototype.getLabel=function(){return this._label},br.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},br.prototype.updateIM=function(t){St.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},br.prototype.isInResult=function(){return this._isInResult},br.prototype.isVisited=function(){return this._isVisited},br.prototype.interfaces_=function(){return[]},br.prototype.getClass=function(){return br};var rh=function(r){function t(){r.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new Ht(0,F.NONE)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var i=n.next();if(i.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(n){},t.prototype.computeMergedLocation=function(n,i){var s=F.NONE;if(s=this._label.getLocation(i),!n.isNull(i)){var o=n.getLocation(i);s!==F.BOUNDARY&&(s=o)}return s},t.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this._label===null?this._label=new Ht(n,i):this._label.setLocation(n,i)}else return r.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof t){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof Ht)for(var s=arguments[0],o=0;o<2;o++){var a=n.computeMergedLocation(s,o),u=n._label.getLocation(o);u===F.NONE&&n._label.setLocation(o,a)}},t.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},t.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var i=F.NONE;this._label!==null&&(i=this._label.getLocation(n));var s=null;switch(i){case F.BOUNDARY:s=F.INTERIOR;break;case F.INTERIOR:s=F.BOUNDARY;break;default:s=F.BOUNDARY;break}this._label.setLocation(n,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(br),Nn=function(){this.nodeMap=new Ue,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Nn.prototype.find=function(t){return this.nodeMap.get(t)},Nn.prototype.addNode=function(){if(arguments[0]instanceof D){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof rh){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return i===null?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}},Nn.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Nn.prototype.iterator=function(){return this.nodeMap.values().iterator()},Nn.prototype.values=function(){return this.nodeMap.values()},Nn.prototype.getBoundaryNodes=function(t){for(var e=new B,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===F.BOUNDARY&&e.add(i)}return e},Nn.prototype.add=function(t){var e=t.getCoordinate(),n=this.addNode(e);n.add(t)},Nn.prototype.interfaces_=function(){return[]},Nn.prototype.getClass=function(){return Nn};var Yt=function(){},Ru={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.isNorthern=function(t){return t===Yt.NE||t===Yt.NW},Yt.isOpposite=function(t,e){if(t===e)return!1;var n=(t-e+4)%4;return n===2},Yt.commonHalfPlane=function(t,e){if(t===e)return t;var n=(t-e+4)%4;if(n===2)return-1;var i=t<e?t:e,s=t>e?t:e;return i===0&&s===3?3:i},Yt.isInHalfPlane=function(t,e){return e===Yt.SE?t===Yt.SE||t===Yt.SW:t===e||t===e+1},Yt.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new ne("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Yt.NE:Yt.SE:e>=0?Yt.NW:Yt.SW}else if(arguments[0]instanceof D&&arguments[1]instanceof D){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new ne("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?Yt.NE:Yt.SE:i.y>=n.y?Yt.NW:Yt.SW}},Ru.NE.get=function(){return 0},Ru.NW.get=function(){return 1},Ru.SW.get=function(){return 2},Ru.SE.get=function(){return 3},Object.defineProperties(Yt,Ru);var ze=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2],s=null;this._edge=e,this.init(n,i),this._label=s}else if(arguments.length===4){var o=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this._edge=o,this.init(a,u),this._label=l}};ze.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:K.computeOrientation(t._p0,t._p1,this._p1)},ze.prototype.getDy=function(){return this._dy},ze.prototype.getCoordinate=function(){return this._p0},ze.prototype.setNode=function(t){this._node=t},ze.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),i=n.lastIndexOf("."),s=n.substring(i+1);t.print(" "+s+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},ze.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},ze.prototype.getDirectedCoordinate=function(){return this._p1},ze.prototype.getDx=function(){return this._dx},ze.prototype.getLabel=function(){return this._label},ze.prototype.getEdge=function(){return this._edge},ze.prototype.getQuadrant=function(){return this._quadrant},ze.prototype.getNode=function(){return this._node},ze.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf("."),i=e.substring(n+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},ze.prototype.computeLabel=function(t){},ze.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=Yt.quadrant(this._dx,this._dy),St.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},ze.prototype.interfaces_=function(){return[Gr]},ze.prototype.getClass=function(){return ze};var Fc=function(r){function t(){var e=arguments[0],n=arguments[1];if(r.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var i=e.getNumPoints()-1;this.init(e.getCoordinate(i),e.getCoordinate(i-1))}this.computeDirectedLabel()}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(n){return this._depth[n]},t.prototype.setVisited=function(n){this._isVisited=n},t.prototype.computeDirectedLabel=function(){this._label=new Ht(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(n,i){if(this._depth[n]!==-999&&this._depth[n]!==i)throw new Ni("assigned depths do not match",this.getCoordinate());this._depth[n]=i},t.prototype.isInteriorAreaEdge=function(){for(var n=this,i=!0,s=0;s<2;s++)n._label.isArea(s)&&n._label.getLocation(s,H.LEFT)===F.INTERIOR&&n._label.getLocation(s,H.RIGHT)===F.INTERIOR||(i=!1);return i},t.prototype.setNextMin=function(n){this._nextMin=n},t.prototype.print=function(n){r.prototype.print.call(this,n),n.print(" "+this._depth[H.LEFT]+"/"+this._depth[H.RIGHT]),n.print(" ("+this.getDepthDelta()+")"),this._isInResult&&n.print(" inResult")},t.prototype.setMinEdgeRing=function(n){this._minEdgeRing=n},t.prototype.isLineEdge=function(){var n=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,F.EXTERIOR),s=!this._label.isArea(1)||this._label.allPositionsEqual(1,F.EXTERIOR);return n&&i&&s},t.prototype.setEdgeRing=function(n){this._edgeRing=n},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n},t.prototype.setInResult=function(n){this._isInResult=n},t.prototype.getSym=function(){return this._sym},t.prototype.isForward=function(){return this._isForward},t.prototype.getEdge=function(){return this._edge},t.prototype.printEdge=function(n){this.print(n),n.print(" "),this._isForward?this._edge.print(n):this._edge.printReverse(n)},t.prototype.setSym=function(n){this._sym=n},t.prototype.setVisitedEdge=function(n){this.setVisited(n),this._sym.setVisited(n)},t.prototype.setEdgeDepths=function(n,i){var s=this.getEdge().getDepthDelta();this._isForward||(s=-s);var o=1;n===H.LEFT&&(o=-1);var a=H.opposite(n),u=s*o,l=i+u;this.setDepth(n,i),this.setDepth(a,l)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(n){this._next=n},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(n,i){return n===F.EXTERIOR&&i===F.INTERIOR?1:n===F.INTERIOR&&i===F.EXTERIOR?-1:0},t}(ze),ha=function(){};ha.prototype.createNode=function(t){return new rh(t,null)},ha.prototype.interfaces_=function(){return[]},ha.prototype.getClass=function(){return ha};var oe=function(){if(this._edges=new B,this._nodes=null,this._edgeEndList=new B,arguments.length===0)this._nodes=new Nn(new ha);else if(arguments.length===1){var t=arguments[0];this._nodes=new Nn(t)}};oe.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var n=0;n<this._edges.size();n++){t.println("edge "+n+":");var i=e._edges.get(n);i.print(t),i.eiList.print(t)}},oe.prototype.find=function(t){return this._nodes.find(t)},oe.prototype.addNode=function(){if(arguments[0]instanceof rh){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof D){var e=arguments[0];return this._nodes.addNode(e)}},oe.prototype.getNodeIterator=function(){return this._nodes.iterator()},oe.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},oe.prototype.debugPrintln=function(t){Oe.out.println(t)},oe.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(n===null)return!1;var i=n.getLabel();return i!==null&&i.getLocation(t)===F.BOUNDARY},oe.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},oe.prototype.matchInSameDirection=function(t,e,n,i){return t.equals(n)?K.computeOrientation(t,e,i)===K.COLLINEAR&&Yt.quadrant(t,e)===Yt.quadrant(n,i):!1},oe.prototype.getEdgeEnds=function(){return this._edgeEndList},oe.prototype.debugPrint=function(t){Oe.out.print(t)},oe.prototype.getEdgeIterator=function(){return this._edges.iterator()},oe.prototype.findEdgeInSameDirection=function(t,e){for(var n=this,i=0;i<this._edges.size();i++){var s=n._edges.get(i),o=s.getCoordinates();if(n.matchInSameDirection(t,e,o[0],o[1])||n.matchInSameDirection(t,e,o[o.length-1],o[o.length-2]))return s}return null},oe.prototype.insertEdge=function(t){this._edges.add(t)},oe.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},oe.prototype.addEdges=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next();e._edges.add(i);var s=new Fc(i,!0),o=new Fc(i,!1);s.setSym(o),o.setSym(s),e.add(s),e.add(o)}},oe.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},oe.prototype.getNodes=function(){return this._nodes.values()},oe.prototype.findEdge=function(t,e){for(var n=this,i=0;i<this._edges.size();i++){var s=n._edges.get(i),o=s.getCoordinates();if(t.equals(o[0])&&e.equals(o[1]))return s}return null},oe.prototype.interfaces_=function(){return[]},oe.prototype.getClass=function(){return oe},oe.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.getEdges().linkResultDirectedEdges()}};var gr=function(){this._geometryFactory=null,this._shellList=new B;var t=arguments[0];this._geometryFactory=t};gr.prototype.sortShellsAndHoles=function(t,e,n){for(var i=t.iterator();i.hasNext();){var s=i.next();s.isHole()?n.add(s):e.add(s)}},gr.prototype.computePolygons=function(t){for(var e=this,n=new B,i=t.iterator();i.hasNext();){var s=i.next(),o=s.toPolygon(e._geometryFactory);n.add(o)}return n},gr.prototype.placeFreeHoles=function(t,e){for(var n=this,i=e.iterator();i.hasNext();){var s=i.next();if(s.getShell()===null){var o=n.findEdgeRingContaining(s,t);if(o===null)throw new Ni("unable to assign hole to a shell",s.getCoordinate(0));s.setShell(o)}}},gr.prototype.buildMinimalEdgeRings=function(t,e,n){for(var i=this,s=new B,o=t.iterator();o.hasNext();){var a=o.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var u=a.buildMinimalRings(),l=i.findShell(u);l!==null?(i.placePolygonHoles(l,u),e.add(l)):n.addAll(u)}else s.add(a)}return s},gr.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var n=e.next();if(n.containsPoint(t))return!0}return!1},gr.prototype.buildMaximalEdgeRings=function(t){for(var e=this,n=new B,i=t.iterator();i.hasNext();){var s=i.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var o=new A_(s,e._geometryFactory);n.add(o),o.setInResult()}}return n},gr.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}},gr.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},gr.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),s=n.getCoordinateN(0),o=null,a=null,u=e.iterator();u.hasNext();){var l=u.next(),h=l.getLinearRing(),c=h.getEnvelopeInternal();o!==null&&(a=o.getLinearRing().getEnvelopeInternal());var f=!1;c.contains(i)&&K.isPointInRing(s,h.getCoordinates())&&(f=!0),f&&(o===null||a.contains(c))&&(o=l)}return o},gr.prototype.findShell=function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var s=i.next();s.isHole()||(n=s,e++)}return St.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},gr.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],n=arguments[1];oe.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),s=new B,o=this.buildMinimalEdgeRings(i,this._shellList,s);this.sortShellsAndHoles(o,this._shellList,s),this.placeFreeHoles(this._shellList,s)}},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr};var ca=function(){};ca.prototype.getBounds=function(){},ca.prototype.interfaces_=function(){return[]},ca.prototype.getClass=function(){return ca};var an=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};an.prototype.getItem=function(){return this._item},an.prototype.getBounds=function(){return this._bounds},an.prototype.interfaces_=function(){return[ca,kr]},an.prototype.getClass=function(){return an};var bi=function(){this._size=null,this._items=null,this._size=0,this._items=new B,this._items.add(null)};bi.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},bi.prototype.size=function(){return this._size},bi.prototype.reorder=function(t){for(var e=this,n=null,i=this._items.get(t);t*2<=this._size&&(n=t*2,n!==e._size&&e._items.get(n+1).compareTo(e._items.get(n))<0&&n++,e._items.get(n).compareTo(i)<0);t=n)e._items.set(t,e._items.get(n));this._items.set(t,i)},bi.prototype.clear=function(){this._size=0,this._items.clear()},bi.prototype.isEmpty=function(){return this._size===0},bi.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)e._items.set(n,e._items.get(Math.trunc(n/2)));this._items.set(n,t)},bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi};var ji=function(){};ji.prototype.visitItem=function(t){},ji.prototype.interfaces_=function(){return[]},ji.prototype.getClass=function(){return ji};var co=function(){};co.prototype.insert=function(t,e){},co.prototype.remove=function(t,e){},co.prototype.query=function(){},co.prototype.interfaces_=function(){return[]},co.prototype.getClass=function(){return co};var Se=function(){if(this._childBoundables=new B,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},Pp={serialVersionUID:{configurable:!0}};Se.prototype.getLevel=function(){return this._level},Se.prototype.size=function(){return this._childBoundables.size()},Se.prototype.getChildBoundables=function(){return this._childBoundables},Se.prototype.addChildBoundable=function(t){St.isTrue(this._bounds===null),this._childBoundables.add(t)},Se.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Se.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Se.prototype.interfaces_=function(){return[ca,kr]},Se.prototype.getClass=function(){return Se},Pp.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Se,Pp);var un=function(){};un.reverseOrder=function(){return{compare:function(e,n){return n.compareTo(e)}}},un.min=function(t){return un.sort(t),t.get(0)},un.sort=function(t,e){var n=t.toArray();e?Ms.sort(n,e):Ms.sort(n);for(var i=t.iterator(),s=0,o=n.length;s<o;s++)i.next(),i.set(n[s])},un.singletonList=function(t){var e=new B;return e.add(t),e};var me=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};me.prototype.expandToQueue=function(t,e){var n=me.isComposite(this._boundable1),i=me.isComposite(this._boundable2);if(n&&i)return me.area(this._boundable1)>me.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new ne("neither boundable is composite")},me.prototype.isLeaves=function(){return!(me.isComposite(this._boundable1)||me.isComposite(this._boundable2))},me.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},me.prototype.expand=function(t,e,n,i){for(var s=this,o=t.getChildBoundables(),a=o.iterator();a.hasNext();){var u=a.next(),l=new me(u,e,s._itemDistance);l.getDistance()<i&&n.add(l)}},me.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},me.prototype.getDistance=function(){return this._distance},me.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},me.prototype.interfaces_=function(){return[Gr]},me.prototype.getClass=function(){return me},me.area=function(t){return t.getBounds().getArea()},me.isComposite=function(t){return t instanceof Se};var Me=function r(){if(this._root=null,this._built=!1,this._itemBoundables=new B,this._nodeCapacity=null,arguments.length===0){var t=r.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];St.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},nh={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Me.prototype.getNodeCapacity=function(){return this._nodeCapacity},Me.prototype.lastNode=function(t){return t.get(t.size()-1)},Me.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,i=e.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof Se?n+=t.size(s):s instanceof an&&(n+=1)}return n}},Me.prototype.removeItem=function(t,e){for(var n=null,i=t.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof an&&s.getItem()===e&&(n=s)}return n!==null?(t.getChildBoundables().remove(n),!0):!1},Me.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new B:e}else if(arguments.length===1){for(var n=arguments[0],i=new B,s=n.getChildBoundables().iterator();s.hasNext();){var o=s.next();if(o instanceof Se){var a=t.itemsTree(o);a!==null&&i.add(a)}else o instanceof an?i.add(o.getItem()):St.shouldNeverReachHere()}return i.size()<=0?null:i}},Me.prototype.insert=function(t,e){St.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new an(t,e))},Me.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],n=new B;return this.boundablesAtLevel(e,this._root,n),n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];if(St.isTrue(i>-2),s.getLevel()===i)return o.add(s),null;for(var a=s.getChildBoundables().iterator();a.hasNext();){var u=a.next();u instanceof Se?t.boundablesAtLevel(i,u,o):(St.isTrue(u instanceof an),i===-1&&o.add(u))}return null}},Me.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var n=new B;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,n),n}else if(arguments.length===2){var i=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,s)}else if(arguments.length===3){if(dt(arguments[2],ji)&&arguments[0]instanceof Object&&arguments[1]instanceof Se)for(var o=arguments[0],a=arguments[1],u=arguments[2],l=a.getChildBoundables(),h=0;h<l.size();h++){var c=l.get(h);t.getIntersectsOp().intersects(c.getBounds(),o)&&(c instanceof Se?t.query(o,c,u):c instanceof an?u.visitItem(c.getItem()):St.shouldNeverReachHere())}else if(dt(arguments[2],nn)&&arguments[0]instanceof Object&&arguments[1]instanceof Se)for(var f=arguments[0],p=arguments[1],v=arguments[2],_=p.getChildBoundables(),w=0;w<_.size();w++){var I=_.get(w);t.getIntersectsOp().intersects(I.getBounds(),f)&&(I instanceof Se?t.query(f,I,v):I instanceof an?v.add(I.getItem()):St.shouldNeverReachHere())}}},Me.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},Me.prototype.getRoot=function(){return this.build(),this._root},Me.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,n):!1}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=this.removeItem(s,o);if(a)return!0;for(var u=null,l=s.getChildBoundables().iterator();l.hasNext();){var h=l.next();if(t.getIntersectsOp().intersects(h.getBounds(),i)&&h instanceof Se&&(a=t.remove(i,h,o),a)){u=h;break}}return u!==null&&u.getChildBoundables().isEmpty()&&s.getChildBoundables().remove(u),a}},Me.prototype.createHigherLevels=function(t,e){St.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return n.size()===1?n.get(0):this.createHigherLevels(n,e+1)},Me.prototype.depth=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,i=e.getChildBoundables().iterator();i.hasNext();){var s=i.next();if(s instanceof Se){var o=t.depth(s);o>n&&(n=o)}}return n+1}},Me.prototype.createParentBoundables=function(t,e){var n=this;St.isTrue(!t.isEmpty());var i=new B;i.add(this.createNode(e));var s=new B(t);un.sort(s,this.getComparator());for(var o=s.iterator();o.hasNext();){var a=o.next();n.lastNode(i).getChildBoundables().size()===n.getNodeCapacity()&&i.add(n.createNode(e)),n.lastNode(i).addChildBoundable(a)}return i},Me.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Me.prototype.interfaces_=function(){return[kr]},Me.prototype.getClass=function(){return Me},Me.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},nh.IntersectsOp.get=function(){return D_},nh.serialVersionUID.get=function(){return-3886435814360241e3},nh.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Me,nh);var D_=function(){},fa=function(){};fa.prototype.distance=function(t,e){},fa.prototype.interfaces_=function(){return[]},fa.prototype.getClass=function(){return fa};var Ip=function(r){function t(n){n=n||t.DEFAULT_NODE_CAPACITY,r.call(this,n)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return t.prototype.createParentBoundablesFromVerticalSlices=function(i,s){var o=this;St.isTrue(i.length>0);for(var a=new B,u=0;u<i.length;u++)a.addAll(o.createParentBoundablesFromVerticalSlice(i[u],s));return a},t.prototype.createNode=function(i){return new Mp(i)},t.prototype.size=function(){return arguments.length===0?r.prototype.size.call(this):r.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];if(i.isNull())return null;r.prototype.insert.call(this,i,s)}else return r.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(i,s){for(var o=Math.trunc(Math.ceil(i.size()/s)),a=new Array(s).fill(null),u=i.iterator(),l=0;l<s;l++){a[l]=new B;for(var h=0;u.hasNext()&&h<o;){var c=u.next();a[l].add(c),h++}}return a},t.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return r.prototype.query.call(this,i)}else if(arguments.length===2){var s=arguments[0],o=arguments[1];r.prototype.query.call(this,s,o)}else if(arguments.length===3){if(dt(arguments[2],ji)&&arguments[0]instanceof Object&&arguments[1]instanceof Se){var a=arguments[0],u=arguments[1],l=arguments[2];r.prototype.query.call(this,a,u,l)}else if(dt(arguments[2],nn)&&arguments[0]instanceof Object&&arguments[1]instanceof Se){var h=arguments[0],c=arguments[1],f=arguments[2];r.prototype.query.call(this,h,c,f)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(i,s){return r.prototype.createParentBoundables.call(this,i,s)},t.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return r.prototype.remove.call(this,i,s)}else return r.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return arguments.length===0?r.prototype.depth.call(this):r.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(i,s){St.isTrue(!i.isEmpty());var o=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),a=new B(i);un.sort(a,t.xComparator);var u=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(o))));return this.createParentBoundablesFromVerticalSlices(u,s)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(dt(arguments[0],fa)){var i=arguments[0],s=new me(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(s)}else if(arguments[0]instanceof me){var o=arguments[0];return this.nearestNeighbour(o,vt.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&dt(arguments[1],fa)){var a=arguments[0],u=arguments[1],l=new me(this.getRoot(),a.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof me&&typeof arguments[1]=="number"){var h=arguments[0],c=arguments[1],f=c,p=null,v=new bi;for(v.add(h);!v.isEmpty()&&f>0;){var _=v.poll(),w=_.getDistance();if(w>=f)break;_.isLeaves()?(f=w,p=_):_.expandToQueue(v,f)}return[p.getBoundable(0).getItem(),p.getBoundable(1).getItem()]}}else if(arguments.length===3){var I=arguments[0],y=arguments[1],E=arguments[2],m=new an(I,y),S=new me(this.getRoot(),m,E);return this.nearestNeighbour(S)[0]}},t.prototype.interfaces_=function(){return[co,kr]},t.prototype.getClass=function(){return t},t.centreX=function(i){return t.avg(i.getMinX(),i.getMaxX())},t.avg=function(i,s){return(i+s)/2},t.centreY=function(i){return t.avg(i.getMinY(),i.getMaxY())},e.STRtreeNode.get=function(){return Mp},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[$o]},compare:function(n,i){return r.compareDoubles(t.centreX(n.getBounds()),t.centreX(i.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[$o]},compare:function(n,i){return r.compareDoubles(t.centreY(n.getBounds()),t.centreY(i.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[r.IntersectsOp]},intersects:function(n,i){return n.intersects(i)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t}(Me),Mp=function(r){function t(){var e=arguments[0];r.call(this,e)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var n=null,i=this.getChildBoundables().iterator();i.hasNext();){var s=i.next();n===null?n=new st(s.getBounds()):n.expandToInclude(s.getBounds())}return n},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Se),rr=function(){};rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.relativeSign=function(t,e){return t<e?-1:t>e?1:0},rr.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=rr.relativeSign(e.x,n.x),s=rr.relativeSign(e.y,n.y);switch(t){case 0:return rr.compareValue(i,s);case 1:return rr.compareValue(s,i);case 2:return rr.compareValue(s,-i);case 3:return rr.compareValue(-i,s);case 4:return rr.compareValue(-i,-s);case 5:return rr.compareValue(-s,-i);case 6:return rr.compareValue(-s,i);case 7:return rr.compareValue(i,-s)}return St.shouldNeverReachHere("invalid octant value"),0},rr.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var ts=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._segString=t,this.coord=new D(e),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))};ts.prototype.getCoordinate=function(){return this.coord},ts.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ts.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:rr.compare(this._segmentOctant,this.coord,e.coord)},ts.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},ts.prototype.isInterior=function(){return this._isInterior},ts.prototype.interfaces_=function(){return[Gr]},ts.prototype.getClass=function(){return ts};var Je=function(){this._nodeMap=new Ue,this._edge=null;var t=arguments[0];this._edge=t};Je.prototype.getSplitCoordinates=function(){var t=this,e=new Nu;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next();t.addEdgeCoordinates(i,s,e),i=s}return e.toCoordinateArray()},Je.prototype.addCollapsedNodes=function(){var t=this,e=new B;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var n=e.iterator();n.hasNext();){var i=n.next().intValue();t.add(t._edge.getCoordinate(i),i)}},Je.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Je.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,n=0;n<this._edge.size()-2;n++){var i=e._edge.getCoordinate(n),s=e._edge.getCoordinate(n+2);i.equals2D(s)&&t.add(new yn(n+1))}},Je.prototype.addEdgeCoordinates=function(t,e,n){var i=this,s=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(s);n.add(new D(t.coord),!1);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)n.add(i._edge.getCoordinate(a));o&&n.add(new D(e.coord))},Je.prototype.iterator=function(){return this._nodeMap.values().iterator()},Je.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next(),o=e.createSplitEdge(i,s);t.add(o),i=s}},Je.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,i===1?(n[0]=t.segmentIndex+1,!0):!1},Je.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,n=new Array(1).fill(null),i=this.iterator(),s=i.next();i.hasNext();){var o=i.next(),a=e.findCollapseIndex(s,o,n);a&&t.add(new yn(n[0])),s=o}},Je.prototype.getEdge=function(){return this._edge},Je.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},Je.prototype.createSplitEdge=function(t,e){var n=this,i=e.segmentIndex-t.segmentIndex+2,s=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(s);o||i--;var a=new Array(i).fill(null),u=0;a[u++]=new D(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=n._edge.getCoordinate(l);return o&&(a[u]=new D(e.coord)),new de(a,this._edge.getData())},Je.prototype.add=function(t,e){var n=new ts(this._edge,t,e,this._edge.getSegmentOctant(e)),i=this._nodeMap.get(n);return i!==null?(St.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(n,n),n)},Je.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0),i=n.getCoordinate(0);if(!i.equals2D(e[0]))throw new wi("bad split edge start point at "+i);var s=t.get(t.size()-1),o=s.getCoordinates(),a=o[o.length-1];if(!a.equals2D(e[e.length-1]))throw new wi("bad split edge end point at "+a)},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je};var fo=function(){};fo.prototype.interfaces_=function(){return[]},fo.prototype.getClass=function(){return fo},fo.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new ne("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),i=Math.abs(e);return t>=0?e>=0?n>=i?0:1:n>=i?7:6:e>=0?n>=i?3:2:n>=i?4:5}else if(arguments[0]instanceof D&&arguments[1]instanceof D){var s=arguments[0],o=arguments[1],a=o.x-s.x,u=o.y-s.y;if(a===0&&u===0)throw new ne("Cannot compute the octant for two identical points "+s);return fo.octant(a,u)}};var ei=function(){};ei.prototype.getCoordinates=function(){},ei.prototype.size=function(){},ei.prototype.getCoordinate=function(t){},ei.prototype.isClosed=function(){},ei.prototype.setData=function(t){},ei.prototype.getData=function(){},ei.prototype.interfaces_=function(){return[]},ei.prototype.getClass=function(){return ei};var Fu=function(){};Fu.prototype.addIntersection=function(t,e){},Fu.prototype.interfaces_=function(){return[ei]},Fu.prototype.getClass=function(){return Fu};var de=function(){this._nodeList=new Je(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};de.prototype.getCoordinates=function(){return this._pts},de.prototype.size=function(){return this._pts.length},de.prototype.getCoordinate=function(t){return this._pts[t]},de.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},de.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},de.prototype.setData=function(t){this._data=t},de.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:fo.octant(t,e)},de.prototype.getData=function(){return this._data},de.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[3],o=new D(n.getIntersection(s));this.addIntersection(o,i)}},de.prototype.toString=function(){return rn.toLineString(new fe(this._pts))},de.prototype.getNodeList=function(){return this._nodeList},de.prototype.addIntersectionNode=function(t,e){var n=e,i=n+1;if(i<this._pts.length){var s=this._pts[i];t.equals2D(s)&&(n=i)}var o=this._nodeList.add(t,n);return o},de.prototype.addIntersections=function(t,e,n){for(var i=this,s=0;s<t.getIntersectionNum();s++)i.addIntersection(t,e,n,s)},de.prototype.interfaces_=function(){return[Fu]},de.prototype.getClass=function(){return de},de.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new B;return de.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var n=arguments[0],i=arguments[1],s=n.iterator();s.hasNext();){var o=s.next();o.getNodeList().addSplitEdges(i)}};var ot=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new D,this.p1=new D;else if(arguments.length===1){var t=arguments[0];this.p0=new D(t.p0),this.p1=new D(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],n=arguments[1],i=arguments[2],s=arguments[3];this.p0=new D(e,n),this.p1=new D(i,s)}},Np={serialVersionUID:{configurable:!0}};ot.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},ot.prototype.orientationIndex=function(){if(arguments[0]instanceof ot){var t=arguments[0],e=K.orientationIndex(this.p0,this.p1,t.p0),n=K.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}else if(arguments[0]instanceof D){var i=arguments[0];return K.orientationIndex(this.p0,this.p1,i)}},ot.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},ot.prototype.isVertical=function(){return this.p0.x===this.p1.x},ot.prototype.equals=function(t){if(!(t instanceof ot))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},ot.prototype.intersection=function(t){var e=new Ps;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},ot.prototype.project=function(){if(arguments[0]instanceof D){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new D(t);var e=this.projectionFactor(t),n=new D;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof ot){var i=arguments[0],s=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(s>=1&&o>=1||s<=0&&o<=0)return null;var a=this.project(i.p0);s<0&&(a=this.p0),s>1&&(a=this.p1);var u=this.project(i.p1);return o<0&&(u=this.p0),o>1&&(u=this.p1),new ot(a,u)}},ot.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},ot.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},ot.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},ot.prototype.distancePerpendicular=function(t){return K.distancePointLinePerpendicular(t,this.p0,this.p1)},ot.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},ot.prototype.midPoint=function(){return ot.midPoint(this.p0,this.p1)},ot.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=e*e+n*n;if(i<=0)return vt.NaN;var s=((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/i;return s},ot.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var n=new Array(2).fill(null),i=vt.MAX_VALUE,s=null,o=this.closestPoint(t.p0);i=o.distance(t.p0),n[0]=o,n[1]=t.p0;var a=this.closestPoint(t.p1);s=a.distance(t.p1),s<i&&(i=s,n[0]=a,n[1]=t.p1);var u=t.closestPoint(this.p0);s=u.distance(this.p0),s<i&&(i=s,n[0]=this.p0,n[1]=u);var l=t.closestPoint(this.p1);return s=l.distance(this.p1),s<i&&(i=s,n[0]=this.p1,n[1]=l),n},ot.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var n=this.p0.distance(t),i=this.p1.distance(t);return n<i?this.p0:this.p1},ot.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},ot.prototype.getLength=function(){return this.p0.distance(this.p1)},ot.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return n!==0?n:this.p1.compareTo(e.p1)},ot.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},ot.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},ot.prototype.lineIntersection=function(t){try{var e=en.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(n){if(!(n instanceof ta))throw n}finally{}return null},ot.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},ot.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),s=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,a=Math.sqrt(s*s+o*o),u=0,l=0;if(e!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");u=e*s/a,l=e*o/a}var h=n-l,c=i+u,f=new D(h,c);return f},ot.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},ot.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||vt.isNaN(e))&&(e=1),e},ot.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},ot.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},ot.prototype.distance=function(){if(arguments[0]instanceof ot){var t=arguments[0];return K.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof D){var e=arguments[0];return K.distancePointLine(e,this.p0,this.p1)}},ot.prototype.pointAlong=function(t){var e=new D;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},ot.prototype.hashCode=function(){var t=vt.doubleToLongBits(this.p0.x);t^=vt.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),n=vt.doubleToLongBits(this.p1.x);n^=vt.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(n)^Math.trunc(n>>32);return e^i},ot.prototype.interfaces_=function(){return[Gr,kr]},ot.prototype.getClass=function(){return ot},ot.midPoint=function(t,e){return new D((t.x+e.x)/2,(t.y+e.y)/2)},Np.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(ot,Np);var Gu=function(){this.tempEnv1=new st,this.tempEnv2=new st,this._overlapSeg1=new ot,this._overlapSeg2=new ot};Gu.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},Gu.prototype.interfaces_=function(){return[]},Gu.prototype.getClass=function(){return Gu};var pr=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=i};pr.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},pr.prototype.computeSelect=function(t,e,n,i){var s=this._pts[e],o=this._pts[n];if(i.tempEnv1.init(s,o),n-e===1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var a=Math.trunc((e+n)/2);e<a&&this.computeSelect(t,e,a,i),a<n&&this.computeSelect(t,a,n,i)},pr.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),n=0,i=this._start;i<=this._end;i++)e[n++]=t._pts[i];return e},pr.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},pr.prototype.setId=function(t){this._id=t},pr.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},pr.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new st(t,e)}return this._env},pr.prototype.getEndIndex=function(){return this._end},pr.prototype.getStartIndex=function(){return this._start},pr.prototype.getContext=function(){return this._context},pr.prototype.getId=function(){return this._id},pr.prototype.computeOverlapsInternal=function(t,e,n,i,s,o){var a=this._pts[t],u=this._pts[e],l=n._pts[i],h=n._pts[s];if(e-t===1&&s-i===1)return o.overlap(this,t,n,i),null;if(o.tempEnv1.init(a,u),o.tempEnv2.init(l,h),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),f=Math.trunc((i+s)/2);t<c&&(i<f&&this.computeOverlapsInternal(t,c,n,i,f,o),f<s&&this.computeOverlapsInternal(t,c,n,f,s,o)),c<e&&(i<f&&this.computeOverlapsInternal(c,e,n,i,f,o),f<s&&this.computeOverlapsInternal(c,e,n,f,s,o))},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr};var bn=function(){};bn.prototype.interfaces_=function(){return[]},bn.prototype.getClass=function(){return bn},bn.getChainStartIndices=function(t){var e=0,n=new B;n.add(new yn(e));do{var i=bn.findChainEnd(t,e);n.add(new yn(i)),e=i}while(e<t.length-1);var s=bn.toIntArray(n);return s},bn.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var i=Yt.quadrant(t[n],t[n+1]),s=e+1;s<t.length;){if(!t[s-1].equals2D(t[s])){var o=Yt.quadrant(t[s-1],t[s]);if(o!==i)break}s++}return s-1},bn.getChains=function(){if(arguments.length===1){var t=arguments[0];return bn.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],n=arguments[1],i=new B,s=bn.getChainStartIndices(e),o=0;o<s.length-1;o++){var a=new pr(e,s[o],s[o+1],n);i.add(a)}return i}},bn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var bs=function(){};bs.prototype.computeNodes=function(t){},bs.prototype.getNodedSubstrings=function(){},bs.prototype.interfaces_=function(){return[]},bs.prototype.getClass=function(){return bs};var ku=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};ku.prototype.setSegmentIntersector=function(t){this._segInt=t},ku.prototype.interfaces_=function(){return[bs]},ku.prototype.getClass=function(){return ku};var Gc=function(r){function t(n){n?r.call(this,n):r.call(this),this._monoChains=new B,this._index=new Ip,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return de.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(i){for(var s=this,o=bn.getChains(i.getCoordinates(),i),a=o.iterator();a.hasNext();){var u=a.next();u.setId(s._idCounter++),s._index.insert(u.getEnvelope(),u),s._monoChains.add(u)}},t.prototype.computeNodes=function(i){var s=this;this._nodedSegStrings=i;for(var o=i.iterator();o.hasNext();)s.add(o.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var i=this,s=new bp(this._segInt),o=this._monoChains.iterator();o.hasNext();)for(var a=o.next(),u=i._index.query(a.getEnvelope()),l=u.iterator();l.hasNext();){var h=l.next();if(h.getId()>a.getId()&&(a.computeOverlaps(h,s),i._nOverlaps++),i._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return bp},Object.defineProperties(t,e),t}(ku),bp=function(r){function t(){r.call(this),this._si=null;var e=arguments[0];this._si=e}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3],a=n.getContext(),u=s.getContext();this._si.processIntersections(a,i,u,o)}else return r.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Gu),Vt=function r(){if(this._quadrantSegments=r.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=r.CAP_ROUND,this._joinStyle=r.JOIN_ROUND,this._mitreLimit=r.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=r.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(n)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(s),this.setJoinStyle(o),this.setMitreLimit(a)}}},Ti={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Vt.prototype.getEndCapStyle=function(){return this._endCapStyle},Vt.prototype.isSingleSided=function(){return this._isSingleSided},Vt.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=Vt.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Vt.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Vt.JOIN_ROUND&&(this._quadrantSegments=Vt.DEFAULT_QUADRANT_SEGMENTS)},Vt.prototype.getJoinStyle=function(){return this._joinStyle},Vt.prototype.setJoinStyle=function(t){this._joinStyle=t},Vt.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Vt.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Vt.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Vt.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Vt.prototype.getMitreLimit=function(){return this._mitreLimit},Vt.prototype.setMitreLimit=function(t){this._mitreLimit=t},Vt.prototype.setSingleSided=function(t){this._isSingleSided=t},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Vt.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Ti.CAP_ROUND.get=function(){return 1},Ti.CAP_FLAT.get=function(){return 2},Ti.CAP_SQUARE.get=function(){return 3},Ti.JOIN_ROUND.get=function(){return 1},Ti.JOIN_MITRE.get=function(){return 2},Ti.JOIN_BEVEL.get=function(){return 3},Ti.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Ti.DEFAULT_MITRE_LIMIT.get=function(){return 5},Ti.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Vt,Ti);var le=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=K.COUNTERCLOCKWISE,this._inputLine=t||null},Vu={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};le.prototype.isDeletable=function(t,e,n,i){var s=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[n];return!this.isConcave(s,o,a)||!this.isShallow(s,o,a,i)?!1:this.isShallowSampled(s,o,t,n,i)},le.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,n=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(n),s=!1;i<this._inputLine.length;){var o=!1;t.isDeletable(e,n,i,t._distanceTol)&&(t._isDeleted[n]=le.DELETE,o=!0,s=!0),o?e=i:e=n,n=t.findNextNonDeletedIndex(e),i=t.findNextNonDeletedIndex(n)}return s},le.prototype.isShallowConcavity=function(t,e,n,i){var s=K.computeOrientation(t,e,n),o=s===this._angleOrientation;if(!o)return!1;var a=K.distancePointLine(e,t,n);return a<i},le.prototype.isShallowSampled=function(t,e,n,i,s){var o=this,a=Math.trunc((i-n)/le.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var u=n;u<i;u+=a)if(!o.isShallow(t,e,o._inputLine[u],s))return!1;return!0},le.prototype.isConcave=function(t,e,n){var i=K.computeOrientation(t,e,n),s=i===this._angleOrientation;return s},le.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=K.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var n=!1;do n=e.deleteShallowConcavities();while(n);return this.collapseLine()},le.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===le.DELETE;)e++;return e},le.prototype.isShallow=function(t,e,n,i){var s=K.distancePointLine(e,t,n);return s<i},le.prototype.collapseLine=function(){for(var t=this,e=new Nu,n=0;n<this._inputLine.length;n++)t._isDeleted[n]!==le.DELETE&&e.add(t._inputLine[n]);return e.toCoordinateArray()},le.prototype.interfaces_=function(){return[]},le.prototype.getClass=function(){return le},le.simplify=function(t,e){var n=new le(t);return n.simplify(e)},Vu.INIT.get=function(){return 0},Vu.DELETE.get=function(){return 1},Vu.KEEP.get=function(){return 1},Vu.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(le,Vu);var Tr=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new B},Tp={COORDINATE_ARRAY_TYPE:{configurable:!0}};Tr.prototype.getCoordinates=function(){var t=this._ptList.toArray(Tr.COORDINATE_ARRAY_TYPE);return t},Tr.prototype.setPrecisionModel=function(t){this._precisionModel=t},Tr.prototype.addPt=function(t){var e=new D(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Tr.prototype.revere=function(){},Tr.prototype.addPts=function(t,e){var n=this;if(e)for(var i=0;i<t.length;i++)n.addPt(t[i]);else for(var s=t.length-1;s>=0;s--)n.addPt(t[s])},Tr.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),n=t.distance(e);return n<this._minimimVertexDistance},Tr.prototype.toString=function(){var t=new Nt,e=t.createLineString(this.getCoordinates());return e.toString()},Tr.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new D(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Tr.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tp.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Tr,Tp);var Tt=function(){},go={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Tt.prototype.interfaces_=function(){return[]},Tt.prototype.getClass=function(){return Tt},Tt.toDegrees=function(t){return t*180/Math.PI},Tt.normalize=function(t){for(;t>Math.PI;)t-=Tt.PI_TIMES_2;for(;t<=-Math.PI;)t+=Tt.PI_TIMES_2;return t},Tt.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=n.x-e.x,s=n.y-e.y;return Math.atan2(s,i)}},Tt.isAcute=function(t,e,n){var i=t.x-e.x,s=t.y-e.y,o=n.x-e.x,a=n.y-e.y,u=i*o+s*a;return u>0},Tt.isObtuse=function(t,e,n){var i=t.x-e.x,s=t.y-e.y,o=n.x-e.x,a=n.y-e.y,u=i*o+s*a;return u<0},Tt.interiorAngle=function(t,e,n){var i=Tt.angle(e,t),s=Tt.angle(e,n);return Math.abs(s-i)},Tt.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Tt.PI_TIMES_2;t>=Tt.PI_TIMES_2&&(t=0)}else{for(;t>=Tt.PI_TIMES_2;)t-=Tt.PI_TIMES_2;t<0&&(t=0)}return t},Tt.angleBetween=function(t,e,n){var i=Tt.angle(e,t),s=Tt.angle(e,n);return Tt.diff(i,s)},Tt.diff=function(t,e){var n=null;return t<e?n=e-t:n=t-e,n>Math.PI&&(n=2*Math.PI-n),n},Tt.toRadians=function(t){return t*Math.PI/180},Tt.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Tt.COUNTERCLOCKWISE:n<0?Tt.CLOCKWISE:Tt.NONE},Tt.angleBetweenOriented=function(t,e,n){var i=Tt.angle(e,t),s=Tt.angle(e,n),o=s-i;return o<=-Math.PI?o+Tt.PI_TIMES_2:o>Math.PI?o-Tt.PI_TIMES_2:o},go.PI_TIMES_2.get=function(){return 2*Math.PI},go.PI_OVER_2.get=function(){return Math.PI/2},go.PI_OVER_4.get=function(){return Math.PI/4},go.COUNTERCLOCKWISE.get=function(){return K.COUNTERCLOCKWISE},go.CLOCKWISE.get=function(){return K.CLOCKWISE},go.NONE.get=function(){return K.COLLINEAR},Object.defineProperties(Tt,go);var te=function r(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new ot,this._seg1=new ot,this._offset0=new ot,this._offset1=new ot,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new Ps,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===Vt.JOIN_ROUND&&(this._closingSegLengthFactor=r.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},Uu={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};te.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=K.computeOrientation(this._s0,this._s1,this._s2),i=n===K.CLOCKWISE&&this._side===H.LEFT||n===K.COUNTERCLOCKWISE&&this._side===H.RIGHT;n===0?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},te.prototype.addLineEndCap=function(t,e){var n=new ot(t,e),i=new ot;this.computeOffsetSegment(n,H.LEFT,this._distance,i);var s=new ot;this.computeOffsetSegment(n,H.RIGHT,this._distance,s);var o=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case Vt.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,u+Math.PI/2,u-Math.PI/2,K.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case Vt.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(s.p1);break;case Vt.CAP_SQUARE:var l=new D;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var h=new D(i.p1.x+l.x,i.p1.y+l.y),c=new D(s.p1.x+l.x,s.p1.y+l.y);this._segList.addPt(h),this._segList.addPt(c);break}},te.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},te.prototype.addMitreJoin=function(t,e,n,i){var s=!0,o=null;try{o=en.intersection(e.p0,e.p1,n.p0,n.p1);var a=i<=0?1:o.distance(t)/Math.abs(i);a>this._bufParams.getMitreLimit()&&(s=!1)}catch(u){if(u instanceof ta)o=new D(0,0),s=!1;else throw u}finally{}s?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,i,this._bufParams.getMitreLimit())},te.prototype.addFilletCorner=function(t,e,n,i,s){var o=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,o),l=n.x-t.x,h=n.y-t.y,c=Math.atan2(h,l);i===K.CLOCKWISE?u<=c&&(u+=2*Math.PI):u>=c&&(u-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,u,c,i,s),this._segList.addPt(n)},te.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*te.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Vt.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Vt.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},te.prototype.createSquare=function(t){this._segList.addPt(new D(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new D(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new D(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new D(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},te.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},te.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},te.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},te.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},te.prototype.addLimitedMitreJoin=function(t,e,n,i){var s=this._seg0.p1,o=Tt.angle(s,this._seg0.p0),a=Tt.angleBetweenOriented(this._seg0.p0,s,this._seg1.p1),u=a/2,l=Tt.normalize(o+u),h=Tt.normalize(l+Math.PI),c=i*n,f=c*Math.abs(Math.sin(u)),p=n-f,v=s.x+c*Math.cos(h),_=s.y+c*Math.sin(h),w=new D(v,_),I=new ot(s,w),y=I.pointAlongOffset(1,p),E=I.pointAlongOffset(1,-p);this._side===H.LEFT?(this._segList.addPt(y),this._segList.addPt(E)):(this._segList.addPt(E),this._segList.addPt(y))},te.prototype.computeOffsetSegment=function(t,e,n,i){var s=e===H.LEFT?1:-1,o=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,u=Math.sqrt(o*o+a*a),l=s*n*o/u,h=s*n*a/u;i.p0.x=t.p0.x-h,i.p0.y=t.p0.y+l,i.p1.x=t.p1.x-h,i.p1.y=t.p1.y+l},te.prototype.addFilletArc=function(t,e,n,i,s){var o=this,a=i===K.CLOCKWISE?-1:1,u=Math.abs(e-n),l=Math.trunc(u/this._filletAngleQuantum+.5);if(l<1)return null;for(var h=0,c=u/l,f=h,p=new D;f<u;){var v=e+a*f;p.x=t.x+s*Math.cos(v),p.y=t.y+s*Math.sin(v),o._segList.addPt(p),f+=c}},te.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*te.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new D((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var i=new D((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},te.prototype.createCircle=function(t){var e=new D(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},te.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},te.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Tr,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*te.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},te.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===Vt.JOIN_BEVEL||this._bufParams.getJoinStyle()===Vt.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,K.CLOCKWISE,this._distance))},te.prototype.closeRing=function(){this._segList.closeRing()},te.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},te.prototype.interfaces_=function(){return[]},te.prototype.getClass=function(){return te},Uu.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Uu.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Uu.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Uu.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(te,Uu);var nr=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};nr.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var n=e<0,i=Math.abs(e),s=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],s):this.computeOffsetCurve(t,n,s);var o=s.getCoordinates();return n&&Mt.reverse(o),o},nr.prototype.computeSingleSidedBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var s=le.simplify(t,-i),o=s.length-1;n.initSideSegments(s[o],s[o-1],H.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(s[a],!0)}else{n.addSegments(t,!1);var u=le.simplify(t,i),l=u.length-1;n.initSideSegments(u[0],u[1],H.LEFT),n.addFirstSegment();for(var h=2;h<=l;h++)n.addNextSegment(u[h],!0)}n.addLastSegment(),n.closeRing()},nr.prototype.computeRingBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);e===H.RIGHT&&(i=-i);var s=le.simplify(t,i),o=s.length-1;n.initSideSegments(s[o-1],s[0],e);for(var a=1;a<=o;a++){var u=a!==1;n.addNextSegment(s[a],u)}n.closeRing()},nr.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),i=le.simplify(t,n),s=i.length-1;e.initSideSegments(i[0],i[1],H.LEFT);for(var o=2;o<=s;o++)e.addNextSegment(i[o],!0);e.addLastSegment(),e.addLineEndCap(i[s-1],i[s]);var a=le.simplify(t,-n),u=a.length-1;e.initSideSegments(a[u],a[u-1],H.LEFT);for(var l=u-2;l>=0;l--)e.addNextSegment(a[l],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},nr.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Vt.CAP_ROUND:e.createCircle(t);break;case Vt.CAP_SQUARE:e.createSquare(t);break}},nr.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var n=Math.abs(e),i=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var s=e<0;this.computeSingleSidedBufferCurve(t,s,i)}else this.computeLineBufferCurve(t,i);var o=i.getCoordinates();return o},nr.prototype.getBufferParameters=function(){return this._bufParams},nr.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},nr.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(n===0)return nr.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},nr.prototype.computeOffsetCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){var s=le.simplify(t,-i),o=s.length-1;n.initSideSegments(s[o],s[o-1],H.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(s[a],!0)}else{var u=le.simplify(t,i),l=u.length-1;n.initSideSegments(u[0],u[1],H.LEFT),n.addFirstSegment();for(var h=2;h<=l;h++)n.addNextSegment(u[h],!0)}n.addLastSegment()},nr.prototype.getSegGen=function(t){return new te(this._precisionModel,this._bufParams,t)},nr.prototype.interfaces_=function(){return[]},nr.prototype.getClass=function(){return nr},nr.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new D(t[n]);return e};var po=function(){this._subgraphs=null,this._seg=new ot,this._cga=new K;var t=arguments[0];this._subgraphs=t},xp={DepthSegment:{configurable:!0}};po.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=new B,i=this._subgraphs.iterator();i.hasNext();){var s=i.next(),o=s.getEnvelope();e.y<o.getMinY()||e.y>o.getMaxY()||t.findStabbedSegments(e,s.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(dt(arguments[2],nn)&&arguments[0]instanceof D&&arguments[1]instanceof Fc)for(var a=arguments[0],u=arguments[1],l=arguments[2],h=u.getEdge().getCoordinates(),c=0;c<h.length-1;c++){t._seg.p0=h[c],t._seg.p1=h[c+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var f=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(f<a.x)&&!t._seg.isHorizontal()&&!(a.y<t._seg.p0.y||a.y>t._seg.p1.y)&&K.computeOrientation(t._seg.p0,t._seg.p1,a)!==K.RIGHT){var p=u.getDepth(H.LEFT);t._seg.p0.equals(h[c])||(p=u.getDepth(H.RIGHT));var v=new Ts(t._seg,p);l.add(v)}}else if(dt(arguments[2],nn)&&arguments[0]instanceof D&&dt(arguments[1],nn))for(var _=arguments[0],w=arguments[1],I=arguments[2],y=w.iterator();y.hasNext();){var E=y.next();E.isForward()&&t.findStabbedSegments(_,E,I)}}},po.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var n=un.min(e);return n._leftDepth},po.prototype.interfaces_=function(){return[]},po.prototype.getClass=function(){return po},xp.DepthSegment.get=function(){return Ts},Object.defineProperties(po,xp);var Ts=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new ot(t),this._leftDepth=e};Ts.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return n!==0||(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(e._upwardSeg)},Ts.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return n!==0?n:t.p1.compareTo(e.p1)},Ts.prototype.toString=function(){return this._upwardSeg.toString()},Ts.prototype.interfaces_=function(){return[Gr]},Ts.prototype.getClass=function(){return Ts};var Ut=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Ut.prototype.area=function(){return Ut.area(this.p0,this.p1,this.p2)},Ut.prototype.signedArea=function(){return Ut.signedArea(this.p0,this.p1,this.p2)},Ut.prototype.interpolateZ=function(t){if(t===null)throw new ne("Supplied point is null.");return Ut.interpolateZ(t,this.p0,this.p1,this.p2)},Ut.prototype.longestSideLength=function(){return Ut.longestSideLength(this.p0,this.p1,this.p2)},Ut.prototype.isAcute=function(){return Ut.isAcute(this.p0,this.p1,this.p2)},Ut.prototype.circumcentre=function(){return Ut.circumcentre(this.p0,this.p1,this.p2)},Ut.prototype.area3D=function(){return Ut.area3D(this.p0,this.p1,this.p2)},Ut.prototype.centroid=function(){return Ut.centroid(this.p0,this.p1,this.p2)},Ut.prototype.inCentre=function(){return Ut.inCentre(this.p0,this.p1,this.p2)},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut},Ut.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},Ut.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Ut.det=function(t,e,n,i){return t*i-e*n},Ut.interpolateZ=function(t,e,n,i){var s=e.x,o=e.y,a=n.x-s,u=i.x-s,l=n.y-o,h=i.y-o,c=a*h-u*l,f=t.x-s,p=t.y-o,v=(h*f-u*p)/c,_=(-l*f+a*p)/c,w=e.z+v*(n.z-e.z)+_*(i.z-e.z);return w},Ut.longestSideLength=function(t,e,n){var i=t.distance(e),s=e.distance(n),o=n.distance(t),a=i;return s>a&&(a=s),o>a&&(a=o),a},Ut.isAcute=function(t,e,n){return!(!Tt.isAcute(t,e,n)||!Tt.isAcute(e,n,t)||!Tt.isAcute(n,t,e))},Ut.circumcentre=function(t,e,n){var i=n.x,s=n.y,o=t.x-i,a=t.y-s,u=e.x-i,l=e.y-s,h=2*Ut.det(o,a,u,l),c=Ut.det(a,o*o+a*a,l,u*u+l*l),f=Ut.det(o,o*o+a*a,u,u*u+l*l),p=i-c/h,v=s+f/h;return new D(p,v)},Ut.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y,s=new en(t.x+n/2,t.y+i/2,1),o=new en(t.x-i+n/2,t.y+n+i/2,1);return new en(s,o)},Ut.angleBisector=function(t,e,n){var i=e.distance(t),s=e.distance(n),o=i/(i+s),a=n.x-t.x,u=n.y-t.y,l=new D(t.x+o*a,t.y+o*u);return l},Ut.area3D=function(t,e,n){var i=e.x-t.x,s=e.y-t.y,o=e.z-t.z,a=n.x-t.x,u=n.y-t.y,l=n.z-t.z,h=s*l-o*u,c=o*a-i*l,f=i*u-s*a,p=h*h+c*c+f*f,v=Math.sqrt(p)/2;return v},Ut.centroid=function(t,e,n){var i=(t.x+e.x+n.x)/3,s=(t.y+e.y+n.y)/3;return new D(i,s)},Ut.inCentre=function(t,e,n){var i=e.distance(n),s=t.distance(n),o=t.distance(e),a=i+s+o,u=(i*t.x+s*e.x+o*n.x)/a,l=(i*t.y+s*e.y+o*n.y)/a;return new D(u,l)};var Wr=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new B;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Wr.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,F.EXTERIOR,F.INTERIOR)},Wr.prototype.addPolygon=function(t){var e=this,n=this._distance,i=H.LEFT;this._distance<0&&(n=-this._distance,i=H.RIGHT);var s=t.getExteriorRing(),o=Mt.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,n,i,F.EXTERIOR,F.INTERIOR);for(var a=0;a<t.getNumInteriorRing();a++){var u=t.getInteriorRingN(a),l=Mt.removeRepeatedPoints(u.getCoordinates());e._distance>0&&e.isErodedCompletely(u,-e._distance)||e.addPolygonRing(l,n,H.opposite(i),F.INTERIOR,F.EXTERIOR)}},Wr.prototype.isTriangleErodedCompletely=function(t,e){var n=new Ut(t[0],t[1],t[2]),i=n.inCentre(),s=K.distancePointLine(i,n.p0,n.p1);return s<Math.abs(e)},Wr.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Mt.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,F.EXTERIOR,F.INTERIOR)},Wr.prototype.addCurve=function(t,e,n){if(t===null||t.length<2)return null;var i=new de(t,new Ht(0,F.BOUNDARY,e,n));this._curveList.add(i)},Wr.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Wr.prototype.addPolygonRing=function(t,e,n,i,s){if(e===0&&t.length<$n.MINIMUM_VALID_SIZE)return null;var o=i,a=s;t.length>=$n.MINIMUM_VALID_SIZE&&K.isCCW(t)&&(o=s,a=i,n=H.opposite(n));var u=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(u,o,a)},Wr.prototype.add=function(t){if(t.isEmpty())return null;t instanceof we?this.addPolygon(t):t instanceof ue?this.addLineString(t):t instanceof dr?this.addPoint(t):t instanceof la?this.addCollection(t):t instanceof Ns?this.addCollection(t):t instanceof jn?this.addCollection(t):t instanceof He&&this.addCollection(t)},Wr.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(n.length===4)return this.isTriangleErodedCompletely(n,e);var i=t.getEnvelopeInternal(),s=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>s},Wr.prototype.addCollection=function(t){for(var e=this,n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);e.add(i)}},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr};var da=function(){};da.prototype.locate=function(t){},da.prototype.interfaces_=function(){return[]},da.prototype.getClass=function(){return da};var ri=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};ri.prototype.next=function(){if(this._atStart)return this._atStart=!1,ri.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new aa;var t=this._parent.getGeometryN(this._index++);return t instanceof He?(this._subcollectionIterator=new ri(t),this._subcollectionIterator.next()):t},ri.prototype.remove=function(){throw new Error(this.getClass().getName())},ri.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},ri.prototype.interfaces_=function(){return[oa]},ri.prototype.getClass=function(){return ri},ri.isAtomic=function(t){return!(t instanceof He)};var xr=function(){this._geom=null;var t=arguments[0];this._geom=t};xr.prototype.locate=function(t){return xr.locate(t,this._geom)},xr.prototype.interfaces_=function(){return[da]},xr.prototype.getClass=function(){return xr},xr.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?K.isPointInRing(t,e.getCoordinates()):!1},xr.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!xr.isPointInRing(t,n))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var s=e.getInteriorRingN(i);if(xr.isPointInRing(t,s))return!1}return!0},xr.containsPoint=function(t,e){if(e instanceof we)return xr.containsPointInPolygon(t,e);if(e instanceof He)for(var n=new ri(e);n.hasNext();){var i=n.next();if(i!==e&&xr.containsPoint(t,i))return!0}return!1},xr.locate=function(t,e){return e.isEmpty()?F.EXTERIOR:xr.containsPoint(t,e)?F.INTERIOR:F.EXTERIOR};var qe=function(){this._edgeMap=new Ue,this._edgeList=null,this._ptInAreaLocation=[F.NONE,F.NONE]};qe.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return e===0&&(n=this._edgeList.size()-1),this._edgeList.get(n)},qe.prototype.propagateSideLabels=function(t){for(var e=F.NONE,n=this.iterator();n.hasNext();){var i=n.next(),s=i.getLabel();s.isArea(t)&&s.getLocation(t,H.LEFT)!==F.NONE&&(e=s.getLocation(t,H.LEFT))}if(e===F.NONE)return null;for(var o=e,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();if(l.getLocation(t,H.ON)===F.NONE&&l.setLocation(t,H.ON,o),l.isArea(t)){var h=l.getLocation(t,H.LEFT),c=l.getLocation(t,H.RIGHT);if(c!==F.NONE){if(c!==o)throw new Ni("side location conflict",u.getCoordinate());h===F.NONE&&St.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),o=h}else St.isTrue(l.getLocation(t,H.LEFT)===F.NONE,"found single null side"),l.setLocation(t,H.RIGHT,o),l.setLocation(t,H.LEFT,o)}}},qe.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},qe.prototype.print=function(t){Oe.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},qe.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},qe.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,i=e.get(n).getLabel(),s=i.getLocation(t,H.LEFT);St.isTrue(s!==F.NONE,"Found unlabelled area edge");for(var o=s,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();St.isTrue(l.isArea(t),"Found non-area edge");var h=l.getLocation(t,H.LEFT),c=l.getLocation(t,H.RIGHT);if(h===c||c!==o)return!1;o=h}return!0},qe.prototype.findIndex=function(t){var e=this;this.iterator();for(var n=0;n<this._edgeList.size();n++){var i=e._edgeList.get(n);if(i===t)return n}return-1},qe.prototype.iterator=function(){return this.getEdges().iterator()},qe.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new B(this._edgeMap.values())),this._edgeList},qe.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===F.NONE&&(this._ptInAreaLocation[t]=xr.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},qe.prototype.toString=function(){var t=new mn;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
64
+ ***************************************************************************** */function OC(r,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(h){return u([l,h])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,i=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){e.label=l[1];break}if(l[0]===6&&e.label<s[1]){e.label=s[1],s=l;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(l);break}s[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(r,e)}catch(h){l=[6,h],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var ts=(function(){function r(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return r})();function DC(r,t){return r>t?1:r<t?-1:0}function es(r,t,e){for(var n=new ts(null,null),i=n,s=n;;){var o=e(r,t.key);if(o<0){if(t.left===null)break;if(e(r,t.left.key)<0){var a=t.left;if(t.left=a.right,a.right=t,t=a,t.left===null)break}s.left=t,s=t,t=t.left}else if(o>0){if(t.right===null)break;if(e(r,t.right.key)>0){var a=t.right;if(t.right=a.left,a.left=t,t=a,t.right===null)break}i.right=t,i=t,t=t.right}else break}return i.right=t.left,s.left=t.right,t.left=n.right,t.right=n.left,t}function Pc(r,t,e,n){var i=new ts(r,t);if(e===null)return i.left=i.right=null,i;e=es(r,e,n);var s=n(r,e.key);return s<0?(i.left=e.left,i.right=e,e.left=null):s>=0&&(i.right=e.right,i.left=e,e.right=null),i}function Yg(r,t,e){var n=null,i=null;if(t){t=es(r,t,e);var s=e(t.key,r);s===0?(n=t.left,i=t.right):s<0?(i=t.right,t.right=null,n=t):(n=t.left,t.left=null,i=t)}return{left:n,right:i}}function AC(r,t,e){return t===null?r:(r===null||(t=es(r.key,t,e),t.left=r),t)}function Mc(r,t,e,n,i){if(r){n(""+t+(e?"└── ":"├── ")+i(r)+`
65
+ `);var s=t+(e?" ":"│ ");r.left&&Mc(r.left,s,!1,n,i),r.right&&Mc(r.right,s,!0,n,i)}}var bc=(function(){function r(t){t===void 0&&(t=DC),this._root=null,this._size=0,this._comparator=t}return r.prototype.insert=function(t,e){return this._size++,this._root=Pc(t,e,this._root,this._comparator)},r.prototype.add=function(t,e){var n=new ts(t,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,s=es(t,this._root,i),o=i(t,s.key);return o===0?this._root=s:(o<0?(n.left=s.left,n.right=s,s.left=null):o>0&&(n.right=s.right,n.left=s,s.right=null),this._size++,this._root=n),this._root},r.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},r.prototype._remove=function(t,e,n){var i;if(e===null)return null;e=es(t,e,n);var s=n(t,e.key);return s===0?(e.left===null?i=e.right:(i=es(t,e.left,n),i.right=e.right),this._size--,i):e},r.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=es(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},r.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},r.prototype.find=function(t){return this._root&&(this._root=es(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},r.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},r.prototype.forEach=function(t,e){for(var n=this._root,i=[],s=!1;!s;)n!==null?(i.push(n),n=n.left):i.length!==0?(n=i.pop(),t.call(e,n),n=n.right):s=!0;return this},r.prototype.range=function(t,e,n,i){for(var s=[],o=this._comparator,a=this._root,u;s.length!==0||a;)if(a)s.push(a),a=a.left;else{if(a=s.pop(),u=o(a.key,e),u>0)break;if(o(a.key,t)>=0&&n.call(i,a))return this;a=a.right}return this},r.prototype.keys=function(){var t=[];return this.forEach(function(e){var n=e.key;return t.push(n)}),t},r.prototype.values=function(){var t=[];return this.forEach(function(e){var n=e.data;return t.push(n)}),t},r.prototype.min=function(){return this._root?this.minNode(this._root).key:null},r.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},r.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},r.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},r.prototype.at=function(t){for(var e=this._root,n=!1,i=0,s=[];!n;)if(e)s.push(e),e=e.left;else if(s.length>0){if(e=s.pop(),i===t)return e;i++,e=e.right}else n=!0;return null},r.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var i=this._comparator;e;){var s=i(t.key,e.key);if(s===0)break;s<0?(n=e,e=e.left):e=e.right}return n},r.prototype.prev=function(t){var e=this._root,n=null;if(t.left!==null){for(n=t.left;n.right;)n=n.right;return n}for(var i=this._comparator;e;){var s=i(t.key,e.key);if(s===0)break;s<0?e=e.left:(n=e,e=e.right)}return n},r.prototype.clear=function(){return this._root=null,this._size=0,this},r.prototype.toList=function(){return RC(this._root)},r.prototype.load=function(t,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var i=t.length,s=this._comparator;if(n&&Tc(t,e,0,i-1,s),this._root===null)this._root=xc(t,e,0,i),this._size=i;else{var o=FC(this.toList(),LC(t,e),s);i=this._size+i,this._root=Nc({head:o},0,i)}return this},r.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),r.prototype.toString=function(t){t===void 0&&(t=function(n){return String(n.key)});var e=[];return Mc(this._root,"",!0,function(n){return e.push(n)},t),e.join("")},r.prototype.update=function(t,e,n){var i=this._comparator,s=Yg(t,this._root,i),o=s.left,a=s.right;i(t,e)<0?a=Pc(e,n,a,i):o=Pc(e,n,o,i),this._root=AC(o,a,i)},r.prototype.split=function(t){return Yg(t,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var t,e,n;return OC(this,function(i){switch(i.label){case 0:t=this._root,e=[],n=!1,i.label=1;case 1:return n?[3,6]:t===null?[3,2]:(e.push(t),t=t.left,[3,5]);case 2:return e.length===0?[3,4]:(t=e.pop(),[4,t]);case 3:return i.sent(),t=t.right,[3,5];case 4:n=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},r})();function xc(r,t,e,n){var i=n-e;if(i>0){var s=e+Math.floor(i/2),o=r[s],a=t[s],u=new ts(o,a);return u.left=xc(r,t,e,s),u.right=xc(r,t,s+1,n),u}return null}function LC(r,t){for(var e=new ts(null,null),n=e,i=0;i<r.length;i++)n=n.next=new ts(r[i],t[i]);return n.next=null,e.next}function RC(r){for(var t=r,e=[],n=!1,i=new ts(null,null),s=i;!n;)t?(e.push(t),t=t.left):e.length>0?(t=s=s.next=e.pop(),t=t.right):n=!0;return s.next=null,i.next}function Nc(r,t,e){var n=e-t;if(n>0){var i=t+Math.floor(n/2),s=Nc(r,t,i),o=r.head;return o.left=s,r.head=r.head.next,o.right=Nc(r,i+1,e),o}return null}function FC(r,t,e){for(var n=new ts(null,null),i=n,s=r,o=t;s!==null&&o!==null;)e(s.key,o.key)<0?(i.next=s,s=s.next):(i.next=o,o=o.next),i=i.next;return s!==null?i.next=s:o!==null&&(i.next=o),n.next}function Tc(r,t,e,n,i){if(!(e>=n)){for(var s=r[e+n>>1],o=e-1,a=n+1;;){do o++;while(i(r[o],s)<0);do a--;while(i(r[a],s)>0);if(o>=a)break;var u=r[o];r[o]=r[a],r[a]=u,u=t[o],t[o]=t[a],t[a]=u}Tc(r,t,e,a,i),Tc(r,t,a+1,n,i)}}const Cu=(r,t)=>r.ll.x<=t.x&&t.x<=r.ur.x&&r.ll.y<=t.y&&t.y<=r.ur.y,Oc=(r,t)=>{if(t.ur.x<r.ll.x||r.ur.x<t.ll.x||t.ur.y<r.ll.y||r.ur.y<t.ll.y)return null;const e=r.ll.x<t.ll.x?t.ll.x:r.ll.x,n=r.ur.x<t.ur.x?r.ur.x:t.ur.x,i=r.ll.y<t.ll.y?t.ll.y:r.ll.y,s=r.ur.y<t.ur.y?r.ur.y:t.ur.y;return{ll:{x:e,y:i},ur:{x:n,y:s}}};let rs=Number.EPSILON;rs===void 0&&(rs=Math.pow(2,-52));const kC=rs*rs,Jg=(r,t)=>{if(-rs<r&&r<rs&&-rs<t&&t<rs)return 0;const e=r-t;return e*e<kC*r*t?0:r<t?-1:1};class VC{constructor(){this.reset()}reset(){this.xRounder=new jg,this.yRounder=new jg}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}class jg{constructor(){this.tree=new bc,this.round(0)}round(t){const e=this.tree.add(t),n=this.tree.prev(e);if(n!==null&&Jg(e.key,n.key)===0)return this.tree.remove(t),n.key;const i=this.tree.next(e);return i!==null&&Jg(e.key,i.key)===0?(this.tree.remove(t),i.key):t}}const Iu=new VC,Fl=(r,t)=>r.x*t.y-r.y*t.x,Qg=(r,t)=>r.x*t.x+r.y*t.y,$g=(r,t,e)=>{const n=pg(r.x,r.y,t.x,t.y,e.x,e.y);return n>0?-1:n<0?1:0},kl=r=>Math.sqrt(Qg(r,r)),UC=(r,t,e)=>{const n={x:t.x-r.x,y:t.y-r.y},i={x:e.x-r.x,y:e.y-r.y};return Fl(i,n)/kl(i)/kl(n)},zC=(r,t,e)=>{const n={x:t.x-r.x,y:t.y-r.y},i={x:e.x-r.x,y:e.y-r.y};return Qg(i,n)/kl(i)/kl(n)},Kg=(r,t,e)=>t.y===0?null:{x:r.x+t.x/t.y*(e-r.y),y:e},Zg=(r,t,e)=>t.x===0?null:{x:e,y:r.y+t.y/t.x*(e-r.x)},GC=(r,t,e,n)=>{if(t.x===0)return Zg(e,n,r.x);if(n.x===0)return Zg(r,t,e.x);if(t.y===0)return Kg(e,n,r.y);if(n.y===0)return Kg(r,t,e.y);const i=Fl(t,n);if(i==0)return null;const s={x:e.x-r.x,y:e.y-r.y},o=Fl(s,t)/i,a=Fl(s,n)/i,u=r.x+a*t.x,l=e.x+o*n.x,h=r.y+a*t.y,c=e.y+o*n.y,f=(u+l)/2,p=(h+c)/2;return{x:f,y:p}};class $r{static compare(t,e){const n=$r.comparePoints(t.point,e.point);return n!==0?n:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:ns.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}constructor(t,e){t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let n=0,i=e.length;n<i;n++){const s=e[n];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let i=e+1;i<t;i++){const s=this.point.events[i];s.consumedBy===void 0&&n.otherSE.point.events===s.otherSE.point.events&&n.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,n=this.point.events.length;e<n;e++){const i=this.point.events[e];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}getLeftmostComparator(t){const e=new Map,n=i=>{const s=i.otherSE;e.set(i,{sine:UC(this.point,t.point,s.point),cosine:zC(this.point,t.point,s.point)})};return(i,s)=>{e.has(i)||n(i),e.has(s)||n(s);const{sine:o,cosine:a}=e.get(i),{sine:u,cosine:l}=e.get(s);return o>=0&&u>=0?a<l?1:a>l?-1:0:o<0&&u<0?a<l?-1:a>l?1:0:u<o?-1:u>o?1:0}}}let qC=0;class ns{static compare(t,e){const n=t.leftSE.point.x,i=e.leftSE.point.x,s=t.rightSE.point.x,o=e.rightSE.point.x;if(o<n)return 1;if(s<i)return-1;const a=t.leftSE.point.y,u=e.leftSE.point.y,l=t.rightSE.point.y,h=e.rightSE.point.y;if(n<i){if(u<a&&u<l)return 1;if(u>a&&u>l)return-1;const c=t.comparePoint(e.leftSE.point);if(c<0)return 1;if(c>0)return-1;const f=e.comparePoint(t.rightSE.point);return f!==0?f:-1}if(n>i){if(a<u&&a<h)return-1;if(a>u&&a>h)return 1;const c=e.comparePoint(t.leftSE.point);if(c!==0)return c;const f=t.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(a<u)return-1;if(a>u)return 1;if(s<o){const c=e.comparePoint(t.rightSE.point);if(c!==0)return c}if(s>o){const c=t.comparePoint(e.rightSE.point);if(c<0)return 1;if(c>0)return-1}if(s!==o){const c=l-a,f=s-n,p=h-u,m=o-i;if(c>f&&p<m)return 1;if(c<f&&p>m)return-1}return s>o?1:s<o||l<h?-1:l>h?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,n,i){this.id=++qC,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=i}static fromRing(t,e,n){let i,s,o;const a=$r.comparePoints(t,e);if(a<0)i=t,s=e,o=1;else if(a>0)i=e,s=t,o=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);const u=new $r(i,!0),l=new $r(s,!1);return new ns(u,l,[n],[o])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const e=this.leftSE.point,n=this.rightSE.point,i=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;const s=(t.y-e.y)/i.y,o=e.x+s*i.x;if(t.x===o)return 0;const a=(t.x-e.x)/i.x,u=e.y+a*i.y;return t.y===u?0:t.y<u?-1:1}getIntersection(t){const e=this.bbox(),n=t.bbox(),i=Oc(e,n);if(i===null)return null;const s=this.leftSE.point,o=this.rightSE.point,a=t.leftSE.point,u=t.rightSE.point,l=Cu(e,a)&&this.comparePoint(a)===0,h=Cu(n,s)&&t.comparePoint(s)===0,c=Cu(e,u)&&this.comparePoint(u)===0,f=Cu(n,o)&&t.comparePoint(o)===0;if(h&&l)return f&&!c?o:!f&&c?u:null;if(h)return c&&s.x===u.x&&s.y===u.y?null:s;if(l)return f&&o.x===a.x&&o.y===a.y?null:a;if(f&&c)return null;if(f)return o;if(c)return u;const p=GC(s,this.vector(),a,t.vector());return p===null||!Cu(i,p)?null:Iu.round(p.x,p.y)}split(t){const e=[],n=t.events!==void 0,i=new $r(t,!0),s=new $r(t,!1),o=this.rightSE;this.replaceRightSE(s),e.push(s),e.push(i);const a=new ns(i,o,this.rings.slice(),this.windings.slice());return $r.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),$r.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),s.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(t){let e=this,n=t;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const i=ns.compare(e,n);if(i!==0){if(i>0){const s=e;e=n,n=s}if(e.prev===n){const s=e;e=n,n=s}for(let s=0,o=n.rings.length;s<o;s++){const a=n.rings[s],u=n.windings[s],l=e.rings.indexOf(a);l===-1?(e.rings.push(a),e.windings.push(u)):e.windings[l]+=u}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,i=this._afterState.multiPolys;for(let a=0,u=this.rings.length;a<u;a++){const l=this.rings[a],h=this.windings[a],c=e.indexOf(l);c===-1?(e.push(l),n.push(h)):n[c]+=h}const s=[],o=[];for(let a=0,u=e.length;a<u;a++){if(n[a]===0)continue;const l=e[a],h=l.poly;if(o.indexOf(h)===-1)if(l.isExterior)s.push(h);else{o.indexOf(h)===-1&&o.push(h);const c=s.indexOf(l.poly);c!==-1&&s.splice(c,1)}}for(let a=0,u=s.length;a<u;a++){const l=s[a].multiPoly;i.indexOf(l)===-1&&i.push(l)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Tn.type){case"union":{const n=t.length===0,i=e.length===0;this._isInResult=n!==i;break}case"intersection":{let n,i;t.length<e.length?(n=t.length,i=e.length):(n=e.length,i=t.length),this._isInResult=i===Tn.numMultiPolys&&n<i;break}case"xor":{const n=Math.abs(t.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=i=>i.length===1&&i[0].isSubject;this._isInResult=n(t)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${Tn.type}`)}return this._isInResult}}class tm{constructor(t,e,n){if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=Iu.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let s=i;for(let o=1,a=t.length;o<a;o++){if(typeof t[o][0]!="number"||typeof t[o][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let u=Iu.round(t[o][0],t[o][1]);u.x===s.x&&u.y===s.y||(this.segments.push(ns.fromRing(s,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),s=u)}(i.x!==s.x||i.y!==s.y)&&this.segments.push(ns.fromRing(s,i,this))}getSweepEvents(){const t=[];for(let e=0,n=this.segments.length;e<n;e++){const i=this.segments[e];t.push(i.leftSE),t.push(i.rightSE)}return t}}class WC{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new tm(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,i=t.length;n<i;n++){const s=new tm(t[n],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const i=this.interiorRings[e].getSweepEvents();for(let s=0,o=i.length;s<o;s++)t.push(i[s])}return t}}class em{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,i=t.length;n<i;n++){const s=new WC(t[n],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const i=this.polys[e].getSweepEvents();for(let s=0,o=i.length;s<o;s++)t.push(i[s])}return t}}class Vl{static factory(t){const e=[];for(let n=0,i=t.length;n<i;n++){const s=t[n];if(!s.isInResult()||s.ringOut)continue;let o=null,a=s.leftSE,u=s.rightSE;const l=[a],h=a.point,c=[];for(;o=a,a=u,l.push(a),a.point!==h;)for(;;){const f=a.getAvailableLinkedEvents();if(f.length===0){const _=l[0].point,E=l[l.length-1].point;throw new Error(`Unable to complete output ring starting at [${_.x}, ${_.y}]. Last matching segment found ends at [${E.x}, ${E.y}].`)}if(f.length===1){u=f[0].otherSE;break}let p=null;for(let _=0,E=c.length;_<E;_++)if(c[_].point===a.point){p=_;break}if(p!==null){const _=c.splice(p)[0],E=l.splice(_.index);E.unshift(E[0].otherSE),e.push(new Vl(E.reverse()));continue}c.push({index:l.length,point:a.point});const m=a.getLeftmostComparator(o);u=f.sort(m)[0].otherSE;break}e.push(new Vl(l))}return e}constructor(t){this.events=t;for(let e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let l=1,h=this.events.length-1;l<h;l++){const c=this.events[l].point,f=this.events[l+1].point;$g(c,t,f)!==0&&(e.push(c),t=c)}if(e.length===1)return null;const n=e[0],i=e[1];$g(n,t,i)===0&&e.shift(),e.push(e[0]);const s=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:e.length-1,a=this.isExteriorRing()?e.length:-1,u=[];for(let l=o;l!=a;l+=s)u.push([e[l].x,e[l].y]);return u}isExteriorRing(){if(this._isExteriorRing===void 0){const t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let i=1,s=this.events.length;i<s;i++){const o=this.events[i];$r.compare(t,o)>0&&(t=o)}let e=t.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class rm{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const i=this.interiorRings[e].getGeom();i!==null&&t.push(i)}return t}}class XC{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const i=this.polys[e].getGeom();i!==null&&t.push(i)}return t}_composePolys(t){const e=[];for(let n=0,i=t.length;n<i;n++){const s=t[n];if(!s.poly)if(s.isExteriorRing())e.push(new rm(s));else{const o=s.enclosingRing();o.poly||e.push(new rm(o)),o.poly.addInterior(s)}}return e}}class BC{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ns.compare;this.queue=t,this.tree=new bc(e),this.segments=[]}process(t){const e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;const i=t.isLeft?this.tree.add(e):this.tree.find(e);if(!i)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let s=i,o=i,a,u;for(;a===void 0;)s=this.tree.prev(s),s===null?a=null:s.key.consumedBy===void 0&&(a=s.key);for(;u===void 0;)o=this.tree.next(o),o===null?u=null:o.key.consumedBy===void 0&&(u=o.key);if(t.isLeft){let l=null;if(a){const c=a.getIntersection(e);if(c!==null&&(e.isAnEndpoint(c)||(l=c),!a.isAnEndpoint(c))){const f=this._splitSafely(a,c);for(let p=0,m=f.length;p<m;p++)n.push(f[p])}}let h=null;if(u){const c=u.getIntersection(e);if(c!==null&&(e.isAnEndpoint(c)||(h=c),!u.isAnEndpoint(c))){const f=this._splitSafely(u,c);for(let p=0,m=f.length;p<m;p++)n.push(f[p])}}if(l!==null||h!==null){let c=null;l===null?c=h:h===null?c=l:c=$r.comparePoints(l,h)<=0?l:h,this.queue.remove(e.rightSE),n.push(e.rightSE);const f=e.split(c);for(let p=0,m=f.length;p<m;p++)n.push(f[p])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&u){const l=a.getIntersection(u);if(l!==null){if(!a.isAnEndpoint(l)){const h=this._splitSafely(a,l);for(let c=0,f=h.length;c<f;c++)n.push(h[c])}if(!u.isAnEndpoint(l)){const h=this._splitSafely(u,l);for(let c=0,f=h.length;c<f;c++)n.push(h[c])}}}this.tree.remove(e)}return n}_splitSafely(t,e){this.tree.remove(t);const n=t.rightSE;this.queue.remove(n);const i=t.split(e);return i.push(n),t.consumedBy===void 0&&this.tree.add(t),i}}const nm=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,HC=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class YC{run(t,e,n){Tn.type=t,Iu.reset();const i=[new em(e,!0)];for(let c=0,f=n.length;c<f;c++)i.push(new em(n[c],!1));if(Tn.numMultiPolys=i.length,Tn.type==="difference"){const c=i[0];let f=1;for(;f<i.length;)Oc(i[f].bbox,c.bbox)!==null?f++:i.splice(f,1)}if(Tn.type==="intersection")for(let c=0,f=i.length;c<f;c++){const p=i[c];for(let m=c+1,_=i.length;m<_;m++)if(Oc(p.bbox,i[m].bbox)===null)return[]}const s=new bc($r.compare);for(let c=0,f=i.length;c<f;c++){const p=i[c].getSweepEvents();for(let m=0,_=p.length;m<_;m++)if(s.insert(p[m]),s.size>nm)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const o=new BC(s);let a=s.size,u=s.pop();for(;u;){const c=u.key;if(s.size===a){const p=c.segment;throw new Error(`Unable to pop() ${c.isLeft?"left":"right"} SweepEvent [${c.point.x}, ${c.point.y}] from segment #${p.id} [${p.leftSE.point.x}, ${p.leftSE.point.y}] -> [${p.rightSE.point.x}, ${p.rightSE.point.y}] from queue.`)}if(s.size>nm)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(o.segments.length>HC)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=o.process(c);for(let p=0,m=f.length;p<m;p++){const _=f[p];_.consumedBy===void 0&&s.insert(_)}a=s.size,u=s.pop()}Iu.reset();const l=Vl.factory(o.segments);return new XC(l).getGeom()}}const Tn=new YC;var Dc={union:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Tn.run("union",r,e)},intersection:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Tn.run("intersection",r,e)},xor:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Tn.run("xor",r,e)},difference:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return Tn.run("difference",r,e)}};function JC(r,t){var e=$e(r),n=$e(t),i=r.properties||{},s=Dc.difference(e.coordinates,n.coordinates);return s.length===0?null:s.length===1?kt(s[0],i):sc(s,i)}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(n+i,0):Math.min(i,n);var s=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:n;for(s=s<0?Math.max(n+arguments[2],0):Math.min(s,n);i<s;)e[i]=t,++i;return e},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!==r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var Fs=function(){};Fs.prototype.interfaces_=function(){return[]},Fs.prototype.getClass=function(){return Fs},Fs.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var zt=(function(r){function t(e){r.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=new r().stack}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t})(Error),st=function(){},im={MAX_VALUE:{configurable:!0}};st.isNaN=function(t){return Number.isNaN(t)},st.doubleToLongBits=function(t){return t},st.longBitsToDouble=function(t){return t},st.isInfinite=function(t){return!Number.isFinite(t)},im.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(st,im);var Pr=function(){},Ul=function(){},qo=function(){};function Mr(){}var x=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.z=t.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},ks={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};x.prototype.setOrdinate=function(t,e){switch(t){case x.X:this.x=e;break;case x.Y:this.y=e;break;case x.Z:this.z=e;break;default:throw new zt("Invalid ordinate index: "+t)}},x.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return!(this.x!==t.x||this.y!==t.y)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return!(!Fs.equalsWithTolerance(this.x,e.x,n)||!Fs.equalsWithTolerance(this.y,e.y,n))}},x.prototype.getOrdinate=function(t){switch(t){case x.X:return this.x;case x.Y:return this.y;case x.Z:return this.z}throw new zt("Invalid ordinate index: "+t)},x.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||st.isNaN(this.z))&&st.isNaN(t.z)},x.prototype.equals=function(t){return t instanceof x?this.equals2D(t):!1},x.prototype.equalInZ=function(t,e){return Fs.equalsWithTolerance(this.z,t.z,e)},x.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},x.prototype.clone=function(){},x.prototype.copy=function(){return new x(this)},x.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},x.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+n*n+i*i)},x.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},x.prototype.hashCode=function(){var t=17;return t=37*t+x.hashCode(this.x),t=37*t+x.hashCode(this.y),t},x.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},x.prototype.interfaces_=function(){return[Pr,Ul,Mr]},x.prototype.getClass=function(){return x},x.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=st.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},ks.DimensionalComparator.get=function(){return Ni},ks.serialVersionUID.get=function(){return 6683108902428367e3},ks.NULL_ORDINATE.get=function(){return st.NaN},ks.X.get=function(){return 0},ks.Y.get=function(){return 1},ks.Z.get=function(){return 2},Object.defineProperties(x,ks);var Ni=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new zt("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};Ni.prototype.compare=function(t,e){var n=t,i=e,s=Ni.compare(n.x,i.x);if(s!==0)return s;var o=Ni.compare(n.y,i.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var a=Ni.compare(n.z,i.z);return a},Ni.prototype.interfaces_=function(){return[qo]},Ni.prototype.getClass=function(){return Ni},Ni.compare=function(t,e){return t<e?-1:t>e?1:st.isNaN(t)?st.isNaN(e)?0:-1:st.isNaN(e)?1:0};var Wo=function(){};Wo.prototype.create=function(){},Wo.prototype.interfaces_=function(){return[]},Wo.prototype.getClass=function(){return Wo};var O=function(){},Pu={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.toLocationSymbol=function(t){switch(t){case O.EXTERIOR:return"e";case O.BOUNDARY:return"b";case O.INTERIOR:return"i";case O.NONE:return"-"}throw new zt("Unknown location value: "+t)},Pu.INTERIOR.get=function(){return 0},Pu.BOUNDARY.get=function(){return 1},Pu.EXTERIOR.get=function(){return 2},Pu.NONE.get=function(){return-1},Object.defineProperties(O,Pu);var rt=function(r,t){return r.interfaces_&&r.interfaces_().indexOf(t)>-1},dr=function(){},sm={LOG_10:{configurable:!0}};dr.prototype.interfaces_=function(){return[]},dr.prototype.getClass=function(){return dr},dr.log10=function(t){var e=Math.log(t);return st.isInfinite(e)||st.isNaN(e)?e:e/dr.LOG_10},dr.min=function(t,e,n,i){var s=t;return e<s&&(s=e),n<s&&(s=n),i<s&&(s=i),s},dr.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],s=arguments[1],o=arguments[2];return i<s?s:i>o?o:i}},dr.wrap=function(t,e){return t<0?e- -t%e:t%e},dr.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2],i=t;return e>i&&(i=e),n>i&&(i=n),i}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3],l=s;return o>l&&(l=o),a>l&&(l=a),u>l&&(l=u),l}},dr.average=function(t,e){return(t+e)/2},sm.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(dr,sm);var Kr=function(t){this.str=t};Kr.prototype.append=function(t){this.str+=t},Kr.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},Kr.prototype.toString=function(t){return this.str};var Zr=function(t){this.value=t};Zr.prototype.intValue=function(){return this.value},Zr.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},Zr.isNaN=function(t){return Number.isNaN(t)};var Mu=function(){};Mu.isWhitespace=function(t){return t<=32&&t>=0||t===127},Mu.toUpperCase=function(t){return t.toUpperCase()};var R=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof r){var e=arguments[0];this.init(e)}else if(typeof arguments[0]=="string"){var n=arguments[0];r.call(this,r.parse(n))}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.init(i,s)}},Rr={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};R.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},R.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),i=R.magnitude(n._hi),s=R.TEN.pow(i);n=n.divide(s),n.gt(R.TEN)?(n=n.divide(R.TEN),i+=1):n.lt(R.ONE)&&(n=n.multiply(R.TEN),i-=1);for(var o=i+1,a=new Kr,u=R.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){t&&l===o&&a.append(".");var h=Math.trunc(n._hi);if(h<0)break;var c=!1,f=0;h>9?(c=!0,f="9"):f="0"+h,a.append(f),n=n.subtract(R.valueOf(h)).multiply(R.TEN),c&&n.selfAdd(R.TEN);var p=!0,m=R.magnitude(n._hi);if(m<0&&Math.abs(m)>=u-l&&(p=!1),!p)break}return e[0]=i,a.toString()},R.prototype.sqr=function(){return this.multiply(this)},R.prototype.doubleValue=function(){return this._hi+this._lo},R.prototype.subtract=function(){if(arguments[0]instanceof R){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},R.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},R.prototype.isZero=function(){return this._hi===0&&this._lo===0},R.prototype.selfSubtract=function(){if(arguments[0]instanceof R){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},R.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},R.prototype.min=function(t){return this.le(t)?this:t},R.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof R){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=null,o=null,a=null,u=null,l=null,h=null,c=null,f=null;return l=this._hi/n,h=R.SPLIT*l,s=h-l,f=R.SPLIT*n,s=h-s,o=l-s,a=f-n,c=l*n,a=f-a,u=n-a,f=s*a-c+s*u+o*a+o*u,h=(this._hi-c-f+this._lo-l*i)/n,f=l+h,this._hi=f,this._lo=l-f+h,this}},R.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},R.prototype.divide=function(){if(arguments[0]instanceof R){var t=arguments[0],e=null,n=null,i=null,s=null,o=null,a=null,u=null,l=null;o=this._hi/t._hi,a=R.SPLIT*o,e=a-o,l=R.SPLIT*t._hi,e=a-e,n=o-e,i=l-t._hi,u=o*t._hi,i=l-i,s=t._hi-i,l=e*i-u+e*s+n*i+n*s,a=(this._hi-u-l+this._lo-o*t._lo)/t._hi,l=o+a;var h=l,c=o-l+a;return new R(h,c)}else if(typeof arguments[0]=="number"){var f=arguments[0];return st.isNaN(f)?R.createNaN():R.copy(this).selfDivide(f,0)}},R.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},R.prototype.pow=function(t){if(t===0)return R.valueOf(1);var e=new R(this),n=R.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2===1&&n.selfMultiply(e),i/=2,i>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},R.prototype.ceil=function(){if(this.isNaN())return R.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new R(t,e)},R.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},R.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()},R.prototype.setValue=function(){if(arguments[0]instanceof R){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},R.prototype.max=function(t){return this.ge(t)?this:t},R.prototype.sqrt=function(){if(this.isZero())return R.valueOf(0);if(this.isNegative())return R.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=R.valueOf(e),i=this.subtract(n.sqr()),s=i._hi*(t*.5);return n.add(s)},R.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof R){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],n=null,i=null,s=null,o=null,a=null,u=null;return s=this._hi+e,a=s-this._hi,o=s-a,o=e-a+(this._hi-o),u=o+this._lo,n=s+u,i=u+(s-n),this._hi=n+i,this._lo=i+(n-this._hi),this}}else if(arguments.length===2){var l=arguments[0],h=arguments[1],c=null,f=null,p=null,m=null,_=null,E=null,C=null,v=null;_=this._hi+l,p=this._lo+h,C=_-this._hi,v=p-this._lo,E=_-C,m=p-v,E=l-C+(this._hi-E),m=h-v+(this._lo-m),C=E+p,c=_+C,f=C+(_-c),C=m+f;var y=c+C,w=C+(c-y);return this._hi=y,this._lo=w,this}},R.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof R){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=null,o=null,a=null,u=null,l=null,h=null;l=R.SPLIT*this._hi,s=l-this._hi,h=R.SPLIT*n,s=l-s,o=this._hi-s,a=h-n,l=this._hi*n,a=h-a,u=n-a,h=s*a-l+s*u+o*a+o*u+(this._hi*i+this._lo*n);var c=l+h;s=l-c;var f=h+s;return this._hi=c,this._lo=f,this}},R.prototype.selfSqr=function(){return this.selfMultiply(this)},R.prototype.floor=function(){if(this.isNaN())return R.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new R(t,e)},R.prototype.negate=function(){return this.isNaN()?this:new R(-this._hi,-this._lo)},R.prototype.clone=function(){},R.prototype.multiply=function(){if(arguments[0]instanceof R){var t=arguments[0];return t.isNaN()?R.createNaN():R.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return st.isNaN(e)?R.createNaN():R.copy(this).selfMultiply(e,0)}},R.prototype.isNaN=function(){return st.isNaN(this._hi)},R.prototype.intValue=function(){return Math.trunc(this._hi)},R.prototype.toString=function(){var t=R.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},R.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),i=e[0]+1,s=n;if(n.charAt(0)===".")s="0"+n;else if(i<0)s="0."+R.stringOfChar("0",-i)+n;else if(n.indexOf(".")===-1){var o=i-n.length,a=R.stringOfChar("0",o);s=n+a+".0"}return this.isNegative()?"-"+s:s},R.prototype.reciprocal=function(){var t=null,e=null,n=null,i=null,s=null,o=null,a=null,u=null;s=1/this._hi,o=R.SPLIT*s,t=o-s,u=R.SPLIT*this._hi,t=o-t,e=s-t,n=u-this._hi,a=s*this._hi,n=u-n,i=this._hi-n,u=t*n-a+t*i+e*n+e*i,o=(1-a-u-s*this._lo)/this._hi;var l=s+o,h=s-l+o;return new R(l,h)},R.prototype.toSciNotation=function(){if(this.isZero())return R.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),i=R.SCI_NOT_EXPONENT_CHAR+e[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var s="";n.length>1&&(s=n.substring(1));var o=n.charAt(0)+"."+s;return this.isNegative()?"-"+o+i:o+i},R.prototype.abs=function(){return this.isNaN()?R.NaN:this.isNegative()?this.negate():new R(this)},R.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},R.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},R.prototype.add=function(){if(arguments[0]instanceof R){var t=arguments[0];return R.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return R.copy(this).selfAdd(e)}},R.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof R){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._hi=n,this._lo=i}},R.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},R.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},R.prototype.trunc=function(){return this.isNaN()?R.NaN:this.isPositive()?this.floor():this.ceil()},R.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},R.prototype.interfaces_=function(){return[Mr,Pr,Ul]},R.prototype.getClass=function(){return R},R.sqr=function(t){return R.valueOf(t).selfMultiply(t)},R.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return R.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new R(e)}},R.sqrt=function(t){return R.valueOf(t).sqrt()},R.parse=function(t){for(var e=0,n=t.length;Mu.isWhitespace(t.charAt(e));)e++;var i=!1;if(e<n){var s=t.charAt(e);(s==="-"||s==="+")&&(e++,s==="-"&&(i=!0))}for(var o=new R,a=0,u=0,l=0;!(e>=n);){var h=t.charAt(e);if(e++,Mu.isDigit(h)){var c=h-"0";o.selfMultiply(R.TEN),o.selfAdd(c),a++;continue}if(h==="."){u=a;continue}if(h==="e"||h==="E"){var f=t.substring(e);try{l=Zr.parseInt(f)}catch(C){throw C instanceof Error?new Error("Invalid exponent "+f+" in string "+t):C}finally{}break}throw new Error("Unexpected character '"+h+"' at position "+e+" in string "+t)}var p=o,m=a-u-l;if(m===0)p=o;else if(m>0){var _=R.TEN.pow(m);p=o.divide(_)}else if(m<0){var E=R.TEN.pow(-m);p=o.multiply(E)}return i?p.negate():p},R.createNaN=function(){return new R(st.NaN,st.NaN)},R.copy=function(t){return new R(t)},R.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(n)),s=Math.pow(10,i);return s*10<=e&&(i+=1),i},R.stringOfChar=function(t,e){for(var n=new Kr,i=0;i<e;i++)n.append(t);return n.toString()},Rr.PI.get=function(){return new R(3.141592653589793,12246467991473532e-32)},Rr.TWO_PI.get=function(){return new R(6.283185307179586,24492935982947064e-32)},Rr.PI_2.get=function(){return new R(1.5707963267948966,6123233995736766e-32)},Rr.E.get=function(){return new R(2.718281828459045,14456468917292502e-32)},Rr.NaN.get=function(){return new R(st.NaN,st.NaN)},Rr.EPS.get=function(){return 123259516440783e-46},Rr.SPLIT.get=function(){return 134217729},Rr.MAX_PRINT_DIGITS.get=function(){return 32},Rr.TEN.get=function(){return R.valueOf(10)},Rr.ONE.get=function(){return R.valueOf(1)},Rr.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Rr.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(R,Rr);var Ge=function(){},om={DP_SAFE_EPSILON:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.orientationIndex=function(t,e,n){var i=Ge.orientationIndexFilter(t,e,n);if(i<=1)return i;var s=R.valueOf(e.x).selfAdd(-t.x),o=R.valueOf(e.y).selfAdd(-t.y),a=R.valueOf(n.x).selfAdd(-e.x),u=R.valueOf(n.y).selfAdd(-e.y);return s.selfMultiply(u).selfSubtract(o.selfMultiply(a)).signum()},Ge.signOfDet2x2=function(t,e,n,i){var s=t.multiply(i).selfSubtract(e.multiply(n));return s.signum()},Ge.intersection=function(t,e,n,i){var s=R.valueOf(i.y).selfSubtract(n.y).selfMultiply(R.valueOf(e.x).selfSubtract(t.x)),o=R.valueOf(i.x).selfSubtract(n.x).selfMultiply(R.valueOf(e.y).selfSubtract(t.y)),a=s.subtract(o),u=R.valueOf(i.x).selfSubtract(n.x).selfMultiply(R.valueOf(t.y).selfSubtract(n.y)),l=R.valueOf(i.y).selfSubtract(n.y).selfMultiply(R.valueOf(t.x).selfSubtract(n.x)),h=u.subtract(l),c=h.selfDivide(a).doubleValue(),f=R.valueOf(t.x).selfAdd(R.valueOf(e.x).selfSubtract(t.x).selfMultiply(c)).doubleValue(),p=R.valueOf(e.x).selfSubtract(t.x).selfMultiply(R.valueOf(t.y).selfSubtract(n.y)),m=R.valueOf(e.y).selfSubtract(t.y).selfMultiply(R.valueOf(t.x).selfSubtract(n.x)),_=p.subtract(m),E=_.selfDivide(a).doubleValue(),C=R.valueOf(n.y).selfAdd(R.valueOf(i.y).selfSubtract(n.y).selfMultiply(E)).doubleValue();return new x(f,C)},Ge.orientationIndexFilter=function(t,e,n){var i=null,s=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),a=s-o;if(s>0){if(o<=0)return Ge.signum(a);i=s+o}else if(s<0){if(o>=0)return Ge.signum(a);i=-s-o}else return Ge.signum(a);var u=Ge.DP_SAFE_EPSILON*i;return a>=u||-a>=u?Ge.signum(a):2},Ge.signum=function(t){return t>0?1:t<0?-1:0},om.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Ge,om);var vt=function(){},bu={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};bu.X.get=function(){return 0},bu.Y.get=function(){return 1},bu.Z.get=function(){return 2},bu.M.get=function(){return 3},vt.prototype.setOrdinate=function(t,e,n){},vt.prototype.size=function(){},vt.prototype.getOrdinate=function(t,e){},vt.prototype.getCoordinate=function(){},vt.prototype.getCoordinateCopy=function(t){},vt.prototype.getDimension=function(){},vt.prototype.getX=function(t){},vt.prototype.clone=function(){},vt.prototype.expandEnvelope=function(t){},vt.prototype.copy=function(){},vt.prototype.getY=function(t){},vt.prototype.toCoordinateArray=function(){},vt.prototype.interfaces_=function(){return[Ul]},vt.prototype.getClass=function(){return vt},Object.defineProperties(vt,bu);var am=function(){},Xo=(function(r){function t(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(am),fe=function(){};fe.arraycopy=function(t,e,n,i,s){for(var o=0,a=e;a<e+s;a++)n[i+o]=t[a],o++},fe.getProperty=function(t){return{"line.separator":`
66
+ `}[t]};var Fr=function r(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],n=arguments[1];this.x=e,this.y=n,this.w=1}else if(arguments[0]instanceof r&&arguments[1]instanceof r){var i=arguments[0],s=arguments[1];this.x=i.y*s.w-s.y*i.w,this.y=s.x*i.w-i.x*s.w,this.w=i.x*s.y-s.x*i.y}else if(arguments[0]instanceof x&&arguments[1]instanceof x){var o=arguments[0],a=arguments[1];this.x=o.y-a.y,this.y=a.x-o.x,this.w=o.x*a.y-a.x*o.y}}else if(arguments.length===3){var u=arguments[0],l=arguments[1],h=arguments[2];this.x=u,this.y=l,this.w=h}else if(arguments.length===4){var c=arguments[0],f=arguments[1],p=arguments[2],m=arguments[3],_=c.y-f.y,E=f.x-c.x,C=c.x*f.y-f.x*c.y,v=p.y-m.y,y=m.x-p.x,w=p.x*m.y-m.x*p.y;this.x=E*w-y*C,this.y=v*C-_*w,this.w=_*y-v*E}};Fr.prototype.getY=function(){var t=this.y/this.w;if(st.isNaN(t)||st.isInfinite(t))throw new Xo;return t},Fr.prototype.getX=function(){var t=this.x/this.w;if(st.isNaN(t)||st.isInfinite(t))throw new Xo;return t},Fr.prototype.getCoordinate=function(){var t=new x;return t.x=this.getX(),t.y=this.getY(),t},Fr.prototype.interfaces_=function(){return[]},Fr.prototype.getClass=function(){return Fr},Fr.intersection=function(t,e,n,i){var s=t.y-e.y,o=e.x-t.x,a=t.x*e.y-e.x*t.y,u=n.y-i.y,l=i.x-n.x,h=n.x*i.y-i.x*n.y,c=o*h-l*a,f=u*a-s*h,p=s*l-u*o,m=c/p,_=f/p;if(st.isNaN(m)||st.isInfinite(m)||st.isNaN(_)||st.isInfinite(_))throw new Xo;return new x(m,_)};var J=function r(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof x){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof r){var e=arguments[0];this.init(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3];this.init(s,o,a,u)}},um={serialVersionUID:{configurable:!0}};J.prototype.getArea=function(){return this.getWidth()*this.getHeight()},J.prototype.equals=function(t){if(!(t instanceof J))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},J.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new J;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,i=this._maxx<t._maxx?this._maxx:t._maxx,s=this._maxy<t._maxy?this._maxy:t._maxy;return new J(e,i,n,s)},J.prototype.isNull=function(){return this._maxx<this._minx},J.prototype.getMaxX=function(){return this._maxx},J.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof x){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof J){var e=arguments[0];return this.isNull()||e.isNull()?!1:e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=this._maxy}},J.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof J){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}else if(arguments[0]instanceof x){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:!(n>this._maxx||n<this._minx||i>this._maxy||i<this._miny)}},J.prototype.getMinY=function(){return this._miny},J.prototype.getMinX=function(){return this._minx},J.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof x){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof J){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},J.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},J.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},J.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},J.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},J.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},J.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},J.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},J.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},J.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},J.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof J){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof x){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},J.prototype.centre=function(){return this.isNull()?null:new x((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},J.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof x){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof J){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3];s<o?(this._minx=s,this._maxx=o):(this._minx=o,this._maxx=s),a<u?(this._miny=a,this._maxy=u):(this._miny=u,this._maxy=a)}},J.prototype.getMaxY=function(){return this._maxy},J.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),e===0?n:n===0?e:Math.sqrt(e*e+n*n)},J.prototype.hashCode=function(){var t=17;return t=37*t+x.hashCode(this._minx),t=37*t+x.hashCode(this._maxx),t=37*t+x.hashCode(this._miny),t=37*t+x.hashCode(this._maxy),t},J.prototype.interfaces_=function(){return[Pr,Mr]},J.prototype.getClass=function(){return J},J.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],u=Math.min(o.x,a.x),l=Math.max(o.x,a.x),h=Math.min(i.x,s.x),c=Math.max(i.x,s.x);return!(h>l||c<u||(u=Math.min(o.y,a.y),l=Math.max(o.y,a.y),h=Math.min(i.y,s.y),c=Math.max(i.y,s.y),h>l)||c<u)}},um.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(J,um);var tn={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},zl=function(t){this.geometryFactory=t||new dt};zl.prototype.read=function(t){var e,n,i;t=t.replace(/[\n\r]/g," ");var s=tn.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(s=tn.emptyTypeStr.exec(t),s[2]=void 0),s&&(n=s[1].toLowerCase(),i=s[2],Bo[n]&&(e=Bo[n].apply(this,[i]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},zl.prototype.write=function(t){return this.extractGeometry(t)},zl.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!ri[e])return null;var n=e.toUpperCase(),i;return t.isEmpty()?i=n+" EMPTY":i=n+"("+ri[e].apply(this,[t])+")",i};var ri={coordinate:function(t){return t.x+" "+t.y},point:function(t){return ri.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,n=[],i=0,s=t._geometries.length;i<s;++i)n.push("("+ri.point.apply(e,[t._geometries[i]])+")");return n.join(",")},linestring:function(t){for(var e=this,n=[],i=0,s=t._points._coordinates.length;i<s;++i)n.push(ri.coordinate.apply(e,[t._points._coordinates[i]]));return n.join(",")},linearring:function(t){for(var e=this,n=[],i=0,s=t._points._coordinates.length;i<s;++i)n.push(ri.coordinate.apply(e,[t._points._coordinates[i]]));return n.join(",")},multilinestring:function(t){for(var e=this,n=[],i=0,s=t._geometries.length;i<s;++i)n.push("("+ri.linestring.apply(e,[t._geometries[i]])+")");return n.join(",")},polygon:function(t){var e=this,n=[];n.push("("+ri.linestring.apply(this,[t._shell])+")");for(var i=0,s=t._holes.length;i<s;++i)n.push("("+ri.linestring.apply(e,[t._holes[i]])+")");return n.join(",")},multipolygon:function(t){for(var e=this,n=[],i=0,s=t._geometries.length;i<s;++i)n.push("("+ri.polygon.apply(e,[t._geometries[i]])+")");return n.join(",")},geometrycollection:function(t){for(var e=this,n=[],i=0,s=t._geometries.length;i<s;++i)n.push(e.extractGeometry(t._geometries[i]));return n.join(",")}},Bo={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(tn.spaces);return this.geometryFactory.createPoint(new x(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var n,i=t.trim().split(","),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(tn.trimParens,"$1"),s.push(Bo.point.apply(e,[n]));return this.geometryFactory.createMultiPoint(s)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),n=[],i,s=0,o=e.length;s<o;++s)i=e[s].trim().split(tn.spaces),n.push(new x(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(n)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),n=[],i,s=0,o=e.length;s<o;++s)i=e[s].trim().split(tn.spaces),n.push(new x(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var n,i=t.trim().split(tn.parenComma),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(tn.trimParens,"$1"),s.push(Bo.linestring.apply(e,[n]));return this.geometryFactory.createMultiLineString(s)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var n,i,s,o=t.trim().split(tn.parenComma),a,u=[],l=0,h=o.length;l<h;++l)n=o[l].replace(tn.trimParens,"$1"),i=Bo.linestring.apply(e,[n]),s=e.geometryFactory.createLinearRing(i._points),l===0?a=s:u.push(s);return this.geometryFactory.createPolygon(a,u)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var n,i=t.trim().split(tn.doubleParenComma),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(tn.trimParens,"$1"),s.push(Bo.polygon.apply(e,[n]));return this.geometryFactory.createMultiPolygon(s)},geometrycollection:function(t){var e=this;if(t===void 0)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var n=t.trim().split("|"),i=[],s=0,o=n.length;s<o;++s)i.push(e.read(n[s]));return this.geometryFactory.createGeometryCollection(i)}},kr=function(t){this.parser=new zl(t)};kr.prototype.write=function(t){return this.parser.write(t)},kr.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var ni=(function(r){function t(e){r.call(this,e),this.name="RuntimeException",this.message=e,this.stack=new r().stack}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t})(Error),Gl=(function(r){function t(){if(r.call(this),arguments.length===0)r.call(this);else if(arguments.length===1){var e=arguments[0];r.call(this,e)}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(ni),ut=function(){};ut.prototype.interfaces_=function(){return[]},ut.prototype.getClass=function(){return ut},ut.shouldNeverReachHere=function(){if(arguments.length===0)ut.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new Gl("Should never reach here"+(t!==null?": "+t:""))}},ut.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],ut.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new Gl:new Gl(e)},ut.equals=function(){var t,e,n;if(arguments.length===2)t=arguments[0],e=arguments[1],ut.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],n=arguments[2],!e.equals(t)))throw new Gl("Expected "+t+" but encountered "+e+(n!==null?": "+n:""))};var Gt=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new x,this._intPt[1]=new x,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},Vs={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};Gt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},Gt.prototype.getTopologySummary=function(){var t=new Kr;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},Gt.prototype.computeIntersection=function(t,e,n,i){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=i,this._result=this.computeIntersect(t,e,n,i)},Gt.prototype.getIntersectionNum=function(){return this._result},Gt.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var t=arguments[0],e=this.getEdgeDistance(t,0),n=this.getEdgeDistance(t,1);e>n?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},Gt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},Gt.prototype.setPrecisionModel=function(t){this._precisionModel=t},Gt.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],n=0;n<this._result;n++)if(!(t._intPt[n].equals2D(t._inputLines[e][0])||t._intPt[n].equals2D(t._inputLines[e][1])))return!0;return!1}},Gt.prototype.getIntersection=function(t){return this._intPt[t]},Gt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},Gt.prototype.hasIntersection=function(){return this._result!==Gt.NO_INTERSECTION},Gt.prototype.getEdgeDistance=function(t,e){var n=Gt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return n},Gt.prototype.isCollinear=function(){return this._result===Gt.COLLINEAR_INTERSECTION},Gt.prototype.toString=function(){return kr.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+kr.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},Gt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},Gt.prototype.isIntersection=function(t){for(var e=this,n=0;n<this._result;n++)if(e._intPt[n].equals2D(t))return!0;return!1},Gt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.computeEdgeDistance=function(t,e,n){var i=Math.abs(n.x-e.x),s=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))i>s?o=i:o=s;else{var a=Math.abs(t.x-e.x),u=Math.abs(t.y-e.y);i>s?o=a:o=u,o===0&&!t.equals(e)&&(o=Math.max(a,u))}return ut.isTrue(!(o===0&&!t.equals(e)),"Bad distance calculation"),o},Gt.nonRobustComputeEdgeDistance=function(t,e,n){var i=t.x-e.x,s=t.y-e.y,o=Math.sqrt(i*i+s*s);return ut.isTrue(!(o===0&&!t.equals(e)),"Invalid distance calculation"),o},Vs.DONT_INTERSECT.get=function(){return 0},Vs.DO_INTERSECT.get=function(){return 1},Vs.COLLINEAR.get=function(){return 2},Vs.NO_INTERSECTION.get=function(){return 0},Vs.POINT_INTERSECTION.get=function(){return 1},Vs.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(Gt,Vs);var is=(function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(n){var i=new J(this._inputLines[0][0],this._inputLines[0][1]),s=new J(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(n)&&s.contains(n)},t.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];if(this._isProper=!1,J.intersects(i,s,n)&&q.orientationIndex(i,s,n)===0&&q.orientationIndex(s,i,n)===0)return this._isProper=!0,(n.equals(i)||n.equals(s))&&(this._isProper=!1),this._result=r.POINT_INTERSECTION,null;this._result=r.NO_INTERSECTION}else return r.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(n,i,s,o,a){a.x=this.smallestInAbsValue(n.x,i.x,s.x,o.x),a.y=this.smallestInAbsValue(n.y,i.y,s.y,o.y),n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},t.prototype.safeHCoordinateIntersection=function(n,i,s,o){var a=null;try{a=Fr.intersection(n,i,s,o)}catch(u){if(u instanceof Xo)a=t.nearestEndpoint(n,i,s,o);else throw u}finally{}return a},t.prototype.intersection=function(n,i,s,o){var a=this.intersectionWithNormalization(n,i,s,o);return this.isInSegmentEnvelopes(a)||(a=new x(t.nearestEndpoint(n,i,s,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},t.prototype.smallestInAbsValue=function(n,i,s,o){var a=n,u=Math.abs(a);return Math.abs(i)<u&&(a=i,u=Math.abs(i)),Math.abs(s)<u&&(a=s,u=Math.abs(s)),Math.abs(o)<u&&(a=o),a},t.prototype.checkDD=function(n,i,s,o,a){var u=Ge.intersection(n,i,s,o),l=this.isInSegmentEnvelopes(u);fe.out.println("DD in env = "+l+" --------------------- "+u),a.distance(u)>1e-4&&fe.out.println("Distance = "+a.distance(u))},t.prototype.intersectionWithNormalization=function(n,i,s,o){var a=new x(n),u=new x(i),l=new x(s),h=new x(o),c=new x;this.normalizeToEnvCentre(a,u,l,h,c);var f=this.safeHCoordinateIntersection(a,u,l,h);return f.x+=c.x,f.y+=c.y,f},t.prototype.computeCollinearIntersection=function(n,i,s,o){var a=J.intersects(n,i,s),u=J.intersects(n,i,o),l=J.intersects(s,o,n),h=J.intersects(s,o,i);return a&&u?(this._intPt[0]=s,this._intPt[1]=o,r.COLLINEAR_INTERSECTION):l&&h?(this._intPt[0]=n,this._intPt[1]=i,r.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!u&&!h?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):a&&h?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!u&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=o,this._intPt[1]=n,o.equals(n)&&!a&&!h?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&h?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!a&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):r.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(n,i,s,o,a){var u=n.x<i.x?n.x:i.x,l=n.y<i.y?n.y:i.y,h=n.x>i.x?n.x:i.x,c=n.y>i.y?n.y:i.y,f=s.x<o.x?s.x:o.x,p=s.y<o.y?s.y:o.y,m=s.x>o.x?s.x:o.x,_=s.y>o.y?s.y:o.y,E=u>f?u:f,C=h<m?h:m,v=l>p?l:p,y=c<_?c:_,w=(E+C)/2,S=(v+y)/2;a.x=w,a.y=S,n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},t.prototype.computeIntersect=function(n,i,s,o){if(this._isProper=!1,!J.intersects(n,i,s,o))return r.NO_INTERSECTION;var a=q.orientationIndex(n,i,s),u=q.orientationIndex(n,i,o);if(a>0&&u>0||a<0&&u<0)return r.NO_INTERSECTION;var l=q.orientationIndex(s,o,n),h=q.orientationIndex(s,o,i);if(l>0&&h>0||l<0&&h<0)return r.NO_INTERSECTION;var c=a===0&&u===0&&l===0&&h===0;return c?this.computeCollinearIntersection(n,i,s,o):(a===0||u===0||l===0||h===0?(this._isProper=!1,n.equals2D(s)||n.equals2D(o)?this._intPt[0]=n:i.equals2D(s)||i.equals2D(o)?this._intPt[0]=i:a===0?this._intPt[0]=new x(s):u===0?this._intPt[0]=new x(o):l===0?this._intPt[0]=new x(n):h===0&&(this._intPt[0]=new x(i))):(this._isProper=!0,this._intPt[0]=this.intersection(n,i,s,o)),r.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(n,i,s,o){var a=n,u=q.distancePointLine(n,s,o),l=q.distancePointLine(i,s,o);return l<u&&(u=l,a=i),l=q.distancePointLine(s,n,i),l<u&&(u=l,a=s),l=q.distancePointLine(o,n,i),l<u&&(u=l,a=o),a},t})(Gt),Us=function(){};Us.prototype.interfaces_=function(){return[]},Us.prototype.getClass=function(){return Us},Us.orientationIndex=function(t,e,n){var i=e.x-t.x,s=e.y-t.y,o=n.x-e.x,a=n.y-e.y;return Us.signOfDet2x2(i,s,o,a)},Us.signOfDet2x2=function(t,e,n,i){var s=null,o=null,a=null;if(s=1,t===0||i===0)return e===0||n===0?0:e>0?n>0?-s:s:n>0?s:-s;if(e===0||n===0)return i>0?t>0?s:-s:t>0?-s:s;if(e>0?i>0?e<=i||(s=-s,o=t,t=n,n=o,o=e,e=i,i=o):e<=-i?(s=-s,n=-n,i=-i):(o=t,t=-n,n=o,o=e,e=-i,i=o):i>0?-e<=i?(s=-s,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=i,i=o):e>=i?(t=-t,e=-e,n=-n,i=-i):(s=-s,o=-t,t=-n,n=o,o=-e,e=-i,i=o),t>0)if(n>0){if(!(t<=n))return s}else return s;else{if(n>0)return-s;if(t>=n)s=-s,t=-t,n=-n;else return-s}for(;;){if(a=Math.floor(n/t),n=n-a*t,i=i-a*e,i<0)return-s;if(i>e)return s;if(t>n+n){if(e<i+i)return s}else{if(e>i+i)return-s;n=t-n,i=e-i,s=-s}if(i===0)return n===0?0:-s;if(n===0||(a=Math.floor(t/n),t=t-a*n,e=e-a*i,e<0))return s;if(e>i)return-s;if(n>t+t){if(i<e+e)return-s}else{if(i>e+e)return s;t=n-t,e=i-e,s=-s}if(e===0)return t===0?0:s;if(t===0)return-s}};var en=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};en.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,i=e.x;return n>i&&(n=e.x,i=t.x),this._p.x>=n&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var s=t.x-this._p.x,o=t.y-this._p.y,a=e.x-this._p.x,u=e.y-this._p.y,l=Us.signOfDet2x2(s,o,a,u);if(l===0)return this._isPointOnSegment=!0,null;u<o&&(l=-l),l>0&&this._crossingCount++}},en.prototype.isPointInPolygon=function(){return this.getLocation()!==O.EXTERIOR},en.prototype.getLocation=function(){return this._isPointOnSegment?O.BOUNDARY:this._crossingCount%2===1?O.INTERIOR:O.EXTERIOR},en.prototype.isOnSegment=function(){return this._isPointOnSegment},en.prototype.interfaces_=function(){return[]},en.prototype.getClass=function(){return en},en.locatePointInRing=function(){if(arguments[0]instanceof x&&rt(arguments[1],vt)){for(var t=arguments[0],e=arguments[1],n=new en(t),i=new x,s=new x,o=1;o<e.size();o++)if(e.getCoordinate(o,i),e.getCoordinate(o-1,s),n.countSegment(i,s),n.isOnSegment())return n.getLocation();return n.getLocation()}else if(arguments[0]instanceof x&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new en(a),h=1;h<u.length;h++){var c=u[h],f=u[h-1];if(l.countSegment(c,f),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var q=function(){},zs={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};q.prototype.interfaces_=function(){return[]},q.prototype.getClass=function(){return q},q.orientationIndex=function(t,e,n){return Ge.orientationIndex(t,e,n)},q.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,i=1;i<t.length-1;i++){var s=t[i].x-n,o=t[i+1].y,a=t[i-1].y;e+=s*(a-o)}return e/2}else if(rt(arguments[0],vt)){var u=arguments[0],l=u.size();if(l<3)return 0;var h=new x,c=new x,f=new x;u.getCoordinate(0,c),u.getCoordinate(1,f);var p=c.x;f.x-=p;for(var m=0,_=1;_<l-1;_++)h.y=c.y,c.x=f.x,c.y=f.y,u.getCoordinate(_+1,f),f.x-=p,m+=c.x*(h.y-f.y);return m/2}},q.distanceLineLine=function(t,e,n,i){if(t.equals(e))return q.distancePointLine(t,n,i);if(n.equals(i))return q.distancePointLine(i,t,e);var s=!1;if(!J.intersects(t,e,n,i))s=!0;else{var o=(e.x-t.x)*(i.y-n.y)-(e.y-t.y)*(i.x-n.x);if(o===0)s=!0;else{var a=(t.y-n.y)*(i.x-n.x)-(t.x-n.x)*(i.y-n.y),u=(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y),l=u/o,h=a/o;(h<0||h>1||l<0||l>1)&&(s=!0)}}return s?dr.min(q.distancePointLine(t,n,i),q.distancePointLine(e,n,i),q.distancePointLine(n,t,e),q.distancePointLine(i,t,e)):0},q.isPointInRing=function(t,e){return q.locatePointInRing(t,e)!==O.EXTERIOR},q.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new x;t.getCoordinate(0,i);for(var s=i.x,o=i.y,a=1;a<e;a++){t.getCoordinate(a,i);var u=i.x,l=i.y,h=u-s,c=l-o;n+=Math.sqrt(h*h+c*c),s=u,o=l}return n},q.isCCW=function(t){var e=t.length-1;if(e<3)throw new zt("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],i=0,s=1;s<=e;s++){var o=t[s];o.y>n.y&&(n=o,i=s)}var a=i;do a=a-1,a<0&&(a=e);while(t[a].equals2D(n)&&a!==i);var u=i;do u=(u+1)%e;while(t[u].equals2D(n)&&u!==i);var l=t[a],h=t[u];if(l.equals2D(n)||h.equals2D(n)||l.equals2D(h))return!1;var c=q.computeOrientation(l,n,h),f=!1;return c===0?f=l.x>h.x:f=c>0,f},q.locatePointInRing=function(t,e){return en.locatePointInRing(t,e)},q.distancePointLinePerpendicular=function(t,e,n){var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),s=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i;return Math.abs(s)*Math.sqrt(i)},q.computeOrientation=function(t,e,n){return q.orientationIndex(t,e,n)},q.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new zt("Line array must contain at least one vertex");for(var n=t.distance(e[0]),i=0;i<e.length-1;i++){var s=q.distancePointLine(t,e[i],e[i+1]);s<n&&(n=s)}return n}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];if(a.x===u.x&&a.y===u.y)return o.distance(a);var l=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),h=((o.x-a.x)*(u.x-a.x)+(o.y-a.y)*(u.y-a.y))/l;if(h<=0)return o.distance(a);if(h>=1)return o.distance(u);var c=((a.y-o.y)*(u.x-a.x)-(a.x-o.x)*(u.y-a.y))/l;return Math.abs(c)*Math.sqrt(l)}},q.isOnLine=function(t,e){for(var n=new is,i=1;i<e.length;i++){var s=e[i-1],o=e[i];if(n.computeIntersection(t,s,o),n.hasIntersection())return!0}return!1},zs.CLOCKWISE.get=function(){return-1},zs.RIGHT.get=function(){return q.CLOCKWISE},zs.COUNTERCLOCKWISE.get=function(){return 1},zs.LEFT.get=function(){return q.COUNTERCLOCKWISE},zs.COLLINEAR.get=function(){return 0},zs.STRAIGHT.get=function(){return q.COLLINEAR},Object.defineProperties(q,zs);var ii=function(){};ii.prototype.filter=function(t){},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii};var tt=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},On={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};tt.prototype.isGeometryCollection=function(){return this.getSortIndex()===tt.SORTINDEX_GEOMETRYCOLLECTION},tt.prototype.getFactory=function(){return this._factory},tt.prototype.getGeometryN=function(t){return this},tt.prototype.getArea=function(){return 0},tt.prototype.isRectangle=function(){return!1},tt.prototype.equals=function(){if(arguments[0]instanceof tt){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof tt))return!1;var n=e;return this.equalsExact(n)}},tt.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},tt.prototype.geometryChanged=function(){this.apply(tt.geometryChangedFilter)},tt.prototype.geometryChangedAction=function(){this._envelope=null},tt.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())},tt.prototype.getLength=function(){return 0},tt.prototype.getNumGeometries=function(){return 1},tt.prototype.compareTo=function(){if(arguments.length===1){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,i)}},tt.prototype.getUserData=function(){return this._userData},tt.prototype.getSRID=function(){return this._SRID},tt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},tt.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===tt.SORTINDEX_GEOMETRYCOLLECTION)throw new zt("This method does not support GeometryCollection arguments")},tt.prototype.equal=function(t,e,n){return n===0?t.equals(e):t.distance(e)<=n},tt.prototype.norm=function(){var t=this.copy();return t.normalize(),t},tt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},tt.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new J(this._envelope)},tt.prototype.setSRID=function(t){this._SRID=t},tt.prototype.setUserData=function(t){this._userData=t},tt.prototype.compare=function(t,e){for(var n=t.iterator(),i=e.iterator();n.hasNext()&&i.hasNext();){var s=n.next(),o=i.next(),a=s.compareTo(o);if(a!==0)return a}return n.hasNext()?1:i.hasNext()?-1:0},tt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},tt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===tt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===tt.SORTINDEX_MULTIPOINT||this.getSortIndex()===tt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===tt.SORTINDEX_MULTIPOLYGON},tt.prototype.interfaces_=function(){return[Ul,Pr,Mr]},tt.prototype.getClass=function(){return tt},tt.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},tt.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},On.serialVersionUID.get=function(){return 8763622679187377e3},On.SORTINDEX_POINT.get=function(){return 0},On.SORTINDEX_MULTIPOINT.get=function(){return 1},On.SORTINDEX_LINESTRING.get=function(){return 2},On.SORTINDEX_LINEARRING.get=function(){return 3},On.SORTINDEX_MULTILINESTRING.get=function(){return 4},On.SORTINDEX_POLYGON.get=function(){return 5},On.SORTINDEX_MULTIPOLYGON.get=function(){return 6},On.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},On.geometryChangedFilter.get=function(){return Ac},Object.defineProperties(tt,On);var Ac=function(){};Ac.interfaces_=function(){return[ii]},Ac.filter=function(t){t.geometryChangedAction()};var Dn=function(){};Dn.prototype.filter=function(t){},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn};var br=function(){},si={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};br.prototype.isInBoundary=function(t){},br.prototype.interfaces_=function(){return[]},br.prototype.getClass=function(){return br},si.Mod2BoundaryNodeRule.get=function(){return Ho},si.EndPointBoundaryNodeRule.get=function(){return Yo},si.MultiValentEndPointBoundaryNodeRule.get=function(){return Jo},si.MonoValentEndPointBoundaryNodeRule.get=function(){return jo},si.MOD2_BOUNDARY_RULE.get=function(){return new Ho},si.ENDPOINT_BOUNDARY_RULE.get=function(){return new Yo},si.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Jo},si.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new jo},si.OGC_SFS_BOUNDARY_RULE.get=function(){return br.MOD2_BOUNDARY_RULE},Object.defineProperties(br,si);var Ho=function(){};Ho.prototype.isInBoundary=function(t){return t%2===1},Ho.prototype.interfaces_=function(){return[br]},Ho.prototype.getClass=function(){return Ho};var Yo=function(){};Yo.prototype.isInBoundary=function(t){return t>0},Yo.prototype.interfaces_=function(){return[br]},Yo.prototype.getClass=function(){return Yo};var Jo=function(){};Jo.prototype.isInBoundary=function(t){return t>1},Jo.prototype.interfaces_=function(){return[br]},Jo.prototype.getClass=function(){return Jo};var jo=function(){};jo.prototype.isInBoundary=function(t){return t===1},jo.prototype.interfaces_=function(){return[br]},jo.prototype.getClass=function(){return jo};var ee=function(){};ee.prototype.add=function(){},ee.prototype.addAll=function(){},ee.prototype.isEmpty=function(){},ee.prototype.iterator=function(){},ee.prototype.size=function(){},ee.prototype.toArray=function(){},ee.prototype.remove=function(){};function Lc(r){this.message=r||""}Lc.prototype=new Error,Lc.prototype.name="IndexOutOfBoundsException";var Qo=function(){};Qo.prototype.hasNext=function(){},Qo.prototype.next=function(){},Qo.prototype.remove=function(){};var Vr=(function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t})(ee);function $o(r){this.message=r||""}$o.prototype=new Error,$o.prototype.name="NoSuchElementException";var G=(function(r){function t(){r.call(this),this.array_=[],arguments[0]instanceof ee&&this.addAll(arguments[0])}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[r,ee]},t.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(n){for(var i=this,s=n.iterator();s.hasNext();)i.add(s.next());return!0},t.prototype.set=function(n,i){var s=this.array_[n];return this.array_[n]=i,s},t.prototype.iterator=function(){return new jC(this)},t.prototype.get=function(n){if(n<0||n>=this.size())throw new Lc;return this.array_[n]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var n=this,i=[],s=0,o=this.array_.length;s<o;s++)i.push(n.array_[s]);return i},t.prototype.remove=function(n){for(var i=this,s=!1,o=0,a=this.array_.length;o<a;o++)if(i.array_[o]===n){i.array_.splice(o,1),s=!0;break}return s},t})(Vr),jC=(function(r){function t(e){r.call(this),this.arrayList_=e,this.position_=0}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new $o;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(n){return this.arrayList_.set(this.position_-1,n)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t})(Qo),xu=(function(r){function t(){if(r.call(this),arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.ensureCapacity(n.length),this.add(n,!0)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.ensureCapacity(i.length),this.add(i,s)}}}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={coordArrayType:{configurable:!0}};return e.coordArrayType.get=function(){return new Array(0).fill(null)},t.prototype.getCoordinate=function(i){return this.get(i)},t.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=!1,u=s.iterator();u.hasNext();)i.add(u.next(),o),a=!0;return a}else return r.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var i=this,s=r.prototype.clone.call(this),o=0;o<this.size();o++)s.add(o,i.get(o).copy());return s},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var i=this;if(arguments.length===1){var s=arguments[0];r.prototype.add.call(this,s)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1];return this.add(o,a,!0),!0}else if(arguments[0]instanceof x&&typeof arguments[1]=="boolean"){var u=arguments[0],l=arguments[1];if(!l&&this.size()>=1){var h=this.get(this.size()-1);if(h.equals2D(u))return null}r.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var c=arguments[0],f=arguments[1];return this.add(c,f),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var p=arguments[0],m=arguments[1],_=arguments[2];if(_)for(var E=0;E<p.length;E++)i.add(p[E],m);else for(var C=p.length-1;C>=0;C--)i.add(p[C],m);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof x){var v=arguments[0],y=arguments[1],w=arguments[2];if(!w){var S=this.size();if(S>0){if(v>0){var P=this.get(v-1);if(P.equals2D(y))return null}if(v<S){var M=this.get(v);if(M.equals2D(y))return null}}}r.prototype.add.call(this,v,y)}}else if(arguments.length===4){var b=arguments[0],D=arguments[1],F=arguments[2],N=arguments[3],L=1;F>N&&(L=-1);for(var A=F;A!==N;A+=L)i.add(b[A],D);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new x(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t})(G),ft=function(){},ql={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};ql.ForwardComparator.get=function(){return Nu},ql.BidirectionalComparator.get=function(){return Ko},ql.coordArrayType.get=function(){return new Array(0).fill(null)},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft},ft.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},ft.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(ft.indexOf(i,e)<0)return i}return null},ft.scroll=function(t,e){var n=ft.indexOf(e,t);if(n<0)return null;var i=new Array(t.length).fill(null);fe.arraycopy(t,n,i,0,t.length-n),fe.arraycopy(t,0,i,t.length-n,n),fe.arraycopy(i,0,t,0,t.length)},ft.equals=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];if(i===s)return!0;if(i===null||s===null||i.length!==s.length)return!1;for(var a=0;a<i.length;a++)if(o.compare(i[a],s[a])!==0)return!1;return!0}},ft.intersection=function(t,e){for(var n=new xu,i=0;i<t.length;i++)e.intersects(t[i])&&n.add(t[i],!0);return n.toCoordinateArray()},ft.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},ft.removeRepeatedPoints=function(t){if(!ft.hasRepeatedPoints(t))return t;var e=new xu(t,!1);return e.toCoordinateArray()},ft.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),i=0;i<=n;i++){var s=t[i];t[i]=t[e-i],t[e-i]=s}},ft.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)t[n]!==null&&e++;var i=new Array(e).fill(null);if(e===0)return i;for(var s=0,o=0;o<t.length;o++)t[o]!==null&&(i[s++]=t[o]);return i},ft.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new x(t[n]);return e}else if(arguments.length===5)for(var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],u=arguments[4],l=0;l<u;l++)o[a+l]=new x(i[s+l])},ft.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],s=e[t.length-n-1];if(i.compareTo(s)!==0)return!1}return!0},ft.envelope=function(t){for(var e=new J,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},ft.toCoordinateArray=function(t){return t.toArray(ft.coordArrayType)},ft.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},ft.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},ft.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,i=t[e].compareTo(t[n]);if(i!==0)return i}return 1},ft.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var i=t[n].compareTo(e[n]);if(i!==0)return i;n++}return n<e.length?-1:n<t.length?1:0},ft.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(e===null||e.compareTo(t[n])>0)&&(e=t[n]);return e},ft.extract=function(t,e,n){e=dr.clamp(e,0,t.length),n=dr.clamp(n,-1,t.length);var i=n-e+1;n<0&&(i=0),e>=t.length&&(i=0),n<e&&(i=0);var s=new Array(i).fill(null);if(i===0)return s;for(var o=0,a=e;a<=n;a++)s[o++]=t[a];return s},Object.defineProperties(ft,ql);var Nu=function(){};Nu.prototype.compare=function(t,e){var n=t,i=e;return ft.compare(n,i)},Nu.prototype.interfaces_=function(){return[qo]},Nu.prototype.getClass=function(){return Nu};var Ko=function(){};Ko.prototype.compare=function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;var s=ft.compare(n,i),o=ft.isEqualReversed(n,i);return o?0:s},Ko.prototype.OLDcompare=function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;for(var s=ft.increasingDirection(n),o=ft.increasingDirection(i),a=s>0?0:n.length-1,u=o>0?0:n.length-1,l=0;l<n.length;l++){var h=n[a].compareTo(i[u]);if(h!==0)return h;a+=s,u+=o}return 0},Ko.prototype.interfaces_=function(){return[qo]},Ko.prototype.getClass=function(){return Ko};var Gs=function(){};Gs.prototype.get=function(){},Gs.prototype.put=function(){},Gs.prototype.size=function(){},Gs.prototype.values=function(){},Gs.prototype.entrySet=function(){};var QC=(function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t})(Gs);function Tu(r){this.message=r||""}Tu.prototype=new Error,Tu.prototype.name="OperationNotSupported";function Wl(){}Wl.prototype=new ee,Wl.prototype.contains=function(){};var Rc=(function(r){function t(){r.call(this),this.array_=[],arguments[0]instanceof ee&&this.addAll(arguments[0])}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.contains=function(n){for(var i=this,s=0,o=this.array_.length;s<o;s++){var a=i.array_[s];if(a===n)return!0}return!1},t.prototype.add=function(n){return this.contains(n)?!1:(this.array_.push(n),!0)},t.prototype.addAll=function(n){for(var i=this,s=n.iterator();s.hasNext();)i.add(s.next());return!0},t.prototype.remove=function(n){throw new Error},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.toArray=function(){for(var n=this,i=[],s=0,o=this.array_.length;s<o;s++)i.push(n.array_[s]);return i},t.prototype.iterator=function(){return new $C(this)},t})(Wl),$C=(function(r){function t(e){r.call(this),this.hashSet_=e,this.position_=0}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new $o;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new Tu},t})(Qo),oi=0,ss=1;function lm(r){return r===null?oi:r.color}function Nt(r){return r===null?null:r.parent}function ai(r,t){r!==null&&(r.color=t)}function Fc(r){return r===null?null:r.left}function hm(r){return r===null?null:r.right}function Ee(){this.root_=null,this.size_=0}Ee.prototype=new QC,Ee.prototype.get=function(r){for(var t=this.root_;t!==null;){var e=r.compareTo(t.key);if(e<0)t=t.left;else if(e>0)t=t.right;else return t.value}return null},Ee.prototype.put=function(r,t){if(this.root_===null)return this.root_={key:r,value:t,left:null,right:null,parent:null,color:oi,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,n,i;do if(n=e,i=r.compareTo(e.key),i<0)e=e.left;else if(i>0)e=e.right;else{var s=e.value;return e.value=t,s}while(e!==null);var o={key:r,left:null,right:null,value:t,parent:n,color:oi,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=o:n.right=o,this.fixAfterInsertion(o),this.size_++,null},Ee.prototype.fixAfterInsertion=function(r){var t=this;for(r.color=ss;r!=null&&r!==this.root_&&r.parent.color===ss;)if(Nt(r)===Fc(Nt(Nt(r)))){var e=hm(Nt(Nt(r)));lm(e)===ss?(ai(Nt(r),oi),ai(e,oi),ai(Nt(Nt(r)),ss),r=Nt(Nt(r))):(r===hm(Nt(r))&&(r=Nt(r),t.rotateLeft(r)),ai(Nt(r),oi),ai(Nt(Nt(r)),ss),t.rotateRight(Nt(Nt(r))))}else{var n=Fc(Nt(Nt(r)));lm(n)===ss?(ai(Nt(r),oi),ai(n,oi),ai(Nt(Nt(r)),ss),r=Nt(Nt(r))):(r===Fc(Nt(r))&&(r=Nt(r),t.rotateRight(r)),ai(Nt(r),oi),ai(Nt(Nt(r)),ss),t.rotateLeft(Nt(Nt(r))))}this.root_.color=oi},Ee.prototype.values=function(){var r=new G,t=this.getFirstEntry();if(t!==null)for(r.add(t.value);(t=Ee.successor(t))!==null;)r.add(t.value);return r},Ee.prototype.entrySet=function(){var r=new Rc,t=this.getFirstEntry();if(t!==null)for(r.add(t);(t=Ee.successor(t))!==null;)r.add(t);return r},Ee.prototype.rotateLeft=function(r){if(r!=null){var t=r.right;r.right=t.left,t.left!=null&&(t.left.parent=r),t.parent=r.parent,r.parent===null?this.root_=t:r.parent.left===r?r.parent.left=t:r.parent.right=t,t.left=r,r.parent=t}},Ee.prototype.rotateRight=function(r){if(r!=null){var t=r.left;r.left=t.right,t.right!=null&&(t.right.parent=r),t.parent=r.parent,r.parent===null?this.root_=t:r.parent.right===r?r.parent.right=t:r.parent.left=t,t.right=r,r.parent=t}},Ee.prototype.getFirstEntry=function(){var r=this.root_;if(r!=null)for(;r.left!=null;)r=r.left;return r},Ee.successor=function(r){if(r===null)return null;if(r.right!==null){for(var t=r.right;t.left!==null;)t=t.left;return t}else{for(var e=r.parent,n=r;e!==null&&n===e.right;)n=e,e=e.parent;return e}},Ee.prototype.size=function(){return this.size_};var Ou=function(){};Ou.prototype.interfaces_=function(){return[]},Ou.prototype.getClass=function(){return Ou};function cm(){}cm.prototype=new Wl;function rn(){this.array_=[],arguments[0]instanceof ee&&this.addAll(arguments[0])}rn.prototype=new cm,rn.prototype.contains=function(r){for(var t=this,e=0,n=this.array_.length;e<n;e++){var i=t.array_[e];if(i.compareTo(r)===0)return!0}return!1},rn.prototype.add=function(r){var t=this;if(this.contains(r))return!1;for(var e=0,n=this.array_.length;e<n;e++){var i=t.array_[e];if(i.compareTo(r)===1)return t.array_.splice(e,0,r),!0}return this.array_.push(r),!0},rn.prototype.addAll=function(r){for(var t=this,e=r.iterator();e.hasNext();)t.add(e.next());return!0},rn.prototype.remove=function(r){throw new Tu},rn.prototype.size=function(){return this.array_.length},rn.prototype.isEmpty=function(){return this.array_.length===0},rn.prototype.toArray=function(){for(var r=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(r.array_[e]);return t},rn.prototype.iterator=function(){return new Xl(this)};var Xl=function(r){this.treeSet_=r,this.position_=0};Xl.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new $o;return this.treeSet_.array_[this.position_++]},Xl.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Xl.prototype.remove=function(){throw new Tu};var os=function(){};os.sort=function(){var t=arguments[0],e,n,i,s;if(arguments.length===1)s=function(a,u){return a.compareTo(u)},t.sort(s);else if(arguments.length===2)i=arguments[1],s=function(a,u){return i.compare(a,u)},t.sort(s);else if(arguments.length===3){n=t.slice(arguments[1],arguments[2]),n.sort();var o=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length));for(t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])}else if(arguments.length===4)for(n=t.slice(arguments[1],arguments[2]),i=arguments[3],s=function(a,u){return i.compare(a,u)},n.sort(s),o=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])},os.asList=function(t){for(var e=new G,n=0,i=t.length;n<i;n++)e.add(t[n]);return e};var Et=function(){},Ur={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Ur.P.get=function(){return 0},Ur.L.get=function(){return 1},Ur.A.get=function(){return 2},Ur.FALSE.get=function(){return-1},Ur.TRUE.get=function(){return-2},Ur.DONTCARE.get=function(){return-3},Ur.SYM_FALSE.get=function(){return"F"},Ur.SYM_TRUE.get=function(){return"T"},Ur.SYM_DONTCARE.get=function(){return"*"},Ur.SYM_P.get=function(){return"0"},Ur.SYM_L.get=function(){return"1"},Ur.SYM_A.get=function(){return"2"},Et.prototype.interfaces_=function(){return[]},Et.prototype.getClass=function(){return Et},Et.toDimensionSymbol=function(t){switch(t){case Et.FALSE:return Et.SYM_FALSE;case Et.TRUE:return Et.SYM_TRUE;case Et.DONTCARE:return Et.SYM_DONTCARE;case Et.P:return Et.SYM_P;case Et.L:return Et.SYM_L;case Et.A:return Et.SYM_A}throw new zt("Unknown dimension value: "+t)},Et.toDimensionValue=function(t){switch(Mu.toUpperCase(t)){case Et.SYM_FALSE:return Et.FALSE;case Et.SYM_TRUE:return Et.TRUE;case Et.SYM_DONTCARE:return Et.DONTCARE;case Et.SYM_P:return Et.P;case Et.SYM_L:return Et.L;case Et.SYM_A:return Et.A}throw new zt("Unknown dimension symbol: "+t)},Object.defineProperties(Et,Ur);var nn=function(){};nn.prototype.filter=function(t){},nn.prototype.interfaces_=function(){return[]},nn.prototype.getClass=function(){return nn};var zr=function(){};zr.prototype.filter=function(t,e){},zr.prototype.isDone=function(){},zr.prototype.isGeometryChanged=function(){},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr};var xe=(function(r){function t(n,i){if(r.call(this,i),this._geometries=n||[],r.hasNullElements(this._geometries))throw new zt("geometries must not contain null elements")}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var i=this,s=new J,o=0;o<this._geometries.length;o++)s.expandToInclude(i._geometries[o].getEnvelopeInternal());return s},t.prototype.getGeometryN=function(i){return this._geometries[i]},t.prototype.getSortIndex=function(){return r.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var i=this,s=new Array(this.getNumPoints()).fill(null),o=-1,a=0;a<this._geometries.length;a++)for(var u=i._geometries[a].getCoordinates(),l=0;l<u.length;l++)o++,s[o]=u[l];return s},t.prototype.getArea=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getArea();return s},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;if(this._geometries.length!==a._geometries.length)return!1;for(var u=0;u<this._geometries.length;u++)if(!i._geometries[u].equalsExact(a._geometries[u],o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,s=0;s<this._geometries.length;s++)i._geometries[s].normalize();os.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var i=this,s=Et.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,i._geometries[o].getBoundaryDimension());return s},t.prototype.getDimension=function(){for(var i=this,s=Et.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,i._geometries[o].getDimension());return s},t.prototype.getLength=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getLength();return s},t.prototype.getNumPoints=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getNumPoints();return s},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=i._geometries[a].reverse();return this.getFactory().createGeometryCollection(o)},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var s=arguments[0],o=new rn(os.asList(this._geometries)),a=new rn(os.asList(s._geometries));return this.compare(o,a)}else if(arguments.length===2){for(var u=arguments[0],l=arguments[1],h=u,c=this.getNumGeometries(),f=h.getNumGeometries(),p=0;p<c&&p<f;){var m=i.getGeometryN(p),_=h.getGeometryN(p),E=m.compareToSameClass(_,l);if(E!==0)return E;p++}return p<c?1:p<f?-1:0}},t.prototype.apply=function(){var i=this;if(rt(arguments[0],Dn))for(var s=arguments[0],o=0;o<this._geometries.length;o++)i._geometries[o].apply(s);else if(rt(arguments[0],zr)){var a=arguments[0];if(this._geometries.length===0)return null;for(var u=0;u<this._geometries.length&&(i._geometries[u].apply(a),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(rt(arguments[0],nn)){var l=arguments[0];l.filter(this);for(var h=0;h<this._geometries.length;h++)i._geometries[h].apply(l)}else if(rt(arguments[0],ii)){var c=arguments[0];c.filter(this);for(var f=0;f<this._geometries.length;f++)i._geometries[f].apply(c)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),ut.shouldNeverReachHere(),null},t.prototype.clone=function(){var i=this,s=r.prototype.clone.call(this);s._geometries=new Array(this._geometries.length).fill(null);for(var o=0;o<this._geometries.length;o++)s._geometries[o]=i._geometries[o].clone();return s},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new t(s,this._factory)},t.prototype.isEmpty=function(){for(var i=this,s=0;s<this._geometries.length;s++)if(!i._geometries[s].isEmpty())return!1;return!0},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(t,e),t})(tt),as=(function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return tt.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Et.FALSE:0},t.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var s=0;s<this._geometries.length;s++)if(!i._geometries[s].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[s-1-a]=i._geometries[a].reverse();return this.getFactory().createMultiLineString(o)},t.prototype.getBoundary=function(){return new xr(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[Ou]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t})(xe),xr=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=br.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}};xr.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return e.length===1?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},xr.prototype.getBoundary=function(){return this._geom instanceof Wt?this.boundaryLineString(this._geom):this._geom instanceof as?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},xr.prototype.boundaryLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this._bnRule.isInBoundary(2);return e?t.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},xr.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},xr.prototype.computeBoundaryCoordinates=function(t){var e=this,n=new G;this._endpointMap=new Ee;for(var i=0;i<t.getNumGeometries();i++){var s=t.getGeometryN(i);s.getNumPoints()!==0&&(e.addEndpoint(s.getCoordinateN(0)),e.addEndpoint(s.getCoordinateN(s.getNumPoints()-1)))}for(var o=this._endpointMap.entrySet().iterator();o.hasNext();){var a=o.next(),u=a.getValue(),l=u.count;e._bnRule.isInBoundary(l)&&n.add(a.getKey())}return ft.toCoordinateArray(n)},xr.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new Bl,this._endpointMap.put(t,e)),e.count++},xr.prototype.interfaces_=function(){return[]},xr.prototype.getClass=function(){return xr},xr.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new xr(t);return e.getBoundary()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=new xr(n,i);return s.getBoundary()}};var Bl=function(){this.count=null};Bl.prototype.interfaces_=function(){return[]},Bl.prototype.getClass=function(){return Bl};function KC(){}function ZC(){}var tI=function(){};function eI(){}function rI(){}function nI(){}var Nr=function(){},kc={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr},Nr.chars=function(t,e){for(var n=new Array(e).fill(null),i=0;i<e;i++)n[i]=t;return String(n)},Nr.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new eI,n=new KC;return t.printStackTrace(n),e.toString()}else if(arguments.length===2){var i=arguments[0],s=arguments[1],o="";new ZC(Nr.getStackTrace(i));for(var a=new nI,u=0;u<s;u++)try{o+=a.readLine()+Nr.NEWLINE}catch(l){if(l instanceof rI)ut.shouldNeverReachHere();else throw l}finally{}return o}},Nr.split=function(t,e){for(var n=e.length,i=new G,s=""+t,o=s.indexOf(e);o>=0;){var a=s.substring(0,o);i.add(a),s=s.substring(o+n),o=s.indexOf(e)}s.length>0&&i.add(s);for(var u=new Array(i.size()).fill(null),l=0;l<u.length;l++)u[l]=i.get(l);return u},Nr.toString=function(){if(arguments.length===1){var t=arguments[0];return Nr.SIMPLE_ORDINATE_FORMAT.format(t)}},Nr.spaces=function(t){return Nr.chars(" ",t)},kc.NEWLINE.get=function(){return fe.getProperty("line.separator")},kc.SIMPLE_ORDINATE_FORMAT.get=function(){return new tI},Object.defineProperties(Nr,kc);var Ht=function(){};Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.copyCoord=function(t,e,n,i){for(var s=Math.min(t.getDimension(),n.getDimension()),o=0;o<s;o++)n.setOrdinate(i,o,t.getOrdinate(e,o))},Ht.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,vt.X)===t.getOrdinate(e-1,vt.X)&&t.getOrdinate(0,vt.Y)===t.getOrdinate(e-1,vt.Y)},Ht.isEqual=function(t,e){var n=t.size(),i=e.size();if(n!==i)return!1;for(var s=Math.min(t.getDimension(),e.getDimension()),o=0;o<n;o++)for(var a=0;a<s;a++){var u=t.getOrdinate(o,a),l=e.getOrdinate(o,a);if(t.getOrdinate(o,a)!==e.getOrdinate(o,a)&&!(st.isNaN(u)&&st.isNaN(l)))return!1}return!0},Ht.extend=function(t,e,n){var i=t.create(n,e.getDimension()),s=e.size();if(Ht.copy(e,0,i,0,s),s>0)for(var o=s;o<n;o++)Ht.copy(e,s-1,i,o,1);return i},Ht.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),i=0;i<=n;i++)Ht.swap(t,i,e-i)},Ht.swap=function(t,e,n){if(e===n)return null;for(var i=0;i<t.getDimension();i++){var s=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(n,i)),t.setOrdinate(n,i,s)}},Ht.copy=function(t,e,n,i,s){for(var o=0;o<s;o++)Ht.copyCoord(t,e+o,n,i+o)},Ht.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var n=t.getDimension(),i=new Kr;i.append("(");for(var s=0;s<e;s++){s>0&&i.append(" ");for(var o=0;o<n;o++)o>0&&i.append(","),i.append(Nr.toString(t.getOrdinate(s,o)))}return i.append(")"),i.toString()}},Ht.ensureValidRing=function(t,e){var n=e.size();if(n===0)return e;if(n<=3)return Ht.createClosedRing(t,e,4);var i=e.getOrdinate(0,vt.X)===e.getOrdinate(n-1,vt.X)&&e.getOrdinate(0,vt.Y)===e.getOrdinate(n-1,vt.Y);return i?e:Ht.createClosedRing(t,e,n+1)},Ht.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),s=e.size();Ht.copy(e,0,i,0,s);for(var o=s;o<n;o++)Ht.copy(e,0,i,o,1);return i};var Wt=(function(r){function t(n,i){r.call(this,i),this._points=null,this.init(n)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new J:this._points.expandEnvelope(new J)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return r.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;if(this._points.size()!==a._points.size())return!1;for(var u=0;u<this._points.size();u++)if(!i.equal(i._points.getCoordinate(u),a._points.getCoordinate(u),o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,s=0;s<Math.trunc(this._points.size()/2);s++){var o=i._points.size()-1-s;if(!i._points.getCoordinate(s).equals(i._points.getCoordinate(o)))return i._points.getCoordinate(s).compareTo(i._points.getCoordinate(o))>0&&Ht.reverse(i._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Et.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return q.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var i=this._points.copy();Ht.reverse(i);var s=this.getFactory().createLineString(i);return s},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var s=arguments[0],o=s,a=0,u=0;a<this._points.size()&&u<o._points.size();){var l=i._points.getCoordinate(a).compareTo(o._points.getCoordinate(u));if(l!==0)return l;a++,u++}return a<this._points.size()?1:u<o._points.size()?-1:0}else if(arguments.length===2){var h=arguments[0],c=arguments[1],f=h;return c.compare(this._points,f._points)}},t.prototype.apply=function(){var i=this;if(rt(arguments[0],Dn))for(var s=arguments[0],o=0;o<this._points.size();o++)s.filter(i._points.getCoordinate(o));else if(rt(arguments[0],zr)){var a=arguments[0];if(this._points.size()===0)return null;for(var u=0;u<this._points.size()&&(a.filter(i._points,u),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(rt(arguments[0],nn)){var l=arguments[0];l.filter(this)}else if(rt(arguments[0],ii)){var h=arguments[0];h.filter(this)}},t.prototype.getBoundary=function(){return new xr(this).getBoundary()},t.prototype.isEquivalentClass=function(i){return i instanceof t},t.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._points=this._points.clone(),i},t.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return this._points.size()===0},t.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new zt("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},t.prototype.isCoordinate=function(i){for(var s=this,o=0;o<this._points.size();o++)if(s._points.getCoordinate(o).equals(i))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},t.prototype.interfaces_=function(){return[Ou]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t})(tt),Du=function(){};Du.prototype.interfaces_=function(){return[]},Du.prototype.getClass=function(){return Du};var Ze=(function(r){function t(n,i){r.call(this,i),this._coordinates=n||null,this.init(this._coordinates)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new J;var i=new J;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},t.prototype.getSortIndex=function(){return r.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),s):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){},t.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},t.prototype.getBoundaryDimension=function(){return Et.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getNumPoints=function(){return this.isEmpty()?0:1},t.prototype.reverse=function(){return this.copy()},t.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},t.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],s=i;return this.getCoordinate().compareTo(s.getCoordinate())}else if(arguments.length===2){var o=arguments[0],a=arguments[1],u=o;return a.compare(this._coordinates,u._coordinates)}},t.prototype.apply=function(){if(rt(arguments[0],Dn)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(rt(arguments[0],zr)){var s=arguments[0];if(this.isEmpty())return null;s.filter(this._coordinates,0),s.isGeometryChanged()&&this.geometryChanged()}else if(rt(arguments[0],nn)){var o=arguments[0];o.filter(this)}else if(rt(arguments[0],ii)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},t.prototype.getGeometryType=function(){return"Point"},t.prototype.copy=function(){return new t(this._coordinates.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._coordinates},t.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},t.prototype.isEmpty=function(){return this._coordinates.size()===0},t.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),ut.isTrue(i.size()<=1),this._coordinates=i},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[Du]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t})(tt),Ti=function(){};Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti};var re=(function(r){function t(n,i,s){if(r.call(this,s),this._shell=null,this._holes=null,n===null&&(n=this.getFactory().createLinearRing()),i===null&&(i=[]),r.hasNullElements(i))throw new zt("holes must not contain null elements");if(n.isEmpty()&&r.hasNonEmptyElements(i))throw new zt("shell is empty but holes are not");this._shell=n,this._holes=i}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return r.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var s=new Array(this.getNumPoints()).fill(null),o=-1,a=this._shell.getCoordinates(),u=0;u<a.length;u++)o++,s[o]=a[u];for(var l=0;l<this._holes.length;l++)for(var h=i._holes[l].getCoordinates(),c=0;c<h.length;c++)o++,s[o]=h[c];return s},t.prototype.getArea=function(){var i=this,s=0;s+=Math.abs(q.signedArea(this._shell.getCoordinateSequence()));for(var o=0;o<this._holes.length;o++)s-=Math.abs(q.signedArea(i._holes[o].getCoordinateSequence()));return s},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),s=this.getEnvelopeInternal(),o=0;o<5;o++){var a=i.getX(o);if(!(a===s.getMinX()||a===s.getMaxX()))return!1;var u=i.getY(o);if(!(u===s.getMinY()||u===s.getMaxY()))return!1}for(var l=i.getX(0),h=i.getY(0),c=1;c<=4;c++){var f=i.getX(c),p=i.getY(c),m=f!==l,_=p!==h;if(m===_)return!1;l=f,h=p}return!0},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s,u=this._shell,l=a._shell;if(!u.equalsExact(l,o)||this._holes.length!==a._holes.length)return!1;for(var h=0;h<this._holes.length;h++)if(!i._holes[h].equalsExact(a._holes[h],o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var s=0;s<this._holes.length;s++)i.normalize(i._holes[s],!1);os.sort(this._holes)}else if(arguments.length===2){var o=arguments[0],a=arguments[1];if(o.isEmpty())return null;var u=new Array(o.getCoordinates().length-1).fill(null);fe.arraycopy(o.getCoordinates(),0,u,0,u.length);var l=ft.minCoordinate(o.getCoordinates());ft.scroll(u,l),fe.arraycopy(u,0,o.getCoordinates(),0,u.length),o.getCoordinates()[u.length]=u[0],q.isCCW(o.getCoordinates())===a&&ft.reverse(o.getCoordinates())}},t.prototype.getCoordinate=function(){return this._shell.getCoordinate()},t.prototype.getNumInteriorRing=function(){return this._holes.length},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.getLength=function(){var i=this,s=0;s+=this._shell.getLength();for(var o=0;o<this._holes.length;o++)s+=i._holes[o].getLength();return s},t.prototype.getNumPoints=function(){for(var i=this,s=this._shell.getNumPoints(),o=0;o<this._holes.length;o++)s+=i._holes[o].getNumPoints();return s},t.prototype.reverse=function(){var i=this,s=this.copy();s._shell=this._shell.copy().reverse(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=i._holes[o].copy().reverse();return s},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var s=arguments[0],o=this._shell,a=s._shell;return o.compareToSameClass(a)}else if(arguments.length===2){var u=arguments[0],l=arguments[1],h=u,c=this._shell,f=h._shell,p=c.compareToSameClass(f,l);if(p!==0)return p;for(var m=this.getNumInteriorRing(),_=h.getNumInteriorRing(),E=0;E<m&&E<_;){var C=i.getInteriorRingN(E),v=h.getInteriorRingN(E),y=C.compareToSameClass(v,l);if(y!==0)return y;E++}return E<m?1:E<_?-1:0}},t.prototype.apply=function(i){var s=this;if(rt(i,Dn)){this._shell.apply(i);for(var o=0;o<this._holes.length;o++)s._holes[o].apply(i)}else if(rt(i,zr)){if(this._shell.apply(i),!i.isDone())for(var a=0;a<this._holes.length&&(s._holes[a].apply(i),!i.isDone());a++);i.isGeometryChanged()&&this.geometryChanged()}else if(rt(i,nn))i.filter(this);else if(rt(i,ii)){i.filter(this),this._shell.apply(i);for(var u=0;u<this._holes.length;u++)s._holes[u].apply(i)}},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var s=new Array(this._holes.length+1).fill(null);s[0]=this._shell;for(var o=0;o<this._holes.length;o++)s[o+1]=i._holes[o];return s.length<=1?this.getFactory().createLinearRing(s[0].getCoordinateSequence()):this.getFactory().createMultiLineString(s)},t.prototype.clone=function(){var i=this,s=r.prototype.clone.call(this);s._shell=this._shell.clone(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=i._holes[o].clone();return s},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var i=this,s=this._shell.copy(),o=new Array(this._holes.length).fill(null),a=0;a<o.length;a++)o[a]=i._holes[a].copy();return new t(s,o,this._factory)},t.prototype.getExteriorRing=function(){return this._shell},t.prototype.isEmpty=function(){return this._shell.isEmpty()},t.prototype.getInteriorRingN=function(i){return this._holes[i]},t.prototype.interfaces_=function(){return[Ti]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t})(tt),Zo=(function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return tt.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return r.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return Et.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.getGeometryType=function(){return"MultiPoint"},t.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[Du]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t})(xe),An=(function(r){function t(n,i){n instanceof x&&i instanceof dt&&(n=i.getCoordinateSequenceFactory().create(n)),r.call(this,n,i),this.validateConstruction()}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return tt.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return Et.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:r.prototype.isClosed.call(this)},t.prototype.reverse=function(){var i=this._points.copy();Ht.reverse(i);var s=this.getFactory().createLinearRing(i);return s},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!r.prototype.isClosed.call(this))throw new zt("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new zt("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.MINIMUM_VALID_SIZE.get=function(){return 4},e.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,e),t})(Wt),Ln=(function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return tt.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=i._geometries[a].reverse();return this.getFactory().createMultiPolygon(o)},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var s=new G,o=0;o<this._geometries.length;o++)for(var a=i._geometries[o],u=a.getBoundary(),l=0;l<u.getNumGeometries();l++)s.add(u.getGeometryN(l));var h=new Array(s.size()).fill(null);return this.getFactory().createMultiLineString(s.toArray(h))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[Ti]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t})(xe),Tr=function(t){this._factory=t||null,this._isUserDataCopied=!1},Hl={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Tr.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Tr.prototype.edit=function(t,e){if(t===null)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},Tr.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof xe?this.editGeometryCollection(t,e):t instanceof re?this.editPolygon(t,e):t instanceof Ze?e.edit(t,this._factory):t instanceof Wt?e.edit(t,this._factory):(ut.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Tr.prototype.editGeometryCollection=function(t,e){for(var n=this,i=e.edit(t,this._factory),s=new G,o=0;o<i.getNumGeometries();o++){var a=n.edit(i.getGeometryN(o),e);a===null||a.isEmpty()||s.add(a)}return i.getClass()===Zo?this._factory.createMultiPoint(s.toArray([])):i.getClass()===as?this._factory.createMultiLineString(s.toArray([])):i.getClass()===Ln?this._factory.createMultiPolygon(s.toArray([])):this._factory.createGeometryCollection(s.toArray([]))},Tr.prototype.editPolygon=function(t,e){var n=this,i=e.edit(t,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var s=this.edit(i.getExteriorRing(),e);if(s===null||s.isEmpty())return this._factory.createPolygon();for(var o=new G,a=0;a<i.getNumInteriorRing();a++){var u=n.edit(i.getInteriorRingN(a),e);u===null||u.isEmpty()||o.add(u)}return this._factory.createPolygon(s,o.toArray([]))},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.GeometryEditorOperation=function(){},Hl.NoOpGeometryOperation.get=function(){return Au},Hl.CoordinateOperation.get=function(){return Lu},Hl.CoordinateSequenceOperation.get=function(){return Ru},Object.defineProperties(Tr,Hl);var Au=function(){};Au.prototype.edit=function(t,e){return t},Au.prototype.interfaces_=function(){return[Tr.GeometryEditorOperation]},Au.prototype.getClass=function(){return Au};var Lu=function(){};Lu.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return n===null?t:t instanceof An?e.createLinearRing(n):t instanceof Wt?e.createLineString(n):t instanceof Ze?n.length>0?e.createPoint(n[0]):e.createPoint():t},Lu.prototype.interfaces_=function(){return[Tr.GeometryEditorOperation]},Lu.prototype.getClass=function(){return Lu};var Ru=function(){};Ru.prototype.edit=function(t,e){return t instanceof An?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Wt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Ze?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},Ru.prototype.interfaces_=function(){return[Tr.GeometryEditorOperation]},Ru.prototype.getClass=function(){return Ru};var Yt=function(){var t=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var n=0;n<e;n++)t._coordinates[n]=new x}else if(rt(arguments[0],vt)){var i=arguments[0];if(i===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._coordinates=new Array(i.size()).fill(null);for(var s=0;s<this._coordinates.length;s++)t._coordinates[s]=i.getCoordinateCopy(s)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var o=arguments[0],a=arguments[1];this._coordinates=o,this._dimension=a,o===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var h=0;h<u;h++)t._coordinates[h]=new x}}},fm={serialVersionUID:{configurable:!0}};Yt.prototype.setOrdinate=function(t,e,n){switch(e){case vt.X:this._coordinates[t].x=n;break;case vt.Y:this._coordinates[t].y=n;break;case vt.Z:this._coordinates[t].z=n;break;default:throw new zt("invalid ordinateIndex")}},Yt.prototype.size=function(){return this._coordinates.length},Yt.prototype.getOrdinate=function(t,e){switch(e){case vt.X:return this._coordinates[t].x;case vt.Y:return this._coordinates[t].y;case vt.Z:return this._coordinates[t].z}return st.NaN},Yt.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},Yt.prototype.getCoordinateCopy=function(t){return new x(this._coordinates[t])},Yt.prototype.getDimension=function(){return this._dimension},Yt.prototype.getX=function(t){return this._coordinates[t].x},Yt.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].clone();return new Yt(e,this._dimension)},Yt.prototype.expandEnvelope=function(t){for(var e=this,n=0;n<this._coordinates.length;n++)t.expandToInclude(e._coordinates[n]);return t},Yt.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].copy();return new Yt(e,this._dimension)},Yt.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new Kr(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var n=1;n<this._coordinates.length;n++)e.append(", "),e.append(t._coordinates[n]);return e.append(")"),e.toString()}else return"()"},Yt.prototype.getY=function(t){return this._coordinates[t].y},Yt.prototype.toCoordinateArray=function(){return this._coordinates},Yt.prototype.interfaces_=function(){return[vt,Mr]},Yt.prototype.getClass=function(){return Yt},fm.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(Yt,fm);var Rn=function(){},Vc={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Rn.prototype.readResolve=function(){return Rn.instance()},Rn.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new Yt(t)}else if(rt(arguments[0],vt)){var e=arguments[0];return new Yt(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new Yt(n):new Yt(n,i)}},Rn.prototype.interfaces_=function(){return[Wo,Mr]},Rn.prototype.getClass=function(){return Rn},Rn.instance=function(){return Rn.instanceObject},Vc.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Vc.instanceObject.get=function(){return new Rn},Object.defineProperties(Rn,Vc);var dm=(function(r){function t(){r.call(this),this.map_=new Map}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(n){return this.map_.get(n)||null},t.prototype.put=function(n,i){return this.map_.set(n,i),i},t.prototype.values=function(){for(var n=new G,i=this.map_.values(),s=i.next();!s.done;)n.add(s.value),s=i.next();return n},t.prototype.entrySet=function(){var n=new Rc;return this.map_.entries().forEach(function(i){return n.add(i)}),n},t.prototype.size=function(){return this.map_.size()},t})(Gs),St=function r(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=r.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof sn){var t=arguments[0];this._modelType=t,t===r.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var e=arguments[0];this._modelType=r.FIXED,this.setScale(e)}else if(arguments[0]instanceof r){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}},Uc={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};St.prototype.equals=function(t){if(!(t instanceof St))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},St.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new Zr(n).compareTo(new Zr(i))},St.prototype.getScale=function(){return this._scale},St.prototype.isFloating=function(){return this._modelType===St.FLOATING||this._modelType===St.FLOATING_SINGLE},St.prototype.getType=function(){return this._modelType},St.prototype.toString=function(){var t="UNKNOWN";return this._modelType===St.FLOATING?t="Floating":this._modelType===St.FLOATING_SINGLE?t="Floating-Single":this._modelType===St.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},St.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(st.isNaN(t))return t;if(this._modelType===St.FLOATING_SINGLE){var e=t;return e}return this._modelType===St.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof x){var n=arguments[0];if(this._modelType===St.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}},St.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===St.FLOATING?t=16:this._modelType===St.FLOATING_SINGLE?t=6:this._modelType===St.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},St.prototype.setScale=function(t){this._scale=Math.abs(t)},St.prototype.interfaces_=function(){return[Mr,Pr]},St.prototype.getClass=function(){return St},St.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Uc.serialVersionUID.get=function(){return 7777263578777804e3},Uc.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(St,Uc);var sn=function r(t){this._name=t||null,r.nameToTypeMap.put(t,this)},zc={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};sn.prototype.readResolve=function(){return sn.nameToTypeMap.get(this._name)},sn.prototype.toString=function(){return this._name},sn.prototype.interfaces_=function(){return[Mr]},sn.prototype.getClass=function(){return sn},zc.serialVersionUID.get=function(){return-552860263173159e4},zc.nameToTypeMap.get=function(){return new dm},Object.defineProperties(sn,zc),St.Type=sn,St.FIXED=new sn("FIXED"),St.FLOATING=new sn("FLOATING"),St.FLOATING_SINGLE=new sn("FLOATING SINGLE");var dt=function r(){this._precisionModel=new St,this._SRID=0,this._coordinateSequenceFactory=r.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?rt(arguments[0],Wo)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof St&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},pm={serialVersionUID:{configurable:!0}};dt.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new x(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new x(t.getMinX(),t.getMinY()),new x(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new x(t.getMinX(),t.getMinY()),new x(t.getMinX(),t.getMaxY()),new x(t.getMaxX(),t.getMaxY()),new x(t.getMaxX(),t.getMinY()),new x(t.getMinX(),t.getMinY())]),null)},dt.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new Wt(this.getCoordinateSequenceFactory().create(t),this);if(rt(t,vt))return new Wt(t,this)}else return new Wt(this.getCoordinateSequenceFactory().create([]),this)},dt.prototype.createMultiLineString=function(){if(arguments.length===0)return new as(null,this);if(arguments.length===1){var t=arguments[0];return new as(t,this)}},dt.prototype.buildGeometry=function(t){for(var e=null,n=!1,i=!1,s=t.iterator();s.hasNext();){var o=s.next(),a=o.getClass();e===null&&(e=a),a!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(e===null)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(dt.toGeometryArray(t));var u=t.iterator().next(),l=t.size()>1;if(l){if(u instanceof re)return this.createMultiPolygon(dt.toPolygonArray(t));if(u instanceof Wt)return this.createMultiLineString(dt.toLineStringArray(t));if(u instanceof Ze)return this.createMultiPoint(dt.toPointArray(t));ut.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},dt.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},dt.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof x){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(rt(arguments[0],vt)){var e=arguments[0];return new Ze(e,this)}}},dt.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},dt.prototype.createPolygon=function(){if(arguments.length===0)return new re(null,null,this);if(arguments.length===1){if(rt(arguments[0],vt)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof An){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];return new re(i,s,this)}},dt.prototype.getSRID=function(){return this._SRID},dt.prototype.createGeometryCollection=function(){if(arguments.length===0)return new xe(null,this);if(arguments.length===1){var t=arguments[0];return new xe(t,this)}},dt.prototype.createGeometry=function(t){var e=new Tr(this);return e.edit(t,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})},dt.prototype.getPrecisionModel=function(){return this._precisionModel},dt.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(rt(arguments[0],vt)){var e=arguments[0];return new An(e,this)}}},dt.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Ln(null,this);if(arguments.length===1){var t=arguments[0];return new Ln(t,this)}},dt.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new Zo(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new Zo(e,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(rt(arguments[0],vt)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(i.size()).fill(null),o=0;o<i.size();o++){var a=t.getCoordinateSequenceFactory().create(1,i.getDimension());Ht.copy(i,o,a,0,1),s[o]=t.createPoint(a)}return this.createMultiPoint(s)}}},dt.prototype.interfaces_=function(){return[Mr]},dt.prototype.getClass=function(){return dt},dt.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},dt.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},dt.getDefaultCoordinateSequenceFactory=function(){return Rn.instance()},dt.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},dt.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},dt.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},dt.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},dt.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},dt.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},dt.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},pm.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(dt,pm);var iI=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Yl=function(t){this.geometryFactory=t||new dt};Yl.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var n=e.type;if(!on[n])throw new Error("Unknown GeoJSON type: "+e.type);return iI.indexOf(n)!==-1?on[n].apply(this,[e.coordinates]):n==="GeometryCollection"?on[n].apply(this,[e.geometries]):on[n].apply(this,[e])},Yl.prototype.write=function(t){var e=t.getGeometryType();if(!ui[e])throw new Error("Geometry is not supported");return ui[e].apply(this,[t])};var on={Feature:function(r){var t={};for(var e in r)t[e]=r[e];if(r.geometry){var n=r.geometry.type;if(!on[n])throw new Error("Unknown GeoJSON type: "+r.type);t.geometry=this.read(r.geometry)}return r.bbox&&(t.bbox=on.bbox.apply(this,[r.bbox])),t},FeatureCollection:function(r){var t=this,e={};if(r.features){e.features=[];for(var n=0;n<r.features.length;++n)e.features.push(t.read(r.features[n]))}return r.bbox&&(e.bbox=this.parse.bbox.apply(this,[r.bbox])),e},coordinates:function(r){for(var t=[],e=0;e<r.length;++e){var n=r[e];t.push(new x(n[0],n[1]))}return t},bbox:function(r){return this.geometryFactory.createLinearRing([new x(r[0],r[1]),new x(r[2],r[1]),new x(r[2],r[3]),new x(r[0],r[3]),new x(r[0],r[1])])},Point:function(r){var t=new x(r[0],r[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(r){for(var t=this,e=[],n=0;n<r.length;++n)e.push(on.Point.apply(t,[r[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(r){var t=on.coordinates.apply(this,[r]);return this.geometryFactory.createLineString(t)},MultiLineString:function(r){for(var t=this,e=[],n=0;n<r.length;++n)e.push(on.LineString.apply(t,[r[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(r){for(var t=this,e=on.coordinates.apply(this,[r[0]]),n=this.geometryFactory.createLinearRing(e),i=[],s=1;s<r.length;++s){var o=r[s],a=on.coordinates.apply(t,[o]),u=t.geometryFactory.createLinearRing(a);i.push(u)}return this.geometryFactory.createPolygon(n,i)},MultiPolygon:function(r){for(var t=this,e=[],n=0;n<r.length;++n){var i=r[n];e.push(on.Polygon.apply(t,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(r){for(var t=this,e=[],n=0;n<r.length;++n){var i=r[n];e.push(t.read(i))}return this.geometryFactory.createGeometryCollection(e)}},ui={coordinate:function(r){return[r.x,r.y]},Point:function(r){var t=ui.coordinate.apply(this,[r.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=ui.Point.apply(t,[i]);e.push(s.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(r){for(var t=this,e=[],n=r.getCoordinates(),i=0;i<n.length;++i){var s=n[i];e.push(ui.coordinate.apply(t,[s]))}return{type:"LineString",coordinates:e}},MultiLineString:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=ui.LineString.apply(t,[i]);e.push(s.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(r){var t=this,e=[],n=ui.LineString.apply(this,[r._shell]);e.push(n.coordinates);for(var i=0;i<r._holes.length;++i){var s=r._holes[i],o=ui.LineString.apply(t,[s]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=ui.Polygon.apply(t,[i]);e.push(s.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=i.getGeometryType();e.push(ui[s].apply(t,[i]))}return{type:"GeometryCollection",geometries:e}}},Gc=function(t){this.geometryFactory=t||new dt,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Yl(this.geometryFactory)};Gc.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===St.FIXED&&this.reducePrecision(e),e},Gc.prototype.reducePrecision=function(t){var e=this,n,i;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(n=0,i=t.points.length;n<i;n++)e.precisionModel.makePrecise(t.points[n]);else if(t.geometries)for(n=0,i=t.geometries.length;n<i;n++)e.reducePrecision(t.geometries[n])};var gm=function(){this.parser=new Yl(this.geometryFactory)};gm.prototype.write=function(t){return this.parser.write(t)};var U=function(){},Jl={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};U.prototype.interfaces_=function(){return[]},U.prototype.getClass=function(){return U},U.opposite=function(t){return t===U.LEFT?U.RIGHT:t===U.RIGHT?U.LEFT:t},Jl.ON.get=function(){return 0},Jl.LEFT.get=function(){return 1},Jl.RIGHT.get=function(){return 2},Object.defineProperties(U,Jl);function jl(r){this.message=r||""}jl.prototype=new Error,jl.prototype.name="EmptyStackException";function an(){this.array_=[]}an.prototype=new Vr,an.prototype.add=function(r){return this.array_.push(r),!0},an.prototype.get=function(r){if(r<0||r>=this.size())throw new Error;return this.array_[r]},an.prototype.push=function(r){return this.array_.push(r),r},an.prototype.pop=function(r){if(this.array_.length===0)throw new jl;return this.array_.pop()},an.prototype.peek=function(){if(this.array_.length===0)throw new jl;return this.array_[this.array_.length-1]},an.prototype.empty=function(){return this.array_.length===0},an.prototype.isEmpty=function(){return this.empty()},an.prototype.search=function(r){return this.array_.indexOf(r)},an.prototype.size=function(){return this.array_.length},an.prototype.toArray=function(){for(var r=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(r.array_[e]);return t};var un=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};un.prototype.getCoordinate=function(){return this._minCoord},un.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},un.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();ut.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],i=q.computeOrientation(this._minCoord,n,e),s=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&i===q.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&i===q.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)},un.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge(),i=n.getCoordinates();if(e<0||e+1>=i.length||i[e].y===i[e+1].y)return-1;var s=U.LEFT;return i[e].y<i[e+1].y&&(s=U.RIGHT),s},un.prototype.getEdge=function(){return this._orientedDe},un.prototype.checkForRightmostCoordinate=function(t){for(var e=this,n=t.getEdge().getCoordinates(),i=0;i<n.length-1;i++)(e._minCoord===null||n[i].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=i,e._minCoord=n[i])},un.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},un.prototype.findEdge=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next();i.isForward()&&e.checkForRightmostCoordinate(i)}ut.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var s=this.getRightmostSide(this._minDe,this._minIndex);s===U.LEFT&&(this._orientedDe=this._minDe.getSym())},un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un};var li=(function(r){function t(e,n){r.call(this,t.msgWithCoord(e,n)),this.pt=n?new x(n):null,this.name="TopologyException"}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(n,i){return i?n:n+" [ "+i+" ]"},t})(ni),Ql=function(){this.array_=[]};Ql.prototype.addLast=function(t){this.array_.push(t)},Ql.prototype.removeFirst=function(){return this.array_.shift()},Ql.prototype.isEmpty=function(){return this.array_.length===0};var Ne=function(){this._finder=null,this._dirEdgeList=new G,this._nodes=new G,this._rightMostCoord=null,this._env=null,this._finder=new un};Ne.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},Ne.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ne.prototype.computeNodeDepth=function(t){for(var e=this,n=null,i=t.getEdges().iterator();i.hasNext();){var s=i.next();if(s.isVisited()||s.getSym().isVisited()){n=s;break}}if(n===null)throw new li("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(n);for(var o=t.getEdges().iterator();o.hasNext();){var a=o.next();a.setVisited(!0),e.copySymDepths(a)}},Ne.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(U.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Ne.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ne.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(U.RIGHT)>=1&&e.getDepth(U.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Ne.prototype.computeDepths=function(t){var e=this,n=new Rc,i=new Ql,s=t.getNode();for(i.addLast(s),n.add(s),t.setVisited(!0);!i.isEmpty();){var o=i.removeFirst();n.add(o),e.computeNodeDepth(o);for(var a=o.getEdges().iterator();a.hasNext();){var u=a.next(),l=u.getSym();if(!l.isVisited()){var h=l.getNode();n.contains(h)||(i.addLast(h),n.add(h))}}}},Ne.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Ne.prototype.getEnvelope=function(){if(this._env===null){for(var t=new J,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),i=n.getEdge().getCoordinates(),s=0;s<i.length-1;s++)t.expandToInclude(i[s]);this._env=t}return this._env},Ne.prototype.addReachable=function(t){var e=this,n=new an;for(n.add(t);!n.empty();){var i=n.pop();e.add(i,n)}},Ne.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(U.LEFT,t.getDepth(U.RIGHT)),e.setDepth(U.RIGHT,t.getDepth(U.LEFT))},Ne.prototype.add=function(t,e){var n=this;t.setVisited(!0),this._nodes.add(t);for(var i=t.getEdges().iterator();i.hasNext();){var s=i.next();n._dirEdgeList.add(s);var o=s.getSym(),a=o.getNode();a.isVisited()||e.push(a)}},Ne.prototype.getNodes=function(){return this._nodes},Ne.prototype.getDirectedEdges=function(){return this._dirEdgeList},Ne.prototype.interfaces_=function(){return[Pr]},Ne.prototype.getClass=function(){return Ne};var Tt=function r(){var t=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[U.ON]=n}else if(arguments[0]instanceof r){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var s=0;s<this.location.length;s++)t.location[s]=i.location[s]}}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];this.init(3),this.location[U.ON]=o,this.location[U.LEFT]=a,this.location[U.RIGHT]=u}};Tt.prototype.setAllLocations=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]=t},Tt.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==O.NONE)return!1;return!0},Tt.prototype.setAllLocationsIfNull=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]===O.NONE&&(e.location[n]=t)},Tt.prototype.isLine=function(){return this.location.length===1},Tt.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var n=new Array(3).fill(null);n[U.ON]=this.location[U.ON],n[U.LEFT]=O.NONE,n[U.RIGHT]=O.NONE,this.location=n}for(var i=0;i<this.location.length;i++)e.location[i]===O.NONE&&i<t.location.length&&(e.location[i]=t.location[i])},Tt.prototype.getLocations=function(){return this.location},Tt.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[U.LEFT];this.location[U.LEFT]=this.location[U.RIGHT],this.location[U.RIGHT]=t},Tt.prototype.toString=function(){var t=new Kr;return this.location.length>1&&t.append(O.toLocationSymbol(this.location[U.LEFT])),t.append(O.toLocationSymbol(this.location[U.ON])),this.location.length>1&&t.append(O.toLocationSymbol(this.location[U.RIGHT])),t.toString()},Tt.prototype.setLocations=function(t,e,n){this.location[U.ON]=t,this.location[U.LEFT]=e,this.location[U.RIGHT]=n},Tt.prototype.get=function(t){return t<this.location.length?this.location[t]:O.NONE},Tt.prototype.isArea=function(){return this.location.length>1},Tt.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===O.NONE)return!0;return!1},Tt.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(U.ON,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.location[e]=n}},Tt.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(O.NONE)},Tt.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Tt.prototype.allPositionsEqual=function(t){for(var e=this,n=0;n<this.location.length;n++)if(e.location[n]!==t)return!1;return!0},Tt.prototype.interfaces_=function(){return[]},Tt.prototype.getClass=function(){return Tt};var Pt=function r(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new Tt(t),this.elt[1]=new Tt(t)}else if(arguments[0]instanceof r){var e=arguments[0];this.elt[0]=new Tt(e.elt[0]),this.elt[1]=new Tt(e.elt[1])}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[0]=new Tt(O.NONE),this.elt[1]=new Tt(O.NONE),this.elt[n].setLocation(i)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this.elt[0]=new Tt(s,o,a),this.elt[1]=new Tt(s,o,a)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],h=arguments[2],c=arguments[3];this.elt[0]=new Tt(O.NONE,O.NONE,O.NONE),this.elt[1]=new Tt(O.NONE,O.NONE,O.NONE),this.elt[u].setLocations(l,h,c)}};Pt.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Pt.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Pt.prototype.isNull=function(t){return this.elt[t].isNull()},Pt.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},Pt.prototype.isLine=function(t){return this.elt[t].isLine()},Pt.prototype.merge=function(t){for(var e=this,n=0;n<2;n++)e.elt[n]===null&&t.elt[n]!==null?e.elt[n]=new Tt(t.elt[n]):e.elt[n].merge(t.elt[n])},Pt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Pt.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(U.ON)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Pt.prototype.toString=function(){var t=new Kr;return this.elt[0]!==null&&(t.append("A:"),t.append(this.elt[0].toString())),this.elt[1]!==null&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},Pt.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var t=arguments[0];return this.elt[t].isArea()}},Pt.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Pt.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(U.ON,e)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this.elt[n].setLocation(i,s)}},Pt.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Pt.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Pt.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Tt(this.elt[t].location[0]))},Pt.prototype.interfaces_=function(){return[]},Pt.prototype.getClass=function(){return Pt},Pt.toLineLabel=function(t){for(var e=new Pt(O.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var $t=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new G,this._pts=new G,this._label=new Pt(O.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new G,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};$t.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),n=0;n<this._pts.size();n++)e[n]=t._pts.get(n);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=q.isCCW(this._ring.getCoordinates())},$t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},$t.prototype.computePoints=function(t){var e=this;this._startDe=t;var n=t,i=!0;do{if(n===null)throw new li("Found null DirectedEdge");if(n.getEdgeRing()===e)throw new li("Directed Edge visited twice during ring-building at "+n.getCoordinate());e._edges.add(n);var s=n.getLabel();ut.isTrue(s.isArea()),e.mergeLabel(s),e.addPoints(n.getEdge(),n.isForward(),i),i=!1,e.setEdgeRing(n,e),n=e.getNext(n)}while(n!==this._startDe)},$t.prototype.getLinearRing=function(){return this._ring},$t.prototype.getCoordinate=function(t){return this._pts.get(t)},$t.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var n=e.getNode(),i=n.getEdges().getOutgoingDegree(t);i>t._maxNodeDegree&&(t._maxNodeDegree=i),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},$t.prototype.addPoints=function(t,e,n){var i=this,s=t.getCoordinates();if(e){var o=1;n&&(o=0);for(var a=o;a<s.length;a++)i._pts.add(s[a])}else{var u=s.length-2;n&&(u=s.length-1);for(var l=u;l>=0;l--)i._pts.add(s[l])}},$t.prototype.isHole=function(){return this._isHole},$t.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},$t.prototype.containsPoint=function(t){var e=this.getLinearRing(),n=e.getEnvelopeInternal();if(!n.contains(t)||!q.isPointInRing(t,e.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var s=i.next();if(s.containsPoint(t))return!1}return!0},$t.prototype.addHole=function(t){this._holes.add(t)},$t.prototype.isShell=function(){return this._shell===null},$t.prototype.getLabel=function(){return this._label},$t.prototype.getEdges=function(){return this._edges},$t.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},$t.prototype.getShell=function(){return this._shell},$t.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=e.getLocation(n,U.RIGHT);if(i===O.NONE)return null;if(this._label.getLocation(n)===O.NONE)return this._label.setLocation(n,i),null}},$t.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},$t.prototype.toPolygon=function(t){for(var e=this,n=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)n[i]=e._holes.get(i).getLinearRing();var s=t.createPolygon(this.getLinearRing(),n);return s},$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t};var sI=(function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(n,i){n.setMinEdgeRing(i)},t.prototype.getNext=function(n){return n.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})($t),oI=(function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var n=this,i=new G,s=this._startDe;do{if(s.getMinEdgeRing()===null){var o=new sI(s,n._geometryFactory);i.add(o)}s=s.getNext()}while(s!==this._startDe);return i},t.prototype.setEdgeRing=function(n,i){n.setEdgeRing(i)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var n=this,i=this._startDe;do{var s=i.getNode();s.getEdges().linkMinimalDirectedEdges(n),i=i.getNext()}while(i!==this._startDe)},t.prototype.getNext=function(n){return n.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})($t),pr=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._label=t}}};pr.prototype.setVisited=function(t){this._isVisited=t},pr.prototype.setInResult=function(t){this._isInResult=t},pr.prototype.isCovered=function(){return this._isCovered},pr.prototype.isCoveredSet=function(){return this._isCoveredSet},pr.prototype.setLabel=function(t){this._label=t},pr.prototype.getLabel=function(){return this._label},pr.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},pr.prototype.updateIM=function(t){ut.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},pr.prototype.isInResult=function(){return this._isInResult},pr.prototype.isVisited=function(){return this._isVisited},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr};var $l=(function(r){function t(){r.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new Pt(0,O.NONE)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var i=n.next();if(i.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(n){},t.prototype.computeMergedLocation=function(n,i){var s=O.NONE;if(s=this._label.getLocation(i),!n.isNull(i)){var o=n.getLocation(i);s!==O.BOUNDARY&&(s=o)}return s},t.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this._label===null?this._label=new Pt(n,i):this._label.setLocation(n,i)}else return r.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof t){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof Pt)for(var s=arguments[0],o=0;o<2;o++){var a=n.computeMergedLocation(s,o),u=n._label.getLocation(o);u===O.NONE&&n._label.setLocation(o,a)}},t.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},t.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var i=O.NONE;this._label!==null&&(i=this._label.getLocation(n));var s=null;switch(i){case O.BOUNDARY:s=O.INTERIOR;break;case O.INTERIOR:s=O.BOUNDARY;break;default:s=O.BOUNDARY;break}this._label.setLocation(n,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(pr),ln=function(){this.nodeMap=new Ee,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};ln.prototype.find=function(t){return this.nodeMap.get(t)},ln.prototype.addNode=function(){if(arguments[0]instanceof x){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof $l){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return i===null?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}},ln.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},ln.prototype.iterator=function(){return this.nodeMap.values().iterator()},ln.prototype.values=function(){return this.nodeMap.values()},ln.prototype.getBoundaryNodes=function(t){for(var e=new G,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===O.BOUNDARY&&e.add(i)}return e},ln.prototype.add=function(t){var e=t.getCoordinate(),n=this.addNode(e);n.add(t)},ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln};var Mt=function(){},Fu={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Mt.prototype.interfaces_=function(){return[]},Mt.prototype.getClass=function(){return Mt},Mt.isNorthern=function(t){return t===Mt.NE||t===Mt.NW},Mt.isOpposite=function(t,e){if(t===e)return!1;var n=(t-e+4)%4;return n===2},Mt.commonHalfPlane=function(t,e){if(t===e)return t;var n=(t-e+4)%4;if(n===2)return-1;var i=t<e?t:e,s=t>e?t:e;return i===0&&s===3?3:i},Mt.isInHalfPlane=function(t,e){return e===Mt.SE?t===Mt.SE||t===Mt.SW:t===e||t===e+1},Mt.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new zt("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Mt.NE:Mt.SE:e>=0?Mt.NW:Mt.SW}else if(arguments[0]instanceof x&&arguments[1]instanceof x){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new zt("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?Mt.NE:Mt.SE:i.y>=n.y?Mt.NW:Mt.SW}},Fu.NE.get=function(){return 0},Fu.NW.get=function(){return 1},Fu.SW.get=function(){return 2},Fu.SE.get=function(){return 3},Object.defineProperties(Mt,Fu);var Se=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2],s=null;this._edge=e,this.init(n,i),this._label=s}else if(arguments.length===4){var o=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this._edge=o,this.init(a,u),this._label=l}};Se.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:q.computeOrientation(t._p0,t._p1,this._p1)},Se.prototype.getDy=function(){return this._dy},Se.prototype.getCoordinate=function(){return this._p0},Se.prototype.setNode=function(t){this._node=t},Se.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),i=n.lastIndexOf("."),s=n.substring(i+1);t.print(" "+s+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Se.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Se.prototype.getDirectedCoordinate=function(){return this._p1},Se.prototype.getDx=function(){return this._dx},Se.prototype.getLabel=function(){return this._label},Se.prototype.getEdge=function(){return this._edge},Se.prototype.getQuadrant=function(){return this._quadrant},Se.prototype.getNode=function(){return this._node},Se.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf("."),i=e.substring(n+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},Se.prototype.computeLabel=function(t){},Se.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=Mt.quadrant(this._dx,this._dy),ut.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Se.prototype.interfaces_=function(){return[Pr]},Se.prototype.getClass=function(){return Se};var qc=(function(r){function t(){var e=arguments[0],n=arguments[1];if(r.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var i=e.getNumPoints()-1;this.init(e.getCoordinate(i),e.getCoordinate(i-1))}this.computeDirectedLabel()}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(n){return this._depth[n]},t.prototype.setVisited=function(n){this._isVisited=n},t.prototype.computeDirectedLabel=function(){this._label=new Pt(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(n,i){if(this._depth[n]!==-999&&this._depth[n]!==i)throw new li("assigned depths do not match",this.getCoordinate());this._depth[n]=i},t.prototype.isInteriorAreaEdge=function(){for(var n=this,i=!0,s=0;s<2;s++)n._label.isArea(s)&&n._label.getLocation(s,U.LEFT)===O.INTERIOR&&n._label.getLocation(s,U.RIGHT)===O.INTERIOR||(i=!1);return i},t.prototype.setNextMin=function(n){this._nextMin=n},t.prototype.print=function(n){r.prototype.print.call(this,n),n.print(" "+this._depth[U.LEFT]+"/"+this._depth[U.RIGHT]),n.print(" ("+this.getDepthDelta()+")"),this._isInResult&&n.print(" inResult")},t.prototype.setMinEdgeRing=function(n){this._minEdgeRing=n},t.prototype.isLineEdge=function(){var n=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,O.EXTERIOR),s=!this._label.isArea(1)||this._label.allPositionsEqual(1,O.EXTERIOR);return n&&i&&s},t.prototype.setEdgeRing=function(n){this._edgeRing=n},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n},t.prototype.setInResult=function(n){this._isInResult=n},t.prototype.getSym=function(){return this._sym},t.prototype.isForward=function(){return this._isForward},t.prototype.getEdge=function(){return this._edge},t.prototype.printEdge=function(n){this.print(n),n.print(" "),this._isForward?this._edge.print(n):this._edge.printReverse(n)},t.prototype.setSym=function(n){this._sym=n},t.prototype.setVisitedEdge=function(n){this.setVisited(n),this._sym.setVisited(n)},t.prototype.setEdgeDepths=function(n,i){var s=this.getEdge().getDepthDelta();this._isForward||(s=-s);var o=1;n===U.LEFT&&(o=-1);var a=U.opposite(n),u=s*o,l=i+u;this.setDepth(n,i),this.setDepth(a,l)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(n){this._next=n},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(n,i){return n===O.EXTERIOR&&i===O.INTERIOR?1:n===O.INTERIOR&&i===O.EXTERIOR?-1:0},t})(Se),ta=function(){};ta.prototype.createNode=function(t){return new $l(t,null)},ta.prototype.interfaces_=function(){return[]},ta.prototype.getClass=function(){return ta};var qt=function(){if(this._edges=new G,this._nodes=null,this._edgeEndList=new G,arguments.length===0)this._nodes=new ln(new ta);else if(arguments.length===1){var t=arguments[0];this._nodes=new ln(t)}};qt.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var n=0;n<this._edges.size();n++){t.println("edge "+n+":");var i=e._edges.get(n);i.print(t),i.eiList.print(t)}},qt.prototype.find=function(t){return this._nodes.find(t)},qt.prototype.addNode=function(){if(arguments[0]instanceof $l){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof x){var e=arguments[0];return this._nodes.addNode(e)}},qt.prototype.getNodeIterator=function(){return this._nodes.iterator()},qt.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},qt.prototype.debugPrintln=function(t){fe.out.println(t)},qt.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(n===null)return!1;var i=n.getLabel();return i!==null&&i.getLocation(t)===O.BOUNDARY},qt.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},qt.prototype.matchInSameDirection=function(t,e,n,i){return t.equals(n)?q.computeOrientation(t,e,i)===q.COLLINEAR&&Mt.quadrant(t,e)===Mt.quadrant(n,i):!1},qt.prototype.getEdgeEnds=function(){return this._edgeEndList},qt.prototype.debugPrint=function(t){fe.out.print(t)},qt.prototype.getEdgeIterator=function(){return this._edges.iterator()},qt.prototype.findEdgeInSameDirection=function(t,e){for(var n=this,i=0;i<this._edges.size();i++){var s=n._edges.get(i),o=s.getCoordinates();if(n.matchInSameDirection(t,e,o[0],o[1])||n.matchInSameDirection(t,e,o[o.length-1],o[o.length-2]))return s}return null},qt.prototype.insertEdge=function(t){this._edges.add(t)},qt.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},qt.prototype.addEdges=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next();e._edges.add(i);var s=new qc(i,!0),o=new qc(i,!1);s.setSym(o),o.setSym(s),e.add(s),e.add(o)}},qt.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},qt.prototype.getNodes=function(){return this._nodes.values()},qt.prototype.findEdge=function(t,e){for(var n=this,i=0;i<this._edges.size();i++){var s=n._edges.get(i),o=s.getCoordinates();if(t.equals(o[0])&&e.equals(o[1]))return s}return null},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.getEdges().linkResultDirectedEdges()}};var tr=function(){this._geometryFactory=null,this._shellList=new G;var t=arguments[0];this._geometryFactory=t};tr.prototype.sortShellsAndHoles=function(t,e,n){for(var i=t.iterator();i.hasNext();){var s=i.next();s.isHole()?n.add(s):e.add(s)}},tr.prototype.computePolygons=function(t){for(var e=this,n=new G,i=t.iterator();i.hasNext();){var s=i.next(),o=s.toPolygon(e._geometryFactory);n.add(o)}return n},tr.prototype.placeFreeHoles=function(t,e){for(var n=this,i=e.iterator();i.hasNext();){var s=i.next();if(s.getShell()===null){var o=n.findEdgeRingContaining(s,t);if(o===null)throw new li("unable to assign hole to a shell",s.getCoordinate(0));s.setShell(o)}}},tr.prototype.buildMinimalEdgeRings=function(t,e,n){for(var i=this,s=new G,o=t.iterator();o.hasNext();){var a=o.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var u=a.buildMinimalRings(),l=i.findShell(u);l!==null?(i.placePolygonHoles(l,u),e.add(l)):n.addAll(u)}else s.add(a)}return s},tr.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var n=e.next();if(n.containsPoint(t))return!0}return!1},tr.prototype.buildMaximalEdgeRings=function(t){for(var e=this,n=new G,i=t.iterator();i.hasNext();){var s=i.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var o=new oI(s,e._geometryFactory);n.add(o),o.setInResult()}}return n},tr.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}},tr.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},tr.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),s=n.getCoordinateN(0),o=null,a=null,u=e.iterator();u.hasNext();){var l=u.next(),h=l.getLinearRing(),c=h.getEnvelopeInternal();o!==null&&(a=o.getLinearRing().getEnvelopeInternal());var f=!1;c.contains(i)&&q.isPointInRing(s,h.getCoordinates())&&(f=!0),f&&(o===null||a.contains(c))&&(o=l)}return o},tr.prototype.findShell=function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var s=i.next();s.isHole()||(n=s,e++)}return ut.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},tr.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],n=arguments[1];qt.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),s=new G,o=this.buildMinimalEdgeRings(i,this._shellList,s);this.sortShellsAndHoles(o,this._shellList,s),this.placeFreeHoles(this._shellList,s)}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr};var ea=function(){};ea.prototype.getBounds=function(){},ea.prototype.interfaces_=function(){return[]},ea.prototype.getClass=function(){return ea};var Gr=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Gr.prototype.getItem=function(){return this._item},Gr.prototype.getBounds=function(){return this._bounds},Gr.prototype.interfaces_=function(){return[ea,Mr]},Gr.prototype.getClass=function(){return Gr};var hi=function(){this._size=null,this._items=null,this._size=0,this._items=new G,this._items.add(null)};hi.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},hi.prototype.size=function(){return this._size},hi.prototype.reorder=function(t){for(var e=this,n=null,i=this._items.get(t);t*2<=this._size&&(n=t*2,n!==e._size&&e._items.get(n+1).compareTo(e._items.get(n))<0&&n++,e._items.get(n).compareTo(i)<0);t=n)e._items.set(t,e._items.get(n));this._items.set(t,i)},hi.prototype.clear=function(){this._size=0,this._items.clear()},hi.prototype.isEmpty=function(){return this._size===0},hi.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)e._items.set(n,e._items.get(Math.trunc(n/2)));this._items.set(n,t)},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi};var Oi=function(){};Oi.prototype.visitItem=function(t){},Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi};var qs=function(){};qs.prototype.insert=function(t,e){},qs.prototype.remove=function(t,e){},qs.prototype.query=function(){},qs.prototype.interfaces_=function(){return[]},qs.prototype.getClass=function(){return qs};var ne=function(){if(this._childBoundables=new G,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},mm={serialVersionUID:{configurable:!0}};ne.prototype.getLevel=function(){return this._level},ne.prototype.size=function(){return this._childBoundables.size()},ne.prototype.getChildBoundables=function(){return this._childBoundables},ne.prototype.addChildBoundable=function(t){ut.isTrue(this._bounds===null),this._childBoundables.add(t)},ne.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},ne.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},ne.prototype.interfaces_=function(){return[ea,Mr]},ne.prototype.getClass=function(){return ne},mm.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(ne,mm);var qr=function(){};qr.reverseOrder=function(){return{compare:function(e,n){return n.compareTo(e)}}},qr.min=function(t){return qr.sort(t),t.get(0)},qr.sort=function(t,e){var n=t.toArray();e?os.sort(n,e):os.sort(n);for(var i=t.iterator(),s=0,o=n.length;s<o;s++)i.next(),i.set(n[s])},qr.singletonList=function(t){var e=new G;return e.add(t),e};var Kt=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};Kt.prototype.expandToQueue=function(t,e){var n=Kt.isComposite(this._boundable1),i=Kt.isComposite(this._boundable2);if(n&&i)return Kt.area(this._boundable1)>Kt.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new zt("neither boundable is composite")},Kt.prototype.isLeaves=function(){return!(Kt.isComposite(this._boundable1)||Kt.isComposite(this._boundable2))},Kt.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},Kt.prototype.expand=function(t,e,n,i){for(var s=this,o=t.getChildBoundables(),a=o.iterator();a.hasNext();){var u=a.next(),l=new Kt(u,e,s._itemDistance);l.getDistance()<i&&n.add(l)}},Kt.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},Kt.prototype.getDistance=function(){return this._distance},Kt.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Kt.prototype.interfaces_=function(){return[Pr]},Kt.prototype.getClass=function(){return Kt},Kt.area=function(t){return t.getBounds().getArea()},Kt.isComposite=function(t){return t instanceof ne};var ue=function r(){if(this._root=null,this._built=!1,this._itemBoundables=new G,this._nodeCapacity=null,arguments.length===0){var t=r.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];ut.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},Kl={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};ue.prototype.getNodeCapacity=function(){return this._nodeCapacity},ue.prototype.lastNode=function(t){return t.get(t.size()-1)},ue.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,i=e.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof ne?n+=t.size(s):s instanceof Gr&&(n+=1)}return n}},ue.prototype.removeItem=function(t,e){for(var n=null,i=t.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof Gr&&s.getItem()===e&&(n=s)}return n!==null?(t.getChildBoundables().remove(n),!0):!1},ue.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new G:e}else if(arguments.length===1){for(var n=arguments[0],i=new G,s=n.getChildBoundables().iterator();s.hasNext();){var o=s.next();if(o instanceof ne){var a=t.itemsTree(o);a!==null&&i.add(a)}else o instanceof Gr?i.add(o.getItem()):ut.shouldNeverReachHere()}return i.size()<=0?null:i}},ue.prototype.insert=function(t,e){ut.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Gr(t,e))},ue.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],n=new G;return this.boundablesAtLevel(e,this._root,n),n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];if(ut.isTrue(i>-2),s.getLevel()===i)return o.add(s),null;for(var a=s.getChildBoundables().iterator();a.hasNext();){var u=a.next();u instanceof ne?t.boundablesAtLevel(i,u,o):(ut.isTrue(u instanceof Gr),i===-1&&o.add(u))}return null}},ue.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var n=new G;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,n),n}else if(arguments.length===2){var i=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,s)}else if(arguments.length===3){if(rt(arguments[2],Oi)&&arguments[0]instanceof Object&&arguments[1]instanceof ne)for(var o=arguments[0],a=arguments[1],u=arguments[2],l=a.getChildBoundables(),h=0;h<l.size();h++){var c=l.get(h);t.getIntersectsOp().intersects(c.getBounds(),o)&&(c instanceof ne?t.query(o,c,u):c instanceof Gr?u.visitItem(c.getItem()):ut.shouldNeverReachHere())}else if(rt(arguments[2],Vr)&&arguments[0]instanceof Object&&arguments[1]instanceof ne)for(var f=arguments[0],p=arguments[1],m=arguments[2],_=p.getChildBoundables(),E=0;E<_.size();E++){var C=_.get(E);t.getIntersectsOp().intersects(C.getBounds(),f)&&(C instanceof ne?t.query(f,C,m):C instanceof Gr?m.add(C.getItem()):ut.shouldNeverReachHere())}}},ue.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},ue.prototype.getRoot=function(){return this.build(),this._root},ue.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,n):!1}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=this.removeItem(s,o);if(a)return!0;for(var u=null,l=s.getChildBoundables().iterator();l.hasNext();){var h=l.next();if(t.getIntersectsOp().intersects(h.getBounds(),i)&&h instanceof ne&&(a=t.remove(i,h,o),a)){u=h;break}}return u!==null&&u.getChildBoundables().isEmpty()&&s.getChildBoundables().remove(u),a}},ue.prototype.createHigherLevels=function(t,e){ut.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return n.size()===1?n.get(0):this.createHigherLevels(n,e+1)},ue.prototype.depth=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,i=e.getChildBoundables().iterator();i.hasNext();){var s=i.next();if(s instanceof ne){var o=t.depth(s);o>n&&(n=o)}}return n+1}},ue.prototype.createParentBoundables=function(t,e){var n=this;ut.isTrue(!t.isEmpty());var i=new G;i.add(this.createNode(e));var s=new G(t);qr.sort(s,this.getComparator());for(var o=s.iterator();o.hasNext();){var a=o.next();n.lastNode(i).getChildBoundables().size()===n.getNodeCapacity()&&i.add(n.createNode(e)),n.lastNode(i).addChildBoundable(a)}return i},ue.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},ue.prototype.interfaces_=function(){return[Mr]},ue.prototype.getClass=function(){return ue},ue.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},Kl.IntersectsOp.get=function(){return aI},Kl.serialVersionUID.get=function(){return-3886435814360241e3},Kl.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(ue,Kl);var aI=function(){},ra=function(){};ra.prototype.distance=function(t,e){},ra.prototype.interfaces_=function(){return[]},ra.prototype.getClass=function(){return ra};var vm=(function(r){function t(n){n=n||t.DEFAULT_NODE_CAPACITY,r.call(this,n)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return t.prototype.createParentBoundablesFromVerticalSlices=function(i,s){var o=this;ut.isTrue(i.length>0);for(var a=new G,u=0;u<i.length;u++)a.addAll(o.createParentBoundablesFromVerticalSlice(i[u],s));return a},t.prototype.createNode=function(i){return new ym(i)},t.prototype.size=function(){return arguments.length===0?r.prototype.size.call(this):r.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];if(i.isNull())return null;r.prototype.insert.call(this,i,s)}else return r.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(i,s){for(var o=Math.trunc(Math.ceil(i.size()/s)),a=new Array(s).fill(null),u=i.iterator(),l=0;l<s;l++){a[l]=new G;for(var h=0;u.hasNext()&&h<o;){var c=u.next();a[l].add(c),h++}}return a},t.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return r.prototype.query.call(this,i)}else if(arguments.length===2){var s=arguments[0],o=arguments[1];r.prototype.query.call(this,s,o)}else if(arguments.length===3){if(rt(arguments[2],Oi)&&arguments[0]instanceof Object&&arguments[1]instanceof ne){var a=arguments[0],u=arguments[1],l=arguments[2];r.prototype.query.call(this,a,u,l)}else if(rt(arguments[2],Vr)&&arguments[0]instanceof Object&&arguments[1]instanceof ne){var h=arguments[0],c=arguments[1],f=arguments[2];r.prototype.query.call(this,h,c,f)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(i,s){return r.prototype.createParentBoundables.call(this,i,s)},t.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return r.prototype.remove.call(this,i,s)}else return r.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return arguments.length===0?r.prototype.depth.call(this):r.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(i,s){ut.isTrue(!i.isEmpty());var o=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),a=new G(i);qr.sort(a,t.xComparator);var u=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(o))));return this.createParentBoundablesFromVerticalSlices(u,s)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(rt(arguments[0],ra)){var i=arguments[0],s=new Kt(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(s)}else if(arguments[0]instanceof Kt){var o=arguments[0];return this.nearestNeighbour(o,st.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&rt(arguments[1],ra)){var a=arguments[0],u=arguments[1],l=new Kt(this.getRoot(),a.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof Kt&&typeof arguments[1]=="number"){var h=arguments[0],c=arguments[1],f=c,p=null,m=new hi;for(m.add(h);!m.isEmpty()&&f>0;){var _=m.poll(),E=_.getDistance();if(E>=f)break;_.isLeaves()?(f=E,p=_):_.expandToQueue(m,f)}return[p.getBoundable(0).getItem(),p.getBoundable(1).getItem()]}}else if(arguments.length===3){var C=arguments[0],v=arguments[1],y=arguments[2],w=new Gr(C,v),S=new Kt(this.getRoot(),w,y);return this.nearestNeighbour(S)[0]}},t.prototype.interfaces_=function(){return[qs,Mr]},t.prototype.getClass=function(){return t},t.centreX=function(i){return t.avg(i.getMinX(),i.getMaxX())},t.avg=function(i,s){return(i+s)/2},t.centreY=function(i){return t.avg(i.getMinY(),i.getMaxY())},e.STRtreeNode.get=function(){return ym},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[qo]},compare:function(n,i){return r.compareDoubles(t.centreX(n.getBounds()),t.centreX(i.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[qo]},compare:function(n,i){return r.compareDoubles(t.centreY(n.getBounds()),t.centreY(i.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[r.IntersectsOp]},intersects:function(n,i){return n.intersects(i)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t})(ue),ym=(function(r){function t(){var e=arguments[0];r.call(this,e)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var n=null,i=this.getChildBoundables().iterator();i.hasNext();){var s=i.next();n===null?n=new J(s.getBounds()):n.expandToInclude(s.getBounds())}return n},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(ne),qe=function(){};qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe},qe.relativeSign=function(t,e){return t<e?-1:t>e?1:0},qe.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=qe.relativeSign(e.x,n.x),s=qe.relativeSign(e.y,n.y);switch(t){case 0:return qe.compareValue(i,s);case 1:return qe.compareValue(s,i);case 2:return qe.compareValue(s,-i);case 3:return qe.compareValue(-i,s);case 4:return qe.compareValue(-i,-s);case 5:return qe.compareValue(-s,-i);case 6:return qe.compareValue(-s,i);case 7:return qe.compareValue(i,-s)}return ut.shouldNeverReachHere("invalid octant value"),0},qe.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var Di=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._segString=t,this.coord=new x(e),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))};Di.prototype.getCoordinate=function(){return this.coord},Di.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},Di.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:qe.compare(this._segmentOctant,this.coord,e.coord)},Di.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},Di.prototype.isInterior=function(){return this._isInterior},Di.prototype.interfaces_=function(){return[Pr]},Di.prototype.getClass=function(){return Di};var Te=function(){this._nodeMap=new Ee,this._edge=null;var t=arguments[0];this._edge=t};Te.prototype.getSplitCoordinates=function(){var t=this,e=new xu;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next();t.addEdgeCoordinates(i,s,e),i=s}return e.toCoordinateArray()},Te.prototype.addCollapsedNodes=function(){var t=this,e=new G;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var n=e.iterator();n.hasNext();){var i=n.next().intValue();t.add(t._edge.getCoordinate(i),i)}},Te.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Te.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,n=0;n<this._edge.size()-2;n++){var i=e._edge.getCoordinate(n),s=e._edge.getCoordinate(n+2);i.equals2D(s)&&t.add(new Zr(n+1))}},Te.prototype.addEdgeCoordinates=function(t,e,n){var i=this,s=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(s);n.add(new x(t.coord),!1);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)n.add(i._edge.getCoordinate(a));o&&n.add(new x(e.coord))},Te.prototype.iterator=function(){return this._nodeMap.values().iterator()},Te.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next(),o=e.createSplitEdge(i,s);t.add(o),i=s}},Te.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,i===1?(n[0]=t.segmentIndex+1,!0):!1},Te.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,n=new Array(1).fill(null),i=this.iterator(),s=i.next();i.hasNext();){var o=i.next(),a=e.findCollapseIndex(s,o,n);a&&t.add(new Zr(n[0])),s=o}},Te.prototype.getEdge=function(){return this._edge},Te.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},Te.prototype.createSplitEdge=function(t,e){var n=this,i=e.segmentIndex-t.segmentIndex+2,s=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(s);o||i--;var a=new Array(i).fill(null),u=0;a[u++]=new x(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=n._edge.getCoordinate(l);return o&&(a[u]=new x(e.coord)),new Jt(a,this._edge.getData())},Te.prototype.add=function(t,e){var n=new Di(this._edge,t,e,this._edge.getSegmentOctant(e)),i=this._nodeMap.get(n);return i!==null?(ut.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(n,n),n)},Te.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0),i=n.getCoordinate(0);if(!i.equals2D(e[0]))throw new ni("bad split edge start point at "+i);var s=t.get(t.size()-1),o=s.getCoordinates(),a=o[o.length-1];if(!a.equals2D(e[e.length-1]))throw new ni("bad split edge end point at "+a)},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te};var Ws=function(){};Ws.prototype.interfaces_=function(){return[]},Ws.prototype.getClass=function(){return Ws},Ws.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new zt("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),i=Math.abs(e);return t>=0?e>=0?n>=i?0:1:n>=i?7:6:e>=0?n>=i?3:2:n>=i?4:5}else if(arguments[0]instanceof x&&arguments[1]instanceof x){var s=arguments[0],o=arguments[1],a=o.x-s.x,u=o.y-s.y;if(a===0&&u===0)throw new zt("Cannot compute the octant for two identical points "+s);return Ws.octant(a,u)}};var Fn=function(){};Fn.prototype.getCoordinates=function(){},Fn.prototype.size=function(){},Fn.prototype.getCoordinate=function(t){},Fn.prototype.isClosed=function(){},Fn.prototype.setData=function(t){},Fn.prototype.getData=function(){},Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn};var ku=function(){};ku.prototype.addIntersection=function(t,e){},ku.prototype.interfaces_=function(){return[Fn]},ku.prototype.getClass=function(){return ku};var Jt=function(){this._nodeList=new Te(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Jt.prototype.getCoordinates=function(){return this._pts},Jt.prototype.size=function(){return this._pts.length},Jt.prototype.getCoordinate=function(t){return this._pts[t]},Jt.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Jt.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},Jt.prototype.setData=function(t){this._data=t},Jt.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:Ws.octant(t,e)},Jt.prototype.getData=function(){return this._data},Jt.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[3],o=new x(n.getIntersection(s));this.addIntersection(o,i)}},Jt.prototype.toString=function(){return kr.toLineString(new Yt(this._pts))},Jt.prototype.getNodeList=function(){return this._nodeList},Jt.prototype.addIntersectionNode=function(t,e){var n=e,i=n+1;if(i<this._pts.length){var s=this._pts[i];t.equals2D(s)&&(n=i)}var o=this._nodeList.add(t,n);return o},Jt.prototype.addIntersections=function(t,e,n){for(var i=this,s=0;s<t.getIntersectionNum();s++)i.addIntersection(t,e,n,s)},Jt.prototype.interfaces_=function(){return[ku]},Jt.prototype.getClass=function(){return Jt},Jt.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new G;return Jt.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var n=arguments[0],i=arguments[1],s=n.iterator();s.hasNext();){var o=s.next();o.getNodeList().addSplitEdges(i)}};var j=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new x,this.p1=new x;else if(arguments.length===1){var t=arguments[0];this.p0=new x(t.p0),this.p1=new x(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],n=arguments[1],i=arguments[2],s=arguments[3];this.p0=new x(e,n),this.p1=new x(i,s)}},_m={serialVersionUID:{configurable:!0}};j.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},j.prototype.orientationIndex=function(){if(arguments[0]instanceof j){var t=arguments[0],e=q.orientationIndex(this.p0,this.p1,t.p0),n=q.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}else if(arguments[0]instanceof x){var i=arguments[0];return q.orientationIndex(this.p0,this.p1,i)}},j.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},j.prototype.isVertical=function(){return this.p0.x===this.p1.x},j.prototype.equals=function(t){if(!(t instanceof j))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},j.prototype.intersection=function(t){var e=new is;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},j.prototype.project=function(){if(arguments[0]instanceof x){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new x(t);var e=this.projectionFactor(t),n=new x;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof j){var i=arguments[0],s=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(s>=1&&o>=1||s<=0&&o<=0)return null;var a=this.project(i.p0);s<0&&(a=this.p0),s>1&&(a=this.p1);var u=this.project(i.p1);return o<0&&(u=this.p0),o>1&&(u=this.p1),new j(a,u)}},j.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},j.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},j.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},j.prototype.distancePerpendicular=function(t){return q.distancePointLinePerpendicular(t,this.p0,this.p1)},j.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},j.prototype.midPoint=function(){return j.midPoint(this.p0,this.p1)},j.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=e*e+n*n;if(i<=0)return st.NaN;var s=((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/i;return s},j.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var n=new Array(2).fill(null),i=st.MAX_VALUE,s=null,o=this.closestPoint(t.p0);i=o.distance(t.p0),n[0]=o,n[1]=t.p0;var a=this.closestPoint(t.p1);s=a.distance(t.p1),s<i&&(i=s,n[0]=a,n[1]=t.p1);var u=t.closestPoint(this.p0);s=u.distance(this.p0),s<i&&(i=s,n[0]=this.p0,n[1]=u);var l=t.closestPoint(this.p1);return s=l.distance(this.p1),s<i&&(i=s,n[0]=this.p1,n[1]=l),n},j.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var n=this.p0.distance(t),i=this.p1.distance(t);return n<i?this.p0:this.p1},j.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},j.prototype.getLength=function(){return this.p0.distance(this.p1)},j.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return n!==0?n:this.p1.compareTo(e.p1)},j.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},j.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},j.prototype.lineIntersection=function(t){try{var e=Fr.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(n){if(!(n instanceof Xo))throw n}finally{}return null},j.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},j.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),s=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,a=Math.sqrt(s*s+o*o),u=0,l=0;if(e!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");u=e*s/a,l=e*o/a}var h=n-l,c=i+u,f=new x(h,c);return f},j.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},j.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||st.isNaN(e))&&(e=1),e},j.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},j.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},j.prototype.distance=function(){if(arguments[0]instanceof j){var t=arguments[0];return q.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof x){var e=arguments[0];return q.distancePointLine(e,this.p0,this.p1)}},j.prototype.pointAlong=function(t){var e=new x;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},j.prototype.hashCode=function(){var t=st.doubleToLongBits(this.p0.x);t^=st.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),n=st.doubleToLongBits(this.p1.x);n^=st.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(n)^Math.trunc(n>>32);return e^i},j.prototype.interfaces_=function(){return[Pr,Mr]},j.prototype.getClass=function(){return j},j.midPoint=function(t,e){return new x((t.x+e.x)/2,(t.y+e.y)/2)},_m.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(j,_m);var Vu=function(){this.tempEnv1=new J,this.tempEnv2=new J,this._overlapSeg1=new j,this._overlapSeg2=new j};Vu.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},Vu.prototype.interfaces_=function(){return[]},Vu.prototype.getClass=function(){return Vu};var er=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=i};er.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},er.prototype.computeSelect=function(t,e,n,i){var s=this._pts[e],o=this._pts[n];if(i.tempEnv1.init(s,o),n-e===1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var a=Math.trunc((e+n)/2);e<a&&this.computeSelect(t,e,a,i),a<n&&this.computeSelect(t,a,n,i)},er.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),n=0,i=this._start;i<=this._end;i++)e[n++]=t._pts[i];return e},er.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},er.prototype.setId=function(t){this._id=t},er.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},er.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new J(t,e)}return this._env},er.prototype.getEndIndex=function(){return this._end},er.prototype.getStartIndex=function(){return this._start},er.prototype.getContext=function(){return this._context},er.prototype.getId=function(){return this._id},er.prototype.computeOverlapsInternal=function(t,e,n,i,s,o){var a=this._pts[t],u=this._pts[e],l=n._pts[i],h=n._pts[s];if(e-t===1&&s-i===1)return o.overlap(this,t,n,i),null;if(o.tempEnv1.init(a,u),o.tempEnv2.init(l,h),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),f=Math.trunc((i+s)/2);t<c&&(i<f&&this.computeOverlapsInternal(t,c,n,i,f,o),f<s&&this.computeOverlapsInternal(t,c,n,f,s,o)),c<e&&(i<f&&this.computeOverlapsInternal(c,e,n,i,f,o),f<s&&this.computeOverlapsInternal(c,e,n,f,s,o))},er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er};var hn=function(){};hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn},hn.getChainStartIndices=function(t){var e=0,n=new G;n.add(new Zr(e));do{var i=hn.findChainEnd(t,e);n.add(new Zr(i)),e=i}while(e<t.length-1);var s=hn.toIntArray(n);return s},hn.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var i=Mt.quadrant(t[n],t[n+1]),s=e+1;s<t.length;){if(!t[s-1].equals2D(t[s])){var o=Mt.quadrant(t[s-1],t[s]);if(o!==i)break}s++}return s-1},hn.getChains=function(){if(arguments.length===1){var t=arguments[0];return hn.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],n=arguments[1],i=new G,s=hn.getChainStartIndices(e),o=0;o<s.length-1;o++){var a=new er(e,s[o],s[o+1],n);i.add(a)}return i}},hn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var us=function(){};us.prototype.computeNodes=function(t){},us.prototype.getNodedSubstrings=function(){},us.prototype.interfaces_=function(){return[]},us.prototype.getClass=function(){return us};var Uu=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};Uu.prototype.setSegmentIntersector=function(t){this._segInt=t},Uu.prototype.interfaces_=function(){return[us]},Uu.prototype.getClass=function(){return Uu};var Wc=(function(r){function t(n){n?r.call(this,n):r.call(this),this._monoChains=new G,this._index=new vm,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return Jt.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(i){for(var s=this,o=hn.getChains(i.getCoordinates(),i),a=o.iterator();a.hasNext();){var u=a.next();u.setId(s._idCounter++),s._index.insert(u.getEnvelope(),u),s._monoChains.add(u)}},t.prototype.computeNodes=function(i){var s=this;this._nodedSegStrings=i;for(var o=i.iterator();o.hasNext();)s.add(o.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var i=this,s=new wm(this._segInt),o=this._monoChains.iterator();o.hasNext();)for(var a=o.next(),u=i._index.query(a.getEnvelope()),l=u.iterator();l.hasNext();){var h=l.next();if(h.getId()>a.getId()&&(a.computeOverlaps(h,s),i._nOverlaps++),i._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return wm},Object.defineProperties(t,e),t})(Uu),wm=(function(r){function t(){r.call(this),this._si=null;var e=arguments[0];this._si=e}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3],a=n.getContext(),u=s.getContext();this._si.processIntersections(a,i,u,o)}else return r.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Vu),Ct=function r(){if(this._quadrantSegments=r.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=r.CAP_ROUND,this._joinStyle=r.JOIN_ROUND,this._mitreLimit=r.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=r.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(n)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(s),this.setJoinStyle(o),this.setMitreLimit(a)}}},ci={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Ct.prototype.getEndCapStyle=function(){return this._endCapStyle},Ct.prototype.isSingleSided=function(){return this._isSingleSided},Ct.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=Ct.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Ct.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Ct.JOIN_ROUND&&(this._quadrantSegments=Ct.DEFAULT_QUADRANT_SEGMENTS)},Ct.prototype.getJoinStyle=function(){return this._joinStyle},Ct.prototype.setJoinStyle=function(t){this._joinStyle=t},Ct.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Ct.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Ct.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Ct.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Ct.prototype.getMitreLimit=function(){return this._mitreLimit},Ct.prototype.setMitreLimit=function(t){this._mitreLimit=t},Ct.prototype.setSingleSided=function(t){this._isSingleSided=t},Ct.prototype.interfaces_=function(){return[]},Ct.prototype.getClass=function(){return Ct},Ct.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},ci.CAP_ROUND.get=function(){return 1},ci.CAP_FLAT.get=function(){return 2},ci.CAP_SQUARE.get=function(){return 3},ci.JOIN_ROUND.get=function(){return 1},ci.JOIN_MITRE.get=function(){return 2},ci.JOIN_BEVEL.get=function(){return 3},ci.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},ci.DEFAULT_MITRE_LIMIT.get=function(){return 5},ci.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Ct,ci);var Xt=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=q.COUNTERCLOCKWISE,this._inputLine=t||null},zu={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Xt.prototype.isDeletable=function(t,e,n,i){var s=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[n];return!this.isConcave(s,o,a)||!this.isShallow(s,o,a,i)?!1:this.isShallowSampled(s,o,t,n,i)},Xt.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,n=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(n),s=!1;i<this._inputLine.length;){var o=!1;t.isDeletable(e,n,i,t._distanceTol)&&(t._isDeleted[n]=Xt.DELETE,o=!0,s=!0),o?e=i:e=n,n=t.findNextNonDeletedIndex(e),i=t.findNextNonDeletedIndex(n)}return s},Xt.prototype.isShallowConcavity=function(t,e,n,i){var s=q.computeOrientation(t,e,n),o=s===this._angleOrientation;if(!o)return!1;var a=q.distancePointLine(e,t,n);return a<i},Xt.prototype.isShallowSampled=function(t,e,n,i,s){var o=this,a=Math.trunc((i-n)/Xt.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var u=n;u<i;u+=a)if(!o.isShallow(t,e,o._inputLine[u],s))return!1;return!0},Xt.prototype.isConcave=function(t,e,n){var i=q.computeOrientation(t,e,n),s=i===this._angleOrientation;return s},Xt.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=q.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var n=!1;do n=e.deleteShallowConcavities();while(n);return this.collapseLine()},Xt.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Xt.DELETE;)e++;return e},Xt.prototype.isShallow=function(t,e,n,i){var s=q.distancePointLine(e,t,n);return s<i},Xt.prototype.collapseLine=function(){for(var t=this,e=new xu,n=0;n<this._inputLine.length;n++)t._isDeleted[n]!==Xt.DELETE&&e.add(t._inputLine[n]);return e.toCoordinateArray()},Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Xt.simplify=function(t,e){var n=new Xt(t);return n.simplify(e)},zu.INIT.get=function(){return 0},zu.DELETE.get=function(){return 1},zu.KEEP.get=function(){return 1},zu.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Xt,zu);var gr=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new G},Em={COORDINATE_ARRAY_TYPE:{configurable:!0}};gr.prototype.getCoordinates=function(){var t=this._ptList.toArray(gr.COORDINATE_ARRAY_TYPE);return t},gr.prototype.setPrecisionModel=function(t){this._precisionModel=t},gr.prototype.addPt=function(t){var e=new x(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},gr.prototype.revere=function(){},gr.prototype.addPts=function(t,e){var n=this;if(e)for(var i=0;i<t.length;i++)n.addPt(t[i]);else for(var s=t.length-1;s>=0;s--)n.addPt(t[s])},gr.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),n=t.distance(e);return n<this._minimimVertexDistance},gr.prototype.toString=function(){var t=new dt,e=t.createLineString(this.getCoordinates());return e.toString()},gr.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new x(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},gr.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr},Em.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(gr,Em);var gt=function(){},Xs={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};gt.prototype.interfaces_=function(){return[]},gt.prototype.getClass=function(){return gt},gt.toDegrees=function(t){return t*180/Math.PI},gt.normalize=function(t){for(;t>Math.PI;)t-=gt.PI_TIMES_2;for(;t<=-Math.PI;)t+=gt.PI_TIMES_2;return t},gt.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=n.x-e.x,s=n.y-e.y;return Math.atan2(s,i)}},gt.isAcute=function(t,e,n){var i=t.x-e.x,s=t.y-e.y,o=n.x-e.x,a=n.y-e.y,u=i*o+s*a;return u>0},gt.isObtuse=function(t,e,n){var i=t.x-e.x,s=t.y-e.y,o=n.x-e.x,a=n.y-e.y,u=i*o+s*a;return u<0},gt.interiorAngle=function(t,e,n){var i=gt.angle(e,t),s=gt.angle(e,n);return Math.abs(s-i)},gt.normalizePositive=function(t){if(t<0){for(;t<0;)t+=gt.PI_TIMES_2;t>=gt.PI_TIMES_2&&(t=0)}else{for(;t>=gt.PI_TIMES_2;)t-=gt.PI_TIMES_2;t<0&&(t=0)}return t},gt.angleBetween=function(t,e,n){var i=gt.angle(e,t),s=gt.angle(e,n);return gt.diff(i,s)},gt.diff=function(t,e){var n=null;return t<e?n=e-t:n=t-e,n>Math.PI&&(n=2*Math.PI-n),n},gt.toRadians=function(t){return t*Math.PI/180},gt.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?gt.COUNTERCLOCKWISE:n<0?gt.CLOCKWISE:gt.NONE},gt.angleBetweenOriented=function(t,e,n){var i=gt.angle(e,t),s=gt.angle(e,n),o=s-i;return o<=-Math.PI?o+gt.PI_TIMES_2:o>Math.PI?o-gt.PI_TIMES_2:o},Xs.PI_TIMES_2.get=function(){return 2*Math.PI},Xs.PI_OVER_2.get=function(){return Math.PI/2},Xs.PI_OVER_4.get=function(){return Math.PI/4},Xs.COUNTERCLOCKWISE.get=function(){return q.COUNTERCLOCKWISE},Xs.CLOCKWISE.get=function(){return q.CLOCKWISE},Xs.NONE.get=function(){return q.COLLINEAR},Object.defineProperties(gt,Xs);var Vt=function r(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new j,this._seg1=new j,this._offset0=new j,this._offset1=new j,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new is,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===Ct.JOIN_ROUND&&(this._closingSegLengthFactor=r.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},Gu={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Vt.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=q.computeOrientation(this._s0,this._s1,this._s2),i=n===q.CLOCKWISE&&this._side===U.LEFT||n===q.COUNTERCLOCKWISE&&this._side===U.RIGHT;n===0?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Vt.prototype.addLineEndCap=function(t,e){var n=new j(t,e),i=new j;this.computeOffsetSegment(n,U.LEFT,this._distance,i);var s=new j;this.computeOffsetSegment(n,U.RIGHT,this._distance,s);var o=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case Ct.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,u+Math.PI/2,u-Math.PI/2,q.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case Ct.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(s.p1);break;case Ct.CAP_SQUARE:var l=new x;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var h=new x(i.p1.x+l.x,i.p1.y+l.y),c=new x(s.p1.x+l.x,s.p1.y+l.y);this._segList.addPt(h),this._segList.addPt(c);break}},Vt.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},Vt.prototype.addMitreJoin=function(t,e,n,i){var s=!0,o=null;try{o=Fr.intersection(e.p0,e.p1,n.p0,n.p1);var a=i<=0?1:o.distance(t)/Math.abs(i);a>this._bufParams.getMitreLimit()&&(s=!1)}catch(u){if(u instanceof Xo)o=new x(0,0),s=!1;else throw u}finally{}s?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,i,this._bufParams.getMitreLimit())},Vt.prototype.addFilletCorner=function(t,e,n,i,s){var o=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,o),l=n.x-t.x,h=n.y-t.y,c=Math.atan2(h,l);i===q.CLOCKWISE?u<=c&&(u+=2*Math.PI):u>=c&&(u-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,u,c,i,s),this._segList.addPt(n)},Vt.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Vt.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Ct.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Ct.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},Vt.prototype.createSquare=function(t){this._segList.addPt(new x(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new x(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new x(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new x(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Vt.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Vt.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Vt.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Vt.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},Vt.prototype.addLimitedMitreJoin=function(t,e,n,i){var s=this._seg0.p1,o=gt.angle(s,this._seg0.p0),a=gt.angleBetweenOriented(this._seg0.p0,s,this._seg1.p1),u=a/2,l=gt.normalize(o+u),h=gt.normalize(l+Math.PI),c=i*n,f=c*Math.abs(Math.sin(u)),p=n-f,m=s.x+c*Math.cos(h),_=s.y+c*Math.sin(h),E=new x(m,_),C=new j(s,E),v=C.pointAlongOffset(1,p),y=C.pointAlongOffset(1,-p);this._side===U.LEFT?(this._segList.addPt(v),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(v))},Vt.prototype.computeOffsetSegment=function(t,e,n,i){var s=e===U.LEFT?1:-1,o=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,u=Math.sqrt(o*o+a*a),l=s*n*o/u,h=s*n*a/u;i.p0.x=t.p0.x-h,i.p0.y=t.p0.y+l,i.p1.x=t.p1.x-h,i.p1.y=t.p1.y+l},Vt.prototype.addFilletArc=function(t,e,n,i,s){var o=this,a=i===q.CLOCKWISE?-1:1,u=Math.abs(e-n),l=Math.trunc(u/this._filletAngleQuantum+.5);if(l<1)return null;for(var h=0,c=u/l,f=h,p=new x;f<u;){var m=e+a*f;p.x=t.x+s*Math.cos(m),p.y=t.y+s*Math.sin(m),o._segList.addPt(p),f+=c}},Vt.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*Vt.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new x((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var i=new x((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Vt.prototype.createCircle=function(t){var e=new x(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Vt.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Vt.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new gr,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Vt.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Vt.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===Ct.JOIN_BEVEL||this._bufParams.getJoinStyle()===Ct.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,q.CLOCKWISE,this._distance))},Vt.prototype.closeRing=function(){this._segList.closeRing()},Vt.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Gu.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Gu.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Gu.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Gu.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Vt,Gu);var We=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};We.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var n=e<0,i=Math.abs(e),s=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],s):this.computeOffsetCurve(t,n,s);var o=s.getCoordinates();return n&&ft.reverse(o),o},We.prototype.computeSingleSidedBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var s=Xt.simplify(t,-i),o=s.length-1;n.initSideSegments(s[o],s[o-1],U.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(s[a],!0)}else{n.addSegments(t,!1);var u=Xt.simplify(t,i),l=u.length-1;n.initSideSegments(u[0],u[1],U.LEFT),n.addFirstSegment();for(var h=2;h<=l;h++)n.addNextSegment(u[h],!0)}n.addLastSegment(),n.closeRing()},We.prototype.computeRingBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);e===U.RIGHT&&(i=-i);var s=Xt.simplify(t,i),o=s.length-1;n.initSideSegments(s[o-1],s[0],e);for(var a=1;a<=o;a++){var u=a!==1;n.addNextSegment(s[a],u)}n.closeRing()},We.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),i=Xt.simplify(t,n),s=i.length-1;e.initSideSegments(i[0],i[1],U.LEFT);for(var o=2;o<=s;o++)e.addNextSegment(i[o],!0);e.addLastSegment(),e.addLineEndCap(i[s-1],i[s]);var a=Xt.simplify(t,-n),u=a.length-1;e.initSideSegments(a[u],a[u-1],U.LEFT);for(var l=u-2;l>=0;l--)e.addNextSegment(a[l],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},We.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Ct.CAP_ROUND:e.createCircle(t);break;case Ct.CAP_SQUARE:e.createSquare(t);break}},We.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var n=Math.abs(e),i=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var s=e<0;this.computeSingleSidedBufferCurve(t,s,i)}else this.computeLineBufferCurve(t,i);var o=i.getCoordinates();return o},We.prototype.getBufferParameters=function(){return this._bufParams},We.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},We.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(n===0)return We.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},We.prototype.computeOffsetCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){var s=Xt.simplify(t,-i),o=s.length-1;n.initSideSegments(s[o],s[o-1],U.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(s[a],!0)}else{var u=Xt.simplify(t,i),l=u.length-1;n.initSideSegments(u[0],u[1],U.LEFT),n.addFirstSegment();for(var h=2;h<=l;h++)n.addNextSegment(u[h],!0)}n.addLastSegment()},We.prototype.getSegGen=function(t){return new Vt(this._precisionModel,this._bufParams,t)},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We},We.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new x(t[n]);return e};var Bs=function(){this._subgraphs=null,this._seg=new j,this._cga=new q;var t=arguments[0];this._subgraphs=t},Sm={DepthSegment:{configurable:!0}};Bs.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=new G,i=this._subgraphs.iterator();i.hasNext();){var s=i.next(),o=s.getEnvelope();e.y<o.getMinY()||e.y>o.getMaxY()||t.findStabbedSegments(e,s.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(rt(arguments[2],Vr)&&arguments[0]instanceof x&&arguments[1]instanceof qc)for(var a=arguments[0],u=arguments[1],l=arguments[2],h=u.getEdge().getCoordinates(),c=0;c<h.length-1;c++){t._seg.p0=h[c],t._seg.p1=h[c+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var f=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(f<a.x)&&!t._seg.isHorizontal()&&!(a.y<t._seg.p0.y||a.y>t._seg.p1.y)&&q.computeOrientation(t._seg.p0,t._seg.p1,a)!==q.RIGHT){var p=u.getDepth(U.LEFT);t._seg.p0.equals(h[c])||(p=u.getDepth(U.RIGHT));var m=new ls(t._seg,p);l.add(m)}}else if(rt(arguments[2],Vr)&&arguments[0]instanceof x&&rt(arguments[1],Vr))for(var _=arguments[0],E=arguments[1],C=arguments[2],v=E.iterator();v.hasNext();){var y=v.next();y.isForward()&&t.findStabbedSegments(_,y,C)}}},Bs.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var n=qr.min(e);return n._leftDepth},Bs.prototype.interfaces_=function(){return[]},Bs.prototype.getClass=function(){return Bs},Sm.DepthSegment.get=function(){return ls},Object.defineProperties(Bs,Sm);var ls=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new j(t),this._leftDepth=e};ls.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return n!==0||(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(e._upwardSeg)},ls.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return n!==0?n:t.p1.compareTo(e.p1)},ls.prototype.toString=function(){return this._upwardSeg.toString()},ls.prototype.interfaces_=function(){return[Pr]},ls.prototype.getClass=function(){return ls};var It=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};It.prototype.area=function(){return It.area(this.p0,this.p1,this.p2)},It.prototype.signedArea=function(){return It.signedArea(this.p0,this.p1,this.p2)},It.prototype.interpolateZ=function(t){if(t===null)throw new zt("Supplied point is null.");return It.interpolateZ(t,this.p0,this.p1,this.p2)},It.prototype.longestSideLength=function(){return It.longestSideLength(this.p0,this.p1,this.p2)},It.prototype.isAcute=function(){return It.isAcute(this.p0,this.p1,this.p2)},It.prototype.circumcentre=function(){return It.circumcentre(this.p0,this.p1,this.p2)},It.prototype.area3D=function(){return It.area3D(this.p0,this.p1,this.p2)},It.prototype.centroid=function(){return It.centroid(this.p0,this.p1,this.p2)},It.prototype.inCentre=function(){return It.inCentre(this.p0,this.p1,this.p2)},It.prototype.interfaces_=function(){return[]},It.prototype.getClass=function(){return It},It.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},It.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},It.det=function(t,e,n,i){return t*i-e*n},It.interpolateZ=function(t,e,n,i){var s=e.x,o=e.y,a=n.x-s,u=i.x-s,l=n.y-o,h=i.y-o,c=a*h-u*l,f=t.x-s,p=t.y-o,m=(h*f-u*p)/c,_=(-l*f+a*p)/c,E=e.z+m*(n.z-e.z)+_*(i.z-e.z);return E},It.longestSideLength=function(t,e,n){var i=t.distance(e),s=e.distance(n),o=n.distance(t),a=i;return s>a&&(a=s),o>a&&(a=o),a},It.isAcute=function(t,e,n){return!(!gt.isAcute(t,e,n)||!gt.isAcute(e,n,t)||!gt.isAcute(n,t,e))},It.circumcentre=function(t,e,n){var i=n.x,s=n.y,o=t.x-i,a=t.y-s,u=e.x-i,l=e.y-s,h=2*It.det(o,a,u,l),c=It.det(a,o*o+a*a,l,u*u+l*l),f=It.det(o,o*o+a*a,u,u*u+l*l),p=i-c/h,m=s+f/h;return new x(p,m)},It.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y,s=new Fr(t.x+n/2,t.y+i/2,1),o=new Fr(t.x-i+n/2,t.y+n+i/2,1);return new Fr(s,o)},It.angleBisector=function(t,e,n){var i=e.distance(t),s=e.distance(n),o=i/(i+s),a=n.x-t.x,u=n.y-t.y,l=new x(t.x+o*a,t.y+o*u);return l},It.area3D=function(t,e,n){var i=e.x-t.x,s=e.y-t.y,o=e.z-t.z,a=n.x-t.x,u=n.y-t.y,l=n.z-t.z,h=s*l-o*u,c=o*a-i*l,f=i*u-s*a,p=h*h+c*c+f*f,m=Math.sqrt(p)/2;return m},It.centroid=function(t,e,n){var i=(t.x+e.x+n.x)/3,s=(t.y+e.y+n.y)/3;return new x(i,s)},It.inCentre=function(t,e,n){var i=e.distance(n),s=t.distance(n),o=t.distance(e),a=i+s+o,u=(i*t.x+s*e.x+o*n.x)/a,l=(i*t.y+s*e.y+o*n.y)/a;return new x(u,l)};var Or=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new G;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Or.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,O.EXTERIOR,O.INTERIOR)},Or.prototype.addPolygon=function(t){var e=this,n=this._distance,i=U.LEFT;this._distance<0&&(n=-this._distance,i=U.RIGHT);var s=t.getExteriorRing(),o=ft.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,n,i,O.EXTERIOR,O.INTERIOR);for(var a=0;a<t.getNumInteriorRing();a++){var u=t.getInteriorRingN(a),l=ft.removeRepeatedPoints(u.getCoordinates());e._distance>0&&e.isErodedCompletely(u,-e._distance)||e.addPolygonRing(l,n,U.opposite(i),O.INTERIOR,O.EXTERIOR)}},Or.prototype.isTriangleErodedCompletely=function(t,e){var n=new It(t[0],t[1],t[2]),i=n.inCentre(),s=q.distancePointLine(i,n.p0,n.p1);return s<Math.abs(e)},Or.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=ft.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,O.EXTERIOR,O.INTERIOR)},Or.prototype.addCurve=function(t,e,n){if(t===null||t.length<2)return null;var i=new Jt(t,new Pt(0,O.BOUNDARY,e,n));this._curveList.add(i)},Or.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Or.prototype.addPolygonRing=function(t,e,n,i,s){if(e===0&&t.length<An.MINIMUM_VALID_SIZE)return null;var o=i,a=s;t.length>=An.MINIMUM_VALID_SIZE&&q.isCCW(t)&&(o=s,a=i,n=U.opposite(n));var u=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(u,o,a)},Or.prototype.add=function(t){if(t.isEmpty())return null;t instanceof re?this.addPolygon(t):t instanceof Wt?this.addLineString(t):t instanceof Ze?this.addPoint(t):t instanceof Zo?this.addCollection(t):t instanceof as?this.addCollection(t):t instanceof Ln?this.addCollection(t):t instanceof xe&&this.addCollection(t)},Or.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(n.length===4)return this.isTriangleErodedCompletely(n,e);var i=t.getEnvelopeInternal(),s=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>s},Or.prototype.addCollection=function(t){for(var e=this,n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);e.add(i)}},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or};var na=function(){};na.prototype.locate=function(t){},na.prototype.interfaces_=function(){return[]},na.prototype.getClass=function(){return na};var kn=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};kn.prototype.next=function(){if(this._atStart)return this._atStart=!1,kn.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new $o;var t=this._parent.getGeometryN(this._index++);return t instanceof xe?(this._subcollectionIterator=new kn(t),this._subcollectionIterator.next()):t},kn.prototype.remove=function(){throw new Error(this.getClass().getName())},kn.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},kn.prototype.interfaces_=function(){return[Qo]},kn.prototype.getClass=function(){return kn},kn.isAtomic=function(t){return!(t instanceof xe)};var mr=function(){this._geom=null;var t=arguments[0];this._geom=t};mr.prototype.locate=function(t){return mr.locate(t,this._geom)},mr.prototype.interfaces_=function(){return[na]},mr.prototype.getClass=function(){return mr},mr.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?q.isPointInRing(t,e.getCoordinates()):!1},mr.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!mr.isPointInRing(t,n))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var s=e.getInteriorRingN(i);if(mr.isPointInRing(t,s))return!1}return!0},mr.containsPoint=function(t,e){if(e instanceof re)return mr.containsPointInPolygon(t,e);if(e instanceof xe)for(var n=new kn(e);n.hasNext();){var i=n.next();if(i!==e&&mr.containsPoint(t,i))return!0}return!1},mr.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:mr.containsPoint(t,e)?O.INTERIOR:O.EXTERIOR};var Ce=function(){this._edgeMap=new Ee,this._edgeList=null,this._ptInAreaLocation=[O.NONE,O.NONE]};Ce.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return e===0&&(n=this._edgeList.size()-1),this._edgeList.get(n)},Ce.prototype.propagateSideLabels=function(t){for(var e=O.NONE,n=this.iterator();n.hasNext();){var i=n.next(),s=i.getLabel();s.isArea(t)&&s.getLocation(t,U.LEFT)!==O.NONE&&(e=s.getLocation(t,U.LEFT))}if(e===O.NONE)return null;for(var o=e,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();if(l.getLocation(t,U.ON)===O.NONE&&l.setLocation(t,U.ON,o),l.isArea(t)){var h=l.getLocation(t,U.LEFT),c=l.getLocation(t,U.RIGHT);if(c!==O.NONE){if(c!==o)throw new li("side location conflict",u.getCoordinate());h===O.NONE&&ut.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),o=h}else ut.isTrue(l.getLocation(t,U.LEFT)===O.NONE,"found single null side"),l.setLocation(t,U.RIGHT,o),l.setLocation(t,U.LEFT,o)}}},Ce.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},Ce.prototype.print=function(t){fe.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Ce.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Ce.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,i=e.get(n).getLabel(),s=i.getLocation(t,U.LEFT);ut.isTrue(s!==O.NONE,"Found unlabelled area edge");for(var o=s,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();ut.isTrue(l.isArea(t),"Found non-area edge");var h=l.getLocation(t,U.LEFT),c=l.getLocation(t,U.RIGHT);if(h===c||c!==o)return!1;o=h}return!0},Ce.prototype.findIndex=function(t){var e=this;this.iterator();for(var n=0;n<this._edgeList.size();n++){var i=e._edgeList.get(n);if(i===t)return n}return-1},Ce.prototype.iterator=function(){return this.getEdges().iterator()},Ce.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new G(this._edgeMap.values())),this._edgeList},Ce.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===O.NONE&&(this._ptInAreaLocation[t]=mr.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Ce.prototype.toString=function(){var t=new Kr;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
26
67
  `);for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append(`
27
- `)}return t.toString()},qe.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.computeLabel(t)}},qe.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var n=[!1,!1],i=this.iterator();i.hasNext();)for(var s=i.next(),o=s.getLabel(),a=0;a<2;a++)o.isLine(a)&&o.getLocation(a)===F.BOUNDARY&&(n[a]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),h=l.getLabel(),c=0;c<2;c++)if(h.isAnyNull(c)){var f=F.NONE;if(n[c])f=F.EXTERIOR;else{var p=l.getCoordinate();f=e.getLocation(c,p,t)}h.setAllLocationsIfNull(c,f)}},qe.prototype.getDegree=function(){return this._edgeMap.size()},qe.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe};var L_=function(r){function t(){r.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var n=this;this.getResultAreaEdges();for(var i=null,s=null,o=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var u=n._resultAreaEdgeList.get(a),l=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),o){case n._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;s=l,o=n._LINKING_TO_OUTGOING;break;case n._LINKING_TO_OUTGOING:if(!u.isInResult())continue;s.setNext(u),o=n._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(i===null)throw new Ni("no outgoing dirEdge found",this.getCoordinate());St.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),s.setNext(i)}},t.prototype.insert=function(n){var i=n;this.insertEdgeEnd(i,i)},t.prototype.getRightmostEdge=function(){var n=this.getEdges(),i=n.size();if(i<1)return null;var s=n.get(0);if(i===1)return s;var o=n.get(i-1),a=s.getQuadrant(),u=o.getQuadrant();return Yt.isNorthern(a)&&Yt.isNorthern(u)?s:!Yt.isNorthern(a)&&!Yt.isNorthern(u)?o:s.getDy()!==0?s:o.getDy()!==0?o:(St.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(n){Oe.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var s=i.next();n.print("out "),s.print(n),n.println(),n.print("in "),s.getSym().print(n),n.println()}},t.prototype.getResultAreaEdges=function(){var n=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new B;for(var i=this.iterator();i.hasNext();){var s=i.next();(s.isInResult()||s.getSym().isInResult())&&n._resultAreaEdgeList.add(s)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(n){for(var i=this.iterator();i.hasNext();){var s=i.next(),o=s.getLabel();o.setAllLocationsIfNull(0,n.getLocation(0)),o.setAllLocationsIfNull(1,n.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var n=this;this.getEdges();for(var i=null,s=null,o=this._edgeList.size()-1;o>=0;o--){var a=n._edgeList.get(o),u=a.getSym();s===null&&(s=u),i!==null&&u.setNext(i),i=a}s.setNext(i)},t.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var i=arguments[0],s=this.findIndex(i),o=i.getDepth(H.LEFT),a=i.getDepth(H.RIGHT),u=this.computeDepths(s+1,this._edgeList.size(),o),l=this.computeDepths(0,s,u);if(l!==a)throw new Ni("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var h=arguments[0],c=arguments[1],f=arguments[2],p=f,v=h;v<c;v++){var _=n._edgeList.get(v);_.setEdgeDepths(H.RIGHT,p),p=_.getDepth(H.LEFT)}return p}},t.prototype.mergeSymLabels=function(){for(var n=this.iterator();n.hasNext();){var i=n.next(),s=i.getLabel();s.merge(i.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(n){for(var i=this,s=null,o=null,a=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=i._resultAreaEdgeList.get(u),h=l.getSym();switch(s===null&&l.getEdgeRing()===n&&(s=l),a){case i._SCANNING_FOR_INCOMING:if(h.getEdgeRing()!==n)continue;o=h,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==n)continue;o.setNextMin(l),a=i._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(St.isTrue(s!==null,"found null for first outgoing dirEdge"),St.isTrue(s.getEdgeRing()===n,"unable to link last incoming dirEdge"),o.setNextMin(s))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,i=this.iterator();i.hasNext();){var s=i.next();s.isInResult()&&n++}return n}else if(arguments.length===1){for(var o=arguments[0],a=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===o&&a++}return a}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var n=F.NONE,i=this.iterator();i.hasNext();){var s=i.next(),o=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){n=F.INTERIOR;break}if(o.isInResult()){n=F.EXTERIOR;break}}}if(n===F.NONE)return null;for(var a=n,u=this.iterator();u.hasNext();){var l=u.next(),h=l.getSym();l.isLineEdge()?l.getEdge().setCovered(a===F.INTERIOR):(l.isInResult()&&(a=F.EXTERIOR),h.isInResult()&&(a=F.INTERIOR))}},t.prototype.computeLabelling=function(n){var i=this;r.prototype.computeLabelling.call(this,n),this._label=new Ht(F.NONE);for(var s=this.iterator();s.hasNext();)for(var o=s.next(),a=o.getEdge(),u=a.getLabel(),l=0;l<2;l++){var h=u.getLocation(l);(h===F.INTERIOR||h===F.BOUNDARY)&&i._label.setLocation(l,F.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(qe),Op=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.createNode=function(n){return new rh(n,new L_)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ha),es=function r(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=r.orientation(t)};es.prototype.compareTo=function(t){var e=t,n=es.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return n},es.prototype.interfaces_=function(){return[Gr]},es.prototype.getClass=function(){return es},es.orientation=function(t){return Mt.increasingDirection(t)===1},es.compareOriented=function(t,e,n,i){for(var s=e?1:-1,o=i?1:-1,a=e?t.length:-1,u=i?n.length:-1,l=e?0:t.length-1,h=i?0:n.length-1;;){var c=t[l].compareTo(n[h]);if(c!==0)return c;l+=s,h+=o;var f=l===a,p=h===u;if(f&&!p)return-1;if(!f&&p)return 1;if(f&&p)return 0}};var ln=function(){this._edges=new B,this._ocaMap=new Ue};ln.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var n=0;n<this._edges.size();n++){var i=e._edges.get(n);n>0&&t.print(","),t.print("(");for(var s=i.getCoordinates(),o=0;o<s.length;o++)o>0&&t.print(","),t.print(s[o].x+" "+s[o].y);t.println(")")}t.print(") ")},ln.prototype.addAll=function(t){for(var e=this,n=t.iterator();n.hasNext();)e.add(n.next())},ln.prototype.findEdgeIndex=function(t){for(var e=this,n=0;n<this._edges.size();n++)if(e._edges.get(n).equals(t))return n;return-1},ln.prototype.iterator=function(){return this._edges.iterator()},ln.prototype.getEdges=function(){return this._edges},ln.prototype.get=function(t){return this._edges.get(t)},ln.prototype.findEqualEdge=function(t){var e=new es(t.getCoordinates()),n=this._ocaMap.get(e);return n},ln.prototype.add=function(t){this._edges.add(t);var e=new es(t.getCoordinates());this._ocaMap.put(e,t)},ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln};var xs=function(){};xs.prototype.processIntersections=function(t,e,n,i){},xs.prototype.isDone=function(){},xs.prototype.interfaces_=function(){return[]},xs.prototype.getClass=function(){return xs};var Or=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Or.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&this._li.getIntersectionNum()===1){if(Or.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var s=t.size()-1;if(e===0&&i===s||i===0&&e===s)return!0}}return!1},Or.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Or.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Or.prototype.getLineIntersector=function(){return this._li},Or.prototype.hasProperIntersection=function(){return this._hasProper},Or.prototype.processIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var s=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Or.prototype.hasIntersection=function(){return this._hasIntersection},Or.prototype.isDone=function(){return!1},Or.prototype.hasInteriorIntersection=function(){return this._hasInterior},Or.prototype.interfaces_=function(){return[xs]},Or.prototype.getClass=function(){return Or},Or.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Tn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new D(t),this.segmentIndex=e,this.dist=n};Tn.prototype.getSegmentIndex=function(){return this.segmentIndex},Tn.prototype.getCoordinate=function(){return this.coord},Tn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Tn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Tn.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},Tn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Tn.prototype.getDistance=function(){return this.dist},Tn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Tn.prototype.interfaces_=function(){return[Gr]},Tn.prototype.getClass=function(){return Tn};var ni=function(){this._nodeMap=new Ue,this.edge=null;var t=arguments[0];this.edge=t};ni.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},ni.prototype.iterator=function(){return this._nodeMap.values().iterator()},ni.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next(),o=e.createSplitEdge(i,s);t.add(o),i=s}},ni.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},ni.prototype.createSplitEdge=function(t,e){var n=this,i=e.segmentIndex-t.segmentIndex+2,s=this.edge.pts[e.segmentIndex],o=e.dist>0||!e.coord.equals2D(s);o||i--;var a=new Array(i).fill(null),u=0;a[u++]=new D(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=n.edge.pts[l];return o&&(a[u]=e.coord),new ih(a,new Ht(this.edge._label))},ni.prototype.add=function(t,e,n){var i=new Tn(t,e,n),s=this._nodeMap.get(i);return s!==null?s:(this._nodeMap.put(i,i),i)},ni.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();if(n.coord.equals(t))return!0}return!1},ni.prototype.interfaces_=function(){return[]},ni.prototype.getClass=function(){return ni};var Os=function(){};Os.prototype.getChainStartIndices=function(t){var e=this,n=0,i=new B;i.add(new yn(n));do{var s=e.findChainEnd(t,n);i.add(new yn(s)),n=s}while(n<t.length-1);var o=Os.toIntArray(i);return o},Os.prototype.findChainEnd=function(t,e){for(var n=Yt.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var s=Yt.quadrant(t[i-1],t[i]);if(s!==n)break;i++}return i-1},Os.prototype.interfaces_=function(){return[]},Os.prototype.getClass=function(){return Os},Os.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var xi=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new st,this.env2=new st;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Os;this.startIndex=e.getChainStartIndices(this.pts)};xi.prototype.getCoordinates=function(){return this.pts},xi.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},xi.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},xi.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],i)}else if(arguments.length===6){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],h=arguments[5],c=this.pts[s],f=this.pts[o],p=a.pts[u],v=a.pts[l];if(o-s===1&&l-u===1)return h.addIntersections(this.e,s,a.e,u),null;if(this.env1.init(c,f),this.env2.init(p,v),!this.env1.intersects(this.env2))return null;var _=Math.trunc((s+o)/2),w=Math.trunc((u+l)/2);s<_&&(u<w&&this.computeIntersectsForChain(s,_,a,u,w,h),w<l&&this.computeIntersectsForChain(s,_,a,w,l,h)),_<o&&(u<w&&this.computeIntersectsForChain(_,o,a,u,w,h),w<l&&this.computeIntersectsForChain(_,o,a,w,l,h))}},xi.prototype.getStartIndexes=function(){return this.startIndex},xi.prototype.computeIntersects=function(t,e){for(var n=this,i=0;i<this.startIndex.length-1;i++)for(var s=0;s<t.startIndex.length-1;s++)n.computeIntersectsForChain(i,t,s,e)},xi.prototype.interfaces_=function(){return[]},xi.prototype.getClass=function(){return xi};var Ae=function r(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var n=0;n<3;n++)t._depth[e][n]=r.NULL_VALUE},Ap={NULL_VALUE:{configurable:!0}};Ae.prototype.getDepth=function(t,e){return this._depth[t][e]},Ae.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},Ae.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var n=0;n<3;n++)if(t._depth[e][n]!==Ae.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===Ae.NULL_VALUE}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._depth[s][o]===Ae.NULL_VALUE}},Ae.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var n=t._depth[e][1];t._depth[e][2]<n&&(n=t._depth[e][2]),n<0&&(n=0);for(var i=1;i<3;i++){var s=0;t._depth[e][i]>n&&(s=1),t._depth[e][i]=s}}},Ae.prototype.getDelta=function(t){return this._depth[t][H.RIGHT]-this._depth[t][H.LEFT]},Ae.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?F.EXTERIOR:F.INTERIOR},Ae.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Ae.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],n=0;n<2;n++)for(var i=1;i<3;i++){var s=e.getLocation(n,i);(s===F.EXTERIOR||s===F.INTERIOR)&&(t.isNull(n,i)?t._depth[n][i]=Ae.depthAtLocation(s):t._depth[n][i]+=Ae.depthAtLocation(s))}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];u===F.INTERIOR&&this._depth[o][a]++}},Ae.prototype.interfaces_=function(){return[]},Ae.prototype.getClass=function(){return Ae},Ae.depthAtLocation=function(t){return t===F.EXTERIOR?0:t===F.INTERIOR?1:Ae.NULL_VALUE},Ap.NULL_VALUE.get=function(){return-1},Object.defineProperties(Ae,Ap);var ih=function(r){function t(){if(r.call(this),this.pts=null,this._env=null,this.eiList=new ni(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Ae,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.pts=n,this._label=i}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var i=new t(n,Ht.toLineLabel(this._label));return i},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(n){this._isIsolated=n},t.prototype.setName=function(n){this._name=n},t.prototype.equals=function(n){var i=this;if(!(n instanceof t))return!1;var s=n;if(this.pts.length!==s.pts.length)return!1;for(var o=!0,a=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(i.pts[l].equals2D(s.pts[l])||(o=!1),i.pts[l].equals2D(s.pts[--u])||(a=!1),!o&&!a)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},t.prototype.print=function(n){var i=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&n.print(","),n.print(i.pts[s].x+" "+i.pts[s].y);n.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(n){t.updateIM(this._label,n)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(n){var i=this;n.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)n.print(i.pts[s]+" ");n.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new xi(this)),this._mce},t.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new st;for(var i=0;i<this.pts.length;i++)n._env.expandToInclude(n.pts[i])}return this._env},t.prototype.addIntersection=function(n,i,s,o){var a=new D(n.getIntersection(o)),u=i,l=n.getEdgeDistance(s,o),h=u+1;if(h<this.pts.length){var c=this.pts[h];a.equals2D(c)&&(u=h,l=0)}this.eiList.add(a,u,l)},t.prototype.toString=function(){var n=this,i=new mn;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&i.append(","),i.append(n.pts[s].x+" "+n.pts[s].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},t.prototype.isPointwiseEqual=function(n){var i=this;if(this.pts.length!==n.pts.length)return!1;for(var s=0;s<this.pts.length;s++)if(!i.pts[s].equals2D(n.pts[s]))return!1;return!0},t.prototype.setDepthDelta=function(n){this._depthDelta=n},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(n,i,s){for(var o=this,a=0;a<n.getIntersectionNum();a++)o.addIntersection(n,i,s,a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];i.setAtLeastIfValid(n.getLocation(0,H.ON),n.getLocation(1,H.ON),1),n.isArea()&&(i.setAtLeastIfValid(n.getLocation(0,H.LEFT),n.getLocation(1,H.LEFT),2),i.setAtLeastIfValid(n.getLocation(0,H.RIGHT),n.getLocation(1,H.RIGHT),2))}else return r.prototype.updateIM.apply(this,arguments)},t}(br),Be=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new ln,this._bufParams=t||null};Be.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},Be.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new Ht(t.getLabel()),i.flip()),n.merge(i);var s=Be.depthDelta(i),o=e.getDepthDelta(),a=o+s;e.setDepthDelta(a)}else this._edgeList.add(t),t.setDepthDelta(Be.depthDelta(t.getLabel()))},Be.prototype.buildSubgraphs=function(t,e){for(var n=new B,i=t.iterator();i.hasNext();){var s=i.next(),o=s.getRightmostCoordinate(),a=new po(n),u=a.getDepth(o);s.computeDepth(u),s.findResultEdges(),n.add(s),e.add(s.getDirectedEdges(),s.getNodes())}},Be.prototype.createSubgraphs=function(t){for(var e=new B,n=t.getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isVisited()){var s=new Ye;s.create(i),e.add(s)}}return un.sort(e,un.reverseOrder()),e},Be.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},Be.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new Gc,n=new Ps;return n.setPrecisionModel(t),e.setSegmentIntersector(new Or(n)),e},Be.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;n===null&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new nr(n,this._bufParams),s=new Wr(t,e,i),o=s.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,n),this._graph=new oe(new Op),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),u=new gr(this._geomFact);this.buildSubgraphs(a,u);var l=u.getPolygons();if(l.size()<=0)return this.createEmptyResultGeometry();var h=this._geomFact.buildGeometry(l);return h},Be.prototype.computeNodedEdges=function(t,e){var n=this,i=this.getNoder(e);i.computeNodes(t);for(var s=i.getNodedSubstrings(),o=s.iterator();o.hasNext();){var a=o.next(),u=a.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=a.getData(),h=new ih(a.getCoordinates(),new Ht(l));n.insertUniqueEdge(h)}}},Be.prototype.setNoder=function(t){this._workingNoder=t},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Be.depthDelta=function(t){var e=t.getLocation(0,H.LEFT),n=t.getLocation(0,H.RIGHT);return e===F.INTERIOR&&n===F.EXTERIOR?1:e===F.EXTERIOR&&n===F.INTERIOR?-1:0},Be.convertSegStrings=function(t){for(var e=new Nt,n=new B;t.hasNext();){var i=t.next(),s=e.createLineString(i.getCoordinates());n.add(s)}return e.buildGeometry(n)};var rs=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=i,this._offsetX=s,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};rs.prototype.rescale=function(){var t=this;if(dt(arguments[0],Ee))for(var e=arguments[0],n=e.iterator();n.hasNext();){var i=n.next();t.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var s=arguments[0],o=0;o<s.length;o++)s[o].x=s[o].x/t._scaleFactor+t._offsetX,s[o].y=s[o].y/t._scaleFactor+t._offsetY;s.length===2&&s[0].equals2D(s[1])&&Oe.out.println(s)}},rs.prototype.scale=function(){var t=this;if(dt(arguments[0],Ee)){for(var e=arguments[0],n=new B,i=e.iterator();i.hasNext();){var s=i.next();n.add(new de(t.scale(s.getCoordinates()),s.getData()))}return n}else if(arguments[0]instanceof Array){for(var o=arguments[0],a=new Array(o.length).fill(null),u=0;u<o.length;u++)a[u]=new D(Math.round((o[u].x-t._offsetX)*t._scaleFactor),Math.round((o[u].y-t._offsetY)*t._scaleFactor),o[u].z);var l=Mt.removeRepeatedPoints(a);return l}},rs.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},rs.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},rs.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},rs.prototype.interfaces_=function(){return[bs]},rs.prototype.getClass=function(){return rs};var xn=function(){this._li=new Ps,this._segStrings=null;var t=arguments[0];this._segStrings=t},Dp={fact:{configurable:!0}};xn.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next(),i=n.getCoordinates();t.checkEndPtVertexIntersections(i[0],t._segStrings),t.checkEndPtVertexIntersections(i[i.length-1],t._segStrings)}else if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=o.iterator();a.hasNext();)for(var u=a.next(),l=u.getCoordinates(),h=1;h<l.length-1;h++)if(l[h].equals(s))throw new wi("found endpt/interior pt intersection at index "+h+" :pt "+s)}},xn.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var n=e.next(),i=this._segStrings.iterator();i.hasNext();){var s=i.next();t.checkInteriorIntersections(n,s)}else if(arguments.length===2)for(var o=arguments[0],a=arguments[1],u=o.getCoordinates(),l=a.getCoordinates(),h=0;h<u.length-1;h++)for(var c=0;c<l.length-1;c++)t.checkInteriorIntersections(o,h,a,c);else if(arguments.length===4){var f=arguments[0],p=arguments[1],v=arguments[2],_=arguments[3];if(f===v&&p===_)return null;var w=f.getCoordinates()[p],I=f.getCoordinates()[p+1],y=v.getCoordinates()[_],E=v.getCoordinates()[_+1];if(this._li.computeIntersection(w,I,y,E),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,w,I)||this.hasInteriorIntersection(this._li,y,E)))throw new wi("found non-noded intersection at "+w+"-"+I+" and "+y+"-"+E)}},xn.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},xn.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next();t.checkCollapses(n)}else if(arguments.length===1)for(var i=arguments[0],s=i.getCoordinates(),o=0;o<s.length-2;o++)t.checkCollapse(s[o],s[o+1],s[o+2])},xn.prototype.hasInteriorIntersection=function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++){var s=t.getIntersection(i);if(!(s.equals(e)||s.equals(n)))return!0}return!1},xn.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new wi("found non-noded collapse at "+xn.fact.createLineString([t,e,n]))},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn},Dp.fact.get=function(){return new Nt},Object.defineProperties(xn,Dp);var ir=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new ne("Scale factor must be non-zero");e!==1&&(this._pt=new D(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new D,this._p1Scaled=new D),this.initCorners(this._pt)},Lp={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};ir.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),i=Math.max(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.y,e.y),a=this._maxx<n||this._minx>i||this._maxy<s||this._miny>o;if(a)return!1;var u=this.intersectsToleranceSquare(t,e);return St.isTrue(!(a&&u),"Found bad envelope test"),u},ir.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new D(this._maxx,this._maxy),this._corner[1]=new D(this._minx,this._maxy),this._corner[2]=new D(this._minx,this._miny),this._corner[3]=new D(this._maxx,this._miny)},ir.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},ir.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},ir.prototype.getCoordinate=function(){return this._originalPt},ir.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},ir.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=ir.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new st(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},ir.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))},ir.prototype.intersectsToleranceSquare=function(t,e){var n=!1,i=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||n&&i||t.equals(this._pt)||e.equals(this._pt))},ir.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return this.intersects(n,i)?(t.addIntersection(this.getCoordinate(),e),!0):!1},ir.prototype.interfaces_=function(){return[]},ir.prototype.getClass=function(){return ir},Lp.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(ir,Lp);var zu=function(){this.tempEnv1=new st,this.selectedSegment=new ot};zu.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}},zu.prototype.interfaces_=function(){return[]},zu.prototype.getClass=function(){return zu};var ga=function(){this._index=null;var t=arguments[0];this._index=t},Rp={HotPixelSnapAction:{configurable:!0}};ga.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2],s=e.getSafeEnvelope(),o=new Fp(e,n,i);return this._index.query(s,{interfaces_:function(){return[ji]},visitItem:function(a){var u=a;u.select(s,o)}}),o.isNodeAdded()}},ga.prototype.interfaces_=function(){return[]},ga.prototype.getClass=function(){return ga},Rp.HotPixelSnapAction.get=function(){return Fp},Object.defineProperties(ga,Rp);var Fp=function(r){function t(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=i}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1],s=n.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,i)}else return r.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(zu),vo=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new B};vo.prototype.processIntersections=function(t,e,n,i){var s=this;if(t===n&&e===i)return null;var o=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];if(this._li.computeIntersection(o,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var h=0;h<this._li.getIntersectionNum();h++)s._interiorIntersections.add(s._li.getIntersection(h));t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)}},vo.prototype.isDone=function(){return!1},vo.prototype.getInteriorIntersections=function(){return this._interiorIntersections},vo.prototype.interfaces_=function(){return[xs]},vo.prototype.getClass=function(){return vo};var ii=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new Ps,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};ii.prototype.checkCorrectness=function(t){var e=de.getNodedSubstrings(t),n=new xn(e);try{n.checkValid()}catch(i){if(i instanceof pp)i.printStackTrace();else throw i}finally{}},ii.prototype.getNodedSubstrings=function(){return de.getNodedSubstrings(this._nodedSegStrings)},ii.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},ii.prototype.findInteriorIntersections=function(t,e){var n=new vo(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},ii.prototype.computeVertexSnaps=function(){var t=this;if(dt(arguments[0],Ee))for(var e=arguments[0],n=e.iterator();n.hasNext();){var i=n.next();t.computeVertexSnaps(i)}else if(arguments[0]instanceof de)for(var s=arguments[0],o=s.getCoordinates(),a=0;a<o.length;a++){var u=new ir(o[a],t._scaleFactor,t._li),l=t._pointSnapper.snap(u,s,a);l&&s.addIntersection(o[a],a)}},ii.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new Gc,this._pointSnapper=new ga(this._noder.getIndex()),this.snapRound(t,this._li)},ii.prototype.computeIntersectionSnaps=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next(),s=new ir(i,e._scaleFactor,e._li);e._pointSnapper.snap(s)}},ii.prototype.interfaces_=function(){return[bs]},ii.prototype.getClass=function(){return ii};var De=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Vt,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},pa={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};De.prototype.bufferFixedPrecision=function(t){var e=new rs(new ii(new kt(1)),t.getScale()),n=new Be(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},De.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=De.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(o){if(o instanceof Ni)t._saveException=o;else throw o}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],i=De.precisionScaleFactor(this._argGeom,this._distance,n),s=new kt(i);this.bufferFixedPrecision(s)}},De.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===kt.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},De.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},De.prototype.bufferOriginalPrecision=function(){try{var t=new Be(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof wi)this._saveException=e;else throw e}finally{}},De.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},De.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De},De.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new De(t),i=n.getResultGeometry(e);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ft&&typeof arguments[1]=="number"){var s=arguments[0],o=arguments[1],a=arguments[2],u=new De(s);u.setQuadrantSegments(a);var l=u.getResultGeometry(o);return l}else if(arguments[2]instanceof Vt&&arguments[0]instanceof ft&&typeof arguments[1]=="number"){var h=arguments[0],c=arguments[1],f=arguments[2],p=new De(h,f),v=p.getResultGeometry(c);return v}}else if(arguments.length===4){var _=arguments[0],w=arguments[1],I=arguments[2],y=arguments[3],E=new De(_);E.setQuadrantSegments(I),E.setEndCapStyle(y);var m=E.getResultGeometry(w);return m}},De.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),s=Nr.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),o=e>0?e:0,a=s+2*o,u=Math.trunc(Math.log(a)/Math.log(10)+1),l=n-u,h=Math.pow(10,l);return h},pa.CAP_ROUND.get=function(){return Vt.CAP_ROUND},pa.CAP_BUTT.get=function(){return Vt.CAP_FLAT},pa.CAP_FLAT.get=function(){return Vt.CAP_FLAT},pa.CAP_SQUARE.get=function(){return Vt.CAP_SQUARE},pa.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(De,pa);var Qe=function(){this._pt=[new D,new D],this._distance=vt.NaN,this._isNull=!0};Qe.prototype.getCoordinates=function(){return this._pt},Qe.prototype.getCoordinate=function(t){return this._pt[t]},Qe.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},Qe.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},Qe.prototype.getDistance=function(){return this._distance},Qe.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},Qe.prototype.interfaces_=function(){return[]},Qe.prototype.getClass=function(){return Qe};var si=function(){};si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si},si.computeDistance=function(){if(arguments[2]instanceof Qe&&arguments[0]instanceof ue&&arguments[1]instanceof D)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=t.getCoordinates(),s=new ot,o=0;o<i.length-1;o++){s.setCoordinates(i[o],i[o+1]);var a=s.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof Qe&&arguments[0]instanceof we&&arguments[1]instanceof D){var u=arguments[0],l=arguments[1],h=arguments[2];si.computeDistance(u.getExteriorRing(),l,h);for(var c=0;c<u.getNumInteriorRing();c++)si.computeDistance(u.getInteriorRingN(c),l,h)}else if(arguments[2]instanceof Qe&&arguments[0]instanceof ft&&arguments[1]instanceof D){var f=arguments[0],p=arguments[1],v=arguments[2];if(f instanceof ue)si.computeDistance(f,p,v);else if(f instanceof we)si.computeDistance(f,p,v);else if(f instanceof He)for(var _=f,w=0;w<_.getNumGeometries();w++){var I=_.getGeometryN(w);si.computeDistance(I,p,v)}else v.setMinimum(f.getCoordinate(),p)}else if(arguments[2]instanceof Qe&&arguments[0]instanceof ot&&arguments[1]instanceof D){var y=arguments[0],E=arguments[1],m=arguments[2],S=y.closestPoint(E);m.setMinimum(S,E)}};var As=function(t){this._maxPtDist=new Qe,this._inputGeom=t||null},kc={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};As.prototype.computeMaxMidpointDistance=function(t){var e=new ns(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},As.prototype.computeMaxVertexDistance=function(t){var e=new mo(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},As.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},As.prototype.getDistancePoints=function(){return this._maxPtDist},As.prototype.interfaces_=function(){return[]},As.prototype.getClass=function(){return As},kc.MaxPointDistanceFilter.get=function(){return mo},kc.MaxMidpointDistanceFilter.get=function(){return ns},Object.defineProperties(As,kc);var mo=function(t){this._maxPtDist=new Qe,this._minPtDist=new Qe,this._geom=t||null};mo.prototype.filter=function(t){this._minPtDist.initialize(),si.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},mo.prototype.getMaxPointDistance=function(){return this._maxPtDist},mo.prototype.interfaces_=function(){return[Zn]},mo.prototype.getClass=function(){return mo};var ns=function(t){this._maxPtDist=new Qe,this._minPtDist=new Qe,this._geom=t||null};ns.prototype.filter=function(t,e){if(e===0)return null;var n=t.getCoordinate(e-1),i=t.getCoordinate(e),s=new D((n.x+i.x)/2,(n.y+i.y)/2);this._minPtDist.initialize(),si.computeDistance(this._geom,s,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ns.prototype.isDone=function(){return!1},ns.prototype.isGeometryChanged=function(){return!1},ns.prototype.getMaxPointDistance=function(){return this._maxPtDist},ns.prototype.interfaces_=function(){return[on]},ns.prototype.getClass=function(){return ns};var Oi=function(t){this._comps=t||null};Oi.prototype.filter=function(t){t instanceof we&&this._comps.add(t)},Oi.prototype.interfaces_=function(){return[Sn]},Oi.prototype.getClass=function(){return Oi},Oi.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return Oi.getPolygons(t,new B)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof we?n.add(e):e instanceof He&&e.apply(new Oi(n)),n}};var Le=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};Le.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof $n){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof ue&&this._lines.add(t)},Le.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Le.prototype.interfaces_=function(){return[Si]},Le.prototype.getClass=function(){return Le},Le.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(Le.getLines(t))}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Le.getLines(e,n))}},Le.getLines=function(){if(arguments.length===1){var t=arguments[0];return Le.getLines(t,!1)}else if(arguments.length===2){if(dt(arguments[0],Ee)&&dt(arguments[1],Ee)){for(var e=arguments[0],n=arguments[1],i=e.iterator();i.hasNext();){var s=i.next();Le.getLines(s,n)}return n}else if(arguments[0]instanceof ft&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1],u=new B;return o.apply(new Le(u,a)),u}else if(arguments[0]instanceof ft&&dt(arguments[1],Ee)){var l=arguments[0],h=arguments[1];return l instanceof ue?h.add(l):l.apply(new Le(h)),h}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&dt(arguments[0],Ee)&&dt(arguments[1],Ee)){for(var c=arguments[0],f=arguments[1],p=arguments[2],v=c.iterator();v.hasNext();){var _=v.next();Le.getLines(_,f,p)}return f}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof ft&&dt(arguments[1],Ee)){var w=arguments[0],I=arguments[1],y=arguments[2];return w.apply(new Le(I,y)),I}}};var hn=function(){if(this._boundaryRule=Vr.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t===null)throw new ne("Rule must be non-null");this._boundaryRule=t}}};hn.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof D&&arguments[1]instanceof we){var e=arguments[0],n=arguments[1];if(n.isEmpty())return F.EXTERIOR;var i=n.getExteriorRing(),s=this.locateInPolygonRing(e,i);if(s===F.EXTERIOR)return F.EXTERIOR;if(s===F.BOUNDARY)return F.BOUNDARY;for(var o=0;o<n.getNumInteriorRing();o++){var a=n.getInteriorRingN(o),u=t.locateInPolygonRing(e,a);if(u===F.INTERIOR)return F.EXTERIOR;if(u===F.BOUNDARY)return F.BOUNDARY}return F.INTERIOR}else if(arguments[0]instanceof D&&arguments[1]instanceof ue){var l=arguments[0],h=arguments[1];if(!h.getEnvelopeInternal().intersects(l))return F.EXTERIOR;var c=h.getCoordinates();return!h.isClosed()&&(l.equals(c[0])||l.equals(c[c.length-1]))?F.BOUNDARY:K.isOnLine(l,c)?F.INTERIOR:F.EXTERIOR}else if(arguments[0]instanceof D&&arguments[1]instanceof dr){var f=arguments[0],p=arguments[1],v=p.getCoordinate();return v.equals2D(f)?F.INTERIOR:F.EXTERIOR}},hn.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?K.locatePointInRing(t,e.getCoordinates()):F.EXTERIOR},hn.prototype.intersects=function(t,e){return this.locate(t,e)!==F.EXTERIOR},hn.prototype.updateLocationInfo=function(t){t===F.INTERIOR&&(this._isIn=!0),t===F.BOUNDARY&&this._numBoundaries++},hn.prototype.computeLocation=function(t,e){var n=this;if(e instanceof dr&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof ue)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof we)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Ns)for(var i=e,s=0;s<i.getNumGeometries();s++){var o=i.getGeometryN(s);n.updateLocationInfo(n.locateInternal(t,o))}else if(e instanceof jn)for(var a=e,u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);n.updateLocationInfo(n.locateInternal(t,l))}else if(e instanceof He)for(var h=new ri(e);h.hasNext();){var c=h.next();c!==e&&n.computeLocation(t,c)}},hn.prototype.locate=function(t,e){return e.isEmpty()?F.EXTERIOR:e instanceof ue?this.locateInternal(t,e):e instanceof we?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?F.BOUNDARY:this._numBoundaries>0||this._isIn?F.INTERIOR:F.EXTERIOR)},hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn};var Ke=function r(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];r.call(this,t,r.INSIDE_AREA,e)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._component=n,this._segIndex=i,this._pt=s}},Gp={INSIDE_AREA:{configurable:!0}};Ke.prototype.isInsideArea=function(){return this._segIndex===Ke.INSIDE_AREA},Ke.prototype.getCoordinate=function(){return this._pt},Ke.prototype.getGeometryComponent=function(){return this._component},Ke.prototype.getSegmentIndex=function(){return this._segIndex},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke},Gp.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Ke,Gp);var is=function(t){this._pts=t||null};is.prototype.filter=function(t){t instanceof dr&&this._pts.add(t)},is.prototype.interfaces_=function(){return[Sn]},is.prototype.getClass=function(){return is},is.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof dr?un.singletonList(t):is.getPoints(t,new B)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof dr?n.add(e):e instanceof He&&e.apply(new is(n)),n}};var yo=function(){this._locations=null;var t=arguments[0];this._locations=t};yo.prototype.filter=function(t){(t instanceof dr||t instanceof ue||t instanceof we)&&this._locations.add(new Ke(t,0,t.getCoordinate()))},yo.prototype.interfaces_=function(){return[Sn]},yo.prototype.getClass=function(){return yo},yo.getLocations=function(t){var e=new B;return t.apply(new yo(e)),e};var Re=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new hn,this._minDistanceLocation=null,this._minDistance=vt.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=i,this._terminateDistance=s}};Re.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=1-n,o=Oi.getPolygons(this._geom[n]);if(o.size()>0){var a=yo.getLocations(this._geom[s]);if(this.computeContainmentDistance(a,o,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=i[0],this._minDistanceLocation[n]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&dt(arguments[0],nn)&&dt(arguments[1],nn)){for(var u=arguments[0],l=arguments[1],h=arguments[2],c=0;c<u.size();c++)for(var f=u.get(c),p=0;p<l.size();p++)if(t.computeContainmentDistance(f,l.get(p),h),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Ke&&arguments[1]instanceof we){var v=arguments[0],_=arguments[1],w=arguments[2],I=v.getCoordinate();if(F.EXTERIOR!==this._ptLocator.locate(I,_))return this._minDistance=0,w[0]=v,w[1]=new Ke(_,I),null}}},Re.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var i=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(o,u,n),i._minDistance<=i._terminateDistance)return null}},Re.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Le.getLines(this._geom[0]),n=Le.getLines(this._geom[1]),i=is.getPoints(this._geom[0]),s=is.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,s,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(i,s,t),this.updateMinDistance(t,!1)},Re.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Re.prototype.updateMinDistance=function(t,e){if(t[0]===null)return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Re.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},Re.prototype.computeMinDistance=function(){var t=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof ue&&arguments[1]instanceof dr){var e=arguments[0],n=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(n.getEnvelopeInternal())>this._minDistance)return null;for(var s=e.getCoordinates(),o=n.getCoordinate(),a=0;a<s.length-1;a++){var u=K.distancePointLine(o,s[a],s[a+1]);if(u<t._minDistance){t._minDistance=u;var l=new ot(s[a],s[a+1]),h=l.closestPoint(o);i[0]=new Ke(e,a,h),i[1]=new Ke(n,0,o)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof ue&&arguments[1]instanceof ue){var c=arguments[0],f=arguments[1],p=arguments[2];if(c.getEnvelopeInternal().distance(f.getEnvelopeInternal())>this._minDistance)return null;for(var v=c.getCoordinates(),_=f.getCoordinates(),w=0;w<v.length-1;w++)for(var I=0;I<_.length-1;I++){var y=K.distanceLineLine(v[w],v[w+1],_[I],_[I+1]);if(y<t._minDistance){t._minDistance=y;var E=new ot(v[w],v[w+1]),m=new ot(_[I],_[I+1]),S=E.closestPoints(m);p[0]=new Ke(c,w,S[0]),p[1]=new Ke(f,I,S[1])}if(t._minDistance<=t._terminateDistance)return null}}}},Re.prototype.computeMinDistancePoints=function(t,e,n){for(var i=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var u=e.get(a),l=o.getCoordinate().distance(u.getCoordinate());if(l<i._minDistance&&(i._minDistance=l,n[0]=new Ke(o,0,o.getCoordinate()),n[1]=new Ke(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},Re.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new ne("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Re.prototype.computeMinDistanceLines=function(t,e,n){for(var i=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(o,u,n),i._minDistance<=i._terminateDistance)return null}},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re},Re.distance=function(t,e){var n=new Re(t,e);return n.distance()},Re.isWithinDistance=function(t,e,n){var i=new Re(t,e,n);return i.distance()<=n},Re.nearestPoints=function(t,e){var n=new Re(t,e);return n.nearestPoints()};var We=function(){this._pt=[new D,new D],this._distance=vt.NaN,this._isNull=!0};We.prototype.getCoordinates=function(){return this._pt},We.prototype.getCoordinate=function(t){return this._pt[t]},We.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},We.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},We.prototype.toString=function(){return rn.toLineString(this._pt[0],this._pt[1])},We.prototype.getDistance=function(){return this._distance},We.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var On=function(){};On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On},On.computeDistance=function(){if(arguments[2]instanceof We&&arguments[0]instanceof ue&&arguments[1]instanceof D)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=new ot,s=t.getCoordinates(),o=0;o<s.length-1;o++){i.setCoordinates(s[o],s[o+1]);var a=i.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof We&&arguments[0]instanceof we&&arguments[1]instanceof D){var u=arguments[0],l=arguments[1],h=arguments[2];On.computeDistance(u.getExteriorRing(),l,h);for(var c=0;c<u.getNumInteriorRing();c++)On.computeDistance(u.getInteriorRingN(c),l,h)}else if(arguments[2]instanceof We&&arguments[0]instanceof ft&&arguments[1]instanceof D){var f=arguments[0],p=arguments[1],v=arguments[2];if(f instanceof ue)On.computeDistance(f,p,v);else if(f instanceof we)On.computeDistance(f,p,v);else if(f instanceof He)for(var _=f,w=0;w<_.getNumGeometries();w++){var I=_.getGeometryN(w);On.computeDistance(I,p,v)}else v.setMinimum(f.getCoordinate(),p)}else if(arguments[2]instanceof We&&arguments[0]instanceof ot&&arguments[1]instanceof D){var y=arguments[0],E=arguments[1],m=arguments[2],S=y.closestPoint(E);m.setMinimum(S,E)}};var Xr=function(){this._g0=null,this._g1=null,this._ptDist=new We,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Vc={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Xr.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Xr.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new ne("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Xr.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Xr.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Xr.prototype.computeOrientedDistance=function(t,e,n){var i=new _o(e);if(t.apply(i),n.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var s=new ss(e,this._densifyFrac);t.apply(s),n.setMaximum(s.getMaxPointDistance())}},Xr.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Xr(t,e);return n.distance()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=new Xr(i,s);return a.setDensifyFraction(o),a.distance()}},Vc.MaxPointDistanceFilter.get=function(){return _o},Vc.MaxDensifiedByFractionDistanceFilter.get=function(){return ss},Object.defineProperties(Xr,Vc);var _o=function(){this._maxPtDist=new We,this._minPtDist=new We,this._euclideanDist=new On,this._geom=null;var t=arguments[0];this._geom=t};_o.prototype.filter=function(t){this._minPtDist.initialize(),On.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},_o.prototype.getMaxPointDistance=function(){return this._maxPtDist},_o.prototype.interfaces_=function(){return[Zn]},_o.prototype.getClass=function(){return _o};var ss=function(){this._maxPtDist=new We,this._minPtDist=new We,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};ss.prototype.filter=function(t,e){var n=this;if(e===0)return null;for(var i=t.getCoordinate(e-1),s=t.getCoordinate(e),o=(s.x-i.x)/this._numSubSegs,a=(s.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=i.x+u*o,h=i.y+u*a,c=new D(l,h);n._minPtDist.initialize(),On.computeDistance(n._geom,c,n._minPtDist),n._maxPtDist.setMaximum(n._minPtDist)}},ss.prototype.isDone=function(){return!1},ss.prototype.isGeometryChanged=function(){return!1},ss.prototype.getMaxPointDistance=function(){return this._maxPtDist},ss.prototype.interfaces_=function(){return[on]},ss.prototype.getClass=function(){return ss};var vr=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},Uc={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};vr.prototype.checkMaximumDistance=function(t,e,n){var i=new Xr(e,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var s=i.getCoordinates();this._errorLocation=s[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+rn.toLineString(s[0],s[1])+")"}},vr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=vr.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),vr.VERBOSE&&Oe.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},vr.prototype.checkNegativeValid=function(){if(!(this._input instanceof we||this._input instanceof jn||this._input instanceof He))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},vr.prototype.getErrorIndicator=function(){return this._errorIndicator},vr.prototype.checkMinimumDistance=function(t,e,n){var i=new Re(t,e,n);if(this._minDistanceFound=i.distance(),this._minDistanceFound<n){this._isValid=!1;var s=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+rn.toLineString(s[0],s[1])+" )"}},vr.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},vr.prototype.getErrorLocation=function(){return this._errorLocation},vr.prototype.getPolygonLines=function(t){for(var e=new B,n=new Le(e),i=Oi.getPolygons(t),s=i.iterator();s.hasNext();){var o=s.next();o.apply(n)}return t.getFactory().buildGeometry(e)},vr.prototype.getErrorMessage=function(){return this._errMsg},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr},Uc.VERBOSE.get=function(){return!1},Uc.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(vr,Uc);var Fe=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},zc={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Fe.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Fe.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Fe.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new st(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new st(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Fe.prototype.checkDistance=function(){var t=new vr(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Fe.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Fe.prototype.checkPolygonal=function(){this._result instanceof we||this._result instanceof jn||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Fe.prototype.getErrorIndicator=function(){return this._errorIndicator},Fe.prototype.getErrorLocation=function(){return this._errorLocation},Fe.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")},Fe.prototype.report=function(t){if(!Fe.VERBOSE)return null;Oe.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Fe.prototype.getErrorMessage=function(){return this._errorMsg},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe},Fe.isValidMsg=function(t,e,n){var i=new Fe(t,e,n);return i.isValid()?null:i.getErrorMessage()},Fe.isValid=function(t,e,n){var i=new Fe(t,e,n);return!!i.isValid()},zc.VERBOSE.get=function(){return!1},zc.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Fe,zc);var An=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};An.prototype.getCoordinates=function(){return this._pts},An.prototype.size=function(){return this._pts.length},An.prototype.getCoordinate=function(t){return this._pts[t]},An.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},An.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:fo.octant(this.getCoordinate(t),this.getCoordinate(t+1))},An.prototype.setData=function(t){this._data=t},An.prototype.getData=function(){return this._data},An.prototype.toString=function(){return rn.toLineString(new fe(this._pts))},An.prototype.interfaces_=function(){return[ei]},An.prototype.getClass=function(){return An};var Ne=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new B,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Ne.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Ne.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Ne.prototype.getIntersectionSegments=function(){return this._intSegments},Ne.prototype.count=function(){return this._intersectionCount},Ne.prototype.getIntersections=function(){return this._intersections},Ne.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ne.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Ne.prototype.processIntersections=function(t,e,n,i){if(!this._findAllIntersections&&this.hasIntersection()||t===n&&e===i)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(t,e)||this.isEndSegment(n,i);if(!s)return null}var o=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];this._li.computeIntersection(o,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=a,this._intSegments[2]=u,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Ne.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},Ne.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Ne.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},Ne.prototype.interfaces_=function(){return[xs]},Ne.prototype.getClass=function(){return Ne},Ne.createAllIntersectionsFinder=function(t){var e=new Ne(t);return e.setFindAllIntersections(!0),e},Ne.createAnyIntersectionFinder=function(t){return new Ne(t)},Ne.createIntersectionCounter=function(t){var e=new Ne(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var cn=function(){this._li=new Ps,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};cn.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},cn.prototype.getIntersections=function(){return this._segInt.getIntersections()},cn.prototype.isValid=function(){return this.execute(),this._isValid},cn.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},cn.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Ne(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Gc;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},cn.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ni(this.getErrorMessage(),this._segInt.getInteriorIntersection())},cn.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+rn.toLineString(t[0],t[1])+" and "+rn.toLineString(t[2],t[3])},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn},cn.computeIntersections=function(t){var e=new cn(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Ds=function r(){this._nv=null;var t=arguments[0];this._nv=new cn(r.toSegmentStrings(t))};Ds.prototype.checkValid=function(){this._nv.checkValid()},Ds.prototype.interfaces_=function(){return[]},Ds.prototype.getClass=function(){return Ds},Ds.toSegmentStrings=function(t){for(var e=new B,n=t.iterator();n.hasNext();){var i=n.next();e.add(new An(i.getCoordinates(),i))}return e},Ds.checkValid=function(t){var e=new Ds(t);e.checkValid()};var Eo=function(t){this._mapOp=t};Eo.prototype.map=function(t){for(var e=this,n=new B,i=0;i<t.getNumGeometries();i++){var s=e._mapOp.map(t.getGeometryN(i));s.isEmpty()||n.add(s)}return t.getFactory().createGeometryCollection(Nt.toGeometryArray(n))},Eo.prototype.interfaces_=function(){return[]},Eo.prototype.getClass=function(){return Eo},Eo.map=function(t,e){var n=new Eo(e);return n.map(t)};var Dn=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new B,this._resultLineList=new B;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};Dn.prototype.collectLines=function(t){for(var e=this,n=this._op.getGraph().getEdgeEnds().iterator();n.hasNext();){var i=n.next();e.collectLineEdge(i,t,e._lineEdgesList),e.collectBoundaryTouchEdge(i,t,e._lineEdgesList)}},Dn.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Dn.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Dn.prototype.collectLineEdge=function(t,e,n){var i=t.getLabel(),s=t.getEdge();t.isLineEdge()&&!t.isVisited()&&Et.isResultOfOp(i,e)&&!s.isCovered()&&(n.add(s),t.setVisitedEdge(!0))},Dn.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();n.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var s=i.next(),o=s.getEdge();if(s.isLineEdge()&&!o.isCoveredSet()){var a=t._op.isCoveredByA(s.getCoordinate());o.setCovered(a)}}},Dn.prototype.labelIsolatedLines=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next(),s=i.getLabel();i.isIsolated()&&(s.isNull(0)?e.labelIsolatedLine(i,0):e.labelIsolatedLine(i,1))}},Dn.prototype.buildLines=function(t){for(var e=this,n=this._lineEdgesList.iterator();n.hasNext();){var i=n.next(),s=e._geometryFactory.createLineString(i.getCoordinates());e._resultLineList.add(s),i.setInResult(!0)}},Dn.prototype.collectBoundaryTouchEdge=function(t,e,n){var i=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;St.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),Et.isResultOfOp(i,e)&&e===Et.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn};var wo=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new B;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};wo.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},wo.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,n=this._op.getGraph().getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||t===Et.INTERSECTION)){var s=i.getLabel();Et.isResultOfOp(s,t)&&e.filterCoveredNodeToPoint(i)}}},wo.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},wo.prototype.interfaces_=function(){return[]},wo.prototype.getClass=function(){return wo};var sr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};sr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},sr.prototype.transformPolygon=function(t,e){var n=this,i=!0,s=this.transformLinearRing(t.getExteriorRing(),t);(s===null||!(s instanceof $n)||s.isEmpty())&&(i=!1);for(var o=new B,a=0;a<t.getNumInteriorRing();a++){var u=n.transformLinearRing(t.getInteriorRingN(a),t);u===null||u.isEmpty()||(u instanceof $n||(i=!1),o.add(u))}if(i)return this._factory.createPolygon(s,o.toArray([]));var l=new B;return s!==null&&l.add(s),l.addAll(o),this._factory.buildGeometry(l)},sr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},sr.prototype.getInputGeometry=function(){return this._inputGeom},sr.prototype.transformMultiLineString=function(t,e){for(var n=this,i=new B,s=0;s<t.getNumGeometries();s++){var o=n.transformLineString(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},sr.prototype.transformCoordinates=function(t,e){return this.copy(t)},sr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},sr.prototype.transformMultiPoint=function(t,e){for(var n=this,i=new B,s=0;s<t.getNumGeometries();s++){var o=n.transformPoint(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},sr.prototype.transformMultiPolygon=function(t,e){for(var n=this,i=new B,s=0;s<t.getNumGeometries();s++){var o=n.transformPolygon(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},sr.prototype.copy=function(t){return t.copy()},sr.prototype.transformGeometryCollection=function(t,e){for(var n=this,i=new B,s=0;s<t.getNumGeometries();s++){var o=n.transform(t.getGeometryN(s));o!==null&&(n._pruneEmptyGeometry&&o.isEmpty()||i.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(Nt.toGeometryArray(i)):this._factory.buildGeometry(i)},sr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof dr)return this.transformPoint(t,null);if(t instanceof la)return this.transformMultiPoint(t,null);if(t instanceof $n)return this.transformLinearRing(t,null);if(t instanceof ue)return this.transformLineString(t,null);if(t instanceof Ns)return this.transformMultiLineString(t,null);if(t instanceof we)return this.transformPolygon(t,null);if(t instanceof jn)return this.transformMultiPolygon(t,null);if(t instanceof He)return this.transformGeometryCollection(t,null);throw new ne("Unknown Geometry subtype: "+t.getClass().getName())},sr.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(n===null)return this._factory.createLinearRing(null);var i=n.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr};var oi=function r(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new ot,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof ue&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];r.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];this._srcPts=n,this._isClosed=r.isClosed(n),this._snapTolerance=i}};oi.prototype.snapVertices=function(t,e){for(var n=this,i=this._isClosed?t.size()-1:t.size(),s=0;s<i;s++){var o=t.get(s),a=n.findSnapForVertex(o,e);a!==null&&(t.set(s,new D(a)),s===0&&n._isClosed&&t.set(t.size()-1,new D(a)))}},oi.prototype.findSnapForVertex=function(t,e){for(var n=this,i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<n._snapTolerance)return e[i]}return null},oi.prototype.snapTo=function(t){var e=new Nu(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var n=e.toCoordinateArray();return n},oi.prototype.snapSegments=function(t,e){var n=this;if(e.length===0)return null;var i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(var s=0;s<i;s++){var o=e[s],a=n.findSegmentIndexToSnap(o,t);a>=0&&t.add(a+1,new D(o),!1)}},oi.prototype.findSegmentIndexToSnap=function(t,e){for(var n=this,i=vt.MAX_VALUE,s=-1,o=0;o<e.size()-1;o++){if(n._seg.p0=e.get(o),n._seg.p1=e.get(o+1),n._seg.p0.equals2D(t)||n._seg.p1.equals2D(t)){if(n._allowSnappingToSourceVertices)continue;return-1}var a=n._seg.distance(t);a<n._snapTolerance&&a<i&&(i=a,s=o)}return s},oi.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var ge=function(t){this._srcGeom=t||null},kp={SNAP_PRECISION_FACTOR:{configurable:!0}};ge.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t),i=new Vp(e,n);return i.transform(this._srcGeom)},ge.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),i=new Vp(t,n,!0),s=i.transform(this._srcGeom),o=s;return e&&dt(o,$i)&&(o=s.buffer(0)),o},ge.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),n=e/10;return n},ge.prototype.extractTargetCoordinates=function(t){for(var e=new wn,n=t.getCoordinates(),i=0;i<n.length;i++)e.add(n[i]);return e.toArray(new Array(0).fill(null))},ge.prototype.computeMinimumSegmentLength=function(t){for(var e=vt.MAX_VALUE,n=0;n<t.length-1;n++){var i=t[n].distance(t[n+1]);i<e&&(e=i)}return e},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge},ge.snap=function(t,e,n){var i=new Array(2).fill(null),s=new ge(t);i[0]=s.snapTo(e,n);var o=new ge(e);return i[1]=o.snapTo(i[0],n),i},ge.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=ge.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===kt.FIXED){var i=1/n.getScale()*2/1.415;i>e&&(e=i)}return e}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return Math.min(ge.computeOverlaySnapTolerance(s),ge.computeOverlaySnapTolerance(o))}},ge.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),n=Math.min(e.getHeight(),e.getWidth()),i=n*ge.SNAP_PRECISION_FACTOR;return i},ge.snapToSelf=function(t,e,n){var i=new ge(t);return i.snapToSelf(e,n)},kp.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(ge,kp);var Vp=function(r){function t(e,n,i){r.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=i!==void 0?i:!1}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(n,i){var s=new oi(n,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(i)},t.prototype.transformCoordinates=function(n,i){var s=n.toCoordinateArray(),o=this.snapLine(s,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(sr),Ze=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Ze.prototype.getCommon=function(){return vt.longBitsToDouble(this._commonBits)},Ze.prototype.add=function(t){var e=vt.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=Ze.signExpBits(this._commonBits),this._isFirst=!1,null;var n=Ze.signExpBits(e);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Ze.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=Ze.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},Ze.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=vt.longBitsToDouble(t),n=vt.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+n,s=i.substring(i.length-64),o=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+e+" ]";return o}},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze},Ze.getBit=function(t,e){var n=1<<e;return(t&n)!==0?1:0},Ze.signExpBits=function(t){return t>>52},Ze.zeroLowerBits=function(t,e){var n=(1<<e)-1,i=~n,s=t&i;return s},Ze.numCommonMostSigMantissaBits=function(t,e){for(var n=0,i=52;i>=0;i--){if(Ze.getBit(t,i)!==Ze.getBit(e,i))return n;n++}return 52};var os=function(){this._commonCoord=null,this._ccFilter=new So},qc={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};os.prototype.addCommonBits=function(t){var e=new as(this._commonCoord);t.apply(e),t.geometryChanged()},os.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new D(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new as(e);return t.apply(n),t.geometryChanged(),t},os.prototype.getCommonCoordinate=function(){return this._commonCoord},os.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},os.prototype.interfaces_=function(){return[]},os.prototype.getClass=function(){return os},qc.CommonCoordinateFilter.get=function(){return So},qc.Translater.get=function(){return as},Object.defineProperties(os,qc);var So=function(){this._commonBitsX=new Ze,this._commonBitsY=new Ze};So.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},So.prototype.getCommonCoordinate=function(){return new D(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},So.prototype.interfaces_=function(){return[Zn]},So.prototype.getClass=function(){return So};var as=function(){this.trans=null;var t=arguments[0];this.trans=t};as.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,i)},as.prototype.isDone=function(){return!1},as.prototype.isGeometryChanged=function(){return!0},as.prototype.interfaces_=function(){return[on]},as.prototype.getClass=function(){return as};var be=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};be.prototype.selfSnap=function(t){var e=new ge(t),n=e.snapTo(t,this._snapTolerance);return n},be.prototype.removeCommonBits=function(t){this._cbr=new os,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},be.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},be.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Et.overlayOp(e[0],e[1],t);return this.prepareResult(n)},be.prototype.checkValid=function(t){t.isValid()||Oe.out.println("Snapped geometry is invalid")},be.prototype.computeSnapTolerance=function(){this._snapTolerance=ge.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},be.prototype.snap=function(t){var e=this.removeCommonBits(t),n=ge.snap(e[0],e[1],this._snapTolerance);return n},be.prototype.interfaces_=function(){return[]},be.prototype.getClass=function(){return be},be.overlayOp=function(t,e,n){var i=new be(t,e);return i.getResultGeometry(n)},be.union=function(t,e){return be.overlayOp(t,e,Et.UNION)},be.intersection=function(t,e){return be.overlayOp(t,e,Et.INTERSECTION)},be.symDifference=function(t,e){return be.overlayOp(t,e,Et.SYMDIFFERENCE)},be.difference=function(t,e){return be.overlayOp(t,e,Et.DIFFERENCE)};var $e=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};$e.prototype.getResultGeometry=function(t){var e=null,n=!1,i=null;try{e=Et.overlayOp(this._geom[0],this._geom[1],t);var s=!0;s&&(n=!0)}catch(o){if(o instanceof wi)i=o;else throw o}finally{}if(!n)try{e=be.overlayOp(this._geom[0],this._geom[1],t)}catch(o){throw o instanceof wi?i:o}finally{}return e},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e},$e.overlayOp=function(t,e,n){var i=new $e(t,e);return i.getResultGeometry(n)},$e.union=function(t,e){return $e.overlayOp(t,e,Et.UNION)},$e.intersection=function(t,e){return $e.overlayOp(t,e,Et.INTERSECTION)},$e.symDifference=function(t,e){return $e.overlayOp(t,e,Et.SYMDIFFERENCE)},$e.difference=function(t,e){return $e.overlayOp(t,e,Et.DIFFERENCE)};var qu=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};qu.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},qu.prototype.interfaces_=function(){return[]},qu.prototype.getClass=function(){return qu};var mr=function r(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],e=arguments[1];this._eventType=r.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._eventType=r.INSERT,this._label=n,this._xValue=i,this._obj=s}},Wc={INSERT:{configurable:!0},DELETE:{configurable:!0}};mr.prototype.isDelete=function(){return this._eventType===mr.DELETE},mr.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},mr.prototype.getObject=function(){return this._obj},mr.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},mr.prototype.getInsertEvent=function(){return this._insertEvent},mr.prototype.isInsert=function(){return this._eventType===mr.INSERT},mr.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},mr.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},mr.prototype.interfaces_=function(){return[Gr]},mr.prototype.getClass=function(){return mr},Wc.INSERT.get=function(){return 1},Wc.DELETE.get=function(){return 2},Object.defineProperties(mr,Wc);var sh=function(){};sh.prototype.interfaces_=function(){return[]},sh.prototype.getClass=function(){return sh};var Ge=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};Ge.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&this._li.getIntersectionNum()===1){if(Ge.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var s=t.getNumPoints()-1;if(e===0&&i===s||i===0&&e===s)return!0}}return!1},Ge.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Ge.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Ge.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Ge.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next(),s=i.getCoordinate();if(t.isIntersection(s))return!0}return!1},Ge.prototype.hasProperIntersection=function(){return this._hasProper},Ge.prototype.hasIntersection=function(){return this._hasIntersection},Ge.prototype.isDone=function(){return this._isDone},Ge.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},Ge.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Ge.prototype.addIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var s=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,u),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var R_=function(r){function t(){r.call(this),this.events=new B,this.nOverlaps=null}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var n=this;un.sort(this.events);for(var i=0;i<this.events.size();i++){var s=n.events.get(i);s.isDelete()&&s.getInsertEvent().setDeleteEventIndex(i)}},t.prototype.computeIntersections=function(){var n=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var s=0;s<this.events.size();s++){var o=n.events.get(s);if(o.isInsert()&&n.processOverlaps(s,o.getDeleteEventIndex(),o,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Ge&&dt(arguments[0],nn)&&dt(arguments[1],nn)){var a=arguments[0],u=arguments[1],l=arguments[2];this.addEdges(a,a),this.addEdges(u,u),this.computeIntersections(l)}else if(typeof arguments[2]=="boolean"&&dt(arguments[0],nn)&&arguments[1]instanceof Ge){var h=arguments[0],c=arguments[1],f=arguments[2];f?this.addEdges(h,null):this.addEdges(h),this.computeIntersections(c)}}},t.prototype.addEdge=function(n,i){for(var s=this,o=n.getMonotoneChainEdge(),a=o.getStartIndexes(),u=0;u<a.length-1;u++){var l=new qu(o,u),h=new mr(i,o.getMinX(u),l);s.events.add(h),s.events.add(new mr(o.getMaxX(u),h))}},t.prototype.processOverlaps=function(n,i,s,o){for(var a=this,u=s.getObject(),l=n;l<i;l++){var h=a.events.get(l);if(h.isInsert()){var c=h.getObject();s.isSameLabel(h)||(u.computeIntersections(c,o),a.nOverlaps++)}}},t.prototype.addEdges=function(){var n=this;if(arguments.length===1)for(var i=arguments[0],s=i.iterator();s.hasNext();){var o=s.next();n.addEdge(o,o)}else if(arguments.length===2)for(var a=arguments[0],u=arguments[1],l=a.iterator();l.hasNext();){var h=l.next();n.addEdge(h,u)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(sh),ai=function(){this._min=vt.POSITIVE_INFINITY,this._max=vt.NEGATIVE_INFINITY},Up={NodeComparator:{configurable:!0}};ai.prototype.getMin=function(){return this._min},ai.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},ai.prototype.getMax=function(){return this._max},ai.prototype.toString=function(){return rn.toLineString(new D(this._min,0),new D(this._max,0))},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai},Up.NodeComparator.get=function(){return Wu},Object.defineProperties(ai,Up);var Wu=function(){};Wu.prototype.compare=function(t,e){var n=t,i=e,s=(n._min+n._max)/2,o=(i._min+i._max)/2;return s<o?-1:s>o?1:0},Wu.prototype.interfaces_=function(){return[$o]},Wu.prototype.getClass=function(){return Wu};var F_=function(r){function t(){r.call(this),this._item=null;var e=arguments[0],n=arguments[1],i=arguments[2];this._min=e,this._max=n,this._item=i}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.query=function(n,i,s){if(!this.intersects(n,i))return null;s.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ai),G_=function(r){function t(){r.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(n,i){this._min=Math.min(n._min,i._min),this._max=Math.max(n._max,i._max)},t.prototype.query=function(n,i,s){if(!this.intersects(n,i))return null;this._node1!==null&&this._node1.query(n,i,s),this._node2!==null&&this._node2.query(n,i,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ai),ui=function(){this._leaves=new B,this._root=null,this._level=0};ui.prototype.buildTree=function(){var t=this;un.sort(this._leaves,new ai.NodeComparator);for(var e=this._leaves,n=null,i=new B;;){if(t.buildLevel(e,i),i.size()===1)return i.get(0);n=e,e=i,i=n}},ui.prototype.insert=function(t,e,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new F_(t,e,n))},ui.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},ui.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},ui.prototype.printNode=function(t){Oe.out.println(rn.toLineString(new D(t._min,this._level),new D(t._max,this._level)))},ui.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},ui.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var i=t.get(n),s=n+1<t.size()?t.get(n):null;if(s===null)e.add(i);else{var o=new G_(t.get(n),t.get(n+1));e.add(o)}}},ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui};var va=function(){this._items=new B};va.prototype.visitItem=function(t){this._items.add(t)},va.prototype.getItems=function(){return this._items},va.prototype.interfaces_=function(){return[ji]},va.prototype.getClass=function(){return va};var ma=function(){this._index=null;var t=arguments[0];if(!dt(t,$i))throw new ne("Argument must be Polygonal");this._index=new Ls(t)},Xc={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};ma.prototype.locate=function(t){var e=new En(t),n=new ya(e);return this._index.query(t.y,t.y,n),e.getLocation()},ma.prototype.interfaces_=function(){return[da]},ma.prototype.getClass=function(){return ma},Xc.SegmentVisitor.get=function(){return ya},Xc.IntervalIndexedGeometry.get=function(){return Ls},Object.defineProperties(ma,Xc);var ya=function(){this._counter=null;var t=arguments[0];this._counter=t};ya.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},ya.prototype.interfaces_=function(){return[ji]},ya.prototype.getClass=function(){return ya};var Ls=function(){this._index=new ui;var t=arguments[0];this.init(t)};Ls.prototype.init=function(t){for(var e=this,n=Le.getLines(t),i=n.iterator();i.hasNext();){var s=i.next(),o=s.getCoordinates();e.addLine(o)}},Ls.prototype.addLine=function(t){for(var e=this,n=1;n<t.length;n++){var i=new ot(t[n-1],t[n]),s=Math.min(i.p0.y,i.p1.y),o=Math.max(i.p0.y,i.p1.y);e._index.insert(s,o,i)}},Ls.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new va;return this._index.query(t,e,n),n.getItems()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];this._index.query(i,s,o)}},Ls.prototype.interfaces_=function(){return[]},Ls.prototype.getClass=function(){return Ls};var Xu=function(r){function t(){if(r.call(this),this._parentGeom=null,this._lineEdgeMap=new wp,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new hn,arguments.length===2){var e=arguments[0],n=arguments[1],i=Vr.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=i,n!==null&&this.add(n)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this._argIndex=s,this._parentGeom=o,this._boundaryNodeRule=a,o!==null&&this.add(o)}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(n,i){var s=this._nodes.addNode(i),o=s.getLabel(),a=1,u=F.NONE;u=o.getLocation(n,H.ON),u===F.BOUNDARY&&a++;var l=t.determineBoundary(this._boundaryNodeRule,a);o.setLocation(n,l)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.computeSelfNodes(n,i,!1)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2],u=new Ge(s,!0,!1);u.setIsDoneIfProperInt(a);var l=this.createEdgeSetIntersector(),h=this._parentGeom instanceof $n||this._parentGeom instanceof we||this._parentGeom instanceof jn,c=o||!h;return l.computeIntersections(this._edges,u,c),this.addSelfIntersectionNodes(this._argIndex),u}},t.prototype.computeSplitEdges=function(n){for(var i=this._edges.iterator();i.hasNext();){var s=i.next();s.eiList.addSplitEdges(n)}},t.prototype.computeEdgeIntersections=function(n,i,s){var o=new Ge(i,s,!0);o.setBoundaryNodes(this.getBoundaryNodes(),n.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,n._edges,o),o},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof dr){var n=arguments[0],i=n.getCoordinate();this.insertPoint(this._argIndex,i,F.INTERIOR)}else if(arguments[0]instanceof D){var s=arguments[0];this.insertPoint(this._argIndex,s,F.INTERIOR)}},t.prototype.addPolygon=function(n){var i=this;this.addPolygonRing(n.getExteriorRing(),F.EXTERIOR,F.INTERIOR);for(var s=0;s<n.getNumInteriorRing();s++){var o=n.getInteriorRingN(s);i.addPolygonRing(o,F.INTERIOR,F.EXTERIOR)}},t.prototype.addEdge=function(n){this.insertEdge(n);var i=n.getCoordinates();this.insertPoint(this._argIndex,i[0],F.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],F.BOUNDARY)},t.prototype.addLineString=function(n){var i=Mt.removeRepeatedPoints(n.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var s=new ih(i,new Ht(this._argIndex,F.INTERIOR));this._lineEdgeMap.put(n,s),this.insertEdge(s),St.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),i=new Array(n.size()).fill(null),s=0,o=n.iterator();o.hasNext();){var a=o.next();i[s++]=a.getCoordinate().copy()}return i},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(n,i,s){if(this.isBoundaryNode(n,i))return null;s===F.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,i):this.insertPoint(n,i,s)},t.prototype.addPolygonRing=function(n,i,s){if(n.isEmpty())return null;var o=Mt.removeRepeatedPoints(n.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var a=i,u=s;K.isCCW(o)&&(a=s,u=i);var l=new ih(o,new Ht(this._argIndex,F.BOUNDARY,a,u));this._lineEdgeMap.put(n,l),this.insertEdge(l),this.insertPoint(this._argIndex,o[0],F.BOUNDARY)},t.prototype.insertPoint=function(n,i,s){var o=this._nodes.addNode(i),a=o.getLabel();a===null?o._label=new Ht(n,s):a.setLocation(n,s)},t.prototype.createEdgeSetIntersector=function(){return new R_},t.prototype.addSelfIntersectionNodes=function(n){for(var i=this,s=this._edges.iterator();s.hasNext();)for(var o=s.next(),a=o.getLabel().getLocation(n),u=o.eiList.iterator();u.hasNext();){var l=u.next();i.addSelfIntersectionNode(n,l.coord,a)}},t.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof jn&&(this._useBoundaryDeterminationRule=!1),n instanceof we)this.addPolygon(n);else if(n instanceof ue)this.addLineString(n);else if(n instanceof dr)this.addPoint(n);else if(n instanceof la)this.addCollection(n);else if(n instanceof Ns)this.addCollection(n);else if(n instanceof jn)this.addCollection(n);else if(n instanceof He)this.addCollection(n);else throw new Error(n.getClass().getName())}else return r.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(n){for(var i=this,s=0;s<n.getNumGeometries();s++){var o=n.getGeometryN(s);i.add(o)}},t.prototype.locate=function(n){return dt(this._parentGeom,$i)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new ma(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return r.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(n,i){return n.isInBoundary(i)?F.BOUNDARY:F.INTERIOR},t}(oe),_a=function(){if(this._li=new Ps,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Xu(0,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=Vr.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Xu(0,e,i),this._arg[1]=new Xu(1,n,i)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];s.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(s.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Xu(0,s,a),this._arg[1]=new Xu(1,o,a)}};_a.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},_a.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},_a.prototype.interfaces_=function(){return[]},_a.prototype.getClass=function(){return _a};var Rs=function(){};Rs.prototype.interfaces_=function(){return[]},Rs.prototype.getClass=function(){return Rs},Rs.map=function(){if(arguments[0]instanceof ft&&dt(arguments[1],Rs.MapOp)){for(var t=arguments[0],e=arguments[1],n=new B,i=0;i<t.getNumGeometries();i++){var s=e.map(t.getGeometryN(i));s!==null&&n.add(s)}return t.getFactory().buildGeometry(n)}else if(dt(arguments[0],Ee)&&dt(arguments[1],Rs.MapOp)){for(var o=arguments[0],a=arguments[1],u=new B,l=o.iterator();l.hasNext();){var h=l.next(),c=a.map(h);c!==null&&u.add(c)}return u}},Rs.MapOp=function(){};var Et=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n),this._ptLocator=new hn,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new ln,this._resultPolyList=new B,this._resultLineList=new B,this._resultPointList=new B,this._graph=new oe(new Op),this._geomFact=e.getFactory()}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(n){var i=this._edgeList.findEqualEdge(n);if(i!==null){var s=i.getLabel(),o=n.getLabel();i.isPointwiseEqual(n)||(o=new Ht(n.getLabel()),o.flip());var a=i.getDepth();a.isNull()&&a.add(s),a.add(o),s.merge(o)}else this._edgeList.add(n)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var i=n.next(),s=i.getSym();i.isInResult()&&s.isInResult()&&(i.setInResult(!1),s.setInResult(!1))}},t.prototype.isCoveredByLA=function(n){return!!(this.isCovered(n,this._resultLineList)||this.isCovered(n,this._resultPolyList))},t.prototype.computeGeometry=function(n,i,s,o){var a=new B;return a.addAll(n),a.addAll(i),a.addAll(s),a.isEmpty()?t.createEmptyResult(o,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},t.prototype.mergeSymLabels=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next();i.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(n,i){for(var s=this,o=i.iterator();o.hasNext();){var a=o.next(),u=s._ptLocator.locate(n,a);if(u!==F.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var n=new B,i=this._edgeList.iterator();i.hasNext();){var s=i.next();s.isCollapsed()&&(i.remove(),n.add(s.getCollapsedEdge()))}this._edgeList.addAll(n)},t.prototype.updateNodeLabelling=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next(),s=i.getEdges().getLabel();i.getLabel().merge(s)}},t.prototype.getResultGeometry=function(n){return this.computeOverlay(n),this._resultGeom},t.prototype.insertUniqueEdges=function(n){for(var i=this,s=n.iterator();s.hasNext();){var o=s.next();i.insertUniqueEdge(o)}},t.prototype.computeOverlay=function(n){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var i=new B;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Ds.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(n),this.cancelDuplicateResultEdges();var s=new gr(this._geomFact);s.add(this._graph),this._resultPolyList=s.getPolygons();var o=new Dn(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(n);var a=new wo(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(n),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,n)},t.prototype.labelIncompleteNode=function(n,i){var s=this._ptLocator.locate(n.getCoordinate(),this._arg[i].getGeometry());n.getLabel().setLocation(i,s)},t.prototype.copyPoints=function(n){for(var i=this,s=this._arg[n].getNodeIterator();s.hasNext();){var o=s.next(),a=i._graph.addNode(o.getCoordinate());a.setLabel(n,o.getLabel().getLocation(n))}},t.prototype.findResultAreaEdges=function(n){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var s=i.next(),o=s.getLabel();o.isArea()&&!s.isInteriorAreaEdge()&&t.isResultOfOp(o.getLocation(0,H.RIGHT),o.getLocation(1,H.RIGHT),n)&&s.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var n=this._edgeList.iterator();n.hasNext();){var i=n.next(),s=i.getLabel(),o=i.getDepth();if(!o.isNull()){o.normalize();for(var a=0;a<2;a++)!s.isNull(a)&&s.isArea()&&!o.isNull(a)&&(o.getDelta(a)===0?s.toLine(a):(St.isTrue(!o.isNull(a,H.LEFT),"depth of LEFT side has not been initialized"),s.setLocation(a,H.LEFT,o.getLocation(a,H.LEFT)),St.isTrue(!o.isNull(a,H.RIGHT),"depth of RIGHT side has not been initialized"),s.setLocation(a,H.RIGHT,o.getLocation(a,H.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next();s.getEdges().computeLabelling(n._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next(),o=s.getLabel();s.isIsolated()&&(o.isNull(0)?n.labelIncompleteNode(s,0):n.labelIncompleteNode(s,1)),s.getEdges().updateLabelling(o)}},t.prototype.isCoveredByA=function(n){return!!this.isCovered(n,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(_a);Et.overlayOp=function(r,t,e){var n=new Et(r,t),i=n.getResultGeometry(e);return i},Et.intersection=function(r,t){if(r.isEmpty()||t.isEmpty())return Et.createEmptyResult(Et.INTERSECTION,r,t,r.getFactory());if(r.isGeometryCollection()){var e=t;return Eo.map(r,{interfaces_:function(){return[Rs.MapOp]},map:function(n){return n.intersection(e)}})}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),$e.overlayOp(r,t,Et.INTERSECTION)},Et.symDifference=function(r,t){if(r.isEmpty()||t.isEmpty()){if(r.isEmpty()&&t.isEmpty())return Et.createEmptyResult(Et.SYMDIFFERENCE,r,t,r.getFactory());if(r.isEmpty())return t.copy();if(t.isEmpty())return r.copy()}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),$e.overlayOp(r,t,Et.SYMDIFFERENCE)},Et.resultDimension=function(r,t,e){var n=t.getDimension(),i=e.getDimension(),s=-1;switch(r){case Et.INTERSECTION:s=Math.min(n,i);break;case Et.UNION:s=Math.max(n,i);break;case Et.DIFFERENCE:s=n;break;case Et.SYMDIFFERENCE:s=Math.max(n,i);break}return s},Et.createEmptyResult=function(r,t,e,n){var i=null;switch(Et.resultDimension(r,t,e)){case-1:i=n.createGeometryCollection(new Array(0).fill(null));break;case 0:i=n.createPoint();break;case 1:i=n.createLineString();break;case 2:i=n.createPolygon();break}return i},Et.difference=function(r,t){return r.isEmpty()?Et.createEmptyResult(Et.DIFFERENCE,r,t,r.getFactory()):t.isEmpty()?r.copy():(r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),$e.overlayOp(r,t,Et.DIFFERENCE))},Et.isResultOfOp=function(){if(arguments.length===2){var r=arguments[0],t=arguments[1],e=r.getLocation(0),n=r.getLocation(1);return Et.isResultOfOp(e,n,t)}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];switch(i===F.BOUNDARY&&(i=F.INTERIOR),s===F.BOUNDARY&&(s=F.INTERIOR),o){case Et.INTERSECTION:return i===F.INTERIOR&&s===F.INTERIOR;case Et.UNION:return i===F.INTERIOR||s===F.INTERIOR;case Et.DIFFERENCE:return i===F.INTERIOR&&s!==F.INTERIOR;case Et.SYMDIFFERENCE:return i===F.INTERIOR&&s!==F.INTERIOR||i!==F.INTERIOR&&s===F.INTERIOR}return!1}},Et.INTERSECTION=1,Et.UNION=2,Et.DIFFERENCE=3,Et.SYMDIFFERENCE=4;var us=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new hn,this._seg=new ot;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};us.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,n=0;n<this._linework.getNumGeometries();n++)for(var i=e._linework.getGeometryN(n),s=i.getCoordinateSequence(),o=0;o<s.size()-1;o++){s.getCoordinate(o,e._seg.p0),s.getCoordinate(o+1,e._seg.p1);var a=e._seg.distance(t);if(a<=e._boundaryDistanceTolerance)return!0}return!1},us.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?F.BOUNDARY:this._ptLocator.locate(t,this._g)},us.prototype.extractLinework=function(t){var e=new Ea;t.apply(e);var n=e.getLinework(),i=Nt.toLineStringArray(n);return t.getFactory().createMultiLineString(i)},us.prototype.interfaces_=function(){return[]},us.prototype.getClass=function(){return us};var Ea=function(){this._linework=null,this._linework=new B};Ea.prototype.getLinework=function(){return this._linework},Ea.prototype.filter=function(t){var e=this;if(t instanceof we){var n=t;this._linework.add(n.getExteriorRing());for(var i=0;i<n.getNumInteriorRing();i++)e._linework.add(n.getInteriorRingN(i))}},Ea.prototype.interfaces_=function(){return[Sn]},Ea.prototype.getClass=function(){return Ea};var Fs=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Fs.prototype.extractPoints=function(t,e,n){for(var i=this,s=t.getCoordinates(),o=0;o<s.length-1;o++)i.computeOffsetPoints(s[o],s[o+1],e,n)},Fs.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Fs.prototype.getPoints=function(t){for(var e=this,n=new B,i=Le.getLines(this._g),s=i.iterator();s.hasNext();){var o=s.next();e.extractPoints(o,t,n)}return n},Fs.prototype.computeOffsetPoints=function(t,e,n,i){var s=e.x-t.x,o=e.y-t.y,a=Math.sqrt(s*s+o*o),u=n*s/a,l=n*o/a,h=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var f=new D(h-l,c+u);i.add(f)}if(this._doRight){var p=new D(h+l,c-u);i.add(p)}},Fs.prototype.interfaces_=function(){return[]},Fs.prototype.getClass=function(){return Fs};var Ar=function r(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=r.TOLERANCE,this._testCoords=new B;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundaryDistanceTolerance=r.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,n],this._locFinder=[new us(this._geom[0],this._boundaryDistanceTolerance),new us(this._geom[1],this._boundaryDistanceTolerance),new us(this._geom[2],this._boundaryDistanceTolerance)]},zp={TOLERANCE:{configurable:!0}};Ar.prototype.reportResult=function(t,e,n){Oe.out.println("Overlay result invalid - A:"+F.toLocationSymbol(e[0])+" B:"+F.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+F.toLocationSymbol(e[2]))},Ar.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},Ar.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=0;n<this._testCoords.size();n++){var i=t._testCoords.get(n);if(!t.checkValid(e,i))return t._invalidLocation=i,!1}return!0}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._location[0]=this._locFinder[0].getLocation(o),this._location[1]=this._locFinder[1].getLocation(o),this._location[2]=this._locFinder[2].getLocation(o),Ar.hasLocation(this._location,F.BOUNDARY)?!0:this.isValidResult(s,this._location)}},Ar.prototype.addTestPts=function(t){var e=new Fs(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Ar.prototype.isValidResult=function(t,e){var n=Et.isResultOfOp(e[0],e[1],t),i=e[2]===F.INTERIOR,s=!(n^i);return s||this.reportResult(t,e,n),s},Ar.prototype.getInvalidLocation=function(){return this._invalidLocation},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar},Ar.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Ar.computeBoundaryDistanceTolerance=function(t,e){return Math.min(ge.computeSizeBasedSnapTolerance(t),ge.computeSizeBasedSnapTolerance(e))},Ar.isValid=function(t,e,n,i){var s=new Ar(t,e,i);return s.isValid(n)},zp.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Ar,zp);var Dr=function r(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=r.extractFactory(t),this._inputGeoms=t};Dr.prototype.extractElements=function(t,e){var n=this;if(t===null)return null;for(var i=0;i<t.getNumGeometries();i++){var s=t.getGeometryN(i);n._skipEmpty&&s.isEmpty()||e.add(s)}},Dr.prototype.combine=function(){for(var t=this,e=new B,n=this._inputGeoms.iterator();n.hasNext();){var i=n.next();t.extractElements(i,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},Dr.prototype.interfaces_=function(){return[]},Dr.prototype.getClass=function(){return Dr},Dr.combine=function(){if(arguments.length===1){var t=arguments[0],e=new Dr(t);return e.combine()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=new Dr(Dr.createList(n,i));return s.combine()}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2],l=new Dr(Dr.createList(o,a,u));return l.combine()}},Dr.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Dr.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new B;return n.add(t),n.add(e),n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=new B;return a.add(i),a.add(s),a.add(o),a}};var ye=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new B)},qp={STRTREE_NODE_CAPACITY:{configurable:!0}};ye.prototype.reduceToGeometries=function(t){for(var e=this,n=new B,i=t.iterator();i.hasNext();){var s=i.next(),o=null;dt(s,nn)?o=e.unionTree(s):s instanceof ft&&(o=s),n.add(o)}return n},ye.prototype.extractByEnvelope=function(t,e,n){for(var i=new B,s=0;s<e.getNumGeometries();s++){var o=e.getGeometryN(s);o.getEnvelopeInternal().intersects(t)?i.add(o):n.add(o)}return this._geomFactory.buildGeometry(i)},ye.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!n.intersects(i)){var s=Dr.combine(t,e);return s}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var o=n.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,o)},ye.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new Ip(ye.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var i=t.itemsTree(),s=this.unionTree(i);return s},ye.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2];if(i-n<=1){var s=ye.getGeometry(e,n);return this.unionSafe(s,null)}else{if(i-n===2)return this.unionSafe(ye.getGeometry(e,n),ye.getGeometry(e,n+1));var o=Math.trunc((i+n)/2),a=this.binaryUnion(e,n,o),u=this.binaryUnion(e,o,i);return this.unionSafe(a,u)}}},ye.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var i=n.next();e===null?e=i.copy():e=e.union(i)}return e},ye.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},ye.prototype.unionActual=function(t,e){return ye.restrictToPolygons(t.union(e))},ye.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),n=this.binaryUnion(e);return n},ye.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var i=new B,s=this.extractByEnvelope(n,t,i),o=this.extractByEnvelope(n,e,i),a=this.unionActual(s,o);i.add(a);var u=Dr.combine(i);return u},ye.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),n=e.buildGeometry(t),i=n.buffer(0);return i}else if(arguments.length===2){var s=arguments[0],o=arguments[1],a=s.getFactory(),u=a.createGeometryCollection([s,o]),l=u.buffer(0);return l}},ye.prototype.interfaces_=function(){return[]},ye.prototype.getClass=function(){return ye},ye.restrictToPolygons=function(t){if(dt(t,$i))return t;var e=Oi.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(Nt.toPolygonArray(e))},ye.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},ye.union=function(t){var e=new ye(t);return e.union()},qp.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(ye,qp);var oh=function(){};oh.prototype.interfaces_=function(){return[]},oh.prototype.getClass=function(){return oh},oh.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Et.createEmptyResult(Et.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),$e.overlayOp(t,e,Et.UNION)};function Gs(){return new ah}function ah(){this.reset()}ah.prototype={constructor:ah,reset:function(){this.s=this.t=0},add:function(r){Wp(uh,r,this.t),Wp(this,uh.s,this.s),this.s?this.t+=uh.t:this.s=uh.t},valueOf:function(){return this.s}};var uh=new ah;function Wp(r,t,e){var n=r.s=t+e,i=n-t,s=n-i;r.t=t-s+(e-i)}var _e=1e-6,Jt=Math.PI,Ai=Jt/2,Xp=Jt/4,Di=Jt*2,ks=180/Jt,Ln=Jt/180,je=Math.abs,k_=Math.atan,wa=Math.atan2,Ce=Math.cos,Pe=Math.sin,Sa=Math.sqrt;function Hp(r){return r>1?0:r<-1?Jt:Math.acos(r)}function Co(r){return r>1?Ai:r<-1?-Ai:Math.asin(r)}function Hu(){}function lh(r,t){r&&Jp.hasOwnProperty(r.type)&&Jp[r.type](r,t)}var Yp={Feature:function(r,t){lh(r.geometry,t)},FeatureCollection:function(r,t){for(var e=r.features,n=-1,i=e.length;++n<i;)lh(e[n].geometry,t)}},Jp={Sphere:function(r,t){t.sphere()},Point:function(r,t){r=r.coordinates,t.point(r[0],r[1],r[2])},MultiPoint:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)r=e[n],t.point(r[0],r[1],r[2])},LineString:function(r,t){Hc(r.coordinates,t,0)},MultiLineString:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)Hc(e[n],t,0)},Polygon:function(r,t){Bp(r.coordinates,t)},MultiPolygon:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)Bp(e[n],t)},GeometryCollection:function(r,t){for(var e=r.geometries,n=-1,i=e.length;++n<i;)lh(e[n],t)}};function Hc(r,t,e){var n=-1,i=r.length-e,s;for(t.lineStart();++n<i;)s=r[n],t.point(s[0],s[1],s[2]);t.lineEnd()}function Bp(r,t){var e=-1,n=r.length;for(t.polygonStart();++e<n;)Hc(r[e],t,1);t.polygonEnd()}function V_(r,t){r&&Yp.hasOwnProperty(r.type)?Yp[r.type](r,t):lh(r,t)}Gs(),Gs();function Yc(r){return[wa(r[1],r[0]),Co(r[2])]}function Ca(r){var t=r[0],e=r[1],n=Ce(e);return[n*Ce(t),n*Pe(t),Pe(e)]}function hh(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function ch(r,t){return[r[1]*t[2]-r[2]*t[1],r[2]*t[0]-r[0]*t[2],r[0]*t[1]-r[1]*t[0]]}function Jc(r,t){r[0]+=t[0],r[1]+=t[1],r[2]+=t[2]}function fh(r,t){return[r[0]*t,r[1]*t,r[2]*t]}function Bc(r){var t=Sa(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);r[0]/=t,r[1]/=t,r[2]/=t}Gs();function Qp(r,t){function e(n,i){return n=r(n,i),t(n[0],n[1])}return r.invert&&t.invert&&(e.invert=function(n,i){return n=t.invert(n,i),n&&r.invert(n[0],n[1])}),e}function Qc(r,t){return[r>Jt?r-Di:r<-Jt?r+Di:r,t]}Qc.invert=Qc;function U_(r,t,e){return(r%=Di)?t||e?Qp(Zp(r),$p(t,e)):Zp(r):t||e?$p(t,e):Qc}function Kp(r){return function(t,e){return t+=r,[t>Jt?t-Di:t<-Jt?t+Di:t,e]}}function Zp(r){var t=Kp(r);return t.invert=Kp(-r),t}function $p(r,t){var e=Ce(r),n=Pe(r),i=Ce(t),s=Pe(t);function o(a,u){var l=Ce(u),h=Ce(a)*l,c=Pe(a)*l,f=Pe(u),p=f*e+h*n;return[wa(c*i-p*s,h*e-f*n),Co(p*i+c*s)]}return o.invert=function(a,u){var l=Ce(u),h=Ce(a)*l,c=Pe(a)*l,f=Pe(u),p=f*i-c*s;return[wa(c*i+f*s,h*e+p*n),Co(p*e-h*n)]},o}function z_(r,t,e,n,i,s){if(e){var o=Ce(t),a=Pe(t),u=n*e;i==null?(i=t+n*Di,s=t-u/2):(i=jp(o,i),s=jp(o,s),(n>0?i<s:i>s)&&(i+=n*Di));for(var l,h=i;n>0?h>s:h<s;h-=u)l=Yc([o,-a*Ce(h),-a*Pe(h)]),r.point(l[0],l[1])}}function jp(r,t){t=Ca(t),t[0]-=r,Bc(t);var e=Hp(-t[1]);return((-t[2]<0?-e:e)+Di-_e)%Di}function t0(){var r=[],t;return{point:function(e,n){t.push([e,n])},lineStart:function(){r.push(t=[])},lineEnd:Hu,rejoin:function(){r.length>1&&r.push(r.pop().concat(r.shift()))},result:function(){var e=r;return r=[],t=null,e}}}function q_(r,t,e,n,i,s){var o=r[0],a=r[1],u=t[0],l=t[1],h=0,c=1,f=u-o,p=l-a,v;if(v=e-o,!(!f&&v>0)){if(v/=f,f<0){if(v<h)return;v<c&&(c=v)}else if(f>0){if(v>c)return;v>h&&(h=v)}if(v=i-o,!(!f&&v<0)){if(v/=f,f<0){if(v>c)return;v>h&&(h=v)}else if(f>0){if(v<h)return;v<c&&(c=v)}if(v=n-a,!(!p&&v>0)){if(v/=p,p<0){if(v<h)return;v<c&&(c=v)}else if(p>0){if(v>c)return;v>h&&(h=v)}if(v=s-a,!(!p&&v<0)){if(v/=p,p<0){if(v>c)return;v>h&&(h=v)}else if(p>0){if(v<h)return;v<c&&(c=v)}return h>0&&(r[0]=o+h*f,r[1]=a+h*p),c<1&&(t[0]=o+c*f,t[1]=a+c*p),!0}}}}}function dh(r,t){return je(r[0]-t[0])<_e&&je(r[1]-t[1])<_e}function gh(r,t,e,n){this.x=r,this.z=t,this.o=e,this.e=n,this.v=!1,this.n=this.p=null}function e0(r,t,e,n,i){var s=[],o=[],a,u;if(r.forEach(function(v){if(!((_=v.length-1)<=0)){var _,w=v[0],I=v[_],y;if(dh(w,I)){for(i.lineStart(),a=0;a<_;++a)i.point((w=v[a])[0],w[1]);i.lineEnd();return}s.push(y=new gh(w,v,null,!0)),o.push(y.o=new gh(w,null,y,!1)),s.push(y=new gh(I,v,null,!1)),o.push(y.o=new gh(I,null,y,!0))}}),!!s.length){for(o.sort(t),r0(s),r0(o),a=0,u=o.length;a<u;++a)o[a].e=e=!e;for(var l=s[0],h,c;;){for(var f=l,p=!0;f.v;)if((f=f.n)===l)return;h=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(a=0,u=h.length;a<u;++a)i.point((c=h[a])[0],c[1]);else n(f.x,f.n.x,1,i);f=f.n}else{if(p)for(h=f.p.z,a=h.length-1;a>=0;--a)i.point((c=h[a])[0],c[1]);else n(f.x,f.p.x,-1,i);f=f.p}f=f.o,h=f.z,p=!p}while(!f.v);i.lineEnd()}}}function r0(r){if(t=r.length){for(var t,e=0,n=r[0],i;++e<t;)n.n=i=r[e],i.p=n,n=i;n.n=i=r[0],i.p=n}}function n0(r,t){return r<t?-1:r>t?1:r>=t?0:NaN}function W_(r){return r.length===1&&(r=X_(r)),{left:function(t,e,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var s=n+i>>>1;r(t[s],e)<0?n=s+1:i=s}return n},right:function(t,e,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var s=n+i>>>1;r(t[s],e)>0?i=s:n=s+1}return n}}}function X_(r){return function(t,e){return n0(r(t),e)}}W_(n0);function i0(r){for(var t=r.length,e,n=-1,i=0,s,o;++n<t;)i+=r[n].length;for(s=new Array(i);--t>=0;)for(o=r[t],e=o.length;--e>=0;)s[--i]=o[e];return s}var ph=1e9,vh=-1e9;function H_(r,t,e,n){function i(l,h){return r<=l&&l<=e&&t<=h&&h<=n}function s(l,h,c,f){var p=0,v=0;if(l==null||(p=o(l,c))!==(v=o(h,c))||u(l,h)<0^c>0)do f.point(p===0||p===3?r:e,p>1?n:t);while((p=(p+c+4)%4)!==v);else f.point(h[0],h[1])}function o(l,h){return je(l[0]-r)<_e?h>0?0:3:je(l[0]-e)<_e?h>0?2:1:je(l[1]-t)<_e?h>0?1:0:h>0?3:2}function a(l,h){return u(l.x,h.x)}function u(l,h){var c=o(l,1),f=o(h,1);return c!==f?c-f:c===0?h[1]-l[1]:c===1?l[0]-h[0]:c===2?l[1]-h[1]:h[0]-l[0]}return function(l){var h=l,c=t0(),f,p,v,_,w,I,y,E,m,S,C,P={point:N,lineStart:x,lineEnd:R,polygonStart:O,polygonEnd:b};function N(Z,J){i(Z,J)&&h.point(Z,J)}function T(){for(var Z=0,J=0,it=p.length;J<it;++J)for(var G=p[J],W=1,k=G.length,U=G[0],A,q,X=U[0],tt=U[1];W<k;++W)A=X,q=tt,U=G[W],X=U[0],tt=U[1],q<=n?tt>n&&(X-A)*(n-q)>(tt-q)*(r-A)&&++Z:tt<=n&&(X-A)*(n-q)<(tt-q)*(r-A)&&--Z;return Z}function O(){h=c,f=[],p=[],C=!0}function b(){var Z=T(),J=C&&Z,it=(f=i0(f)).length;(J||it)&&(l.polygonStart(),J&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),it&&e0(f,a,Z,s,l),l.polygonEnd()),h=l,f=p=v=null}function x(){P.point=V,p&&p.push(v=[]),S=!0,m=!1,y=E=NaN}function R(){f&&(V(_,w),I&&m&&c.rejoin(),f.push(c.result())),P.point=N,m&&h.lineEnd()}function V(Z,J){var it=i(Z,J);if(p&&v.push([Z,J]),S)_=Z,w=J,I=it,S=!1,it&&(h.lineStart(),h.point(Z,J));else if(it&&m)h.point(Z,J);else{var G=[y=Math.max(vh,Math.min(ph,y)),E=Math.max(vh,Math.min(ph,E))],W=[Z=Math.max(vh,Math.min(ph,Z)),J=Math.max(vh,Math.min(ph,J))];q_(G,W,r,t,e,n)?(m||(h.lineStart(),h.point(G[0],G[1])),h.point(W[0],W[1]),it||h.lineEnd(),C=!1):it&&(h.lineStart(),h.point(Z,J),C=!1)}y=Z,E=J,m=it}return P}}var Kc=Gs();function Y_(r,t){var e=t[0],n=t[1],i=[Pe(e),-Ce(e),0],s=0,o=0;Kc.reset();for(var a=0,u=r.length;a<u;++a)if(h=(l=r[a]).length)for(var l,h,c=l[h-1],f=c[0],p=c[1]/2+Xp,v=Pe(p),_=Ce(p),w=0;w<h;++w,f=y,v=m,_=S,c=I){var I=l[w],y=I[0],E=I[1]/2+Xp,m=Pe(E),S=Ce(E),C=y-f,P=C>=0?1:-1,N=P*C,T=N>Jt,O=v*m;if(Kc.add(wa(O*P*Pe(N),_*S+O*Ce(N))),s+=T?C+P*Di:C,T^f>=e^y>=e){var b=ch(Ca(c),Ca(I));Bc(b);var x=ch(i,b);Bc(x);var R=(T^C>=0?-1:1)*Co(x[2]);(n>R||n===R&&(b[0]||b[1]))&&(o+=T^C>=0?1:-1)}}return(s<-1e-6||s<_e&&Kc<-1e-6)^o&1}Gs();function s0(r){return r}Gs(),Gs();var Pa=1/0,mh=Pa,Yu=-Pa,yh=Yu,o0={point:J_,lineStart:Hu,lineEnd:Hu,polygonStart:Hu,polygonEnd:Hu,result:function(){var r=[[Pa,mh],[Yu,yh]];return Yu=yh=-(mh=Pa=1/0),r}};function J_(r,t){r<Pa&&(Pa=r),r>Yu&&(Yu=r),t<mh&&(mh=t),t>yh&&(yh=t)}Gs();function a0(r,t,e,n){return function(i,s){var o=t(s),a=i.invert(n[0],n[1]),u=t0(),l=t(u),h=!1,c,f,p,v={point:_,lineStart:I,lineEnd:y,polygonStart:function(){v.point=E,v.lineStart=m,v.lineEnd=S,f=[],c=[]},polygonEnd:function(){v.point=_,v.lineStart=I,v.lineEnd=y,f=i0(f);var C=Y_(c,a);f.length?(h||(s.polygonStart(),h=!0),e0(f,Q_,C,e,s)):C&&(h||(s.polygonStart(),h=!0),s.lineStart(),e(null,null,1,s),s.lineEnd()),h&&(s.polygonEnd(),h=!1),f=c=null},sphere:function(){s.polygonStart(),s.lineStart(),e(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function _(C,P){var N=i(C,P);r(C=N[0],P=N[1])&&s.point(C,P)}function w(C,P){var N=i(C,P);o.point(N[0],N[1])}function I(){v.point=w,o.lineStart()}function y(){v.point=_,o.lineEnd()}function E(C,P){p.push([C,P]);var N=i(C,P);l.point(N[0],N[1])}function m(){l.lineStart(),p=[]}function S(){E(p[0][0],p[0][1]),l.lineEnd();var C=l.clean(),P=u.result(),N,T=P.length,O,b,x;if(p.pop(),c.push(p),p=null,!!T){if(C&1){if(b=P[0],(O=b.length-1)>0){for(h||(s.polygonStart(),h=!0),s.lineStart(),N=0;N<O;++N)s.point((x=b[N])[0],x[1]);s.lineEnd()}return}T>1&&C&2&&P.push(P.pop().concat(P.shift())),f.push(P.filter(B_))}}return v}}function B_(r){return r.length>1}function Q_(r,t){return((r=r.x)[0]<0?r[1]-Ai-_e:Ai-r[1])-((t=t.x)[0]<0?t[1]-Ai-_e:Ai-t[1])}const u0=a0(function(){return!0},K_,$_,[-Jt,-Ai]);function K_(r){var t=NaN,e=NaN,n=NaN,i;return{lineStart:function(){r.lineStart(),i=1},point:function(s,o){var a=s>0?Jt:-Jt,u=je(s-t);je(u-Jt)<_e?(r.point(t,e=(e+o)/2>0?Ai:-Ai),r.point(n,e),r.lineEnd(),r.lineStart(),r.point(a,e),r.point(s,e),i=0):n!==a&&u>=Jt&&(je(t-n)<_e&&(t-=n*_e),je(s-a)<_e&&(s-=a*_e),e=Z_(t,e,s,o),r.point(n,e),r.lineEnd(),r.lineStart(),r.point(a,e),i=0),r.point(t=s,e=o),n=a},lineEnd:function(){r.lineEnd(),t=e=NaN},clean:function(){return 2-i}}}function Z_(r,t,e,n){var i,s,o=Pe(r-e);return je(o)>_e?k_((Pe(t)*(s=Ce(n))*Pe(e)-Pe(n)*(i=Ce(t))*Pe(r))/(i*s*o)):(t+n)/2}function $_(r,t,e,n){var i;if(r==null)i=e*Ai,n.point(-Jt,i),n.point(0,i),n.point(Jt,i),n.point(Jt,0),n.point(Jt,-i),n.point(0,-i),n.point(-Jt,-i),n.point(-Jt,0),n.point(-Jt,i);else if(je(r[0]-t[0])>_e){var s=r[0]<t[0]?Jt:-Jt;i=e*s/2,n.point(-s,i),n.point(0,i),n.point(s,i)}else n.point(t[0],t[1])}function j_(r,t){var e=Ce(r),n=e>0,i=je(e)>_e;function s(h,c,f,p){z_(p,r,t,f,h,c)}function o(h,c){return Ce(h)*Ce(c)>e}function a(h){var c,f,p,v,_;return{lineStart:function(){v=p=!1,_=1},point:function(w,I){var y=[w,I],E,m=o(w,I),S=n?m?0:l(w,I):m?l(w+(w<0?Jt:-Jt),I):0;if(!c&&(v=p=m)&&h.lineStart(),m!==p&&(E=u(c,y),(!E||dh(c,E)||dh(y,E))&&(y[0]+=_e,y[1]+=_e,m=o(y[0],y[1]))),m!==p)_=0,m?(h.lineStart(),E=u(y,c),h.point(E[0],E[1])):(E=u(c,y),h.point(E[0],E[1]),h.lineEnd()),c=E;else if(i&&c&&n^m){var C;!(S&f)&&(C=u(y,c,!0))&&(_=0,n?(h.lineStart(),h.point(C[0][0],C[0][1]),h.point(C[1][0],C[1][1]),h.lineEnd()):(h.point(C[1][0],C[1][1]),h.lineEnd(),h.lineStart(),h.point(C[0][0],C[0][1])))}m&&(!c||!dh(c,y))&&h.point(y[0],y[1]),c=y,p=m,f=S},lineEnd:function(){p&&h.lineEnd(),c=null},clean:function(){return _|(v&&p)<<1}}}function u(h,c,f){var p=Ca(h),v=Ca(c),_=[1,0,0],w=ch(p,v),I=hh(w,w),y=w[0],E=I-y*y;if(!E)return!f&&h;var m=e*I/E,S=-e*y/E,C=ch(_,w),P=fh(_,m),N=fh(w,S);Jc(P,N);var T=C,O=hh(P,T),b=hh(T,T),x=O*O-b*(hh(P,P)-1);if(!(x<0)){var R=Sa(x),V=fh(T,(-O-R)/b);if(Jc(V,P),V=Yc(V),!f)return V;var Z=h[0],J=c[0],it=h[1],G=c[1],W;J<Z&&(W=Z,Z=J,J=W);var k=J-Z,U=je(k-Jt)<_e,A=U||k<_e;if(!U&&G<it&&(W=it,it=G,G=W),A?U?it+G>0^V[1]<(je(V[0]-Z)<_e?it:G):it<=V[1]&&V[1]<=G:k>Jt^(Z<=V[0]&&V[0]<=J)){var q=fh(T,(-O+R)/b);return Jc(q,P),[V,Yc(q)]}}}function l(h,c){var f=n?r:Jt-r,p=0;return h<-f?p|=1:h>f&&(p|=2),c<-f?p|=4:c>f&&(p|=8),p}return a0(o,a,s,n?[0,-r]:[-Jt,r-Jt])}function l0(r){return function(t){var e=new Zc;for(var n in r)e[n]=r[n];return e.stream=t,e}}function Zc(){}Zc.prototype={constructor:Zc,point:function(r,t){this.stream.point(r,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function h0(r,t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],s=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),s!=null&&r.clipExtent(null),V_(e,r.stream(o0));var o=o0.result(),a=Math.min(n/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),u=+t[0][0]+(n-a*(o[1][0]+o[0][0]))/2,l=+t[0][1]+(i-a*(o[1][1]+o[0][1]))/2;return s!=null&&r.clipExtent(s),r.scale(a*150).translate([u,l])}function t1(r,t,e){return h0(r,[[0,0],t],e)}var c0=16,e1=Ce(30*Ln);function f0(r,t){return+t?n1(r,t):r1(r)}function r1(r){return l0({point:function(t,e){t=r(t,e),this.stream.point(t[0],t[1])}})}function n1(r,t){function e(n,i,s,o,a,u,l,h,c,f,p,v,_,w){var I=l-n,y=h-i,E=I*I+y*y;if(E>4*t&&_--){var m=o+f,S=a+p,C=u+v,P=Sa(m*m+S*S+C*C),N=Co(C/=P),T=je(je(C)-1)<_e||je(s-c)<_e?(s+c)/2:wa(S,m),O=r(T,N),b=O[0],x=O[1],R=b-n,V=x-i,Z=y*R-I*V;(Z*Z/E>t||je((I*R+y*V)/E-.5)>.3||o*f+a*p+u*v<e1)&&(e(n,i,s,o,a,u,b,x,T,m/=P,S/=P,C,_,w),w.point(b,x),e(b,x,T,m,S,C,l,h,c,f,p,v,_,w))}}return function(n){var i,s,o,a,u,l,h,c,f,p,v,_,w={point:I,lineStart:y,lineEnd:m,polygonStart:function(){n.polygonStart(),w.lineStart=S},polygonEnd:function(){n.polygonEnd(),w.lineStart=y}};function I(N,T){N=r(N,T),n.point(N[0],N[1])}function y(){c=NaN,w.point=E,n.lineStart()}function E(N,T){var O=Ca([N,T]),b=r(N,T);e(c,f,h,p,v,_,c=b[0],f=b[1],h=N,p=O[0],v=O[1],_=O[2],c0,n),n.point(c,f)}function m(){w.point=I,n.lineEnd()}function S(){y(),w.point=C,w.lineEnd=P}function C(N,T){E(i=N,T),s=c,o=f,a=p,u=v,l=_,w.point=E}function P(){e(c,f,h,p,v,_,s,o,i,a,u,l,c0,n),w.lineEnd=m,m()}return w}}var i1=l0({point:function(r,t){this.stream.point(r*Ln,t*Ln)}});function s1(r){return o1(function(){return r})()}function o1(r){var t,e=150,n=480,i=250,s,o,a=0,u=0,l=0,h=0,c=0,f,p,v=null,_=u0,w=null,I,y,E,m=s0,S=.5,C=f0(b,S),P,N;function T(V){return V=p(V[0]*Ln,V[1]*Ln),[V[0]*e+s,o-V[1]*e]}function O(V){return V=p.invert((V[0]-s)/e,(o-V[1])/e),V&&[V[0]*ks,V[1]*ks]}function b(V,Z){return V=t(V,Z),[V[0]*e+s,o-V[1]*e]}T.stream=function(V){return P&&N===V?P:P=i1(_(f,C(m(N=V))))},T.clipAngle=function(V){return arguments.length?(_=+V?j_(v=V*Ln,6*Ln):(v=null,u0),R()):v*ks},T.clipExtent=function(V){return arguments.length?(m=V==null?(w=I=y=E=null,s0):H_(w=+V[0][0],I=+V[0][1],y=+V[1][0],E=+V[1][1]),R()):w==null?null:[[w,I],[y,E]]},T.scale=function(V){return arguments.length?(e=+V,x()):e},T.translate=function(V){return arguments.length?(n=+V[0],i=+V[1],x()):[n,i]},T.center=function(V){return arguments.length?(a=V[0]%360*Ln,u=V[1]%360*Ln,x()):[a*ks,u*ks]},T.rotate=function(V){return arguments.length?(l=V[0]%360*Ln,h=V[1]%360*Ln,c=V.length>2?V[2]%360*Ln:0,x()):[l*ks,h*ks,c*ks]},T.precision=function(V){return arguments.length?(C=f0(b,S=V*V),R()):Sa(S)},T.fitExtent=function(V,Z){return h0(T,V,Z)},T.fitSize=function(V,Z){return t1(T,V,Z)};function x(){p=Qp(f=U_(l,h,c),t);var V=t(a,u);return s=n-V[0]*e,o=i+V[1]*e,R()}function R(){return P=N=null,T}return function(){return t=r.apply(this,arguments),T.invert=t.invert&&O,x()}}function d0(r){return function(t,e){var n=Ce(t),i=Ce(e),s=r(n*i);return[s*i*Pe(t),s*Pe(e)]}}function g0(r){return function(t,e){var n=Sa(t*t+e*e),i=r(n),s=Pe(i),o=Ce(i);return[wa(t*s,n*o),Co(n&&e*s/n)]}}var a1=d0(function(r){return Sa(2/(1+r))});a1.invert=g0(function(r){return 2*Co(r/2)});var p0=d0(function(r){return(r=Hp(r))&&r/Pe(r)});p0.invert=g0(function(r){return r});function u1(){return s1(p0).scale(79.4188).clipAngle(179.999)}function v0(r,t){return[r,t]}v0.invert=v0;function l1(r,t,e){e=e||{};var n=e.units||"kilometers",i=e.steps||8;if(!r)throw new Error("geojson is required");if(typeof e!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var s=[];switch(r.type){case"GeometryCollection":return Fl(r,function(o){var a=_h(o,t,n,i);a&&s.push(a)}),Bo(s);case"FeatureCollection":return Rl(r,function(o){var a=_h(o,t,n,i);a&&Rl(a,function(u){u&&s.push(u)})}),Bo(s)}return _h(r,t,n,i)}function _h(r,t,e,n){var i=r.properties||{},s=r.type==="Feature"?r.geometry:r;if(s.type==="GeometryCollection"){var o=[];return Fl(r,function(_){var w=_h(_,t,e,n);w&&o.push(w)}),Bo(o)}var a=h1(s),u={type:s.type,coordinates:y0(s.coordinates,a)},l=new Rc,h=l.read(u),c=uc(lc(t,e),"meters"),f=De.bufferOp(h,c,n),p=new Cp;if(f=p.write(f),!m0(f.coordinates)){var v={type:f.type,coordinates:_0(f.coordinates,a)};return Yn(v,i)}}function m0(r){return Array.isArray(r[0])?m0(r[0]):isNaN(r[0])}function y0(r,t){return typeof r[0]!="object"?t(r):r.map(function(e){return y0(e,t)})}function _0(r,t){return typeof r[0]!="object"?t.invert(r):r.map(function(e){return _0(e,t)})}function h1(r){var t=dy(r).geometry.coordinates,e=[-t[0],-t[1]];return u1().rotate(e).scale(tr)}function c1(r,t,e){e===void 0&&(e={});var n=jr(r),i=jr(t),s=Mc.union(n.coordinates,i.coordinates);return s.length===0?null:s.length===1?hr(s[0],e.properties):ac(s,e.properties)}function f1(r,t,e){e===void 0&&(e={});var n=jr(r),i=jr(t),s=Mc.intersection(n.coordinates,i.coordinates);return s.length===0?null:s.length===1?hr(s[0],e.properties):ac(s,e.properties)}function d1(r,t){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1])&&r.push(r[0]);const e=re(t),n=hr([r]);return pn(e,n)}function g1(r,t){const e=Jn(r);return Ny(e,t,{units:"meters"}).geometry.coordinates}function $c(r){if((r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),r.length<=3)return 0;const t=hr([r]);return Iy(t)}function p1(r){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]);const t=hr([r]),n=Dg(t).geometry.coordinates;return[n[0],n[1],n[2]??r[0][2]??0]}function v1(r,t,e,n){const[i,s,o]=r,a=Ko(re([i,s]),t,e,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return n=n||[0,0,0],n[0]=a.geometry.coordinates[0],n[1]=a.geometry.coordinates[1],n[2]=o,n}function jc(r,t){return Bi(re(r),re(t),{units:"meters"})}function Eh(r,t){return Eu(re(r),re(t))}function m1(r,t){return zg(Jn(r),Jn(t))}function y1(r,t){const e=re(r),n=re(t),i=fy(e,n),s=(r[2]+t[2])/2;return[...i.geometry.coordinates,s]}function _1(r,t){const e=re(t),n=Jn(r);return wy(n,e,{units:"meters"})}function E1(r,t){const e=re(r),n=Jn(t);return Cy(e,n,{units:"meters"})}function w1(r,t,e,n){const[i,s,o]=r,a=Vy(re([i,s]),t,e,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return n=n||[0,0,0],n[0]=a.geometry.coordinates[0],n[1]=a.geometry.coordinates[1],n[2]=o,n}function E0(r,t){return Wg(re(r),re(t),{units:"meters"})}function S1(r,t){return ky(re(r),re(t))}function w0(r,t){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=f1(hr([r]),hr([t]));if(e)return e.geometry.coordinates}function S0(r,t){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=c1(hr([r]),hr([t]));if(e)return e.geometry.coordinates}function C0(r,t=500,e="meters"){const n=l1(Jn(r),t,{units:e});if(n)return n.geometry.coordinates}function P0(r,t){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=E_(hr([r]),hr([t]));if(e)return e.geometry.coordinates}function I0(r,t,e=10,n="meters"){return hy(r,t,{steps:e,units:n}).geometry.coordinates}function tf(r,t){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=hr([r]),n=hr([t]);return zy(e,n)?"oneBig":Ty(e,n)?"twoBig":!1}function M0(r){const t=d.min(d.objsIterator(r,["0"])),e=d.min(d.objsIterator(r,["1"])),n=d.min(d.objsIterator(r,["2"])),i=d.max(d.objsIterator(r,["0"])),s=d.max(d.objsIterator(r,["1"])),o=d.max(d.objsIterator(r,["2"]));return{minPos:[t,e,n],maxPos:[i,s,o],center:[(t+i)*.5,(e+s)*.5,(n+o)*.5]}}function C1(r){const{minPos:t,maxPos:e,center:n}=M0(r);if(t.some(a=>!Number.isFinite(a)||e.some(u=>!Number.isFinite(u))||n.some(u=>!Number.isFinite(u)))){console.warn("geoCenterAndRadiusFromPositions error: minPos.some(e => !Number.isFinite(e) || maxPos.some(e => !Number.isFinite(e)) || center.some(e => !Number.isFinite(e))");return}const i=jc(t,e);let s=i*.5;const o=Math.abs(t[2]-e[2]);return o!=0&&(s=Math.sqrt(i*i+o*o)*.5),{center:n,radius:s}}function P1(r){r("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),r("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),r("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var t=1;t<=60;++t)r("EPSG:"+(32600+t),"+proj=utm +zone="+t+" +datum=WGS84 +units=m"),r("EPSG:"+(32700+t),"+proj=utm +zone="+t+" +south +datum=WGS84 +units=m");r.WGS84=r["EPSG:4326"],r["EPSG:3785"]=r["EPSG:3857"],r.GOOGLE=r["EPSG:3857"],r["EPSG:900913"]=r["EPSG:3857"],r["EPSG:102113"]=r["EPSG:3857"]}var Po=1,Io=2,Ia=3,I1=4,ef=5,N0=6378137,M1=6356752314e-3,b0=.0066943799901413165,Ju=484813681109536e-20,Y=Math.PI/2,N1=.16666666666666666,b1=.04722222222222222,T1=.022156084656084655,j=1e-10,ae=.017453292519943295,Li=57.29577951308232,$t=Math.PI/4,Bu=Math.PI*2,or=3.14159265359,Hr={};Hr.greenwich=0,Hr.lisbon=-9.131906111111,Hr.paris=2.337229166667,Hr.bogota=-74.080916666667,Hr.madrid=-3.687938888889,Hr.rome=12.452333333333,Hr.bern=7.439583333333,Hr.jakarta=106.807719444444,Hr.ferro=-17.666666666667,Hr.brussels=4.367975,Hr.stockholm=18.058277777778,Hr.athens=23.7163375,Hr.oslo=10.722916666667;const x1={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.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:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var T0=/[\s_\-\/\(\)]/g;function Vs(r,t){if(r[t])return r[t];for(var e=Object.keys(r),n=t.toLowerCase().replace(T0,""),i=-1,s,o;++i<e.length;)if(s=e[i],o=s.toLowerCase().replace(T0,""),o===n)return r[s]}function rf(r){var t={},e=r.split("+").map(function(a){return a.trim()}).filter(function(a){return a}).reduce(function(a,u){var l=u.split("=");return l.push(!0),a[l[0].toLowerCase()]=l[1],a},{}),n,i,s,o={proj:"projName",datum:"datumCode",rf:function(a){t.rf=parseFloat(a)},lat_0:function(a){t.lat0=a*ae},lat_1:function(a){t.lat1=a*ae},lat_2:function(a){t.lat2=a*ae},lat_ts:function(a){t.lat_ts=a*ae},lon_0:function(a){t.long0=a*ae},lon_1:function(a){t.long1=a*ae},lon_2:function(a){t.long2=a*ae},alpha:function(a){t.alpha=parseFloat(a)*ae},gamma:function(a){t.rectified_grid_angle=parseFloat(a)*ae},lonc:function(a){t.longc=a*ae},x_0:function(a){t.x0=parseFloat(a)},y_0:function(a){t.y0=parseFloat(a)},k_0:function(a){t.k0=parseFloat(a)},k:function(a){t.k0=parseFloat(a)},a:function(a){t.a=parseFloat(a)},b:function(a){t.b=parseFloat(a)},r:function(a){t.a=t.b=parseFloat(a)},r_a:function(){t.R_A=!0},zone:function(a){t.zone=parseInt(a,10)},south:function(){t.utmSouth=!0},towgs84:function(a){t.datum_params=a.split(",").map(function(u){return parseFloat(u)})},to_meter:function(a){t.to_meter=parseFloat(a)},units:function(a){t.units=a;var u=Vs(x1,a);u&&(t.to_meter=u.to_meter)},from_greenwich:function(a){t.from_greenwich=a*ae},pm:function(a){var u=Vs(Hr,a);t.from_greenwich=(u||parseFloat(a))*ae},nadgrids:function(a){a==="@null"?t.datumCode="none":t.nadgrids=a},axis:function(a){var u="ewnsud";a.length===3&&u.indexOf(a.substr(0,1))!==-1&&u.indexOf(a.substr(1,1))!==-1&&u.indexOf(a.substr(2,1))!==-1&&(t.axis=a)},approx:function(){t.approx=!0}};for(n in e)i=e[n],n in o?(s=o[n],typeof s=="function"?s(i):t[s]=i):t[n]=i;return typeof t.datumCode=="string"&&t.datumCode!=="WGS84"&&(t.datumCode=t.datumCode.toLowerCase()),t}class x0{static getId(t){const e=t.find(n=>Array.isArray(n)&&n[0]==="ID");return e&&e.length>=3?{authority:e[1],code:parseInt(e[2],10)}:null}static convertUnit(t,e="unit"){if(!t||t.length<3)return{type:e,name:"unknown",conversion_factor:null};const n=t[1],i=parseFloat(t[2])||null,s=t.find(a=>Array.isArray(a)&&a[0]==="ID"),o=s?{authority:s[1],code:parseInt(s[2],10)}:null;return{type:e,name:n,conversion_factor:i,id:o}}static convertAxis(t){const e=t[1]||"Unknown";let n;const i=e.match(/^\((.)\)$/);if(i){const l=i[1].toUpperCase();if(l==="E")n="east";else if(l==="N")n="north";else if(l==="U")n="up";else throw new Error(`Unknown axis abbreviation: ${l}`)}else n=t[2]?t[2].toLowerCase():"unknown";const s=t.find(l=>Array.isArray(l)&&l[0]==="ORDER"),o=s?parseInt(s[1],10):null,a=t.find(l=>Array.isArray(l)&&(l[0]==="LENGTHUNIT"||l[0]==="ANGLEUNIT"||l[0]==="SCALEUNIT")),u=this.convertUnit(a);return{name:e,direction:n,unit:u,order:o}}static extractAxes(t){return t.filter(e=>Array.isArray(e)&&e[0]==="AXIS").map(e=>this.convertAxis(e)).sort((e,n)=>(e.order||0)-(n.order||0))}static convert(t,e={}){switch(t[0]){case"PROJCRS":e.type="ProjectedCRS",e.name=t[1],e.base_crs=t.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")):null,e.conversion=t.find(f=>Array.isArray(f)&&f[0]==="CONVERSION")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="CONVERSION")):null;const n=t.find(f=>Array.isArray(f)&&f[0]==="CS");n&&(e.coordinate_system={type:n[1],axis:this.extractAxes(t)});const i=t.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT");if(i){const f=this.convertUnit(i);e.coordinate_system.unit=f}e.id=this.getId(t);break;case"BASEGEOGCRS":case"GEOGCRS":e.type="GeographicCRS",e.name=t[1];const s=t.find(f=>Array.isArray(f)&&(f[0]==="DATUM"||f[0]==="ENSEMBLE"));if(s){const f=this.convert(s);s[0]==="ENSEMBLE"?e.datum_ensemble=f:e.datum=f;const p=t.find(v=>Array.isArray(v)&&v[0]==="PRIMEM");p&&p[1]!=="Greenwich"&&(f.prime_meridian={name:p[1],longitude:parseFloat(p[2])})}e.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(t)},e.id=this.getId(t);break;case"DATUM":e.type="GeodeticReferenceFrame",e.name=t[1],e.ellipsoid=t.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":e.type="DatumEnsemble",e.name=t[1],e.members=t.filter(f=>Array.isArray(f)&&f[0]==="MEMBER").map(f=>({type:"DatumEnsembleMember",name:f[1],id:this.getId(f)}));const o=t.find(f=>Array.isArray(f)&&f[0]==="ENSEMBLEACCURACY");o&&(e.accuracy=parseFloat(o[1]));const a=t.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID");a&&(e.ellipsoid=this.convert(a)),e.id=this.getId(t);break;case"ELLIPSOID":e.type="Ellipsoid",e.name=t[1],e.semi_major_axis=parseFloat(t[2]),e.inverse_flattening=parseFloat(t[3]),t.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT")&&this.convert(t.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT"),e);break;case"CONVERSION":e.type="Conversion",e.name=t[1],e.method=t.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,e.parameters=t.filter(f=>Array.isArray(f)&&f[0]==="PARAMETER").map(f=>this.convert(f));break;case"METHOD":e.type="Method",e.name=t[1],e.id=this.getId(t);break;case"PARAMETER":e.type="Parameter",e.name=t[1],e.value=parseFloat(t[2]),e.unit=this.convertUnit(t.find(f=>Array.isArray(f)&&(f[0]==="LENGTHUNIT"||f[0]==="ANGLEUNIT"||f[0]==="SCALEUNIT"))),e.id=this.getId(t);break;case"BOUNDCRS":e.type="BoundCRS";const u=t.find(f=>Array.isArray(f)&&f[0]==="SOURCECRS");if(u){const f=u.find(p=>Array.isArray(p));e.source_crs=f?this.convert(f):null}const l=t.find(f=>Array.isArray(f)&&f[0]==="TARGETCRS");if(l){const f=l.find(p=>Array.isArray(p));e.target_crs=f?this.convert(f):null}const h=t.find(f=>Array.isArray(f)&&f[0]==="ABRIDGEDTRANSFORMATION");h?e.transformation=this.convert(h):e.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(e.type="Transformation",e.name=t[1],e.method=t.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,e.parameters=t.filter(f=>Array.isArray(f)&&(f[0]==="PARAMETER"||f[0]==="PARAMETERFILE")).map(f=>{if(f[0]==="PARAMETER")return this.convert(f);if(f[0]==="PARAMETERFILE")return{name:f[1],value:f[2],id:{authority:"EPSG",code:8656}}}),e.parameters.length===7){const f=e.parameters[6];f.name==="Scale difference"&&(f.value=Math.round((f.value-1)*1e12)/1e6)}e.id=this.getId(t);break;case"AXIS":e.coordinate_system||(e.coordinate_system={type:"unspecified",axis:[]}),e.coordinate_system.axis.push(this.convertAxis(t));break;case"LENGTHUNIT":const c=this.convertUnit(t,"LinearUnit");e.coordinate_system&&e.coordinate_system.axis&&e.coordinate_system.axis.forEach(f=>{f.unit||(f.unit=c)}),c.conversion_factor&&c.conversion_factor!==1&&e.semi_major_axis&&(e.semi_major_axis={value:e.semi_major_axis,unit:c});break;default:e.keyword=t[0];break}return e}}class O1 extends x0{static convert(t,e={}){return super.convert(t,e),e.coordinate_system&&e.coordinate_system.subtype==="Cartesian"&&delete e.coordinate_system,e.usage&&delete e.usage,e}}class A1 extends x0{static convert(t,e={}){super.convert(t,e);const n=t.find(s=>Array.isArray(s)&&s[0]==="CS");n&&(e.coordinate_system={subtype:n[1],axis:this.extractAxes(t)});const i=t.find(s=>Array.isArray(s)&&s[0]==="USAGE");if(i){const s=i.find(u=>Array.isArray(u)&&u[0]==="SCOPE"),o=i.find(u=>Array.isArray(u)&&u[0]==="AREA"),a=i.find(u=>Array.isArray(u)&&u[0]==="BBOX");e.usage={},s&&(e.usage.scope=s[1]),o&&(e.usage.area=o[1]),a&&(e.usage.bbox=a.slice(1))}return e}}function D1(r){return r.find(t=>Array.isArray(t)&&t[0]==="USAGE")?"2019":(r.find(t=>Array.isArray(t)&&t[0]==="CS")||r[0]==="BOUNDCRS"||r[0]==="PROJCRS"||r[0]==="GEOGCRS","2015")}function L1(r){return(D1(r)==="2019"?A1:O1).convert(r)}function R1(r){const t=r.toUpperCase();return t.includes("PROJCRS")||t.includes("GEOGCRS")||t.includes("BOUNDCRS")||t.includes("VERTCRS")||t.includes("LENGTHUNIT")||t.includes("ANGLEUNIT")||t.includes("SCALEUNIT")?"WKT2":(t.includes("PROJCS")||t.includes("GEOGCS")||t.includes("LOCAL_CS")||t.includes("VERT_CS")||t.includes("UNIT"),"WKT1")}var Qu=1,O0=2,A0=3,wh=4,D0=5,nf=-1,F1=/\s/,G1=/[A-Za-z]/,k1=/[A-Za-z84_]/,Sh=/[,\]]/,L0=/[\d\.E\-\+]/;function ls(r){if(typeof r!="string")throw new Error("not a string");this.text=r.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Qu}ls.prototype.readCharicter=function(){var r=this.text[this.place++];if(this.state!==wh)for(;F1.test(r);){if(this.place>=this.text.length)return;r=this.text[this.place++]}switch(this.state){case Qu:return this.neutral(r);case O0:return this.keyword(r);case wh:return this.quoted(r);case D0:return this.afterquote(r);case A0:return this.number(r);case nf:return}},ls.prototype.afterquote=function(r){if(r==='"'){this.word+='"',this.state=wh;return}if(Sh.test(r)){this.word=this.word.trim(),this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in afterquote yet, index '+this.place)},ls.prototype.afterItem=function(r){if(r===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Qu;return}if(r==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Qu,this.currentObject=this.stack.pop(),this.currentObject||(this.state=nf);return}},ls.prototype.number=function(r){if(L0.test(r)){this.word+=r;return}if(Sh.test(r)){this.word=parseFloat(this.word),this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in number yet, index '+this.place)},ls.prototype.quoted=function(r){if(r==='"'){this.state=D0;return}this.word+=r},ls.prototype.keyword=function(r){if(k1.test(r)){this.word+=r;return}if(r==="["){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=Qu;return}if(Sh.test(r)){this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in keyword yet, index '+this.place)},ls.prototype.neutral=function(r){if(G1.test(r)){this.word=r,this.state=O0;return}if(r==='"'){this.word="",this.state=wh;return}if(L0.test(r)){this.word=r,this.state=A0;return}if(Sh.test(r)){this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in neutral yet, index '+this.place)},ls.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===nf)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function V1(r){var t=new ls(r);return t.output()}function sf(r,t,e){Array.isArray(t)&&(e.unshift(t),t=null);var n=t?{}:r,i=e.reduce(function(s,o){return Ma(o,s),s},n);t&&(r[t]=i)}function Ma(r,t){if(!Array.isArray(r)){t[r]=!0;return}var e=r.shift();if(e==="PARAMETER"&&(e=r.shift()),r.length===1){if(Array.isArray(r[0])){t[e]={},Ma(r[0],t[e]);return}t[e]=r[0];return}if(!r.length){t[e]=!0;return}if(e==="TOWGS84"){t[e]=r;return}if(e==="AXIS"){e in t||(t[e]=[]),t[e].push(r);return}Array.isArray(e)||(t[e]={});var n;switch(e){case"UNIT":case"PRIMEM":case"VERT_DATUM":t[e]={name:r[0].toLowerCase(),convert:r[1]},r.length===3&&Ma(r[2],t[e]);return;case"SPHEROID":case"ELLIPSOID":t[e]={name:r[0],a:r[1],rf:r[2]},r.length===4&&Ma(r[3],t[e]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":r[0]=["name",r[0]],sf(t,e,r);return;case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":r[0]=["name",r[0]],sf(t,e,r),t[e].type=e;return;default:for(n=-1;++n<r.length;)if(!Array.isArray(r[n]))return Ma(r,t[e]);return sf(t,e,r)}}var U1=.017453292519943295;function li(r){return r*U1}function R0(r){const t=(r.projName||"").toLowerCase().replace(/_/g," ");!r.long0&&r.longc&&(t==="albers conic equal area"||t==="lambert azimuthal equal area")&&(r.long0=r.longc),!r.lat_ts&&r.lat1&&(t==="stereographic south pole"||t==="polar stereographic (variant b)")?(r.lat0=li(r.lat1>0?90:-90),r.lat_ts=r.lat1,delete r.lat1):!r.lat_ts&&r.lat0&&(t==="polar stereographic"||t==="polar stereographic (variant a)")&&(r.lat_ts=r.lat0,r.lat0=li(r.lat0>0?90:-90),delete r.lat1)}function F0(r){let t={units:null,to_meter:void 0};return typeof r=="string"?(t.units=r.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.units==="meter"&&(t.to_meter=1)):r&&r.name&&(t.units=r.name.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.to_meter=r.conversion_factor),t}function G0(r){return typeof r=="object"?r.value*r.unit.conversion_factor:r}function k0(r,t){r.ellipsoid.radius?(t.a=r.ellipsoid.radius,t.rf=0):(t.a=G0(r.ellipsoid.semi_major_axis),r.ellipsoid.inverse_flattening!==void 0?t.rf=r.ellipsoid.inverse_flattening:r.ellipsoid.semi_major_axis!==void 0&&r.ellipsoid.semi_minor_axis!==void 0&&(t.rf=t.a/(t.a-G0(r.ellipsoid.semi_minor_axis))))}function Ch(r,t={}){return!r||typeof r!="object"?r:r.type==="BoundCRS"?(Ch(r.source_crs,t),r.transformation&&(r.transformation.method&&r.transformation.method.name==="NTv2"?t.nadgrids=r.transformation.parameters[0].value:t.datum_params=r.transformation.parameters.map(e=>e.value)),t):(Object.keys(r).forEach(e=>{const n=r[e];if(n!==null)switch(e){case"name":if(t.srsCode)break;t.name=n,t.srsCode=n;break;case"type":n==="GeographicCRS"?t.projName="longlat":n==="ProjectedCRS"&&r.conversion&&r.conversion.method&&(t.projName=r.conversion.method.name);break;case"datum":case"datum_ensemble":n.ellipsoid&&(t.ellps=n.ellipsoid.name,k0(n,t)),n.prime_meridian&&(t.from_greenwich=n.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":t.ellps=n.name,k0(n,t);break;case"prime_meridian":t.long0=(n.longitude||0)*Math.PI/180;break;case"coordinate_system":if(n.axis){if(t.axis=n.axis.map(i=>{const s=i.direction;if(s==="east")return"e";if(s==="north")return"n";if(s==="west")return"w";if(s==="south")return"s";throw new Error(`Unknown axis direction: ${s}`)}).join("")+"u",n.unit){const{units:i,to_meter:s}=F0(n.unit);t.units=i,t.to_meter=s}else if(n.axis[0]&&n.axis[0].unit){const{units:i,to_meter:s}=F0(n.axis[0].unit);t.units=i,t.to_meter=s}}break;case"id":n.authority&&n.code&&(t.title=n.authority+":"+n.code);break;case"conversion":n.method&&n.method.name&&(t.projName=n.method.name),n.parameters&&n.parameters.forEach(i=>{const s=i.name.toLowerCase().replace(/\s+/g,"_"),o=i.value;i.unit&&i.unit.conversion_factor?t[s]=o*i.unit.conversion_factor:i.unit==="degree"?t[s]=o*Math.PI/180:t[s]=o});break;case"unit":n.name&&(t.units=n.name.toLowerCase(),t.units==="metre"&&(t.units="meter")),n.conversion_factor&&(t.to_meter=n.conversion_factor);break;case"base_crs":Ch(n,t),t.datumCode=n.id?n.id.authority+"_"+n.id.code:n.name;break}}),t.latitude_of_false_origin!==void 0&&(t.lat0=t.latitude_of_false_origin),t.longitude_of_false_origin!==void 0&&(t.long0=t.longitude_of_false_origin),t.latitude_of_standard_parallel!==void 0&&(t.lat0=t.latitude_of_standard_parallel,t.lat1=t.latitude_of_standard_parallel),t.latitude_of_1st_standard_parallel!==void 0&&(t.lat1=t.latitude_of_1st_standard_parallel),t.latitude_of_2nd_standard_parallel!==void 0&&(t.lat2=t.latitude_of_2nd_standard_parallel),t.latitude_of_projection_centre!==void 0&&(t.lat0=t.latitude_of_projection_centre),t.longitude_of_projection_centre!==void 0&&(t.longc=t.longitude_of_projection_centre),t.easting_at_false_origin!==void 0&&(t.x0=t.easting_at_false_origin),t.northing_at_false_origin!==void 0&&(t.y0=t.northing_at_false_origin),t.latitude_of_natural_origin!==void 0&&(t.lat0=t.latitude_of_natural_origin),t.longitude_of_natural_origin!==void 0&&(t.long0=t.longitude_of_natural_origin),t.longitude_of_origin!==void 0&&(t.long0=t.longitude_of_origin),t.false_easting!==void 0&&(t.x0=t.false_easting),t.easting_at_projection_centre&&(t.x0=t.easting_at_projection_centre),t.false_northing!==void 0&&(t.y0=t.false_northing),t.northing_at_projection_centre&&(t.y0=t.northing_at_projection_centre),t.standard_parallel_1!==void 0&&(t.lat1=t.standard_parallel_1),t.standard_parallel_2!==void 0&&(t.lat2=t.standard_parallel_2),t.scale_factor_at_natural_origin!==void 0&&(t.k0=t.scale_factor_at_natural_origin),t.scale_factor_at_projection_centre!==void 0&&(t.k0=t.scale_factor_at_projection_centre),t.scale_factor_on_pseudo_standard_parallel!==void 0&&(t.k0=t.scale_factor_on_pseudo_standard_parallel),t.azimuth!==void 0&&(t.alpha=t.azimuth),t.azimuth_at_projection_centre!==void 0&&(t.alpha=t.azimuth_at_projection_centre),t.angle_from_rectified_to_skew_grid&&(t.rectified_grid_angle=t.angle_from_rectified_to_skew_grid),R0(t),t)}var z1=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function q1(r,t){var e=t[0],n=t[1];!(e in r)&&n in r&&(r[e]=r[n],t.length===3&&(r[e]=t[2](r[e])))}function V0(r){for(var t=Object.keys(r),e=0,n=t.length;e<n;++e){var i=t[e];z1.indexOf(i)!==-1&&W1(r[i]),typeof r[i]=="object"&&V0(r[i])}}function W1(r){if(r.AUTHORITY){var t=Object.keys(r.AUTHORITY)[0];t&&t in r.AUTHORITY&&(r.title=t+":"+r.AUTHORITY[t])}if(r.type==="GEOGCS"?r.projName="longlat":r.type==="LOCAL_CS"?(r.projName="identity",r.local=!0):typeof r.PROJECTION=="object"?r.projName=Object.keys(r.PROJECTION)[0]:r.projName=r.PROJECTION,r.AXIS){for(var e="",n=0,i=r.AXIS.length;n<i;++n){var s=[r.AXIS[n][0].toLowerCase(),r.AXIS[n][1].toLowerCase()];s[0].indexOf("north")!==-1||(s[0]==="y"||s[0]==="lat")&&s[1]==="north"?e+="n":s[0].indexOf("south")!==-1||(s[0]==="y"||s[0]==="lat")&&s[1]==="south"?e+="s":s[0].indexOf("east")!==-1||(s[0]==="x"||s[0]==="lon")&&s[1]==="east"?e+="e":(s[0].indexOf("west")!==-1||(s[0]==="x"||s[0]==="lon")&&s[1]==="west")&&(e+="w")}e.length===2&&(e+="u"),e.length===3&&(r.axis=e)}r.UNIT&&(r.units=r.UNIT.name.toLowerCase(),r.units==="metre"&&(r.units="meter"),r.UNIT.convert&&(r.type==="GEOGCS"?r.DATUM&&r.DATUM.SPHEROID&&(r.to_meter=r.UNIT.convert*r.DATUM.SPHEROID.a):r.to_meter=r.UNIT.convert));var o=r.GEOGCS;r.type==="GEOGCS"&&(o=r),o&&(o.DATUM?r.datumCode=o.DATUM.name.toLowerCase():r.datumCode=o.name.toLowerCase(),r.datumCode.slice(0,2)==="d_"&&(r.datumCode=r.datumCode.slice(2)),r.datumCode==="new_zealand_1949"&&(r.datumCode="nzgd49"),(r.datumCode==="wgs_1984"||r.datumCode==="world_geodetic_system_1984")&&(r.PROJECTION==="Mercator_Auxiliary_Sphere"&&(r.sphere=!0),r.datumCode="wgs84"),r.datumCode==="belge_1972"&&(r.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(r.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),r.ellps.toLowerCase().slice(0,13)==="international"&&(r.ellps="intl"),r.a=o.DATUM.SPHEROID.a,r.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(r.datum_params=o.DATUM.TOWGS84),~r.datumCode.indexOf("osgb_1936")&&(r.datumCode="osgb36"),~r.datumCode.indexOf("osni_1952")&&(r.datumCode="osni52"),(~r.datumCode.indexOf("tm65")||~r.datumCode.indexOf("geodetic_datum_of_1965"))&&(r.datumCode="ire65"),r.datumCode==="ch1903+"&&(r.datumCode="ch1903"),~r.datumCode.indexOf("israel")&&(r.datumCode="isr93")),r.b&&!isFinite(r.b)&&(r.b=r.a),r.rectified_grid_angle&&(r.rectified_grid_angle=li(r.rectified_grid_angle));function a(h){var c=r.to_meter||1;return h*c}var u=function(h){return q1(r,h)},l=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",li],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",li],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",li],["lat0","latitude_of_origin",li],["lat0","standard_parallel_1",li],["lat1","standard_parallel_1",li],["lat2","standard_parallel_2",li],["azimuth","Azimuth"],["alpha","azimuth",li],["srsCode","name"]];l.forEach(u),R0(r)}function of(r){if(typeof r=="object")return Ch(r);const t=R1(r);var e=V1(r);if(t==="WKT2"){const s=L1(e);return Ch(s)}var n=e[0],i={};return Ma(e,i),V0(i),i[n]}function Lr(r){var t=this;if(arguments.length===2){var e=arguments[1];typeof e=="string"?e.charAt(0)==="+"?Lr[r]=rf(arguments[1]):Lr[r]=of(arguments[1]):Lr[r]=e}else if(arguments.length===1){if(Array.isArray(r))return r.map(function(n){Array.isArray(n)?Lr.apply(t,n):Lr(n)});if(typeof r=="string"){if(r in Lr)return Lr[r]}else"EPSG"in r?Lr["EPSG:"+r.EPSG]=r:"ESRI"in r?Lr["ESRI:"+r.ESRI]=r:"IAU2000"in r?Lr["IAU2000:"+r.IAU2000]=r:console.log(r);return}}P1(Lr);function X1(r){return typeof r=="string"}function H1(r){return r in Lr}function Y1(r){return r.indexOf("+")!==0&&r.indexOf("[")!==-1||typeof r=="object"&&!("srsCode"in r)}var J1=["3857","900913","3785","102113"];function B1(r){var t=Vs(r,"authority");if(t){var e=Vs(t,"epsg");return e&&J1.indexOf(e)>-1}}function Q1(r){var t=Vs(r,"extension");if(t)return Vs(t,"proj4")}function K1(r){return r[0]==="+"}function Z1(r){if(X1(r)){if(H1(r))return Lr[r];if(Y1(r)){var t=of(r);if(B1(t))return Lr["EPSG:3857"];var e=Q1(t);return e?rf(e):t}if(K1(r))return rf(r)}else return r.projName?r:of(r)}function U0(r,t){r=r||{};var e,n;if(!t)return r;for(n in t)e=t[n],e!==void 0&&(r[n]=e);return r}function Ri(r,t,e){var n=r*t;return e/Math.sqrt(1-n*n)}function Ku(r){return r<0?-1:1}function nt(r){return Math.abs(r)<=or?r:r-Ku(r)*Bu}function hi(r,t,e){var n=r*e,i=.5*r;return n=Math.pow((1-n)/(1+n),i),Math.tan(.5*(Y-t))/n}function Zu(r,t){for(var e=.5*r,n,i,s=Y-2*Math.atan(t),o=0;o<=15;o++)if(n=r*Math.sin(s),i=Y-2*Math.atan(t*Math.pow((1-n)/(1+n),e))-s,s+=i,Math.abs(i)<=1e-10)return s;return-9999}function $1(){var r=this.b/this.a;this.es=1-r*r,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Ri(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function j1(r){var t=r.x,e=r.y;if(e*Li>90&&e*Li<-90&&t*Li>180&&t*Li<-180)return null;var n,i;if(Math.abs(Math.abs(e)-Y)<=j)return null;if(this.sphere)n=this.x0+this.a*this.k0*nt(t-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan($t+.5*e));else{var s=Math.sin(e),o=hi(this.e,e,s);n=this.x0+this.a*this.k0*nt(t-this.long0),i=this.y0-this.a*this.k0*Math.log(o)}return r.x=n,r.y=i,r}function tE(r){var t=r.x-this.x0,e=r.y-this.y0,n,i;if(this.sphere)i=Y-2*Math.atan(Math.exp(-e/(this.a*this.k0)));else{var s=Math.exp(-e/(this.a*this.k0));if(i=Zu(this.e,s),i===-9999)return null}return n=nt(this.long0+t/(this.a*this.k0)),r.x=n,r.y=i,r}var eE=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const rE={init:$1,forward:j1,inverse:tE,names:eE};function nE(){}function z0(r){return r}var iE=["longlat","identity"],sE=[rE,{init:nE,forward:z0,inverse:z0,names:iE}],Mo={},Na=[];function q0(r,t){var e=Na.length;return r.names?(Na[e]=r,r.names.forEach(function(n){Mo[n.toLowerCase()]=e}),this):(console.log(t),!0)}function W0(r){return r.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function oE(r){if(!r)return!1;var t=r.toLowerCase();if(typeof Mo[t]<"u"&&Na[Mo[t]]||(t=W0(t),t in Mo&&Na[Mo[t]]))return Na[Mo[t]]}function aE(){sE.forEach(q0)}const uE={start:aE,add:q0,get:oE};var X0={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const lE=X0.WGS84;function hE(r,t,e,n){var i=r*r,s=t*t,o=(i-s)/i,a=0;n?(r*=1-o*(N1+o*(b1+o*T1)),i=r*r,o=0):a=Math.sqrt(o);var u=(i-s)/s;return{es:o,e:a,ep2:u}}function cE(r,t,e,n,i){if(!r){var s=Vs(X0,n);s||(s=lE),r=s.a,t=s.b,e=s.rf}return e&&!t&&(t=(1-1/e)*r),(e===0||Math.abs(r-t)<j)&&(i=!0,t=r),{a:r,b:t,rf:e,sphere:i}}var Ph={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var fE in Ph){var af=Ph[fE];af.datumName&&(Ph[af.datumName]=af)}function dE(r,t,e,n,i,s,o){var a={};return r===void 0||r==="none"?a.datum_type=ef:a.datum_type=I1,t&&(a.datum_params=t.map(parseFloat),(a.datum_params[0]!==0||a.datum_params[1]!==0||a.datum_params[2]!==0)&&(a.datum_type=Po),a.datum_params.length>3&&(a.datum_params[3]!==0||a.datum_params[4]!==0||a.datum_params[5]!==0||a.datum_params[6]!==0)&&(a.datum_type=Io,a.datum_params[3]*=Ju,a.datum_params[4]*=Ju,a.datum_params[5]*=Ju,a.datum_params[6]=a.datum_params[6]/1e6+1)),o&&(a.datum_type=Ia,a.grids=o),a.a=e,a.b=n,a.es=i,a.ep2=s,a}var uf={};function gE(r,t,e){return t instanceof ArrayBuffer?pE(r,t,e):{ready:vE(r,t)}}function pE(r,t,e){var n=!0;e!==void 0&&e.includeErrorFields===!1&&(n=!1);var i=new DataView(t),s=_E(i),o=EE(i,s),a=wE(i,o,s,n),u={header:o,subgrids:a};return uf[r]=u,u}async function vE(r,t){for(var e=[],n=await t.getImageCount(),i=n-1;i>=0;i--){var s=await t.getImage(i),o=await s.readRasters(),a=o,u=[s.getWidth(),s.getHeight()],l=s.getBoundingBox().map(H0),h=[s.fileDirectory.ModelPixelScale[0],s.fileDirectory.ModelPixelScale[1]].map(H0),c=l[0]+(u[0]-1)*h[0],f=l[3]-(u[1]-1)*h[1],p=a[0],v=a[1],_=[];for(let y=u[1]-1;y>=0;y--)for(let E=u[0]-1;E>=0;E--){var w=y*u[0]+E;_.push([-Us(v[w]),Us(p[w])])}e.push({del:h,lim:u,ll:[-c,f],cvs:_})}var I={header:{nSubgrids:n},subgrids:e};return uf[r]=I,I}function mE(r){if(r===void 0)return null;var t=r.split(",");return t.map(yE)}function yE(r){if(r.length===0)return null;var t=r[0]==="@";return t&&(r=r.slice(1)),r==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:r,mandatory:!t,grid:uf[r]||null,isNull:!1}}function H0(r){return r*Math.PI/180}function Us(r){return r/3600*Math.PI/180}function _E(r){var t=r.getInt32(8,!1);return t===11?!1:(t=r.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function EE(r,t){return{nFields:r.getInt32(8,t),nSubgridFields:r.getInt32(24,t),nSubgrids:r.getInt32(40,t),shiftType:lf(r,56,64).trim(),fromSemiMajorAxis:r.getFloat64(120,t),fromSemiMinorAxis:r.getFloat64(136,t),toSemiMajorAxis:r.getFloat64(152,t),toSemiMinorAxis:r.getFloat64(168,t)}}function lf(r,t,e){return String.fromCharCode.apply(null,new Uint8Array(r.buffer.slice(t,e)))}function wE(r,t,e,n){for(var i=176,s=[],o=0;o<t.nSubgrids;o++){var a=CE(r,i,e),u=PE(r,i,a,e,n),l=Math.round(1+(a.upperLongitude-a.lowerLongitude)/a.longitudeInterval),h=Math.round(1+(a.upperLatitude-a.lowerLatitude)/a.latitudeInterval);s.push({ll:[Us(a.lowerLongitude),Us(a.lowerLatitude)],del:[Us(a.longitudeInterval),Us(a.latitudeInterval)],lim:[l,h],count:a.gridNodeCount,cvs:SE(u)});var c=16;n===!1&&(c=8),i+=176+a.gridNodeCount*c}return s}function SE(r){return r.map(function(t){return[Us(t.longitudeShift),Us(t.latitudeShift)]})}function CE(r,t,e){return{name:lf(r,t+8,t+16).trim(),parent:lf(r,t+24,t+24+8).trim(),lowerLatitude:r.getFloat64(t+72,e),upperLatitude:r.getFloat64(t+88,e),lowerLongitude:r.getFloat64(t+104,e),upperLongitude:r.getFloat64(t+120,e),latitudeInterval:r.getFloat64(t+136,e),longitudeInterval:r.getFloat64(t+152,e),gridNodeCount:r.getInt32(t+168,e)}}function PE(r,t,e,n,i){var s=t+176,o=16;i===!1&&(o=8);for(var a=[],u=0;u<e.gridNodeCount;u++){var l={latitudeShift:r.getFloat32(s+u*o,n),longitudeShift:r.getFloat32(s+u*o+4,n)};i!==!1&&(l.latitudeAccuracy=r.getFloat32(s+u*o+8,n),l.longitudeAccuracy=r.getFloat32(s+u*o+12,n)),a.push(l)}return a}function Fi(r,t){if(!(this instanceof Fi))return new Fi(r);t=t||function(l){if(l)throw l};var e=Z1(r);if(typeof e!="object"){t("Could not parse to valid json: "+r);return}var n=Fi.projections.get(e.projName);if(!n){t("Could not get projection name from: "+r);return}if(e.datumCode&&e.datumCode!=="none"){var i=Vs(Ph,e.datumCode);i&&(e.datum_params=e.datum_params||(i.towgs84?i.towgs84.split(","):null),e.ellps=i.ellipse,e.datumName=i.datumName?i.datumName:e.datumCode)}e.k0=e.k0||1,e.axis=e.axis||"enu",e.ellps=e.ellps||"wgs84",e.lat1=e.lat1||e.lat0;var s=cE(e.a,e.b,e.rf,e.ellps,e.sphere),o=hE(s.a,s.b,s.rf,e.R_A),a=mE(e.nadgrids),u=e.datum||dE(e.datumCode,e.datum_params,s.a,s.b,o.es,o.ep2,a);U0(this,e),U0(this,n),this.a=s.a,this.b=s.b,this.rf=s.rf,this.sphere=s.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=u,this.init(),t(null,this)}Fi.projections=uE,Fi.projections.start();function IE(r,t){return r.datum_type!==t.datum_type||r.a!==t.a||Math.abs(r.es-t.es)>5e-11?!1:r.datum_type===Po?r.datum_params[0]===t.datum_params[0]&&r.datum_params[1]===t.datum_params[1]&&r.datum_params[2]===t.datum_params[2]:r.datum_type===Io?r.datum_params[0]===t.datum_params[0]&&r.datum_params[1]===t.datum_params[1]&&r.datum_params[2]===t.datum_params[2]&&r.datum_params[3]===t.datum_params[3]&&r.datum_params[4]===t.datum_params[4]&&r.datum_params[5]===t.datum_params[5]&&r.datum_params[6]===t.datum_params[6]:!0}function Y0(r,t,e){var n=r.x,i=r.y,s=r.z?r.z:0,o,a,u,l;if(i<-Y&&i>-1.001*Y)i=-Y;else if(i>Y&&i<1.001*Y)i=Y;else{if(i<-Y)return{x:-1/0,y:-1/0,z:r.z};if(i>Y)return{x:1/0,y:1/0,z:r.z}}return n>Math.PI&&(n-=2*Math.PI),a=Math.sin(i),l=Math.cos(i),u=a*a,o=e/Math.sqrt(1-t*u),{x:(o+s)*l*Math.cos(n),y:(o+s)*l*Math.sin(n),z:(o*(1-t)+s)*a}}function J0(r,t,e,n){var i=1e-12,s=i*i,o=30,a,u,l,h,c,f,p,v,_,w,I,y,E,m=r.x,S=r.y,C=r.z?r.z:0,P,N,T;if(a=Math.sqrt(m*m+S*S),u=Math.sqrt(m*m+S*S+C*C),a/e<i){if(P=0,u/e<i)return N=Y,T=-n,{x:r.x,y:r.y,z:r.z}}else P=Math.atan2(S,m);l=C/u,h=a/u,c=1/Math.sqrt(1-t*(2-t)*h*h),v=h*(1-t)*c,_=l*c,E=0;do E++,p=e/Math.sqrt(1-t*_*_),T=a*v+C*_-p*(1-t*_*_),f=t*p/(p+T),c=1/Math.sqrt(1-f*(2-f)*h*h),w=h*(1-f)*c,I=l*c,y=I*v-w*_,v=w,_=I;while(y*y>s&&E<o);return N=Math.atan(I/Math.abs(w)),{x:P,y:N,z:T}}function ME(r,t,e){if(t===Po)return{x:r.x+e[0],y:r.y+e[1],z:r.z+e[2]};if(t===Io){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],l=e[6];return{x:l*(r.x-u*r.y+a*r.z)+n,y:l*(u*r.x+r.y-o*r.z)+i,z:l*(-a*r.x+o*r.y+r.z)+s}}}function NE(r,t,e){if(t===Po)return{x:r.x-e[0],y:r.y-e[1],z:r.z-e[2]};if(t===Io){var n=e[0],i=e[1],s=e[2],o=e[3],a=e[4],u=e[5],l=e[6],h=(r.x-n)/l,c=(r.y-i)/l,f=(r.z-s)/l;return{x:h+u*c-a*f,y:-u*h+c+o*f,z:a*h-o*c+f}}}function Ih(r){return r===Po||r===Io}function bE(r,t,e){if(IE(r,t)||r.datum_type===ef||t.datum_type===ef)return e;var n=r.a,i=r.es;if(r.datum_type===Ia){var s=B0(r,!1,e);if(s!==0)return;n=N0,i=b0}var o=t.a,a=t.b,u=t.es;if(t.datum_type===Ia&&(o=N0,a=M1,u=b0),i===u&&n===o&&!Ih(r.datum_type)&&!Ih(t.datum_type))return e;if(e=Y0(e,i,n),Ih(r.datum_type)&&(e=ME(e,r.datum_type,r.datum_params)),Ih(t.datum_type)&&(e=NE(e,t.datum_type,t.datum_params)),e=J0(e,u,o,a),t.datum_type===Ia){var l=B0(t,!0,e);if(l!==0)return}return e}function B0(r,t,e){if(r.grids===null||r.grids.length===0)return console.log("Grid shift grids not found"),-1;var n={x:-e.x,y:e.y},i={x:Number.NaN,y:Number.NaN},s=[];t:for(var o=0;o<r.grids.length;o++){var a=r.grids[o];if(s.push(a.name),a.isNull){i=n;break}if(a.grid===null){if(a.mandatory)return console.log("Unable to find mandatory grid '"+a.name+"'"),-1;continue}for(var u=a.grid.subgrids,l=0,h=u.length;l<h;l++){var c=u[l],f=(Math.abs(c.del[1])+Math.abs(c.del[0]))/1e4,p=c.ll[0]-f,v=c.ll[1]-f,_=c.ll[0]+(c.lim[0]-1)*c.del[0]+f,w=c.ll[1]+(c.lim[1]-1)*c.del[1]+f;if(!(v>n.y||p>n.x||w<n.y||_<n.x)&&(i=TE(n,t,c),!isNaN(i.x)))break t}}return isNaN(i.x)?(console.log("Failed to find a grid shift table for location '"+-n.x*Li+" "+n.y*Li+" tried: '"+s+"'"),-1):(e.x=-i.x,e.y=i.y,0)}function TE(r,t,e){var n={x:Number.NaN,y:Number.NaN};if(isNaN(r.x))return n;var i={x:r.x,y:r.y};i.x-=e.ll[0],i.y-=e.ll[1],i.x=nt(i.x-Math.PI)+Math.PI;var s=Q0(i,e);if(t){if(isNaN(s.x))return n;s.x=i.x-s.x,s.y=i.y-s.y;var o=9,a=1e-12,u,l;do{if(l=Q0(s,e),isNaN(l.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}u={x:i.x-(l.x+s.x),y:i.y-(l.y+s.y)},s.x+=u.x,s.y+=u.y}while(o--&&Math.abs(u.x)>a&&Math.abs(u.y)>a);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=nt(s.x+e.ll[0]),n.y=s.y+e.ll[1]}else isNaN(s.x)||(n.x=r.x+s.x,n.y=r.y+s.y);return n}function Q0(r,t){var e={x:r.x/t.del[0],y:r.y/t.del[1]},n={x:Math.floor(e.x),y:Math.floor(e.y)},i={x:e.x-1*n.x,y:e.y-1*n.y},s={x:Number.NaN,y:Number.NaN},o;if(n.x<0||n.x>=t.lim[0]||n.y<0||n.y>=t.lim[1])return s;o=n.y*t.lim[0]+n.x;var a={x:t.cvs[o][0],y:t.cvs[o][1]};o++;var u={x:t.cvs[o][0],y:t.cvs[o][1]};o+=t.lim[0];var l={x:t.cvs[o][0],y:t.cvs[o][1]};o--;var h={x:t.cvs[o][0],y:t.cvs[o][1]},c=i.x*i.y,f=i.x*(1-i.y),p=(1-i.x)*(1-i.y),v=(1-i.x)*i.y;return s.x=p*a.x+f*u.x+v*h.x+c*l.x,s.y=p*a.y+f*u.y+v*h.y+c*l.y,s}function K0(r,t,e){var n=e.x,i=e.y,s=e.z||0,o,a,u,l={};for(u=0;u<3;u++)if(!(t&&u===2&&e.z===void 0))switch(u===0?(o=n,"ew".indexOf(r.axis[u])!==-1?a="x":a="y"):u===1?(o=i,"ns".indexOf(r.axis[u])!==-1?a="y":a="x"):(o=s,a="z"),r.axis[u]){case"e":l[a]=o;break;case"w":l[a]=-o;break;case"n":l[a]=o;break;case"s":l[a]=-o;break;case"u":e[a]!==void 0&&(l.z=o);break;case"d":e[a]!==void 0&&(l.z=-o);break;default:return null}return l}function Z0(r){var t={x:r[0],y:r[1]};return r.length>2&&(t.z=r[2]),r.length>3&&(t.m=r[3]),t}function xE(r){$0(r.x),$0(r.y)}function $0(r){if(typeof Number.isFinite=="function"){if(Number.isFinite(r))return;throw new TypeError("coordinates must be finite numbers")}if(typeof r!="number"||r!==r||!isFinite(r))throw new TypeError("coordinates must be finite numbers")}function OE(r,t){return(r.datum.datum_type===Po||r.datum.datum_type===Io||r.datum.datum_type===Ia)&&t.datumCode!=="WGS84"||(t.datum.datum_type===Po||t.datum.datum_type===Io||t.datum.datum_type===Ia)&&r.datumCode!=="WGS84"}function Mh(r,t,e,n){var i;Array.isArray(e)?e=Z0(e):e={x:e.x,y:e.y,z:e.z,m:e.m};var s=e.z!==void 0;if(xE(e),r.datum&&t.datum&&OE(r,t)&&(i=new Fi("WGS84"),e=Mh(r,i,e,n),r=i),n&&r.axis!=="enu"&&(e=K0(r,!1,e)),r.projName==="longlat")e={x:e.x*ae,y:e.y*ae,z:e.z||0};else if(r.to_meter&&(e={x:e.x*r.to_meter,y:e.y*r.to_meter,z:e.z||0}),e=r.inverse(e),!e)return;if(r.from_greenwich&&(e.x+=r.from_greenwich),e=bE(r.datum,t.datum,e),!!e)return t.from_greenwich&&(e={x:e.x-t.from_greenwich,y:e.y,z:e.z||0}),t.projName==="longlat"?e={x:e.x*Li,y:e.y*Li,z:e.z||0}:(e=t.forward(e),t.to_meter&&(e={x:e.x/t.to_meter,y:e.y/t.to_meter,z:e.z||0})),n&&t.axis!=="enu"?K0(t,!0,e):(e&&!s&&delete e.z,e)}var j0=Fi("WGS84");function hf(r,t,e,n){var i,s,o;return Array.isArray(e)?(i=Mh(r,t,e,n)||{x:NaN,y:NaN},e.length>2?typeof r.name<"u"&&r.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"?typeof i.z=="number"?[i.x,i.y,i.z].concat(e.slice(3)):[i.x,i.y,e[2]].concat(e.slice(3)):[i.x,i.y].concat(e.slice(2)):[i.x,i.y]):(s=Mh(r,t,e,n),o=Object.keys(e),o.length===2||o.forEach(function(a){if(typeof r.name<"u"&&r.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"){if(a==="x"||a==="y"||a==="z")return}else if(a==="x"||a==="y")return;s[a]=e[a]}),s)}function tv(r){return r instanceof Fi?r:r.oProj?r.oProj:Fi(r)}function Yr(r,t,e){r=tv(r);var n=!1,i;return typeof t>"u"?(t=r,r=j0,n=!0):(typeof t.x<"u"||Array.isArray(t))&&(e=t,t=r,r=j0,n=!0),t=tv(t),e?hf(r,t,e):(i={forward:function(s,o){return hf(r,t,s,o)},inverse:function(s,o){return hf(t,r,s,o)}},n&&(i.oProj=t),i)}var ev=6,rv="AJSAJS",nv="AFAFAF",ba=65,Jr=73,Rn=79,$u=86,ju=90;const AE={forward:iv,inverse:DE,toPoint:sv};function iv(r,t){return t=t||5,FE(LE({lat:r[1],lon:r[0]}),t)}function DE(r){var t=ff(uv(r.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function sv(r){var t=ff(uv(r.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function cf(r){return r*(Math.PI/180)}function ov(r){return 180*(r/Math.PI)}function LE(r){var t=r.lat,e=r.lon,n=6378137,i=.00669438,s=.9996,o,a,u,l,h,c,f,p=cf(t),v=cf(e),_,w;w=Math.floor((e+180)/6)+1,e===180&&(w=60),t>=56&&t<64&&e>=3&&e<12&&(w=32),t>=72&&t<84&&(e>=0&&e<9?w=31:e>=9&&e<21?w=33:e>=21&&e<33?w=35:e>=33&&e<42&&(w=37)),o=(w-1)*6-180+3,_=cf(o),a=i/(1-i),u=n/Math.sqrt(1-i*Math.sin(p)*Math.sin(p)),l=Math.tan(p)*Math.tan(p),h=a*Math.cos(p)*Math.cos(p),c=Math.cos(p)*(v-_),f=n*((1-i/4-3*i*i/64-5*i*i*i/256)*p-(3*i/8+3*i*i/32+45*i*i*i/1024)*Math.sin(2*p)+(15*i*i/256+45*i*i*i/1024)*Math.sin(4*p)-35*i*i*i/3072*Math.sin(6*p));var I=s*u*(c+(1-l+h)*c*c*c/6+(5-18*l+l*l+72*h-58*a)*c*c*c*c*c/120)+5e5,y=s*(f+u*Math.tan(p)*(c*c/2+(5-l+9*h+4*h*h)*c*c*c*c/24+(61-58*l+l*l+600*h-330*a)*c*c*c*c*c*c/720));return t<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(I),zoneNumber:w,zoneLetter:RE(t)}}function ff(r){var t=r.northing,e=r.easting,n=r.zoneLetter,i=r.zoneNumber;if(i<0||i>60)return null;var s=.9996,o=6378137,a=.00669438,u,l=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a)),h,c,f,p,v,_,w,I,y,E=e-5e5,m=t;n<"N"&&(m-=1e7),w=(i-1)*6-180+3,u=a/(1-a),_=m/s,I=_/(o*(1-a/4-3*a*a/64-5*a*a*a/256)),y=I+(3*l/2-27*l*l*l/32)*Math.sin(2*I)+(21*l*l/16-55*l*l*l*l/32)*Math.sin(4*I)+151*l*l*l/96*Math.sin(6*I),h=o/Math.sqrt(1-a*Math.sin(y)*Math.sin(y)),c=Math.tan(y)*Math.tan(y),f=u*Math.cos(y)*Math.cos(y),p=o*(1-a)/Math.pow(1-a*Math.sin(y)*Math.sin(y),1.5),v=E/(h*s);var S=y-h*Math.tan(y)/p*(v*v/2-(5+3*c+10*f-4*f*f-9*u)*v*v*v*v/24+(61+90*c+298*f+45*c*c-252*u-3*f*f)*v*v*v*v*v*v/720);S=ov(S);var C=(v-(1+2*c+f)*v*v*v/6+(5-2*f+28*c-3*f*f+8*u+24*c*c)*v*v*v*v*v/120)/Math.cos(y);C=w+ov(C);var P;if(r.accuracy){var N=ff({northing:r.northing+r.accuracy,easting:r.easting+r.accuracy,zoneLetter:r.zoneLetter,zoneNumber:r.zoneNumber});P={top:N.lat,right:N.lon,bottom:S,left:C}}else P={lat:S,lon:C};return P}function RE(r){var t="Z";return 84>=r&&r>=72?t="X":72>r&&r>=64?t="W":64>r&&r>=56?t="V":56>r&&r>=48?t="U":48>r&&r>=40?t="T":40>r&&r>=32?t="S":32>r&&r>=24?t="R":24>r&&r>=16?t="Q":16>r&&r>=8?t="P":8>r&&r>=0?t="N":0>r&&r>=-8?t="M":-8>r&&r>=-16?t="L":-16>r&&r>=-24?t="K":-24>r&&r>=-32?t="J":-32>r&&r>=-40?t="H":-40>r&&r>=-48?t="G":-48>r&&r>=-56?t="F":-56>r&&r>=-64?t="E":-64>r&&r>=-72?t="D":-72>r&&r>=-80&&(t="C"),t}function FE(r,t){var e="00000"+r.easting,n="00000"+r.northing;return r.zoneNumber+r.zoneLetter+GE(r.easting,r.northing,r.zoneNumber)+e.substr(e.length-5,t)+n.substr(n.length-5,t)}function GE(r,t,e){var n=av(e),i=Math.floor(r/1e5),s=Math.floor(t/1e5)%20;return kE(i,s,n)}function av(r){var t=r%ev;return t===0&&(t=ev),t}function kE(r,t,e){var n=e-1,i=rv.charCodeAt(n),s=nv.charCodeAt(n),o=i+r-1,a=s+t,u=!1;o>ju&&(o=o-ju+ba-1,u=!0),(o===Jr||i<Jr&&o>Jr||(o>Jr||i<Jr)&&u)&&o++,(o===Rn||i<Rn&&o>Rn||(o>Rn||i<Rn)&&u)&&(o++,o===Jr&&o++),o>ju&&(o=o-ju+ba-1),a>$u?(a=a-$u+ba-1,u=!0):u=!1,(a===Jr||s<Jr&&a>Jr||(a>Jr||s<Jr)&&u)&&a++,(a===Rn||s<Rn&&a>Rn||(a>Rn||s<Rn)&&u)&&(a++,a===Jr&&a++),a>$u&&(a=a-$u+ba-1);var l=String.fromCharCode(o)+String.fromCharCode(a);return l}function uv(r){if(r&&r.length===0)throw"MGRSPoint coverting from nothing";for(var t=r.length,e=null,n="",i,s=0;!/[A-Z]/.test(i=r.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+r;n+=i,s++}var o=parseInt(n,10);if(s===0||s+3>t)throw"MGRSPoint bad conversion from: "+r;var a=r.charAt(s++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O")throw"MGRSPoint zone letter "+a+" not handled: "+r;e=r.substring(s,s+=2);for(var u=av(o),l=VE(e.charAt(0),u),h=UE(e.charAt(1),u);h<zE(a);)h+=2e6;var c=t-s;if(c%2!==0)throw`MGRSPoint has to have an even number
28
- of digits after the zone letter and two 100km letters - front
29
- half for easting meters, second half for
30
- northing meters`+r;var f=c/2,p=0,v=0,_,w,I,y,E;return f>0&&(_=1e5/Math.pow(10,f),w=r.substring(s,s+f),p=parseFloat(w)*_,I=r.substring(s+f),v=parseFloat(I)*_),y=p+l,E=v+h,{easting:y,northing:E,zoneLetter:a,zoneNumber:o,accuracy:_}}function VE(r,t){for(var e=rv.charCodeAt(t-1),n=1e5,i=!1;e!==r.charCodeAt(0);){if(e++,e===Jr&&e++,e===Rn&&e++,e>ju){if(i)throw"Bad character: "+r;e=ba,i=!0}n+=1e5}return n}function UE(r,t){if(r>"V")throw"MGRSPoint given invalid Northing "+r;for(var e=nv.charCodeAt(t-1),n=0,i=!1;e!==r.charCodeAt(0);){if(e++,e===Jr&&e++,e===Rn&&e++,e>$u){if(i)throw"Bad character: "+r;e=ba,i=!0}n+=1e5}return n}function zE(r){var t;switch(r){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+r}function Ta(r,t,e){if(!(this instanceof Ta))return new Ta(r,t,e);if(Array.isArray(r))this.x=r[0],this.y=r[1],this.z=r[2]||0;else if(typeof r=="object")this.x=r.x,this.y=r.y,this.z=r.z||0;else if(typeof r=="string"&&typeof t>"u"){var n=r.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=r,this.y=t,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ta.fromMGRS=function(r){return new Ta(sv(r))},Ta.prototype.toMGRS=function(r){return iv([this.x,this.y],r)};var qE=1,WE=.25,lv=.046875,hv=.01953125,cv=.01068115234375,XE=.75,HE=.46875,YE=.013020833333333334,JE=.007120768229166667,BE=.3645833333333333,QE=.005696614583333333,KE=.3076171875;function df(r){var t=[];t[0]=qE-r*(WE+r*(lv+r*(hv+r*cv))),t[1]=r*(XE-r*(lv+r*(hv+r*cv)));var e=r*r;return t[2]=e*(HE-r*(YE+r*JE)),e*=r,t[3]=e*(BE-r*QE),t[4]=e*r*KE,t}function xa(r,t,e,n){return e*=t,t*=t,n[0]*r-e*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}var ZE=20;function gf(r,t,e){for(var n=1/(1-t),i=r,s=ZE;s;--s){var o=Math.sin(i),a=1-t*o*o;if(a=(xa(i,o,Math.cos(i),e)-r)*(a*Math.sqrt(a))*n,i-=a,Math.abs(a)<j)return i}return i}function $E(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=df(this.es),this.ml0=xa(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function jE(r){var t=r.x,e=r.y,n=nt(t-this.long0),i,s,o,a=Math.sin(e),u=Math.cos(e);if(this.es){var h=u*n,c=Math.pow(h,2),f=this.ep2*Math.pow(u,2),p=Math.pow(f,2),v=Math.abs(u)>j?Math.tan(e):0,_=Math.pow(v,2),w=Math.pow(_,2);i=1-this.es*Math.pow(a,2),h=h/Math.sqrt(i);var I=xa(e,a,u,this.en);s=this.a*(this.k0*h*(1+c/6*(1-_+f+c/20*(5-18*_+w+14*f-58*_*f+c/42*(61+179*w-w*_-479*_)))))+this.x0,o=this.a*(this.k0*(I-this.ml0+a*n*h/2*(1+c/12*(5-_+9*f+4*p+c/30*(61+w-58*_+270*f-330*_*f+c/56*(1385+543*w-w*_-3111*_))))))+this.y0}else{var l=u*Math.sin(n);if(Math.abs(Math.abs(l)-1)<j)return 93;if(s=.5*this.a*this.k0*Math.log((1+l)/(1-l))+this.x0,o=u*Math.cos(n)/Math.sqrt(1-Math.pow(l,2)),l=Math.abs(o),l>=1){if(l-1>j)return 93;o=0}else o=Math.acos(o);e<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return r.x=s,r.y=o,r}function tw(r){var t,e,n,i,s=(r.x-this.x0)*(1/this.a),o=(r.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,e=gf(t,this.es,this.en),Math.abs(e)<Y){var c=Math.sin(e),f=Math.cos(e),p=Math.abs(f)>j?Math.tan(e):0,v=this.ep2*Math.pow(f,2),_=Math.pow(v,2),w=Math.pow(p,2),I=Math.pow(w,2);t=1-this.es*Math.pow(c,2);var y=s*Math.sqrt(t)/this.k0,E=Math.pow(y,2);t=t*p,n=e-t*E/(1-this.es)*.5*(1-E/12*(5+3*w-9*v*w+v-4*_-E/30*(61+90*w-252*v*w+45*I+46*v-E/56*(1385+3633*w+4095*I+1574*I*w)))),i=nt(this.long0+y*(1-E/6*(1+2*w+v-E/20*(5+28*w+24*I+8*v*w+6*v-E/42*(61+662*w+1320*I+720*I*w))))/f)}else n=Y*Ku(o),i=0;else{var a=Math.exp(s/this.k0),u=.5*(a-1/a),l=this.lat0+o/this.k0,h=Math.cos(l);t=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(u,2))),n=Math.asin(t),o<0&&(n=-n),u===0&&h===0?i=0:i=nt(Math.atan2(u,h)+this.long0)}return r.x=i,r.y=n,r}var ew=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const Nh={init:$E,forward:jE,inverse:tw,names:ew};function fv(r){var t=Math.exp(r);return t=(t-1/t)/2,t}function Br(r,t){r=Math.abs(r),t=Math.abs(t);var e=Math.max(r,t),n=Math.min(r,t)/(e||1);return e*Math.sqrt(1+Math.pow(n,2))}function rw(r){var t=1+r,e=t-1;return e===0?r:r*Math.log(t)/e}function nw(r){var t=Math.abs(r);return t=rw(t*(1+t/(Br(1,t)+1))),r<0?-t:t}function pf(r,t){for(var e=2*Math.cos(2*t),n=r.length-1,i=r[n],s=0,o;--n>=0;)o=-s+e*i+r[n],s=i,i=o;return t+o*Math.sin(2*t)}function iw(r,t){for(var e=2*Math.cos(t),n=r.length-1,i=r[n],s=0,o;--n>=0;)o=-s+e*i+r[n],s=i,i=o;return Math.sin(t)*o}function sw(r){var t=Math.exp(r);return t=(t+1/t)/2,t}function dv(r,t,e){for(var n=Math.sin(t),i=Math.cos(t),s=fv(e),o=sw(e),a=2*i*o,u=-2*n*s,l=r.length-1,h=r[l],c=0,f=0,p=0,v,_;--l>=0;)v=f,_=c,f=h,c=p,h=-v+a*f-u*c+r[l],p=-_+u*f+a*c;return a=n*o,u=i*s,[a*h-u*p,a*p+u*h]}function ow(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Nh.init.apply(this),this.forward=Nh.forward,this.inverse=Nh.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var r=this.es/(1+Math.sqrt(1-this.es)),t=r/(2-r),e=t;this.cgb[0]=t*(2+t*(-.6666666666666666+t*(-2+t*(2.577777777777778+t*(.5777777777777777+t*-4.228148148148148))))),this.cbg[0]=t*(-2+t*(.6666666666666666+t*(1.3333333333333333+t*(-1.8222222222222222+t*(.7111111111111111+t*.9824338624338624))))),e=e*t,this.cgb[1]=e*(2.3333333333333335+t*(-1.6+t*(-5.044444444444444+t*(8.584126984126984+t*2.458201058201058)))),this.cbg[1]=e*(1.6666666666666667+t*(-1.0666666666666667+t*(-1.4444444444444444+t*(2.86984126984127+t*-1.6105820105820106)))),e=e*t,this.cgb[2]=e*(3.7333333333333334+t*(-3.8857142857142857+t*(-12.019047619047619+t*26.03668430335097))),this.cbg[2]=e*(-1.7333333333333334+t*(1.619047619047619+t*(1.6+t*-4.474779541446208))),e=e*t,this.cgb[3]=e*(6.792063492063492+t*(-9.485714285714286+t*-28.188500881834216)),this.cbg[3]=e*(1.9634920634920634+t*(-2.4+t*-1.7518165784832451)),e=e*t,this.cgb[4]=e*(13.250793650793652+t*-23.22238255571589),this.cbg[4]=e*(-2.3301587301587303+t*3.5144460477793813),e=e*t,this.cgb[5]=e*27.011268237934903,this.cbg[5]=e*2.8496841430174764,e=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+e*(.25+e*(.015625+e/256))),this.utg[0]=t*(-.5+t*(.6666666666666666+t*(-.3854166666666667+t*(.002777777777777778+t*(.158203125+t*-.15905919312169312))))),this.gtu[0]=t*(.5+t*(-.6666666666666666+t*(.3125+t*(.22777777777777777+t*(-.4409722222222222+t*.20875661375661375))))),this.utg[1]=e*(-.020833333333333332+t*(-.06666666666666667+t*(.3034722222222222+t*(-.4380952380952381+t*.2890188388723545)))),this.gtu[1]=e*(.2708333333333333+t*(-.6+t*(.38680555555555557+t*(.44603174603174606+t*-1.0248393063822752)))),e=e*t,this.utg[2]=e*(-.035416666666666666+t*(.04404761904761905+t*(.046651785714285715+t*-.06138668430335097))),this.gtu[2]=e*(.25416666666666665+t*(-.7357142857142858+t*(.5603050595238095+t*.9237378747795415))),e=e*t,this.utg[3]=e*(-.02726314484126984+t*(.021825396825396824+t*.11439745921516754)),this.gtu[3]=e*(.30729786706349205+t*(-1.0654761904761905+t*.9096203979276896)),e=e*t,this.utg[4]=e*(-.02841641865079365+t*.027268468414301746),this.gtu[4]=e*(.4306671626984127+t*-1.713007555715889),e=e*t,this.utg[5]=e*-.03233083094085698,this.gtu[5]=e*.6650675310896665;var n=pf(this.cbg,this.lat0);this.Zb=-this.Qn*(n+iw(this.gtu,2*n))}function aw(r){var t=nt(r.x-this.long0),e=r.y;e=pf(this.cbg,e);var n=Math.sin(e),i=Math.cos(e),s=Math.sin(t),o=Math.cos(t);e=Math.atan2(n,o*i),t=Math.atan2(s*i,Br(n,i*o)),t=nw(Math.tan(t));var a=dv(this.gtu,2*e,2*t);e=e+a[0],t=t+a[1];var u,l;return Math.abs(t)<=2.623395162778?(u=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*e+this.Zb)+this.y0):(u=1/0,l=1/0),r.x=u,r.y=l,r}function uw(r){var t=(r.x-this.x0)*(1/this.a),e=(r.y-this.y0)*(1/this.a);e=(e-this.Zb)/this.Qn,t=t/this.Qn;var n,i;if(Math.abs(t)<=2.623395162778){var s=dv(this.utg,2*e,2*t);e=e+s[0],t=t+s[1],t=Math.atan(fv(t));var o=Math.sin(e),a=Math.cos(e),u=Math.sin(t),l=Math.cos(t);e=Math.atan2(o*l,Br(u,l*a)),t=Math.atan2(u,l*a),n=nt(t+this.long0),i=pf(this.cgb,e)}else n=1/0,i=1/0;return r.x=n,r.y=i,r}var lw=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const bh={init:ow,forward:aw,inverse:uw,names:lw};function hw(r,t){if(r===void 0){if(r=Math.floor((nt(t)+Math.PI)*30/Math.PI)+1,r<0)return 0;if(r>60)return 60}return r}var cw="etmerc";function fw(){var r=hw(this.zone,this.long0);if(r===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(r)-183)*ae,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,bh.init.apply(this),this.forward=bh.forward,this.inverse=bh.inverse}var dw=["Universal Transverse Mercator System","utm"];const gw={init:fw,names:dw,dependsOn:cw};function vf(r,t){return Math.pow((1-r)/(1+r),t)}var pw=20;function vw(){var r=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*r*r),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(r/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+$t)/(Math.pow(Math.tan(.5*this.lat0+$t),this.C)*vf(this.e*r,this.ratexp))}function mw(r){var t=r.x,e=r.y;return r.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+$t),this.C)*vf(this.e*Math.sin(e),this.ratexp))-Y,r.x=this.C*t,r}function yw(r){for(var t=1e-14,e=r.x/this.C,n=r.y,i=Math.pow(Math.tan(.5*n+$t)/this.K,1/this.C),s=pw;s>0&&(n=2*Math.atan(i*vf(this.e*Math.sin(r.y),-.5*this.e))-Y,!(Math.abs(n-r.y)<t));--s)r.y=n;return s?(r.x=e,r.y=n,r):null}const mf={init:vw,forward:mw,inverse:yw};function _w(){mf.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function Ew(r){var t,e,n,i;return r.x=nt(r.x-this.long0),mf.forward.apply(this,[r]),t=Math.sin(r.y),e=Math.cos(r.y),n=Math.cos(r.x),i=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*e*n),r.x=i*e*Math.sin(r.x),r.y=i*(this.cosc0*t-this.sinc0*e*n),r.x=this.a*r.x+this.x0,r.y=this.a*r.y+this.y0,r}function ww(r){var t,e,n,i,s;if(r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,r.x/=this.k0,r.y/=this.k0,s=Br(r.x,r.y)){var o=2*Math.atan2(s,this.R2);t=Math.sin(o),e=Math.cos(o),i=Math.asin(e*this.sinc0+r.y*t*this.cosc0/s),n=Math.atan2(r.x*t,s*this.cosc0*e-r.y*this.sinc0*t)}else i=this.phic0,n=0;return r.x=n,r.y=i,mf.inverse.apply(this,[r]),r.x=nt(r.x+this.long0),r}var Sw=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const Cw={init:_w,forward:Ew,inverse:ww,names:Sw};function Pw(r,t,e){return t*=e,Math.tan(.5*(Y+r))*Math.pow((1-t)/(1+t),.5*e)}function Iw(){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?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=j&&(this.k0=.5*(1+Ku(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=j&&(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)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=j&&Math.abs(Math.cos(this.lat_ts))>j&&(this.k0=.5*this.cons*Ri(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/hi(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Ri(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Y,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function Mw(r){var t=r.x,e=r.y,n=Math.sin(e),i=Math.cos(e),s,o,a,u,l,h,c=nt(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=j&&Math.abs(e+this.lat0)<=j?(r.x=NaN,r.y=NaN,r):this.sphere?(s=2*this.k0/(1+this.sinlat0*n+this.coslat0*i*Math.cos(c)),r.x=this.a*s*i*Math.sin(c)+this.x0,r.y=this.a*s*(this.coslat0*n-this.sinlat0*i*Math.cos(c))+this.y0,r):(o=2*Math.atan(this.ssfn_(e,n,this.e))-Y,u=Math.cos(o),a=Math.sin(o),Math.abs(this.coslat0)<=j?(l=hi(this.e,e*this.con,this.con*n),h=2*this.a*this.k0*l/this.cons,r.x=this.x0+h*Math.sin(t-this.long0),r.y=this.y0-this.con*h*Math.cos(t-this.long0),r):(Math.abs(this.sinlat0)<j?(s=2*this.a*this.k0/(1+u*Math.cos(c)),r.y=s*a):(s=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*u*Math.cos(c))),r.y=s*(this.cosX0*a-this.sinX0*u*Math.cos(c))+this.y0),r.x=s*u*Math.sin(c)+this.x0,r))}function Nw(r){r.x-=this.x0,r.y-=this.y0;var t,e,n,i,s,o=Math.sqrt(r.x*r.x+r.y*r.y);if(this.sphere){var a=2*Math.atan(o/(2*this.a*this.k0));return t=this.long0,e=this.lat0,o<=j?(r.x=t,r.y=e,r):(e=Math.asin(Math.cos(a)*this.sinlat0+r.y*Math.sin(a)*this.coslat0/o),Math.abs(this.coslat0)<j?this.lat0>0?t=nt(this.long0+Math.atan2(r.x,-1*r.y)):t=nt(this.long0+Math.atan2(r.x,r.y)):t=nt(this.long0+Math.atan2(r.x*Math.sin(a),o*this.coslat0*Math.cos(a)-r.y*this.sinlat0*Math.sin(a))),r.x=t,r.y=e,r)}else if(Math.abs(this.coslat0)<=j){if(o<=j)return e=this.lat0,t=this.long0,r.x=t,r.y=e,r;r.x*=this.con,r.y*=this.con,n=o*this.cons/(2*this.a*this.k0),e=this.con*Zu(this.e,n),t=this.con*nt(this.con*this.long0+Math.atan2(r.x,-1*r.y))}else i=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=j?s=this.X0:(s=Math.asin(Math.cos(i)*this.sinX0+r.y*Math.sin(i)*this.cosX0/o),t=nt(this.long0+Math.atan2(r.x*Math.sin(i),o*this.cosX0*Math.cos(i)-r.y*this.sinX0*Math.sin(i)))),e=-1*Zu(this.e,Math.tan(.5*(Y+s)));return r.x=t,r.y=e,r}var bw=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const Tw={init:Iw,forward:Mw,inverse:Nw,names:bw,ssfn_:Pw};function xw(){var r=this.lat0;this.lambda0=this.long0;var t=Math.sin(r),e=this.a,n=this.rf,i=1/n,s=2*i-Math.pow(i,2),o=this.e=Math.sqrt(s);this.R=this.k0*e*Math.sqrt(1-s)/(1-s*Math.pow(t,2)),this.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(r),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),u=Math.log(Math.tan(Math.PI/4+r/2)),l=Math.log((1+o*t)/(1-o*t));this.K=a-this.alpha*u+this.alpha*o/2*l}function Ow(r){var t=Math.log(Math.tan(Math.PI/4-r.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(r.y))/(1-this.e*Math.sin(r.y))),n=-this.alpha*(t+e)+this.K,i=2*(Math.atan(Math.exp(n))-Math.PI/4),s=this.alpha*(r.x-this.lambda0),o=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(s));return r.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,r.x=this.R*o+this.x0,r}function Aw(r){for(var t=r.x-this.x0,e=r.y-this.y0,n=t/this.R,i=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(n)),o=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(i))),a=this.lambda0+o/this.alpha,u=0,l=s,h=-1e3,c=0;Math.abs(l-h)>1e-7;){if(++c>20)return;u=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),h=l,l=2*Math.atan(Math.exp(u))-Math.PI/2}return r.x=a,r.y=l,r}var Dw=["somerc"];const Lw={init:xw,forward:Ow,inverse:Aw,names:Dw};var Oa=1e-7;function Rw(r){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],e=typeof r.projName=="object"?Object.keys(r.projName)[0]:r.projName;return"no_uoff"in r||"no_off"in r||t.indexOf(e)!==-1||t.indexOf(W0(e))!==-1}function Fw(){var r,t,e,n,i,s,o,a,u,l,h=0,c,f=0,p=0,v=0,_=0,w=0,I=0;this.no_off=Rw(this),this.no_rot="no_rot"in this;var y=!1;"alpha"in this&&(y=!0);var E=!1;if("rectified_grid_angle"in this&&(E=!0),y&&(I=this.alpha),E&&(h=this.rectified_grid_angle),y||E)f=this.longc;else if(p=this.long1,_=this.lat1,v=this.long2,w=this.lat2,Math.abs(_-w)<=Oa||(r=Math.abs(_))<=Oa||Math.abs(r-Y)<=Oa||Math.abs(Math.abs(this.lat0)-Y)<=Oa||Math.abs(Math.abs(w)-Y)<=Oa)throw new Error;var m=1-this.es;t=Math.sqrt(m),Math.abs(this.lat0)>j?(a=Math.sin(this.lat0),e=Math.cos(this.lat0),r=1-this.es*a*a,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/m),this.A=this.B*this.k0*t/r,n=this.B*t/(e*Math.sqrt(r)),i=n*n-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=n,this.E*=Math.pow(hi(this.e,this.lat0,a),this.B)):(this.B=1/t,this.A=this.k0,this.E=n=i=1),y||E?(y?(c=Math.asin(Math.sin(I)/n),E||(h=I)):(c=h,I=Math.asin(n*Math.sin(c))),this.lam0=f-Math.asin(.5*(i-1/i)*Math.tan(c))/this.B):(s=Math.pow(hi(this.e,_,Math.sin(_)),this.B),o=Math.pow(hi(this.e,w,Math.sin(w)),this.B),i=this.E/s,u=(o-s)/(o+s),l=this.E*this.E,l=(l-o*s)/(l+o*s),r=p-v,r<-Math.pi?v-=Bu:r>Math.pi&&(v+=Bu),this.lam0=nt(.5*(p+v)-Math.atan(l*Math.tan(.5*this.B*(p-v))/u)/this.B),c=Math.atan(2*Math.sin(this.B*nt(p-this.lam0))/(i-1/i)),h=I=Math.asin(n*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(h),this.cosrot=Math.cos(h),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(n*n-1)/Math.cos(I))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan($t-i)),this.v_pole_s=this.ArB*Math.log(Math.tan($t+i))}function Gw(r){var t={},e,n,i,s,o,a,u,l;if(r.x=r.x-this.lam0,Math.abs(Math.abs(r.y)-Y)>j){if(o=this.E/Math.pow(hi(this.e,r.y,Math.sin(r.y)),this.B),a=1/o,e=.5*(o-a),n=.5*(o+a),s=Math.sin(this.B*r.x),i=(e*this.singam-s*this.cosgam)/n,Math.abs(Math.abs(i)-1)<j)throw new Error;l=.5*this.ArB*Math.log((1-i)/(1+i)),a=Math.cos(this.B*r.x),Math.abs(a)<Oa?u=this.A*r.x:u=this.ArB*Math.atan2(e*this.cosgam+s*this.singam,a)}else l=r.y>0?this.v_pole_n:this.v_pole_s,u=this.ArB*r.y;return this.no_rot?(t.x=u,t.y=l):(u-=this.u_0,t.x=l*this.cosrot+u*this.sinrot,t.y=u*this.cosrot-l*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function kw(r){var t,e,n,i,s,o,a,u={};if(r.x=(r.x-this.x0)*(1/this.a),r.y=(r.y-this.y0)*(1/this.a),this.no_rot?(e=r.y,t=r.x):(e=r.x*this.cosrot-r.y*this.sinrot,t=r.y*this.cosrot+r.x*this.sinrot+this.u_0),n=Math.exp(-this.BrA*e),i=.5*(n-1/n),s=.5*(n+1/n),o=Math.sin(this.BrA*t),a=(o*this.cosgam+i*this.singam)/s,Math.abs(Math.abs(a)-1)<j)u.x=0,u.y=a<0?-Y:Y;else{if(u.y=this.E/Math.sqrt((1+a)/(1-a)),u.y=Zu(this.e,Math.pow(u.y,1/this.B)),u.y===1/0)throw new Error;u.x=-this.rB*Math.atan2(i*this.cosgam-o*this.singam,Math.cos(this.BrA*t))}return u.x+=this.lam0,u}var Vw=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const Uw={init:Fw,forward:Gw,inverse:kw,names:Vw};function zw(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<j)){var r=this.b/this.a;this.e=Math.sqrt(1-r*r);var t=Math.sin(this.lat1),e=Math.cos(this.lat1),n=Ri(this.e,t,e),i=hi(this.e,this.lat1,t),s=Math.sin(this.lat2),o=Math.cos(this.lat2),a=Ri(this.e,s,o),u=hi(this.e,this.lat2,s),l=Math.abs(Math.abs(this.lat0)-Y)<j?0:hi(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>j?this.ns=Math.log(n/a)/Math.log(i/u):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=n/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function qw(r){var t=r.x,e=r.y;Math.abs(2*Math.abs(e)-Math.PI)<=j&&(e=Ku(e)*(Y-2*j));var n=Math.abs(Math.abs(e)-Y),i,s;if(n>j)i=hi(this.e,e,Math.sin(e)),s=this.a*this.f0*Math.pow(i,this.ns);else{if(n=e*this.ns,n<=0)return null;s=0}var o=this.ns*nt(t-this.long0);return r.x=this.k0*(s*Math.sin(o))+this.x0,r.y=this.k0*(this.rh-s*Math.cos(o))+this.y0,r}function Ww(r){var t,e,n,i,s,o=(r.x-this.x0)/this.k0,a=this.rh-(r.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+a*a),e=1):(t=-Math.sqrt(o*o+a*a),e=-1);var u=0;if(t!==0&&(u=Math.atan2(e*o,e*a)),t!==0||this.ns>0){if(e=1/this.ns,n=Math.pow(t/(this.a*this.f0),e),i=Zu(this.e,n),i===-9999)return null}else i=-Y;return s=nt(u/this.ns+this.long0),r.x=s,r.y=i,r}var Xw=["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)"];const Hw={init:zw,forward:qw,inverse:Ww,names:Xw};function Yw(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.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}function Jw(r){var t,e,n,i,s,o,a,u=r.x,l=r.y,h=nt(u-this.long0);return t=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/t)-this.s45),n=-h*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(n)),s=Math.asin(Math.cos(e)*Math.sin(n)/Math.cos(i)),o=this.n*s,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),r.y=a*Math.cos(o)/1,r.x=a*Math.sin(o)/1,this.czech||(r.y*=-1,r.x*=-1),r}function Bw(r){var t,e,n,i,s,o,a,u,l=r.x;r.x=r.y,r.y=l,this.czech||(r.y*=-1,r.x*=-1),o=Math.sqrt(r.x*r.x+r.y*r.y),s=Math.atan2(r.y,r.x),i=s/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),e=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(t)),r.x=this.long0-e/this.alfa,a=t,u=0;var h=0;do r.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-r.y)<1e-10&&(u=1),a=r.y,h+=1;while(u===0&&h<15);return h>=15?null:r}var Qw=["Krovak","krovak"];const Kw={init:Yw,forward:Jw,inverse:Bw,names:Qw};function Rr(r,t,e,n,i){return r*i-t*Math.sin(2*i)+e*Math.sin(4*i)-n*Math.sin(6*i)}function tl(r){return 1-.25*r*(1+r/16*(3+1.25*r))}function el(r){return .375*r*(1+.25*r*(1+.46875*r))}function rl(r){return .05859375*r*r*(1+.75*r)}function nl(r){return r*r*r*.011393229166666666}function yf(r,t,e){var n=t*e;return r/Math.sqrt(1-n*n)}function zs(r){return Math.abs(r)<Y?r:r-Ku(r)*Math.PI}function Th(r,t,e,n,i){var s,o;s=r/t;for(var a=0;a<15;a++)if(o=(r-(t*s-e*Math.sin(2*s)+n*Math.sin(4*s)-i*Math.sin(6*s)))/(t-2*e*Math.cos(2*s)+4*n*Math.cos(4*s)-6*i*Math.cos(6*s)),s+=o,Math.abs(o)<=1e-10)return s;return NaN}function Zw(){this.sphere||(this.e0=tl(this.es),this.e1=el(this.es),this.e2=rl(this.es),this.e3=nl(this.es),this.ml0=this.a*Rr(this.e0,this.e1,this.e2,this.e3,this.lat0))}function $w(r){var t,e,n=r.x,i=r.y;if(n=nt(n-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(i)*Math.sin(n)),e=this.a*(Math.atan2(Math.tan(i),Math.cos(n))-this.lat0);else{var s=Math.sin(i),o=Math.cos(i),a=yf(this.a,this.e,s),u=Math.tan(i)*Math.tan(i),l=n*Math.cos(i),h=l*l,c=this.es*o*o/(1-this.es),f=this.a*Rr(this.e0,this.e1,this.e2,this.e3,i);t=a*l*(1-h*u*(.16666666666666666-(8-u+8*c)*h/120)),e=f-this.ml0+a*s/o*h*(.5+(5-u+6*c)*h/24)}return r.x=t+this.x0,r.y=e+this.y0,r}function jw(r){r.x-=this.x0,r.y-=this.y0;var t=r.x/this.a,e=r.y/this.a,n,i;if(this.sphere){var s=e+this.lat0;n=Math.asin(Math.sin(s)*Math.cos(t)),i=Math.atan2(Math.tan(t),Math.cos(s))}else{var o=this.ml0/this.a+e,a=Th(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-Y)<=j)return r.x=this.long0,r.y=Y,e<0&&(r.y*=-1),r;var u=yf(this.a,this.e,Math.sin(a)),l=u*u*u/this.a/this.a*(1-this.es),h=Math.pow(Math.tan(a),2),c=t*this.a/u,f=c*c;n=a-u*Math.tan(a)/l*c*c*(.5-(1+3*h)*c*c/24),i=c*(1-f*(h/3+(1+3*h)*h*f/15))/Math.cos(a)}return r.x=nt(i+this.long0),r.y=zs(n),r}var tS=["Cassini","Cassini_Soldner","cass"];const eS={init:Zw,forward:$w,inverse:jw,names:tS};function qs(r,t){var e;return r>1e-7?(e=r*t,(1-r*r)*(t/(1-e*e)-.5/r*Math.log((1-e)/(1+e)))):2*t}var rS=1,nS=2,iS=3,sS=4;function oS(){var r=Math.abs(this.lat0);if(Math.abs(r-Y)<j?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(r)<j?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var t;switch(this.qp=qs(this.e,1),this.mmf=.5/(1-this.es),this.apa=pS(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=qs(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function aS(r){var t,e,n,i,s,o,a,u,l,h,c=r.x,f=r.y;if(c=nt(c-this.long0),this.sphere){if(s=Math.sin(f),h=Math.cos(f),n=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e=this.mode===this.EQUIT?1+h*n:1+this.sinph0*s+this.cosph0*h*n,e<=j)return null;e=Math.sqrt(2/e),t=e*h*Math.sin(c),e*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*h*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(f+this.lat0)<j)return null;e=$t-f*.5,e=2*(this.mode===this.S_POLE?Math.cos(e):Math.sin(e)),t=e*Math.sin(c),e*=n}}else{switch(a=0,u=0,l=0,n=Math.cos(c),i=Math.sin(c),s=Math.sin(f),o=qs(this.e,s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(a=o/this.qp,u=Math.sqrt(1-a*a)),this.mode){case this.OBLIQ:l=1+this.sinb1*a+this.cosb1*u*n;break;case this.EQUIT:l=1+u*n;break;case this.N_POLE:l=Y+f,o=this.qp-o;break;case this.S_POLE:l=f-Y,o=this.qp+o;break}if(Math.abs(l)<j)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),this.mode===this.OBLIQ?e=this.ymf*l*(this.cosb1*a-this.sinb1*u*n):e=(l=Math.sqrt(2/(1+u*n)))*a*this.ymf,t=this.xmf*l*u*i;break;case this.N_POLE:case this.S_POLE:o>=0?(t=(l=Math.sqrt(o))*i,e=n*(this.mode===this.S_POLE?l:-l)):t=e=0;break}}return r.x=this.a*t+this.x0,r.y=this.a*e+this.y0,r}function uS(r){r.x-=this.x0,r.y-=this.y0;var t=r.x/this.a,e=r.y/this.a,n,i,s,o,a,u,l;if(this.sphere){var h=0,c,f=0;if(c=Math.sqrt(t*t+e*e),i=c*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(f=Math.sin(i),h=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(c)<=j?0:Math.asin(e*f/c),t*=f,e=h*c;break;case this.OBLIQ:i=Math.abs(c)<=j?this.lat0:Math.asin(h*this.sinph0+e*f*this.cosph0/c),t*=f*this.cosph0,e=(h-Math.sin(i)*this.sinph0)*c;break;case this.N_POLE:e=-e,i=Y-i;break;case this.S_POLE:i-=Y;break}n=e===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,e)}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,e*=this.dd,u=Math.sqrt(t*t+e*e),u<j)return r.x=this.long0,r.y=this.lat0,r;o=2*Math.asin(.5*u/this.rq),s=Math.cos(o),t*=o=Math.sin(o),this.mode===this.OBLIQ?(l=s*this.sinb1+e*o*this.cosb1/u,a=this.qp*l,e=u*this.cosb1*s-e*this.sinb1*o):(l=e*o/u,a=this.qp*l,e=u*s)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(e=-e),a=t*t+e*e,!a)return r.x=this.long0,r.y=this.lat0,r;l=1-a/this.qp,this.mode===this.S_POLE&&(l=-l)}n=Math.atan2(t,e),i=vS(Math.asin(l),this.apa)}return r.x=nt(this.long0+n),r.y=i,r}var lS=.3333333333333333,hS=.17222222222222222,cS=.10257936507936508,fS=.06388888888888888,dS=.0664021164021164,gS=.016415012942191543;function pS(r){var t,e=[];return e[0]=r*lS,t=r*r,e[0]+=t*hS,e[1]=t*fS,t*=r,e[0]+=t*cS,e[1]+=t*dS,e[2]=t*gS,e}function vS(r,t){var e=r+r;return r+t[0]*Math.sin(e)+t[1]*Math.sin(e+e)+t[2]*Math.sin(e+e+e)}var mS=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const yS={init:oS,forward:aS,inverse:uS,names:mS,S_POLE:rS,N_POLE:nS,EQUIT:iS,OBLIQ:sS};function Ws(r){return Math.abs(r)>1&&(r=r>1?1:-1),Math.asin(r)}function _S(){Math.abs(this.lat1+this.lat2)<j||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Ri(this.e3,this.sin_po,this.cos_po),this.qs1=qs(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Ri(this.e3,this.sin_po,this.cos_po),this.qs2=qs(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=qs(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>j?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function ES(r){var t=r.x,e=r.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var n=qs(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,s=this.ns0*nt(t-this.long0),o=i*Math.sin(s)+this.x0,a=this.rh-i*Math.cos(s)+this.y0;return r.x=o,r.y=a,r}function wS(r){var t,e,n,i,s,o;return r.x-=this.x0,r.y=this.rh-r.y+this.y0,this.ns0>=0?(t=Math.sqrt(r.x*r.x+r.y*r.y),n=1):(t=-Math.sqrt(r.x*r.x+r.y*r.y),n=-1),i=0,t!==0&&(i=Math.atan2(n*r.x,n*r.y)),n=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-n*n)/(2*this.ns0)):(e=(this.c-n*n)/this.ns0,o=this.phi1z(this.e3,e)),s=nt(i/this.ns0+this.long0),r.x=s,r.y=o,r}function SS(r,t){var e,n,i,s,o,a=Ws(.5*t);if(r<j)return a;for(var u=r*r,l=1;l<=25;l++)if(e=Math.sin(a),n=Math.cos(a),i=r*e,s=1-i*i,o=.5*s*s/n*(t/(1-u)-e/s+.5/r*Math.log((1-i)/(1+i))),a=a+o,Math.abs(o)<=1e-7)return a;return null}var CS=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const PS={init:_S,forward:ES,inverse:wS,names:CS,phi1z:SS};function IS(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function MS(r){var t,e,n,i,s,o,a,u,l=r.x,h=r.y;return n=nt(l-this.long0),t=Math.sin(h),e=Math.cos(h),i=Math.cos(n),o=this.sin_p14*t+this.cos_p14*e*i,s=1,o>0||Math.abs(o)<=j?(a=this.x0+this.a*s*e*Math.sin(n)/o,u=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*i)/o):(a=this.x0+this.infinity_dist*e*Math.sin(n),u=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*e*i)),r.x=a,r.y=u,r}function NS(r){var t,e,n,i,s,o;return r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,r.x/=this.k0,r.y/=this.k0,(t=Math.sqrt(r.x*r.x+r.y*r.y))?(i=Math.atan2(t,this.rc),e=Math.sin(i),n=Math.cos(i),o=Ws(n*this.sin_p14+r.y*e*this.cos_p14/t),s=Math.atan2(r.x*e,t*this.cos_p14*n-r.y*this.sin_p14*e),s=nt(this.long0+s)):(o=this.phic0,s=0),r.x=s,r.y=o,r}var bS=["gnom"];const TS={init:IS,forward:MS,inverse:NS,names:bS};function xS(r,t){var e=1-(1-r*r)/(2*r)*Math.log((1-r)/(1+r));if(Math.abs(Math.abs(t)-e)<1e-6)return t<0?-1*Y:Y;for(var n=Math.asin(.5*t),i,s,o,a,u=0;u<30;u++)if(s=Math.sin(n),o=Math.cos(n),a=r*s,i=Math.pow(1-a*a,2)/(2*o)*(t/(1-r*r)-s/(1-a*a)+.5/r*Math.log((1-a)/(1+a))),n+=i,Math.abs(i)<=1e-10)return n;return NaN}function OS(){this.sphere||(this.k0=Ri(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function AS(r){var t=r.x,e=r.y,n,i,s=nt(t-this.long0);if(this.sphere)n=this.x0+this.a*s*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var o=qs(this.e,Math.sin(e));n=this.x0+this.a*this.k0*s,i=this.y0+this.a*o*.5/this.k0}return r.x=n,r.y=i,r}function DS(r){r.x-=this.x0,r.y-=this.y0;var t,e;return this.sphere?(t=nt(this.long0+r.x/this.a/Math.cos(this.lat_ts)),e=Math.asin(r.y/this.a*Math.cos(this.lat_ts))):(e=xS(this.e,2*r.y*this.k0/this.a),t=nt(this.long0+r.x/(this.a*this.k0))),r.x=t,r.y=e,r}var LS=["cea"];const RS={init:OS,forward:AS,inverse:DS,names:LS};function FS(){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)}function GS(r){var t=r.x,e=r.y,n=nt(t-this.long0),i=zs(e-this.lat0);return r.x=this.x0+this.a*n*this.rc,r.y=this.y0+this.a*i,r}function kS(r){var t=r.x,e=r.y;return r.x=nt(this.long0+(t-this.x0)/(this.a*this.rc)),r.y=zs(this.lat0+(e-this.y0)/this.a),r}var VS=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const US={init:FS,forward:GS,inverse:kS,names:VS};var gv=20;function zS(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=tl(this.es),this.e1=el(this.es),this.e2=rl(this.es),this.e3=nl(this.es),this.ml0=this.a*Rr(this.e0,this.e1,this.e2,this.e3,this.lat0)}function qS(r){var t=r.x,e=r.y,n,i,s,o=nt(t-this.long0);if(s=o*Math.sin(e),this.sphere)Math.abs(e)<=j?(n=this.a*o,i=-1*this.a*this.lat0):(n=this.a*Math.sin(s)/Math.tan(e),i=this.a*(zs(e-this.lat0)+(1-Math.cos(s))/Math.tan(e)));else if(Math.abs(e)<=j)n=this.a*o,i=-1*this.ml0;else{var a=yf(this.a,this.e,Math.sin(e))/Math.tan(e);n=a*Math.sin(s),i=this.a*Rr(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+a*(1-Math.cos(s))}return r.x=n+this.x0,r.y=i+this.y0,r}function WS(r){var t,e,n,i,s,o,a,u,l;if(n=r.x-this.x0,i=r.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=j)t=nt(n/this.a+this.long0),e=0;else{o=this.lat0+i/this.a,a=n*n/this.a/this.a+o*o,u=o;var h;for(s=gv;s;--s)if(h=Math.tan(u),l=-1*(o*(u*h+1)-u-.5*(u*u+a)*h)/((u-o)/h-1),u+=l,Math.abs(l)<=j){e=u;break}t=nt(this.long0+Math.asin(n*Math.tan(u)/this.a)/Math.sin(e))}else if(Math.abs(i+this.ml0)<=j)e=0,t=nt(this.long0+n/this.a);else{o=(this.ml0+i)/this.a,a=n*n/this.a/this.a+o*o,u=o;var c,f,p,v,_;for(s=gv;s;--s)if(_=this.e*Math.sin(u),c=Math.sqrt(1-_*_)*Math.tan(u),f=this.a*Rr(this.e0,this.e1,this.e2,this.e3,u),p=this.e0-2*this.e1*Math.cos(2*u)+4*this.e2*Math.cos(4*u)-6*this.e3*Math.cos(6*u),v=f/this.a,l=(o*(c*v+1)-v-.5*c*(v*v+a))/(this.es*Math.sin(2*u)*(v*v+a-2*o*v)/(4*c)+(o-v)*(c*p-2/Math.sin(2*u))-p),u-=l,Math.abs(l)<=j){e=u;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),t=nt(this.long0+Math.asin(n*c/this.a)/Math.sin(e))}return r.x=t,r.y=e,r}var XS=["Polyconic","American_Polyconic","poly"];const HS={init:zS,forward:qS,inverse:WS,names:XS};function YS(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function JS(r){var t,e=r.x,n=r.y,i=n-this.lat0,s=e-this.long0,o=i/Ju*1e-5,a=s,u=1,l=0;for(t=1;t<=10;t++)u=u*o,l=l+this.A[t]*u;var h=l,c=a,f=1,p=0,v,_,w=0,I=0;for(t=1;t<=6;t++)v=f*h-p*c,_=p*h+f*c,f=v,p=_,w=w+this.B_re[t]*f-this.B_im[t]*p,I=I+this.B_im[t]*f+this.B_re[t]*p;return r.x=I*this.a+this.x0,r.y=w*this.a+this.y0,r}function BS(r){var t,e=r.x,n=r.y,i=e-this.x0,s=n-this.y0,o=s/this.a,a=i/this.a,u=1,l=0,h,c,f=0,p=0;for(t=1;t<=6;t++)h=u*o-l*a,c=l*o+u*a,u=h,l=c,f=f+this.C_re[t]*u-this.C_im[t]*l,p=p+this.C_im[t]*u+this.C_re[t]*l;for(var v=0;v<this.iterations;v++){var _=f,w=p,I,y,E=o,m=a;for(t=2;t<=6;t++)I=_*f-w*p,y=w*f+_*p,_=I,w=y,E=E+(t-1)*(this.B_re[t]*_-this.B_im[t]*w),m=m+(t-1)*(this.B_im[t]*_+this.B_re[t]*w);_=1,w=0;var S=this.B_re[1],C=this.B_im[1];for(t=2;t<=6;t++)I=_*f-w*p,y=w*f+_*p,_=I,w=y,S=S+t*(this.B_re[t]*_-this.B_im[t]*w),C=C+t*(this.B_im[t]*_+this.B_re[t]*w);var P=S*S+C*C;f=(E*S+m*C)/P,p=(m*S-E*C)/P}var N=f,T=p,O=1,b=0;for(t=1;t<=9;t++)O=O*N,b=b+this.D[t]*O;var x=this.lat0+b*Ju*1e5,R=this.long0+T;return r.x=R,r.y=x,r}var QS=["New_Zealand_Map_Grid","nzmg"];const KS={init:YS,forward:JS,inverse:BS,names:QS};function ZS(){}function $S(r){var t=r.x,e=r.y,n=nt(t-this.long0),i=this.x0+this.a*n,s=this.y0+this.a*Math.log(Math.tan(Math.PI/4+e/2.5))*1.25;return r.x=i,r.y=s,r}function jS(r){r.x-=this.x0,r.y-=this.y0;var t=nt(this.long0+r.x/this.a),e=2.5*(Math.atan(Math.exp(.8*r.y/this.a))-Math.PI/4);return r.x=t,r.y=e,r}var tC=["Miller_Cylindrical","mill"];const eC={init:ZS,forward:$S,inverse:jS,names:tC};var rC=20;function nC(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=df(this.es)}function iC(r){var t,e,n=r.x,i=r.y;if(n=nt(n-this.long0),this.sphere){if(!this.m)i=this.n!==1?Math.asin(this.n*Math.sin(i)):i;else for(var s=this.n*Math.sin(i),o=rC;o;--o){var a=(this.m*i+Math.sin(i)-s)/(this.m+Math.cos(i));if(i-=a,Math.abs(a)<j)break}t=this.a*this.C_x*n*(this.m+Math.cos(i)),e=this.a*this.C_y*i}else{var u=Math.sin(i),l=Math.cos(i);e=this.a*xa(i,u,l,this.en),t=this.a*n*l/Math.sqrt(1-this.es*u*u)}return r.x=t,r.y=e,r}function sC(r){var t,e,n,i;return r.x-=this.x0,n=r.x/this.a,r.y-=this.y0,t=r.y/this.a,this.sphere?(t/=this.C_y,n=n/(this.C_x*(this.m+Math.cos(t))),this.m?t=Ws((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=Ws(Math.sin(t)/this.n)),n=nt(n+this.long0),t=zs(t)):(t=gf(r.y/this.a,this.es,this.en),i=Math.abs(t),i<Y?(i=Math.sin(t),e=this.long0+r.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(t)),n=nt(e)):i-j<Y&&(n=this.long0)),r.x=n,r.y=t,r}var oC=["Sinusoidal","sinu"];const aC={init:nC,forward:iC,inverse:sC,names:oC};function uC(){}function lC(r){for(var t=r.x,e=r.y,n=nt(t-this.long0),i=e,s=Math.PI*Math.sin(e);;){var o=-(i+Math.sin(i)-s)/(1+Math.cos(i));if(i+=o,Math.abs(o)<j)break}i/=2,Math.PI/2-Math.abs(e)<j&&(n=0);var a=.900316316158*this.a*n*Math.cos(i)+this.x0,u=1.4142135623731*this.a*Math.sin(i)+this.y0;return r.x=a,r.y=u,r}function hC(r){var t,e;r.x-=this.x0,r.y-=this.y0,e=r.y/(1.4142135623731*this.a),Math.abs(e)>.999999999999&&(e=.999999999999),t=Math.asin(e);var n=nt(this.long0+r.x/(.900316316158*this.a*Math.cos(t)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),e=(2*t+Math.sin(2*t))/Math.PI,Math.abs(e)>1&&(e=1);var i=Math.asin(e);return r.x=n,r.y=i,r}var cC=["Mollweide","moll"];const fC={init:uC,forward:lC,inverse:hC,names:cC};function dC(){Math.abs(this.lat1+this.lat2)<j||(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=tl(this.es),this.e1=el(this.es),this.e2=rl(this.es),this.e3=nl(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Ri(this.e,this.sinphi,this.cosphi),this.ml1=Rr(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<j?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Ri(this.e,this.sinphi,this.cosphi),this.ml2=Rr(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=Rr(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function gC(r){var t=r.x,e=r.y,n;if(this.sphere)n=this.a*(this.g-e);else{var i=Rr(this.e0,this.e1,this.e2,this.e3,e);n=this.a*(this.g-i)}var s=this.ns*nt(t-this.long0),o=this.x0+n*Math.sin(s),a=this.y0+this.rh-n*Math.cos(s);return r.x=o,r.y=a,r}function pC(r){r.x-=this.x0,r.y=this.rh-r.y+this.y0;var t,e,n,i;this.ns>=0?(e=Math.sqrt(r.x*r.x+r.y*r.y),t=1):(e=-Math.sqrt(r.x*r.x+r.y*r.y),t=-1);var s=0;if(e!==0&&(s=Math.atan2(t*r.x,t*r.y)),this.sphere)return i=nt(this.long0+s/this.ns),n=zs(this.g-e/this.a),r.x=i,r.y=n,r;var o=this.g-e/this.a;return n=Th(o,this.e0,this.e1,this.e2,this.e3),i=nt(this.long0+s/this.ns),r.x=i,r.y=n,r}var vC=["Equidistant_Conic","eqdc"];const mC={init:dC,forward:gC,inverse:pC,names:vC};function yC(){this.R=this.a}function _C(r){var t=r.x,e=r.y,n=nt(t-this.long0),i,s;Math.abs(e)<=j&&(i=this.x0+this.R*n,s=this.y0);var o=Ws(2*Math.abs(e/Math.PI));(Math.abs(n)<=j||Math.abs(Math.abs(e)-Y)<=j)&&(i=this.x0,e>=0?s=this.y0+Math.PI*this.R*Math.tan(.5*o):s=this.y0+Math.PI*this.R*-Math.tan(.5*o));var a=.5*Math.abs(Math.PI/n-n/Math.PI),u=a*a,l=Math.sin(o),h=Math.cos(o),c=h/(l+h-1),f=c*c,p=c*(2/l-1),v=p*p,_=Math.PI*this.R*(a*(c-v)+Math.sqrt(u*(c-v)*(c-v)-(v+u)*(f-v)))/(v+u);n<0&&(_=-_),i=this.x0+_;var w=u+c;return _=Math.PI*this.R*(p*w-a*Math.sqrt((v+u)*(u+1)-w*w))/(v+u),e>=0?s=this.y0+_:s=this.y0-_,r.x=i,r.y=s,r}function EC(r){var t,e,n,i,s,o,a,u,l,h,c,f,p;return r.x-=this.x0,r.y-=this.y0,c=Math.PI*this.R,n=r.x/c,i=r.y/c,s=n*n+i*i,o=-Math.abs(i)*(1+s),a=o-2*i*i+n*n,u=-2*o+1+2*i*i+s*s,p=i*i/u+(2*a*a*a/u/u/u-9*o*a/u/u)/27,l=(o-a*a/3/u)/u,h=2*Math.sqrt(-l/3),c=3*p/l/h,Math.abs(c)>1&&(c>=0?c=1:c=-1),f=Math.acos(c)/3,r.y>=0?e=(-h*Math.cos(f+Math.PI/3)-a/3/u)*Math.PI:e=-(-h*Math.cos(f+Math.PI/3)-a/3/u)*Math.PI,Math.abs(n)<j?t=this.long0:t=nt(this.long0+Math.PI*(s-1+Math.sqrt(1+2*(n*n-i*i)+s*s))/2/n),r.x=t,r.y=e,r}var wC=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const SC={init:yC,forward:_C,inverse:EC,names:wC};var _f={exports:{}},pv;function CC(){return pv||(pv=1,function(r){(function(t){var e={};e.Constants={},e.Math={},e.Accumulator={},function(n){n.WGS84={a:6378137,f:.0033528106647474805},n.version={major:2,minor:1,patch:1},n.version_string="2.1.1"}(e.Constants),function(n){n.digits=53,n.epsilon=Math.pow(.5,n.digits-1),n.degree=Math.PI/180,n.sq=function(i){return i*i},n.hypot=function(i,s){return Math.sqrt(i*i+s*s)},n.cbrt=Math.cbrt||function(i){var s=Math.pow(Math.abs(i),.3333333333333333);return i>0?s:i<0?-s:i},n.log1p=Math.log1p||function(i){var s=1+i,o=s-1;return o===0?i:i*Math.log(s)/o},n.atanh=Math.atanh||function(i){var s=Math.abs(i);return s=n.log1p(2*s/(1-s))/2,i>0?s:i<0?-s:i},n.copysign=function(i,s){return Math.abs(i)*(s<0||s===0&&1/s<0?-1:1)},n.sum=function(i,s){var o=i+s,a=o-s,u=o-a,l;return a-=i,u-=s,l=o&&0-(a+u),{s:o,t:l}},n.polyval=function(i,s,o,a){for(var u=i<0?0:s[o++];--i>=0;)u=u*a+s[o++];return u},n.AngRound=function(i){var s=.0625,o=Math.abs(i);return o=o<s?s-(s-o):o,n.copysign(o,i)},n.remainder=function(i,s){return i%=s,i<-s/2?i+s:i<s/2?i:i-s},n.AngNormalize=function(i){var s=n.remainder(i,360);return Math.abs(s)===180?n.copysign(180,i):s},n.LatFix=function(i){return Math.abs(i)>90?NaN:i},n.AngDiff=function(i,s){var o=n.sum(n.remainder(-i,360),n.remainder(s,360)),a,u;return o=n.sum(n.remainder(o.s,360),o.t),a=o.s,u=o.t,(a===0||Math.abs(a)===180)&&(a=n.copysign(a,u===0?s-i:-u)),{d:a,e:u}},n.sincosd=function(i){var s,o,a,u,l,h,c;switch(s=i%360,a=Math.round(s/90),s-=90*a,o=s*this.degree,u=Math.sin(o),l=Math.cos(o),Math.abs(s)===45?(l=Math.sqrt(.5),u=n.copysign(l,o)):Math.abs(s)===30&&(l=Math.sqrt(.75),u=n.copysign(.5,o)),a&3){case 0:h=u,c=l;break;case 1:h=l,c=-u;break;case 2:h=-u,c=-l;break;default:h=-l,c=u;break}return c+=0,h===0&&(h=n.copysign(h,i)),{s:h,c}},n.sincosde=function(i,s){var o,a,u,l,h,c,f;switch(o=i%360,u=Math.round(o/90),o=n.AngRound(o-90*u+s),a=o*this.degree,l=Math.sin(a),h=Math.cos(a),Math.abs(o)===45?(h=Math.sqrt(.5),l=n.copysign(h,a)):Math.abs(o)===30&&(h=Math.sqrt(.75),l=n.copysign(.5,a)),u&3){case 0:c=l,f=h;break;case 1:c=h,f=-l;break;case 2:c=-l,f=-h;break;default:c=-h,f=l;break}return f+=0,c===0&&(c=n.copysign(c,i+s)),{s:c,c:f}},n.atan2d=function(i,s){var o=0,a;switch(Math.abs(i)>Math.abs(s)&&([i,s]=[s,i],o=2),n.copysign(1,s)<0&&(s=-s,++o),a=Math.atan2(i,s)/this.degree,o){case 1:a=n.copysign(180,i)-a;break;case 2:a=90-a;break;case 3:a=-90+a;break}return a}}(e.Math),function(n,i){n.Accumulator=function(s){this.Set(s)},n.Accumulator.prototype.Set=function(s){s||(s=0),s.constructor===n.Accumulator?(this._s=s._s,this._t=s._t):(this._s=s,this._t=0)},n.Accumulator.prototype.Add=function(s){var o=i.sum(s,this._t),a=i.sum(o.s,this._s);o=o.t,this._s=a.s,this._t=a.t,this._s===0?this._s=o:this._t+=o},n.Accumulator.prototype.Sum=function(s){var o;return s?(o=new n.Accumulator(this),o.Add(s),o._s):this._s},n.Accumulator.prototype.Negate=function(){this._s*=-1,this._t*=-1},n.Accumulator.prototype.Remainder=function(s){this._s=i.remainder(this._s,s),this.Add(0)}}(e.Accumulator,e.Math),e.Geodesic={},e.GeodesicLine={},e.PolygonArea={},function(n,i,s,o,a){var u=6,l=u,h=u,c=u,f=c,p,v,_=20,w=_+o.digits+10,I=o.epsilon,y=200*I,E=Math.sqrt(I),m=I,S=1e3*E,C=0,P=31,N=32640,T,O,b,x,R,V,Z,J,it;n.tiny_=Math.sqrt(Number.MIN_VALUE/Number.EPSILON),n.nC1_=u,n.nC1p_=u,n.nC2_=u,n.nC3_=u,n.nC4_=u,p=n.nC3_*(n.nC3_-1)/2,v=n.nC4_*(n.nC4_+1)/2,n.CAP_C1=1,n.CAP_C1p=2,n.CAP_C2=4,n.CAP_C3=8,n.CAP_C4=16,n.NONE=0,n.ARC=64,n.LATITUDE=128|C,n.LONGITUDE=256|n.CAP_C3,n.AZIMUTH=512|C,n.DISTANCE=1024|n.CAP_C1,n.STANDARD=n.LATITUDE|n.LONGITUDE|n.AZIMUTH|n.DISTANCE,n.DISTANCE_IN=2048|n.CAP_C1|n.CAP_C1p,n.REDUCEDLENGTH=4096|n.CAP_C1|n.CAP_C2,n.GEODESICSCALE=8192|n.CAP_C1|n.CAP_C2,n.AREA=16384|n.CAP_C4,n.ALL=N|P,n.LONG_UNROLL=32768,n.OUT_MASK=N|n.LONG_UNROLL,n.SinCosSeries=function(G,W,k,U){var A=U.length,q=A-(G?1:0),X=2*(k-W)*(k+W),tt=q&1?U[--A]:0,at=0;for(q=Math.floor(q/2);q--;)at=X*tt-at+U[--A],tt=X*at-tt+U[--A];return G?2*W*k*tt:k*(tt-at)},T=function(G,W){var k,U=o.sq(G),A=o.sq(W),q=(U+A-1)/6,X,tt,at,et,mt,rt,wt,Ct,Q,yt,It;return A===0&&q<=0?k=0:(X=U*A/4,tt=o.sq(q),at=q*tt,et=X*(X+2*at),mt=q,et>=0?(rt=X+at,rt+=rt<0?-Math.sqrt(et):Math.sqrt(et),wt=o.cbrt(rt),mt+=wt+(wt!==0?tt/wt:0)):(Ct=Math.atan2(Math.sqrt(-et),-(X+at)),mt+=2*q*Math.cos(Ct/3)),Q=Math.sqrt(o.sq(mt)+A),yt=mt<0?A/(Q-mt):mt+Q,It=(yt-A)/(2*Q),k=yt/(Math.sqrt(yt+o.sq(It))+It)),k},O=[1,4,64,0,256],n.A1m1f=function(G){var W=Math.floor(l/2),k=o.polyval(W,O,0,o.sq(G))/O[W+1];return(k+G)/(1-G)},b=[-1,6,-16,32,-9,64,-128,2048,9,-16,768,3,-5,512,-7,1280,-7,2048],n.C1f=function(G,W){var k=o.sq(G),U=G,A=0,q,X;for(q=1;q<=n.nC1_;++q)X=Math.floor((n.nC1_-q)/2),W[q]=U*o.polyval(X,b,A,k)/b[A+X+1],A+=X+2,U*=G},x=[205,-432,768,1536,4005,-4736,3840,12288,-225,116,384,-7173,2695,7680,3467,7680,38081,61440],n.C1pf=function(G,W){var k=o.sq(G),U=G,A=0,q,X;for(q=1;q<=n.nC1p_;++q)X=Math.floor((n.nC1p_-q)/2),W[q]=U*o.polyval(X,x,A,k)/x[A+X+1],A+=X+2,U*=G},R=[-11,-28,-192,0,256],n.A2m1f=function(G){var W=Math.floor(h/2),k=o.polyval(W,R,0,o.sq(G))/R[W+1];return(k-G)/(1+G)},V=[1,2,16,32,35,64,384,2048,15,80,768,7,35,512,63,1280,77,2048],n.C2f=function(G,W){var k=o.sq(G),U=G,A=0,q,X;for(q=1;q<=n.nC2_;++q)X=Math.floor((n.nC2_-q)/2),W[q]=U*o.polyval(X,V,A,k)/V[A+X+1],A+=X+2,U*=G},n.Geodesic=function(G,W){if(this.a=G,this.f=W,this._f1=1-this.f,this._e2=this.f*(2-this.f),this._ep2=this._e2/o.sq(this._f1),this._n=this.f/(2-this.f),this._b=this.a*this._f1,this._c2=(o.sq(this.a)+o.sq(this._b)*(this._e2===0?1:(this._e2>0?o.atanh(Math.sqrt(this._e2)):Math.atan(Math.sqrt(-this._e2)))/Math.sqrt(Math.abs(this._e2))))/2,this._etol2=.1*E/Math.sqrt(Math.max(.001,Math.abs(this.f))*Math.min(1,1-this.f/2)/2),!(isFinite(this.a)&&this.a>0))throw new Error("Equatorial radius is not positive");if(!(isFinite(this._b)&&this._b>0))throw new Error("Polar semi-axis is not positive");this._A3x=new Array(f),this._C3x=new Array(p),this._C4x=new Array(v),this.A3coeff(),this.C3coeff(),this.C4coeff()},Z=[-3,128,-2,-3,64,-1,-3,-1,16,3,-1,-2,8,1,-1,2,1,1],n.Geodesic.prototype.A3coeff=function(){var G=0,W=0,k,U;for(k=c-1;k>=0;--k)U=Math.min(c-k-1,k),this._A3x[W++]=o.polyval(U,Z,G,this._n)/Z[G+U+1],G+=U+2},J=[3,128,2,5,128,-1,3,3,64,-1,0,1,8,-1,1,4,5,256,1,3,128,-3,-2,3,64,1,-3,2,32,7,512,-10,9,384,5,-9,5,192,7,512,-14,7,512,21,2560],n.Geodesic.prototype.C3coeff=function(){var G=0,W=0,k,U,A;for(k=1;k<n.nC3_;++k)for(U=n.nC3_-1;U>=k;--U)A=Math.min(n.nC3_-U-1,U),this._C3x[W++]=o.polyval(A,J,G,this._n)/J[G+A+1],G+=A+2},it=[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],n.Geodesic.prototype.C4coeff=function(){var G=0,W=0,k,U,A;for(k=0;k<n.nC4_;++k)for(U=n.nC4_-1;U>=k;--U)A=n.nC4_-U-1,this._C4x[W++]=o.polyval(A,it,G,this._n)/it[G+A+1],G+=A+2},n.Geodesic.prototype.A3f=function(G){return o.polyval(f-1,this._A3x,0,G)},n.Geodesic.prototype.C3f=function(G,W){var k=1,U=0,A,q;for(A=1;A<n.nC3_;++A)q=n.nC3_-A-1,k*=G,W[A]=k*o.polyval(q,this._C3x,U,G),U+=q+1},n.Geodesic.prototype.C4f=function(G,W){var k=1,U=0,A,q;for(A=0;A<n.nC4_;++A)q=n.nC4_-A-1,W[A]=k*o.polyval(q,this._C4x,U,G),U+=q+1,k*=G},n.Geodesic.prototype.Lengths=function(G,W,k,U,A,q,X,tt,at,et,mt,rt,wt){mt&=n.OUT_MASK;var Ct={},Q=0,yt=0,It=0,At=0,qt,Wt,Bt,he,ke;if(mt&(n.DISTANCE|n.REDUCEDLENGTH|n.GEODESICSCALE)&&(It=n.A1m1f(G),n.C1f(G,rt),mt&(n.REDUCEDLENGTH|n.GEODESICSCALE)&&(At=n.A2m1f(G),n.C2f(G,wt),Q=It-At,At=1+At),It=1+It),mt&n.DISTANCE)qt=n.SinCosSeries(!0,q,X,rt)-n.SinCosSeries(!0,k,U,rt),Ct.s12b=It*(W+qt),mt&(n.REDUCEDLENGTH|n.GEODESICSCALE)&&(Wt=n.SinCosSeries(!0,q,X,wt)-n.SinCosSeries(!0,k,U,wt),yt=Q*W+(It*qt-At*Wt));else if(mt&(n.REDUCEDLENGTH|n.GEODESICSCALE)){for(Bt=1;Bt<=n.nC2_;++Bt)wt[Bt]=It*rt[Bt]-At*wt[Bt];yt=Q*W+(n.SinCosSeries(!0,q,X,wt)-n.SinCosSeries(!0,k,U,wt))}return mt&n.REDUCEDLENGTH&&(Ct.m0=Q,Ct.m12b=tt*(U*q)-A*(k*X)-U*X*yt),mt&n.GEODESICSCALE&&(he=U*X+k*q,ke=this._ep2*(at-et)*(at+et)/(A+tt),Ct.M12=he+(ke*q-X*yt)*k/A,Ct.M21=he-(ke*k-U*yt)*q/tt),Ct},n.Geodesic.prototype.InverseStart=function(G,W,k,U,A,q,X,tt,at,et,mt){var rt={},wt=U*W-A*G,Ct=A*W+U*G,Q,yt,It,At,qt,Wt,Bt,he,ke,Xt,Lt,Ft,pe,Te,Xn,to,Ml,Ji,Qt,Zr,Pr,$r,gn;return rt.sig12=-1,Q=U*W,Q+=A*G,yt=Ct>=0&&wt<.5&&A*X<.5,yt?(At=o.sq(G+U),At/=At+o.sq(W+A),rt.dnm=Math.sqrt(1+this._ep2*At),It=X/(this._f1*rt.dnm),qt=Math.sin(It),Wt=Math.cos(It)):(qt=tt,Wt=at),rt.salp1=A*qt,rt.calp1=Wt>=0?wt+A*G*o.sq(qt)/(1+Wt):Q-A*G*o.sq(qt)/(1-Wt),he=o.hypot(rt.salp1,rt.calp1),ke=G*U+W*A*Wt,yt&&he<this._etol2?(rt.salp2=W*qt,rt.calp2=wt-W*U*(Wt>=0?o.sq(qt)/(1+Wt):1-Wt),Bt=o.hypot(rt.salp2,rt.calp2),rt.salp2/=Bt,rt.calp2/=Bt,rt.sig12=Math.atan2(he,ke)):Math.abs(this._n)>.1||ke>=0||he>=6*Math.abs(this._n)*Math.PI*o.sq(W)||(gn=Math.atan2(-tt,-at),this.f>=0?(Te=o.sq(G)*this._ep2,Xn=Te/(2*(1+Math.sqrt(1+Te))+Te),Ft=this.f*W*this.A3f(Xn)*Math.PI,pe=Ft*W,Xt=gn/Ft,Lt=Q/pe):(to=A*W-U*G,Ml=Math.atan2(Q,to),Zr=this.Lengths(this._n,Math.PI+Ml,G,-W,k,U,A,q,W,A,n.REDUCEDLENGTH,et,mt),Ji=Zr.m12b,Qt=Zr.m0,Xt=-1+Ji/(W*A*Qt*Math.PI),pe=Xt<-.01?Q/Xt:-this.f*o.sq(W)*Math.PI,Ft=pe/W,Lt=X/Ft),Lt>-y&&Xt>-1-S?this.f>=0?(rt.salp1=Math.min(1,-Xt),rt.calp1=-Math.sqrt(1-o.sq(rt.salp1))):(rt.calp1=Math.max(Xt>-y?0:-1,Xt),rt.salp1=Math.sqrt(1-o.sq(rt.calp1))):(Pr=T(Xt,Lt),$r=Ft*(this.f>=0?-Xt*Pr/(1+Pr):-Lt*(1+Pr)/Pr),qt=Math.sin($r),Wt=-Math.cos($r),rt.salp1=A*qt,rt.calp1=Q-A*G*o.sq(qt)/(1-Wt))),rt.salp1<=0?(rt.salp1=1,rt.calp1=0):(Bt=o.hypot(rt.salp1,rt.calp1),rt.salp1/=Bt,rt.calp1/=Bt),rt},n.Geodesic.prototype.Lambda12=function(G,W,k,U,A,q,X,tt,at,et,mt,rt,wt,Ct){var Q={},yt,It,At,qt,Wt,Bt,he,ke,Xt,Lt,Ft,pe,Te;return G===0&&tt===0&&(tt=-n.tiny_),It=X*W,At=o.hypot(tt,X*G),Q.ssig1=G,qt=It*G,Q.csig1=Wt=tt*W,yt=o.hypot(Q.ssig1,Q.csig1),Q.ssig1/=yt,Q.csig1/=yt,Q.salp2=A!==W?It/A:X,Q.calp2=A!==W||Math.abs(U)!==-G?Math.sqrt(o.sq(tt*W)+(W<-G?(A-W)*(W+A):(G-U)*(G+U)))/A:Math.abs(tt),Q.ssig2=U,Bt=It*U,Q.csig2=he=Q.calp2*A,yt=o.hypot(Q.ssig2,Q.csig2),Q.ssig2/=yt,Q.csig2/=yt,Q.sig12=Math.atan2(Math.max(0,Q.csig1*Q.ssig2-Q.ssig1*Q.csig2),Q.csig1*Q.csig2+Q.ssig1*Q.ssig2),ke=Math.max(0,Wt*Bt-qt*he),Xt=Wt*he+qt*Bt,Ft=Math.atan2(ke*et-Xt*at,Xt*et+ke*at),pe=o.sq(At)*this._ep2,Q.eps=pe/(2*(1+Math.sqrt(1+pe))+pe),this.C3f(Q.eps,Ct),Lt=n.SinCosSeries(!0,Q.ssig2,Q.csig2,Ct)-n.SinCosSeries(!0,Q.ssig1,Q.csig1,Ct),Q.domg12=-this.f*this.A3f(Q.eps)*It*(Q.sig12+Lt),Q.lam12=Ft+Q.domg12,mt&&(Q.calp2===0?Q.dlam12=-2*this._f1*k/G:(Te=this.Lengths(Q.eps,Q.sig12,Q.ssig1,Q.csig1,k,Q.ssig2,Q.csig2,q,W,A,n.REDUCEDLENGTH,rt,wt),Q.dlam12=Te.m12b,Q.dlam12*=this._f1/(Q.calp2*A))),Q},n.Geodesic.prototype.Inverse=function(G,W,k,U,A){var q,X;return A||(A=n.STANDARD),A===n.LONG_UNROLL&&(A|=n.STANDARD),A&=n.OUT_MASK,q=this.InverseInt(G,W,k,U,A),X=q.vals,A&n.AZIMUTH&&(X.azi1=o.atan2d(q.salp1,q.calp1),X.azi2=o.atan2d(q.salp2,q.calp2)),X},n.Geodesic.prototype.InverseInt=function(G,W,k,U,A){var q={},X,tt,at,et,mt,rt,wt,Ct,Q,yt,It,At,qt,Wt,Bt,he,ke,Xt,Lt,Ft,pe,Te,Xn,to,Ml,Ji,Qt,Zr,Pr,$r,gn,Hh,Yh,pu,Ho,Nl,bl,Tl,xl,Jh,Zd,vu,$d,Bh,jd,tg,eg,lm,rg,Qh,ng,Kh,hm,Zh,cm,fm,Ol,$h,Al,ig,sg,jh,tc,og,ag;if(q.lat1=G=o.LatFix(G),q.lat2=k=o.LatFix(k),G=o.AngRound(G),k=o.AngRound(k),X=o.AngDiff(W,U),tt=X.e,X=X.d,A&n.LONG_UNROLL?(q.lon1=W,q.lon2=W+X+tt):(q.lon1=o.AngNormalize(W),q.lon2=o.AngNormalize(U)),at=o.copysign(1,X),X*=at,tt*=at,Bt=X*o.degree,et=o.sincosde(X,tt),he=et.s,ke=et.c,tt=180-X-tt,mt=Math.abs(G)<Math.abs(k)||isNaN(k)?-1:1,mt<0&&(at*=-1,[k,G]=[G,k]),rt=o.copysign(1,-G),G*=rt,k*=rt,et=o.sincosd(G),wt=this._f1*et.s,Ct=et.c,et=o.hypot(wt,Ct),wt/=et,Ct/=et,Ct=Math.max(n.tiny_,Ct),et=o.sincosd(k),Q=this._f1*et.s,yt=et.c,et=o.hypot(Q,yt),Q/=et,yt/=et,yt=Math.max(n.tiny_,yt),Ct<-wt?yt===Ct&&(Q=o.copysign(wt,Q)):Math.abs(Q)===-wt&&(yt=Ct),qt=Math.sqrt(1+this._ep2*o.sq(wt)),Wt=Math.sqrt(1+this._ep2*o.sq(Q)),Xn=new Array(n.nC1_+1),to=new Array(n.nC2_+1),Ml=new Array(n.nC3_),Ji=G===-90||he===0,Ji&&(Lt=ke,Ft=he,pe=1,Te=0,Zr=wt,Pr=Lt*Ct,$r=Q,gn=pe*yt,Xt=Math.atan2(Math.max(0,Pr*$r-Zr*gn),Pr*gn+Zr*$r),Qt=this.Lengths(this._n,Xt,Zr,Pr,qt,$r,gn,Wt,Ct,yt,A|n.DISTANCE|n.REDUCEDLENGTH,Xn,to),It=Qt.s12b,At=Qt.m12b,A&n.GEODESICSCALE&&(q.M12=Qt.M12,q.M21=Qt.M21),Xt<1||At>=0?((Xt<3*n.tiny_||Xt<I&&(It<0||At<0))&&(Xt=At=It=0),At*=this._b,It*=this._b,q.a12=Xt/o.degree):Ji=!1),Ol=2,!Ji&&wt===0&&(this.f<=0||tt>=this.f*180))Lt=pe=0,Ft=Te=1,It=this.a*Bt,Xt=Yh=Bt/this._f1,At=this._b*Math.sin(Xt),A&n.GEODESICSCALE&&(q.M12=q.M21=Math.cos(Xt)),q.a12=X/this._f1;else if(!Ji)if(Qt=this.InverseStart(wt,Ct,qt,Q,yt,Wt,Bt,he,ke,Xn,to),Xt=Qt.sig12,Ft=Qt.salp1,Lt=Qt.calp1,Xt>=0)Te=Qt.salp2,pe=Qt.calp2,pu=Qt.dnm,It=Xt*this._b*pu,At=o.sq(pu)*this._b*Math.sin(Xt/pu),A&n.GEODESICSCALE&&(q.M12=q.M21=Math.cos(Xt/pu)),q.a12=Xt/o.degree,Yh=Bt/(this._f1*pu);else{for(Ho=0,Nl=n.tiny_,bl=1,Tl=n.tiny_,xl=-1,Jh=!1,Zd=!1;Qt=this.Lambda12(wt,Ct,qt,Q,yt,Wt,Ft,Lt,he,ke,Ho<_,Xn,to,Ml),vu=Qt.lam12,Te=Qt.salp2,pe=Qt.calp2,Xt=Qt.sig12,Zr=Qt.ssig1,Pr=Qt.csig1,$r=Qt.ssig2,gn=Qt.csig2,Hh=Qt.eps,Al=Qt.domg12,$d=Qt.dlam12,!(Zd||!(Math.abs(vu)>=(Jh?8:1)*I)||Ho==w);++Ho){if(vu>0&&(Ho<_||Lt/Ft>xl/Tl)?(Tl=Ft,xl=Lt):vu<0&&(Ho<_||Lt/Ft<bl/Nl)&&(Nl=Ft,bl=Lt),Ho<_&&$d>0&&(Bh=-vu/$d,Math.abs(Bh)<Math.PI&&(jd=Math.sin(Bh),tg=Math.cos(Bh),eg=Ft*tg+Lt*jd,eg>0))){Lt=Lt*tg-Ft*jd,Ft=eg,et=o.hypot(Ft,Lt),Ft/=et,Lt/=et,Jh=Math.abs(vu)<=16*I;continue}Ft=(Nl+Tl)/2,Lt=(bl+xl)/2,et=o.hypot(Ft,Lt),Ft/=et,Lt/=et,Jh=!1,Zd=Math.abs(Nl-Ft)+(bl-Lt)<m||Math.abs(Ft-Tl)+(Lt-xl)<m}lm=A|(A&(n.REDUCEDLENGTH|n.GEODESICSCALE)?n.DISTANCE:n.NONE),Qt=this.Lengths(Hh,Xt,Zr,Pr,qt,$r,gn,Wt,Ct,yt,lm,Xn,to),It=Qt.s12b,At=Qt.m12b,A&n.GEODESICSCALE&&(q.M12=Qt.M12,q.M21=Qt.M21),At*=this._b,It*=this._b,q.a12=Xt/o.degree,A&n.AREA&&(og=Math.sin(Al),ag=Math.cos(Al),Ol=he*ag-ke*og,$h=ke*ag+he*og)}return A&n.DISTANCE&&(q.s12=0+It),A&n.REDUCEDLENGTH&&(q.m12=0+At),A&n.AREA&&(rg=Ft*Ct,Qh=o.hypot(Lt,Ft*wt),Qh!==0&&rg!==0?(Zr=wt,Pr=Lt*Ct,$r=Q,gn=pe*yt,Kh=o.sq(Qh)*this._ep2,Hh=Kh/(2*(1+Math.sqrt(1+Kh))+Kh),hm=o.sq(this.a)*Qh*rg*this._e2,et=o.hypot(Zr,Pr),Zr/=et,Pr/=et,et=o.hypot($r,gn),$r/=et,gn/=et,Zh=new Array(n.nC4_),this.C4f(Hh,Zh),cm=n.SinCosSeries(!1,Zr,Pr,Zh),fm=n.SinCosSeries(!1,$r,gn,Zh),q.S12=hm*(fm-cm)):q.S12=0,!Ji&&Ol==2&&(Ol=Math.sin(Yh),$h=Math.cos(Yh)),!Ji&&$h>-.7071&&Q-wt<1.75?(Al=1+$h,ig=1+Ct,sg=1+yt,ng=2*Math.atan2(Ol*(wt*sg+Q*ig),Al*(wt*Q+ig*sg))):(jh=Te*Lt-pe*Ft,tc=pe*Lt+Te*Ft,jh===0&&tc<0&&(jh=n.tiny_*Lt,tc=-1),ng=Math.atan2(jh,tc)),q.S12+=this._c2*ng,q.S12*=mt*at*rt,q.S12+=0),mt<0&&([Te,Ft]=[Ft,Te],[pe,Lt]=[Lt,pe],A&n.GEODESICSCALE&&([q.M21,q.M12]=[q.M12,q.M21])),Ft*=mt*at,Lt*=mt*rt,Te*=mt*at,pe*=mt*rt,{vals:q,salp1:Ft,calp1:Lt,salp2:Te,calp2:pe}},n.Geodesic.prototype.GenDirect=function(G,W,k,U,A,q){var X;return q?q===n.LONG_UNROLL&&(q|=n.STANDARD):q=n.STANDARD,U||(q|=n.DISTANCE_IN),X=new i.GeodesicLine(this,G,W,k,q),X.GenPosition(U,A,q)},n.Geodesic.prototype.Direct=function(G,W,k,U,A){return this.GenDirect(G,W,k,!1,U,A)},n.Geodesic.prototype.ArcDirect=function(G,W,k,U,A){return this.GenDirect(G,W,k,!0,U,A)},n.Geodesic.prototype.Line=function(G,W,k,U){return new i.GeodesicLine(this,G,W,k,U)},n.Geodesic.prototype.DirectLine=function(G,W,k,U,A){return this.GenDirectLine(G,W,k,!1,U,A)},n.Geodesic.prototype.ArcDirectLine=function(G,W,k,U,A){return this.GenDirectLine(G,W,k,!0,U,A)},n.Geodesic.prototype.GenDirectLine=function(G,W,k,U,A,q){var X;return q||(q=n.STANDARD|n.DISTANCE_IN),U||(q|=n.DISTANCE_IN),X=new i.GeodesicLine(this,G,W,k,q),X.GenSetDistance(U,A),X},n.Geodesic.prototype.InverseLine=function(G,W,k,U,A){var q,X,tt;return A||(A=n.STANDARD|n.DISTANCE_IN),q=this.InverseInt(G,W,k,U,n.ARC),tt=o.atan2d(q.salp1,q.calp1),A&(n.OUT_MASK&n.DISTANCE_IN)&&(A|=n.DISTANCE),X=new i.GeodesicLine(this,G,W,tt,A,q.salp1,q.calp1),X.SetArc(q.vals.a12),X},n.Geodesic.prototype.Polygon=function(G){return new s.PolygonArea(this,G)},n.WGS84=new n.Geodesic(a.WGS84.a,a.WGS84.f)}(e.Geodesic,e.GeodesicLine,e.PolygonArea,e.Math,e.Constants),function(n,i,s){i.GeodesicLine=function(o,a,u,l,h,c,f){var p,v,_,w,I,y;h||(h=n.STANDARD|n.DISTANCE_IN),this.a=o.a,this.f=o.f,this._b=o._b,this._c2=o._c2,this._f1=o._f1,this.caps=h|n.LATITUDE|n.AZIMUTH|n.LONG_UNROLL,this.lat1=s.LatFix(a),this.lon1=u,typeof c>"u"||typeof f>"u"?(this.azi1=s.AngNormalize(l),p=s.sincosd(s.AngRound(this.azi1)),this.salp1=p.s,this.calp1=p.c):(this.azi1=l,this.salp1=c,this.calp1=f),p=s.sincosd(s.AngRound(this.lat1)),_=this._f1*p.s,v=p.c,p=s.hypot(_,v),_/=p,v/=p,v=Math.max(n.tiny_,v),this._dn1=Math.sqrt(1+o._ep2*s.sq(_)),this._salp0=this.salp1*v,this._calp0=s.hypot(this.calp1,this.salp1*_),this._ssig1=_,this._somg1=this._salp0*_,this._csig1=this._comg1=_!==0||this.calp1!==0?v*this.calp1:1,p=s.hypot(this._ssig1,this._csig1),this._ssig1/=p,this._csig1/=p,this._k2=s.sq(this._calp0)*o._ep2,w=this._k2/(2*(1+Math.sqrt(1+this._k2))+this._k2),this.caps&n.CAP_C1&&(this._A1m1=n.A1m1f(w),this._C1a=new Array(n.nC1_+1),n.C1f(w,this._C1a),this._B11=n.SinCosSeries(!0,this._ssig1,this._csig1,this._C1a),I=Math.sin(this._B11),y=Math.cos(this._B11),this._stau1=this._ssig1*y+this._csig1*I,this._ctau1=this._csig1*y-this._ssig1*I),this.caps&n.CAP_C1p&&(this._C1pa=new Array(n.nC1p_+1),n.C1pf(w,this._C1pa)),this.caps&n.CAP_C2&&(this._A2m1=n.A2m1f(w),this._C2a=new Array(n.nC2_+1),n.C2f(w,this._C2a),this._B21=n.SinCosSeries(!0,this._ssig1,this._csig1,this._C2a)),this.caps&n.CAP_C3&&(this._C3a=new Array(n.nC3_),o.C3f(w,this._C3a),this._A3c=-this.f*this._salp0*o.A3f(w),this._B31=n.SinCosSeries(!0,this._ssig1,this._csig1,this._C3a)),this.caps&n.CAP_C4&&(this._C4a=new Array(n.nC4_),o.C4f(w,this._C4a),this._A4=s.sq(this.a)*this._calp0*this._salp0*o._e2,this._B41=n.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a)),this.a13=this.s13=NaN},i.GeodesicLine.prototype.GenPosition=function(o,a,u){var l={},h,c,f,p,v,_,w,I,y,E,m,S,C,P,N,T,O,b,x,R,V,Z,J,it,G,W,k,U,A;return u?u===n.LONG_UNROLL&&(u|=n.STANDARD):u=n.STANDARD,u&=this.caps&n.OUT_MASK,l.lat1=this.lat1,l.azi1=this.azi1,l.lon1=u&n.LONG_UNROLL?this.lon1:s.AngNormalize(this.lon1),o?l.a12=a:l.s12=a,o||this.caps&n.DISTANCE_IN&n.OUT_MASK?(p=0,v=0,o?(h=a*s.degree,W=s.sincosd(a),c=W.s,f=W.c):(I=a/(this._b*(1+this._A1m1)),y=Math.sin(I),E=Math.cos(I),p=-n.SinCosSeries(!0,this._stau1*E+this._ctau1*y,this._ctau1*E-this._stau1*y,this._C1pa),h=I-(p-this._B11),c=Math.sin(h),f=Math.cos(h),Math.abs(this.f)>.01&&(_=this._ssig1*f+this._csig1*c,w=this._csig1*f-this._ssig1*c,p=n.SinCosSeries(!0,_,w,this._C1a),m=(1+this._A1m1)*(h+(p-this._B11))-a/this._b,h=h-m/Math.sqrt(1+this._k2*s.sq(_)),c=Math.sin(h),f=Math.cos(h))),_=this._ssig1*f+this._csig1*c,w=this._csig1*f-this._ssig1*c,Z=Math.sqrt(1+this._k2*s.sq(_)),u&(n.DISTANCE|n.REDUCEDLENGTH|n.GEODESICSCALE)&&((o||Math.abs(this.f)>.01)&&(p=n.SinCosSeries(!0,_,w,this._C1a)),v=(1+this._A1m1)*(p-this._B11)),T=this._calp0*_,O=s.hypot(this._salp0,this._calp0*w),O===0&&(O=w=n.tiny_),R=this._salp0,V=this._calp0*w,o&&u&n.DISTANCE&&(l.s12=this._b*((1+this._A1m1)*h+v)),u&n.LONGITUDE&&(b=this._salp0*_,x=w,N=s.copysign(1,this._salp0),S=u&n.LONG_UNROLL?N*(h-(Math.atan2(_,w)-Math.atan2(this._ssig1,this._csig1))+(Math.atan2(N*b,x)-Math.atan2(N*this._somg1,this._comg1))):Math.atan2(b*this._comg1-x*this._somg1,x*this._comg1+b*this._somg1),C=S+this._A3c*(h+(n.SinCosSeries(!0,_,w,this._C3a)-this._B31)),P=C/s.degree,l.lon2=u&n.LONG_UNROLL?this.lon1+P:s.AngNormalize(s.AngNormalize(this.lon1)+s.AngNormalize(P))),u&n.LATITUDE&&(l.lat2=s.atan2d(T,this._f1*O)),u&n.AZIMUTH&&(l.azi2=s.atan2d(R,V)),u&(n.REDUCEDLENGTH|n.GEODESICSCALE)&&(J=n.SinCosSeries(!0,_,w,this._C2a),it=(1+this._A2m1)*(J-this._B21),G=(this._A1m1-this._A2m1)*h+(v-it),u&n.REDUCEDLENGTH&&(l.m12=this._b*(Z*(this._csig1*_)-this._dn1*(this._ssig1*w)-this._csig1*w*G)),u&n.GEODESICSCALE&&(W=this._k2*(_-this._ssig1)*(_+this._ssig1)/(this._dn1+Z),l.M12=f+(W*_-w*G)*this._ssig1/this._dn1,l.M21=f-(W*this._ssig1-this._csig1*G)*_/Z)),u&n.AREA&&(k=n.SinCosSeries(!1,_,w,this._C4a),this._calp0===0||this._salp0===0?(U=R*this.calp1-V*this.salp1,A=V*this.calp1+R*this.salp1):(U=this._calp0*this._salp0*(f<=0?this._csig1*(1-f)+c*this._ssig1:c*(this._csig1*c/(1+f)+this._ssig1)),A=s.sq(this._salp0)+s.sq(this._calp0)*this._csig1*w),l.S12=this._c2*Math.atan2(U,A)+this._A4*(k-this._B41)),o||(l.a12=h/s.degree),l):(l.a12=NaN,l)},i.GeodesicLine.prototype.Position=function(o,a){return this.GenPosition(!1,o,a)},i.GeodesicLine.prototype.ArcPosition=function(o,a){return this.GenPosition(!0,o,a)},i.GeodesicLine.prototype.GenSetDistance=function(o,a){o?this.SetArc(a):this.SetDistance(a)},i.GeodesicLine.prototype.SetDistance=function(o){var a;this.s13=o,a=this.GenPosition(!1,this.s13,n.ARC),this.a13=0+a.a12},i.GeodesicLine.prototype.SetArc=function(o){var a;this.a13=o,a=this.GenPosition(!0,this.a13,n.DISTANCE),this.s13=0+a.s12}}(e.Geodesic,e.GeodesicLine,e.Math),function(n,i,s,o){var a,u,l,h;a=function(c,f){var p=s.AngDiff(c,f).d;return c=s.AngNormalize(c),f=s.AngNormalize(f),p>0&&(c<0&&f>=0||c>0&&f===0)?1:p<0&&c>=0&&f<0?-1:0},u=function(c,f){return c=c%720,f=f%720,(0<=f&&f<360||f<-360?0:1)-(0<=c&&c<360||c<-360?0:1)},l=function(c,f,p,v,_){return c.Remainder(f),p&1&&c.Add((c.Sum()<0?1:-1)*f/2),v||c.Negate(),_?c.Sum()>f/2?c.Add(-f):c.Sum()<=-f/2&&c.Add(+f):c.Sum()>=f?c.Add(-f):c.Sum()<0&&c.Add(+f),0+c.Sum()},h=function(c,f,p,v,_){return c=s.remainder(c,f),p&1&&(c+=(c<0?1:-1)*f/2),v||(c*=-1),_?c>f/2?c-=f:c<=-f/2&&(c+=f):c>=f?c-=f:c<0&&(c+=f),0+c},n.PolygonArea=function(c,f){this._geod=c,this.a=this._geod.a,this.f=this._geod.f,this._area0=4*Math.PI*c._c2,this.polyline=f||!1,this._mask=i.LATITUDE|i.LONGITUDE|i.DISTANCE|(this.polyline?i.NONE:i.AREA|i.LONG_UNROLL),this.polyline||(this._areasum=new o.Accumulator(0)),this._perimetersum=new o.Accumulator(0),this.Clear()},n.PolygonArea.prototype.Clear=function(){this.num=0,this._crossings=0,this.polyline||this._areasum.Set(0),this._perimetersum.Set(0),this._lat0=this._lon0=this.lat=this.lon=NaN},n.PolygonArea.prototype.AddPoint=function(c,f){var p;this.num===0?(this._lat0=this.lat=c,this._lon0=this.lon=f):(p=this._geod.Inverse(this.lat,this.lon,c,f,this._mask),this._perimetersum.Add(p.s12),this.polyline||(this._areasum.Add(p.S12),this._crossings+=a(this.lon,f)),this.lat=c,this.lon=f),++this.num},n.PolygonArea.prototype.AddEdge=function(c,f){var p;this.num&&(p=this._geod.Direct(this.lat,this.lon,c,f,this._mask),this._perimetersum.Add(f),this.polyline||(this._areasum.Add(p.S12),this._crossings+=u(this.lon,p.lon2)),this.lat=p.lat2,this.lon=p.lon2),++this.num},n.PolygonArea.prototype.Compute=function(c,f){var p={number:this.num},v,_;return this.num<2?(p.perimeter=0,this.polyline||(p.area=0),p):this.polyline?(p.perimeter=this._perimetersum.Sum(),p):(v=this._geod.Inverse(this.lat,this.lon,this._lat0,this._lon0,this._mask),p.perimeter=this._perimetersum.Sum(v.s12),_=new o.Accumulator(this._areasum),_.Add(v.S12),p.area=l(_,this._area0,this._crossings+a(this.lon,this._lon0),c,f),p)},n.PolygonArea.prototype.TestPoint=function(c,f,p,v){var _={number:this.num+1},w,I,y,E;if(this.num===0)return _.perimeter=0,this.polyline||(_.area=0),_;for(_.perimeter=this._perimetersum.Sum(),I=this.polyline?0:this._areasum.Sum(),y=this._crossings,E=0;E<(this.polyline?1:2);++E)w=this._geod.Inverse(E===0?this.lat:c,E===0?this.lon:f,E!==0?this._lat0:c,E!==0?this._lon0:f,this._mask),_.perimeter+=w.s12,this.polyline||(I+=w.S12,y+=a(E===0?this.lon:f,E!==0?this._lon0:f));return this.polyline||(_.area=h(I,this._area0,y,p,v)),_},n.PolygonArea.prototype.TestEdge=function(c,f,p,v){var _={number:this.num?this.num+1:0},w,I,y;return this.num===0||(_.perimeter=this._perimetersum.Sum()+f,this.polyline)||(I=this._areasum.Sum(),y=this._crossings,w=this._geod.Direct(this.lat,this.lon,c,f,this._mask),I+=w.S12,y+=u(this.lon,w.lon2),y+=a(w.lon2,this._lon0),w=this._geod.Inverse(w.lat2,w.lon2,this._lat0,this._lon0,this._mask),_.perimeter+=w.s12,I+=w.S12,_.area=h(I,this._area0,y,p,v)),_}}(e.PolygonArea,e.Geodesic,e.Math,e.Accumulator),t(e)})(function(t){r.exports?r.exports=t:window.geodesic=t})}(_f)),_f.exports}var PC=CC();function IC(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.g=new PC.Geodesic.Geodesic(this.a,this.es/(1+Math.sqrt(1-this.es)))}function MC(r){var t=r.x,e=r.y,n=Math.sin(r.y),i=Math.cos(r.y),s=nt(t-this.long0),o,a,u,l,h,c,f,p,v,_,w,I,y,E,m;return this.sphere?Math.abs(this.sin_p12-1)<=j?(r.x=this.x0+this.a*(Y-e)*Math.sin(s),r.y=this.y0-this.a*(Y-e)*Math.cos(s),r):Math.abs(this.sin_p12+1)<=j?(r.x=this.x0+this.a*(Y+e)*Math.sin(s),r.y=this.y0+this.a*(Y+e)*Math.cos(s),r):(v=this.sin_p12*n+this.cos_p12*i*Math.cos(s),f=Math.acos(v),p=f?f/Math.sin(f):1,r.x=this.x0+this.a*p*i*Math.sin(s),r.y=this.y0+this.a*p*(this.cos_p12*n-this.sin_p12*i*Math.cos(s)),r):(o=tl(this.es),a=el(this.es),u=rl(this.es),l=nl(this.es),Math.abs(this.sin_p12-1)<=j?(h=this.a*Rr(o,a,u,l,Y),c=this.a*Rr(o,a,u,l,e),r.x=this.x0+(h-c)*Math.sin(s),r.y=this.y0-(h-c)*Math.cos(s),r):Math.abs(this.sin_p12+1)<=j?(h=this.a*Rr(o,a,u,l,Y),c=this.a*Rr(o,a,u,l,e),r.x=this.x0+(h+c)*Math.sin(s),r.y=this.y0+(h+c)*Math.cos(s),r):Math.abs(t)<j&&Math.abs(e-this.lat0)<j?(r.x=r.y=0,r):(_=this.lat0/ae,w=this.long0/ae,I=e/ae,y=t/ae,E=this.g.Inverse(_,w,I,y,this.g.AZIMUTH),m=E.azi1*ae,r.x=E.s12*Math.sin(m),r.y=E.s12*Math.cos(m),r))}function NC(r){r.x-=this.x0,r.y-=this.y0;var t,e,n,i,s,o,a,u,l,h,c,f,p,v,_,w,I,y;return this.sphere?(t=Math.sqrt(r.x*r.x+r.y*r.y),t>2*Y*this.a?void 0:(e=t/this.a,n=Math.sin(e),i=Math.cos(e),s=this.long0,Math.abs(t)<=j?o=this.lat0:(o=Ws(i*this.sin_p12+r.y*n*this.cos_p12/t),a=Math.abs(this.lat0)-Y,Math.abs(a)<=j?this.lat0>=0?s=nt(this.long0+Math.atan2(r.x,-r.y)):s=nt(this.long0-Math.atan2(-r.x,r.y)):s=nt(this.long0+Math.atan2(r.x*n,t*this.cos_p12*i-r.y*this.sin_p12*n))),r.x=s,r.y=o,r)):(u=tl(this.es),l=el(this.es),h=rl(this.es),c=nl(this.es),Math.abs(this.sin_p12-1)<=j?(f=this.a*Rr(u,l,h,c,Y),t=Math.sqrt(r.x*r.x+r.y*r.y),p=f-t,o=Th(p/this.a,u,l,h,c),s=nt(this.long0+Math.atan2(r.x,-1*r.y)),r.x=s,r.y=o,r):Math.abs(this.sin_p12+1)<=j?(f=this.a*Rr(u,l,h,c,Y),t=Math.sqrt(r.x*r.x+r.y*r.y),p=t-f,o=Th(p/this.a,u,l,h,c),s=nt(this.long0+Math.atan2(r.x,r.y)),r.x=s,r.y=o,r):(v=this.lat0/ae,_=this.long0/ae,w=Math.atan2(r.x,r.y)/ae,I=Math.sqrt(r.x*r.x+r.y*r.y),y=this.g.Direct(v,_,w,I,this.g.STANDARD),r.x=y.lon2*ae,r.y=y.lat2*ae,r))}var bC=["Azimuthal_Equidistant","aeqd"];const TC={init:IC,forward:MC,inverse:NC,names:bC};function xC(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function OC(r){var t,e,n,i,s,o,a,u,l=r.x,h=r.y;return n=nt(l-this.long0),t=Math.sin(h),e=Math.cos(h),i=Math.cos(n),o=this.sin_p14*t+this.cos_p14*e*i,s=1,(o>0||Math.abs(o)<=j)&&(a=this.a*s*e*Math.sin(n),u=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*i)),r.x=a,r.y=u,r}function AC(r){var t,e,n,i,s,o,a;return r.x-=this.x0,r.y-=this.y0,t=Math.sqrt(r.x*r.x+r.y*r.y),e=Ws(t/this.a),n=Math.sin(e),i=Math.cos(e),o=this.long0,Math.abs(t)<=j?(a=this.lat0,r.x=o,r.y=a,r):(a=Ws(i*this.sin_p14+r.y*n*this.cos_p14/t),s=Math.abs(this.lat0)-Y,Math.abs(s)<=j?(this.lat0>=0?o=nt(this.long0+Math.atan2(r.x,-r.y)):o=nt(this.long0-Math.atan2(-r.x,r.y)),r.x=o,r.y=a,r):(o=nt(this.long0+Math.atan2(r.x*n,t*this.cos_p14*i-r.y*this.sin_p14*n)),r.x=o,r.y=a,r))}var DC=["ortho"];const LC={init:xC,forward:OC,inverse:AC,names:DC};var Ie={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},jt={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function RC(){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||"Quadrilateralized Spherical Cube",this.lat0>=Y-$t/2?this.face=Ie.TOP:this.lat0<=-(Y-$t/2)?this.face=Ie.BOTTOM:Math.abs(this.long0)<=$t?this.face=Ie.FRONT:Math.abs(this.long0)<=Y+$t?this.face=this.long0>0?Ie.RIGHT:Ie.LEFT:this.face=Ie.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function FC(r){var t={x:0,y:0},e,n,i,s,o,a,u={value:0};if(r.x-=this.long0,this.es!==0?e=Math.atan(this.one_minus_f_squared*Math.tan(r.y)):e=r.y,n=r.x,this.face===Ie.TOP)s=Y-e,n>=$t&&n<=Y+$t?(u.value=jt.AREA_0,i=n-Y):n>Y+$t||n<=-(Y+$t)?(u.value=jt.AREA_1,i=n>0?n-or:n+or):n>-(Y+$t)&&n<=-$t?(u.value=jt.AREA_2,i=n+Y):(u.value=jt.AREA_3,i=n);else if(this.face===Ie.BOTTOM)s=Y+e,n>=$t&&n<=Y+$t?(u.value=jt.AREA_0,i=-n+Y):n<$t&&n>=-$t?(u.value=jt.AREA_1,i=-n):n<-$t&&n>=-(Y+$t)?(u.value=jt.AREA_2,i=-n-Y):(u.value=jt.AREA_3,i=n>0?-n+or:-n-or);else{var l,h,c,f,p,v,_;this.face===Ie.RIGHT?n=Aa(n,+Y):this.face===Ie.BACK?n=Aa(n,3.14159265359):this.face===Ie.LEFT&&(n=Aa(n,-Y)),f=Math.sin(e),p=Math.cos(e),v=Math.sin(n),_=Math.cos(n),l=p*_,h=p*v,c=f,this.face===Ie.FRONT?(s=Math.acos(l),i=xh(s,c,h,u)):this.face===Ie.RIGHT?(s=Math.acos(h),i=xh(s,c,-l,u)):this.face===Ie.BACK?(s=Math.acos(-l),i=xh(s,c,-h,u)):this.face===Ie.LEFT?(s=Math.acos(-h),i=xh(s,c,l,u)):(s=i=0,u.value=jt.AREA_0)}return a=Math.atan(12/or*(i+Math.acos(Math.sin(i)*Math.cos($t))-Y)),o=Math.sqrt((1-Math.cos(s))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(i))))),u.value===jt.AREA_1?a+=Y:u.value===jt.AREA_2?a+=or:u.value===jt.AREA_3&&(a+=1.5*or),t.x=o*Math.cos(a),t.y=o*Math.sin(a),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,r.x=t.x,r.y=t.y,r}function GC(r){var t={lam:0,phi:0},e,n,i,s,o,a,u,l,h,c={value:0};if(r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,n=Math.atan(Math.sqrt(r.x*r.x+r.y*r.y)),e=Math.atan2(r.y,r.x),r.x>=0&&r.x>=Math.abs(r.y)?c.value=jt.AREA_0:r.y>=0&&r.y>=Math.abs(r.x)?(c.value=jt.AREA_1,e-=Y):r.x<0&&-r.x>=Math.abs(r.y)?(c.value=jt.AREA_2,e=e<0?e+or:e-or):(c.value=jt.AREA_3,e+=Y),h=or/12*Math.tan(e),o=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),a=Math.atan(o),i=Math.cos(e),s=Math.tan(n),u=1-i*i*s*s*(1-Math.cos(Math.atan(1/Math.cos(a)))),u<-1?u=-1:u>1&&(u=1),this.face===Ie.TOP)l=Math.acos(u),t.phi=Y-l,c.value===jt.AREA_0?t.lam=a+Y:c.value===jt.AREA_1?t.lam=a<0?a+or:a-or:c.value===jt.AREA_2?t.lam=a-Y:t.lam=a;else if(this.face===Ie.BOTTOM)l=Math.acos(u),t.phi=l-Y,c.value===jt.AREA_0?t.lam=-a+Y:c.value===jt.AREA_1?t.lam=-a:c.value===jt.AREA_2?t.lam=-a-Y:t.lam=a<0?-a-or:-a+or;else{var f,p,v;f=u,h=f*f,h>=1?v=0:v=Math.sqrt(1-h)*Math.sin(a),h+=v*v,h>=1?p=0:p=Math.sqrt(1-h),c.value===jt.AREA_1?(h=p,p=-v,v=h):c.value===jt.AREA_2?(p=-p,v=-v):c.value===jt.AREA_3&&(h=p,p=v,v=-h),this.face===Ie.RIGHT?(h=f,f=-p,p=h):this.face===Ie.BACK?(f=-f,p=-p):this.face===Ie.LEFT&&(h=f,f=p,p=-h),t.phi=Math.acos(-v)-Y,t.lam=Math.atan2(p,f),this.face===Ie.RIGHT?t.lam=Aa(t.lam,-Y):this.face===Ie.BACK?t.lam=Aa(t.lam,-3.14159265359):this.face===Ie.LEFT&&(t.lam=Aa(t.lam,+Y))}if(this.es!==0){var _,w,I;_=t.phi<0?1:0,w=Math.tan(t.phi),I=this.b/Math.sqrt(w*w+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-I*I)/(this.one_minus_f*I)),_&&(t.phi=-t.phi)}return t.lam+=this.long0,r.x=t.lam,r.y=t.phi,r}function xh(r,t,e,n){var i;return r<j?(n.value=jt.AREA_0,i=0):(i=Math.atan2(t,e),Math.abs(i)<=$t?n.value=jt.AREA_0:i>$t&&i<=Y+$t?(n.value=jt.AREA_1,i-=Y):i>Y+$t||i<=-(Y+$t)?(n.value=jt.AREA_2,i=i>=0?i-or:i+or):(n.value=jt.AREA_3,i+=Y)),i}function Aa(r,t){var e=r+t;return e<-3.14159265359?e+=Bu:e>3.14159265359&&(e-=Bu),e}var kC=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const VC={init:RC,forward:FC,inverse:GC,names:kC};var Ef=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],il=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],vv=.8487,mv=1.3523,yv=Li/5,UC=1/yv,Da=18,Oh=function(r,t){return r[0]+t*(r[1]+t*(r[2]+t*r[3]))},zC=function(r,t){return r[1]+t*(2*r[2]+t*3*r[3])};function qC(r,t,e,n){for(var i=t;n;--n){var s=r(i);if(i-=s,Math.abs(s)<e)break}return i}function WC(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function XC(r){var t=nt(r.x-this.long0),e=Math.abs(r.y),n=Math.floor(e*yv);n<0?n=0:n>=Da&&(n=Da-1),e=Li*(e-UC*n);var i={x:Oh(Ef[n],e)*t,y:Oh(il[n],e)};return r.y<0&&(i.y=-i.y),i.x=i.x*this.a*vv+this.x0,i.y=i.y*this.a*mv+this.y0,i}function HC(r){var t={x:(r.x-this.x0)/(this.a*vv),y:Math.abs(r.y-this.y0)/(this.a*mv)};if(t.y>=1)t.x/=Ef[Da][0],t.y=r.y<0?-Y:Y;else{var e=Math.floor(t.y*Da);for(e<0?e=0:e>=Da&&(e=Da-1);;)if(il[e][0]>t.y)--e;else if(il[e+1][0]<=t.y)++e;else break;var n=il[e],i=5*(t.y-n[0])/(il[e+1][0]-n[0]);i=qC(function(s){return(Oh(n,s)-t.y)/zC(n,s)},i,j,100),t.x/=Oh(Ef[e],i),t.y=(5*e+i)*ae,r.y<0&&(t.y=-t.y)}return t.x=nt(t.x+this.long0),t}var YC=["Robinson","robin"];const JC={init:WC,forward:XC,inverse:HC,names:YC};function BC(){this.name="geocent"}function QC(r){var t=Y0(r,this.es,this.a);return t}function KC(r){var t=J0(r,this.es,this.a,this.b);return t}var ZC=["Geocentric","geocentric","geocent","Geocent"];const $C={init:BC,forward:QC,inverse:KC,names:ZC};var yr={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},sl={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function jC(){if(Object.keys(sl).forEach((function(e){if(typeof this[e]>"u")this[e]=sl[e].def;else{if(sl[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);sl[e].num&&(this[e]=parseFloat(this[e]))}sl[e].degrees&&(this[e]=this[e]*ae)}).bind(this)),Math.abs(Math.abs(this.lat0)-Y)<j?this.mode=this.lat0<0?yr.S_POLE:yr.N_POLE:Math.abs(this.lat0)<j?this.mode=yr.EQUIT:(this.mode=yr.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)throw new Error("Invalid height");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;var r=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(r),this.sw=Math.sin(r)}function tP(r){r.x-=this.long0;var t=Math.sin(r.y),e=Math.cos(r.y),n=Math.cos(r.x),i,s;switch(this.mode){case yr.OBLIQ:s=this.sinph0*t+this.cosph0*e*n;break;case yr.EQUIT:s=e*n;break;case yr.S_POLE:s=-t;break;case yr.N_POLE:s=t;break}switch(s=this.pn1/(this.p-s),i=s*e*Math.sin(r.x),this.mode){case yr.OBLIQ:s*=this.cosph0*t-this.sinph0*e*n;break;case yr.EQUIT:s*=t;break;case yr.N_POLE:s*=-(e*n);break;case yr.S_POLE:s*=e*n;break}var o,a;return o=s*this.cg+i*this.sg,a=1/(o*this.sw*this.h1+this.cw),i=(i*this.cg-s*this.sg)*this.cw*a,s=o*a,r.x=i*this.a,r.y=s*this.a,r}function eP(r){r.x/=this.a,r.y/=this.a;var t={x:r.x,y:r.y},e,n,i;i=1/(this.pn1-r.y*this.sw),e=this.pn1*r.x*i,n=this.pn1*r.y*this.cw*i,r.x=e*this.cg+n*this.sg,r.y=n*this.cg-e*this.sg;var s=Br(r.x,r.y);if(Math.abs(s)<j)t.x=0,t.y=r.y;else{var o,a;switch(a=1-s*s*this.pfact,a=(this.p-Math.sqrt(a))/(this.pn1/s+s/this.pn1),o=Math.sqrt(1-a*a),this.mode){case yr.OBLIQ:t.y=Math.asin(o*this.sinph0+r.y*a*this.cosph0/s),r.y=(o-this.sinph0*Math.sin(t.y))*s,r.x*=a*this.cosph0;break;case yr.EQUIT:t.y=Math.asin(r.y*a/s),r.y=o*s,r.x*=a;break;case yr.N_POLE:t.y=Math.asin(o),r.y=-r.y;break;case yr.S_POLE:t.y=-Math.asin(o);break}t.x=Math.atan2(r.x,r.y)}return r.x=t.x+this.long0,r.y=t.y,r}var rP=["Tilted_Perspective","tpers"];const nP={init:jC,forward:tP,inverse:eP,names:rP};function iP(){if(this.flip_axis=this.sweep==="x"?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)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var r=1-this.es,t=1/r;this.radius_p=Math.sqrt(r),this.radius_p2=r,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function sP(r){var t=r.x,e=r.y,n,i,s,o;if(t=t-this.long0,this.shape==="ellipse"){e=Math.atan(this.radius_p2*Math.tan(e));var a=this.radius_p/Br(this.radius_p*Math.cos(e),Math.sin(e));if(i=a*Math.cos(t)*Math.cos(e),s=a*Math.sin(t)*Math.cos(e),o=a*Math.sin(e),(this.radius_g-i)*i-s*s-o*o*this.radius_p_inv2<0)return r.x=Number.NaN,r.y=Number.NaN,r;n=this.radius_g-i,this.flip_axis?(r.x=this.radius_g_1*Math.atan(s/Br(o,n)),r.y=this.radius_g_1*Math.atan(o/n)):(r.x=this.radius_g_1*Math.atan(s/n),r.y=this.radius_g_1*Math.atan(o/Br(s,n)))}else this.shape==="sphere"&&(n=Math.cos(e),i=Math.cos(t)*n,s=Math.sin(t)*n,o=Math.sin(e),n=this.radius_g-i,this.flip_axis?(r.x=this.radius_g_1*Math.atan(s/Br(o,n)),r.y=this.radius_g_1*Math.atan(o/n)):(r.x=this.radius_g_1*Math.atan(s/n),r.y=this.radius_g_1*Math.atan(o/Br(s,n))));return r.x=r.x*this.a,r.y=r.y*this.a,r}function oP(r){var t=-1,e=0,n=0,i,s,o,a;if(r.x=r.x/this.a,r.y=r.y/this.a,this.shape==="ellipse"){this.flip_axis?(n=Math.tan(r.y/this.radius_g_1),e=Math.tan(r.x/this.radius_g_1)*Br(1,n)):(e=Math.tan(r.x/this.radius_g_1),n=Math.tan(r.y/this.radius_g_1)*Br(1,e));var u=n/this.radius_p;if(i=e*e+u*u+t*t,s=2*this.radius_g*t,o=s*s-4*i*this.C,o<0)return r.x=Number.NaN,r.y=Number.NaN,r;a=(-s-Math.sqrt(o))/(2*i),t=this.radius_g+a*t,e*=a,n*=a,r.x=Math.atan2(e,t),r.y=Math.atan(n*Math.cos(r.x)/t),r.y=Math.atan(this.radius_p_inv2*Math.tan(r.y))}else if(this.shape==="sphere"){if(this.flip_axis?(n=Math.tan(r.y/this.radius_g_1),e=Math.tan(r.x/this.radius_g_1)*Math.sqrt(1+n*n)):(e=Math.tan(r.x/this.radius_g_1),n=Math.tan(r.y/this.radius_g_1)*Math.sqrt(1+e*e)),i=e*e+n*n+t*t,s=2*this.radius_g*t,o=s*s-4*i*this.C,o<0)return r.x=Number.NaN,r.y=Number.NaN,r;a=(-s-Math.sqrt(o))/(2*i),t=this.radius_g+a*t,e*=a,n*=a,r.x=Math.atan2(e,t),r.y=Math.atan(n*Math.cos(r.x)/t)}return r.x=r.x+this.long0,r}var aP=["Geostationary Satellite View","Geostationary_Satellite","geos"];const uP={init:iP,forward:sP,inverse:oP,names:aP};var ol=1.340264,al=-.081106,ul=893e-6,ll=.003796,Ah=Math.sqrt(3)/2;function lP(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function hP(r){var t=nt(r.x-this.long0),e=r.y,n=Math.asin(Ah*Math.sin(e)),i=n*n,s=i*i*i;return r.x=t*Math.cos(n)/(Ah*(ol+3*al*i+s*(7*ul+9*ll*i))),r.y=n*(ol+al*i+s*(ul+ll*i)),r.x=this.a*r.x+this.x0,r.y=this.a*r.y+this.y0,r}function cP(r){r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a;var t=1e-9,e=12,n=r.y,i,s,o,a,u,l;for(l=0;l<e&&(i=n*n,s=i*i*i,o=n*(ol+al*i+s*(ul+ll*i))-r.y,a=ol+3*al*i+s*(7*ul+9*ll*i),n-=u=o/a,!(Math.abs(u)<t));++l);return i=n*n,s=i*i*i,r.x=Ah*r.x*(ol+3*al*i+s*(7*ul+9*ll*i))/Math.cos(n),r.y=Math.asin(Math.sin(n)/Ah),r.x=nt(r.x+this.long0),r}var fP=["eqearth","Equal Earth","Equal_Earth"];const dP={init:lP,forward:hP,inverse:cP,names:fP};var hl=1e-10;function gP(){var r;if(this.phi1=this.lat1,Math.abs(this.phi1)<hl)throw new Error;this.es?(this.en=df(this.es),this.m1=xa(this.phi1,this.am1=Math.sin(this.phi1),r=Math.cos(this.phi1),this.en),this.am1=r/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=vP,this.forward=pP):(Math.abs(this.phi1)+hl>=Y?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=yP,this.forward=mP)}function pP(r){var t=nt(r.x-(this.long0||0)),e=r.y,n,i,s;return n=this.am1+this.m1-xa(e,i=Math.sin(e),s=Math.cos(e),this.en),i=s*t/(n*Math.sqrt(1-this.es*i*i)),r.x=n*Math.sin(i),r.y=this.am1-n*Math.cos(i),r.x=this.a*r.x+(this.x0||0),r.y=this.a*r.y+(this.y0||0),r}function vP(r){r.x=(r.x-(this.x0||0))/this.a,r.y=(r.y-(this.y0||0))/this.a;var t,e,n,i;if(e=Br(r.x,r.y=this.am1-r.y),i=gf(this.am1+this.m1-e,this.es,this.en),(t=Math.abs(i))<Y)t=Math.sin(i),n=e*Math.atan2(r.x,r.y)*Math.sqrt(1-this.es*t*t)/Math.cos(i);else if(Math.abs(t-Y)<=hl)n=0;else throw new Error;return r.x=nt(n+(this.long0||0)),r.y=zs(i),r}function mP(r){var t=nt(r.x-(this.long0||0)),e=r.y,n,i;return i=this.cphi1+this.phi1-e,Math.abs(i)>hl?(r.x=i*Math.sin(n=t*Math.cos(e)/i),r.y=this.cphi1-i*Math.cos(n)):r.x=r.y=0,r.x=this.a*r.x+(this.x0||0),r.y=this.a*r.y+(this.y0||0),r}function yP(r){r.x=(r.x-(this.x0||0))/this.a,r.y=(r.y-(this.y0||0))/this.a;var t,e,n=Br(r.x,r.y=this.cphi1-r.y);if(e=this.cphi1+this.phi1-n,Math.abs(e)>Y)throw new Error;return Math.abs(Math.abs(e)-Y)<=hl?t=0:t=n*Math.atan2(r.x,r.y)/Math.cos(e),r.x=nt(t+(this.long0||0)),r.y=zs(e),r}var _P=["bonne","Bonne (Werner lat_1=90)"];const EP={init:gP,names:_P};function wP(r){r.Proj.projections.add(Nh),r.Proj.projections.add(bh),r.Proj.projections.add(gw),r.Proj.projections.add(Cw),r.Proj.projections.add(Tw),r.Proj.projections.add(Lw),r.Proj.projections.add(Uw),r.Proj.projections.add(Hw),r.Proj.projections.add(Kw),r.Proj.projections.add(eS),r.Proj.projections.add(yS),r.Proj.projections.add(PS),r.Proj.projections.add(TS),r.Proj.projections.add(RS),r.Proj.projections.add(US),r.Proj.projections.add(HS),r.Proj.projections.add(KS),r.Proj.projections.add(eC),r.Proj.projections.add(aC),r.Proj.projections.add(fC),r.Proj.projections.add(mC),r.Proj.projections.add(SC),r.Proj.projections.add(TC),r.Proj.projections.add(LC),r.Proj.projections.add(VC),r.Proj.projections.add(JC),r.Proj.projections.add($C),r.Proj.projections.add(nP),r.Proj.projections.add(uP),r.Proj.projections.add(dP),r.Proj.projections.add(EP)}Yr.defaultDatum="WGS84",Yr.Proj=Fi,Yr.WGS84=new Yr.Proj("WGS84"),Yr.Point=Ta,Yr.toPoint=Z0,Yr.defs=Lr,Yr.nadgrid=gE,Yr.transform=Mh,Yr.mgrs=AE,Yr.version="__VERSION__",wP(Yr);const _v=Yr("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=geocent +datum=WGS84");function Gi(r){return _v.forward(r)}function Ev(r){return _v.inverse(r)}const wv=Yr("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs");function SP(r){const t=wv.forward([r[0],r[1]]);return[t[0],t[1],r[2]]}function CP(r){const t=wv.inverse([r[0],r[1]]);return[t[0],t[1],r[2]]}function Sv(r,t){const e=Gi(r),n=Gi(t);return d.Vector.distance(e,n)}function cl(r,t){const e=[],n=r.length;let i=0;for(let s=0;s<n-1;++s){if(t===void 0||t==="GEODESIC"){const o=jc(r[s],r[s+1]),a=Math.abs(r[s][2]-r[s+1][2]);if(a===0)i+=o;else{const u=Math.sqrt(o*o+a*a);i+=u}}else if(t==="RHUMB"){const o=E0(r[s],r[s+1]),a=Math.abs(r[s][2]-r[s+1][2]);if(a===0)i+=o;else{const u=Math.sqrt(o*o+a*a);i+=u}}else if(t==="NONE"){const o=Sv(r[s],r[s+1]);i+=o}else console.warn(`未知的arcType: ${t},导致距离无法计算!`);e.push(i)}return e}function wf(r){const t="__getXyzFromPostion";let e=d.getExtProp(r,t);return(!e||!d.Vector.equals(e[0],r))&&(e=[[...r],Gi(r)],d.setExtProp(r,t,e)),e[1]}class Cv extends d.Destroyable{constructor(){super();g(this,"_data",this.dv(d.react(void 0)))}set data(e){this._data.value=e}get data(){return this._data.value}get dataChanged(){return this._data.changed}}class Pv extends d.Destroyable{constructor(){super(...arguments);g(this,"_dragStartEvent",this.dv(new d.Event));g(this,"_dragOverEvent",this.dv(new d.Event));g(this,"_dragLeaveEvent",this.dv(new d.Event));g(this,"_dropEvent",this.dv(new d.Event))}dragStart(e){this._dragStartEvent.emit(e)}dragOver(e){this._dragOverEvent.emit(e)}dragLeave(e){this._dragLeaveEvent.emit(e)}drop(e){this._dropEvent.emit(e)}}function PP(r,t){t&&(Reflect.has(t,"editing")?t.editing=!0:Reflect.has(t,"positionEditing")&&(t.positionEditing=!0))}function IP(r){["Czm3DTiles","View","ESCameraView","OlView","GeoCameraController"].includes(r.typeName)||(Reflect.has(r,"editing")?r.editing=!0:Reflect.has(r,"positionEditing")&&(r.positionEditing=!0)),typeof r.execOnCreating=="function"&&r.execOnCreating()}function Dh(r,t){d.getExtProp(r,"__treeItem")&&console.error("setSceneObjectTreeItem error!"),d.setExtProp(r,"__treeItem",t)}function MP(r){return d.getExtProp(r,"__treeItem")}function NP(r){if(!(r.startsWith("./")||r.startsWith("../")||r.startsWith("/")))return r;const t=document.createElement("a");t.href=r;const e=t.href;return t.remove(),e}function bP(r){try{return JSON.parse(r),!0}catch{return!1}}function TP(r){return r instanceof Function?r():r}function Iv(r,t){for(let e of r)if(t.includes(e))return!0;return!1}function hs(r,t){const e=r,n=t;return e===void 0||e.length===0||n===void 0||n.length===0?!0:Iv(e,n)}function xP(r){const t=setTimeout(()=>{r(),clearTimeout(t)})}function La(r){let t=r%360;return t=t<0?360+t:t,t}function Mv(r){return La(r+180)-180}function Lh(r,t,e){let n=La(r),i=La(t);Math.abs(n-i)>180&&(n<i?n+=360:i+=360);const s=n*(1-e)+i*e;return Mv(s)}function Sf(r,t,e,n){return n=n||[0,0,0],n[0]=Lh(r[0],t[0],e),n[1]=Lh(r[1],t[1],e),n[2]=Lh(r[2],t[2],e),n}function Nv(r,t,e="editing"){const n=new d.Destroyable;r.ad(n);const i=t.bind(r);return n.ad(new d.ObjResettingWithEvent(r.activeViewerChanged,()=>{const s=new d.Destroyable;let o=r.activeViewer;return o?(s.ad(r[`${e}Changed`].don(()=>{var a;r[`${e}`]?i():(a=r.mainClass.editingID)!=null&&a.includes("inner")&&r.activeViewer&&r.activeViewer.stopEditing()})),s.ad(o.editingEvent.don(a=>{if(a.objectIDs.includes(r.id)&&a.type==="end"){const u=r.mainClass;u.editingID&&a.editingID.includes(u.editingID)?r[`${e}`]=!1:r[`${e}`]=!u.editingID.includes("outer")}}))):s.ad(r[`${e}Changed`].don(()=>{r[`${e}`]=!1})),s})),r[`${e}`]&&i(),n}function OP(r,t){const{type:e,id:n}=r;if(e){const i=ht.create(e,n);if(i)return i.json=r,i;console.warn(`cannot create sceneObject from type(${e})`)}else console.warn(`cannot create sceneObject from type(${e})`)}function bv(r){const t=r.children&&d.every(r.children,n=>{if(!(n instanceof _r))throw new Error("!(treeItem instanceof SceneTreeItem)");return!n.show})||!1,e=r.sceneTree.getSceneObjectShowFunc(r.sceneObject);return!t||e}class _r extends d.TreeItem{constructor(e,n=!1,i,s,o=!0){super(e,n,i);g(this,"_dragDrop");g(this,"_showChangedNotAffectChildren",!1);g(this,"_showChangedNotAffectParent",!1);g(this,"_type",this.dv(d.react("Unknown")));g(this,"_isExport",this.dv(d.react(!0)));const a=()=>this.tree&&this.tree.itemsChanged.emit([this]);this.dispose(this.nameChanged.disposableOn(a)),this.name=`未命名条目(${this.id})`,this.extras=s,this._isExport.value=o;let u;const l=()=>{u&&(u(),u=void 0)};this.dispose(l),this.dispose(this.sceneObjectChanged.disposableOn(h=>{l(),h&&(u=d.bind([this,"name"],[h,"name"]))})),this.dispose(this.showChanged.disposableOn(h=>{if(e.setSceneObjectShowFunc(this.sceneObject,h),this.tree&&this.tree.forceRedraw(),this.children&&!this._showChangedNotAffectChildren)for(let c of this.children)c instanceof _r&&(c._showChangedNotAffectParent=!0,c.show=h,c._showChangedNotAffectParent=!1);this.parent&&this.parent instanceof _r&&!this._showChangedNotAffectParent&&(this.parent._showChangedNotAffectChildren=!0,this.parent.show=bv(this.parent),this.parent._showChangedNotAffectChildren=!1)})),this.dv(new d.ObjResettingWithEvent(this.sceneObjectChanged,()=>{if(!this.sceneObject)return;const h=new d.Destroyable;if("show"in this.sceneObject&&"showChanged"in this.sceneObject&&this.sceneObject.showChanged instanceof Event){const c=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};c(),h.dispose(this.sceneObject.showChanged.disposableOn(c))}else if("enabled"in this.sceneObject&&"enabledChanged"in this.sceneObject&&this.sceneObject.enabledChanged instanceof Event){const c=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};c(),h.dispose(this.sceneObject.enabledChanged.disposableOn(c))}return h})),this.childrenChangedEvent.disposableOn(()=>{const h=bv(this);this._showChangedNotAffectChildren=!0,this.show=h,this._showChangedNotAffectChildren=!1});{const h=()=>{let c="Unknown";this.sceneObject?c=this.sceneObject.typeName:this.children&&(c="Folder"),this._type.value=c};this.dispose(this.sceneObjectChanged.disposableOn(h)),this.dispose(this.childrenResetedEvent.disposableOn(h)),h()}}get dragDrop(){return this._dragDrop||(this._dragDrop=this.dv(this.sceneTree.createTreeItemDragDropFunc(this))),this._dragDrop}get type(){return this._type.value}get typeChanged(){return this._type.changed}get isExport(){return this._isExport.value}get isExportChanged(){return this._isExport.changed}set isExport(e){this._isExport.value=e}get sceneTree(){return this.tree}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){try{this.json=JSON.parse(e)}catch(n){console.error(`sceneTreeItem.jsonStr error ${n}`,n)}}get json(){const e=this.children&&[...this.children].filter(n=>n.isExport).map(n=>n.json);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.json,children:e,extras:this.extras}}set json(e){if(e.name!==void 0&&(this.name=e.name),this.extras=e.extras,this._showChangedNotAffectChildren=!0,this._showChangedNotAffectParent=!0,this.show=e.show??!0,this._showChangedNotAffectChildren=!1,this._showChangedNotAffectParent=!1,this.uiTreeObject.collapsed=e.collapsed??!1,this.sceneObject=void 0,e.sceneObj&&(this.sceneObject=this.sceneTree.createSceneObjectFunc(e.sceneObj,this)),!!e.children){if(this.resetChildren(!0),!this.children)throw new Error("resetChildren(true) cannot get children!");for(let n of e.children){const i=new _r(this.tree,!0);i.json=n,this.children.push(i)}}}clone(){try{const e=new _r(this.sceneTree,!!this.children,void 0,this.extras,this.isExport);return e.json=this.json,e.name=this.sceneTree.getSceneTreeItemCloneNameFunc(this),e}catch(e){console.error(`SceneTreeItem.clone error: ${e}`,e)}}insertNewTreeItem(e,n){if(e==="FolderInnerOrAfter"||e==="FolderInnerOrBefore"||e==="FolderInner"){if(n&&n.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&!(e.includes("Or")&&this.sceneObject))return n&&this.children.push(n),!0;if(e==="FolderInner")return!1;if(e==="FolderInnerOrAfter")return super.insertNewTreeItem("After",n);if(e==="FolderInnerOrBefore")return super.insertNewTreeItem("Before",n);throw new Error("should not be here!")}else return super.insertNewTreeItem(e,n)}}(r=>{r.createDefaultProps=()=>({name:"未命名条目",nameEditing:!1,sceneObject:void 0,show:!0,extras:d.reactJsonWithUndefined(void 0)})})(_r||(_r={})),d.extendClassProps(_r.prototype,_r.createDefaultProps);function Tv(r,t,e){let{offsetY:n}=t;if(!t.target||!("clientTop"in t.target))return"none";n+=2,n+=t.target.clientTop;let i="none";return r.children?n<=e*.3?i="before":n>=e*.7?!r.uiTreeObject.collapsed&&r.children.length>0?i="inner":i="after":i="inner":n<=e*.5?i="before":i="after",i}class xv extends Pv{constructor(t){super(),this._treeItem=t;const{dragStartDataManager:e}=this._treeItem.sceneTree;let n="none";const i=this.disposeVar(d.createTimeoutWithStartValues(()=>{this._treeItem.uiTreeObject.moveToPositionMode=n,console.log(`uiTreeObject.moveToPositionMode = lastDragMode(${n});`)},200));function s(o){n!==o&&(n=o,i.restart())}this.dispose(this._dragStartEvent.disposableOn(o=>{e.data={type:"UITreeA",value:this._treeItem}})),this.dispose(this._dragOverEvent.disposableOn(o=>{if(!o.dataTransfer)return;o.preventDefault();const a=e;if(a.data&&a.data.type==="UITreeA"&&a.data.value!==void 0){const u=a.data.value,l=this._treeItem,{tree:h}=l;if(h){const c=[...h.selectedItems];~c.indexOf(u)||c.push(u);const f=Tv(l,o,h.itemDivHeight);if(f!=="none"&&d.Tree.canMoveToTreeItems(c,l,f)){o.dataTransfer.dropEffect="move",s(f);return}}}o.dataTransfer.dropEffect="none",s("none")})),this.dispose(this._dropEvent.disposableOn(o=>{const a=e;if(!(a.data&&a.data.type==="UITreeA"&&a.data.value!==void 0))return;const u=a.data.value,l=this._treeItem,{tree:h}=l;if(!h)return;const c=[...h.selectedItems];~c.indexOf(u)||c.push(u);const f=Tv(l,o,h.itemDivHeight);f!=="none"&&d.Tree.canMoveToTreeItems(c,l,f)&&(d.Tree.moveToTreeItems(c,l,f),a.data=void 0,s("none"))})),this.dispose(this._dragLeaveEvent.disposableOn(()=>{n="none",i.restart()}))}}function AP(r){if(!(r instanceof _r))throw new Error("defaultCreateTreeItemDragDrop !(treeItem instanceof SceneTreeItem)");return new xv(r)}function DP(r){let t=!1;return r&&("show"in r?t=r.show??!0:"enabled"in r&&(t=r.enabled??!0)),t}function LP(r,t){r&&("show"in r?r.show=t:"enabled"in r&&(r.enabled=t))}const RP=["EnvironmentVariables","ScriptsLoader","SceneScript","ScriptLoader"];function FP(r){const t=[],{root:e={}}=r,n=[e];for(;n.length>0;){const i=n.pop();if(!i)throw new Error("!todo");if(i.children){for(let s of i.children)if(s.children&&n.unshift(s),s.sceneObj){const{type:o=void 0}=s.sceneObj;o||(console.warn("sceneObjJson has no type! treeItem.sceneObj: "),console.warn(s.sceneObj)),o&&RP.includes(o)&&t.push(s.sceneObj)}}}return t}async function GP(r,t){const e=FP(r);let n=0;const i=e.length;for(let s of e)if(++n,t){const o=n/i;t(o,n,i)}}class Ov extends d.Destroyable{constructor(e,n){super();g(this,"treeItemContexMenuCallback");this._sceneTree=e,this._projectManager=n}get sceneTree(){return this._sceneTree}}class kP extends d.Destroyable{constructor(e){super();g(this,"_jsonLoadingEvent",this.disposeVar(new d.Event));g(this,"_setJsonProcessing",this.disposeVar(d.createProcessingFromAsyncFunc(async(e,n)=>{this._jsonLoadingEvent.emit({type:"init"}),this._jsonLoadingEvent.emit({type:"loading"}),n&&await e.promise(this._sceneTree.preloadFunc(n)),this._setJson(n),this._jsonLoadingEvent.emit({type:"loaded"})})));this._sceneTree=e,this._setJsonProcessing.errorFunc=n=>{this._jsonLoadingEvent.emit({type:"error",error:n})}}get jsonLoadingEvent(){return this._jsonLoadingEvent}_setJson(e){try{this._sceneTree.setJson(e||{})}catch(n){console.error(`json数据装配时发生错误!error: ${n}`)}}get json(){return this._sceneTree.getJson()}set json(e){this._setJsonProcessing.restart(new d.CancelError("JSON重新赋值!"),e)}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){this.json=JSON.parse(e)}}function VP(r){return r.name+"_clone"}function Cf(r,t,e){if(r instanceof _r)return r.insertNewTreeItem(t,e);{const n={FolderInnerOrAfter:"InnerOrAfter",FolderInnerOrBefore:"InnerOrBefore",FolderInner:"Inner",InnerOrAfter:"InnerOrAfter",InnerOrBefore:"InnerOrBefore",Inner:"Inner",After:"After",Before:"Before"};return r.insertNewTreeItem(n[t],e)}}function UP(r){[r,...r.getDescendants()].forEach(t=>t.destroy())}const Kr=class Kr extends d.Tree{constructor(e,n,i,s){super(i);g(this,"_jsonLoading",this.disposeVar(new kP(this)));g(this,"createSceneObjectFunc",Kr.defaultCreateSceneObjectFunc);g(this,"createTreeItemDragDropFunc",Kr.defaultCreateTreeItemDragDropFunc);g(this,"preloadFunc",Kr.defaultPreload);g(this,"getSceneObjectShowFunc",Kr.defaultGetSceneObjectShow);g(this,"setSceneObjectShowFunc",Kr.defaultSetSceneObjectShow);g(this,"getSceneTreeItemCloneNameFunc",Kr.defaultGetSceneTreeItemCloneNameFunc);g(this,"debug",!1);g(this,"_contextMenu",this.disposeVar(new Ov(this,this.projectManager)));g(this,"_showPropUiOnSelecting",this.disposeVar(d.react(!0)));this._name=e,this._dragStartDataManager=n,this._projectManager=s,this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{var a,u;window.lssn=this.lastSelectedItem,window.lsso=(a=this.lastSelectedItem)==null?void 0:a.sceneObject,this.debug&&console.log(((u=this.lastSelectedItem)==null?void 0:u.sceneObject)??"select null")}));const{sceneObjectsManager:o}=this._projectManager;this.dispose(this.itemsDeleted.disposableOn(a=>{for(let u of a){const l=u,{sceneObject:h}=l;h&&o.deleteSceneObject(h)&&h.destroy()&&Dh(h,void 0);for(let c of l.getDescendants()){const{sceneObject:f}=c;f&&o.deleteSceneObject(f)&&f.destroy()&&Dh(f,void 0)}UP(u)}})),this.dispose(this.itemsAdded.disposableOn(a=>{for(let u of a){const l=u;l.sceneObject&&o.addSceneObject(l.sceneObject)&&Dh(l.sceneObject,l)}})),this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{if(!this.showPropUiOnSelecting)return;this._projectManager.propUiTreeManager.sceneObject=void 0;const{lastSelectedItem:a}=this;a&&(this._projectManager.propUiTreeManager.sceneObject=a.sceneObject)}))}get json(){return this._jsonLoading.json}set json(e){this._jsonLoading.json=e}get jsonStr(){return this._jsonLoading.jsonStr}set jsonStr(e){this._jsonLoading.jsonStr=e}get jsonLoadingEvent(){return this._jsonLoading.jsonLoadingEvent}get name(){return this._name}get projectManager(){return this._projectManager}get contextMenu(){return this._contextMenu}get showPropUiOnSelecting(){return this._showPropUiOnSelecting.value}set showPropUiOnSelecting(e){this._showPropUiOnSelecting.value=e}get showPropUiOnSelectingChanged(){return this._showPropUiOnSelecting.changed}get sceneUiTree(){return this.uiTree}getTreeItemFromSceneObjId(e){const n=this.getDescendants();let i;for(let s of n)if(s.sceneObject&&s.sceneObject.id===e){i=s;break}return i}get dragStartDataManager(){return this._dragStartDataManager}getJson(){return{root:{children:[...this.children].filter(e=>e.isExport).map(e=>e.json)}}}setJson(e){var i;e.root=e.root||{};const n=e.root.children??[];this.root.resetChildren(!0);for(let s of n){const o=new _r(this,!0);o.json=s,(i=this.root.children)==null||i.push(o)}}testAddNewTreeItem(e,n){const i=e||this.lastSelectedItem||this.root;return i?Cf(i,n):!1}addNewTreeItem(e,n,i,s){const o=e||this.lastSelectedItem||this.root;if(o&&Cf(o,n)){const a=new _r(this,i);if(a.sceneObject=s,!Cf(o,n,a))throw new Error("currentTreeItem.insertNewTreeItem return false!");return a}}createSceneObjectTreeItem(e,n,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${i?i.id:"root"})`);return}const a=ht.create(e,n);return a?this.addNewTreeItem(i,s??"FolderInnerOrAfter",!0,a):void 0}createGroupTreeItem(e,n,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${i?i.id:"root"})`);return}const a=this.addNewTreeItem(i,s??"FolderInnerOrAfter",!0);if(!a){console.warn("addNewTreeItem error!");return}return a.name=e??"未命名组节点",a}createSceneObjectTreeItemFromClass(e,n,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o))return;const a=ht.createFromClass(e,n);return a?this.addNewTreeItem(i,o,!0,a):void 0}createSceneObjectTreeItemFromJson(e,n,i){const s=i??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(n,s))return;const o=ht.createFromJson(e);return console.log(o),o?this.addNewTreeItem(n,i??"FolderInnerOrAfter",!0,o):void 0}destroySceneObjectTreeItem(e){if(e===this.root){console.warn("cannot destroy root! please use function destroyAllSceneObjectTreeItems!");return}e.detachFromParent()}destroyAllSceneObjectTreeItems(){if(!this.root.children)return;const e=[...this.root.children];for(let n of e)this.destroySceneObjectTreeItem(n)}};g(Kr,"defaultCreateSceneObjectFunc",OP),g(Kr,"defaultCreateTreeItemDragDropFunc",AP),g(Kr,"defaultPreload",GP),g(Kr,"defaultGetSceneObjectShow",DP),g(Kr,"defaultSetSceneObjectShow",LP),g(Kr,"defaultGetSceneTreeItemCloneNameFunc",VP);let fl=Kr;const Pf={saturation:.35,brightness:1.4,gamma:.8,atmosphereScatteringIntensity:5,groundColor:[0,.09411764705882353,.3137254901960784,1]};class Av extends d.Tree{constructor(t){super(t)}get propUiTree(){return this.uiTree}}class If extends d.TreeItem{constructor(t,e,n){super(t,e),this._property=n}get property(){return this._property}}class Mf extends If{constructor(t,e){super(t,!1,e)}}class Nf extends If{constructor(t,e){super(t,!0,e)}get groupChildren(){return this.children}}function Dv(r,t){const e=new Av(t),n=r.getProperties("chinese"),i=[];for(let s of n)if(s instanceof gt){const o=new Nf(e,s);o.d(()=>s.destroy()),e.children.push(o),i.push(o)}else{const o=new Mf(e,s);e.children.push(o),o.d(()=>s.destroy())}for(;i.length>0;){const s=i.pop();if(!s)throw new Error("should not be here!");const o=s;if(!(o.property instanceof gt))throw new Error("!(treeItem.property instanceof GroupProperty)");for(let a of o.property.children)if(a instanceof gt){const u=new Nf(e,a);u.d(()=>a.destroy()),o.groupChildren.push(u),i.push(u)}else{const u=new Mf(e,a);o.groupChildren.push(u),u.d(()=>a.destroy())}}return e.d(()=>{e.itemChildrenChanged.reset(),e.itemChildrenToChange.reset();const s=[...e.getDescendants()];s.forEach(o=>{o.children&&(o.children.length=0),o.destroy()}),s.length=0}),e}class Ra extends d.Destroyable{constructor(e){super();g(this,"_propTreeReact",this.dv(d.react(void 0)));this.d(()=>this._propTreeReact.value=void 0),this.dv(new d.ObjResettingWithEvent(this.sceneObjectChanged,n=>{if(!n)return;const i=new d.Destroyable;return i.d(n.toDestroyEvent.don(()=>{this.sceneObject=void 0})),i})),this.d(this.sceneObjectChanged.don(n=>{this._propTreeReact.value=void 0,!(!n||!(n instanceof ht))&&(this._propTreeReact.value=Dv(n,e))}))}get propTree(){return this._propTreeReact.value}get propTreeChanged(){return this._propTreeReact.changed}}(r=>{r.createDefaultProps=()=>({sceneObject:void 0})})(Ra||(Ra={})),d.extendClassProps(Ra.prototype,Ra.createDefaultProps);function zP(r,t,e,n=!0){n&&e(),r.dispose(t.disposableOn(e))}class qP extends d.Destroyable{constructor(e,n,i,s){super();g(this,"_sceneObjectId",this.dv(new d.SceneObjectWithId));this._id=e,this._startTimeStamp=n,this._duration=i,this._parent=s,this._sceneObjectId.id=this._id;const o=()=>{if(!this.player)return;const{currentTime:a=0}=this._parent,u=a-this._startTimeStamp;this.player.currentTime=d.clamp(u,0,this._duration)*(this.player.speed??1)};o(),this.d(this._parent.currentTimeChanged.don(o)),this.d(this.playerChanged.don(o))}get player(){return this._sceneObjectId.sceneObject instanceof ci?this._sceneObjectId.sceneObject:void 0}get playerChanged(){return this._sceneObjectId.sceneObjectChanged}}const WP=`
31
- 用来配置子播放器,它是一个数组形式,数组的每个元素仍然是一个数组,形式是[子播放器的ID, 起始时间, 持续时间]。
32
- 注意时间的单位是毫秒。
33
- 示例如下:
34
- \`\`\`
35
- [
36
- [
37
- "9591a729-d90b-40d0-8d1b-f1ac4b5263c1",
38
- 0,
39
- 5000
40
- ],
41
- [
42
- "76ad204f-58c6-4639-8713-ecfab6783b0f",
43
- 7000.002288818359,
44
- 5000
45
- ]
46
- ]
47
- \`\`\`
48
- `,ar=class ar extends d.Destroyable{constructor(){super();g(this,"_ratio",this.dv(d.react(0)));g(this,"_subPlayers",this.dv(new d.ObservableArray));const e=this.dv(new d.Player);{const o=()=>{e.loop=this.loop??ar.defaults.loop};o(),this.d(this.loopChanged.don(o))}{const o=()=>{(this.loop??ar.defaults.loop)!==e.loop&&(this.loop=e.loop)};o(),this.d(e.loopChangedEvent.don(o))}{const o=()=>{e.currentTime=this.currentTime??ar.defaults.currentTime};o(),this.d(this.currentTimeChanged.don(o))}{const o=()=>{(this.currentTime??ar.defaults.currentTime)!==e.currentTime&&(this.currentTime=e.currentTime)};o(),this.d(e.currentTimeChangedEvent.don(o))}{const o=()=>{e.duration=this.duration??ar.defaults.duration};o(),this.d(this.durationChanged.don(o))}{const o=()=>{(this.duration??ar.defaults.duration)!==e.duration&&(this.duration=e.duration)};o(),this.d(e.durationChangedEvent.don(o))}{const o=()=>{e.speed=this.speed??ar.defaults.speed};o(),this.d(this.speedChanged.don(o))}{const o=()=>{(this.speed??ar.defaults.speed)!==e.speed&&(this.speed=e.speed)};o(),this.d(e.speedChangedEvent.don(o))}{const o=()=>{e.playing=this.playing??ar.defaults.playing};o(),this.d(this.playingChanged.don(o))}{const o=()=>{(this.playing??ar.defaults.playing)!==e.playing&&(this.playing=e.playing)};o(),this.d(e.playingChangedEvent.don(o))}const n=()=>{const o=this.duration??ar.defaults.duration;o>0&&(this._ratio.value=(this.currentTime??ar.defaults.currentTime)/o)};n();const i=this.dv(d.createNextAnimateFrameEvent(this.currentTimeChanged,this.durationChanged));this.d(i.don(n)),this.d(()=>{const{length:o}=this._subPlayers;for(let a=0;a<o;++a)this._subPlayers.get(a).destroy();this._subPlayers.length=0});const s=()=>{for(let a of this._subPlayers)a.destroy();if(this._subPlayers.length=0,!this.channels)return;const o=this.channels.map(a=>{const[u,l,h]=a;return new qP(u,l,h,this)});this._subPlayers.splice(0,0,...o)};s(),this.d(this.channelsChanged.don(s))}get ratio(){return this._ratio.value}set ratio(e){Math.abs(this._ratio.value-e)<.001||(this.currentTime=(this.duration??ar.defaults.duration)*e)}get ratioChanged(){return this._ratio.changed}};g(ar,"defaults",{loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,channels:!0,ratio:0}),g(ar,"channelsReadMe",WP);let ci=ar;(r=>{r.createDefaultProps=()=>({loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,channels:d.reactDeepArrayWithUndefined(void 0,(t,e)=>t==null?void 0:t.every((n,i)=>n===e[i]),t=>[...t])})})(ci||(ci={})),d.extendClassProps(ci.prototype,ci.createDefaultProps);class bf extends d.Destroyable{constructor(e){super();g(this,"_sceneObject",this.dv(d.react(void 0)));this._id=e,this.d(()=>{this._sceneObject.value=void 0});const n=ht.getSceneObjById(this._id);n&&(this._sceneObject.value=n),this.d(ht.context.sceneObjCreatedEvent.don(i=>{i.id===this._id&&(this._sceneObject.value=i)})),this.d(ht.context.sceneObjToDestroyEvent.don(i=>{i.id===this._id&&(this._sceneObject.value=void 0)}))}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}get id(){return this._id}}class XP extends d.Destroyable{constructor(e,n){super();g(this,"_sofi");this._id=e,this._sofi=this.dv(new bf(this._id));{const i=()=>{n.sceneObject=this._sofi.sceneObject};i(),this.d(this._sofi.sceneObjectChanged.don(i))}}}class HP extends d.Destroyable{constructor(){super();g(this,"_id",this.dv(d.react(void 0)));g(this,"_sceneObject",this.dv(d.react(void 0)));g(this,"_resetting",this.dv(new d.ObjResettingWithEvent(this.idChanged,()=>{const{id:e}=this;if(e===void 0||e===""){this.sceneObject=void 0;return}return new XP(e,this)})))}get id(){return this._id.value}get idChanged(){return this._id.changed}set id(e){this._id.value=e}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}set sceneObject(e){this._sceneObject.value=e}get resetting(){return this._resetting}}class YP extends d.Destroyable{constructor(t,e,n,i){super(),this.disposeVar(new d.ObjResettingWithEvent(t.sceneObjectChanged,()=>{let s;i.debug&&console.log("正在获取Event事件...");const o=t.sceneObject;if(o&&e){const a=e.split(".");if(a.length===0)i.debug&&console.warn("propNames.length === 0");else{let u=d.pluckProperty(o,!1,...a);(!u||!(u instanceof d.Event))&&(a[a.length-1]=a[a.length-1]+"Changed",i.debug&&console.warn(`event未能获取,那么将属性名的最后一项加上Changed(${a[a.length-1]})再试试!`),u=d.pluckProperty(o,!1,...a),i.debug&&u&&console.warn("event仍然获取不到!")),u?u instanceof d.Event?(s=u,i.debug&&console.log(`Event获取成功 propChangedName: ${e}`,s)):i.debug&&console.warn(`the prop is not event from ${o.id}-${o.name}-${o.ref}-${e}`):i.debug&&console.warn(`cannot get changed from ${o.id}-${o.name}-${o.ref}-${e}`)}}if(s){const a=new d.Destroyable;return a.d(s.dwon(()=>n.emit())),a}else{i.debug&&console.log(`未获取到Event!propChangedName: ${e}`);return}}))}}let JP=class extends d.Destroyable{constructor(e,n,i){super();g(this,"_doEvalEvent",this.dv(new d.Event));const s=this._doEvalEvent,o=this.disposeVar(d.createNextAnimateFrameEvent(s)),a=e.map(([u,l])=>{const h=new bf(u),c=l&&new YP(h,l,s,n)||void 0;return[h,c]});this.d(()=>{a.forEach(([u,l])=>{l==null||l.destroy(),u.destroy()}),a.length=0}),this.d(s.don(()=>{const{evalMode:u="NextAnimateFrame",evalOnlyWhenObjsAllExist:l=!0}=n;if(u==="Immediate"){const h=a.map(([c])=>c.sceneObject);(!l||h.every(c=>c!==void 0))&&i(h)}})),this.d(o.don(()=>{const{evalMode:u="NextAnimateFrame",evalOnlyWhenObjsAllExist:l=!0}=n;if(u==="NextAnimateFrame"){const h=a.map(([c])=>c.sceneObject);(!l||h.every(c=>c!==void 0))&&i(h)}}))}forceExecute(){this._doEvalEvent.emit()}};const Lv=Object.freeze(Object.defineProperty({__proto__:null,WatcherObjects:JP},Symbol.toStringTag,{value:"Module"})),{WatcherObjects:BP}=Lv;class dl extends d.Destroyable{constructor(){super();g(this,"_evalFunc");g(this,"_forceExecute",new d.Event);const e=this.dv(d.react(void 0)),n=()=>{try{e.value=this.evalFuncStr&&Function('"use strict";return ('+this.evalFuncStr+")")(),this.debug&&console.log("evalFunc成功构建",e.value)}catch(o){console.error(`evalFunc get error! ${o}`),e.value=void 0}};n(),this.dispose(this.evalFuncStrChanged.disposableOn(n));const i=o=>{this.enabled&&(this.debug&&console.log("执行evalFunc..."),this._evalFunc&&this._evalFunc(o),e.value&&e.value(o))},s=this.disposeVar(new d.ObjResettingWithEvent(this.objIdAndPropChangedNamesChanged,()=>{if(this.objIdAndPropChangedNames.length>0)return this.debug&&console.log("监视对象发生变化,重新创建WatcherObjects"),new BP(this.objIdAndPropChangedNames,this,i)}));this.dispose(this._forceExecute.disposableOn(()=>{var o;(o=s.obj)==null||o.forceExecute()}))}get evalFunc(){return this._evalFunc}set evalFunc(e){this._evalFunc=e}forceExecute(){this._forceExecute.emit()}}(r=>{r.createDefaultProps=()=>({enabled:!1,objIdAndPropChangedNames:d.reactDeepArray([],(t,e)=>t[0]===e[0]&&t[1]===e[1],t=>[t[0],t[1]]),evalFuncStr:"",evalMode:"NextAnimateFrame",evalOnlyWhenObjsAllExist:!0,debug:!1,name:"未命名场景对象",ref:void 0,extras:d.reactJson(void 0),devTags:d.reactArrayWithUndefined(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})})(dl||(dl={})),d.extendClassProps(dl.prototype,dl.createDefaultProps);function QP(r,t,e){var i;((i=t.attachedViewers.values().toArray()[0])==null?void 0:i.getEngineObject(t))?e.call(r):r.dispose(t.createdEvent.don(()=>e.call(r)))}function Rv(r){let t=0;function e(n,i){i++,t=Math.max(i,t),n.forEach(s=>{Array.isArray(s)&&e(s,i)})}return e(r,0),t}const ki=class ki extends ee{constructor(e){super(e);g(this,"editingBindMode","lineString");g(this,"_area",this.dv(d.react(0)));g(this,"_perimeter",this.dv(d.react(0)));const n=()=>{this._updateArea(),this._updatePerimeter()};n(),this.d(this.pointsChanged.don(n))}updateEditing(){var n;const e=[];this.editingBindMode=="doublePoints"?e.push(lt.DoublePointsAppend,lt.DoublePointsModify):this.editingBindMode=="lineString"?e.push(lt.LineStringAppend,lt.LineStringInsert,lt.Translation):this.editingBindMode=="circular"?(e.push(lt.CircularAppend,lt.CircularInsert,lt.Translation),this.supportEditingModes().includes(lt.HeightModify)&&e.push(lt.HeightModify)):this.editingBindMode=="visibility"?e.push(lt.VisibilityAppend,lt.VisibilityModify):this.editingBindMode=="scatter"&&e.push(lt.ScatterAppend,lt.ScatterModify),(n=this.activeViewer)==null||n.startEditing(this,e,{callSource:"inner"})}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}_updateArea(){this._area.value=this.getArea()??0}_updatePerimeter(){this._perimeter.value=this.getPerimeter()??0}getArea(){if(this.points&&this.points.length>=3)return $c([...this.points])}getDistance(){if(this.points&&this.points.length>=2){const e=cl(this.points,"GEODESIC");return e[e.length-1]}else return}getPerimeter(){if(this.points&&this.points.length>=3){const e=[...this.points,this.points[0]],n=cl(e,"GEODESIC");return n[n.length-1]}else return}getIntersect(e){if(this.points&&this.points.length>=3&&e.length>=3){const n=w0(this.points,e);if(!n)return;const i=n[0][0][0];if(Array.isArray(i)){const s=[...n],o=[];return s.forEach(a=>{const u=a[0].map(l=>[...l,0]);o.push(u)}),o}else return[[...n][0].map(a=>[...a,0])]}else return}getUnion(e){if(this.points&&this.points.length>=3&&e.length>=3){const n=S0(this.points,e);if(!n)return;const i=n[0][0][0];if(Array.isArray(i)){const s=[...n],o=[];return s.forEach(a=>{const u=a[0].map(l=>[...l,0]);o.push(u)}),o}else return[[...n][0].map(a=>[...a,0])]}else return}getDifference(e){if(this.points&&this.points.length>=3&&e.length>=3){let n=[...e];const i=e[0],s=e[e.length-1];i[0]===s[0]&&i[1]===s[1]&&i[2]===s[2]||n.push(i);const o=P0([...this.points,this.points[0]],[...n]);if(!o)return{status:"undefined",positions:void 0};const a=[...o];if(Rv(a)===3){const u=a.map(f=>f.map(p=>[...p,0]));if(u.length<=1)return{status:"notIncluded",positions:u};const l=u[0],h=u[1];return tf([...l],[...h])==="oneBig"?{status:"included",positions:u}:{status:"notIncluded",positions:u}}else if(Rv(a)===4){const l=[...a.map(c=>c.map(f=>f.map(p=>[...p,0])))],h=[];return l.forEach(c=>{h.push(c[0])}),{status:"notIncluded",positions:h}}else return{status:"undefined",positions:void 0}}else return{status:"undefined",positions:void 0}}getBuffer(e=500,n){if(this.points&&this.points.length>=2){const i=C0(this.points,e,n);return i?[i[0].map(s=>[...s,0])]:void 0}else return}geoPolygonOverlap(e){if(this.points&&this.points.length>=3&&e.length>=3){const n=tf(this.points,e);return n==="oneBig"?!0:n==="twoBig"?!1:void 0}else return}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",coordinate:[...e.coordinate,new $([this,"editing"],"编辑",!1),new ut([this,"points"],"位置数组",ki.defaults.points,void 0,!0)],style:[...e.style,new gt([],"点样式"),new $([this,"pointed"],"开启",!1),new L([this,"pointSize"],"点大小",1),new bt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new Rt([this,"pointColor"],"点颜色",[1,1,1,1]),new Rt([this,"pointOutlineColor"],"轮廓颜色",ki.defaults.pointStyle.outlineColor),new L([this,"pointOutlineWidth"],"轮廓宽度",ki.defaults.pointStyle.outlineWidth),new gt([],"线样式"),new $([this,"stroked"],"开启线样式",!0),new $([this,"strokeGround"],"贴地",!1),new L([this,"strokeWidth"],"线宽",1),new bt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new Rt([this,"strokeColor"],"线颜色",[1,1,1,1]),new gt([],"面样式"),new $([this,"filled"],"开启",!1),new $([this,"fillGround"],"贴地",!1),new Rt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...e.more,new gt([],"点样式集合"),new _t([this,"pointMaterial"],"点材质"),new ut([this,"pointMaterialParams"],"点材质参数"),new gt([],"线样式集合"),new _t([this,"strokeMaterial"],"线材质"),new ut([this,"strokeMaterialParams"],"线材质参数"),new gt([],"面样式集合"),new _t([this,"fillMaterial"],"面材质"),new ut([this,"fillMaterialParams"],"面材质参数")]}}get pointSize(){return this.pointStyle.size}set pointSize(e){this.pointStyle={...this.pointStyle,size:e}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(e){this.pointStyle={...this.pointStyle,sizeType:e}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(e){this.pointStyle={...this.pointStyle,color:[...e]}}get pointColorChanged(){return this.pointStyleChanged}get pointOutlineColor(){return this.pointStyle.outlineColor}set pointOutlineColor(e){this.pointStyle={...this.pointStyle,outlineColor:[...e]}}get pointOutlineColorChanged(){return this.pointStyleChanged}get pointOutlineWidth(){return this.pointStyle.outlineWidth}set pointOutlineWidth(e){this.pointStyle={...this.pointStyle,outlineWidth:e}}get pointOutlineWidthChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(e){this.pointStyle={...this.pointStyle,material:e}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(e){this.pointStyle={...this.pointStyle,materialParams:e}}get pointMaterialParamsChanged(){return this.pointStyleChanged}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(e){this.strokeStyle={...this.strokeStyle,width:e}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(e){this.strokeStyle={...this.strokeStyle,widthType:e}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(e){this.strokeStyle={...this.strokeStyle,color:[...e]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(e){this.strokeStyle={...this.strokeStyle,material:e}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(e){this.strokeStyle={...this.strokeStyle,materialParams:e}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(e){this.strokeStyle={...this.strokeStyle,ground:e}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(e){this.fillStyle={...this.fillStyle,color:[...e]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(e){this.fillStyle={...this.fillStyle,material:e}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(e){this.fillStyle={...this.fillStyle,materialParams:e}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(e){this.fillStyle={...this.fillStyle,ground:e}}get fillGroundChanged(){return this.fillStyleChanged}};g(ki,"createDefaultProps",()=>({...ee.createDefaultProps(),pointed:!1,pointStyle:d.reactJson({size:10,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),stroked:!1,strokeStyle:d.reactJson({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:d.reactJson({color:[1,1,1,1],material:"",materialParams:{},ground:!1}),points:d.reactPositions(void 0)})),g(ki,"type",ki.register("ESGeoVector",ki,{chsName:"地理矢量",tags:["ESObjects"],description:"地理矢量"})),g(ki,"supportEditingModes",[...ee.supportEditingModes,lt.Translation]);let Dt=ki;const No=class No extends ee{constructor(){super(...arguments);g(this,"_statusDis",this.dv(d.react(!0)));g(this,"_smoothMoveEvent",this.dv(new d.Event));g(this,"_smoothMoveWithRotationEvent",this.dv(new d.Event));g(this,"_smoothMoveOnGroundEvent",this.dv(new d.Event));g(this,"_smoothMoveWithRotationOnGroundEvent",this.dv(new d.Event));g(this,"_automaticLandingEvent",this.dv(new d.Event));g(this,"_smoothMoveKeepPitchEvent",this.dv(new d.Event));g(this,"_smoothMoveRelativelyEvent",this.dv(new d.Event));g(this,"_smoothMoveRelativelyWithRotationEvent",this.dv(new d.Event));g(this,"useCalcFlyToParamInESObjectWithLocation",!0)}updateEditing(){var n;const e=[];this.editingBindMode=="singlePoint"?(e.push(lt.Place,lt.Translation),["ESLocationMeasurement"].includes(this.typeName)||e.push(lt.Rotation),["ESClippingPlane","ESLocationMeasurement","ESLocalRectangle","ESBoxClipping"].includes(this.typeName)||e.push(lt.Scale)):this.editingBindMode=="doublePoints"&&e.push(lt.DoublePointsAppend,lt.DoublePointsModify),(n=this.activeViewer)==null||n.startEditing(this,e,{callSource:"inner"})}get statusDis(){return this._statusDis.value}get statusDisChanged(){return this._statusDis.changed}get smoothMoveEvent(){return this._smoothMoveEvent}smoothMove(e,n){this._smoothMoveEvent.emit(e,n)}get smoothMoveWithRotationEvent(){return this._smoothMoveWithRotationEvent}smoothMoveWithRotation(e,n,i){this._smoothMoveWithRotationEvent.emit(e,n,i)}get smoothMoveOnGroundEvent(){return this._smoothMoveOnGroundEvent}smoothMoveOnGround(e,n,i,s){this._smoothMoveOnGroundEvent.emit(e,n,i,s)}get smoothMoveWithRotationOnGroundEvent(){return this._smoothMoveWithRotationOnGroundEvent}smoothMoveWithRotationOnGround(e,n,i,s,o){this._smoothMoveWithRotationOnGroundEvent.emit(e,n,i,s,o)}get automaticLandingEvent(){return this._automaticLandingEvent}automaticLanding(){const e=this.collision;this.collision=!1,setTimeout(()=>{this._automaticLandingEvent.emit(e)},100)}get smoothMoveKeepPitchEvent(){return this._smoothMoveKeepPitchEvent}smoothMoveKeepPitch(e,n){this._smoothMoveKeepPitchEvent.emit(e,n)}get smoothMoveRelativelyEvent(){return this._smoothMoveRelativelyEvent}smoothMoveRelatively(e,n){this._smoothMoveRelativelyEvent.emit(e,n)}get smoothMoveRelativelyWithRotationEvent(){return this._smoothMoveRelativelyWithRotationEvent}smoothMoveRelativelyWithRotation(e,n,i){this._smoothMoveRelativelyWithRotationEvent.emit(e,n,i)}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",location:[...e.location,new $([this,"editing"],"是否编辑"),new pt([],()=>this.automaticLanding(),[],"自动落地"),new Jo([this,"position"],"位置数组",[0,0,0]),new ic([this,"rotation"],"姿态数组",[0,0,0]),new lr([this,"scale"],"缩放",[1,1,1]),new L([this,"minVisibleDistance"],"最小可见距离",0),new L([this,"maxVisibleDistance"],"最大可见距离",0)],more:[...e.more,new pt(["numbers","number"],(n,i)=>this.smoothMove(n,i),[[0,0,0],0],"平滑移动","smoothMove"),new pt(["numbers","number"],(n,i)=>this.smoothMoveKeepPitch(n,i),[[0,0,0],0],"固定方向平滑移动","smoothMoveKeepPitch"),new pt(["numbers","numbers","number"],(n,i,s)=>this.smoothMoveWithRotation(n,i,s),[[0,0,0],[0,0,0],0],"平滑偏移","smoothMoveWithRotation"),new pt(["number","number","number","string"],(n,i,s,o)=>this.smoothMoveOnGround(n,i,s,o),[0,0,0,""],"贴地平滑移动","smoothMoveOnGround"),new pt(["numbers","number","number","number","string"],(n,i,s,o,a)=>this.smoothMoveWithRotationOnGround(n,i,s,o,a),[[0,0,0],0,0,0,""],"贴地平滑偏移","smoothMoveWithRotationOnGround"),new pt(["numbers","number"],(n,i)=>this.smoothMoveRelatively(n,i),[[0,0,0],0],"smoothMoveRelatively","smoothMoveRelatively"),new pt(["numbers","numbers","number"],(n,i,s)=>this.smoothMoveRelativelyWithRotation(n,i,s),[[0,0,0],[0,0,0],0],"smoothMoveRelativelyWithRotation","smoothMoveRelativelyWithRotation"),new $([this,"enableVisibleDistance"],"是否应用距离显隐")]}}get pointSize(){return this.pointStyle.size}set pointSize(e){this.pointStyle={...this.pointStyle,size:e}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(e){this.pointStyle={...this.pointStyle,sizeType:e}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(e){this.pointStyle={...this.pointStyle,color:[...e]}}get pointColorChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(e){this.pointStyle={...this.pointStyle,material:e}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(e){this.pointStyle={...this.pointStyle,materialParams:e}}get pointMaterialParamsChanged(){return this.pointStyleChanged}};g(No,"createDefaultProps",()=>({...ee.createDefaultProps(),pointed:!1,pointStyle:d.reactJson({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),position:d.reactArray([0,0,0]),rotation:d.reactArray([0,0,0]),scale:d.reactArray([1,1,1]),minVisibleDistance:d.react(0),maxVisibleDistance:d.react(0)})),g(No,"type",No.register("ESObjectWithLocation",No,{chsName:"对象位置",tags:["ESObjects"],description:"对象位置"})),g(No,"supportEditingModes",[...ee.supportEditingModes,lt.Place,lt.Translation,lt.Rotation,lt.Scale,lt.DoublePointsAppend,lt.DoublePointsModify]);let ct=No;const Va=class Va extends ct{getESProperties(){const t={...super.getESProperties()};return{...t,style:[...t.style,new gt([],"点样式集合"),new $([this,"pointed"],"开启点样式",!1),new L([this,"pointSize"],"点大小",1),new bt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new Rt([this,"pointColor"],"点颜色",[1,1,1,1]),new gt([],"线样式集合"),new $([this,"stroked"],"开启线样式",!1),new $([this,"strokeGround"],"是否贴地(线)",!1),new L([this,"strokeWidth"],"线宽",1),new bt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new Rt([this,"strokeColor"],"线颜色",[1,1,1,1]),new gt([],"面样式集合"),new $([this,"filled"],"开启填充样式",!1),new $([this,"fillGround"],"是否贴地",!1),new Rt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...t.more,new gt([],"点样式"),new _t([this,"pointMaterial"],"点材质",""),new ut([this,"pointMaterialParams"],"点材质参数",{}),new gt([],"线样式"),new _t([this,"strokeMaterial"],"线材质",""),new ut([this,"strokeMaterialParams"],"线材质参数",{}),new gt([],"填充样式"),new _t([this,"fillMaterial"],"面材质",""),new ut([this,"fillMaterialParams"],"面材质参数",{})]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(t){this.strokeStyle={...this.strokeStyle,width:t}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(t){this.strokeStyle={...this.strokeStyle,widthType:t}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(t){this.strokeStyle={...this.strokeStyle,color:[...t]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(t){this.strokeStyle={...this.strokeStyle,material:t}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(t){this.strokeStyle={...this.strokeStyle,materialParams:t}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(t){this.strokeStyle={...this.strokeStyle,ground:t}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(t){this.fillStyle={...this.fillStyle,color:[...t]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle,materialParams:t}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(t){this.fillStyle={...this.fillStyle,ground:t}}get fillGroundChanged(){return this.fillStyleChanged}};g(Va,"createDefaultProps",()=>({...ct.createDefaultProps(),pointed:!1,pointStyle:d.reactJson({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:1}),stroked:!1,strokeStyle:d.reactJson({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:d.reactJson({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),g(Va,"type",Va.register("ESLocalVector",Va,{chsName:"本地矢量",tags:["ESObjects"],description:"本地矢量对象"}));let Fa=Va;const Sl=class Sl extends Fa{};g(Sl,"type",Sl.register("ESLocalVector2D",Sl,{chsName:"本地矢量2D",tags:["ESObjects"],description:"本地矢量2D对象"}));let cs=Sl;const KP=[["固定朝向",0],["面向屏幕旋转",1],["绕自身Z轴旋转",2]],ZP=[["单面不透明",0],["双面不透明",1],["单面遮罩",2],["双面遮罩",3],["单面透明",4],["双面透明",5],["单面未遮挡透明",6],["双面未遮挡透明",7]],Ua=class Ua extends ct{constructor(){super(...arguments);g(this,"_widgetEvent",this.dv(new d.Event))}get widgetEvent(){return this._widgetEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new $([this,"screenRender"],"屏幕渲染",!0),new $([this,"sizeByContent"],"尺寸自适应",!0),new Ve([this,"size"],"尺寸大小",[100,100]),new Ve([this,"anchor"],"偏移比例",[.5,1]),new Ve([this,"offset"],"像素偏移",[0,0]),new bt([this,"renderMode"],ZP,"渲染模式",0),new bt([this,"rotationType"],KP,"漫游旋转类型",1),new _t([this,"actorTag"],"绑定对象"),new _t([this,"socketName"],"插槽名称"),new lr([this,"positionOffset"],"位置偏移"),new lr([this,"rotationOffset"],"相对姿态")],more:[...e.more,new L([this,"zOrder"],"排序",0)]}}};g(Ua,"createDefaultProps",()=>({...ct.createDefaultProps(),screenRender:!0,size:d.reactArray([100,100]),anchor:d.reactArray([.5,1]),offset:d.reactArray([0,0]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,actorTag:"",socketName:"",positionOffset:d.reactArray([0,0,0]),rotationOffset:d.reactArray([0,0,0])})),g(Ua,"type",Ua.register("ESLabel",Ua,{chsName:"标签",tags:["ESObjects"],description:"标签对象"}));let fn=Ua;const za=class za extends ht{constructor(t){super(t)}};g(za,"createDefaultProps",()=>({...ht.createDefaultProps(),show:!0,fillStyle:d.reactJson({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),g(za,"type",za.register("ESTestObject",za,{chsName:"测试",tags:["ESObjects"],description:""}));let Tf=za;const Vi=class Vi extends ee{constructor(e){super(e);g(this,"_refreshTilesetEvent",this.dv(new d.Event));g(this,"_tilesetReadyEvent",this.dv(new d.Event));g(this,"_supportEdit",this.dv(d.react(!0)));g(this,"_highlightFeatureEvent",this.dv(new d.Event));g(this,"_highlightFeatureAndFlyToEvent",this.dv(new d.Event));g(this,"_strokeFeatureEvent",this.disposeVar(new d.Event));g(this,"_getFeatureTableEvent",this.dv(new d.Event));g(this,"_featureTableResultEvent",this.dv(new d.Event));g(this,"_getMaterialNameListEvent",this.disposeVar(new d.Event));g(this,"_setFeatureStyleEvent",this.dv(new d.Event));g(this,"_setFeatureColorEvent",this.dv(new d.Event));g(this,"_setFeatureVisableEvent",this.dv(new d.Event));g(this,"_resetFeatureStyleEvent",this.dv(new d.Event));g(this,"setMaterialInfoEvent",this.ad(new d.Event));g(this,"_setMaterialEvent",this.disposeVar(new d.Event));g(this,"_clippingPlanesId",this.dv(d.react("")));g(this,"_clippingPlaneIds",this.dv(d.react([])));g(this,"_flattenedPlaneId",this.dv(d.react("")));g(this,"_flattenedPlaneEnabled",this.dv(d.react(!1)));g(this,"_clippingPlaneId",this.dv(d.react("")));g(this,"_excavateId",this.dv(d.reactArray([])))}updateEditing(){var e;(e=this.activeViewer)==null||e.startEditing(this,[lt.Translation,lt.Rotation],{callSource:"inner"})}get refreshTilesetEvent(){return this._refreshTilesetEvent}refreshTileset(){this._refreshTilesetEvent.emit()}get tilesetReady(){return this._tilesetReadyEvent}get supportEdit(){return this._supportEdit.value}set supportEdit(e){this._supportEdit.value=e}get supportEditChanged(){return this._supportEdit.changed}get highlightFeatureEvent(){return this._highlightFeatureEvent}highlightFeature(e,n){this._highlightFeatureEvent.emit(e,n)}get highlightFeatureAndFlyToEvent(){return this._highlightFeatureAndFlyToEvent}highlightFeatureAndFlyTo(e,n,i,s){this._highlightFeatureAndFlyToEvent.emit(e,n,i,s)}get strokeFeatureEvent(){return this._strokeFeatureEvent}strokeFeature(e,n=[1,0,0,1]){this._strokeFeatureEvent.emit(e,n)}get getFeatureTableEvent(){return this._getFeatureTableEvent}getFeatureTable(){return Promise.race([new Promise(e=>{const n=this.d(this._featureTableResultEvent.donce(e));this._getFeatureTableEvent.emit(),setTimeout(()=>{n(),e(void 0)},2e3)})])}get getMaterialNameListEvent(){return this._getMaterialNameListEvent}getMaterialNameList(){return new Promise(e=>{const n=new d.Destroyable;n.d(this.getMaterialNameListEvent.don(i=>{i!=="start"&&(n.destroy(),e(i))})),this.getMaterialNameListEvent.emit("start"),setTimeout(()=>{n.isDestroyed()||(n.destroy(),e(void 0))},2e3)})}get setFeatureStyleEvent(){return this._setFeatureStyleEvent}setFeatureStyle(e){this._setFeatureStyleEvent.emit(e)}get setFeatureColorEvent(){return this._setFeatureColorEvent}setFeatureColor(e,n){this._setFeatureColorEvent.emit(e,typeof n=="string"?JSON.parse(n):n)}get setFeatureVisableEvent(){return this._setFeatureVisableEvent}setFeatureVisable(e,n){this._setFeatureVisableEvent.emit(e,typeof n=="string"?JSON.parse(n):n)}get resetFeatureStyleEvent(){return this._resetFeatureStyleEvent}resetFeatureStyle(){this._resetFeatureStyleEvent.emit()}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){return new Promise(n=>{const i=new d.Destroyable;i.ad(this.setMaterialInfoEvent.donce(s=>{i.destroy(),n(s)})),this._setMaterialEvent.emit(e)})}get clippingPlanesId(){return this._clippingPlanesId.value}set clippingPlanesId(e){this._clippingPlanesId.value=e}get clippingPlanesIdChanged(){return this._clippingPlanesId.changed}get clippingPlaneIds(){return this._clippingPlaneIds.value}set clippingPlaneIds(e){this._clippingPlaneIds.value=e}get clippingPlaneIdsChanged(){return this._clippingPlaneIds.changed}get flattenedPlaneId(){return this._flattenedPlaneId.value}set flattenedPlaneId(e){this._flattenedPlaneId.value=e}get flattenedPlaneIdChanged(){return this._flattenedPlaneId.changed}get flattenedPlaneEnabled(){return this._flattenedPlaneEnabled.value}set flattenedPlaneEnabled(e){this._flattenedPlaneEnabled.value=e}get flattenedPlaneEnabledChanged(){return this._flattenedPlaneEnabled.changed}get clippingPlaneId(){return this._clippingPlaneId.value}set clippingPlaneId(e){this._clippingPlaneId.value=e}get clippingPlaneIdChanged(){return this._clippingPlaneId.changed}get excavateId(){return this._excavateId.value}set excavateId(e){this._excavateId.value=e}get excavateIdChanged(){return this._excavateId.changed}setLight122(){this.czmEnvironmentMapManager={...Pf}}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new Xe([this,"maximumScreenSpaceError"],1,[0,256],"精度",16),new bt([this,"materialMode"],[["常规","normal"],["科技感","technology"]],"材质模式","normal",!0),new bt([this,"colorBlendMode"],[["默认","HIGHLIGHT"],["替换","REPLACE"],["混合","MIX"]],"颜色模式","HIGHLIGHT"),new ut([this,"materialOverrideMap"],"材质替换",Vi.defaults.materialOverrideMap)],dataSource:[...e.dataSource,new ut([this,"url"],"服务地址",Vi.defaults.url,void 0,!0)],coordinate:[...e.coordinate,new $([this,"editing"],"编辑",!1,!0),new lr([this,"offset"],"偏移量",[0,0,0],!0),new ic([this,"rotation"],"旋转",[0,0,0])],more:[...e.more,new ut([this,"materialParams"],"materialParams",Vi.defaults.materialParams),new pt(["string","string"],(n,i)=>this.highlightFeature(n,i),["","rgba(255,0,0,1)"],"highlightFeature"),new pt(["string","string"],(n,i)=>this.setFeatureColor(n,i),["",""],"setFeatureColor"),new pt(["string","string"],(n,i)=>this.setFeatureVisable(n,i),["",""],"setFeatureVisable"),new pt([],()=>this.resetFeatureStyle(),[],"resetFeatureStyle"),new gt([],"ue"),new pt([],()=>this.refreshTileset(),[],"refreshTileset"),new _t([this,"actorTag"]),new $([this,"highlight"],"是否高亮"),new Rt([this,"highlightColor"]),new L([this,"highlightID"]),new gt([],"czm"),new gt([],"可视化"),new Ve([this,"czmImageBasedLightingFactor"],"反射强度"),new L([this,"czmAtmosphereScatteringIntensity"],"大气散射强度"),new ut([this,"czmEnvironmentMapManager"],"动态环境贴图管理器"),new L([this,"czmMaximumMemoryUsage"],"最大内存"),new gt([],"常用"),new bt([this,"czmClassificationType"],[["NONE","NONE"],["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]],"czmClassificationType","NONE",!0),new ut([this,"czmStyleJson"],"czmStyle"),new $([this,"czmBackFaceCulling"]),new $([this,"czmSkipLevelOfDetail"]),new L([this,"cacheBytes"],"最大缓存",536870912),new gt([],"调试信息"),new $([this,"czmDebugShowBoundingVolume"]),new $([this,"czmDebugShowContentBoundingVolume"]),new gt([],"clippingPlanes"),new $([this,"clippingPlaneEnabled"]),new $([this,"unionClippingRegions"]),new Rt([this,"clippingPlaneEdgeColor"]),new L([this,"clippingPlaneEdgeWidth"])]}}};g(Vi,"createDefaultProps",()=>({...ee.createDefaultProps(),url:"",actorTag:"",materialMode:"normal",highlight:!1,maximumScreenSpaceError:16,highlightID:0,highlightColor:d.reactArray([1,0,0,1]),offset:d.reactArrayWithUndefined([0,0,0]),rotation:d.reactArray([0,0,0]),czmImageBasedLightingFactor:d.reactArray([1,1]),czmEnvironmentMapManager:d.reactJsonWithUndefined(void 0),czmLuminanceAtZenith:2,czmAtmosphereScatteringIntensity:2,czmMaximumMemoryUsage:512,czmClassificationType:"NONE",czmStyleJson:d.reactJson({}),czmBackFaceCulling:!0,czmDebugShowBoundingVolume:!1,czmDebugShowContentBoundingVolume:!1,czmSkipLevelOfDetail:!1,cacheBytes:536870912,colorBlendMode:"HIGHLIGHT",clippingPlaneEnabled:!0,unionClippingRegions:!0,clippingPlaneEdgeColor:d.reactArray([1,1,1,1]),clippingPlaneEdgeWidth:2,materialParams:{baseColor:[0,.5,1]},allowPicking:!0,materialOverrideMap:d.reactJsonWithUndefined({}),featureIdLabel:0,splitDirection:"NONE"})),g(Vi,"type",Vi.register("ES3DTileset",Vi,{chsName:"3DTileset",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"3DTileset"})),g(Vi,"supportEditingModes",[...ee.supportEditingModes,lt.Translation,lt.Rotation]);let Fn=Vi;const qa=class qa extends ct{constructor(e){super(e);g(this,"_isFlyInCreated",this.dv(d.react(!1)));g(this,"_readyEvent",this.dv(new d.Event));this.collision=!1,this.d(this.createdEvent.don(()=>{setTimeout(()=>{if((this.editing??!1)||!this.position){const i=this.dv(d.createNextAnimateFrameEvent(this.positionChanged,this.editingChanged));this.d(i.donce(()=>{this.editing||!this.position||this.isFlyInCreated&&this.flyTo()}))}else{if(!this.isFlyInCreated)return;this.flyTo()}},1e3)}))}get isFlyInCreated(){return this._isFlyInCreated.value}set isFlyInCreated(e){this._isFlyInCreated.value=e}get isFlyInCreatedChanged(){return this._isFlyInCreated.changed}get readyEvent(){return this._readyEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new bt([this,"mode"],[["柱状警告","cylinder"],["圆形警告","circle"]],"模式","cylinder"),new L([this,"radius"],"半径",10)]}}};g(qa,"createDefaultProps",()=>({...ct.createDefaultProps(),mode:"cylinder",radius:10})),g(qa,"type",qa.register("ESAlarm",qa,{chsName:"报警",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警告类"}));let xf=qa;const bo=class bo extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new L([this,"radius"],"半径",1),new bt([this,"mode"],[["扫描","scan"],["扩散","diffuse"]],"模式",bo.defaults.mode)]}}};g(bo,"createDefaultProps",()=>({...ct.createDefaultProps(),radius:1,mode:"scan",collision:!1})),g(bo,"type",bo.register("ESApertureEffect",bo,{chsName:"光圈特效",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"光圈特效"}));let Of=bo;const To=class To extends Dt{constructor(e){super(e);g(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new L([this,"area"],"面积",0,!1,!0),new L([this,"perimeter"],"周长",0,!1,!0)]}}};g(To,"createDefaultProps",()=>({...Dt.createDefaultProps(),fillStyle:d.reactJson({color:[1,1,1,.5],material:"",materialParams:{},ground:!1}),strokeStyle:d.reactJson({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!0,stroked:!1,collision:!1})),g(To,"type",To.register("ESGeoPolygon",To,{chsName:"地理多边形",tags:["ESObjects"],description:"地理多边形"})),g(To,"supportEditingModes",[...Dt.supportEditingModes,lt.CircularAppend,lt.CircularInsert]);let ie=To;const fs=class fs extends ie{get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialParams(){return this.fillStyle?this.fillStyle.materialParams:fs.defaults.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle??fs.defaults.fillStyle,materialParams:t??fs.defaults.fillStyle.materialParams}}constructor(t){super(t)}};g(fs,"createDefaultProps",()=>({...ie.createDefaultProps(),stroked:!0,filled:!0,units:d.reactArray(["SquareMeter_SquareKilometer","MU_Hectare","PerimeterMeter_PerimeterKilometer"]),fillStyle:d.reactJson({color:[1,1,1,1],material:"Material'/EarthSDKForUE/M_ES_Material.M_ES_Material'",materialParams:{Opacity:.4},ground:!0}),strokeStyle:d.reactJson({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),g(fs,"type",fs.register("ESAreaMeasurement",fs,{chsName:"面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"面积测量"}));let Af=fs;const Wa=class Wa extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"general",more:[...t.more,new gt([],"czm"),new mu([this,"image"],"图片"),new lr([this,"translation"],"偏移")]}}};g(Wa,"createDefaultProps",()=>({...ct.createDefaultProps(),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",translation:d.reactArray([0,0,0])})),g(Wa,"type",Wa.register("ESBlastParticleSystem",Wa,{chsName:"粒子爆炸",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"粒子爆炸"}));let Df=Wa;const di=class di extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new $([this,"reverse"],"反转",di.defaults.reverse),new lr([this,"size"],"尺寸",di.defaults.size),new Rt([this,"edgeColor"],"边框颜色",di.defaults.edgeColor),new L([this,"edgeWidth"],"边框宽度",di.defaults.edgeWidth),new _t([this,"targetID"],"瓦片图层",di.defaults.targetID)]}}};g(di,"createDefaultProps",()=>({...ct.createDefaultProps(),reverse:!1,edgeColor:d.reactArray([1,1,1,1]),edgeWidth:2,size:d.reactArray([10,10,10]),targetID:""})),g(di,"type",di.register("ESBoxClipping",di,{chsName:"体剖切",tags:["ESObjects","_ES_Impl_Cesium"],description:"体剖切,体裁剪,体裁切,盒裁切"}));let Lf=di;const Cl=class Cl extends ct{constructor(){super(...arguments);g(this,"_thumbnail",this.dv(d.react("")));g(this,"_duration",this.dv(d.react(1)));g(this,"_resetWithCurrentCameraEvent",this.dv(new d.Event));g(this,"_captureEvent",this.dv(new d.Event))}get thumbnail(){return this._thumbnail.value}set thumbnail(e){this._thumbnail.value=e}get thumbnailChanged(){return this._thumbnail.changed}get duration(){return this._duration.value}set duration(e){this._duration.value=e}get durationChanged(){return this._duration.changed}flyIn(e=1,n="default"){this.flyInEvent.emit(e,-1,n)}get resetWithCurrentCameraEvent(){return this._resetWithCurrentCameraEvent}resetWithCurrentCamera(){this._resetWithCurrentCameraEvent.emit()}get captureEvent(){return this._captureEvent}capture(e,n){this._captureEvent.emit(e,n)}execOnCreating(){this.resetWithCurrentCamera()}async initByCurrent(){this.resetWithCurrentCamera()}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new gt([],"ESCameraView"),new pt([],()=>this.resetWithCurrentCamera(),[],"设置为当前视角"),new pt(["number","number"],(n,i)=>this.capture(n,i),[64,64],"获取缩略图"),new _t([this,"thumbnail"],"缩略图","",!0),new L([this,"duration"],"飞行时间",1,!0)]}}};g(Cl,"type",Cl.register("ESCameraView",Cl,{chsName:"视角",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角"}));let Rh=Cl;class Fh extends d.Destroyable{constructor(e,n,i){super();g(this,"_view",this.dv(new Rh));if(this.d(e.components.disposableAdd(this._view)),this._view.name=(i==null?void 0:i.name)??`视角${e.views.length+1}`,n){const a=this._view,u=n;a.duration=u.duration??1,a.position=u.position,a.rotation=u.rotation??[0,0,0],a.thumbnail=u.thumbnail??"",a.name=u.name}else{const a=(i==null?void 0:i.size)??[64,64];this.d(d.nextAnimateFrame(()=>{this._view.resetWithCurrentCamera(),this._view.capture(a[0],a[1])}))}const s=this._view,o=this.dv(d.createNextAnimateFrameEvent(s.durationChanged,s.positionChanged,s.rotationChanged,s.thumbnailChanged,s.nameChanged));this.d(o.don(()=>e.emitViewsWarpper()))}get view(){return this._view}get viewInfo(){const e=this._view;return{duration:e.duration,position:e.position,rotation:e.rotation,thumbnail:e.thumbnail,name:e.name}}}const kn=class kn extends ht{constructor(e){super(e);g(this,"_currentViewIndex",this.dv(d.react(-1)));g(this,"_viewWrappers",this.dv(new d.ObservableArray));g(this,"_currentViewWrapper",this.dv(d.react(void 0)));g(this,"_container",this.dv(d.react(void 0)));this.initProcessing();{const n=()=>{if(!this._currentViewWrapper.value)return;this._viewWrappers.indexOf(this._currentViewWrapper.value)===-1&&(this._currentViewWrapper.value=void 0)};n(),this.d(this._viewWrappers.changedEvent.don(n))}{const n=()=>{const i=this._currentViewWrapper.value;this._currentViewIndex.value=i?this._getIndex(i):-1};n(),this.d(this._viewWrappers.changedEvent.don(n)),this.d(this._currentViewWrapper.changed.don(n))}this.d(()=>{this.clearAllViews()})}get json(){return{...this._innerGetJson(),views:this.views}}set json(e){this._innerSetJson(e),this.views=e.views}get currentViewIndex(){return this._currentViewIndex.value}get currentViewIndexChanged(){return this._currentViewIndex.changed}emitViewsWarpper(){this._viewWrappers.changedEvent.emit(this._viewWrappers)}get container(){return this._container.value}get containerChanged(){return this._container.changed}set container(e){this._container.value=e}get views(){return _g(this._viewWrappers,e=>e.viewInfo)}get viewsChanged(){return this._viewWrappers.changedEvent}set views(e){if(e.length===this._viewWrappers.length){const n=this._viewWrappers;if(e.every((i,s)=>{const o=n.get(s).view;return i.duration===o.duration&&oc(i.position,o.position)&&oc(i.rotation,o.rotation)&&i.thumbnail===o.thumbnail&&i.name===o.name}))return}this.clearAllViews();for(let n of e)this._viewWrappers.push(new Fh(this,n))}_getIndex(e){return this._viewWrappers.indexOf(e)}clearAllViews(){for(let e of this._viewWrappers)e.destroy();this._viewWrappers.length=0}add(e=`视角${this.views.length+1}`,n=[64,64]){this._viewWrappers.push(new Fh(this,void 0,{name:e,size:n}))}update(e,n,i=[64,64]){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const s=this._viewWrappers.get(e);return n&&(s.view.name=n),s.view.resetWithCurrentCamera(),s.view.capture(i[0],i[1]),!0}addView(){this._viewWrappers.push(new Fh(this))}insertView(e){if(this._viewWrappers.length+1<=e||e<0){console.error("this._views.length <= index || index < 0");return}this._viewWrappers.splice(e,0,new Fh(this))}setCurrentView(e){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const n=this._viewWrappers.get(e);return this._currentViewWrapper.value=n,!0}resetView(e){if(e>=this._viewWrappers.length||e<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const n=this._viewWrappers.get(e);n.view.resetWithCurrentCamera(),n.view.capture()}resetViewName(e,n){if(e>=this._viewWrappers.length||e<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const i=this._viewWrappers.get(e);i.view.name=n}updateView(e,n){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const i=this._viewWrappers.get(e);return i.view.position=n.position,i.view.rotation=n.rotation??[0,0,0],i.view.duration=n.duration??1,i.view.thumbnail=n.thumbnail??"",i.view.name=n.name??"",!0}flyToView(e){if(this.setCurrentView(e)){if(!this._currentViewWrapper.value)throw new Error("this._currentViewWrapper.value");const n=this._currentViewWrapper.value.view.duration;this._currentViewWrapper.value.view.flyIn(n,this.flyMode??kn.defaults.flyMode)}}flyToPrevView(){const e=this._currentViewWrapper.value;if(!e)return this.flyToView(0),!0;const n=this._getIndex(e);return this.loop??kn.defaults.loop?(this.flyToView((this._viewWrappers.length+n-1)%this._viewWrappers.length),!0):n-1<0?!1:(this.flyToView(n-1),!0)}moveToPreView(){const e=this._currentViewWrapper.value;if(!e)return;const n=this._getIndex(e);if(n===0)return;const i=this._viewWrappers.splice(n-1,1,e)[0];this._viewWrappers.set(n,i)}moveToNextView(){const e=this._currentViewWrapper.value;if(!e)return;const n=this._getIndex(e);if(n===this._viewWrappers.length-1)return;const i=this._viewWrappers.splice(n+1,1,e)[0];this._viewWrappers.set(n,i)}flyToNextView(){const e=this._currentViewWrapper.value;if(!e)return this.flyToView(0),!0;const n=this._getIndex(e);return this.loop??kn.defaults.loop?(this.flyToView((n+1)%this._viewWrappers.length),!0):n+1>this._viewWrappers.length-1?!1:(this.flyToView(n+1),!0)}stop(){this._currentViewWrapper.value=void 0,this.playing=!1}deleteView(e){if(e<0||e>=this._viewWrappers.length){console.warn("index < 0 || index >= this._viewWrappers.length");return}this._viewWrappers.get(e).destroy(),this._viewWrappers.splice(e,1)}deleteCurrentView(){const e=this._currentViewWrapper.value;if(!e){console.warn("!this._currentViewWrapper.value");return}const n=this._getIndex(e);if(n===-1){console.warn("index === -1");return}this.deleteView(n)}transitionImageUrl(e){return ht.context.getStrFromEnv(e)}_flyStep(e){var o;if(!this.flyToNextView())return this.playing=!1,Promise.resolve();const n=this.intervalTime??kn.defaults.intervalTime,s=((((o=this._currentViewWrapper.value)==null?void 0:o.viewInfo.duration)??0)+n)*1e3;return e.promise(d.sleep(s)).then(()=>this._flyStep(e))}initProcessing(){const e=this.dv(d.createProcessingFromAsyncFunc(async i=>this._flyStep(i))),n=()=>{this.playing?e.restart():e.cancel()};n(),this.d(this.playingChanged.don(n))}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new bt([this,"flyMode"],[["默认","default"],["直线飞行","uniform"]],"飞行模式",kn.defaults.flyMode),new pt([],()=>this.addView(),[],"添加视角"),new pt(["number"],n=>this.insertView(n),[0],"插入视角"),new pt([],()=>this.clearAllViews(),[],"清空所有视角"),new pt([],()=>this.insertView(this.currentViewIndex+1),[],"当前位置插入视角"),new pt([],()=>this.flyToPrevView(),[],"上一个视角"),new pt([],()=>this.flyToNextView(),[],"下一个视角"),new pt([],()=>this.moveToPreView(),[],"当前视角移动到上一个视角"),new pt([],()=>this.moveToNextView(),[],"当前视角移动到下一个视角"),new pt(["number"],n=>this.flyToView(n),[0],"飞入指定视角"),new pt(["number"],n=>this.setCurrentView(n),[0],"设置当前视角"),new pt([],()=>this.deleteCurrentView(),[],"删除当前视角"),new pt(["number"],n=>this.deleteView(n),[0],"删除指定视角"),new pt(["number"],n=>this.resetView(n),[0],"重置视角"),new L([this,"currentViewIndex"],"当前序号",-1,!1,!0),new gg([this,"playing"],()=>this.stop(),[this,"loop"],"播放",kn.defaults),new $([this,"playing"],"是否播放"),new pt([],()=>this.stop(),[],"停止"),new $([this,"loop"],"是否循环"),new L([this,"intervalTime"],"间隔时间"),new ut([this,"views"],"视角集合",[],void 0,!0)]}}};g(kn,"createDefaultProps",()=>({...ht.createDefaultProps(),playing:!1,loop:!0,intervalTime:5,flyMode:"default"})),g(kn,"type",kn.register("ESCameraViewCollection",kn,{chsName:"视角集合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角集合"}));let Gh=kn;const Xa=class Xa extends ct{constructor(e){super(e);g(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new L([this,"aspectRatio"],"宽高比",1.77778),new L([this,"fov"],"横向夹角",90),new L([this,"far"],"视野长度",100),new L([this,"near"],"近面距离",5)]}}};g(Xa,"createDefaultProps",()=>({...ct.createDefaultProps(),fov:90,aspectRatio:1.77778,far:100,near:5,collision:!1})),g(Xa,"type",Xa.register("ESCameraVisibleRange",Xa,{chsName:"摄像头可视域",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"摄像头可视域"}));let Rf=Xa;const Ha=class Ha extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new bt([this,"mode"],[["警车","policeCar"]],"模式","policeCar")]}}};g(Ha,"createDefaultProps",()=>({...ct.createDefaultProps(),mode:"policeCar",allowPicking:!0})),g(Ha,"type",Ha.register("ESCar",Ha,{chsName:"车辆",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警车等基础车辆模型"}));let Ff=Ha;const xo=class xo extends Dt{constructor(e){super(e);g(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new L([this,"height"],"高度",10)],coordinate:[...e.coordinate,new L([this,"area"],"面积",0,!1,!0),new L([this,"perimeter"],"周长",0,!1,!0)]}}};g(xo,"createDefaultProps",()=>({...Dt.createDefaultProps(),height:10,filled:!0,fillStyle:d.reactJson({material:"",materialParams:{},ground:!0,color:[1,1,1,1]})})),g(xo,"type",xo.register("ESClassification",xo,{chsName:"倾斜单体化",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"平尾箭头"})),g(xo,"supportEditingModes",[...Dt.supportEditingModes,lt.CircularAppend,lt.CircularInsert,lt.HeightModify]);let kh=xo;const Ya=class Ya extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new $([this,"showArrow"],"显示箭头",!0),new Rt([this,"edgeColor"],"线框颜色",[1,1,1,1]),new L([this,"edgetWidth"],"线框宽度",2),new L([this,"width"],"裁剪宽度",200),new L([this,"height"],"裁剪高度",200),new _t([this,"targetID"],"瓦片图层","")]}}};g(Ya,"createDefaultProps",()=>({...ct.createDefaultProps(),showArrow:!0,edgeColor:d.reactArray([1,1,1,1]),edgetWidth:2,width:200,height:200,targetID:""})),g(Ya,"type",Ya.register("ESClippingPlane",Ya,{chsName:"裁切",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESClippingPlane"}));let Gf=Ya;class $P extends d.Destroyable{constructor(t,e,n){super();const i=document.createElement("div");i.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${n.id}) container`);{const u=()=>{const h=` ${e.cssText}
68
+ `)}return t.toString()},Ce.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.computeLabel(t)}},Ce.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var n=[!1,!1],i=this.iterator();i.hasNext();)for(var s=i.next(),o=s.getLabel(),a=0;a<2;a++)o.isLine(a)&&o.getLocation(a)===O.BOUNDARY&&(n[a]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),h=l.getLabel(),c=0;c<2;c++)if(h.isAnyNull(c)){var f=O.NONE;if(n[c])f=O.EXTERIOR;else{var p=l.getCoordinate();f=e.getLocation(c,p,t)}h.setAllLocationsIfNull(c,f)}},Ce.prototype.getDegree=function(){return this._edgeMap.size()},Ce.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce};var uI=(function(r){function t(){r.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var n=this;this.getResultAreaEdges();for(var i=null,s=null,o=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var u=n._resultAreaEdgeList.get(a),l=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),o){case n._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;s=l,o=n._LINKING_TO_OUTGOING;break;case n._LINKING_TO_OUTGOING:if(!u.isInResult())continue;s.setNext(u),o=n._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(i===null)throw new li("no outgoing dirEdge found",this.getCoordinate());ut.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),s.setNext(i)}},t.prototype.insert=function(n){var i=n;this.insertEdgeEnd(i,i)},t.prototype.getRightmostEdge=function(){var n=this.getEdges(),i=n.size();if(i<1)return null;var s=n.get(0);if(i===1)return s;var o=n.get(i-1),a=s.getQuadrant(),u=o.getQuadrant();return Mt.isNorthern(a)&&Mt.isNorthern(u)?s:!Mt.isNorthern(a)&&!Mt.isNorthern(u)?o:s.getDy()!==0?s:o.getDy()!==0?o:(ut.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(n){fe.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var s=i.next();n.print("out "),s.print(n),n.println(),n.print("in "),s.getSym().print(n),n.println()}},t.prototype.getResultAreaEdges=function(){var n=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new G;for(var i=this.iterator();i.hasNext();){var s=i.next();(s.isInResult()||s.getSym().isInResult())&&n._resultAreaEdgeList.add(s)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(n){for(var i=this.iterator();i.hasNext();){var s=i.next(),o=s.getLabel();o.setAllLocationsIfNull(0,n.getLocation(0)),o.setAllLocationsIfNull(1,n.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var n=this;this.getEdges();for(var i=null,s=null,o=this._edgeList.size()-1;o>=0;o--){var a=n._edgeList.get(o),u=a.getSym();s===null&&(s=u),i!==null&&u.setNext(i),i=a}s.setNext(i)},t.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var i=arguments[0],s=this.findIndex(i),o=i.getDepth(U.LEFT),a=i.getDepth(U.RIGHT),u=this.computeDepths(s+1,this._edgeList.size(),o),l=this.computeDepths(0,s,u);if(l!==a)throw new li("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var h=arguments[0],c=arguments[1],f=arguments[2],p=f,m=h;m<c;m++){var _=n._edgeList.get(m);_.setEdgeDepths(U.RIGHT,p),p=_.getDepth(U.LEFT)}return p}},t.prototype.mergeSymLabels=function(){for(var n=this.iterator();n.hasNext();){var i=n.next(),s=i.getLabel();s.merge(i.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(n){for(var i=this,s=null,o=null,a=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=i._resultAreaEdgeList.get(u),h=l.getSym();switch(s===null&&l.getEdgeRing()===n&&(s=l),a){case i._SCANNING_FOR_INCOMING:if(h.getEdgeRing()!==n)continue;o=h,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==n)continue;o.setNextMin(l),a=i._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(ut.isTrue(s!==null,"found null for first outgoing dirEdge"),ut.isTrue(s.getEdgeRing()===n,"unable to link last incoming dirEdge"),o.setNextMin(s))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,i=this.iterator();i.hasNext();){var s=i.next();s.isInResult()&&n++}return n}else if(arguments.length===1){for(var o=arguments[0],a=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===o&&a++}return a}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var n=O.NONE,i=this.iterator();i.hasNext();){var s=i.next(),o=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){n=O.INTERIOR;break}if(o.isInResult()){n=O.EXTERIOR;break}}}if(n===O.NONE)return null;for(var a=n,u=this.iterator();u.hasNext();){var l=u.next(),h=l.getSym();l.isLineEdge()?l.getEdge().setCovered(a===O.INTERIOR):(l.isInResult()&&(a=O.EXTERIOR),h.isInResult()&&(a=O.INTERIOR))}},t.prototype.computeLabelling=function(n){var i=this;r.prototype.computeLabelling.call(this,n),this._label=new Pt(O.NONE);for(var s=this.iterator();s.hasNext();)for(var o=s.next(),a=o.getEdge(),u=a.getLabel(),l=0;l<2;l++){var h=u.getLocation(l);(h===O.INTERIOR||h===O.BOUNDARY)&&i._label.setLocation(l,O.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Ce),Cm=(function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.createNode=function(n){return new $l(n,new uI)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(ta),Ai=function r(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=r.orientation(t)};Ai.prototype.compareTo=function(t){var e=t,n=Ai.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return n},Ai.prototype.interfaces_=function(){return[Pr]},Ai.prototype.getClass=function(){return Ai},Ai.orientation=function(t){return ft.increasingDirection(t)===1},Ai.compareOriented=function(t,e,n,i){for(var s=e?1:-1,o=i?1:-1,a=e?t.length:-1,u=i?n.length:-1,l=e?0:t.length-1,h=i?0:n.length-1;;){var c=t[l].compareTo(n[h]);if(c!==0)return c;l+=s,h+=o;var f=l===a,p=h===u;if(f&&!p)return-1;if(!f&&p)return 1;if(f&&p)return 0}};var Wr=function(){this._edges=new G,this._ocaMap=new Ee};Wr.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var n=0;n<this._edges.size();n++){var i=e._edges.get(n);n>0&&t.print(","),t.print("(");for(var s=i.getCoordinates(),o=0;o<s.length;o++)o>0&&t.print(","),t.print(s[o].x+" "+s[o].y);t.println(")")}t.print(") ")},Wr.prototype.addAll=function(t){for(var e=this,n=t.iterator();n.hasNext();)e.add(n.next())},Wr.prototype.findEdgeIndex=function(t){for(var e=this,n=0;n<this._edges.size();n++)if(e._edges.get(n).equals(t))return n;return-1},Wr.prototype.iterator=function(){return this._edges.iterator()},Wr.prototype.getEdges=function(){return this._edges},Wr.prototype.get=function(t){return this._edges.get(t)},Wr.prototype.findEqualEdge=function(t){var e=new Ai(t.getCoordinates()),n=this._ocaMap.get(e);return n},Wr.prototype.add=function(t){this._edges.add(t);var e=new Ai(t.getCoordinates());this._ocaMap.put(e,t)},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr};var hs=function(){};hs.prototype.processIntersections=function(t,e,n,i){},hs.prototype.isDone=function(){},hs.prototype.interfaces_=function(){return[]},hs.prototype.getClass=function(){return hs};var vr=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};vr.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&this._li.getIntersectionNum()===1){if(vr.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var s=t.size()-1;if(e===0&&i===s||i===0&&e===s)return!0}}return!1},vr.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},vr.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},vr.prototype.getLineIntersector=function(){return this._li},vr.prototype.hasProperIntersection=function(){return this._hasProper},vr.prototype.processIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var s=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},vr.prototype.hasIntersection=function(){return this._hasIntersection},vr.prototype.isDone=function(){return!1},vr.prototype.hasInteriorIntersection=function(){return this._hasInterior},vr.prototype.interfaces_=function(){return[hs]},vr.prototype.getClass=function(){return vr},vr.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var cn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new x(t),this.segmentIndex=e,this.dist=n};cn.prototype.getSegmentIndex=function(){return this.segmentIndex},cn.prototype.getCoordinate=function(){return this.coord},cn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},cn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},cn.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},cn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},cn.prototype.getDistance=function(){return this.dist},cn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},cn.prototype.interfaces_=function(){return[Pr]},cn.prototype.getClass=function(){return cn};var Vn=function(){this._nodeMap=new Ee,this.edge=null;var t=arguments[0];this.edge=t};Vn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Vn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Vn.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next(),o=e.createSplitEdge(i,s);t.add(o),i=s}},Vn.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Vn.prototype.createSplitEdge=function(t,e){var n=this,i=e.segmentIndex-t.segmentIndex+2,s=this.edge.pts[e.segmentIndex],o=e.dist>0||!e.coord.equals2D(s);o||i--;var a=new Array(i).fill(null),u=0;a[u++]=new x(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=n.edge.pts[l];return o&&(a[u]=e.coord),new Zl(a,new Pt(this.edge._label))},Vn.prototype.add=function(t,e,n){var i=new cn(t,e,n),s=this._nodeMap.get(i);return s!==null?s:(this._nodeMap.put(i,i),i)},Vn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();if(n.coord.equals(t))return!0}return!1},Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn};var cs=function(){};cs.prototype.getChainStartIndices=function(t){var e=this,n=0,i=new G;i.add(new Zr(n));do{var s=e.findChainEnd(t,n);i.add(new Zr(s)),n=s}while(n<t.length-1);var o=cs.toIntArray(i);return o},cs.prototype.findChainEnd=function(t,e){for(var n=Mt.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var s=Mt.quadrant(t[i-1],t[i]);if(s!==n)break;i++}return i-1},cs.prototype.interfaces_=function(){return[]},cs.prototype.getClass=function(){return cs},cs.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var fi=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new J,this.env2=new J;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new cs;this.startIndex=e.getChainStartIndices(this.pts)};fi.prototype.getCoordinates=function(){return this.pts},fi.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},fi.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},fi.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],i)}else if(arguments.length===6){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],h=arguments[5],c=this.pts[s],f=this.pts[o],p=a.pts[u],m=a.pts[l];if(o-s===1&&l-u===1)return h.addIntersections(this.e,s,a.e,u),null;if(this.env1.init(c,f),this.env2.init(p,m),!this.env1.intersects(this.env2))return null;var _=Math.trunc((s+o)/2),E=Math.trunc((u+l)/2);s<_&&(u<E&&this.computeIntersectsForChain(s,_,a,u,E,h),E<l&&this.computeIntersectsForChain(s,_,a,E,l,h)),_<o&&(u<E&&this.computeIntersectsForChain(_,o,a,u,E,h),E<l&&this.computeIntersectsForChain(_,o,a,E,l,h))}},fi.prototype.getStartIndexes=function(){return this.startIndex},fi.prototype.computeIntersects=function(t,e){for(var n=this,i=0;i<this.startIndex.length-1;i++)for(var s=0;s<t.startIndex.length-1;s++)n.computeIntersectsForChain(i,t,s,e)},fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi};var de=function r(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var n=0;n<3;n++)t._depth[e][n]=r.NULL_VALUE},Im={NULL_VALUE:{configurable:!0}};de.prototype.getDepth=function(t,e){return this._depth[t][e]},de.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},de.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var n=0;n<3;n++)if(t._depth[e][n]!==de.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===de.NULL_VALUE}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._depth[s][o]===de.NULL_VALUE}},de.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var n=t._depth[e][1];t._depth[e][2]<n&&(n=t._depth[e][2]),n<0&&(n=0);for(var i=1;i<3;i++){var s=0;t._depth[e][i]>n&&(s=1),t._depth[e][i]=s}}},de.prototype.getDelta=function(t){return this._depth[t][U.RIGHT]-this._depth[t][U.LEFT]},de.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?O.EXTERIOR:O.INTERIOR},de.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},de.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],n=0;n<2;n++)for(var i=1;i<3;i++){var s=e.getLocation(n,i);(s===O.EXTERIOR||s===O.INTERIOR)&&(t.isNull(n,i)?t._depth[n][i]=de.depthAtLocation(s):t._depth[n][i]+=de.depthAtLocation(s))}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];u===O.INTERIOR&&this._depth[o][a]++}},de.prototype.interfaces_=function(){return[]},de.prototype.getClass=function(){return de},de.depthAtLocation=function(t){return t===O.EXTERIOR?0:t===O.INTERIOR?1:de.NULL_VALUE},Im.NULL_VALUE.get=function(){return-1},Object.defineProperties(de,Im);var Zl=(function(r){function t(){if(r.call(this),this.pts=null,this._env=null,this.eiList=new Vn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new de,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.pts=n,this._label=i}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var i=new t(n,Pt.toLineLabel(this._label));return i},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(n){this._isIsolated=n},t.prototype.setName=function(n){this._name=n},t.prototype.equals=function(n){var i=this;if(!(n instanceof t))return!1;var s=n;if(this.pts.length!==s.pts.length)return!1;for(var o=!0,a=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(i.pts[l].equals2D(s.pts[l])||(o=!1),i.pts[l].equals2D(s.pts[--u])||(a=!1),!o&&!a)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},t.prototype.print=function(n){var i=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&n.print(","),n.print(i.pts[s].x+" "+i.pts[s].y);n.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(n){t.updateIM(this._label,n)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(n){var i=this;n.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)n.print(i.pts[s]+" ");n.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new fi(this)),this._mce},t.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new J;for(var i=0;i<this.pts.length;i++)n._env.expandToInclude(n.pts[i])}return this._env},t.prototype.addIntersection=function(n,i,s,o){var a=new x(n.getIntersection(o)),u=i,l=n.getEdgeDistance(s,o),h=u+1;if(h<this.pts.length){var c=this.pts[h];a.equals2D(c)&&(u=h,l=0)}this.eiList.add(a,u,l)},t.prototype.toString=function(){var n=this,i=new Kr;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&i.append(","),i.append(n.pts[s].x+" "+n.pts[s].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},t.prototype.isPointwiseEqual=function(n){var i=this;if(this.pts.length!==n.pts.length)return!1;for(var s=0;s<this.pts.length;s++)if(!i.pts[s].equals2D(n.pts[s]))return!1;return!0},t.prototype.setDepthDelta=function(n){this._depthDelta=n},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(n,i,s){for(var o=this,a=0;a<n.getIntersectionNum();a++)o.addIntersection(n,i,s,a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];i.setAtLeastIfValid(n.getLocation(0,U.ON),n.getLocation(1,U.ON),1),n.isArea()&&(i.setAtLeastIfValid(n.getLocation(0,U.LEFT),n.getLocation(1,U.LEFT),2),i.setAtLeastIfValid(n.getLocation(0,U.RIGHT),n.getLocation(1,U.RIGHT),2))}else return r.prototype.updateIM.apply(this,arguments)},t})(pr),Oe=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Wr,this._bufParams=t||null};Oe.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},Oe.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new Pt(t.getLabel()),i.flip()),n.merge(i);var s=Oe.depthDelta(i),o=e.getDepthDelta(),a=o+s;e.setDepthDelta(a)}else this._edgeList.add(t),t.setDepthDelta(Oe.depthDelta(t.getLabel()))},Oe.prototype.buildSubgraphs=function(t,e){for(var n=new G,i=t.iterator();i.hasNext();){var s=i.next(),o=s.getRightmostCoordinate(),a=new Bs(n),u=a.getDepth(o);s.computeDepth(u),s.findResultEdges(),n.add(s),e.add(s.getDirectedEdges(),s.getNodes())}},Oe.prototype.createSubgraphs=function(t){for(var e=new G,n=t.getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isVisited()){var s=new Ne;s.create(i),e.add(s)}}return qr.sort(e,qr.reverseOrder()),e},Oe.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},Oe.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new Wc,n=new is;return n.setPrecisionModel(t),e.setSegmentIntersector(new vr(n)),e},Oe.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;n===null&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new We(n,this._bufParams),s=new Or(t,e,i),o=s.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,n),this._graph=new qt(new Cm),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),u=new tr(this._geomFact);this.buildSubgraphs(a,u);var l=u.getPolygons();if(l.size()<=0)return this.createEmptyResultGeometry();var h=this._geomFact.buildGeometry(l);return h},Oe.prototype.computeNodedEdges=function(t,e){var n=this,i=this.getNoder(e);i.computeNodes(t);for(var s=i.getNodedSubstrings(),o=s.iterator();o.hasNext();){var a=o.next(),u=a.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=a.getData(),h=new Zl(a.getCoordinates(),new Pt(l));n.insertUniqueEdge(h)}}},Oe.prototype.setNoder=function(t){this._workingNoder=t},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},Oe.depthDelta=function(t){var e=t.getLocation(0,U.LEFT),n=t.getLocation(0,U.RIGHT);return e===O.INTERIOR&&n===O.EXTERIOR?1:e===O.EXTERIOR&&n===O.INTERIOR?-1:0},Oe.convertSegStrings=function(t){for(var e=new dt,n=new G;t.hasNext();){var i=t.next(),s=e.createLineString(i.getCoordinates());n.add(s)}return e.buildGeometry(n)};var Li=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=i,this._offsetX=s,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};Li.prototype.rescale=function(){var t=this;if(rt(arguments[0],ee))for(var e=arguments[0],n=e.iterator();n.hasNext();){var i=n.next();t.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var s=arguments[0],o=0;o<s.length;o++)s[o].x=s[o].x/t._scaleFactor+t._offsetX,s[o].y=s[o].y/t._scaleFactor+t._offsetY;s.length===2&&s[0].equals2D(s[1])&&fe.out.println(s)}},Li.prototype.scale=function(){var t=this;if(rt(arguments[0],ee)){for(var e=arguments[0],n=new G,i=e.iterator();i.hasNext();){var s=i.next();n.add(new Jt(t.scale(s.getCoordinates()),s.getData()))}return n}else if(arguments[0]instanceof Array){for(var o=arguments[0],a=new Array(o.length).fill(null),u=0;u<o.length;u++)a[u]=new x(Math.round((o[u].x-t._offsetX)*t._scaleFactor),Math.round((o[u].y-t._offsetY)*t._scaleFactor),o[u].z);var l=ft.removeRepeatedPoints(a);return l}},Li.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},Li.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},Li.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},Li.prototype.interfaces_=function(){return[us]},Li.prototype.getClass=function(){return Li};var fn=function(){this._li=new is,this._segStrings=null;var t=arguments[0];this._segStrings=t},Pm={fact:{configurable:!0}};fn.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next(),i=n.getCoordinates();t.checkEndPtVertexIntersections(i[0],t._segStrings),t.checkEndPtVertexIntersections(i[i.length-1],t._segStrings)}else if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=o.iterator();a.hasNext();)for(var u=a.next(),l=u.getCoordinates(),h=1;h<l.length-1;h++)if(l[h].equals(s))throw new ni("found endpt/interior pt intersection at index "+h+" :pt "+s)}},fn.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var n=e.next(),i=this._segStrings.iterator();i.hasNext();){var s=i.next();t.checkInteriorIntersections(n,s)}else if(arguments.length===2)for(var o=arguments[0],a=arguments[1],u=o.getCoordinates(),l=a.getCoordinates(),h=0;h<u.length-1;h++)for(var c=0;c<l.length-1;c++)t.checkInteriorIntersections(o,h,a,c);else if(arguments.length===4){var f=arguments[0],p=arguments[1],m=arguments[2],_=arguments[3];if(f===m&&p===_)return null;var E=f.getCoordinates()[p],C=f.getCoordinates()[p+1],v=m.getCoordinates()[_],y=m.getCoordinates()[_+1];if(this._li.computeIntersection(E,C,v,y),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,E,C)||this.hasInteriorIntersection(this._li,v,y)))throw new ni("found non-noded intersection at "+E+"-"+C+" and "+v+"-"+y)}},fn.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},fn.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next();t.checkCollapses(n)}else if(arguments.length===1)for(var i=arguments[0],s=i.getCoordinates(),o=0;o<s.length-2;o++)t.checkCollapse(s[o],s[o+1],s[o+2])},fn.prototype.hasInteriorIntersection=function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++){var s=t.getIntersection(i);if(!(s.equals(e)||s.equals(n)))return!0}return!1},fn.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new ni("found non-noded collapse at "+fn.fact.createLineString([t,e,n]))},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn},Pm.fact.get=function(){return new dt},Object.defineProperties(fn,Pm);var Xe=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new zt("Scale factor must be non-zero");e!==1&&(this._pt=new x(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new x,this._p1Scaled=new x),this.initCorners(this._pt)},Mm={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};Xe.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),i=Math.max(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.y,e.y),a=this._maxx<n||this._minx>i||this._maxy<s||this._miny>o;if(a)return!1;var u=this.intersectsToleranceSquare(t,e);return ut.isTrue(!(a&&u),"Found bad envelope test"),u},Xe.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new x(this._maxx,this._maxy),this._corner[1]=new x(this._minx,this._maxy),this._corner[2]=new x(this._minx,this._miny),this._corner[3]=new x(this._maxx,this._miny)},Xe.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},Xe.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},Xe.prototype.getCoordinate=function(){return this._originalPt},Xe.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},Xe.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=Xe.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new J(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},Xe.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))},Xe.prototype.intersectsToleranceSquare=function(t,e){var n=!1,i=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||n&&i||t.equals(this._pt)||e.equals(this._pt))},Xe.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return this.intersects(n,i)?(t.addIntersection(this.getCoordinate(),e),!0):!1},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe},Mm.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(Xe,Mm);var qu=function(){this.tempEnv1=new J,this.selectedSegment=new j};qu.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}},qu.prototype.interfaces_=function(){return[]},qu.prototype.getClass=function(){return qu};var ia=function(){this._index=null;var t=arguments[0];this._index=t},bm={HotPixelSnapAction:{configurable:!0}};ia.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2],s=e.getSafeEnvelope(),o=new xm(e,n,i);return this._index.query(s,{interfaces_:function(){return[Oi]},visitItem:function(a){var u=a;u.select(s,o)}}),o.isNodeAdded()}},ia.prototype.interfaces_=function(){return[]},ia.prototype.getClass=function(){return ia},bm.HotPixelSnapAction.get=function(){return xm},Object.defineProperties(ia,bm);var xm=(function(r){function t(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=i}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1],s=n.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,i)}else return r.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(qu),Hs=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new G};Hs.prototype.processIntersections=function(t,e,n,i){var s=this;if(t===n&&e===i)return null;var o=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];if(this._li.computeIntersection(o,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var h=0;h<this._li.getIntersectionNum();h++)s._interiorIntersections.add(s._li.getIntersection(h));t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)}},Hs.prototype.isDone=function(){return!1},Hs.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Hs.prototype.interfaces_=function(){return[hs]},Hs.prototype.getClass=function(){return Hs};var Un=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new is,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};Un.prototype.checkCorrectness=function(t){var e=Jt.getNodedSubstrings(t),n=new fn(e);try{n.checkValid()}catch(i){if(i instanceof am)i.printStackTrace();else throw i}finally{}},Un.prototype.getNodedSubstrings=function(){return Jt.getNodedSubstrings(this._nodedSegStrings)},Un.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},Un.prototype.findInteriorIntersections=function(t,e){var n=new Hs(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},Un.prototype.computeVertexSnaps=function(){var t=this;if(rt(arguments[0],ee))for(var e=arguments[0],n=e.iterator();n.hasNext();){var i=n.next();t.computeVertexSnaps(i)}else if(arguments[0]instanceof Jt)for(var s=arguments[0],o=s.getCoordinates(),a=0;a<o.length;a++){var u=new Xe(o[a],t._scaleFactor,t._li),l=t._pointSnapper.snap(u,s,a);l&&s.addIntersection(o[a],a)}},Un.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new Wc,this._pointSnapper=new ia(this._noder.getIndex()),this.snapRound(t,this._li)},Un.prototype.computeIntersectionSnaps=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next(),s=new Xe(i,e._scaleFactor,e._li);e._pointSnapper.snap(s)}},Un.prototype.interfaces_=function(){return[us]},Un.prototype.getClass=function(){return Un};var pe=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Ct,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},sa={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};pe.prototype.bufferFixedPrecision=function(t){var e=new Li(new Un(new St(1)),t.getScale()),n=new Oe(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},pe.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=pe.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(o){if(o instanceof li)t._saveException=o;else throw o}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],i=pe.precisionScaleFactor(this._argGeom,this._distance,n),s=new St(i);this.bufferFixedPrecision(s)}},pe.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===St.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},pe.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},pe.prototype.bufferOriginalPrecision=function(){try{var t=new Oe(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof ni)this._saveException=e;else throw e}finally{}},pe.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},pe.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe},pe.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new pe(t),i=n.getResultGeometry(e);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof tt&&typeof arguments[1]=="number"){var s=arguments[0],o=arguments[1],a=arguments[2],u=new pe(s);u.setQuadrantSegments(a);var l=u.getResultGeometry(o);return l}else if(arguments[2]instanceof Ct&&arguments[0]instanceof tt&&typeof arguments[1]=="number"){var h=arguments[0],c=arguments[1],f=arguments[2],p=new pe(h,f),m=p.getResultGeometry(c);return m}}else if(arguments.length===4){var _=arguments[0],E=arguments[1],C=arguments[2],v=arguments[3],y=new pe(_);y.setQuadrantSegments(C),y.setEndCapStyle(v);var w=y.getResultGeometry(E);return w}},pe.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),s=dr.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),o=e>0?e:0,a=s+2*o,u=Math.trunc(Math.log(a)/Math.log(10)+1),l=n-u,h=Math.pow(10,l);return h},sa.CAP_ROUND.get=function(){return Ct.CAP_ROUND},sa.CAP_BUTT.get=function(){return Ct.CAP_FLAT},sa.CAP_FLAT.get=function(){return Ct.CAP_FLAT},sa.CAP_SQUARE.get=function(){return Ct.CAP_SQUARE},sa.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(pe,sa);var De=function(){this._pt=[new x,new x],this._distance=st.NaN,this._isNull=!0};De.prototype.getCoordinates=function(){return this._pt},De.prototype.getCoordinate=function(t){return this._pt[t]},De.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},De.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},De.prototype.getDistance=function(){return this._distance},De.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De};var zn=function(){};zn.prototype.interfaces_=function(){return[]},zn.prototype.getClass=function(){return zn},zn.computeDistance=function(){if(arguments[2]instanceof De&&arguments[0]instanceof Wt&&arguments[1]instanceof x)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=t.getCoordinates(),s=new j,o=0;o<i.length-1;o++){s.setCoordinates(i[o],i[o+1]);var a=s.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof De&&arguments[0]instanceof re&&arguments[1]instanceof x){var u=arguments[0],l=arguments[1],h=arguments[2];zn.computeDistance(u.getExteriorRing(),l,h);for(var c=0;c<u.getNumInteriorRing();c++)zn.computeDistance(u.getInteriorRingN(c),l,h)}else if(arguments[2]instanceof De&&arguments[0]instanceof tt&&arguments[1]instanceof x){var f=arguments[0],p=arguments[1],m=arguments[2];if(f instanceof Wt)zn.computeDistance(f,p,m);else if(f instanceof re)zn.computeDistance(f,p,m);else if(f instanceof xe)for(var _=f,E=0;E<_.getNumGeometries();E++){var C=_.getGeometryN(E);zn.computeDistance(C,p,m)}else m.setMinimum(f.getCoordinate(),p)}else if(arguments[2]instanceof De&&arguments[0]instanceof j&&arguments[1]instanceof x){var v=arguments[0],y=arguments[1],w=arguments[2],S=v.closestPoint(y);w.setMinimum(S,y)}};var fs=function(t){this._maxPtDist=new De,this._inputGeom=t||null},Xc={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};fs.prototype.computeMaxMidpointDistance=function(t){var e=new Ri(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},fs.prototype.computeMaxVertexDistance=function(t){var e=new Ys(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},fs.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},fs.prototype.getDistancePoints=function(){return this._maxPtDist},fs.prototype.interfaces_=function(){return[]},fs.prototype.getClass=function(){return fs},Xc.MaxPointDistanceFilter.get=function(){return Ys},Xc.MaxMidpointDistanceFilter.get=function(){return Ri},Object.defineProperties(fs,Xc);var Ys=function(t){this._maxPtDist=new De,this._minPtDist=new De,this._geom=t||null};Ys.prototype.filter=function(t){this._minPtDist.initialize(),zn.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ys.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ys.prototype.interfaces_=function(){return[Dn]},Ys.prototype.getClass=function(){return Ys};var Ri=function(t){this._maxPtDist=new De,this._minPtDist=new De,this._geom=t||null};Ri.prototype.filter=function(t,e){if(e===0)return null;var n=t.getCoordinate(e-1),i=t.getCoordinate(e),s=new x((n.x+i.x)/2,(n.y+i.y)/2);this._minPtDist.initialize(),zn.computeDistance(this._geom,s,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ri.prototype.isDone=function(){return!1},Ri.prototype.isGeometryChanged=function(){return!1},Ri.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ri.prototype.interfaces_=function(){return[zr]},Ri.prototype.getClass=function(){return Ri};var di=function(t){this._comps=t||null};di.prototype.filter=function(t){t instanceof re&&this._comps.add(t)},di.prototype.interfaces_=function(){return[nn]},di.prototype.getClass=function(){return di},di.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return di.getPolygons(t,new G)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof re?n.add(e):e instanceof xe&&e.apply(new di(n)),n}};var ge=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};ge.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof An){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Wt&&this._lines.add(t)},ge.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},ge.prototype.interfaces_=function(){return[ii]},ge.prototype.getClass=function(){return ge},ge.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(ge.getLines(t))}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(ge.getLines(e,n))}},ge.getLines=function(){if(arguments.length===1){var t=arguments[0];return ge.getLines(t,!1)}else if(arguments.length===2){if(rt(arguments[0],ee)&&rt(arguments[1],ee)){for(var e=arguments[0],n=arguments[1],i=e.iterator();i.hasNext();){var s=i.next();ge.getLines(s,n)}return n}else if(arguments[0]instanceof tt&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1],u=new G;return o.apply(new ge(u,a)),u}else if(arguments[0]instanceof tt&&rt(arguments[1],ee)){var l=arguments[0],h=arguments[1];return l instanceof Wt?h.add(l):l.apply(new ge(h)),h}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&rt(arguments[0],ee)&&rt(arguments[1],ee)){for(var c=arguments[0],f=arguments[1],p=arguments[2],m=c.iterator();m.hasNext();){var _=m.next();ge.getLines(_,f,p)}return f}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof tt&&rt(arguments[1],ee)){var E=arguments[0],C=arguments[1],v=arguments[2];return E.apply(new ge(C,v)),C}}};var Xr=function(){if(this._boundaryRule=br.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t===null)throw new zt("Rule must be non-null");this._boundaryRule=t}}};Xr.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof x&&arguments[1]instanceof re){var e=arguments[0],n=arguments[1];if(n.isEmpty())return O.EXTERIOR;var i=n.getExteriorRing(),s=this.locateInPolygonRing(e,i);if(s===O.EXTERIOR)return O.EXTERIOR;if(s===O.BOUNDARY)return O.BOUNDARY;for(var o=0;o<n.getNumInteriorRing();o++){var a=n.getInteriorRingN(o),u=t.locateInPolygonRing(e,a);if(u===O.INTERIOR)return O.EXTERIOR;if(u===O.BOUNDARY)return O.BOUNDARY}return O.INTERIOR}else if(arguments[0]instanceof x&&arguments[1]instanceof Wt){var l=arguments[0],h=arguments[1];if(!h.getEnvelopeInternal().intersects(l))return O.EXTERIOR;var c=h.getCoordinates();return!h.isClosed()&&(l.equals(c[0])||l.equals(c[c.length-1]))?O.BOUNDARY:q.isOnLine(l,c)?O.INTERIOR:O.EXTERIOR}else if(arguments[0]instanceof x&&arguments[1]instanceof Ze){var f=arguments[0],p=arguments[1],m=p.getCoordinate();return m.equals2D(f)?O.INTERIOR:O.EXTERIOR}},Xr.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?q.locatePointInRing(t,e.getCoordinates()):O.EXTERIOR},Xr.prototype.intersects=function(t,e){return this.locate(t,e)!==O.EXTERIOR},Xr.prototype.updateLocationInfo=function(t){t===O.INTERIOR&&(this._isIn=!0),t===O.BOUNDARY&&this._numBoundaries++},Xr.prototype.computeLocation=function(t,e){var n=this;if(e instanceof Ze&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Wt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof re)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof as)for(var i=e,s=0;s<i.getNumGeometries();s++){var o=i.getGeometryN(s);n.updateLocationInfo(n.locateInternal(t,o))}else if(e instanceof Ln)for(var a=e,u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);n.updateLocationInfo(n.locateInternal(t,l))}else if(e instanceof xe)for(var h=new kn(e);h.hasNext();){var c=h.next();c!==e&&n.computeLocation(t,c)}},Xr.prototype.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:e instanceof Wt?this.locateInternal(t,e):e instanceof re?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?O.BOUNDARY:this._numBoundaries>0||this._isIn?O.INTERIOR:O.EXTERIOR)},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr};var Ae=function r(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];r.call(this,t,r.INSIDE_AREA,e)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._component=n,this._segIndex=i,this._pt=s}},Nm={INSIDE_AREA:{configurable:!0}};Ae.prototype.isInsideArea=function(){return this._segIndex===Ae.INSIDE_AREA},Ae.prototype.getCoordinate=function(){return this._pt},Ae.prototype.getGeometryComponent=function(){return this._component},Ae.prototype.getSegmentIndex=function(){return this._segIndex},Ae.prototype.interfaces_=function(){return[]},Ae.prototype.getClass=function(){return Ae},Nm.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Ae,Nm);var Fi=function(t){this._pts=t||null};Fi.prototype.filter=function(t){t instanceof Ze&&this._pts.add(t)},Fi.prototype.interfaces_=function(){return[nn]},Fi.prototype.getClass=function(){return Fi},Fi.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof Ze?qr.singletonList(t):Fi.getPoints(t,new G)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof Ze?n.add(e):e instanceof xe&&e.apply(new Fi(n)),n}};var Js=function(){this._locations=null;var t=arguments[0];this._locations=t};Js.prototype.filter=function(t){(t instanceof Ze||t instanceof Wt||t instanceof re)&&this._locations.add(new Ae(t,0,t.getCoordinate()))},Js.prototype.interfaces_=function(){return[nn]},Js.prototype.getClass=function(){return Js},Js.getLocations=function(t){var e=new G;return t.apply(new Js(e)),e};var me=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Xr,this._minDistanceLocation=null,this._minDistance=st.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=i,this._terminateDistance=s}};me.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=1-n,o=di.getPolygons(this._geom[n]);if(o.size()>0){var a=Js.getLocations(this._geom[s]);if(this.computeContainmentDistance(a,o,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=i[0],this._minDistanceLocation[n]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&rt(arguments[0],Vr)&&rt(arguments[1],Vr)){for(var u=arguments[0],l=arguments[1],h=arguments[2],c=0;c<u.size();c++)for(var f=u.get(c),p=0;p<l.size();p++)if(t.computeContainmentDistance(f,l.get(p),h),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Ae&&arguments[1]instanceof re){var m=arguments[0],_=arguments[1],E=arguments[2],C=m.getCoordinate();if(O.EXTERIOR!==this._ptLocator.locate(C,_))return this._minDistance=0,E[0]=m,E[1]=new Ae(_,C),null}}},me.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var i=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(o,u,n),i._minDistance<=i._terminateDistance)return null}},me.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=ge.getLines(this._geom[0]),n=ge.getLines(this._geom[1]),i=Fi.getPoints(this._geom[0]),s=Fi.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,s,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(i,s,t),this.updateMinDistance(t,!1)},me.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},me.prototype.updateMinDistance=function(t,e){if(t[0]===null)return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},me.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},me.prototype.computeMinDistance=function(){var t=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof Wt&&arguments[1]instanceof Ze){var e=arguments[0],n=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(n.getEnvelopeInternal())>this._minDistance)return null;for(var s=e.getCoordinates(),o=n.getCoordinate(),a=0;a<s.length-1;a++){var u=q.distancePointLine(o,s[a],s[a+1]);if(u<t._minDistance){t._minDistance=u;var l=new j(s[a],s[a+1]),h=l.closestPoint(o);i[0]=new Ae(e,a,h),i[1]=new Ae(n,0,o)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Wt&&arguments[1]instanceof Wt){var c=arguments[0],f=arguments[1],p=arguments[2];if(c.getEnvelopeInternal().distance(f.getEnvelopeInternal())>this._minDistance)return null;for(var m=c.getCoordinates(),_=f.getCoordinates(),E=0;E<m.length-1;E++)for(var C=0;C<_.length-1;C++){var v=q.distanceLineLine(m[E],m[E+1],_[C],_[C+1]);if(v<t._minDistance){t._minDistance=v;var y=new j(m[E],m[E+1]),w=new j(_[C],_[C+1]),S=y.closestPoints(w);p[0]=new Ae(c,E,S[0]),p[1]=new Ae(f,C,S[1])}if(t._minDistance<=t._terminateDistance)return null}}}},me.prototype.computeMinDistancePoints=function(t,e,n){for(var i=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var u=e.get(a),l=o.getCoordinate().distance(u.getCoordinate());if(l<i._minDistance&&(i._minDistance=l,n[0]=new Ae(o,0,o.getCoordinate()),n[1]=new Ae(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},me.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new zt("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},me.prototype.computeMinDistanceLines=function(t,e,n){for(var i=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(o,u,n),i._minDistance<=i._terminateDistance)return null}},me.prototype.interfaces_=function(){return[]},me.prototype.getClass=function(){return me},me.distance=function(t,e){var n=new me(t,e);return n.distance()},me.isWithinDistance=function(t,e,n){var i=new me(t,e,n);return i.distance()<=n},me.nearestPoints=function(t,e){var n=new me(t,e);return n.nearestPoints()};var Ie=function(){this._pt=[new x,new x],this._distance=st.NaN,this._isNull=!0};Ie.prototype.getCoordinates=function(){return this._pt},Ie.prototype.getCoordinate=function(t){return this._pt[t]},Ie.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},Ie.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},Ie.prototype.toString=function(){return kr.toLineString(this._pt[0],this._pt[1])},Ie.prototype.getDistance=function(){return this._distance},Ie.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie};var dn=function(){};dn.prototype.interfaces_=function(){return[]},dn.prototype.getClass=function(){return dn},dn.computeDistance=function(){if(arguments[2]instanceof Ie&&arguments[0]instanceof Wt&&arguments[1]instanceof x)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=new j,s=t.getCoordinates(),o=0;o<s.length-1;o++){i.setCoordinates(s[o],s[o+1]);var a=i.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof Ie&&arguments[0]instanceof re&&arguments[1]instanceof x){var u=arguments[0],l=arguments[1],h=arguments[2];dn.computeDistance(u.getExteriorRing(),l,h);for(var c=0;c<u.getNumInteriorRing();c++)dn.computeDistance(u.getInteriorRingN(c),l,h)}else if(arguments[2]instanceof Ie&&arguments[0]instanceof tt&&arguments[1]instanceof x){var f=arguments[0],p=arguments[1],m=arguments[2];if(f instanceof Wt)dn.computeDistance(f,p,m);else if(f instanceof re)dn.computeDistance(f,p,m);else if(f instanceof xe)for(var _=f,E=0;E<_.getNumGeometries();E++){var C=_.getGeometryN(E);dn.computeDistance(C,p,m)}else m.setMinimum(f.getCoordinate(),p)}else if(arguments[2]instanceof Ie&&arguments[0]instanceof j&&arguments[1]instanceof x){var v=arguments[0],y=arguments[1],w=arguments[2],S=v.closestPoint(y);w.setMinimum(S,y)}};var Dr=function(){this._g0=null,this._g1=null,this._ptDist=new Ie,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Bc={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Dr.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Dr.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new zt("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Dr.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Dr.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Dr.prototype.computeOrientedDistance=function(t,e,n){var i=new js(e);if(t.apply(i),n.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var s=new ki(e,this._densifyFrac);t.apply(s),n.setMaximum(s.getMaxPointDistance())}},Dr.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Dr.prototype.interfaces_=function(){return[]},Dr.prototype.getClass=function(){return Dr},Dr.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Dr(t,e);return n.distance()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=new Dr(i,s);return a.setDensifyFraction(o),a.distance()}},Bc.MaxPointDistanceFilter.get=function(){return js},Bc.MaxDensifiedByFractionDistanceFilter.get=function(){return ki},Object.defineProperties(Dr,Bc);var js=function(){this._maxPtDist=new Ie,this._minPtDist=new Ie,this._euclideanDist=new dn,this._geom=null;var t=arguments[0];this._geom=t};js.prototype.filter=function(t){this._minPtDist.initialize(),dn.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},js.prototype.getMaxPointDistance=function(){return this._maxPtDist},js.prototype.interfaces_=function(){return[Dn]},js.prototype.getClass=function(){return js};var ki=function(){this._maxPtDist=new Ie,this._minPtDist=new Ie,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};ki.prototype.filter=function(t,e){var n=this;if(e===0)return null;for(var i=t.getCoordinate(e-1),s=t.getCoordinate(e),o=(s.x-i.x)/this._numSubSegs,a=(s.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=i.x+u*o,h=i.y+u*a,c=new x(l,h);n._minPtDist.initialize(),dn.computeDistance(n._geom,c,n._minPtDist),n._maxPtDist.setMaximum(n._minPtDist)}},ki.prototype.isDone=function(){return!1},ki.prototype.isGeometryChanged=function(){return!1},ki.prototype.getMaxPointDistance=function(){return this._maxPtDist},ki.prototype.interfaces_=function(){return[zr]},ki.prototype.getClass=function(){return ki};var rr=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},Hc={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};rr.prototype.checkMaximumDistance=function(t,e,n){var i=new Dr(e,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var s=i.getCoordinates();this._errorLocation=s[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+kr.toLineString(s[0],s[1])+")"}},rr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=rr.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),rr.VERBOSE&&fe.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},rr.prototype.checkNegativeValid=function(){if(!(this._input instanceof re||this._input instanceof Ln||this._input instanceof xe))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},rr.prototype.getErrorIndicator=function(){return this._errorIndicator},rr.prototype.checkMinimumDistance=function(t,e,n){var i=new me(t,e,n);if(this._minDistanceFound=i.distance(),this._minDistanceFound<n){this._isValid=!1;var s=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+kr.toLineString(s[0],s[1])+" )"}},rr.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},rr.prototype.getErrorLocation=function(){return this._errorLocation},rr.prototype.getPolygonLines=function(t){for(var e=new G,n=new ge(e),i=di.getPolygons(t),s=i.iterator();s.hasNext();){var o=s.next();o.apply(n)}return t.getFactory().buildGeometry(e)},rr.prototype.getErrorMessage=function(){return this._errMsg},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},Hc.VERBOSE.get=function(){return!1},Hc.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(rr,Hc);var ve=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},Yc={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};ve.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},ve.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*ve.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new J(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new J(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},ve.prototype.checkDistance=function(){var t=new rr(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},ve.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},ve.prototype.checkPolygonal=function(){this._result instanceof re||this._result instanceof Ln||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},ve.prototype.getErrorIndicator=function(){return this._errorIndicator},ve.prototype.getErrorLocation=function(){return this._errorLocation},ve.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")},ve.prototype.report=function(t){if(!ve.VERBOSE)return null;fe.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},ve.prototype.getErrorMessage=function(){return this._errorMsg},ve.prototype.interfaces_=function(){return[]},ve.prototype.getClass=function(){return ve},ve.isValidMsg=function(t,e,n){var i=new ve(t,e,n);return i.isValid()?null:i.getErrorMessage()},ve.isValid=function(t,e,n){var i=new ve(t,e,n);return!!i.isValid()},Yc.VERBOSE.get=function(){return!1},Yc.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(ve,Yc);var pn=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};pn.prototype.getCoordinates=function(){return this._pts},pn.prototype.size=function(){return this._pts.length},pn.prototype.getCoordinate=function(t){return this._pts[t]},pn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},pn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:Ws.octant(this.getCoordinate(t),this.getCoordinate(t+1))},pn.prototype.setData=function(t){this._data=t},pn.prototype.getData=function(){return this._data},pn.prototype.toString=function(){return kr.toLineString(new Yt(this._pts))},pn.prototype.interfaces_=function(){return[Fn]},pn.prototype.getClass=function(){return pn};var le=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new G,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};le.prototype.getInteriorIntersection=function(){return this._interiorIntersection},le.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},le.prototype.getIntersectionSegments=function(){return this._intSegments},le.prototype.count=function(){return this._intersectionCount},le.prototype.getIntersections=function(){return this._intersections},le.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},le.prototype.setKeepIntersections=function(t){this._keepIntersections=t},le.prototype.processIntersections=function(t,e,n,i){if(!this._findAllIntersections&&this.hasIntersection()||t===n&&e===i)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(t,e)||this.isEndSegment(n,i);if(!s)return null}var o=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];this._li.computeIntersection(o,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=a,this._intSegments[2]=u,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},le.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},le.prototype.hasIntersection=function(){return this._interiorIntersection!==null},le.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},le.prototype.interfaces_=function(){return[hs]},le.prototype.getClass=function(){return le},le.createAllIntersectionsFinder=function(t){var e=new le(t);return e.setFindAllIntersections(!0),e},le.createAnyIntersectionFinder=function(t){return new le(t)},le.createIntersectionCounter=function(t){var e=new le(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Br=function(){this._li=new is,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Br.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},Br.prototype.getIntersections=function(){return this._segInt.getIntersections()},Br.prototype.isValid=function(){return this.execute(),this._isValid},Br.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Br.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new le(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Wc;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Br.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new li(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Br.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+kr.toLineString(t[0],t[1])+" and "+kr.toLineString(t[2],t[3])},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},Br.computeIntersections=function(t){var e=new Br(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var ds=function r(){this._nv=null;var t=arguments[0];this._nv=new Br(r.toSegmentStrings(t))};ds.prototype.checkValid=function(){this._nv.checkValid()},ds.prototype.interfaces_=function(){return[]},ds.prototype.getClass=function(){return ds},ds.toSegmentStrings=function(t){for(var e=new G,n=t.iterator();n.hasNext();){var i=n.next();e.add(new pn(i.getCoordinates(),i))}return e},ds.checkValid=function(t){var e=new ds(t);e.checkValid()};var Qs=function(t){this._mapOp=t};Qs.prototype.map=function(t){for(var e=this,n=new G,i=0;i<t.getNumGeometries();i++){var s=e._mapOp.map(t.getGeometryN(i));s.isEmpty()||n.add(s)}return t.getFactory().createGeometryCollection(dt.toGeometryArray(n))},Qs.prototype.interfaces_=function(){return[]},Qs.prototype.getClass=function(){return Qs},Qs.map=function(t,e){var n=new Qs(e);return n.map(t)};var gn=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new G,this._resultLineList=new G;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};gn.prototype.collectLines=function(t){for(var e=this,n=this._op.getGraph().getEdgeEnds().iterator();n.hasNext();){var i=n.next();e.collectLineEdge(i,t,e._lineEdgesList),e.collectBoundaryTouchEdge(i,t,e._lineEdgesList)}},gn.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},gn.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},gn.prototype.collectLineEdge=function(t,e,n){var i=t.getLabel(),s=t.getEdge();t.isLineEdge()&&!t.isVisited()&&at.isResultOfOp(i,e)&&!s.isCovered()&&(n.add(s),t.setVisitedEdge(!0))},gn.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();n.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var s=i.next(),o=s.getEdge();if(s.isLineEdge()&&!o.isCoveredSet()){var a=t._op.isCoveredByA(s.getCoordinate());o.setCovered(a)}}},gn.prototype.labelIsolatedLines=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next(),s=i.getLabel();i.isIsolated()&&(s.isNull(0)?e.labelIsolatedLine(i,0):e.labelIsolatedLine(i,1))}},gn.prototype.buildLines=function(t){for(var e=this,n=this._lineEdgesList.iterator();n.hasNext();){var i=n.next(),s=e._geometryFactory.createLineString(i.getCoordinates());e._resultLineList.add(s),i.setInResult(!0)}},gn.prototype.collectBoundaryTouchEdge=function(t,e,n){var i=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;ut.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),at.isResultOfOp(i,e)&&e===at.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))},gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn};var $s=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new G;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};$s.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},$s.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,n=this._op.getGraph().getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||t===at.INTERSECTION)){var s=i.getLabel();at.isResultOfOp(s,t)&&e.filterCoveredNodeToPoint(i)}}},$s.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},$s.prototype.interfaces_=function(){return[]},$s.prototype.getClass=function(){return $s};var Be=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Be.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Be.prototype.transformPolygon=function(t,e){var n=this,i=!0,s=this.transformLinearRing(t.getExteriorRing(),t);(s===null||!(s instanceof An)||s.isEmpty())&&(i=!1);for(var o=new G,a=0;a<t.getNumInteriorRing();a++){var u=n.transformLinearRing(t.getInteriorRingN(a),t);u===null||u.isEmpty()||(u instanceof An||(i=!1),o.add(u))}if(i)return this._factory.createPolygon(s,o.toArray([]));var l=new G;return s!==null&&l.add(s),l.addAll(o),this._factory.buildGeometry(l)},Be.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Be.prototype.getInputGeometry=function(){return this._inputGeom},Be.prototype.transformMultiLineString=function(t,e){for(var n=this,i=new G,s=0;s<t.getNumGeometries();s++){var o=n.transformLineString(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},Be.prototype.transformCoordinates=function(t,e){return this.copy(t)},Be.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Be.prototype.transformMultiPoint=function(t,e){for(var n=this,i=new G,s=0;s<t.getNumGeometries();s++){var o=n.transformPoint(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},Be.prototype.transformMultiPolygon=function(t,e){for(var n=this,i=new G,s=0;s<t.getNumGeometries();s++){var o=n.transformPolygon(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},Be.prototype.copy=function(t){return t.copy()},Be.prototype.transformGeometryCollection=function(t,e){for(var n=this,i=new G,s=0;s<t.getNumGeometries();s++){var o=n.transform(t.getGeometryN(s));o!==null&&(n._pruneEmptyGeometry&&o.isEmpty()||i.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(dt.toGeometryArray(i)):this._factory.buildGeometry(i)},Be.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Ze)return this.transformPoint(t,null);if(t instanceof Zo)return this.transformMultiPoint(t,null);if(t instanceof An)return this.transformLinearRing(t,null);if(t instanceof Wt)return this.transformLineString(t,null);if(t instanceof as)return this.transformMultiLineString(t,null);if(t instanceof re)return this.transformPolygon(t,null);if(t instanceof Ln)return this.transformMultiPolygon(t,null);if(t instanceof xe)return this.transformGeometryCollection(t,null);throw new zt("Unknown Geometry subtype: "+t.getClass().getName())},Be.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(n===null)return this._factory.createLinearRing(null);var i=n.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be};var Gn=function r(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new j,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Wt&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];r.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];this._srcPts=n,this._isClosed=r.isClosed(n),this._snapTolerance=i}};Gn.prototype.snapVertices=function(t,e){for(var n=this,i=this._isClosed?t.size()-1:t.size(),s=0;s<i;s++){var o=t.get(s),a=n.findSnapForVertex(o,e);a!==null&&(t.set(s,new x(a)),s===0&&n._isClosed&&t.set(t.size()-1,new x(a)))}},Gn.prototype.findSnapForVertex=function(t,e){for(var n=this,i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<n._snapTolerance)return e[i]}return null},Gn.prototype.snapTo=function(t){var e=new xu(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var n=e.toCoordinateArray();return n},Gn.prototype.snapSegments=function(t,e){var n=this;if(e.length===0)return null;var i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(var s=0;s<i;s++){var o=e[s],a=n.findSegmentIndexToSnap(o,t);a>=0&&t.add(a+1,new x(o),!1)}},Gn.prototype.findSegmentIndexToSnap=function(t,e){for(var n=this,i=st.MAX_VALUE,s=-1,o=0;o<e.size()-1;o++){if(n._seg.p0=e.get(o),n._seg.p1=e.get(o+1),n._seg.p0.equals2D(t)||n._seg.p1.equals2D(t)){if(n._allowSnappingToSourceVertices)continue;return-1}var a=n._seg.distance(t);a<n._snapTolerance&&a<i&&(i=a,s=o)}return s},Gn.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn},Gn.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var jt=function(t){this._srcGeom=t||null},Tm={SNAP_PRECISION_FACTOR:{configurable:!0}};jt.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t),i=new Om(e,n);return i.transform(this._srcGeom)},jt.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),i=new Om(t,n,!0),s=i.transform(this._srcGeom),o=s;return e&&rt(o,Ti)&&(o=s.buffer(0)),o},jt.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),n=e/10;return n},jt.prototype.extractTargetCoordinates=function(t){for(var e=new rn,n=t.getCoordinates(),i=0;i<n.length;i++)e.add(n[i]);return e.toArray(new Array(0).fill(null))},jt.prototype.computeMinimumSegmentLength=function(t){for(var e=st.MAX_VALUE,n=0;n<t.length-1;n++){var i=t[n].distance(t[n+1]);i<e&&(e=i)}return e},jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt},jt.snap=function(t,e,n){var i=new Array(2).fill(null),s=new jt(t);i[0]=s.snapTo(e,n);var o=new jt(e);return i[1]=o.snapTo(i[0],n),i},jt.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=jt.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===St.FIXED){var i=1/n.getScale()*2/1.415;i>e&&(e=i)}return e}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return Math.min(jt.computeOverlaySnapTolerance(s),jt.computeOverlaySnapTolerance(o))}},jt.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),n=Math.min(e.getHeight(),e.getWidth()),i=n*jt.SNAP_PRECISION_FACTOR;return i},jt.snapToSelf=function(t,e,n){var i=new jt(t);return i.snapToSelf(e,n)},Tm.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(jt,Tm);var Om=(function(r){function t(e,n,i){r.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=i!==void 0?i:!1}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(n,i){var s=new Gn(n,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(i)},t.prototype.transformCoordinates=function(n,i){var s=n.toCoordinateArray(),o=this.snapLine(s,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(Be),Le=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Le.prototype.getCommon=function(){return st.longBitsToDouble(this._commonBits)},Le.prototype.add=function(t){var e=st.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=Le.signExpBits(this._commonBits),this._isFirst=!1,null;var n=Le.signExpBits(e);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Le.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=Le.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},Le.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=st.longBitsToDouble(t),n=st.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+n,s=i.substring(i.length-64),o=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+e+" ]";return o}},Le.prototype.interfaces_=function(){return[]},Le.prototype.getClass=function(){return Le},Le.getBit=function(t,e){var n=1<<e;return(t&n)!==0?1:0},Le.signExpBits=function(t){return t>>52},Le.zeroLowerBits=function(t,e){var n=(1<<e)-1,i=~n,s=t&i;return s},Le.numCommonMostSigMantissaBits=function(t,e){for(var n=0,i=52;i>=0;i--){if(Le.getBit(t,i)!==Le.getBit(e,i))return n;n++}return 52};var Vi=function(){this._commonCoord=null,this._ccFilter=new Ks},Jc={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Vi.prototype.addCommonBits=function(t){var e=new Ui(this._commonCoord);t.apply(e),t.geometryChanged()},Vi.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new x(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new Ui(e);return t.apply(n),t.geometryChanged(),t},Vi.prototype.getCommonCoordinate=function(){return this._commonCoord},Vi.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Vi.prototype.interfaces_=function(){return[]},Vi.prototype.getClass=function(){return Vi},Jc.CommonCoordinateFilter.get=function(){return Ks},Jc.Translater.get=function(){return Ui},Object.defineProperties(Vi,Jc);var Ks=function(){this._commonBitsX=new Le,this._commonBitsY=new Le};Ks.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Ks.prototype.getCommonCoordinate=function(){return new x(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Ks.prototype.interfaces_=function(){return[Dn]},Ks.prototype.getClass=function(){return Ks};var Ui=function(){this.trans=null;var t=arguments[0];this.trans=t};Ui.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,i)},Ui.prototype.isDone=function(){return!1},Ui.prototype.isGeometryChanged=function(){return!0},Ui.prototype.interfaces_=function(){return[zr]},Ui.prototype.getClass=function(){return Ui};var he=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};he.prototype.selfSnap=function(t){var e=new jt(t),n=e.snapTo(t,this._snapTolerance);return n},he.prototype.removeCommonBits=function(t){this._cbr=new Vi,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},he.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},he.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=at.overlayOp(e[0],e[1],t);return this.prepareResult(n)},he.prototype.checkValid=function(t){t.isValid()||fe.out.println("Snapped geometry is invalid")},he.prototype.computeSnapTolerance=function(){this._snapTolerance=jt.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},he.prototype.snap=function(t){var e=this.removeCommonBits(t),n=jt.snap(e[0],e[1],this._snapTolerance);return n},he.prototype.interfaces_=function(){return[]},he.prototype.getClass=function(){return he},he.overlayOp=function(t,e,n){var i=new he(t,e);return i.getResultGeometry(n)},he.union=function(t,e){return he.overlayOp(t,e,at.UNION)},he.intersection=function(t,e){return he.overlayOp(t,e,at.INTERSECTION)},he.symDifference=function(t,e){return he.overlayOp(t,e,at.SYMDIFFERENCE)},he.difference=function(t,e){return he.overlayOp(t,e,at.DIFFERENCE)};var Re=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};Re.prototype.getResultGeometry=function(t){var e=null,n=!1,i=null;try{e=at.overlayOp(this._geom[0],this._geom[1],t);var s=!0;s&&(n=!0)}catch(o){if(o instanceof ni)i=o;else throw o}finally{}if(!n)try{e=he.overlayOp(this._geom[0],this._geom[1],t)}catch(o){throw o instanceof ni?i:o}finally{}return e},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re},Re.overlayOp=function(t,e,n){var i=new Re(t,e);return i.getResultGeometry(n)},Re.union=function(t,e){return Re.overlayOp(t,e,at.UNION)},Re.intersection=function(t,e){return Re.overlayOp(t,e,at.INTERSECTION)},Re.symDifference=function(t,e){return Re.overlayOp(t,e,at.SYMDIFFERENCE)},Re.difference=function(t,e){return Re.overlayOp(t,e,at.DIFFERENCE)};var Wu=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Wu.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Wu.prototype.interfaces_=function(){return[]},Wu.prototype.getClass=function(){return Wu};var nr=function r(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],e=arguments[1];this._eventType=r.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._eventType=r.INSERT,this._label=n,this._xValue=i,this._obj=s}},jc={INSERT:{configurable:!0},DELETE:{configurable:!0}};nr.prototype.isDelete=function(){return this._eventType===nr.DELETE},nr.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},nr.prototype.getObject=function(){return this._obj},nr.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},nr.prototype.getInsertEvent=function(){return this._insertEvent},nr.prototype.isInsert=function(){return this._eventType===nr.INSERT},nr.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},nr.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},nr.prototype.interfaces_=function(){return[Pr]},nr.prototype.getClass=function(){return nr},jc.INSERT.get=function(){return 1},jc.DELETE.get=function(){return 2},Object.defineProperties(nr,jc);var th=function(){};th.prototype.interfaces_=function(){return[]},th.prototype.getClass=function(){return th};var ye=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};ye.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&this._li.getIntersectionNum()===1){if(ye.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var s=t.getNumPoints()-1;if(e===0&&i===s||i===0&&e===s)return!0}}return!1},ye.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ye.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},ye.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ye.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next(),s=i.getCoordinate();if(t.isIntersection(s))return!0}return!1},ye.prototype.hasProperIntersection=function(){return this._hasProper},ye.prototype.hasIntersection=function(){return this._hasIntersection},ye.prototype.isDone=function(){return this._isDone},ye.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},ye.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},ye.prototype.addIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var s=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,u),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},ye.prototype.interfaces_=function(){return[]},ye.prototype.getClass=function(){return ye},ye.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var lI=(function(r){function t(){r.call(this),this.events=new G,this.nOverlaps=null}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var n=this;qr.sort(this.events);for(var i=0;i<this.events.size();i++){var s=n.events.get(i);s.isDelete()&&s.getInsertEvent().setDeleteEventIndex(i)}},t.prototype.computeIntersections=function(){var n=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var s=0;s<this.events.size();s++){var o=n.events.get(s);if(o.isInsert()&&n.processOverlaps(s,o.getDeleteEventIndex(),o,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof ye&&rt(arguments[0],Vr)&&rt(arguments[1],Vr)){var a=arguments[0],u=arguments[1],l=arguments[2];this.addEdges(a,a),this.addEdges(u,u),this.computeIntersections(l)}else if(typeof arguments[2]=="boolean"&&rt(arguments[0],Vr)&&arguments[1]instanceof ye){var h=arguments[0],c=arguments[1],f=arguments[2];f?this.addEdges(h,null):this.addEdges(h),this.computeIntersections(c)}}},t.prototype.addEdge=function(n,i){for(var s=this,o=n.getMonotoneChainEdge(),a=o.getStartIndexes(),u=0;u<a.length-1;u++){var l=new Wu(o,u),h=new nr(i,o.getMinX(u),l);s.events.add(h),s.events.add(new nr(o.getMaxX(u),h))}},t.prototype.processOverlaps=function(n,i,s,o){for(var a=this,u=s.getObject(),l=n;l<i;l++){var h=a.events.get(l);if(h.isInsert()){var c=h.getObject();s.isSameLabel(h)||(u.computeIntersections(c,o),a.nOverlaps++)}}},t.prototype.addEdges=function(){var n=this;if(arguments.length===1)for(var i=arguments[0],s=i.iterator();s.hasNext();){var o=s.next();n.addEdge(o,o)}else if(arguments.length===2)for(var a=arguments[0],u=arguments[1],l=a.iterator();l.hasNext();){var h=l.next();n.addEdge(h,u)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(th),qn=function(){this._min=st.POSITIVE_INFINITY,this._max=st.NEGATIVE_INFINITY},Dm={NodeComparator:{configurable:!0}};qn.prototype.getMin=function(){return this._min},qn.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},qn.prototype.getMax=function(){return this._max},qn.prototype.toString=function(){return kr.toLineString(new x(this._min,0),new x(this._max,0))},qn.prototype.interfaces_=function(){return[]},qn.prototype.getClass=function(){return qn},Dm.NodeComparator.get=function(){return Xu},Object.defineProperties(qn,Dm);var Xu=function(){};Xu.prototype.compare=function(t,e){var n=t,i=e,s=(n._min+n._max)/2,o=(i._min+i._max)/2;return s<o?-1:s>o?1:0},Xu.prototype.interfaces_=function(){return[qo]},Xu.prototype.getClass=function(){return Xu};var hI=(function(r){function t(){r.call(this),this._item=null;var e=arguments[0],n=arguments[1],i=arguments[2];this._min=e,this._max=n,this._item=i}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.query=function(n,i,s){if(!this.intersects(n,i))return null;s.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(qn),cI=(function(r){function t(){r.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(n,i){this._min=Math.min(n._min,i._min),this._max=Math.max(n._max,i._max)},t.prototype.query=function(n,i,s){if(!this.intersects(n,i))return null;this._node1!==null&&this._node1.query(n,i,s),this._node2!==null&&this._node2.query(n,i,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(qn),Wn=function(){this._leaves=new G,this._root=null,this._level=0};Wn.prototype.buildTree=function(){var t=this;qr.sort(this._leaves,new qn.NodeComparator);for(var e=this._leaves,n=null,i=new G;;){if(t.buildLevel(e,i),i.size()===1)return i.get(0);n=e,e=i,i=n}},Wn.prototype.insert=function(t,e,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new hI(t,e,n))},Wn.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},Wn.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Wn.prototype.printNode=function(t){fe.out.println(kr.toLineString(new x(t._min,this._level),new x(t._max,this._level)))},Wn.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},Wn.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var i=t.get(n),s=n+1<t.size()?t.get(n):null;if(s===null)e.add(i);else{var o=new cI(t.get(n),t.get(n+1));e.add(o)}}},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn};var oa=function(){this._items=new G};oa.prototype.visitItem=function(t){this._items.add(t)},oa.prototype.getItems=function(){return this._items},oa.prototype.interfaces_=function(){return[Oi]},oa.prototype.getClass=function(){return oa};var aa=function(){this._index=null;var t=arguments[0];if(!rt(t,Ti))throw new zt("Argument must be Polygonal");this._index=new ps(t)},Qc={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};aa.prototype.locate=function(t){var e=new en(t),n=new ua(e);return this._index.query(t.y,t.y,n),e.getLocation()},aa.prototype.interfaces_=function(){return[na]},aa.prototype.getClass=function(){return aa},Qc.SegmentVisitor.get=function(){return ua},Qc.IntervalIndexedGeometry.get=function(){return ps},Object.defineProperties(aa,Qc);var ua=function(){this._counter=null;var t=arguments[0];this._counter=t};ua.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},ua.prototype.interfaces_=function(){return[Oi]},ua.prototype.getClass=function(){return ua};var ps=function(){this._index=new Wn;var t=arguments[0];this.init(t)};ps.prototype.init=function(t){for(var e=this,n=ge.getLines(t),i=n.iterator();i.hasNext();){var s=i.next(),o=s.getCoordinates();e.addLine(o)}},ps.prototype.addLine=function(t){for(var e=this,n=1;n<t.length;n++){var i=new j(t[n-1],t[n]),s=Math.min(i.p0.y,i.p1.y),o=Math.max(i.p0.y,i.p1.y);e._index.insert(s,o,i)}},ps.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new oa;return this._index.query(t,e,n),n.getItems()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];this._index.query(i,s,o)}},ps.prototype.interfaces_=function(){return[]},ps.prototype.getClass=function(){return ps};var Bu=(function(r){function t(){if(r.call(this),this._parentGeom=null,this._lineEdgeMap=new dm,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Xr,arguments.length===2){var e=arguments[0],n=arguments[1],i=br.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=i,n!==null&&this.add(n)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this._argIndex=s,this._parentGeom=o,this._boundaryNodeRule=a,o!==null&&this.add(o)}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(n,i){var s=this._nodes.addNode(i),o=s.getLabel(),a=1,u=O.NONE;u=o.getLocation(n,U.ON),u===O.BOUNDARY&&a++;var l=t.determineBoundary(this._boundaryNodeRule,a);o.setLocation(n,l)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.computeSelfNodes(n,i,!1)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2],u=new ye(s,!0,!1);u.setIsDoneIfProperInt(a);var l=this.createEdgeSetIntersector(),h=this._parentGeom instanceof An||this._parentGeom instanceof re||this._parentGeom instanceof Ln,c=o||!h;return l.computeIntersections(this._edges,u,c),this.addSelfIntersectionNodes(this._argIndex),u}},t.prototype.computeSplitEdges=function(n){for(var i=this._edges.iterator();i.hasNext();){var s=i.next();s.eiList.addSplitEdges(n)}},t.prototype.computeEdgeIntersections=function(n,i,s){var o=new ye(i,s,!0);o.setBoundaryNodes(this.getBoundaryNodes(),n.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,n._edges,o),o},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof Ze){var n=arguments[0],i=n.getCoordinate();this.insertPoint(this._argIndex,i,O.INTERIOR)}else if(arguments[0]instanceof x){var s=arguments[0];this.insertPoint(this._argIndex,s,O.INTERIOR)}},t.prototype.addPolygon=function(n){var i=this;this.addPolygonRing(n.getExteriorRing(),O.EXTERIOR,O.INTERIOR);for(var s=0;s<n.getNumInteriorRing();s++){var o=n.getInteriorRingN(s);i.addPolygonRing(o,O.INTERIOR,O.EXTERIOR)}},t.prototype.addEdge=function(n){this.insertEdge(n);var i=n.getCoordinates();this.insertPoint(this._argIndex,i[0],O.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],O.BOUNDARY)},t.prototype.addLineString=function(n){var i=ft.removeRepeatedPoints(n.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var s=new Zl(i,new Pt(this._argIndex,O.INTERIOR));this._lineEdgeMap.put(n,s),this.insertEdge(s),ut.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),i=new Array(n.size()).fill(null),s=0,o=n.iterator();o.hasNext();){var a=o.next();i[s++]=a.getCoordinate().copy()}return i},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(n,i,s){if(this.isBoundaryNode(n,i))return null;s===O.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,i):this.insertPoint(n,i,s)},t.prototype.addPolygonRing=function(n,i,s){if(n.isEmpty())return null;var o=ft.removeRepeatedPoints(n.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var a=i,u=s;q.isCCW(o)&&(a=s,u=i);var l=new Zl(o,new Pt(this._argIndex,O.BOUNDARY,a,u));this._lineEdgeMap.put(n,l),this.insertEdge(l),this.insertPoint(this._argIndex,o[0],O.BOUNDARY)},t.prototype.insertPoint=function(n,i,s){var o=this._nodes.addNode(i),a=o.getLabel();a===null?o._label=new Pt(n,s):a.setLocation(n,s)},t.prototype.createEdgeSetIntersector=function(){return new lI},t.prototype.addSelfIntersectionNodes=function(n){for(var i=this,s=this._edges.iterator();s.hasNext();)for(var o=s.next(),a=o.getLabel().getLocation(n),u=o.eiList.iterator();u.hasNext();){var l=u.next();i.addSelfIntersectionNode(n,l.coord,a)}},t.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof Ln&&(this._useBoundaryDeterminationRule=!1),n instanceof re)this.addPolygon(n);else if(n instanceof Wt)this.addLineString(n);else if(n instanceof Ze)this.addPoint(n);else if(n instanceof Zo)this.addCollection(n);else if(n instanceof as)this.addCollection(n);else if(n instanceof Ln)this.addCollection(n);else if(n instanceof xe)this.addCollection(n);else throw new Error(n.getClass().getName())}else return r.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(n){for(var i=this,s=0;s<n.getNumGeometries();s++){var o=n.getGeometryN(s);i.add(o)}},t.prototype.locate=function(n){return rt(this._parentGeom,Ti)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new aa(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return r.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(n,i){return n.isInBoundary(i)?O.BOUNDARY:O.INTERIOR},t})(qt),la=function(){if(this._li=new is,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Bu(0,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=br.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Bu(0,e,i),this._arg[1]=new Bu(1,n,i)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];s.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(s.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Bu(0,s,a),this._arg[1]=new Bu(1,o,a)}};la.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},la.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},la.prototype.interfaces_=function(){return[]},la.prototype.getClass=function(){return la};var gs=function(){};gs.prototype.interfaces_=function(){return[]},gs.prototype.getClass=function(){return gs},gs.map=function(){if(arguments[0]instanceof tt&&rt(arguments[1],gs.MapOp)){for(var t=arguments[0],e=arguments[1],n=new G,i=0;i<t.getNumGeometries();i++){var s=e.map(t.getGeometryN(i));s!==null&&n.add(s)}return t.getFactory().buildGeometry(n)}else if(rt(arguments[0],ee)&&rt(arguments[1],gs.MapOp)){for(var o=arguments[0],a=arguments[1],u=new G,l=o.iterator();l.hasNext();){var h=l.next(),c=a.map(h);c!==null&&u.add(c)}return u}},gs.MapOp=function(){};var at=(function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n),this._ptLocator=new Xr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Wr,this._resultPolyList=new G,this._resultLineList=new G,this._resultPointList=new G,this._graph=new qt(new Cm),this._geomFact=e.getFactory()}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(n){var i=this._edgeList.findEqualEdge(n);if(i!==null){var s=i.getLabel(),o=n.getLabel();i.isPointwiseEqual(n)||(o=new Pt(n.getLabel()),o.flip());var a=i.getDepth();a.isNull()&&a.add(s),a.add(o),s.merge(o)}else this._edgeList.add(n)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var i=n.next(),s=i.getSym();i.isInResult()&&s.isInResult()&&(i.setInResult(!1),s.setInResult(!1))}},t.prototype.isCoveredByLA=function(n){return!!(this.isCovered(n,this._resultLineList)||this.isCovered(n,this._resultPolyList))},t.prototype.computeGeometry=function(n,i,s,o){var a=new G;return a.addAll(n),a.addAll(i),a.addAll(s),a.isEmpty()?t.createEmptyResult(o,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},t.prototype.mergeSymLabels=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next();i.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(n,i){for(var s=this,o=i.iterator();o.hasNext();){var a=o.next(),u=s._ptLocator.locate(n,a);if(u!==O.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var n=new G,i=this._edgeList.iterator();i.hasNext();){var s=i.next();s.isCollapsed()&&(i.remove(),n.add(s.getCollapsedEdge()))}this._edgeList.addAll(n)},t.prototype.updateNodeLabelling=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next(),s=i.getEdges().getLabel();i.getLabel().merge(s)}},t.prototype.getResultGeometry=function(n){return this.computeOverlay(n),this._resultGeom},t.prototype.insertUniqueEdges=function(n){for(var i=this,s=n.iterator();s.hasNext();){var o=s.next();i.insertUniqueEdge(o)}},t.prototype.computeOverlay=function(n){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var i=new G;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),ds.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(n),this.cancelDuplicateResultEdges();var s=new tr(this._geomFact);s.add(this._graph),this._resultPolyList=s.getPolygons();var o=new gn(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(n);var a=new $s(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(n),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,n)},t.prototype.labelIncompleteNode=function(n,i){var s=this._ptLocator.locate(n.getCoordinate(),this._arg[i].getGeometry());n.getLabel().setLocation(i,s)},t.prototype.copyPoints=function(n){for(var i=this,s=this._arg[n].getNodeIterator();s.hasNext();){var o=s.next(),a=i._graph.addNode(o.getCoordinate());a.setLabel(n,o.getLabel().getLocation(n))}},t.prototype.findResultAreaEdges=function(n){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var s=i.next(),o=s.getLabel();o.isArea()&&!s.isInteriorAreaEdge()&&t.isResultOfOp(o.getLocation(0,U.RIGHT),o.getLocation(1,U.RIGHT),n)&&s.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var n=this._edgeList.iterator();n.hasNext();){var i=n.next(),s=i.getLabel(),o=i.getDepth();if(!o.isNull()){o.normalize();for(var a=0;a<2;a++)!s.isNull(a)&&s.isArea()&&!o.isNull(a)&&(o.getDelta(a)===0?s.toLine(a):(ut.isTrue(!o.isNull(a,U.LEFT),"depth of LEFT side has not been initialized"),s.setLocation(a,U.LEFT,o.getLocation(a,U.LEFT)),ut.isTrue(!o.isNull(a,U.RIGHT),"depth of RIGHT side has not been initialized"),s.setLocation(a,U.RIGHT,o.getLocation(a,U.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next();s.getEdges().computeLabelling(n._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next(),o=s.getLabel();s.isIsolated()&&(o.isNull(0)?n.labelIncompleteNode(s,0):n.labelIncompleteNode(s,1)),s.getEdges().updateLabelling(o)}},t.prototype.isCoveredByA=function(n){return!!this.isCovered(n,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t})(la);at.overlayOp=function(r,t,e){var n=new at(r,t),i=n.getResultGeometry(e);return i},at.intersection=function(r,t){if(r.isEmpty()||t.isEmpty())return at.createEmptyResult(at.INTERSECTION,r,t,r.getFactory());if(r.isGeometryCollection()){var e=t;return Qs.map(r,{interfaces_:function(){return[gs.MapOp]},map:function(n){return n.intersection(e)}})}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),Re.overlayOp(r,t,at.INTERSECTION)},at.symDifference=function(r,t){if(r.isEmpty()||t.isEmpty()){if(r.isEmpty()&&t.isEmpty())return at.createEmptyResult(at.SYMDIFFERENCE,r,t,r.getFactory());if(r.isEmpty())return t.copy();if(t.isEmpty())return r.copy()}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),Re.overlayOp(r,t,at.SYMDIFFERENCE)},at.resultDimension=function(r,t,e){var n=t.getDimension(),i=e.getDimension(),s=-1;switch(r){case at.INTERSECTION:s=Math.min(n,i);break;case at.UNION:s=Math.max(n,i);break;case at.DIFFERENCE:s=n;break;case at.SYMDIFFERENCE:s=Math.max(n,i);break}return s},at.createEmptyResult=function(r,t,e,n){var i=null;switch(at.resultDimension(r,t,e)){case-1:i=n.createGeometryCollection(new Array(0).fill(null));break;case 0:i=n.createPoint();break;case 1:i=n.createLineString();break;case 2:i=n.createPolygon();break}return i},at.difference=function(r,t){return r.isEmpty()?at.createEmptyResult(at.DIFFERENCE,r,t,r.getFactory()):t.isEmpty()?r.copy():(r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),Re.overlayOp(r,t,at.DIFFERENCE))},at.isResultOfOp=function(){if(arguments.length===2){var r=arguments[0],t=arguments[1],e=r.getLocation(0),n=r.getLocation(1);return at.isResultOfOp(e,n,t)}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];switch(i===O.BOUNDARY&&(i=O.INTERIOR),s===O.BOUNDARY&&(s=O.INTERIOR),o){case at.INTERSECTION:return i===O.INTERIOR&&s===O.INTERIOR;case at.UNION:return i===O.INTERIOR||s===O.INTERIOR;case at.DIFFERENCE:return i===O.INTERIOR&&s!==O.INTERIOR;case at.SYMDIFFERENCE:return i===O.INTERIOR&&s!==O.INTERIOR||i!==O.INTERIOR&&s===O.INTERIOR}return!1}},at.INTERSECTION=1,at.UNION=2,at.DIFFERENCE=3,at.SYMDIFFERENCE=4;var zi=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Xr,this._seg=new j;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};zi.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,n=0;n<this._linework.getNumGeometries();n++)for(var i=e._linework.getGeometryN(n),s=i.getCoordinateSequence(),o=0;o<s.size()-1;o++){s.getCoordinate(o,e._seg.p0),s.getCoordinate(o+1,e._seg.p1);var a=e._seg.distance(t);if(a<=e._boundaryDistanceTolerance)return!0}return!1},zi.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?O.BOUNDARY:this._ptLocator.locate(t,this._g)},zi.prototype.extractLinework=function(t){var e=new ha;t.apply(e);var n=e.getLinework(),i=dt.toLineStringArray(n);return t.getFactory().createMultiLineString(i)},zi.prototype.interfaces_=function(){return[]},zi.prototype.getClass=function(){return zi};var ha=function(){this._linework=null,this._linework=new G};ha.prototype.getLinework=function(){return this._linework},ha.prototype.filter=function(t){var e=this;if(t instanceof re){var n=t;this._linework.add(n.getExteriorRing());for(var i=0;i<n.getNumInteriorRing();i++)e._linework.add(n.getInteriorRingN(i))}},ha.prototype.interfaces_=function(){return[nn]},ha.prototype.getClass=function(){return ha};var ms=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};ms.prototype.extractPoints=function(t,e,n){for(var i=this,s=t.getCoordinates(),o=0;o<s.length-1;o++)i.computeOffsetPoints(s[o],s[o+1],e,n)},ms.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},ms.prototype.getPoints=function(t){for(var e=this,n=new G,i=ge.getLines(this._g),s=i.iterator();s.hasNext();){var o=s.next();e.extractPoints(o,t,n)}return n},ms.prototype.computeOffsetPoints=function(t,e,n,i){var s=e.x-t.x,o=e.y-t.y,a=Math.sqrt(s*s+o*o),u=n*s/a,l=n*o/a,h=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var f=new x(h-l,c+u);i.add(f)}if(this._doRight){var p=new x(h+l,c-u);i.add(p)}},ms.prototype.interfaces_=function(){return[]},ms.prototype.getClass=function(){return ms};var yr=function r(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=r.TOLERANCE,this._testCoords=new G;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundaryDistanceTolerance=r.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,n],this._locFinder=[new zi(this._geom[0],this._boundaryDistanceTolerance),new zi(this._geom[1],this._boundaryDistanceTolerance),new zi(this._geom[2],this._boundaryDistanceTolerance)]},Am={TOLERANCE:{configurable:!0}};yr.prototype.reportResult=function(t,e,n){fe.out.println("Overlay result invalid - A:"+O.toLocationSymbol(e[0])+" B:"+O.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+O.toLocationSymbol(e[2]))},yr.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},yr.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=0;n<this._testCoords.size();n++){var i=t._testCoords.get(n);if(!t.checkValid(e,i))return t._invalidLocation=i,!1}return!0}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._location[0]=this._locFinder[0].getLocation(o),this._location[1]=this._locFinder[1].getLocation(o),this._location[2]=this._locFinder[2].getLocation(o),yr.hasLocation(this._location,O.BOUNDARY)?!0:this.isValidResult(s,this._location)}},yr.prototype.addTestPts=function(t){var e=new ms(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},yr.prototype.isValidResult=function(t,e){var n=at.isResultOfOp(e[0],e[1],t),i=e[2]===O.INTERIOR,s=!(n^i);return s||this.reportResult(t,e,n),s},yr.prototype.getInvalidLocation=function(){return this._invalidLocation},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr},yr.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},yr.computeBoundaryDistanceTolerance=function(t,e){return Math.min(jt.computeSizeBasedSnapTolerance(t),jt.computeSizeBasedSnapTolerance(e))},yr.isValid=function(t,e,n,i){var s=new yr(t,e,i);return s.isValid(n)},Am.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(yr,Am);var _r=function r(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=r.extractFactory(t),this._inputGeoms=t};_r.prototype.extractElements=function(t,e){var n=this;if(t===null)return null;for(var i=0;i<t.getNumGeometries();i++){var s=t.getGeometryN(i);n._skipEmpty&&s.isEmpty()||e.add(s)}},_r.prototype.combine=function(){for(var t=this,e=new G,n=this._inputGeoms.iterator();n.hasNext();){var i=n.next();t.extractElements(i,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},_r.combine=function(){if(arguments.length===1){var t=arguments[0],e=new _r(t);return e.combine()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=new _r(_r.createList(n,i));return s.combine()}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2],l=new _r(_r.createList(o,a,u));return l.combine()}},_r.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},_r.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new G;return n.add(t),n.add(e),n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=new G;return a.add(i),a.add(s),a.add(o),a}};var Zt=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new G)},Lm={STRTREE_NODE_CAPACITY:{configurable:!0}};Zt.prototype.reduceToGeometries=function(t){for(var e=this,n=new G,i=t.iterator();i.hasNext();){var s=i.next(),o=null;rt(s,Vr)?o=e.unionTree(s):s instanceof tt&&(o=s),n.add(o)}return n},Zt.prototype.extractByEnvelope=function(t,e,n){for(var i=new G,s=0;s<e.getNumGeometries();s++){var o=e.getGeometryN(s);o.getEnvelopeInternal().intersects(t)?i.add(o):n.add(o)}return this._geomFactory.buildGeometry(i)},Zt.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!n.intersects(i)){var s=_r.combine(t,e);return s}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var o=n.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,o)},Zt.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new vm(Zt.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var i=t.itemsTree(),s=this.unionTree(i);return s},Zt.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2];if(i-n<=1){var s=Zt.getGeometry(e,n);return this.unionSafe(s,null)}else{if(i-n===2)return this.unionSafe(Zt.getGeometry(e,n),Zt.getGeometry(e,n+1));var o=Math.trunc((i+n)/2),a=this.binaryUnion(e,n,o),u=this.binaryUnion(e,o,i);return this.unionSafe(a,u)}}},Zt.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var i=n.next();e===null?e=i.copy():e=e.union(i)}return e},Zt.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},Zt.prototype.unionActual=function(t,e){return Zt.restrictToPolygons(t.union(e))},Zt.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),n=this.binaryUnion(e);return n},Zt.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var i=new G,s=this.extractByEnvelope(n,t,i),o=this.extractByEnvelope(n,e,i),a=this.unionActual(s,o);i.add(a);var u=_r.combine(i);return u},Zt.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),n=e.buildGeometry(t),i=n.buffer(0);return i}else if(arguments.length===2){var s=arguments[0],o=arguments[1],a=s.getFactory(),u=a.createGeometryCollection([s,o]),l=u.buffer(0);return l}},Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt},Zt.restrictToPolygons=function(t){if(rt(t,Ti))return t;var e=di.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(dt.toPolygonArray(e))},Zt.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Zt.union=function(t){var e=new Zt(t);return e.union()},Lm.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Zt,Lm);var eh=function(){};eh.prototype.interfaces_=function(){return[]},eh.prototype.getClass=function(){return eh},eh.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return at.createEmptyResult(at.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Re.overlayOp(t,e,at.UNION)};function vs(){return new rh}function rh(){this.reset()}rh.prototype={constructor:rh,reset:function(){this.s=this.t=0},add:function(r){Rm(nh,r,this.t),Rm(this,nh.s,this.s),this.s?this.t+=nh.t:this.s=nh.t},valueOf:function(){return this.s}};var nh=new rh;function Rm(r,t,e){var n=r.s=t+e,i=n-t,s=n-i;r.t=t-s+(e-i)}var Bt=1e-6,bt=Math.PI,pi=bt/2,Fm=bt/4,gi=bt*2,ys=180/bt,mn=bt/180,Fe=Math.abs,fI=Math.atan,ca=Math.atan2,ie=Math.cos,se=Math.sin,fa=Math.sqrt;function km(r){return r>1?0:r<-1?bt:Math.acos(r)}function Zs(r){return r>1?pi:r<-1?-pi:Math.asin(r)}function Hu(){}function ih(r,t){r&&Um.hasOwnProperty(r.type)&&Um[r.type](r,t)}var Vm={Feature:function(r,t){ih(r.geometry,t)},FeatureCollection:function(r,t){for(var e=r.features,n=-1,i=e.length;++n<i;)ih(e[n].geometry,t)}},Um={Sphere:function(r,t){t.sphere()},Point:function(r,t){r=r.coordinates,t.point(r[0],r[1],r[2])},MultiPoint:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)r=e[n],t.point(r[0],r[1],r[2])},LineString:function(r,t){$c(r.coordinates,t,0)},MultiLineString:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)$c(e[n],t,0)},Polygon:function(r,t){zm(r.coordinates,t)},MultiPolygon:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)zm(e[n],t)},GeometryCollection:function(r,t){for(var e=r.geometries,n=-1,i=e.length;++n<i;)ih(e[n],t)}};function $c(r,t,e){var n=-1,i=r.length-e,s;for(t.lineStart();++n<i;)s=r[n],t.point(s[0],s[1],s[2]);t.lineEnd()}function zm(r,t){var e=-1,n=r.length;for(t.polygonStart();++e<n;)$c(r[e],t,1);t.polygonEnd()}function dI(r,t){r&&Vm.hasOwnProperty(r.type)?Vm[r.type](r,t):ih(r,t)}vs(),vs();function Kc(r){return[ca(r[1],r[0]),Zs(r[2])]}function da(r){var t=r[0],e=r[1],n=ie(e);return[n*ie(t),n*se(t),se(e)]}function sh(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function oh(r,t){return[r[1]*t[2]-r[2]*t[1],r[2]*t[0]-r[0]*t[2],r[0]*t[1]-r[1]*t[0]]}function Zc(r,t){r[0]+=t[0],r[1]+=t[1],r[2]+=t[2]}function ah(r,t){return[r[0]*t,r[1]*t,r[2]*t]}function tf(r){var t=fa(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);r[0]/=t,r[1]/=t,r[2]/=t}vs();function Gm(r,t){function e(n,i){return n=r(n,i),t(n[0],n[1])}return r.invert&&t.invert&&(e.invert=function(n,i){return n=t.invert(n,i),n&&r.invert(n[0],n[1])}),e}function ef(r,t){return[r>bt?r-gi:r<-bt?r+gi:r,t]}ef.invert=ef;function pI(r,t,e){return(r%=gi)?t||e?Gm(Wm(r),Xm(t,e)):Wm(r):t||e?Xm(t,e):ef}function qm(r){return function(t,e){return t+=r,[t>bt?t-gi:t<-bt?t+gi:t,e]}}function Wm(r){var t=qm(r);return t.invert=qm(-r),t}function Xm(r,t){var e=ie(r),n=se(r),i=ie(t),s=se(t);function o(a,u){var l=ie(u),h=ie(a)*l,c=se(a)*l,f=se(u),p=f*e+h*n;return[ca(c*i-p*s,h*e-f*n),Zs(p*i+c*s)]}return o.invert=function(a,u){var l=ie(u),h=ie(a)*l,c=se(a)*l,f=se(u),p=f*i-c*s;return[ca(c*i+f*s,h*e+p*n),Zs(p*e-h*n)]},o}function gI(r,t,e,n,i,s){if(e){var o=ie(t),a=se(t),u=n*e;i==null?(i=t+n*gi,s=t-u/2):(i=Bm(o,i),s=Bm(o,s),(n>0?i<s:i>s)&&(i+=n*gi));for(var l,h=i;n>0?h>s:h<s;h-=u)l=Kc([o,-a*ie(h),-a*se(h)]),r.point(l[0],l[1])}}function Bm(r,t){t=da(t),t[0]-=r,tf(t);var e=km(-t[1]);return((-t[2]<0?-e:e)+gi-Bt)%gi}function Hm(){var r=[],t;return{point:function(e,n){t.push([e,n])},lineStart:function(){r.push(t=[])},lineEnd:Hu,rejoin:function(){r.length>1&&r.push(r.pop().concat(r.shift()))},result:function(){var e=r;return r=[],t=null,e}}}function mI(r,t,e,n,i,s){var o=r[0],a=r[1],u=t[0],l=t[1],h=0,c=1,f=u-o,p=l-a,m;if(m=e-o,!(!f&&m>0)){if(m/=f,f<0){if(m<h)return;m<c&&(c=m)}else if(f>0){if(m>c)return;m>h&&(h=m)}if(m=i-o,!(!f&&m<0)){if(m/=f,f<0){if(m>c)return;m>h&&(h=m)}else if(f>0){if(m<h)return;m<c&&(c=m)}if(m=n-a,!(!p&&m>0)){if(m/=p,p<0){if(m<h)return;m<c&&(c=m)}else if(p>0){if(m>c)return;m>h&&(h=m)}if(m=s-a,!(!p&&m<0)){if(m/=p,p<0){if(m>c)return;m>h&&(h=m)}else if(p>0){if(m<h)return;m<c&&(c=m)}return h>0&&(r[0]=o+h*f,r[1]=a+h*p),c<1&&(t[0]=o+c*f,t[1]=a+c*p),!0}}}}}function uh(r,t){return Fe(r[0]-t[0])<Bt&&Fe(r[1]-t[1])<Bt}function lh(r,t,e,n){this.x=r,this.z=t,this.o=e,this.e=n,this.v=!1,this.n=this.p=null}function Ym(r,t,e,n,i){var s=[],o=[],a,u;if(r.forEach(function(m){if(!((_=m.length-1)<=0)){var _,E=m[0],C=m[_],v;if(uh(E,C)){for(i.lineStart(),a=0;a<_;++a)i.point((E=m[a])[0],E[1]);i.lineEnd();return}s.push(v=new lh(E,m,null,!0)),o.push(v.o=new lh(E,null,v,!1)),s.push(v=new lh(C,m,null,!1)),o.push(v.o=new lh(C,null,v,!0))}}),!!s.length){for(o.sort(t),Jm(s),Jm(o),a=0,u=o.length;a<u;++a)o[a].e=e=!e;for(var l=s[0],h,c;;){for(var f=l,p=!0;f.v;)if((f=f.n)===l)return;h=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(a=0,u=h.length;a<u;++a)i.point((c=h[a])[0],c[1]);else n(f.x,f.n.x,1,i);f=f.n}else{if(p)for(h=f.p.z,a=h.length-1;a>=0;--a)i.point((c=h[a])[0],c[1]);else n(f.x,f.p.x,-1,i);f=f.p}f=f.o,h=f.z,p=!p}while(!f.v);i.lineEnd()}}}function Jm(r){if(t=r.length){for(var t,e=0,n=r[0],i;++e<t;)n.n=i=r[e],i.p=n,n=i;n.n=i=r[0],i.p=n}}function jm(r,t){return r<t?-1:r>t?1:r>=t?0:NaN}function vI(r){return r.length===1&&(r=yI(r)),{left:function(t,e,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var s=n+i>>>1;r(t[s],e)<0?n=s+1:i=s}return n},right:function(t,e,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var s=n+i>>>1;r(t[s],e)>0?i=s:n=s+1}return n}}}function yI(r){return function(t,e){return jm(r(t),e)}}vI(jm);function Qm(r){for(var t=r.length,e,n=-1,i=0,s,o;++n<t;)i+=r[n].length;for(s=new Array(i);--t>=0;)for(o=r[t],e=o.length;--e>=0;)s[--i]=o[e];return s}var Yu=1e9,hh=-Yu;function _I(r,t,e,n){function i(l,h){return r<=l&&l<=e&&t<=h&&h<=n}function s(l,h,c,f){var p=0,m=0;if(l==null||(p=o(l,c))!==(m=o(h,c))||u(l,h)<0^c>0)do f.point(p===0||p===3?r:e,p>1?n:t);while((p=(p+c+4)%4)!==m);else f.point(h[0],h[1])}function o(l,h){return Fe(l[0]-r)<Bt?h>0?0:3:Fe(l[0]-e)<Bt?h>0?2:1:Fe(l[1]-t)<Bt?h>0?1:0:h>0?3:2}function a(l,h){return u(l.x,h.x)}function u(l,h){var c=o(l,1),f=o(h,1);return c!==f?c-f:c===0?h[1]-l[1]:c===1?l[0]-h[0]:c===2?l[1]-h[1]:h[0]-l[0]}return function(l){var h=l,c=Hm(),f,p,m,_,E,C,v,y,w,S,P,M={point:b,lineStart:L,lineEnd:A,polygonStart:F,polygonEnd:N};function b(H,et){i(H,et)&&h.point(H,et)}function D(){for(var H=0,et=0,ht=p.length;et<ht;++et)for(var Rt=p[et],Qt=1,ke=Rt.length,Ft=Rt[0],Ot,Ve,Ah=Ft[0],Za=Ft[1];Qt<ke;++Qt)Ot=Ah,Ve=Za,Ft=Rt[Qt],Ah=Ft[0],Za=Ft[1],Ve<=n?Za>n&&(Ah-Ot)*(n-Ve)>(Za-Ve)*(r-Ot)&&++H:Za<=n&&(Ah-Ot)*(n-Ve)<(Za-Ve)*(r-Ot)&&--H;return H}function F(){h=c,f=[],p=[],P=!0}function N(){var H=D(),et=P&&H,ht=(f=Qm(f)).length;(et||ht)&&(l.polygonStart(),et&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),ht&&Ym(f,a,H,s,l),l.polygonEnd()),h=l,f=p=m=null}function L(){M.point=k,p&&p.push(m=[]),S=!0,w=!1,v=y=NaN}function A(){f&&(k(_,E),C&&w&&c.rejoin(),f.push(c.result())),M.point=b,w&&h.lineEnd()}function k(H,et){var ht=i(H,et);if(p&&m.push([H,et]),S)_=H,E=et,C=ht,S=!1,ht&&(h.lineStart(),h.point(H,et));else if(ht&&w)h.point(H,et);else{var Rt=[v=Math.max(hh,Math.min(Yu,v)),y=Math.max(hh,Math.min(Yu,y))],Qt=[H=Math.max(hh,Math.min(Yu,H)),et=Math.max(hh,Math.min(Yu,et))];mI(Rt,Qt,r,t,e,n)?(w||(h.lineStart(),h.point(Rt[0],Rt[1])),h.point(Qt[0],Qt[1]),ht||h.lineEnd(),P=!1):ht&&(h.lineStart(),h.point(H,et),P=!1)}v=H,y=et,w=ht}return M}}var rf=vs();function wI(r,t){var e=t[0],n=t[1],i=[se(e),-ie(e),0],s=0,o=0;rf.reset();for(var a=0,u=r.length;a<u;++a)if(h=(l=r[a]).length)for(var l,h,c=l[h-1],f=c[0],p=c[1]/2+Fm,m=se(p),_=ie(p),E=0;E<h;++E,f=v,m=w,_=S,c=C){var C=l[E],v=C[0],y=C[1]/2+Fm,w=se(y),S=ie(y),P=v-f,M=P>=0?1:-1,b=M*P,D=b>bt,F=m*w;if(rf.add(ca(F*M*se(b),_*S+F*ie(b))),s+=D?P+M*gi:P,D^f>=e^v>=e){var N=oh(da(c),da(C));tf(N);var L=oh(i,N);tf(L);var A=(D^P>=0?-1:1)*Zs(L[2]);(n>A||n===A&&(N[0]||N[1]))&&(o+=D^P>=0?1:-1)}}return(s<-Bt||s<Bt&&rf<-Bt)^o&1}vs();function $m(r){return r}vs(),vs();var pa=1/0,ch=pa,Ju=-pa,fh=Ju,Km={point:EI,lineStart:Hu,lineEnd:Hu,polygonStart:Hu,polygonEnd:Hu,result:function(){var r=[[pa,ch],[Ju,fh]];return Ju=fh=-(ch=pa=1/0),r}};function EI(r,t){r<pa&&(pa=r),r>Ju&&(Ju=r),t<ch&&(ch=t),t>fh&&(fh=t)}vs();function Zm(r,t,e,n){return function(i,s){var o=t(s),a=i.invert(n[0],n[1]),u=Hm(),l=t(u),h=!1,c,f,p,m={point:_,lineStart:C,lineEnd:v,polygonStart:function(){m.point=y,m.lineStart=w,m.lineEnd=S,f=[],c=[]},polygonEnd:function(){m.point=_,m.lineStart=C,m.lineEnd=v,f=Qm(f);var P=wI(c,a);f.length?(h||(s.polygonStart(),h=!0),Ym(f,CI,P,e,s)):P&&(h||(s.polygonStart(),h=!0),s.lineStart(),e(null,null,1,s),s.lineEnd()),h&&(s.polygonEnd(),h=!1),f=c=null},sphere:function(){s.polygonStart(),s.lineStart(),e(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function _(P,M){var b=i(P,M);r(P=b[0],M=b[1])&&s.point(P,M)}function E(P,M){var b=i(P,M);o.point(b[0],b[1])}function C(){m.point=E,o.lineStart()}function v(){m.point=_,o.lineEnd()}function y(P,M){p.push([P,M]);var b=i(P,M);l.point(b[0],b[1])}function w(){l.lineStart(),p=[]}function S(){y(p[0][0],p[0][1]),l.lineEnd();var P=l.clean(),M=u.result(),b,D=M.length,F,N,L;if(p.pop(),c.push(p),p=null,!!D){if(P&1){if(N=M[0],(F=N.length-1)>0){for(h||(s.polygonStart(),h=!0),s.lineStart(),b=0;b<F;++b)s.point((L=N[b])[0],L[1]);s.lineEnd()}return}D>1&&P&2&&M.push(M.pop().concat(M.shift())),f.push(M.filter(SI))}}return m}}function SI(r){return r.length>1}function CI(r,t){return((r=r.x)[0]<0?r[1]-pi-Bt:pi-r[1])-((t=t.x)[0]<0?t[1]-pi-Bt:pi-t[1])}const tv=Zm(function(){return!0},II,MI,[-bt,-pi]);function II(r){var t=NaN,e=NaN,n=NaN,i;return{lineStart:function(){r.lineStart(),i=1},point:function(s,o){var a=s>0?bt:-bt,u=Fe(s-t);Fe(u-bt)<Bt?(r.point(t,e=(e+o)/2>0?pi:-pi),r.point(n,e),r.lineEnd(),r.lineStart(),r.point(a,e),r.point(s,e),i=0):n!==a&&u>=bt&&(Fe(t-n)<Bt&&(t-=n*Bt),Fe(s-a)<Bt&&(s-=a*Bt),e=PI(t,e,s,o),r.point(n,e),r.lineEnd(),r.lineStart(),r.point(a,e),i=0),r.point(t=s,e=o),n=a},lineEnd:function(){r.lineEnd(),t=e=NaN},clean:function(){return 2-i}}}function PI(r,t,e,n){var i,s,o=se(r-e);return Fe(o)>Bt?fI((se(t)*(s=ie(n))*se(e)-se(n)*(i=ie(t))*se(r))/(i*s*o)):(t+n)/2}function MI(r,t,e,n){var i;if(r==null)i=e*pi,n.point(-bt,i),n.point(0,i),n.point(bt,i),n.point(bt,0),n.point(bt,-i),n.point(0,-i),n.point(-bt,-i),n.point(-bt,0),n.point(-bt,i);else if(Fe(r[0]-t[0])>Bt){var s=r[0]<t[0]?bt:-bt;i=e*s/2,n.point(-s,i),n.point(0,i),n.point(s,i)}else n.point(t[0],t[1])}function bI(r,t){var e=ie(r),n=e>0,i=Fe(e)>Bt;function s(h,c,f,p){gI(p,r,t,f,h,c)}function o(h,c){return ie(h)*ie(c)>e}function a(h){var c,f,p,m,_;return{lineStart:function(){m=p=!1,_=1},point:function(E,C){var v=[E,C],y,w=o(E,C),S=n?w?0:l(E,C):w?l(E+(E<0?bt:-bt),C):0;if(!c&&(m=p=w)&&h.lineStart(),w!==p&&(y=u(c,v),(!y||uh(c,y)||uh(v,y))&&(v[0]+=Bt,v[1]+=Bt,w=o(v[0],v[1]))),w!==p)_=0,w?(h.lineStart(),y=u(v,c),h.point(y[0],y[1])):(y=u(c,v),h.point(y[0],y[1]),h.lineEnd()),c=y;else if(i&&c&&n^w){var P;!(S&f)&&(P=u(v,c,!0))&&(_=0,n?(h.lineStart(),h.point(P[0][0],P[0][1]),h.point(P[1][0],P[1][1]),h.lineEnd()):(h.point(P[1][0],P[1][1]),h.lineEnd(),h.lineStart(),h.point(P[0][0],P[0][1])))}w&&(!c||!uh(c,v))&&h.point(v[0],v[1]),c=v,p=w,f=S},lineEnd:function(){p&&h.lineEnd(),c=null},clean:function(){return _|(m&&p)<<1}}}function u(h,c,f){var p=da(h),m=da(c),_=[1,0,0],E=oh(p,m),C=sh(E,E),v=E[0],y=C-v*v;if(!y)return!f&&h;var w=e*C/y,S=-e*v/y,P=oh(_,E),M=ah(_,w),b=ah(E,S);Zc(M,b);var D=P,F=sh(M,D),N=sh(D,D),L=F*F-N*(sh(M,M)-1);if(!(L<0)){var A=fa(L),k=ah(D,(-F-A)/N);if(Zc(k,M),k=Kc(k),!f)return k;var H=h[0],et=c[0],ht=h[1],Rt=c[1],Qt;et<H&&(Qt=H,H=et,et=Qt);var ke=et-H,Ft=Fe(ke-bt)<Bt,Ot=Ft||ke<Bt;if(!Ft&&Rt<ht&&(Qt=ht,ht=Rt,Rt=Qt),Ot?Ft?ht+Rt>0^k[1]<(Fe(k[0]-H)<Bt?ht:Rt):ht<=k[1]&&k[1]<=Rt:ke>bt^(H<=k[0]&&k[0]<=et)){var Ve=ah(D,(-F+A)/N);return Zc(Ve,M),[k,Kc(Ve)]}}}function l(h,c){var f=n?r:bt-r,p=0;return h<-f?p|=1:h>f&&(p|=2),c<-f?p|=4:c>f&&(p|=8),p}return Zm(o,a,s,n?[0,-r]:[-bt,r-bt])}function ev(r){return function(t){var e=new nf;for(var n in r)e[n]=r[n];return e.stream=t,e}}function nf(){}nf.prototype={constructor:nf,point:function(r,t){this.stream.point(r,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function rv(r,t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],s=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),s!=null&&r.clipExtent(null),dI(e,r.stream(Km));var o=Km.result(),a=Math.min(n/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),u=+t[0][0]+(n-a*(o[1][0]+o[0][0]))/2,l=+t[0][1]+(i-a*(o[1][1]+o[0][1]))/2;return s!=null&&r.clipExtent(s),r.scale(a*150).translate([u,l])}function xI(r,t,e){return rv(r,[[0,0],t],e)}var nv=16,NI=ie(30*mn);function iv(r,t){return+t?OI(r,t):TI(r)}function TI(r){return ev({point:function(t,e){t=r(t,e),this.stream.point(t[0],t[1])}})}function OI(r,t){function e(n,i,s,o,a,u,l,h,c,f,p,m,_,E){var C=l-n,v=h-i,y=C*C+v*v;if(y>4*t&&_--){var w=o+f,S=a+p,P=u+m,M=fa(w*w+S*S+P*P),b=Zs(P/=M),D=Fe(Fe(P)-1)<Bt||Fe(s-c)<Bt?(s+c)/2:ca(S,w),F=r(D,b),N=F[0],L=F[1],A=N-n,k=L-i,H=v*A-C*k;(H*H/y>t||Fe((C*A+v*k)/y-.5)>.3||o*f+a*p+u*m<NI)&&(e(n,i,s,o,a,u,N,L,D,w/=M,S/=M,P,_,E),E.point(N,L),e(N,L,D,w,S,P,l,h,c,f,p,m,_,E))}}return function(n){var i,s,o,a,u,l,h,c,f,p,m,_,E={point:C,lineStart:v,lineEnd:w,polygonStart:function(){n.polygonStart(),E.lineStart=S},polygonEnd:function(){n.polygonEnd(),E.lineStart=v}};function C(b,D){b=r(b,D),n.point(b[0],b[1])}function v(){c=NaN,E.point=y,n.lineStart()}function y(b,D){var F=da([b,D]),N=r(b,D);e(c,f,h,p,m,_,c=N[0],f=N[1],h=b,p=F[0],m=F[1],_=F[2],nv,n),n.point(c,f)}function w(){E.point=C,n.lineEnd()}function S(){v(),E.point=P,E.lineEnd=M}function P(b,D){y(i=b,D),s=c,o=f,a=p,u=m,l=_,E.point=y}function M(){e(c,f,h,p,m,_,s,o,i,a,u,l,nv,n),E.lineEnd=w,w()}return E}}var DI=ev({point:function(r,t){this.stream.point(r*mn,t*mn)}});function AI(r){return LI(function(){return r})()}function LI(r){var t,e=150,n=480,i=250,s,o,a=0,u=0,l=0,h=0,c=0,f,p,m=null,_=tv,E=null,C,v,y,w=$m,S=.5,P=iv(N,S),M,b;function D(k){return k=p(k[0]*mn,k[1]*mn),[k[0]*e+s,o-k[1]*e]}function F(k){return k=p.invert((k[0]-s)/e,(o-k[1])/e),k&&[k[0]*ys,k[1]*ys]}function N(k,H){return k=t(k,H),[k[0]*e+s,o-k[1]*e]}D.stream=function(k){return M&&b===k?M:M=DI(_(f,P(w(b=k))))},D.clipAngle=function(k){return arguments.length?(_=+k?bI(m=k*mn,6*mn):(m=null,tv),A()):m*ys},D.clipExtent=function(k){return arguments.length?(w=k==null?(E=C=v=y=null,$m):_I(E=+k[0][0],C=+k[0][1],v=+k[1][0],y=+k[1][1]),A()):E==null?null:[[E,C],[v,y]]},D.scale=function(k){return arguments.length?(e=+k,L()):e},D.translate=function(k){return arguments.length?(n=+k[0],i=+k[1],L()):[n,i]},D.center=function(k){return arguments.length?(a=k[0]%360*mn,u=k[1]%360*mn,L()):[a*ys,u*ys]},D.rotate=function(k){return arguments.length?(l=k[0]%360*mn,h=k[1]%360*mn,c=k.length>2?k[2]%360*mn:0,L()):[l*ys,h*ys,c*ys]},D.precision=function(k){return arguments.length?(P=iv(N,S=k*k),A()):fa(S)},D.fitExtent=function(k,H){return rv(D,k,H)},D.fitSize=function(k,H){return xI(D,k,H)};function L(){p=Gm(f=pI(l,h,c),t);var k=t(a,u);return s=n-k[0]*e,o=i+k[1]*e,A()}function A(){return M=b=null,D}return function(){return t=r.apply(this,arguments),D.invert=t.invert&&F,L()}}function sv(r){return function(t,e){var n=ie(t),i=ie(e),s=r(n*i);return[s*i*se(t),s*se(e)]}}function ov(r){return function(t,e){var n=fa(t*t+e*e),i=r(n),s=se(i),o=ie(i);return[ca(t*s,n*o),Zs(n&&e*s/n)]}}var RI=sv(function(r){return fa(2/(1+r))});RI.invert=ov(function(r){return 2*Zs(r/2)});var av=sv(function(r){return(r=km(r))&&r/se(r)});av.invert=ov(function(r){return r});function FI(){return AI(av).scale(79.4188).clipAngle(179.999)}function uv(r,t){return[r,t]}uv.invert=uv;function kI(r,t,e){e=e||{};var n=e.units||"kilometers",i=e.steps||8;if(!r)throw new Error("geojson is required");if(typeof e!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var s=[];switch(r.type){case"GeometryCollection":return Nl(r,function(o){var a=dh(o,t,n,i);a&&s.push(a)}),Lr(s);case"FeatureCollection":return Fo(r,function(o){var a=dh(o,t,n,i);a&&Fo(a,function(u){u&&s.push(u)})}),Lr(s)}return dh(r,t,n,i)}function dh(r,t,e,n){var i=r.properties||{},s=r.type==="Feature"?r.geometry:r;if(s.type==="GeometryCollection"){var o=[];return Nl(r,function(_){var E=dh(_,t,e,n);E&&o.push(E)}),Lr(o)}var a=VI(s),u={type:s.type,coordinates:hv(s.coordinates,a)},l=new Gc,h=l.read(u),c=oc(ac(t,e),"meters"),f=pe.bufferOp(h,c,n),p=new gm;if(f=p.write(f),!lv(f.coordinates)){var m={type:f.type,coordinates:cv(f.coordinates,a)};return jr(m,i)}}function lv(r){return Array.isArray(r[0])?lv(r[0]):isNaN(r[0])}function hv(r,t){return typeof r[0]!="object"?t(r):r.map(function(e){return hv(e,t)})}function cv(r,t){return typeof r[0]!="object"?t.invert(r):r.map(function(e){return cv(e,t)})}function VI(r){var t=Sg(r).geometry.coordinates,e=[-t[0],-t[1]];return FI().rotate(e).scale(ze)}function UI(r,t,e){e===void 0&&(e={});var n=$e(r),i=$e(t),s=Dc.union(n.coordinates,i.coordinates);return s.length===0?null:s.length===1?kt(s[0],e.properties):sc(s,e.properties)}function ju(r,t,e){e===void 0&&(e={});var n=$e(r),i=$e(t),s=Dc.intersection(n.coordinates,i.coordinates);return s.length===0?null:s.length===1?kt(s[0],e.properties):sc(s,e.properties)}function zI(r,t,e){e===void 0&&(e={});var n=JSON.stringify(e.properties||{}),i=r[0],s=r[1],o=r[2],a=r[3],u=(s+a)/2,l=(i+o)/2,h=t*2/we([i,u],[o,u],e),c=h*(o-i),f=t*2/we([l,s],[l,a],e),p=f*(a-s),m=c/2,_=m*2,E=Math.sqrt(3)/2*p,C=o-i,v=a-s,y=3/4*_,w=E,S=(C-_)/(_-m/2),P=Math.floor(S),M=(P*y-m/2-C)/2-m/2+y/2,b=Math.floor((v-E)/E),D=(v-b*E)/2,F=b*E-v>E/2;F&&(D-=E/4);for(var N=[],L=[],A=0;A<6;A++){var k=2*Math.PI/6*A;N.push(Math.cos(k)),L.push(Math.sin(k))}for(var H=[],et=0;et<=P;et++)for(var ht=0;ht<=b;ht++){var Rt=et%2===1;if(!(ht===0&&Rt)&&!(ht===0&&F)){var Qt=et*y+i-M,ke=ht*w+s+D;if(Rt&&(ke-=E/2),e.triangles===!0)qI([Qt,ke],c/2,p/2,JSON.parse(n),N,L).forEach(function(Ot){e.mask?ju(e.mask,Ot)&&H.push(Ot):H.push(Ot)});else{var Ft=GI([Qt,ke],c/2,p/2,JSON.parse(n),N,L);e.mask?ju(e.mask,Ft)&&H.push(Ft):H.push(Ft)}}}return Lr(H)}function GI(r,t,e,n,i,s){for(var o=[],a=0;a<6;a++){var u=r[0]+t*i[a],l=r[1]+e*s[a];o.push([u,l])}return o.push(o[0].slice()),kt([o],n)}function qI(r,t,e,n,i,s){for(var o=[],a=0;a<6;a++){var u=[];u.push(r),u.push([r[0]+t*i[a],r[1]+e*s[a]]),u.push([r[0]+t*i[(a+1)%6],r[1]+e*s[(a+1)%6]]),u.push(r),o.push(kt([u],n))}return o}function WI(r,t,e,n){n===void 0&&(n={});for(var i=[],s=r[0],o=r[1],a=r[2],u=r[3],l=t/we([s,o],[a,o],n),h=l*(a-s),c=e/we([s,o],[s,u],n),f=c*(u-o),p=a-s,m=u-o,_=Math.floor(p/h),E=Math.floor(m/f),C=(p-_*h)/2,v=(m-E*f)/2,y=s+C,w=0;w<_;w++){for(var S=o+v,P=0;P<E;P++){var M=kt([[[y,S],[y,S+f],[y+h,S+f],[y+h,S],[y,S]]],n.properties);n.mask?TC(n.mask,M)&&i.push(M):i.push(M),S+=f}y+=h}return Lr(i)}function XI(r,t,e){return e===void 0&&(e={}),WI(r,t,t,e)}function BI(r,t,e){e===void 0&&(e={});for(var n=[],i=t/we([r[0],r[1]],[r[2],r[1]],e),s=i*(r[2]-r[0]),o=t/we([r[0],r[1]],[r[0],r[3]],e),a=o*(r[3]-r[1]),u=0,l=r[0];l<=r[2];){for(var h=0,c=r[1];c<=r[3];){var f=null,p=null;u%2===0&&h%2===0?(f=kt([[[l,c],[l,c+a],[l+s,c],[l,c]]],e.properties),p=kt([[[l,c+a],[l+s,c+a],[l+s,c],[l,c+a]]],e.properties)):u%2===0&&h%2===1?(f=kt([[[l,c],[l+s,c+a],[l+s,c],[l,c]]],e.properties),p=kt([[[l,c],[l,c+a],[l+s,c+a],[l,c]]],e.properties)):h%2===0&&u%2===1?(f=kt([[[l,c],[l,c+a],[l+s,c+a],[l,c]]],e.properties),p=kt([[[l,c],[l+s,c+a],[l+s,c],[l,c]]],e.properties)):h%2===1&&u%2===1&&(f=kt([[[l,c],[l,c+a],[l+s,c],[l,c]]],e.properties),p=kt([[[l,c+a],[l+s,c+a],[l+s,c],[l,c+a]]],e.properties)),e.mask?(ju(e.mask,f)&&n.push(f),ju(e.mask,p)&&n.push(p)):(n.push(f),n.push(p)),c+=a,h++}u++,l+=s}return Lr(n)}function HI(r,t,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var n=e.gridType,i=e.property,s=e.weight;if(!r)throw new Error("points is required");if(iS(r,"Point","input must contain Points"),!t)throw new Error("cellSize is required");if(s!==void 0&&typeof s!="number")throw new Error("weight must be a number");i=i||"elevation",n=n||"square",s=s||1;var o=Qr(r),a;switch(n){case"point":case"points":a=lC(o,t,e);break;case"square":case"squares":a=XI(o,t,e);break;case"hex":case"hexes":a=zI(o,t,e);break;case"triangle":case"triangles":a=BI(o,t,e);break;default:throw new Error("invalid gridType")}var u=[];return Fo(a,function(l){var h=0,c=0;Fo(r,function(p){var m=n==="point"?l:yc(l),_=we(m,p,e),E;if(i!==void 0&&(E=p.properties[i]),E===void 0&&(E=p.geometry.coordinates[2]),E===void 0)throw new Error("zValue is missing");_===0&&(h=E);var C=1/Math.pow(_,s);c+=C,h+=C*E});var f=LS(l);f.properties[i]=h/c,u.push(f)}),Lr(u)}function YI(r,t){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1])&&r.push(r[0]);const e=xt(t),n=kt([r]);return be(e,n)}function JI(r,t){const e=Ir(r);return Sc(e,t,{units:"meters"}).geometry.coordinates}function sf(r){if((r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),r.length<=3)return 0;const t=kt([r]);return KS(t)}function jI(r){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]);const t=kt([r]),n=Cg(t).geometry.coordinates;return[n[0],n[1],n[2]??r[0][2]??0]}function fv(r,t,e,n){const[i,s,o]=r,a=Go(xt([i,s]),t,e,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return n=n||[0,0,0],n[0]=a.geometry.coordinates[0],n[1]=a.geometry.coordinates[1],n[2]=o,n}function ph(r,t){return we(xt(r),xt(t),{units:"meters"})}function Qu(r,t){return Eu(xt(r),xt(t))}function QI(r,t){return Su(Ir(r),Ir(t))}function $I(r,t){const e=xt(r),n=xt(t),i=VS(e,n),s=(r[2]+t[2])/2;return[...i.geometry.coordinates,s]}function KI(r,t){const e=xt(t),n=Ir(r);return JS(n,e,{units:"meters"})}function ZI(r,t){const e=xt(r),n=Ir(t);return QS(e,n,{units:"meters"})}function tP(r,t,e,n){const[i,s,o]=r,a=dC(xt([i,s]),t,e,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return n=n||[0,0,0],n[0]=a.geometry.coordinates[0],n[1]=a.geometry.coordinates[1],n[2]=o,n}function dv(r,t){return Ag(xt(r),xt(t),{units:"meters"})}function eP(r,t){return fC(xt(r),xt(t))}function pv(r,t){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=ju(kt([r]),kt([t]));if(e)return e.geometry.coordinates}function gv(r,t){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=UI(kt([r]),kt([t]));if(e)return e.geometry.coordinates}function mv(r,t=500,e="meters"){const n=kI(Ir(r),t,{units:e});if(n)return n.geometry.coordinates}function vv(r,t){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=JC(kt([r]),kt([t]));if(e)return e.geometry.coordinates}function yv(r,t,e=10,n="meters"){return FS(r,t,{steps:e,units:n}).geometry.coordinates}function of(r,t){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=kt([r]),n=kt([t]);return EC(e,n)?"oneBig":Ug(e,n)?"twoBig":!1}function _v(r){const t=g.min(g.objsIterator(r,["0"])),e=g.min(g.objsIterator(r,["1"])),n=g.min(g.objsIterator(r,["2"])),i=g.max(g.objsIterator(r,["0"])),s=g.max(g.objsIterator(r,["1"])),o=g.max(g.objsIterator(r,["2"]));return{minPos:[t,e,n],maxPos:[i,s,o],center:[(t+i)*.5,(e+s)*.5,(n+o)*.5]}}function wv(r){const{minPos:t,maxPos:e,center:n}=_v(r);if(t.some(a=>!Number.isFinite(a)||e.some(u=>!Number.isFinite(u))||n.some(u=>!Number.isFinite(u)))){console.warn("geoCenterAndRadiusFromPositions error: minPos.some(e => !Number.isFinite(e) || maxPos.some(e => !Number.isFinite(e)) || center.some(e => !Number.isFinite(e))");return}const i=ph(t,e);let s=i*.5;const o=Math.abs(t[2]-e[2]);return o!=0&&(s=Math.sqrt(i*i+o*o)*.5),{center:n,radius:s}}function Ev(r,t){const e=ei(r),n=ei(t);return g.Vector.distance(e,n)}function $u(r,t){const e=[],n=r.length;let i=0;for(let s=0;s<n-1;++s){if(t===void 0||t==="GEODESIC"){const o=ph(r[s],r[s+1]),a=Math.abs(r[s][2]-r[s+1][2]);if(a===0)i+=o;else{const u=Math.sqrt(o*o+a*a);i+=u}}else if(t==="RHUMB"){const o=dv(r[s],r[s+1]),a=Math.abs(r[s][2]-r[s+1][2]);if(a===0)i+=o;else{const u=Math.sqrt(o*o+a*a);i+=u}}else if(t==="NONE"){const o=Ev(r[s],r[s+1]);i+=o}else console.warn(`未知的arcType: ${t},导致距离无法计算!`);e.push(i)}return e}function af(r){const t="__getXyzFromPostion";let e=g.getExtProp(r,t);return(!e||!g.Vector.equals(e[0],r))&&(e=[[...r],ei(r)],g.setExtProp(r,t,e)),e[1]}class Sv extends g.Tree{constructor(t){super(t)}get propUiTree(){return this.uiTree}}class uf extends g.TreeItem{constructor(t,e,n){super(t,e),this._property=n}get property(){return this._property}}class lf extends uf{constructor(t,e){super(t,!1,e)}}class hf extends uf{constructor(t,e){super(t,!0,e)}get groupChildren(){return this.children}}function Cv(r,t){const e=new Sv(t),n=r.getProperties("chinese"),i=[];for(let s of n)if(s instanceof nt){const o=new hf(e,s);o.d(()=>s.destroy()),e.children.push(o),i.push(o)}else{const o=new lf(e,s);e.children.push(o),o.d(()=>s.destroy())}for(;i.length>0;){const s=i.pop();if(!s)throw new Error("should not be here!");const o=s;if(!(o.property instanceof nt))throw new Error("!(treeItem.property instanceof GroupProperty)");for(let a of o.property.children)if(a instanceof nt){const u=new hf(e,a);u.d(()=>a.destroy()),o.groupChildren.push(u),i.push(u)}else{const u=new lf(e,a);o.groupChildren.push(u),u.d(()=>a.destroy())}}return e.d(()=>{e.itemChildrenChanged.reset(),e.itemChildrenToChange.reset();const s=[...e.getDescendants()];s.forEach(o=>{o.children&&(o.children.length=0),o.destroy()}),s.length=0}),e}class ga extends B{constructor(e){super();d(this,"_propTreeReact",this.dv(g.react(void 0)));this.d(()=>this._propTreeReact.value=void 0),this.dv(new g.ObjResettingWithEvent(this.sceneObjectChanged,n=>{if(!n)return;const i=new B;return i.d(n.toDestroyEvent.don(()=>{this.sceneObject=void 0})),i})),this.d(this.sceneObjectChanged.don(n=>{this._propTreeReact.value=void 0,!(!n||!(n instanceof K))&&(this._propTreeReact.value=Cv(n,e))}))}get propTree(){return this._propTreeReact.value}get propTreeChanged(){return this._propTreeReact.changed}}(r=>{r.createDefaultProps=()=>({sceneObject:void 0})})(ga||(ga={})),g.extendClassProps(ga.prototype,ga.createDefaultProps);function cf(r){return g.reactDeepArrayWithUndefined(r,(t,e)=>t[0]===e[0]&&t[1]===e[1],t=>[...t])}function Iv(r,t){const e=new Array;for(let n of r)e.push(t(n));return e}function ff(r,t){return r===void 0&&t===void 0?!0:!r||!t?!1:r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]}function rP(r,t,e){var i;((i=t.attachedViewers.values().toArray()[0])==null?void 0:i.getEngineObject(t))?e.call(r):(r.dispose(t.viewerAttached.don(()=>{e.call(r)})),r.dispose(t.createdEvent.don(()=>e.call(r))))}function nP(r,t,e,n=!0){n&&e(),r.dispose(t.disposableOn(e))}function iP(r,t){const{type:e,id:n}=r;if(e){const i=K.create(e,n);if(i)return i.json=r,i;console.warn(`cannot create sceneObject from type(${e})`)}else console.warn(`cannot create sceneObject from type(${e})`)}function Pv(r){const t=r.children&&g.every(r.children,n=>{if(!(n instanceof ir))throw new Error("!(treeItem instanceof SceneTreeItem)");return!n.show})||!1,e=r.sceneTree.getSceneObjectShowFunc(r.sceneObject);return!t||e}class ir extends g.TreeItem{constructor(e,n=!1,i,s,o=!0){super(e,n,i);d(this,"_dragDrop");d(this,"_showChangedNotAffectChildren",!1);d(this,"_showChangedNotAffectParent",!1);d(this,"_type",this.dv(g.react("Unknown")));d(this,"_isExport",this.dv(g.react(!0)));const a=()=>this.tree&&this.tree.itemsChanged.emit([this]);this.dispose(this.nameChanged.disposableOn(a)),this.name=`未命名条目(${this.id})`,this.extras=s,this._isExport.value=o;let u;const l=()=>{u&&(u(),u=void 0)};this.dispose(l),this.dispose(this.sceneObjectChanged.disposableOn(h=>{l(),h&&(u=g.bind([this,"name"],[h,"name"]))})),this.dispose(this.showChanged.disposableOn(h=>{if(e.setSceneObjectShowFunc(this.sceneObject,h),this.tree&&this.tree.forceRedraw(),this.children&&!this._showChangedNotAffectChildren)for(let c of this.children)c instanceof ir&&(c._showChangedNotAffectParent=!0,c.show=h,c._showChangedNotAffectParent=!1);this.parent&&this.parent instanceof ir&&!this._showChangedNotAffectParent&&(this.parent._showChangedNotAffectChildren=!0,this.parent.show=Pv(this.parent),this.parent._showChangedNotAffectChildren=!1)})),this.dv(new g.ObjResettingWithEvent(this.sceneObjectChanged,()=>{if(!this.sceneObject)return;const h=new B;if("show"in this.sceneObject&&"showChanged"in this.sceneObject&&this.sceneObject.showChanged instanceof V){const c=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};c(),h.dispose(this.sceneObject.showChanged.disposableOn(c))}else if("enabled"in this.sceneObject&&"enabledChanged"in this.sceneObject&&this.sceneObject.enabledChanged instanceof V){const c=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};c(),h.dispose(this.sceneObject.enabledChanged.disposableOn(c))}return h})),this.childrenChangedEvent.disposableOn(()=>{const h=Pv(this);this._showChangedNotAffectChildren=!0,this.show=h,this._showChangedNotAffectChildren=!1});{const h=()=>{let c="Unknown";this.sceneObject?c=this.sceneObject.typeName:this.children&&(c="Folder"),this._type.value=c};this.dispose(this.sceneObjectChanged.disposableOn(h)),this.dispose(this.childrenResetedEvent.disposableOn(h)),h()}}get dragDrop(){return this._dragDrop||(this._dragDrop=this.dv(this.sceneTree.createTreeItemDragDropFunc(this))),this._dragDrop}get type(){return this._type.value}get typeChanged(){return this._type.changed}get isExport(){return this._isExport.value}get isExportChanged(){return this._isExport.changed}set isExport(e){this._isExport.value=e}get sceneTree(){return this.tree}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){try{this.json=JSON.parse(e)}catch(n){console.error(`sceneTreeItem.jsonStr error ${n}`,n)}}get json(){const e=this.children&&[...this.children].filter(n=>n.isExport).map(n=>n.json);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.json,children:e,extras:this.extras}}set json(e){if(e.name!==void 0&&(this.name=e.name),this.extras=e.extras,this._showChangedNotAffectChildren=!0,this._showChangedNotAffectParent=!0,this.show=e.show??!0,this._showChangedNotAffectChildren=!1,this._showChangedNotAffectParent=!1,this.uiTreeObject.collapsed=e.collapsed??!1,this.sceneObject=void 0,e.sceneObj&&(this.sceneObject=this.sceneTree.createSceneObjectFunc(e.sceneObj,this)),!!e.children){if(this.resetChildren(!0),!this.children)throw new Error("resetChildren(true) cannot get children!");for(let n of e.children){const i=new ir(this.tree,!0);i.json=n,this.children.push(i)}}}clone(){try{const e=new ir(this.sceneTree,!!this.children,void 0,this.extras,this.isExport);return e.json=this.json,e.name=this.sceneTree.getSceneTreeItemCloneNameFunc(this),e}catch(e){console.error(`SceneTreeItem.clone error: ${e}`,e)}}insertNewTreeItem(e,n){if(e==="FolderInnerOrAfter"||e==="FolderInnerOrBefore"||e==="FolderInner"){if(n&&n.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&!(e.includes("Or")&&this.sceneObject))return n&&this.children.push(n),!0;if(e==="FolderInner")return!1;if(e==="FolderInnerOrAfter")return super.insertNewTreeItem("After",n);if(e==="FolderInnerOrBefore")return super.insertNewTreeItem("Before",n);throw new Error("should not be here!")}else return super.insertNewTreeItem(e,n)}}(r=>{r.createDefaultProps=()=>({name:"未命名条目",nameEditing:!1,sceneObject:void 0,show:!0,extras:g.reactJsonWithUndefined(void 0)})})(ir||(ir={})),g.extendClassProps(ir.prototype,ir.createDefaultProps);function Mv(r,t,e){let{offsetY:n}=t;if(!t.target||!("clientTop"in t.target))return"none";n+=2,n+=t.target.clientTop;let i="none";return r.children?n<=e*.3?i="before":n>=e*.7?!r.uiTreeObject.collapsed&&r.children.length>0?i="inner":i="after":i="inner":n<=e*.5?i="before":i="after",i}class bv extends tp{constructor(t){super(),this._treeItem=t;const{dragStartDataManager:e}=this._treeItem.sceneTree;let n="none";const i=this.disposeVar(g.createTimeoutWithStartValues(()=>{this._treeItem.uiTreeObject.moveToPositionMode=n,console.log(`uiTreeObject.moveToPositionMode = lastDragMode(${n});`)},200));function s(o){n!==o&&(n=o,i.restart())}this.dispose(this._dragStartEvent.disposableOn(o=>{e.data={type:"UITreeA",value:this._treeItem}})),this.dispose(this._dragOverEvent.disposableOn(o=>{if(!o.dataTransfer)return;o.preventDefault();const a=e;if(a.data&&a.data.type==="UITreeA"&&a.data.value!==void 0){const u=a.data.value,l=this._treeItem,{tree:h}=l;if(h){const c=[...h.selectedItems];~c.indexOf(u)||c.push(u);const f=Mv(l,o,h.itemDivHeight);if(f!=="none"&&g.Tree.canMoveToTreeItems(c,l,f)){o.dataTransfer.dropEffect="move",s(f);return}}}o.dataTransfer.dropEffect="none",s("none")})),this.dispose(this._dropEvent.disposableOn(o=>{const a=e;if(!(a.data&&a.data.type==="UITreeA"&&a.data.value!==void 0))return;const u=a.data.value,l=this._treeItem,{tree:h}=l;if(!h)return;const c=[...h.selectedItems];~c.indexOf(u)||c.push(u);const f=Mv(l,o,h.itemDivHeight);f!=="none"&&g.Tree.canMoveToTreeItems(c,l,f)&&(g.Tree.moveToTreeItems(c,l,f),a.data=void 0,s("none"))})),this.dispose(this._dragLeaveEvent.disposableOn(()=>{n="none",i.restart()}))}}function sP(r){if(!(r instanceof ir))throw new Error("defaultCreateTreeItemDragDrop !(treeItem instanceof SceneTreeItem)");return new bv(r)}function oP(r){let t=!1;return r&&("show"in r?t=r.show??!0:"enabled"in r&&(t=r.enabled??!0)),t}function aP(r,t){r&&("show"in r?r.show=t:"enabled"in r&&(r.enabled=t))}const uP=["EnvironmentVariables","ScriptsLoader","SceneScript","ScriptLoader"];function lP(r){const t=[],{root:e={}}=r,n=[e];for(;n.length>0;){const i=n.pop();if(!i)throw new Error("!todo");if(i.children){for(let s of i.children)if(s.children&&n.unshift(s),s.sceneObj){const{type:o=void 0}=s.sceneObj;o||(console.warn("sceneObjJson has no type! treeItem.sceneObj: "),console.warn(s.sceneObj)),o&&uP.includes(o)&&t.push(s.sceneObj)}}}return t}async function hP(r,t){const e=lP(r);let n=0;const i=e.length;for(let s of e)if(++n,t){const o=n/i;t(o,n,i)}}class xv extends B{constructor(e,n){super();d(this,"treeItemContexMenuCallback");this._sceneTree=e,this._projectManager=n}get sceneTree(){return this._sceneTree}}class cP extends B{constructor(e){super();d(this,"_jsonLoadingEvent",this.disposeVar(new V));d(this,"_setJsonProcessing",this.disposeVar(g.createProcessingFromAsyncFunc(async(e,n)=>{this._jsonLoadingEvent.emit({type:"init"}),this._jsonLoadingEvent.emit({type:"loading"}),n&&await e.promise(this._sceneTree.preloadFunc(n)),this._setJson(n),this._jsonLoadingEvent.emit({type:"loaded"})})));this._sceneTree=e,this._setJsonProcessing.errorFunc=n=>{this._jsonLoadingEvent.emit({type:"error",error:n})}}get jsonLoadingEvent(){return this._jsonLoadingEvent}_setJson(e){try{this._sceneTree.setJson(e||{})}catch(n){console.error(`json数据装配时发生错误!error: ${n}`)}}get json(){return this._sceneTree.getJson()}set json(e){this._setJsonProcessing.restart(new g.CancelError("JSON重新赋值!"),e)}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){this.json=JSON.parse(e)}}function fP(r){return r.name+"_clone"}function df(r,t,e){if(r instanceof ir)return r.insertNewTreeItem(t,e);{const n={FolderInnerOrAfter:"InnerOrAfter",FolderInnerOrBefore:"InnerOrBefore",FolderInner:"Inner",InnerOrAfter:"InnerOrAfter",InnerOrBefore:"InnerOrBefore",Inner:"Inner",After:"After",Before:"Before"};return r.insertNewTreeItem(n[t],e)}}function dP(r){[r,...r.getDescendants()].forEach(t=>t.destroy())}const Ar=class Ar extends g.Tree{constructor(e,n,i,s){super(i);d(this,"_jsonLoading",this.disposeVar(new cP(this)));d(this,"createSceneObjectFunc",Ar.defaultCreateSceneObjectFunc);d(this,"createTreeItemDragDropFunc",Ar.defaultCreateTreeItemDragDropFunc);d(this,"preloadFunc",Ar.defaultPreload);d(this,"getSceneObjectShowFunc",Ar.defaultGetSceneObjectShow);d(this,"setSceneObjectShowFunc",Ar.defaultSetSceneObjectShow);d(this,"getSceneTreeItemCloneNameFunc",Ar.defaultGetSceneTreeItemCloneNameFunc);d(this,"debug",!1);d(this,"_contextMenu",this.disposeVar(new xv(this,this.projectManager)));d(this,"_showPropUiOnSelecting",this.disposeVar(g.react(!0)));this._name=e,this._dragStartDataManager=n,this._projectManager=s,this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{var a,u;window.lssn=this.lastSelectedItem,window.lsso=(a=this.lastSelectedItem)==null?void 0:a.sceneObject,this.debug&&console.log(((u=this.lastSelectedItem)==null?void 0:u.sceneObject)??"select null")}));const{sceneObjectsManager:o}=this._projectManager;this.dispose(this.itemsDeleted.disposableOn(a=>{for(let u of a){const l=u,{sceneObject:h}=l;h&&o.deleteSceneObject(h)&&h.destroy()&&fl(h,void 0);for(let c of l.getDescendants()){const{sceneObject:f}=c;f&&o.deleteSceneObject(f)&&f.destroy()&&fl(f,void 0)}dP(u)}})),this.dispose(this.itemsAdded.disposableOn(a=>{for(let u of a){const l=u;l.sceneObject&&o.addSceneObject(l.sceneObject)&&fl(l.sceneObject,l)}})),this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{if(!this.showPropUiOnSelecting)return;this._projectManager.propUiTreeManager.sceneObject=void 0;const{lastSelectedItem:a}=this;a&&(this._projectManager.propUiTreeManager.sceneObject=a.sceneObject)}))}get json(){return this._jsonLoading.json}set json(e){this._jsonLoading.json=e}get jsonStr(){return this._jsonLoading.jsonStr}set jsonStr(e){this._jsonLoading.jsonStr=e}get jsonLoadingEvent(){return this._jsonLoading.jsonLoadingEvent}get name(){return this._name}get projectManager(){return this._projectManager}get contextMenu(){return this._contextMenu}get showPropUiOnSelecting(){return this._showPropUiOnSelecting.value}set showPropUiOnSelecting(e){this._showPropUiOnSelecting.value=e}get showPropUiOnSelectingChanged(){return this._showPropUiOnSelecting.changed}get sceneUiTree(){return this.uiTree}getTreeItemFromSceneObjId(e){const n=this.getDescendants();let i;for(let s of n)if(s.sceneObject&&s.sceneObject.id===e){i=s;break}return i}get dragStartDataManager(){return this._dragStartDataManager}getJson(){return{root:{children:[...this.children].filter(e=>e.isExport).map(e=>e.json)}}}setJson(e){var i;e.root=e.root||{};const n=e.root.children??[];this.root.resetChildren(!0);for(let s of n){const o=new ir(this,!0);o.json=s,(i=this.root.children)==null||i.push(o)}}testAddNewTreeItem(e,n){const i=e||this.lastSelectedItem||this.root;return i?df(i,n):!1}addNewTreeItem(e,n,i,s){const o=e||this.lastSelectedItem||this.root;if(o&&df(o,n)){const a=new ir(this,i);if(a.sceneObject=s,!df(o,n,a))throw new Error("currentTreeItem.insertNewTreeItem return false!");return a}}createSceneObjectTreeItem(e,n,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${i?i.id:"root"})`);return}const a=K.create(e,n);return a?this.addNewTreeItem(i,s??"FolderInnerOrAfter",!0,a):void 0}createGroupTreeItem(e,n,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${i?i.id:"root"})`);return}const a=this.addNewTreeItem(i,s??"FolderInnerOrAfter",!0);if(!a){console.warn("addNewTreeItem error!");return}return a.name=e??"未命名组节点",a}createSceneObjectTreeItemFromClass(e,n,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o))return;const a=K.createFromClass(e,n);return a?this.addNewTreeItem(i,o,!0,a):void 0}createSceneObjectTreeItemFromJson(e,n,i){const s=i??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(n,s))return;const o=K.createFromJson(e);return console.log(o),o?this.addNewTreeItem(n,i??"FolderInnerOrAfter",!0,o):void 0}destroySceneObjectTreeItem(e){if(e===this.root){console.warn("cannot destroy root! please use function destroyAllSceneObjectTreeItems!");return}e.detachFromParent()}destroyAllSceneObjectTreeItems(){if(!this.root.children)return;const e=[...this.root.children];for(let n of e)this.destroySceneObjectTreeItem(n)}};d(Ar,"defaultCreateSceneObjectFunc",iP),d(Ar,"defaultCreateTreeItemDragDropFunc",sP),d(Ar,"defaultPreload",hP),d(Ar,"defaultGetSceneObjectShow",oP),d(Ar,"defaultSetSceneObjectShow",aP),d(Ar,"defaultGetSceneTreeItemCloneNameFunc",fP);let Ku=Ar;const pf={saturation:.35,brightness:1.4,gamma:.8,atmosphereScatteringIntensity:5,groundColor:[0,.09411764705882353,.3137254901960784,1]};class pP extends B{constructor(e){super();d(this,"_currentPosition",this.disposeVar(g.reactArrayWithUndefined(void 0)));d(this,"_currentRotation",this.disposeVar(g.reactArrayWithUndefined(void 0)));d(this,"_currentHeading",this.disposeVar(g.react(void 0)));d(this,"_isRotating",this.disposeVar(g.react(!1)));d(this,"_isGround",this.disposeVar(g.react(!1)));d(this,"_startPosition",[0,0,0]);d(this,"_startRotation",[0,0,0]);d(this,"_processing",this.disposeVar(g.createProcessingFromAsyncFunc(async(e,n,i,s)=>{const{currentPosition:o,currentRotation:a}=this;if(!o||s<=0||!a){this._currentPosition.value=n,this._currentRotation.value=i;return}const u=this._startPosition;u.splice(0,3,...o);const l=this._startRotation;l.splice(0,3,...a);let h=Date.now();const c=Qu(u,n);this._currentHeading.value=c;const p=ph(u,n)/s,m=[i[0]-l[0],i[1]-l[1],i[2]-l[2]],_=n[2]-u[2];await e.promise(new Promise(E=>{e.disposer.dispose(g.animateFrame(async()=>{let C=Date.now()-h;C=C<0?0:C,C=C>s?s:C;const v=C*p,y=fv(u,v,c);if(this.isGround&&y){const w=await this._esviewer.getTerrainHeight([y[0],y[1]]);this._currentPosition.value=[y[0],y[1],w??0]}else y&&(y[2]+=_*(C/s)),this._currentPosition.value=y;if(this.isRotating){const[w,S,P]=m,M=C/s;this._currentRotation.value=[l[0]+w*M,l[1]+S*M,l[2]+P*M]}C===s&&(this._currentPosition.value=n,this.isRotating&&(this._currentRotation.value=i),this.isRotating=!1,this.isGround=!1,E())}))}))})));this._esviewer=e}get currentPosition(){return this._currentPosition.value}get currentPositionChanged(){return this._currentPosition.changed}get currentRotation(){return this._currentRotation.value}get currentRotationChanged(){return this._currentRotation.changed}get currentHeading(){return this._currentHeading.value}get currentHeadingChanged(){return this._currentHeading.changed}get isRotating(){return this._isRotating.value}set isRotating(e){this._isRotating.value=e}get isRotatingChanged(){return this._isRotating.changed}get isGround(){return this._isGround.value}set isGround(e){this._isGround.value=e}get isGroundChanged(){return this._isGround.changed}get processing(){return this._processing}restart(e,n,i){this._processing.restart(void 0,e,n,i)}cancel(){this._processing.cancel()}}function Nv(r){let t=0;function e(n,i){i++,t=Math.max(i,t),n.forEach(s=>{Array.isArray(s)&&e(s,i)})}return e(r,0),t}const mi=class mi extends Dt{constructor(e){super(e);d(this,"editingBindMode","lineString");d(this,"_area",this.dv(g.react(0)));d(this,"_perimeter",this.dv(g.react(0)));const n=()=>{this._updateArea(),this._updatePerimeter()};n(),this.d(this.pointsChanged.don(n))}updateEditing(){var n;const e=[];this.editingBindMode=="doublePoints"?e.push($.DoublePointsAppend,$.DoublePointsModify):this.editingBindMode=="lineString"?e.push($.LineStringAppend,$.LineStringInsert,$.Translation):this.editingBindMode=="circular"?(e.push($.CircularAppend,$.CircularInsert,$.Translation),this.supportEditingModes().includes($.HeightModify)&&e.push($.HeightModify)):this.editingBindMode=="visibility"?e.push($.VisibilityAppend,$.VisibilityModify):this.editingBindMode=="scatter"&&e.push($.ScatterAppend,$.ScatterModify),(n=this.activeViewer)==null||n.startEditing(this,e,{callSource:"inner"})}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}_updateArea(){this._area.value=this.getArea()??0}_updatePerimeter(){this._perimeter.value=this.getPerimeter()??0}getArea(){if(this.points&&this.points.length>=3)return sf([...this.points])}getDistance(){if(this.points&&this.points.length>=2){const e=$u(this.points,"GEODESIC");return e[e.length-1]}else return}getPerimeter(){if(this.points&&this.points.length>=3){const e=[...this.points,this.points[0]],n=$u(e,"GEODESIC");return n[n.length-1]}else return}getIntersect(e){if(this.points&&this.points.length>=3&&e.length>=3){const n=pv(this.points,e);if(!n)return;const i=n[0][0][0];if(Array.isArray(i)){const s=[...n],o=[];return s.forEach(a=>{const u=a[0].map(l=>[...l,0]);o.push(u)}),o}else return[[...n][0].map(a=>[...a,0])]}else return}getUnion(e){if(this.points&&this.points.length>=3&&e.length>=3){const n=gv(this.points,e);if(!n)return;const i=n[0][0][0];if(Array.isArray(i)){const s=[...n],o=[];return s.forEach(a=>{const u=a[0].map(l=>[...l,0]);o.push(u)}),o}else return[[...n][0].map(a=>[...a,0])]}else return}getDifference(e){if(this.points&&this.points.length>=3&&e.length>=3){let n=[...e];const i=e[0],s=e[e.length-1];i[0]===s[0]&&i[1]===s[1]&&i[2]===s[2]||n.push(i);const o=vv([...this.points,this.points[0]],[...n]);if(!o)return{status:"undefined",positions:void 0};const a=[...o];if(Nv(a)===3){const u=a.map(f=>f.map(p=>[...p,0]));if(u.length<=1)return{status:"notIncluded",positions:u};const l=u[0],h=u[1];return of([...l],[...h])==="oneBig"?{status:"included",positions:u}:{status:"notIncluded",positions:u}}else if(Nv(a)===4){const l=[...a.map(c=>c.map(f=>f.map(p=>[...p,0])))],h=[];return l.forEach(c=>{h.push(c[0])}),{status:"notIncluded",positions:h}}else return{status:"undefined",positions:void 0}}else return{status:"undefined",positions:void 0}}getBuffer(e=500,n){if(this.points&&this.points.length>=2){const i=mv(this.points,e,n);return i?[i[0].map(s=>[...s,0])]:void 0}else return}geoPolygonOverlap(e){if(this.points&&this.points.length>=3&&e.length>=3){const n=of(this.points,e);return n==="oneBig"?!0:n==="twoBig"?!1:void 0}else return}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",coordinate:[...e.coordinate,new W([this,"editing"],"编辑",!1),new Q([this,"points"],"位置数组",mi.defaults.points,void 0,!0)],style:[...e.style,new nt([],"点样式"),new W([this,"pointed"],"开启",!1),new T([this,"pointSize"],"点大小",1),new pt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new _t([this,"pointColor"],"点颜色",[1,1,1,1]),new _t([this,"pointOutlineColor"],"轮廓颜色",mi.defaults.pointStyle.outlineColor),new T([this,"pointOutlineWidth"],"轮廓宽度",mi.defaults.pointStyle.outlineWidth),new nt([],"线样式"),new W([this,"stroked"],"开启线样式",!0),new W([this,"strokeGround"],"贴地",!1),new T([this,"strokeWidth"],"线宽",1),new pt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new _t([this,"strokeColor"],"线颜色",[1,1,1,1]),new nt([],"面样式"),new W([this,"filled"],"开启",!1),new W([this,"fillGround"],"贴地",!1),new _t([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...e.more,new nt([],"点样式集合"),new ot([this,"pointMaterial"],"点材质"),new Q([this,"pointMaterialParams"],"点材质参数"),new nt([],"线样式集合"),new ot([this,"strokeMaterial"],"线材质"),new Q([this,"strokeMaterialParams"],"线材质参数"),new nt([],"面样式集合"),new ot([this,"fillMaterial"],"面材质"),new Q([this,"fillMaterialParams"],"面材质参数")]}}get pointSize(){return this.pointStyle.size}set pointSize(e){this.pointStyle={...this.pointStyle,size:e}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(e){this.pointStyle={...this.pointStyle,sizeType:e}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(e){this.pointStyle={...this.pointStyle,color:[...e]}}get pointColorChanged(){return this.pointStyleChanged}get pointOutlineColor(){return this.pointStyle.outlineColor}set pointOutlineColor(e){this.pointStyle={...this.pointStyle,outlineColor:[...e]}}get pointOutlineColorChanged(){return this.pointStyleChanged}get pointOutlineWidth(){return this.pointStyle.outlineWidth}set pointOutlineWidth(e){this.pointStyle={...this.pointStyle,outlineWidth:e}}get pointOutlineWidthChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(e){this.pointStyle={...this.pointStyle,material:e}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(e){this.pointStyle={...this.pointStyle,materialParams:e}}get pointMaterialParamsChanged(){return this.pointStyleChanged}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(e){this.strokeStyle={...this.strokeStyle,width:e}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(e){this.strokeStyle={...this.strokeStyle,widthType:e}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(e){this.strokeStyle={...this.strokeStyle,color:[...e]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(e){this.strokeStyle={...this.strokeStyle,material:e}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(e){this.strokeStyle={...this.strokeStyle,materialParams:e}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(e){this.strokeStyle={...this.strokeStyle,ground:e}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(e){this.fillStyle={...this.fillStyle,color:[...e]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(e){this.fillStyle={...this.fillStyle,material:e}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(e){this.fillStyle={...this.fillStyle,materialParams:e}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(e){this.fillStyle={...this.fillStyle,ground:e}}get fillGroundChanged(){return this.fillStyleChanged}};d(mi,"createDefaultProps",()=>({...Dt.createDefaultProps(),pointed:!1,pointStyle:g.reactJson({size:10,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),stroked:!1,strokeStyle:g.reactJson({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:g.reactJson({color:[1,1,1,1],material:"",materialParams:{},ground:!1}),points:g.reactPositions([])})),d(mi,"type",mi.register("ESGeoVector",mi,{chsName:"地理矢量",tags:["ESObjects"],description:"地理矢量"})),d(mi,"supportEditingModes",[...Dt.supportEditingModes,$.Translation]);let yt=mi;const ro=class ro extends Dt{constructor(){super(...arguments);d(this,"_statusDis",this.dv(g.react(!0)));d(this,"_smoothMoveEvent",this.dv(new V));d(this,"_smoothMoveWithRotationEvent",this.dv(new V));d(this,"_smoothMoveOnGroundEvent",this.dv(new V));d(this,"_smoothMoveWithRotationOnGroundEvent",this.dv(new V));d(this,"_automaticLandingEvent",this.dv(new V));d(this,"_smoothMoveKeepPitchEvent",this.dv(new V));d(this,"_smoothMoveRelativelyEvent",this.dv(new V));d(this,"_smoothMoveRelativelyWithRotationEvent",this.dv(new V));d(this,"useCalcFlyToParamInESObjectWithLocation",!0)}updateEditing(){var n;const e=[];this.editingBindMode=="singlePoint"?(e.push($.Place,$.Translation),["ESLocationMeasurement"].includes(this.typeName)||e.push($.Rotation),["ESClippingPlane","ESLocationMeasurement","ESLocalRectangle","ESBoxClipping"].includes(this.typeName)||e.push($.Scale)):this.editingBindMode=="doublePoints"&&e.push($.DoublePointsAppend,$.DoublePointsModify),(n=this.activeViewer)==null||n.startEditing(this,e,{callSource:"inner"})}get statusDis(){return this._statusDis.value}get statusDisChanged(){return this._statusDis.changed}get smoothMoveEvent(){return this._smoothMoveEvent}smoothMove(e,n){this._smoothMoveEvent.emit(e,n)}get smoothMoveWithRotationEvent(){return this._smoothMoveWithRotationEvent}smoothMoveWithRotation(e,n,i){this._smoothMoveWithRotationEvent.emit(e,n,i)}get smoothMoveOnGroundEvent(){return this._smoothMoveOnGroundEvent}smoothMoveOnGround(e,n,i,s){this._smoothMoveOnGroundEvent.emit(e,n,i,s)}get smoothMoveWithRotationOnGroundEvent(){return this._smoothMoveWithRotationOnGroundEvent}smoothMoveWithRotationOnGround(e,n,i,s,o){this._smoothMoveWithRotationOnGroundEvent.emit(e,n,i,s,o)}get automaticLandingEvent(){return this._automaticLandingEvent}automaticLanding(){const e=this.collision;this.collision=!1,setTimeout(()=>{this._automaticLandingEvent.emit(e)},100)}get smoothMoveKeepPitchEvent(){return this._smoothMoveKeepPitchEvent}smoothMoveKeepPitch(e,n){this._smoothMoveKeepPitchEvent.emit(e,n)}get smoothMoveRelativelyEvent(){return this._smoothMoveRelativelyEvent}smoothMoveRelatively(e,n){this._smoothMoveRelativelyEvent.emit(e,n)}get smoothMoveRelativelyWithRotationEvent(){return this._smoothMoveRelativelyWithRotationEvent}smoothMoveRelativelyWithRotation(e,n,i){this._smoothMoveRelativelyWithRotationEvent.emit(e,n,i)}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",location:[...e.location,new W([this,"editing"],"是否编辑"),new it([],()=>this.automaticLanding(),[],"自动落地"),new Io([this,"position"],"位置数组",[0,0,0]),new Wh([this,"rotation"],"姿态数组",[0,0,0]),new Je([this,"scale"],"缩放",[1,1,1]),new T([this,"minVisibleDistance"],"最小可见距离",0),new T([this,"maxVisibleDistance"],"最大可见距离",0)],more:[...e.more,new it(["numbers","number"],(n,i)=>this.smoothMove(n,i),[[0,0,0],0],"平滑移动","smoothMove"),new it(["numbers","number"],(n,i)=>this.smoothMoveKeepPitch(n,i),[[0,0,0],0],"固定方向平滑移动","smoothMoveKeepPitch"),new it(["numbers","numbers","number"],(n,i,s)=>this.smoothMoveWithRotation(n,i,s),[[0,0,0],[0,0,0],0],"平滑偏移","smoothMoveWithRotation"),new it(["number","number","number","string"],(n,i,s,o)=>this.smoothMoveOnGround(n,i,s,o),[0,0,0,""],"贴地平滑移动","smoothMoveOnGround"),new it(["numbers","number","number","number","string"],(n,i,s,o,a)=>this.smoothMoveWithRotationOnGround(n,i,s,o,a),[[0,0,0],0,0,0,""],"贴地平滑偏移","smoothMoveWithRotationOnGround"),new it(["numbers","number"],(n,i)=>this.smoothMoveRelatively(n,i),[[0,0,0],0],"smoothMoveRelatively","smoothMoveRelatively"),new it(["numbers","numbers","number"],(n,i,s)=>this.smoothMoveRelativelyWithRotation(n,i,s),[[0,0,0],[0,0,0],0],"smoothMoveRelativelyWithRotation","smoothMoveRelativelyWithRotation"),new W([this,"enableVisibleDistance"],"是否应用距离显隐")]}}get pointSize(){return this.pointStyle.size}set pointSize(e){this.pointStyle={...this.pointStyle,size:e}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(e){this.pointStyle={...this.pointStyle,sizeType:e}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(e){this.pointStyle={...this.pointStyle,color:[...e]}}get pointColorChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(e){this.pointStyle={...this.pointStyle,material:e}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(e){this.pointStyle={...this.pointStyle,materialParams:e}}get pointMaterialParamsChanged(){return this.pointStyleChanged}};d(ro,"createDefaultProps",()=>({...Dt.createDefaultProps(),pointed:!1,pointStyle:g.reactJson({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),position:g.reactArray([0,0,0]),rotation:g.reactArray([0,0,0]),scale:g.reactArray([1,1,1]),minVisibleDistance:g.react(0),maxVisibleDistance:g.react(0)})),d(ro,"type",ro.register("ESObjectWithLocation",ro,{chsName:"对象位置",tags:["ESObjects"],description:"对象位置"})),d(ro,"supportEditingModes",[...Dt.supportEditingModes,$.Place,$.Translation,$.Rotation,$.Scale,$.DoublePointsAppend,$.DoublePointsModify]);let Z=ro;const Sa=class Sa extends Z{getESProperties(){const t={...super.getESProperties()};return{...t,style:[...t.style,new nt([],"点样式集合"),new W([this,"pointed"],"开启点样式",!1),new T([this,"pointSize"],"点大小",1),new pt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new _t([this,"pointColor"],"点颜色",[1,1,1,1]),new nt([],"线样式集合"),new W([this,"stroked"],"开启线样式",!1),new W([this,"strokeGround"],"是否贴地(线)",!1),new T([this,"strokeWidth"],"线宽",1),new pt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new _t([this,"strokeColor"],"线颜色",[1,1,1,1]),new nt([],"面样式集合"),new W([this,"filled"],"开启填充样式",!1),new W([this,"fillGround"],"是否贴地",!1),new _t([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...t.more,new nt([],"点样式"),new ot([this,"pointMaterial"],"点材质",""),new Q([this,"pointMaterialParams"],"点材质参数",{}),new nt([],"线样式"),new ot([this,"strokeMaterial"],"线材质",""),new Q([this,"strokeMaterialParams"],"线材质参数",{}),new nt([],"填充样式"),new ot([this,"fillMaterial"],"面材质",""),new Q([this,"fillMaterialParams"],"面材质参数",{})]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(t){this.strokeStyle={...this.strokeStyle,width:t}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(t){this.strokeStyle={...this.strokeStyle,widthType:t}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(t){this.strokeStyle={...this.strokeStyle,color:[...t]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(t){this.strokeStyle={...this.strokeStyle,material:t}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(t){this.strokeStyle={...this.strokeStyle,materialParams:t}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(t){this.strokeStyle={...this.strokeStyle,ground:t}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(t){this.fillStyle={...this.fillStyle,color:[...t]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle,materialParams:t}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(t){this.fillStyle={...this.fillStyle,ground:t}}get fillGroundChanged(){return this.fillStyleChanged}};d(Sa,"createDefaultProps",()=>({...Z.createDefaultProps(),pointed:!1,pointStyle:g.reactJson({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:1}),stroked:!1,strokeStyle:g.reactJson({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:g.reactJson({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(Sa,"type",Sa.register("ESLocalVector",Sa,{chsName:"本地矢量",tags:["ESObjects"],description:"本地矢量对象"}));let ma=Sa;const ol=class ol extends ma{};d(ol,"type",ol.register("ESLocalVector2D",ol,{chsName:"本地矢量2D",tags:["ESObjects"],description:"本地矢量2D对象"}));let Gi=ol;const gP=[["固定朝向",0],["面向屏幕旋转",1],["绕自身Z轴旋转",2]],mP=[["单面不透明",0],["双面不透明",1],["单面遮罩",2],["双面遮罩",3],["单面透明",4],["双面透明",5],["单面未遮挡透明",6],["双面未遮挡透明",7]],Ca=class Ca extends Z{constructor(){super(...arguments);d(this,"_widgetEvent",this.dv(new V))}get widgetEvent(){return this._widgetEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new W([this,"screenRender"],"屏幕渲染",!0),new W([this,"sizeByContent"],"尺寸自适应",!0),new _e([this,"size"],"尺寸大小",[100,100]),new _e([this,"anchor"],"偏移比例",[.5,1]),new _e([this,"offset"],"像素偏移",[0,0]),new pt([this,"renderMode"],mP,"渲染模式",0),new pt([this,"rotationType"],gP,"漫游旋转类型",1),new ot([this,"actorTag"],"绑定对象"),new ot([this,"socketName"],"插槽名称"),new Je([this,"positionOffset"],"位置偏移"),new Je([this,"rotationOffset"],"相对姿态")],more:[...e.more,new T([this,"zOrder"],"排序",0)]}}};d(Ca,"createDefaultProps",()=>({...Z.createDefaultProps(),screenRender:!0,size:g.reactArray([100,100]),anchor:g.reactArray([.5,1]),offset:g.reactArray([0,0]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,actorTag:"",socketName:"",positionOffset:g.reactArray([0,0,0]),rotationOffset:g.reactArray([0,0,0])})),d(Ca,"type",Ca.register("ESLabel",Ca,{chsName:"标签",tags:["ESObjects"],description:"标签对象"}));let Hr=Ca;const Ia=class Ia extends K{constructor(t){super(t)}};d(Ia,"createDefaultProps",()=>({...K.createDefaultProps(),show:!0,fillStyle:g.reactJson({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(Ia,"type",Ia.register("ESTestObject",Ia,{chsName:"测试",tags:["ESObjects"],description:""}));let gf=Ia;const vi=class vi extends Dt{constructor(e){super(e);d(this,"_refreshTilesetEvent",this.dv(new V));d(this,"_tilesetReadyEvent",this.dv(new V));d(this,"_supportEdit",this.dv(g.react(!0)));d(this,"_highlightFeatureEvent",this.dv(new V));d(this,"_highlightFeatureAndFlyToEvent",this.dv(new V));d(this,"_strokeFeatureEvent",this.disposeVar(new V));d(this,"_getFeatureTableEvent",this.dv(new V));d(this,"_featureTableResultEvent",this.dv(new V));d(this,"_getMaterialNameListEvent",this.disposeVar(new V));d(this,"_setFeatureStyleEvent",this.dv(new V));d(this,"_setFeatureColorEvent",this.dv(new V));d(this,"_setFeatureVisableEvent",this.dv(new V));d(this,"_resetFeatureStyleEvent",this.dv(new V));d(this,"setMaterialInfoEvent",this.ad(new V));d(this,"_setMaterialEvent",this.disposeVar(new V));d(this,"_clippingPlanesId",this.dv(g.react("")));d(this,"_clippingPlaneIds",this.dv(g.react([])));d(this,"_flattenedPlaneId",this.dv(g.react("")));d(this,"_flattenedPlaneEnabled",this.dv(g.react(!1)));d(this,"_clippingPlaneId",this.dv(g.react("")));d(this,"_excavateId",this.dv(g.reactArray([])))}updateEditing(){var e;(e=this.activeViewer)==null||e.startEditing(this,[$.Translation,$.Rotation],{callSource:"inner"})}get refreshTilesetEvent(){return this._refreshTilesetEvent}refreshTileset(){this._refreshTilesetEvent.emit()}get tilesetReady(){return this._tilesetReadyEvent}get supportEdit(){return this._supportEdit.value}set supportEdit(e){this._supportEdit.value=e}get supportEditChanged(){return this._supportEdit.changed}get highlightFeatureEvent(){return this._highlightFeatureEvent}highlightFeature(e,n){this._highlightFeatureEvent.emit(e,n)}get highlightFeatureAndFlyToEvent(){return this._highlightFeatureAndFlyToEvent}highlightFeatureAndFlyTo(e,n,i,s){this._highlightFeatureAndFlyToEvent.emit(e,n,i,s)}get strokeFeatureEvent(){return this._strokeFeatureEvent}strokeFeature(e,n=[1,0,0,1]){this._strokeFeatureEvent.emit(e,n)}get getFeatureTableEvent(){return this._getFeatureTableEvent}getFeatureTable(){return Promise.race([new Promise(e=>{const n=this.d(this._featureTableResultEvent.donce(e));this._getFeatureTableEvent.emit(),setTimeout(()=>{n(),e(void 0)},2e3)})])}get getMaterialNameListEvent(){return this._getMaterialNameListEvent}getMaterialNameList(){return new Promise(e=>{const n=new B;n.d(this.getMaterialNameListEvent.don(i=>{i!=="start"&&(n.destroy(),e(i))})),this.getMaterialNameListEvent.emit("start"),setTimeout(()=>{n.isDestroyed()||(n.destroy(),e(void 0))},2e3)})}get setFeatureStyleEvent(){return this._setFeatureStyleEvent}setFeatureStyle(e){this._setFeatureStyleEvent.emit(e)}get setFeatureColorEvent(){return this._setFeatureColorEvent}setFeatureColor(e,n){this._setFeatureColorEvent.emit(e,typeof n=="string"?JSON.parse(n):n)}get setFeatureVisableEvent(){return this._setFeatureVisableEvent}setFeatureVisable(e,n){this._setFeatureVisableEvent.emit(e,typeof n=="string"?JSON.parse(n):n)}get resetFeatureStyleEvent(){return this._resetFeatureStyleEvent}resetFeatureStyle(){this._resetFeatureStyleEvent.emit()}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){return new Promise(n=>{const i=new B;i.ad(this.setMaterialInfoEvent.donce(s=>{i.destroy(),n(s)})),this._setMaterialEvent.emit(e)})}get clippingPlanesId(){return this._clippingPlanesId.value}set clippingPlanesId(e){this._clippingPlanesId.value=e}get clippingPlanesIdChanged(){return this._clippingPlanesId.changed}get clippingPlaneIds(){return this._clippingPlaneIds.value}set clippingPlaneIds(e){this._clippingPlaneIds.value=e}get clippingPlaneIdsChanged(){return this._clippingPlaneIds.changed}get flattenedPlaneId(){return this._flattenedPlaneId.value}set flattenedPlaneId(e){this._flattenedPlaneId.value=e}get flattenedPlaneIdChanged(){return this._flattenedPlaneId.changed}get flattenedPlaneEnabled(){return this._flattenedPlaneEnabled.value}set flattenedPlaneEnabled(e){this._flattenedPlaneEnabled.value=e}get flattenedPlaneEnabledChanged(){return this._flattenedPlaneEnabled.changed}get clippingPlaneId(){return this._clippingPlaneId.value}set clippingPlaneId(e){this._clippingPlaneId.value=e}get clippingPlaneIdChanged(){return this._clippingPlaneId.changed}get excavateId(){return this._excavateId.value}set excavateId(e){this._excavateId.value=e}get excavateIdChanged(){return this._excavateId.changed}setLight122(){this.czmEnvironmentMapManager={...pf}}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new Pe([this,"maximumScreenSpaceError"],1,[0,256],"精度",16),new pt([this,"materialMode"],[["常规","normal"],["科技感","technology"]],"材质模式","normal",!0),new pt([this,"colorBlendMode"],[["默认","HIGHLIGHT"],["替换","REPLACE"],["混合","MIX"]],"颜色模式","HIGHLIGHT"),new Q([this,"materialOverrideMap"],"材质替换",vi.defaults.materialOverrideMap)],dataSource:[...e.dataSource,new Q([this,"url"],"服务地址",vi.defaults.url,void 0,!0)],coordinate:[...e.coordinate,new W([this,"editing"],"编辑",!1,!0),new Je([this,"offset"],"偏移",[0,0,0],!0),new Wh([this,"rotation"],"旋转",[0,0,0])],more:[...e.more,new Q([this,"materialParams"],"materialParams",vi.defaults.materialParams),new it(["string","string"],(n,i)=>this.highlightFeature(n,i),["","rgba(255,0,0,1)"],"highlightFeature"),new it(["string","string"],(n,i)=>this.setFeatureColor(n,i),["",""],"setFeatureColor"),new it(["string","string"],(n,i)=>this.setFeatureVisable(n,i),["",""],"setFeatureVisable"),new it([],()=>this.resetFeatureStyle(),[],"resetFeatureStyle"),new nt([],"ue"),new it([],()=>this.refreshTileset(),[],"refreshTileset"),new ot([this,"actorTag"]),new W([this,"highlight"],"是否高亮"),new _t([this,"highlightColor"]),new T([this,"highlightID"]),new nt([],"czm"),new nt([],"可视化"),new _e([this,"czmImageBasedLightingFactor"],"反射强度"),new T([this,"czmAtmosphereScatteringIntensity"],"大气散射强度"),new Q([this,"czmEnvironmentMapManager"],"动态环境贴图管理器"),new T([this,"czmMaximumMemoryUsage"],"最大内存"),new nt([],"常用"),new pt([this,"czmClassificationType"],[["NONE","NONE"],["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]],"czmClassificationType","NONE",!0),new Q([this,"czmStyleJson"],"czmStyle"),new W([this,"czmBackFaceCulling"]),new W([this,"czmSkipLevelOfDetail"]),new T([this,"cacheBytes"],"最大缓存",536870912),new nt([],"调试信息"),new W([this,"czmDebugShowBoundingVolume"]),new W([this,"czmDebugShowContentBoundingVolume"]),new nt([],"clippingPlanes"),new W([this,"clippingPlaneEnabled"]),new W([this,"unionClippingRegions"]),new _t([this,"clippingPlaneEdgeColor"]),new T([this,"clippingPlaneEdgeWidth"])]}}};d(vi,"createDefaultProps",()=>({...Dt.createDefaultProps(),url:"",actorTag:"",materialMode:"normal",highlight:!1,maximumScreenSpaceError:16,highlightID:0,highlightColor:g.reactArray([1,0,0,1]),offset:g.reactArrayWithUndefined([0,0,0]),rotation:g.reactArray([0,0,0]),czmImageBasedLightingFactor:g.reactArray([1,1]),czmEnvironmentMapManager:g.reactJsonWithUndefined(void 0),czmLuminanceAtZenith:2,czmAtmosphereScatteringIntensity:2,czmMaximumMemoryUsage:512,czmClassificationType:"NONE",czmStyleJson:g.reactJson({}),czmBackFaceCulling:!0,czmDebugShowBoundingVolume:!1,czmDebugShowContentBoundingVolume:!1,czmSkipLevelOfDetail:!1,cacheBytes:536870912,colorBlendMode:"HIGHLIGHT",clippingPlaneEnabled:!0,unionClippingRegions:!0,clippingPlaneEdgeColor:g.reactArray([1,1,1,1]),clippingPlaneEdgeWidth:2,materialParams:{baseColor:[0,.5,1]},allowPicking:!0,materialOverrideMap:g.reactJsonWithUndefined({}),featureIdLabel:0,splitDirection:"NONE"})),d(vi,"type",vi.register("ES3DTileset",vi,{chsName:"3DTileset",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"3DTileset"})),d(vi,"supportEditingModes",[...Dt.supportEditingModes,$.Translation,$.Rotation]);let vn=vi;const Pa=class Pa extends Z{constructor(e){super(e);d(this,"_isFlyInCreated",this.dv(g.react(!1)));d(this,"_readyEvent",this.dv(new V));this.collision=!1,this.d(this.createdEvent.don(()=>{setTimeout(()=>{if((this.editing??!1)||!this.position)this.d(Co([this.positionChanged,this.editingChanged],()=>{this.editing||!this.position||this.isFlyInCreated&&this.flyTo()},{time:"donce"}));else{if(!this.isFlyInCreated)return;this.flyTo()}},1e3)}))}get isFlyInCreated(){return this._isFlyInCreated.value}set isFlyInCreated(e){this._isFlyInCreated.value=e}get isFlyInCreatedChanged(){return this._isFlyInCreated.changed}get readyEvent(){return this._readyEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pt([this,"mode"],[["柱状警告","cylinder"],["圆形警告","circle"]],"模式","cylinder"),new T([this,"radius"],"半径",10)]}}};d(Pa,"createDefaultProps",()=>({...Z.createDefaultProps(),mode:"cylinder",radius:10})),d(Pa,"type",Pa.register("ESAlarm",Pa,{chsName:"报警",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警告类"}));let mf=Pa;const no=class no extends Z{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new T([this,"radius"],"半径",1),new pt([this,"mode"],[["扫描","scan"],["扩散","diffuse"]],"模式",no.defaults.mode)]}}};d(no,"createDefaultProps",()=>({...Z.createDefaultProps(),radius:1,mode:"scan",collision:!1})),d(no,"type",no.register("ESApertureEffect",no,{chsName:"光圈特效",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"光圈特效"}));let vf=no;const io=class io extends yt{constructor(e){super(e);d(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new T([this,"area"],"面积",0,!1,!0),new T([this,"perimeter"],"周长",0,!1,!0)]}}};d(io,"createDefaultProps",()=>({...yt.createDefaultProps(),fillStyle:g.reactJson({color:[1,1,1,.5],material:"",materialParams:{},ground:!1}),strokeStyle:g.reactJson({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!0,stroked:!1,collision:!1})),d(io,"type",io.register("ESGeoPolygon",io,{chsName:"地理多边形",tags:["ESObjects"],description:"地理多边形"})),d(io,"supportEditingModes",[...yt.supportEditingModes,$.CircularAppend,$.CircularInsert]);let Ut=io;const Wi=class Wi extends Ut{get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialParams(){return this.fillStyle?this.fillStyle.materialParams:Wi.defaults.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle??Wi.defaults.fillStyle,materialParams:t??Wi.defaults.fillStyle.materialParams}}constructor(t){super(t)}};d(Wi,"createDefaultProps",()=>({...Ut.createDefaultProps(),stroked:!0,filled:!0,units:g.reactArray(["SquareMeter_SquareKilometer","MU_Hectare","PerimeterMeter_PerimeterKilometer"]),fillStyle:g.reactJson({color:[1,1,1,1],material:"Material'/EarthSDKForUE/M_ES_Material.M_ES_Material'",materialParams:{Opacity:.4},ground:!0}),strokeStyle:g.reactJson({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(Wi,"type",Wi.register("ESAreaMeasurement",Wi,{chsName:"面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"面积测量"}));let yf=Wi;const Ma=class Ma extends Z{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"general",more:[...t.more,new nt([],"czm"),new eu([this,"image"],"图片"),new Je([this,"translation"],"偏移")]}}};d(Ma,"createDefaultProps",()=>({...Z.createDefaultProps(),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",translation:g.reactArray([0,0,0])})),d(Ma,"type",Ma.register("ESBlastParticleSystem",Ma,{chsName:"粒子爆炸",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"粒子爆炸"}));let _f=Ma;const Bn=class Bn extends Z{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new W([this,"reverse"],"反转",Bn.defaults.reverse),new Je([this,"size"],"尺寸",Bn.defaults.size),new _t([this,"edgeColor"],"边框颜色",Bn.defaults.edgeColor),new T([this,"edgeWidth"],"边框宽度",Bn.defaults.edgeWidth),new ot([this,"targetID"],"瓦片图层",Bn.defaults.targetID)]}}};d(Bn,"createDefaultProps",()=>({...Z.createDefaultProps(),reverse:!1,edgeColor:g.reactArray([1,1,1,1]),edgeWidth:2,size:g.reactArray([10,10,10]),targetID:""})),d(Bn,"type",Bn.register("ESBoxClipping",Bn,{chsName:"体剖切",tags:["ESObjects","_ES_Impl_Cesium"],description:"体剖切,体裁剪,体裁切,盒裁切"}));let wf=Bn;const al=class al extends Z{constructor(){super(...arguments);d(this,"_thumbnail",this.dv(g.react("")));d(this,"_duration",this.dv(g.react(1)));d(this,"_resetWithCurrentCameraEvent",this.dv(new V));d(this,"_captureEvent",this.dv(new V))}get thumbnail(){return this._thumbnail.value}set thumbnail(e){this._thumbnail.value=e}get thumbnailChanged(){return this._thumbnail.changed}get duration(){return this._duration.value}set duration(e){this._duration.value=e}get durationChanged(){return this._duration.changed}flyIn(e=1,n="default"){this.flyInEvent.emit(e,-1,n)}get resetWithCurrentCameraEvent(){return this._resetWithCurrentCameraEvent}resetWithCurrentCamera(){this._resetWithCurrentCameraEvent.emit()}get captureEvent(){return this._captureEvent}capture(e,n){this._captureEvent.emit(e,n)}execOnCreating(){this.resetWithCurrentCamera()}async initByCurrent(){this.resetWithCurrentCamera()}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new nt([],"ESCameraView"),new it([],()=>this.resetWithCurrentCamera(),[],"设置为当前视角"),new it(["number","number"],(n,i)=>this.capture(n,i),[64,64],"获取缩略图"),new ot([this,"thumbnail"],"缩略图","",!0),new T([this,"duration"],"飞行时间",1,!0)]}}};d(al,"type",al.register("ESCameraView",al,{chsName:"视角",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角"}));let gh=al;class mh extends B{constructor(e,n,i){super();d(this,"_view",this.dv(new gh));if(this.d(e.components.disposableAdd(this._view)),this._view.name=(i==null?void 0:i.name)??`视角${e.views.length+1}`,n){const a=this._view,u=n;a.duration=u.duration??1,a.position=u.position,a.rotation=u.rotation??[0,0,0],a.thumbnail=u.thumbnail??"",a.name=u.name}else{const a=(i==null?void 0:i.size)??[64,64];this.d(g.nextAnimateFrame(()=>{this._view.resetWithCurrentCamera(),this._view.capture(a[0],a[1])}))}const s=this._view,o=this.dv(g.createNextAnimateFrameEvent(s.durationChanged,s.positionChanged,s.rotationChanged,s.thumbnailChanged,s.nameChanged));this.d(o.don(()=>e.emitViewsWarpper()))}get view(){return this._view}get viewInfo(){const e=this._view;return{duration:e.duration,position:e.position,rotation:e.rotation,thumbnail:e.thumbnail,name:e.name}}}const _n=class _n extends K{constructor(e){super(e);d(this,"_currentViewIndex",this.dv(g.react(-1)));d(this,"_viewWrappers",this.dv(new g.ObservableArray));d(this,"_currentViewWrapper",this.dv(g.react(void 0)));d(this,"_container",this.dv(g.react(void 0)));this.initProcessing();{const n=()=>{if(!this._currentViewWrapper.value)return;this._viewWrappers.indexOf(this._currentViewWrapper.value)===-1&&(this._currentViewWrapper.value=void 0)};n(),this.d(this._viewWrappers.changedEvent.don(n))}{const n=()=>{const i=this._currentViewWrapper.value;this._currentViewIndex.value=i?this._getIndex(i):-1};n(),this.d(this._viewWrappers.changedEvent.don(n)),this.d(this._currentViewWrapper.changed.don(n))}this.d(()=>{this.clearAllViews()})}get json(){return{...this._innerGetJson(),views:this.views}}set json(e){this._innerSetJson(e),this.views=e.views}get currentViewIndex(){return this._currentViewIndex.value}get currentViewIndexChanged(){return this._currentViewIndex.changed}emitViewsWarpper(){this._viewWrappers.changedEvent.emit(this._viewWrappers)}get container(){return this._container.value}get containerChanged(){return this._container.changed}set container(e){this._container.value=e}get views(){return Iv(this._viewWrappers,e=>e.viewInfo)}get viewsChanged(){return this._viewWrappers.changedEvent}set views(e){if(e.length===this._viewWrappers.length){const n=this._viewWrappers;if(e.every((i,s)=>{const o=n.get(s).view;return i.duration===o.duration&&ff(i.position,o.position)&&ff(i.rotation,o.rotation)&&i.thumbnail===o.thumbnail&&i.name===o.name}))return}this.clearAllViews();for(let n of e)this._viewWrappers.push(new mh(this,n))}_getIndex(e){return this._viewWrappers.indexOf(e)}clearAllViews(){for(let e of this._viewWrappers)e.destroy();this._viewWrappers.length=0}add(e=`视角${this.views.length+1}`,n=[64,64]){this._viewWrappers.push(new mh(this,void 0,{name:e,size:n}))}update(e,n,i=[64,64]){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const s=this._viewWrappers.get(e);return n&&(s.view.name=n),s.view.resetWithCurrentCamera(),s.view.capture(i[0],i[1]),!0}addView(){this._viewWrappers.push(new mh(this))}insertView(e){if(this._viewWrappers.length+1<=e||e<0){console.error("this._views.length <= index || index < 0");return}this._viewWrappers.splice(e,0,new mh(this))}setCurrentView(e){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const n=this._viewWrappers.get(e);return this._currentViewWrapper.value=n,!0}resetView(e){if(e>=this._viewWrappers.length||e<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const n=this._viewWrappers.get(e);n.view.resetWithCurrentCamera(),n.view.capture()}resetViewName(e,n){if(e>=this._viewWrappers.length||e<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const i=this._viewWrappers.get(e);i.view.name=n}updateView(e,n){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const i=this._viewWrappers.get(e);return i.view.position=n.position,i.view.rotation=n.rotation??[0,0,0],i.view.duration=n.duration??1,i.view.thumbnail=n.thumbnail??"",i.view.name=n.name??"",!0}flyToView(e){if(this.setCurrentView(e)){if(!this._currentViewWrapper.value)throw new Error("this._currentViewWrapper.value");const n=this._currentViewWrapper.value.view.duration;this._currentViewWrapper.value.view.flyIn(n,this.flyMode??_n.defaults.flyMode)}}flyToPrevView(){const e=this._currentViewWrapper.value;if(!e)return this.flyToView(0),!0;const n=this._getIndex(e);return this.loop??_n.defaults.loop?(this.flyToView((this._viewWrappers.length+n-1)%this._viewWrappers.length),!0):n-1<0?!1:(this.flyToView(n-1),!0)}moveToPreView(){const e=this._currentViewWrapper.value;if(!e)return;const n=this._getIndex(e);if(n===0)return;const i=this._viewWrappers.splice(n-1,1,e)[0];this._viewWrappers.set(n,i)}moveToNextView(){const e=this._currentViewWrapper.value;if(!e)return;const n=this._getIndex(e);if(n===this._viewWrappers.length-1)return;const i=this._viewWrappers.splice(n+1,1,e)[0];this._viewWrappers.set(n,i)}flyToNextView(){const e=this._currentViewWrapper.value;if(!e)return this.flyToView(0),!0;const n=this._getIndex(e);return this.loop??_n.defaults.loop?(this.flyToView((n+1)%this._viewWrappers.length),!0):n+1>this._viewWrappers.length-1?!1:(this.flyToView(n+1),!0)}stop(){this._currentViewWrapper.value=void 0,this.playing=!1}deleteView(e){if(e<0||e>=this._viewWrappers.length){console.warn("index < 0 || index >= this._viewWrappers.length");return}this._viewWrappers.get(e).destroy(),this._viewWrappers.splice(e,1)}deleteCurrentView(){const e=this._currentViewWrapper.value;if(!e){console.warn("!this._currentViewWrapper.value");return}const n=this._getIndex(e);if(n===-1){console.warn("index === -1");return}this.deleteView(n)}transitionImageUrl(e){return K.context.getStrFromEnv(e)}_flyStep(e){var o;if(!this.flyToNextView())return this.playing=!1,Promise.resolve();const n=this.intervalTime??_n.defaults.intervalTime,s=((((o=this._currentViewWrapper.value)==null?void 0:o.viewInfo.duration)??0)+n)*1e3;return e.promise(g.sleep(s)).then(()=>this._flyStep(e))}initProcessing(){const e=this.dv(g.createProcessingFromAsyncFunc(async i=>this._flyStep(i))),n=()=>{this.playing?e.restart():e.cancel()};n(),this.d(this.playingChanged.don(n))}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new pt([this,"flyMode"],[["默认","default"],["直线飞行","uniform"]],"飞行模式",_n.defaults.flyMode),new it([],()=>this.addView(),[],"添加视角"),new it(["number"],n=>this.insertView(n),[0],"插入视角"),new it([],()=>this.clearAllViews(),[],"清空所有视角"),new it([],()=>this.insertView(this.currentViewIndex+1),[],"当前位置插入视角"),new it([],()=>this.flyToPrevView(),[],"上一个视角"),new it([],()=>this.flyToNextView(),[],"下一个视角"),new it([],()=>this.moveToPreView(),[],"当前视角移动到上一个视角"),new it([],()=>this.moveToNextView(),[],"当前视角移动到下一个视角"),new it(["number"],n=>this.flyToView(n),[0],"飞入指定视角"),new it(["number"],n=>this.setCurrentView(n),[0],"设置当前视角"),new it([],()=>this.deleteCurrentView(),[],"删除当前视角"),new it(["number"],n=>this.deleteView(n),[0],"删除指定视角"),new it(["number"],n=>this.resetView(n),[0],"重置视角"),new T([this,"currentViewIndex"],"当前序号",-1,!1,!0),new Jd([this,"playing"],()=>this.stop(),[this,"loop"],"播放",_n.defaults),new W([this,"playing"],"是否播放"),new it([],()=>this.stop(),[],"停止"),new W([this,"loop"],"是否循环"),new T([this,"intervalTime"],"间隔时间"),new Q([this,"views"],"视角集合",[],void 0,!0)]}}};d(_n,"createDefaultProps",()=>({...K.createDefaultProps(),playing:!1,loop:!0,intervalTime:5,flyMode:"default"})),d(_n,"type",_n.register("ESCameraViewCollection",_n,{chsName:"视角集合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角集合"}));let vh=_n;const ba=class ba extends Z{constructor(e){super(e);d(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new T([this,"aspectRatio"],"宽高比",1.77778),new T([this,"fov"],"横向夹角",90),new T([this,"far"],"视野长度",100),new T([this,"near"],"近面距离",5)]}}};d(ba,"createDefaultProps",()=>({...Z.createDefaultProps(),fov:90,aspectRatio:1.77778,far:100,near:5,collision:!1})),d(ba,"type",ba.register("ESCameraVisibleRange",ba,{chsName:"摄像头可视域",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"摄像头可视域"}));let Ef=ba;const xa=class xa extends Z{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new pt([this,"mode"],[["警车","policeCar"]],"模式","policeCar")]}}};d(xa,"createDefaultProps",()=>({...Z.createDefaultProps(),mode:"policeCar",allowPicking:!0})),d(xa,"type",xa.register("ESCar",xa,{chsName:"车辆",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警车等基础车辆模型"}));let yh=xa;const so=class so extends yt{constructor(e){super(e);d(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new T([this,"height"],"高度",10)],coordinate:[...e.coordinate,new T([this,"area"],"面积",0,!1,!0),new T([this,"perimeter"],"周长",0,!1,!0)]}}};d(so,"createDefaultProps",()=>({...yt.createDefaultProps(),height:10,filled:!0,fillStyle:g.reactJson({material:"",materialParams:{},ground:!0,color:[1,1,1,1]})})),d(so,"type",so.register("ESClassification",so,{chsName:"倾斜单体化",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"平尾箭头"})),d(so,"supportEditingModes",[...yt.supportEditingModes,$.CircularAppend,$.CircularInsert,$.HeightModify]);let _h=so;const Na=class Na extends Z{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new W([this,"showArrow"],"显示箭头",!0),new _t([this,"edgeColor"],"线框颜色",[1,1,1,1]),new T([this,"edgetWidth"],"线框宽度",2),new T([this,"width"],"裁剪宽度",200),new T([this,"height"],"裁剪高度",200),new ot([this,"targetID"],"瓦片图层","")]}}};d(Na,"createDefaultProps",()=>({...Z.createDefaultProps(),showArrow:!0,edgeColor:g.reactArray([1,1,1,1]),edgetWidth:2,width:200,height:200,targetID:""})),d(Na,"type",Na.register("ESClippingPlane",Na,{chsName:"裁切",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESClippingPlane"}));let Sf=Na;class vP extends B{constructor(t,e,n){super();const i=document.createElement("div");i.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${n.id}) container`);{const u=()=>{const h=` ${e.cssText}
49
69
  ${e.cssAllInitial?"all: initial;":""}
50
70
  ${e.show?"":"display: none"}
51
- `;i.style.cssText=h};u();const l=this.dv(d.createNextAnimateFrameEvent(e.cssAllInitialChanged,e.cssTextChanged,e.showChanged));this.d(l.don(u))}t.appendChild(i),this.d(()=>t.removeChild(i));const s=this.dv(d.createNextAnimateFrameEvent(e.instanceClassChanged,e.containerChanged,e.shadowDomChanged)),o=this.dv(new d.ObjResettingWithEvent(s,()=>{const{instanceClass:u,container:l}=e;if(!u||l)return;let h=i;if(i.firstElementChild&&i.removeChild(i.firstElementChild),e.shadowDom){const c=i.appendChild(document.createElement("div"));c.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${n.id}) container shadowDiv`),h=c.attachShadow({mode:"open"}).appendChild(document.createElement("div")),h.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${n.id}) container shadowDiv div`)}return new u(h,e,n)})),{_updateEvent:a}=e;this.d(a.don(u=>{if(o.obj)try{u(o.obj,e,n)}catch(l){console.error(`ESCustomDiv update error! ${l}`)}}))}}const Fv=`class MyDiv {
71
+ `;i.style.cssText=h};u();const l=this.dv(g.createNextAnimateFrameEvent(e.cssAllInitialChanged,e.cssTextChanged,e.showChanged));this.d(l.don(u))}t.appendChild(i),this.d(()=>t.removeChild(i));const s=this.dv(g.createNextAnimateFrameEvent(e.instanceClassChanged,e.containerChanged,e.shadowDomChanged)),o=this.dv(new g.ObjResettingWithEvent(s,()=>{const{instanceClass:u,container:l}=e;if(!u||l)return;let h=i;if(i.firstElementChild&&i.removeChild(i.firstElementChild),e.shadowDom){const c=i.appendChild(document.createElement("div"));c.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${n.id}) container shadowDiv`),h=c.attachShadow({mode:"open"}).appendChild(document.createElement("div")),h.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${n.id}) container shadowDiv div`)}return new u(h,e,n)})),{_updateEvent:a}=e;this.d(a.don(u=>{if(o.obj)try{u(o.obj,e,n)}catch(l){console.error(`ESCustomDiv update error! ${l}`)}}))}}const Tv=`class MyDiv {
52
72
  // subContainer是外部视口的div容器,可以在这里创建自己需要的DOM元素
53
73
  // customDiv指向当前的CustomDiv场景对象
54
74
  // viewer指定当前的视口
@@ -86,11 +106,11 @@ northing meters`+r;var f=c/2,p=0,v=0,_,w,I,y,E;return f>0&&(_=1e5/Math.pow(10,f)
86
106
  destroy() {
87
107
  this._container.removeChild(this._div);
88
108
  }
89
- }`,jP=`示例代码:
109
+ }`,yP=`示例代码:
90
110
  \`\`\`
91
- ${Fv}
111
+ ${Tv}
92
112
  \`\`\`
93
- `,Vn=class Vn extends ht{constructor(e){super(e);g(this,"_updateEvent",this.dv(new d.Event));g(this,"_instanceClassReact",this.dv(d.react(void 0)));g(this,"_innerHtmlMounted",this.dv(new d.Event));g(this,"_container",this.dv(d.react(void 0)));this.registerAttachedObjectForContainer((i,s)=>new $P(s,this,i));{const i=()=>{try{this.instanceClass=this.instanceClassStr&&Function(`"use strict";return (${this.instanceClassStr})`)()}catch{this.instanceClass=void 0}};i(),this.d(this.instanceClassStrChanged.don(i))}{const i=()=>{if(this.innerHTML===void 0){this.instanceClassStr=void 0;return}const s=`class MyDiv {
113
+ `,wn=class wn extends K{constructor(e){super(e);d(this,"_updateEvent",this.dv(new V));d(this,"_instanceClassReact",this.dv(g.react(void 0)));d(this,"_innerHtmlMounted",this.dv(new V));d(this,"_container",this.dv(g.react(void 0)));this.registerAttachedObjectForContainer((i,s)=>new vP(s,this,i));{const i=()=>{try{this.instanceClass=this.instanceClassStr&&Function(`"use strict";return (${this.instanceClassStr})`)()}catch{this.instanceClass=void 0}};i(),this.d(this.instanceClassStrChanged.don(i))}{const i=()=>{if(this.innerHTML===void 0){this.instanceClassStr=void 0;return}const s=`class MyDiv {
94
114
  // subContainer是外部视口的div容器,可以在这里创建自己需要的DOM元素
95
115
  // customDiv指向当前的CustomDiv场景对象
96
116
  // viewer指定当前的视口
@@ -111,13 +131,13 @@ ${Fv}
111
131
  }`;this.instanceClassStr=s};i(),this.d(this.innerHTMLChanged.don(i))}const n=document.createElement("div");n.setAttribute("xe2-div",`ESCustomDiv(${this.id}) container`);{const i=()=>{const o=` ${this.cssText};
112
132
  ${this.cssAllInitial?"all: initial;":""}
113
133
  ${this.show?"":"display: none;"}
114
- `;n.style.cssText=o};i();const s=this.dv(d.createNextAnimateFrameEvent(this.cssAllInitialChanged,this.cssTextChanged,this.showChanged));this.d(s.don(i))}{const i=()=>{if(this.containerId===void 0||this.containerId==="")this.container=void 0;else{const s=document.getElementById(this.containerId);s instanceof HTMLElement?this.container=s:(this.container=void 0,console.warn(`Div from containerId(${this.containerId}) is not HTMLDivElement!`))}};i(),this.d(this.containerIdChanged.don(i))}{class i extends d.Destroyable{constructor(o){super(),o.appendChild(n),this.d(()=>o.removeChild(n))}}this.dv(new d.ObjResettingWithEvent(this.containerChanged,()=>{if(this.container)return new i(this.container)}))}{const i=this.dv(d.createNextAnimateFrameEvent(this.containerChanged,this.instanceClassChanged,this.shadowDomChanged));this.dv(new d.ObjResettingWithEvent(i,()=>{if(!this.container||!this.instanceClass)return;let s=n;if(n.firstElementChild&&n.removeChild(n.firstElementChild),this.shadowDom){const o=n.appendChild(document.createElement("div"));o.setAttribute("xe2-div","ESCustomDiv container shadowDiv"),s=o.attachShadow({mode:"open"}).appendChild(document.createElement("div")),s.setAttribute("xe2-div","ESCustomDiv container shadowDiv div")}return new this.instanceClass(s,this,void 0)}))}}update(e){this._updateEvent.emit(e)}get instanceClass(){return this._instanceClassReact.value}set instanceClass(e){this._instanceClassReact.value=e}get instanceClassChanged(){return this._instanceClassReact.changed}get innerHtmlMounted(){return this._innerHtmlMounted}get container(){return this._container.value}get containerChanged(){return this._container.changed}set container(e){this._container.value=e}getESProperties(){const e={...super.getESProperties()},n=i=>{i||alert("evalFuncStr为空,无法执行!");try{const s=i&&Function(`"use strict";return (${i})`)();this.update(s)}catch(s){alert(`updateDivFunc error: ${s}`)}};return{...e,more:[...e.more,new gt([new $([this,"show"],"显示"),new _s([this,"instanceClassStr"],"实例类",Fv,jP,!0),new _s([this,"innerHTML"],"innerHTML",Vn.defaultInnerHTML,Vn.innerHTMLReadMe,!0),new pt(["string"],n,["(divClass, dom, viewer) => divClass.update && divClass.update()"],"强制更新"),new $([this,"allowPicking"],"允许拾取",!0),new _t([this,"containerId"],"容器ID",Vn.defaults.containerId,!0),new $([this,"shadowDom"],"shadowDom"),new $([this,"cssAllInitial"],"cssAllInitial"),new _t([this,"cssText"],"cssText")],"ESCustomDiv")]}}};g(Vn,"createDefaultProps",()=>({...ht.createDefaultProps(),show:!0,instanceClassStr:void 0,innerHTML:void 0,allowPicking:void 0,containerId:"",shadowDom:!1,cssAllInitial:!1,cssText:""})),g(Vn,"type",Vn.register("ESCustomDiv",Vn,{chsName:"ESCustomDiv",tags:["ESObjects"],description:"自定义div"})),g(Vn,"defaultInnerHTML",` <!-- z-index样式需要设置,否则可能导致看不到!-->
134
+ `;n.style.cssText=o};i();const s=this.dv(g.createNextAnimateFrameEvent(this.cssAllInitialChanged,this.cssTextChanged,this.showChanged));this.d(s.don(i))}{const i=()=>{if(this.containerId===void 0||this.containerId==="")this.container=void 0;else{const s=document.getElementById(this.containerId);s instanceof HTMLElement?this.container=s:(this.container=void 0,console.warn(`Div from containerId(${this.containerId}) is not HTMLDivElement!`))}};i(),this.d(this.containerIdChanged.don(i))}{class i extends B{constructor(o){super(),o.appendChild(n),this.d(()=>o.removeChild(n))}}this.dv(new g.ObjResettingWithEvent(this.containerChanged,()=>{if(this.container)return new i(this.container)}))}{const i=this.dv(g.createNextAnimateFrameEvent(this.containerChanged,this.instanceClassChanged,this.shadowDomChanged));this.dv(new g.ObjResettingWithEvent(i,()=>{if(!this.container||!this.instanceClass)return;let s=n;if(n.firstElementChild&&n.removeChild(n.firstElementChild),this.shadowDom){const o=n.appendChild(document.createElement("div"));o.setAttribute("xe2-div","ESCustomDiv container shadowDiv"),s=o.attachShadow({mode:"open"}).appendChild(document.createElement("div")),s.setAttribute("xe2-div","ESCustomDiv container shadowDiv div")}return new this.instanceClass(s,this,void 0)}))}}update(e){this._updateEvent.emit(e)}get instanceClass(){return this._instanceClassReact.value}set instanceClass(e){this._instanceClassReact.value=e}get instanceClassChanged(){return this._instanceClassReact.changed}get innerHtmlMounted(){return this._innerHtmlMounted}get container(){return this._container.value}get containerChanged(){return this._container.changed}set container(e){this._container.value=e}getESProperties(){const e={...super.getESProperties()},n=i=>{i||alert("evalFuncStr为空,无法执行!");try{const s=i&&Function(`"use strict";return (${i})`)();this.update(s)}catch(s){alert(`updateDivFunc error: ${s}`)}};return{...e,more:[...e.more,new nt([new W([this,"show"],"显示"),new Qi([this,"instanceClassStr"],"实例类",Tv,yP,!0),new Qi([this,"innerHTML"],"innerHTML",wn.defaultInnerHTML,wn.innerHTMLReadMe,!0),new it(["string"],n,["(divClass, dom, viewer) => divClass.update && divClass.update()"],"强制更新"),new W([this,"allowPicking"],"允许拾取",!0),new ot([this,"containerId"],"容器ID",wn.defaults.containerId,!0),new W([this,"shadowDom"],"shadowDom"),new W([this,"cssAllInitial"],"cssAllInitial"),new ot([this,"cssText"],"cssText")],"ESCustomDiv")]}}};d(wn,"createDefaultProps",()=>({...K.createDefaultProps(),show:!0,instanceClassStr:void 0,innerHTML:void 0,allowPicking:void 0,containerId:"",shadowDom:!1,cssAllInitial:!1,cssText:""})),d(wn,"type",wn.register("ESCustomDiv",wn,{chsName:"ESCustomDiv",tags:["ESObjects"],description:"自定义div"})),d(wn,"defaultInnerHTML",` <!-- z-index样式需要设置,否则可能导致看不到!-->
115
135
  <div style="width: 300px; height: 50px; z-index: 100; position: absolute; left: 10px; top: 10px; background: rgba(120, 120, 0, 0.7); color: white; font-size: 30px; line-height: 50px; border: 1px solid white;">Hello world!</div>
116
- `),g(Vn,"innerHTMLReadMe",` 示例代码:
136
+ `),d(wn,"innerHTMLReadMe",` 示例代码:
117
137
  \`\`\`
118
- ${Vn.defaultInnerHTML}
138
+ ${wn.defaultInnerHTML}
119
139
  \`\`\`
120
- `);let Vh=Vn;const Oo=class Oo extends ct{constructor(e){super(e);g(this,"_maxTime",this.dv(d.react(23)))}get maxTime(){return this._maxTime.value}get maxTimeChanged(){return this._maxTime.changed}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new ut([this,"url"]),new L([this,"maxTime"],"maxTime",23,!0,!0),new L([this,"currentTime"]),new L([this,"minPropValue"]),new L([this,"maxPropValue"]),new ut([this,"colorStops"],"colorStops",Oo.defaults.colorStops,void 0,!0)]}}};g(Oo,"createDefaultProps",()=>({...ct.createDefaultProps(),url:"http://114.242.26.126:6003/ESDataMesh/water-assets2/",currentTime:0,minPropValue:0,maxPropValue:1,colorStops:d.reactJsonWithUndefined([{ratio:0,rgba:[0,0,1,1]},{ratio:.2,rgba:[0,1,0,1]},{ratio:.8,rgba:[1,1,0,1]},{ratio:1,rgba:[1,0,0,1]}])})),g(Oo,"type",Oo.register("ESDataMesh",Oo,{chsName:"数值面着色",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"数值面着色"}));let kf=Oo;const Ao=class Ao extends Dt{constructor(e){super(e);g(this,"_distance",this.dv(d.react(0)));g(this,"editingBindMode","lineString");const n=()=>{this._distance.value=this.getDistance()??0};n(),this.d(this.pointsChanged.don(n))}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new L([this,"distance"],"长度",0,!1,!0)]}}};g(Ao,"createDefaultProps",()=>({...Dt.createDefaultProps(),stroked:!0,strokeStyle:d.reactJson({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),g(Ao,"type",Ao.register("ESGeoLineString",Ao,{chsName:"地理折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地理折线"})),g(Ao,"supportEditingModes",[...Dt.supportEditingModes,lt.LineStringAppend,lt.LineStringInsert]);let Xs=Ao;const Ja=class Ja extends Xs{constructor(t){super(t)}};g(Ja,"createDefaultProps",()=>({...Xs.createDefaultProps(),strokeStyle:d.reactJson({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),g(Ja,"type",Ja.register("ESDistanceMeasurement",Ja,{chsName:"距离测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"距离测量"}));let Vf=Ja;const Js=class Js extends ie{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new bt([this,"mode"],Js.modes,"模式","in"),new _t([this,"targetID"],"瓦片图层","")]}}};g(Js,"createDefaultProps",()=>({...ie.createDefaultProps(),mode:"in",targetID:"",filled:!1})),g(Js,"type",Js.register("ESExcavate",Js,{chsName:"挖坑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"挖坑"})),g(Js,"modes",[["向内","in"],["向外","out"]]);let gl=Js;const Ba=class Ba extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"general",more:[...t.more,new mu([this,"image"],"图片"),new lr([this,"translation"],"偏移")]}}};g(Ba,"createDefaultProps",()=>({...ct.createDefaultProps(),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",translation:d.reactArray([0,0,0])})),g(Ba,"type",Ba.register("ESFireParticleSystem",Ba,{chsName:"粒子烟火",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"粒子烟火"}));let Uf=Ba;const tI=`
140
+ `);let wh=wn;const oo=class oo extends Z{constructor(e){super(e);d(this,"_maxTime",this.dv(g.react(23)))}get maxTime(){return this._maxTime.value}get maxTimeChanged(){return this._maxTime.changed}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Q([this,"url"]),new T([this,"maxTime"],"maxTime",23,!0,!0),new T([this,"currentTime"]),new T([this,"minPropValue"]),new T([this,"maxPropValue"]),new Q([this,"colorStops"],"colorStops",oo.defaults.colorStops,void 0,!0)]}}};d(oo,"createDefaultProps",()=>({...Z.createDefaultProps(),url:"http://114.242.26.126:6003/ESDataMesh/water-assets2/",currentTime:0,minPropValue:0,maxPropValue:1,colorStops:g.reactJsonWithUndefined([{ratio:0,rgba:[0,0,1,1]},{ratio:.2,rgba:[0,1,0,1]},{ratio:.8,rgba:[1,1,0,1]},{ratio:1,rgba:[1,0,0,1]}])})),d(oo,"type",oo.register("ESDataMesh",oo,{chsName:"数值面着色",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"数值面着色"}));let Cf=oo;const ao=class ao extends yt{constructor(e){super(e);d(this,"_distance",this.dv(g.react(0)));d(this,"editingBindMode","lineString");const n=()=>{this._distance.value=this.getDistance()??0};n(),this.d(this.pointsChanged.don(n))}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new T([this,"distance"],"长度",0,!1,!0)]}}};d(ao,"createDefaultProps",()=>({...yt.createDefaultProps(),stroked:!0,strokeStyle:g.reactJson({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(ao,"type",ao.register("ESGeoLineString",ao,{chsName:"地理折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地理折线"})),d(ao,"supportEditingModes",[...yt.supportEditingModes,$.LineStringAppend,$.LineStringInsert]);let qi=ao;const Ta=class Ta extends qi{constructor(t){super(t)}};d(Ta,"createDefaultProps",()=>({...qi.createDefaultProps(),strokeStyle:g.reactJson({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(Ta,"type",Ta.register("ESDistanceMeasurement",Ta,{chsName:"距离测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"距离测量"}));let If=Ta;const Ss=class Ss extends Ut{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new pt([this,"mode"],Ss.modes,"模式","in"),new ot([this,"targetID"],"瓦片图层","")]}}};d(Ss,"createDefaultProps",()=>({...Ut.createDefaultProps(),mode:"in",targetID:"",filled:!1})),d(Ss,"type",Ss.register("ESExcavate",Ss,{chsName:"挖坑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"挖坑"})),d(Ss,"modes",[["向内","in"],["向外","out"]]);let Zu=Ss;const Oa=class Oa extends Z{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"general",more:[...t.more,new eu([this,"image"],"图片"),new Je([this,"translation"],"偏移")]}}};d(Oa,"createDefaultProps",()=>({...Z.createDefaultProps(),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",translation:g.reactArray([0,0,0])})),d(Oa,"type",Oa.register("ESFireParticleSystem",Oa,{chsName:"粒子烟火",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"粒子烟火"}));let Pf=Oa;const _P=`
121
141
  ## 参数类型为 ESTreeType
122
142
  \`\`\`js
123
143
  type ESJVector2D = [number, number]
@@ -127,7 +147,7 @@ ${Fv}
127
147
  space: number
128
148
  }
129
149
  \`\`\`
130
- `,Do=class Do extends ee{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([this,"url"],"路径",!0),new ut([this,"treeTypes"],"treeTypes",[],void 0,!0),new ut([this,"xiaoBanWidget"],"xiaoBanWidget",Do.defaults.xiaoBanWidget,tI,!0),new _t([this,"youShiSZ"]),new _t([this,"diLei"]),new _t([this,"senLinLB"]),new _t([this,"labelMaterial"]),new L([this,"heightOffset"])]}}};g(Do,"createDefaultProps",()=>({...ee.createDefaultProps(),url:"",treeTypes:d.reactJsonWithUndefined([]),xiaoBanWidget:d.reactJsonWithUndefined({class:"WidgetBlueprint'/ESFoliage/ESDefaultXiaoBan.ESDefaultXiaoBan",pivot:[.5,1],space:1}),youShiSZ:"StringTable'/ESFoliage/You_Shi_SZ.You_Shi_SZ'",diLei:"StringTable'/ESFoliage/Di_Lei.Di_Lei'",senLinLB:"StringTable'/ESFoliage/Sen_Lin_LB.Sen_Lin_LB'",labelMaterial:"Material'/ESFoliage/ES3DWidgetMaterial.ES3DWidgetMaterial'",heightOffset:40})),g(Do,"type",Do.register("ESForestTileset",Do,{chsName:"森林切片图层",tags:["ESObjects","_ES_Impl_UE"],description:"ESForestTileset"}));let zf=Do;const Gv=`class MyDiv {
150
+ `,uo=class uo extends Dt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new Q([this,"url"],"路径",!0),new Q([this,"treeTypes"],"treeTypes",[],void 0,!0),new Q([this,"xiaoBanWidget"],"xiaoBanWidget",uo.defaults.xiaoBanWidget,_P,!0),new ot([this,"youShiSZ"]),new ot([this,"diLei"]),new ot([this,"senLinLB"]),new ot([this,"labelMaterial"]),new T([this,"heightOffset"])]}}};d(uo,"createDefaultProps",()=>({...Dt.createDefaultProps(),url:"",treeTypes:g.reactJsonWithUndefined([]),xiaoBanWidget:g.reactJsonWithUndefined({class:"WidgetBlueprint'/ESFoliage/ESDefaultXiaoBan.ESDefaultXiaoBan",pivot:[.5,1],space:1}),youShiSZ:"StringTable'/ESFoliage/You_Shi_SZ.You_Shi_SZ'",diLei:"StringTable'/ESFoliage/Di_Lei.Di_Lei'",senLinLB:"StringTable'/ESFoliage/Sen_Lin_LB.Sen_Lin_LB'",labelMaterial:"Material'/ESFoliage/ES3DWidgetMaterial.ES3DWidgetMaterial'",heightOffset:40})),d(uo,"type",uo.register("ESForestTileset",uo,{chsName:"森林切片图层",tags:["ESObjects","_ES_Impl_UE"],description:"ESForestTileset"}));let Mf=uo;const Ov=`class MyDiv {
131
151
  // container是Poi的div
132
152
  // geoCustomDivPoi指向当前的GeoCustomDivPoi场景对象
133
153
  // viewer指定当前的视口
@@ -158,16 +178,16 @@ ${Fv}
158
178
  destroy() {
159
179
  this._container.removeChild(this._div);
160
180
  }
161
- }`,eI=`示例代码:
181
+ }`,wP=`示例代码:
162
182
  \`\`\`
163
- ${Gv}
183
+ ${Ov}
164
184
  \`\`\`
165
- `,kv=`<div style="width: 300px; height: 50px; background: rgba(120, 120, 0, 0.7); color: white; font-size: 30px; line-height: 50px; border: 1px solid white;">Hello world!</div>
166
- `,rI=`示例代码:
185
+ `,Dv=`<div style="width: 300px; height: 50px; background: rgba(120, 120, 0, 0.7); color: white; font-size: 30px; line-height: 50px; border: 1px solid white;">Hello world!</div>
186
+ `,EP=`示例代码:
167
187
  \`\`\`
168
- ${kv}
188
+ ${Dv}
169
189
  \`\`\`
170
- `,gi=class gi extends ct{constructor(e){super(e);g(this,"_widgetEvent",this.dv(new d.Event));g(this,"_echartsFunReact",this.dv(d.react(void 0)));g(this,"_instanceClassReact",this.dv(d.react(void 0)));const n=()=>{try{this.instanceClass=this.instanceClassStr&&Function(`"use strict";return (${this.instanceClassStr})`)()}catch{this.instanceClass=void 0}};n(),this.d(this.instanceClassStrChanged.don(n));{const i=()=>{if(this.innerHTML===void 0){this.instanceClassStr=void 0;return}const s=`class MyDiv {
190
+ `,Hn=class Hn extends Z{constructor(e){super(e);d(this,"_widgetEvent",this.dv(new V));d(this,"_echartsFunReact",this.dv(g.react(void 0)));d(this,"_instanceClassReact",this.dv(g.react(void 0)));const n=()=>{try{this.instanceClass=this.instanceClassStr&&Function(`"use strict";return (${this.instanceClassStr})`)()}catch{this.instanceClass=void 0}};n(),this.d(this.instanceClassStrChanged.don(n));{const i=()=>{if(this.innerHTML===void 0){this.instanceClassStr=void 0;return}const s=`class MyDiv {
171
191
  // container是Poi的div
172
192
  // geoCustomDivPoi指向当前的GeoCustomDivPoi场景对象
173
193
  // viewer指定当前的视口
@@ -183,7 +203,7 @@ ${kv}
183
203
  destroy() {
184
204
  this._container.removeChild(this._div);
185
205
  }
186
- }`;this.instanceClassStr=s};i(),this.d(this.innerHTMLChanged.don(i))}}get widgetEvent(){return this._widgetEvent}get echartsFun(){return this._echartsFunReact.value}set echartsFun(e){this._echartsFunReact.value=e}get echartsFunChanged(){return this._echartsFunReact.changed}get instanceClass(){return this._instanceClassReact.value}set instanceClass(e){this._instanceClassReact.value=e}get instanceClassChanged(){return this._instanceClassReact.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new L([this,"opacity"],"透明度",gi.defaults.opacity,!0),new L([this,"zOrder"],"zOrder",gi.defaults.zOrder,!0),new Ve([this,"anchor"],"偏移比例",gi.defaults.anchor,!0),new _s([this,"innerHTML"],"innerHTML",gi.defaults.innerHTML,rI,!0),new _s([this,"instanceClassStr"],"实例类",gi.defaults.instanceClassStr,eI,!0),new $([this,"renderInUE"],"是否在UE中渲染",!0,!1)]}}};g(gi,"createDefaultProps",()=>({...ct.createDefaultProps(),opacity:1,anchor:d.reactArray([.5,1]),instanceClassStr:Gv,innerHTML:kv,zOrder:0,renderInUE:!1})),g(gi,"type",gi.register("ESGeoDiv",gi,{chsName:"ESGeoDiv",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESGeoDiv"}));let qf=gi;const Lo=class Lo extends Dt{constructor(e){super(e);g(this,"editingBindMode","doublePoints")}toPolygon(){if(this.points&&this.points.length>=2){const e=[...this.points][0],n=[...this.points][1];return[e,[e[0],n[1],e[2]],n,[n[0],e[1],n[2]]]}else return}_updateArea(){if(this.points&&this.points.length>=2){const e=[...this.points],n=e[0],i=e[1],s=[n,[n[0],i[1],n[2]],i,[i[0],n[1],i[2]]];this._area.value=$c(s)}else this._area.value=0}_updatePerimeter(){if(this.points&&this.points.length>=2){const e=[...this.points],n=e[0],i=e[1],s=[n,[n[0],i[1],n[2]],i,[i[0],n[1],i[2]]],o=[...s,s[0]],a=cl(o,"GEODESIC"),u=a[a.length-1];this._perimeter.value=u}else this._perimeter.value=0}getESProperties(){const e=super.getESProperties();return{...e,coordinate:[...e.coordinate,new L([this,"area"],"面积",0,!1,!0),new L([this,"perimeter"],"周长",0,!1,!0)]}}};g(Lo,"createDefaultProps",()=>({...Dt.createDefaultProps(),collision:!1,stroked:!0,filled:!0,fillStyle:d.reactJson({color:[1,1,1,.5],material:"",materialParams:{},ground:!1})})),g(Lo,"type",Lo.register("ESGeoRectangle",Lo,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"矩形"})),g(Lo,"supportEditingModes",[...Dt.supportEditingModes,lt.DoublePointsAppend,lt.DoublePointsModify]);let Wf=Lo;const Xf={translationX:0,translationY:0,translationZ:0,rotationHeading:0,rotationPitch:0,rotationRoll:0,scaleX:1,scaleY:1,scaleZ:1},Bs=class Bs extends ct{constructor(e){super(e);g(this,"_nodeTransformations",this.dv(d.react(void 0)));g(this,"_czmModelReadyEvent",this.dv(new d.Event));g(this,"_setNodePositionEvent",this.dv(new d.Event));g(this,"_setNodeRotationEvent",this.dv(new d.Event));g(this,"_setNodeScaleEvent",this.dv(new d.Event));g(this,"_printDebugInfoEvent",this.dv(new d.Event));g(this,"setMaterialInfoEvent",this.ad(new d.Event));g(this,"_setMaterialEvent",this.disposeVar(new d.Event))}get nodeTransformations(){return this._nodeTransformations.value}set nodeTransformations(e){this._nodeTransformations.value=e}get nodeTransformationsChanged(){return this._nodeTransformations.changed}get czmModelReadyEvent(){return this._czmModelReadyEvent}deleteNodeTransformation(e){if(!this.nodeTransformations||!this.nodeTransformations[e])return;const n={...this.nodeTransformations};delete n[e],this.nodeTransformations=n}get setNodePositionEvent(){return this._setNodePositionEvent}setNodePosition(e,n){this._setNodePositionEvent.emit(e,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const i=this._nodeTransformations.value[e]??{...Xf};if(n.some(s=>!Number.isFinite(s))){console.error(`setNodePosition error: ${e} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[e]:{...i,translationX:n[0],translationY:n[1],translationZ:n[2]}}}get setNodeRotationEvent(){return this._setNodeRotationEvent}setNodeRotation(e,n){this._setNodeRotationEvent.emit(e,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const i=this._nodeTransformations.value[e]??{...Xf};if(n.some(s=>!Number.isFinite(s))){console.error(`setNodeRotation error: ${e} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[e]:{...i,rotationHeading:n[0],rotationPitch:n[1],rotationRoll:n[2]}}}get setNodeScaleEvent(){return this._setNodeScaleEvent}setNodeScale(e,n){this._setNodeScaleEvent.emit(e,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const i=this._nodeTransformations.value[e]??{...Xf};if(n.some(s=>!Number.isFinite(s)||s<0)){console.error(`setNodeScale error: !Number.isFinite(e) || e < 0 ${e} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[e]:{...i,scaleX:n[0],scaleY:n[1],scaleZ:n[2]}}}getNodePosition(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.translationX,n.translationY,n.translationZ]}getNodeRotation(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.rotationHeading,n.rotationPitch,n.rotationRoll]}getNodeScale(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.scaleX,n.scaleY,n.scaleZ]}get printDebugInfoEvent(){return this._printDebugInfoEvent}printDebugInfo(){this._printDebugInfoEvent.emit()}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){return new Promise(n=>{const i=new d.Destroyable;i.ad(this.setMaterialInfoEvent.donce(s=>{i.destroy(),n(s)})),this._setMaterialEvent.emit(e)})}setLight122(){this.czmEnvironmentMapManager={...Pf}}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",dataSource:[...e.dataSource,new ut([this,"url"],"模型路径",Bs.defaults.url,void 0,!0),new ut([this,"instances"],"实例化矩阵",Bs.defaults.instances,void 0,!0)],more:[...e.more,new Ve([this,"czmImageBasedLightingFactor"]),new L([this,"czmAtmosphereScatteringIntensity"]),new ut([this,"czmEnvironmentMapManager"]),new pt([],()=>this.printDebugInfo(),[],"控制台输出模型信息"),new L([this,"czmMaximumScale"],"最大缩放比例",void 0,!0),new L([this,"czmNativeScale"],"统一缩放值"),new L([this,"czmMinimumPixelSize"],"最小像素尺寸"),new Rt([this,"czmColor"],"颜色")]}}};g(Bs,"createDefaultProps",()=>({...ct.createDefaultProps(),url:"${earthsdk3-assets-script-dir}/assets/glb/building.glb",czmMaximumScale:void 0,czmMinimumPixelSize:0,czmNativeScale:1,czmColor:d.reactArray([1,1,1,1]),allowPicking:!0,instances:d.reactArrayWithUndefined([]),czmImageBasedLightingFactor:d.reactArray([1,1]),czmAtmosphereScatteringIntensity:2,czmEnvironmentMapManager:d.reactJsonWithUndefined(void 0)})),g(Bs,"type",Bs.register("ESGltfModel",Bs,{chsName:"模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"gltf模型"}));let Hf=Bs;const Un=class Un extends ct{constructor(e){super(e);g(this,"_aiMoveToEvent",this.dv(new d.Event));g(this,"_stopAIMoveEvent",this.dv(new d.Event))}get aiMoveToEvent(){return this._aiMoveToEvent}aiMoveTo(e,n){this._aiMoveToEvent.emit(e,n)}get stopAIMoveEvent(){return this._stopAIMoveEvent}stopAIMove(){this._stopAIMoveEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new bt([this,"mode"],Un.modes,"模式",Un.defaults.mode,!0),new bt([this,"animation"],Un.animations,"动画",Un.defaults.animation,!0)],more:[...e.more,new pt(["numbers","number"],(n,i)=>this.aiMoveTo(n,i),[[0,0,0],0],"自动寻路"),new pt([],()=>this.stopAIMove(),[],"停止自动寻路")]}}};g(Un,"createDefaultProps",()=>({...ct.createDefaultProps(),mode:"worker",animation:"standing",allowPicking:!0})),g(Un,"type",Un.register("ESHuman",Un,{chsName:"人员",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"工人 警察 路人"})),g(Un,"modes",[["工人","worker"],["警察","police"],["路人","pedestrian"],["陌生人","stranger"],["男士","suitMan"],["女士","suitWoman"]]),g(Un,"animations",[["站立","standing"],["行走","walking"],["奔跑","running"]]);let Ga=Un;const Ro=class Ro extends fn{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ut([this,"url"],"图片路径",Ro.defaults.url),new $([this,"isHoverZoom"],"悬浮放大")]}}};g(Ro,"createDefaultProps",()=>({...fn.createDefaultProps(),url:"inner://CameraBlue.png",isHoverZoom:!1,renderMode:4})),g(Ro,"type",Ro.register("ESImageLabel",Ro,{chsName:"图片标签",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"基础图片标签。"}));let Yf=Ro;const Ui=class Ui extends ee{constructor(t){super(t),this.ad(d.bind([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(d.bind([this,"czmAlpha"],[this,"opacity"]))}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"dataSource",basic:[...t.basic,new L([this,"zIndex"],"层级序号",Ui.defaults.zIndex)],dataSource:[...t.dataSource,new ut([this,"url"],"影像服务地址"),new Hn([this,"rectangle"],"矩形范围",Ui.defaults.rectangle,!0),new Xe([this,"maximumLevel"],1,[1,24],"最大级别",Ui.defaults.maximumLevel,!0),new ut([this,"options"],"options",Ui.defaults.options,void 0,!0),new _t([this,"targetID"],"targetID"),new Xe([this,"opacity"],.01,[0,1],"opacity",1)],more:[...t.more,new gt([],"通用"),new L([this,"height"],"高度"),new _t([this,"actorTag"]),new _t([this,"componentTag"]),new L([this,"minimumLevel"]),new gt([],"图像"),new L([this,"czmAlpha"],"透明度"),new L([this,"czmBrightness"],"亮度"),new L([this,"czmContrast"],"对比度"),new L([this,"czmHue"],"色相"),new L([this,"czmSaturation"],"饱和度"),new L([this,"czmGamma"],"伽马值")]}}};g(Ui,"createDefaultProps",()=>({...ee.createDefaultProps(),url:"",rectangle:d.reactJsonWithUndefined([-180,-90,180,90]),options:d.reactJsonWithUndefined(void 0),zIndex:0,actorTag:"",componentTag:"",maximumLevel:22,minimumLevel:0,targetID:"",czmSplitDirection:"NONE",czmAlpha:1,czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1,opacity:1,splitDirection:"NONE"})),g(Ui,"type",Ui.register("ESImageryLayer",Ui,{chsName:"影像图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"影像图层"}));let Jf=Ui;const nI=`
206
+ }`;this.instanceClassStr=s};i(),this.d(this.innerHTMLChanged.don(i))}}get widgetEvent(){return this._widgetEvent}get echartsFun(){return this._echartsFunReact.value}set echartsFun(e){this._echartsFunReact.value=e}get echartsFunChanged(){return this._echartsFunReact.changed}get instanceClass(){return this._instanceClassReact.value}set instanceClass(e){this._instanceClassReact.value=e}get instanceClassChanged(){return this._instanceClassReact.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new T([this,"opacity"],"透明度",Hn.defaults.opacity,!0),new T([this,"zOrder"],"zOrder",Hn.defaults.zOrder,!0),new _e([this,"anchor"],"偏移比例",Hn.defaults.anchor,!0),new Qi([this,"innerHTML"],"innerHTML",Hn.defaults.innerHTML,EP,!0),new Qi([this,"instanceClassStr"],"实例类",Hn.defaults.instanceClassStr,wP,!0),new W([this,"renderInUE"],"是否在UE中渲染",!0,!1)]}}};d(Hn,"createDefaultProps",()=>({...Z.createDefaultProps(),opacity:1,anchor:g.reactArray([.5,1]),instanceClassStr:Ov,innerHTML:Dv,zOrder:0,renderInUE:!1})),d(Hn,"type",Hn.register("ESGeoDiv",Hn,{chsName:"ESGeoDiv",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESGeoDiv"}));let bf=Hn;const lo=class lo extends yt{constructor(e){super(e);d(this,"editingBindMode","doublePoints")}toPolygon(){if(this.points&&this.points.length>=2){const e=[...this.points][0],n=[...this.points][1];return[e,[e[0],n[1],e[2]],n,[n[0],e[1],n[2]]]}else return}_updateArea(){if(this.points&&this.points.length>=2){const e=[...this.points],n=e[0],i=e[1],s=[n,[n[0],i[1],n[2]],i,[i[0],n[1],i[2]]];this._area.value=sf(s)}else this._area.value=0}_updatePerimeter(){if(this.points&&this.points.length>=2){const e=[...this.points],n=e[0],i=e[1],s=[n,[n[0],i[1],n[2]],i,[i[0],n[1],i[2]]],o=[...s,s[0]],a=$u(o,"GEODESIC"),u=a[a.length-1];this._perimeter.value=u}else this._perimeter.value=0}getESProperties(){const e=super.getESProperties();return{...e,coordinate:[...e.coordinate,new T([this,"area"],"面积",0,!1,!0),new T([this,"perimeter"],"周长",0,!1,!0)]}}};d(lo,"createDefaultProps",()=>({...yt.createDefaultProps(),collision:!1,stroked:!0,filled:!0,fillStyle:g.reactJson({color:[1,1,1,.5],material:"",materialParams:{},ground:!1})})),d(lo,"type",lo.register("ESGeoRectangle",lo,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"矩形"})),d(lo,"supportEditingModes",[...yt.supportEditingModes,$.DoublePointsAppend,$.DoublePointsModify]);let xf=lo;const Nf={translationX:0,translationY:0,translationZ:0,rotationHeading:0,rotationPitch:0,rotationRoll:0,scaleX:1,scaleY:1,scaleZ:1},Cs=class Cs extends Z{constructor(e){super(e);d(this,"_nodeTransformations",this.dv(g.react(void 0)));d(this,"_czmModelReadyEvent",this.dv(new V));d(this,"_setNodePositionEvent",this.dv(new V));d(this,"_setNodeRotationEvent",this.dv(new V));d(this,"_setNodeScaleEvent",this.dv(new V));d(this,"_printDebugInfoEvent",this.dv(new V));d(this,"setMaterialInfoEvent",this.ad(new V));d(this,"_setMaterialEvent",this.disposeVar(new V))}get nodeTransformations(){return this._nodeTransformations.value}set nodeTransformations(e){this._nodeTransformations.value=e}get nodeTransformationsChanged(){return this._nodeTransformations.changed}get czmModelReadyEvent(){return this._czmModelReadyEvent}deleteNodeTransformation(e){if(!this.nodeTransformations||!this.nodeTransformations[e])return;const n={...this.nodeTransformations};delete n[e],this.nodeTransformations=n}get setNodePositionEvent(){return this._setNodePositionEvent}setNodePosition(e,n){this._setNodePositionEvent.emit(e,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const i=this._nodeTransformations.value[e]??{...Nf};if(n.some(s=>!Number.isFinite(s))){console.error(`setNodePosition error: ${e} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[e]:{...i,translationX:n[0],translationY:n[1],translationZ:n[2]}}}get setNodeRotationEvent(){return this._setNodeRotationEvent}setNodeRotation(e,n){this._setNodeRotationEvent.emit(e,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const i=this._nodeTransformations.value[e]??{...Nf};if(n.some(s=>!Number.isFinite(s))){console.error(`setNodeRotation error: ${e} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[e]:{...i,rotationHeading:n[0],rotationPitch:n[1],rotationRoll:n[2]}}}get setNodeScaleEvent(){return this._setNodeScaleEvent}setNodeScale(e,n){this._setNodeScaleEvent.emit(e,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const i=this._nodeTransformations.value[e]??{...Nf};if(n.some(s=>!Number.isFinite(s)||s<0)){console.error(`setNodeScale error: !Number.isFinite(e) || e < 0 ${e} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[e]:{...i,scaleX:n[0],scaleY:n[1],scaleZ:n[2]}}}getNodePosition(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.translationX,n.translationY,n.translationZ]}getNodeRotation(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.rotationHeading,n.rotationPitch,n.rotationRoll]}getNodeScale(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.scaleX,n.scaleY,n.scaleZ]}get printDebugInfoEvent(){return this._printDebugInfoEvent}printDebugInfo(){this._printDebugInfoEvent.emit()}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){return new Promise(n=>{const i=new B;i.ad(this.setMaterialInfoEvent.donce(s=>{i.destroy(),n(s)})),this._setMaterialEvent.emit(e)})}setLight122(){this.czmEnvironmentMapManager={...pf}}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",dataSource:[...e.dataSource,new Q([this,"url"],"模型路径",Cs.defaults.url,void 0,!0),new Q([this,"instances"],"实例化矩阵",Cs.defaults.instances,void 0,!0)],more:[...e.more,new _e([this,"czmImageBasedLightingFactor"]),new T([this,"czmAtmosphereScatteringIntensity"]),new Q([this,"czmEnvironmentMapManager"]),new it([],()=>this.printDebugInfo(),[],"控制台输出模型信息"),new T([this,"czmMaximumScale"],"最大缩放比例",void 0,!0),new T([this,"czmNativeScale"],"统一缩放值"),new T([this,"czmMinimumPixelSize"],"最小像素尺寸"),new _t([this,"czmColor"],"颜色")]}}};d(Cs,"createDefaultProps",()=>({...Z.createDefaultProps(),url:"${earthsdk3-assets-script-dir}/assets/glb/building.glb",czmMaximumScale:void 0,czmMinimumPixelSize:0,czmNativeScale:1,czmColor:g.reactArray([1,1,1,1]),allowPicking:!0,instances:g.reactArrayWithUndefined([]),czmImageBasedLightingFactor:g.reactArray([1,1]),czmAtmosphereScatteringIntensity:2,czmEnvironmentMapManager:g.reactJsonWithUndefined(void 0)})),d(Cs,"type",Cs.register("ESGltfModel",Cs,{chsName:"模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"gltf模型"}));let _s=Cs;const En=class En extends Z{constructor(e){super(e);d(this,"_aiMoveToEvent",this.dv(new V));d(this,"_stopAIMoveEvent",this.dv(new V))}get aiMoveToEvent(){return this._aiMoveToEvent}aiMoveTo(e,n){this._aiMoveToEvent.emit(e,n)}get stopAIMoveEvent(){return this._stopAIMoveEvent}stopAIMove(){this._stopAIMoveEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pt([this,"mode"],En.modes,"模式",En.defaults.mode,!0),new pt([this,"animation"],En.animations,"动画",En.defaults.animation,!0)],more:[...e.more,new it(["numbers","number"],(n,i)=>this.aiMoveTo(n,i),[[0,0,0],0],"自动寻路"),new it([],()=>this.stopAIMove(),[],"停止自动寻路")]}}};d(En,"createDefaultProps",()=>({...Z.createDefaultProps(),mode:"worker",animation:"standing",allowPicking:!0})),d(En,"type",En.register("ESHuman",En,{chsName:"人员",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"工人 警察 路人"})),d(En,"modes",[["工人","worker"],["警察","police"],["路人","pedestrian"],["陌生人","stranger"],["男士","suitMan"],["女士","suitWoman"]]),d(En,"animations",[["站立","standing"],["行走","walking"],["奔跑","running"]]);let to=En;const ho=class ho extends Hr{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Q([this,"url"],"图片路径",ho.defaults.url),new W([this,"isHoverZoom"],"悬浮放大")]}}};d(ho,"createDefaultProps",()=>({...Hr.createDefaultProps(),url:"inner://CameraBlue.png",isHoverZoom:!1,renderMode:4})),d(ho,"type",ho.register("ESImageLabel",ho,{chsName:"图片标签",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"基础图片标签。"}));let Eh=ho;const yi=class yi extends Dt{constructor(t){super(t),this.ad(g.bind([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(g.bind([this,"czmAlpha"],[this,"opacity"]))}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"dataSource",basic:[...t.basic,new T([this,"zIndex"],"层级序号",yi.defaults.zIndex)],dataSource:[...t.dataSource,new Q([this,"url"],"影像服务地址"),new Pn([this,"rectangle"],"矩形范围",yi.defaults.rectangle,!0),new Pe([this,"maximumLevel"],1,[1,24],"最大级别",yi.defaults.maximumLevel,!0),new Q([this,"options"],"options",yi.defaults.options,void 0,!0),new ot([this,"targetID"],"targetID"),new Pe([this,"opacity"],.01,[0,1],"opacity",1)],more:[...t.more,new nt([],"通用"),new T([this,"height"],"高度"),new ot([this,"actorTag"]),new ot([this,"componentTag"]),new T([this,"minimumLevel"]),new nt([],"图像"),new T([this,"czmAlpha"],"透明度"),new T([this,"czmBrightness"],"亮度"),new T([this,"czmContrast"],"对比度"),new T([this,"czmHue"],"色相"),new T([this,"czmSaturation"],"饱和度"),new T([this,"czmGamma"],"伽马值")]}}};d(yi,"createDefaultProps",()=>({...Dt.createDefaultProps(),url:"",rectangle:g.reactJsonWithUndefined([-180,-90,180,90]),options:g.reactJsonWithUndefined(void 0),zIndex:0,actorTag:"",componentTag:"",maximumLevel:22,minimumLevel:0,targetID:"",czmSplitDirection:"NONE",czmAlpha:1,czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1,opacity:1,splitDirection:"NONE"})),d(yi,"type",yi.register("ESImageryLayer",yi,{chsName:"影像图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"影像图层"}));let Tf=yi;const SP=`
187
207
  # 声明文件
188
208
  ### options 类型
189
209
  \`\`\`javascript
@@ -289,14 +309,14 @@ export type ESJTimeIntervalCollectionJsonType = {
289
309
  };
290
310
 
291
311
  \`\`\`
292
- `,pi=class pi extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new L([this,"size"],"尺寸",pi.defaults.size),new $([this,"autoFollow"],"自动跟随",pi.defaults.autoFollow),new bt([this,"mode"],pi.modes,"模式","blueSky")],more:[...t.more,new L([this,"autoOpacityFactor"],"自动消失系数",pi.defaults.autoOpacityFactor)]}}};g(pi,"createDefaultProps",()=>({...ct.createDefaultProps(),size:1e4,autoFollow:!0,autoOpacityFactor:2,mode:"blueSky",collision:!1,allowPicking:!1})),g(pi,"type",pi.register("ESLocalSkyBox",pi,{chsName:"局部天空盒",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"效果类"})),g(pi,"modes",[["baiyun","baiyun"],["blueSky","blueSky"],["clearSky","clearSky"],["dream","dream"],["starrySky","starrySky"],["sunnySky","sunnySky"],["sunSets","sunSets"]]);let Bf=pi;const Pl=class Pl extends ct{constructor(e){super(e);g(this,"_location",this.disposeVar(d.react(void 0)));{const n=()=>{this.location=this.position};n(),this.ad(this.positionChanged.don(n))}}get location(){return this._location.value}set location(e){this._location.value=e}get locationChanged(){return this._location.changed}};g(Pl,"type",Pl.register("ESLocationMeasurement",Pl,{chsName:"位置测量点",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"位置测量点"}));let Qf=Pl;const ur=class ur extends ct{constructor(e){super(e);g(this,"_player",this.dv(new ci));{const n=ur.defaults;this.d(d.bind([this._player,"loop"],[this,"playingLoop"],i=>i??n.playingLoop,i=>i??n.playingLoop)),this.d(d.bind([this._player,"currentTime"],[this,"currentTime"],i=>i??n.currentTime,i=>i??n.currentTime)),this.d(d.bind([this._player,"duration"],[this,"duration"],i=>i??n.duration,i=>i??n.duration)),this.d(d.bind([this._player,"playing"],[this,"playing"],i=>i??n.playing,i=>i??n.playing)),this.d(d.bind([this._player,"speed"],[this,"playingSpeed"],i=>i??n.playingSpeed,i=>i??n.playingSpeed))}}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new gt([],"通用","通用"),new pt(["number"],n=>this.flyTo(n),[1e3],"飞入"),new _s([this,"updateCallback"],"更新回调函数",void 0,void 0,!0),new L([this,"emissionRate"],"发射率",5,!0),new $([this,"loop"],"是否循环",!0,!0),new L([this,"particleScale"],"等级",1,!0),new L([this,"startScale"],"初始等级",void 0,!0),new L([this,"endScale"],"结束等级",ur.defaults.endScale,!0),new Rt([this,"color"],"颜色",void 0,!0),new Rt([this,"startColor"],"初始颜色",void 0,!0),new Rt([this,"endColor"],"结束颜色",void 0,!0),new $([this,"sizeInMeters"],"尺寸单位为米",void 0,!0),new L([this,"speed"],"速度",1,!0),new L([this,"minimumSpeed"],"最小速度",void 0,!0),new L([this,"maximumSpeed"],"最大速度",void 0,!0),new L([this,"lifetime"],"生命周期",Number.MAX_VALUE,!0),new L([this,"particleLife"],"粒子生命周期",ur.defaults.particleLife,!0),new L([this,"minimumParticleLife"],"最小粒子生命周期",void 0,!0),new L([this,"maximumParticleLife"],"最大粒子生命周期",void 0,!0),new L([this,"mass"],"块数量",1,!0),new L([this,"minimumMass"],"最小块数量",void 0,!0),new L([this,"maximumMass"],"最大块数量",void 0,!0),new Ve([this,"imageSize"],"图片尺寸",ur.defaults.imageSize,!0),new Ve([this,"minimumImageSize"],"最小图片尺寸",void 0,!0),new Ve([this,"maximumImageSize"],"最大图片尺寸",void 0,!0),new mu([this,"image"],"图片",ur.defaults.image,!0),new lr([this,"translation"],"偏移",[0,0,0],!0),new rc([this,"bursts"],"bursts",void 0,!0),new ut([this,"emitter"],"emitter",ur.defaults.emitter),new gt([],"播放器","播放器"),new L([this,"ratio"],"播放比率",0,!0),new Dl([this,"playing"],[this,"ratio"],[this,"playingLoop"],"播放器"),new $([this,"playingLoop"],"是否循环",ur.defaults.playingLoop,!0),new L([this,"currentTime"],"当前时间",ur.defaults.currentTime,!0),new L([this,"duration"],"过渡时间",ur.defaults.duration,!0),new $([this,"playing"],"是否播放",ur.defaults.playing,!0),new L([this,"playingSpeed"],"播放速度",ur.defaults.playingSpeed,!0)]}}};g(ur,"createDefaultProps",()=>({...ct.createDefaultProps(),emitter:d.reactJsonWithUndefined({type:"CircleEmitter",radius:.5}),bursts:d.reactArrayCollectionWithUndefined(void 0),translation:d.reactArrayWithUndefined(void 0),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",imageSize:d.reactArrayWithUndefined([20,20]),minimumImageSize:d.reactArrayWithUndefined(void 0),maximumImageSize:d.reactArrayWithUndefined(void 0),updateCallback:void 0,emissionRate:void 0,loop:void 0,particleScale:void 0,startScale:void 0,endScale:4,color:d.reactArrayWithUndefined(void 0),startColor:d.reactArrayWithUndefined(void 0),endColor:d.reactArrayWithUndefined(void 0),sizeInMeters:void 0,speed:void 0,minimumSpeed:void 0,maximumSpeed:void 0,lifetime:void 0,particleLife:.5,minimumParticleLife:void 0,maximumParticleLife:void 0,mass:void 0,minimumMass:void 0,maximumMass:void 0,playingLoop:!0,currentTime:0,duration:6e3,playingSpeed:1,playing:!0})),g(ur,"type",ur.register("ESParticleSystemPrimitive",ur,{chsName:"粒子",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"通过Cesium的Primitive API 实现的粒子特效。"}));let Kf=ur;const vi=class vi extends fn{constructor(e){super(e);g(this,"initialStyle",this.ad(d.reactJsonWithUndefined(void 0)));g(this,"_getInitialStyleEvent",this.disposeVar(new d.Event))}get getInitialStyleEvent(){return this._getInitialStyleEvent}getInitialStyle(){return Promise.race([new Promise(e=>{const n=this.d(this.initialStyle.changed.disposableOnce(e));this.getInitialStyleEvent.emit(),setTimeout(()=>{n(),e(void 0)},2e3)})])}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new bt([this,"mode"],vi.modes,"模式",vi.defaults.mode),new ut([this,"style"],"样式",vi.defaults.style),new $([this,"autoAnchor"],"自动锚点对齐",vi.defaults.autoAnchor)]}}};g(vi,"createDefaultProps",()=>({...fn.createDefaultProps(),mode:"SquareH01",style:d.reactJson({fontSize:16,imageSize:[60,60],textBackgroundColor:[1,1,1,0],textBackgroundSize:[120,30],textColor:[1,1,1,1],textOffset:[10,2],textBoxOffset:[40,0],textBoxAlign:"start",textBoxShow:!0,textBoxMode:"default"}),autoAnchor:!0})),g(vi,"type",vi.register("ESPoi2D",vi,{chsName:"ESPoi2D",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"三角形,菱形"})),g(vi,"modes",[["自定义","Custom"],["SquareH01","SquareH01"],["SquareH02","SquareH02"],["SquareV01","SquareV01"],["SquareV02","SquareV02"],["SquareV03","SquareV03"],["SquareV04","SquareV04"],["Flag01","Flag01"],["Flag02","Flag02"],["Linear01","Linear01"],["Linear02","Linear02"],["Linear03","Linear03"],["CircularH01","CircularH01"],["CircularH02","CircularH02"],["CircularV01","CircularV01"],["CircularV02","CircularV02"],["CircularV03","CircularV03"],["CircularV04","CircularV04"],["CircularV05","CircularV05"],["P3D01","P3D01"],["P3D02","P3D02"],["P3D03","P3D03"],["P3D04","P3D04"],["P3D05","P3D05"],["P3D06","P3D06"],["P3D07","P3D07"],["Diamond01","Diamond01"],["Diamond02","Diamond02"],["Stranger","Stranger"],["ManNormal","ManNormal"],["ManAbnormal","ManAbnormal"],["WomanNormal","WomanNormal"],["WomanAbnormal","WomanAbnormal"],["Camera","Camera"]]);let pl=vi;const zi=class zi extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new bt([this,"mode"],zi.modes,"模式",zi.defaults.mode),new ut([this,"style"],"样式",zi.defaults.style)]}}};g(zi,"createDefaultProps",()=>({...ct.createDefaultProps(),mode:"triangle",style:d.reactJson({UI_Color:[.09803921568627451,.40784313725490196,.8,1],FX_Color:[.09803921568627451,.40784313725490196,.8,1]})})),g(zi,"type",zi.register("ESPoi3D",zi,{chsName:"ESPoi3D",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"三角形,菱形"})),g(zi,"modes",[["三角形","triangle"],["菱形","diamond"]]);let Zf=zi;const Qa=class Qa extends ie{constructor(e){super(e);g(this,"_czmFlattenedPlaneId",this.dv(d.react("")))}get czmFlattenedPlaneId(){return this._czmFlattenedPlaneId.value}set czmFlattenedPlaneId(e){this._czmFlattenedPlaneId.value=e}get czmFlattenedPlaneIdChanged(){return this._czmFlattenedPlaneId.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new _t([this,"targetID"],"瓦片图层","")]}}};g(Qa,"createDefaultProps",()=>({...ie.createDefaultProps(),targetID:"",filled:!1})),g(Qa,"type",Qa.register("ESPolygonFlattenedPlane",Qa,{chsName:"压平",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPolygonFlattenedPlane"}));let $f=Qa;const Vv=async(r,t,e)=>{const{viewer:n}=r;if(!n){console.error("AddTrees: ueViewer.viewer is undefined");return}const i=await n.callUeFunc({f:"AddTrees",p:{id:t,TreeParams:e}});return i.error&&console.error("AddTrees:",i.error),i},Uv=async(r,t)=>{const{viewer:e}=r;if(!e){console.error("RemoveAllTrees: ueViewer.viewer is undefined");return}const n=await e.callUeFunc({f:"RemoveAllTrees",p:{id:t}});return n.error&&console.error("RemoveAllTrees:",n.error),n},zv=async(r,t,e)=>{const{viewer:n}=r;if(!n){console.error("UpdateTreeParams: ueViewer.viewer is undefined");return}const i=await n.callUeFunc({f:"UpdateTreeParams",p:{id:t,TreeParams:e}});return i.error&&console.error("UpdateTreeParams:",i.error),i},qv=async(r,t,e,n)=>{const{viewer:i}=r;if(!i){console.error("CutDownTrees: ueViewer.viewer is undefined");return}const s=await i.callUeFunc({f:"CutDownTrees",p:{id:t,TreeIds:e,TimeLength:n}});return s.error&&console.error("CutDownTrees:",s.error),s},Wv=async(r,t,e,n,i)=>{const{viewer:s}=r;if(!s){console.error("GrowthSimulation: ueViewer.viewer is undefined");return}const o=await s.callUeFunc({f:"GrowthSimulation",p:{id:t,ToParams:e,SwitchTime:i,TimeLength:n}});return o.error&&console.error("GrowthSimulation:",o.error),o},Ka=class Ka extends ee{constructor(e){super(e);g(this,"_addTreesEvent",this.dv(new d.Event));g(this,"_removeAllTreesEvent",this.dv(new d.Event));g(this,"_updateTreeParamsEvent",this.dv(new d.Event));g(this,"_cutDownTreesEvent",this.dv(new d.Event));g(this,"_growthSimulationEvent",this.dv(new d.Event))}async addTreesCallFunc(e,n){return await Vv(e,this.id,n)}async updateTreeParamsCallFunc(e,n){return await zv(e,this.id,n)}async cutDownTreesCallFunc(e,n,i){return await qv(e,this.id,n,i)}async removeAllTreesCallFunc(e){return await Uv(e,this.id)}async growthSimulationCallFunc(e,n,i,s){return await Wv(e,this.id,n,i,s)}async getIdByComponentNameAndHitItem(e,n,i){return await e.getIdByComponentNameAndHitItem(this.id,n,i)}get addTreesEvent(){return this._addTreesEvent}addTrees(e){this._addTreesEvent.emit(e)}get removeAllTreesEvent(){return this._removeAllTreesEvent}removeAllTrees(){this._removeAllTreesEvent.emit()}get updateTreeParamsEvent(){return this._updateTreeParamsEvent}updateTreeParams(e){this._updateTreeParamsEvent.emit(e)}get cutDownTreesEvent(){return this._cutDownTreesEvent}cutDownTrees(e,n){this._cutDownTreesEvent.emit(e,n)}get growthSimulationEvent(){return this._growthSimulationEvent}growthSimulation(e,n,i){this._growthSimulationEvent.emit(e,n,i)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new gt([],"通用"),new ut([this,"treeTypes"],"treeTypes",[],"{ name: string, meshPath: string }[]",!0),new L([this,"stumpId"],"树桩id"),new L([this,"intervalTime"],"动画间隔时间"),new L([this,"switchIntervalTime"],"切换间隔时间")]}}};g(Ka,"createDefaultProps",()=>({...ee.createDefaultProps(),treeTypes:d.reactJsonWithUndefined([]),stumpId:-1,intervalTime:.1,switchIntervalTime:.5})),g(Ka,"type",Ka.register("ESSeparateFoliage",Ka,{chsName:"单体控制森林",tags:["ESObjects","_ES_Impl_UE"],description:"ESSeparateFoliage"}));let jf=Ka;function Uh(r,t,e){const n="buffer"in r,i=n?r.buffer:r;n&&(t+=r.byteOffset);const s=new Array(e),o=new DataView(i);for(let a=0;a<e;++a){const u=o.getUint8(t+a);s[a]=String.fromCharCode(u)}return s.join("")}function zh(r,t){const e="buffer"in r,n=e?r.buffer:r;return e&&(t+=r.byteOffset),new DataView(n).getUint32(t,!0)}function Xv(r,t,e){const n="buffer"in r,i=n?r.buffer:r;if(n&&(t+=r.byteOffset),t+e>i.byteLength){console.error("byteOffset + length > buffer.byteLength");return}return new Uint8Array(i,t,e)}function iI(r,t,e){const n="buffer"in r,i=n?r.buffer:r;if(n&&(t+=r.byteOffset),t+e*2>i.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Uint16Array(i,t,e)}function sI(r,t,e){const n="buffer"in r,i=n?r.buffer:r;if(n&&(t+=r.byteOffset),t+e*4>i.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Uint32Array(i,t,e)}function oI(r,t,e){const n="buffer"in r,i=n?r.buffer:r;if(n&&(t+=r.byteOffset),t+e*4>i.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Float32Array(i,t,e)}function Hv(r){if(Uh(r,0,4)!=="glTF"){console.error("Not a glTF file");return}const e=zh(r,4);if(e!==2){console.error("Unsupported glTF version");return}const n=zh(r,8);if(n!==r.byteLength){console.error("Invalid glTF length");return}const i=zh(r,12);if(i+12+4>n){console.error("Invalid glTF chunk length");return}if(Uh(r,16,4)!=="JSON"){console.error("Invalid glTF chunk type");return}const o=Uh(r,20,i),a={version:e,length:n,gltfJson:o};if(20+i<r.byteLength){const u=zh(r,20+i);if(Uh(r,20+i+4,4)!=="BIN\0"){console.error("Invalid glTF chunk type");return}const h=Xv(r,20+i+8,u);a.gltfBinary=h}return a}window.parseGlb=Hv;function Yv(r){const t=Hv(r);if(t===void 0||!t.gltfBinary)return;const e=JSON.parse(t.gltfJson);return e.nodes.map(n=>{var i=e.meshes[n.mesh],s=i.primitives[0].attributes.POSITION,o=i.primitives[0].indices,a=e.accessors[s],u=e.bufferViews[a.bufferView];if(!t.gltfBinary)throw new Error("!glbParseResult.gltfBinary");const l=oI(t.gltfBinary,u.byteOffset??0,u.byteLength/4);var h=e.accessors[o],c=e.bufferViews[h.bufferView];if(!t.gltfBinary)throw new Error("!glbParseResult.gltfBinary");let f;return h.componentType===5121?f=Xv(t.gltfBinary,c.byteOffset??0,c.byteLength/1):h.componentType===5123?f=iI(t.gltfBinary,c.byteOffset??0,c.byteLength/2):h.componentType===5125&&(f=sI(t.gltfBinary,c.byteOffset??0,c.byteLength/4)),{name:n.name,posBuffer:l,indicesBuffer:f}})}window.parseWaterGlb=Yv;const Er=class Er extends ct{constructor(e){super(e);g(this,"_submergingData");g(this,"_allMoments",[]);g(this,"readyEvent",this.dv(new d.Event));{const n=()=>{this.url!=""&&fetch(this.url).then(i=>{i.status==200&&i.ok&&i.arrayBuffer().then(s=>{this._submergingData=Yv(s);const o=this._submergingData.map(a=>Date.parse(a.name)).sort();this._allMoments=o,this.currentTime==0&&(this.currentTime=o[0]),this.readyEvent.emit()})}).catch(i=>{console.log(i)})};n(),this.d(this.urlChanged.don(()=>{n()}))}}get getSubmergingData(){return this._submergingData}getAllMoments(){return this._allMoments}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new _t([this,"url"],"Url地址",Er.defaults.url),new Xe([this,"amplitude"],.01,[0,1],"振幅",Er.defaults.amplitude),new L([this,"frequency"],"频率",Er.defaults.frequency),new L([this,"currentTime"],"当前时间",Er.defaults.currentTime),new ut([this,"materialParams"],"材质参数",Er.defaults.materialParams),new bt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型","river"),new Rt([this,"waterColor"],"水的底色",Er.defaults.waterColor),new Xe([this,"waveVelocity"],.01,[0,1],"波动频率",Er.defaults.waveVelocity),new L([this,"flowSpeed"],"水流速度",Er.defaults.flowSpeed),new Xe([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Er.defaults.specularIntensity),new Xe([this,"murkiness"],.01,[0,10],"水体浑浊度",Er.defaults.murkiness)]}}};g(Er,"createDefaultProps",()=>({...ct.createDefaultProps(),allowPicking:!0,url:"",currentTime:0,materialParams:d.reactJson({}),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowSpeed:0,murkiness:5})),g(Er,"type",Er.register("ESSubmergingAnalysis",Er,{chsName:"淹没分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESSubmergingAnalysis"}));let td=Er;const Fo=class Fo extends ie{constructor(e){super(e);g(this,"_startEvent",this.dv(new d.Event));g(this,"_stopEvent",this.dv(new d.Event))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Rt([this,"startColor"],"起始颜色"),new Rt([this,"endColor"],"结束颜色"),new L([this,"progress"],"计算进度"),new L([this,"extrudedHeight"],"高度m"),new L([this,"height"],"底面高度"),new L([this,"sampleDistance"],"采样间距m"),new L([this,"startTime"],"起始时间,时间戳"),new L([this,"endTime"],"结束时间,时间戳"),new L([this,"spanTime"],"时间跨度,默认1小时时间戳"),new pt([],()=>this.start(),[],"开始分析"),new pt([],()=>this.stop(),[],"结束分析")]}}};g(Fo,"createDefaultProps",()=>({...ie.createDefaultProps(),extrudedHeight:30,height:0,sampleDistance:10,startColor:d.reactArray([1,1,0,1]),endColor:d.reactArray([1,0,0,1]),startTime:0,endTime:36e6,spanTime:1,progress:0,filled:!1,stroked:!1})),g(Fo,"type",Fo.register("ESSunshineAnalysis",Fo,{chsName:"日照分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"日照分析"})),g(Fo,"supportEditingModes",[...ie.supportEditingModes,lt.HeightModify]);let ed=Fo;const zn=class zn extends ee{constructor(e){super(e);g(this,"_activateEvent",this.disposeVar(new d.Event));g(this,"activate",!1)}get activateEvent(){return this._activateEvent}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new L([this,"zIndex"],"层级序号",zn.defaults.zIndex),new bt([this,"renderMode"],zn.renderModes,"渲染模式","default"),new L([this,"opacity"],"透明度",zn.defaults.opacity)],dataSource:[...e.dataSource,new ut([this,"url"],"地形服务地址",zn.defaults.url),new Hn([this,"rectangle"],"矩形范围",zn.defaults.rectangle)],more:[...e.more,new L([this,"czmMinzoom"],"czmMinzoom",void 0,!0),new L([this,"czmMaxzoom"],"czmMaxzoom",void 0,!0)]}}};g(zn,"createDefaultProps",()=>({...ee.createDefaultProps(),url:"http://inner.earthsdk.com/layer.json",rectangle:d.reactArray([-180,-90,180,90]),zIndex:0,czmMaxzoom:void 0,czmMinzoom:void 0,renderMode:"default",opacity:1})),g(zn,"type",zn.register("ESTerrainLayer",zn,{chsName:"地形图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地形图层"})),g(zn,"renderModes",[["使用深度检测","default"],["不使用深度检测","disableDepthTest"],["透明","transparent"]]);let rd=zn;const qi=class qi extends fn{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Rt([this,"color"],"文本颜色",[1,1,1,1]),new L([this,"fontSize"],"文字大小",14),new nc([this,"text"],"内容",qi.defaults.text,void 0,!0),new Rt([this,"backgroundColor"],"背景颜色",qi.defaults.backgroundColor),new Hn([this,"padding"],"内边距",qi.defaults.padding),new Rt([this,"borderColor"],"边界颜色"),new Hn([this,"borderRadius"],"边界圆角"),new L([this,"borderWidth"],"边界宽度")],more:[...t.more,new gt([],"czm","czm"),new $([this,"textEditingInteraction"],"文本编辑交互"),new $([this,"textEditing"],"文本编辑"),new L([this,"width"],"宽度",qi.defaults.width,!0),new L([this,"opacity"],"透明度"),new bt([this,"textAlign"],[["center","center"],["left","left"],["right","right"]],"文字位置","left"),new bt([this,"borderStyle"],[["none","none"],["hidden","hidden"],["dotted","dotted"],["dashed","dashed"],["solid","solid"],["double","double"],["groove","groove"],["ridge","ridge"],["inset","inset"],["outset","outset"]],"边框类型")]}}};g(qi,"createDefaultProps",()=>({...fn.createDefaultProps(),text:"请输入文字",width:80,textEditing:!1,textEditingInteraction:!1,opacity:1,fontSize:14,textAlign:"left",color:d.reactArray([1,1,1,1]),backgroundColor:d.reactArray([0,0,0,.8]),padding:d.reactArray([5,5,5,5]),borderRadius:d.reactArray([6,6,6,6]),borderWidth:0,borderColor:d.reactArray([1,1,1,1]),borderStyle:"solid"})),g(qi,"type",qi.register("ESTextLabel",qi,{chsName:"文本标签",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"文本标签。"}));let nd=qi;const aI=`
312
+ `,Yn=class Yn extends Z{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new T([this,"size"],"尺寸",Yn.defaults.size),new W([this,"autoFollow"],"自动跟随",Yn.defaults.autoFollow),new pt([this,"mode"],Yn.modes,"模式","blueSky")],more:[...t.more,new T([this,"autoOpacityFactor"],"自动消失系数",Yn.defaults.autoOpacityFactor)]}}};d(Yn,"createDefaultProps",()=>({...Z.createDefaultProps(),size:1e4,autoFollow:!0,autoOpacityFactor:2,mode:"blueSky",collision:!1,allowPicking:!1})),d(Yn,"type",Yn.register("ESLocalSkyBox",Yn,{chsName:"局部天空盒",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"效果类"})),d(Yn,"modes",[["baiyun","baiyun"],["blueSky","blueSky"],["clearSky","clearSky"],["dream","dream"],["starrySky","starrySky"],["sunnySky","sunnySky"],["sunSets","sunSets"]]);let Of=Yn;const ul=class ul extends Z{constructor(e){super(e);d(this,"_location",this.disposeVar(g.react(void 0)));{const n=()=>{this.location=this.position};n(),this.ad(this.positionChanged.don(n))}}get location(){return this._location.value}set location(e){this._location.value=e}get locationChanged(){return this._location.changed}};d(ul,"type",ul.register("ESLocationMeasurement",ul,{chsName:"位置测量点",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"位置测量点"}));let Df=ul;const Ye=class Ye extends Z{constructor(e){super(e);d(this,"_player",this.dv(new Mn));{const n=Ye.defaults;this.d(g.bind([this._player,"loop"],[this,"playingLoop"],i=>i??n.playingLoop,i=>i??n.playingLoop)),this.d(g.bind([this._player,"currentTime"],[this,"currentTime"],i=>i??n.currentTime,i=>i??n.currentTime)),this.d(g.bind([this._player,"duration"],[this,"duration"],i=>i??n.duration,i=>i??n.duration)),this.d(g.bind([this._player,"playing"],[this,"playing"],i=>i??n.playing,i=>i??n.playing)),this.d(g.bind([this._player,"speed"],[this,"playingSpeed"],i=>i??n.playingSpeed,i=>i??n.playingSpeed))}}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new nt([],"通用","通用"),new it(["number"],n=>this.flyTo(n),[1e3],"飞入"),new Qi([this,"updateCallback"],"更新回调函数",void 0,void 0,!0),new T([this,"emissionRate"],"发射率",5,!0),new W([this,"loop"],"是否循环",!0,!0),new T([this,"particleScale"],"等级",1,!0),new T([this,"startScale"],"初始等级",void 0,!0),new T([this,"endScale"],"结束等级",Ye.defaults.endScale,!0),new _t([this,"color"],"颜色",void 0,!0),new _t([this,"startColor"],"初始颜色",void 0,!0),new _t([this,"endColor"],"结束颜色",void 0,!0),new W([this,"sizeInMeters"],"尺寸单位为米",void 0,!0),new T([this,"speed"],"速度",1,!0),new T([this,"minimumSpeed"],"最小速度",void 0,!0),new T([this,"maximumSpeed"],"最大速度",void 0,!0),new T([this,"lifetime"],"生命周期",Number.MAX_VALUE,!0),new T([this,"particleLife"],"粒子生命周期",Ye.defaults.particleLife,!0),new T([this,"minimumParticleLife"],"最小粒子生命周期",void 0,!0),new T([this,"maximumParticleLife"],"最大粒子生命周期",void 0,!0),new T([this,"mass"],"块数量",1,!0),new T([this,"minimumMass"],"最小块数量",void 0,!0),new T([this,"maximumMass"],"最大块数量",void 0,!0),new _e([this,"imageSize"],"图片尺寸",Ye.defaults.imageSize,!0),new _e([this,"minimumImageSize"],"最小图片尺寸",void 0,!0),new _e([this,"maximumImageSize"],"最大图片尺寸",void 0,!0),new eu([this,"image"],"图片",Ye.defaults.image,!0),new Je([this,"translation"],"偏移",[0,0,0],!0),new Gh([this,"bursts"],"bursts",void 0,!0),new Q([this,"emitter"],"emitter",Ye.defaults.emitter),new nt([],"播放器","播放器"),new T([this,"ratio"],"播放比率",0,!0),new cl([this,"playing"],[this,"ratio"],[this,"playingLoop"],"播放器"),new W([this,"playingLoop"],"是否循环",Ye.defaults.playingLoop,!0),new T([this,"currentTime"],"当前时间",Ye.defaults.currentTime,!0),new T([this,"duration"],"过渡时间",Ye.defaults.duration,!0),new W([this,"playing"],"是否播放",Ye.defaults.playing,!0),new T([this,"playingSpeed"],"播放速度",Ye.defaults.playingSpeed,!0)]}}};d(Ye,"createDefaultProps",()=>({...Z.createDefaultProps(),emitter:g.reactJsonWithUndefined({type:"CircleEmitter",radius:.5}),bursts:g.reactArrayCollectionWithUndefined(void 0),translation:g.reactArrayWithUndefined(void 0),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",imageSize:g.reactArrayWithUndefined([20,20]),minimumImageSize:g.reactArrayWithUndefined(void 0),maximumImageSize:g.reactArrayWithUndefined(void 0),updateCallback:void 0,emissionRate:void 0,loop:void 0,particleScale:void 0,startScale:void 0,endScale:4,color:g.reactArrayWithUndefined(void 0),startColor:g.reactArrayWithUndefined(void 0),endColor:g.reactArrayWithUndefined(void 0),sizeInMeters:void 0,speed:void 0,minimumSpeed:void 0,maximumSpeed:void 0,lifetime:void 0,particleLife:.5,minimumParticleLife:void 0,maximumParticleLife:void 0,mass:void 0,minimumMass:void 0,maximumMass:void 0,playingLoop:!0,currentTime:0,duration:6e3,playingSpeed:1,playing:!0})),d(Ye,"type",Ye.register("ESParticleSystemPrimitive",Ye,{chsName:"粒子",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"通过Cesium的Primitive API 实现的粒子特效。"}));let Sh=Ye;const Jn=class Jn extends Hr{constructor(e){super(e);d(this,"initialStyle",this.ad(g.reactJsonWithUndefined(void 0)));d(this,"_getInitialStyleEvent",this.disposeVar(new V))}get getInitialStyleEvent(){return this._getInitialStyleEvent}getInitialStyle(){return Promise.race([new Promise(e=>{const n=this.d(this.initialStyle.changed.disposableOnce(e));this.getInitialStyleEvent.emit(),setTimeout(()=>{n(),e(void 0)},2e3)})])}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pt([this,"mode"],Jn.modes,"模式",Jn.defaults.mode),new Q([this,"style"],"样式",Jn.defaults.style),new W([this,"autoAnchor"],"自动锚点对齐",Jn.defaults.autoAnchor)]}}};d(Jn,"createDefaultProps",()=>({...Hr.createDefaultProps(),mode:"SquareH01",style:g.reactJson({fontSize:16,imageSize:[60,60],textBackgroundColor:[1,1,1,0],textBackgroundSize:[120,30],textColor:[1,1,1,1],textOffset:[10,2],textBoxOffset:[40,0],textBoxAlign:"start",textBoxShow:!0,textBoxMode:"default"}),autoAnchor:!0})),d(Jn,"type",Jn.register("ESPoi2D",Jn,{chsName:"ESPoi2D",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"三角形,菱形"})),d(Jn,"modes",[["自定义","Custom"],["SquareH01","SquareH01"],["SquareH02","SquareH02"],["SquareV01","SquareV01"],["SquareV02","SquareV02"],["SquareV03","SquareV03"],["SquareV04","SquareV04"],["Flag01","Flag01"],["Flag02","Flag02"],["Linear01","Linear01"],["Linear02","Linear02"],["Linear03","Linear03"],["CircularH01","CircularH01"],["CircularH02","CircularH02"],["CircularV01","CircularV01"],["CircularV02","CircularV02"],["CircularV03","CircularV03"],["CircularV04","CircularV04"],["CircularV05","CircularV05"],["P3D01","P3D01"],["P3D02","P3D02"],["P3D03","P3D03"],["P3D04","P3D04"],["P3D05","P3D05"],["P3D06","P3D06"],["P3D07","P3D07"],["Diamond01","Diamond01"],["Diamond02","Diamond02"],["Stranger","Stranger"],["ManNormal","ManNormal"],["ManAbnormal","ManAbnormal"],["WomanNormal","WomanNormal"],["WomanAbnormal","WomanAbnormal"],["Camera","Camera"]]);let tl=Jn;const _i=class _i extends Z{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new pt([this,"mode"],_i.modes,"模式",_i.defaults.mode),new Q([this,"style"],"样式",_i.defaults.style)]}}};d(_i,"createDefaultProps",()=>({...Z.createDefaultProps(),mode:"triangle",style:g.reactJson({UI_Color:[.09803921568627451,.40784313725490196,.8,1],FX_Color:[.09803921568627451,.40784313725490196,.8,1]})})),d(_i,"type",_i.register("ESPoi3D",_i,{chsName:"ESPoi3D",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"三角形,菱形"})),d(_i,"modes",[["三角形","triangle"],["菱形","diamond"],["制(存)梁场","BridgePrefabricationSite"],["汽车运输便道","ExportRoad"],["拌合站","MixingStation"],["小型预制构件厂","PrefabricatedComponentsSite"],["项目部","ProjectDepartment"],["铁路岔线","RailwayFork"],["钢筋加工厂","RebarMachining"],["临时电力干线","TempElectricMain"],["铺轨基地","TrackLayingBase"],["汽车运梁通道","TransportationBridge"]]);let Af=_i;const Da=class Da extends Ut{constructor(e){super(e);d(this,"_czmFlattenedPlaneId",this.dv(g.react("")))}get czmFlattenedPlaneId(){return this._czmFlattenedPlaneId.value}set czmFlattenedPlaneId(e){this._czmFlattenedPlaneId.value=e}get czmFlattenedPlaneIdChanged(){return this._czmFlattenedPlaneId.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ot([this,"targetID"],"瓦片图层","")]}}};d(Da,"createDefaultProps",()=>({...Ut.createDefaultProps(),targetID:"",filled:!1})),d(Da,"type",Da.register("ESPolygonFlattenedPlane",Da,{chsName:"压平",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPolygonFlattenedPlane"}));let Lf=Da;const Av=async(r,t,e)=>{const{viewer:n}=r;if(!n){console.error("AddTrees: ueViewer.viewer is undefined");return}const i=await n.callUeFunc({f:"AddTrees",p:{id:t,TreeParams:e}});return i.error&&console.error("AddTrees:",i.error),i},Lv=async(r,t)=>{const{viewer:e}=r;if(!e){console.error("RemoveAllTrees: ueViewer.viewer is undefined");return}const n=await e.callUeFunc({f:"RemoveAllTrees",p:{id:t}});return n.error&&console.error("RemoveAllTrees:",n.error),n},Rv=async(r,t,e)=>{const{viewer:n}=r;if(!n){console.error("UpdateTreeParams: ueViewer.viewer is undefined");return}const i=await n.callUeFunc({f:"UpdateTreeParams",p:{id:t,TreeParams:e}});return i.error&&console.error("UpdateTreeParams:",i.error),i},Fv=async(r,t,e,n)=>{const{viewer:i}=r;if(!i){console.error("CutDownTrees: ueViewer.viewer is undefined");return}const s=await i.callUeFunc({f:"CutDownTrees",p:{id:t,TreeIds:e,TimeLength:n}});return s.error&&console.error("CutDownTrees:",s.error),s},kv=async(r,t,e,n,i)=>{const{viewer:s}=r;if(!s){console.error("GrowthSimulation: ueViewer.viewer is undefined");return}const o=await s.callUeFunc({f:"GrowthSimulation",p:{id:t,ToParams:e,SwitchTime:i,TimeLength:n}});return o.error&&console.error("GrowthSimulation:",o.error),o},Aa=class Aa extends Dt{constructor(e){super(e);d(this,"_addTreesEvent",this.dv(new V));d(this,"_removeAllTreesEvent",this.dv(new V));d(this,"_updateTreeParamsEvent",this.dv(new V));d(this,"_cutDownTreesEvent",this.dv(new V));d(this,"_growthSimulationEvent",this.dv(new V))}async addTreesCallFunc(e,n){return await Av(e,this.id,n)}async updateTreeParamsCallFunc(e,n){return await Rv(e,this.id,n)}async cutDownTreesCallFunc(e,n,i){return await Fv(e,this.id,n,i)}async removeAllTreesCallFunc(e){return await Lv(e,this.id)}async growthSimulationCallFunc(e,n,i,s){return await kv(e,this.id,n,i,s)}async getIdByComponentNameAndHitItem(e,n,i){return await e.getIdByComponentNameAndHitItem(this.id,n,i)}get addTreesEvent(){return this._addTreesEvent}addTrees(e){this._addTreesEvent.emit(e)}get removeAllTreesEvent(){return this._removeAllTreesEvent}removeAllTrees(){this._removeAllTreesEvent.emit()}get updateTreeParamsEvent(){return this._updateTreeParamsEvent}updateTreeParams(e){this._updateTreeParamsEvent.emit(e)}get cutDownTreesEvent(){return this._cutDownTreesEvent}cutDownTrees(e,n){this._cutDownTreesEvent.emit(e,n)}get growthSimulationEvent(){return this._growthSimulationEvent}growthSimulation(e,n,i){this._growthSimulationEvent.emit(e,n,i)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new nt([],"通用"),new Q([this,"treeTypes"],"treeTypes",[],"{ name: string, meshPath: string }[]",!0),new T([this,"stumpId"],"树桩id"),new T([this,"intervalTime"],"动画间隔时间"),new T([this,"switchIntervalTime"],"切换间隔时间")]}}};d(Aa,"createDefaultProps",()=>({...Dt.createDefaultProps(),treeTypes:g.reactJsonWithUndefined([]),stumpId:-1,intervalTime:.1,switchIntervalTime:.5})),d(Aa,"type",Aa.register("ESSeparateFoliage",Aa,{chsName:"单体控制森林",tags:["ESObjects","_ES_Impl_UE"],description:"ESSeparateFoliage"}));let Rf=Aa;function Ch(r,t,e){const n="buffer"in r,i=n?r.buffer:r;n&&(t+=r.byteOffset);const s=new Array(e),o=new DataView(i);for(let a=0;a<e;++a){const u=o.getUint8(t+a);s[a]=String.fromCharCode(u)}return s.join("")}function Ih(r,t){const e="buffer"in r,n=e?r.buffer:r;return e&&(t+=r.byteOffset),new DataView(n).getUint32(t,!0)}function Vv(r,t,e){const n="buffer"in r,i=n?r.buffer:r;if(n&&(t+=r.byteOffset),t+e>i.byteLength){console.error("byteOffset + length > buffer.byteLength");return}return new Uint8Array(i,t,e)}function CP(r,t,e){const n="buffer"in r,i=n?r.buffer:r;if(n&&(t+=r.byteOffset),t+e*2>i.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Uint16Array(i,t,e)}function IP(r,t,e){const n="buffer"in r,i=n?r.buffer:r;if(n&&(t+=r.byteOffset),t+e*4>i.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Uint32Array(i,t,e)}function PP(r,t,e){const n="buffer"in r,i=n?r.buffer:r;if(n&&(t+=r.byteOffset),t+e*4>i.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Float32Array(i,t,e)}function Uv(r){if(Ch(r,0,4)!=="glTF"){console.error("Not a glTF file");return}const e=Ih(r,4);if(e!==2){console.error("Unsupported glTF version");return}const n=Ih(r,8);if(n!==r.byteLength){console.error("Invalid glTF length");return}const i=Ih(r,12);if(i+12+4>n){console.error("Invalid glTF chunk length");return}if(Ch(r,16,4)!=="JSON"){console.error("Invalid glTF chunk type");return}const o=Ch(r,20,i),a={version:e,length:n,gltfJson:o};if(20+i<r.byteLength){const u=Ih(r,20+i);if(Ch(r,20+i+4,4)!=="BIN\0"){console.error("Invalid glTF chunk type");return}const h=Vv(r,20+i+8,u);a.gltfBinary=h}return a}window.parseGlb=Uv;function zv(r){const t=Uv(r);if(t===void 0||!t.gltfBinary)return;const e=JSON.parse(t.gltfJson);return e.nodes.map(n=>{var i=e.meshes[n.mesh],s=i.primitives[0].attributes.POSITION,o=i.primitives[0].indices,a=e.accessors[s],u=e.bufferViews[a.bufferView];if(!t.gltfBinary)throw new Error("!glbParseResult.gltfBinary");const l=PP(t.gltfBinary,u.byteOffset??0,u.byteLength/4);var h=e.accessors[o],c=e.bufferViews[h.bufferView];if(!t.gltfBinary)throw new Error("!glbParseResult.gltfBinary");let f;return h.componentType===5121?f=Vv(t.gltfBinary,c.byteOffset??0,c.byteLength/1):h.componentType===5123?f=CP(t.gltfBinary,c.byteOffset??0,c.byteLength/2):h.componentType===5125&&(f=IP(t.gltfBinary,c.byteOffset??0,c.byteLength/4)),{name:n.name,posBuffer:l,indicesBuffer:f}})}window.parseWaterGlb=zv;const sr=class sr extends Z{constructor(e){super(e);d(this,"_submergingData");d(this,"_allMoments",[]);d(this,"readyEvent",this.dv(new V));{const n=()=>{this.url!=""&&fetch(this.url).then(i=>{i.status==200&&i.ok&&i.arrayBuffer().then(s=>{this._submergingData=zv(s);const o=this._submergingData.map(a=>Date.parse(a.name)).sort();this._allMoments=o,this.currentTime==0&&(this.currentTime=o[0]),this.readyEvent.emit()})}).catch(i=>{console.log(i)})};n(),this.d(this.urlChanged.don(()=>{n()}))}}get getSubmergingData(){return this._submergingData}getAllMoments(){return this._allMoments}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ot([this,"url"],"Url地址",sr.defaults.url),new Pe([this,"amplitude"],.01,[0,1],"振幅",sr.defaults.amplitude),new T([this,"frequency"],"频率",sr.defaults.frequency),new T([this,"currentTime"],"当前时间",sr.defaults.currentTime),new Q([this,"materialParams"],"材质参数",sr.defaults.materialParams),new pt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型","river"),new _t([this,"waterColor"],"水的底色",sr.defaults.waterColor),new Pe([this,"waveVelocity"],.01,[0,1],"波动频率",sr.defaults.waveVelocity),new T([this,"flowSpeed"],"水流速度",sr.defaults.flowSpeed),new Pe([this,"specularIntensity"],.01,[0,1],"镜面反射强度",sr.defaults.specularIntensity),new Pe([this,"murkiness"],.01,[0,10],"水体浑浊度",sr.defaults.murkiness)]}}};d(sr,"createDefaultProps",()=>({...Z.createDefaultProps(),allowPicking:!0,url:"",currentTime:0,materialParams:g.reactJson({}),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowSpeed:0,murkiness:5})),d(sr,"type",sr.register("ESSubmergingAnalysis",sr,{chsName:"淹没分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESSubmergingAnalysis"}));let Ff=sr;const co=class co extends Ut{constructor(e){super(e);d(this,"_startEvent",this.dv(new V));d(this,"_stopEvent",this.dv(new V))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new _t([this,"startColor"],"起始颜色"),new _t([this,"endColor"],"结束颜色"),new T([this,"progress"],"计算进度"),new T([this,"extrudedHeight"],"高度m"),new T([this,"height"],"底面高度"),new T([this,"sampleDistance"],"采样间距m"),new T([this,"startTime"],"起始时间,时间戳"),new T([this,"endTime"],"结束时间,时间戳"),new T([this,"spanTime"],"时间跨度,默认1小时时间戳"),new it([],()=>this.start(),[],"开始分析"),new it([],()=>this.stop(),[],"结束分析")]}}};d(co,"createDefaultProps",()=>({...Ut.createDefaultProps(),extrudedHeight:30,height:0,sampleDistance:10,startColor:g.reactArray([1,1,0,1]),endColor:g.reactArray([1,0,0,1]),startTime:0,endTime:36e6,spanTime:1,progress:0,filled:!1,stroked:!1})),d(co,"type",co.register("ESSunshineAnalysis",co,{chsName:"日照分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"日照分析"})),d(co,"supportEditingModes",[...Ut.supportEditingModes,$.HeightModify]);let kf=co;const Sn=class Sn extends Dt{constructor(e){super(e);d(this,"_activateEvent",this.disposeVar(new V));d(this,"activate",!1)}get activateEvent(){return this._activateEvent}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new T([this,"zIndex"],"层级序号",Sn.defaults.zIndex),new pt([this,"renderMode"],Sn.renderModes,"渲染模式","default"),new T([this,"opacity"],"透明度",Sn.defaults.opacity)],dataSource:[...e.dataSource,new Q([this,"url"],"地形服务地址",Sn.defaults.url),new Pn([this,"rectangle"],"矩形范围",Sn.defaults.rectangle)],more:[...e.more,new T([this,"czmMinzoom"],"czmMinzoom",void 0,!0),new T([this,"czmMaxzoom"],"czmMaxzoom",void 0,!0)]}}};d(Sn,"createDefaultProps",()=>({...Dt.createDefaultProps(),url:"http://inner.earthsdk.com/layer.json",rectangle:g.reactArray([-180,-90,180,90]),zIndex:0,czmMaxzoom:void 0,czmMinzoom:void 0,renderMode:"default",opacity:1})),d(Sn,"type",Sn.register("ESTerrainLayer",Sn,{chsName:"地形图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地形图层"})),d(Sn,"renderModes",[["使用深度检测","default"],["不使用深度检测","disableDepthTest"],["透明","transparent"]]);let Vf=Sn;const wi=class wi extends Hr{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new _t([this,"color"],"文本颜色",[1,1,1,1]),new T([this,"fontSize"],"文字大小",14),new qh([this,"text"],"内容",wi.defaults.text,void 0,!0),new _t([this,"backgroundColor"],"背景颜色",wi.defaults.backgroundColor),new Pn([this,"padding"],"内边距",wi.defaults.padding),new _t([this,"borderColor"],"边界颜色"),new Pn([this,"borderRadius"],"边界圆角"),new T([this,"borderWidth"],"边界宽度")],more:[...t.more,new nt([],"czm","czm"),new W([this,"textEditingInteraction"],"文本编辑交互"),new W([this,"textEditing"],"文本编辑"),new T([this,"width"],"宽度",wi.defaults.width,!0),new T([this,"opacity"],"透明度"),new pt([this,"textAlign"],[["center","center"],["left","left"],["right","right"]],"文字位置","left"),new pt([this,"borderStyle"],[["none","none"],["hidden","hidden"],["dotted","dotted"],["dashed","dashed"],["solid","solid"],["double","double"],["groove","groove"],["ridge","ridge"],["inset","inset"],["outset","outset"]],"边框类型")]}}};d(wi,"createDefaultProps",()=>({...Hr.createDefaultProps(),text:"请输入文字",width:80,textEditing:!1,textEditingInteraction:!1,opacity:1,fontSize:14,textAlign:"left",color:g.reactArray([1,1,1,1]),backgroundColor:g.reactArray([0,0,0,.8]),padding:g.reactArray([5,5,5,5]),borderRadius:g.reactArray([6,6,6,6]),borderWidth:0,borderColor:g.reactArray([1,1,1,1]),borderStyle:"solid"})),d(wi,"type",wi.register("ESTextLabel",wi,{chsName:"文本标签",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"文本标签。"}));let va=wi;const MP=`
293
313
  #### 默认值如下
294
314
  \`\`\`js
295
315
  {
296
316
  "Title": "示例",
297
317
  "Content": "这是一个示例\\n帮助你理解info的数据形式\\nnum:1\\nkey:'value'\\n"
298
318
  }
299
- \`\`\``,qn=class qn extends fn{constructor(e){super(e);g(this,"_callFunctionEvent",this.disposeVar(new d.Event));g(this,"_callFunctionResultEvent",this.dv(new d.Event))}get __callFunctionResultEvent(){return this._callFunctionResultEvent}get callFunctionEvent(){return this._callFunctionEvent}callFunction(e,n){return new Promise(i=>{const s=new d.Destroyable,o=setTimeout(()=>{s.isDestroyed()||(s.destroy(),i(void 0))},1e4);s.d(this._callFunctionResultEvent.donce(a=>{s.isDestroyed()||(s.destroy(),i(a),clearTimeout(o))})),this._callFunctionEvent.emit(e,n)})}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new lr([this,"positionOffset"],"positionOffset",qn.defaults.positionOffset),new lr([this,"rotationOffset"],"rotationOffset",qn.defaults.rotationOffset),new _t([this,"actorTag"],"actorTag",qn.defaults.actorTag),new _t([this,"widgetClass"],"widgetClass",qn.defaults.widgetClass),new _t([this,"socketName"],"socketName",qn.defaults.socketName),new ut([this,"info"],"info",qn.defaults.info,aI,!0)],more:[...e.more,new pt(["string","string"],(n,i)=>this.callFunction(n,JSON.parse(i)),["",""],"callFunction")]}}};g(qn,"createDefaultProps",()=>({...fn.createDefaultProps(),widgetClass:"",info:d.reactJsonWithUndefined({Title:"标题示例",Content:"内容示例"})})),g(qn,"type",qn.register("ESUEWidget",qn,{chsName:"部件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"3DTileset"}));let id=qn;const Za=class Za extends ct{constructor(){super(...arguments);g(this,"_callFunctionEvent",this.dv(new d.Event));g(this,"_callFunctionResultEvent",this.dv(new d.Event));g(this,"_actorEvent",this.dv(new d.Event));g(this,"_lastActorStatus",this.dv(d.react("null")))}get __callFunctionResultEvent(){return this._callFunctionResultEvent}get callFunctionEvent(){return this._callFunctionEvent}callFunction(e,n){return new Promise(i=>{const s=new d.Destroyable,o=setTimeout(()=>{s.isDestroyed()||(s.destroy(),i(void 0))},1e4);s.d(this._callFunctionResultEvent.donce(a=>{s.isDestroyed()||(s.destroy(),i(a),clearTimeout(o))})),this._callFunctionEvent.emit(e,n)})}getBoundSphereWithChildren(e){return new Promise((n,i)=>{n(void 0)})}get actorEvent(){return this._actorEvent}get lastActorStatus(){return this._lastActorStatus.value}set lastActorStatus(e){this._lastActorStatus.value=e}get lastActorStatusChanged(){return this._lastActorStatus.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new _t([this,"actorTag"],"actorTag",""),new _t([this,"actorClass"],"actorClass",""),new $([this,"highlight"],"是否高亮",!1)],more:[...e.more,new pt(["string","string"],(n,i)=>this.callFunction(n,JSON.parse(i)),["",""],"callFunction")]}}};g(Za,"createDefaultProps",()=>({...ct.createDefaultProps(),actorTag:"",actorClass:"",highlight:!1,allowPicking:!0})),g(Za,"type",Za.register("ESUnrealActor",Za,{chsName:"UnrealActor",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"UnrealActor"}));let sd=Za;const wr=class wr extends ct{constructor(e){super(e);g(this,"editingBindMode","doublePoints");g(this,"_resetWithCameraInfoEvent",this.dv(new d.Event));this.collision=!1}get resetWithCameraInfoEvent(){return this._resetWithCameraInfoEvent}resetWithCameraInfo(){this._resetWithCameraInfoEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new $([this,"looping"],"循环",wr.defaults.looping),new $([this,"showFrustum"],"视椎体",wr.defaults.showFrustum),new L([this,"aspectRatio"],"宽高比",wr.defaults.aspectRatio),new L([this,"fov"],"横向夹角",wr.defaults.fov),new L([this,"far"],"视野长度",wr.defaults.far),new L([this,"near"],"近面距离",wr.defaults.near),new ut([this,"videoStreamUrl"],"视频路径",wr.defaults.videoStreamUrl),new L([this,"zIndex"],"显示优先级",wr.defaults.zIndex),new bt([this,"videoStreamType"],wr.videoStreamTypes,"视频类型","video")],more:[...e.more,new pt([],()=>this.resetWithCameraInfo(),[],"以当前相机状态重置")]}}};g(wr,"createDefaultProps",()=>({...ct.createDefaultProps(),fov:90,aspectRatio:1.77778,far:100,near:5,videoStreamUrl:"",zIndex:1,showFrustum:!0,looping:!0,videoStreamType:"video"})),g(wr,"type",wr.register("ESVideoFusion",wr,{chsName:"视频融合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视频融合"})),g(wr,"videoStreamTypes",[["video","video"],["hls","hls"],["flv","flv"],["img","img"],["gif","gif"]]);let od=wr;const Wn=class Wn extends ct{constructor(e){super(e);g(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new $([this,"showFrustum"],"视椎体",Wn.defaults.showFrustum),new L([this,"aspectRatio"],"宽高比",Wn.defaults.aspectRatio),new L([this,"fov"],"横向夹角",Wn.defaults.fov),new L([this,"near"],"近面距离",Wn.defaults.near),new L([this,"far"],"视野长度",Wn.defaults.far),new L([this,"zIndex"],"显示优先级",Wn.defaults.zIndex)]}}};g(Wn,"createDefaultProps",()=>({...ct.createDefaultProps(),fov:90,aspectRatio:1.77778,near:10,far:100,zIndex:1,showFrustum:!0,collision:!1})),g(Wn,"type",Wn.register("ESViewShed",Wn,{chsName:"视域分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"信号传输器"}));let ad=Wn;const uI=`
319
+ \`\`\``,Cn=class Cn extends Hr{constructor(e){super(e);d(this,"_callFunctionEvent",this.disposeVar(new V));d(this,"_callFunctionResultEvent",this.dv(new V))}get __callFunctionResultEvent(){return this._callFunctionResultEvent}get callFunctionEvent(){return this._callFunctionEvent}callFunction(e,n){return new Promise(i=>{const s=new B,o=setTimeout(()=>{s.isDestroyed()||(s.destroy(),i(void 0))},1e4);s.d(this._callFunctionResultEvent.donce(a=>{s.isDestroyed()||(s.destroy(),i(a),clearTimeout(o))})),this._callFunctionEvent.emit(e,n)})}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Je([this,"positionOffset"],"positionOffset",Cn.defaults.positionOffset),new Je([this,"rotationOffset"],"rotationOffset",Cn.defaults.rotationOffset),new ot([this,"actorTag"],"actorTag",Cn.defaults.actorTag),new ot([this,"widgetClass"],"widgetClass",Cn.defaults.widgetClass),new ot([this,"socketName"],"socketName",Cn.defaults.socketName),new Q([this,"info"],"info",Cn.defaults.info,MP,!0)],more:[...e.more,new it(["string","string"],(n,i)=>this.callFunction(n,JSON.parse(i)),["",""],"callFunction")]}}};d(Cn,"createDefaultProps",()=>({...Hr.createDefaultProps(),widgetClass:"",info:g.reactJsonWithUndefined({Title:"标题示例",Content:"内容示例"})})),d(Cn,"type",Cn.register("ESUEWidget",Cn,{chsName:"部件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"3DTileset"}));let Uf=Cn;const La=class La extends Z{constructor(){super(...arguments);d(this,"_callFunctionEvent",this.dv(new V));d(this,"_callFunctionResultEvent",this.dv(new V));d(this,"_actorEvent",this.dv(new V));d(this,"_lastActorStatus",this.dv(g.react("null")))}get __callFunctionResultEvent(){return this._callFunctionResultEvent}get callFunctionEvent(){return this._callFunctionEvent}callFunction(e,n){return new Promise(i=>{const s=new B,o=setTimeout(()=>{s.isDestroyed()||(s.destroy(),i(void 0))},1e4);s.d(this._callFunctionResultEvent.donce(a=>{s.isDestroyed()||(s.destroy(),i(a),clearTimeout(o))})),this._callFunctionEvent.emit(e,n)})}getBoundSphereWithChildren(e){return new Promise((n,i)=>{n(void 0)})}get actorEvent(){return this._actorEvent}get lastActorStatus(){return this._lastActorStatus.value}set lastActorStatus(e){this._lastActorStatus.value=e}get lastActorStatusChanged(){return this._lastActorStatus.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ot([this,"actorTag"],"actorTag",""),new ot([this,"actorClass"],"actorClass",""),new W([this,"highlight"],"是否高亮",!1)],more:[...e.more,new it(["string","string"],(n,i)=>this.callFunction(n,JSON.parse(i)),["",""],"callFunction")]}}};d(La,"createDefaultProps",()=>({...Z.createDefaultProps(),actorTag:"",actorClass:"",highlight:!1,allowPicking:!0})),d(La,"type",La.register("ESUnrealActor",La,{chsName:"UnrealActor",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"UnrealActor"}));let zf=La;const or=class or extends Z{constructor(e){super(e);d(this,"editingBindMode","doublePoints");d(this,"_resetWithCameraInfoEvent",this.dv(new V));this.collision=!1}get resetWithCameraInfoEvent(){return this._resetWithCameraInfoEvent}resetWithCameraInfo(){this._resetWithCameraInfoEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new W([this,"looping"],"循环",or.defaults.looping),new W([this,"showFrustum"],"视椎体",or.defaults.showFrustum),new T([this,"aspectRatio"],"宽高比",or.defaults.aspectRatio),new T([this,"fov"],"横向夹角",or.defaults.fov),new T([this,"far"],"视野长度",or.defaults.far),new T([this,"near"],"近面距离",or.defaults.near),new Q([this,"videoStreamUrl"],"视频路径",or.defaults.videoStreamUrl),new T([this,"zIndex"],"显示优先级",or.defaults.zIndex),new pt([this,"videoStreamType"],or.videoStreamTypes,"视频类型","video")],more:[...e.more,new it([],()=>this.resetWithCameraInfo(),[],"以当前相机状态重置")]}}};d(or,"createDefaultProps",()=>({...Z.createDefaultProps(),fov:90,aspectRatio:1.77778,far:100,near:5,videoStreamUrl:"",zIndex:1,showFrustum:!0,looping:!0,videoStreamType:"video"})),d(or,"type",or.register("ESVideoFusion",or,{chsName:"视频融合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视频融合"})),d(or,"videoStreamTypes",[["video","video"],["hls","hls"],["flv","flv"],["img","img"],["gif","gif"]]);let Gf=or;const In=class In extends Z{constructor(e){super(e);d(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new W([this,"showFrustum"],"视椎体",In.defaults.showFrustum),new T([this,"aspectRatio"],"宽高比",In.defaults.aspectRatio),new T([this,"fov"],"横向夹角",In.defaults.fov),new T([this,"near"],"近面距离",In.defaults.near),new T([this,"far"],"视野长度",In.defaults.far),new T([this,"zIndex"],"显示优先级",In.defaults.zIndex)]}}};d(In,"createDefaultProps",()=>({...Z.createDefaultProps(),fov:90,aspectRatio:1.77778,near:10,far:100,zIndex:1,showFrustum:!0,collision:!1})),d(In,"type",In.register("ESViewShed",In,{chsName:"视域分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"信号传输器"}));let qf=In;const bP=`
300
320
  #### 默认值如下
301
321
  \`\`\`js
302
322
  {
@@ -304,7 +324,7 @@ export type ESJTimeIntervalCollectionJsonType = {
304
324
  "Key":"Value",
305
325
  "内容": "这是一个示例\\n帮助你理解info的数据形式\\nnum:1\\nkey:'value'\\n"
306
326
  }
307
- \`\`\``,Qs=class Qs extends fn{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ut([this,"info"],"信息",Qs.defaults.info,uI,!0)],more:[...t.more,new gt([],"通用","通用"),new gt([],"ue","ue"),new Jo([this,"positionOffset"],"坐标偏移"),new Jo([this,"rotationOffset"],"旋转偏移"),new _t([this,"actorTag"]),new _t([this,"widgetClass"]),new _t([this,"socketName"]),new gt([],"czm","czm"),new L([this,"opacity"],"透明度",Qs.defaults.opacity,!0)]}}};g(Qs,"createDefaultProps",()=>({...fn.createDefaultProps(),info:d.reactJson({title:"标题示例",内容:"内容示例"}),widgetClass:"WidgetBlueprint'/EarthSDKForUE/Widget/WBP_ES_DefaultInfo.WBP_ES_DefaultInfo'",actorTag:"",socketName:"",positionOffset:d.reactArray([0,0,0]),rotationOffset:d.reactArray([0,0,0]),opacity:1})),g(Qs,"type",Qs.register("ESWidget",Qs,{chsName:"部件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ES组件"}));let ud=Qs;const Go=class Go extends Dt{constructor(e){super(e);g(this,"_direction",this.disposeVar(d.react(0)));g(this,"editingBindMode","doublePoints");{const n=()=>{this.direction=this.points&&this.points.length>=2?La(Eh(this.points[0],this.points[1])):0};n(),this.ad(this.pointsChanged.don(n))}}get direction(){return this._direction.value}set direction(e){this._direction.value=e}get directionChanged(){return this._direction.changed}};g(Go,"createDefaultProps",()=>({...Dt.createDefaultProps(),stroked:!0,strokeStyle:d.reactJson({width:10,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),g(Go,"type",Go.register("ESDirectionMeasurement",Go,{chsName:"方位角测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"方位角测量"})),g(Go,"supportEditingModes",[...Dt.supportEditingModes,lt.Rotation,lt.Scale,lt.DoublePointsAppend,lt.DoublePointsModify]);let ld=Go;const Jv=`// dataSource
327
+ \`\`\``,Is=class Is extends Hr{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Q([this,"info"],"信息",Is.defaults.info,bP,!0)],more:[...t.more,new nt([],"通用","通用"),new nt([],"ue","ue"),new Io([this,"positionOffset"],"坐标偏移"),new Io([this,"rotationOffset"],"旋转偏移"),new ot([this,"actorTag"]),new ot([this,"widgetClass"]),new ot([this,"socketName"]),new nt([],"czm","czm"),new T([this,"opacity"],"透明度",Is.defaults.opacity,!0)]}}};d(Is,"createDefaultProps",()=>({...Hr.createDefaultProps(),info:g.reactJson({title:"标题示例",内容:"内容示例"}),widgetClass:"WidgetBlueprint'/EarthSDKForUE/Widget/WBP_ES_DefaultInfo.WBP_ES_DefaultInfo'",actorTag:"",socketName:"",positionOffset:g.reactArray([0,0,0]),rotationOffset:g.reactArray([0,0,0]),opacity:1})),d(Is,"type",Is.register("ESWidget",Is,{chsName:"部件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ES组件"}));let Wf=Is;const fo=class fo extends yt{constructor(e){super(e);d(this,"_direction",this.disposeVar(g.react(0)));d(this,"editingBindMode","doublePoints");{const n=()=>{this.direction=this.points&&this.points.length>=2?Po(Qu(this.points[0],this.points[1])):0};n(),this.ad(this.pointsChanged.don(n))}}get direction(){return this._direction.value}set direction(e){this._direction.value=e}get directionChanged(){return this._direction.changed}};d(fo,"createDefaultProps",()=>({...yt.createDefaultProps(),stroked:!0,strokeStyle:g.reactJson({width:10,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(fo,"type",fo.register("ESDirectionMeasurement",fo,{chsName:"方位角测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"方位角测量"})),d(fo,"supportEditingModes",[...yt.supportEditingModes,$.Rotation,$.Scale,$.DoublePointsAppend,$.DoublePointsModify]);let Xf=fo;const Gv=`// dataSource
308
328
  (dataSource) => {
309
329
  if (dataSource) {
310
330
  dataSource.show = true;
@@ -330,11 +350,11 @@ export type ESJTimeIntervalCollectionJsonType = {
330
350
  }
331
351
  }
332
352
  }
333
- `,lI=`示例代码
353
+ `,xP=`示例代码
334
354
  \`\`\`
335
- ${Jv}
355
+ ${Gv}
336
356
  \`\`\`
337
- `;function Bv(r){try{return JSON.parse(r),!0}catch{return!1}}const hI="${earthsdk3-assets-script-dir}/assets/misc/2.geojson",zt=class zt extends ee{constructor(e){super(e);g(this,"_flyToFeatureEvent",this.dv(new d.Event));g(this,"_flyToFeatureIndexEvent",this.dv(new d.Event));g(this,"_features",this.disposeVar(d.reactJsonWithUndefined(void 0)));g(this,"pickedInfoType","FeatureCollection");this._updateUrl(),this.ad(this.urlChanged.don(()=>{this._updateUrl()})),this.ad(this.editingChanged.don(()=>{console.warn("ESGeoJson暂不支持编辑!")}))}get flyToFeatureEvent(){return this._flyToFeatureEvent}flyToFeature(e,n,i){this._flyToFeatureEvent.emit(e,n,i)}get flyToFeatureIndexEvent(){return this._flyToFeatureIndexEvent}flyToFeatureIndex(e,n){this._flyToFeatureIndexEvent.emit(e,n)}get features(){return this._features.value}set features(e){this._features.value=e}get featuresChanged(){return this._features.changed}getFeatures(){if(this.features)return this.features;console.log("数据未加载完成,请稍后调用此方法getFeatures()")}async _updateUrl(){var e;if(!this.url){this.features=void 0;return}typeof this.url=="object"?this.features=this.url:Bv(this.url)?this.features=JSON.parse(this.url):await fetch(ht.context.getStrFromEnv(this.url)).then(n=>n.json()).then(n=>{this.features=n}).catch(n=>{console.warn("ESEntityCluster数据加载失败",n)}),this.pickedInfoType=((e=this.features)==null?void 0:e.type)??"FeatureCollection"}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",dataSource:[...e.dataSource,new ut([this,"url"],"服务地址",zt.defaults.url),new L([this,"minFeatureVisibleDistance"],"要素最小可视距离",zt.defaults.minFeatureVisibleDistance),new L([this,"maxFeatureVisibleDistance"],"要素最大可视距离",zt.defaults.maxFeatureVisibleDistance),new bt([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考")],style:[...e.style,new gt([],"点样式集合"),new $([this,"textShow"],"是否显示",zt.defaults.textShow),new Ve([this,"textAnchor"],"锚点",zt.defaults.anchor),new _t([this,"textProperty"],"标注显示属性",zt.defaults.textStyle.textProperty),new _t([this,"textDefaultText"],"默认文本",zt.defaults.textStyle.defaultText),new Rt([this,"textColor"],"文本颜色",zt.defaults.textStyle.color),new Rt([this,"textBackgroundColor"],"文本背景颜色",zt.defaults.textStyle.backgroundColor),new _t([this,"textFontStyle"],"字体样式",zt.defaults.textStyle.fontStyle),new _t([this,"textFontWeight"],"字体粗细",zt.defaults.textStyle.fontWeight),new L([this,"textFontSize"],"字体大小",zt.defaults.textStyle.fontSize),new Ve([this,"textOffset"],"像素偏移",zt.defaults.textStyle.offset),new gt([],"点图片样式集合"),new $([this,"imageShow"],"是否显示",zt.defaults.imageShow),new Ve([this,"imageAnchor"],"锚点",zt.defaults.imageStyle.anchor),new ut([this,"imageUrl"],"图片地址",zt.defaults.imageStyle.url),new Ve([this,"imageSize"],"图片大小",zt.defaults.imageStyle.size),new Ve([this,"imageOffset"],"像素偏移",zt.defaults.imageStyle.offset),new gt([],"线样式集合"),new $([this,"stroked"],"是否显示",zt.defaults.stroked),new $([this,"strokeGround"],"贴地",zt.defaults.strokeStyle.ground),new L([this,"strokeWidth"],"线宽",zt.defaults.strokeStyle.width),new bt([this,"strokeWidthType"],zt.defaults.strokeStyle.widthTypes,"线宽类型"),new Rt([this,"strokeColor"],"线颜色",zt.defaults.strokeStyle.color),new _t([this,"strokeMaterial"],"线材质",zt.defaults.strokeStyle.material),new ut([this,"strokeMaterialParams"],"线材质参数",zt.defaults.strokeStyle.materialParams),new gt([],"面样式集合"),new $([this,"filled"],"是否显示",zt.defaults.filled),new $([this,"fillGround"],"贴地",zt.defaults.fillStyle.ground),new Rt([this,"fillColor"],"填充颜色",zt.defaults.fillStyle.color),new _t([this,"fillMaterial"],"填充材质",zt.defaults.fillStyle.material),new ut([this,"fillMaterialParams"],"填充材质参数",zt.defaults.fillStyle.materialParams)],more:[...e.more,new gt([],"标注文本样式"),new _t([this,"textFontFamily"],"字体",zt.defaults.textStyle.fontFamily),new gt([],"通用"),new _s([this,"loadFuncStr"],"loadFnStr",Jv,lI,!0)]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(e){this.strokeStyle={...this.strokeStyle,width:e}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(e){this.strokeStyle={...this.strokeStyle,widthType:e}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(e){this.strokeStyle={...this.strokeStyle,color:[...e]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(e){this.strokeStyle={...this.strokeStyle,material:e}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(e){this.strokeStyle={...this.strokeStyle,materialParams:e}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(e){this.strokeStyle={...this.strokeStyle,ground:e}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(e){this.fillStyle={...this.fillStyle,color:[...e]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(e){this.fillStyle={...this.fillStyle,material:e}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(e){this.fillStyle={...this.fillStyle,materialParams:e}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(e){this.fillStyle={...this.fillStyle,ground:e}}get fillGroundChanged(){return this.fillStyleChanged}get textProperty(){return this.textStyle.textProperty}set textProperty(e){this.textStyle={...this.textStyle,textProperty:e}}get textPropertyChanged(){return this.textStyleChanged}get textDefaultText(){return this.textStyle.defaultText}set textDefaultText(e){this.textStyle={...this.textStyle,defaultText:e}}get textDefaultTextChanged(){return this.textStyleChanged}get textColor(){return this.textStyle.color}set textColor(e){this.textStyle={...this.textStyle,color:e}}get textColorChanged(){return this.textStyleChanged}get textBackgroundColor(){return this.textStyle.backgroundColor}set textBackgroundColor(e){this.textStyle={...this.textStyle,backgroundColor:e}}get textBackgroundColorChanged(){return this.textStyleChanged}get textFontFamily(){return this.textStyle.fontFamily}set textFontFamily(e){this.textStyle={...this.textStyle,fontFamily:e}}get textFontFamilyChanged(){return this.textStyleChanged}get textFontStyle(){return this.textStyle.fontStyle}set textFontStyle(e){this.textStyle={...this.textStyle,fontStyle:e}}get textFontStyleChanged(){return this.textStyleChanged}get textFontWeight(){return this.textStyle.fontWeight}set textFontWeight(e){this.textStyle={...this.textStyle,fontWeight:e}}get textFontWeightChanged(){return this.textStyleChanged}get textFontSize(){return this.textStyle.fontSize}set textFontSize(e){this.textStyle={...this.textStyle,fontSize:e}}get textFontSizeChanged(){return this.textStyleChanged}get textAnchor(){return this.textStyle.anchor}set textAnchor(e){this.textStyle={...this.textStyle,anchor:e}}get textAnchorChanged(){return this.textStyleChanged}get textOffset(){return this.textStyle.offset}set textOffset(e){this.textStyle={...this.textStyle,offset:e}}get textOffsetChanged(){return this.textStyleChanged}get imageUrl(){return this.imageStyle.url}set imageUrl(e){this.imageStyle={...this.imageStyle,url:e}}get imageUrlChanged(){return this.imageStyleChanged}get imageSize(){return this.imageStyle.size}set imageSize(e){this.imageStyle={...this.imageStyle,size:e}}get imageSizeChanged(){return this.imageStyleChanged}get imageAnchor(){return this.imageStyle.anchor}set imageAnchor(e){this.imageStyle={...this.imageStyle,anchor:e}}get imageAnchorChanged(){return this.imageStyleChanged}get imageOffset(){return this.imageStyle.offset}set imageOffset(e){this.imageStyle={...this.imageStyle,offset:e}}get imageOffsetChanged(){return this.imageStyleChanged}};g(zt,"createDefaultProps",()=>({...ee.createDefaultProps(),show:!0,allowPicking:!0,loadFuncStr:void 0,url:hI,stroked:!0,strokeStyle:d.reactJson({width:1,widthType:"world",color:[.79,.91,.06,1],material:"",materialParams:{},ground:!1}),filled:!0,fillStyle:d.reactJson({color:[.79,.91,.06,.2],material:"",materialParams:{},ground:!1}),imageShow:!0,imageStyle:d.reactJson({url:"${earthsdk3-assets-script-dir}/assets/img/location.png",size:[32,32],anchor:[.5,1],offset:[0,0]}),textShow:!0,textStyle:d.reactJson({textProperty:"",defaultText:"默认标注",color:[1,1,1,1],backgroundColor:void 0,fontFamily:"Arial",fontSize:16,fontStyle:"normal",fontWeight:"normal",anchor:[0,1],offset:[16,-8]}),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE"})),g(zt,"type",zt.register("ESGeoJson",zt,{chsName:"ESGeoJson",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"GeoJson数据加载"}));let hd=zt;const ko=class ko extends Dt{constructor(e){super(e);g(this,"editingBindMode","doublePoints");g(this,"_height",this.disposeVar(d.react(0)));{const n=()=>{this.height=this.points&&this.points.length>=2?this.points[1][2]-this.points[0][2]:0};n(),this.ad(this.pointsChanged.don(n))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}};g(ko,"createDefaultProps",()=>({...Dt.createDefaultProps(),stroked:!0,strokeStyle:d.reactJson({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),g(ko,"type",ko.register("ESHeightMeasurement",ko,{chsName:"高度测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"高度测量"})),g(ko,"supportEditingModes",[...Dt.supportEditingModes,lt.DoublePointsAppend,lt.DoublePointsModify]);let cd=ko;const $a=class $a extends cs{constructor(e){super(e);g(this,"_area",this.dv(d.react(0)));g(this,"_perimeter",this.dv(d.react(0)));g(this,"editingBindMode","doublePoints");const n=()=>{this._area.value=Math.PI*this.radius*this.radius,this._perimeter.value=2*Math.PI*this.radius};n(),this.d(this.radiusChanged.don(n))}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}toPolygon(e=10,n){return I0([...this.position],this.radius,e,n)[0].map(s=>[...s,this.position?this.position[2]:0])}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",basic:[...e.basic,new L([this,"radius"],"圆半径",1,!0)],coordinate:[...e.coordinate,new $([this,"editing"],"是否编辑"),new Jo([this,"position"],"三维坐标",[0,0,0],!0),new L([this,"area"],"面积",0,!1,!0),new L([this,"perimeter"],"周长",0,!1,!0)]}}};g($a,"createDefaultProps",()=>({...cs.createDefaultProps(),radius:1,filled:!0,collision:!1,fillStyle:d.reactJson({color:[1,1,1,.5],material:"",materialParams:{},ground:!1})})),g($a,"type",$a.register("ESLocalCircle",$a,{chsName:"局部坐标圆形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalCircle"}));let fd=$a;const ja=class ja extends cs{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new hg([this,"points"],"坐标",[])]}}};g(ja,"createDefaultProps",()=>({...cs.createDefaultProps(),points:sc([]),filled:!0})),g(ja,"type",ja.register("ESLocalPolygon",ja,{chsName:"局部2D坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygon"}));let vl=ja;const tu=class tu extends Fa{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new rc([this,"points"],"本地位置数组")]}}};g(tu,"createDefaultProps",()=>({...Fa.createDefaultProps(),points:d.reactPositions(void 0),filled:!0})),g(tu,"type",tu.register("ESLocalPolygonZ",tu,{chsName:"局部坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygonZ"}));let dd=tu;const eu=class eu extends cs{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new L([this,"width"],"宽度"),new L([this,"height"],"高度")]}}};g(eu,"createDefaultProps",()=>({...cs.createDefaultProps(),width:5e5,height:3e5,filled:!0})),g(eu,"type",eu.register("ESLocalRectangle",eu,{chsName:"局部坐标四边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalRectangle"}));let gd=eu;const ds=class ds extends Dt{constructor(e){super(e);g(this,"editingBindMode","lineString");g(this,"_distance",this.dv(d.react(0)));g(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);g(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());const n=()=>{if(this.points&&this.points.length>=2){const i=cl(this.points,"GEODESIC"),s=i[i.length-1];this._distance.value=s}else this._distance.value=0};n(),this.d(this.pointsChanged.don(n))}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new L([this,"height"],"高度",10),new L([this,"width"],"宽度",10),new bt([this,"materialMode"],ds.materialModes,"模式","purple")],coordinate:[...e.coordinate,new L([this,"distance"],"距离",0,!1,!0)]}}};g(ds,"createDefaultProps",()=>({...Dt.createDefaultProps(),height:10,width:10,materialMode:"singleArrow",filled:!0,stroked:!0,fillStyle:d.reactJson({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),g(ds,"type",ds.register("ESPipeFence",ds,{chsName:"管道电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"管道电子围栏"})),g(ds,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"]]),g(ds,"supportEditingModes",[...Dt.supportEditingModes,lt.LineStringAppend,lt.LineStringInsert]);let pd=ds;const gs=class gs extends Fn{constructor(e){super(e);g(this,"_setLayerVisibleEvent",this.dv(new d.Event));g(this,"_setLayerColorEvent",this.dv(new d.Event))}get setLayerVisibleEvent(){return this._setLayerVisibleEvent}setLayerVisible(e,n){this._setLayerVisibleEvent.emit(e,n)}get setLayerColorEvent(){return this._setLayerColorEvent}setLayerColor(e,n){this._setLayerColorEvent.emit(e,n)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new gt([],"ESPipeserTileset"),new pt(["string","string"],(n,i)=>this.setLayerVisible(n,i),["",""],"setLayerVisible"),new pt(["string","string"],(n,i)=>this.setLayerColor(n,i),["",""],"setLayerColor"),new bt([this,"colorMode"],gs.colorModes,"colorMode",gs.defaults.colorMode,!0)]}}};g(gs,"createDefaultProps",()=>({...Fn.createDefaultProps(),colorMode:"default"})),g(gs,"type",gs.register("ESPipeserTileset",gs,{chsName:"PipeSer图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"PipeSer图层"})),g(gs,"colorModes",[["default","default"],["color","color"],["blend","blend"]]);let vd=gs;const ps=class ps extends Dt{constructor(e){super(e);g(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",coordinate:[...e.coordinate,new L([this,"area"],"面积",0,!1,!0),new L([this,"perimeter"],"周长",0,!1,!0)],basic:[...e.basic,new L([this,"height"],"高度",10),new bt([this,"materialMode"],ps.materialModes,"模式","danger")]}}};g(ps,"createDefaultProps",()=>({...Dt.createDefaultProps(),height:10,materialMode:"danger",filled:!0,collision:!1})),g(ps,"type",ps.register("ESPolygonFence",ps,{chsName:"多边形电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"多边形电子围栏"})),g(ps,"materialModes",[["模式一","danger"],["模式二","checkerboard"],["模式三","warning"],["模式四","cord"],["模式五","scanline"],["模式六","honeycomb"],["模式七","gradientColor"]]),g(ps,"supportEditingModes",[...Dt.supportEditingModes,lt.CircularAppend,lt.CircularInsert,lt.HeightModify]);let md=ps;const Ks=class Ks extends Dt{constructor(e){super(e);g(this,"_deprecated",["ground"]);g(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());g(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new gt([],"通用","通用"),new $([this,"ground"],"是否贴地"),new $([this,"outlineTranslucent"],"轮廓线半透明"),new L([this,"height"],"高度"),new L([this,"extrudedHeight"],"拉伸高度"),new Hn([this,"rectangle"],"范围",Ks.defaults.rectangle,!0),new L([this,"stRotation"],"纹理旋转角度"),new L([this,"rotation"],"旋转角度"),new $([this,"pointEditing"],"是否单点编辑")]}}};g(Ks,"createDefaultProps",()=>({...Dt.createDefaultProps(),ground:!1,outlineTranslucent:!0,height:0,extrudedHeight:0,rectangle:d.reactArrayWithUndefined(void 0),rotation:0,stRotation:0,pointEditing:!1,filled:!0})),g(Ks,"type",Ks.register("ESRectangle",Ks,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"矩形"})),g(Ks,"supportEditingModes",[...Dt.supportEditingModes,lt.DoublePointsAppend,lt.DoublePointsModify]);let yd=Ks;const ru=class ru extends ie{getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ut([this,"innerRings"],"裁切多边形数组",[],void 0,!0)]}}};g(ru,"createDefaultProps",()=>({...ie.createDefaultProps(),innerRings:d.reactPositionsSet([])})),g(ru,"type",ru.register("ESPolygonWithHole",ru,{chsName:"内部裁切多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"带洞多边形"}));let _d=ru;const Zs=class Zs extends ie{constructor(e){super(e);g(this,"_startEvent",this.disposeVar(new d.Event));g(this,"_stopEvent",this.dv(new d.Event));g(this,"_surfaceArea",this.disposeVar(d.react(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get surfaceArea(){return this._surfaceArea.value}set surfaceArea(e){this._surfaceArea.value=e}get surfaceChanged(){return this._surfaceArea.changed}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new gt([],"表面积测量","表面积测量"),new pt([],()=>this.start(),[],"开始计算"),new L([this,"interpolation"],"插值距离",Zs.defaults.interpolation),new L([this,"offsetHeight"],"偏移高度",Zs.defaults.offsetHeight)]}}};g(Zs,"createDefaultProps",()=>({...ie.createDefaultProps(),interpolation:.5,offsetHeight:0,units:d.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"]),fillStyle:d.reactJson({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),g(Zs,"type",Zs.register("ESSurfaceAreaMeasurement",Zs,{chsName:"表面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"表面积测量"}));let Ed=Zs;const $s=class $s extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new L([this,"downloadProgress"],"下载进度",$s.defaults.downloadProgress,!0,!0),new ut([this,"importOptions"],"导入参数",$s.defaults.importOptions,void 0,!0)],dataSource:[...t.dataSource,new ut([this,"url"],"路径")]}}};g($s,"createDefaultProps",()=>({...ct.createDefaultProps(),url:"",importOptions:d.reactJsonWithUndefined({buildCollisions:"QueryAndPhysics",buildHierarchy:"Simplified",collisionType:"CTF_UseComplexAsSimple",bImportMetaData:!0}),downloadProgress:0})),g($s,"type",$s.register("ESDatasmithRuntimeModel",$s,{chsName:"Datasmith Model",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Datasmith Model"}));let wd=$s;const Sr=class Sr extends vl{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new bt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",Sr.defaults.waterType),new L([this,"frequency"],"频率",Sr.defaults.frequency),new Xe([this,"amplitude"],.01,[0,1],"振幅",Sr.defaults.amplitude),new Xe([this,"flowDirection"],1,[0,360],"流向",Sr.defaults.flowDirection),new Xe([this,"waveVelocity"],.01,[0,1],"波动频率",Sr.defaults.waveVelocity),new Xe([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Sr.defaults.specularIntensity),new Xe([this,"murkiness"],.1,[0,10],"水体浑浊度",Sr.defaults.murkiness),new L([this,"flowSpeed"],"水流速度",Sr.defaults.flowSpeed),new Rt([this,"waterColor"],"水的底色",Sr.defaults.waterColor),new ut([this,"waterImage"],"水的图片",Sr.defaults.waterImage)]}}};g(Sr,"createDefaultProps",()=>({...vl.createDefaultProps(),allowPicking:!0,waterImage:d.reactJsonWithUndefined(void 0),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5,stroked:!1,filled:!0})),g(Sr,"type",Sr.register("ESDynamicWater",Sr,{chsName:"动态水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"局部多边形水面"}));let Sd=Sr;const Cr=class Cr extends ie{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new bt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",Cr.defaults.waterType),new L([this,"frequency"],"频率",Cr.defaults.frequency),new Xe([this,"amplitude"],.01,[0,1],"振幅",Cr.defaults.amplitude),new Xe([this,"flowDirection"],1,[0,360],"流向",Cr.defaults.flowDirection),new Xe([this,"waveVelocity"],.01,[0,1],"波动频率",Cr.defaults.waveVelocity),new Xe([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Cr.defaults.specularIntensity),new Xe([this,"murkiness"],.1,[0,10],"水体浑浊度",Cr.defaults.murkiness),new L([this,"flowSpeed"],"水流速度",Cr.defaults.flowSpeed),new Rt([this,"waterColor"],"水的底色",Cr.defaults.waterColor),new ut([this,"waterImage"],"水的图片",Cr.defaults.waterImage)]}}};g(Cr,"createDefaultProps",()=>({...ie.createDefaultProps(),allowPicking:!0,waterImage:d.reactJsonWithUndefined({}),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5})),g(Cr,"type",Cr.register("ESGeoWater",Cr,{chsName:"地理水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地理动态水面"}));let Cd=Cr;const Vo=class Vo extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new L([this,"downloadProgress"],"下载进度",Vo.defaults.downloadProgress,!0,!0),new _t([this,"levelName"],"levelName",""),new L([this,"levelLoadDistance"],"levelLoadDistance",1e3),new lr([this,"levelOffset"],"levelOffset",[0,0,0])],dataSource:[...t.dataSource,new ut([this,"url"],"url","")]}}};g(Vo,"createDefaultProps",()=>({...ct.createDefaultProps(),url:"",downloadProgress:0,levelName:"",levelOffset:d.reactArray([0,0,0]),levelLoadDistance:1e3})),g(Vo,"type",Vo.register("ESLevelRuntimeModel",Vo,{chsName:"关卡包模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"关卡包模型"}));let Pd=Vo;const dn=class dn extends Xs{constructor(e){super(e);g(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);g(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})())}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new L([this,"radius"],"半径",dn.defaults.radius),new L([this,"sides"],"圆边数",dn.defaults.sides),new L([this,"speed"],"材质速度",dn.defaults.speed),new bt([this,"materialMode"],dn.materialModes,"材质模式",dn.defaults.materialMode),new ut([this,"materialImage"],"材质图片和重复度",dn.defaults.materialImage)]}}};g(dn,"createDefaultProps",()=>({...Xs.createDefaultProps(),radius:10,sides:10,materialMode:"singleArrow",materialImage:d.reactJson({url:"",uDis:50,vDis:10}),speed:1,filled:!0,stroked:!1,fillStyle:d.reactJson({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),g(dn,"type",dn.register("ESPipeline",dn,{chsName:"管线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPipeline"})),g(dn,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"]]);let Id=dn;const Wi=class Wi extends Dt{constructor(e){super(e);g(this,"editingBindMode","visibility")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Rt([this,"visibleColor"],"可视区域颜色",Wi.defaults.visibleColor),new Rt([this,"invisibleColor"],"遮挡区域颜色",Wi.defaults.invisibleColor),new L([this,"heightOffset"],"视点高度偏移",Wi.defaults.heightOffset)]}}};g(Wi,"createDefaultProps",()=>({...Dt.createDefaultProps(),visibleColor:d.reactArray([0,1,0,1]),invisibleColor:d.reactArray([1,0,0,1]),heightOffset:0})),g(Wi,"type",Wi.register("ESVisibilityAnalysis",Wi,{chsName:"通视分析,视线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"通视分析,视线分析"})),g(Wi,"supportEditingModes",[...Dt.supportEditingModes,lt.VisibilityAppend,lt.VisibilityModify]);let Md=Wi;const nu=class nu extends ie{constructor(e){super(e);g(this,"_startEvent",this.dv(new d.Event));g(this,"_clearEvent",this.dv(new d.Event));g(this,"_volume",this.disposeVar(d.react(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get volume(){return this._volume.value}set volume(e){this._volume.value=e}get volumeChanged(){return this._volume.changed}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new gt([],"通用","通用"),new L([this,"planeHeight"],"基准面高程",void 0,!0),new L([this,"gridWidth"],"采样间距 m"),new L([this,"cutVolume"],"挖方",0,!1,!0),new L([this,"fillVolume"],"填方",0,!1,!0),new L([this,"cutAndFillVolume"],"挖填方",0,!1,!0),new L([this,"progress"],"计算进度",0,!1,!0),new pt([],()=>this.start(),[],"开始分析"),new pt([],()=>this.clear(),[],"清空分析结果"),new $([this,"depthTest"],"是否开启深度检测")]}}};g(nu,"createDefaultProps",()=>({...ie.createDefaultProps(),planeHeight:d.react(void 0),gridWidth:1,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,filled:!1,stroked:!0,strokeStyle:d.reactJson({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),g(nu,"type",nu.register("ESVolumeMeasurement",nu,{chsName:"体积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"体积测量"}));let Nd=nu;const iu=class iu extends Ga{constructor(e){super(e);g(this,"_human",this.dv(new Ga));g(this,"_poi",this.dv(new pl));this.mainClass=this._human,this.d(this.components.disposableAdd(this._human)),this.d(this.components.disposableAdd(this._poi));{const{_human:n,_poi:i}=this;this.d(d.track([n,"show"],[this,"show"])),this.d(d.track([i,"show"],[this,"show"])),this.d(d.track([n,"allowPicking"],[this,"allowPicking"])),this.d(d.track([i,"allowPicking"],[this,"allowPicking"])),this.d(d.bind([n,"scale"],[this,"scale"])),this.d(d.bind([i,"scale"],[this,"scale"])),this.d(d.track([n,"collision"],[this,"collision"])),this.d(d.track([i,"collision"],[this,"collision"])),this.d(d.bind([n,"flyInParam"],[this,"flyInParam"])),this.d(d.bind([n,"flyToParam"],[this,"flyToParam"])),this.d(d.track([n,"animation"],[this,"animation"])),this.d(d.track([n,"mode"],[this,"mode"])),this.d(d.track([n,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(d.track([n,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(d.track([i,"name"],[this,"name"])),this.d(d.track([i,"mode"],[this,"poiMode"])),this.d(d.track([i,"autoAnchor"],[this,"autoAnchor"])),this.d(d.track([i,"screenRender"],[this,"screenRender"])),this.d(d.track([i,"size"],[this,"size"])),this.d(d.track([i,"anchor"],[this,"anchor"])),this.d(d.track([i,"sizeByContent"],[this,"sizeByContent"])),this.d(d.track([i,"renderMode"],[this,"renderMode"])),this.d(d.track([i,"rotationType"],[this,"rotationType"])),this.d(d.track([i,"zOrder"],[this,"zOrder"])),this.d(d.track([i,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(d.track([i,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(d.bind([n,"position"],[this,"position"])),this.d(d.bind([n,"rotation"],[this,"rotation"])),this.d(this.flyInEvent.don(s=>{n.flyIn(s)})),this.d(this.flyToEvent.don(s=>{n.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{n.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{n.calcFlyInParam()})),this.d(this.smoothMoveEvent.don((s,o)=>{n.smoothMove(s,o)})),this.d(this.smoothMoveWithRotationEvent.don((s,o,a)=>{n.smoothMoveWithRotation(s,o,a)})),this.d(this.smoothMoveOnGroundEvent.don((s,o,a,u)=>{n.smoothMoveOnGround(s,o,a,u)})),this.d(this.smoothMoveWithRotationOnGroundEvent.don((s,o,a,u,l)=>{n.smoothMoveWithRotationOnGround(s,o,a,u,l)})),this.d(this.automaticLandingEvent.don(()=>{n.automaticLanding()}))}}get human(){return this._human}get poi(){return this._poi}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new bt([this,"poiMode"],pl.modes,"poi模式","SquareH01"),new L([this,"poiOffsetHeight"],"poi高度偏移",1.8)]}}};g(iu,"createDefaultProps",()=>({poiOffsetHeight:1.8,poiMode:"SquareH01",style:d.reactJson({}),autoAnchor:!0,screenRender:!0,size:d.reactArray([100,100]),anchor:d.reactArray([.5,1]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,...Ga.createDefaultProps()})),g(iu,"type",iu.register("ESHumanPoi",iu,{chsName:"人员poi",tags:["ESObjects"],description:"ESHuman + ESPoi2D组合对象"}));let bd=iu;const mi=class mi extends ie{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new L([this,"depth"],"深度",mi.defaults.depth),new L([this,"interpolation"],"插值",mi.defaults.interpolation),new L([this,"opacity"],"透明度",mi.defaults.opacity),new ut([this,"sideImage"],"侧面图片",mi.defaults.sideImage),new ut([this,"bottomImage"],"底面图片",mi.defaults.bottomImage)]}}};g(mi,"createDefaultProps",()=>({...ie.createDefaultProps(),depth:100,sideImage:d.reactJson({url:ht.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/side.jpg"),uDis:50,vDis:50}),bottomImage:d.reactJson({url:ht.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/bottom.jpg"),uDis:50,vDis:50}),opacity:1,interpolation:50,collision:!1,allowPicking:!1,filled:!0})),g(mi,"type",mi.register("ESPit",mi,{chsName:"坑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"坑"}));let ka=mi;const su=class su extends ka{constructor(e){super(e);g(this,"_excavate",this.dv(new gl));g(this,"_pit",this.dv(new ka));this.mainClass=this._pit,this.d(this.components.disposableAdd(this._excavate)),this.d(this.components.disposableAdd(this._pit));{const{_excavate:n,_pit:i}=this;this.d(d.track([n,"show"],[this,"show"])),this.d(d.track([i,"show"],[this,"show"])),this.d(d.track([n,"allowPicking"],[this,"allowPicking"])),this.d(d.track([i,"allowPicking"],[this,"allowPicking"])),this.d(d.track([n,"collision"],[this,"collision"])),this.d(d.track([i,"collision"],[this,"collision"])),this.d(d.bind([i,"points"],[this,"points"])),this.d(d.track([n,"points"],[this,"points"])),this.d(d.track([i,"pointed"],[this,"pointed"])),this.d(d.track([n,"pointed"],[this,"pointed"])),this.d(d.track([i,"pointStyle"],[this,"pointStyle"])),this.d(d.track([n,"pointStyle"],[this,"pointStyle"])),this.d(d.track([i,"stroked"],[this,"stroked"])),this.d(d.track([n,"stroked"],[this,"stroked"])),this.d(d.track([i,"strokeStyle"],[this,"strokeStyle"])),this.d(d.track([n,"strokeStyle"],[this,"strokeStyle"])),this.d(d.track([i,"filled"],[this,"filled"])),this.d(d.track([i,"fillStyle"],[this,"fillStyle"])),this.d(d.track([n,"fillStyle"],[this,"fillStyle"])),this.d(d.track([n,"mode"],[this,"mode"])),this.d(d.track([n,"targetID"],[this,"targetID"])),this.d(d.track([i,"depth"],[this,"depth"])),this.d(d.track([i,"sideImage"],[this,"sideImage"])),this.d(d.track([i,"bottomImage"],[this,"bottomImage"])),this.d(d.track([i,"opacity"],[this,"opacity"])),this.d(d.track([i,"interpolation"],[this,"interpolation"])),this.d(d.bind([i,"flyInParam"],[this,"flyInParam"])),this.d(d.bind([i,"flyToParam"],[this,"flyToParam"])),this.d(this.flyInEvent.don(s=>{i.flyIn(s)})),this.d(this.flyToEvent.don(s=>{i.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}}get excavate(){return this._excavate}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new bt([this,"mode"],gl.modes,"模式","in"),new _t([this,"targetID"],"瓦片图层","")]}}};g(su,"createDefaultProps",()=>({...ka.createDefaultProps(),mode:"in",targetID:""})),g(su,"type",su.register("ESHole",su,{chsName:"挖坑(带材质+深度)",tags:["ESObjects"],description:"挖坑"}));let Td=su;const xd={layerconfigfind:"/ts/layer/config/get",layerconfigsave:"/ts/layer/config/put",featureproperty:"/ts/editor/property",featureeditormuti:"/ts/editor/update",getts:"/ts/info"},cI=async(r,t,e,n)=>{try{const i=window.localStorage.getItem("Authorization");let s=r+`${xd.layerconfigfind}?tileServiceName=${t}`;e&&(s+=`&earthdstoken=${encodeURIComponent(n)}`);const o={headers:{...!e&&i?{Authorization:i}:{}},mode:"cors"},u=await(await fetch(s,o)).text();return JSON.parse(u)}catch(i){console.error(i)}},fI=async(r,t,e,n,i)=>{try{const s=window.localStorage.getItem("Authorization");let o=r+xd.layerconfigsave;const a=i??{};e&&(o+=`?earthdstoken=${encodeURIComponent(n)}`);const u={method:"POST",headers:{"Content-Type":"application/json",...!e&&s?{Authorization:s}:{}},mode:"cors",body:JSON.stringify({tileServiceName:t,layerConfig:JSON.stringify(a)})},h=await(await fetch(o,u)).text();return JSON.parse(h)}catch(s){console.error(s)}},dI=async(r,t,e)=>{try{const n=window.localStorage.getItem("Authorization");let i=r;t&&(i+=`?earthdstoken=${encodeURIComponent(e)}`);const s={headers:{...!t&&n?{Authorization:n}:{}},mode:"cors"},a=await(await fetch(i,s)).text(),u=JSON.parse(a);if(u.status=="ok")return u.data.port;console.error(u.status);return}catch(n){console.error(n)}},gI=async(r,t,e,n,i)=>{try{const s={tileServiceName:t,featureId:e},o=window.localStorage.getItem("Authorization");let a=r+xd.featureproperty;n&&(a+=`?earthdstoken=${encodeURIComponent(i)}`);const l=await(await fetch(a,{method:"post",headers:{"Content-Type":"application/json",...!n&&o?{Authorization:o}:{}},body:JSON.stringify(s),mode:"cors"})).text(),h=JSON.parse(l);if(h.status=="ok")return h.data;console.error(h.data.status);return}catch(s){console.error(s)}},ou=class ou extends Fn{constructor(e){super(e);g(this,"_es3DTileset",this.dv(new Fn));g(this,"_ids",this.dv(d.reactJson([])));g(this,"_useEarthDSToken",this.dv(d.react(!1)));g(this,"_earthdstoken",this.dv(d.react("")));g(this,"_visJson",this.disposeVar(d.react({})));g(this,"_highlightInner3DtilesetEvent",this.dv(new d.Event));g(this,"_removeHighlightInner3DtilesetEvent",this.dv(new d.Event));g(this,"_tilesetServePort",this.dv(d.react("")));this.mainClass=this._es3DTileset;{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ts01");return}this.url?this.refresh():this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset));const n=this._es3DTileset;this.d(d.track([n,"allowPicking"],[this,"allowPicking"])),this.d(d.track([n,"collision"],[this,"collision"])),this.d(d.bind([n,"flyToParam"],[this,"flyToParam"])),this.d(d.bind([n,"flyToParam"],[this,"flyToParam"])),this.d(d.track([n,"actorTag"],[this,"actorTag"])),this.d(d.track([n,"materialMode"],[this,"materialMode"])),this.d(d.track([n,"highlight"],[this,"highlight"])),this.d(d.track([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(d.track([n,"highlightID"],[this,"highlightID"])),this.d(d.track([n,"highlightColor"],[this,"highlightColor"])),this.d(d.bind([n,"offset"],[this,"offset"])),this.d(d.bind([n,"rotation"],[this,"rotation"])),this.d(d.track([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(d.track([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(d.track([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(d.track([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(d.track([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(d.track([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(d.track([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(d.track([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(d.track([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(d.track([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(d.track([n,"cacheBytes"],[this,"cacheBytes"])),this.d(d.track([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(d.track([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(d.track([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(d.track([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(d.track([n,"materialParams"],[this,"materialParams"])),this.d(d.bind([n,"supportEdit"],[this,"supportEdit"])),this.d(d.bind([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(d.bind([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(d.bind([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(d.bind([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(d.bind([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(d.bind([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...i)=>{n.highlightFeature(...i)})),this.d(this.highlightFeatureAndFlyToEvent.don((...i)=>{n.highlightFeatureAndFlyTo(...i)})),this.d(this.setFeatureColorEvent.don((...i)=>{n.setFeatureColor(...i)})),this.d(this.setFeatureVisableEvent.don((...i)=>{n.setFeatureVisable(...i)})),this.d(this.resetFeatureStyleEvent.don((...i)=>{n.resetFeatureStyle(...i)})),this.d(this.setFeatureStyleEvent.don((...i)=>{n.setFeatureStyle(...i)})),this.d(this.flyInEvent.don((...i)=>{n.flyIn(i[0])})),this.d(this.flyToEvent.don((...i)=>{n.flyTo(i[0])})),this.d(this.calcFlyToParamEvent.don((...i)=>{n.calcFlyToParam(...i)})),this.d(this.calcFlyInParamEvent.don((...i)=>{n.calcFlyInParam(...i)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(i=>{this.tilesetReady.emit(i)})),this.d(n.pickedEvent.don(i=>{i.assign({sceneObject:this}),this.pickedEvent.emit(i)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get ids(){return this._ids.value}get idsChanged(){return this._ids.changed}set ids(e){this._ids.value=e}get useEarthDSToken(){return this._useEarthDSToken.value}get useEarthDSTokenChanged(){return this._useEarthDSToken.changed}set useEarthDSToken(e){this._useEarthDSToken.value=e}get earthdstoken(){return this._earthdstoken.value}get earthdstokenChanged(){return this._earthdstoken.changed}set earthdstoken(e){this._earthdstoken.value=e}get visJson(){return this._visJson.value}set visJson(e){this._visJson.value=e}get visJsonChanged(){return this._visJson.changed}setFeatureVisable(e,n){var i;if((i=this.layerConfig)!=null&&i.length){const s={};s[n[0].value]=n[0].visable,this.visJson={...this.visJson,...s}}else this.setFeatureVisableEvent.emit(e,typeof n=="string"?JSON.parse(n):n)}async getFeatureProperty(e){return await gI(this.baseUrl,this.tileServiceName,e,this.useEarthDSToken,this.earthdstoken)}async getLayerConfig(){const e=await cI(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken);return!e||!Array.isArray(e)?this.layerConfig=[]:this.layerConfig=e,this.layerConfig}async saveLayerConfig(){const e=this.layerConfig;return await fI(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,e)}get highlightInner3DtilesetEvent(){return this._highlightInner3DtilesetEvent}_highlightInner3Dtileset(e){this._highlightInner3DtilesetEvent.emit(e)}async highlightDSFeature(e){this._highlightInner3Dtileset(e)}get removeHighlightInner3DtilesetEvent(){return this._removeHighlightInner3DtilesetEvent}_removeHighlightInner3Dtileset(e){this._removeHighlightInner3DtilesetEvent.emit(e)}async removeHighlightDSFeature(e){this._removeHighlightInner3Dtileset(e)}async pickFeature(e,n){var a,u,l;const i=await e.pick(n),s=i.sceneObject;return!s||s.id!==this.id&&s.typeName!="ESRtsFeatureEditing"?void 0:s.typeName!="ESRtsFeatureEditing"?(this.ids=[...this.ids,(a=i==null?void 0:i.tilesetPickInfo)==null?void 0:a.id],{featureId:(u=i==null?void 0:i.tilesetPickInfo)==null?void 0:u.id,pickInnerFields:i==null?void 0:i.tilesetPickInfo}):{featureId:(l=i==null?void 0:i.sceneObject)==null?void 0:l.id,pickInnerFields:i==null?void 0:i.tilesetPickInfo}}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(e){this._tilesetServePort.value=e}async getport(){const e=await dI(this.url,this.useEarthDSToken,this.earthdstoken);if(e)return this.tilesetServePort=e,e;throw new Error("服务地址port获取失败!")}async refresh(){var i;if(!this.url||typeof this.url!="string")return;const e=(i=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:i[1],n=+new Date;if(e){const s=this.tileServiceIp,o=await this.getport();await this.getLayerConfig(),this._es3DTileset.url=`${s}:${o}/tiles/tileset.json?t=${n}`}console.log("3dtileset url:",this._es3DTileset.url)}get baseUrl(){var e;if(this.url&&typeof this.url=="string"){const n=(e=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:e[1];if(!n)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01");return n}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01")}get tileServiceName(){var e;if(this.url&&typeof this.url=="string"){const n=(e=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:e[1];if(!n)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01,");return n}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var e;if(this.url&&typeof this.url=="string"){const n=(e=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:e[1];if(!n)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01");return n}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ut([this,"layerConfig"],"图层配置",[],void 0,!0)]}}};g(ou,"createDefaultProps",()=>({...Fn.createDefaultProps(),layerConfig:d.reactJsonWithUndefined([])})),g(ou,"type",ou.register("ESRtsTileset",ou,{chsName:"CIMRTS实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let Od=ou;function pI(r){return typeof r=="number"&&!isNaN(r)}const au=class au extends Fn{get json(){return{...this._innerGetJson(),show:this.show,materials:this.materials,changeMaterial:this.changeMaterial,props:this.props,rotation:this.rotation}}set json(t){this._innerSetJson(t)}async init(t,e){this.featureId=e;const n=await t.getFeatureProperty(e);this.uiShowprops=n.allFields.map(o=>({featureClassName:o.featureClassName,fields:o.fields.map(a=>({key:a.name,type:a.type,value:a.type!="Double"?a.value:pI(a.value)?Number(a.value.toFixed(3)):""}))})),this.datasetName=n.datasetName,t.setFeatureVisable("id",[{value:this.featureId,visable:!1}]),this.d(()=>{t.setFeatureVisable("id",[{value:this.featureId,visable:!0}])});const i=t.tileServiceIp,s=t.tilesetServePort;if(!s)throw new Error("ESRtsFeatureEditing: port is not defined");this.url=`${i}:${s}/featuretiles/${this.featureId}/tileset.json`,this.allowPicking=!0,this.d(this.pickedEvent.don(o=>{o.assign({sceneObject:t}),t.pickedEvent.emit(o)})),this.d(()=>{this.editing=!1,t.removeHighlightDSFeature(this)})}constructor(t){super(t)}};g(au,"createDefaultProps",()=>({...Fn.createDefaultProps(),datasetName:void 0,featureId:void 0,materials:d.reactJson({}),changeMaterial:d.reactJsonWithUndefined(void 0),uiShowprops:d.reactJson({}),props:d.reactJson({})})),g(au,"type",au.register("ESRtsFeatureEditing",au,{chsName:"ESRtsFeatureEditing",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let Ad=au;const vI=async(r,t,e)=>{try{const n=window.localStorage.getItem("Authorization");let i=r;t&&(i+=`?earthdstoken=${encodeURIComponent(e)}`);const s={headers:{...!t&&n?{Authorization:n}:{}},mode:"cors"},a=await(await fetch(i,s)).text(),u=JSON.parse(a);if(u.status=="ok")return u.data.port;console.error(u.status);return}catch(n){console.error(n)}},Il=class Il extends Fn{constructor(e){super(e);g(this,"_es3DTileset",this.dv(new Fn));g(this,"_tilesetServePort",this.dv(d.react("")));g(this,"_useEarthDSToken",this.dv(d.react(!1)));g(this,"_earthdstoken",this.dv(d.react("")));this.mainClass=this._es3DTileset;{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ms01");return}this.url?this.refresh():this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset));const n=this._es3DTileset;this.d(d.track([n,"allowPicking"],[this,"allowPicking"])),this.d(d.track([n,"collision"],[this,"collision"])),this.d(d.bind([n,"flyToParam"],[this,"flyToParam"])),this.d(d.bind([n,"flyToParam"],[this,"flyToParam"])),this.d(d.track([n,"actorTag"],[this,"actorTag"])),this.d(d.track([n,"materialMode"],[this,"materialMode"])),this.d(d.track([n,"highlight"],[this,"highlight"])),this.d(d.track([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(d.track([n,"highlightID"],[this,"highlightID"])),this.d(d.track([n,"highlightColor"],[this,"highlightColor"])),this.d(d.bind([n,"offset"],[this,"offset"])),this.d(d.bind([n,"rotation"],[this,"rotation"])),this.d(d.track([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(d.track([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(d.track([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(d.track([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(d.track([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(d.track([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(d.track([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(d.track([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(d.track([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(d.track([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(d.track([n,"cacheBytes"],[this,"cacheBytes"])),this.d(d.track([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(d.track([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(d.track([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(d.track([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(d.track([n,"materialParams"],[this,"materialParams"])),this.d(d.bind([n,"supportEdit"],[this,"supportEdit"])),this.d(d.bind([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(d.bind([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(d.bind([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(d.bind([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(d.bind([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(d.bind([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...i)=>{n.highlightFeature(...i)})),this.d(this.highlightFeatureAndFlyToEvent.don((...i)=>{n.highlightFeatureAndFlyTo(...i)})),this.d(this.setFeatureColorEvent.don((...i)=>{n.setFeatureColor(...i)})),this.d(this.setFeatureVisableEvent.don((...i)=>{n.setFeatureVisable(...i)})),this.d(this.resetFeatureStyleEvent.don((...i)=>{n.resetFeatureStyle(...i)})),this.d(this.flyInEvent.don((...i)=>{n.flyIn(i[0])})),this.d(this.flyToEvent.don((...i)=>{n.flyTo(i[0])})),this.d(this.calcFlyToParamEvent.don((...i)=>{n.calcFlyToParam(...i)})),this.d(this.calcFlyInParamEvent.don((...i)=>{n.calcFlyInParam(...i)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(i=>{this.tilesetReady.emit(i)})),this.d(n.pickedEvent.don(i=>{i.assign({sceneObject:this}),this.pickedEvent.emit(i)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(e){this._tilesetServePort.value=e}get useEarthDSToken(){return this._useEarthDSToken.value}get useEarthDSTokenChanged(){return this._useEarthDSToken.changed}set useEarthDSToken(e){this._useEarthDSToken.value=e}get earthdstoken(){return this._earthdstoken.value}get earthdstokenChanged(){return this._earthdstoken.changed}set earthdstoken(e){this._earthdstoken.value=e}async getport(){const e=await vI(this.url,this.useEarthDSToken,this.earthdstoken);if(e)return this.tilesetServePort=e,e;throw new Error("服务地址port获取失败!")}async refresh(){var i;if(!this.url||typeof this.url!="string")return;const e=(i=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:i[1],n=+new Date;if(e){const s=this.tileServiceIp,o=await this.getport();this._es3DTileset.url=`${s}:${o}/tiles/tileset.json?t=${n}`}console.log("3dtileset url:",this._es3DTileset.url)}get baseUrl(){var e;if(this.url&&typeof this.url=="string"){const n=(e=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:e[1];if(!n)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var e;if(this.url&&typeof this.url=="string"){const n=(e=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:e[1];if(!n)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceName(){var e;if(this.url&&typeof this.url=="string"){const n=(e=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:e[1];if(!n)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01,");return n}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01")}};g(Il,"type",Il.register("ESMsTileset",Il,{chsName:"Modelser实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let Dd=Il;const Qv={defaultValue:[{type:"2",widget:"WidgetBlueprint'/ESFoliage/PoiSheng.PoiSheng'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"3",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"4",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"5",widget:"WidgetBlueprint'/ESFoliage/PoiXiang.PoiXiang'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"6",widget:"WidgetBlueprint'/ESFoliage/PoiCun.PoiCun'",povit:[.5,1],worldScale:.1,hiddenDistance:40}],sampleValue:`
357
+ `,NP="${earthsdk3-assets-script-dir}/assets/misc/2.geojson",wt=class wt extends Dt{constructor(e){super(e);d(this,"_flyToFeatureEvent",this.dv(new V));d(this,"_flyToFeatureIndexEvent",this.dv(new V));d(this,"_features",this.disposeVar(g.reactJsonWithUndefined(void 0)));d(this,"pickedInfoType","FeatureCollection");d(this,"abortController");this._updateUrl(),this.ad(this.urlChanged.don(()=>{this._updateUrl()})),this.ad(this.editingChanged.don(()=>{console.warn("ESGeoJson暂不支持编辑!")}))}get flyToFeatureEvent(){return this._flyToFeatureEvent}flyToFeature(e,n,i){this._flyToFeatureEvent.emit(e,n,i)}get flyToFeatureIndexEvent(){return this._flyToFeatureIndexEvent}flyToFeatureIndex(e,n){this._flyToFeatureIndexEvent.emit(e,n)}get features(){return this._features.value}set features(e){this._features.value=e}get featuresChanged(){return this._features.changed}getFeatures(){if(this.features)return this.features;console.log("数据未加载完成,请稍后调用此方法getFeatures()")}async _updateUrl(){var n;this.abortController&&this.abortController.abort(),this.abortController=new AbortController;const e=this.abortController.signal;if(!this.url){this.features=void 0;return}typeof this.url=="object"?this.features=this.url:Xh(this.url)?this.features=JSON.parse(this.url):await fetch(K.context.getStrFromEnv(this.url),{signal:e}).then(i=>i.json()).then(i=>{this.features=i}).catch(i=>{i.name!="AbortError"&&console.warn("ESEntityCluster数据加载失败",i)}),this.pickedInfoType=((n=this.features)==null?void 0:n.type)??"FeatureCollection"}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",dataSource:[...e.dataSource,new Q([this,"url"],"服务地址",wt.defaults.url),new T([this,"minFeatureVisibleDistance"],"要素最小可视距离",wt.defaults.minFeatureVisibleDistance),new T([this,"maxFeatureVisibleDistance"],"要素最大可视距离",wt.defaults.maxFeatureVisibleDistance),new pt([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考")],style:[...e.style,new nt([],"点样式集合"),new W([this,"textShow"],"是否显示",wt.defaults.textShow),new _e([this,"textAnchor"],"锚点",wt.defaults.anchor),new ot([this,"textProperty"],"标注显示属性",wt.defaults.textStyle.textProperty),new ot([this,"textDefaultText"],"默认文本",wt.defaults.textStyle.defaultText),new _t([this,"textColor"],"文本颜色",wt.defaults.textStyle.color),new _t([this,"textBackgroundColor"],"文本背景颜色",wt.defaults.textStyle.backgroundColor),new ot([this,"textFontStyle"],"字体样式",wt.defaults.textStyle.fontStyle),new ot([this,"textFontWeight"],"字体粗细",wt.defaults.textStyle.fontWeight),new T([this,"textFontSize"],"字体大小",wt.defaults.textStyle.fontSize),new _e([this,"textOffset"],"像素偏移",wt.defaults.textStyle.offset),new nt([],"点图片样式集合"),new W([this,"imageShow"],"是否显示",wt.defaults.imageShow),new _e([this,"imageAnchor"],"锚点",wt.defaults.imageStyle.anchor),new Q([this,"imageUrl"],"图片地址",wt.defaults.imageStyle.url),new _e([this,"imageSize"],"图片大小",wt.defaults.imageStyle.size),new _e([this,"imageOffset"],"像素偏移",wt.defaults.imageStyle.offset),new nt([],"线样式集合"),new W([this,"stroked"],"是否显示",wt.defaults.stroked),new W([this,"strokeGround"],"贴地",wt.defaults.strokeStyle.ground),new T([this,"strokeWidth"],"线宽",wt.defaults.strokeStyle.width),new pt([this,"strokeWidthType"],wt.strokeStyleWidthTypes,"线宽类型"),new _t([this,"strokeColor"],"线颜色",wt.defaults.strokeStyle.color),new ot([this,"strokeMaterial"],"线材质",wt.defaults.strokeStyle.material),new Q([this,"strokeMaterialParams"],"线材质参数",wt.defaults.strokeStyle.materialParams),new nt([],"面样式集合"),new W([this,"filled"],"是否显示",wt.defaults.filled),new W([this,"fillGround"],"贴地",wt.defaults.fillStyle.ground),new _t([this,"fillColor"],"填充颜色",wt.defaults.fillStyle.color),new ot([this,"fillMaterial"],"填充材质",wt.defaults.fillStyle.material),new Q([this,"fillMaterialParams"],"填充材质参数",wt.defaults.fillStyle.materialParams)],more:[...e.more,new nt([],"标注文本样式"),new ot([this,"textFontFamily"],"字体",wt.defaults.textStyle.fontFamily),new nt([],"通用"),new Qi([this,"loadFuncStr"],"loadFnStr",Gv,xP,!0)]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(e){this.strokeStyle={...this.strokeStyle,width:e}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(e){this.strokeStyle={...this.strokeStyle,widthType:e}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(e){this.strokeStyle={...this.strokeStyle,color:[...e]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(e){this.strokeStyle={...this.strokeStyle,material:e}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(e){this.strokeStyle={...this.strokeStyle,materialParams:e}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(e){this.strokeStyle={...this.strokeStyle,ground:e}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(e){this.fillStyle={...this.fillStyle,color:[...e]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(e){this.fillStyle={...this.fillStyle,material:e}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(e){this.fillStyle={...this.fillStyle,materialParams:e}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(e){this.fillStyle={...this.fillStyle,ground:e}}get fillGroundChanged(){return this.fillStyleChanged}get textProperty(){return this.textStyle.textProperty}set textProperty(e){this.textStyle={...this.textStyle,textProperty:e}}get textPropertyChanged(){return this.textStyleChanged}get textDefaultText(){return this.textStyle.defaultText}set textDefaultText(e){this.textStyle={...this.textStyle,defaultText:e}}get textDefaultTextChanged(){return this.textStyleChanged}get textColor(){return this.textStyle.color}set textColor(e){this.textStyle={...this.textStyle,color:e}}get textColorChanged(){return this.textStyleChanged}get textBackgroundColor(){return this.textStyle.backgroundColor}set textBackgroundColor(e){this.textStyle={...this.textStyle,backgroundColor:e}}get textBackgroundColorChanged(){return this.textStyleChanged}get textFontFamily(){return this.textStyle.fontFamily}set textFontFamily(e){this.textStyle={...this.textStyle,fontFamily:e}}get textFontFamilyChanged(){return this.textStyleChanged}get textFontStyle(){return this.textStyle.fontStyle}set textFontStyle(e){this.textStyle={...this.textStyle,fontStyle:e}}get textFontStyleChanged(){return this.textStyleChanged}get textFontWeight(){return this.textStyle.fontWeight}set textFontWeight(e){this.textStyle={...this.textStyle,fontWeight:e}}get textFontWeightChanged(){return this.textStyleChanged}get textFontSize(){return this.textStyle.fontSize}set textFontSize(e){this.textStyle={...this.textStyle,fontSize:e}}get textFontSizeChanged(){return this.textStyleChanged}get textAnchor(){return this.textStyle.anchor}set textAnchor(e){this.textStyle={...this.textStyle,anchor:e}}get textAnchorChanged(){return this.textStyleChanged}get textOffset(){return this.textStyle.offset}set textOffset(e){this.textStyle={...this.textStyle,offset:e}}get textOffsetChanged(){return this.textStyleChanged}get imageUrl(){return this.imageStyle.url}set imageUrl(e){this.imageStyle={...this.imageStyle,url:e}}get imageUrlChanged(){return this.imageStyleChanged}get imageSize(){return this.imageStyle.size}set imageSize(e){this.imageStyle={...this.imageStyle,size:e}}get imageSizeChanged(){return this.imageStyleChanged}get imageAnchor(){return this.imageStyle.anchor}set imageAnchor(e){this.imageStyle={...this.imageStyle,anchor:e}}get imageAnchorChanged(){return this.imageStyleChanged}get imageOffset(){return this.imageStyle.offset}set imageOffset(e){this.imageStyle={...this.imageStyle,offset:e}}get imageOffsetChanged(){return this.imageStyleChanged}};d(wt,"createDefaultProps",()=>({...Dt.createDefaultProps(),show:!0,allowPicking:!0,loadFuncStr:void 0,url:NP,stroked:!0,strokeStyle:g.reactJson({width:1,widthType:"world",color:[.79,.91,.06,1],material:"",materialParams:{},ground:!1}),filled:!0,fillStyle:g.reactJson({color:[.79,.91,.06,.2],material:"",materialParams:{},ground:!1}),imageShow:!0,imageStyle:g.reactJson({url:"${earthsdk3-assets-script-dir}/assets/img/location.png",size:[32,32],anchor:[.5,1],offset:[0,0]}),textShow:!0,textStyle:g.reactJson({textProperty:"",defaultText:"默认标注",color:[1,1,1,1],backgroundColor:void 0,fontFamily:"Arial",fontSize:16,fontStyle:"normal",fontWeight:"normal",anchor:[0,1],offset:[16,-8]}),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE"})),d(wt,"type",wt.register("ESGeoJson",wt,{chsName:"ESGeoJson",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"GeoJson数据加载"})),d(wt,"strokeStyleWidthTypes",[["screen","screen"],["world","world"]]);let el=wt;const po=class po extends yt{constructor(e){super(e);d(this,"editingBindMode","doublePoints");d(this,"_height",this.disposeVar(g.react(0)));{const n=()=>{this.height=this.points&&this.points.length>=2?this.points[1][2]-this.points[0][2]:0};n(),this.ad(this.pointsChanged.don(n))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}};d(po,"createDefaultProps",()=>({...yt.createDefaultProps(),stroked:!0,strokeStyle:g.reactJson({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(po,"type",po.register("ESHeightMeasurement",po,{chsName:"高度测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"高度测量"})),d(po,"supportEditingModes",[...yt.supportEditingModes,$.DoublePointsAppend,$.DoublePointsModify]);let Bf=po;const Ra=class Ra extends Gi{constructor(e){super(e);d(this,"_area",this.dv(g.react(0)));d(this,"_perimeter",this.dv(g.react(0)));d(this,"editingBindMode","doublePoints");const n=()=>{this._area.value=Math.PI*this.radius*this.radius,this._perimeter.value=2*Math.PI*this.radius};n(),this.d(this.radiusChanged.don(n))}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}toPolygon(e=10,n){return yv([...this.position],this.radius,e,n)[0].map(s=>[...s,this.position?this.position[2]:0])}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",basic:[...e.basic,new T([this,"radius"],"圆半径",1,!0)],coordinate:[...e.coordinate,new W([this,"editing"],"是否编辑"),new Io([this,"position"],"三维坐标",[0,0,0],!0),new T([this,"area"],"面积",0,!1,!0),new T([this,"perimeter"],"周长",0,!1,!0)]}}};d(Ra,"createDefaultProps",()=>({...Gi.createDefaultProps(),radius:1,filled:!0,collision:!1,fillStyle:g.reactJson({color:[1,1,1,.5],material:"",materialParams:{},ground:!1})})),d(Ra,"type",Ra.register("ESLocalCircle",Ra,{chsName:"局部坐标圆形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalCircle"}));let Hf=Ra;const Fa=class Fa extends Gi{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new Xd([this,"points"],"坐标",[])]}}};d(Fa,"createDefaultProps",()=>({...Gi.createDefaultProps(),points:cf([]),filled:!0})),d(Fa,"type",Fa.register("ESLocalPolygon",Fa,{chsName:"局部2D坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygon"}));let rl=Fa;const ka=class ka extends ma{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new Gh([this,"points"],"本地位置数组")]}}};d(ka,"createDefaultProps",()=>({...ma.createDefaultProps(),points:g.reactPositions(void 0),filled:!0})),d(ka,"type",ka.register("ESLocalPolygonZ",ka,{chsName:"局部坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygonZ"}));let Yf=ka;const Va=class Va extends Gi{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new T([this,"width"],"宽度"),new T([this,"height"],"高度")]}}};d(Va,"createDefaultProps",()=>({...Gi.createDefaultProps(),width:5e5,height:3e5,filled:!0})),d(Va,"type",Va.register("ESLocalRectangle",Va,{chsName:"局部坐标四边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalRectangle"}));let Jf=Va;const Xi=class Xi extends yt{constructor(e){super(e);d(this,"editingBindMode","lineString");d(this,"_distance",this.dv(g.react(0)));d(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());const n=()=>{if(this.points&&this.points.length>=2){const i=$u(this.points,"GEODESIC"),s=i[i.length-1];this._distance.value=s}else this._distance.value=0};n(),this.d(this.pointsChanged.don(n))}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new T([this,"height"],"高度",10),new T([this,"width"],"宽度",10),new pt([this,"materialMode"],Xi.materialModes,"模式","purple")],coordinate:[...e.coordinate,new T([this,"distance"],"距离",0,!1,!0)]}}};d(Xi,"createDefaultProps",()=>({...yt.createDefaultProps(),height:10,width:10,materialMode:"singleArrow",filled:!0,stroked:!0,fillStyle:g.reactJson({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),d(Xi,"type",Xi.register("ESPipeFence",Xi,{chsName:"管道电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"管道电子围栏"})),d(Xi,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","color"]]),d(Xi,"supportEditingModes",[...yt.supportEditingModes,$.LineStringAppend,$.LineStringInsert]);let Ph=Xi;const Bi=class Bi extends vn{constructor(e){super(e);d(this,"_setLayerVisibleEvent",this.dv(new V));d(this,"_setLayerColorEvent",this.dv(new V))}get setLayerVisibleEvent(){return this._setLayerVisibleEvent}setLayerVisible(e,n){this._setLayerVisibleEvent.emit(e,n)}get setLayerColorEvent(){return this._setLayerColorEvent}setLayerColor(e,n){this._setLayerColorEvent.emit(e,n)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new nt([],"ESPipeserTileset"),new it(["string","string"],(n,i)=>this.setLayerVisible(n,i),["",""],"setLayerVisible"),new it(["string","string"],(n,i)=>this.setLayerColor(n,i),["",""],"setLayerColor"),new pt([this,"colorMode"],Bi.colorModes,"colorMode",Bi.defaults.colorMode,!0)]}}};d(Bi,"createDefaultProps",()=>({...vn.createDefaultProps(),colorMode:"default"})),d(Bi,"type",Bi.register("ESPipeserTileset",Bi,{chsName:"PipeSer图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"PipeSer图层"})),d(Bi,"colorModes",[["default","default"],["color","color"],["blend","blend"]]);let jf=Bi;const Hi=class Hi extends yt{constructor(e){super(e);d(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",coordinate:[...e.coordinate,new T([this,"area"],"面积",0,!1,!0),new T([this,"perimeter"],"周长",0,!1,!0)],basic:[...e.basic,new T([this,"height"],"高度",10),new pt([this,"materialMode"],Hi.materialModes,"模式","danger")]}}};d(Hi,"createDefaultProps",()=>({...yt.createDefaultProps(),height:10,materialMode:"danger",filled:!0,collision:!1})),d(Hi,"type",Hi.register("ESPolygonFence",Hi,{chsName:"多边形电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"多边形电子围栏"})),d(Hi,"materialModes",[["模式一","danger"],["模式二","checkerboard"],["模式三","warning"],["模式四","cord"],["模式五","scanline"],["模式六","honeycomb"],["模式七","gradientColor"]]),d(Hi,"supportEditingModes",[...yt.supportEditingModes,$.CircularAppend,$.CircularInsert,$.HeightModify]);let Mh=Hi;const Ps=class Ps extends yt{constructor(e){super(e);d(this,"_deprecated",["ground"]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());d(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new nt([],"通用","通用"),new W([this,"ground"],"是否贴地"),new W([this,"outlineTranslucent"],"轮廓线半透明"),new T([this,"height"],"高度"),new T([this,"extrudedHeight"],"拉伸高度"),new Pn([this,"rectangle"],"范围",Ps.defaults.rectangle,!0),new T([this,"stRotation"],"纹理旋转角度"),new T([this,"rotation"],"旋转角度"),new W([this,"pointEditing"],"是否单点编辑")]}}};d(Ps,"createDefaultProps",()=>({...yt.createDefaultProps(),ground:!1,outlineTranslucent:!0,height:0,extrudedHeight:0,rectangle:g.reactArrayWithUndefined(void 0),rotation:0,stRotation:0,pointEditing:!1,filled:!0})),d(Ps,"type",Ps.register("ESRectangle",Ps,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"矩形"})),d(Ps,"supportEditingModes",[...yt.supportEditingModes,$.DoublePointsAppend,$.DoublePointsModify]);let Qf=Ps;const Ua=class Ua extends Ut{getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Q([this,"innerRings"],"裁切多边形数组",[],void 0,!0)]}}};d(Ua,"createDefaultProps",()=>({...Ut.createDefaultProps(),innerRings:g.reactPositionsSet([])})),d(Ua,"type",Ua.register("ESPolygonWithHole",Ua,{chsName:"内部裁切多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"带洞多边形"}));let $f=Ua;const Ms=class Ms extends Ut{constructor(e){super(e);d(this,"_startEvent",this.disposeVar(new V));d(this,"_stopEvent",this.dv(new V));d(this,"_surfaceArea",this.disposeVar(g.react(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get surfaceArea(){return this._surfaceArea.value}set surfaceArea(e){this._surfaceArea.value=e}get surfaceChanged(){return this._surfaceArea.changed}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new nt([],"表面积测量","表面积测量"),new it([],()=>this.start(),[],"开始计算"),new T([this,"interpolation"],"插值距离",Ms.defaults.interpolation),new T([this,"offsetHeight"],"偏移高度",Ms.defaults.offsetHeight)]}}};d(Ms,"createDefaultProps",()=>({...Ut.createDefaultProps(),interpolation:.5,offsetHeight:0,units:g.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"]),fillStyle:g.reactJson({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),d(Ms,"type",Ms.register("ESSurfaceAreaMeasurement",Ms,{chsName:"表面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"表面积测量"}));let Kf=Ms;const bs=class bs extends Z{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new T([this,"downloadProgress"],"下载进度",bs.defaults.downloadProgress,!0,!0),new Q([this,"importOptions"],"导入参数",bs.defaults.importOptions,void 0,!0)],dataSource:[...t.dataSource,new Q([this,"url"],"路径")]}}};d(bs,"createDefaultProps",()=>({...Z.createDefaultProps(),url:"",importOptions:g.reactJsonWithUndefined({buildCollisions:"QueryAndPhysics",buildHierarchy:"Simplified",collisionType:"CTF_UseComplexAsSimple",bImportMetaData:!0}),downloadProgress:0})),d(bs,"type",bs.register("ESDatasmithRuntimeModel",bs,{chsName:"Datasmith Model",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Datasmith Model"}));let Zf=bs;const ar=class ar extends rl{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new pt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",ar.defaults.waterType),new T([this,"frequency"],"频率",ar.defaults.frequency),new Pe([this,"amplitude"],.01,[0,1],"振幅",ar.defaults.amplitude),new Pe([this,"flowDirection"],1,[0,360],"流向",ar.defaults.flowDirection),new Pe([this,"waveVelocity"],.01,[0,1],"波动频率",ar.defaults.waveVelocity),new Pe([this,"specularIntensity"],.01,[0,1],"镜面反射强度",ar.defaults.specularIntensity),new Pe([this,"murkiness"],.1,[0,10],"水体浑浊度",ar.defaults.murkiness),new T([this,"flowSpeed"],"水流速度",ar.defaults.flowSpeed),new _t([this,"waterColor"],"水的底色",ar.defaults.waterColor),new Q([this,"waterImage"],"水的图片",ar.defaults.waterImage)]}}};d(ar,"createDefaultProps",()=>({...rl.createDefaultProps(),allowPicking:!0,waterImage:g.reactJsonWithUndefined(void 0),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5,stroked:!1,filled:!0})),d(ar,"type",ar.register("ESDynamicWater",ar,{chsName:"动态水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"局部多边形水面"}));let td=ar;const ur=class ur extends Ut{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new pt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",ur.defaults.waterType),new T([this,"frequency"],"频率",ur.defaults.frequency),new Pe([this,"amplitude"],.01,[0,1],"振幅",ur.defaults.amplitude),new Pe([this,"flowDirection"],1,[0,360],"流向",ur.defaults.flowDirection),new Pe([this,"waveVelocity"],.01,[0,1],"波动频率",ur.defaults.waveVelocity),new Pe([this,"specularIntensity"],.01,[0,1],"镜面反射强度",ur.defaults.specularIntensity),new Pe([this,"murkiness"],.1,[0,10],"水体浑浊度",ur.defaults.murkiness),new T([this,"flowSpeed"],"水流速度",ur.defaults.flowSpeed),new _t([this,"waterColor"],"水的底色",ur.defaults.waterColor),new Q([this,"waterImage"],"水的图片",ur.defaults.waterImage)]}}};d(ur,"createDefaultProps",()=>({...Ut.createDefaultProps(),allowPicking:!0,waterImage:g.reactJsonWithUndefined({}),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5})),d(ur,"type",ur.register("ESGeoWater",ur,{chsName:"地理水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地理动态水面"}));let ed=ur;const go=class go extends Z{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new T([this,"downloadProgress"],"下载进度",go.defaults.downloadProgress,!0,!0),new ot([this,"levelName"],"levelName",""),new T([this,"levelLoadDistance"],"levelLoadDistance",1e3),new Je([this,"levelOffset"],"levelOffset",[0,0,0])],dataSource:[...t.dataSource,new Q([this,"url"],"url","")]}}};d(go,"createDefaultProps",()=>({...Z.createDefaultProps(),url:"",downloadProgress:0,levelName:"",levelOffset:g.reactArray([0,0,0]),levelLoadDistance:1e3})),d(go,"type",go.register("ESLevelRuntimeModel",go,{chsName:"关卡包模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"关卡包模型"}));let rd=go;const Yr=class Yr extends qi{constructor(e){super(e);d(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})())}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new T([this,"radius"],"半径",Yr.defaults.radius),new T([this,"sides"],"圆边数",Yr.defaults.sides),new T([this,"speed"],"材质速度",Yr.defaults.speed),new pt([this,"materialMode"],Yr.materialModes,"材质模式",Yr.defaults.materialMode),new Q([this,"materialImage"],"材质图片和重复度",Yr.defaults.materialImage)]}}};d(Yr,"createDefaultProps",()=>({...qi.createDefaultProps(),radius:10,sides:10,materialMode:"singleArrow",materialImage:g.reactJson({url:"",uDis:50,vDis:10}),speed:1,filled:!0,stroked:!1,fillStyle:g.reactJson({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),d(Yr,"type",Yr.register("ESPipeline",Yr,{chsName:"管线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPipeline"})),d(Yr,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"]]);let nd=Yr;const Ei=class Ei extends yt{constructor(e){super(e);d(this,"editingBindMode","visibility")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new _t([this,"visibleColor"],"可视区域颜色",Ei.defaults.visibleColor),new _t([this,"invisibleColor"],"遮挡区域颜色",Ei.defaults.invisibleColor),new T([this,"heightOffset"],"视点高度偏移",Ei.defaults.heightOffset)]}}};d(Ei,"createDefaultProps",()=>({...yt.createDefaultProps(),visibleColor:g.reactArray([0,1,0,1]),invisibleColor:g.reactArray([1,0,0,1]),heightOffset:0})),d(Ei,"type",Ei.register("ESVisibilityAnalysis",Ei,{chsName:"通视分析,视线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"通视分析,视线分析"})),d(Ei,"supportEditingModes",[...yt.supportEditingModes,$.VisibilityAppend,$.VisibilityModify]);let id=Ei;const za=class za extends Ut{constructor(e){super(e);d(this,"_startEvent",this.dv(new V));d(this,"_clearEvent",this.dv(new V));d(this,"_volume",this.disposeVar(g.react(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get volume(){return this._volume.value}set volume(e){this._volume.value=e}get volumeChanged(){return this._volume.changed}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new nt([],"通用","通用"),new T([this,"planeHeight"],"基准面高程",void 0,!0),new T([this,"gridWidth"],"采样间距 m"),new T([this,"cutVolume"],"挖方",0,!1,!0),new T([this,"fillVolume"],"填方",0,!1,!0),new T([this,"cutAndFillVolume"],"挖填方",0,!1,!0),new T([this,"progress"],"计算进度",0,!1,!0),new it([],()=>this.start(),[],"开始分析"),new it([],()=>this.clear(),[],"清空分析结果"),new W([this,"depthTest"],"是否开启深度检测")]}}};d(za,"createDefaultProps",()=>({...Ut.createDefaultProps(),planeHeight:g.react(void 0),gridWidth:1,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,filled:!1,stroked:!0,strokeStyle:g.reactJson({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(za,"type",za.register("ESVolumeMeasurement",za,{chsName:"体积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"体积测量"}));let sd=za;const Ga=class Ga extends to{constructor(e){super(e);d(this,"_human",this.dv(new to));d(this,"_poi",this.dv(new tl));this.d(this.components.disposableAdd(this._human,!0)),this.d(this.components.disposableAdd(this._poi));{const{_human:n,_poi:i}=this;this.d(g.track([n,"show"],[this,"show"])),this.d(g.track([i,"show"],[this,"show"])),this.d(g.track([n,"allowPicking"],[this,"allowPicking"])),this.d(g.track([i,"allowPicking"],[this,"allowPicking"])),this.d(g.bind([n,"scale"],[this,"scale"])),this.d(g.bind([i,"scale"],[this,"scale"])),this.d(g.track([n,"collision"],[this,"collision"])),this.d(g.track([i,"collision"],[this,"collision"])),this.d(g.bind([n,"flyInParam"],[this,"flyInParam"])),this.d(g.bind([n,"flyToParam"],[this,"flyToParam"])),this.d(g.track([n,"animation"],[this,"animation"])),this.d(g.track([n,"mode"],[this,"mode"])),this.d(g.track([n,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(g.track([n,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(g.track([i,"name"],[this,"name"])),this.d(g.track([i,"mode"],[this,"poiMode"])),this.d(g.track([i,"autoAnchor"],[this,"autoAnchor"])),this.d(g.track([i,"screenRender"],[this,"screenRender"])),this.d(g.track([i,"size"],[this,"size"])),this.d(g.track([i,"anchor"],[this,"anchor"])),this.d(g.track([i,"sizeByContent"],[this,"sizeByContent"])),this.d(g.track([i,"renderMode"],[this,"renderMode"])),this.d(g.track([i,"rotationType"],[this,"rotationType"])),this.d(g.track([i,"zOrder"],[this,"zOrder"])),this.d(g.track([i,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(g.track([i,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(g.bind([n,"position"],[this,"position"])),this.d(g.bind([n,"rotation"],[this,"rotation"])),this.d(this.flyInEvent.don(s=>{n.flyIn(s)})),this.d(this.flyToEvent.don(s=>{n.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{n.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{n.calcFlyInParam()})),this.d(this.smoothMoveEvent.don((s,o)=>{n.smoothMove(s,o)})),this.d(this.smoothMoveWithRotationEvent.don((s,o,a)=>{n.smoothMoveWithRotation(s,o,a)})),this.d(this.smoothMoveOnGroundEvent.don((s,o,a,u)=>{n.smoothMoveOnGround(s,o,a,u)})),this.d(this.smoothMoveWithRotationOnGroundEvent.don((s,o,a,u,l)=>{n.smoothMoveWithRotationOnGround(s,o,a,u,l)})),this.d(this.automaticLandingEvent.don(()=>{n.automaticLanding()}))}}get human(){return this._human}get poi(){return this._poi}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pt([this,"poiMode"],tl.modes,"poi模式","SquareH01"),new T([this,"poiOffsetHeight"],"poi高度偏移",1.8)]}}};d(Ga,"createDefaultProps",()=>({poiOffsetHeight:1.8,poiMode:"SquareH01",style:g.reactJson({}),autoAnchor:!0,screenRender:!0,size:g.reactArray([100,100]),anchor:g.reactArray([.5,1]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,...to.createDefaultProps()})),d(Ga,"type",Ga.register("ESHumanPoi",Ga,{chsName:"人员poi",tags:["ESObjects"],description:"ESHuman + ESPoi2D组合对象"}));let od=Ga;const jn=class jn extends Ut{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new T([this,"depth"],"深度",jn.defaults.depth),new T([this,"interpolation"],"插值",jn.defaults.interpolation),new T([this,"opacity"],"透明度",jn.defaults.opacity),new Q([this,"sideImage"],"侧面图片",jn.defaults.sideImage),new Q([this,"bottomImage"],"底面图片",jn.defaults.bottomImage)]}}};d(jn,"createDefaultProps",()=>({...Ut.createDefaultProps(),depth:100,sideImage:g.reactJson({url:K.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/side.jpg"),uDis:50,vDis:50}),bottomImage:g.reactJson({url:K.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/bottom.jpg"),uDis:50,vDis:50}),opacity:1,interpolation:50,collision:!1,allowPicking:!1,filled:!0})),d(jn,"type",jn.register("ESPit",jn,{chsName:"坑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"坑"}));let ya=jn;const qa=class qa extends ya{constructor(e){super(e);d(this,"_excavate",this.dv(new Zu));d(this,"_pit",this.dv(new ya));this.d(this.components.disposableAdd(this._excavate)),this.d(this.components.disposableAdd(this._pit,!0));{const{_excavate:n,_pit:i}=this;this.d(g.track([n,"show"],[this,"show"])),this.d(g.track([i,"show"],[this,"show"])),this.d(g.track([n,"allowPicking"],[this,"allowPicking"])),this.d(g.track([i,"allowPicking"],[this,"allowPicking"])),this.d(g.track([n,"collision"],[this,"collision"])),this.d(g.track([i,"collision"],[this,"collision"])),this.d(g.bind([i,"points"],[this,"points"])),this.d(g.track([n,"points"],[this,"points"])),this.d(g.track([i,"pointed"],[this,"pointed"])),this.d(g.track([n,"pointed"],[this,"pointed"])),this.d(g.track([i,"pointStyle"],[this,"pointStyle"])),this.d(g.track([n,"pointStyle"],[this,"pointStyle"])),this.d(g.track([i,"stroked"],[this,"stroked"])),this.d(g.track([n,"stroked"],[this,"stroked"])),this.d(g.track([i,"strokeStyle"],[this,"strokeStyle"])),this.d(g.track([n,"strokeStyle"],[this,"strokeStyle"])),this.d(g.track([i,"filled"],[this,"filled"])),this.d(g.track([i,"fillStyle"],[this,"fillStyle"])),this.d(g.track([n,"fillStyle"],[this,"fillStyle"])),this.d(g.track([n,"mode"],[this,"mode"])),this.d(g.track([n,"targetID"],[this,"targetID"])),this.d(g.track([i,"depth"],[this,"depth"])),this.d(g.track([i,"sideImage"],[this,"sideImage"])),this.d(g.track([i,"bottomImage"],[this,"bottomImage"])),this.d(g.track([i,"opacity"],[this,"opacity"])),this.d(g.track([i,"interpolation"],[this,"interpolation"])),this.d(g.bind([i,"flyInParam"],[this,"flyInParam"])),this.d(g.bind([i,"flyToParam"],[this,"flyToParam"])),this.d(this.flyInEvent.don(s=>{i.flyIn(s)})),this.d(this.flyToEvent.don(s=>{i.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}}get excavate(){return this._excavate}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pt([this,"mode"],Zu.modes,"模式","in"),new ot([this,"targetID"],"瓦片图层","")]}}};d(qa,"createDefaultProps",()=>({...ya.createDefaultProps(),mode:"in",targetID:""})),d(qa,"type",qa.register("ESHole",qa,{chsName:"挖坑(带材质+深度)",tags:["ESObjects"],description:"挖坑"}));let ad=qa;const ud={layerconfigfind:"/ts/layer/config/get",layerconfigsave:"/ts/layer/config/put",featureproperty:"/ts/editor/property",featureeditormuti:"/ts/editor/update",getts:"/ts/info"},TP=async(r,t,e,n)=>{try{const i=window.localStorage.getItem("Authorization");let s=r+`${ud.layerconfigfind}?tileServiceName=${t}`;e&&(s+=`&earthdstoken=${encodeURIComponent(n)}`);const o={headers:{...!e&&i?{Authorization:i}:{}},mode:"cors"},u=await(await fetch(s,o)).text();return JSON.parse(u)}catch(i){console.error(i)}},OP=async(r,t,e,n,i)=>{try{const s=window.localStorage.getItem("Authorization");let o=r+ud.layerconfigsave;const a=i??{};e&&(o+=`?earthdstoken=${encodeURIComponent(n)}`);const u={method:"POST",headers:{"Content-Type":"application/json",...!e&&s?{Authorization:s}:{}},mode:"cors",body:JSON.stringify({tileServiceName:t,layerConfig:JSON.stringify(a)})},h=await(await fetch(o,u)).text();return JSON.parse(h)}catch(s){console.error(s)}},DP=async(r,t,e)=>{try{const n=window.localStorage.getItem("Authorization");let i=r;t&&(i+=`?earthdstoken=${encodeURIComponent(e)}`);const s={headers:{...!t&&n?{Authorization:n}:{}},mode:"cors"},a=await(await fetch(i,s)).text(),u=JSON.parse(a);if(u.status=="ok")return u.data.port;console.error(u.status);return}catch(n){console.error(n)}},AP=async(r,t,e,n,i)=>{try{const s={tileServiceName:t,featureId:e},o=window.localStorage.getItem("Authorization");let a=r+ud.featureproperty;n&&(a+=`?earthdstoken=${encodeURIComponent(i)}`);const l=await(await fetch(a,{method:"post",headers:{"Content-Type":"application/json",...!n&&o?{Authorization:o}:{}},body:JSON.stringify(s),mode:"cors"})).text(),h=JSON.parse(l);if(h.status=="ok")return h.data;console.error(h.data.status);return}catch(s){console.error(s)}},Wa=class Wa extends vn{constructor(e){super(e);d(this,"_es3DTileset",this.dv(new vn));d(this,"_ids",this.dv(g.reactJson([])));d(this,"_useEarthDSToken",this.dv(g.react(!1)));d(this,"_earthdstoken",this.dv(g.react("")));d(this,"_visJson",this.disposeVar(g.react({})));d(this,"_highlightInner3DtilesetEvent",this.dv(new V));d(this,"_removeHighlightInner3DtilesetEvent",this.dv(new V));d(this,"_tilesetServePort",this.dv(g.react("")));{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ts01");return}this.url?this.refresh():this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(g.track([n,"allowPicking"],[this,"allowPicking"])),this.d(g.track([n,"collision"],[this,"collision"])),this.d(g.bind([n,"flyToParam"],[this,"flyToParam"])),this.d(g.bind([n,"flyToParam"],[this,"flyToParam"])),this.d(g.track([n,"actorTag"],[this,"actorTag"])),this.d(g.track([n,"materialMode"],[this,"materialMode"])),this.d(g.track([n,"highlight"],[this,"highlight"])),this.d(g.track([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(g.track([n,"highlightID"],[this,"highlightID"])),this.d(g.track([n,"highlightColor"],[this,"highlightColor"])),this.d(g.bind([n,"offset"],[this,"offset"])),this.d(g.bind([n,"rotation"],[this,"rotation"])),this.d(g.track([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(g.track([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(g.track([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(g.track([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(g.track([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(g.track([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(g.track([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(g.track([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(g.track([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(g.track([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(g.track([n,"cacheBytes"],[this,"cacheBytes"])),this.d(g.track([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(g.track([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(g.track([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(g.track([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(g.track([n,"materialParams"],[this,"materialParams"])),this.d(g.bind([n,"supportEdit"],[this,"supportEdit"])),this.d(g.bind([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(g.bind([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(g.bind([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(g.bind([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(g.bind([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(g.bind([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...i)=>{n.highlightFeature(...i)})),this.d(this.highlightFeatureAndFlyToEvent.don((...i)=>{n.highlightFeatureAndFlyTo(...i)})),this.d(this.setFeatureColorEvent.don((...i)=>{n.setFeatureColor(...i)})),this.d(this.setFeatureVisableEvent.don((...i)=>{n.setFeatureVisable(...i)})),this.d(this.resetFeatureStyleEvent.don((...i)=>{n.resetFeatureStyle(...i)})),this.d(this.setFeatureStyleEvent.don((...i)=>{n.setFeatureStyle(...i)})),this.d(this.flyInEvent.don((...i)=>{n.flyIn(i[0])})),this.d(this.flyToEvent.don((...i)=>{n.flyTo(i[0])})),this.d(this.calcFlyToParamEvent.don((...i)=>{n.calcFlyToParam(...i)})),this.d(this.calcFlyInParamEvent.don((...i)=>{n.calcFlyInParam(...i)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(i=>{this.tilesetReady.emit(i)})),this.d(n.pickedEvent.don(i=>{i.assign({sceneObject:this}),this.pickedEvent.emit(i)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get ids(){return this._ids.value}get idsChanged(){return this._ids.changed}set ids(e){this._ids.value=e}get useEarthDSToken(){return this._useEarthDSToken.value}get useEarthDSTokenChanged(){return this._useEarthDSToken.changed}set useEarthDSToken(e){this._useEarthDSToken.value=e}get earthdstoken(){return this._earthdstoken.value}get earthdstokenChanged(){return this._earthdstoken.changed}set earthdstoken(e){this._earthdstoken.value=e}get visJson(){return this._visJson.value}set visJson(e){this._visJson.value=e}get visJsonChanged(){return this._visJson.changed}setFeatureVisable(e,n){var i;if((i=this.layerConfig)!=null&&i.length){const s={};s[n[0].value]=n[0].visable,this.visJson={...this.visJson,...s}}else this.setFeatureVisableEvent.emit(e,typeof n=="string"?JSON.parse(n):n)}async getFeatureProperty(e){return await AP(this.baseUrl,this.tileServiceName,e,this.useEarthDSToken,this.earthdstoken)}async getLayerConfig(){const e=await TP(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken);return!e||!Array.isArray(e)?this.layerConfig=[]:this.layerConfig=e,this.layerConfig}async saveLayerConfig(){const e=this.layerConfig;return await OP(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,e)}get highlightInner3DtilesetEvent(){return this._highlightInner3DtilesetEvent}_highlightInner3Dtileset(e){this._highlightInner3DtilesetEvent.emit(e)}async highlightDSFeature(e){this._highlightInner3Dtileset(e)}get removeHighlightInner3DtilesetEvent(){return this._removeHighlightInner3DtilesetEvent}_removeHighlightInner3Dtileset(e){this._removeHighlightInner3DtilesetEvent.emit(e)}async removeHighlightDSFeature(e){this._removeHighlightInner3Dtileset(e)}async pickFeature(e,n){var a,u,l;const i=await e.pick(n),s=i.sceneObject;return!s||s.id!==this.id&&s.typeName!="ESRtsFeatureEditing"?void 0:s.typeName!="ESRtsFeatureEditing"?(this.ids=[...this.ids,(a=i==null?void 0:i.tilesetPickInfo)==null?void 0:a.id],{featureId:(u=i==null?void 0:i.tilesetPickInfo)==null?void 0:u.id,pickInnerFields:i==null?void 0:i.tilesetPickInfo}):{featureId:(l=i==null?void 0:i.sceneObject)==null?void 0:l.id,pickInnerFields:i==null?void 0:i.tilesetPickInfo}}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(e){this._tilesetServePort.value=e}async getport(){const e=await DP(this.url,this.useEarthDSToken,this.earthdstoken);if(e)return this.tilesetServePort=e,e;throw new Error("服务地址port获取失败!")}async refresh(){var i;if(!this.url||typeof this.url!="string")return;const e=(i=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:i[1],n=+new Date;if(e){const s=this.tileServiceIp,o=await this.getport();await this.getLayerConfig(),this._es3DTileset.url=`${s}:${o}/tiles/tileset.json?t=${n}`}console.log("3dtileset url:",this._es3DTileset.url)}get baseUrl(){var e;if(this.url&&typeof this.url=="string"){const n=(e=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:e[1];if(!n)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01");return n}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01")}get tileServiceName(){var e;if(this.url&&typeof this.url=="string"){const n=(e=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:e[1];if(!n)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01,");return n}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var e;if(this.url&&typeof this.url=="string"){const n=(e=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:e[1];if(!n)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01");return n}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Q([this,"layerConfig"],"图层配置",[],void 0,!0)]}}};d(Wa,"createDefaultProps",()=>({...vn.createDefaultProps(),layerConfig:g.reactJsonWithUndefined([])})),d(Wa,"type",Wa.register("ESRtsTileset",Wa,{chsName:"CIMRTS实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let ld=Wa;function LP(r){return typeof r=="number"&&!isNaN(r)}const Xa=class Xa extends vn{get json(){return{...this._innerGetJson(),show:this.show,materials:this.materials,changeMaterial:this.changeMaterial,props:this.props,rotation:this.rotation,offset:this.offset}}set json(t){this._innerSetJson(t)}async init(t,e){this.featureId=e;const n=await t.getFeatureProperty(e);this.uiShowprops=n.allFields.map(o=>({featureClassName:o.featureClassName,fields:o.fields.map(a=>({key:a.name,type:a.type,value:a.type!="Double"?a.value:LP(a.value)?Number(a.value.toFixed(3)):""}))})),this.datasetName=n.datasetName,t.setFeatureVisable("id",[{value:this.featureId,visable:!1}]),this.d(()=>{t.setFeatureVisable("id",[{value:this.featureId,visable:!0}])});const i=t.tileServiceIp,s=t.tilesetServePort;if(!s)throw new Error("ESRtsFeatureEditing: port is not defined");this.url=`${i}:${s}/featuretiles/${this.featureId}/tileset.json`,this.allowPicking=!0,this.d(this.pickedEvent.don(o=>{o.assign({sceneObject:t}),t.pickedEvent.emit(o)})),this.d(()=>{this.editing=!1,t.removeHighlightDSFeature(this)})}constructor(t){super(t)}};d(Xa,"createDefaultProps",()=>({...vn.createDefaultProps(),datasetName:void 0,featureId:void 0,materials:g.reactJson({}),changeMaterial:g.reactJsonWithUndefined(void 0),uiShowprops:g.reactJson({}),props:g.reactJson({})})),d(Xa,"type",Xa.register("ESRtsFeatureEditing",Xa,{chsName:"ESRtsFeatureEditing",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let hd=Xa;const RP=async(r,t,e)=>{try{const n=window.localStorage.getItem("Authorization");let i=r;t&&(i+=`?earthdstoken=${encodeURIComponent(e)}`);const s={headers:{...!t&&n?{Authorization:n}:{}},mode:"cors"},a=await(await fetch(i,s)).text(),u=JSON.parse(a);if(u.status=="ok")return u.data.port;console.error(u.status);return}catch(n){console.error(n)}},ll=class ll extends vn{constructor(e){super(e);d(this,"_es3DTileset",this.dv(new vn));d(this,"_tilesetServePort",this.dv(g.react("")));d(this,"_useEarthDSToken",this.dv(g.react(!1)));d(this,"_earthdstoken",this.dv(g.react("")));{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ms01");return}this.url?this.refresh():this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(g.track([n,"allowPicking"],[this,"allowPicking"])),this.d(g.track([n,"collision"],[this,"collision"])),this.d(g.bind([n,"flyToParam"],[this,"flyToParam"])),this.d(g.bind([n,"flyToParam"],[this,"flyToParam"])),this.d(g.track([n,"actorTag"],[this,"actorTag"])),this.d(g.track([n,"materialMode"],[this,"materialMode"])),this.d(g.track([n,"highlight"],[this,"highlight"])),this.d(g.track([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(g.track([n,"highlightID"],[this,"highlightID"])),this.d(g.track([n,"highlightColor"],[this,"highlightColor"])),this.d(g.bind([n,"offset"],[this,"offset"])),this.d(g.bind([n,"rotation"],[this,"rotation"])),this.d(g.track([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(g.track([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(g.track([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(g.track([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(g.track([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(g.track([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(g.track([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(g.track([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(g.track([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(g.track([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(g.track([n,"cacheBytes"],[this,"cacheBytes"])),this.d(g.track([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(g.track([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(g.track([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(g.track([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(g.track([n,"materialParams"],[this,"materialParams"])),this.d(g.bind([n,"supportEdit"],[this,"supportEdit"])),this.d(g.bind([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(g.bind([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(g.bind([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(g.bind([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(g.bind([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(g.bind([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...i)=>{n.highlightFeature(...i)})),this.d(this.highlightFeatureAndFlyToEvent.don((...i)=>{n.highlightFeatureAndFlyTo(...i)})),this.d(this.setFeatureColorEvent.don((...i)=>{n.setFeatureColor(...i)})),this.d(this.setFeatureVisableEvent.don((...i)=>{n.setFeatureVisable(...i)})),this.d(this.resetFeatureStyleEvent.don((...i)=>{n.resetFeatureStyle(...i)})),this.d(this.flyInEvent.don((...i)=>{n.flyIn(i[0])})),this.d(this.flyToEvent.don((...i)=>{n.flyTo(i[0])})),this.d(this.calcFlyToParamEvent.don((...i)=>{n.calcFlyToParam(...i)})),this.d(this.calcFlyInParamEvent.don((...i)=>{n.calcFlyInParam(...i)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(i=>{this.tilesetReady.emit(i)})),this.d(n.pickedEvent.don(i=>{i.assign({sceneObject:this}),this.pickedEvent.emit(i)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(e){this._tilesetServePort.value=e}get useEarthDSToken(){return this._useEarthDSToken.value}get useEarthDSTokenChanged(){return this._useEarthDSToken.changed}set useEarthDSToken(e){this._useEarthDSToken.value=e}get earthdstoken(){return this._earthdstoken.value}get earthdstokenChanged(){return this._earthdstoken.changed}set earthdstoken(e){this._earthdstoken.value=e}async getport(){const e=await RP(this.url,this.useEarthDSToken,this.earthdstoken);if(e)return this.tilesetServePort=e,e;throw new Error("服务地址port获取失败!")}async refresh(){var i;if(!this.url||typeof this.url!="string")return;const e=(i=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:i[1],n=+new Date;if(e){const s=this.tileServiceIp,o=await this.getport();this._es3DTileset.url=`${s}:${o}/tiles/tileset.json?t=${n}`}console.log("3dtileset url:",this._es3DTileset.url)}get baseUrl(){var e;if(this.url&&typeof this.url=="string"){const n=(e=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:e[1];if(!n)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var e;if(this.url&&typeof this.url=="string"){const n=(e=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:e[1];if(!n)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceName(){var e;if(this.url&&typeof this.url=="string"){const n=(e=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:e[1];if(!n)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01,");return n}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01")}};d(ll,"type",ll.register("ESMsTileset",ll,{chsName:"Modelser实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let cd=ll;const qv={defaultValue:[{type:"2",widget:"WidgetBlueprint'/ESFoliage/PoiSheng.PoiSheng'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"3",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"4",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"5",widget:"WidgetBlueprint'/ESFoliage/PoiXiang.PoiXiang'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"6",widget:"WidgetBlueprint'/ESFoliage/PoiCun.PoiCun'",povit:[.5,1],worldScale:.1,hiddenDistance:40}],sampleValue:`
338
358
  ## 参数类型为 ESPoiType[]
339
359
  \`\`\`js
340
360
  type Vector2D = [number, number]
@@ -347,7 +367,7 @@ ${Jv}
347
367
  hiddenDistance: number
348
368
  }
349
369
  \`\`\`
350
- `},Uo=class Uo extends ee{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new gt([],"通用"),new ut([this,"url"],"路径"),new ut([this,"poiTypes"],Uo.defaults.poiTypes,Qv.sampleValue),new L([this,"heightOffset"])]}}};g(Uo,"createDefaultProps",()=>({...ee.createDefaultProps(),url:"",poiTypes:d.reactJsonWithUndefined(Qv.defaultValue),heightOffset:40})),g(Uo,"type",Uo.register("ESPoiTileset",Uo,{chsName:"ESPoiTileset",tags:["ESObjects","_ES_Impl_UE"],description:"ESPoiTileset"}));let Ld=Uo;const uu=class uu extends ht{getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new gt([],"通用","通用"),new $([this,"show"],"是否显示"),new bt([this,"screenPosition"],[["left","left"],["right","right"]],"定位","right"),new Ve([this,"cssPosition"],"位置")]}}};g(uu,"createDefaultProps",()=>({...ht.createDefaultProps(),show:!0,screenPosition:"right",cssPosition:[40,30]})),g(uu,"type",uu.register("ESScale",uu,{chsName:"比例尺",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"比例尺"}));let Rd=uu;const Xi=class Xi extends ie{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new L([this,"height"],"高度",Xi.defaults.height,!0),new L([this,"extrudedHeight"],"拉伸高度",Xi.defaults.extrudedHeight,!0),new $([this,"perPositionHeight"],"应用每个位置高度",Xi.defaults.perPositionHeight,!0)]}}};g(Xi,"createDefaultProps",()=>({...ie.createDefaultProps(),height:0,extrudedHeight:10,perPositionHeight:!1,collision:!1})),g(Xi,"type",Xi.register("ESGeoExtrudedPolygon",Xi,{chsName:"拉升多边形体",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"拉升多边形体"})),g(Xi,"supportEditingModes",[...ie.supportEditingModes,lt.HeightModify]);let ml=Xi;const zo=class zo extends ie{constructor(e){super(e);g(this,"_classification",this.dv(new kh));g(this,"_geoExtrudedPolygon",this.dv(new ml));this.mainClass=this._geoExtrudedPolygon,this.d(this.components.disposableAdd(this._classification)),this.d(this.components.disposableAdd(this._geoExtrudedPolygon));{const{_classification:n,_geoExtrudedPolygon:i}=this;i.perPositionHeight=!0,this.d(d.track([n,"collision"],[this,"collision"])),this.d(d.track([i,"collision"],[this,"collision"])),this.d(d.bind([i,"flyInParam"],[this,"flyInParam"])),this.d(d.bind([i,"flyToParam"],[this,"flyToParam"])),this.d(d.bind([i,"points"],[this,"points"])),this.d(d.bind([i,"extrudedHeight"],[this,"height"])),this.d(d.bind([n,"fillColor"],[this,"overheightColor"])),this.d(d.bind([i,"fillColor"],[this,"standardColor"]));{const s=()=>{const{height:a,points:u,maxHeight:l}=this;if(!u)return;const h=u.map(c=>[c[0],c[1],a]);n.points=h,n.height=l-a,l-a<=0?n.show=!1:n.show=this.show&&this.filled};s();const o=this.dv(d.createNextAnimateFrameEvent(this.heightChanged,this.pointsChanged,this.maxHeightChanged));this.d(o.don(s))}{const s=()=>{const{show:a,filled:u}=this;n.show=a&&u,i.show=a&&u};s();const o=this.dv(d.createNextAnimateFrameEvent(this.showChanged,this.filledChanged));this.d(o.don(s))}this.dispose(this.flyInEvent.don(s=>{i.flyIn(s)})),this.dispose(this.flyToEvent.don(s=>{i.flyTo(s)})),this.dispose(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.dispose(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}}get classification(){return this._classification}get geoExtrudedPolygon(){return this._geoExtrudedPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new L([this,"height"],"高度",10),new L([this,"maxHeight"],"最高高度",200),new Rt([this,"overheightColor"],"超高颜色",[1,0,0,.5]),new Rt([this,"standardColor"],"标准颜色",[0,1,0,.5])]}}};g(zo,"createDefaultProps",()=>({...ie.createDefaultProps(),height:10,maxHeight:200,overheightColor:[1,0,0,.5],standardColor:[0,1,0,.5]})),g(zo,"type",zo.register("ESHeightLimitAnalysis",zo,{chsName:"控高分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"控高分析对象"})),g(zo,"supportEditingModes",[...ie.supportEditingModes,lt.HeightModify]);let Fd=zo;const yi=class yi extends ee{constructor(e){super(e);g(this,"_widgetEvent",this.dv(new d.Event));g(this,"_data",this.dv(d.react(void 0)));{const n=()=>{this.url&&(typeof this.url=="object"?this.data=this.url:Bv(this.url)?this.data=JSON.parse(this.url):fetch(ht.context.getStrFromEnv(this.url)).then(i=>i.json()).then(i=>{this.data=i}).catch(i=>{console.warn("ESEntityCluster数据加载失败",i)}))};n(),this.d(this.urlChanged.don(n))}}get widgetEvent(){return this._widgetEvent}get data(){return this._data.value}set data(e){this._data.value=e}get dataChanged(){return this._data.changed}getFeatures(){if(this._data)return this._data;console.log("数据未加载完成,请稍后重试")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ut([this,"url"],"地址",yi.defaults.url),new L([this,"pixelRange"],"集合范围",yi.defaults.pixelRange),new L([this,"minimumClusterSize"],"最小数量",yi.defaults.minimumClusterSize),new bt([this,"heightReference"],[["None","None"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["CLAMP_TO_TERRAIN","CLAMP_TO_TERRAIN"]],"高度模式","None")],more:[...e.more,new ut([this,"style"],"style",yi.defaults.style),new $([this,"perspective"],"透视效果",yi.defaults.perspective)]}}};g(yi,"createDefaultProps",()=>({...ee.createDefaultProps(),url:"",pixelRange:200,minimumClusterSize:2,style:d.reactJsonWithUndefined({cluster:[{minValue:2,mode:"SquareV02",style:{}}],nonCluster:{mode:"SquareV03",style:{}}}),heightReference:"None",perspective:!1})),g(yi,"type",yi.register("ESEntityCluster",yi,{chsName:"Poi聚合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于聚合POI标注,提高性能。"}));let Gd=yi;class yl extends d.Destroyable{constructor(){super();g(this,"_player",this.disposeVar(new ci));const e=this._player;{const n=()=>{const i=(this.stopTime??0)-(this.startTime??0);e.duration=i>0?i:0};n(),this.d(this.startTimeChanged.don(n)),this.d(this.stopTimeChanged.don(n))}this.d(d.bind([e,"playing"],[this,"playing"])),this.d(d.bind([e,"loop"],[this,"loop"])),this.d(d.bind([e,"speed"],[this,"speed"])),this.d(e.currentTimeChanged.don(()=>{this.startTime!==void 0&&e.currentTime!==void 0&&(this.currentTime=e.currentTime+this.startTime)})),this.d(this.currentTimeChanged.don(()=>{if(this.currentTime===void 0||this.startTime===void 0)return;const n=this.currentTime-this.startTime;e.currentTime=d.clamp(n,0,e.duration)}))}get player(){return this._player}get ratio(){return this._player.ratio}get ratioChanged(){return this._player.ratioChanged}set ratio(e){this._player.ratio=e}}(r=>{r.createDefaultProps=()=>({...ht.createDefaultProps(),currentTime:void 0,startTime:void 0,stopTime:void 0,playing:void 0,loop:void 0,speed:void 0})})(yl||(yl={})),d.extendClassProps(yl.prototype,yl.createDefaultProps);const lu=class lu extends ht{constructor(e){super(e);g(this,"_absolutePlayer",this.dv(new yl));const n=this.absolutePlayer;this.d(d.bind([n,"currentTime"],[this,"currentTime"])),this.d(d.bind([n,"startTime"],[this,"startTime"])),this.d(d.bind([n,"stopTime"],[this,"stopTime"])),this.d(d.bind([n,"playing"],[this,"playing"])),this.d(d.bind([n,"loop"],[this,"loop"])),this.d(d.bind([n,"speed"],[this,"speed"]))}get absolutePlayer(){return this._absolutePlayer}get ratio(){return this._absolutePlayer.ratio}get ratioChanged(){return this._absolutePlayer.ratioChanged}set ratio(e){this._absolutePlayer.ratio=e}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Dl([this,"playing"],[this,"ratio"],[this,"loop"],"播放器"),new ro([this,"currentTime"],"currentTime"),new ro([this,"startTime"]),new ro([this,"stopTime"]),new $([this,"playing"]),new $([this,"loop"]),new L([this,"speed"])]}}};g(lu,"createDefaultProps",()=>({...ht.createDefaultProps(),currentTime:0,startTime:0,stopTime:0,playing:!1,loop:!1,speed:1})),g(lu,"type",lu.register("ESPlayer",lu,{chsName:"ESPlayer",tags:["ESObjects","_ES_Impl_UE"],description:"ESPlayer"}));let _l=lu;function Kv(r,t=!1){const e=r.map(i=>[i[0],[...i[1]],i[2]?[...i[2]]:void 0]),n=e.length;if(n===0)return e;if(n===1)return(!e[0][2]===void 0||t)&&(e[0][2]=void 0),e;for(let i=1;i<n;++i){if(e[i][2]!==void 0&&!t)continue;const s=e[i-1][1],o=e[i][1],a=Gi(s),u=Gi(o),l=d.Vector.distance(a,u);if(l===0){e[i][2]=e[i-1][2];continue}const h=Eh(s,o),c=o[2]-s[2],f=Math.asin(c/l)*180/Math.PI,p=Number.isFinite(h)?h:0,v=Number.isFinite(f)?f:0;e[i][2]=[p,v,0]}return(e[0][2]===void 0||t)&&(e[0][2]=n>1?e[1][2]:void 0),e}function Zv(r,t=!1){const e=r.map(i=>[i[0],[...i[1]],i[2]?[...i[2]]:void 0]),n=e.length;if(n===0)return e;if(n===1)return(!e[0][2]===void 0||t)&&(e[0][2]=void 0),e;for(let i=n-2;i>=0;--i){if(e[i][2]!==void 0&&!t)continue;const s=e[i][1],o=e[i+1][1],a=Gi(s),u=Gi(o),l=d.Vector.distance(a,u);if(l===0){e[i][2]=e[i+1][2];continue}const h=Eh(s,o),c=o[2]-s[2],f=Math.asin(c/l)*180/Math.PI,p=Number.isFinite(h)?h:0,v=Number.isFinite(f)?f:0;e[i][2]=[p,v,0]}return(e[n-1][2]===void 0||t)&&(e[n-1][2]=n>1?e[n-2][2]:[0,0,0]),e}function mI(r,t=!1){const e=Kv(r,t),n=Zv(r,t);if(e.length!==n.length)throw new Error("p.length !== n.length");const i=e.length;for(let s=0;s<i;s++){const o=e[s][2],a=n[s][2];o===void 0&&a===void 0?e[s][2]=void 0:o===void 0?e[s][2]=a:a===void 0?e[s][2]=o:e[s][2]=Sf(o,a,.5)}return e}function yI(r,t,e){let i;if(!r.timePosRots)return;const s=[],o=r.timePosRots.length;if(!(o<=2)){s.push(r.timePosRots[0]);for(let a=1;a<o-1;++a){const u=r.timePosRots[a-1][0],l=r.timePosRots[a][0],h=r.timePosRots[a+1][0],c=r.accumDistances[a-1],f=r.accumDistances[a],p=r.accumDistances[a+1],v=f-c;if(v!==0){const w=v-(i??(t.length==1?t[0]:t[a-1]||t[t.length-1])*.5);let I=(w<0?0:w)/v;Number.isNaN(I)&&(I=0);const y=(1-I)*u+I*l,E=r.getCurrent(y);E&&s.push([y,E.position,E.rotation])}e&&s.push(r.timePosRots[a]);const _=p-f;if(_!==0){let w=(t.length==1?t[0]:t[a-1]||t[t.length-1])*.5;const I=(t.length==1?t[0]:t[a]||t[t.length-1])*.5||0;w+I>_?(w=_*(w/(w+I)),i=_-w):i=void 0;let y=(w<0?0:w)/_;const E=(1-y)*l+y*h,m=r.getCurrent(E);m&&s.push([E,m.position,m.rotation])}}s.push(r.timePosRots[o-1]),r.timePosRots=s}}function $v(r,t){if(t<0)return[void 0,0];if(t>r.length-1)return[void 0,r.length-1];const e=[...r].slice(0,t+1).reverse().findIndex(i=>!!(i!=null&&i[2]));if(e===-1)return[void 0,0];const n=t-e;return[r[n][2],n]}function jv(r,t){if(t<0)return[void 0,0];if(t>=r.length)return[void 0,r.length-1];const e=r.slice(t).findIndex(([,,i])=>i!==void 0),n=e===-1?r.length-1:t+e;return[r[n][2],n]}function _I(r,t,e="Lerp"){let n,i,s,o;if(r.length!==0){if(t<=r[0][0])n=r[0][1],i=r[0][2],s=0,o=0;else if(t>=r[r.length-1][0]){const[u,l,h]=r[r.length-1];n=l,i=h,s=r.length-2,o=1}else{const u=r.findIndex(([l])=>t<=l);if(u===-1)throw new Error("nextIndex === -1");s=u-1;{const[l,h]=r[s],[c,f]=r[u],p=(t-l)/(c-l),v=wf(h),_=wf(f),w=d.Vector.lerp(v,_,p);n=Ev(w),o=p}{let[l,h]=$v(r,s),[c,f]=jv(r,u);if(e==="Lerp")if(l&&c){if(h<0||f>=r.length)throw new Error("Invalid rotation index");const p=(t-r[h][0])/(r[f][0]-r[h][0]);i=Sf(l,c,p)}else l?i=l:c?i=c:i=void 0;else e==="Prev"?l&&(i=l):e==="Next"&&c&&(i=c)}}return{position:n,rotation:i,index:s,ratio:o}}}function EI(r){try{const t=JSON.parse(r);if(Array.isArray(t)&&t.length>0){const e=typeof t[0][0]=="number",n=Array.isArray(t[0][1])&&t[0][1].length===3;return e&&n?t:void 0}throw new Error("解析有问题")}catch{const e=r.split(/\n|\r\n/),n=[],i=e.length;for(let s=0;s<i;++s){const o=e[s],a=o.split(/[^0-9e\.\+\-]+/).filter(u=>u!=="").map(u=>+u);a.length<4?console.warn(`第${s+1}行数据无法解析成路径的数据, 原内容为: ${o}`):a.length<7?n.push([a[0],[a[1],a[2],a[3]],void 0]):n.push([a[0],[a[1],a[2],a[3]],[a[4],a[5],a[6]]])}return n}}function wI(r,t,e){const{timePosRots:n}=r;if(!n)throw new Error("!timePosRots");if(n.length===0)throw new Error("timePosRots.length === 0");t=Math.max(t,n[0][0]),e=Math.min(e,n[n.length-1][0]);const i=r.getCurrent(t),s=r.getCurrent(e);if(!i||!s)return;const o=[];i.ratio<1&&o.push([t,i.position,i.rotation]);for(let a=i.index+1;a<=s.index;++a)o.push(n[a]);return s.ratio>0&&o.push([e,s.position,s.rotation]),o}const SI=`
370
+ `},mo=class mo extends Dt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new nt([],"通用"),new Q([this,"url"],"路径"),new Q([this,"poiTypes"],mo.defaults.poiTypes,qv.sampleValue),new T([this,"heightOffset"])]}}};d(mo,"createDefaultProps",()=>({...Dt.createDefaultProps(),url:"",poiTypes:g.reactJsonWithUndefined(qv.defaultValue),heightOffset:40})),d(mo,"type",mo.register("ESPoiTileset",mo,{chsName:"ESPoiTileset",tags:["ESObjects","_ES_Impl_UE"],description:"ESPoiTileset"}));let fd=mo;const Ba=class Ba extends K{getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new nt([],"通用","通用"),new W([this,"show"],"是否显示"),new pt([this,"screenPosition"],[["left","left"],["right","right"]],"定位","right"),new _e([this,"cssPosition"],"位置")]}}};d(Ba,"createDefaultProps",()=>({...K.createDefaultProps(),show:!0,screenPosition:"right",cssPosition:[40,30]})),d(Ba,"type",Ba.register("ESScale",Ba,{chsName:"比例尺",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"比例尺"}));let dd=Ba;const Si=class Si extends Ut{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new T([this,"height"],"高度",Si.defaults.height,!0),new T([this,"extrudedHeight"],"拉伸高度",Si.defaults.extrudedHeight,!0),new W([this,"perPositionHeight"],"应用每个位置高度",Si.defaults.perPositionHeight,!0)]}}};d(Si,"createDefaultProps",()=>({...Ut.createDefaultProps(),height:0,extrudedHeight:10,perPositionHeight:!1,collision:!1})),d(Si,"type",Si.register("ESGeoExtrudedPolygon",Si,{chsName:"拉升多边形体",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"拉升多边形体"})),d(Si,"supportEditingModes",[...Ut.supportEditingModes,$.HeightModify]);let eo=Si;const vo=class vo extends Ut{constructor(e){super(e);d(this,"_classification",this.dv(new _h));d(this,"_geoExtrudedPolygon",this.dv(new eo));this.d(this.components.disposableAdd(this._classification)),this.d(this.components.disposableAdd(this._geoExtrudedPolygon,!0));{const{_classification:n,_geoExtrudedPolygon:i}=this;i.perPositionHeight=!0,this.d(g.track([n,"collision"],[this,"collision"])),this.d(g.track([i,"collision"],[this,"collision"])),this.d(g.bind([i,"flyInParam"],[this,"flyInParam"])),this.d(g.bind([i,"flyToParam"],[this,"flyToParam"])),this.d(g.bind([i,"points"],[this,"points"])),this.d(g.bind([i,"extrudedHeight"],[this,"height"])),this.d(g.bind([n,"fillColor"],[this,"overheightColor"])),this.d(g.bind([i,"fillColor"],[this,"standardColor"]));{const s=()=>{const{height:o,points:a,maxHeight:u}=this;if(!a)return;const l=a.map(h=>[h[0],h[1],o]);n.points=l,n.height=u-o,u-o<=0?n.show=!1:n.show=this.show&&this.filled};s(),this.d(Co([this.heightChanged,this.pointsChanged,this.maxHeightChanged],s))}{const s=()=>{const{show:o,filled:a}=this;n.show=o&&a,i.show=o&&a};s(),this.d(Co([this.showChanged,this.filledChanged],s))}this.d(this.flyInEvent.don(s=>{i.flyIn(s)})),this.d(this.flyToEvent.don(s=>{i.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}}get classification(){return this._classification}get geoExtrudedPolygon(){return this._geoExtrudedPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new T([this,"height"],"高度",10),new T([this,"maxHeight"],"最高高度",200),new _t([this,"overheightColor"],"超高颜色",[1,0,0,.5]),new _t([this,"standardColor"],"标准颜色",[0,1,0,.5])]}}};d(vo,"createDefaultProps",()=>({...Ut.createDefaultProps(),height:10,maxHeight:200,overheightColor:[1,0,0,.5],standardColor:[0,1,0,.5]})),d(vo,"type",vo.register("ESHeightLimitAnalysis",vo,{chsName:"控高分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"控高分析对象"})),d(vo,"supportEditingModes",[...Ut.supportEditingModes,$.HeightModify]);let pd=vo;const Qn=class Qn extends Dt{constructor(e){super(e);d(this,"_widgetEvent",this.dv(new V));d(this,"_data",this.dv(g.react(void 0)));{const n=()=>{this.url&&(typeof this.url=="object"?this.data=this.url:Xh(this.url)?this.data=JSON.parse(this.url):fetch(K.context.getStrFromEnv(this.url)).then(i=>i.json()).then(i=>{this.data=i}).catch(i=>{console.warn("ESEntityCluster数据加载失败",i)}))};n(),this.d(this.urlChanged.don(n))}}get widgetEvent(){return this._widgetEvent}get data(){return this._data.value}set data(e){this._data.value=e}get dataChanged(){return this._data.changed}getFeatures(){if(this._data)return this._data;console.log("数据未加载完成,请稍后重试")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Q([this,"url"],"地址",Qn.defaults.url),new T([this,"pixelRange"],"集合范围",Qn.defaults.pixelRange),new T([this,"minimumClusterSize"],"最小数量",Qn.defaults.minimumClusterSize),new pt([this,"heightReference"],[["None","None"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["CLAMP_TO_TERRAIN","CLAMP_TO_TERRAIN"]],"高度模式","None")],more:[...e.more,new Q([this,"style"],"style",Qn.defaults.style),new W([this,"perspective"],"透视效果",Qn.defaults.perspective)]}}};d(Qn,"createDefaultProps",()=>({...Dt.createDefaultProps(),url:"",pixelRange:200,minimumClusterSize:2,style:g.reactJsonWithUndefined({cluster:[{minValue:2,mode:"SquareV02",style:{}}],nonCluster:{mode:"SquareV03",style:{}}}),heightReference:"None",perspective:!1})),d(Qn,"type",Qn.register("ESEntityCluster",Qn,{chsName:"Poi聚合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于聚合POI标注,提高性能。"}));let gd=Qn;class nl extends B{constructor(){super();d(this,"_player",this.disposeVar(new Mn));const e=this._player;{const n=()=>{const i=(this.stopTime??0)-(this.startTime??0);e.duration=i>0?i:0};n(),this.d(this.startTimeChanged.don(n)),this.d(this.stopTimeChanged.don(n))}this.d(g.bind([e,"playing"],[this,"playing"])),this.d(g.bind([e,"loop"],[this,"loop"])),this.d(g.bind([e,"speed"],[this,"speed"])),this.d(e.currentTimeChanged.don(()=>{this.startTime!==void 0&&e.currentTime!==void 0&&(this.currentTime=e.currentTime+this.startTime)})),this.d(this.currentTimeChanged.don(()=>{if(this.currentTime===void 0||this.startTime===void 0)return;const n=this.currentTime-this.startTime;e.currentTime=g.clamp(n,0,e.duration)}))}get player(){return this._player}get ratio(){return this._player.ratio}get ratioChanged(){return this._player.ratioChanged}set ratio(e){this._player.ratio=e}}(r=>{r.createDefaultProps=()=>({...K.createDefaultProps(),currentTime:void 0,startTime:void 0,stopTime:void 0,playing:void 0,loop:void 0,speed:void 0})})(nl||(nl={})),g.extendClassProps(nl.prototype,nl.createDefaultProps);const Ha=class Ha extends K{constructor(e){super(e);d(this,"_absolutePlayer",this.dv(new nl));const n=this.absolutePlayer;this.d(g.bind([n,"currentTime"],[this,"currentTime"])),this.d(g.bind([n,"startTime"],[this,"startTime"])),this.d(g.bind([n,"stopTime"],[this,"stopTime"])),this.d(g.bind([n,"playing"],[this,"playing"])),this.d(g.bind([n,"loop"],[this,"loop"])),this.d(g.bind([n,"speed"],[this,"speed"]))}get absolutePlayer(){return this._absolutePlayer}get ratio(){return this._absolutePlayer.ratio}get ratioChanged(){return this._absolutePlayer.ratioChanged}set ratio(e){this._absolutePlayer.ratio=e}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new cl([this,"playing"],[this,"ratio"],[this,"loop"],"播放器"),new Os([this,"currentTime"],"currentTime"),new Os([this,"startTime"]),new Os([this,"stopTime"]),new W([this,"playing"]),new W([this,"loop"]),new T([this,"speed"])]}}};d(Ha,"createDefaultProps",()=>({...K.createDefaultProps(),currentTime:0,startTime:0,stopTime:0,playing:!1,loop:!1,speed:1})),d(Ha,"type",Ha.register("ESPlayer",Ha,{chsName:"ESPlayer",tags:["ESObjects","_ES_Impl_UE"],description:"ESPlayer"}));let _a=Ha;function Wv(r,t=!1){const e=r.map(i=>[i[0],[...i[1]],i[2]?[...i[2]]:void 0]),n=e.length;if(n===0)return e;if(n===1)return(!e[0][2]===void 0||t)&&(e[0][2]=void 0),e;for(let i=1;i<n;++i){if(e[i][2]!==void 0&&!t)continue;const s=e[i-1][1],o=e[i][1],a=ei(s),u=ei(o),l=g.Vector.distance(a,u);if(l===0){e[i][2]=e[i-1][2];continue}const h=Qu(s,o),c=o[2]-s[2],f=Math.asin(c/l)*180/Math.PI,p=Number.isFinite(h)?h:0,m=Number.isFinite(f)?f:0;e[i][2]=[p,m,0]}return(e[0][2]===void 0||t)&&(e[0][2]=n>1?e[1][2]:void 0),e}function Xv(r,t=!1){const e=r.map(i=>[i[0],[...i[1]],i[2]?[...i[2]]:void 0]),n=e.length;if(n===0)return e;if(n===1)return(!e[0][2]===void 0||t)&&(e[0][2]=void 0),e;for(let i=n-2;i>=0;--i){if(e[i][2]!==void 0&&!t)continue;const s=e[i][1],o=e[i+1][1],a=ei(s),u=ei(o),l=g.Vector.distance(a,u);if(l===0){e[i][2]=e[i+1][2];continue}const h=Qu(s,o),c=o[2]-s[2],f=Math.asin(c/l)*180/Math.PI,p=Number.isFinite(h)?h:0,m=Number.isFinite(f)?f:0;e[i][2]=[p,m,0]}return(e[n-1][2]===void 0||t)&&(e[n-1][2]=n>1?e[n-2][2]:[0,0,0]),e}function FP(r,t=!1){const e=Wv(r,t),n=Xv(r,t);if(e.length!==n.length)throw new Error("p.length !== n.length");const i=e.length;for(let s=0;s<i;s++){const o=e[s][2],a=n[s][2];o===void 0&&a===void 0?e[s][2]=void 0:o===void 0?e[s][2]=a:a===void 0?e[s][2]=o:e[s][2]=Bh(o,a,.5)}return e}function kP(r,t,e){let i;if(!r.timePosRots)return;const s=[],o=r.timePosRots.length;if(!(o<=2)){s.push(r.timePosRots[0]);for(let a=1;a<o-1;++a){const u=r.timePosRots[a-1][0],l=r.timePosRots[a][0],h=r.timePosRots[a+1][0],c=r.accumDistances[a-1],f=r.accumDistances[a],p=r.accumDistances[a+1],m=f-c;if(m!==0){const E=m-(i??(t.length==1?t[0]:t[a-1]||t[t.length-1])*.5);let C=(E<0?0:E)/m;Number.isNaN(C)&&(C=0);const v=(1-C)*u+C*l,y=r.getCurrent(v);y&&s.push([v,y.position,y.rotation])}e&&s.push(r.timePosRots[a]);const _=p-f;if(_!==0){let E=(t.length==1?t[0]:t[a-1]||t[t.length-1])*.5;const C=(t.length==1?t[0]:t[a]||t[t.length-1])*.5||0;E+C>_?(E=_*(E/(E+C)),i=_-E):i=void 0;let v=(E<0?0:E)/_;Number.isNaN(v)&&(v=0);const y=(1-v)*l+v*h,w=r.getCurrent(y);w&&s.push([y,w.position,w.rotation])}}s.push(r.timePosRots[o-1]),r.timePosRots=s}}function Bv(r,t){if(t<0)return[void 0,0];if(t>r.length-1)return[void 0,r.length-1];const e=[...r].slice(0,t+1).reverse().findIndex(i=>!!(i!=null&&i[2]));if(e===-1)return[void 0,0];const n=t-e;return[r[n][2],n]}function Hv(r,t){if(t<0)return[void 0,0];if(t>=r.length)return[void 0,r.length-1];const e=r.slice(t).findIndex(([,,i])=>i!==void 0),n=e===-1?r.length-1:t+e;return[r[n][2],n]}function VP(r,t,e="Lerp"){let n,i,s,o;if(r.length!==0){if(t<=r[0][0])n=r[0][1],i=r[0][2],s=0,o=0;else if(t>=r[r.length-1][0]){const[u,l,h]=r[r.length-1];n=l,i=h,s=r.length-2,o=1}else{const u=r.findIndex(([l])=>t<=l);if(u===-1)throw new Error("nextIndex === -1");s=u-1;{const[l,h]=r[s],[c,f]=r[u],p=(t-l)/(c-l),m=af(h),_=af(f),E=g.Vector.lerp(m,_,p);n=Kp(E),o=p}{let[l,h]=Bv(r,s),[c,f]=Hv(r,u);if(e==="Lerp")if(l&&c){if(h<0||f>=r.length)throw new Error("Invalid rotation index");const p=(t-r[h][0])/(r[f][0]-r[h][0]);i=Bh(l,c,p)}else l?i=l:c?i=c:i=void 0;else e==="Prev"?l&&(i=l):e==="Next"&&c&&(i=c)}}return{position:n,rotation:i,index:s,ratio:o}}}function UP(r){try{const t=JSON.parse(r);if(Array.isArray(t)&&t.length>0){const e=typeof t[0][0]=="number",n=Array.isArray(t[0][1])&&t[0][1].length===3;return e&&n?t:void 0}throw new Error("解析有问题")}catch{const e=r.split(/\n|\r\n/),n=[],i=e.length;for(let s=0;s<i;++s){const o=e[s],a=o.split(/[^0-9e\.\+\-]+/).filter(u=>u!=="").map(u=>+u);a.length<4?console.warn(`第${s+1}行数据无法解析成路径的数据, 原内容为: ${o}`):a.length<7?n.push([a[0],[a[1],a[2],a[3]],void 0]):n.push([a[0],[a[1],a[2],a[3]],[a[4],a[5],a[6]]])}return n}}function zP(r,t,e){const{timePosRots:n}=r;if(!n)throw new Error("!timePosRots");if(n.length===0)throw new Error("timePosRots.length === 0");t=Math.max(t,n[0][0]),e=Math.min(e,n[n.length-1][0]);const i=r.getCurrent(t),s=r.getCurrent(e);if(!i||!s)return;const o=[];i.ratio<1&&o.push([t,i.position,i.rotation]);for(let a=i.index+1;a<=s.index;++a)o.push(n[a]);return s.ratio>0&&o.push([e,s.position,s.rotation]),o}const GP=`
351
371
  timePosRots是一个内部包含三个元素的数组,第一个表示时间戳,单位毫秒,第二个表示经纬度,第三个表示姿态(偏航、俯仰、翻转)。示例代码如下:
352
372
  \`\`\`
353
373
  [
@@ -392,7 +412,7 @@ timePosRots是一个内部包含三个元素的数组,第一个表示时间戳
392
412
  ]
393
413
  ]
394
414
  \`\`\`
395
- `,Fr=class Fr extends d.Destroyable{constructor(e,n){super();g(this,"_scratchCurrentInfo",{position:[0,0,0],rotation:[0,0,0],index:0});g(this,"_currentInfo",this.disposeVar(d.react(void 0,(e,n)=>!1)));g(this,"_player");g(this,"_flyToEvent",this.disposeVar(new d.Event));g(this,"_accumDistancesChanged",this.disposeVar(new d.Event));g(this,"_accumDistancesChangedInit",this.dispose(this.timePosRotsChanged.disposableOn(()=>(this._accumDistancesDirty=!0,this._accumDistancesChanged.emit()))));g(this,"_accumDistancesDirty",!1);g(this,"_accumDistances",[]);g(this,"_getCurrentFunc",this.disposeVar(d.react(void 0)));this._player=this.disposeVar(new ci);const i=()=>{const s=this.getCurrent(this.currentTime??0);if(s===void 0)this._currentInfo.value=void 0;else{const{index:o,position:a,rotation:u,ratio:l}=s;this._scratchCurrentInfo.index=o,this._scratchCurrentInfo.position=a,this._scratchCurrentInfo.rotation=u,this._scratchCurrentInfo.ratio=l,this._currentInfo.value=this._scratchCurrentInfo}};i(),this.currentTimeChanged.disposableOn(i),this.timePosRotsChanged.disposableOn(i),this.rotLerpModeChanged.disposableOn(i),this.dispose(d.bind([this._player,"loop"],[this,"loop"]));{const s=()=>{if(this.startTime===void 0||this.currentTime===void 0)return;const o=this.currentTime-this.startTime;(this._player.currentTime===void 0||Math.abs(o-this._player.currentTime)>.01)&&(this._player.currentTime=o)};s(),this.dispose(this.currentTimeChanged.disposableOn(s))}{const s=()=>{if(this.startTime===void 0||this._player.currentTime===void 0)return;const o=this._player.currentTime+this.startTime;(this.currentTime===void 0||Math.abs(o-this.currentTime)>.01)&&(this.currentTime=o)};s(),this.dispose(this._player.currentTimeChanged.disposableOn(s))}this.dispose(d.bind([this._player,"duration"],[this,"duration"])),this.dispose(d.bind([this._player,"playing"],[this,"playing"])),this.dispose(d.bind([this._player,"speed"],[this,"speed"]));{const s=()=>{(this.autoComputeTimeFromTimePosRots??!0)&&this.computeTimeFromTimePosRots()};s();const o=this.disposeVar(d.createNextAnimateFrameEvent(this.autoComputeTimeFromTimePosRotsChanged,this.timePosRotsChanged));this.dispose(o.disposableOn(s))}{const s=()=>{const o=this.timePosRots;if(!o)return;let a=0;const u=o.length;for(let l=0;l<u;++l){const h=o[l][0];if(h<0)console.warn("地理路径的时间戳不能小于0!");else if(h<a){console.warn(`地理路径的时间戳需要满足从小到大的数据,元素越靠后,时间越靠后!当前不满足条件的元素是index: ${l} time: ${h}`);break}}};s(),this.dispose(this.timePosRotsChanged.disposableOn(s))}{const s=this.disposeVar(d.createProcessingFromAsyncFunc(async o=>{if(!this.dataUri)return;await o.promise(d.sleep(1e3));const a=await o.promise(fetch(this.dataUri)),u=await o.promise(a.text());this.timePosRots=Fr.parseData(u)}));this.dispose(this.dataUriChanged.disposableOn(()=>{s.restart()})),this.dispose(this.dataTextChanged.disposableOn(()=>{this.dataText&&(this.timePosRots=Fr.parseData(this.dataText))}))}}get currentInfo(){return this._currentInfo.value}get currentInfoChanged(){return this._currentInfo.changed}get currentIndex(){return this._currentInfo.value&&this._currentInfo.value.index}get currentIndexChanged(){return this._currentInfo.changed}get currentPosition(){return this._currentInfo.value&&this._currentInfo.value.position}get currentPositionChanged(){return this._currentInfo.changed}get currentRotation(){return this._currentInfo.value&&this._currentInfo.value.rotation}get currentRotationChanged(){return this._currentInfo.changed}get player(){return this._player}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get accumDistancesChanged(){return this._accumDistancesChanged}get accumDistances(){if(this._accumDistancesDirty)return this._accumDistances;if(!this.timePosRots||this.timePosRots.length<2)return this._accumDistances=[],this._accumDistances;{const e=this.timePosRots.length;let n=0;const i=[];let s=Gi(this.timePosRots[0][1]);i.push(n);for(let o=1;o<e;++o){const a=Gi(this.timePosRots[o][1]),u=d.Vector.distance(a,s);s=a,n+=u,i.push(n)}this._accumDistances=i}return this._accumDistances}get totalDistanceChanged(){return this._accumDistancesChanged}get totalDistance(){return this.accumDistances.length>0?this.accumDistances[this.accumDistances.length-1]:0}getCurrent(e){return this.getCurrentFunc?this.getCurrentFunc(e,this):this.timePosRots&&_I(this.timePosRots,e,this.rotLerpMode)}subPath(e,n){return this.timePosRots&&wI(this,e,n)}computeRotIfUndefinedUsingPrevLine(e=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=Fr.computeRotIfUndefinedUsingPrevLine(this.timePosRots,e)}computeRotIfUndefinedUsingNextLine(e=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=Fr.computeRotIfUndefinedUsingNextLine(this.timePosRots,e)}computeRotIfUndefinedUsingLerp(e=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=Fr.computeRotIfUndefinedUsingLerp(this.timePosRots,e)}computeRotIfUndefined(e=!1){this.computeRotIfUndefinedUsingPrevLine(e)}addAroundPoints(e,n){yI(this,e,n)}get getCurrentFunc(){return this._getCurrentFunc.value}set getCurrentFunc(e){this._getCurrentFunc.value=e}get getCurrentFuncChanged(){return this._getCurrentFunc.changed}computeTimeFromTimePosRots(){const e=this.timePosRots;if(!e||e.length<=1){this.startTime=void 0,this.stopTime=void 0,this.duration=void 0;return}this.startTime=e[0][0],this.stopTime=e[e.length-1][0],this.duration=this.stopTime-this.startTime}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}};g(Fr,"computeRotIfUndefinedUsingPrevLine",Kv),g(Fr,"computeRotIfUndefinedUsingNextLine",Zv),g(Fr,"computeRotIfUndefinedUsingLerp",mI),g(Fr,"getLeftRotation",$v),g(Fr,"getRightRotation",jv),g(Fr,"parseData",EI),g(Fr,"defaults",{timePosRots:[],startTime:0,stopTime:3e3,loop:!1,duration:3e3,playing:!1,dataText:""}),g(Fr,"timePosRotsMd",SI);let Hs=Fr;(r=>{r.createDefaultProps=()=>({show:!1,currentPoiShow:!0,timePosRots:d.reactDeepArrayWithUndefined(void 0,(t,e)=>t[0]===e[0]&&t[1].every((n,i)=>n===e[1][i])&&t[2]===e[2]===void 0||t[2]!==void 0&&e[2]!==void 0&&t[2].every((n,i)=>e[2][i]),t=>[t[0],[...t[1]],t[2]&&[...t[2]]||void 0]),autoComputeTimeFromTimePosRots:!0,leadTime:0,trailTime:0,startTime:void 0,stopTime:void 0,loop:!1,currentTime:0,duration:void 0,speed:1,playing:!1,polylineShow:!0,width:1,ground:!1,color:d.reactArray([1,1,1,1]),hasDash:!1,gapColor:d.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,depthTest:!1,arcType:"GEODESIC",allowPicking:!1,dataUri:"",dataText:void 0,rotLerpMode:"Lerp",debug:!1})})(Hs||(Hs={})),d.extendClassProps(Hs.prototype,Hs.createDefaultProps);const hu=class hu extends Xs{constructor(e){super(e);g(this,"_path");g(this,"_currentPositionChanged",this.disposeVar(new d.Event));g(this,"_currentRotationChanged",this.disposeVar(new d.Event));g(this,"_currentChanged",this.disposeVar(new d.Event));g(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);g(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());this.strokeStyle={width:10,widthType:"world",color:[1,0,.73,1],material:"",materialParams:{},ground:!1},this._path=this.disposeVar(new Hs),this.dispose(this._path.currentInfoChanged.disposableOn(()=>this._currentPositionChanged.emit(this._path.currentPosition))),this.dispose(this._path.currentInfoChanged.disposableOn(()=>this._currentRotationChanged.emit(this.currentRotation))),this.dispose(this._path.currentInfoChanged.disposableOn(()=>this._currentChanged.emit(this.current))),this._path.show=!0,this._path.polylineShow=!1,this._path.currentPoiShow=!1;{const n=()=>{if(!this.timeStamps||!this.points){this._path.timePosRots=void 0;return}const s=this.timeStamps.length,o=this.points.length,a=Math.min(s,o),u=[];for(let l=0;l<a;++l)u.push([this.timeStamps[l],this.points[l]]);this._path.timePosRots=u,this.rotationRadius.some(l=>l>0)?(this._path.addAroundPoints(this.rotationRadius,!0),this._path.computeRotIfUndefinedUsingLerp(!0),this._path.rotLerpMode="Lerp"):(this._path.computeRotIfUndefinedUsingPrevLine(!0),this._path.rotLerpMode="Next")},i=this.disposeVar(d.createNextAnimateFrameEvent(this.timeStampsChanged,this.pointsChanged,this.rotationRadiusChanged));n(),this.dispose(i.disposableOn(n))}}get path(){return this._path}get currentPosition(){return this._path.currentPosition}get currentPositionChanged(){return this._currentPositionChanged}get currentRotation(){const e=this._path.currentRotation;if(e)return[La(e[0]-90),e[1],e[2]]}get currentRotationChanged(){return this._currentRotationChanged}get current(){return{position:this.currentPosition,rotation:this.currentRotation}}get currentChanged(){return this._currentChanged}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pg([this,"timeStamps"],"时间序列",[],!0),new L([this,"speed"],"线条流速",1),new bt([this,"materialMode"],[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","pureColor"]],"模式","singleArrow"),new ut([this,"rotationRadius"],"拐弯半径")],more:[...e.more,new lr([this,"currentPosition"],"当前位置",void 0,!0,!0)]}}};g(hu,"createDefaultProps",()=>({...Dt.createDefaultProps(),timeStamps:d.reactArrayWithUndefined(void 0),speed:1,materialMode:"singleArrow",stroked:!0,strokeStyle:d.reactJson({width:10,widthType:"world",color:[1,0,.73,1],material:"",materialParams:{},ground:!1}),rotationRadius:[5]})),g(hu,"type",hu.register("ESPath",hu,{chsName:"ESPath",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPath"}));let El=hu;const js=class js extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new gt([]),new $([this,"textEditingInteraction"],"文本编辑交互"),new $([this,"textEditing"],"文本编辑"),new L([this,"width"],"宽度",js.defaults.width,!0),new nc([this,"text"],"内容",js.defaults.text,void 0,!0),new Hn([this,"originRatioAndOffset"],"原点比例和偏移"),new L([this,"opacity"],"透明度"),new L([this,"fontSize"],"字体大小"),new Rt([this,"color"],"字体颜色"),new Rt([this,"backgroundColor"],"背景颜色"),new Hn([this,"padding"],"内边距"),new Hn([this,"borderRadius"],"边框圆角"),new Rt([this,"borderColor"],"边框颜色"),new L([this,"borderWidth"],"边框宽度"),new bt([this,"textAlign"],[["center","center"],["left","left"],["right","right"]],"文字位置"),new bt([this,"borderStyle"],[["none","none"],["hidden","hidden"],["dotted","dotted"],["dashed","dashed"],["solid","solid"],["double","double"],["groove","groove"],["ridge","ridge"],["inset","inset"],["outset","outset"]],"边框类型")]}}};g(js,"createDefaultProps",()=>({...ct.createDefaultProps(),text:"请输入文字",width:80,textEditingInteraction:!1,textEditing:!1,originRatioAndOffset:d.reactArray([.5,1,0,0]),opacity:1,fontSize:14,textAlign:"left",color:d.reactArray([1,1,1,1]),backgroundColor:d.reactArray([0,0,0,.8]),padding:d.reactArray([5,5,5,5]),borderRadius:d.reactArray([6,6,6,6]),borderWidth:0,borderColor:d.reactArray([1,1,1,1]),borderStyle:"solid"})),g(js,"type",js.register("ESGeoDivTextPoi",js,{chsName:"图标点",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"图标点"}));let kd=js;const cu=class cu extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Rt([this,"color"],"颜色",[1,1,0,1])]}}};g(cu,"createDefaultProps",()=>({...ct.createDefaultProps(),color:d.reactArray([1,1,0,1])})),g(cu,"type",cu.register("ESCityBasePoint",cu,{chsName:"城市基点(Czm)",tags:["ESObjects","CityObjects","_ES_Impl_Cesium"],description:"城市基点(Czm)"}));let Vd=cu;const CI=[{id:"document",version:"1.0"},{id:"Vehicle",availability:"2012-08-04T16:00:00Z/2012-08-04T16:14:15.251Z",billboard:{eyeOffset:{cartesian:[0,0,0]},horizontalOrigin:"CENTER",image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEISURBVEhLvVXBDYQwDOuojHKj8LhBbpTbpBCEkZsmIVTXq1RVQGrHiWlLmTTqPiZBlyLgy/KSZQ5JSHDQ/mCYCsC8106kDU0AdwRnvYZArWRcAl0dcYJq1hWCb3hBrumbDAVMwAC82WoRvgMnVMDBnB0nYZFTbE6BBvdUGqVqCbjBIk3PyFFR/NU7EKzru+qZsau3ryPwwCRLKYOzutZuCL6fUmWeJGzNzL/RxAMrUmASSCkkAayk2IxPlwhAAYGpsiHQjbLccfdOY5gKkCXAMi7SscAwbQpAnKyctWyUZ6z8ja3OGMepwD8asz+9FnSvbhU8uVOHFIwQsI3/p0CfhuqCSQuxLqsN6mu8SS+N42MAAAAASUVORK5CYII=",pixelOffset:{cartesian2:[0,0]},scale:.8333333333333334,show:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",boolean:!0}],verticalOrigin:"BOTTOM"},label:{fillColor:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",rgba:[255,255,0,255]}],font:"bold 10pt Segoe UI Semibold",horizontalOrigin:"LEFT",outlineColor:{rgba:[0,0,0,255]},pixelOffset:{cartesian2:[10,0]},scale:1,show:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",boolean:!0}],style:"FILL",text:"Vehicle",verticalOrigin:"CENTER"},path:{material:{solidColor:{color:{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",rgba:[255,255,0,255]}}},width:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",number:5}],show:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",boolean:!0}]},position:{interpolationAlgorithm:"LAGRANGE",interpolationDegree:1,epoch:"2012-08-04T16:00:00Z",cartesian:[0,-23797546637012e-7,-466533288013588e-8,362813368924173e-8,100,-237951008905552e-8,-466541964840452e-8,362818220006795e-8,200,-23795684769522e-7,-46655553441867e-7,362797083323261e-8,300,-237963893786855e-8,-466569163561896e-8,362775082085873e-8,400,-237970929834665e-8,-46658279679646e-7,362753080187124e-8,500,-237983728064915e-8,-46658477494347e-7,362742212874017e-8,600,-237962498289073e-8,-466590750853722e-8,36274841191848e-7,700,-237938612743523e-8,-466602954174431e-8,362748383297459e-8,800,-237914726777171e-8,-466615156669944e-8,36274835403492e-7,900,-237890840390057e-8,-466627358340244e-8,362748324130864e-8,1e3]}}],PI=`第一个packet代表了cesium场景(cesium时间轴的范围,当前时刻,倍速等信息)之外,其他的packet都可以理解为描述某一时间范围内的entity的行为。
415
+ `,wr=class wr extends B{constructor(e,n){super();d(this,"_scratchCurrentInfo",{position:[0,0,0],rotation:[0,0,0],index:0});d(this,"_currentInfo",this.disposeVar(g.react(void 0,(e,n)=>!1)));d(this,"_player");d(this,"_flyToEvent",this.disposeVar(new V));d(this,"_accumDistancesChanged",this.disposeVar(new V));d(this,"_accumDistancesChangedInit",this.dispose(this.timePosRotsChanged.disposableOn(()=>(this._accumDistancesDirty=!0,this._accumDistancesChanged.emit()))));d(this,"_accumDistancesDirty",!1);d(this,"_accumDistances",[]);d(this,"_getCurrentFunc",this.disposeVar(g.react(void 0)));this._player=this.disposeVar(new Mn);const i=()=>{const s=this.getCurrent(this.currentTime??0);if(s===void 0)this._currentInfo.value=void 0;else{const{index:o,position:a,rotation:u,ratio:l}=s;this._scratchCurrentInfo.index=o,this._scratchCurrentInfo.position=a,this._scratchCurrentInfo.rotation=u,this._scratchCurrentInfo.ratio=l,this._currentInfo.value=this._scratchCurrentInfo}};i(),this.currentTimeChanged.disposableOn(i),this.timePosRotsChanged.disposableOn(i),this.rotLerpModeChanged.disposableOn(i),this.dispose(g.bind([this._player,"loop"],[this,"loop"]));{const s=()=>{if(this.startTime===void 0||this.currentTime===void 0)return;const o=this.currentTime-this.startTime;(this._player.currentTime===void 0||Math.abs(o-this._player.currentTime)>.01)&&(this._player.currentTime=o)};s(),this.dispose(this.currentTimeChanged.disposableOn(s))}{const s=()=>{if(this.startTime===void 0||this._player.currentTime===void 0)return;const o=this._player.currentTime+this.startTime;(this.currentTime===void 0||Math.abs(o-this.currentTime)>.01)&&(this.currentTime=o)};s(),this.dispose(this._player.currentTimeChanged.disposableOn(s))}this.dispose(g.bind([this._player,"duration"],[this,"duration"])),this.dispose(g.bind([this._player,"playing"],[this,"playing"])),this.dispose(g.bind([this._player,"speed"],[this,"speed"]));{const s=()=>{(this.autoComputeTimeFromTimePosRots??!0)&&this.computeTimeFromTimePosRots()};s();const o=this.disposeVar(g.createNextAnimateFrameEvent(this.autoComputeTimeFromTimePosRotsChanged,this.timePosRotsChanged));this.dispose(o.disposableOn(s))}{const s=()=>{const o=this.timePosRots;if(!o)return;let a=0;const u=o.length;for(let l=0;l<u;++l){const h=o[l][0];if(h<0)console.warn("地理路径的时间戳不能小于0!");else if(h<a){console.warn(`地理路径的时间戳需要满足从小到大的数据,元素越靠后,时间越靠后!当前不满足条件的元素是index: ${l} time: ${h}`);break}}};s(),this.dispose(this.timePosRotsChanged.disposableOn(s))}{const s=this.disposeVar(g.createProcessingFromAsyncFunc(async o=>{if(!this.dataUri)return;await o.promise(g.sleep(1e3));const a=await o.promise(fetch(this.dataUri)),u=await o.promise(a.text());this.timePosRots=wr.parseData(u)}));this.dispose(this.dataUriChanged.disposableOn(()=>{s.restart()})),this.dispose(this.dataTextChanged.disposableOn(()=>{this.dataText&&(this.timePosRots=wr.parseData(this.dataText))}))}}get currentInfo(){return this._currentInfo.value}get currentInfoChanged(){return this._currentInfo.changed}get currentIndex(){return this._currentInfo.value&&this._currentInfo.value.index}get currentIndexChanged(){return this._currentInfo.changed}get currentPosition(){return this._currentInfo.value&&this._currentInfo.value.position}get currentPositionChanged(){return this._currentInfo.changed}get currentRotation(){return this._currentInfo.value&&this._currentInfo.value.rotation}get currentRotationChanged(){return this._currentInfo.changed}get player(){return this._player}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get accumDistancesChanged(){return this._accumDistancesChanged}get accumDistances(){if(!this._accumDistancesDirty)return this._accumDistances;if(!this.timePosRots||this.timePosRots.length<2)this._accumDistances=[];else{const e=this.timePosRots.length;let n=0;const i=[];let s=ei(this.timePosRots[0][1]);i.push(n);for(let o=1;o<e;++o){const a=ei(this.timePosRots[o][1]),u=g.Vector.distance(a,s);s=a,n+=u,i.push(n)}this._accumDistances=i}return this._accumDistances}get totalDistanceChanged(){return this._accumDistancesChanged}get totalDistance(){return this.accumDistances.length>0?this.accumDistances[this.accumDistances.length-1]:0}getCurrent(e){return this.getCurrentFunc?this.getCurrentFunc(e,this):this.timePosRots&&VP(this.timePosRots,e,this.rotLerpMode)}subPath(e,n){return this.timePosRots&&zP(this,e,n)}computeRotIfUndefinedUsingPrevLine(e=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=wr.computeRotIfUndefinedUsingPrevLine(this.timePosRots,e)}computeRotIfUndefinedUsingNextLine(e=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=wr.computeRotIfUndefinedUsingNextLine(this.timePosRots,e)}computeRotIfUndefinedUsingLerp(e=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=wr.computeRotIfUndefinedUsingLerp(this.timePosRots,e)}computeRotIfUndefined(e=!1){this.computeRotIfUndefinedUsingPrevLine(e)}addAroundPoints(e,n){kP(this,e,n)}get getCurrentFunc(){return this._getCurrentFunc.value}set getCurrentFunc(e){this._getCurrentFunc.value=e}get getCurrentFuncChanged(){return this._getCurrentFunc.changed}computeTimeFromTimePosRots(){const e=this.timePosRots;if(!e||e.length<=1){this.startTime=void 0,this.stopTime=void 0,this.duration=void 0;return}this.startTime=e[0][0],this.stopTime=e[e.length-1][0],this.duration=this.stopTime-this.startTime}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}};d(wr,"computeRotIfUndefinedUsingPrevLine",Wv),d(wr,"computeRotIfUndefinedUsingNextLine",Xv),d(wr,"computeRotIfUndefinedUsingLerp",FP),d(wr,"getLeftRotation",Bv),d(wr,"getRightRotation",Hv),d(wr,"parseData",UP),d(wr,"defaults",{timePosRots:[],startTime:0,stopTime:3e3,loop:!1,duration:3e3,playing:!1,dataText:""}),d(wr,"timePosRotsMd",GP);let ws=wr;(r=>{r.createDefaultProps=()=>({show:!1,currentPoiShow:!0,timePosRots:g.reactDeepArrayWithUndefined(void 0,(t,e)=>t[0]===e[0]&&t[1].every((n,i)=>n===e[1][i])&&t[2]===e[2]===void 0||t[2]!==void 0&&e[2]!==void 0&&t[2].every((n,i)=>e[2][i]),t=>[t[0],[...t[1]],t[2]&&[...t[2]]||void 0]),autoComputeTimeFromTimePosRots:!0,leadTime:0,trailTime:0,startTime:void 0,stopTime:void 0,loop:!1,currentTime:0,duration:void 0,speed:1,playing:!1,polylineShow:!0,width:1,ground:!1,color:g.reactArray([1,1,1,1]),hasDash:!1,gapColor:g.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,depthTest:!1,arcType:"GEODESIC",allowPicking:!1,dataUri:"",dataText:void 0,rotLerpMode:"Lerp",debug:!1})})(ws||(ws={})),g.extendClassProps(ws.prototype,ws.createDefaultProps);const Ya=class Ya extends qi{constructor(e){super(e);d(this,"_path");d(this,"_currentPositionChanged",this.disposeVar(new V));d(this,"_currentRotationChanged",this.disposeVar(new V));d(this,"_currentChanged",this.disposeVar(new V));d(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());this.strokeStyle={width:10,widthType:"world",color:[1,0,.73,1],material:"",materialParams:{},ground:!1},this._path=this.disposeVar(new ws),this.dispose(this._path.currentInfoChanged.disposableOn(()=>this._currentPositionChanged.emit(this._path.currentPosition))),this.dispose(this._path.currentInfoChanged.disposableOn(()=>this._currentRotationChanged.emit(this.currentRotation))),this.dispose(this._path.currentInfoChanged.disposableOn(()=>this._currentChanged.emit(this.current))),this._path.show=!0,this._path.polylineShow=!1,this._path.currentPoiShow=!1;{const n=()=>{if(!this.timeStamps||!this.points){this._path.timePosRots=void 0;return}const s=this.timeStamps.length,o=this.points.length,a=Math.min(s,o),u=[];for(let l=0;l<a;++l)u.push([this.timeStamps[l],this.points[l]]);this._path.timePosRots=u,this.rotationRadius.some(l=>l>0)?(this._path.addAroundPoints(this.rotationRadius,!0),this._path.computeRotIfUndefinedUsingLerp(!0),this._path.rotLerpMode="Lerp"):(this._path.computeRotIfUndefinedUsingPrevLine(!0),this._path.rotLerpMode="Next")},i=this.disposeVar(g.createNextAnimateFrameEvent(this.timeStampsChanged,this.pointsChanged,this.rotationRadiusChanged));n(),this.dispose(i.disposableOn(n))}}get path(){return this._path}get currentPosition(){return this._path.currentPosition}get currentPositionChanged(){return this._currentPositionChanged}get currentRotation(){const e=this._path.currentRotation;if(e)return[Po(e[0]-90),e[1],e[2]]}get currentRotationChanged(){return this._currentRotationChanged}get current(){return{position:this.currentPosition,rotation:this.currentRotation}}get currentChanged(){return this._currentChanged}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new jd([this,"timeStamps"],"时间序列",[],!0),new T([this,"speed"],"线条流速",1),new pt([this,"materialMode"],[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","pureColor"]],"模式","singleArrow"),new Q([this,"rotationRadius"],"拐弯半径")],more:[...e.more,new Je([this,"currentPosition"],"当前位置",void 0,!0,!0)]}}};d(Ya,"createDefaultProps",()=>({...yt.createDefaultProps(),timeStamps:g.reactArrayWithUndefined(void 0),speed:1,materialMode:"singleArrow",stroked:!0,strokeStyle:g.reactJson({width:10,widthType:"world",color:[1,0,.73,1],material:"",materialParams:{},ground:!1}),rotationRadius:[5]})),d(Ya,"type",Ya.register("ESPath",Ya,{chsName:"ESPath",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPath"}));let wa=Ya;const xs=class xs extends Z{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new nt([]),new W([this,"textEditingInteraction"],"文本编辑交互"),new W([this,"textEditing"],"文本编辑"),new T([this,"width"],"宽度",xs.defaults.width,!0),new qh([this,"text"],"内容",xs.defaults.text,void 0,!0),new Pn([this,"originRatioAndOffset"],"原点比例和偏移"),new T([this,"opacity"],"透明度"),new T([this,"fontSize"],"字体大小"),new _t([this,"color"],"字体颜色"),new _t([this,"backgroundColor"],"背景颜色"),new Pn([this,"padding"],"内边距"),new Pn([this,"borderRadius"],"边框圆角"),new _t([this,"borderColor"],"边框颜色"),new T([this,"borderWidth"],"边框宽度"),new pt([this,"textAlign"],[["center","center"],["left","left"],["right","right"]],"文字位置"),new pt([this,"borderStyle"],[["none","none"],["hidden","hidden"],["dotted","dotted"],["dashed","dashed"],["solid","solid"],["double","double"],["groove","groove"],["ridge","ridge"],["inset","inset"],["outset","outset"]],"边框类型")]}}};d(xs,"createDefaultProps",()=>({...Z.createDefaultProps(),text:"请输入文字",width:80,textEditingInteraction:!1,textEditing:!1,originRatioAndOffset:g.reactArray([.5,1,0,0]),opacity:1,fontSize:14,textAlign:"left",color:g.reactArray([1,1,1,1]),backgroundColor:g.reactArray([0,0,0,.8]),padding:g.reactArray([5,5,5,5]),borderRadius:g.reactArray([6,6,6,6]),borderWidth:0,borderColor:g.reactArray([1,1,1,1]),borderStyle:"solid"})),d(xs,"type",xs.register("ESGeoDivTextPoi",xs,{chsName:"图标点",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"图标点"}));let md=xs;const Ja=class Ja extends Z{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new _t([this,"color"],"颜色",[1,1,0,1])]}}};d(Ja,"createDefaultProps",()=>({...Z.createDefaultProps(),color:g.reactArray([1,1,0,1])})),d(Ja,"type",Ja.register("ESCityBasePoint",Ja,{chsName:"城市基点(Czm)",tags:["ESObjects","CityObjects","_ES_Impl_Cesium"],description:"城市基点(Czm)"}));let vd=Ja;const qP=[{id:"document",version:"1.0"},{id:"Vehicle",availability:"2012-08-04T16:00:00Z/2012-08-04T16:14:15.251Z",billboard:{eyeOffset:{cartesian:[0,0,0]},horizontalOrigin:"CENTER",image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEISURBVEhLvVXBDYQwDOuojHKj8LhBbpTbpBCEkZsmIVTXq1RVQGrHiWlLmTTqPiZBlyLgy/KSZQ5JSHDQ/mCYCsC8106kDU0AdwRnvYZArWRcAl0dcYJq1hWCb3hBrumbDAVMwAC82WoRvgMnVMDBnB0nYZFTbE6BBvdUGqVqCbjBIk3PyFFR/NU7EKzru+qZsau3ryPwwCRLKYOzutZuCL6fUmWeJGzNzL/RxAMrUmASSCkkAayk2IxPlwhAAYGpsiHQjbLccfdOY5gKkCXAMi7SscAwbQpAnKyctWyUZ6z8ja3OGMepwD8asz+9FnSvbhU8uVOHFIwQsI3/p0CfhuqCSQuxLqsN6mu8SS+N42MAAAAASUVORK5CYII=",pixelOffset:{cartesian2:[0,0]},scale:.8333333333333334,show:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",boolean:!0}],verticalOrigin:"BOTTOM"},label:{fillColor:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",rgba:[255,255,0,255]}],font:"bold 10pt Segoe UI Semibold",horizontalOrigin:"LEFT",outlineColor:{rgba:[0,0,0,255]},pixelOffset:{cartesian2:[10,0]},scale:1,show:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",boolean:!0}],style:"FILL",text:"Vehicle",verticalOrigin:"CENTER"},path:{material:{solidColor:{color:{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",rgba:[255,255,0,255]}}},width:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",number:5}],show:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",boolean:!0}]},position:{interpolationAlgorithm:"LAGRANGE",interpolationDegree:1,epoch:"2012-08-04T16:00:00Z",cartesian:[0,-23797546637012e-7,-466533288013588e-8,362813368924173e-8,100,-237951008905552e-8,-466541964840452e-8,362818220006795e-8,200,-23795684769522e-7,-46655553441867e-7,362797083323261e-8,300,-237963893786855e-8,-466569163561896e-8,362775082085873e-8,400,-237970929834665e-8,-46658279679646e-7,362753080187124e-8,500,-237983728064915e-8,-46658477494347e-7,362742212874017e-8,600,-237962498289073e-8,-466590750853722e-8,36274841191848e-7,700,-237938612743523e-8,-466602954174431e-8,362748383297459e-8,800,-237914726777171e-8,-466615156669944e-8,36274835403492e-7,900,-237890840390057e-8,-466627358340244e-8,362748324130864e-8,1e3]}}],WP=`第一个packet代表了cesium场景(cesium时间轴的范围,当前时刻,倍速等信息)之外,其他的packet都可以理解为描述某一时间范围内的entity的行为。
396
416
  \`\`\`
397
417
  [{
398
418
  "id": "document",
@@ -447,7 +467,7 @@ timePosRots是一个内部包含三个元素的数组,第一个表示时间戳
447
467
  }
448
468
  }]
449
469
  \`\`\`
450
- `,tm=`(dataSource) => {
470
+ `,Yv=`(dataSource) => {
451
471
  var entities = dataSource.entities.values;
452
472
 
453
473
  for (var i = 0; i < entities.length; i++) {
@@ -462,32 +482,12 @@ timePosRots是一个内部包含三个元素的数组,第一个表示时间戳
462
482
  }
463
483
  }
464
484
  }
465
- `,II=`data 路径都可以使用下面回调函数
485
+ `,XP=`data 路径都可以使用下面回调函数
466
486
  \`\`\`
467
- ${tm}
487
+ ${Yv}
468
488
  \`\`\`
469
489
 
470
- `,wl=Date.now();new Date(wl).toISOString(),new Date(wl+864e5).toISOString();const _i=class _i extends ht{constructor(e){super(e);g(this,"_flyToEvent",this.disposeVar(new d.Event));g(this,"_resetClockEvent",this.disposeVar(new d.Event))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new ut([this,"data"],_i.defaults.data,PI,"数据",!0),new ut([this,"uri"],"路径",""),new $([this,"clockEnabled"],"启用",!1),new L([this,"multiplier"],"倍速",_i.defaults.multiplier),new $([this,"autoResetClock"],"自动设置时钟",!0),new ro([this,"startTime"],"开始时间",_i.defaults.startTime,!0),new ro([this,"stopTime"],"结束时间",_i.defaults.stopTime,!0),new ro([this,"currentTime"],"当前时间",_i.defaults.currentTime,!0),new bt([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep","SYSTEM_CLOCK_MULTIPLIER"),new bt([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange","UNBOUNDED"),new $([this,"shouldAnimate"],"是否启用动画",!1)],general:[...e.general,new $([this,"show"],"是否显示",!0),new $([this,"collision"],"开启碰撞",!1),new $([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new pt(["number"],n=>this.flyTo(n),[1e3],"飞入"),new pt([],()=>this.resetClock(),[],"重设时钟"),new _s([this,"loadFuncStr"],"loadFnStr",tm,II,!0)]}}};g(_i,"createDefaultProps",()=>({show:!0,uri:"${earthsdk3-assets-script-dir}/assets/misc/simple.czml",allowPicking:!1,data:d.reactJsonWithUndefined(CI),autoResetClock:!0,clockEnabled:!1,startTime:wl,stopTime:wl+864e5,currentTime:wl,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...ht.createDefaultProps()})),g(_i,"type",_i.register("ESCzml",_i,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"}));let Ud=_i;const fu=class fu extends ht{getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new gt([]),new $([this,"show"],"是否显示"),new L([this,"cssSize"],"尺寸"),new Ve([this,"cssPosition"],"位置"),new mu([this,"imgUrl"],"图片地址")]}}};g(fu,"createDefaultProps",()=>({...ht.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:ht.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")})),g(fu,"type",fu.register("ESNavigator",fu,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"}));let zd=fu;const Hi=class Hi extends ht{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new gt([],"通用","通用"),new $([this,"show"],"是否显示",Hi.defaults.show),new L([this,"height"],"高度",Hi.defaults.height,!0),new L([this,"fontSize"],"文字大小",Hi.defaults.fontSize,!0),new Rt([this,"bgColor"],"背景颜色",Hi.defaults.bgColor,!0)]}}};g(Hi,"createDefaultProps",()=>({...ht.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:d.reactArray([.2784313725490196,.2784313725490196,.2784313725490196,.8])})),g(Hi,"type",Hi.register("ESViewerStatusBar",Hi,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let qd=Hi;const Yi=class Yi extends ht{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new gt([],"通用","通用"),new $([this,"show"],"是否显示",Yi.defaults.show),new L([this,"height"],"高度",Yi.defaults.height,!0),new L([this,"fontSize"],"文字大小",Yi.defaults.fontSize,!0),new Rt([this,"bgColor"],"背景颜色",Yi.defaults.bgColor,!0)]}}};g(Yi,"createDefaultProps",()=>({...ht.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:d.reactArray([.2784313725490196,.2784313725490196,.2784313725490196,.8])})),g(Yi,"type",Yi.register("ESViewerStatusBarScale",Yi,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let Wd=Yi;const du=class du extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new _t([this,"url"],"路径","",!0),new L([this,"progress"],"进度",0,!1,!0)]}}};g(du,"createDefaultProps",()=>({...ct.createDefaultProps(),url:"",progress:0})),g(du,"type",du.register("ESGaussianSplatting",du,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"}));let Xd=du;const qo=class qo extends ct{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new _t([this,"mesh"],"mesh地址",qo.defaults.mesh)]}}};g(qo,"createDefaultProps",()=>({...ct.createDefaultProps(),mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"})),g(qo,"type",qo.register("ESStaticMesh",qo,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"}));let Hd=qo;const gu=class gu extends Dt{constructor(e){super(e);g(this,"_startEvent",this.dv(new d.Event));g(this,"_clearEvent",this.dv(new d.Event));g(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new ml),this.ad(this.components.disposableAdd(this._eSGeoExtrudedPolygon)),this.eSGeoExtrudedPolygon.perPositionHeight=!0,this.eSGeoExtrudedPolygon.extrudedHeight=0,this.stroked=!0,this.strokeWidth=2,this.strokeColor=[1,0,0,1],this.ad(d.track([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"points"],[this,"points"])),this.ad(this.clearEvent.don(()=>{this.points=void 0,this.depths=void 0,this.windowPositions=void 0}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get eSGeoExtrudedPolygon(){return this._eSGeoExtrudedPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new pt([],()=>this.start(),[],"开始分析"),new pt([],()=>this.clear(),[],"清除分析"),new ut([this,"windowPositions"],"屏幕坐标",[],void 0,!1,!0),new ut([this,"depths"],"深度值",[],void 0,!1,!0),new L([this,"radius"],"半径",1e4,!0)]}}};g(gu,"createDefaultProps",()=>({...Dt.createDefaultProps(),windowPositions:sc([]),depths:d.reactArrayWithUndefined([]),radius:d.react(1e4)})),g(gu,"type",gu.register("ESSkylineAnalysis",gu,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"}));let Yd=gu;const vs=class vs extends ee{constructor(t){super(t)}getESProperties(){const t=super.getESProperties();return{...t,basic:[...t.basic,new ut([this,"data"],"数据",[],void 0,!0),new ut([this,"gradient"],"渐变",vs.defaults.gradient,void 0,!0),new L([this,"radius"],"半径",vs.defaults.radius,void 0,!0),new L([this,"blur"],"模糊",vs.defaults.blur,!0),new $([this,"is3D"],"is3D",!1,!0)]}}};g(vs,"createDefaultProps",()=>({...ee.createDefaultProps(),is3D:d.react(!1),data:d.reactPositions([]),gradient:d.reactJsonWithUndefined({".5":"green",".7":"yellow",".95":"red"}),radius:d.react(10),blur:d.react(.85)})),g(vs,"type",vs.register("ESHeatMap",vs,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"}));let Jd=vs;const Wo=class Wo extends Dt{constructor(e){super(e);g(this,"editingBindMode","scatter")}};g(Wo,"createDefaultProps",()=>({...Dt.createDefaultProps(),pointed:!0})),g(Wo,"type",Wo.register("ESGeoPoints",Wo,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:"地图中的可视化地理点集合"})),g(Wo,"supportEditingModes",[...Dt.supportEditingModes,lt.ScatterAppend,lt.ScatterModify]);let Bd=Wo;function em(r){return typeof r=="string"?document.getElementById(r):r}function Qd(r){if(!r)throw new Error("container is not defined");r.innerHTML="";const t=document.createElement("div");return t.style.cssText="width: 100%; height: 100%; margin: 0px; padding: 0px; border: none; overflow: hidden; position: relative; z-index: 0; background: rgba(0,0,0,0);",r.appendChild(t),t}class rm extends d.Destroyable{constructor(e,n){super();g(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=e,this._createSceneObjectListeningFunc=n;const i=this._listeningSceneObjects,s=(o,a)=>{if(o)for(let u of o){const l=i.get(u);l&&(l.destroy(),i.delete(u))}if(a)for(let u of a){if(i.get(u)){console.warn(`listeningSceneObjects已存在某对象:${u.name}`,u);debugger}const h=this.createSceneObjectListeningFunc(u);h&&i.set(u,h)}};s(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(s)),this.dispose(()=>{for(let o of this._listeningSceneObjects.values())o.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class MI extends d.Destroyable{constructor(t){super(),this._esObjectsManager=t;{const e=this._esObjectsManager;class n extends d.Destroyable{constructor(s){super(),this._esPath=s,this.dv(new d.ObjResettingWithEvent(e.activeViewerChanged,()=>{const o=e.activeViewer;if(!o)return;class a extends d.Destroyable{constructor(l){if(super(),this._esPath=l,!o)throw new Error("!viewer");const h=()=>{const c=e.activeViewer;c&&(this._esPath.path.currentTime=c.simulationTime)};h(),this.d(o.simulationTimeChanged.don(h))}}return new a(this._esPath)}))}}this.dv(new rm(e.sceneObjectsManager,i=>{if(i instanceof El)return new n(i)}))}{const e=this._esObjectsManager;class n extends d.Destroyable{constructor(s){super();const o=()=>{const a=e.activeViewer;a&&(a.simulationTime=s.currentTime??0)};o(),this.d(s.currentTimeChanged.don(o))}}this.dv(new rm(e.sceneObjectsManager,i=>{if(i instanceof _l)return new n(i)}))}}}class NI extends d.Destroyable{constructor(t){super(),t.forEach(e=>{this.d(e.path.currentPositionChanged.don(n=>{n&&e.sceneObjects.forEach(i=>{Reflect.has(i,"position")&&(i.position=[...n])})})),this.d(e.path.currentRotationChanged.don(n=>{n&&e.sceneObjects.forEach(i=>{Reflect.has(i,"rotation")&&(i.rotation=[...n])})}))})}}class bI extends d.Destroyable{constructor(e){super();g(this,"_player");g(this,"_channels",this.dv(d.reactArray([])));this._objectManager=e,this._player=this._objectManager.player,this.dv(new d.ObjResettingWithEvent(this.channelsChanged,()=>{if(this.channels.length===0)return;const n=[];for(let i=0;i<this.channels.length;i++){const s=this.channels[i],o=ht.getSceneObjById(s.pathId);if(!o||!(o instanceof El))continue;const u=s.sceneObjectIds.map(l=>ht.getSceneObjById(l)).filter(l=>l!==void 0);u.length!==0&&n.push({path:o,sceneObjects:u})}if(n.length!==0)return new NI(n)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(e){this._channels.value=e}}function qh(r){if(r.data){const{type:t,value:e}=r.data;if(t==="UITreeA"&&e instanceof _r){const{sceneObject:n}=e;if(n)return n.id}}}function TI(r,t){const{property:e,customEventName:n,otherParams:i}=t,{dragstartDataMananger:s}=r;if(!(e instanceof Jo)){if(!(e instanceof dg)){if(e instanceof _t){const[o,a]=d.getReactFuncs(e.reactVar);if(n==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const u=i[0];if(u.preventDefault(),!u.dataTransfer)return;qh(s)?u.dataTransfer.dropEffect="move":u.dataTransfer.dropEffect="none"}else if(n==="ondrop"){if(!i)throw new Error("!otherParams");i[0].preventDefault();const l=qh(s);l!==void 0&&a(l)}}else if(e instanceof ug){const[o,a]=d.getReactFuncs(e.reactVar);if(n==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const u=i[0];if(u.preventDefault(),!u.dataTransfer)return;qh(s)?u.dataTransfer.dropEffect="move":u.dataTransfer.dropEffect="none"}else if(n==="ondrop"){if(!i)throw new Error("!otherParams");const u=i[0].$event,l=i[0].strinsPropDom,h=i[0].index;u.preventDefault();const c=qh(s);if(c!==void 0){l[h].firstChild.value=c;const f=new Event("input",{bubbles:!0,cancelable:!0});l[h].firstChild.dispatchEvent(f)}}}else if(e instanceof lg){const[o,a]=d.getReactFuncs(e.reactVar)}}}}function nm(r,t,e,n){if(e)n.currentActiveEditing=[r,t];else if(n.currentActiveEditing){const[i,s]=n.currentActiveEditing;i===r&&s===t&&(e||(n.currentActiveEditing=void 0))}}const xI=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class OI extends d.Destroyable{constructor(t,e){super(),this._sceneObject=t;const n=this._sceneObject;for(let i of xI){const s=i+"Changed",o=n[s];if(o){{const a=n[i];nm(n,i,a,e)}this.dispose(o.disposableOn(a=>nm(n,i,a,e)))}}}get sceneObject(){return this._sceneObject}}class AI extends d.Destroyable{constructor(){super();g(this,"_currentActiveEditing",this.disposeVar(d.reactArrayWithUndefined(void 0)));g(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((e,n)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),n){const[i,s]=n;i[s]===!0&&(i[s]=!1)}if(e){const[i,s]=e;i[s]=!0}})),ht.context.sceneObjCreatedEvent.don(e=>{e.dv(new OI(e,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(e){this._currentActiveEditing.value=e}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class DI extends d.Destroyable{constructor(){super();g(this,"_sceneObjects",new Set);g(this,"_sceneObjectsToChange",this.dv(new d.Event));this.d(()=>{const e=d.length(this._sceneObjects);e!==0&&console.warn(`场景对象管理器销毁时仍然管理着${e}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(e){return this._sceneObjects.has(e)?(console.warn(`创建失败:对象${e.typeName+":"+e.id}已经存在于场景对象管理器中!}`),!1):(this._sceneObjectsToChange.emit([],[e]),this._sceneObjects.add(e),!0)}deleteSceneObject(e){return this._sceneObjects.has(e)?(this._sceneObjectsToChange.emit([e],[]),this._sceneObjects.delete(e),!0):(console.warn(`删除失败:对象${e.typeName+":"+e.id}不存在于场景对象管理器中!}`),!1)}createSceneObject(e,n){const i=ht.context.createSceneObject(e,n);return i&&this.addSceneObject(i),i}createSceneObjectFromClass(e,n){const i=ht.context.createSceneObjectFromClass(e,n);return i&&this.addSceneObject(i),i}createSceneObjectFromJson(e){const n=ht.context.createSceneObjectFromJson(e);return n&&this.addSceneObject(n),n}}function im(r,t){return r.length===t.length&&r.every((e,n)=>e===t[n])}class LI extends d.Destroyable{constructor(t){super(),this._viewer=t,this.d(d.track([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class RI extends d.Destroyable{constructor(t,e){super(),this._viewer=t,this._activeViewer=e;const n=fi.createCommonProps(),i=[];Object.keys(n).forEach(u=>{const l=this._activeViewer[u+"Changed"];i.push(l)});const s=this.dv(d.createNextAnimateFrameEvent(...i)),o=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(n).forEach(u=>{this._viewer[u]=this._activeViewer[u]})};this.d(s.don(o));const a=this.dv(d.createAnimateFrame());a.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const u=this._activeViewer.getCurrentCameraInfo(),l=this._viewer.getCurrentCameraInfo();if(!u)return;const{position:h,rotation:c}=u;l&&im(h,l.position)&&im(c,l.rotation)||this._viewer.flyIn(h,c,0)}),this.d(()=>a.cancel())}}const FI=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="40" height="40" style="shape-rendering: auto; display: block; background: rgba(255, 255, 255, 0);" xmlns:xlink="http://www.w3.org/1999/xlink"><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#ffffff" stroke-width="8" r="32" cy="50" cx="50">
490
+ `,il=Date.now();new Date(il).toISOString(),new Date(il+864e5).toISOString();const $n=class $n extends K{constructor(e){super(e);d(this,"_flyToEvent",this.disposeVar(new V));d(this,"_resetClockEvent",this.disposeVar(new V))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new Q([this,"data"],$n.defaults.data,WP,"数据",!0),new Q([this,"uri"],"路径","${earthsdk3-assets-script-dir}/assets/misc/simple.czml",void 0,!0),new W([this,"clockEnabled"],"启用",!1),new T([this,"multiplier"],"倍速",$n.defaults.multiplier),new W([this,"autoResetClock"],"自动设置时钟",!0),new Os([this,"startTime"],"开始时间",$n.defaults.startTime,!0),new Os([this,"stopTime"],"结束时间",$n.defaults.stopTime,!0),new Os([this,"currentTime"],"当前时间",$n.defaults.currentTime,!0),new pt([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep","SYSTEM_CLOCK_MULTIPLIER"),new pt([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange","UNBOUNDED"),new W([this,"shouldAnimate"],"是否启用动画",!1)],general:[...e.general,new W([this,"show"],"是否显示",!0),new W([this,"collision"],"开启碰撞",!1),new W([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new it(["number"],n=>this.flyTo(n),[1e3],"飞入"),new it([],()=>this.resetClock(),[],"重设时钟"),new Qi([this,"loadFuncStr"],"loadFnStr",Yv,XP,!0)]}}};d($n,"createDefaultProps",()=>({show:!0,uri:void 0,allowPicking:!1,data:g.reactJsonWithUndefined(qP),autoResetClock:!0,clockEnabled:!1,startTime:il,stopTime:il+864e5,currentTime:il,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...K.createDefaultProps()})),d($n,"type",$n.register("ESCzml",$n,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"}));let yd=$n;const ja=class ja extends K{getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new nt([]),new W([this,"show"],"是否显示"),new T([this,"cssSize"],"尺寸"),new _e([this,"cssPosition"],"位置"),new eu([this,"imgUrl"],"图片地址")]}}};d(ja,"createDefaultProps",()=>({...K.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:K.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")})),d(ja,"type",ja.register("ESNavigator",ja,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"}));let _d=ja;const Ci=class Ci extends K{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new nt([],"通用","通用"),new W([this,"show"],"是否显示",Ci.defaults.show),new T([this,"height"],"高度",Ci.defaults.height,!0),new T([this,"fontSize"],"文字大小",Ci.defaults.fontSize,!0),new _t([this,"bgColor"],"背景颜色",Ci.defaults.bgColor,!0)]}}};d(Ci,"createDefaultProps",()=>({...K.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:g.reactArray([.2784313725490196,.2784313725490196,.2784313725490196,.8])})),d(Ci,"type",Ci.register("ESViewerStatusBar",Ci,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let wd=Ci;const Ii=class Ii extends K{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new nt([],"通用","通用"),new W([this,"show"],"是否显示",Ii.defaults.show),new T([this,"height"],"高度",Ii.defaults.height,!0),new T([this,"fontSize"],"文字大小",Ii.defaults.fontSize,!0),new _t([this,"bgColor"],"背景颜色",Ii.defaults.bgColor,!0)]}}};d(Ii,"createDefaultProps",()=>({...K.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:g.reactArray([.2784313725490196,.2784313725490196,.2784313725490196,.8])})),d(Ii,"type",Ii.register("ESViewerStatusBarScale",Ii,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"}));let Ed=Ii;const Qa=class Qa extends Z{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ot([this,"url"],"路径","",!0),new T([this,"progress"],"进度",0,!1,!0)]}}};d(Qa,"createDefaultProps",()=>({...Z.createDefaultProps(),url:"",progress:0})),d(Qa,"type",Qa.register("ESGaussianSplatting",Qa,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"}));let Sd=Qa;const yo=class yo extends Z{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ot([this,"mesh"],"mesh地址",yo.defaults.mesh)]}}};d(yo,"createDefaultProps",()=>({...Z.createDefaultProps(),mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"})),d(yo,"type",yo.register("ESStaticMesh",yo,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"}));let Cd=yo;const $a=class $a extends yt{constructor(e){super(e);d(this,"_startEvent",this.dv(new V));d(this,"_clearEvent",this.dv(new V));d(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new eo),this.ad(this.components.disposableAdd(this._eSGeoExtrudedPolygon)),this.eSGeoExtrudedPolygon.perPositionHeight=!0,this.eSGeoExtrudedPolygon.extrudedHeight=0,this.stroked=!0,this.strokeWidth=2,this.strokeColor=[1,0,0,1],this.ad(g.track([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(g.track([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(g.track([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(g.track([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(g.track([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(g.track([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(g.track([this.eSGeoExtrudedPolygon,"points"],[this,"points"])),this.ad(this.clearEvent.don(()=>{this.points=void 0,this.depths=void 0,this.windowPositions=void 0}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get eSGeoExtrudedPolygon(){return this._eSGeoExtrudedPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new it([],()=>this.start(),[],"开始分析"),new it([],()=>this.clear(),[],"清除分析"),new Q([this,"windowPositions"],"屏幕坐标",[],void 0,!1,!0),new Q([this,"depths"],"深度值",[],void 0,!1,!0),new T([this,"radius"],"半径",1e4,!0)]}}};d($a,"createDefaultProps",()=>({...yt.createDefaultProps(),windowPositions:cf([]),depths:g.reactArrayWithUndefined([]),radius:g.react(1e4)})),d($a,"type",$a.register("ESSkylineAnalysis",$a,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"}));let Id=$a;const Yi=class Yi extends Dt{constructor(t){super(t)}getESProperties(){const t=super.getESProperties();return{...t,basic:[...t.basic,new Q([this,"data"],"数据",[],void 0,!0),new Q([this,"gradient"],"渐变",Yi.defaults.gradient,void 0,!0),new T([this,"radius"],"半径",Yi.defaults.radius,void 0,!0),new T([this,"blur"],"模糊",Yi.defaults.blur,!0),new W([this,"is3D"],"is3D",!1,!0)]}}};d(Yi,"createDefaultProps",()=>({...Dt.createDefaultProps(),is3D:g.react(!1),data:g.reactPositions([]),gradient:g.reactJsonWithUndefined({".5":"green",".7":"yellow",".95":"red"}),radius:g.react(10),blur:g.react(.85)})),d(Yi,"type",Yi.register("ESHeatMap",Yi,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"}));let bh=Yi;const _o=class _o extends yt{constructor(e){super(e);d(this,"editingBindMode","scatter")}};d(_o,"createDefaultProps",()=>({...yt.createDefaultProps(),pointed:!0})),d(_o,"type",_o.register("ESGeoPoints",_o,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:"地图中的可视化地理点集合"})),d(_o,"supportEditingModes",[...yt.supportEditingModes,$.ScatterAppend,$.ScatterModify]);let sl=_o;const Jv=async(r,t=[],e)=>{const n=[];for(const i of t){const{coordinates:s}=i.geometry;for(const o of s){const a=await Promise.all(o.map(async u=>{let l=u[2]??0;if(e)if(e.type==="absolute")l=e.height??l;else if(e.type==="relative"){const h=await r.getTerrainHeight([u[0],u[1]])??0;l=(e.height??l)+h}else e.type==="terrain"&&(l=await r.getTerrainHeight([u[0],u[1]])??0);return[u[0],u[1],l]}));n.push({...i,points:a})}}return n},jv=async(r,t=[],e)=>await Promise.all(t.map(async n=>{var u,l,h,c,f,p,m,_,E;const i=((u=n.geometry)==null?void 0:u.x)??((h=(l=n.geometry)==null?void 0:l.coordinates)==null?void 0:h[0]),s=((c=n.geometry)==null?void 0:c.y)??((p=(f=n.geometry)==null?void 0:f.coordinates)==null?void 0:p[1]);let a=((m=n.geometry)==null?void 0:m.z)??((E=(_=n.geometry)==null?void 0:_.coordinates)==null?void 0:E[2])??0;if(e)if(e.type==="absolute")a=e.height??a;else if(e.type==="relative"){const C=await r.getTerrainHeight([i,s])??0;a=(e.height??a)+C}else e.type==="terrain"&&(a=await r.getTerrainHeight([i,s])??0);return{...n,points:[i,s,a]}})),Qv=async(r,t=[],e)=>{const n=[];return await Promise.all(t.map(async i=>{const{coordinates:s}=i.geometry;await Promise.all(s.map(async o=>{const a=await Promise.all(o.map(async u=>{let l=u[2]??0;if(e)if(e.type==="absolute")l=e.height??l;else if(e.type==="relative"){const h=await r.getTerrainHeight([u[0],u[1]])??0;l=(e.height??l)+h}else e.type==="terrain"&&(l=await r.getTerrainHeight([u[0],u[1]])??0);return[u[0],u[1],l]}));n.push({...i,points:a})}))})),n};function BP(r){const t=Ir(r),e=Vg(t),n=Sc(t,e/2);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function HP(r,t){const e=Ir(r),n=Vg(e),i=Math.floor(n/t),s=[];if(s.push(r[0]),i<1)return[r[0]];for(let o=1;o<i;o+=1){const a=Sc(e,n*(o/i));s.push([a.geometry.coordinates[0],a.geometry.coordinates[1],a.geometry.coordinates[2]||0])}return s}function YP(r){const t=[...r];JSON.stringify(r[0])!==JSON.stringify(r[r.length-1])&&t.push(r[0]);const e=kt([t]),n=Sg(e);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function $v(r,t,e){const n=r.dv(new va);for(const i in e)i!=="type"&&(n[i]=e[i]);n.position=t,r.d(r.components.disposableAdd(n))}function Pd(r,t,e,n){let i=n.textTemplate||n.symbol.text||"";const s=/{{(.*?)}}/;for(;s.test(i);){const h=i.match(s);if(h){const c=h[1].trim(),f=e[`${c}`]||"-";i=i.replace(h[0],f)}}let o=n.symbol;const{minVisibleDistance:a,maxVisibleDistance:u}=n;a&&u&&(o={...o,minVisibleDistance:a,maxVisibleDistance:u});const l={...o,text:i};$v(r,t,l)}function Ea(r,t){const e={width:null,height:null,color:null,opacity:null,rotation:null};return t.forEach(n=>{n.type==="size"?n.axis==="width"?e.width=r[n.field]||null:n.axis==="height"&&(e.height=r[n.field]||null):n.type==="color"?e.color=r[n.field]||null:n.type==="opacity"?e.opacity=r[n.field]||null:n.type==="rotation"&&(e.rotation=r[n.field]||null)}),e}function Md(r,t,e){const i={...t.symbol};if(e&&e.length>0){const s=Ea(r,e);for(let o in s)i[o]!==void 0&&s[o]!==null&&(i[o]=s[o])}return i}function bd(r,t,e){var l,h;const n=t,{uniqueValueInfos:i,field:s,fieldDelimiter:o,defaultSymbol:a}=n;let u={...a};if(Array.isArray(s)){const f=s.map(p=>r[p]??"").join(o);u=((l=i.find(p=>p.value==f))==null?void 0:l.symbol)||a}else u=((h=i.find(c=>c.value==r[s]))==null?void 0:h.symbol)||a;if(e&&e.length>0){const c=Ea(r,e);for(let f in c)u[f]!==void 0&&c[f]!==null&&(u[f]=c[f])}return u}function xd(r,t,e){const n=t,{classBreakInfos:i,field:s,defaultSymbol:o}=n;let a=o;const u=r[s];if(u===void 0||typeof u!="number")a=o;else{const l=i.find(h=>u<=h.maxValue&&u>=h.minValue);l?a=l.symbol:a=o}if(e&&e.length>0){const l=Ea(r,e);for(let h in l)a[h]!==void 0&&l[h]!==null&&(a[h]=l[h])}return a}function JP(r,t){function e(l,h,c,f){const p=S=>S*Math.PI/180,m=S=>S*180/Math.PI,_=p(l),E=p(c),C=p(f-h),v=Math.sin(C)*Math.cos(E),y=Math.cos(_)*Math.sin(E)-Math.sin(_)*Math.cos(E)*Math.cos(C),w=Math.atan2(v,y);return(m(w)+360)%360}function n(l,h,c,f,p){const _=M=>M*Math.PI/180,E=M=>M*180/Math.PI,C=f/6371e3,v=_(p),y=_(l),w=_(h),S=Math.asin(Math.sin(y)*Math.cos(C)+Math.cos(y)*Math.sin(C)*Math.cos(v)),P=w+Math.atan2(Math.sin(v)*Math.sin(C)*Math.cos(y),Math.cos(C)-Math.sin(y)*Math.sin(S));return{lat:E(S),lng:E(P),alt:c}}function i(l){const h=[];l.length>1&&h.push(e(l[0].lat,l[0].lng,l[1].lat,l[1].lng));for(let c=1;c<l.length-1;c++){const f=e(l[c-1].lat,l[c-1].lng,l[c].lat,l[c].lng),p=e(l[c].lat,l[c].lng,l[c+1].lat,l[c+1].lng);let m=(f+p)/2;Math.abs(f-p)>180&&(m=(m+180)%360),h.push(m)}return l.length>1&&h.push(e(l[l.length-2].lat,l[l.length-2].lng,l[l.length-1].lat,l[l.length-1].lng)),l.length===1&&h.push(0),h}if(!r||r.length<2)throw new Error("至少需要两个点才能生成路径");if(t<=0)throw new Error("宽度必须大于0");const s=t/2,o=i(r),a=[],u=[];for(let l=0;l<r.length;l++){const h=(o[l]+90)%360,c=(o[l]+270)%360,f=r[l].alt!==void 0?r[l].alt:0;a.push(n(r[l].lat,r[l].lng,f,s,h)),u.push(n(r[l].lat,r[l].lng,f,s,c))}return a.concat(u.reverse())}function jP(r,t,e,n){function i(_){return _*(Math.PI/180)}const s=6378137,o=i(r),a=i(t),u=i(e),l=i(n),h=u-o,c=l-a,f=Math.sin(h/2)**2+Math.cos(o)*Math.cos(u)*Math.sin(c/2)**2,p=2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f));return s*p}const Kv=(r,t,e)=>Array.isArray(t)?t.map(s=>r[s]??"").join(e):r[t]??"";function Zv(r,t){const n={...t.symbol};return{points:r.map(i=>i.points),symbol:n}}function ty(r,t){const e=t,{uniqueValueInfos:n,field:i,fieldDelimiter:s,defaultSymbol:o}=e,a=[],u=n.reduce((h,c)=>{const f=c.value.toString();return h[f]={points:[],value:c.value,symbol:c.symbol},h},{});for(let h=0;h<r.length;h++){const c=r[h],f=Kv(c,i,s);if(f!==void 0&&f!==""){const p=u[f.toString()];p?p.points.push(c.points):a.push(c.points)}else a.push(c.points)}const l=[];for(let h in u){const{points:c,symbol:f}=u[h];c.length>0&&l.push({points:c,symbol:f})}return a.length>0&&l.push({points:a,symbol:o}),l}function ey(r,t){const e=t,{classBreakInfos:n,field:i,defaultSymbol:s}=e,o=[],a=n.map(l=>({...l,points:[]}));for(let l=0;l<r.length;l++){const h=r[l],c=h[i];if(c===void 0||typeof c!="number")o.push(h.points);else{const f=a.findIndex(p=>c<=p.maxValue&&c>=p.minValue);f!==-1?a[f].points.push(h.points):o.push(h.points)}}const u=[];return a.forEach(l=>{l.points.length>0&&u.push({points:l.points,symbol:l.symbol})}),o.length>0&&u.push({points:o,symbol:s}),u}function QP(r,t,e=[]){const i={...t.symbol},s=r.map(o=>{const a=Ea(o,e);return{position:o.points,rotation:a.rotation||i.rotation||[0,0,0],scale:i.scale||[1,1,1]}});return{url:i.url,locations:s}}function $P(r,t,e=[]){const n=t,{uniqueValueInfos:i,field:s,fieldDelimiter:o}=n,a=n.defaultSymbol,u=[],l=i.reduce((c,f)=>{const p=f.value.toString();return c[p]={locations:[],value:f.value,symbol:f.symbol},c},{});for(let c=0;c<r.length;c++){const f=r[c],p=Kv(f,s,o);if(p){const m=l[p.toString()];if(m){const _=Ea(f,e);m.locations.push({position:f.points,rotation:_.rotation||a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else u.push({position:f.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}else u.push({position:f.points,rotation:a.rotation||[0,0,0],scale:a.scale||[1,1,1]})}const h=[];for(let c in l){const{locations:f,symbol:p}=l[c];f.length>0&&h.push({url:p.url,locations:f})}return u.length>0&&h.push({url:a.url,locations:u}),h}function KP(r,t,e=[]){const n=t,{classBreakInfos:i,field:s}=n,o=n.defaultSymbol,a=[],u=i.map(h=>({...h,locations:[]}));for(let h=0;h<r.length;h++){const c=r[h],f=c[s];if(f===void 0||typeof f!="number")a.push({position:c.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]});else{const p=u.findIndex(m=>f<=m.maxValue&&f>=m.minValue);if(p!==-1){const m=Ea(c,e);u[p].locations.push({position:c.points,rotation:m.rotation||o.rotation||[0,0,0],scale:u[p].symbol.scale||[1,1,1]})}else a.push({position:c.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]})}}const l=[];return u.forEach(h=>{h.locations.length>0&&l.push({url:h.symbol.url,locations:h.locations})}),a.length>0&&l.push({url:o.url,locations:a}),l}class ZP extends B{constructor(e,n,i,s){super();d(this,"labelingInfo");this.sceneObject=e;const o=n;if(s&&g.forEach(o,a=>{this.renderLabel(a,s)}),i)if(i.type==="simple"){const{visualVariables:a}=i;if(i.symbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!");const u=Zv(o,i);this._simplePointAllRender(u.points,u.symbol);return}if(i.symbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!");const u=Zv(o,i);this._imageAllRender(u.points,u.symbol);return}if(i.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:u,locations:l}=QP(o,i,a);this._modelAllRender(u,l);return}for(let u=0;u<o.length;u++){const l=Md(o[u],i,a);this.render(o[u],l)}}else if(i.type==="unique-value"){const{visualVariables:a}=i;if(i.uniqueValueInfos.findIndex(c=>c.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),ty(o,i).forEach(({points:f,symbol:p})=>{this._simplePointAllRender(f,p)});return}if(i.uniqueValueInfos.findIndex(c=>c.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),ty(o,i).forEach(({points:f,symbol:p})=>{this._imageAllRender(f,p)});return}if(i.uniqueValueInfos.findIndex(c=>c.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),$P(o,i,a).forEach(({url:f,locations:p})=>{this._modelAllRender(f,p)});return}for(let c=0;c<o.length;c++){const f=bd(o[c],i,a);this.render(o[c],f)}}else if(i.type==="class-breaks"){const{visualVariables:a}=i;if(i.classBreakInfos.findIndex(c=>c.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染!"),ey(o,i).forEach(({points:f,symbol:p})=>{this._simplePointAllRender(f,p)});return}if(i.classBreakInfos.findIndex(c=>c.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!a||a.length==0)){console.log("PointLayer:大批量点渲染成图标!"),ey(o,i).forEach(({points:f,symbol:p})=>{this._imageAllRender(f,p)});return}if(i.classBreakInfos.findIndex(c=>c.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),KP(o,i,a).forEach(({url:f,locations:p})=>{this._modelAllRender(f,p)});return}for(let c=0;c<o.length;c++){const f=xd(o[c],i,a);this.render(o[c],f)}}else if(i.type==="heatmap"){const{field:a,fieldValueMax:u,fieldValueMin:l}=i;console.time();const h=o.map(c=>{const{points:f}=c;if(a&&typeof a=="string"){let p=c[a];typeof p=="number"&&(typeof u=="number"&&p>u&&(p=u),typeof l=="number"&&p<l&&(p=l),f[2]=p)}return f});this.renderHeatmap(h,i)}else console.error("PointLayer: renderer type is not supported")}renderLabel(e,n){const{points:i}=e;Pd(this.sceneObject,i,e,n)}renderHeatmap(e,n){const{is3D:i,radius:s,blur:o,gradient:a}=n,u=this.dv(new bh);this.d(this.sceneObject.components.disposableAdd(u)),u.is3D=i,u.radius=s,u.blur=o,a&&(u.gradient={...a}),u.data=e}render(e,n){n.type==="simple-point"?this._simplePointRender(e,n):n.type==="ESImageLabel"?this._simpleImageRender(e,n):n.type==="ESGltfModel"?this._simpleModelRender(e,n):n.type==="ESTextLabel"?$v(this.sceneObject,e.points,n):n.type==="ESParticleSystemPrimitive"?this._simpleParticleRender(e,n):console.error(" PointLayer: symbol type is not supported")}_simplePointRender(e,n){const{points:i}=e,{size:s,color:o,outlineColor:a,outlineWidth:u}=n,l=this.dv(new sl);this.d(this.sceneObject.components.disposableAdd(l)),l.pointed=!0,l.pointOutlineColor=a,l.pointOutlineWidth=u,l.pointSize=s,l.pointColor=o,l.allowPicking=(n==null?void 0:n.allowPicking)??!0,l.extras={selected:!1},l.points=[i]}_simplePointAllRender(e,n){const{size:i,color:s,outlineColor:o,outlineWidth:a}=n,u=this.dv(new sl);this.d(this.sceneObject.components.disposableAdd(u)),u.pointed=!0,u.pointOutlineColor=o,u.pointOutlineWidth=a,u.pointSize=i,u.pointColor=s,u.allowPicking=(n==null?void 0:n.allowPicking)??!0,u.points=[...e]}_simpleImageRender(e,n){const{points:i}=e,{rotation:s,offset:o,size:a,url:u,screenRender:l,anchor:h,renderMode:c,rotationType:f}=n,p=this.dv(new Eh),m=this.dv(new va);this.d(this.sceneObject.components.disposableAdd(p)),this.d(this.sceneObject.components.disposableAdd(m)),p.url=u,p.renderMode=c??0,s&&(p.rotation=s),o&&(p.offset=o),p.size=a||[32,32],h&&(p.anchor=h),f&&(p.rotationType=f),p.screenRender=l??!0,p.allowPicking=(n==null?void 0:n.allowPicking)??!0,p.extras={selected:!1},p.position=[...i],p.sizeByContent=!1,m.allowPicking=(n==null?void 0:n.allowPicking)??!0;const _=a?Math.max(...a)+10:Math.max(...p.size)+10;m.sizeByContent=!1,m.screenRender=!0,m.size=[_,_],m.borderRadius=[_,_,_,_],m.padding=[_/2,_/2,_/2,_/2],m.borderWidth=_/10,m.offset=[0,_/10+5],m.text="",m.backgroundColor=[0,0,0,0],m.borderColor=[0,0,0,0]}_imageAllRender(e,n){const i={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:e}}]},s=this.dv(new el);this.d(this.sceneObject.components.disposableAdd(s));const o=this.dv(new va);this.d(this.sceneObject.components.disposableAdd(o)),s.textDefaultText="";const{offset:a,size:u,url:l,anchor:h}=n;s.imageUrl=l,h&&(s.imageAnchor=h),a&&(s.imageOffset=a),s.imageSize=u||[32,32],s.url=i,s.allowPicking=(n==null?void 0:n.allowPicking)??!0,s.extras={selected:!1},o.allowPicking=!0;const c=u?Math.max(...u)+10:Math.max(...s.imageSize)+10;o.sizeByContent=!1,o.size=[c,c],o.borderRadius=[c,c,c,c],o.padding=[c/2,c/2,c/2,c/2],o.borderWidth=c/10,o.offset=[0,c/10+5],o.text="",o.backgroundColor=[0,0,0,0],o.borderColor=[0,0,0,0]}_simpleModelRender(e,n){const{points:i}=e,{rotation:s,scale:o,url:a}=n,u=this.dv(new _s);this.d(this.sceneObject.components.disposableAdd(u)),u.url=a,s&&(u.rotation=s),o&&(u.scale=o),u.position=[...i]}_modelAllRender(e,n){const i=this.dv(new _s);this.d(this.sceneObject.components.disposableAdd(i)),i.url=e,i.instances=n}_simpleParticleRender(e,n){const{points:i}=e,s=this.dv(new Sh);this.d(this.sceneObject.components.disposableAdd(s)),s.position=[...i],Object.keys(n).forEach(o=>{s[o]=n[o]})}}class tM extends B{constructor(t,e,n,i){super(),this.sceneObject=t;const s=e;if(i&&g.forEach(s,o=>{this.renderLabel(o,i)}),n)if(n.type==="simple"){const{visualVariables:o}=n;g.forEach(s,a=>{const u=Md(a,n,o);this.render(a,u)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;g.forEach(s,a=>{const u=bd(a,n,o);this.render(a,u)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;g.forEach(s,a=>{const u=xd(a,n,o);this.render(a,u)})}else console.error("PolyLineLayer: renderer type is not supported")}render(t,e){console.log("PolyLineLayer: render",t,e),e.type==="simple-line"?this._simpleLineRender(t,e):e.type==="ESPolygonFence"?this._esPolygonFenceRender(t,e):e.type==="ESPipeFence"?this._esPipeFenceRender(t,e):e.type==="ESPath"?this._esPathRender(t,e):e.type==="ESlineInterpolationModel"?this._eslineInterpolationModelRender(t,e):e.type==="ESlineWall"?this._eslineWallRender(t,e):console.error("PolyLineLayer: symbol type is not supported")}_simpleLineRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new qi);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...n],i.stroked=!0,i.strokeColor=e.color,i.strokeWidth=e.width||1,i.allowPicking=(e==null?void 0:e.allowPicking)??!0,i.extras={selected:!1}}_esPolygonFenceRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new Mh);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...n],i.height=e.height,i.materialMode=e.materialMode}_esPipeFenceRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new Ph);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...n],i.height=e.height,i.width=e.width,i.materialMode=e.materialMode}_esPathRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new wa),s=this.dv(new _a);if(this.d(this.sceneObject.components.disposableAdd(i)),this.d(this.sceneObject.components.disposableAdd(s)),i.points=[...n],i.speed=e.speed,i.strokeColor=e.color,i.materialMode=e.materialMode,i.strokeWidth=e.width||1,e!=null&&e.runModel){const a=e==null?void 0:e.runSpeed,u=e==null?void 0:e.modelSymbol;let l;switch(e==null?void 0:e.runModel){case"ESHuman":l=this.dv(new to);break;case"ESCar":l=this.dv(new yh);break;case"ESGltfModel":l=this.dv(new _s)}if(this.d(this.sceneObject.components.disposableAdd(l)),u)for(let c in u)l[c]=u[c];const h=[0];for(var o=0;o<n.length-1;o+=1){const c=n[o],f=n[o+1],p=jP(c[1],c[0],f[1],f[0]);h.push(h[o]+Math.ceil(p/a)*1e3)}i.timeStamps=h,e!=null&&e.runSpeed&&(i.currentPositionChanged.don(c=>{i.currentPosition&&(l.position=i.currentPosition,i.currentRotation&&(l.rotation=i.currentRotation))}),s.startTime=0,s.stopTime=h[h.length-1],s.playing=!0,s.loop=(e==null?void 0:e.runLoop)??!0,s.currentTimeChanged.don(c=>{i.path.currentTime=c}))}}_eslineInterpolationModelRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=(e==null?void 0:e.interpolationDistance)??0;if(!i)return;const s=HP(n,i/1e3),o=this.dv(new _s);this.d(this.sceneObject.components.disposableAdd(o)),o.url=e.url,o.instances=s.map(a=>({position:a,rotation:e.rotation,scale:e.scale}))}_eslineWallRender(t,e){const{points:n}=t;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=e.height??0,s=e.width??0,o=e.extrudedHeight??0,a=n.map(h=>({lng:(h==null?void 0:h[0])??0,lat:(h==null?void 0:h[1])??0,alt:(h==null?void 0:h[2])??0})),u=JP(a,s).map(h=>[(h==null?void 0:h.lng)??0,(h==null?void 0:h.lat)??0,(h==null?void 0:h.alt)??0]),l=this.dv(new eo);this.d(this.sceneObject.components.disposableAdd(l)),l.height=i,l.extrudedHeight=o,l.filled=e.filled??!0,l.fillColor=e.fillColor,l.allowPicking=(e==null?void 0:e.allowPicking)??!0,l.extras={selected:!1},l.points=u}renderLabel(t,e){const{points:n}=t,i=BP(n);Pd(this.sceneObject,i,t,e)}}function ry(r,t){try{JSON.stringify(r[r.length-1])!==JSON.stringify(r[0])&&r.push(r[0]);const e=Lr(r.map(u=>xt(u))),n=kt([r]);return HI(e,t,{gridType:"point",units:"meters"}).features.map(u=>u.geometry.coordinates)[0][0].filter(u=>be(xt(u),n))}catch(e){return console.error(e),[]}}class eM extends B{constructor(t,e,n,i){super(),this.sceneObject=t;const s=e;if(i&&g.forEach(s,o=>{this.renderLabel(o,i)}),n)if(n.type==="simple"){const{visualVariables:o}=n;g.forEach(s,a=>{const u=Md(a,n,o);this.render(a,u)})}else if(n.type==="unique-value"){const{visualVariables:o}=n;g.forEach(s,a=>{const u=bd(a,n,o);this.render(a,u)})}else if(n.type==="class-breaks"){const{visualVariables:o}=n;g.forEach(s,a=>{const u=xd(a,n,o);this.render(a,u)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(t,e){const{points:n}=t;console.log("PolygonLayer: renderLabel",n);const i=YP(n);Pd(this.sceneObject,i,t,e)}render(t,e){e.type==="simple-fill"?this._simplePolygonRender(t,e):e.type==="ESGeoExtrudedPolygon"?this._esGeoExtrudedPolygonRender(t,e):e.type==="PolygonInterpolateESGltfModel"?this._polygonInterpolateESGltfModelRender(t,e):e.type==="PolygonInterpolateESImageLabel"?this._polygonInterpolateESImageLabelRender(t,e):console.error("PolyLineLayer: symbol type is not supported")}_simplePolygonRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{color:i,outline:s,filled:o,ground:a}=e,{width:u,color:l,stroked:h}=s,c=this.dv(new Ut);this.d(this.sceneObject.components.disposableAdd(c)),c.stroked=h??!1,c.strokeColor=l??[1,1,1,1],c.strokeWidth=u??1,c.filled=o??!0,c.fillGround=a??!1,c.fillColor=i??[1,1,1,1],c.allowPicking=(e==null?void 0:e.allowPicking)??!0,c.extras={selected:!1},c.points=[...n]}_esGeoExtrudedPolygonRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,extrudedHeight:s,color:o}=e,a=this.dv(new eo);this.d(this.sceneObject.components.disposableAdd(a)),a.height=i,a.extrudedHeight=s,a.filled=!0,a.fillColor=o,a.allowPicking=(e==null?void 0:e.allowPicking)??!0,a.extras={selected:!1},a.points=[...n]}_polygonInterpolateESGltfModelRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,interpolateDistance:s,url:o,rotation:a,scale:u}=e,l=ry(n,s??10),h=this.dv(new _s);this.d(this.sceneObject.components.disposableAdd(h)),h.url=o,h.instances=l.map(c=>({position:[...c,i??0],rotation:a??[0,0,0],scale:u??[1,1,1]}))}_polygonInterpolateESImageLabelRender(t,e){const{points:n}=t;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,interpolateDistance:s,offset:o,size:a,url:u,anchor:l}=e,c={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...ry(n,s??10).map(p=>[...p,i??0])]}}]},f=this.dv(new el);this.d(this.sceneObject.components.disposableAdd(f)),f.textDefaultText="",f.imageUrl=u,l&&(f.imageAnchor=l),o&&(f.imageOffset=o),a&&(f.imageSize=a),f.url=c}}class rM extends B{constructor(e,n){super();d(this,"_initEvent",this.dv(new V));const i=this,s=async()=>{try{const a=e.featureProps;if(!a)return;const{heightMode:u,features:l,layerType:h,url:c}=a;let f=[];if(!l&&c){let p=await fetch(c).then(m=>m.json());return p=(p==null?void 0:p.features)??p,h==="polylineVector"?f=await Jv(n,p,u):h==="polygonVector"?f=await Qv(n,p,u):h==="pointVector"&&(f=await jv(n,p,u)),f}else h==="polylineVector"?f=await Jv(n,l,u):h==="polygonVector"?f=await Qv(n,l,u):h==="pointVector"&&(f=await jv(n,l,u));return f}catch(a){console.error(a);return}},o=this.dv(g.createNextAnimateFrameEvent(this._initEvent,e.featurePropsChanged));i.dv(new g.ObjResettingWithEvent(o,()=>{if(!e.featureProps)return;const a=e.featureProps;let u;return(async()=>{const{layerType:h,renderer:c,labelingInfo:f}=a,p=await s();!p||p.length===0||(h==="pointVector"?u=new ZP(e,p,c,f):h==="polylineVector"?u=new tM(e,p,c,f):h==="polygonVector"&&(u=new eM(e,p,c,f)),console.log("polygonVectorLayer","createLayer",u))})().catch(console.error),{destroy:()=>{var h;(h=u==null?void 0:u.destroy)==null||h.call(u),u=void 0}}}));{const a=(u,l=1)=>{const h=wv(u);if(!h)return;const{center:c,radius:f}=h;n.flyTo({distance:f*4,heading:0,pitch:-90,flyDuration:l??1,hDelta:0,pDelta:0},c)};i.d(e.flyToEvent.don(async u=>{const{featureProps:l}=e;if(!l)return;const h=await s();if(!h)return;let c=[];l.layerType==="polylineVector"?c=h.map(f=>f.points).flat():l.layerType==="polygonVector"?c=h.map(f=>f.points).flat():l.layerType==="pointVector"&&(c=h.map(f=>f.points)),c.length!==0&&a(c,u)}))}}init(){this._initEvent.emit()}}const Ka=class Ka extends Dt{constructor(e){super(e);d(this,"featureLayerMap",new Map);const n=this;n.d(n.viewerAttached.don(i=>{if(console.log("ESFeatureLayer","viewerAttached",i.id),n.featureLayerMap.has(i.id))return;const s=new rM(n,i);s.init(),n.featureLayerMap.set(i.id,s)})),n.d(n.viewerDetached.don(i=>{var s;console.log("ESFeatureLayer","viewerDetached",i.id),n.featureLayerMap.has(i.id)&&((s=n.featureLayerMap.get(i.id))==null||s.destroy(),n.featureLayerMap.delete(i.id))})),n.d(()=>{for(const i of n.featureLayerMap.values())i.destroy();n.featureLayerMap.clear()}),n.d(Co(n.showChanged,()=>{for(const i of n.components.values())Reflect.has(i,"show")&&(i.show=n.show)},{immediate:!0}))}};d(Ka,"createDefaultProps",()=>({...Dt.createDefaultProps(),featureProps:g.reactJsonWithUndefined(void 0)})),d(Ka,"type",Ka.register("ESFeatureLayer",Ka,{chsName:"矢量图层",tags:["ESObjects"],description:"ESFeatureLayer"}));let Nd=Ka;function ny(r){return typeof r=="string"?document.getElementById(r):r}function Td(r){if(!r)throw new Error("container is not defined");r.innerHTML="";const t=document.createElement("div");return t.style.cssText="width: 100%; height: 100%; margin: 0px; padding: 0px; border: none; overflow: hidden; position: relative; z-index: 0; background: rgba(0,0,0,0);",r.appendChild(t),t}class iy extends B{constructor(e,n){super();d(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=e,this._createSceneObjectListeningFunc=n;const i=this._listeningSceneObjects,s=(o,a)=>{if(o)for(let u of o){const l=i.get(u);l&&(l.destroy(),i.delete(u))}if(a)for(let u of a){if(i.get(u)){console.warn(`listeningSceneObjects已存在某对象:${u.name}`,u);debugger}const h=this.createSceneObjectListeningFunc(u);h&&i.set(u,h)}};s(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(s)),this.dispose(()=>{for(let o of this._listeningSceneObjects.values())o.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class nM extends B{constructor(t){super(),this._esObjectsManager=t;{const e=this._esObjectsManager;class n extends B{constructor(s){super(),this._esPath=s,this.dv(new g.ObjResettingWithEvent(e.activeViewerChanged,()=>{const o=e.activeViewer;if(!o)return;class a extends B{constructor(l){if(super(),this._esPath=l,!o)throw new Error("!viewer");const h=()=>{const c=e.activeViewer;c&&(this._esPath.path.currentTime=c.simulationTime)};h(),this.d(o.simulationTimeChanged.don(h))}}return new a(this._esPath)}))}}this.dv(new iy(e.sceneObjectsManager,i=>{if(i instanceof wa)return new n(i)}))}{const e=this._esObjectsManager;class n extends B{constructor(s){super();const o=()=>{const a=e.activeViewer;a&&(a.simulationTime=s.currentTime??0)};o(),this.d(s.currentTimeChanged.don(o))}}this.dv(new iy(e.sceneObjectsManager,i=>{if(i instanceof _a)return new n(i)}))}}}class iM extends B{constructor(t){super(),t.forEach(e=>{this.d(e.path.currentPositionChanged.don(n=>{n&&e.sceneObjects.forEach(i=>{Reflect.has(i,"position")&&(i.position=[...n])})})),this.d(e.path.currentRotationChanged.don(n=>{n&&e.sceneObjects.forEach(i=>{Reflect.has(i,"rotation")&&(i.rotation=[...n])})}))})}}class sM extends B{constructor(e){super();d(this,"_player");d(this,"_channels",this.dv(g.reactArray([])));this._objectManager=e,this._player=this._objectManager.player,this.dv(new g.ObjResettingWithEvent(this.channelsChanged,()=>{if(this.channels.length===0)return;const n=[];for(let i=0;i<this.channels.length;i++){const s=this.channels[i],o=K.getSceneObjById(s.pathId);if(!o||!(o instanceof wa))continue;const u=s.sceneObjectIds.map(l=>K.getSceneObjById(l)).filter(l=>l!==void 0);u.length!==0&&n.push({path:o,sceneObjects:u})}if(n.length!==0)return new iM(n)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(e){this._channels.value=e}}function xh(r){if(r.data){const{type:t,value:e}=r.data;if(t==="UITreeA"&&e instanceof ir){const{sceneObject:n}=e;if(n)return n.id}}}function oM(r,t){const{property:e,customEventName:n,otherParams:i}=t,{dragstartDataMananger:s}=r;if(!(e instanceof Io)){if(!(e instanceof Yd)){if(e instanceof ot){const[o,a]=g.getReactFuncs(e.reactVar);if(n==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const u=i[0];if(u.preventDefault(),!u.dataTransfer)return;xh(s)?u.dataTransfer.dropEffect="move":u.dataTransfer.dropEffect="none"}else if(n==="ondrop"){if(!i)throw new Error("!otherParams");i[0].preventDefault();const l=xh(s);l!==void 0&&a(l)}}else if(e instanceof qd){const[o,a]=g.getReactFuncs(e.reactVar);if(n==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const u=i[0];if(u.preventDefault(),!u.dataTransfer)return;xh(s)?u.dataTransfer.dropEffect="move":u.dataTransfer.dropEffect="none"}else if(n==="ondrop"){if(!i)throw new Error("!otherParams");const u=i[0].$event,l=i[0].strinsPropDom,h=i[0].index;u.preventDefault();const c=xh(s);if(c!==void 0){l[h].firstChild.value=c;const f=new Event("input",{bubbles:!0,cancelable:!0});l[h].firstChild.dispatchEvent(f)}}}else if(e instanceof Wd){const[o,a]=g.getReactFuncs(e.reactVar)}}}}function sy(r,t,e,n){if(e)n.currentActiveEditing=[r,t];else if(n.currentActiveEditing){const[i,s]=n.currentActiveEditing;i===r&&s===t&&(e||(n.currentActiveEditing=void 0))}}const aM=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class uM extends B{constructor(t,e){super(),this._sceneObject=t;const n=this._sceneObject;for(let i of aM){const s=i+"Changed",o=n[s];if(o){{const a=n[i];sy(n,i,a,e)}this.dispose(o.disposableOn((a=>sy(n,i,a,e))))}}}get sceneObject(){return this._sceneObject}}class lM extends B{constructor(){super();d(this,"_currentActiveEditing",this.disposeVar(g.reactArrayWithUndefined(void 0)));d(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((e,n)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),n){const[i,s]=n;i[s]===!0&&(i[s]=!1)}if(e){const[i,s]=e;i[s]=!0}})),K.context.sceneObjCreatedEvent.don(e=>{e.dv(new uM(e,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(e){this._currentActiveEditing.value=e}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class hM extends B{constructor(){super();d(this,"_sceneObjects",new Set);d(this,"_sceneObjectsToChange",this.dv(new V));this.d(()=>{const e=g.length(this._sceneObjects);e!==0&&console.warn(`场景对象管理器销毁时仍然管理着${e}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(e){return this._sceneObjects.has(e)?(console.warn(`创建失败:对象${e.typeName+":"+e.id}已经存在于场景对象管理器中!}`),!1):(this._sceneObjectsToChange.emit([],[e]),this._sceneObjects.add(e),!0)}deleteSceneObject(e){return this._sceneObjects.has(e)?(this._sceneObjectsToChange.emit([e],[]),this._sceneObjects.delete(e),!0):(console.warn(`删除失败:对象${e.typeName+":"+e.id}不存在于场景对象管理器中!}`),!1)}createSceneObject(e,n){const i=K.context.createSceneObject(e,n);return i&&this.addSceneObject(i),i}createSceneObjectFromUrl(e,n){const i=K.context.createSceneObjectFromUrl(e,n);return i&&this.addSceneObject(i),i}createSceneObjectFromClass(e,n){const i=K.context.createSceneObjectFromClass(e,n);return i&&this.addSceneObject(i),i}createSceneObjectFromJson(e){const n=K.context.createSceneObjectFromJson(e);return n&&this.addSceneObject(n),n}}function oy(r,t){return r.length===t.length&&r.every((e,n)=>e===t[n])}class cM extends B{constructor(t){super(),this._viewer=t,this.d(g.track([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class fM extends B{constructor(t,e){super(),this._viewer=t,this._activeViewer=e;const n=Xn.createCommonProps(),i=[];Object.keys(n).forEach(u=>{const l=this._activeViewer[u+"Changed"];i.push(l)});const s=this.dv(g.createNextAnimateFrameEvent(...i)),o=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(n).forEach(u=>{this._viewer[u]=this._activeViewer[u]})};this.d(s.don(o));const a=this.dv(g.createAnimateFrame());a.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const u=this._activeViewer.getCurrentCameraInfo(),l=this._viewer.getCurrentCameraInfo();if(!u)return;const{position:h,rotation:c}=u;l&&oy(h,l.position)&&oy(c,l.rotation)||this._viewer.flyIn(h,c,0)}),this.d(()=>a.cancel())}}const dM=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="40" height="40" style="shape-rendering: auto; display: block; background: rgba(255, 255, 255, 0);" xmlns:xlink="http://www.w3.org/1999/xlink"><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#ffffff" stroke-width="8" r="32" cy="50" cx="50">
471
491
  <animateTransform values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform>
472
492
  </circle><g></g></g></svg>
473
- `,GI='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',kI='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',Xo=class Xo extends d.Destroyable{constructor(t){super();const e=()=>{const n=this.dv(new Vh);this.d(d.track([n,"show"],[t,"useDefaultStatusDiv"]));{const i=()=>{n.show=(t.useDefaultStatusDiv??!0)&&t.status!=="Created"};i(),this.d(t.useDefaultStatusDivChanged.don(i)),this.d(t.statusChanged.don(i)),n.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}t.add(n),this.d(()=>t.delete(n)),n.instanceClass=class extends d.Destroyable{constructor(o,a,u){super();g(this,"_div",document.createElement("div"));if(this._subContainer=o,!u)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const v=()=>{a.show?this._div.style.opacity="1":this._div.style.opacity="0"};v(),this.d(a.showChanged.don(v))}let l,h,c,f,p;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",l=document.createElement("div"),this._div.appendChild(l),l.style.width="auto",l.style.position="absolute",l.style.left="50%",l.style.top="50%",l.style.transform="translate(-50%,-50%)",l.style.background="rgba(120, 120, 0, 0.7)",l.style.color="white",l.style.fontSize="10px",l.style.background="none",l.style.display="flex",l.style.justifyContent="center",l.style.alignItems="center",h=document.createElement("div"),l.appendChild(h),h.style.pointerEvents="none",h.style.display="block",h.style.width="40px",h.innerHTML=Xo.defaultsSvg.loadingSvg,h.style.filter="drop-shadow(0px 0px 1px black)",c=document.createElement("div"),l.appendChild(c),c.style.pointerEvents="none",c.style.marginLeft="10px",c.style.display="flex",c.style.flexFlow="column",c.style.maxWidth="300px",f=document.createElement("div"),c.appendChild(f),f.style.fontSize="14px",f.style.fontWeight="800",f.style.marginBottom="5px",f.style.textShadow="0 0 2px black",p=document.createElement("div"),c.appendChild(p),p.style.fontWeight="400",p.style.textShadow="0 0 2px black";{const v=()=>{let w="Raw";u.status==="Raw"?w="初始状态":u.status==="Creating"?w="正在创建":u.status==="Created"?w="创建完成":u.status==="Error"?w="创建失败":u.status==="Reconnecting"&&(w="重新连接"),f.innerText=`${w}(${u.status})`,p.innerText=`${u.statusLog}`,(u.status==="Creating"||u.status==="Reconnecting")&&(h.innerHTML=Xo.defaultsSvg.loadingSvg),u.status==="Created"&&(h.innerHTML=Xo.defaultsSvg.successSvg),u.status==="Error"&&(h.innerHTML=Xo.defaultsSvg.warnSvg)};v();const _=this.dv(d.createNextAnimateFrameEvent(u.statusLogChanged,u.statusChanged));this.d(_.don(v))}}update(){const o=255*Math.random()|0,a=255*Math.random()|0,u=255*Math.random()|0;this._div.style.background=`rgba(${o}, ${a}, ${u}, 0.8)`}}};this.d(t.containerChanged.don(()=>{e()}))}};g(Xo,"defaultsSvg",{loadingSvg:FI,successSvg:GI,warnSvg:kI});let Kd=Xo;class VI extends d.Destroyable{constructor(t,e,n){super(),this._subContainer=t,this._overlayContainer=e,this._viewer=n;const i=this._subContainer,s=this._overlayContainer,o=this._viewer,a=()=>{const h=o.zIndex??"";i.style.zIndex=h,s.style.zIndex=h};a(),this.d(o.zIndexChanged.don(a));const u=()=>{i.style.display=o.show??!0?"block":"none"};u(),this.d(o.showChanged.don(u));const l=()=>{i.style.opacity=`${o.opacity??1}`};l(),this.d(o.opacityChanged.don(l))}}function Wh(r){let t=d.getExtProp(r,"_relativeContainer");return t||(t=document.createElement("div"),t.style.position="relative",t.style.width="100%",t.style.height="100%",t.style.padding="0",t.style.margin="0",r.appendChild(t),d.setExtProp(r,"_relativeContainer",t)),t}class UI extends d.Destroyable{constructor(e,n){super();g(this,"_subContainer",document.createElement("div"));g(this,"_overlayContainer",document.createElement("div"));g(this,"_containerStyleController");this._container=e,this._viewer=n,this._containerStyleController=this.dv(new VI(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:i,overlayContainer:s}=this;i.tabIndex=-1,i.style.outline="none",i.style.width="100%",i.style.height="100%",i.onpointerdown=()=>i.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),i.setAttribute("earthsdk3","earthsdk3-subContainer"),Wh(this._container).appendChild(i),this.d(()=>Wh(this._container).removeChild(i)),Wh(this._container).appendChild(s),this.d(()=>Wh(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class zI extends d.Destroyable{constructor(){super(...arguments);g(this,"registerObjsMap",new Map)}register(e,n){return this.registerObjsMap.has(e)&&console.warn(`register warn:${e}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(e,n),e}getViewerConstructor(e){const n=this.registerObjsMap.get(e);if(!n){console.warn(`未找到${e}类!`);return}return n}createViewer(e){const n=e.type;console.log(e);const i=this.getViewerConstructor(n);if(!i)throw new Error(`没有找到类型为${n}的Viewer构造器!`);return new i(e)}}class sm extends d.Destroyable{constructor(t,e,n=!1,i=!1){if(super(),this._viewer=t,!e)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(d.DomElementEvent.create(e,"pointerdown")),o=this.dv(d.DomElementEvent.create(e,"pointermove")),a=this.dv(d.DomElementEvent.create(e,"pointerup")),u=this.dv(d.DomElementEvent.create(e,"pointerout")),l=this.dv(d.DomElementEvent.create(e,"pointerover")),h=this.dv(new d.PointerClick),c=this.dv(new d.PointerHover),f=()=>{const m=this._viewer.hoverTime*1e3;c.delayTime=m};this.d(this._viewer.hoverTimeChanged.don(()=>{f()})),this.d(s.don(m=>h.pointerDown(m))),this.d(o.don(m=>h.pointerMove(m))),this.d(a.don(m=>h.pointerUp(m))),this.d(u.don(m=>h.pointerOut(m))),this.d(s.don(m=>c.pointerDown(m))),this.d(o.don(m=>c.pointerMove(m))),this.d(a.don(m=>c.pointerUp(m))),this.d(u.don(m=>c.pointerOut(m)));const{x:p,y:v}=e.getBoundingClientRect(),_=i?p:0,w=i?v:0;this.d(c.hoverEvent.don(m=>{const[S,C]=d.getDomEventCurrentTargetPos(m,n);this._viewer.hoverEvent.emit({screenPosition:[S+_,C+w],pointerEvent:m})})),this.d(h.clickEvent.don(m=>{const[S,C]=d.getDomEventCurrentTargetPos(m,n);this._viewer.clickEvent.emit({screenPosition:[S+_,C+w],pointerEvent:m})})),this.d(h.dbclickEvent.don(m=>{const[S,C]=d.getDomEventCurrentTargetPos(m,n);m.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[S+_,C+w],pointerEvent:m})})),this.d(s.don(m=>{const[S,C]=d.getDomEventCurrentTargetPos(m,n);m.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[S+_,C+w],pointerEvent:m})})),this.d(a.don(m=>{const[S,C]=d.getDomEventCurrentTargetPos(m,n);m.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[S+_,C+w],pointerEvent:m})})),this.d(o.don(m=>{const[S,C]=d.getDomEventCurrentTargetPos(m,n);this._viewer.pointerMoveEvent.emit({screenPosition:[S+_,C+w],pointerEvent:m})})),this.d(l.don(m=>{const[S,C]=d.getDomEventCurrentTargetPos(m,n);this._viewer.pointerOverEvent.emit({screenPosition:[S+_,C+w],pointerEvent:m})})),this.d(u.don(m=>{const[S,C]=d.getDomEventCurrentTargetPos(m,n);this._viewer.pointerOutEvent.emit({screenPosition:[S+_,C+w],pointerEvent:m})}));const I=this.dv(d.DomElementEvent.create(e,"keydown"));this.d(I.don(m=>this._viewer.keyDownEvent.emit(m)));const y=this.dv(d.DomElementEvent.create(e,"keyup"));this.d(y.don(m=>this._viewer.keyUpEvent.emit(m)));const E=this.dv(d.DomElementEvent.create(e,"wheel"));this.d(E.don(m=>this._viewer.wheelEvent.emit(m)))}}class qI extends d.Destroyable{constructor(e){super();g(this,"viewer");const n=this.viewer=e;this.ad(new d.ObjResettingWithEvent(n.rollerShutterChanged,()=>{const i=n.container;if(!i||!n.rollerShutter)return;const s=new d.Destroyable;this.viewer.splitPosition=.5;let o=this.getRollerShutterDIV();return i.appendChild(o),s.d(()=>{this.viewer.splitPosition=0,i.removeChild(o)}),s}))}getRollerShutterDIV(){let e=document.createElement("div");e.style.position="absolute",e.style.left="50%",e.style.top="0",e.style.backgroundColor="#d3d3d3",e.style.width="5px",e.style.height="100%",e.style.zIndex="9999";const n=i=>{if(!e.parentElement)return;i.preventDefault?i.preventDefault():i.returnValue=!1;const o=i.x/e.parentElement.offsetWidth;e.style.left=`${100*o}%`,this.viewer.splitPosition=o};return e.addEventListener("mouseenter",i=>{e.style.cursor="ew-resize"}),e.addEventListener("mouseleave",i=>{e.style.cursor="default"}),e.addEventListener("mousedown",i=>{e.style.cursor="ew-resize",document.addEventListener("mousemove",n)}),document.addEventListener("mouseup",i=>{e.style.cursor="default",document.removeEventListener("mousemove",n)}),e}}class WI extends d.Destroyable{constructor(e){super();g(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new qI(e))}}const ms=class ms extends d.Destroyable{constructor(e){super();g(this,"_forceRecreateEvent",this.dv(new d.Event));g(this,"_container",this.dv(d.react(void 0)));g(this,"_containerSize",this.dv(d.react(void 0)));g(this,"_editingEvent",this.disposeVar(new d.Event));g(this,"_status",this.dv(d.react("Raw")));g(this,"_statusLog",this.dv(d.react("")));g(this,"_statusContainer",this.dv(new Kd(this)));g(this,"_useCustomInteraction",this.dv(d.react(!0)));g(this,"_resetInteractionEvent",this.dv(d.createNextAnimateFrameEvent(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));g(this,"_interactionResetting",this.dv(new d.ObjResettingWithEvent(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new sm(this,this.container)})));g(this,"_viewerChanged",this.dv(new d.Event));g(this,"_cameraChanged",this.dv(new d.Event));g(this,"_containerResetEvent",this.dv(d.createNextAnimateFrameEvent(this.containerChanged,this._forceRecreateEvent)));g(this,"_containerResetting",this.dv(new d.ObjResettingWithEvent(this._containerResetEvent,()=>{if(this.container)return new UI(this.container,this)})));g(this,"_sceneObjectsMap",new Map);g(this,"_id");g(this,"_typeName");g(this,"_updateFuncReact",this.dv(d.react(void 0)));g(this,"_toDestroyFuncReact",this.dv(d.react(void 0)));g(this,"_statusInfo",ms.defaults.statusInfo);g(this,"_navigationMode",this.dv(d.react("Map")));g(this,"_syncViewer",this.dv(d.react(void 0)));g(this,"_syncEventDon",this.dv(new d.ObjResettingWithEvent(this.syncViewerChanged,()=>{const e=this.syncViewer;if(e)return new RI(this,e)})));g(this,"_timeSyncdon",this.dv(new d.ObjResettingWithEvent(this.timeSyncChanged,()=>{if(this.timeSync)return new LI(this)})));g(this,"_hoverEvent",this.dv(new d.Event));g(this,"_pointerOverEvent",this.dv(new d.Event));g(this,"_pointerMoveEvent",this.dv(new d.Event));g(this,"_pointerDownEvent",this.dv(new d.Event));g(this,"_pointerUpEvent",this.dv(new d.Event));g(this,"_pointerOutEvent",this.dv(new d.Event));g(this,"_clickEvent",this.dv(new d.Event));g(this,"_dblclickEvent",this.dv(new d.Event));g(this,"_keyDownEvent",this.dv(new d.Event));g(this,"_keyUpEvent",this.dv(new d.Event));g(this,"_wheelEvent",this.dv(new d.Event));g(this,"_actived",this.dv(d.react(!1)));this._id=e.id??d.createGuid();const n=em(e.container);if(n)this._container.value=Qd(n),this._typeName=e.type,this._initName();else throw new Error("container is not defined");{const i=()=>{n&&(this.show??!0?n.style.display="block":n.style.display="none")};i(),this.d(this.showChanged.don(i))}{const i=this._sceneObjectsMap,s=()=>{for(let[a,u]of i.entries())if(!u&&a){const l=eo.context.createEngineObject(a,this);l&&i.set(a,l)}},o=()=>{for(let[a,u]of i.entries())u&&!u.isDestroyed()&&u.destroy(),i.set(a,void 0)};this.d(o),this.d(this.viewerChanged.don(a=>{o(),a&&s()}))}{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||d.createAnimateFrame(),s.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new WI(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(e){this._container.value=e}set containerOrId(e){if(typeof e=="string"){const n=document.getElementById(e);n&&n instanceof HTMLDivElement?this._container.value=Qd(n):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else e instanceof HTMLDivElement?this._container.value=Qd(e):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(e){this._containerSize.value=e}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(e){this._status.value=e}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(e){this._statusLog.value=e}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(e){this._useCustomInteraction.value=e}get viewerChanged(){return this._viewerChanged}get cameraChanged(){return this._cameraChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(e){return this.sceneObjectsMap.get(e)}add(...e){for(let n of e)if(!this.has(n)){ht.context.addSceneObject(n);const i=eo.context.createEngineObject(n,this);i&&this._sceneObjectsMap.set(n,i),n.viewerAttached.emit(this)}}delete(...e){for(let n of e)if(this.has(n)){const i=this._sceneObjectsMap.get(n);i&&i.destroy(),ht.context.deleteSceneObject(n),this._sceneObjectsMap.delete(n),n.viewerDetached.emit(this)}}disposableAdd(...e){return this.add(...e),()=>this.delete(...e)}disAdd(...e){return this.disposableAdd(...e)}has(e){return this._sceneObjectsMap.has(e)}clearAllSceneObjects(){for(let e of this.sceneObjects)this.delete(e)}get id(){return this._id}set id(e){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return ms.createDefaultProps()}_getJson(e=!0){const n={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(e){let s,o=this.defaultProps[i];o instanceof d.ReactiveVariable?s=o.equals(this[i]):s=o===this[i],s||(n[i]=this[i])}else n[i]=this[i];return n}_setJson(e,n,i){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in e)this[a]=e[a]===null?void 0:e[a];else if(!(i??!1)){let u=this.defaultProps[a];u instanceof d.ReactiveVariable&&(u=u.value),this[a]=u}}get json(){return this._getJson()}set json(e){this._setJson(e,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(e){this._syncViewer.value=e}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(e){e&&e.syncViewer&&(e.syncViewer=void 0),e===this?this._syncViewer.value=void 0:this._syncViewer.value=e}setCurrentTime(e){try{this.currentTime=typeof e=="string"?Date.parse(e):e}catch(n){console.warn(`时间格式不正确! value: ${e} error: ${n}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}get actived(){return this._actived.value}set actived(e){this._actived.value=e}get activedChanged(){return this._actived.changed}getESProperties(){return{defaultMenu:"general",basic:[],general:[],dataSource:[],location:[],coordinate:[],style:[],more:[]}}getProperties(e){const n={...this.getESProperties()},i=[];return n.general.length>0&&i.push(new gt(n.general,"general")),Object.keys(n).forEach(s=>{s!=="defaultMenu"&&s!=="general"&&n[s].length>0&&i.push(new gt(n[s],s))}),i}};g(ms,"context",new zI),g(ms,"register",ms.context.register.bind(ms.context)),g(ms,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0});let fi=ms;(r=>{r.createBaseProps=()=>({name:"未命名场景对象",extras:d.reactJson(void 0),devTags:d.reactArrayWithUndefined(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),r.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:256,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:d.reactArrayWithUndefined(void 0),editingAuxiliaryPointColor:d.reactArrayWithUndefined(void 0),editingLineWidth:void 0,editingLineColor:d.reactArrayWithUndefined(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:r.defaults.terrainShader,splitPosition:d.react(void 0),rollerShutter:!1}),r.createDefaultProps=()=>({...(0,r.createBaseProps)(),...(0,r.createCommonProps)()})})(fi||(fi={})),d.extendClassProps(fi.prototype,fi.createDefaultProps);function om(r,t){const e=r._lastCameraInfo;if(e){const n=t.viewerChanged.don(i=>{if(!i||!e)return;const{position:s,rotation:o}=e;t.flyIn(s,o,0),r._lastCameraInfo=void 0,n()})}}const XI=r=>{const t=fi.createCommonProps(),e={};try{Object.keys(t).forEach(n=>{e[n]=r[n]})}catch(n){console.warn(n)}return e},am=(r,t)=>{const e=fi.createCommonProps();try{Object.keys(e).forEach(n=>{r[n]=t[n]})}catch(n){console.warn(n)}};class HI extends d.Destroyable{constructor(e){super();g(this,"_viewersChanged",this.disposeVar(new d.Event));g(this,"_viewers",new Set);g(this,"_viewersToChange",this.dv(new d.Event));this._sceneObjectsManager=e,this.d(()=>{for(const n of this._viewers)this.destroyViewer(n);this._viewers.clear()}),this.viewers.forEach(n=>{const i=this._sceneObjectsManager.sceneObjects;n.add(...i)}),this.d(()=>{const n=this._sceneObjectsManager.sceneObjects;this.viewers.forEach(i=>{i.delete(...n)})}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don((n,i)=>{this.viewers.forEach(s=>{i.forEach(o=>{hs(s.devTags,o.devTags)&&(s.has(o)?console.warn(`${s.typeName}中已存${o.typeName},检查逻辑是否有问题!`):s.add(o))}),n.forEach(o=>{hs(s.devTags,o.devTags)&&(s.has(o)?s.delete(o):console.warn(`${s.typeName}中不存在${o.typeName},检查逻辑是否有问题!`))})}),i.length>0&&i.forEach(s=>{s.d(s.devTagsChanged.don(()=>{this.viewers.forEach(o=>{o.has(s)&&o.delete(s),console.log("sceneObjectsToChange",o.devTags,s.devTags,hs(o.devTags,s.devTags)),hs(o.devTags,s.devTags)&&(o.has(s)?console.warn(`${o.typeName}中已存${s.typeName},检查逻辑是否有问题!`):o.add(s))})}))})})),this.d(this.viewersChanged.don((n,i)=>{const s=this._sceneObjectsManager.sceneObjects;i.forEach(o=>{for(let a of s)hs(o.devTags,a.devTags)&&(o.has(a)?console.warn(`${o.typeName}中已存${a.typeName},检查逻辑是否有问题!`):o.add(a))}),n.forEach(o=>{for(let a of s)hs(o.devTags,a.devTags)&&(o.has(a)?o.delete(a):console.warn(`${o.typeName}中不存在${a.typeName},检查逻辑是否有问题!`))}),i.length>0&&i.forEach(o=>{o.d(o.devTagsChanged.don(()=>{o.clearAllSceneObjects();const a=this._sceneObjectsManager.sceneObjects;for(let u of a)console.log("viewersChanged",o.devTags,u.devTags,hs(o.devTags,u.devTags)),hs(o.devTags,u.devTags)&&(o.has(u)?console.warn(`${o.typeName}中已存${u.typeName},检查逻辑是否有问题!`):o.add(u))}))})}))}get viewersChanged(){return this._viewersChanged}get viewers(){return this._viewers}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(e){const n=fi.context.createViewer(e);return this._viewers.add(n),this._viewersChanged.emit([],[n]),n}destroyViewer(e){return e.isDestroyed()?!0:(this._viewers.delete(e),this._viewersChanged.emit([e],[]),e.destroy(),e.isDestroyed())}}class Ys extends d.Destroyable{constructor(...e){super();g(this,"_drgm",this.dv(new Cv));g(this,"_sobjm",this.dv(new DI));g(this,"_vrm",this.dv(new HI(this._sobjm)));g(this,"_sceneObjectEditingManager",this.disposeVar(new AI));g(this,"_activeViewer",this.dv(d.react(void 0)));g(this,"_syncOtherViewersToActived",this.dv(d.react(!1)));g(this,"_cmrvm",this.createSceneObjectFromClass(Gh));g(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));g(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});g(this,"_sceneTree",this.dv(new fl("default",this.dragstartDataMananger,24,this)));g(this,"_propUiTreeManager",this.dv(new Ra(24)));g(this,"_sceneTreeMap",new Map);g(this,"_viewerCreatedEvent",this.dv(new d.Event));g(this,"_lastCameraInfo");g(this,"_lastActiveViewerJson");g(this,"syncEvent",this.dv(d.createNextAnimateFrameEvent(this.activeViewerChanged,this.syncOtherViewersToActivedChanged)));g(this,"_syncEventDon",this.d(this.syncEvent.don(()=>{const e=this.syncOtherViewersToActived;this.viewers.forEach(n=>{e?n.syncOtherViewer(this.activeViewer):n.syncOtherViewer(void 0)})})));g(this,"_player",this.createSceneObjectFromClass(_l));g(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));g(this,"_esPlyarAndPathTime",this.dv(new MI(this)));g(this,"_pathAnimationManager",this.dv(new bI(this)))}static get envs(){return ht.context.environmentVariables}getSceneObjectById(e){return ht.getSceneObjectById(e)}getSceneObject(e){return ht.getSceneObject(e)}get $refs(){return ht.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(e){this._activeViewer.value=e,this.viewers.values().forEach(n=>n.actived=n===e)}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(e){this._syncOtherViewersToActived.value=e}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get json(){var c;const e=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),i=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:n,name:i},a=this.sceneTree.json,u=this._cmrvm.views,l=[...this._vrm.viewers].map(f=>f.json),h=(c=this.activeViewer)==null?void 0:c.getCurrentCameraInfo();return{asset:o,viewers:l,sceneTree:a,viewCollection:u,lastView:h}}set json(e){try{if(!e.asset)return;if(!e.asset.type||e.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=e.asset&&e.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=e.asset&&e.asset.modifiedTime||"",this._asset.name=e.asset&&e.asset.name||"未命名项目",this._asset.version=e.asset&&e.asset.version||"0.1.0",e.sceneTree&&(this.sceneTree.json=e.sceneTree),e.viewCollection&&(this._cmrvm.views=e.viewCollection),!e.viewers||!Array.isArray(e.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this._vrm.viewers.size===0||e.viewers.length===0){console.warn("viewers is empty !");return}this._vrm.viewers.forEach(n=>{const i=e.viewers.find(s=>s.id===n.id);i&&(n.json=i)})}catch(n){console.error(`ESObjectsManager解析json数据时发生错误! error: ${n}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}get propUiTreeManager(){return this._propUiTreeManager}propTreeCallback(e){return TI(this,e)}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(e="default"){if(e==="default")return this._sceneTree;if(!this._sceneTreeMap.has(e)){console.warn(`id为${e}的SceneTree不存在!`);return}return this._sceneTreeMap.get(e)}createSceneTree(e,n=24){if(this._sceneTreeMap.has(e)||e==="default")console.warn(`id为${e}的SceneTree已存在!`);else{const i=this.dv(new fl(e,this.dragstartDataMananger,n,this));this._sceneTreeMap.set(e,i)}return this.getSceneTree(e)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(e){const n=this._vrm.createViewer(e);this.activeViewer||(this.activeViewer=n);const i=this.d(n.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(n),i())}));return n}destroyViewer(e){return this._activeViewer.value===e&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(e)}switchViewer(e,n=!0,i=!0,s=!0){var l;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&n&&(this._lastCameraInfo=(l=this.activeViewer)==null?void 0:l.getCurrentCameraInfo()),!this._lastActiveViewerJson&&i&&(this._lastActiveViewerJson=this.activeViewer?XI(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const o=e.id,a=o?[...this.getViewers()].find(h=>h.id===o):[...this.getViewers()].find(h=>h.typeName===e.type);if(a)if(o&&a.typeName!==e.type)console.warn(`id为${o}的viewer的typeName和option.type${e.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(a);else return console.log("ESViewer exists, will be used"),n&&om(this,a),i&&this._lastActiveViewerJson&&(am(a,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),a.container===em(e.container)?(a.containerOrId=e.container,a.forceRecreate()):a.containerOrId=e.container,this.activeViewer=a,a;console.log("No ESViewer exists, will be created");const u=this.createViewer(e);return console.log(e),console.log(this),n&&om(this,u),i&&this._lastActiveViewerJson&&(am(u,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=u,u}switchToCesiumViewer(...e){if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)){const{container:n,viewSync:i,attributeSync:s,destroy:o,id:a}=e[0];return this.switchViewer({type:"ESCesiumViewer",container:n,id:a},i??!0,s??!0,o??!0)}else if(typeof e[0]=="string"||e[0]instanceof HTMLDivElement){const n={container:e[0],viewSync:e[1]??!0,attributeSync:e[2]??!0,destroy:e[3]??!0,id:e[4]},{container:i,viewSync:s,attributeSync:o,destroy:a,id:u}=n;return this.switchViewer({type:"ESCesiumViewer",container:i,id:u},s,o,a)}}switchToUEViewer(...e){let n,i={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("uri")){const{container:u,uri:l,app:h,token:c,viewSync:f,attributeSync:p,destroy:v,id:_}=e[0];n={type:"ESUeViewer",container:u,id:_,options:{uri:l,app:h,token:c}},i={viewSync:f??!0,attributeSync:p??!0,destroy:v??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("ws")){const{container:u,ws:l,esmsg:h,viewSync:c,attributeSync:f,id:p,destroy:v}=e[0];n={type:"ESUeViewer",container:u,id:p,options:{ws:l,esmsg:h}},i={viewSync:c??!0,attributeSync:f??!0,destroy:v??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("project")){const{container:u,project:l,baseUrl:h,viewSync:c,attributeSync:f,id:p,destroy:v}=e[0];n={type:"ESUeViewer",container:u,id:p,options:{project:l,baseUrl:h}},i={viewSync:c??!0,attributeSync:f??!0,destroy:v??!0}}else(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?(n={type:"ESUeViewer",container:e[0],id:e[6],options:{ws:e[1],esmsg:e[2]??void 0}},i={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}):typeof e[1]=="string"&&e[1].startsWith("http")?(n={type:"ESUeViewer",container:e[0],id:e[7],options:{uri:e[1],app:e[2],token:e[3]??void 0}},i={viewSync:e[4]??!0,attributeSync:e[5]??!0,destroy:e[6]??!0}):(n={type:"ESUeViewer",container:e[0],id:e[6],options:{project:e[1],baseUrl:e[2]??void 0}},i={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}));if(!n)throw new Error("参数错误");const{viewSync:s,attributeSync:o,destroy:a}=i;return this.switchViewer(n,s,o,a)}createCesiumViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESCesiumViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(n={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESCesiumViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createOpenLayersViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESOlViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(n={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESOlViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createUeViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESUeViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?n={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{ws:e[1],esmsg:e[2]??void 0}}:typeof e[1]=="string"&&e[1].startsWith("http")?n={type:"ESUeViewer",container:e[0],id:e[4]??void 0,options:{uri:e[1],app:e[2],token:e[3]??void 0}}:n={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{project:e[1],baseUrl:e[2]??void 0}}),!n)throw new Error("参数错误");return this.createViewer(n)}createSceneObject(e,n){return this._sobjm.createSceneObject(e,n)}createSceneObjectFromClass(e,n){return this._sobjm.createSceneObjectFromClass(e,n)}createSceneObjectFromJson(e){return this._sobjm.createSceneObjectFromJson(e)}destroySceneObject(e){const n=this._sobjm.deleteSceneObject(e);return e.destroy(),n}destroyAllSceneObjects(){const e=[...this._sobjm.sceneObjects];for(let n of e)n!=this._player&&n!=this._cmrvm&&this.destroySceneObject(n)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}g(Ys,"getSceneObjById",ht.context.getSceneObjectById.bind(ht.context)),g(Ys,"getEnv",ht.context.getEnv.bind(ht.context)),g(Ys,"setEnv",ht.context.setEnv.bind(ht.context)),(r=>{r.createDefaultProps=()=>({})})(Ys||(Ys={})),d.extendClassProps(Ys.prototype,Ys.createDefaultProps);function YI(){const r=navigator.userAgent;let t="Unknown";/Windows/.test(r)?t="Windows":/Macintosh/.test(r)?t="MacOS":/Linux/.test(r)?t="Linux":/Android/.test(r)?t="Android":/iOS|iPhone|iPad|iPod/.test(r)&&(t="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(r)?e="x64":/x86|i686|Win32/.test(r)?e="x86":/arm64|aarch64/.test(r)?e="arm64":/arm/.test(r)&&(e="arm"),{os:t.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const JI=Date.now();function um(r){const{os:t,arch:e}=YI(),n={version:r.version,commitdate:r.date,commitId:r.commitId,runningTime:(Date.now()-JI)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:t,arch:e},s={method:"GET",headers:new Headers,redirect:"follow"},o=window.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(a=>a.text()).then(a=>console.log(a)).catch(a=>console.log("error",a))}M.copyright=void 0;try{const r="earthsdk3",t="3.4.0-beta.9",e="2025-08-29T06:51:48.000Z",n="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="fb558d1caab6fa68aec33c4a215b8444c1541b24",a=((Date.now()-1756450308e3)/36e5).toFixed(1),u=`%c🌏 ${r}%c ${t}.${s.slice(0,8)}.${e} (距今${a}个小时)
474
- %c${i?i+`
475
- `:""}当前网站正在使用${r},此软件版权归${n}所有
476
- `;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","fb558d1caab6fa68aec33c4a215b8444c1541b24")},get info(){return u},get date(){return"2025-08-29T06:51:48.000Z"},get author(){return"suplyang"},get version(){return"3.4.0-beta.9"},get name(){return"earthsdk3"},get commitId(){return"fb558d1caab6fa68aec33c4a215b8444c1541b24"},print(){console.info(this.info,`
477
- font-size: 18px;
478
- font-weight: 1000;
479
- line-height: 1;
480
- color: rgb(0, 120, 215);
481
- padding-top: 20px;
482
- padding-bottom: 10px;
483
- `,`
484
- font-size: 10px;
485
- font-weight: 1000;
486
- color: rgb(0, 120, 215);
487
- `,`
488
- font-size: 10px;
489
- line-height: 1.5;
490
- color: rgb(0, 120, 215);
491
- padding-bottom: 2px;
492
- padding-left: 35px;
493
- `)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[r]=M.copyright,window.g_XE3SendProductUsageInfo=window.g_XE3SendProductUsageInfo||!0,window.g_XE3SendProductUsageInfo&&(setTimeout(()=>um(M.copyright),6e4),setInterval(()=>um(M.copyright),864e5)),window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&M.copyright.print()}catch{console.warn("版本信息有误!")}return M.BasePropTreeItem=If,M.Boolean2Property=Pm,M.Boolean2sProperty=Nm,M.Boolean3Property=Im,M.Boolean3sProperty=bm,M.Boolean4Property=Mm,M.Boolean4sProperty=Tm,M.BooleanProperty=$,M.BooleansProperty=vm,M.ColorProperty=Rt,M.ColorRgbProperty=Am,M.DashPatternProperty=Dm,M.DateProperty=ro,M.DatesProperty=pg,M.DragStartDataManager=Cv,M.ES3DTileset=Fn,M.ESAlarm=xf,M.ESApertureEffect=Of,M.ESAreaMeasurement=Af,M.ESBlastParticleSystem=Df,M.ESBoxClipping=Lf,M.ESCameraView=Rh,M.ESCameraViewCollection=Gh,M.ESCameraVisibleRange=Rf,M.ESCar=Ff,M.ESCityBasePoint=Vd,M.ESClassification=kh,M.ESClippingPlane=Gf,M.ESCustomDiv=Vh,M.ESCzml=Ud,M.ESDataMesh=kf,M.ESDatasmithRuntimeModel=wd,M.ESDirectionMeasurement=ld,M.ESDistanceMeasurement=Vf,M.ESDynamicWater=Sd,M.ESEntityCluster=Gd,M.ESExcavate=gl,M.ESFireParticleSystem=Uf,M.ESForestTileset=zf,M.ESGaussianSplatting=Xd,M.ESGeoDiv=qf,M.ESGeoDivTextPoi=kd,M.ESGeoExtrudedPolygon=ml,M.ESGeoJson=hd,M.ESGeoLineString=Xs,M.ESGeoPoints=Bd,M.ESGeoPolygon=ie,M.ESGeoRectangle=Wf,M.ESGeoVector=Dt,M.ESGeoWater=Cd,M.ESGltfModel=Hf,M.ESHeatMap=Jd,M.ESHeightLimitAnalysis=Fd,M.ESHeightMeasurement=cd,M.ESHole=Td,M.ESHuman=Ga,M.ESHumanPoi=bd,M.ESImageLabel=Yf,M.ESImageryLayer=Jf,M.ESJEditingMode=lt,M.ESJLonLatFormat=vg,M.ESJPickedResult=zm,M.ESLabel=fn,M.ESLevelRuntimeModel=Pd,M.ESLocalCircle=fd,M.ESLocalPolygon=vl,M.ESLocalPolygonZ=dd,M.ESLocalRectangle=gd,M.ESLocalSkyBox=Bf,M.ESLocalVector=Fa,M.ESLocalVector2D=cs,M.ESLocationMeasurement=Qf,M.ESMsTileset=Dd,M.ESNavigator=zd,M.ESObjectWithLocation=ct,M.ESObjectsManager=Ys,M.ESParticleSystemPrimitive=Kf,M.ESPath=El,M.ESPathImpl=Hs,M.ESPipeFence=pd,M.ESPipeline=Id,M.ESPipeserTileset=vd,M.ESPit=ka,M.ESPlayer=_l,M.ESPoi2D=pl,M.ESPoi3D=Zf,M.ESPoiTileset=Ld,M.ESPolygonFence=md,M.ESPolygonFlattenedPlane=$f,M.ESPolygonWithHole=_d,M.ESRectangle=yd,M.ESRtsFeatureEditing=Ad,M.ESRtsTileset=Od,M.ESScale=Rd,M.ESSceneObject=ht,M.ESSceneObjectWithId=HP,M.ESSeparateFoliage=jf,M.ESSkylineAnalysis=Yd,M.ESStaticMesh=Hd,M.ESSubmergingAnalysis=td,M.ESSunshineAnalysis=ed,M.ESSurfaceAreaMeasurement=Ed,M.ESTerrainLayer=rd,M.ESTestObject=Tf,M.ESTextLabel=nd,M.ESUEWidget=id,M.ESUnrealActor=sd,M.ESVideoFusion=od,M.ESViewShed=ad,M.ESViewer=fi,M.ESViewerStatusBar=qd,M.ESViewerStatusBarScale=Wd,M.ESVisibilityAnalysis=Md,M.ESVisualObject=ee,M.ESVolumeMeasurement=Nd,M.ESWidget=ud,M.EngineObject=eo,M.EnumProperty=bt,M.EnumStringsProperty=Lm,M.EvalStringProperty=_s,M.FunctionProperty=pt,M.GroupPropTreeItem=Nf,M.GroupProperty=gt,M.JsonProperty=ut,M.LeafPropTreeItem=Mf,M.LongStringProperty=nc,M.MaximumScreenSpaceErrorProperty=gm,M.MinmaxProperty=Rm,M.NearFarScalerProperty=Fm,M.NonreactiveJsonStringProperty=fg,M.Number2Property=Ve,M.Number2sProperty=hg,M.Number3Property=lr,M.Number3sProperty=rc,M.Number4Property=Hn,M.Number4WithUndefinedProperty=Sm,M.Number4sProperty=Cm,M.NumberProperty=L,M.NumberRangeProperty=Gm,M.NumberSliderProperty=Xe,M.NumbersProperty=pm,M.ParamsProperty=cg,M.PickedInfo=Um,M.Player=ci,M.PlayerProperty=Dl,M.PositionProperty=Jo,M.PositionsProperty=dg,M.PositionsSetPropety=Vm,M.PropTree=Av,M.PropUiTreeManager=Ra,M.Property=ys,M.ReactVarProperty=xt,M.RotationProperty=ic,M.SceneObjectFromId=bf,M.SceneTree=fl,M.SceneTreeContextMenu=Ov,M.SceneTreeItem=_r,M.SceneTreeItemDragDrop=xv,M.String2Property=mm,M.String2sProperty=lg,M.String3Property=ym,M.String3sProperty=Em,M.String4Property=_m,M.String4sProperty=wm,M.StringNumberProperty=xm,M.StringNumbersProperty=Om,M.StringProperty=_t,M.StringsProperty=ug,M.TreeItemDragDrop=Pv,M.UriProperty=mu,M.ViewPlayerProperty=gg,M.ViewerCustomInteraction=sm,M.Watcher=dl,M.WatcherTools=Lv,M.WithUndefinedProperty=ec,M.addTreesCallFunc=Vv,M.bindCustomEditing=Nv,M.booleanPointInPolygon=d1,M.cartesianDistance=Sv,M.clamp0_360=La,M.clampN180_180=Mv,M.createPropTreeFromSceneObject=Dv,M.cutDownTreesCallFunc=qv,M.defaultFlyInParam=Hm,M.defaultFlyToParam=no,M.defaultInitSceneObjectOnCreatingFunc=IP,M.defaultLight122FromEnvironmentMapManager=Pf,M.defaultUpdateSceneObjectOnPickingFunc=PP,M.equalsN3=oc,M.geoAlong=g1,M.geoArea=$c,M.geoBuffer=C0,M.geoCenterOfMass=p1,M.geoDestination=v1,M.geoDifference=P0,M.geoDistance=jc,M.geoHeading=Eh,M.geoIntersect=w0,M.geoLineIntersect=m1,M.geoNearestPointOnLine=_1,M.geoPointToLineDistance=E1,M.geoPolygonFromCircle=I0,M.geoPolygonOverlap=tf,M.geoRhumbDestination=w1,M.geoRhumbDistance=E0,M.geoRhumbHeading=S1,M.geoUnion=S0,M.getDefaultValue=TP,M.getDistancesFromPositions=cl,M.getGeoBoundingSphereFromPositions=C1,M.getMidpoint=y1,M.getMinMaxCorner=M0,M.getSceneObjectTreeItem=MP,M.getXyzFromPostion=wf,M.growthSimulationCallFunc=Wv,M.hasSameTags=Iv,M.hasSameViewerTags=hs,M.inOrderRunning=xP,M.isJSONString=bP,M.lbhToWebMerc=SP,M.lbhToXyz=Gi,M.lerpAngle=Lh,M.lerpRotation=Sf,M.map=_g,M.optionsStr=nI,M.reactPosition2Ds=sc,M.registerCreatedEventUpdate=QP,M.registerEventUpdate=zP,M.removeAllTreesCallFunc=Uv,M.rpToap=NP,M.setSceneObjectTreeItem=Dh,M.updateTreeParamsCallFunc=zv,M.webMercToLbh=CP,M.xyzToLbh=Ev,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"}),M}({},xbsj_base);
493
+ `,pM='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',gM='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',wo=class wo extends B{constructor(t){super();const e=()=>{const n=this.dv(new wh);this.d(g.track([n,"show"],[t,"useDefaultStatusDiv"]));{const i=()=>{n.show=(t.useDefaultStatusDiv??!0)&&t.status!=="Created"};i(),this.d(t.useDefaultStatusDivChanged.don(i)),this.d(t.statusChanged.don(i)),n.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}t.add(n),this.d(()=>t.delete(n)),n.instanceClass=class extends B{constructor(o,a,u){super();d(this,"_div",document.createElement("div"));if(this._subContainer=o,!u)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const m=()=>{a.show?this._div.style.opacity="1":this._div.style.opacity="0"};m(),this.d(a.showChanged.don(m))}let l,h,c,f,p;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",l=document.createElement("div"),this._div.appendChild(l),l.style.width="auto",l.style.position="absolute",l.style.left="50%",l.style.top="50%",l.style.transform="translate(-50%,-50%)",l.style.background="rgba(120, 120, 0, 0.7)",l.style.color="white",l.style.fontSize="10px",l.style.background="none",l.style.display="flex",l.style.justifyContent="center",l.style.alignItems="center",h=document.createElement("div"),l.appendChild(h),h.style.pointerEvents="none",h.style.display="block",h.style.width="40px",h.innerHTML=wo.defaultsSvg.loadingSvg,h.style.filter="drop-shadow(0px 0px 1px black)",c=document.createElement("div"),l.appendChild(c),c.style.pointerEvents="none",c.style.marginLeft="10px",c.style.display="flex",c.style.flexFlow="column",c.style.maxWidth="300px",f=document.createElement("div"),c.appendChild(f),f.style.fontSize="14px",f.style.fontWeight="800",f.style.marginBottom="5px",f.style.textShadow="0 0 2px black",p=document.createElement("div"),c.appendChild(p),p.style.fontWeight="400",p.style.textShadow="0 0 2px black";{const m=()=>{let E="Raw";u.status==="Raw"?E="初始状态":u.status==="Creating"?E="正在创建":u.status==="Created"?E="创建完成":u.status==="Error"?E="创建失败":u.status==="Reconnecting"&&(E="重新连接"),f.innerText=`${E}(${u.status})`,p.innerText=`${u.statusLog}`,(u.status==="Creating"||u.status==="Reconnecting")&&(h.innerHTML=wo.defaultsSvg.loadingSvg),u.status==="Created"&&(h.innerHTML=wo.defaultsSvg.successSvg),u.status==="Error"&&(h.innerHTML=wo.defaultsSvg.warnSvg)};m();const _=this.dv(g.createNextAnimateFrameEvent(u.statusLogChanged,u.statusChanged));this.d(_.don(m))}}update(){const o=255*Math.random()|0,a=255*Math.random()|0,u=255*Math.random()|0;this._div.style.background=`rgba(${o}, ${a}, ${u}, 0.8)`}}};this.d(t.containerChanged.don(()=>{e()}))}};d(wo,"defaultsSvg",{loadingSvg:dM,successSvg:pM,warnSvg:gM});let Od=wo;class mM extends B{constructor(t,e,n){super(),this._subContainer=t,this._overlayContainer=e,this._viewer=n;const i=this._subContainer,s=this._overlayContainer,o=this._viewer,a=()=>{const h=o.zIndex??"";i.style.zIndex=h,s.style.zIndex=h};a(),this.d(o.zIndexChanged.don(a));const u=()=>{i.style.display=o.show??!0?"block":"none"};u(),this.d(o.showChanged.don(u));const l=()=>{i.style.opacity=`${o.opacity??1}`};l(),this.d(o.opacityChanged.don(l))}}function Nh(r){let t=g.getExtProp(r,"_relativeContainer");return t||(t=document.createElement("div"),t.style.position="relative",t.style.width="100%",t.style.height="100%",t.style.padding="0",t.style.margin="0",r.appendChild(t),g.setExtProp(r,"_relativeContainer",t)),t}class vM extends B{constructor(e,n){super();d(this,"_subContainer",document.createElement("div"));d(this,"_overlayContainer",document.createElement("div"));d(this,"_containerStyleController");this._container=e,this._viewer=n,this._containerStyleController=this.dv(new mM(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:i,overlayContainer:s}=this;i.tabIndex=-1,i.style.outline="none",i.style.width="100%",i.style.height="100%",i.onpointerdown=()=>i.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),i.setAttribute("earthsdk3","earthsdk3-subContainer"),Nh(this._container).appendChild(i),this.d(()=>Nh(this._container).removeChild(i)),Nh(this._container).appendChild(s),this.d(()=>Nh(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class yM extends B{constructor(){super(...arguments);d(this,"registerObjsMap",new Map)}register(e,n){return this.registerObjsMap.has(e)&&console.warn(`register warn:${e}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(e,n),e}getViewerConstructor(e){const n=this.registerObjsMap.get(e);if(!n){console.warn(`未找到${e}类!`);return}return n}createViewer(e){const n=e.type;console.log(e);const i=this.getViewerConstructor(n);if(!i)throw new Error(`没有找到类型为${n}的Viewer构造器!`);return new i(e)}}class ay extends B{constructor(t,e,n=!1,i=!1){if(super(),this._viewer=t,!e)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(g.DomElementEvent.create(e,"pointerdown")),o=this.dv(g.DomElementEvent.create(e,"pointermove")),a=this.dv(g.DomElementEvent.create(e,"pointerup")),u=this.dv(g.DomElementEvent.create(e,"pointerout")),l=this.dv(g.DomElementEvent.create(e,"pointerover")),h=this.dv(new g.PointerClick),c=this.dv(new g.PointerHover),f=()=>{const w=this._viewer.hoverTime*1e3;c.delayTime=w};this.d(this._viewer.hoverTimeChanged.don(()=>{f()})),this.d(s.don(w=>h.pointerDown(w))),this.d(o.don(w=>h.pointerMove(w))),this.d(a.don(w=>h.pointerUp(w))),this.d(u.don(w=>h.pointerOut(w))),this.d(s.don(w=>c.pointerDown(w))),this.d(o.don(w=>c.pointerMove(w))),this.d(a.don(w=>c.pointerUp(w))),this.d(u.don(w=>c.pointerOut(w)));const{x:p,y:m}=e.getBoundingClientRect(),_=i?p:0,E=i?m:0;this.d(c.hoverEvent.don(w=>{const[S,P]=g.getDomEventCurrentTargetPos(w,n);this._viewer.hoverEvent.emit({screenPosition:[S+_,P+E],pointerEvent:w})})),this.d(h.clickEvent.don(w=>{const[S,P]=g.getDomEventCurrentTargetPos(w,n);this._viewer.clickEvent.emit({screenPosition:[S+_,P+E],pointerEvent:w})})),this.d(h.dbclickEvent.don(w=>{const[S,P]=g.getDomEventCurrentTargetPos(w,n);w.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[S+_,P+E],pointerEvent:w})})),this.d(s.don(w=>{const[S,P]=g.getDomEventCurrentTargetPos(w,n);w.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[S+_,P+E],pointerEvent:w})})),this.d(a.don(w=>{const[S,P]=g.getDomEventCurrentTargetPos(w,n);w.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[S+_,P+E],pointerEvent:w})})),this.d(o.don(w=>{const[S,P]=g.getDomEventCurrentTargetPos(w,n);this._viewer.pointerMoveEvent.emit({screenPosition:[S+_,P+E],pointerEvent:w})})),this.d(l.don(w=>{const[S,P]=g.getDomEventCurrentTargetPos(w,n);this._viewer.pointerOverEvent.emit({screenPosition:[S+_,P+E],pointerEvent:w})})),this.d(u.don(w=>{const[S,P]=g.getDomEventCurrentTargetPos(w,n);this._viewer.pointerOutEvent.emit({screenPosition:[S+_,P+E],pointerEvent:w})}));const C=this.dv(g.DomElementEvent.create(e,"keydown"));this.d(C.don(w=>this._viewer.keyDownEvent.emit(w)));const v=this.dv(g.DomElementEvent.create(e,"keyup"));this.d(v.don(w=>this._viewer.keyUpEvent.emit(w)));const y=this.dv(g.DomElementEvent.create(e,"wheel"));this.d(y.don(w=>this._viewer.wheelEvent.emit(w)))}}class _M extends B{constructor(e){super();d(this,"viewer");const n=this.viewer=e;this.ad(new g.ObjResettingWithEvent(n.rollerShutterChanged,()=>{const i=n.container;if(!i||!n.rollerShutter)return;const s=new B;this.viewer.splitPosition=.5;let o=this.getRollerShutterDIV();return i.appendChild(o),s.d(()=>{this.viewer.splitPosition=0,i.removeChild(o)}),s}))}getRollerShutterDIV(){let e=document.createElement("div");e.style.position="absolute",e.style.left="50%",e.style.top="0",e.style.backgroundColor="#d3d3d3",e.style.width="5px",e.style.height="100%",e.style.zIndex="9999";const n=i=>{if(!e.parentElement)return;i.preventDefault?i.preventDefault():i.returnValue=!1;const o=i.x/e.parentElement.offsetWidth;e.style.left=`${100*o}%`,this.viewer.splitPosition=o};return e.addEventListener("mouseenter",i=>{e.style.cursor="ew-resize"}),e.addEventListener("mouseleave",i=>{e.style.cursor="default"}),e.addEventListener("mousedown",i=>{e.style.cursor="ew-resize",document.addEventListener("mousemove",n)}),document.addEventListener("mouseup",i=>{e.style.cursor="default",document.removeEventListener("mousemove",n)}),e}}class wM extends B{constructor(e){super();d(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new _M(e))}}const Ji=class Ji extends B{constructor(e){super();d(this,"_forceRecreateEvent",this.dv(new V));d(this,"_container",this.dv(g.react(void 0)));d(this,"_containerSize",this.dv(g.react(void 0)));d(this,"_editingEvent",this.disposeVar(new V));d(this,"_status",this.dv(g.react("Raw")));d(this,"_statusLog",this.dv(g.react("")));d(this,"_statusContainer",this.dv(new Od(this)));d(this,"_useCustomInteraction",this.dv(g.react(!0)));d(this,"_resetInteractionEvent",this.dv(g.createNextAnimateFrameEvent(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));d(this,"_interactionResetting",this.dv(new g.ObjResettingWithEvent(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new ay(this,this.container)})));d(this,"_viewerChanged",this.dv(new V));d(this,"_cameraChanged",this.dv(new V));d(this,"_containerResetEvent",this.dv(g.createNextAnimateFrameEvent(this.containerChanged,this._forceRecreateEvent)));d(this,"_containerResetting",this.dv(new g.ObjResettingWithEvent(this._containerResetEvent,()=>{if(this.container)return new vM(this.container,this)})));d(this,"_sceneObjectsMap",new Map);d(this,"_id");d(this,"_typeName");d(this,"_updateFuncReact",this.dv(g.react(void 0)));d(this,"_toDestroyFuncReact",this.dv(g.react(void 0)));d(this,"_statusInfo",Ji.defaults.statusInfo);d(this,"_navigationMode",this.dv(g.react("Map")));d(this,"_syncViewer",this.dv(g.react(void 0)));d(this,"_syncEventDon",this.dv(new g.ObjResettingWithEvent(this.syncViewerChanged,()=>{const e=this.syncViewer;if(e)return new fM(this,e)})));d(this,"_timeSyncdon",this.dv(new g.ObjResettingWithEvent(this.timeSyncChanged,()=>{if(this.timeSync)return new cM(this)})));d(this,"_hoverEvent",this.dv(new V));d(this,"_pointerOverEvent",this.dv(new V));d(this,"_pointerMoveEvent",this.dv(new V));d(this,"_pointerDownEvent",this.dv(new V));d(this,"_pointerUpEvent",this.dv(new V));d(this,"_pointerOutEvent",this.dv(new V));d(this,"_clickEvent",this.dv(new V));d(this,"_dblclickEvent",this.dv(new V));d(this,"_keyDownEvent",this.dv(new V));d(this,"_keyUpEvent",this.dv(new V));d(this,"_wheelEvent",this.dv(new V));d(this,"_actived",this.dv(g.react(!1)));this._id=e.id??g.createGuid();const n=ny(e.container);if(n)this._container.value=Td(n),this._typeName=e.type,this._initName();else throw new Error("container is not defined");{const i=()=>{n&&(this.show??!0?n.style.display="block":n.style.display="none")};i(),this.d(this.showChanged.don(i))}{const i=this._sceneObjectsMap,s=()=>{for(let[a,u]of i.entries())if(!u&&a){const l=Ts.context.createEngineObject(a,this);l&&i.set(a,l)}},o=()=>{for(let[a,u]of i.entries())u&&!u.isDestroyed()&&u.destroy(),i.set(a,void 0)};this.d(o),this.d(this.viewerChanged.don(a=>{o(),a&&s()}))}{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||g.createAnimateFrame(),s.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new wM(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(e){this._container.value=e}set containerOrId(e){if(typeof e=="string"){const n=document.getElementById(e);n&&n instanceof HTMLDivElement?this._container.value=Td(n):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else e instanceof HTMLDivElement?this._container.value=Td(e):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(e){this._containerSize.value=e}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(e){this._status.value=e}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(e){this._statusLog.value=e}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(e){this._useCustomInteraction.value=e}get viewerChanged(){return this._viewerChanged}get cameraChanged(){return this._cameraChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(e){return this.sceneObjectsMap.get(e)}add(...e){for(let n of e)if(!this.has(n)){K.context.addSceneObject(n);const i=Ts.context.createEngineObject(n,this);i&&this._sceneObjectsMap.set(n,i),n.viewerAttached.emit(this)}}delete(...e){for(let n of e)if(this.has(n)){const i=this._sceneObjectsMap.get(n);i&&i.destroy(),K.context.deleteSceneObject(n),this._sceneObjectsMap.delete(n),n.viewerDetached.emit(this)}}disposableAdd(...e){return this.add(...e),()=>this.delete(...e)}disAdd(...e){return this.disposableAdd(...e)}has(e){return this._sceneObjectsMap.has(e)}clearAllSceneObjects(){for(let e of this.sceneObjects)this.delete(e)}get id(){return this._id}set id(e){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return Ji.createDefaultProps()}_getJson(e=!0){const n={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(e){let s,o=this.defaultProps[i];o instanceof g.ReactiveVariable?s=o.equals(this[i]):s=o===this[i],s||(n[i]=this[i])}else n[i]=this[i];return n}_setJson(e,n,i){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in e)this[a]=e[a]===null?void 0:e[a];else if(!(i??!1)){let u=this.defaultProps[a];u instanceof g.ReactiveVariable&&(u=u.value),this[a]=u}}get json(){return this._getJson()}set json(e){this._setJson(e,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(e){this._syncViewer.value=e}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(e){e&&e.syncViewer&&(e.syncViewer=void 0),e===this?this._syncViewer.value=void 0:this._syncViewer.value=e}setCurrentTime(e){try{this.currentTime=typeof e=="string"?Date.parse(e):e}catch(n){console.warn(`时间格式不正确! value: ${e} error: ${n}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}get actived(){return this._actived.value}set actived(e){this._actived.value=e}get activedChanged(){return this._actived.changed}getESProperties(){return{defaultMenu:"general",basic:[],general:[],dataSource:[],location:[],coordinate:[],style:[],more:[]}}getProperties(e){const n={...this.getESProperties()},i=[];return n.general.length>0&&i.push(new nt(n.general,"general")),Object.keys(n).forEach(s=>{s!=="defaultMenu"&&s!=="general"&&n[s].length>0&&i.push(new nt(n[s],s))}),i}};d(Ji,"context",new yM),d(Ji,"register",Ji.context.register.bind(Ji.context)),d(Ji,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0,cameraMovableRegion:[0,0,0,0,0,0]});let Xn=Ji;(r=>{r.createBaseProps=()=>({name:"未命名场景对象",extras:g.reactJson(void 0),devTags:g.reactArrayWithUndefined(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),r.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:256,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:g.reactArrayWithUndefined(void 0),editingAuxiliaryPointColor:g.reactArrayWithUndefined(void 0),editingLineWidth:void 0,editingLineColor:g.reactArrayWithUndefined(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:r.defaults.terrainShader,splitPosition:g.react(void 0),rollerShutter:!1,cameraMovableRegion:g.reactArrayWithUndefined(void 0)}),r.createDefaultProps=()=>({...(0,r.createBaseProps)(),...(0,r.createCommonProps)()})})(Xn||(Xn={})),g.extendClassProps(Xn.prototype,Xn.createDefaultProps);function uy(r,t){const e=r._lastCameraInfo;if(e){const n=t.viewerChanged.don(i=>{if(!i||!e)return;const{position:s,rotation:o}=e;t.flyIn(s,o,0),r._lastCameraInfo=void 0,n()})}}const EM=r=>{const t=Xn.createCommonProps(),e={};try{Object.keys(t).forEach(n=>{e[n]=r[n]})}catch(n){console.warn(n)}return e},ly=(r,t)=>{const e=Xn.createCommonProps();try{Object.keys(e).forEach(n=>{r[n]=t[n]})}catch(n){console.warn(n)}};class SM extends B{constructor(e){super();d(this,"_viewersChanged",this.disposeVar(new V));d(this,"_viewers",new Set);d(this,"_viewersToChange",this.dv(new V));this._sceneObjectsManager=e,this.d(()=>{for(const n of this._viewers)this.destroyViewer(n);this._viewers.clear()}),this.viewers.forEach(n=>{const i=this._sceneObjectsManager.sceneObjects;n.add(...i)}),this.d(()=>{const n=this._sceneObjectsManager.sceneObjects;this.viewers.forEach(i=>{i.delete(...n)})}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don((n,i)=>{this.viewers.forEach(s=>{i.forEach(o=>{Pi(s.devTags,o.devTags)&&(s.has(o)?console.warn(`${s.typeName}中已存${o.typeName},检查逻辑是否有问题!`):s.add(o))}),n.forEach(o=>{Pi(s.devTags,o.devTags)&&(s.has(o)?s.delete(o):console.warn(`${s.typeName}中不存在${o.typeName},检查逻辑是否有问题!`))})}),i.length>0&&i.forEach(s=>{s.d(s.devTagsChanged.don(()=>{this.viewers.forEach(o=>{o.has(s)&&o.delete(s),console.log("sceneObjectsToChange",o.devTags,s.devTags,Pi(o.devTags,s.devTags)),Pi(o.devTags,s.devTags)&&(o.has(s)?console.warn(`${o.typeName}中已存${s.typeName},检查逻辑是否有问题!`):o.add(s))})}))})})),this.d(this.viewersChanged.don((n,i)=>{const s=this._sceneObjectsManager.sceneObjects;i.forEach(o=>{for(let a of s)Pi(o.devTags,a.devTags)&&(o.has(a)?console.warn(`${o.typeName}中已存${a.typeName},检查逻辑是否有问题!`):o.add(a))}),n.forEach(o=>{for(let a of s)Pi(o.devTags,a.devTags)&&(o.has(a)?o.delete(a):console.warn(`${o.typeName}中不存在${a.typeName},检查逻辑是否有问题!`))}),i.length>0&&i.forEach(o=>{o.d(o.devTagsChanged.don(()=>{o.clearAllSceneObjects();const a=this._sceneObjectsManager.sceneObjects;for(let u of a)console.log("viewersChanged",o.devTags,u.devTags,Pi(o.devTags,u.devTags)),Pi(o.devTags,u.devTags)&&(o.has(u)?console.warn(`${o.typeName}中已存${u.typeName},检查逻辑是否有问题!`):o.add(u))}))})}))}get viewersChanged(){return this._viewersChanged}get viewers(){return this._viewers}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(e){const n=Xn.context.createViewer(e);return this._viewers.add(n),this._viewersChanged.emit([],[n]),n}destroyViewer(e){return e.isDestroyed()?!0:(this._viewers.delete(e),this._viewersChanged.emit([e],[]),e.destroy(),e.isDestroyed())}}class Es extends B{constructor(...e){super();d(this,"_drgm",this.dv(new Zd));d(this,"_sobjm",this.dv(new hM));d(this,"_vrm",this.dv(new SM(this._sobjm)));d(this,"_sceneObjectEditingManager",this.disposeVar(new lM));d(this,"_activeViewer",this.dv(g.react(void 0)));d(this,"_syncOtherViewersToActived",this.dv(g.react(!1)));d(this,"_cmrvm",this.createSceneObjectFromClass(vh));d(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));d(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});d(this,"_sceneTree",this.dv(new Ku("default",this.dragstartDataMananger,24,this)));d(this,"_propUiTreeManager",this.dv(new ga(24)));d(this,"_sceneTreeMap",new Map);d(this,"_viewerCreatedEvent",this.dv(new V));d(this,"_lastCameraInfo");d(this,"_lastActiveViewerJson");d(this,"_syncEventDonFunc",this.d(Co([this.activeViewerChanged,this.syncOtherViewersToActivedChanged],()=>{const e=this.syncOtherViewersToActived;this.viewers.forEach(n=>{e?n.syncOtherViewer(this.activeViewer):n.syncOtherViewer(void 0)})})));d(this,"_player",this.createSceneObjectFromClass(_a));d(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));d(this,"_esPlyarAndPathTime",this.dv(new nM(this)));d(this,"_pathAnimationManager",this.dv(new sM(this)))}static get envs(){return K.context.environmentVariables}getSceneObjectById(e){return K.getSceneObjectById(e)}getSceneObject(e){return K.getSceneObject(e)}get $refs(){return K.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(e){this._activeViewer.value=e,this.viewers.values().forEach(n=>n.actived=n===e)}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(e){this._syncOtherViewersToActived.value=e}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get json(){var c;const e=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),i=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:n,name:i},a=this.sceneTree.json,u=this._cmrvm.views,l=[...this._vrm.viewers].map(f=>f.json),h=(c=this.activeViewer)==null?void 0:c.getCurrentCameraInfo();return{asset:o,viewers:l,sceneTree:a,viewCollection:u,lastView:h}}set json(e){try{if(!e.asset)return;if(!e.asset.type||e.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=e.asset&&e.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=e.asset&&e.asset.modifiedTime||"",this._asset.name=e.asset&&e.asset.name||"未命名项目",this._asset.version=e.asset&&e.asset.version||"0.1.0",e.sceneTree&&(this.sceneTree.json=e.sceneTree),e.viewCollection&&(this._cmrvm.views=e.viewCollection),!e.viewers||!Array.isArray(e.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this._vrm.viewers.size===0||e.viewers.length===0){console.warn("viewers is empty !");return}this._vrm.viewers.forEach(n=>{const i=e.viewers.find(s=>s.id===n.id);i&&(n.json=i)})}catch(n){console.error(`ESObjectsManager解析json数据时发生错误! error: ${n}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}get propUiTreeManager(){return this._propUiTreeManager}propTreeCallback(e){return oM(this,e)}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(e="default"){if(e==="default")return this._sceneTree;if(!this._sceneTreeMap.has(e)){console.warn(`id为${e}的SceneTree不存在!`);return}return this._sceneTreeMap.get(e)}createSceneTree(e,n=24){if(this._sceneTreeMap.has(e)||e==="default")console.warn(`id为${e}的SceneTree已存在!`);else{const i=this.dv(new Ku(e,this.dragstartDataMananger,n,this));this._sceneTreeMap.set(e,i)}return this.getSceneTree(e)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(e){const n=this._vrm.createViewer(e);this.activeViewer||(this.activeViewer=n);const i=this.d(n.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(n),i())}));return n}destroyViewer(e){return this._activeViewer.value===e&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(e)}switchViewer(e,n=!0,i=!0,s=!0){var l;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&n&&(this._lastCameraInfo=(l=this.activeViewer)==null?void 0:l.getCurrentCameraInfo()),!this._lastActiveViewerJson&&i&&(this._lastActiveViewerJson=this.activeViewer?EM(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const o=e.id,a=o?[...this.getViewers()].find(h=>h.id===o):[...this.getViewers()].find(h=>h.typeName===e.type);if(a)if(o&&a.typeName!==e.type)console.warn(`id为${o}的viewer的typeName和option.type${e.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(a);else return console.log("ESViewer exists, will be used"),n&&uy(this,a),i&&this._lastActiveViewerJson&&(ly(a,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),a.container===ny(e.container)?(a.containerOrId=e.container,a.forceRecreate()):a.containerOrId=e.container,this.activeViewer=a,a;console.log("No ESViewer exists, will be created");const u=this.createViewer(e);return console.log(e),console.log(this),n&&uy(this,u),i&&this._lastActiveViewerJson&&(ly(u,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=u,u}switchToCesiumViewer(...e){if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)){const{container:n,viewSync:i,attributeSync:s,destroy:o,id:a}=e[0];return this.switchViewer({type:"ESCesiumViewer",container:n,id:a},i??!0,s??!0,o??!0)}else if(typeof e[0]=="string"||e[0]instanceof HTMLDivElement){const n={container:e[0],viewSync:e[1]??!0,attributeSync:e[2]??!0,destroy:e[3]??!0,id:e[4]},{container:i,viewSync:s,attributeSync:o,destroy:a,id:u}=n;return this.switchViewer({type:"ESCesiumViewer",container:i,id:u},s,o,a)}}switchToUEViewer(...e){let n,i={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("uri")){const{container:u,uri:l,app:h,token:c,viewSync:f,attributeSync:p,destroy:m,id:_}=e[0];n={type:"ESUeViewer",container:u,id:_,options:{uri:l,app:h,token:c}},i={viewSync:f??!0,attributeSync:p??!0,destroy:m??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("ws")){const{container:u,ws:l,esmsg:h,viewSync:c,attributeSync:f,id:p,destroy:m}=e[0];n={type:"ESUeViewer",container:u,id:p,options:{ws:l,esmsg:h}},i={viewSync:c??!0,attributeSync:f??!0,destroy:m??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("project")){const{container:u,project:l,baseUrl:h,viewSync:c,attributeSync:f,id:p,destroy:m}=e[0];n={type:"ESUeViewer",container:u,id:p,options:{project:l,baseUrl:h}},i={viewSync:c??!0,attributeSync:f??!0,destroy:m??!0}}else(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?(n={type:"ESUeViewer",container:e[0],id:e[6],options:{ws:e[1],esmsg:e[2]??void 0}},i={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}):typeof e[1]=="string"&&e[1].startsWith("http")?(n={type:"ESUeViewer",container:e[0],id:e[7],options:{uri:e[1],app:e[2],token:e[3]??void 0}},i={viewSync:e[4]??!0,attributeSync:e[5]??!0,destroy:e[6]??!0}):(n={type:"ESUeViewer",container:e[0],id:e[6],options:{project:e[1],baseUrl:e[2]??void 0}},i={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}));if(!n)throw new Error("参数错误");const{viewSync:s,attributeSync:o,destroy:a}=i;return this.switchViewer(n,s,o,a)}createCesiumViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESCesiumViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(n={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESCesiumViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createOpenLayersViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESOlViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(n={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESOlViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createUeViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESUeViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?n={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{ws:e[1],esmsg:e[2]??void 0}}:typeof e[1]=="string"&&e[1].startsWith("http")?n={type:"ESUeViewer",container:e[0],id:e[4]??void 0,options:{uri:e[1],app:e[2],token:e[3]??void 0}}:n={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{project:e[1],baseUrl:e[2]??void 0}}),!n)throw new Error("参数错误");return this.createViewer(n)}createSceneObject(e,n){return this._sobjm.createSceneObject(e,n)}createSceneObjectFromUrl(e,n){return this._sobjm.createSceneObjectFromUrl(e,n)}createSceneObjectFromClass(e,n){return this._sobjm.createSceneObjectFromClass(e,n)}createSceneObjectFromJson(e){return this._sobjm.createSceneObjectFromJson(e)}destroySceneObject(e){const n=this._sobjm.deleteSceneObject(e);return e.destroy(),n}destroyAllSceneObjects(){const e=[...this._sobjm.sceneObjects];for(let n of e)n!=this._player&&n!=this._cmrvm&&this.destroySceneObject(n)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}return d(Es,"getSceneObjById",K.context.getSceneObjectById.bind(K.context)),d(Es,"getEnv",K.context.getEnv.bind(K.context)),d(Es,"setEnv",K.context.setEnv.bind(K.context)),(r=>{r.createDefaultProps=()=>({})})(Es||(Es={})),g.extendClassProps(Es.prototype,Es.createDefaultProps),I.BasePropTreeItem=uf,I.Boolean2Property=ky,I.Boolean2sProperty=zy,I.Boolean3Property=Vy,I.Boolean3sProperty=Gy,I.Boolean4Property=Uy,I.Boolean4sProperty=qy,I.BooleanProperty=W,I.BooleansProperty=Ny,I.ColorProperty=_t,I.ColorRgbProperty=By,I.DashPatternProperty=Hy,I.DateProperty=Os,I.DatesProperty=jd,I.Destroyable=B,I.DoublyLinkedList=kd,I.DragStartDataManager=Zd,I.ES3DTileset=vn,I.ESAlarm=mf,I.ESApertureEffect=vf,I.ESAreaMeasurement=yf,I.ESBlastParticleSystem=_f,I.ESBoxClipping=wf,I.ESCameraView=gh,I.ESCameraViewCollection=vh,I.ESCameraVisibleRange=Ef,I.ESCar=yh,I.ESCityBasePoint=vd,I.ESClassification=_h,I.ESClippingPlane=Sf,I.ESCustomDiv=wh,I.ESCzml=yd,I.ESDataMesh=Cf,I.ESDatasmithRuntimeModel=Zf,I.ESDirectionMeasurement=Xf,I.ESDistanceMeasurement=If,I.ESDynamicWater=td,I.ESEntityCluster=gd,I.ESExcavate=Zu,I.ESFeatureLayer=Nd,I.ESFireParticleSystem=Pf,I.ESForestTileset=Mf,I.ESGaussianSplatting=Sd,I.ESGeoDiv=bf,I.ESGeoDivTextPoi=md,I.ESGeoExtrudedPolygon=eo,I.ESGeoJson=el,I.ESGeoLineString=qi,I.ESGeoPoints=sl,I.ESGeoPolygon=Ut,I.ESGeoRectangle=xf,I.ESGeoVector=yt,I.ESGeoWater=ed,I.ESGltfModel=_s,I.ESHeatMap=bh,I.ESHeightLimitAnalysis=pd,I.ESHeightMeasurement=Bf,I.ESHole=ad,I.ESHuman=to,I.ESHumanPoi=od,I.ESImageLabel=Eh,I.ESImageryLayer=Tf,I.ESJEditingMode=$,I.ESJLonLatFormat=Qd,I.ESJPickedResult=t0,I.ESLabel=Hr,I.ESLevelRuntimeModel=rd,I.ESLocalCircle=Hf,I.ESLocalPolygon=rl,I.ESLocalPolygonZ=Yf,I.ESLocalRectangle=Jf,I.ESLocalSkyBox=Of,I.ESLocalVector=ma,I.ESLocalVector2D=Gi,I.ESLocationMeasurement=Df,I.ESMsTileset=cd,I.ESNavigator=_d,I.ESObjectWithLocation=Z,I.ESObjectsManager=Es,I.ESParticleSystemPrimitive=Sh,I.ESPath=wa,I.ESPathImpl=ws,I.ESPipeFence=Ph,I.ESPipeline=nd,I.ESPipeserTileset=jf,I.ESPit=ya,I.ESPlayer=_a,I.ESPoi2D=tl,I.ESPoi3D=Af,I.ESPoiTileset=fd,I.ESPolygonFence=Mh,I.ESPolygonFlattenedPlane=Lf,I.ESPolygonWithHole=$f,I.ESRectangle=Qf,I.ESRtsFeatureEditing=hd,I.ESRtsTileset=ld,I.ESScale=dd,I.ESSceneObject=K,I.ESSceneObjectWithId=p0,I.ESSeparateFoliage=Rf,I.ESSkylineAnalysis=Id,I.ESStaticMesh=Cd,I.ESSubmergingAnalysis=Ff,I.ESSunshineAnalysis=kf,I.ESSurfaceAreaMeasurement=Kf,I.ESTerrainLayer=Vf,I.ESTestObject=gf,I.ESTextLabel=va,I.ESUEWidget=Uf,I.ESUnrealActor=zf,I.ESVideoFusion=Gf,I.ESViewShed=qf,I.ESViewer=Xn,I.ESViewerStatusBar=wd,I.ESViewerStatusBarScale=Ed,I.ESVisibilityAnalysis=id,I.ESVisualObject=Dt,I.ESVolumeMeasurement=sd,I.ESWidget=Wf,I.EngineObject=Ts,I.EnumProperty=pt,I.EnumStringsProperty=Yy,I.EvalStringProperty=Qi,I.Event=V,I.EventListenerHandler=Uh,I.FunctionProperty=it,I.GroupPropTreeItem=hf,I.GroupProperty=nt,I.JsonProperty=Q,I.LeafPropTreeItem=lf,I.ListenerPipe=Vh,I.LongStringProperty=qh,I.MaximumScreenSpaceErrorProperty=by,I.MinmaxProperty=Jy,I.NearFarScalerProperty=jy,I.NextAnimateFrameEvent=Gd,I.NonreactiveJsonStringProperty=Hd,I.Number2Property=_e,I.Number2sProperty=Xd,I.Number3Property=Je,I.Number3sProperty=Gh,I.Number4Property=Pn,I.Number4WithUndefinedProperty=Ry,I.Number4sProperty=Fy,I.NumberProperty=T,I.NumberRangeProperty=Qy,I.NumberSliderProperty=Pe,I.NumbersProperty=xy,I.ObjPool=Rh,I.ObservableSet=hl,I.ParamsProperty=Bd,I.PickedInfo=Zy,I.Player=Mn,I.PlayerProperty=cl,I.PositionProperty=Io,I.PositionsProperty=Yd,I.PositionsSetPropety=Ky,I.PropTree=Sv,I.PropUiTreeManager=ga,I.Property=ji,I.ReactVarProperty=mt,I.RotationProperty=Wh,I.SceneObjectFromId=Hh,I.SceneTree=Ku,I.SceneTreeContextMenu=xv,I.SceneTreeItem=ir,I.SceneTreeItemDragDrop=bv,I.SmartListenerHandler=tu,I.SmartListenerPipe=vy,I.SmoothMoveController=pP,I.String2Property=Ty,I.String2sProperty=Wd,I.String3Property=Oy,I.String3sProperty=Ay,I.String4Property=Dy,I.String4sProperty=Ly,I.StringNumberProperty=Wy,I.StringNumbersProperty=Xy,I.StringProperty=ot,I.StringsProperty=qd,I.TreeItemDragDrop=tp,I.UriProperty=eu,I.ViewPlayerProperty=Jd,I.ViewerCustomInteraction=ay,I.Watcher=ru,I.WatcherTools=ip,I.WithUndefinedProperty=zh,I.addTreesCallFunc=Av,I.animateFrame=wy,I.bindCustomEditing=np,I.booleanPointInPolygon=YI,I.cartesianDistance=Ev,I.clamp0_360=Po,I.clampN180_180=rp,I.createEventsCallFunc=Co,I.createPropTreeFromSceneObject=Cv,I.cutDownTreesCallFunc=Fv,I.defaultInitSceneObjectOnCreatingFunc=s0,I.defaultLight122FromEnvironmentMapManager=pf,I.defaultUpdateSceneObjectOnPickingFunc=i0,I.destroyObject=Ad,I.downloadLink=Iy,I.equalsN3=ff,I.geoAlong=JI,I.geoArea=sf,I.geoBuffer=mv,I.geoCenterOfMass=jI,I.geoDestination=fv,I.geoDifference=vv,I.geoDistance=ph,I.geoHeading=Qu,I.geoIntersect=pv,I.geoLineIntersect=QI,I.geoNearestPointOnLine=KI,I.geoPointToLineDistance=ZI,I.geoPolygonFromCircle=yv,I.geoPolygonOverlap=of,I.geoRhumbDestination=tP,I.geoRhumbDistance=dv,I.geoRhumbHeading=eP,I.geoUnion=gv,I.getDefaultValue=l0,I.getDistancesFromPositions=$u,I.getGeoBoundingSphereFromPositions=wv,I.getMidpoint=$I,I.getMinMaxCorner=_v,I.getSceneObjectTreeItem=o0,I.getXyzFromPostion=af,I.growthSimulationCallFunc=kv,I.hasSameTags=ep,I.hasSameViewerTags=Pi,I.inOrderRunning=h0,I.interval=yy,I.isJSON=Xh,I.isXML=u0,I.lbhToWebMerc=ZE,I.lbhToXyz=ei,I.lerpAngle=dl,I.lerpRotation=Bh,I.map=Iv,I.nextAnimateFrame=zd,I.nextMicroTask=Ey,I.oneTimeWarning=Ud,I.optionsStr=SP,I.reactPosition2Ds=cf,I.registerCreatedEventUpdate=rP,I.registerEventCtor=Ld,I.registerEventUpdate=nP,I.removeAllTreesCallFunc=Lv,I.rpToap=a0,I.saveOnBrowser=Cy,I.setSceneObjectTreeItem=fl,I.timeout=_y,I.updateTreeParamsCallFunc=Rv,I.webMercToLbh=tS,I.xyzToLbh=Kp,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"}),I})({},xbsj_base);