@vcmap/ui 5.0.0-rc.9 → 5.0.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 (724) hide show
  1. package/README.md +90 -106
  2. package/app.config.json +3 -0
  3. package/build/.eslintrc +3 -0
  4. package/build/build.js +302 -162
  5. package/build/buildCesium.js +39 -19
  6. package/build/buildHelpers.js +279 -87
  7. package/build/buildPreview.js +16 -6
  8. package/build/bundle.js +57 -0
  9. package/build/commonViteConfig.js +6 -15
  10. package/build/determineHost.js +17 -4
  11. package/build/generateOLLib.js +15 -18
  12. package/build/getPluginProxies.js +35 -3
  13. package/build/info/conf.json +21 -19
  14. package/build/info/publish.js +16 -5
  15. package/config/aerowest.config.json +47 -54
  16. package/config/base.config.json +607 -662
  17. package/config/codes.config.json +401 -0
  18. package/config/dev.config.json +460 -14
  19. package/config/graphFeatureInfo.config.json +141 -0
  20. package/config/projects.config.json +29 -0
  21. package/config/www.config.json +1843 -0
  22. package/dist/assets/@mdi/font/LICENSE +20 -0
  23. package/dist/assets/@mdi/font/css/materialdesignicons.css.map +16 -0
  24. package/dist/assets/@mdi/font/css/materialdesignicons.min.e3f476.css +3 -0
  25. package/dist/assets/@mdi/font/fonts/materialdesignicons-webfont.woff2 +0 -0
  26. package/dist/assets/cesium/ThirdParty/Workers/basis_transcoder.js +21 -0
  27. package/dist/assets/cesium/ThirdParty/Workers/package.json +1 -0
  28. package/dist/assets/cesium/ThirdParty/Workers/pako_deflate.min.js +2 -0
  29. package/dist/assets/cesium/ThirdParty/Workers/pako_inflate.min.js +2 -0
  30. package/dist/assets/cesium/ThirdParty/Workers/z-worker-pako.js +1 -0
  31. package/dist/assets/cesium/ThirdParty/basis_transcoder.wasm +0 -0
  32. package/dist/assets/cesium/ThirdParty/draco_decoder.wasm +0 -0
  33. package/dist/assets/cesium/ThirdParty/google-earth-dbroot-parser.js +8337 -0
  34. package/dist/assets/cesium/Workers/chunk-227AJNOA.js +59 -0
  35. package/dist/assets/cesium/Workers/chunk-2R5O53JW.js +157 -0
  36. package/dist/assets/cesium/Workers/chunk-34YUDLRP.js +781 -0
  37. package/dist/assets/cesium/Workers/chunk-3W63OHNJ.js +100 -0
  38. package/dist/assets/cesium/Workers/chunk-4MFFIWUA.js +163 -0
  39. package/dist/assets/cesium/Workers/chunk-66QLLS45.js +218 -0
  40. package/dist/assets/cesium/Workers/chunk-6BTKZDRG.js +77 -0
  41. package/dist/assets/cesium/Workers/chunk-A4JVFBQ3.js +101 -0
  42. package/dist/assets/cesium/Workers/chunk-ABADGKYE.js +58 -0
  43. package/dist/assets/cesium/Workers/chunk-AFFLIKOH.js +353 -0
  44. package/dist/assets/cesium/Workers/chunk-AHKEZ2OE.js +629 -0
  45. package/dist/assets/cesium/Workers/chunk-C3SXRKRW.js +476 -0
  46. package/dist/assets/cesium/Workers/chunk-CCFQRR6D.js +55 -0
  47. package/dist/assets/cesium/Workers/chunk-CHHNOC2C.js +1860 -0
  48. package/dist/assets/cesium/Workers/chunk-CTELOFLA.js +196 -0
  49. package/dist/assets/cesium/Workers/chunk-DUHWWBQQ.js +3273 -0
  50. package/dist/assets/cesium/Workers/chunk-EW2GWJYB.js +44 -0
  51. package/dist/assets/cesium/Workers/chunk-GLZBE3ML.js +421 -0
  52. package/dist/assets/cesium/Workers/chunk-HARLBUOL.js +236 -0
  53. package/dist/assets/cesium/Workers/chunk-HQF437NJ.js +117 -0
  54. package/dist/assets/cesium/Workers/chunk-IPA4EACJ.js +368 -0
  55. package/dist/assets/cesium/Workers/chunk-J3JY6I2C.js +1009 -0
  56. package/dist/assets/cesium/Workers/chunk-JB2LWGH4.js +390 -0
  57. package/dist/assets/cesium/Workers/chunk-JS3AW5BK.js +634 -0
  58. package/dist/assets/cesium/Workers/chunk-K36FEYS7.js +452 -0
  59. package/dist/assets/cesium/Workers/chunk-KD4Y7CZL.js +400 -0
  60. package/dist/assets/cesium/Workers/chunk-KTJSNCK4.js +842 -0
  61. package/dist/assets/cesium/Workers/chunk-LLUNNUJV.js +258 -0
  62. package/dist/assets/cesium/Workers/chunk-MPAZH4BF.js +37 -0
  63. package/dist/assets/cesium/Workers/chunk-MYZB7C4T.js +1258 -0
  64. package/dist/assets/cesium/Workers/chunk-N3JIFFX2.js +501 -0
  65. package/dist/assets/cesium/Workers/chunk-O5AMBQ36.js +430 -0
  66. package/dist/assets/cesium/Workers/chunk-OAVNIRB4.js +124 -0
  67. package/dist/assets/cesium/Workers/chunk-OYFCF4PL.js +171 -0
  68. package/dist/assets/cesium/Workers/chunk-OZJDGN5F.js +1477 -0
  69. package/dist/assets/cesium/Workers/chunk-PCJWUS4M.js +2041 -0
  70. package/dist/assets/cesium/Workers/chunk-PFQBCKBM.js +8644 -0
  71. package/dist/assets/cesium/Workers/chunk-QIKODV5G.js +305 -0
  72. package/dist/assets/cesium/Workers/chunk-QJ3DFBH3.js +73 -0
  73. package/dist/assets/cesium/Workers/chunk-QMEMZIJI.js +138 -0
  74. package/dist/assets/cesium/Workers/chunk-QT3MPEMI.js +102 -0
  75. package/dist/assets/cesium/Workers/chunk-RP2A7BR5.js +289 -0
  76. package/dist/assets/cesium/Workers/chunk-RW6LU2CJ.js +138 -0
  77. package/dist/assets/cesium/Workers/chunk-TFC6TZ3S.js +757 -0
  78. package/dist/assets/cesium/Workers/chunk-V3NGATMV.js +693 -0
  79. package/dist/assets/cesium/Workers/chunk-VLGOATD6.js +1075 -0
  80. package/dist/assets/cesium/Workers/chunk-WXTV4ATB.js +39 -0
  81. package/dist/assets/cesium/Workers/chunk-X4SU25DT.js +302 -0
  82. package/dist/assets/cesium/Workers/chunk-XTY7B2N6.js +2716 -0
  83. package/dist/assets/cesium/Workers/chunk-XY7MGBKC.js +513 -0
  84. package/dist/assets/cesium/Workers/chunk-Z24VKNDO.js +834 -0
  85. package/dist/assets/cesium/Workers/chunk-ZA25DG4Y.js +684 -0
  86. package/dist/assets/cesium/Workers/chunk-ZFOBYDGF.js +73 -0
  87. package/dist/assets/cesium/Workers/combineGeometry.js +67 -1
  88. package/dist/assets/cesium/Workers/createBoxGeometry.js +57 -1
  89. package/dist/assets/cesium/Workers/createBoxOutlineGeometry.js +234 -1
  90. package/dist/assets/cesium/Workers/createCircleGeometry.js +196 -1
  91. package/dist/assets/cesium/Workers/createCircleOutlineGeometry.js +146 -1
  92. package/dist/assets/cesium/Workers/createCoplanarPolygonGeometry.js +506 -1
  93. package/dist/assets/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +224 -1
  94. package/dist/assets/cesium/Workers/createCorridorGeometry.js +1262 -1
  95. package/dist/assets/cesium/Workers/createCorridorOutlineGeometry.js +567 -1
  96. package/dist/assets/cesium/Workers/createCylinderGeometry.js +59 -1
  97. package/dist/assets/cesium/Workers/createCylinderOutlineGeometry.js +231 -1
  98. package/dist/assets/cesium/Workers/createEllipseGeometry.js +70 -1
  99. package/dist/assets/cesium/Workers/createEllipseOutlineGeometry.js +63 -1
  100. package/dist/assets/cesium/Workers/createEllipsoidGeometry.js +58 -1
  101. package/dist/assets/cesium/Workers/createEllipsoidOutlineGeometry.js +60 -1
  102. package/dist/assets/cesium/Workers/createFrustumGeometry.js +57 -1
  103. package/dist/assets/cesium/Workers/createFrustumOutlineGeometry.js +234 -1
  104. package/dist/assets/cesium/Workers/createGeometry.js +150 -1
  105. package/dist/assets/cesium/Workers/createGroundPolylineGeometry.js +1607 -1
  106. package/dist/assets/cesium/Workers/createPlaneGeometry.js +223 -1
  107. package/dist/assets/cesium/Workers/createPlaneOutlineGeometry.js +123 -1
  108. package/dist/assets/cesium/Workers/createPolygonGeometry.js +1134 -1
  109. package/dist/assets/cesium/Workers/createPolygonOutlineGeometry.js +542 -1
  110. package/dist/assets/cesium/Workers/createPolylineGeometry.js +495 -1
  111. package/dist/assets/cesium/Workers/createPolylineVolumeGeometry.js +379 -1
  112. package/dist/assets/cesium/Workers/createPolylineVolumeOutlineGeometry.js +277 -1
  113. package/dist/assets/cesium/Workers/createRectangleGeometry.js +1273 -1
  114. package/dist/assets/cesium/Workers/createRectangleOutlineGeometry.js +480 -1
  115. package/dist/assets/cesium/Workers/createSimplePolylineGeometry.js +399 -1
  116. package/dist/assets/cesium/Workers/createSphereGeometry.js +117 -1
  117. package/dist/assets/cesium/Workers/createSphereOutlineGeometry.js +117 -1
  118. package/dist/assets/cesium/Workers/createTaskProcessorWorker.js +32 -1
  119. package/dist/assets/cesium/Workers/createVectorTileClampedPolylines.js +492 -1
  120. package/dist/assets/cesium/Workers/createVectorTileGeometries.js +386 -1
  121. package/dist/assets/cesium/Workers/createVectorTilePoints.js +112 -1
  122. package/dist/assets/cesium/Workers/createVectorTilePolygons.js +384 -1
  123. package/dist/assets/cesium/Workers/createVectorTilePolylines.js +262 -1
  124. package/dist/assets/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +568 -1
  125. package/dist/assets/cesium/Workers/createVerticesFromHeightmap.js +2277 -3
  126. package/dist/assets/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +745 -1
  127. package/dist/assets/cesium/Workers/createWallGeometry.js +489 -1
  128. package/dist/assets/cesium/Workers/createWallOutlineGeometry.js +337 -1
  129. package/dist/assets/cesium/Workers/decodeDraco.js +369 -1
  130. package/dist/assets/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +2650 -1
  131. package/dist/assets/cesium/Workers/decodeI3S.js +835 -0
  132. package/dist/assets/cesium/Workers/transcodeKTX2.js +3425 -1
  133. package/dist/assets/cesium/Workers/transferTypedArrayTest.js +41 -1
  134. package/dist/assets/cesium/Workers/upsampleQuantizedTerrainMesh.js +818 -1
  135. package/dist/assets/cesium.888ef7.js +164897 -0
  136. package/dist/assets/cesium.js +1 -1
  137. package/dist/assets/core.860907.js +19286 -0
  138. package/dist/assets/core.js +1 -1
  139. package/dist/assets/favicon-128.4c4ce5.png +0 -0
  140. package/dist/assets/favicon-180.5b99c0.png +0 -0
  141. package/dist/assets/favicon-192.0e205e.png +0 -0
  142. package/dist/assets/favicon-32.6b9add.png +0 -0
  143. package/dist/assets/favicon.d5ec97.svg +10 -0
  144. package/dist/assets/font/OFL.txt +93 -0
  145. package/dist/assets/font/TitilliumWeb-Regular.9ca076.woff2 +0 -0
  146. package/dist/assets/index-f265c560.js +1 -0
  147. package/dist/assets/ol.5e8a90.js +60117 -0
  148. package/dist/assets/ol.js +1 -1
  149. package/dist/assets/style/icon-marker-blue.534e37.png +0 -0
  150. package/dist/assets/style/icon-marker-green.0b6a92.png +0 -0
  151. package/dist/assets/style/icon-marker-o-blue.7b6d62.png +0 -0
  152. package/dist/assets/style/icon-marker-o-green.c863c0.png +0 -0
  153. package/dist/assets/style/icon-marker-o-red.93ff58.png +0 -0
  154. package/dist/assets/style/icon-marker-o.036477.png +0 -0
  155. package/dist/assets/style/icon-marker-red.313d03.png +0 -0
  156. package/dist/assets/style/icon-marker.70960f.png +0 -0
  157. package/dist/assets/style/icon-pin-blue.7be369.png +0 -0
  158. package/dist/assets/style/icon-pin-green.cbb935.png +0 -0
  159. package/dist/assets/style/icon-pin-red.3f25b2.png +0 -0
  160. package/dist/assets/style/icon-pin.b7ce77.png +0 -0
  161. package/dist/assets/ui.7758a8.css +5 -0
  162. package/dist/assets/ui.7758a8.js +16909 -0
  163. package/dist/assets/ui.js +1 -1
  164. package/dist/assets/vue.9771b3.js +4911 -0
  165. package/dist/assets/vue.js +5 -1
  166. package/dist/assets/vuetify.2818ff.css +5 -0
  167. package/dist/assets/vuetify.2818ff.js +21262 -0
  168. package/dist/assets/vuetify.js +5 -2
  169. package/dist/index.html +90 -8
  170. package/index.html +111 -0
  171. package/index.js +171 -24
  172. package/lib/cesium.js +1 -1
  173. package/lib/core.js +1 -1
  174. package/lib/olLib.js +861 -843
  175. package/lib/ui.js +1 -1
  176. package/lib/vue.js +2 -1
  177. package/lib/vuetify.js +2 -2
  178. package/package.json +56 -36
  179. package/plugins/.eslintrc +9 -0
  180. package/plugins/@vcmap-show-case/README.md +28 -0
  181. package/plugins/@vcmap-show-case/buttons-example/README.md +4 -0
  182. package/plugins/@vcmap-show-case/buttons-example/package.json +5 -0
  183. package/plugins/@vcmap-show-case/buttons-example/src/ButtonsExample.vue +282 -0
  184. package/plugins/@vcmap-show-case/buttons-example/src/index.js +51 -0
  185. package/plugins/@vcmap-show-case/category-tester/README.md +3 -0
  186. package/plugins/@vcmap-show-case/category-tester/package.json +5 -0
  187. package/plugins/@vcmap-show-case/category-tester/src/CategoriesExample.vue +135 -0
  188. package/plugins/@vcmap-show-case/category-tester/src/CollectionComponentOptions.vue +209 -0
  189. package/plugins/@vcmap-show-case/category-tester/src/index.js +73 -0
  190. package/plugins/@vcmap-show-case/collection-manager-example/README.md +3 -0
  191. package/plugins/@vcmap-show-case/collection-manager-example/package.json +5 -0
  192. package/plugins/@vcmap-show-case/collection-manager-example/src/CollectionManagerExample.vue +182 -0
  193. package/plugins/@vcmap-show-case/collection-manager-example/src/index.js +79 -0
  194. package/plugins/@vcmap-show-case/config-editor/README.md +3 -0
  195. package/plugins/@vcmap-show-case/config-editor/package.json +5 -0
  196. package/plugins/@vcmap-show-case/config-editor/src/ConfigEditor.vue +62 -0
  197. package/plugins/@vcmap-show-case/config-editor/src/index.js +49 -0
  198. package/plugins/@vcmap-show-case/context-menu-tester/README.md +3 -0
  199. package/plugins/@vcmap-show-case/context-menu-tester/package.json +5 -0
  200. package/plugins/@vcmap-show-case/context-menu-tester/src/index.js +41 -0
  201. package/plugins/@vcmap-show-case/form-inputs-example/README.md +4 -0
  202. package/plugins/@vcmap-show-case/form-inputs-example/config.json +5 -0
  203. package/plugins/@vcmap-show-case/form-inputs-example/package.json +5 -0
  204. package/plugins/@vcmap-show-case/form-inputs-example/src/FormInputsExample.vue +516 -0
  205. package/plugins/@vcmap-show-case/form-inputs-example/src/exampleActions.js +36 -0
  206. package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example/src}/index.js +119 -35
  207. package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example/src}/validation.js +14 -2
  208. package/plugins/@vcmap-show-case/hello-world/README.md +31 -0
  209. package/plugins/@vcmap-show-case/hello-world/package.json +6 -0
  210. package/plugins/@vcmap-show-case/hello-world/plugin-assets/vcs_logo.png +0 -0
  211. package/plugins/@vcmap-show-case/hello-world/src/defaultOptions.js +4 -0
  212. package/plugins/@vcmap-show-case/hello-world/src/helloWorld.vue +69 -0
  213. package/plugins/@vcmap-show-case/hello-world/src/index.js +142 -0
  214. package/plugins/@vcmap-show-case/hello-world/tests/helloWorld.spec.js +53 -0
  215. package/plugins/@vcmap-show-case/icons-example/README.md +5 -0
  216. package/plugins/@vcmap-show-case/icons-example/package.json +5 -0
  217. package/plugins/@vcmap-show-case/icons-example/src/AllIconsComponent.vue +51 -0
  218. package/plugins/@vcmap-show-case/icons-example/src/index.js +46 -0
  219. package/plugins/@vcmap-show-case/list-example/README.md +3 -0
  220. package/plugins/@vcmap-show-case/list-example/package.json +5 -0
  221. package/plugins/@vcmap-show-case/list-example/src/ListExample.vue +411 -0
  222. package/plugins/@vcmap-show-case/list-example/src/index.js +46 -0
  223. package/plugins/@vcmap-show-case/notifier-tester/README.md +3 -0
  224. package/plugins/@vcmap-show-case/notifier-tester/package.json +5 -0
  225. package/plugins/@vcmap-show-case/notifier-tester/src/NotifierTester.vue +82 -0
  226. package/plugins/@vcmap-show-case/notifier-tester/src/index.js +42 -0
  227. package/plugins/@vcmap-show-case/plugin-editors/README.md +4 -0
  228. package/plugins/@vcmap-show-case/plugin-editors/package.json +5 -0
  229. package/plugins/@vcmap-show-case/plugin-editors/src/PluginEditors.vue +119 -0
  230. package/plugins/@vcmap-show-case/plugin-editors/src/index.js +41 -0
  231. package/plugins/@vcmap-show-case/project-selector/README.md +25 -0
  232. package/plugins/@vcmap-show-case/project-selector/config.json +15 -0
  233. package/plugins/{@vcmap → @vcmap-show-case}/project-selector/package.json +3 -4
  234. package/plugins/{@vcmap/project-selector/ContextsListComponent.vue → @vcmap-show-case/project-selector/src/ModulesListComponent.vue} +22 -19
  235. package/plugins/@vcmap-show-case/project-selector/src/ProjectSelectorComponent.vue +102 -0
  236. package/plugins/@vcmap-show-case/project-selector/src/de.json +10 -0
  237. package/plugins/@vcmap-show-case/project-selector/src/en.json +10 -0
  238. package/plugins/@vcmap-show-case/project-selector/src/index.js +269 -0
  239. package/plugins/@vcmap-show-case/simple-graph/README.md +71 -0
  240. package/plugins/@vcmap-show-case/simple-graph/package.json +11 -0
  241. package/plugins/@vcmap-show-case/simple-graph/src/SimpleGraphComponent.vue +59 -0
  242. package/plugins/@vcmap-show-case/simple-graph/src/index.js +17 -0
  243. package/plugins/@vcmap-show-case/simple-graph/src/simpleGraphView.js +78 -0
  244. package/plugins/@vcmap-show-case/style-input-example/README.md +4 -0
  245. package/plugins/@vcmap-show-case/style-input-example/package.json +5 -0
  246. package/plugins/@vcmap-show-case/style-input-example/src/StyleExample.vue +190 -0
  247. package/plugins/@vcmap-show-case/style-input-example/src/index.js +42 -0
  248. package/plugins/@vcmap-show-case/switch-map-callback-example/README.md +21 -0
  249. package/plugins/@vcmap-show-case/switch-map-callback-example/config.json +3 -0
  250. package/plugins/@vcmap-show-case/switch-map-callback-example/package.json +5 -0
  251. package/plugins/@vcmap-show-case/switch-map-callback-example/src/index.js +34 -0
  252. package/plugins/@vcmap-show-case/switch-map-callback-example/src/switchMapCallback.js +47 -0
  253. package/plugins/@vcmap-show-case/table-example/README.md +3 -0
  254. package/plugins/@vcmap-show-case/table-example/package.json +5 -0
  255. package/plugins/@vcmap-show-case/table-example/src/DataTableExample.vue +187 -0
  256. package/plugins/@vcmap-show-case/table-example/src/index.js +49 -0
  257. package/plugins/@vcmap-show-case/textfields-example/README.md +3 -0
  258. package/plugins/@vcmap-show-case/textfields-example/package.json +5 -0
  259. package/plugins/{example/mySuperComponent.vue → @vcmap-show-case/textfields-example/src/TextfieldsExample.vue} +13 -31
  260. package/plugins/@vcmap-show-case/textfields-example/src/index.js +64 -0
  261. package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/README.md +5 -3
  262. package/plugins/@vcmap-show-case/theme-changer/config.json +69 -0
  263. package/plugins/@vcmap-show-case/theme-changer/package.json +11 -0
  264. package/plugins/{@vcmap/theme-changer → @vcmap-show-case/theme-changer/src}/ThemeChangerComponent.vue +36 -8
  265. package/plugins/{@vcmap/theme-changer → @vcmap-show-case/theme-changer/src}/index.js +14 -8
  266. package/plugins/@vcmap-show-case/vector-properties-example/package.json +5 -0
  267. package/plugins/@vcmap-show-case/vector-properties-example/src/VectorPropertiesExample.vue +128 -0
  268. package/plugins/@vcmap-show-case/vector-properties-example/src/index.js +40 -0
  269. package/plugins/@vcmap-show-case/window-tester/README.md +3 -0
  270. package/plugins/@vcmap-show-case/window-tester/package.json +5 -0
  271. package/plugins/@vcmap-show-case/window-tester/src/EmptyComponent.vue +18 -0
  272. package/plugins/@vcmap-show-case/window-tester/src/MyCustomHeader.vue +31 -0
  273. package/plugins/@vcmap-show-case/window-tester/src/WindowExample.vue +185 -0
  274. package/plugins/@vcmap-show-case/window-tester/src/WindowExampleContent.vue +18 -0
  275. package/plugins/@vcmap-show-case/window-tester/src/WindowExampleToggleChild.vue +45 -0
  276. package/plugins/@vcmap-show-case/window-tester/src/index.js +80 -0
  277. package/plugins/@vcmap-show-case/window-tester/src/toolboxData.js +288 -0
  278. package/plugins/@vcmap-show-case/wizard-example/README.md +3 -0
  279. package/plugins/@vcmap-show-case/wizard-example/package.json +5 -0
  280. package/plugins/@vcmap-show-case/wizard-example/src/WizardExample.vue +127 -0
  281. package/plugins/@vcmap-show-case/wizard-example/src/index.js +53 -0
  282. package/plugins/package.json +9 -2
  283. package/public/assets/@mdi/font/LICENSE +20 -0
  284. package/public/assets/@mdi/font/css/materialdesignicons.css.map +16 -0
  285. package/public/assets/@mdi/font/css/materialdesignicons.min.css +3 -0
  286. package/public/assets/@mdi/font/fonts/materialdesignicons-webfont.woff2 +0 -0
  287. package/public/assets/favicon-128.png +0 -0
  288. package/public/assets/favicon-180.png +0 -0
  289. package/public/assets/favicon-192.png +0 -0
  290. package/public/assets/favicon-32.png +0 -0
  291. package/public/assets/favicon.svg +10 -0
  292. package/public/assets/font/OFL.txt +93 -0
  293. package/public/assets/font/TitilliumWeb-Regular.woff2 +0 -0
  294. package/public/assets/style/icon-marker-blue.png +0 -0
  295. package/public/assets/style/icon-marker-green.png +0 -0
  296. package/public/assets/style/icon-marker-o-blue.png +0 -0
  297. package/public/assets/style/icon-marker-o-green.png +0 -0
  298. package/public/assets/style/icon-marker-o-red.png +0 -0
  299. package/public/assets/style/icon-marker-o.png +0 -0
  300. package/public/assets/style/icon-marker-red.png +0 -0
  301. package/public/assets/style/icon-marker.png +0 -0
  302. package/public/assets/style/icon-pin-blue.png +0 -0
  303. package/public/assets/style/icon-pin-green.png +0 -0
  304. package/public/assets/style/icon-pin-red.png +0 -0
  305. package/public/assets/style/icon-pin.png +0 -0
  306. package/src/actions/StyleSelector.vue +136 -0
  307. package/src/actions/actionHelper.js +203 -50
  308. package/src/actions/stateRefAction.js +2 -3
  309. package/src/application/VcsApp.vue +538 -98
  310. package/src/application/VcsAppWrapper.vue +32 -0
  311. package/src/application/VcsAttributions.vue +83 -0
  312. package/src/application/VcsAttributionsFooter.vue +83 -0
  313. package/src/application/VcsMap.vue +22 -5
  314. package/src/application/VcsNavbar.vue +217 -0
  315. package/src/application/VcsSettings.vue +98 -0
  316. package/src/application/attributionsHelper.js +162 -0
  317. package/src/callback/activateLayersCallback.js +54 -0
  318. package/src/callback/applyLayerStyleCallback.js +63 -0
  319. package/src/callback/deactivateLayersCallback.js +54 -0
  320. package/src/callback/goToViewpointCallback.js +54 -0
  321. package/src/callback/vcsCallback.js +66 -0
  322. package/src/components/ImageElementInjector.vue +24 -0
  323. package/src/components/buttons/VcsActionButtonList.vue +52 -22
  324. package/src/components/buttons/VcsButton.vue +60 -110
  325. package/src/components/buttons/VcsFormButton.vue +178 -0
  326. package/src/components/buttons/VcsToolButton.vue +161 -0
  327. package/src/components/form-inputs-controls/VcsCheckbox.vue +62 -20
  328. package/src/components/form-inputs-controls/VcsChipArrayInput.vue +290 -0
  329. package/src/components/form-inputs-controls/VcsDatePicker.vue +156 -0
  330. package/src/components/form-inputs-controls/VcsFormSection.vue +120 -16
  331. package/src/components/form-inputs-controls/VcsLabel.vue +29 -11
  332. package/src/components/form-inputs-controls/VcsRadio.vue +149 -0
  333. package/src/components/form-inputs-controls/VcsRadioGrid.vue +175 -0
  334. package/src/components/form-inputs-controls/VcsSelect.vue +164 -50
  335. package/src/components/form-inputs-controls/VcsSlider.vue +73 -0
  336. package/src/components/form-inputs-controls/VcsTextArea.vue +118 -68
  337. package/src/components/form-inputs-controls/VcsTextField.vue +238 -69
  338. package/src/components/form-inputs-controls/VcsWizard.vue +137 -0
  339. package/src/components/form-inputs-controls/VcsWizardStep.vue +161 -0
  340. package/src/components/form-inputs-controls/composables.js +31 -0
  341. package/src/components/form-output/VcsFormattedNumber.vue +28 -28
  342. package/src/{icons → components/icons}/+all.js +109 -5
  343. package/src/components/icons/2DAreaIcon.vue +58 -0
  344. package/src/components/icons/2DDistanceIcon.vue +24 -0
  345. package/src/components/icons/3DAreaIcon.vue +58 -0
  346. package/src/components/icons/3DDistanceIcon.vue +24 -0
  347. package/src/components/icons/3DHeightIcon.vue +24 -0
  348. package/src/components/icons/AngleIcon.vue +16 -0
  349. package/src/{icons → components/icons}/AssociationsIcon.vue +7 -4
  350. package/src/components/icons/AxisIcon.vue +35 -0
  351. package/src/components/icons/BoundingBoxIcon.vue +38 -0
  352. package/src/components/icons/CheckboxCheckedIcon.vue +12 -0
  353. package/src/components/icons/CheckboxIcon.vue +21 -0
  354. package/src/components/icons/CheckboxIndeterminateIcon.vue +10 -0
  355. package/src/components/icons/CircleIcon.vue +25 -0
  356. package/src/components/icons/ClippingHorizontalIcon.vue +18 -0
  357. package/src/components/icons/ClippingIcon.vue +17 -0
  358. package/src/components/icons/ClippingVerticalIcon.vue +18 -0
  359. package/src/components/icons/ColorPickerIcon.vue +17 -0
  360. package/src/{icons → components/icons}/ColorSwatchIcon.vue +6 -2
  361. package/src/{icons → components/icons}/CommentIcon.vue +6 -6
  362. package/src/components/icons/CompassIcon.vue +24 -0
  363. package/src/components/icons/ComponentsIcon.vue +18 -0
  364. package/src/components/icons/ConeIcon.vue +30 -0
  365. package/src/components/icons/DimensionsHouseIcon.vue +20 -0
  366. package/src/components/icons/EditIcon.vue +17 -0
  367. package/src/components/icons/EditVerticesIcon.vue +35 -0
  368. package/src/{icons → components/icons}/ElevationProfileIcon.vue +7 -14
  369. package/src/components/icons/ExportAreaIcon.vue +17 -0
  370. package/src/components/icons/ExportFlightIcon.vue +17 -0
  371. package/src/components/icons/ExportIcon.vue +24 -0
  372. package/src/components/icons/ExternalLinkIcon.vue +23 -0
  373. package/src/components/icons/EyeIcon.vue +17 -0
  374. package/src/components/icons/FastForwardIcon.vue +17 -0
  375. package/src/components/icons/FilterIcon.vue +18 -0
  376. package/src/components/icons/GlobalTerrainIcon.vue +19 -0
  377. package/src/components/icons/GlobeNatureIcon.vue +17 -0
  378. package/src/components/icons/GroundIcon.vue +27 -0
  379. package/src/{icons → components/icons}/HealthCareIndustriesIcon.vue +7 -12
  380. package/src/components/icons/HelpIcon.vue +17 -0
  381. package/src/components/icons/HideIcon.vue +25 -0
  382. package/src/components/icons/HomePointIcon.vue +17 -0
  383. package/src/{icons → components/icons}/HospitalsIcon.vue +7 -21
  384. package/src/components/icons/HouseIcon.vue +32 -0
  385. package/src/components/icons/ImportIcon.vue +18 -0
  386. package/src/components/icons/InfoIcon.vue +24 -0
  387. package/src/{icons → components/icons}/KebabIcon.vue +7 -5
  388. package/src/components/icons/LabelIcon.vue +23 -0
  389. package/src/{icons → components/icons}/LayersIcon.vue +7 -5
  390. package/src/components/icons/LegendIcon.vue +24 -0
  391. package/src/components/icons/LineIcon.vue +22 -0
  392. package/src/components/icons/LinkIcon.vue +17 -0
  393. package/src/components/icons/LogoutIcon.vue +17 -0
  394. package/src/components/icons/MapIcon.vue +18 -0
  395. package/src/{icons → components/icons}/MenuIcon.vue +7 -5
  396. package/src/components/icons/MinusIcon.vue +18 -0
  397. package/src/components/icons/ObjectAttributeIcon.vue +18 -0
  398. package/src/components/icons/ObjectSelectIcon.vue +18 -0
  399. package/src/components/icons/ObliqueViewIcon.vue +19 -0
  400. package/src/components/icons/PdfIcon.vue +19 -0
  401. package/src/components/icons/PedestrianIcon.vue +17 -0
  402. package/src/components/icons/PenIcon.vue +16 -0
  403. package/src/components/icons/PlayCircleIcon.vue +20 -0
  404. package/src/components/icons/PlusIcon.vue +18 -0
  405. package/src/components/icons/PoiIcon.vue +23 -0
  406. package/src/{icons/PolygonIcon.vue → components/icons/PointIcon.vue} +8 -6
  407. package/src/components/icons/PointSelectIcon.vue +18 -0
  408. package/src/components/icons/PresentationModeIcon.vue +17 -0
  409. package/src/{icons → components/icons}/ProgressIcon.vue +9 -7
  410. package/src/components/icons/QueryIcon.vue +39 -0
  411. package/src/components/icons/RectangleIcon.vue +24 -0
  412. package/src/components/icons/ReturnIcon.vue +17 -0
  413. package/src/components/icons/RewindIcon.vue +16 -0
  414. package/src/components/icons/RotateLeftIcon.vue +17 -0
  415. package/src/components/icons/RotateRightIcon.vue +17 -0
  416. package/src/components/icons/ScreenshotIcon.vue +53 -0
  417. package/src/components/icons/SearchIcon.vue +17 -0
  418. package/src/components/icons/ShadowIcon.vue +18 -0
  419. package/src/{icons → components/icons}/ShapesIcon.vue +13 -6
  420. package/src/components/icons/ShareIcon.vue +22 -0
  421. package/src/components/icons/SimpleCircleFilledIcon.vue +18 -0
  422. package/src/{icons → components/icons}/SimpleCircleHalfFilledIcon.vue +6 -2
  423. package/src/components/icons/SimpleCircleOutlinedIcon.vue +13 -0
  424. package/src/components/icons/SkipNextIcon.vue +18 -0
  425. package/src/components/icons/SkipPreviousIcon.vue +18 -0
  426. package/src/{icons → components/icons}/SplitViewIcon.vue +6 -6
  427. package/src/components/icons/TerrainBoxIcon.vue +19 -0
  428. package/src/components/icons/TextStyleIcon.vue +17 -0
  429. package/src/components/icons/ThreeDimensionsIcon.vue +17 -0
  430. package/src/components/icons/ToolsIcon.vue +16 -0
  431. package/src/components/icons/TouchIcon.vue +18 -0
  432. package/src/components/icons/TrashCanIcon.vue +18 -0
  433. package/src/components/icons/TriangleIcon.vue +16 -0
  434. package/src/components/icons/TwoDimensionsIcon.vue +18 -0
  435. package/src/components/icons/UploadIcon.vue +17 -0
  436. package/src/components/icons/UserProfileIcon.vue +17 -0
  437. package/src/components/icons/UserShareIcon.vue +16 -0
  438. package/src/components/icons/VideoRecorderIcon.vue +23 -0
  439. package/src/components/icons/ViewpointFlightIcon.vue +28 -0
  440. package/src/components/icons/ViewpointIcon.vue +28 -0
  441. package/src/components/icons/Viewshed360Icon.vue +18 -0
  442. package/src/components/icons/ViewshedConeIcon.vue +17 -0
  443. package/src/components/icons/ViewshedIcon.vue +18 -0
  444. package/src/components/icons/WalkingIcon.vue +17 -0
  445. package/src/components/icons/WallIcon.vue +22 -0
  446. package/src/components/icons/WandIcon.vue +123 -0
  447. package/src/components/lists/VcsActionList.vue +57 -25
  448. package/src/components/lists/VcsList.vue +593 -0
  449. package/src/components/lists/VcsTreeview.vue +45 -42
  450. package/src/components/lists/VcsTreeviewLeaf.vue +45 -69
  451. package/src/components/lists/VcsTreeviewSearchbar.vue +40 -48
  452. package/src/components/notification/VcsBadge.vue +6 -4
  453. package/src/components/notification/VcsHelp.vue +39 -0
  454. package/src/components/notification/VcsTooltip.vue +111 -105
  455. package/src/components/notification/validation.js +1 -1
  456. package/src/components/plugins/AbstractConfigEditor.vue +84 -0
  457. package/src/components/style/MenuWrapper.vue +140 -0
  458. package/src/components/style/VcsFillMenu.vue +61 -0
  459. package/src/components/style/VcsFillSelector.vue +45 -0
  460. package/src/components/style/VcsImageMenu.vue +83 -0
  461. package/src/components/style/VcsImageSelector.vue +986 -0
  462. package/src/components/style/VcsStrokeMenu.vue +73 -0
  463. package/src/components/style/VcsStrokeSelector.vue +88 -0
  464. package/src/components/style/VcsTextMenu.vue +81 -0
  465. package/src/components/style/VcsTextSelector.vue +269 -0
  466. package/src/components/style/VcsVectorStyleComponent.vue +114 -0
  467. package/src/components/style/composables.js +84 -0
  468. package/src/components/tables/VcsDataTable.vue +503 -0
  469. package/src/components/tables/VcsTable.vue +145 -0
  470. package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +778 -0
  471. package/src/components/vector-properties/composables.js +93 -0
  472. package/src/contentTree/LayerTree.vue +18 -14
  473. package/src/contentTree/contentTreeCollection.js +109 -41
  474. package/src/contentTree/contentTreeItem.js +109 -43
  475. package/src/contentTree/groupContentTreeItem.js +46 -23
  476. package/src/contentTree/layerContentTreeItem.js +54 -23
  477. package/src/contentTree/layerGroupContentTreeItem.js +58 -26
  478. package/src/contentTree/nodeContentTreeItem.js +19 -8
  479. package/src/contentTree/obliqueCollectionContentTreeItem.js +51 -22
  480. package/src/contentTree/subContentTreeItem.js +14 -5
  481. package/src/contentTree/vcsObjectContentTreeItem.js +27 -16
  482. package/src/contentTree/viewpointContentTreeItem.js +121 -0
  483. package/src/downloadHelper.js +52 -0
  484. package/src/featureInfo/AddressBalloonComponent.vue +58 -0
  485. package/src/featureInfo/BalloonComponent.vue +193 -0
  486. package/src/featureInfo/abstractFeatureInfoView.js +346 -0
  487. package/src/featureInfo/addressBalloonFeatureInfoView.js +130 -0
  488. package/src/featureInfo/balloonFeatureInfoView.js +159 -0
  489. package/src/featureInfo/balloonHelper.js +172 -0
  490. package/src/featureInfo/featureInfo.js +525 -0
  491. package/src/featureInfo/featureInfoInteraction.js +48 -0
  492. package/src/featureInfo/iframeFeatureInfoView.js +97 -0
  493. package/src/featureInfo/tableFeatureInfoView.js +120 -0
  494. package/src/i18n/de.js +195 -0
  495. package/src/i18n/en.js +195 -0
  496. package/src/i18n/i18nCollection.js +137 -0
  497. package/src/init.js +121 -36
  498. package/src/legend/StyleLegendItem.vue +176 -0
  499. package/src/legend/VcsLegend.vue +140 -0
  500. package/src/legend/legendHelper.js +204 -0
  501. package/src/manager/buttonManager.js +35 -16
  502. package/src/manager/collectionManager/CollectionComponent.vue +140 -0
  503. package/src/manager/collectionManager/CollectionComponentList.vue +77 -0
  504. package/src/manager/collectionManager/CollectionComponentProvider.vue +39 -0
  505. package/src/manager/collectionManager/CollectionManager.vue +62 -0
  506. package/src/manager/collectionManager/categoryManager.js +83 -0
  507. package/src/manager/collectionManager/collectionComponent.js +470 -0
  508. package/src/manager/collectionManager/collectionManager.js +432 -0
  509. package/src/manager/contextMenu/ContextMenuComponent.vue +43 -0
  510. package/src/manager/contextMenu/contextMenuInteraction.js +47 -0
  511. package/src/manager/contextMenu/contextMenuManager.js +220 -0
  512. package/src/manager/navbarManager.js +47 -13
  513. package/src/manager/toolbox/GroupToolboxComponent.vue +128 -0
  514. package/src/manager/toolbox/SelectToolboxComponent.vue +144 -0
  515. package/src/manager/toolbox/ToolboxManager.vue +124 -102
  516. package/src/manager/toolbox/toolboxManager.js +257 -87
  517. package/src/manager/window/WindowComponent.vue +105 -85
  518. package/src/manager/window/WindowComponentHeader.vue +115 -24
  519. package/src/manager/window/WindowManager.vue +121 -55
  520. package/src/manager/window/windowHelper.js +465 -0
  521. package/src/manager/window/windowManager.js +298 -87
  522. package/src/navigation/{mapNavCompass.vue → MapNavCompass.vue} +31 -11
  523. package/src/navigation/MapNavigation.vue +276 -0
  524. package/src/navigation/ObliqueRotation.vue +69 -0
  525. package/src/navigation/{orientationToolsButton.vue → OrientationToolsButton.vue} +13 -12
  526. package/src/navigation/{tiltSlider.vue → TiltSlider.vue} +39 -16
  527. package/src/navigation/VcsCompass.vue +69 -0
  528. package/src/navigation/VcsZoomButton.vue +52 -0
  529. package/src/navigation/overviewMap.js +142 -104
  530. package/src/navigation/overviewMapClickedInteraction.js +6 -1
  531. package/src/notifier/NotifierComponent.vue +86 -0
  532. package/src/notifier/notifier.js +129 -0
  533. package/src/pluginHelper.js +148 -20
  534. package/src/search/ResultItem.vue +83 -0
  535. package/src/search/ResultsComponent.vue +103 -0
  536. package/src/search/SearchComponent.vue +116 -0
  537. package/src/search/search.js +342 -0
  538. package/src/setup.js +9 -10
  539. package/src/state.js +272 -0
  540. package/src/styles/_theming.scss +69 -21
  541. package/src/styles/_typography.scss +3 -6
  542. package/src/styles/main.scss +9 -0
  543. package/src/styles/shades.scss +4 -0
  544. package/src/styles/utils/_border.scss +1 -1
  545. package/src/styles/utils/_cursor.scss +4 -0
  546. package/src/styles/utils/_display.scss +1 -1
  547. package/src/styles/variables.scss +79 -11
  548. package/src/styles/vcsFont.scss +2 -5
  549. package/src/styles/vcsGrid.scss +9 -0
  550. package/src/uiConfig.js +83 -0
  551. package/src/vcsUiApp.js +508 -68
  552. package/src/vuePlugins/i18n.js +51 -13
  553. package/src/vuePlugins/vuetify.js +104 -43
  554. package/config/berlin.config.json +0 -529
  555. package/dist/assets/cesium/Workers/ArcType-fc72c06c.js +0 -1
  556. package/dist/assets/cesium/Workers/AttributeCompression-80665726.js +0 -1
  557. package/dist/assets/cesium/Workers/AxisAlignedBoundingBox-a655a4bc.js +0 -1
  558. package/dist/assets/cesium/Workers/BoundingRectangle-c3b79029.js +0 -1
  559. package/dist/assets/cesium/Workers/BoxGeometry-f8f9c981.js +0 -1
  560. package/dist/assets/cesium/Workers/Color-de06a177.js +0 -1
  561. package/dist/assets/cesium/Workers/ComponentDatatype-a15c9a19.js +0 -1
  562. package/dist/assets/cesium/Workers/CoplanarPolygonGeometryLibrary-48cdc26d.js +0 -1
  563. package/dist/assets/cesium/Workers/CorridorGeometryLibrary-ddc027d3.js +0 -1
  564. package/dist/assets/cesium/Workers/CylinderGeometry-82a8cbe6.js +0 -1
  565. package/dist/assets/cesium/Workers/CylinderGeometryLibrary-76cda53e.js +0 -1
  566. package/dist/assets/cesium/Workers/EllipseGeometry-32d55454.js +0 -1
  567. package/dist/assets/cesium/Workers/EllipseGeometryLibrary-b2ae188a.js +0 -1
  568. package/dist/assets/cesium/Workers/EllipseOutlineGeometry-f05a5a27.js +0 -1
  569. package/dist/assets/cesium/Workers/EllipsoidGeodesic-19e75e11.js +0 -1
  570. package/dist/assets/cesium/Workers/EllipsoidGeometry-7c99fc81.js +0 -1
  571. package/dist/assets/cesium/Workers/EllipsoidOutlineGeometry-21c243df.js +0 -1
  572. package/dist/assets/cesium/Workers/EllipsoidRhumbLine-6145377b.js +0 -1
  573. package/dist/assets/cesium/Workers/EllipsoidTangentPlane-a01286f6.js +0 -1
  574. package/dist/assets/cesium/Workers/EncodedCartesian3-d9f5c4a4.js +0 -1
  575. package/dist/assets/cesium/Workers/FrustumGeometry-17776af8.js +0 -1
  576. package/dist/assets/cesium/Workers/GeometryAttribute-89a520b9.js +0 -1
  577. package/dist/assets/cesium/Workers/GeometryAttributes-32b29525.js +0 -1
  578. package/dist/assets/cesium/Workers/GeometryInstance-4fbf16ba.js +0 -1
  579. package/dist/assets/cesium/Workers/GeometryOffsetAttribute-8c5e10db.js +0 -1
  580. package/dist/assets/cesium/Workers/GeometryPipeline-309fad76.js +0 -1
  581. package/dist/assets/cesium/Workers/IndexDatatype-f1dcdf35.js +0 -1
  582. package/dist/assets/cesium/Workers/IntersectionTests-58aa8f80.js +0 -1
  583. package/dist/assets/cesium/Workers/Matrix2-47e98d76.js +0 -1
  584. package/dist/assets/cesium/Workers/OrientedBoundingBox-fcb5b750.js +0 -1
  585. package/dist/assets/cesium/Workers/Plane-3f01019d.js +0 -1
  586. package/dist/assets/cesium/Workers/PolygonGeometryLibrary-0b29eb16.js +0 -1
  587. package/dist/assets/cesium/Workers/PolygonPipeline-a934c4dd.js +0 -1
  588. package/dist/assets/cesium/Workers/PolylinePipeline-8095c9bc.js +0 -1
  589. package/dist/assets/cesium/Workers/PolylineVolumeGeometryLibrary-67d12fff.js +0 -1
  590. package/dist/assets/cesium/Workers/PrimitivePipeline-980e44c5.js +0 -1
  591. package/dist/assets/cesium/Workers/RectangleGeometryLibrary-621c6de8.js +0 -1
  592. package/dist/assets/cesium/Workers/RuntimeError-8952249c.js +0 -1
  593. package/dist/assets/cesium/Workers/TerrainEncoding-f96552d5.js +0 -1
  594. package/dist/assets/cesium/Workers/Transforms-c8cb8f43.js +0 -39
  595. package/dist/assets/cesium/Workers/VertexFormat-a0b706b0.js +0 -1
  596. package/dist/assets/cesium/Workers/WallGeometryLibrary-c03d8479.js +0 -1
  597. package/dist/assets/cesium/Workers/WebGLConstants-508b9636.js +0 -1
  598. package/dist/assets/cesium/Workers/WebMercatorProjection-79b3214e.js +0 -1
  599. package/dist/assets/cesium/Workers/_commonjsHelpers-3aae1032-26891ab7.js +0 -1
  600. package/dist/assets/cesium/Workers/_rollup_plugin_ignore_empty_module_placeholder-57d574d0.js +0 -1
  601. package/dist/assets/cesium/Workers/arrayRemoveDuplicates-dc2f4046.js +0 -1
  602. package/dist/assets/cesium/Workers/cesiumWorkerBootstrapper.js +0 -6
  603. package/dist/assets/cesium/Workers/combine-3c023bda.js +0 -1
  604. package/dist/assets/cesium/Workers/defaultValue-81eec7ed.js +0 -1
  605. package/dist/assets/cesium.4e40f4.js +0 -9105
  606. package/dist/assets/core.edcf5e.js +0 -4
  607. package/dist/assets/index.60dea538.css +0 -1
  608. package/dist/assets/index.889d0f3a.js +0 -1
  609. package/dist/assets/ol.246fd4.js +0 -318
  610. package/dist/assets/ui.df4f6d.css +0 -1
  611. package/dist/assets/ui.df4f6d.js +0 -43
  612. package/dist/assets/vue-composition-api.a520f3.js +0 -14
  613. package/dist/assets/vue-composition-api.js +0 -2
  614. package/dist/assets/vue.2cee44.js +0 -9
  615. package/dist/assets/vuetify.cc817b.css +0 -5
  616. package/dist/assets/vuetify.cc817b.js +0 -48
  617. package/lib/vue-composition-api.js +0 -2
  618. package/map.config.json +0 -35
  619. package/plugins/@vcmap/pluginExample/config.json +0 -6
  620. package/plugins/@vcmap/pluginExample/package.json +0 -7
  621. package/plugins/@vcmap/pluginExample/pluginExampleComponent.vue +0 -374
  622. package/plugins/@vcmap/project-selector/ProjectSelectorComponent.vue +0 -81
  623. package/plugins/@vcmap/project-selector/README.md +0 -29
  624. package/plugins/@vcmap/project-selector/config.json +0 -15
  625. package/plugins/@vcmap/project-selector/index.js +0 -254
  626. package/plugins/@vcmap/theme-changer/config.json +0 -69
  627. package/plugins/@vcmap/theme-changer/package.json +0 -12
  628. package/plugins/buttonExamples/ButtonExamples.vue +0 -190
  629. package/plugins/buttonExamples/index.js +0 -41
  630. package/plugins/categoryTest/Categories.vue +0 -145
  631. package/plugins/categoryTest/Category.vue +0 -114
  632. package/plugins/categoryTest/ItemEditor.vue +0 -13
  633. package/plugins/categoryTest/index.js +0 -41
  634. package/plugins/example/index.js +0 -75
  635. package/plugins/test/allIconsComponent.vue +0 -34
  636. package/plugins/test/editor.vue +0 -63
  637. package/plugins/test/index.js +0 -116
  638. package/plugins/test/myCustomHeader.vue +0 -19
  639. package/plugins/test/toolbox-data.js +0 -129
  640. package/plugins/test/vcsContent.vue +0 -23
  641. package/plugins/test/windowManagerExample.vue +0 -143
  642. package/src/actions/styleSelector.vue +0 -90
  643. package/src/application/Navbar.vue +0 -130
  644. package/src/application/empty-cmp.vue +0 -6
  645. package/src/components/form-inputs-controls/VcsColorPicker.vue +0 -81
  646. package/src/contentTree/viewPointContentTreeItem.js +0 -107
  647. package/src/icons/2DAreaIcon.vue +0 -21
  648. package/src/icons/2DDistanceIcon.vue +0 -18
  649. package/src/icons/3DAreaIcon.vue +0 -21
  650. package/src/icons/3DDistanceIcon.vue +0 -18
  651. package/src/icons/3DHeightIcon.vue +0 -18
  652. package/src/icons/AngleIcon.vue +0 -8
  653. package/src/icons/AxisIcon.vue +0 -10
  654. package/src/icons/BoundingBoxIcon.vue +0 -15
  655. package/src/icons/CheckboxCheckedIcon.vue +0 -16
  656. package/src/icons/CheckboxIcon.vue +0 -23
  657. package/src/icons/CheckboxIndeterminateIcon.vue +0 -24
  658. package/src/icons/CircleIcon.vue +0 -10
  659. package/src/icons/CompassIcon.vue +0 -8
  660. package/src/icons/ComponentsIcon.vue +0 -7
  661. package/src/icons/ConeIcon.vue +0 -11
  662. package/src/icons/DimensionsHouseIcon.vue +0 -14
  663. package/src/icons/ExportAreaIcon.vue +0 -7
  664. package/src/icons/ExportFlightIcon.vue +0 -7
  665. package/src/icons/ExportIcon.vue +0 -8
  666. package/src/icons/ExternalLinkIcon.vue +0 -10
  667. package/src/icons/EyeIcon.vue +0 -7
  668. package/src/icons/FastForwardIcon.vue +0 -7
  669. package/src/icons/FilterIcon.vue +0 -8
  670. package/src/icons/GlobeNatureIcon.vue +0 -14
  671. package/src/icons/HelpIcon.vue +0 -7
  672. package/src/icons/HomePointIcon.vue +0 -8
  673. package/src/icons/HouseIcon.vue +0 -25
  674. package/src/icons/ImportIcon.vue +0 -8
  675. package/src/icons/InfoIcon.vue +0 -10
  676. package/src/icons/LabelIcon.vue +0 -7
  677. package/src/icons/LegendIcon.vue +0 -65
  678. package/src/icons/LineIcon.vue +0 -7
  679. package/src/icons/LinkIcon.vue +0 -7
  680. package/src/icons/MapIcon.vue +0 -8
  681. package/src/icons/MinusIcon.vue +0 -8
  682. package/src/icons/ObjectAttributeIcon.vue +0 -18
  683. package/src/icons/ObjectSelectIcon.vue +0 -8
  684. package/src/icons/ObliqueViewIcon.vue +0 -13
  685. package/src/icons/PdfIcon.vue +0 -10
  686. package/src/icons/PedestrianIcon.vue +0 -8
  687. package/src/icons/PenIcon.vue +0 -14
  688. package/src/icons/PlayCircleIcon.vue +0 -10
  689. package/src/icons/PlusIcon.vue +0 -9
  690. package/src/icons/PoiIcon.vue +0 -7
  691. package/src/icons/PointSelectIcon.vue +0 -7
  692. package/src/icons/PresentationModeIcon.vue +0 -7
  693. package/src/icons/QueryIcon.vue +0 -15
  694. package/src/icons/RectangleIcon.vue +0 -9
  695. package/src/icons/ReturnIcon.vue +0 -7
  696. package/src/icons/RewindIcon.vue +0 -6
  697. package/src/icons/SearchIcon.vue +0 -8
  698. package/src/icons/ShadowIcon.vue +0 -9
  699. package/src/icons/ShareIcon.vue +0 -22
  700. package/src/icons/SimpleCircleFilledIcon.vue +0 -15
  701. package/src/icons/SimpleCircleOutlinedIcon.vue +0 -15
  702. package/src/icons/SkipNextIcon.vue +0 -7
  703. package/src/icons/SkipPreviousIcon.vue +0 -9
  704. package/src/icons/TextStyleIcon.vue +0 -14
  705. package/src/icons/ThreeDimensionsIcon.vue +0 -7
  706. package/src/icons/ToolsIcon.vue +0 -35
  707. package/src/icons/TouchIcon.vue +0 -8
  708. package/src/icons/TrashCanIcon.vue +0 -7
  709. package/src/icons/TriangleIcon.vue +0 -15
  710. package/src/icons/TwoDimensionsIcon.vue +0 -8
  711. package/src/icons/UploadIcon.vue +0 -14
  712. package/src/icons/VideoRecorderIcon.vue +0 -14
  713. package/src/icons/WalkingIcon.vue +0 -7
  714. package/src/icons/WallIcon.vue +0 -14
  715. package/src/lang/de.js +0 -60
  716. package/src/lang/en.js +0 -53
  717. package/src/manager/toolbox/ToolboxGroupComponent.vue +0 -128
  718. package/src/navigation/mapNavigation.vue +0 -205
  719. package/src/navigation/obliqueRotation.vue +0 -48
  720. package/src/navigation/vcsCompass.vue +0 -144
  721. package/src/navigation/vcsZoomButton.vue +0 -27
  722. package/start.js +0 -3
  723. /package/src/{assets/logo-mobile.svg → logo-mobile.svg} +0 -0
  724. /package/src/{assets/logo.svg → logo.svg} +0 -0
@@ -1,4 +0,0 @@
1
- var rd=Object.defineProperty,nd=Object.defineProperties;var ad=Object.getOwnPropertyDescriptors;var Fo=Object.getOwnPropertySymbols;var od=Object.prototype.hasOwnProperty,ld=Object.prototype.propertyIsEnumerable;var Ro=(i,t,e)=>t in i?rd(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,_=(i,t)=>{for(var e in t||(t={}))od.call(t,e)&&Ro(i,e,t[e]);if(Fo)for(var e of Fo(t))ld.call(t,e)&&Ro(i,e,t[e]);return i},O=(i,t)=>nd(i,ad(t));import{ol$geom$Circle as le,ol$geom$GeometryCollection as gs,ol$geom$GeometryLayout as Cn,ol$Feature as Z,ol$proj$getTransform as dt,ol$proj$get as hd,ol$proj$equivalent as cd,ol$proj$proj4$register as Ao,ol$style$Style as ft,ol$style$Fill as he,ol$style$Stroke as ee,ol$style$Text as wn,ol$has$DEVICE_PIXEL_RATIO as ud,ol$style$RegularShape as xn,ol$style$Circle as ms,ol$style$Icon as ps,ol$style$Image as dd,ol$Map as fd,ol$interaction$defaults as gd,ol$Observable$unByKey as yt,ol$View as bn,ol$easing$inAndOut as md,ol$extent$containsXY as Go,ol$extent$boundingExtent as ys,ol$extent$getBottomLeft as On,ol$geom$Point as xi,ol$geom$LineString as Pn,ol$geom$MultiPoint as ko,ol$geom$MultiLineString as zo,ol$geom$MultiPolygon as ur,ol$sphere$offset as dr,ol$geom$GeometryType as Re,ol$layer$Vector as jo,ol$geom$Polygon$circular as pd,ol$ImageState as fr,ol$geom$Polygon as En,ol$extent$getBottomRight as $o,ol$extent$getTopRight as Ho,ol$extent$getTopLeft as gr,ol$proj$transform as Xe,ol$geom$Polygon$fromCircle as yd,ol$source$Vector as vs,ol$tilegrid$createXYZ as Vo,ol$proj$Projection as vd,ol$tilegrid$TileGrid as Bo,ol$source$TileImage as _d,ol$layer$Tile as bi,ol$extent$containsCoordinate as Sd,ol$extent$buffer as Uo,ol$extent$getCenter as In,ol$proj$transformExtent as qo,ol$sphere$getDistance as Md,ol$format$GeoJSON as Wo,Feature as Cd,ol$extent$getWidth as Ln,ol$source$TileWMS as wd,ol$format$GML2 as Tn,ol$format$WFS as Yo,ol$format$GML3 as Nn,ol$extent$createEmpty as Xo,ol$structs$LRUCache as xd,ol$extent$createOrUpdateFromCoordinate as bd,ol$render$canvas$Immediate as Od,ol$geom$flat$transform$transform2D as Pd,ol$extent$intersects as Ed,ol$geom$SimpleGeometry$transformGeom2D as Id,ol$transform$scale as Ld,ol$transform$create as Td,ol$transform$compose as Nd,ol$extent$extend as Zo,ol$source$OSM as Dd,ol$layer$Image as Fd,ol$source$ImageStatic as Rd,ol$source$TileDebug as Ad,ol$source$XYZ as Gd,ol$source$VectorTile as kd,ol$TileState as zd,ol$layer$VectorTile as jd,ol$tilegrid$WMTS as $d,ol$source$WMTS as Hd,ol$format$MVT as Vd}from"./ol.246fd4.js";import{Cartesian3 as C,Math as P,Material as Oi,Cartesian2 as Ht,Cesium3DTilePointFeature as Ae,Cesium3DTileFeature as Ge,Matrix3 as Vt,Quaternion as Bd,Color as Ot,EasingFunction as Ud,Cesium3DTileStyle as Dn,Cesium3DTileColorBlendMode as mr,VerticalOrigin as Bt,Entity as Fn,ConditionsExpression as qd,Expression as Wd,HeightReference as Yt,ClassificationType as Pi,NearFarScalar as _s,SceneTransforms as Yd,MaterialAppearance as Xd,GeometryInstance as pr,ColorGeometryInstanceAttribute as Jo,PerInstanceColorAppearance as Rn,ShadowMode as Ss,ClassificationPrimitive as Ko,GroundPrimitive as Qo,Primitive as An,PolylineMaterialAppearance as Zd,GroundPolylinePrimitive as tl,PolygonGeometry as Jd,PolygonOutlineGeometry as Kd,GroundPolylineGeometry as Gn,PolylineGeometry as kn,PolygonHierarchy as el,CircleGeometry as Qd,CircleOutlineGeometry as tf,Cartographic as et,WallGeometry as ef,WallOutlineGeometry as sf,HeadingPitchRoll as rf,Matrix4 as A,Transforms as il,Model as nf,sampleTerrainMostDetailed as yr,ModelAnimationLoop as af,LabelStyle as zn,HorizontalOrigin as jn,PrimitiveCollection as $n,BillboardCollection as of,LabelCollection as lf,CesiumTerrainProvider as sl,Cartesian4 as rl,sampleTerrain as hf,Ellipsoid as Hn,ExperimentalFeatures as cf,Clock as uf,DataSourceClock as df,JulianDate as nl,KeyboardEventModifier as Vn,ScreenSpaceEventType as Ze,CesiumWidget as ff,DataSourceDisplay as al,DataSourceCollection as ol,RequestScheduler as gf,ScreenSpaceEventHandler as mf,Ray as pf,Camera as yf,ImageryLayer as Je,CustomDataSource as ll,Cesium3DTileset as Ms,BoundingSphere as hl,Intersect as vf,CesiumInspector as _f,Cesium3DTilesInspector as Sf,BillboardVisualizer as Mf,LabelVisualizer as Cf,PointVisualizer as wf,Rectangle as Ut,Composite3DTileContent as xf,HeadingPitchRange as bf,BoundingSphereState as cl,OpenStreetMapImageryProvider as Of,SingleTileImageryProvider as Pf,WebMercatorTilingScheme as Bn,GeographicTilingScheme as ul,SplitDirection as X,TileMapServiceImageryProvider as Ef,Event as If,WebMapServiceImageryProvider as Lf,WebMapTileServiceImageryProvider as Tf,EntityCollection as Nf,CzmlDataSource as Df,Plane as Ke,ClippingPlaneCollection as Qe,ClippingPlane as ti,ConstantProperty as Ff,Globe as Rf}from"./cesium.4e40f4.js";const Cs=[[String,"string"],[Number,"number"],[Boolean,"boolean"],[Function,"function"],[void 0,"undefined"],[Symbol,"symbol"]];function vr(i){const t={};if(!i||t.toString(i)!=="[object Object]")return!1;const e=Object.getPrototypeOf(i);if(!e)return!0;const s=t.hasOwnProperty,r=s.call(e,"constructor")&&e.constructor;return typeof r=="function"&&s.toString.call(r)===s.toString.call(Object)}function ie(i,t){if(i===null)return"null";if(typeof i=="undefined")return"undefined";if(t)return typeof i;let e;if(Array.isArray(i))e=`[${i.map(r=>ie(r,t)).join(",")}]`;else try{e=JSON.stringify(i)}catch{e=typeof i}return e=e||typeof i,e.length>20?`${e.substr(0,20)}...`:e}function Af(i,t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"?i===t?!1:`Expected ${ie(i)} to equal ${t.toString()}`:null}function Gf(i,t,e){if(Array.isArray(t)){if(t.length!==1)throw new Error("Array patterns may only have on type");if(Array.isArray(i)){let s=!1;return i.findIndex(n=>{try{v(n,t[0],e)}catch(a){s=a.message.replace(/Match failed:\s/,"")}return s})>-1?`${s} in ${ie(i)}`:!1}return`Expected ${ie(i)} to be an Array`}return null}function Un(i,t,e){const s=e?`${e}.`:"";if(!vr(i))return`Expected ${ie(i)} to be a plain Object`;let n=!1;const a=Object.keys(t).find(o=>{const l=i[o];if(vr(t[o]))n=Un(l,t[o],s+o);else try{v(l,t[o])}catch(h){n=h.message.replace(/Match failed:\s/,"")}return n});return a?`${n} in object.${s}${a}`:!1}function kf(i,t){if(t===Number)return Number.isFinite(i)?!1:`expected ${ie(i)} to be a number, excluding NaN`;for(let e=Cs.length;e--;)if(t===Cs[e][0])return typeof i===Cs[e][1]?!1:`expected ${ie(i)} to be a ${Cs[e][1]}`;return null}function qn(i){if(i===null)return"null";const t=Cs.find(r=>r[0]===i);if(t)return t[1];let e=i.toString();if(i.className)return i.className;const s=e.match(/function (.*)\(/);if(s&&s.length>1)return s[1];if(vr(i)){const r={};Object.keys(i).forEach(n=>{r[n]=qn(i[n])});try{e=`Object of ${JSON.stringify(r)}`}catch{e="Object"}}return e}function dl(i,t,e){const s=e?`${e}.`:"";let r=!1;return Object.keys(i).find(a=>{if(vr(t[a])){const o=i[a];r=dl(o,t[a],s+a)}else t[a]||(r=`Found additional key ${s}${a}`);return r=r?r.replace(/\sin.*/,""):!1,r})?`${r} in ${ie(i)}`:!1}function fl(i,t,e){const s=function(a,o){if(o==null)return a===o?!1:`Expected ${ie(a)} to be ${o}`;const l=kf(a,o);if(l!==null)return l;const h=Af(a,o);if(h!==null)return h;if(Array.isArray(o))return Gf(a,o,e);if(o instanceof Function)return a instanceof o?!1:`Expected ${ie(a,!0)} to be of Type ${qn(o)}`;if(o===Object)return Un(a,{});if(typeof o!="object")throw new Error(`Cannot handler pattern ${o}`);const c=Un(a,o);return c||(e?dl(a,o):!1)};let r;return Array.isArray(t)&&t.length>1?t.every(a=>s(i,a))&&(r=`Expected ${ie(i)} to be a ${t.map(a=>qn(a)).join(" or ")}`):r=s(i,t),r}function Wn(i,t,e){return!fl(i,t,e)}function v(i,t,e){const s=fl(i,t,e);if(s)throw new Error(`Match failed: ${s}`);return!1}function it(i,t,e){const s=[null,void 0];return Array.isArray(t)&&t.length>1?t.forEach(r=>{s.push(r)}):s.push(t),v(i,s.reverse(),e)}function zf(i,t,e){const r=P.toRadians(e),n=P.toRadians(i[1]),a=P.toRadians(i[0]),o=Math.asin(Math.sin(n)*Math.cos(t/6371e3)+Math.cos(n)*Math.sin(t/6371e3)*Math.cos(r)),l=a+Math.atan2(Math.sin(r)*Math.sin(t/6371e3)*Math.cos(n),Math.cos(t/6371e3)-Math.sin(n)*Math.sin(o));return[parseFloat(P.toDegrees(l).toFixed(5)),parseFloat(P.toDegrees(o).toFixed(5))]}function jf(i,t){const e=P.toRadians(i[0]),s=P.toRadians(i[1]),r=P.toRadians(t[0]),n=P.toRadians(t[1]),a=Math.sin(r-e)*Math.cos(n),o=Math.cos(s)*Math.sin(n)-Math.sin(s)*Math.cos(n)*Math.cos(r-e);let l=P.toDegrees(Math.atan2(a,o));return l=(l+360)%360,l}function ke(i,t){const e=i[0]-t[0],s=i[1]-t[1];return Math.sqrt(e**2+s**2)}function gl(i,t){const e=C.fromElements(i[0],i[1],i[2]),s=C.fromElements(t[0],t[1],t[2]);return C.distance(e,s)}le.prototype.getCoordinates=function(){return[this.getCenter(),this.getLastCoordinate()]},le.prototype.setCoordinates=function(t,e){v(t,[[Number]]),v(t.length,2);const s=e||this.getLayout(),r=/XYM?/.test(s)?ke:gl;this.setCenterAndRadius(t[0],r(t[0],t[1]),e)},gs.prototype.getCoordinates=function(){return this.getGeometries().map(t=>t.getCoordinates())},gs.prototype.setCoordinates=function(t,e){v(t,Array),v(t.length,this.getGeometries().length),this.setGeometries(this.getGeometries().map((s,r)=>(s.setCoordinates(t[r],e),s)))},gs.prototype.getLayout=function(){const t=this.getGeometries()[0];return t?t.getLayout():Cn.XYZ},Z.prototype.getProperty=function(t){if(t==="attributes"){const e=this.getProperties();return this.getGeometryName()&&delete e[this.getGeometryName()],e}else if(t==="olcs_geometryType"){const e=this.getGeometry().getType();return e==="Polygon"?1:e==="LineString"?2:e==="Point"?3:e==="Circle"||e==="MultiPolygon"?1:e==="MultiLineString"?2:e==="MultiPoint"?3:void 0}return this.get(t)},Z.prototype.getPropertyInherited=function(t){return this.getProperty(t)},Oi._materialCache.addMaterial("Wallpaper",{fabric:{type:"Wallpaper",uniforms:{image:Oi.DefaultImageId,anchor:new Ht(0,0)},components:{diffuse:"texture2D(image, fract((gl_FragCoord.xy - anchor.xy) / vec2(imageDimensions.xy))).rgb",alpha:"texture2D(image, fract((gl_FragCoord.xy - anchor.xy) / vec2(imageDimensions.xy))).a"}},translucent:!1}),Ae.prototype.getId=function(){return this.getProperty("id")||`${this.content.url}${this._batchId}`},Ge.prototype.getId=function(){return this.getProperty("id")||`${this.content.url}${this._batchId}`},new C,new Vt,new Bd,new Ot;var _r,$f=new Uint8Array(16);function Hf(){if(!_r&&(_r=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!_r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _r($f)}var Vf=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function ml(i){return typeof i=="string"&&Vf.test(i)}for(var vt=[],Yn=0;Yn<256;++Yn)vt.push((Yn+256).toString(16).substr(1));function pl(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=(vt[i[t+0]]+vt[i[t+1]]+vt[i[t+2]]+vt[i[t+3]]+"-"+vt[i[t+4]]+vt[i[t+5]]+"-"+vt[i[t+6]]+vt[i[t+7]]+"-"+vt[i[t+8]]+vt[i[t+9]]+"-"+vt[i[t+10]]+vt[i[t+11]]+vt[i[t+12]]+vt[i[t+13]]+vt[i[t+14]]+vt[i[t+15]]).toLowerCase();if(!ml(e))throw TypeError("Stringified UUID is invalid");return e}function Bf(i){if(!ml(i))throw TypeError("Invalid UUID");var t,e=new Uint8Array(16);return e[0]=(t=parseInt(i.slice(0,8),16))>>>24,e[1]=t>>>16&255,e[2]=t>>>8&255,e[3]=t&255,e[4]=(t=parseInt(i.slice(9,13),16))>>>8,e[5]=t&255,e[6]=(t=parseInt(i.slice(14,18),16))>>>8,e[7]=t&255,e[8]=(t=parseInt(i.slice(19,23),16))>>>8,e[9]=t&255,e[10]=(t=parseInt(i.slice(24,36),16))/1099511627776&255,e[11]=t/4294967296&255,e[12]=t>>>24&255,e[13]=t>>>16&255,e[14]=t>>>8&255,e[15]=t&255,e}function Uf(i){i=unescape(encodeURIComponent(i));for(var t=[],e=0;e<i.length;++e)t.push(i.charCodeAt(e));return t}var qf="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Wf="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Yf(i,t,e){function s(r,n,a,o){if(typeof r=="string"&&(r=Uf(r)),typeof n=="string"&&(n=Bf(n)),n.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var l=new Uint8Array(16+r.length);if(l.set(n),l.set(r,n.length),l=e(l),l[6]=l[6]&15|t,l[8]=l[8]&63|128,a){o=o||0;for(var h=0;h<16;++h)a[o+h]=l[h];return a}return pl(l)}try{s.name=i}catch{}return s.DNS=qf,s.URL=Wf,s}function Xt(i,t,e){i=i||{};var s=i.random||(i.rng||Hf)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,t){e=e||0;for(var r=0;r<16;++r)t[e+r]=s[r];return t}return pl(s)}function Xf(i,t,e,s){switch(i){case 0:return t&e^~t&s;case 1:return t^e^s;case 2:return t&e^t&s^e&s;case 3:return t^e^s}}function Xn(i,t){return i<<t|i>>>32-t}function Zf(i){var t=[1518500249,1859775393,2400959708,3395469782],e=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof i=="string"){var s=unescape(encodeURIComponent(i));i=[];for(var r=0;r<s.length;++r)i.push(s.charCodeAt(r))}else Array.isArray(i)||(i=Array.prototype.slice.call(i));i.push(128);for(var n=i.length/4+2,a=Math.ceil(n/16),o=new Array(a),l=0;l<a;++l){for(var h=new Uint32Array(16),c=0;c<16;++c)h[c]=i[l*64+c*4]<<24|i[l*64+c*4+1]<<16|i[l*64+c*4+2]<<8|i[l*64+c*4+3];o[l]=h}o[a-1][14]=(i.length-1)*8/Math.pow(2,32),o[a-1][14]=Math.floor(o[a-1][14]),o[a-1][15]=(i.length-1)*8&4294967295;for(var u=0;u<a;++u){for(var d=new Uint32Array(80),f=0;f<16;++f)d[f]=o[u][f];for(var g=16;g<80;++g)d[g]=Xn(d[g-3]^d[g-8]^d[g-14]^d[g-16],1);for(var m=e[0],p=e[1],y=e[2],M=e[3],x=e[4],L=0;L<80;++L){var I=Math.floor(L/20),D=Xn(m,5)+Xf(I,p,y,M)+x+t[I]+d[L]>>>0;x=M,M=y,y=Xn(p,30)>>>0,p=m,m=D}e[0]=e[0]+m>>>0,e[1]=e[1]+p>>>0,e[2]=e[2]+y>>>0,e[3]=e[3]+M>>>0,e[4]=e[4]+x>>>0}return[e[0]>>24&255,e[0]>>16&255,e[0]>>8&255,e[0]&255,e[1]>>24&255,e[1]>>16&255,e[1]>>8&255,e[1]&255,e[2]>>24&255,e[2]>>16&255,e[2]>>8&255,e[2]&255,e[3]>>24&255,e[3]>>16&255,e[3]>>8&255,e[3]&255,e[4]>>24&255,e[4]>>16&255,e[4]>>8&255,e[4]&255]}var Jf=Yf("v5",80,Zf),Kf=Jf;const st={OFF:1,ERROR:2,WARN:4,INFO:8,DEBUG:16},Ce={ERROR:0,WARN:0,INFO:0,DEBUG:0};Ce.ERROR=st.ERROR|st.WARN|st.INFO|st.DEBUG,Ce.WARN=st.WARN|st.INFO|st.DEBUG,Ce.INFO=st.INFO|st.DEBUG,Ce.DEBUG=st.DEBUG;const ws={useTimestamp:!1,logLevel:st.INFO},xs=new Map;xs.set(st.ERROR,"error"),xs.set(st.WARN,"warn"),xs.set(st.INFO,"info"),xs.set(st.DEBUG,"log");class yl{constructor(t){this.className=t,this.deprecations=new Map}error(t,...e){ws.logLevel&Ce.ERROR&&this._log(String(t),st.ERROR,e)}warning(t,...e){ws.logLevel&Ce.WARN&&this._log(String(t),st.WARN,e)}deprecate(t,e){const s=String(t),r=e?String(e):null;if(!this.deprecations.has(s)){this.deprecations.set(s,r||null);let n=`${s} has been deprecated and will be removed`;r&&(n=`${n}. ${r}`),this.warning(n)}}info(t,...e){ws.logLevel&Ce.INFO&&this._log(String(t),st.INFO,e)}debug(t,...e){ws.logLevel&Ce.DEBUG&&this._log(String(t),st.DEBUG,e)}log(t,...e){ws.logLevel&Ce.DEBUG&&this._log(String(t),st.DEBUG,e)}_log(t,e,s){let r=t;this.className&&(r=`[${this.className}] ${r}`),console[xs.get(e)](r,...s),e&st.ERROR&&(console.group(),console.trace(),console.groupEnd())}}const Zn=new Map;let Jn;function Qf(){return Jn||(Jn=new yl),Jn}function tg(i){const t=new yl(i);return Zn.set(i,t),t}function Pt(i){return i?Zn.has(i)?Zn.get(i):tg(i):Qf()}function V(i,t){if(i!=null){const e=Number.parseInt(String(i),10);if(e!=null&&!Number.isNaN(e))return e}return t}function E(i,t){if(i!=null){const e=Number.parseFloat(String(i));if(e!=null&&!Number.isNaN(e))return e}return t}function Sr(i,t,e,s){const r=E(i,t);return r<e?e:r>s?s:r}function rt(i,t){return i==null?t:typeof i=="boolean"?i:i===1?!0:i===0?!1:typeof i=="string"&&(i.toLowerCase()==="true"||i.toLowerCase()==="1")?!0:typeof i=="string"&&(i.toLowerCase()==="false"||i.toLowerCase()==="0")?!1:t}function Kn(i,t,e){if(i!=null){const s=Object.values(t).find(r=>r==i);if(s!=null)return s}return e}function ze(i,t,e){if(i!=null){const s=Object.keys(t).find(r=>r==i);if(s!=null)return t[s]}return e}function eg(i){i("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),i("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),i("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"),i.WGS84=i["EPSG:4326"],i["EPSG:3785"]=i["EPSG:3857"],i.GOOGLE=i["EPSG:3857"],i["EPSG:900913"]=i["EPSG:3857"],i["EPSG:102113"]=i["EPSG:3857"]}var ei=1,ii=2,Mr=3,ig=4,Qn=5,vl=6378137,sg=6356752314e-3,_l=.0066943799901413165,bs=484813681109536e-20,S=Math.PI/2,rg=.16666666666666666,ng=.04722222222222222,ag=.022156084656084655,w=1e-10,_t=.017453292519943295,ce=57.29577951308232,j=Math.PI/4,Os=Math.PI*2,nt=3.14159265359,Dt={};Dt.greenwich=0,Dt.lisbon=-9.131906111111,Dt.paris=2.337229166667,Dt.bogota=-74.080916666667,Dt.madrid=-3.687938888889,Dt.rome=12.452333333333,Dt.bern=7.439583333333,Dt.jakarta=106.807719444444,Dt.ferro=-17.666666666667,Dt.brussels=4.367975,Dt.stockholm=18.058277777778,Dt.athens=23.7163375,Dt.oslo=10.722916666667;var og={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},Sl=/[\s_\-\/\(\)]/g;function je(i,t){if(i[t])return i[t];for(var e=Object.keys(i),s=t.toLowerCase().replace(Sl,""),r=-1,n,a;++r<e.length;)if(n=e[r],a=n.toLowerCase().replace(Sl,""),a===s)return i[n]}function ta(i){var t={},e=i.split("+").map(function(o){return o.trim()}).filter(function(o){return o}).reduce(function(o,l){var h=l.split("=");return h.push(!0),o[h[0].toLowerCase()]=h[1],o},{}),s,r,n,a={proj:"projName",datum:"datumCode",rf:function(o){t.rf=parseFloat(o)},lat_0:function(o){t.lat0=o*_t},lat_1:function(o){t.lat1=o*_t},lat_2:function(o){t.lat2=o*_t},lat_ts:function(o){t.lat_ts=o*_t},lon_0:function(o){t.long0=o*_t},lon_1:function(o){t.long1=o*_t},lon_2:function(o){t.long2=o*_t},alpha:function(o){t.alpha=parseFloat(o)*_t},gamma:function(o){t.rectified_grid_angle=parseFloat(o)},lonc:function(o){t.longc=o*_t},x_0:function(o){t.x0=parseFloat(o)},y_0:function(o){t.y0=parseFloat(o)},k_0:function(o){t.k0=parseFloat(o)},k:function(o){t.k0=parseFloat(o)},a:function(o){t.a=parseFloat(o)},b:function(o){t.b=parseFloat(o)},r_a:function(){t.R_A=!0},zone:function(o){t.zone=parseInt(o,10)},south:function(){t.utmSouth=!0},towgs84:function(o){t.datum_params=o.split(",").map(function(l){return parseFloat(l)})},to_meter:function(o){t.to_meter=parseFloat(o)},units:function(o){t.units=o;var l=je(og,o);l&&(t.to_meter=l.to_meter)},from_greenwich:function(o){t.from_greenwich=o*_t},pm:function(o){var l=je(Dt,o);t.from_greenwich=(l||parseFloat(o))*_t},nadgrids:function(o){o==="@null"?t.datumCode="none":t.nadgrids=o},axis:function(o){var l="ewnsud";o.length===3&&l.indexOf(o.substr(0,1))!==-1&&l.indexOf(o.substr(1,1))!==-1&&l.indexOf(o.substr(2,1))!==-1&&(t.axis=o)},approx:function(){t.approx=!0}};for(s in e)r=e[s],s in a?(n=a[s],typeof n=="function"?n(r):t[n]=r):t[s]=r;return typeof t.datumCode=="string"&&t.datumCode!=="WGS84"&&(t.datumCode=t.datumCode.toLowerCase()),t}var Ps=1,Ml=2,Cl=3,Cr=4,wl=5,ea=-1,lg=/\s/,hg=/[A-Za-z]/,cg=/[A-Za-z84]/,wr=/[,\]]/,xl=/[\d\.E\-\+]/;function we(i){if(typeof i!="string")throw new Error("not a string");this.text=i.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Ps}we.prototype.readCharicter=function(){var i=this.text[this.place++];if(this.state!==Cr)for(;lg.test(i);){if(this.place>=this.text.length)return;i=this.text[this.place++]}switch(this.state){case Ps:return this.neutral(i);case Ml:return this.keyword(i);case Cr:return this.quoted(i);case wl:return this.afterquote(i);case Cl:return this.number(i);case ea:return}},we.prototype.afterquote=function(i){if(i==='"'){this.word+='"',this.state=Cr;return}if(wr.test(i)){this.word=this.word.trim(),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in afterquote yet, index '+this.place)},we.prototype.afterItem=function(i){if(i===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Ps;return}if(i==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Ps,this.currentObject=this.stack.pop(),this.currentObject||(this.state=ea);return}},we.prototype.number=function(i){if(xl.test(i)){this.word+=i;return}if(wr.test(i)){this.word=parseFloat(this.word),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in number yet, index '+this.place)},we.prototype.quoted=function(i){if(i==='"'){this.state=wl;return}this.word+=i},we.prototype.keyword=function(i){if(cg.test(i)){this.word+=i;return}if(i==="["){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=Ps;return}if(wr.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in keyword yet, index '+this.place)},we.prototype.neutral=function(i){if(hg.test(i)){this.word=i,this.state=Ml;return}if(i==='"'){this.word="",this.state=Cr;return}if(xl.test(i)){this.word=i,this.state=Cl;return}if(wr.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in neutral yet, index '+this.place)},we.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===ea)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function ug(i){var t=new we(i);return t.output()}function bl(i,t,e){Array.isArray(t)&&(e.unshift(t),t=null);var s=t?{}:i,r=e.reduce(function(n,a){return Ei(a,n),n},s);t&&(i[t]=r)}function Ei(i,t){if(!Array.isArray(i)){t[i]=!0;return}var e=i.shift();if(e==="PARAMETER"&&(e=i.shift()),i.length===1){if(Array.isArray(i[0])){t[e]={},Ei(i[0],t[e]);return}t[e]=i[0];return}if(!i.length){t[e]=!0;return}if(e==="TOWGS84"){t[e]=i;return}if(e==="AXIS"){e in t||(t[e]=[]),t[e].push(i);return}Array.isArray(e)||(t[e]={});var s;switch(e){case"UNIT":case"PRIMEM":case"VERT_DATUM":t[e]={name:i[0].toLowerCase(),convert:i[1]},i.length===3&&Ei(i[2],t[e]);return;case"SPHEROID":case"ELLIPSOID":t[e]={name:i[0],a:i[1],rf:i[2]},i.length===4&&Ei(i[3],t[e]);return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":i[0]=["name",i[0]],bl(t,e,i);return;default:for(s=-1;++s<i.length;)if(!Array.isArray(i[s]))return Ei(i,t[e]);return bl(t,e,i)}}var dg=.017453292519943295;function fg(i,t){var e=t[0],s=t[1];!(e in i)&&s in i&&(i[e]=i[s],t.length===3&&(i[e]=t[2](i[e])))}function xe(i){return i*dg}function gg(i){if(i.type==="GEOGCS"?i.projName="longlat":i.type==="LOCAL_CS"?(i.projName="identity",i.local=!0):typeof i.PROJECTION=="object"?i.projName=Object.keys(i.PROJECTION)[0]:i.projName=i.PROJECTION,i.AXIS){for(var t="",e=0,s=i.AXIS.length;e<s;++e){var r=[i.AXIS[e][0].toLowerCase(),i.AXIS[e][1].toLowerCase()];r[0].indexOf("north")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="north"?t+="n":r[0].indexOf("south")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="south"?t+="s":r[0].indexOf("east")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="east"?t+="e":(r[0].indexOf("west")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="west")&&(t+="w")}t.length===2&&(t+="u"),t.length===3&&(i.axis=t)}i.UNIT&&(i.units=i.UNIT.name.toLowerCase(),i.units==="metre"&&(i.units="meter"),i.UNIT.convert&&(i.type==="GEOGCS"?i.DATUM&&i.DATUM.SPHEROID&&(i.to_meter=i.UNIT.convert*i.DATUM.SPHEROID.a):i.to_meter=i.UNIT.convert));var n=i.GEOGCS;i.type==="GEOGCS"&&(n=i),n&&(n.DATUM?i.datumCode=n.DATUM.name.toLowerCase():i.datumCode=n.name.toLowerCase(),i.datumCode.slice(0,2)==="d_"&&(i.datumCode=i.datumCode.slice(2)),(i.datumCode==="new_zealand_geodetic_datum_1949"||i.datumCode==="new_zealand_1949")&&(i.datumCode="nzgd49"),(i.datumCode==="wgs_1984"||i.datumCode==="world_geodetic_system_1984")&&(i.PROJECTION==="Mercator_Auxiliary_Sphere"&&(i.sphere=!0),i.datumCode="wgs84"),i.datumCode.slice(-6)==="_ferro"&&(i.datumCode=i.datumCode.slice(0,-6)),i.datumCode.slice(-8)==="_jakarta"&&(i.datumCode=i.datumCode.slice(0,-8)),~i.datumCode.indexOf("belge")&&(i.datumCode="rnb72"),n.DATUM&&n.DATUM.SPHEROID&&(i.ellps=n.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),i.ellps.toLowerCase().slice(0,13)==="international"&&(i.ellps="intl"),i.a=n.DATUM.SPHEROID.a,i.rf=parseFloat(n.DATUM.SPHEROID.rf,10)),n.DATUM&&n.DATUM.TOWGS84&&(i.datum_params=n.DATUM.TOWGS84),~i.datumCode.indexOf("osgb_1936")&&(i.datumCode="osgb36"),~i.datumCode.indexOf("osni_1952")&&(i.datumCode="osni52"),(~i.datumCode.indexOf("tm65")||~i.datumCode.indexOf("geodetic_datum_of_1965"))&&(i.datumCode="ire65"),i.datumCode==="ch1903+"&&(i.datumCode="ch1903"),~i.datumCode.indexOf("israel")&&(i.datumCode="isr93")),i.b&&!isFinite(i.b)&&(i.b=i.a);function a(h){var c=i.to_meter||1;return h*c}var o=function(h){return fg(i,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",xe],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",xe],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",xe],["lat0","latitude_of_origin",xe],["lat0","standard_parallel_1",xe],["lat1","standard_parallel_1",xe],["lat2","standard_parallel_2",xe],["azimuth","Azimuth"],["alpha","azimuth",xe],["srsCode","name"]];l.forEach(o),!i.long0&&i.longc&&(i.projName==="Albers_Conic_Equal_Area"||i.projName==="Lambert_Azimuthal_Equal_Area")&&(i.long0=i.longc),!i.lat_ts&&i.lat1&&(i.projName==="Stereographic_South_Pole"||i.projName==="Polar Stereographic (variant B)")&&(i.lat0=xe(i.lat1>0?90:-90),i.lat_ts=i.lat1)}function Ol(i){var t=ug(i),e=t.shift(),s=t.shift();t.unshift(["name",s]),t.unshift(["type",e]);var r={};return Ei(t,r),gg(r),r}function Et(i){var t=this;if(arguments.length===2){var e=arguments[1];typeof e=="string"?e.charAt(0)==="+"?Et[i]=ta(arguments[1]):Et[i]=Ol(arguments[1]):Et[i]=e}else if(arguments.length===1){if(Array.isArray(i))return i.map(function(s){Array.isArray(s)?Et.apply(t,s):Et(s)});if(typeof i=="string"){if(i in Et)return Et[i]}else"EPSG"in i?Et["EPSG:"+i.EPSG]=i:"ESRI"in i?Et["ESRI:"+i.ESRI]=i:"IAU2000"in i?Et["IAU2000:"+i.IAU2000]=i:console.log(i);return}}eg(Et);function mg(i){return typeof i=="string"}function pg(i){return i in Et}var yg=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function vg(i){return yg.some(function(t){return i.indexOf(t)>-1})}var _g=["3857","900913","3785","102113"];function Sg(i){var t=je(i,"authority");if(!!t){var e=je(t,"epsg");return e&&_g.indexOf(e)>-1}}function Mg(i){var t=je(i,"extension");if(!!t)return je(t,"proj4")}function Cg(i){return i[0]==="+"}function wg(i){if(mg(i)){if(pg(i))return Et[i];if(vg(i)){var t=Ol(i);if(Sg(t))return Et["EPSG:3857"];var e=Mg(t);return e?ta(e):t}if(Cg(i))return ta(i)}else return i}function Pl(i,t){i=i||{};var e,s;if(!t)return i;for(s in t)e=t[s],e!==void 0&&(i[s]=e);return i}function ue(i,t,e){var s=i*t;return e/Math.sqrt(1-s*s)}function Es(i){return i<0?-1:1}function b(i){return Math.abs(i)<=nt?i:i-Es(i)*Os}function se(i,t,e){var s=i*e,r=.5*i;return s=Math.pow((1-s)/(1+s),r),Math.tan(.5*(S-t))/s}function Is(i,t){for(var e=.5*i,s,r,n=S-2*Math.atan(t),a=0;a<=15;a++)if(s=i*Math.sin(n),r=S-2*Math.atan(t*Math.pow((1-s)/(1+s),e))-n,n+=r,Math.abs(r)<=1e-10)return n;return-9999}function xg(){var i=this.b/this.a;this.es=1-i*i,"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=ue(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function bg(i){var t=i.x,e=i.y;if(e*ce>90&&e*ce<-90&&t*ce>180&&t*ce<-180)return null;var s,r;if(Math.abs(Math.abs(e)-S)<=w)return null;if(this.sphere)s=this.x0+this.a*this.k0*b(t-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(j+.5*e));else{var n=Math.sin(e),a=se(this.e,e,n);s=this.x0+this.a*this.k0*b(t-this.long0),r=this.y0-this.a*this.k0*Math.log(a)}return i.x=s,i.y=r,i}function Og(i){var t=i.x-this.x0,e=i.y-this.y0,s,r;if(this.sphere)r=S-2*Math.atan(Math.exp(-e/(this.a*this.k0)));else{var n=Math.exp(-e/(this.a*this.k0));if(r=Is(this.e,n),r===-9999)return null}return s=b(this.long0+t/(this.a*this.k0)),i.x=s,i.y=r,i}var Pg=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],Eg={init:xg,forward:bg,inverse:Og,names:Pg};function Ig(){}function El(i){return i}var Lg=["longlat","identity"],Tg={init:Ig,forward:El,inverse:El,names:Lg},Ng=[Eg,Tg],xr={},br=[];function Il(i,t){var e=br.length;return i.names?(br[e]=i,i.names.forEach(function(s){xr[s.toLowerCase()]=e}),this):(console.log(t),!0)}function Dg(i){if(!i)return!1;var t=i.toLowerCase();if(typeof xr[t]!="undefined"&&br[xr[t]])return br[xr[t]]}function Fg(){Ng.forEach(Il)}var Rg={start:Fg,add:Il,get:Dg},N={};N.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},N.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},N.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},N.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},N.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},N.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},N.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},N.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},N.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},N.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},N.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},N.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},N.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},N.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},N.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},N.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},N.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},N.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},N.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},N.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},N.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},N.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},N.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},N.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},N.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},N.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},N.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},N.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},N.hough={a:6378270,rf:297,ellipseName:"Hough"},N.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},N.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},N.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},N.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},N.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},N.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},N.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},N.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},N.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},N.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},N.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},N.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var Ag=N.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};N.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function Gg(i,t,e,s){var r=i*i,n=t*t,a=(r-n)/r,o=0;s?(i*=1-a*(rg+a*(ng+a*ag)),r=i*i,a=0):o=Math.sqrt(a);var l=(r-n)/n;return{es:a,e:o,ep2:l}}function kg(i,t,e,s,r){if(!i){var n=je(N,s);n||(n=Ag),i=n.a,t=n.b,e=n.rf}return e&&!t&&(t=(1-1/e)*i),(e===0||Math.abs(i-t)<w)&&(r=!0,t=i),{a:i,b:t,rf:e,sphere:r}}var gt={};gt.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},gt.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},gt.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},gt.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},gt.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},gt.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},gt.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},gt.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},gt.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},gt.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},gt.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},gt.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},gt.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},gt.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},gt.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gt.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},gt.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function zg(i,t,e,s,r,n,a){var o={};return i===void 0||i==="none"?o.datum_type=Qn:o.datum_type=ig,t&&(o.datum_params=t.map(parseFloat),(o.datum_params[0]!==0||o.datum_params[1]!==0||o.datum_params[2]!==0)&&(o.datum_type=ei),o.datum_params.length>3&&(o.datum_params[3]!==0||o.datum_params[4]!==0||o.datum_params[5]!==0||o.datum_params[6]!==0)&&(o.datum_type=ii,o.datum_params[3]*=bs,o.datum_params[4]*=bs,o.datum_params[5]*=bs,o.datum_params[6]=o.datum_params[6]/1e6+1)),a&&(o.datum_type=Mr,o.grids=a),o.a=e,o.b=s,o.es=r,o.ep2=n,o}var Ll={};function jg(i,t){var e=new DataView(t),s=Vg(e),r=Bg(e,s);r.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var n=Ug(e,r,s),a={header:r,subgrids:n};return Ll[i]=a,a}function $g(i){if(i===void 0)return null;var t=i.split(",");return t.map(Hg)}function Hg(i){if(i.length===0)return null;var t=i[0]==="@";return t&&(i=i.slice(1)),i==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:i,mandatory:!t,grid:Ll[i]||null,isNull:!1}}function Ii(i){return i/3600*Math.PI/180}function Vg(i){var t=i.getInt32(8,!1);return t===11?!1:(t=i.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function Bg(i,t){return{nFields:i.getInt32(8,t),nSubgridFields:i.getInt32(24,t),nSubgrids:i.getInt32(40,t),shiftType:ia(i,56,56+8).trim(),fromSemiMajorAxis:i.getFloat64(120,t),fromSemiMinorAxis:i.getFloat64(136,t),toSemiMajorAxis:i.getFloat64(152,t),toSemiMinorAxis:i.getFloat64(168,t)}}function ia(i,t,e){return String.fromCharCode.apply(null,new Uint8Array(i.buffer.slice(t,e)))}function Ug(i,t,e){for(var s=176,r=[],n=0;n<t.nSubgrids;n++){var a=Wg(i,s,e),o=Yg(i,s,a,e),l=Math.round(1+(a.upperLongitude-a.lowerLongitude)/a.longitudeInterval),h=Math.round(1+(a.upperLatitude-a.lowerLatitude)/a.latitudeInterval);r.push({ll:[Ii(a.lowerLongitude),Ii(a.lowerLatitude)],del:[Ii(a.longitudeInterval),Ii(a.latitudeInterval)],lim:[l,h],count:a.gridNodeCount,cvs:qg(o)})}return r}function qg(i){return i.map(function(t){return[Ii(t.longitudeShift),Ii(t.latitudeShift)]})}function Wg(i,t,e){return{name:ia(i,t+8,t+16).trim(),parent:ia(i,t+24,t+24+8).trim(),lowerLatitude:i.getFloat64(t+72,e),upperLatitude:i.getFloat64(t+88,e),lowerLongitude:i.getFloat64(t+104,e),upperLongitude:i.getFloat64(t+120,e),latitudeInterval:i.getFloat64(t+136,e),longitudeInterval:i.getFloat64(t+152,e),gridNodeCount:i.getInt32(t+168,e)}}function Yg(i,t,e,s){for(var r=t+176,n=16,a=[],o=0;o<e.gridNodeCount;o++){var l={latitudeShift:i.getFloat32(r+o*n,s),longitudeShift:i.getFloat32(r+o*n+4,s),latitudeAccuracy:i.getFloat32(r+o*n+8,s),longitudeAccuracy:i.getFloat32(r+o*n+12,s)};a.push(l)}return a}function de(i,t){if(!(this instanceof de))return new de(i);t=t||function(h){if(h)throw h};var e=wg(i);if(typeof e!="object"){t(i);return}var s=de.projections.get(e.projName);if(!s){t(i);return}if(e.datumCode&&e.datumCode!=="none"){var r=je(gt,e.datumCode);r&&(e.datum_params=e.datum_params||(r.towgs84?r.towgs84.split(","):null),e.ellps=r.ellipse,e.datumName=r.datumName?r.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 n=kg(e.a,e.b,e.rf,e.ellps,e.sphere),a=Gg(n.a,n.b,n.rf,e.R_A),o=$g(e.nadgrids),l=e.datum||zg(e.datumCode,e.datum_params,n.a,n.b,a.es,a.ep2,o);Pl(this,e),Pl(this,s),this.a=n.a,this.b=n.b,this.rf=n.rf,this.sphere=n.sphere,this.es=a.es,this.e=a.e,this.ep2=a.ep2,this.datum=l,this.init(),t(null,this)}de.projections=Rg,de.projections.start();function Xg(i,t){return i.datum_type!==t.datum_type||i.a!==t.a||Math.abs(i.es-t.es)>5e-11?!1:i.datum_type===ei?i.datum_params[0]===t.datum_params[0]&&i.datum_params[1]===t.datum_params[1]&&i.datum_params[2]===t.datum_params[2]:i.datum_type===ii?i.datum_params[0]===t.datum_params[0]&&i.datum_params[1]===t.datum_params[1]&&i.datum_params[2]===t.datum_params[2]&&i.datum_params[3]===t.datum_params[3]&&i.datum_params[4]===t.datum_params[4]&&i.datum_params[5]===t.datum_params[5]&&i.datum_params[6]===t.datum_params[6]:!0}function Tl(i,t,e){var s=i.x,r=i.y,n=i.z?i.z:0,a,o,l,h;if(r<-S&&r>-1.001*S)r=-S;else if(r>S&&r<1.001*S)r=S;else{if(r<-S)return{x:-1/0,y:-1/0,z:i.z};if(r>S)return{x:1/0,y:1/0,z:i.z}}return s>Math.PI&&(s-=2*Math.PI),o=Math.sin(r),h=Math.cos(r),l=o*o,a=e/Math.sqrt(1-t*l),{x:(a+n)*h*Math.cos(s),y:(a+n)*h*Math.sin(s),z:(a*(1-t)+n)*o}}function Nl(i,t,e,s){var r=1e-12,n=r*r,a=30,o,l,h,c,u,d,f,g,m,p,y,M,x,L=i.x,I=i.y,D=i.z?i.z:0,Y,H,wt;if(o=Math.sqrt(L*L+I*I),l=Math.sqrt(L*L+I*I+D*D),o/e<r){if(Y=0,l/e<r)return H=S,wt=-s,{x:i.x,y:i.y,z:i.z}}else Y=Math.atan2(I,L);h=D/l,c=o/l,u=1/Math.sqrt(1-t*(2-t)*c*c),g=c*(1-t)*u,m=h*u,x=0;do x++,f=e/Math.sqrt(1-t*m*m),wt=o*g+D*m-f*(1-t*m*m),d=t*f/(f+wt),u=1/Math.sqrt(1-d*(2-d)*c*c),p=c*(1-d)*u,y=h*u,M=y*g-p*m,g=p,m=y;while(M*M>n&&x<a);return H=Math.atan(y/Math.abs(p)),{x:Y,y:H,z:wt}}function Zg(i,t,e){if(t===ei)return{x:i.x+e[0],y:i.y+e[1],z:i.z+e[2]};if(t===ii){var s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],l=e[5],h=e[6];return{x:h*(i.x-l*i.y+o*i.z)+s,y:h*(l*i.x+i.y-a*i.z)+r,z:h*(-o*i.x+a*i.y+i.z)+n}}}function Jg(i,t,e){if(t===ei)return{x:i.x-e[0],y:i.y-e[1],z:i.z-e[2]};if(t===ii){var s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],l=e[5],h=e[6],c=(i.x-s)/h,u=(i.y-r)/h,d=(i.z-n)/h;return{x:c+l*u-o*d,y:-l*c+u+a*d,z:o*c-a*u+d}}}function Or(i){return i===ei||i===ii}function Kg(i,t,e){if(Xg(i,t)||i.datum_type===Qn||t.datum_type===Qn)return e;var s=i.a,r=i.es;if(i.datum_type===Mr){var n=Dl(i,!1,e);if(n!==0)return;s=vl,r=_l}var a=t.a,o=t.b,l=t.es;if(t.datum_type===Mr&&(a=vl,o=sg,l=_l),r===l&&s===a&&!Or(i.datum_type)&&!Or(t.datum_type))return e;if(e=Tl(e,r,s),Or(i.datum_type)&&(e=Zg(e,i.datum_type,i.datum_params)),Or(t.datum_type)&&(e=Jg(e,t.datum_type,t.datum_params)),e=Nl(e,l,a,o),t.datum_type===Mr){var h=Dl(t,!0,e);if(h!==0)return}return e}function Dl(i,t,e){if(i.grids===null||i.grids.length===0)return console.log("Grid shift grids not found"),-1;for(var s={x:-e.x,y:e.y},r={x:Number.NaN,y:Number.NaN},n=[],a=0;a<i.grids.length;a++){var o=i.grids[a];if(n.push(o.name),o.isNull){r=s;break}if(o.grid===null){if(o.mandatory)return console.log("Unable to find mandatory grid '"+o.name+"'"),-1;continue}var l=o.grid.subgrids[0],h=(Math.abs(l.del[1])+Math.abs(l.del[0]))/1e4,c=l.ll[0]-h,u=l.ll[1]-h,d=l.ll[0]+(l.lim[0]-1)*l.del[0]+h,f=l.ll[1]+(l.lim[1]-1)*l.del[1]+h;if(!(u>s.y||c>s.x||f<s.y||d<s.x)&&(r=Qg(s,t,l),!isNaN(r.x)))break}return isNaN(r.x)?(console.log("Failed to find a grid shift table for location '"+-s.x*ce+" "+s.y*ce+" tried: '"+n+"'"),-1):(e.x=-r.x,e.y=r.y,0)}function Qg(i,t,e){var s={x:Number.NaN,y:Number.NaN};if(isNaN(i.x))return s;var r={x:i.x,y:i.y};r.x-=e.ll[0],r.y-=e.ll[1],r.x=b(r.x-Math.PI)+Math.PI;var n=Fl(r,e);if(t){if(isNaN(n.x))return s;n.x=r.x-n.x,n.y=r.y-n.y;var a=9,o=1e-12,l,h;do{if(h=Fl(n,e),isNaN(h.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}l={x:r.x-(h.x+n.x),y:r.y-(h.y+n.y)},n.x+=l.x,n.y+=l.y}while(a--&&Math.abs(l.x)>o&&Math.abs(l.y)>o);if(a<0)return console.log("Inverse grid shift iterator failed to converge."),s;s.x=b(n.x+e.ll[0]),s.y=n.y+e.ll[1]}else isNaN(n.x)||(s.x=i.x+n.x,s.y=i.y+n.y);return s}function Fl(i,t){var e={x:i.x/t.del[0],y:i.y/t.del[1]},s={x:Math.floor(e.x),y:Math.floor(e.y)},r={x:e.x-1*s.x,y:e.y-1*s.y},n={x:Number.NaN,y:Number.NaN},a;if(s.x<0||s.x>=t.lim[0]||s.y<0||s.y>=t.lim[1])return n;a=s.y*t.lim[0]+s.x;var o={x:t.cvs[a][0],y:t.cvs[a][1]};a++;var l={x:t.cvs[a][0],y:t.cvs[a][1]};a+=t.lim[0];var h={x:t.cvs[a][0],y:t.cvs[a][1]};a--;var c={x:t.cvs[a][0],y:t.cvs[a][1]},u=r.x*r.y,d=r.x*(1-r.y),f=(1-r.x)*(1-r.y),g=(1-r.x)*r.y;return n.x=f*o.x+d*l.x+g*c.x+u*h.x,n.y=f*o.y+d*l.y+g*c.y+u*h.y,n}function Rl(i,t,e){var s=e.x,r=e.y,n=e.z||0,a,o,l,h={};for(l=0;l<3;l++)if(!(t&&l===2&&e.z===void 0))switch(l===0?(a=s,"ew".indexOf(i.axis[l])!==-1?o="x":o="y"):l===1?(a=r,"ns".indexOf(i.axis[l])!==-1?o="y":o="x"):(a=n,o="z"),i.axis[l]){case"e":h[o]=a;break;case"w":h[o]=-a;break;case"n":h[o]=a;break;case"s":h[o]=-a;break;case"u":e[o]!==void 0&&(h.z=a);break;case"d":e[o]!==void 0&&(h.z=-a);break;default:return null}return h}function Al(i){var t={x:i[0],y:i[1]};return i.length>2&&(t.z=i[2]),i.length>3&&(t.m=i[3]),t}function tm(i){Gl(i.x),Gl(i.y)}function Gl(i){if(typeof Number.isFinite=="function"){if(Number.isFinite(i))return;throw new TypeError("coordinates must be finite numbers")}if(typeof i!="number"||i!==i||!isFinite(i))throw new TypeError("coordinates must be finite numbers")}function em(i,t){return(i.datum.datum_type===ei||i.datum.datum_type===ii)&&t.datumCode!=="WGS84"||(t.datum.datum_type===ei||t.datum.datum_type===ii)&&i.datumCode!=="WGS84"}function Pr(i,t,e,s){var r;if(Array.isArray(e)&&(e=Al(e)),tm(e),i.datum&&t.datum&&em(i,t)&&(r=new de("WGS84"),e=Pr(i,r,e,s),i=r),s&&i.axis!=="enu"&&(e=Rl(i,!1,e)),i.projName==="longlat")e={x:e.x*_t,y:e.y*_t,z:e.z||0};else if(i.to_meter&&(e={x:e.x*i.to_meter,y:e.y*i.to_meter,z:e.z||0}),e=i.inverse(e),!e)return;if(i.from_greenwich&&(e.x+=i.from_greenwich),e=Kg(i.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*ce,y:e.y*ce,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})),s&&t.axis!=="enu"?Rl(t,!0,e):e}var kl=de("WGS84");function sa(i,t,e,s){var r,n,a;return Array.isArray(e)?(r=Pr(i,t,e,s)||{x:NaN,y:NaN},e.length>2?typeof i.name!="undefined"&&i.name==="geocent"||typeof t.name!="undefined"&&t.name==="geocent"?typeof r.z=="number"?[r.x,r.y,r.z].concat(e.splice(3)):[r.x,r.y,e[2]].concat(e.splice(3)):[r.x,r.y].concat(e.splice(2)):[r.x,r.y]):(n=Pr(i,t,e,s),a=Object.keys(e),a.length===2||a.forEach(function(o){if(typeof i.name!="undefined"&&i.name==="geocent"||typeof t.name!="undefined"&&t.name==="geocent"){if(o==="x"||o==="y"||o==="z")return}else if(o==="x"||o==="y")return;n[o]=e[o]}),n)}function zl(i){return i instanceof de?i:i.oProj?i.oProj:de(i)}function ct(i,t,e){i=zl(i);var s=!1,r;return typeof t=="undefined"?(t=i,i=kl,s=!0):(typeof t.x!="undefined"||Array.isArray(t))&&(e=t,t=i,i=kl,s=!0),t=zl(t),e?sa(i,t,e):(r={forward:function(n,a){return sa(i,t,n,a)},inverse:function(n,a){return sa(t,i,n,a)}},s&&(r.oProj=t),r)}var jl=6,$l="AJSAJS",Hl="AFAFAF",Li=65,Ft=73,Zt=79,Ls=86,Ts=90,im={forward:Vl,inverse:sm,toPoint:Bl};function Vl(i,t){return t=t||5,am(rm({lat:i[1],lon:i[0]}),t)}function sm(i){var t=na(Wl(i.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function Bl(i){var t=na(Wl(i.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function ra(i){return i*(Math.PI/180)}function Ul(i){return 180*(i/Math.PI)}function rm(i){var t=i.lat,e=i.lon,s=6378137,r=.00669438,n=.9996,a,o,l,h,c,u,d,f=ra(t),g=ra(e),m,p;p=Math.floor((e+180)/6)+1,e===180&&(p=60),t>=56&&t<64&&e>=3&&e<12&&(p=32),t>=72&&t<84&&(e>=0&&e<9?p=31:e>=9&&e<21?p=33:e>=21&&e<33?p=35:e>=33&&e<42&&(p=37)),a=(p-1)*6-180+3,m=ra(a),o=r/(1-r),l=s/Math.sqrt(1-r*Math.sin(f)*Math.sin(f)),h=Math.tan(f)*Math.tan(f),c=o*Math.cos(f)*Math.cos(f),u=Math.cos(f)*(g-m),d=s*((1-r/4-3*r*r/64-5*r*r*r/256)*f-(3*r/8+3*r*r/32+45*r*r*r/1024)*Math.sin(2*f)+(15*r*r/256+45*r*r*r/1024)*Math.sin(4*f)-35*r*r*r/3072*Math.sin(6*f));var y=n*l*(u+(1-h+c)*u*u*u/6+(5-18*h+h*h+72*c-58*o)*u*u*u*u*u/120)+5e5,M=n*(d+l*Math.tan(f)*(u*u/2+(5-h+9*c+4*c*c)*u*u*u*u/24+(61-58*h+h*h+600*c-330*o)*u*u*u*u*u*u/720));return t<0&&(M+=1e7),{northing:Math.round(M),easting:Math.round(y),zoneNumber:p,zoneLetter:nm(t)}}function na(i){var t=i.northing,e=i.easting,s=i.zoneLetter,r=i.zoneNumber;if(r<0||r>60)return null;var n=.9996,a=6378137,o=.00669438,l,h=(1-Math.sqrt(1-o))/(1+Math.sqrt(1-o)),c,u,d,f,g,m,p,y,M,x=e-5e5,L=t;s<"N"&&(L-=1e7),p=(r-1)*6-180+3,l=o/(1-o),m=L/n,y=m/(a*(1-o/4-3*o*o/64-5*o*o*o/256)),M=y+(3*h/2-27*h*h*h/32)*Math.sin(2*y)+(21*h*h/16-55*h*h*h*h/32)*Math.sin(4*y)+151*h*h*h/96*Math.sin(6*y),c=a/Math.sqrt(1-o*Math.sin(M)*Math.sin(M)),u=Math.tan(M)*Math.tan(M),d=l*Math.cos(M)*Math.cos(M),f=a*(1-o)/Math.pow(1-o*Math.sin(M)*Math.sin(M),1.5),g=x/(c*n);var I=M-c*Math.tan(M)/f*(g*g/2-(5+3*u+10*d-4*d*d-9*l)*g*g*g*g/24+(61+90*u+298*d+45*u*u-252*l-3*d*d)*g*g*g*g*g*g/720);I=Ul(I);var D=(g-(1+2*u+d)*g*g*g/6+(5-2*d+28*u-3*d*d+8*l+24*u*u)*g*g*g*g*g/120)/Math.cos(M);D=p+Ul(D);var Y;if(i.accuracy){var H=na({northing:i.northing+i.accuracy,easting:i.easting+i.accuracy,zoneLetter:i.zoneLetter,zoneNumber:i.zoneNumber});Y={top:H.lat,right:H.lon,bottom:I,left:D}}else Y={lat:I,lon:D};return Y}function nm(i){var t="Z";return 84>=i&&i>=72?t="X":72>i&&i>=64?t="W":64>i&&i>=56?t="V":56>i&&i>=48?t="U":48>i&&i>=40?t="T":40>i&&i>=32?t="S":32>i&&i>=24?t="R":24>i&&i>=16?t="Q":16>i&&i>=8?t="P":8>i&&i>=0?t="N":0>i&&i>=-8?t="M":-8>i&&i>=-16?t="L":-16>i&&i>=-24?t="K":-24>i&&i>=-32?t="J":-32>i&&i>=-40?t="H":-40>i&&i>=-48?t="G":-48>i&&i>=-56?t="F":-56>i&&i>=-64?t="E":-64>i&&i>=-72?t="D":-72>i&&i>=-80&&(t="C"),t}function am(i,t){var e="00000"+i.easting,s="00000"+i.northing;return i.zoneNumber+i.zoneLetter+om(i.easting,i.northing,i.zoneNumber)+e.substr(e.length-5,t)+s.substr(s.length-5,t)}function om(i,t,e){var s=ql(e),r=Math.floor(i/1e5),n=Math.floor(t/1e5)%20;return lm(r,n,s)}function ql(i){var t=i%jl;return t===0&&(t=jl),t}function lm(i,t,e){var s=e-1,r=$l.charCodeAt(s),n=Hl.charCodeAt(s),a=r+i-1,o=n+t,l=!1;a>Ts&&(a=a-Ts+Li-1,l=!0),(a===Ft||r<Ft&&a>Ft||(a>Ft||r<Ft)&&l)&&a++,(a===Zt||r<Zt&&a>Zt||(a>Zt||r<Zt)&&l)&&(a++,a===Ft&&a++),a>Ts&&(a=a-Ts+Li-1),o>Ls?(o=o-Ls+Li-1,l=!0):l=!1,(o===Ft||n<Ft&&o>Ft||(o>Ft||n<Ft)&&l)&&o++,(o===Zt||n<Zt&&o>Zt||(o>Zt||n<Zt)&&l)&&(o++,o===Ft&&o++),o>Ls&&(o=o-Ls+Li-1);var h=String.fromCharCode(a)+String.fromCharCode(o);return h}function Wl(i){if(i&&i.length===0)throw"MGRSPoint coverting from nothing";for(var t=i.length,e=null,s="",r,n=0;!/[A-Z]/.test(r=i.charAt(n));){if(n>=2)throw"MGRSPoint bad conversion from: "+i;s+=r,n++}var a=parseInt(s,10);if(n===0||n+3>t)throw"MGRSPoint bad conversion from: "+i;var o=i.charAt(n++);if(o<="A"||o==="B"||o==="Y"||o>="Z"||o==="I"||o==="O")throw"MGRSPoint zone letter "+o+" not handled: "+i;e=i.substring(n,n+=2);for(var l=ql(a),h=hm(e.charAt(0),l),c=cm(e.charAt(1),l);c<um(o);)c+=2e6;var u=t-n;if(u%2!==0)throw`MGRSPoint has to have an even number
2
- of digits after the zone letter and two 100km letters - front
3
- half for easting meters, second half for
4
- northing meters`+i;var d=u/2,f=0,g=0,m,p,y,M,x;return d>0&&(m=1e5/Math.pow(10,d),p=i.substring(n,n+d),f=parseFloat(p)*m,y=i.substring(n+d),g=parseFloat(y)*m),M=f+h,x=g+c,{easting:M,northing:x,zoneLetter:o,zoneNumber:a,accuracy:m}}function hm(i,t){for(var e=$l.charCodeAt(t-1),s=1e5,r=!1;e!==i.charCodeAt(0);){if(e++,e===Ft&&e++,e===Zt&&e++,e>Ts){if(r)throw"Bad character: "+i;e=Li,r=!0}s+=1e5}return s}function cm(i,t){if(i>"V")throw"MGRSPoint given invalid Northing "+i;for(var e=Hl.charCodeAt(t-1),s=0,r=!1;e!==i.charCodeAt(0);){if(e++,e===Ft&&e++,e===Zt&&e++,e>Ls){if(r)throw"Bad character: "+i;e=Li,r=!0}s+=1e5}return s}function um(i){var t;switch(i){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: "+i}function Ti(i,t,e){if(!(this instanceof Ti))return new Ti(i,t,e);if(Array.isArray(i))this.x=i[0],this.y=i[1],this.z=i[2]||0;else if(typeof i=="object")this.x=i.x,this.y=i.y,this.z=i.z||0;else if(typeof i=="string"&&typeof t=="undefined"){var s=i.split(",");this.x=parseFloat(s[0],10),this.y=parseFloat(s[1],10),this.z=parseFloat(s[2],10)||0}else this.x=i,this.y=t,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ti.fromMGRS=function(i){return new Ti(Bl(i))},Ti.prototype.toMGRS=function(i){return Vl([this.x,this.y],i)};var dm=1,fm=.25,Yl=.046875,Xl=.01953125,Zl=.01068115234375,gm=.75,mm=.46875,pm=.013020833333333334,ym=.007120768229166667,vm=.3645833333333333,_m=.005696614583333333,Sm=.3076171875;function Jl(i){var t=[];t[0]=dm-i*(fm+i*(Yl+i*(Xl+i*Zl))),t[1]=i*(gm-i*(Yl+i*(Xl+i*Zl)));var e=i*i;return t[2]=e*(mm-i*(pm+i*ym)),e*=i,t[3]=e*(vm-i*_m),t[4]=e*i*Sm,t}function Er(i,t,e,s){return e*=t,t*=t,s[0]*i-e*(s[1]+t*(s[2]+t*(s[3]+t*s[4])))}var Mm=20;function Kl(i,t,e){for(var s=1/(1-t),r=i,n=Mm;n;--n){var a=Math.sin(r),o=1-t*a*a;if(o=(Er(r,a,Math.cos(r),e)-i)*(o*Math.sqrt(o))*s,r-=o,Math.abs(o)<w)return r}return r}function Cm(){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=Jl(this.es),this.ml0=Er(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function wm(i){var t=i.x,e=i.y,s=b(t-this.long0),r,n,a,o=Math.sin(e),l=Math.cos(e);if(this.es){var c=l*s,u=Math.pow(c,2),d=this.ep2*Math.pow(l,2),f=Math.pow(d,2),g=Math.abs(l)>w?Math.tan(e):0,m=Math.pow(g,2),p=Math.pow(m,2);r=1-this.es*Math.pow(o,2),c=c/Math.sqrt(r);var y=Er(e,o,l,this.en);n=this.a*(this.k0*c*(1+u/6*(1-m+d+u/20*(5-18*m+p+14*d-58*m*d+u/42*(61+179*p-p*m-479*m)))))+this.x0,a=this.a*(this.k0*(y-this.ml0+o*s*c/2*(1+u/12*(5-m+9*d+4*f+u/30*(61+p-58*m+270*d-330*m*d+u/56*(1385+543*p-p*m-3111*m))))))+this.y0}else{var h=l*Math.sin(s);if(Math.abs(Math.abs(h)-1)<w)return 93;if(n=.5*this.a*this.k0*Math.log((1+h)/(1-h))+this.x0,a=l*Math.cos(s)/Math.sqrt(1-Math.pow(h,2)),h=Math.abs(a),h>=1){if(h-1>w)return 93;a=0}else a=Math.acos(a);e<0&&(a=-a),a=this.a*this.k0*(a-this.lat0)+this.y0}return i.x=n,i.y=a,i}function xm(i){var t,e,s,r,n=(i.x-this.x0)*(1/this.a),a=(i.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+a/this.k0,e=Kl(t,this.es,this.en),Math.abs(e)<S){var u=Math.sin(e),d=Math.cos(e),f=Math.abs(d)>w?Math.tan(e):0,g=this.ep2*Math.pow(d,2),m=Math.pow(g,2),p=Math.pow(f,2),y=Math.pow(p,2);t=1-this.es*Math.pow(u,2);var M=n*Math.sqrt(t)/this.k0,x=Math.pow(M,2);t=t*f,s=e-t*x/(1-this.es)*.5*(1-x/12*(5+3*p-9*g*p+g-4*m-x/30*(61+90*p-252*g*p+45*y+46*g-x/56*(1385+3633*p+4095*y+1574*y*p)))),r=b(this.long0+M*(1-x/6*(1+2*p+g-x/20*(5+28*p+24*y+8*g*p+6*g-x/42*(61+662*p+1320*y+720*y*p))))/d)}else s=S*Es(a),r=0;else{var o=Math.exp(n/this.k0),l=.5*(o-1/o),h=this.lat0+a/this.k0,c=Math.cos(h);t=Math.sqrt((1-Math.pow(c,2))/(1+Math.pow(l,2))),s=Math.asin(t),a<0&&(s=-s),l===0&&c===0?r=0:r=b(Math.atan2(l,c)+this.long0)}return i.x=r,i.y=s,i}var bm=["Fast_Transverse_Mercator","Fast Transverse Mercator"],Ir={init:Cm,forward:wm,inverse:xm,names:bm};function Ql(i){var t=Math.exp(i);return t=(t-1/t)/2,t}function Lr(i,t){i=Math.abs(i),t=Math.abs(t);var e=Math.max(i,t),s=Math.min(i,t)/(e||1);return e*Math.sqrt(1+Math.pow(s,2))}function Om(i){var t=1+i,e=t-1;return e===0?i:i*Math.log(t)/e}function Pm(i){var t=Math.abs(i);return t=Om(t*(1+t/(Lr(1,t)+1))),i<0?-t:t}function aa(i,t){for(var e=2*Math.cos(2*t),s=i.length-1,r=i[s],n=0,a;--s>=0;)a=-n+e*r+i[s],n=r,r=a;return t+a*Math.sin(2*t)}function Em(i,t){for(var e=2*Math.cos(t),s=i.length-1,r=i[s],n=0,a;--s>=0;)a=-n+e*r+i[s],n=r,r=a;return Math.sin(t)*a}function Im(i){var t=Math.exp(i);return t=(t+1/t)/2,t}function th(i,t,e){for(var s=Math.sin(t),r=Math.cos(t),n=Ql(e),a=Im(e),o=2*r*a,l=-2*s*n,h=i.length-1,c=i[h],u=0,d=0,f=0,g,m;--h>=0;)g=d,m=u,d=c,u=f,c=-g+o*d-l*u+i[h],f=-m+l*d+o*u;return o=s*a,l=r*n,[o*c-l*f,o*f+l*c]}function Lm(){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&&(Ir.init.apply(this),this.forward=Ir.forward,this.inverse=Ir.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 i=this.es/(1+Math.sqrt(1-this.es)),t=i/(2-i),e=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+t*(-2854/675)))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))),e=e*t,this.cgb[1]=e*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+t*(2323/945))))),this.cbg[1]=e*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),e=e*t,this.cgb[2]=e*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=e*(-26/15+t*(34/21+t*(8/5+t*(-12686/2835)))),e=e*t,this.cgb[3]=e*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=e*(1237/630+t*(-12/5+t*(-24832/14175))),e=e*t,this.cgb[4]=e*(4174/315+t*(-144838/6237)),this.cbg[4]=e*(-734/315+t*(109598/31185)),e=e*t,this.cgb[5]=e*(601676/22275),this.cbg[5]=e*(444337/155925),e=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+e*(1/4+e*(1/64+e/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=e*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=e*(13/48+t*(-3/5+t*(557/1440+t*(281/630+t*(-1983433/1935360))))),e=e*t,this.utg[2]=e*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=e*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),e=e*t,this.utg[3]=e*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=e*(49561/161280+t*(-179/168+t*(6601661/7257600))),e=e*t,this.utg[4]=e*(-4583/161280+t*(108847/3991680)),this.gtu[4]=e*(34729/80640+t*(-3418889/1995840)),e=e*t,this.utg[5]=e*(-20648693/638668800),this.gtu[5]=e*(212378941/319334400);var s=aa(this.cbg,this.lat0);this.Zb=-this.Qn*(s+Em(this.gtu,2*s))}function Tm(i){var t=b(i.x-this.long0),e=i.y;e=aa(this.cbg,e);var s=Math.sin(e),r=Math.cos(e),n=Math.sin(t),a=Math.cos(t);e=Math.atan2(s,a*r),t=Math.atan2(n*r,Lr(s,r*a)),t=Pm(Math.tan(t));var o=th(this.gtu,2*e,2*t);e=e+o[0],t=t+o[1];var l,h;return Math.abs(t)<=2.623395162778?(l=this.a*(this.Qn*t)+this.x0,h=this.a*(this.Qn*e+this.Zb)+this.y0):(l=1/0,h=1/0),i.x=l,i.y=h,i}function Nm(i){var t=(i.x-this.x0)*(1/this.a),e=(i.y-this.y0)*(1/this.a);e=(e-this.Zb)/this.Qn,t=t/this.Qn;var s,r;if(Math.abs(t)<=2.623395162778){var n=th(this.utg,2*e,2*t);e=e+n[0],t=t+n[1],t=Math.atan(Ql(t));var a=Math.sin(e),o=Math.cos(e),l=Math.sin(t),h=Math.cos(t);e=Math.atan2(a*h,Lr(l,h*o)),t=Math.atan2(l,h*o),s=b(t+this.long0),r=aa(this.cgb,e)}else s=1/0,r=1/0;return i.x=s,i.y=r,i}var Dm=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"],Tr={init:Lm,forward:Tm,inverse:Nm,names:Dm};function Fm(i,t){if(i===void 0){if(i=Math.floor((b(t)+Math.PI)*30/Math.PI)+1,i<0)return 0;if(i>60)return 60}return i}var Rm="etmerc";function Am(){var i=Fm(this.zone,this.long0);if(i===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(i)-183)*_t,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Tr.init.apply(this),this.forward=Tr.forward,this.inverse=Tr.inverse}var Gm=["Universal Transverse Mercator System","utm"],km={init:Am,names:Gm,dependsOn:Rm};function oa(i,t){return Math.pow((1-i)/(1+i),t)}var zm=20;function jm(){var i=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*i*i),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(i/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+j)/(Math.pow(Math.tan(.5*this.lat0+j),this.C)*oa(this.e*i,this.ratexp))}function $m(i){var t=i.x,e=i.y;return i.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+j),this.C)*oa(this.e*Math.sin(e),this.ratexp))-S,i.x=this.C*t,i}function Hm(i){for(var t=1e-14,e=i.x/this.C,s=i.y,r=Math.pow(Math.tan(.5*s+j)/this.K,1/this.C),n=zm;n>0&&(s=2*Math.atan(r*oa(this.e*Math.sin(i.y),-.5*this.e))-S,!(Math.abs(s-i.y)<t));--n)i.y=s;return n?(i.x=e,i.y=s,i):null}var Vm=["gauss"],la={init:jm,forward:$m,inverse:Hm,names:Vm};function Bm(){la.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 Um(i){var t,e,s,r;return i.x=b(i.x-this.long0),la.forward.apply(this,[i]),t=Math.sin(i.y),e=Math.cos(i.y),s=Math.cos(i.x),r=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*e*s),i.x=r*e*Math.sin(i.x),i.y=r*(this.cosc0*t-this.sinc0*e*s),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function qm(i){var t,e,s,r,n;if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,n=Math.sqrt(i.x*i.x+i.y*i.y)){var a=2*Math.atan2(n,this.R2);t=Math.sin(a),e=Math.cos(a),r=Math.asin(e*this.sinc0+i.y*t*this.cosc0/n),s=Math.atan2(i.x*t,n*this.cosc0*e-i.y*this.sinc0*t)}else r=this.phic0,s=0;return i.x=s,i.y=r,la.inverse.apply(this,[i]),i.x=b(i.x+this.long0),i}var Wm=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"],Ym={init:Bm,forward:Um,inverse:qm,names:Wm};function Xm(i,t,e){return t*=e,Math.tan(.5*(S+i))*Math.pow((1-t)/(1+t),.5*e)}function Zm(){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)<=w&&(this.k0=.5*(1+Es(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=w&&(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)<=w&&(this.k0=.5*this.cons*ue(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/se(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=ue(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-S,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function Jm(i){var t=i.x,e=i.y,s=Math.sin(e),r=Math.cos(e),n,a,o,l,h,c,u=b(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=w&&Math.abs(e+this.lat0)<=w?(i.x=NaN,i.y=NaN,i):this.sphere?(n=2*this.k0/(1+this.sinlat0*s+this.coslat0*r*Math.cos(u)),i.x=this.a*n*r*Math.sin(u)+this.x0,i.y=this.a*n*(this.coslat0*s-this.sinlat0*r*Math.cos(u))+this.y0,i):(a=2*Math.atan(this.ssfn_(e,s,this.e))-S,l=Math.cos(a),o=Math.sin(a),Math.abs(this.coslat0)<=w?(h=se(this.e,e*this.con,this.con*s),c=2*this.a*this.k0*h/this.cons,i.x=this.x0+c*Math.sin(t-this.long0),i.y=this.y0-this.con*c*Math.cos(t-this.long0),i):(Math.abs(this.sinlat0)<w?(n=2*this.a*this.k0/(1+l*Math.cos(u)),i.y=n*o):(n=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*o+this.cosX0*l*Math.cos(u))),i.y=n*(this.cosX0*o-this.sinX0*l*Math.cos(u))+this.y0),i.x=n*l*Math.sin(u)+this.x0,i))}function Km(i){i.x-=this.x0,i.y-=this.y0;var t,e,s,r,n,a=Math.sqrt(i.x*i.x+i.y*i.y);if(this.sphere){var o=2*Math.atan(a/(2*this.a*this.k0));return t=this.long0,e=this.lat0,a<=w?(i.x=t,i.y=e,i):(e=Math.asin(Math.cos(o)*this.sinlat0+i.y*Math.sin(o)*this.coslat0/a),Math.abs(this.coslat0)<w?this.lat0>0?t=b(this.long0+Math.atan2(i.x,-1*i.y)):t=b(this.long0+Math.atan2(i.x,i.y)):t=b(this.long0+Math.atan2(i.x*Math.sin(o),a*this.coslat0*Math.cos(o)-i.y*this.sinlat0*Math.sin(o))),i.x=t,i.y=e,i)}else if(Math.abs(this.coslat0)<=w){if(a<=w)return e=this.lat0,t=this.long0,i.x=t,i.y=e,i;i.x*=this.con,i.y*=this.con,s=a*this.cons/(2*this.a*this.k0),e=this.con*Is(this.e,s),t=this.con*b(this.con*this.long0+Math.atan2(i.x,-1*i.y))}else r=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=w?n=this.X0:(n=Math.asin(Math.cos(r)*this.sinX0+i.y*Math.sin(r)*this.cosX0/a),t=b(this.long0+Math.atan2(i.x*Math.sin(r),a*this.cosX0*Math.cos(r)-i.y*this.sinX0*Math.sin(r)))),e=-1*Is(this.e,Math.tan(.5*(S+n)));return i.x=t,i.y=e,i}var Qm=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],tp={init:Zm,forward:Jm,inverse:Km,names:Qm,ssfn_:Xm};function ep(){var i=this.lat0;this.lambda0=this.long0;var t=Math.sin(i),e=this.a,s=this.rf,r=1/s,n=2*r-Math.pow(r,2),a=this.e=Math.sqrt(n);this.R=this.k0*e*Math.sqrt(1-n)/(1-n*Math.pow(t,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(i),4)),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+i/2)),h=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*l+this.alpha*a/2*h}function ip(i){var t=Math.log(Math.tan(Math.PI/4-i.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(i.y))/(1-this.e*Math.sin(i.y))),s=-this.alpha*(t+e)+this.K,r=2*(Math.atan(Math.exp(s))-Math.PI/4),n=this.alpha*(i.x-this.lambda0),a=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(n))),o=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(n));return i.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,i.x=this.R*a+this.x0,i}function sp(i){for(var t=i.x-this.x0,e=i.y-this.y0,s=t/this.R,r=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),n=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(s)),a=Math.atan(Math.sin(s)/(Math.cos(this.b0)*Math.cos(s)-Math.sin(this.b0)*Math.tan(r))),o=this.lambda0+a/this.alpha,l=0,h=n,c=-1e3,u=0;Math.abs(h-c)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+n/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),c=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return i.x=o,i.y=h,i}var rp=["somerc"],np={init:ep,forward:ip,inverse:sp,names:rp},Ni=1e-7;function ap(i){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],e=typeof i.PROJECTION=="object"?Object.keys(i.PROJECTION)[0]:i.PROJECTION;return"no_uoff"in i||"no_off"in i||t.indexOf(e)!==-1}function op(){var i,t,e,s,r,n,a,o,l,h,c=0,u,d=0,f=0,g=0,m=0,p=0,y=0;this.no_off=ap(this),this.no_rot="no_rot"in this;var M=!1;"alpha"in this&&(M=!0);var x=!1;if("rectified_grid_angle"in this&&(x=!0),M&&(y=this.alpha),x&&(c=this.rectified_grid_angle*_t),M||x)d=this.longc;else if(f=this.long1,m=this.lat1,g=this.long2,p=this.lat2,Math.abs(m-p)<=Ni||(i=Math.abs(m))<=Ni||Math.abs(i-S)<=Ni||Math.abs(Math.abs(this.lat0)-S)<=Ni||Math.abs(Math.abs(p)-S)<=Ni)throw new Error;var L=1-this.es;t=Math.sqrt(L),Math.abs(this.lat0)>w?(o=Math.sin(this.lat0),e=Math.cos(this.lat0),i=1-this.es*o*o,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/L),this.A=this.B*this.k0*t/i,s=this.B*t/(e*Math.sqrt(i)),r=s*s-1,r<=0?r=0:(r=Math.sqrt(r),this.lat0<0&&(r=-r)),this.E=r+=s,this.E*=Math.pow(se(this.e,this.lat0,o),this.B)):(this.B=1/t,this.A=this.k0,this.E=s=r=1),M||x?(M?(u=Math.asin(Math.sin(y)/s),x||(c=y)):(u=c,y=Math.asin(s*Math.sin(u))),this.lam0=d-Math.asin(.5*(r-1/r)*Math.tan(u))/this.B):(n=Math.pow(se(this.e,m,Math.sin(m)),this.B),a=Math.pow(se(this.e,p,Math.sin(p)),this.B),r=this.E/n,l=(a-n)/(a+n),h=this.E*this.E,h=(h-a*n)/(h+a*n),i=f-g,i<-Math.pi?g-=Os:i>Math.pi&&(g+=Os),this.lam0=b(.5*(f+g)-Math.atan(h*Math.tan(.5*this.B*(f-g))/l)/this.B),u=Math.atan(2*Math.sin(this.B*b(f-this.lam0))/(r-1/r)),c=y=Math.asin(s*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(c),this.cosrot=Math.cos(c),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(s*s-1)/Math.cos(y))),this.lat0<0&&(this.u_0=-this.u_0)),r=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(j-r)),this.v_pole_s=this.ArB*Math.log(Math.tan(j+r))}function lp(i){var t={},e,s,r,n,a,o,l,h;if(i.x=i.x-this.lam0,Math.abs(Math.abs(i.y)-S)>w){if(a=this.E/Math.pow(se(this.e,i.y,Math.sin(i.y)),this.B),o=1/a,e=.5*(a-o),s=.5*(a+o),n=Math.sin(this.B*i.x),r=(e*this.singam-n*this.cosgam)/s,Math.abs(Math.abs(r)-1)<w)throw new Error;h=.5*this.ArB*Math.log((1-r)/(1+r)),o=Math.cos(this.B*i.x),Math.abs(o)<Ni?l=this.A*i.x:l=this.ArB*Math.atan2(e*this.cosgam+n*this.singam,o)}else h=i.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*i.y;return this.no_rot?(t.x=l,t.y=h):(l-=this.u_0,t.x=h*this.cosrot+l*this.sinrot,t.y=l*this.cosrot-h*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function hp(i){var t,e,s,r,n,a,o,l={};if(i.x=(i.x-this.x0)*(1/this.a),i.y=(i.y-this.y0)*(1/this.a),this.no_rot?(e=i.y,t=i.x):(e=i.x*this.cosrot-i.y*this.sinrot,t=i.y*this.cosrot+i.x*this.sinrot+this.u_0),s=Math.exp(-this.BrA*e),r=.5*(s-1/s),n=.5*(s+1/s),a=Math.sin(this.BrA*t),o=(a*this.cosgam+r*this.singam)/n,Math.abs(Math.abs(o)-1)<w)l.x=0,l.y=o<0?-S:S;else{if(l.y=this.E/Math.sqrt((1+o)/(1-o)),l.y=Is(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(r*this.cosgam-a*this.singam,Math.cos(this.BrA*t))}return l.x+=this.lam0,l}var cp=["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"],up={init:op,forward:lp,inverse:hp,names:cp};function dp(){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)<w)){var i=this.b/this.a;this.e=Math.sqrt(1-i*i);var t=Math.sin(this.lat1),e=Math.cos(this.lat1),s=ue(this.e,t,e),r=se(this.e,this.lat1,t),n=Math.sin(this.lat2),a=Math.cos(this.lat2),o=ue(this.e,n,a),l=se(this.e,this.lat2,n),h=se(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>w?this.ns=Math.log(s/o)/Math.log(r/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=s/(this.ns*Math.pow(r,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function fp(i){var t=i.x,e=i.y;Math.abs(2*Math.abs(e)-Math.PI)<=w&&(e=Es(e)*(S-2*w));var s=Math.abs(Math.abs(e)-S),r,n;if(s>w)r=se(this.e,e,Math.sin(e)),n=this.a*this.f0*Math.pow(r,this.ns);else{if(s=e*this.ns,s<=0)return null;n=0}var a=this.ns*b(t-this.long0);return i.x=this.k0*(n*Math.sin(a))+this.x0,i.y=this.k0*(this.rh-n*Math.cos(a))+this.y0,i}function gp(i){var t,e,s,r,n,a=(i.x-this.x0)/this.k0,o=this.rh-(i.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+o*o),e=1):(t=-Math.sqrt(a*a+o*o),e=-1);var l=0;if(t!==0&&(l=Math.atan2(e*a,e*o)),t!==0||this.ns>0){if(e=1/this.ns,s=Math.pow(t/(this.a*this.f0),e),r=Is(this.e,s),r===-9999)return null}else r=-S;return n=b(l/this.ns+this.long0),i.x=n,i.y=r,i}var mp=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc"],pp={init:dp,forward:fp,inverse:gp,names:mp};function yp(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),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 vp(i){var t,e,s,r,n,a,o,l=i.x,h=i.y,c=b(l-this.long0);return t=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/t)-this.s45),s=-c*this.alfa,r=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(s)),n=Math.asin(Math.cos(e)*Math.sin(s)/Math.cos(r)),a=this.n*n,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n),i.y=o*Math.cos(a)/1,i.x=o*Math.sin(a)/1,this.czech||(i.y*=-1,i.x*=-1),i}function _p(i){var t,e,s,r,n,a,o,l,h=i.x;i.x=i.y,i.y=h,this.czech||(i.y*=-1,i.x*=-1),a=Math.sqrt(i.x*i.x+i.y*i.y),n=Math.atan2(i.y,i.x),r=n/Math.sin(this.s0),s=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(s)-Math.sin(this.ad)*Math.cos(s)*Math.cos(r)),e=Math.asin(Math.cos(s)*Math.sin(r)/Math.cos(t)),i.x=this.long0-e/this.alfa,o=t,l=0;var c=0;do i.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(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-i.y)<1e-10&&(l=1),o=i.y,c+=1;while(l===0&&c<15);return c>=15?null:i}var Sp=["Krovak","krovak"],Mp={init:yp,forward:vp,inverse:_p,names:Sp};function It(i,t,e,s,r){return i*r-t*Math.sin(2*r)+e*Math.sin(4*r)-s*Math.sin(6*r)}function Ns(i){return 1-.25*i*(1+i/16*(3+1.25*i))}function Ds(i){return .375*i*(1+.25*i*(1+.46875*i))}function Fs(i){return .05859375*i*i*(1+.75*i)}function Rs(i){return i*i*i*(35/3072)}function Di(i,t,e){var s=t*e;return i/Math.sqrt(1-s*s)}function Fi(i){return Math.abs(i)<S?i:i-Es(i)*Math.PI}function Nr(i,t,e,s,r){var n,a;n=i/t;for(var o=0;o<15;o++)if(a=(i-(t*n-e*Math.sin(2*n)+s*Math.sin(4*n)-r*Math.sin(6*n)))/(t-2*e*Math.cos(2*n)+4*s*Math.cos(4*n)-6*r*Math.cos(6*n)),n+=a,Math.abs(a)<=1e-10)return n;return NaN}function Cp(){this.sphere||(this.e0=Ns(this.es),this.e1=Ds(this.es),this.e2=Fs(this.es),this.e3=Rs(this.es),this.ml0=this.a*It(this.e0,this.e1,this.e2,this.e3,this.lat0))}function wp(i){var t,e,s=i.x,r=i.y;if(s=b(s-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(r)*Math.sin(s)),e=this.a*(Math.atan2(Math.tan(r),Math.cos(s))-this.lat0);else{var n=Math.sin(r),a=Math.cos(r),o=Di(this.a,this.e,n),l=Math.tan(r)*Math.tan(r),h=s*Math.cos(r),c=h*h,u=this.es*a*a/(1-this.es),d=this.a*It(this.e0,this.e1,this.e2,this.e3,r);t=o*h*(1-c*l*(1/6-(8-l+8*u)*c/120)),e=d-this.ml0+o*n/a*c*(.5+(5-l+6*u)*c/24)}return i.x=t+this.x0,i.y=e+this.y0,i}function xp(i){i.x-=this.x0,i.y-=this.y0;var t=i.x/this.a,e=i.y/this.a,s,r;if(this.sphere){var n=e+this.lat0;s=Math.asin(Math.sin(n)*Math.cos(t)),r=Math.atan2(Math.tan(t),Math.cos(n))}else{var a=this.ml0/this.a+e,o=Nr(a,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-S)<=w)return i.x=this.long0,i.y=S,e<0&&(i.y*=-1),i;var l=Di(this.a,this.e,Math.sin(o)),h=l*l*l/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(o),2),u=t*this.a/l,d=u*u;s=o-l*Math.tan(o)/h*u*u*(.5-(1+3*c)*u*u/24),r=u*(1-d*(c/3+(1+3*c)*c*d/15))/Math.cos(o)}return i.x=b(r+this.long0),i.y=Fi(s),i}var bp=["Cassini","Cassini_Soldner","cass"],Op={init:Cp,forward:wp,inverse:xp,names:bp};function $e(i,t){var e;return i>1e-7?(e=i*t,(1-i*i)*(t/(1-e*e)-.5/i*Math.log((1-e)/(1+e)))):2*t}var Pp=1,Ep=2,Ip=3,Lp=4;function Tp(){var i=Math.abs(this.lat0);if(Math.abs(i-S)<w?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(i)<w?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var t;switch(this.qp=$e(this.e,1),this.mmf=.5/(1-this.es),this.apa=jp(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=$e(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 Np(i){var t,e,s,r,n,a,o,l,h,c,u=i.x,d=i.y;if(u=b(u-this.long0),this.sphere){if(n=Math.sin(d),c=Math.cos(d),s=Math.cos(u),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e=this.mode===this.EQUIT?1+c*s:1+this.sinph0*n+this.cosph0*c*s,e<=w)return null;e=Math.sqrt(2/e),t=e*c*Math.sin(u),e*=this.mode===this.EQUIT?n:this.cosph0*n-this.sinph0*c*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(d+this.lat0)<w)return null;e=j-d*.5,e=2*(this.mode===this.S_POLE?Math.cos(e):Math.sin(e)),t=e*Math.sin(u),e*=s}}else{switch(o=0,l=0,h=0,s=Math.cos(u),r=Math.sin(u),n=Math.sin(d),a=$e(this.e,n),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(o=a/this.qp,l=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:h=1+this.sinb1*o+this.cosb1*l*s;break;case this.EQUIT:h=1+l*s;break;case this.N_POLE:h=S+d,a=this.qp-a;break;case this.S_POLE:h=d-S,a=this.qp+a;break}if(Math.abs(h)<w)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:h=Math.sqrt(2/h),this.mode===this.OBLIQ?e=this.ymf*h*(this.cosb1*o-this.sinb1*l*s):e=(h=Math.sqrt(2/(1+l*s)))*o*this.ymf,t=this.xmf*h*l*r;break;case this.N_POLE:case this.S_POLE:a>=0?(t=(h=Math.sqrt(a))*r,e=s*(this.mode===this.S_POLE?h:-h)):t=e=0;break}}return i.x=this.a*t+this.x0,i.y=this.a*e+this.y0,i}function Dp(i){i.x-=this.x0,i.y-=this.y0;var t=i.x/this.a,e=i.y/this.a,s,r,n,a,o,l,h;if(this.sphere){var c=0,u,d=0;if(u=Math.sqrt(t*t+e*e),r=u*.5,r>1)return null;switch(r=2*Math.asin(r),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(d=Math.sin(r),c=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(u)<=w?0:Math.asin(e*d/u),t*=d,e=c*u;break;case this.OBLIQ:r=Math.abs(u)<=w?this.lat0:Math.asin(c*this.sinph0+e*d*this.cosph0/u),t*=d*this.cosph0,e=(c-Math.sin(r)*this.sinph0)*u;break;case this.N_POLE:e=-e,r=S-r;break;case this.S_POLE:r-=S;break}s=e===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,e)}else{if(h=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,e*=this.dd,l=Math.sqrt(t*t+e*e),l<w)return i.x=this.long0,i.y=this.lat0,i;a=2*Math.asin(.5*l/this.rq),n=Math.cos(a),t*=a=Math.sin(a),this.mode===this.OBLIQ?(h=n*this.sinb1+e*a*this.cosb1/l,o=this.qp*h,e=l*this.cosb1*n-e*this.sinb1*a):(h=e*a/l,o=this.qp*h,e=l*n)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(e=-e),o=t*t+e*e,!o)return i.x=this.long0,i.y=this.lat0,i;h=1-o/this.qp,this.mode===this.S_POLE&&(h=-h)}s=Math.atan2(t,e),r=$p(Math.asin(h),this.apa)}return i.x=b(this.long0+s),i.y=r,i}var Fp=.3333333333333333,Rp=.17222222222222222,Ap=.10257936507936508,Gp=.06388888888888888,kp=.0664021164021164,zp=.016415012942191543;function jp(i){var t,e=[];return e[0]=i*Fp,t=i*i,e[0]+=t*Rp,e[1]=t*Gp,t*=i,e[0]+=t*Ap,e[1]+=t*kp,e[2]=t*zp,e}function $p(i,t){var e=i+i;return i+t[0]*Math.sin(e)+t[1]*Math.sin(e+e)+t[2]*Math.sin(e+e+e)}var Hp=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],Vp={init:Tp,forward:Np,inverse:Dp,names:Hp,S_POLE:Pp,N_POLE:Ep,EQUIT:Ip,OBLIQ:Lp};function He(i){return Math.abs(i)>1&&(i=i>1?1:-1),Math.asin(i)}function Bp(){Math.abs(this.lat1+this.lat2)<w||(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=ue(this.e3,this.sin_po,this.cos_po),this.qs1=$e(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=ue(this.e3,this.sin_po,this.cos_po),this.qs2=$e(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=$e(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>w?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 Up(i){var t=i.x,e=i.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var s=$e(this.e3,this.sin_phi,this.cos_phi),r=this.a*Math.sqrt(this.c-this.ns0*s)/this.ns0,n=this.ns0*b(t-this.long0),a=r*Math.sin(n)+this.x0,o=this.rh-r*Math.cos(n)+this.y0;return i.x=a,i.y=o,i}function qp(i){var t,e,s,r,n,a;return i.x-=this.x0,i.y=this.rh-i.y+this.y0,this.ns0>=0?(t=Math.sqrt(i.x*i.x+i.y*i.y),s=1):(t=-Math.sqrt(i.x*i.x+i.y*i.y),s=-1),r=0,t!==0&&(r=Math.atan2(s*i.x,s*i.y)),s=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-s*s)/(2*this.ns0)):(e=(this.c-s*s)/this.ns0,a=this.phi1z(this.e3,e)),n=b(r/this.ns0+this.long0),i.x=n,i.y=a,i}function Wp(i,t){var e,s,r,n,a,o=He(.5*t);if(i<w)return o;for(var l=i*i,h=1;h<=25;h++)if(e=Math.sin(o),s=Math.cos(o),r=i*e,n=1-r*r,a=.5*n*n/s*(t/(1-l)-e/n+.5/i*Math.log((1-r)/(1+r))),o=o+a,Math.abs(a)<=1e-7)return o;return null}var Yp=["Albers_Conic_Equal_Area","Albers","aea"],Xp={init:Bp,forward:Up,inverse:qp,names:Yp,phi1z:Wp};function Zp(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function Jp(i){var t,e,s,r,n,a,o,l,h=i.x,c=i.y;return s=b(h-this.long0),t=Math.sin(c),e=Math.cos(c),r=Math.cos(s),a=this.sin_p14*t+this.cos_p14*e*r,n=1,a>0||Math.abs(a)<=w?(o=this.x0+this.a*n*e*Math.sin(s)/a,l=this.y0+this.a*n*(this.cos_p14*t-this.sin_p14*e*r)/a):(o=this.x0+this.infinity_dist*e*Math.sin(s),l=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*e*r)),i.x=o,i.y=l,i}function Kp(i){var t,e,s,r,n,a;return i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,(t=Math.sqrt(i.x*i.x+i.y*i.y))?(r=Math.atan2(t,this.rc),e=Math.sin(r),s=Math.cos(r),a=He(s*this.sin_p14+i.y*e*this.cos_p14/t),n=Math.atan2(i.x*e,t*this.cos_p14*s-i.y*this.sin_p14*e),n=b(this.long0+n)):(a=this.phic0,n=0),i.x=n,i.y=a,i}var Qp=["gnom"],ty={init:Zp,forward:Jp,inverse:Kp,names:Qp};function ey(i,t){var e=1-(1-i*i)/(2*i)*Math.log((1-i)/(1+i));if(Math.abs(Math.abs(t)-e)<1e-6)return t<0?-1*S:S;for(var s=Math.asin(.5*t),r,n,a,o,l=0;l<30;l++)if(n=Math.sin(s),a=Math.cos(s),o=i*n,r=Math.pow(1-o*o,2)/(2*a)*(t/(1-i*i)-n/(1-o*o)+.5/i*Math.log((1-o)/(1+o))),s+=r,Math.abs(r)<=1e-10)return s;return NaN}function iy(){this.sphere||(this.k0=ue(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function sy(i){var t=i.x,e=i.y,s,r,n=b(t-this.long0);if(this.sphere)s=this.x0+this.a*n*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var a=$e(this.e,Math.sin(e));s=this.x0+this.a*this.k0*n,r=this.y0+this.a*a*.5/this.k0}return i.x=s,i.y=r,i}function ry(i){i.x-=this.x0,i.y-=this.y0;var t,e;return this.sphere?(t=b(this.long0+i.x/this.a/Math.cos(this.lat_ts)),e=Math.asin(i.y/this.a*Math.cos(this.lat_ts))):(e=ey(this.e,2*i.y*this.k0/this.a),t=b(this.long0+i.x/(this.a*this.k0))),i.x=t,i.y=e,i}var ny=["cea"],ay={init:iy,forward:sy,inverse:ry,names:ny};function oy(){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 ly(i){var t=i.x,e=i.y,s=b(t-this.long0),r=Fi(e-this.lat0);return i.x=this.x0+this.a*s*this.rc,i.y=this.y0+this.a*r,i}function hy(i){var t=i.x,e=i.y;return i.x=b(this.long0+(t-this.x0)/(this.a*this.rc)),i.y=Fi(this.lat0+(e-this.y0)/this.a),i}var cy=["Equirectangular","Equidistant_Cylindrical","eqc"],uy={init:oy,forward:ly,inverse:hy,names:cy},eh=20;function dy(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Ns(this.es),this.e1=Ds(this.es),this.e2=Fs(this.es),this.e3=Rs(this.es),this.ml0=this.a*It(this.e0,this.e1,this.e2,this.e3,this.lat0)}function fy(i){var t=i.x,e=i.y,s,r,n,a=b(t-this.long0);if(n=a*Math.sin(e),this.sphere)Math.abs(e)<=w?(s=this.a*a,r=-1*this.a*this.lat0):(s=this.a*Math.sin(n)/Math.tan(e),r=this.a*(Fi(e-this.lat0)+(1-Math.cos(n))/Math.tan(e)));else if(Math.abs(e)<=w)s=this.a*a,r=-1*this.ml0;else{var o=Di(this.a,this.e,Math.sin(e))/Math.tan(e);s=o*Math.sin(n),r=this.a*It(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+o*(1-Math.cos(n))}return i.x=s+this.x0,i.y=r+this.y0,i}function gy(i){var t,e,s,r,n,a,o,l,h;if(s=i.x-this.x0,r=i.y-this.y0,this.sphere)if(Math.abs(r+this.a*this.lat0)<=w)t=b(s/this.a+this.long0),e=0;else{a=this.lat0+r/this.a,o=s*s/this.a/this.a+a*a,l=a;var c;for(n=eh;n;--n)if(c=Math.tan(l),h=-1*(a*(l*c+1)-l-.5*(l*l+o)*c)/((l-a)/c-1),l+=h,Math.abs(h)<=w){e=l;break}t=b(this.long0+Math.asin(s*Math.tan(l)/this.a)/Math.sin(e))}else if(Math.abs(r+this.ml0)<=w)e=0,t=b(this.long0+s/this.a);else{a=(this.ml0+r)/this.a,o=s*s/this.a/this.a+a*a,l=a;var u,d,f,g,m;for(n=eh;n;--n)if(m=this.e*Math.sin(l),u=Math.sqrt(1-m*m)*Math.tan(l),d=this.a*It(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),g=d/this.a,h=(a*(u*g+1)-g-.5*u*(g*g+o))/(this.es*Math.sin(2*l)*(g*g+o-2*a*g)/(4*u)+(a-g)*(u*f-2/Math.sin(2*l))-f),l-=h,Math.abs(h)<=w){e=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),t=b(this.long0+Math.asin(s*u/this.a)/Math.sin(e))}return i.x=t,i.y=e,i}var my=["Polyconic","poly"],py={init:dy,forward:fy,inverse:gy,names:my};function yy(){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 vy(i){var t,e=i.x,s=i.y,r=s-this.lat0,n=e-this.long0,a=r/bs*1e-5,o=n,l=1,h=0;for(t=1;t<=10;t++)l=l*a,h=h+this.A[t]*l;var c=h,u=o,d=1,f=0,g,m,p=0,y=0;for(t=1;t<=6;t++)g=d*c-f*u,m=f*c+d*u,d=g,f=m,p=p+this.B_re[t]*d-this.B_im[t]*f,y=y+this.B_im[t]*d+this.B_re[t]*f;return i.x=y*this.a+this.x0,i.y=p*this.a+this.y0,i}function _y(i){var t,e=i.x,s=i.y,r=e-this.x0,n=s-this.y0,a=n/this.a,o=r/this.a,l=1,h=0,c,u,d=0,f=0;for(t=1;t<=6;t++)c=l*a-h*o,u=h*a+l*o,l=c,h=u,d=d+this.C_re[t]*l-this.C_im[t]*h,f=f+this.C_im[t]*l+this.C_re[t]*h;for(var g=0;g<this.iterations;g++){var m=d,p=f,y,M,x=a,L=o;for(t=2;t<=6;t++)y=m*d-p*f,M=p*d+m*f,m=y,p=M,x=x+(t-1)*(this.B_re[t]*m-this.B_im[t]*p),L=L+(t-1)*(this.B_im[t]*m+this.B_re[t]*p);m=1,p=0;var I=this.B_re[1],D=this.B_im[1];for(t=2;t<=6;t++)y=m*d-p*f,M=p*d+m*f,m=y,p=M,I=I+t*(this.B_re[t]*m-this.B_im[t]*p),D=D+t*(this.B_im[t]*m+this.B_re[t]*p);var Y=I*I+D*D;d=(x*I+L*D)/Y,f=(L*I-x*D)/Y}var H=d,wt=f,$t=1,Me=0;for(t=1;t<=9;t++)$t=$t*H,Me=Me+this.D[t]*$t;var cr=this.lat0+Me*bs*1e5,sd=this.long0+wt;return i.x=sd,i.y=cr,i}var Sy=["New_Zealand_Map_Grid","nzmg"],My={init:yy,forward:vy,inverse:_y,names:Sy};function Cy(){}function wy(i){var t=i.x,e=i.y,s=b(t-this.long0),r=this.x0+this.a*s,n=this.y0+this.a*Math.log(Math.tan(Math.PI/4+e/2.5))*1.25;return i.x=r,i.y=n,i}function xy(i){i.x-=this.x0,i.y-=this.y0;var t=b(this.long0+i.x/this.a),e=2.5*(Math.atan(Math.exp(.8*i.y/this.a))-Math.PI/4);return i.x=t,i.y=e,i}var by=["Miller_Cylindrical","mill"],Oy={init:Cy,forward:wy,inverse:xy,names:by},Py=20;function Ey(){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=Jl(this.es)}function Iy(i){var t,e,s=i.x,r=i.y;if(s=b(s-this.long0),this.sphere){if(!this.m)r=this.n!==1?Math.asin(this.n*Math.sin(r)):r;else for(var n=this.n*Math.sin(r),a=Py;a;--a){var o=(this.m*r+Math.sin(r)-n)/(this.m+Math.cos(r));if(r-=o,Math.abs(o)<w)break}t=this.a*this.C_x*s*(this.m+Math.cos(r)),e=this.a*this.C_y*r}else{var l=Math.sin(r),h=Math.cos(r);e=this.a*Er(r,l,h,this.en),t=this.a*s*h/Math.sqrt(1-this.es*l*l)}return i.x=t,i.y=e,i}function Ly(i){var t,e,s,r;return i.x-=this.x0,s=i.x/this.a,i.y-=this.y0,t=i.y/this.a,this.sphere?(t/=this.C_y,s=s/(this.C_x*(this.m+Math.cos(t))),this.m?t=He((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=He(Math.sin(t)/this.n)),s=b(s+this.long0),t=Fi(t)):(t=Kl(i.y/this.a,this.es,this.en),r=Math.abs(t),r<S?(r=Math.sin(t),e=this.long0+i.x*Math.sqrt(1-this.es*r*r)/(this.a*Math.cos(t)),s=b(e)):r-w<S&&(s=this.long0)),i.x=s,i.y=t,i}var Ty=["Sinusoidal","sinu"],Ny={init:Ey,forward:Iy,inverse:Ly,names:Ty};function Dy(){}function Fy(i){for(var t=i.x,e=i.y,s=b(t-this.long0),r=e,n=Math.PI*Math.sin(e);;){var a=-(r+Math.sin(r)-n)/(1+Math.cos(r));if(r+=a,Math.abs(a)<w)break}r/=2,Math.PI/2-Math.abs(e)<w&&(s=0);var o=.900316316158*this.a*s*Math.cos(r)+this.x0,l=1.4142135623731*this.a*Math.sin(r)+this.y0;return i.x=o,i.y=l,i}function Ry(i){var t,e;i.x-=this.x0,i.y-=this.y0,e=i.y/(1.4142135623731*this.a),Math.abs(e)>.999999999999&&(e=.999999999999),t=Math.asin(e);var s=b(this.long0+i.x/(.900316316158*this.a*Math.cos(t)));s<-Math.PI&&(s=-Math.PI),s>Math.PI&&(s=Math.PI),e=(2*t+Math.sin(2*t))/Math.PI,Math.abs(e)>1&&(e=1);var r=Math.asin(e);return i.x=s,i.y=r,i}var Ay=["Mollweide","moll"],Gy={init:Dy,forward:Fy,inverse:Ry,names:Ay};function ky(){Math.abs(this.lat1+this.lat2)<w||(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=Ns(this.es),this.e1=Ds(this.es),this.e2=Fs(this.es),this.e3=Rs(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=ue(this.e,this.sinphi,this.cosphi),this.ml1=It(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<w?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=ue(this.e,this.sinphi,this.cosphi),this.ml2=It(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=It(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function zy(i){var t=i.x,e=i.y,s;if(this.sphere)s=this.a*(this.g-e);else{var r=It(this.e0,this.e1,this.e2,this.e3,e);s=this.a*(this.g-r)}var n=this.ns*b(t-this.long0),a=this.x0+s*Math.sin(n),o=this.y0+this.rh-s*Math.cos(n);return i.x=a,i.y=o,i}function jy(i){i.x-=this.x0,i.y=this.rh-i.y+this.y0;var t,e,s,r;this.ns>=0?(e=Math.sqrt(i.x*i.x+i.y*i.y),t=1):(e=-Math.sqrt(i.x*i.x+i.y*i.y),t=-1);var n=0;if(e!==0&&(n=Math.atan2(t*i.x,t*i.y)),this.sphere)return r=b(this.long0+n/this.ns),s=Fi(this.g-e/this.a),i.x=r,i.y=s,i;var a=this.g-e/this.a;return s=Nr(a,this.e0,this.e1,this.e2,this.e3),r=b(this.long0+n/this.ns),i.x=r,i.y=s,i}var $y=["Equidistant_Conic","eqdc"],Hy={init:ky,forward:zy,inverse:jy,names:$y};function Vy(){this.R=this.a}function By(i){var t=i.x,e=i.y,s=b(t-this.long0),r,n;Math.abs(e)<=w&&(r=this.x0+this.R*s,n=this.y0);var a=He(2*Math.abs(e/Math.PI));(Math.abs(s)<=w||Math.abs(Math.abs(e)-S)<=w)&&(r=this.x0,e>=0?n=this.y0+Math.PI*this.R*Math.tan(.5*a):n=this.y0+Math.PI*this.R*-Math.tan(.5*a));var o=.5*Math.abs(Math.PI/s-s/Math.PI),l=o*o,h=Math.sin(a),c=Math.cos(a),u=c/(h+c-1),d=u*u,f=u*(2/h-1),g=f*f,m=Math.PI*this.R*(o*(u-g)+Math.sqrt(l*(u-g)*(u-g)-(g+l)*(d-g)))/(g+l);s<0&&(m=-m),r=this.x0+m;var p=l+u;return m=Math.PI*this.R*(f*p-o*Math.sqrt((g+l)*(l+1)-p*p))/(g+l),e>=0?n=this.y0+m:n=this.y0-m,i.x=r,i.y=n,i}function Uy(i){var t,e,s,r,n,a,o,l,h,c,u,d,f;return i.x-=this.x0,i.y-=this.y0,u=Math.PI*this.R,s=i.x/u,r=i.y/u,n=s*s+r*r,a=-Math.abs(r)*(1+n),o=a-2*r*r+s*s,l=-2*a+1+2*r*r+n*n,f=r*r/l+(2*o*o*o/l/l/l-9*a*o/l/l)/27,h=(a-o*o/3/l)/l,c=2*Math.sqrt(-h/3),u=3*f/h/c,Math.abs(u)>1&&(u>=0?u=1:u=-1),d=Math.acos(u)/3,i.y>=0?e=(-c*Math.cos(d+Math.PI/3)-o/3/l)*Math.PI:e=-(-c*Math.cos(d+Math.PI/3)-o/3/l)*Math.PI,Math.abs(s)<w?t=this.long0:t=b(this.long0+Math.PI*(n-1+Math.sqrt(1+2*(s*s-r*r)+n*n))/2/s),i.x=t,i.y=e,i}var qy=["Van_der_Grinten_I","VanDerGrinten","vandg"],Wy={init:Vy,forward:By,inverse:Uy,names:qy};function Yy(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function Xy(i){var t=i.x,e=i.y,s=Math.sin(i.y),r=Math.cos(i.y),n=b(t-this.long0),a,o,l,h,c,u,d,f,g,m,p,y,M,x,L,I,D,Y,H,wt,$t,Me,cr;return this.sphere?Math.abs(this.sin_p12-1)<=w?(i.x=this.x0+this.a*(S-e)*Math.sin(n),i.y=this.y0-this.a*(S-e)*Math.cos(n),i):Math.abs(this.sin_p12+1)<=w?(i.x=this.x0+this.a*(S+e)*Math.sin(n),i.y=this.y0+this.a*(S+e)*Math.cos(n),i):(Y=this.sin_p12*s+this.cos_p12*r*Math.cos(n),I=Math.acos(Y),D=I?I/Math.sin(I):1,i.x=this.x0+this.a*D*r*Math.sin(n),i.y=this.y0+this.a*D*(this.cos_p12*s-this.sin_p12*r*Math.cos(n)),i):(a=Ns(this.es),o=Ds(this.es),l=Fs(this.es),h=Rs(this.es),Math.abs(this.sin_p12-1)<=w?(c=this.a*It(a,o,l,h,S),u=this.a*It(a,o,l,h,e),i.x=this.x0+(c-u)*Math.sin(n),i.y=this.y0-(c-u)*Math.cos(n),i):Math.abs(this.sin_p12+1)<=w?(c=this.a*It(a,o,l,h,S),u=this.a*It(a,o,l,h,e),i.x=this.x0+(c+u)*Math.sin(n),i.y=this.y0+(c+u)*Math.cos(n),i):(d=s/r,f=Di(this.a,this.e,this.sin_p12),g=Di(this.a,this.e,s),m=Math.atan((1-this.es)*d+this.es*f*this.sin_p12/(g*r)),p=Math.atan2(Math.sin(n),this.cos_p12*Math.tan(m)-this.sin_p12*Math.cos(n)),p===0?H=Math.asin(this.cos_p12*Math.sin(m)-this.sin_p12*Math.cos(m)):Math.abs(Math.abs(p)-Math.PI)<=w?H=-Math.asin(this.cos_p12*Math.sin(m)-this.sin_p12*Math.cos(m)):H=Math.asin(Math.sin(n)*Math.cos(m)/Math.sin(p)),y=this.e*this.sin_p12/Math.sqrt(1-this.es),M=this.e*this.cos_p12*Math.cos(p)/Math.sqrt(1-this.es),x=y*M,L=M*M,wt=H*H,$t=wt*H,Me=$t*H,cr=Me*H,I=f*H*(1-wt*L*(1-L)/6+$t/8*x*(1-2*L)+Me/120*(L*(4-7*L)-3*y*y*(1-7*L))-cr/48*x),i.x=this.x0+I*Math.sin(p),i.y=this.y0+I*Math.cos(p),i))}function Zy(i){i.x-=this.x0,i.y-=this.y0;var t,e,s,r,n,a,o,l,h,c,u,d,f,g,m,p,y,M,x,L,I,D,Y,H;return this.sphere?(t=Math.sqrt(i.x*i.x+i.y*i.y),t>2*S*this.a?void 0:(e=t/this.a,s=Math.sin(e),r=Math.cos(e),n=this.long0,Math.abs(t)<=w?a=this.lat0:(a=He(r*this.sin_p12+i.y*s*this.cos_p12/t),o=Math.abs(this.lat0)-S,Math.abs(o)<=w?this.lat0>=0?n=b(this.long0+Math.atan2(i.x,-i.y)):n=b(this.long0-Math.atan2(-i.x,i.y)):n=b(this.long0+Math.atan2(i.x*s,t*this.cos_p12*r-i.y*this.sin_p12*s))),i.x=n,i.y=a,i)):(l=Ns(this.es),h=Ds(this.es),c=Fs(this.es),u=Rs(this.es),Math.abs(this.sin_p12-1)<=w?(d=this.a*It(l,h,c,u,S),t=Math.sqrt(i.x*i.x+i.y*i.y),f=d-t,a=Nr(f/this.a,l,h,c,u),n=b(this.long0+Math.atan2(i.x,-1*i.y)),i.x=n,i.y=a,i):Math.abs(this.sin_p12+1)<=w?(d=this.a*It(l,h,c,u,S),t=Math.sqrt(i.x*i.x+i.y*i.y),f=t-d,a=Nr(f/this.a,l,h,c,u),n=b(this.long0+Math.atan2(i.x,i.y)),i.x=n,i.y=a,i):(t=Math.sqrt(i.x*i.x+i.y*i.y),p=Math.atan2(i.x,i.y),g=Di(this.a,this.e,this.sin_p12),y=Math.cos(p),M=this.e*this.cos_p12*y,x=-M*M/(1-this.es),L=3*this.es*(1-x)*this.sin_p12*this.cos_p12*y/(1-this.es),I=t/g,D=I-x*(1+x)*Math.pow(I,3)/6-L*(1+3*x)*Math.pow(I,4)/24,Y=1-x*D*D/2-I*D*D*D/6,m=Math.asin(this.sin_p12*Math.cos(D)+this.cos_p12*Math.sin(D)*y),n=b(this.long0+Math.asin(Math.sin(p)*Math.sin(D)/Math.cos(m))),H=Math.sin(m),a=Math.atan2((H-this.es*Y*this.sin_p12)*Math.tan(m),H*(1-this.es)),i.x=n,i.y=a,i))}var Jy=["Azimuthal_Equidistant","aeqd"],Ky={init:Yy,forward:Xy,inverse:Zy,names:Jy};function Qy(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function t0(i){var t,e,s,r,n,a,o,l,h=i.x,c=i.y;return s=b(h-this.long0),t=Math.sin(c),e=Math.cos(c),r=Math.cos(s),a=this.sin_p14*t+this.cos_p14*e*r,n=1,(a>0||Math.abs(a)<=w)&&(o=this.a*n*e*Math.sin(s),l=this.y0+this.a*n*(this.cos_p14*t-this.sin_p14*e*r)),i.x=o,i.y=l,i}function e0(i){var t,e,s,r,n,a,o;return i.x-=this.x0,i.y-=this.y0,t=Math.sqrt(i.x*i.x+i.y*i.y),e=He(t/this.a),s=Math.sin(e),r=Math.cos(e),a=this.long0,Math.abs(t)<=w?(o=this.lat0,i.x=a,i.y=o,i):(o=He(r*this.sin_p14+i.y*s*this.cos_p14/t),n=Math.abs(this.lat0)-S,Math.abs(n)<=w?(this.lat0>=0?a=b(this.long0+Math.atan2(i.x,-i.y)):a=b(this.long0-Math.atan2(-i.x,i.y)),i.x=a,i.y=o,i):(a=b(this.long0+Math.atan2(i.x*s,t*this.cos_p14*r-i.y*this.sin_p14*s)),i.x=a,i.y=o,i))}var i0=["ortho"],s0={init:Qy,forward:t0,inverse:e0,names:i0},J={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},$={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function r0(){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>=S-j/2?this.face=J.TOP:this.lat0<=-(S-j/2)?this.face=J.BOTTOM:Math.abs(this.long0)<=j?this.face=J.FRONT:Math.abs(this.long0)<=S+j?this.face=this.long0>0?J.RIGHT:J.LEFT:this.face=J.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 n0(i){var t={x:0,y:0},e,s,r,n,a,o,l={value:0};if(i.x-=this.long0,this.es!==0?e=Math.atan(this.one_minus_f_squared*Math.tan(i.y)):e=i.y,s=i.x,this.face===J.TOP)n=S-e,s>=j&&s<=S+j?(l.value=$.AREA_0,r=s-S):s>S+j||s<=-(S+j)?(l.value=$.AREA_1,r=s>0?s-nt:s+nt):s>-(S+j)&&s<=-j?(l.value=$.AREA_2,r=s+S):(l.value=$.AREA_3,r=s);else if(this.face===J.BOTTOM)n=S+e,s>=j&&s<=S+j?(l.value=$.AREA_0,r=-s+S):s<j&&s>=-j?(l.value=$.AREA_1,r=-s):s<-j&&s>=-(S+j)?(l.value=$.AREA_2,r=-s-S):(l.value=$.AREA_3,r=s>0?-s+nt:-s-nt);else{var h,c,u,d,f,g,m;this.face===J.RIGHT?s=Ri(s,+S):this.face===J.BACK?s=Ri(s,+nt):this.face===J.LEFT&&(s=Ri(s,-S)),d=Math.sin(e),f=Math.cos(e),g=Math.sin(s),m=Math.cos(s),h=f*m,c=f*g,u=d,this.face===J.FRONT?(n=Math.acos(h),r=Dr(n,u,c,l)):this.face===J.RIGHT?(n=Math.acos(c),r=Dr(n,u,-h,l)):this.face===J.BACK?(n=Math.acos(-h),r=Dr(n,u,-c,l)):this.face===J.LEFT?(n=Math.acos(-c),r=Dr(n,u,h,l)):(n=r=0,l.value=$.AREA_0)}return o=Math.atan(12/nt*(r+Math.acos(Math.sin(r)*Math.cos(j))-S)),a=Math.sqrt((1-Math.cos(n))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(r))))),l.value===$.AREA_1?o+=S:l.value===$.AREA_2?o+=nt:l.value===$.AREA_3&&(o+=1.5*nt),t.x=a*Math.cos(o),t.y=a*Math.sin(o),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,i.x=t.x,i.y=t.y,i}function a0(i){var t={lam:0,phi:0},e,s,r,n,a,o,l,h,c,u={value:0};if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,s=Math.atan(Math.sqrt(i.x*i.x+i.y*i.y)),e=Math.atan2(i.y,i.x),i.x>=0&&i.x>=Math.abs(i.y)?u.value=$.AREA_0:i.y>=0&&i.y>=Math.abs(i.x)?(u.value=$.AREA_1,e-=S):i.x<0&&-i.x>=Math.abs(i.y)?(u.value=$.AREA_2,e=e<0?e+nt:e-nt):(u.value=$.AREA_3,e+=S),c=nt/12*Math.tan(e),a=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(a),r=Math.cos(e),n=Math.tan(s),l=1-r*r*n*n*(1-Math.cos(Math.atan(1/Math.cos(o)))),l<-1?l=-1:l>1&&(l=1),this.face===J.TOP)h=Math.acos(l),t.phi=S-h,u.value===$.AREA_0?t.lam=o+S:u.value===$.AREA_1?t.lam=o<0?o+nt:o-nt:u.value===$.AREA_2?t.lam=o-S:t.lam=o;else if(this.face===J.BOTTOM)h=Math.acos(l),t.phi=h-S,u.value===$.AREA_0?t.lam=-o+S:u.value===$.AREA_1?t.lam=-o:u.value===$.AREA_2?t.lam=-o-S:t.lam=o<0?-o-nt:-o+nt;else{var d,f,g;d=l,c=d*d,c>=1?g=0:g=Math.sqrt(1-c)*Math.sin(o),c+=g*g,c>=1?f=0:f=Math.sqrt(1-c),u.value===$.AREA_1?(c=f,f=-g,g=c):u.value===$.AREA_2?(f=-f,g=-g):u.value===$.AREA_3&&(c=f,f=g,g=-c),this.face===J.RIGHT?(c=d,d=-f,f=c):this.face===J.BACK?(d=-d,f=-f):this.face===J.LEFT&&(c=d,d=f,f=-c),t.phi=Math.acos(-g)-S,t.lam=Math.atan2(f,d),this.face===J.RIGHT?t.lam=Ri(t.lam,-S):this.face===J.BACK?t.lam=Ri(t.lam,-nt):this.face===J.LEFT&&(t.lam=Ri(t.lam,+S))}if(this.es!==0){var m,p,y;m=t.phi<0?1:0,p=Math.tan(t.phi),y=this.b/Math.sqrt(p*p+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-y*y)/(this.one_minus_f*y)),m&&(t.phi=-t.phi)}return t.lam+=this.long0,i.x=t.lam,i.y=t.phi,i}function Dr(i,t,e,s){var r;return i<w?(s.value=$.AREA_0,r=0):(r=Math.atan2(t,e),Math.abs(r)<=j?s.value=$.AREA_0:r>j&&r<=S+j?(s.value=$.AREA_1,r-=S):r>S+j||r<=-(S+j)?(s.value=$.AREA_2,r=r>=0?r-nt:r+nt):(s.value=$.AREA_3,r+=S)),r}function Ri(i,t){var e=i+t;return e<-nt?e+=Os:e>+nt&&(e-=Os),e}var o0=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"],l0={init:r0,forward:n0,inverse:a0,names:o0},ha=[[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]],As=[[-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]],ih=.8487,sh=1.3523,rh=ce/5,h0=1/rh,Ai=18,Fr=function(i,t){return i[0]+t*(i[1]+t*(i[2]+t*i[3]))},c0=function(i,t){return i[1]+t*(2*i[2]+t*3*i[3])};function u0(i,t,e,s){for(var r=t;s;--s){var n=i(r);if(r-=n,Math.abs(n)<e)break}return r}function d0(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function f0(i){var t=b(i.x-this.long0),e=Math.abs(i.y),s=Math.floor(e*rh);s<0?s=0:s>=Ai&&(s=Ai-1),e=ce*(e-h0*s);var r={x:Fr(ha[s],e)*t,y:Fr(As[s],e)};return i.y<0&&(r.y=-r.y),r.x=r.x*this.a*ih+this.x0,r.y=r.y*this.a*sh+this.y0,r}function g0(i){var t={x:(i.x-this.x0)/(this.a*ih),y:Math.abs(i.y-this.y0)/(this.a*sh)};if(t.y>=1)t.x/=ha[Ai][0],t.y=i.y<0?-S:S;else{var e=Math.floor(t.y*Ai);for(e<0?e=0:e>=Ai&&(e=Ai-1);;)if(As[e][0]>t.y)--e;else if(As[e+1][0]<=t.y)++e;else break;var s=As[e],r=5*(t.y-s[0])/(As[e+1][0]-s[0]);r=u0(function(n){return(Fr(s,n)-t.y)/c0(s,n)},r,w,100),t.x/=Fr(ha[e],r),t.y=(5*e+r)*_t,i.y<0&&(t.y=-t.y)}return t.x=b(t.x+this.long0),t}var m0=["Robinson","robin"],p0={init:d0,forward:f0,inverse:g0,names:m0};function y0(){this.name="geocent"}function v0(i){var t=Tl(i,this.es,this.a);return t}function _0(i){var t=Nl(i,this.es,this.a,this.b);return t}var S0=["Geocentric","geocentric","geocent","Geocent"],M0={init:y0,forward:v0,inverse:_0,names:S0},xt={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Gs={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 C0(){if(Object.keys(Gs).forEach(function(e){if(typeof this[e]=="undefined")this[e]=Gs[e].def;else{if(Gs[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);Gs[e].num&&(this[e]=parseFloat(this[e]))}Gs[e].degrees&&(this[e]=this[e]*_t)}.bind(this)),Math.abs(Math.abs(this.lat0)-S)<w?this.mode=this.lat0<0?xt.S_POLE:xt.N_POLE:Math.abs(this.lat0)<w?this.mode=xt.EQUIT:(this.mode=xt.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 i=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(i),this.sw=Math.sin(i)}function w0(i){i.x-=this.long0;var t=Math.sin(i.y),e=Math.cos(i.y),s=Math.cos(i.x),r,n;switch(this.mode){case xt.OBLIQ:n=this.sinph0*t+this.cosph0*e*s;break;case xt.EQUIT:n=e*s;break;case xt.S_POLE:n=-t;break;case xt.N_POLE:n=t;break}switch(n=this.pn1/(this.p-n),r=n*e*Math.sin(i.x),this.mode){case xt.OBLIQ:n*=this.cosph0*t-this.sinph0*e*s;break;case xt.EQUIT:n*=t;break;case xt.N_POLE:n*=-(e*s);break;case xt.S_POLE:n*=e*s;break}var a,o;return a=n*this.cg+r*this.sg,o=1/(a*this.sw*this.h1+this.cw),r=(r*this.cg-n*this.sg)*this.cw*o,n=a*o,i.x=r*this.a,i.y=n*this.a,i}function x0(i){i.x/=this.a,i.y/=this.a;var t={x:i.x,y:i.y},e,s,r;r=1/(this.pn1-i.y*this.sw),e=this.pn1*i.x*r,s=this.pn1*i.y*this.cw*r,i.x=e*this.cg+s*this.sg,i.y=s*this.cg-e*this.sg;var n=Lr(i.x,i.y);if(Math.abs(n)<w)t.x=0,t.y=i.y;else{var a,o;switch(o=1-n*n*this.pfact,o=(this.p-Math.sqrt(o))/(this.pn1/n+n/this.pn1),a=Math.sqrt(1-o*o),this.mode){case xt.OBLIQ:t.y=Math.asin(a*this.sinph0+i.y*o*this.cosph0/n),i.y=(a-this.sinph0*Math.sin(t.y))*n,i.x*=o*this.cosph0;break;case xt.EQUIT:t.y=Math.asin(i.y*o/n),i.y=a*n,i.x*=o;break;case xt.N_POLE:t.y=Math.asin(a),i.y=-i.y;break;case xt.S_POLE:t.y=-Math.asin(a);break}t.x=Math.atan2(i.x,i.y)}return i.x=t.x+this.long0,i.y=t.y,i}var b0=["Tilted_Perspective","tpers"],O0={init:C0,forward:w0,inverse:x0,names:b0};function P0(i){i.Proj.projections.add(Ir),i.Proj.projections.add(Tr),i.Proj.projections.add(km),i.Proj.projections.add(Ym),i.Proj.projections.add(tp),i.Proj.projections.add(np),i.Proj.projections.add(up),i.Proj.projections.add(pp),i.Proj.projections.add(Mp),i.Proj.projections.add(Op),i.Proj.projections.add(Vp),i.Proj.projections.add(Xp),i.Proj.projections.add(ty),i.Proj.projections.add(ay),i.Proj.projections.add(uy),i.Proj.projections.add(py),i.Proj.projections.add(My),i.Proj.projections.add(Oy),i.Proj.projections.add(Ny),i.Proj.projections.add(Gy),i.Proj.projections.add(Hy),i.Proj.projections.add(Wy),i.Proj.projections.add(Ky),i.Proj.projections.add(s0),i.Proj.projections.add(l0),i.Proj.projections.add(p0),i.Proj.projections.add(M0),i.Proj.projections.add(O0)}ct.defaultDatum="WGS84",ct.Proj=de,ct.WGS84=new ct.Proj("WGS84"),ct.Point=Ti,ct.toPoint=Al,ct.defs=Et,ct.nadgrid=jg,ct.transform=Pr,ct.mgrs=im,ct.version="__VERSION__",P0(ct);const ks=dt("EPSG:4326","EPSG:3857"),ca=dt("EPSG:3857","EPSG:4326");let ua={epsg:"EPSG:4326"};function da(i,t="EPSG:"){const e=new RegExp(`^(?:${t})?(\\d+)`,"i"),s=`${i}`.match(e);return s&&s[1]?`${t}${s[1]}`:""}function nh(i){let t=null;if(i.epsg)try{t=ct(da(i.epsg))}catch{t=null}if(i.proj4)try{t=ct(i.proj4)}catch{t=null}return t!=null}function ah(i){const t={prefix:i.prefix};return i.epsg&&(t.epsg=da(i.epsg,i.prefix),t.epsg&&(i.proj4&&(t.proj4=i.proj4,ct.defs(t.epsg,i.proj4),Ao(ct)),i.alias&&Array.isArray(i.alias)&&(t.alias=i.alias,t.alias.forEach(e=>{ct.defs(e,ct.defs(t.epsg)),Ao(ct)})))),t}function oh(i){if(v(i,{epsg:[String,Number],proj4:[String,void 0,null]}),!nh(i))throw new Error("Cannot set invalid projection options as default options");ua=ah(i)}class T{static get className(){return"Projection"}constructor(t={epsg:""}){const e=ah(t);this._proj4=e.proj4,this._epsg=e.epsg,this.proj||(this._epsg=T.parseEPSGCode(ua.epsg)),this._alias=e.alias,this._prefix=e.prefix}get epsg(){return this._epsg}get proj4(){return this._proj4}get proj(){return hd(this.epsg)}equals(t){return cd(this.proj,t.proj)}static transform(t,e,s){const r=dt(e.proj,t.proj),n=new Array(2);return r([s[0],s[1]],n,2),s.length>2&&n.push(s[2]),n}transformTo(t,e){return T.transform(t,this,e)}static transformCoordinates(t,e,s){const r=[];for(let n=0;n<s.length;n++)r.push(T.transform(t,e,s[n]));return r}static getTransformer(t,e){return dt(e.proj,t.proj)}transformFrom(t,e){return T.transform(this,t,e)}toJSON(){const t={type:T.className,epsg:this.epsg};return this.proj4&&(t.proj4=this.proj4),Array.isArray(this._alias)&&this._alias.length>0&&(t.alias=this._alias.slice()),this._prefix&&(t.prefix=this._prefix),t}static mercatorToWgs84(t,e){return ca(t,e?t:void 0,t.length)}static wgs84ToMercator(t,e){return ks(t,e?t:void 0,t.length)}static validateOptions(t){return nh(t)}static parseEPSGCode(t,e="EPSG:"){return da(t,e)}}function lh(){return new T(ua)}const B=new T({epsg:4326}),F=new T({epsg:3857});class re{static get className(){return"VcsObject"}constructor(t){this.name=t.name||Xt(),this.properties=t.properties||{}}get className(){return this.constructor.className}getLogger(){return Pt(this.className)}toJSON(){const t={type:this.className,name:this.name};return Object.keys(this.properties).length>0&&(t.properties=_({},this.properties)),t}destroy(){this.isDestroyed=!0,this.properties={}}}function hh(i){return!i||!Array.isArray(i)||i.length!==4||!Number.isFinite(i[0])||!Number.isFinite(i[1])||!Number.isFinite(i[2])||!Number.isFinite(i[3])?!1:i[0]<=i[2]&&i[1]<=i[3]}class pt{static get className(){return"Extent"}constructor(t={}){this.projection=new T(t.projection),this.extent=t.coordinates||this.projection.proj.getExtent()}getCoordinatesInProjection(t,e){if(t.epsg===this.projection.epsg)return e?e.splice(0,4,...this.extent):this.extent.slice();const s=T.getTransformer(t,this.projection),r=e||[];return s(this.extent,r,2),r}isValid(){return hh(this.extent)}toJSON(){return{coordinates:this.extent.slice(),projection:this.projection.toJSON(),type:pt.className}}clone(){return new pt(this.toJSON())}equals(t){return this===t?!0:this.isValid()&&t.isValid()&&this.extent.every((e,s)=>e===t.extent[s])&&this.projection.equals(t.projection)}static validateOptions(t){return T.validateOptions(t.projection||{})&&hh(t.coordinates)}static get WGS_84_EXTENT(){return[-180,-90,180,90]}}function fa(i,t,e){return Math.abs(i-t)<=e}function Rr(i,t,e){const s=i-t-Math.trunc((i-t)/360)*360;return Math.abs(s)<=e}function ga(i,t,e){return i!==null&&t!==null&&i.every((s,r)=>fa(s,t[r],e))}class oe extends re{static get className(){return"ViewPoint"}constructor(t){super(t);this.cameraPosition=null,Array.isArray(t.cameraPosition)&&t.cameraPosition.length===3&&(this.cameraPosition=t.cameraPosition.map(e=>Number(e))),this.groundPosition=null,Array.isArray(t.groundPosition)&&(this.groundPosition=t.groundPosition.map(e=>Number(e))),this.distance=E(t.distance,this.cameraPosition?this.cameraPosition[2]:1e3),this.heading=E(t.heading,0),this.pitch=E(t.pitch,-90),this.roll=E(t.roll,0),this.animate=rt(t.animate,!1),this.duration=t.duration||null,this.easingFunctionName=t.easingFunctionName||null}get easingFunction(){return this.easingFunctionName?Ud[this.easingFunctionName]:null}toJSON(){return O(_({},super.toJSON()),{distance:this.distance,cameraPosition:this.cameraPosition?this.cameraPosition.slice():null,groundPosition:this.groundPosition?this.groundPosition.slice():null,heading:this.heading,pitch:this.pitch,roll:this.roll,animate:this.animate,duration:this.duration,easingFunctionName:this.easingFunctionName})}clone(){return new oe(this.toJSON())}toString(){return`ViewPoint: [Ground:${String(this.groundPosition?this.groundPosition:null)}][Camera:${String(this.cameraPosition?this.cameraPosition:null)}][Distance:${this.distance}][heading:${this.distance}][pitch:${this.distance}][roll:${this.distance}]`}static createViewPointFromExtent(t){const e=t instanceof pt?t.getCoordinatesInProjection(B):t;if(e&&e.length===4){const s=e[0],r=e[1],n=e[2],a=e[3],o=[(n-s)/2+s,(a-r)/2+r];let l=0;const h=Math.max(n-s,a-r);return h<.001?l=400:l=h*3e5,new oe({name:"viewpointFromExtend",distance:l,groundPosition:o,heading:360,pitch:-90,roll:0,animate:!0})}return null}static parseURLparameter(t){let{cameraPosition:e,groundPosition:s}=t;if(e!=null&&(e=e.split(",").map(n=>Number(n))),s!=null&&(s=s.split(",").map(n=>Number(n))),t.epsg!=null){const{epsg:n,proj4:a}=t,o=new T({epsg:n,proj4:a}),l=B;s&&(s=T.transform(l,o,s)),e&&(e=T.transform(l,o,e))}const r={cameraPosition:e,groundPosition:s,distance:Number(t.distance),pitch:Number(t.pitch),heading:Number(t.heading),roll:Number(t.roll)};return new oe(r)}isValid(){const t=this.cameraPosition&&Array.isArray(this.cameraPosition)&&this.cameraPosition.length===3&&this.cameraPosition.every(s=>Number.isFinite(s));return!(!(this.groundPosition&&Array.isArray(this.groundPosition)&&this.groundPosition.length>1&&this.groundPosition.length<4&&this.groundPosition.every(s=>Number.isFinite(s)))&&!t||!t&&!Number.isFinite(this.distance)||!Number.isFinite(this.heading)||!Number.isFinite(this.pitch)||!Number.isFinite(this.roll))}equals(t,e=0){return t===this||t!==null&&fa(t.distance,this.distance,e)&&Rr(t.heading,this.heading,e)&&Rr(t.pitch,this.pitch,e)&&Rr(t.roll,this.roll,e)&&(ga(t.cameraPosition,this.cameraPosition,e)||ga(t.groundPosition,this.groundPosition,e))}}class R{constructor(){this._listeners=new Set}get numberOfListeners(){return this._listeners.size}addEventListener(t){return this._listeners.add(t),()=>{this.removeEventListener(t)}}removeEventListener(t){return this._listeners.has(t)?(this._listeners.delete(t),!0):!1}raiseEvent(t){[...this._listeners].forEach(e=>{e(t)})}async awaitRaisedEvent(t){const e=new Array(this._listeners.size);let s=0;[...this._listeners].forEach(r=>{e[s]=r(t),s+=1}),await Promise.all(e)}destroy(){this._listeners.clear()}}function E0(){return Pt("OverrideClassRegistry")}class fe{constructor(t){this._coreClassRegistry=t,this._classMap=new Map,this._classShadows=new Map,this.replaced=new R,this.removed=new R}getClassNames(){return[...new Set([...this._classMap.keys(),...this._coreClassRegistry.getClassNames()])]}registerClass(t,e,s){v(t,String),v(e,String),v(s,Function);const r={contextId:t,ctor:s},n=this.hasClass(e);this._classMap.has(e)&&(this._classShadows.has(e)||this._classShadows.set(e,[]),this._classShadows.get(e).push(this._classMap.get(e))),this._classMap.set(e,r),n&&this.replaced.raiseEvent(e)}unregisterClass(t,e){if(v(t,String),v(e,String),this._classShadows.has(e)){const s=this._classShadows.get(e),r=s.filter(n=>n.contextId!==t);r.length===0?this._classShadows.delete(e):r.length!==s.length&&this._classShadows.set(e,r)}this._classMap.has(e)&&this._classMap.get(e).contextId===t&&(this._classMap.delete(e),this._classShadows.has(e)?(this._classMap.set(e,this._classShadows.get(e).pop()),this._classShadows.get(e).length===0&&this._classShadows.delete(e),this.replaced.raiseEvent(e)):this._coreClassRegistry.hasClass(e)?this.replaced.raiseEvent(e):this.removed.raiseEvent(e))}getClass(t){return v(t,String),this._classMap.has(t)?this._classMap.get(t).ctor:this._coreClassRegistry.getClass(t)}hasClass(t){return v(t,String),this._classMap.has(t)||this._coreClassRegistry.hasClass(t)}create(t,...e){v(t,String);const s=this.getClass(t);if(!s){E0().error(`could not find constructor ${t}`);return}return new s(...e)}createFromTypeOptions(t,...e){return v(t,{type:String}),this.create(t.type,t,...e)}removeContext(t){v(t,String),this._classMap.forEach((e,s)=>{this.unregisterClass(t,s)})}destroy(){this._coreClassRegistry=null,this._classMap.clear(),this._classShadows.clear(),this.replaced.destroy(),this.removed.destroy()}}function zs(){return Pt("ClassRegistry")}class be{constructor(){this._classMap=new Map}getClassNames(){return[...this._classMap.keys()]}registerClass(t,e){if(v(t,String),v(e,Function),this._classMap.has(t))throw new Error("a constructor with this className has already been registered");this._classMap.set(t,e)}getClass(t){if(v(t,String),this._classMap.has(t))return this._classMap.get(t)}hasClass(t){return v(t,String),this._classMap.has(t)}create(t,...e){v(t,String);const s=this.getClass(t);if(!s){zs().error(`could not find constructor ${t}`);return}return new s(...e)}createFromTypeOptions(t,...e){return v(t,{type:String}),this.create(t.type,t,...e)}}const ot=new be,si=new be,Ar=new be,ri=new be,Gi=new be,Gr=new be;function ge(i,t,...e){if(!Wn(i,[be,fe]))return zs().error(`ObjectCreation failed: no class registry provided for ${t}`),null;if(!(t==null?void 0:t.type))return zs().warning(`ObjectCreation failed: could not find type in options ${t}`),null;let s;try{s=i.createFromTypeOptions(t,...e)}catch(r){zs().warning(`Error: ${r}`)}return s||(zs().warning("ObjectCreation failed: could not create new Object"),null)}function I0(){return Pt("init")}const Lt=Symbol("contextId");function ma(i,t){const e=ge(i.mapClassRegistry,t);return e&&(e.layerCollection=i.layers),e}function ch(i){const t=new oe(i);return t&&t.isValid()?t:(I0().warning(`Viewpoint ${i.name} is not valid`),null)}function pa(i,t){let e;t.style&&(typeof t.style=="string"?e=i.styles.getByKey(t.style):e=ge(i.styleClassRegistry,t.style));let s;t.tileProvider&&(s=ge(i.tileProviderClassRegistry,t.tileProvider));let r;return t.featureProvider&&(r=ge(i.featureProviderClassRegistry,t.featureProvider)),ge(i.layerClassRegistry,O(_({},t),{style:e,tileProvider:s,featureProvider:r}))}function uh(i,t){var s;const e=t.toJSON();return e.zIndex=t[i.layers.zIndexSymbol],((s=e==null?void 0:e.style)==null?void 0:s.name)&&i.styles.hasKey(e.style.name)&&(e.style=e.style.name),e}function dh(i,t,e){return i.zIndex!==t.zIndex?null:e}function me(i){[...i].forEach(t=>{t.destroy&&!t.isDestroyed&&t.destroy()}),i.destroy()}class ve{static from(t,e){const s=new ve(e);if(t)for(const r of t)s.add(r);return s}constructor(t){this._array=[],this._uniqueKey="name",typeof t=="string"||typeof t=="symbol"?this._uniqueKey=t:t===!1&&(this._uniqueKey=void 0),this.added=new R,this.removed=new R}*[Symbol.iterator](){const t=this._array.length;for(let e=0;e<t;e++)yield this._array[e]}get uniqueKey(){return this._uniqueKey}get size(){return this._array.length}getByKey(t){if(!!this._uniqueKey)return this._array.find(e=>e[this._uniqueKey]===t)}_checkUniqueness(t){if(this._uniqueKey){if(t==null||typeof t!="object")return!1;const e=t[this._uniqueKey];if(e==null||this.getByKey(e)!=null)return!1}return!0}add(t){return this._checkUniqueness(t)?(this._array.push(t),this.added.raiseEvent(t),this._array.length-1):null}_remove(t){const e=this._array.indexOf(t);return e>-1&&this._array.splice(e,1),e}remove(t){this._remove(t)>-1&&this.removed.raiseEvent(t)}has(t){return this._array.includes(t)}hasKey(t){if(!!this._uniqueKey)return this._array.some(e=>e[this._uniqueKey]===t)}clear(){this._array.forEach(t=>{this.removed.raiseEvent(t)}),this._array.splice(0)}destroy(){this._array=[],this.added.destroy(),this.removed.destroy()}}function L0(){return Pt("OverrideCollection")}const kr=Symbol("OverrideCollection");function ni(i,t,e,s,r,n){v(i,ve);const a=i;if(a[kr])throw new Error("Cannot transform collection, collection already is an OverrideCollection");a[kr]=!0;const o=s||(u=>u),l=e||(u=>u.toJSON?u.toJSON():u),h=n||((u,d,f)=>f);a.shadowMap=new Map,a.override=function(d){let f,g;const m=d[a.uniqueKey];if(a.hasKey(m)){f=a.getByKey(m),g=a._remove(f),a.shadowMap.has(m)||a.shadowMap.set(m,[]);const y=a.shadowMap.get(m),M=l(f);f.destroy&&f.destroy(),M[Lt]=f[Lt],y.push(M)}const p=f?h(f,d,g):null;return f&&a.replaced.raiseEvent(d),a.add(d,p)>=0?d:null},a.parseItems=async function(d,f){Array.isArray(d)&&(await Promise.all(d.map(async m=>{const p=await o(m);return!p||r&&!(p instanceof r)?(L0().warning(`Could not load item ${m[a.uniqueKey]} of type ${m.type}`),null):(p[Lt]=f,p)}))).filter(m=>m).forEach(m=>{a.override(m)})},a.removed.addEventListener(async u=>{const d=u[a.uniqueKey];if(a.shadowMap.has(d)){const f=a.shadowMap.get(d).pop();if(f){const g=await o(f);g[Lt]=f[Lt];const m=h(g,u,u[a.previousIndexSymbol]);a.add(g,m)}a.shadowMap.get(d).length===0&&a.shadowMap.delete(d)}}),a.added.addEventListener(u=>{u[Lt]||(u[Lt]=t())}),a.removeContext=async function(d){a.shadowMap.forEach((f,g)=>{const m=f.filter(p=>p[Lt]!==d);m.length===0?a.shadowMap.delete(g):m.length!==f.length&&a.shadowMap.set(g,m)}),await Promise.all([...a].filter(f=>f[Lt]===d).map(async f=>{a.remove(f),f.destroy&&f.destroy()}))},a.replaced=new R,a.serializeContext=function(d){return[...a].map(f=>f[Lt]===d?l(f):a.shadowMap.has(f[a.uniqueKey])?a.shadowMap.get(f[a.uniqueKey]).find(g=>g[Lt]===d):null).filter(f=>f)};const c=a.destroy.bind(a);return a.destroy=function(){c(),a.shadowMap.clear(),a.replaced.destroy()},a}const z=Symbol("vcsLayerName"),K={INACTIVE:1,ACTIVE:2,LOADING:4};let ya;function va(){return ya||(ya=new R),ya}function fh(){return navigator.language?navigator.language.substring(0,2):"en"}let zr;function _a(){return zr||(zr=fh()),zr}function T0(i){typeof i=="string"&&(zr=i,va().raiseEvent(i))}var N0=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Oe=function i(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var s,r,n;if(Array.isArray(t)){if(s=t.length,s!=e.length)return!1;for(r=s;r--!==0;)if(!i(t[r],e[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(n=Object.keys(t),s=n.length,s!==Object.keys(e).length)return!1;for(r=s;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,n[r]))return!1;for(r=s;r--!==0;){var a=n[r];if(!i(t[a],e[a]))return!1}return!0}return t!==t&&e!==e};class ne extends re{static get className(){return"StyleItem"}constructor(t){super(t);this.supportedLayers=[],this.cesiumStyle=new Dn({show:!0}),this.styleChanged=new R,this.colorBlendMode=Kn(t.colorBlendMode,mr,mr.HIGHLIGHT),this._style=null}get style(){return this._style}set style(t){this._style=t}isSupported(t){return this.supportedLayers.length===0||this.supportedLayers.indexOf(t)>-1}toJSON(){const t=super.toJSON();return this.colorBlendMode!==mr.HIGHLIGHT&&(t.colorBlendMode=this.colorBlendMode),t}clone(t){return t}assign(t){return this.properties=JSON.parse(JSON.stringify(t.properties)),this}equals(t){if(this!==t){const e=this.toJSON();delete e.name;const s=t.toJSON();return delete s.name,Oe(e,s)}return!0}_styleChanged(){this.styleChanged.raiseEvent()}destroy(){this.cesiumStyle=null,this.styleChanged.destroy(),super.destroy()}}Gi.registerClass(ne.className,ne);function gh(){return Pt("StyleHelpers")}const Sa={NWSE:1,SWNE:2,DIAGONALCROSS:3,NS:4,WE:5,CROSS:6};function mh(i,t){let e=i.substring(1);return e.length===3&&(e=e.replace(/([\w\d])/g,"$1$1")),[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16),t!=null?t:1]}function Pe(i){const t=i.toBytes();return t[3]/=255,t}function D0(i){return Ot.fromBytes(i[0],i[1],i[2],i[3]*255)}function bt(i,t){if(Array.isArray(i))return i.length===3&&i.push(1),i;if(typeof i=="string"){if(/^#/.test(i))return mh(i);if(/^rgba?\((\d+(,\s?)?){3}((0|1)(\.\d+)?)?\)/.test(i)){const e=i.replace(/^rgba?\(([\s\S]+?)\)/,"$1").replace(/\s/,"").split(",").map(s=>Number(s));return e.length===3&&e.push(1),e}}if(i instanceof CanvasPattern)return[255,255,255,.4];if(t)return t;throw new Error(`Cannot parse color ${i}`)}function ai(i,t){const e=bt(i,t);return Ot.fromBytes(e[0],e[1],e[2],e[3]*255)}function Rt(i){return`rgba(${bt(i).join(",")})`}function ph(i,t){const e=ud,s=t||document.createElement("canvas");(!t||!s.width)&&(s.width=(i.pattern.size||10)*e,s.height=(i.pattern.size||10)*e);const r=s.getContext("2d"),n=s.width;r.fillStyle=Rt(i.color),r.fillRect(0,0,n,n);function a(o,l){r.strokeStyle=Rt(i.pattern.color),r.lineWidth=i.pattern.width,r.lineCap="square",r.beginPath(),r.moveTo(o[0],o[1]),r.lineTo(l[0],l[1]),r.stroke()}switch(i.pattern.type){case 1:a([n/2,n],[n,n/2]),a([0,n/2],[n/2,0]);break;case 2:a([n/2,n],[0,n/2]),a([n,n/2],[n/2,0]);break;case 3:a([n/2,n],[n,n/2]),a([0,n/2],[n/2,0]),a([n/2,n],[0,n/2]),a([n,n/2],[n/2,0]);break;case 4:a([n/2,0],[n/2,n]);break;case 5:a([0,n/2],[n,n/2]);break;case 6:a([n/2,0],[n/2,n]),a([0,n/2],[n,n/2]);break;default:return null}return r.createPattern(s,"repeat")}function Ma(i){function t(e){const s=e.toString(16);return s.length===1?`0${s}`:s}return i.slice(0,3).reduce((e,s)=>`${e}${t(s)}`,"#")}function F0(i){return/^#[0-9a-f]{6}$/.test(i)}function R0(i){if(typeof i!="string")return i;let t=null,e=null,s="normal",r="normal",n="normal",a="normal";return i.split(/\s+/).forEach(o=>{switch(o){case"normal":break;case"italic":case"oblique":s=o;break;case"small-caps":n=o;break;case"bold":case"bolder":case"lighter":case"100":case"200":case"300":case"400":case"500":case"600":case"700":case"800":case"900":r=o;break;default:if(!e){const l=o.split("/");e=l[0],l.length>1&&(a=l[1]);break}t?t=`${t} ${o}`:t=o;break}}),{fontStyle:s,fontVariant:n,fontWeight:r,fontSize:e,lineHeight:a,fontFamily:t}}function yh(i){const t=["fontStyle","fontVariant","fontWeight","fontSize","fontFamily"];let e=null;return Object.entries(i).filter(s=>s[1]!=="normal"&&s[0]!=="lineWeight").sort((s,r)=>{const n=t.indexOf(s[0]),a=t.indexOf(r[0]);return n<a?-1:n>a?1:0}).forEach(s=>{e?e=`${e} ${s[1]}`:e=s[1]}),e||""}function A0(i,t,e,s){const r=s||[0,0],n=i.getImageData(r[0],r[1],e[0],e[1]),{data:a}=n,[o,l,h]=t,c=a.length;for(let u=0;u<c;u+=4)a[u]=o,a[u+1]=l,a[u+2]=h;i.putImageData(n,r[0],r[1])}function jr(i){if(i.getFill()){let t=i.getFill().getColor();try{t=bt(t).slice()}catch(e){gh().warning(e.message)}return{color:t}}}function js(i){let t=i.getColor();if(t)try{t=bt(t).slice()}catch(e){gh().warning(e.message)}return{color:t,width:i.getWidth(),lineDash:i.getLineDash()}}function vh(i){return{font:i.getFont(),fill:jr(i),stroke:i.getStroke()?js(i.getStroke()):void 0,textBaseline:i.getTextBaseline(),offsetY:i.getOffsetY(),offsetX:i.getOffsetX()}}function _h(i){const t=_({},i);return t.fill&&!(t.fill instanceof he)&&(t.fill=new he(t.fill)),t.stroke&&!(t.stroke instanceof ee)&&(t.stroke=new ee(t.stroke)),t.font&&typeof t.font!="string"&&(t.font=yh(t.font)),new wn(t)}function G0(i){const t={font:i.getFont(),textShadow:void 0,color:void 0};if(i.getStroke()){let e=i.getStroke().getWidth();e=e>1?1:e;const s=Ma(bt(i.getStroke().getColor()));t.textShadow=`-${e}px ${e}px 0 ${s},${e}px ${e}px 0 ${s},${e}px -${e}px 0 ${s},-${e}px -${e}px 0 ${s}`}return i.getFill()&&(t.color=Ma(bt(i.getFill().getColor()))),t}const $r=new ft({}),k0=[0,0,0,0],$s=[255,255,255,1],Hr=[0,0,0,1];function Ca(){return{image:{fill:{color:[255,255,255,.4]},stroke:{color:Hr,width:1},radius:5},stroke:{color:[51,153,204,1],width:1.25},fill:{color:[255,255,255,.4]},text:{font:"bold 18px sans-serif",textBaseline:"bottom",offsetY:-15,offsetX:0}}}const z0={olcs_color:Rt($s),olcs_scale:"1.0",olcs_outlineWidth:"0.0",olcs_outlineColor:Rt(Hr),olcs_pointSize:"8.0",olcs_image:null,olcs_font:`'${Ca().text.font}'`,olcs_fontColor:Rt(Hr),olcs_fontOutlineWidth:"1.0",olcs_fontOutlineColor:Rt($s),olcs_labelText:null,olcs_anchorLineColor:Rt($s)};function Q(i,t){const e=`Boolean(\${${i}})===true`,s=t?`color(\${${i}})`:`\${${i}}`;return[[e,s],["true",z0[i]]]}const j0="${attributes} !== undefined && ${attributes} !== null && ${attributes.olcs_extrudedHeight} !== undefined && ${attributes.olcs_extrudedHeight}!==null";function wa(i){return i.fill&&!(i.fill instanceof he)&&(i.fill=new he(i.fill)),i.stroke&&!(i.stroke instanceof ee)&&(i.stroke=new ee(i.stroke)),i.points?new xn(i):new ms(i)}class $0{constructor(){this.shapes=[]}addImage(t){const s=wa(_({},t)).getImage(1);t.src=s.toDataURL(),this.shapes.push(t)}}const Sh=new $0,Mh={fill:new he({color:[255,255,255,1]}),stroke:new ee({color:[0,0,0,1],width:1}),radius:16};[null,{points:3},{points:3,angle:Math.PI},{points:4,angle:Math.PI/4},{points:6}].forEach(i=>{const t=i?Object.assign(i,Mh):Mh;Sh.addImage(t)});const xa={POLYGON:1,POLYLINE:2,POINT:3},Tt=Symbol("VcsVectorStyleItem");class q extends ne{static get className(){return"VectorStyleItem"}constructor(t){super(t);this.validateOptions(t),this.exclude={fill:t.fill===!1,stroke:t.stroke===!1,image:t.image===!1},this._fillOptions=null,this._fill=void 0,this._stroke=t.stroke?new ee(t.stroke):void 0,this._text=void 0,t.text&&(this._text=_h(t.text)),this._label=t.label,this.label=this._label,this._cesiumColor=new Ot,this._image=void 0,t.image&&(this._image=t.image.radius?wa(_({},t.image)):new ps(t.image)),this._style=new ft({image:this._image,stroke:this._stroke,text:this._text}),t.fill?(this._fillOptions=t.fill,this._setFill()):this.updateCesiumStyle()}validateOptions(t){const e=r=>{try{r.color=bt(r.color),v(r.color,[Number]),v(r.color.length,[3,4])}catch(n){this.getLogger().error(n.message),r.color=[255,255,255,.4]}},s=r=>{e(r),r.width||(this.getLogger().error("missing width for stroke, setting to 1.5"),r.width=1.5)};t.fill&&(e(t.fill),t.fill.pattern&&(s(t.fill.pattern),t.fill.pattern.type&&Object.values(Sa).includes(t.fill.pattern.type)||(this.getLogger().error(`Cannot find pattern ${t.fill.pattern.type}`),t.fill.pattern.type=Sa.NWSE))),t.stroke&&s(t.stroke),t.image&&(t.image.icon?t.image=t.image.icon:t.image.circle&&(t.image=t.image.circle),t.image.src||t.image.radius||(this.getLogger().error("missing source or label in style, setting default circle"),t.image={fill:{color:"rgba(255,255,255,0.4)"},stroke:{color:"#3399CC",width:1},radius:5}),t.image.radius&&(t.image.radius=Number(t.image.radius),Number.isFinite(t.image.radius)||(this.getLogger().error("radius must be a number"),t.image.radius=5),t.image.fill&&e(t.image.fill),t.image.stroke&&s(t.image.stroke)))}get fillColor(){return this._fillOptions?this._fillOptions.color:null}get cesiumFillColor(){const t=this.fillColor?this.fillColor.slice():null;return t?(t[3]=t[3]||1,t[3]*=255,Ot.fromBytes(...t,this._cesiumColor)):Ot.RED.clone(this._cesiumColor)}set fillColor(t){this.exclude.fill=!1,this._style instanceof ft?t?(this._fillOptions?this._fillOptions.color=bt(t):this._fillOptions={color:bt(t)},this._setFill()):(this._fillOptions=null,this._fill=void 0,this._style.setFill(this._fill),this.updateCesiumStyleColor(!0)):this.getLogger().info("trying to set fill on a style function")}get pattern(){return this._fillOptions&&this._fillOptions.pattern?this._fillOptions.pattern:null}set pattern(t){if(!this._fillOptions){this.getLogger().error("Missing fill color");return}t?(it(t,{color:[String,[Number]],width:Number,type:Number,size:[Number,void 0,null]},!0),this._fillOptions.pattern=t):this._fillOptions.pattern=void 0,this._setFill()}get stroke(){return this._stroke}set stroke(t){this.exclude.stroke=!1,this._style instanceof ft?(it(t,ee),this._style.setStroke(t),this._stroke=t,this.updateCesiumStyleColor(!0)):this.getLogger().info("trying to set stroke on a style function")}get label(){return this._label}set label(t){it(t,String),t?this._label=t:this._label=void 0,this._text&&this._text.setText(t)}get text(){return this._text}set text(t){this._style instanceof ft?(it(t,wn),this._text=t,this._text.setText(this._label),this._style.setText(this._text)):this.getLogger().info("trying to set text on a style function")}get image(){return this._image}set image(t){this.exclude.image=!1,this._style instanceof ft?(it(t,dd),this._image=t,this._style.setImage(this._image),this.updateCesiumStyle()):this.getLogger().info("trying to set text on a style function")}get style(){return this._style}set style(t){it(t,[ft,Function]),t instanceof ft?(this._stroke=t.getStroke(),this._fill=t.getFill(),this._text=t.getText(),this._image=t.getImage()):(this._stroke=void 0,this._fill=void 0,this._text=void 0,this._image=void 0),this._style=t,this._fill&&this._fill.getColor()&&(this._fillOptions={color:bt(this._fill.getColor())}),this._text&&this._text.setText(this._label),this.updateCesiumStyle()}_setFill(){if(this._style instanceof ft){const t=this._fillOptions.pattern?ph(this._fillOptions):this._fillOptions.color;this._fill?this._fill.setColor(t):(this._fill=new he({color:t}),this._style.setFill(this._fill)),this._fillOptions.pattern&&(this._fill.fallBackColor=this._fillOptions.color),this.updateCesiumStyle()}}updateCesiumStyle(){this.updateCesiumStyleColor(!0),this.updateCesiumStyleImage(!0),this.updateCesiumStyleText(!0),this._styleChanged()}updateCesiumStyleColor(t){const e=Q("olcs_color",!0);this.stroke&&this.stroke.getColor()&&e.splice(1,0,[`\${olcs_geometryType}===${xa.POLYLINE}`,Rt(this.stroke.getColor())]),this._image instanceof ms&&this._image.getFill()&&e.splice(1,0,[`\${olcs_geometryType}===${xa.POINT}`,Rt(this._image.getFill().getColor())]),this.fillColor&&e.splice(-1,1,["true",Rt(this.fillColor)]),this.cesiumStyle.color={conditions:e},t||this._styleChanged()}updateCesiumStyleImage(t){const e=Q("olcs_scale"),s=Q("olcs_outlineWidth"),r=Q("olcs_outlineColor",!0),n=Q("olcs_pointSize"),a=Q("olcs_image");if(this._image)if(this._image.getScale()!=null&&e.splice(1,1,["true",`${this._image.getScale()}`]),this._image instanceof ms){const o=this._image.getStroke();let l=this._image.getRadius()*2;if(o){this._image.getStroke().getColor()&&r.splice(1,1,["true",Rt(this._image.getStroke().getColor())]);const h=this._image.getStroke().getWidth();s.splice(1,1,["true",`${h}`]),l-=h}n.splice(1,1,["true",`${l}`])}else if(this._image instanceof xn){const o=this._image.getImage(1).toDataURL();a.splice(1,1,["true",`"${o}"`])}else this._image instanceof ps&&a.splice(1,1,["true",`"${this._image.getSrc()}"`]);this.cesiumStyle.scale={conditions:e},this.cesiumStyle.pointOutlineWidth={conditions:s},this.cesiumStyle.pointOutlineColor={conditions:r},this.cesiumStyle.pointSize={conditions:n},this.cesiumStyle.image={conditions:a},this.cesiumStyle.verticalOrigin="1",this.cesiumStyle.horizontalOrigin="0",t||this._styleChanged()}updateCesiumStyleText(t){const e=Q("olcs_font"),s=Q("olcs_labelText"),r=Q("olcs_fontColor",!0),n=Q("olcs_fontOutlineWidth"),a=Q("olcs_fontOutlineColor",!0);this._text&&(this._text.getFont()&&e.splice(1,1,["true",`'${this._text.getFont()}'`]),this._text.getText()&&s.splice(1,1,["true",`'${this._text.getText()}'`]),this._text.getFill()&&this._text.getFill().getColor()&&r.splice(1,1,["true",Rt(this._text.getFill().getColor())]),this._text.getStroke()&&this._text.getStroke().getColor()&&(a.splice(1,1,["true",Rt(this._text.getStroke().getColor())]),n.splice(1,1,["true",`${this._text.getStroke().getWidth()||1.25}`]))),this.cesiumStyle.font={conditions:e},this.cesiumStyle.labelText={conditions:s},this.cesiumStyle.labelColor={conditions:r},this.cesiumStyle.labelOutlineWidth={conditions:n},this.cesiumStyle.labelOutlineColor={conditions:a},this.cesiumStyle.labelStyle="Boolean(${olcs_fontOutlineWidth}) === true ? 2 : 0",this.cesiumStyle.labelHorizontalOrigin="0";let o=Bt.CENTER;if(this._text)switch(this._text.getTextBaseline()){case"top":o=Bt.TOP;break;case"middle":o=Bt.CENTER;break;case"bottom":o=Bt.BOTTOM;break;case"alphabetic":o=Bt.TOP;break;case"hanging":o=Bt.BOTTOM;break}this.cesiumStyle.labelVerticalOrigin=o,t||this._styleChanged()}clone(t){if(t)return t.style=this._style instanceof ft?this._style.clone():this._style,this._fillOptions&&this._fillOptions.color&&(t.fillColor=this._fillOptions.color.slice(),this._fillOptions.pattern&&(t.pattern=_({},this._fillOptions.pattern))),Object.keys(this.exclude).forEach(s=>{this.exclude[s]&&t.unset(s)}),t;const e=this.toJSON();return delete e.name,new q(e)}assign(t){return super.assign(t),t.fillColor&&(this.fillColor=t.fillColor.slice()),t.pattern?this.pattern=_({},t.pattern):this.pattern=void 0,t.stroke&&(this.stroke=t.stroke.clone()),t.image&&(this.image=t.image.clone()),t.text&&(this.text=t.text.clone()),t.label&&(this.label=t.label),Object.keys(t.exclude).forEach(e=>{t.exclude[e]&&this.unset(e)}),this}toJSON(){const t=super.toJSON();return this._fillOptions?(t.fill={color:bt(this._fillOptions.color).slice()},this._fillOptions.pattern&&(t.fill.pattern=_({},this._fillOptions.pattern))):this.exclude.fill&&(t.fill=!1),this._stroke?t.stroke=js(this._stroke):this.exclude.stroke&&(t.stroke=!1),this._text&&(t.text=vh(this._text)),this._label&&(t.label=this._label),this._image instanceof ps?t.image={src:this._image.getSrc(),scale:this._image.getScale(),opacity:this._image.getOpacity()}:this._image instanceof ms?t.image={scale:this._image.getScale(),fill:jr(this._image),radius:this._image.getRadius(),stroke:this._image.getStroke()?js(this._image.getStroke()):void 0}:this._image instanceof xn?t.image={scale:this._image.getScale(),fill:jr(this._image),points:this._image.getPoints(),angle:this._image.getAngle(),radius:this._image.getRadius(),stroke:this._image.getStroke()?js(this._image.getStroke()):void 0}:this.exclude.image&&(t.image=!1),t}getOptionsForFeature(t){const e=t.getGeometry().getType(),s=t.get("olcs_extrudedHeight")||t.get("olcs_storeyHeight")&&t.get("olcs_storeyNumber"),r=new Set;e==="Point"||e==="MultiPoint"?(t[Tt].label!=null&&(r.add("text"),r.add("label")),r.add("image"),s&&r.add("stroke")):e==="LineString"||e==="MultiLineString"?(r.add("stroke"),s&&r.add("fill")):e==="Polygon"||e==="MultiPolygon"||e==="Circle"?(r.add("stroke"),r.add("fill")):e==="GeometryCollection"&&(r.add("stroke"),r.add("fill"),r.add("image"),r.add("text"));const n=this.toJSON(),a={};return r.forEach(o=>{a[o]=n[o]}),a}unset(t){v(t,Object.keys(this.exclude)),t==="fill"?this.fillColor=void 0:this[t]=void 0,this.exclude[t]=!0}destroy(){this._image=null,this._stroke=null,this._fill=null,this._label=null,this._text=null,this._style=null,super.destroy()}}const oi=new q(Ca());Gi.registerClass(q.className,q);function Ch(i){const t=i.toBytes();return t[3]/=255,new q({fill:{color:t},stroke:{color:t,width:oi.stroke.getWidth()}})}const pe=Symbol("originalStyle"),Nt=Symbol("highlighted"),At=Symbol("hidden"),Gt=Symbol("globalHidden");function ki(i){return i&&i.content&&!i.content.isDestroyed()&&!i.content.batchTable.isDestroyed()}function ba(i){(i instanceof Ge||i instanceof Ae)&&ki(i)||i instanceof Fn?i.show=!1:i instanceof Z&&i.setStyle($r.clone())}function Vr(i){Reflect.has(i,pe)||((i instanceof Ge||i instanceof Ae)&&ki(i)?i[pe]=i.color.clone():i instanceof Z&&(i[pe]=i.getStyle()))}function wh(i){if(!(i[Gt]||i[At]||i[Nt])){const t=i[pe];(i instanceof Ge||i instanceof Ae)&&ki(i)?i.color=t:i instanceof Z&&i.setStyle(t),delete i[pe]}}function Br(i){if(!(i[Gt]||i[At])){const t=i[Nt];(i instanceof Ge||i instanceof Ae)&&ki(i)?i.color=t.cesiumFillColor:i instanceof Z&&i.setStyle(t.style)}}function Oa(i){delete i[pe],Vr(i),i[At]||i[Gt]?ba(i):i[Nt]&&Br(i)}function H0(i){delete i[Nt],wh(i)}function xh(i,t){delete i[t],i[At]||i[Gt]||(((i instanceof Ge||i instanceof Ae)&&ki(i)||i instanceof Fn)&&(i.show=!0),i[Nt]?Br(i):wh(i))}const W={HIGHLIGHT:1,UNHIGHLIGHT:2,HIDE:3,SHOW:4};function bh(i,t){function e({action:n,ids:a}){if(n===W.HIGHLIGHT){const o={};a.forEach(l=>{o[l]=i.highlightedObjects[l].style}),t.highlight(o)}else n===W.UNHIGHLIGHT?t.unHighlight(a):n===W.HIDE?t.hideObjects(a):n===W.SHOW&&t.showObjects(a)}const s=Object.keys(i.highlightedObjects);s.length>0&&e({action:W.HIGHLIGHT,ids:s});const r=Object.keys(i.hiddenObjects);return r.length>0&&e({action:W.HIDE,ids:r}),i.changed.addEventListener(e)}class Ur{constructor(){this.hiddenObjects={},this.highlightedObjects={},this.lastUpdated=Date.now(),this.changed=new R}highlight(t){const e=[];Object.entries(t).forEach(([s,r])=>{let n=r;r instanceof Ot?n=Ch(r):r instanceof ft&&(n=new q({}),r.getText()&&r.getText().getText()&&!Array.isArray(r.getText().getText())&&(n.label=String(r.getText().getText())),n.style=r),n=n,this.highlightedObjects[s]?this.highlightedObjects[s].style!==n&&(this.highlightedObjects[s].style=n,this.highlightedObjects[s].features.forEach((a,o)=>{o[Nt]=n,Br(o)})):(this.highlightedObjects[s]={style:n,features:new Set},e.push(s))}),e.length>0&&(this.lastUpdated=Date.now(),this.changed.raiseEvent({action:W.HIGHLIGHT,ids:e}))}unHighlight(t){const e=[];t.forEach(s=>{this.highlightedObjects[s]&&(this.highlightedObjects[s].features.forEach(r=>{H0(r)}),delete this.highlightedObjects[s],e.push(s))}),e.length>0&&this.changed.raiseEvent({action:W.UNHIGHLIGHT,ids:e})}clearHighlighting(){this.unHighlight(Object.keys(this.highlightedObjects))}hasHighlightFeature(t,e){return this.highlightedObjects[t]&&this.highlightedObjects[t].features.has(e)}addHighlightFeature(t,e){this.highlightedObjects[t]&&(Vr(e),this.highlightedObjects[t].features.add(e),e[Nt]=this.highlightedObjects[t].style,Br(e))}hideObjects(t){const e=[];t.forEach(s=>{this.hiddenObjects[s]||(this.hiddenObjects[s]=new Set,e.push(s))}),e.length>0&&(this.lastUpdated=Date.now(),this.changed.raiseEvent({action:W.HIDE,ids:e}))}showObjects(t){const e=[];t.forEach(s=>{this.hiddenObjects[s]&&(this.hiddenObjects[s].forEach(r=>{xh(r,At)}),delete this.hiddenObjects[s],e.push(s))}),e.length>0&&this.changed.raiseEvent({action:W.SHOW,ids:e})}clearHiddenObjects(){this.showObjects(Object.keys(this.hiddenObjects))}hasHiddenFeature(t,e){return this.hiddenObjects[t]&&this.hiddenObjects[t].has(e)}addHiddenFeature(t,e){this.hiddenObjects[t]&&(Vr(e),this.hiddenObjects[t].add(e),e[At]=!0,ba(e))}destroy(){Object.values(this.hiddenObjects).forEach(t=>{t.clear()}),this.hiddenObjects={},Object.values(this.highlightedObjects).forEach(({features:t})=>{t.clear()}),this.highlightedObjects={},this.changed.destroy()}}class qr{constructor(){this.hiddenObjects={},this._hiddenObjectFeatures={},this.lastUpdated=Date.now(),this.changed=new R}hideObjects(t){v(t,[String]);const e=[];t.forEach(s=>{this.hiddenObjects[s]||(e.push(s),this.hiddenObjects[s]=0),this.hiddenObjects[s]+=1}),e.length>0&&(this.lastUpdated=Date.now(),this.changed.raiseEvent({action:W.HIDE,ids:e}))}showObjects(t){v(t,[String]);const e=[];t.forEach(s=>{this.hiddenObjects[s]&&(this.hiddenObjects[s]-=1,this.hiddenObjects[s]===0&&(this._hiddenObjectFeatures[s]&&(this._hiddenObjectFeatures[s].forEach(r=>{xh(r,Gt)}),this._hiddenObjectFeatures[s].clear()),delete this.hiddenObjects[s],e.push(s)))}),e.length>0&&this.changed.raiseEvent({action:W.SHOW,ids:e})}addFeature(t,e){this._hiddenObjectFeatures[t]||(this._hiddenObjectFeatures[t]=new Set),Vr(e),this._hiddenObjectFeatures[t].add(e),e[Gt]=!0,ba(e)}hasFeature(t,e){return this._hiddenObjectFeatures[t]?this._hiddenObjectFeatures[t].has(e):!1}destroy(){this.hiddenObjects={},Object.values(this._hiddenObjectFeatures).forEach(t=>{t.clear()}),this._hiddenObjectFeatures={},this.changed.destroy()}}const Pa="2.0";class ht extends re{static get className(){return"Layer"}static get vcsLayerNameSymbol(){return z}static getDefaultOptions(){return{name:void 0,extent:void 0,activeOnStartup:!1,allowPicking:!0,exclusiveGroups:[],mapNames:[],url:void 0,hiddenObjectIds:[],copyright:void 0}}constructor(t){super(t);const e=ht.getDefaultOptions();this.extent=t.extent?new pt(t.extent):null,this.activeOnStartup=rt(t.activeOnStartup,e.activeOnStartup),this._allowPicking=rt(t.allowPicking,e.allowPicking),this._state=K.INACTIVE,this._loadingPromise=null,this._initialized=!1,this.mapNames=t.mapNames||e.mapNames,this._supportedMaps=[],this._url=t.url,this._localeChangedListener=null,this._zIndex=V(t.zIndex,0),this.zIndexChanged=new R,this._hiddenObjectIds=Array.isArray(t.hiddenObjectIds)?t.hiddenObjectIds:e.hiddenObjectIds,this._globalHider=null,this._exclusiveGroups=Array.isArray(t.exclusiveGroups)?t.exclusiveGroups.slice():e.exclusiveGroups,this.exclusiveGroupsChanged=new R,this.copyright=t.copyright||e.copyright,this._implementations=new Map,this._activeMaps=new Set,this.stateChanged=new R,this.featureProvider=void 0}get initialized(){return this._initialized}get active(){return this._state===K.ACTIVE}get loading(){return!!(this._state&K.LOADING)}get state(){return this._state}get allowPicking(){return this._allowPicking}set allowPicking(t){this._allowPicking=t}get url(){if(this._url){if(typeof this._url=="string")return this._url;const t=_a();return this._url[t]?this._url[t]:Object.values(this._url)[0]}return""}set url(t){v(t,[String,Object]),this._url!==t&&(this._url=t,this.reload())}get hiddenObjectIds(){return this._hiddenObjectIds}set hiddenObjectIds(t){v(t,[String]),this._globalHider&&this.active&&this._globalHider.hideObjects(t),this._hiddenObjectIds=t}get globalHider(){return this._globalHider}setGlobalHider(t){it(t,qr),t&&this.active&&t.hideObjects(this.hiddenObjectIds),this._globalHider=t}get exclusive(){return this._exclusiveGroups.length>0}get exclusiveGroups(){return this._exclusiveGroups.slice()}set exclusiveGroups(t){v(t,[[String,Symbol]]),(t.length!==this._exclusiveGroups.length||!t.every(e=>this._exclusiveGroups.includes(e)))&&(this._exclusiveGroups=t.slice(),this.exclusiveGroupsChanged.raiseEvent(t))}get zIndex(){return this._zIndex}set zIndex(t){v(t,Number),this._zIndex!==t&&(this._zIndex=t,this.zIndexChanged.raiseEvent(t))}createImplementationsForMap(t){return[]}getImplementationsForMap(t){return this._implementations.has(t)||(this.isSupported(t)?this._implementations.set(t,this.createImplementationsForMap(t)):this._implementations.set(t,[])),this._implementations.get(t)}getImplementations(){return[...this._implementations.values()].flat()}getImplementationOptions(){return{name:this.name,url:this.url}}reload(){return this.forceRedraw()}async forceRedraw(){const e=[...this._implementations.keys()].map(s=>(this.removedFromMap(s),s.active?this.mapActivated(s):Promise.resolve()));await Promise.all(e)}getExtent(){return this.extent}getZoomToExtent(){return this.extent&&this.extent.isValid()?this.extent:null}_handleLocaleChange(t){this._url&&typeof this._url=="object"&&this._url[t]&&this.reload()}initialize(){return this.initialized||(this._localeChangedListener=va().addEventListener(this._handleLocaleChange.bind(this))),this._initialized=!0,Promise.resolve()}async mapActivated(t){this.getLogger().debug(`Layer: ${this.name} mapActivated is called from Map: ${t.name}`),this._activeMaps.add(t),(this.active||this.loading&&this.initialized)&&await this._activateImplsForMap(t)}mapDeactivated(t){this.getLogger().debug(`Layer: ${this.name} mapDeactivated is called from Map: ${t.name}`),this._activeMaps.delete(t),(this.active||this.loading)&&this.getImplementationsForMap(t).forEach(e=>{e.deactivate()})}removedFromMap(t){this._activeMaps.delete(t),this.getImplementationsForMap(t).forEach(e=>{e.destroy()}),this._implementations.delete(t)}isSupported(t){return t&&this._supportedMaps.includes(t.className)&&(this.mapNames.length===0||this.mapNames.indexOf(t.name)>=0)}async _activateImplsForMap(t){const e=this.getImplementationsForMap(t);try{await Promise.all(e.map(s=>s.activate()))}catch(s){this.getLogger().error(`Layer ${this.name} could not activate impl for map ${t.name}`),this.getLogger().error(s),this._implementations.set(t,[]),e.forEach(r=>{r.destroy()})}}async _activate(){this._state=K.LOADING;try{this.stateChanged.raiseEvent(K.LOADING)}catch(t){this.getLogger().debug(`Error on raising LayerState.LOADING event for layer ${this.name} : ${t.message}`)}if(await this.initialize(),this._state===K.LOADING&&(await Promise.all([...this._activeMaps].map(t=>this._activateImplsForMap(t))),this._state===K.LOADING)){this._globalHider&&this._globalHider.hideObjects(this.hiddenObjectIds),this._state=K.ACTIVE;try{this.stateChanged.raiseEvent(K.ACTIVE)}catch(t){this.getLogger().debug(`Error on raising LayerState.ACTIVE event for layer ${this.name} : ${t.message}`)}this._loadingPromise=null}}activate(){return this._loadingPromise?this._loadingPromise:this._state===K.INACTIVE?(this._loadingPromise=this._activate().catch(t=>(this._state=K.INACTIVE,Promise.reject(t))),this._loadingPromise):Promise.resolve()}deactivate(){if(this._loadingPromise&&(this._loadingPromise=null),this._state!==K.INACTIVE){this.getImplementations().forEach(t=>{(t.loading||t.active)&&t.deactivate()}),this._globalHider&&this._globalHider.showObjects(this.hiddenObjectIds),this._state=K.INACTIVE;try{this.stateChanged.raiseEvent(K.INACTIVE)}catch(t){this.getLogger().debug(`Error on raising LayerState.INACTIVE event for layer ${this.name} : ${t.message}`)}}}toJSON(){const t=super.toJSON(),e=ht.getDefaultOptions();return this.activeOnStartup!==e.activeOnStartup&&(t.activeOnStartup=this.activeOnStartup),this.allowPicking!==e.allowPicking&&(t.allowPicking=this.allowPicking),this.mapNames.length>0&&(t.mapNames=this.mapNames.slice()),this.hiddenObjectIds.length>0&&(t.hiddenObjectIds=this.hiddenObjectIds.slice()),this._url&&(t.url=this._url),this.extent&&this.extent.isValid()&&(t.extent=this.extent.toJSON()),this._exclusiveGroups.length>0&&(t.exclusiveGroups=this._exclusiveGroups.slice()),this.copyright!==e.copyright&&(t.copyright=_({},this.copyright)),t}destroy(){super.destroy(),this.featureProvider&&this.featureProvider.destroy(),this._activeMaps.clear(),this.getImplementations().forEach(t=>{t.destroy()}),this._localeChangedListener&&(this._localeChangedListener(),this._localeChangedListener=null),this._initialized=!1,this._implementations.clear(),this.stateChanged.destroy(),this.zIndexChanged.destroy(),this.exclusiveGroupsChanged.destroy()}}ot.registerClass(ht.className,ht);const Oh=Symbol("alreadyTransformedToMercator"),Ve=Symbol("alreadyTransformedToImage"),Wr=Symbol("obliqueGeometry"),Ea=Symbol("doNotTransform"),Be=Symbol("OriginalFeature"),Hs=Symbol("ActuallyIsCircle"),li=new Ot,V0=new wn({font:"30px sans-serif",fill:new he({color:$s}),textAlign:"left",offsetY:-15});function Ph(i,t,e){e[t].conditions?i[t]=new qd(e[t],e.defines):i[t]=new Wd(e[t],e.defines)}class Mt extends ne{static get className(){return"DeclarativeStyleItem"}constructor(t){super(t);const e=t.declarativeStyle||{};e.show=e.show!=null?e.show:!0,this.cesiumStyle=new Dn(e),this._style=this._styleFunction.bind(this),e.strokeColor&&Ph(this.cesiumStyle,"strokeColor",e),e.strokeWidth&&Ph(this.cesiumStyle,"strokeWidth",e),this._styleOptions=e,this._circleCache=new Map}get styleOptions(){return JSON.parse(JSON.stringify(this._styleOptions))}toJSON(){const t=super.toJSON(),e=this.cesiumStyle.ready?this.cesiumStyle.style:this.styleOptions;return t.declarativeStyle=Object.fromEntries(Object.entries(e).filter(([,s])=>s!=null).map(([s,r])=>Wn(r,Boolean)?[s,r.toString()]:[s,r])),t}clone(t){if(t)return t.assign(this);const e=this.toJSON();return delete e.name,new Mt(e)}assign(t){return super.assign(t),this._styleOptions=t.cesiumStyle.ready?t.cesiumStyle.style:t.styleOptions,this.cesiumStyle=new Dn(this._styleOptions),this}_styleFunction(t){const e=t[Be]||t;if(!this.cesiumStyle.show.evaluate(e))return $r;const s=e.getGeometry().getType();return s==="Point"?this._stylePoint(e):s==="Polygon"?this._stylePolygon(e):s==="LineString"?this._styleLineString(e):s==="Circle"?this._stylePolygon(e):s==="MultiPoint"?this._stylePoint(e):s==="MultiPolygon"?this._stylePolygon(e):s==="MultiLineString"?this._styleLineString(e):(this.getLogger().warning(`could not style geometry type: ${s}`),$r)}_stylePolygon(t){const e=new ft({}),s=this.cesiumStyle.color?this.cesiumStyle.color.evaluate(t,li):Ot.WHITE;return s&&e.setFill(new he({color:Pe(s)})),this._evaluateStroke(t,e),e}_styleLineString(t){const e=new ft({}),s=t.get("olcs_extrudedHeight")||t.get("olcs_storeyHeight")&&t.get("olcs_storeyNumber"),r=this.cesiumStyle.color?this.cesiumStyle.color.evaluate(t,li):Ot.WHITE;if(r)if(s)e.setFill(new he({color:Pe(r)}));else{const n=this.cesiumStyle.strokeWidth?this.cesiumStyle.strokeWidth.evaluate(t):1;e.setStroke(new ee({width:Number.isFinite(n)?n:1,color:Pe(r)}))}return s&&this._evaluateStroke(t,e),e}_stylePoint(t){const e=new ft({});if(this.cesiumStyle.labelText){const s=this.cesiumStyle.labelText.evaluate(t);if(s){const r=V0.clone();if(r.setText(s.toString()),this.cesiumStyle.font){const n=this.cesiumStyle.font.evaluate(t);n&&r.setFont(n)}if(this.cesiumStyle.labelColor){const n=this.cesiumStyle.labelColor.evaluateColor(t,li);n&&r.getFill().setColor(Pe(n))}if(this.cesiumStyle.labelOutlineColor){const n=this.cesiumStyle.labelOutlineColor.evaluate(t,li);if(n){const a=this.cesiumStyle.labelOutlineWidth?this.cesiumStyle.labelOutlineWidth.evaluate(t):1;r.setStroke(new ee({color:Pe(n),width:a}))}}e.setText(r)}}if(this.cesiumStyle.image){const s=this.cesiumStyle.image.evaluate(t);s&&e.setImage(new ps({src:s}))}else{const s=this.cesiumStyle.color?this.cesiumStyle.color.evaluate(t,li):Ot.WHITE;let r=4;this.cesiumStyle.pointSize&&(r=this.cesiumStyle.pointSize.evaluate(t)/2);const n=this.cesiumStyle.pointOutlineWidth?this.cesiumStyle.pointOutlineWidth.evaluate(t):0;let a=Ot.BLACK;n&&(this.cesiumStyle.pointOutlineColor&&(a=this.cesiumStyle.pointOutlineColor.evaluateColor(t,li)),r+=n/2);const o=`${r}${s}${n}${a}`;if(!this._circleCache.has(o)){const l={radius:r,fill:new he({color:Pe(s)})};n&&(l.stroke=new ee({color:Pe(a),width:n})),this._circleCache.set(o,new ms(l))}e.setImage(this._circleCache.get(o))}if(this.cesiumStyle.scale&&e.getImage()){const s=this.cesiumStyle.scale.evaluate(t);Number.isFinite(s)&&e.getImage().setScale(s)}return this._evaluateStroke(t,e),e}_evaluateStroke(t,e){if(this.cesiumStyle.strokeColor){const s=this.cesiumStyle.strokeColor.evaluateColor(t,li);if(s){const r=this.cesiumStyle.strokeWidth?this.cesiumStyle.strokeWidth.evaluate(t):1;e.setStroke(new ee({width:Number.isFinite(r)?r:1,color:Pe(s)}))}}}get show(){return this._styleOptions.show}set show(t){this._styleOptions.show=t,this.cesiumStyle.show=t,this._styleChanged()}get color(){return this._styleOptions.color}set color(t){this._styleOptions.color=t,this.cesiumStyle.color=t,this._styleChanged()}get strokeColor(){return this._styleOptions.strokeColor}set strokeColor(t){this._styleOptions.strokeColor=t,this.cesiumStyle.strokeColor=t,this._styleChanged()}get strokeWidth(){return this._styleOptions.strokeWidth}set strokeWidth(t){this._styleOptions.strokeWidth=t,this.cesiumStyle.strokeWidth=t,this._styleChanged()}get image(){return this._styleOptions.image}set image(t){this._styleOptions.image=t,this.cesiumStyle.image=t,this._styleChanged()}get labelText(){return this._styleOptions.labelText}set labelText(t){this._styleOptions.labelText=t,this.cesiumStyle.labelText=t,this._styleChanged()}get labelColor(){return this._styleOptions.labelColor}set labelColor(t){this._styleOptions.labelColor=t,this.cesiumStyle.labelColor=t,this._styleChanged()}get font(){return this._styleOptions.font}set font(t){this._styleOptions.font=t,this.cesiumStyle.font=t,this._styleChanged()}get pointSize(){return this._styleOptions.pointSize}set pointSize(t){this._styleOptions.pointSize=t,this.cesiumStyle.pointSize=t,this._styleChanged()}destroy(){this._circleCache.clear(),super.destroy()}}Gi.registerClass(Mt.className,Mt);const Eh=new Mt({declarativeStyle:{show:!0,color:{conditions:Q("olcs_color",!0)},scale:{conditions:Q("olcs_scale")},pointOutlineWidth:{conditions:Q("olcs_outlineWidth")},pointOutlineColor:{conditions:Q("olcs_outlineColor",!0)},pointSize:{conditions:Q("olcs_pointSize")},image:{conditions:Q("olcs_image")},font:{conditions:Q("olcs_font")},labelStyle:"2",labelText:{conditions:Q("olcs_labelText")},labelColor:{conditions:Q("olcs_fontColor",!0)},labelOutlineWidth:{conditions:Q("olcs_fontOutlineWidth")},labelOutlineColor:{conditions:Q("olcs_fontOutlineColor",!0)},verticalOrigin:"1",horizontalOrigin:"0",labelHorizontalOrigin:"0",labelVerticalOrigin:"1"}});function Ia(i,t){if(i.image&&i.image.src&&/^data:/.test(i.image.src))if(t){let e=t.indexOf(i.image.src);e===-1&&(t.push(i.image.src),e=t.length-1),i.image.src=`:${e}`}else i.image={radius:5};return i}function Ih(i,t={}){return i instanceof q?t.style=Ia(i.toJSON(),t.embeddedIcons):i instanceof Mt&&(t.style=i.toJSON()),t}function La(){return Pt("VectorProperties")}const hi={clampToGround:Yt.CLAMP_TO_GROUND,absolute:Yt.NONE,relativeToGround:Yt.RELATIVE_TO_GROUND},ci={both:Pi.BOTH,cesium3DTile:Pi.CESIUM_3D_TILE,terrain:Pi.TERRAIN};function Yr(i,t){if(Array.isArray(i)){const e=i.map(s=>E(s,null)).filter(s=>s!=null);if(e.length===4)return new _s(e[0],e[1],e[2],e[3])}return t}function Xr(i,t){if(Array.isArray(i)){const e=i.map(s=>E(s,null)).filter(s=>s!=null);if(e.length===3)return new C(e[0],e[1],e[2])}return t}function ui(i,t){if(Array.isArray(i))return i.map(e=>E(e,null)).filter(e=>e!==null&&e>0);{const e=E(i,null);if(e&&e>0)return[e]}return Array.isArray(t)?t:[t]}function Vs(i){return Object.keys(hi).find(t=>hi[t]===i)}function Zr(i){return Object.keys(ci).find(t=>ci[t]===i)}function Jr(i){return i?_s.pack(i,[]):void 0}function Kr(i){return i?C.pack(i,[]):void 0}class te{static getDefaultOptions(){return{altitudeMode:"clampToGround",allowPicking:!0,classificationType:void 0,scaleByDistance:void 0,eyeOffset:void 0,heightAboveGround:0,skirt:0,groundLevel:void 0,extrudedHeight:0,storeysAboveGround:0,storeysBelowGround:0,storeyHeightsAboveGround:[],storeyHeightsBelowGround:[],storeyHeight:void 0,modelUrl:void 0,modelScaleX:1,modelScaleY:1,modelScaleZ:1,modelHeading:0,modelPitch:0,modelRoll:0,modelOptions:void 0,baseUrl:void 0}}constructor(t){const e=te.getDefaultOptions();this._altitudeMode=ze(t.altitudeMode,hi,Yt.CLAMP_TO_GROUND),this._allowPicking=rt(t.allowPicking,e.allowPicking),this._classificationType=ze(t.classificationType,ci,void 0),this._scaleByDistance=Yr(t.scaleByDistance,void 0),this._eyeOffset=Xr(t.eyeOffset,void 0),this._heightAboveGround=E(t.heightAboveGround,e.heightAboveGround),this._skirt=E(t.skirt,e.skirt),this._groundLevel=E(t.groundLevel,e.groundLevel),this._extrudedHeight=E(t.extrudedHeight,e.extrudedHeight),this._storeysAboveGround=V(t.storeysAboveGround,e.storeysAboveGround),this._storeysBelowGround=V(t.storeysBelowGround,e.storeysBelowGround),this._storeyHeightsAboveGround=ui(t.storeyHeightsAboveGround,e.storeyHeightsAboveGround),this._storeyHeightsBelowGround=ui(t.storeyHeightsBelowGround,e.storeyHeightsBelowGround),this._storeyHeight=E(t.storeyHeight,e.storeyHeight),this._modelUrl=t.modelUrl||e.modelUrl,this._modelScaleX=E(t.modelScaleX,e.modelScaleX),this._modelScaleY=E(t.modelScaleY,e.modelScaleY),this._modelScaleZ=E(t.modelScaleZ,e.modelScaleZ),this._modelHeading=E(t.modelHeading,e.modelHeading),this._modelPitch=E(t.modelPitch,e.modelPitch),this._modelRoll=E(t.modelRoll,e.modelRoll),this._baseUrl=t.baseUrl||e.baseUrl,this._modelOptions=t.modelOptions||e.modelOptions,this.propertyChanged=new R}get altitudeMode(){return this._altitudeMode}set altitudeMode(t){t!==this._altitudeMode&&(v(t,Object.values(Yt)),this._altitudeMode=t,this.propertyChanged.raiseEvent(["altitudeMode"]))}getAltitudeMode(t){const e=t.get("olcs_altitudeMode");return ze(e,hi,this._altitudeMode)}get allowPicking(){return this._allowPicking}set allowPicking(t){t!==this._allowPicking&&(v(t,Boolean),this._allowPicking=t,this.propertyChanged.raiseEvent(["allowPicking"]))}getAllowPicking(t){const e=t.get("olcs_allowPicking");return rt(e,this._allowPicking)}get classificationType(){return this._classificationType}set classificationType(t){t!==this._classificationType&&(it(t,Object.values(Pi)),this._classificationType=t,this.propertyChanged.raiseEvent(["classificationType"]))}getClassificationType(t){const e=t.get("olcs_classificationType");return ze(e,ci,this.classificationType)}get scaleByDistance(){return this._scaleByDistance}set scaleByDistance(t){_s.equals(t,this._scaleByDistance)||(it(t,_s),this._scaleByDistance=t,this.propertyChanged.raiseEvent(["scaleByDistance"]))}getScaleByDistance(t){const e=t.get("olcs_scaleByDistance");return Yr(e,this.scaleByDistance)}get eyeOffset(){return this._eyeOffset}set eyeOffset(t){C.equals(this.eyeOffset,t)||(it(t,C),this._eyeOffset=t,this.propertyChanged.raiseEvent(["eyeOffset"]))}getEyeOffset(t){const e=t.get("olcs_eyeOffset");if(!e){const s=t.get("olcs_zCoordinateEyeOffset");if(s)return La().deprecate("zCoordinateEyeOffset","use eyeOffset and provide [0,0,value]"),new C(0,0,E(s,0))}return Xr(e,this.eyeOffset)}get heightAboveGround(){return this._heightAboveGround}set heightAboveGround(t){t!==this._heightAboveGround&&(v(t,Number),this._heightAboveGround=t,this.propertyChanged.raiseEvent(["heightAboveGround"]))}getHeightAboveGround(t){const e=t.get("olcs_heightAboveGround");return E(e,this.heightAboveGround)}get skirt(){return this._skirt}set skirt(t){t!==this._skirt&&(v(t,Number),this._skirt=t,this.propertyChanged.raiseEvent(["skirt"]))}getSkirt(t){const e=t.get("olcs_skirt");return E(e,this.skirt)}get groundLevel(){return this._groundLevel}set groundLevel(t){t!==this._groundLevel&&(it(t,Number),this._groundLevel=t,this.propertyChanged.raiseEvent(["groundLevel"]))}getGroundLevel(t){const e=t.get("olcs_groundLevel");return E(e,this.groundLevel)}get extrudedHeight(){return this._extrudedHeight}set extrudedHeight(t){t!==this._extrudedHeight&&(v(t,Number),this._extrudedHeight=t,this.propertyChanged.raiseEvent(["extrudedHeight"]))}getExtrudedHeight(t){const e=t.get("olcs_extrudedHeight");return E(e,this.extrudedHeight)}get storeysAboveGround(){return this._storeysAboveGround}set storeysAboveGround(t){t!==this._storeysAboveGround&&(v(t,Number),this._storeysAboveGround=Math.trunc(t),this.propertyChanged.raiseEvent(["storeysAboveGround"]))}getStoreysAboveGround(t){const e=t.get("olcs_storeysAboveGround");return V(e,this.storeysAboveGround)}get storeysBelowGround(){return this._storeysBelowGround}set storeysBelowGround(t){t!==this._storeysBelowGround&&(v(t,Number),this._storeysBelowGround=Math.trunc(t),this.propertyChanged.raiseEvent(["storeysBelowGround"]))}getStoreysBelowGround(t){const e=t.get("olcs_storeysBelowGround");return V(e,this.storeysBelowGround)}get storeyHeightsAboveGround(){return this._storeyHeightsAboveGround.slice()}set storeyHeightsAboveGround(t){Oe(t,this._storeyHeightsAboveGround)||(v(t,[Number]),this._storeyHeightsAboveGround=t,this.propertyChanged.raiseEvent(["storeyHeightsAboveGround"]))}getStoreyHeightsAboveGround(t){const e=t.get("olcs_storeyHeightsAboveGround");return ui(e,this.storeyHeightsAboveGround)}get storeyHeightsBelowGround(){return this._storeyHeightsBelowGround.slice()}set storeyHeightsBelowGround(t){Oe(t,this._storeyHeightsBelowGround)||(v(t,[Number]),this._storeyHeightsBelowGround=t,this.propertyChanged.raiseEvent(["storeyHeightsBelowGround"]))}getStoreyHeightsBelowGround(t){const e=t.get("olcs_storeyHeightsBelowGround");return ui(e,this.storeyHeightsBelowGround)}get storeyHeight(){return this._storeyHeight}set storeyHeight(t){t!==this._storeyHeight&&(La().deprecate("storeyHeight","use storeyHeightAboveGround"),v(t,Number),this._storeyHeight=t,this.propertyChanged.raiseEvent(["storeyHeight"]))}get modelUrl(){return this._modelUrl}set modelUrl(t){v(t,String),this._modelUrl!==t&&(this._modelUrl=t,this.propertyChanged.raiseEvent(["modelUrl"]))}getModelUrl(t){const e=t.get("olcs_modelUrl");return e!==void 0?e:this.modelUrl}get modelScaleX(){return this._modelScaleX}set modelScaleX(t){v(t,Number),this._modelScaleX!==t&&(this._modelScaleX=t,this.propertyChanged.raiseEvent(["modelScaleX"]))}getModelScaleX(t){const e=t.get("olcs_modelScaleX");return E(e,this.modelScaleX)}get modelScaleY(){return this._modelScaleY}set modelScaleY(t){v(t,Number),this._modelScaleY!==t&&(this._modelScaleY=t,this.propertyChanged.raiseEvent(["modelScaleY"]))}getModelScaleY(t){const e=t.get("olcs_modelScaleY");return E(e,this.modelScaleY)}get modelScaleZ(){return this._modelScaleZ}set modelScaleZ(t){v(t,Number),this._modelScaleZ!==t&&(this._modelScaleZ=t,this.propertyChanged.raiseEvent(["modelScaleZ"]))}getModelScaleZ(t){const e=t.get("olcs_modelScaleZ");return E(e,this.modelScaleZ)}get modelHeading(){return this._modelHeading}set modelHeading(t){v(t,Number),this._modelHeading!==t&&(this._modelHeading=t,this.propertyChanged.raiseEvent(["modelHeading"]))}getModelHeading(t){const e=t.get("olcs_modelHeading");return E(e,this.modelHeading)}get modelPitch(){return this._modelPitch}set modelPitch(t){v(t,Number),this._modelPitch!==t&&(this._modelPitch=t,this.propertyChanged.raiseEvent(["modelPitch"]))}getModelPitch(t){const e=t.get("olcs_modelPitch");return E(e,this.modelPitch)}get modelRoll(){return this._modelRoll}set modelRoll(t){v(t,Number),this._modelRoll!==t&&(this._modelRoll=t,this.propertyChanged.raiseEvent(["modelRoll"]))}getModelRoll(t){const e=t.get("olcs_modelRoll");return E(e,this.modelRoll)}get modelOptions(){return this._modelOptions}set modelOptions(t){it(t,Object),this._modelOptions!==t&&(this._modelOptions=t,this.propertyChanged.raiseEvent(["modelOptions"]))}getModelOptions(t){const e=t.get("olcs_modelOptions");return e||(this.modelOptions?this.modelOptions:{})}get baseUrl(){return this._baseUrl}set baseUrl(t){v(t,String),this._baseUrl!==t&&(this._baseUrl=t,this.propertyChanged.raiseEvent(["baseUrl"]))}getBaseUrl(t){const e=t.get("olcs_baseUrl");return e!==void 0?e:this.baseUrl}getModel(t){let e=this.getModelUrl(t);if(!e)return null;const s=this.getBaseUrl(t);return s&&(e=new URL(e,s).toString()),{url:e,scale:[this.getModelScaleX(t),this.getModelScaleY(t),this.getModelScaleZ(t)],heading:this.getModelHeading(t),pitch:this.getModelPitch(t),roll:this.getModelRoll(t)}}setVcsMeta(t){const e=te.getDefaultOptions();t.altitudeMode||(t.altitudeMode=Vs(this.altitudeMode)),Object.assign(e,t),this.setValues(e)}setValues(t){const e=te.getDefaultOptions(),s=[];if("altitudeMode"in t){const r=ze(e.altitudeMode,hi,void 0),n=ze(t.altitudeMode,hi,r);this._altitudeMode!==n&&(this._altitudeMode=n,s.push("altitudeMode"))}if("allowPicking"in t){const r=rt(t.allowPicking,e.allowPicking);this._allowPicking!==r&&(this._allowPicking=r,s.push("allowPicking"))}if("classificationType"in t){const r=ze(e.classificationType,ci,void 0),n=ze(t.classificationType,ci,r);this._classificationType!==n&&(this._classificationType=n,s.push("classificationType"))}if("scaleByDistance"in t){const r=Yr(t.scaleByDistance,void 0);_s.equals(r,this._scaleByDistance)||(this._scaleByDistance=r,s.push("scaleByDistance"))}if("eyeOffset"in t){const r=Xr(t.eyeOffset,void 0);C.equals(r,this._eyeOffset)||(this._eyeOffset=r,s.push("eyeOffset"))}if("heightAboveGround"in t){const r=E(t.heightAboveGround,e.heightAboveGround);r!==this._heightAboveGround&&(this._heightAboveGround=r,s.push("heightAboveGround"))}if("skirt"in t){const r=E(t.skirt,e.skirt);r!==this._skirt&&(this._skirt=r,s.push("skirt"))}if("groundLevel"in t){const r=E(t.groundLevel,e.groundLevel);r!==this._groundLevel&&(this._groundLevel=r,s.push("groundLevel"))}if("extrudedHeight"in t){const r=E(t.extrudedHeight,e.extrudedHeight);r!==this._extrudedHeight&&(this._extrudedHeight=r,s.push("extrudedHeight"))}if("storeysAboveGround"in t){const r=V(t.storeysAboveGround,e.storeysAboveGround);r!==this._storeysAboveGround&&(this._storeysAboveGround=r,s.push("storeysAboveGround"))}if("storeysBelowGround"in t){const r=V(t.storeysBelowGround,e.storeysBelowGround);r!==this._storeysBelowGround&&(this._storeysBelowGround=r,s.push("storeysBelowGround"))}if("storeyHeightsAboveGround"in t){const r=ui(t.storeyHeightsAboveGround,e.storeyHeightsAboveGround);Oe(r,this._storeyHeightsAboveGround)||(this._storeyHeightsAboveGround=r,s.push("storeyHeightsAboveGround"))}if("storeyHeightsBelowGround"in t){const r=ui(t.storeyHeightsBelowGround,e.storeyHeightsBelowGround);Oe(r,this._storeyHeightsBelowGround)||(this._storeyHeightsBelowGround=r,s.push("storeyHeightsBelowGround"))}if("storeyHeight"in t){const r=E(t.storeyHeight,e.storeyHeight);r!==this._storeyHeight&&(La().deprecate("storeyHeight","use storeyHeightAboveGround"),this._storeyHeight=r,s.push("storeyHeight"))}if("modelUrl"in t&&t.modelUrl!==this._modelUrl&&(this._modelUrl=t.modelUrl,s.push("modelUrl")),"modelScaleX"in t){const r=E(t.modelScaleX,e.modelScaleX);r!==this._modelScaleX&&(this._modelScaleX=r,s.push("modelScaleX"))}if("modelScaleY"in t){const r=E(t.modelScaleY,e.modelScaleY);r!==this._modelScaleY&&(this._modelScaleY=r,s.push("modelScaleY"))}if("modelScaleZ"in t){const r=E(t.modelScaleZ,e.modelScaleZ);r!==this._modelScaleZ&&(this._modelScaleZ=r,s.push("modelScaleZ"))}if("modelHeading"in t){const r=E(t.modelHeading,e.modelHeading);r!==this._modelHeading&&(this._modelHeading=r,s.push("modelHeading"))}if("modelPitch"in t){const r=E(t.modelPitch,e.modelPitch);r!==this._modelPitch&&(this._modelPitch=r,s.push("modelPitch"))}if("modelRoll"in t){const r=E(t.modelRoll,e.modelRoll);r!==this._modelRoll&&(this._modelRoll=r,s.push("modelRoll"))}"baseUrl"in t&&t.baseUrl!==this._baseUrl&&(this._baseUrl=t.baseUrl,s.push("baseUrl")),s.length&&this.propertyChanged.raiseEvent(s)}getValues(){return{altitudeMode:Vs(this.altitudeMode),allowPicking:this.allowPicking,classificationType:Zr(this.classificationType),scaleByDistance:Jr(this.scaleByDistance),eyeOffset:Kr(this.eyeOffset),heightAboveGround:this.heightAboveGround,skirt:this.skirt,groundLevel:this.groundLevel,extrudedHeight:this.extrudedHeight,storeysAboveGround:this.storeysAboveGround,storeysBelowGround:this.storeysBelowGround,storeyHeightsAboveGround:this.storeyHeightsAboveGround,storeyHeightsBelowGround:this.storeyHeightsBelowGround,storeyHeight:this.storeyHeight,modelUrl:this.modelUrl,modelScaleX:this.modelScaleX,modelScaleY:this.modelScaleY,modelScaleZ:this.modelScaleZ,modelHeading:this.modelHeading,modelPitch:this.modelPitch,modelRoll:this.modelRoll,baseUrl:this.baseUrl}}getVcsMeta(t){const e=t||te.getDefaultOptions(),s={};return Vs(this.altitudeMode)!==e.altitudeMode&&(s.altitudeMode=Vs(this.altitudeMode)),this.allowPicking!==e.allowPicking&&(s.allowPicking=this.allowPicking),Zr(this.classificationType)!==e.classificationType&&(s.classificationType=Zr(this.classificationType)),Oe(Jr(this.scaleByDistance),e.scaleByDistance)||(s.scaleByDistance=Jr(this.scaleByDistance)),Oe(Kr(this.eyeOffset),e.eyeOffset)||(s.eyeOffset=Kr(this.eyeOffset)),this.heightAboveGround!==e.heightAboveGround&&(s.heightAboveGround=this.heightAboveGround),this.skirt!==e.skirt&&(s.skirt=this.skirt),this.groundLevel!==e.groundLevel&&(s.groundLevel=this.groundLevel),this.extrudedHeight!==e.extrudedHeight&&(s.extrudedHeight=this.extrudedHeight),this.storeysAboveGround!==e.storeysAboveGround&&(s.storeysAboveGround=this.storeysAboveGround),this.storeysBelowGround!==e.storeysBelowGround&&(s.storeysBelowGround=this.storeysBelowGround),Oe(this.storeyHeightsAboveGround,e.storeyHeightsAboveGround)||(s.storeyHeightsAboveGround=this.storeyHeightsAboveGround),Oe(this.storeyHeightsBelowGround,e.storeyHeightsBelowGround)||(s.storeyHeightsBelowGround=this.storeyHeightsBelowGround),this.storeyHeight!==e.storeyHeight&&(s.storeyHeight=this.storeyHeight),this.modelUrl!==e.modelUrl&&(s.modelUrl=this.modelUrl),this.modelScaleX!==e.modelScaleX&&(s.modelScaleX=this.modelScaleX),this.modelScaleY!==e.modelScaleY&&(s.modelScaleY=this.modelScaleY),this.modelScaleZ!==e.modelScaleZ&&(s.modelScaleZ=this.modelScaleZ),this.modelHeading!==e.modelHeading&&(s.modelHeading=this.modelHeading),this.modelPitch!==e.modelPitch&&(s.modelPitch=this.modelPitch),this.modelRoll!==e.modelRoll&&(s.modelRoll=this.modelRoll),this.baseUrl!==e.baseUrl&&(s.baseUrl=this.baseUrl),s}destroy(){this.propertyChanged.destroy()}}function Bs(i,t){if(Wn(i,[ne,{type:String}])){if(i instanceof ne)return i;{const e=Gi.createFromTypeOptions(i);if(e)return e instanceof q&&t instanceof q?t.assign(e):e}}return t||Eh.clone()}class _e extends ht{static get className(){return"FeatureLayer"}static getDefaultOptions(){return O(_({},ht.getDefaultOptions()),{style:void 0,balloonHeightOffset:10,genericFeatureProperties:{}})}constructor(t){super(t);const e=_e.getDefaultOptions();this._style=this.getStyleOrDefaultStyle(t.style),this._defaultStyle=this._style,this.styleChanged=new R,this._genericFeatureProperties=t.genericFeatureProperties||e.genericFeatureProperties,this.balloonHeightOffset=V(t.balloonHeightOffset,e.balloonHeightOffset),this.featureVisibility=t.featureVisibility||new Ur}get defaultStyle(){return this._defaultStyle}get style(){return this._style}get genericFeatureProperties(){return this._genericFeatureProperties}getImplementationOptions(){return O(_({},super.getImplementationOptions()),{globalHider:this.globalHider,featureVisibility:this.featureVisibility,style:this.style})}setGlobalHider(t){super.setGlobalHider(t),this.forceRedraw()}objectClickedHandler(t){return null}getGenericFeatureFromClickedObject(t){return this.getLogger().warning("This method should be implemented by any specific layers"),null}assignGenericFeatureProperties(t){v(t,Object),Object.assign(this._genericFeatureProperties,t)}getStyleOrDefaultStyle(t,e){return Bs(t,e)}setStyle(t,e){v(t,[ft,ne,Function]),t instanceof ne?this._style=t:(this._style=new q({}),this._style.style=t),this.getImplementations().forEach(s=>{s.updateStyle(this._style,e)}),this.styleChanged.raiseEvent(this._style)}clearStyle(){this.setStyle(this.defaultStyle)}toJSON(){const t=super.toJSON();return this.getStyleOrDefaultStyle().equals(this._style)||(t.style=this.style.toJSON()),Object.keys(this._genericFeatureProperties).length>0&&(t.genericFeatureProperties=_({},this._genericFeatureProperties)),t}destroy(){this.featureVisibility&&this.featureVisibility.destroy(),this.styleChanged.destroy(),super.destroy()}}ot.registerClass(_e.className,_e);class Mi extends ve{static from(t,e){const s=new Mi(e);if(t)for(const r of t)s.add(r);return s}constructor(t){super(t);this.moved=new R,this._previousIndexSymbol=Symbol("previousIndex")}get previousIndexSymbol(){return this._previousIndexSymbol}get(t){return this._array[t]}add(t,e){if(this._checkUniqueness(t)){let s=this._array.length;return e!=null&&e<this._array.length?(s=e>=0?e:0,this._array.splice(s,0,t)):this._array.push(t),this.added.raiseEvent(t),s}return null}remove(t){t[this._previousIndexSymbol]=this._array.indexOf(t),super.remove(t)}_move(t,e,s){let r=s;return r=r>=0?r:0,r=r<this._array.length?r:this._array.length-1,this._array.splice(e,1),this._array.splice(r,0,t),this.moved.raiseEvent(t),r}lower(t,e=1){const s=this._array.indexOf(t);return s>-1?this._move(t,s,s-Math.ceil(e)):null}raise(t,e=1){const s=this._array.indexOf(t);return s>-1?this._move(t,s,s+Math.ceil(e)):null}indexOf(t){return this._array.indexOf(t)}indexOfKey(t){if(!!this.uniqueKey)return this._array.findIndex(e=>e[this.uniqueKey]===t)}destroy(){super.destroy(),this.moved.destroy()}}class Lh{constructor(){this.layers=new Map}registerLayer(t){const{exclusiveGroups:e}=t;e.length>0&&(e.forEach(s=>{this.layers.has(s)||this.layers.set(s,new Set),this.layers.get(s).add(t)}),t.active&&this.handleLayerActivated(t))}unregisterLayer(t){const{exclusiveGroups:e}=t;e.length>0&&e.forEach(s=>{this.layers.get(s).delete(t)})}handleSplitDirectionChanged(t){t.active&&this.handleLayerActivated(t)}handleLayerActivated(t){const{exclusiveGroups:e}=t;if(e.length>0){const s=t.splitDirection||0;e.forEach(r=>{this.layers.has(r)&&this.layers.get(r).forEach(n=>{n!==t&&!(s&&n.splitDirection&&n.splitDirection!==s)&&n.deactivate()})})}}handleExclusiveGroupsChanged(t){[...this.layers.values()].forEach(e=>{e.delete(t)}),this.registerLayer(t)}getActiveLayersForGroup(t){const e=this.layers.get(t);if(e){const s=[];return e.forEach(r=>{r.active&&s.push(r)}),s}return[]}clear(){this.layers.clear()}destroy(){this.clear()}}class Te extends Mi{static from(t){const e=new Te;if(t)for(const s of t)e.add(s);return e}constructor(){super();this._layerEventListeners={},this._zIndexSymbol=Symbol("zIndex"),this.stateChanged=new R,this.exclusiveManager=new Lh,this._globalHider=new qr}get zIndexSymbol(){return this._zIndexSymbol}get globalHider(){return this._globalHider}set globalHider(t){v(t,qr),this._globalHider=t,this._array.forEach(e=>{e.setGlobalHider(this._globalHider)})}_listenToLayerEvents(t){const e=t.stateChanged.addEventListener(a=>{a===K.ACTIVE&&this.exclusiveManager.handleLayerActivated(t),this.stateChanged.raiseEvent(t)}),s=t.zIndexChanged.addEventListener(()=>{this._zIndexChanged(t)}),r=t.exclusiveGroupsChanged.addEventListener(()=>{this.exclusiveManager.handleExclusiveGroupsChanged(t)}),n=[e,s,r];t.splitDirectionChanged&&n.push(t.splitDirectionChanged.addEventListener(()=>{this.exclusiveManager.handleSplitDirectionChanged(t)})),this._layerEventListeners[t.name]=n}_findZIndexPosition(t){const e=this._array.findIndex(s=>s[this._zIndexSymbol]>t);return e>-1?e:null}_zIndexChanged(t){const e=this.indexOf(t);if(e>-1){t[this._zIndexSymbol]=t.zIndex;let s=this._findZIndexPosition(t.zIndex);s>0&&s>e&&(s-=1),s=s!=null?s:this._array.length-1,this._move(t,e,s),this._ensureLocalZIndex(t)}}_ensureLocalZIndex(t){const e=this.indexOf(t);if(e>0){const s=this._array[e-1][this._zIndexSymbol];s>t[this._zIndexSymbol]&&(t[this._zIndexSymbol]=s)}if(e<this._array.length-1){const s=this._array[e+1][this._zIndexSymbol];s<t[this._zIndexSymbol]&&(t[this._zIndexSymbol]=s)}}add(t,e){let s=e;e==null&&(s=this._findZIndexPosition(t.zIndex));const r=super.add(t,s);return r!=null&&(t[this._zIndexSymbol]=t.zIndex,t.setGlobalHider(this._globalHider),this._ensureLocalZIndex(t),this._listenToLayerEvents(t),this.exclusiveManager.registerLayer(t)),r}_remove(t){return this._layerEventListeners[t.name]&&(this._layerEventListeners[t.name].forEach(e=>{e()}),delete this._layerEventListeners[t.name]),delete t[this._zIndexSymbol],t.setGlobalHider(null),this.exclusiveManager.unregisterLayer(t),super._remove(t)}clear(){Object.values(this._layerEventListeners).flat().forEach(t=>{t()}),this._array.forEach(t=>{delete t[this._zIndexSymbol]}),this.exclusiveManager.clear(),this._layerEventListeners={},super.clear()}destroy(){Object.values(this._layerEventListeners).flat().forEach(t=>{t()}),this._layerEventListeners={},this.exclusiveManager.destroy(),this._globalHider.destroy(),super.destroy()}}const Jt={INACTIVE:1,ACTIVE:2,LOADING:4},B0={};class Ee extends re{static get className(){return"VcsMap"}static get specificLayerImpl(){return B0}static getDefaultOptions(){return{fallbackMap:void 0}}constructor(t){super(t);this.mapElement=document.createElement("div"),this.mapElement.setAttribute("id",Xt()),this.mapElement.classList.add("mapElement"),this.mapElement.style.display="none",this._target=null,t.target&&this.setTarget(t.target),this._layerCollection=t.layerCollection||new Te,this.destroyLayerCollection=!t.layerCollection,this._collectionListeners=[],this._setLayerCollectionListeners(),this.initialized=!1,this.movementDisabled=!1,this.fallbackMap=t.fallbackMap||null,this._visualizations=new Map,this._state=Jt.INACTIVE,this.stateChanged=new R,this.pointerInteractionEvent=new R,this.splitScreen=null}get active(){return this._state===Jt.ACTIVE}get loading(){return this._state===Jt.LOADING}get target(){return this._target}get layerCollection(){return this._layerCollection}set layerCollection(t){v(t,Te),this.destroyLayerCollection=!1,[...this._layerCollection].forEach(e=>{e.removedFromMap(this)}),this._layerCollection=t,this.active&&[...this._layerCollection].forEach(e=>{e.mapActivated(this)}),this._setLayerCollectionListeners()}_setLayerCollectionListeners(){this._collectionListeners.forEach(t=>{t()}),this._collectionListeners=[this.layerCollection.moved.addEventListener(t=>{this.indexChanged(t)}),this.layerCollection.added.addEventListener(t=>{this._layerAdded(t)}),this.layerCollection.removed.addEventListener(t=>{this._layerRemoved(t)})]}canShowViewpoint(t){return Promise.resolve(!0)}setTarget(t){it(t,[String,HTMLElement]),this._target&&this._target.removeChild(this.mapElement),this._target=typeof t=="string"?document.getElementById(t):t,this._target&&this._target.appendChild(this.mapElement)}async initialize(){}indexChanged(t){}_layerAdded(t){this.active&&t.mapActivated(this)}_layerRemoved(t){t.removedFromMap(this)}validateVisualization(t){const e=t[z];return e==null?(this.getLogger().warning("item is missing vcsLayerName symbol"),!1):this.layerCollection.hasKey(e)}addVisualization(t){if(!this.validateVisualization(t))throw new Error("Visualization item is not valid, validate before adding");const e=t[z];this._visualizations.has(e)||this._visualizations.set(e,new Set),this._visualizations.get(e).add(t)}removeVisualization(t){const e=t[z],s=this._visualizations.get(e);s&&(s.delete(t),s.size===0&&this._visualizations.delete(e))}getVisualizationsForLayer(t){return this._visualizations.get(t.name)}getVisualizations(){return[...this._visualizations.values()].map(t=>[...t]).flat()}async activate(){if(this._state===Jt.INACTIVE){if(this._state=Jt.LOADING,this.stateChanged.raiseEvent(Jt.LOADING),this.mapElement.style.display="",await this.initialize(),this._state!==Jt.LOADING||(this._state=Jt.ACTIVE,await Promise.all([...this.layerCollection].map(t=>t.mapActivated(this))),this._state!==Jt.ACTIVE))return;this.stateChanged.raiseEvent(this._state)}}deactivate(){this._state!==Jt.INACTIVE&&(this.mapElement.style.display="none",this._state=Jt.INACTIVE,[...this.layerCollection].forEach(t=>{t.mapDeactivated(this)}),this.stateChanged.raiseEvent(this._state))}disableMovement(t){this.movementDisabled=t}gotoViewPoint(t,e){return Promise.resolve()}async getViewPoint(){return null}getViewPointSync(){return null}getCurrentResolution(t){return 1}pointIsVisible(t){return!1}requestRender(){}toJSON(){const t=super.toJSON();return this.fallbackMap&&(t.fallbackMap=this.fallbackMap),t}destroy(){super.destroy(),this.mapElement&&(this.mapElement.parentElement&&this.mapElement.parentElement.removeChild(this.mapElement),this.mapElement=null),this._target=null,this._collectionListeners.forEach(t=>{t()}),this._collectionListeners=[],this.layerCollection&&[...this.layerCollection].forEach(t=>{t.removedFromMap(this)}),this.stateChanged&&(this.stateChanged.destroy(),this.stateChanged=null),this.destroyLayerCollection&&this.layerCollection&&this.layerCollection.destroy(),this.pointerInteractionEvent&&(this.pointerInteractionEvent.destroy(),this.pointerInteractionEvent=null),this._layerCollection=null}}ri.registerClass(Ee.className,Ee);let U=1;class kt{static get interactionTypeCounter(){return U}static getNextBit(t){return t<<1}}const lt={NONE:U=kt.getNextBit(U),ALT:U=kt.getNextBit(U),CTRL:U=kt.getNextBit(U),SHIFT:U=kt.getNextBit(U),ALL:0};lt.ALL=lt.NONE|lt.ALT|lt.CTRL|lt.SHIFT;const k={NONE:0,CLICK:U=kt.getNextBit(U),DBLCLICK:U=kt.getNextBit(U),DRAG:U=kt.getNextBit(U),DRAGSTART:U=kt.getNextBit(U),DRAGEND:U=kt.getNextBit(U),MOVE:U=kt.getNextBit(U),DRAGEVENTS:0,CLICKMOVE:0,ALL:0};k.DRAGEVENTS=k.DRAG|k.DRAGEND|k.DRAGSTART,k.CLICKMOVE=k.CLICK|k.MOVE,k.ALL=Object.values(k).reduce((i,t)=>i|t,0);const mt={LEFT:U=kt.getNextBit(U),RIGHT:U=kt.getNextBit(U),MIDDLE:U=kt.getNextBit(U),ALL:0};mt.ALL=mt.LEFT|mt.RIGHT|mt.MIDDLE;const zt={DOWN:1,UP:2,MOVE:3};function Th(i,t,e){const s=e.indexOfKey(t[z]);if(s>-1){const r=i.getArray();if(!r.includes(t)){let n=r.findIndex(a=>e.indexOfKey(a[z])>s);n===-1&&(n=r.length),i.insertAt(n,t)}}}class Us extends Ee{static get className(){return"BaseOLMap"}constructor(t){super(t);this._olMap=null,this._olListeners=[]}get olMap(){return this._olMap}_raisePointerInteraction(t,e){const s={"-1":mt.ALL,0:mt.LEFT,1:mt.MIDDLE,2:mt.RIGHT};let r=t.originalEvent.shiftKey?lt.SHIFT:lt.NONE;r=t.originalEvent.ctrlKey?lt.CTRL:r,r=t.originalEvent.altKey?lt.ALT:r,r!==lt.NONE&&t.preventDefault(),t.originalEvent.preventDefault();const n=[t.coordinate[0],t.coordinate[1],0];this.pointerInteractionEvent.raiseEvent({map:this,position:n,positionOrPixel:n,windowPosition:Ht.fromArray(t.pixel,0,new Ht),key:r,pointer:s[t.originalEvent.button||0],pointerEvent:e})}setTarget(t){super.setTarget(t),this._olMap&&this.target&&this._olMap.updateSize()}async initialize(){if(!this._olMap){this._olMap=new fd({layers:[],controls:[],interactions:gd({altShiftDragRotate:!1,pinchRotate:!1,shiftDragZoom:!1,doubleClickZoom:!1}),target:this.mapElement});const t=this.olMap.on("pointerdown",r=>{this._raisePointerInteraction(r,zt.DOWN)}),e=this.olMap.on("pointerup",r=>{this._raisePointerInteraction(r,zt.UP)}),s=this.olMap.on("pointermove",r=>{this._raisePointerInteraction(r,zt.MOVE)});this._olListeners.push(t,e,s)}}async activate(){await super.activate(),this.active&&this._olMap.updateSize()}indexChanged(t){const e=this.getVisualizationsForLayer(t);e&&e.forEach(s=>{const r=this._olMap.getLayers();r.remove(s),Th(r,s,this.layerCollection)})}addOLLayer(t){this.validateVisualization(t)&&(this.addVisualization(t),Th(this._olMap.getLayers(),t,this.layerCollection))}removeOLLayer(t){this.removeVisualization(t),this._olMap.getLayers().remove(t)}disableMovement(t){super.disableMovement(t),this._olMap&&this._olMap.getInteractions().forEach(e=>{e.setActive(!t)})}getCurrentResolution(t){const e=this.olMap?this.olMap.getView():null;return e?e.getResolution():1}requestRender(){this._olMap&&this._olMap.render()}destroy(){this._olMap&&this._olMap.setTarget(null),yt(this._olListeners),super.destroy()}}ri.registerClass(Us.className,Us);class tt extends Us{static get className(){return"OpenlayersMap"}static getDefaultOptions(){return O(_({},Ee.getDefaultOptions()),{fixedNorthOrientation:!0})}constructor(t){super(t);const e=tt.getDefaultOptions();this.fixedNorthOrientation=rt(t.fixedNorthOrientation,e.fixedNorthOrientation)}async initialize(){this.initialized||(await super.initialize(),this.olMap.setView(new bn({center:[1.2309226203948376e6,6350766117974091e-9],zoom:13})),this.initialized=!0)}async getViewPoint(){return this.getViewPointSync()}getViewPointSync(){const t=this.olMap.getView(),e=t.getCenter(),s=dt(t.getProjection(),"EPSG:4326"),r=Math.PI/3,n=this.olMap.getViewport(),a={};a.height=n.offsetHeight||1,a.width=n.offsetWidth||1;const o=a.width/a.height,l=Math.atan(Math.tan(r*.5)/o)*2,h=s(e.slice(0,2),void 0,void 0),c=t.getProjection().getMetersPerUnit(),d=t.getResolution()*a.height,f=Math.cos(Math.abs(P.toRadians(h[1]))),g=d*c*f,m=Math.abs(g/2/Math.tan(l/2)),p=-P.toDegrees(t.getRotation()),y=h,M=-90;return new oe({groundPosition:y,pitch:M,heading:p,distance:m})}gotoViewPoint(t){if(this.movementDisabled||!t.isValid())return Promise.resolve();this.fixedNorthOrientation&&(t.heading=0);const e=this.olMap.getView(),s=dt("EPSG:4326",e.getProjection());let r=[];t.groundPosition?r=t.groundPosition.slice(0,2):r=t.cameraPosition.slice(0,2);const{distance:n}=t,a=s(r,void 0,void 0),o=Math.PI/3,l=this.olMap.getViewport(),h={};h.height=l.offsetHeight?l.offsetHeight:1,h.width=l.offsetWidth?l.offsetWidth:1;const c=h.width/h.height,u=Math.atan(Math.tan(o*.5)/c)*2,d=2*n*Math.tan(u/2),f=e.getProjection().getMetersPerUnit(),g=Math.cos(Math.abs(P.toRadians(r[1]))),p=d/f/g/h.height;if(t.animate){let y=0;return!this.fixedNorthOrientation&&t.heading!=null&&(y=-P.toRadians(t.heading)),new Promise(M=>{e.animate({duration:t.duration?t.duration*1e3:100,center:a,easing:md,resolution:p,rotation:y},()=>{M()})})}else e.setCenter(a),e.setResolution(p),!this.fixedNorthOrientation&&t.heading!=null&&e.setRotation(-P.toRadians(t.heading));return Promise.resolve()}pointIsVisible(t){const e=this.olMap.getView(),s=e.calculateExtent(this.olMap.getSize()),r=dt(e.getProjection(),"EPSG:4326"),n=[s[0],s[3]],a=[s[2],s[1]],o=[r(n,void 0,void 0),r(a,void 0,void 0)];return Go(ys(o),t[0],t[1])}toJSON(){const t=super.toJSON(),e=tt.getDefaultOptions();return this.fixedNorthOrientation!==e.fixedNorthOrientation&&(t.fixedNorthOrientation=this.fixedNorthOrientation),t}}ri.registerClass(tt.className,tt);class Ue extends re{static get className(){return"LayerImplementation"}constructor(t,e){super(e);this.map=t,this.url=e.url,this._state=K.INACTIVE,this._initialized=!1}get initialized(){return this._initialized}get active(){return this._state===K.ACTIVE}get loading(){return this._state===K.LOADING}async initialize(){this._initialized=!0}async activate(){this.map.active&&!this.active&&(this._state=K.LOADING,await this.initialize(),this.loading&&(this._state=K.ACTIVE))}deactivate(){this._state=K.INACTIVE}destroy(){this._initialized=!1,this._state=K.INACTIVE,this.map=null,super.destroy()}}class qs extends Ue{static get className(){return"LayerOpenlayersImpl"}constructor(t,e){super(t,e);this.olLayer=null}initialize(){return this.initialized||(this.olLayer=this.getOLLayer(),this.olLayer[z]=this.name,this.map.addOLLayer(this.olLayer)),super.initialize()}async activate(){await super.activate(),this.active&&this.olLayer.setVisible(!0)}deactivate(){super.deactivate(),this.olLayer&&this.olLayer.setVisible(!1)}getOLLayer(){throw new Error}destroy(){this.olLayer&&this.map.removeOLLayer(this.olLayer),this.olLayer=null,super.destroy()}}function Nh(i,t,e){const s={flat:!0,renderState:{depthTest:{enabled:!0}}},r=t.getColor();if(r instanceof CanvasPattern){const n=document.createElement("canvas"),a=n.getContext("2d");a.fillStyle=r,a.fillRect(0,0,300,300),s.material=Oi.fromType("Wallpaper",{image:n,anchor:Yd.wgs84ToDrawingBufferCoordinates(i,C.fromDegreesArray(On(e.getGeometry().getExtent()))[0])})}else{const n=ai(r,[0,0,0,1]);s.material=Oi.fromType("Color",{color:n}),s.translucent=n.alpha!==1}return new Xd(s)}function Dh(i,t,e,s){const r=t.map(o=>new pr({geometry:o,attributes:{color:Jo.fromColor(e)}})),n=new Rn({flat:!1,renderState:{depthTest:{enabled:!0},lineWidth:1},translucent:e.alpha!==1}),a=O(_({},i),{geometryInstances:r,appearance:n,shadows:Ss.ENABLED,classificationType:s});return new Ko(a)}function Fh(i,t,e,s,r,n,a){const o=t.getClassificationType(s),l={shadows:Ss.ENABLED,allowPicking:e};let h;if(o!==void 0&&!a){if(!Ko.isSupported(i))return null;const c=ai(n.getFill().getColor(),[0,0,0,1]);h=Dh(l,r,c,o)}else{const c=r.map(d=>new pr({geometry:d}));l.geometryInstances=c;const u=Nh(i,n.getFill(),s);if(l.appearance=u,a){if(!Qo.isSupported(i))return null;l.classificationType=o||Pi.TERRAIN,h=new Qo(l)}else h=new An(l)}return h}function Rh(i,t,e,s,r,n){const a=ai(n.getStroke().getColor(),[0,0,0,1]),o=r.map(u=>new pr({geometry:u,attributes:{color:Jo.fromColor(a)}})),l=new Rn({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:1},translucent:a.alpha!==1}),h={geometryInstances:o,appearance:l,shadows:Ss.ENABLED,allowPicking:e};return new An(h)}function Ta(i,t,e,s,r,n,a){const o=t.getClassificationType(s),l=r.map(g=>new pr({geometry:g})),h=ai(n.getStroke().getColor(),[0,0,0,1]);let c;n.getStroke().getLineDash()?c=Oi.fromType("Stripe",{horizontal:!1,repeat:500,evenColor:h,oddColor:new Ot(0,0,0,0)}):c=Oi.fromType("Color",{color:h});const u=new Zd({renderState:{depthTest:{enabled:!0},lineWidth:1},translucent:h.alpha!==1,material:c}),d={geometryInstances:l,appearance:u,shadows:Ss.ENABLED,allowPicking:e};let f;if(a){if(!tl.isSupported(i))return null;d.classificationType=o||Pi.TERRAIN,f=new tl(d)}else f=new An(d);return f}function Ah(i,t){if(i!=null&&Number.isFinite(Number(i)))return i;if(t){let e=1/0;for(let s=0;s<t.length;s++)e=t[s][2]<e?t[s][2]:e;if(Number.isFinite(e))return e}return 0}function Na(i,t,e){const s=Math.abs(i),r=[];if(t.length){let n=0;for(let o=0;o<t.length;o++)if(n+=t[o],n<s)r.push(t[o]);else return r.push(t[o]-(n-s)),r;const a=t[t.length-1];for(;n<s;)if(n+=a,n<s)r.push(a);else return r.push(a-(n-s)),r}else if(e)return new Array(e).fill(s/e);return[s]}function Da(i,t){if(i&&t.length){const e=i-t.length;e>0?t.push(...new Array(e).fill(t[t.length-1])):e<0&&t.splice(t.length+e),i>100&&t.splice(100)}else t.splice(0)}function Gh(i,t,e){return t===Yt.RELATIVE_TO_GROUND?e.getHeightAboveGround(i):0}function Qr(i,t,e){const s=t.getExtrudedHeight(i),r=Math.abs(V(i.get("olcs_storeyNumber"),0)),n=Math.abs(E(i.get("olcs_storeyHeight"),0));let a=0,o=0,l=[],h=[];if(n||r)if(s&&s>0&&n)a=Math.ceil(s/n),l=new Array(a-1).fill(n),l.push(s-(a-1)*n);else if(s&&s<0&&n)o=Math.ceil(Math.abs(s/n)),h=new Array(o-1).fill(n),h.push(Math.abs(s)-(o-1)*n);else if(s&&s>0&&r){a=r;const M=Math.abs(s/r);l=new Array(r).fill(M)}else if(s&&s<0&&r){o=r;const M=Math.abs(s/r);h=new Array(r).fill(M)}else r&&n?(a=r,l=new Array(r).fill(n)):r&&t.storeyHeight&&(a=r,l=new Array(r).fill(t.storeyHeight));!(a&&l.length)&&!(o&&h.length)&&(a=t.getStoreysAboveGround(i),o=t.getStoreysBelowGround(i),l=t.getStoreyHeightsAboveGround(i),h=t.getStoreyHeightsBelowGround(i),s&&(s>0?(l=Na(s,l,a),a=l.length,h=[],o=0):s<0&&(h=Na(s,h,o),o=h.length,l=[],a=0))),Da(a,l),Da(o,h);const c=t.getSkirt(i),u=t.getGroundLevel(i),d=t.getAltitudeMode(i),f=Gh(i,d,t),g=Ah(u,e)+f,m=!!e.find(M=>M[2]),p=!!(l.length||h.length||c),y=m&&(!p||p&&l.length+h.length===1);return{extruded:p,storeyHeightsAboveGround:l,storeyHeightsBelowGround:h,skirt:c,groundLevel:g,perPositionHeight:y,heightReference:d,heightAboveGroundAdjustment:f}}function Fa(i,t,e,s){const r=e?-1:1;let n=t;const a=i.length,o=new Array(a);for(let l=0;l<a;l++){const h=n+r*i[l];o[l]={currentHeight:n,extrudedHeight:h},n=h}return s?(s.push(...o),s):o}function tn(i,t,e,s,r,n,a){if(!e.length)return;const o=[],l=[],h=[],c=Qr(i,s,n.getCoordinates(e)),u=!!t.getFill(),d=!!t.getStroke();let f=!1;e.forEach(p=>{const y=n.getGeometryOptions(p,c.heightAboveGroundAdjustment),M=Fa(c.storeyHeightsAboveGround,c.groundLevel);if(Fa(c.storeyHeightsBelowGround,c.groundLevel,!0,M),u&&M.forEach(x=>{o.push(...n.createSolidGeometries(y,x.currentHeight,c.perPositionHeight,x.extrudedHeight))}),d&&M.forEach(x=>{l.push(...n.createOutlineGeometries(y,x.currentHeight,c.perPositionHeight,x.extrudedHeight))}),c.skirt){const x=c.groundLevel-c.storeyHeightsBelowGround.reduce((D,Y)=>D+Y,0),L=x-c.skirt,I=c.storeyHeightsBelowGround.length?!1:c.perPositionHeight;u&&o.push(...n.createSolidGeometries(y,x,I,L)),d&&l.push(...n.createOutlineGeometries(y,x,I,L))}c.extruded||(c.heightReference===Yt.CLAMP_TO_GROUND&&(f=!0),u&&o.push(...n.createFillGeometries(y,c.groundLevel,c.perPositionHeight)),d&&(c.heightReference===Yt.CLAMP_TO_GROUND?h.push(...n.createGroundLineGeometries(y,t)):h.push(...n.createLineGeometries(y,t))))});const g=s.getAllowPicking(i),m=[];if(h.length){const p=Ta(r,s,g,i,h,t,f);p&&m.push(p)}if(o.length){const p=Fh(r,s,g,i,o,t,f);p&&m.push(p)}if(l.length){const p=Rh(r,s,g,i,l,t);p&&m.push(p)}a.addPrimitives(m,i,g)}var qt={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"},Ra={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},U0=function(){function i(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return i.prototype.preventDefault=function(){this.defaultPrevented=!0},i.prototype.stopPropagation=function(){this.propagationStopped=!0},i}(),kh=U0,q0={PROPERTYCHANGE:"propertychange"},W0=function(){function i(){this.disposed=!1}return i.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},i.prototype.disposeInternal=function(){},i}(),Y0=W0;function X0(i,t){return i>t?1:i<t?-1:0}function Z0(i,t){for(var e=Array.isArray(t)?t:[t],s=e.length,r=0;r<s;r++)i[i.length]=e[r]}function J0(i,t){var e=i.length;if(e!==t.length)return!1;for(var s=0;s<e;s++)if(i[s]!==t[s])return!1;return!0}function zh(){}function K0(i){var t=!1,e,s,r;return function(){var n=Array.prototype.slice.call(arguments);return(!t||this!==r||!J0(n,s))&&(t=!0,r=this,s=n,e=i.apply(this,arguments)),e}}var jh=typeof Object.assign=="function"?Object.assign:function(i,t){if(i==null)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(i),s=1,r=arguments.length;s<r;++s){var n=arguments[s];if(n!=null)for(var a in n)n.hasOwnProperty(a)&&(e[a]=n[a])}return e};function $h(i){for(var t in i)delete i[t]}function Q0(i){var t;for(t in i)return!1;return!t}var tv=globalThis&&globalThis.__extends||function(){var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,r){s.__proto__=r}||function(s,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(s[n]=r[n])},i(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(t,e);function s(){this.constructor=t}t.prototype=e===null?Object.create(e):(s.prototype=e.prototype,new s)}}(),ev=function(i){tv(t,i);function t(e){var s=i.call(this)||this;return s.eventTarget_=e,s.pendingRemovals_=null,s.dispatching_=null,s.listeners_=null,s}return t.prototype.addEventListener=function(e,s){if(!(!e||!s)){var r=this.listeners_||(this.listeners_={}),n=r[e]||(r[e]=[]);n.indexOf(s)===-1&&n.push(s)}},t.prototype.dispatchEvent=function(e){var s=typeof e=="string",r=s?e:e.type,n=this.listeners_&&this.listeners_[r];if(!!n){var a=s?new kh(e):e;a.target||(a.target=this.eventTarget_||this);var o=this.dispatching_||(this.dispatching_={}),l=this.pendingRemovals_||(this.pendingRemovals_={});r in o||(o[r]=0,l[r]=0),++o[r];for(var h,c=0,u=n.length;c<u;++c)if("handleEvent"in n[c]?h=n[c].handleEvent(a):h=n[c].call(this,a),h===!1||a.propagationStopped){h=!1;break}if(--o[r]===0){var d=l[r];for(delete l[r];d--;)this.removeEventListener(r,zh);delete o[r]}return h}},t.prototype.disposeInternal=function(){this.listeners_&&$h(this.listeners_)},t.prototype.getListeners=function(e){return this.listeners_&&this.listeners_[e]||void 0},t.prototype.hasListener=function(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1},t.prototype.removeEventListener=function(e,s){var r=this.listeners_&&this.listeners_[e];if(r){var n=r.indexOf(s);n!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(r[n]=zh,++this.pendingRemovals_[e]):(r.splice(n,1),r.length===0&&delete this.listeners_[e]))}},t}(Y0),iv=ev,sv={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function Aa(i,t,e,s,r){if(s&&s!==i&&(e=e.bind(s)),r){var n=e;e=function(){i.removeEventListener(t,e),n.apply(this,arguments)}}var a={target:i,type:t,listener:e};return i.addEventListener(t,e),a}function Hh(i,t,e,s){return Aa(i,t,e,s,!0)}function Vh(i){i&&i.target&&(i.target.removeEventListener(i.type,i.listener),$h(i))}var rv=globalThis&&globalThis.__extends||function(){var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,r){s.__proto__=r}||function(s,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(s[n]=r[n])},i(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(t,e);function s(){this.constructor=t}t.prototype=e===null?Object.create(e):(s.prototype=e.prototype,new s)}}(),en=function(i){rv(t,i);function t(){var e=i.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return t.prototype.changed=function(){++this.revision_,this.dispatchEvent(sv.CHANGE)},t.prototype.getRevision=function(){return this.revision_},t.prototype.onInternal=function(e,s){if(Array.isArray(e)){for(var r=e.length,n=new Array(r),a=0;a<r;++a)n[a]=Aa(this,e[a],s);return n}else return Aa(this,e,s)},t.prototype.onceInternal=function(e,s){var r;if(Array.isArray(e)){var n=e.length;r=new Array(n);for(var a=0;a<n;++a)r[a]=Hh(this,e[a],s)}else r=Hh(this,e,s);return s.ol_key=r,r},t.prototype.unInternal=function(e,s){var r=s.ol_key;if(r)nv(r);else if(Array.isArray(e))for(var n=0,a=e.length;n<a;++n)this.removeEventListener(e[n],s);else this.removeEventListener(e,s)},t}(iv);en.prototype.on,en.prototype.once,en.prototype.un;function nv(i){if(Array.isArray(i))for(var t=0,e=i.length;t<e;++t)Vh(i[t]);else Vh(i)}var av=en;function Kt(){return function(){throw new Error("Unimplemented abstract method.")}()}var ov=0;function lv(i){return i.ol_uid||(i.ol_uid=String(++ov))}var Bh=globalThis&&globalThis.__extends||function(){var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,r){s.__proto__=r}||function(s,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(s[n]=r[n])},i(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(t,e);function s(){this.constructor=t}t.prototype=e===null?Object.create(e):(s.prototype=e.prototype,new s)}}(),Uh=function(i){Bh(t,i);function t(e,s,r){var n=i.call(this,e)||this;return n.key=s,n.oldValue=r,n}return t}(kh),hv=function(i){Bh(t,i);function t(e){var s=i.call(this)||this;return s.on,s.once,s.un,lv(s),s.values_=null,e!==void 0&&s.setProperties(e),s}return t.prototype.get=function(e){var s;return this.values_&&this.values_.hasOwnProperty(e)&&(s=this.values_[e]),s},t.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},t.prototype.getProperties=function(){return this.values_&&jh({},this.values_)||{}},t.prototype.hasProperties=function(){return!!this.values_},t.prototype.notify=function(e,s){var r;r="change:".concat(e),this.hasListener(r)&&this.dispatchEvent(new Uh(r,e,s)),r=q0.PROPERTYCHANGE,this.hasListener(r)&&this.dispatchEvent(new Uh(r,e,s))},t.prototype.addChangeListener=function(e,s){this.addEventListener("change:".concat(e),s)},t.prototype.removeChangeListener=function(e,s){this.removeEventListener("change:".concat(e),s)},t.prototype.set=function(e,s,r){var n=this.values_||(this.values_={});if(r)n[e]=s;else{var a=n[e];n[e]=s,a!==s&&this.notify(e,a)}},t.prototype.setProperties=function(e,s){for(var r in e)this.set(r,e[r],s)},t.prototype.applyProperties=function(e){!e.values_||jh(this.values_||(this.values_={}),e.values_)},t.prototype.unset=function(e,s){if(this.values_&&e in this.values_){var r=this.values_[e];delete this.values_[e],Q0(this.values_)&&(this.values_=null),s||this.notify(e,r)}},t}(av),cv=hv,zi={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},ji={};ji[zi.RADIANS]=6370997/(2*Math.PI),ji[zi.DEGREES]=2*Math.PI*6370997/360,ji[zi.FEET]=.3048,ji[zi.METERS]=1,ji[zi.USFEET]=1200/3937;var Ga=zi;new Array(6);function uv(){return[1,0,0,1,0,0]}function dv(i,t,e,s,r,n,a,o){var l=Math.sin(n),h=Math.cos(n);return i[0]=s*h,i[1]=r*l,i[2]=-s*l,i[3]=r*h,i[4]=a*s*h-o*s*l+t,i[5]=a*r*l+o*r*h+e,i}var St={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function qh(i,t,e){var s,r;return t<i[0]?s=i[0]-t:i[2]<t?s=t-i[2]:s=0,e<i[1]?r=i[1]-e:i[3]<e?r=e-i[3]:r=0,s*s+r*r}function fv(i,t){return i[0]<=t[0]&&t[2]<=i[2]&&i[1]<=t[1]&&t[3]<=i[3]}function gv(i,t,e){return i[0]<=t&&t<=i[2]&&i[1]<=e&&e<=i[3]}function Wh(i,t){var e=i[0],s=i[1],r=i[2],n=i[3],a=t[0],o=t[1],l=St.UNKNOWN;return a<e?l=l|St.LEFT:a>r&&(l=l|St.RIGHT),o<s?l=l|St.BELOW:o>n&&(l=l|St.ABOVE),l===St.UNKNOWN&&(l=St.INTERSECTING),l}function Yh(){return[1/0,1/0,-1/0,-1/0]}function Xh(i,t,e,s,r){return r?(r[0]=i,r[1]=t,r[2]=e,r[3]=s,r):[i,t,e,s]}function Zh(i){return Xh(1/0,1/0,-1/0,-1/0,i)}function mv(i,t){var e=i[0],s=i[1];return Xh(e,s,e,s,t)}function pv(i,t,e,s,r){var n=Zh(r);return Jh(n,i,t,e,s)}function Jh(i,t,e,s,r){for(;e<s;e+=r)yv(i,t[e],t[e+1]);return i}function yv(i,t,e){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}function vv(i,t){var e;return e=t(_v(i)),e||(e=t(Sv(i)),e)||(e=t(Cv(i)),e)||(e=t(Mv(i)),e)?e:!1}function _v(i){return[i[0],i[1]]}function Sv(i){return[i[2],i[1]]}function Kh(i){return[(i[0]+i[2])/2,(i[1]+i[3])/2]}function Qh(i){return i[3]-i[1]}function Mv(i){return[i[0],i[3]]}function Cv(i){return[i[2],i[3]]}function wv(i,t){return i[0]<=t[2]&&i[2]>=t[0]&&i[1]<=t[3]&&i[3]>=t[1]}function xv(i,t){return t?(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t):i}function bv(i,t,e){var s=!1,r=Wh(i,t),n=Wh(i,e);if(r===St.INTERSECTING||n===St.INTERSECTING)s=!0;else{var a=i[0],o=i[1],l=i[2],h=i[3],c=t[0],u=t[1],d=e[0],f=e[1],g=(f-u)/(d-c),m=void 0,p=void 0;!!(n&St.ABOVE)&&!(r&St.ABOVE)&&(m=d-(f-h)/g,s=m>=a&&m<=l),!s&&!!(n&St.RIGHT)&&!(r&St.RIGHT)&&(p=f-(d-l)*g,s=p>=o&&p<=h),!s&&!!(n&St.BELOW)&&!(r&St.BELOW)&&(m=d-(f-o)/g,s=m>=a&&m<=l),!s&&!!(n&St.LEFT)&&!(r&St.LEFT)&&(p=f-(d-a)*g,s=p>=o&&p<=h)}return s}var Ov=function(){function i(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return i.prototype.canWrapX=function(){return this.canWrapX_},i.prototype.getCode=function(){return this.code_},i.prototype.getExtent=function(){return this.extent_},i.prototype.getUnits=function(){return this.units_},i.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||ji[this.units_]},i.prototype.getWorldExtent=function(){return this.worldExtent_},i.prototype.getAxisOrientation=function(){return this.axisOrientation_},i.prototype.isGlobal=function(){return this.global_},i.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)},i.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},i.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},i.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)},i.prototype.setWorldExtent=function(t){this.worldExtent_=t},i.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},i.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},i}(),tc=Ov,Pv=function(){var i;return"cosh"in Math?i=Math.cosh:i=function(t){var e=Math.exp(t);return(e+1/e)/2},i}();function Ev(i,t,e,s,r,n){var a=r-e,o=n-s;if(a!==0||o!==0){var l=((i-e)*a+(t-s)*o)/(a*a+o*o);l>1?(e=r,s=n):l>0&&(e+=a*l,s+=o*l)}return $i(i,t,e,s)}function $i(i,t,e,s){var r=e-i,n=s-t;return r*r+n*n}function Iv(i,t){var e=i%t;return e*t<0?e+t:e}function Lv(i,t,e){return i+e*(t-i)}var Tv=globalThis&&globalThis.__extends||function(){var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,r){s.__proto__=r}||function(s,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(s[n]=r[n])},i(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(t,e);function s(){this.constructor=t}t.prototype=e===null?Object.create(e):(s.prototype=e.prototype,new s)}}(),Ws=6378137,Hi=Math.PI*Ws,Nv=[-Hi,-Hi,Hi,Hi],Dv=[-180,-85,180,85],sn=Ws*Math.log(Math.tan(Math.PI/2)),Vi=function(i){Tv(t,i);function t(e){return i.call(this,{code:e,units:Ga.METERS,extent:Nv,global:!0,worldExtent:Dv,getPointResolution:function(s,r){return s/Pv(r[1]/Ws)}})||this}return t}(tc),ec=[new Vi("EPSG:3857"),new Vi("EPSG:102100"),new Vi("EPSG:102113"),new Vi("EPSG:900913"),new Vi("http://www.opengis.net/def/crs/EPSG/0/3857"),new Vi("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Fv(i,t,e){var s=i.length,r=e>1?e:2,n=t;n===void 0&&(r>2?n=i.slice():n=new Array(s));for(var a=0;a<s;a+=r){n[a]=Hi*i[a]/180;var o=Ws*Math.log(Math.tan(Math.PI*(+i[a+1]+90)/360));o>sn?o=sn:o<-sn&&(o=-sn),n[a+1]=o}return n}function Rv(i,t,e){var s=i.length,r=e>1?e:2,n=t;n===void 0&&(r>2?n=i.slice():n=new Array(s));for(var a=0;a<s;a+=r)n[a]=180*i[a]/Hi,n[a+1]=360*Math.atan(Math.exp(i[a+1]/Ws))/Math.PI-90;return n}var Av=globalThis&&globalThis.__extends||function(){var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,r){s.__proto__=r}||function(s,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(s[n]=r[n])},i(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(t,e);function s(){this.constructor=t}t.prototype=e===null?Object.create(e):(s.prototype=e.prototype,new s)}}(),Gv=6378137,ic=[-180,-90,180,90],kv=Math.PI*Gv/180,di=function(i){Av(t,i);function t(e,s){return i.call(this,{code:e,units:Ga.DEGREES,extent:ic,axisOrientation:s,global:!0,metersPerUnit:kv,worldExtent:ic})||this}return t}(tc),sc=[new di("CRS:84"),new di("EPSG:4326","neu"),new di("urn:ogc:def:crs:OGC:1.3:CRS84"),new di("urn:ogc:def:crs:OGC:2:84"),new di("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new di("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new di("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],ka={};function zv(i){return ka[i]||ka[i.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function jv(i,t){ka[i]=t}var Bi={};function rn(i,t,e){var s=i.getCode(),r=t.getCode();s in Bi||(Bi[s]={}),Bi[s][r]=e}function $v(i,t){var e;return i in Bi&&t in Bi[i]&&(e=Bi[i][t]),e}function rc(i,t,e){var s;if(t!==void 0){for(var r=0,n=i.length;r<n;++r)t[r]=i[r];s=t}else s=i.slice();return s}function Hv(i,t,e){if(t!==void 0&&i!==t){for(var s=0,r=i.length;s<r;++s)t[s]=i[s];i=t}return i}function Vv(i){jv(i.getCode(),i),rn(i,i,rc)}function Bv(i){i.forEach(Vv)}function za(i){return typeof i=="string"?zv(i):i||null}function nc(i){Bv(i),i.forEach(function(t){i.forEach(function(e){t!==e&&rn(t,e,rc)})})}function Uv(i,t,e,s){i.forEach(function(r){t.forEach(function(n){rn(r,n,e),rn(n,r,s)})})}function qv(i,t){var e=i.getCode(),s=t.getCode(),r=$v(e,s);return r||(r=Hv),r}function ac(i,t){var e=za(i),s=za(t);return qv(e,s)}function Wv(){nc(ec),nc(sc),Uv(sc,ec,Fv,Rv)}Wv();function Yv(i,t,e,s,r,n){for(var a=n||[],o=0,l=t;l<e;l+=s){var h=i[l],c=i[l+1];a[o++]=r[0]*h+r[2]*c+r[4],a[o++]=r[1]*h+r[3]*c+r[5]}return n&&a.length!=o&&(a.length=o),a}function Xv(i,t,e,s,r,n,a){for(var o=a||[],l=Math.cos(r),h=Math.sin(r),c=n[0],u=n[1],d=0,f=t;f<e;f+=s){var g=i[f]-c,m=i[f+1]-u;o[d++]=c+g*l-m*h,o[d++]=u+g*h+m*l;for(var p=f+2;p<f+s;++p)o[d++]=i[p]}return a&&o.length!=d&&(o.length=d),o}function Zv(i,t,e,s,r,n,a,o){for(var l=o||[],h=a[0],c=a[1],u=0,d=t;d<e;d+=s){var f=i[d]-h,g=i[d+1]-c;l[u++]=h+r*f,l[u++]=c+n*g;for(var m=d+2;m<d+s;++m)l[u++]=i[m]}return o&&l.length!=u&&(l.length=u),l}function Jv(i,t,e,s,r,n,a){for(var o=a||[],l=0,h=t;h<e;h+=s){o[l++]=i[h]+r,o[l++]=i[h+1]+n;for(var c=h+2;c<h+s;++c)o[l++]=i[c]}return a&&o.length!=l&&(o.length=l),o}var Kv=globalThis&&globalThis.__extends||function(){var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,r){s.__proto__=r}||function(s,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(s[n]=r[n])},i(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(t,e);function s(){this.constructor=t}t.prototype=e===null?Object.create(e):(s.prototype=e.prototype,new s)}}(),oc=uv(),Qv=function(i){Kv(t,i);function t(){var e=i.call(this)||this;return e.extent_=Yh(),e.extentRevision_=-1,e.simplifiedGeometryMaxMinSquaredTolerance=0,e.simplifiedGeometryRevision=0,e.simplifyTransformedInternal=K0(function(s,r,n){if(!n)return this.getSimplifiedGeometry(r);var a=this.clone();return a.applyTransform(n),a.getSimplifiedGeometry(r)}),e}return t.prototype.simplifyTransformed=function(e,s){return this.simplifyTransformedInternal(this.getRevision(),e,s)},t.prototype.clone=function(){return Kt()},t.prototype.closestPointXY=function(e,s,r,n){return Kt()},t.prototype.containsXY=function(e,s){var r=this.getClosestPoint([e,s]);return r[0]===e&&r[1]===s},t.prototype.getClosestPoint=function(e,s){var r=s||[NaN,NaN];return this.closestPointXY(e[0],e[1],r,1/0),r},t.prototype.intersectsCoordinate=function(e){return this.containsXY(e[0],e[1])},t.prototype.computeExtent=function(e){return Kt()},t.prototype.getExtent=function(e){if(this.extentRevision_!=this.getRevision()){var s=this.computeExtent(this.extent_);(isNaN(s[0])||isNaN(s[1]))&&Zh(s),this.extentRevision_=this.getRevision()}return xv(this.extent_,e)},t.prototype.rotate=function(e,s){Kt()},t.prototype.scale=function(e,s,r){Kt()},t.prototype.simplify=function(e){return this.getSimplifiedGeometry(e*e)},t.prototype.getSimplifiedGeometry=function(e){return Kt()},t.prototype.getType=function(){return Kt()},t.prototype.applyTransform=function(e){Kt()},t.prototype.intersectsExtent=function(e){return Kt()},t.prototype.translate=function(e,s){Kt()},t.prototype.transform=function(e,s){var r=za(e),n=r.getUnits()==Ga.TILE_PIXELS?function(a,o,l){var h=r.getExtent(),c=r.getWorldExtent(),u=Qh(c)/Qh(h);return dv(oc,c[0],c[3],u,-u,0,0,0),Yv(a,0,a.length,l,oc,o),ac(r,s)(a,o,l)}:ac(r,s);return this.applyTransform(n),this},t}(cv),t_=Qv,e_=globalThis&&globalThis.__extends||function(){var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,r){s.__proto__=r}||function(s,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(s[n]=r[n])},i(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(t,e);function s(){this.constructor=t}t.prototype=e===null?Object.create(e):(s.prototype=e.prototype,new s)}}(),i_=function(i){e_(t,i);function t(){var e=i.call(this)||this;return e.layout=qt.XY,e.stride=2,e.flatCoordinates=null,e}return t.prototype.computeExtent=function(e){return pv(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.getCoordinates=function(){return Kt()},t.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},t.prototype.getFlatCoordinates=function(){return this.flatCoordinates},t.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},t.prototype.getLayout=function(){return this.layout},t.prototype.getSimplifiedGeometry=function(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var s=this.getSimplifiedGeometryInternal(e),r=s.getFlatCoordinates();return r.length<this.flatCoordinates.length?s:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)},t.prototype.getSimplifiedGeometryInternal=function(e){return this},t.prototype.getStride=function(){return this.stride},t.prototype.setFlatCoordinates=function(e,s){this.stride=lc(e),this.layout=e,this.flatCoordinates=s},t.prototype.setCoordinates=function(e,s){Kt()},t.prototype.setLayout=function(e,s,r){var n;if(e)n=lc(e);else{for(var a=0;a<r;++a)if(s.length===0){this.layout=qt.XY,this.stride=2;return}else s=s[0];n=s.length,e=s_(n)}this.layout=e,this.stride=n},t.prototype.applyTransform=function(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},t.prototype.rotate=function(e,s){var r=this.getFlatCoordinates();if(r){var n=this.getStride();Xv(r,0,r.length,n,e,s,r),this.changed()}},t.prototype.scale=function(e,s,r){var n=s;n===void 0&&(n=e);var a=r;a||(a=Kh(this.getExtent()));var o=this.getFlatCoordinates();if(o){var l=this.getStride();Zv(o,0,o.length,l,e,n,a,o),this.changed()}},t.prototype.translate=function(e,s){var r=this.getFlatCoordinates();if(r){var n=this.getStride();Jv(r,0,r.length,n,e,s,r),this.changed()}},t}(t_);function s_(i){var t;return i==2?t=qt.XY:i==3?t=qt.XYZ:i==4&&(t=qt.XYZM),t}function lc(i){var t;return i==qt.XY?t=2:i==qt.XYZ||i==qt.XYM?t=3:i==qt.XYZM&&(t=4),t}var ja=i_;function hc(i,t,e,s,r,n,a){var o=i[t],l=i[t+1],h=i[e]-o,c=i[e+1]-l,u;if(h===0&&c===0)u=t;else{var d=((r-o)*h+(n-l)*c)/(h*h+c*c);if(d>1)u=e;else if(d>0){for(var f=0;f<s;++f)a[f]=Lv(i[t+f],i[e+f],d);a.length=s;return}else u=t}for(var f=0;f<s;++f)a[f]=i[u+f];a.length=s}function cc(i,t,e,s,r){var n=i[t],a=i[t+1];for(t+=s;t<e;t+=s){var o=i[t],l=i[t+1],h=$i(n,a,o,l);h>r&&(r=h),n=o,a=l}return r}function r_(i,t,e,s,r){for(var n=0,a=e.length;n<a;++n){var o=e[n];r=cc(i,t,o,s,r),t=o}return r}function uc(i,t,e,s,r,n,a,o,l,h,c){if(t==e)return h;var u,d;if(r===0)if(d=$i(a,o,i[t],i[t+1]),d<h){for(u=0;u<s;++u)l[u]=i[t+u];return l.length=s,d}else return h;for(var f=c||[NaN,NaN],g=t+s;g<e;)if(hc(i,g-s,g,s,a,o,f),d=$i(a,o,f[0],f[1]),d<h){for(h=d,u=0;u<s;++u)l[u]=f[u];l.length=s,g+=s}else g+=s*Math.max((Math.sqrt(d)-Math.sqrt(h))/r|0,1);if(n&&(hc(i,e-s,t,s,a,o,f),d=$i(a,o,f[0],f[1]),d<h)){for(h=d,u=0;u<s;++u)l[u]=f[u];l.length=s}return h}function n_(i,t,e,s,r,n,a,o,l,h,c){for(var u=c||[NaN,NaN],d=0,f=e.length;d<f;++d){var g=e[d];h=uc(i,t,g,s,r,n,a,o,l,h,u),t=g}return h}function a_(i,t,e,s){for(var r=0,n=e.length;r<n;++r)i[t++]=e[r];return t}function dc(i,t,e,s){for(var r=0,n=e.length;r<n;++r)for(var a=e[r],o=0;o<s;++o)i[t++]=a[o];return t}function o_(i,t,e,s,r){for(var n=r||[],a=0,o=0,l=e.length;o<l;++o){var h=dc(i,t,e[o],s);n[a++]=h,t=h}return n.length=a,n}function l_(i,t,e,s,r,n,a){var o=(e-t)/s;if(o<3){for(;t<e;t+=s)n[a++]=i[t],n[a++]=i[t+1];return a}var l=new Array(o);l[0]=1,l[o-1]=1;for(var h=[t,e-s],c=0;h.length>0;){for(var u=h.pop(),d=h.pop(),f=0,g=i[d],m=i[d+1],p=i[u],y=i[u+1],M=d+s;M<u;M+=s){var x=i[M],L=i[M+1],I=Ev(x,L,g,m,p,y);I>f&&(c=M,f=I)}f>r&&(l[(c-t)/s]=1,d+s<c&&h.push(d,c),c+s<u&&h.push(c,u))}for(var M=0;M<o;++M)l[M]&&(n[a++]=i[t+M*s],n[a++]=i[t+M*s+1]);return a}function Ui(i,t){return t*Math.round(i/t)}function h_(i,t,e,s,r,n,a){if(t==e)return a;var o=Ui(i[t],r),l=Ui(i[t+1],r);t+=s,n[a++]=o,n[a++]=l;var h,c;do if(h=Ui(i[t],r),c=Ui(i[t+1],r),t+=s,t==e)return n[a++]=h,n[a++]=c,a;while(h==o&&c==l);for(;t<e;){var u=Ui(i[t],r),d=Ui(i[t+1],r);if(t+=s,!(u==h&&d==c)){var f=h-o,g=c-l,m=u-o,p=d-l;if(f*p==g*m&&(f<0&&m<f||f==m||f>0&&m>f)&&(g<0&&p<g||g==p||g>0&&p>g)){h=u,c=d;continue}n[a++]=h,n[a++]=c,o=h,l=c,h=u,c=d}}return n[a++]=h,n[a++]=c,a}function c_(i,t,e,s,r,n,a,o){for(var l=0,h=e.length;l<h;++l){var c=e[l];a=h_(i,t,c,s,r,n,a),o.push(a),t=c}return a}function fc(i,t,e,s,r){for(var n=r!==void 0?r:[],a=0,o=t;o<e;o+=s)n[a++]=i.slice(o,o+s);return n.length=a,n}function u_(i,t,e,s,r){for(var n=r!==void 0?r:[],a=0,o=0,l=e.length;o<l;++o){var h=e[o];n[a++]=fc(i,t,h,s,n[a]),t=h}return n.length=a,n}function gc(i,t,e,s){for(var r=0,n=i[e-s],a=i[e-s+1];t<e;t+=s){var o=i[t],l=i[t+1];r+=a*o-n*l,n=o,a=l}return r/2}function d_(i,t,e,s){for(var r=0,n=0,a=e.length;n<a;++n){var o=e[n];r+=gc(i,t,o,s),t=o}return r}var f_=globalThis&&globalThis.__extends||function(){var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,r){s.__proto__=r}||function(s,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(s[n]=r[n])},i(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(t,e);function s(){this.constructor=t}t.prototype=e===null?Object.create(e):(s.prototype=e.prototype,new s)}}(),g_=function(i){f_(t,i);function t(e,s){var r=i.call(this)||this;return r.maxDelta_=-1,r.maxDeltaRevision_=-1,s!==void 0&&!Array.isArray(e[0])?r.setFlatCoordinates(s,e):r.setCoordinates(e,s),r}return t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,s,r,n){return n<qh(this.getExtent(),e,s)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(cc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),uc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,s,r,n))},t.prototype.getArea=function(){return gc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getCoordinates=function(){return fc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getSimplifiedGeometryInternal=function(e){var s=[];return s.length=l_(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,s,0),new t(s,qt.XY)},t.prototype.getType=function(){return Ra.LINEAR_RING},t.prototype.intersectsExtent=function(e){return!1},t.prototype.setCoordinates=function(e,s){this.setLayout(s,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=dc(this.flatCoordinates,0,e,this.stride),this.changed()},t}(ja),mc=g_,m_=globalThis&&globalThis.__extends||function(){var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,r){s.__proto__=r}||function(s,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(s[n]=r[n])},i(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(t,e);function s(){this.constructor=t}t.prototype=e===null?Object.create(e):(s.prototype=e.prototype,new s)}}(),p_=function(i){m_(t,i);function t(e,s){var r=i.call(this)||this;return r.setCoordinates(e,s),r}return t.prototype.clone=function(){var e=new t(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e},t.prototype.closestPointXY=function(e,s,r,n){var a=this.flatCoordinates,o=$i(e,s,a[0],a[1]);if(o<n){for(var l=this.stride,h=0;h<l;++h)r[h]=a[h];return r.length=l,o}else return n},t.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},t.prototype.computeExtent=function(e){return mv(this.flatCoordinates,e)},t.prototype.getType=function(){return Ra.POINT},t.prototype.intersectsExtent=function(e){return gv(e,this.flatCoordinates[0],this.flatCoordinates[1])},t.prototype.setCoordinates=function(e,s){this.setLayout(s,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=a_(this.flatCoordinates,0,e,this.stride),this.changed()},t}(ja),y_=p_;function v_(i,t,e,s,r){var n=vv(r,function(a){return!fi(i,t,e,s,a[0],a[1])});return!n}function fi(i,t,e,s,r,n){for(var a=0,o=i[e-s],l=i[e-s+1];t<e;t+=s){var h=i[t],c=i[t+1];l<=n?c>n&&(h-o)*(n-l)-(r-o)*(c-l)>0&&a++:c<=n&&(h-o)*(n-l)-(r-o)*(c-l)<0&&a--,o=h,l=c}return a!==0}function pc(i,t,e,s,r,n){if(e.length===0||!fi(i,t,e[0],s,r,n))return!1;for(var a=1,o=e.length;a<o;++a)if(fi(i,e[a-1],e[a],s,r,n))return!1;return!0}function __(i,t,e,s,r,n,a){for(var o,l,h,c,u,d,f,g=r[n+1],m=[],p=0,y=e.length;p<y;++p){var M=e[p];for(c=i[M-s],d=i[M-s+1],o=t;o<M;o+=s)u=i[o],f=i[o+1],(g<=d&&f<=g||d<=g&&g<=f)&&(h=(g-d)/(f-d)*(u-c)+c,m.push(h)),c=u,d=f}var x=NaN,L=-1/0;for(m.sort(X0),c=m[0],o=1,l=m.length;o<l;++o){u=m[o];var I=Math.abs(u-c);I>L&&(h=(c+u)/2,pc(i,t,e,s,h,g)&&(x=h,L=I)),c=u}return isNaN(x)&&(x=r[n]),a?(a.push(x,g,L),a):[x,g,L]}function S_(i,t,e,s,r){var n;for(t+=s;t<e;t+=s)if(n=r(i.slice(t-s,t),i.slice(t,t+s)),n)return n;return!1}function yc(i,t,e,s,r){var n=Jh(Yh(),i,t,e,s);return wv(r,n)?fv(r,n)||n[0]>=r[0]&&n[2]<=r[2]||n[1]>=r[1]&&n[3]<=r[3]?!0:S_(i,t,e,s,function(a,o){return bv(r,a,o)}):!1}function M_(i,t,e,s,r){return!!(yc(i,t,e,s,r)||fi(i,t,e,s,r[0],r[1])||fi(i,t,e,s,r[0],r[3])||fi(i,t,e,s,r[2],r[1])||fi(i,t,e,s,r[2],r[3]))}function C_(i,t,e,s,r){if(!M_(i,t,e[0],s,r))return!1;if(e.length===1)return!0;for(var n=1,a=e.length;n<a;++n)if(v_(i,e[n-1],e[n],s,r)&&!yc(i,e[n-1],e[n],s,r))return!1;return!0}function w_(i,t,e,s){for(;t<e-s;){for(var r=0;r<s;++r){var n=i[t+r];i[t+r]=i[e-s+r],i[e-s+r]=n}t+=s,e-=s}}function vc(i,t,e,s){for(var r=0,n=i[e-s],a=i[e-s+1];t<e;t+=s){var o=i[t],l=i[t+1];r+=(o-n)*(l+a),n=o,a=l}return r===0?void 0:r>0}function x_(i,t,e,s,r){for(var n=r!==void 0?r:!1,a=0,o=e.length;a<o;++a){var l=e[a],h=vc(i,t,l,s);if(a===0){if(n&&h||!n&&!h)return!1}else if(n&&!h||!n&&h)return!1;t=l}return!0}function _c(i,t,e,s,r){for(var n=r!==void 0?r:!1,a=0,o=e.length;a<o;++a){var l=e[a],h=vc(i,t,l,s),c=a===0?n&&h||!n&&!h:n&&!h||!n&&h;c&&w_(i,t,l,s),t=l}return t}var b_=globalThis&&globalThis.__extends||function(){var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,r){s.__proto__=r}||function(s,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(s[n]=r[n])},i(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(t,e);function s(){this.constructor=t}t.prototype=e===null?Object.create(e):(s.prototype=e.prototype,new s)}}(),$a=function(i){b_(t,i);function t(e,s,r){var n=i.call(this)||this;return n.ends_=[],n.flatInteriorPointRevision_=-1,n.flatInteriorPoint_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,s!==void 0&&r?(n.setFlatCoordinates(s,e),n.ends_=r):n.setCoordinates(e,s),n}return t.prototype.appendLinearRing=function(e){this.flatCoordinates?Z0(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},t.prototype.clone=function(){var e=new t(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e},t.prototype.closestPointXY=function(e,s,r,n){return n<qh(this.getExtent(),e,s)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(r_(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),n_(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,s,r,n))},t.prototype.containsXY=function(e,s){return pc(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,s)},t.prototype.getArea=function(){return d_(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},t.prototype.getCoordinates=function(e){var s;return e!==void 0?(s=this.getOrientedFlatCoordinates().slice(),_c(s,0,this.ends_,this.stride,e)):s=this.flatCoordinates,u_(s,0,this.ends_,this.stride)},t.prototype.getEnds=function(){return this.ends_},t.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var e=Kh(this.getExtent());this.flatInteriorPoint_=__(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},t.prototype.getInteriorPoint=function(){return new y_(this.getFlatInteriorPoint(),qt.XYM)},t.prototype.getLinearRingCount=function(){return this.ends_.length},t.prototype.getLinearRing=function(e){return e<0||this.ends_.length<=e?null:new mc(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)},t.prototype.getLinearRings=function(){for(var e=this.layout,s=this.flatCoordinates,r=this.ends_,n=[],a=0,o=0,l=r.length;o<l;++o){var h=r[o],c=new mc(s.slice(a,h),e);n.push(c),a=h}return n},t.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var e=this.flatCoordinates;x_(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=_c(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},t.prototype.getSimplifiedGeometryInternal=function(e){var s=[],r=[];return s.length=c_(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),s,0,r),new t(s,qt.XY,r)},t.prototype.getType=function(){return Ra.POLYGON},t.prototype.intersectsExtent=function(e){return C_(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)},t.prototype.setCoordinates=function(e,s){this.setLayout(s,e,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=o_(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=r.length===0?0:r[r.length-1],this.changed()},t}(ja),nn=$a;function O_(i){var t=i[0],e=i[1],s=i[2],r=i[3],n=[t,e,t,r,s,r,s,e,t,e];return new $a(n,qt.XY,[n.length])}function P_(i,t,e){for(var s=t||32,r=i.getStride(),n=i.getLayout(),a=i.getCenter(),o=r*(s+1),l=new Array(o),h=0;h<o;h+=r){l[h]=0,l[h+1]=0;for(var c=2;c<r;c++)l[h+c]=a[c]}var u=[l.length],d=new $a(l,n,u);return E_(d,a,i.getRadius(),e),d}function E_(i,t,e,s){for(var r=i.getFlatCoordinates(),n=i.getStride(),a=r.length/n-1,o=s||0,l=0;l<=a;++l){var h=l*n,c=o+Iv(l,a)*2*Math.PI/a;r[h]=t[0]+e*Math.cos(c),r[h+1]=t[1]+e*Math.sin(c)}i.changed()}function Ha(i){const t=i.getStride(),e=i.getFlatCoordinates();if(e.length){const s=Math.floor(e.length/t),r=new Array(s);for(let n=0;n<s;n++){const a=n*t,o=new Array(t);for(let l=0;l<t;l++)o[l]=e[a+l];r[n]=o}return r}return[]}function qi(i,t){const e=t||i.getCoordinates();let s=null;return i instanceof xi?s=[e]:i instanceof Pn?s=e:i instanceof nn?s=e.reduce((r,n)=>r.concat(n)):i instanceof ko?s=e:i instanceof zo?s=e.reduce((r,n)=>r.concat(n)):i instanceof ur?s=e.reduce((r,n)=>r.concat(n)).reduce((r,n)=>r.concat(n)):i instanceof le?s=e:i instanceof gs&&(s=i.getGeometries().map((r,n)=>qi(r,e[n])).reduce((r,n)=>r.concat(n))),s}function Va(i,t){const e=dr(T.mercatorToWgs84(i),t,Math.PI/2),s=T.wgs84ToMercator(e),r=i[0]-s[0],n=i[1]-s[1],a=r*r,o=n*n,l=Math.sqrt(a+o);return new le(i,l,"XYZ")}function Ba(i){return i instanceof le?P_(i):(i instanceof nn&&i.unset("_vcsGeomType"),i)}function an(i){const[t,e]=i[i.length-1];i[0][0]===t&&i[0][1]===e||i.push(i[0].slice())}function Ua(i){const[t,e]=i[i.length-1];i[0][0]===t&&i[0][1]===e&&i.pop()}function qa(i){if(i instanceof nn){const t=i.getCoordinates();t.forEach(e=>{Ua(e)}),i.setCoordinates(t)}else if(i instanceof ur){const t=i.getCoordinates();t.forEach(e=>{e.forEach(s=>{Ua(s)})}),i.setCoordinates(t)}}function I_(i){let t=0;const e=i.length;for(let s=0;s<=e-2;s++){const r=i[s],n=i[s+1];t+=r[0]*n[1]-r[1]*n[0]}return t/=2,t}function Sc(i){return I_(i)<0&&i.reverse(),i}class Fe{static fromArray(t){return v(t,[Number]),v(t.length,6),new Fe(t[0],t[1],t[2],t[3],t[4],t[5])}static fromGeometry(t){const e=new Fe;return e.extendWithGeometry(t),e}static fromHeightInfo(t){const e=new Fe;return e.extendWithHeightInfo(t),e}constructor(t=1/0,e=1/0,s=1/0,r=-1/0,n=-1/0,a=-1/0){this.minX=t,this.minY=e,this.minZ=s,this.maxX=r,this.maxY=n,this.maxZ=a}extendWithGeometry(t){if(t.getType()===Re.GEOMETRY_COLLECTION)t.getGeometriesArray().forEach(e=>{this.extendWithGeometry(e)});else if(t.getType()===Re.CIRCLE){const e=t.getFlatCoordinates(),s=t.getStride(),r=e[s]-e[0];this.extendXY(e[0]-r,e[1]-r),this.extendXY(e[0]+r,e[1]+r),s>2&&this.extendZ(e[2])}else{const e=t.getFlatCoordinates(),s=t.getStride();this.extendFlatCoordinates(e,s)}}extendWithHeightInfo(t){if(t.extruded){const e=t.groundLevel+t.storeyHeightsAboveGround.reduce((r,n)=>r+n,0);this.extendZ(e);const s=t.groundLevel-t.storeyHeightsBelowGround.reduce((r,n)=>r+n,0);this.extendZ(s)}}extendXYZ(t,e,s){this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,e),this.minZ=Math.min(this.minZ,s),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,e),this.maxZ=Math.max(this.maxZ,s)}extendXY(t,e){this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,e),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,e)}extendZ(t){this.minZ=Math.min(this.minZ,t),this.maxZ=Math.max(this.maxZ,t)}extendFlatCoordinates(t,e){const{length:s}=t;for(let r=0;r<s;r+=e)e>2?this.extendXYZ(t[r],t[r+1],t[r+2]):this.extendXY(t[r],t[r+1])}to2D(){return[this.minX,this.minY,this.maxX,this.maxY]}toArray(){return[this.minX,this.minY,this.minZ,this.maxX,this.maxY,this.maxZ]}}const gi=Symbol("FVlastUpdated"),Wi=Symbol("GlobalHiderLastUpdated");function Mc(i,t){Object.keys(i.highlightedObjects).forEach(e=>{const s=t.getFeatureById(e);s&&!i.hasHighlightFeature(e,s)&&i.addHighlightFeature(e,s)}),Object.keys(i.hiddenObjects).forEach(e=>{const s=t.getFeatureById(e);s&&!i.hasHiddenFeature(e,s)&&i.addHiddenFeature(e,s)}),t[gi]=Date.now()}function Cc(i,t){Object.keys(i.hiddenObjects).forEach(e=>{const s=t.getFeatureById(e);s&&!i.hasFeature(e,s)&&i.addFeature(e,s)}),t[Wi]=Date.now()}function on(i,t,e){const s=t.on("addfeature",({feature:r})=>{const n=r.getId();i.highlightedObjects[n]&&i.addHighlightFeature(n,r),i.hiddenObjects[n]&&i.addHiddenFeature(n,r),e.hiddenObjects[n]&&e.addFeature(n,r);const a=Date.now();t[gi]=a,t[Wi]=a});return(!t[gi]||t[gi]<i.lastUpdated)&&Mc(i,t),(!t[Wi]||t[Wi]<i.lastUpdated)&&Cc(e,t),[i.changed.addEventListener(({action:r,ids:n})=>{r===W.HIGHLIGHT?(n.forEach(a=>{const o=t.getFeatureById(a);o&&i.addHighlightFeature(a,o)}),t[gi]=Date.now()):r===W.HIDE&&(n.forEach(a=>{const o=t.getFeatureById(a);o&&i.addHiddenFeature(a,o)}),t[gi]=Date.now())}),e.changed.addEventListener(({action:r,ids:n})=>{r===W.HIDE&&(n.forEach(a=>{const o=t.getFeatureById(a);o&&e.addFeature(a,o)}),t[Wi]=Date.now())}),()=>{yt(s)}]}function Wa(i,t){if(!(i instanceof Z))return null;const e=i.getProperties();delete e[i.getGeometryName()];const{clickedPosition:s}=i;if(!s)return null;let{latitude:r,longitude:n}=s;const a=i.getGeometry();let o=s.height,l=!o;a||(l=!1);let h=!o;const c=T.wgs84ToMercator([s.longitude,s.latitude,s.height]);if(a&&!a.intersectsCoordinate(c)){const u=a.getClosestPoint(c);[n,r]=T.mercatorToWgs84(u),l=!0}if(l){const u=qi(a),d=Qr(i,t.vectorProperties,u);if(d.perPositionHeight||d.extruded){const f=Fe.fromGeometry(a);f.extendWithHeightInfo(d),o=f.maxZ}!d.extruded&&(a.getType()===Re.POINT||a.getType()===Re.MULTI_POINT)&&(d.heightReference===Yt.RELATIVE_TO_GROUND||d.heightReference===Yt.CLAMP_TO_GROUND)?(o=d.heightAboveGroundAdjustment,h=!0):o+=d.heightAboveGroundAdjustment}return delete e.clickedPosition,o=Number.isFinite(o)?o:0,{layerName:t.name,layerClass:t.className,attributes:_(_({},t.genericFeatureProperties),e),longitude:n,latitude:r,height:o+t.balloonHeightOffset,relativeToGround:h}}class Ya extends qs{static get className(){return"VectorOpenlayersImpl"}constructor(t,e){super(t,e);this.source=e.source,this.style=e.style,this.maxResolution=e.maxResolution,this.minResolution=e.minResolution,this.featureVisibility=e.featureVisibility,this._featureVisibilityListeners=[],this.olLayer=null,this.globalHider=e.globalHider}updateStyle(t,e){this.style=t,this.initialized&&this.olLayer.setStyle(this.style.style)}getOLLayer(){const t=new jo({visible:!1,source:this.source,style:this.style.style});return this.minResolution&&t.setMinResolution(this.minResolution),this.maxResolution&&t.setMaxResolution(this.maxResolution),t}async activate(){this.active||(await super.activate(),this.active&&this._featureVisibilityListeners.length===0&&(this._featureVisibilityListeners=on(this.featureVisibility,this.source,this.globalHider)))}deactivate(){super.deactivate(),this._featureVisibilityListeners.forEach(t=>{t()}),this._featureVisibilityListeners=[]}setVisibility(t){this.initialized&&this.olLayer.setVisible(t)}destroy(){this._featureVisibilityListeners.forEach(t=>{t()}),this._featureVisibilityListeners=[],super.destroy()}}function wc(i,t,e,s){const r=O(_({},i),{perPositionHeight:e,extrudedHeight:s});return e||(r.height=t),[new Jd(r)]}function L_(i,t,e,s){return[new Kd(O(_({},i),{height:e?void 0:t,extrudedHeight:s,perPositionHeight:e,vertexFormat:Rn.FLAT_VERTEX_FORMAT}))]}function T_(i,t,e){return wc(i,t,e,void 0)}function xc(i,t){const e=E(t.getStroke().getWidth(),1),s=[];return s.push({positions:i.polygonHierarchy.positions,width:e}),i.polygonHierarchy.holes.forEach(r=>{s.push({positions:r.positions,width:e})}),s}function N_(i,t){return xc(i,t).map(e=>new Gn(e))}function D_(i,t){return xc(i,t).map(e=>new kn(e))}function F_(i,t){let e;const s=[],r=i.getLinearRings();for(let n=0;n<r.length;n++){const o=r[n].getCoordinates().map(l=>{const h=T.mercatorToWgs84(l);return h[2]!=null&&(h[2]+=t),C.fromDegrees(h[0],h[1],h[2])});C.equals(o[0],o[o.length-1])||o.push(o[0]),n===0?e=o:s.push(new el(o))}return{polygonHierarchy:new el(e,s)}}function R_(i){const t=[];return i.forEach(e=>{t.push(...Ha(e))}),t}let Xa=null;function A_(){return Xa||(Xa={getCoordinates:R_,getGeometryOptions:F_,createSolidGeometries:wc,createOutlineGeometries:L_,createFillGeometries:T_,createGroundLineGeometries:N_,createLineGeometries:D_}),Xa}function bc(i){if(i.getType()!==Re.POLYGON)return!1;const t=i.getFlatCoordinates(),e=i.getEnds(),s=i.getStride();if(!e.every((a,o)=>{const l=o?e[o-1]:0;return a-l>=s*3}))return!1;const n=s*3*i.getLinearRingCount();return t&&t.length>=n&&i.getLinearRingCount()?t.every(a=>Number.isFinite(a)):!1}function Za(i,t,e,s,r,n){if(!t.getFill()&&!t.getStroke())return;const a=A_(),o=e.filter(l=>bc(l));tn(i,t,o,s,r,a,n)}function Oc(i,t,e,s){return[new Qd(O(_({},i),{height:t,granularity:.02,extrudedHeight:s}))]}function G_(i,t,e,s){return[new tf(O(_({},i),{height:t,extrudedHeight:s,granularity:.02}))]}function k_(i,t,e){return Oc(i,t,e,void 0)}function Pc(i,t){const e=E(t.getStroke().getWidth(),1),{center:s,radius:r}=i,n=et.fromCartesian(s),a=[P.toDegrees(n.longitude),P.toDegrees(n.latitude)];return{positions:pd(a,r,40).getLinearRing(0).getCoordinates().map(c=>C.fromDegrees(c[0],c[1],n.height)),width:e}}function z_(i,t){const e=Pc(i,t);return[new Gn(e)]}function j_(i,t){const e=Pc(i,t);return[new kn(e)]}function $_(i,t){const e=i.getCenter(),s=e.slice();s[0]+=i.getRadius();const r=T.mercatorToWgs84(e,!0);r[2]!=null&&(r[2]+=t);const n=T.mercatorToWgs84(s,!0),a=C.fromDegrees(r[0],r[1],r[2]),o=C.fromDegrees(n[0],n[1],r[2]);return{radius:C.distance(a,o),center:a}}function H_(i){return i.map(t=>t.getCenter())}let Ja=null;function V_(){return Ja||(Ja={getCoordinates:H_,getGeometryOptions:$_,createSolidGeometries:Oc,createOutlineGeometries:G_,createFillGeometries:k_,createGroundLineGeometries:z_,createLineGeometries:j_}),Ja}function Ec(i){if(i.getType()!==Re.CIRCLE)return!1;const t=i.getFlatCoordinates(),e=i.getStride();return t&&t.length>=e+1&&t[e]!==t[0]?t.every(s=>Number.isFinite(s)):!1}function Ic(i,t,e,s,r,n){if(!t.getFill()&&!t.getStroke())return;const a=V_(),o=e.filter(l=>Ec(l));tn(i,t,o,s,r,a,n)}function B_(i,t,e,s){return[ef.fromConstantHeights(O(_({},i),{maximumHeight:e?void 0:t,minimumHeight:s}))]}function U_(i,t,e,s){return[sf.fromConstantHeights(O(_({},i),{maximumHeight:e?void 0:t,minimumHeight:s}))]}function q_(i,t,e){return[]}function W_(i,t){const e=E(t.getStroke().getWidth(),1);return[new Gn(O(_({},i),{width:e}))]}function Lc(i,t){const e=E(t.getStroke().getWidth(),1);return[new kn(O(_({},i),{width:e}))]}function Y_(i,t){return{positions:i.getCoordinates().map(r=>{const n=T.mercatorToWgs84(r);return n[2]!=null&&(n[2]+=t),C.fromDegrees(n[0],n[1],n[2])})}}function X_(i){const t=[];return i.forEach(e=>{t.push(...Ha(e))}),t}let Ka=null;function Z_(){return Ka||(Ka={getCoordinates:X_,getGeometryOptions:Y_,createSolidGeometries:B_,createOutlineGeometries:U_,createFillGeometries:q_,createGroundLineGeometries:W_,createLineGeometries:Lc}),Ka}function Tc(i){if(i.getType()!==Re.LINE_STRING)return!1;const t=i.getFlatCoordinates(),e=i.getStride()*2;return t&&t.length>=e?t.every(s=>Number.isFinite(s)):!1}function Qa(i,t,e,s,r,n){if(!t.getFill()&&!t.getStroke())return;const a=Z_(),o=e.filter(l=>Tc(l));tn(i,t,o,s,r,a,n)}function J_(i){return i.map(t=>t.getCoordinates())}function Nc(i,t,e,s){const r=t.getImage();if(r){const n=new Ot(1,1,1,r.getOpacity());let a=null;r instanceof ps&&(r.load(),r.getImageState()===fr.LOADING&&(a=new Promise((l,h)=>{const c=()=>{r.getImageState()===fr.LOADED||r.getImageState()===fr.EMPTY?(l(r.getImage(1)),r.unlistenImageChange(c)):r.getImageState()===fr.ERROR&&(h(),r.unlistenImageChange(c))};r.listenImageChange(c)}))),a||(a=r.getImage(1));const o={image:a,color:n,scale:r.getScale(),heightReference:e,verticalOrigin:Bt.BOTTOM,id:i.getId()};return o.eyeOffset=s.getEyeOffset(i),o.scaleByDistance=s.getScaleByDistance(i),o}return null}function Dc(i,t,e,s){const r=t.getText(),n=r?r.getText():null;if(n){const a={};a.text=n,a.heightReference=e;const o=r.getOffsetX()||0,l=r.getOffsetY()||0;a.pixelOffset=new Ht(o,l);const h=r.getFont();h&&(a.font=h);const c=r.getFill(),u=r.getStroke();let d;c&&(a.fillColor=ai(c.getColor(),[0,0,0,1]),d=zn.FILL),u&&(a.outlineWidth=E(u.getWidth(),1),a.outlineColor=ai(u.getColor(),[0,0,0,1]),d=zn.OUTLINE),c&&u&&(d=zn.FILL_AND_OUTLINE),a.style=d;let f;switch(r.getTextAlign()){case"left":f=jn.LEFT;break;case"right":f=jn.RIGHT;break;case"center":default:f=jn.CENTER}a.horizontalOrigin=f;let g;switch(r.getTextBaseline()){case"top":g=Bt.TOP;break;case"middle":g=Bt.CENTER;break;case"bottom":g=Bt.BOTTOM;break;case"alphabetic":g=Bt.TOP;break;case"hanging":g=Bt.BOTTOM;break;default:g=Bt.BASELINE}return a.verticalOrigin=g,a.eyeOffset=s.getEyeOffset(i),a.scaleByDistance=s.getScaleByDistance(i),a}return null}function Fc(i,t,e,s,r){const n=s.getModel(i);if(n){const a=C.fromArray(n.scale),o=rf.fromDegrees(n.heading,n.pitch,n.roll);return e.map((l,h)=>{const c=A.multiply(il.headingPitchRollToFixedFrame(l,o),A.fromScale(a),new A),u=s.getModelOptions(i),d=nf.fromGltf(_({url:n.url,modelMatrix:c},u));return t[h][2]||yr(r.globe.terrainProvider,[et.fromCartesian(l)]).then(([f])=>{d.isDestroyed()||(d.modelMatrix=A.multiply(il.headingPitchRollToFixedFrame(et.toCartesian(f),o),A.fromScale(a),new A))}).catch(()=>{}),d.readyPromise.then(()=>{d.activeAnimations.addAll({loop:af.REPEAT})}),d})}return null}function Rc(i){if(i.getType()!==Re.POINT)return!1;const t=i.getFlatCoordinates();return t&&t.length>=2?t.every(e=>Number.isFinite(e)):!1}function Ac(i,t){const e=new Array(i.length),s=new Array(i.length),r=t.groundLevel+t.storeyHeightsAboveGround.reduce((n,a)=>n+a,0);return i.forEach((n,a)=>{e[a]=T.mercatorToWgs84(n,!0);let o=null;t.heightReference===Yt.RELATIVE_TO_GROUND?o=t.heightAboveGroundAdjustment:o=r,s[a]=C.fromDegrees(n[0],n[1],o)}),{positions:s,wgs84Positions:e}}function K_(i,t,e,s){const r=[],n=t.skirt+t.storeyHeightsBelowGround.reduce((a,o)=>a+o,0);for(let a=0;a<i.length;a++){const o=i[a];let l=o[2]!=null?o[2]:t.groundLevel;l-=n;const h=C.fromDegrees(o[0],o[1],l),c=[e[a],h];r.push(...Lc({positions:c},s))}return r}function to(i,t,e,s,r,n){if(!t.getImage()&&!(t.getText()&&t.getText().getText()))return;const a=e.filter(g=>Rc(g));if(!a.length)return;const o=J_(a),l=Qr(i,s,o);let{heightReference:h}=l;const c=s.getAllowPicking(i),{positions:u,wgs84Positions:d}=Ac(o,l),f=Fc(i,d,u,s,r);if(f)n.addPrimitives(f,i,c);else{if(l.extruded&&t.getStroke()){const p=K_(d,l,u,t);if(p.length){h=Yt.NONE;const y=Ta(r,s,c,i,p,t,!1);y&&n.addPrimitives([y],i,c)}}const g=Nc(i,t,h,s);if(g){const p=u.map(y=>O(_({},g),{position:y}));n.addBillboards(p,i,c)}const m=Dc(i,t,h,s);if(m){const p=u.map(y=>O(_({},m),{position:y}));n.addLabels(p,i,c)}}}function Gc(i,t,e,s,r,n){t instanceof xi?to(i,e,[t],s,r,n):t instanceof En?Za(i,e,[t],s,r,n):t instanceof Pn?Qa(i,e,[t],s,r,n):t instanceof le?Ic(i,e,[t],s,r,n):t instanceof ko?to(i,e,t.getPoints(),s,r,n):t instanceof ur?Za(i,e,t.getPolygons(),s,r,n):t instanceof zo?Qa(i,e,t.getLineStrings(),s,r,n):t instanceof gs&&t.getGeometries().forEach(a=>{Gc(i,a,e,s,r,n)})}function Ys(i,t,e=1){const s=[];return typeof i=="function"?s.push(...Ys(i(t,e),t,e)):Array.isArray(i)?i.forEach(r=>{s.push(...Ys(r,t,e))}):i instanceof ft&&s.push(i),s}function kc(i,t,e,s,r){Ys(i.getStyle()||t,i,0).forEach(a=>{const o=a.getGeometryFunction()(i);o&&Gc(i,o,a,e,r,s)})}function zc(i,t){t.olFeature=i}function mi(i,t){t&&t.forEach(e=>{i.remove(e)})}function Yi(i,t,e){mi(e,t.get(i)),t.delete(i)}function Xi(i,t,e,s,r){if(i.length){const n=i.map(a=>{const o=s.add(a);return e&&zc(t,o),o});r.has(t)?r.get(t).push(...n):r.set(t,n)}}class jc{constructor(t,e){this.primitives=new $n,this.billboards=new of({scene:t}),this.labels=new lf({scene:t}),this.featureToPrimitiveMap=new Map,this.featureToBillboardMap=new Map,this.featureToLabelMap=new Map,e.add(this.primitives),e.add(this.billboards),e.add(this.labels)}addPrimitives(t,e,s){Xi(t,e,s,this.primitives,this.featureToPrimitiveMap)}addBillboards(t,e,s){Xi(t,e,s,this.billboards,this.featureToBillboardMap)}addLabels(t,e,s){Xi(t,e,s,this.labels,this.featureToLabelMap)}removeFeature(t){Yi(t,this.featureToPrimitiveMap,this.primitives),Yi(t,this.featureToBillboardMap,this.billboards),Yi(t,this.featureToLabelMap,this.labels)}createFeatureCache(t){const e={};return e.primitives=this.featureToPrimitiveMap.get(t),this.featureToPrimitiveMap.delete(t),e.billboards=this.featureToBillboardMap.get(t),this.featureToBillboardMap.delete(t),e.labels=this.featureToLabelMap.get(t),this.featureToLabelMap.delete(t),e}clearFeatureCache(t){mi(this.primitives,t.primitives),mi(this.billboards,t.billboards),mi(this.labels,t.labels)}clear(){this.primitives.removeAll(),this.billboards.removeAll(),this.labels.removeAll(),this.featureToBillboardMap.clear(),this.featureToLabelMap.clear(),this.featureToPrimitiveMap.clear()}}class $c extends Ue{static get className(){return"VectorCesiumImpl"}constructor(t,e){super(t,e);this.vectorProperties=e.vectorProperties,this.source=e.source,this.style=e.style,this.featureVisibility=e.featureVisibility,this._featureVisibilityListeners=[],this._removeVectorPropertiesChangeHandler=()=>{},this._rootCollection=new $n,this._rootCollection[z]=e.name,this._olListeners=[],this._featureToAdd=new Set,this._context=null,this._scene=null,this.globalHider=e.globalHider}_addListeners(){this._olListeners.push(this.source.on("addfeature",t=>{this._addFeature(t.feature)})),this._olListeners.push(this.source.on("removefeature",t=>{this._removeFeature(t.feature)})),this._olListeners.push(this.source.on("changefeature",t=>{this._featureChanged(t.feature)})),this._removeVectorPropertiesChangeHandler=this.vectorProperties.propertyChanged.addEventListener(this.refresh.bind(this))}async _setupContext(t){const e=this._rootCollection;this._context=new jc(this._scene,e),t.addPrimitiveCollection(e)}async initialize(){this.initialized||(this._scene=this.map.getScene(),this._addListeners(),this._addFeatures(this.source.getFeatures()),await this._setupContext(this.map)),await super.initialize()}_addFeatures(t){t.forEach(e=>{this._addFeature(e)})}_addFeature(t){this.active?kc(t,this.style.style,this.vectorProperties,this._context,this._scene):this._featureToAdd.add(t)}refresh(){this._context.clear(),this._addFeatures(this.source.getFeatures())}_removeFeature(t){this._context.removeFeature(t),this._featureToAdd.delete(t)}_featureChanged(t){const e=this._context.createFeatureCache(t);this._featureToAdd.delete(t),this._addFeature(t),this._context.clearFeatureCache(e)}async activate(){this.active||(await super.activate(),this.active&&(this._addFeatures([...this._featureToAdd]),this._featureToAdd.clear(),this._rootCollection.show=!0,this._featureVisibilityListeners.length===0&&(this._featureVisibilityListeners=on(this.featureVisibility,this.source,this.globalHider))))}deactivate(){super.deactivate(),this._rootCollection.show=!1,this._featureVisibilityListeners.forEach(t=>{t()}),this._featureVisibilityListeners=[]}updateStyle(t,e){this.style=t,this.initialized&&!e&&this.source.getFeatures().filter(r=>!r.getStyle()).forEach(r=>{this._featureChanged(r)})}_destroyCollection(){this.map.removePrimitiveCollection(this._rootCollection)}destroy(){this.initialized&&(this._context.clear(),this._destroyCollection()),this._context=null,this._scene=null,this._removeVectorPropertiesChangeHandler(),this._olListeners.forEach(t=>{yt(t)}),this._olListeners=[],this._featureToAdd.clear(),this._featureVisibilityListeners.forEach(t=>{t()}),this._featureVisibilityListeners=[],this.source=null,this.vectorProperties=null,this.featureVisibility=null,this.style=null,this.globalHider=null,this._rootCollection=null,super.destroy()}}const ut={NORTH:1,EAST:2,SOUTH:3,WEST:4,NADIR:5},ln={north:ut.NORTH,east:ut.EAST,south:ut.SOUTH,west:ut.WEST,nadir:ut.NADIR};function Q_(i){return Object.keys(ln).find(t=>ln[t]===i)}const Zi={};function Ji(i){if(!Zi[i.url])return Zi[i.url]=new sl(i),Zi[i.url];let t=Zi[i.url];return(i.requestVertexNormals!==void 0&&t.requestVertexNormals!==i.requestVertexNormals||i.requestWaterMask!==void 0&&t.requestWaterMask!==i.requestWaterMask)&&(Zi[i.url]=new sl(i),t=Zi[i.url]),t}function pi(i,t,e,s){const r=e?dt(e.proj,B.proj):null,n=t.map(o=>{const l=r?r(o,o.slice(),o.length):o;return et.fromDegrees(l[0],l[1])}),a=s||t.map(o=>o.slice());return yr(i,n).then(o=>(o.forEach((l,h)=>{a[h][2]=l.height||0}),a))}function Hc(i,t,e){if(!i.ready)return!1;const s=i.tilingScheme.positionToTileXY(e,t,new Ht);return i.getTileDataAvailable(s.x,s.y,t)}let eo=new Ht,io=new Ht;function so(i,t=!1){const e=i.slice(),s=ys(e);let n=[On(s),$o(s),Ho(s),gr(s)].map(a=>{let o=0,l=1/0;return e.forEach((h,c)=>{const u=ke(a,h);u<l&&(l=u,o=c)}),e.splice(o,1)[0]});return t===ut.EAST?n=[n[3],n[0],n[1],n[2]]:t===ut.SOUTH?n=[n[2],n[3],n[0],n[1]]:t===ut.WEST&&(n=[n[1],n[2],n[3],n[0]]),n}function Xs(i,t){return eo=Ht.fromElements(i[0],i[1],eo),io=Ht.fromElements(t[0],t[1],io),Ht.angleBetween(eo,io)}function ro(i,t){const[[e,s],[r,n]]=i,[[a,o],[l,h]]=t;let c,u;const d={x:null,y:null,onLine1:!1,onLine2:!1},f=(h-o)*(r-e)-(l-a)*(n-s);if(f===0)return d;c=s-o,u=e-a;const g=(l-a)*c-(h-o)*u,m=(r-e)*c-(n-s)*u;return c=g/f,u=m/f,d.x=e+c*(r-e),d.y=s+c*(n-s),c>0&&c<1&&(d.onLine1=!0),u>0&&u<1&&(d.onLine2=!0),d}function Vc(i,t,e,s,r){const n=so(i,e?!1:r),a=so(t,e?r:!1),o=[];for(let c=0;c<n.length;++c){const u=[];for(let g=0;g<n.length;++g){const m=g===n.length-1?0:g+1;if(c===g||c===m||g===3&&m===0||g===1&&m===2)continue;const p=ro([n[c],s],[n[g],n[m]]);if(p.x==null||p.y==null)continue;const y=[s[0]-n[c][0],s[1]-n[c][1]],M=[p.x-n[c][0],p.y-n[c][1]],x=Xs(y,M);if(x==null||x/(Math.PI*180)>5)continue;const L=[n[g][0]-n[m][0],n[g][1]-n[m][1]],I=[n[m][0]-n[g][0],n[m][1]-n[g][1]],D=Xs(y,L);if(D==null)continue;const Y=Xs(y,I);if(Y==null)continue;const H=ke(n[g],n[m]);if(H===0)continue;const wt=ke(n[g],[p.x,p.y])/H;let $t=0;wt!==0&&($t=Xs(I,[p.x-n[g][0],p.y-n[g][1]]),$t==null)||u.push({cornerPoint:c,intrX:p.x,intrY:p.y,angle:D<=Y?D:Y,edgeStart:g,edgeEnd:m,ratioStart2End:$t/Math.PI*180>5?wt*-1:wt})}let d=-1,f=-1;for(let g=0;g<u.length;++g)u[g].angle>d&&(d=u[g].angle,f=g);f!==-1&&o.push(u[f])}if(o.length<2)return null;const l=[];for(let c=0;c<o.length;++c)for(let u=c+1;u<o.length;++u)l.push([o[c].angle+o[u].angle,c,u]);let h=null;return l.sort().reverse().find(c=>{const u=[o[c[1]],o[c[2]]],d=a[u[0].edgeEnd],f=a[u[0].edgeStart],g=[d[0]-f[0],d[1]-f[1]],m=[f[0]+g[0]*u[0].ratioStart2End,f[1]+g[1]*u[0].ratioStart2End],p=a[u[1].edgeEnd],y=a[u[1].edgeStart],M=[p[0]-y[0],p[1]-y[1]],x=[y[0]+M[0]*u[1].ratioStart2End,y[1]+M[1]*u[1].ratioStart2End],L=[m[0]-a[u[0].cornerPoint][0],m[1]-a[u[0].cornerPoint][1]],I=[x[0]-a[u[1].cornerPoint][0],x[1]-a[u[1].cornerPoint][1]];return!(Xs(L,I)==null||(h=ro([a[u[0].cornerPoint],m],[a[u[1].cornerPoint],x]),h.x==null||h.y==null))}),h}function t1(i,t,e={}){let s;e.dataProjection&&e.dataProjection===i.meta.projection?s=t:s=e.dataProjection?Xe(t,e.dataProjection.proj,i.meta.projection.proj):Xe(t,F.proj,i.meta.projection.proj);function r(){return{coords:i.transformRealWorld2Image(s),height:i.averageHeight,estimate:!0}}if(t[2]){const n=i.transformRealWorld2Image(s,t[2]);return Promise.resolve({coords:n,height:t[2],estimate:!1})}return!e.dontUseTerrain&&i.meta.terrainProvider?pi(i.meta.terrainProvider,[s],i.meta.projection).then(([n])=>n[2]?{coords:i.transformRealWorld2Image(s,n[2]),height:s[2],estimate:!1}:(console.warn("The configured terrain on the oblique layer could not be queried, position might be inaccurate"),r())).catch(()=>r()):Promise.resolve(r())}function Bc(i){i.count+=1;const{image:t,worldCoordinate:e,imageCoordinate:s,terrainErrorThreshold:r,terrainErrorCountThreshold:n,count:a,height:o}=i;return pi(t.meta.terrainProvider,[e]).then(([l])=>{if(l[2]!=null){const h=Xe(t.transformImage2RealWorld(s,l[2]),t.meta.projection.proj,B.proj);return h[2]=l[2],Math.abs(o-l[2])<r||a>n?{coords:h,estimate:!1}:(i.height=h[2],i.worldCoordinate=l,Bc(i))}return console.log("The configured terrain on the oblique layer could not be queried, position might be inaccurate"),{coords:l,estimate:!0}}).catch(()=>({coords:e,estimate:!0}))}async function Ki(i,t,e={}){const s=Xe(i.transformImage2RealWorld(t,i.averageHeight),i.meta.projection.proj,B.proj),r=e.terrainErrorThreshold||1,n=e.terrainErrorCountThreshold||3;let a={coords:s,estimate:!0};return!e.dontUseTerrain&&i.meta.terrainProvider&&(a=await Bc({worldCoordinate:s,imageCoordinate:t,image:i,count:0,height:i.averageHeight,terrainErrorThreshold:r,terrainErrorCountThreshold:n})),a.coords=e.dataProjection?Xe(a.coords,B.proj,e.dataProjection.proj):Xe(a.coords,B.proj,F.proj),a}function Uc(i){if(!/^[a-z][a-z0-9+.-]*:/.test(i)||/^data:/.test(i))return!0;const t=new URL(window.location.href),e=new URL(i);return t.host.toLowerCase()===e.host.toLocaleLowerCase()}function qc(i){let t=0;for(let e=0;e<i.length;e++){let s=e+1;s>=i.length&&(s=0);const r=i[e],n=i[s],a=ke(r,n);a>t&&(t=a)}return t}function no(i,t){const e=qc(t.groundCoordinates),s=Math.PI/3,r=i.getViewport(),n={height:r.offsetHeight||1,width:r.offsetWidth||1},a=n.width/n.height,o=Math.atan(Math.tan(s*.5)/a)*2,[l,h]=t.meta.size,c=l>h?l:h,u=e/c;return{size:n,fovy:o,metersPerUnit:u}}function Wc(i,t,e){const{size:s,fovy:r,metersPerUnit:n}=no(i,t),l=2*e*Math.tan(r/2)/n/s.height;return i.getView().getZoomForResolution(l)}async function Yc(i,t,e){const s=i instanceof le?yd(i):i,r=s.getCoordinates(),n=qi(s,r);let a=dt(F.proj,e.meta.projection.proj),o=[];if(e.meta.terrainProvider){const l=n.map(h=>(T.mercatorToWgs84(h,!0),et.fromDegrees(h[0],h[1])));a=dt(B.proj,e.meta.projection.proj),o=await yr(e.meta.terrainProvider,l)}return n.forEach((l,h)=>{a(l,l,3);const c=o[h]?o[h].height:null,u=e.transformRealWorld2Image(l,c||l[2]||e.averageHeight);n[h][0]=u[0],n[h][1]=u[1]}),t.setCoordinates(r),t}function Xc(i,t,e){const s=i.getCoordinates(),n=qi(i,s).map(a=>Ki(e,a).then(o=>{a[0]=o.coords[0],a[1]=o.coords[1],a[2]=o.coords[2]}));return Promise.all(n).then(()=>(t.setCoordinates(s),t))}function ao(i,t=!1){const e=i.getGeometry();if((e.get("_vcsGeomType")==="bbox"||e.get("_vcsGeomType")==="rectangle")&&t)return e;const r=e instanceof le,n=Ba(e);return n[Hs]=r,n}function oo(i,t){const e=i.getGeometry(),s=i.getGeometry().clone();t.setGeometry(e[Ve]?s:Ba(s)),e[Ve]&&t.getGeometry().setProperties(i.getGeometry().getProperties(),!1),i[Wr]=t.getGeometry()}class Zc extends Ue{constructor(t,e){super(t,e);this.olLayer=null}initialize(){return this.initialized||(this.olLayer=this.getOLLayer(),this.olLayer[z]=this.name,this.map.addOLLayer(this.olLayer)),super.initialize()}async activate(){await super.activate(),this.active&&this.olLayer.setVisible(!0)}deactivate(){super.deactivate(),this.olLayer&&this.olLayer.setVisible(!1)}getOLLayer(){throw new Error}destroy(){this.olLayer&&this.map.removeOLLayer(this.olLayer),this.olLayer=null,super.destroy()}}class lo extends Zc{static get className(){return"VectorObliqueImpl"}constructor(t,e){super(t,e);this.obliqueSource=new vs({}),this._featureListeners={},this._sourceListener=[],this.currentExtent=null,this.fetchedFeaturesForImageName=null,this._updatingMercator={},this._updatingOblique={},this._featureVisibilityListeners=[],this.globalHider=e.globalHider,this.source=e.source,this.style=e.style,this.featureVisibility=e.featureVisibility,this.olLayer=null}getOLLayer(){return new jo({visible:!1,source:this.obliqueSource,style:this.style.style})}updateStyle(t,e){this.style=t,this.initialized&&this.olLayer.setStyle(this.style.style)}_onObliqueImageChanged(){this._clearCurrentImage(),this._fetchFeaturesInView()}_featureInExtent(t){if(this.currentExtent){const e=t.getGeometry();if(e)return e[Ve]||e.intersectsExtent(this.currentExtent)}return!1}_addSourceListeners(){this._sourceListener.push(this.source.on("addfeature",t=>{const{feature:e}=t;this._featureInExtent(e)&&this.addFeature(t.feature)})),this._sourceListener.push(this.source.on("removefeature",t=>{this.removeFeature(t.feature)})),this._sourceListener.push(this.source.on("changefeature",t=>{const{feature:e}=t,s=e.getId();!this._featureListeners[s]&&this._featureInExtent(e)&&this.addFeature(e)}))}async activate(){this.active||(await super.activate(),this.active&&(this.olLayer.setVisible(!0),this._featureVisibilityListeners.length===0&&(this._featureVisibilityListeners=on(this.featureVisibility,this.source,this.globalHider)),this._addSourceListeners(),this._imageChangedListener=this.map.imageChanged.addEventListener(this._onObliqueImageChanged.bind(this)),await this._fetchFeaturesInView()))}addFeature(t){if(this.active||(this.fetchedFeaturesForImageName=null),this.active&&this.currentExtent){const e=t.getId(),s=t.getGeometry();if(t[Ea])return s&&!this.obliqueSource.getFeatureById(e)&&this.obliqueSource.addFeature(t),Promise.resolve();if(this.obliqueSource.getFeatureById(e))return Promise.resolve();const r=new Z({});return r.setId(e),r[Be]=t,oo(t,r),r.setStyle(t.getStyle()),this._setFeatureListeners(t,r),this._convertToOblique(t,r).then(()=>{this.obliqueSource.addFeature(r)})}return Promise.resolve()}_originalGeometryChanged(t,e,s){yt(t.originalGeometryChanged),yt(t.obliqueGeometryChanged),oo(e,s),this.updateObliqueGeometry(e,s),t.originalGeometryChanged=e.getGeometry().on("change",this.updateObliqueGeometry.bind(this,e,s)),t.obliqueGeometryChanged=s.getGeometry().on("change",this.updateMercatorGeometry.bind(this,e,s))}_setFeatureListeners(t,e){const s=e.getId(),r={originalFeatureGeometryChanged:t.on("change:geometry",()=>{const n=t.getGeometry();if(n[Hs]){yt(r.originalGeometryChanged),r.originalGeometryChanged=t.getGeometry().on("change",()=>{this._updatingMercator[s]||(delete n[Hs],this._originalGeometryChanged(r,t,e))});return}this._originalGeometryChanged(r,t,e)}),originalFeatureChanged:t.on("change",()=>{e.setStyle(t.getStyle())}),originalGeometryChanged:t.getGeometry().on("change",this.updateObliqueGeometry.bind(this,t,e)),obliqueGeometryChanged:e.getGeometry().on("change",this.updateMercatorGeometry.bind(this,t,e))};this._featureListeners[s]=r}async _convertToOblique(t,e){const s=t.getId(),r=t.getGeometry(),n=e.getGeometry();this._updatingOblique[s]=!0,r[Ve]?e.getGeometry().setCoordinates(r.getCoordinates()):await Yc(r,n,this.map.currentImage),this._updatingOblique[s]=null}updateObliqueGeometry(t,e){const s=t.getId();this._updatingMercator[s]||(this._updatingOblique[s]!=null&&clearTimeout(this._updatingOblique[s]),this._updatingOblique[s]=setTimeout(()=>{this._convertToOblique(t,e)},200))}updateMercatorGeometry(t,e){const s=t.getId();if(this._updatingOblique[s])return;this._updatingMercator[s]!=null&&clearTimeout(this._updatingMercator[s]);const r=this.fetchedFeaturesForImageName;this._updatingMercator[s]=setTimeout(async()=>{const n=ao(t,!1);n[Hs]&&t.setGeometry(n);const a=ao(e,!0);this._updatingMercator[s]=!0,await Xc(a,n,this.map.collection.getImageByName(r)),this._updatingMercator[s]=null},200)}_clearCurrentImage(){Object.values(this._featureListeners).forEach(t=>{yt(Object.values(t))}),this._featureListeners={},this._updatingOblique={},this._updatingMercator={},this.obliqueSource.getFeatures().forEach(t=>{const e=t[Be];e&&(delete e[Wr],delete e.getGeometry()[Ve])}),this.obliqueSource.clear(!0),this.fetchedFeaturesForImageName=null}_fetchFeaturesInView(){this.active&&this.map.currentImage&&this.fetchedFeaturesForImageName!==this.map.currentImage.name&&(this.currentExtent=this.map.getExtentOfCurrentImage().getCoordinatesInProjection(F),this.source.forEachFeatureInExtent(this.currentExtent,t=>{this.addFeature(t)}),this.source.forEachFeature(t=>{t.getGeometry()[Ve]&&this.addFeature(t)}),this.fetchedFeaturesForImageName=this.map.currentImage.name)}removeFeature(t){const e=this.obliqueSource.getFeatureById(t.getId());if(e){const s=e.getId(),r=this._featureListeners[s];r&&(yt(Object.values(r)),delete this._featureListeners[s]),this.obliqueSource.removeFeature(e)}}deactivate(){super.deactivate(),this.olLayer&&this.olLayer.setVisible(!1),this._featureVisibilityListeners.forEach(t=>{t()}),this._featureVisibilityListeners=[],yt(this._sourceListener),this._sourceListener=[],this._imageChangedListener&&(this._imageChangedListener(),this._imageChangedListener=null),this._clearCurrentImage()}destroy(){this.olLayer&&this.map.removeOLLayer(this.olLayer),this.olLayer=null,yt(this._sourceListener),this._sourceListener=[],this._imageChangedListener&&(this._imageChangedListener(),this._imageChangedListener=null),this.obliqueSource.clear(!0),Object.values(this._updatingOblique).forEach(t=>{t!=null&&clearTimeout(t)}),Object.values(this._updatingMercator).forEach(t=>{t!=null&&clearTimeout(t)}),this._clearCurrentImage(),super.destroy()}}class hn{constructor(t){this.name=t.name,this.meta=t.meta,this.viewDirection=t.viewDirection,this.viewDirectionAngle=t.viewDirectionAngle,this.groundCoordinates=t.groundCoordinates,this.centerPointOnGround=t.centerPointOnGround,this.pToRealworld=t.pToRealworld||null,this.pToImage=t.pToImage||null,this.projectionCenter=t.projectionCenter||null,this._averageHeight=null}get averageHeight(){return this._averageHeight!=null?this._averageHeight:0}get hasCamera(){return!!this.meta.principalPoint}transformImage2RealWorld(t,e){let s=t;if(this.meta.principalPoint)this.meta.hasRadial&&(s=this.meta.radialDistortionCoordinate(s,!0));else return this._transformNoCamera(s,!0,e);const r=new C(s[0],this.meta.size[1]-s[1],1),n=Vt.multiplyByVector(this.pToRealworld,r,new C),a=e||this.averageHeight,o=new C(this.centerPointOnGround[0],this.centerPointOnGround[1],a),l=C.subtract(this.projectionCenter,o,new C),h=C.dot(C.UNIT_Z,l)*-1,c=C.dot(C.UNIT_Z,n),u=h/c,d=C.add(this.projectionCenter,C.multiplyByScalar(n,u,new C),new C);return[d.x,d.y,a]}transformRealWorld2Image(t,e){if(!this.meta.principalPoint)return this._transformNoCamera(t,!1,e);const s=e||this.averageHeight,r=new rl(t[0],t[1],s,1),n=A.multiplyByVector(this.pToImage,r,new rl),a=[n.x/n.z,n.y/n.z],o=[a[0],this.meta.size[1]-a[1]];return this.meta.radialDistortionCoordinate(o,!1)}_transformNoCamera(t,e,s){const r=[[0,0],[this.meta.size[0],0],this.meta.size,[0,this.meta.size[1]]],n=Vc(e?r:this.groundCoordinates,e?this.groundCoordinates:r,e,t,this.viewDirection),a=s||this.averageHeight;if(n===null||n.x==null||n.y==null){console.error("Real world coordinate could not be determined from footprint data, center will be returned");const l=[this.centerPointOnGround[0],this.centerPointOnGround[1]];return e&&l.push(a),l}const o=[n.x,n.y];return e&&o.push(a),o}calculateImageAverageHeight(){if(this._averageHeight===null){const t=(this.groundCoordinates[0][2]+this.groundCoordinates[1][2]+this.groundCoordinates[2][2]+this.groundCoordinates[3][2])/4;if(t===0&&this.meta.terrainProvider)return pi(this.meta.terrainProvider,[this.centerPointOnGround.slice()],this.meta.projection).then(e=>{e[0]&&e[0][2]!=null&&(this._averageHeight=e[0][2])}).catch(()=>{this._averageHeight=t});this._averageHeight=t}return Promise.resolve()}}class Zs{constructor(t){this.name=t.name,this.principalPoint=t["principal-point"],this.pixelSize=t["pixel-size"],this.radialE2F=t["radial-distorsion-expected-2-found"],this.radialF2E=t["radial-distorsion-found-2-expected"],this.hasRadial=!!(this.pixelSize&&this.radialE2F&&this.radialF2E),this.size=t.size,this.tileSize=t.tileSize,this.tileResolution=t.tileResolution,this.projection=t.projection,this.url=t.url,this.terrainProvider=t.terrainProvider,this.format=t.format||"jpg"}radialDistortionCoordinate(t,e){if(this.hasRadial&&this.principalPoint){const s=e?this.radialF2E:this.radialE2F,r=ke(this.principalPoint,t)*this.pixelSize[0];if(r===0)return t.slice();const n=t[0]-this.principalPoint[0],a=t[1]-this.principalPoint[1];let o=0;for(let c=0;c<s.length;++c)o+=s[c]*r**c;const l=(r+o)/this.pixelSize[0],h=Math.atan2(a,n);return[this.principalPoint[0]+l*Math.cos(h),this.principalPoint[1]+l*Math.sin(h)]}return t.slice()}}let Jc=0;function e1(){return Jc+=1,Jc}function ho(i){const t={version:null,buildNumber:null};if(i.version){const e=i.version.match(/\d+\.\d+/);e&&(t.version=Number(e[0]));const s=i.version.match(/-\d+-/);s&&(t.buildNumber=Number(s[0].match(/\d+/)[0]))}return t}function Kc(i,t,e,s){let r;i.generalImageInfo.width&&i.generalImageInfo.height&&(r=[i.generalImageInfo.width,i.generalImageInfo.height]);const n=i.generalImageInfo["tile-resolution"],a=[i.generalImageInfo["tile-width"],i.generalImageInfo["tile-height"]];let o=e;const l=[];!o&&i.generalImageInfo.crs&&(o=new T({epsg:e1(),prefix:"OBLIQUE:",proj4:i.generalImageInfo.crs}));const h={size:r,tileResolution:n,tileSize:a,projection:o,url:t,terrainProvider:s};return i.generalImageInfo.cameraParameter&&(Array.isArray(i.generalImageInfo.cameraParameter)?i.generalImageInfo.cameraParameter.forEach(c=>{l.push(new Zs(_(_({},h),c)))}):typeof i.generalImageInfo.cameraParameter=="object"&&Object.entries(i.generalImageInfo.cameraParameter).forEach(([c,u])=>{l.push(new Zs(_(_({name:c},h),u)))})),l.length===0&&l.push(new Zs(_({name:"default"},h))),l}function co(i,t){const e=i.images[0],s={name:e.indexOf("name"),width:e.indexOf("width"),height:e.indexOf("height"),tileResolution:e.indexOf("tile-resolution"),viewDirection:e.indexOf("view-direction"),viewDirectionAngle:e.indexOf("view-direction-angle"),groundCoordinates:e.indexOf("groundCoordinates"),centerPointOnGround:e.indexOf("centerPointOnGround"),cameraIndex:e.indexOf("camera-index"),projectionCenter:e.indexOf("projection-center"),pToRealworld:e.indexOf("p-to-realworld"),pToImage:e.indexOf("p-to-image")},r=new Array(i.images.length-1);return i.images.forEach((n,a)=>{if(a===0)return;const o=[];n[s.pToRealworld]&&n[s.pToRealworld].forEach(f=>{o.push(...f)});const l=n[s.pToRealworld]?new Vt(...o):null,h=[];n[s.pToImage]&&(n[s.pToImage].forEach(f=>{h.push(...f)}),h.push(0,0,0,1));const c=n[s.projectionCenter]?C.fromArray(n[s.projectionCenter]):null,u=n[s.pToImage]?new A(...h):null,d=t[n[s.cameraIndex]||0];d.size||(n[s.height]&&n[s.width]?d.size=[n[s.width],n[s.height]]:console.error("missing image meta size")),d.tileResolution||(n[s.tileResolution]?d.tileResolution=n[s.tileResolution]:console.error("missing image meta tileResolution")),r[a-1]=new hn({name:n[s.name],viewDirection:n[s.viewDirection],viewDirectionAngle:n[s.viewDirectionAngle],groundCoordinates:n[s.groundCoordinates],centerPointOnGround:n[s.centerPointOnGround],meta:d,projectionCenter:c,pToRealworld:l,pToImage:u})}),r}function Qc(i,t){const{cameraParameter:e}=i.generalImageInfo,{version:s,buildNumber:r}=ho(i);return i.images.map(n=>{const a=ln[n["view-direction"]],o=s>=3.4&&r>=18?n["view-directionAngle"]:void 0,l=n["projection-center"],{name:h,groundCoordinates:c,centerPointOnGround:u}=n,d=n["camera-name"],f=t.find(p=>p.name===d),g=f||t[0];g.size||(n.height&&n.width?g.size=[n.width,n.height]:console.error("missing image meta size")),g.tileResolution||(n.tileResolution?g.tileResolution=n.tileResolution:console.error("missing image meta tileResolution"));const m={name:h,meta:g,viewDirection:a,viewDirectionAngle:o,groundCoordinates:c,centerPointOnGround:u};if(f&&d){const p=e[d],y=Vt.fromRowMajorArray([].concat(...p["camera-matrix"])),M=Vt.inverse(y,new Vt),x=Vt.fromRowMajorArray([].concat(...n["rotation-matrix"])),L=Vt.transpose(x,new Vt),I=p["focal-length"]*-1;Vt.multiplyByScalar(M,I,M);const D=Vt.multiply(L,M,new Vt),Y=A.fromRotationTranslation(y,C.ZERO,new A),H=C.fromArray(l),wt=A.fromTranslation(C.multiplyByScalar(H,-1,new C),new A),$t=A.fromRotationTranslation(x,C.ZERO,new A),Me=A.multiply(Y,A.multiply($t,wt,new A),new A);m.projectionCenter=H,m.pToRealworld=D,m.pToImage=Me}return new hn(m)})}async function uo(i,t){const e=await fetch(i,t);if(!e.ok)throw new Error(`Failed fetching url ${i} with status: ${e.status}`);return e}async function ye(i,t){return(await uo(i,t)).json()}async function tu(i,t){return(await uo(i,t)).arrayBuffer()}const at={PENDING:1,LOADING:2,READY:3};function Js(i){return i.some(t=>t===at.PENDING)?at.PENDING:i.some(t=>t===at.LOADING)?at.LOADING:at.READY}class fo{constructor(t,e,s){this.url=t,/\.json$/.test(this.url)||(this.url=this.url.replace(/\/?$/,"/image.json")),this.baseUrl=this.url.replace(/\/?([^/]+\.json)?$/,"");let r=e;r&&!(r instanceof T)&&(r=new T(r)),this.projection=r,this._terrainProviderOptions=s?_({},s):void 0,this._terrainProvider=this._terrainProviderOptions?Ji(this._terrainProviderOptions):void 0,this._imageMetas=[],this.imagesLoaded=new R,this._tiles=new Map,this._loadingPromises=new Map,this._state=at.PENDING,this._tileLevel=null,this._tileGrid=Vo(),this._images=[],this.copyright=void 0}get images(){return this._images.slice()}get state(){return this._state}get terrainProvider(){return this._terrainProvider}load(){return this._loadingPromise||(this._state=at.LOADING,this._loadingPromise=ye(this.url).then(t=>this._initialize(t)).catch(t=>Promise.reject(t))),this._loadingPromise}getTiles(){const t={};return this._tiles.forEach((e,s)=>{t[s]=e}),t}initialize(t){if(this._state!==at.PENDING)throw new Error("DataSet has already been loaded");this._loadingPromise=Promise.resolve(),this._initialize(t)}_initialize(t){this._parseMetaData(t),this._state=at.READY}_parseMetaData(t){this._imageMetas=Kc(t,this.baseUrl,this.projection,this.terrainProvider);const{version:e,buildNumber:s}=ho(t);if(t.tileLevel)this._tileLevel=t.tileLevel,t.availableTiles.forEach(r=>{this._tiles.set(r,at.PENDING)});else{let r=[];e>=3.5||e===3.4&&s>36?r=co(t,this._imageMetas):(e>=3.1||e===null)&&(r=Qc(t,this._imageMetas)),r.length>0&&(this._images=r,this.imagesLoaded.raiseEvent({images:r}))}}_getClosestTileCoordinate(t){if(!this._tileLevel)return null;const e=this._tileGrid.getTileCoordForCoordAndZ(t,this._tileLevel);if(this._tiles.has(e.join("/")))return e;let s=1/0,r=null;return[...this._tiles.keys()].forEach(n=>{const a=n.split("/").map(Number),o=ke([e[1],e[2]],[a[1],a[2]]);o<s&&(s=o,r=a)}),r||e}_getTileCoordinatesForExtent(t){const e=this._tileGrid.getTileCoordForCoordAndZ([t[0],t[3]],this._tileLevel),s=this._tileGrid.getTileCoordForCoordAndZ([t[2],t[1]],this._tileLevel),r=[];for(let n=e[1];n<=s[1];n++)for(let a=e[2];a<=s[2];a++)r.push([this._tileLevel,n,a]);return r.map(n=>n.join("/")).filter(n=>{const a=this._tiles.get(n);return a&&a!==at.READY})}getDataStateForCoordinate(t){if(this._state!==at.READY||this._tiles.size===0)return this._state;const e=this._getClosestTileCoordinate(t).join("/");return this._tiles.has(e)?this._tiles.get(e):at.READY}getDataStateForExtent(t){if(this._state!==at.READY||this._tiles.size===0)return this._state;const s=this._getTileCoordinatesForExtent(t).map(r=>this._tiles.get(r)).filter(r=>r);return Js(s)}_loadTile(t){if(this._loadingPromises.has(t))return this._loadingPromises.get(t);if(this._tiles.get(t)!==at.PENDING)return Promise.resolve();this._tiles.set(t,at.LOADING);const e=ye(`${this.baseUrl}/${t}.json`).then(s=>{const r=co(s,this._imageMetas);r.length>0&&(this._images=this._images.concat(r),this.imagesLoaded.raiseEvent({images:r,tileCoordinate:t}))}).catch(s=>{console.error(s)}).finally(()=>{this._tiles.set(t,at.READY),this._loadingPromises.delete(t)});return this._loadingPromises.set(t,e),e}async loadDataForCoordinate(t){const e=this._getClosestTileCoordinate(t);e&&await this._loadTile(e.join("/"))}async loadDataForExtent(t){const e=this._getTileCoordinatesForExtent(t);await Promise.all(e.map(s=>this._loadTile(s)))}destroy(){this.imagesLoaded.destroy(),this._images=[],this._imageMetas=[],this._tiles.clear(),this._loadingPromises.clear(),this._tileGrid=null,this._terrainProvider=null}toJSON(){const t={url:this.url};return this.projection&&(t.projection=this.projection.toJSON()),this._terrainProviderOptions&&(t.terrainProvider=_({},this._terrainProviderOptions)),t}}let go="";function i1(){if(!go){const i=document.createElement("canvas");i.height=512,i.width=512;const t=i.getContext("2d");t.fillStyle="#409D76",t.fillRect(0,0,512,512),t.font="bold 46px Monospace, Courier New",t.fillStyle="#424242",t.textAlign="center",t.fillText("No Image",256,256),go=i.toDataURL("png")}return go}class eu{constructor(t,e){this.id=Xt(),this.size=t.size,this.url=t.url,this.tileSize=t.tileSize,this.format=t.format,this.minZoom=e.minZoom,this.maxZoom=e.maxZoom,this.scaleFactor=e.scaleFactor;const{tileResolution:s}=t;this.tileResolution=s.slice(0,s.length-e.hideLevels),this._createViewAndLayer()}_createViewAndLayer(){const t=[0,0,...this.size],e=new vd({code:"ZOOMIFY",units:"pixels",extent:t}),s=this.maxZoom>0?this.maxZoom:this.tileResolution.length+4,r=Math.log(2)/Math.log(this.scaleFactor);this.view=new bn({projection:e,center:[this.size[0]/2,this.size[1]/2],constrainOnlyCenter:!0,minZoom:this.minZoom*r,maxZoom:s*r,extent:[-2e3,-2e3,this.size[0]+2e3,this.size[1]+2e3],zoom:this.minZoom*r,zoomFactor:this.scaleFactor});const n={projection:e,tileGrid:new Bo({origin:[0,0],extent:t,resolutions:this.tileResolution,tileSize:this.tileSize})};Uc(this.url)||(n.crossOrigin="anonymous"),this.tileImageSource=new _d(n),this.layer=new bi({source:this.tileImageSource,extent:t})}setImageName(t,e=!1){e&&this.tileImageSource.setTileLoadFunction(s=>{s.getImage().src=i1(),s.load()}),this.tileImageSource.setTileUrlFunction(s=>{const[r,n,a]=s,o=-a-1;return`${this.url}/${t}/${r}/${n}/${o}.${this.format}`}),this.tileImageSource.refresh()}destroy(){this.view=null,this.layer=null,this.tileImageSource.clear(),this.tileImageSource=null}}function s1(i,t,e,s,r){iu(i,t,e||0,s||i.length-1,r||r1)}function iu(i,t,e,s,r){for(;s>e;){if(s-e>600){var n=s-e+1,a=t-e+1,o=Math.log(n),l=.5*Math.exp(2*o/3),h=.5*Math.sqrt(o*l*(n-l)/n)*(a-n/2<0?-1:1),c=Math.max(e,Math.floor(t-a*l/n+h)),u=Math.min(s,Math.floor(t+(n-a)*l/n+h));iu(i,t,c,u,r)}var d=i[t],f=e,g=s;for(Ks(i,e,t),r(i[s],d)>0&&Ks(i,e,s);f<g;){for(Ks(i,f,g),f++,g--;r(i[f],d)<0;)f++;for(;r(i[g],d)>0;)g--}r(i[e],d)===0?Ks(i,e,g):(g++,Ks(i,g,s)),g<=t&&(e=g+1),t<=g&&(s=g-1)}}function Ks(i,t,e){var s=i[t];i[t]=i[e],i[e]=s}function r1(i,t){return i<t?-1:i>t?1:0}class mo{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 s=[];if(!un(t,e))return s;const r=this.toBBox,n=[];for(;e;){for(let a=0;a<e.children.length;a++){const o=e.children[a],l=e.leaf?r(o):o;un(t,l)&&(e.leaf?s.push(o):yo(t,l)?this._all(o,s):n.push(o))}e=n.pop()}return s}collides(t){let e=this.data;if(!un(t,e))return!1;const s=[];for(;e;){for(let r=0;r<e.children.length;r++){const n=e.children[r],a=e.leaf?this.toBBox(n):n;if(un(t,a)){if(e.leaf||yo(t,a))return!0;s.push(n)}}e=s.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let s=0;s<t.length;s++)this.insert(t[s]);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 s=this.data;this.data=e,e=s}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=ts([]),this}remove(t,e){if(!t)return this;let s=this.data;const r=this.toBBox(t),n=[],a=[];let o,l,h;for(;s||n.length;){if(s||(s=n.pop(),l=n[n.length-1],o=a.pop(),h=!0),s.leaf){const c=n1(t,s.children,e);if(c!==-1)return s.children.splice(c,1),n.push(s),this._condense(n),this}!h&&!s.leaf&&yo(s,r)?(n.push(s),a.push(o),o=0,l=s,s=s.children[0]):l?(o++,s=l.children[o],h=!1):s=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 s=[];for(;t;)t.leaf?e.push(...t.children):s.push(...t.children),t=s.pop();return e}_build(t,e,s,r){const n=s-e+1;let a=this._maxEntries,o;if(n<=a)return o=ts(t.slice(e,s+1)),Qi(o,this.toBBox),o;r||(r=Math.ceil(Math.log(n)/Math.log(a)),a=Math.ceil(n/Math.pow(a,r-1))),o=ts([]),o.leaf=!1,o.height=r;const l=Math.ceil(n/a),h=l*Math.ceil(Math.sqrt(a));su(t,e,s,h,this.compareMinX);for(let c=e;c<=s;c+=h){const u=Math.min(c+h-1,s);su(t,c,u,l,this.compareMinY);for(let d=c;d<=u;d+=l){const f=Math.min(d+l-1,u);o.children.push(this._build(t,d,f,r-1))}}return Qi(o,this.toBBox),o}_chooseSubtree(t,e,s,r){for(;r.push(e),!(e.leaf||r.length-1===s);){let n=1/0,a=1/0,o;for(let l=0;l<e.children.length;l++){const h=e.children[l],c=po(h),u=l1(t,h)-c;u<a?(a=u,n=c<n?c:n,o=h):u===a&&c<n&&(n=c,o=h)}e=o||e.children[0]}return e}_insert(t,e,s){const r=s?t:this.toBBox(t),n=[],a=this._chooseSubtree(r,this.data,e,n);for(a.children.push(t),tr(a,r);e>=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(r,n,e)}_split(t,e){const s=t[e],r=s.children.length,n=this._minEntries;this._chooseSplitAxis(s,n,r);const a=this._chooseSplitIndex(s,n,r),o=ts(s.children.splice(a,s.children.length-a));o.height=s.height,o.leaf=s.leaf,Qi(s,this.toBBox),Qi(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(s,o)}_splitRoot(t,e){this.data=ts([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Qi(this.data,this.toBBox)}_chooseSplitIndex(t,e,s){let r,n=1/0,a=1/0;for(let o=e;o<=s-e;o++){const l=Qs(t,0,o,this.toBBox),h=Qs(t,o,s,this.toBBox),c=h1(l,h),u=po(l)+po(h);c<n?(n=c,r=o,a=u<a?u:a):c===n&&u<a&&(a=u,r=o)}return r||s-e}_chooseSplitAxis(t,e,s){const r=t.leaf?this.compareMinX:a1,n=t.leaf?this.compareMinY:o1,a=this._allDistMargin(t,e,s,r),o=this._allDistMargin(t,e,s,n);a<o&&t.children.sort(r)}_allDistMargin(t,e,s,r){t.children.sort(r);const n=this.toBBox,a=Qs(t,0,e,n),o=Qs(t,s-e,s,n);let l=cn(a)+cn(o);for(let h=e;h<s-e;h++){const c=t.children[h];tr(a,t.leaf?n(c):c),l+=cn(a)}for(let h=s-e-1;h>=e;h--){const c=t.children[h];tr(o,t.leaf?n(c):c),l+=cn(o)}return l}_adjustParentBBoxes(t,e,s){for(let r=s;r>=0;r--)tr(e[r],t)}_condense(t){for(let e=t.length-1,s;e>=0;e--)t[e].children.length===0?e>0?(s=t[e-1].children,s.splice(s.indexOf(t[e]),1)):this.clear():Qi(t[e],this.toBBox)}}function n1(i,t,e){if(!e)return t.indexOf(i);for(let s=0;s<t.length;s++)if(e(i,t[s]))return s;return-1}function Qi(i,t){Qs(i,0,i.children.length,t,i)}function Qs(i,t,e,s,r){r||(r=ts(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let n=t;n<e;n++){const a=i.children[n];tr(r,i.leaf?s(a):a)}return r}function tr(i,t){return i.minX=Math.min(i.minX,t.minX),i.minY=Math.min(i.minY,t.minY),i.maxX=Math.max(i.maxX,t.maxX),i.maxY=Math.max(i.maxY,t.maxY),i}function a1(i,t){return i.minX-t.minX}function o1(i,t){return i.minY-t.minY}function po(i){return(i.maxX-i.minX)*(i.maxY-i.minY)}function cn(i){return i.maxX-i.minX+(i.maxY-i.minY)}function l1(i,t){return(Math.max(t.maxX,i.maxX)-Math.min(t.minX,i.minX))*(Math.max(t.maxY,i.maxY)-Math.min(t.minY,i.minY))}function h1(i,t){const e=Math.max(i.minX,t.minX),s=Math.max(i.minY,t.minY),r=Math.min(i.maxX,t.maxX),n=Math.min(i.maxY,t.maxY);return Math.max(0,r-e)*Math.max(0,n-s)}function yo(i,t){return i.minX<=t.minX&&i.minY<=t.minY&&t.maxX<=i.maxX&&t.maxY<=i.maxY}function un(i,t){return t.minX<=i.maxX&&t.minY<=i.maxY&&t.maxX>=i.minX&&t.maxY>=i.minY}function ts(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function su(i,t,e,s,r){const n=[t,e];for(;n.length;){if(e=n.pop(),t=n.pop(),e-t<=s)continue;const a=t+Math.ceil((e-t)/s/2)*s;s1(i,a,t,e,r),n.push(t,a,a,e)}}var vo={exports:{}},ru={exports:{}};(function(i,t){(function(e,s){i.exports=s()})(N0,function(){var e=function(n,a){if(n===void 0&&(n=[]),a===void 0&&(a=s),this.data=n,this.length=this.data.length,this.compare=a,this.length>0)for(var o=(this.length>>1)-1;o>=0;o--)this._down(o)};e.prototype.push=function(n){this.data.push(n),this.length++,this._up(this.length-1)},e.prototype.pop=function(){if(this.length!==0){var n=this.data[0],a=this.data.pop();return this.length--,this.length>0&&(this.data[0]=a,this._down(0)),n}},e.prototype.peek=function(){return this.data[0]},e.prototype._up=function(n){for(var a=this,o=a.data,l=a.compare,h=o[n];n>0;){var c=n-1>>1,u=o[c];if(l(h,u)>=0)break;o[n]=u,n=c}o[n]=h},e.prototype._down=function(n){for(var a=this,o=a.data,l=a.compare,h=this.length>>1,c=o[n];n<h;){var u=(n<<1)+1,d=o[u],f=u+1;if(f<this.length&&l(o[f],d)<0&&(u=f,d=o[f]),l(d,c)>=0)break;o[n]=d,n=u}o[n]=c};function s(r,n){return r<n?-1:r>n?1:0}return e})})(ru);var c1=ru.exports;vo.exports=nu,vo.exports.default=nu;function nu(i,t,e,s,r,n){for(var a=i.data,o=[],l=i.toBBox,h,c,u,d,f=new c1(void 0,u1);a;){for(h=0;h<a.children.length;h++)c=a.children[h],u=d1(t,e,a.leaf?l(c):c),(!n||u<=n*n)&&f.push({node:c,isItem:a.leaf,dist:u});for(;f.length&&f.peek().isItem;)if(d=f.pop().node,(!r||r(d))&&o.push(d),s&&o.length===s)return o;a=f.pop(),a&&(a=a.node)}return o}function u1(i,t){return i.dist-t.dist}function d1(i,t,e){var s=au(i,e.minX,e.maxX),r=au(t,e.minY,e.maxY);return s*s+r*r}function au(i,t,e){return i<t?t-i:i<=e?0:i-e}var ou=vo.exports;function lu(i){return i.map(t=>{const e=dt(t.meta.projection.proj,F.proj),s=new Z({geometry:new nn([t.groundCoordinates.map(r=>e(r.slice(0,2),void 0,void 0))]),viewDirection:t.viewDirection});return s.setId(t.name),s})}function hu(i){const t=Vo();return Object.entries(i).map(([e,s])=>{const r=e.split("/").map(o=>Number.parseInt(o,10)),n=t.getTileCoordExtent(r),a=new Z({geometry:O_(n),state:s});return a.setId(e),a})}class Ne extends re{static get className(){return"ObliqueCollection"}static getDefaultOptions(){return{maxZoom:0,minZoom:0,scaleFactor:4,dataSets:void 0,hideLevels:0,activeOnStartup:!1}}constructor(t){super(t);const e=Ne.getDefaultOptions();this._directionTrees=new Map,this._images=new Map,this._dataSets=[],this.viewOptions={maxZoom:V(t.maxZoom,e.maxZoom),minZoom:V(t.minZoom,e.minZoom),scaleFactor:E(t.scaleFactor,e.scaleFactor),hideLevels:V(t.hideLevels,e.hideLevels)},this._loaded=!1,this.imagesLoaded=new R,this._tileFeatureSource=null,this._imageFeatureSource=null,Array.isArray(t.dataSets)&&t.dataSets.forEach(s=>{this._addDataSet(s)}),this._destroyed=new R,this.activeOnStartup=rt(t.activeOnStartup,e.activeOnStartup)}get dataSets(){return this._dataSets.slice()}get loaded(){return this._loaded}get destroyed(){return this._destroyed}get tileFeatureSource(){return this._tileFeatureSource||(this._tileFeatureSource=this._createTileFeatureSource()),this._tileFeatureSource}get imageFeatureSource(){return this._imageFeatureSource||(this._imageFeatureSource=this._createImageFeatureSource()),this._imageFeatureSource}get images(){return[...this._images.values()]}_createTileFeatureSource(){const t=hu(this.getTiles()),e=new vs;return e.addFeatures(t),e}_createImageFeatureSource(){const t=lu([...this._images.values()]),e=new vs;return e.addFeatures(t),e}async _loadDataSet(t){if(await t.load(),this._tileFeatureSource){const e=hu(t.getTiles());this._tileFeatureSource.addFeatures(e)}}_addDataSet(t){let e;t instanceof fo?e=t:e=new fo(t.url,t.projection,t.terrainProvider),e.imagesLoaded.addEventListener(({images:s,tileCoordinate:r})=>{this._loadImages(s,r)}),this._loadImages(e.images),this._dataSets.push(e)}async addDataSet(t){this._loadingPromise&&(await this._loadingPromise,await this._loadDataSet(t)),this._addDataSet(t)}async load(){this._loadingPromise||(this._loadingPromise=Promise.all(this._dataSets.map(t=>this._loadDataSet(t))),await this._loadingPromise,this._loaded=!0),await this._loadingPromise}_loadImages(t,e){if(e&&this._tileFeatureSource){const r=this._tileFeatureSource.getFeatureById(e);r&&r.set("state",at.READY)}const s=new Map;if(t.forEach(r=>{this._images.set(r.name,r),s.has(r.viewDirection)||s.set(r.viewDirection,[]);const n=dt(r.meta.projection.proj,F.proj),a=r.centerPointOnGround.slice(0,2);n(a,a,void 0),s.get(r.viewDirection).push({minX:a[0],minY:a[1],maxX:a[0],maxY:a[1],name:r.name})}),s.forEach((r,n)=>{this._directionTrees.get(n)||this._directionTrees.set(n,new mo),this._directionTrees.get(n).load(r)}),this._imageFeatureSource){const r=lu(t);this._imageFeatureSource.addFeatures(r)}this.imagesLoaded.raiseEvent(t)}getTiles(){const t={};return this._dataSets.forEach(e=>{Object.entries(e.getTiles()).forEach(([s,r])=>{t[s]?t[s]=Js([r,t[s]]):t[s]=r})}),t}getImageByName(t){return this._images.get(t)}getAvailableViewDirections(){return[...this._directionTrees.keys()]}getDataStateForCoordinate(t){const e=this._dataSets.map(s=>s.getDataStateForCoordinate(t));return Js(e)}getDataStateForExtent(t){const e=this._dataSets.map(s=>s.getDataStateForExtent(t));return Js(e)}async loadDataForCoordinate(t){await Promise.all(this._dataSets.map(e=>e.loadDataForCoordinate(t)))}async loadDataForExtent(t){await Promise.all(this._dataSets.map(e=>e.loadDataForExtent(t)))}_getNextImageForCoordinate(t,e){const s=this._directionTrees.get(e);if(s){const r=ou(s,t[0],t[1],1);if(r.length===1&&r[0].name)return this.getImageByName(r[0].name)}}getImageForCoordinate(t,e){const s=[e,...Object.values(ut).filter(r=>r!==e)];for(let r=0;r<s.length;r++){const n=this._getNextImageForCoordinate(t,s[r]);if(n)return n}}async loadImageForCoordinate(t,e){return await this.loadDataForCoordinate(t),this.getImageForCoordinate(t,e)}async hasImageAtCoordinate(t,e){const s=await this.loadImageForCoordinate(t,e);if(s){const r=dt(F.proj,s.meta.projection.proj),n=t.slice(0,2);r(n,n,void 0);const a=ys(s.groundCoordinates);return Sd(a,n)}return!1}async loadAdjacentImage(t,e,s=Math.PI/4){const r=this._directionTrees.get(t.viewDirection);if(r){const n=dt(t.meta.projection.proj,F.proj),a=t.groundCoordinates.map(u=>n(u.slice(0,2),void 0,void 0)),o=ys(a);await this.loadDataForExtent(Uo(o,200));const l=In(o),c=ou(r,l[0],l[1],20).find(u=>{if(u.name!==t.name){let d=Math.atan2(u.minY-l[1],u.minX-l[0]);d<=0&&(d+=Math.PI*2);let f=d-e;if(f>Math.PI?f-=Math.PI*2:f<-Math.PI&&(f+=Math.PI*2),f<=s&&f>=-s)return u}return!1});if(c)return this.getImageByName(c.name)}}destroy(){this._dataSets.forEach(t=>{t.destroy()}),this._dataSets=[],[...this._directionTrees.values()].forEach(t=>{t.clear()}),this._directionTrees.clear(),this._images.clear(),this._tileFeatureSource&&(this._tileFeatureSource.clear(!0),this._tileFeatureSource=null),this._imageFeatureSource&&(this._imageFeatureSource.clear(!0),this._imageFeatureSource=null),this.imagesLoaded.destroy(),super.destroy(),this.destroyed.raiseEvent(),this._destroyed.destroy()}toJSON(){const t=super.toJSON(),e=Ne.getDefaultOptions();return this.viewOptions.maxZoom!==e.maxZoom&&(t.maxZoom=this.viewOptions.maxZoom),this.viewOptions.minZoom!==e.minZoom&&(t.minZoom=this.viewOptions.minZoom),this.viewOptions.scaleFactor!==e.scaleFactor&&(t.scaleFactor=this.viewOptions.scaleFactor),this.viewOptions.hideLevels!==e.hideLevels&&(t.hideLevels=this.viewOptions.hideLevels),this.dataSets.length>0&&(t.dataSets=this.dataSets.map(s=>s.toJSON())),t}}const f1=new Zs({name:"defaultObliqueMeta",size:[512,512],tileSize:[512,512],tileResolution:[1],projection:F,format:"png",url:""}),cu=Symbol("isDefaultImage");class uu extends Ne{constructor(){super({})}getImageForCoordinate(t,e){const s=[[t[0]-100,t[1]-100,0],[t[0]+100,t[1]-100,0],[t[0]+100,t[1]+100,0],[t[0]-100,t[1]+100,0]],r=new hn({meta:f1,viewDirection:ut.NORTH,viewDirectionAngle:0,name:this.name,groundCoordinates:s,centerPointOnGround:t});return r[cu]=!0,r}}function du(i,t){return i<0?0:i>t?t:i}class fu{constructor(t){this._active=!1,this._loadingImage=null,this._olMap=t,this._viewCache=new Map,this._currentImage=null,this._currentView=null,this._collection=null,this._mapChangeEvent="postrender",this.imageChanged=new R,this.switchEnabled=!0,this.switchThreshold=0}get mapChangeEvent(){return this._mapChangeEvent}set mapChangeEvent(t){this._mapChangeEvent=t,this._active&&(this._postRenderListener&&yt(this._postRenderListener),this._postRenderListener=this._olMap.on(this._mapChangeEvent,this._postRenderHandler.bind(this)))}get loading(){return!!this._loadingImage}get active(){return this._active}get currentImage(){return this._currentImage}get collection(){return this._collection}setCollection(t){if(this._loadingImage=null,!t.loaded){console.error("cannot set an unloaded collection");return}this._collection=t,this._removeCurrentView(),this._currentView=null,this._currentImage=null}activate(){if(!this._collection)throw new Error("cannot activate provider without an oblique collection.");this._active||(this._active=!0,this._setCurrentView(),this._postRenderListener||(this._postRenderListener=this._olMap.on(this._mapChangeEvent,this._postRenderHandler.bind(this))))}deactivate(){this._currentView&&this._removeCurrentView(),this._postRenderListener&&(yt(this._postRenderListener),this._postRenderListener=null),this._active=!1}_pullCoordinateToImageCenter(t){if(this.currentImage){const e=[this.currentImage.meta.size[0]/2,this.currentImage.meta.size[1]/2];t[0]<e[0]?t[0]+=50:t[0]-=50,t[1]<e[1]?t[1]+=50:t[1]-=50}return t}_postRenderHandler(){if(this._active&&!this.loading&&this.switchEnabled){const t=this._currentImage?this._currentImage.meta.size:null,e=this._olMap.getView().getCenter(),s=this.switchThreshold,r=1-s;if(!this._currentImage||e[0]/t[0]>s&&e[0]/t[0]<r&&e[1]/t[1]>s&&e[1]/t[1]<r)return;const n=this._pullCoordinateToImageCenter(e.slice()),a=this._currentImage.transformImage2RealWorld(n).slice(0,2),l=dt(this._currentImage.meta.projection.proj,F.proj)(a,void 0,void 0),h=200,c=[l[0]-h,l[1]-h,l[0]+h,l[1]+h],u=this._collection.getDataStateForExtent(c);if(u===at.READY){const d=this._collection.getImageForCoordinate(l,this._currentImage.viewDirection);d&&d.name!==this._currentImage.name&&this._changeImage(d,e)}else u===at.PENDING&&this._collection.loadDataForExtent(c)}}async _changeImage(t,e){this._loadingImage=t;const{coords:s}=await Ki(this._currentImage,e);this._loadingImage===t&&await this.setImage(t,s)}async setImage(t,e){if(!this._collection)throw new Error("cannot set an image without an oblique collection.");this._loadingImage=t;const s=!this._currentImage||this._currentImage.name!==t.name;if(this._currentImage=t,s&&await t.calculateImageAverageHeight(),t!==this._loadingImage)return!1;let r;this._viewCache.has(t.meta)?r=this._viewCache.get(t.meta):(r=new eu(t.meta,this._collection.viewOptions),this._viewCache.set(t.meta,r));const n=this._currentView;this._currentView=r,s&&this._currentView.setImageName(this._currentImage.name,this._currentImage[cu]);const[a,o]=this._currentImage.meta.size;let l=[a/2,o/2];if(e){const h=dt(F.proj,this._currentImage.meta.projection.proj)(e.slice(0,2),void 0,void 0),c=this._currentImage.transformRealWorld2Image(h,e[2]);c[0]=du(c[0],a),c[1]=du(c[1],o),l=c}return this._currentView.view.setCenter(l),this._active&&this._setCurrentView(n),this._loadingImage=null,s&&this.imageChanged.raiseEvent(t),!0}_setCurrentView(t){this._currentView&&(t&&t===this._currentView||(t&&this._olMap.removeLayer(t.layer),this._olMap.getView()&&this._olMap.getView().getResolution()&&this._currentView.view.setResolution(this._olMap.getView().getResolution()),this._olMap.setView(this._currentView.view),this._olMap.getLayers().insertAt(0,this._currentView.layer)))}_removeCurrentView(){this._currentView&&(this._olMap.getView()===this._currentView.view&&this._olMap.setView(new bn),this._olMap.removeLayer(this._currentView.layer))}async setView(t,e,s=2){if(!this._collection)throw new Error("cannot set the view without an oblique collection.");const r=t.slice(),n=`${t.join("")}${e}${s}`;this._loadingImage=n;const a=await this._collection.loadImageForCoordinate(t,e);if(a){if(this._loadingImage!==n)return;if(this._loadingImage=a,!r[2]&&a.meta.terrainProvider){const l=[r];await pi(a.meta.terrainProvider,l,F,l)}if(this._loadingImage!==a)return;await this.setImage(a,r)&&this._currentView.view.setZoom(s)}else throw new Error("could not find an image for this direction")}async getView(){if(this._currentView&&this._currentImage){const t=this._currentView.view.getCenter(),{coords:e}=await Ki(this._currentImage,t);return{center:e,direction:this._currentImage.viewDirection,zoom:this._currentView.view.getZoom()}}return null}destroy(){this._removeCurrentView(),[...this._viewCache.values()].forEach(t=>{t.destroy()}),this._viewCache.clear(),this._loadingImage=null,this._postRenderListener&&(yt(this._postRenderListener),this._postRenderListener=null),this.imageChanged.destroy(),this._collection=null,this._olMap=null}}const g1={[ut.NORTH]:0,[ut.EAST]:90,[ut.SOUTH]:180,[ut.WEST]:270},gu=new uu;function _o(i){const{heading:t}=i;let e=ut.NORTH;return t>=45&&t<135?e=ut.EAST:t>=135&&t<225?e=ut.SOUTH:t>=225&&t<315&&(e=ut.WEST),e}function mu(i){const t=i.groundPosition||i.cameraPosition;return Xe(t,B.proj,F.proj)}class ae extends Us{static get className(){return"ObliqueMap"}static getDefaultOptions(){return O(_({},Ee.getDefaultOptions()),{changeOnMoveEnd:!1,switchThreshold:0,switchOnEdge:!0})}constructor(t){super(t);const e=ae.getDefaultOptions();this._loadingCollection=null,this._mapChangeEvent=t.changeOnMoveEnd?"moveend":"postrender",this._switchThreshold=E(t.switchThreshold,e.switchThreshold),this._switchThreshold>1?this._switchThreshold=.2:this._switchThreshold<0&&(this._switchThreshold=0),this._switchEnabled=rt(t.switchOnEdge,e.switchOnEdge),this.collectionChanged=new R,this._activeCollectionDestroyedListener=()=>{}}get switchEnabled(){return this._switchEnabled}set switchEnabled(t){this._switchEnabled=t,this._obliqueProvider&&(this._obliqueProvider.switchEnabled=t)}get switchThreshold(){return this._switchThreshold}set switchThreshold(t){v(t,Number),this._switchThreshold=t,this._switchThreshold>1?this._switchThreshold=.2:this._switchThreshold<0&&(this._switchThreshold=0),this._obliqueProvider&&(this._obliqueProvider.switchThreshold=this._switchThreshold)}get mapChangeEvent(){return this._mapChangeEvent}async initialize(){this.initializedPromise||(this.initializedPromise=super.initialize().then(async()=>{this._obliqueProvider=new fu(this.olMap),this.mapChangeEvent=this._mapChangeEvent,this.switchThreshold=this._switchThreshold,this.switchEnabled=this._switchEnabled;let t=this._loadingCollection;t||(t=gu),t&&await this._setCollection(t)}).then(()=>{this.initialized=!0})),await this.initializedPromise}set mapChangeEvent(t){v(t,String),this._mapChangeEvent=t,this._obliqueProvider&&(this._obliqueProvider.mapChangeEvent=t)}get collection(){return this._obliqueProvider.collection}get imageChanged(){return this._obliqueProvider?this._obliqueProvider.imageChanged:null}get currentImage(){return this._obliqueProvider?this._obliqueProvider.currentImage:null}async canShowViewpoint(t){if(await this.initialize(),this.collection){const e=_o(t),s=mu(t);return this.collection.hasImageAtCoordinate(s,e)}return!1}async activate(){await super.activate(),this.active&&this._obliqueProvider.activate()}getExtentOfCurrentImage(){const t=this.currentImage;if(t){const e=ys(t.groundCoordinates);return new pt({coordinates:qo(e,t.meta.projection.proj,F.proj),projection:F.toJSON()})}return new pt({coordinates:[-189243134349e-4,-155387110963e-4,189243134349e-4,155387110963e-4],projection:F.toJSON()})}deactivate(){super.deactivate(),this._obliqueProvider.deactivate()}async setCollection(t,e){v(t,Ne),!this.movementDisabled&&(this._loadingCollection=t,!!this.initializedPromise&&(await this.initializedPromise,this._loadingCollection===t&&await this._setCollection(t,e)))}async _setCollection(t,e){this._loadingCollection=t,this._activeCollectionDestroyedListener(),this._activeCollectionDestroyedListener=t.destroyed.addEventListener(()=>{this._setCollection(gu)}),await t.load();const s=e||await this.getViewPoint();this._loadingCollection===t&&(this._obliqueProvider.setCollection(t),this.collectionChanged.raiseEvent(t),s&&await this.gotoViewPoint(s))}async setImageByName(t,e){if(this.movementDisabled||!this.initializedPromise)return;await this.initializedPromise;const s=this._obliqueProvider.collection.getImageByName(t);s&&await this._obliqueProvider.setImage(s,e)}async getViewPoint(){const t=this.currentImage;if(!t)return null;const e=this.olMap.getView().getCenter();if(!e)return null;const s={dataProjection:B},{coords:r}=await Ki(t,e,s);return this._computeViewpointInternal(r)}getViewPointSync(){const t=this.currentImage;if(!t)return null;const e=this.olMap.getView().getCenter();if(!e)return null;const s=t.transformImage2RealWorld(e,t.averageHeight),n=dt(t.meta.projection.proj,B.proj)(s.slice(0,2),void 0,void 0);return this._computeViewpointInternal(n)}_computeViewpointInternal(t){const e=this.currentImage,{size:s,fovy:r,metersPerUnit:n}=no(this.olMap,e),h=(this.olMap.getView().getResolution()||1)*s.height*n,c=Math.abs(h/2/Math.tan(r/2)),u=t[2]||e.averageHeight,d=c+u;return new oe({cameraPosition:[t[0],t[1],d],groundPosition:t,heading:g1[e.viewDirection],pitch:-90,roll:0,distance:c})}async gotoViewPoint(t){if(this.movementDisabled||!this._obliqueProvider||!t.isValid())return;const e=_o(t),s=mu(t),{distance:r}=t;if(await this._obliqueProvider.setView(s,e),this._obliqueProvider.currentImage){const n=Wc(this.olMap,this._obliqueProvider.currentImage,r);this.olMap.getView().setZoom(n)}}pointIsVisible(t){const e=this.currentImage;if(!e||!this.active)return!1;const r=this.olMap.getView().calculateExtent(this.olMap.getSize()),n=e.transformImage2RealWorld([r[0],r[1]]),a=e.transformImage2RealWorld([r[2],r[3]]),o=[n[0],n[1],a[0],a[1]],l=qo(o,e.meta.projection.proj,B.proj);return Go(l,t[0],t[1])}toJSON(){const t=super.toJSON(),e=ae.getDefaultOptions();return this.mapChangeEvent==="movened"&&(t.changeOnMoveEnd=!0),this.switchThreshold!==e.switchThreshold&&(t.switchThreshold=this.switchThreshold),this.switchEnabled!==e.switchOnEdge&&(t.switchOnEdge=this.switchEnabled),t}destroy(){this._obliqueProvider&&this._obliqueProvider.destroy(),this.collectionChanged.destroy(),this._activeCollectionDestroyedListener(),super.destroy()}}ri.registerClass(ae.className,ae);const dn={HEIGHT:"height",DISTANCE:"distance"};class rs{static get className(){return"CameraLimiter"}static getDefaultOptions(){return{mode:dn.HEIGHT,terrainUrl:void 0,limit:200,level:12}}constructor(t){const e=rs.getDefaultOptions();this.mode=Kn(t.mode,dn,e.mode),this._terrainUrl=t.terrainUrl||e.terrainUrl,this._terrainProvider=this._terrainUrl?Ji({url:this._terrainUrl}):null,this.limit=E(t.limit,e.limit),this.level=t.level===null?null:V(t.level,e.level),this.lastCheckedPosition=new et,this._terrainHeight=null,this._updatingTerrainHeight=!1}get terrainUrl(){return this._terrainUrl}set terrainUrl(t){it(t,String),this._terrainUrl!==t&&(this._terrainUrl=t,this._terrainProvider=this._terrainUrl?Ji({url:this._terrainUrl}):null)}_limitWithLevel(t){return Hc(this._terrainProvider,this.level,t)?hf(this._terrainProvider,this.level,[t]):this._limitMostDetailed(t)}_limitMostDetailed(t){return yr(this._terrainProvider,[t])}async _updateTerrainHeight(t){if(!this._updatingTerrainHeight&&!t.equalsEpsilon(this.lastCheckedPosition,P.EPSILON5)){this._updatingTerrainHeight=!0;const[e]=this.level!=null?await this._limitWithLevel(t.clone()):await this._limitMostDetailed(t.clone());this._terrainHeight=e.height,this.lastCheckedPosition=t,this._updatingTerrainHeight=!1}}limitCamera(t){let e=Promise.resolve();const s=et.fromCartesian(t.position);if(s)if(this.mode===dn.DISTANCE&&this._terrainProvider){if(e=this._updateTerrainHeight(s),this._terrainHeight&&s.height-this._terrainHeight<this.limit){const r=this._terrainHeight+this.limit;et.toCartesian(new et(s.longitude,s.latitude,r),Hn.WGS84,t.position)}}else s.height<this.limit&&et.toCartesian(new et(s.longitude,s.latitude,this.limit),Hn.WGS84,t.position);return e}toJSON(){const t={},e=rs.getDefaultOptions();return this.terrainUrl&&(t.terrainUrl=this.terrainUrl),this.limit!==e.limit&&(t.limit=this.limit),this.mode!==e.mode&&(t.mode=this.mode),this.level!==e.level&&(t.level=this.level),t}}function fn(i,t,e){const s=e.indexOfKey(t[z]);if(s>-1&&!i.contains(t)){const r=i.length;let n=r;for(let a=0;a<r;a++){const o=i.get(a);if(e.indexOfKey(o[z])>s){n=a;break}}i.add(t,n)}}async function pu(i,t,e){const s=e.indexOfKey(t[z]);if(s>-1){i.contains(t)||await i.add(t);const r=i.length;let n=r;for(let o=0;o<r;o++){const l=i.get(o);if(e.indexOfKey(l[z])>s){n=o;break}}let a=i.indexOf(t);if(n>a&&(n-=1),a<n)for(;a<n;)i.raise(t),a=i.indexOf(t);else if(a>n)for(;a>n;)i.lower(t),a=i.indexOf(t)}}function m1(i,t,e){const{destroyPrimitives:s}=i;i.destroyPrimitives=!1,i.remove(t),fn(i,t,e),i.destroyPrimitives=s}function p1(i,t,e){i.remove(t,!1),fn(i,t,e)}function y1(i,t,e){pu(i,t,e)}function yu(i,t){return t.clockRange=i.clockRange,t.clockStep=i.clockStep,t.multiplier=i.multiplier,(!t.startTime||!t.startTime.equals(i.startTime)||!t.stopTime||!t.stopTime.equals(i.stopTime))&&(t.startTime=i.startTime,t.stopTime=i.stopTime,t.currentTime=i.currentTime),i.definitionChanged.addEventListener((e,s,r)=>{t[s]=r})}function vu(i,t){i.debugShowRenderingStatistics=t,i.debugShowBoundingVolume=t,i.debugShowContentBoundingVolume=t}function v1(i,t){i.filter(e=>e instanceof Ms).forEach(e=>{vu(e,t)})}cf.enableModelExperimental=!1;class G extends Ee{static get className(){return"CesiumMap"}static getDefaultOptions(){return O(_({},Ee.getDefaultOptions()),{enableLightning:!0,tileCacheSize:1,webGLaa:!1,cameraLimiter:void 0,globeColor:"#3f47cc"})}constructor(t){super(t);const e=G.getDefaultOptions();this._cesiumWidget=null,this.dataSourceDisplayClock=new uf({shouldAnimate:!0});const s=new df;s.currentTime=this.dataSourceDisplayClock.currentTime,this._defaultClock=s,this._dataSourceClocks=[],this.debugMode=!1,this.enableLightning=rt(t.enableLightning,e.enableLightning),this.tileCacheSize=V(t.tileCacheSize,e.tileCacheSize),this.screenSpaceEventHandler=null,this._screenSpaceListeners=[],this.defaultJDate=nl.fromDate(new Date(2014,6,20,13,0,0,0)),this.webGLaa=rt(t.webGLaa,e.webGLaa),this.globeColor=Ot.fromCssColorString(t.globeColor||e.globeColor),this._clusterDataSourceDisplay=null,this._terrainProvider=null,this.defaultTerrainProvider=null,this._cameraLimiter=null,this._cameraLimiterOptions=t.cameraLimiter||e.cameraLimiter,this._terrainProviderChangedListener=null,this._preUpdateListener=null,this._clockTickListener=null,this._clockSyncListener=null,this._removeClusterClockTickListener=null,this._debug=!1}get terrainProvider(){return this._terrainProvider}get cameraLimiter(){return this._cameraLimiter}set cameraLimiter(t){it(t,rs),this._cameraLimiter!==t&&(this._cameraLimiter=t,this._cameraLimiter&&!this._preUpdateListener&&this._cesiumWidget?this._setupPreUpdateListener():!this._cameraLimiter&&this._preUpdateListener&&(this._preUpdateListener(),this._preUpdateListener=null))}get debug(){return this._debug}set debug(t){v(t,Boolean),this._debug!==t&&(this._debug=t,this.initialized&&this._setDebug())}_setupPreUpdateListener(){this._preUpdateListener=this._cesiumWidget.scene.preUpdate.addEventListener(()=>{this._cameraLimiter&&this._cameraLimiter.limitCamera(this._cesiumWidget.scene.camera)})}_raisePointerInteraction(t,e,s,r){const n=this.screenSpaceEventHandler._positions.length>1;this.pointerInteractionEvent.raiseEvent({map:this,windowPosition:r.position||r.endPosition,key:t,pointer:e,multipleTouch:n,pointerEvent:s})}_setupInteractions(){const t=[{csModifier:Vn.ALT,vcsModifier:lt.ALT},{csModifier:Vn.CTRL,vcsModifier:lt.CTRL},{csModifier:Vn.SHIFT,vcsModifier:lt.SHIFT},{csModifier:void 0,vcsModifier:lt.NONE}],e=[{type:Ze.LEFT_DOWN,pointerEvent:zt.DOWN,pointer:mt.LEFT},{type:Ze.LEFT_UP,pointerEvent:zt.UP,pointer:mt.LEFT},{type:Ze.RIGHT_DOWN,pointerEvent:zt.DOWN,pointer:mt.RIGHT},{type:Ze.RIGHT_UP,pointerEvent:zt.UP,pointer:mt.RIGHT},{type:Ze.MIDDLE_DOWN,pointerEvent:zt.DOWN,pointer:mt.MIDDLE},{type:Ze.MIDDLE_UP,pointerEvent:zt.UP,pointer:mt.MIDDLE},{type:Ze.MOUSE_MOVE,pointerEvent:zt.MOVE,pointer:mt.ALL}];this._screenSpaceListeners=e.map(({pointerEvent:s,pointer:r,type:n})=>t.map(({csModifier:a,vcsModifier:o})=>(this.screenSpaceEventHandler.setInputAction(l=>{this._raisePointerInteraction(o,r,s,l)},n,a),()=>{this.screenSpaceEventHandler.removeInputAction(n,a)}))).flat()}async initialize(){if(!this.initialized){this._cesiumWidget=new ff(this.mapElement,{requestRenderMode:!1,scene3DOnly:!0,imageryProvider:!1,shadows:!1,terrainShadows:Ss.ENABLED,contextOptions:{webgl:{failIfMajorPerformanceCaveat:!1,antialias:this.webGLaa}}}),this._cesiumWidget.scene.globe.tileCacheSize=this.tileCacheSize,this._cesiumWidget.scene.globe.baseColor=this.globeColor,this.dataSourceDisplay=new al({scene:this._cesiumWidget.scene,dataSourceCollection:new ol}),this._cesiumWidget.scene.frameState.creditDisplay.update=()=>{},this._cesiumWidget.scene.frameState.creditDisplay.beginFrame=()=>{},this._cesiumWidget.scene.frameState.creditDisplay.endFrame=()=>{};const{clock:t}=this._cesiumWidget;t.shouldAnimate=!0,this._clockTickListener=t.onTick.addEventListener(()=>{this.dataSourceDisplayClock.tick();const s=this.dataSourceDisplayClock.currentTime;this.dataSourceDisplay.update(s)}),gf.maximumRequestsPerServer=12,this._cesiumWidget.scene.shadowMap.maximumDistance=5e3,this._cesiumWidget.scene.shadowMap.darkness=.6,this._cesiumWidget.scene.globe.depthTestAgainstTerrain=!0,this._cesiumWidget.scene.highDynamicRange=!1,this._cesiumWidget.scene.imagerySplitPosition=.5,this._cesiumWidget.scene.globe.enableLighting=this.enableLightning,this.setDay(this.defaultJDate);const e=document.getElementsByClassName("cesium-widget-credits");if(e)for(let s=0;s<e.length;s++){const r=e[s];r.style.display="none"}this._cameraLimiterOptions&&!this._cameraLimiter&&(this._cameraLimiter=new rs(this._cameraLimiterOptions)),this._cameraLimiter&&this._setupPreUpdateListener(),this.screenSpaceEventHandler=new mf(this._cesiumWidget.scene.canvas),this._setupInteractions(),this.initialized=!0,this.defaultTerrainProvider=this._cesiumWidget.scene.terrainProvider,this._terrainProvider=this.defaultTerrainProvider,this._terrainProviderChangedListener=this._cesiumWidget.scene.terrainProviderChanged.addEventListener(this._terrainProviderChanged.bind(this)),this._debug&&this._setDebug()}}async activate(){await super.activate(),this.active&&(this._cesiumWidget.useDefaultRenderLoop=!0,this._cesiumWidget.resize())}deactivate(){super.deactivate(),this._cesiumWidget&&(this._cesiumWidget.useDefaultRenderLoop=!1)}getHeightFromTerrain(t){const{terrainProvider:e}=this._cesiumWidget.scene;return e.readyPromise.then(()=>e.availability?pi(e,t,F,t):Promise.resolve(t))}async getViewPoint(){return this.getViewPointSync()}getViewPointSync(){if(!this._cesiumWidget||!this._cesiumWidget.scene||!this.target)return null;const t=this._cesiumWidget.scene.camera,e=t.position;let s=null,r=null;const n=new pf(t.position,t.direction),a=this._cesiumWidget.scene.globe.pick(n,this._cesiumWidget.scene);if(a){r=C.distance(a,e);const h=Hn.WGS84.cartesianToCartographic(a);s=[P.toDegrees(h.longitude),P.toDegrees(h.latitude),h.height]}const o=t.positionCartographic,l=[P.toDegrees(o.longitude),P.toDegrees(o.latitude),o.height];return new oe({groundPosition:s,cameraPosition:l,distance:r,heading:P.toDegrees(t.heading),pitch:P.toDegrees(t.pitch),roll:P.toDegrees(t.roll)})}async gotoViewPoint(t,e){if(this.movementDisabled||!t.isValid())return;let s=null;const{distance:r}=t,n=P.toRadians(t.heading),a=P.toRadians(t.pitch),o=P.toRadians(t.roll);if(t.cameraPosition){const c=t.cameraPosition;s=C.fromDegrees(c[0],c[1],c[2])}else{if(!t.groundPosition)return;const c=t.groundPosition;if(!c[2]){const g=await this.getHeightFromTerrain([T.wgs84ToMercator(c)]);c[2]=g[0][2]}const u=C.fromDegrees(c[0],c[1],c[2]),d=new yf(this._cesiumWidget.scene),f={destination:u,orientation:{heading:n,pitch:a,roll:o}};d.setView(f),d.moveBackward(r),s=d.position}const l=this._cesiumWidget.scene.camera,h={heading:n,pitch:a,roll:o};s=s||null,l.cancelFlight(),t.animate?await new Promise(c=>{const u={destination:s,orientation:h,complete:()=>{c()},cancel:()=>{c()}};t.duration&&(u.duration=t.duration),t.easingFunction&&(u.easingFunction=t.easingFunction),e&&(u.maximumHeight=e),l.flyTo(u)}):l.setView({destination:s,orientation:h})}getCurrentResolution(t){const e=this._cesiumWidget.scene.camera,s=T.mercatorToWgs84(t),r=C.distance(C.fromDegrees(s[0],s[1],s[2]),e.position),n=Math.PI/3,a=this.mapElement.offsetWidth,o=this.mapElement.offsetHeight,l=a/o,h=Math.atan(Math.tan(n*.5)/l)*2,c=2*r*Math.tan(h/2),u=Math.cos(Math.abs(P.toRadians(s[1])));return c/u/o}disableMovement(t){super.disableMovement(t),this._cesiumWidget.scene.screenSpaceCameraController.enableInputs=!t}setDataSourceDisplayClock(t){const e=this._dataSourceClocks[this._dataSourceClocks.length-1];t!==e&&(this._clockSyncListener&&(this._clockSyncListener(),this._clockSyncListener=null),this._clockSyncListener=yu(t,this.dataSourceDisplayClock)),this._dataSourceClocks.push(t)}unsetDataSourceDisplayClock(t){const e=this._dataSourceClocks.lastIndexOf(t);if(e>-1&&(this._dataSourceClocks.splice(e,1),e===this._dataSourceClocks.length)){const s=this._dataSourceClocks[this._dataSourceClocks.length-1]||this._defaultClock;this._clockSyncListener&&(this._clockSyncListener(),this._clockSyncListener=null),this._clockSyncListener=yu(s,this.dataSourceDisplayClock)}}setDay(t){this._cesiumWidget.clock.currentTime=t,this._cesiumWidget.clock.multiplier=1}setLightning(t){this.enableLightning=t,this._cesiumWidget.scene.globe.enableLighting=t}getCesiumWidget(){return this._cesiumWidget}getEntities(){return this.dataSourceDisplay.defaultDataSource.entities}getDatasources(){return this.dataSourceDisplay.dataSources}getClusterDatasources(){if(this._clusterDataSourceDisplay)return this._clusterDataSourceDisplay.dataSources;const t=new ol;function e(s,r,n){const{entities:a}=n;return[new Mf(r,a),new Cf(r,a),new wf(r,a)]}return this._clusterDataSourceDisplay=new al({scene:this._cesiumWidget.scene,dataSourceCollection:t,visualizersCallback:e}),this._removeClusterClockTickListener=this._cesiumWidget.clock.onTick.addEventListener(s=>{this._clusterDataSourceDisplay.update(s.currentTime)}),t}indexChanged(t){const e=this.getVisualizationsForLayer(t);e&&e.forEach(s=>{s instanceof $n?m1(this.getScene().primitives,s,this.layerCollection):s instanceof Je?p1(this.getScene().imageryLayers,s,this.layerCollection):s instanceof ll&&y1(this.dataSourceDisplay.dataSources,s,this.layerCollection)})}addPrimitiveCollection(t){this.validateVisualization(t)&&(this.addVisualization(t),this._debug&&t instanceof Ms&&vu(t,this._debug),fn(this.getScene().primitives,t,this.layerCollection))}removePrimitiveCollection(t){var e;this.removeVisualization(t),(e=this.getScene())==null||e.primitives.remove(t)}addImageryLayer(t){this.validateVisualization(t)&&(this.addVisualization(t),fn(this.getScene().imageryLayers,t,this.layerCollection))}removeImageryLayer(t){var e;this.removeVisualization(t),(e=this.getScene())==null||e.imageryLayers.remove(t)}async addDataSource(t){this.validateVisualization(t)&&(this.addVisualization(t),await pu(this.dataSourceDisplay.dataSources,t,this.layerCollection))}removeDataSource(t){this.removeVisualization(t),!this.dataSourceDisplay.isDestroyed()&&!this.dataSourceDisplay.dataSources.isDestroyed()&&this.dataSourceDisplay.dataSources.remove(t)}setTerrainProvider(t){this.terrainProvider!==t&&(this._cesiumWidget.scene.terrainProvider=t)}unsetTerrainProvider(t){this.terrainProvider===t&&(this._terrainProvider=this.defaultTerrainProvider,this._cesiumWidget.scene.terrainProvider=this.defaultTerrainProvider)}getDataSourceDisplay(){return this.dataSourceDisplay}getScene(){var t;return(t=this._cesiumWidget)==null?void 0:t.scene}pointIsVisible(t){const{camera:e}=this._cesiumWidget.scene,s=C.fromDegrees(t[0],t[1],0);return e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC).computeVisibility(new hl(s))===vf.INSIDE}_setDebug(){this._debug&&this.initialized&&!this._cesiumInspectorContainer&&(this._cesiumInspectorContainer=document.createElement("div"),this._cesiumInspectorContainer.className="vcm-cesium-inspector",this.mapElement.appendChild(this._cesiumInspectorContainer),this._cesiumInspector=new _f(this._cesiumInspectorContainer,this.getScene()),this._cesium3DTilesInspector=new Sf(this._cesiumInspectorContainer,this.getScene()),this._cesium3DTilesInspector.viewModel.picking=!1),this._cesiumInspectorContainer&&(this._cesiumInspectorContainer.style.display=this.active&&this._debug?"":"none"),v1(this.getVisualizations(),this._debug)}_terrainProviderChanged(t){if(this.terrainProvider!==t){const e=this.layerCollection.getByKey(this.terrainProvider[z]);this._terrainProvider=t,e&&e.deactivate()}}pickPositionSupported(){return this.initialized?this._cesiumWidget.scene.pickPositionSupported:!1}isGroundPrimitiveSupported(){return this.initialized?this._cesiumWidget.scene.context.fragmentDepth:!1}toJSON(){const t=super.toJSON(),e=G.getDefaultOptions();return this.enableLightning!==e.enableLightning&&(t.enableLightning=this.enableLightning),this.tileCacheSize!==e.tileCacheSize&&(t.tileCacheSize=this.tileCacheSize),this.webGLaa!==e.webGLaa&&(t.webGLaa=this.webGLaa),this.globeColor.toCssHexString()!==e.globeColor&&(t.globeColor=this.globeColor.toCssHexString()),this._cameraLimiter?t.cameraLimiter=this._cameraLimiter.toJSON():this._cameraLimiterOptions&&!this.initialized&&(t.cameraLimiter=this._cameraLimiterOptions),t}destroy(){this.dataSourceDisplay&&!this.dataSourceDisplay.isDestroyed()&&this.dataSourceDisplay.destroy(),this._screenSpaceListeners.forEach(t=>{t()}),this.screenSpaceEventHandler&&(this.screenSpaceEventHandler.destroy(),this.screenSpaceEventHandler=null),this._terrainProviderChangedListener&&(this._terrainProviderChangedListener(),this._terrainProviderChangedListener=null),this._terrainProvider=null,this.defaultTerrainProvider=null,this._clockTickListener&&(this._clockTickListener(),this._clockTickListener=null),this._clockSyncListener&&(this._clockSyncListener(),this._clockSyncListener=null),this._preUpdateListener&&(this._preUpdateListener(),this._preUpdateListener=null),this._cameraLimiter&&(this._cameraLimiter=null),this._removeClusterClockTickListener&&this._removeClusterClockTickListener(),[...this.layerCollection].forEach(t=>{t.removedFromMap(this)}),this._clusterDataSourceDisplay&&this._clusterDataSourceDisplay.destroy(),this._cesiumWidget&&(this._cesiumWidget.destroy(),this._cesiumWidget=null),this._cesium3DTilesInspector&&(this._cesium3DTilesInspector.destroy(),this._cesium3DTilesInspector=null),this._cesiumInspector&&(this._cesiumInspector.destroy(),this._cesiumInspector=null),this._cesiumInspectorContainer&&(this._cesiumInspectorContainer.parentElement.removeChild(this._cesiumInspectorContainer),this._cesiumInspectorContainer=null),super.destroy()}}ri.registerClass(G.className,G);class Ct extends _e{static get className(){return"VectorLayer"}static get alreadyTransformedToMercator(){return Oh}static get alreadyTransformedToImage(){return Ve}static get obliqueGeometry(){return Wr}static get doNotTransform(){return Ea}static get originalFeatureSymbol(){return Be}static getDefaultOptions(){return O(_({},ht.getDefaultOptions()),{projection:void 0,maxResolution:void 0,minResolution:void 0,dontUseTerrainForOblique:!1,zIndex:50,highlightStyle:void 0,isDynamic:!1,vectorProperties:{}})}constructor(t){super(t);this._supportedMaps=[G.className,ae.className,tt.className];const e=Ct.getDefaultOptions();this.source=new vs({}),this.projection=new T(t.projection),this.maxResolution=t.maxResolution!=null?t.maxResolution:e.maxResolution,this.minResolution=t.minResolution!=null?t.minResolution:e.minResolution,this.dontUseTerrainForOblique=rt(t.dontUseTerrainForOblique,e.dontUseTerrainForOblique),this.highlightStyle=e.highlightStyle,t.highlightStyle&&(this.highlightStyle=t.highlightStyle instanceof q?t.highlightStyle:new q(t.highlightStyle)),this.hasFeatureUUID=!1,this._visibility=!0,this.isDynamic=rt(t.isDynamic,e.isDynamic),this._onStyleChangeRemover=null,this.vectorProperties=new te(_({allowPicking:this.allowPicking},t.vectorProperties));let s=t.style;t.style instanceof ne&&(s=t.style.toJSON()),this._initialStyle=s}get allowPicking(){return super.allowPicking}set allowPicking(t){super.allowPicking=t,this.vectorProperties.allowPicking=t}get visibility(){return this._visibility}set visibility(t){this._visibility!==t&&(this._visibility=t,this.forceRedraw())}initialize(){return super.initialize().then(()=>{this._trackStyleChanges()})}getVcsMeta(t={}){const e=this.vectorProperties.getVcsMeta();if(e.version=Pa,t.embedIcons&&(e.embeddedIcons=[]),t.writeStyle){const s=this.getStyleOrDefaultStyle(this._initialStyle);(t.writeDefaultStyle||!s.equals(this.style))&&Ih(this.style,e)}return e}setVcsMeta(t){this.vectorProperties.setVcsMeta(t)}getImplementationOptions(){return O(_({},super.getImplementationOptions()),{source:this.source,maxResolution:this.maxResolution,minResolution:this.minResolution,vectorProperties:this.vectorProperties})}createImplementationsForMap(t){return this.visibility?t instanceof tt?[new Ya(t,this.getImplementationOptions())]:t instanceof G?[new $c(t,this.getImplementationOptions())]:t instanceof ae?[new lo(t,this.getImplementationOptions())]:[]:[]}getStyleOrDefaultStyle(t,e){return super.getStyleOrDefaultStyle(t,e||oi.clone())}setStyle(t,e){super.setStyle(t,e),this._trackStyleChanges();const s=this.style instanceof Mt;this.getFeatures().forEach(r=>{if(r[Tt]){let n;s?(n=!0,r.setStyle(void 0)):r.getStyle()!==r[Tt].style&&(n=!0,r.setStyle(r[Tt].style)),n&&Reflect.has(r,pe)&&Oa(r)}})}_trackStyleChanges(){this._onStyleChangeRemover&&(this._onStyleChangeRemover(),this._onStyleChangeRemover=null);const t=this.style instanceof Mt;this._onStyleChangeRemover=this.style.styleChanged.addEventListener(()=>{this.getFeatures().forEach(e=>{(t||!e[Tt])&&e.changed()})})}setHighlightStyle(t){v(t,[ft,q,Function]),t instanceof q?this.highlightStyle=t:(this.highlightStyle||(this.highlightStyle=new q({})),this.highlightStyle.style=t)}getSource(){return this.source}addFeatures(t){v(t,[Z]);const e=this.style instanceof Mt,s=t.map(r=>{const n=r.getId();if(n==null)r.setId(Xt());else if(this.hasFeatureUUID=!0,n&&this.getFeatureById(n))return!1;if(this.projection.epsg!==F.epsg){const a=r.getGeometry();a&&(a[Ct.alreadyTransformedToMercator]||(a.transform(this.projection.proj,F.proj),a[Ct.alreadyTransformedToMercator]=!0))}return r[ht.vcsLayerNameSymbol]=this.name,e&&r[Tt]&&r.setStyle(),r}).filter(r=>r);return this.source.addFeatures(s),t.map(r=>r.getId())}removeFeaturesById(t){const e=this.getFeaturesById(t);for(let s=0;s<e.length;s++)this.source.removeFeature(e[s])}removeAllFeatures(){this.source.clear()}getFeaturesById(t){return v(t,[[String,Number]]),t.map(e=>this.getFeatureById(e)).filter(e=>e!=null)}getFeatureById(t){return this.source.getFeatureById(t)}getFeatures(){return this.source.getFeatures()}getZoomToExtent(){const t=super.getZoomToExtent();if(t)return t;const e=new pt({projection:F.toJSON(),coordinates:this.source.getExtent()});return e.isValid()?e:null}objectClickedHandler(t){const e=t[Be]||t;return this.vectorProperties.getAllowPicking(e)?{id:e.getId(),feature:e}:null}getGenericFeatureFromClickedObject(t){return Wa(t,this)}toJSON(){const t=super.toJSON(),e=Ct.getDefaultOptions();this.projection.epsg!==lh().epsg&&(t.projection=this.projection.toJSON()),this.maxResolution!==e.maxResolution&&(t.maxResolution=this.maxResolution),this.minResolution!==e.minResolution&&(t.minResolution=this.minResolution),this.dontUseTerrainForOblique!==e.dontUseTerrainForOblique&&(t.dontUseTerrainForOblique=this.dontUseTerrainForOblique),this.highlightStyle&&(t.highlightStyle=this.highlightStyle.toJSON()),this.isDynamic!==e.isDynamic&&(t.isDynamic=this.isDynamic);const s=this.vectorProperties.getVcsMeta();return Object.keys(s).length>0&&(t.vectorProperties=s),t}destroy(){this.source&&this.source.clear(!0),this._onStyleChangeRemover&&this._onStyleChangeRemover(),this.vectorProperties.destroy(),super.destroy()}}ot.registerClass(Ct.className,Ct);const Qt=Symbol("vcsFeatureType"),yi={DYNAMIC:"dynamic",STATIC:"static",EDITED:"edited"},_1="EPSG:3857";let So;function Mo(){return So||(So=new Wo),So}function _u(i){const{crs:t}=i;if(t){if(t.type==="name")return t.properties.name;if(t.type==="EPSG")return`EPSG:${t.properties.code}`}return null}function Su(i){if(i.get("altitudeMode")&&(i.set("olcs_altitudeMode",i.get("altitudeMode"),!0),i.unset("altitudeMode",!0)),i.get("extrudedHeight")){if(i.get("drawingType"))i.set("olcs_extrudedHeight",i.get("extrudedHeight"),!0);else{const t=Fe.fromGeometry(i.getGeometry()),e=Number.isFinite(t.minZ)?t.minZ:0;i.set("olcs_extrudedHeight",i.get("extrudedHeight")-e,!0)}i.unset("extrudedHeight",!0)}i.get("skirt")&&(i.set("olcs_skirt",i.get("skirt"),!0),i.unset("skirt",!0)),i.get("radius")&&i.unset("radius",!0)}function S1(i,t){const e=Mo().readGeometry(i,t.formatOptions);return String(t.formatOptions.featureProjection)==="EPSG:3857"&&(e[Ct.alreadyTransformedToMercator]=!0),qa(e),new Z({geometry:e})}function Mu(i,t){return i.image&&i.image.src&&/^:\d+$/.test(i.image.src)&&(t.embeddedIcons?i.image.src=t.embeddedIcons[i.image.src.substring(1)]:delete i.image.src),i}function M1(i,t){const e=i.color?bt(i.color):!1,s=i.width||1.25,r=i.pointRadius||5,n=i.opacity||.8;if(delete i.color,delete i.width,delete i.pointRadius,delete i.opacity,t==="Polygon"||t==="Circle"){const a=e?e.slice():[255,255,255,.4];return a[3]=n,{fill:{color:a},stroke:{color:e||bt("#3399CC"),width:s}}}if(t==="LineString")return{stroke:{color:e||bt("#3399CC"),width:s}};if(t==="Point")return{image:{fill:{color:[255,255,255,.4]},radius:r,stroke:{color:e||bt("#3399CC"),width:1}}}}function Cu(i,t){if(!i.geometry)return null;const e=i.geometry.olcs_radius;let s=Mo().readGeometry(i.geometry,t.formatOptions);if(i.radius&&s instanceof xi){const a=s.getCoordinates();a.length===2&&a.push(0),s=new le(a,i.radius,"XYZ")}if(e&&s instanceof xi){const a=s.getCoordinates();a.length===2&&a.push(0),s=Va(a,e)}String(t.formatOptions.featureProjection)==="EPSG:3857"&&(s[Ct.alreadyTransformedToMercator]=!0),i.vcsMeta=i.vcsMeta||{},i.vcsStyle&&(i.vcsMeta.style=i.vcsMeta.style||i.vcsStyle);const{properties:r}=i;t.readLegacyStyleOptions&&!i.vcsMeta.style&&(i.vcsMeta.style=M1(r,s.getType())),qa(s);const n=new Z(O(_({},r),{geometry:s}));if(i.id&&n.setId(i.id),i.state&&(n[Qt]=i.state),i.vcsMeta.style&&!t.dontReadStyle){i.vcsMeta.style=Mu(i.vcsMeta.style,t);let a;t.defaultStyle?(a=t.defaultStyle.clone().assign(new q(i.vcsMeta.style)),a.label!=null&&s.set("_vcsGeomType","Label")):a=new q(i.vcsMeta.style),n[Tt]=a,n.setStyle(a.style)}return Su(n),n}function Ie(i,t={}){const e=typeof i=="string"?JSON.parse(i):i,s=_u(e),r=s?{epsg:s}:t.dataProjection,n={formatOptions:{dataProjection:r?r.epsg:B.epsg,featureProjection:t.targetProjection?t.targetProjection.epsg:F.epsg},dontReadStyle:t.dontReadStyle,readLegacyStyleOptions:t.readLegacyStyleOptions,defaultStyle:t.defaultStyle};if(t.dynamicStyle&&!n.defaultStyle&&(n.defaultStyle=oi),e.type==="FeatureCollection"){e.vcsMeta=e.vcsMeta||{embeddedIcons:e.vcsEmbeddedIcons,style:e.vcsStyle};let a;return e.vcsMeta.embeddedIcons&&(n.embeddedIcons=e.vcsMeta.embeddedIcons),e.vcsMeta.style&&t.dynamicStyle&&(e.vcsMeta.style.type===Mt.className?a=new Mt(e.vcsMeta.style):(e.vcsMeta.style=Mu(e.vcsMeta.style,n),n.defaultStyle=n.defaultStyle.clone().assign(new q(e.vcsMeta.style)),a=n.defaultStyle)),{features:e.features.map(o=>Cu(o,n)).filter(o=>o),style:e.vcsMeta.style?a:void 0,vcsMeta:e.vcsMeta?e.vcsMeta:void 0}}else if(e.type==="Feature"){const a=Cu(e,n);return{features:a?[a]:[],vcsMeta:e.vcsMeta?e.vcsMeta:void 0}}else if(e.type!=null)return{features:[S1(e,n)]};return{features:[]}}function es(i,t={},e){const s={type:"Feature",properties:i.getProperties()};t.writeId&&(s.id=i.getId()),delete s.properties[i.getGeometryName()],delete s.properties.style,delete s.properties.olcs_allowPicking;let r=i.getGeometry(),n=null;if(r instanceof le){const a=r.getCoordinates();n=Md(T.mercatorToWgs84(a[0],!0),T.mercatorToWgs84(a[1],!0)),r=new xi(r.getCenter())}else if(r instanceof En){const a=r.getCoordinates();a.forEach(o=>{an(o)}),r.setCoordinates(a)}else if(r instanceof ur){const a=r.getCoordinates();a.forEach(o=>{o.forEach(l=>{an(l)})}),r.setCoordinates(a)}return s.geometry=Mo().writeGeometryObject(r,{featureProjection:_1,rightHanded:!0}),n&&(s.geometry.olcs_radius=n),s.vcsMeta={},t.writeStyle&&i[Tt]&&(s.vcsMeta.style=Ia(i[Tt].getOptionsForFeature(i),e)),s}function C1(i,t={}){const e=i.vcsMeta||{};e.version=Pa;const s=i.features.map(n=>es(n,t,e.embeddedIcons)),r={type:"FeatureCollection",features:s,vcsMeta:e};return t.asObject?r:JSON.stringify(r,null,t.prettyPrint?2:null)}const w1=Xt();function x1(i,t){if(t.style&&i.setStyle(Bs(t.style,i.defaultStyle)),t.highlightStyle){const e=Bs(t.highlightStyle,i.highlightStyle);i.setHighlightStyle(e)}t.vectorProperties&&i.vectorProperties.setValues(t.vectorProperties),t.zIndex!=null&&(i.zIndex=t.zIndex)}function Co(i,t,e,s){if(s==null?t!==e:s!==t)throw new Error(`Cannot merge options, values of ${i} do not match`)}class De extends re{static get className(){return"Category"}static getDefaultConfig(){return{title:"",featureProperty:void 0,classRegistryName:void 0,layerOptions:{},keyProperty:"name",items:[]}}constructor(t){super(t);const e=De.getDefaultConfig();this.title=t.title||this.name,this._app=null,this._featureProperty=t.featureProperty||e.featureProperty,this._classRegistryName=t.classRegistryName,this._layerOptions=t.layerOptions||e.layerOptions,this._layer=null,this._featureProperty&&(this._layer=new Ct(this._layerOptions),this._layer[Lt]=w1),this._keyProperty=t.keyProperty||e.keyProperty,this._collectionChanged=new R,this._collectionListeners=[],this._collection=null,this.setCollection(new Mi(this._keyProperty)),this._contextRemovedListener=()=>{}}get classRegistryName(){return this._classRegistryName}get collection(){return this._collection}get collectionChanged(){return this._collectionChanged}get layer(){return this._layer}_itemAdded(t){if(this._featureProperty){const e=t[this._keyProperty];this._layer.removeFeaturesById([e]);const s=t[this._featureProperty];let r;if(s instanceof Cd)r=s;else if(typeof s=="object"){const{features:n}=Ie(s);n[0]&&(r=n[0])}r&&(r.setId(e),setTimeout(()=>{this._layer.addFeatures([r])},0))}}_itemRemoved(t){this._featureProperty&&this._layer.removeFeaturesById([t[this._keyProperty]])}_itemReplaced(t){}_itemMoved(t){}_getDynamicContextId(){if(!this._app)throw new Error("Cannot get dynamic context id, before setting the vcApp");return this._app.dynamicContextId}mergeOptions(t){const e=De.getDefaultConfig();Co("classRegistryName",this._classRegistryName,e.classRegistryName,t.classRegistryName),Co("featureProperty",this._featureProperty,e.featureProperty,t.featureProperty),Co("keyProperty",this._keyProperty,e.keyProperty,t.keyProperty),this.title=t.title||this.title,t.layerOptions&&this._layer&&x1(this._layer,t.layerOptions)}setCollection(t){if(v(t,ve),this._keyProperty!==t.uniqueKey)throw new Error("The collections key property does not match the categories key property");this._collectionListeners.forEach(e=>{e()}),this._collection&&me(this._collection),this._layer&&this._layer.removeAllFeatures(),this._collection=t[kr]?t:ni(t,this._getDynamicContextId.bind(this),this._serializeItem.bind(this),this._deserializeItem.bind(this)),[...this.collection].forEach(e=>{this._itemAdded(e)}),this._collectionListeners=[this._collection.added.addEventListener(this._itemAdded.bind(this)),this._collection.removed.addEventListener(this._itemRemoved.bind(this)),this._collection.replaced.addEventListener(this._itemReplaced.bind(this))],this._collection.moved&&this._collectionListeners.push(this._collection.moved.addEventListener(this._itemMoved.bind(this))),this.collectionChanged.raiseEvent()}setApp(t){if(this._app)throw new Error("Cannot switch apps");this._app=t,this._contextRemovedListener=this._app.contextRemoved.addEventListener(e=>{this._collection.removeContext(e.id)}),this._layer&&this._app.layers.add(this._layer)}async _deserializeItem(t){if(!this._app)throw new Error("Cannot deserialize item before setting the vcApp");const e=this._classRegistryName?this._app[this._classRegistryName]:null;return e&&e instanceof fe?ge(e,t):t}_serializeItem(t){const e=JSON.parse(JSON.stringify(t));if(this._featureProperty){const s=this._layer.getFeatureById(t[this._keyProperty]);s&&(e[this._featureProperty]=es(s))}return e}serializeForContext(t){return this._collection.size===0?null:{name:this.name,items:this.collection.serializeContext(t)}}destroy(){super.destroy(),this._app&&this._layer&&this._app.layers.remove(this._layer),this._layer&&this._layer.destroy(),this._collectionListeners.forEach(t=>{t()}),this._collectionListeners.splice(0),this._contextRemovedListener(),this._contextRemovedListener=()=>{},me(this._collection),this._collectionChanged.destroy(),this._app=null}}Gr.registerClass(De.className,De);const b1={layers:"layerClassRegistry",styles:"styleClassRegistry",maps:"mapClassRegistry",categories:"categoryClassRegistry"};class wo extends De{static get className(){return"AppBackedCategory"}constructor(t){t.classRegistryName=b1[t.collectionName];super(t);this._collectionName=t.collectionName}async _deserializeItem(t){if(!this._app)throw new Error("Cannot deserialize item before setting the vcApp");return this._collectionName==="viewPoints"?new oe(t):this._collectionName==="obliqueCollections"?new Ne(t):this._collectionName==="layers"?pa(this._app,t):this._collectionName==="maps"?ma(this._app,t):super._deserializeItem(t)}setApp(t){super.setApp(t),this.setCollection(this._app[this._collectionName])}serializeForContext(t){return null}}Gr.registerClass(wo.className,wo);function wu(){return Pt("CategoryCollection")}class xu extends Mi{constructor(t){super();this._app=t,this._cache=new Map,this._contextRemovedListener=this._app.contextRemoved.addEventListener(e=>{this._cache.forEach((s,r)=>{s.delete(e.id),s.size===0&&this._cache.delete(r)})})}add(t){if(this.hasKey(t.name))return null;t.setApp(this._app);const e=super.add(t);return e!=null&&this._cache.has(t.name)&&(this._cache.get(t.name).forEach((s,r)=>{this.parseCategoryItems(t.name,s,r)}),this._cache.delete(t.name)),e}remove(t){super.remove(t),this._cache.delete(t.name)}async parseCategoryItems(t,e,s){const r=this.getByKey(t);r?await r.collection.parseItems(e,s):this._cache.has(t)?this._cache.get(t).set(s,e):this._cache.set(t,new Map([[s,e]]))}async requestCategory(t){if(!t.name)return wu().error("Cannot request a category without a name"),null;t.type||(wu().warning(`Implicitly typing category ${t.name} as ${De.className}`),t.type=De.className);let e;if(this.hasKey(t.name))e=this.getByKey(t.name),e.mergeOptions(t);else if(e=await ge(this._app.categoryClassRegistry,t),e&&this.add(e)==null)return null;if(!e)throw new Error(`Category ${t.name} with type ${t.type} could not be created`);return e}destroy(){super.destroy(),this._contextRemovedListener(),this._cache.clear(),this._app=null}}const O1=Xt();class xo{constructor(t){this._config=t,this._checkSum=Kf(JSON.stringify(t),O1),this._id=t.id||this._checkSum}get id(){return this._id}get checkSum(){return this._checkSum}get config(){return JSON.parse(JSON.stringify(this._config))}}const bu=Symbol("isProvidedFeature"),Ou=Symbol("showProvidedFeature");class wi extends re{static get className(){return"AbstractFeatureProvider"}static getDefaultOptions(){return{vectorProperties:{allowPicking:!1},genericFeatureProperties:void 0,showGeometry:!1,mapTypes:[]}}constructor(t,e){super(e);const s=wi.getDefaultOptions();this.layerName=t,this.style=e.style?Bs(e.style,oi.clone()):void 0,this.showGeometry=rt(e.showGeometry,s.showGeometry),this.vectorProperties=e.vectorProperties instanceof te?e.vectorProperties:new te(_(_({},s.vectorProperties),e.vectorProperties)),this.genericFeatureProperties=e.genericFeatureProperties||s.genericFeatureProperties,this.mapTypes=Array.isArray(e.mapTypes)?e.mapTypes:s.mapTypes}isSupported(t){return t&&(this.mapTypes.length===0||this.mapTypes.includes(t.className))}getProviderFeature(t){return t.getId()||t.setId(Xt()),this.style&&t.setStyle(this.style.style),this.genericFeatureProperties&&t.setProperties(this.genericFeatureProperties),t[z]=this.layerName,t[bu]=!0,t[Ou]=this.showGeometry,Object.entries(this.vectorProperties.getValues()).forEach(([e,s])=>{const r=`olcs_${e}`;t.get(r)===void 0&&s!==void 0&&t.set(r,s)}),t}async getFeaturesByCoordinate(t,e){return[]}toJSON(){const t=super.toJSON(),e=wi.getDefaultOptions();delete t.name,this.showGeometry!==e.showGeometry&&(t.showGeometry=this.showGeometry),this.genericFeatureProperties&&(t.genericFeatureProperties=_({},this.genericFeatureProperties)),this.style&&(t.style=this.style.toJSON());const s=this.vectorProperties.getVcsMeta(_(_({},te.getDefaultOptions()),e.vectorProperties));return Object.keys(s).length>0&&(t.vectorProperties=s),t}destroy(){this.style=null,this.vectorProperties.destroy(),this.genericFeatureProperties=void 0,super.destroy()}}function P1(i,t){const e=i.getProperties();delete e[i.getGeometryName()];let{clickedPosition:s}=i;const r=i.getGeometry(),n=i.get("olcs_modelUrl");if(r&&(r.getType()==="Point"&&!n||s&&!s.exactPosition||!s&&r)){const l=In(r.getExtent());l&&(T.mercatorToWgs84(l,!0),s={longitude:l[0],latitude:l[1]})}let a=s.height;if(!n){const l=Fe.fromGeometry(r);a=Number.isFinite(l.maxZ)?l.maxZ:0}const o=!n&&i.get("olcs_altitudeMode")==="relativeToGround";return delete e.clickedPosition,{layerName:t.name,layerClass:t.className,attributes:e,longitude:s.longitude,latitude:s.latitude,height:a,relativeToGround:o}}class gn extends wi{static get className(){return"TileProviderFeatureProvider"}constructor(t,e){super(t,e);this.mapTypes=["CesiumMap"],this.tileProvider=e.tileProvider}async getFeaturesByCoordinate(t,e){return(await this.tileProvider.getFeaturesByCoordinate(t,e)).filter(r=>this.vectorProperties.getAllowPicking(r))}destroy(){this.tileProvider=void 0,super.destroy()}}Ar.registerClass(gn.className,gn);function er(i){const{location:t}=window,e=new URL(i,`${t.protocol}//${t.host}${t.pathname}`);return e.host?e.protocol===t.protocol&&e.host===t.host:!0}function bo(i){const t=i.tilingSchema==="geographic"?B:F,e=t.proj.getExtent(),s=Ln(e),r=i.tilingSchema==="geographic"?s/(i.tileSize[0]*2):s/i.tileSize[0],n=i.maxLevel+1,a=[];for(let h=0;h<n;++h)a.push(r/2**h);const o={origin:gr(e),resolutions:a,tileSize:i.tileSize,minZoom:i.minLevel};i.extent&&i.extent.isValid()&&(o.extent=i.extent.getCoordinatesInProjection(t));const l={url:i.url,tileGrid:new Bo(o),params:i.parameters};return er(i.url)||(l.crossOrigin="anonymous"),i.tilingSchema==="geographic"&&(i.version==="1.3.0"?l.projection="CRS:84":l.projection="EPSG:4326"),new wd(l)}const E1={GML:Nn,GML2:Tn,GML3:Nn},I1=["application/geojson","application/json","application/vnd.geo+json"];function Pu(i,t={}){return i==="text/xml"?(t.gmlFormat=t.gmlFormat?new E1[t.gmlFormat]:new Tn,new Yo(t)):I1.includes(i)?new Wo(t):i==="application/vnd.ogc.gml"?new Tn(t):i==="application/vnd.ogc.gml/3.1.1"?new Nn(t):null}class Ye extends wi{static get className(){return"WMSFeatureProvider"}static getDefaultOptions(){return O(_({},wi.getDefaultOptions()),{responseType:"text/xml",style:void 0,formatOptions:void 0,projection:void 0,url:"",tilingSchema:"geographic",version:"1.1.1",maxLevel:0,minLevel:0,tileSize:[256,256],parameters:{},extent:void 0})}constructor(t,e){super(t,e);const s=Ye.getDefaultOptions();this.extent=null,e.extent&&(e.extent instanceof pt?this.extent=e.extent:this.extent=new pt(e.extent)),this._wmsSourceOptions={url:e.url,tilingSchema:e.tilingSchema||s.tilingSchema,maxLevel:V(e.maxLevel,s.maxLevel),minLevel:V(e.minLevel,s.minLevel),tileSize:e.tileSize||s.tileSize,parameters:e.parameters,version:e.version||s.version},this.wmsSource=bo(this._wmsSourceOptions),this.featureInfoResponseType=e.responseType||s.responseType,this._formatOptions=e.formatOptions||s.formatOptions,this.featureFormat=Pu(this.featureInfoResponseType,e.formatOptions),this.projection=e.projection?new T(e.projection):void 0}featureResponseCallback(t,e){let s;try{s=this.featureFormat.readFeatures(t,{dataProjection:this.projection?this.projection.proj:void 0,featureProjection:F.proj})}catch{return this.getLogger().warning("Features could not be read, please verify the featureInfoResponseType with the capabilities from the server"),[]}return Array.isArray(s)?(s.forEach(r=>{r.getGeometry()||r.setGeometry(new xi(e))}),s):[]}async getFeaturesByCoordinate(t,e){const s=this.wmsSource.getProjection();let r=t;s&&(r=dt(F.proj,s)(t.slice(),void 0,void 0));const n=111194.87428468118,a=this.wmsSource.getFeatureInfoUrl(r,e/n,s,{INFO_FORMAT:this.featureInfoResponseType});if(a){let o;try{o=await ye(a)}catch{return this.getLogger().error(`Failed fetching WMS FeatureInfo ${a}`),[]}return this.featureResponseCallback(o,t).map(l=>this.getProviderFeature(l))}return[]}toJSON(){const t=super.toJSON(),e=Ye.getDefaultOptions();return this.featureInfoResponseType!==e.responseType&&(t.responseType=this.featureInfoResponseType),this._formatOptions!==e.formatOptions&&(t.formatOptions=_({},this._formatOptions)),this.projection!==e.projection&&(t.projection=this.projection.toJSON()),t.url=this._wmsSourceOptions.url,t.parameters=_({},this._wmsSourceOptions.parameters),this._wmsSourceOptions.tilingSchema!==e.tilingSchema&&(t.tilingSchema=this._wmsSourceOptions.tilingSchema),this._wmsSourceOptions.maxLevel!==e.maxLevel&&(t.maxLevel=this._wmsSourceOptions.maxLevel),this._wmsSourceOptions.minLevel!==e.minLevel&&(t.minLevel=this._wmsSourceOptions.minLevel),this._wmsSourceOptions.version!==e.version&&(t.version=this._wmsSourceOptions.version),(this._wmsSourceOptions.tileSize[0]!==e.tileSize[0]||this._wmsSourceOptions.tileSize[1]!==e.tileSize[1])&&(t.tileSize=this._wmsSourceOptions.tileSize.slice()),this.extent&&(t.extent=this.extent.toJSON()),t}destroy(){this.wmsSource=void 0,this.featureFormat=void 0,this.projection=void 0,this._formatOptions=void 0,super.destroy()}}Ar.registerClass(Ye.className,Ye);class vi{constructor(t=k.NONE,e=lt.NONE,s=mt.LEFT){this.id=Xt(),this._defaultActive=t,this.active=this._defaultActive,this._defaultModificationKey=e,this.modificationKey=this._defaultModificationKey,this._defaultPointerKey=s,this.pointerKey=this._defaultPointerKey}async pipe(t){return t}setActive(t){typeof t=="undefined"?(this.active=this._defaultActive,this.modificationKey=this._defaultModificationKey,this.pointerKey=this._defaultPointerKey):typeof t=="boolean"?this.active=t?this._defaultActive:k.NONE:this.active=t}setModification(t){t?this.modificationKey=t:this.modificationKey=this._defaultModificationKey}setPointer(t){t?this.pointerKey=t:this.pointerKey=this._defaultPointerKey}destroy(){}}class Sn extends vi{constructor(){super(k.ALL,lt.ALL);this._scratchCartographic=new et,this._scratchCartesian=new C,this.setActive()}async pipe(t){return t.map.className==="CesiumMap"?this._cesiumHandler(t):t.map.className==="ObliqueMap"?Sn.obliqueHandler(t):t}_cesiumHandler(t){const s=t.map.getScene();t.ray=s.camera.getPickRay(t.windowPosition);const r=s.globe.pick(t.ray,s,this._scratchCartesian);return r?(this._scratchCartographic=et.fromCartesian(r,s.globe.ellipsoid,this._scratchCartographic),t.position=T.wgs84ToMercator([P.toDegrees(this._scratchCartographic.longitude),P.toDegrees(this._scratchCartographic.latitude),this._scratchCartographic.height],!0)):t.position=[0,0,0],t.positionOrPixel=t.position,Promise.resolve(t)}static obliqueHandler(t){const s=t.map.currentImage;if(s){const r=t.type&(k.MOVE^k.DRAGEVENTS),n=t.position.slice(0,2);if(Number.isFinite(n[0])&&Number.isFinite(n[1]))return Ki(s,n,{dontUseTerrain:!!r,dataProjection:F}).then(a=>(t.obliqueParameters={pixel:n},t.position=a.coords,t.obliqueParameters.estimate=a.estimate,t))}return t.stopPropagation=!0,Promise.resolve(t)}}class Eu extends vi{constructor(t){super(k.ALL,lt.ALL,mt.ALL);this.chain=t||[],this.setActive()}addInteraction(t,e){e!=null?this.chain.splice(e,0,t):this.chain.push(t)}removeInteraction(t){const e=this.chain.findIndex(s=>s.id===t.id);return e>-1&&this.chain.splice(e,1),e}async pipe(t){let e=t;const s=this.chain.length;for(let r=0;r<s;r++){const n=this.chain[r];if(n.active&t.type&&n.modificationKey&t.key&&n.pointerKey&t.pointer&&(e=await n.pipe(e),e.stopPropagation))break}return e}setModification(){super.setModification()}setPointer(){super.setPointer()}destroy(){this.chain.forEach(t=>{t.destroy()}),this.chain=[],super.destroy()}}class Iu extends vi{constructor(){super(k.ALL^k.MOVE,lt.ALL);this._pickPosition=k.CLICK,this._pickPositionMask=-1,this.pickTranslucent=!0,this.pullPickedPosition=0,this.hitTolerance=10,this._draggingFeature=null,this.setActive()}get pickPosition(){return this._pickPosition}set pickPosition(t){this._pickPosition=t&this._pickPositionMask}get excludedPickPositionEvents(){return~this._pickPositionMask}set excludedPickPositionEvents(t){this._pickPositionMask=~t}async pipe(t){return t.type&k.DRAG&&!(this._pickPosition&k.DRAG)?(this._draggingFeature&&(t.feature=this._draggingFeature),t):(t.type&k.DRAGEND&&(this._draggingFeature=null),t.map.className==="OpenlayersMap"?await this._openlayersHandler(t):t.map.className==="ObliqueMap"?await this._obliqueHandler(t):t.map.className==="CesiumMap"&&await this._cesiumHandler(t),t.type&k.DRAGSTART&&t.feature&&(this._draggingFeature=t.feature),t.type&k.DRAG&&this._draggingFeature&&(t.feature=this._draggingFeature),t)}setActive(t){typeof t=="undefined"&&(this.pickPosition=k.CLICK,this.pullPickedPosition=0),super.setActive(t)}_openlayersHandler(t){let e=null,s=null;return t.map.olMap.forEachFeatureAtPixel([t.windowPosition.x,t.windowPosition.y],(r,n)=>(r&&(r.get("olcs_allowPicking")==null||r.get("olcs_allowPicking")===!0)&&(e=r,s=n),!0),{hitTolerance:this.hitTolerance}),e&&s&&(t.feature=e,e.get("features")&&(t.feature[z]=s[z]),t.exactPosition=!0),Promise.resolve(t)}_obliqueHandler(t){let e=null,s=null;return t.map.olMap.forEachFeatureAtPixel([t.windowPosition.x,t.windowPosition.y],(r,n)=>(r&&(e=r[Be]||r),s=n,!0),{hitTolerance:this.hitTolerance}),e&&s&&(t.feature=e,e.get("features")&&(t.feature[z]=s[z]),t.exactPosition=!0),Promise.resolve(t)}_cesiumHandler(t){const e=t.map,s=e.getScene(),r=s.pick(t.windowPosition,this.hitTolerance,this.hitTolerance);let n=new et,a=new C,o=new C;const{pickTranslucentDepth:l}=s,h=()=>a?(this.pullPickedPosition&&t.ray&&(o=C.multiplyByScalar(t.ray.direction,this.pullPickedPosition,o),a=C.subtract(a,o,a)),n=et.fromCartesian(a,s.globe.ellipsoid,n),t.position=T.wgs84ToMercator([P.toDegrees(n.longitude),P.toDegrees(n.latitude),n.height],!0),t.positionOrPixel=t.position,s.pickTranslucentDepth=l,Promise.resolve(t)):(a=new C,Promise.resolve(t));if(r){if(r.primitive&&r.primitive.olFeature)t.feature=r.primitive.olFeature;else if(r.primitive&&r.primitive[z]&&(r instanceof Ge||r instanceof Ae)){t.feature=r;const c=Object.getOwnPropertySymbols(r.primitive),u=c.length;for(let d=0;d<u;d++)t.feature[c[d]]=r.primitive[c[d]]}else r.id&&r.id.olFeature?t.feature=r.id.olFeature:r.id&&r.id[z]?(t.feature=r,t.feature[z]=r.id[z]):t.feature=r;if(!(t.type&this.pickPosition))return Promise.resolve(t);if(s.pickPositionSupported)return r.primitive&&this.pickTranslucent&&!(r.primitive.pointCloudShading&&r.primitive.pointCloudShading.attenuation)&&(s.pickTranslucentDepth=!0,s.render(e.getCesiumWidget().clock.currentTime),t.exactPosition=!0),a=s.pickPosition(t.windowPosition,a),h()}return Promise.resolve(t)}}class Lu extends vi{constructor(){super(k.CLICK,lt.ALL);this.setActive()}async pipe(t){if(!t.feature){const e=[...t.map.layerCollection].filter(s=>s.featureProvider&&s.active&&s.isSupported(t.map)&&s.featureProvider.isSupported(t.map));if(e.length>0){const s=t.map.getCurrentResolution(t.position),r=(await Promise.all(e.map(n=>n.featureProvider.getFeaturesByCoordinate(t.position,s)))).flat();r.length>0&&(t.feature=r[0])}}return t}}function L1(){return Pt("EventHandler")}class Tu{constructor(){this._positionInteraction=new Sn,this._featureInteraction=new Iu,this._featureProviderInteraction=new Lu,this._interactionChain=new Eu([this._positionInteraction,this._featureInteraction,this._featureProviderInteraction]),this.clickDuration=400,this.dragDuration=100,this._lastDown=null,this._lastClick={time:null,windowPosition:new Ht},this._dragging=null,this._running=!1,this._eventQueue=[],this._exclusiveInteraction=null,this._multiples=!1,this.exclusiveRemoved=new R,this.exclusiveAdded=new R}get positionInteraction(){return this._positionInteraction}get featureInteraction(){return this._featureInteraction}get featureProviderInteraction(){return this._featureProviderInteraction}get interactions(){return this._interactionChain.chain.slice()}addExclusiveInteraction(t,e,s=3,r){return v(t,vi),v(e,Function),v(s,Number),it(r,String),this._exclusiveInteraction&&this._exclusiveInteraction.id!==r&&this.removeExclusive(),this._interactionChain.addInteraction(t,s),this._exclusiveInteraction?(this._exclusiveInteraction.interactions.push(t),this._exclusiveInteraction.cb.push(e)):this._exclusiveInteraction={id:r||Xt(),cb:[e],interactions:[t]},this.exclusiveAdded.raiseEvent(),this._exclusiveUnListen.bind(this,t,this._exclusiveInteraction.id)}removeExclusive(){this._exclusiveInteraction&&(this._exclusiveInteraction.interactions.filter(t=>t).forEach(t=>{this._interactionChain.removeInteraction(t)}),this._exclusiveInteraction.cb.filter(t=>t).forEach(t=>{t()}),this._exclusiveInteraction=null,this.exclusiveRemoved.raiseEvent())}_exclusiveUnListen(t,e){if(!this._exclusiveInteraction||this._exclusiveInteraction&&this._exclusiveInteraction.id!==e)return 0;const s=this._interactionChain.removeInteraction(t),r=this._exclusiveInteraction.interactions.findIndex(n=>n&&n.id===t.id);return r>-1&&(this._exclusiveInteraction.interactions.splice(r,1,void 0),this._exclusiveInteraction.cb.splice(r,1,void 0)),this._exclusiveInteraction.interactions.every(n=>n===void 0)&&(this._exclusiveInteraction=null),s>-1&&this.exclusiveRemoved.raiseEvent(),s!==-1?1:0}addPersistentInteraction(t,e=3){return v(t,vi),v(e,Number),this._interactionChain.addInteraction(t,e),()=>this._interactionChain.removeInteraction(t)!==-1?1:0}handleMapEvent(t){t.pointerEvent===zt.MOVE?this._mouseMove(t):t.pointerEvent===zt.DOWN?this._mouseDown(t):t.pointerEvent===zt.UP&&this._mouseUp(t)}_mouseDown(t){if(this._lastDown){this._multiples=!0;return}t.windowPosition.x===0&&t.windowPosition.y===0||(this._lastDown=t,this._lastDown.time=Date.now())}_mouseUp(t){if(t.multipleTouch){this._multiples=!0,this._lastDown=null;return}if(this._multiples){this._lastDown=null,this._multiples=!1;return}const e=t;this._dragging?(e.type=k.DRAGEND,e.key=this._dragging.key,e.pointer=this._dragging.pointer,this._startChain(e)):this._lastDown&&(this._lastClick.time&&Date.now()-this._lastClick.time<this.clickDuration&&Ht.distanceSquared(this._lastClick.windowPosition,e.windowPosition)<12?(this._lastClick.time=null,e.type=k.DBLCLICK):(this._lastClick.time=Date.now(),Ht.clone(e.windowPosition,this._lastClick.windowPosition),e.type=k.CLICK),this._startChain(e)),this._dragging=null,this._lastDown=null}_mouseMove(t){let e=t;this._lastDown?this._dragging?(e.type=k.DRAG,e.key=this._dragging.key,e.pointer=this._dragging.pointer,this._startChain(e,!0)):!this._dragging&&Date.now()-this._lastDown.time>this.dragDuration&&(e=_({type:k.DRAGSTART},this._lastDown),this._dragging=e,this._startChain(e,!0)):(e.type=k.MOVE,this._startChain(e,!0))}_startChain(t,e){this._running&&e||(this._running?this._eventQueue.push(t):(this._running=!0,this._interactionChain.pipe(t).then(this._endChain.bind(this)).catch(s=>{L1().error(s.message),this._endChain()})))}_endChain(){this._running=!1,this._eventQueue.length>0&&this._startChain(this._eventQueue.shift())}destroy(){this.removeExclusive(),this.exclusiveAdded.destroy(),this.exclusiveRemoved.destroy(),this._interactionChain.destroy(),this._interactionChain=null,this._positionInteraction.destroy(),this._positionInteraction=null,this._featureInteraction.destroy(),this._featureInteraction=null,this._eventQueue=[]}}const qe=Symbol("cesiumTilesetLastUpdated");function Oo(i){if(!i.ready)return Xo();const{rectangle:t}=i.root.boundingVolume;if(t){const o=Ut.southwest(t),l=Ut.northeast(t),h=T.wgs84ToMercator([P.toDegrees(o.longitude),P.toDegrees(o.latitude)]),c=T.wgs84ToMercator([P.toDegrees(l.longitude),P.toDegrees(l.latitude)]);return[h[0],h[1],c[0],c[1]]}const{center:e,radius:s}=i.boundingSphere,r=et.fromCartesian(e),n=T.wgs84ToMercator([P.toDegrees(r.longitude),P.toDegrees(r.latitude),r.height]);return Va(n,s).getExtent()}class We extends Ue{static get className(){return"CesiumTilesetCesiumImpl"}constructor(t,e){super(t,e);this.cesium3DTileset=null,this.tilesetOptions=e.tilesetOptions,this.splitDirection=e.splitDirection,this.style=e.style,this.featureVisibility=e.featureVisibility,this.globalHider=e.globalHider,this.tilesetProperties=e.tilesetProperties,this.modelMatrix=e.modelMatrix,this.offset=e.offset,this._initializedPromise=null,this._originalOrigin=null,this._styleLastUpdated=Date.now()}async initialize(){this._initializedPromise||(this.cesium3DTileset=new Ms(this.tilesetOptions),this.tilesetProperties&&this.tilesetProperties.forEach(({key:t,value:e})=>{this.cesium3DTileset[t]=e}),this.cesium3DTileset[z]=this.name,this.cesium3DTileset.tileVisible.addEventListener(this.applyStyle.bind(this)),this.cesium3DTileset.tileUnload.addEventListener(t=>{delete t[qe]}),this._initializedPromise=this.cesium3DTileset.readyPromise,await this._initializedPromise,this._originalOrigin=C.clone(this.cesium3DTileset.boundingSphere.center),this.modelMatrix?this.cesium3DTileset.modelMatrix=this.modelMatrix:this.offset&&this._calculateOffset(),this.map.addPrimitiveCollection(this.cesium3DTileset),await super.initialize(),this.splitDirection&&this.updateSplitDirection(this.splitDirection),this.updateStyle(this.style)),await this._initializedPromise}_calculateOffset(){if(this.cesium3DTileset&&!this.modelMatrix)if(!this.offset)this.cesium3DTileset.modelMatrix=A.IDENTITY;else{const t=et.fromCartesian(this._originalOrigin);t.longitude+=P.toRadians(this.offset[0]),t.latitude+=P.toRadians(this.offset[1]),t.height+=this.offset[2];const e=et.toCartesian(t),s=C.subtract(e,this._originalOrigin,e);this.cesium3DTileset.modelMatrix=A.fromTranslation(s)}}updateModelMatrix(t){this.modelMatrix=t,this.cesium3DTileset&&(this.modelMatrix?this.cesium3DTileset.modelMatrix=t:this.offset?this._calculateOffset():this.cesium3DTileset.modelMatrix=A.IDENTITY)}updateOffset(t){this.offset=t,this._calculateOffset()}async activate(){await super.activate(),this.active&&(this.cesium3DTileset.show=!0)}deactivate(){super.deactivate(),this.cesium3DTileset&&(this.cesium3DTileset.show=!1)}updateStyle(t,e){this.style=t,this.initialized&&(this.cesium3DTileset.style=this.style.cesiumStyle,this._onStyleChangeRemover&&this._onStyleChangeRemover(),this._onStyleChangeRemover=this.style.styleChanged.addEventListener(()=>{this.cesium3DTileset.makeStyleDirty(),this._styleLastUpdated=Date.now()}),this._styleLastUpdated=Date.now(),this.cesium3DTileset.readyPromise.then(()=>{this.cesium3DTileset.colorBlendMode!==this.style.colorBlendMode&&(this.style.colorBlendMode!==mr.HIGHLIGHT?this.cesium3DTileset.extras&&this.cesium3DTileset.extras._3DTILESDIFFUSE&&(this.cesium3DTileset.colorBlendMode=this.style.colorBlendMode):this.cesium3DTileset.colorBlendMode=this.style.colorBlendMode)}))}updateSplitDirection(t){const{splitScreen:e}=this.map;if(e){const s=e.getClippingObjectForDirection(this.splitDirection);s&&s.removeLayer(this.name),this.splitDirection=t;const r=e.getClippingObjectForDirection(this.splitDirection);r&&r.addLayer(this.name)}}applyStyle(t){if(t.content instanceof xf)for(let e=0;e<t.content.innerContents.length;e++)this.styleContent(t.content.innerContents[e]);else this.styleContent(t.content)}styleContent(t){if(!t[qe]||t[qe]<this.featureVisibility.lastUpdated||t[qe]<this.globalHider.lastUpdated||t[qe]<this._styleLastUpdated){const e=t.featuresLength;for(let s=0;s<e;s++){const r=t.getFeature(s);if(r){let n=r.getProperty("id");n||(n=`${t.url}${s}`),this.featureVisibility.highlightedObjects[n]&&!this.featureVisibility.hasHighlightFeature(n,r)&&this.featureVisibility.addHighlightFeature(n,r),this.featureVisibility.hiddenObjects[n]&&!this.featureVisibility.hasHiddenFeature(n,r)&&this.featureVisibility.addHiddenFeature(n,r),this.globalHider.hiddenObjects[n]&&!this.globalHider.hasFeature(n,r)&&this.globalHider.addFeature(n,r),this._styleLastUpdated>t[qe]&&r[pe]&&Oa(r)}}t[qe]=Date.now()}}destroy(){if(this.cesium3DTileset){if(this.map.initialized){const t=this.cesium3DTileset;this.map.removePrimitiveCollection(t)}else this.cesium3DTileset.destroy();this.cesium3DTileset=null}if(this._onStyleChangeRemover&&this._onStyleChangeRemover(),this.splitDirection&&this.map.splitScreen){const t=this.map.splitScreen.getClippingObjectForDirection(this.splitDirection);t&&t.removeLayer(this.name)}super.destroy()}}class T1{constructor(t){this.entities=t.entities,this.featureToBillboardMap=new Map,this.featureToLabelMap=new Map}addPrimitives(t,e,s){}addBillboards(t,e,s){Xi(t.map(r=>({billboard:r,position:r.position})),e,s,this.entities,this.featureToBillboardMap)}addLabels(t,e,s){Xi(t.map(r=>({label:r,position:r.position})),e,s,this.entities,this.featureToLabelMap)}removeFeature(t){Yi(t,this.featureToBillboardMap,this.entities),Yi(t,this.featureToLabelMap,this.entities)}createFeatureCache(t){const e={};return e.billboards=this.featureToBillboardMap.get(t),this.featureToBillboardMap.delete(t),e.labels=this.featureToLabelMap.get(t),this.featureToLabelMap.delete(t),e}clearFeatureCache(t){mi(this.entities,t.billboards),mi(this.entities,t.labels)}clear(){this.entities.removeAll(),this.featureToBillboardMap.clear(),this.featureToLabelMap.clear()}}function N1(i,t){return i.values.forEach(e=>{t.add(e)}),i.collectionChanged.addEventListener((e,s,r)=>{s.forEach(n=>{t.add(n)}),r.forEach(n=>{t.remove(n)})})}class Nu extends Ue{static get className(){return"DataSourceCesiumImpl"}constructor(t,e){super(t,e);this.dataSource=new ll(this.name),this.dataSource[z]=this.name,this.entities=e.entities,this.clock=e.clock,this._collectionListener=()=>{}}async initialize(){this.initialized||(this._collectionListener=N1(this.entities,this.dataSource.entities),await this.map.addDataSource(this.dataSource)),await super.initialize()}async activate(){await super.activate(),this.active&&(this.dataSource.show=!0),this.clock&&this.map.setDataSourceDisplayClock(this.clock)}deactivate(){super.deactivate(),this.dataSource.show=!1,this.clock&&this.map.unsetDataSourceDisplayClock(this.clock)}flyToEntity(t){if(this.active){const e=this.dataSource.entities.getById(t);if(!e){this.getLogger().warning("could not find entity on this layer");return}const s=this.map.getDataSourceDisplay(),r=this.map.getScene(),{camera:n}=r,a=new hl,o=this.map.getViewPointSync(),{heading:l,pitch:h}=o,c=new bf(P.toRadians(l),P.toRadians(h<-45?h:-45),void 0);let u,d=0;const f=()=>{const m=s.getBoundingSphere(e,!0,a);if(m!==cl.PENDING){if(m===cl.FAILED){d+=1,d>3&&u();return}n.flyToBoundingSphere(a,{duration:1,offset:c}),u()}},g=s.defaultDataSource;if(g.isLoading){const m=g.loadingEvent.addEventListener(()=>{u=r.postRender.addEventListener(f),m()})}else u=r.postRender.addEventListener(f)}}destroy(){this.map.initialized&&!this.isDestroyed&&this.map.removeDataSource(this.dataSource),this._collectionListener(),this.dataSource.entities.removeAll(),this.clock&&this.map.unsetDataSourceDisplayClock(this.clock),super.destroy()}}class _i extends Ue{static get className(){return"RasterLayerCesiumImpl"}constructor(t,e){super(t,e);this.cesiumLayer=null,this.splitDirection=e.splitDirection,this.minLevel=e.minLevel,this.maxLevel=e.maxLevel,this.tilingSchema=e.tilingSchema,this.extent=e.extent,this.opacity=e.opacity}initialize(){return this.initialized||(this.cesiumLayer=this.getCesiumLayer(),this.cesiumLayer[z]=this.name,this.cesiumLayer.show=!1,this.map.addImageryLayer(this.cesiumLayer)),super.initialize()}updateSplitDirection(t){this.splitDirection=t,this.initialized&&(this.cesiumLayer.splitDirection=t)}getCesiumLayer(){throw new Error("implementation error")}async activate(){await super.activate(),this.active&&(this.cesiumLayer.show=!0)}deactivate(){super.deactivate(),this.cesiumLayer&&(this.cesiumLayer.show=!1)}updateOpacity(t){this.opacity=t,this.initialized&&this.cesiumLayer&&(this.cesiumLayer.alpha=t)}destroy(){this.cesiumLayer&&this.map.removeImageryLayer(this.cesiumLayer),this.cesiumLayer=null,super.destroy()}}class Du extends _i{static get className(){return"OpenStreetMapCesiumImpl"}getCesiumLayer(){return new Je(new Of({maximumLevel:this.maxLevel}),{alpha:this.opacity,splitDirection:this.splitDirection})}}class Fu extends _i{static get className(){return"SingleImageCesiumImpl"}constructor(t,e){super(t,e);this.credit=e.credit}getCesiumLayer(){const t={url:this.url,credit:this.credit},e=this.extent.getCoordinatesInProjection(B);e&&(t.rectangle=Ut.fromDegrees(e[0],e[1],e[2],e[3]));const s=new Pf(t),r={rectangle:t.rectangle,alpha:this.opacity,defaultAlpha:1,splitDirection:this.splitDirection};return new Je(s,r)}}class Ru extends Ue{static get className(){return"TerrainCesiumImpl"}constructor(t,e){super(t,e);this.requestVertexNormals=e.requestVertexNormals,this.requestWaterMask=e.requestWaterMask}initialize(){return this.initialized||(this.terrainProvider=Ji({url:this.url,requestVertexNormals:this.requestVertexNormals,requestWaterMask:this.requestWaterMask}),this.terrainProvider[z]=this.name),super.initialize()}async activate(){await super.activate(),this.active&&this.map.setTerrainProvider(this.terrainProvider)}deactivate(){super.deactivate(),this.terrainProvider&&this.map.unsetTerrainProvider(this.terrainProvider)}destroy(){this.terrainProvider=null,super.destroy()}}const Le={GEOGRAPHIC:"geographic",MERCATOR:"mercator"};function Po(i){const t={};return i.numberOfLevelZeroTilesX&&i.numberOfLevelZeroTilesX>1&&(t.numberOfLevelZeroTilesX=i.numberOfLevelZeroTilesX),i.numberOfLevelZeroTilesY&&i.numberOfLevelZeroTilesY>1&&(t.numberOfLevelZeroTilesY=i.numberOfLevelZeroTilesY),i.tilingSchema===Le.MERCATOR?new Bn(t):new ul(t)}function Au(i,t,e,s=0){if(!i.isValid())return s;const r=i.getCoordinatesInProjection(B);r[1]<-85&&(r[1]=-85),r[3]>85&&(r[3]=85);const a=[On(r),$o(r),Ho(r),gr(r)].map(l=>et.fromDegrees(l[0],l[1]));let o=s;for(;o<e;){const l=a.map(c=>t.positionToTileXY(c,o)),h=[];if(h.push(Math.abs(l[0].x-l[1].x)),h.push(Math.abs(l[0].y-l[3].y)),h[0]>1||h[1]>1){o-=1;break}o+=1}return o}class jt extends ht{static get className(){return"RasterLayer"}static getDefaultOptions(){return O(_({},ht.getDefaultOptions()),{minLevel:0,maxLevel:18,tilingSchema:Le.GEOGRAPHIC,opacity:1,splitDirection:void 0})}constructor(t){t.url=t.url||"";super(t);const e=jt.getDefaultOptions();this.extent=this.extent||new pt,this.tilingSchema=Kn(t.tilingSchema,Le,e.tilingSchema),this.maxLevel=V(t.maxLevel,e.maxLevel),this._minLevel=V(t.minLevel,e.minLevel);const s=Po(t);this.minLevel=Au(this.extent,s,this.maxLevel,this._minLevel),this._opacity=Sr(t.opacity,e.opacity,0,1),this._splitDirection=X.NONE,t.splitDirection&&(this._splitDirection=t.splitDirection==="left"?X.LEFT:X.RIGHT),this.splitDirectionChanged=new R}get splitDirection(){return this._splitDirection}set splitDirection(t){t!==this._splitDirection&&(this._splitDirection=t,this.getImplementations().forEach(e=>{e.updateSplitDirection(t)}),this.splitDirectionChanged.raiseEvent(this._splitDirection))}get opacity(){return this._opacity}set opacity(t){const e=Sr(t,this._opacity,0,1);this._opacity!==e&&(this._opacity=e,this.getImplementations().forEach(s=>{s.updateOpacity(e)}))}getImplementationOptions(){const t=O(_({},super.getImplementationOptions()),{minLevel:this.minLevel,maxLevel:this.maxLevel,tilingSchema:this.tilingSchema,opacity:this.opacity,splitDirection:this._splitDirection});return this.extent.isValid()&&(t.extent=this.extent),t}toJSON(){const t=super.toJSON(),e=jt.getDefaultOptions();return this.extent.equals(new pt)&&delete t.extent,this._minLevel!==e.minLevel&&(t.minLevel=this._minLevel),this.maxLevel!==e.maxLevel&&(t.maxLevel=this.maxLevel),this.tilingSchema!==e.tilingSchema&&(t.tilingSchema=this.tilingSchema),this.opacity!==e.opacity&&(t.opacity=this.opacity),this._splitDirection!==X.NONE&&(t.splitDirection=this._splitDirection===X.RIGHT?"right":"left"),t}destroy(){this.splitDirectionChanged.destroy(),super.destroy()}}ot.registerClass(jt.className,jt);class Gu extends _i{static get className(){return"TmsCesiumImpl"}constructor(t,e){super(t,e);this.format=e.format}getCesiumLayer(){const t={url:this.url,fileExtension:this.format,maximumLevel:this.maxLevel,minimumLevel:this.minLevel,show:!1};if(this.extent&&this.extent.isValid()){const r=this.extent.getCoordinatesInProjection(B);t.rectangle=Ut.fromDegrees(r[0],r[1],r[2],r[3])}this.tilingSchema===Le.GEOGRAPHIC&&(t.tilingScheme=new ul);const e=new Ef(t),s={alpha:this.opacity,splitDirection:this.splitDirection};return new Je(e,s)}}const ir=new Array(25);for(let i=0;i<ir.length;i++)ir[i]=200375083427892e-7*2/256/2**(i+1);function mn(i){const t=Ut.southwest(i),e=Ut.northeast(i),s=[P.toDegrees(t.longitude),P.toDegrees(t.latitude)],r=[P.toDegrees(e.longitude),P.toDegrees(e.latitude)],n=ks(s),a=ks(r);return[...n,...a]}class Wt extends re{static get className(){return"TileProvider"}static getDefaultOptions(){return{tileCacheSize:50,baseLevels:[15],trackFeaturesToTiles:!0,allowTileAggregation:!0}}constructor(t){super(t);const e=Wt.getDefaultOptions();this.tilingScheme=new Bn,this._tileCacheSize=V(t.tileCacheSize,e.tileCacheSize);const s=Array.isArray(t.baseLevels)?t.baseLevels.slice():e.baseLevels.slice();s.sort((r,n)=>n-r),this.baseLevels=[...new Set(s)],this.cache=new Map,this.baseLevels.forEach(r=>{this.cache.set(r,new xd(this.tileCacheSize))}),this.rtreeCache=new Map,this.trackFeaturesToTiles=rt(t.trackFeaturesToTiles,e.trackFeaturesToTiles),this.allowTileAggregation=rt(t.allowTileAggregation,e.allowTileAggregation),this.featureIdToTileIds=new Map,this.tileLoadedEvent=new R}get tileCacheSize(){return this._tileCacheSize}setTileCacheSize(t){const e=[];return this._tileCacheSize=t,this.cache.forEach((s,r)=>{for(s.setSize(this._tileCacheSize);s.canExpireCache();)e.push(this._removeLastTileFromCache(r))}),Promise.all(e)}_trackFeatures(t,e){this.trackFeaturesToTiles&&t.forEach(s=>{const r=s.getId();r&&(this.featureIdToTileIds.has(String(r))||this.featureIdToTileIds.set(String(r),new Set),this.featureIdToTileIds.get(String(r)).add(e))})}_unTrackFeatures(t,e){this.trackFeaturesToTiles&&t.forEach(s=>{const r=s.getId();if(r&&this.featureIdToTileIds.has(String(r))){const n=this.featureIdToTileIds.get(String(r));n.delete(e),n.size===0&&this.featureIdToTileIds.delete(String(r))}})}_addTilePromiseToCache(t,e,s){const r=t.then(n=>{n.forEach(o=>{o.getId()||o.setId(Xt())});const a=new mo(n.length);return a.load(n.map(o=>{const l=o.getGeometry();if(l){const h=l.getExtent();return{minX:h[0],minY:h[1],maxX:h[2],maxY:h[3],value:o}}return null}).filter(o=>o)),this.tileLoadedEvent.raiseEvent({tileId:s,rtree:a}),this._trackFeatures(n,s),this.rtreeCache.set(s,a),a}).catch(()=>{this.getLogger().warning(`Could not load Tile ${s}`);const n=new mo;return this.rtreeCache.set(s,n),n});return this.cache.get(e).set(s,r),this.cache.get(e).canExpireCache()?Promise.all([r,this._removeLastTileFromCache(e)]):r}_removeLastTileFromCache(t){const e=this.cache.get(t).peekLastKey(),s=this.cache.get(t).pop();if(s)return s.then(r=>{r&&(this.rtreeCache.delete(e),setTimeout(()=>{this._unTrackFeatures(r.all().map(n=>n.value),e),r.clear()},0))})}getBaseLevelForResolution(t,e){const s=t/Math.cos(e);let r=0;for(let a=0;a<ir.length&&(r=a,!(s>=ir[a]));a++);const n=this.getBaseLevel(r);return n===void 0?this.baseLevels[this.baseLevels.length-1]:n}getBaseLevel(t){return this.baseLevels.find(e=>t>=e)}getCacheKey(t,e,s){return`${s}/${t}/${e}`}async _getRtreeForBaseTile(t,e){const s=this.tilingScheme.positionToTileXY(e,t),r=this.getCacheKey(s.x,s.y,t);if(this.cache.has(t)){if(!this.cache.get(t).containsKey(r)){const n=this.loader(s.x,s.y,t);this._addTilePromiseToCache(n,t,r)}return this.cache.get(t).get(r)}return null}async getFeaturesByCoordinate(t,e){const s=bd(t);Uo(s,e,s);const r=ca(t),n=et.fromDegrees(r[0],r[1]),a=this.getBaseLevelForResolution(e,n.latitude),o=await this._getRtreeForBaseTile(a,n);return o?o.search({minX:s[0],minY:s[1],maxX:s[2],maxY:s[3]}).map(h=>h.value):[]}async getFeaturesForTile(t,e,s){const r=this.tilingScheme.tileXYToRectangle(t,e,s),n=Ut.center(r),a=this.getBaseLevel(s);if(a!=null){const o=await this._getRtreeForBaseTile(a,n);if(o){if(s===a)return o.all().map(l=>l.value);{const l=mn(r);return o.search({minX:l[0],minY:l[1],maxX:l[2],maxY:l[3]}).map(c=>c.value)}}}else if(this.allowTileAggregation&&this.baseLevels[this.baseLevels.length-1]-s<=2){const o=s+1,l=t*2,h=e*2;return[...await this.getFeaturesForTile(l,h,o),...await this.getFeaturesForTile(l+1,h,o),...await this.getFeaturesForTile(l+1,h+1,o),...await this.getFeaturesForTile(l,h+1,o)]}return[]}async getFeaturesForExtent(t,e){let s=e!=null?e:this.baseLevels[0];s=this.getBaseLevel(s);const[r,n,a,o]=t.getCoordinatesInProjection(B),l=this.tilingScheme.positionToTileXY(et.fromDegrees(r,o),s),h=this.tilingScheme.positionToTileXY(et.fromDegrees(a,n),s),c=[];for(let{x:f}=l;f<=h.x;f++)for(let{y:g}=l;g<=h.y;g++)c.push([f,g]);const u=await Promise.all(c.map(([f,g])=>this.getFeaturesForTile(f,g,s))),d=t.getCoordinatesInProjection(F);return u.flat().filter(f=>{const g=f.getGeometry();return g&&g.intersectsExtent(d)})}forEachFeature(t){this.rtreeCache.forEach(e=>{e.all().map(s=>s.value).forEach(t)})}async loader(t,e,s){return[]}toJSON(){const t=super.toJSON(),e=Wt.getDefaultOptions();return e.tileCacheSize!==this.tileCacheSize&&(t.tileCacheSize=this.tileCacheSize),this.baseLevels.length===e.baseLevels.length&&this.baseLevels.every(s=>e.baseLevels.includes(s))||(t.baseLevels=this.baseLevels.slice()),e.trackFeaturesToTiles!==this.trackFeaturesToTiles&&(t.trackFeaturesToTiles=this.trackFeaturesToTiles),e.allowTileAggregation!==this.allowTileAggregation&&(t.allowTileAggregation=this.allowTileAggregation),t}async clearCache(){const t=[];this.cache.forEach(e=>{e.forEach(s=>{t.push(s)}),e.clear()}),await Promise.all(t),this.rtreeCache.forEach(e=>{e.clear()}),this.rtreeCache.clear(),this.featureIdToTileIds.clear()}destroy(){super.destroy(),this.clearCache(),this.cache.clear(),this.isDestroyed=!0,this.tileLoadedEvent.destroy()}}si.registerClass(Wt.className,Wt);class D1 extends Od{constructor(t,e,s,r,n,a,o,l=1){super(t,e,s,r,n,a,o);this.scaleY=l,this.scaledImageScale_=[0,0],this.scaledTextScale_=[0,0]}get imageScale_(){return this.scaledImageScale_}set imageScale_(t){const e=t||[1,1];this.scaledImageScale_=[e[0],e[1]*this.scaleY]}get textScale_(){return this.scaledTextScale_}set textScale_(t){const e=t||[1,1];this.scaledTextScale_=[e[0],e[1]*this.scaleY]}moveToLineTo_(t,e,s,r,n){const a=this.context_,o=Pd(t,e,s,r,this.transform_,this.pixelCoordinates_);a.moveTo(o[0],o[1]);const{length:l}=o;for(let h=2;h<l;h+=2)a.lineTo(o[h],o[h+1]);return n&&a.closePath(),s}drawCircle(t){if(!!Ed(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=Id(t,this.transform_,this.pixelCoordinates_),s=e[2]-e[0],r=e[3]-e[1],n=Math.sqrt(s*s+r*r),a=this.context_;a.beginPath(),a.ellipse(e[0],e[1],n,n*this.scaleY,0,0,2*Math.PI),this.fillState_&&a.fill(),this.strokeState_&&a.stroke()}this.text_!==""&&this.drawText_(t.getCenter(),0,2,2)}}}function ku(i,t,e,s){const{canvas:r}=e;r.width=s[0],r.height=s[1],r.style.width=`${s[0]}px`,r.style.height=`${s[1]}px`;const n=(i[2]-i[0])/(i[3]-i[1]),a=1/((i[2]-i[0])/256),o=-1/((i[3]-i[1])/256),l=Ld(Td(),1,1),h=Nd(l,128,128,a,o,0,-t[0],-t[1]);return new D1(e,1,i,h,0,null,null,n)}function zu(i,t,e,s){const r=document.createElement("canvas");r.width=s[0],r.height=s[0];const n=ks([P.toDegrees(e.longitude),P.toDegrees(e.latitude)]),a=ku(t,n,r.getContext("2d"),s);return i.forEach(o=>{o.getStyleFunction()(o,1).forEach(c=>{a.drawFeature(o,c)})}),r}class ju{constructor(t){this.tileProvider=t.tileProvider,this._tilingScheme=this.tileProvider.tilingScheme,this._tileSize=t.tileSize,this._errorEvent=new If,this._readyPromise=Promise.resolve(!0),this.emptyCanvas=document.createElement("canvas"),this.emptyCanvas.width=this.tileWidth,this.emptyCanvas.height=this.tileHeight,this.minLevel=0,this.maxLevel=26,this._reload=void 0,this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0}get ready(){return!0}get readyPromise(){return this._readyPromise}get rectangle(){return this._tilingScheme.rectangle}get tileWidth(){return this._tileSize[0]}get tileHeight(){return this._tileSize[1]}get maximumLevel(){return this.maxLevel}get minimumLevel(){return this.minLevel}get tilingScheme(){return this._tilingScheme}get tileDiscardPolicy(){}get errorEvent(){return this._errorEvent}get credit(){}get proxy(){}get hasAlphaChannel(){return!0}async requestImage(t,e,s){const r=await this.tileProvider.getFeaturesForTile(t,e,s);if(r.length===0)return this.emptyCanvas;const n=this.tileProvider.tilingScheme.tileXYToRectangle(t,e,s),a=mn(n),o=Ut.center(n);return zu(r,a,o,this._tileSize)}}class $u extends _i{static get className(){return"VectorRasterTileCesiumImpl"}constructor(t,e){const s=O(_({},e),{tilingSchema:"mercator",splitDirection:void 0,opacity:void 0});super(t,s);this.tileProvider=e.tileProvider,this.tileSize=e.tileSize,this._reloadTimeout=null,this.imageryProvider=null}getCesiumLayer(){this.imageryProvider=new ju({tileProvider:this.tileProvider,tileSize:this.tileSize});const t={alpha:this.opacity,splitDirection:this.splitDirection,minimumTerrainLevel:this.minLevel,maximumTerrainLevel:this.maxLevel};if(this.extent&&this.extent.isValid()){const s=this.extent.getCoordinatesInProjection(B);t.rectangle=Ut.fromDegrees(s[0],s[1],s[2],s[3])}return new Je(this.imageryProvider,t)}_reloadTiles(){window.clearTimeout(this._reloadTimeout),this.imageryProvider&&this.imageryProvider._reload&&(this._reloadTimeout=window.setTimeout(()=>{this.imageryProvider._reload(),this._reloadTimeout=null}))}updateTiles(t){t.length>0&&this._reloadTiles()}updateStyle(t,e){this._reloadTiles()}}class Hu extends _i{static get className(){return"WmsCesiumImpl"}constructor(t,e){super(t,e);this.parameters=e.parameters,this.highResolution=e.highResolution,this.tileSize=e.tileSize}getCesiumLayer(){const t=_({},this.parameters);this.highResolution&&(t.width=this.tileSize[0]*2,t.height=this.tileSize[1]*2);const e={url:this.url,layers:t.LAYERS,minimumLevel:this.minLevel,maximumLevel:this.maxLevel,show:!1,parameters:t,tileWidth:this.tileSize[0],tileHeight:this.tileSize[1]};if(this.extent&&this.extent.isValid()){const n=this.extent.getCoordinatesInProjection(B);n&&(e.rectangle=Ut.fromDegrees(n[0],n[1],n[2],n[3]))}this.tilingSchema==="mercator"&&(e.tilingScheme=new Bn);const s=new Lf(e),r={alpha:this.opacity,splitDirection:this.splitDirection};return new Je(s,r)}}class Vu extends _i{static get className(){return"WmtsCesiumImpl"}constructor(t,e){super(t,e);this.layer=e.layer,this.style=e.style,this.format=e.format,this.tileMatrixSetID=e.tileMatrixSetID,this.tileSize=e.tileSize,this.numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX,this.numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY,this.matrixIds=e.matrixIds}getCesiumLayer(){const t=this.url.indexOf("{Layer}")!==-1?this.url.replace("{Layer}",this.layer):this.url,e=this.extent.getCoordinatesInProjection(B),s={url:t,layer:this.layer,style:this.style,format:this.format,tileMatrixSetID:this.tileMatrixSetID,maximumLevel:this.maxLevel,rectangle:Ut.fromDegrees(e[0],e[1],e[2],e[3]),tileWidth:this.tileSize[0],tileHeight:this.tileSize[1]};s.tilingScheme=Po({tilingSchema:this.tilingSchema,numberOfLevelZeroTilesX:this.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:this.numberOfLevelZeroTilesY}),s.tileMatrixLabels=this.matrixIds;const r=new Tf(s),n={alpha:this.opacity,splitDirection:this.splitDirection};return new Je(r,n)}}function Bu(i){const t=i.getPropertyNames(),e={};for(let s=0;s<t.length;s++)e[t[s]]=i.getProperty(t[s]);return e.id==null&&(e.id=`${i.content.url}${i._batchId}`),e.attributes?e.attributes.gmlId=e.id:e.gmlId==null&&(e.gmlId=e.id),e.clickedPosition=i.clickedPosition?i.clickedPosition:{},e}function sr(){const i=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(i.substr(0,4))}class Se extends _e{static get className(){return"CesiumTilesetLayer"}static getDefaultOptions(){return O(_({},_e.getDefaultOptions()),{highlightStyle:void 0,screenSpaceError:16,screenSpaceErrorMobile:32,maximumMemoryUsage:16,tilesetOptions:{},splitDirection:void 0,offset:void 0})}constructor(t){super(t);this._supportedMaps=[G.className];const e=Se.getDefaultOptions();this.url&&!/\.json$/.test(this.url)&&(this.url=`${this.url.replace(/\/$/,"")}/tileset.json`),this.highlightStyle=null,t.highlightStyle&&(this.highlightStyle=t.highlightStyle instanceof q?t.highlightStyle:new q(t.highlightStyle)),this.screenSpaceError=V(t.screenSpaceError,e.screenSpaceError),this.screenSpaceErrorMobile=V(t.screenSpaceErrorMobile,e.screenSpaceErrorMobile),this.maximumMemoryUsage=V(t.maximumMemoryUsage,e.maximumMemoryUsage);const s=t.tilesetOptions||e.tilesetOptions;this.tilesetOptions=_({url:this.url,maximumScreenSpaceError:sr()?this.screenSpaceErrorMobile:this.screenSpaceError,maximumMemoryUsage:this.maximumMemoryUsage},s),this._splitDirection=X.NONE,t.splitDirection&&(this._splitDirection=t.splitDirection==="left"?X.LEFT:X.RIGHT),this.splitDirectionChanged=new R,this._modelMatrix=void 0,this._offset=t.offset||e.offset}get modelMatrix(){return this._modelMatrix}set modelMatrix(t){it(t,A),this._modelMatrix=t,this.getImplementations().forEach(e=>{e.updateModelMatrix(t)})}get offset(){return this._offset}set offset(t){it(t,[Number]),this._offset=t,this.getImplementations().forEach(e=>{e.updateOffset(t)})}get splitDirection(){return this._splitDirection}set splitDirection(t){t!==this._splitDirection&&(this.getImplementations().forEach(e=>{e.updateSplitDirection(t)}),this._splitDirection=t,this.splitDirectionChanged.raiseEvent(this._splitDirection))}async initialize(){return await this.style.cesiumStyle.readyPromise,super.initialize()}getImplementationOptions(){return O(_({},super.getImplementationOptions()),{tilesetOptions:this.tilesetOptions,splitDirection:this.splitDirection,modelMatrix:this.modelMatrix,offset:this.offset})}createImplementationsForMap(t){return t instanceof G?[new We(t,this.getImplementationOptions())]:[]}objectClickedHandler(t){if(this.allowPicking){const e=Bu(t);if(e)return{id:e.id,feature:e}}return null}getZoomToExtent(){const t=super.getZoomToExtent();if(t)return t;const e=this.getImplementations()[0];if(e){const s=Oo(e.cesium3DTileset),r=new pt({projection:F.toJSON(),coordinates:s});if(r.isValid())return r}return null}getGenericFeatureFromClickedObject(t){const e=_(_({},this.genericFeatureProperties),t.attributes||t);return{layerName:this.name,layerClass:this.className,attributes:e,longitude:t.clickedPosition.longitude,latitude:t.clickedPosition.latitude,height:t.clickedPosition.height+this.balloonHeightOffset,relativeToGround:!1}}setMaximumScreenSpaceError(t){this.getImplementations().forEach(e=>{e.cesium3DTileset&&(e.cesium3DTileset.maximumScreenSpaceError=t)})}toJSON(){const t=super.toJSON(),e=Se.getDefaultOptions();this.highlightStyle&&(t.highlightStyle=this.highlightStyle.toJSON()),this.screenSpaceError!==e.screenSpaceError&&(t.screenSpaceError=this.screenSpaceError),this.screenSpaceErrorMobile!==e.screenSpaceErrorMobile&&(t.screenSpaceErrorMobile=this.screenSpaceErrorMobile),this.maximumMemoryUsage!==e.maximumMemoryUsage&&(t.maximumMemoryUsage=this.maximumMemoryUsage);const s=_({},this.tilesetOptions);s.url===this.url&&delete s.url;const r=sr()?this.screenSpaceErrorMobile:this.screenSpaceError;return s.maximumScreenSpaceError===r&&delete s.maximumScreenSpaceError,s.maximumMemoryUsage===this.maximumMemoryUsage&&delete s.maximumMemoryUsage,Object.keys(s).length>0&&(t.tilesetOptions=s),this._splitDirection!==X.NONE&&(t.splitDirection=this._splitDirection===X.RIGHT?"right":"left"),Array.isArray(this.offset)&&(t.offset=this.offset.slice()),t}destroy(){super.destroy(),this.splitDirectionChanged.destroy()}}ot.registerClass(Se.className,Se);class Ci extends ht{static get className(){return"DataSourceLayer"}static getDefaultOptions(){return O(_({},ht.getDefaultOptions()),{genericFeatureProperties:{}})}constructor(t){super(t);const e=Ci.getDefaultOptions();this.entities=new Nf,this.clock=void 0,this._genericFeatureProperties=t.genericFeatureProperties||e.genericFeatureProperties,this.featureVisibility=new Ur,this._featureVisibilityListeners=[],this._supportedMaps=[G.className]}setGlobalHider(t){super.setGlobalHider(t),this._setUpFeatureVisibility()}_setUpFeatureVisibility(){this._featureVisibilityListeners.forEach(t=>{t()}),this._featureVisibilityListeners=[this.featureVisibility.changed.addEventListener(({action:t,ids:e})=>{t===W.HIDE&&e.forEach(s=>{const r=this.entities.getById(s);r&&this.featureVisibility.addHiddenFeature(s,r)})}),this.entities.collectionChanged.addEventListener((t,e)=>{e.forEach(s=>{this.featureVisibility.hiddenObjects[s.id]&&this.featureVisibility.addHiddenFeature(s.id,s),this.globalHider&&this.globalHider.hiddenObjects[s.id]&&this.globalHider.addFeature(s.id,s)})})],this.globalHider&&this._featureVisibilityListeners.push(this.globalHider.changed.addEventListener(({action:t,ids:e})=>{t===W.HIDE&&e.forEach(s=>{const r=this.entities.getById(s);r&&this.globalHider.addFeature(s,r)})}))}initialize(){return this.initialized||this._setUpFeatureVisibility(),super.initialize()}getImplementationOptions(){return O(_({},super.getImplementationOptions()),{entities:this.entities,clock:this.clock})}createImplementationsForMap(t){return t instanceof G?[new Nu(t,this.getImplementationOptions())]:[]}addEntity(t,e,s){const r=this.entities.add(t);return r[z]=this.name,r.attributes=e,r.allowPicking=s,r.id}flyToEntity(t){this.getImplementations().forEach(e=>{e.flyToEntity(t)})}removeEntityById(t){this.entities.removeById(t)}objectClickedHandler(t){if(this.allowPicking&&t.id.allowPicking!==!1){const e=t.id,{id:s}=e;return e.clickedPosition=t.clickedPosition,{id:s,feature:t}}return null}getGenericFeatureFromClickedObject(t){const e=_(_({},this._genericFeatureProperties),t.attributes||{});return{layerName:this.name,layerClass:this.className,attributes:e,longitude:t.clickedPosition.longitude,latitude:t.clickedPosition.latitude,height:t.clickedPosition.height,relativeToGround:!1}}toJSON(){const t=super.toJSON();return Object.keys(this._genericFeatureProperties).length>0&&(t.genericFeatureProperties=_({},this._genericFeatureProperties)),t}destroy(){this.entities.removeAll(),this._featureVisibilityListeners.forEach(t=>{t()}),this._featureVisibilityListeners=[],this.featureVisibility.destroy(),super.destroy()}}ot.registerClass(Ci.className,Ci);class nr extends Ci{static get className(){return"CzmlLayer"}static getDefaultOptions(){return O(_({},Ci.getDefaultOptions()),{sourceUri:void 0})}constructor(t){super(t);this.dataSource=new Df,this.entities=this.dataSource.entities;const e=nr.getDefaultOptions();this.sourceUri=t.sourceUri||e.sourceUri,this._loadedResolve=()=>{},this._loadedReject=()=>{},this.loaded=new Promise((s,r)=>{this._loadedResolve=s,this._loadedReject=r})}initialize(){return this._initializedPromise||(this._initializedPromise=this._loadData().then(()=>super.initialize()).then(()=>{this._loadedResolve()}).catch(t=>{this._loadedReject(t)})),this._initializedPromise}async _loadData(){await this.dataSource.load(this.url,this.sourceUri?{sourceUri:this.sourceUri}:void 0),this.entities.values.forEach(t=>{t[z]=this.name}),this.clock=this.dataSource.clock}async reload(){this.entities.removeAll(),await this._loadData(),await this.forceRedraw()}toJSON(){const t=super.toJSON();return this.sourceUri&&(t.sourceUri=this.sourceUri),t}destroy(){super.destroy(),this.dataSource._entityCluster.destroy(),this.dataSource._entityCluster=null,this.dataSource._entityCollection=null,this.dataSource._changed=null,this.dataSource._error=null,this.dataSource._loading=null,this.dataSource=null}}ot.registerClass(nr.className,nr);function F1(i,t,e){const s=[];return i.forEach(r=>{const n=es(r,{writeStyle:!0});s.push({action:"add",feature:n,original:r,success(a){r.setId(a),r[Qt]=yi.DYNAMIC}})}),t.forEach(r=>{const n=es(r,{writeStyle:!0});n._id=r.getId(),n.geomety="test",s.push({action:"edit",original:r,feature:n,success(){r[Qt]===yi.STATIC&&(r[Qt]=yi.EDITED)}})}),e.forEach(r=>{const n=r.getId();s.push({original:r,action:"remove",feature:{_id:n},success(){}})}),s}class Uu extends re{static get className(){return"FeatureStoreLayerChanges"}constructor(t){super({});this.layer=t,this._changesListeners={addfeature:null,changefeature:null,removefeature:null},this._addedFeatures=new Set,this._editedFeatures=new Set,this._removedFeatures=new Set,this._convertedFeatures=new Set,this.values={changed:!1}}get active(){return Object.values(this._changesListeners).some(t=>t!==null)}track(){this._changesListeners.addfeature===null&&(this._changesListeners.addfeature=this.layer.source.on("addfeature",this._featureAdded.bind(this))),this._changesListeners.changefeature===null&&(this._changesListeners.changefeature=this.layer.source.on("changefeature",this._featureChanged.bind(this))),this._changesListeners.removefeature===null&&(this._changesListeners.removefeature=this.layer.source.on("removefeature",this._featureRemoved.bind(this)))}getChanges(){return{add:[...this._addedFeatures],edit:[...this._editedFeatures],remove:[...this._removedFeatures]}}async commitChanges(t){const e=F1(this._addedFeatures,this._editedFeatures,this._removedFeatures);if(e.length>0){const s=await ye(t.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e.map(n=>({action:n.action,feature:n.feature})))}),r=s.failedActions.map(({index:n,error:a})=>{const o=e[n];return this.getLogger().log(`failed action ${o.action}: ${a}`),e[n]=null,this._resetFeature(o.original)});e.filter(n=>n).forEach(({action:n,success:a})=>{n==="add"?a(s.insertedIds.shift()._id):a()}),await Promise.all(r)}else{try{await Promise.all([...this._convertedFeatures].map(async s=>{await this._resetFeature(s)}))}catch(s){this.getLogger().error(s.message)}this._resetValues()}}async reset(){const t=[];return this._addedFeatures.forEach(e=>{t.push(this._resetFeature(e))}),this._editedFeatures.forEach(e=>{t.push(this._resetFeature(e))}),this._removedFeatures.forEach(e=>{t.push(this._resetFeature(e))}),this._convertedFeatures.forEach(e=>{t.push(this._resetFeature(e))}),Promise.all(t).then(()=>{this._resetValues()}).catch(e=>{this.getLogger().error(e),this._resetValues()})}_resetFeature(t){const e=t.getId(),s=[e];return t[Qt]?t[Qt]===yi.STATIC?(this.layer.resetStaticFeature(e),Promise.resolve()):this.layer.injectedFetchDynamicFeatureFunc(e).then(r=>{const{features:n}=Ie(r);this.layer.removeFeaturesById(s),this.layer.addFeatures(n)}).catch(r=>{this.getLogger().error("failed to reset feature, giving up",r.message)}):(this.layer.removeFeaturesById(s),Promise.resolve())}_resetValues(){this._addedFeatures.clear(),this._editedFeatures.clear(),this._removedFeatures.clear(),this._convertedFeatures.clear(),this.values.changed=!1}unTrack(){yt(Object.values(this._changesListeners)),this._changesListeners.addfeature=null,this._changesListeners.changefeature=null,this._changesListeners.removefeature=null,this._resetValues()}pauseTracking(t){this._changesListeners[t]&&(yt(this._changesListeners[t]),this._changesListeners[t]=null)}_featureAdded(t){const{feature:e}=t;e[Qt]?e[Qt]===yi.STATIC&&(this._convertedFeatures.add(e),this.values.changed=!0):(this._addedFeatures.add(e),this.values.changed=!0)}_featureChanged(t){const{feature:e}=t;e[Qt]&&(this._convertedFeatures.delete(e),this._editedFeatures.add(e),this.values.changed=!0)}_featureRemoved(t){const{feature:e}=t;e[Qt]?(this._removedFeatures.add(e),this._editedFeatures.delete(e),this._convertedFeatures.delete(e),this.values.changed=!0):this._addedFeatures.delete(e)}removeFeature(t){v(t,Z),this._featureRemoved({feature:t})}addFeature(t){v(t,Z),this._featureAdded({feature:t})}editFeature(t){v(t,Z),this._featureChanged({feature:t})}destroy(){this.unTrack(),this.layer=null,super.destroy()}}const Eo=Symbol("isTiledFeature");class ns extends Ct{static get className(){return"FeatureStoreLayer"}static getDefaultOptions(){return O(_({id:"",type:"FeatureStoreLayer",featureType:"simple",features:[]},Ct.getDefaultOptions()),{projection:F.toJSON(),staticRepresentation:{},hiddenStaticFeatureIds:[],vcsMeta:{screenSpaceError:4,altitudeMode:"clampToGround"}})}constructor(t){const e=ns.getDefaultOptions(),s=_({projection:e.projection},t);super(s);this._supportedMaps=[G.className,tt.className,ae.className],this.hasFeatureUUID=!0,this.layerId=t.id,this.staticRepresentation=t.staticRepresentation||e.staticRepresentation,this.hiddenStaticFeatureIds=new Set(t.hiddenStaticFeatureIds||e.hiddenStaticFeatureIds),this.changeTracker=new Uu(this);const{vcsMeta:r}=e;if(t.vcsMeta&&Object.assign(r,t.vcsMeta),this.vcsMeta=r,this.setVcsMeta(this.vcsMeta),this.screenSpaceErrorMobile=this.vcsMeta.screenSpaceError,this.screenSpaceError=this.vcsMeta.screenSpaceError,this._removeVectorPropertiesChangeHandler=this.vectorProperties.propertyChanged.addEventListener(()=>{this.changeTracker.values.changed=!0}),this.injectedFetchDynamicFeatureFunc=t.injectedFetchDynamicFeatureFunc,this._staticFeatureVisibility=new Ur,this._featureVisibilitySyncListeners=[bh(this.featureVisibility,this._staticFeatureVisibility),this._staticFeatureVisibility.changed.addEventListener(({action:n})=>{n===W.SHOW&&this._staticFeatureVisibility.hideObjects([...this.hiddenStaticFeatureIds])})],this._setEditing=null,this._twoDimLoaded=null,this._twoDimStyleChanged=null,this._twoDimStaticSource=new vs,t.features){const n={type:"FeatureCollection",features:t.features,vcsMeta:t.vcsMeta},{style:a,features:o}=Ie(n,{targetProjection:F,dynamicStyle:!0});a&&(this._defaultStyle=a,this.setStyle(a)),this.addFeatures(o)}}initialize(){return this.initialized?super.initialize():super.initialize().then(()=>{this._staticFeatureVisibility.hideObjects([...this.hiddenStaticFeatureIds])})}_loadTwoDim(){return this._twoDimLoaded||(this._twoDimLoaded=(async()=>{const t=await ye(this.staticRepresentation.twoDim),{features:e}=Ie(t,{targetProjection:F,dynamicStyle:!0}),s=this.style instanceof Mt;e.forEach(r=>{r[ht.vcsLayerNameSymbol]=this.name,r[Eo]=!0,s&&r[Tt]&&r.setStyle(),this._setEditing&&this._setEditing.featureType!=null&&(r[this._setEditing.symbol]=this._setEditing.featureType)}),this._twoDimStaticSource.addFeatures(e)})()),this._twoDimLoaded}_getTwoDimStaticImplOptions(){return O(_({},super.getImplementationOptions()),{source:this._twoDimStaticSource,featureVisibility:this._staticFeatureVisibility})}createImplementationsForMap(t){const e=super.createImplementationsForMap(t);return t instanceof G&&this.staticRepresentation&&this.staticRepresentation.threeDim?e.push(new We(t,{url:this.staticRepresentation.threeDim,tilesetOptions:{maximumScreenSpaceError:sr()?this.screenSpaceErrorMobile:this.screenSpaceError,url:this.staticRepresentation.threeDim},tilesetProperties:[{key:Eo,value:!0}],name:this.name,style:this.style,featureVisibility:this._staticFeatureVisibility,globalHider:this.globalHider,splitDirection:X.NONE,jumpToLocation:!1})):this.staticRepresentation&&this.staticRepresentation.twoDim&&(this._loadTwoDim(),t instanceof tt?e.push(new Ya(t,this._getTwoDimStaticImplOptions())):t instanceof ae&&e.push(new lo(t,this._getTwoDimStaticImplOptions()))),e}reload(){return this._twoDimLoaded=null,this._twoDimStaticSource.clear(),super.reload()}async activate(){await super.activate(),this.active&&this._setEditing&&this.setEditing(this._setEditing.symbol,this._setEditing.featureType)}_trackStyleChanges(){if(super._trackStyleChanges(),this.staticRepresentation.twoDim){this._twoDimStyleChanged&&(this._twoDimStyleChanged(),this._twoDimStyleChanged=null);const t=this.style instanceof Mt;this._twoDimStyleChanged=this.style.styleChanged.addEventListener(()=>{this._twoDimStaticSource.getFeatures().forEach(e=>{(t||!e[Tt])&&e.changed()})})}}setStyle(t,e){const s=this.changeTracker.active;s&&this.changeTracker.pauseTracking("changefeature"),super.setStyle(t,e);const r=this.style instanceof Mt;this._twoDimStaticSource.getFeatures().forEach(n=>{if(n[Tt]){let a;r?(a=!0,n.setStyle(void 0)):n.getStyle()!==n[Tt].style&&(a=!0,n.setStyle(n[Tt].style)),a&&Reflect.has(n,pe)&&Oa(n)}}),s&&(this.changeTracker.track(),this.changeTracker.values.changed=!0)}setEditing(t,e){this.getImplementations().forEach(s=>{s instanceof We&&(s.initialized?(e!=null?s.cesium3DTileset[t]=e:delete s.cesium3DTileset[t],this._setEditing=null):this._setEditing={symbol:t,featureType:e})}),this.staticRepresentation.twoDim&&(this._twoDimLoaded?this._twoDimLoaded.then(()=>{this._twoDimStaticSource.getFeatures().forEach(s=>{e!=null?s[t]=e:delete s[t]})}):this._setEditing={symbol:t,featureType:e})}objectClickedHandler(t){return t instanceof Ge||t instanceof Ae?Se.prototype.objectClickedHandler.call(this,t):t instanceof Z?super.objectClickedHandler(t):null}getGenericFeatureFromClickedObject(t){if(t instanceof Z)return super.getGenericFeatureFromClickedObject(t);const e=Se.prototype.getGenericFeatureFromClickedObject.call(this,t);return e.layerName=this.name,e.layerClass=this.className,e}getZoomToExtent(){if(this.extent&&this.extent.isValid())return this.extent;const t=super.getZoomToExtent(),e=t?t.getCoordinatesInProjection(F):Xo();if(this.staticRepresentation.threeDim){const r=this.getImplementations().find(n=>n instanceof We&&n.cesium3DTileset);if(r){const n=Oo(r.cesium3DTileset);Zo(e,n)}}this.staticRepresentation.twoDim&&this._twoDimLoaded&&Zo(e,this._twoDimStaticSource.getExtent());const s=new pt({projection:F.toJSON(),coordinates:e});return s.isValid()?s:null}setMaximumScreenSpaceError(t){sr()?this.screenSpaceErrorMobile=t:this.screenSpaceError=t,this.getImplementations().forEach(e=>{e instanceof We&&e.cesium3DTileset&&(e.cesium3DTileset.maximumScreenSpaceError=t)})}switchStaticFeatureToDynamic(t){return this.hiddenStaticFeatureIds.has(t)?Promise.resolve(this.getFeatureById(t)):this.injectedFetchDynamicFeatureFunc?this.injectedFetchDynamicFeatureFunc(t).then(e=>{const{features:s}=Ie(e,{targetProjection:F,defaultStyle:this.defaultStyle instanceof q?this.defaultStyle:oi});return this._staticFeatureVisibility.hideObjects([t]),this.hiddenStaticFeatureIds.add(t),this.addFeatures(s),s[0]}).catch(e=>{this.getLogger().error(e.message)}):Promise.reject(new Error("no injected fetching function"))}removeStaticFeature(t){this._staticFeatureVisibility.hideObjects([t]),this.hiddenStaticFeatureIds.add(t);const e=new Z;e.setId(t),e[Qt]=yi.STATIC,this.changeTracker.removeFeature(e)}resetStaticFeature(t){if(this.hiddenStaticFeatureIds.has(t)){const e=[t];this.removeFeaturesById(e),this.hiddenStaticFeatureIds.delete(t),this.featureVisibility.hiddenObjects[t]||this._staticFeatureVisibility.showObjects(e)}}toJSON(){const t=super.toJSON(),e=ns.getDefaultOptions();return delete t.projection,t.vcsMeta=this.vectorProperties.getVcsMeta(_(_({},te.getDefaultOptions()),e.vcsMeta)),Object.keys(t.vcsMeta).length===0&&delete t.vcsMeta,this.vcsMeta.screenSpaceError!==e.vcsMeta.screenSpaceError&&(t.vcsMeta=t.vcsMeta||{},t.vcsMeta.screenSpaceError=this.vcsMeta.screenSpaceError),Object.keys(this.staticRepresentation).length>0&&(t.staticRepresentation=_({},this.staticRepresentation)),this.hiddenStaticFeatureIds.size>0&&(t.hiddenStaticFeatureIds=[...this.hiddenStaticFeatureIds]),t}destroy(){this.removeAllFeatures(),this._twoDimStaticSource.clear(),this._twoDimStyleChanged&&(this._twoDimStyleChanged(),this._twoDimStyleChanged=null),this._featureVisibilitySyncListeners.forEach(t=>{t()}),this._featureVisibilitySyncListeners=[],this._staticFeatureVisibility.destroy(),this.changeTracker.destroy(),this._removeVectorPropertiesChangeHandler&&this._removeVectorPropertiesChangeHandler(),super.destroy()}}ot.registerClass(ns.className,ns);const pn=Symbol("featureFromOptions");class as extends Ct{static get className(){return"GeoJSONLayer"}static getDefaultOptions(){return O(_({},Ct.getDefaultOptions()),{projection:B.toJSON(),features:void 0})}constructor(t){const e=as.getDefaultOptions();t.projection=t.projection||e.projection;super(t);this._dataFetchedPromise=null,this._featuresToLoad=t.features||e.features}async initialize(){return this.initialized||await this.fetchData(),super.initialize()}async reload(){if(this._dataFetchedPromise){const t=this.getFeatures().filter(e=>e[pn]);this.removeAllFeatures(),this.source.addFeatures(t),this._dataFetchedPromise=null,await this.fetchData()}return super.reload()}fetchData(){return this._dataFetchedPromise?this._dataFetchedPromise:(Array.isArray(this._featuresToLoad)&&(this._parseGeojsonData({type:"FeatureCollection",features:this._featuresToLoad}),this.getFeatures().forEach(t=>{t[pn]=!0}),this._featuresToLoad.splice(0),this._featuresToLoad=void 0),this.url?this._dataFetchedPromise=ye(this.url).then(t=>this._parseGeojsonData(t)).catch(t=>(this.getLogger().warning(`Could not send request for loading layer content (${t.message})`),Promise.reject(t))):this._dataFetchedPromise=Promise.resolve(),this._dataFetchedPromise)}_parseGeojsonData(t){const e=Ie(t,{dataProjection:this.projection,dynamicStyle:!0});if(this.addFeatures(e.features),e.style&&this.setStyle(e.style),e.vcsMeta){const s=_(_({},e.vcsMeta),this.vectorProperties.getVcsMeta());this.setVcsMeta(s)}}toJSON(){const t=super.toJSON(),e=as.getDefaultOptions(),s=new T(e.projection);if(this.projection.equals(s)?delete t.projection:t.projection=this.projection.toJSON(),Array.isArray(this._featuresToLoad))t.features=this._featuresToLoad.slice();else{const r=this.getFeatures().filter(n=>n[pn]);r.length>0&&(t.features=r.map(n=>es(n,{writeStyle:!0,writeId:!0})))}return t}destroy(){super.destroy(),this._featuresToLoad=void 0}}ot.registerClass(as.className,as);class is extends qs{static get className(){return"RasterLayerOpenlayersImpl"}constructor(t,e){super(t,e);this.splitDirection=e.splitDirection,this.minLevel=e.minLevel,this.maxLevel=e.maxLevel,this.tilingSchema=e.tilingSchema,this.extent=e.extent,this.opacity=e.opacity,this._splitDirectionRenderListeners=null}initialize(){return super.initialize().then(()=>{this.updateSplitDirection(this.splitDirection)})}updateOpacity(t){this.opacity=t,this.initialized&&this.olLayer.setOpacity(this.opacity)}updateSplitDirection(t){this.splitDirection=t,this.initialized&&(this.splitDirection===X.NONE&&this._splitDirectionRenderListeners?(yt(this._splitDirectionRenderListeners),this._splitDirectionRenderListeners=null,this.olLayer.changed()):t!==X.NONE&&!this._splitDirectionRenderListeners&&(this._splitDirectionRenderListeners=[],this._splitDirectionRenderListeners.push(this.olLayer.on("prerender",this._splitPreCompose.bind(this))),this._splitDirectionRenderListeners.push(this.olLayer.on("postrender",e=>{e.context.restore()})),this.olLayer.changed()))}_splitPreCompose(t){if(!this.map.splitScreen)return;const e=t.context,s=e.canvas.width*this.map.splitScreen.position;e.save(),e.beginPath(),this.splitDirection===X.LEFT?e.rect(0,0,s,e.canvas.height):e.rect(s,0,e.canvas.width-s,e.canvas.height),e.clip()}destroy(){this._splitDirectionRenderListeners&&(yt(this._splitDirectionRenderListeners),this._splitDirectionRenderListeners=null),super.destroy()}}class qu extends is{static get className(){return"OpenStreetMapOpenlayersImpl"}getOLLayer(){return new bi({opacity:this.opacity,source:new Dd({maxZoom:this.maxLevel})})}}class os extends ht{static get className(){return"OpenStreetMapLayer"}static getDefaultOptions(){return O(_({},ht.getDefaultOptions),{splitDirection:void 0,opacity:1,maxLevel:19})}constructor(t){super(t);const e=os.getDefaultOptions();this._splitDirection=X.NONE,t.splitDirection&&(this._splitDirection=t.splitDirection==="left"?X.LEFT:X.RIGHT),this._supportedMaps=[G.className,tt.className],this._opacity=Sr(t.opacity,e.opacity,0,1),this.splitDirectionChanged=new R,this.maxLevel=V(t.maxLevel,e.maxLevel)}get splitDirection(){return this._splitDirection}set splitDirection(t){t!==this._splitDirection&&(this._splitDirection=t,this.getImplementations().forEach(e=>{e.updateSplitDirection(this._splitDirection)}),this.splitDirectionChanged.raiseEvent(this._splitDirection))}get opacity(){return this._opacity}set opacity(t){const e=Sr(t,this._opacity,0,1);this._opacity!==e&&(this._opacity=e,this.getImplementations().forEach(s=>{s.updateOpacity(e)}))}getImplementationOptions(){return O(_({},super.getImplementationOptions()),{opacity:this.opacity,splitDirection:this.splitDirection,minLevel:0,maxLevel:this.maxLevel,tilingSchema:""})}createImplementationsForMap(t){return t instanceof tt?[new qu(t,this.getImplementationOptions())]:t instanceof G?[new Du(t,this.getImplementationOptions())]:[]}toJSON(){const t=super.toJSON(),e=os.getDefaultOptions();return this._splitDirection!==X.NONE&&(t.splitDirection=this._splitDirection===X.RIGHT?"right":"left"),this.opacity!==e.opacity&&(t.opacity=this.opacity),this.maxLevel!==e.maxLevel&&(t.maxLevel=this.maxLevel),t}destroy(){this.splitDirectionChanged.destroy(),super.destroy()}}ot.registerClass(os.className,os);class Wu extends is{static get className(){return"SingleImageOpenlayersImpl"}constructor(t,e){super(t,e);this.credit=e.credit}getOLLayer(){const t={attributions:this.credit,url:this.url,projection:"EPSG:4326",imageExtent:this.extent.getCoordinatesInProjection(B)};return er(this.url)||(t.crossOrigin="anonymous"),new Fd({source:new Rd(t),opacity:this.opacity})}}class R1 extends qs{static get className(){return"TileDebugOpenlayersImpl"}getOLLayer(){return new bi({source:new Ad})}updateStyle(t,e){}updateTiles(t){}}class Yu extends is{static get className(){return"TmsOpenlayersImpl"}constructor(t,e){super(t,e);this.format=e.format,this.tileSize=e.tileSize}getOLLayer(){const t={tileUrlFunction:s=>{const r=this.url.replace(/\/$/,""),n=(1<<s[0])-s[2]-1;return`${r}/${s[0]}/${s[1]}/${n}.${this.format}`},tileSize:this.tileSize,minZoom:this.minLevel,maxZoom:this.maxLevel,wrapX:!1};er(this.url)||(t.crossOrigin="anonymous"),this.tilingSchema===Le.GEOGRAPHIC&&(t.projection="EPSG:4326");const e={source:new Gd(t),opacity:this.opacity};return this.extent&&this.extent.isValid()&&(e.extent=this.extent.getCoordinatesInProjection(F)),new bi(e)}}class Xu extends qs{static get className(){return"VectorTileOpenlayersImpl"}constructor(t,e){super(t,e);this.tileProvider=e.tileProvider,this.source=null,this.tileSize=e.tileSize,this._tilesToUpdate=new Set,this._reloadTimeout=null,this.minLevel=e.minLevel,this.maxLevel=e.maxLevel,this.extent=e.extent}getOLLayer(){this.source=new kd({minZoom:0,maxZoom:26,tileSize:this.tileSize,tileLoadFunction:async n=>{const a=await this.tileProvider.getFeaturesForTile(n.tileCoord[1],n.tileCoord[2],n.tileCoord[0]);a.length>0?n.setFeatures(a):(n.setFeatures([]),n.setState(zd.EMPTY))},url:"/{z}/{x}/{y}"});const t=this.extent&&this.extent.isValid()?this.extent.getCoordinatesInProjection(F):void 0,e=this.minLevel?this.minLevel:void 0,s=this.maxLevel?this.maxLevel+1:void 0;return new jd({visible:!1,source:this.source,renderBuffer:200,renderMode:"image",declutter:!0,extent:t,minZoom:e,maxZoom:s})}updateTiles(t){t.length>0&&(t.forEach(e=>{this._tilesToUpdate.add(e)}),this.source&&(this._reloadTimeout||(this._reloadTimeout=window.setTimeout(()=>{this._tilesToUpdate.forEach(e=>{const{tileCache:s}=this.source;if(s.containsKey(e)){const r=s.get(e);r.key=!1}}),this.source.changed(),this._tilesToUpdate.clear(),this._reloadTimeout=null},0))))}updateStyle(t,e){this.initialized&&(window.clearTimeout(this._reloadTimeout),this._reloadTimeout=null,this._tilesToUpdate.clear(),this.source.refresh())}setVisibility(t){this.initialized&&this.olLayer.setVisible(t)}destroy(){this.source&&(this.source.clear(),this.source=null),this.tileProvider=null,super.destroy()}}class Zu extends is{static get className(){return"WmsOpenlayersImpl"}constructor(t,e){super(t,e);this.parameters=e.parameters,this.version=e.version,this.tileSize=e.tileSize}getOLLayer(){return new bi({visible:!1,source:bo({url:this.url,parameters:this.parameters,version:this.version,extent:this.extent,tileSize:this.tileSize,minLevel:this.minLevel,maxLevel:this.maxLevel,tilingSchema:this.tilingSchema}),opacity:this.opacity})}}class Ju extends is{static get className(){return"WmtsOpenlayersImpl"}constructor(t,e){super(t,e);this.layer=e.layer,this.style=e.style,this.format=e.format,this.tileMatrixSetID=e.tileMatrixSetID,this.tileSize=e.tileSize,this.numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX,this.numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY,this.matrixIds=e.matrixIds,this.openlayersOptions=e.openlayersOptions}getOLLayer(){const t=this.tilingSchema===Le.GEOGRAPHIC?B:F,e=t.proj.getExtent();let s=Ln(e)/this.tileSize[0];this.numberOfLevelZeroTilesX>1&&(s/=this.numberOfLevelZeroTilesX),this.tilingSchema===Le.GEOGRAPHIC&&(s=Ln(e)/(this.tileSize[0]*2));const r=this.maxLevel+1,n=new Array(r).fill(void 0).map((u,d)=>s/2**d),a=this.extent.getCoordinatesInProjection(t),o={origin:gr(e),extent:a,resolutions:n,matrixIds:this.matrixIds,minZoom:this.minLevel,tileSize:this.tileSize};if(this.numberOfLevelZeroTilesX>1||this.numberOfLevelZeroTilesY>1){const u=[];let d=this.numberOfLevelZeroTilesX,f=this.numberOfLevelZeroTilesY;for(let g=0;g<=r;g++)u.push([d,f]),d*=2,f*=2;o.sizes=u}const l=new $d(o),h=this.url.indexOf("{")>=0?"REST":"KVP",c={tileGrid:l,requestEncoding:h,layer:this.layer,style:this.style,format:this.format,matrixSet:this.tileMatrixSetID,url:this.url};return er(this.url)||(c.crossOrigin="anonymous"),this.tilingSchema===Le.GEOGRAPHIC&&(c.projection="EPSG:4326"),Object.assign(c,this.openlayersOptions),new bi({opacity:this.opacity,source:new Hd(c)})}}const Ku=new Mt({});class ls extends Se{static get className(){return"PointCloudLayer"}static getDefaultOptions(){return O(_({},Se.getDefaultOptions()),{pointSize:null})}constructor(t){super(t);const e=ls.getDefaultOptions();this.defaultPointSize=t.pointSize!=null?t.pointSize:e.pointSize,this._pointSize=this.defaultPointSize,this._supportedMaps=[G.className]}getStyleOrDefaultStyle(t,e){return super.getStyleOrDefaultStyle(t,e||Ku)}get pointSize(){return this._pointSize}set pointSize(t){it(t,[Number,String]),this._pointSize=t,this.style.pointSize=t==null?void 0:t.toString()}async initialize(){await super.initialize(),this.pointSize=this._pointSize}createImplementationsForMap(t){return t instanceof G?[new We(t,this.getImplementationOptions())]:[]}clearStyle(){super.clearStyle(),this.pointSize=this.defaultPointSize}setStyle(t,e){t instanceof q?this.getLogger().warning("trying to apply vector style to point cloud layer."):super.setStyle(t,e)}toJSON(){const t=super.toJSON(),e=ls.getDefaultOptions();return this.defaultPointSize!==e.pointSize&&(t.pointSize=this.defaultPointSize),t}}ot.registerClass(ls.className,ls);class ar extends jt{static get className(){return"SingleImageLayer"}static getDefaultOptions(){return O(_({},jt.getDefaultOptions()),{credit:void 0})}constructor(t){super(t);const e=ar.getDefaultOptions();this.credit=t.credit||e.credit,this.extent.isValid()||(this.getLogger().warning(`layer ${this.name} was constructed with an invalid extent, defaulting to global extent`),this.extent=new pt({projection:B.toJSON(),coordinates:[-180,-90,180,90]})),this._supportedMaps=[G.className,tt.className]}getImplementationOptions(){return O(_({},super.getImplementationOptions()),{credit:this.credit})}createImplementationsForMap(t){return t instanceof G?[new Fu(t,this.getImplementationOptions())]:t instanceof tt?[new Wu(t,this.getImplementationOptions())]:[]}setExtent(t){if(v(t,pt),!t.isValid())throw new Error("Cannot set invalid extent");this.extent=t,this.forceRedraw()}toJSON(){const t=super.toJSON();return delete t.tilingSchema,this.credit&&(t.credit=this.credit),t}}ot.registerClass(ar.className,ar);class hs extends ht{static get className(){return"TerrainLayer"}static getDefaultOptions(){return O(_({},ht.getDefaultOptions()),{requestVertexNormals:!0,requestWaterMask:!1})}constructor(t){super(t);const e=hs.getDefaultOptions();this._supportedMaps=[G.className],this.requestVertexNormals=rt(t.requestVertexNormals,e.requestVertexNormals),this.requestWaterMask=rt(t.requestWaterMask,e.requestWaterMask)}getImplementationOptions(){return O(_({},super.getImplementationOptions()),{requestVertexNormals:this.requestVertexNormals,requestWaterMask:this.requestWaterMask})}createImplementationsForMap(t){return t instanceof G?[new Ru(t,this.getImplementationOptions())]:[]}getHeightForWGS84Coordinates(t){const e=Ji({url:this.url,requestVertexNormals:this.requestVertexNormals,requestWaterMask:this.requestWaterMask});return pi(e,t,null,t)}toJSON(){const t=super.toJSON(),e=hs.getDefaultOptions();return this.requestVertexNormals!==e.requestVertexNormals&&(t.requestVertexNormals=this.requestVertexNormals),this.requestWaterMask!==e.requestWaterMask&&(t.requestWaterMask=this.requestWaterMask),t}}ot.registerClass(hs.className,hs);function A1(i,t){return new Promise(e=>{let s;const r=i.cesium3DTileset.allTilesLoaded.addEventListener(()=>{s&&clearTimeout(s),r(),e()});t!=null&&(s=setTimeout(()=>{r(),e()},t))})}async function G1(i,t){const e=i.getImplementations().filter(s=>s instanceof We);!i.active||e.every(s=>s.cesium3DTileset.tilesLoaded)||await Promise.all(e.map(s=>A1(s,t)))}function k1(i,t){return i.tilesLoaded?Promise.resolve():new Promise(e=>{let s;const r=i.tileLoadProgressEvent.addEventListener(n=>{n<1&&(s&&clearTimeout(s),r(),e())});t!=null&&(s=setTimeout(()=>{r(),e()},t))})}function Io(i,t,e,s,r){let n=i;if(r){const a=Ut.southwest(r),o=Ut.northeast(r),l=P.toDegrees(a.longitude),h=P.toDegrees(a.latitude),c=P.toDegrees(o.longitude),u=P.toDegrees(o.latitude);n=n.replace(/\{minx\}/,String(l)).replace(/\{miny\}/,String(h)).replace(/\{maxx\}/,String(c)).replace(/\{maxy\}/,String(u))}return n=n.replace(/\{x\}/,String(t)).replace(/\{y\}/,String(e)).replace(/\{z\}/,String(s)).replace(/\{locale\}/,_a()),n}class or extends Wt{static get className(){return"URLTemplateTileProvider"}static getDefaultOptions(){return O(_({},Wt.getDefaultOptions()),{url:void 0})}constructor(t){const e=or.getDefaultOptions();super(t);this.url=t.url||e.url}async loader(t,e,s){const r=this.tilingScheme.tileXYToRectangle(t,e,s),n=Io(this.url,t,e,s,r),a=await ye(n),{features:o}=Ie(a,{dynamicStyle:!0});return o}toJSON(){const t=super.toJSON();return this.url&&(t.url=this.url),t}}si.registerClass(or.className,or);class lr extends Wt{static get className(){return"MVTTileProvider"}static getDefaultOptions(){return O(_({},Wt.getDefaultOptions()),{url:void 0,idProperty:void 0})}constructor(t){const e=lr.getDefaultOptions();super(t);this.url=t.url||e.url,this.idProperty=t.idProperty||e.idProperty,this._MVTFormat=new Vd({featureClass:Z})}async loader(t,e,s){const r=this.tilingScheme.tileXYToRectangle(t,e,s),n=Io(this.url,t,e,s,r),a=mn(r),o=In(a),l=await tu(n),h=this._MVTFormat.readFeatures(l),c=(a[2]-a[0])/4096,u=-((a[3]-a[1])/4096);return h.forEach(d=>{const f=d.get(this.idProperty);f!=null&&d.setId(String(f));const m=d.getGeometry().getFlatCoordinates(),p=m.length;for(let y=0;y<p;y++)y%2?(m[y]=(m[y]-2048)*u,m[y]+=o[1]):(m[y]=(m[y]-2048)*c,m[y]+=o[0])}),h}toJSON(){const t=super.toJSON();return this.url&&(t.url=this.url),this.idProperty&&(t.idProperty=this.idProperty),t}}si.registerClass(lr.className,lr);class hr extends Wt{static get className(){return"StaticGeoJSONTileProvider"}static getDefaultOptions(){return O(_({},Wt.getDefaultOptions()),{url:void 0,baseLevels:[0]})}constructor(t){const e=hr.getDefaultOptions();t.baseLevels=e.baseLevels;super(t);this.url=t.url||e.url}async loader(t,e,s){const r=await ye(this.url),{features:n}=Ie(r,{dynamicStyle:!0});return n}toJSON(){const t=super.toJSON();return delete t.baseLevels,this.url&&(t.url=this.url),t}}si.registerClass(hr.className,hr);class cs extends jt{static get className(){return"TMSLayer"}static getDefaultOptions(){return O(_({},jt.getDefaultOptions()),{tilingSchema:"mercator",format:"jpeg",tileSize:[256,256]})}constructor(t){const e=cs.getDefaultOptions();t.tilingSchema=t.tilingSchema||e.tilingSchema;super(t);this._supportedMaps=[tt.className,G.className],this.format=t.format||e.format,this.tileSize=Array.isArray(t.tileSize)?t.tileSize.slice():e.tileSize}getImplementationOptions(){return O(_({},super.getImplementationOptions()),{format:this.format,tileSize:this.tileSize})}createImplementationsForMap(t){return t instanceof tt?[new Yu(t,this.getImplementationOptions())]:t instanceof G?[new Gu(t,this.getImplementationOptions())]:[]}toJSON(){const t=super.toJSON(),e=cs.getDefaultOptions();return this.tilingSchema!==e.tilingSchema?t.tilingSchema=this.tilingSchema:delete t.tilingSchema,this.format!==e.format&&(t.format=this.format),(this.tileSize[0]!==e.tileSize[0]||this.tileSize[1]!==e.tileSize[1])&&(t.tileSize=this.tileSize.slice()),t}}ot.registerClass(cs.className,cs);function Qu(i,t,e){const s=e.getId();i.hiddenObjects[s]?e[At]=!0:e[At]&&delete e[At],i.highlightedObjects[s]?e[Nt]=i.highlightedObjects[s].style:e[Nt]&&delete e[Nt],t.hiddenObjects[s]?e[Gt]=!0:e[Gt]&&delete e[Gt]}class us extends _e{static get className(){return"VectorTileLayer"}static getDefaultOptions(){return O(_({},_e.getDefaultOptions()),{tileProvider:void 0,highlightStyle:void 0,vectorProperties:{},minLevel:void 0,maxLevel:void 0})}constructor(t){super(t);this._supportedMaps=[G.className,tt.className];const e=us.getDefaultOptions();this.highlightStyle=e.highlightStyle,t.highlightStyle&&(this.highlightStyle=t.highlightStyle instanceof q?t.highlightStyle:new q(t.highlightStyle)),this._tileSize=[256,256],this.vectorProperties=new te(_({allowPicking:this.allowPicking},t.vectorProperties)),this.tileProvider=t.tileProvider instanceof Wt?t.tileProvider:ge(si,t.tileProvider),this._maxLevel=V(t.maxLevel,e.maxLevel),this._minLevel=V(t.minLevel,e.minLevel),this._featureVisibilityListeners=[],this._tileLoadEventListener=()=>{},this._vectorPropertiesChangedListener=()=>{},this._styleZIndex=0}async initialize(){this.initialized||(this._tileLoadEventListener=this.tileProvider.tileLoadedEvent.addEventListener(t=>this._handleTileLoaded(t)),this._vectorPropertiesChangedListener=this.vectorProperties.propertyChanged.addEventListener(()=>{this.reload()}),this.featureProvider=new gn(this.name,{tileProvider:this.tileProvider,vectorProperties:this.vectorProperties})),await super.initialize()}objectClickedHandler(t){const e=t[Be]||t;return this.vectorProperties.getAllowPicking(e)?t[At]||t[Gt]?null:{id:e.getId(),feature:e}:null}getGenericFeatureFromClickedObject(t){return Wa(t,this)}_getNextStyleZIndex(){return this._styleZIndex+=1,this._styleZIndex}_handleTileLoaded({rtree:t}){t.all().map(e=>e.value).forEach(e=>{const s=e.getStyle();s&&s instanceof ft&&s.setZIndex(this._getNextStyleZIndex()),e[z]=this.name,e.getStyleFunction=()=>this._featureStyle.bind(this),this.tileProvider.trackFeaturesToTiles&&Qu(this.featureVisibility,this.globalHider,e)})}setGlobalHider(t){super.setGlobalHider(t),this._setupFeatureVisibilityHandlers()}_setupFeatureVisibilityHandlers(){!this.tileProvider.trackFeaturesToTiles||(this._featureVisibilityListeners.forEach(t=>{t()}),this._featureVisibilityListeners=[this.featureVisibility.changed.addEventListener(({action:t,ids:e})=>{const s=new Set;e.forEach(r=>{const n=this.tileProvider.featureIdToTileIds.get(r);n&&n.forEach(a=>{const l=this.tileProvider.rtreeCache.get(a).all().find(h=>h.value.getId()===r);if(l){const h=l.value;s.add(a),t===W.HIGHLIGHT?h[Nt]=this.featureVisibility.highlightedObjects[r].style:t===W.UNHIGHLIGHT?delete h[Nt]:t===W.HIDE?h[At]=!0:t===W.SHOW&&delete h[At]}})}),this.updateTiles([...s])})],this.globalHider&&this._featureVisibilityListeners.push(this.globalHider.changed.addEventListener(({action:t,ids:e})=>{const s=new Set;e.forEach(r=>{const n=this.tileProvider.featureIdToTileIds.get(r);n&&n.forEach(a=>{const l=this.tileProvider.rtreeCache.get(a).all().find(h=>h.value.getId()===r);if(l){const h=l.value;s.add(a),t===W.HIDE?h[Gt]=!0:t===W.SHOW&&delete h[Gt]}})}),this.updateTiles([...s])})))}updateTiles(t){this.getImplementations().forEach(e=>{e.updateTiles(t)})}_featureStyle(t,e){let s;return t[At]||t[Gt]?[]:(t[Nt]?{style:s}=t[Nt]:this.style instanceof Mt?{style:s}=this.style:s=t.getStyle()||this.style.style,Ys(s,t,e))}getImplementationOptions(){return O(_({},super.getImplementationOptions()),{tileProvider:this.tileProvider,tileSize:this._tileSize,minLevel:this._minLevel,maxLevel:this._maxLevel,extent:this.extent})}createImplementationsForMap(t){return t instanceof G?[new $u(t,this.getImplementationOptions())]:t instanceof tt?[new Xu(t,this.getImplementationOptions())]:[]}getStyleOrDefaultStyle(t,e){return super.getStyleOrDefaultStyle(t,e||oi.clone())}async activate(){await super.activate(),this._setupFeatureVisibilityHandlers(),this.tileProvider.trackFeaturesToTiles&&this.globalHider&&this.tileProvider.forEachFeature(t=>{Qu(this.featureVisibility,this.globalHider,t)})}deactivate(){super.deactivate(),this._featureVisibilityListeners.forEach(t=>{t()})}destroy(){this._featureVisibilityListeners.forEach(t=>{t()}),super.destroy(),this._tileLoadEventListener(),this.featureProvider&&this.featureProvider.destroy(),this.tileProvider&&this.tileProvider.destroy(),this._vectorPropertiesChangedListener(),this.vectorProperties&&this.vectorProperties.destroy()}toJSON(){const t=super.toJSON(),e=us.getDefaultOptions();this._maxLevel!==e.maxLevel&&(t.maxLevel=this._maxLevel),this._minLevel!==e.minLevel&&(t.minLevel=this._minLevel);const s=this.vectorProperties.getVcsMeta();return Object.keys(s).length>0&&(t.vectorProperties=s),this.tileProvider&&(t.tileProvider=this.tileProvider.toJSON()),t}}ot.registerClass(us.className,us);class Lo extends Ct{static get className(){return"WFSLayer"}static getDefaultOptions(){return O(_({},Ct.getDefaultOptions()),{featureType:[],featureNS:"",featurePrefix:"",getFeatureOptions:{}})}constructor(t){const e=new T(t.projection).toJSON();e.alias=[`http://www.opengis.net/gml/srs/epsg.xml#${e.epsg.match(/\d+/)[0]}`],t.projection=e;super(t);this.featureType=Array.isArray(t.featureType)?t.featureType:[t.featureType],this.featureNS=t.featureNS,this.featurePrefix=t.featurePrefix,this.getFeaturesOptions=t.getFeatureOptions||{},this.wfsFormat=new Yo({featureNS:this.featureNS,featureType:this.featureType}),this._dataFetchedPromise=null}async initialize(){return this.initialized||await this.fetchData(),super.initialize()}async reload(){return this._dataFetchedPromise&&(this.removeAllFeatures(),this._dataFetchedPromise=null,await this.fetchData()),super.reload()}fetchData(){if(this._dataFetchedPromise)return this._dataFetchedPromise;if(this.url!=null){const t=this.wfsFormat.writeGetFeature(_({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureTypes:this.featureType,srsName:this.projection.epsg},this.getFeaturesOptions)),e=new XMLSerializer().serializeToString(t);return this._dataFetchedPromise=ye(this.url,{method:"POST",headers:{"Content-Type":"application/text+xml"},body:JSON.stringify(e)}).then(s=>this._parseWFSData(s)).catch(s=>(this.getLogger().info(`Could not send request for loading layer content (${s.message})`),Promise.reject(s))),this._dataFetchedPromise}return this.getLogger().warning("Could not load WFSLayer layer, no url is set"),Promise.reject(new Error("missing url in WFSLayer layer"))}_parseWFSData(t){const e=this.wfsFormat.readFeatures(t);this.addFeatures(e)}toJSON(){const t=super.toJSON();return t.featureType=this.featureType.slice(),t.featureNS=this.featureNS,t.featurePrefix=this.featurePrefix,Object.keys(this.getFeaturesOptions).length>0&&(t.getFeatureOptions=this.getFeaturesOptions),t}}ot.registerClass(Lo.className,Lo);class ds extends jt{static get className(){return"WMSLayer"}static getDefaultOptions(){return O(_({},jt.getDefaultOptions()),{version:"1.1.1",parameters:void 0,featureInfo:void 0,tileSize:[256,256],highResolution:!1,layers:""})}constructor(t){super(t);const e=ds.getDefaultOptions();if(this.version=t.version||e.version,this.parameters={},t.parameters){let s;typeof t.parameters=="string"?s=Object.fromEntries(new URLSearchParams(t.parameters)):t.parameters instanceof Object&&(s=t.parameters),Object.keys(s).forEach(r=>{this.parameters[r.toUpperCase()]=s[r]})}this.parameters.TRANSPARENT==null&&(this.parameters.TRANSPARENT=!1),this.version&&(this.parameters.VERSION=this.version),this.parameters.LAYERS=t.layers||e.layers,this.tileSize=t.tileSize||e.tileSize,this.highResolution=rt(t.highResolution,e.highResolution),this._featureInfoOptions=t.featureInfo||e.featureInfo,this._supportedMaps=[G.className,tt.className]}initialize(){return this.initialized||this._setFeatureProvider(),super.initialize()}_setFeatureProvider(){if(this._featureInfoOptions){const t=_({url:this.url,tilingSchema:this.tilingSchema,maxLevel:this.maxLevel,minLevel:this.minLevel,tileSize:this.tileSize,extent:this.extent,parameters:this.parameters,version:this.version},this._featureInfoOptions);this.featureProvider=new Ye(this.name,t)}}async reload(){return this.featureProvider&&this._featureInfoOptions&&(this.featureProvider.destroy(),this._setFeatureProvider()),super.reload()}getImplementationOptions(){return O(_({},super.getImplementationOptions()),{version:this.version,parameters:this.parameters,highResolution:this.highResolution,tileSize:this.tileSize})}createImplementationsForMap(t){return t instanceof G?[new Hu(t,this.getImplementationOptions())]:t instanceof tt?[new Zu(t,this.getImplementationOptions())]:[]}async setLayers(t){v(t,[String,[String]]);const e=Array.isArray(t)?t:[t];this.parameters.LAYERS=e.join(","),await this.forceRedraw()}getLayers(){return this.parameters.LAYERS?this.parameters.LAYERS.split(","):[]}toJSON(){const t=super.toJSON(),e=ds.getDefaultOptions();this.parameters.LAYERS&&(t.layers=this.parameters.LAYERS),this.version!==e.version&&(t.version=this.version);const s=_({},this.parameters);if(delete s.VERSION,delete s.LAYERS,s.TRANSPARENT===!1&&delete s.TRANSPARENT,Object.keys(s).length>0&&(t.parameters=s),this.version!==e.version&&(t.version=this.version),this.highResolution!==e.highResolution&&(t.highResolution=this.highResolution),(this.tileSize[0]!==e.tileSize[0]||this.tileSize[1]!==e.tileSize[1])&&(t.tileSize=this.tileSize.slice()),this.featureProvider&&this.featureProvider instanceof Ye){const r=this.featureProvider.toJSON();(this.tileSize[0]===r.tileSize[0]||this.tileSize[1]===r.tileSize[1])&&delete r.tileSize,Object.entries(this.parameters).every(([n,a])=>r.parameters[n]===a)&&delete r.parameters,r.extent&&new pt(r.extent).equals(this.extent)&&delete r.extent,this.url===r.url&&delete r.url,this.tilingSchema===r.tilingSchema&&delete r.tilingSchema,this.version===r.version&&delete r.version,this.minLevel===r.minLevel&&delete r.minLevel,this.maxLevel===r.maxLevel&&delete r.maxLevel,t.featureInfo=r}else this._featureInfoOptions&&(t.featureInfo=this._featureInfoOptions);return t}}ot.registerClass(ds.className,ds);function z1(i,t,e){if(i.length>0){if(i.length===t+1)return i;Pt("WmtsCesiumImpl").log("matrixIds must have the same length as maxLevel")}return new Array(t+1).fill(void 0).map((s,r)=>`${e}${r}`)}class fs extends jt{static get className(){return"WMTSLayer"}static getDefaultOptions(){return O(_({},jt.getDefaultOptions()),{tilingSchema:"mercator",numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,layer:"",style:"",format:"",tileMatrixPrefix:"",tileMatrixSetID:"",openlayersOptions:{},matrixIds:[],tileSize:[256,256]})}constructor(t){const e=fs.getDefaultOptions();t.tilingSchema=t.tilingSchema||e.tilingSchema;super(t);this._supportedMaps=[tt.className,G.className],this.numberOfLevelZeroTilesX=V(t.numberOfLevelZeroTilesX,e.numberOfLevelZeroTilesX),this.numberOfLevelZeroTilesY=V(t.numberOfLevelZeroTilesY,e.numberOfLevelZeroTilesY),this.layer=t.layer||e.layer,this.style=t.style||e.style,this.format=t.format||e.format,this.tileMatrixPrefix=t.tileMatrixPrefix||e.tileMatrixPrefix,this.tileMatrixSetID=t.tileMatrixSetID||e.tileMatrixSetID,this.openlayersOptions=t.openlayersOptions||e.openlayersOptions,this.matrixIds=Array.isArray(t.matrixIds)?t.matrixIds:e.matrixIds,this.tileSize=t.tileSize||e.tileSize}getImplementationOptions(){return O(_({},super.getImplementationOptions()),{layer:this.layer,style:this.style,format:this.format,tileMatrixSetID:this.tileMatrixSetID,tileSize:this.tileSize,numberOfLevelZeroTilesX:this.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:this.numberOfLevelZeroTilesY,matrixIds:z1(this.matrixIds,this.maxLevel,this.tileMatrixPrefix),openlayersOptions:this.openlayersOptions})}createImplementationsForMap(t){return t instanceof tt?[new Ju(t,this.getImplementationOptions())]:t instanceof G?[new Vu(t,this.getImplementationOptions())]:[]}toJSON(){const t=super.toJSON(),e=fs.getDefaultOptions();return this.tilingSchema!==e.tilingSchema?t.tilingSchema=this.tilingSchema:delete t.tilingSchema,this.numberOfLevelZeroTilesX!==e.numberOfLevelZeroTilesX&&(t.numberOfLevelZeroTilesX=this.numberOfLevelZeroTilesX),this.numberOfLevelZeroTilesY!==e.numberOfLevelZeroTilesY&&(t.numberOfLevelZeroTilesY=this.numberOfLevelZeroTilesY),this.layer!==e.layer&&(t.layer=this.layer),this.style!==e.style&&(t.style=this.style),this.format!==e.format&&(t.format=this.format),this.tileMatrixPrefix!==e.tileMatrixPrefix&&(t.tileMatrixPrefix=this.tileMatrixPrefix),this.tileMatrixSetID!==e.tileMatrixSetID&&(t.tileMatrixSetID=this.tileMatrixSetID),Object.keys(this.openlayersOptions).length>0&&(t.openlayersOptions=_({},this.openlayersOptions)),this.matrixIds.length>0&&(t.matrixIds=this.matrixIds.slice()),(this.tileSize[0]!==e.tileSize[0]||this.tileSize[1]!==e.tileSize[1])&&(t.tileSize=this.tileSize.slice()),t}}ot.registerClass(fs.className,fs);function To(){return Pt("ClippingObject")}const yn=Symbol("ClippingObjectGlobe");class Si{constructor(t={}){this.id=Xt(),this.layerNames=t.layerNames||[],this.entities=t.entities||[],this.targets=new Map,this._clippingPlaneCollection=t.clippingPlaneCollection||null,this._terrain=rt(t.terrain,!1),this._local=rt(t.local,!1),this.targetsUpdated=new R,this.clippingPlaneUpdated=new R,this._cachedFeatureStoreLayers=new Set,this._activeMap=null,this._layerCollection=null}get clippingPlaneCollection(){return this._clippingPlaneCollection}set clippingPlaneCollection(t){this._clippingPlaneCollection=t,this.clippingPlaneUpdated.raiseEvent()}get terrain(){return this._terrain}set terrain(t){v(t,Boolean),this._terrain!==t&&(this._terrain=t,this.handleMapChanged(this._activeMap))}get local(){return this._local}set local(t){v(t,Boolean),this._local!==t&&(this._local=t,this.clippingPlaneUpdated.raiseEvent())}setLayerCollection(t){if(v(t,Te),this._layerCollection&&this._layerCollection!==t)throw new Error("layerCollection has already been set");this._layerCollection=t,[...this._layerCollection].forEach(e=>{this.handleLayerChanged(e)})}handleLayerChanged(t){const e=this._activeMap;if(e instanceof G){if(this.layerNames.includes(t.name))if(t.active){const s=e.getVisualizationsForLayer(t),r=s?[...s].filter(n=>n instanceof Ms):[];if(r.length>0)r.forEach(n=>{n.readyPromise.then(a=>{this.layerNames.includes(t.name)&&t.active&&(this.targets.set(t.name,a),this.targetsUpdated.raiseEvent())})});else{const n=this.layerNames.indexOf(t.name);To().warning(`layer ${t.name} cannot have a ClippingObject applied`),this.layerNames.splice(n,1)}}else this.targets.has(t.name)&&(this.targets.delete(t.name),this.targetsUpdated.raiseEvent());else if(this.entities.find(s=>s.layerName===t.name)){let s=!1;const r=e.getVisualizationsForLayer(t),n=r?[...r][0]:null;if(!n){const a=this.layerNames.indexOf(t.name);To().warning(`layer ${t.name} cannot have a ClippingObject applied`),this.layerNames.splice(a,1);return}this.entities.filter(a=>a.layerName===t.name).forEach(a=>{const o=`${a.layerName}-${a.entityId}`;if(t.active){const l=n.entities.getById(a.entityId);if(l)this.targets.set(o,l),s=!0;else{const h=this.entities.indexOf(a);To().warning(`could not find entity with id ${a.entityId} in layer ${a.layerName}`),this.entities.splice(h,1)}}else this.targets.has(o)&&(this.targets.delete(o),s=!0)}),s&&this.targetsUpdated.raiseEvent()}}else this.layerNames.includes(t.name)&&t.className==="FeatureStoreLayer"&&(t.active?this._cachedFeatureStoreLayers.add(t):this._cachedFeatureStoreLayers.has(t)&&this._cachedFeatureStoreLayers.delete(t))}handleMapChanged(t){if(t instanceof G){const{globe:e}=t.getScene();let s=!1;this._terrain&&!this.targets.has(yn)?(this.targets.set(yn,e),s=!0):!this._terrain&&this.targets.has(yn)&&(this.targets.delete(yn),s=!0),s&&this.targetsUpdated.raiseEvent(),this._cachedFeatureStoreLayers.size>0&&(this._cachedFeatureStoreLayers.forEach(r=>{this.handleLayerChanged(r)}),this._cachedFeatureStoreLayers.clear())}this._activeMap=t}addLayer(t){if(v(t,String),!this.layerNames.includes(t)){this.layerNames.push(t);const e=this._layerCollection?this._layerCollection.getByKey(t):null;e&&e.active&&this.handleLayerChanged(e)}}removeLayer(t){v(t,String);const e=this.layerNames.indexOf(t);e>-1&&this.layerNames.splice(e,1),this.targets.has(t)&&(this.targets.delete(t),this.targetsUpdated.raiseEvent())}addEntity(t,e){if(v(t,String),v(e,String),!this.entities.find(s=>s.layerName===t&&s.entityId===e)){this.entities.push({layerName:t,entityId:e});const s=this._layerCollection?this._layerCollection.getByKey(t):null;s&&s.active&&this.handleLayerChanged(s)}}removeEntity(t,e){v(t,String),v(e,String);const s=this.entities.findIndex(n=>n.layerName===t&&n.entityId===e);s>-1&&this.entities.splice(s,1);const r=`${t}-${e}`;this.targets.has(r)&&(this.targets.delete(r),this.targetsUpdated.raiseEvent())}}function td(i,t){const e=C.subtract(i,t,new C);C.normalize(e,e);const s=Ke.fromPointNormal(i,e);return ti.fromPlane(s)}function j1(i){const t=[],e=i.map(s=>C.fromDegrees(...T.mercatorToWgs84(s)));for(let s=0;s<e.length-1;s++){const r=s+1,n=new C;C.cross(e[r],e[s],n),C.normalize(n,n);const a=new Ke(n,0);Number.isNaN(a.distance)||t.push(ti.fromPlane(a))}return t}function ed(i,t,e){const s=[],r=Fe.fromGeometry(i.getGeometry());let n=Number.isFinite(r.minZ)?r.minZ:0,a=Number.isFinite(r.maxZ)?r.maxZ:0;const o=i.get("olcs_extrudedHeight");o&&(a+=o,i.get("olcs_skirt")&&(n-=i.get("olcs_skirt"))),n===a&&(a+=1);const[l,h]=T.mercatorToWgs84(t[0]),c=C.fromDegrees(l,h,n),u=C.fromDegrees(l,h,a);return e.createBottomPlane&&s.push(td(c,u)),o&&e.createTopPlane&&s.push(td(u,c)),s}function $1(i){const t=[],e=i.map(n=>C.fromDegrees(...T.mercatorToWgs84(n))),s=new C;C.cross(e[0],e[1],s),C.normalize(s,s);function r(n){const a=C.add(n,s,new C),o=new C;C.cross(n,a,o),C.normalize(o,o);const l=new Ke(o,0);t.push(ti.fromPlane(l))}return r(e[0]),C.negate(s,s),r(e[1]),t}function H1(i,t={},e){v(i,Z),v(t,Object),it(e,A);const s=[],r=i.getGeometry(),n=r.getType();if(n==="Point")s.push(...ed(i,[r.getCoordinates()],t));else{const a=qi(r);if(a.length<2||a[0][0]===a[1][0]&&a[0][1]===a[1][1])return null;n==="Polygon"?(an(a),Sc(a)):n==="LineString"&&a.length===2&&t.createEndingPlanes&&s.push(...$1(a)),t.createVerticalPlanes&&s.push(...j1(a)),i.get("olcs_altitudeMode")==="absolute"&&(t.createBottomPlane||t.createTopPlane)&&s.push(...ed(i,a,t))}return e&&s.forEach(a=>{const o=Ke.transform(a,e);a.normal=o.normal,a.distance=o.distance}),t.reverse&&s.forEach(a=>{C.negate(a.normal,a.normal),a.distance*=-1}),new Qe({planes:s,unionClippingRegions:t.reverse})}function ss(i,t,e,s){v(i,Qe),v(t,Qe),t.length>0&&t.removeAll();for(let r=0;r<i.length;r++){const n=i.get(r);if(e&&s){const a=Ke.getPointDistance(n,s),o=Ke.transform(n,e);o.distance=a,t.add(ti.fromPlane(o))}else t.add(ti.clone(n))}return t.modelMatrix=i.modelMatrix.clone(),t.unionClippingRegions=i.unionClippingRegions,t.edgeColor=i.edgeColor.clone(),t.edgeWidth=i.edgeWidth,t}function rr(i){i instanceof Fn?i.model&&(i.model.clippingPlanes?i.model.clippingPlanes.getValue().removeAll():i.model.clippingPlanes=new Ff(new Qe)):i.clippingPlanes?i.clippingPlanes.removeAll():i.clippingPlanes=new Qe}function V1(i,t,e){if(rr(i),e)ss(t,i.clippingPlanes);else if(!t.modelMatrix.equals(A.IDENTITY))ss(t,i.clippingPlanes),i.clippingPlanes.modelMatrix=A.multiply(A.inverse(i.clippingPlanesOriginMatrix,i.clippingPlanes.modelMatrix),t.modelMatrix,i.clippingPlanes.modelMatrix);else{const s=A.getMatrix3(A.inverse(i.clippingPlanesOriginMatrix,new A),new Vt),r=A.fromRotationTranslation(s,new C);ss(t,i.clippingPlanes,r,i.boundingSphere.center)}}function B1(i,t){rr(i),ss(t,i.clippingPlanes)}function U1(i,t,e){if(i.model){rr(i);const s=i.model.clippingPlanes.getValue();if(ss(t,s),!e){const r=i.computeModelMatrix(nl.now());A.inverseTransformation(r,s.modelMatrix),t.modelMatrix.equals(A.IDENTITY)||A.multiply(s.modelMatrix,t.modelMatrix,s.modelMatrix)}}}function No(i,t,e){i instanceof Ms?V1(i,t,e):i instanceof Rf?B1(i,t):U1(i,t,e)}function q1(i,t,e=!1,s=25){v(i,[Number]),v(e,Boolean),v(s,Number);let r;if(e){const a=dr(i,-s,t.heading),o=dr(i,s,t.heading);r=new Pn([[a[0],a[1],i[2]],[o[0],o[1],i[2]]],Cn.XYZ)}else{r=new En([[]],Cn.XYZ);let a=2*Math.PI-Math.PI/4;const o=[...new Array(4)].map(()=>{const l=dr(i,s,a);return a-=Math.PI/2,[l[0],l[1],i[2]]});r.setCoordinates([o])}const n=new Z({geometry:r});return n.set("olcs_altitudeMode","absolute"),e&&n.set("olcs_extrudedHeight",s*2),r.transform(B.proj,F.proj),n}function W1(i,t=!1){return it(i,Z),v(t,Boolean),(i?i.getGeometry().getType()==="LineString":!1)?{createBottomPlane:!t,createTopPlane:!t,createEndingPlanes:!t,createVerticalPlanes:!0}:{createVerticalPlanes:!t,createBottomPlane:!0}}class id{static get className(){return"ClippingObjectManager"}constructor(t){this._defaultClippingObjects=new Set,this._exclusiveClippingObjects=null,this._targetsMap=new Map,this._listenersMap=new Map,this._exclusiveRemovedCb=null,this.initialized=!1,this._updateSuspended=!1,this._dirty=!1,this._layerCollection=t,this._activeMap=null,this._layerChangedListener=this._layerCollection.stateChanged.addEventListener(e=>{this._layerChanged(e)})}get suspendUpdate(){return this._updateSuspended}set suspendUpdate(t){v(t,Boolean),this._updateSuspended=t,!this._updateSuspended&&this._dirty&&(this._dirty=!1,this._update())}_layerChanged(t){this.suspendUpdate=!0,this._defaultClippingObjects.forEach(e=>{e.handleLayerChanged(t)}),this._exclusiveClippingObjects&&this._exclusiveClippingObjects.forEach(e=>{e.handleLayerChanged(t)}),this.suspendUpdate=!1}mapActivated(t){this.suspendUpdate=!0,this._defaultClippingObjects.forEach(e=>{e.handleMapChanged(t)}),this._exclusiveClippingObjects&&this._exclusiveClippingObjects.forEach(e=>{e.handleMapChanged(t)}),this.suspendUpdate=!1,this._activeMap=t}addClippingObject(t){if(v(t,Si),this.hasClippingObject(t))throw new Error("ClippingObject already managed, remove it first");t.setLayerCollection(this._layerCollection),this._defaultClippingObjects.add(t),this._activeMap instanceof G&&t.handleMapChanged(this._activeMap),this._listenersMap.set(t,[t.targetsUpdated.addEventListener(this._update.bind(this)),t.clippingPlaneUpdated.addEventListener(this._clippingPlaneUpdated.bind(this,t))]),this._update()}removeClippingObject(t){v(t,Si),this._defaultClippingObjects.has(t)&&(this._defaultClippingObjects.delete(t),this._listenersMap.get(t).forEach(e=>{e()}),this._listenersMap.delete(t),this._update())}hasClippingObject(t){return v(t,Si),this._defaultClippingObjects.has(t)||!!(this._exclusiveClippingObjects&&this._exclusiveClippingObjects.includes(t))}setExclusiveClippingObjects(t,e){if(v(t,[Si]),v(e,Function),t.find(s=>this._defaultClippingObjects.has(s)))throw new Error("Some ClippingObjects are already managed, remove them first");this._clearExclusiveClippingObjects(),this._exclusiveRemovedCb=e,this._exclusiveClippingObjects=t,this._exclusiveClippingObjects.forEach(s=>{s.setLayerCollection(this._layerCollection),this._activeMap instanceof G&&s.handleMapChanged(this._activeMap),this._listenersMap.set(s,[s.targetsUpdated.addEventListener(this._update.bind(this)),s.clippingPlaneUpdated.addEventListener(this._clippingPlaneUpdated.bind(this,s))])}),this._update()}_clearExclusiveClippingObjects(t){this._exclusiveClippingObjects&&(this._exclusiveClippingObjects.forEach(e=>{this._listenersMap.get(e).forEach(s=>{s()}),this._listenersMap.delete(e)}),this._exclusiveClippingObjects=null),!t&&this._exclusiveRemovedCb&&this._exclusiveRemovedCb(),this._exclusiveRemovedCb=null}clearExclusiveClippingObjects(t){this._clearExclusiveClippingObjects(t),this._update()}_update(){if(this._updateSuspended){this._dirty=!0;return}const t=new Set(this._targetsMap.keys()),e=s=>{s.targets.forEach(r=>{this._targetsMap.set(r,s),t.delete(r)})};this._targetsMap.clear(),this._defaultClippingObjects.forEach(e),this._exclusiveClippingObjects&&this._exclusiveClippingObjects.forEach(e),t.forEach(s=>{rr(s)}),this._targetsMap.forEach((s,r)=>{s.clippingPlaneCollection&&No(r,s.clippingPlaneCollection,s.local)})}_clippingPlaneUpdated(t){this._targetsMap.forEach((e,s)=>{e===t&&t.clippingPlaneCollection&&No(s,t.clippingPlaneCollection)})}destroy(){this._listenersMap.forEach(t=>{t.forEach(e=>{e()})}),this._layerChangedListener(),this._listenersMap.clear(),this._targetsMap.clear(),this._defaultClippingObjects.clear(),this._exclusiveClippingObjects=null}}function Y1(i,t){return new Intl.DateTimeFormat(t,{dateStyle:"short"}).format(i)}function X1(i,t){return new Intl.DateTimeFormat(t,{timeStyle:"short"}).format(i)}function Z1(i){const t=i.getMonth()+1,e=i.getDate();return`${i.getFullYear()}-${t>9?"":0}${t}-${e>9?"":0}${e}`}function J1(i){const t=new Date(i.getFullYear(),0,0),e=i-t+(t.getTimezoneOffset()-i.getTimezoneOffset())*60*1e3,s=1e3*60*60*24;return Math.floor(e/s)}function K1(i){const t=i.getFullYear();return t%4!==0?!1:t%100!==0?!0:t%400===0}class Do{constructor(t){this._position=.5,this.scene=null,this.olMap=null,this.initialized=!1,this.leftScreenClippingObject=new Si,this.rightScreenClippingObject=new Si,this._cameraListener=null,this.originalCameraPercentageChanged=null,this._targetsChangedListeners=[],this._targetsChangedListeners=[this.rightScreenClippingObject.targetsUpdated.addEventListener(()=>{this._targetsChanged()}),this.leftScreenClippingObject.targetsUpdated.addEventListener(()=>{this._targetsChanged()})],this._clippingObjectManager=t,this._clippingObjectManager.addClippingObject(this.rightScreenClippingObject),this._clippingObjectManager.addClippingObject(this.leftScreenClippingObject)}get position(){return this._position}set position(t){if(v(t,Number),t<0||t>1)throw new Error("Position must be between 0 and 1");Math.abs(this._position-t)>1e-4&&this._updatePosition(t)}_targetsChanged(){if(this.scene){const t=this.rightScreenClippingObject.targets.size+this.leftScreenClippingObject.targets.size,{camera:e}=this.scene;this._cameraListener&&t===0?(this._cameraListener(),this._cameraListener=null,e.percentageChanged=this.originalCameraPercentageChanged):!this._cameraListener&&t>0&&(this.originalCameraPercentageChanged=e.percentageChanged,e.percentageChanged=0,this._cameraListener=e.changed.addEventListener(this._updateClippingPlanes.bind(this)),this._updateClippingPlanes())}}_updatePosition(t){this._position=t,this.scene?(this.scene.imagerySplitPosition=t,this._updateClippingPlanes()):this.olMap&&this.olMap.render()}mapActivated(t){t instanceof G?(this.scene=t.getScene(),this.olMap=null,this._targetsChanged()):t instanceof tt&&(this.scene=null,this.olMap=t.olMap),this._updatePosition(this.position)}_calcClippingPlane(){const{camera:t}=this.scene,{fov:e,near:s}=t.frustum,r=this.scene.canvas.width||1,n=this.scene.canvas.height||1;let a;n>r?a=s*Math.tan(.5*e)*2/n:a=s*Math.tan(.5*e)*2/r;const o=r*this.position-r/2,l=n/2,h=new C(a*o,a*l,-1*s),c=new C(a*o,-1*a*l,-1*s);A.multiplyByPoint(t.inverseViewMatrix,h,h),A.multiplyByPoint(t.inverseViewMatrix,c,c);const u=t.positionWC;C.subtract(u,h,h),C.subtract(u,c,c);const d=C.cross(h,c,new C);C.normalize(d,d);const f=Ke.fromPointNormal(u,d);return ti.fromPlane(f)}_updateClippingPlanes(){const t=this._calcClippingPlane();this.leftScreenClippingObject.clippingPlaneCollection=new Qe({planes:[t]});const e=ti.clone(t);e.normal=C.negate(e.normal,e.normal),e.distance*=-1,this.rightScreenClippingObject.clippingPlaneCollection=new Qe({planes:[e]})}getClippingObjectForDirection(t){return v(t,[X.LEFT,X.RIGHT,X.NONE]),t===X.LEFT?this.leftScreenClippingObject:t===X.RIGHT?this.rightScreenClippingObject:null}destroy(){this._clippingObjectManager&&(this._clippingObjectManager.removeClippingObject(this.rightScreenClippingObject),this._clippingObjectManager.removeClippingObject(this.leftScreenClippingObject)),this._targetsChangedListeners.forEach(t=>{t()}),this._targetsChangedListeners=[],this._clippingObjectManager=null,this._cameraListener&&(this._cameraListener(),this._cameraListener=null)}}async function Q1(i,t){const e=i.getViewPointSync(),s=e.clone();s.heading=0,s.pitch=-90,e&&!e.equals(s)&&(t.fixedNorthOrientation&&(e.heading=0),e.pitch=-90,e.animate=!0,e.duration=1,e.groundPosition&&(e.cameraPosition=null),await i.gotoViewPoint(e))}class Mn extends ve{static from(t){const e=new Mn;if(t)for(const s of t)e.add(s);return e}constructor(){super();this._activeMap=null,this._target=null,this._cachedViewpoint=null,this.eventHandler=new Tu,this._layerCollection=new Te,this.initializeError=new R,this.fallbackMapActivated=new R,this.mapActivated=new R,this.clippingObjectManager=new id(this._layerCollection),this._splitScreen=new Do(this.clippingObjectManager),this._mapPointerListeners=[]}get activeMap(){return this._activeMap}get target(){return this._target}get layerCollection(){return this._layerCollection}set layerCollection(t){v(t,Te),this._layerCollection=t,this._array.forEach(e=>{e.layerCollection=this._layerCollection})}get splitScreen(){return this._splitScreen}set splitScreen(t){v(t,Do),this._splitScreen=t,this._array.forEach(e=>{e.splitScreen=this._splitScreen})}add(t){const e=super.add(t);return e!==null&&(this._mapPointerListeners.push(t.pointerInteractionEvent.addEventListener(this.eventHandler.handleMapEvent.bind(this.eventHandler))),t.layerCollection=this._layerCollection,t.splitScreen=this._splitScreen,t.setTarget(this._target)),e}_remove(t){if(this._activeMap===t){if(this._cachedViewpoint=t.getViewPointSync(),this._target){const e=this._activeMap.className.split(".").pop();this._target.classList.remove(e)}this._activeMap=null}return this.has(t)&&(t.setTarget(null),t.splitScreen=null,t.layerCollection=new Te),super._remove(t)}_setActiveMapCSSClass(){if(this._target&&this._activeMap){const t=this._activeMap.className.split(".").pop();this._target.classList.add(t)}}setTarget(t){it(t,[String,HTMLElement]),this._target=typeof t=="string"?document.getElementById(t):t,this._array.forEach(e=>{e.setTarget(this._target)}),this._setActiveMapCSSClass()}_getFallbackMap(t){const{fallbackMap:e}=t;if(e){const s=this.getByKey(e);if(s&&s!==t)return s;Pt().warning(`the fallback map with the name: ${e} is missconfigured`)}return null}_getFallbackMapOrDefault(t){return this._getFallbackMap(t)||this.getByType("OpenlayersMap")[0]||this._array[0]}async setActiveMap(t){const e=this.getByKey(t);if(!e)return Pt("MapCollection").warning(`could not find map with name ${t}`),Promise.resolve();this._activeMap&&this._activeMap.className==="CesiumMap"&&e.className==="OpenlayersMap"&&await Q1(this._activeMap,e);try{await e.initialize()}catch(r){Pt("MapCollection").error(r),this.remove(e);const n=this._getFallbackMapOrDefault(e);if(this.initializeError.raiseEvent({map:e,error:r}),n)return this.fallbackMapActivated.raiseEvent(e),this.setActiveMap(n.name);throw new Error("cannot activate a single map")}let s;if(this._activeMap||this._cachedViewpoint){if(this._activeMap===e)return e.activate();if(s=this._activeMap?await this._activeMap.getViewPoint():this._cachedViewpoint,!await e.canShowViewpoint(s)){const n=this._getFallbackMap(e);if(n)return this.fallbackMapActivated.raiseEvent(e),this.setActiveMap(n.name)}if(this._cachedViewpoint=null,this._activeMap&&(this._activeMap.deactivate(),this._target)){const n=this._activeMap.className.split(".").pop();this._target.classList.remove(n)}}return this._activeMap=e,await this._activeMap.activate(),this._setActiveMapCSSClass(),s&&await this._activeMap.gotoViewPoint(s),this.clippingObjectManager.mapActivated(e),this._splitScreen.mapActivated(e),this.mapActivated.raiseEvent(e),Promise.resolve()}getByType(t){return this._array.filter(e=>e.className===t)}destroy(){super.destroy(),[...this._layerCollection].forEach(t=>{t.destroy()}),this._layerCollection.destroy(),this.eventHandler.destroy(),this.mapActivated.destroy(),this.clippingObjectManager.destroy(),this.clippingObjectManager=null,this._splitScreen.destroy(),this._splitScreen=null,this.fallbackMapActivated.destroy(),this.initializeError.destroy(),this._mapPointerListeners.forEach(t=>{t()}),this._mapPointerListeners=[],this._target=null}}function vn(){return Pt("init")}const _n=new Map;class tS{constructor(){this._id=Xt(),this._defaultDynamicContext=new xo({id:"_defaultDynamicContext"}),this._dynamicContext=this._defaultDynamicContext;const t=()=>this._dynamicContext.id;this._mapClassRegistry=new fe(ri),this._maps=ni(new Mn,t,null,ma.bind(null,this),Ee),this._layerClassRegistry=new fe(ot),this._layers=ni(this._maps.layerCollection,t,uh.bind(null,this),pa.bind(null,this),ht,dh),this._obliqueCollections=ni(new ve,t,null,e=>new Ne(e),Ne),this._viewPoints=ni(new ve,t,null,ch,oe),this._styleClassRegistry=new fe(Gi),this._styles=ni(new ve,t,null,ge.bind(null,this._styleClassRegistry),ne),this._contexts=new Mi("id"),this._contexts.add(this._dynamicContext),this._categoryClassRegisty=new fe(Gr),this._categories=new xu(this),this._destroyed=new R,this._contextMutationPromise=Promise.resolve(),this._categoryItemClassRegistry=new fe(new be),this._tileProviderClassRegsitry=new fe(si),this._featureProviderClassRegsitry=new fe(Ar),_n.set(this._id,this)}get id(){return this._id}get maps(){return this._maps}get layers(){return this._layers}get obliqueCollections(){return this._obliqueCollections}get viewPoints(){return this._viewPoints}get styles(){return this._styles}get categories(){return this._categories}get destroyed(){return this._destroyed}get contextAdded(){return this._contexts.added}get contextRemoved(){return this._contexts.removed}get dynamicContextId(){return this._dynamicContext.id}get mapClassRegistry(){return this._mapClassRegistry}get layerClassRegistry(){return this._layerClassRegistry}get styleClassRegistry(){return this._styleClassRegistry}get categoryClassRegistry(){return this._categoryClassRegisty}get categoryItemClassRegistry(){return this._categoryItemClassRegistry}get tileProviderClassRegistry(){return this._tileProviderClassRegsitry}get featureProviderClassRegistry(){return this._featureProviderClassRegsitry}getContextById(t){return this._contexts.getByKey(t)}async _parseContext(t){const{config:e}=t;e.projection&&oh(e.projection),await this._styles.parseItems(e.styles,t.id),await this._layers.parseItems(e.layers,t.id),await this._obliqueCollections.parseItems(e.obliqueCollections,t.id),await this._viewPoints.parseItems(e.viewpoints,t.id),await this._maps.parseItems(e.maps,t.id),Array.isArray(e.categories)&&await Promise.all(e.categories.map(async({name:s,items:r})=>{await this._categories.parseCategoryItems(s,r,t.id)}))}async _setContextState(t){const{config:e}=t;[...this._layers].filter(r=>r[Lt]===t.id).forEach(r=>{r.activeOnStartup&&r.activate().catch(n=>{vn().error(`Failed to activate active on startup layer ${r.name}`),vn().error(n),this._layers.remove(r),r.destroy()})});const s=[...this._obliqueCollections].find(r=>r[Lt]===t.id&&r.activeOnStartup);if(s&&[...this._maps].filter(r=>r instanceof ae).forEach(r=>{r.setCollection(s)}),e.startingMapName?await this._maps.setActiveMap(e.startingMapName):!this._maps.activeMap&&this._maps.size>0&&await this._maps.setActiveMap([...this._maps][0].name),e.startingViewPointName&&this._maps.activeMap){const r=this._viewPoints.getByKey(e.startingViewPointName);r&&await this._maps.activeMap.gotoViewPoint(r)}}addContext(t){return v(t,xo),this._contextMutationPromise=this._contextMutationPromise.then(async()=>{if(this._contexts.has(t)){vn().info(`context with id ${t.id} already loaded`);return}await this._parseContext(t),await this._setContextState(t),this._contexts.add(t)}),this._contextMutationPromise}async _removeContext(t){await Promise.all([this._maps.removeContext(t),this._layers.removeContext(t),this._viewPoints.removeContext(t),this._styles.removeContext(t),this._obliqueCollections.removeContext(t)])}removeContext(t){return this._contextMutationPromise=this._contextMutationPromise.then(async()=>{const e=this._contexts.getByKey(t);if(!e){vn().info(`context with id ${t} has alread been removed`);return}await this._removeContext(t),this._contexts.remove(e)}),this._contextMutationPromise}destroy(){Object.defineProperty(this,"_contextMutationPromise",{get(){throw new Error("VcsApp was destroyed")}}),_n.delete(this._id),me(this._maps),me(this._layers),me(this._obliqueCollections),me(this._viewPoints),me(this._styles),me(this._contexts),me(this._categories),this._mapClassRegistry.destroy(),this._layerClassRegistry.destroy(),this._styleClassRegistry.destroy(),this._categoryClassRegisty.destroy(),this._categoryItemClassRegistry.destroy(),this._tileProviderClassRegsitry.destroy(),this._featureProviderClassRegsitry.destroy(),this.destroyed.raiseEvent(),this.destroyed.destroy()}}function eS(i){return _n.get(i)}window.vcs=window.vcs||{},window.vcs.apps=_n;export{wi as AbstractFeatureProvider,vi as AbstractInteraction,hi as AltitudeModeCesium,wo as AppBackedCategory,Us as BaseOLMap,kt as BitCounter,rs as CameraLimiter,dn as CameraLimiterMode,De as Category,xu as CategoryCollection,G as CesiumMap,We as CesiumTilesetCesiumImpl,Se as CesiumTilesetLayer,be as ClassRegistry,ci as ClassificationTypeCesium,Si as ClippingObject,id as ClippingObjectManager,T1 as ClusterContext,ve as Collection,xo as Context,Sn as CoordinateAtPixel,nr as CzmlLayer,Nu as DataSourceCesiumImpl,Ci as DataSourceLayer,at as DataState,Mt as DeclarativeStyleItem,uu as DefaultObliqueCollection,Tu as EventHandler,k as EventType,Lh as ExclusiveManager,pt as Extent,Fe as Extent3D,Iu as FeatureAtPixelInteraction,_e as FeatureLayer,Lu as FeatureProviderInteraction,ns as FeatureStoreLayer,Uu as FeatureStoreLayerChanges,yi as FeatureStoreLayerState,Ur as FeatureVisibility,W as FeatureVisibilityAction,as as GeoJSONLayer,qr as GlobalHider,Mi as IndexedCollection,Eu as InteractionChain,ht as Layer,Te as LayerCollection,Ue as LayerImplementation,Zc as LayerObliqueImpl,qs as LayerOpenlayersImpl,K as LayerState,lr as MVTTileProvider,Mn as MapCollection,Jt as MapState,lt as ModificationKeyType,Ne as ObliqueCollection,fo as ObliqueDataSet,hn as ObliqueImage,Zs as ObliqueImageMeta,ae as ObliqueMap,fu as ObliqueProvider,eu as ObliqueView,ut as ObliqueViewDirection,xa as OlcsGeometryType,Du as OpenStreetMapCesiumImpl,os as OpenStreetMapLayer,qu as OpenStreetMapOpenlayersImpl,tt as OpenlayersMap,fe as OverrideClassRegistry,Sa as PatternType,ls as PointCloudLayer,zt as PointerEventType,mt as PointerKeyType,T as Projection,jt as RasterLayer,_i as RasterLayerCesiumImpl,is as RasterLayerOpenlayersImpl,Fu as SingleImageCesiumImpl,ar as SingleImageLayer,Wu as SingleImageOpenlayersImpl,Do as SplitScreen,hr as StaticGeoJSONTileProvider,ne as StyleItem,cs as TMSLayer,Ru as TerrainCesiumImpl,hs as TerrainLayer,R1 as TileDebugOpenlayersImpl,Wt as TileProvider,gn as TileProviderFeatureProvider,Le as TilingScheme,Gu as TmsCesiumImpl,Yu as TmsOpenlayersImpl,or as URLTemplateTileProvider,tS as VcsApp,R as VcsEvent,Ee as VcsMap,re as VcsObject,$c as VectorCesiumImpl,jc as VectorContext,Ct as VectorLayer,lo as VectorObliqueImpl,Ya as VectorOpenlayersImpl,te as VectorProperties,$u as VectorRasterTileCesiumImpl,q as VectorStyleItem,ju as VectorTileImageryProvider,us as VectorTileLayer,Xu as VectorTileOpenlayersImpl,oe as ViewPoint,Lo as WFSLayer,Ye as WMSFeatureProvider,ds as WMSLayer,fs as WMTSLayer,Hu as WmsCesiumImpl,Zu as WmsOpenlayersImpl,Vu as WmtsCesiumImpl,Ju as WmtsOpenlayersImpl,Hs as actuallyIsCircle,Xi as addPrimitiveToContext,tn as addPrimitivesToContext,Ve as alreadyTransformedToImage,Oh as alreadyTransformedToMercator,Rr as angleEqualsEpsilon,Hr as blackColor,Au as calculateMinLevel,ke as cartesian2DDistance,gl as cartesian3DDistance,Gr as categoryClassRegistry,Pe as cesiumColorToColor,qe as cesiumTilesetLastUpdated,ro as checkLineIntersection,Va as circleFromCenterRadius,Ic as circleToCesium,rr as clearClippingPlanes,A0 as colorInCanvas,yh as combineFont,Lt as contextIdSymbol,kc as convert,Ba as convertGeometryToPolygon,zf as coordinateAtDistance,ga as coordinateEqualsEpsilon,ss as copyClippingPlanesToCollection,Dh as createClassificationPrimitive,q1 as createClippingFeature,H1 as createClippingPlaneCollection,Ta as createLinePrimitive,Rh as createOutlinePrimitive,ph as createPattern,Fh as createPrimitive,Eh as defaultDeclarativeStyle,j0 as defaultExtrudedHeightCondition,Ku as defaultPointCloudStyle,oi as defaultVectorStyle,pa as deserializeLayer,ma as deserializeMap,ch as deserializeViewPoint,me as destroyCollection,fh as detectBrowserLocale,Ea as doNotTransform,Ia as embedIconsInStyle,k0 as emptyColor,$r as emptyStyle,an as enforceEndingVertex,Sc as enforceRightHand,ki as featureExists,pn as featureFromOptions,Ar as featureProviderClassRegistry,Qt as featureStoreStateSymbol,Ch as fromCesiumColor,gi as fvLastUpdated,Vs as getAltitudeModeOptions,Nc as getBillboardOptions,zu as getCanvasFromFeatures,Ac as getCartesian3AndWGS84FromCoordinates,Kr as getCartesian3Options,ai as getCesiumColor,Zr as getClassificationTypeOptions,W1 as getClippingOptions,G0 as getCssStyleFromTextStyle,_a as getCurrentLocale,J1 as getDayOfYear,Q as getDefaultCondition,lh as getDefaultProjection,Ca as getDefaultVectorStyleItemOptions,Q_ as getDirectionName,_u as getEPSGCodeFromGeojson,Oo as getExtentFromTileset,jr as getFillOptions,qi as getFlatCoordinatesFromGeometry,Ha as getFlatCoordinatesFromSimpleGeometry,Pu as getFormat,Wa as getGenericFeatureFromClickedObject,P1 as getGenericFeatureFromProvidedFeature,Gh as getHeightAboveGround,pi as getHeightFromTerrainProvider,Qr as getHeightInfo,Z1 as getISODateString,Bu as getJSONObjectFromObject,Dc as getLabelOptions,dh as getLayerIndex,va as getLocaleChangedEvent,qc as getLongestSide,Nh as getMaterialAppearance,Ah as getMinHeightOrGroundLevel,Fc as getModelOptions,Jr as getNearFarValueOptions,ge as getObjectFromClassRegistry,ao as getPolygonizedGeometry,no as getResolutionOptions,wa as getShapeFromOptions,Y1 as getShortLocaleDate,X1 as getShortLocaleTime,Js as getStateFromStatesArray,Na as getStoreyHeights,Fa as getStoreyOptions,Rt as getStringColor,js as getStrokeOptions,Bs as getStyleOrDefaultStyle,Ys as getStylesArray,Ji as getTerrainProviderForUrl,_h as getTextFromOptions,vh as getTextOptions,Po as getTilingScheme,Io as getURL,eS as getVcsAppById,ho as getVersionFromImageJson,_o as getViewDirectionFromViewPoint,bo as getWMSSource,Wc as getZoom,Gt as globalHidden,Wi as globalHiderLastUpdated,k1 as globeLoaded,Uc as hasSameOrigin,mh as hexToOlColor,At as hidden,Nt as highlighted,Xc as imageGeometryToMercatorGeometry,jf as initialBearingBetweenCoords,K1 as isLeapYear,sr as isMobile,kr as isOverrideCollection,bu as isProvidedFeature,er as isSameOrigin,Hc as isTerrainTileAvailable,Eo as isTiledFeature,ot as layerClassRegistry,Qa as lineStringToCesium,ni as makeOverrideCollection,ri as mapClassRegistry,Yc as mercatorGeometryToImageGeometry,F as mercatorProjection,ir as mercatorResolutionsToLevel,ca as mercatorToWgs84Transformer,Wr as obliqueGeometry,ln as obliqueViewDirectionNames,D0 as olColorToCesiumColor,Ma as olColorToHex,Be as originalFeatureSymbol,pe as originalStyle,Xr as parseCartesian3,bt as parseColor,R0 as parseFont,Ie as parseGeoJSON,co as parseImageData,Kc as parseImageMeta,Qc as parseLegacyImageData,Yr as parseNearFarScalar,ui as parseStoreyHeights,to as pointToCesium,Za as polygonToCesium,fa as propertyEqualsEpsilon,mn as rectangleToExtent,mi as removeArrayFromCollection,Ua as removeEndingVertex,qa as removeEndingVertexFromGeometry,Yi as removeFeatureFromMap,tu as requestArrayBuffer,ye as requestJson,uo as requestUrl,uh as serializeLayer,No as setClippingPlanes,T0 as setCurrentLocale,oh as setDefaultProjectionOptions,oo as setNewGeometry,zc as setReferenceForPicking,Sh as shapeCategory,Ou as showProvidedFeature,so as sortRealWordEdgeCoordinates,Gi as styleClassRegistry,bh as synchronizeFeatureVisibility,on as synchronizeFeatureVisibilityWithSource,si as tileProviderClassRegistry,G1 as tiledLayerLoaded,ku as toContext,Vc as transformCWIFC,Ki as transformFromImage,t1 as transformToImage,Mc as updateFeatureVisibility,Cc as updateGlobalHider,Su as updateLegacyFeature,Ec as validateCircle,F0 as validateHexColor,Tc as validateLineString,Rc as validatePoint,bc as validatePolygon,Da as validateStoreys,z as vcsLayerName,Pa as vcsMetaVersion,Tt as vectorStyleSymbol,B as wgs84Projection,ks as wgs84ToMercatorTransformer,$s as whiteColor,C1 as writeGeoJSON,es as writeGeoJSONFeature,Ih as writeStyle};