streamlit 1.51.0__py3-none-any.whl → 1.52.0__py3-none-any.whl

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 (314) hide show
  1. streamlit/__init__.py +1 -0
  2. streamlit/commands/execution_control.py +89 -14
  3. streamlit/components/v1/component_arrow.py +7 -7
  4. streamlit/components/v2/__init__.py +59 -3
  5. streamlit/components/v2/bidi_component/main.py +161 -13
  6. streamlit/components/v2/bidi_component/serialization.py +13 -6
  7. streamlit/components/v2/component_manager.py +11 -3
  8. streamlit/components/v2/component_registry.py +18 -1
  9. streamlit/components/v2/types.py +2 -2
  10. streamlit/connections/snowflake_connection.py +1 -1
  11. streamlit/connections/snowpark_connection.py +1 -1
  12. streamlit/dataframe_util.py +18 -18
  13. streamlit/delta_generator.py +7 -0
  14. streamlit/delta_generator_singletons.py +8 -14
  15. streamlit/elements/alert.py +16 -0
  16. streamlit/elements/arrow.py +36 -6
  17. streamlit/elements/bokeh_chart.py +10 -78
  18. streamlit/elements/code.py +2 -2
  19. streamlit/elements/deck_gl_json_chart.py +1 -1
  20. streamlit/elements/exception.py +1 -1
  21. streamlit/elements/form.py +27 -0
  22. streamlit/elements/heading.py +60 -5
  23. streamlit/elements/html.py +13 -2
  24. streamlit/elements/image.py +1 -1
  25. streamlit/elements/layouts.py +28 -22
  26. streamlit/elements/lib/built_in_chart_utils.py +49 -16
  27. streamlit/elements/lib/color_util.py +1 -1
  28. streamlit/elements/lib/column_config_utils.py +6 -5
  29. streamlit/elements/lib/layout_utils.py +50 -0
  30. streamlit/elements/lib/pandas_styler_utils.py +17 -9
  31. streamlit/elements/lib/shortcut_utils.py +152 -0
  32. streamlit/elements/markdown.py +50 -3
  33. streamlit/elements/metric.py +31 -1
  34. streamlit/elements/plotly_chart.py +75 -6
  35. streamlit/elements/spinner.py +1 -1
  36. streamlit/elements/text.py +20 -3
  37. streamlit/elements/toast.py +2 -0
  38. streamlit/elements/vega_charts.py +17 -1
  39. streamlit/elements/widgets/audio_input.py +8 -7
  40. streamlit/elements/widgets/button.py +279 -40
  41. streamlit/elements/widgets/button_group.py +27 -2
  42. streamlit/elements/widgets/camera_input.py +1 -1
  43. streamlit/elements/widgets/chat.py +300 -42
  44. streamlit/elements/widgets/color_picker.py +7 -0
  45. streamlit/elements/widgets/data_editor.py +68 -28
  46. streamlit/elements/widgets/file_uploader.py +4 -1
  47. streamlit/elements/widgets/number_input.py +2 -0
  48. streamlit/elements/widgets/text_widgets.py +2 -0
  49. streamlit/elements/widgets/time_widgets.py +581 -9
  50. streamlit/errors.py +22 -0
  51. streamlit/git_util.py +1 -1
  52. streamlit/navigation/page.py +7 -0
  53. streamlit/net_util.py +2 -2
  54. streamlit/proto/Alert_pb2.pyi +3 -3
  55. streamlit/proto/AppPage_pb2.pyi +7 -1
  56. streamlit/proto/ArrowData_pb2.pyi +7 -1
  57. streamlit/proto/ArrowNamedDataSet_pb2.pyi +7 -1
  58. streamlit/proto/ArrowVegaLiteChart_pb2.pyi +7 -1
  59. streamlit/proto/Arrow_pb2.py +10 -10
  60. streamlit/proto/Arrow_pb2.pyi +19 -12
  61. streamlit/proto/AudioInput_pb2.pyi +7 -1
  62. streamlit/proto/Audio_pb2.pyi +7 -1
  63. streamlit/proto/AuthRedirect_pb2.pyi +7 -1
  64. streamlit/proto/AutoRerun_pb2.pyi +7 -1
  65. streamlit/proto/BackMsg_pb2.py +4 -2
  66. streamlit/proto/BackMsg_pb2.pyi +34 -4
  67. streamlit/proto/Balloons_pb2.pyi +7 -1
  68. streamlit/proto/BidiComponent_pb2.pyi +10 -4
  69. streamlit/proto/Block_pb2.pyi +35 -35
  70. streamlit/proto/BokehChart_pb2.pyi +7 -1
  71. streamlit/proto/ButtonGroup_pb2.pyi +9 -9
  72. streamlit/proto/Button_pb2.py +2 -2
  73. streamlit/proto/Button_pb2.pyi +11 -2
  74. streamlit/proto/CameraInput_pb2.pyi +7 -1
  75. streamlit/proto/ChatInput_pb2.py +6 -6
  76. streamlit/proto/ChatInput_pb2.pyi +18 -6
  77. streamlit/proto/Checkbox_pb2.pyi +3 -3
  78. streamlit/proto/ClientState_pb2.pyi +10 -4
  79. streamlit/proto/Code_pb2.pyi +7 -1
  80. streamlit/proto/ColorPicker_pb2.pyi +7 -1
  81. streamlit/proto/Common_pb2.py +3 -3
  82. streamlit/proto/Common_pb2.pyi +35 -23
  83. streamlit/proto/Components_pb2.pyi +19 -13
  84. streamlit/proto/DataFrame_pb2.pyi +55 -49
  85. streamlit/proto/DateInput_pb2.pyi +7 -1
  86. streamlit/proto/DateTimeInput_pb2.py +28 -0
  87. streamlit/proto/DateTimeInput_pb2.pyi +92 -0
  88. streamlit/proto/DeckGlJsonChart_pb2.pyi +3 -3
  89. streamlit/proto/Delta_pb2.pyi +7 -1
  90. streamlit/proto/DocString_pb2.pyi +10 -4
  91. streamlit/proto/DownloadButton_pb2.py +2 -2
  92. streamlit/proto/DownloadButton_pb2.pyi +16 -2
  93. streamlit/proto/Element_pb2.py +5 -3
  94. streamlit/proto/Element_pb2.pyi +23 -5
  95. streamlit/proto/Empty_pb2.pyi +7 -1
  96. streamlit/proto/Exception_pb2.pyi +7 -1
  97. streamlit/proto/Favicon_pb2.pyi +7 -1
  98. streamlit/proto/FileUploader_pb2.pyi +7 -1
  99. streamlit/proto/ForwardMsg_pb2.py +12 -10
  100. streamlit/proto/ForwardMsg_pb2.pyi +42 -15
  101. streamlit/proto/GapSize_pb2.pyi +4 -4
  102. streamlit/proto/GitInfo_pb2.pyi +3 -3
  103. streamlit/proto/GraphVizChart_pb2.pyi +7 -1
  104. streamlit/proto/Heading_pb2.pyi +7 -1
  105. streamlit/proto/HeightConfig_pb2.pyi +7 -1
  106. streamlit/proto/Html_pb2.py +2 -2
  107. streamlit/proto/Html_pb2.pyi +11 -2
  108. streamlit/proto/IFrame_pb2.pyi +7 -1
  109. streamlit/proto/Image_pb2.pyi +10 -4
  110. streamlit/proto/Json_pb2.pyi +7 -1
  111. streamlit/proto/LabelVisibilityMessage_pb2.pyi +3 -3
  112. streamlit/proto/LinkButton_pb2.py +2 -2
  113. streamlit/proto/LinkButton_pb2.pyi +15 -2
  114. streamlit/proto/Logo_pb2.pyi +7 -1
  115. streamlit/proto/Markdown_pb2.pyi +3 -3
  116. streamlit/proto/Metric_pb2.pyi +7 -7
  117. streamlit/proto/MetricsEvent_pb2.pyi +10 -4
  118. streamlit/proto/MultiSelect_pb2.pyi +7 -1
  119. streamlit/proto/NamedDataSet_pb2.pyi +7 -1
  120. streamlit/proto/Navigation_pb2.pyi +3 -3
  121. streamlit/proto/NewSession_pb2.pyi +40 -40
  122. streamlit/proto/NumberInput_pb2.pyi +3 -3
  123. streamlit/proto/PageConfig_pb2.pyi +7 -7
  124. streamlit/proto/PageInfo_pb2.pyi +7 -1
  125. streamlit/proto/PageLink_pb2.py +2 -2
  126. streamlit/proto/PageLink_pb2.pyi +11 -2
  127. streamlit/proto/PageNotFound_pb2.pyi +7 -1
  128. streamlit/proto/PageProfile_pb2.pyi +13 -7
  129. streamlit/proto/PagesChanged_pb2.pyi +7 -1
  130. streamlit/proto/ParentMessage_pb2.pyi +7 -1
  131. streamlit/proto/PlotlyChart_pb2.pyi +6 -6
  132. streamlit/proto/Progress_pb2.pyi +7 -1
  133. streamlit/proto/Radio_pb2.pyi +7 -1
  134. streamlit/proto/RootContainer_pb2.pyi +1 -1
  135. streamlit/proto/Selectbox_pb2.pyi +7 -1
  136. streamlit/proto/SessionEvent_pb2.pyi +7 -1
  137. streamlit/proto/SessionStatus_pb2.pyi +7 -1
  138. streamlit/proto/Skeleton_pb2.pyi +3 -3
  139. streamlit/proto/Slider_pb2.pyi +5 -5
  140. streamlit/proto/Snow_pb2.pyi +7 -1
  141. streamlit/proto/Space_pb2.pyi +7 -1
  142. streamlit/proto/Spinner_pb2.pyi +7 -1
  143. streamlit/proto/TextAlignmentConfig_pb2.py +29 -0
  144. streamlit/proto/TextAlignmentConfig_pb2.pyi +68 -0
  145. streamlit/proto/TextArea_pb2.pyi +7 -1
  146. streamlit/proto/TextInput_pb2.pyi +3 -3
  147. streamlit/proto/Text_pb2.pyi +7 -1
  148. streamlit/proto/TimeInput_pb2.pyi +7 -1
  149. streamlit/proto/Toast_pb2.pyi +7 -1
  150. streamlit/proto/VegaLiteChart_pb2.pyi +7 -1
  151. streamlit/proto/Video_pb2.pyi +6 -6
  152. streamlit/proto/WidgetStates_pb2.pyi +10 -4
  153. streamlit/proto/WidthConfig_pb2.pyi +7 -1
  154. streamlit/proto/openmetrics_data_model_pb2.pyi +52 -52
  155. streamlit/runtime/app_session.py +38 -1
  156. streamlit/runtime/caching/cache_data_api.py +1 -1
  157. streamlit/runtime/caching/cache_resource_api.py +2 -2
  158. streamlit/runtime/caching/cache_utils.py +1 -1
  159. streamlit/runtime/caching/hashing.py +1 -1
  160. streamlit/runtime/download_data_util.py +53 -0
  161. streamlit/runtime/forward_msg_queue.py +1 -0
  162. streamlit/runtime/media_file_manager.py +178 -2
  163. streamlit/runtime/metrics_util.py +87 -3
  164. streamlit/runtime/scriptrunner/script_runner.py +3 -1
  165. streamlit/runtime/state/query_params.py +80 -29
  166. streamlit/runtime/state/session_state.py +2 -2
  167. streamlit/static/index.html +1 -1
  168. streamlit/static/manifest.json +530 -229
  169. streamlit/static/static/js/{ErrorOutline.esm.YoJdlW1p.js → ErrorOutline.esm.ZJDbmVTx.js} +1 -1
  170. streamlit/static/static/js/{FileDownload.esm.Ddx8VEYy.js → FileDownload.esm.Dx0vI3vH.js} +1 -1
  171. streamlit/static/static/js/{FileHelper.90EtOmj9.js → FileHelper.B7Ero7qQ.js} +3 -3
  172. streamlit/static/static/js/{FormClearHelper.BB1Km6eP.js → FormClearHelper.CG2XN1_g.js} +1 -1
  173. streamlit/static/static/js/IFrameUtil.DefezniK.js +1 -0
  174. streamlit/static/static/js/InputInstructions.Cj5-1zf6.js +1 -0
  175. streamlit/static/static/js/Particles.BfWfv0Aw.js +1 -0
  176. streamlit/static/static/js/{ProgressBar.DLY8H6nE.js → ProgressBar.CGQ8OgfO.js} +2 -2
  177. streamlit/static/static/js/StreamlitSyntaxHighlighter.DTKLpwhl.js +20 -0
  178. streamlit/static/static/js/{Toolbar.D8nHCkuz.js → Toolbar.B2qFUmd9.js} +1 -1
  179. streamlit/static/static/js/_arrayIncludes.B19Iyn2B.js +1 -0
  180. streamlit/static/static/js/_baseIndexOf.BTknn6Gb.js +1 -0
  181. streamlit/static/static/js/{base-input.CJGiNqed.js → base-input.o9tL8MDP.js} +4 -4
  182. streamlit/static/static/js/{checkbox.Cpdd482O.js → checkbox.0BeV1IBL.js} +1 -1
  183. streamlit/static/static/js/{createSuper.CuQIogbW.js → createSuper.RBO59fEm.js} +1 -1
  184. streamlit/static/static/js/data-grid-overlay-editor.CiTkUy0t.js +1 -0
  185. streamlit/static/static/js/{downloader.CN0K7xlu.js → downloader.DwNZg3Mw.js} +1 -1
  186. streamlit/static/static/js/embed.XT9xNd3F.js +195 -0
  187. streamlit/static/static/js/{es6.BJcsVXQ0.js → es6.x9KsYQg-.js} +2 -2
  188. streamlit/static/static/js/{iframeResizer.contentWindow.XzUvQqcZ.js → iframeResizer.contentWindow.ZVXpMPi0.js} +1 -1
  189. streamlit/static/static/js/index.5VPOamri.js +1 -0
  190. streamlit/static/static/js/index.8HslT92O.js +14 -0
  191. streamlit/static/static/js/index.AnXMIBz3.js +7 -0
  192. streamlit/static/static/js/index.B0yp3bM1.js +6 -0
  193. streamlit/static/static/js/index.B1fRb5wF.js +1 -0
  194. streamlit/static/static/js/index.B527JZdO.js +3 -0
  195. streamlit/static/static/js/index.BHgV-yW4.js +1 -0
  196. streamlit/static/static/js/index.BQr-XwGV.js +1 -0
  197. streamlit/static/static/js/index.BTtmaLDB.js +1 -0
  198. streamlit/static/static/js/index.BWB_91TA.js +1 -0
  199. streamlit/static/static/js/index.BfEKaEmw.js +1 -0
  200. streamlit/static/static/js/index.BfXjTO8b.js +1 -0
  201. streamlit/static/static/js/index.Bjy4NRu9.js +3 -0
  202. streamlit/static/static/js/index.Bu5JWpT_.js +1 -0
  203. streamlit/static/static/js/index.BuCx76ZV.js +1 -0
  204. streamlit/static/static/js/index.BxjzhVUb.js +2 -0
  205. streamlit/static/static/js/index.By55VdPY.js +1 -0
  206. streamlit/static/static/js/index.CF5MxTbK.js +1 -0
  207. streamlit/static/static/js/index.CLmq_z9K.js +1 -0
  208. streamlit/static/static/js/index.CNH4rdSz.js +1 -0
  209. streamlit/static/static/js/{index.D3GPA5k4.js → index.CTgm_-jO.js} +9 -40
  210. streamlit/static/static/js/index.C_rK-Swb.js +188 -0
  211. streamlit/static/static/js/index.CjozwSzS.js +1 -0
  212. streamlit/static/static/js/{index.DOFlg3dS.js → index.CkGVt6-G.js} +1 -1
  213. streamlit/static/static/js/index.CuvXOyER.js +2 -0
  214. streamlit/static/static/js/{index.B_dWA3vd.js → index.CyUHWoCC.js} +2 -2
  215. streamlit/static/static/js/index.CyroQtI4.js +2 -0
  216. streamlit/static/static/js/index.D6HmkoDm.js +263 -0
  217. streamlit/static/static/js/index.DAqCNvsO.js +1 -0
  218. streamlit/static/static/js/index.DB_w_CZQ.js +1 -0
  219. streamlit/static/static/js/index.DBalctjj.js +2 -0
  220. streamlit/static/static/js/index.DK0RFJUG.js +11 -0
  221. streamlit/static/static/js/index.DMxc2XFp.js +151 -0
  222. streamlit/static/static/js/index.DO5utP74.js +2 -0
  223. streamlit/static/static/js/index.DS7lf09n.js +1 -0
  224. streamlit/static/static/js/index.DWexTVLY.js +1 -0
  225. streamlit/static/static/js/index.DXxnU5ej.js +1 -0
  226. streamlit/static/static/js/index.DcU3uDvB.js +2 -0
  227. streamlit/static/static/js/index.DlltaH7J.js +1 -0
  228. streamlit/static/static/js/index.DpNTZz82.js +27 -0
  229. streamlit/static/static/js/index.Dr9HIhQw.js +1 -0
  230. streamlit/static/static/js/index.DsgAU5lc.js +1 -0
  231. streamlit/static/static/js/{index.DPUXkcQL.js → index.KfXqjDYy.js} +1 -1
  232. streamlit/static/static/js/index.PaidgjCs.js +1 -0
  233. streamlit/static/static/js/index.RJZuWCGA.js +1 -0
  234. streamlit/static/static/js/{index.CxIUUfab.js → index.hbeqcRTn.js} +53 -122
  235. streamlit/static/static/js/index.q5hIQwAY.js +1 -0
  236. streamlit/static/static/js/index.rORSX6IW.js +1 -0
  237. streamlit/static/static/js/index.uSX757_v.js +1 -0
  238. streamlit/static/static/js/index.x_QRaLMd.js +1 -0
  239. streamlit/static/static/js/{input.D4MN_FzN.js → input.D5oh9-aB.js} +2 -2
  240. streamlit/static/static/js/main.q9oGOg0H.js +13 -0
  241. streamlit/static/static/js/{memory.DrZjtdGT.js → memory.5kCSFUJS.js} +1 -1
  242. streamlit/static/static/js/moment.C3j7ZXd7.js +4 -0
  243. streamlit/static/static/js/number-overlay-editor.Cn_LsK8N.js +9 -0
  244. streamlit/static/static/js/pandasStylerUtils.BqhXt51_.js +1 -0
  245. streamlit/static/static/js/{possibleConstructorReturn.exeeJQEP.js → possibleConstructorReturn.DD9NK1Z8.js} +1 -1
  246. streamlit/static/static/js/{sandbox.ClO3IuUr.js → sandbox.DACSyz29.js} +1 -1
  247. streamlit/static/static/js/styled-components.C3R090At.js +1 -0
  248. streamlit/static/static/js/threshold.Q1mXg5rX.js +1 -0
  249. streamlit/static/static/js/throttle.B0GR3Iyz.js +1 -0
  250. streamlit/static/static/js/{timepicker.DAhu-vcF.js → timepicker.BdhzPxrv.js} +1 -1
  251. streamlit/static/static/js/timer.C2hYhUse.js +1 -0
  252. streamlit/static/static/js/{toConsumableArray.DNbljYEC.js → toConsumableArray.Db2pdqM2.js} +1 -1
  253. streamlit/static/static/js/uniqueId.CtqIr-Yh.js +1 -0
  254. streamlit/static/static/js/urls.BwSlolu9.js +1 -0
  255. streamlit/static/static/js/{useBasicWidgetState.D6sOH6oI.js → useBasicWidgetState.Bfp6TnSw.js} +1 -1
  256. streamlit/static/static/js/useIntlLocale.hRV75Xgj.js +12 -0
  257. streamlit/static/static/js/{useTextInputAutoExpand.4u3_GcuN.js → useTextInputAutoExpand.QepX7n8Y.js} +1 -1
  258. streamlit/static/static/js/useUpdateUiValue.DHx8TzX6.js +1 -0
  259. streamlit/static/static/js/useWaveformController.WxVzpzEX.js +1 -0
  260. streamlit/static/static/js/value.B4vHRSi7.js +1 -0
  261. streamlit/static/static/js/withCalculatedWidth.DcKeRSWJ.js +1 -0
  262. streamlit/static/static/js/withFullScreenWrapper.CrHddARq.js +1 -0
  263. streamlit/string_util.py +8 -1
  264. streamlit/testing/v1/app_test.py +15 -0
  265. streamlit/testing/v1/element_tree.py +62 -0
  266. streamlit/web/bootstrap.py +24 -0
  267. streamlit/web/server/oauth_authlib_routes.py +5 -2
  268. streamlit/web/server/upload_file_request_handler.py +16 -0
  269. {streamlit-1.51.0.dist-info → streamlit-1.52.0.dist-info}/METADATA +9 -5
  270. {streamlit-1.51.0.dist-info → streamlit-1.52.0.dist-info}/RECORD +274 -239
  271. streamlit/static/static/js/InputInstructions.jhH15PqV.js +0 -1
  272. streamlit/static/static/js/Particles.DUsputn1.js +0 -1
  273. streamlit/static/static/js/data-grid-overlay-editor.2Ufgxc6y.js +0 -1
  274. streamlit/static/static/js/index.B1ZQh4P1.js +0 -1
  275. streamlit/static/static/js/index.BKstZk0M.js +0 -27
  276. streamlit/static/static/js/index.BMcFsUee.js +0 -1
  277. streamlit/static/static/js/index.BR-IdcTb.js +0 -2
  278. streamlit/static/static/js/index.BgnZEMVh.js +0 -1
  279. streamlit/static/static/js/index.BohqXifI.js +0 -1
  280. streamlit/static/static/js/index.Br5nxKNj.js +0 -2
  281. streamlit/static/static/js/index.BrIKVbNc.js +0 -3
  282. streamlit/static/static/js/index.BtWUPzle.js +0 -1
  283. streamlit/static/static/js/index.C0RLraek.js +0 -1
  284. streamlit/static/static/js/index.CAIjskgG.js +0 -1
  285. streamlit/static/static/js/index.CAj-7vWz.js +0 -949
  286. streamlit/static/static/js/index.CMtEit2O.js +0 -1
  287. streamlit/static/static/js/index.CkRlykEE.js +0 -12
  288. streamlit/static/static/js/index.CmN3FXfI.js +0 -1617
  289. streamlit/static/static/js/index.CwbFI1_-.js +0 -1
  290. streamlit/static/static/js/index.D2KPNy7e.js +0 -1
  291. streamlit/static/static/js/index.DGAh7DMq.js +0 -1
  292. streamlit/static/static/js/index.DKb_NvmG.js +0 -197
  293. streamlit/static/static/js/index.DMqgUYKq.js +0 -1
  294. streamlit/static/static/js/index.DX1xY89g.js +0 -1
  295. streamlit/static/static/js/index.DYATBCsq.js +0 -2
  296. streamlit/static/static/js/index.DaSmGJ76.js +0 -3
  297. streamlit/static/static/js/index.Dd7bMeLP.js +0 -1
  298. streamlit/static/static/js/index.DjmmgI5U.js +0 -1
  299. streamlit/static/static/js/index.Dq56CyM2.js +0 -1
  300. streamlit/static/static/js/index.DuiXaS5_.js +0 -7
  301. streamlit/static/static/js/index.DvFidMLe.js +0 -2
  302. streamlit/static/static/js/index.DwkhC5Pc.js +0 -1
  303. streamlit/static/static/js/index.Q-3sFn1v.js +0 -1
  304. streamlit/static/static/js/index.QJ5QO9sJ.js +0 -1
  305. streamlit/static/static/js/index.VwTaeety.js +0 -1
  306. streamlit/static/static/js/index.YOqQbeX8.js +0 -1
  307. streamlit/static/static/js/number-overlay-editor.DRwAw1In.js +0 -9
  308. streamlit/static/static/js/uniqueId.oG4Gvj1v.js +0 -1
  309. streamlit/static/static/js/useUpdateUiValue.F2R3eTeR.js +0 -1
  310. streamlit/static/static/js/withFullScreenWrapper.zothJIsI.js +0 -1
  311. {streamlit-1.51.0.data → streamlit-1.52.0.data}/scripts/streamlit.cmd +0 -0
  312. {streamlit-1.51.0.dist-info → streamlit-1.52.0.dist-info}/WHEEL +0 -0
  313. {streamlit-1.51.0.dist-info → streamlit-1.52.0.dist-info}/entry_points.txt +0 -0
  314. {streamlit-1.51.0.dist-info → streamlit-1.52.0.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- import{r as It,bO as Tr,cd as At,a2 as _h,ce as c5,aZ as zu,_ as $D,j as Jf,F as l5,s as WD,h as JD,cf as u5,cg as f5,I as XD,ch as r2,ci as AB,aO as h5,L as d5,u as p5,e as gB,bm as A5,cj as mB}from"./index.CAj-7vWz.js";import{_ as gs,a as g5,C as m5}from"./toConsumableArray.DNbljYEC.js";import{f as of,e as af,d as Ux,_ as Bp,a as zx}from"./possibleConstructorReturn.exeeJQEP.js";import{E as KD,w as _5}from"./withFullScreenWrapper.zothJIsI.js";import{a as y5,T as v5}from"./Toolbar.D8nHCkuz.js";import{a as b5}from"./useBasicWidgetState.D6sOH6oI.js";import"./FormClearHelper.BB1Km6eP.js";function x5(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(r,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}function o_(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const Gx=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),_B=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);_B&&parseFloat(_B[1]);const a_=globalThis,c_=globalThis.process||{},w5=globalThis.navigator||{};function qD(r){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function Al(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||qD()}function C5(r){return Al()?qD()?"Electron":(w5.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const iy="4.1.0";function T5(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}let E5=class{constructor(e,t,n="sessionStorage"){this.storage=T5(n),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function B5(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function S5(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var l_;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(l_||(l_={}));const I5=10;function yB(r){return typeof r!="string"?r:(r=r.toUpperCase(),l_[r]||l_.WHITE)}function M5(r,e,t){return!Al&&typeof r=="string"&&(e&&(r=`\x1B[${yB(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${yB(t)+I5}m${r}\x1B[49m`)),r}function P5(r,e=["constructor"]){const t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),i=r;for(const s of n){const o=i[s];typeof o=="function"&&(e.find(c=>s===c)||(i[s]=o.bind(r)))}}function Vx(r,e){if(!r)throw new Error("Assertion failed")}function md(){let r;if(Al()&&a_.performance)r=a_?.performance?.now?.();else if("hrtime"in c_){const e=c_?.hrtime?.();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}const _d={debug:Al()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},R5={enabled:!0,level:0};function yd(){}const vB={},bB={once:!0};let YD=class{constructor({id:e}={id:""}){this.VERSION=iy,this._startTs=md(),this._deltaTs=md(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new E5(`__probe-${this.id}__`,R5),this.timeStamp(`${this.id} started`),P5(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((md()-this._startTs).toPrecision(10))}getDelta(){return Number((md()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,_d.warn,arguments,bB)}error(e){return this._getLogFunction(0,e,_d.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,_d.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,_d.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,_d.debug||_d.info,arguments,bB)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||yd,n&&[n],{tag:D5(t)}):yd}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||yd)}group(e,t,n={collapsed:!1}){const i=xB({logLevel:e,message:t,opts:n}),{collapsed:s}=n;return i.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||yd)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=ZD(e)}_getLogFunction(e,t,n,i,s){if(this._shouldLog(e)){s=xB({logLevel:e,message:t,args:i,opts:s}),n=n||s.method,Vx(n),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=md();const o=s.tag||s.message;if(s.once&&o)if(!vB[o])vB[o]=md();else return yd;return t=F5(this.id,s.message,s),n.bind(console,t,...s.args)}return yd}};YD.VERSION=iy;function ZD(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return Vx(Number.isFinite(e)&&e>=0),e}function xB(r){const{logLevel:e,message:t}=r;r.logLevel=ZD(e);const n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&n.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break}typeof r.message=="function"&&(r.message=r.message());const i=typeof r.message;return Vx(i==="string"||i==="object"),Object.assign(r,{args:n},r.opts)}function F5(r,e,t){if(typeof e=="string"){const n=t.time?S5(B5(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=M5(e,t.color,t.background)}return e}function D5(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}function O5(r,e){return QD(r||{},e)}function QD(r,e,t=0){if(t>3)return e;const n={...r};for(const[i,s]of Object.entries(e))s&&typeof s=="object"&&!Array.isArray(s)?n[i]=QD(n[i]||{},e[i],t+1):n[i]=e[i];return n}const L5="latest";function k5(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const N5=k5();function Yu(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}const rh=typeof process!="object"||String(process)!=="[object process]"||process.browser,U5=typeof window<"u"&&typeof window.orientation<"u",wB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);wB&&parseFloat(wB[1]);let z5=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(e,t){this.name=e,this.workerThread=t,this.result=new Promise((n,i)=>{this._resolve=n,this._reject=i})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Yu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Yu(this.isRunning),this.isRunning=!1,this._reject(e)}},Nv=class{terminate(){}};const Uv=new Map;function G5(r){Yu(r.source&&!r.url||!r.source&&r.url);let e=Uv.get(r.source||r.url);return e||(r.url&&(e=V5(r.url),Uv.set(r.url,e)),r.source&&(e=eO(r.source),Uv.set(r.source,e))),Yu(e),e}function V5(r){if(!r.startsWith("http"))return r;const e=H5(r);return eO(e)}function eO(r){const e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function H5(r){return`try {
1
+ import{r as It,cU as Tr,d0 as At,ag as _h,d1 as c5,bs as zu,_ as $D,j as Jf,a0 as l5,x as WD,k as JD,R as XD,d2 as AB,bn as u5,L as f5,g as h5,l as gB,ck as d5,d3 as mB}from"./index.DMxc2XFp.js";import{_ as gs,a as p5,C as A5}from"./toConsumableArray.Db2pdqM2.js";import{f as of,e as af,d as Ux,_ as Bp,a as zx}from"./possibleConstructorReturn.DD9NK1Z8.js";import{E as KD,w as g5}from"./withFullScreenWrapper.CrHddARq.js";import{a as m5,T as _5}from"./Toolbar.B2qFUmd9.js";import{l as r2}from"./index.8HslT92O.js";import{a as y5}from"./useBasicWidgetState.Bfp6TnSw.js";import{u as v5,s as b5}from"./threshold.Q1mXg5rX.js";import"./FormClearHelper.CG2XN1_g.js";import"./value.B4vHRSi7.js";function x5(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(r,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}function o_(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const Gx=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),_B=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);_B&&parseFloat(_B[1]);const a_=globalThis,c_=globalThis.process||{},w5=globalThis.navigator||{};function qD(r){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function Al(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||qD()}function C5(r){return Al()?qD()?"Electron":(w5.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const iy="4.1.0";function T5(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}let E5=class{constructor(e,t,n="sessionStorage"){this.storage=T5(n),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function B5(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function S5(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var l_;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(l_||(l_={}));const I5=10;function yB(r){return typeof r!="string"?r:(r=r.toUpperCase(),l_[r]||l_.WHITE)}function M5(r,e,t){return!Al&&typeof r=="string"&&(e&&(r=`\x1B[${yB(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${yB(t)+I5}m${r}\x1B[49m`)),r}function P5(r,e=["constructor"]){const t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),i=r;for(const s of n){const o=i[s];typeof o=="function"&&(e.find(c=>s===c)||(i[s]=o.bind(r)))}}function Vx(r,e){if(!r)throw new Error("Assertion failed")}function md(){let r;if(Al()&&a_.performance)r=a_?.performance?.now?.();else if("hrtime"in c_){const e=c_?.hrtime?.();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}const _d={debug:Al()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},R5={enabled:!0,level:0};function yd(){}const vB={},bB={once:!0};let YD=class{constructor({id:e}={id:""}){this.VERSION=iy,this._startTs=md(),this._deltaTs=md(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new E5(`__probe-${this.id}__`,R5),this.timeStamp(`${this.id} started`),P5(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((md()-this._startTs).toPrecision(10))}getDelta(){return Number((md()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,_d.warn,arguments,bB)}error(e){return this._getLogFunction(0,e,_d.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,_d.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,_d.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,_d.debug||_d.info,arguments,bB)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||yd,n&&[n],{tag:D5(t)}):yd}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||yd)}group(e,t,n={collapsed:!1}){const i=xB({logLevel:e,message:t,opts:n}),{collapsed:s}=n;return i.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||yd)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=ZD(e)}_getLogFunction(e,t,n,i,s){if(this._shouldLog(e)){s=xB({logLevel:e,message:t,args:i,opts:s}),n=n||s.method,Vx(n),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=md();const o=s.tag||s.message;if(s.once&&o)if(!vB[o])vB[o]=md();else return yd;return t=F5(this.id,s.message,s),n.bind(console,t,...s.args)}return yd}};YD.VERSION=iy;function ZD(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return Vx(Number.isFinite(e)&&e>=0),e}function xB(r){const{logLevel:e,message:t}=r;r.logLevel=ZD(e);const n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&n.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break}typeof r.message=="function"&&(r.message=r.message());const i=typeof r.message;return Vx(i==="string"||i==="object"),Object.assign(r,{args:n},r.opts)}function F5(r,e,t){if(typeof e=="string"){const n=t.time?S5(B5(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=M5(e,t.color,t.background)}return e}function D5(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}function O5(r,e){return QD(r||{},e)}function QD(r,e,t=0){if(t>3)return e;const n={...r};for(const[i,s]of Object.entries(e))s&&typeof s=="object"&&!Array.isArray(s)?n[i]=QD(n[i]||{},e[i],t+1):n[i]=e[i];return n}const L5="latest";function k5(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const N5=k5();function Yu(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}const rh=typeof process!="object"||String(process)!=="[object process]"||process.browser,U5=typeof window<"u"&&typeof window.orientation<"u",wB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);wB&&parseFloat(wB[1]);let z5=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(e,t){this.name=e,this.workerThread=t,this.result=new Promise((n,i)=>{this._resolve=n,this._reject=i})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Yu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Yu(this.isRunning),this.isRunning=!1,this._reject(e)}},Nv=class{terminate(){}};const Uv=new Map;function G5(r){Yu(r.source&&!r.url||!r.source&&r.url);let e=Uv.get(r.source||r.url);return e||(r.url&&(e=V5(r.url),Uv.set(r.url,e)),r.source&&(e=eO(r.source),Uv.set(r.source,e))),Yu(e),e}function V5(r){if(!r.startsWith("http"))return r;const e=H5(r);return eO(e)}function eO(r){const e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function H5(r){return`try {
2
2
  importScripts('${r}');
3
3
  } catch (error) {
4
4
  console.error(error);
@@ -2089,12 +2089,7 @@ void main(void) {
2089
2089
  } catch (error) {
2090
2090
  console.error(error);
2091
2091
  throw error;
2092
- }`}function qL(r,e=!0,t){const n=t||new Set;if(r){if(J3(r))n.add(r);else if(J3(r.buffer))n.add(r.buffer);else if(!ArrayBuffer.isView(r)){if(e&&typeof r=="object")for(const i in r)qL(r[i],e,n)}}return t===void 0?Array.from(n):[]}function J3(r){return r?r instanceof ArrayBuffer||typeof MessagePort<"u"&&r instanceof MessagePort||typeof ImageBitmap<"u"&&r instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas:!1}const bb=()=>{};class z2{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&oh||typeof yb<"u"&&!oh}constructor(e){const{name:t,source:n,url:i}=e;Qu(n||i),this.name=t,this.source=n,this.url=i,this.onMessage=bb,this.onError=s=>console.log(s),this.worker=oh?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=bb,this.onError=bb,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,t){t=t||qL(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=JZ({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}_createNodeWorker(){let e;if(this.url){const n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;e=new yb(n,{eval:!1})}else if(this.source)e=new yb(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",t=>{this.onMessage(t)}),e.on("error",t=>{this.onError(t)}),e.on("exit",t=>{}),e}}class qZ{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return z2.isSupported()}constructor(e){this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,t=(i,s,o)=>i.done(o),n=(i,s)=>i.error(s)){const i=new Promise(s=>(this.jobQueue.push({name:e,onMessage:t,onError:n,onStart:s}),this));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const n=new WZ(t.name,e);e.onMessage=i=>t.onMessage(n,i.type,i.payload),e.onError=i=>t.onError(n,i),t.onStart(n);try{await n.result}catch(i){console.error(`Worker exception: ${i}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!oh||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new z2({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return $Z?this.maxMobileConcurrency:this.maxConcurrency}}const YZ={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};class Vu{props;workerPools=new Map;static _workerFarm;static isSupported(){return z2.isSupported()}static getWorkerFarm(e={}){return Vu._workerFarm=Vu._workerFarm||new Vu({}),Vu._workerFarm.setProps(e),Vu._workerFarm}constructor(e){this.props={...YZ},this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:n,url:i}=e;let s=this.workerPools.get(t);return s||(s=new qZ({name:t,source:n,url:i}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function ZZ(r,e={}){const t=e[r.id]||{},n=oh?`${r.id}-worker.js`:`${r.id}-worker-node.js`;let i=t.workerUrl;if(!i&&r.id==="compression"&&(i=e.workerUrl),e._workerType==="test"&&(oh?i=`modules/${r.module}/dist/${n}`:i=`modules/${r.module}/src/workers/${r.id}-worker-node.ts`),!i){let s=r.version;s==="latest"&&(s=VZ);const o=s?`@${s}`:"";i=`https://unpkg.com/@loaders.gl/${r.module}${o}/dist/${n}`}return Qu(i),i}function QZ(r,e=jZ){Qu(r,"no worker provided");const t=r.version;return!(!e||!t)}function eQ(r,e){return!Vu.isSupported()||!oh&&!e?._nodeWorkers?!1:r.worker&&e?.worker}async function tQ(r,e,t,n,i){const s=r.id,o=ZZ(r,t),f=Vu.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t)),n=JSON.parse(JSON.stringify(n||{}));const A=await f.startJob("process-on-worker",rQ.bind(null,i));return A.postMessage("process",{input:e,options:t,context:n}),await(await A.result).result}async function rQ(r,e,t,n){switch(t){case"done":e.done(n);break;case"error":e.error(new Error(n.error));break;case"process":const{id:i,input:s,options:o}=n;try{const c=await r(s,o);e.postMessage("done",{id:i,result:c})}catch(c){const f=c instanceof Error?c.message:"unknown error";e.postMessage("error",{id:i,error:f})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}}function nQ(r,e,t){if(t=t||r.byteLength,r.byteLength<t||e.byteLength<t)return!1;const n=new Uint8Array(r),i=new Uint8Array(e);for(let s=0;s<n.length;++s)if(n[s]!==i[s])return!1;return!0}function iQ(...r){return sQ(r)}function sQ(r){const e=r.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),t=e.reduce((s,o)=>s+o.byteLength,0),n=new Uint8Array(t);let i=0;for(const s of e)n.set(s,i),i+=s.byteLength;return n.buffer}async function oQ(r){const e=[];for await(const t of r)e.push(t);return iQ(...e)}function X3(){let r;if(typeof window<"u"&&window.performance)r=window.performance.now();else if(typeof process<"u"&&process.hrtime){const e=process.hrtime();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}class K3{constructor(e,t){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=e,this.type=t,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=X3(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(X3()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class YL{constructor(e){this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e of Object.values(this.stats))e.reset();return this}forEach(e){for(const t of Object.values(this.stats))e(t)}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){const{name:t,type:n}=e;let i=this.stats[t];return i||(e instanceof K3?i=e:i=new K3(t,n),this.stats[t]=i),i}}let aQ="";const q3={};function cQ(r){for(const e in q3)if(r.startsWith(e)){const t=q3[e];r=r.replace(e,t)}return!r.startsWith("http://")&&!r.startsWith("https://")&&(r=`${aQ}${r}`),r}function lQ(r){return r&&typeof r=="object"&&r.isBuffer}function ZL(r){if(lQ(r))return r;if(r instanceof ArrayBuffer)return r;if(ArrayBuffer.isView(r))return r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);if(typeof r=="string"){const e=r;return new TextEncoder().encode(e).buffer}if(r&&typeof r=="object"&&r._toArrayBuffer)return r._toArrayBuffer();throw new Error("toArrayBuffer")}function QL(r){const e=r?r.lastIndexOf("/"):-1;return e>=0?r.substr(e+1):""}function uQ(r){const e=r?r.lastIndexOf("/"):-1;return e>=0?r.substr(0,e):""}const fQ=r=>typeof r=="boolean",cg=r=>typeof r=="function",Ng=r=>r!==null&&typeof r=="object",Y3=r=>Ng(r)&&r.constructor==={}.constructor,hQ=r=>!!r&&typeof r[Symbol.iterator]=="function",dQ=r=>r&&typeof r[Symbol.asyncIterator]=="function",xh=r=>typeof Response<"u"&&r instanceof Response||r&&r.arrayBuffer&&r.text&&r.json,wh=r=>typeof Blob<"u"&&r instanceof Blob,pQ=r=>r&&typeof r=="object"&&r.isBuffer,AQ=r=>typeof ReadableStream<"u"&&r instanceof ReadableStream||Ng(r)&&cg(r.tee)&&cg(r.cancel)&&cg(r.getReader),gQ=r=>Ng(r)&&cg(r.read)&&cg(r.pipe)&&fQ(r.readable),ek=r=>AQ(r)||gQ(r);class mQ extends Error{constructor(e,t){super(e),this.reason=t.reason,this.url=t.url,this.response=t.response}reason;url;response}const _Q=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,yQ=/^([-\w.]+\/[-\w.+]+)/;function Z3(r,e){return r.toLowerCase()===e.toLowerCase()}function vQ(r){const e=yQ.exec(r);return e?e[1]:r}function Q3(r){const e=_Q.exec(r);return e?e[1]:""}const tk=/\?.*/;function bQ(r){const e=r.match(tk);return e&&e[0]}function Vw(r){return r.replace(tk,"")}function xQ(r){if(r.length<50)return r;const e=r.slice(r.length-15);return`${r.substr(0,32)}...${e}`}function by(r){return xh(r)?r.url:wh(r)?r.name||"":typeof r=="string"?r:""}function Hw(r){if(xh(r)){const e=r,t=e.headers.get("content-type")||"",n=Vw(e.url);return vQ(t)||Q3(n)}return wh(r)?r.type||"":typeof r=="string"?Q3(r):""}function wQ(r){return xh(r)?r.headers["content-length"]||-1:wh(r)?r.size:typeof r=="string"?r.length:r instanceof ArrayBuffer||ArrayBuffer.isView(r)?r.byteLength:-1}async function rk(r){if(xh(r))return r;const e={},t=wQ(r);t>=0&&(e["content-length"]=String(t));const n=by(r),i=Hw(r);i&&(e["content-type"]=i);const s=await EQ(r);s&&(e["x-first-bytes"]=s),typeof r=="string"&&(r=new TextEncoder().encode(r));const o=new Response(r,{headers:e});return Object.defineProperty(o,"url",{value:n}),o}async function CQ(r){if(!r.ok)throw await TQ(r)}async function TQ(r){const e=xQ(r.url);let t=`Failed to fetch resource (${r.status}) ${r.statusText}: ${e}`;t=t.length>100?`${t.slice(0,100)}...`:t;const n={reason:r.statusText,url:r.url,response:r};try{const i=r.headers.get("Content-Type");n.reason=!r.bodyUsed&&i?.includes("application/json")?await r.json():await r.text()}catch{}return new mQ(t,n)}async function EQ(r){if(typeof r=="string")return`data:,${r.slice(0,5)}`;if(r instanceof Blob){const t=r.slice(0,5);return await new Promise(n=>{const i=new FileReader;i.onload=s=>n(s?.target?.result),i.readAsDataURL(t)})}if(r instanceof ArrayBuffer){const t=r.slice(0,5);return`data:base64,${BQ(t)}`}return null}function BQ(r){let e="";const t=new Uint8Array(r);for(let n=0;n<t.byteLength;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function SQ(r){return!IQ(r)&&!MQ(r)}function IQ(r){return r.startsWith("http:")||r.startsWith("https:")}function MQ(r){return r.startsWith("data:")}async function eI(r,e){if(typeof r=="string"){const t=cQ(r);return SQ(t)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(t,e):await fetch(t,e)}return await rk(r)}const tI=new vy({id:"loaders.gl"});class PQ{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}class RQ{console;constructor(){this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}}const nk={fetch:null,mimeType:void 0,nothrow:!1,log:new RQ,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:jL,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},FQ={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function ik(){globalThis.loaders=globalThis.loaders||{};const{loaders:r}=globalThis;return r._state||(r._state={}),r._state}function sk(){const r=ik();return r.globalOptions=r.globalOptions||{...nk},r.globalOptions}function DQ(r,e,t,n){return t=t||[],t=Array.isArray(t)?t:[t],OQ(r,t),kQ(e,r,n)}function OQ(r,e){rI(r,null,nk,FQ,e);for(const t of e){const n=r&&r[t.id]||{},i=t.options&&t.options[t.id]||{},s=t.deprecatedOptions&&t.deprecatedOptions[t.id]||{};rI(n,t.id,i,s,e)}}function rI(r,e,t,n,i){const s=e||"Top level",o=e?`${e}.`:"";for(const c in r){const f=!e&&Ng(r[c]),A=c==="baseUri"&&!e,v=c==="workerUrl"&&e;if(!(c in t)&&!A&&!v){if(c in n)tI.warn(`${s} loader option '${o}${c}' no longer supported, use '${n[c]}'`)();else if(!f){const w=LQ(c,i);tI.warn(`${s} loader option '${o}${c}' not recognized. ${w}`)()}}}}function LQ(r,e){const t=r.toLowerCase();let n="";for(const i of e)for(const s in i.options){if(r===s)return`Did you mean '${i.id}.${s}'?`;const o=s.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(n=n||`Did you mean '${i.id}.${s}'?`)}return n}function kQ(r,e,t){const i={...r.options||{}};return NQ(i,t),i.log===null&&(i.log=new PQ),nI(i,sk()),nI(i,e),i}function nI(r,e){for(const t in e)if(t in e){const n=e[t];Y3(n)&&Y3(r[t])?r[t]={...r[t],...e[t]}:r[t]=e[t]}}function NQ(r,e){e&&!("baseUri"in r)&&(r.baseUri=e)}function jw(r){return r?(Array.isArray(r)&&(r=r[0]),Array.isArray(r?.extensions)):!1}function $w(r){N3(r,"null loader"),N3(jw(r),"invalid loader");let e;return Array.isArray(r)&&(e=r[1],r=r[0],r={...r,options:{...r.options,...e}}),(r?.parseTextSync||r?.parseText)&&(r.text=!0),r.text||(r.binary=!0),r}const ok=()=>{const r=ik();return r.loaderRegistry=r.loaderRegistry||[],r.loaderRegistry};function Ug(r){const e=ok();r=Array.isArray(r)?r:[r];for(const t of r){const n=$w(t);e.find(i=>n===i)||e.unshift(n)}}function UQ(){return ok()}const zQ=/\.([^.]+)$/;async function GQ(r,e=[],t,n){if(!ak(r))return null;let i=iI(r,e,{...t,nothrow:!0},n);if(i)return i;if(wh(r)&&(r=await r.slice(0,10).arrayBuffer(),i=iI(r,e,t,n)),!i&&!t?.nothrow)throw new Error(ck(r));return i}function iI(r,e=[],t,n){if(!ak(r))return null;if(e&&!Array.isArray(e))return $w(e);let i=[];e&&(i=i.concat(e)),t?.ignoreRegisteredLoaders||i.push(...UQ()),HQ(i);const s=VQ(r,i,t,n);if(!s&&!t?.nothrow)throw new Error(ck(r));return s}function VQ(r,e,t,n){const i=by(r),s=Hw(r),o=Vw(i)||n?.url;let c=null,f="";return t?.mimeType&&(c=xb(e,t?.mimeType),f=`match forced by supplied MIME type ${t?.mimeType}`),c=c||jQ(e,o),f=f||(c?`matched url ${o}`:""),c=c||xb(e,s),f=f||(c?`matched MIME type ${s}`:""),c=c||WQ(e,r),f=f||(c?`matched initial data ${lk(r)}`:""),t?.fallbackMimeType&&(c=c||xb(e,t?.fallbackMimeType),f=f||(c?`matched fallback MIME type ${s}`:"")),f&&zZ.log(1,`selectLoader selected ${c?.name}: ${f}.`),c}function ak(r){return!(r instanceof Response&&r.status===204)}function ck(r){const e=by(r),t=Hw(r);let n="No valid loader found (";n+=e?`${QL(e)}, `:"no url provided, ",n+=`MIME type: ${t?`"${t}"`:"not provided"}, `;const i=r?lk(r):"";return n+=i?` first bytes: "${i}"`:"first bytes: not available",n+=")",n}function HQ(r){for(const e of r)$w(e)}function jQ(r,e){const t=e&&zQ.exec(e),n=t&&t[1];return n?$Q(r,n):null}function $Q(r,e){e=e.toLowerCase();for(const t of r)for(const n of t.extensions)if(n.toLowerCase()===e)return t;return null}function xb(r,e){for(const t of r)if(t.mimeTypes?.some(n=>Z3(e,n))||Z3(e,`application/x.${t.id}`))return t;return null}function WQ(r,e){if(!e)return null;for(const t of r)if(typeof e=="string"){if(JQ(e,t))return t}else if(ArrayBuffer.isView(e)){if(sI(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&sI(e,0,t))return t;return null}function JQ(r,e){return e.testText?e.testText(r):(Array.isArray(e.tests)?e.tests:[e.tests]).some(n=>r.startsWith(n))}function sI(r,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(i=>XQ(r,e,t,i))}function XQ(r,e,t,n){if(n instanceof ArrayBuffer)return nQ(n,r,n.byteLength);switch(typeof n){case"function":return n(r);case"string":const i=G2(r,e,n.length);return n===i;default:return!1}}function lk(r,e=5){return typeof r=="string"?r.slice(0,e):ArrayBuffer.isView(r)?G2(r.buffer,r.byteOffset,e):r instanceof ArrayBuffer?G2(r,0,e):""}function G2(r,e,t){if(r.byteLength<e+t)return"";const n=new DataView(r);let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(n.getUint8(e+s));return i}const KQ=256*1024;function*qQ(r,e){const t=e?.chunkSize||KQ;let n=0;const i=new TextEncoder;for(;n<r.length;){const s=Math.min(r.length-n,t),o=r.slice(n,n+s);n+=s,yield i.encode(o)}}const YQ=256*1024;function*ZQ(r,e={}){const{chunkSize:t=YQ}=e;let n=0;for(;n<r.byteLength;){const i=Math.min(r.byteLength-n,t),s=new ArrayBuffer(i),o=new Uint8Array(r,n,i);new Uint8Array(s).set(o),n+=i,yield s}}const QQ=1024*1024;async function*eee(r,e){const t=e?.chunkSize||QQ;let n=0;for(;n<r.size;){const i=n+t,s=await r.slice(n,i).arrayBuffer();n=i,yield s}}function oI(r,e){return jL?tee(r,e):ree(r)}async function*tee(r,e){const t=r.getReader();let n;try{for(;;){const i=n||t.read();e?._streamReadAhead&&(n=t.read());const{done:s,value:o}=await i;if(s)return;yield ZL(o)}}catch{t.releaseLock()}}async function*ree(r,e){for await(const t of r)yield ZL(t)}function nee(r,e){if(typeof r=="string")return qQ(r,e);if(r instanceof ArrayBuffer)return ZQ(r,e);if(wh(r))return eee(r,e);if(ek(r))return oI(r,e);if(xh(r))return oI(r.body,e);throw new Error("makeIterator")}const uk="Cannot convert supplied data type";function iee(r,e,t){if(e.text&&typeof r=="string")return r;if(pQ(r)&&(r=r.buffer),r instanceof ArrayBuffer){const n=r;return e.text&&!e.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(r)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(r);let n=r.buffer;const i=r.byteLength||r.length;return(r.byteOffset!==0||i!==n.byteLength)&&(n=n.slice(r.byteOffset,r.byteOffset+i)),n}throw new Error(uk)}async function see(r,e,t){const n=r instanceof ArrayBuffer||ArrayBuffer.isView(r);if(typeof r=="string"||n)return iee(r,e);if(wh(r)&&(r=await rk(r)),xh(r)){const i=r;return await CQ(i),e.binary?await i.arrayBuffer():await i.text()}if(ek(r)&&(r=nee(r,t)),hQ(r)||dQ(r))return oQ(r);throw new Error(uk)}function fk(r,e){const t=sk(),n=r||t;return typeof n.fetch=="function"?n.fetch:Ng(n.fetch)?i=>eI(i,n.fetch):e?.fetch?e?.fetch:eI}function oee(r,e,t){if(t)return t;const n={fetch:fk(e,r),...r};if(n.url){const i=Vw(n.url);n.baseUrl=i,n.queryString=bQ(n.url),n.filename=QL(i),n.baseUrl=uQ(i)}return Array.isArray(n.loaders)||(n.loaders=null),n}function aee(r,e){if(r&&!Array.isArray(r))return r;let t;if(r&&(t=Array.isArray(r)?r:[r]),e&&e.loaders){const n=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...n]:n}return t&&t.length?t:void 0}async function P_(r,e,t,n){e&&!Array.isArray(e)&&!jw(e)&&(n=void 0,t=e,e=void 0),r=await r,t=t||{};const i=by(r),o=aee(e,n),c=await GQ(r,o,t);return c?(t=DQ(t,c,o,i),n=oee({url:i,_parse:P_,loaders:o},t,n||null),await cee(c,r,t,n)):null}async function cee(r,e,t,n){if(QZ(r),t=GZ(r.options,t),xh(e)){const s=e,{ok:o,redirected:c,status:f,statusText:A,type:v,url:w}=s,S=Object.fromEntries(s.headers.entries());n.response={headers:S,ok:o,redirected:c,status:f,statusText:A,type:v,url:w}}e=await see(e,r,t);const i=r;if(i.parseTextSync&&typeof e=="string")return i.parseTextSync(e,t,n);if(eQ(r,t))return await tQ(r,e,t,n,P_);if(i.parseText&&typeof e=="string")return await i.parseText(e,t,n);if(i.parse)return await i.parse(e,t,n);throw Qu(!i.parseSync),new Error(`${r.id} loader - no parser found and worker is disabled`)}async function Wp(r,e,t,n){let i,s;!Array.isArray(e)&&!jw(e)?(i=[],s=e):(i=e,s=t);const o=fk(s);let c=r;return typeof r=="string"&&(c=await o(r)),wh(r)&&(c=await o(r)),Array.isArray(i)?await P_(c,i,s):await P_(c,i,s)}const aI=100;class lee{schema;options;shape;length=0;rows=null;cursor=0;_headers=[];constructor(e,t){if(this.options=t,this.schema=e,!Array.isArray(e)){this._headers=[];for(const n in e)this._headers[e[n].index]=e[n].name}}rowCount(){return this.length}addArrayRow(e,t){Number.isFinite(t)&&(this.cursor=t),this.shape="array-row-table",this.rows=this.rows||new Array(aI),this.rows[this.length]=e,this.length++}addObjectRow(e,t){Number.isFinite(t)&&(this.cursor=t),this.shape="object-row-table",this.rows=this.rows||new Array(aI),this.rows[this.length]=e,this.length++}getBatch(){let e=this.rows;return e?(e=e.slice(0,this.length),this.rows=null,{shape:this.shape||"array-row-table",batchType:"data",data:e,length:this.length,schema:this.schema,cursor:this.cursor}):null}}function hk(r,e){if(!r)throw new Error("null row");const t={};if(e)for(let n=0;n<e.length;n++)t[e[n]]=r[n];else for(let n=0;n<r.length;n++){const i=`column-${n}`;t[i]=r[n]}return t}function dk(r,e){if(!r)throw new Error("null row");if(e){const t=new Array(e.length);for(let n=0;n<e.length;n++)t[n]=r[e[n]];return t}return Object.values(r)}function uee(r){const e=[];for(let t=0;t<r.length;t++){const n=`column-${t}`;e.push(n)}return e}function fee(r){return Object.keys(r)}const cI=100;class hee{schema;options;length=0;objectRows=null;arrayRows=null;cursor=0;_headers=null;constructor(e,t){if(this.options=t,this.schema=e,e){this._headers=[];for(const n in e)this._headers[e[n].index]=e[n].name}}rowCount(){return this.length}addArrayRow(e,t){switch(Number.isFinite(t)&&(this.cursor=t),this._headers||=uee(e),this.options.shape){case"object-row-table":const n=hk(e,this._headers);this.addObjectRow(n,t);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(cI),this.arrayRows[this.length]=e,this.length++;break}}addObjectRow(e,t){switch(Number.isFinite(t)&&(this.cursor=t),this._headers||=fee(e),this.options.shape){case"array-row-table":const n=dk(e,this._headers);this.addArrayRow(n,t);break;case"object-row-table":this.objectRows=this.objectRows||new Array(cI),this.objectRows[this.length]=e,this.length++;break}}getBatch(){let e=this.arrayRows||this.objectRows;return e?(e=e.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:e,length:this.length,schema:this.schema,cursor:this.cursor}):null}}const dee=100;class pee{schema;length=0;allocated=0;columns={};constructor(e,t){this.schema=e,this._reallocateColumns()}rowCount(){return this.length}addArrayRow(e){this._reallocateColumns();let t=0;for(const n in this.columns)this.columns[n][this.length]=e[t++];this.length++}addObjectRow(e){this._reallocateColumns();for(const t in e)this.columns[t][this.length]=e[t];this.length++}getBatch(){this._pruneColumns();const e=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(const n in this.schema){const i=this.schema[n];e[i.name]=this.columns[i.index]}return this.columns={},{shape:"columnar-table",batchType:"data",data:e,schema:this.schema,length:this.length}}_reallocateColumns(){if(!(this.length<this.allocated)){this.allocated=this.allocated>0?this.allocated*=2:dee,this.columns={};for(const e in this.schema){const t=this.schema[e],n=t.type||Float32Array,i=this.columns[t.index];if(i&&ArrayBuffer.isView(i)){const s=new n(this.allocated);s.set(i),this.columns[t.index]=s}else i?(i.length=this.allocated,this.columns[t.index]=i):this.columns[t.index]=new n(this.allocated)}}}_pruneColumns(){for(const[e,t]of Object.entries(this.columns))this.columns[e]=t.slice(0,this.length)}}const Aee={shape:void 0,batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},gee="TableBatchBuilder";class R_{schema;options;aggregator=null;batchCount=0;bytesUsed=0;isChunkComplete=!1;lastBatchEmittedMs=Date.now();totalLength=0;totalBytes=0;rowBytes=0;static ArrowBatch;constructor(e,t){this.schema=e,this.options={...Aee,...t}}limitReached(){return!!(this.options?.limit&&this.totalLength>=this.options.limit||this.options?._limitMB&&this.totalBytes/1e6>=this.options._limitMB)}addRow(e){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(e),this.totalBytes+=this.rowBytes,Array.isArray(e)?this.addArrayRow(e):this.addObjectRow(e))}addArrayRow(e){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addArrayRow(e)}addObjectRow(e){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addObjectRow(e)}chunkComplete(e){e instanceof ArrayBuffer&&(this.bytesUsed+=e.byteLength),typeof e=="string"&&(this.bytesUsed+=e.length),this.isChunkComplete=!0}getFullBatch(e){return this._isFull()?this._getBatch(e):null}getFinalBatch(e){return this._getBatch(e)}_estimateRowMB(e){return Array.isArray(e)?e.length*8:Object.keys(e).length*8}_isFull(){if(!this.aggregator||this.aggregator.rowCount()===0)return!1;if(this.options.batchSize==="auto"){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs?!1:(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}_getBatch(e){if(!this.aggregator)return null;e?.bytesUsed&&(this.bytesUsed=e.bytesUsed);const t=this.aggregator.getBatch();return t.count=this.batchCount,t.bytesUsed=this.bytesUsed,Object.assign(t,e),this.batchCount++,this.aggregator=null,t}_getTableBatchType(){switch(this.options.shape){case"array-row-table":case"object-row-table":return hee;case"columnar-table":return pee;case"arrow-table":if(!R_.ArrowBatch)throw new Error(gee);return R_.ArrowBatch;default:return lee}}}class lI extends Array{enqueue(e){return this.push(e)}dequeue(){return this.shift()}}class mee{_values;_settlers;_closed;constructor(){this._values=new lI,this._settlers=new lI,this._closed=!1}close(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}[Symbol.asyncIterator](){return this}enqueue(e){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");const t=this._settlers.dequeue();e instanceof Error?t.reject(e):t.resolve({value:e})}else this._values.enqueue(e)}next(){if(this._values.length>0){const e=this._values.dequeue();return e instanceof Error?Promise.reject(e):Promise.resolve({value:e})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0})}return new Promise((e,t)=>{this._settlers.enqueue({resolve:e,reject:t})})}}/* @license
2093
- Papa Parse
2094
- v5.0.0-beta.0
2095
- https://github.com/mholt/PapaParse
2096
- License: MIT
2097
- */const uI="\uFEFF";function _ee(r,e={},t=vee){e=e||{};var n=e.dynamicTyping||!1;vc(n)&&(e.dynamicTypingFunction=n,n={}),e.dynamicTyping=n,e.transform=vc(e.transform)?e.transform:!1;var i=new t(e);return i.stream(r)}function yee(r,e){var t=!1,n=!0,i=",",s=`\r
2092
+ }`}function qL(r,e=!0,t){const n=t||new Set;if(r){if(J3(r))n.add(r);else if(J3(r.buffer))n.add(r.buffer);else if(!ArrayBuffer.isView(r)){if(e&&typeof r=="object")for(const i in r)qL(r[i],e,n)}}return t===void 0?Array.from(n):[]}function J3(r){return r?r instanceof ArrayBuffer||typeof MessagePort<"u"&&r instanceof MessagePort||typeof ImageBitmap<"u"&&r instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas:!1}const bb=()=>{};class z2{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&oh||typeof yb<"u"&&!oh}constructor(e){const{name:t,source:n,url:i}=e;Qu(n||i),this.name=t,this.source=n,this.url=i,this.onMessage=bb,this.onError=s=>console.log(s),this.worker=oh?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=bb,this.onError=bb,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,t){t=t||qL(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=JZ({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}_createNodeWorker(){let e;if(this.url){const n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;e=new yb(n,{eval:!1})}else if(this.source)e=new yb(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",t=>{this.onMessage(t)}),e.on("error",t=>{this.onError(t)}),e.on("exit",t=>{}),e}}class qZ{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return z2.isSupported()}constructor(e){this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,t=(i,s,o)=>i.done(o),n=(i,s)=>i.error(s)){const i=new Promise(s=>(this.jobQueue.push({name:e,onMessage:t,onError:n,onStart:s}),this));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const n=new WZ(t.name,e);e.onMessage=i=>t.onMessage(n,i.type,i.payload),e.onError=i=>t.onError(n,i),t.onStart(n);try{await n.result}catch(i){console.error(`Worker exception: ${i}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!oh||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new z2({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return $Z?this.maxMobileConcurrency:this.maxConcurrency}}const YZ={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};class Vu{props;workerPools=new Map;static _workerFarm;static isSupported(){return z2.isSupported()}static getWorkerFarm(e={}){return Vu._workerFarm=Vu._workerFarm||new Vu({}),Vu._workerFarm.setProps(e),Vu._workerFarm}constructor(e){this.props={...YZ},this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:n,url:i}=e;let s=this.workerPools.get(t);return s||(s=new qZ({name:t,source:n,url:i}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function ZZ(r,e={}){const t=e[r.id]||{},n=oh?`${r.id}-worker.js`:`${r.id}-worker-node.js`;let i=t.workerUrl;if(!i&&r.id==="compression"&&(i=e.workerUrl),e._workerType==="test"&&(oh?i=`modules/${r.module}/dist/${n}`:i=`modules/${r.module}/src/workers/${r.id}-worker-node.ts`),!i){let s=r.version;s==="latest"&&(s=VZ);const o=s?`@${s}`:"";i=`https://unpkg.com/@loaders.gl/${r.module}${o}/dist/${n}`}return Qu(i),i}function QZ(r,e=jZ){Qu(r,"no worker provided");const t=r.version;return!(!e||!t)}function eQ(r,e){return!Vu.isSupported()||!oh&&!e?._nodeWorkers?!1:r.worker&&e?.worker}async function tQ(r,e,t,n,i){const s=r.id,o=ZZ(r,t),f=Vu.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t)),n=JSON.parse(JSON.stringify(n||{}));const A=await f.startJob("process-on-worker",rQ.bind(null,i));return A.postMessage("process",{input:e,options:t,context:n}),await(await A.result).result}async function rQ(r,e,t,n){switch(t){case"done":e.done(n);break;case"error":e.error(new Error(n.error));break;case"process":const{id:i,input:s,options:o}=n;try{const c=await r(s,o);e.postMessage("done",{id:i,result:c})}catch(c){const f=c instanceof Error?c.message:"unknown error";e.postMessage("error",{id:i,error:f})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}}function nQ(r,e,t){if(t=t||r.byteLength,r.byteLength<t||e.byteLength<t)return!1;const n=new Uint8Array(r),i=new Uint8Array(e);for(let s=0;s<n.length;++s)if(n[s]!==i[s])return!1;return!0}function iQ(...r){return sQ(r)}function sQ(r){const e=r.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),t=e.reduce((s,o)=>s+o.byteLength,0),n=new Uint8Array(t);let i=0;for(const s of e)n.set(s,i),i+=s.byteLength;return n.buffer}async function oQ(r){const e=[];for await(const t of r)e.push(t);return iQ(...e)}function X3(){let r;if(typeof window<"u"&&window.performance)r=window.performance.now();else if(typeof process<"u"&&process.hrtime){const e=process.hrtime();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}class K3{constructor(e,t){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=e,this.type=t,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=X3(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(X3()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class YL{constructor(e){this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e of Object.values(this.stats))e.reset();return this}forEach(e){for(const t of Object.values(this.stats))e(t)}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){const{name:t,type:n}=e;let i=this.stats[t];return i||(e instanceof K3?i=e:i=new K3(t,n),this.stats[t]=i),i}}let aQ="";const q3={};function cQ(r){for(const e in q3)if(r.startsWith(e)){const t=q3[e];r=r.replace(e,t)}return!r.startsWith("http://")&&!r.startsWith("https://")&&(r=`${aQ}${r}`),r}function lQ(r){return r&&typeof r=="object"&&r.isBuffer}function ZL(r){if(lQ(r))return r;if(r instanceof ArrayBuffer)return r;if(ArrayBuffer.isView(r))return r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);if(typeof r=="string"){const e=r;return new TextEncoder().encode(e).buffer}if(r&&typeof r=="object"&&r._toArrayBuffer)return r._toArrayBuffer();throw new Error("toArrayBuffer")}function QL(r){const e=r?r.lastIndexOf("/"):-1;return e>=0?r.substr(e+1):""}function uQ(r){const e=r?r.lastIndexOf("/"):-1;return e>=0?r.substr(0,e):""}const fQ=r=>typeof r=="boolean",cg=r=>typeof r=="function",Ng=r=>r!==null&&typeof r=="object",Y3=r=>Ng(r)&&r.constructor==={}.constructor,hQ=r=>!!r&&typeof r[Symbol.iterator]=="function",dQ=r=>r&&typeof r[Symbol.asyncIterator]=="function",xh=r=>typeof Response<"u"&&r instanceof Response||r&&r.arrayBuffer&&r.text&&r.json,wh=r=>typeof Blob<"u"&&r instanceof Blob,pQ=r=>r&&typeof r=="object"&&r.isBuffer,AQ=r=>typeof ReadableStream<"u"&&r instanceof ReadableStream||Ng(r)&&cg(r.tee)&&cg(r.cancel)&&cg(r.getReader),gQ=r=>Ng(r)&&cg(r.read)&&cg(r.pipe)&&fQ(r.readable),ek=r=>AQ(r)||gQ(r);class mQ extends Error{constructor(e,t){super(e),this.reason=t.reason,this.url=t.url,this.response=t.response}reason;url;response}const _Q=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,yQ=/^([-\w.]+\/[-\w.+]+)/;function Z3(r,e){return r.toLowerCase()===e.toLowerCase()}function vQ(r){const e=yQ.exec(r);return e?e[1]:r}function Q3(r){const e=_Q.exec(r);return e?e[1]:""}const tk=/\?.*/;function bQ(r){const e=r.match(tk);return e&&e[0]}function Vw(r){return r.replace(tk,"")}function xQ(r){if(r.length<50)return r;const e=r.slice(r.length-15);return`${r.substr(0,32)}...${e}`}function by(r){return xh(r)?r.url:wh(r)?r.name||"":typeof r=="string"?r:""}function Hw(r){if(xh(r)){const e=r,t=e.headers.get("content-type")||"",n=Vw(e.url);return vQ(t)||Q3(n)}return wh(r)?r.type||"":typeof r=="string"?Q3(r):""}function wQ(r){return xh(r)?r.headers["content-length"]||-1:wh(r)?r.size:typeof r=="string"?r.length:r instanceof ArrayBuffer||ArrayBuffer.isView(r)?r.byteLength:-1}async function rk(r){if(xh(r))return r;const e={},t=wQ(r);t>=0&&(e["content-length"]=String(t));const n=by(r),i=Hw(r);i&&(e["content-type"]=i);const s=await EQ(r);s&&(e["x-first-bytes"]=s),typeof r=="string"&&(r=new TextEncoder().encode(r));const o=new Response(r,{headers:e});return Object.defineProperty(o,"url",{value:n}),o}async function CQ(r){if(!r.ok)throw await TQ(r)}async function TQ(r){const e=xQ(r.url);let t=`Failed to fetch resource (${r.status}) ${r.statusText}: ${e}`;t=t.length>100?`${t.slice(0,100)}...`:t;const n={reason:r.statusText,url:r.url,response:r};try{const i=r.headers.get("Content-Type");n.reason=!r.bodyUsed&&i?.includes("application/json")?await r.json():await r.text()}catch{}return new mQ(t,n)}async function EQ(r){if(typeof r=="string")return`data:,${r.slice(0,5)}`;if(r instanceof Blob){const t=r.slice(0,5);return await new Promise(n=>{const i=new FileReader;i.onload=s=>n(s?.target?.result),i.readAsDataURL(t)})}if(r instanceof ArrayBuffer){const t=r.slice(0,5);return`data:base64,${BQ(t)}`}return null}function BQ(r){let e="";const t=new Uint8Array(r);for(let n=0;n<t.byteLength;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function SQ(r){return!IQ(r)&&!MQ(r)}function IQ(r){return r.startsWith("http:")||r.startsWith("https:")}function MQ(r){return r.startsWith("data:")}async function eI(r,e){if(typeof r=="string"){const t=cQ(r);return SQ(t)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(t,e):await fetch(t,e)}return await rk(r)}const tI=new vy({id:"loaders.gl"});class PQ{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}class RQ{console;constructor(){this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}}const nk={fetch:null,mimeType:void 0,nothrow:!1,log:new RQ,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:jL,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},FQ={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function ik(){globalThis.loaders=globalThis.loaders||{};const{loaders:r}=globalThis;return r._state||(r._state={}),r._state}function sk(){const r=ik();return r.globalOptions=r.globalOptions||{...nk},r.globalOptions}function DQ(r,e,t,n){return t=t||[],t=Array.isArray(t)?t:[t],OQ(r,t),kQ(e,r,n)}function OQ(r,e){rI(r,null,nk,FQ,e);for(const t of e){const n=r&&r[t.id]||{},i=t.options&&t.options[t.id]||{},s=t.deprecatedOptions&&t.deprecatedOptions[t.id]||{};rI(n,t.id,i,s,e)}}function rI(r,e,t,n,i){const s=e||"Top level",o=e?`${e}.`:"";for(const c in r){const f=!e&&Ng(r[c]),A=c==="baseUri"&&!e,v=c==="workerUrl"&&e;if(!(c in t)&&!A&&!v){if(c in n)tI.warn(`${s} loader option '${o}${c}' no longer supported, use '${n[c]}'`)();else if(!f){const w=LQ(c,i);tI.warn(`${s} loader option '${o}${c}' not recognized. ${w}`)()}}}}function LQ(r,e){const t=r.toLowerCase();let n="";for(const i of e)for(const s in i.options){if(r===s)return`Did you mean '${i.id}.${s}'?`;const o=s.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(n=n||`Did you mean '${i.id}.${s}'?`)}return n}function kQ(r,e,t){const i={...r.options||{}};return NQ(i,t),i.log===null&&(i.log=new PQ),nI(i,sk()),nI(i,e),i}function nI(r,e){for(const t in e)if(t in e){const n=e[t];Y3(n)&&Y3(r[t])?r[t]={...r[t],...e[t]}:r[t]=e[t]}}function NQ(r,e){e&&!("baseUri"in r)&&(r.baseUri=e)}function jw(r){return r?(Array.isArray(r)&&(r=r[0]),Array.isArray(r?.extensions)):!1}function $w(r){N3(r,"null loader"),N3(jw(r),"invalid loader");let e;return Array.isArray(r)&&(e=r[1],r=r[0],r={...r,options:{...r.options,...e}}),(r?.parseTextSync||r?.parseText)&&(r.text=!0),r.text||(r.binary=!0),r}const ok=()=>{const r=ik();return r.loaderRegistry=r.loaderRegistry||[],r.loaderRegistry};function Ug(r){const e=ok();r=Array.isArray(r)?r:[r];for(const t of r){const n=$w(t);e.find(i=>n===i)||e.unshift(n)}}function UQ(){return ok()}const zQ=/\.([^.]+)$/;async function GQ(r,e=[],t,n){if(!ak(r))return null;let i=iI(r,e,{...t,nothrow:!0},n);if(i)return i;if(wh(r)&&(r=await r.slice(0,10).arrayBuffer(),i=iI(r,e,t,n)),!i&&!t?.nothrow)throw new Error(ck(r));return i}function iI(r,e=[],t,n){if(!ak(r))return null;if(e&&!Array.isArray(e))return $w(e);let i=[];e&&(i=i.concat(e)),t?.ignoreRegisteredLoaders||i.push(...UQ()),HQ(i);const s=VQ(r,i,t,n);if(!s&&!t?.nothrow)throw new Error(ck(r));return s}function VQ(r,e,t,n){const i=by(r),s=Hw(r),o=Vw(i)||n?.url;let c=null,f="";return t?.mimeType&&(c=xb(e,t?.mimeType),f=`match forced by supplied MIME type ${t?.mimeType}`),c=c||jQ(e,o),f=f||(c?`matched url ${o}`:""),c=c||xb(e,s),f=f||(c?`matched MIME type ${s}`:""),c=c||WQ(e,r),f=f||(c?`matched initial data ${lk(r)}`:""),t?.fallbackMimeType&&(c=c||xb(e,t?.fallbackMimeType),f=f||(c?`matched fallback MIME type ${s}`:"")),f&&zZ.log(1,`selectLoader selected ${c?.name}: ${f}.`),c}function ak(r){return!(r instanceof Response&&r.status===204)}function ck(r){const e=by(r),t=Hw(r);let n="No valid loader found (";n+=e?`${QL(e)}, `:"no url provided, ",n+=`MIME type: ${t?`"${t}"`:"not provided"}, `;const i=r?lk(r):"";return n+=i?` first bytes: "${i}"`:"first bytes: not available",n+=")",n}function HQ(r){for(const e of r)$w(e)}function jQ(r,e){const t=e&&zQ.exec(e),n=t&&t[1];return n?$Q(r,n):null}function $Q(r,e){e=e.toLowerCase();for(const t of r)for(const n of t.extensions)if(n.toLowerCase()===e)return t;return null}function xb(r,e){for(const t of r)if(t.mimeTypes?.some(n=>Z3(e,n))||Z3(e,`application/x.${t.id}`))return t;return null}function WQ(r,e){if(!e)return null;for(const t of r)if(typeof e=="string"){if(JQ(e,t))return t}else if(ArrayBuffer.isView(e)){if(sI(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&sI(e,0,t))return t;return null}function JQ(r,e){return e.testText?e.testText(r):(Array.isArray(e.tests)?e.tests:[e.tests]).some(n=>r.startsWith(n))}function sI(r,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(i=>XQ(r,e,t,i))}function XQ(r,e,t,n){if(n instanceof ArrayBuffer)return nQ(n,r,n.byteLength);switch(typeof n){case"function":return n(r);case"string":const i=G2(r,e,n.length);return n===i;default:return!1}}function lk(r,e=5){return typeof r=="string"?r.slice(0,e):ArrayBuffer.isView(r)?G2(r.buffer,r.byteOffset,e):r instanceof ArrayBuffer?G2(r,0,e):""}function G2(r,e,t){if(r.byteLength<e+t)return"";const n=new DataView(r);let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(n.getUint8(e+s));return i}const KQ=256*1024;function*qQ(r,e){const t=e?.chunkSize||KQ;let n=0;const i=new TextEncoder;for(;n<r.length;){const s=Math.min(r.length-n,t),o=r.slice(n,n+s);n+=s,yield i.encode(o)}}const YQ=256*1024;function*ZQ(r,e={}){const{chunkSize:t=YQ}=e;let n=0;for(;n<r.byteLength;){const i=Math.min(r.byteLength-n,t),s=new ArrayBuffer(i),o=new Uint8Array(r,n,i);new Uint8Array(s).set(o),n+=i,yield s}}const QQ=1024*1024;async function*eee(r,e){const t=e?.chunkSize||QQ;let n=0;for(;n<r.size;){const i=n+t,s=await r.slice(n,i).arrayBuffer();n=i,yield s}}function oI(r,e){return jL?tee(r,e):ree(r)}async function*tee(r,e){const t=r.getReader();let n;try{for(;;){const i=n||t.read();e?._streamReadAhead&&(n=t.read());const{done:s,value:o}=await i;if(s)return;yield ZL(o)}}catch{t.releaseLock()}}async function*ree(r,e){for await(const t of r)yield ZL(t)}function nee(r,e){if(typeof r=="string")return qQ(r,e);if(r instanceof ArrayBuffer)return ZQ(r,e);if(wh(r))return eee(r,e);if(ek(r))return oI(r,e);if(xh(r))return oI(r.body,e);throw new Error("makeIterator")}const uk="Cannot convert supplied data type";function iee(r,e,t){if(e.text&&typeof r=="string")return r;if(pQ(r)&&(r=r.buffer),r instanceof ArrayBuffer){const n=r;return e.text&&!e.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(r)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(r);let n=r.buffer;const i=r.byteLength||r.length;return(r.byteOffset!==0||i!==n.byteLength)&&(n=n.slice(r.byteOffset,r.byteOffset+i)),n}throw new Error(uk)}async function see(r,e,t){const n=r instanceof ArrayBuffer||ArrayBuffer.isView(r);if(typeof r=="string"||n)return iee(r,e);if(wh(r)&&(r=await rk(r)),xh(r)){const i=r;return await CQ(i),e.binary?await i.arrayBuffer():await i.text()}if(ek(r)&&(r=nee(r,t)),hQ(r)||dQ(r))return oQ(r);throw new Error(uk)}function fk(r,e){const t=sk(),n=r||t;return typeof n.fetch=="function"?n.fetch:Ng(n.fetch)?i=>eI(i,n.fetch):e?.fetch?e?.fetch:eI}function oee(r,e,t){if(t)return t;const n={fetch:fk(e,r),...r};if(n.url){const i=Vw(n.url);n.baseUrl=i,n.queryString=bQ(n.url),n.filename=QL(i),n.baseUrl=uQ(i)}return Array.isArray(n.loaders)||(n.loaders=null),n}function aee(r,e){if(r&&!Array.isArray(r))return r;let t;if(r&&(t=Array.isArray(r)?r:[r]),e&&e.loaders){const n=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...n]:n}return t&&t.length?t:void 0}async function P_(r,e,t,n){e&&!Array.isArray(e)&&!jw(e)&&(n=void 0,t=e,e=void 0),r=await r,t=t||{};const i=by(r),o=aee(e,n),c=await GQ(r,o,t);return c?(t=DQ(t,c,o,i),n=oee({url:i,_parse:P_,loaders:o},t,n||null),await cee(c,r,t,n)):null}async function cee(r,e,t,n){if(QZ(r),t=GZ(r.options,t),xh(e)){const s=e,{ok:o,redirected:c,status:f,statusText:A,type:v,url:w}=s,S=Object.fromEntries(s.headers.entries());n.response={headers:S,ok:o,redirected:c,status:f,statusText:A,type:v,url:w}}e=await see(e,r,t);const i=r;if(i.parseTextSync&&typeof e=="string")return i.parseTextSync(e,t,n);if(eQ(r,t))return await tQ(r,e,t,n,P_);if(i.parseText&&typeof e=="string")return await i.parseText(e,t,n);if(i.parse)return await i.parse(e,t,n);throw Qu(!i.parseSync),new Error(`${r.id} loader - no parser found and worker is disabled`)}async function Wp(r,e,t,n){let i,s;!Array.isArray(e)&&!jw(e)?(i=[],s=e):(i=e,s=t);const o=fk(s);let c=r;return typeof r=="string"&&(c=await o(r)),wh(r)&&(c=await o(r)),Array.isArray(i)?await P_(c,i,s):await P_(c,i,s)}const aI=100;class lee{schema;options;shape;length=0;rows=null;cursor=0;_headers=[];constructor(e,t){if(this.options=t,this.schema=e,!Array.isArray(e)){this._headers=[];for(const n in e)this._headers[e[n].index]=e[n].name}}rowCount(){return this.length}addArrayRow(e,t){Number.isFinite(t)&&(this.cursor=t),this.shape="array-row-table",this.rows=this.rows||new Array(aI),this.rows[this.length]=e,this.length++}addObjectRow(e,t){Number.isFinite(t)&&(this.cursor=t),this.shape="object-row-table",this.rows=this.rows||new Array(aI),this.rows[this.length]=e,this.length++}getBatch(){let e=this.rows;return e?(e=e.slice(0,this.length),this.rows=null,{shape:this.shape||"array-row-table",batchType:"data",data:e,length:this.length,schema:this.schema,cursor:this.cursor}):null}}function hk(r,e){if(!r)throw new Error("null row");const t={};if(e)for(let n=0;n<e.length;n++)t[e[n]]=r[n];else for(let n=0;n<r.length;n++){const i=`column-${n}`;t[i]=r[n]}return t}function dk(r,e){if(!r)throw new Error("null row");if(e){const t=new Array(e.length);for(let n=0;n<e.length;n++)t[n]=r[e[n]];return t}return Object.values(r)}function uee(r){const e=[];for(let t=0;t<r.length;t++){const n=`column-${t}`;e.push(n)}return e}function fee(r){return Object.keys(r)}const cI=100;class hee{schema;options;length=0;objectRows=null;arrayRows=null;cursor=0;_headers=null;constructor(e,t){if(this.options=t,this.schema=e,e){this._headers=[];for(const n in e)this._headers[e[n].index]=e[n].name}}rowCount(){return this.length}addArrayRow(e,t){switch(Number.isFinite(t)&&(this.cursor=t),this._headers||=uee(e),this.options.shape){case"object-row-table":const n=hk(e,this._headers);this.addObjectRow(n,t);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(cI),this.arrayRows[this.length]=e,this.length++;break}}addObjectRow(e,t){switch(Number.isFinite(t)&&(this.cursor=t),this._headers||=fee(e),this.options.shape){case"array-row-table":const n=dk(e,this._headers);this.addArrayRow(n,t);break;case"object-row-table":this.objectRows=this.objectRows||new Array(cI),this.objectRows[this.length]=e,this.length++;break}}getBatch(){let e=this.arrayRows||this.objectRows;return e?(e=e.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:e,length:this.length,schema:this.schema,cursor:this.cursor}):null}}const dee=100;class pee{schema;length=0;allocated=0;columns={};constructor(e,t){this.schema=e,this._reallocateColumns()}rowCount(){return this.length}addArrayRow(e){this._reallocateColumns();let t=0;for(const n in this.columns)this.columns[n][this.length]=e[t++];this.length++}addObjectRow(e){this._reallocateColumns();for(const t in e)this.columns[t][this.length]=e[t];this.length++}getBatch(){this._pruneColumns();const e=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(const n in this.schema){const i=this.schema[n];e[i.name]=this.columns[i.index]}return this.columns={},{shape:"columnar-table",batchType:"data",data:e,schema:this.schema,length:this.length}}_reallocateColumns(){if(!(this.length<this.allocated)){this.allocated=this.allocated>0?this.allocated*=2:dee,this.columns={};for(const e in this.schema){const t=this.schema[e],n=t.type||Float32Array,i=this.columns[t.index];if(i&&ArrayBuffer.isView(i)){const s=new n(this.allocated);s.set(i),this.columns[t.index]=s}else i?(i.length=this.allocated,this.columns[t.index]=i):this.columns[t.index]=new n(this.allocated)}}}_pruneColumns(){for(const[e,t]of Object.entries(this.columns))this.columns[e]=t.slice(0,this.length)}}const Aee={shape:void 0,batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},gee="TableBatchBuilder";class R_{schema;options;aggregator=null;batchCount=0;bytesUsed=0;isChunkComplete=!1;lastBatchEmittedMs=Date.now();totalLength=0;totalBytes=0;rowBytes=0;static ArrowBatch;constructor(e,t){this.schema=e,this.options={...Aee,...t}}limitReached(){return!!(this.options?.limit&&this.totalLength>=this.options.limit||this.options?._limitMB&&this.totalBytes/1e6>=this.options._limitMB)}addRow(e){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(e),this.totalBytes+=this.rowBytes,Array.isArray(e)?this.addArrayRow(e):this.addObjectRow(e))}addArrayRow(e){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addArrayRow(e)}addObjectRow(e){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addObjectRow(e)}chunkComplete(e){e instanceof ArrayBuffer&&(this.bytesUsed+=e.byteLength),typeof e=="string"&&(this.bytesUsed+=e.length),this.isChunkComplete=!0}getFullBatch(e){return this._isFull()?this._getBatch(e):null}getFinalBatch(e){return this._getBatch(e)}_estimateRowMB(e){return Array.isArray(e)?e.length*8:Object.keys(e).length*8}_isFull(){if(!this.aggregator||this.aggregator.rowCount()===0)return!1;if(this.options.batchSize==="auto"){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs?!1:(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}_getBatch(e){if(!this.aggregator)return null;e?.bytesUsed&&(this.bytesUsed=e.bytesUsed);const t=this.aggregator.getBatch();return t.count=this.batchCount,t.bytesUsed=this.bytesUsed,Object.assign(t,e),this.batchCount++,this.aggregator=null,t}_getTableBatchType(){switch(this.options.shape){case"array-row-table":case"object-row-table":return hee;case"columnar-table":return pee;case"arrow-table":if(!R_.ArrowBatch)throw new Error(gee);return R_.ArrowBatch;default:return lee}}}class lI extends Array{enqueue(e){return this.push(e)}dequeue(){return this.shift()}}class mee{_values;_settlers;_closed;constructor(){this._values=new lI,this._settlers=new lI,this._closed=!1}close(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}[Symbol.asyncIterator](){return this}enqueue(e){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");const t=this._settlers.dequeue();e instanceof Error?t.reject(e):t.resolve({value:e})}else this._values.enqueue(e)}next(){if(this._values.length>0){const e=this._values.dequeue();return e instanceof Error?Promise.reject(e):Promise.resolve({value:e})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0})}return new Promise((e,t)=>{this._settlers.enqueue({resolve:e,reject:t})})}}const uI="\uFEFF";function _ee(r,e={},t=vee){e=e||{};var n=e.dynamicTyping||!1;vc(n)&&(e.dynamicTypingFunction=n,n={}),e.dynamicTyping=n,e.transform=vc(e.transform)?e.transform:!1;var i=new t(e);return i.stream(r)}function yee(r,e){var t=!1,n=!0,i=",",s=`\r
2098
2093
  `,o='"',c=o+o,f=!1,A=null;w();var v=new RegExp(Cg(o),"g");if(typeof r=="string"&&(r=JSON.parse(r)),Array.isArray(r)){if(!r.length||Array.isArray(r[0]))return S(null,r,f);if(typeof r[0]=="object")return S(A||Object.keys(r[0]),r,f)}else if(typeof r=="object")return typeof r.data=="string"&&(r.data=JSON.parse(r.data)),Array.isArray(r.data)&&(r.fields||(r.fields=r.meta&&r.meta.fields),r.fields||(r.fields=Array.isArray(r.data[0])?r.fields:Object.keys(r.data[0])),!Array.isArray(r.data[0])&&typeof r.data[0]!="object"&&(r.data=[r.data])),S(r.fields||[],r.data||[],f);throw new Error("Unable to serialize unrecognized input");function w(){if(typeof e=="object"){if(typeof e.delimiter=="string"&&!ka.BAD_DELIMITERS.filter(function(U){return e.delimiter.indexOf(U)!==-1}).length&&(i=e.delimiter),(typeof e.quotes=="boolean"||Array.isArray(e.quotes))&&(t=e.quotes),(typeof e.skipEmptyLines=="boolean"||typeof e.skipEmptyLines=="string")&&(f=e.skipEmptyLines),typeof e.newline=="string"&&(s=e.newline),typeof e.quoteChar=="string"&&(o=e.quoteChar),typeof e.header=="boolean"&&(n=e.header),Array.isArray(e.columns)){if(e.columns.length===0)throw new Error("Option columns is empty");A=e.columns}e.escapeChar!==void 0&&(c=e.escapeChar+o)}}function S(U,$,G){var H="";typeof U=="string"&&(U=JSON.parse(U)),typeof $=="string"&&($=JSON.parse($));var J=Array.isArray(U)&&U.length>0,ue=!Array.isArray($[0]);if(J&&n){for(var q=0;q<U.length;q++)q>0&&(H+=i),H+=F(U[q],q);$.length>0&&(H+=s)}for(var se=0;se<$.length;se++){var Te=J?U.length:$[se].length,Ue=!1,de=J?Object.keys($[se]).length===0:$[se].length===0;if(G&&!J&&(Ue=G==="greedy"?$[se].join("").trim()==="":$[se].length===1&&$[se][0].length===0),G==="greedy"&&J){for(var me=[],pe=0;pe<Te;pe++){var W=ue?U[pe]:pe;me.push($[se][W])}Ue=me.join("").trim()===""}if(!Ue){for(var re=0;re<Te;re++){re>0&&!de&&(H+=i);var Ee=J&&ue?U[re]:re;H+=F($[se][Ee],re)}se<$.length-1&&(!G||Te>0&&!de)&&(H+=s)}}return H}function F(U,$){if(typeof U>"u"||U===null)return"";if(U.constructor===Date)return JSON.stringify(U).slice(1,25);U=U.toString().replace(v,c);var G=typeof t=="boolean"&&t||Array.isArray(t)&&t[$]||N(U,ka.BAD_DELIMITERS)||U.indexOf(i)>-1||U.charAt(0)===" "||U.charAt(U.length-1)===" ";return G?o+U+o:U}function N(U,$){for(var G=0;G<$.length;G++)if(U.indexOf($[G])>-1)return!0;return!1}}let pk=class{_handle;_config;_finished=!1;_completed=!1;_input=null;_baseIndex=0;_partialLine="";_rowCount=0;_start=0;isFirstChunk=!0;_completeResults={data:[],errors:[],meta:{}};constructor(e){var t={...e};t.chunkSize=parseInt(t.chunkSize),!e.step&&!e.chunk&&(t.chunkSize=null),this._handle=new Ak(t),this._handle.streamer=this,this._config=t}parseChunk(e,t){if(this.isFirstChunk&&vc(this._config.beforeFirstChunk)){var n=this._config.beforeFirstChunk(e);n!==void 0&&(e=n)}this.isFirstChunk=!1;var i=this._partialLine+e;this._partialLine="";var s=this._handle.parse(i,this._baseIndex,!this._finished);if(!(this._handle.paused()||this._handle.aborted())){var o=s.meta.cursor;this._finished||(this._partialLine=i.substring(o-this._baseIndex),this._baseIndex=o),s&&s.data&&(this._rowCount+=s.data.length);var c=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(vc(this._config.chunk)&&!t){if(this._config.chunk(s,this._handle),this._handle.paused()||this._handle.aborted())return;s=void 0,this._completeResults=void 0}return!this._config.step&&!this._config.chunk&&(this._completeResults.data=this._completeResults.data.concat(s.data),this._completeResults.errors=this._completeResults.errors.concat(s.errors),this._completeResults.meta=s.meta),!this._completed&&c&&vc(this._config.complete)&&(!s||!s.meta.aborted)&&(this._config.complete(this._completeResults,this._input),this._completed=!0),s}}_sendError(e){vc(this._config.error)&&this._config.error(e)}};class vee extends pk{remaining;constructor(e={}){super(e)}stream(e){return this.remaining=e,this._nextChunk()}_nextChunk(){if(!this._finished){var e=this._config.chunkSize,t=e?this.remaining.substr(0,e):this.remaining;return this.remaining=e?this.remaining.substr(e):"",this._finished=!this.remaining,this.parseChunk(t)}}}const bee=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,xee=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/;class Ak{_config;_stepCounter=0;_rowCounter=0;_input;_parser;_paused=!1;_aborted=!1;_delimiterError=!1;_fields=[];_results={data:[],errors:[],meta:{}};constructor(e){if(vc(e.step)){var t=e.step;e.step=n=>{if(this._results=n,this.needsHeaderRow())this.processResults();else{if(this.processResults(),!this._results.data||this._results.data.length===0)return;this._stepCounter+=n.data.length,e.preview&&this._stepCounter>e.preview?this._parser.abort():t(this._results,this)}}}this._config=e}parse(e,t,n){var i=this._config.quoteChar||'"';if(this._config.newline||(this._config.newline=wee(e,i)),this._delimiterError=!1,this._config.delimiter)vc(this._config.delimiter)&&(this._config.delimiter=this._config.delimiter(e),this._results.meta.delimiter=this._config.delimiter);else{var s=this.guessDelimiter(e,this._config.newline,this._config.skipEmptyLines,this._config.comments,this._config.delimitersToGuess);s.successful?this._config.delimiter=s.bestDelimiter:(this._delimiterError=!0,this._config.delimiter=ka.DefaultDelimiter),this._results.meta.delimiter=this._config.delimiter}var o=gk(this._config);return this._config.preview&&this._config.header&&o.preview++,this._input=e,this._parser=new V2(o),this._results=this._parser.parse(this._input,t,n),this.processResults(),this._paused?{meta:{paused:!0}}:this._results||{meta:{paused:!1}}}paused(){return this._paused}pause(){this._paused=!0,this._parser.abort(),this._input=this._input.substr(this._parser.getCharIndex())}resume(){this._paused=!1,this.streamer.parseChunk(this._input,!0)}aborted(){return this._aborted}abort(){this._aborted=!0,this._parser.abort(),this._results.meta.aborted=!0,vc(this._config.complete)&&this._config.complete(this._results),this._input=""}testEmptyLine(e){return this._config.skipEmptyLines==="greedy"?e.join("").trim()==="":e.length===1&&e[0].length===0}processResults(){if(this._results&&this._delimiterError&&(this.addError("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+ka.DefaultDelimiter+"'"),this._delimiterError=!1),this._config.skipEmptyLines)for(var e=0;e<this._results.data.length;e++)this.testEmptyLine(this._results.data[e])&&this._results.data.splice(e--,1);return this.needsHeaderRow()&&this.fillHeaderFields(),this.applyHeaderAndDynamicTypingAndTransformation()}needsHeaderRow(){return this._config.header&&this._fields.length===0}fillHeaderFields(){if(!this._results)return;const e=n=>{vc(this._config.transformHeader)&&(n=this._config.transformHeader(n)),this._fields.push(n)};if(Array.isArray(this._results.data[0])){for(var t=0;this.needsHeaderRow()&&t<this._results.data.length;t++)this._results.data[t].forEach(e);this._results.data.splice(0,1)}else this._results.data.forEach(e)}shouldApplyDynamicTyping(e){return this._config.dynamicTypingFunction&&this._config.dynamicTyping[e]===void 0&&(this._config.dynamicTyping[e]=this._config.dynamicTypingFunction(e)),(this._config.dynamicTyping[e]||this._config.dynamicTyping)===!0}parseDynamic(e,t){return this.shouldApplyDynamicTyping(e)?t==="true"||t==="TRUE"?!0:t==="false"||t==="FALSE"?!1:bee.test(t)?parseFloat(t):xee.test(t)?new Date(t):t===""?null:t:t}applyHeaderAndDynamicTypingAndTransformation(){if(!this._results||!this._results.data||!this._config.header&&!this._config.dynamicTyping&&!this._config.transform)return this._results;var e=1;return!this._results.data[0]||Array.isArray(this._results.data[0])?(this._results.data=this._results.data.map(this.processRow.bind(this)),e=this._results.data.length):this._results.data=this.processRow(this._results.data,0),this._config.header&&this._results.meta&&(this._results.meta.fields=this._fields),this._rowCounter+=e,this._results}processRow(e,t){var n=this._config.header?{}:[],i;for(i=0;i<e.length;i++){var s=i,o=e[i];this._config.header&&(s=i>=this._fields.length?"__parsed_extra":this._fields[i]),this._config.transform&&(o=this._config.transform(o,s)),o=this.parseDynamic(s,o),s==="__parsed_extra"?(n[s]=n[s]||[],n[s].push(o)):n[s]=o}return this._config.header&&(i>this._fields.length?this.addError("FieldMismatch","TooManyFields","Too many fields: expected "+this._fields.length+" fields but parsed "+i,this._rowCounter+t):i<this._fields.length&&this.addError("FieldMismatch","TooFewFields","Too few fields: expected "+this._fields.length+" fields but parsed "+i,this._rowCounter+t)),n}guessDelimiter(e,t,n,i,s){var o,c,f;s=s||[","," ","|",";",ka.RECORD_SEP,ka.UNIT_SEP];for(var A=0;A<s.length;A++){var v=s[A],w=0,S=0,F=0;f=void 0;for(var N=new V2({comments:i,delimiter:v,newline:t,preview:10}).parse(e),U=0;U<N.data.length;U++){if(n&&this.testEmptyLine(N.data[U])){F++;continue}var $=N.data[U].length;if(S+=$,typeof f>"u"){f=0;continue}else $>1&&(w+=Math.abs($-f),f=$)}N.data.length>0&&(S/=N.data.length-F),(typeof c>"u"||w>c)&&S>1.99&&(c=w,o=v)}return this._config.delimiter=o,{successful:!!o,bestDelimiter:o}}addError(e,t,n,i){this._results.errors.push({type:e,code:t,message:n,row:i})}}function wee(r,e){r=r.substr(0,1024*1024);var t=new RegExp(Cg(e)+"([^]*?)"+Cg(e),"gm");r=r.replace(t,"");var n=r.split("\r"),i=r.split(`
2099
2094
  `),s=i.length>1&&i[0].length<n[0].length;if(n.length===1||s)return`
2100
2095
  `;for(var o=0,c=0;c<n.length;c++)n[c][0]===`
@@ -2603,13 +2598,9 @@ uniform `+ee+" "+Z+" u_"+te+`;
2603
2598
  `),We=R.createShader(R.FRAGMENT_SHADER);if(R.isContextLost())this.failedToCreate=!0;else{R.shaderSource(We,Re),R.compileShader(We),R.attachShader(this.program,We);var nt=R.createShader(R.VERTEX_SHADER);if(R.isContextLost())this.failedToCreate=!0;else{R.shaderSource(nt,He),R.compileShader(nt),R.attachShader(this.program,nt),this.attributes={};var Xe={};this.numAttributes=X.length;for(var Qe=0;Qe<this.numAttributes;Qe++)X[Qe]&&(R.bindAttribLocation(this.program,Qe,X[Qe]),this.attributes[X[Qe]]=Qe);R.linkProgram(this.program),R.deleteShader(nt),R.deleteShader(We);for(var pt=0;pt<te.length;pt++){var Dt=te[pt];if(Dt&&!Xe[Dt]){var Ct=R.getUniformLocation(this.program,Dt);Ct&&(Xe[Dt]=Ct)}}this.fixedUniforms=T(l,Xe),this.binderUniforms=m?m.getUniforms(l,Xe):[]}}};function Rc(l,d,h){var m=1/Rn(h,1,d.transform.tileZoom),T=Math.pow(2,h.tileID.overscaledZ),P=h.tileSize*Math.pow(2,d.transform.tileZoom)/T,R=P*(h.tileID.canonical.x+h.tileID.wrap*T),L=P*h.tileID.canonical.y;return{u_image:0,u_texsize:h.imageAtlasTexture.size,u_scale:[m,l.fromScale,l.toScale],u_fade:l.t,u_pixel_coord_upper:[R>>16,L>>16],u_pixel_coord_lower:[65535&R,65535&L]}}Lh.prototype.draw=function(l,d,h,m,T,P,R,L,z,X,ee,Z,te,oe,we,Fe){var ge,Re=l.gl;if(!this.failedToCreate){for(var He in l.program.set(this.program),l.setDepthMode(h),l.setStencilMode(m),l.setColorMode(T),l.setCullFace(P),this.fixedUniforms)this.fixedUniforms[He].set(R[He]);oe&&oe.setUniforms(l,this.binderUniforms,Z,{zoom:te});for(var We=(ge={},ge[Re.LINES]=2,ge[Re.TRIANGLES]=3,ge[Re.LINE_STRIP]=1,ge)[d],nt=0,Xe=ee.get();nt<Xe.length;nt+=1){var Qe=Xe[nt],pt=Qe.vaos||(Qe.vaos={});(pt[L]||(pt[L]=new uu)).bind(l,this,z,oe?oe.getPaintVertexBuffers():[],X,Qe.vertexOffset,we,Fe),Re.drawElements(d,Qe.primitiveLength*We,Re.UNSIGNED_SHORT,Qe.primitiveOffset*We*2)}}};var kh=function(l,d,h,m){var T=d.style.light,P=T.properties.get("position"),R=[P.x,P.y,P.z],L=o.create$1();T.properties.get("anchor")==="viewport"&&o.fromRotation(L,-d.transform.angle),o.transformMat3(R,R,L);var z=T.properties.get("color");return{u_matrix:l,u_lightpos:R,u_lightintensity:T.properties.get("intensity"),u_lightcolor:[z.r,z.g,z.b],u_vertical_gradient:+h,u_opacity:m}},Ko=function(l,d,h,m,T,P,R){return o.extend(kh(l,d,h,m),Rc(P,d,R),{u_height_factor:-Math.pow(2,T.overscaledZ)/R.tileSize/8})},qo=function(l){return{u_matrix:l}},to=function(l,d,h,m){return o.extend(qo(l),Rc(h,d,m))},Nh=function(l,d){return{u_matrix:l,u_world:d}},fu=function(l,d,h,m,T){return o.extend(to(l,d,h,m),{u_world:T})},hu=function(l,d,h,m){var T,P,R=l.transform;if(m.paint.get("circle-pitch-alignment")==="map"){var L=Rn(h,1,R.zoom);T=!0,P=[L,L]}else T=!1,P=R.pixelsToGLUnits;return{u_camera_to_center_distance:R.cameraToCenterDistance,u_scale_with_map:+(m.paint.get("circle-pitch-scale")==="map"),u_matrix:l.translatePosMatrix(d.posMatrix,h,m.paint.get("circle-translate"),m.paint.get("circle-translate-anchor")),u_pitch_with_map:+T,u_device_pixel_ratio:o.browser.devicePixelRatio,u_extrude_scale:P}},Ya=function(l,d,h){var m=Rn(h,1,d.zoom),T=Math.pow(2,d.zoom-h.tileID.overscaledZ),P=h.tileID.overscaleFactor();return{u_matrix:l,u_camera_to_center_distance:d.cameraToCenterDistance,u_pixels_to_tile_units:m,u_extrude_scale:[d.pixelsToGLUnits[0]/(m*T),d.pixelsToGLUnits[1]/(m*T)],u_overscale_factor:P}},vf=function(l,d,h){return{u_matrix:l,u_inv_matrix:d,u_camera_to_center_distance:h.cameraToCenterDistance,u_viewport_size:[h.width,h.height]}},Yo=function(l,d,h){return h===void 0&&(h=1),{u_matrix:l,u_color:d,u_overlay:0,u_overlay_scale:h}},Zo=function(l){return{u_matrix:l}},Tl=function(l,d,h,m){return{u_matrix:l,u_extrude_scale:Rn(d,1,h),u_intensity:m}},Fn=function(l,d,h){var m=l.transform;return{u_matrix:Uh(l,d,h),u_ratio:1/Rn(d,1,m.zoom),u_device_pixel_ratio:o.browser.devicePixelRatio,u_units_to_pixels:[1/m.pixelsToGLUnits[0],1/m.pixelsToGLUnits[1]]}},On=function(l,d,h,m){return o.extend(Fn(l,d,h),{u_image:0,u_image_height:m})},du=function(l,d,h,m){var T=l.transform,P=Fc(d,T);return{u_matrix:Uh(l,d,h),u_texsize:d.imageAtlasTexture.size,u_ratio:1/Rn(d,1,T.zoom),u_device_pixel_ratio:o.browser.devicePixelRatio,u_image:0,u_scale:[P,m.fromScale,m.toScale],u_fade:m.t,u_units_to_pixels:[1/T.pixelsToGLUnits[0],1/T.pixelsToGLUnits[1]]}},tA=function(l,d,h,m,T){var P=l.lineAtlas,R=Fc(d,l.transform),L=h.layout.get("line-cap")==="round",z=P.getDash(m.from,L),X=P.getDash(m.to,L),ee=z.width*T.fromScale,Z=X.width*T.toScale;return o.extend(Fn(l,d,h),{u_patternscale_a:[R/ee,-z.height/2],u_patternscale_b:[R/Z,-X.height/2],u_sdfgamma:P.width/(256*Math.min(ee,Z)*o.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:z.y,u_tex_y_b:X.y,u_mix:T.t})};function Fc(l,d){return 1/Rn(l,1,d.tileZoom)}function Uh(l,d,h){return l.translatePosMatrix(d.tileID.posMatrix,d,h.paint.get("line-translate"),h.paint.get("line-translate-anchor"))}var rA=function(l,d,h,m,T){return{u_matrix:l,u_tl_parent:d,u_scale_parent:h,u_buffer_scale:1,u_fade_t:m.mix,u_opacity:m.opacity*T.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:T.paint.get("raster-brightness-min"),u_brightness_high:T.paint.get("raster-brightness-max"),u_saturation_factor:(R=T.paint.get("raster-saturation"),R>0?1-1/(1.001-R):-R),u_contrast_factor:(P=T.paint.get("raster-contrast"),P>0?1/(1-P):1+P),u_spin_weights:zh(T.paint.get("raster-hue-rotate"))};var P,R};function zh(l){l*=Math.PI/180;var d=Math.sin(l),h=Math.cos(l);return[(2*h+1)/3,(-Math.sqrt(3)*d-h+1)/3,(Math.sqrt(3)*d-h+1)/3]}var ns,Sa=function(l,d,h,m,T,P,R,L,z,X){var ee=T.transform;return{u_is_size_zoom_constant:+(l==="constant"||l==="source"),u_is_size_feature_constant:+(l==="constant"||l==="camera"),u_size_t:d?d.uSizeT:0,u_size:d?d.uSize:0,u_camera_to_center_distance:ee.cameraToCenterDistance,u_pitch:ee.pitch/360*2*Math.PI,u_rotate_symbol:+h,u_aspect_ratio:ee.width/ee.height,u_fade_change:T.options.fadeDuration?T.symbolFadeChange:1,u_matrix:P,u_label_plane_matrix:R,u_coord_matrix:L,u_is_text:+z,u_pitch_with_map:+m,u_texsize:X,u_texture:0}},wo=function(l,d,h,m,T,P,R,L,z,X,ee){var Z=T.transform;return o.extend(Sa(l,d,h,m,T,P,R,L,z,X),{u_gamma_scale:m?Math.cos(Z._pitch)*Z.cameraToCenterDistance:1,u_device_pixel_ratio:o.browser.devicePixelRatio,u_is_halo:1})},pu=function(l,d,h,m,T,P,R,L,z,X){return o.extend(wo(l,d,h,m,T,P,R,L,!0,z),{u_texsize_icon:X,u_texture_icon:1})},Za=function(l,d,h){return{u_matrix:l,u_opacity:d,u_color:h}},Dc=function(l,d,h,m,T,P){return o.extend(function(R,L,z,X){var ee=z.imageManager.getPattern(R.from.toString()),Z=z.imageManager.getPattern(R.to.toString()),te=z.imageManager.getPixelSize(),oe=te.width,we=te.height,Fe=Math.pow(2,X.tileID.overscaledZ),ge=X.tileSize*Math.pow(2,z.transform.tileZoom)/Fe,Re=ge*(X.tileID.canonical.x+X.tileID.wrap*Fe),He=ge*X.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:ee.tl,u_pattern_br_a:ee.br,u_pattern_tl_b:Z.tl,u_pattern_br_b:Z.br,u_texsize:[oe,we],u_mix:L.t,u_pattern_size_a:ee.displaySize,u_pattern_size_b:Z.displaySize,u_scale_a:L.fromScale,u_scale_b:L.toScale,u_tile_units_to_pixels:1/Rn(X,1,z.transform.tileZoom),u_pixel_coord_upper:[Re>>16,He>>16],u_pixel_coord_lower:[65535&Re,65535&He]}}(m,P,h,T),{u_matrix:l,u_opacity:d})},zs={fillExtrusion:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_lightpos:new o.Uniform3f(l,d.u_lightpos),u_lightintensity:new o.Uniform1f(l,d.u_lightintensity),u_lightcolor:new o.Uniform3f(l,d.u_lightcolor),u_vertical_gradient:new o.Uniform1f(l,d.u_vertical_gradient),u_opacity:new o.Uniform1f(l,d.u_opacity)}},fillExtrusionPattern:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_lightpos:new o.Uniform3f(l,d.u_lightpos),u_lightintensity:new o.Uniform1f(l,d.u_lightintensity),u_lightcolor:new o.Uniform3f(l,d.u_lightcolor),u_vertical_gradient:new o.Uniform1f(l,d.u_vertical_gradient),u_height_factor:new o.Uniform1f(l,d.u_height_factor),u_image:new o.Uniform1i(l,d.u_image),u_texsize:new o.Uniform2f(l,d.u_texsize),u_pixel_coord_upper:new o.Uniform2f(l,d.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(l,d.u_pixel_coord_lower),u_scale:new o.Uniform3f(l,d.u_scale),u_fade:new o.Uniform1f(l,d.u_fade),u_opacity:new o.Uniform1f(l,d.u_opacity)}},fill:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix)}},fillPattern:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_image:new o.Uniform1i(l,d.u_image),u_texsize:new o.Uniform2f(l,d.u_texsize),u_pixel_coord_upper:new o.Uniform2f(l,d.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(l,d.u_pixel_coord_lower),u_scale:new o.Uniform3f(l,d.u_scale),u_fade:new o.Uniform1f(l,d.u_fade)}},fillOutline:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_world:new o.Uniform2f(l,d.u_world)}},fillOutlinePattern:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_world:new o.Uniform2f(l,d.u_world),u_image:new o.Uniform1i(l,d.u_image),u_texsize:new o.Uniform2f(l,d.u_texsize),u_pixel_coord_upper:new o.Uniform2f(l,d.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(l,d.u_pixel_coord_lower),u_scale:new o.Uniform3f(l,d.u_scale),u_fade:new o.Uniform1f(l,d.u_fade)}},circle:function(l,d){return{u_camera_to_center_distance:new o.Uniform1f(l,d.u_camera_to_center_distance),u_scale_with_map:new o.Uniform1i(l,d.u_scale_with_map),u_pitch_with_map:new o.Uniform1i(l,d.u_pitch_with_map),u_extrude_scale:new o.Uniform2f(l,d.u_extrude_scale),u_device_pixel_ratio:new o.Uniform1f(l,d.u_device_pixel_ratio),u_matrix:new o.UniformMatrix4f(l,d.u_matrix)}},collisionBox:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_camera_to_center_distance:new o.Uniform1f(l,d.u_camera_to_center_distance),u_pixels_to_tile_units:new o.Uniform1f(l,d.u_pixels_to_tile_units),u_extrude_scale:new o.Uniform2f(l,d.u_extrude_scale),u_overscale_factor:new o.Uniform1f(l,d.u_overscale_factor)}},collisionCircle:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_inv_matrix:new o.UniformMatrix4f(l,d.u_inv_matrix),u_camera_to_center_distance:new o.Uniform1f(l,d.u_camera_to_center_distance),u_viewport_size:new o.Uniform2f(l,d.u_viewport_size)}},debug:function(l,d){return{u_color:new o.UniformColor(l,d.u_color),u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_overlay:new o.Uniform1i(l,d.u_overlay),u_overlay_scale:new o.Uniform1f(l,d.u_overlay_scale)}},clippingMask:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix)}},heatmap:function(l,d){return{u_extrude_scale:new o.Uniform1f(l,d.u_extrude_scale),u_intensity:new o.Uniform1f(l,d.u_intensity),u_matrix:new o.UniformMatrix4f(l,d.u_matrix)}},heatmapTexture:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_world:new o.Uniform2f(l,d.u_world),u_image:new o.Uniform1i(l,d.u_image),u_color_ramp:new o.Uniform1i(l,d.u_color_ramp),u_opacity:new o.Uniform1f(l,d.u_opacity)}},hillshade:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_image:new o.Uniform1i(l,d.u_image),u_latrange:new o.Uniform2f(l,d.u_latrange),u_light:new o.Uniform2f(l,d.u_light),u_shadow:new o.UniformColor(l,d.u_shadow),u_highlight:new o.UniformColor(l,d.u_highlight),u_accent:new o.UniformColor(l,d.u_accent)}},hillshadePrepare:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_image:new o.Uniform1i(l,d.u_image),u_dimension:new o.Uniform2f(l,d.u_dimension),u_zoom:new o.Uniform1f(l,d.u_zoom),u_unpack:new o.Uniform4f(l,d.u_unpack)}},line:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_ratio:new o.Uniform1f(l,d.u_ratio),u_device_pixel_ratio:new o.Uniform1f(l,d.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(l,d.u_units_to_pixels)}},lineGradient:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_ratio:new o.Uniform1f(l,d.u_ratio),u_device_pixel_ratio:new o.Uniform1f(l,d.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(l,d.u_units_to_pixels),u_image:new o.Uniform1i(l,d.u_image),u_image_height:new o.Uniform1f(l,d.u_image_height)}},linePattern:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_texsize:new o.Uniform2f(l,d.u_texsize),u_ratio:new o.Uniform1f(l,d.u_ratio),u_device_pixel_ratio:new o.Uniform1f(l,d.u_device_pixel_ratio),u_image:new o.Uniform1i(l,d.u_image),u_units_to_pixels:new o.Uniform2f(l,d.u_units_to_pixels),u_scale:new o.Uniform3f(l,d.u_scale),u_fade:new o.Uniform1f(l,d.u_fade)}},lineSDF:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_ratio:new o.Uniform1f(l,d.u_ratio),u_device_pixel_ratio:new o.Uniform1f(l,d.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(l,d.u_units_to_pixels),u_patternscale_a:new o.Uniform2f(l,d.u_patternscale_a),u_patternscale_b:new o.Uniform2f(l,d.u_patternscale_b),u_sdfgamma:new o.Uniform1f(l,d.u_sdfgamma),u_image:new o.Uniform1i(l,d.u_image),u_tex_y_a:new o.Uniform1f(l,d.u_tex_y_a),u_tex_y_b:new o.Uniform1f(l,d.u_tex_y_b),u_mix:new o.Uniform1f(l,d.u_mix)}},raster:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_tl_parent:new o.Uniform2f(l,d.u_tl_parent),u_scale_parent:new o.Uniform1f(l,d.u_scale_parent),u_buffer_scale:new o.Uniform1f(l,d.u_buffer_scale),u_fade_t:new o.Uniform1f(l,d.u_fade_t),u_opacity:new o.Uniform1f(l,d.u_opacity),u_image0:new o.Uniform1i(l,d.u_image0),u_image1:new o.Uniform1i(l,d.u_image1),u_brightness_low:new o.Uniform1f(l,d.u_brightness_low),u_brightness_high:new o.Uniform1f(l,d.u_brightness_high),u_saturation_factor:new o.Uniform1f(l,d.u_saturation_factor),u_contrast_factor:new o.Uniform1f(l,d.u_contrast_factor),u_spin_weights:new o.Uniform3f(l,d.u_spin_weights)}},symbolIcon:function(l,d){return{u_is_size_zoom_constant:new o.Uniform1i(l,d.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(l,d.u_is_size_feature_constant),u_size_t:new o.Uniform1f(l,d.u_size_t),u_size:new o.Uniform1f(l,d.u_size),u_camera_to_center_distance:new o.Uniform1f(l,d.u_camera_to_center_distance),u_pitch:new o.Uniform1f(l,d.u_pitch),u_rotate_symbol:new o.Uniform1i(l,d.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(l,d.u_aspect_ratio),u_fade_change:new o.Uniform1f(l,d.u_fade_change),u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(l,d.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(l,d.u_coord_matrix),u_is_text:new o.Uniform1i(l,d.u_is_text),u_pitch_with_map:new o.Uniform1i(l,d.u_pitch_with_map),u_texsize:new o.Uniform2f(l,d.u_texsize),u_texture:new o.Uniform1i(l,d.u_texture)}},symbolSDF:function(l,d){return{u_is_size_zoom_constant:new o.Uniform1i(l,d.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(l,d.u_is_size_feature_constant),u_size_t:new o.Uniform1f(l,d.u_size_t),u_size:new o.Uniform1f(l,d.u_size),u_camera_to_center_distance:new o.Uniform1f(l,d.u_camera_to_center_distance),u_pitch:new o.Uniform1f(l,d.u_pitch),u_rotate_symbol:new o.Uniform1i(l,d.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(l,d.u_aspect_ratio),u_fade_change:new o.Uniform1f(l,d.u_fade_change),u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(l,d.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(l,d.u_coord_matrix),u_is_text:new o.Uniform1i(l,d.u_is_text),u_pitch_with_map:new o.Uniform1i(l,d.u_pitch_with_map),u_texsize:new o.Uniform2f(l,d.u_texsize),u_texture:new o.Uniform1i(l,d.u_texture),u_gamma_scale:new o.Uniform1f(l,d.u_gamma_scale),u_device_pixel_ratio:new o.Uniform1f(l,d.u_device_pixel_ratio),u_is_halo:new o.Uniform1i(l,d.u_is_halo)}},symbolTextAndIcon:function(l,d){return{u_is_size_zoom_constant:new o.Uniform1i(l,d.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(l,d.u_is_size_feature_constant),u_size_t:new o.Uniform1f(l,d.u_size_t),u_size:new o.Uniform1f(l,d.u_size),u_camera_to_center_distance:new o.Uniform1f(l,d.u_camera_to_center_distance),u_pitch:new o.Uniform1f(l,d.u_pitch),u_rotate_symbol:new o.Uniform1i(l,d.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(l,d.u_aspect_ratio),u_fade_change:new o.Uniform1f(l,d.u_fade_change),u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(l,d.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(l,d.u_coord_matrix),u_is_text:new o.Uniform1i(l,d.u_is_text),u_pitch_with_map:new o.Uniform1i(l,d.u_pitch_with_map),u_texsize:new o.Uniform2f(l,d.u_texsize),u_texsize_icon:new o.Uniform2f(l,d.u_texsize_icon),u_texture:new o.Uniform1i(l,d.u_texture),u_texture_icon:new o.Uniform1i(l,d.u_texture_icon),u_gamma_scale:new o.Uniform1f(l,d.u_gamma_scale),u_device_pixel_ratio:new o.Uniform1f(l,d.u_device_pixel_ratio),u_is_halo:new o.Uniform1i(l,d.u_is_halo)}},background:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_opacity:new o.Uniform1f(l,d.u_opacity),u_color:new o.UniformColor(l,d.u_color)}},backgroundPattern:function(l,d){return{u_matrix:new o.UniformMatrix4f(l,d.u_matrix),u_opacity:new o.Uniform1f(l,d.u_opacity),u_image:new o.Uniform1i(l,d.u_image),u_pattern_tl_a:new o.Uniform2f(l,d.u_pattern_tl_a),u_pattern_br_a:new o.Uniform2f(l,d.u_pattern_br_a),u_pattern_tl_b:new o.Uniform2f(l,d.u_pattern_tl_b),u_pattern_br_b:new o.Uniform2f(l,d.u_pattern_br_b),u_texsize:new o.Uniform2f(l,d.u_texsize),u_mix:new o.Uniform1f(l,d.u_mix),u_pattern_size_a:new o.Uniform2f(l,d.u_pattern_size_a),u_pattern_size_b:new o.Uniform2f(l,d.u_pattern_size_b),u_scale_a:new o.Uniform1f(l,d.u_scale_a),u_scale_b:new o.Uniform1f(l,d.u_scale_b),u_pixel_coord_upper:new o.Uniform2f(l,d.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(l,d.u_pixel_coord_lower),u_tile_units_to_pixels:new o.Uniform1f(l,d.u_tile_units_to_pixels)}}};function Qa(l,d,h,m,T,P,R){for(var L=l.context,z=L.gl,X=l.useProgram("collisionBox"),ee=[],Z=0,te=0,oe=0;oe<m.length;oe++){var we=m[oe],Fe=d.getTile(we),ge=Fe.getBucket(h);if(ge){var Re=we.posMatrix;T[0]===0&&T[1]===0||(Re=l.translatePosMatrix(we.posMatrix,Fe,T,P));var He=R?ge.textCollisionBox:ge.iconCollisionBox,We=ge.collisionCircleArray;if(We.length>0){var nt=o.create(),Xe=Re;o.mul(nt,ge.placementInvProjMatrix,l.transform.glCoordMatrix),o.mul(nt,nt,ge.placementViewportMatrix),ee.push({circleArray:We,circleOffset:te,transform:Xe,invTransform:nt}),te=Z+=We.length/4}He&&X.draw(L,z.LINES,ve.disabled,Oe.disabled,l.colorModeForRenderPass(),be.disabled,Ya(Re,l.transform,Fe),h.id,He.layoutVertexBuffer,He.indexBuffer,He.segments,null,l.transform.zoom,null,null,He.collisionVertexBuffer)}}if(R&&ee.length){var Qe=l.useProgram("collisionCircle"),pt=new o.StructArrayLayout2f1f2i16;pt.resize(4*Z),pt._trim();for(var Dt=0,Ct=0,zt=ee;Ct<zt.length;Ct+=1)for(var sr=zt[Ct],Er=0;Er<sr.circleArray.length/4;Er++){var Mr=4*Er,xn=sr.circleArray[Mr+0],ar=sr.circleArray[Mr+1],$r=sr.circleArray[Mr+2],rn=sr.circleArray[Mr+3];pt.emplace(Dt++,xn,ar,$r,rn,0),pt.emplace(Dt++,xn,ar,$r,rn,1),pt.emplace(Dt++,xn,ar,$r,rn,2),pt.emplace(Dt++,xn,ar,$r,rn,3)}(!ns||ns.length<2*Z)&&(ns=function(Ei){var vs=2*Ei,as=new o.StructArrayLayout3ui6;as.resize(vs),as._trim();for(var bi=0;bi<vs;bi++){var Mi=6*bi;as.uint16[Mi+0]=4*bi+0,as.uint16[Mi+1]=4*bi+1,as.uint16[Mi+2]=4*bi+2,as.uint16[Mi+3]=4*bi+2,as.uint16[Mi+4]=4*bi+3,as.uint16[Mi+5]=4*bi+0}return as}(Z));for(var jr=L.createIndexBuffer(ns,!0),Gr=L.createVertexBuffer(pt,o.collisionCircleLayout.members,!0),Zr=0,kr=ee;Zr<kr.length;Zr+=1){var Or=kr[Zr],qi=vf(Or.transform,Or.invTransform,l.transform);Qe.draw(L,z.TRIANGLES,ve.disabled,Oe.disabled,l.colorModeForRenderPass(),be.disabled,qi,h.id,Gr,jr,o.SegmentVector.simpleSegment(0,2*Or.circleOffset,Or.circleArray.length,Or.circleArray.length/2),null,l.transform.zoom,null,null,null)}Gr.destroy(),jr.destroy()}}var Gs=o.identity(new Float32Array(16));function ec(l,d,h,m,T,P){var R=o.getAnchorAlignment(l),L=-(R.horizontalAlign-.5)*d,z=-(R.verticalAlign-.5)*h,X=o.evaluateVariableOffset(l,m);return new o.Point((L/T+X[0])*P,(z/T+X[1])*P)}function Oc(l,d,h,m,T,P,R,L,z,X,ee){var Z=l.text.placedSymbolArray,te=l.text.dynamicLayoutVertexArray,oe=l.icon.dynamicLayoutVertexArray,we={};te.clear();for(var Fe=0;Fe<Z.length;Fe++){var ge=Z.get(Fe),Re=ge.hidden||!ge.crossTileID||l.allowVerticalPlacement&&!ge.placedOrientation?null:m[ge.crossTileID];if(Re){var He=new o.Point(ge.anchorX,ge.anchorY),We=Xt(He,h?L:R),nt=tn(P.cameraToCenterDistance,We.signedDistanceFromCamera),Xe=T.evaluateSizeForFeature(l.textSizeData,X,ge)*nt/o.ONE_EM;h&&(Xe*=l.tilePixelRatio/z);for(var Qe=ec(Re.anchor,Re.width,Re.height,Re.textOffset,Re.textBoxScale,Xe),pt=h?Xt(He.add(Qe),R).point:We.point.add(d?Qe.rotate(-P.angle):Qe),Dt=l.allowVerticalPlacement&&ge.placedOrientation===o.WritingMode.vertical?Math.PI/2:0,Ct=0;Ct<ge.numGlyphs;Ct++)o.addDynamicAttributes(te,pt,Dt);ee&&ge.associatedIconIndex>=0&&(we[ge.associatedIconIndex]={shiftedAnchor:pt,angle:Dt})}else Oi(ge.numGlyphs,te)}if(ee){oe.clear();for(var zt=l.icon.placedSymbolArray,sr=0;sr<zt.length;sr++){var Er=zt.get(sr);if(Er.hidden)Oi(Er.numGlyphs,oe);else{var Mr=we[sr];if(Mr)for(var xn=0;xn<Er.numGlyphs;xn++)o.addDynamicAttributes(oe,Mr.shiftedAnchor,Mr.angle);else Oi(Er.numGlyphs,oe)}}l.icon.dynamicLayoutVertexBuffer.updateData(oe)}l.text.dynamicLayoutVertexBuffer.updateData(te)}function Lc(l,d,h){return h.iconsInText&&d?"symbolTextAndIcon":l?"symbolSDF":"symbolIcon"}function tc(l,d,h,m,T,P,R,L,z,X,ee,Z){for(var te=l.context,oe=te.gl,we=l.transform,Fe=L==="map",ge=z==="map",Re=Fe&&h.layout.get("symbol-placement")!=="point",He=Fe&&!ge&&!Re,We=h.layout.get("symbol-sort-key").constantOr(1)!==void 0,nt=!1,Xe=l.depthModeForSublayer(0,ve.ReadOnly),Qe=h.layout.get("text-variable-anchor"),pt=[],Dt=0,Ct=m;Dt<Ct.length;Dt+=1){var zt=Ct[Dt],sr=d.getTile(zt),Er=sr.getBucket(h);if(Er){var Mr=T?Er.text:Er.icon;if(Mr&&Mr.segments.get().length){var xn=Mr.programConfigurations.get(h.id),ar=T||Er.sdfIcons,$r=T?Er.textSizeData:Er.iconSizeData,rn=ge||we.pitch!==0,jr=l.useProgram(Lc(ar,T,Er),xn),Gr=o.evaluateSizeForZoom($r,we.zoom),Zr=void 0,kr=[0,0],Or=void 0,qi=void 0,Ei=null,vs=void 0;if(T)Or=sr.glyphAtlasTexture,qi=oe.LINEAR,Zr=sr.glyphAtlasTexture.size,Er.iconsInText&&(kr=sr.imageAtlasTexture.size,Ei=sr.imageAtlasTexture,vs=rn||l.options.rotating||l.options.zooming||$r.kind==="composite"||$r.kind==="camera"?oe.LINEAR:oe.NEAREST);else{var as=h.layout.get("icon-size").constantOr(0)!==1||Er.iconsNeedLinear;Or=sr.imageAtlasTexture,qi=ar||l.options.rotating||l.options.zooming||as||rn?oe.LINEAR:oe.NEAREST,Zr=sr.imageAtlasTexture.size}var bi=Rn(sr,1,l.transform.zoom),Mi=pr(zt.posMatrix,ge,Fe,l.transform,bi),ao=Ie(zt.posMatrix,ge,Fe,l.transform,bi),Ps=Qe&&Er.hasTextData(),jc=h.layout.get("icon-text-fit")!=="none"&&Ps&&Er.hasIconData();Re&&ya(Er,zt.posMatrix,l,T,Mi,ao,ge,X);var $s=l.translatePosMatrix(zt.posMatrix,sr,P,R),oa=Re||T&&Qe||jc?Gs:Mi,Lo=l.translatePosMatrix(ao,sr,P,R,!0),If=ar&&h.paint.get(T?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Eu={program:jr,buffers:Mr,uniformValues:ar?Er.iconsInText?pu($r.kind,Gr,He,ge,l,$s,oa,Lo,Zr,kr):wo($r.kind,Gr,He,ge,l,$s,oa,Lo,T,Zr):Sa($r.kind,Gr,He,ge,l,$s,oa,Lo,T,Zr),atlasTexture:Or,atlasTextureIcon:Ei,atlasInterpolation:qi,atlasInterpolationIcon:vs,isSDF:ar,hasHalo:If};if(We&&Er.canOverlap){nt=!0;for(var $c=0,Bu=Mr.segments.get();$c<Bu.length;$c+=1){var Mf=Bu[$c];pt.push({segments:new o.SegmentVector([Mf]),sortKey:Mf.sortKey,state:Eu})}}else pt.push({segments:Mr.segments,sortKey:0,state:Eu})}}}nt&&pt.sort(function(Wc,Dl){return Wc.sortKey-Dl.sortKey});for(var Ma=0,Pf=pt;Ma<Pf.length;Ma+=1){var Pa=Pf[Ma],Yi=Pa.state;if(te.activeTexture.set(oe.TEXTURE0),Yi.atlasTexture.bind(Yi.atlasInterpolation,oe.CLAMP_TO_EDGE),Yi.atlasTextureIcon&&(te.activeTexture.set(oe.TEXTURE1),Yi.atlasTextureIcon&&Yi.atlasTextureIcon.bind(Yi.atlasInterpolationIcon,oe.CLAMP_TO_EDGE)),Yi.isSDF){var sc=Yi.uniformValues;Yi.hasHalo&&(sc.u_is_halo=1,kc(Yi.buffers,Pa.segments,h,l,Yi.program,Xe,ee,Z,sc)),sc.u_is_halo=0}kc(Yi.buffers,Pa.segments,h,l,Yi.program,Xe,ee,Z,Yi.uniformValues)}}function kc(l,d,h,m,T,P,R,L,z){var X=m.context;T.draw(X,X.gl.TRIANGLES,P,R,L,be.disabled,z,h.id,l.layoutVertexBuffer,l.indexBuffer,d,h.paint,m.transform.zoom,l.programConfigurations.get(h.id),l.dynamicLayoutVertexBuffer,l.opacityVertexBuffer)}function Au(l,d,h,m,T,P,R){var L,z,X,ee,Z,te=l.context.gl,oe=h.paint.get("fill-pattern"),we=oe&&oe.constantOr(1),Fe=h.getCrossfadeParameters();R?(z=we&&!h.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",L=te.LINES):(z=we?"fillPattern":"fill",L=te.TRIANGLES);for(var ge=0,Re=m;ge<Re.length;ge+=1){var He=Re[ge],We=d.getTile(He);if(!we||We.patternsLoaded()){var nt=We.getBucket(h);if(nt){var Xe=nt.programConfigurations.get(h.id),Qe=l.useProgram(z,Xe);we&&(l.context.activeTexture.set(te.TEXTURE0),We.imageAtlasTexture.bind(te.LINEAR,te.CLAMP_TO_EDGE),Xe.updatePaintBuffers(Fe));var pt=oe.constantOr(null);if(pt&&We.imageAtlas){var Dt=We.imageAtlas,Ct=Dt.patternPositions[pt.to.toString()],zt=Dt.patternPositions[pt.from.toString()];Ct&&zt&&Xe.setConstantPatternPositions(Ct,zt)}var sr=l.translatePosMatrix(He.posMatrix,We,h.paint.get("fill-translate"),h.paint.get("fill-translate-anchor"));if(R){ee=nt.indexBuffer2,Z=nt.segments2;var Er=[te.drawingBufferWidth,te.drawingBufferHeight];X=z==="fillOutlinePattern"&&we?fu(sr,l,Fe,We,Er):Nh(sr,Er)}else ee=nt.indexBuffer,Z=nt.segments,X=we?to(sr,l,Fe,We):qo(sr);Qe.draw(l.context,L,T,l.stencilModeForClipping(He),P,be.disabled,X,h.id,nt.layoutVertexBuffer,ee,Z,h.paint,l.transform.zoom,Xe)}}}}function El(l,d,h,m,T,P,R){for(var L=l.context,z=L.gl,X=h.paint.get("fill-extrusion-pattern"),ee=X.constantOr(1),Z=h.getCrossfadeParameters(),te=h.paint.get("fill-extrusion-opacity"),oe=0,we=m;oe<we.length;oe+=1){var Fe=we[oe],ge=d.getTile(Fe),Re=ge.getBucket(h);if(Re){var He=Re.programConfigurations.get(h.id),We=l.useProgram(ee?"fillExtrusionPattern":"fillExtrusion",He);ee&&(l.context.activeTexture.set(z.TEXTURE0),ge.imageAtlasTexture.bind(z.LINEAR,z.CLAMP_TO_EDGE),He.updatePaintBuffers(Z));var nt=X.constantOr(null);if(nt&&ge.imageAtlas){var Xe=ge.imageAtlas,Qe=Xe.patternPositions[nt.to.toString()],pt=Xe.patternPositions[nt.from.toString()];Qe&&pt&&He.setConstantPatternPositions(Qe,pt)}var Dt=l.translatePosMatrix(Fe.posMatrix,ge,h.paint.get("fill-extrusion-translate"),h.paint.get("fill-extrusion-translate-anchor")),Ct=h.paint.get("fill-extrusion-vertical-gradient"),zt=ee?Ko(Dt,l,Ct,te,Fe,Z,ge):kh(Dt,l,Ct,te);We.draw(L,L.gl.TRIANGLES,T,P,R,be.backCCW,zt,h.id,Re.layoutVertexBuffer,Re.indexBuffer,Re.segments,h.paint,l.transform.zoom,He)}}}function gu(l,d,h,m,T,P){var R=l.context,L=R.gl,z=d.fbo;if(z){var X=l.useProgram("hillshade");R.activeTexture.set(L.TEXTURE0),L.bindTexture(L.TEXTURE_2D,z.colorAttachment.get());var ee=function(Z,te,oe){var we=oe.paint.get("hillshade-shadow-color"),Fe=oe.paint.get("hillshade-highlight-color"),ge=oe.paint.get("hillshade-accent-color"),Re=oe.paint.get("hillshade-illumination-direction")*(Math.PI/180);oe.paint.get("hillshade-illumination-anchor")==="viewport"&&(Re-=Z.transform.angle);var He,We,nt,Xe=!Z.options.moving;return{u_matrix:Z.transform.calculatePosMatrix(te.tileID.toUnwrapped(),Xe),u_image:0,u_latrange:(He=te.tileID,We=Math.pow(2,He.canonical.z),nt=He.canonical.y,[new o.MercatorCoordinate(0,nt/We).toLngLat().lat,new o.MercatorCoordinate(0,(nt+1)/We).toLngLat().lat]),u_light:[oe.paint.get("hillshade-exaggeration"),Re],u_shadow:we,u_highlight:Fe,u_accent:ge}}(l,d,h);X.draw(R,L.TRIANGLES,m,T,P,be.disabled,ee,h.id,l.rasterBoundsBuffer,l.quadTriangleIndexBuffer,l.rasterBoundsSegments)}}function nA(l,d,h,m,T,P){var R=l.context,L=R.gl,z=d.dem;if(z&&z.data){var X=z.dim,ee=z.stride,Z=z.getPixels();if(R.activeTexture.set(L.TEXTURE1),R.pixelStoreUnpackPremultiplyAlpha.set(!1),d.demTexture=d.demTexture||l.getTileTexture(ee),d.demTexture){var te=d.demTexture;te.update(Z,{premultiply:!1}),te.bind(L.NEAREST,L.CLAMP_TO_EDGE)}else d.demTexture=new o.Texture(R,Z,L.RGBA,{premultiply:!1}),d.demTexture.bind(L.NEAREST,L.CLAMP_TO_EDGE);R.activeTexture.set(L.TEXTURE0);var oe=d.fbo;if(!oe){var we=new o.Texture(R,{width:X,height:X,data:null},L.RGBA);we.bind(L.LINEAR,L.CLAMP_TO_EDGE),(oe=d.fbo=R.createFramebuffer(X,X,!0)).colorAttachment.set(we.texture)}R.bindFramebuffer.set(oe.framebuffer),R.viewport.set([0,0,X,X]),l.useProgram("hillshadePrepare").draw(R,L.TRIANGLES,m,T,P,be.disabled,function(Fe,ge){var Re=ge.stride,He=o.create();return o.ortho(He,0,o.EXTENT,-o.EXTENT,0,0,1),o.translate(He,He,[0,-o.EXTENT,0]),{u_matrix:He,u_image:1,u_dimension:[Re,Re],u_zoom:Fe.overscaledZ,u_unpack:ge.getUnpackVector()}}(d.tileID,z),h.id,l.rasterBoundsBuffer,l.quadTriangleIndexBuffer,l.rasterBoundsSegments),d.needsHillshadePrepare=!1}}function Bl(l,d,h,m,T){var P=m.paint.get("raster-fade-duration");if(P>0){var R=o.browser.now(),L=(R-l.timeAdded)/P,z=d?(R-d.timeAdded)/P:-1,X=h.getSource(),ee=T.coveringZoomLevel({tileSize:X.tileSize,roundZoom:X.roundZoom}),Z=!d||Math.abs(d.tileID.overscaledZ-ee)>Math.abs(l.tileID.overscaledZ-ee),te=Z&&l.refreshedUponExpiration?1:o.clamp(Z?L:1-z,0,1);return l.refreshedUponExpiration&&L>=1&&(l.refreshedUponExpiration=!1),d?{opacity:1,mix:1-te}:{opacity:te,mix:0}}return{opacity:1,mix:0}}var mu=new o.Color(1,0,0,1),Nc=new o.Color(0,1,0,1),rc=new o.Color(0,0,1,1),_u=new o.Color(1,0,1,1),nc=new o.Color(0,1,1,1);function bf(l,d,h,m){Sl(l,0,d+h/2,l.transform.width,h,m)}function xf(l,d,h,m){Sl(l,d-h/2,0,h,l.transform.height,m)}function Sl(l,d,h,m,T,P){var R=l.context,L=R.gl;L.enable(L.SCISSOR_TEST),L.scissor(d*o.browser.devicePixelRatio,h*o.browser.devicePixelRatio,m*o.browser.devicePixelRatio,T*o.browser.devicePixelRatio),R.clear({color:P}),L.disable(L.SCISSOR_TEST)}function Gh(l,d,h){var m=l.context,T=m.gl,P=h.posMatrix,R=l.useProgram("debug"),L=ve.disabled,z=Oe.disabled,X=l.colorModeForRenderPass();m.activeTexture.set(T.TEXTURE0),l.emptyTexture.bind(T.LINEAR,T.CLAMP_TO_EDGE),R.draw(m,T.LINE_STRIP,L,z,X,be.disabled,Yo(P,o.Color.red),"$debug",l.debugBuffer,l.tileBorderIndexBuffer,l.debugSegments);var ee=d.getTileByID(h.key).latestRawTileData,Z=Math.floor((ee&&ee.byteLength||0)/1024),te=d.getTile(h).tileSize,oe=512/Math.min(te,512)*(h.overscaledZ/l.transform.zoom)*.5,we=h.canonical.toString();h.overscaledZ!==h.canonical.z&&(we+=" => "+h.overscaledZ),function(Fe,ge){Fe.initDebugOverlayCanvas();var Re=Fe.debugOverlayCanvas,He=Fe.context.gl,We=Fe.debugOverlayCanvas.getContext("2d");We.clearRect(0,0,Re.width,Re.height),We.shadowColor="white",We.shadowBlur=2,We.lineWidth=1.5,We.strokeStyle="white",We.textBaseline="top",We.font="bold 36px Open Sans, sans-serif",We.fillText(ge,5,5),We.strokeText(ge,5,5),Fe.debugOverlayTexture.update(Re),Fe.debugOverlayTexture.bind(He.LINEAR,He.CLAMP_TO_EDGE)}(l,we+" "+Z+"kb"),R.draw(m,T.TRIANGLES,L,z,he.alphaBlended,be.disabled,Yo(P,o.Color.transparent,oe),"$debug",l.debugBuffer,l.quadTriangleIndexBuffer,l.debugSegments)}var ic={symbol:function(l,d,h,m,T){if(l.renderPass==="translucent"){var P=Oe.disabled,R=l.colorModeForRenderPass();h.layout.get("text-variable-anchor")&&function(L,z,X,ee,Z,te,oe){for(var we=z.transform,Fe=Z==="map",ge=te==="map",Re=0,He=L;Re<He.length;Re+=1){var We=He[Re],nt=ee.getTile(We),Xe=nt.getBucket(X);if(Xe&&Xe.text&&Xe.text.segments.get().length){var Qe=o.evaluateSizeForZoom(Xe.textSizeData,we.zoom),pt=Rn(nt,1,z.transform.zoom),Dt=pr(We.posMatrix,ge,Fe,z.transform,pt),Ct=X.layout.get("icon-text-fit")!=="none"&&Xe.hasIconData();if(Qe){var zt=Math.pow(2,we.zoom-nt.tileID.overscaledZ);Oc(Xe,Fe,ge,oe,o.symbolSize,we,Dt,We.posMatrix,zt,Qe,Ct)}}}}(m,l,h,d,h.layout.get("text-rotation-alignment"),h.layout.get("text-pitch-alignment"),T),h.paint.get("icon-opacity").constantOr(1)!==0&&tc(l,d,h,m,!1,h.paint.get("icon-translate"),h.paint.get("icon-translate-anchor"),h.layout.get("icon-rotation-alignment"),h.layout.get("icon-pitch-alignment"),h.layout.get("icon-keep-upright"),P,R),h.paint.get("text-opacity").constantOr(1)!==0&&tc(l,d,h,m,!0,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),h.layout.get("text-rotation-alignment"),h.layout.get("text-pitch-alignment"),h.layout.get("text-keep-upright"),P,R),d.map.showCollisionBoxes&&(Qa(l,d,h,m,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),!0),Qa(l,d,h,m,h.paint.get("icon-translate"),h.paint.get("icon-translate-anchor"),!1))}},circle:function(l,d,h,m){if(l.renderPass==="translucent"){var T=h.paint.get("circle-opacity"),P=h.paint.get("circle-stroke-width"),R=h.paint.get("circle-stroke-opacity"),L=h.layout.get("circle-sort-key").constantOr(1)!==void 0;if(T.constantOr(1)!==0||P.constantOr(1)!==0&&R.constantOr(1)!==0){for(var z=l.context,X=z.gl,ee=l.depthModeForSublayer(0,ve.ReadOnly),Z=Oe.disabled,te=l.colorModeForRenderPass(),oe=[],we=0;we<m.length;we++){var Fe=m[we],ge=d.getTile(Fe),Re=ge.getBucket(h);if(Re){var He=Re.programConfigurations.get(h.id),We={programConfiguration:He,program:l.useProgram("circle",He),layoutVertexBuffer:Re.layoutVertexBuffer,indexBuffer:Re.indexBuffer,uniformValues:hu(l,Fe,ge,h)};if(L)for(var nt=0,Xe=Re.segments.get();nt<Xe.length;nt+=1){var Qe=Xe[nt];oe.push({segments:new o.SegmentVector([Qe]),sortKey:Qe.sortKey,state:We})}else oe.push({segments:Re.segments,sortKey:0,state:We})}}L&&oe.sort(function(sr,Er){return sr.sortKey-Er.sortKey});for(var pt=0,Dt=oe;pt<Dt.length;pt+=1){var Ct=Dt[pt],zt=Ct.state;zt.program.draw(z,X.TRIANGLES,ee,Z,te,be.disabled,zt.uniformValues,h.id,zt.layoutVertexBuffer,zt.indexBuffer,Ct.segments,h.paint,l.transform.zoom,zt.programConfiguration)}}}},heatmap:function(l,d,h,m){if(h.paint.get("heatmap-opacity")!==0)if(l.renderPass==="offscreen"){var T=l.context,P=T.gl,R=Oe.disabled,L=new he([P.ONE,P.ONE],o.Color.transparent,[!0,!0,!0,!0]);(function(oe,we,Fe){var ge=oe.gl;oe.activeTexture.set(ge.TEXTURE1),oe.viewport.set([0,0,we.width/4,we.height/4]);var Re=Fe.heatmapFbo;if(Re)ge.bindTexture(ge.TEXTURE_2D,Re.colorAttachment.get()),oe.bindFramebuffer.set(Re.framebuffer);else{var He=ge.createTexture();ge.bindTexture(ge.TEXTURE_2D,He),ge.texParameteri(ge.TEXTURE_2D,ge.TEXTURE_WRAP_S,ge.CLAMP_TO_EDGE),ge.texParameteri(ge.TEXTURE_2D,ge.TEXTURE_WRAP_T,ge.CLAMP_TO_EDGE),ge.texParameteri(ge.TEXTURE_2D,ge.TEXTURE_MIN_FILTER,ge.LINEAR),ge.texParameteri(ge.TEXTURE_2D,ge.TEXTURE_MAG_FILTER,ge.LINEAR),Re=Fe.heatmapFbo=oe.createFramebuffer(we.width/4,we.height/4,!1),function(We,nt,Xe,Qe){var pt=We.gl;pt.texImage2D(pt.TEXTURE_2D,0,pt.RGBA,nt.width/4,nt.height/4,0,pt.RGBA,We.extRenderToTextureHalfFloat?We.extTextureHalfFloat.HALF_FLOAT_OES:pt.UNSIGNED_BYTE,null),Qe.colorAttachment.set(Xe)}(oe,we,He,Re)}})(T,l,h),T.clear({color:o.Color.transparent});for(var z=0;z<m.length;z++){var X=m[z];if(!d.hasRenderableParent(X)){var ee=d.getTile(X),Z=ee.getBucket(h);if(Z){var te=Z.programConfigurations.get(h.id);l.useProgram("heatmap",te).draw(T,P.TRIANGLES,ve.disabled,R,L,be.disabled,Tl(X.posMatrix,ee,l.transform.zoom,h.paint.get("heatmap-intensity")),h.id,Z.layoutVertexBuffer,Z.indexBuffer,Z.segments,h.paint,l.transform.zoom,te)}}}T.viewport.set([0,0,l.width,l.height])}else l.renderPass==="translucent"&&(l.context.setColorMode(l.colorModeForRenderPass()),function(oe,we){var Fe=oe.context,ge=Fe.gl,Re=we.heatmapFbo;if(Re){Fe.activeTexture.set(ge.TEXTURE0),ge.bindTexture(ge.TEXTURE_2D,Re.colorAttachment.get()),Fe.activeTexture.set(ge.TEXTURE1);var He=we.colorRampTexture;He||(He=we.colorRampTexture=new o.Texture(Fe,we.colorRamp,ge.RGBA)),He.bind(ge.LINEAR,ge.CLAMP_TO_EDGE),oe.useProgram("heatmapTexture").draw(Fe,ge.TRIANGLES,ve.disabled,Oe.disabled,oe.colorModeForRenderPass(),be.disabled,function(We,nt,Xe,Qe){var pt=o.create();o.ortho(pt,0,We.width,We.height,0,0,1);var Dt=We.context.gl;return{u_matrix:pt,u_world:[Dt.drawingBufferWidth,Dt.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:nt.paint.get("heatmap-opacity")}}(oe,we),we.id,oe.viewportBuffer,oe.quadTriangleIndexBuffer,oe.viewportSegments,we.paint,oe.transform.zoom)}}(l,h))},line:function(l,d,h,m){if(l.renderPass==="translucent"){var T=h.paint.get("line-opacity"),P=h.paint.get("line-width");if(T.constantOr(1)!==0&&P.constantOr(1)!==0)for(var R=l.depthModeForSublayer(0,ve.ReadOnly),L=l.colorModeForRenderPass(),z=h.paint.get("line-dasharray"),X=h.paint.get("line-pattern"),ee=X.constantOr(1),Z=h.paint.get("line-gradient"),te=h.getCrossfadeParameters(),oe=ee?"linePattern":z?"lineSDF":Z?"lineGradient":"line",we=l.context,Fe=we.gl,ge=!0,Re=0,He=m;Re<He.length;Re+=1){var We=He[Re],nt=d.getTile(We);if(!ee||nt.patternsLoaded()){var Xe=nt.getBucket(h);if(Xe){var Qe=Xe.programConfigurations.get(h.id),pt=l.context.program.get(),Dt=l.useProgram(oe,Qe),Ct=ge||Dt.program!==pt,zt=X.constantOr(null);if(zt&&nt.imageAtlas){var sr=nt.imageAtlas,Er=sr.patternPositions[zt.to.toString()],Mr=sr.patternPositions[zt.from.toString()];Er&&Mr&&Qe.setConstantPatternPositions(Er,Mr)}var xn=ee?du(l,nt,h,te):z?tA(l,nt,h,z,te):Z?On(l,nt,h,Xe.lineClipsArray.length):Fn(l,nt,h);if(ee)we.activeTexture.set(Fe.TEXTURE0),nt.imageAtlasTexture.bind(Fe.LINEAR,Fe.CLAMP_TO_EDGE),Qe.updatePaintBuffers(te);else if(z&&(Ct||l.lineAtlas.dirty))we.activeTexture.set(Fe.TEXTURE0),l.lineAtlas.bind(we);else if(Z){var ar=Xe.gradients[h.id],$r=ar.texture;if(h.gradientVersion!==ar.version){var rn=256;if(h.stepInterpolant){var jr=d.getSource().maxzoom,Gr=We.canonical.z===jr?Math.ceil(1<<l.transform.maxZoom-We.canonical.z):1;rn=o.clamp(o.nextPowerOfTwo(Xe.maxLineLength/o.EXTENT*1024*Gr),256,we.maxTextureSize)}ar.gradient=o.renderColorRamp({expression:h.gradientExpression(),evaluationKey:"lineProgress",resolution:rn,image:ar.gradient||void 0,clips:Xe.lineClipsArray}),ar.texture?ar.texture.update(ar.gradient):ar.texture=new o.Texture(we,ar.gradient,Fe.RGBA),ar.version=h.gradientVersion,$r=ar.texture}we.activeTexture.set(Fe.TEXTURE0),$r.bind(h.stepInterpolant?Fe.NEAREST:Fe.LINEAR,Fe.CLAMP_TO_EDGE)}Dt.draw(we,Fe.TRIANGLES,R,l.stencilModeForClipping(We),L,be.disabled,xn,h.id,Xe.layoutVertexBuffer,Xe.indexBuffer,Xe.segments,h.paint,l.transform.zoom,Qe,Xe.layoutVertexBuffer2),ge=!1}}}}},fill:function(l,d,h,m){var T=h.paint.get("fill-color"),P=h.paint.get("fill-opacity");if(P.constantOr(1)!==0){var R=l.colorModeForRenderPass(),L=h.paint.get("fill-pattern"),z=l.opaquePassEnabledForLayer()&&!L.constantOr(1)&&T.constantOr(o.Color.transparent).a===1&&P.constantOr(0)===1?"opaque":"translucent";if(l.renderPass===z){var X=l.depthModeForSublayer(1,l.renderPass==="opaque"?ve.ReadWrite:ve.ReadOnly);Au(l,d,h,m,X,R,!1)}if(l.renderPass==="translucent"&&h.paint.get("fill-antialias")){var ee=l.depthModeForSublayer(h.getPaintProperty("fill-outline-color")?2:0,ve.ReadOnly);Au(l,d,h,m,ee,R,!0)}}},"fill-extrusion":function(l,d,h,m){var T=h.paint.get("fill-extrusion-opacity");if(T!==0&&l.renderPass==="translucent"){var P=new ve(l.context.gl.LEQUAL,ve.ReadWrite,l.depthRangeFor3D);if(T!==1||h.paint.get("fill-extrusion-pattern").constantOr(1))El(l,d,h,m,P,Oe.disabled,he.disabled),El(l,d,h,m,P,l.stencilModeFor3D(),l.colorModeForRenderPass());else{var R=l.colorModeForRenderPass();El(l,d,h,m,P,Oe.disabled,R)}}},hillshade:function(l,d,h,m){if(l.renderPass==="offscreen"||l.renderPass==="translucent"){for(var T=l.context,P=l.depthModeForSublayer(0,ve.ReadOnly),R=l.colorModeForRenderPass(),L=l.renderPass==="translucent"?l.stencilConfigForOverlap(m):[{},m],z=L[0],X=0,ee=L[1];X<ee.length;X+=1){var Z=ee[X],te=d.getTile(Z);te.needsHillshadePrepare&&l.renderPass==="offscreen"?nA(l,te,h,P,Oe.disabled,R):l.renderPass==="translucent"&&gu(l,te,h,P,z[Z.overscaledZ],R)}T.viewport.set([0,0,l.width,l.height])}},raster:function(l,d,h,m){if(l.renderPass==="translucent"&&h.paint.get("raster-opacity")!==0&&m.length)for(var T=l.context,P=T.gl,R=d.getSource(),L=l.useProgram("raster"),z=l.colorModeForRenderPass(),X=R instanceof ut?[{},m]:l.stencilConfigForOverlap(m),ee=X[0],Z=X[1],te=Z[Z.length-1].overscaledZ,oe=!l.options.moving,we=0,Fe=Z;we<Fe.length;we+=1){var ge=Fe[we],Re=l.depthModeForSublayer(ge.overscaledZ-te,h.paint.get("raster-opacity")===1?ve.ReadWrite:ve.ReadOnly,P.LESS),He=d.getTile(ge),We=l.transform.calculatePosMatrix(ge.toUnwrapped(),oe);He.registerFadeDuration(h.paint.get("raster-fade-duration"));var nt=d.findLoadedParent(ge,0),Xe=Bl(He,nt,d,h,l.transform),Qe=void 0,pt=void 0,Dt=h.paint.get("raster-resampling")==="nearest"?P.NEAREST:P.LINEAR;T.activeTexture.set(P.TEXTURE0),He.texture.bind(Dt,P.CLAMP_TO_EDGE,P.LINEAR_MIPMAP_NEAREST),T.activeTexture.set(P.TEXTURE1),nt?(nt.texture.bind(Dt,P.CLAMP_TO_EDGE,P.LINEAR_MIPMAP_NEAREST),Qe=Math.pow(2,nt.tileID.overscaledZ-He.tileID.overscaledZ),pt=[He.tileID.canonical.x*Qe%1,He.tileID.canonical.y*Qe%1]):He.texture.bind(Dt,P.CLAMP_TO_EDGE,P.LINEAR_MIPMAP_NEAREST);var Ct=rA(We,pt||[0,0],Qe||1,Xe,h);R instanceof ut?L.draw(T,P.TRIANGLES,Re,Oe.disabled,z,be.disabled,Ct,h.id,R.boundsBuffer,l.quadTriangleIndexBuffer,R.boundsSegments):L.draw(T,P.TRIANGLES,Re,ee[ge.overscaledZ],z,be.disabled,Ct,h.id,l.rasterBoundsBuffer,l.quadTriangleIndexBuffer,l.rasterBoundsSegments)}},background:function(l,d,h){var m=h.paint.get("background-color"),T=h.paint.get("background-opacity");if(T!==0){var P=l.context,R=P.gl,L=l.transform,z=L.tileSize,X=h.paint.get("background-pattern");if(!l.isPatternMissing(X)){var ee=!X&&m.a===1&&T===1&&l.opaquePassEnabledForLayer()?"opaque":"translucent";if(l.renderPass===ee){var Z=Oe.disabled,te=l.depthModeForSublayer(0,ee==="opaque"?ve.ReadWrite:ve.ReadOnly),oe=l.colorModeForRenderPass(),we=l.useProgram(X?"backgroundPattern":"background"),Fe=L.coveringTiles({tileSize:z});X&&(P.activeTexture.set(R.TEXTURE0),l.imageManager.bind(l.context));for(var ge=h.getCrossfadeParameters(),Re=0,He=Fe;Re<He.length;Re+=1){var We=He[Re],nt=l.transform.calculatePosMatrix(We.toUnwrapped()),Xe=X?Dc(nt,T,l,X,{tileID:We,tileSize:z},ge):Za(nt,T,m);we.draw(P,R.TRIANGLES,te,Z,oe,be.disabled,Xe,h.id,l.tileExtentBuffer,l.quadTriangleIndexBuffer,l.tileExtentSegments)}}}}},debug:function(l,d,h){for(var m=0;m<h.length;m++)Gh(l,d,h[m])},custom:function(l,d,h){var m=l.context,T=h.implementation;if(l.renderPass==="offscreen"){var P=T.prerender;P&&(l.setCustomLayerDefaults(),m.setColorMode(l.colorModeForRenderPass()),P.call(T,m.gl,l.transform.customLayerMatrix()),m.setDirty(),l.setBaseState())}else if(l.renderPass==="translucent"){l.setCustomLayerDefaults(),m.setColorMode(l.colorModeForRenderPass()),m.setStencilMode(Oe.disabled);var R=T.renderingMode==="3d"?new ve(l.context.gl.LEQUAL,ve.ReadWrite,l.depthRangeFor3D):l.depthModeForSublayer(0,ve.ReadOnly);m.setDepthMode(R),T.render(m.gl,l.transform.customLayerMatrix()),m.setDirty(),l.setBaseState(),m.bindFramebuffer.set(null)}}},Wn=function(l,d){this.context=new ae(l),this.transform=d,this._tileTextures={},this.setup(),this.numSublayers=Be.maxUnderzooming+Be.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ba,this.gpuTimers={}};Wn.prototype.resize=function(l,d){if(this.width=l*o.browser.devicePixelRatio,this.height=d*o.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var h=0,m=this.style._order;h<m.length;h+=1)this.style._layers[m[h]].resize()},Wn.prototype.setup=function(){var l=this.context,d=new o.StructArrayLayout2i4;d.emplaceBack(0,0),d.emplaceBack(o.EXTENT,0),d.emplaceBack(0,o.EXTENT),d.emplaceBack(o.EXTENT,o.EXTENT),this.tileExtentBuffer=l.createVertexBuffer(d,hi.members),this.tileExtentSegments=o.SegmentVector.simpleSegment(0,0,4,2);var h=new o.StructArrayLayout2i4;h.emplaceBack(0,0),h.emplaceBack(o.EXTENT,0),h.emplaceBack(0,o.EXTENT),h.emplaceBack(o.EXTENT,o.EXTENT),this.debugBuffer=l.createVertexBuffer(h,hi.members),this.debugSegments=o.SegmentVector.simpleSegment(0,0,4,5);var m=new o.StructArrayLayout4i8;m.emplaceBack(0,0,0,0),m.emplaceBack(o.EXTENT,0,o.EXTENT,0),m.emplaceBack(0,o.EXTENT,0,o.EXTENT),m.emplaceBack(o.EXTENT,o.EXTENT,o.EXTENT,o.EXTENT),this.rasterBoundsBuffer=l.createVertexBuffer(m,rt.members),this.rasterBoundsSegments=o.SegmentVector.simpleSegment(0,0,4,2);var T=new o.StructArrayLayout2i4;T.emplaceBack(0,0),T.emplaceBack(1,0),T.emplaceBack(0,1),T.emplaceBack(1,1),this.viewportBuffer=l.createVertexBuffer(T,hi.members),this.viewportSegments=o.SegmentVector.simpleSegment(0,0,4,2);var P=new o.StructArrayLayout1ui2;P.emplaceBack(0),P.emplaceBack(1),P.emplaceBack(3),P.emplaceBack(2),P.emplaceBack(0),this.tileBorderIndexBuffer=l.createIndexBuffer(P);var R=new o.StructArrayLayout3ui6;R.emplaceBack(0,1,2),R.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=l.createIndexBuffer(R),this.emptyTexture=new o.Texture(l,{width:1,height:1,data:new Uint8Array([0,0,0,0])},l.gl.RGBA);var L=this.context.gl;this.stencilClearMode=new Oe({func:L.ALWAYS,mask:0},0,255,L.ZERO,L.ZERO,L.ZERO)},Wn.prototype.clearStencil=function(){var l=this.context,d=l.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var h=o.create();o.ortho(h,0,this.width,this.height,0,0,1),o.scale(h,h,[d.drawingBufferWidth,d.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(l,d.TRIANGLES,ve.disabled,this.stencilClearMode,he.disabled,be.disabled,Zo(h),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Wn.prototype._renderTileClippingMasks=function(l,d){if(this.currentStencilSource!==l.source&&l.isTileClipped()&&d&&d.length){this.currentStencilSource=l.source;var h=this.context,m=h.gl;this.nextStencilID+d.length>256&&this.clearStencil(),h.setColorMode(he.disabled),h.setDepthMode(ve.disabled);var T=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var P=0,R=d;P<R.length;P+=1){var L=R[P],z=this._tileClippingMaskIDs[L.key]=this.nextStencilID++;T.draw(h,m.TRIANGLES,ve.disabled,new Oe({func:m.ALWAYS,mask:0},z,255,m.KEEP,m.KEEP,m.REPLACE),he.disabled,be.disabled,Zo(L.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},Wn.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var l=this.nextStencilID++,d=this.context.gl;return new Oe({func:d.NOTEQUAL,mask:255},l,255,d.KEEP,d.KEEP,d.REPLACE)},Wn.prototype.stencilModeForClipping=function(l){var d=this.context.gl;return new Oe({func:d.EQUAL,mask:255},this._tileClippingMaskIDs[l.key],0,d.KEEP,d.KEEP,d.REPLACE)},Wn.prototype.stencilConfigForOverlap=function(l){var d,h=this.context.gl,m=l.sort(function(z,X){return X.overscaledZ-z.overscaledZ}),T=m[m.length-1].overscaledZ,P=m[0].overscaledZ-T+1;if(P>1){this.currentStencilSource=void 0,this.nextStencilID+P>256&&this.clearStencil();for(var R={},L=0;L<P;L++)R[L+T]=new Oe({func:h.GEQUAL,mask:255},L+this.nextStencilID,255,h.KEEP,h.KEEP,h.REPLACE);return this.nextStencilID+=P,[R,m]}return[(d={},d[T]=Oe.disabled,d),m]},Wn.prototype.colorModeForRenderPass=function(){var l=this.context.gl;return this._showOverdrawInspector?new he([l.CONSTANT_COLOR,l.ONE],new o.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?he.unblended:he.alphaBlended},Wn.prototype.depthModeForSublayer=function(l,d,h){if(!this.opaquePassEnabledForLayer())return ve.disabled;var m=1-((1+this.currentLayer)*this.numSublayers+l)*this.depthEpsilon;return new ve(h||this.context.gl.LEQUAL,d,[m,m])},Wn.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},Wn.prototype.render=function(l,d){var h=this;this.style=l,this.options=d,this.lineAtlas=l.lineAtlas,this.imageManager=l.imageManager,this.glyphManager=l.glyphManager,this.symbolFadeChange=l.placement.symbolFadeChange(o.browser.now()),this.imageManager.beginFrame();var m=this.style._order,T=this.style.sourceCaches;for(var P in T){var R=T[P];R.used&&R.prepare(this.context)}var L,z,X={},ee={},Z={};for(var te in T){var oe=T[te];X[te]=oe.getVisibleCoordinates(),ee[te]=X[te].slice().reverse(),Z[te]=oe.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var we=0;we<m.length;we++)if(this.style._layers[m[we]].is3D()){this.opaquePassCutoff=we;break}this.renderPass="offscreen";for(var Fe=0,ge=m;Fe<ge.length;Fe+=1){var Re=this.style._layers[ge[Fe]];if(Re.hasOffscreenPass()&&!Re.isHidden(this.transform.zoom)){var He=ee[Re.source];(Re.type==="custom"||He.length)&&this.renderLayer(this,T[Re.source],Re,He)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:d.showOverdrawInspector?o.Color.black:o.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=d.showOverdrawInspector,this.depthRangeFor3D=[0,1-(l._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=m.length-1;this.currentLayer>=0;this.currentLayer--){var We=this.style._layers[m[this.currentLayer]],nt=T[We.source],Xe=X[We.source];this._renderTileClippingMasks(We,Xe),this.renderLayer(this,nt,We,Xe)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<m.length;this.currentLayer++){var Qe=this.style._layers[m[this.currentLayer]],pt=T[Qe.source],Dt=(Qe.type==="symbol"?Z:ee)[Qe.source];this._renderTileClippingMasks(Qe,X[Qe.source]),this.renderLayer(this,pt,Qe,Dt)}this.options.showTileBoundaries&&(o.values(this.style._layers).forEach(function(Ct){Ct.source&&!Ct.isHidden(h.transform.zoom)&&(Ct.source!==(z&&z.id)&&(z=h.style.sourceCaches[Ct.source]),(!L||L.getSource().maxzoom<z.getSource().maxzoom)&&(L=z))}),L&&ic.debug(this,L,L.getVisibleCoordinates())),this.options.showPadding&&function(Ct){var zt=Ct.transform.padding;bf(Ct,Ct.transform.height-(zt.top||0),3,mu),bf(Ct,zt.bottom||0,3,Nc),xf(Ct,zt.left||0,3,rc),xf(Ct,Ct.transform.width-(zt.right||0),3,_u);var sr=Ct.transform.centerPoint;(function(Er,Mr,xn,ar){Sl(Er,Mr-1,xn-10,2,20,ar),Sl(Er,Mr-10,xn-1,20,2,ar)})(Ct,sr.x,Ct.transform.height-sr.y,nc)}(this),this.context.setDefault()},Wn.prototype.renderLayer=function(l,d,h,m){h.isHidden(this.transform.zoom)||(h.type==="background"||h.type==="custom"||m.length)&&(this.id=h.id,this.gpuTimingStart(h),ic[h.type](l,d,h,m,this.style.placement.variableOffsets),this.gpuTimingEnd())},Wn.prototype.gpuTimingStart=function(l){if(this.options.gpuTiming){var d=this.context.extTimerQuery,h=this.gpuTimers[l.id];h||(h=this.gpuTimers[l.id]={calls:0,cpuTime:0,query:d.createQueryEXT()}),h.calls++,d.beginQueryEXT(d.TIME_ELAPSED_EXT,h.query)}},Wn.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var l=this.context.extTimerQuery;l.endQueryEXT(l.TIME_ELAPSED_EXT)}},Wn.prototype.collectGpuTimers=function(){var l=this.gpuTimers;return this.gpuTimers={},l},Wn.prototype.queryGpuTimers=function(l){var d={};for(var h in l){var m=l[h],T=this.context.extTimerQuery,P=T.getQueryObjectEXT(m.query,T.QUERY_RESULT_EXT)/1e6;T.deleteQueryEXT(m.query),d[h]=P}return d},Wn.prototype.translatePosMatrix=function(l,d,h,m,T){if(!h[0]&&!h[1])return l;var P=T?m==="map"?this.transform.angle:0:m==="viewport"?-this.transform.angle:0;if(P){var R=Math.sin(P),L=Math.cos(P);h=[h[0]*L-h[1]*R,h[0]*R+h[1]*L]}var z=[T?h[0]:Rn(d,h[0],this.transform.zoom),T?h[1]:Rn(d,h[1],this.transform.zoom),0],X=new Float32Array(16);return o.translate(X,l,z),X},Wn.prototype.saveTileTexture=function(l){var d=this._tileTextures[l.size[0]];d?d.push(l):this._tileTextures[l.size[0]]=[l]},Wn.prototype.getTileTexture=function(l){var d=this._tileTextures[l];return d&&d.length>0?d.pop():null},Wn.prototype.isPatternMissing=function(l){if(!l)return!1;if(!l.from||!l.to)return!0;var d=this.imageManager.getPattern(l.from.toString()),h=this.imageManager.getPattern(l.to.toString());return!d||!h},Wn.prototype.useProgram=function(l,d){this.cache=this.cache||{};var h=""+l+(d?d.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[h]||(this.cache[h]=new Lh(this.context,l,lu[l],d,zs[l],this._showOverdrawInspector)),this.cache[h]},Wn.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Wn.prototype.setBaseState=function(){var l=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(l.FUNC_ADD)},Wn.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=o.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new o.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},Wn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var yu=function(l,d){this.points=l,this.planes=d};yu.fromInvProjectionMatrix=function(l,d,h){var m=Math.pow(2,h),T=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(function(R){return o.transformMat4([],R,l)}).map(function(R){return o.scale$1([],R,1/R[3]/d*m)}),P=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(R){var L=o.sub([],T[R[0]],T[R[1]]),z=o.sub([],T[R[2]],T[R[1]]),X=o.normalize([],o.cross([],L,z)),ee=-o.dot(X,T[R[1]]);return X.concat(ee)});return new yu(T,P)};var Qo=function(l,d){this.min=l,this.max=d,this.center=o.scale$2([],o.add([],this.min,this.max),.5)};Qo.prototype.quadrant=function(l){for(var d=[l%2==0,l<2],h=o.clone$2(this.min),m=o.clone$2(this.max),T=0;T<d.length;T++)h[T]=d[T]?this.min[T]:this.center[T],m[T]=d[T]?this.center[T]:this.max[T];return m[2]=this.max[2],new Qo(h,m)},Qo.prototype.distanceX=function(l){return Math.max(Math.min(this.max[0],l[0]),this.min[0])-l[0]},Qo.prototype.distanceY=function(l){return Math.max(Math.min(this.max[1],l[1]),this.min[1])-l[1]},Qo.prototype.intersects=function(l){for(var d=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],h=!0,m=0;m<l.planes.length;m++){for(var T=l.planes[m],P=0,R=0;R<d.length;R++)P+=o.dot$1(T,d[R])>=0;if(P===0)return 0;P!==d.length&&(h=!1)}if(h)return 2;for(var L=0;L<3;L++){for(var z=Number.MAX_VALUE,X=-Number.MAX_VALUE,ee=0;ee<l.points.length;ee++){var Z=l.points[ee][L]-this.min[L];z=Math.min(z,Z),X=Math.max(X,Z)}if(X<0||z>this.max[L]-this.min[L])return 0}return 1};var ea=function(l,d,h,m){if(l===void 0&&(l=0),d===void 0&&(d=0),h===void 0&&(h=0),m===void 0&&(m=0),isNaN(l)||l<0||isNaN(d)||d<0||isNaN(h)||h<0||isNaN(m)||m<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=l,this.bottom=d,this.left=h,this.right=m};ea.prototype.interpolate=function(l,d,h){return d.top!=null&&l.top!=null&&(this.top=o.number(l.top,d.top,h)),d.bottom!=null&&l.bottom!=null&&(this.bottom=o.number(l.bottom,d.bottom,h)),d.left!=null&&l.left!=null&&(this.left=o.number(l.left,d.left,h)),d.right!=null&&l.right!=null&&(this.right=o.number(l.right,d.right,h)),this},ea.prototype.getCenter=function(l,d){var h=o.clamp((this.left+l-this.right)/2,0,l),m=o.clamp((this.top+d-this.bottom)/2,0,d);return new o.Point(h,m)},ea.prototype.equals=function(l){return this.top===l.top&&this.bottom===l.bottom&&this.left===l.left&&this.right===l.right},ea.prototype.clone=function(){return new ea(this.top,this.bottom,this.left,this.right)},ea.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var fn=function(l,d,h,m,T){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=T===void 0||T,this._minZoom=l||0,this._maxZoom=d||22,this._minPitch=h??0,this._maxPitch=m??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new o.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ea,this._posMatrixCache={},this._alignedPosMatrixCache={}},Ln={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};fn.prototype.clone=function(){var l=new fn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return l.tileSize=this.tileSize,l.latRange=this.latRange,l.width=this.width,l.height=this.height,l._center=this._center,l.zoom=this.zoom,l.angle=this.angle,l._fov=this._fov,l._pitch=this._pitch,l._unmodified=this._unmodified,l._edgeInsets=this._edgeInsets.clone(),l._calcMatrices(),l},Ln.minZoom.get=function(){return this._minZoom},Ln.minZoom.set=function(l){this._minZoom!==l&&(this._minZoom=l,this.zoom=Math.max(this.zoom,l))},Ln.maxZoom.get=function(){return this._maxZoom},Ln.maxZoom.set=function(l){this._maxZoom!==l&&(this._maxZoom=l,this.zoom=Math.min(this.zoom,l))},Ln.minPitch.get=function(){return this._minPitch},Ln.minPitch.set=function(l){this._minPitch!==l&&(this._minPitch=l,this.pitch=Math.max(this.pitch,l))},Ln.maxPitch.get=function(){return this._maxPitch},Ln.maxPitch.set=function(l){this._maxPitch!==l&&(this._maxPitch=l,this.pitch=Math.min(this.pitch,l))},Ln.renderWorldCopies.get=function(){return this._renderWorldCopies},Ln.renderWorldCopies.set=function(l){l===void 0?l=!0:l===null&&(l=!1),this._renderWorldCopies=l},Ln.worldSize.get=function(){return this.tileSize*this.scale},Ln.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Ln.size.get=function(){return new o.Point(this.width,this.height)},Ln.bearing.get=function(){return-this.angle/Math.PI*180},Ln.bearing.set=function(l){var d=-o.wrap(l,-180,180)*Math.PI/180;this.angle!==d&&(this._unmodified=!1,this.angle=d,this._calcMatrices(),this.rotationMatrix=o.create$2(),o.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Ln.pitch.get=function(){return this._pitch/Math.PI*180},Ln.pitch.set=function(l){var d=o.clamp(l,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==d&&(this._unmodified=!1,this._pitch=d,this._calcMatrices())},Ln.fov.get=function(){return this._fov/Math.PI*180},Ln.fov.set=function(l){l=Math.max(.01,Math.min(60,l)),this._fov!==l&&(this._unmodified=!1,this._fov=l/180*Math.PI,this._calcMatrices())},Ln.zoom.get=function(){return this._zoom},Ln.zoom.set=function(l){var d=Math.min(Math.max(l,this.minZoom),this.maxZoom);this._zoom!==d&&(this._unmodified=!1,this._zoom=d,this.scale=this.zoomScale(d),this.tileZoom=Math.floor(d),this.zoomFraction=d-this.tileZoom,this._constrain(),this._calcMatrices())},Ln.center.get=function(){return this._center},Ln.center.set=function(l){l.lat===this._center.lat&&l.lng===this._center.lng||(this._unmodified=!1,this._center=l,this._constrain(),this._calcMatrices())},Ln.padding.get=function(){return this._edgeInsets.toJSON()},Ln.padding.set=function(l){this._edgeInsets.equals(l)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,l,1),this._calcMatrices())},Ln.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},fn.prototype.isPaddingEqual=function(l){return this._edgeInsets.equals(l)},fn.prototype.interpolatePadding=function(l,d,h){this._unmodified=!1,this._edgeInsets.interpolate(l,d,h),this._constrain(),this._calcMatrices()},fn.prototype.coveringZoomLevel=function(l){var d=(l.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/l.tileSize));return Math.max(0,d)},fn.prototype.getVisibleUnwrappedCoordinates=function(l){var d=[new o.UnwrappedTileID(0,l)];if(this._renderWorldCopies)for(var h=this.pointCoordinate(new o.Point(0,0)),m=this.pointCoordinate(new o.Point(this.width,0)),T=this.pointCoordinate(new o.Point(this.width,this.height)),P=this.pointCoordinate(new o.Point(0,this.height)),R=Math.floor(Math.min(h.x,m.x,T.x,P.x)),L=Math.floor(Math.max(h.x,m.x,T.x,P.x)),z=R-1;z<=L+1;z++)z!==0&&d.push(new o.UnwrappedTileID(z,l));return d},fn.prototype.coveringTiles=function(l){var d=this.coveringZoomLevel(l),h=d;if(l.minzoom!==void 0&&d<l.minzoom)return[];l.maxzoom!==void 0&&d>l.maxzoom&&(d=l.maxzoom);var m=o.MercatorCoordinate.fromLngLat(this.center),T=Math.pow(2,d),P=[T*m.x,T*m.y,0],R=yu.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,d),L=l.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(L=d);var z=function(Ct){return{aabb:new Qo([Ct*T,0,0],[(Ct+1)*T,T,0]),zoom:0,x:0,y:0,wrap:Ct,fullyVisible:!1}},X=[],ee=[],Z=d,te=l.reparseOverscaled?h:d;if(this._renderWorldCopies)for(var oe=1;oe<=3;oe++)X.push(z(-oe)),X.push(z(oe));for(X.push(z(0));X.length>0;){var we=X.pop(),Fe=we.x,ge=we.y,Re=we.fullyVisible;if(!Re){var He=we.aabb.intersects(R);if(He===0)continue;Re=He===2}var We=we.aabb.distanceX(P),nt=we.aabb.distanceY(P),Xe=Math.max(Math.abs(We),Math.abs(nt));if(we.zoom===Z||Xe>3+(1<<Z-we.zoom)-2&&we.zoom>=L)ee.push({tileID:new o.OverscaledTileID(we.zoom===Z?te:we.zoom,we.wrap,we.zoom,Fe,ge),distanceSq:o.sqrLen([P[0]-.5-Fe,P[1]-.5-ge])});else for(var Qe=0;Qe<4;Qe++){var pt=(Fe<<1)+Qe%2,Dt=(ge<<1)+(Qe>>1);X.push({aabb:we.aabb.quadrant(Qe),zoom:we.zoom+1,x:pt,y:Dt,wrap:we.wrap,fullyVisible:Re})}}return ee.sort(function(Ct,zt){return Ct.distanceSq-zt.distanceSq}).map(function(Ct){return Ct.tileID})},fn.prototype.resize=function(l,d){this.width=l,this.height=d,this.pixelsToGLUnits=[2/l,-2/d],this._constrain(),this._calcMatrices()},Ln.unmodified.get=function(){return this._unmodified},fn.prototype.zoomScale=function(l){return Math.pow(2,l)},fn.prototype.scaleZoom=function(l){return Math.log(l)/Math.LN2},fn.prototype.project=function(l){var d=o.clamp(l.lat,-this.maxValidLatitude,this.maxValidLatitude);return new o.Point(o.mercatorXfromLng(l.lng)*this.worldSize,o.mercatorYfromLat(d)*this.worldSize)},fn.prototype.unproject=function(l){return new o.MercatorCoordinate(l.x/this.worldSize,l.y/this.worldSize).toLngLat()},Ln.point.get=function(){return this.project(this.center)},fn.prototype.setLocationAtPoint=function(l,d){var h=this.pointCoordinate(d),m=this.pointCoordinate(this.centerPoint),T=this.locationCoordinate(l),P=new o.MercatorCoordinate(T.x-(h.x-m.x),T.y-(h.y-m.y));this.center=this.coordinateLocation(P),this._renderWorldCopies&&(this.center=this.center.wrap())},fn.prototype.locationPoint=function(l){return this.coordinatePoint(this.locationCoordinate(l))},fn.prototype.pointLocation=function(l){return this.coordinateLocation(this.pointCoordinate(l))},fn.prototype.locationCoordinate=function(l){return o.MercatorCoordinate.fromLngLat(l)},fn.prototype.coordinateLocation=function(l){return l.toLngLat()},fn.prototype.pointCoordinate=function(l){var d=[l.x,l.y,0,1],h=[l.x,l.y,1,1];o.transformMat4(d,d,this.pixelMatrixInverse),o.transformMat4(h,h,this.pixelMatrixInverse);var m=d[3],T=h[3],P=d[1]/m,R=h[1]/T,L=d[2]/m,z=h[2]/T,X=L===z?0:(0-L)/(z-L);return new o.MercatorCoordinate(o.number(d[0]/m,h[0]/T,X)/this.worldSize,o.number(P,R,X)/this.worldSize)},fn.prototype.coordinatePoint=function(l){var d=[l.x*this.worldSize,l.y*this.worldSize,0,1];return o.transformMat4(d,d,this.pixelMatrix),new o.Point(d[0]/d[3],d[1]/d[3])},fn.prototype.getBounds=function(){return new o.LngLatBounds().extend(this.pointLocation(new o.Point(0,0))).extend(this.pointLocation(new o.Point(this.width,0))).extend(this.pointLocation(new o.Point(this.width,this.height))).extend(this.pointLocation(new o.Point(0,this.height)))},fn.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new o.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},fn.prototype.setMaxBounds=function(l){l?(this.lngRange=[l.getWest(),l.getEast()],this.latRange=[l.getSouth(),l.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},fn.prototype.calculatePosMatrix=function(l,d){d===void 0&&(d=!1);var h=l.key,m=d?this._alignedPosMatrixCache:this._posMatrixCache;if(m[h])return m[h];var T=l.canonical,P=this.worldSize/this.zoomScale(T.z),R=T.x+Math.pow(2,T.z)*l.wrap,L=o.identity(new Float64Array(16));return o.translate(L,L,[R*P,T.y*P,0]),o.scale(L,L,[P/o.EXTENT,P/o.EXTENT,1]),o.multiply(L,d?this.alignedProjMatrix:this.projMatrix,L),m[h]=new Float32Array(L),m[h]},fn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},fn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var l,d,h,m,T=-90,P=90,R=-180,L=180,z=this.size,X=this._unmodified;if(this.latRange){var ee=this.latRange;T=o.mercatorYfromLat(ee[1])*this.worldSize,l=(P=o.mercatorYfromLat(ee[0])*this.worldSize)-T<z.y?z.y/(P-T):0}if(this.lngRange){var Z=this.lngRange;R=o.mercatorXfromLng(Z[0])*this.worldSize,d=(L=o.mercatorXfromLng(Z[1])*this.worldSize)-R<z.x?z.x/(L-R):0}var te=this.point,oe=Math.max(d||0,l||0);if(oe)return this.center=this.unproject(new o.Point(d?(L+R)/2:te.x,l?(P+T)/2:te.y)),this.zoom+=this.scaleZoom(oe),this._unmodified=X,void(this._constraining=!1);if(this.latRange){var we=te.y,Fe=z.y/2;we-Fe<T&&(m=T+Fe),we+Fe>P&&(m=P-Fe)}if(this.lngRange){var ge=te.x,Re=z.x/2;ge-Re<R&&(h=R+Re),ge+Re>L&&(h=L-Re)}h===void 0&&m===void 0||(this.center=this.unproject(new o.Point(h!==void 0?h:te.x,m!==void 0?m:te.y))),this._unmodified=X,this._constraining=!1}},fn.prototype._calcMatrices=function(){if(this.height){var l=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var d=Math.PI/2+this._pitch,h=this._fov*(.5+l.y/this.height),m=Math.sin(h)*this.cameraToCenterDistance/Math.sin(o.clamp(Math.PI-d-h,.01,Math.PI-.01)),T=this.point,P=T.x,R=T.y,L=1.01*(Math.cos(Math.PI/2-this._pitch)*m+this.cameraToCenterDistance),z=this.height/50,X=new Float64Array(16);o.perspective(X,this._fov,this.width/this.height,z,L),X[8]=2*-l.x/this.width,X[9]=2*l.y/this.height,o.scale(X,X,[1,-1,1]),o.translate(X,X,[0,0,-this.cameraToCenterDistance]),o.rotateX(X,X,this._pitch),o.rotateZ(X,X,this.angle),o.translate(X,X,[-P,-R,0]),this.mercatorMatrix=o.scale([],X,[this.worldSize,this.worldSize,this.worldSize]),o.scale(X,X,[1,1,o.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=X,this.invProjMatrix=o.invert([],this.projMatrix);var ee=this.width%2/2,Z=this.height%2/2,te=Math.cos(this.angle),oe=Math.sin(this.angle),we=P-Math.round(P)+te*ee+oe*Z,Fe=R-Math.round(R)+te*Z+oe*ee,ge=new Float64Array(X);if(o.translate(ge,ge,[we>.5?we-1:we,Fe>.5?Fe-1:Fe,0]),this.alignedProjMatrix=ge,X=o.create(),o.scale(X,X,[this.width/2,-this.height/2,1]),o.translate(X,X,[1,-1,0]),this.labelPlaneMatrix=X,X=o.create(),o.scale(X,X,[1,-1,1]),o.translate(X,X,[-1,-1,0]),o.scale(X,X,[2/this.width,2/this.height,1]),this.glCoordMatrix=X,this.pixelMatrix=o.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(X=o.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=X,this._posMatrixCache={},this._alignedPosMatrixCache={}}},fn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var l=this.pointCoordinate(new o.Point(0,0)),d=[l.x*this.worldSize,l.y*this.worldSize,0,1];return o.transformMat4(d,d,this.pixelMatrix)[3]/this.cameraToCenterDistance},fn.prototype.getCameraPoint=function(){var l=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new o.Point(0,l))},fn.prototype.getCameraQueryGeometry=function(l){var d=this.getCameraPoint();if(l.length===1)return[l[0],d];for(var h=d.x,m=d.y,T=d.x,P=d.y,R=0,L=l;R<L.length;R+=1){var z=L[R];h=Math.min(h,z.x),m=Math.min(m,z.y),T=Math.max(T,z.x),P=Math.max(P,z.y)}return[new o.Point(h,m),new o.Point(T,m),new o.Point(T,P),new o.Point(h,P),new o.Point(h,m)]},Object.defineProperties(fn.prototype,Ln);var Vs=function(l){var d,h,m,T;this._hashName=l&&encodeURIComponent(l),o.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(d=this._updateHashUnthrottled.bind(this),h=!1,m=null,T=function(){m=null,h&&(d(),m=setTimeout(T,300),h=!1)},function(){return h=!0,m||T(),m})};Vs.prototype.addTo=function(l){return this._map=l,o.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Vs.prototype.remove=function(){return o.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Vs.prototype.getHashString=function(l){var d=this._map.getCenter(),h=Math.round(100*this._map.getZoom())/100,m=Math.ceil((h*Math.LN2+Math.log(512/360/.5))/Math.LN10),T=Math.pow(10,m),P=Math.round(d.lng*T)/T,R=Math.round(d.lat*T)/T,L=this._map.getBearing(),z=this._map.getPitch(),X="";if(X+=l?"/"+P+"/"+R+"/"+h:h+"/"+R+"/"+P,(L||z)&&(X+="/"+Math.round(10*L)/10),z&&(X+="/"+Math.round(z)),this._hashName){var ee=this._hashName,Z=!1,te=o.window.location.hash.slice(1).split("&").map(function(oe){var we=oe.split("=")[0];return we===ee?(Z=!0,we+"="+X):oe}).filter(function(oe){return oe});return Z||te.push(ee+"="+X),"#"+te.join("&")}return"#"+X},Vs.prototype._getCurrentHash=function(){var l,d=this,h=o.window.location.hash.replace("#","");return this._hashName?(h.split("&").map(function(m){return m.split("=")}).forEach(function(m){m[0]===d._hashName&&(l=m)}),(l&&l[1]||"").split("/")):h.split("/")},Vs.prototype._onHashChange=function(){var l=this._getCurrentHash();if(l.length>=3&&!l.some(function(h){return isNaN(h)})){var d=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(l[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+l[2],+l[1]],zoom:+l[0],bearing:d,pitch:+(l[4]||0)}),!0}return!1},Vs.prototype._updateHashUnthrottled=function(){var l=o.window.location.href.replace(/(#.+)?$/,this.getHashString());try{o.window.history.replaceState(o.window.history.state,null,l)}catch{}};var Il={linearity:.3,easing:o.bezier(0,0,.3,1)},Uc=o.extend({deceleration:2500,maxSpeed:1400},Il),Ml=o.extend({deceleration:20,maxSpeed:1400},Il),iA=o.extend({deceleration:1e3,maxSpeed:360},Il),sA=o.extend({deceleration:1e3,maxSpeed:90},Il),zc=function(l){this._map=l,this.clear()};function Pl(l,d){(!l.duration||l.duration<d.duration)&&(l.duration=d.duration,l.easing=d.easing)}function Fo(l,d,h){var m=h.maxSpeed,T=h.linearity,P=h.deceleration,R=o.clamp(l*T/(d/1e3),-m,m),L=Math.abs(R)/(P*T);return{easing:h.easing,duration:1e3*L,amount:R*(L/2)}}zc.prototype.clear=function(){this._inertiaBuffer=[]},zc.prototype.record=function(l){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:o.browser.now(),settings:l})},zc.prototype._drainInertiaBuffer=function(){for(var l=this._inertiaBuffer,d=o.browser.now();l.length>0&&d-l[0].time>160;)l.shift()},zc.prototype._onMoveEnd=function(l){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var d={zoom:0,bearing:0,pitch:0,pan:new o.Point(0,0),pinchAround:void 0,around:void 0},h=0,m=this._inertiaBuffer;h<m.length;h+=1){var T=m[h].settings;d.zoom+=T.zoomDelta||0,d.bearing+=T.bearingDelta||0,d.pitch+=T.pitchDelta||0,T.panDelta&&d.pan._add(T.panDelta),T.around&&(d.around=T.around),T.pinchAround&&(d.pinchAround=T.pinchAround)}var P=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,R={};if(d.pan.mag()){var L=Fo(d.pan.mag(),P,o.extend({},Uc,l||{}));R.offset=d.pan.mult(L.amount/d.pan.mag()),R.center=this._map.transform.center,Pl(R,L)}if(d.zoom){var z=Fo(d.zoom,P,Ml);R.zoom=this._map.transform.zoom+z.amount,Pl(R,z)}if(d.bearing){var X=Fo(d.bearing,P,iA);R.bearing=this._map.transform.bearing+o.clamp(X.amount,-179,179),Pl(R,X)}if(d.pitch){var ee=Fo(d.pitch,P,sA);R.pitch=this._map.transform.pitch+ee.amount,Pl(R,ee)}if(R.zoom||R.bearing){var Z=d.pinchAround===void 0?d.around:d.pinchAround;R.around=Z?this._map.unproject(Z):this._map.getCenter()}return this.clear(),o.extend(R,{noMoveStart:!0})}};var kn=function(l){function d(m,T,P,R){R===void 0&&(R={});var L=f.mousePos(T.getCanvasContainer(),P),z=T.unproject(L);l.call(this,m,o.extend({point:L,lngLat:z,originalEvent:P},R)),this._defaultPrevented=!1,this.target=T}l&&(d.__proto__=l),(d.prototype=Object.create(l&&l.prototype)).constructor=d;var h={defaultPrevented:{configurable:!0}};return d.prototype.preventDefault=function(){this._defaultPrevented=!0},h.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(d.prototype,h),d}(o.Event),Gc=function(l){function d(m,T,P){var R=m==="touchend"?P.changedTouches:P.touches,L=f.touchPos(T.getCanvasContainer(),R),z=L.map(function(Z){return T.unproject(Z)}),X=L.reduce(function(Z,te,oe,we){return Z.add(te.div(we.length))},new o.Point(0,0)),ee=T.unproject(X);l.call(this,m,{points:L,point:X,lngLats:z,lngLat:ee,originalEvent:P}),this._defaultPrevented=!1}l&&(d.__proto__=l),(d.prototype=Object.create(l&&l.prototype)).constructor=d;var h={defaultPrevented:{configurable:!0}};return d.prototype.preventDefault=function(){this._defaultPrevented=!0},h.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(d.prototype,h),d}(o.Event),Vh=function(l){function d(m,T,P){l.call(this,m,{originalEvent:P}),this._defaultPrevented=!1}l&&(d.__proto__=l),(d.prototype=Object.create(l&&l.prototype)).constructor=d;var h={defaultPrevented:{configurable:!0}};return d.prototype.preventDefault=function(){this._defaultPrevented=!0},h.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(d.prototype,h),d}(o.Event),Ci=function(l,d){this._map=l,this._clickTolerance=d.clickTolerance};Ci.prototype.reset=function(){delete this._mousedownPos},Ci.prototype.wheel=function(l){return this._firePreventable(new Vh(l.type,this._map,l))},Ci.prototype.mousedown=function(l,d){return this._mousedownPos=d,this._firePreventable(new kn(l.type,this._map,l))},Ci.prototype.mouseup=function(l){this._map.fire(new kn(l.type,this._map,l))},Ci.prototype.click=function(l,d){this._mousedownPos&&this._mousedownPos.dist(d)>=this._clickTolerance||this._map.fire(new kn(l.type,this._map,l))},Ci.prototype.dblclick=function(l){return this._firePreventable(new kn(l.type,this._map,l))},Ci.prototype.mouseover=function(l){this._map.fire(new kn(l.type,this._map,l))},Ci.prototype.mouseout=function(l){this._map.fire(new kn(l.type,this._map,l))},Ci.prototype.touchstart=function(l){return this._firePreventable(new Gc(l.type,this._map,l))},Ci.prototype.touchmove=function(l){this._map.fire(new Gc(l.type,this._map,l))},Ci.prototype.touchend=function(l){this._map.fire(new Gc(l.type,this._map,l))},Ci.prototype.touchcancel=function(l){this._map.fire(new Gc(l.type,this._map,l))},Ci.prototype._firePreventable=function(l){if(this._map.fire(l),l.defaultPrevented)return{}},Ci.prototype.isEnabled=function(){return!0},Ci.prototype.isActive=function(){return!1},Ci.prototype.enable=function(){},Ci.prototype.disable=function(){};var or=function(l){this._map=l};or.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},or.prototype.mousemove=function(l){this._map.fire(new kn(l.type,this._map,l))},or.prototype.mousedown=function(){this._delayContextMenu=!0},or.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new kn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},or.prototype.contextmenu=function(l){this._delayContextMenu?this._contextMenuEvent=l:this._map.fire(new kn(l.type,this._map,l)),this._map.listens("contextmenu")&&l.preventDefault()},or.prototype.isEnabled=function(){return!0},or.prototype.isActive=function(){return!1},or.prototype.enable=function(){},or.prototype.disable=function(){};var Ss=function(l,d){this._map=l,this._el=l.getCanvasContainer(),this._container=l.getContainer(),this._clickTolerance=d.clickTolerance||1};function vu(l,d){for(var h={},m=0;m<l.length;m++)h[l[m].identifier]=d[m];return h}Ss.prototype.isEnabled=function(){return!!this._enabled},Ss.prototype.isActive=function(){return!!this._active},Ss.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Ss.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Ss.prototype.mousedown=function(l,d){this.isEnabled()&&l.shiftKey&&l.button===0&&(f.disableDrag(),this._startPos=this._lastPos=d,this._active=!0)},Ss.prototype.mousemoveWindow=function(l,d){if(this._active){var h=d;if(!(this._lastPos.equals(h)||!this._box&&h.dist(this._startPos)<this._clickTolerance)){var m=this._startPos;this._lastPos=h,this._box||(this._box=f.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",l));var T=Math.min(m.x,h.x),P=Math.max(m.x,h.x),R=Math.min(m.y,h.y),L=Math.max(m.y,h.y);f.setTransform(this._box,"translate("+T+"px,"+R+"px)"),this._box.style.width=P-T+"px",this._box.style.height=L-R+"px"}}},Ss.prototype.mouseupWindow=function(l,d){var h=this;if(this._active&&l.button===0){var m=this._startPos,T=d;if(this.reset(),f.suppressClick(),m.x!==T.x||m.y!==T.y)return this._map.fire(new o.Event("boxzoomend",{originalEvent:l})),{cameraAnimation:function(P){return P.fitScreenCoordinates(m,T,h._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",l)}},Ss.prototype.keydown=function(l){this._active&&l.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",l))},Ss.prototype.blur=function(){this.reset()},Ss.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(f.remove(this._box),this._box=null),f.enableDrag(),delete this._startPos,delete this._lastPos},Ss.prototype._fireEvent=function(l,d){return this._map.fire(new o.Event(l,{originalEvent:d}))};var Hs=function(l){this.reset(),this.numTouches=l.numTouches};Hs.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Hs.prototype.touchstart=function(l,d,h){(this.centroid||h.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=l.timeStamp),h.length===this.numTouches&&(this.centroid=function(m){for(var T=new o.Point(0,0),P=0,R=m;P<R.length;P+=1)T._add(R[P]);return T.div(m.length)}(d),this.touches=vu(h,d)))},Hs.prototype.touchmove=function(l,d,h){if(!this.aborted&&this.centroid){var m=vu(h,d);for(var T in this.touches){var P=m[T];(!P||P.dist(this.touches[T])>30)&&(this.aborted=!0)}}},Hs.prototype.touchend=function(l,d,h){if((!this.centroid||l.timeStamp-this.startTime>500)&&(this.aborted=!0),h.length===0){var m=!this.aborted&&this.centroid;if(this.reset(),m)return m}};var ro=function(l){this.singleTap=new Hs(l),this.numTaps=l.numTaps,this.reset()};ro.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},ro.prototype.touchstart=function(l,d,h){this.singleTap.touchstart(l,d,h)},ro.prototype.touchmove=function(l,d,h){this.singleTap.touchmove(l,d,h)},ro.prototype.touchend=function(l,d,h){var m=this.singleTap.touchend(l,d,h);if(m){var T=l.timeStamp-this.lastTime<500,P=!this.lastTap||this.lastTap.dist(m)<30;if(T&&P||this.reset(),this.count++,this.lastTime=l.timeStamp,this.lastTap=m,this.count===this.numTaps)return this.reset(),m}};var _s=function(){this._zoomIn=new ro({numTouches:1,numTaps:2}),this._zoomOut=new ro({numTouches:2,numTaps:1}),this.reset()};_s.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},_s.prototype.touchstart=function(l,d,h){this._zoomIn.touchstart(l,d,h),this._zoomOut.touchstart(l,d,h)},_s.prototype.touchmove=function(l,d,h){this._zoomIn.touchmove(l,d,h),this._zoomOut.touchmove(l,d,h)},_s.prototype.touchend=function(l,d,h){var m=this,T=this._zoomIn.touchend(l,d,h),P=this._zoomOut.touchend(l,d,h);return T?(this._active=!0,l.preventDefault(),setTimeout(function(){return m.reset()},0),{cameraAnimation:function(R){return R.easeTo({duration:300,zoom:R.getZoom()+1,around:R.unproject(T)},{originalEvent:l})}}):P?(this._active=!0,l.preventDefault(),setTimeout(function(){return m.reset()},0),{cameraAnimation:function(R){return R.easeTo({duration:300,zoom:R.getZoom()-1,around:R.unproject(P)},{originalEvent:l})}}):void 0},_s.prototype.touchcancel=function(){this.reset()},_s.prototype.enable=function(){this._enabled=!0},_s.prototype.disable=function(){this._enabled=!1,this.reset()},_s.prototype.isEnabled=function(){return this._enabled},_s.prototype.isActive=function(){return this._active};var wf={0:1,2:2},Yt=function(l){this.reset(),this._clickTolerance=l.clickTolerance||1};Yt.prototype.blur=function(){this.reset()},Yt.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Yt.prototype._correctButton=function(l,d){return!1},Yt.prototype._move=function(l,d){return{}},Yt.prototype.mousedown=function(l,d){if(!this._lastPoint){var h=f.mouseButton(l);this._correctButton(l,h)&&(this._lastPoint=d,this._eventButton=h)}},Yt.prototype.mousemoveWindow=function(l,d){var h=this._lastPoint;if(h){if(l.preventDefault(),function(m,T){var P=wf[T];return m.buttons===void 0||(m.buttons&P)!==P}(l,this._eventButton))this.reset();else if(this._moved||!(d.dist(h)<this._clickTolerance))return this._moved=!0,this._lastPoint=d,this._move(h,d)}},Yt.prototype.mouseupWindow=function(l){this._lastPoint&&f.mouseButton(l)===this._eventButton&&(this._moved&&f.suppressClick(),this.reset())},Yt.prototype.enable=function(){this._enabled=!0},Yt.prototype.disable=function(){this._enabled=!1,this.reset()},Yt.prototype.isEnabled=function(){return this._enabled},Yt.prototype.isActive=function(){return this._active};var Cf=function(l){function d(){l.apply(this,arguments)}return l&&(d.__proto__=l),(d.prototype=Object.create(l&&l.prototype)).constructor=d,d.prototype.mousedown=function(h,m){l.prototype.mousedown.call(this,h,m),this._lastPoint&&(this._active=!0)},d.prototype._correctButton=function(h,m){return m===0&&!h.ctrlKey},d.prototype._move=function(h,m){return{around:m,panDelta:m.sub(h)}},d}(Yt),bu=function(l){function d(){l.apply(this,arguments)}return l&&(d.__proto__=l),(d.prototype=Object.create(l&&l.prototype)).constructor=d,d.prototype._correctButton=function(h,m){return m===0&&h.ctrlKey||m===2},d.prototype._move=function(h,m){var T=.8*(m.x-h.x);if(T)return this._active=!0,{bearingDelta:T}},d.prototype.contextmenu=function(h){h.preventDefault()},d}(Yt),Tf=function(l){function d(){l.apply(this,arguments)}return l&&(d.__proto__=l),(d.prototype=Object.create(l&&l.prototype)).constructor=d,d.prototype._correctButton=function(h,m){return m===0&&h.ctrlKey||m===2},d.prototype._move=function(h,m){var T=-.5*(m.y-h.y);if(T)return this._active=!0,{pitchDelta:T}},d.prototype.contextmenu=function(h){h.preventDefault()},d}(Yt),no=function(l){this._minTouches=1,this._clickTolerance=l.clickTolerance||1,this.reset()};no.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new o.Point(0,0)},no.prototype.touchstart=function(l,d,h){return this._calculateTransform(l,d,h)},no.prototype.touchmove=function(l,d,h){if(this._active&&!(h.length<this._minTouches))return l.preventDefault(),this._calculateTransform(l,d,h)},no.prototype.touchend=function(l,d,h){this._calculateTransform(l,d,h),this._active&&h.length<this._minTouches&&this.reset()},no.prototype.touchcancel=function(){this.reset()},no.prototype._calculateTransform=function(l,d,h){h.length>0&&(this._active=!0);var m=vu(h,d),T=new o.Point(0,0),P=new o.Point(0,0),R=0;for(var L in m){var z=m[L],X=this._touches[L];X&&(T._add(z),P._add(z.sub(X)),R++,m[L]=z)}if(this._touches=m,!(R<this._minTouches)&&P.mag()){var ee=P.div(R);if(this._sum._add(ee),!(this._sum.mag()<this._clickTolerance))return{around:T.div(R),panDelta:ee}}},no.prototype.enable=function(){this._enabled=!0},no.prototype.disable=function(){this._enabled=!1,this.reset()},no.prototype.isEnabled=function(){return this._enabled},no.prototype.isActive=function(){return this._active};var Is=function(){this.reset()};function xu(l,d,h){for(var m=0;m<l.length;m++)if(l[m].identifier===h)return d[m]}function wu(l,d){return Math.log(l/d)/Math.LN2}Is.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Is.prototype._start=function(l){},Is.prototype._move=function(l,d,h){return{}},Is.prototype.touchstart=function(l,d,h){this._firstTwoTouches||h.length<2||(this._firstTwoTouches=[h[0].identifier,h[1].identifier],this._start([d[0],d[1]]))},Is.prototype.touchmove=function(l,d,h){if(this._firstTwoTouches){l.preventDefault();var m=this._firstTwoTouches,T=m[1],P=xu(h,d,m[0]),R=xu(h,d,T);if(P&&R){var L=this._aroundCenter?null:P.add(R).div(2);return this._move([P,R],L,l)}}},Is.prototype.touchend=function(l,d,h){if(this._firstTwoTouches){var m=this._firstTwoTouches,T=m[1],P=xu(h,d,m[0]),R=xu(h,d,T);P&&R||(this._active&&f.suppressClick(),this.reset())}},Is.prototype.touchcancel=function(){this.reset()},Is.prototype.enable=function(l){this._enabled=!0,this._aroundCenter=!!l&&l.around==="center"},Is.prototype.disable=function(){this._enabled=!1,this.reset()},Is.prototype.isEnabled=function(){return this._enabled},Is.prototype.isActive=function(){return this._active};var Ms=function(l){function d(){l.apply(this,arguments)}return l&&(d.__proto__=l),(d.prototype=Object.create(l&&l.prototype)).constructor=d,d.prototype.reset=function(){l.prototype.reset.call(this),delete this._distance,delete this._startDistance},d.prototype._start=function(h){this._startDistance=this._distance=h[0].dist(h[1])},d.prototype._move=function(h,m){var T=this._distance;if(this._distance=h[0].dist(h[1]),this._active||!(Math.abs(wu(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:wu(this._distance,T),pinchAround:m}},d}(Is);function ta(l,d){return 180*l.angleWith(d)/Math.PI}var Ef=function(l){function d(){l.apply(this,arguments)}return l&&(d.__proto__=l),(d.prototype=Object.create(l&&l.prototype)).constructor=d,d.prototype.reset=function(){l.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},d.prototype._start=function(h){this._startVector=this._vector=h[0].sub(h[1]),this._minDiameter=h[0].dist(h[1])},d.prototype._move=function(h,m){var T=this._vector;if(this._vector=h[0].sub(h[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ta(this._vector,T),pinchAround:m}},d.prototype._isBelowThreshold=function(h){this._minDiameter=Math.min(this._minDiameter,h.mag());var m=25/(Math.PI*this._minDiameter)*360,T=ta(h,this._startVector);return Math.abs(T)<m},d}(Is);function Vc(l){return Math.abs(l.y)>Math.abs(l.x)}var Ti=function(l){function d(){l.apply(this,arguments)}return l&&(d.__proto__=l),(d.prototype=Object.create(l&&l.prototype)).constructor=d,d.prototype.reset=function(){l.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},d.prototype._start=function(h){this._lastPoints=h,Vc(h[0].sub(h[1]))&&(this._valid=!1)},d.prototype._move=function(h,m,T){var P=h[0].sub(this._lastPoints[0]),R=h[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(P,R,T.timeStamp),this._valid)return this._lastPoints=h,this._active=!0,{pitchDelta:(P.y+R.y)/2*-.5}},d.prototype.gestureBeginsVertically=function(h,m,T){if(this._valid!==void 0)return this._valid;var P=h.mag()>=2,R=m.mag()>=2;if(P||R){if(!P||!R)return this._firstMove===void 0&&(this._firstMove=T),T-this._firstMove<100&&void 0;var L=h.y>0==m.y>0;return Vc(h)&&Vc(m)&&L}},d}(Is),Bf={panStep:100,bearingStep:15,pitchStep:10},Co=function(){var l=Bf;this._panStep=l.panStep,this._bearingStep=l.bearingStep,this._pitchStep=l.pitchStep,this._rotationDisabled=!1};function is(l){return l*(2-l)}Co.prototype.blur=function(){this.reset()},Co.prototype.reset=function(){this._active=!1},Co.prototype.keydown=function(l){var d=this;if(!(l.altKey||l.ctrlKey||l.metaKey)){var h=0,m=0,T=0,P=0,R=0;switch(l.keyCode){case 61:case 107:case 171:case 187:h=1;break;case 189:case 109:case 173:h=-1;break;case 37:l.shiftKey?m=-1:(l.preventDefault(),P=-1);break;case 39:l.shiftKey?m=1:(l.preventDefault(),P=1);break;case 38:l.shiftKey?T=1:(l.preventDefault(),R=-1);break;case 40:l.shiftKey?T=-1:(l.preventDefault(),R=1);break;default:return}return this._rotationDisabled&&(m=0,T=0),{cameraAnimation:function(L){var z=L.getZoom();L.easeTo({duration:300,easeId:"keyboardHandler",easing:is,zoom:h?Math.round(z)+h*(l.shiftKey?2:1):z,bearing:L.getBearing()+m*d._bearingStep,pitch:L.getPitch()+T*d._pitchStep,offset:[-P*d._panStep,-R*d._panStep],center:L.getCenter()},{originalEvent:l})}}}},Co.prototype.enable=function(){this._enabled=!0},Co.prototype.disable=function(){this._enabled=!1,this.reset()},Co.prototype.isEnabled=function(){return this._enabled},Co.prototype.isActive=function(){return this._active},Co.prototype.disableRotation=function(){this._rotationDisabled=!0},Co.prototype.enableRotation=function(){this._rotationDisabled=!1};var Hr=function(l,d){this._map=l,this._el=l.getCanvasContainer(),this._handler=d,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,o.bindAll(["_onTimeout"],this)};Hr.prototype.setZoomRate=function(l){this._defaultZoomRate=l},Hr.prototype.setWheelZoomRate=function(l){this._wheelZoomRate=l},Hr.prototype.isEnabled=function(){return!!this._enabled},Hr.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},Hr.prototype.isZooming=function(){return!!this._zooming},Hr.prototype.enable=function(l){this.isEnabled()||(this._enabled=!0,this._aroundCenter=l&&l.around==="center")},Hr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Hr.prototype.wheel=function(l){if(this.isEnabled()){var d=l.deltaMode===o.window.WheelEvent.DOM_DELTA_LINE?40*l.deltaY:l.deltaY,h=o.browser.now(),m=h-(this._lastWheelEventTime||0);this._lastWheelEventTime=h,d!==0&&d%4.000244140625==0?this._type="wheel":d!==0&&Math.abs(d)<4?this._type="trackpad":m>400?(this._type=null,this._lastValue=d,this._timeout=setTimeout(this._onTimeout,40,l)):this._type||(this._type=Math.abs(m*d)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,d+=this._lastValue)),l.shiftKey&&d&&(d/=4),this._type&&(this._lastWheelEvent=l,this._delta-=d,this._active||this._start(l)),l.preventDefault()}},Hr.prototype._onTimeout=function(l){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(l)},Hr.prototype._start=function(l){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var d=f.mousePos(this._el,l);this._around=o.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(d)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},Hr.prototype.renderFrame=function(){var l=this;if(this._frameId&&(this._frameId=null,this.isActive())){var d=this._map.transform;if(this._delta!==0){var h=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,m=2/(1+Math.exp(-Math.abs(this._delta*h)));this._delta<0&&m!==0&&(m=1/m);var T=typeof this._targetZoom=="number"?d.zoomScale(this._targetZoom):d.scale;this._targetZoom=Math.min(d.maxZoom,Math.max(d.minZoom,d.scaleZoom(T*m))),this._type==="wheel"&&(this._startZoom=d.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var P,R=typeof this._targetZoom=="number"?this._targetZoom:d.zoom,L=this._startZoom,z=this._easing,X=!1;if(this._type==="wheel"&&L&&z){var ee=Math.min((o.browser.now()-this._lastWheelEventTime)/200,1),Z=z(ee);P=o.number(L,R,Z),ee<1?this._frameId||(this._frameId=!0):X=!0}else P=R,X=!0;return this._active=!0,X&&(this._active=!1,this._finishTimeout=setTimeout(function(){l._zooming=!1,l._handler._triggerRenderFrame(),delete l._targetZoom,delete l._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!X,zoomDelta:P-d.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},Hr.prototype._smoothOutEasing=function(l){var d=o.ease;if(this._prevEase){var h=this._prevEase,m=(o.browser.now()-h.start)/h.duration,T=h.easing(m+.01)-h.easing(m),P=.27/Math.sqrt(T*T+1e-4)*.01,R=Math.sqrt(.0729-P*P);d=o.bezier(P,R,.25,1)}return this._prevEase={start:o.browser.now(),duration:l,easing:d},d},Hr.prototype.blur=function(){this.reset()},Hr.prototype.reset=function(){this._active=!1};var Do=function(l,d){this._clickZoom=l,this._tapZoom=d};Do.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Do.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Do.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Do.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var io=function(){this.reset()};io.prototype.reset=function(){this._active=!1},io.prototype.blur=function(){this.reset()},io.prototype.dblclick=function(l,d){return l.preventDefault(),{cameraAnimation:function(h){h.easeTo({duration:300,zoom:h.getZoom()+(l.shiftKey?-1:1),around:h.unproject(d)},{originalEvent:l})}}},io.prototype.enable=function(){this._enabled=!0},io.prototype.disable=function(){this._enabled=!1,this.reset()},io.prototype.isEnabled=function(){return this._enabled},io.prototype.isActive=function(){return this._active};var Xi=function(){this._tap=new ro({numTouches:1,numTaps:1}),this.reset()};Xi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Xi.prototype.touchstart=function(l,d,h){this._swipePoint||(this._tapTime&&l.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?h.length>0&&(this._swipePoint=d[0],this._swipeTouch=h[0].identifier):this._tap.touchstart(l,d,h))},Xi.prototype.touchmove=function(l,d,h){if(this._tapTime){if(this._swipePoint){if(h[0].identifier!==this._swipeTouch)return;var m=d[0],T=m.y-this._swipePoint.y;return this._swipePoint=m,l.preventDefault(),this._active=!0,{zoomDelta:T/128}}}else this._tap.touchmove(l,d,h)},Xi.prototype.touchend=function(l,d,h){this._tapTime?this._swipePoint&&h.length===0&&this.reset():this._tap.touchend(l,d,h)&&(this._tapTime=l.timeStamp)},Xi.prototype.touchcancel=function(){this.reset()},Xi.prototype.enable=function(){this._enabled=!0},Xi.prototype.disable=function(){this._enabled=!1,this.reset()},Xi.prototype.isEnabled=function(){return this._enabled},Xi.prototype.isActive=function(){return this._active};var Ia=function(l,d,h){this._el=l,this._mousePan=d,this._touchPan=h};Ia.prototype.enable=function(l){this._inertiaOptions=l||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Ia.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Ia.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Ia.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var ra=function(l,d,h){this._pitchWithRotate=l.pitchWithRotate,this._mouseRotate=d,this._mousePitch=h};ra.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},ra.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},ra.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},ra.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var so=function(l,d,h,m){this._el=l,this._touchZoom=d,this._touchRotate=h,this._tapDragZoom=m,this._rotationDisabled=!1,this._enabled=!0};so.prototype.enable=function(l){this._touchZoom.enable(l),this._rotationDisabled||this._touchRotate.enable(l),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},so.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},so.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},so.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},so.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},so.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var ss=function(l){return l.zoom||l.drag||l.pitch||l.rotate},Rl=function(l){function d(){l.apply(this,arguments)}return l&&(d.__proto__=l),(d.prototype=Object.create(l&&l.prototype)).constructor=d,d}(o.Event);function wr(l){return l.panDelta&&l.panDelta.mag()||l.zoomDelta||l.bearingDelta||l.pitchDelta}var ur=function(l,d){this._map=l,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new zc(l),this._bearingSnap=d.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(d),o.bindAll(["handleEvent","handleWindowEvent"],this);var h=this._el;this._listeners=[[h,"touchstart",{passive:!0}],[h,"touchmove",{passive:!1}],[h,"touchend",void 0],[h,"touchcancel",void 0],[h,"mousedown",void 0],[h,"mousemove",void 0],[h,"mouseup",void 0],[o.window.document,"mousemove",{capture:!0}],[o.window.document,"mouseup",void 0],[h,"mouseover",void 0],[h,"mouseout",void 0],[h,"dblclick",void 0],[h,"click",void 0],[h,"keydown",{capture:!1}],[h,"keyup",void 0],[h,"wheel",{passive:!1}],[h,"contextmenu",void 0],[o.window,"blur",void 0]];for(var m=0,T=this._listeners;m<T.length;m+=1){var P=T[m],R=P[0];f.addEventListener(R,P[1],R===o.window.document?this.handleWindowEvent:this.handleEvent,P[2])}};ur.prototype.destroy=function(){for(var l=0,d=this._listeners;l<d.length;l+=1){var h=d[l],m=h[0];f.removeEventListener(m,h[1],m===o.window.document?this.handleWindowEvent:this.handleEvent,h[2])}},ur.prototype._addDefaultHandlers=function(l){var d=this._map,h=d.getCanvasContainer();this._add("mapEvent",new Ci(d,l));var m=d.boxZoom=new Ss(d,l);this._add("boxZoom",m);var T=new _s,P=new io;d.doubleClickZoom=new Do(P,T),this._add("tapZoom",T),this._add("clickZoom",P);var R=new Xi;this._add("tapDragZoom",R);var L=d.touchPitch=new Ti;this._add("touchPitch",L);var z=new bu(l),X=new Tf(l);d.dragRotate=new ra(l,z,X),this._add("mouseRotate",z,["mousePitch"]),this._add("mousePitch",X,["mouseRotate"]);var ee=new Cf(l),Z=new no(l);d.dragPan=new Ia(h,ee,Z),this._add("mousePan",ee),this._add("touchPan",Z,["touchZoom","touchRotate"]);var te=new Ef,oe=new Ms;d.touchZoomRotate=new so(h,oe,te,R),this._add("touchRotate",te,["touchPan","touchZoom"]),this._add("touchZoom",oe,["touchPan","touchRotate"]);var we=d.scrollZoom=new Hr(d,this);this._add("scrollZoom",we,["mousePan"]);var Fe=d.keyboard=new Co;this._add("keyboard",Fe),this._add("blockableMapEvent",new or(d));for(var ge=0,Re=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];ge<Re.length;ge+=1){var He=Re[ge];l.interactive&&l[He]&&d[He].enable(l[He])}},ur.prototype._add=function(l,d,h){this._handlers.push({handlerName:l,handler:d,allowed:h}),this._handlersById[l]=d},ur.prototype.stop=function(l){if(!this._updatingCamera){for(var d=0,h=this._handlers;d<h.length;d+=1)h[d].handler.reset();this._inertia.clear(),this._fireEvents({},{},l),this._changes=[]}},ur.prototype.isActive=function(){for(var l=0,d=this._handlers;l<d.length;l+=1)if(d[l].handler.isActive())return!0;return!1},ur.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},ur.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},ur.prototype.isMoving=function(){return!!ss(this._eventsInProgress)||this.isZooming()},ur.prototype._blockedByActive=function(l,d,h){for(var m in l)if(m!==h&&(!d||d.indexOf(m)<0))return!0;return!1},ur.prototype.handleWindowEvent=function(l){this.handleEvent(l,l.type+"Window")},ur.prototype._getMapTouches=function(l){for(var d=[],h=0,m=l;h<m.length;h+=1){var T=m[h];this._el.contains(T.target)&&d.push(T)}return d},ur.prototype.handleEvent=function(l,d){this._updatingCamera=!0;for(var h=l.type==="renderFrame"?void 0:l,m={needsRenderFrame:!1},T={},P={},R=l.touches?this._getMapTouches(l.touches):void 0,L=R?f.touchPos(this._el,R):f.mousePos(this._el,l),z=0,X=this._handlers;z<X.length;z+=1){var ee=X[z],Z=ee.handlerName,te=ee.handler,oe=ee.allowed;if(te.isEnabled()){var we=void 0;this._blockedByActive(P,oe,Z)?te.reset():te[d||l.type]&&(we=te[d||l.type](l,L,R),this.mergeHandlerResult(m,T,we,Z,h),we&&we.needsRenderFrame&&this._triggerRenderFrame()),(we||te.isActive())&&(P[Z]=te)}}var Fe={};for(var ge in this._previousActiveHandlers)P[ge]||(Fe[ge]=h);this._previousActiveHandlers=P,(Object.keys(Fe).length||wr(m))&&(this._changes.push([m,T,Fe]),this._triggerRenderFrame()),(Object.keys(P).length||wr(m))&&this._map._stop(!0),this._updatingCamera=!1;var Re=m.cameraAnimation;Re&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],Re(this._map))},ur.prototype.mergeHandlerResult=function(l,d,h,m,T){if(h){o.extend(l,h);var P={handlerName:m,originalEvent:h.originalEvent||T};h.zoomDelta!==void 0&&(d.zoom=P),h.panDelta!==void 0&&(d.drag=P),h.pitchDelta!==void 0&&(d.pitch=P),h.bearingDelta!==void 0&&(d.rotate=P)}},ur.prototype._applyChanges=function(){for(var l={},d={},h={},m=0,T=this._changes;m<T.length;m+=1){var P=T[m],R=P[0],L=P[1],z=P[2];R.panDelta&&(l.panDelta=(l.panDelta||new o.Point(0,0))._add(R.panDelta)),R.zoomDelta&&(l.zoomDelta=(l.zoomDelta||0)+R.zoomDelta),R.bearingDelta&&(l.bearingDelta=(l.bearingDelta||0)+R.bearingDelta),R.pitchDelta&&(l.pitchDelta=(l.pitchDelta||0)+R.pitchDelta),R.around!==void 0&&(l.around=R.around),R.pinchAround!==void 0&&(l.pinchAround=R.pinchAround),R.noInertia&&(l.noInertia=R.noInertia),o.extend(d,L),o.extend(h,z)}this._updateMapTransform(l,d,h),this._changes=[]},ur.prototype._updateMapTransform=function(l,d,h){var m=this._map,T=m.transform;if(!wr(l))return this._fireEvents(d,h,!0);var P=l.panDelta,R=l.zoomDelta,L=l.bearingDelta,z=l.pitchDelta,X=l.around,ee=l.pinchAround;ee!==void 0&&(X=ee),m._stop(!0),X=X||m.transform.centerPoint;var Z=T.pointLocation(P?X.sub(P):X);L&&(T.bearing+=L),z&&(T.pitch+=z),R&&(T.zoom+=R),T.setLocationAtPoint(Z,X),this._map._update(),l.noInertia||this._inertia.record(l),this._fireEvents(d,h,!0)},ur.prototype._fireEvents=function(l,d,h){var m=this,T=ss(this._eventsInProgress),P=ss(l),R={};for(var L in l)this._eventsInProgress[L]||(R[L+"start"]=l[L].originalEvent),this._eventsInProgress[L]=l[L];for(var z in!T&&P&&this._fireEvent("movestart",P.originalEvent),R)this._fireEvent(z,R[z]);for(var X in P&&this._fireEvent("move",P.originalEvent),l)this._fireEvent(X,l[X].originalEvent);var ee,Z={};for(var te in this._eventsInProgress){var oe=this._eventsInProgress[te],we=oe.handlerName,Fe=oe.originalEvent;this._handlersById[we].isActive()||(delete this._eventsInProgress[te],Z[te+"end"]=ee=d[we]||Fe)}for(var ge in Z)this._fireEvent(ge,Z[ge]);var Re=ss(this._eventsInProgress);if(h&&(T||P)&&!Re){this._updatingCamera=!0;var He=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),We=function(nt){return nt!==0&&-m._bearingSnap<nt&&nt<m._bearingSnap};He?(We(He.bearing||this._map.getBearing())&&(He.bearing=0),this._map.easeTo(He,{originalEvent:ee})):(this._map.fire(new o.Event("moveend",{originalEvent:ee})),We(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},ur.prototype._fireEvent=function(l,d){this._map.fire(new o.Event(l,d?{originalEvent:d}:{}))},ur.prototype._requestFrame=function(){var l=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(d){delete l._frameId,l.handleEvent(new Rl("renderFrame",{timeStamp:d})),l._applyChanges()})},ur.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var Cu=function(l){function d(h,m){l.call(this),this._moving=!1,this._zooming=!1,this.transform=h,this._bearingSnap=m.bearingSnap,o.bindAll(["_renderFrameCallback"],this)}return l&&(d.__proto__=l),(d.prototype=Object.create(l&&l.prototype)).constructor=d,d.prototype.getCenter=function(){return new o.LngLat(this.transform.center.lng,this.transform.center.lat)},d.prototype.setCenter=function(h,m){return this.jumpTo({center:h},m)},d.prototype.panBy=function(h,m,T){return h=o.Point.convert(h).mult(-1),this.panTo(this.transform.center,o.extend({offset:h},m),T)},d.prototype.panTo=function(h,m,T){return this.easeTo(o.extend({center:h},m),T)},d.prototype.getZoom=function(){return this.transform.zoom},d.prototype.setZoom=function(h,m){return this.jumpTo({zoom:h},m),this},d.prototype.zoomTo=function(h,m,T){return this.easeTo(o.extend({zoom:h},m),T)},d.prototype.zoomIn=function(h,m){return this.zoomTo(this.getZoom()+1,h,m),this},d.prototype.zoomOut=function(h,m){return this.zoomTo(this.getZoom()-1,h,m),this},d.prototype.getBearing=function(){return this.transform.bearing},d.prototype.setBearing=function(h,m){return this.jumpTo({bearing:h},m),this},d.prototype.getPadding=function(){return this.transform.padding},d.prototype.setPadding=function(h,m){return this.jumpTo({padding:h},m),this},d.prototype.rotateTo=function(h,m,T){return this.easeTo(o.extend({bearing:h},m),T)},d.prototype.resetNorth=function(h,m){return this.rotateTo(0,o.extend({duration:1e3},h),m),this},d.prototype.resetNorthPitch=function(h,m){return this.easeTo(o.extend({bearing:0,pitch:0,duration:1e3},h),m),this},d.prototype.snapToNorth=function(h,m){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(h,m):this},d.prototype.getPitch=function(){return this.transform.pitch},d.prototype.setPitch=function(h,m){return this.jumpTo({pitch:h},m),this},d.prototype.cameraForBounds=function(h,m){h=o.LngLatBounds.convert(h);var T=m&&m.bearing||0;return this._cameraForBoxAndBearing(h.getNorthWest(),h.getSouthEast(),T,m)},d.prototype._cameraForBoxAndBearing=function(h,m,T,P){var R={top:0,bottom:0,right:0,left:0};if(typeof(P=o.extend({padding:R,offset:[0,0],maxZoom:this.transform.maxZoom},P)).padding=="number"){var L=P.padding;P.padding={top:L,bottom:L,right:L,left:L}}P.padding=o.extend(R,P.padding);var z=this.transform,X=z.padding,ee=z.project(o.LngLat.convert(h)),Z=z.project(o.LngLat.convert(m)),te=ee.rotate(-T*Math.PI/180),oe=Z.rotate(-T*Math.PI/180),we=new o.Point(Math.max(te.x,oe.x),Math.max(te.y,oe.y)),Fe=new o.Point(Math.min(te.x,oe.x),Math.min(te.y,oe.y)),ge=we.sub(Fe),Re=(z.width-(X.left+X.right+P.padding.left+P.padding.right))/ge.x,He=(z.height-(X.top+X.bottom+P.padding.top+P.padding.bottom))/ge.y;if(!(He<0||Re<0)){var We=Math.min(z.scaleZoom(z.scale*Math.min(Re,He)),P.maxZoom),nt=typeof P.offset.x=="number"?new o.Point(P.offset.x,P.offset.y):o.Point.convert(P.offset),Xe=new o.Point((P.padding.left-P.padding.right)/2,(P.padding.top-P.padding.bottom)/2).rotate(T*Math.PI/180),Qe=nt.add(Xe).mult(z.scale/z.zoomScale(We));return{center:z.unproject(ee.add(Z).div(2).sub(Qe)),zoom:We,bearing:T}}o.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},d.prototype.fitBounds=function(h,m,T){return this._fitInternal(this.cameraForBounds(h,m),m,T)},d.prototype.fitScreenCoordinates=function(h,m,T,P,R){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(o.Point.convert(h)),this.transform.pointLocation(o.Point.convert(m)),T,P),P,R)},d.prototype._fitInternal=function(h,m,T){return h?(delete(m=o.extend(h,m)).padding,m.linear?this.easeTo(m,T):this.flyTo(m,T)):this},d.prototype.jumpTo=function(h,m){this.stop();var T=this.transform,P=!1,R=!1,L=!1;return"zoom"in h&&T.zoom!==+h.zoom&&(P=!0,T.zoom=+h.zoom),h.center!==void 0&&(T.center=o.LngLat.convert(h.center)),"bearing"in h&&T.bearing!==+h.bearing&&(R=!0,T.bearing=+h.bearing),"pitch"in h&&T.pitch!==+h.pitch&&(L=!0,T.pitch=+h.pitch),h.padding==null||T.isPaddingEqual(h.padding)||(T.padding=h.padding),this.fire(new o.Event("movestart",m)).fire(new o.Event("move",m)),P&&this.fire(new o.Event("zoomstart",m)).fire(new o.Event("zoom",m)).fire(new o.Event("zoomend",m)),R&&this.fire(new o.Event("rotatestart",m)).fire(new o.Event("rotate",m)).fire(new o.Event("rotateend",m)),L&&this.fire(new o.Event("pitchstart",m)).fire(new o.Event("pitch",m)).fire(new o.Event("pitchend",m)),this.fire(new o.Event("moveend",m))},d.prototype.easeTo=function(h,m){var T=this;this._stop(!1,h.easeId),((h=o.extend({offset:[0,0],duration:500,easing:o.ease},h)).animate===!1||!h.essential&&o.browser.prefersReducedMotion)&&(h.duration=0);var P=this.transform,R=this.getZoom(),L=this.getBearing(),z=this.getPitch(),X=this.getPadding(),ee="zoom"in h?+h.zoom:R,Z="bearing"in h?this._normalizeBearing(h.bearing,L):L,te="pitch"in h?+h.pitch:z,oe="padding"in h?h.padding:P.padding,we=o.Point.convert(h.offset),Fe=P.centerPoint.add(we),ge=P.pointLocation(Fe),Re=o.LngLat.convert(h.center||ge);this._normalizeCenter(Re);var He,We,nt=P.project(ge),Xe=P.project(Re).sub(nt),Qe=P.zoomScale(ee-R);h.around&&(He=o.LngLat.convert(h.around),We=P.locationPoint(He));var pt={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||ee!==R,this._rotating=this._rotating||L!==Z,this._pitching=this._pitching||te!==z,this._padding=!P.isPaddingEqual(oe),this._easeId=h.easeId,this._prepareEase(m,h.noMoveStart,pt),this._ease(function(Dt){if(T._zooming&&(P.zoom=o.number(R,ee,Dt)),T._rotating&&(P.bearing=o.number(L,Z,Dt)),T._pitching&&(P.pitch=o.number(z,te,Dt)),T._padding&&(P.interpolatePadding(X,oe,Dt),Fe=P.centerPoint.add(we)),He)P.setLocationAtPoint(He,We);else{var Ct=P.zoomScale(P.zoom-R),zt=ee>R?Math.min(2,Qe):Math.max(.5,Qe),sr=Math.pow(zt,1-Dt),Er=P.unproject(nt.add(Xe.mult(Dt*sr)).mult(Ct));P.setLocationAtPoint(P.renderWorldCopies?Er.wrap():Er,Fe)}T._fireMoveEvents(m)},function(Dt){T._afterEase(m,Dt)},h),this},d.prototype._prepareEase=function(h,m,T){T===void 0&&(T={}),this._moving=!0,m||T.moving||this.fire(new o.Event("movestart",h)),this._zooming&&!T.zooming&&this.fire(new o.Event("zoomstart",h)),this._rotating&&!T.rotating&&this.fire(new o.Event("rotatestart",h)),this._pitching&&!T.pitching&&this.fire(new o.Event("pitchstart",h))},d.prototype._fireMoveEvents=function(h){this.fire(new o.Event("move",h)),this._zooming&&this.fire(new o.Event("zoom",h)),this._rotating&&this.fire(new o.Event("rotate",h)),this._pitching&&this.fire(new o.Event("pitch",h))},d.prototype._afterEase=function(h,m){if(!this._easeId||!m||this._easeId!==m){delete this._easeId;var T=this._zooming,P=this._rotating,R=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,T&&this.fire(new o.Event("zoomend",h)),P&&this.fire(new o.Event("rotateend",h)),R&&this.fire(new o.Event("pitchend",h)),this.fire(new o.Event("moveend",h))}},d.prototype.flyTo=function(h,m){var T=this;if(!h.essential&&o.browser.prefersReducedMotion){var P=o.pick(h,["center","zoom","bearing","pitch","around"]);return this.jumpTo(P,m)}this.stop(),h=o.extend({offset:[0,0],speed:1.2,curve:1.42,easing:o.ease},h);var R=this.transform,L=this.getZoom(),z=this.getBearing(),X=this.getPitch(),ee=this.getPadding(),Z="zoom"in h?o.clamp(+h.zoom,R.minZoom,R.maxZoom):L,te="bearing"in h?this._normalizeBearing(h.bearing,z):z,oe="pitch"in h?+h.pitch:X,we="padding"in h?h.padding:R.padding,Fe=R.zoomScale(Z-L),ge=o.Point.convert(h.offset),Re=R.centerPoint.add(ge),He=R.pointLocation(Re),We=o.LngLat.convert(h.center||He);this._normalizeCenter(We);var nt=R.project(He),Xe=R.project(We).sub(nt),Qe=h.curve,pt=Math.max(R.width,R.height),Dt=pt/Fe,Ct=Xe.mag();if("minZoom"in h){var zt=o.clamp(Math.min(h.minZoom,L,Z),R.minZoom,R.maxZoom),sr=pt/R.zoomScale(zt-L);Qe=Math.sqrt(sr/Ct*2)}var Er=Qe*Qe;function Mr(kr){var Or=(Dt*Dt-pt*pt+(kr?-1:1)*Er*Er*Ct*Ct)/(2*(kr?Dt:pt)*Er*Ct);return Math.log(Math.sqrt(Or*Or+1)-Or)}function xn(kr){return(Math.exp(kr)-Math.exp(-kr))/2}function ar(kr){return(Math.exp(kr)+Math.exp(-kr))/2}var $r=Mr(0),rn=function(kr){return ar($r)/ar($r+Qe*kr)},jr=function(kr){return pt*((ar($r)*(xn(Or=$r+Qe*kr)/ar(Or))-xn($r))/Er)/Ct;var Or},Gr=(Mr(1)-$r)/Qe;if(Math.abs(Ct)<1e-6||!isFinite(Gr)){if(Math.abs(pt-Dt)<1e-6)return this.easeTo(h,m);var Zr=Dt<pt?-1:1;Gr=Math.abs(Math.log(Dt/pt))/Qe,jr=function(){return 0},rn=function(kr){return Math.exp(Zr*Qe*kr)}}return h.duration="duration"in h?+h.duration:1e3*Gr/("screenSpeed"in h?+h.screenSpeed/Qe:+h.speed),h.maxDuration&&h.duration>h.maxDuration&&(h.duration=0),this._zooming=!0,this._rotating=z!==te,this._pitching=oe!==X,this._padding=!R.isPaddingEqual(we),this._prepareEase(m,!1),this._ease(function(kr){var Or=kr*Gr,qi=1/rn(Or);R.zoom=kr===1?Z:L+R.scaleZoom(qi),T._rotating&&(R.bearing=o.number(z,te,kr)),T._pitching&&(R.pitch=o.number(X,oe,kr)),T._padding&&(R.interpolatePadding(ee,we,kr),Re=R.centerPoint.add(ge));var Ei=kr===1?We:R.unproject(nt.add(Xe.mult(jr(Or))).mult(qi));R.setLocationAtPoint(R.renderWorldCopies?Ei.wrap():Ei,Re),T._fireMoveEvents(m)},function(){return T._afterEase(m)},h),this},d.prototype.isEasing=function(){return!!this._easeFrameId},d.prototype.stop=function(){return this._stop()},d.prototype._stop=function(h,m){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var T=this._onEaseEnd;delete this._onEaseEnd,T.call(this,m)}if(!h){var P=this.handlers;P&&P.stop(!1)}return this},d.prototype._ease=function(h,m,T){T.animate===!1||T.duration===0?(h(1),m()):(this._easeStart=o.browser.now(),this._easeOptions=T,this._onEaseFrame=h,this._onEaseEnd=m,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},d.prototype._renderFrameCallback=function(){var h=Math.min((o.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(h)),h<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},d.prototype._normalizeBearing=function(h,m){h=o.wrap(h,-180,180);var T=Math.abs(h-m);return Math.abs(h-360-m)<T&&(h-=360),Math.abs(h+360-m)<T&&(h+=360),h},d.prototype._normalizeCenter=function(h){var m=this.transform;if(m.renderWorldCopies&&!m.lngRange){var T=h.lng-m.center.lng;h.lng+=T>180?-360:T<-180?360:0}},d}(o.Evented),fs=function(l){l===void 0&&(l={}),this.options=l,o.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};fs.prototype.getDefaultPosition=function(){return"bottom-right"},fs.prototype.onAdd=function(l){var d=this.options&&this.options.compact;return this._map=l,this._container=f.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=f.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=f.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),d&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),d===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},fs.prototype.onRemove=function(){f.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},fs.prototype._setElementTitle=function(l,d){var h=this._map._getUIString("AttributionControl."+d);l.title=h,l.setAttribute("aria-label",h)},fs.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},fs.prototype._updateEditLink=function(){var l=this._editLink;l||(l=this._editLink=this._container.querySelector(".mapbox-improve-map"));var d=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||o.config.ACCESS_TOKEN}];if(l){var h=d.reduce(function(m,T,P){return T.value&&(m+=T.key+"="+T.value+(P<d.length-1?"&":"")),m},"?");l.href=o.config.FEEDBACK_URL+"/"+h+(this._map._hash?this._map._hash.getHashString(!0):""),l.rel="noopener nofollow",this._setElementTitle(l,"MapFeedback")}},fs.prototype._updateData=function(l){!l||l.sourceDataType!=="metadata"&&l.sourceDataType!=="visibility"&&l.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())},fs.prototype._updateAttributions=function(){if(this._map.style){var l=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?l=l.concat(this.options.customAttribution.map(function(L){return typeof L!="string"?"":L})):typeof this.options.customAttribution=="string"&&l.push(this.options.customAttribution)),this._map.style.stylesheet){var d=this._map.style.stylesheet;this.styleOwner=d.owner,this.styleId=d.id}var h=this._map.style.sourceCaches;for(var m in h){var T=h[m];if(T.used){var P=T.getSource();P.attribution&&l.indexOf(P.attribution)<0&&l.push(P.attribution)}}l.sort(function(L,z){return L.length-z.length});var R=(l=l.filter(function(L,z){for(var X=z+1;X<l.length;X++)if(l[X].indexOf(L)>=0)return!1;return!0})).join(" | ");R!==this._attribHTML&&(this._attribHTML=R,l.length?(this._innerContainer.innerHTML=R,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},fs.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Ki=function(){o.bindAll(["_updateLogo"],this),o.bindAll(["_updateCompact"],this)};Ki.prototype.onAdd=function(l){this._map=l,this._container=f.create("div","mapboxgl-ctrl");var d=f.create("a","mapboxgl-ctrl-logo");return d.target="_blank",d.rel="noopener nofollow",d.href="https://www.mapbox.com/",d.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),d.setAttribute("rel","noopener nofollow"),this._container.appendChild(d),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Ki.prototype.onRemove=function(){f.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Ki.prototype.getDefaultPosition=function(){return"bottom-left"},Ki.prototype._updateLogo=function(l){l&&l.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},Ki.prototype._logoRequired=function(){if(this._map.style){var l=this._map.style.sourceCaches;for(var d in l)if(l[d].getSource().mapbox_logo)return!0;return!1}},Ki.prototype._updateCompact=function(){var l=this._container.children;if(l.length){var d=l[0];this._map.getCanvasContainer().offsetWidth<250?d.classList.add("mapboxgl-compact"):d.classList.remove("mapboxgl-compact")}};var Jn=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Jn.prototype.add=function(l){var d=++this._id;return this._queue.push({callback:l,id:d,cancelled:!1}),d},Jn.prototype.remove=function(l){for(var d=this._currentlyRunning,h=0,m=d?this._queue.concat(d):this._queue;h<m.length;h+=1){var T=m[h];if(T.id===l)return void(T.cancelled=!0)}},Jn.prototype.run=function(l){l===void 0&&(l=0);var d=this._currentlyRunning=this._queue;this._queue=[];for(var h=0,m=d;h<m.length;h+=1){var T=m[h];if(!T.cancelled&&(T.callback(l),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Jn.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var zr={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},oo=o.window.HTMLImageElement,An=o.window.HTMLElement,Kr=o.window.ImageBitmap,ki={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Tu=function(l){function d(m){var T=this;if((m=o.extend({},ki,m)).minZoom!=null&&m.maxZoom!=null&&m.minZoom>m.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(m.minPitch!=null&&m.maxPitch!=null&&m.minPitch>m.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(m.minPitch!=null&&m.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(m.maxPitch!=null&&m.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var P=new fn(m.minZoom,m.maxZoom,m.minPitch,m.maxPitch,m.renderWorldCopies);if(l.call(this,P,m),this._interactive=m.interactive,this._maxTileCacheSize=m.maxTileCacheSize,this._failIfMajorPerformanceCaveat=m.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=m.preserveDrawingBuffer,this._antialias=m.antialias,this._trackResize=m.trackResize,this._bearingSnap=m.bearingSnap,this._refreshExpiredTiles=m.refreshExpiredTiles,this._fadeDuration=m.fadeDuration,this._crossSourceCollisions=m.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=m.collectResourceTiming,this._renderTaskQueue=new Jn,this._controls=[],this._mapId=o.uniqueId(),this._locale=o.extend({},zr,m.locale),this._clickTolerance=m.clickTolerance,this._requestManager=new o.RequestManager(m.transformRequest,m.accessToken),typeof m.container=="string"){if(this._container=o.window.document.getElementById(m.container),!this._container)throw new Error("Container '"+m.container+"' not found.")}else{if(!(m.container instanceof An))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=m.container}if(m.maxBounds&&this.setMaxBounds(m.maxBounds),o.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return T._update(!1)}),this.on("moveend",function(){return T._update(!1)}),this.on("zoom",function(){return T._update(!0)}),o.window!==void 0&&(o.window.addEventListener("online",this._onWindowOnline,!1),o.window.addEventListener("resize",this._onWindowResize,!1),o.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new ur(this,m),this._hash=m.hash&&new Vs(typeof m.hash=="string"&&m.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:m.center,zoom:m.zoom,bearing:m.bearing,pitch:m.pitch}),m.bounds&&(this.resize(),this.fitBounds(m.bounds,o.extend({},m.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=m.localIdeographFontFamily,m.style&&this.setStyle(m.style,{localIdeographFontFamily:m.localIdeographFontFamily}),m.attributionControl&&this.addControl(new fs({customAttribution:m.customAttribution})),this.addControl(new Ki,m.logoPosition),this.on("style.load",function(){T.transform.unmodified&&T.jumpTo(T.style.stylesheet)}),this.on("data",function(R){T._update(R.dataType==="style"),T.fire(new o.Event(R.dataType+"data",R))}),this.on("dataloading",function(R){T.fire(new o.Event(R.dataType+"dataloading",R))})}l&&(d.__proto__=l),(d.prototype=Object.create(l&&l.prototype)).constructor=d;var h={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return d.prototype._getMapId=function(){return this._mapId},d.prototype.addControl=function(m,T){if(T===void 0&&(T=m.getDefaultPosition?m.getDefaultPosition():"top-right"),!m||!m.onAdd)return this.fire(new o.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var P=m.onAdd(this);this._controls.push(m);var R=this._controlPositions[T];return T.indexOf("bottom")!==-1?R.insertBefore(P,R.firstChild):R.appendChild(P),this},d.prototype.removeControl=function(m){if(!m||!m.onRemove)return this.fire(new o.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var T=this._controls.indexOf(m);return T>-1&&this._controls.splice(T,1),m.onRemove(this),this},d.prototype.hasControl=function(m){return this._controls.indexOf(m)>-1},d.prototype.resize=function(m){var T=this._containerDimensions(),P=T[0],R=T[1];if(P===this.transform.width&&R===this.transform.height)return this;this._resizeCanvas(P,R),this.transform.resize(P,R),this.painter.resize(P,R);var L=!this._moving;return L&&this.fire(new o.Event("movestart",m)).fire(new o.Event("move",m)),this.fire(new o.Event("resize",m)),L&&this.fire(new o.Event("moveend",m)),this},d.prototype.getBounds=function(){return this.transform.getBounds()},d.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},d.prototype.setMaxBounds=function(m){return this.transform.setMaxBounds(o.LngLatBounds.convert(m)),this._update()},d.prototype.setMinZoom=function(m){if((m=m??-2)>=-2&&m<=this.transform.maxZoom)return this.transform.minZoom=m,this._update(),this.getZoom()<m&&this.setZoom(m),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},d.prototype.getMinZoom=function(){return this.transform.minZoom},d.prototype.setMaxZoom=function(m){if((m=m??22)>=this.transform.minZoom)return this.transform.maxZoom=m,this._update(),this.getZoom()>m&&this.setZoom(m),this;throw new Error("maxZoom must be greater than the current minZoom")},d.prototype.getMaxZoom=function(){return this.transform.maxZoom},d.prototype.setMinPitch=function(m){if((m=m??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(m>=0&&m<=this.transform.maxPitch)return this.transform.minPitch=m,this._update(),this.getPitch()<m&&this.setPitch(m),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},d.prototype.getMinPitch=function(){return this.transform.minPitch},d.prototype.setMaxPitch=function(m){if((m=m??60)>60)throw new Error("maxPitch must be less than or equal to 60");if(m>=this.transform.minPitch)return this.transform.maxPitch=m,this._update(),this.getPitch()>m&&this.setPitch(m),this;throw new Error("maxPitch must be greater than the current minPitch")},d.prototype.getMaxPitch=function(){return this.transform.maxPitch},d.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},d.prototype.setRenderWorldCopies=function(m){return this.transform.renderWorldCopies=m,this._update()},d.prototype.project=function(m){return this.transform.locationPoint(o.LngLat.convert(m))},d.prototype.unproject=function(m){return this.transform.pointLocation(o.Point.convert(m))},d.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},d.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},d.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},d.prototype._createDelegatedListener=function(m,T,P){var R,L=this;if(m==="mouseenter"||m==="mouseover"){var z=!1;return{layer:T,listener:P,delegates:{mousemove:function(ee){var Z=L.getLayer(T)?L.queryRenderedFeatures(ee.point,{layers:[T]}):[];Z.length?z||(z=!0,P.call(L,new kn(m,L,ee.originalEvent,{features:Z}))):z=!1},mouseout:function(){z=!1}}}}if(m==="mouseleave"||m==="mouseout"){var X=!1;return{layer:T,listener:P,delegates:{mousemove:function(ee){(L.getLayer(T)?L.queryRenderedFeatures(ee.point,{layers:[T]}):[]).length?X=!0:X&&(X=!1,P.call(L,new kn(m,L,ee.originalEvent)))},mouseout:function(ee){X&&(X=!1,P.call(L,new kn(m,L,ee.originalEvent)))}}}}return{layer:T,listener:P,delegates:(R={},R[m]=function(ee){var Z=L.getLayer(T)?L.queryRenderedFeatures(ee.point,{layers:[T]}):[];Z.length&&(ee.features=Z,P.call(L,ee),delete ee.features)},R)}},d.prototype.on=function(m,T,P){if(P===void 0)return l.prototype.on.call(this,m,T);var R=this._createDelegatedListener(m,T,P);for(var L in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[m]=this._delegatedListeners[m]||[],this._delegatedListeners[m].push(R),R.delegates)this.on(L,R.delegates[L]);return this},d.prototype.once=function(m,T,P){if(P===void 0)return l.prototype.once.call(this,m,T);var R=this._createDelegatedListener(m,T,P);for(var L in R.delegates)this.once(L,R.delegates[L]);return this},d.prototype.off=function(m,T,P){var R=this;return P===void 0?l.prototype.off.call(this,m,T):(this._delegatedListeners&&this._delegatedListeners[m]&&function(L){for(var z=L[m],X=0;X<z.length;X++){var ee=z[X];if(ee.layer===T&&ee.listener===P){for(var Z in ee.delegates)R.off(Z,ee.delegates[Z]);return z.splice(X,1),R}}}(this._delegatedListeners),this)},d.prototype.queryRenderedFeatures=function(m,T){if(!this.style)return[];var P;if(T!==void 0||m===void 0||m instanceof o.Point||Array.isArray(m)||(T=m,m=void 0),T=T||{},(m=m||[[0,0],[this.transform.width,this.transform.height]])instanceof o.Point||typeof m[0]=="number")P=[o.Point.convert(m)];else{var R=o.Point.convert(m[0]),L=o.Point.convert(m[1]);P=[R,new o.Point(L.x,R.y),L,new o.Point(R.x,L.y),R]}return this.style.queryRenderedFeatures(P,T,this.transform)},d.prototype.querySourceFeatures=function(m,T){return this.style.querySourceFeatures(m,T)},d.prototype.setStyle=function(m,T){return(T=o.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},T)).diff!==!1&&T.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&m?(this._diffStyle(m,T),this):(this._localIdeographFontFamily=T.localIdeographFontFamily,this._updateStyle(m,T))},d.prototype._getUIString=function(m){var T=this._locale[m];if(T==null)throw new Error("Missing UI string '"+m+"'");return T},d.prototype._updateStyle=function(m,T){return this.style&&(this.style.setEventedParent(null),this.style._remove()),m?(this.style=new zn(this,T||{}),this.style.setEventedParent(this,{style:this.style}),typeof m=="string"?this.style.loadURL(m):this.style.loadJSON(m),this):(delete this.style,this)},d.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new zn(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},d.prototype._diffStyle=function(m,T){var P=this;if(typeof m=="string"){var R=this._requestManager.normalizeStyleURL(m),L=this._requestManager.transformRequest(R,o.ResourceType.Style);o.getJSON(L,function(z,X){z?P.fire(new o.ErrorEvent(z)):X&&P._updateDiff(X,T)})}else typeof m=="object"&&this._updateDiff(m,T)},d.prototype._updateDiff=function(m,T){try{this.style.setState(m)&&this._update(!0)}catch(P){o.warnOnce("Unable to perform style diff: "+(P.message||P.error||P)+". Rebuilding the style from scratch."),this._updateStyle(m,T)}},d.prototype.getStyle=function(){if(this.style)return this.style.serialize()},d.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():o.warnOnce("There is no style added to the map.")},d.prototype.addSource=function(m,T){return this._lazyInitEmptyStyle(),this.style.addSource(m,T),this._update(!0)},d.prototype.isSourceLoaded=function(m){var T=this.style&&this.style.sourceCaches[m];if(T!==void 0)return T.loaded();this.fire(new o.ErrorEvent(new Error("There is no source with ID '"+m+"'")))},d.prototype.areTilesLoaded=function(){var m=this.style&&this.style.sourceCaches;for(var T in m){var P=m[T]._tiles;for(var R in P){var L=P[R];if(L.state!=="loaded"&&L.state!=="errored")return!1}}return!0},d.prototype.addSourceType=function(m,T,P){return this._lazyInitEmptyStyle(),this.style.addSourceType(m,T,P)},d.prototype.removeSource=function(m){return this.style.removeSource(m),this._update(!0)},d.prototype.getSource=function(m){return this.style.getSource(m)},d.prototype.addImage=function(m,T,P){P===void 0&&(P={});var R=P.pixelRatio;R===void 0&&(R=1);var L=P.sdf;L===void 0&&(L=!1);var z=P.stretchX,X=P.stretchY,ee=P.content;if(this._lazyInitEmptyStyle(),T instanceof oo||Kr&&T instanceof Kr){var Z=o.browser.getImageData(T);this.style.addImage(m,{data:new o.RGBAImage({width:Z.width,height:Z.height},Z.data),pixelRatio:R,stretchX:z,stretchY:X,content:ee,sdf:L,version:0})}else{if(T.width===void 0||T.height===void 0)return this.fire(new o.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var te=T;this.style.addImage(m,{data:new o.RGBAImage({width:T.width,height:T.height},new Uint8Array(T.data)),pixelRatio:R,stretchX:z,stretchY:X,content:ee,sdf:L,version:0,userImage:te}),te.onAdd&&te.onAdd(this,m)}},d.prototype.updateImage=function(m,T){var P=this.style.getImage(m);if(!P)return this.fire(new o.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var R=T instanceof oo||Kr&&T instanceof Kr?o.browser.getImageData(T):T,L=R.width,z=R.height,X=R.data;return L===void 0||z===void 0?this.fire(new o.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):L!==P.data.width||z!==P.data.height?this.fire(new o.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(P.data.replace(X,!(T instanceof oo||Kr&&T instanceof Kr)),void this.style.updateImage(m,P))},d.prototype.hasImage=function(m){return m?!!this.style.getImage(m):(this.fire(new o.ErrorEvent(new Error("Missing required image id"))),!1)},d.prototype.removeImage=function(m){this.style.removeImage(m)},d.prototype.loadImage=function(m,T){o.getImage(this._requestManager.transformRequest(m,o.ResourceType.Image),T)},d.prototype.listImages=function(){return this.style.listImages()},d.prototype.addLayer=function(m,T){return this._lazyInitEmptyStyle(),this.style.addLayer(m,T),this._update(!0)},d.prototype.moveLayer=function(m,T){return this.style.moveLayer(m,T),this._update(!0)},d.prototype.removeLayer=function(m){return this.style.removeLayer(m),this._update(!0)},d.prototype.getLayer=function(m){return this.style.getLayer(m)},d.prototype.setLayerZoomRange=function(m,T,P){return this.style.setLayerZoomRange(m,T,P),this._update(!0)},d.prototype.setFilter=function(m,T,P){return P===void 0&&(P={}),this.style.setFilter(m,T,P),this._update(!0)},d.prototype.getFilter=function(m){return this.style.getFilter(m)},d.prototype.setPaintProperty=function(m,T,P,R){return R===void 0&&(R={}),this.style.setPaintProperty(m,T,P,R),this._update(!0)},d.prototype.getPaintProperty=function(m,T){return this.style.getPaintProperty(m,T)},d.prototype.setLayoutProperty=function(m,T,P,R){return R===void 0&&(R={}),this.style.setLayoutProperty(m,T,P,R),this._update(!0)},d.prototype.getLayoutProperty=function(m,T){return this.style.getLayoutProperty(m,T)},d.prototype.setLight=function(m,T){return T===void 0&&(T={}),this._lazyInitEmptyStyle(),this.style.setLight(m,T),this._update(!0)},d.prototype.getLight=function(){return this.style.getLight()},d.prototype.setFeatureState=function(m,T){return this.style.setFeatureState(m,T),this._update()},d.prototype.removeFeatureState=function(m,T){return this.style.removeFeatureState(m,T),this._update()},d.prototype.getFeatureState=function(m){return this.style.getFeatureState(m)},d.prototype.getContainer=function(){return this._container},d.prototype.getCanvasContainer=function(){return this._canvasContainer},d.prototype.getCanvas=function(){return this._canvas},d.prototype._containerDimensions=function(){var m=0,T=0;return this._container&&(m=this._container.clientWidth||400,T=this._container.clientHeight||300),[m,T]},d.prototype._detectMissingCSS=function(){o.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&o.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},d.prototype._setupContainer=function(){var m=this._container;m.classList.add("mapboxgl-map"),(this._missingCSSCanary=f.create("div","mapboxgl-canary",m)).style.visibility="hidden",this._detectMissingCSS();var T=this._canvasContainer=f.create("div","mapboxgl-canvas-container",m);this._interactive&&T.classList.add("mapboxgl-interactive"),this._canvas=f.create("canvas","mapboxgl-canvas",T),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var P=this._containerDimensions();this._resizeCanvas(P[0],P[1]);var R=this._controlContainer=f.create("div","mapboxgl-control-container",m),L=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(z){L[z]=f.create("div","mapboxgl-ctrl-"+z,R)}),this._container.addEventListener("scroll",this._onMapScroll,!1)},d.prototype._resizeCanvas=function(m,T){var P=o.browser.devicePixelRatio||1;this._canvas.width=P*m,this._canvas.height=P*T,this._canvas.style.width=m+"px",this._canvas.style.height=T+"px"},d.prototype._setupPainter=function(){var m=o.extend({},c.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),T=this._canvas.getContext("webgl",m)||this._canvas.getContext("experimental-webgl",m);T?(this.painter=new Wn(T,this.transform),o.webpSupported.testSupport(T)):this.fire(new o.ErrorEvent(new Error("Failed to initialize WebGL")))},d.prototype._contextLost=function(m){m.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new o.Event("webglcontextlost",{originalEvent:m}))},d.prototype._contextRestored=function(m){this._setupPainter(),this.resize(),this._update(),this.fire(new o.Event("webglcontextrestored",{originalEvent:m}))},d.prototype._onMapScroll=function(m){if(m.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},d.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},d.prototype._update=function(m){return this.style?(this._styleDirty=this._styleDirty||m,this._sourcesDirty=!0,this.triggerRepaint(),this):this},d.prototype._requestRenderFrame=function(m){return this._update(),this._renderTaskQueue.add(m)},d.prototype._cancelRenderFrame=function(m){this._renderTaskQueue.remove(m)},d.prototype._render=function(m){var T,P=this,R=0,L=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(T=L.createQueryEXT(),L.beginQueryEXT(L.TIME_ELAPSED_EXT,T),R=o.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(m),!this._removed){var z=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var X=this.transform.zoom,ee=o.browser.now();this.style.zoomHistory.update(X,ee);var Z=new o.EvaluationParameters(X,{now:ee,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),te=Z.crossFadingFactor();te===1&&te===this._crossFadingFactor||(z=!0,this._crossFadingFactor=te),this.style.update(Z)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new o.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new o.Event("load"))),this.style&&(this.style.hasTransitions()||z)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var oe=o.browser.now()-R;L.endQueryEXT(L.TIME_ELAPSED_EXT,T),setTimeout(function(){var ge=L.getQueryObjectEXT(T,L.QUERY_RESULT_EXT)/1e6;L.deleteQueryEXT(T),P.fire(new o.Event("gpu-timing-frame",{cpuTime:oe,gpuTime:ge}))},50)}if(this.listens("gpu-timing-layer")){var we=this.painter.collectGpuTimers();setTimeout(function(){var ge=P.painter.queryGpuTimers(we);P.fire(new o.Event("gpu-timing-layer",{layerTimes:ge}))},50)}var Fe=this._sourcesDirty||this._styleDirty||this._placementDirty;return Fe||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new o.Event("idle")),!this._loaded||this._fullyLoaded||Fe||(this._fullyLoaded=!0),this}},d.prototype.remove=function(){this._hash&&this._hash.remove();for(var m=0,T=this._controls;m<T.length;m+=1)T[m].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),o.window!==void 0&&(o.window.removeEventListener("resize",this._onWindowResize,!1),o.window.removeEventListener("orientationchange",this._onWindowResize,!1),o.window.removeEventListener("online",this._onWindowOnline,!1));var P=this.painter.context.gl.getExtension("WEBGL_lose_context");P&&P.loseContext(),js(this._canvasContainer),js(this._controlContainer),js(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new o.Event("remove"))},d.prototype.triggerRepaint=function(){var m=this;this.style&&!this._frame&&(this._frame=o.browser.frame(function(T){m._frame=null,m._render(T)}))},d.prototype._onWindowOnline=function(){this._update()},d.prototype._onWindowResize=function(m){this._trackResize&&this.resize({originalEvent:m})._update()},h.showTileBoundaries.get=function(){return!!this._showTileBoundaries},h.showTileBoundaries.set=function(m){this._showTileBoundaries!==m&&(this._showTileBoundaries=m,this._update())},h.showPadding.get=function(){return!!this._showPadding},h.showPadding.set=function(m){this._showPadding!==m&&(this._showPadding=m,this._update())},h.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},h.showCollisionBoxes.set=function(m){this._showCollisionBoxes!==m&&(this._showCollisionBoxes=m,m?this.style._generateCollisionBoxes():this._update())},h.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},h.showOverdrawInspector.set=function(m){this._showOverdrawInspector!==m&&(this._showOverdrawInspector=m,this._update())},h.repaint.get=function(){return!!this._repaint},h.repaint.set=function(m){this._repaint!==m&&(this._repaint=m,this.triggerRepaint())},h.vertices.get=function(){return!!this._vertices},h.vertices.set=function(m){this._vertices=m,this._update()},d.prototype._setCacheLimits=function(m,T){o.setCacheLimits(m,T)},h.version.get=function(){return o.version},Object.defineProperties(d.prototype,h),d}(Cu);function js(l){l.parentNode&&l.parentNode.removeChild(l)}var Sf={showCompass:!0,showZoom:!0,visualizePitch:!1},di=function(l){var d=this;this.options=o.extend({},Sf,l),this._container=f.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(h){return h.preventDefault()}),this.options.showZoom&&(o.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(h){return d._map.zoomIn({},{originalEvent:h})}),f.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(h){return d._map.zoomOut({},{originalEvent:h})}),f.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(o.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",function(h){d.options.visualizePitch?d._map.resetNorthPitch({},{originalEvent:h}):d._map.resetNorth({},{originalEvent:h})}),this._compassIcon=f.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};di.prototype._updateZoomButtons=function(){var l=this._map.getZoom(),d=l===this._map.getMaxZoom(),h=l===this._map.getMinZoom();this._zoomInButton.disabled=d,this._zoomOutButton.disabled=h,this._zoomInButton.setAttribute("aria-disabled",d.toString()),this._zoomOutButton.setAttribute("aria-disabled",h.toString())},di.prototype._rotateCompassArrow=function(){var l=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=l},di.prototype.onAdd=function(l){return this._map=l,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new os(this._map,this._compass,this.options.visualizePitch)),this._container},di.prototype.onRemove=function(){f.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},di.prototype._createButton=function(l,d){var h=f.create("button",l,this._container);return h.type="button",h.addEventListener("click",d),h},di.prototype._setButtonTitle=function(l,d){var h=this._map._getUIString("NavigationControl."+d);l.title=h,l.setAttribute("aria-label",h)};var os=function(l,d,h){h===void 0&&(h=!1),this._clickTolerance=10,this.element=d,this.mouseRotate=new bu({clickTolerance:l.dragRotate._mouseRotate._clickTolerance}),this.map=l,h&&(this.mousePitch=new Tf({clickTolerance:l.dragRotate._mousePitch._clickTolerance})),o.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),f.addEventListener(d,"mousedown",this.mousedown),f.addEventListener(d,"touchstart",this.touchstart,{passive:!1}),f.addEventListener(d,"touchmove",this.touchmove),f.addEventListener(d,"touchend",this.touchend),f.addEventListener(d,"touchcancel",this.reset)};function To(l,d,h){if(l=new o.LngLat(l.lng,l.lat),d){var m=new o.LngLat(l.lng-360,l.lat),T=new o.LngLat(l.lng+360,l.lat),P=h.locationPoint(l).distSqr(d);h.locationPoint(m).distSqr(d)<P?l=m:h.locationPoint(T).distSqr(d)<P&&(l=T)}for(;Math.abs(l.lng-h.center.lng)>180;){var R=h.locationPoint(l);if(R.x>=0&&R.y>=0&&R.x<=h.width&&R.y<=h.height)break;l.lng>h.center.lng?l.lng-=360:l.lng+=360}return l}os.prototype.down=function(l,d){this.mouseRotate.mousedown(l,d),this.mousePitch&&this.mousePitch.mousedown(l,d),f.disableDrag()},os.prototype.move=function(l,d){var h=this.map,m=this.mouseRotate.mousemoveWindow(l,d);if(m&&m.bearingDelta&&h.setBearing(h.getBearing()+m.bearingDelta),this.mousePitch){var T=this.mousePitch.mousemoveWindow(l,d);T&&T.pitchDelta&&h.setPitch(h.getPitch()+T.pitchDelta)}},os.prototype.off=function(){var l=this.element;f.removeEventListener(l,"mousedown",this.mousedown),f.removeEventListener(l,"touchstart",this.touchstart,{passive:!1}),f.removeEventListener(l,"touchmove",this.touchmove),f.removeEventListener(l,"touchend",this.touchend),f.removeEventListener(l,"touchcancel",this.reset),this.offTemp()},os.prototype.offTemp=function(){f.enableDrag(),f.removeEventListener(o.window,"mousemove",this.mousemove),f.removeEventListener(o.window,"mouseup",this.mouseup)},os.prototype.mousedown=function(l){this.down(o.extend({},l,{ctrlKey:!0,preventDefault:function(){return l.preventDefault()}}),f.mousePos(this.element,l)),f.addEventListener(o.window,"mousemove",this.mousemove),f.addEventListener(o.window,"mouseup",this.mouseup)},os.prototype.mousemove=function(l){this.move(l,f.mousePos(this.element,l))},os.prototype.mouseup=function(l){this.mouseRotate.mouseupWindow(l),this.mousePitch&&this.mousePitch.mouseupWindow(l),this.offTemp()},os.prototype.touchstart=function(l){l.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=f.touchPos(this.element,l.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return l.preventDefault()}},this._startPos))},os.prototype.touchmove=function(l){l.targetTouches.length!==1?this.reset():(this._lastPos=f.touchPos(this.element,l.targetTouches)[0],this.move({preventDefault:function(){return l.preventDefault()}},this._lastPos))},os.prototype.touchend=function(l){l.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},os.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Eo={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Jt(l,d,h){var m=l.classList;for(var T in Eo)m.remove("mapboxgl-"+h+"-anchor-"+T);m.add("mapboxgl-"+h+"-anchor-"+d)}var tr,Hc=function(l){function d(h,m){if(l.call(this),(h instanceof o.window.HTMLElement||m)&&(h=o.extend({element:h},m)),o.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=h&&h.anchor||"center",this._color=h&&h.color||"#3FB1CE",this._scale=h&&h.scale||1,this._draggable=h&&h.draggable||!1,this._clickTolerance=h&&h.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=h&&h.rotation||0,this._rotationAlignment=h&&h.rotationAlignment||"auto",this._pitchAlignment=h&&h.pitchAlignment&&h.pitchAlignment!=="auto"?h.pitchAlignment:this._rotationAlignment,h&&h.element)this._element=h.element,this._offset=o.Point.convert(h&&h.offset||[0,0]);else{this._defaultMarker=!0,this._element=f.create("div"),this._element.setAttribute("aria-label","Map marker");var T=f.createNS("http://www.w3.org/2000/svg","svg");T.setAttributeNS(null,"display","block"),T.setAttributeNS(null,"height","41px"),T.setAttributeNS(null,"width","27px"),T.setAttributeNS(null,"viewBox","0 0 27 41");var P=f.createNS("http://www.w3.org/2000/svg","g");P.setAttributeNS(null,"stroke","none"),P.setAttributeNS(null,"stroke-width","1"),P.setAttributeNS(null,"fill","none"),P.setAttributeNS(null,"fill-rule","evenodd");var R=f.createNS("http://www.w3.org/2000/svg","g");R.setAttributeNS(null,"fill-rule","nonzero");var L=f.createNS("http://www.w3.org/2000/svg","g");L.setAttributeNS(null,"transform","translate(3.0, 29.0)"),L.setAttributeNS(null,"fill","#000000");for(var z=0,X=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];z<X.length;z+=1){var ee=X[z],Z=f.createNS("http://www.w3.org/2000/svg","ellipse");Z.setAttributeNS(null,"opacity","0.04"),Z.setAttributeNS(null,"cx","10.5"),Z.setAttributeNS(null,"cy","5.80029008"),Z.setAttributeNS(null,"rx",ee.rx),Z.setAttributeNS(null,"ry",ee.ry),L.appendChild(Z)}var te=f.createNS("http://www.w3.org/2000/svg","g");te.setAttributeNS(null,"fill",this._color);var oe=f.createNS("http://www.w3.org/2000/svg","path");oe.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),te.appendChild(oe);var we=f.createNS("http://www.w3.org/2000/svg","g");we.setAttributeNS(null,"opacity","0.25"),we.setAttributeNS(null,"fill","#000000");var Fe=f.createNS("http://www.w3.org/2000/svg","path");Fe.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),we.appendChild(Fe);var ge=f.createNS("http://www.w3.org/2000/svg","g");ge.setAttributeNS(null,"transform","translate(6.0, 7.0)"),ge.setAttributeNS(null,"fill","#FFFFFF");var Re=f.createNS("http://www.w3.org/2000/svg","g");Re.setAttributeNS(null,"transform","translate(8.0, 8.0)");var He=f.createNS("http://www.w3.org/2000/svg","circle");He.setAttributeNS(null,"fill","#000000"),He.setAttributeNS(null,"opacity","0.25"),He.setAttributeNS(null,"cx","5.5"),He.setAttributeNS(null,"cy","5.5"),He.setAttributeNS(null,"r","5.4999962");var We=f.createNS("http://www.w3.org/2000/svg","circle");We.setAttributeNS(null,"fill","#FFFFFF"),We.setAttributeNS(null,"cx","5.5"),We.setAttributeNS(null,"cy","5.5"),We.setAttributeNS(null,"r","5.4999962"),Re.appendChild(He),Re.appendChild(We),R.appendChild(L),R.appendChild(te),R.appendChild(we),R.appendChild(ge),R.appendChild(Re),T.appendChild(R),T.setAttributeNS(null,"height",41*this._scale+"px"),T.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(T),this._offset=o.Point.convert(h&&h.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(nt){nt.preventDefault()}),this._element.addEventListener("mousedown",function(nt){nt.preventDefault()}),Jt(this._element,this._anchor,"marker"),this._popup=null}return l&&(d.__proto__=l),(d.prototype=Object.create(l&&l.prototype)).constructor=d,d.prototype.addTo=function(h){return this.remove(),this._map=h,h.getCanvasContainer().appendChild(this._element),h.on("move",this._update),h.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},d.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),f.remove(this._element),this._popup&&this._popup.remove(),this},d.prototype.getLngLat=function(){return this._lngLat},d.prototype.setLngLat=function(h){return this._lngLat=o.LngLat.convert(h),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},d.prototype.getElement=function(){return this._element},d.prototype.setPopup=function(h){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),h){if(!("offset"in h.options)){var m=Math.sqrt(Math.pow(13.5,2)/2);h.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[m,-1*(24.6+m)],"bottom-right":[-m,-1*(24.6+m)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=h,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},d.prototype._onKeyPress=function(h){var m=h.code,T=h.charCode||h.keyCode;m!=="Space"&&m!=="Enter"&&T!==32&&T!==13||this.togglePopup()},d.prototype._onMapClick=function(h){var m=h.originalEvent.target,T=this._element;this._popup&&(m===T||T.contains(m))&&this.togglePopup()},d.prototype.getPopup=function(){return this._popup},d.prototype.togglePopup=function(){var h=this._popup;return h?(h.isOpen()?h.remove():h.addTo(this._map),this):this},d.prototype._update=function(h){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=To(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var m="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?m="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(m="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var T="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?T="rotateX(0deg)":this._pitchAlignment==="map"&&(T="rotateX("+this._map.getPitch()+"deg)"),h&&h.type!=="moveend"||(this._pos=this._pos.round()),f.setTransform(this._element,Eo[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+T+" "+m)}},d.prototype.getOffset=function(){return this._offset},d.prototype.setOffset=function(h){return this._offset=o.Point.convert(h),this._update(),this},d.prototype._onMove=function(h){if(!this._isDragging){var m=this._clickTolerance||this._map._clickTolerance;this._isDragging=h.point.dist(this._pointerdownPos)>=m}this._isDragging&&(this._pos=h.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new o.Event("dragstart"))),this.fire(new o.Event("drag")))},d.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new o.Event("dragend")),this._state="inactive"},d.prototype._addDragHandler=function(h){this._element.contains(h.originalEvent.target)&&(h.preventDefault(),this._positionDelta=h.point.sub(this._pos).add(this._offset),this._pointerdownPos=h.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},d.prototype.setDraggable=function(h){return this._draggable=!!h,this._map&&(h?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},d.prototype.isDraggable=function(){return this._draggable},d.prototype.setRotation=function(h){return this._rotation=h||0,this._update(),this},d.prototype.getRotation=function(){return this._rotation},d.prototype.setRotationAlignment=function(h){return this._rotationAlignment=h||"auto",this._update(),this},d.prototype.getRotationAlignment=function(){return this._rotationAlignment},d.prototype.setPitchAlignment=function(h){return this._pitchAlignment=h&&h!=="auto"?h:this._rotationAlignment,this._update(),this},d.prototype.getPitchAlignment=function(){return this._pitchAlignment},d}(o.Evented),Fl={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},na=0,Oo=!1,ia=function(l){function d(h){l.call(this),this.options=o.extend({},Fl,h),o.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return l&&(d.__proto__=l),(d.prototype=Object.create(l&&l.prototype)).constructor=d,d.prototype.onAdd=function(h){var m;return this._map=h,this._container=f.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),m=this._setupUI,tr!==void 0?m(tr):o.window.navigator.permissions!==void 0?o.window.navigator.permissions.query({name:"geolocation"}).then(function(T){m(tr=T.state!=="denied")}):m(tr=!!o.window.navigator.geolocation),this._container},d.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(o.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),f.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,na=0,Oo=!1},d.prototype._isOutOfMapMaxBounds=function(h){var m=this._map.getMaxBounds(),T=h.coords;return m&&(T.longitude<m.getWest()||T.longitude>m.getEast()||T.latitude<m.getSouth()||T.latitude>m.getNorth())},d.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},d.prototype._onSuccess=function(h){if(this._map){if(this._isOutOfMapMaxBounds(h))return this._setErrorState(),this.fire(new o.Event("outofmaxbounds",h)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=h,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(h),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(h),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new o.Event("geolocate",h)),this._finish()}},d.prototype._updateCamera=function(h){var m=new o.LngLat(h.coords.longitude,h.coords.latitude),T=h.coords.accuracy,P=this._map.getBearing(),R=o.extend({bearing:P},this.options.fitBoundsOptions);this._map.fitBounds(m.toBounds(T),R,{geolocateSource:!0})},d.prototype._updateMarker=function(h){if(h){var m=new o.LngLat(h.coords.longitude,h.coords.latitude);this._accuracyCircleMarker.setLngLat(m).addTo(this._map),this._userLocationDotMarker.setLngLat(m).addTo(this._map),this._accuracy=h.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},d.prototype._updateCircleRadius=function(){var h=this._map._container.clientHeight/2,m=this._map.unproject([0,h]),T=this._map.unproject([1,h]),P=m.distanceTo(T),R=Math.ceil(2*this._accuracy/P);this._circleElement.style.width=R+"px",this._circleElement.style.height=R+"px"},d.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},d.prototype._onError=function(h){if(this._map){if(this.options.trackUserLocation)if(h.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var m=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=m,this._geolocateButton.setAttribute("aria-label",m),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(h.code===3&&Oo)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new o.Event("error",h)),this._finish()}},d.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},d.prototype._setupUI=function(h){var m=this;if(this._container.addEventListener("contextmenu",function(R){return R.preventDefault()}),this._geolocateButton=f.create("button","mapboxgl-ctrl-geolocate",this._container),f.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",h===!1){o.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var T=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=T,this._geolocateButton.setAttribute("aria-label",T)}else{var P=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=P,this._geolocateButton.setAttribute("aria-label",P)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=f.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Hc(this._dotElement),this._circleElement=f.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Hc({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(R){R.geolocateSource||m._watchState!=="ACTIVE_LOCK"||R.originalEvent&&R.originalEvent.type==="resize"||(m._watchState="BACKGROUND",m._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),m._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),m.fire(new o.Event("trackuserlocationend")))})},d.prototype.trigger=function(){if(!this._setup)return o.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new o.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":na--,Oo=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new o.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new o.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var h;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++na>1?(h={maximumAge:6e5,timeout:0},Oo=!0):(h=this.options.positionOptions,Oo=!1),this._geolocationWatchID=o.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,h)}}else o.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},d.prototype._clearWatch=function(){o.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},d}(o.Evented),sa={maxWidth:100,unit:"metric"},ys=function(l){this.options=o.extend({},sa,l),o.bindAll(["_onMove","setUnit"],this)};function y(l,d,h){var m=h&&h.maxWidth||100,T=l._container.clientHeight/2,P=l.unproject([0,T]),R=l.unproject([m,T]),L=P.distanceTo(R);if(h&&h.unit==="imperial"){var z=3.2808*L;z>5280?_(d,m,z/5280,l._getUIString("ScaleControl.Miles")):_(d,m,z,l._getUIString("ScaleControl.Feet"))}else h&&h.unit==="nautical"?_(d,m,L/1852,l._getUIString("ScaleControl.NauticalMiles")):L>=1e3?_(d,m,L/1e3,l._getUIString("ScaleControl.Kilometers")):_(d,m,L,l._getUIString("ScaleControl.Meters"))}function _(l,d,h,m){var T,P,R,L=(T=h,(P=Math.pow(10,(""+Math.floor(T)).length-1))*(R=(R=T/P)>=10?10:R>=5?5:R>=3?3:R>=2?2:R>=1?1:function(z){var X=Math.pow(10,Math.ceil(-Math.log(z)/Math.LN10));return Math.round(z*X)/X}(R)));l.style.width=d*(L/h)+"px",l.innerHTML=L+"&nbsp;"+m}ys.prototype.getDefaultPosition=function(){return"bottom-left"},ys.prototype._onMove=function(){y(this._map,this._container,this.options)},ys.prototype.onAdd=function(l){return this._map=l,this._container=f.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",l.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},ys.prototype.onRemove=function(){f.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},ys.prototype.setUnit=function(l){this.options.unit=l,y(this._map,this._container,this.options)};var b=function(l){this._fullscreen=!1,l&&l.container&&(l.container instanceof o.window.HTMLElement?this._container=l.container:o.warnOnce("Full screen control 'container' must be a DOM element.")),o.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in o.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in o.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in o.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in o.window.document&&(this._fullscreenchange="MSFullscreenChange")};b.prototype.onAdd=function(l){return this._map=l,this._container||(this._container=this._map.getContainer()),this._controlContainer=f.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",o.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},b.prototype.onRemove=function(){f.remove(this._controlContainer),this._map=null,o.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},b.prototype._checkFullscreenSupport=function(){return!!(o.window.document.fullscreenEnabled||o.window.document.mozFullScreenEnabled||o.window.document.msFullscreenEnabled||o.window.document.webkitFullscreenEnabled)},b.prototype._setupUI=function(){var l=this._fullscreenButton=f.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);f.create("span","mapboxgl-ctrl-icon",l).setAttribute("aria-hidden",!0),l.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),o.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},b.prototype._updateTitle=function(){var l=this._getTitle();this._fullscreenButton.setAttribute("aria-label",l),this._fullscreenButton.title=l},b.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},b.prototype._isFullscreen=function(){return this._fullscreen},b.prototype._changeIcon=function(){(o.window.document.fullscreenElement||o.window.document.mozFullScreenElement||o.window.document.webkitFullscreenElement||o.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},b.prototype._onClickFullscreen=function(){this._isFullscreen()?o.window.document.exitFullscreen?o.window.document.exitFullscreen():o.window.document.mozCancelFullScreen?o.window.document.mozCancelFullScreen():o.window.document.msExitFullscreen?o.window.document.msExitFullscreen():o.window.document.webkitCancelFullScreen&&o.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var C={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},B=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),M=function(l){function d(h){l.call(this),this.options=o.extend(Object.create(C),h),o.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return l&&(d.__proto__=l),(d.prototype=Object.create(l&&l.prototype)).constructor=d,d.prototype.addTo=function(h){return this._map&&this.remove(),this._map=h,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new o.Event("open")),this},d.prototype.isOpen=function(){return!!this._map},d.prototype.remove=function(){return this._content&&f.remove(this._content),this._container&&(f.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new o.Event("close")),this},d.prototype.getLngLat=function(){return this._lngLat},d.prototype.setLngLat=function(h){return this._lngLat=o.LngLat.convert(h),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},d.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},d.prototype.getElement=function(){return this._container},d.prototype.setText=function(h){return this.setDOMContent(o.window.document.createTextNode(h))},d.prototype.setHTML=function(h){var m,T=o.window.document.createDocumentFragment(),P=o.window.document.createElement("body");for(P.innerHTML=h;m=P.firstChild;)T.appendChild(m);return this.setDOMContent(T)},d.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},d.prototype.setMaxWidth=function(h){return this.options.maxWidth=h,this._update(),this},d.prototype.setDOMContent=function(h){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=f.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(h),this._createCloseButton(),this._update(),this._focusFirstElement(),this},d.prototype.addClassName=function(h){this._container&&this._container.classList.add(h)},d.prototype.removeClassName=function(h){this._container&&this._container.classList.remove(h)},d.prototype.setOffset=function(h){return this.options.offset=h,this._update(),this},d.prototype.toggleClassName=function(h){if(this._container)return this._container.classList.toggle(h)},d.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=f.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))},d.prototype._onMouseUp=function(h){this._update(h.point)},d.prototype._onMouseMove=function(h){this._update(h.point)},d.prototype._onDrag=function(h){this._update(h.point)},d.prototype._update=function(h){var m=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=f.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=f.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(Z){return m._container.classList.add(Z)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=To(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||h)){var T=this._pos=this._trackPointer&&h?h:this._map.project(this._lngLat),P=this.options.anchor,R=function Z(te){if(te){if(typeof te=="number"){var oe=Math.round(Math.sqrt(.5*Math.pow(te,2)));return{center:new o.Point(0,0),top:new o.Point(0,te),"top-left":new o.Point(oe,oe),"top-right":new o.Point(-oe,oe),bottom:new o.Point(0,-te),"bottom-left":new o.Point(oe,-oe),"bottom-right":new o.Point(-oe,-oe),left:new o.Point(te,0),right:new o.Point(-te,0)}}if(te instanceof o.Point||Array.isArray(te)){var we=o.Point.convert(te);return{center:we,top:we,"top-left":we,"top-right":we,bottom:we,"bottom-left":we,"bottom-right":we,left:we,right:we}}return{center:o.Point.convert(te.center||[0,0]),top:o.Point.convert(te.top||[0,0]),"top-left":o.Point.convert(te["top-left"]||[0,0]),"top-right":o.Point.convert(te["top-right"]||[0,0]),bottom:o.Point.convert(te.bottom||[0,0]),"bottom-left":o.Point.convert(te["bottom-left"]||[0,0]),"bottom-right":o.Point.convert(te["bottom-right"]||[0,0]),left:o.Point.convert(te.left||[0,0]),right:o.Point.convert(te.right||[0,0])}}return Z(new o.Point(0,0))}(this.options.offset);if(!P){var L,z=this._container.offsetWidth,X=this._container.offsetHeight;L=T.y+R.bottom.y<X?["top"]:T.y>this._map.transform.height-X?["bottom"]:[],T.x<z/2?L.push("left"):T.x>this._map.transform.width-z/2&&L.push("right"),P=L.length===0?"bottom":L.join("-")}var ee=T.add(R[P]).round();f.setTransform(this._container,Eo[P]+" translate("+ee.x+"px,"+ee.y+"px)"),Jt(this._container,P,"popup")}},d.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var h=this._container.querySelector(B);h&&h.focus()}},d.prototype._onClose=function(){this.remove()},d}(o.Evented),O={version:o.version,supported:c,setRTLTextPlugin:o.setRTLTextPlugin,getRTLTextPluginStatus:o.getRTLTextPluginStatus,Map:Tu,NavigationControl:di,GeolocateControl:ia,AttributionControl:fs,ScaleControl:ys,FullscreenControl:b,Popup:M,Marker:Hc,Style:zn,LngLat:o.LngLat,LngLatBounds:o.LngLatBounds,Point:o.Point,MercatorCoordinate:o.MercatorCoordinate,Evented:o.Evented,config:o.config,prewarm:function(){ht().acquire(Ke)},clearPrewarmedResources:function(){var l=Pt;l&&(l.isPreloaded()&&l.numActive()===1?(l.release(Ke),Pt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return o.config.ACCESS_TOKEN},set accessToken(l){o.config.ACCESS_TOKEN=l},get baseApiUrl(){return o.config.API_URL},set baseApiUrl(l){o.config.API_URL=l},get workerCount(){return Et.workerCount},set workerCount(l){Et.workerCount=l},get maxParallelImageRequests(){return o.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(l){o.config.MAX_PARALLEL_IMAGE_REQUESTS=l},clearStorage:function(l){o.clearTileCache(l)},workerUrl:""};return O}),i})}(J0)),J0.exports}var kse=Lse();const dl=_h(kse);var Nse=1e-7;function ex(r){return Array.isArray(r)||ArrayBuffer.isView(r)}function e6(r,e){if(r===e)return!0;if(ex(r)&&ex(e)){if(r.length!==e.length)return!1;for(var t=0;t<r.length;++t)if(!e6(r[t],e[t]))return!1;return!0}return Math.abs(r-e)<=Nse}function r0(r,e,t){return Math.max(e,Math.min(t,r))}function k_(r,e,t){return ex(r)?r.map(function(n,i){return k_(n,e[i],t)}):t*e+(1-t)*r}function pc(r,e){if(!r)throw new Error(e||"react-map-gl: assertion failed.")}function zI(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function GI(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zI(Object(t),!0).forEach(function(n){Tr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):zI(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Qf={minZoom:0,maxZoom:24,minPitch:0,maxPitch:60},Ob={pitch:0,bearing:0,altitude:1.5},VI=5,Use=1.2,wp=function(){function r(e){var t=e.width,n=e.height,i=e.latitude,s=e.longitude,o=e.zoom,c=e.bearing,f=c===void 0?Ob.bearing:c,A=e.pitch,v=A===void 0?Ob.pitch:A,w=e.altitude,S=w===void 0?Ob.altitude:w,F=e.maxZoom,N=F===void 0?Qf.maxZoom:F,U=e.minZoom,$=U===void 0?Qf.minZoom:U,G=e.maxPitch,H=G===void 0?Qf.maxPitch:G,J=e.minPitch,ue=J===void 0?Qf.minPitch:J,q=e.transitionDuration,se=e.transitionEasing,Te=e.transitionInterpolator,Ue=e.transitionInterruption,de=e.startPanLngLat,me=e.startZoomLngLat,pe=e.startRotatePos,W=e.startBearing,re=e.startPitch,Ee=e.startZoom;af(this,r),pc(Number.isFinite(t),"`width` must be supplied"),pc(Number.isFinite(n),"`height` must be supplied"),pc(Number.isFinite(s),"`longitude` must be supplied"),pc(Number.isFinite(i),"`latitude` must be supplied"),pc(Number.isFinite(o),"`zoom` must be supplied"),this._viewportProps=this._applyConstraints({width:t,height:n,latitude:i,longitude:s,zoom:o,bearing:f,pitch:v,altitude:S,maxZoom:N,minZoom:$,maxPitch:H,minPitch:ue,transitionDuration:q,transitionEasing:se,transitionInterpolator:Te,transitionInterruption:Ue}),this._state={startPanLngLat:de,startZoomLngLat:me,startRotatePos:pe,startBearing:W,startPitch:re,startZoom:Ee}}return of(r,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getState",value:function(){return this._state}},{key:"panStart",value:function(t){var n=t.pos;return this._getUpdatedMapState({startPanLngLat:this._unproject(n)})}},{key:"pan",value:function(t){var n=t.pos,i=t.startPos,s=this._state.startPanLngLat||this._unproject(i);if(!s)return this;var o=this._calculateNewLngLat({startPanLngLat:s,pos:n}),c=gs(o,2),f=c[0],A=c[1];return this._getUpdatedMapState({longitude:f,latitude:A})}},{key:"panEnd",value:function(){return this._getUpdatedMapState({startPanLngLat:null})}},{key:"rotateStart",value:function(t){var n=t.pos;return this._getUpdatedMapState({startRotatePos:n,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(t){var n=t.pos,i=t.deltaAngleX,s=i===void 0?0:i,o=t.deltaAngleY,c=o===void 0?0:o,f=this._state,A=f.startRotatePos,v=f.startBearing,w=f.startPitch;if(!Number.isFinite(v)||!Number.isFinite(w))return this;var S;return n?S=this._calculateNewPitchAndBearing(GI(GI({},this._getRotationParams(n,A)),{},{startBearing:v,startPitch:w})):S={bearing:v+s,pitch:w+c},this._getUpdatedMapState(S)}},{key:"rotateEnd",value:function(){return this._getUpdatedMapState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(t){var n=t.pos;return this._getUpdatedMapState({startZoomLngLat:this._unproject(n),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(t){var n=t.pos,i=t.startPos,s=t.scale;pc(s>0,"`scale` must be a positive number");var o=this._state,c=o.startZoom,f=o.startZoomLngLat;Number.isFinite(c)||(c=this._viewportProps.zoom,f=this._unproject(i)||this._unproject(n)),pc(f,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var A=this._calculateNewZoom({scale:s,startZoom:c||0}),v=new fl(Object.assign({},this._viewportProps,{zoom:A})),w=v.getMapCenterByLngLatPosition({lngLat:f,pos:n}),S=gs(w,2),F=S[0],N=S[1];return this._getUpdatedMapState({zoom:A,longitude:F,latitude:N})}},{key:"zoomEnd",value:function(){return this._getUpdatedMapState({startZoomLngLat:null,startZoom:null})}},{key:"_getUpdatedMapState",value:function(t){return new r(Object.assign({},this._viewportProps,this._state,t))}},{key:"_applyConstraints",value:function(t){var n=t.maxZoom,i=t.minZoom,s=t.zoom;t.zoom=r0(s,i,n);var o=t.maxPitch,c=t.minPitch,f=t.pitch;return t.pitch=r0(f,c,o),Object.assign(t,Ese(t)),t}},{key:"_unproject",value:function(t){var n=new fl(this._viewportProps);return t&&n.unproject(t)}},{key:"_calculateNewLngLat",value:function(t){var n=t.startPanLngLat,i=t.pos,s=new fl(this._viewportProps);return s.getMapCenterByLngLatPosition({lngLat:n,pos:i})}},{key:"_calculateNewZoom",value:function(t){var n=t.scale,i=t.startZoom,s=this._viewportProps,o=s.maxZoom,c=s.minZoom,f=i+Math.log2(n);return r0(f,c,o)}},{key:"_calculateNewPitchAndBearing",value:function(t){var n=t.deltaScaleX,i=t.deltaScaleY,s=t.startBearing,o=t.startPitch;i=r0(i,-1,1);var c=this._viewportProps,f=c.minPitch,A=c.maxPitch,v=s+180*n,w=o;return i>0?w=o+i*(A-o):i<0&&(w=o-i*(f-o)),{pitch:w,bearing:v}}},{key:"_getRotationParams",value:function(t,n){var i=t[0]-n[0],s=t[1]-n[1],o=t[1],c=n[1],f=this._viewportProps,A=f.width,v=f.height,w=i/A,S=0;return s>0?Math.abs(v-c)>VI&&(S=s/(c-v)*Use):s<0&&c>VI&&(S=1-o/c),S=Math.min(1,Math.max(-1,S)),{deltaScaleX:w,deltaScaleY:S}}}]),r}();function zse(r){return r[0].toLowerCase()+r.slice(1)}function Gse(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qf;for(var t in e){var n=t.slice(0,3),i=zse(t.slice(3));if(n==="min"&&r[i]<e[t]||n==="max"&&r[i]>e[t])return!1}return!0}function HI(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function jI(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?HI(Object(t),!0).forEach(function(n){Tr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):HI(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Th=It.createContext({viewport:null,map:null,container:null,onViewportChange:null,onViewStateChange:null,eventManager:null}),rC=Th.Provider;function Vse(r){var e=r.value,t=r.children,n=It.useState(null),i=gs(n,2),s=i[0],o=i[1],c=It.useContext(Th);return e=jI(jI({setMap:o},c),{},{map:c&&c.map||s},e),It.createElement(rC,{value:e},t)}Th.Provider=Vse;var tx=typeof window<"u"?It.useLayoutEffect:It.useEffect;function $I(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function dc(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$I(Object(t),!0).forEach(function(n){Tr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):$I(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Hse="https://visgl.github.io/react-map-gl/docs/get-started/mapbox-tokens",t6="A valid API access token is required to use Mapbox data";function jse(){}function r6(r){var e=r.props,t=r.width,n=r.height;return new fl(dc(dc(dc({},e),e.viewState),{},{width:t,height:n}))}var $se=401,WI={position:"absolute",width:"100%",height:"100%",overflow:"hidden"},Wse=Object.assign({},Ch.propTypes,{width:At.oneOfType([At.number,At.string]),height:At.oneOfType([At.number,At.string]),onResize:At.func,disableTokenWarning:At.bool,visible:At.bool,className:At.string,style:At.object,visibilityConstraints:At.object}),Jse=Object.assign({},Ch.defaultProps,{disableTokenWarning:!1,visible:!0,onResize:jse,className:"",style:null,visibilityConstraints:Qf});function Xse(){var r={position:"absolute",left:0,top:0};return It.createElement("div",{key:"warning",id:"no-token-warning",style:r},It.createElement("h3",{key:"header"},t6),It.createElement("div",{key:"text"},"For information on setting up your basemap, read"),It.createElement("a",{key:"link",href:Hse},"Note on Map Tokens"))}function Kse(r){return{getMap:function(){return r.current&&r.current.getMap()},queryRenderedFeatures:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.current&&r.current.getMap();return i&&i.queryRenderedFeatures(t,n)}}}var nu=It.forwardRef(function(r,e){var t=It.useState(!0),n=gs(t,2),i=n[0],s=n[1],o=It.useState({width:0,height:0}),c=gs(o,2),f=c[0],A=c[1],v=It.useRef(null),w=It.useRef(null),S=It.useRef(null),F=It.useRef(null),N=It.useContext(Th);tx(function(){if(nu.supported()){var me=new Ch(dc(dc(dc({},r),f),{},{mapboxgl:dl,container:w.current,onError:function(re){var Ee=re.error&&re.error.status||re.status;Ee===$se&&i&&(console.error(t6),s(!1)),r.onError(re)}}));v.current=me,N&&N.setMap&&N.setMap(me.getMap());var pe=new c5(function(W){if(W[0].contentRect){var re=W[0].contentRect,Ee=re.width,et=re.height;A({width:Ee,height:et}),r.onResize({width:Ee,height:et})}});return pe.observe(S.current),function(){me.finalize(),v.current=null,pe.disconnect()}}},[]),tx(function(){v.current&&v.current.setProps(dc(dc({},r),f))});var U=v.current&&v.current.getMap();It.useImperativeHandle(e,function(){return Kse(v)},[]);var $=It.useCallback(function(me){var pe=me.target;pe===F.current&&pe.scrollTo(0,0)},[]),G=U&&It.createElement(rC,{value:dc(dc({},N),{},{viewport:N.viewport||r6(dc({map:U,props:r},f)),map:U,container:N.container||S.current})},It.createElement("div",{key:"map-overlays",className:"overlays",ref:F,style:WI,onScroll:$},r.children)),H=r.className,J=r.width,ue=r.height,q=r.style,se=r.visibilityConstraints,Te=Object.assign({position:"relative"},q,{width:J,height:ue}),Ue=r.visible&&Gse(r.viewState||r,se),de=Object.assign({},WI,{visibility:Ue?"inherit":"hidden"});return It.createElement("div",{key:"map-container",ref:S,style:Te},It.createElement("div",{key:"map-mapbox",ref:w,style:de,className:H}),G,!i&&!r.disableTokenWarning&&It.createElement(Xse,null))});nu.supported=function(){return dl&&dl.supported()};nu.propTypes=Wse;nu.defaultProps=Jse;function qse(r,e){var t;if(typeof Symbol>"u"||r[Symbol.iterator]==null){if(Array.isArray(r)||(t=Yse(r))||e){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(A){throw A},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2604
2599
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,c;return{s:function(){t=r[Symbol.iterator]()},n:function(){var A=t.next();return s=A.done,A},e:function(A){o=!0,c=A},f:function(){try{!s&&t.return!=null&&t.return()}finally{if(o)throw c}}}}function Yse(r,e){if(r){if(typeof r=="string")return JI(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return JI(r,e)}}function JI(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}var n6=function(){function r(){af(this,r),Tr(this,"propNames",[])}return of(r,[{key:"arePropsEqual",value:function(t,n){var i=qse(this.propNames||[]),s;try{for(i.s();!(s=i.n()).done;){var o=s.value;if(!e6(t[o],n[o]))return!1}}catch(c){i.e(c)}finally{i.f()}return!0}},{key:"initializeProps",value:function(t,n){return{start:t,end:n}}},{key:"interpolateProps",value:function(t,n,i){pc(!1,"interpolateProps is not implemented")}},{key:"getDuration",value:function(t,n){return n.transitionDuration}}]),r}(),Zse={longitude:1,bearing:1};function N_(r){return Number.isFinite(r)||Array.isArray(r)}function Qse(r){return r in Zse}function rx(r,e,t){return Qse(r)&&Math.abs(t-e)>180&&(t=t<0?t+360:t-360),t}function Lb(r,e){var t;if(typeof Symbol>"u"||r[Symbol.iterator]==null){if(Array.isArray(r)||(t=eoe(r))||e){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(A){throw A},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2605
2600
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,c;return{s:function(){t=r[Symbol.iterator]()},n:function(){var A=t.next();return s=A.done,A},e:function(A){o=!0,c=A},f:function(){try{!s&&t.return!=null&&t.return()}finally{if(o)throw c}}}}function eoe(r,e){if(r){if(typeof r=="string")return XI(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return XI(r,e)}}function XI(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function toe(r){var e=roe();return function(){var n=Bp(r),i;if(e){var s=Bp(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return zx(this,i)}}function roe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}var noe=["longitude","latitude","zoom","bearing","pitch"],ioe=["latitude","longitude","zoom","width","height"],KI=["bearing","pitch"],soe={speed:1.2,curve:1.414};(function(r){Ux(t,r);var e=toe(t);function t(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return af(this,t),n=e.call(this),Tr(zu(n),"propNames",noe),n.props=Object.assign({},soe,i),n}return of(t,[{key:"initializeProps",value:function(i,s){var o={},c={},f=Lb(ioe),A;try{for(f.s();!(A=f.n()).done;){var v=A.value,w=i[v],S=s[v];pc(N_(w)&&N_(S),"".concat(v," must be supplied for transition")),o[v]=w,c[v]=rx(v,w,S)}}catch(H){f.e(H)}finally{f.f()}var F=Lb(KI),N;try{for(F.s();!(N=F.n()).done;){var U=N.value,$=i[U]||0,G=s[U]||0;o[U]=$,c[U]=rx(U,$,G)}}catch(H){F.e(H)}finally{F.f()}return{start:o,end:c}}},{key:"interpolateProps",value:function(i,s,o){var c=Sse(i,s,o,this.props),f=Lb(KI),A;try{for(f.s();!(A=f.n()).done;){var v=A.value;c[v]=k_(i[v],s[v],o)}}catch(w){f.e(w)}finally{f.f()}return c}},{key:"getDuration",value:function(i,s){var o=s.transitionDuration;return o==="auto"&&(o=Ise(i,s,this.props)),o}}]),t})(n6);function qI(r,e){var t;if(typeof Symbol>"u"||r[Symbol.iterator]==null){if(Array.isArray(r)||(t=ooe(r))||e){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(A){throw A},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2606
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,c;return{s:function(){t=r[Symbol.iterator]()},n:function(){var A=t.next();return s=A.done,A},e:function(A){o=!0,c=A},f:function(){try{!s&&t.return!=null&&t.return()}finally{if(o)throw c}}}}function ooe(r,e){if(r){if(typeof r=="string")return YI(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return YI(r,e)}}function YI(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function aoe(r){var e=coe();return function(){var n=Bp(r),i;if(e){var s=Bp(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return zx(this,i)}}function coe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}var loe=["longitude","latitude","zoom","bearing","pitch"],ug=function(r){Ux(t,r);var e=aoe(t);function t(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return af(this,t),n=e.call(this),Array.isArray(i)&&(i={transitionProps:i}),n.propNames=i.transitionProps||loe,i.around&&(n.around=i.around),n}return of(t,[{key:"initializeProps",value:function(i,s){var o={},c={};if(this.around){o.around=this.around;var f=new fl(i).unproject(this.around);Object.assign(c,s,{around:new fl(s).project(f),aroundLngLat:f})}var A=qI(this.propNames),v;try{for(A.s();!(v=A.n()).done;){var w=v.value,S=i[w],F=s[w];pc(N_(S)&&N_(F),"".concat(w," must be supplied for transition")),o[w]=S,c[w]=rx(w,S,F)}}catch(N){A.e(N)}finally{A.f()}return{start:o,end:c}}},{key:"interpolateProps",value:function(i,s,o){var c={},f=qI(this.propNames),A;try{for(f.s();!(A=f.n()).done;){var v=A.value;c[v]=k_(i[v],s[v],o)}}catch(U){f.e(U)}finally{f.f()}if(s.around){var w=new fl(Object.assign({},s,c)).getMapCenterByLngLatPosition({lngLat:s.aroundLngLat,pos:k_(i.around,s.around,o)}),S=gs(w,2),F=S[0],N=S[1];c.longitude=F,c.latitude=N}return c}}]),t}(n6),fg=function(){};function uoe(r,e){var t=r(e);return function(n){return 1/(1-t)*(r(n*(1-e)+e)-t)}}var hg={BREAK:1,SNAP_TO_END:2,IGNORE:3,UPDATE:4},foe={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new ug,transitionInterruption:hg.BREAK,onTransitionStart:fg,onTransitionInterrupt:fg,onTransitionEnd:fg},nC=function(){function r(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};af(this,r),Tr(this,"_animationFrame",null),Tr(this,"_onTransitionFrame",function(){e._animationFrame=requestAnimationFrame(e._onTransitionFrame),e._updateViewport()}),this.props=null,this.onViewportChange=t.onViewportChange||fg,this.onStateChange=t.onStateChange||fg,this.time=t.getTime||Date.now}return of(r,[{key:"getViewportInTransition",value:function(){return this._animationFrame?this.state.propsInTransition:null}},{key:"processViewportChange",value:function(t){var n=this.props;if(this.props=t,!n||this._shouldIgnoreViewportChange(n,t))return!1;if(this._isTransitionEnabled(t)){var i=Object.assign({},n),s=Object.assign({},t);if(this._isTransitionInProgress()&&(n.onTransitionInterrupt(),this.state.interruption===hg.SNAP_TO_END?Object.assign(i,this.state.endProps):Object.assign(i,this.state.propsInTransition),this.state.interruption===hg.UPDATE)){var o=this.time(),c=(o-this.state.startTime)/this.state.duration;s.transitionDuration=this.state.duration-(o-this.state.startTime),s.transitionEasing=uoe(this.state.easing,c),s.transitionInterpolator=i.transitionInterpolator}return s.onTransitionStart(),this._triggerTransition(i,s),!0}return this._isTransitionInProgress()&&(n.onTransitionInterrupt(),this._endTransition()),!1}},{key:"_isTransitionInProgress",value:function(){return!!this._animationFrame}},{key:"_isTransitionEnabled",value:function(t){var n=t.transitionDuration,i=t.transitionInterpolator;return(n>0||n==="auto")&&!!i}},{key:"_isUpdateDueToCurrentTransition",value:function(t){return this.state.propsInTransition?this.state.interpolator.arePropsEqual(t,this.state.propsInTransition):!1}},{key:"_shouldIgnoreViewportChange",value:function(t,n){return t?this._isTransitionInProgress()?this.state.interruption===hg.IGNORE||this._isUpdateDueToCurrentTransition(n):this._isTransitionEnabled(n)?n.transitionInterpolator.arePropsEqual(t,n):!0:!0}},{key:"_triggerTransition",value:function(t,n){pc(this._isTransitionEnabled(n)),this._animationFrame&&cancelAnimationFrame(this._animationFrame);var i=n.transitionInterpolator,s=i.getDuration?i.getDuration(t,n):n.transitionDuration;if(s!==0){var o=n.transitionInterpolator.initializeProps(t,n),c={inTransition:!0,isZooming:t.zoom!==n.zoom,isPanning:t.longitude!==n.longitude||t.latitude!==n.latitude,isRotating:t.bearing!==n.bearing||t.pitch!==n.pitch};this.state={duration:s,easing:n.transitionEasing,interpolator:n.transitionInterpolator,interruption:n.transitionInterruption,startTime:this.time(),startProps:o.start,endProps:o.end,animation:null,propsInTransition:{}},this._onTransitionFrame(),this.onStateChange(c)}}},{key:"_endTransition",value:function(){this._animationFrame&&(cancelAnimationFrame(this._animationFrame),this._animationFrame=null),this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1})}},{key:"_updateViewport",value:function(){var t=this.time(),n=this.state,i=n.startTime,s=n.duration,o=n.easing,c=n.interpolator,f=n.startProps,A=n.endProps,v=!1,w=(t-i)/s;w>=1&&(w=1,v=!0),w=o(w);var S=c.interpolateProps(f,A,w),F=new wp(Object.assign({},this.props,S));this.state.propsInTransition=F.getViewportProps(),this.onViewportChange(this.state.propsInTransition,this.props),v&&(this._endTransition(),this.props.onTransitionEnd())}}]),r}();Tr(nC,"defaultProps",foe);var kb={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
2607
- * http://hammerjs.github.io/
2608
- *
2609
- * Copyright (c) 2016 Jorik Tangelder;
2610
- * Licensed under the MIT license */var ZI;function hoe(){return ZI||(ZI=1,function(r){(function(e,t,n,i){var s=["","webkit","Moz","MS","ms","o"],o=t.createElement("div"),c="function",f=Math.round,A=Math.abs,v=Date.now;function w(xe,Pe,$e){return setTimeout(J(xe,$e),Pe)}function S(xe,Pe,$e){return Array.isArray(xe)?(F(xe,$e[Pe],$e),!0):!1}function F(xe,Pe,$e){var gt;if(xe)if(xe.forEach)xe.forEach(Pe,$e);else if(xe.length!==i)for(gt=0;gt<xe.length;)Pe.call($e,xe[gt],gt,xe),gt++;else for(gt in xe)xe.hasOwnProperty(gt)&&Pe.call($e,xe[gt],gt,xe)}function N(xe,Pe,$e){var gt="DEPRECATED METHOD: "+Pe+`
2601
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,c;return{s:function(){t=r[Symbol.iterator]()},n:function(){var A=t.next();return s=A.done,A},e:function(A){o=!0,c=A},f:function(){try{!s&&t.return!=null&&t.return()}finally{if(o)throw c}}}}function ooe(r,e){if(r){if(typeof r=="string")return YI(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return YI(r,e)}}function YI(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function aoe(r){var e=coe();return function(){var n=Bp(r),i;if(e){var s=Bp(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return zx(this,i)}}function coe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}var loe=["longitude","latitude","zoom","bearing","pitch"],ug=function(r){Ux(t,r);var e=aoe(t);function t(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return af(this,t),n=e.call(this),Array.isArray(i)&&(i={transitionProps:i}),n.propNames=i.transitionProps||loe,i.around&&(n.around=i.around),n}return of(t,[{key:"initializeProps",value:function(i,s){var o={},c={};if(this.around){o.around=this.around;var f=new fl(i).unproject(this.around);Object.assign(c,s,{around:new fl(s).project(f),aroundLngLat:f})}var A=qI(this.propNames),v;try{for(A.s();!(v=A.n()).done;){var w=v.value,S=i[w],F=s[w];pc(N_(S)&&N_(F),"".concat(w," must be supplied for transition")),o[w]=S,c[w]=rx(w,S,F)}}catch(N){A.e(N)}finally{A.f()}return{start:o,end:c}}},{key:"interpolateProps",value:function(i,s,o){var c={},f=qI(this.propNames),A;try{for(f.s();!(A=f.n()).done;){var v=A.value;c[v]=k_(i[v],s[v],o)}}catch(U){f.e(U)}finally{f.f()}if(s.around){var w=new fl(Object.assign({},s,c)).getMapCenterByLngLatPosition({lngLat:s.aroundLngLat,pos:k_(i.around,s.around,o)}),S=gs(w,2),F=S[0],N=S[1];c.longitude=F,c.latitude=N}return c}}]),t}(n6),fg=function(){};function uoe(r,e){var t=r(e);return function(n){return 1/(1-t)*(r(n*(1-e)+e)-t)}}var hg={BREAK:1,SNAP_TO_END:2,IGNORE:3,UPDATE:4},foe={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new ug,transitionInterruption:hg.BREAK,onTransitionStart:fg,onTransitionInterrupt:fg,onTransitionEnd:fg},nC=function(){function r(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};af(this,r),Tr(this,"_animationFrame",null),Tr(this,"_onTransitionFrame",function(){e._animationFrame=requestAnimationFrame(e._onTransitionFrame),e._updateViewport()}),this.props=null,this.onViewportChange=t.onViewportChange||fg,this.onStateChange=t.onStateChange||fg,this.time=t.getTime||Date.now}return of(r,[{key:"getViewportInTransition",value:function(){return this._animationFrame?this.state.propsInTransition:null}},{key:"processViewportChange",value:function(t){var n=this.props;if(this.props=t,!n||this._shouldIgnoreViewportChange(n,t))return!1;if(this._isTransitionEnabled(t)){var i=Object.assign({},n),s=Object.assign({},t);if(this._isTransitionInProgress()&&(n.onTransitionInterrupt(),this.state.interruption===hg.SNAP_TO_END?Object.assign(i,this.state.endProps):Object.assign(i,this.state.propsInTransition),this.state.interruption===hg.UPDATE)){var o=this.time(),c=(o-this.state.startTime)/this.state.duration;s.transitionDuration=this.state.duration-(o-this.state.startTime),s.transitionEasing=uoe(this.state.easing,c),s.transitionInterpolator=i.transitionInterpolator}return s.onTransitionStart(),this._triggerTransition(i,s),!0}return this._isTransitionInProgress()&&(n.onTransitionInterrupt(),this._endTransition()),!1}},{key:"_isTransitionInProgress",value:function(){return!!this._animationFrame}},{key:"_isTransitionEnabled",value:function(t){var n=t.transitionDuration,i=t.transitionInterpolator;return(n>0||n==="auto")&&!!i}},{key:"_isUpdateDueToCurrentTransition",value:function(t){return this.state.propsInTransition?this.state.interpolator.arePropsEqual(t,this.state.propsInTransition):!1}},{key:"_shouldIgnoreViewportChange",value:function(t,n){return t?this._isTransitionInProgress()?this.state.interruption===hg.IGNORE||this._isUpdateDueToCurrentTransition(n):this._isTransitionEnabled(n)?n.transitionInterpolator.arePropsEqual(t,n):!0:!0}},{key:"_triggerTransition",value:function(t,n){pc(this._isTransitionEnabled(n)),this._animationFrame&&cancelAnimationFrame(this._animationFrame);var i=n.transitionInterpolator,s=i.getDuration?i.getDuration(t,n):n.transitionDuration;if(s!==0){var o=n.transitionInterpolator.initializeProps(t,n),c={inTransition:!0,isZooming:t.zoom!==n.zoom,isPanning:t.longitude!==n.longitude||t.latitude!==n.latitude,isRotating:t.bearing!==n.bearing||t.pitch!==n.pitch};this.state={duration:s,easing:n.transitionEasing,interpolator:n.transitionInterpolator,interruption:n.transitionInterruption,startTime:this.time(),startProps:o.start,endProps:o.end,animation:null,propsInTransition:{}},this._onTransitionFrame(),this.onStateChange(c)}}},{key:"_endTransition",value:function(){this._animationFrame&&(cancelAnimationFrame(this._animationFrame),this._animationFrame=null),this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1})}},{key:"_updateViewport",value:function(){var t=this.time(),n=this.state,i=n.startTime,s=n.duration,o=n.easing,c=n.interpolator,f=n.startProps,A=n.endProps,v=!1,w=(t-i)/s;w>=1&&(w=1,v=!0),w=o(w);var S=c.interpolateProps(f,A,w),F=new wp(Object.assign({},this.props,S));this.state.propsInTransition=F.getViewportProps(),this.onViewportChange(this.state.propsInTransition,this.props),v&&(this._endTransition(),this.props.onTransitionEnd())}}]),r}();Tr(nC,"defaultProps",foe);var kb={exports:{}};var ZI;function hoe(){return ZI||(ZI=1,function(r){(function(e,t,n,i){var s=["","webkit","Moz","MS","ms","o"],o=t.createElement("div"),c="function",f=Math.round,A=Math.abs,v=Date.now;function w(xe,Pe,$e){return setTimeout(J(xe,$e),Pe)}function S(xe,Pe,$e){return Array.isArray(xe)?(F(xe,$e[Pe],$e),!0):!1}function F(xe,Pe,$e){var gt;if(xe)if(xe.forEach)xe.forEach(Pe,$e);else if(xe.length!==i)for(gt=0;gt<xe.length;)Pe.call($e,xe[gt],gt,xe),gt++;else for(gt in xe)xe.hasOwnProperty(gt)&&Pe.call($e,xe[gt],gt,xe)}function N(xe,Pe,$e){var gt="DEPRECATED METHOD: "+Pe+`
2611
2602
  `+$e+` AT
2612
- `;return function(){var Wt=new Error("get-stack-trace"),vr=Wt&&Wt.stack?Wt.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Ir=e.console&&(e.console.warn||e.console.log);return Ir&&Ir.call(e.console,gt,vr),xe.apply(this,arguments)}}var U;typeof Object.assign!="function"?U=function(Pe){if(Pe===i||Pe===null)throw new TypeError("Cannot convert undefined or null to object");for(var $e=Object(Pe),gt=1;gt<arguments.length;gt++){var Wt=arguments[gt];if(Wt!==i&&Wt!==null)for(var vr in Wt)Wt.hasOwnProperty(vr)&&($e[vr]=Wt[vr])}return $e}:U=Object.assign;var $=N(function(Pe,$e,gt){for(var Wt=Object.keys($e),vr=0;vr<Wt.length;)(!gt||gt&&Pe[Wt[vr]]===i)&&(Pe[Wt[vr]]=$e[Wt[vr]]),vr++;return Pe},"extend","Use `assign`."),G=N(function(Pe,$e){return $(Pe,$e,!0)},"merge","Use `assign`.");function H(xe,Pe,$e){var gt=Pe.prototype,Wt;Wt=xe.prototype=Object.create(gt),Wt.constructor=xe,Wt._super=gt,$e&&U(Wt,$e)}function J(xe,Pe){return function(){return xe.apply(Pe,arguments)}}function ue(xe,Pe){return typeof xe==c?xe.apply(Pe&&Pe[0]||i,Pe):xe}function q(xe,Pe){return xe===i?Pe:xe}function se(xe,Pe,$e){F(me(Pe),function(gt){xe.addEventListener(gt,$e,!1)})}function Te(xe,Pe,$e){F(me(Pe),function(gt){xe.removeEventListener(gt,$e,!1)})}function Ue(xe,Pe){for(;xe;){if(xe==Pe)return!0;xe=xe.parentNode}return!1}function de(xe,Pe){return xe.indexOf(Pe)>-1}function me(xe){return xe.trim().split(/\s+/g)}function pe(xe,Pe,$e){if(xe.indexOf&&!$e)return xe.indexOf(Pe);for(var gt=0;gt<xe.length;){if($e&&xe[gt][$e]==Pe||!$e&&xe[gt]===Pe)return gt;gt++}return-1}function W(xe){return Array.prototype.slice.call(xe,0)}function re(xe,Pe,$e){for(var gt=[],Wt=[],vr=0;vr<xe.length;){var Ir=xe[vr][Pe];pe(Wt,Ir)<0&&gt.push(xe[vr]),Wt[vr]=Ir,vr++}return gt=gt.sort(function(Li,Ji){return Li[Pe]>Ji[Pe]}),gt}function Ee(xe,Pe){for(var $e,gt,Wt=Pe[0].toUpperCase()+Pe.slice(1),vr=0;vr<s.length;){if($e=s[vr],gt=$e?$e+Wt:Pe,gt in xe)return gt;vr++}return i}var et=1;function _e(){return et++}function Le(xe){var Pe=xe.ownerDocument||xe;return Pe.defaultView||Pe.parentWindow||e}var Ge=/mobile|tablet|ip(ad|hone|od)|android/i,Ze="ontouchstart"in e,tt=Ee(e,"PointerEvent")!==i,rt=Ze&&Ge.test(navigator.userAgent),ut="touch",vt="pen",St="mouse",st="kinect",dr=25,er=1,Kt=2,Nt=4,Ar=8,ln=1,Pr=2,xr=4,Vn=8,_r=16,yr=Pr|xr,un=Vn|_r,Dr=yr|un,ci=["x","y"],Yn=["clientX","clientY"];function mn(xe,Pe){var $e=this;this.manager=xe,this.callback=Pe,this.element=xe.element,this.target=xe.options.inputTarget,this.domHandler=function(gt){ue(xe.options.enable,[xe])&&$e.handler(gt)},this.init()}mn.prototype={handler:function(){},init:function(){this.evEl&&se(this.element,this.evEl,this.domHandler),this.evTarget&&se(this.target,this.evTarget,this.domHandler),this.evWin&&se(Le(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Te(this.element,this.evEl,this.domHandler),this.evTarget&&Te(this.target,this.evTarget,this.domHandler),this.evWin&&Te(Le(this.element),this.evWin,this.domHandler)}};function ti(xe){var Pe,$e=xe.options.inputClass;return $e?Pe=$e:tt?Pe=Ce:rt?Pe=he:Ze?Pe=g:Pe=Gt,new Pe(xe,Hn)}function Hn(xe,Pe,$e){var gt=$e.pointers.length,Wt=$e.changedPointers.length,vr=Pe&er&&gt-Wt===0,Ir=Pe&(Nt|Ar)&&gt-Wt===0;$e.isFirst=!!vr,$e.isFinal=!!Ir,vr&&(xe.session={}),$e.eventType=Pe,Bn(xe,$e),xe.emit("hammer.input",$e),xe.recognize($e),xe.session.prevInput=$e}function Bn(xe,Pe){var $e=xe.session,gt=Pe.pointers,Wt=gt.length;$e.firstInput||($e.firstInput=mr(Pe)),Wt>1&&!$e.firstMultiple?$e.firstMultiple=mr(Pe):Wt===1&&($e.firstMultiple=!1);var vr=$e.firstInput,Ir=$e.firstMultiple,fi=Ir?Ir.center:vr.center,Li=Pe.center=Rr(gt);Pe.timeStamp=v(),Pe.deltaTime=Pe.timeStamp-vr.timeStamp,Pe.angle=kt(fi,Li),Pe.distance=Me(fi,Li),Zn($e,Pe),Pe.offsetDirection=_i(Pe.deltaX,Pe.deltaY);var Ji=nn(Pe.deltaTime,Pe.deltaX,Pe.deltaY);Pe.overallVelocityX=Ji.x,Pe.overallVelocityY=Ji.y,Pe.overallVelocity=A(Ji.x)>A(Ji.y)?Ji.x:Ji.y,Pe.scale=Ir?lr(Ir.pointers,gt):1,Pe.rotation=Ir?$t(Ir.pointers,gt):0,Pe.maxPointers=$e.prevInput?Pe.pointers.length>$e.prevInput.maxPointers?Pe.pointers.length:$e.prevInput.maxPointers:Pe.pointers.length,Vt($e,Pe);var Qs=xe.element;Ue(Pe.srcEvent.target,Qs)&&(Qs=Pe.srcEvent.target),Pe.target=Qs}function Zn(xe,Pe){var $e=Pe.center,gt=xe.offsetDelta||{},Wt=xe.prevDelta||{},vr=xe.prevInput||{};(Pe.eventType===er||vr.eventType===Nt)&&(Wt=xe.prevDelta={x:vr.deltaX||0,y:vr.deltaY||0},gt=xe.offsetDelta={x:$e.x,y:$e.y}),Pe.deltaX=Wt.x+($e.x-gt.x),Pe.deltaY=Wt.y+($e.y-gt.y)}function Vt(xe,Pe){var $e=xe.lastInterval||Pe,gt=Pe.timeStamp-$e.timeStamp,Wt,vr,Ir,fi;if(Pe.eventType!=Ar&&(gt>dr||$e.velocity===i)){var Li=Pe.deltaX-$e.deltaX,Ji=Pe.deltaY-$e.deltaY,Qs=nn(gt,Li,Ji);vr=Qs.x,Ir=Qs.y,Wt=A(Qs.x)>A(Qs.y)?Qs.x:Qs.y,fi=_i(Li,Ji),xe.lastInterval=Pe}else Wt=$e.velocity,vr=$e.velocityX,Ir=$e.velocityY,fi=$e.direction;Pe.velocity=Wt,Pe.velocityX=vr,Pe.velocityY=Ir,Pe.direction=fi}function mr(xe){for(var Pe=[],$e=0;$e<xe.pointers.length;)Pe[$e]={clientX:f(xe.pointers[$e].clientX),clientY:f(xe.pointers[$e].clientY)},$e++;return{timeStamp:v(),pointers:Pe,center:Rr(Pe),deltaX:xe.deltaX,deltaY:xe.deltaY}}function Rr(xe){var Pe=xe.length;if(Pe===1)return{x:f(xe[0].clientX),y:f(xe[0].clientY)};for(var $e=0,gt=0,Wt=0;Wt<Pe;)$e+=xe[Wt].clientX,gt+=xe[Wt].clientY,Wt++;return{x:f($e/Pe),y:f(gt/Pe)}}function nn(xe,Pe,$e){return{x:Pe/xe||0,y:$e/xe||0}}function _i(xe,Pe){return xe===Pe?ln:A(xe)>=A(Pe)?xe<0?Pr:xr:Pe<0?Vn:_r}function Me(xe,Pe,$e){$e||($e=ci);var gt=Pe[$e[0]]-xe[$e[0]],Wt=Pe[$e[1]]-xe[$e[1]];return Math.sqrt(gt*gt+Wt*Wt)}function kt(xe,Pe,$e){$e||($e=ci);var gt=Pe[$e[0]]-xe[$e[0]],Wt=Pe[$e[1]]-xe[$e[1]];return Math.atan2(Wt,gt)*180/Math.PI}function $t(xe,Pe){return kt(Pe[1],Pe[0],Yn)+kt(xe[1],xe[0],Yn)}function lr(xe,Pe){return Me(Pe[0],Pe[1],Yn)/Me(xe[0],xe[1],Yn)}var Ye={mousedown:er,mousemove:Kt,mouseup:Nt},Rt="mousedown",Ae="mousemove mouseup";function Gt(){this.evEl=Rt,this.evWin=Ae,this.pressed=!1,mn.apply(this,arguments)}H(Gt,mn,{handler:function(Pe){var $e=Ye[Pe.type];$e&er&&Pe.button===0&&(this.pressed=!0),$e&Kt&&Pe.which!==1&&($e=Nt),this.pressed&&($e&Nt&&(this.pressed=!1),this.callback(this.manager,$e,{pointers:[Pe],changedPointers:[Pe],pointerType:St,srcEvent:Pe}))}});var Tt={pointerdown:er,pointermove:Kt,pointerup:Nt,pointercancel:Ar,pointerout:Ar},j={2:ut,3:vt,4:St,5:st},bt="pointerdown",Bt="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(bt="MSPointerDown",Bt="MSPointerMove MSPointerUp MSPointerCancel");function Ce(){this.evEl=bt,this.evWin=Bt,mn.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}H(Ce,mn,{handler:function(Pe){var $e=this.store,gt=!1,Wt=Pe.type.toLowerCase().replace("ms",""),vr=Tt[Wt],Ir=j[Pe.pointerType]||Pe.pointerType,fi=Ir==ut,Li=pe($e,Pe.pointerId,"pointerId");vr&er&&(Pe.button===0||fi)?Li<0&&($e.push(Pe),Li=$e.length-1):vr&(Nt|Ar)&&(gt=!0),!(Li<0)&&($e[Li]=Pe,this.callback(this.manager,vr,{pointers:$e,changedPointers:[Pe],pointerType:Ir,srcEvent:Pe}),gt&&$e.splice(Li,1))}});var Je={touchstart:er,touchmove:Kt,touchend:Nt,touchcancel:Ar},lt="touchstart",Y="touchstart touchmove touchend touchcancel";function ne(){this.evTarget=lt,this.evWin=Y,this.started=!1,mn.apply(this,arguments)}H(ne,mn,{handler:function(Pe){var $e=Je[Pe.type];if($e===er&&(this.started=!0),!!this.started){var gt=le.call(this,Pe,$e);$e&(Nt|Ar)&&gt[0].length-gt[1].length===0&&(this.started=!1),this.callback(this.manager,$e,{pointers:gt[0],changedPointers:gt[1],pointerType:ut,srcEvent:Pe})}}});function le(xe,Pe){var $e=W(xe.touches),gt=W(xe.changedTouches);return Pe&(Nt|Ar)&&($e=re($e.concat(gt),"identifier")),[$e,gt]}var ve={touchstart:er,touchmove:Kt,touchend:Nt,touchcancel:Ar},Oe="touchstart touchmove touchend touchcancel";function he(){this.evTarget=Oe,this.targetIds={},mn.apply(this,arguments)}H(he,mn,{handler:function(Pe){var $e=ve[Pe.type],gt=be.call(this,Pe,$e);gt&&this.callback(this.manager,$e,{pointers:gt[0],changedPointers:gt[1],pointerType:ut,srcEvent:Pe})}});function be(xe,Pe){var $e=W(xe.touches),gt=this.targetIds;if(Pe&(er|Kt)&&$e.length===1)return gt[$e[0].identifier]=!0,[$e,$e];var Wt,vr,Ir=W(xe.changedTouches),fi=[],Li=this.target;if(vr=$e.filter(function(Ji){return Ue(Ji.target,Li)}),Pe===er)for(Wt=0;Wt<vr.length;)gt[vr[Wt].identifier]=!0,Wt++;for(Wt=0;Wt<Ir.length;)gt[Ir[Wt].identifier]&&fi.push(Ir[Wt]),Pe&(Nt|Ar)&&delete gt[Ir[Wt].identifier],Wt++;if(fi.length)return[re(vr.concat(fi),"identifier"),fi]}var ae=2500,Be=25;function g(){mn.apply(this,arguments);var xe=J(this.handler,this);this.touch=new he(this.manager,xe),this.mouse=new Gt(this.manager,xe),this.primaryTouch=null,this.lastTouches=[]}H(g,mn,{handler:function(Pe,$e,gt){var Wt=gt.pointerType==ut,vr=gt.pointerType==St;if(!(vr&&gt.sourceCapabilities&&gt.sourceCapabilities.firesTouchEvents)){if(Wt)ce.call(this,$e,gt);else if(vr&&Ke.call(this,gt))return;this.callback(Pe,$e,gt)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function ce(xe,Pe){xe&er?(this.primaryTouch=Pe.changedPointers[0].identifier,xt.call(this,Pe)):xe&(Nt|Ar)&&xt.call(this,Pe)}function xt(xe){var Pe=xe.changedPointers[0];if(Pe.identifier===this.primaryTouch){var $e={x:Pe.clientX,y:Pe.clientY};this.lastTouches.push($e);var gt=this.lastTouches,Wt=function(){var vr=gt.indexOf($e);vr>-1&&gt.splice(vr,1)};setTimeout(Wt,ae)}}function Ke(xe){for(var Pe=xe.srcEvent.clientX,$e=xe.srcEvent.clientY,gt=0;gt<this.lastTouches.length;gt++){var Wt=this.lastTouches[gt],vr=Math.abs(Pe-Wt.x),Ir=Math.abs($e-Wt.y);if(vr<=Be&&Ir<=Be)return!0}return!1}var Et=Ee(o.style,"touchAction"),Pt=Et!==i,Ot="compute",ht="auto",Lt="manipulation",Mt="none",Ht="pan-x",Ur="pan-y",Qt=Wr();function en(xe,Pe){this.manager=xe,this.set(Pe)}en.prototype={set:function(xe){xe==Ot&&(xe=this.compute()),Pt&&this.manager.element.style&&Qt[xe]&&(this.manager.element.style[Et]=xe),this.actions=xe.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var xe=[];return F(this.manager.recognizers,function(Pe){ue(Pe.options.enable,[Pe])&&(xe=xe.concat(Pe.getTouchAction()))}),cn(xe.join(" "))},preventDefaults:function(xe){var Pe=xe.srcEvent,$e=xe.offsetDirection;if(this.manager.session.prevented){Pe.preventDefault();return}var gt=this.actions,Wt=de(gt,Mt)&&!Qt[Mt],vr=de(gt,Ur)&&!Qt[Ur],Ir=de(gt,Ht)&&!Qt[Ht];if(Wt){var fi=xe.pointers.length===1,Li=xe.distance<2,Ji=xe.deltaTime<250;if(fi&&Li&&Ji)return}if(!(Ir&&vr)&&(Wt||vr&&$e&yr||Ir&&$e&un))return this.preventSrc(Pe)},preventSrc:function(xe){this.manager.session.prevented=!0,xe.preventDefault()}};function cn(xe){if(de(xe,Mt))return Mt;var Pe=de(xe,Ht),$e=de(xe,Ur);return Pe&&$e?Mt:Pe||$e?Pe?Ht:Ur:de(xe,Lt)?Lt:ht}function Wr(){if(!Pt)return!1;var xe={},Pe=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function($e){xe[$e]=Pe?e.CSS.supports("touch-action",$e):!0}),xe}var Jr=1,Vr=2,yi=4,Xr=8,pr=Xr,Ie=16,Xt=32;function tn(xe){this.options=U({},this.defaults,xe||{}),this.id=_e(),this.manager=null,this.options.enable=q(this.options.enable,!0),this.state=Jr,this.simultaneous={},this.requireFail=[]}tn.prototype={defaults:{},set:function(xe){return U(this.options,xe),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(xe){if(S(xe,"recognizeWith",this))return this;var Pe=this.simultaneous;return xe=li(xe,this),Pe[xe.id]||(Pe[xe.id]=xe,xe.recognizeWith(this)),this},dropRecognizeWith:function(xe){return S(xe,"dropRecognizeWith",this)?this:(xe=li(xe,this),delete this.simultaneous[xe.id],this)},requireFailure:function(xe){if(S(xe,"requireFailure",this))return this;var Pe=this.requireFail;return xe=li(xe,this),pe(Pe,xe)===-1&&(Pe.push(xe),xe.requireFailure(this)),this},dropRequireFailure:function(xe){if(S(xe,"dropRequireFailure",this))return this;xe=li(xe,this);var Pe=pe(this.requireFail,xe);return Pe>-1&&this.requireFail.splice(Pe,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(xe){return!!this.simultaneous[xe.id]},emit:function(xe){var Pe=this,$e=this.state;function gt(Wt){Pe.manager.emit(Wt,xe)}$e<Xr&&gt(Pe.options.event+$i($e)),gt(Pe.options.event),xe.additionalEvent&&gt(xe.additionalEvent),$e>=Xr&&gt(Pe.options.event+$i($e))},tryEmit:function(xe){if(this.canEmit())return this.emit(xe);this.state=Xt},canEmit:function(){for(var xe=0;xe<this.requireFail.length;){if(!(this.requireFail[xe].state&(Xt|Jr)))return!1;xe++}return!0},recognize:function(xe){var Pe=U({},xe);if(!ue(this.options.enable,[this,Pe])){this.reset(),this.state=Xt;return}this.state&(pr|Ie|Xt)&&(this.state=Jr),this.state=this.process(Pe),this.state&(Vr|yi|Xr|Ie)&&this.tryEmit(Pe)},process:function(xe){},getTouchAction:function(){},reset:function(){}};function $i(xe){return xe&Ie?"cancel":xe&Xr?"end":xe&yi?"move":xe&Vr?"start":""}function ya(xe){return xe==_r?"down":xe==Vn?"up":xe==Pr?"left":xe==xr?"right":""}function li(xe,Pe){var $e=Pe.manager;return $e?$e.get(xe):xe}function jn(){tn.apply(this,arguments)}H(jn,tn,{defaults:{pointers:1},attrTest:function(xe){var Pe=this.options.pointers;return Pe===0||xe.pointers.length===Pe},process:function(xe){var Pe=this.state,$e=xe.eventType,gt=Pe&(Vr|yi),Wt=this.attrTest(xe);return gt&&($e&Ar||!Wt)?Pe|Ie:gt||Wt?$e&Nt?Pe|Xr:Pe&Vr?Pe|yi:Vr:Xt}});function Se(){jn.apply(this,arguments),this.pX=null,this.pY=null}H(Se,jn,{defaults:{event:"pan",threshold:10,pointers:1,direction:Dr},getTouchAction:function(){var xe=this.options.direction,Pe=[];return xe&yr&&Pe.push(Ur),xe&un&&Pe.push(Ht),Pe},directionTest:function(xe){var Pe=this.options,$e=!0,gt=xe.distance,Wt=xe.direction,vr=xe.deltaX,Ir=xe.deltaY;return Wt&Pe.direction||(Pe.direction&yr?(Wt=vr===0?ln:vr<0?Pr:xr,$e=vr!=this.pX,gt=Math.abs(xe.deltaX)):(Wt=Ir===0?ln:Ir<0?Vn:_r,$e=Ir!=this.pY,gt=Math.abs(xe.deltaY))),xe.direction=Wt,$e&&gt>Pe.threshold&&Wt&Pe.direction},attrTest:function(xe){return jn.prototype.attrTest.call(this,xe)&&(this.state&Vr||!(this.state&Vr)&&this.directionTest(xe))},emit:function(xe){this.pX=xe.deltaX,this.pY=xe.deltaY;var Pe=ya(xe.direction);Pe&&(xe.additionalEvent=this.options.event+Pe),this._super.emit.call(this,xe)}});function $o(){jn.apply(this,arguments)}H($o,jn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Mt]},attrTest:function(xe){return this._super.attrTest.call(this,xe)&&(Math.abs(xe.scale-1)>this.options.threshold||this.state&Vr)},emit:function(xe){if(xe.scale!==1){var Pe=xe.scale<1?"in":"out";xe.additionalEvent=this.options.event+Pe}this._super.emit.call(this,xe)}});function $n(){tn.apply(this,arguments),this._timer=null,this._input=null}H($n,tn,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ht]},process:function(xe){var Pe=this.options,$e=xe.pointers.length===Pe.pointers,gt=xe.distance<Pe.threshold,Wt=xe.deltaTime>Pe.time;if(this._input=xe,!gt||!$e||xe.eventType&(Nt|Ar)&&!Wt)this.reset();else if(xe.eventType&er)this.reset(),this._timer=w(function(){this.state=pr,this.tryEmit()},Pe.time,this);else if(xe.eventType&Nt)return pr;return Xt},reset:function(){clearTimeout(this._timer)},emit:function(xe){this.state===pr&&(xe&&xe.eventType&Nt?this.manager.emit(this.options.event+"up",xe):(this._input.timeStamp=v(),this.manager.emit(this.options.event,this._input)))}});function Wo(){jn.apply(this,arguments)}H(Wo,jn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Mt]},attrTest:function(xe){return this._super.attrTest.call(this,xe)&&(Math.abs(xe.rotation)>this.options.threshold||this.state&Vr)}});function Oi(){jn.apply(this,arguments)}H(Oi,jn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:yr|un,pointers:1},getTouchAction:function(){return Se.prototype.getTouchAction.call(this)},attrTest:function(xe){var Pe=this.options.direction,$e;return Pe&(yr|un)?$e=xe.overallVelocity:Pe&yr?$e=xe.overallVelocityX:Pe&un&&($e=xe.overallVelocityY),this._super.attrTest.call(this,xe)&&Pe&xe.offsetDirection&&xe.distance>this.options.threshold&&xe.maxPointers==this.options.pointers&&A($e)>this.options.velocity&&xe.eventType&Nt},emit:function(xe){var Pe=ya(xe.offsetDirection);Pe&&this.manager.emit(this.options.event+Pe,xe),this.manager.emit(this.options.event,xe)}});function ui(){tn.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}H(ui,tn,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Lt]},process:function(xe){var Pe=this.options,$e=xe.pointers.length===Pe.pointers,gt=xe.distance<Pe.threshold,Wt=xe.deltaTime<Pe.time;if(this.reset(),xe.eventType&er&&this.count===0)return this.failTimeout();if(gt&&Wt&&$e){if(xe.eventType!=Nt)return this.failTimeout();var vr=this.pTime?xe.timeStamp-this.pTime<Pe.interval:!0,Ir=!this.pCenter||Me(this.pCenter,xe.center)<Pe.posThreshold;this.pTime=xe.timeStamp,this.pCenter=xe.center,!Ir||!vr?this.count=1:this.count+=1,this._input=xe;var fi=this.count%Pe.taps;if(fi===0)return this.hasRequireFailures()?(this._timer=w(function(){this.state=pr,this.tryEmit()},Pe.interval,this),Vr):pr}return Xt},failTimeout:function(){return this._timer=w(function(){this.state=Xt},this.options.interval,this),Xt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==pr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Ii(xe,Pe){return Pe=Pe||{},Pe.recognizers=q(Pe.recognizers,Ii.defaults.preset),new Wi(xe,Pe)}Ii.VERSION="2.0.7",Ii.defaults={domEvents:!1,touchAction:Ot,enable:!0,inputTarget:null,inputClass:null,preset:[[Wo,{enable:!1}],[$o,{enable:!1},["rotate"]],[Oi,{direction:yr}],[Se,{direction:yr},["swipe"]],[ui],[ui,{event:"doubletap",taps:2},["tap"]],[$n]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Rn=1,ms=2;function Wi(xe,Pe){this.options=U({},Ii.defaults,Pe||{}),this.options.inputTarget=this.options.inputTarget||xe,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=xe,this.input=ti(this),this.touchAction=new en(this,this.options.touchAction),Ns(this,!0),F(this.options.recognizers,function($e){var gt=this.add(new $e[0]($e[1]));$e[2]&&gt.recognizeWith($e[2]),$e[3]&&gt.requireFailure($e[3])},this)}Wi.prototype={set:function(xe){return U(this.options,xe),xe.touchAction&&this.touchAction.update(),xe.inputTarget&&(this.input.destroy(),this.input.target=xe.inputTarget,this.input.init()),this},stop:function(xe){this.session.stopped=xe?ms:Rn},recognize:function(xe){var Pe=this.session;if(!Pe.stopped){this.touchAction.preventDefaults(xe);var $e,gt=this.recognizers,Wt=Pe.curRecognizer;(!Wt||Wt&&Wt.state&pr)&&(Wt=Pe.curRecognizer=null);for(var vr=0;vr<gt.length;)$e=gt[vr],Pe.stopped!==ms&&(!Wt||$e==Wt||$e.canRecognizeWith(Wt))?$e.recognize(xe):$e.reset(),!Wt&&$e.state&(Vr|yi|Xr)&&(Wt=Pe.curRecognizer=$e),vr++}},get:function(xe){if(xe instanceof tn)return xe;for(var Pe=this.recognizers,$e=0;$e<Pe.length;$e++)if(Pe[$e].options.event==xe)return Pe[$e];return null},add:function(xe){if(S(xe,"add",this))return this;var Pe=this.get(xe.options.event);return Pe&&this.remove(Pe),this.recognizers.push(xe),xe.manager=this,this.touchAction.update(),xe},remove:function(xe){if(S(xe,"remove",this))return this;if(xe=this.get(xe),xe){var Pe=this.recognizers,$e=pe(Pe,xe);$e!==-1&&(Pe.splice($e,1),this.touchAction.update())}return this},on:function(xe,Pe){if(xe!==i&&Pe!==i){var $e=this.handlers;return F(me(xe),function(gt){$e[gt]=$e[gt]||[],$e[gt].push(Pe)}),this}},off:function(xe,Pe){if(xe!==i){var $e=this.handlers;return F(me(xe),function(gt){Pe?$e[gt]&&$e[gt].splice(pe($e[gt],Pe),1):delete $e[gt]}),this}},emit:function(xe,Pe){this.options.domEvents&&Sn(xe,Pe);var $e=this.handlers[xe]&&this.handlers[xe].slice();if(!(!$e||!$e.length)){Pe.type=xe,Pe.preventDefault=function(){Pe.srcEvent.preventDefault()};for(var gt=0;gt<$e.length;)$e[gt](Pe),gt++}},destroy:function(){this.element&&Ns(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Ns(xe,Pe){var $e=xe.element;if($e.style){var gt;F(xe.options.cssProps,function(Wt,vr){gt=Ee($e.style,vr),Pe?(xe.oldCssProps[gt]=$e.style[gt],$e.style[gt]=Wt):$e.style[gt]=xe.oldCssProps[gt]||""}),Pe||(xe.oldCssProps={})}}function Sn(xe,Pe){var $e=t.createEvent("Event");$e.initEvent(xe,!0,!0),$e.gesture=Pe,Pe.target.dispatchEvent($e)}U(Ii,{INPUT_START:er,INPUT_MOVE:Kt,INPUT_END:Nt,INPUT_CANCEL:Ar,STATE_POSSIBLE:Jr,STATE_BEGAN:Vr,STATE_CHANGED:yi,STATE_ENDED:Xr,STATE_RECOGNIZED:pr,STATE_CANCELLED:Ie,STATE_FAILED:Xt,DIRECTION_NONE:ln,DIRECTION_LEFT:Pr,DIRECTION_RIGHT:xr,DIRECTION_UP:Vn,DIRECTION_DOWN:_r,DIRECTION_HORIZONTAL:yr,DIRECTION_VERTICAL:un,DIRECTION_ALL:Dr,Manager:Wi,Input:mn,TouchAction:en,TouchInput:he,MouseInput:Gt,PointerEventInput:Ce,TouchMouseInput:g,SingleTouchInput:ne,Recognizer:tn,AttrRecognizer:jn,Tap:ui,Pan:Se,Swipe:Oi,Pinch:$o,Rotate:Wo,Press:$n,on:se,off:Te,each:F,merge:G,extend:$,assign:U,inherit:H,bindFn:J,prefixed:Ee});var yl=typeof e<"u"?e:typeof self<"u"?self:{};yl.Hammer=Ii,r.exports?r.exports=Ii:e[n]=Ii})(window,document,"Hammer")}(kb)),kb.exports}var Hg=hoe();const doe=_h(Hg),tl=x5({__proto__:null,default:doe},[Hg]),i6=1,s6=2,nx=4,poe={mousedown:i6,mousemove:s6,mouseup:nx};function Aoe(r,e){for(let t=0;t<r.length;t++)if(e(r[t]))return!0;return!1}function goe(r){const e=r.prototype.handler;r.prototype.handler=function(n){const i=this.store;n.button>0&&n.type==="pointerdown"&&(Aoe(i,s=>s.pointerId===n.pointerId)||i.push(n)),e.call(this,n)}}function moe(r){r.prototype.handler=function(t){let n=poe[t.type];n&i6&&t.button>=0&&(this.pressed=!0),n&s6&&t.buttons===0&&(n=nx),this.pressed&&(n&nx&&(this.pressed=!1),this.callback(this.manager,n,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}goe(Hg.PointerEventInput);moe(Hg.MouseInput);const _oe=Hg.Manager;class Ey{constructor(e,t,n){this.element=e,this.callback=t,this.options={enable:!0,...n}}}const yoe=tl?[[tl.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[tl.Rotate,{enable:!1}],[tl.Pinch,{enable:!1}],[tl.Swipe,{enable:!1}],[tl.Pan,{threshold:0,enable:!1}],[tl.Press,{enable:!1}],[tl.Tap,{event:"doubletap",taps:2,enable:!1}],[tl.Tap,{event:"anytap",enable:!1}],[tl.Tap,{enable:!1}]]:null,QI={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},voe={doubletap:["tap"]},boe={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},iC={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},xoe={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},eM={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},woe=typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.toLowerCase():"",fp=typeof window<"u"?window:global;let ix=!1;try{const r={get passive(){return ix=!0,!0}};fp.addEventListener("test",null,r),fp.removeEventListener("test",null)}catch{ix=!1}const Coe=woe.indexOf("firefox")!==-1,{WHEEL_EVENTS:Toe}=iC,tM="wheel",rM=4.000244140625,Eoe=40,Boe=.25;class Soe extends Ey{constructor(e,t,n){super(e,t,n),this.handleEvent=i=>{if(!this.options.enable)return;let s=i.deltaY;fp.WheelEvent&&(Coe&&i.deltaMode===fp.WheelEvent.DOM_DELTA_PIXEL&&(s/=fp.devicePixelRatio),i.deltaMode===fp.WheelEvent.DOM_DELTA_LINE&&(s*=Eoe)),s!==0&&s%rM===0&&(s=Math.floor(s/rM)),i.shiftKey&&s&&(s=s*Boe),this.callback({type:tM,center:{x:i.clientX,y:i.clientY},delta:-s,srcEvent:i,pointerType:"mouse",target:i.target})},this.events=(this.options.events||[]).concat(Toe),this.events.forEach(i=>e.addEventListener(i,this.handleEvent,ix?{passive:!1}:!1))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===tM&&(this.options.enable=t)}}const{MOUSE_EVENTS:Ioe}=iC,nM="pointermove",iM="pointerover",sM="pointerout",oM="pointerenter",aM="pointerleave";class Moe extends Ey{constructor(e,t,n){super(e,t,n),this.handleEvent=s=>{this.handleOverEvent(s),this.handleOutEvent(s),this.handleEnterEvent(s),this.handleLeaveEvent(s),this.handleMoveEvent(s)},this.pressed=!1;const{enable:i}=this.options;this.enableMoveEvent=i,this.enableLeaveEvent=i,this.enableEnterEvent=i,this.enableOutEvent=i,this.enableOverEvent=i,this.events=(this.options.events||[]).concat(Ioe),this.events.forEach(s=>e.addEventListener(s,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===nM&&(this.enableMoveEvent=t),e===iM&&(this.enableOverEvent=t),e===sM&&(this.enableOutEvent=t),e===oM&&(this.enableEnterEvent=t),e===aM&&(this.enableLeaveEvent=t)}handleOverEvent(e){this.enableOverEvent&&e.type==="mouseover"&&this._emit(iM,e)}handleOutEvent(e){this.enableOutEvent&&e.type==="mouseout"&&this._emit(sM,e)}handleEnterEvent(e){this.enableEnterEvent&&e.type==="mouseenter"&&this._emit(oM,e)}handleLeaveEvent(e){this.enableLeaveEvent&&e.type==="mouseleave"&&this._emit(aM,e)}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":e.buttons===0&&(this.pressed=!1),this.pressed||this._emit(nM,e);break;case"mouseup":this.pressed=!1;break}}_emit(e,t){this.callback({type:e,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})}}const{KEY_EVENTS:Poe}=iC,cM="keydown",lM="keyup";class Roe extends Ey{constructor(e,t,n){super(e,t,n),this.handleEvent=i=>{const s=i.target||i.srcElement;s.tagName==="INPUT"&&s.type==="text"||s.tagName==="TEXTAREA"||(this.enableDownEvent&&i.type==="keydown"&&this.callback({type:cM,srcEvent:i,key:i.key,target:i.target}),this.enableUpEvent&&i.type==="keyup"&&this.callback({type:lM,srcEvent:i,key:i.key,target:i.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=(this.options.events||[]).concat(Poe),e.tabIndex=this.options.tabIndex||0,e.style.outline="none",this.events.forEach(i=>e.addEventListener(i,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===cM&&(this.enableDownEvent=t),e===lM&&(this.enableUpEvent=t)}}const uM="contextmenu";class Foe extends Ey{constructor(e,t,n){super(e,t,n),this.handleEvent=i=>{this.options.enable&&this.callback({type:uM,center:{x:i.clientX,y:i.clientY},srcEvent:i,pointerType:"mouse",target:i.target})},e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,t){e===uM&&(this.options.enable=t)}}const fM=1,sx=2,hM=4,Doe={pointerdown:fM,pointermove:sx,pointerup:hM,mousedown:fM,mousemove:sx,mouseup:hM},Ooe=0,Loe=1,koe=2,Noe=1,Uoe=2,zoe=4;function Goe(r){const e=Doe[r.srcEvent.type];if(!e)return null;const{buttons:t,button:n}=r.srcEvent;let i=!1,s=!1,o=!1;return e===sx?(i=!!(t&Noe),s=!!(t&zoe),o=!!(t&Uoe)):(i=n===Ooe,s=n===Loe,o=n===koe),{leftButton:i,middleButton:s,rightButton:o}}function Voe(r,e){const t=r.center;if(!t)return null;const n=e.getBoundingClientRect(),i=n.width/e.offsetWidth||1,s=n.height/e.offsetHeight||1,o={x:(t.x-n.left-e.clientLeft)/i,y:(t.y-n.top-e.clientTop)/s};return{center:t,offsetCenter:o}}const Nb={srcElement:"root",priority:0};class Hoe{constructor(e){this.handleEvent=t=>{if(this.isEmpty())return;const n=this._normalizeEvent(t);let i=t.srcEvent.target;for(;i&&i!==n.rootElement;){if(this._emit(n,i),n.handled)return;i=i.parentNode}this._emit(n,"root")},this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(e,t,n,i=!1,s=!1){const{handlers:o,handlersByElement:c}=this;let f=Nb;typeof n=="string"||n&&n.addEventListener?f={...Nb,srcElement:n}:n&&(f={...Nb,...n});let A=c.get(f.srcElement);A||(A=[],c.set(f.srcElement,A));const v={type:e,handler:t,srcElement:f.srcElement,priority:f.priority};i&&(v.once=!0),s&&(v.passive=!0),o.push(v),this._active=this._active||!v.passive;let w=A.length-1;for(;w>=0&&!(A[w].priority>=v.priority);)w--;A.splice(w+1,0,v)}remove(e,t){const{handlers:n,handlersByElement:i}=this;for(let s=n.length-1;s>=0;s--){const o=n[s];if(o.type===e&&o.handler===t){n.splice(s,1);const c=i.get(o.srcElement);c.splice(c.indexOf(o),1),c.length===0&&i.delete(o.srcElement)}}this._active=n.some(s=>!s.passive)}_emit(e,t){const n=this.handlersByElement.get(t);if(n){let i=!1;const s=()=>{e.handled=!0},o=()=>{e.handled=!0,i=!0},c=[];for(let f=0;f<n.length;f++){const{type:A,handler:v,once:w}=n[f];if(v({...e,type:A,stopPropagation:s,stopImmediatePropagation:o}),w&&c.push(n[f]),i)break}for(let f=0;f<c.length;f++){const{type:A,handler:v}=c[f];this.remove(A,v)}}}_normalizeEvent(e){const t=this.eventManager.getElement();return{...e,...Goe(e),...Voe(e,t),preventDefault:()=>{e.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:t}}}const joe={events:null,recognizers:null,recognizerOptions:{},Manager:_oe,touchAction:"none",tabIndex:0};class $oe{constructor(e=null,t){this._onBasicInput=i=>{const{srcEvent:s}=i,o=boe[s.type];o&&this.manager.emit(o,i)},this._onOtherEvent=i=>{this.manager.emit(i.type,i)},this.options={...joe,...t},this.events=new Map,this.setElement(e);const{events:n}=this.options;n&&this.on(n)}getElement(){return this.element}setElement(e){if(this.element&&this.destroy(),this.element=e,!e)return;const{options:t}=this,n=t.Manager;this.manager=new n(e,{touchAction:t.touchAction,recognizers:t.recognizers||yoe}).on("hammer.input",this._onBasicInput),t.recognizers||Object.keys(QI).forEach(i=>{const s=this.manager.get(i);s&&QI[i].forEach(o=>{s.recognizeWith(o)})});for(const i in t.recognizerOptions){const s=this.manager.get(i);if(s){const o=t.recognizerOptions[i];delete o.enable,s.set(o)}}this.wheelInput=new Soe(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Moe(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Roe(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new Foe(e,this._onOtherEvent,{enable:!1});for(const[i,s]of this.events)s.isEmpty()||(this._toggleRecognizer(s.recognizerName,!0),this.manager.on(i,s.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,t,n){this._addEventHandler(e,t,n,!1)}once(e,t,n){this._addEventHandler(e,t,n,!0)}watch(e,t,n){this._addEventHandler(e,t,n,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(e,t){const{manager:n}=this;if(!n)return;const i=n.get(e);if(i&&i.options.enable!==t){i.set({enable:t});const s=voe[e];s&&!this.options.recognizers&&s.forEach(o=>{const c=n.get(o);t?(c.requireFailure(e),i.dropRequireFailure(o)):c.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}_addEventHandler(e,t,n,i,s){if(typeof e!="string"){n=t;for(const v in e)this._addEventHandler(v,e[v],n,i,s);return}const{manager:o,events:c}=this,f=eM[e]||e;let A=c.get(f);A||(A=new Hoe(this),c.set(f,A),A.recognizerName=xoe[f]||f,o&&o.on(f,A.handleEvent)),A.add(e,t,n,i,s),A.isEmpty()||this._toggleRecognizer(A.recognizerName,!0)}_removeEventHandler(e,t){if(typeof e!="string"){for(const o in e)this._removeEventHandler(o,e[o]);return}const{events:n}=this,i=eM[e]||e,s=n.get(i);if(s&&(s.remove(e,t),s.isEmpty())){const{recognizerName:o}=s;let c=!1;for(const f of n.values())if(f.recognizerName===o&&!f.isEmpty()){c=!0;break}c||this._toggleRecognizer(o,!1)}}}function dM(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Mo(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dM(Object(t),!0).forEach(function(n){Tr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):dM(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Vf={transitionDuration:0},jl={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new ug,transitionInterruption:hg.BREAK},n0=300,i0=function(e){return 1-(1-e)*(1-e)},Fd={WHEEL:["wheel"],PAN:["panstart","panmove","panend"],PINCH:["pinchstart","pinchmove","pinchend"],TRIPLE_PAN:["tripanstart","tripanmove","tripanend"],DOUBLE_TAP:["doubletap"],KEYBOARD:["keydown"]},o6=function(){function r(){var e=this;af(this,r),Tr(this,"events",[]),Tr(this,"scrollZoom",!0),Tr(this,"dragPan",!0),Tr(this,"dragRotate",!0),Tr(this,"doubleClickZoom",!0),Tr(this,"touchZoom",!0),Tr(this,"touchRotate",!1),Tr(this,"keyboard",!0),Tr(this,"_interactionState",{isDragging:!1}),Tr(this,"_events",{}),Tr(this,"_setInteractionState",function(t){Object.assign(e._interactionState,t),e.onStateChange&&e.onStateChange(e._interactionState)}),Tr(this,"_onTransition",function(t,n){e.onViewportChange(t,e._interactionState,n)}),this.handleEvent=this.handleEvent.bind(this),this._transitionManager=new nC({onViewportChange:this._onTransition,onStateChange:this._setInteractionState})}return of(r,[{key:"handleEvent",value:function(t){this.mapState=this.getMapState();var n=this._eventStartBlocked;switch(t.type){case"panstart":return n?!1:this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return n?!1:this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"tripanstart":return n?!1:this._onTriplePanStart(t);case"tripanmove":return this._onTriplePan(t);case"tripanend":return this._onTriplePanEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}},{key:"getCenter",value:function(t){var n=t.offsetCenter,i=n.x,s=n.y;return[i,s]}},{key:"isFunctionKeyPressed",value:function(t){var n=t.srcEvent;return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}},{key:"blockEvents",value:function(t){var n=this,i=setTimeout(function(){n._eventStartBlocked===i&&(n._eventStartBlocked=null)},t);this._eventStartBlocked=i}},{key:"updateViewport",value:function(t,n,i){var s=this.mapState instanceof wp?this.mapState.getViewportProps():this.mapState,o=Mo(Mo({},t.getViewportProps()),n),c=Object.keys(o).some(function(f){return s[f]!==o[f]});this._state=t.getState(),this._setInteractionState(i),c&&this.onViewportChange(o,this._interactionState,s)}},{key:"getMapState",value:function(t){return new wp(Mo(Mo(Mo({},this.mapStateProps),this._state),t))}},{key:"isDragging",value:function(){return this._interactionState.isDragging}},{key:"setOptions",value:function(t){var n=t.onViewportChange,i=t.onStateChange,s=t.eventManager,o=s===void 0?this.eventManager:s,c=t.isInteractive,f=c===void 0?!0:c,A=t.scrollZoom,v=A===void 0?this.scrollZoom:A,w=t.dragPan,S=w===void 0?this.dragPan:w,F=t.dragRotate,N=F===void 0?this.dragRotate:F,U=t.doubleClickZoom,$=U===void 0?this.doubleClickZoom:U,G=t.touchZoom,H=G===void 0?this.touchZoom:G,J=t.touchRotate,ue=J===void 0?this.touchRotate:J,q=t.keyboard,se=q===void 0?this.keyboard:q;this.onViewportChange=n,this.onStateChange=i;var Te=this.mapStateProps||{},Ue=Te.height!==t.height||Te.width!==t.width;this.mapStateProps=t,Ue&&(this.mapState=Te,this.updateViewport(new wp(t))),this._transitionManager.processViewportChange(t),this.eventManager!==o&&(this.eventManager=o,this._events={},this.toggleEvents(this.events,!0)),this.toggleEvents(Fd.WHEEL,f&&!!v),this.toggleEvents(Fd.PAN,f&&!!(S||N)),this.toggleEvents(Fd.PINCH,f&&!!(H||ue)),this.toggleEvents(Fd.TRIPLE_PAN,f&&!!ue),this.toggleEvents(Fd.DOUBLE_TAP,f&&!!$),this.toggleEvents(Fd.KEYBOARD,f&&!!se),this.scrollZoom=v,this.dragPan=S,this.dragRotate=N,this.doubleClickZoom=$,this.touchZoom=H,this.touchRotate=ue,this.keyboard=se}},{key:"toggleEvents",value:function(t,n){var i=this;this.eventManager&&t.forEach(function(s){i._events[s]!==n&&(i._events[s]=n,n?i.eventManager.on(s,i.handleEvent):i.eventManager.off(s,i.handleEvent))})}},{key:"_onPanStart",value:function(t){var n=this.getCenter(t);this._panRotate=this.isFunctionKeyPressed(t)||t.rightButton;var i=this._panRotate?this.mapState.rotateStart({pos:n}):this.mapState.panStart({pos:n});return this.updateViewport(i,Vf,{isDragging:!0}),!0}},{key:"_onPan",value:function(t){return this.isDragging()?this._panRotate?this._onPanRotate(t):this._onPanMove(t):!1}},{key:"_onPanEnd",value:function(t){return this.isDragging()?this._panRotate?this._onPanRotateEnd(t):this._onPanMoveEnd(t):!1}},{key:"_onPanMove",value:function(t){if(!this.dragPan)return!1;var n=this.getCenter(t),i=this.mapState.pan({pos:n});return this.updateViewport(i,Vf,{isPanning:!0}),!0}},{key:"_onPanMoveEnd",value:function(t){if(this.dragPan){var n=this.dragPan.inertia,i=n===void 0?n0:n;if(i&&t.velocity){var s=this.getCenter(t),o=[s[0]+t.velocityX*i/2,s[1]+t.velocityY*i/2],c=this.mapState.pan({pos:o}).panEnd();return this.updateViewport(c,Mo(Mo({},jl),{},{transitionDuration:i,transitionEasing:i0}),{isDragging:!1,isPanning:!0}),!0}}var f=this.mapState.panEnd();return this.updateViewport(f,null,{isDragging:!1,isPanning:!1}),!0}},{key:"_onPanRotate",value:function(t){if(!this.dragRotate)return!1;var n=this.getCenter(t),i=this.mapState.rotate({pos:n});return this.updateViewport(i,Vf,{isRotating:!0}),!0}},{key:"_onPanRotateEnd",value:function(t){if(this.dragRotate){var n=this.dragRotate.inertia,i=n===void 0?n0:n;if(i&&t.velocity){var s=this.getCenter(t),o=[s[0]+t.velocityX*i/2,s[1]+t.velocityY*i/2],c=this.mapState.rotate({pos:o}).rotateEnd();return this.updateViewport(c,Mo(Mo({},jl),{},{transitionDuration:i,transitionEasing:i0}),{isDragging:!1,isRotating:!0}),!0}}var f=this.mapState.panEnd();return this.updateViewport(f,null,{isDragging:!1,isRotating:!1}),!0}},{key:"_onWheel",value:function(t){if(!this.scrollZoom)return!1;var n=this.scrollZoom,i=n.speed,s=i===void 0?.01:i,o=n.smooth,c=o===void 0?!1:o;t.preventDefault();var f=this.getCenter(t),A=t.delta,v=2/(1+Math.exp(-Math.abs(A*s)));A<0&&v!==0&&(v=1/v);var w=this.mapState.zoom({pos:f,scale:v});return w.getViewportProps().zoom===this.mapStateProps.zoom?!1:(this.updateViewport(w,Mo(Mo({},jl),{},{transitionInterpolator:new ug({around:f}),transitionDuration:c?250:1}),{isPanning:!0,isZooming:!0}),!0)}},{key:"_onPinchStart",value:function(t){var n=this.getCenter(t),i=this.mapState.zoomStart({pos:n}).rotateStart({pos:n});return this._startPinchRotation=t.rotation,this._lastPinchEvent=t,this.updateViewport(i,Vf,{isDragging:!0}),!0}},{key:"_onPinch",value:function(t){if(!this.isDragging()||!this.touchZoom&&!this.touchRotate)return!1;var n=this.mapState;if(this.touchZoom){var i=t.scale,s=this.getCenter(t);n=n.zoom({pos:s,scale:i})}if(this.touchRotate){var o=t.rotation;n=n.rotate({deltaAngleX:this._startPinchRotation-o})}return this.updateViewport(n,Vf,{isDragging:!0,isPanning:!!this.touchZoom,isZooming:!!this.touchZoom,isRotating:!!this.touchRotate}),this._lastPinchEvent=t,!0}},{key:"_onPinchEnd",value:function(t){if(!this.isDragging())return!1;if(this.touchZoom){var n=this.touchZoom.inertia,i=n===void 0?n0:n,s=this._lastPinchEvent;if(i&&s&&t.scale!==s.scale){var o=this.getCenter(t),c=this.mapState.rotateEnd(),f=Math.log2(t.scale),A=(f-Math.log2(s.scale))/(t.deltaTime-s.deltaTime),v=Math.pow(2,f+A*i/2);return c=c.zoom({pos:o,scale:v}).zoomEnd(),this.updateViewport(c,Mo(Mo({},jl),{},{transitionInterpolator:new ug({around:o}),transitionDuration:i,transitionEasing:i0}),{isDragging:!1,isPanning:!!this.touchZoom,isZooming:!!this.touchZoom,isRotating:!1}),this.blockEvents(i),!0}}var w=this.mapState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(w,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),this._startPinchRotation=null,this._lastPinchEvent=null,!0}},{key:"_onTriplePanStart",value:function(t){var n=this.getCenter(t),i=this.mapState.rotateStart({pos:n});return this.updateViewport(i,Vf,{isDragging:!0}),!0}},{key:"_onTriplePan",value:function(t){if(!this.isDragging()||!this.touchRotate)return!1;var n=this.getCenter(t);n[0]-=t.deltaX;var i=this.mapState.rotate({pos:n});return this.updateViewport(i,Vf,{isRotating:!0}),!0}},{key:"_onTriplePanEnd",value:function(t){if(!this.isDragging())return!1;if(this.touchRotate){var n=this.touchRotate.inertia,i=n===void 0?n0:n;if(i&&t.velocityY){var s=this.getCenter(t),o=[s[0],s[1]+=t.velocityY*i/2],c=this.mapState.rotate({pos:o});return this.updateViewport(c,Mo(Mo({},jl),{},{transitionDuration:i,transitionEasing:i0}),{isDragging:!1,isRotating:!0}),this.blockEvents(i),!1}}var f=this.mapState.rotateEnd();return this.updateViewport(f,null,{isDragging:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(t){if(!this.doubleClickZoom)return!1;var n=this.getCenter(t),i=this.isFunctionKeyPressed(t),s=this.mapState.zoom({pos:n,scale:i?.5:2});return this.updateViewport(s,Object.assign({},jl,{transitionInterpolator:new ug({around:n})}),{isZooming:!0}),!0}},{key:"_onKeyDown",value:function(t){if(!this.keyboard)return!1;var n=this.isFunctionKeyPressed(t),i=this.keyboard,s=i.zoomSpeed,o=s===void 0?2:s,c=i.moveSpeed,f=c===void 0?100:c,A=i.rotateSpeedX,v=A===void 0?15:A,w=i.rotateSpeedY,S=w===void 0?10:w,F=this.mapStateProps,N;switch(t.srcEvent.keyCode){case 189:n?N=this.getMapState({zoom:F.zoom-Math.log2(o)-1}):N=this.getMapState({zoom:F.zoom-Math.log2(o)});break;case 187:n?N=this.getMapState({zoom:F.zoom+Math.log2(o)+1}):N=this.getMapState({zoom:F.zoom+Math.log2(o)});break;case 37:n?N=this.getMapState({bearing:F.bearing-v}):N=this.mapState.pan({pos:[f,0],startPos:[0,0]});break;case 39:n?N=this.getMapState({bearing:F.bearing+v}):N=this.mapState.pan({pos:[-f,0],startPos:[0,0]});break;case 38:n?N=this.getMapState({pitch:F.pitch+S}):N=this.mapState.pan({pos:[0,f],startPos:[0,0]});break;case 40:n?N=this.getMapState({pitch:F.pitch-S}):N=this.mapState.pan({pos:[0,-f],startPos:[0,0]});break;default:return!1}return this.updateViewport(N,jl)}}]),r}();function pM(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Vl(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pM(Object(t),!0).forEach(function(n){Tr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):pM(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Woe=Object.assign({},nu.propTypes,{maxZoom:At.number,minZoom:At.number,maxPitch:At.number,minPitch:At.number,onViewStateChange:At.func,onViewportChange:At.func,onInteractionStateChange:At.func,transitionDuration:At.oneOfType([At.number,At.string]),transitionInterpolator:At.object,transitionInterruption:At.number,transitionEasing:At.func,onTransitionStart:At.func,onTransitionInterrupt:At.func,onTransitionEnd:At.func,scrollZoom:At.oneOfType([At.bool,At.object]),dragPan:At.oneOfType([At.bool,At.object]),dragRotate:At.oneOfType([At.bool,At.object]),doubleClickZoom:At.bool,touchZoom:At.oneOfType([At.bool,At.object]),touchRotate:At.oneOfType([At.bool,At.object]),keyboard:At.oneOfType([At.bool,At.object]),onHover:At.func,onClick:At.func,onDblClick:At.func,onContextMenu:At.func,onMouseDown:At.func,onMouseMove:At.func,onMouseUp:At.func,onTouchStart:At.func,onTouchMove:At.func,onTouchEnd:At.func,onMouseEnter:At.func,onMouseLeave:At.func,onMouseOut:At.func,onWheel:At.func,touchAction:At.string,eventRecognizerOptions:At.object,clickRadius:At.number,interactiveLayerIds:At.array,getCursor:At.func,controller:At.instanceOf(o6)}),Joe=function(e){var t=e.isDragging,n=e.isHovering;return t?"grabbing":n?"pointer":"grab"},Xoe=Object.assign({},nu.defaultProps,Qf,nC.defaultProps,{onViewStateChange:null,onViewportChange:null,onClick:null,onNativeClick:null,onHover:null,onContextMenu:function(e){return e.preventDefault()},scrollZoom:!0,dragPan:!0,dragRotate:!0,doubleClickZoom:!0,touchZoom:!0,touchRotate:!1,keyboard:!0,touchAction:"none",eventRecognizerOptions:{},clickRadius:0,getCursor:Joe});function sC(r){if(r.lngLat||!r.offsetCenter)return r;var e=r.offsetCenter,t=e.x,n=e.y;if(!Number.isFinite(t)||!Number.isFinite(n))return r;var i=[t,n];return r.point=i,r.lngLat=this.viewport.unproject(i),r}function a6(r){var e=this.map;if(!e||!r)return null;var t={},n=this.props.clickRadius;this.props.interactiveLayerIds&&(t.layers=this.props.interactiveLayerIds);try{return e.queryRenderedFeatures(n?[[r[0]-n,r[1]+n],[r[0]+n,r[1]-n]]:r,t)}catch{return null}}function ql(r,e){var t=this.props[r];t&&t(sC.call(this,e))}function Koe(r){ql.call(this,r.pointerType==="touch"?"onTouchStart":"onMouseDown",r)}function qoe(r){ql.call(this,r.pointerType==="touch"?"onTouchEnd":"onMouseUp",r)}function Yoe(r){if(ql.call(this,r.pointerType==="touch"?"onTouchMove":"onMouseMove",r),!this.state.isDragging){var e=this.props,t=e.onHover,n=e.interactiveLayerIds,i;r=sC.call(this,r),(n||t)&&(i=a6.call(this,r.point));var s=!!(n&&i&&i.length>0),o=s&&!this.state.isHovering,c=!s&&this.state.isHovering;(t||o)&&(r.features=i,t&&t(r)),o&&ql.call(this,"onMouseEnter",r),c&&ql.call(this,"onMouseLeave",r),(o||c)&&this.setState({isHovering:s})}}function AM(r){var e=this.props,t=e.onClick,n=e.onNativeClick,i=e.onDblClick,s=e.doubleClickZoom,o=[],c=i||s;switch(r.type){case"anyclick":o.push(n),c||o.push(t);break;case"click":c&&o.push(t);break}o=o.filter(Boolean),o.length&&(r=sC.call(this,r),r.features=a6.call(this,r.point),o.forEach(function(f){return f(r)}))}function Zoe(r){return{getMap:r.current&&r.current.getMap,queryRenderedFeatures:r.current&&r.current.queryRenderedFeatures}}var oC=It.forwardRef(function(r,e){var t=It.useContext(Th),n=It.useMemo(function(){return r.controller||new o6},[]),i=It.useMemo(function(){return new $oe(null,{touchAction:r.touchAction,recognizerOptions:r.eventRecognizerOptions})},[]),s=It.useRef(null),o=It.useRef(null),c=It.useRef({width:0,height:0,state:{isHovering:!1,isDragging:!1}}),f=c.current;f.props=r,f.map=o.current&&o.current.getMap(),f.setState=function(se){f.state=Vl(Vl({},f.state),se),s.current.style.cursor=r.getCursor(f.state)};var A=!0,v,w,S=function(Te,Ue,de){if(A){v=[Te,Ue,de];return}var me=f.props,pe=me.onViewStateChange,W=me.onViewportChange;pe&&pe({viewState:Te,interactionState:Ue,oldViewState:de}),W&&W(Te,Ue,de)};It.useImperativeHandle(e,function(){return Zoe(o)},[]);var F=It.useMemo(function(){return Vl(Vl({},t),{},{eventManager:i,container:t.container||s.current})},[t,s.current]);F.onViewportChange=S,F.viewport=t.viewport||r6(f),f.viewport=F.viewport;var N=function(Te){var Ue=Te.isDragging,de=Ue===void 0?!1:Ue;if(de!==f.state.isDragging&&f.setState({isDragging:de}),A){w=Te;return}var me=f.props.onInteractionStateChange;me&&me(Te)},U=function(){f.width&&f.height&&n.setOptions(Vl(Vl(Vl({},f.props),f.props.viewState),{},{isInteractive:!!(f.props.onViewStateChange||f.props.onViewportChange),onViewportChange:S,onStateChange:N,eventManager:i,width:f.width,height:f.height}))},$=function(Te){var Ue=Te.width,de=Te.height;f.width=Ue,f.height=de,U(),f.props.onResize({width:Ue,height:de})};It.useEffect(function(){return i.setElement(s.current),i.on({pointerdown:Koe.bind(f),pointermove:Yoe.bind(f),pointerup:qoe.bind(f),pointerleave:ql.bind(f,"onMouseOut"),click:AM.bind(f),anyclick:AM.bind(f),dblclick:ql.bind(f,"onDblClick"),wheel:ql.bind(f,"onWheel"),contextmenu:ql.bind(f,"onContextMenu")}),function(){i.destroy()}},[]),tx(function(){v&&S.apply(void 0,g5(v)),w&&N(w)}),U();var G=r.width,H=r.height,J=r.style,ue=r.getCursor,q=It.useMemo(function(){return Vl(Vl({position:"relative"},J),{},{width:G,height:H,cursor:ue(f.state)})},[J,G,H,ue,f.state]);return(!v||!f._child)&&(f._child=It.createElement(rC,{value:F},It.createElement("div",{key:"event-canvas",ref:s,style:q},It.createElement(nu,$D({},r,{width:"100%",height:"100%",style:null,onResize:$,ref:o}))))),A=!1,f._child});oC.supported=nu.supported;oC.propTypes=Woe;oC.defaultProps=Xoe;At.string.isRequired;var Qoe=["fill","line","symbol","circle","fill-extrusion","raster","background","heatmap","hillshade"];At.oneOf(Qoe).isRequired;var cf={captureScroll:!1,captureDrag:!0,captureClick:!0,captureDoubleClick:!0,capturePointerMove:!1},Ic={captureScroll:At.bool,captureDrag:At.bool,captureClick:At.bool,captureDoubleClick:At.bool,capturePointerMove:At.bool};function eae(r){var e=r.containerRef.current,t=r.context.eventManager;if(!(!e||!t)){var n={wheel:function(s){var o=r.props;o.captureScroll&&s.stopPropagation(),o.onScroll&&o.onScroll(s,r)},panstart:function(s){var o=r.props;o.captureDrag&&s.stopPropagation(),o.onDragStart&&o.onDragStart(s,r)},anyclick:function(s){var o=r.props;o.captureClick&&s.stopPropagation(),o.onNativeClick&&o.onNativeClick(s,r)},click:function(s){var o=r.props;o.captureClick&&s.stopPropagation(),o.onClick&&o.onClick(s,r)},dblclick:function(s){var o=r.props;o.captureDoubleClick&&s.stopPropagation(),o.onDoubleClick&&o.onDoubleClick(s,r)},pointermove:function(s){var o=r.props;o.capturePointerMove&&s.stopPropagation(),o.onPointerMove&&o.onPointerMove(s,r)}};return t.watch(n,e),function(){t.off(n)}}}function lf(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=It.useContext(Th),t=It.useRef(null),n=It.useRef({props:r,state:{},context:e,containerRef:t}),i=n.current;return i.props=r,i.context=e,It.useEffect(function(){return eae(i)},[e.eventManager]),i}function tae(r){var e=rae();return function(){var n=Bp(r),i;if(e){var s=Bp(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return zx(this,i)}}function rae(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function nae(r){var e=r.instance,t=lf(r),n=t.context,i=t.containerRef;return e._context=n,e._containerRef=i,e._render()}var c6=function(r){Ux(t,r);var e=tae(t);function t(){var n;af(this,t);for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),Tr(zu(n),"_context",{}),Tr(zu(n),"_containerRef",It.createRef()),Tr(zu(n),"_onScroll",function(c){}),Tr(zu(n),"_onDragStart",function(c){}),Tr(zu(n),"_onDblClick",function(c){}),Tr(zu(n),"_onClick",function(c){}),Tr(zu(n),"_onPointerMove",function(c){}),n}return of(t,[{key:"_render",value:function(){throw new Error("_render() not implemented")}},{key:"render",value:function(){return It.createElement(nae,$D({instance:this},this.props,{onScroll:this._onScroll,onDragStart:this._onDragStart,onDblClick:this._onDblClick,onClick:this._onClick,onPointerMove:this._onPointerMove}))}}]),t}(It.PureComponent);Tr(c6,"propTypes",Ic);Tr(c6,"defaultProps",cf);function gM(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function mM(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?gM(Object(t),!0).forEach(function(n){Tr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):gM(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var iae=Object.assign({},Ic,{draggable:At.bool,onDrag:At.func,onDragEnd:At.func,onDragStart:At.func,offsetLeft:At.number,offsetTop:At.number}),sae=Object.assign({},cf,{draggable:!1,offsetLeft:0,offsetTop:0});function l6(r){var e=r.offsetCenter,t=e.x,n=e.y;return[t,n]}function oae(r,e){var t=r.center,n=t.x,i=t.y;if(e){var s=e.getBoundingClientRect();return[s.left-n,s.top-i]}return null}function aC(r,e,t,n){var i=r[0]+e[0]-t.offsetLeft,s=r[1]+e[1]-t.offsetTop;return n.viewport.unproject([i,s])}function aae(r,e){var t=e.props,n=e.callbacks,i=e.state,s=e.context,o=e.containerRef,c=t.draggable;if(c){r.stopPropagation();var f=l6(r),A=oae(r,o.current);if(i.setDragPos(f),i.setDragOffset(A),n.onDragStart&&A){var v=Object.assign({},r);v.lngLat=aC(f,A,t,s),n.onDragStart(v)}}}function cae(r,e){var t=e.props,n=e.callbacks,i=e.state,s=e.context;r.stopPropagation();var o=l6(r);i.setDragPos(o);var c=i.dragOffset;if(n.onDrag&&c){var f=Object.assign({},r);f.lngLat=aC(o,c,t,s),n.onDrag(f)}}function lae(r,e){var t=e.props,n=e.callbacks,i=e.state,s=e.context;r.stopPropagation();var o=i.dragPos,c=i.dragOffset;if(i.setDragPos(null),i.setDragOffset(null),n.onDragEnd&&o&&c){var f=Object.assign({},r);f.lngLat=aC(o,c,t,s),n.onDragEnd(f)}}function uae(r,e){var t=e.state;r.stopPropagation(),t.setDragPos(null),t.setDragOffset(null)}function fae(r){var e=r.context.eventManager;if(!(!e||!r.state.dragPos)){var t={panmove:function(i){return cae(i,r)},panend:function(i){return lae(i,r)},pancancel:function(i){return uae(i,r)}};return e.watch(t),function(){e.off(t)}}}function hae(r){var e=It.useState(null),t=gs(e,2),n=t[0],i=t[1],s=It.useState(null),o=gs(s,2),c=o[0],f=o[1],A=lf(mM(mM({},r),{},{onDragStart:aae}));return A.callbacks=r,A.state.dragPos=n,A.state.setDragPos=i,A.state.dragOffset=c,A.state.setDragOffset=f,It.useEffect(function(){return fae(A)},[A.context.eventManager,!!n]),A}var _M=typeof window<"u"&&window.devicePixelRatio||1,Bg=function(e){return Math.round(e*_M)/_M},yM=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"x";if(e===null)return t;var i=n==="x"?e.offsetWidth:e.offsetHeight;return Bg(t/100*i)/i*100};function vM(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function dae(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vM(Object(t),!0).forEach(function(n){Tr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):vM(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var pae=Object.assign({},iae,{className:At.string,longitude:At.number.isRequired,latitude:At.number.isRequired,style:At.object}),Aae=Object.assign({},sae,{className:""});function gae(r){var e=r.props,t=r.state,n=r.context,i=e.longitude,s=e.latitude,o=e.offsetLeft,c=e.offsetTop,f=t.dragPos,A=t.dragOffset;if(f&&A)return[f[0]+A[0],f[1]+A[1]];var v=n.viewport.project([i,s]),w=gs(v,2),S=w[0],F=w[1];return S+=o,F+=c,[S,F]}function cC(r){var e=hae(r),t=e.state,n=e.containerRef,i=r.children,s=r.className,o=r.draggable,c=r.style,f=t.dragPos,A=gae(e),v=gs(A,2),w=v[0],S=v[1],F="translate(".concat(Bg(w),"px, ").concat(Bg(S),"px)"),N=o?f?"grabbing":"grab":"auto",U=It.useMemo(function(){var G=dae({position:"absolute",left:0,top:0,transform:F,cursor:N},c);return It.createElement("div",{className:"mapboxgl-marker ".concat(s),ref:e.containerRef,style:G},i)},[i,s]),$=n.current;return $&&($.style.transform=F,$.style.cursor=N),U}cC.defaultProps=Aae;cC.propTypes=pae;It.memo(cC);var Sg={top:{x:.5,y:0},"top-left":{x:0,y:0},"top-right":{x:1,y:0},bottom:{x:.5,y:1},"bottom-left":{x:0,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5}},mae=Object.keys(Sg);function _ae(r){var e=r.x,t=r.y,n=r.width,i=r.height,s=r.selfWidth,o=r.selfHeight,c=r.anchor,f=r.padding,A=f===void 0?0:f,v=Sg[c],w=v.x,S=v.y,F=t-S*o,N=F+o,U=Math.max(0,A-F)+Math.max(0,N-i+A);if(U>0){var $=S,G=U;for(S=0;S<=1;S+=.5)F=t-S*o,N=F+o,U=Math.max(0,A-F)+Math.max(0,N-i+A),U<G&&(G=U,$=S);S=$}var H=.5;S===.5&&(w=Math.floor(w),H=1);var J=e-w*s,ue=J+s,q=Math.max(0,A-J)+Math.max(0,ue-n+A);if(q>0){var se=w,Te=q;for(w=0;w<=1;w+=H)J=e-w*s,ue=J+s,q=Math.max(0,A-J)+Math.max(0,ue-n+A),q<Te&&(Te=q,se=w);w=se}return mae.find(function(Ue){var de=Sg[Ue];return de.x===w&&de.y===S})||c}var yae=Object.assign({},Ic,{className:At.string,longitude:At.number.isRequired,latitude:At.number.isRequired,altitude:At.number,offsetLeft:At.number,offsetTop:At.number,tipSize:At.number,closeButton:At.bool,closeOnClick:At.bool,anchor:At.oneOf(Object.keys(Sg)),dynamicPosition:At.bool,sortByDepth:At.bool,onClose:At.func}),vae=Object.assign({},cf,{className:"",altitude:0,offsetLeft:0,offsetTop:0,tipSize:10,anchor:"bottom",dynamicPosition:!0,sortByDepth:!1,closeButton:!0,closeOnClick:!0,onClose:function(){}});function bae(r,e,t,n){var i=gs(n,2),s=i[0],o=i[1],c=r.anchor,f=r.dynamicPosition,A=r.tipSize;return t&&f?_ae({x:s,y:o,anchor:c,padding:A,width:e.width,height:e.height,selfWidth:t.clientWidth,selfHeight:t.clientHeight}):c}function xae(r,e,t,n,i){var s=gs(n,3),o=s[0],c=s[1],f=s[2],A=r.offsetLeft,v=r.offsetTop,w=r.sortByDepth,S=Sg[i],F=o+A,N=c+v,U=yM(t,-S.x*100),$=yM(t,-S.y*100,"y"),G={position:"absolute",transform:`
2603
+ `;return function(){var Wt=new Error("get-stack-trace"),vr=Wt&&Wt.stack?Wt.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Ir=e.console&&(e.console.warn||e.console.log);return Ir&&Ir.call(e.console,gt,vr),xe.apply(this,arguments)}}var U;typeof Object.assign!="function"?U=function(Pe){if(Pe===i||Pe===null)throw new TypeError("Cannot convert undefined or null to object");for(var $e=Object(Pe),gt=1;gt<arguments.length;gt++){var Wt=arguments[gt];if(Wt!==i&&Wt!==null)for(var vr in Wt)Wt.hasOwnProperty(vr)&&($e[vr]=Wt[vr])}return $e}:U=Object.assign;var $=N(function(Pe,$e,gt){for(var Wt=Object.keys($e),vr=0;vr<Wt.length;)(!gt||gt&&Pe[Wt[vr]]===i)&&(Pe[Wt[vr]]=$e[Wt[vr]]),vr++;return Pe},"extend","Use `assign`."),G=N(function(Pe,$e){return $(Pe,$e,!0)},"merge","Use `assign`.");function H(xe,Pe,$e){var gt=Pe.prototype,Wt;Wt=xe.prototype=Object.create(gt),Wt.constructor=xe,Wt._super=gt,$e&&U(Wt,$e)}function J(xe,Pe){return function(){return xe.apply(Pe,arguments)}}function ue(xe,Pe){return typeof xe==c?xe.apply(Pe&&Pe[0]||i,Pe):xe}function q(xe,Pe){return xe===i?Pe:xe}function se(xe,Pe,$e){F(me(Pe),function(gt){xe.addEventListener(gt,$e,!1)})}function Te(xe,Pe,$e){F(me(Pe),function(gt){xe.removeEventListener(gt,$e,!1)})}function Ue(xe,Pe){for(;xe;){if(xe==Pe)return!0;xe=xe.parentNode}return!1}function de(xe,Pe){return xe.indexOf(Pe)>-1}function me(xe){return xe.trim().split(/\s+/g)}function pe(xe,Pe,$e){if(xe.indexOf&&!$e)return xe.indexOf(Pe);for(var gt=0;gt<xe.length;){if($e&&xe[gt][$e]==Pe||!$e&&xe[gt]===Pe)return gt;gt++}return-1}function W(xe){return Array.prototype.slice.call(xe,0)}function re(xe,Pe,$e){for(var gt=[],Wt=[],vr=0;vr<xe.length;){var Ir=xe[vr][Pe];pe(Wt,Ir)<0&&gt.push(xe[vr]),Wt[vr]=Ir,vr++}return gt=gt.sort(function(Li,Ji){return Li[Pe]>Ji[Pe]}),gt}function Ee(xe,Pe){for(var $e,gt,Wt=Pe[0].toUpperCase()+Pe.slice(1),vr=0;vr<s.length;){if($e=s[vr],gt=$e?$e+Wt:Pe,gt in xe)return gt;vr++}return i}var et=1;function _e(){return et++}function Le(xe){var Pe=xe.ownerDocument||xe;return Pe.defaultView||Pe.parentWindow||e}var Ge=/mobile|tablet|ip(ad|hone|od)|android/i,Ze="ontouchstart"in e,tt=Ee(e,"PointerEvent")!==i,rt=Ze&&Ge.test(navigator.userAgent),ut="touch",vt="pen",St="mouse",st="kinect",dr=25,er=1,Kt=2,Nt=4,Ar=8,ln=1,Pr=2,xr=4,Vn=8,_r=16,yr=Pr|xr,un=Vn|_r,Dr=yr|un,ci=["x","y"],Yn=["clientX","clientY"];function mn(xe,Pe){var $e=this;this.manager=xe,this.callback=Pe,this.element=xe.element,this.target=xe.options.inputTarget,this.domHandler=function(gt){ue(xe.options.enable,[xe])&&$e.handler(gt)},this.init()}mn.prototype={handler:function(){},init:function(){this.evEl&&se(this.element,this.evEl,this.domHandler),this.evTarget&&se(this.target,this.evTarget,this.domHandler),this.evWin&&se(Le(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Te(this.element,this.evEl,this.domHandler),this.evTarget&&Te(this.target,this.evTarget,this.domHandler),this.evWin&&Te(Le(this.element),this.evWin,this.domHandler)}};function ti(xe){var Pe,$e=xe.options.inputClass;return $e?Pe=$e:tt?Pe=Ce:rt?Pe=he:Ze?Pe=g:Pe=Gt,new Pe(xe,Hn)}function Hn(xe,Pe,$e){var gt=$e.pointers.length,Wt=$e.changedPointers.length,vr=Pe&er&&gt-Wt===0,Ir=Pe&(Nt|Ar)&&gt-Wt===0;$e.isFirst=!!vr,$e.isFinal=!!Ir,vr&&(xe.session={}),$e.eventType=Pe,Bn(xe,$e),xe.emit("hammer.input",$e),xe.recognize($e),xe.session.prevInput=$e}function Bn(xe,Pe){var $e=xe.session,gt=Pe.pointers,Wt=gt.length;$e.firstInput||($e.firstInput=mr(Pe)),Wt>1&&!$e.firstMultiple?$e.firstMultiple=mr(Pe):Wt===1&&($e.firstMultiple=!1);var vr=$e.firstInput,Ir=$e.firstMultiple,fi=Ir?Ir.center:vr.center,Li=Pe.center=Rr(gt);Pe.timeStamp=v(),Pe.deltaTime=Pe.timeStamp-vr.timeStamp,Pe.angle=kt(fi,Li),Pe.distance=Me(fi,Li),Zn($e,Pe),Pe.offsetDirection=_i(Pe.deltaX,Pe.deltaY);var Ji=nn(Pe.deltaTime,Pe.deltaX,Pe.deltaY);Pe.overallVelocityX=Ji.x,Pe.overallVelocityY=Ji.y,Pe.overallVelocity=A(Ji.x)>A(Ji.y)?Ji.x:Ji.y,Pe.scale=Ir?lr(Ir.pointers,gt):1,Pe.rotation=Ir?$t(Ir.pointers,gt):0,Pe.maxPointers=$e.prevInput?Pe.pointers.length>$e.prevInput.maxPointers?Pe.pointers.length:$e.prevInput.maxPointers:Pe.pointers.length,Vt($e,Pe);var Qs=xe.element;Ue(Pe.srcEvent.target,Qs)&&(Qs=Pe.srcEvent.target),Pe.target=Qs}function Zn(xe,Pe){var $e=Pe.center,gt=xe.offsetDelta||{},Wt=xe.prevDelta||{},vr=xe.prevInput||{};(Pe.eventType===er||vr.eventType===Nt)&&(Wt=xe.prevDelta={x:vr.deltaX||0,y:vr.deltaY||0},gt=xe.offsetDelta={x:$e.x,y:$e.y}),Pe.deltaX=Wt.x+($e.x-gt.x),Pe.deltaY=Wt.y+($e.y-gt.y)}function Vt(xe,Pe){var $e=xe.lastInterval||Pe,gt=Pe.timeStamp-$e.timeStamp,Wt,vr,Ir,fi;if(Pe.eventType!=Ar&&(gt>dr||$e.velocity===i)){var Li=Pe.deltaX-$e.deltaX,Ji=Pe.deltaY-$e.deltaY,Qs=nn(gt,Li,Ji);vr=Qs.x,Ir=Qs.y,Wt=A(Qs.x)>A(Qs.y)?Qs.x:Qs.y,fi=_i(Li,Ji),xe.lastInterval=Pe}else Wt=$e.velocity,vr=$e.velocityX,Ir=$e.velocityY,fi=$e.direction;Pe.velocity=Wt,Pe.velocityX=vr,Pe.velocityY=Ir,Pe.direction=fi}function mr(xe){for(var Pe=[],$e=0;$e<xe.pointers.length;)Pe[$e]={clientX:f(xe.pointers[$e].clientX),clientY:f(xe.pointers[$e].clientY)},$e++;return{timeStamp:v(),pointers:Pe,center:Rr(Pe),deltaX:xe.deltaX,deltaY:xe.deltaY}}function Rr(xe){var Pe=xe.length;if(Pe===1)return{x:f(xe[0].clientX),y:f(xe[0].clientY)};for(var $e=0,gt=0,Wt=0;Wt<Pe;)$e+=xe[Wt].clientX,gt+=xe[Wt].clientY,Wt++;return{x:f($e/Pe),y:f(gt/Pe)}}function nn(xe,Pe,$e){return{x:Pe/xe||0,y:$e/xe||0}}function _i(xe,Pe){return xe===Pe?ln:A(xe)>=A(Pe)?xe<0?Pr:xr:Pe<0?Vn:_r}function Me(xe,Pe,$e){$e||($e=ci);var gt=Pe[$e[0]]-xe[$e[0]],Wt=Pe[$e[1]]-xe[$e[1]];return Math.sqrt(gt*gt+Wt*Wt)}function kt(xe,Pe,$e){$e||($e=ci);var gt=Pe[$e[0]]-xe[$e[0]],Wt=Pe[$e[1]]-xe[$e[1]];return Math.atan2(Wt,gt)*180/Math.PI}function $t(xe,Pe){return kt(Pe[1],Pe[0],Yn)+kt(xe[1],xe[0],Yn)}function lr(xe,Pe){return Me(Pe[0],Pe[1],Yn)/Me(xe[0],xe[1],Yn)}var Ye={mousedown:er,mousemove:Kt,mouseup:Nt},Rt="mousedown",Ae="mousemove mouseup";function Gt(){this.evEl=Rt,this.evWin=Ae,this.pressed=!1,mn.apply(this,arguments)}H(Gt,mn,{handler:function(Pe){var $e=Ye[Pe.type];$e&er&&Pe.button===0&&(this.pressed=!0),$e&Kt&&Pe.which!==1&&($e=Nt),this.pressed&&($e&Nt&&(this.pressed=!1),this.callback(this.manager,$e,{pointers:[Pe],changedPointers:[Pe],pointerType:St,srcEvent:Pe}))}});var Tt={pointerdown:er,pointermove:Kt,pointerup:Nt,pointercancel:Ar,pointerout:Ar},j={2:ut,3:vt,4:St,5:st},bt="pointerdown",Bt="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(bt="MSPointerDown",Bt="MSPointerMove MSPointerUp MSPointerCancel");function Ce(){this.evEl=bt,this.evWin=Bt,mn.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}H(Ce,mn,{handler:function(Pe){var $e=this.store,gt=!1,Wt=Pe.type.toLowerCase().replace("ms",""),vr=Tt[Wt],Ir=j[Pe.pointerType]||Pe.pointerType,fi=Ir==ut,Li=pe($e,Pe.pointerId,"pointerId");vr&er&&(Pe.button===0||fi)?Li<0&&($e.push(Pe),Li=$e.length-1):vr&(Nt|Ar)&&(gt=!0),!(Li<0)&&($e[Li]=Pe,this.callback(this.manager,vr,{pointers:$e,changedPointers:[Pe],pointerType:Ir,srcEvent:Pe}),gt&&$e.splice(Li,1))}});var Je={touchstart:er,touchmove:Kt,touchend:Nt,touchcancel:Ar},lt="touchstart",Y="touchstart touchmove touchend touchcancel";function ne(){this.evTarget=lt,this.evWin=Y,this.started=!1,mn.apply(this,arguments)}H(ne,mn,{handler:function(Pe){var $e=Je[Pe.type];if($e===er&&(this.started=!0),!!this.started){var gt=le.call(this,Pe,$e);$e&(Nt|Ar)&&gt[0].length-gt[1].length===0&&(this.started=!1),this.callback(this.manager,$e,{pointers:gt[0],changedPointers:gt[1],pointerType:ut,srcEvent:Pe})}}});function le(xe,Pe){var $e=W(xe.touches),gt=W(xe.changedTouches);return Pe&(Nt|Ar)&&($e=re($e.concat(gt),"identifier")),[$e,gt]}var ve={touchstart:er,touchmove:Kt,touchend:Nt,touchcancel:Ar},Oe="touchstart touchmove touchend touchcancel";function he(){this.evTarget=Oe,this.targetIds={},mn.apply(this,arguments)}H(he,mn,{handler:function(Pe){var $e=ve[Pe.type],gt=be.call(this,Pe,$e);gt&&this.callback(this.manager,$e,{pointers:gt[0],changedPointers:gt[1],pointerType:ut,srcEvent:Pe})}});function be(xe,Pe){var $e=W(xe.touches),gt=this.targetIds;if(Pe&(er|Kt)&&$e.length===1)return gt[$e[0].identifier]=!0,[$e,$e];var Wt,vr,Ir=W(xe.changedTouches),fi=[],Li=this.target;if(vr=$e.filter(function(Ji){return Ue(Ji.target,Li)}),Pe===er)for(Wt=0;Wt<vr.length;)gt[vr[Wt].identifier]=!0,Wt++;for(Wt=0;Wt<Ir.length;)gt[Ir[Wt].identifier]&&fi.push(Ir[Wt]),Pe&(Nt|Ar)&&delete gt[Ir[Wt].identifier],Wt++;if(fi.length)return[re(vr.concat(fi),"identifier"),fi]}var ae=2500,Be=25;function g(){mn.apply(this,arguments);var xe=J(this.handler,this);this.touch=new he(this.manager,xe),this.mouse=new Gt(this.manager,xe),this.primaryTouch=null,this.lastTouches=[]}H(g,mn,{handler:function(Pe,$e,gt){var Wt=gt.pointerType==ut,vr=gt.pointerType==St;if(!(vr&&gt.sourceCapabilities&&gt.sourceCapabilities.firesTouchEvents)){if(Wt)ce.call(this,$e,gt);else if(vr&&Ke.call(this,gt))return;this.callback(Pe,$e,gt)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function ce(xe,Pe){xe&er?(this.primaryTouch=Pe.changedPointers[0].identifier,xt.call(this,Pe)):xe&(Nt|Ar)&&xt.call(this,Pe)}function xt(xe){var Pe=xe.changedPointers[0];if(Pe.identifier===this.primaryTouch){var $e={x:Pe.clientX,y:Pe.clientY};this.lastTouches.push($e);var gt=this.lastTouches,Wt=function(){var vr=gt.indexOf($e);vr>-1&&gt.splice(vr,1)};setTimeout(Wt,ae)}}function Ke(xe){for(var Pe=xe.srcEvent.clientX,$e=xe.srcEvent.clientY,gt=0;gt<this.lastTouches.length;gt++){var Wt=this.lastTouches[gt],vr=Math.abs(Pe-Wt.x),Ir=Math.abs($e-Wt.y);if(vr<=Be&&Ir<=Be)return!0}return!1}var Et=Ee(o.style,"touchAction"),Pt=Et!==i,Ot="compute",ht="auto",Lt="manipulation",Mt="none",Ht="pan-x",Ur="pan-y",Qt=Wr();function en(xe,Pe){this.manager=xe,this.set(Pe)}en.prototype={set:function(xe){xe==Ot&&(xe=this.compute()),Pt&&this.manager.element.style&&Qt[xe]&&(this.manager.element.style[Et]=xe),this.actions=xe.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var xe=[];return F(this.manager.recognizers,function(Pe){ue(Pe.options.enable,[Pe])&&(xe=xe.concat(Pe.getTouchAction()))}),cn(xe.join(" "))},preventDefaults:function(xe){var Pe=xe.srcEvent,$e=xe.offsetDirection;if(this.manager.session.prevented){Pe.preventDefault();return}var gt=this.actions,Wt=de(gt,Mt)&&!Qt[Mt],vr=de(gt,Ur)&&!Qt[Ur],Ir=de(gt,Ht)&&!Qt[Ht];if(Wt){var fi=xe.pointers.length===1,Li=xe.distance<2,Ji=xe.deltaTime<250;if(fi&&Li&&Ji)return}if(!(Ir&&vr)&&(Wt||vr&&$e&yr||Ir&&$e&un))return this.preventSrc(Pe)},preventSrc:function(xe){this.manager.session.prevented=!0,xe.preventDefault()}};function cn(xe){if(de(xe,Mt))return Mt;var Pe=de(xe,Ht),$e=de(xe,Ur);return Pe&&$e?Mt:Pe||$e?Pe?Ht:Ur:de(xe,Lt)?Lt:ht}function Wr(){if(!Pt)return!1;var xe={},Pe=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function($e){xe[$e]=Pe?e.CSS.supports("touch-action",$e):!0}),xe}var Jr=1,Vr=2,yi=4,Xr=8,pr=Xr,Ie=16,Xt=32;function tn(xe){this.options=U({},this.defaults,xe||{}),this.id=_e(),this.manager=null,this.options.enable=q(this.options.enable,!0),this.state=Jr,this.simultaneous={},this.requireFail=[]}tn.prototype={defaults:{},set:function(xe){return U(this.options,xe),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(xe){if(S(xe,"recognizeWith",this))return this;var Pe=this.simultaneous;return xe=li(xe,this),Pe[xe.id]||(Pe[xe.id]=xe,xe.recognizeWith(this)),this},dropRecognizeWith:function(xe){return S(xe,"dropRecognizeWith",this)?this:(xe=li(xe,this),delete this.simultaneous[xe.id],this)},requireFailure:function(xe){if(S(xe,"requireFailure",this))return this;var Pe=this.requireFail;return xe=li(xe,this),pe(Pe,xe)===-1&&(Pe.push(xe),xe.requireFailure(this)),this},dropRequireFailure:function(xe){if(S(xe,"dropRequireFailure",this))return this;xe=li(xe,this);var Pe=pe(this.requireFail,xe);return Pe>-1&&this.requireFail.splice(Pe,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(xe){return!!this.simultaneous[xe.id]},emit:function(xe){var Pe=this,$e=this.state;function gt(Wt){Pe.manager.emit(Wt,xe)}$e<Xr&&gt(Pe.options.event+$i($e)),gt(Pe.options.event),xe.additionalEvent&&gt(xe.additionalEvent),$e>=Xr&&gt(Pe.options.event+$i($e))},tryEmit:function(xe){if(this.canEmit())return this.emit(xe);this.state=Xt},canEmit:function(){for(var xe=0;xe<this.requireFail.length;){if(!(this.requireFail[xe].state&(Xt|Jr)))return!1;xe++}return!0},recognize:function(xe){var Pe=U({},xe);if(!ue(this.options.enable,[this,Pe])){this.reset(),this.state=Xt;return}this.state&(pr|Ie|Xt)&&(this.state=Jr),this.state=this.process(Pe),this.state&(Vr|yi|Xr|Ie)&&this.tryEmit(Pe)},process:function(xe){},getTouchAction:function(){},reset:function(){}};function $i(xe){return xe&Ie?"cancel":xe&Xr?"end":xe&yi?"move":xe&Vr?"start":""}function ya(xe){return xe==_r?"down":xe==Vn?"up":xe==Pr?"left":xe==xr?"right":""}function li(xe,Pe){var $e=Pe.manager;return $e?$e.get(xe):xe}function jn(){tn.apply(this,arguments)}H(jn,tn,{defaults:{pointers:1},attrTest:function(xe){var Pe=this.options.pointers;return Pe===0||xe.pointers.length===Pe},process:function(xe){var Pe=this.state,$e=xe.eventType,gt=Pe&(Vr|yi),Wt=this.attrTest(xe);return gt&&($e&Ar||!Wt)?Pe|Ie:gt||Wt?$e&Nt?Pe|Xr:Pe&Vr?Pe|yi:Vr:Xt}});function Se(){jn.apply(this,arguments),this.pX=null,this.pY=null}H(Se,jn,{defaults:{event:"pan",threshold:10,pointers:1,direction:Dr},getTouchAction:function(){var xe=this.options.direction,Pe=[];return xe&yr&&Pe.push(Ur),xe&un&&Pe.push(Ht),Pe},directionTest:function(xe){var Pe=this.options,$e=!0,gt=xe.distance,Wt=xe.direction,vr=xe.deltaX,Ir=xe.deltaY;return Wt&Pe.direction||(Pe.direction&yr?(Wt=vr===0?ln:vr<0?Pr:xr,$e=vr!=this.pX,gt=Math.abs(xe.deltaX)):(Wt=Ir===0?ln:Ir<0?Vn:_r,$e=Ir!=this.pY,gt=Math.abs(xe.deltaY))),xe.direction=Wt,$e&&gt>Pe.threshold&&Wt&Pe.direction},attrTest:function(xe){return jn.prototype.attrTest.call(this,xe)&&(this.state&Vr||!(this.state&Vr)&&this.directionTest(xe))},emit:function(xe){this.pX=xe.deltaX,this.pY=xe.deltaY;var Pe=ya(xe.direction);Pe&&(xe.additionalEvent=this.options.event+Pe),this._super.emit.call(this,xe)}});function $o(){jn.apply(this,arguments)}H($o,jn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Mt]},attrTest:function(xe){return this._super.attrTest.call(this,xe)&&(Math.abs(xe.scale-1)>this.options.threshold||this.state&Vr)},emit:function(xe){if(xe.scale!==1){var Pe=xe.scale<1?"in":"out";xe.additionalEvent=this.options.event+Pe}this._super.emit.call(this,xe)}});function $n(){tn.apply(this,arguments),this._timer=null,this._input=null}H($n,tn,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ht]},process:function(xe){var Pe=this.options,$e=xe.pointers.length===Pe.pointers,gt=xe.distance<Pe.threshold,Wt=xe.deltaTime>Pe.time;if(this._input=xe,!gt||!$e||xe.eventType&(Nt|Ar)&&!Wt)this.reset();else if(xe.eventType&er)this.reset(),this._timer=w(function(){this.state=pr,this.tryEmit()},Pe.time,this);else if(xe.eventType&Nt)return pr;return Xt},reset:function(){clearTimeout(this._timer)},emit:function(xe){this.state===pr&&(xe&&xe.eventType&Nt?this.manager.emit(this.options.event+"up",xe):(this._input.timeStamp=v(),this.manager.emit(this.options.event,this._input)))}});function Wo(){jn.apply(this,arguments)}H(Wo,jn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Mt]},attrTest:function(xe){return this._super.attrTest.call(this,xe)&&(Math.abs(xe.rotation)>this.options.threshold||this.state&Vr)}});function Oi(){jn.apply(this,arguments)}H(Oi,jn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:yr|un,pointers:1},getTouchAction:function(){return Se.prototype.getTouchAction.call(this)},attrTest:function(xe){var Pe=this.options.direction,$e;return Pe&(yr|un)?$e=xe.overallVelocity:Pe&yr?$e=xe.overallVelocityX:Pe&un&&($e=xe.overallVelocityY),this._super.attrTest.call(this,xe)&&Pe&xe.offsetDirection&&xe.distance>this.options.threshold&&xe.maxPointers==this.options.pointers&&A($e)>this.options.velocity&&xe.eventType&Nt},emit:function(xe){var Pe=ya(xe.offsetDirection);Pe&&this.manager.emit(this.options.event+Pe,xe),this.manager.emit(this.options.event,xe)}});function ui(){tn.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}H(ui,tn,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Lt]},process:function(xe){var Pe=this.options,$e=xe.pointers.length===Pe.pointers,gt=xe.distance<Pe.threshold,Wt=xe.deltaTime<Pe.time;if(this.reset(),xe.eventType&er&&this.count===0)return this.failTimeout();if(gt&&Wt&&$e){if(xe.eventType!=Nt)return this.failTimeout();var vr=this.pTime?xe.timeStamp-this.pTime<Pe.interval:!0,Ir=!this.pCenter||Me(this.pCenter,xe.center)<Pe.posThreshold;this.pTime=xe.timeStamp,this.pCenter=xe.center,!Ir||!vr?this.count=1:this.count+=1,this._input=xe;var fi=this.count%Pe.taps;if(fi===0)return this.hasRequireFailures()?(this._timer=w(function(){this.state=pr,this.tryEmit()},Pe.interval,this),Vr):pr}return Xt},failTimeout:function(){return this._timer=w(function(){this.state=Xt},this.options.interval,this),Xt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==pr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Ii(xe,Pe){return Pe=Pe||{},Pe.recognizers=q(Pe.recognizers,Ii.defaults.preset),new Wi(xe,Pe)}Ii.VERSION="2.0.7",Ii.defaults={domEvents:!1,touchAction:Ot,enable:!0,inputTarget:null,inputClass:null,preset:[[Wo,{enable:!1}],[$o,{enable:!1},["rotate"]],[Oi,{direction:yr}],[Se,{direction:yr},["swipe"]],[ui],[ui,{event:"doubletap",taps:2},["tap"]],[$n]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Rn=1,ms=2;function Wi(xe,Pe){this.options=U({},Ii.defaults,Pe||{}),this.options.inputTarget=this.options.inputTarget||xe,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=xe,this.input=ti(this),this.touchAction=new en(this,this.options.touchAction),Ns(this,!0),F(this.options.recognizers,function($e){var gt=this.add(new $e[0]($e[1]));$e[2]&&gt.recognizeWith($e[2]),$e[3]&&gt.requireFailure($e[3])},this)}Wi.prototype={set:function(xe){return U(this.options,xe),xe.touchAction&&this.touchAction.update(),xe.inputTarget&&(this.input.destroy(),this.input.target=xe.inputTarget,this.input.init()),this},stop:function(xe){this.session.stopped=xe?ms:Rn},recognize:function(xe){var Pe=this.session;if(!Pe.stopped){this.touchAction.preventDefaults(xe);var $e,gt=this.recognizers,Wt=Pe.curRecognizer;(!Wt||Wt&&Wt.state&pr)&&(Wt=Pe.curRecognizer=null);for(var vr=0;vr<gt.length;)$e=gt[vr],Pe.stopped!==ms&&(!Wt||$e==Wt||$e.canRecognizeWith(Wt))?$e.recognize(xe):$e.reset(),!Wt&&$e.state&(Vr|yi|Xr)&&(Wt=Pe.curRecognizer=$e),vr++}},get:function(xe){if(xe instanceof tn)return xe;for(var Pe=this.recognizers,$e=0;$e<Pe.length;$e++)if(Pe[$e].options.event==xe)return Pe[$e];return null},add:function(xe){if(S(xe,"add",this))return this;var Pe=this.get(xe.options.event);return Pe&&this.remove(Pe),this.recognizers.push(xe),xe.manager=this,this.touchAction.update(),xe},remove:function(xe){if(S(xe,"remove",this))return this;if(xe=this.get(xe),xe){var Pe=this.recognizers,$e=pe(Pe,xe);$e!==-1&&(Pe.splice($e,1),this.touchAction.update())}return this},on:function(xe,Pe){if(xe!==i&&Pe!==i){var $e=this.handlers;return F(me(xe),function(gt){$e[gt]=$e[gt]||[],$e[gt].push(Pe)}),this}},off:function(xe,Pe){if(xe!==i){var $e=this.handlers;return F(me(xe),function(gt){Pe?$e[gt]&&$e[gt].splice(pe($e[gt],Pe),1):delete $e[gt]}),this}},emit:function(xe,Pe){this.options.domEvents&&Sn(xe,Pe);var $e=this.handlers[xe]&&this.handlers[xe].slice();if(!(!$e||!$e.length)){Pe.type=xe,Pe.preventDefault=function(){Pe.srcEvent.preventDefault()};for(var gt=0;gt<$e.length;)$e[gt](Pe),gt++}},destroy:function(){this.element&&Ns(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Ns(xe,Pe){var $e=xe.element;if($e.style){var gt;F(xe.options.cssProps,function(Wt,vr){gt=Ee($e.style,vr),Pe?(xe.oldCssProps[gt]=$e.style[gt],$e.style[gt]=Wt):$e.style[gt]=xe.oldCssProps[gt]||""}),Pe||(xe.oldCssProps={})}}function Sn(xe,Pe){var $e=t.createEvent("Event");$e.initEvent(xe,!0,!0),$e.gesture=Pe,Pe.target.dispatchEvent($e)}U(Ii,{INPUT_START:er,INPUT_MOVE:Kt,INPUT_END:Nt,INPUT_CANCEL:Ar,STATE_POSSIBLE:Jr,STATE_BEGAN:Vr,STATE_CHANGED:yi,STATE_ENDED:Xr,STATE_RECOGNIZED:pr,STATE_CANCELLED:Ie,STATE_FAILED:Xt,DIRECTION_NONE:ln,DIRECTION_LEFT:Pr,DIRECTION_RIGHT:xr,DIRECTION_UP:Vn,DIRECTION_DOWN:_r,DIRECTION_HORIZONTAL:yr,DIRECTION_VERTICAL:un,DIRECTION_ALL:Dr,Manager:Wi,Input:mn,TouchAction:en,TouchInput:he,MouseInput:Gt,PointerEventInput:Ce,TouchMouseInput:g,SingleTouchInput:ne,Recognizer:tn,AttrRecognizer:jn,Tap:ui,Pan:Se,Swipe:Oi,Pinch:$o,Rotate:Wo,Press:$n,on:se,off:Te,each:F,merge:G,extend:$,assign:U,inherit:H,bindFn:J,prefixed:Ee});var yl=typeof e<"u"?e:typeof self<"u"?self:{};yl.Hammer=Ii,r.exports?r.exports=Ii:e[n]=Ii})(window,document,"Hammer")}(kb)),kb.exports}var Hg=hoe();const doe=_h(Hg),tl=x5({__proto__:null,default:doe},[Hg]),i6=1,s6=2,nx=4,poe={mousedown:i6,mousemove:s6,mouseup:nx};function Aoe(r,e){for(let t=0;t<r.length;t++)if(e(r[t]))return!0;return!1}function goe(r){const e=r.prototype.handler;r.prototype.handler=function(n){const i=this.store;n.button>0&&n.type==="pointerdown"&&(Aoe(i,s=>s.pointerId===n.pointerId)||i.push(n)),e.call(this,n)}}function moe(r){r.prototype.handler=function(t){let n=poe[t.type];n&i6&&t.button>=0&&(this.pressed=!0),n&s6&&t.buttons===0&&(n=nx),this.pressed&&(n&nx&&(this.pressed=!1),this.callback(this.manager,n,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}goe(Hg.PointerEventInput);moe(Hg.MouseInput);const _oe=Hg.Manager;class Ey{constructor(e,t,n){this.element=e,this.callback=t,this.options={enable:!0,...n}}}const yoe=tl?[[tl.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[tl.Rotate,{enable:!1}],[tl.Pinch,{enable:!1}],[tl.Swipe,{enable:!1}],[tl.Pan,{threshold:0,enable:!1}],[tl.Press,{enable:!1}],[tl.Tap,{event:"doubletap",taps:2,enable:!1}],[tl.Tap,{event:"anytap",enable:!1}],[tl.Tap,{enable:!1}]]:null,QI={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},voe={doubletap:["tap"]},boe={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},iC={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},xoe={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},eM={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},woe=typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.toLowerCase():"",fp=typeof window<"u"?window:global;let ix=!1;try{const r={get passive(){return ix=!0,!0}};fp.addEventListener("test",null,r),fp.removeEventListener("test",null)}catch{ix=!1}const Coe=woe.indexOf("firefox")!==-1,{WHEEL_EVENTS:Toe}=iC,tM="wheel",rM=4.000244140625,Eoe=40,Boe=.25;class Soe extends Ey{constructor(e,t,n){super(e,t,n),this.handleEvent=i=>{if(!this.options.enable)return;let s=i.deltaY;fp.WheelEvent&&(Coe&&i.deltaMode===fp.WheelEvent.DOM_DELTA_PIXEL&&(s/=fp.devicePixelRatio),i.deltaMode===fp.WheelEvent.DOM_DELTA_LINE&&(s*=Eoe)),s!==0&&s%rM===0&&(s=Math.floor(s/rM)),i.shiftKey&&s&&(s=s*Boe),this.callback({type:tM,center:{x:i.clientX,y:i.clientY},delta:-s,srcEvent:i,pointerType:"mouse",target:i.target})},this.events=(this.options.events||[]).concat(Toe),this.events.forEach(i=>e.addEventListener(i,this.handleEvent,ix?{passive:!1}:!1))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===tM&&(this.options.enable=t)}}const{MOUSE_EVENTS:Ioe}=iC,nM="pointermove",iM="pointerover",sM="pointerout",oM="pointerenter",aM="pointerleave";class Moe extends Ey{constructor(e,t,n){super(e,t,n),this.handleEvent=s=>{this.handleOverEvent(s),this.handleOutEvent(s),this.handleEnterEvent(s),this.handleLeaveEvent(s),this.handleMoveEvent(s)},this.pressed=!1;const{enable:i}=this.options;this.enableMoveEvent=i,this.enableLeaveEvent=i,this.enableEnterEvent=i,this.enableOutEvent=i,this.enableOverEvent=i,this.events=(this.options.events||[]).concat(Ioe),this.events.forEach(s=>e.addEventListener(s,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===nM&&(this.enableMoveEvent=t),e===iM&&(this.enableOverEvent=t),e===sM&&(this.enableOutEvent=t),e===oM&&(this.enableEnterEvent=t),e===aM&&(this.enableLeaveEvent=t)}handleOverEvent(e){this.enableOverEvent&&e.type==="mouseover"&&this._emit(iM,e)}handleOutEvent(e){this.enableOutEvent&&e.type==="mouseout"&&this._emit(sM,e)}handleEnterEvent(e){this.enableEnterEvent&&e.type==="mouseenter"&&this._emit(oM,e)}handleLeaveEvent(e){this.enableLeaveEvent&&e.type==="mouseleave"&&this._emit(aM,e)}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":e.buttons===0&&(this.pressed=!1),this.pressed||this._emit(nM,e);break;case"mouseup":this.pressed=!1;break}}_emit(e,t){this.callback({type:e,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})}}const{KEY_EVENTS:Poe}=iC,cM="keydown",lM="keyup";class Roe extends Ey{constructor(e,t,n){super(e,t,n),this.handleEvent=i=>{const s=i.target||i.srcElement;s.tagName==="INPUT"&&s.type==="text"||s.tagName==="TEXTAREA"||(this.enableDownEvent&&i.type==="keydown"&&this.callback({type:cM,srcEvent:i,key:i.key,target:i.target}),this.enableUpEvent&&i.type==="keyup"&&this.callback({type:lM,srcEvent:i,key:i.key,target:i.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=(this.options.events||[]).concat(Poe),e.tabIndex=this.options.tabIndex||0,e.style.outline="none",this.events.forEach(i=>e.addEventListener(i,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===cM&&(this.enableDownEvent=t),e===lM&&(this.enableUpEvent=t)}}const uM="contextmenu";class Foe extends Ey{constructor(e,t,n){super(e,t,n),this.handleEvent=i=>{this.options.enable&&this.callback({type:uM,center:{x:i.clientX,y:i.clientY},srcEvent:i,pointerType:"mouse",target:i.target})},e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,t){e===uM&&(this.options.enable=t)}}const fM=1,sx=2,hM=4,Doe={pointerdown:fM,pointermove:sx,pointerup:hM,mousedown:fM,mousemove:sx,mouseup:hM},Ooe=0,Loe=1,koe=2,Noe=1,Uoe=2,zoe=4;function Goe(r){const e=Doe[r.srcEvent.type];if(!e)return null;const{buttons:t,button:n}=r.srcEvent;let i=!1,s=!1,o=!1;return e===sx?(i=!!(t&Noe),s=!!(t&zoe),o=!!(t&Uoe)):(i=n===Ooe,s=n===Loe,o=n===koe),{leftButton:i,middleButton:s,rightButton:o}}function Voe(r,e){const t=r.center;if(!t)return null;const n=e.getBoundingClientRect(),i=n.width/e.offsetWidth||1,s=n.height/e.offsetHeight||1,o={x:(t.x-n.left-e.clientLeft)/i,y:(t.y-n.top-e.clientTop)/s};return{center:t,offsetCenter:o}}const Nb={srcElement:"root",priority:0};class Hoe{constructor(e){this.handleEvent=t=>{if(this.isEmpty())return;const n=this._normalizeEvent(t);let i=t.srcEvent.target;for(;i&&i!==n.rootElement;){if(this._emit(n,i),n.handled)return;i=i.parentNode}this._emit(n,"root")},this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(e,t,n,i=!1,s=!1){const{handlers:o,handlersByElement:c}=this;let f=Nb;typeof n=="string"||n&&n.addEventListener?f={...Nb,srcElement:n}:n&&(f={...Nb,...n});let A=c.get(f.srcElement);A||(A=[],c.set(f.srcElement,A));const v={type:e,handler:t,srcElement:f.srcElement,priority:f.priority};i&&(v.once=!0),s&&(v.passive=!0),o.push(v),this._active=this._active||!v.passive;let w=A.length-1;for(;w>=0&&!(A[w].priority>=v.priority);)w--;A.splice(w+1,0,v)}remove(e,t){const{handlers:n,handlersByElement:i}=this;for(let s=n.length-1;s>=0;s--){const o=n[s];if(o.type===e&&o.handler===t){n.splice(s,1);const c=i.get(o.srcElement);c.splice(c.indexOf(o),1),c.length===0&&i.delete(o.srcElement)}}this._active=n.some(s=>!s.passive)}_emit(e,t){const n=this.handlersByElement.get(t);if(n){let i=!1;const s=()=>{e.handled=!0},o=()=>{e.handled=!0,i=!0},c=[];for(let f=0;f<n.length;f++){const{type:A,handler:v,once:w}=n[f];if(v({...e,type:A,stopPropagation:s,stopImmediatePropagation:o}),w&&c.push(n[f]),i)break}for(let f=0;f<c.length;f++){const{type:A,handler:v}=c[f];this.remove(A,v)}}}_normalizeEvent(e){const t=this.eventManager.getElement();return{...e,...Goe(e),...Voe(e,t),preventDefault:()=>{e.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:t}}}const joe={events:null,recognizers:null,recognizerOptions:{},Manager:_oe,touchAction:"none",tabIndex:0};class $oe{constructor(e=null,t){this._onBasicInput=i=>{const{srcEvent:s}=i,o=boe[s.type];o&&this.manager.emit(o,i)},this._onOtherEvent=i=>{this.manager.emit(i.type,i)},this.options={...joe,...t},this.events=new Map,this.setElement(e);const{events:n}=this.options;n&&this.on(n)}getElement(){return this.element}setElement(e){if(this.element&&this.destroy(),this.element=e,!e)return;const{options:t}=this,n=t.Manager;this.manager=new n(e,{touchAction:t.touchAction,recognizers:t.recognizers||yoe}).on("hammer.input",this._onBasicInput),t.recognizers||Object.keys(QI).forEach(i=>{const s=this.manager.get(i);s&&QI[i].forEach(o=>{s.recognizeWith(o)})});for(const i in t.recognizerOptions){const s=this.manager.get(i);if(s){const o=t.recognizerOptions[i];delete o.enable,s.set(o)}}this.wheelInput=new Soe(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Moe(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Roe(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new Foe(e,this._onOtherEvent,{enable:!1});for(const[i,s]of this.events)s.isEmpty()||(this._toggleRecognizer(s.recognizerName,!0),this.manager.on(i,s.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,t,n){this._addEventHandler(e,t,n,!1)}once(e,t,n){this._addEventHandler(e,t,n,!0)}watch(e,t,n){this._addEventHandler(e,t,n,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(e,t){const{manager:n}=this;if(!n)return;const i=n.get(e);if(i&&i.options.enable!==t){i.set({enable:t});const s=voe[e];s&&!this.options.recognizers&&s.forEach(o=>{const c=n.get(o);t?(c.requireFailure(e),i.dropRequireFailure(o)):c.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}_addEventHandler(e,t,n,i,s){if(typeof e!="string"){n=t;for(const v in e)this._addEventHandler(v,e[v],n,i,s);return}const{manager:o,events:c}=this,f=eM[e]||e;let A=c.get(f);A||(A=new Hoe(this),c.set(f,A),A.recognizerName=xoe[f]||f,o&&o.on(f,A.handleEvent)),A.add(e,t,n,i,s),A.isEmpty()||this._toggleRecognizer(A.recognizerName,!0)}_removeEventHandler(e,t){if(typeof e!="string"){for(const o in e)this._removeEventHandler(o,e[o]);return}const{events:n}=this,i=eM[e]||e,s=n.get(i);if(s&&(s.remove(e,t),s.isEmpty())){const{recognizerName:o}=s;let c=!1;for(const f of n.values())if(f.recognizerName===o&&!f.isEmpty()){c=!0;break}c||this._toggleRecognizer(o,!1)}}}function dM(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Mo(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dM(Object(t),!0).forEach(function(n){Tr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):dM(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Vf={transitionDuration:0},jl={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new ug,transitionInterruption:hg.BREAK},n0=300,i0=function(e){return 1-(1-e)*(1-e)},Fd={WHEEL:["wheel"],PAN:["panstart","panmove","panend"],PINCH:["pinchstart","pinchmove","pinchend"],TRIPLE_PAN:["tripanstart","tripanmove","tripanend"],DOUBLE_TAP:["doubletap"],KEYBOARD:["keydown"]},o6=function(){function r(){var e=this;af(this,r),Tr(this,"events",[]),Tr(this,"scrollZoom",!0),Tr(this,"dragPan",!0),Tr(this,"dragRotate",!0),Tr(this,"doubleClickZoom",!0),Tr(this,"touchZoom",!0),Tr(this,"touchRotate",!1),Tr(this,"keyboard",!0),Tr(this,"_interactionState",{isDragging:!1}),Tr(this,"_events",{}),Tr(this,"_setInteractionState",function(t){Object.assign(e._interactionState,t),e.onStateChange&&e.onStateChange(e._interactionState)}),Tr(this,"_onTransition",function(t,n){e.onViewportChange(t,e._interactionState,n)}),this.handleEvent=this.handleEvent.bind(this),this._transitionManager=new nC({onViewportChange:this._onTransition,onStateChange:this._setInteractionState})}return of(r,[{key:"handleEvent",value:function(t){this.mapState=this.getMapState();var n=this._eventStartBlocked;switch(t.type){case"panstart":return n?!1:this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return n?!1:this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"tripanstart":return n?!1:this._onTriplePanStart(t);case"tripanmove":return this._onTriplePan(t);case"tripanend":return this._onTriplePanEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}},{key:"getCenter",value:function(t){var n=t.offsetCenter,i=n.x,s=n.y;return[i,s]}},{key:"isFunctionKeyPressed",value:function(t){var n=t.srcEvent;return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}},{key:"blockEvents",value:function(t){var n=this,i=setTimeout(function(){n._eventStartBlocked===i&&(n._eventStartBlocked=null)},t);this._eventStartBlocked=i}},{key:"updateViewport",value:function(t,n,i){var s=this.mapState instanceof wp?this.mapState.getViewportProps():this.mapState,o=Mo(Mo({},t.getViewportProps()),n),c=Object.keys(o).some(function(f){return s[f]!==o[f]});this._state=t.getState(),this._setInteractionState(i),c&&this.onViewportChange(o,this._interactionState,s)}},{key:"getMapState",value:function(t){return new wp(Mo(Mo(Mo({},this.mapStateProps),this._state),t))}},{key:"isDragging",value:function(){return this._interactionState.isDragging}},{key:"setOptions",value:function(t){var n=t.onViewportChange,i=t.onStateChange,s=t.eventManager,o=s===void 0?this.eventManager:s,c=t.isInteractive,f=c===void 0?!0:c,A=t.scrollZoom,v=A===void 0?this.scrollZoom:A,w=t.dragPan,S=w===void 0?this.dragPan:w,F=t.dragRotate,N=F===void 0?this.dragRotate:F,U=t.doubleClickZoom,$=U===void 0?this.doubleClickZoom:U,G=t.touchZoom,H=G===void 0?this.touchZoom:G,J=t.touchRotate,ue=J===void 0?this.touchRotate:J,q=t.keyboard,se=q===void 0?this.keyboard:q;this.onViewportChange=n,this.onStateChange=i;var Te=this.mapStateProps||{},Ue=Te.height!==t.height||Te.width!==t.width;this.mapStateProps=t,Ue&&(this.mapState=Te,this.updateViewport(new wp(t))),this._transitionManager.processViewportChange(t),this.eventManager!==o&&(this.eventManager=o,this._events={},this.toggleEvents(this.events,!0)),this.toggleEvents(Fd.WHEEL,f&&!!v),this.toggleEvents(Fd.PAN,f&&!!(S||N)),this.toggleEvents(Fd.PINCH,f&&!!(H||ue)),this.toggleEvents(Fd.TRIPLE_PAN,f&&!!ue),this.toggleEvents(Fd.DOUBLE_TAP,f&&!!$),this.toggleEvents(Fd.KEYBOARD,f&&!!se),this.scrollZoom=v,this.dragPan=S,this.dragRotate=N,this.doubleClickZoom=$,this.touchZoom=H,this.touchRotate=ue,this.keyboard=se}},{key:"toggleEvents",value:function(t,n){var i=this;this.eventManager&&t.forEach(function(s){i._events[s]!==n&&(i._events[s]=n,n?i.eventManager.on(s,i.handleEvent):i.eventManager.off(s,i.handleEvent))})}},{key:"_onPanStart",value:function(t){var n=this.getCenter(t);this._panRotate=this.isFunctionKeyPressed(t)||t.rightButton;var i=this._panRotate?this.mapState.rotateStart({pos:n}):this.mapState.panStart({pos:n});return this.updateViewport(i,Vf,{isDragging:!0}),!0}},{key:"_onPan",value:function(t){return this.isDragging()?this._panRotate?this._onPanRotate(t):this._onPanMove(t):!1}},{key:"_onPanEnd",value:function(t){return this.isDragging()?this._panRotate?this._onPanRotateEnd(t):this._onPanMoveEnd(t):!1}},{key:"_onPanMove",value:function(t){if(!this.dragPan)return!1;var n=this.getCenter(t),i=this.mapState.pan({pos:n});return this.updateViewport(i,Vf,{isPanning:!0}),!0}},{key:"_onPanMoveEnd",value:function(t){if(this.dragPan){var n=this.dragPan.inertia,i=n===void 0?n0:n;if(i&&t.velocity){var s=this.getCenter(t),o=[s[0]+t.velocityX*i/2,s[1]+t.velocityY*i/2],c=this.mapState.pan({pos:o}).panEnd();return this.updateViewport(c,Mo(Mo({},jl),{},{transitionDuration:i,transitionEasing:i0}),{isDragging:!1,isPanning:!0}),!0}}var f=this.mapState.panEnd();return this.updateViewport(f,null,{isDragging:!1,isPanning:!1}),!0}},{key:"_onPanRotate",value:function(t){if(!this.dragRotate)return!1;var n=this.getCenter(t),i=this.mapState.rotate({pos:n});return this.updateViewport(i,Vf,{isRotating:!0}),!0}},{key:"_onPanRotateEnd",value:function(t){if(this.dragRotate){var n=this.dragRotate.inertia,i=n===void 0?n0:n;if(i&&t.velocity){var s=this.getCenter(t),o=[s[0]+t.velocityX*i/2,s[1]+t.velocityY*i/2],c=this.mapState.rotate({pos:o}).rotateEnd();return this.updateViewport(c,Mo(Mo({},jl),{},{transitionDuration:i,transitionEasing:i0}),{isDragging:!1,isRotating:!0}),!0}}var f=this.mapState.panEnd();return this.updateViewport(f,null,{isDragging:!1,isRotating:!1}),!0}},{key:"_onWheel",value:function(t){if(!this.scrollZoom)return!1;var n=this.scrollZoom,i=n.speed,s=i===void 0?.01:i,o=n.smooth,c=o===void 0?!1:o;t.preventDefault();var f=this.getCenter(t),A=t.delta,v=2/(1+Math.exp(-Math.abs(A*s)));A<0&&v!==0&&(v=1/v);var w=this.mapState.zoom({pos:f,scale:v});return w.getViewportProps().zoom===this.mapStateProps.zoom?!1:(this.updateViewport(w,Mo(Mo({},jl),{},{transitionInterpolator:new ug({around:f}),transitionDuration:c?250:1}),{isPanning:!0,isZooming:!0}),!0)}},{key:"_onPinchStart",value:function(t){var n=this.getCenter(t),i=this.mapState.zoomStart({pos:n}).rotateStart({pos:n});return this._startPinchRotation=t.rotation,this._lastPinchEvent=t,this.updateViewport(i,Vf,{isDragging:!0}),!0}},{key:"_onPinch",value:function(t){if(!this.isDragging()||!this.touchZoom&&!this.touchRotate)return!1;var n=this.mapState;if(this.touchZoom){var i=t.scale,s=this.getCenter(t);n=n.zoom({pos:s,scale:i})}if(this.touchRotate){var o=t.rotation;n=n.rotate({deltaAngleX:this._startPinchRotation-o})}return this.updateViewport(n,Vf,{isDragging:!0,isPanning:!!this.touchZoom,isZooming:!!this.touchZoom,isRotating:!!this.touchRotate}),this._lastPinchEvent=t,!0}},{key:"_onPinchEnd",value:function(t){if(!this.isDragging())return!1;if(this.touchZoom){var n=this.touchZoom.inertia,i=n===void 0?n0:n,s=this._lastPinchEvent;if(i&&s&&t.scale!==s.scale){var o=this.getCenter(t),c=this.mapState.rotateEnd(),f=Math.log2(t.scale),A=(f-Math.log2(s.scale))/(t.deltaTime-s.deltaTime),v=Math.pow(2,f+A*i/2);return c=c.zoom({pos:o,scale:v}).zoomEnd(),this.updateViewport(c,Mo(Mo({},jl),{},{transitionInterpolator:new ug({around:o}),transitionDuration:i,transitionEasing:i0}),{isDragging:!1,isPanning:!!this.touchZoom,isZooming:!!this.touchZoom,isRotating:!1}),this.blockEvents(i),!0}}var w=this.mapState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(w,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),this._startPinchRotation=null,this._lastPinchEvent=null,!0}},{key:"_onTriplePanStart",value:function(t){var n=this.getCenter(t),i=this.mapState.rotateStart({pos:n});return this.updateViewport(i,Vf,{isDragging:!0}),!0}},{key:"_onTriplePan",value:function(t){if(!this.isDragging()||!this.touchRotate)return!1;var n=this.getCenter(t);n[0]-=t.deltaX;var i=this.mapState.rotate({pos:n});return this.updateViewport(i,Vf,{isRotating:!0}),!0}},{key:"_onTriplePanEnd",value:function(t){if(!this.isDragging())return!1;if(this.touchRotate){var n=this.touchRotate.inertia,i=n===void 0?n0:n;if(i&&t.velocityY){var s=this.getCenter(t),o=[s[0],s[1]+=t.velocityY*i/2],c=this.mapState.rotate({pos:o});return this.updateViewport(c,Mo(Mo({},jl),{},{transitionDuration:i,transitionEasing:i0}),{isDragging:!1,isRotating:!0}),this.blockEvents(i),!1}}var f=this.mapState.rotateEnd();return this.updateViewport(f,null,{isDragging:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(t){if(!this.doubleClickZoom)return!1;var n=this.getCenter(t),i=this.isFunctionKeyPressed(t),s=this.mapState.zoom({pos:n,scale:i?.5:2});return this.updateViewport(s,Object.assign({},jl,{transitionInterpolator:new ug({around:n})}),{isZooming:!0}),!0}},{key:"_onKeyDown",value:function(t){if(!this.keyboard)return!1;var n=this.isFunctionKeyPressed(t),i=this.keyboard,s=i.zoomSpeed,o=s===void 0?2:s,c=i.moveSpeed,f=c===void 0?100:c,A=i.rotateSpeedX,v=A===void 0?15:A,w=i.rotateSpeedY,S=w===void 0?10:w,F=this.mapStateProps,N;switch(t.srcEvent.keyCode){case 189:n?N=this.getMapState({zoom:F.zoom-Math.log2(o)-1}):N=this.getMapState({zoom:F.zoom-Math.log2(o)});break;case 187:n?N=this.getMapState({zoom:F.zoom+Math.log2(o)+1}):N=this.getMapState({zoom:F.zoom+Math.log2(o)});break;case 37:n?N=this.getMapState({bearing:F.bearing-v}):N=this.mapState.pan({pos:[f,0],startPos:[0,0]});break;case 39:n?N=this.getMapState({bearing:F.bearing+v}):N=this.mapState.pan({pos:[-f,0],startPos:[0,0]});break;case 38:n?N=this.getMapState({pitch:F.pitch+S}):N=this.mapState.pan({pos:[0,f],startPos:[0,0]});break;case 40:n?N=this.getMapState({pitch:F.pitch-S}):N=this.mapState.pan({pos:[0,-f],startPos:[0,0]});break;default:return!1}return this.updateViewport(N,jl)}}]),r}();function pM(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Vl(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pM(Object(t),!0).forEach(function(n){Tr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):pM(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Woe=Object.assign({},nu.propTypes,{maxZoom:At.number,minZoom:At.number,maxPitch:At.number,minPitch:At.number,onViewStateChange:At.func,onViewportChange:At.func,onInteractionStateChange:At.func,transitionDuration:At.oneOfType([At.number,At.string]),transitionInterpolator:At.object,transitionInterruption:At.number,transitionEasing:At.func,onTransitionStart:At.func,onTransitionInterrupt:At.func,onTransitionEnd:At.func,scrollZoom:At.oneOfType([At.bool,At.object]),dragPan:At.oneOfType([At.bool,At.object]),dragRotate:At.oneOfType([At.bool,At.object]),doubleClickZoom:At.bool,touchZoom:At.oneOfType([At.bool,At.object]),touchRotate:At.oneOfType([At.bool,At.object]),keyboard:At.oneOfType([At.bool,At.object]),onHover:At.func,onClick:At.func,onDblClick:At.func,onContextMenu:At.func,onMouseDown:At.func,onMouseMove:At.func,onMouseUp:At.func,onTouchStart:At.func,onTouchMove:At.func,onTouchEnd:At.func,onMouseEnter:At.func,onMouseLeave:At.func,onMouseOut:At.func,onWheel:At.func,touchAction:At.string,eventRecognizerOptions:At.object,clickRadius:At.number,interactiveLayerIds:At.array,getCursor:At.func,controller:At.instanceOf(o6)}),Joe=function(e){var t=e.isDragging,n=e.isHovering;return t?"grabbing":n?"pointer":"grab"},Xoe=Object.assign({},nu.defaultProps,Qf,nC.defaultProps,{onViewStateChange:null,onViewportChange:null,onClick:null,onNativeClick:null,onHover:null,onContextMenu:function(e){return e.preventDefault()},scrollZoom:!0,dragPan:!0,dragRotate:!0,doubleClickZoom:!0,touchZoom:!0,touchRotate:!1,keyboard:!0,touchAction:"none",eventRecognizerOptions:{},clickRadius:0,getCursor:Joe});function sC(r){if(r.lngLat||!r.offsetCenter)return r;var e=r.offsetCenter,t=e.x,n=e.y;if(!Number.isFinite(t)||!Number.isFinite(n))return r;var i=[t,n];return r.point=i,r.lngLat=this.viewport.unproject(i),r}function a6(r){var e=this.map;if(!e||!r)return null;var t={},n=this.props.clickRadius;this.props.interactiveLayerIds&&(t.layers=this.props.interactiveLayerIds);try{return e.queryRenderedFeatures(n?[[r[0]-n,r[1]+n],[r[0]+n,r[1]-n]]:r,t)}catch{return null}}function ql(r,e){var t=this.props[r];t&&t(sC.call(this,e))}function Koe(r){ql.call(this,r.pointerType==="touch"?"onTouchStart":"onMouseDown",r)}function qoe(r){ql.call(this,r.pointerType==="touch"?"onTouchEnd":"onMouseUp",r)}function Yoe(r){if(ql.call(this,r.pointerType==="touch"?"onTouchMove":"onMouseMove",r),!this.state.isDragging){var e=this.props,t=e.onHover,n=e.interactiveLayerIds,i;r=sC.call(this,r),(n||t)&&(i=a6.call(this,r.point));var s=!!(n&&i&&i.length>0),o=s&&!this.state.isHovering,c=!s&&this.state.isHovering;(t||o)&&(r.features=i,t&&t(r)),o&&ql.call(this,"onMouseEnter",r),c&&ql.call(this,"onMouseLeave",r),(o||c)&&this.setState({isHovering:s})}}function AM(r){var e=this.props,t=e.onClick,n=e.onNativeClick,i=e.onDblClick,s=e.doubleClickZoom,o=[],c=i||s;switch(r.type){case"anyclick":o.push(n),c||o.push(t);break;case"click":c&&o.push(t);break}o=o.filter(Boolean),o.length&&(r=sC.call(this,r),r.features=a6.call(this,r.point),o.forEach(function(f){return f(r)}))}function Zoe(r){return{getMap:r.current&&r.current.getMap,queryRenderedFeatures:r.current&&r.current.queryRenderedFeatures}}var oC=It.forwardRef(function(r,e){var t=It.useContext(Th),n=It.useMemo(function(){return r.controller||new o6},[]),i=It.useMemo(function(){return new $oe(null,{touchAction:r.touchAction,recognizerOptions:r.eventRecognizerOptions})},[]),s=It.useRef(null),o=It.useRef(null),c=It.useRef({width:0,height:0,state:{isHovering:!1,isDragging:!1}}),f=c.current;f.props=r,f.map=o.current&&o.current.getMap(),f.setState=function(se){f.state=Vl(Vl({},f.state),se),s.current.style.cursor=r.getCursor(f.state)};var A=!0,v,w,S=function(Te,Ue,de){if(A){v=[Te,Ue,de];return}var me=f.props,pe=me.onViewStateChange,W=me.onViewportChange;pe&&pe({viewState:Te,interactionState:Ue,oldViewState:de}),W&&W(Te,Ue,de)};It.useImperativeHandle(e,function(){return Zoe(o)},[]);var F=It.useMemo(function(){return Vl(Vl({},t),{},{eventManager:i,container:t.container||s.current})},[t,s.current]);F.onViewportChange=S,F.viewport=t.viewport||r6(f),f.viewport=F.viewport;var N=function(Te){var Ue=Te.isDragging,de=Ue===void 0?!1:Ue;if(de!==f.state.isDragging&&f.setState({isDragging:de}),A){w=Te;return}var me=f.props.onInteractionStateChange;me&&me(Te)},U=function(){f.width&&f.height&&n.setOptions(Vl(Vl(Vl({},f.props),f.props.viewState),{},{isInteractive:!!(f.props.onViewStateChange||f.props.onViewportChange),onViewportChange:S,onStateChange:N,eventManager:i,width:f.width,height:f.height}))},$=function(Te){var Ue=Te.width,de=Te.height;f.width=Ue,f.height=de,U(),f.props.onResize({width:Ue,height:de})};It.useEffect(function(){return i.setElement(s.current),i.on({pointerdown:Koe.bind(f),pointermove:Yoe.bind(f),pointerup:qoe.bind(f),pointerleave:ql.bind(f,"onMouseOut"),click:AM.bind(f),anyclick:AM.bind(f),dblclick:ql.bind(f,"onDblClick"),wheel:ql.bind(f,"onWheel"),contextmenu:ql.bind(f,"onContextMenu")}),function(){i.destroy()}},[]),tx(function(){v&&S.apply(void 0,p5(v)),w&&N(w)}),U();var G=r.width,H=r.height,J=r.style,ue=r.getCursor,q=It.useMemo(function(){return Vl(Vl({position:"relative"},J),{},{width:G,height:H,cursor:ue(f.state)})},[J,G,H,ue,f.state]);return(!v||!f._child)&&(f._child=It.createElement(rC,{value:F},It.createElement("div",{key:"event-canvas",ref:s,style:q},It.createElement(nu,$D({},r,{width:"100%",height:"100%",style:null,onResize:$,ref:o}))))),A=!1,f._child});oC.supported=nu.supported;oC.propTypes=Woe;oC.defaultProps=Xoe;At.string.isRequired;var Qoe=["fill","line","symbol","circle","fill-extrusion","raster","background","heatmap","hillshade"];At.oneOf(Qoe).isRequired;var cf={captureScroll:!1,captureDrag:!0,captureClick:!0,captureDoubleClick:!0,capturePointerMove:!1},Ic={captureScroll:At.bool,captureDrag:At.bool,captureClick:At.bool,captureDoubleClick:At.bool,capturePointerMove:At.bool};function eae(r){var e=r.containerRef.current,t=r.context.eventManager;if(!(!e||!t)){var n={wheel:function(s){var o=r.props;o.captureScroll&&s.stopPropagation(),o.onScroll&&o.onScroll(s,r)},panstart:function(s){var o=r.props;o.captureDrag&&s.stopPropagation(),o.onDragStart&&o.onDragStart(s,r)},anyclick:function(s){var o=r.props;o.captureClick&&s.stopPropagation(),o.onNativeClick&&o.onNativeClick(s,r)},click:function(s){var o=r.props;o.captureClick&&s.stopPropagation(),o.onClick&&o.onClick(s,r)},dblclick:function(s){var o=r.props;o.captureDoubleClick&&s.stopPropagation(),o.onDoubleClick&&o.onDoubleClick(s,r)},pointermove:function(s){var o=r.props;o.capturePointerMove&&s.stopPropagation(),o.onPointerMove&&o.onPointerMove(s,r)}};return t.watch(n,e),function(){t.off(n)}}}function lf(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=It.useContext(Th),t=It.useRef(null),n=It.useRef({props:r,state:{},context:e,containerRef:t}),i=n.current;return i.props=r,i.context=e,It.useEffect(function(){return eae(i)},[e.eventManager]),i}function tae(r){var e=rae();return function(){var n=Bp(r),i;if(e){var s=Bp(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return zx(this,i)}}function rae(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function nae(r){var e=r.instance,t=lf(r),n=t.context,i=t.containerRef;return e._context=n,e._containerRef=i,e._render()}var c6=function(r){Ux(t,r);var e=tae(t);function t(){var n;af(this,t);for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n=e.call.apply(e,[this].concat(s)),Tr(zu(n),"_context",{}),Tr(zu(n),"_containerRef",It.createRef()),Tr(zu(n),"_onScroll",function(c){}),Tr(zu(n),"_onDragStart",function(c){}),Tr(zu(n),"_onDblClick",function(c){}),Tr(zu(n),"_onClick",function(c){}),Tr(zu(n),"_onPointerMove",function(c){}),n}return of(t,[{key:"_render",value:function(){throw new Error("_render() not implemented")}},{key:"render",value:function(){return It.createElement(nae,$D({instance:this},this.props,{onScroll:this._onScroll,onDragStart:this._onDragStart,onDblClick:this._onDblClick,onClick:this._onClick,onPointerMove:this._onPointerMove}))}}]),t}(It.PureComponent);Tr(c6,"propTypes",Ic);Tr(c6,"defaultProps",cf);function gM(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function mM(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?gM(Object(t),!0).forEach(function(n){Tr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):gM(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var iae=Object.assign({},Ic,{draggable:At.bool,onDrag:At.func,onDragEnd:At.func,onDragStart:At.func,offsetLeft:At.number,offsetTop:At.number}),sae=Object.assign({},cf,{draggable:!1,offsetLeft:0,offsetTop:0});function l6(r){var e=r.offsetCenter,t=e.x,n=e.y;return[t,n]}function oae(r,e){var t=r.center,n=t.x,i=t.y;if(e){var s=e.getBoundingClientRect();return[s.left-n,s.top-i]}return null}function aC(r,e,t,n){var i=r[0]+e[0]-t.offsetLeft,s=r[1]+e[1]-t.offsetTop;return n.viewport.unproject([i,s])}function aae(r,e){var t=e.props,n=e.callbacks,i=e.state,s=e.context,o=e.containerRef,c=t.draggable;if(c){r.stopPropagation();var f=l6(r),A=oae(r,o.current);if(i.setDragPos(f),i.setDragOffset(A),n.onDragStart&&A){var v=Object.assign({},r);v.lngLat=aC(f,A,t,s),n.onDragStart(v)}}}function cae(r,e){var t=e.props,n=e.callbacks,i=e.state,s=e.context;r.stopPropagation();var o=l6(r);i.setDragPos(o);var c=i.dragOffset;if(n.onDrag&&c){var f=Object.assign({},r);f.lngLat=aC(o,c,t,s),n.onDrag(f)}}function lae(r,e){var t=e.props,n=e.callbacks,i=e.state,s=e.context;r.stopPropagation();var o=i.dragPos,c=i.dragOffset;if(i.setDragPos(null),i.setDragOffset(null),n.onDragEnd&&o&&c){var f=Object.assign({},r);f.lngLat=aC(o,c,t,s),n.onDragEnd(f)}}function uae(r,e){var t=e.state;r.stopPropagation(),t.setDragPos(null),t.setDragOffset(null)}function fae(r){var e=r.context.eventManager;if(!(!e||!r.state.dragPos)){var t={panmove:function(i){return cae(i,r)},panend:function(i){return lae(i,r)},pancancel:function(i){return uae(i,r)}};return e.watch(t),function(){e.off(t)}}}function hae(r){var e=It.useState(null),t=gs(e,2),n=t[0],i=t[1],s=It.useState(null),o=gs(s,2),c=o[0],f=o[1],A=lf(mM(mM({},r),{},{onDragStart:aae}));return A.callbacks=r,A.state.dragPos=n,A.state.setDragPos=i,A.state.dragOffset=c,A.state.setDragOffset=f,It.useEffect(function(){return fae(A)},[A.context.eventManager,!!n]),A}var _M=typeof window<"u"&&window.devicePixelRatio||1,Bg=function(e){return Math.round(e*_M)/_M},yM=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"x";if(e===null)return t;var i=n==="x"?e.offsetWidth:e.offsetHeight;return Bg(t/100*i)/i*100};function vM(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function dae(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vM(Object(t),!0).forEach(function(n){Tr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):vM(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var pae=Object.assign({},iae,{className:At.string,longitude:At.number.isRequired,latitude:At.number.isRequired,style:At.object}),Aae=Object.assign({},sae,{className:""});function gae(r){var e=r.props,t=r.state,n=r.context,i=e.longitude,s=e.latitude,o=e.offsetLeft,c=e.offsetTop,f=t.dragPos,A=t.dragOffset;if(f&&A)return[f[0]+A[0],f[1]+A[1]];var v=n.viewport.project([i,s]),w=gs(v,2),S=w[0],F=w[1];return S+=o,F+=c,[S,F]}function cC(r){var e=hae(r),t=e.state,n=e.containerRef,i=r.children,s=r.className,o=r.draggable,c=r.style,f=t.dragPos,A=gae(e),v=gs(A,2),w=v[0],S=v[1],F="translate(".concat(Bg(w),"px, ").concat(Bg(S),"px)"),N=o?f?"grabbing":"grab":"auto",U=It.useMemo(function(){var G=dae({position:"absolute",left:0,top:0,transform:F,cursor:N},c);return It.createElement("div",{className:"mapboxgl-marker ".concat(s),ref:e.containerRef,style:G},i)},[i,s]),$=n.current;return $&&($.style.transform=F,$.style.cursor=N),U}cC.defaultProps=Aae;cC.propTypes=pae;It.memo(cC);var Sg={top:{x:.5,y:0},"top-left":{x:0,y:0},"top-right":{x:1,y:0},bottom:{x:.5,y:1},"bottom-left":{x:0,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5}},mae=Object.keys(Sg);function _ae(r){var e=r.x,t=r.y,n=r.width,i=r.height,s=r.selfWidth,o=r.selfHeight,c=r.anchor,f=r.padding,A=f===void 0?0:f,v=Sg[c],w=v.x,S=v.y,F=t-S*o,N=F+o,U=Math.max(0,A-F)+Math.max(0,N-i+A);if(U>0){var $=S,G=U;for(S=0;S<=1;S+=.5)F=t-S*o,N=F+o,U=Math.max(0,A-F)+Math.max(0,N-i+A),U<G&&(G=U,$=S);S=$}var H=.5;S===.5&&(w=Math.floor(w),H=1);var J=e-w*s,ue=J+s,q=Math.max(0,A-J)+Math.max(0,ue-n+A);if(q>0){var se=w,Te=q;for(w=0;w<=1;w+=H)J=e-w*s,ue=J+s,q=Math.max(0,A-J)+Math.max(0,ue-n+A),q<Te&&(Te=q,se=w);w=se}return mae.find(function(Ue){var de=Sg[Ue];return de.x===w&&de.y===S})||c}var yae=Object.assign({},Ic,{className:At.string,longitude:At.number.isRequired,latitude:At.number.isRequired,altitude:At.number,offsetLeft:At.number,offsetTop:At.number,tipSize:At.number,closeButton:At.bool,closeOnClick:At.bool,anchor:At.oneOf(Object.keys(Sg)),dynamicPosition:At.bool,sortByDepth:At.bool,onClose:At.func}),vae=Object.assign({},cf,{className:"",altitude:0,offsetLeft:0,offsetTop:0,tipSize:10,anchor:"bottom",dynamicPosition:!0,sortByDepth:!1,closeButton:!0,closeOnClick:!0,onClose:function(){}});function bae(r,e,t,n){var i=gs(n,2),s=i[0],o=i[1],c=r.anchor,f=r.dynamicPosition,A=r.tipSize;return t&&f?_ae({x:s,y:o,anchor:c,padding:A,width:e.width,height:e.height,selfWidth:t.clientWidth,selfHeight:t.clientHeight}):c}function xae(r,e,t,n,i){var s=gs(n,3),o=s[0],c=s[1],f=s[2],A=r.offsetLeft,v=r.offsetTop,w=r.sortByDepth,S=Sg[i],F=o+A,N=c+v,U=yM(t,-S.x*100),$=yM(t,-S.y*100,"y"),G={position:"absolute",transform:`
2613
2604
  translate(`.concat(U,"%, ").concat($,`%)
2614
2605
  translate(`).concat(Bg(F),"px, ").concat(Bg(N),`px)
2615
2606
  `),display:void 0,zIndex:void 0};return w&&(f>1||f<-1||o<0||o>e.width||c<0||c>e.height?G.display="none":G.zIndex=Math.floor((1-f)/2*1e5)),G}function lC(r){var e=It.useRef(null),t=lf(r),n=t.context,i=t.containerRef,s=It.useState(!1),o=gs(s,2),c=o[1];It.useEffect(function(){c(!0)},[e.current]),It.useEffect(function(){if(n.eventManager&&r.closeOnClick){var ue=function(){return t.props.onClose()};return n.eventManager.on("anyclick",ue),function(){n.eventManager.off("anyclick",ue)}}},[n.eventManager,r.closeOnClick]);var f=n.viewport,A=r.className,v=r.longitude,w=r.latitude,S=r.altitude,F=r.tipSize,N=r.closeButton,U=r.children,$=f.project([v,w,S]),G=bae(r,f,e.current,$),H=xae(r,f,i.current,$,G),J=It.useCallback(function(ue){t.props.onClose();var q=t.context.eventManager;q&&q.once("click",function(se){return se.stopPropagation()},ue.target)},[]);return It.createElement("div",{className:"mapboxgl-popup mapboxgl-popup-anchor-".concat(G," ").concat(A),style:H,ref:i},It.createElement("div",{key:"tip",className:"mapboxgl-popup-tip",style:{borderWidth:F}}),It.createElement("div",{key:"content",ref:e,className:"mapboxgl-popup-content"},N&&It.createElement("button",{key:"close-button",className:"mapboxgl-popup-close-button",type:"button",onClick:J},"×"),U))}lC.propTypes=yae;lC.defaultProps=vae;It.memo(lC);function bM(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function wae(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?bM(Object(t),!0).forEach(function(n){Tr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):bM(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Cae=Object.assign({},Ic,{toggleLabel:At.string,className:At.string,style:At.object,compact:At.bool,customAttribution:At.oneOfType([At.string,At.arrayOf(At.string)])}),Tae=Object.assign({},cf,{className:"",toggleLabel:"Toggle Attribution"});function Eae(r,e,t,n){var i=new dl.AttributionControl(r);return i._map=e,i._container=t,i._innerContainer=n,i._updateAttributions(),i._updateEditLink(),e.on("styledata",i._updateData),e.on("sourcedata",i._updateData),i}function Bae(r){r._map.off("styledata",r._updateData),r._map.off("sourcedata",r._updateData)}function uC(r){var e=lf(r),t=e.context,n=e.containerRef,i=It.useRef(null),s=It.useState(!1),o=gs(s,2),c=o[0],f=o[1];It.useEffect(function(){var S;return t.map&&(S=Eae({customAttribution:r.customAttribution},t.map,n.current,i.current)),function(){return S&&Bae(S)}},[t.map]);var A=r.compact===void 0?t.viewport.width<=640:r.compact;It.useEffect(function(){!A&&c&&f(!1)},[A]);var v=It.useCallback(function(){return f(function(S){return!S})},[]),w=It.useMemo(function(){return wae({position:"absolute"},r.style)},[r.style]);return It.createElement("div",{style:w,className:r.className},It.createElement("div",{ref:n,"aria-pressed":c,className:"mapboxgl-ctrl mapboxgl-ctrl-attrib ".concat(A?"mapboxgl-compact":""," ").concat(c?"mapboxgl-compact-show":"")},It.createElement("button",{type:"button",className:"mapboxgl-ctrl-attrib-button",title:r.toggleLabel,onClick:v}),It.createElement("div",{ref:i,className:"mapboxgl-ctrl-attrib-inner",role:"list"})))}uC.propTypes=Cae;uC.defaultProps=Tae;It.memo(uC);function xM(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Sae(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xM(Object(t),!0).forEach(function(n){Tr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):xM(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Iae=Object.assign({},Ic,{className:At.string,style:At.object,container:At.object,label:At.string}),Mae=Object.assign({},cf,{className:"",container:null,label:"Toggle fullscreen"});function fC(r){var e=lf(r),t=e.context,n=e.containerRef,i=It.useState(!1),s=gs(i,2),o=s[0],c=s[1],f=It.useState(!1),A=gs(f,2),v=A[0],w=A[1],S=It.useState(null),F=gs(S,2),N=F[0],U=F[1];It.useEffect(function(){var q=new dl.FullscreenControl;U(q),w(q._checkFullscreenSupport());var se=function(){var Ue=!q._fullscreen;q._fullscreen=Ue,c(Ue)};return Xl.addEventListener(q._fullscreenchange,se),function(){Xl.removeEventListener(q._fullscreenchange,se)}},[]);var $=function(){N&&(N._container=r.container||t.container,N._onClickFullscreen())},G=It.useMemo(function(){return Sae({position:"absolute"},r.style)},[r.style]);if(!v)return null;var H=r.className,J=r.label,ue=o?"shrink":"fullscreen";return It.createElement("div",{style:G,className:H},It.createElement("div",{className:"mapboxgl-ctrl mapboxgl-ctrl-group",ref:n},It.createElement("button",{key:ue,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(ue),type:"button",title:J,onClick:$},It.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))))}fC.propTypes=Iae;fC.defaultProps=Mae;It.memo(fC);var Dd;function Pae(){return Dd!==void 0?Promise.resolve(Dd):window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(function(r){return Dd=r.state!=="denied",Dd}):(Dd=!!window.navigator.geolocation,Promise.resolve(Dd))}function wM(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Rae(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wM(Object(t),!0).forEach(function(n){Tr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):wM(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var CM=function(){},Fae=Object.assign({},Ic,{className:At.string,style:At.object,label:At.string,disabledLabel:At.string,auto:At.bool,positionOptions:At.object,fitBoundsOptions:At.object,trackUserLocation:At.bool,showUserLocation:At.bool,showAccuracyCircle:At.bool,showUserHeading:At.bool,onViewStateChange:At.func,onViewportChange:At.func,onGeolocate:At.func}),Dae=Object.assign({},cf,{className:"",label:"Find My Location",disabledLabel:"Location Not Available",auto:!1,positionOptions:{enableHighAccuracy:!1,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0,showUserHeading:!1,showAccuracyCircle:!0,onGeolocate:function(){}});function Oae(r){var e=new dl.LngLat(r.coords.longitude,r.coords.latitude),t=r.coords.accuracy,n=e.toBounds(t);return[[n._ne.lng,n._ne.lat],[n._sw.lng,n._sw.lat]]}function Lae(r,e,t){var n=new dl.GeolocateControl(e);n._container=Xl.createElement("div"),n._map={on:function(){},_getUIString:function(){return""}},n._setupUI(!0),n._map=r.map,n._geolocateButton=t;var i=r.eventManager;return n.options.trackUserLocation&&i&&i.on("panstart",function(){n._watchState==="ACTIVE_LOCK"&&(n._watchState="BACKGROUND",t.classList.add("mapboxgl-ctrl-geolocate-background"),t.classList.remove("mapboxgl-ctrl-geolocate-active"))}),n.on("geolocate",e.onGeolocate),n}function kae(r,e){var t=e.context,n=e.props,i=Oae(r),s=t.viewport.fitBounds(i,n.fitBoundsOptions),o=s.longitude,c=s.latitude,f=s.zoom,A=Object.assign({},t.viewport,{longitude:o,latitude:c,zoom:f}),v=new wp(A),w=Object.assign({},v.getViewportProps(),jl),S=n.onViewportChange||t.onViewportChange||CM,F=n.onViewStateChange||t.onViewStateChange||CM;F({viewState:w}),S(w)}function hC(r){var e=lf(r),t=e.context,n=e.containerRef,i=It.useRef(null),s=It.useState(null),o=gs(s,2),c=o[0],f=o[1],A=It.useState(!1),v=gs(A,2),w=v[0],S=v[1];It.useEffect(function(){var J;return t.map&&Pae().then(function(ue){S(ue),i.current&&(J=Lae(t,r,i.current),J._updateCamera=function(q){return kae(q,e)},f(J))}),function(){J&&J._clearWatch()}},[t.map]);var F=It.useCallback(function(){c&&(c.options=e.props,c.trigger())},[c]);It.useEffect(function(){r.auto&&F()},[c,r.auto]),It.useEffect(function(){c&&c._onZoom()},[t.viewport.zoom]);var N=r.className,U=r.label,$=r.disabledLabel,G=r.trackUserLocation,H=It.useMemo(function(){return Rae({position:"absolute"},r.style)},[r.style]);return It.createElement("div",{style:H,className:N},It.createElement("div",{key:"geolocate-control",className:"mapboxgl-ctrl mapboxgl-ctrl-group",ref:n},It.createElement("button",{key:"geolocate",className:"mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",ref:i,disabled:!w,"aria-pressed":!G,type:"button",title:w?U:$,"aria-label":w?U:$,onClick:F},It.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))))}hC.propTypes=Fae;hC.defaultProps=Dae;It.memo(hC);function Nae(r,e){for(var t=(r||"").split(".").map(Number),n=e.split(".").map(Number),i=0;i<3;i++){var s=t[i]||0,o=n[i]||0;if(s<o)return-1;if(s>o)return 1}return 0}function TM(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Uae(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?TM(Object(t),!0).forEach(function(n){Tr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):TM(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var EM=function(){},zae=Object.assign({},Ic,{className:At.string,style:At.object,onViewStateChange:At.func,onViewportChange:At.func,showCompass:At.bool,showZoom:At.bool,zoomInLabel:At.string,zoomOutLabel:At.string,compassLabel:At.string}),Gae=Object.assign({},cf,{className:"",showCompass:!0,showZoom:!0,zoomInLabel:"Zoom In",zoomOutLabel:"Zoom Out",compassLabel:"Reset North"}),Vae=1,ox=2;function Hae(r){return Nae(r,"1.6.0")>=0?ox:Vae}function Ub(r,e,t){var n=r.viewport,i=new wp(Object.assign({},n,t)),s=Object.assign({},i.getViewportProps(),jl),o=e.onViewportChange||r.onViewportChange||EM,c=e.onViewStateChange||r.onViewStateChange||EM;c({viewState:s}),o(s)}function zb(r,e,t,n){return It.createElement("button",{key:r,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(r),type:"button",title:e,onClick:t},n||It.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))}function jae(r){var e=It.useMemo(function(){return r.map?Hae(r.map.version):ox},[r.map]),t=r.viewport.bearing,n={transform:"rotate(".concat(-t,"deg)")};return e===ox?It.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true",style:n}):It.createElement("span",{className:"mapboxgl-ctrl-compass-arrow",style:n})}function dC(r){var e=lf(r),t=e.context,n=e.containerRef,i=function(){Ub(t,r,{zoom:t.viewport.zoom+1})},s=function(){Ub(t,r,{zoom:t.viewport.zoom-1})},o=function(){Ub(t,r,{bearing:0,pitch:0})},c=r.className,f=r.showCompass,A=r.showZoom,v=r.zoomInLabel,w=r.zoomOutLabel,S=r.compassLabel,F=It.useMemo(function(){return Uae({position:"absolute"},r.style)},[r.style]);return It.createElement("div",{style:F,className:c},It.createElement("div",{className:"mapboxgl-ctrl mapboxgl-ctrl-group",ref:n},A&&zb("zoom-in",v,i),A&&zb("zoom-out",w,s),f&&zb("compass",S,o,jae(t))))}dC.propTypes=zae;dC.defaultProps=Gae;const $ae=It.memo(dC);function BM(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Wae(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?BM(Object(t),!0).forEach(function(n){Tr(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):BM(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Jae=Object.assign({},Ic,{className:At.string,style:At.object,maxWidth:At.number,unit:At.oneOf(["imperial","metric","nautical"])}),Xae=Object.assign({},cf,{className:"",maxWidth:100,unit:"metric"});function pC(r){var e=lf(r),t=e.context,n=e.containerRef,i=It.useState(null),s=gs(i,2),o=s[0],c=s[1];It.useEffect(function(){if(t.map){var A=new dl.ScaleControl;A._map=t.map,A._container=n.current,c(A)}},[t.map]),o&&(o.options=r,o._onMove&&o._onMove());var f=It.useMemo(function(){return Wae({position:"absolute"},r.style)},[r.style]);return It.createElement("div",{style:f,className:r.className},It.createElement("div",{ref:n,className:"mapboxgl-ctrl mapboxgl-ctrl-scale"}))}pC.propTypes=Jae;pC.defaultProps=Xae;It.memo(pC);Object.assign({},Ic,{redraw:At.func.isRequired});Object.assign({},Ic,{redraw:At.func.isRequired,style:At.object});Object.assign({},Ic,{redraw:At.func.isRequired,style:At.object});dl&&dl.setRTLTextPlugin;const Kae=()=>Jf(l5,{}),SM=WD("div",{target:"e7mj6ya0"})(({isStretchHeight:r})=>({position:"relative",height:"100%",width:"100%",...r&&{minHeight:"6.25rem"}})),qae=WD("div",{target:"e7mj6ya1"})(({theme:r})=>({position:"absolute",right:"2.625rem",top:r.spacing.md,zIndex:r.zIndices.priority,".mapboxgl-ctrl.mapboxgl-ctrl-group":{overflow:"hidden",background:r.colors.bgColor},"button:not(:disabled)":{background:r.colors.bgColor,width:r.iconSizes.twoXL,height:r.iconSizes.twoXL,"& + button":{borderTopColor:r.colors.borderColor},".mapboxgl-ctrl-icon":{backgroundSize:r.iconSizes.twoXL,"&:hover":{backgroundColor:r.colors.darkenedBgMix25}},"& span":{filter:JD(r)?"":"invert(100%)"}}})),Yae=({container:r,element:e,heightFallback:t="auto",isFullScreen:n,shouldUseContainerWidth:i,widthFallback:s="auto"})=>{const o=It.useMemo(()=>i||n?"100%":e.width||r.width||s,[r.width,e.width,n,i,s]),c=It.useMemo(()=>n&&r.height?r.height:e.height||r.height||t,[n,e.height,r.height,t]);return{width:o,height:c}},IM=`uniform arcUniforms {
@@ -4197,11 +4188,7 @@ DECKGL_FILTER_COLOR(fragColor, geometry);
4197
4188
  `);const se=new e("!xml");let Te=se,Ue="",de="";for(let me=0;me<q.length;me++)if(q[me]==="<")if(q[me+1]==="/"){const W=G(q,">",me,"Closing Tag is not closed.");let re=q.substring(me+2,W).trim();if(this.options.removeNSPrefix){const _e=re.indexOf(":");_e!==-1&&(re=re.substr(_e+1))}this.options.transformTagName&&(re=this.options.transformTagName(re)),Te&&(Ue=this.saveTextToParentTag(Ue,Te,de));const Ee=de.substring(de.lastIndexOf(".")+1);if(re&&this.options.unpairedTags.indexOf(re)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${re}>`);let et=0;Ee&&this.options.unpairedTags.indexOf(Ee)!==-1?(et=de.lastIndexOf(".",de.lastIndexOf(".")-1),this.tagsNodeStack.pop()):et=de.lastIndexOf("."),de=de.substring(0,et),Te=this.tagsNodeStack.pop(),Ue="",me=W}else if(q[me+1]==="?"){let W=H(q,me,!1,"?>");if(!W)throw new Error("Pi Tag is not closed.");if(Ue=this.saveTextToParentTag(Ue,Te,de),!(this.options.ignoreDeclaration&&W.tagName==="?xml"||this.options.ignorePiTags)){const re=new e(W.tagName);re.add(this.options.textNodeName,""),W.tagName!==W.tagExp&&W.attrExpPresent&&(re[":@"]=this.buildAttributesMap(W.tagExp,de,W.tagName)),this.addChild(Te,re,de)}me=W.closeIndex+1}else if(q.substr(me+1,3)==="!--"){const W=G(q,"-->",me+4,"Comment is not closed.");if(this.options.commentPropName){const re=q.substring(me+4,W-2);Ue=this.saveTextToParentTag(Ue,Te,de),Te.add(this.options.commentPropName,[{[this.options.textNodeName]:re}])}me=W}else if(q.substr(me+1,2)==="!D"){const W=t(q,me);this.docTypeEntities=W.entities,me=W.i}else if(q.substr(me+1,2)==="!["){const W=G(q,"]]>",me,"CDATA is not closed.")-2,re=q.substring(me+9,W);Ue=this.saveTextToParentTag(Ue,Te,de);let Ee=this.parseTextData(re,Te.tagname,de,!0,!1,!0,!0);Ee==null&&(Ee=""),this.options.cdataPropName?Te.add(this.options.cdataPropName,[{[this.options.textNodeName]:re}]):Te.add(this.options.textNodeName,Ee),me=W+2}else{let W=H(q,me,this.options.removeNSPrefix),re=W.tagName;const Ee=W.rawTagName;let et=W.tagExp,_e=W.attrExpPresent,Le=W.closeIndex;this.options.transformTagName&&(re=this.options.transformTagName(re)),Te&&Ue&&Te.tagname!=="!xml"&&(Ue=this.saveTextToParentTag(Ue,Te,de,!1));const Ge=Te;if(Ge&&this.options.unpairedTags.indexOf(Ge.tagname)!==-1&&(Te=this.tagsNodeStack.pop(),de=de.substring(0,de.lastIndexOf("."))),re!==se.tagname&&(de+=de?"."+re:re),this.isItStopNode(this.options.stopNodes,de,re)){let Ze="";if(et.length>0&&et.lastIndexOf("/")===et.length-1)re[re.length-1]==="/"?(re=re.substr(0,re.length-1),de=de.substr(0,de.length-1),et=re):et=et.substr(0,et.length-1),me=W.closeIndex;else if(this.options.unpairedTags.indexOf(re)!==-1)me=W.closeIndex;else{const rt=this.readStopNodeData(q,Ee,Le+1);if(!rt)throw new Error(`Unexpected end of ${Ee}`);me=rt.i,Ze=rt.tagContent}const tt=new e(re);re!==et&&_e&&(tt[":@"]=this.buildAttributesMap(et,de,re)),Ze&&(Ze=this.parseTextData(Ze,re,de,!0,_e,!0,!0)),de=de.substr(0,de.lastIndexOf(".")),tt.add(this.options.textNodeName,Ze),this.addChild(Te,tt,de)}else{if(et.length>0&&et.lastIndexOf("/")===et.length-1){re[re.length-1]==="/"?(re=re.substr(0,re.length-1),de=de.substr(0,de.length-1),et=re):et=et.substr(0,et.length-1),this.options.transformTagName&&(re=this.options.transformTagName(re));const Ze=new e(re);re!==et&&_e&&(Ze[":@"]=this.buildAttributesMap(et,de,re)),this.addChild(Te,Ze,de),de=de.substr(0,de.lastIndexOf("."))}else{const Ze=new e(re);this.tagsNodeStack.push(Te),re!==et&&_e&&(Ze[":@"]=this.buildAttributesMap(et,de,re)),this.addChild(Te,Ze,de),Te=Ze}Ue="",me=Le}}else Ue+=q[me];return se.child};function S(q,se,Te){const Ue=this.options.updateTag(se.tagname,Te,se[":@"]);Ue===!1||(typeof Ue=="string"&&(se.tagname=Ue),q.addChild(se))}const F=function(q){if(this.options.processEntities){for(let se in this.docTypeEntities){const Te=this.docTypeEntities[se];q=q.replace(Te.regx,Te.val)}for(let se in this.lastEntities){const Te=this.lastEntities[se];q=q.replace(Te.regex,Te.val)}if(this.options.htmlEntities)for(let se in this.htmlEntities){const Te=this.htmlEntities[se];q=q.replace(Te.regex,Te.val)}q=q.replace(this.ampEntity.regex,this.ampEntity.val)}return q};function N(q,se,Te,Ue){return q&&(Ue===void 0&&(Ue=Object.keys(se.child).length===0),q=this.parseTextData(q,se.tagname,Te,!1,se[":@"]?Object.keys(se[":@"]).length!==0:!1,Ue),q!==void 0&&q!==""&&se.add(this.options.textNodeName,q),q=""),q}function U(q,se,Te){const Ue="*."+Te;for(const de in q){const me=q[de];if(Ue===me||se===me)return!0}return!1}function $(q,se,Te=">"){let Ue,de="";for(let me=se;me<q.length;me++){let pe=q[me];if(Ue)pe===Ue&&(Ue="");else if(pe==='"'||pe==="'")Ue=pe;else if(pe===Te[0])if(Te[1]){if(q[me+1]===Te[1])return{data:de,index:me}}else return{data:de,index:me};else pe===" "&&(pe=" ");de+=pe}}function G(q,se,Te,Ue){const de=q.indexOf(se,Te);if(de===-1)throw new Error(Ue);return de+se.length-1}function H(q,se,Te,Ue=">"){const de=$(q,se+1,Ue);if(!de)return;let me=de.data;const pe=de.index,W=me.search(/\s/);let re=me,Ee=!0;W!==-1&&(re=me.substring(0,W),me=me.substring(W+1).trimStart());const et=re;if(Te){const _e=re.indexOf(":");_e!==-1&&(re=re.substr(_e+1),Ee=re!==de.data.substr(_e+1))}return{tagName:re,tagExp:me,closeIndex:pe,attrExpPresent:Ee,rawTagName:et}}function J(q,se,Te){const Ue=Te;let de=1;for(;Te<q.length;Te++)if(q[Te]==="<")if(q[Te+1]==="/"){const me=G(q,">",Te,`${se} is not closed`);if(q.substring(Te+2,me).trim()===se&&(de--,de===0))return{tagContent:q.substring(Ue,Te),i:me};Te=me}else if(q[Te+1]==="?")Te=G(q,"?>",Te+1,"StopNode is not closed.");else if(q.substr(Te+1,3)==="!--")Te=G(q,"-->",Te+3,"StopNode is not closed.");else if(q.substr(Te+1,2)==="![")Te=G(q,"]]>",Te,"StopNode is not closed.")-2;else{const me=H(q,Te,">");me&&((me&&me.tagName)===se&&me.tagExp[me.tagExp.length-1]!=="/"&&de++,Te=me.closeIndex)}}function ue(q,se,Te){if(se&&typeof q=="string"){const Ue=q.trim();return Ue==="true"?!0:Ue==="false"?!1:n(q,Te)}else return r.isExist(q)?q:""}return Qb=s,Qb}var e1={},vP;function _ue(){if(vP)return e1;vP=1;function r(s,o){return e(s,o)}function e(s,o,c){let f;const A={};for(let v=0;v<s.length;v++){const w=s[v],S=t(w);let F="";if(c===void 0?F=S:F=c+"."+S,S===o.textNodeName)f===void 0?f=w[S]:f+=""+w[S];else{if(S===void 0)continue;if(w[S]){let N=e(w[S],o,F);const U=i(N,o);w[":@"]?n(N,w[":@"],F,o):Object.keys(N).length===1&&N[o.textNodeName]!==void 0&&!o.alwaysCreateTextNode?N=N[o.textNodeName]:Object.keys(N).length===0&&(o.alwaysCreateTextNode?N[o.textNodeName]="":N=""),A[S]!==void 0&&A.hasOwnProperty(S)?(Array.isArray(A[S])||(A[S]=[A[S]]),A[S].push(N)):o.isArray(S,F,U)?A[S]=[N]:A[S]=N}}}return typeof f=="string"?f.length>0&&(A[o.textNodeName]=f):f!==void 0&&(A[o.textNodeName]=f),A}function t(s){const o=Object.keys(s);for(let c=0;c<o.length;c++){const f=o[c];if(f!==":@")return f}}function n(s,o,c,f){if(o){const A=Object.keys(o),v=A.length;for(let w=0;w<v;w++){const S=A[w];f.isArray(S,c+"."+S,!0,!0)?s[S]=[o[S]]:s[S]=o[S]}}}function i(s,o){const{textNodeName:c}=o,f=Object.keys(s).length;return!!(f===0||f===1&&(s[c]||typeof s[c]=="boolean"||s[c]===0))}return e1.prettify=r,e1}var t1,bP;function yue(){if(bP)return t1;bP=1;const{buildOptions:r}=due(),e=mue(),{prettify:t}=_ue(),n=I6();class i{constructor(o){this.externalEntities={},this.options=r(o)}parse(o,c){if(typeof o!="string")if(o.toString)o=o.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(c){c===!0&&(c={});const v=n.validate(o,c);if(v!==!0)throw Error(`${v.err.msg}:${v.err.line}:${v.err.col}`)}const f=new e(this.options);f.addExternalEntities(this.externalEntities);const A=f.parseXml(o);return this.options.preserveOrder||A===void 0?A:t(A,this.options)}addEntity(o,c){if(c.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(o.indexOf("&")!==-1||o.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(c==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[o]=c}}return t1=i,t1}var r1,xP;function vue(){if(xP)return r1;xP=1;const r=`
4198
4189
  `;function e(c,f){let A="";return f.format&&f.indentBy.length>0&&(A=r),t(c,f,"",A)}function t(c,f,A,v){let w="",S=!1;for(let F=0;F<c.length;F++){const N=c[F],U=n(N);if(U===void 0)continue;let $="";if(A.length===0?$=U:$=`${A}.${U}`,U===f.textNodeName){let q=N[U];s($,f)||(q=f.tagValueProcessor(U,q),q=o(q,f)),S&&(w+=v),w+=q,S=!1;continue}else if(U===f.cdataPropName){S&&(w+=v),w+=`<![CDATA[${N[U][0][f.textNodeName]}]]>`,S=!1;continue}else if(U===f.commentPropName){w+=v+`<!--${N[U][0][f.textNodeName]}-->`,S=!0;continue}else if(U[0]==="?"){const q=i(N[":@"],f),se=U==="?xml"?"":v;let Te=N[U][0][f.textNodeName];Te=Te.length!==0?" "+Te:"",w+=se+`<${U}${Te}${q}?>`,S=!0;continue}let G=v;G!==""&&(G+=f.indentBy);const H=i(N[":@"],f),J=v+`<${U}${H}`,ue=t(N[U],f,$,G);f.unpairedTags.indexOf(U)!==-1?f.suppressUnpairedNode?w+=J+">":w+=J+"/>":(!ue||ue.length===0)&&f.suppressEmptyNode?w+=J+"/>":ue&&ue.endsWith(">")?w+=J+`>${ue}${v}</${U}>`:(w+=J+">",ue&&v!==""&&(ue.includes("/>")||ue.includes("</"))?w+=v+f.indentBy+ue+v:w+=ue,w+=`</${U}>`),S=!0}return w}function n(c){const f=Object.keys(c);for(let A=0;A<f.length;A++){const v=f[A];if(c.hasOwnProperty(v)&&v!==":@")return v}}function i(c,f){let A="";if(c&&!f.ignoreAttributes)for(let v in c){if(!c.hasOwnProperty(v))continue;let w=f.attributeValueProcessor(v,c[v]);w=o(w,f),w===!0&&f.suppressBooleanAttributes?A+=` ${v.substr(f.attributeNamePrefix.length)}`:A+=` ${v.substr(f.attributeNamePrefix.length)}="${w}"`}return A}function s(c,f){c=c.substr(0,c.length-f.textNodeName.length-1);let A=c.substr(c.lastIndexOf(".")+1);for(let v in f.stopNodes)if(f.stopNodes[v]===c||f.stopNodes[v]==="*."+A)return!0;return!1}function o(c,f){if(c&&c.length>0&&f.processEntities)for(let A=0;A<f.entities.length;A++){const v=f.entities[A];c=c.replace(v.regex,v.val)}return c}return r1=e,r1}var n1,wP;function bue(){if(wP)return n1;wP=1;const r=vue(),e=M6(),t={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(c,f){return f},attributeValueProcessor:function(c,f){return f},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function n(c){this.options=Object.assign({},t,c),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=e(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=o),this.processTextOrObjNode=i,this.options.format?(this.indentate=s,this.tagEndChar=`>
4199
4190
  `,this.newLine=`
4200
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}n.prototype.build=function(c){return this.options.preserveOrder?r(c,this.options):(Array.isArray(c)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(c={[this.options.arrayNodeName]:c}),this.j2x(c,0,[]).val)},n.prototype.j2x=function(c,f,A){let v="",w="";const S=A.join(".");for(let F in c)if(Object.prototype.hasOwnProperty.call(c,F))if(typeof c[F]>"u")this.isAttribute(F)&&(w+="");else if(c[F]===null)this.isAttribute(F)?w+="":F[0]==="?"?w+=this.indentate(f)+"<"+F+"?"+this.tagEndChar:w+=this.indentate(f)+"<"+F+"/"+this.tagEndChar;else if(c[F]instanceof Date)w+=this.buildTextValNode(c[F],F,"",f);else if(typeof c[F]!="object"){const N=this.isAttribute(F);if(N&&!this.ignoreAttributesFn(N,S))v+=this.buildAttrPairStr(N,""+c[F]);else if(!N)if(F===this.options.textNodeName){let U=this.options.tagValueProcessor(F,""+c[F]);w+=this.replaceEntitiesValue(U)}else w+=this.buildTextValNode(c[F],F,"",f)}else if(Array.isArray(c[F])){const N=c[F].length;let U="",$="";for(let G=0;G<N;G++){const H=c[F][G];if(!(typeof H>"u"))if(H===null)F[0]==="?"?w+=this.indentate(f)+"<"+F+"?"+this.tagEndChar:w+=this.indentate(f)+"<"+F+"/"+this.tagEndChar;else if(typeof H=="object")if(this.options.oneListGroup){const J=this.j2x(H,f+1,A.concat(F));U+=J.val,this.options.attributesGroupName&&H.hasOwnProperty(this.options.attributesGroupName)&&($+=J.attrStr)}else U+=this.processTextOrObjNode(H,F,f,A);else if(this.options.oneListGroup){let J=this.options.tagValueProcessor(F,H);J=this.replaceEntitiesValue(J),U+=J}else U+=this.buildTextValNode(H,F,"",f)}this.options.oneListGroup&&(U=this.buildObjectNode(U,F,$,f)),w+=U}else if(this.options.attributesGroupName&&F===this.options.attributesGroupName){const N=Object.keys(c[F]),U=N.length;for(let $=0;$<U;$++)v+=this.buildAttrPairStr(N[$],""+c[F][N[$]])}else w+=this.processTextOrObjNode(c[F],F,f,A);return{attrStr:v,val:w}},n.prototype.buildAttrPairStr=function(c,f){return f=this.options.attributeValueProcessor(c,""+f),f=this.replaceEntitiesValue(f),this.options.suppressBooleanAttributes&&f==="true"?" "+c:" "+c+'="'+f+'"'};function i(c,f,A,v){const w=this.j2x(c,A+1,v.concat(f));return c[this.options.textNodeName]!==void 0&&Object.keys(c).length===1?this.buildTextValNode(c[this.options.textNodeName],f,w.attrStr,A):this.buildObjectNode(w.val,f,w.attrStr,A)}n.prototype.buildObjectNode=function(c,f,A,v){if(c==="")return f[0]==="?"?this.indentate(v)+"<"+f+A+"?"+this.tagEndChar:this.indentate(v)+"<"+f+A+this.closeTag(f)+this.tagEndChar;{let w="</"+f+this.tagEndChar,S="";return f[0]==="?"&&(S="?",w=""),(A||A==="")&&c.indexOf("<")===-1?this.indentate(v)+"<"+f+A+S+">"+c+w:this.options.commentPropName!==!1&&f===this.options.commentPropName&&S.length===0?this.indentate(v)+`<!--${c}-->`+this.newLine:this.indentate(v)+"<"+f+A+S+this.tagEndChar+c+this.indentate(v)+w}},n.prototype.closeTag=function(c){let f="";return this.options.unpairedTags.indexOf(c)!==-1?this.options.suppressUnpairedNode||(f="/"):this.options.suppressEmptyNode?f="/":f=`></${c}`,f},n.prototype.buildTextValNode=function(c,f,A,v){if(this.options.cdataPropName!==!1&&f===this.options.cdataPropName)return this.indentate(v)+`<![CDATA[${c}]]>`+this.newLine;if(this.options.commentPropName!==!1&&f===this.options.commentPropName)return this.indentate(v)+`<!--${c}-->`+this.newLine;if(f[0]==="?")return this.indentate(v)+"<"+f+A+"?"+this.tagEndChar;{let w=this.options.tagValueProcessor(f,c);return w=this.replaceEntitiesValue(w),w===""?this.indentate(v)+"<"+f+A+this.closeTag(f)+this.tagEndChar:this.indentate(v)+"<"+f+A+">"+w+"</"+f+this.tagEndChar}},n.prototype.replaceEntitiesValue=function(c){if(c&&c.length>0&&this.options.processEntities)for(let f=0;f<this.options.entities.length;f++){const A=this.options.entities[f];c=c.replace(A.regex,A.val)}return c};function s(c){return this.options.indentBy.repeat(c)}function o(c){return c.startsWith(this.options.attributeNamePrefix)&&c!==this.options.textNodeName?c.substr(this.attrPrefixLen):!1}return n1=n,n1}var i1,CP;function xue(){if(CP)return i1;CP=1;const r=I6(),e=yue(),t=bue();return i1={XMLParser:e,XMLValidator:r,XMLBuilder:t},i1}var wue=xue();function TP(r,e){if(e?._parser&&e._parser!=="fast-xml-parser")throw new Error(e?._parser);const t={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:e?.removeNSPrefix,textNodeName:e?.textNodeName,isArray:(i,s,o,c)=>!!e?.arrayPaths?.some(A=>s===A),...e?._fastXML},n=Cue(r,t);return e?.uncapitalizeKeys?ux(n):n}function Cue(r,e){return new wue.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...e}).parse(r)}const Tue="4.2.4",kp={dataType:null,batchType:null,name:"XML",id:"xml",module:"xml",version:Tue,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:Eue,options:{xml:{_parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:async(r,e)=>TP(new TextDecoder().decode(r),{...kp.options.xml,...e?.xml}),parseTextSync:(r,e)=>TP(r,{...kp.options.xml,...e?.xml})};function Eue(r){return r.startsWith("<?xml")}async function Bh(r,e,t,n){return n._parse(r,e,t,n)}function Ai(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const P6=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),EP=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);EP&&parseFloat(EP[1]);function Bue(r,e){return R6(r||{},e)}function R6(r,e,t=0){if(t>3)return e;const n={...r};for(const[i,s]of Object.entries(e))s&&typeof s=="object"&&!Array.isArray(s)?n[i]=R6(n[i]||{},e[i],t+1):n[i]=e[i];return n}function Sue(r){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,r)}function Iue(r){return globalThis.loaders?.modules?.[r]||null}function Mue(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const Pue=Mue();function Rue(r,e){if(!r)throw new Error("loaders.gl assertion failed.")}const Xg=typeof process!="object"||String(process)!=="[object process]"||process.browser,yC=typeof importScripts=="function",BP=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);BP&&parseFloat(BP[1]);const s1={};async function ch(r,e=null,t={},n=null){return e&&(r=Fue(r,e,t,n)),s1[r]=s1[r]||Due(r),await s1[r]}function Fue(r,e,t={},n=null){if(!t.useLocalLibraries&&r.startsWith("http"))return r;n=n||r;const i=t.modules||{};return i[n]?i[n]:Xg?t.CDN?(Rue(t.CDN.startsWith("http")),`${t.CDN}/${e}@${Pue}/dist/libs/${n}`):yC?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}async function Due(r){if(r.endsWith("wasm"))return await Lue(r);if(!Xg)try{const{requireFromFile:t}=globalThis.loaders||{};return await t?.(r)}catch(t){return console.error(t),null}if(yC)return importScripts(r);const e=await kue(r);return Oue(e,r)}function Oue(r,e){if(!Xg){const{requireFromString:n}=globalThis.loaders||{};return n?.(r,e)}if(yC)return eval.call(globalThis,r),null;const t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(r))}catch{t.text=r}return document.body.appendChild(t),null}async function Lue(r){const{readFileAsArrayBuffer:e}=globalThis.loaders||{};return Xg||!e||r.startsWith("http")?await(await fetch(r)).arrayBuffer():await e(r)}async function kue(r){const{readFileAsText:e}=globalThis.loaders||{};return Xg||!e||r.startsWith("http")?await(await fetch(r)).text():await e(r)}function Nue(r,e=5){return typeof r=="string"?r.slice(0,e):ArrayBuffer.isView(r)?SP(r.buffer,r.byteOffset,e):r instanceof ArrayBuffer?SP(r,0,e):""}function SP(r,e,t){if(r.byteLength<=e+t)return"";const n=new DataView(r);let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(n.getUint8(e+s));return i}function F6(r){try{return JSON.parse(r)}catch{throw new Error(`Failed to parse JSON from data starting with "${Nue(r)}"`)}}function Kg(r,e,t){const n=t!==void 0?new Uint8Array(r).subarray(e,e+t):new Uint8Array(r).subarray(e);return new Uint8Array(n).buffer}function su(r,e){return Ai(r>=0),Ai(e>0),r+(e-1)&-4}function D6(r,e,t){let n;if(r instanceof ArrayBuffer)n=new Uint8Array(r);else{const i=r.byteOffset,s=r.byteLength;n=new Uint8Array(r.buffer||r.arrayBuffer,i,s)}return e.set(n,t),t+su(n.byteLength,4)}const Uue="Queued Requests",zue="Active Requests",Gue="Cancelled Requests",Vue="Queued Requests Ever",Hue="Active Requests Ever",jue={id:"request-scheduler",throttleRequests:!0,maxRequests:6,debounceTime:0};class O6{props;stats;activeRequestCount=0;requestQueue=[];requestMap=new Map;updateTimer=null;constructor(e={}){this.props={...jue,...e},this.stats=new YL({id:this.props.id}),this.stats.get(Uue),this.stats.get(zue),this.stats.get(Gue),this.stats.get(Vue),this.stats.get(Hue)}scheduleRequest(e,t=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(e))return this.requestMap.get(e);const n={handle:e,priority:0,getPriority:t},i=new Promise(s=>(n.resolve=s,n));return this.requestQueue.push(n),this.requestMap.set(e,i),this._issueNewRequests(),i}_issueRequest(e){const{handle:t,resolve:n}=e;let i=!1;const s=()=>{i||(i=!0,this.requestMap.delete(t),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:s}):Promise.resolve({done:s})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;const e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(e!==0){this._updateAllRequests();for(let t=0;t<e;++t){const n=this.requestQueue.shift();n&&this._issueRequest(n)}}}_updateAllRequests(){const e=this.requestQueue;for(let t=0;t<e.length;++t){const n=e[t];this._updateRequest(n)||(e.splice(t,1),this.requestMap.delete(n.handle),t--)}e.sort((t,n)=>t.priority-n.priority)}_updateRequest(e){return e.priority=e.getPriority(e.handle),e.priority<0?(e.resolve(null),!1):!0}}function $ue(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();const r=window.location?.pathname;return r?.slice(0,r.lastIndexOf("/")+1)||""}function L6(r){const e=r?r.lastIndexOf("/"):-1;return e>=0?r.substr(0,e):""}function Wue(...r){const e=[];for(let s=0;s<r.length;s++)e[s]=r[s];let t="",n=!1,i;for(let s=e.length-1;s>=-1&&!n;s--){let o;s>=0?o=e[s]:(i===void 0&&(i=$ue()),o=i),o.length!==0&&(t=`${o}/${t}`,n=o.charCodeAt(0)===qA)}return t=Jue(t,!n),n?`/${t}`:t.length>0?t:"."}const qA=47,o1=46;function Jue(r,e){let t="",n=-1,i=0,s,o=!1;for(let c=0;c<=r.length;++c){if(c<r.length)s=r.charCodeAt(c);else{if(s===qA)break;s=qA}if(s===qA){if(!(n===c-1||i===1))if(n!==c-1&&i===2){if(t.length<2||!o||t.charCodeAt(t.length-1)!==o1||t.charCodeAt(t.length-2)!==o1){if(t.length>2){const f=t.length-1;let A=f;for(;A>=0&&t.charCodeAt(A)!==qA;--A);if(A!==f){t=A===-1?"":t.slice(0,A),n=c,i=0,o=!1;continue}}else if(t.length===2||t.length===1){t="",n=c,i=0,o=!1;continue}}e&&(t.length>0?t+="/..":t="..",o=!0)}else{const f=r.slice(n+1,c);t.length>0?t+=`/${f}`:t=f,o=!1}n=c,i=0}else s===o1&&i!==-1?++i:i=-1}return t}class Xue{fetch;loadOptions;_needsRefresh=!0;props;constructor(e){this.props={...e},this.loadOptions={...e.loadOptions},this.fetch=Kue(this.loadOptions)}setProps(e){this.props=Object.assign(this.props,e),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(e=!0){const t=this._needsRefresh;return e&&(this._needsRefresh=!1),t}}function Kue(r){const e=r?.fetch;if(e&&typeof e=="function")return(n,i)=>e(n,i);const t=r?.fetch;return t&&typeof t!="function"?n=>fetch(n,t):n=>fetch(n)}class vC extends Xue{static type="template";static testURL=e=>!1}function que(r,e){const t=kp.parseTextSync?.(r,e),n=t?.ServiceExceptionReport?.ServiceException||t?.["ogc:ServiceExceptionReport"]?.["ogc:ServiceException"];return typeof n=="string"?n:n.value||n.code||"Unknown error"}const Yue="4.2.4",Z0={dataType:null,batchType:null,id:"wms-error",name:"WMS Error",module:"wms",version:Yue,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:Zue,options:{wms:{throwOnError:!1}},parse:async(r,e)=>a1(new TextDecoder().decode(r),e),parseSync:(r,e)=>a1(new TextDecoder().decode(r),e),parseTextSync:(r,e)=>a1(r,e)};function Zue(r){return r.startsWith("<?xml")}function a1(r,e){const t={...Z0.options.wms,...e?.wms},n=que(r,t),i=t.minimalErrors?n:`WMS Service error: ${n}`;if(t.throwOnError)throw new Error(i);return i}function Np(r){return Array.isArray(r)?r:r?[r]:[]}function My(r){const e=Np(r);return e.length>0&&e.every(t=>typeof t=="string")?e:[]}function f0(r,e=void 0){switch(typeof r){case"number":return r;case"string":return parseFloat(r);default:return}}function c1(r,e=void 0){switch(typeof r){case"number":return r;case"string":return parseInt(r,10);default:return}}function Tp(r){switch(r){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1;default:return!1}}function IP(r,e){const t=kp.parseTextSync?.(r,e),n=t.WMT_MS_Capabilities||t.WMS_Capabilities||t,i=Que(n);if(e?.inheritedLayerProps)for(const s of i.layers)N6(s,null);return e?.includeRawJSON&&(i.json=n),e?.includeXMLText&&(i.xml=r),i}function Que(r){const e={version:String(r.version||""),name:String(r.Service?.Name||"unnamed"),title:r.Service?.Title?String(r.Service?.Title):void 0,abstract:r.Service?.Abstract?String(r.Service?.Abstract):void 0,keywords:My(r.Service?.KeywordList?.Keyword),fees:r.Service?.Fees?JSON.stringify(r.Service?.Fees):void 0,accessConstraints:r.Service?.AccessConstraints?JSON.stringify(r.Service?.AccessConstraints):void 0,layerLimit:c1(r.Service?.LayerLimit),maxWidth:c1(r.Service?.maxWidth),maxHeight:c1(r.Service?.maxHeight),layers:[],requests:efe(r.Capability?.Request),exceptions:tfe(r.Exception)},t=Np(r.Capability?.Layer);for(const n of t)e.layers.push(k6(n));for(const[n,i]of Object.entries(e))i===void 0&&delete e[n];return e}function efe(r){const e={};for(const[t,n]of Object.entries(r||{})){const i=My(n?.Format);e[t]={mimeTypes:i}}return e}function tfe(r){if(Np(r?.Format).length>0)return{mimeTypes:My(r)}}function k6(r){const e={title:String(r?.Title||""),name:r?.Name&&String(r?.Name),abstract:r?.Name&&String(r?.Abstract),keywords:My(r.KeywordList?.Keyword)},t=r?.CRS||r?.SRS;t&&Array.isArray(t)&&t.every(A=>typeof A=="string")&&(e.crs=t);let n=r?.EX_GeographicBoundingBox&&rfe(r?.EX_GeographicBoundingBox);n&&(e.geographicBoundingBox=n),n=r?.LatLonBoundingBox&&nfe(r?.LatLonBoundingBox),n&&(e.geographicBoundingBox=n);const i=r?.BoundingBox&&ife(r?.BoundingBox);i&&i.length>0&&(e.boundingBoxes=i);const o=Np(r?.Dimension).map(A=>ofe(A));o.length&&(e.dimensions=o),r?.opaque&&(e.opaque=Tp(r?.opaque)),r?.cascaded&&(e.cascaded=Tp(r?.cascaded)),r?.queryable&&(e.queryable=Tp(r?.queryable));const c=Np(r?.Layer),f=[];for(const A of c)f.push(k6(A));f.length>0&&(e.layers=f);for(const[A,v]of Object.entries(e))v===void 0&&delete e[A];return e}function rfe(r){const{westBoundLongitude:e,northBoundLatitude:t,eastBoundLongitude:n,southBoundLatitude:i}=r;return[[e,i],[n,t]]}function nfe(r){const{minx:e,miny:t,maxx:n,maxy:i}=r;return[[e,t],[n,i]]}function ife(r){return Np(r).map(t=>sfe(t))}function sfe(r){const{CRS:e,SRS:t,minx:n,miny:i,maxx:s,maxy:o,resx:c,resy:f}=r,A={crs:e||t,boundingBox:[[f0(n),f0(i)],[f0(s),f0(o)]]};return c&&(A.xResolution=c),f&&(A.yResolution=f),A}function ofe(r){const{name:e,units:t,value:n}=r,i={name:e,units:t,extent:n};return r.unitSymbol&&(i.unitSymbol=r.unitSymbol),r.default&&(i.defaultValue=r.default),r.multipleValues&&(i.multipleValues=Tp(r.multipleValues)),r.nearestValue&&(i.nearestValue=Tp(r.nearestValue)),r.current&&(i.current=Tp(r.current)),i}function N6(r,e){e?.geographicBoundingBox&&!r.geographicBoundingBox&&(r.geographicBoundingBox=[...e.geographicBoundingBox]),e?.crs&&!r.crs&&(r.crs=[...e.crs]),e?.boundingBoxes&&!r.boundingBoxes&&(r.boundingBoxes=[...e.boundingBoxes]),e?.dimensions&&!r.dimensions&&(r.dimensions=[...e.dimensions]);for(const t of r.layers||[])N6(t,r)}const afe="4.2.4",bC={dataType:null,batchType:null,id:"wms-capabilities",name:"WMS Capabilities",module:"wms",version:afe,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.wms_xml","application/xml","text/xml"],testText:cfe,options:{wms:{}},parse:async(r,e)=>IP(new TextDecoder().decode(r),e?.wms),parseTextSync:(r,e)=>IP(r,e?.wms)};function cfe(r){return r.startsWith("<?xml")}function MP(r,e){const n=(kp.parseTextSync?.(r,e)).FeatureInfoResponse?.FIELDS||[];return{features:(Array.isArray(n)?n:[n]).map(s=>lfe(s))}}function lfe(r){return{attributes:r||{},type:"",bounds:{bottom:0,top:0,left:0,right:0}}}const ufe={...bC,dataType:null,id:"wms-feature-info",name:"WMS FeatureInfo",parse:async(r,e)=>MP(new TextDecoder().decode(r),e),parseTextSync:(r,e)=>MP(r,e)};function PP(r,e){return kp.parseTextSync?.(r,e)}const ffe={...bC,dataType:null,id:"wms-layer-description",name:"WMS DescribeLayer",parse:async(r,e)=>PP(new TextDecoder().decode(r),e),parseTextSync:(r,e)=>PP(r,e)};function hfe(r,e){const{type:t="auto"}=r,n=t==="auto"?pfe(r.url,e):dfe(t,e);if(!n)throw new Error("Not a valid image source type");return n.create(r)}function dfe(r,e){for(const t of e)if(t.type===r)return t;return null}function pfe(r,e){for(const t of e)if(t.testURL&&t.testURL(r))return t;return null}const Afe="4.2.4",gfe=globalThis.loaders?.parseImageNode,fx=typeof Image<"u",hx=typeof ImageBitmap<"u",mfe=!!gfe,dx=P6?!0:mfe;function _fe(r){switch(r){case"auto":return hx||fx||dx;case"imagebitmap":return hx;case"image":return fx;case"data":return dx;default:throw new Error(`@loaders.gl/images: image ${r} not supported in this environment`)}}function yfe(){if(hx)return"imagebitmap";if(fx)return"image";if(dx)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function vfe(r){const e=bfe(r);if(!e)throw new Error("Not an image");return e}function xC(r){switch(vfe(r)){case"data":return r;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=r.width,e.height=r.height,t.drawImage(r,0,0),t.getImageData(0,0,r.width,r.height);default:throw new Error("getImageData")}}function bfe(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&r instanceof Image?"image":r&&typeof r=="object"&&r.data&&r.width&&r.height?"data":null}const xfe=/^data:image\/svg\+xml/,wfe=/\.svg((\?|#).*)?$/;function wC(r){return r&&(xfe.test(r)||wfe.test(r))}function Cfe(r,e){if(wC(e)){let n=new TextDecoder().decode(r);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return U6(r,e)}function U6(r,e){if(wC(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(r)])}async function z6(r,e,t){const n=Cfe(r,t),i=self.URL||self.webkitURL,s=typeof n!="string"&&i.createObjectURL(n);try{return await Tfe(s||n,e)}finally{s&&i.revokeObjectURL(s)}}async function Tfe(r,e){const t=new Image;return t.src=r,e.image&&e.image.decode&&t.decode?(await t.decode(),t):await new Promise((n,i)=>{try{t.onload=()=>n(t),t.onerror=s=>{const o=s instanceof Error?s.message:"error";i(new Error(o))}}catch(s){i(s)}})}const Efe={};let RP=!0;async function Bfe(r,e,t){let n;wC(t)?n=await z6(r,e,t):n=U6(r,t);const i=e&&e.imagebitmap;return await Sfe(n,i)}async function Sfe(r,e=null){if((Ife(e)||!RP)&&(e=null),e)try{return await createImageBitmap(r,e)}catch(t){console.warn(t),RP=!1}return await createImageBitmap(r)}function Ife(r){for(const e in r||Efe)return!1;return!0}function Mfe(r){return!Dfe(r,"ftyp",4)||(r[8]&96)===0?null:Pfe(r)}function Pfe(r){switch(Rfe(r,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function Rfe(r,e,t){return String.fromCharCode(...r.slice(e,t))}function Ffe(r){return[...r].map(e=>e.charCodeAt(0))}function Dfe(r,e,t=0){const n=Ffe(e);for(let i=0;i<n.length;++i)if(n[i]!==r[i+t])return!1;return!0}const ol=!1,pg=!0;function Py(r){const e=qg(r);return Lfe(e)||Ufe(e)||kfe(e)||Nfe(e)||Ofe(e)}function Ofe(r){const e=new Uint8Array(r instanceof DataView?r.buffer:r),t=Mfe(e);return t?{mimeType:t.mimeType,width:0,height:0}:null}function Lfe(r){const e=qg(r);return e.byteLength>=24&&e.getUint32(0,ol)===2303741511?{mimeType:"image/png",width:e.getUint32(16,ol),height:e.getUint32(20,ol)}:null}function kfe(r){const e=qg(r);return e.byteLength>=10&&e.getUint32(0,ol)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,pg),height:e.getUint16(8,pg)}:null}function Nfe(r){const e=qg(r);return e.byteLength>=14&&e.getUint16(0,ol)===16973&&e.getUint32(2,pg)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,pg),height:e.getUint32(22,pg)}:null}function Ufe(r){const e=qg(r);if(!(e.byteLength>=3&&e.getUint16(0,ol)===65496&&e.getUint8(2)===255))return null;const{tableMarkers:n,sofMarkers:i}=zfe();let s=2;for(;s+9<e.byteLength;){const o=e.getUint16(s,ol);if(i.has(o))return{mimeType:"image/jpeg",height:e.getUint16(s+5,ol),width:e.getUint16(s+7,ol)};if(!n.has(o))return null;s+=2,s+=e.getUint16(s,ol)}return null}function zfe(){const r=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)r.add(t);return{tableMarkers:r,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function qg(r){if(r instanceof DataView)return r;if(ArrayBuffer.isView(r))return new DataView(r.buffer);if(r instanceof ArrayBuffer)return new DataView(r);throw new Error("toDataView")}async function Gfe(r,e){const{mimeType:t}=Py(r)||{},n=globalThis.loaders?.parseImageNode;return Ai(n),await n(r,t)}async function Vfe(r,e,t){e=e||{};const i=(e.image||{}).type||"auto",{url:s}=t||{},o=Hfe(i);let c;switch(o){case"imagebitmap":c=await Bfe(r,e,s);break;case"image":c=await z6(r,e,s);break;case"data":c=await Gfe(r);break;default:Ai(!1)}return i==="data"&&(c=xC(c)),c}function Hfe(r){switch(r){case"auto":case"data":return yfe();default:return _fe(r),r}}const jfe=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],$fe=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Wfe={image:{type:"auto",decode:!0}},Pg={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:Afe,mimeTypes:$fe,extensions:jfe,parse:Vfe,tests:[r=>!!Py(new DataView(r))],options:Wfe},l1={};function G6(r){if(l1[r]===void 0){const e=P6?Xfe(r):Jfe(r);l1[r]=e}return l1[r]}function Jfe(r){const e=["image/png","image/jpeg","image/gif"],t=globalThis.loaders?.imageFormatsNode||e;return!!globalThis.loaders?.parseImageNode&&t.includes(r)}function Xfe(r){switch(r){case"image/avif":case"image/webp":return Kfe(r);default:return!0}}function Kfe(r){try{return document.createElement("canvas").toDataURL(r).indexOf(`data:${r}`)===0}catch{return!1}}const qfe={type:"wms",testURL:r=>r.toLowerCase().includes("wms"),create:r=>new Yfe(r)};class Yfe extends vC{url;data;substituteCRS84;flipCRS;wmsParameters;vendorParameters;capabilities=null;constructor(e){super(e),this.url=e.url,this.data=e.url,this.substituteCRS84=e.substituteCRS84??!1,this.flipCRS=["EPSG:4326"],this.wmsParameters={layers:void 0,query_layers:void 0,styles:void 0,version:"1.3.0",crs:"EPSG:4326",format:"image/png",info_format:"text/plain",transparent:void 0,time:void 0,elevation:void 0,...e.wmsParameters},this.vendorParameters=e.vendorParameters||{}}async getMetadata(){const e=await this.getCapabilities();return this.normalizeMetadata(e)}async getImage(e){const{boundingBox:t,bbox:n,...i}=e,s={bbox:t?[...t[0],...t[1]]:n,...i};return await this.getMap(s)}normalizeMetadata(e){return e}async getCapabilities(e,t){const n=this.getCapabilitiesURL(e,t),i=await this.fetch(n),s=await i.arrayBuffer();this._checkResponse(i,s);const o=await bC.parse(s,this.loadOptions);return this.capabilities=o,o}async getMap(e,t){const n=this.getMapURL(e,t),i=await this.fetch(n),s=await i.arrayBuffer();this._checkResponse(i,s);try{return await Pg.parse(s,this.loadOptions)}catch{throw this._parseError(s)}}async getFeatureInfo(e,t){const n=this.getFeatureInfoURL(e,t),i=await this.fetch(n),s=await i.arrayBuffer();return this._checkResponse(i,s),await ufe.parse(s,this.loadOptions)}async getFeatureInfoText(e,t){const n=this.getFeatureInfoURL(e,t),i=await this.fetch(n),s=await i.arrayBuffer();return this._checkResponse(i,s),new TextDecoder().decode(s)}async describeLayer(e,t){const n=this.describeLayerURL(e,t),i=await this.fetch(n),s=await i.arrayBuffer();return this._checkResponse(i,s),await ffe.parse(s,this.loadOptions)}async getLegendGraphic(e,t){const n=this.getLegendGraphicURL(e,t),i=await this.fetch(n),s=await i.arrayBuffer();this._checkResponse(i,s);try{return await Pg.parse(s,this.loadOptions)}catch{throw this._parseError(s)}}getCapabilitiesURL(e,t){const n={version:this.wmsParameters.version,...e};return this._getWMSUrl("GetCapabilities",n,t)}getMapURL(e,t){e=this._getWMS130Parameters(e);const n={version:this.wmsParameters.version,format:this.wmsParameters.format,transparent:this.wmsParameters.transparent,time:this.wmsParameters.time,elevation:this.wmsParameters.elevation,layers:this.wmsParameters.layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...e};return this._getWMSUrl("GetMap",n,t)}getFeatureInfoURL(e,t){e=this._getWMS130Parameters(e);const{boundingBox:n,bbox:i}=e;e.bbox=n?[...n[0],...n[1]]:i;const s={version:this.wmsParameters.version,info_format:this.wmsParameters.info_format,layers:this.wmsParameters.layers,query_layers:this.wmsParameters.query_layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...e};return this._getWMSUrl("GetFeatureInfo",s,t)}describeLayerURL(e,t){const n={version:this.wmsParameters.version,...e};return this._getWMSUrl("DescribeLayer",n,t)}getLegendGraphicURL(e,t){const n={version:this.wmsParameters.version,...e};return this._getWMSUrl("GetLegendGraphic",n,t)}_parseWMSUrl(e){const[t,n]=e.split("?"),i=n.split("&"),s={};for(const o of i){const[c,f]=o.split("=");s[c]=f}return{url:t,parameters:s}}_getWMSUrl(e,t,n){let i=this.url,s=!0;const o={service:"WMS",version:t.version,request:e,...t,...this.vendorParameters,...n},c=["transparent","time","elevation"];for(const[f,A]of Object.entries(o))(!c.includes(f)||A)&&(i+=s?"?":"&",s=!1,i+=this._getURLParameter(f,A,t));return encodeURI(i)}_getWMS130Parameters(e){const t={...e};return t.srs&&(t.crs=t.crs||t.srs,delete t.srs),t}_getURLParameter(e,t,n){switch(e){case"crs":n.version!=="1.3.0"?e="srs":this.substituteCRS84&&t==="EPSG:4326"&&(t="CRS:84");break;case"srs":n.version==="1.3.0"&&(e="crs");break;case"bbox":const i=this._flipBoundingBox(t,n);i&&(t=i);break;case"x":n.version==="1.3.0"&&(e="i");break;case"y":n.version==="1.3.0"&&(e="j");break}return e=e.toUpperCase(),Array.isArray(t)?`${e}=${t.join(",")}`:`${e}=${t?String(t):""}`}_flipBoundingBox(e,t){if(!Array.isArray(e)||e.length!==4)return null;const n=t.version==="1.3.0"&&this.flipCRS.includes(t.crs||"")&&!(this.substituteCRS84&&t.crs==="EPSG:4326"),i=e;return n?[i[1],i[0],i[3],i[2]]:i}async _fetchArrayBuffer(e){const t=await this.fetch(e),n=await t.arrayBuffer();return this._checkResponse(t,n),n}_checkResponse(e,t){const n=e.headers["content-type"];if(!e.ok||Z0.mimeTypes.includes(n)){const i=Bue(this.loadOptions,{wms:{throwOnError:!0}}),s=Z0.parseSync?.(t,i);throw new Error(s)}}_parseError(e){const t=Z0.parseSync?.(e,this.loadOptions);return new Error(t)}}class Zfe extends vC{static type="template";static testURL=e=>e.toLowerCase().includes("{");constructor(e){super(e)}async getMetadata(){throw new Error("ImageSource.getMetadata not implemented")}async getImage(e){const t=this.getGranularParameters(e),n=this.getURLFromTemplate(t),s=await(await this.fetch(n)).arrayBuffer();return await Pg.parse(s)}getGranularParameters(e){const[[t,n],[i,s]]=e.boundingBox;return{...e,east:t,north:n,south:s,west:i}}getURLFromTemplate(e){let t=this.props.url;for(const[n,i]of Object.entries(e))t=t.replace(`\${${n}}`,String(i)),t=t.replace(`{${n}}`,String(i));return t}}class Qfe extends Zfe{data;constructor(e){super(e),this.data=e.url}async getMetadata(){return await this.metadata()}async getImage(e){throw new Error("not implemented")}async metadata(){throw new Error("not implemented")}exportImage(e){throw new Error("not implemented")}metadataURL(e){return`${this.props.url}?f=pjson`}exportImageURL(e){const t=`bbox=${e.bbox[0]},${e.bbox[1]},${e.bbox[2]},${e.bbox[3]}`,n=`size=${e.width},${e.height}`,i={...e,bbox:t,size:n};return delete i.width,delete i.height,this.getUrl("exportImage",i)}getUrl(e,t,n){let i=`${this.props.url}/${e}`,s=!0;for(const[o,c]of Object.entries(t))i+=s?"?":"&",s=!1,Array.isArray(c)?i+=`${o.toUpperCase()}=${c.join(",")}`:i+=`${o.toUpperCase()}=${c?String(c):""}`;return i}async checkResponse(e){if(!e.ok)throw new Error("error")}}const ehe={type:"arcgis-image-server",testURL:r=>r.toLowerCase().includes("ImageServer"),create:r=>new Qfe(r)},the=[qfe,ehe];function rhe(r){return hfe(r,the)}const FP=6378137*Math.PI;function DP(r){const e=eu(r);return e[0]=(e[0]/256-1)*FP,e[1]=(e[1]/256-1)*FP,e}const nhe={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:()=>{}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:()=>{}},onImageLoad:{type:"function",value:()=>{}},onImageLoadError:{type:"function",compare:!1,value:(r,e)=>console.error(e,r)}};class CC extends Bs{get isLoaded(){return this.state?.loadCounter===0&&super.isLoaded}shouldUpdateState(){return!0}initializeState(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0}updateState({changeFlags:e,props:t,oldProps:n}){const{viewport:i}=this.context;e.dataChanged||t.serviceType!==n.serviceType?(this.state.imageSource=this._createImageSource(t),this._loadMetadata(),this.debounce(()=>this.loadImage(i,"image source changed"),0)):rs(t.layers,n.layers,1)?e.viewportChanged&&this.debounce(()=>this.loadImage(i,"viewport changed")):this.debounce(()=>this.loadImage(i,"layers changed"),0)}finalizeState(){}renderLayers(){const{bounds:e,image:t,lastRequestParameters:n}=this.state;return t&&new By({...this.getSubLayerProps({id:"bitmap"}),_imageCoordinateSystem:n.srs==="EPSG:4326"?Qr.LNGLAT:Qr.CARTESIAN,bounds:e,image:t})}async getFeatureInfoText(e,t){const{lastRequestParameters:n}=this.state;return n?await this.state.imageSource.getFeatureInfoText?.({...n,query_layers:n.layers,x:e,y:t,info_format:"application/vnd.ogc.gml"}):""}_createImageSource(e){if(e.data instanceof vC)return e.data;if(typeof e.data=="string")return rhe({url:e.data,loadOptions:e.loadOptions,type:e.serviceType});throw new Error("invalid image source in props.data")}async _loadMetadata(){const{imageSource:e}=this.state;try{this.state.loadCounter++;const t=await e.getMetadata();this.state.imageSource===e&&this.getCurrentLayer()?.props.onMetadataLoad(t)}catch(t){this.getCurrentLayer()?.props.onMetadataLoadError(t)}finally{this.state.loadCounter--}}async loadImage(e,t){const{layers:n,serviceType:i}=this.props;if(i==="wms"&&n.length===0)return;const s=e.getBounds(),{width:o,height:c}=e,f=this.getRequestId();let{srs:A}=this.props;A==="auto"&&(A=e.resolution?"EPSG:4326":"EPSG:3857");const v={width:o,height:c,boundingBox:[[s[0],s[1]],[s[2],s[3]]],layers:n,crs:A};if(A==="EPSG:3857"){const w=DP([s[0],s[1]]),S=DP([s[2],s[3]]);v.boundingBox=[w,S]}try{this.state.loadCounter++,this.props.onImageLoadStart(f);const w=await this.state.imageSource.getImage(v);this.state.lastRequestId<f&&(this.getCurrentLayer()?.props.onImageLoad(f),this.setState({image:w,bounds:s,lastRequestParameters:v,lastRequestId:f}))}catch(w){this.raiseError(w,"Load image"),this.getCurrentLayer()?.props.onImageLoadError(f,w)}finally{this.state.loadCounter--}}getRequestId(){return this.state._nextRequestId++}debounce(e,t=500){clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout(()=>e(),t)}}CC.layerName="WMSLayer";CC.defaultProps=nhe;const ihe={getHeight:{type:"accessor",value:0},greatCircle:!0};class TC extends jg{}TC.layerName="GreatCircleLayer";TC.defaultProps=ihe;const she={...hf.defaultProps};class df extends Bs{indexToBounds(){return null}renderLayers(){const{elevationScale:e,extruded:t,wireframe:n,filled:i,stroked:s,lineWidthUnits:o,lineWidthScale:c,lineWidthMinPixels:f,lineWidthMaxPixels:A,lineJointRounded:v,lineMiterLimit:w,lineDashJustified:S,getElevation:F,getFillColor:N,getLineColor:U,getLineWidth:$}=this.props,{updateTriggers:G,material:H,transitions:J}=this.props,ue=this.getSubLayerClass("cell",hf),{updateTriggers:q,...se}=this.indexToBounds()||{};return new ue({filled:i,wireframe:n,extruded:t,elevationScale:e,stroked:s,lineWidthUnits:o,lineWidthScale:c,lineWidthMinPixels:f,lineWidthMaxPixels:A,lineJointRounded:v,lineMiterLimit:w,lineDashJustified:S,material:H,transitions:J,getElevation:F,getFillColor:N,getLineColor:U,getLineWidth:$},this.getSubLayerProps({id:"cell",updateTriggers:G&&{...q,getElevation:G.getElevation,getFillColor:G.getFillColor,getLineColor:G.getLineColor,getLineWidth:G.getLineWidth}}),se)}}df.layerName="GeoCellLayer";df.defaultProps=she;function ohe(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Q0={exports:{}},ahe=Q0.exports,OP;function che(){return OP||(OP=1,function(r){/**
4201
- * @license long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
4202
- * Released under the Apache License, Version 2.0
4203
- * see: https://github.com/dcodeIO/long.js for details
4204
- */(function(e,t){typeof ohe=="function"&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(ahe,function(){function e(me,pe,W){this.low=me|0,this.high=pe|0,this.unsigned=!!W}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1});function t(me){return(me&&me.__isLong__)===!0}e.isLong=t;var n={},i={};function s(me,pe){var W,re,Ee;return pe?(me>>>=0,(Ee=0<=me&&me<256)&&(re=i[me],re)?re:(W=c(me,(me|0)<0?-1:0,!0),Ee&&(i[me]=W),W)):(me|=0,(Ee=-128<=me&&me<128)&&(re=n[me],re)?re:(W=c(me,me<0?-1:0,!1),Ee&&(n[me]=W),W))}e.fromInt=s;function o(me,pe){if(isNaN(me)||!isFinite(me))return pe?H:G;if(pe){if(me<0)return H;if(me>=N)return Te}else{if(me<=-U)return Ue;if(me+1>=U)return se}return me<0?o(-me,pe).neg():c(me%F|0,me/F|0,pe)}e.fromNumber=o;function c(me,pe,W){return new e(me,pe,W)}e.fromBits=c;var f=Math.pow;function A(me,pe,W){if(me.length===0)throw Error("empty string");if(me==="NaN"||me==="Infinity"||me==="+Infinity"||me==="-Infinity")return G;if(typeof pe=="number"?(W=pe,pe=!1):pe=!!pe,W=W||10,W<2||36<W)throw RangeError("radix");var re;if((re=me.indexOf("-"))>0)throw Error("interior hyphen");if(re===0)return A(me.substring(1),pe,W).neg();for(var Ee=o(f(W,8)),et=G,_e=0;_e<me.length;_e+=8){var Le=Math.min(8,me.length-_e),Ge=parseInt(me.substring(_e,_e+Le),W);if(Le<8){var Ze=o(f(W,Le));et=et.mul(Ze).add(o(Ge))}else et=et.mul(Ee),et=et.add(o(Ge))}return et.unsigned=pe,et}e.fromString=A;function v(me){return me instanceof e?me:typeof me=="number"?o(me):typeof me=="string"?A(me):c(me.low,me.high,me.unsigned)}e.fromValue=v;var w=65536,S=1<<24,F=w*w,N=F*F,U=N/2,$=s(S),G=s(0);e.ZERO=G;var H=s(0,!0);e.UZERO=H;var J=s(1);e.ONE=J;var ue=s(1,!0);e.UONE=ue;var q=s(-1);e.NEG_ONE=q;var se=c(-1,2147483647,!1);e.MAX_VALUE=se;var Te=c(-1,-1,!0);e.MAX_UNSIGNED_VALUE=Te;var Ue=c(0,-2147483648,!1);e.MIN_VALUE=Ue;var de=e.prototype;return de.toInt=function(){return this.unsigned?this.low>>>0:this.low},de.toNumber=function(){return this.unsigned?(this.high>>>0)*F+(this.low>>>0):this.high*F+(this.low>>>0)},de.toString=function(pe){if(pe=pe||10,pe<2||36<pe)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(Ue)){var W=o(pe),re=this.div(W),Ee=re.mul(W).sub(this);return re.toString(pe)+Ee.toInt().toString(pe)}else return"-"+this.neg().toString(pe);for(var et=o(f(pe,6),this.unsigned),_e=this,Le="";;){var Ge=_e.div(et),Ze=_e.sub(Ge.mul(et)).toInt()>>>0,tt=Ze.toString(pe);if(_e=Ge,_e.isZero())return tt+Le;for(;tt.length<6;)tt="0"+tt;Le=""+tt+Le}},de.getHighBits=function(){return this.high},de.getHighBitsUnsigned=function(){return this.high>>>0},de.getLowBits=function(){return this.low},de.getLowBitsUnsigned=function(){return this.low>>>0},de.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Ue)?64:this.neg().getNumBitsAbs();for(var pe=this.high!=0?this.high:this.low,W=31;W>0&&(pe&1<<W)==0;W--);return this.high!=0?W+33:W+1},de.isZero=function(){return this.high===0&&this.low===0},de.isNegative=function(){return!this.unsigned&&this.high<0},de.isPositive=function(){return this.unsigned||this.high>=0},de.isOdd=function(){return(this.low&1)===1},de.isEven=function(){return(this.low&1)===0},de.equals=function(pe){return t(pe)||(pe=v(pe)),this.unsigned!==pe.unsigned&&this.high>>>31===1&&pe.high>>>31===1?!1:this.high===pe.high&&this.low===pe.low},de.eq=de.equals,de.notEquals=function(pe){return!this.eq(pe)},de.neq=de.notEquals,de.lessThan=function(pe){return this.comp(pe)<0},de.lt=de.lessThan,de.lessThanOrEqual=function(pe){return this.comp(pe)<=0},de.lte=de.lessThanOrEqual,de.greaterThan=function(pe){return this.comp(pe)>0},de.gt=de.greaterThan,de.greaterThanOrEqual=function(pe){return this.comp(pe)>=0},de.gte=de.greaterThanOrEqual,de.compare=function(pe){if(t(pe)||(pe=v(pe)),this.eq(pe))return 0;var W=this.isNegative(),re=pe.isNegative();return W&&!re?-1:!W&&re?1:this.unsigned?pe.high>>>0>this.high>>>0||pe.high===this.high&&pe.low>>>0>this.low>>>0?-1:1:this.sub(pe).isNegative()?-1:1},de.comp=de.compare,de.negate=function(){return!this.unsigned&&this.eq(Ue)?Ue:this.not().add(J)},de.neg=de.negate,de.add=function(pe){t(pe)||(pe=v(pe));var W=this.high>>>16,re=this.high&65535,Ee=this.low>>>16,et=this.low&65535,_e=pe.high>>>16,Le=pe.high&65535,Ge=pe.low>>>16,Ze=pe.low&65535,tt=0,rt=0,ut=0,vt=0;return vt+=et+Ze,ut+=vt>>>16,vt&=65535,ut+=Ee+Ge,rt+=ut>>>16,ut&=65535,rt+=re+Le,tt+=rt>>>16,rt&=65535,tt+=W+_e,tt&=65535,c(ut<<16|vt,tt<<16|rt,this.unsigned)},de.subtract=function(pe){return t(pe)||(pe=v(pe)),this.add(pe.neg())},de.sub=de.subtract,de.multiply=function(pe){if(this.isZero()||(t(pe)||(pe=v(pe)),pe.isZero()))return G;if(this.eq(Ue))return pe.isOdd()?Ue:G;if(pe.eq(Ue))return this.isOdd()?Ue:G;if(this.isNegative())return pe.isNegative()?this.neg().mul(pe.neg()):this.neg().mul(pe).neg();if(pe.isNegative())return this.mul(pe.neg()).neg();if(this.lt($)&&pe.lt($))return o(this.toNumber()*pe.toNumber(),this.unsigned);var W=this.high>>>16,re=this.high&65535,Ee=this.low>>>16,et=this.low&65535,_e=pe.high>>>16,Le=pe.high&65535,Ge=pe.low>>>16,Ze=pe.low&65535,tt=0,rt=0,ut=0,vt=0;return vt+=et*Ze,ut+=vt>>>16,vt&=65535,ut+=Ee*Ze,rt+=ut>>>16,ut&=65535,ut+=et*Ge,rt+=ut>>>16,ut&=65535,rt+=re*Ze,tt+=rt>>>16,rt&=65535,rt+=Ee*Ge,tt+=rt>>>16,rt&=65535,rt+=et*Le,tt+=rt>>>16,rt&=65535,tt+=W*Ze+re*Ge+Ee*Le+et*_e,tt&=65535,c(ut<<16|vt,tt<<16|rt,this.unsigned)},de.mul=de.multiply,de.divide=function(pe){if(t(pe)||(pe=v(pe)),pe.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?H:G;var W,re,Ee;if(this.unsigned){if(pe.unsigned||(pe=pe.toUnsigned()),pe.gt(this))return H;if(pe.gt(this.shru(1)))return ue;Ee=H}else{if(this.eq(Ue)){if(pe.eq(J)||pe.eq(q))return Ue;if(pe.eq(Ue))return J;var et=this.shr(1);return W=et.div(pe).shl(1),W.eq(G)?pe.isNegative()?J:q:(re=this.sub(pe.mul(W)),Ee=W.add(re.div(pe)),Ee)}else if(pe.eq(Ue))return this.unsigned?H:G;if(this.isNegative())return pe.isNegative()?this.neg().div(pe.neg()):this.neg().div(pe).neg();if(pe.isNegative())return this.div(pe.neg()).neg();Ee=G}for(re=this;re.gte(pe);){W=Math.max(1,Math.floor(re.toNumber()/pe.toNumber()));for(var _e=Math.ceil(Math.log(W)/Math.LN2),Le=_e<=48?1:f(2,_e-48),Ge=o(W),Ze=Ge.mul(pe);Ze.isNegative()||Ze.gt(re);)W-=Le,Ge=o(W,this.unsigned),Ze=Ge.mul(pe);Ge.isZero()&&(Ge=J),Ee=Ee.add(Ge),re=re.sub(Ze)}return Ee},de.div=de.divide,de.modulo=function(pe){return t(pe)||(pe=v(pe)),this.sub(this.div(pe).mul(pe))},de.mod=de.modulo,de.not=function(){return c(~this.low,~this.high,this.unsigned)},de.and=function(pe){return t(pe)||(pe=v(pe)),c(this.low&pe.low,this.high&pe.high,this.unsigned)},de.or=function(pe){return t(pe)||(pe=v(pe)),c(this.low|pe.low,this.high|pe.high,this.unsigned)},de.xor=function(pe){return t(pe)||(pe=v(pe)),c(this.low^pe.low,this.high^pe.high,this.unsigned)},de.shiftLeft=function(pe){return t(pe)&&(pe=pe.toInt()),(pe&=63)===0?this:pe<32?c(this.low<<pe,this.high<<pe|this.low>>>32-pe,this.unsigned):c(0,this.low<<pe-32,this.unsigned)},de.shl=de.shiftLeft,de.shiftRight=function(pe){return t(pe)&&(pe=pe.toInt()),(pe&=63)===0?this:pe<32?c(this.low>>>pe|this.high<<32-pe,this.high>>pe,this.unsigned):c(this.high>>pe-32,this.high>=0?0:-1,this.unsigned)},de.shr=de.shiftRight,de.shiftRightUnsigned=function(pe){if(t(pe)&&(pe=pe.toInt()),pe&=63,pe===0)return this;var W=this.high;if(pe<32){var re=this.low;return c(re>>>pe|W<<32-pe,W>>>pe,this.unsigned)}else return pe===32?c(W,0,this.unsigned):c(W>>>pe-32,0,this.unsigned)},de.shru=de.shiftRightUnsigned,de.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},de.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},de.toBytes=function(me){return me?this.toBytesLE():this.toBytesBE()},de.toBytesLE=function(){var me=this.high,pe=this.low;return[pe&255,pe>>>8&255,pe>>>16&255,pe>>>24&255,me&255,me>>>8&255,me>>>16&255,me>>>24&255]},de.toBytesBE=function(){var me=this.high,pe=this.low;return[me>>>24&255,me>>>16&255,me>>>8&255,me&255,pe>>>24&255,pe>>>16&255,pe>>>8&255,pe&255]},e})}(Q0)),Q0.exports}var lhe=che();const e_=_h(lhe),uhe=3,fhe=30,hhe=2*fhe+1,LP=180/Math.PI;function dhe(r,e,t){const n=1<<e;return[(r[0]+t[0])/n,(r[1]+t[1])/n]}function kP(r){return r>=.5?1/3*(4*r*r-1):1/3*(1-4*(1-r)*(1-r))}function phe(r){return[kP(r[0]),kP(r[1])]}function Ahe(r,[e,t]){switch(r){case 0:return[1,e,t];case 1:return[-e,1,t];case 2:return[-e,-t,1];case 3:return[-1,-t,-e];case 4:return[t,-1,-e];case 5:return[t,e,-1];default:throw new Error("Invalid face")}}function ghe([r,e,t]){const n=Math.atan2(t,Math.sqrt(r*r+e*e));return[Math.atan2(e,r)*LP,n*LP]}function mhe(r){let e=e_.fromString(r,!0,10).toString(2);for(;e.length<uhe+hhe;)e="0"+e;const t=e.lastIndexOf("1"),n=e.substring(0,3),i=e.substring(3,t),s=i.length/2,o=e_.fromString(n,!0,2).toString(10);let c=e_.fromString(i,!0,2).toString(4);for(;c.length<s;)c="0"+c;return`${o}/${c}`}function _he(r,e,t,n){if(n===0){t===1&&(e[0]=r-1-e[0],e[1]=r-1-e[1]);const i=e[0];e[0]=e[1],e[1]=i}}function yhe(r){const e=r.split("/"),t=parseInt(e[0],10),n=e[1],i=n.length,s=[0,0];let o;for(let c=i-1;c>=0;c--){o=i-c;const f=n[c];let A=0,v=0;f==="1"?v=1:f==="2"?(A=1,v=1):f==="3"&&(A=1);const w=Math.pow(2,o-1);_he(w,s,A,v),s[0]+=w*A,s[1]+=w*v}if(t%2===1){const c=s[0];s[0]=s[1],s[1]=c}return{face:t,ij:s,level:o}}function vhe(r){const e=r.padEnd(16,"0");return e_.fromString(e,16)}const bhe=100;function xhe({face:r,ij:e,level:t}){const n=[[0,0],[0,1],[1,1],[1,0],[0,0]],i=Math.max(1,Math.ceil(bhe*Math.pow(2,-t))),s=new Float64Array(4*i*2+2);let o=0,c=0;for(let f=0;f<4;f++){const A=n[f].slice(0),v=n[f+1],w=(v[0]-A[0])/i,S=(v[1]-A[1])/i;for(let F=0;F<i;F++){A[0]+=w,A[1]+=S;const N=dhe(e,t,A),U=phe(N),$=Ahe(r,U),G=ghe($);Math.abs(G[1])>89.999&&(G[0]=c);const H=G[0]-c;G[0]+=H>180?-360:H<-180?360:0,s[o++]=G[0],s[o++]=G[1],c=G[0]}}return s[o++]=s[0],s[o++]=s[1],s}function whe(r){if(typeof r=="string"){if(r.indexOf("/")>0)return r;r=vhe(r)}return mhe(r.toString())}function Che(r){const e=whe(r),t=yhe(e);return xhe(t)}const The={getS2Token:{type:"accessor",value:r=>r.token}};class Ry extends df{indexToBounds(){const{data:e,getS2Token:t}=this.props;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(n,i)=>Che(t(n,i))}}}Ry.layerName="S2Layer";Ry.defaultProps=The;const u1=512;function Ehe(r,e){let t=0,n=0,i=1<<r.length;const s=i/u1;for(let o=0;o<r.length;o++){i>>=1;const c=parseInt(r[o]);c%2&&(t|=i),c>1&&(n|=i)}return[[t/s,u1-n/s],[(t+e)/s,u1-(n+e)/s]]}function Bhe(r,e=1){const[t,n]=Ehe(r,e),[i,s]=hl(t),[o,c]=hl(n);return[o,s,o,c,i,c,i,s,o,s]}const She={getQuadkey:{type:"accessor",value:r=>r.quadkey}};class Fy extends df{indexToBounds(){const{data:e,extruded:t,getQuadkey:n}=this.props,i=t?.99:1;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(s,o)=>Bhe(n(s,o),i),updateTriggers:{getPolygon:i}}}}Fy.layerName="QuadkeyLayer";Fy.defaultProps=She;class V6{constructor(e){this.index=e,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get bbox(){return this._bbox}set bbox(e){this._bbox||(this._bbox=e,"west"in e?this.boundingBox=[[e.west,e.south],[e.east,e.north]]:this.boundingBox=[[e.left,e.top],[e.right,e.bottom]])}get data(){return this.isLoading&&this._loader?this._loader.then(()=>this.data):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return!!this._loader&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){const e=this.content?this.content.byteLength:0;return Number.isFinite(e)||console.error("byteLength not defined in tile data"),e}async _loadData({getData:e,requestScheduler:t,onLoad:n,onError:i}){const{index:s,id:o,bbox:c,userData:f,zoom:A}=this,v=this._loaderId;this._abortController=new AbortController;const{signal:w}=this._abortController,S=await t.scheduleRequest(this,U=>U.isSelected?1:-1);if(!S){this._isCancelled=!0;return}if(this._isCancelled){S.done();return}let F=null,N;try{F=await e({index:s,id:o,bbox:c,userData:f,zoom:A,signal:w})}catch(U){N=U||!0}finally{S.done()}if(v===this._loaderId){if(this._loader=void 0,this.content=F,this._isCancelled&&!F){this._isLoaded=!1;return}this._isLoaded=!0,this._isCancelled=!1,N?i(N,this):n(this)}}loadData(e){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(e),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){this.isLoaded||(this._isCancelled=!0,this._abortController?.abort())}}const go={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},NP=new dt,Ihe=new dt;class EC{constructor(e=[0,0,0],t=[0,0,0],n){n=n||NP.copy(e).add(t).scale(.5),this.center=new dt(n),this.halfDiagonal=new dt(t).subtract(this.center),this.minimum=new dt(e),this.maximum=new dt(t)}clone(){return new EC(this.minimum,this.maximum,this.center)}equals(e){return this===e||!!e&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}transform(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}intersectPlane(e){const{halfDiagonal:t}=this,n=Ihe.from(e.normal),i=t.x*Math.abs(n.x)+t.y*Math.abs(n.y)+t.z*Math.abs(n.z),s=this.center.dot(n)+e.distance;return s-i>0?go.INSIDE:s+i<0?go.OUTSIDE:go.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=NP.from(e).subtract(this.center),{halfDiagonal:n}=this;let i=0,s;return s=Math.abs(t.x)-n.x,s>0&&(i+=s*s),s=Math.abs(t.y)-n.y,s>0&&(i+=s*s),s=Math.abs(t.z)-n.z,s>0&&(i+=s*s),i}}const LA=new dt,UP=new dt;class Yg{constructor(e=[0,0,0],t=0){this.radius=-0,this.center=new dt,this.fromCenterRadius(e,t)}fromCenterRadius(e,t){return this.center.from(e),this.radius=t,this}fromCornerPoints(e,t){return t=LA.from(t),this.center=new dt().from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}equals(e){return this===e||!!e&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new Yg(this.center,this.radius)}union(e){const t=this.center,n=this.radius,i=e.center,s=e.radius,o=LA.copy(i).subtract(t),c=o.magnitude();if(n>=c+s)return this.clone();if(s>=c+n)return e.clone();const f=(n+c+s)*.5;return UP.copy(o).scale((-n+f)/c).add(t),this.center.copy(UP),this.radius=f,this}expand(e){const n=LA.from(e).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(e){this.center.transform(e);const t=ej(LA,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){const t=this.distanceTo(e);return t*t}distanceTo(e){const n=LA.from(e).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(e){const t=this.center,n=this.radius,s=e.normal.dot(t)+e.distance;return s<-n?go.OUTSIDE:s<n?go.INTERSECTING:go.INSIDE}}const Mhe=new dt,Phe=new dt,h0=new dt,d0=new dt,p0=new dt,Rhe=new dt,Fhe=new dt,Hl={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8};class Zg{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){this.center=new dt().from(e),this.halfAxes=new gi(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new dt(e).len(),new dt(t).len(),new dt(n).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new dt(e).normalize(),s=new dt(t).normalize(),o=new dt(n).normalize();return new vg().fromMatrix3(new gi([...i,...s,...o]))}fromCenterHalfSizeQuaternion(e,t,n){const i=new vg(n),s=new gi().fromQuaternion(i);return s[0]=s[0]*t[0],s[1]=s[1]*t[0],s[2]=s[2]*t[0],s[3]=s[3]*t[1],s[4]=s[4]*t[1],s[5]=s[5]*t[1],s[6]=s[6]*t[2],s[7]=s[7]*t[2],s[8]=s[8]*t[2],this.center=new dt().from(e),this.halfAxes=s,this}clone(){return new Zg(this.center,this.halfAxes)}equals(e){return this===e||!!e&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new Yg){const t=this.halfAxes,n=t.getColumn(0,h0),i=t.getColumn(1,d0),s=t.getColumn(2,p0),o=Mhe.copy(n).add(i).add(s);return e.center.copy(this.center),e.radius=o.magnitude(),e}intersectPlane(e){const t=this.center,n=e.normal,i=this.halfAxes,s=n.x,o=n.y,c=n.z,f=Math.abs(s*i[Hl.COLUMN0ROW0]+o*i[Hl.COLUMN0ROW1]+c*i[Hl.COLUMN0ROW2])+Math.abs(s*i[Hl.COLUMN1ROW0]+o*i[Hl.COLUMN1ROW1]+c*i[Hl.COLUMN1ROW2])+Math.abs(s*i[Hl.COLUMN2ROW0]+o*i[Hl.COLUMN2ROW1]+c*i[Hl.COLUMN2ROW2]),A=n.dot(t)+e.distance;return A<=-f?go.OUTSIDE:A>=f?go.INSIDE:go.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=Phe.from(e).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,h0),s=n.getColumn(1,d0),o=n.getColumn(2,p0),c=i.magnitude(),f=s.magnitude(),A=o.magnitude();i.normalize(),s.normalize(),o.normalize();let v=0,w;return w=Math.abs(t.dot(i))-c,w>0&&(v+=w*w),w=Math.abs(t.dot(s))-f,w>0&&(v+=w*w),w=Math.abs(t.dot(o))-A,w>0&&(v+=w*w),v}computePlaneDistances(e,t,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;const o=this.center,c=this.halfAxes,f=c.getColumn(0,h0),A=c.getColumn(1,d0),v=c.getColumn(2,p0),w=Rhe.copy(f).add(A).add(v).add(o),S=Fhe.copy(w).subtract(e);let F=t.dot(S);return i=Math.min(F,i),s=Math.max(F,s),w.copy(o).add(f).add(A).subtract(v),S.copy(w).subtract(e),F=t.dot(S),i=Math.min(F,i),s=Math.max(F,s),w.copy(o).add(f).subtract(A).add(v),S.copy(w).subtract(e),F=t.dot(S),i=Math.min(F,i),s=Math.max(F,s),w.copy(o).add(f).subtract(A).subtract(v),S.copy(w).subtract(e),F=t.dot(S),i=Math.min(F,i),s=Math.max(F,s),o.copy(w).subtract(f).add(A).add(v),S.copy(w).subtract(e),F=t.dot(S),i=Math.min(F,i),s=Math.max(F,s),o.copy(w).subtract(f).add(A).subtract(v),S.copy(w).subtract(e),F=t.dot(S),i=Math.min(F,i),s=Math.max(F,s),o.copy(w).subtract(f).subtract(A).add(v),S.copy(w).subtract(e),F=t.dot(S),i=Math.min(F,i),s=Math.max(F,s),o.copy(w).subtract(f).subtract(A).subtract(v),S.copy(w).subtract(e),F=t.dot(S),i=Math.min(F,i),s=Math.max(F,s),n[0]=i,n[1]=s,n}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,h0);t.transformAsPoint(e);const n=this.halfAxes.getColumn(1,d0);n.transformAsPoint(e);const i=this.halfAxes.getColumn(2,p0);return i.transformAsPoint(e),this.halfAxes=new gi([...t,...n,...i]),this}getTransform(){throw new Error("not implemented")}}const zP=new dt,GP=new dt;class gc{constructor(e=[0,0,1],t=0){this.normal=new dt,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return mc(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=zP.from(e),this.normal.from(t).normalize();const n=-this.normal.dot(e);return this.distance=n,this}fromCoefficients(e,t,n,i){return this.normal.set(e,t,n),mc(ma(this.normal.len(),1)),this.distance=i,this}clone(){return new gc(this.normal,this.distance)}equals(e){return ma(this.distance,e.distance)&&ma(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=GP.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,t)}projectPointOntoPlane(e,t=[0,0,0]){const n=zP.from(e),i=this.getPointDistance(n),s=GP.copy(this.normal).scale(i);return n.subtract(s).to(t)}}const VP=[new dt([1,0,0]),new dt([0,1,0]),new dt([0,0,1])],HP=new dt,Dhe=new dt;class pa{constructor(e=[]){this.planes=e}fromBoundingSphere(e){this.planes.length=2*VP.length;const t=e.center,n=e.radius;let i=0;for(const s of VP){let o=this.planes[i],c=this.planes[i+1];o||(o=this.planes[i]=new gc),c||(c=this.planes[i+1]=new gc);const f=HP.copy(s).scale(-n).add(t);o.fromPointNormal(f,s);const A=HP.copy(s).scale(n).add(t),v=Dhe.copy(s).negate();c.fromPointNormal(A,v),i+=2}return this}computeVisibility(e){let t=go.INSIDE;for(const n of this.planes)switch(e.intersectPlane(n)){case go.OUTSIDE:return go.OUTSIDE;case go.INTERSECTING:t=go.INTERSECTING;break}return t}computeVisibilityWithPlaneMask(e,t){if(mc(Number.isFinite(t),"parentPlaneMask is required."),t===pa.MASK_OUTSIDE||t===pa.MASK_INSIDE)return t;let n=pa.MASK_INSIDE;const i=this.planes;for(let s=0;s<this.planes.length;++s){const o=s<31?1<<s:0;if(s<31&&(t&o)===0)continue;const c=i[s],f=e.intersectPlane(c);if(f===go.OUTSIDE)return pa.MASK_OUTSIDE;f===go.INTERSECTING&&(n|=o)}return n}}pa.MASK_OUTSIDE=4294967295;pa.MASK_INSIDE=0;pa.MASK_INDETERMINATE=2147483647;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;const rl=new gi,Ohe=new gi,Lhe=new gi,A0=new gi,jP=new gi;function khe(r,e={}){const t=Uj,n=10;let i=0,s=0;const o=Ohe,c=Lhe;o.identity(),c.copy(r);const f=t*Nhe(c);for(;s<n&&Uhe(c)>f;)zhe(c,A0),jP.copy(A0).transpose(),c.multiplyRight(A0),c.multiplyLeft(jP),o.multiplyRight(A0),++i>2&&(++s,i=0);return e.unitary=o.toTarget(e.unitary),e.diagonal=c.toTarget(e.diagonal),e}function Nhe(r){let e=0;for(let t=0;t<9;++t){const n=r[t];e+=n*n}return Math.sqrt(e)}const px=[1,0,0],Ax=[2,2,1];function Uhe(r){let e=0;for(let t=0;t<3;++t){const n=r[rl.getElementIndex(Ax[t],px[t])];e+=2*n*n}return Math.sqrt(e)}function zhe(r,e){const t=M4;let n=0,i=1;for(let A=0;A<3;++A){const v=Math.abs(r[rl.getElementIndex(Ax[A],px[A])]);v>n&&(i=A,n=v)}const s=px[i],o=Ax[i];let c=1,f=0;if(Math.abs(r[rl.getElementIndex(o,s)])>t){const A=r[rl.getElementIndex(o,o)],v=r[rl.getElementIndex(s,s)],w=r[rl.getElementIndex(o,s)],S=(A-v)/2/w;let F;S<0?F=-1/(-S+Math.sqrt(1+S*S)):F=1/(S+Math.sqrt(1+S*S)),c=1/Math.sqrt(1+F*F),f=F*c}return gi.IDENTITY.to(e),e[rl.getElementIndex(s,s)]=e[rl.getElementIndex(o,o)]=c,e[rl.getElementIndex(o,s)]=f,e[rl.getElementIndex(s,o)]=-f,e}const Nu=new dt,Ghe=new dt,Vhe=new dt,Hhe=new dt,jhe=new dt,$he=new gi,Whe={diagonal:new gi,unitary:new gi};function H6(r,e=new Zg){if(!r||r.length===0)return e.halfAxes=new gi([0,0,0,0,0,0,0,0,0]),e.center=new dt,e;const t=r.length,n=new dt(0,0,0);for(const de of r)n.add(de);const i=1/t;n.multiplyByScalar(i);let s=0,o=0,c=0,f=0,A=0,v=0;for(const de of r){const me=Nu.copy(de).subtract(n);s+=me.x*me.x,o+=me.x*me.y,c+=me.x*me.z,f+=me.y*me.y,A+=me.y*me.z,v+=me.z*me.z}s*=i,o*=i,c*=i,f*=i,A*=i,v*=i;const w=$he;w[0]=s,w[1]=o,w[2]=c,w[3]=o,w[4]=f,w[5]=A,w[6]=c,w[7]=A,w[8]=v;const{unitary:S}=khe(w,Whe),F=e.halfAxes.copy(S);let N=F.getColumn(0,Vhe),U=F.getColumn(1,Hhe),$=F.getColumn(2,jhe),G=-Number.MAX_VALUE,H=-Number.MAX_VALUE,J=-Number.MAX_VALUE,ue=Number.MAX_VALUE,q=Number.MAX_VALUE,se=Number.MAX_VALUE;for(const de of r)Nu.copy(de),G=Math.max(Nu.dot(N),G),H=Math.max(Nu.dot(U),H),J=Math.max(Nu.dot($),J),ue=Math.min(Nu.dot(N),ue),q=Math.min(Nu.dot(U),q),se=Math.min(Nu.dot($),se);N=N.multiplyByScalar(.5*(ue+G)),U=U.multiplyByScalar(.5*(q+H)),$=$.multiplyByScalar(.5*(se+J)),e.center.copy(N).add(U).add($);const Te=Ghe.set(G-ue,H-q,J-se).multiplyByScalar(.5),Ue=new gi([Te[0],0,0,0,Te[1],0,0,0,Te[2]]);return e.halfAxes.multiplyRight(Ue),e}const hp=512,$P=3,j6=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],$6=j6.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),Jhe=$6.concat([[.25,.5],[.75,.5]]);class dp{constructor(e,t,n){this.x=e,this.y=t,this.z=n}get children(){if(!this._children){const e=this.x*2,t=this.y*2,n=this.z+1;this._children=[new dp(e,t,n),new dp(e,t+1,n),new dp(e+1,t,n),new dp(e+1,t+1,n)]}return this._children}update(e){const{viewport:t,cullingVolume:n,elevationBounds:i,minZ:s,maxZ:o,bounds:c,offset:f,project:A}=e,v=this.getBoundingVolume(i,f,A);if(c&&!this.insideBounds(c)||n.computeVisibility(v)<0)return!1;if(!this.childVisible){let{z:S}=this;if(S<o&&S>=s){const F=v.distanceTo(t.cameraPosition)*t.scale/t.height;S+=Math.floor(Math.log2(F))}if(S>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(const S of this.children)S.update(e);return!0}getSelected(e=[]){if(this.selected&&e.push(this),this._children)for(const t of this._children)t.getSelected(e);return e}insideBounds([e,t,n,i]){const s=Math.pow(2,this.z),o=hp/s;return this.x*o<n&&this.y*o<i&&(this.x+1)*o>e&&(this.y+1)*o>t}getBoundingVolume(e,t,n){if(n){const f=this.z<1?Jhe:this.z<2?$6:j6,A=[];for(const v of f){const w=mx(this.x+v[0],this.y+v[1],this.z);w[2]=e[0],A.push(n(w)),e[0]!==e[1]&&(w[2]=e[1],A.push(n(w)))}return H6(A)}const i=Math.pow(2,this.z),s=hp/i,o=this.x*s+t*hp,c=hp-(this.y+1)*s;return new EC([o,c,e[0]],[o+s,c+s,e[1]])}}function Xhe(r,e,t,n){const i=r instanceof hZ&&r.resolution?r.projectPosition:null,s=Object.values(r.getFrustumPlanes()).map(({normal:F,distance:N})=>new gc(F.clone().negate(),N)),o=new pa(s),c=r.distanceScales.unitsPerMeter[2],f=t&&t[0]*c||0,A=t&&t[1]*c||0,v=r instanceof wg&&r.pitch<=60?e:0;if(n){const[F,N,U,$]=n,G=eu([F,$]),H=eu([U,N]);n=[G[0],hp-G[1],H[0],hp-H[1]]}const w=new dp(0,0,0),S={viewport:r,project:i,cullingVolume:o,elevationBounds:[f,A],minZ:v,maxZ:e,bounds:n,offset:0};if(w.update(S),r instanceof wg&&r.subViewports&&r.subViewports.length>1){for(S.offset=-1;w.update(S)&&!(--S.offset<-$P););for(S.offset=1;w.update(S)&&!(++S.offset>$P););}return w.getSelected()}const tu=512,Khe=[-1/0,-1/0,1/0,1/0],H_={type:"object",value:null,validate:(r,e)=>e.optional&&r===null||typeof r=="string"||Array.isArray(r)&&r.every(t=>typeof t=="string"),equal:(r,e)=>{if(r===e)return!0;if(!Array.isArray(r)||!Array.isArray(e))return!1;const t=r.length;if(t!==e.length)return!1;for(let n=0;n<t;n++)if(r[n]!==e[n])return!1;return!0}};function W6(r,e){const t=[e.transformAsPoint([r[0],r[1]]),e.transformAsPoint([r[2],r[1]]),e.transformAsPoint([r[0],r[3]]),e.transformAsPoint([r[2],r[3]])];return[Math.min(...t.map(i=>i[0])),Math.min(...t.map(i=>i[1])),Math.max(...t.map(i=>i[0])),Math.max(...t.map(i=>i[1]))]}function qhe(r){return Math.abs(r.split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0))}function ph(r,e){if(!r||!r.length)return null;const{index:t,id:n}=e;if(Array.isArray(r)){const s=qhe(n)%r.length;r=r[s]}let i=r;for(const s of Object.keys(t)){const o=new RegExp(`{${s}}`,"g");i=i.replace(o,String(t[s]))}return Number.isInteger(t.y)&&Number.isInteger(t.z)&&(i=i.replace(/\{-y\}/g,String(Math.pow(2,t.z)-t.y-1))),i}function Yhe(r,e,t){let n;return n=r.getBounds(),r.isGeospatial?[Math.max(n[0],t[0]),Math.max(n[1],t[1]),Math.min(n[2],t[2]),Math.min(n[3],t[3])]:[Math.max(Math.min(n[0],t[2]),t[0]),Math.max(Math.min(n[1],t[3]),t[1]),Math.min(Math.max(n[2],t[0]),t[2]),Math.min(Math.max(n[3],t[1]),t[3])]}function Zhe({viewport:r,z:e,cullRect:t}){return(r.subViewports||[r]).map(i=>gx(i,e||0,t))}function gx(r,e,t){if(!Array.isArray(e)){const s=t.x-r.x,o=t.y-r.y,{width:c,height:f}=t,A={targetZ:e},v=r.unproject([s,o],A),w=r.unproject([s+c,o],A),S=r.unproject([s,o+f],A),F=r.unproject([s+c,o+f],A);return[Math.min(v[0],w[0],S[0],F[0]),Math.min(v[1],w[1],S[1],F[1]),Math.max(v[0],w[0],S[0],F[0]),Math.max(v[1],w[1],S[1],F[1])]}const n=gx(r,e[0],t),i=gx(r,e[1],t);return[Math.min(n[0],i[0]),Math.min(n[1],i[1]),Math.max(n[2],i[2]),Math.max(n[3],i[3])]}function Qhe(r,e,t){return t?W6(r,t).map(i=>i*e/tu):r.map(n=>n*e/tu)}function BC(r,e){return Math.pow(2,r)*tu/e}function mx(r,e,t){const n=BC(t,tu),i=r/n*360-180,s=Math.PI-2*Math.PI*e/n,o=180/Math.PI*Math.atan(.5*(Math.exp(s)-Math.exp(-s)));return[i,o]}function WP(r,e,t,n){const i=BC(t,n);return[r/i*tu,e/i*tu]}function ede(r,e,t,n,i=tu){if(r.isGeospatial){const[A,v]=mx(e,t,n),[w,S]=mx(e+1,t+1,n);return{west:A,north:v,east:w,south:S}}const[s,o]=WP(e,t,n,i),[c,f]=WP(e+1,t+1,n,i);return{left:s,top:o,right:c,bottom:f}}function tde(r,e,t,n,i){const s=Yhe(r,null,n),o=BC(e,t),[c,f,A,v]=Qhe(s,o,i),w=[];for(let S=Math.floor(c);S<A;S++)for(let F=Math.floor(f);F<v;F++)w.push({x:S,y:F,z:e});return w}function rde({viewport:r,maxZoom:e,minZoom:t,zRange:n,extent:i,tileSize:s=tu,modelMatrix:o,modelMatrixInverse:c,zoomOffset:f=0}){let A=r.isGeospatial?Math.round(r.zoom+Math.log2(tu/s))+f:Math.ceil(r.zoom)+f;if(typeof t=="number"&&Number.isFinite(t)&&A<t){if(!i)return[];A=t}typeof e=="number"&&Number.isFinite(e)&&A>e&&(A=e);let v=i;return o&&c&&i&&!r.isGeospatial&&(v=W6(i,o)),r.isGeospatial?Xhe(r,A,n,i):tde(r,A,s,v||Khe,c)}function nde(r){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(r)}function ide(r){return Number.isFinite(r.west)&&Number.isFinite(r.north)&&Number.isFinite(r.east)&&Number.isFinite(r.south)}function sde(r){let e={},t;return n=>{for(const i in n)if(!ode(n[i],e[i])){t=r(n),e=n;break}return t}}function ode(r,e){if(r===e)return!0;if(Array.isArray(r)){const t=r.length;if(!e||e.length!==t)return!1;for(let n=0;n<t;n++)if(r[n]!==e[n])return!1;return!0}return!1}const JP=1,Dy=2,ade="never",cde="no-overlap",SC="best-available",lde=5,ude={[SC]:hde,[cde]:dde,[ade]:()=>{}},fde={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{}};class Oy{constructor(e){this._getCullBounds=sde(Zhe),this.opts={...fde,...e},this.setOptions(this.opts),this.onTileLoad=t=>{this.opts.onTileLoad?.(t),this.opts.maxCacheByteSize!==null&&(this._cacheByteSize+=t.byteLength,this._resizeCache())},this._requestScheduler=new O6({throttleRequests:this.opts.maxRequests>0||this.opts.debounceTime>0,maxRequests:this.opts.maxRequests,debounceTime:this.opts.debounceTime}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._zRange=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new vn,this._modelMatrixInverse=new vn}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return this._selectedTiles!==null&&this._selectedTiles.every(e=>e.isLoaded)}get needsReload(){return this._selectedTiles!==null&&this._selectedTiles.some(e=>e.needsReload)}setOptions(e){Object.assign(this.opts,e),Number.isFinite(e.maxZoom)&&(this._maxZoom=Math.floor(e.maxZoom)),Number.isFinite(e.minZoom)&&(this._minZoom=Math.ceil(e.minZoom))}finalize(){for(const e of this._cache.values())e.isLoading&&e.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(const e of this._cache.keys()){const t=this._cache.get(e);!this._selectedTiles||!this._selectedTiles.includes(t)?this._cache.delete(e):t.setNeedsReload()}}update(e,{zRange:t,modelMatrix:n}={zRange:null,modelMatrix:null}){const i=n?new vn(n):new vn,s=!i.equals(this._modelMatrix);if(!this._viewport||!e.equals(this._viewport)||!ma(this._zRange,t)||s){s&&(this._modelMatrixInverse=i.clone().invert(),this._modelMatrix=i),this._viewport=e,this._zRange=t;const c=this.getTileIndices({viewport:e,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:t,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=c.map(f=>this._getTile(f,!0)),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(c=>this._getTile(c.index,!0)));const o=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),o&&this._frameNumber++,this._frameNumber}isTileVisible(e,t){if(!e.isVisible)return!1;if(t&&this._viewport){const n=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:t}),{bbox:i}=e;for(const[s,o,c,f]of n){let A;if("west"in i)A=i.west<c&&i.east>s&&i.south<f&&i.north>o;else{const v=Math.min(i.top,i.bottom),w=Math.max(i.top,i.bottom);A=i.left<c&&i.right>s&&v<f&&w>o}if(A)return!0}return!1}return!0}getTileIndices({viewport:e,maxZoom:t,minZoom:n,zRange:i,modelMatrix:s,modelMatrixInverse:o}){const{tileSize:c,extent:f,zoomOffset:A}=this.opts;return rde({viewport:e,maxZoom:t,minZoom:n,zRange:i,tileSize:c,extent:f,modelMatrix:s,modelMatrixInverse:o,zoomOffset:A})}getTileId(e){return`${e.x}-${e.y}-${e.z}`}getTileZoom(e){return e.z}getTileMetadata(e){const{tileSize:t}=this.opts;return{bbox:ede(this._viewport,e.x,e.y,e.z,t)}}getParentIndex(e){const t=Math.floor(e.x/2),n=Math.floor(e.y/2),i=e.z-1;return{x:t,y:n,z:i}}updateTileStates(){const e=this.opts.refinementStrategy||SC,t=new Array(this._cache.size);let n=0;for(const i of this._cache.values())t[n++]=i.isVisible,i.isSelected=!1,i.isVisible=!1;for(const i of this._selectedTiles)i.isSelected=!0,i.isVisible=!0;(typeof e=="function"?e:ude[e])(Array.from(this._cache.values())),n=0;for(const i of this._cache.values())if(t[n++]!==i.isVisible)return!0;return!1}_pruneRequests(){const{maxRequests:e=0}=this.opts,t=[];let n=0;for(const i of this._cache.values())i.isLoading&&(n++,!i.isSelected&&!i.isVisible&&t.push(i));for(;e>0&&n>e&&t.length>0;)t.shift().abort(),n--}_rebuildTree(){const{_cache:e}=this;for(const t of e.values())t.parent=null,t.children&&(t.children.length=0);for(const t of e.values()){const n=this._getNearestAncestor(t);t.parent=n,n?.children&&n.children.push(t)}}_resizeCache(){const{_cache:e,opts:t}=this,n=t.maxCacheSize??(t.maxCacheByteSize!==null?1/0:lde*this.selectedTiles.length),i=t.maxCacheByteSize??1/0;if(e.size>n||this._cacheByteSize>i){for(const[o,c]of e)if(!c.isVisible&&!c.isSelected&&(this._cacheByteSize-=t.maxCacheByteSize!==null?c.byteLength:0,e.delete(o),this.opts.onTileUnload?.(c)),e.size<=n&&this._cacheByteSize<=i)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((o,c)=>o.zoom-c.zoom),this._dirty=!1)}_getTile(e,t){const n=this.getTileId(e);let i=this._cache.get(n),s=!1;return!i&&t?(i=new V6(e),Object.assign(i,this.getTileMetadata(i.index)),Object.assign(i,{id:n,zoom:this.getTileZoom(i.index)}),s=!0,this._cache.set(n,i),this._dirty=!0):i&&i.needsReload&&(s=!0),i&&s&&i.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),i}_getNearestAncestor(e){const{_minZoom:t=0}=this;let n=e.index;for(;this.getTileZoom(n)>t;){n=this.getParentIndex(n);const i=this._getTile(n);if(i)return i}return null}}function hde(r){for(const e of r)e.state=0;for(const e of r)e.isSelected&&!J6(e)&&IC(e);for(const e of r)e.isVisible=!!(e.state&Dy)}function dde(r){for(const t of r)t.state=0;for(const t of r)t.isSelected&&J6(t);const e=Array.from(r).sort((t,n)=>t.zoom-n.zoom);for(const t of e)if(t.isVisible=!!(t.state&Dy),t.children&&(t.isVisible||t.state&JP))for(const n of t.children)n.state=JP;else t.isSelected&&IC(t)}function J6(r){let e=r;for(;e;){if(e.isLoaded||e.content)return e.state|=Dy,!0;e=e.parent}return!1}function IC(r){for(const e of r.children)e.isLoaded||e.content?e.state|=Dy:IC(e)}const pde={TilesetClass:Oy,data:{type:"data",value:[]},dataComparator:H_.equal,renderSubLayers:{type:"function",value:r=>new iu(r)},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:r=>{}},onTileUnload:{type:"function",value:r=>{}},onTileError:{type:"function",value:r=>console.error(r)},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:SC,zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0};class ou extends Bs{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){this.state?.tileset?.finalize()}get isLoaded(){return!!this.state?.tileset?.selectedTiles?.every(e=>e.isLoaded&&e.layers&&e.layers.every(t=>t.isLoaded))}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState({changeFlags:e}){let{tileset:t}=this.state;const n=e.propsOrDataChanged||e.updateTriggersChanged,i=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getTileData);t?n&&(t.setOptions(this._getTilesetOptions()),i?t.reloadAll():t.tiles.forEach(s=>{s.layers=null})):(t=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:t})),this._updateTileset()}_getTilesetOptions(){const{tileSize:e,maxCacheSize:t,maxCacheByteSize:n,refinementStrategy:i,extent:s,maxZoom:o,minZoom:c,maxRequests:f,debounceTime:A,zoomOffset:v}=this.props;return{maxCacheSize:t,maxCacheByteSize:n,maxZoom:o,minZoom:c,tileSize:e,refinementStrategy:i,extent:s,maxRequests:f,debounceTime:A,zoomOffset:v,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){const e=this.state.tileset,{zRange:t,modelMatrix:n}=this.props,i=e.update(this.context.viewport,{zRange:t,modelMatrix:n}),{isLoaded:s}=e,o=this.state.isLoaded!==s,c=this.state.frameNumber!==i;s&&(o||c)&&this._onViewportLoad(),c&&this.setState({frameNumber:i}),this.state.isLoaded=s}_onViewportLoad(){const{tileset:e}=this.state,{onViewportLoad:t}=this.props;t&&t(e.selectedTiles)}_onTileLoad(e){this.props.onTileLoad(e),e.layers=null,this.setNeedsUpdate()}_onTileError(e,t){this.props.onTileError(e),t.layers=null,this.setNeedsUpdate()}_onTileUnload(e){this.props.onTileUnload(e)}getTileData(e){const{data:t,getTileData:n,fetch:i}=this.props,{signal:s}=e;return e.url=typeof t=="string"||Array.isArray(t)?ph(t,e):null,n?n(e):i&&e.url?i(e.url,{propName:"data",layer:this,signal:s}):null}renderSubLayers(e){return this.props.renderSubLayers(e)}getSubLayerPropsByTile(e){return null}getPickingInfo(e){const t=e.sourceLayer,n=t.props.tile,i=e.info;return i.picked&&(i.tile=n),i.sourceTile=n,i.sourceTileSubLayer=t,i}_updateAutoHighlight(e){e.sourceTileSubLayer.updateAutoHighlight(e)}renderLayers(){return this.state.tileset.tiles.map(e=>{const t=this.getSubLayerPropsByTile(e);if(!(!e.isLoaded&&!e.content))if(e.layers)t&&e.layers[0]&&Object.keys(t).some(n=>e.layers[0].props[n]!==t[n])&&(e.layers=e.layers.map(n=>n.clone(t)));else{const n=this.renderSubLayers({...this.props,...this.getSubLayerProps({id:e.id,updateTriggers:this.props.updateTriggers}),data:e.content,_offset:0,tile:e});e.layers=py(n,Boolean).map(i=>i.clone({tile:e,...t}))}return e.layers})}filterSubLayer({layer:e,cullRect:t}){const{tile:n}=e.props;return this.state.tileset.isTileVisible(n,t)}}ou.defaultProps=pde;ou.layerName="TileLayer";const XP=`uniform tripsUniforms {
4191
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}n.prototype.build=function(c){return this.options.preserveOrder?r(c,this.options):(Array.isArray(c)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(c={[this.options.arrayNodeName]:c}),this.j2x(c,0,[]).val)},n.prototype.j2x=function(c,f,A){let v="",w="";const S=A.join(".");for(let F in c)if(Object.prototype.hasOwnProperty.call(c,F))if(typeof c[F]>"u")this.isAttribute(F)&&(w+="");else if(c[F]===null)this.isAttribute(F)?w+="":F[0]==="?"?w+=this.indentate(f)+"<"+F+"?"+this.tagEndChar:w+=this.indentate(f)+"<"+F+"/"+this.tagEndChar;else if(c[F]instanceof Date)w+=this.buildTextValNode(c[F],F,"",f);else if(typeof c[F]!="object"){const N=this.isAttribute(F);if(N&&!this.ignoreAttributesFn(N,S))v+=this.buildAttrPairStr(N,""+c[F]);else if(!N)if(F===this.options.textNodeName){let U=this.options.tagValueProcessor(F,""+c[F]);w+=this.replaceEntitiesValue(U)}else w+=this.buildTextValNode(c[F],F,"",f)}else if(Array.isArray(c[F])){const N=c[F].length;let U="",$="";for(let G=0;G<N;G++){const H=c[F][G];if(!(typeof H>"u"))if(H===null)F[0]==="?"?w+=this.indentate(f)+"<"+F+"?"+this.tagEndChar:w+=this.indentate(f)+"<"+F+"/"+this.tagEndChar;else if(typeof H=="object")if(this.options.oneListGroup){const J=this.j2x(H,f+1,A.concat(F));U+=J.val,this.options.attributesGroupName&&H.hasOwnProperty(this.options.attributesGroupName)&&($+=J.attrStr)}else U+=this.processTextOrObjNode(H,F,f,A);else if(this.options.oneListGroup){let J=this.options.tagValueProcessor(F,H);J=this.replaceEntitiesValue(J),U+=J}else U+=this.buildTextValNode(H,F,"",f)}this.options.oneListGroup&&(U=this.buildObjectNode(U,F,$,f)),w+=U}else if(this.options.attributesGroupName&&F===this.options.attributesGroupName){const N=Object.keys(c[F]),U=N.length;for(let $=0;$<U;$++)v+=this.buildAttrPairStr(N[$],""+c[F][N[$]])}else w+=this.processTextOrObjNode(c[F],F,f,A);return{attrStr:v,val:w}},n.prototype.buildAttrPairStr=function(c,f){return f=this.options.attributeValueProcessor(c,""+f),f=this.replaceEntitiesValue(f),this.options.suppressBooleanAttributes&&f==="true"?" "+c:" "+c+'="'+f+'"'};function i(c,f,A,v){const w=this.j2x(c,A+1,v.concat(f));return c[this.options.textNodeName]!==void 0&&Object.keys(c).length===1?this.buildTextValNode(c[this.options.textNodeName],f,w.attrStr,A):this.buildObjectNode(w.val,f,w.attrStr,A)}n.prototype.buildObjectNode=function(c,f,A,v){if(c==="")return f[0]==="?"?this.indentate(v)+"<"+f+A+"?"+this.tagEndChar:this.indentate(v)+"<"+f+A+this.closeTag(f)+this.tagEndChar;{let w="</"+f+this.tagEndChar,S="";return f[0]==="?"&&(S="?",w=""),(A||A==="")&&c.indexOf("<")===-1?this.indentate(v)+"<"+f+A+S+">"+c+w:this.options.commentPropName!==!1&&f===this.options.commentPropName&&S.length===0?this.indentate(v)+`<!--${c}-->`+this.newLine:this.indentate(v)+"<"+f+A+S+this.tagEndChar+c+this.indentate(v)+w}},n.prototype.closeTag=function(c){let f="";return this.options.unpairedTags.indexOf(c)!==-1?this.options.suppressUnpairedNode||(f="/"):this.options.suppressEmptyNode?f="/":f=`></${c}`,f},n.prototype.buildTextValNode=function(c,f,A,v){if(this.options.cdataPropName!==!1&&f===this.options.cdataPropName)return this.indentate(v)+`<![CDATA[${c}]]>`+this.newLine;if(this.options.commentPropName!==!1&&f===this.options.commentPropName)return this.indentate(v)+`<!--${c}-->`+this.newLine;if(f[0]==="?")return this.indentate(v)+"<"+f+A+"?"+this.tagEndChar;{let w=this.options.tagValueProcessor(f,c);return w=this.replaceEntitiesValue(w),w===""?this.indentate(v)+"<"+f+A+this.closeTag(f)+this.tagEndChar:this.indentate(v)+"<"+f+A+">"+w+"</"+f+this.tagEndChar}},n.prototype.replaceEntitiesValue=function(c){if(c&&c.length>0&&this.options.processEntities)for(let f=0;f<this.options.entities.length;f++){const A=this.options.entities[f];c=c.replace(A.regex,A.val)}return c};function s(c){return this.options.indentBy.repeat(c)}function o(c){return c.startsWith(this.options.attributeNamePrefix)&&c!==this.options.textNodeName?c.substr(this.attrPrefixLen):!1}return n1=n,n1}var i1,CP;function xue(){if(CP)return i1;CP=1;const r=I6(),e=yue(),t=bue();return i1={XMLParser:e,XMLValidator:r,XMLBuilder:t},i1}var wue=xue();function TP(r,e){if(e?._parser&&e._parser!=="fast-xml-parser")throw new Error(e?._parser);const t={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:e?.removeNSPrefix,textNodeName:e?.textNodeName,isArray:(i,s,o,c)=>!!e?.arrayPaths?.some(A=>s===A),...e?._fastXML},n=Cue(r,t);return e?.uncapitalizeKeys?ux(n):n}function Cue(r,e){return new wue.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...e}).parse(r)}const Tue="4.2.4",kp={dataType:null,batchType:null,name:"XML",id:"xml",module:"xml",version:Tue,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:Eue,options:{xml:{_parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:async(r,e)=>TP(new TextDecoder().decode(r),{...kp.options.xml,...e?.xml}),parseTextSync:(r,e)=>TP(r,{...kp.options.xml,...e?.xml})};function Eue(r){return r.startsWith("<?xml")}async function Bh(r,e,t,n){return n._parse(r,e,t,n)}function Ai(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const P6=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),EP=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);EP&&parseFloat(EP[1]);function Bue(r,e){return R6(r||{},e)}function R6(r,e,t=0){if(t>3)return e;const n={...r};for(const[i,s]of Object.entries(e))s&&typeof s=="object"&&!Array.isArray(s)?n[i]=R6(n[i]||{},e[i],t+1):n[i]=e[i];return n}function Sue(r){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,r)}function Iue(r){return globalThis.loaders?.modules?.[r]||null}function Mue(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const Pue=Mue();function Rue(r,e){if(!r)throw new Error("loaders.gl assertion failed.")}const Xg=typeof process!="object"||String(process)!=="[object process]"||process.browser,yC=typeof importScripts=="function",BP=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);BP&&parseFloat(BP[1]);const s1={};async function ch(r,e=null,t={},n=null){return e&&(r=Fue(r,e,t,n)),s1[r]=s1[r]||Due(r),await s1[r]}function Fue(r,e,t={},n=null){if(!t.useLocalLibraries&&r.startsWith("http"))return r;n=n||r;const i=t.modules||{};return i[n]?i[n]:Xg?t.CDN?(Rue(t.CDN.startsWith("http")),`${t.CDN}/${e}@${Pue}/dist/libs/${n}`):yC?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}async function Due(r){if(r.endsWith("wasm"))return await Lue(r);if(!Xg)try{const{requireFromFile:t}=globalThis.loaders||{};return await t?.(r)}catch(t){return console.error(t),null}if(yC)return importScripts(r);const e=await kue(r);return Oue(e,r)}function Oue(r,e){if(!Xg){const{requireFromString:n}=globalThis.loaders||{};return n?.(r,e)}if(yC)return eval.call(globalThis,r),null;const t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(r))}catch{t.text=r}return document.body.appendChild(t),null}async function Lue(r){const{readFileAsArrayBuffer:e}=globalThis.loaders||{};return Xg||!e||r.startsWith("http")?await(await fetch(r)).arrayBuffer():await e(r)}async function kue(r){const{readFileAsText:e}=globalThis.loaders||{};return Xg||!e||r.startsWith("http")?await(await fetch(r)).text():await e(r)}function Nue(r,e=5){return typeof r=="string"?r.slice(0,e):ArrayBuffer.isView(r)?SP(r.buffer,r.byteOffset,e):r instanceof ArrayBuffer?SP(r,0,e):""}function SP(r,e,t){if(r.byteLength<=e+t)return"";const n=new DataView(r);let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(n.getUint8(e+s));return i}function F6(r){try{return JSON.parse(r)}catch{throw new Error(`Failed to parse JSON from data starting with "${Nue(r)}"`)}}function Kg(r,e,t){const n=t!==void 0?new Uint8Array(r).subarray(e,e+t):new Uint8Array(r).subarray(e);return new Uint8Array(n).buffer}function su(r,e){return Ai(r>=0),Ai(e>0),r+(e-1)&-4}function D6(r,e,t){let n;if(r instanceof ArrayBuffer)n=new Uint8Array(r);else{const i=r.byteOffset,s=r.byteLength;n=new Uint8Array(r.buffer||r.arrayBuffer,i,s)}return e.set(n,t),t+su(n.byteLength,4)}const Uue="Queued Requests",zue="Active Requests",Gue="Cancelled Requests",Vue="Queued Requests Ever",Hue="Active Requests Ever",jue={id:"request-scheduler",throttleRequests:!0,maxRequests:6,debounceTime:0};class O6{props;stats;activeRequestCount=0;requestQueue=[];requestMap=new Map;updateTimer=null;constructor(e={}){this.props={...jue,...e},this.stats=new YL({id:this.props.id}),this.stats.get(Uue),this.stats.get(zue),this.stats.get(Gue),this.stats.get(Vue),this.stats.get(Hue)}scheduleRequest(e,t=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(e))return this.requestMap.get(e);const n={handle:e,priority:0,getPriority:t},i=new Promise(s=>(n.resolve=s,n));return this.requestQueue.push(n),this.requestMap.set(e,i),this._issueNewRequests(),i}_issueRequest(e){const{handle:t,resolve:n}=e;let i=!1;const s=()=>{i||(i=!0,this.requestMap.delete(t),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:s}):Promise.resolve({done:s})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;const e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(e!==0){this._updateAllRequests();for(let t=0;t<e;++t){const n=this.requestQueue.shift();n&&this._issueRequest(n)}}}_updateAllRequests(){const e=this.requestQueue;for(let t=0;t<e.length;++t){const n=e[t];this._updateRequest(n)||(e.splice(t,1),this.requestMap.delete(n.handle),t--)}e.sort((t,n)=>t.priority-n.priority)}_updateRequest(e){return e.priority=e.getPriority(e.handle),e.priority<0?(e.resolve(null),!1):!0}}function $ue(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();const r=window.location?.pathname;return r?.slice(0,r.lastIndexOf("/")+1)||""}function L6(r){const e=r?r.lastIndexOf("/"):-1;return e>=0?r.substr(0,e):""}function Wue(...r){const e=[];for(let s=0;s<r.length;s++)e[s]=r[s];let t="",n=!1,i;for(let s=e.length-1;s>=-1&&!n;s--){let o;s>=0?o=e[s]:(i===void 0&&(i=$ue()),o=i),o.length!==0&&(t=`${o}/${t}`,n=o.charCodeAt(0)===qA)}return t=Jue(t,!n),n?`/${t}`:t.length>0?t:"."}const qA=47,o1=46;function Jue(r,e){let t="",n=-1,i=0,s,o=!1;for(let c=0;c<=r.length;++c){if(c<r.length)s=r.charCodeAt(c);else{if(s===qA)break;s=qA}if(s===qA){if(!(n===c-1||i===1))if(n!==c-1&&i===2){if(t.length<2||!o||t.charCodeAt(t.length-1)!==o1||t.charCodeAt(t.length-2)!==o1){if(t.length>2){const f=t.length-1;let A=f;for(;A>=0&&t.charCodeAt(A)!==qA;--A);if(A!==f){t=A===-1?"":t.slice(0,A),n=c,i=0,o=!1;continue}}else if(t.length===2||t.length===1){t="",n=c,i=0,o=!1;continue}}e&&(t.length>0?t+="/..":t="..",o=!0)}else{const f=r.slice(n+1,c);t.length>0?t+=`/${f}`:t=f,o=!1}n=c,i=0}else s===o1&&i!==-1?++i:i=-1}return t}class Xue{fetch;loadOptions;_needsRefresh=!0;props;constructor(e){this.props={...e},this.loadOptions={...e.loadOptions},this.fetch=Kue(this.loadOptions)}setProps(e){this.props=Object.assign(this.props,e),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(e=!0){const t=this._needsRefresh;return e&&(this._needsRefresh=!1),t}}function Kue(r){const e=r?.fetch;if(e&&typeof e=="function")return(n,i)=>e(n,i);const t=r?.fetch;return t&&typeof t!="function"?n=>fetch(n,t):n=>fetch(n)}class vC extends Xue{static type="template";static testURL=e=>!1}function que(r,e){const t=kp.parseTextSync?.(r,e),n=t?.ServiceExceptionReport?.ServiceException||t?.["ogc:ServiceExceptionReport"]?.["ogc:ServiceException"];return typeof n=="string"?n:n.value||n.code||"Unknown error"}const Yue="4.2.4",Z0={dataType:null,batchType:null,id:"wms-error",name:"WMS Error",module:"wms",version:Yue,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:Zue,options:{wms:{throwOnError:!1}},parse:async(r,e)=>a1(new TextDecoder().decode(r),e),parseSync:(r,e)=>a1(new TextDecoder().decode(r),e),parseTextSync:(r,e)=>a1(r,e)};function Zue(r){return r.startsWith("<?xml")}function a1(r,e){const t={...Z0.options.wms,...e?.wms},n=que(r,t),i=t.minimalErrors?n:`WMS Service error: ${n}`;if(t.throwOnError)throw new Error(i);return i}function Np(r){return Array.isArray(r)?r:r?[r]:[]}function My(r){const e=Np(r);return e.length>0&&e.every(t=>typeof t=="string")?e:[]}function f0(r,e=void 0){switch(typeof r){case"number":return r;case"string":return parseFloat(r);default:return}}function c1(r,e=void 0){switch(typeof r){case"number":return r;case"string":return parseInt(r,10);default:return}}function Tp(r){switch(r){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1;default:return!1}}function IP(r,e){const t=kp.parseTextSync?.(r,e),n=t.WMT_MS_Capabilities||t.WMS_Capabilities||t,i=Que(n);if(e?.inheritedLayerProps)for(const s of i.layers)N6(s,null);return e?.includeRawJSON&&(i.json=n),e?.includeXMLText&&(i.xml=r),i}function Que(r){const e={version:String(r.version||""),name:String(r.Service?.Name||"unnamed"),title:r.Service?.Title?String(r.Service?.Title):void 0,abstract:r.Service?.Abstract?String(r.Service?.Abstract):void 0,keywords:My(r.Service?.KeywordList?.Keyword),fees:r.Service?.Fees?JSON.stringify(r.Service?.Fees):void 0,accessConstraints:r.Service?.AccessConstraints?JSON.stringify(r.Service?.AccessConstraints):void 0,layerLimit:c1(r.Service?.LayerLimit),maxWidth:c1(r.Service?.maxWidth),maxHeight:c1(r.Service?.maxHeight),layers:[],requests:efe(r.Capability?.Request),exceptions:tfe(r.Exception)},t=Np(r.Capability?.Layer);for(const n of t)e.layers.push(k6(n));for(const[n,i]of Object.entries(e))i===void 0&&delete e[n];return e}function efe(r){const e={};for(const[t,n]of Object.entries(r||{})){const i=My(n?.Format);e[t]={mimeTypes:i}}return e}function tfe(r){if(Np(r?.Format).length>0)return{mimeTypes:My(r)}}function k6(r){const e={title:String(r?.Title||""),name:r?.Name&&String(r?.Name),abstract:r?.Name&&String(r?.Abstract),keywords:My(r.KeywordList?.Keyword)},t=r?.CRS||r?.SRS;t&&Array.isArray(t)&&t.every(A=>typeof A=="string")&&(e.crs=t);let n=r?.EX_GeographicBoundingBox&&rfe(r?.EX_GeographicBoundingBox);n&&(e.geographicBoundingBox=n),n=r?.LatLonBoundingBox&&nfe(r?.LatLonBoundingBox),n&&(e.geographicBoundingBox=n);const i=r?.BoundingBox&&ife(r?.BoundingBox);i&&i.length>0&&(e.boundingBoxes=i);const o=Np(r?.Dimension).map(A=>ofe(A));o.length&&(e.dimensions=o),r?.opaque&&(e.opaque=Tp(r?.opaque)),r?.cascaded&&(e.cascaded=Tp(r?.cascaded)),r?.queryable&&(e.queryable=Tp(r?.queryable));const c=Np(r?.Layer),f=[];for(const A of c)f.push(k6(A));f.length>0&&(e.layers=f);for(const[A,v]of Object.entries(e))v===void 0&&delete e[A];return e}function rfe(r){const{westBoundLongitude:e,northBoundLatitude:t,eastBoundLongitude:n,southBoundLatitude:i}=r;return[[e,i],[n,t]]}function nfe(r){const{minx:e,miny:t,maxx:n,maxy:i}=r;return[[e,t],[n,i]]}function ife(r){return Np(r).map(t=>sfe(t))}function sfe(r){const{CRS:e,SRS:t,minx:n,miny:i,maxx:s,maxy:o,resx:c,resy:f}=r,A={crs:e||t,boundingBox:[[f0(n),f0(i)],[f0(s),f0(o)]]};return c&&(A.xResolution=c),f&&(A.yResolution=f),A}function ofe(r){const{name:e,units:t,value:n}=r,i={name:e,units:t,extent:n};return r.unitSymbol&&(i.unitSymbol=r.unitSymbol),r.default&&(i.defaultValue=r.default),r.multipleValues&&(i.multipleValues=Tp(r.multipleValues)),r.nearestValue&&(i.nearestValue=Tp(r.nearestValue)),r.current&&(i.current=Tp(r.current)),i}function N6(r,e){e?.geographicBoundingBox&&!r.geographicBoundingBox&&(r.geographicBoundingBox=[...e.geographicBoundingBox]),e?.crs&&!r.crs&&(r.crs=[...e.crs]),e?.boundingBoxes&&!r.boundingBoxes&&(r.boundingBoxes=[...e.boundingBoxes]),e?.dimensions&&!r.dimensions&&(r.dimensions=[...e.dimensions]);for(const t of r.layers||[])N6(t,r)}const afe="4.2.4",bC={dataType:null,batchType:null,id:"wms-capabilities",name:"WMS Capabilities",module:"wms",version:afe,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.wms_xml","application/xml","text/xml"],testText:cfe,options:{wms:{}},parse:async(r,e)=>IP(new TextDecoder().decode(r),e?.wms),parseTextSync:(r,e)=>IP(r,e?.wms)};function cfe(r){return r.startsWith("<?xml")}function MP(r,e){const n=(kp.parseTextSync?.(r,e)).FeatureInfoResponse?.FIELDS||[];return{features:(Array.isArray(n)?n:[n]).map(s=>lfe(s))}}function lfe(r){return{attributes:r||{},type:"",bounds:{bottom:0,top:0,left:0,right:0}}}const ufe={...bC,dataType:null,id:"wms-feature-info",name:"WMS FeatureInfo",parse:async(r,e)=>MP(new TextDecoder().decode(r),e),parseTextSync:(r,e)=>MP(r,e)};function PP(r,e){return kp.parseTextSync?.(r,e)}const ffe={...bC,dataType:null,id:"wms-layer-description",name:"WMS DescribeLayer",parse:async(r,e)=>PP(new TextDecoder().decode(r),e),parseTextSync:(r,e)=>PP(r,e)};function hfe(r,e){const{type:t="auto"}=r,n=t==="auto"?pfe(r.url,e):dfe(t,e);if(!n)throw new Error("Not a valid image source type");return n.create(r)}function dfe(r,e){for(const t of e)if(t.type===r)return t;return null}function pfe(r,e){for(const t of e)if(t.testURL&&t.testURL(r))return t;return null}const Afe="4.2.4",gfe=globalThis.loaders?.parseImageNode,fx=typeof Image<"u",hx=typeof ImageBitmap<"u",mfe=!!gfe,dx=P6?!0:mfe;function _fe(r){switch(r){case"auto":return hx||fx||dx;case"imagebitmap":return hx;case"image":return fx;case"data":return dx;default:throw new Error(`@loaders.gl/images: image ${r} not supported in this environment`)}}function yfe(){if(hx)return"imagebitmap";if(fx)return"image";if(dx)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function vfe(r){const e=bfe(r);if(!e)throw new Error("Not an image");return e}function xC(r){switch(vfe(r)){case"data":return r;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=r.width,e.height=r.height,t.drawImage(r,0,0),t.getImageData(0,0,r.width,r.height);default:throw new Error("getImageData")}}function bfe(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&r instanceof Image?"image":r&&typeof r=="object"&&r.data&&r.width&&r.height?"data":null}const xfe=/^data:image\/svg\+xml/,wfe=/\.svg((\?|#).*)?$/;function wC(r){return r&&(xfe.test(r)||wfe.test(r))}function Cfe(r,e){if(wC(e)){let n=new TextDecoder().decode(r);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return U6(r,e)}function U6(r,e){if(wC(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(r)])}async function z6(r,e,t){const n=Cfe(r,t),i=self.URL||self.webkitURL,s=typeof n!="string"&&i.createObjectURL(n);try{return await Tfe(s||n,e)}finally{s&&i.revokeObjectURL(s)}}async function Tfe(r,e){const t=new Image;return t.src=r,e.image&&e.image.decode&&t.decode?(await t.decode(),t):await new Promise((n,i)=>{try{t.onload=()=>n(t),t.onerror=s=>{const o=s instanceof Error?s.message:"error";i(new Error(o))}}catch(s){i(s)}})}const Efe={};let RP=!0;async function Bfe(r,e,t){let n;wC(t)?n=await z6(r,e,t):n=U6(r,t);const i=e&&e.imagebitmap;return await Sfe(n,i)}async function Sfe(r,e=null){if((Ife(e)||!RP)&&(e=null),e)try{return await createImageBitmap(r,e)}catch(t){console.warn(t),RP=!1}return await createImageBitmap(r)}function Ife(r){for(const e in r||Efe)return!1;return!0}function Mfe(r){return!Dfe(r,"ftyp",4)||(r[8]&96)===0?null:Pfe(r)}function Pfe(r){switch(Rfe(r,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function Rfe(r,e,t){return String.fromCharCode(...r.slice(e,t))}function Ffe(r){return[...r].map(e=>e.charCodeAt(0))}function Dfe(r,e,t=0){const n=Ffe(e);for(let i=0;i<n.length;++i)if(n[i]!==r[i+t])return!1;return!0}const ol=!1,pg=!0;function Py(r){const e=qg(r);return Lfe(e)||Ufe(e)||kfe(e)||Nfe(e)||Ofe(e)}function Ofe(r){const e=new Uint8Array(r instanceof DataView?r.buffer:r),t=Mfe(e);return t?{mimeType:t.mimeType,width:0,height:0}:null}function Lfe(r){const e=qg(r);return e.byteLength>=24&&e.getUint32(0,ol)===2303741511?{mimeType:"image/png",width:e.getUint32(16,ol),height:e.getUint32(20,ol)}:null}function kfe(r){const e=qg(r);return e.byteLength>=10&&e.getUint32(0,ol)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,pg),height:e.getUint16(8,pg)}:null}function Nfe(r){const e=qg(r);return e.byteLength>=14&&e.getUint16(0,ol)===16973&&e.getUint32(2,pg)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,pg),height:e.getUint32(22,pg)}:null}function Ufe(r){const e=qg(r);if(!(e.byteLength>=3&&e.getUint16(0,ol)===65496&&e.getUint8(2)===255))return null;const{tableMarkers:n,sofMarkers:i}=zfe();let s=2;for(;s+9<e.byteLength;){const o=e.getUint16(s,ol);if(i.has(o))return{mimeType:"image/jpeg",height:e.getUint16(s+5,ol),width:e.getUint16(s+7,ol)};if(!n.has(o))return null;s+=2,s+=e.getUint16(s,ol)}return null}function zfe(){const r=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)r.add(t);return{tableMarkers:r,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function qg(r){if(r instanceof DataView)return r;if(ArrayBuffer.isView(r))return new DataView(r.buffer);if(r instanceof ArrayBuffer)return new DataView(r);throw new Error("toDataView")}async function Gfe(r,e){const{mimeType:t}=Py(r)||{},n=globalThis.loaders?.parseImageNode;return Ai(n),await n(r,t)}async function Vfe(r,e,t){e=e||{};const i=(e.image||{}).type||"auto",{url:s}=t||{},o=Hfe(i);let c;switch(o){case"imagebitmap":c=await Bfe(r,e,s);break;case"image":c=await z6(r,e,s);break;case"data":c=await Gfe(r);break;default:Ai(!1)}return i==="data"&&(c=xC(c)),c}function Hfe(r){switch(r){case"auto":case"data":return yfe();default:return _fe(r),r}}const jfe=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],$fe=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Wfe={image:{type:"auto",decode:!0}},Pg={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:Afe,mimeTypes:$fe,extensions:jfe,parse:Vfe,tests:[r=>!!Py(new DataView(r))],options:Wfe},l1={};function G6(r){if(l1[r]===void 0){const e=P6?Xfe(r):Jfe(r);l1[r]=e}return l1[r]}function Jfe(r){const e=["image/png","image/jpeg","image/gif"],t=globalThis.loaders?.imageFormatsNode||e;return!!globalThis.loaders?.parseImageNode&&t.includes(r)}function Xfe(r){switch(r){case"image/avif":case"image/webp":return Kfe(r);default:return!0}}function Kfe(r){try{return document.createElement("canvas").toDataURL(r).indexOf(`data:${r}`)===0}catch{return!1}}const qfe={type:"wms",testURL:r=>r.toLowerCase().includes("wms"),create:r=>new Yfe(r)};class Yfe extends vC{url;data;substituteCRS84;flipCRS;wmsParameters;vendorParameters;capabilities=null;constructor(e){super(e),this.url=e.url,this.data=e.url,this.substituteCRS84=e.substituteCRS84??!1,this.flipCRS=["EPSG:4326"],this.wmsParameters={layers:void 0,query_layers:void 0,styles:void 0,version:"1.3.0",crs:"EPSG:4326",format:"image/png",info_format:"text/plain",transparent:void 0,time:void 0,elevation:void 0,...e.wmsParameters},this.vendorParameters=e.vendorParameters||{}}async getMetadata(){const e=await this.getCapabilities();return this.normalizeMetadata(e)}async getImage(e){const{boundingBox:t,bbox:n,...i}=e,s={bbox:t?[...t[0],...t[1]]:n,...i};return await this.getMap(s)}normalizeMetadata(e){return e}async getCapabilities(e,t){const n=this.getCapabilitiesURL(e,t),i=await this.fetch(n),s=await i.arrayBuffer();this._checkResponse(i,s);const o=await bC.parse(s,this.loadOptions);return this.capabilities=o,o}async getMap(e,t){const n=this.getMapURL(e,t),i=await this.fetch(n),s=await i.arrayBuffer();this._checkResponse(i,s);try{return await Pg.parse(s,this.loadOptions)}catch{throw this._parseError(s)}}async getFeatureInfo(e,t){const n=this.getFeatureInfoURL(e,t),i=await this.fetch(n),s=await i.arrayBuffer();return this._checkResponse(i,s),await ufe.parse(s,this.loadOptions)}async getFeatureInfoText(e,t){const n=this.getFeatureInfoURL(e,t),i=await this.fetch(n),s=await i.arrayBuffer();return this._checkResponse(i,s),new TextDecoder().decode(s)}async describeLayer(e,t){const n=this.describeLayerURL(e,t),i=await this.fetch(n),s=await i.arrayBuffer();return this._checkResponse(i,s),await ffe.parse(s,this.loadOptions)}async getLegendGraphic(e,t){const n=this.getLegendGraphicURL(e,t),i=await this.fetch(n),s=await i.arrayBuffer();this._checkResponse(i,s);try{return await Pg.parse(s,this.loadOptions)}catch{throw this._parseError(s)}}getCapabilitiesURL(e,t){const n={version:this.wmsParameters.version,...e};return this._getWMSUrl("GetCapabilities",n,t)}getMapURL(e,t){e=this._getWMS130Parameters(e);const n={version:this.wmsParameters.version,format:this.wmsParameters.format,transparent:this.wmsParameters.transparent,time:this.wmsParameters.time,elevation:this.wmsParameters.elevation,layers:this.wmsParameters.layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...e};return this._getWMSUrl("GetMap",n,t)}getFeatureInfoURL(e,t){e=this._getWMS130Parameters(e);const{boundingBox:n,bbox:i}=e;e.bbox=n?[...n[0],...n[1]]:i;const s={version:this.wmsParameters.version,info_format:this.wmsParameters.info_format,layers:this.wmsParameters.layers,query_layers:this.wmsParameters.query_layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...e};return this._getWMSUrl("GetFeatureInfo",s,t)}describeLayerURL(e,t){const n={version:this.wmsParameters.version,...e};return this._getWMSUrl("DescribeLayer",n,t)}getLegendGraphicURL(e,t){const n={version:this.wmsParameters.version,...e};return this._getWMSUrl("GetLegendGraphic",n,t)}_parseWMSUrl(e){const[t,n]=e.split("?"),i=n.split("&"),s={};for(const o of i){const[c,f]=o.split("=");s[c]=f}return{url:t,parameters:s}}_getWMSUrl(e,t,n){let i=this.url,s=!0;const o={service:"WMS",version:t.version,request:e,...t,...this.vendorParameters,...n},c=["transparent","time","elevation"];for(const[f,A]of Object.entries(o))(!c.includes(f)||A)&&(i+=s?"?":"&",s=!1,i+=this._getURLParameter(f,A,t));return encodeURI(i)}_getWMS130Parameters(e){const t={...e};return t.srs&&(t.crs=t.crs||t.srs,delete t.srs),t}_getURLParameter(e,t,n){switch(e){case"crs":n.version!=="1.3.0"?e="srs":this.substituteCRS84&&t==="EPSG:4326"&&(t="CRS:84");break;case"srs":n.version==="1.3.0"&&(e="crs");break;case"bbox":const i=this._flipBoundingBox(t,n);i&&(t=i);break;case"x":n.version==="1.3.0"&&(e="i");break;case"y":n.version==="1.3.0"&&(e="j");break}return e=e.toUpperCase(),Array.isArray(t)?`${e}=${t.join(",")}`:`${e}=${t?String(t):""}`}_flipBoundingBox(e,t){if(!Array.isArray(e)||e.length!==4)return null;const n=t.version==="1.3.0"&&this.flipCRS.includes(t.crs||"")&&!(this.substituteCRS84&&t.crs==="EPSG:4326"),i=e;return n?[i[1],i[0],i[3],i[2]]:i}async _fetchArrayBuffer(e){const t=await this.fetch(e),n=await t.arrayBuffer();return this._checkResponse(t,n),n}_checkResponse(e,t){const n=e.headers["content-type"];if(!e.ok||Z0.mimeTypes.includes(n)){const i=Bue(this.loadOptions,{wms:{throwOnError:!0}}),s=Z0.parseSync?.(t,i);throw new Error(s)}}_parseError(e){const t=Z0.parseSync?.(e,this.loadOptions);return new Error(t)}}class Zfe extends vC{static type="template";static testURL=e=>e.toLowerCase().includes("{");constructor(e){super(e)}async getMetadata(){throw new Error("ImageSource.getMetadata not implemented")}async getImage(e){const t=this.getGranularParameters(e),n=this.getURLFromTemplate(t),s=await(await this.fetch(n)).arrayBuffer();return await Pg.parse(s)}getGranularParameters(e){const[[t,n],[i,s]]=e.boundingBox;return{...e,east:t,north:n,south:s,west:i}}getURLFromTemplate(e){let t=this.props.url;for(const[n,i]of Object.entries(e))t=t.replace(`\${${n}}`,String(i)),t=t.replace(`{${n}}`,String(i));return t}}class Qfe extends Zfe{data;constructor(e){super(e),this.data=e.url}async getMetadata(){return await this.metadata()}async getImage(e){throw new Error("not implemented")}async metadata(){throw new Error("not implemented")}exportImage(e){throw new Error("not implemented")}metadataURL(e){return`${this.props.url}?f=pjson`}exportImageURL(e){const t=`bbox=${e.bbox[0]},${e.bbox[1]},${e.bbox[2]},${e.bbox[3]}`,n=`size=${e.width},${e.height}`,i={...e,bbox:t,size:n};return delete i.width,delete i.height,this.getUrl("exportImage",i)}getUrl(e,t,n){let i=`${this.props.url}/${e}`,s=!0;for(const[o,c]of Object.entries(t))i+=s?"?":"&",s=!1,Array.isArray(c)?i+=`${o.toUpperCase()}=${c.join(",")}`:i+=`${o.toUpperCase()}=${c?String(c):""}`;return i}async checkResponse(e){if(!e.ok)throw new Error("error")}}const ehe={type:"arcgis-image-server",testURL:r=>r.toLowerCase().includes("ImageServer"),create:r=>new Qfe(r)},the=[qfe,ehe];function rhe(r){return hfe(r,the)}const FP=6378137*Math.PI;function DP(r){const e=eu(r);return e[0]=(e[0]/256-1)*FP,e[1]=(e[1]/256-1)*FP,e}const nhe={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:()=>{}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:()=>{}},onImageLoad:{type:"function",value:()=>{}},onImageLoadError:{type:"function",compare:!1,value:(r,e)=>console.error(e,r)}};class CC extends Bs{get isLoaded(){return this.state?.loadCounter===0&&super.isLoaded}shouldUpdateState(){return!0}initializeState(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0}updateState({changeFlags:e,props:t,oldProps:n}){const{viewport:i}=this.context;e.dataChanged||t.serviceType!==n.serviceType?(this.state.imageSource=this._createImageSource(t),this._loadMetadata(),this.debounce(()=>this.loadImage(i,"image source changed"),0)):rs(t.layers,n.layers,1)?e.viewportChanged&&this.debounce(()=>this.loadImage(i,"viewport changed")):this.debounce(()=>this.loadImage(i,"layers changed"),0)}finalizeState(){}renderLayers(){const{bounds:e,image:t,lastRequestParameters:n}=this.state;return t&&new By({...this.getSubLayerProps({id:"bitmap"}),_imageCoordinateSystem:n.srs==="EPSG:4326"?Qr.LNGLAT:Qr.CARTESIAN,bounds:e,image:t})}async getFeatureInfoText(e,t){const{lastRequestParameters:n}=this.state;return n?await this.state.imageSource.getFeatureInfoText?.({...n,query_layers:n.layers,x:e,y:t,info_format:"application/vnd.ogc.gml"}):""}_createImageSource(e){if(e.data instanceof vC)return e.data;if(typeof e.data=="string")return rhe({url:e.data,loadOptions:e.loadOptions,type:e.serviceType});throw new Error("invalid image source in props.data")}async _loadMetadata(){const{imageSource:e}=this.state;try{this.state.loadCounter++;const t=await e.getMetadata();this.state.imageSource===e&&this.getCurrentLayer()?.props.onMetadataLoad(t)}catch(t){this.getCurrentLayer()?.props.onMetadataLoadError(t)}finally{this.state.loadCounter--}}async loadImage(e,t){const{layers:n,serviceType:i}=this.props;if(i==="wms"&&n.length===0)return;const s=e.getBounds(),{width:o,height:c}=e,f=this.getRequestId();let{srs:A}=this.props;A==="auto"&&(A=e.resolution?"EPSG:4326":"EPSG:3857");const v={width:o,height:c,boundingBox:[[s[0],s[1]],[s[2],s[3]]],layers:n,crs:A};if(A==="EPSG:3857"){const w=DP([s[0],s[1]]),S=DP([s[2],s[3]]);v.boundingBox=[w,S]}try{this.state.loadCounter++,this.props.onImageLoadStart(f);const w=await this.state.imageSource.getImage(v);this.state.lastRequestId<f&&(this.getCurrentLayer()?.props.onImageLoad(f),this.setState({image:w,bounds:s,lastRequestParameters:v,lastRequestId:f}))}catch(w){this.raiseError(w,"Load image"),this.getCurrentLayer()?.props.onImageLoadError(f,w)}finally{this.state.loadCounter--}}getRequestId(){return this.state._nextRequestId++}debounce(e,t=500){clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout(()=>e(),t)}}CC.layerName="WMSLayer";CC.defaultProps=nhe;const ihe={getHeight:{type:"accessor",value:0},greatCircle:!0};class TC extends jg{}TC.layerName="GreatCircleLayer";TC.defaultProps=ihe;const she={...hf.defaultProps};class df extends Bs{indexToBounds(){return null}renderLayers(){const{elevationScale:e,extruded:t,wireframe:n,filled:i,stroked:s,lineWidthUnits:o,lineWidthScale:c,lineWidthMinPixels:f,lineWidthMaxPixels:A,lineJointRounded:v,lineMiterLimit:w,lineDashJustified:S,getElevation:F,getFillColor:N,getLineColor:U,getLineWidth:$}=this.props,{updateTriggers:G,material:H,transitions:J}=this.props,ue=this.getSubLayerClass("cell",hf),{updateTriggers:q,...se}=this.indexToBounds()||{};return new ue({filled:i,wireframe:n,extruded:t,elevationScale:e,stroked:s,lineWidthUnits:o,lineWidthScale:c,lineWidthMinPixels:f,lineWidthMaxPixels:A,lineJointRounded:v,lineMiterLimit:w,lineDashJustified:S,material:H,transitions:J,getElevation:F,getFillColor:N,getLineColor:U,getLineWidth:$},this.getSubLayerProps({id:"cell",updateTriggers:G&&{...q,getElevation:G.getElevation,getFillColor:G.getFillColor,getLineColor:G.getLineColor,getLineWidth:G.getLineWidth}}),se)}}df.layerName="GeoCellLayer";df.defaultProps=she;function ohe(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Q0={exports:{}},ahe=Q0.exports,OP;function che(){return OP||(OP=1,function(r){(function(e,t){typeof ohe=="function"&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(ahe,function(){function e(me,pe,W){this.low=me|0,this.high=pe|0,this.unsigned=!!W}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1});function t(me){return(me&&me.__isLong__)===!0}e.isLong=t;var n={},i={};function s(me,pe){var W,re,Ee;return pe?(me>>>=0,(Ee=0<=me&&me<256)&&(re=i[me],re)?re:(W=c(me,(me|0)<0?-1:0,!0),Ee&&(i[me]=W),W)):(me|=0,(Ee=-128<=me&&me<128)&&(re=n[me],re)?re:(W=c(me,me<0?-1:0,!1),Ee&&(n[me]=W),W))}e.fromInt=s;function o(me,pe){if(isNaN(me)||!isFinite(me))return pe?H:G;if(pe){if(me<0)return H;if(me>=N)return Te}else{if(me<=-U)return Ue;if(me+1>=U)return se}return me<0?o(-me,pe).neg():c(me%F|0,me/F|0,pe)}e.fromNumber=o;function c(me,pe,W){return new e(me,pe,W)}e.fromBits=c;var f=Math.pow;function A(me,pe,W){if(me.length===0)throw Error("empty string");if(me==="NaN"||me==="Infinity"||me==="+Infinity"||me==="-Infinity")return G;if(typeof pe=="number"?(W=pe,pe=!1):pe=!!pe,W=W||10,W<2||36<W)throw RangeError("radix");var re;if((re=me.indexOf("-"))>0)throw Error("interior hyphen");if(re===0)return A(me.substring(1),pe,W).neg();for(var Ee=o(f(W,8)),et=G,_e=0;_e<me.length;_e+=8){var Le=Math.min(8,me.length-_e),Ge=parseInt(me.substring(_e,_e+Le),W);if(Le<8){var Ze=o(f(W,Le));et=et.mul(Ze).add(o(Ge))}else et=et.mul(Ee),et=et.add(o(Ge))}return et.unsigned=pe,et}e.fromString=A;function v(me){return me instanceof e?me:typeof me=="number"?o(me):typeof me=="string"?A(me):c(me.low,me.high,me.unsigned)}e.fromValue=v;var w=65536,S=1<<24,F=w*w,N=F*F,U=N/2,$=s(S),G=s(0);e.ZERO=G;var H=s(0,!0);e.UZERO=H;var J=s(1);e.ONE=J;var ue=s(1,!0);e.UONE=ue;var q=s(-1);e.NEG_ONE=q;var se=c(-1,2147483647,!1);e.MAX_VALUE=se;var Te=c(-1,-1,!0);e.MAX_UNSIGNED_VALUE=Te;var Ue=c(0,-2147483648,!1);e.MIN_VALUE=Ue;var de=e.prototype;return de.toInt=function(){return this.unsigned?this.low>>>0:this.low},de.toNumber=function(){return this.unsigned?(this.high>>>0)*F+(this.low>>>0):this.high*F+(this.low>>>0)},de.toString=function(pe){if(pe=pe||10,pe<2||36<pe)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(Ue)){var W=o(pe),re=this.div(W),Ee=re.mul(W).sub(this);return re.toString(pe)+Ee.toInt().toString(pe)}else return"-"+this.neg().toString(pe);for(var et=o(f(pe,6),this.unsigned),_e=this,Le="";;){var Ge=_e.div(et),Ze=_e.sub(Ge.mul(et)).toInt()>>>0,tt=Ze.toString(pe);if(_e=Ge,_e.isZero())return tt+Le;for(;tt.length<6;)tt="0"+tt;Le=""+tt+Le}},de.getHighBits=function(){return this.high},de.getHighBitsUnsigned=function(){return this.high>>>0},de.getLowBits=function(){return this.low},de.getLowBitsUnsigned=function(){return this.low>>>0},de.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Ue)?64:this.neg().getNumBitsAbs();for(var pe=this.high!=0?this.high:this.low,W=31;W>0&&(pe&1<<W)==0;W--);return this.high!=0?W+33:W+1},de.isZero=function(){return this.high===0&&this.low===0},de.isNegative=function(){return!this.unsigned&&this.high<0},de.isPositive=function(){return this.unsigned||this.high>=0},de.isOdd=function(){return(this.low&1)===1},de.isEven=function(){return(this.low&1)===0},de.equals=function(pe){return t(pe)||(pe=v(pe)),this.unsigned!==pe.unsigned&&this.high>>>31===1&&pe.high>>>31===1?!1:this.high===pe.high&&this.low===pe.low},de.eq=de.equals,de.notEquals=function(pe){return!this.eq(pe)},de.neq=de.notEquals,de.lessThan=function(pe){return this.comp(pe)<0},de.lt=de.lessThan,de.lessThanOrEqual=function(pe){return this.comp(pe)<=0},de.lte=de.lessThanOrEqual,de.greaterThan=function(pe){return this.comp(pe)>0},de.gt=de.greaterThan,de.greaterThanOrEqual=function(pe){return this.comp(pe)>=0},de.gte=de.greaterThanOrEqual,de.compare=function(pe){if(t(pe)||(pe=v(pe)),this.eq(pe))return 0;var W=this.isNegative(),re=pe.isNegative();return W&&!re?-1:!W&&re?1:this.unsigned?pe.high>>>0>this.high>>>0||pe.high===this.high&&pe.low>>>0>this.low>>>0?-1:1:this.sub(pe).isNegative()?-1:1},de.comp=de.compare,de.negate=function(){return!this.unsigned&&this.eq(Ue)?Ue:this.not().add(J)},de.neg=de.negate,de.add=function(pe){t(pe)||(pe=v(pe));var W=this.high>>>16,re=this.high&65535,Ee=this.low>>>16,et=this.low&65535,_e=pe.high>>>16,Le=pe.high&65535,Ge=pe.low>>>16,Ze=pe.low&65535,tt=0,rt=0,ut=0,vt=0;return vt+=et+Ze,ut+=vt>>>16,vt&=65535,ut+=Ee+Ge,rt+=ut>>>16,ut&=65535,rt+=re+Le,tt+=rt>>>16,rt&=65535,tt+=W+_e,tt&=65535,c(ut<<16|vt,tt<<16|rt,this.unsigned)},de.subtract=function(pe){return t(pe)||(pe=v(pe)),this.add(pe.neg())},de.sub=de.subtract,de.multiply=function(pe){if(this.isZero()||(t(pe)||(pe=v(pe)),pe.isZero()))return G;if(this.eq(Ue))return pe.isOdd()?Ue:G;if(pe.eq(Ue))return this.isOdd()?Ue:G;if(this.isNegative())return pe.isNegative()?this.neg().mul(pe.neg()):this.neg().mul(pe).neg();if(pe.isNegative())return this.mul(pe.neg()).neg();if(this.lt($)&&pe.lt($))return o(this.toNumber()*pe.toNumber(),this.unsigned);var W=this.high>>>16,re=this.high&65535,Ee=this.low>>>16,et=this.low&65535,_e=pe.high>>>16,Le=pe.high&65535,Ge=pe.low>>>16,Ze=pe.low&65535,tt=0,rt=0,ut=0,vt=0;return vt+=et*Ze,ut+=vt>>>16,vt&=65535,ut+=Ee*Ze,rt+=ut>>>16,ut&=65535,ut+=et*Ge,rt+=ut>>>16,ut&=65535,rt+=re*Ze,tt+=rt>>>16,rt&=65535,rt+=Ee*Ge,tt+=rt>>>16,rt&=65535,rt+=et*Le,tt+=rt>>>16,rt&=65535,tt+=W*Ze+re*Ge+Ee*Le+et*_e,tt&=65535,c(ut<<16|vt,tt<<16|rt,this.unsigned)},de.mul=de.multiply,de.divide=function(pe){if(t(pe)||(pe=v(pe)),pe.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?H:G;var W,re,Ee;if(this.unsigned){if(pe.unsigned||(pe=pe.toUnsigned()),pe.gt(this))return H;if(pe.gt(this.shru(1)))return ue;Ee=H}else{if(this.eq(Ue)){if(pe.eq(J)||pe.eq(q))return Ue;if(pe.eq(Ue))return J;var et=this.shr(1);return W=et.div(pe).shl(1),W.eq(G)?pe.isNegative()?J:q:(re=this.sub(pe.mul(W)),Ee=W.add(re.div(pe)),Ee)}else if(pe.eq(Ue))return this.unsigned?H:G;if(this.isNegative())return pe.isNegative()?this.neg().div(pe.neg()):this.neg().div(pe).neg();if(pe.isNegative())return this.div(pe.neg()).neg();Ee=G}for(re=this;re.gte(pe);){W=Math.max(1,Math.floor(re.toNumber()/pe.toNumber()));for(var _e=Math.ceil(Math.log(W)/Math.LN2),Le=_e<=48?1:f(2,_e-48),Ge=o(W),Ze=Ge.mul(pe);Ze.isNegative()||Ze.gt(re);)W-=Le,Ge=o(W,this.unsigned),Ze=Ge.mul(pe);Ge.isZero()&&(Ge=J),Ee=Ee.add(Ge),re=re.sub(Ze)}return Ee},de.div=de.divide,de.modulo=function(pe){return t(pe)||(pe=v(pe)),this.sub(this.div(pe).mul(pe))},de.mod=de.modulo,de.not=function(){return c(~this.low,~this.high,this.unsigned)},de.and=function(pe){return t(pe)||(pe=v(pe)),c(this.low&pe.low,this.high&pe.high,this.unsigned)},de.or=function(pe){return t(pe)||(pe=v(pe)),c(this.low|pe.low,this.high|pe.high,this.unsigned)},de.xor=function(pe){return t(pe)||(pe=v(pe)),c(this.low^pe.low,this.high^pe.high,this.unsigned)},de.shiftLeft=function(pe){return t(pe)&&(pe=pe.toInt()),(pe&=63)===0?this:pe<32?c(this.low<<pe,this.high<<pe|this.low>>>32-pe,this.unsigned):c(0,this.low<<pe-32,this.unsigned)},de.shl=de.shiftLeft,de.shiftRight=function(pe){return t(pe)&&(pe=pe.toInt()),(pe&=63)===0?this:pe<32?c(this.low>>>pe|this.high<<32-pe,this.high>>pe,this.unsigned):c(this.high>>pe-32,this.high>=0?0:-1,this.unsigned)},de.shr=de.shiftRight,de.shiftRightUnsigned=function(pe){if(t(pe)&&(pe=pe.toInt()),pe&=63,pe===0)return this;var W=this.high;if(pe<32){var re=this.low;return c(re>>>pe|W<<32-pe,W>>>pe,this.unsigned)}else return pe===32?c(W,0,this.unsigned):c(W>>>pe-32,0,this.unsigned)},de.shru=de.shiftRightUnsigned,de.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},de.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},de.toBytes=function(me){return me?this.toBytesLE():this.toBytesBE()},de.toBytesLE=function(){var me=this.high,pe=this.low;return[pe&255,pe>>>8&255,pe>>>16&255,pe>>>24&255,me&255,me>>>8&255,me>>>16&255,me>>>24&255]},de.toBytesBE=function(){var me=this.high,pe=this.low;return[me>>>24&255,me>>>16&255,me>>>8&255,me&255,pe>>>24&255,pe>>>16&255,pe>>>8&255,pe&255]},e})}(Q0)),Q0.exports}var lhe=che();const e_=_h(lhe),uhe=3,fhe=30,hhe=2*fhe+1,LP=180/Math.PI;function dhe(r,e,t){const n=1<<e;return[(r[0]+t[0])/n,(r[1]+t[1])/n]}function kP(r){return r>=.5?1/3*(4*r*r-1):1/3*(1-4*(1-r)*(1-r))}function phe(r){return[kP(r[0]),kP(r[1])]}function Ahe(r,[e,t]){switch(r){case 0:return[1,e,t];case 1:return[-e,1,t];case 2:return[-e,-t,1];case 3:return[-1,-t,-e];case 4:return[t,-1,-e];case 5:return[t,e,-1];default:throw new Error("Invalid face")}}function ghe([r,e,t]){const n=Math.atan2(t,Math.sqrt(r*r+e*e));return[Math.atan2(e,r)*LP,n*LP]}function mhe(r){let e=e_.fromString(r,!0,10).toString(2);for(;e.length<uhe+hhe;)e="0"+e;const t=e.lastIndexOf("1"),n=e.substring(0,3),i=e.substring(3,t),s=i.length/2,o=e_.fromString(n,!0,2).toString(10);let c=e_.fromString(i,!0,2).toString(4);for(;c.length<s;)c="0"+c;return`${o}/${c}`}function _he(r,e,t,n){if(n===0){t===1&&(e[0]=r-1-e[0],e[1]=r-1-e[1]);const i=e[0];e[0]=e[1],e[1]=i}}function yhe(r){const e=r.split("/"),t=parseInt(e[0],10),n=e[1],i=n.length,s=[0,0];let o;for(let c=i-1;c>=0;c--){o=i-c;const f=n[c];let A=0,v=0;f==="1"?v=1:f==="2"?(A=1,v=1):f==="3"&&(A=1);const w=Math.pow(2,o-1);_he(w,s,A,v),s[0]+=w*A,s[1]+=w*v}if(t%2===1){const c=s[0];s[0]=s[1],s[1]=c}return{face:t,ij:s,level:o}}function vhe(r){const e=r.padEnd(16,"0");return e_.fromString(e,16)}const bhe=100;function xhe({face:r,ij:e,level:t}){const n=[[0,0],[0,1],[1,1],[1,0],[0,0]],i=Math.max(1,Math.ceil(bhe*Math.pow(2,-t))),s=new Float64Array(4*i*2+2);let o=0,c=0;for(let f=0;f<4;f++){const A=n[f].slice(0),v=n[f+1],w=(v[0]-A[0])/i,S=(v[1]-A[1])/i;for(let F=0;F<i;F++){A[0]+=w,A[1]+=S;const N=dhe(e,t,A),U=phe(N),$=Ahe(r,U),G=ghe($);Math.abs(G[1])>89.999&&(G[0]=c);const H=G[0]-c;G[0]+=H>180?-360:H<-180?360:0,s[o++]=G[0],s[o++]=G[1],c=G[0]}}return s[o++]=s[0],s[o++]=s[1],s}function whe(r){if(typeof r=="string"){if(r.indexOf("/")>0)return r;r=vhe(r)}return mhe(r.toString())}function Che(r){const e=whe(r),t=yhe(e);return xhe(t)}const The={getS2Token:{type:"accessor",value:r=>r.token}};class Ry extends df{indexToBounds(){const{data:e,getS2Token:t}=this.props;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(n,i)=>Che(t(n,i))}}}Ry.layerName="S2Layer";Ry.defaultProps=The;const u1=512;function Ehe(r,e){let t=0,n=0,i=1<<r.length;const s=i/u1;for(let o=0;o<r.length;o++){i>>=1;const c=parseInt(r[o]);c%2&&(t|=i),c>1&&(n|=i)}return[[t/s,u1-n/s],[(t+e)/s,u1-(n+e)/s]]}function Bhe(r,e=1){const[t,n]=Ehe(r,e),[i,s]=hl(t),[o,c]=hl(n);return[o,s,o,c,i,c,i,s,o,s]}const She={getQuadkey:{type:"accessor",value:r=>r.quadkey}};class Fy extends df{indexToBounds(){const{data:e,extruded:t,getQuadkey:n}=this.props,i=t?.99:1;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(s,o)=>Bhe(n(s,o),i),updateTriggers:{getPolygon:i}}}}Fy.layerName="QuadkeyLayer";Fy.defaultProps=She;class V6{constructor(e){this.index=e,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get bbox(){return this._bbox}set bbox(e){this._bbox||(this._bbox=e,"west"in e?this.boundingBox=[[e.west,e.south],[e.east,e.north]]:this.boundingBox=[[e.left,e.top],[e.right,e.bottom]])}get data(){return this.isLoading&&this._loader?this._loader.then(()=>this.data):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return!!this._loader&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){const e=this.content?this.content.byteLength:0;return Number.isFinite(e)||console.error("byteLength not defined in tile data"),e}async _loadData({getData:e,requestScheduler:t,onLoad:n,onError:i}){const{index:s,id:o,bbox:c,userData:f,zoom:A}=this,v=this._loaderId;this._abortController=new AbortController;const{signal:w}=this._abortController,S=await t.scheduleRequest(this,U=>U.isSelected?1:-1);if(!S){this._isCancelled=!0;return}if(this._isCancelled){S.done();return}let F=null,N;try{F=await e({index:s,id:o,bbox:c,userData:f,zoom:A,signal:w})}catch(U){N=U||!0}finally{S.done()}if(v===this._loaderId){if(this._loader=void 0,this.content=F,this._isCancelled&&!F){this._isLoaded=!1;return}this._isLoaded=!0,this._isCancelled=!1,N?i(N,this):n(this)}}loadData(e){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(e),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){this.isLoaded||(this._isCancelled=!0,this._abortController?.abort())}}const go={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},NP=new dt,Ihe=new dt;class EC{constructor(e=[0,0,0],t=[0,0,0],n){n=n||NP.copy(e).add(t).scale(.5),this.center=new dt(n),this.halfDiagonal=new dt(t).subtract(this.center),this.minimum=new dt(e),this.maximum=new dt(t)}clone(){return new EC(this.minimum,this.maximum,this.center)}equals(e){return this===e||!!e&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}transform(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}intersectPlane(e){const{halfDiagonal:t}=this,n=Ihe.from(e.normal),i=t.x*Math.abs(n.x)+t.y*Math.abs(n.y)+t.z*Math.abs(n.z),s=this.center.dot(n)+e.distance;return s-i>0?go.INSIDE:s+i<0?go.OUTSIDE:go.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=NP.from(e).subtract(this.center),{halfDiagonal:n}=this;let i=0,s;return s=Math.abs(t.x)-n.x,s>0&&(i+=s*s),s=Math.abs(t.y)-n.y,s>0&&(i+=s*s),s=Math.abs(t.z)-n.z,s>0&&(i+=s*s),i}}const LA=new dt,UP=new dt;class Yg{constructor(e=[0,0,0],t=0){this.radius=-0,this.center=new dt,this.fromCenterRadius(e,t)}fromCenterRadius(e,t){return this.center.from(e),this.radius=t,this}fromCornerPoints(e,t){return t=LA.from(t),this.center=new dt().from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}equals(e){return this===e||!!e&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new Yg(this.center,this.radius)}union(e){const t=this.center,n=this.radius,i=e.center,s=e.radius,o=LA.copy(i).subtract(t),c=o.magnitude();if(n>=c+s)return this.clone();if(s>=c+n)return e.clone();const f=(n+c+s)*.5;return UP.copy(o).scale((-n+f)/c).add(t),this.center.copy(UP),this.radius=f,this}expand(e){const n=LA.from(e).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(e){this.center.transform(e);const t=ej(LA,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){const t=this.distanceTo(e);return t*t}distanceTo(e){const n=LA.from(e).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(e){const t=this.center,n=this.radius,s=e.normal.dot(t)+e.distance;return s<-n?go.OUTSIDE:s<n?go.INTERSECTING:go.INSIDE}}const Mhe=new dt,Phe=new dt,h0=new dt,d0=new dt,p0=new dt,Rhe=new dt,Fhe=new dt,Hl={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8};class Zg{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){this.center=new dt().from(e),this.halfAxes=new gi(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new dt(e).len(),new dt(t).len(),new dt(n).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new dt(e).normalize(),s=new dt(t).normalize(),o=new dt(n).normalize();return new vg().fromMatrix3(new gi([...i,...s,...o]))}fromCenterHalfSizeQuaternion(e,t,n){const i=new vg(n),s=new gi().fromQuaternion(i);return s[0]=s[0]*t[0],s[1]=s[1]*t[0],s[2]=s[2]*t[0],s[3]=s[3]*t[1],s[4]=s[4]*t[1],s[5]=s[5]*t[1],s[6]=s[6]*t[2],s[7]=s[7]*t[2],s[8]=s[8]*t[2],this.center=new dt().from(e),this.halfAxes=s,this}clone(){return new Zg(this.center,this.halfAxes)}equals(e){return this===e||!!e&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new Yg){const t=this.halfAxes,n=t.getColumn(0,h0),i=t.getColumn(1,d0),s=t.getColumn(2,p0),o=Mhe.copy(n).add(i).add(s);return e.center.copy(this.center),e.radius=o.magnitude(),e}intersectPlane(e){const t=this.center,n=e.normal,i=this.halfAxes,s=n.x,o=n.y,c=n.z,f=Math.abs(s*i[Hl.COLUMN0ROW0]+o*i[Hl.COLUMN0ROW1]+c*i[Hl.COLUMN0ROW2])+Math.abs(s*i[Hl.COLUMN1ROW0]+o*i[Hl.COLUMN1ROW1]+c*i[Hl.COLUMN1ROW2])+Math.abs(s*i[Hl.COLUMN2ROW0]+o*i[Hl.COLUMN2ROW1]+c*i[Hl.COLUMN2ROW2]),A=n.dot(t)+e.distance;return A<=-f?go.OUTSIDE:A>=f?go.INSIDE:go.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=Phe.from(e).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,h0),s=n.getColumn(1,d0),o=n.getColumn(2,p0),c=i.magnitude(),f=s.magnitude(),A=o.magnitude();i.normalize(),s.normalize(),o.normalize();let v=0,w;return w=Math.abs(t.dot(i))-c,w>0&&(v+=w*w),w=Math.abs(t.dot(s))-f,w>0&&(v+=w*w),w=Math.abs(t.dot(o))-A,w>0&&(v+=w*w),v}computePlaneDistances(e,t,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;const o=this.center,c=this.halfAxes,f=c.getColumn(0,h0),A=c.getColumn(1,d0),v=c.getColumn(2,p0),w=Rhe.copy(f).add(A).add(v).add(o),S=Fhe.copy(w).subtract(e);let F=t.dot(S);return i=Math.min(F,i),s=Math.max(F,s),w.copy(o).add(f).add(A).subtract(v),S.copy(w).subtract(e),F=t.dot(S),i=Math.min(F,i),s=Math.max(F,s),w.copy(o).add(f).subtract(A).add(v),S.copy(w).subtract(e),F=t.dot(S),i=Math.min(F,i),s=Math.max(F,s),w.copy(o).add(f).subtract(A).subtract(v),S.copy(w).subtract(e),F=t.dot(S),i=Math.min(F,i),s=Math.max(F,s),o.copy(w).subtract(f).add(A).add(v),S.copy(w).subtract(e),F=t.dot(S),i=Math.min(F,i),s=Math.max(F,s),o.copy(w).subtract(f).add(A).subtract(v),S.copy(w).subtract(e),F=t.dot(S),i=Math.min(F,i),s=Math.max(F,s),o.copy(w).subtract(f).subtract(A).add(v),S.copy(w).subtract(e),F=t.dot(S),i=Math.min(F,i),s=Math.max(F,s),o.copy(w).subtract(f).subtract(A).subtract(v),S.copy(w).subtract(e),F=t.dot(S),i=Math.min(F,i),s=Math.max(F,s),n[0]=i,n[1]=s,n}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,h0);t.transformAsPoint(e);const n=this.halfAxes.getColumn(1,d0);n.transformAsPoint(e);const i=this.halfAxes.getColumn(2,p0);return i.transformAsPoint(e),this.halfAxes=new gi([...t,...n,...i]),this}getTransform(){throw new Error("not implemented")}}const zP=new dt,GP=new dt;class gc{constructor(e=[0,0,1],t=0){this.normal=new dt,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return mc(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=zP.from(e),this.normal.from(t).normalize();const n=-this.normal.dot(e);return this.distance=n,this}fromCoefficients(e,t,n,i){return this.normal.set(e,t,n),mc(ma(this.normal.len(),1)),this.distance=i,this}clone(){return new gc(this.normal,this.distance)}equals(e){return ma(this.distance,e.distance)&&ma(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=GP.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,t)}projectPointOntoPlane(e,t=[0,0,0]){const n=zP.from(e),i=this.getPointDistance(n),s=GP.copy(this.normal).scale(i);return n.subtract(s).to(t)}}const VP=[new dt([1,0,0]),new dt([0,1,0]),new dt([0,0,1])],HP=new dt,Dhe=new dt;class pa{constructor(e=[]){this.planes=e}fromBoundingSphere(e){this.planes.length=2*VP.length;const t=e.center,n=e.radius;let i=0;for(const s of VP){let o=this.planes[i],c=this.planes[i+1];o||(o=this.planes[i]=new gc),c||(c=this.planes[i+1]=new gc);const f=HP.copy(s).scale(-n).add(t);o.fromPointNormal(f,s);const A=HP.copy(s).scale(n).add(t),v=Dhe.copy(s).negate();c.fromPointNormal(A,v),i+=2}return this}computeVisibility(e){let t=go.INSIDE;for(const n of this.planes)switch(e.intersectPlane(n)){case go.OUTSIDE:return go.OUTSIDE;case go.INTERSECTING:t=go.INTERSECTING;break}return t}computeVisibilityWithPlaneMask(e,t){if(mc(Number.isFinite(t),"parentPlaneMask is required."),t===pa.MASK_OUTSIDE||t===pa.MASK_INSIDE)return t;let n=pa.MASK_INSIDE;const i=this.planes;for(let s=0;s<this.planes.length;++s){const o=s<31?1<<s:0;if(s<31&&(t&o)===0)continue;const c=i[s],f=e.intersectPlane(c);if(f===go.OUTSIDE)return pa.MASK_OUTSIDE;f===go.INTERSECTING&&(n|=o)}return n}}pa.MASK_OUTSIDE=4294967295;pa.MASK_INSIDE=0;pa.MASK_INDETERMINATE=2147483647;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;new dt;const rl=new gi,Ohe=new gi,Lhe=new gi,A0=new gi,jP=new gi;function khe(r,e={}){const t=Uj,n=10;let i=0,s=0;const o=Ohe,c=Lhe;o.identity(),c.copy(r);const f=t*Nhe(c);for(;s<n&&Uhe(c)>f;)zhe(c,A0),jP.copy(A0).transpose(),c.multiplyRight(A0),c.multiplyLeft(jP),o.multiplyRight(A0),++i>2&&(++s,i=0);return e.unitary=o.toTarget(e.unitary),e.diagonal=c.toTarget(e.diagonal),e}function Nhe(r){let e=0;for(let t=0;t<9;++t){const n=r[t];e+=n*n}return Math.sqrt(e)}const px=[1,0,0],Ax=[2,2,1];function Uhe(r){let e=0;for(let t=0;t<3;++t){const n=r[rl.getElementIndex(Ax[t],px[t])];e+=2*n*n}return Math.sqrt(e)}function zhe(r,e){const t=M4;let n=0,i=1;for(let A=0;A<3;++A){const v=Math.abs(r[rl.getElementIndex(Ax[A],px[A])]);v>n&&(i=A,n=v)}const s=px[i],o=Ax[i];let c=1,f=0;if(Math.abs(r[rl.getElementIndex(o,s)])>t){const A=r[rl.getElementIndex(o,o)],v=r[rl.getElementIndex(s,s)],w=r[rl.getElementIndex(o,s)],S=(A-v)/2/w;let F;S<0?F=-1/(-S+Math.sqrt(1+S*S)):F=1/(S+Math.sqrt(1+S*S)),c=1/Math.sqrt(1+F*F),f=F*c}return gi.IDENTITY.to(e),e[rl.getElementIndex(s,s)]=e[rl.getElementIndex(o,o)]=c,e[rl.getElementIndex(o,s)]=f,e[rl.getElementIndex(s,o)]=-f,e}const Nu=new dt,Ghe=new dt,Vhe=new dt,Hhe=new dt,jhe=new dt,$he=new gi,Whe={diagonal:new gi,unitary:new gi};function H6(r,e=new Zg){if(!r||r.length===0)return e.halfAxes=new gi([0,0,0,0,0,0,0,0,0]),e.center=new dt,e;const t=r.length,n=new dt(0,0,0);for(const de of r)n.add(de);const i=1/t;n.multiplyByScalar(i);let s=0,o=0,c=0,f=0,A=0,v=0;for(const de of r){const me=Nu.copy(de).subtract(n);s+=me.x*me.x,o+=me.x*me.y,c+=me.x*me.z,f+=me.y*me.y,A+=me.y*me.z,v+=me.z*me.z}s*=i,o*=i,c*=i,f*=i,A*=i,v*=i;const w=$he;w[0]=s,w[1]=o,w[2]=c,w[3]=o,w[4]=f,w[5]=A,w[6]=c,w[7]=A,w[8]=v;const{unitary:S}=khe(w,Whe),F=e.halfAxes.copy(S);let N=F.getColumn(0,Vhe),U=F.getColumn(1,Hhe),$=F.getColumn(2,jhe),G=-Number.MAX_VALUE,H=-Number.MAX_VALUE,J=-Number.MAX_VALUE,ue=Number.MAX_VALUE,q=Number.MAX_VALUE,se=Number.MAX_VALUE;for(const de of r)Nu.copy(de),G=Math.max(Nu.dot(N),G),H=Math.max(Nu.dot(U),H),J=Math.max(Nu.dot($),J),ue=Math.min(Nu.dot(N),ue),q=Math.min(Nu.dot(U),q),se=Math.min(Nu.dot($),se);N=N.multiplyByScalar(.5*(ue+G)),U=U.multiplyByScalar(.5*(q+H)),$=$.multiplyByScalar(.5*(se+J)),e.center.copy(N).add(U).add($);const Te=Ghe.set(G-ue,H-q,J-se).multiplyByScalar(.5),Ue=new gi([Te[0],0,0,0,Te[1],0,0,0,Te[2]]);return e.halfAxes.multiplyRight(Ue),e}const hp=512,$P=3,j6=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],$6=j6.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),Jhe=$6.concat([[.25,.5],[.75,.5]]);class dp{constructor(e,t,n){this.x=e,this.y=t,this.z=n}get children(){if(!this._children){const e=this.x*2,t=this.y*2,n=this.z+1;this._children=[new dp(e,t,n),new dp(e,t+1,n),new dp(e+1,t,n),new dp(e+1,t+1,n)]}return this._children}update(e){const{viewport:t,cullingVolume:n,elevationBounds:i,minZ:s,maxZ:o,bounds:c,offset:f,project:A}=e,v=this.getBoundingVolume(i,f,A);if(c&&!this.insideBounds(c)||n.computeVisibility(v)<0)return!1;if(!this.childVisible){let{z:S}=this;if(S<o&&S>=s){const F=v.distanceTo(t.cameraPosition)*t.scale/t.height;S+=Math.floor(Math.log2(F))}if(S>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(const S of this.children)S.update(e);return!0}getSelected(e=[]){if(this.selected&&e.push(this),this._children)for(const t of this._children)t.getSelected(e);return e}insideBounds([e,t,n,i]){const s=Math.pow(2,this.z),o=hp/s;return this.x*o<n&&this.y*o<i&&(this.x+1)*o>e&&(this.y+1)*o>t}getBoundingVolume(e,t,n){if(n){const f=this.z<1?Jhe:this.z<2?$6:j6,A=[];for(const v of f){const w=mx(this.x+v[0],this.y+v[1],this.z);w[2]=e[0],A.push(n(w)),e[0]!==e[1]&&(w[2]=e[1],A.push(n(w)))}return H6(A)}const i=Math.pow(2,this.z),s=hp/i,o=this.x*s+t*hp,c=hp-(this.y+1)*s;return new EC([o,c,e[0]],[o+s,c+s,e[1]])}}function Xhe(r,e,t,n){const i=r instanceof hZ&&r.resolution?r.projectPosition:null,s=Object.values(r.getFrustumPlanes()).map(({normal:F,distance:N})=>new gc(F.clone().negate(),N)),o=new pa(s),c=r.distanceScales.unitsPerMeter[2],f=t&&t[0]*c||0,A=t&&t[1]*c||0,v=r instanceof wg&&r.pitch<=60?e:0;if(n){const[F,N,U,$]=n,G=eu([F,$]),H=eu([U,N]);n=[G[0],hp-G[1],H[0],hp-H[1]]}const w=new dp(0,0,0),S={viewport:r,project:i,cullingVolume:o,elevationBounds:[f,A],minZ:v,maxZ:e,bounds:n,offset:0};if(w.update(S),r instanceof wg&&r.subViewports&&r.subViewports.length>1){for(S.offset=-1;w.update(S)&&!(--S.offset<-$P););for(S.offset=1;w.update(S)&&!(++S.offset>$P););}return w.getSelected()}const tu=512,Khe=[-1/0,-1/0,1/0,1/0],H_={type:"object",value:null,validate:(r,e)=>e.optional&&r===null||typeof r=="string"||Array.isArray(r)&&r.every(t=>typeof t=="string"),equal:(r,e)=>{if(r===e)return!0;if(!Array.isArray(r)||!Array.isArray(e))return!1;const t=r.length;if(t!==e.length)return!1;for(let n=0;n<t;n++)if(r[n]!==e[n])return!1;return!0}};function W6(r,e){const t=[e.transformAsPoint([r[0],r[1]]),e.transformAsPoint([r[2],r[1]]),e.transformAsPoint([r[0],r[3]]),e.transformAsPoint([r[2],r[3]])];return[Math.min(...t.map(i=>i[0])),Math.min(...t.map(i=>i[1])),Math.max(...t.map(i=>i[0])),Math.max(...t.map(i=>i[1]))]}function qhe(r){return Math.abs(r.split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0))}function ph(r,e){if(!r||!r.length)return null;const{index:t,id:n}=e;if(Array.isArray(r)){const s=qhe(n)%r.length;r=r[s]}let i=r;for(const s of Object.keys(t)){const o=new RegExp(`{${s}}`,"g");i=i.replace(o,String(t[s]))}return Number.isInteger(t.y)&&Number.isInteger(t.z)&&(i=i.replace(/\{-y\}/g,String(Math.pow(2,t.z)-t.y-1))),i}function Yhe(r,e,t){let n;return n=r.getBounds(),r.isGeospatial?[Math.max(n[0],t[0]),Math.max(n[1],t[1]),Math.min(n[2],t[2]),Math.min(n[3],t[3])]:[Math.max(Math.min(n[0],t[2]),t[0]),Math.max(Math.min(n[1],t[3]),t[1]),Math.min(Math.max(n[2],t[0]),t[2]),Math.min(Math.max(n[3],t[1]),t[3])]}function Zhe({viewport:r,z:e,cullRect:t}){return(r.subViewports||[r]).map(i=>gx(i,e||0,t))}function gx(r,e,t){if(!Array.isArray(e)){const s=t.x-r.x,o=t.y-r.y,{width:c,height:f}=t,A={targetZ:e},v=r.unproject([s,o],A),w=r.unproject([s+c,o],A),S=r.unproject([s,o+f],A),F=r.unproject([s+c,o+f],A);return[Math.min(v[0],w[0],S[0],F[0]),Math.min(v[1],w[1],S[1],F[1]),Math.max(v[0],w[0],S[0],F[0]),Math.max(v[1],w[1],S[1],F[1])]}const n=gx(r,e[0],t),i=gx(r,e[1],t);return[Math.min(n[0],i[0]),Math.min(n[1],i[1]),Math.max(n[2],i[2]),Math.max(n[3],i[3])]}function Qhe(r,e,t){return t?W6(r,t).map(i=>i*e/tu):r.map(n=>n*e/tu)}function BC(r,e){return Math.pow(2,r)*tu/e}function mx(r,e,t){const n=BC(t,tu),i=r/n*360-180,s=Math.PI-2*Math.PI*e/n,o=180/Math.PI*Math.atan(.5*(Math.exp(s)-Math.exp(-s)));return[i,o]}function WP(r,e,t,n){const i=BC(t,n);return[r/i*tu,e/i*tu]}function ede(r,e,t,n,i=tu){if(r.isGeospatial){const[A,v]=mx(e,t,n),[w,S]=mx(e+1,t+1,n);return{west:A,north:v,east:w,south:S}}const[s,o]=WP(e,t,n,i),[c,f]=WP(e+1,t+1,n,i);return{left:s,top:o,right:c,bottom:f}}function tde(r,e,t,n,i){const s=Yhe(r,null,n),o=BC(e,t),[c,f,A,v]=Qhe(s,o,i),w=[];for(let S=Math.floor(c);S<A;S++)for(let F=Math.floor(f);F<v;F++)w.push({x:S,y:F,z:e});return w}function rde({viewport:r,maxZoom:e,minZoom:t,zRange:n,extent:i,tileSize:s=tu,modelMatrix:o,modelMatrixInverse:c,zoomOffset:f=0}){let A=r.isGeospatial?Math.round(r.zoom+Math.log2(tu/s))+f:Math.ceil(r.zoom)+f;if(typeof t=="number"&&Number.isFinite(t)&&A<t){if(!i)return[];A=t}typeof e=="number"&&Number.isFinite(e)&&A>e&&(A=e);let v=i;return o&&c&&i&&!r.isGeospatial&&(v=W6(i,o)),r.isGeospatial?Xhe(r,A,n,i):tde(r,A,s,v||Khe,c)}function nde(r){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(r)}function ide(r){return Number.isFinite(r.west)&&Number.isFinite(r.north)&&Number.isFinite(r.east)&&Number.isFinite(r.south)}function sde(r){let e={},t;return n=>{for(const i in n)if(!ode(n[i],e[i])){t=r(n),e=n;break}return t}}function ode(r,e){if(r===e)return!0;if(Array.isArray(r)){const t=r.length;if(!e||e.length!==t)return!1;for(let n=0;n<t;n++)if(r[n]!==e[n])return!1;return!0}return!1}const JP=1,Dy=2,ade="never",cde="no-overlap",SC="best-available",lde=5,ude={[SC]:hde,[cde]:dde,[ade]:()=>{}},fde={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{}};class Oy{constructor(e){this._getCullBounds=sde(Zhe),this.opts={...fde,...e},this.setOptions(this.opts),this.onTileLoad=t=>{this.opts.onTileLoad?.(t),this.opts.maxCacheByteSize!==null&&(this._cacheByteSize+=t.byteLength,this._resizeCache())},this._requestScheduler=new O6({throttleRequests:this.opts.maxRequests>0||this.opts.debounceTime>0,maxRequests:this.opts.maxRequests,debounceTime:this.opts.debounceTime}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._zRange=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new vn,this._modelMatrixInverse=new vn}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return this._selectedTiles!==null&&this._selectedTiles.every(e=>e.isLoaded)}get needsReload(){return this._selectedTiles!==null&&this._selectedTiles.some(e=>e.needsReload)}setOptions(e){Object.assign(this.opts,e),Number.isFinite(e.maxZoom)&&(this._maxZoom=Math.floor(e.maxZoom)),Number.isFinite(e.minZoom)&&(this._minZoom=Math.ceil(e.minZoom))}finalize(){for(const e of this._cache.values())e.isLoading&&e.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(const e of this._cache.keys()){const t=this._cache.get(e);!this._selectedTiles||!this._selectedTiles.includes(t)?this._cache.delete(e):t.setNeedsReload()}}update(e,{zRange:t,modelMatrix:n}={zRange:null,modelMatrix:null}){const i=n?new vn(n):new vn,s=!i.equals(this._modelMatrix);if(!this._viewport||!e.equals(this._viewport)||!ma(this._zRange,t)||s){s&&(this._modelMatrixInverse=i.clone().invert(),this._modelMatrix=i),this._viewport=e,this._zRange=t;const c=this.getTileIndices({viewport:e,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:t,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=c.map(f=>this._getTile(f,!0)),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(c=>this._getTile(c.index,!0)));const o=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),o&&this._frameNumber++,this._frameNumber}isTileVisible(e,t){if(!e.isVisible)return!1;if(t&&this._viewport){const n=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:t}),{bbox:i}=e;for(const[s,o,c,f]of n){let A;if("west"in i)A=i.west<c&&i.east>s&&i.south<f&&i.north>o;else{const v=Math.min(i.top,i.bottom),w=Math.max(i.top,i.bottom);A=i.left<c&&i.right>s&&v<f&&w>o}if(A)return!0}return!1}return!0}getTileIndices({viewport:e,maxZoom:t,minZoom:n,zRange:i,modelMatrix:s,modelMatrixInverse:o}){const{tileSize:c,extent:f,zoomOffset:A}=this.opts;return rde({viewport:e,maxZoom:t,minZoom:n,zRange:i,tileSize:c,extent:f,modelMatrix:s,modelMatrixInverse:o,zoomOffset:A})}getTileId(e){return`${e.x}-${e.y}-${e.z}`}getTileZoom(e){return e.z}getTileMetadata(e){const{tileSize:t}=this.opts;return{bbox:ede(this._viewport,e.x,e.y,e.z,t)}}getParentIndex(e){const t=Math.floor(e.x/2),n=Math.floor(e.y/2),i=e.z-1;return{x:t,y:n,z:i}}updateTileStates(){const e=this.opts.refinementStrategy||SC,t=new Array(this._cache.size);let n=0;for(const i of this._cache.values())t[n++]=i.isVisible,i.isSelected=!1,i.isVisible=!1;for(const i of this._selectedTiles)i.isSelected=!0,i.isVisible=!0;(typeof e=="function"?e:ude[e])(Array.from(this._cache.values())),n=0;for(const i of this._cache.values())if(t[n++]!==i.isVisible)return!0;return!1}_pruneRequests(){const{maxRequests:e=0}=this.opts,t=[];let n=0;for(const i of this._cache.values())i.isLoading&&(n++,!i.isSelected&&!i.isVisible&&t.push(i));for(;e>0&&n>e&&t.length>0;)t.shift().abort(),n--}_rebuildTree(){const{_cache:e}=this;for(const t of e.values())t.parent=null,t.children&&(t.children.length=0);for(const t of e.values()){const n=this._getNearestAncestor(t);t.parent=n,n?.children&&n.children.push(t)}}_resizeCache(){const{_cache:e,opts:t}=this,n=t.maxCacheSize??(t.maxCacheByteSize!==null?1/0:lde*this.selectedTiles.length),i=t.maxCacheByteSize??1/0;if(e.size>n||this._cacheByteSize>i){for(const[o,c]of e)if(!c.isVisible&&!c.isSelected&&(this._cacheByteSize-=t.maxCacheByteSize!==null?c.byteLength:0,e.delete(o),this.opts.onTileUnload?.(c)),e.size<=n&&this._cacheByteSize<=i)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((o,c)=>o.zoom-c.zoom),this._dirty=!1)}_getTile(e,t){const n=this.getTileId(e);let i=this._cache.get(n),s=!1;return!i&&t?(i=new V6(e),Object.assign(i,this.getTileMetadata(i.index)),Object.assign(i,{id:n,zoom:this.getTileZoom(i.index)}),s=!0,this._cache.set(n,i),this._dirty=!0):i&&i.needsReload&&(s=!0),i&&s&&i.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),i}_getNearestAncestor(e){const{_minZoom:t=0}=this;let n=e.index;for(;this.getTileZoom(n)>t;){n=this.getParentIndex(n);const i=this._getTile(n);if(i)return i}return null}}function hde(r){for(const e of r)e.state=0;for(const e of r)e.isSelected&&!J6(e)&&IC(e);for(const e of r)e.isVisible=!!(e.state&Dy)}function dde(r){for(const t of r)t.state=0;for(const t of r)t.isSelected&&J6(t);const e=Array.from(r).sort((t,n)=>t.zoom-n.zoom);for(const t of e)if(t.isVisible=!!(t.state&Dy),t.children&&(t.isVisible||t.state&JP))for(const n of t.children)n.state=JP;else t.isSelected&&IC(t)}function J6(r){let e=r;for(;e;){if(e.isLoaded||e.content)return e.state|=Dy,!0;e=e.parent}return!1}function IC(r){for(const e of r.children)e.isLoaded||e.content?e.state|=Dy:IC(e)}const pde={TilesetClass:Oy,data:{type:"data",value:[]},dataComparator:H_.equal,renderSubLayers:{type:"function",value:r=>new iu(r)},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:r=>{}},onTileUnload:{type:"function",value:r=>{}},onTileError:{type:"function",value:r=>console.error(r)},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:SC,zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0};class ou extends Bs{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){this.state?.tileset?.finalize()}get isLoaded(){return!!this.state?.tileset?.selectedTiles?.every(e=>e.isLoaded&&e.layers&&e.layers.every(t=>t.isLoaded))}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState({changeFlags:e}){let{tileset:t}=this.state;const n=e.propsOrDataChanged||e.updateTriggersChanged,i=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getTileData);t?n&&(t.setOptions(this._getTilesetOptions()),i?t.reloadAll():t.tiles.forEach(s=>{s.layers=null})):(t=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:t})),this._updateTileset()}_getTilesetOptions(){const{tileSize:e,maxCacheSize:t,maxCacheByteSize:n,refinementStrategy:i,extent:s,maxZoom:o,minZoom:c,maxRequests:f,debounceTime:A,zoomOffset:v}=this.props;return{maxCacheSize:t,maxCacheByteSize:n,maxZoom:o,minZoom:c,tileSize:e,refinementStrategy:i,extent:s,maxRequests:f,debounceTime:A,zoomOffset:v,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){const e=this.state.tileset,{zRange:t,modelMatrix:n}=this.props,i=e.update(this.context.viewport,{zRange:t,modelMatrix:n}),{isLoaded:s}=e,o=this.state.isLoaded!==s,c=this.state.frameNumber!==i;s&&(o||c)&&this._onViewportLoad(),c&&this.setState({frameNumber:i}),this.state.isLoaded=s}_onViewportLoad(){const{tileset:e}=this.state,{onViewportLoad:t}=this.props;t&&t(e.selectedTiles)}_onTileLoad(e){this.props.onTileLoad(e),e.layers=null,this.setNeedsUpdate()}_onTileError(e,t){this.props.onTileError(e),t.layers=null,this.setNeedsUpdate()}_onTileUnload(e){this.props.onTileUnload(e)}getTileData(e){const{data:t,getTileData:n,fetch:i}=this.props,{signal:s}=e;return e.url=typeof t=="string"||Array.isArray(t)?ph(t,e):null,n?n(e):i&&e.url?i(e.url,{propName:"data",layer:this,signal:s}):null}renderSubLayers(e){return this.props.renderSubLayers(e)}getSubLayerPropsByTile(e){return null}getPickingInfo(e){const t=e.sourceLayer,n=t.props.tile,i=e.info;return i.picked&&(i.tile=n),i.sourceTile=n,i.sourceTileSubLayer=t,i}_updateAutoHighlight(e){e.sourceTileSubLayer.updateAutoHighlight(e)}renderLayers(){return this.state.tileset.tiles.map(e=>{const t=this.getSubLayerPropsByTile(e);if(!(!e.isLoaded&&!e.content))if(e.layers)t&&e.layers[0]&&Object.keys(t).some(n=>e.layers[0].props[n]!==t[n])&&(e.layers=e.layers.map(n=>n.clone(t)));else{const n=this.renderSubLayers({...this.props,...this.getSubLayerProps({id:e.id,updateTriggers:this.props.updateTriggers}),data:e.content,_offset:0,tile:e});e.layers=py(n,Boolean).map(i=>i.clone({tile:e,...t}))}return e.layers})}filterSubLayer({layer:e,cullRect:t}){const{tile:n}=e.props;return this.state.tileset.isTileVisible(n,t)}}ou.defaultProps=pde;ou.layerName="TileLayer";const XP=`uniform tripsUniforms {
4205
4192
  bool fadeTrail;
4206
4193
  float trailLength;
4207
4194
  float currentTime;
@@ -4576,25 +4563,7 @@ fragColor = vec4(lightColor, color.a * layer.opacity);
4576
4563
  #endif
4577
4564
  DECKGL_FILTER_COLOR(fragColor, geometry);
4578
4565
  }
4579
- `;function i0e(r){const e=r.positions||r.POSITION,t=e.value.length/e.size;r.COLOR_0||r.colors||(r.colors={size:4,value:new Uint8Array(t*4).fill(255),normalized:!0})}const s0e={pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}};class XC extends Ah{getShaders(){const e=super.getShaders();return e.modules.push(Ew,t0e),{...e,vs:r0e,fs:n0e}}initializeState(){const{featureIds:e}=this.props;super.initializeState();const t=this.getAttributeManager();e&&t.add({featureIdsPickingColors:{type:"uint8",size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}updateState(e){super.updateState(e);const{props:t,oldProps:n}=e;t.pbrMaterial!==n.pbrMaterial&&this.updatePbrMaterialUniforms(t.pbrMaterial)}draw(e){const{featureIds:t}=this.props,{model:n}=this.state;if(!n)return;const i={pickFeatureIds:!!t},s={camera:n.uniforms.cameraPosition};n.shaderInputs.setProps({pbrProjection:s,mesh:i}),super.draw(e)}getModel(e){const{id:t}=this.props,n=this.parseMaterial(this.props.pbrMaterial,e);this.setState({parsedPBRMaterial:n});const i=this.getShaders();return i0e(e.attributes),new Di(this.context.device,{...this.getShaders(),id:t,geometry:e,bufferLayout:this.getAttributeManager().getBufferLayouts(),defines:{...i.defines,...n?.defines,HAS_UV_REGIONS:e.attributes.uvRegions?1:0},parameters:n?.parameters,isInstanced:!0})}updatePbrMaterialUniforms(e){const{model:t}=this.state;if(t){const{mesh:n}=this.props,i=this.parseMaterial(e,n);this.setState({parsedPBRMaterial:i});const{pbr_baseColorSampler:s}=i.bindings,{emptyTexture:o}=this.state,c={sampler:s||o,hasTexture:!!s},{camera:f,...A}={...i.bindings,...i.uniforms};t.shaderInputs.setProps({simpleMesh:c,pbrMaterial:A})}}parseMaterial(e,t){const n=!!(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture);return f8(this.context.device,{unlit:n,...e},{NORMAL:t.attributes.normals,TEXCOORD_0:t.attributes.texCoords},{pbrDebug:!1,lights:!0,useTangents:!1})}calculateFeatureIdsPickingColors(e){const t=this.props.featureIds,n=new Uint8ClampedArray(t.length*e.size),i=[];for(let s=0;s<t.length;s++)this.encodePickingColor(t[s],i),n[s*3]=i[0],n[s*3+1]=i[1],n[s*3+2]=i[2];e.value=n}finalizeState(e){super.finalizeState(e),this.state.parsedPBRMaterial?.generatedTextures.forEach(t=>t.destroy()),this.setState({parsedPBRMaterial:null})}}XC.layerName="MeshLayer";XC.defaultProps=s0e;const o0e=6378137,a0e=6378137,c0e=6356752314245179e-9;function Hy(r){return r}new dt;function l0e(r,e=[],t=Hy){return"longitude"in r?(e[0]=t(r.longitude),e[1]=t(r.latitude),e[2]=r.height):"x"in r?(e[0]=t(r.x),e[1]=t(r.y),e[2]=r.z):(e[0]=t(r[0]),e[1]=t(r[1]),e[2]=r[2]),e}function u0e(r,e=[]){return l0e(r,e,Ts._cartographicRadians?Hy:_H)}function f0e(r,e,t=Hy){return"longitude"in e?(e.longitude=t(r[0]),e.latitude=t(r[1]),e.height=r[2]):"x"in e?(e.x=t(r[0]),e.y=t(r[1]),e.z=r[2]):(e[0]=t(r[0]),e[1]=t(r[1]),e[2]=r[2]),e}function h0e(r,e){return f0e(r,e,Ts._cartographicRadians?Hy:yH)}const ER=1e-14,d0e=new dt,BR={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},b1={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},NA={east:new dt,north:new dt,up:new dt,west:new dt,south:new dt,down:new dt},p0e=new dt,A0e=new dt,g0e=new dt;function SR(r,e,t,n,i,s){const o=BR[e]&&BR[e][t];mc(o&&(!n||n===o));let c,f,A;const v=d0e.copy(i);if(ma(v.x,0,ER)&&ma(v.y,0,ER)){const S=Math.sign(v.z);c=p0e.fromArray(b1[e]),e!=="east"&&e!=="west"&&c.scale(S),f=A0e.fromArray(b1[t]),t!=="east"&&t!=="west"&&f.scale(S),A=g0e.fromArray(b1[n]),n!=="east"&&n!=="west"&&A.scale(S)}else{const{up:S,east:F,north:N}=NA;F.set(-v.y,v.x,0).normalize(),r.geodeticSurfaceNormal(v,S),N.copy(S).cross(F);const{down:U,west:$,south:G}=NA;U.copy(S).scale(-1),$.copy(F).scale(-1),G.copy(N).scale(-1),c=NA[e],f=NA[t],A=NA[n]}return s[0]=c.x,s[1]=c.y,s[2]=c.z,s[3]=0,s[4]=f.x,s[5]=f.y,s[6]=f.z,s[7]=0,s[8]=A.x,s[9]=A.y,s[10]=A.z,s[11]=0,s[12]=v.x,s[13]=v.y,s[14]=v.z,s[15]=1,s}const Ld=new dt,m0e=new dt,_0e=new dt;function y0e(r,e,t=[]){const{oneOverRadii:n,oneOverRadiiSquared:i,centerToleranceSquared:s}=e;Ld.from(r);const o=Ld.x,c=Ld.y,f=Ld.z,A=n.x,v=n.y,w=n.z,S=o*o*A*A,F=c*c*v*v,N=f*f*w*w,U=S+F+N,$=Math.sqrt(1/U);if(!Number.isFinite($))return;const G=m0e;if(G.copy(r).scale($),U<s)return G.to(t);const H=i.x,J=i.y,ue=i.z,q=_0e;q.set(G.x*H*2,G.y*J*2,G.z*ue*2);let se=(1-$)*Ld.len()/(.5*q.len()),Te=0,Ue,de,me,pe;do{se-=Te,Ue=1/(1+se*H),de=1/(1+se*J),me=1/(1+se*ue);const W=Ue*Ue,re=de*de,Ee=me*me,et=W*Ue,_e=re*de,Le=Ee*me;pe=S*W+F*re+N*Ee-1;const Ze=-2*(S*et*H+F*_e*J+N*Le*ue);Te=pe/Ze}while(Math.abs(pe)>Nj);return Ld.scale([Ue,de,me]).to(t)}const y0=new dt,IR=new dt,v0e=new dt,uc=new dt,b0e=new dt,v0=new dt;class wi{constructor(e=0,t=0,n=0){this.centerToleranceSquared=kj,mc(e>=0),mc(t>=0),mc(n>=0),this.radii=new dt(e,t,n),this.radiiSquared=new dt(e*e,t*t,n*n),this.radiiToTheFourth=new dt(e*e*e*e,t*t*t*t,n*n*n*n),this.oneOverRadii=new dt(e===0?0:1/e,t===0?0:1/t,n===0?0:1/n),this.oneOverRadiiSquared=new dt(e===0?0:1/(e*e),t===0?0:1/(t*t),n===0?0:1/(n*n)),this.minimumRadius=Math.min(e,t,n),this.maximumRadius=Math.max(e,t,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||!!(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,t=[0,0,0]){const n=IR,i=v0e,[,,s]=e;this.geodeticSurfaceNormalCartographic(e,n),i.copy(this.radiiSquared).scale(n);const o=Math.sqrt(n.dot(i));return i.scale(1/o),n.scale(s),i.add(n),i.to(t)}cartesianToCartographic(e,t=[0,0,0]){v0.from(e);const n=this.scaleToGeodeticSurface(v0,uc);if(!n)return;const i=this.geodeticSurfaceNormal(n,IR),s=b0e;s.copy(v0).subtract(n);const o=Math.atan2(i.y,i.x),c=Math.asin(i.z),f=Math.sign(vw(s,v0))*y4(s);return h0e([o,c,f],t)}eastNorthUpToFixedFrame(e,t=new vn){return SR(this,"east","north","up",e,t)}localFrameToFixedFrame(e,t,n,i,s=new vn){return SR(this,e,t,n,i,s)}geocentricSurfaceNormal(e,t=[0,0,0]){return y0.from(e).normalize().to(t)}geodeticSurfaceNormalCartographic(e,t=[0,0,0]){const n=u0e(e),i=n[0],s=n[1],o=Math.cos(s);return y0.set(o*Math.cos(i),o*Math.sin(i),Math.sin(s)).normalize(),y0.to(t)}geodeticSurfaceNormal(e,t=[0,0,0]){return y0.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(e,t){return y0e(e,this,t)}scaleToGeocentricSurface(e,t=[0,0,0]){uc.from(e);const n=uc.x,i=uc.y,s=uc.z,o=this.oneOverRadiiSquared,c=1/Math.sqrt(n*n*o.x+i*i*o.y+s*s*o.z);return uc.multiplyScalar(c).to(t)}transformPositionToScaledSpace(e,t=[0,0,0]){return uc.from(e).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(e,t=[0,0,0]){return uc.from(e).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(e,t=0,n=[0,0,0]){mc(ma(this.radii.x,this.radii.y,M4)),mc(this.radii.z>0),uc.from(e);const i=uc.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-t))return uc.set(0,0,i).to(n)}}wi.WGS84=new wi(o0e,a0e,c0e);class x0e{item;previous;next;constructor(e,t,n){this.item=e,this.previous=t,this.next=n}}class w0e{head=null;tail=null;_length=0;get length(){return this._length}add(e){const t=new x0e(e,this.tail,null);return this.tail?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t}remove(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}splice(e,t){e!==t&&(this.remove(t),this._insert(e,t))}_insert(e,t){const n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e,++this._length}}class C0e{_list;_sentinel;_trimTiles;constructor(){this._list=new w0e,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(e){const t=e._cacheNode;t&&this._list.splice(this._sentinel,t)}add(e,t,n){t._cacheNode||(t._cacheNode=this._list.add(t),n&&n(e,t))}unloadTile(e,t,n){const i=t._cacheNode;i&&(this._list.remove(i),t._cacheNode=null,n&&n(e,t))}unloadTiles(e,t){const n=this._trimTiles;this._trimTiles=!1;const i=this._list,s=e.maximumMemoryUsage*1024*1024,o=this._sentinel;let c=i.head;for(;c!==o&&(e.gpuMemoryUsageInBytes>s||n);){const f=c.item;c=c.next,this.unloadTile(e,f,t)}}trim(){this._trimTiles=!0}}function T0e(r,e){Ai(r),Ai(e);const{rtcCenter:t,gltfUpAxis:n}=e,{computedTransform:i,boundingVolume:{center:s}}=r;let o=new vn(i);switch(t&&o.translate(t),n){case"Z":break;case"Y":const w=new vn().rotateX(Math.PI/2);o=o.multiplyRight(w);break;case"X":const S=new vn().rotateY(-Math.PI/2);o=o.multiplyRight(S);break}e.isQuantized&&o.translate(e.quantizedVolumeOffset).scale(e.quantizedVolumeScale);const c=new dt(s);e.cartesianModelMatrix=o,e.cartesianOrigin=c;const f=wi.WGS84.cartesianToCartographic(c,new dt),v=wi.WGS84.eastNorthUpToFixedFrame(c).invert();e.cartographicModelMatrix=v.multiplyRight(o),e.cartographicOrigin=f,e.coordinateSystem||(e.modelMatrix=e.cartographicModelMatrix)}const MR=new dt,x1=new dt,xx=new pa([new gc,new gc,new gc,new gc,new gc,new gc]);function E0e(r,e){const{cameraDirection:t,cameraUp:n,height:i}=r,{metersPerUnit:s}=r.distanceScales,o=r_(r,r.center),c=wi.WGS84.eastNorthUpToFixedFrame(o),f=r.unprojectPosition(r.cameraPosition),A=wi.WGS84.cartographicToCartesian(f,new dt),v=new dt(c.transformAsVector(new dt(t).scale(s))).normalize(),w=new dt(c.transformAsVector(new dt(n).scale(s))).normalize();S0e(r);const S=r.constructor,{longitude:F,latitude:N,width:U,bearing:$,zoom:G}=r,H=new S({longitude:F,latitude:N,height:i,width:U,bearing:$,zoom:G,pitch:0});return{camera:{position:A,direction:v,up:w},viewport:r,topDownViewport:H,height:i,cullingVolume:xx,frameNumber:e,sseDenominator:1.15}}function B0e(r,e,t){if(t===0||r.length<=t)return[r,[]];const n=[],{longitude:i,latitude:s}=e.viewport;for(const[A,v]of r.entries()){const[w,S]=v.header.mbs,F=Math.abs(i-w),N=Math.abs(s-S),U=Math.sqrt(N*N+F*F);n.push([A,U])}const o=n.sort((A,v)=>A[1]-v[1]),c=[];for(let A=0;A<t;A++)c.push(r[o[A][0]]);const f=[];for(let A=t;A<o.length;A++)f.push(r[o[A][0]]);return[c,f]}function S0e(r){const e=r.getFrustumPlanes(),t=PR(e.near,r.cameraPosition),n=r_(r,t),i=r_(r,r.cameraPosition,x1);let s=0;xx.planes[s++].fromPointNormal(n,MR.copy(n).subtract(i));for(const o in e){if(o==="near")continue;const c=e[o],f=PR(c,t,x1),A=r_(r,f,x1);xx.planes[s++].fromPointNormal(A,MR.copy(n).subtract(A))}}function PR(r,e,t=new dt){const n=r.normal.dot(e);return t.copy(r.normal).scale(r.distance-n).add(e),t}function r_(r,e,t=new dt){const n=r.unprojectPosition(e);return wi.WGS84.cartographicToCartesian(n,t)}const I0e=6378137,M0e=6378137,wx=6356752314245179e-9,Ap=new dt;function P0e(r,e){if(r instanceof Zg){const{halfAxes:t}=r,n=F0e(t);return Math.log2(wx/(n+e[2]))}else if(r instanceof Yg){const{radius:t}=r;return Math.log2(wx/(t+e[2]))}else if(r.width&&r.height){const{width:t,height:n}=r,i=Math.log2(I0e/t),s=Math.log2(M0e/n);return(i+s)/2}return 1}function R8(r,e,t){wi.WGS84.cartographicToCartesian([r.xmax,r.ymax,r.zmax],Ap);const n=Math.sqrt(Math.pow(Ap[0]-t[0],2)+Math.pow(Ap[1]-t[1],2)+Math.pow(Ap[2]-t[2],2));return Math.log2(wx/(n+e[2]))}function R0e(r,e,t){const[n,i,s,o]=r;return R8({xmax:s,ymax:o,zmax:0},e,t)}function F0e(r){r.getColumn(0,Ap);const e=r.getColumn(1),t=r.getColumn(2);return Ap.add(e).add(t).len()}const fa={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};var Tc;(function(r){r[r.ADD=1]="ADD",r[r.REPLACE=2]="REPLACE"})(Tc||(Tc={}));var Yl;(function(r){r.EMPTY="empty",r.SCENEGRAPH="scenegraph",r.POINTCLOUD="pointcloud",r.MESH="mesh"})(Yl||(Yl={}));var Go;(function(r){r.I3S="I3S",r.TILES3D="TILES3D"})(Go||(Go={}));var Gp;(function(r){r.GEOMETRIC_ERROR="geometricError",r.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(Gp||(Gp={}));const D0e={USE_OPTIMIZATION:1};function F8(r){return r!=null}const mo=new dt,n_=new dt,O0e=new dt,L0e=new dt,Hf=new dt,RR=new dt,FR=new dt,DR=new dt;function w1(r,e,t){if(Ai(r,"3D Tile: boundingVolume must be defined"),r.box)return D8(r.box,e,t);if(r.region)return U0e(r.region);if(r.sphere)return N0e(r.sphere,e,t);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function k0e(r,e){if(r.box)return z0e(e);if(r.region){const[t,n,i,s,o,c]=r.region;return[[Ac(t),Ac(n),o],[Ac(i),Ac(s),c]]}if(r.sphere)return G0e(e);throw new Error("Unkown boundingVolume type")}function D8(r,e,t){const n=new dt(r[0],r[1],r[2]);e.transform(n,n);let i=[];if(r.length===10){const A=r.slice(3,6),v=new vg;v.fromArray(r,6);const w=new dt([1,0,0]),S=new dt([0,1,0]),F=new dt([0,0,1]);w.transformByQuaternion(v),w.scale(A[0]),S.transformByQuaternion(v),S.scale(A[1]),F.transformByQuaternion(v),F.scale(A[2]),i=[...w.toArray(),...S.toArray(),...F.toArray()]}else i=[...r.slice(3,6),...r.slice(6,9),...r.slice(9,12)];const s=e.transformAsVector(i.slice(0,3)),o=e.transformAsVector(i.slice(3,6)),c=e.transformAsVector(i.slice(6,9)),f=new gi([s[0],s[1],s[2],o[0],o[1],o[2],c[0],c[1],c[2]]);return F8(t)?(t.center=n,t.halfAxes=f,t):new Zg(n,f)}function N0e(r,e,t){const n=new dt(r[0],r[1],r[2]);e.transform(n,n);const i=e.getScale(n_),s=Math.max(Math.max(i[0],i[1]),i[2]),o=r[3]*s;return F8(t)?(t.center=n,t.radius=o,t):new Yg(n,o)}function U0e(r){const[e,t,n,i,s,o]=r,c=wi.WGS84.cartographicToCartesian([Ac(e),Ac(i),s],O0e),f=wi.WGS84.cartographicToCartesian([Ac(n),Ac(t),o],L0e),A=new dt().addVectors(c,f).multiplyByScalar(.5);return wi.WGS84.cartesianToCartographic(A,Hf),wi.WGS84.cartographicToCartesian([Ac(n),Hf[1],Hf[2]],RR),wi.WGS84.cartographicToCartesian([Hf[0],Ac(i),Hf[2]],FR),wi.WGS84.cartographicToCartesian([Hf[0],Hf[1],o],DR),D8([...A,...RR.subtract(A),...FR.subtract(A),...DR.subtract(A)],new vn)}function z0e(r){const e=O8(),{halfAxes:t}=r,n=new dt(t.getColumn(0)),i=new dt(t.getColumn(1)),s=new dt(t.getColumn(2));for(let o=0;o<2;o++){for(let c=0;c<2;c++){for(let f=0;f<2;f++)mo.copy(r.center),mo.add(n),mo.add(i),mo.add(s),L8(e,mo),s.negate();i.negate()}n.negate()}return e}function G0e(r){const e=O8(),{center:t,radius:n}=r,i=wi.WGS84.scaleToGeodeticSurface(t,mo);let s;i?s=wi.WGS84.geodeticSurfaceNormal(i):s=new dt(0,0,1);let o=new dt(s[2],-s[1],0);o.len()>0?o.normalize():o=new dt(0,1,0);const c=o.clone().cross(s);for(const f of[o,c,s]){n_.copy(f).scale(n);for(let A=0;A<2;A++)mo.copy(t),mo.add(n_),L8(e,mo),n_.negate()}return e}function O8(){return[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]]}function L8(r,e){wi.WGS84.cartesianToCartographic(e,mo),r[0][0]=Math.min(r[0][0],mo[0]),r[0][1]=Math.min(r[0][1],mo[1]),r[0][2]=Math.min(r[0][2],mo[2]),r[1][0]=Math.max(r[1][0],mo[0]),r[1][1]=Math.max(r[1][1],mo[1]),r[1][2]=Math.max(r[1][2],mo[2])}new dt;new dt;new vn;new dt;new dt;new dt;function V0e(r,e){const t=r*e;return 1-Math.exp(-(t*t))}function H0e(r,e){if(r.dynamicScreenSpaceError&&r.dynamicScreenSpaceErrorComputedDensity){const t=r.dynamicScreenSpaceErrorComputedDensity,n=r.dynamicScreenSpaceErrorFactor;return V0e(e,t)*n}return 0}function j0e(r,e,t){const n=r.tileset,i=r.parent&&r.parent.lodMetricValue||r.lodMetricValue,s=t?i:r.lodMetricValue;if(s===0)return 0;const o=Math.max(r._distanceToCamera,1e-7),{height:c,sseDenominator:f}=e,{viewDistanceScale:A}=n.options;let v=s*c*(A||1)/(o*f);return v-=H0e(n,o),v}const C1=new dt,OR=new dt,Uu=new dt,LR=new dt,$0e=new dt,T1=new vn,kR=new vn;function W0e(r,e){if(r.lodMetricValue===0||isNaN(r.lodMetricValue))return"DIG";const t=2*k8(r,e);return t<2?"OUT":!r.header.children||t<=r.lodMetricValue?"DRAW":r.header.children?"DIG":"OUT"}function k8(r,e){const{topDownViewport:t}=e,n=r.header.mbs[1],i=r.header.mbs[0],s=r.header.mbs[2],o=r.header.mbs[3],c=[...r.boundingVolume.center],f=t.unprojectPosition(t.cameraPosition);wi.WGS84.cartographicToCartesian(f,C1),OR.copy(C1).subtract(c).normalize(),wi.WGS84.eastNorthUpToFixedFrame(c,T1),kR.copy(T1).invert(),Uu.copy(C1).transform(kR);const A=Math.sqrt(Uu[0]*Uu[0]+Uu[1]*Uu[1]),v=A*A/Uu[2];LR.copy([Uu[0],Uu[1],v]);const S=LR.transform(T1).subtract(c).normalize(),N=OR.cross(S).normalize().scale(o).add(c),U=wi.WGS84.cartesianToCartographic(N),$=t.project([i,n,s]),G=t.project(U);return $0e.copy($).subtract(G).magnitude()}function J0e(r){return{assetGltfUpAxis:r.asset&&r.asset.gltfUpAxis||"Y"}}class NR{_map=new Map;_array;_length;constructor(e=0){this._array=new Array(e),this._length=e}get length(){return this._length}set length(e){this._length=e,e>this._array.length&&(this._array.length=e)}get values(){return this._array}get(e){return Ai(e<this._array.length),this._array[e]}set(e,t){Ai(e>=0),e>=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=t,this._map.set(t,e)}delete(e){const t=this._map.get(e);t>=0&&(this._array.splice(t,1),this._map.delete(e),this.length--)}peek(){return this._array[this._length-1]}push(e){if(!this._map.has(e)){const t=this.length++;this._array[t]=e,this._map.set(e,t)}}pop(){const e=this._array[--this.length];return this._map.delete(e),e}reserve(e){Ai(e>=0),e>this._array.length&&(this._array.length=e)}resize(e){Ai(e>=0),this.length=e}trim(e){e==null&&(e=this.length),this._array.length=e}reset(){this._array=[],this._map=new Map,this._length=0}find(e){return this._map.has(e)}}const X0e={loadSiblings:!1,skipLevelOfDetail:!1,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""};class jy{options;root=null;selectedTiles={};requestedTiles={};emptyTiles={};lastUpdate=new Date().getTime();updateDebounceTime=1e3;_traversalStack=new NR;_emptyTraversalStack=new NR;_frameNumber=null;traversalFinished(e){return!0}constructor(e){this.options={...X0e,...e}}traverse(e,t,n){this.root=e,this.options={...this.options,...n},this.reset(),this.updateTile(e,t),this._frameNumber=t.frameNumber,this.executeTraversal(e,t)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(e,t){const n=this._traversalStack;for(e._selectionDepth=1,n.push(e);n.length>0;){const s=n.pop();let o=!1;this.canTraverse(s,t)&&(this.updateChildTiles(s,t),o=this.updateAndPushChildren(s,t,n,s.hasRenderContent?s._selectionDepth+1:s._selectionDepth));const c=s.parent,f=!!(!c||c._shouldRefine),A=!o;s.hasRenderContent?s.refine===Tc.ADD?(this.loadTile(s,t),this.selectTile(s,t)):s.refine===Tc.REPLACE&&(this.loadTile(s,t),A&&this.selectTile(s,t)):(this.emptyTiles[s.id]=s,this.loadTile(s,t),A&&this.selectTile(s,t)),this.touchTile(s,t),s._shouldRefine=o&&f}const i=new Date().getTime();(this.traversalFinished(t)||i-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=i,this.options.onTraversalEnd(t))}updateChildTiles(e,t){const n=e.children;for(const i of n)this.updateTile(i,t)}updateAndPushChildren(e,t,n,i){const{loadSiblings:s,skipLevelOfDetail:o}=this.options,c=e.children;c.sort(this.compareDistanceToCamera.bind(this));const f=e.refine===Tc.REPLACE&&e.hasRenderContent&&!o;let A=!1,v=!0;for(const w of c)if(w._selectionDepth=i,w.isVisibleAndInRequestVolume?(n.find(w)&&n.delete(w),n.push(w),A=!0):(f||s)&&(this.loadTile(w,t),this.touchTile(w,t)),f){let S;if(w._inRequestVolume?w.hasRenderContent?S=w.contentAvailable:S=this.executeEmptyTraversal(w,t):S=!1,v=v&&S,!v)return!1}return A||(v=!1),v}updateTile(e,t){this.updateTileVisibility(e,t)}selectTile(e,t){this.shouldSelectTile(e)&&(e._selectedFrame=t.frameNumber,this.selectedTiles[e.id]=e)}loadTile(e,t){this.shouldLoadTile(e)&&(e._requestedFrame=t.frameNumber,e._priority=e._getPriority(),this.requestedTiles[e.id]=e)}touchTile(e,t){e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber}canTraverse(e,t,n=!1,i=!1){return e.hasChildren?e.hasTilesetContent?!e.contentExpired:!i&&!e.isVisibleAndInRequestVolume?!1:this.shouldRefine(e,t,n):!1}shouldLoadTile(e){return e.hasUnloadedContent||e.contentExpired}shouldSelectTile(e){return e.contentAvailable&&!this.options.skipLevelOfDetail}shouldRefine(e,t,n=!1){let i=e._screenSpaceError;return n&&(i=e.getScreenSpaceError(t,!0)),i>e.tileset.memoryAdjustedScreenSpaceError}updateTileVisibility(e,t){const n=[];if(this.options.viewportTraversersMap)for(const i in this.options.viewportTraversersMap)this.options.viewportTraversersMap[i]===t.viewport.id&&n.push(i);else n.push(t.viewport.id);e.updateVisibility(t,n)}compareDistanceToCamera(e,t){return e._distanceToCamera-t._distanceToCamera}anyChildrenVisible(e,t){let n=!1;for(const i of e.children)i.updateVisibility(t),n=n||i.isVisibleAndInRequestVolume;return n}executeEmptyTraversal(e,t){let n=!0;const i=this._emptyTraversalStack;for(i.push(e);i.length>0;){const s=i.pop(),o=!s.hasRenderContent&&this.canTraverse(s,t,!1,!1),c=!s.hasRenderContent&&s.children.length===0;if(!o&&!s.contentAvailable&&!c&&(n=!1),this.updateTile(s,t),s.isVisibleAndInRequestVolume||(this.loadTile(s,t),this.touchTile(s,t)),o){const f=s.children;for(const A of f)i.push(A)}}return n}}const UR=new dt;function K0e(r){return r!=null}class Cx{tileset;header;id;url;parent;refine;type;contentUrl;lodMetricType="geometricError";lodMetricValue=0;boundingVolume=null;content=null;contentState=fa.UNLOADED;gpuMemoryUsageInBytes=0;children=[];depth=0;viewportIds=[];transform=new vn;extensions=null;implicitTiling=null;userData={};computedTransform;hasEmptyContent=!1;hasTilesetContent=!1;traverser=new jy({});_cacheNode=null;_frameNumber=null;_expireDate=null;_expiredContent=null;_boundingBox=void 0;_distanceToCamera=0;_screenSpaceError=0;_visibilityPlaneMask;_visible=void 0;_contentBoundingVolume;_viewerRequestVolume;_initialTransform=new vn;_priority=0;_selectedFrame=0;_requestedFrame=0;_selectionDepth=0;_touchedFrame=0;_centerZDepth=0;_shouldRefine=!1;_stackLength=0;_visitedFrame=0;_inRequestVolume=!1;_lodJudge=null;constructor(e,t,n,i=""){this.header=t,this.tileset=e,this.id=i||t.id,this.url=t.url,this.parent=n,this.refine=this._getRefine(t.refine),this.type=t.type,this.contentUrl=t.contentUrl,this._initializeLodMetric(t),this._initializeTransforms(t),this._initializeBoundingVolumes(t),this._initializeContent(t),this._initializeRenderingState(t),Object.seal(this)}destroy(){this.header=null}isDestroyed(){return this.header===null}get selected(){return this._selectedFrame===this.tileset._frameNumber}get isVisible(){return this._visible}get isVisibleAndInRequestVolume(){return this._visible&&this._inRequestVolume}get hasRenderContent(){return!this.hasEmptyContent&&!this.hasTilesetContent}get hasChildren(){return this.children.length>0||this.header.children&&this.header.children.length>0}get contentReady(){return this.contentState===fa.READY||this.hasEmptyContent}get contentAvailable(){return!!(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}get hasUnloadedContent(){return this.hasRenderContent&&this.contentUnloaded}get contentUnloaded(){return this.contentState===fa.UNLOADED}get contentExpired(){return this.contentState===fa.EXPIRED}get contentFailed(){return this.contentState===fa.FAILED}get distanceToCamera(){return this._distanceToCamera}get screenSpaceError(){return this._screenSpaceError}get boundingBox(){return this._boundingBox||(this._boundingBox=k0e(this.header.boundingVolume,this.boundingVolume)),this._boundingBox}getScreenSpaceError(e,t){switch(this.tileset.type){case Go.I3S:return k8(this,e);case Go.TILES3D:return j0e(this,e,t);default:throw new Error("Unsupported tileset type")}}unselect(){this._selectedFrame=0}_getGpuMemoryUsageInBytes(){return this.content.gpuMemoryUsageInBytes||this.content.byteLength||0}_getPriority(){const e=this.tileset._traverser,{skipLevelOfDetail:t}=e.options,n=this.refine===Tc.ADD||t;if(n&&!this.isVisible&&this._visible!==void 0||this.tileset._frameNumber-this._touchedFrame>=1||this.contentState===fa.UNLOADED)return-1;const i=this.parent,o=i&&(!n||this._screenSpaceError===0||i.hasTilesetContent)?i._screenSpaceError:this._screenSpaceError,c=e.root?e.root._screenSpaceError:0;return Math.max(c-o,0)}async loadContent(){if(this.hasEmptyContent)return!1;if(this.content)return!0;this.contentExpired&&(this._expireDate=null),this.contentState=fa.LOADING;const t=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!t)return this.contentState=fa.UNLOADED,!1;try{const n=this.tileset.getTileUrl(this.contentUrl),i=this.tileset.loader,s={...this.tileset.loadOptions,[i.id]:{...this.tileset.loadOptions[i.id],isTileset:this.type==="json",...this._getLoaderSpecificOptions(i.id)}};return this.content=await Wp(n,i,s),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=fa.READY,this._onContentLoaded(),!0}catch(n){throw this.contentState=fa.FAILED,n}finally{t.done()}}unloadContent(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=fa.UNLOADED,!0}updateVisibility(e,t){if(this._frameNumber===e.frameNumber)return;const n=this.parent,i=n?n._visibilityPlaneMask:pa.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){const s=n?n.computedTransform:this.tileset.modelMatrix;this._updateTransform(s)}this._distanceToCamera=this.distanceToTile(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._visibilityPlaneMask=this.visibility(e,i),this._visible=this._visibilityPlaneMask!==pa.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._frameNumber=e.frameNumber,this.viewportIds=t}visibility(e,t){const{cullingVolume:n}=e,{boundingVolume:i}=this;return n.computeVisibilityWithPlaneMask(i,t)}contentVisibility(){return!0}distanceToTile(e){const t=this.boundingVolume;return Math.sqrt(Math.max(t.distanceSquaredTo(e.camera.position),0))}cameraSpaceZDepth({camera:e}){const t=this.boundingVolume;return UR.subVectors(t.center,e.position),e.direction.dot(UR)}insideViewerRequestVolume(e){const t=this._viewerRequestVolume;return!t||t.distanceSquaredTo(e.camera.position)<=0}updateExpiration(){if(K0e(this._expireDate)&&this.contentReady&&!this.hasEmptyContent){const e=Date.now();Date.lessThan(this._expireDate,e)&&(this.contentState=fa.EXPIRED,this._expiredContent=this.content)}}get extras(){return this.header.extras}_initializeLodMetric(e){"lodMetricType"in e?this.lodMetricType=e.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in e?this.lodMetricValue=e.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}_initializeTransforms(e){this.transform=e.transform?new vn(e.transform):new vn;const t=this.parent,n=this.tileset,i=t&&t.computedTransform?t.computedTransform.clone():n.modelMatrix.clone();this.computedTransform=new vn(i).multiplyRight(this.transform);const s=t&&t._initialTransform?t._initialTransform.clone():new vn;this._initialTransform=new vn(s).multiplyRight(this.transform)}_initializeBoundingVolumes(e){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(e)}_initializeContent(e){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=fa.UNLOADED,this.hasTilesetContent=!1,e.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}_initializeRenderingState(e){this.depth=e.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=pa.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}_getRefine(e){return e||this.parent&&this.parent.refine||Tc.REPLACE}_isTileset(){return this.contentUrl.indexOf(".json")!==-1}_onContentLoaded(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0;break}this._isTileset()?this.hasTilesetContent=!0:this.gpuMemoryUsageInBytes=this._getGpuMemoryUsageInBytes()}_updateBoundingVolume(e){this.boundingVolume=w1(e.boundingVolume,this.computedTransform,this.boundingVolume);const t=e.content;t&&(t.boundingVolume&&(this._contentBoundingVolume=w1(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=w1(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(e=new vn){const t=e.clone().multiplyRight(this.transform);t.equals(this.computedTransform)||(this.computedTransform=t,this._updateBoundingVolume(this.header))}_getLoaderSpecificOptions(e){switch(e){case"i3s":return{...this.tileset.options.i3s,_tileOptions:{attributeUrls:this.header.attributeUrls,textureUrl:this.header.textureUrl,textureFormat:this.header.textureFormat,textureLoaderOptions:this.header.textureLoaderOptions,materialDefinition:this.header.materialDefinition,isDracoGeometry:this.header.isDracoGeometry,mbs:this.header.mbs},_tilesetOptions:{store:this.tileset.tileset.store,attributeStorageInfo:this.tileset.tileset.attributeStorageInfo,fields:this.tileset.tileset.fields},isTileHeader:!1};case"3d-tiles":case"cesium-ion":default:return J0e(this.tileset.tileset)}}}class q0e extends jy{compareDistanceToCamera(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}updateTileVisibility(e,t){if(super.updateTileVisibility(e,t),!e.isVisibleAndInRequestVolume)return;const n=e.children.length>0;if(e.hasTilesetContent&&n){const o=e.children[0];this.updateTileVisibility(o,t),e._visible=o._visible;return}if(this.meetsScreenSpaceErrorEarly(e,t)){e._visible=!1;return}const i=e.refine===Tc.REPLACE,s=e._optimChildrenWithinParent===D0e.USE_OPTIMIZATION;if(i&&s&&n&&!this.anyChildrenVisible(e,t)){e._visible=!1;return}}meetsScreenSpaceErrorEarly(e,t){const{parent:n}=e;return!n||n.hasTilesetContent||n.refine!==Tc.ADD?!1:!this.shouldRefine(e,t,!0)}}class Y0e{frameNumberMap=new Map;register(e,t){const n=this.frameNumberMap.get(e)||new Map,i=n.get(t)||0;n.set(t,i+1),this.frameNumberMap.set(e,n)}deregister(e,t){const n=this.frameNumberMap.get(e);if(!n)return;const i=n.get(t)||1;n.set(t,i-1)}isZero(e,t){return(this.frameNumberMap.get(e)?.get(t)||0)===0}}const E1={REQUESTED:"REQUESTED",COMPLETED:"COMPLETED",ERROR:"ERROR"};class Z0e{_statusMap;pendingTilesRegister=new Y0e;constructor(){this._statusMap={}}add(e,t,n,i){if(!this._statusMap[t]){const{frameNumber:s,viewport:{id:o}}=i;this._statusMap[t]={request:e,callback:n,key:t,frameState:i,status:E1.REQUESTED},this.pendingTilesRegister.register(o,s),e().then(c=>{this._statusMap[t].status=E1.COMPLETED;const{frameNumber:f,viewport:{id:A}}=this._statusMap[t].frameState;this.pendingTilesRegister.deregister(A,f),this._statusMap[t].callback(c,i)}).catch(c=>{this._statusMap[t].status=E1.ERROR;const{frameNumber:f,viewport:{id:A}}=this._statusMap[t].frameState;this.pendingTilesRegister.deregister(A,f),n(c)})}}update(e,t){if(this._statusMap[e]){const{frameNumber:n,viewport:{id:i}}=this._statusMap[e].frameState;this.pendingTilesRegister.deregister(i,n);const{frameNumber:s,viewport:{id:o}}=t;this.pendingTilesRegister.register(o,s),this._statusMap[e].frameState=t}}find(e){return this._statusMap[e]}hasPendingTiles(e,t){return!this.pendingTilesRegister.isZero(e,t)}}class Q0e extends jy{_tileManager;constructor(e){super(e),this._tileManager=new Z0e}traversalFinished(e){return!this._tileManager.hasPendingTiles(e.viewport.id,this._frameNumber||0)}shouldRefine(e,t){return e._lodJudge=W0e(e,t),e._lodJudge==="DIG"}updateChildTiles(e,t){const n=e.header.children||[],i=e.children,s=e.tileset;for(const o of n){const c=`${o.id}-${t.viewport.id}`,f=i&&i.find(A=>A.id===c);if(f)f&&this.updateTile(f,t);else{let A=()=>this._loadTile(o.id,s);this._tileManager.find(c)?this._tileManager.update(c,t):(s.tileset.nodePages&&(A=()=>s.tileset.nodePagesTile.formTileFromNodePages(o.id)),this._tileManager.add(A,c,w=>this._onTileLoad(w,e,c),t))}}return!1}async _loadTile(e,t){const{loader:n}=t,i=t.getTileUrl(`${t.url}/nodes/${e}`),s={...t.loadOptions,i3s:{...t.loadOptions.i3s,isTileHeader:!0}};return await Wp(i,n,s)}_onTileLoad(e,t,n){const i=new Cx(t.tileset,e,t,n);t.children.push(i);const s=this._tileManager.find(i.id).frameState;this.updateTile(i,s),this._frameNumber===s.frameNumber&&(this.traversalFinished(s)||new Date().getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(i,s)}}const e_e={description:"",ellipsoid:wi.WGS84,modelMatrix:new vn,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,memoryCacheOverflow:1,maximumTilesSelected:0,debounceTime:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:r=>r,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,memoryAdjustedScreenSpaceError:!1,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},b0="Tiles In Tileset(s)",B1="Tiles In Memory",zR="Tiles In View",GR="Tiles To Render",VR="Tiles Loaded",S1="Tiles Loading",HR="Tiles Unloaded",jR="Failed Tile Loads",$R="Points/Vertices",I1="Tile Memory Use",WR="Maximum Screen Space Error";class t_e{options;loadOptions;type;tileset;loader;url;basePath;modelMatrix;ellipsoid;lodMetricType;lodMetricValue;refine;root=null;roots={};asset={};description="";properties;extras=null;attributions={};credits={};stats;contentFormats={draco:!1,meshopt:!1,dds:!1,ktx2:!1};cartographicCenter=null;cartesianCenter=null;zoom=1;boundingVolume=null;dynamicScreenSpaceErrorComputedDensity=0;maximumMemoryUsage=32;gpuMemoryUsageInBytes=0;memoryAdjustedScreenSpaceError=0;_cacheBytes=0;_cacheOverflowBytes=0;_frameNumber=0;_queryParams={};_extensionsUsed=[];_tiles={};_pendingCount=0;selectedTiles=[];traverseCounter=0;geometricError=0;lastUpdatedVieports=null;_requestedTiles=[];_emptyTiles=[];frameStateData={};_traverser;_cache=new C0e;_requestScheduler;updatePromise=null;tilesetInitializationPromise;constructor(e,t){this.options={...e_e,...t},this.tileset=e,this.loader=e.loader,this.type=e.type,this.url=e.url,this.basePath=e.basePath||L6(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=e.lodMetricType,this.lodMetricValue=e.lodMetricValue,this.refine=e.root.refine,this.loadOptions=this.options.loadOptions||{},this._traverser=this._initializeTraverser(),this._requestScheduler=new O6({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this.memoryAdjustedScreenSpaceError=this.options.maximumScreenSpaceError,this._cacheBytes=this.options.maximumMemoryUsage*1024*1024,this._cacheOverflowBytes=this.options.memoryCacheOverflow*1024*1024,this.stats=new YL({id:this.url}),this._initializeStats(),this.tilesetInitializationPromise=this._initializeTileSet(e)}destroy(){this._destroy()}isLoaded(){return this._pendingCount===0&&this._frameNumber!==0&&this._requestedTiles.length===0}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return new URLSearchParams(this._queryParams).toString()}setProps(e){this.options={...this.options,...e}}getTileUrl(e){if(e.startsWith("data:"))return e;let n=e;return this.queryParams.length&&(n=`${e}${e.includes("?")?"&":"?"}${this.queryParams}`),n}hasExtension(e){return this._extensionsUsed.indexOf(e)>-1}update(e=null){this.tilesetInitializationPromise.then(()=>{!e&&this.lastUpdatedVieports?e=this.lastUpdatedVieports:this.lastUpdatedVieports=e,e&&this.doUpdate(e)})}async selectTiles(e=null){return await this.tilesetInitializationPromise,e&&(this.lastUpdatedVieports=e),this.updatePromise||(this.updatePromise=new Promise(t=>{setTimeout(()=>{this.lastUpdatedVieports&&this.doUpdate(this.lastUpdatedVieports),t(this._frameNumber),this.updatePromise=null},this.options.debounceTime)})),this.updatePromise}adjustScreenSpaceError(){this.gpuMemoryUsageInBytes<this._cacheBytes?this.memoryAdjustedScreenSpaceError=Math.max(this.memoryAdjustedScreenSpaceError/1.02,this.options.maximumScreenSpaceError):this.gpuMemoryUsageInBytes>this._cacheBytes+this._cacheOverflowBytes&&(this.memoryAdjustedScreenSpaceError*=1.02)}doUpdate(e){if("loadTiles"in this.options&&!this.options.loadTiles||this.traverseCounter>0)return;const t=e instanceof Array?e:[e];this._cache.reset(),this._frameNumber++,this.traverseCounter=t.length;const n=[];for(const i of t){const s=i.id;this._needTraverse(s)?n.push(s):this.traverseCounter--}for(const i of t){const s=i.id;if(this.roots[s]||(this.roots[s]=this._initializeTileHeaders(this.tileset,null)),!n.includes(s))continue;const o=E0e(i,this._frameNumber);this._traverser.traverse(this.roots[s],o,this.options)}}_needTraverse(e){let t=e;return this.options.viewportTraversersMap&&(t=this.options.viewportTraversersMap[e]),t===e}_onTraversalEnd(e){const t=e.viewport.id;this.frameStateData[t]||(this.frameStateData[t]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});const n=this.frameStateData[t],i=Object.values(this._traverser.selectedTiles),[s,o]=B0e(i,e,this.options.maximumTilesSelected);n.selectedTiles=s;for(const c of o)c.unselect();n._requestedTiles=Object.values(this._traverser.requestedTiles),n._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,!(this.traverseCounter>0)&&this._updateTiles()}_updateTiles(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(const e in this.frameStateData){const t=this.frameStateData[e];this.selectedTiles=this.selectedTiles.concat(t.selectedTiles),this._requestedTiles=this._requestedTiles.concat(t._requestedTiles),this._emptyTiles=this._emptyTiles.concat(t._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);for(const e of this.selectedTiles)this._tiles[e.id]=e;this._loadTiles(),this._unloadTiles(),this._updateStats()}_tilesChanged(e,t){if(e.length!==t.length)return!0;const n=new Set(e.map(o=>o.id)),i=new Set(t.map(o=>o.id));let s=e.filter(o=>!i.has(o.id)).length>0;return s=s||t.filter(o=>!n.has(o.id)).length>0,s}_loadTiles(){for(const e of this._requestedTiles)e.contentUnloaded&&this._loadTile(e)}_unloadTiles(){this._cache.unloadTiles(this,(e,t)=>e._unloadTile(t))}_updateStats(){let e=0,t=0;for(const n of this.selectedTiles)n.contentAvailable&&n.content&&(e++,n.content.pointCount?t+=n.content.pointCount:t+=n.content.vertexCount);this.stats.get(zR).count=this.selectedTiles.length,this.stats.get(GR).count=e,this.stats.get($R).count=t,this.stats.get(WR).count=this.memoryAdjustedScreenSpaceError}async _initializeTileSet(e){this.type===Go.I3S&&(this.calculateViewPropsI3S(),e.root=await e.root),this.root=this._initializeTileHeaders(e,null),this.type===Go.TILES3D&&(this._initializeTiles3DTileset(e),this.calculateViewPropsTiles3D()),this.type===Go.I3S&&this._initializeI3STileset()}calculateViewPropsI3S(){const e=this.tileset.fullExtent;if(e){const{xmin:n,xmax:i,ymin:s,ymax:o,zmin:c,zmax:f}=e;this.cartographicCenter=new dt(n+(i-n)/2,s+(o-s)/2,c+(f-c)/2),this.cartesianCenter=new dt,wi.WGS84.cartographicToCartesian(this.cartographicCenter,this.cartesianCenter),this.zoom=R8(e,this.cartographicCenter,this.cartesianCenter);return}const t=this.tileset.store?.extent;if(t){const[n,i,s,o]=t;this.cartographicCenter=new dt(n+(s-n)/2,i+(o-i)/2,0),this.cartesianCenter=new dt,wi.WGS84.cartographicToCartesian(this.cartographicCenter,this.cartesianCenter),this.zoom=R0e(t,this.cartographicCenter,this.cartesianCenter);return}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new dt,this.zoom=1}calculateViewPropsTiles3D(){const e=this.root,{center:t}=e.boundingVolume;if(!t){console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new dt,this.zoom=1;return}t[0]!==0||t[1]!==0||t[2]!==0?(this.cartographicCenter=new dt,wi.WGS84.cartesianToCartographic(t,this.cartographicCenter)):this.cartographicCenter=new dt(0,0,-wi.WGS84.radii[0]),this.cartesianCenter=t,this.zoom=P0e(e.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get(b0),this.stats.get(S1),this.stats.get(B1),this.stats.get(zR),this.stats.get(GR),this.stats.get(VR),this.stats.get(HR),this.stats.get(jR),this.stats.get($R),this.stats.get(I1,"memory"),this.stats.get(WR)}_initializeTileHeaders(e,t){const n=new Cx(this,e.root,t);if(t&&(t.children.push(n),n.depth=t.depth+1),this.type===Go.TILES3D){const i=[];for(i.push(n);i.length>0;){const s=i.pop();this.stats.get(b0).incrementCount();const o=s.header.children||[];for(const c of o){const f=new Cx(this,c,s);if(f.contentUrl?.includes("?session=")){const v=new URL(f.contentUrl).searchParams.get("session");v&&(this._queryParams.session=v)}s.children.push(f),f.depth=s.depth+1,i.push(f)}}}return n}_initializeTraverser(){let e;switch(this.type){case Go.TILES3D:e=q0e;break;case Go.I3S:e=Q0e;break;default:e=jy}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}_destroyTileHeaders(e){this._destroySubtree(e)}async _loadTile(e){let t;try{this._onStartTileLoading(),t=await e.loadContent()}catch(n){this._onTileLoadError(e,n instanceof Error?n:new Error("load failed"))}finally{this._onEndTileLoading(),this._onTileLoad(e,t)}}_onTileLoadError(e,t){this.stats.get(jR).incrementCount();const n=t.message||t.toString(),i=e.url;console.error(`A 3D tile failed to load: ${e.url} ${n}`),this.options.onTileError(e,n,i)}_onTileLoad(e,t){if(t){if(this.type===Go.I3S){const n=this.tileset?.nodePagesTile?.nodesInNodePages||0;this.stats.get(b0).reset(),this.stats.get(b0).addCount(n)}e&&e.content&&T0e(e,e.content),this.updateContentTypes(e),this._addTileToCache(e),this.options.onTileLoad(e)}}updateContentTypes(e){if(this.type===Go.I3S)switch(e.header.isDracoGeometry&&(this.contentFormats.draco=!0),e.header.textureFormat){case"dds":this.contentFormats.dds=!0;break;case"ktx2":this.contentFormats.ktx2=!0;break}else if(this.type===Go.TILES3D){const{extensionsRemoved:t=[]}=e.content?.gltf||{};t.includes("KHR_draco_mesh_compression")&&(this.contentFormats.draco=!0),t.includes("EXT_meshopt_compression")&&(this.contentFormats.meshopt=!0),t.includes("KHR_texture_basisu")&&(this.contentFormats.ktx2=!0)}}_onStartTileLoading(){this._pendingCount++,this.stats.get(S1).incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get(S1).decrementCount()}_addTileToCache(e){this._cache.add(this,e,t=>t._updateCacheStats(e))}_updateCacheStats(e){this.stats.get(VR).incrementCount(),this.stats.get(B1).incrementCount(),this.gpuMemoryUsageInBytes+=e.gpuMemoryUsageInBytes||0,this.stats.get(I1).count=this.gpuMemoryUsageInBytes,this.options.memoryAdjustedScreenSpaceError&&this.adjustScreenSpaceError()}_unloadTile(e){this.gpuMemoryUsageInBytes-=e.gpuMemoryUsageInBytes||0,this.stats.get(B1).decrementCount(),this.stats.get(HR).incrementCount(),this.stats.get(I1).count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(e),e.unloadContent()}_destroy(){const e=[];for(this.root&&e.push(this.root);e.length>0;){const t=e.pop();for(const n of t.children)e.push(n);this._destroyTile(t)}this.root=null}_destroySubtree(e){const t=e,n=[];for(n.push(t);n.length>0;){e=n.pop();for(const i of e.children)n.push(i);e!==t&&this._destroyTile(e)}t.children=[]}_destroyTile(e){this._cache.unloadTile(this,e),this._unloadTile(e),e.destroy()}_initializeTiles3DTileset(e){if(e.queryString){const t=new URLSearchParams(e.queryString),n=Object.fromEntries(t.entries());this._queryParams={...this._queryParams,...n}}if(this.asset=e.asset,!this.asset)throw new Error("Tileset must have an asset property.");if(this.asset.version!=="0.0"&&this.asset.version!=="1.0"&&this.asset.version!=="1.1")throw new Error("The tileset must be 3D Tiles version either 0.0 or 1.0 or 1.1.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=e.properties,this.geometricError=e.geometricError,this._extensionsUsed=e.extensionsUsed||[],this.extras=e.extras}_initializeI3STileset(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}const N8="4.2.4",UA={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GLTF:"glTF"};function U8(r,e,t){Ai(r instanceof ArrayBuffer);const n=new TextDecoder("utf8"),i=new Uint8Array(r,e,t);return n.decode(i)}function r_e(r,e=0){const t=new DataView(r);return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}const n_e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},ps={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Un={...n_e,...ps},M1={[ps.DOUBLE]:Float64Array,[ps.FLOAT]:Float32Array,[ps.UNSIGNED_SHORT]:Uint16Array,[ps.UNSIGNED_INT]:Uint32Array,[ps.UNSIGNED_BYTE]:Uint8Array,[ps.BYTE]:Int8Array,[ps.SHORT]:Int16Array,[ps.INT]:Int32Array},i_e={DOUBLE:ps.DOUBLE,FLOAT:ps.FLOAT,UNSIGNED_SHORT:ps.UNSIGNED_SHORT,UNSIGNED_INT:ps.UNSIGNED_INT,UNSIGNED_BYTE:ps.UNSIGNED_BYTE,BYTE:ps.BYTE,SHORT:ps.SHORT,INT:ps.INT},P1="Failed to convert GL type";class ll{static fromTypedArray(e){e=ArrayBuffer.isView(e)?e.constructor:e;for(const t in M1)if(M1[t]===e)return t;throw new Error(P1)}static fromName(e){const t=i_e[e];if(!t)throw new Error(P1);return t}static getArrayType(e){switch(e){case ps.UNSIGNED_SHORT_5_6_5:case ps.UNSIGNED_SHORT_4_4_4_4:case ps.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:const t=M1[e];if(!t)throw new Error(P1);return t}}static getByteSize(e){return ll.getArrayType(e).BYTES_PER_ELEMENT}static validate(e){return!!ll.getArrayType(e)}static createTypedArray(e,t,n=0,i){i===void 0&&(i=(t.byteLength-n)/ll.getByteSize(e));const s=ll.getArrayType(e);return new s(t,n,i)}}function s_e(r,e){if(!r)throw new Error(`math.gl assertion failed. ${e}`)}function o_e(r,e=[0,0,0]){const t=r>>11&31,n=r>>5&63,i=r&31;return e[0]=t<<3,e[1]=n<<2,e[2]=i<<3,e}new yw;new dt;new yw;new yw;function JR(r,e=255){return Kl(r,0,e)/e*2-1}function XR(r){return r<0?-1:1}function a_e(r,e,t,n){if(s_e(n),r<0||r>t||e<0||e>t)throw new Error(`x and y must be unsigned normalized integers between 0 and ${t}`);if(n.x=JR(r,t),n.y=JR(e,t),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){const i=n.x;n.x=(1-Math.abs(n.y))*XR(i),n.y=(1-Math.abs(i))*XR(n.y)}return n.normalize()}function c_e(r,e,t){return a_e(r,e,255,t)}class KC{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(e,t){this.json=e,this.buffer=t}getExtension(e){return this.json.extensions&&this.json.extensions[e]}hasProperty(e){return!!this.json[e]}getGlobalProperty(e,t=Un.UNSIGNED_INT,n=1){const i=this.json[e];return i&&Number.isFinite(i.byteOffset)?this._getTypedArrayFromBinary(e,t,n,1,i.byteOffset):i}getPropertyArray(e,t,n){const i=this.json[e];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(t=ll.fromName(i.componentType)),this._getTypedArrayFromBinary(e,t,n,this.featuresLength,i.byteOffset)):this._getTypedArrayFromArray(e,t,i)}getProperty(e,t,n,i,s){const o=this.json[e];if(!o)return o;const c=this.getPropertyArray(e,t,n);if(n===1)return c[i];for(let f=0;f<n;++f)s[f]=c[n*i+f];return s}_getTypedArrayFromBinary(e,t,n,i,s){const o=this._cachedTypedArrays;let c=o[e];return c||(c=ll.createTypedArray(t,this.buffer.buffer,this.buffer.byteOffset+s,i*n),o[e]=c),c}_getTypedArrayFromArray(e,t,n){const i=this._cachedTypedArrays;let s=i[e];return s||(s=ll.createTypedArray(t,n),i[e]=s),s}}const l_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},u_e={SCALAR:(r,e)=>r[e],VEC2:(r,e)=>[r[2*e+0],r[2*e+1]],VEC3:(r,e)=>[r[3*e+0],r[3*e+1],r[3*e+2]],VEC4:(r,e)=>[r[4*e+0],r[4*e+1],r[4*e+2],r[4*e+3]],MAT2:(r,e)=>[r[4*e+0],r[4*e+1],r[4*e+2],r[4*e+3]],MAT3:(r,e)=>[r[9*e+0],r[9*e+1],r[9*e+2],r[9*e+3],r[9*e+4],r[9*e+5],r[9*e+6],r[9*e+7],r[9*e+8]],MAT4:(r,e)=>[r[16*e+0],r[16*e+1],r[16*e+2],r[16*e+3],r[16*e+4],r[16*e+5],r[16*e+6],r[16*e+7],r[16*e+8],r[16*e+9],r[16*e+10],r[16*e+11],r[16*e+12],r[16*e+13],r[16*e+14],r[16*e+15]]},f_e={SCALAR:(r,e,t)=>{e[t]=r},VEC2:(r,e,t)=>{e[2*t+0]=r[0],e[2*t+1]=r[1]},VEC3:(r,e,t)=>{e[3*t+0]=r[0],e[3*t+1]=r[1],e[3*t+2]=r[2]},VEC4:(r,e,t)=>{e[4*t+0]=r[0],e[4*t+1]=r[1],e[4*t+2]=r[2],e[4*t+3]=r[3]},MAT2:(r,e,t)=>{e[4*t+0]=r[0],e[4*t+1]=r[1],e[4*t+2]=r[2],e[4*t+3]=r[3]},MAT3:(r,e,t)=>{e[9*t+0]=r[0],e[9*t+1]=r[1],e[9*t+2]=r[2],e[9*t+3]=r[3],e[9*t+4]=r[4],e[9*t+5]=r[5],e[9*t+6]=r[6],e[9*t+7]=r[7],e[9*t+8]=r[8],e[9*t+9]=r[9]},MAT4:(r,e,t)=>{e[16*t+0]=r[0],e[16*t+1]=r[1],e[16*t+2]=r[2],e[16*t+3]=r[3],e[16*t+4]=r[4],e[16*t+5]=r[5],e[16*t+6]=r[6],e[16*t+7]=r[7],e[16*t+8]=r[8],e[16*t+9]=r[9],e[16*t+10]=r[10],e[16*t+11]=r[11],e[16*t+12]=r[12],e[16*t+13]=r[13],e[16*t+14]=r[14],e[16*t+15]=r[15]}};function h_e(r,e,t,n){const{componentType:i}=r;Ai(r.componentType);const s=typeof i=="string"?ll.fromName(i):i,o=l_e[r.type],c=u_e[r.type],f=f_e[r.type];return t+=r.byteOffset,{values:ll.createTypedArray(s,e,t,o*n),type:s,size:o,unpacker:c,packer:f}}const al=r=>r!==void 0;function d_e(r,e,t){if(!e)return null;let n=r.getExtension("3DTILES_batch_table_hierarchy");const i=e.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?p_e(n,t):null}function p_e(r,e){let t,n,i;const s=r.instancesLength,o=r.classes;let c=r.classIds,f=r.parentCounts,A=r.parentIds,v=s;al(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,s));let w;if(al(f))for(al(f.byteOffset)&&(f.componentType=defaultValue(f.componentType,GL.UNSIGNED_SHORT),f.type=AttributeType.SCALAR,i=getBinaryAccessor(f),f=i.createArrayBufferView(e.buffer,e.byteOffset+f.byteOffset,s)),w=new Uint16Array(s),v=0,t=0;t<s;++t)w[t]=v,v+=f[t];al(A)&&al(A.byteOffset)&&(A.componentType=defaultValue(A.componentType,GL.UNSIGNED_SHORT),A.type=AttributeType.SCALAR,i=getBinaryAccessor(A),A=i.createArrayBufferView(e.buffer,e.byteOffset+A.byteOffset,v));const S=o.length;for(t=0;t<S;++t){const $=o[t].length,G=o[t].instances,H=getBinaryProperties($,G,e);o[t].instances=combine(H,G)}const F=new Array(S).fill(0),N=new Uint16Array(s);for(t=0;t<s;++t)n=c[t],N[t]=F[n],++F[n];const U={classes:o,classIds:c,classIndexes:N,parentCounts:f,parentIndexes:w,parentIds:A};return m_e(U),U}function zA(r,e,t){if(!r)return;const n=r.parentCounts;return r.parentIds?t(r,e):n>0?A_e(r,e,t):g_e(r,e,t)}function A_e(r,e,t){const n=r.classIds,i=r.parentCounts,s=r.parentIds,o=r.parentIndexes,c=n.length,f=scratchVisited;f.length=Math.max(f.length,c);const A=++marker,v=scratchStack;for(v.length=0,v.push(e);v.length>0;){if(e=v.pop(),f[e]===A)continue;f[e]=A;const w=t(r,e);if(al(w))return w;const S=i[e],F=o[e];for(let N=0;N<S;++N){const U=s[F+N];U!==e&&v.push(U)}}return null}function g_e(r,e,t){let n=!0;for(;n;){const i=t(r,e);if(al(i))return i;const s=r.parentIds[e];n=s!==e,e=s}throw new Error("traverseHierarchySingleParent")}function m_e(r){const t=r.classIds.length;for(let n=0;n<t;++n)z8(r,n,stack)}function z8(r,e,t){const n=r.parentCounts,i=r.parentIds,s=r.parentIndexes,c=r.classIds.length;if(!al(i))return;assert(e<c,`Parent index ${e} exceeds the total number of instances: ${c}`),assert(t.indexOf(e)===-1,"Circular dependency detected in the batch table hierarchy."),t.push(e);const f=al(n)?n[e]:1,A=al(n)?s[e]:e;for(let v=0;v<f;++v){const w=i[A+v];w!==e&&z8(r,w,t)}t.pop(e)}function zo(r){return r!=null}const x0=(r,e)=>r,__e={HIERARCHY:!0,extensions:!0,extras:!0};class G8{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(e,t,n,i={}){Ai(n>=0),this.json=e||{},this.binary=t,this.featureCount=n,this._extensions=this.json?.extensions||{},this._properties={};for(const s in this.json)__e[s]||(this._properties[s]=this.json[s]);this._binaryProperties=this._initializeBinaryProperties(),i["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=d_e(this,this.json,this.binary))}getExtension(e){return this.json&&this.json.extensions&&this.json.extensions[e]}memorySizeInBytes(){return 0}isClass(e,t){if(this._checkBatchId(e),Ai(typeof t=="string",t),this._hierarchy){const n=zA(this._hierarchy,e,(i,s)=>{const o=i.classIds[s];return i.classes[o].name===t});return zo(n)}return!1}isExactClass(e,t){return Ai(typeof t=="string",t),this.getExactClassName(e)===t}getExactClassName(e){if(this._checkBatchId(e),this._hierarchy){const t=this._hierarchy.classIds[e];return this._hierarchy.classes[t].name}}hasProperty(e,t){return this._checkBatchId(e),Ai(typeof t=="string",t),zo(this._properties[t])||this._hasPropertyInHierarchy(e,t)}getPropertyNames(e,t){this._checkBatchId(e),t=zo(t)?t:[],t.length=0;const n=Object.keys(this._properties);return t.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}getProperty(e,t){if(this._checkBatchId(e),Ai(typeof t=="string",t),this._binaryProperties){const i=this._binaryProperties[t];if(zo(i))return this._getBinaryProperty(i,e)}const n=this._properties[t];if(zo(n))return x0(n[e]);if(this._hierarchy){const i=this._getHierarchyProperty(e,t);if(zo(i))return i}}setProperty(e,t,n){const i=this.featureCount;if(this._checkBatchId(e),Ai(typeof t=="string",t),this._binaryProperties){const o=this._binaryProperties[t];if(o){this._setBinaryProperty(o,e,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,e,t,n))return;let s=this._properties[t];zo(s)||(this._properties[t]=new Array(i),s=this._properties[t]),s[e]=x0(n)}_checkBatchId(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(e,t){return e.unpack(e.typedArray,t)}_setBinaryProperty(e,t,n){e.pack(n,e.typedArray,t)}_initializeBinaryProperties(){let e=null;for(const t in this._properties){const n=this._properties[t],i=this._initializeBinaryProperty(t,n);i&&(e=e||{},e[t]=i)}return e}_initializeBinaryProperty(e,t){if("byteOffset"in t){const n=t;Ai(this.binary,`Property ${e} requires a batch table binary.`),Ai(n.type,`Property ${e} requires a type.`);const i=h_e(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:i.values,componentCount:i.size,unpack:i.unpacker,pack:i.packer}}return null}_hasPropertyInHierarchy(e,t){if(!this._hierarchy)return!1;const n=zA(this._hierarchy,e,(i,s)=>{const o=i.classIds[s],c=i.classes[o].instances;return zo(c[t])});return zo(n)}_getPropertyNamesInHierarchy(e,t){zA(this._hierarchy,e,(n,i)=>{const s=n.classIds[i],o=n.classes[s].instances;for(const c in o)o.hasOwnProperty(c)&&t.indexOf(c)===-1&&t.push(c)})}_getHierarchyProperty(e,t){return zA(this._hierarchy,e,(n,i)=>{const s=n.classIds[i],o=n.classes[s],c=n.classIndexes[i],f=o.instances[t];return zo(f)?zo(f.typedArray)?this._getBinaryProperty(f,c):x0(f[c]):null})}_setHierarchyProperty(e,t,n,i){const s=zA(this._hierarchy,t,(o,c)=>{const f=o.classIds[c],A=o.classes[f],v=o.classIndexes[c],w=A.instances[n];return zo(w)?(Ai(c===t,`Inherited property "${n}" is read-only.`),zo(w.typedArray)?this._setBinaryProperty(w,v,i):w[v]=x0(i),!0):!1});return zo(s)}}const R1=4;function $y(r,e,t=0){const n=new DataView(e);if(r.magic=n.getUint32(t,!0),t+=R1,r.version=n.getUint32(t,!0),t+=R1,r.byteLength=n.getUint32(t,!0),t+=R1,r.version!==1)throw new Error(`3D Tile Version ${r.version} not supported`);return t}const kd=4,KR="b3dm tile in legacy format.";function qC(r,e,t){const n=new DataView(e);let i;r.header=r.header||{};let s=n.getUint32(t,!0);t+=kd;let o=n.getUint32(t,!0);t+=kd;let c=n.getUint32(t,!0);t+=kd;let f=n.getUint32(t,!0);return t+=kd,c>=570425344?(t-=kd*2,i=s,c=o,f=0,s=0,o=0,console.warn(KR)):f>=570425344&&(t-=kd,i=c,c=s,f=o,s=0,o=0,console.warn(KR)),r.header.featureTableJsonByteLength=s,r.header.featureTableBinaryByteLength=o,r.header.batchTableJsonByteLength=c,r.header.batchTableBinaryByteLength=f,r.header.batchLength=i,t}function YC(r,e,t,n){return t=y_e(r,e,t),t=v_e(r,e,t),t}function y_e(r,e,t,n){const{featureTableJsonByteLength:i,featureTableBinaryByteLength:s,batchLength:o}=r.header||{};if(r.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){const c=U8(e,t,i);r.featureTableJson=JSON.parse(c)}return t+=i||0,r.featureTableBinary=new Uint8Array(e,t,s),t+=s||0,t}function v_e(r,e,t,n){const{batchTableJsonByteLength:i,batchTableBinaryByteLength:s}=r.header||{};if(i&&i>0){const o=U8(e,t,i);r.batchTableJson=JSON.parse(o),t+=i,s&&s>0&&(r.batchTableBinary=new Uint8Array(e,t,s),r.batchTableBinary=new Uint8Array(r.batchTableBinary),t+=s)}return t}function V8(r,e,t){if(!e&&(!r||!r.batchIds||!t))return null;const{batchIds:n,isRGB565:i,pointCount:s=0}=r;if(n&&t){const o=new Uint8ClampedArray(s*3);for(let c=0;c<s;c++){const f=n[c],v=t.getProperty(f,"dimensions").map(w=>w*255);o[c*3]=v[0],o[c*3+1]=v[1],o[c*3+2]=v[2]}return{type:Un.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}if(e&&i){const o=new Uint8ClampedArray(s*3);for(let c=0;c<s;c++){const f=o_e(e[c]);o[c*3]=f[0],o[c*3+1]=f[1],o[c*3+2]=f[2]}return{type:Un.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}return e&&e.length===s*3?{type:Un.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:Un.UNSIGNED_BYTE,value:e||new Uint8ClampedArray,size:4,normalized:!0}}const qR=new dt;function b_e(r,e){if(!e)return null;if(r.isOctEncoded16P){const t=new Float32Array((r.pointsLength||0)*3);for(let n=0;n<(r.pointsLength||0);n++)c_e(e[n*2],e[n*2+1],qR),qR.toArray(t,n*3);return{type:Un.FLOAT,size:2,value:t}}return{type:Un.FLOAT,size:2,value:e}}function x_e(r,e,t){return r.isQuantized?t["3d-tiles"]&&t["3d-tiles"].decodeQuantizedPositions?(r.isQuantized=!1,w_e(r,e)):{type:Un.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}function w_e(r,e){const t=new dt,n=new Float32Array(r.pointCount*3);for(let i=0;i<r.pointCount;i++)t.set(e[i*3],e[i*3+1],e[i*3+2]).scale(1/r.quantizedRange).multiply(r.quantizedVolumeScale).add(r.quantizedVolumeOffset).toArray(n,i*3);return n}async function C_e(r,e,t,n,i){t=$y(r,e,t),t=qC(r,e,t),t=YC(r,e,t),T_e(r);const{featureTable:s,batchTable:o}=E_e(r);return await P_e(r,s,o,n,i),B_e(r,s,n),S_e(r,s,o),I_e(r,s),t}function T_e(r){r.attributes={positions:null,colors:null,normals:null,batchIds:null},r.isQuantized=!1,r.isTranslucent=!1,r.isRGB565=!1,r.isOctEncoded16P=!1}function E_e(r){const e=new KC(r.featureTableJson,r.featureTableBinary),t=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(t))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=t,r.featuresLength=t,r.pointsLength=t,r.pointCount=t,r.rtcCenter=e.getGlobalProperty("RTC_CENTER",Un.FLOAT,3);const n=M_e(r,e);return{featureTable:e,batchTable:n}}function B_e(r,e,t){if(r.attributes=r.attributes||{positions:null,colors:null,normals:null,batchIds:null},!r.attributes.positions){if(e.hasProperty("POSITION"))r.attributes.positions=e.getPropertyArray("POSITION",Un.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){const n=e.getPropertyArray("POSITION_QUANTIZED",Un.UNSIGNED_SHORT,3);if(r.isQuantized=!0,r.quantizedRange=65535,r.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Un.FLOAT,3),!r.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(r.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Un.FLOAT,3),!r.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");r.attributes.positions=x_e(r,n,t)}}if(!r.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function S_e(r,e,t){if(r.attributes=r.attributes||{positions:null,colors:null,normals:null,batchIds:null},!r.attributes.colors){let n=null;e.hasProperty("RGBA")?(n=e.getPropertyArray("RGBA",Un.UNSIGNED_BYTE,4),r.isTranslucent=!0):e.hasProperty("RGB")?n=e.getPropertyArray("RGB",Un.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(n=e.getPropertyArray("RGB565",Un.UNSIGNED_SHORT,1),r.isRGB565=!0),r.attributes.colors=V8(r,n,t)}e.hasProperty("CONSTANT_RGBA")&&(r.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",Un.UNSIGNED_BYTE,4))}function I_e(r,e){if(r.attributes=r.attributes||{positions:null,colors:null,normals:null,batchIds:null},!r.attributes.normals){let t=null;e.hasProperty("NORMAL")?t=e.getPropertyArray("NORMAL",Un.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(t=e.getPropertyArray("NORMAL_OCT16P",Un.UNSIGNED_BYTE,2),r.isOctEncoded16P=!0),r.attributes.normals=b_e(r,t)}}function M_e(r,e){let t=null;if(!r.batchIds&&e.hasProperty("BATCH_ID")&&(r.batchIds=e.getPropertyArray("BATCH_ID",Un.UNSIGNED_SHORT,1),r.batchIds)){const n=e.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");const{batchTableJson:i,batchTableBinary:s}=r;t=new G8(i,s,n)}return t}async function P_e(r,e,t,n,i){let s,o,c;const f=r.batchTableJson&&r.batchTableJson.extensions&&r.batchTableJson.extensions["3DTILES_draco_point_compression"];f&&(c=f.properties);const A=e.getExtension("3DTILES_draco_point_compression");if(A){o=A.properties;const w=A.byteOffset,S=A.byteLength;if(!o||!Number.isFinite(w)||!S)throw new Error("Draco properties, byteOffset, and byteLength must be defined");s=(r.featureTableBinary||[]).slice(w,w+S),r.hasPositions=Number.isFinite(o.POSITION),r.hasColors=Number.isFinite(o.RGB)||Number.isFinite(o.RGBA),r.hasNormals=Number.isFinite(o.NORMAL),r.hasBatchIds=Number.isFinite(o.BATCH_ID),r.isTranslucent=Number.isFinite(o.RGBA)}if(!s)return!0;const v={buffer:s,properties:{...o,...c},batchTableProperties:c};return await R_e(r,v,n,i)}async function R_e(r,e,t,n){if(!n)return;const i={...t,draco:{...t?.draco,extraAttributes:e.batchTableProperties||{}}};delete i["3d-tiles"];const s=await Bh(e.buffer,JC,i,n),o=s.attributes.POSITION&&s.attributes.POSITION.value,c=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,f=s.attributes.NORMAL&&s.attributes.NORMAL.value,A=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,v=o&&s.attributes.POSITION.value.quantization,w=f&&s.attributes.NORMAL.value.quantization;if(v){const F=s.POSITION.data.quantization,N=F.range;r.quantizedVolumeScale=new dt(N,N,N),r.quantizedVolumeOffset=new dt(F.minValues),r.quantizedRange=(1<<F.quantizationBits)-1,r.isQuantizedDraco=!0}w&&(r.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,r.isOctEncodedDraco=!0);const S={};if(e.batchTableProperties)for(const F of Object.keys(e.batchTableProperties))s.attributes[F]&&s.attributes[F].value&&(S[F.toLowerCase()]=s.attributes[F].value);r.attributes={positions:o,colors:V8(r,c,void 0),normals:f,batchIds:A,...S}}function ga(r,e){if(!r)throw new Error(e||"assert failed: gltf")}const H8={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},j8={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},F_e=1.33,YR=["SCALAR","VEC2","VEC3","VEC4"],D_e=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],O_e=new Map(D_e),L_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},k_e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},N_e={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function $8(r){return YR[r-1]||YR[0]}function ZC(r){const e=O_e.get(r.constructor);if(!e)throw new Error("Illegal typed array");return e}function QC(r,e){const t=N_e[r.componentType],n=L_e[r.type],i=k_e[r.componentType],s=r.count*n,o=r.count*n*i;ga(o>=0&&o<=e.byteLength);const c=j8[r.componentType],f=H8[r.type];return{ArrayType:t,length:s,byteLength:o,componentByteSize:c,numberOfComponentsInElement:f}}function W8(r){let{images:e,bufferViews:t}=r;e=e||[],t=t||[];const n=e.map(o=>o.bufferView);t=t.filter(o=>!n.includes(o));const i=t.reduce((o,c)=>o+c.byteLength,0),s=e.reduce((o,c)=>{const{width:f,height:A}=c.image;return o+f*A},0);return i+Math.ceil(4*s*F_e)}function U_e(r,e,t){const n=r.bufferViews[t];ga(n);const i=n.buffer,s=e[i];ga(s);const o=(n.byteOffset||0)+s.byteOffset;return new Uint8Array(s.arrayBuffer,o,n.byteLength)}function z_e(r,e,t){const n=typeof t=="number"?r.accessors?.[t]:t;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(t)}`);const i=r.bufferViews?.[n.bufferView||0];if(!i)throw new Error(`No gltf buffer view for accessor ${i}`);const{arrayBuffer:s,byteOffset:o}=e[i.buffer],c=(o||0)+(n.byteOffset||0)+(i.byteOffset||0),{ArrayType:f,length:A,componentByteSize:v,numberOfComponentsInElement:w}=QC(n,i),S=v*w,F=i.byteStride||S;if(typeof i.byteStride>"u"||i.byteStride===S)return new f(s,c,A);const N=new f(A);for(let U=0;U<n.count;U++){const $=new f(s,c+U*F,w);N.set($,U*w)}return N}function G_e(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}class vo{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||G_e(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){const t=this.getUsedExtensions().find(i=>i===e),n=this.getRequiredExtensions().find(i=>i===e);return typeof t=="string"||typeof n=="string"}getExtension(e){const t=this.getUsedExtensions().find(i=>i===e),n=this.json.extensions||{};return t?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if(typeof t=="object")return t;const n=this.json[e]&&this.json[e][t];if(!n)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return n}getTypedArrayForBufferView(e){e=this.getBufferView(e);const t=e.buffer,n=this.gltf.buffers[t];ga(n);const i=(e.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,e.byteLength)}getTypedArrayForAccessor(e){const t=this.getAccessor(e);return z_e(this.gltf.json,this.gltf.buffers,t)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),i=this.getBuffer(t.buffer).data,s=t.byteOffset||0;return new Uint8Array(i,s,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,n){return e.extensions=e.extensions||{},e.extensions[t]=n,this.registerUsedExtension(t),this}setObjectExtension(e,t,n){const i=e.extensions||{};i[t]=n}removeObjectExtension(e,t){const n=e?.extensions||{};if(n[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];const i=this.json.extensionsRemoved;i.includes(t)||i.push(t)}delete n[t]}addExtension(e,t={}){return ga(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return ga(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];const t=this.json.extensionsRemoved;t.includes(e)||t.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:n}=e;this.json.nodes=this.json.nodes||[];const i={mesh:t};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:n,material:i,mode:s=4}=e,c={primitives:[{attributes:this._addAttributes(t),mode:s}]};if(n){const f=this._addIndices(n);c.primitives[0].indices=f}return Number.isFinite(i)&&(c.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(c),this.json.meshes.length-1}addPointCloud(e){const n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,t){const n=Py(e),i=t||n?.mimeType,o={bufferView:this.addBufferView(e),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e,t=0,n=this.byteLength){const i=e.byteLength;ga(Number.isFinite(i)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const s={buffer:t,byteOffset:n,byteLength:i};return this.byteLength+=su(i,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(s),this.json.bufferViews.length-1}addAccessor(e,t){const n={bufferView:e,type:$8(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const n=this.addBufferView(e);let i={min:t.min,max:t.max};(!i.min||!i.max)&&(i=this._getAccessorMinMax(e,t.size));const s={size:t.size,componentType:ZC(e),count:Math.round(e.length/t.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(s,t))}addTexture(e){const{imageIndex:t}=e,n={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){this.gltf.buffers=[];const e=this.byteLength,t=new ArrayBuffer(e),n=new Uint8Array(t);let i=0;for(const s of this.sourceBuffers||[])i=D6(s,n,i);this.json?.buffers?.[0]?this.json.buffers[0].byteLength=e:this.json.buffers=[{byteLength:e}],this.gltf.binary=t,this.sourceBuffers=[t]}_removeStringFromArray(e,t){let n=!0;for(;n;){const i=e.indexOf(t);i>-1?e.splice(i,1):n=!1}}_addAttributes(e={}){const t={};for(const n in e){const i=e[n],s=this._getGltfAttributeName(n),o=this.addBinaryBuffer(i.value,i);t[s]=o}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const n={min:null,max:null};if(e.length<t)return n;n.min=[],n.max=[];const i=e.subarray(0,t);for(const s of i)n.min.push(s),n.max.push(s);for(let s=t;s<e.length;s+=t)for(let o=0;o<t;o++)n.min[0+o]=Math.min(n.min[0+o],e[s+o]),n.max[0+o]=Math.max(n.max[0+o],e[s+o]);return n}}function ZR(r){return(r%1+1)%1}const J8={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},V_e={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},X8={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function eT(r,e){return X8[e]*J8[r]}function Wy(r,e,t,n){if(t!=="UINT8"&&t!=="UINT16"&&t!=="UINT32"&&t!=="UINT64")return null;const i=r.getTypedArrayForBufferView(e),s=Jy(i,"SCALAR",t,n+1);return s instanceof BigInt64Array||s instanceof BigUint64Array?null:s}function Jy(r,e,t,n=1){const i=J8[e],s=V_e[t],o=X8[t],c=n*i,f=c*o;let A=r.buffer,v=r.byteOffset;return v%o!==0&&(A=new Uint8Array(A).slice(v,v+f).buffer,v=0),new s(A,v,c)}function tT(r,e,t){const n=`TEXCOORD_${e.texCoord||0}`,i=t.attributes[n],s=r.getTypedArrayForAccessor(i),o=r.gltf.json,c=e.index,f=o.textures?.[c]?.source;if(typeof f<"u"){const A=o.images?.[f]?.mimeType,v=r.gltf.images?.[f];if(v&&typeof v.width<"u"){const w=[];for(let S=0;S<s.length;S+=2){const F=H_e(v,A,s,S,e.channels);w.push(F)}return w}}return[]}function K8(r,e,t,n,i){if(!t?.length)return;const s=[];for(const v of t){let w=n.findIndex(S=>S===v);w===-1&&(w=n.push(v)-1),s.push(w)}const o=new Uint32Array(s),c=r.gltf.buffers.push({arrayBuffer:o.buffer,byteOffset:o.byteOffset,byteLength:o.byteLength})-1,f=r.addBufferView(o,c,0),A=r.addAccessor(f,{size:1,componentType:ZC(o),count:o.length});i.attributes[e]=A}function H_e(r,e,t,n,i=[0]){const s={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=t[n],c=t[n+1];let f=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(f=4);const A=j_e(o,c,r,f);let v=0;for(const w of i){const S=typeof w=="number"?Object.values(s)[w]:s[w],F=A+S.offset,N=xC(r);if(N.data.length<=F)throw new Error(`${N.data.length} <= ${F}`);const U=N.data[F];v|=U<<S.shift}return v}function j_e(r,e,t,n=1){const i=t.width,s=ZR(r)*(i-1),o=Math.round(s),c=t.height,f=ZR(e)*(c-1),A=Math.round(f),v=t.components?t.components:n;return(A*i+o)*v}function q8(r,e,t,n,i){const s=[];for(let o=0;o<e;o++){const c=t[o],f=t[o+1]-t[o];if(f+c>n)break;const A=c/i,v=f/i;s.push(r.slice(A,A+v))}return s}function Y8(r,e,t){const n=[];for(let i=0;i<e;i++){const s=i*t;n.push(r.slice(s,s+t))}return n}function Z8(r,e,t,n){if(t)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){const i=[],s=new TextDecoder("utf8");let o=0;for(let c=0;c<r;c++){const f=n[c+1]-n[c];if(f+o<=e.length){const A=e.subarray(o,f+o),v=s.decode(A);i.push(v),o+=f}}return i}return[]}const Q8="EXT_mesh_features",$_e=Q8;async function W_e(r,e){const t=new vo(r);J_e(t,e)}function J_e(r,e){const t=r.gltf.json;if(t.meshes)for(const n of t.meshes)for(const i of n.primitives)X_e(r,i,e)}function X_e(r,e,t){if(!t?.gltf?.loadBuffers)return;const i=e.extensions?.[Q8]?.featureIds;if(i)for(const s of i){let o;if(typeof s.attribute<"u"){const c=`_FEATURE_ID_${s.attribute}`,f=e.attributes[c];o=r.getTypedArrayForAccessor(f)}else typeof s.texture<"u"&&t?.gltf?.loadImages?o=tT(r,s.texture,e):o=[];s.data=o}}const K_e=Object.freeze(Object.defineProperty({__proto__:null,decode:W_e,name:$_e},Symbol.toStringTag,{value:"Module"})),rT="EXT_structural_metadata",q_e=rT;async function Y_e(r,e){const t=new vo(r);Z_e(t,e)}function Z_e(r,e){if(!e.gltf?.loadBuffers)return;const t=r.getExtension(rT);t&&(e.gltf?.loadImages&&Q_e(r,t),eye(r,t))}function Q_e(r,e){const t=e.propertyTextures,n=r.gltf.json;if(t&&n.meshes)for(const i of n.meshes)for(const s of i.primitives)rye(r,t,s,e)}function eye(r,e){const t=e.schema;if(!t)return;const n=t.classes,i=e.propertyTables;if(n&&i)for(const s in n){const o=tye(i,s);o&&iye(r,t,o)}}function tye(r,e){for(const t of r)if(t.class===e)return t;return null}function rye(r,e,t,n){if(!e)return;const s=t.extensions?.[rT]?.propertyTextures;if(s)for(const o of s){const c=e[o];nye(r,c,t,n)}}function nye(r,e,t,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);const i=e.class;for(const s in e.properties){const o=`${i}_${s}`,c=e.properties?.[s];if(!c)continue;c.data||(c.data=[]);const f=c.data,A=tT(r,c,t);A!==null&&(K8(r,o,A,f,t),c.data=f,n.dataAttributeNames.push(o))}}function iye(r,e,t){const n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);const i=t.count;for(const s in n.properties){const o=n.properties[s],c=t.properties?.[s];if(c){const f=sye(r,e,o,i,c);c.data=f}}}function sye(r,e,t,n,i){let s=[];const o=i.values,c=r.getTypedArrayForBufferView(o),f=oye(r,t,i,n),A=aye(r,i,n);switch(t.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{s=cye(t,n,c,f);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${t.type}`);case"STRING":{s=Z8(n,c,f,A);break}case"ENUM":{s=lye(e,t,n,c,f);break}default:throw new Error(`Unknown classProperty type ${t.type}`)}return s}function oye(r,e,t,n){return e.array&&typeof e.count>"u"&&typeof t.arrayOffsets<"u"?Wy(r,t.arrayOffsets,t.arrayOffsetType||"UINT32",n):null}function aye(r,e,t){return typeof e.stringOffsets<"u"?Wy(r,e.stringOffsets,e.stringOffsetType||"UINT32",t):null}function cye(r,e,t,n){const i=r.array,s=r.count,o=eT(r.type,r.componentType),c=t.byteLength/o;let f;return r.componentType?f=Jy(t,r.type,r.componentType,c):f=t,i?n?q8(f,e,n,t.length,o):s?Y8(f,e,s):[]:f}function lye(r,e,t,n,i){const s=e.enumType;if(!s)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");const o=r.enums?.[s];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${s}`);const c=o.valueType||"UINT16",f=eT(e.type,c),A=n.byteLength/f;let v=Jy(n,e.type,c,A);if(v||(v=n),e.array){if(i)return uye({valuesData:v,numberOfElements:t,arrayOffsets:i,valuesDataBytesLength:n.length,elementSize:f,enumEntry:o});const w=e.count;return w?fye(v,t,w,o):[]}return nT(v,0,t,o)}function uye(r){const{valuesData:e,numberOfElements:t,arrayOffsets:n,valuesDataBytesLength:i,elementSize:s,enumEntry:o}=r,c=[];for(let f=0;f<t;f++){const A=n[f],v=n[f+1]-n[f];if(v+A>i)break;const w=A/s,S=v/s,F=nT(e,w,S,o);c.push(F)}return c}function fye(r,e,t,n){const i=[];for(let s=0;s<e;s++){const o=t*s,c=nT(r,o,t,n);i.push(c)}return i}function nT(r,e,t,n){const i=[];for(let s=0;s<t;s++)if(r instanceof BigInt64Array||r instanceof BigUint64Array)i.push("");else{const o=r[e+s],c=hye(n,o);c?i.push(c.name):i.push("")}return i}function hye(r,e){for(const t of r.values)if(t.value===e)return t;return null}const dye=Object.freeze(Object.defineProperty({__proto__:null,decode:Y_e,name:q_e},Symbol.toStringTag,{value:"Module"})),eN="EXT_feature_metadata",pye=eN;async function Aye(r,e){const t=new vo(r);gye(t,e)}function gye(r,e){if(!e.gltf?.loadBuffers)return;const t=r.getExtension(eN);t&&(e.gltf?.loadImages&&mye(r,t),_ye(r,t))}function mye(r,e){const t=e.schema;if(!t)return;const n=t.classes,{featureTextures:i}=e;if(n&&i)for(const s in n){const o=n[s],c=vye(i,s);c&&xye(r,c,o)}}function _ye(r,e){const t=e.schema;if(!t)return;const n=t.classes,i=e.featureTables;if(n&&i)for(const s in n){const o=yye(i,s);o&&bye(r,t,o)}}function yye(r,e){for(const t in r){const n=r[t];if(n.class===e)return n}return null}function vye(r,e){for(const t in r){const n=r[t];if(n.class===e)return n}return null}function bye(r,e,t){if(!t.class)return;const n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);const i=t.count;for(const s in n.properties){const o=n.properties[s],c=t.properties?.[s];if(c){const f=wye(r,e,o,i,c);c.data=f}}}function xye(r,e,t){const n=e.class;for(const i in t.properties){const s=e?.properties?.[i];if(s){const o=Sye(r,s,n);s.data=o}}}function wye(r,e,t,n,i){let s=[];const o=i.bufferView,c=r.getTypedArrayForBufferView(o),f=Cye(r,t,i,n),A=Tye(r,t,i,n);return t.type==="STRING"||t.componentType==="STRING"?s=Z8(n,c,f,A):Eye(t)&&(s=Bye(t,n,c,f)),s}function Cye(r,e,t,n){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof t.arrayOffsetBufferView<"u"?Wy(r,t.arrayOffsetBufferView,t.offsetType||"UINT32",n):null}function Tye(r,e,t,n){return typeof t.stringOffsetBufferView<"u"?Wy(r,t.stringOffsetBufferView,t.offsetType||"UINT32",n):null}function Eye(r){const e=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return e.includes(r.type)||typeof r.componentType<"u"&&e.includes(r.componentType)}function Bye(r,e,t,n){const i=r.type==="ARRAY",s=r.componentCount,o="SCALAR",c=r.componentType||r.type,f=eT(o,c),A=t.byteLength/f,v=Jy(t,o,c,A);return i?n?q8(v,e,n,t.length,f):s?Y8(v,e,s):[]:v}function Sye(r,e,t){const n=r.gltf.json;if(!n.meshes)return[];const i=[];for(const s of n.meshes)for(const o of s.primitives)Iye(r,t,e,i,o);return i}function Iye(r,e,t,n,i){const s={channels:t.channels,...t.texture},o=tT(r,s,i);o&&K8(r,e,o,n,i)}const Mye=Object.freeze(Object.defineProperty({__proto__:null,decode:Aye,name:pye},Symbol.toStringTag,{value:"Module"})),Pye="4.2.4",Vp=!0,QR=1735152710,iT=12,K_=8,Rye=1313821514,Fye=5130562,Dye=0,Oye=0,Lye=1;function kye(r,e=0){return`${String.fromCharCode(r.getUint8(e+0))}${String.fromCharCode(r.getUint8(e+1))}${String.fromCharCode(r.getUint8(e+2))}${String.fromCharCode(r.getUint8(e+3))}`}function Nye(r,e=0,t={}){const n=new DataView(r),{magic:i=QR}=t,s=n.getUint32(e,!1);return s===i||s===QR}function Uye(r,e,t=0,n={}){const i=new DataView(e),s=kye(i,t+0),o=i.getUint32(t+4,Vp),c=i.getUint32(t+8,Vp);switch(Object.assign(r,{header:{byteOffset:t,byteLength:c,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),t+=iT,r.version){case 1:return zye(r,i,t);case 2:return Gye(r,i,t,n={});default:throw new Error(`Invalid GLB version ${r.version}. Only supports version 1 and 2.`)}}function zye(r,e,t){Ai(r.header.byteLength>iT+K_);const n=e.getUint32(t+0,Vp),i=e.getUint32(t+4,Vp);return t+=K_,Ai(i===Dye),Tx(r,e,t,n),t+=n,t+=Ex(r,e,t,r.header.byteLength),t}function Gye(r,e,t,n){return Ai(r.header.byteLength>iT+K_),Vye(r,e,t,n),t+r.header.byteLength}function Vye(r,e,t,n){for(;t+8<=r.header.byteLength;){const i=e.getUint32(t+0,Vp),s=e.getUint32(t+4,Vp);switch(t+=K_,s){case Rye:Tx(r,e,t,i);break;case Fye:Ex(r,e,t,i);break;case Oye:n.strict||Tx(r,e,t,i);break;case Lye:n.strict||Ex(r,e,t,i);break}t+=su(i,4)}return t}function Tx(r,e,t,n){const i=new Uint8Array(e.buffer,t,n),o=new TextDecoder("utf8").decode(i);return r.json=JSON.parse(o),su(n,4)}function Ex(r,e,t,n){return r.header.hasBinChunk=!0,r.binChunks.push({byteOffset:t,byteLength:n,arrayBuffer:e.buffer}),su(n,4)}function tN(r,e){if(r.startsWith("data:")||r.startsWith("http:")||r.startsWith("https:"))return r;const n=e.baseUri||e.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${r}`);return n.substr(0,n.lastIndexOf("/")+1)+r}const Hye="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",jye="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",$ye=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Wye=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Jye={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Xye={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function Kye(r,e,t,n,i,s="NONE"){const o=await qye();Qye(o,o.exports[Xye[i]],r,e,t,n,o.exports[Jye[s||"NONE"]])}let F1;async function qye(){return F1||(F1=Yye()),F1}async function Yye(){let r=Hye;WebAssembly.validate($ye)&&(r=jye,console.log("Warning: meshopt_decoder is using experimental SIMD support"));const e=await WebAssembly.instantiate(Zye(r),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}function Zye(r){const e=new Uint8Array(r.length);for(let n=0;n<r.length;++n){const i=r.charCodeAt(n);e[n]=i>96?i-71:i>64?i-65:i>47?i+4:i>46?63:62}let t=0;for(let n=0;n<r.length;++n)e[t++]=e[n]<60?Wye[e[n]]:(e[n]-60)*64+e[++n];return e.buffer.slice(0,t)}function Qye(r,e,t,n,i,s,o){const c=r.exports.sbrk,f=n+3&-4,A=c(f*i),v=c(s.length),w=new Uint8Array(r.exports.memory.buffer);w.set(s,v);const S=e(A,n,i,v,s.length);if(S===0&&o&&o(A,f,i),t.set(w.subarray(A,A+n*i)),c(A-c(0)),S!==0)throw new Error(`Malformed buffer data: ${S}`)}const q_="EXT_meshopt_compression",eve=q_;async function tve(r,e){const t=new vo(r);if(!e?.gltf?.decompressMeshes||!e.gltf?.loadBuffers)return;const n=[];for(const i of r.json.bufferViews||[])n.push(rve(t,i));await Promise.all(n),t.removeExtension(q_)}async function rve(r,e){const t=r.getObjectExtension(e,q_);if(t){const{byteOffset:n=0,byteLength:i=0,byteStride:s,count:o,mode:c,filter:f="NONE",buffer:A}=t,v=r.gltf.buffers[A],w=new Uint8Array(v.arrayBuffer,v.byteOffset+n,i),S=new Uint8Array(r.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);await Kye(S,o,s,w,c,f),r.removeObjectExtension(e,q_)}}const nve=Object.freeze(Object.defineProperty({__proto__:null,decode:tve,name:eve},Symbol.toStringTag,{value:"Module"})),tp="EXT_texture_webp",ive=tp;function sve(r,e){const t=new vo(r);if(!G6("image/webp")){if(t.getRequiredExtensions().includes(tp))throw new Error(`gltf: Required extension ${tp} not supported by browser`);return}const{json:n}=t;for(const i of n.textures||[]){const s=t.getObjectExtension(i,tp);s&&(i.source=s.source),t.removeObjectExtension(i,tp)}t.removeExtension(tp)}const ove=Object.freeze(Object.defineProperty({__proto__:null,name:ive,preprocess:sve},Symbol.toStringTag,{value:"Module"})),i_="KHR_texture_basisu",ave=i_;function cve(r,e){const t=new vo(r),{json:n}=t;for(const i of n.textures||[]){const s=t.getObjectExtension(i,i_);s&&(i.source=s.source,t.removeObjectExtension(i,i_))}t.removeExtension(i_)}const lve=Object.freeze(Object.defineProperty({__proto__:null,name:ave,preprocess:cve},Symbol.toStringTag,{value:"Module"}));function uve(r){const e={};for(const t in r){const n=r[t];if(t!=="indices"){const i=rN(n);e[t]=i}}return e}function rN(r){const{buffer:e,size:t,count:n}=fve(r);return{value:e,size:t,byteOffset:0,count:n,type:$8(t),componentType:ZC(e)}}function fve(r){let e=r,t=1,n=0;return r&&r.value&&(e=r.value,t=r.size||1),e&&(ArrayBuffer.isView(e)||(e=hve(e,Float32Array)),n=e.length/t),{buffer:e,size:t,count:n}}function hve(r,e,t=!1){return r?Array.isArray(r)?new e(r):t&&!(r instanceof e)?new e(r):r:null}const sf="KHR_draco_mesh_compression",dve=sf;function pve(r,e,t){const n=new vo(r);for(const i of nN(n))n.getObjectExtension(i,sf)}async function Ave(r,e,t){if(!e?.gltf?.decompressMeshes)return;const n=new vo(r),i=[];for(const s of nN(n))n.getObjectExtension(s,sf)&&i.push(mve(n,s,e,t));await Promise.all(i),n.removeExtension(sf)}function gve(r,e={}){const t=new vo(r);for(const n of t.json.meshes||[])_ve(n),t.addRequiredExtension(sf)}async function mve(r,e,t,n){const i=r.getObjectExtension(e,sf);if(!i)return;const s=r.getTypedArrayForBufferView(i.bufferView),o=Kg(s.buffer,s.byteOffset),c={...t};delete c["3d-tiles"];const f=await Bh(o,JC,c,n),A=uve(f.attributes);for(const[v,w]of Object.entries(A))if(v in e.attributes){const S=e.attributes[v],F=r.getAccessor(S);F?.min&&F?.max&&(w.min=F.min,w.max=F.max)}e.attributes=A,f.indices&&(e.indices=rN(f.indices)),r.removeObjectExtension(e,sf),yve(e)}function _ve(r,e,t=4,n,i){if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const s=n.DracoWriter.encodeSync({attributes:r}),o=i?.parseSync?.({attributes:r}),c=n._addFauxAttributes(o.attributes),f=n.addBufferView(s);return{primitives:[{attributes:c,mode:t,extensions:{[sf]:{bufferView:f,attributes:c}}}]}}function yve(r){if(!r.attributes&&Object.keys(r.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*nN(r){for(const e of r.json.meshes||[])for(const t of e.primitives)yield t}const vve=Object.freeze(Object.defineProperty({__proto__:null,decode:Ave,encode:gve,name:dve,preprocess:pve},Symbol.toStringTag,{value:"Module"})),Xy="KHR_texture_transform",bve=Xy,w0=new dt,xve=new gi,wve=new gi;async function Cve(r,e){if(!new vo(r).hasExtension(Xy)||!e.gltf?.loadBuffers)return;const i=r.json.materials||[];for(let s=0;s<i.length;s++)Tve(s,r)}function Tve(r,e){const t=e.json.materials?.[r],n=[t?.pbrMetallicRoughness?.baseColorTexture,t?.emissiveTexture,t?.normalTexture,t?.occlusionTexture,t?.pbrMetallicRoughness?.metallicRoughnessTexture],i=[];for(const s of n)s&&s?.extensions?.[Xy]&&Eve(e,r,s,i)}function Eve(r,e,t,n){const i=Bve(t,n);if(!i)return;const s=r.json.meshes||[];for(const o of s)for(const c of o.primitives){const f=c.material;Number.isFinite(f)&&e===f&&Sve(r,c,i)}}function Bve(r,e){const t=r.extensions?.[Xy],{texCoord:n=0}=r,{texCoord:i=n}=t;if(!(e.findIndex(([o,c])=>o===n&&c===i)!==-1)){const o=Pve(t);return n!==i&&(r.texCoord=i),e.push([n,i]),{originalTexCoord:n,texCoord:i,matrix:o}}return null}function Sve(r,e,t){const{originalTexCoord:n,texCoord:i,matrix:s}=t,o=e.attributes[`TEXCOORD_${n}`];if(Number.isFinite(o)){const c=r.json.accessors?.[o];if(c&&c.bufferView){const f=r.json.bufferViews?.[c.bufferView];if(f){const{arrayBuffer:A,byteOffset:v}=r.buffers[f.buffer],w=(v||0)+(c.byteOffset||0)+(f.byteOffset||0),{ArrayType:S,length:F}=QC(c,f),N=j8[c.componentType],U=H8[c.type],$=f.byteStride||N*U,G=new Float32Array(F);for(let H=0;H<c.count;H++){const J=new S(A,w+H*$,2);w0.set(J[0],J[1],1),w0.transformByMatrix3(s),G.set([w0[0],w0[1]],H*U)}n===i?Ive(c,f,r.buffers,G):Mve(i,c,e,r,G)}}}}function Ive(r,e,t,n){r.componentType=5126,t.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),e.buffer=t.length-1,e.byteLength=n.buffer.byteLength,e.byteOffset=0,delete e.byteStride}function Mve(r,e,t,n,i){n.buffers.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength});const s=n.json.bufferViews;if(!s)return;s.push({buffer:n.buffers.length-1,byteLength:i.buffer.byteLength,byteOffset:0});const o=n.json.accessors;o&&(o.push({bufferView:s?.length-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),t.attributes[`TEXCOORD_${r}`]=o.length-1)}function Pve(r){const{offset:e=[0,0],rotation:t=0,scale:n=[1,1]}=r,i=new gi().set(1,0,0,0,1,0,e[0],e[1],1),s=xve.set(Math.cos(t),Math.sin(t),0,-Math.sin(t),Math.cos(t),0,0,0,1),o=wve.set(n[0],0,0,0,n[1],0,0,0,1);return i.multiplyRight(s).multiplyRight(o)}const Rve=Object.freeze(Object.defineProperty({__proto__:null,decode:Cve,name:bve},Symbol.toStringTag,{value:"Module"})),th="KHR_lights_punctual",Fve=th;async function Dve(r){const e=new vo(r),{json:t}=e,n=e.getExtension(th);n&&(e.json.lights=n.lights,e.removeExtension(th));for(const i of t.nodes||[]){const s=e.getObjectExtension(i,th);s&&(i.light=s.light),e.removeObjectExtension(i,th)}}async function Ove(r){const e=new vo(r),{json:t}=e;if(t.lights){const n=e.addExtension(th);ga(!n.lights),n.lights=t.lights,delete t.lights}if(e.json.lights){for(const n of e.json.lights){const i=n.node;e.addObjectExtension(i,th,n)}delete e.json.lights}}const Lve=Object.freeze(Object.defineProperty({__proto__:null,decode:Dve,encode:Ove,name:Fve},Symbol.toStringTag,{value:"Module"})),Fg="KHR_materials_unlit",kve=Fg;async function Nve(r){const e=new vo(r),{json:t}=e;for(const n of t.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),e.removeObjectExtension(n,Fg);e.removeExtension(Fg)}function Uve(r){const e=new vo(r),{json:t}=e;if(e.materials)for(const n of t.materials||[])n.unlit&&(delete n.unlit,e.addObjectExtension(n,Fg,{}),e.addExtension(Fg))}const zve=Object.freeze(Object.defineProperty({__proto__:null,decode:Nve,encode:Uve,name:kve},Symbol.toStringTag,{value:"Module"})),ZA="KHR_techniques_webgl",Gve=ZA;async function Vve(r){const e=new vo(r),{json:t}=e,n=e.getExtension(ZA);if(n){const i=jve(n,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,ZA);o&&(s.technique=Object.assign({},o,i[o.technique]),s.technique.values=$ve(s.technique,e)),e.removeObjectExtension(s,ZA)}e.removeExtension(ZA)}}async function Hve(r,e){}function jve(r,e){const{programs:t=[],shaders:n=[],techniques:i=[]}=r,s=new TextDecoder;return n.forEach(o=>{if(Number.isFinite(o.bufferView))o.code=s.decode(e.getTypedArrayForBufferView(o.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),t.forEach(o=>{o.fragmentShader=n[o.fragmentShader],o.vertexShader=n[o.vertexShader]}),i.forEach(o=>{o.program=t[o.program]}),i}function $ve(r,e){const t=Object.assign({},r.values);return Object.keys(r.uniforms||{}).forEach(n=>{r.uniforms[n].value&&!(n in t)&&(t[n]=r.uniforms[n].value)}),Object.keys(t).forEach(n=>{typeof t[n]=="object"&&t[n].index!==void 0&&(t[n].texture=e.getTexture(t[n].index))}),t}const Wve=Object.freeze(Object.defineProperty({__proto__:null,decode:Vve,encode:Hve,name:Gve},Symbol.toStringTag,{value:"Module"})),iN=[dye,K_e,nve,ove,lve,vve,Lve,zve,Wve,Rve,Mye];function Jve(r,e={},t){const n=iN.filter(i=>sN(i.name,e));for(const i of n)i.preprocess?.(r,e,t)}async function Xve(r,e={},t){const n=iN.filter(i=>sN(i.name,e));for(const i of n)await i.decode?.(r,e,t)}function sN(r,e){const t=e?.gltf?.excludeExtensions||{};return!(r in t&&!t[r])}const D1="KHR_binary_glTF";function Kve(r){const e=new vo(r),{json:t}=e;for(const n of t.images||[]){const i=e.getObjectExtension(n,D1);i&&Object.assign(n,i),e.removeObjectExtension(n,D1)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(D1)}const eF={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},qve={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class Yve{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(e,t){this.json=e.json;const n=e.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),Kve(e),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in eF)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const n=e[t];if(!(!n||Array.isArray(n))){e[t]=[];for(const i in n){const s=n[i];s.id=s.id||i;const o=e[t].length;e[t].push(s),this.idToIndexMap[t][i]=o}}}_convertObjectIdsToArrayIndices(e){for(const t in eF)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:n,indices:i,material:s}=t;for(const o in n)n[o]=this._convertIdToIndex(n[o],"accessor");i&&(t.indices=this._convertIdToIndex(i,"accessor")),s&&(t.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(console.warn(`gltf v1: json doesn't contain attribute ${t}`),e[t]=[]);for(const n of e[t])for(const i in n){const s=n[i],o=this._convertIdToIndex(s,i);n[i]=o}}_convertIdToIndex(e,t){const n=qve[t];if(n in this.idToIndexMap){const i=this.idToIndexMap[n][e];if(!Number.isFinite(i))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return i}return e}_updateObjects(e){for(const t of this.json.buffers)delete t.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const n=t.values?.tex||t.values?.texture2d_0||t.values?.diffuseTex,i=e.textures.findIndex(s=>s.id===n);i!==-1&&(t.pbrMetallicRoughness.baseColorTexture={index:i})}}}function Zve(r,e={}){return new Yve().normalize(r,e)}async function Qve(r,e,t=0,n,i){return ebe(r,e,t,n),Zve(r,{normalize:n?.gltf?.normalize}),Jve(r,n,i),n?.gltf?.loadBuffers&&r.json.buffers&&await tbe(r,n,i),n?.gltf?.loadImages&&await rbe(r,n,i),await Xve(r,n,i),r}function ebe(r,e,t,n){if(n.uri&&(r.baseUri=n.uri),e instanceof ArrayBuffer&&!Nye(e,t,n)&&(e=new TextDecoder().decode(e)),typeof e=="string")r.json=F6(e);else if(e instanceof ArrayBuffer){const o={};t=Uye(o,e,t,n.glb),ga(o.type==="glTF",`Invalid GLB magic string ${o.type}`),r._glb=o,r.json=o.json}else ga(!1,"GLTF: must be ArrayBuffer or string");const i=r.json.buffers||[];if(r.buffers=new Array(i.length).fill(null),r._glb&&r._glb.header.hasBinChunk){const{binChunks:o}=r._glb;r.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}const s=r.json.images||[];r.images=new Array(s.length).fill({})}async function tbe(r,e,t){const n=r.json.buffers||[];for(let i=0;i<n.length;++i){const s=n[i];if(s.uri){const{fetch:o}=t;ga(o);const c=tN(s.uri,e),A=await(await t?.fetch?.(c))?.arrayBuffer?.();r.buffers[i]={arrayBuffer:A,byteOffset:0,byteLength:A.byteLength},delete s.uri}else r.buffers[i]===null&&(r.buffers[i]={arrayBuffer:new ArrayBuffer(s.byteLength),byteOffset:0,byteLength:s.byteLength})}}async function rbe(r,e,t){const n=nbe(r),i=r.json.images||[],s=[];for(const o of n)s.push(ibe(r,i[o],o,e,t));return await Promise.all(s)}function nbe(r){const e=new Set,t=r.json.textures||[];for(const n of t)n.source!==void 0&&e.add(n.source);return Array.from(e).sort()}async function ibe(r,e,t,n,i){let s;if(e.uri&&!e.hasOwnProperty("bufferView")){const c=tN(e.uri,n),{fetch:f}=i;s=await(await f(c)).arrayBuffer(),e.bufferView={data:s}}if(Number.isFinite(e.bufferView)){const c=U_e(r.json,r.buffers,e.bufferView);s=Kg(c.buffer,c.byteOffset,c.byteLength)}ga(s,"glTF image has no data");let o=await Bh(s,[Pg,C8],{...n,mimeType:e.mimeType,basis:n.basis||{format:$C()}},i);o&&o[0]&&(o={compressed:!0,mipmaps:!1,width:o[0].width,height:o[0].height,data:o[0]}),r.images=r.images||[],r.images[t]=o}const Y_={dataType:null,batchType:null,name:"glTF",id:"gltf",module:"gltf",version:Pye,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:sbe,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function sbe(r,e={},t){e={...Y_.options,...e},e.gltf={...Y_.options.gltf,...e.gltf};const{byteOffset:n=0}=e;return await Qve({},r,n,e,t)}const obe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},abe={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Oa={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},cbe={magFilter:Oa.TEXTURE_MAG_FILTER,minFilter:Oa.TEXTURE_MIN_FILTER,wrapS:Oa.TEXTURE_WRAP_S,wrapT:Oa.TEXTURE_WRAP_T},lbe={[Oa.TEXTURE_MAG_FILTER]:Oa.LINEAR,[Oa.TEXTURE_MIN_FILTER]:Oa.NEAREST_MIPMAP_LINEAR,[Oa.TEXTURE_WRAP_S]:Oa.REPEAT,[Oa.TEXTURE_WRAP_T]:Oa.REPEAT};function ube(){return{id:"default-sampler",parameters:lbe}}function fbe(r){return abe[r]}function hbe(r){return obe[r]}class dbe{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(e,t={}){const{json:n,buffers:i=[],images:s=[]}=e,{baseUri:o=""}=e;return ga(n),this.baseUri=o,this.buffers=i,this.images=s,this.jsonUnprocessed=n,this.json=this._resolveTree(e.json,t),this.json}_resolveTree(e,t={}){const n={...e};return this.json=n,e.bufferViews&&(n.bufferViews=e.bufferViews.map((i,s)=>this._resolveBufferView(i,s))),e.images&&(n.images=e.images.map((i,s)=>this._resolveImage(i,s))),e.samplers&&(n.samplers=e.samplers.map((i,s)=>this._resolveSampler(i,s))),e.textures&&(n.textures=e.textures.map((i,s)=>this._resolveTexture(i,s))),e.accessors&&(n.accessors=e.accessors.map((i,s)=>this._resolveAccessor(i,s))),e.materials&&(n.materials=e.materials.map((i,s)=>this._resolveMaterial(i,s))),e.meshes&&(n.meshes=e.meshes.map((i,s)=>this._resolveMesh(i,s))),e.nodes&&(n.nodes=e.nodes.map((i,s)=>this._resolveNode(i,s)),n.nodes=n.nodes.map((i,s)=>this._resolveNodeChildren(i))),e.skins&&(n.skins=e.skins.map((i,s)=>this._resolveSkin(i,s))),e.scenes&&(n.scenes=e.scenes.map((i,s)=>this._resolveScene(i,s))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(e){return this._get(this.json.scenes,e)}getNode(e){return this._get(this.json.nodes,e)}getSkin(e){return this._get(this.json.skins,e)}getMesh(e){return this._get(this.json.meshes,e)}getMaterial(e){return this._get(this.json.materials,e)}getAccessor(e){return this._get(this.json.accessors,e)}getCamera(e){return this._get(this.json.cameras,e)}getTexture(e){return this._get(this.json.textures,e)}getSampler(e){return this._get(this.json.samplers,e)}getImage(e){return this._get(this.json.images,e)}getBufferView(e){return this._get(this.json.bufferViews,e)}getBuffer(e){return this._get(this.json.buffers,e)}_get(e,t){if(typeof t=="object")return t;const n=e&&e[t];return n||console.warn(`glTF file error: Could not find ${e}[${t}]`),n}_resolveScene(e,t){return{...e,id:e.id||`scene-${t}`,nodes:(e.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(e,t){const n={...e,id:e?.id||`node-${t}`};return e.mesh!==void 0&&(n.mesh=this.getMesh(e.mesh)),e.camera!==void 0&&(n.camera=this.getCamera(e.camera)),e.skin!==void 0&&(n.skin=this.getSkin(e.skin)),e.meshes!==void 0&&e.meshes.length&&(n.mesh=e.meshes.reduce((i,s)=>{const o=this.getMesh(s);return i.id=o.id,i.primitives=i.primitives.concat(o.primitives),i},{primitives:[]})),n}_resolveNodeChildren(e){return e.children&&(e.children=e.children.map(t=>this.getNode(t))),e}_resolveSkin(e,t){const n=typeof e.inverseBindMatrices=="number"?this.getAccessor(e.inverseBindMatrices):void 0;return{...e,id:e.id||`skin-${t}`,inverseBindMatrices:n}}_resolveMesh(e,t){const n={...e,id:e.id||`mesh-${t}`,primitives:[]};return e.primitives&&(n.primitives=e.primitives.map(i=>{const s={...i,attributes:{},indices:void 0,material:void 0},o=i.attributes;for(const c in o)s.attributes[c]=this.getAccessor(o[c]);return i.indices!==void 0&&(s.indices=this.getAccessor(i.indices)),i.material!==void 0&&(s.material=this.getMaterial(i.material)),s})),n}_resolveMaterial(e,t){const n={...e,id:e.id||`material-${t}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};const i=n.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture={...i.baseColorTexture},i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture={...i.metallicRoughnessTexture},i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return n}_resolveAccessor(e,t){const n=fbe(e.componentType),i=hbe(e.type),s=n*i,o={...e,id:e.id||`accessor-${t}`,bytesPerComponent:n,components:i,bytesPerElement:s,value:void 0,bufferView:void 0,sparse:void 0};if(e.bufferView!==void 0&&(o.bufferView=this.getBufferView(e.bufferView)),o.bufferView){const c=o.bufferView.buffer,{ArrayType:f,byteLength:A}=QC(o,o.bufferView),v=(o.bufferView.byteOffset||0)+(o.byteOffset||0)+c.byteOffset;let w=c.arrayBuffer.slice(v,v+A);o.bufferView.byteStride&&(w=this._getValueFromInterleavedBuffer(c,v,o.bufferView.byteStride,o.bytesPerElement,o.count)),o.value=new f(w)}return o}_getValueFromInterleavedBuffer(e,t,n,i,s){const o=new Uint8Array(s*i);for(let c=0;c<s;c++){const f=t+c*n;o.set(new Uint8Array(e.arrayBuffer.slice(f,f+i)),c*i)}return o.buffer}_resolveTexture(e,t){return{...e,id:e.id||`texture-${t}`,sampler:typeof e.sampler=="number"?this.getSampler(e.sampler):ube(),source:typeof e.source=="number"?this.getImage(e.source):void 0}}_resolveSampler(e,t){const n={id:e.id||`sampler-${t}`,...e,parameters:{}};for(const i in n){const s=this._enumSamplerParameter(i);s!==void 0&&(n.parameters[s]=n[i])}return n}_enumSamplerParameter(e){return cbe[e]}_resolveImage(e,t){const n={...e,id:e.id||`image-${t}`,image:null,bufferView:e.bufferView!==void 0?this.getBufferView(e.bufferView):void 0},i=this.images[t];return i&&(n.image=i),n}_resolveBufferView(e,t){const n=e.buffer,i=this.buffers[n].arrayBuffer;let s=this.buffers[n].byteOffset||0;return e.byteOffset&&(s+=e.byteOffset),{id:`bufferView-${t}`,...e,buffer:this.buffers[n],data:new Uint8Array(i,s,e.byteLength)}}_resolveCamera(e,t){const n={...e,id:e.id||`camera-${t}`};return n.perspective,n.orthographic,n}}function oN(r,e){return new dbe().postProcess(r,e)}const Bx={URI:0,EMBEDDED:1};function aN(r,e,t,n){r.rotateYtoZ=!0;const i=(r.byteOffset||0)+(r.byteLength||0)-t;if(i===0)throw new Error("glTF byte length must be greater than 0.");return r.gltfUpAxis=n?.["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",r.gltfArrayBuffer=Kg(e,t,i),r.gltfByteOffset=0,r.gltfByteLength=i,t%4===0||console.warn(`${r.type}: embedded glb is not aligned to a 4-byte boundary.`),(r.byteOffset||0)+(r.byteLength||0)}async function cN(r,e,t,n){const i=t?.["3d-tiles"]||{};if(pbe(r,e),i.loadGLTF){if(!n)return;if(r.gltfUrl){const{fetch:s}=n,o=await s(r.gltfUrl,t);r.gltfArrayBuffer=await o.arrayBuffer(),r.gltfByteOffset=0}if(r.gltfArrayBuffer){const s=await Bh(r.gltfArrayBuffer,Y_,t,n);r.gltf=oN(s),r.gpuMemoryUsageInBytes=W8(r.gltf),delete r.gltfArrayBuffer,delete r.gltfByteOffset,delete r.gltfByteLength}}}function pbe(r,e,t){switch(e){case Bx.URI:if(r.gltfArrayBuffer){const n=new Uint8Array(r.gltfArrayBuffer,r.gltfByteOffset),s=new TextDecoder().decode(n);r.gltfUrl=s.replace(/[\s\0]+$/,"")}delete r.gltfArrayBuffer,delete r.gltfByteOffset,delete r.gltfByteLength;break;case Bx.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function Abe(r,e,t,n,i){t=gbe(r,e,t,n),await cN(r,Bx.EMBEDDED,n,i);const s=r?.gltf?.extensions;return s&&s.CESIUM_RTC&&(r.rtcCenter=s.CESIUM_RTC.center),t}function gbe(r,e,t,n,i){t=$y(r,e,t),t=qC(r,e,t),t=YC(r,e,t),t=aN(r,e,t,n);const s=new KC(r.featureTableJson,r.featureTableBinary);return r.rtcCenter=s.getGlobalProperty("RTC_CENTER",Un.FLOAT,3),t}async function mbe(r,e,t,n,i){return t=_be(r,e,t,n),await cN(r,r.gltfFormat||0,n,i),t}function _be(r,e,t,n,i){if(t=$y(r,e,t),r.version!==1)throw new Error(`Instanced 3D Model version ${r.version} is not supported`);t=qC(r,e,t);const s=new DataView(e);if(r.gltfFormat=s.getUint32(t,!0),t+=4,t=YC(r,e,t),t=aN(r,e,t,n),!r?.header?.featureTableJsonByteLength||r.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const o=new KC(r.featureTableJson,r.featureTableBinary),c=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=c,!Number.isFinite(c))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");r.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),r.rtcCenter=o.getGlobalProperty("RTC_CENTER",Un.FLOAT,3);const f=new G8(r.batchTableJson,r.batchTableBinary,c);return ybe(r,o,f,c),t}function ybe(r,e,t,n){const i=new Array(n),s=new dt;new dt,new dt,new dt;const o=new gi,c=new vg,f=new dt,A={},v=new vn,w=[],S=[],F=[],N=[];for(let U=0;U<n;U++){let $;if(e.hasProperty("POSITION"))$=e.getProperty("POSITION",Un.FLOAT,3,U,s);else if(e.hasProperty("POSITION_QUANTIZED")){$=e.getProperty("POSITION_QUANTIZED",Un.UNSIGNED_SHORT,3,U,s);const se=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Un.FLOAT,3);if(!se)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const Te=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Un.FLOAT,3);if(!Te)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const Ue=65535;for(let de=0;de<3;de++)$[de]=$[de]/Ue*Te[de]+se[de]}if(!$)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");if(s.copy($),A.translation=s,r.normalUp=e.getProperty("NORMAL_UP",Un.FLOAT,3,U,w),r.normalRight=e.getProperty("NORMAL_RIGHT",Un.FLOAT,3,U,S),r.normalUp){if(!r.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");r.hasCustomOrientation=!0}else{if(r.octNormalUp=e.getProperty("NORMAL_UP_OCT32P",Un.UNSIGNED_SHORT,2,U,w),r.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",Un.UNSIGNED_SHORT,2,U,S),r.octNormalUp)throw r.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");r.eastNorthUp?(wi.WGS84.eastNorthUpToFixedFrame(s,v),v.getRotationMatrix3(o)):o.identity()}c.fromMatrix3(o),A.rotation=c,f.set(1,1,1);const G=e.getProperty("SCALE",Un.FLOAT,1,U,F);Number.isFinite(G)&&f.multiplyByScalar(G);const H=e.getProperty("SCALE_NON_UNIFORM",Un.FLOAT,3,U,w);H&&f.scale(H),A.scale=f;let J=e.getProperty("BATCH_ID",Un.UNSIGNED_SHORT,1,U,N);J===void 0&&(J=U);const ue=new vn().fromQuaternion(A.rotation);v.identity(),v.translate(A.translation),v.multiplyRight(ue),v.scale(A.scale);const q=v.clone();i[U]={modelMatrix:q,batchId:J}}r.instances=i}async function vbe(r,e,t,n,i,s){t=$y(r,e,t);const o=new DataView(e);for(r.tilesLength=o.getUint32(t,!0),t+=4,r.tiles=[];r.tiles.length<r.tilesLength&&(r.byteLength||0)-t>12;){const c={shape:"tile3d"};r.tiles.push(c),t=await s(e,t,n,i,c)}return t}async function bbe(r,e,t,n){if(r.rotateYtoZ=!0,r.gltfUpAxis=t?.["3d-tiles"]?.assetGltfUpAxis?t["3d-tiles"].assetGltfUpAxis:"Y",t?.["3d-tiles"]?.loadGLTF){if(!n)return e.byteLength;const i=await Bh(e,Y_,t,n);r.gltf=oN(i),r.gpuMemoryUsageInBytes=W8(r.gltf)}else r.gltfArrayBuffer=e;return e.byteLength}async function lN(r,e=0,t,n,i={shape:"tile3d"}){switch(i.byteOffset=e,i.type=r_e(r,e),i.type){case UA.COMPOSITE:return await vbe(i,r,e,t,n,lN);case UA.BATCHED_3D_MODEL:return await Abe(i,r,e,t,n);case UA.GLTF:return await bbe(i,r,t,n);case UA.INSTANCED_3D_MODEL:return await mbe(i,r,e,t,n);case UA.POINT_CLOUD:return await C_e(i,r,e,t,n);default:throw new Error(`3DTileLoader: unknown type ${i.type}`)}}const xbe=1952609651,wbe=1;async function Cbe(r,e,t){if(new Uint32Array(r.slice(0,4))[0]!==xbe)throw new Error("Wrong subtree file magic number");if(new Uint32Array(r.slice(4,8))[0]!==wbe)throw new Error("Wrong subtree file verson, must be 1");const s=tF(r.slice(8,16)),o=new Uint8Array(r,24,s),f=new TextDecoder("utf8").decode(o),A=JSON.parse(f),v=tF(r.slice(16,24));let w=new ArrayBuffer(0);if(v&&(w=r.slice(24+s)),await C0(A,A.tileAvailability,w,t),Array.isArray(A.contentAvailability))for(const S of A.contentAvailability)await C0(A,S,w,t);else await C0(A,A.contentAvailability,w,t);return await C0(A,A.childSubtreeAvailability,w,t),A}async function C0(r,e,t,n){const i=Number.isFinite(e.bitstream)?e.bitstream:e.bufferView;if(typeof i!="number")return;const s=r.bufferViews[i],o=r.buffers[s.buffer];if(!n?.baseUrl)throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(o.uri){const f=`${n?.baseUrl||""}/${o.uri}`,v=await(await n.fetch(f)).arrayBuffer();e.explicitBitstream=new Uint8Array(v,s.byteOffset,s.byteLength);return}const c=r.buffers.slice(0,s.buffer).reduce((f,A)=>f+A.byteLength,0);e.explicitBitstream=new Uint8Array(t.slice(c,c+o.byteLength),s.byteOffset,s.byteLength)}function tF(r){const e=new DataView(r),t=e.getUint32(0,!0),n=e.getUint32(4,!0);return t+2**32*n}const uN={dataType:null,batchType:null,id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:N8,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Cbe,options:{}};/**
4580
- * @license
4581
- * Copyright 2009 The Closure Library Authors
4582
- * Copyright 2020 Daniel Wirtz / The long.js Authors.
4583
- *
4584
- * Licensed under the Apache License, Version 2.0 (the "License");
4585
- * you may not use this file except in compliance with the License.
4586
- * You may obtain a copy of the License at
4587
- *
4588
- * http://www.apache.org/licenses/LICENSE-2.0
4589
- *
4590
- * Unless required by applicable law or agreed to in writing, software
4591
- * distributed under the License is distributed on an "AS IS" BASIS,
4592
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4593
- * See the License for the specific language governing permissions and
4594
- * limitations under the License.
4595
- *
4596
- * SPDX-License-Identifier: Apache-2.0
4597
- */var Ua=null;try{Ua=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function ai(r,e,t){this.low=r|0,this.high=e|0,this.unsigned=!!t}ai.prototype.__isLong__;Object.defineProperty(ai.prototype,"__isLong__",{value:!0});function bo(r){return(r&&r.__isLong__)===!0}function rF(r){var e=Math.clz32(r&-r);return r?31-e:e}ai.isLong=bo;var nF={},iF={};function Sh(r,e){var t,n,i;return e?(r>>>=0,(i=0<=r&&r<256)&&(n=iF[r],n)?n:(t=Gn(r,0,!0),i&&(iF[r]=t),t)):(r|=0,(i=-128<=r&&r<128)&&(n=nF[r],n)?n:(t=Gn(r,r<0?-1:0,!1),i&&(nF[r]=t),t))}ai.fromInt=Sh;function za(r,e){if(isNaN(r))return e?Zl:wc;if(e){if(r<0)return Zl;if(r>=fN)return pN}else{if(r<=-oF)return jo;if(r+1>=oF)return dN}return r<0?za(-r,e).neg():Gn(r%Hp|0,r/Hp|0,e)}ai.fromNumber=za;function Gn(r,e,t){return new ai(r,e,t)}ai.fromBits=Gn;var Z_=Math.pow;function sT(r,e,t){if(r.length===0)throw Error("empty string");if(typeof e=="number"?(t=e,e=!1):e=!!e,r==="NaN"||r==="Infinity"||r==="+Infinity"||r==="-Infinity")return e?Zl:wc;if(t=t||10,t<2||36<t)throw RangeError("radix");var n;if((n=r.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return sT(r.substring(1),e,t).neg();for(var i=za(Z_(t,8)),s=wc,o=0;o<r.length;o+=8){var c=Math.min(8,r.length-o),f=parseInt(r.substring(o,o+c),t);if(c<8){var A=za(Z_(t,c));s=s.mul(A).add(za(f))}else s=s.mul(i),s=s.add(za(f))}return s.unsigned=e,s}ai.fromString=sT;function Mc(r,e){return typeof r=="number"?za(r,e):typeof r=="string"?sT(r,e):Gn(r.low,r.high,typeof e=="boolean"?e:r.unsigned)}ai.fromValue=Mc;var sF=65536,Tbe=1<<24,Hp=sF*sF,fN=Hp*Hp,oF=fN/2,aF=Sh(Tbe),wc=Sh(0);ai.ZERO=wc;var Zl=Sh(0,!0);ai.UZERO=Zl;var gp=Sh(1);ai.ONE=gp;var hN=Sh(1,!0);ai.UONE=hN;var Sx=Sh(-1);ai.NEG_ONE=Sx;var dN=Gn(-1,2147483647,!1);ai.MAX_VALUE=dN;var pN=Gn(-1,-1,!0);ai.MAX_UNSIGNED_VALUE=pN;var jo=Gn(0,-2147483648,!1);ai.MIN_VALUE=jo;var rr=ai.prototype;rr.toInt=function(){return this.unsigned?this.low>>>0:this.low};rr.toNumber=function(){return this.unsigned?(this.high>>>0)*Hp+(this.low>>>0):this.high*Hp+(this.low>>>0)};rr.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(jo)){var t=za(e),n=this.div(t),i=n.mul(t).sub(this);return n.toString(e)+i.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var s=za(Z_(e,6),this.unsigned),o=this,c="";;){var f=o.div(s),A=o.sub(f.mul(s)).toInt()>>>0,v=A.toString(e);if(o=f,o.isZero())return v+c;for(;v.length<6;)v="0"+v;c=""+v+c}};rr.getHighBits=function(){return this.high};rr.getHighBitsUnsigned=function(){return this.high>>>0};rr.getLowBits=function(){return this.low};rr.getLowBitsUnsigned=function(){return this.low>>>0};rr.getNumBitsAbs=function(){if(this.isNegative())return this.eq(jo)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,t=31;t>0&&(e&1<<t)==0;t--);return this.high!=0?t+33:t+1};rr.isZero=function(){return this.high===0&&this.low===0};rr.eqz=rr.isZero;rr.isNegative=function(){return!this.unsigned&&this.high<0};rr.isPositive=function(){return this.unsigned||this.high>=0};rr.isOdd=function(){return(this.low&1)===1};rr.isEven=function(){return(this.low&1)===0};rr.equals=function(e){return bo(e)||(e=Mc(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};rr.eq=rr.equals;rr.notEquals=function(e){return!this.eq(e)};rr.neq=rr.notEquals;rr.ne=rr.notEquals;rr.lessThan=function(e){return this.comp(e)<0};rr.lt=rr.lessThan;rr.lessThanOrEqual=function(e){return this.comp(e)<=0};rr.lte=rr.lessThanOrEqual;rr.le=rr.lessThanOrEqual;rr.greaterThan=function(e){return this.comp(e)>0};rr.gt=rr.greaterThan;rr.greaterThanOrEqual=function(e){return this.comp(e)>=0};rr.gte=rr.greaterThanOrEqual;rr.ge=rr.greaterThanOrEqual;rr.compare=function(e){if(bo(e)||(e=Mc(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};rr.comp=rr.compare;rr.negate=function(){return!this.unsigned&&this.eq(jo)?jo:this.not().add(gp)};rr.neg=rr.negate;rr.add=function(e){bo(e)||(e=Mc(e));var t=this.high>>>16,n=this.high&65535,i=this.low>>>16,s=this.low&65535,o=e.high>>>16,c=e.high&65535,f=e.low>>>16,A=e.low&65535,v=0,w=0,S=0,F=0;return F+=s+A,S+=F>>>16,F&=65535,S+=i+f,w+=S>>>16,S&=65535,w+=n+c,v+=w>>>16,w&=65535,v+=t+o,v&=65535,Gn(S<<16|F,v<<16|w,this.unsigned)};rr.subtract=function(e){return bo(e)||(e=Mc(e)),this.add(e.neg())};rr.sub=rr.subtract;rr.multiply=function(e){if(this.isZero())return this;if(bo(e)||(e=Mc(e)),Ua){var t=Ua.mul(this.low,this.high,e.low,e.high);return Gn(t,Ua.get_high(),this.unsigned)}if(e.isZero())return this.unsigned?Zl:wc;if(this.eq(jo))return e.isOdd()?jo:wc;if(e.eq(jo))return this.isOdd()?jo:wc;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(aF)&&e.lt(aF))return za(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,s=this.low>>>16,o=this.low&65535,c=e.high>>>16,f=e.high&65535,A=e.low>>>16,v=e.low&65535,w=0,S=0,F=0,N=0;return N+=o*v,F+=N>>>16,N&=65535,F+=s*v,S+=F>>>16,F&=65535,F+=o*A,S+=F>>>16,F&=65535,S+=i*v,w+=S>>>16,S&=65535,S+=s*A,w+=S>>>16,S&=65535,S+=o*f,w+=S>>>16,S&=65535,w+=n*v+i*A+s*f+o*c,w&=65535,Gn(F<<16|N,w<<16|S,this.unsigned)};rr.mul=rr.multiply;rr.divide=function(e){if(bo(e)||(e=Mc(e)),e.isZero())throw Error("division by zero");if(Ua){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var t=(this.unsigned?Ua.div_u:Ua.div_s)(this.low,this.high,e.low,e.high);return Gn(t,Ua.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Zl:wc;var n,i,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return Zl;if(e.gt(this.shru(1)))return hN;s=Zl}else{if(this.eq(jo)){if(e.eq(gp)||e.eq(Sx))return jo;if(e.eq(jo))return gp;var o=this.shr(1);return n=o.div(e).shl(1),n.eq(wc)?e.isNegative()?gp:Sx:(i=this.sub(e.mul(n)),s=n.add(i.div(e)),s)}else if(e.eq(jo))return this.unsigned?Zl:wc;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=wc}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var c=Math.ceil(Math.log(n)/Math.LN2),f=c<=48?1:Z_(2,c-48),A=za(n),v=A.mul(e);v.isNegative()||v.gt(i);)n-=f,A=za(n,this.unsigned),v=A.mul(e);A.isZero()&&(A=gp),s=s.add(A),i=i.sub(v)}return s};rr.div=rr.divide;rr.modulo=function(e){if(bo(e)||(e=Mc(e)),Ua){var t=(this.unsigned?Ua.rem_u:Ua.rem_s)(this.low,this.high,e.low,e.high);return Gn(t,Ua.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};rr.mod=rr.modulo;rr.rem=rr.modulo;rr.not=function(){return Gn(~this.low,~this.high,this.unsigned)};rr.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};rr.clz=rr.countLeadingZeros;rr.countTrailingZeros=function(){return this.low?rF(this.low):rF(this.high)+32};rr.ctz=rr.countTrailingZeros;rr.and=function(e){return bo(e)||(e=Mc(e)),Gn(this.low&e.low,this.high&e.high,this.unsigned)};rr.or=function(e){return bo(e)||(e=Mc(e)),Gn(this.low|e.low,this.high|e.high,this.unsigned)};rr.xor=function(e){return bo(e)||(e=Mc(e)),Gn(this.low^e.low,this.high^e.high,this.unsigned)};rr.shiftLeft=function(e){return bo(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?Gn(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):Gn(0,this.low<<e-32,this.unsigned)};rr.shl=rr.shiftLeft;rr.shiftRight=function(e){return bo(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?Gn(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):Gn(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};rr.shr=rr.shiftRight;rr.shiftRightUnsigned=function(e){return bo(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?Gn(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):e===32?Gn(this.high,0,this.unsigned):Gn(this.high>>>e-32,0,this.unsigned)};rr.shru=rr.shiftRightUnsigned;rr.shr_u=rr.shiftRightUnsigned;rr.rotateLeft=function(e){var t;return bo(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?Gn(this.high,this.low,this.unsigned):e<32?(t=32-e,Gn(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(e-=32,t=32-e,Gn(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))};rr.rotl=rr.rotateLeft;rr.rotateRight=function(e){var t;return bo(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?Gn(this.high,this.low,this.unsigned):e<32?(t=32-e,Gn(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(e-=32,t=32-e,Gn(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))};rr.rotr=rr.rotateRight;rr.toSigned=function(){return this.unsigned?Gn(this.low,this.high,!1):this};rr.toUnsigned=function(){return this.unsigned?this:Gn(this.low,this.high,!0)};rr.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};rr.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]};rr.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]};ai.fromBytes=function(e,t,n){return n?ai.fromBytesLE(e,t):ai.fromBytesBE(e,t)};ai.fromBytesLE=function(e,t){return new ai(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)};ai.fromBytesBE=function(e,t){return new ai(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)};const Ebe=16;function AN(r){r==="X"&&(r="");const e=r.padEnd(Ebe,"0");return ai.fromString(e,!0,16)}function Bbe(r){if(r.isZero())return"X";let e=r.countTrailingZeros();const t=e%4;e=(e-t)/4;const n=e;e*=4;const s=r.shiftRightUnsigned(e).toString(16).replace(/0+$/,"");return Array(17-n-s.length).join("0")+s}function Sbe(r,e){const t=Ibe(r).shiftRightUnsigned(2);return r.add(ai.fromNumber(2*e+1-4).multiply(t))}function Ibe(r){return r.and(r.not().add(1))}const Mbe=3,Pbe=30,Rbe=2*Pbe+1,cF=180/Math.PI;function Fbe(r){if(r.length===0)throw new Error(`Invalid Hilbert quad key ${r}`);const e=r.split("/"),t=parseInt(e[0],10),n=e[1],i=n.length;let s=0;const o=[0,0];for(let c=i-1;c>=0;c--){s=i-c;const f=n[c];let A=0,v=0;f==="1"?v=1:f==="2"?(A=1,v=1):f==="3"&&(A=1);const w=Math.pow(2,s-1);Obe(w,o,A,v),o[0]+=w*A,o[1]+=w*v}if(t%2===1){const c=o[0];o[0]=o[1],o[1]=c}return{face:t,ij:o,level:s}}function Dbe(r){if(r.isZero())return"";let e=r.toString(2);for(;e.length<Mbe+Rbe;)e="0"+e;const t=e.lastIndexOf("1"),n=e.substring(0,3),i=e.substring(3,t),s=i.length/2,o=ai.fromString(n,!0,2).toString(10);let c="";if(s!==0)for(c=ai.fromString(i,!0,2).toString(4);c.length<s;)c="0"+c;return`${o}/${c}`}function gN(r,e,t){const n=1<<e;return[(r[0]+t[0])/n,(r[1]+t[1])/n]}function lF(r){return r>=.5?1/3*(4*r*r-1):1/3*(1-4*(1-r)*(1-r))}function mN(r){return[lF(r[0]),lF(r[1])]}function _N(r,[e,t]){switch(r){case 0:return[1,e,t];case 1:return[-e,1,t];case 2:return[-e,-t,1];case 3:return[-1,-t,-e];case 4:return[t,-1,-e];case 5:return[t,e,-1];default:throw new Error("Invalid face")}}function yN([r,e,t]){const n=Math.atan2(t,Math.sqrt(r*r+e*e));return[Math.atan2(e,r)*cF,n*cF]}function Obe(r,e,t,n){if(n===0){t===1&&(e[0]=r-1-e[0],e[1]=r-1-e[1]);const i=e[0];e[0]=e[1],e[1]=i}}function Lbe(r){const e=gN(r.ij,r.level,[.5,.5]),t=mN(e),n=_N(r.face,t);return yN(n)}const kbe=100;function uF(r){const{face:e,ij:t,level:n}=r,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],s=Math.max(1,Math.ceil(kbe*Math.pow(2,-n))),o=new Float64Array(4*s*2+2);let c=0,f=0;for(let A=0;A<4;A++){const v=i[A].slice(0),w=i[A+1],S=(w[0]-v[0])/s,F=(w[1]-v[1])/s;for(let N=0;N<s;N++){v[0]+=S,v[1]+=F;const U=gN(t,n,v),$=mN(U),G=_N(e,$),H=yN(G);Math.abs(H[1])>89.999&&(H[0]=f);const J=H[0]-f;H[0]+=J>180?-360:J<-180?360:0,o[c++]=H[0],o[c++]=H[1],f=H[0]}}return o[c++]=o[0],o[c++]=o[1],o}function oT(r){const e=Nbe(r);return Fbe(e)}function Nbe(r){if(r.indexOf("/")>0)return r;const e=AN(r);return Dbe(e)}function Ube(r){const e=oT(r);return Lbe(e)}function zbe(r){let e;if(r.face===2||r.face===5){let t=null,n=0;for(let i=0;i<4;i++){const s=`${r.face}/${i}`,o=oT(s),c=uF(o);(typeof t>"u"||t===null)&&(t=new Float64Array(4*c.length)),t.set(c,n),n+=c.length}e=fF(t)}else{const t=uF(r);e=fF(t)}return e}function fF(r){if(r.length%2!==0)throw new Error("Invalid corners");const e=[],t=[];for(let n=0;n<r.length;n+=2)e.push(r[n]),t.push(r[n+1]);return e.sort((n,i)=>n-i),t.sort((n,i)=>n-i),{west:e[0],east:e[e.length-1],north:t[t.length-1],south:t[0]}}function Gbe(r,e){const t=e?.minimumHeight||0,n=e?.maximumHeight||0,i=oT(r),s=zbe(i),o=s.west,c=s.south,f=s.east,A=s.north,v=[];return v.push(new dt(o,A,t)),v.push(new dt(f,A,t)),v.push(new dt(f,c,t)),v.push(new dt(o,c,t)),v.push(new dt(o,A,n)),v.push(new dt(f,A,n)),v.push(new dt(f,c,n)),v.push(new dt(o,c,n)),v}function vN(r){const e=r.token,t={minimumHeight:r.minimumHeight,maximumHeight:r.maximumHeight},n=Gbe(e,t),i=Ube(e),s=i[0],o=i[1],c=wi.WGS84.cartographicToCartesian([s,o,t.maximumHeight]),f=new dt(c[0],c[1],c[2]);n.push(f);const A=H6(n);return[...A.center,...A.halfAxes]}const Vbe=4,Hbe=8,jbe={QUADTREE:Vbe,OCTREE:Hbe};function $be(r,e,t){if(r?.box){const n=AN(r.s2VolumeInfo.token),i=Sbe(n,e),s=Bbe(i),o={...r.s2VolumeInfo};switch(o.token=s,t){case"OCTREE":const A=r.s2VolumeInfo,v=A.maximumHeight-A.minimumHeight,w=v/2,S=A.minimumHeight+v/2;A.minimumHeight=S-w,A.maximumHeight=S+w;break}return{box:vN(o),s2VolumeInfo:o}}}async function bN(r){const{implicitOptions:e,parentData:t={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,s2VolumeBox:i,loaderOptions:s}=r;let{subtree:o,level:c=0,globalData:f={level:0,mortonIndex:0,x:0,y:0,z:0}}=r;const{subdivisionScheme:A,subtreeLevels:v,maximumLevel:w,contentUrlTemplate:S,subtreesUriTemplate:F,basePath:N}=e,U={children:[],lodMetricValue:0,contentUrl:""};if(!w)return JL.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${S} won't be loaded...`),U;const $=c+f.level;if($>w)return U;const G=jbe[A],H=Math.log2(G),J=n&1,ue=n>>1&1,q=n>>2&1,se=(G**c-1)/(G-1);let Te=jf(t.mortonIndex,n,H),Ue=se+Te,de=jf(t.x,J,1),me=jf(t.y,ue,1),pe=jf(t.z,q,1),W=!1;c>=v&&(W=O1(o.childSubtreeAvailability,Te));const re=jf(f.x,de,c),Ee=jf(f.y,me,c),et=jf(f.z,pe,c);if(W){const tt=`${N}/${F}`,rt=Ix(tt,$,re,Ee,et);o=await Wp(rt,uN,s),f={mortonIndex:Te,x:de,y:me,z:pe,level:c},Te=0,Ue=0,de=0,me=0,pe=0,c=0}if(!O1(o.tileAvailability,Ue))return U;O1(o.contentAvailability,Ue)&&(U.contentUrl=Ix(S,$,re,Ee,et));const Ge=c+1,Ze={mortonIndex:Te,x:de,y:me,z:pe};for(let tt=0;tt<G;tt++){const rt=$be(i,tt,A),ut=await bN({subtree:o,implicitOptions:e,loaderOptions:s,parentData:Ze,childIndex:tt,level:Ge,globalData:{...f},s2VolumeBox:rt});if(ut.contentUrl||ut.children.length){const vt=$+1,st=Wbe(ut,vt,{childTileX:de,childTileY:me,childTileZ:pe},e,i);U.children.push(st)}}return U}function O1(r,e){let t;return Array.isArray(r)?(t=r[0],r.length>1&&JL.once('Not supported extension "3DTILES_multiple_contents" has been detected')):t=r,"constant"in t?!!t.constant:t.explicitBitstream?Kbe(e,t.explicitBitstream):!1}function Wbe(r,e,t,n,i){const{basePath:s,refine:o,getRefine:c,lodMetricType:f,getTileType:A,rootLodMetricValue:v,rootBoundingVolume:w}=n,S=r.contentUrl&&r.contentUrl.replace(`${s}/`,""),F=v/2**e,N=i?.box?{box:i.box}:w,U=Jbe(e,N,t);return{children:r.children,contentUrl:r.contentUrl,content:{uri:S},id:r.contentUrl,refine:c(o),type:A(r),lodMetricType:f,lodMetricValue:F,geometricError:F,transform:r.transform,boundingVolume:U}}function Jbe(r,e,t){if(e.region){const{childTileX:n,childTileY:i,childTileZ:s}=t,[o,c,f,A,v,w]=e.region,S=2**r,F=(f-o)/S,N=(A-c)/S,U=(w-v)/S,[$,G]=[o+F*n,o+F*(n+1)],[H,J]=[c+N*i,c+N*(i+1)],[ue,q]=[v+U*s,v+U*(s+1)];return{region:[$,H,G,J,ue,q]}}if(e.box)return e;throw new Error(`Unsupported bounding volume type ${JSON.stringify(e)}`)}function jf(r,e,t){return(r<<t)+e}function Ix(r,e,t,n,i){const s=Xbe({level:e,x:t,y:n,z:i});return r.replace(/{level}|{x}|{y}|{z}/gi,o=>s[o])}function Xbe(r){const e={};for(const t in r)e[`{${t}}`]=r[t];return e}function Kbe(r,e){const t=Math.floor(r/8),n=r%8;return(e[t]>>n&1)===1}function aT(r,e=""){if(!e)return Yl.EMPTY;const n=e.split("?")[0].split(".").pop();switch(n){case"pnts":return Yl.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Yl.SCENEGRAPH;default:return n||Yl.EMPTY}}function cT(r){switch(r){case"REPLACE":case"replace":return Tc.REPLACE;case"ADD":case"add":return Tc.ADD;default:return r}}function Mx(r,e){if(/^[a-z][0-9a-z+.-]*:/i.test(e)){const n=new URL(r,`${e}/`);return decodeURI(n.toString())}else if(r.startsWith("/"))return r;return Wue(e,r)}function hF(r,e){if(!r)return null;let t;if(r.content){const i=r.content.uri||r.content?.url;typeof i<"u"&&(t=Mx(i,e))}return{...r,id:t,contentUrl:t,lodMetricType:Gp.GEOMETRIC_ERROR,lodMetricValue:r.geometricError,transformMatrix:r.transform,type:aT(r,t),refine:cT(r.refine)}}async function qbe(r,e,t){let n=null;const i=pF(r.root);i&&r.root?n=await dF(r.root,r,e,i,t):n=hF(r.root,e);const s=[];for(s.push(n);s.length>0;){const o=s.pop()||{},c=o.children||[],f=[];for(const A of c){const v=pF(A);let w;v?w=await dF(A,r,e,v,t):w=hF(A,e),w&&(f.push(w),s.push(w))}o.children=f}return n}async function dF(r,e,t,n,i){const{subdivisionScheme:s,maximumLevel:o,availableLevels:c,subtreeLevels:f,subtrees:{uri:A}}=n,v=Ix(A,0,0,0,0),w=Mx(v,t),S=await Wp(w,uN,i),F=r.content?.uri,N=F?Mx(F,t):"",U=e?.root?.refine,$=r.geometricError,G=r.boundingVolume.extensions?.["3DTILES_bounding_volume_S2"];if(G){const q={box:vN(G),s2VolumeInfo:G};r.boundingVolume=q}const H=r.boundingVolume,J={contentUrlTemplate:N,subtreesUriTemplate:A,subdivisionScheme:s,subtreeLevels:f,maximumLevel:Number.isFinite(c)?c-1:o,refine:U,basePath:t,lodMetricType:Gp.GEOMETRIC_ERROR,rootLodMetricValue:$,rootBoundingVolume:H,getTileType:aT,getRefine:cT};return await Ybe(r,t,S,J,i)}async function Ybe(r,e,t,n,i){if(!r)return null;const{children:s,contentUrl:o}=await bN({subtree:t,implicitOptions:n,loaderOptions:i});let c,f=null;return o&&(c=o,f={uri:o.replace(`${e}/`,"")}),{...r,id:c,contentUrl:c,lodMetricType:Gp.GEOMETRIC_ERROR,lodMetricValue:r.geometricError,transformMatrix:r.transform,type:aT(r,c),refine:cT(r.refine),content:f||r.content,children:s}}function pF(r){return r?.extensions?.["3DTILES_implicit_tiling"]||r?.implicitTiling}const xN={dataType:null,batchType:null,id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:N8,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:Zbe,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function Zbe(r,e={},t){const n=e["3d-tiles"]||{};let i;return n.isTileset==="auto"?i=t?.url&&t.url.indexOf(".json")!==-1:i=n.isTileset,i?Qbe(r,e,t):e1e(r,e,t)}async function Qbe(r,e,t){const n=JSON.parse(new TextDecoder().decode(r)),i=t?.url||"",s=t1e(i),o=await qbe(n,s,e||{});return{...n,shape:"tileset3d",loader:xN,url:i,queryString:t?.queryString||"",basePath:s,root:o||n.root,type:Go.TILES3D,lodMetricType:Gp.GEOMETRIC_ERROR,lodMetricValue:n.root?.geometricError||0}}async function e1e(r,e,t){const n={content:{shape:"tile3d",featureIds:null}};return await lN(r,0,e,t,n.content),n.content}function t1e(r){return L6(r)}var L1={},AF;function pf(){return AF||(AF=1,function(r){var e=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function t(s,o){return Object.prototype.hasOwnProperty.call(s,o)}r.assign=function(s){for(var o=Array.prototype.slice.call(arguments,1);o.length;){var c=o.shift();if(c){if(typeof c!="object")throw new TypeError(c+"must be non-object");for(var f in c)t(c,f)&&(s[f]=c[f])}}return s},r.shrinkBuf=function(s,o){return s.length===o?s:s.subarray?s.subarray(0,o):(s.length=o,s)};var n={arraySet:function(s,o,c,f,A){if(o.subarray&&s.subarray){s.set(o.subarray(c,c+f),A);return}for(var v=0;v<f;v++)s[A+v]=o[c+v]},flattenChunks:function(s){var o,c,f,A,v,w;for(f=0,o=0,c=s.length;o<c;o++)f+=s[o].length;for(w=new Uint8Array(f),A=0,o=0,c=s.length;o<c;o++)v=s[o],w.set(v,A),A+=v.length;return w}},i={arraySet:function(s,o,c,f,A){for(var v=0;v<f;v++)s[A+v]=o[c+v]},flattenChunks:function(s){return[].concat.apply([],s)}};r.setTyped=function(s){s?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,n)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,i))},r.setTyped(e)}(L1)),L1}var Nd={},fc={},$f={},gF;function r1e(){if(gF)return $f;gF=1;var r=pf(),e=4,t=0,n=1,i=2;function s(Me){for(var kt=Me.length;--kt>=0;)Me[kt]=0}var o=0,c=1,f=2,A=3,v=258,w=29,S=256,F=S+1+w,N=30,U=19,$=2*F+1,G=15,H=16,J=7,ue=256,q=16,se=17,Te=18,Ue=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],de=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],me=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],pe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],W=512,re=new Array((F+2)*2);s(re);var Ee=new Array(N*2);s(Ee);var et=new Array(W);s(et);var _e=new Array(v-A+1);s(_e);var Le=new Array(w);s(Le);var Ge=new Array(N);s(Ge);function Ze(Me,kt,$t,lr,Ye){this.static_tree=Me,this.extra_bits=kt,this.extra_base=$t,this.elems=lr,this.max_length=Ye,this.has_stree=Me&&Me.length}var tt,rt,ut;function vt(Me,kt){this.dyn_tree=Me,this.max_code=0,this.stat_desc=kt}function St(Me){return Me<256?et[Me]:et[256+(Me>>>7)]}function st(Me,kt){Me.pending_buf[Me.pending++]=kt&255,Me.pending_buf[Me.pending++]=kt>>>8&255}function dr(Me,kt,$t){Me.bi_valid>H-$t?(Me.bi_buf|=kt<<Me.bi_valid&65535,st(Me,Me.bi_buf),Me.bi_buf=kt>>H-Me.bi_valid,Me.bi_valid+=$t-H):(Me.bi_buf|=kt<<Me.bi_valid&65535,Me.bi_valid+=$t)}function er(Me,kt,$t){dr(Me,$t[kt*2],$t[kt*2+1])}function Kt(Me,kt){var $t=0;do $t|=Me&1,Me>>>=1,$t<<=1;while(--kt>0);return $t>>>1}function Nt(Me){Me.bi_valid===16?(st(Me,Me.bi_buf),Me.bi_buf=0,Me.bi_valid=0):Me.bi_valid>=8&&(Me.pending_buf[Me.pending++]=Me.bi_buf&255,Me.bi_buf>>=8,Me.bi_valid-=8)}function Ar(Me,kt){var $t=kt.dyn_tree,lr=kt.max_code,Ye=kt.stat_desc.static_tree,Rt=kt.stat_desc.has_stree,Ae=kt.stat_desc.extra_bits,Gt=kt.stat_desc.extra_base,Tt=kt.stat_desc.max_length,j,bt,Bt,Ce,Je,lt,Y=0;for(Ce=0;Ce<=G;Ce++)Me.bl_count[Ce]=0;for($t[Me.heap[Me.heap_max]*2+1]=0,j=Me.heap_max+1;j<$;j++)bt=Me.heap[j],Ce=$t[$t[bt*2+1]*2+1]+1,Ce>Tt&&(Ce=Tt,Y++),$t[bt*2+1]=Ce,!(bt>lr)&&(Me.bl_count[Ce]++,Je=0,bt>=Gt&&(Je=Ae[bt-Gt]),lt=$t[bt*2],Me.opt_len+=lt*(Ce+Je),Rt&&(Me.static_len+=lt*(Ye[bt*2+1]+Je)));if(Y!==0){do{for(Ce=Tt-1;Me.bl_count[Ce]===0;)Ce--;Me.bl_count[Ce]--,Me.bl_count[Ce+1]+=2,Me.bl_count[Tt]--,Y-=2}while(Y>0);for(Ce=Tt;Ce!==0;Ce--)for(bt=Me.bl_count[Ce];bt!==0;)Bt=Me.heap[--j],!(Bt>lr)&&($t[Bt*2+1]!==Ce&&(Me.opt_len+=(Ce-$t[Bt*2+1])*$t[Bt*2],$t[Bt*2+1]=Ce),bt--)}}function ln(Me,kt,$t){var lr=new Array(G+1),Ye=0,Rt,Ae;for(Rt=1;Rt<=G;Rt++)lr[Rt]=Ye=Ye+$t[Rt-1]<<1;for(Ae=0;Ae<=kt;Ae++){var Gt=Me[Ae*2+1];Gt!==0&&(Me[Ae*2]=Kt(lr[Gt]++,Gt))}}function Pr(){var Me,kt,$t,lr,Ye,Rt=new Array(G+1);for($t=0,lr=0;lr<w-1;lr++)for(Le[lr]=$t,Me=0;Me<1<<Ue[lr];Me++)_e[$t++]=lr;for(_e[$t-1]=lr,Ye=0,lr=0;lr<16;lr++)for(Ge[lr]=Ye,Me=0;Me<1<<de[lr];Me++)et[Ye++]=lr;for(Ye>>=7;lr<N;lr++)for(Ge[lr]=Ye<<7,Me=0;Me<1<<de[lr]-7;Me++)et[256+Ye++]=lr;for(kt=0;kt<=G;kt++)Rt[kt]=0;for(Me=0;Me<=143;)re[Me*2+1]=8,Me++,Rt[8]++;for(;Me<=255;)re[Me*2+1]=9,Me++,Rt[9]++;for(;Me<=279;)re[Me*2+1]=7,Me++,Rt[7]++;for(;Me<=287;)re[Me*2+1]=8,Me++,Rt[8]++;for(ln(re,F+1,Rt),Me=0;Me<N;Me++)Ee[Me*2+1]=5,Ee[Me*2]=Kt(Me,5);tt=new Ze(re,Ue,S+1,F,G),rt=new Ze(Ee,de,0,N,G),ut=new Ze(new Array(0),me,0,U,J)}function xr(Me){var kt;for(kt=0;kt<F;kt++)Me.dyn_ltree[kt*2]=0;for(kt=0;kt<N;kt++)Me.dyn_dtree[kt*2]=0;for(kt=0;kt<U;kt++)Me.bl_tree[kt*2]=0;Me.dyn_ltree[ue*2]=1,Me.opt_len=Me.static_len=0,Me.last_lit=Me.matches=0}function Vn(Me){Me.bi_valid>8?st(Me,Me.bi_buf):Me.bi_valid>0&&(Me.pending_buf[Me.pending++]=Me.bi_buf),Me.bi_buf=0,Me.bi_valid=0}function _r(Me,kt,$t,lr){Vn(Me),st(Me,$t),st(Me,~$t),r.arraySet(Me.pending_buf,Me.window,kt,$t,Me.pending),Me.pending+=$t}function yr(Me,kt,$t,lr){var Ye=kt*2,Rt=$t*2;return Me[Ye]<Me[Rt]||Me[Ye]===Me[Rt]&&lr[kt]<=lr[$t]}function un(Me,kt,$t){for(var lr=Me.heap[$t],Ye=$t<<1;Ye<=Me.heap_len&&(Ye<Me.heap_len&&yr(kt,Me.heap[Ye+1],Me.heap[Ye],Me.depth)&&Ye++,!yr(kt,lr,Me.heap[Ye],Me.depth));)Me.heap[$t]=Me.heap[Ye],$t=Ye,Ye<<=1;Me.heap[$t]=lr}function Dr(Me,kt,$t){var lr,Ye,Rt=0,Ae,Gt;if(Me.last_lit!==0)do lr=Me.pending_buf[Me.d_buf+Rt*2]<<8|Me.pending_buf[Me.d_buf+Rt*2+1],Ye=Me.pending_buf[Me.l_buf+Rt],Rt++,lr===0?er(Me,Ye,kt):(Ae=_e[Ye],er(Me,Ae+S+1,kt),Gt=Ue[Ae],Gt!==0&&(Ye-=Le[Ae],dr(Me,Ye,Gt)),lr--,Ae=St(lr),er(Me,Ae,$t),Gt=de[Ae],Gt!==0&&(lr-=Ge[Ae],dr(Me,lr,Gt)));while(Rt<Me.last_lit);er(Me,ue,kt)}function ci(Me,kt){var $t=kt.dyn_tree,lr=kt.stat_desc.static_tree,Ye=kt.stat_desc.has_stree,Rt=kt.stat_desc.elems,Ae,Gt,Tt=-1,j;for(Me.heap_len=0,Me.heap_max=$,Ae=0;Ae<Rt;Ae++)$t[Ae*2]!==0?(Me.heap[++Me.heap_len]=Tt=Ae,Me.depth[Ae]=0):$t[Ae*2+1]=0;for(;Me.heap_len<2;)j=Me.heap[++Me.heap_len]=Tt<2?++Tt:0,$t[j*2]=1,Me.depth[j]=0,Me.opt_len--,Ye&&(Me.static_len-=lr[j*2+1]);for(kt.max_code=Tt,Ae=Me.heap_len>>1;Ae>=1;Ae--)un(Me,$t,Ae);j=Rt;do Ae=Me.heap[1],Me.heap[1]=Me.heap[Me.heap_len--],un(Me,$t,1),Gt=Me.heap[1],Me.heap[--Me.heap_max]=Ae,Me.heap[--Me.heap_max]=Gt,$t[j*2]=$t[Ae*2]+$t[Gt*2],Me.depth[j]=(Me.depth[Ae]>=Me.depth[Gt]?Me.depth[Ae]:Me.depth[Gt])+1,$t[Ae*2+1]=$t[Gt*2+1]=j,Me.heap[1]=j++,un(Me,$t,1);while(Me.heap_len>=2);Me.heap[--Me.heap_max]=Me.heap[1],Ar(Me,kt),ln($t,Tt,Me.bl_count)}function Yn(Me,kt,$t){var lr,Ye=-1,Rt,Ae=kt[0*2+1],Gt=0,Tt=7,j=4;for(Ae===0&&(Tt=138,j=3),kt[($t+1)*2+1]=65535,lr=0;lr<=$t;lr++)Rt=Ae,Ae=kt[(lr+1)*2+1],!(++Gt<Tt&&Rt===Ae)&&(Gt<j?Me.bl_tree[Rt*2]+=Gt:Rt!==0?(Rt!==Ye&&Me.bl_tree[Rt*2]++,Me.bl_tree[q*2]++):Gt<=10?Me.bl_tree[se*2]++:Me.bl_tree[Te*2]++,Gt=0,Ye=Rt,Ae===0?(Tt=138,j=3):Rt===Ae?(Tt=6,j=3):(Tt=7,j=4))}function mn(Me,kt,$t){var lr,Ye=-1,Rt,Ae=kt[0*2+1],Gt=0,Tt=7,j=4;for(Ae===0&&(Tt=138,j=3),lr=0;lr<=$t;lr++)if(Rt=Ae,Ae=kt[(lr+1)*2+1],!(++Gt<Tt&&Rt===Ae)){if(Gt<j)do er(Me,Rt,Me.bl_tree);while(--Gt!==0);else Rt!==0?(Rt!==Ye&&(er(Me,Rt,Me.bl_tree),Gt--),er(Me,q,Me.bl_tree),dr(Me,Gt-3,2)):Gt<=10?(er(Me,se,Me.bl_tree),dr(Me,Gt-3,3)):(er(Me,Te,Me.bl_tree),dr(Me,Gt-11,7));Gt=0,Ye=Rt,Ae===0?(Tt=138,j=3):Rt===Ae?(Tt=6,j=3):(Tt=7,j=4)}}function ti(Me){var kt;for(Yn(Me,Me.dyn_ltree,Me.l_desc.max_code),Yn(Me,Me.dyn_dtree,Me.d_desc.max_code),ci(Me,Me.bl_desc),kt=U-1;kt>=3&&Me.bl_tree[pe[kt]*2+1]===0;kt--);return Me.opt_len+=3*(kt+1)+5+5+4,kt}function Hn(Me,kt,$t,lr){var Ye;for(dr(Me,kt-257,5),dr(Me,$t-1,5),dr(Me,lr-4,4),Ye=0;Ye<lr;Ye++)dr(Me,Me.bl_tree[pe[Ye]*2+1],3);mn(Me,Me.dyn_ltree,kt-1),mn(Me,Me.dyn_dtree,$t-1)}function Bn(Me){var kt=4093624447,$t;for($t=0;$t<=31;$t++,kt>>>=1)if(kt&1&&Me.dyn_ltree[$t*2]!==0)return t;if(Me.dyn_ltree[9*2]!==0||Me.dyn_ltree[10*2]!==0||Me.dyn_ltree[13*2]!==0)return n;for($t=32;$t<S;$t++)if(Me.dyn_ltree[$t*2]!==0)return n;return t}var Zn=!1;function Vt(Me){Zn||(Pr(),Zn=!0),Me.l_desc=new vt(Me.dyn_ltree,tt),Me.d_desc=new vt(Me.dyn_dtree,rt),Me.bl_desc=new vt(Me.bl_tree,ut),Me.bi_buf=0,Me.bi_valid=0,xr(Me)}function mr(Me,kt,$t,lr){dr(Me,(o<<1)+(lr?1:0),3),_r(Me,kt,$t)}function Rr(Me){dr(Me,c<<1,3),er(Me,ue,re),Nt(Me)}function nn(Me,kt,$t,lr){var Ye,Rt,Ae=0;Me.level>0?(Me.strm.data_type===i&&(Me.strm.data_type=Bn(Me)),ci(Me,Me.l_desc),ci(Me,Me.d_desc),Ae=ti(Me),Ye=Me.opt_len+3+7>>>3,Rt=Me.static_len+3+7>>>3,Rt<=Ye&&(Ye=Rt)):Ye=Rt=$t+5,$t+4<=Ye&&kt!==-1?mr(Me,kt,$t,lr):Me.strategy===e||Rt===Ye?(dr(Me,(c<<1)+(lr?1:0),3),Dr(Me,re,Ee)):(dr(Me,(f<<1)+(lr?1:0),3),Hn(Me,Me.l_desc.max_code+1,Me.d_desc.max_code+1,Ae+1),Dr(Me,Me.dyn_ltree,Me.dyn_dtree)),xr(Me),lr&&Vn(Me)}function _i(Me,kt,$t){return Me.pending_buf[Me.d_buf+Me.last_lit*2]=kt>>>8&255,Me.pending_buf[Me.d_buf+Me.last_lit*2+1]=kt&255,Me.pending_buf[Me.l_buf+Me.last_lit]=$t&255,Me.last_lit++,kt===0?Me.dyn_ltree[$t*2]++:(Me.matches++,kt--,Me.dyn_ltree[(_e[$t]+S+1)*2]++,Me.dyn_dtree[St(kt)*2]++),Me.last_lit===Me.lit_bufsize-1}return $f._tr_init=Vt,$f._tr_stored_block=mr,$f._tr_flush_block=nn,$f._tr_tally=_i,$f._tr_align=Rr,$f}var k1,mF;function wN(){if(mF)return k1;mF=1;function r(e,t,n,i){for(var s=e&65535|0,o=e>>>16&65535|0,c=0;n!==0;){c=n>2e3?2e3:n,n-=c;do s=s+t[i++]|0,o=o+s|0;while(--c);s%=65521,o%=65521}return s|o<<16|0}return k1=r,k1}var N1,_F;function CN(){if(_F)return N1;_F=1;function r(){for(var n,i=[],s=0;s<256;s++){n=s;for(var o=0;o<8;o++)n=n&1?3988292384^n>>>1:n>>>1;i[s]=n}return i}var e=r();function t(n,i,s,o){var c=e,f=o+s;n^=-1;for(var A=o;A<f;A++)n=n>>>8^c[(n^i[A])&255];return n^-1}return N1=t,N1}var U1,yF;function lT(){return yF||(yF=1,U1={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),U1}var vF;function n1e(){if(vF)return fc;vF=1;var r=pf(),e=r1e(),t=wN(),n=CN(),i=lT(),s=0,o=1,c=3,f=4,A=5,v=0,w=1,S=-2,F=-3,N=-5,U=-1,$=1,G=2,H=3,J=4,ue=0,q=2,se=8,Te=9,Ue=15,de=8,me=29,pe=256,W=pe+1+me,re=30,Ee=19,et=2*W+1,_e=15,Le=3,Ge=258,Ze=Ge+Le+1,tt=32,rt=42,ut=69,vt=73,St=91,st=103,dr=113,er=666,Kt=1,Nt=2,Ar=3,ln=4,Pr=3;function xr(j,bt){return j.msg=i[bt],bt}function Vn(j){return(j<<1)-(j>4?9:0)}function _r(j){for(var bt=j.length;--bt>=0;)j[bt]=0}function yr(j){var bt=j.state,Bt=bt.pending;Bt>j.avail_out&&(Bt=j.avail_out),Bt!==0&&(r.arraySet(j.output,bt.pending_buf,bt.pending_out,Bt,j.next_out),j.next_out+=Bt,bt.pending_out+=Bt,j.total_out+=Bt,j.avail_out-=Bt,bt.pending-=Bt,bt.pending===0&&(bt.pending_out=0))}function un(j,bt){e._tr_flush_block(j,j.block_start>=0?j.block_start:-1,j.strstart-j.block_start,bt),j.block_start=j.strstart,yr(j.strm)}function Dr(j,bt){j.pending_buf[j.pending++]=bt}function ci(j,bt){j.pending_buf[j.pending++]=bt>>>8&255,j.pending_buf[j.pending++]=bt&255}function Yn(j,bt,Bt,Ce){var Je=j.avail_in;return Je>Ce&&(Je=Ce),Je===0?0:(j.avail_in-=Je,r.arraySet(bt,j.input,j.next_in,Je,Bt),j.state.wrap===1?j.adler=t(j.adler,bt,Je,Bt):j.state.wrap===2&&(j.adler=n(j.adler,bt,Je,Bt)),j.next_in+=Je,j.total_in+=Je,Je)}function mn(j,bt){var Bt=j.max_chain_length,Ce=j.strstart,Je,lt,Y=j.prev_length,ne=j.nice_match,le=j.strstart>j.w_size-Ze?j.strstart-(j.w_size-Ze):0,ve=j.window,Oe=j.w_mask,he=j.prev,be=j.strstart+Ge,ae=ve[Ce+Y-1],Be=ve[Ce+Y];j.prev_length>=j.good_match&&(Bt>>=2),ne>j.lookahead&&(ne=j.lookahead);do if(Je=bt,!(ve[Je+Y]!==Be||ve[Je+Y-1]!==ae||ve[Je]!==ve[Ce]||ve[++Je]!==ve[Ce+1])){Ce+=2,Je++;do;while(ve[++Ce]===ve[++Je]&&ve[++Ce]===ve[++Je]&&ve[++Ce]===ve[++Je]&&ve[++Ce]===ve[++Je]&&ve[++Ce]===ve[++Je]&&ve[++Ce]===ve[++Je]&&ve[++Ce]===ve[++Je]&&ve[++Ce]===ve[++Je]&&Ce<be);if(lt=Ge-(be-Ce),Ce=be-Ge,lt>Y){if(j.match_start=bt,Y=lt,lt>=ne)break;ae=ve[Ce+Y-1],Be=ve[Ce+Y]}}while((bt=he[bt&Oe])>le&&--Bt!==0);return Y<=j.lookahead?Y:j.lookahead}function ti(j){var bt=j.w_size,Bt,Ce,Je,lt,Y;do{if(lt=j.window_size-j.lookahead-j.strstart,j.strstart>=bt+(bt-Ze)){r.arraySet(j.window,j.window,bt,bt,0),j.match_start-=bt,j.strstart-=bt,j.block_start-=bt,Ce=j.hash_size,Bt=Ce;do Je=j.head[--Bt],j.head[Bt]=Je>=bt?Je-bt:0;while(--Ce);Ce=bt,Bt=Ce;do Je=j.prev[--Bt],j.prev[Bt]=Je>=bt?Je-bt:0;while(--Ce);lt+=bt}if(j.strm.avail_in===0)break;if(Ce=Yn(j.strm,j.window,j.strstart+j.lookahead,lt),j.lookahead+=Ce,j.lookahead+j.insert>=Le)for(Y=j.strstart-j.insert,j.ins_h=j.window[Y],j.ins_h=(j.ins_h<<j.hash_shift^j.window[Y+1])&j.hash_mask;j.insert&&(j.ins_h=(j.ins_h<<j.hash_shift^j.window[Y+Le-1])&j.hash_mask,j.prev[Y&j.w_mask]=j.head[j.ins_h],j.head[j.ins_h]=Y,Y++,j.insert--,!(j.lookahead+j.insert<Le)););}while(j.lookahead<Ze&&j.strm.avail_in!==0)}function Hn(j,bt){var Bt=65535;for(Bt>j.pending_buf_size-5&&(Bt=j.pending_buf_size-5);;){if(j.lookahead<=1){if(ti(j),j.lookahead===0&&bt===s)return Kt;if(j.lookahead===0)break}j.strstart+=j.lookahead,j.lookahead=0;var Ce=j.block_start+Bt;if((j.strstart===0||j.strstart>=Ce)&&(j.lookahead=j.strstart-Ce,j.strstart=Ce,un(j,!1),j.strm.avail_out===0)||j.strstart-j.block_start>=j.w_size-Ze&&(un(j,!1),j.strm.avail_out===0))return Kt}return j.insert=0,bt===f?(un(j,!0),j.strm.avail_out===0?Ar:ln):(j.strstart>j.block_start&&(un(j,!1),j.strm.avail_out===0),Kt)}function Bn(j,bt){for(var Bt,Ce;;){if(j.lookahead<Ze){if(ti(j),j.lookahead<Ze&&bt===s)return Kt;if(j.lookahead===0)break}if(Bt=0,j.lookahead>=Le&&(j.ins_h=(j.ins_h<<j.hash_shift^j.window[j.strstart+Le-1])&j.hash_mask,Bt=j.prev[j.strstart&j.w_mask]=j.head[j.ins_h],j.head[j.ins_h]=j.strstart),Bt!==0&&j.strstart-Bt<=j.w_size-Ze&&(j.match_length=mn(j,Bt)),j.match_length>=Le)if(Ce=e._tr_tally(j,j.strstart-j.match_start,j.match_length-Le),j.lookahead-=j.match_length,j.match_length<=j.max_lazy_match&&j.lookahead>=Le){j.match_length--;do j.strstart++,j.ins_h=(j.ins_h<<j.hash_shift^j.window[j.strstart+Le-1])&j.hash_mask,Bt=j.prev[j.strstart&j.w_mask]=j.head[j.ins_h],j.head[j.ins_h]=j.strstart;while(--j.match_length!==0);j.strstart++}else j.strstart+=j.match_length,j.match_length=0,j.ins_h=j.window[j.strstart],j.ins_h=(j.ins_h<<j.hash_shift^j.window[j.strstart+1])&j.hash_mask;else Ce=e._tr_tally(j,0,j.window[j.strstart]),j.lookahead--,j.strstart++;if(Ce&&(un(j,!1),j.strm.avail_out===0))return Kt}return j.insert=j.strstart<Le-1?j.strstart:Le-1,bt===f?(un(j,!0),j.strm.avail_out===0?Ar:ln):j.last_lit&&(un(j,!1),j.strm.avail_out===0)?Kt:Nt}function Zn(j,bt){for(var Bt,Ce,Je;;){if(j.lookahead<Ze){if(ti(j),j.lookahead<Ze&&bt===s)return Kt;if(j.lookahead===0)break}if(Bt=0,j.lookahead>=Le&&(j.ins_h=(j.ins_h<<j.hash_shift^j.window[j.strstart+Le-1])&j.hash_mask,Bt=j.prev[j.strstart&j.w_mask]=j.head[j.ins_h],j.head[j.ins_h]=j.strstart),j.prev_length=j.match_length,j.prev_match=j.match_start,j.match_length=Le-1,Bt!==0&&j.prev_length<j.max_lazy_match&&j.strstart-Bt<=j.w_size-Ze&&(j.match_length=mn(j,Bt),j.match_length<=5&&(j.strategy===$||j.match_length===Le&&j.strstart-j.match_start>4096)&&(j.match_length=Le-1)),j.prev_length>=Le&&j.match_length<=j.prev_length){Je=j.strstart+j.lookahead-Le,Ce=e._tr_tally(j,j.strstart-1-j.prev_match,j.prev_length-Le),j.lookahead-=j.prev_length-1,j.prev_length-=2;do++j.strstart<=Je&&(j.ins_h=(j.ins_h<<j.hash_shift^j.window[j.strstart+Le-1])&j.hash_mask,Bt=j.prev[j.strstart&j.w_mask]=j.head[j.ins_h],j.head[j.ins_h]=j.strstart);while(--j.prev_length!==0);if(j.match_available=0,j.match_length=Le-1,j.strstart++,Ce&&(un(j,!1),j.strm.avail_out===0))return Kt}else if(j.match_available){if(Ce=e._tr_tally(j,0,j.window[j.strstart-1]),Ce&&un(j,!1),j.strstart++,j.lookahead--,j.strm.avail_out===0)return Kt}else j.match_available=1,j.strstart++,j.lookahead--}return j.match_available&&(Ce=e._tr_tally(j,0,j.window[j.strstart-1]),j.match_available=0),j.insert=j.strstart<Le-1?j.strstart:Le-1,bt===f?(un(j,!0),j.strm.avail_out===0?Ar:ln):j.last_lit&&(un(j,!1),j.strm.avail_out===0)?Kt:Nt}function Vt(j,bt){for(var Bt,Ce,Je,lt,Y=j.window;;){if(j.lookahead<=Ge){if(ti(j),j.lookahead<=Ge&&bt===s)return Kt;if(j.lookahead===0)break}if(j.match_length=0,j.lookahead>=Le&&j.strstart>0&&(Je=j.strstart-1,Ce=Y[Je],Ce===Y[++Je]&&Ce===Y[++Je]&&Ce===Y[++Je])){lt=j.strstart+Ge;do;while(Ce===Y[++Je]&&Ce===Y[++Je]&&Ce===Y[++Je]&&Ce===Y[++Je]&&Ce===Y[++Je]&&Ce===Y[++Je]&&Ce===Y[++Je]&&Ce===Y[++Je]&&Je<lt);j.match_length=Ge-(lt-Je),j.match_length>j.lookahead&&(j.match_length=j.lookahead)}if(j.match_length>=Le?(Bt=e._tr_tally(j,1,j.match_length-Le),j.lookahead-=j.match_length,j.strstart+=j.match_length,j.match_length=0):(Bt=e._tr_tally(j,0,j.window[j.strstart]),j.lookahead--,j.strstart++),Bt&&(un(j,!1),j.strm.avail_out===0))return Kt}return j.insert=0,bt===f?(un(j,!0),j.strm.avail_out===0?Ar:ln):j.last_lit&&(un(j,!1),j.strm.avail_out===0)?Kt:Nt}function mr(j,bt){for(var Bt;;){if(j.lookahead===0&&(ti(j),j.lookahead===0)){if(bt===s)return Kt;break}if(j.match_length=0,Bt=e._tr_tally(j,0,j.window[j.strstart]),j.lookahead--,j.strstart++,Bt&&(un(j,!1),j.strm.avail_out===0))return Kt}return j.insert=0,bt===f?(un(j,!0),j.strm.avail_out===0?Ar:ln):j.last_lit&&(un(j,!1),j.strm.avail_out===0)?Kt:Nt}function Rr(j,bt,Bt,Ce,Je){this.good_length=j,this.max_lazy=bt,this.nice_length=Bt,this.max_chain=Ce,this.func=Je}var nn;nn=[new Rr(0,0,0,0,Hn),new Rr(4,4,8,4,Bn),new Rr(4,5,16,8,Bn),new Rr(4,6,32,32,Bn),new Rr(4,4,16,16,Zn),new Rr(8,16,32,32,Zn),new Rr(8,16,128,128,Zn),new Rr(8,32,128,256,Zn),new Rr(32,128,258,1024,Zn),new Rr(32,258,258,4096,Zn)];function _i(j){j.window_size=2*j.w_size,_r(j.head),j.max_lazy_match=nn[j.level].max_lazy,j.good_match=nn[j.level].good_length,j.nice_match=nn[j.level].nice_length,j.max_chain_length=nn[j.level].max_chain,j.strstart=0,j.block_start=0,j.lookahead=0,j.insert=0,j.match_length=j.prev_length=Le-1,j.match_available=0,j.ins_h=0}function Me(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=se,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(et*2),this.dyn_dtree=new r.Buf16((2*re+1)*2),this.bl_tree=new r.Buf16((2*Ee+1)*2),_r(this.dyn_ltree),_r(this.dyn_dtree),_r(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(_e+1),this.heap=new r.Buf16(2*W+1),_r(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*W+1),_r(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function kt(j){var bt;return!j||!j.state?xr(j,S):(j.total_in=j.total_out=0,j.data_type=q,bt=j.state,bt.pending=0,bt.pending_out=0,bt.wrap<0&&(bt.wrap=-bt.wrap),bt.status=bt.wrap?rt:dr,j.adler=bt.wrap===2?0:1,bt.last_flush=s,e._tr_init(bt),v)}function $t(j){var bt=kt(j);return bt===v&&_i(j.state),bt}function lr(j,bt){return!j||!j.state||j.state.wrap!==2?S:(j.state.gzhead=bt,v)}function Ye(j,bt,Bt,Ce,Je,lt){if(!j)return S;var Y=1;if(bt===U&&(bt=6),Ce<0?(Y=0,Ce=-Ce):Ce>15&&(Y=2,Ce-=16),Je<1||Je>Te||Bt!==se||Ce<8||Ce>15||bt<0||bt>9||lt<0||lt>J)return xr(j,S);Ce===8&&(Ce=9);var ne=new Me;return j.state=ne,ne.strm=j,ne.wrap=Y,ne.gzhead=null,ne.w_bits=Ce,ne.w_size=1<<ne.w_bits,ne.w_mask=ne.w_size-1,ne.hash_bits=Je+7,ne.hash_size=1<<ne.hash_bits,ne.hash_mask=ne.hash_size-1,ne.hash_shift=~~((ne.hash_bits+Le-1)/Le),ne.window=new r.Buf8(ne.w_size*2),ne.head=new r.Buf16(ne.hash_size),ne.prev=new r.Buf16(ne.w_size),ne.lit_bufsize=1<<Je+6,ne.pending_buf_size=ne.lit_bufsize*4,ne.pending_buf=new r.Buf8(ne.pending_buf_size),ne.d_buf=1*ne.lit_bufsize,ne.l_buf=3*ne.lit_bufsize,ne.level=bt,ne.strategy=lt,ne.method=Bt,$t(j)}function Rt(j,bt){return Ye(j,bt,se,Ue,de,ue)}function Ae(j,bt){var Bt,Ce,Je,lt;if(!j||!j.state||bt>A||bt<0)return j?xr(j,S):S;if(Ce=j.state,!j.output||!j.input&&j.avail_in!==0||Ce.status===er&&bt!==f)return xr(j,j.avail_out===0?N:S);if(Ce.strm=j,Bt=Ce.last_flush,Ce.last_flush=bt,Ce.status===rt)if(Ce.wrap===2)j.adler=0,Dr(Ce,31),Dr(Ce,139),Dr(Ce,8),Ce.gzhead?(Dr(Ce,(Ce.gzhead.text?1:0)+(Ce.gzhead.hcrc?2:0)+(Ce.gzhead.extra?4:0)+(Ce.gzhead.name?8:0)+(Ce.gzhead.comment?16:0)),Dr(Ce,Ce.gzhead.time&255),Dr(Ce,Ce.gzhead.time>>8&255),Dr(Ce,Ce.gzhead.time>>16&255),Dr(Ce,Ce.gzhead.time>>24&255),Dr(Ce,Ce.level===9?2:Ce.strategy>=G||Ce.level<2?4:0),Dr(Ce,Ce.gzhead.os&255),Ce.gzhead.extra&&Ce.gzhead.extra.length&&(Dr(Ce,Ce.gzhead.extra.length&255),Dr(Ce,Ce.gzhead.extra.length>>8&255)),Ce.gzhead.hcrc&&(j.adler=n(j.adler,Ce.pending_buf,Ce.pending,0)),Ce.gzindex=0,Ce.status=ut):(Dr(Ce,0),Dr(Ce,0),Dr(Ce,0),Dr(Ce,0),Dr(Ce,0),Dr(Ce,Ce.level===9?2:Ce.strategy>=G||Ce.level<2?4:0),Dr(Ce,Pr),Ce.status=dr);else{var Y=se+(Ce.w_bits-8<<4)<<8,ne=-1;Ce.strategy>=G||Ce.level<2?ne=0:Ce.level<6?ne=1:Ce.level===6?ne=2:ne=3,Y|=ne<<6,Ce.strstart!==0&&(Y|=tt),Y+=31-Y%31,Ce.status=dr,ci(Ce,Y),Ce.strstart!==0&&(ci(Ce,j.adler>>>16),ci(Ce,j.adler&65535)),j.adler=1}if(Ce.status===ut)if(Ce.gzhead.extra){for(Je=Ce.pending;Ce.gzindex<(Ce.gzhead.extra.length&65535)&&!(Ce.pending===Ce.pending_buf_size&&(Ce.gzhead.hcrc&&Ce.pending>Je&&(j.adler=n(j.adler,Ce.pending_buf,Ce.pending-Je,Je)),yr(j),Je=Ce.pending,Ce.pending===Ce.pending_buf_size));)Dr(Ce,Ce.gzhead.extra[Ce.gzindex]&255),Ce.gzindex++;Ce.gzhead.hcrc&&Ce.pending>Je&&(j.adler=n(j.adler,Ce.pending_buf,Ce.pending-Je,Je)),Ce.gzindex===Ce.gzhead.extra.length&&(Ce.gzindex=0,Ce.status=vt)}else Ce.status=vt;if(Ce.status===vt)if(Ce.gzhead.name){Je=Ce.pending;do{if(Ce.pending===Ce.pending_buf_size&&(Ce.gzhead.hcrc&&Ce.pending>Je&&(j.adler=n(j.adler,Ce.pending_buf,Ce.pending-Je,Je)),yr(j),Je=Ce.pending,Ce.pending===Ce.pending_buf_size)){lt=1;break}Ce.gzindex<Ce.gzhead.name.length?lt=Ce.gzhead.name.charCodeAt(Ce.gzindex++)&255:lt=0,Dr(Ce,lt)}while(lt!==0);Ce.gzhead.hcrc&&Ce.pending>Je&&(j.adler=n(j.adler,Ce.pending_buf,Ce.pending-Je,Je)),lt===0&&(Ce.gzindex=0,Ce.status=St)}else Ce.status=St;if(Ce.status===St)if(Ce.gzhead.comment){Je=Ce.pending;do{if(Ce.pending===Ce.pending_buf_size&&(Ce.gzhead.hcrc&&Ce.pending>Je&&(j.adler=n(j.adler,Ce.pending_buf,Ce.pending-Je,Je)),yr(j),Je=Ce.pending,Ce.pending===Ce.pending_buf_size)){lt=1;break}Ce.gzindex<Ce.gzhead.comment.length?lt=Ce.gzhead.comment.charCodeAt(Ce.gzindex++)&255:lt=0,Dr(Ce,lt)}while(lt!==0);Ce.gzhead.hcrc&&Ce.pending>Je&&(j.adler=n(j.adler,Ce.pending_buf,Ce.pending-Je,Je)),lt===0&&(Ce.status=st)}else Ce.status=st;if(Ce.status===st&&(Ce.gzhead.hcrc?(Ce.pending+2>Ce.pending_buf_size&&yr(j),Ce.pending+2<=Ce.pending_buf_size&&(Dr(Ce,j.adler&255),Dr(Ce,j.adler>>8&255),j.adler=0,Ce.status=dr)):Ce.status=dr),Ce.pending!==0){if(yr(j),j.avail_out===0)return Ce.last_flush=-1,v}else if(j.avail_in===0&&Vn(bt)<=Vn(Bt)&&bt!==f)return xr(j,N);if(Ce.status===er&&j.avail_in!==0)return xr(j,N);if(j.avail_in!==0||Ce.lookahead!==0||bt!==s&&Ce.status!==er){var le=Ce.strategy===G?mr(Ce,bt):Ce.strategy===H?Vt(Ce,bt):nn[Ce.level].func(Ce,bt);if((le===Ar||le===ln)&&(Ce.status=er),le===Kt||le===Ar)return j.avail_out===0&&(Ce.last_flush=-1),v;if(le===Nt&&(bt===o?e._tr_align(Ce):bt!==A&&(e._tr_stored_block(Ce,0,0,!1),bt===c&&(_r(Ce.head),Ce.lookahead===0&&(Ce.strstart=0,Ce.block_start=0,Ce.insert=0))),yr(j),j.avail_out===0))return Ce.last_flush=-1,v}return bt!==f?v:Ce.wrap<=0?w:(Ce.wrap===2?(Dr(Ce,j.adler&255),Dr(Ce,j.adler>>8&255),Dr(Ce,j.adler>>16&255),Dr(Ce,j.adler>>24&255),Dr(Ce,j.total_in&255),Dr(Ce,j.total_in>>8&255),Dr(Ce,j.total_in>>16&255),Dr(Ce,j.total_in>>24&255)):(ci(Ce,j.adler>>>16),ci(Ce,j.adler&65535)),yr(j),Ce.wrap>0&&(Ce.wrap=-Ce.wrap),Ce.pending!==0?v:w)}function Gt(j){var bt;return!j||!j.state?S:(bt=j.state.status,bt!==rt&&bt!==ut&&bt!==vt&&bt!==St&&bt!==st&&bt!==dr&&bt!==er?xr(j,S):(j.state=null,bt===dr?xr(j,F):v))}function Tt(j,bt){var Bt=bt.length,Ce,Je,lt,Y,ne,le,ve,Oe;if(!j||!j.state||(Ce=j.state,Y=Ce.wrap,Y===2||Y===1&&Ce.status!==rt||Ce.lookahead))return S;for(Y===1&&(j.adler=t(j.adler,bt,Bt,0)),Ce.wrap=0,Bt>=Ce.w_size&&(Y===0&&(_r(Ce.head),Ce.strstart=0,Ce.block_start=0,Ce.insert=0),Oe=new r.Buf8(Ce.w_size),r.arraySet(Oe,bt,Bt-Ce.w_size,Ce.w_size,0),bt=Oe,Bt=Ce.w_size),ne=j.avail_in,le=j.next_in,ve=j.input,j.avail_in=Bt,j.next_in=0,j.input=bt,ti(Ce);Ce.lookahead>=Le;){Je=Ce.strstart,lt=Ce.lookahead-(Le-1);do Ce.ins_h=(Ce.ins_h<<Ce.hash_shift^Ce.window[Je+Le-1])&Ce.hash_mask,Ce.prev[Je&Ce.w_mask]=Ce.head[Ce.ins_h],Ce.head[Ce.ins_h]=Je,Je++;while(--lt);Ce.strstart=Je,Ce.lookahead=Le-1,ti(Ce)}return Ce.strstart+=Ce.lookahead,Ce.block_start=Ce.strstart,Ce.insert=Ce.lookahead,Ce.lookahead=0,Ce.match_length=Ce.prev_length=Le-1,Ce.match_available=0,j.next_in=le,j.input=ve,j.avail_in=ne,Ce.wrap=Y,v}return fc.deflateInit=Rt,fc.deflateInit2=Ye,fc.deflateReset=$t,fc.deflateResetKeep=kt,fc.deflateSetHeader=lr,fc.deflate=Ae,fc.deflateEnd=Gt,fc.deflateSetDictionary=Tt,fc.deflateInfo="pako deflate (from Nodeca project)",fc}var Wf={},bF;function TN(){if(bF)return Wf;bF=1;var r=pf(),e=!0,t=!0;try{String.fromCharCode.apply(null,[0])}catch{e=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{t=!1}for(var n=new r.Buf8(256),i=0;i<256;i++)n[i]=i>=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;n[254]=n[254]=1,Wf.string2buf=function(o){var c,f,A,v,w,S=o.length,F=0;for(v=0;v<S;v++)f=o.charCodeAt(v),(f&64512)===55296&&v+1<S&&(A=o.charCodeAt(v+1),(A&64512)===56320&&(f=65536+(f-55296<<10)+(A-56320),v++)),F+=f<128?1:f<2048?2:f<65536?3:4;for(c=new r.Buf8(F),w=0,v=0;w<F;v++)f=o.charCodeAt(v),(f&64512)===55296&&v+1<S&&(A=o.charCodeAt(v+1),(A&64512)===56320&&(f=65536+(f-55296<<10)+(A-56320),v++)),f<128?c[w++]=f:f<2048?(c[w++]=192|f>>>6,c[w++]=128|f&63):f<65536?(c[w++]=224|f>>>12,c[w++]=128|f>>>6&63,c[w++]=128|f&63):(c[w++]=240|f>>>18,c[w++]=128|f>>>12&63,c[w++]=128|f>>>6&63,c[w++]=128|f&63);return c};function s(o,c){if(c<65534&&(o.subarray&&t||!o.subarray&&e))return String.fromCharCode.apply(null,r.shrinkBuf(o,c));for(var f="",A=0;A<c;A++)f+=String.fromCharCode(o[A]);return f}return Wf.buf2binstring=function(o){return s(o,o.length)},Wf.binstring2buf=function(o){for(var c=new r.Buf8(o.length),f=0,A=c.length;f<A;f++)c[f]=o.charCodeAt(f);return c},Wf.buf2string=function(o,c){var f,A,v,w,S=c||o.length,F=new Array(S*2);for(A=0,f=0;f<S;){if(v=o[f++],v<128){F[A++]=v;continue}if(w=n[v],w>4){F[A++]=65533,f+=w-1;continue}for(v&=w===2?31:w===3?15:7;w>1&&f<S;)v=v<<6|o[f++]&63,w--;if(w>1){F[A++]=65533;continue}v<65536?F[A++]=v:(v-=65536,F[A++]=55296|v>>10&1023,F[A++]=56320|v&1023)}return s(F,A)},Wf.utf8border=function(o,c){var f;for(c=c||o.length,c>o.length&&(c=o.length),f=c-1;f>=0&&(o[f]&192)===128;)f--;return f<0||f===0?c:f+n[o[f]]>c?f:c},Wf}var z1,xF;function EN(){if(xF)return z1;xF=1;function r(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return z1=r,z1}var wF;function i1e(){if(wF)return Nd;wF=1;var r=n1e(),e=pf(),t=TN(),n=lT(),i=EN(),s=Object.prototype.toString,o=0,c=4,f=0,A=1,v=2,w=-1,S=0,F=8;function N(H){if(!(this instanceof N))return new N(H);this.options=e.assign({level:w,method:F,chunkSize:16384,windowBits:15,memLevel:8,strategy:S,to:""},H||{});var J=this.options;J.raw&&J.windowBits>0?J.windowBits=-J.windowBits:J.gzip&&J.windowBits>0&&J.windowBits<16&&(J.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new i,this.strm.avail_out=0;var ue=r.deflateInit2(this.strm,J.level,J.method,J.windowBits,J.memLevel,J.strategy);if(ue!==f)throw new Error(n[ue]);if(J.header&&r.deflateSetHeader(this.strm,J.header),J.dictionary){var q;if(typeof J.dictionary=="string"?q=t.string2buf(J.dictionary):s.call(J.dictionary)==="[object ArrayBuffer]"?q=new Uint8Array(J.dictionary):q=J.dictionary,ue=r.deflateSetDictionary(this.strm,q),ue!==f)throw new Error(n[ue]);this._dict_set=!0}}N.prototype.push=function(H,J){var ue=this.strm,q=this.options.chunkSize,se,Te;if(this.ended)return!1;Te=J===~~J?J:J===!0?c:o,typeof H=="string"?ue.input=t.string2buf(H):s.call(H)==="[object ArrayBuffer]"?ue.input=new Uint8Array(H):ue.input=H,ue.next_in=0,ue.avail_in=ue.input.length;do{if(ue.avail_out===0&&(ue.output=new e.Buf8(q),ue.next_out=0,ue.avail_out=q),se=r.deflate(ue,Te),se!==A&&se!==f)return this.onEnd(se),this.ended=!0,!1;(ue.avail_out===0||ue.avail_in===0&&(Te===c||Te===v))&&(this.options.to==="string"?this.onData(t.buf2binstring(e.shrinkBuf(ue.output,ue.next_out))):this.onData(e.shrinkBuf(ue.output,ue.next_out)))}while((ue.avail_in>0||ue.avail_out===0)&&se!==A);return Te===c?(se=r.deflateEnd(this.strm),this.onEnd(se),this.ended=!0,se===f):(Te===v&&(this.onEnd(f),ue.avail_out=0),!0)},N.prototype.onData=function(H){this.chunks.push(H)},N.prototype.onEnd=function(H){H===f&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=e.flattenChunks(this.chunks)),this.chunks=[],this.err=H,this.msg=this.strm.msg};function U(H,J){var ue=new N(J);if(ue.push(H,!0),ue.err)throw ue.msg||n[ue.err];return ue.result}function $(H,J){return J=J||{},J.raw=!0,U(H,J)}function G(H,J){return J=J||{},J.gzip=!0,U(H,J)}return Nd.Deflate=N,Nd.deflate=U,Nd.deflateRaw=$,Nd.gzip=G,Nd}var Ud={},Fa={},G1,CF;function s1e(){if(CF)return G1;CF=1;var r=30,e=12;return G1=function(n,i){var s,o,c,f,A,v,w,S,F,N,U,$,G,H,J,ue,q,se,Te,Ue,de,me,pe,W,re;s=n.state,o=n.next_in,W=n.input,c=o+(n.avail_in-5),f=n.next_out,re=n.output,A=f-(i-n.avail_out),v=f+(n.avail_out-257),w=s.dmax,S=s.wsize,F=s.whave,N=s.wnext,U=s.window,$=s.hold,G=s.bits,H=s.lencode,J=s.distcode,ue=(1<<s.lenbits)-1,q=(1<<s.distbits)-1;e:do{G<15&&($+=W[o++]<<G,G+=8,$+=W[o++]<<G,G+=8),se=H[$&ue];t:for(;;){if(Te=se>>>24,$>>>=Te,G-=Te,Te=se>>>16&255,Te===0)re[f++]=se&65535;else if(Te&16){Ue=se&65535,Te&=15,Te&&(G<Te&&($+=W[o++]<<G,G+=8),Ue+=$&(1<<Te)-1,$>>>=Te,G-=Te),G<15&&($+=W[o++]<<G,G+=8,$+=W[o++]<<G,G+=8),se=J[$&q];r:for(;;){if(Te=se>>>24,$>>>=Te,G-=Te,Te=se>>>16&255,Te&16){if(de=se&65535,Te&=15,G<Te&&($+=W[o++]<<G,G+=8,G<Te&&($+=W[o++]<<G,G+=8)),de+=$&(1<<Te)-1,de>w){n.msg="invalid distance too far back",s.mode=r;break e}if($>>>=Te,G-=Te,Te=f-A,de>Te){if(Te=de-Te,Te>F&&s.sane){n.msg="invalid distance too far back",s.mode=r;break e}if(me=0,pe=U,N===0){if(me+=S-Te,Te<Ue){Ue-=Te;do re[f++]=U[me++];while(--Te);me=f-de,pe=re}}else if(N<Te){if(me+=S+N-Te,Te-=N,Te<Ue){Ue-=Te;do re[f++]=U[me++];while(--Te);if(me=0,N<Ue){Te=N,Ue-=Te;do re[f++]=U[me++];while(--Te);me=f-de,pe=re}}}else if(me+=N-Te,Te<Ue){Ue-=Te;do re[f++]=U[me++];while(--Te);me=f-de,pe=re}for(;Ue>2;)re[f++]=pe[me++],re[f++]=pe[me++],re[f++]=pe[me++],Ue-=3;Ue&&(re[f++]=pe[me++],Ue>1&&(re[f++]=pe[me++]))}else{me=f-de;do re[f++]=re[me++],re[f++]=re[me++],re[f++]=re[me++],Ue-=3;while(Ue>2);Ue&&(re[f++]=re[me++],Ue>1&&(re[f++]=re[me++]))}}else if((Te&64)===0){se=J[(se&65535)+($&(1<<Te)-1)];continue r}else{n.msg="invalid distance code",s.mode=r;break e}break}}else if((Te&64)===0){se=H[(se&65535)+($&(1<<Te)-1)];continue t}else if(Te&32){s.mode=e;break e}else{n.msg="invalid literal/length code",s.mode=r;break e}break}}while(o<c&&f<v);Ue=G>>3,o-=Ue,G-=Ue<<3,$&=(1<<G)-1,n.next_in=o,n.next_out=f,n.avail_in=o<c?5+(c-o):5-(o-c),n.avail_out=f<v?257+(v-f):257-(f-v),s.hold=$,s.bits=G},G1}var V1,TF;function o1e(){if(TF)return V1;TF=1;var r=pf(),e=15,t=852,n=592,i=0,s=1,o=2,c=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],A=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],v=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return V1=function(S,F,N,U,$,G,H,J){var ue=J.bits,q=0,se=0,Te=0,Ue=0,de=0,me=0,pe=0,W=0,re=0,Ee=0,et,_e,Le,Ge,Ze,tt=null,rt=0,ut,vt=new r.Buf16(e+1),St=new r.Buf16(e+1),st=null,dr=0,er,Kt,Nt;for(q=0;q<=e;q++)vt[q]=0;for(se=0;se<U;se++)vt[F[N+se]]++;for(de=ue,Ue=e;Ue>=1&&vt[Ue]===0;Ue--);if(de>Ue&&(de=Ue),Ue===0)return $[G++]=1<<24|64<<16|0,$[G++]=1<<24|64<<16|0,J.bits=1,0;for(Te=1;Te<Ue&&vt[Te]===0;Te++);for(de<Te&&(de=Te),W=1,q=1;q<=e;q++)if(W<<=1,W-=vt[q],W<0)return-1;if(W>0&&(S===i||Ue!==1))return-1;for(St[1]=0,q=1;q<e;q++)St[q+1]=St[q]+vt[q];for(se=0;se<U;se++)F[N+se]!==0&&(H[St[F[N+se]]++]=se);if(S===i?(tt=st=H,ut=19):S===s?(tt=c,rt-=257,st=f,dr-=257,ut=256):(tt=A,st=v,ut=-1),Ee=0,se=0,q=Te,Ze=G,me=de,pe=0,Le=-1,re=1<<de,Ge=re-1,S===s&&re>t||S===o&&re>n)return 1;for(;;){er=q-pe,H[se]<ut?(Kt=0,Nt=H[se]):H[se]>ut?(Kt=st[dr+H[se]],Nt=tt[rt+H[se]]):(Kt=96,Nt=0),et=1<<q-pe,_e=1<<me,Te=_e;do _e-=et,$[Ze+(Ee>>pe)+_e]=er<<24|Kt<<16|Nt|0;while(_e!==0);for(et=1<<q-1;Ee&et;)et>>=1;if(et!==0?(Ee&=et-1,Ee+=et):Ee=0,se++,--vt[q]===0){if(q===Ue)break;q=F[N+H[se]]}if(q>de&&(Ee&Ge)!==Le){for(pe===0&&(pe=de),Ze+=Te,me=q-pe,W=1<<me;me+pe<Ue&&(W-=vt[me+pe],!(W<=0));)me++,W<<=1;if(re+=1<<me,S===s&&re>t||S===o&&re>n)return 1;Le=Ee&Ge,$[Le]=de<<24|me<<16|Ze-G|0}}return Ee!==0&&($[Ze+Ee]=q-pe<<24|64<<16|0),J.bits=de,0},V1}var EF;function a1e(){if(EF)return Fa;EF=1;var r=pf(),e=wN(),t=CN(),n=s1e(),i=o1e(),s=0,o=1,c=2,f=4,A=5,v=6,w=0,S=1,F=2,N=-2,U=-3,$=-4,G=-5,H=8,J=1,ue=2,q=3,se=4,Te=5,Ue=6,de=7,me=8,pe=9,W=10,re=11,Ee=12,et=13,_e=14,Le=15,Ge=16,Ze=17,tt=18,rt=19,ut=20,vt=21,St=22,st=23,dr=24,er=25,Kt=26,Nt=27,Ar=28,ln=29,Pr=30,xr=31,Vn=32,_r=852,yr=592,un=15,Dr=un;function ci(Ye){return(Ye>>>24&255)+(Ye>>>8&65280)+((Ye&65280)<<8)+((Ye&255)<<24)}function Yn(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function mn(Ye){var Rt;return!Ye||!Ye.state?N:(Rt=Ye.state,Ye.total_in=Ye.total_out=Rt.total=0,Ye.msg="",Rt.wrap&&(Ye.adler=Rt.wrap&1),Rt.mode=J,Rt.last=0,Rt.havedict=0,Rt.dmax=32768,Rt.head=null,Rt.hold=0,Rt.bits=0,Rt.lencode=Rt.lendyn=new r.Buf32(_r),Rt.distcode=Rt.distdyn=new r.Buf32(yr),Rt.sane=1,Rt.back=-1,w)}function ti(Ye){var Rt;return!Ye||!Ye.state?N:(Rt=Ye.state,Rt.wsize=0,Rt.whave=0,Rt.wnext=0,mn(Ye))}function Hn(Ye,Rt){var Ae,Gt;return!Ye||!Ye.state||(Gt=Ye.state,Rt<0?(Ae=0,Rt=-Rt):(Ae=(Rt>>4)+1,Rt<48&&(Rt&=15)),Rt&&(Rt<8||Rt>15))?N:(Gt.window!==null&&Gt.wbits!==Rt&&(Gt.window=null),Gt.wrap=Ae,Gt.wbits=Rt,ti(Ye))}function Bn(Ye,Rt){var Ae,Gt;return Ye?(Gt=new Yn,Ye.state=Gt,Gt.window=null,Ae=Hn(Ye,Rt),Ae!==w&&(Ye.state=null),Ae):N}function Zn(Ye){return Bn(Ye,Dr)}var Vt=!0,mr,Rr;function nn(Ye){if(Vt){var Rt;for(mr=new r.Buf32(512),Rr=new r.Buf32(32),Rt=0;Rt<144;)Ye.lens[Rt++]=8;for(;Rt<256;)Ye.lens[Rt++]=9;for(;Rt<280;)Ye.lens[Rt++]=7;for(;Rt<288;)Ye.lens[Rt++]=8;for(i(o,Ye.lens,0,288,mr,0,Ye.work,{bits:9}),Rt=0;Rt<32;)Ye.lens[Rt++]=5;i(c,Ye.lens,0,32,Rr,0,Ye.work,{bits:5}),Vt=!1}Ye.lencode=mr,Ye.lenbits=9,Ye.distcode=Rr,Ye.distbits=5}function _i(Ye,Rt,Ae,Gt){var Tt,j=Ye.state;return j.window===null&&(j.wsize=1<<j.wbits,j.wnext=0,j.whave=0,j.window=new r.Buf8(j.wsize)),Gt>=j.wsize?(r.arraySet(j.window,Rt,Ae-j.wsize,j.wsize,0),j.wnext=0,j.whave=j.wsize):(Tt=j.wsize-j.wnext,Tt>Gt&&(Tt=Gt),r.arraySet(j.window,Rt,Ae-Gt,Tt,j.wnext),Gt-=Tt,Gt?(r.arraySet(j.window,Rt,Ae-Gt,Gt,0),j.wnext=Gt,j.whave=j.wsize):(j.wnext+=Tt,j.wnext===j.wsize&&(j.wnext=0),j.whave<j.wsize&&(j.whave+=Tt))),0}function Me(Ye,Rt){var Ae,Gt,Tt,j,bt,Bt,Ce,Je,lt,Y,ne,le,ve,Oe,he=0,be,ae,Be,g,ce,xt,Ke,Et,Pt=new r.Buf8(4),Ot,ht,Lt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!Ye||!Ye.state||!Ye.output||!Ye.input&&Ye.avail_in!==0)return N;Ae=Ye.state,Ae.mode===Ee&&(Ae.mode=et),bt=Ye.next_out,Tt=Ye.output,Ce=Ye.avail_out,j=Ye.next_in,Gt=Ye.input,Bt=Ye.avail_in,Je=Ae.hold,lt=Ae.bits,Y=Bt,ne=Ce,Et=w;e:for(;;)switch(Ae.mode){case J:if(Ae.wrap===0){Ae.mode=et;break}for(;lt<16;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if(Ae.wrap&2&&Je===35615){Ae.check=0,Pt[0]=Je&255,Pt[1]=Je>>>8&255,Ae.check=t(Ae.check,Pt,2,0),Je=0,lt=0,Ae.mode=ue;break}if(Ae.flags=0,Ae.head&&(Ae.head.done=!1),!(Ae.wrap&1)||(((Je&255)<<8)+(Je>>8))%31){Ye.msg="incorrect header check",Ae.mode=Pr;break}if((Je&15)!==H){Ye.msg="unknown compression method",Ae.mode=Pr;break}if(Je>>>=4,lt-=4,Ke=(Je&15)+8,Ae.wbits===0)Ae.wbits=Ke;else if(Ke>Ae.wbits){Ye.msg="invalid window size",Ae.mode=Pr;break}Ae.dmax=1<<Ke,Ye.adler=Ae.check=1,Ae.mode=Je&512?W:Ee,Je=0,lt=0;break;case ue:for(;lt<16;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if(Ae.flags=Je,(Ae.flags&255)!==H){Ye.msg="unknown compression method",Ae.mode=Pr;break}if(Ae.flags&57344){Ye.msg="unknown header flags set",Ae.mode=Pr;break}Ae.head&&(Ae.head.text=Je>>8&1),Ae.flags&512&&(Pt[0]=Je&255,Pt[1]=Je>>>8&255,Ae.check=t(Ae.check,Pt,2,0)),Je=0,lt=0,Ae.mode=q;case q:for(;lt<32;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Ae.head&&(Ae.head.time=Je),Ae.flags&512&&(Pt[0]=Je&255,Pt[1]=Je>>>8&255,Pt[2]=Je>>>16&255,Pt[3]=Je>>>24&255,Ae.check=t(Ae.check,Pt,4,0)),Je=0,lt=0,Ae.mode=se;case se:for(;lt<16;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Ae.head&&(Ae.head.xflags=Je&255,Ae.head.os=Je>>8),Ae.flags&512&&(Pt[0]=Je&255,Pt[1]=Je>>>8&255,Ae.check=t(Ae.check,Pt,2,0)),Je=0,lt=0,Ae.mode=Te;case Te:if(Ae.flags&1024){for(;lt<16;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Ae.length=Je,Ae.head&&(Ae.head.extra_len=Je),Ae.flags&512&&(Pt[0]=Je&255,Pt[1]=Je>>>8&255,Ae.check=t(Ae.check,Pt,2,0)),Je=0,lt=0}else Ae.head&&(Ae.head.extra=null);Ae.mode=Ue;case Ue:if(Ae.flags&1024&&(le=Ae.length,le>Bt&&(le=Bt),le&&(Ae.head&&(Ke=Ae.head.extra_len-Ae.length,Ae.head.extra||(Ae.head.extra=new Array(Ae.head.extra_len)),r.arraySet(Ae.head.extra,Gt,j,le,Ke)),Ae.flags&512&&(Ae.check=t(Ae.check,Gt,le,j)),Bt-=le,j+=le,Ae.length-=le),Ae.length))break e;Ae.length=0,Ae.mode=de;case de:if(Ae.flags&2048){if(Bt===0)break e;le=0;do Ke=Gt[j+le++],Ae.head&&Ke&&Ae.length<65536&&(Ae.head.name+=String.fromCharCode(Ke));while(Ke&&le<Bt);if(Ae.flags&512&&(Ae.check=t(Ae.check,Gt,le,j)),Bt-=le,j+=le,Ke)break e}else Ae.head&&(Ae.head.name=null);Ae.length=0,Ae.mode=me;case me:if(Ae.flags&4096){if(Bt===0)break e;le=0;do Ke=Gt[j+le++],Ae.head&&Ke&&Ae.length<65536&&(Ae.head.comment+=String.fromCharCode(Ke));while(Ke&&le<Bt);if(Ae.flags&512&&(Ae.check=t(Ae.check,Gt,le,j)),Bt-=le,j+=le,Ke)break e}else Ae.head&&(Ae.head.comment=null);Ae.mode=pe;case pe:if(Ae.flags&512){for(;lt<16;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if(Je!==(Ae.check&65535)){Ye.msg="header crc mismatch",Ae.mode=Pr;break}Je=0,lt=0}Ae.head&&(Ae.head.hcrc=Ae.flags>>9&1,Ae.head.done=!0),Ye.adler=Ae.check=0,Ae.mode=Ee;break;case W:for(;lt<32;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Ye.adler=Ae.check=ci(Je),Je=0,lt=0,Ae.mode=re;case re:if(Ae.havedict===0)return Ye.next_out=bt,Ye.avail_out=Ce,Ye.next_in=j,Ye.avail_in=Bt,Ae.hold=Je,Ae.bits=lt,F;Ye.adler=Ae.check=1,Ae.mode=Ee;case Ee:if(Rt===A||Rt===v)break e;case et:if(Ae.last){Je>>>=lt&7,lt-=lt&7,Ae.mode=Nt;break}for(;lt<3;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}switch(Ae.last=Je&1,Je>>>=1,lt-=1,Je&3){case 0:Ae.mode=_e;break;case 1:if(nn(Ae),Ae.mode=ut,Rt===v){Je>>>=2,lt-=2;break e}break;case 2:Ae.mode=Ze;break;case 3:Ye.msg="invalid block type",Ae.mode=Pr}Je>>>=2,lt-=2;break;case _e:for(Je>>>=lt&7,lt-=lt&7;lt<32;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if((Je&65535)!==(Je>>>16^65535)){Ye.msg="invalid stored block lengths",Ae.mode=Pr;break}if(Ae.length=Je&65535,Je=0,lt=0,Ae.mode=Le,Rt===v)break e;case Le:Ae.mode=Ge;case Ge:if(le=Ae.length,le){if(le>Bt&&(le=Bt),le>Ce&&(le=Ce),le===0)break e;r.arraySet(Tt,Gt,j,le,bt),Bt-=le,j+=le,Ce-=le,bt+=le,Ae.length-=le;break}Ae.mode=Ee;break;case Ze:for(;lt<14;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if(Ae.nlen=(Je&31)+257,Je>>>=5,lt-=5,Ae.ndist=(Je&31)+1,Je>>>=5,lt-=5,Ae.ncode=(Je&15)+4,Je>>>=4,lt-=4,Ae.nlen>286||Ae.ndist>30){Ye.msg="too many length or distance symbols",Ae.mode=Pr;break}Ae.have=0,Ae.mode=tt;case tt:for(;Ae.have<Ae.ncode;){for(;lt<3;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Ae.lens[Lt[Ae.have++]]=Je&7,Je>>>=3,lt-=3}for(;Ae.have<19;)Ae.lens[Lt[Ae.have++]]=0;if(Ae.lencode=Ae.lendyn,Ae.lenbits=7,Ot={bits:Ae.lenbits},Et=i(s,Ae.lens,0,19,Ae.lencode,0,Ae.work,Ot),Ae.lenbits=Ot.bits,Et){Ye.msg="invalid code lengths set",Ae.mode=Pr;break}Ae.have=0,Ae.mode=rt;case rt:for(;Ae.have<Ae.nlen+Ae.ndist;){for(;he=Ae.lencode[Je&(1<<Ae.lenbits)-1],be=he>>>24,ae=he>>>16&255,Be=he&65535,!(be<=lt);){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if(Be<16)Je>>>=be,lt-=be,Ae.lens[Ae.have++]=Be;else{if(Be===16){for(ht=be+2;lt<ht;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if(Je>>>=be,lt-=be,Ae.have===0){Ye.msg="invalid bit length repeat",Ae.mode=Pr;break}Ke=Ae.lens[Ae.have-1],le=3+(Je&3),Je>>>=2,lt-=2}else if(Be===17){for(ht=be+3;lt<ht;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Je>>>=be,lt-=be,Ke=0,le=3+(Je&7),Je>>>=3,lt-=3}else{for(ht=be+7;lt<ht;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Je>>>=be,lt-=be,Ke=0,le=11+(Je&127),Je>>>=7,lt-=7}if(Ae.have+le>Ae.nlen+Ae.ndist){Ye.msg="invalid bit length repeat",Ae.mode=Pr;break}for(;le--;)Ae.lens[Ae.have++]=Ke}}if(Ae.mode===Pr)break;if(Ae.lens[256]===0){Ye.msg="invalid code -- missing end-of-block",Ae.mode=Pr;break}if(Ae.lenbits=9,Ot={bits:Ae.lenbits},Et=i(o,Ae.lens,0,Ae.nlen,Ae.lencode,0,Ae.work,Ot),Ae.lenbits=Ot.bits,Et){Ye.msg="invalid literal/lengths set",Ae.mode=Pr;break}if(Ae.distbits=6,Ae.distcode=Ae.distdyn,Ot={bits:Ae.distbits},Et=i(c,Ae.lens,Ae.nlen,Ae.ndist,Ae.distcode,0,Ae.work,Ot),Ae.distbits=Ot.bits,Et){Ye.msg="invalid distances set",Ae.mode=Pr;break}if(Ae.mode=ut,Rt===v)break e;case ut:Ae.mode=vt;case vt:if(Bt>=6&&Ce>=258){Ye.next_out=bt,Ye.avail_out=Ce,Ye.next_in=j,Ye.avail_in=Bt,Ae.hold=Je,Ae.bits=lt,n(Ye,ne),bt=Ye.next_out,Tt=Ye.output,Ce=Ye.avail_out,j=Ye.next_in,Gt=Ye.input,Bt=Ye.avail_in,Je=Ae.hold,lt=Ae.bits,Ae.mode===Ee&&(Ae.back=-1);break}for(Ae.back=0;he=Ae.lencode[Je&(1<<Ae.lenbits)-1],be=he>>>24,ae=he>>>16&255,Be=he&65535,!(be<=lt);){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if(ae&&(ae&240)===0){for(g=be,ce=ae,xt=Be;he=Ae.lencode[xt+((Je&(1<<g+ce)-1)>>g)],be=he>>>24,ae=he>>>16&255,Be=he&65535,!(g+be<=lt);){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Je>>>=g,lt-=g,Ae.back+=g}if(Je>>>=be,lt-=be,Ae.back+=be,Ae.length=Be,ae===0){Ae.mode=Kt;break}if(ae&32){Ae.back=-1,Ae.mode=Ee;break}if(ae&64){Ye.msg="invalid literal/length code",Ae.mode=Pr;break}Ae.extra=ae&15,Ae.mode=St;case St:if(Ae.extra){for(ht=Ae.extra;lt<ht;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Ae.length+=Je&(1<<Ae.extra)-1,Je>>>=Ae.extra,lt-=Ae.extra,Ae.back+=Ae.extra}Ae.was=Ae.length,Ae.mode=st;case st:for(;he=Ae.distcode[Je&(1<<Ae.distbits)-1],be=he>>>24,ae=he>>>16&255,Be=he&65535,!(be<=lt);){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if((ae&240)===0){for(g=be,ce=ae,xt=Be;he=Ae.distcode[xt+((Je&(1<<g+ce)-1)>>g)],be=he>>>24,ae=he>>>16&255,Be=he&65535,!(g+be<=lt);){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Je>>>=g,lt-=g,Ae.back+=g}if(Je>>>=be,lt-=be,Ae.back+=be,ae&64){Ye.msg="invalid distance code",Ae.mode=Pr;break}Ae.offset=Be,Ae.extra=ae&15,Ae.mode=dr;case dr:if(Ae.extra){for(ht=Ae.extra;lt<ht;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Ae.offset+=Je&(1<<Ae.extra)-1,Je>>>=Ae.extra,lt-=Ae.extra,Ae.back+=Ae.extra}if(Ae.offset>Ae.dmax){Ye.msg="invalid distance too far back",Ae.mode=Pr;break}Ae.mode=er;case er:if(Ce===0)break e;if(le=ne-Ce,Ae.offset>le){if(le=Ae.offset-le,le>Ae.whave&&Ae.sane){Ye.msg="invalid distance too far back",Ae.mode=Pr;break}le>Ae.wnext?(le-=Ae.wnext,ve=Ae.wsize-le):ve=Ae.wnext-le,le>Ae.length&&(le=Ae.length),Oe=Ae.window}else Oe=Tt,ve=bt-Ae.offset,le=Ae.length;le>Ce&&(le=Ce),Ce-=le,Ae.length-=le;do Tt[bt++]=Oe[ve++];while(--le);Ae.length===0&&(Ae.mode=vt);break;case Kt:if(Ce===0)break e;Tt[bt++]=Ae.length,Ce--,Ae.mode=vt;break;case Nt:if(Ae.wrap){for(;lt<32;){if(Bt===0)break e;Bt--,Je|=Gt[j++]<<lt,lt+=8}if(ne-=Ce,Ye.total_out+=ne,Ae.total+=ne,ne&&(Ye.adler=Ae.check=Ae.flags?t(Ae.check,Tt,ne,bt-ne):e(Ae.check,Tt,ne,bt-ne)),ne=Ce,(Ae.flags?Je:ci(Je))!==Ae.check){Ye.msg="incorrect data check",Ae.mode=Pr;break}Je=0,lt=0}Ae.mode=Ar;case Ar:if(Ae.wrap&&Ae.flags){for(;lt<32;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if(Je!==(Ae.total&4294967295)){Ye.msg="incorrect length check",Ae.mode=Pr;break}Je=0,lt=0}Ae.mode=ln;case ln:Et=S;break e;case Pr:Et=U;break e;case xr:return $;case Vn:default:return N}return Ye.next_out=bt,Ye.avail_out=Ce,Ye.next_in=j,Ye.avail_in=Bt,Ae.hold=Je,Ae.bits=lt,(Ae.wsize||ne!==Ye.avail_out&&Ae.mode<Pr&&(Ae.mode<Nt||Rt!==f))&&_i(Ye,Ye.output,Ye.next_out,ne-Ye.avail_out),Y-=Ye.avail_in,ne-=Ye.avail_out,Ye.total_in+=Y,Ye.total_out+=ne,Ae.total+=ne,Ae.wrap&&ne&&(Ye.adler=Ae.check=Ae.flags?t(Ae.check,Tt,ne,Ye.next_out-ne):e(Ae.check,Tt,ne,Ye.next_out-ne)),Ye.data_type=Ae.bits+(Ae.last?64:0)+(Ae.mode===Ee?128:0)+(Ae.mode===ut||Ae.mode===Le?256:0),(Y===0&&ne===0||Rt===f)&&Et===w&&(Et=G),Et}function kt(Ye){if(!Ye||!Ye.state)return N;var Rt=Ye.state;return Rt.window&&(Rt.window=null),Ye.state=null,w}function $t(Ye,Rt){var Ae;return!Ye||!Ye.state||(Ae=Ye.state,(Ae.wrap&2)===0)?N:(Ae.head=Rt,Rt.done=!1,w)}function lr(Ye,Rt){var Ae=Rt.length,Gt,Tt,j;return!Ye||!Ye.state||(Gt=Ye.state,Gt.wrap!==0&&Gt.mode!==re)?N:Gt.mode===re&&(Tt=1,Tt=e(Tt,Rt,Ae,0),Tt!==Gt.check)?U:(j=_i(Ye,Rt,Ae,Ae),j?(Gt.mode=xr,$):(Gt.havedict=1,w))}return Fa.inflateReset=ti,Fa.inflateReset2=Hn,Fa.inflateResetKeep=mn,Fa.inflateInit=Zn,Fa.inflateInit2=Bn,Fa.inflate=Me,Fa.inflateEnd=kt,Fa.inflateGetHeader=$t,Fa.inflateSetDictionary=lr,Fa.inflateInfo="pako inflate (from Nodeca project)",Fa}var H1,BF;function BN(){return BF||(BF=1,H1={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),H1}var j1,SF;function c1e(){if(SF)return j1;SF=1;function r(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}return j1=r,j1}var IF;function l1e(){if(IF)return Ud;IF=1;var r=a1e(),e=pf(),t=TN(),n=BN(),i=lT(),s=EN(),o=c1e(),c=Object.prototype.toString;function f(w){if(!(this instanceof f))return new f(w);this.options=e.assign({chunkSize:16384,windowBits:0,to:""},w||{});var S=this.options;S.raw&&S.windowBits>=0&&S.windowBits<16&&(S.windowBits=-S.windowBits,S.windowBits===0&&(S.windowBits=-15)),S.windowBits>=0&&S.windowBits<16&&!(w&&w.windowBits)&&(S.windowBits+=32),S.windowBits>15&&S.windowBits<48&&(S.windowBits&15)===0&&(S.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var F=r.inflateInit2(this.strm,S.windowBits);if(F!==n.Z_OK)throw new Error(i[F]);if(this.header=new o,r.inflateGetHeader(this.strm,this.header),S.dictionary&&(typeof S.dictionary=="string"?S.dictionary=t.string2buf(S.dictionary):c.call(S.dictionary)==="[object ArrayBuffer]"&&(S.dictionary=new Uint8Array(S.dictionary)),S.raw&&(F=r.inflateSetDictionary(this.strm,S.dictionary),F!==n.Z_OK)))throw new Error(i[F])}f.prototype.push=function(w,S){var F=this.strm,N=this.options.chunkSize,U=this.options.dictionary,$,G,H,J,ue,q=!1;if(this.ended)return!1;G=S===~~S?S:S===!0?n.Z_FINISH:n.Z_NO_FLUSH,typeof w=="string"?F.input=t.binstring2buf(w):c.call(w)==="[object ArrayBuffer]"?F.input=new Uint8Array(w):F.input=w,F.next_in=0,F.avail_in=F.input.length;do{if(F.avail_out===0&&(F.output=new e.Buf8(N),F.next_out=0,F.avail_out=N),$=r.inflate(F,n.Z_NO_FLUSH),$===n.Z_NEED_DICT&&U&&($=r.inflateSetDictionary(this.strm,U)),$===n.Z_BUF_ERROR&&q===!0&&($=n.Z_OK,q=!1),$!==n.Z_STREAM_END&&$!==n.Z_OK)return this.onEnd($),this.ended=!0,!1;F.next_out&&(F.avail_out===0||$===n.Z_STREAM_END||F.avail_in===0&&(G===n.Z_FINISH||G===n.Z_SYNC_FLUSH))&&(this.options.to==="string"?(H=t.utf8border(F.output,F.next_out),J=F.next_out-H,ue=t.buf2string(F.output,H),F.next_out=J,F.avail_out=N-J,J&&e.arraySet(F.output,F.output,H,J,0),this.onData(ue)):this.onData(e.shrinkBuf(F.output,F.next_out))),F.avail_in===0&&F.avail_out===0&&(q=!0)}while((F.avail_in>0||F.avail_out===0)&&$!==n.Z_STREAM_END);return $===n.Z_STREAM_END&&(G=n.Z_FINISH),G===n.Z_FINISH?($=r.inflateEnd(this.strm),this.onEnd($),this.ended=!0,$===n.Z_OK):(G===n.Z_SYNC_FLUSH&&(this.onEnd(n.Z_OK),F.avail_out=0),!0)},f.prototype.onData=function(w){this.chunks.push(w)},f.prototype.onEnd=function(w){w===n.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=e.flattenChunks(this.chunks)),this.chunks=[],this.err=w,this.msg=this.strm.msg};function A(w,S){var F=new f(S);if(F.push(w,!0),F.err)throw F.msg||i[F.err];return F.result}function v(w,S){return S=S||{},S.raw=!0,A(w,S)}return Ud.Inflate=f,Ud.inflate=A,Ud.inflateRaw=v,Ud.ungzip=A,Ud}var $1,MF;function u1e(){if(MF)return $1;MF=1;var r=pf().assign,e=i1e(),t=l1e(),n=BN(),i={};return r(i,e,t,n),$1=i,$1}var f1e=u1e();const zd=_h(f1e),PF=[0],h1e={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:"",loader:xN,onTilesetLoad:{type:"function",value:r=>{}},onTileLoad:{type:"function",value:r=>{}},onTileUnload:{type:"function",value:r=>{}},onTileError:{type:"function",value:(r,e,t)=>{}},_getMeshColor:{type:"function",value:r=>[255,255,255]}};class uT extends Bs{initializeState(){"onTileLoadFail"in this.props&&Yr.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}get isLoaded(){return!!(this.state?.tileset3d?.isLoaded()&&super.isLoaded)}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState({props:e,oldProps:t,changeFlags:n}){if(e.data&&e.data!==t.data&&this._loadTileset(e.data),n.viewportChanged){const{activeViewports:i}=this.state;Object.keys(i).length&&(this._updateTileset(i),this.state.lastUpdatedViewports=i,this.state.activeViewports={})}if(n.propsChanged){const{layerMap:i}=this.state;for(const s in i)i[s].needsUpdate=!0}}activateViewport(e){const{activeViewports:t,lastUpdatedViewports:n}=this.state;this.internalState.viewport=e,t[e.id]=e;const i=n?.[e.id];(!i||!e.equals(i))&&(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}getPickingInfo({info:e,sourceLayer:t}){const n=t&&t.props.tile;return e.picked&&(e.object=n),e.sourceTile=n,e}filterSubLayer({layer:e,viewport:t}){const{tile:n}=e.props,{id:i}=t;return n.selected&&n.viewportIds.includes(i)}_updateAutoHighlight(e){const t=e.sourceTile,n=this.state.layerMap[t?.id];n&&n.layer&&n.layer.updateAutoHighlight(e)}async _loadTileset(e){const{loadOptions:t={}}=this.props,n=this.props.loader||this.props.loaders,i=Array.isArray(n)?n[0]:n,s={loadOptions:{...t}};let o=e;if(i.preload){const A=await i.preload(e,t);A.url&&(o=A.url),A.headers&&(s.loadOptions.fetch={...s.loadOptions.fetch,headers:A.headers}),Object.assign(s,A)}const c=await Wp(o,i,s.loadOptions),f=new t_e(c,{onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError,...s});this.setState({tileset3d:f,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(f)}_onTileLoad(e){const{lastUpdatedViewports:t}=this.state;this.props.onTileLoad(e),this._updateTileset(t),this.setNeedsUpdate()}_onTileUnload(e){delete this.state.layerMap[e.id],this.props.onTileUnload(e)}_updateTileset(e){if(!e)return;const{tileset3d:t}=this.state,{timeline:n}=this.context,i=Object.keys(e).length;!n||!i||!t||t.selectTiles(Object.values(e)).then(s=>{this.state.frameNumber!==s&&this.setState({frameNumber:s})})}_getSubLayer(e,t){if(!e.content)return null;switch(e.type){case Yl.POINTCLOUD:return this._makePointCloudLayer(e,t);case Yl.SCENEGRAPH:return this._make3DModelLayer(e);case Yl.MESH:return this._makeSimpleMeshLayer(e,t);default:throw new Error(`Tile3DLayer: Failed to render layer of type ${e.content.type}`)}}_makePointCloudLayer(e,t){const{attributes:n,pointCount:i,constantRGBA:s,cartographicOrigin:o,modelMatrix:c}=e.content,{positions:f,normals:A,colors:v}=n;if(!f)return null;const w=t&&t.props.data||{header:{vertexCount:i},attributes:{POSITION:f,NORMAL:A,COLOR_0:v}},{pointSize:S,getPointColor:F}=this.props,N=this.getSubLayerClass("pointcloud",$g);return new N({pointSize:S},this.getSubLayerProps({id:"pointcloud"}),{id:`${this.id}-pointcloud-${e.id}`,tile:e,data:w,coordinateSystem:Qr.METER_OFFSETS,coordinateOrigin:o,modelMatrix:c,getColor:s||F,_offset:0})}_make3DModelLayer(e){const{gltf:t,instances:n,cartographicOrigin:i,modelMatrix:s}=e.content,o=this.getSubLayerClass("scenegraph",Qg);return new o({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:`${this.id}-scenegraph-${e.id}`,tile:e,data:n||PF,scenegraph:t,coordinateSystem:Qr.METER_OFFSETS,coordinateOrigin:i,modelMatrix:s,getTransformMatrix:c=>c.modelMatrix,getPosition:[0,0,0],_offset:0})}_makeSimpleMeshLayer(e,t){const n=e.content,{attributes:i,indices:s,modelMatrix:o,cartographicOrigin:c,coordinateSystem:f=Qr.METER_OFFSETS,material:A,featureIds:v}=n,{_getMeshColor:w}=this.props,S=t&&t.props.mesh||new Ys({topology:"triangle-list",attributes:d1e(i),indices:s}),F=this.getSubLayerClass("mesh",XC);return new F(this.getSubLayerProps({id:"mesh"}),{id:`${this.id}-mesh-${e.id}`,tile:e,mesh:S,data:PF,getColor:w(e),pbrMaterial:A,modelMatrix:o,coordinateOrigin:c,coordinateSystem:f,featureIds:v,_offset:0})}renderLayers(){const{tileset3d:e,layerMap:t}=this.state;return e?e.tiles.map(n=>{const i=t[n.id]=t[n.id]||{tile:n};let{layer:s}=i;return n.selected&&(s?i.needsUpdate&&(s=this._getSubLayer(n,s),i.needsUpdate=!1):s=this._getSubLayer(n)),i.layer=s,s}).filter(Boolean):null}}uT.defaultProps=h1e;uT.layerName="Tile3DLayer";function d1e(r){const e={};return e.positions={...r.positions,value:new Float32Array(r.positions.value)},r.normals&&(e.normals=r.normals),r.texCoords&&(e.texCoords=r.texCoords),r.colors&&(e.colors=r.colors),r.uvRegions&&(e.uvRegions=r.uvRegions),e}const p1e="4.2.4",SN={dataType:null,batchType:null,name:"Terrain",id:"terrain",module:"terrain",version:p1e,worker:!0,extensions:["png","pngraw","jpg","jpeg","gif","webp","bmp"],mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp"],options:{terrain:{tesselator:"auto",bounds:void 0,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:void 0}}};({...SN});const RF=[1],A1e={...ou.defaultProps,elevationData:H_,texture:{...H_,optional:!0},meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:"",wireframe:!1,material:!0,loaders:[SN]};function FF(r){return Array.isArray(r)?r.join(";"):r||""}class fT extends Bs{updateState({props:e,oldProps:t}){const n=e.elevationData!==t.elevationData;if(n){const{elevationData:s}=e,o=s&&(Array.isArray(s)||s.includes("{x}")&&s.includes("{y}"));this.setState({isTiled:o})}const i=n||e.meshMaxError!==t.meshMaxError||e.elevationDecoder!==t.elevationDecoder||e.bounds!==t.bounds;if(!this.state.isTiled&&i){const s=this.loadTerrain(e);this.setState({terrain:s})}e.workerUrl&&Yr.removed("workerUrl","loadOptions.terrain.workerUrl")()}loadTerrain({elevationData:e,bounds:t,elevationDecoder:n,meshMaxError:i,signal:s}){if(!e)return null;let o=this.getLoadOptions();o={...o,terrain:{skirtHeight:this.state.isTiled?i*2:0,...o?.terrain,bounds:t,meshMaxError:i,elevationDecoder:n}};const{fetch:c}=this.props;return c(e,{propName:"elevationData",layer:this,loadOptions:o,signal:s})}getTiledTerrainData(e){const{elevationData:t,fetch:n,texture:i,elevationDecoder:s,meshMaxError:o}=this.props,{viewport:c}=this.context,f=ph(t,e),A=i&&ph(i,e),{signal:v}=e;let w=[0,0],S=[0,0];if(c.isGeospatial){const $=e.bbox;w=c.projectFlat([$.west,$.south]),S=c.projectFlat([$.east,$.north])}else{const $=e.bbox;w=[$.left,$.bottom],S=[$.right,$.top]}const F=[w[0],w[1],S[0],S[1]],N=this.loadTerrain({elevationData:f,bounds:F,elevationDecoder:s,meshMaxError:o,signal:v}),U=A?n(A,{propName:"texture",layer:this,loaders:[],signal:v}).catch($=>null):Promise.resolve(null);return Promise.all([N,U])}renderSubLayers(e){const t=this.getSubLayerClass("mesh",Ah),{color:n,wireframe:i,material:s}=this.props,{data:o}=e;if(!o)return null;const[c,f]=o;return new t(e,{data:RF,mesh:c,texture:f,_instanced:!1,coordinateSystem:Qr.CARTESIAN,getPosition:A=>[0,0,0],getColor:n,wireframe:i,material:s})}onViewportLoad(e){if(!e)return;const{zRange:t}=this.state,n=e.map(o=>o.content).filter(Boolean).map(o=>o[0].header.boundingBox.map(f=>f[2]));if(n.length===0)return;const i=Math.min(...n.map(o=>o[0])),s=Math.max(...n.map(o=>o[1]));(!t||i<t[0]||s>t[1])&&this.setState({zRange:[i,s]})}renderLayers(){const{color:e,material:t,elevationData:n,texture:i,wireframe:s,meshMaxError:o,elevationDecoder:c,tileSize:f,maxZoom:A,minZoom:v,extent:w,maxRequests:S,onTileLoad:F,onTileUnload:N,onTileError:U,maxCacheSize:$,maxCacheByteSize:G,refinementStrategy:H}=this.props;if(this.state.isTiled)return new ou(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:FF(n),texture:FF(i),meshMaxError:o,elevationDecoder:c}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:f,maxZoom:A,minZoom:v,extent:w,maxRequests:S,onTileLoad:F,onTileUnload:N,onTileError:U,maxCacheSize:$,maxCacheByteSize:G,refinementStrategy:H});if(!n)return null;const J=this.getSubLayerClass("mesh",Ah);return new J(this.getSubLayerProps({id:"mesh"}),{data:RF,mesh:this.state.terrain,texture:i,_instanced:!1,getPosition:ue=>[0,0,0],getColor:e,material:t,wireframe:s})}}fT.defaultProps=A1e;fT.layerName="TerrainLayer";const g1e={clipBounds:[0,0,1,1],clipByInstance:void 0},IN=`
4566
+ `;function i0e(r){const e=r.positions||r.POSITION,t=e.value.length/e.size;r.COLOR_0||r.colors||(r.colors={size:4,value:new Uint8Array(t*4).fill(255),normalized:!0})}const s0e={pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}};class XC extends Ah{getShaders(){const e=super.getShaders();return e.modules.push(Ew,t0e),{...e,vs:r0e,fs:n0e}}initializeState(){const{featureIds:e}=this.props;super.initializeState();const t=this.getAttributeManager();e&&t.add({featureIdsPickingColors:{type:"uint8",size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}updateState(e){super.updateState(e);const{props:t,oldProps:n}=e;t.pbrMaterial!==n.pbrMaterial&&this.updatePbrMaterialUniforms(t.pbrMaterial)}draw(e){const{featureIds:t}=this.props,{model:n}=this.state;if(!n)return;const i={pickFeatureIds:!!t},s={camera:n.uniforms.cameraPosition};n.shaderInputs.setProps({pbrProjection:s,mesh:i}),super.draw(e)}getModel(e){const{id:t}=this.props,n=this.parseMaterial(this.props.pbrMaterial,e);this.setState({parsedPBRMaterial:n});const i=this.getShaders();return i0e(e.attributes),new Di(this.context.device,{...this.getShaders(),id:t,geometry:e,bufferLayout:this.getAttributeManager().getBufferLayouts(),defines:{...i.defines,...n?.defines,HAS_UV_REGIONS:e.attributes.uvRegions?1:0},parameters:n?.parameters,isInstanced:!0})}updatePbrMaterialUniforms(e){const{model:t}=this.state;if(t){const{mesh:n}=this.props,i=this.parseMaterial(e,n);this.setState({parsedPBRMaterial:i});const{pbr_baseColorSampler:s}=i.bindings,{emptyTexture:o}=this.state,c={sampler:s||o,hasTexture:!!s},{camera:f,...A}={...i.bindings,...i.uniforms};t.shaderInputs.setProps({simpleMesh:c,pbrMaterial:A})}}parseMaterial(e,t){const n=!!(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture);return f8(this.context.device,{unlit:n,...e},{NORMAL:t.attributes.normals,TEXCOORD_0:t.attributes.texCoords},{pbrDebug:!1,lights:!0,useTangents:!1})}calculateFeatureIdsPickingColors(e){const t=this.props.featureIds,n=new Uint8ClampedArray(t.length*e.size),i=[];for(let s=0;s<t.length;s++)this.encodePickingColor(t[s],i),n[s*3]=i[0],n[s*3+1]=i[1],n[s*3+2]=i[2];e.value=n}finalizeState(e){super.finalizeState(e),this.state.parsedPBRMaterial?.generatedTextures.forEach(t=>t.destroy()),this.setState({parsedPBRMaterial:null})}}XC.layerName="MeshLayer";XC.defaultProps=s0e;const o0e=6378137,a0e=6378137,c0e=6356752314245179e-9;function Hy(r){return r}new dt;function l0e(r,e=[],t=Hy){return"longitude"in r?(e[0]=t(r.longitude),e[1]=t(r.latitude),e[2]=r.height):"x"in r?(e[0]=t(r.x),e[1]=t(r.y),e[2]=r.z):(e[0]=t(r[0]),e[1]=t(r[1]),e[2]=r[2]),e}function u0e(r,e=[]){return l0e(r,e,Ts._cartographicRadians?Hy:_H)}function f0e(r,e,t=Hy){return"longitude"in e?(e.longitude=t(r[0]),e.latitude=t(r[1]),e.height=r[2]):"x"in e?(e.x=t(r[0]),e.y=t(r[1]),e.z=r[2]):(e[0]=t(r[0]),e[1]=t(r[1]),e[2]=r[2]),e}function h0e(r,e){return f0e(r,e,Ts._cartographicRadians?Hy:yH)}const ER=1e-14,d0e=new dt,BR={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},b1={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},NA={east:new dt,north:new dt,up:new dt,west:new dt,south:new dt,down:new dt},p0e=new dt,A0e=new dt,g0e=new dt;function SR(r,e,t,n,i,s){const o=BR[e]&&BR[e][t];mc(o&&(!n||n===o));let c,f,A;const v=d0e.copy(i);if(ma(v.x,0,ER)&&ma(v.y,0,ER)){const S=Math.sign(v.z);c=p0e.fromArray(b1[e]),e!=="east"&&e!=="west"&&c.scale(S),f=A0e.fromArray(b1[t]),t!=="east"&&t!=="west"&&f.scale(S),A=g0e.fromArray(b1[n]),n!=="east"&&n!=="west"&&A.scale(S)}else{const{up:S,east:F,north:N}=NA;F.set(-v.y,v.x,0).normalize(),r.geodeticSurfaceNormal(v,S),N.copy(S).cross(F);const{down:U,west:$,south:G}=NA;U.copy(S).scale(-1),$.copy(F).scale(-1),G.copy(N).scale(-1),c=NA[e],f=NA[t],A=NA[n]}return s[0]=c.x,s[1]=c.y,s[2]=c.z,s[3]=0,s[4]=f.x,s[5]=f.y,s[6]=f.z,s[7]=0,s[8]=A.x,s[9]=A.y,s[10]=A.z,s[11]=0,s[12]=v.x,s[13]=v.y,s[14]=v.z,s[15]=1,s}const Ld=new dt,m0e=new dt,_0e=new dt;function y0e(r,e,t=[]){const{oneOverRadii:n,oneOverRadiiSquared:i,centerToleranceSquared:s}=e;Ld.from(r);const o=Ld.x,c=Ld.y,f=Ld.z,A=n.x,v=n.y,w=n.z,S=o*o*A*A,F=c*c*v*v,N=f*f*w*w,U=S+F+N,$=Math.sqrt(1/U);if(!Number.isFinite($))return;const G=m0e;if(G.copy(r).scale($),U<s)return G.to(t);const H=i.x,J=i.y,ue=i.z,q=_0e;q.set(G.x*H*2,G.y*J*2,G.z*ue*2);let se=(1-$)*Ld.len()/(.5*q.len()),Te=0,Ue,de,me,pe;do{se-=Te,Ue=1/(1+se*H),de=1/(1+se*J),me=1/(1+se*ue);const W=Ue*Ue,re=de*de,Ee=me*me,et=W*Ue,_e=re*de,Le=Ee*me;pe=S*W+F*re+N*Ee-1;const Ze=-2*(S*et*H+F*_e*J+N*Le*ue);Te=pe/Ze}while(Math.abs(pe)>Nj);return Ld.scale([Ue,de,me]).to(t)}const y0=new dt,IR=new dt,v0e=new dt,uc=new dt,b0e=new dt,v0=new dt;class wi{constructor(e=0,t=0,n=0){this.centerToleranceSquared=kj,mc(e>=0),mc(t>=0),mc(n>=0),this.radii=new dt(e,t,n),this.radiiSquared=new dt(e*e,t*t,n*n),this.radiiToTheFourth=new dt(e*e*e*e,t*t*t*t,n*n*n*n),this.oneOverRadii=new dt(e===0?0:1/e,t===0?0:1/t,n===0?0:1/n),this.oneOverRadiiSquared=new dt(e===0?0:1/(e*e),t===0?0:1/(t*t),n===0?0:1/(n*n)),this.minimumRadius=Math.min(e,t,n),this.maximumRadius=Math.max(e,t,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||!!(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,t=[0,0,0]){const n=IR,i=v0e,[,,s]=e;this.geodeticSurfaceNormalCartographic(e,n),i.copy(this.radiiSquared).scale(n);const o=Math.sqrt(n.dot(i));return i.scale(1/o),n.scale(s),i.add(n),i.to(t)}cartesianToCartographic(e,t=[0,0,0]){v0.from(e);const n=this.scaleToGeodeticSurface(v0,uc);if(!n)return;const i=this.geodeticSurfaceNormal(n,IR),s=b0e;s.copy(v0).subtract(n);const o=Math.atan2(i.y,i.x),c=Math.asin(i.z),f=Math.sign(vw(s,v0))*y4(s);return h0e([o,c,f],t)}eastNorthUpToFixedFrame(e,t=new vn){return SR(this,"east","north","up",e,t)}localFrameToFixedFrame(e,t,n,i,s=new vn){return SR(this,e,t,n,i,s)}geocentricSurfaceNormal(e,t=[0,0,0]){return y0.from(e).normalize().to(t)}geodeticSurfaceNormalCartographic(e,t=[0,0,0]){const n=u0e(e),i=n[0],s=n[1],o=Math.cos(s);return y0.set(o*Math.cos(i),o*Math.sin(i),Math.sin(s)).normalize(),y0.to(t)}geodeticSurfaceNormal(e,t=[0,0,0]){return y0.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(e,t){return y0e(e,this,t)}scaleToGeocentricSurface(e,t=[0,0,0]){uc.from(e);const n=uc.x,i=uc.y,s=uc.z,o=this.oneOverRadiiSquared,c=1/Math.sqrt(n*n*o.x+i*i*o.y+s*s*o.z);return uc.multiplyScalar(c).to(t)}transformPositionToScaledSpace(e,t=[0,0,0]){return uc.from(e).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(e,t=[0,0,0]){return uc.from(e).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(e,t=0,n=[0,0,0]){mc(ma(this.radii.x,this.radii.y,M4)),mc(this.radii.z>0),uc.from(e);const i=uc.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-t))return uc.set(0,0,i).to(n)}}wi.WGS84=new wi(o0e,a0e,c0e);class x0e{item;previous;next;constructor(e,t,n){this.item=e,this.previous=t,this.next=n}}class w0e{head=null;tail=null;_length=0;get length(){return this._length}add(e){const t=new x0e(e,this.tail,null);return this.tail?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t}remove(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}splice(e,t){e!==t&&(this.remove(t),this._insert(e,t))}_insert(e,t){const n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e,++this._length}}class C0e{_list;_sentinel;_trimTiles;constructor(){this._list=new w0e,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(e){const t=e._cacheNode;t&&this._list.splice(this._sentinel,t)}add(e,t,n){t._cacheNode||(t._cacheNode=this._list.add(t),n&&n(e,t))}unloadTile(e,t,n){const i=t._cacheNode;i&&(this._list.remove(i),t._cacheNode=null,n&&n(e,t))}unloadTiles(e,t){const n=this._trimTiles;this._trimTiles=!1;const i=this._list,s=e.maximumMemoryUsage*1024*1024,o=this._sentinel;let c=i.head;for(;c!==o&&(e.gpuMemoryUsageInBytes>s||n);){const f=c.item;c=c.next,this.unloadTile(e,f,t)}}trim(){this._trimTiles=!0}}function T0e(r,e){Ai(r),Ai(e);const{rtcCenter:t,gltfUpAxis:n}=e,{computedTransform:i,boundingVolume:{center:s}}=r;let o=new vn(i);switch(t&&o.translate(t),n){case"Z":break;case"Y":const w=new vn().rotateX(Math.PI/2);o=o.multiplyRight(w);break;case"X":const S=new vn().rotateY(-Math.PI/2);o=o.multiplyRight(S);break}e.isQuantized&&o.translate(e.quantizedVolumeOffset).scale(e.quantizedVolumeScale);const c=new dt(s);e.cartesianModelMatrix=o,e.cartesianOrigin=c;const f=wi.WGS84.cartesianToCartographic(c,new dt),v=wi.WGS84.eastNorthUpToFixedFrame(c).invert();e.cartographicModelMatrix=v.multiplyRight(o),e.cartographicOrigin=f,e.coordinateSystem||(e.modelMatrix=e.cartographicModelMatrix)}const MR=new dt,x1=new dt,xx=new pa([new gc,new gc,new gc,new gc,new gc,new gc]);function E0e(r,e){const{cameraDirection:t,cameraUp:n,height:i}=r,{metersPerUnit:s}=r.distanceScales,o=r_(r,r.center),c=wi.WGS84.eastNorthUpToFixedFrame(o),f=r.unprojectPosition(r.cameraPosition),A=wi.WGS84.cartographicToCartesian(f,new dt),v=new dt(c.transformAsVector(new dt(t).scale(s))).normalize(),w=new dt(c.transformAsVector(new dt(n).scale(s))).normalize();S0e(r);const S=r.constructor,{longitude:F,latitude:N,width:U,bearing:$,zoom:G}=r,H=new S({longitude:F,latitude:N,height:i,width:U,bearing:$,zoom:G,pitch:0});return{camera:{position:A,direction:v,up:w},viewport:r,topDownViewport:H,height:i,cullingVolume:xx,frameNumber:e,sseDenominator:1.15}}function B0e(r,e,t){if(t===0||r.length<=t)return[r,[]];const n=[],{longitude:i,latitude:s}=e.viewport;for(const[A,v]of r.entries()){const[w,S]=v.header.mbs,F=Math.abs(i-w),N=Math.abs(s-S),U=Math.sqrt(N*N+F*F);n.push([A,U])}const o=n.sort((A,v)=>A[1]-v[1]),c=[];for(let A=0;A<t;A++)c.push(r[o[A][0]]);const f=[];for(let A=t;A<o.length;A++)f.push(r[o[A][0]]);return[c,f]}function S0e(r){const e=r.getFrustumPlanes(),t=PR(e.near,r.cameraPosition),n=r_(r,t),i=r_(r,r.cameraPosition,x1);let s=0;xx.planes[s++].fromPointNormal(n,MR.copy(n).subtract(i));for(const o in e){if(o==="near")continue;const c=e[o],f=PR(c,t,x1),A=r_(r,f,x1);xx.planes[s++].fromPointNormal(A,MR.copy(n).subtract(A))}}function PR(r,e,t=new dt){const n=r.normal.dot(e);return t.copy(r.normal).scale(r.distance-n).add(e),t}function r_(r,e,t=new dt){const n=r.unprojectPosition(e);return wi.WGS84.cartographicToCartesian(n,t)}const I0e=6378137,M0e=6378137,wx=6356752314245179e-9,Ap=new dt;function P0e(r,e){if(r instanceof Zg){const{halfAxes:t}=r,n=F0e(t);return Math.log2(wx/(n+e[2]))}else if(r instanceof Yg){const{radius:t}=r;return Math.log2(wx/(t+e[2]))}else if(r.width&&r.height){const{width:t,height:n}=r,i=Math.log2(I0e/t),s=Math.log2(M0e/n);return(i+s)/2}return 1}function R8(r,e,t){wi.WGS84.cartographicToCartesian([r.xmax,r.ymax,r.zmax],Ap);const n=Math.sqrt(Math.pow(Ap[0]-t[0],2)+Math.pow(Ap[1]-t[1],2)+Math.pow(Ap[2]-t[2],2));return Math.log2(wx/(n+e[2]))}function R0e(r,e,t){const[n,i,s,o]=r;return R8({xmax:s,ymax:o,zmax:0},e,t)}function F0e(r){r.getColumn(0,Ap);const e=r.getColumn(1),t=r.getColumn(2);return Ap.add(e).add(t).len()}const fa={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};var Tc;(function(r){r[r.ADD=1]="ADD",r[r.REPLACE=2]="REPLACE"})(Tc||(Tc={}));var Yl;(function(r){r.EMPTY="empty",r.SCENEGRAPH="scenegraph",r.POINTCLOUD="pointcloud",r.MESH="mesh"})(Yl||(Yl={}));var Go;(function(r){r.I3S="I3S",r.TILES3D="TILES3D"})(Go||(Go={}));var Gp;(function(r){r.GEOMETRIC_ERROR="geometricError",r.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(Gp||(Gp={}));const D0e={USE_OPTIMIZATION:1};function F8(r){return r!=null}const mo=new dt,n_=new dt,O0e=new dt,L0e=new dt,Hf=new dt,RR=new dt,FR=new dt,DR=new dt;function w1(r,e,t){if(Ai(r,"3D Tile: boundingVolume must be defined"),r.box)return D8(r.box,e,t);if(r.region)return U0e(r.region);if(r.sphere)return N0e(r.sphere,e,t);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function k0e(r,e){if(r.box)return z0e(e);if(r.region){const[t,n,i,s,o,c]=r.region;return[[Ac(t),Ac(n),o],[Ac(i),Ac(s),c]]}if(r.sphere)return G0e(e);throw new Error("Unkown boundingVolume type")}function D8(r,e,t){const n=new dt(r[0],r[1],r[2]);e.transform(n,n);let i=[];if(r.length===10){const A=r.slice(3,6),v=new vg;v.fromArray(r,6);const w=new dt([1,0,0]),S=new dt([0,1,0]),F=new dt([0,0,1]);w.transformByQuaternion(v),w.scale(A[0]),S.transformByQuaternion(v),S.scale(A[1]),F.transformByQuaternion(v),F.scale(A[2]),i=[...w.toArray(),...S.toArray(),...F.toArray()]}else i=[...r.slice(3,6),...r.slice(6,9),...r.slice(9,12)];const s=e.transformAsVector(i.slice(0,3)),o=e.transformAsVector(i.slice(3,6)),c=e.transformAsVector(i.slice(6,9)),f=new gi([s[0],s[1],s[2],o[0],o[1],o[2],c[0],c[1],c[2]]);return F8(t)?(t.center=n,t.halfAxes=f,t):new Zg(n,f)}function N0e(r,e,t){const n=new dt(r[0],r[1],r[2]);e.transform(n,n);const i=e.getScale(n_),s=Math.max(Math.max(i[0],i[1]),i[2]),o=r[3]*s;return F8(t)?(t.center=n,t.radius=o,t):new Yg(n,o)}function U0e(r){const[e,t,n,i,s,o]=r,c=wi.WGS84.cartographicToCartesian([Ac(e),Ac(i),s],O0e),f=wi.WGS84.cartographicToCartesian([Ac(n),Ac(t),o],L0e),A=new dt().addVectors(c,f).multiplyByScalar(.5);return wi.WGS84.cartesianToCartographic(A,Hf),wi.WGS84.cartographicToCartesian([Ac(n),Hf[1],Hf[2]],RR),wi.WGS84.cartographicToCartesian([Hf[0],Ac(i),Hf[2]],FR),wi.WGS84.cartographicToCartesian([Hf[0],Hf[1],o],DR),D8([...A,...RR.subtract(A),...FR.subtract(A),...DR.subtract(A)],new vn)}function z0e(r){const e=O8(),{halfAxes:t}=r,n=new dt(t.getColumn(0)),i=new dt(t.getColumn(1)),s=new dt(t.getColumn(2));for(let o=0;o<2;o++){for(let c=0;c<2;c++){for(let f=0;f<2;f++)mo.copy(r.center),mo.add(n),mo.add(i),mo.add(s),L8(e,mo),s.negate();i.negate()}n.negate()}return e}function G0e(r){const e=O8(),{center:t,radius:n}=r,i=wi.WGS84.scaleToGeodeticSurface(t,mo);let s;i?s=wi.WGS84.geodeticSurfaceNormal(i):s=new dt(0,0,1);let o=new dt(s[2],-s[1],0);o.len()>0?o.normalize():o=new dt(0,1,0);const c=o.clone().cross(s);for(const f of[o,c,s]){n_.copy(f).scale(n);for(let A=0;A<2;A++)mo.copy(t),mo.add(n_),L8(e,mo),n_.negate()}return e}function O8(){return[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]]}function L8(r,e){wi.WGS84.cartesianToCartographic(e,mo),r[0][0]=Math.min(r[0][0],mo[0]),r[0][1]=Math.min(r[0][1],mo[1]),r[0][2]=Math.min(r[0][2],mo[2]),r[1][0]=Math.max(r[1][0],mo[0]),r[1][1]=Math.max(r[1][1],mo[1]),r[1][2]=Math.max(r[1][2],mo[2])}new dt;new dt;new vn;new dt;new dt;new dt;function V0e(r,e){const t=r*e;return 1-Math.exp(-(t*t))}function H0e(r,e){if(r.dynamicScreenSpaceError&&r.dynamicScreenSpaceErrorComputedDensity){const t=r.dynamicScreenSpaceErrorComputedDensity,n=r.dynamicScreenSpaceErrorFactor;return V0e(e,t)*n}return 0}function j0e(r,e,t){const n=r.tileset,i=r.parent&&r.parent.lodMetricValue||r.lodMetricValue,s=t?i:r.lodMetricValue;if(s===0)return 0;const o=Math.max(r._distanceToCamera,1e-7),{height:c,sseDenominator:f}=e,{viewDistanceScale:A}=n.options;let v=s*c*(A||1)/(o*f);return v-=H0e(n,o),v}const C1=new dt,OR=new dt,Uu=new dt,LR=new dt,$0e=new dt,T1=new vn,kR=new vn;function W0e(r,e){if(r.lodMetricValue===0||isNaN(r.lodMetricValue))return"DIG";const t=2*k8(r,e);return t<2?"OUT":!r.header.children||t<=r.lodMetricValue?"DRAW":r.header.children?"DIG":"OUT"}function k8(r,e){const{topDownViewport:t}=e,n=r.header.mbs[1],i=r.header.mbs[0],s=r.header.mbs[2],o=r.header.mbs[3],c=[...r.boundingVolume.center],f=t.unprojectPosition(t.cameraPosition);wi.WGS84.cartographicToCartesian(f,C1),OR.copy(C1).subtract(c).normalize(),wi.WGS84.eastNorthUpToFixedFrame(c,T1),kR.copy(T1).invert(),Uu.copy(C1).transform(kR);const A=Math.sqrt(Uu[0]*Uu[0]+Uu[1]*Uu[1]),v=A*A/Uu[2];LR.copy([Uu[0],Uu[1],v]);const S=LR.transform(T1).subtract(c).normalize(),N=OR.cross(S).normalize().scale(o).add(c),U=wi.WGS84.cartesianToCartographic(N),$=t.project([i,n,s]),G=t.project(U);return $0e.copy($).subtract(G).magnitude()}function J0e(r){return{assetGltfUpAxis:r.asset&&r.asset.gltfUpAxis||"Y"}}class NR{_map=new Map;_array;_length;constructor(e=0){this._array=new Array(e),this._length=e}get length(){return this._length}set length(e){this._length=e,e>this._array.length&&(this._array.length=e)}get values(){return this._array}get(e){return Ai(e<this._array.length),this._array[e]}set(e,t){Ai(e>=0),e>=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=t,this._map.set(t,e)}delete(e){const t=this._map.get(e);t>=0&&(this._array.splice(t,1),this._map.delete(e),this.length--)}peek(){return this._array[this._length-1]}push(e){if(!this._map.has(e)){const t=this.length++;this._array[t]=e,this._map.set(e,t)}}pop(){const e=this._array[--this.length];return this._map.delete(e),e}reserve(e){Ai(e>=0),e>this._array.length&&(this._array.length=e)}resize(e){Ai(e>=0),this.length=e}trim(e){e==null&&(e=this.length),this._array.length=e}reset(){this._array=[],this._map=new Map,this._length=0}find(e){return this._map.has(e)}}const X0e={loadSiblings:!1,skipLevelOfDetail:!1,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""};class jy{options;root=null;selectedTiles={};requestedTiles={};emptyTiles={};lastUpdate=new Date().getTime();updateDebounceTime=1e3;_traversalStack=new NR;_emptyTraversalStack=new NR;_frameNumber=null;traversalFinished(e){return!0}constructor(e){this.options={...X0e,...e}}traverse(e,t,n){this.root=e,this.options={...this.options,...n},this.reset(),this.updateTile(e,t),this._frameNumber=t.frameNumber,this.executeTraversal(e,t)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(e,t){const n=this._traversalStack;for(e._selectionDepth=1,n.push(e);n.length>0;){const s=n.pop();let o=!1;this.canTraverse(s,t)&&(this.updateChildTiles(s,t),o=this.updateAndPushChildren(s,t,n,s.hasRenderContent?s._selectionDepth+1:s._selectionDepth));const c=s.parent,f=!!(!c||c._shouldRefine),A=!o;s.hasRenderContent?s.refine===Tc.ADD?(this.loadTile(s,t),this.selectTile(s,t)):s.refine===Tc.REPLACE&&(this.loadTile(s,t),A&&this.selectTile(s,t)):(this.emptyTiles[s.id]=s,this.loadTile(s,t),A&&this.selectTile(s,t)),this.touchTile(s,t),s._shouldRefine=o&&f}const i=new Date().getTime();(this.traversalFinished(t)||i-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=i,this.options.onTraversalEnd(t))}updateChildTiles(e,t){const n=e.children;for(const i of n)this.updateTile(i,t)}updateAndPushChildren(e,t,n,i){const{loadSiblings:s,skipLevelOfDetail:o}=this.options,c=e.children;c.sort(this.compareDistanceToCamera.bind(this));const f=e.refine===Tc.REPLACE&&e.hasRenderContent&&!o;let A=!1,v=!0;for(const w of c)if(w._selectionDepth=i,w.isVisibleAndInRequestVolume?(n.find(w)&&n.delete(w),n.push(w),A=!0):(f||s)&&(this.loadTile(w,t),this.touchTile(w,t)),f){let S;if(w._inRequestVolume?w.hasRenderContent?S=w.contentAvailable:S=this.executeEmptyTraversal(w,t):S=!1,v=v&&S,!v)return!1}return A||(v=!1),v}updateTile(e,t){this.updateTileVisibility(e,t)}selectTile(e,t){this.shouldSelectTile(e)&&(e._selectedFrame=t.frameNumber,this.selectedTiles[e.id]=e)}loadTile(e,t){this.shouldLoadTile(e)&&(e._requestedFrame=t.frameNumber,e._priority=e._getPriority(),this.requestedTiles[e.id]=e)}touchTile(e,t){e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber}canTraverse(e,t,n=!1,i=!1){return e.hasChildren?e.hasTilesetContent?!e.contentExpired:!i&&!e.isVisibleAndInRequestVolume?!1:this.shouldRefine(e,t,n):!1}shouldLoadTile(e){return e.hasUnloadedContent||e.contentExpired}shouldSelectTile(e){return e.contentAvailable&&!this.options.skipLevelOfDetail}shouldRefine(e,t,n=!1){let i=e._screenSpaceError;return n&&(i=e.getScreenSpaceError(t,!0)),i>e.tileset.memoryAdjustedScreenSpaceError}updateTileVisibility(e,t){const n=[];if(this.options.viewportTraversersMap)for(const i in this.options.viewportTraversersMap)this.options.viewportTraversersMap[i]===t.viewport.id&&n.push(i);else n.push(t.viewport.id);e.updateVisibility(t,n)}compareDistanceToCamera(e,t){return e._distanceToCamera-t._distanceToCamera}anyChildrenVisible(e,t){let n=!1;for(const i of e.children)i.updateVisibility(t),n=n||i.isVisibleAndInRequestVolume;return n}executeEmptyTraversal(e,t){let n=!0;const i=this._emptyTraversalStack;for(i.push(e);i.length>0;){const s=i.pop(),o=!s.hasRenderContent&&this.canTraverse(s,t,!1,!1),c=!s.hasRenderContent&&s.children.length===0;if(!o&&!s.contentAvailable&&!c&&(n=!1),this.updateTile(s,t),s.isVisibleAndInRequestVolume||(this.loadTile(s,t),this.touchTile(s,t)),o){const f=s.children;for(const A of f)i.push(A)}}return n}}const UR=new dt;function K0e(r){return r!=null}class Cx{tileset;header;id;url;parent;refine;type;contentUrl;lodMetricType="geometricError";lodMetricValue=0;boundingVolume=null;content=null;contentState=fa.UNLOADED;gpuMemoryUsageInBytes=0;children=[];depth=0;viewportIds=[];transform=new vn;extensions=null;implicitTiling=null;userData={};computedTransform;hasEmptyContent=!1;hasTilesetContent=!1;traverser=new jy({});_cacheNode=null;_frameNumber=null;_expireDate=null;_expiredContent=null;_boundingBox=void 0;_distanceToCamera=0;_screenSpaceError=0;_visibilityPlaneMask;_visible=void 0;_contentBoundingVolume;_viewerRequestVolume;_initialTransform=new vn;_priority=0;_selectedFrame=0;_requestedFrame=0;_selectionDepth=0;_touchedFrame=0;_centerZDepth=0;_shouldRefine=!1;_stackLength=0;_visitedFrame=0;_inRequestVolume=!1;_lodJudge=null;constructor(e,t,n,i=""){this.header=t,this.tileset=e,this.id=i||t.id,this.url=t.url,this.parent=n,this.refine=this._getRefine(t.refine),this.type=t.type,this.contentUrl=t.contentUrl,this._initializeLodMetric(t),this._initializeTransforms(t),this._initializeBoundingVolumes(t),this._initializeContent(t),this._initializeRenderingState(t),Object.seal(this)}destroy(){this.header=null}isDestroyed(){return this.header===null}get selected(){return this._selectedFrame===this.tileset._frameNumber}get isVisible(){return this._visible}get isVisibleAndInRequestVolume(){return this._visible&&this._inRequestVolume}get hasRenderContent(){return!this.hasEmptyContent&&!this.hasTilesetContent}get hasChildren(){return this.children.length>0||this.header.children&&this.header.children.length>0}get contentReady(){return this.contentState===fa.READY||this.hasEmptyContent}get contentAvailable(){return!!(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}get hasUnloadedContent(){return this.hasRenderContent&&this.contentUnloaded}get contentUnloaded(){return this.contentState===fa.UNLOADED}get contentExpired(){return this.contentState===fa.EXPIRED}get contentFailed(){return this.contentState===fa.FAILED}get distanceToCamera(){return this._distanceToCamera}get screenSpaceError(){return this._screenSpaceError}get boundingBox(){return this._boundingBox||(this._boundingBox=k0e(this.header.boundingVolume,this.boundingVolume)),this._boundingBox}getScreenSpaceError(e,t){switch(this.tileset.type){case Go.I3S:return k8(this,e);case Go.TILES3D:return j0e(this,e,t);default:throw new Error("Unsupported tileset type")}}unselect(){this._selectedFrame=0}_getGpuMemoryUsageInBytes(){return this.content.gpuMemoryUsageInBytes||this.content.byteLength||0}_getPriority(){const e=this.tileset._traverser,{skipLevelOfDetail:t}=e.options,n=this.refine===Tc.ADD||t;if(n&&!this.isVisible&&this._visible!==void 0||this.tileset._frameNumber-this._touchedFrame>=1||this.contentState===fa.UNLOADED)return-1;const i=this.parent,o=i&&(!n||this._screenSpaceError===0||i.hasTilesetContent)?i._screenSpaceError:this._screenSpaceError,c=e.root?e.root._screenSpaceError:0;return Math.max(c-o,0)}async loadContent(){if(this.hasEmptyContent)return!1;if(this.content)return!0;this.contentExpired&&(this._expireDate=null),this.contentState=fa.LOADING;const t=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!t)return this.contentState=fa.UNLOADED,!1;try{const n=this.tileset.getTileUrl(this.contentUrl),i=this.tileset.loader,s={...this.tileset.loadOptions,[i.id]:{...this.tileset.loadOptions[i.id],isTileset:this.type==="json",...this._getLoaderSpecificOptions(i.id)}};return this.content=await Wp(n,i,s),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=fa.READY,this._onContentLoaded(),!0}catch(n){throw this.contentState=fa.FAILED,n}finally{t.done()}}unloadContent(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=fa.UNLOADED,!0}updateVisibility(e,t){if(this._frameNumber===e.frameNumber)return;const n=this.parent,i=n?n._visibilityPlaneMask:pa.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){const s=n?n.computedTransform:this.tileset.modelMatrix;this._updateTransform(s)}this._distanceToCamera=this.distanceToTile(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._visibilityPlaneMask=this.visibility(e,i),this._visible=this._visibilityPlaneMask!==pa.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._frameNumber=e.frameNumber,this.viewportIds=t}visibility(e,t){const{cullingVolume:n}=e,{boundingVolume:i}=this;return n.computeVisibilityWithPlaneMask(i,t)}contentVisibility(){return!0}distanceToTile(e){const t=this.boundingVolume;return Math.sqrt(Math.max(t.distanceSquaredTo(e.camera.position),0))}cameraSpaceZDepth({camera:e}){const t=this.boundingVolume;return UR.subVectors(t.center,e.position),e.direction.dot(UR)}insideViewerRequestVolume(e){const t=this._viewerRequestVolume;return!t||t.distanceSquaredTo(e.camera.position)<=0}updateExpiration(){if(K0e(this._expireDate)&&this.contentReady&&!this.hasEmptyContent){const e=Date.now();Date.lessThan(this._expireDate,e)&&(this.contentState=fa.EXPIRED,this._expiredContent=this.content)}}get extras(){return this.header.extras}_initializeLodMetric(e){"lodMetricType"in e?this.lodMetricType=e.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in e?this.lodMetricValue=e.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}_initializeTransforms(e){this.transform=e.transform?new vn(e.transform):new vn;const t=this.parent,n=this.tileset,i=t&&t.computedTransform?t.computedTransform.clone():n.modelMatrix.clone();this.computedTransform=new vn(i).multiplyRight(this.transform);const s=t&&t._initialTransform?t._initialTransform.clone():new vn;this._initialTransform=new vn(s).multiplyRight(this.transform)}_initializeBoundingVolumes(e){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(e)}_initializeContent(e){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=fa.UNLOADED,this.hasTilesetContent=!1,e.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}_initializeRenderingState(e){this.depth=e.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=pa.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}_getRefine(e){return e||this.parent&&this.parent.refine||Tc.REPLACE}_isTileset(){return this.contentUrl.indexOf(".json")!==-1}_onContentLoaded(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0;break}this._isTileset()?this.hasTilesetContent=!0:this.gpuMemoryUsageInBytes=this._getGpuMemoryUsageInBytes()}_updateBoundingVolume(e){this.boundingVolume=w1(e.boundingVolume,this.computedTransform,this.boundingVolume);const t=e.content;t&&(t.boundingVolume&&(this._contentBoundingVolume=w1(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=w1(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(e=new vn){const t=e.clone().multiplyRight(this.transform);t.equals(this.computedTransform)||(this.computedTransform=t,this._updateBoundingVolume(this.header))}_getLoaderSpecificOptions(e){switch(e){case"i3s":return{...this.tileset.options.i3s,_tileOptions:{attributeUrls:this.header.attributeUrls,textureUrl:this.header.textureUrl,textureFormat:this.header.textureFormat,textureLoaderOptions:this.header.textureLoaderOptions,materialDefinition:this.header.materialDefinition,isDracoGeometry:this.header.isDracoGeometry,mbs:this.header.mbs},_tilesetOptions:{store:this.tileset.tileset.store,attributeStorageInfo:this.tileset.tileset.attributeStorageInfo,fields:this.tileset.tileset.fields},isTileHeader:!1};case"3d-tiles":case"cesium-ion":default:return J0e(this.tileset.tileset)}}}class q0e extends jy{compareDistanceToCamera(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}updateTileVisibility(e,t){if(super.updateTileVisibility(e,t),!e.isVisibleAndInRequestVolume)return;const n=e.children.length>0;if(e.hasTilesetContent&&n){const o=e.children[0];this.updateTileVisibility(o,t),e._visible=o._visible;return}if(this.meetsScreenSpaceErrorEarly(e,t)){e._visible=!1;return}const i=e.refine===Tc.REPLACE,s=e._optimChildrenWithinParent===D0e.USE_OPTIMIZATION;if(i&&s&&n&&!this.anyChildrenVisible(e,t)){e._visible=!1;return}}meetsScreenSpaceErrorEarly(e,t){const{parent:n}=e;return!n||n.hasTilesetContent||n.refine!==Tc.ADD?!1:!this.shouldRefine(e,t,!0)}}class Y0e{frameNumberMap=new Map;register(e,t){const n=this.frameNumberMap.get(e)||new Map,i=n.get(t)||0;n.set(t,i+1),this.frameNumberMap.set(e,n)}deregister(e,t){const n=this.frameNumberMap.get(e);if(!n)return;const i=n.get(t)||1;n.set(t,i-1)}isZero(e,t){return(this.frameNumberMap.get(e)?.get(t)||0)===0}}const E1={REQUESTED:"REQUESTED",COMPLETED:"COMPLETED",ERROR:"ERROR"};class Z0e{_statusMap;pendingTilesRegister=new Y0e;constructor(){this._statusMap={}}add(e,t,n,i){if(!this._statusMap[t]){const{frameNumber:s,viewport:{id:o}}=i;this._statusMap[t]={request:e,callback:n,key:t,frameState:i,status:E1.REQUESTED},this.pendingTilesRegister.register(o,s),e().then(c=>{this._statusMap[t].status=E1.COMPLETED;const{frameNumber:f,viewport:{id:A}}=this._statusMap[t].frameState;this.pendingTilesRegister.deregister(A,f),this._statusMap[t].callback(c,i)}).catch(c=>{this._statusMap[t].status=E1.ERROR;const{frameNumber:f,viewport:{id:A}}=this._statusMap[t].frameState;this.pendingTilesRegister.deregister(A,f),n(c)})}}update(e,t){if(this._statusMap[e]){const{frameNumber:n,viewport:{id:i}}=this._statusMap[e].frameState;this.pendingTilesRegister.deregister(i,n);const{frameNumber:s,viewport:{id:o}}=t;this.pendingTilesRegister.register(o,s),this._statusMap[e].frameState=t}}find(e){return this._statusMap[e]}hasPendingTiles(e,t){return!this.pendingTilesRegister.isZero(e,t)}}class Q0e extends jy{_tileManager;constructor(e){super(e),this._tileManager=new Z0e}traversalFinished(e){return!this._tileManager.hasPendingTiles(e.viewport.id,this._frameNumber||0)}shouldRefine(e,t){return e._lodJudge=W0e(e,t),e._lodJudge==="DIG"}updateChildTiles(e,t){const n=e.header.children||[],i=e.children,s=e.tileset;for(const o of n){const c=`${o.id}-${t.viewport.id}`,f=i&&i.find(A=>A.id===c);if(f)f&&this.updateTile(f,t);else{let A=()=>this._loadTile(o.id,s);this._tileManager.find(c)?this._tileManager.update(c,t):(s.tileset.nodePages&&(A=()=>s.tileset.nodePagesTile.formTileFromNodePages(o.id)),this._tileManager.add(A,c,w=>this._onTileLoad(w,e,c),t))}}return!1}async _loadTile(e,t){const{loader:n}=t,i=t.getTileUrl(`${t.url}/nodes/${e}`),s={...t.loadOptions,i3s:{...t.loadOptions.i3s,isTileHeader:!0}};return await Wp(i,n,s)}_onTileLoad(e,t,n){const i=new Cx(t.tileset,e,t,n);t.children.push(i);const s=this._tileManager.find(i.id).frameState;this.updateTile(i,s),this._frameNumber===s.frameNumber&&(this.traversalFinished(s)||new Date().getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(i,s)}}const e_e={description:"",ellipsoid:wi.WGS84,modelMatrix:new vn,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,memoryCacheOverflow:1,maximumTilesSelected:0,debounceTime:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:r=>r,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,memoryAdjustedScreenSpaceError:!1,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},b0="Tiles In Tileset(s)",B1="Tiles In Memory",zR="Tiles In View",GR="Tiles To Render",VR="Tiles Loaded",S1="Tiles Loading",HR="Tiles Unloaded",jR="Failed Tile Loads",$R="Points/Vertices",I1="Tile Memory Use",WR="Maximum Screen Space Error";class t_e{options;loadOptions;type;tileset;loader;url;basePath;modelMatrix;ellipsoid;lodMetricType;lodMetricValue;refine;root=null;roots={};asset={};description="";properties;extras=null;attributions={};credits={};stats;contentFormats={draco:!1,meshopt:!1,dds:!1,ktx2:!1};cartographicCenter=null;cartesianCenter=null;zoom=1;boundingVolume=null;dynamicScreenSpaceErrorComputedDensity=0;maximumMemoryUsage=32;gpuMemoryUsageInBytes=0;memoryAdjustedScreenSpaceError=0;_cacheBytes=0;_cacheOverflowBytes=0;_frameNumber=0;_queryParams={};_extensionsUsed=[];_tiles={};_pendingCount=0;selectedTiles=[];traverseCounter=0;geometricError=0;lastUpdatedVieports=null;_requestedTiles=[];_emptyTiles=[];frameStateData={};_traverser;_cache=new C0e;_requestScheduler;updatePromise=null;tilesetInitializationPromise;constructor(e,t){this.options={...e_e,...t},this.tileset=e,this.loader=e.loader,this.type=e.type,this.url=e.url,this.basePath=e.basePath||L6(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=e.lodMetricType,this.lodMetricValue=e.lodMetricValue,this.refine=e.root.refine,this.loadOptions=this.options.loadOptions||{},this._traverser=this._initializeTraverser(),this._requestScheduler=new O6({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this.memoryAdjustedScreenSpaceError=this.options.maximumScreenSpaceError,this._cacheBytes=this.options.maximumMemoryUsage*1024*1024,this._cacheOverflowBytes=this.options.memoryCacheOverflow*1024*1024,this.stats=new YL({id:this.url}),this._initializeStats(),this.tilesetInitializationPromise=this._initializeTileSet(e)}destroy(){this._destroy()}isLoaded(){return this._pendingCount===0&&this._frameNumber!==0&&this._requestedTiles.length===0}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return new URLSearchParams(this._queryParams).toString()}setProps(e){this.options={...this.options,...e}}getTileUrl(e){if(e.startsWith("data:"))return e;let n=e;return this.queryParams.length&&(n=`${e}${e.includes("?")?"&":"?"}${this.queryParams}`),n}hasExtension(e){return this._extensionsUsed.indexOf(e)>-1}update(e=null){this.tilesetInitializationPromise.then(()=>{!e&&this.lastUpdatedVieports?e=this.lastUpdatedVieports:this.lastUpdatedVieports=e,e&&this.doUpdate(e)})}async selectTiles(e=null){return await this.tilesetInitializationPromise,e&&(this.lastUpdatedVieports=e),this.updatePromise||(this.updatePromise=new Promise(t=>{setTimeout(()=>{this.lastUpdatedVieports&&this.doUpdate(this.lastUpdatedVieports),t(this._frameNumber),this.updatePromise=null},this.options.debounceTime)})),this.updatePromise}adjustScreenSpaceError(){this.gpuMemoryUsageInBytes<this._cacheBytes?this.memoryAdjustedScreenSpaceError=Math.max(this.memoryAdjustedScreenSpaceError/1.02,this.options.maximumScreenSpaceError):this.gpuMemoryUsageInBytes>this._cacheBytes+this._cacheOverflowBytes&&(this.memoryAdjustedScreenSpaceError*=1.02)}doUpdate(e){if("loadTiles"in this.options&&!this.options.loadTiles||this.traverseCounter>0)return;const t=e instanceof Array?e:[e];this._cache.reset(),this._frameNumber++,this.traverseCounter=t.length;const n=[];for(const i of t){const s=i.id;this._needTraverse(s)?n.push(s):this.traverseCounter--}for(const i of t){const s=i.id;if(this.roots[s]||(this.roots[s]=this._initializeTileHeaders(this.tileset,null)),!n.includes(s))continue;const o=E0e(i,this._frameNumber);this._traverser.traverse(this.roots[s],o,this.options)}}_needTraverse(e){let t=e;return this.options.viewportTraversersMap&&(t=this.options.viewportTraversersMap[e]),t===e}_onTraversalEnd(e){const t=e.viewport.id;this.frameStateData[t]||(this.frameStateData[t]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});const n=this.frameStateData[t],i=Object.values(this._traverser.selectedTiles),[s,o]=B0e(i,e,this.options.maximumTilesSelected);n.selectedTiles=s;for(const c of o)c.unselect();n._requestedTiles=Object.values(this._traverser.requestedTiles),n._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,!(this.traverseCounter>0)&&this._updateTiles()}_updateTiles(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(const e in this.frameStateData){const t=this.frameStateData[e];this.selectedTiles=this.selectedTiles.concat(t.selectedTiles),this._requestedTiles=this._requestedTiles.concat(t._requestedTiles),this._emptyTiles=this._emptyTiles.concat(t._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);for(const e of this.selectedTiles)this._tiles[e.id]=e;this._loadTiles(),this._unloadTiles(),this._updateStats()}_tilesChanged(e,t){if(e.length!==t.length)return!0;const n=new Set(e.map(o=>o.id)),i=new Set(t.map(o=>o.id));let s=e.filter(o=>!i.has(o.id)).length>0;return s=s||t.filter(o=>!n.has(o.id)).length>0,s}_loadTiles(){for(const e of this._requestedTiles)e.contentUnloaded&&this._loadTile(e)}_unloadTiles(){this._cache.unloadTiles(this,(e,t)=>e._unloadTile(t))}_updateStats(){let e=0,t=0;for(const n of this.selectedTiles)n.contentAvailable&&n.content&&(e++,n.content.pointCount?t+=n.content.pointCount:t+=n.content.vertexCount);this.stats.get(zR).count=this.selectedTiles.length,this.stats.get(GR).count=e,this.stats.get($R).count=t,this.stats.get(WR).count=this.memoryAdjustedScreenSpaceError}async _initializeTileSet(e){this.type===Go.I3S&&(this.calculateViewPropsI3S(),e.root=await e.root),this.root=this._initializeTileHeaders(e,null),this.type===Go.TILES3D&&(this._initializeTiles3DTileset(e),this.calculateViewPropsTiles3D()),this.type===Go.I3S&&this._initializeI3STileset()}calculateViewPropsI3S(){const e=this.tileset.fullExtent;if(e){const{xmin:n,xmax:i,ymin:s,ymax:o,zmin:c,zmax:f}=e;this.cartographicCenter=new dt(n+(i-n)/2,s+(o-s)/2,c+(f-c)/2),this.cartesianCenter=new dt,wi.WGS84.cartographicToCartesian(this.cartographicCenter,this.cartesianCenter),this.zoom=R8(e,this.cartographicCenter,this.cartesianCenter);return}const t=this.tileset.store?.extent;if(t){const[n,i,s,o]=t;this.cartographicCenter=new dt(n+(s-n)/2,i+(o-i)/2,0),this.cartesianCenter=new dt,wi.WGS84.cartographicToCartesian(this.cartographicCenter,this.cartesianCenter),this.zoom=R0e(t,this.cartographicCenter,this.cartesianCenter);return}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new dt,this.zoom=1}calculateViewPropsTiles3D(){const e=this.root,{center:t}=e.boundingVolume;if(!t){console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new dt,this.zoom=1;return}t[0]!==0||t[1]!==0||t[2]!==0?(this.cartographicCenter=new dt,wi.WGS84.cartesianToCartographic(t,this.cartographicCenter)):this.cartographicCenter=new dt(0,0,-wi.WGS84.radii[0]),this.cartesianCenter=t,this.zoom=P0e(e.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get(b0),this.stats.get(S1),this.stats.get(B1),this.stats.get(zR),this.stats.get(GR),this.stats.get(VR),this.stats.get(HR),this.stats.get(jR),this.stats.get($R),this.stats.get(I1,"memory"),this.stats.get(WR)}_initializeTileHeaders(e,t){const n=new Cx(this,e.root,t);if(t&&(t.children.push(n),n.depth=t.depth+1),this.type===Go.TILES3D){const i=[];for(i.push(n);i.length>0;){const s=i.pop();this.stats.get(b0).incrementCount();const o=s.header.children||[];for(const c of o){const f=new Cx(this,c,s);if(f.contentUrl?.includes("?session=")){const v=new URL(f.contentUrl).searchParams.get("session");v&&(this._queryParams.session=v)}s.children.push(f),f.depth=s.depth+1,i.push(f)}}}return n}_initializeTraverser(){let e;switch(this.type){case Go.TILES3D:e=q0e;break;case Go.I3S:e=Q0e;break;default:e=jy}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}_destroyTileHeaders(e){this._destroySubtree(e)}async _loadTile(e){let t;try{this._onStartTileLoading(),t=await e.loadContent()}catch(n){this._onTileLoadError(e,n instanceof Error?n:new Error("load failed"))}finally{this._onEndTileLoading(),this._onTileLoad(e,t)}}_onTileLoadError(e,t){this.stats.get(jR).incrementCount();const n=t.message||t.toString(),i=e.url;console.error(`A 3D tile failed to load: ${e.url} ${n}`),this.options.onTileError(e,n,i)}_onTileLoad(e,t){if(t){if(this.type===Go.I3S){const n=this.tileset?.nodePagesTile?.nodesInNodePages||0;this.stats.get(b0).reset(),this.stats.get(b0).addCount(n)}e&&e.content&&T0e(e,e.content),this.updateContentTypes(e),this._addTileToCache(e),this.options.onTileLoad(e)}}updateContentTypes(e){if(this.type===Go.I3S)switch(e.header.isDracoGeometry&&(this.contentFormats.draco=!0),e.header.textureFormat){case"dds":this.contentFormats.dds=!0;break;case"ktx2":this.contentFormats.ktx2=!0;break}else if(this.type===Go.TILES3D){const{extensionsRemoved:t=[]}=e.content?.gltf||{};t.includes("KHR_draco_mesh_compression")&&(this.contentFormats.draco=!0),t.includes("EXT_meshopt_compression")&&(this.contentFormats.meshopt=!0),t.includes("KHR_texture_basisu")&&(this.contentFormats.ktx2=!0)}}_onStartTileLoading(){this._pendingCount++,this.stats.get(S1).incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get(S1).decrementCount()}_addTileToCache(e){this._cache.add(this,e,t=>t._updateCacheStats(e))}_updateCacheStats(e){this.stats.get(VR).incrementCount(),this.stats.get(B1).incrementCount(),this.gpuMemoryUsageInBytes+=e.gpuMemoryUsageInBytes||0,this.stats.get(I1).count=this.gpuMemoryUsageInBytes,this.options.memoryAdjustedScreenSpaceError&&this.adjustScreenSpaceError()}_unloadTile(e){this.gpuMemoryUsageInBytes-=e.gpuMemoryUsageInBytes||0,this.stats.get(B1).decrementCount(),this.stats.get(HR).incrementCount(),this.stats.get(I1).count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(e),e.unloadContent()}_destroy(){const e=[];for(this.root&&e.push(this.root);e.length>0;){const t=e.pop();for(const n of t.children)e.push(n);this._destroyTile(t)}this.root=null}_destroySubtree(e){const t=e,n=[];for(n.push(t);n.length>0;){e=n.pop();for(const i of e.children)n.push(i);e!==t&&this._destroyTile(e)}t.children=[]}_destroyTile(e){this._cache.unloadTile(this,e),this._unloadTile(e),e.destroy()}_initializeTiles3DTileset(e){if(e.queryString){const t=new URLSearchParams(e.queryString),n=Object.fromEntries(t.entries());this._queryParams={...this._queryParams,...n}}if(this.asset=e.asset,!this.asset)throw new Error("Tileset must have an asset property.");if(this.asset.version!=="0.0"&&this.asset.version!=="1.0"&&this.asset.version!=="1.1")throw new Error("The tileset must be 3D Tiles version either 0.0 or 1.0 or 1.1.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=e.properties,this.geometricError=e.geometricError,this._extensionsUsed=e.extensionsUsed||[],this.extras=e.extras}_initializeI3STileset(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}const N8="4.2.4",UA={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GLTF:"glTF"};function U8(r,e,t){Ai(r instanceof ArrayBuffer);const n=new TextDecoder("utf8"),i=new Uint8Array(r,e,t);return n.decode(i)}function r_e(r,e=0){const t=new DataView(r);return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}const n_e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},ps={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Un={...n_e,...ps},M1={[ps.DOUBLE]:Float64Array,[ps.FLOAT]:Float32Array,[ps.UNSIGNED_SHORT]:Uint16Array,[ps.UNSIGNED_INT]:Uint32Array,[ps.UNSIGNED_BYTE]:Uint8Array,[ps.BYTE]:Int8Array,[ps.SHORT]:Int16Array,[ps.INT]:Int32Array},i_e={DOUBLE:ps.DOUBLE,FLOAT:ps.FLOAT,UNSIGNED_SHORT:ps.UNSIGNED_SHORT,UNSIGNED_INT:ps.UNSIGNED_INT,UNSIGNED_BYTE:ps.UNSIGNED_BYTE,BYTE:ps.BYTE,SHORT:ps.SHORT,INT:ps.INT},P1="Failed to convert GL type";class ll{static fromTypedArray(e){e=ArrayBuffer.isView(e)?e.constructor:e;for(const t in M1)if(M1[t]===e)return t;throw new Error(P1)}static fromName(e){const t=i_e[e];if(!t)throw new Error(P1);return t}static getArrayType(e){switch(e){case ps.UNSIGNED_SHORT_5_6_5:case ps.UNSIGNED_SHORT_4_4_4_4:case ps.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:const t=M1[e];if(!t)throw new Error(P1);return t}}static getByteSize(e){return ll.getArrayType(e).BYTES_PER_ELEMENT}static validate(e){return!!ll.getArrayType(e)}static createTypedArray(e,t,n=0,i){i===void 0&&(i=(t.byteLength-n)/ll.getByteSize(e));const s=ll.getArrayType(e);return new s(t,n,i)}}function s_e(r,e){if(!r)throw new Error(`math.gl assertion failed. ${e}`)}function o_e(r,e=[0,0,0]){const t=r>>11&31,n=r>>5&63,i=r&31;return e[0]=t<<3,e[1]=n<<2,e[2]=i<<3,e}new yw;new dt;new yw;new yw;function JR(r,e=255){return Kl(r,0,e)/e*2-1}function XR(r){return r<0?-1:1}function a_e(r,e,t,n){if(s_e(n),r<0||r>t||e<0||e>t)throw new Error(`x and y must be unsigned normalized integers between 0 and ${t}`);if(n.x=JR(r,t),n.y=JR(e,t),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){const i=n.x;n.x=(1-Math.abs(n.y))*XR(i),n.y=(1-Math.abs(i))*XR(n.y)}return n.normalize()}function c_e(r,e,t){return a_e(r,e,255,t)}class KC{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(e,t){this.json=e,this.buffer=t}getExtension(e){return this.json.extensions&&this.json.extensions[e]}hasProperty(e){return!!this.json[e]}getGlobalProperty(e,t=Un.UNSIGNED_INT,n=1){const i=this.json[e];return i&&Number.isFinite(i.byteOffset)?this._getTypedArrayFromBinary(e,t,n,1,i.byteOffset):i}getPropertyArray(e,t,n){const i=this.json[e];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(t=ll.fromName(i.componentType)),this._getTypedArrayFromBinary(e,t,n,this.featuresLength,i.byteOffset)):this._getTypedArrayFromArray(e,t,i)}getProperty(e,t,n,i,s){const o=this.json[e];if(!o)return o;const c=this.getPropertyArray(e,t,n);if(n===1)return c[i];for(let f=0;f<n;++f)s[f]=c[n*i+f];return s}_getTypedArrayFromBinary(e,t,n,i,s){const o=this._cachedTypedArrays;let c=o[e];return c||(c=ll.createTypedArray(t,this.buffer.buffer,this.buffer.byteOffset+s,i*n),o[e]=c),c}_getTypedArrayFromArray(e,t,n){const i=this._cachedTypedArrays;let s=i[e];return s||(s=ll.createTypedArray(t,n),i[e]=s),s}}const l_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},u_e={SCALAR:(r,e)=>r[e],VEC2:(r,e)=>[r[2*e+0],r[2*e+1]],VEC3:(r,e)=>[r[3*e+0],r[3*e+1],r[3*e+2]],VEC4:(r,e)=>[r[4*e+0],r[4*e+1],r[4*e+2],r[4*e+3]],MAT2:(r,e)=>[r[4*e+0],r[4*e+1],r[4*e+2],r[4*e+3]],MAT3:(r,e)=>[r[9*e+0],r[9*e+1],r[9*e+2],r[9*e+3],r[9*e+4],r[9*e+5],r[9*e+6],r[9*e+7],r[9*e+8]],MAT4:(r,e)=>[r[16*e+0],r[16*e+1],r[16*e+2],r[16*e+3],r[16*e+4],r[16*e+5],r[16*e+6],r[16*e+7],r[16*e+8],r[16*e+9],r[16*e+10],r[16*e+11],r[16*e+12],r[16*e+13],r[16*e+14],r[16*e+15]]},f_e={SCALAR:(r,e,t)=>{e[t]=r},VEC2:(r,e,t)=>{e[2*t+0]=r[0],e[2*t+1]=r[1]},VEC3:(r,e,t)=>{e[3*t+0]=r[0],e[3*t+1]=r[1],e[3*t+2]=r[2]},VEC4:(r,e,t)=>{e[4*t+0]=r[0],e[4*t+1]=r[1],e[4*t+2]=r[2],e[4*t+3]=r[3]},MAT2:(r,e,t)=>{e[4*t+0]=r[0],e[4*t+1]=r[1],e[4*t+2]=r[2],e[4*t+3]=r[3]},MAT3:(r,e,t)=>{e[9*t+0]=r[0],e[9*t+1]=r[1],e[9*t+2]=r[2],e[9*t+3]=r[3],e[9*t+4]=r[4],e[9*t+5]=r[5],e[9*t+6]=r[6],e[9*t+7]=r[7],e[9*t+8]=r[8],e[9*t+9]=r[9]},MAT4:(r,e,t)=>{e[16*t+0]=r[0],e[16*t+1]=r[1],e[16*t+2]=r[2],e[16*t+3]=r[3],e[16*t+4]=r[4],e[16*t+5]=r[5],e[16*t+6]=r[6],e[16*t+7]=r[7],e[16*t+8]=r[8],e[16*t+9]=r[9],e[16*t+10]=r[10],e[16*t+11]=r[11],e[16*t+12]=r[12],e[16*t+13]=r[13],e[16*t+14]=r[14],e[16*t+15]=r[15]}};function h_e(r,e,t,n){const{componentType:i}=r;Ai(r.componentType);const s=typeof i=="string"?ll.fromName(i):i,o=l_e[r.type],c=u_e[r.type],f=f_e[r.type];return t+=r.byteOffset,{values:ll.createTypedArray(s,e,t,o*n),type:s,size:o,unpacker:c,packer:f}}const al=r=>r!==void 0;function d_e(r,e,t){if(!e)return null;let n=r.getExtension("3DTILES_batch_table_hierarchy");const i=e.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?p_e(n,t):null}function p_e(r,e){let t,n,i;const s=r.instancesLength,o=r.classes;let c=r.classIds,f=r.parentCounts,A=r.parentIds,v=s;al(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,s));let w;if(al(f))for(al(f.byteOffset)&&(f.componentType=defaultValue(f.componentType,GL.UNSIGNED_SHORT),f.type=AttributeType.SCALAR,i=getBinaryAccessor(f),f=i.createArrayBufferView(e.buffer,e.byteOffset+f.byteOffset,s)),w=new Uint16Array(s),v=0,t=0;t<s;++t)w[t]=v,v+=f[t];al(A)&&al(A.byteOffset)&&(A.componentType=defaultValue(A.componentType,GL.UNSIGNED_SHORT),A.type=AttributeType.SCALAR,i=getBinaryAccessor(A),A=i.createArrayBufferView(e.buffer,e.byteOffset+A.byteOffset,v));const S=o.length;for(t=0;t<S;++t){const $=o[t].length,G=o[t].instances,H=getBinaryProperties($,G,e);o[t].instances=combine(H,G)}const F=new Array(S).fill(0),N=new Uint16Array(s);for(t=0;t<s;++t)n=c[t],N[t]=F[n],++F[n];const U={classes:o,classIds:c,classIndexes:N,parentCounts:f,parentIndexes:w,parentIds:A};return m_e(U),U}function zA(r,e,t){if(!r)return;const n=r.parentCounts;return r.parentIds?t(r,e):n>0?A_e(r,e,t):g_e(r,e,t)}function A_e(r,e,t){const n=r.classIds,i=r.parentCounts,s=r.parentIds,o=r.parentIndexes,c=n.length,f=scratchVisited;f.length=Math.max(f.length,c);const A=++marker,v=scratchStack;for(v.length=0,v.push(e);v.length>0;){if(e=v.pop(),f[e]===A)continue;f[e]=A;const w=t(r,e);if(al(w))return w;const S=i[e],F=o[e];for(let N=0;N<S;++N){const U=s[F+N];U!==e&&v.push(U)}}return null}function g_e(r,e,t){let n=!0;for(;n;){const i=t(r,e);if(al(i))return i;const s=r.parentIds[e];n=s!==e,e=s}throw new Error("traverseHierarchySingleParent")}function m_e(r){const t=r.classIds.length;for(let n=0;n<t;++n)z8(r,n,stack)}function z8(r,e,t){const n=r.parentCounts,i=r.parentIds,s=r.parentIndexes,c=r.classIds.length;if(!al(i))return;assert(e<c,`Parent index ${e} exceeds the total number of instances: ${c}`),assert(t.indexOf(e)===-1,"Circular dependency detected in the batch table hierarchy."),t.push(e);const f=al(n)?n[e]:1,A=al(n)?s[e]:e;for(let v=0;v<f;++v){const w=i[A+v];w!==e&&z8(r,w,t)}t.pop(e)}function zo(r){return r!=null}const x0=(r,e)=>r,__e={HIERARCHY:!0,extensions:!0,extras:!0};class G8{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(e,t,n,i={}){Ai(n>=0),this.json=e||{},this.binary=t,this.featureCount=n,this._extensions=this.json?.extensions||{},this._properties={};for(const s in this.json)__e[s]||(this._properties[s]=this.json[s]);this._binaryProperties=this._initializeBinaryProperties(),i["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=d_e(this,this.json,this.binary))}getExtension(e){return this.json&&this.json.extensions&&this.json.extensions[e]}memorySizeInBytes(){return 0}isClass(e,t){if(this._checkBatchId(e),Ai(typeof t=="string",t),this._hierarchy){const n=zA(this._hierarchy,e,(i,s)=>{const o=i.classIds[s];return i.classes[o].name===t});return zo(n)}return!1}isExactClass(e,t){return Ai(typeof t=="string",t),this.getExactClassName(e)===t}getExactClassName(e){if(this._checkBatchId(e),this._hierarchy){const t=this._hierarchy.classIds[e];return this._hierarchy.classes[t].name}}hasProperty(e,t){return this._checkBatchId(e),Ai(typeof t=="string",t),zo(this._properties[t])||this._hasPropertyInHierarchy(e,t)}getPropertyNames(e,t){this._checkBatchId(e),t=zo(t)?t:[],t.length=0;const n=Object.keys(this._properties);return t.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}getProperty(e,t){if(this._checkBatchId(e),Ai(typeof t=="string",t),this._binaryProperties){const i=this._binaryProperties[t];if(zo(i))return this._getBinaryProperty(i,e)}const n=this._properties[t];if(zo(n))return x0(n[e]);if(this._hierarchy){const i=this._getHierarchyProperty(e,t);if(zo(i))return i}}setProperty(e,t,n){const i=this.featureCount;if(this._checkBatchId(e),Ai(typeof t=="string",t),this._binaryProperties){const o=this._binaryProperties[t];if(o){this._setBinaryProperty(o,e,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,e,t,n))return;let s=this._properties[t];zo(s)||(this._properties[t]=new Array(i),s=this._properties[t]),s[e]=x0(n)}_checkBatchId(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(e,t){return e.unpack(e.typedArray,t)}_setBinaryProperty(e,t,n){e.pack(n,e.typedArray,t)}_initializeBinaryProperties(){let e=null;for(const t in this._properties){const n=this._properties[t],i=this._initializeBinaryProperty(t,n);i&&(e=e||{},e[t]=i)}return e}_initializeBinaryProperty(e,t){if("byteOffset"in t){const n=t;Ai(this.binary,`Property ${e} requires a batch table binary.`),Ai(n.type,`Property ${e} requires a type.`);const i=h_e(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:i.values,componentCount:i.size,unpack:i.unpacker,pack:i.packer}}return null}_hasPropertyInHierarchy(e,t){if(!this._hierarchy)return!1;const n=zA(this._hierarchy,e,(i,s)=>{const o=i.classIds[s],c=i.classes[o].instances;return zo(c[t])});return zo(n)}_getPropertyNamesInHierarchy(e,t){zA(this._hierarchy,e,(n,i)=>{const s=n.classIds[i],o=n.classes[s].instances;for(const c in o)o.hasOwnProperty(c)&&t.indexOf(c)===-1&&t.push(c)})}_getHierarchyProperty(e,t){return zA(this._hierarchy,e,(n,i)=>{const s=n.classIds[i],o=n.classes[s],c=n.classIndexes[i],f=o.instances[t];return zo(f)?zo(f.typedArray)?this._getBinaryProperty(f,c):x0(f[c]):null})}_setHierarchyProperty(e,t,n,i){const s=zA(this._hierarchy,t,(o,c)=>{const f=o.classIds[c],A=o.classes[f],v=o.classIndexes[c],w=A.instances[n];return zo(w)?(Ai(c===t,`Inherited property "${n}" is read-only.`),zo(w.typedArray)?this._setBinaryProperty(w,v,i):w[v]=x0(i),!0):!1});return zo(s)}}const R1=4;function $y(r,e,t=0){const n=new DataView(e);if(r.magic=n.getUint32(t,!0),t+=R1,r.version=n.getUint32(t,!0),t+=R1,r.byteLength=n.getUint32(t,!0),t+=R1,r.version!==1)throw new Error(`3D Tile Version ${r.version} not supported`);return t}const kd=4,KR="b3dm tile in legacy format.";function qC(r,e,t){const n=new DataView(e);let i;r.header=r.header||{};let s=n.getUint32(t,!0);t+=kd;let o=n.getUint32(t,!0);t+=kd;let c=n.getUint32(t,!0);t+=kd;let f=n.getUint32(t,!0);return t+=kd,c>=570425344?(t-=kd*2,i=s,c=o,f=0,s=0,o=0,console.warn(KR)):f>=570425344&&(t-=kd,i=c,c=s,f=o,s=0,o=0,console.warn(KR)),r.header.featureTableJsonByteLength=s,r.header.featureTableBinaryByteLength=o,r.header.batchTableJsonByteLength=c,r.header.batchTableBinaryByteLength=f,r.header.batchLength=i,t}function YC(r,e,t,n){return t=y_e(r,e,t),t=v_e(r,e,t),t}function y_e(r,e,t,n){const{featureTableJsonByteLength:i,featureTableBinaryByteLength:s,batchLength:o}=r.header||{};if(r.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){const c=U8(e,t,i);r.featureTableJson=JSON.parse(c)}return t+=i||0,r.featureTableBinary=new Uint8Array(e,t,s),t+=s||0,t}function v_e(r,e,t,n){const{batchTableJsonByteLength:i,batchTableBinaryByteLength:s}=r.header||{};if(i&&i>0){const o=U8(e,t,i);r.batchTableJson=JSON.parse(o),t+=i,s&&s>0&&(r.batchTableBinary=new Uint8Array(e,t,s),r.batchTableBinary=new Uint8Array(r.batchTableBinary),t+=s)}return t}function V8(r,e,t){if(!e&&(!r||!r.batchIds||!t))return null;const{batchIds:n,isRGB565:i,pointCount:s=0}=r;if(n&&t){const o=new Uint8ClampedArray(s*3);for(let c=0;c<s;c++){const f=n[c],v=t.getProperty(f,"dimensions").map(w=>w*255);o[c*3]=v[0],o[c*3+1]=v[1],o[c*3+2]=v[2]}return{type:Un.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}if(e&&i){const o=new Uint8ClampedArray(s*3);for(let c=0;c<s;c++){const f=o_e(e[c]);o[c*3]=f[0],o[c*3+1]=f[1],o[c*3+2]=f[2]}return{type:Un.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}return e&&e.length===s*3?{type:Un.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:Un.UNSIGNED_BYTE,value:e||new Uint8ClampedArray,size:4,normalized:!0}}const qR=new dt;function b_e(r,e){if(!e)return null;if(r.isOctEncoded16P){const t=new Float32Array((r.pointsLength||0)*3);for(let n=0;n<(r.pointsLength||0);n++)c_e(e[n*2],e[n*2+1],qR),qR.toArray(t,n*3);return{type:Un.FLOAT,size:2,value:t}}return{type:Un.FLOAT,size:2,value:e}}function x_e(r,e,t){return r.isQuantized?t["3d-tiles"]&&t["3d-tiles"].decodeQuantizedPositions?(r.isQuantized=!1,w_e(r,e)):{type:Un.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}function w_e(r,e){const t=new dt,n=new Float32Array(r.pointCount*3);for(let i=0;i<r.pointCount;i++)t.set(e[i*3],e[i*3+1],e[i*3+2]).scale(1/r.quantizedRange).multiply(r.quantizedVolumeScale).add(r.quantizedVolumeOffset).toArray(n,i*3);return n}async function C_e(r,e,t,n,i){t=$y(r,e,t),t=qC(r,e,t),t=YC(r,e,t),T_e(r);const{featureTable:s,batchTable:o}=E_e(r);return await P_e(r,s,o,n,i),B_e(r,s,n),S_e(r,s,o),I_e(r,s),t}function T_e(r){r.attributes={positions:null,colors:null,normals:null,batchIds:null},r.isQuantized=!1,r.isTranslucent=!1,r.isRGB565=!1,r.isOctEncoded16P=!1}function E_e(r){const e=new KC(r.featureTableJson,r.featureTableBinary),t=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(t))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=t,r.featuresLength=t,r.pointsLength=t,r.pointCount=t,r.rtcCenter=e.getGlobalProperty("RTC_CENTER",Un.FLOAT,3);const n=M_e(r,e);return{featureTable:e,batchTable:n}}function B_e(r,e,t){if(r.attributes=r.attributes||{positions:null,colors:null,normals:null,batchIds:null},!r.attributes.positions){if(e.hasProperty("POSITION"))r.attributes.positions=e.getPropertyArray("POSITION",Un.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){const n=e.getPropertyArray("POSITION_QUANTIZED",Un.UNSIGNED_SHORT,3);if(r.isQuantized=!0,r.quantizedRange=65535,r.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Un.FLOAT,3),!r.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(r.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Un.FLOAT,3),!r.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");r.attributes.positions=x_e(r,n,t)}}if(!r.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function S_e(r,e,t){if(r.attributes=r.attributes||{positions:null,colors:null,normals:null,batchIds:null},!r.attributes.colors){let n=null;e.hasProperty("RGBA")?(n=e.getPropertyArray("RGBA",Un.UNSIGNED_BYTE,4),r.isTranslucent=!0):e.hasProperty("RGB")?n=e.getPropertyArray("RGB",Un.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(n=e.getPropertyArray("RGB565",Un.UNSIGNED_SHORT,1),r.isRGB565=!0),r.attributes.colors=V8(r,n,t)}e.hasProperty("CONSTANT_RGBA")&&(r.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",Un.UNSIGNED_BYTE,4))}function I_e(r,e){if(r.attributes=r.attributes||{positions:null,colors:null,normals:null,batchIds:null},!r.attributes.normals){let t=null;e.hasProperty("NORMAL")?t=e.getPropertyArray("NORMAL",Un.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(t=e.getPropertyArray("NORMAL_OCT16P",Un.UNSIGNED_BYTE,2),r.isOctEncoded16P=!0),r.attributes.normals=b_e(r,t)}}function M_e(r,e){let t=null;if(!r.batchIds&&e.hasProperty("BATCH_ID")&&(r.batchIds=e.getPropertyArray("BATCH_ID",Un.UNSIGNED_SHORT,1),r.batchIds)){const n=e.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");const{batchTableJson:i,batchTableBinary:s}=r;t=new G8(i,s,n)}return t}async function P_e(r,e,t,n,i){let s,o,c;const f=r.batchTableJson&&r.batchTableJson.extensions&&r.batchTableJson.extensions["3DTILES_draco_point_compression"];f&&(c=f.properties);const A=e.getExtension("3DTILES_draco_point_compression");if(A){o=A.properties;const w=A.byteOffset,S=A.byteLength;if(!o||!Number.isFinite(w)||!S)throw new Error("Draco properties, byteOffset, and byteLength must be defined");s=(r.featureTableBinary||[]).slice(w,w+S),r.hasPositions=Number.isFinite(o.POSITION),r.hasColors=Number.isFinite(o.RGB)||Number.isFinite(o.RGBA),r.hasNormals=Number.isFinite(o.NORMAL),r.hasBatchIds=Number.isFinite(o.BATCH_ID),r.isTranslucent=Number.isFinite(o.RGBA)}if(!s)return!0;const v={buffer:s,properties:{...o,...c},batchTableProperties:c};return await R_e(r,v,n,i)}async function R_e(r,e,t,n){if(!n)return;const i={...t,draco:{...t?.draco,extraAttributes:e.batchTableProperties||{}}};delete i["3d-tiles"];const s=await Bh(e.buffer,JC,i,n),o=s.attributes.POSITION&&s.attributes.POSITION.value,c=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,f=s.attributes.NORMAL&&s.attributes.NORMAL.value,A=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,v=o&&s.attributes.POSITION.value.quantization,w=f&&s.attributes.NORMAL.value.quantization;if(v){const F=s.POSITION.data.quantization,N=F.range;r.quantizedVolumeScale=new dt(N,N,N),r.quantizedVolumeOffset=new dt(F.minValues),r.quantizedRange=(1<<F.quantizationBits)-1,r.isQuantizedDraco=!0}w&&(r.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,r.isOctEncodedDraco=!0);const S={};if(e.batchTableProperties)for(const F of Object.keys(e.batchTableProperties))s.attributes[F]&&s.attributes[F].value&&(S[F.toLowerCase()]=s.attributes[F].value);r.attributes={positions:o,colors:V8(r,c,void 0),normals:f,batchIds:A,...S}}function ga(r,e){if(!r)throw new Error(e||"assert failed: gltf")}const H8={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},j8={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},F_e=1.33,YR=["SCALAR","VEC2","VEC3","VEC4"],D_e=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],O_e=new Map(D_e),L_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},k_e={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},N_e={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function $8(r){return YR[r-1]||YR[0]}function ZC(r){const e=O_e.get(r.constructor);if(!e)throw new Error("Illegal typed array");return e}function QC(r,e){const t=N_e[r.componentType],n=L_e[r.type],i=k_e[r.componentType],s=r.count*n,o=r.count*n*i;ga(o>=0&&o<=e.byteLength);const c=j8[r.componentType],f=H8[r.type];return{ArrayType:t,length:s,byteLength:o,componentByteSize:c,numberOfComponentsInElement:f}}function W8(r){let{images:e,bufferViews:t}=r;e=e||[],t=t||[];const n=e.map(o=>o.bufferView);t=t.filter(o=>!n.includes(o));const i=t.reduce((o,c)=>o+c.byteLength,0),s=e.reduce((o,c)=>{const{width:f,height:A}=c.image;return o+f*A},0);return i+Math.ceil(4*s*F_e)}function U_e(r,e,t){const n=r.bufferViews[t];ga(n);const i=n.buffer,s=e[i];ga(s);const o=(n.byteOffset||0)+s.byteOffset;return new Uint8Array(s.arrayBuffer,o,n.byteLength)}function z_e(r,e,t){const n=typeof t=="number"?r.accessors?.[t]:t;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(t)}`);const i=r.bufferViews?.[n.bufferView||0];if(!i)throw new Error(`No gltf buffer view for accessor ${i}`);const{arrayBuffer:s,byteOffset:o}=e[i.buffer],c=(o||0)+(n.byteOffset||0)+(i.byteOffset||0),{ArrayType:f,length:A,componentByteSize:v,numberOfComponentsInElement:w}=QC(n,i),S=v*w,F=i.byteStride||S;if(typeof i.byteStride>"u"||i.byteStride===S)return new f(s,c,A);const N=new f(A);for(let U=0;U<n.count;U++){const $=new f(s,c+U*F,w);N.set($,U*w)}return N}function G_e(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}class vo{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||G_e(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){const t=this.getUsedExtensions().find(i=>i===e),n=this.getRequiredExtensions().find(i=>i===e);return typeof t=="string"||typeof n=="string"}getExtension(e){const t=this.getUsedExtensions().find(i=>i===e),n=this.json.extensions||{};return t?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if(typeof t=="object")return t;const n=this.json[e]&&this.json[e][t];if(!n)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return n}getTypedArrayForBufferView(e){e=this.getBufferView(e);const t=e.buffer,n=this.gltf.buffers[t];ga(n);const i=(e.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,e.byteLength)}getTypedArrayForAccessor(e){const t=this.getAccessor(e);return z_e(this.gltf.json,this.gltf.buffers,t)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),i=this.getBuffer(t.buffer).data,s=t.byteOffset||0;return new Uint8Array(i,s,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,n){return e.extensions=e.extensions||{},e.extensions[t]=n,this.registerUsedExtension(t),this}setObjectExtension(e,t,n){const i=e.extensions||{};i[t]=n}removeObjectExtension(e,t){const n=e?.extensions||{};if(n[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];const i=this.json.extensionsRemoved;i.includes(t)||i.push(t)}delete n[t]}addExtension(e,t={}){return ga(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return ga(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];const t=this.json.extensionsRemoved;t.includes(e)||t.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:n}=e;this.json.nodes=this.json.nodes||[];const i={mesh:t};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:n,material:i,mode:s=4}=e,c={primitives:[{attributes:this._addAttributes(t),mode:s}]};if(n){const f=this._addIndices(n);c.primitives[0].indices=f}return Number.isFinite(i)&&(c.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(c),this.json.meshes.length-1}addPointCloud(e){const n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,t){const n=Py(e),i=t||n?.mimeType,o={bufferView:this.addBufferView(e),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e,t=0,n=this.byteLength){const i=e.byteLength;ga(Number.isFinite(i)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const s={buffer:t,byteOffset:n,byteLength:i};return this.byteLength+=su(i,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(s),this.json.bufferViews.length-1}addAccessor(e,t){const n={bufferView:e,type:$8(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const n=this.addBufferView(e);let i={min:t.min,max:t.max};(!i.min||!i.max)&&(i=this._getAccessorMinMax(e,t.size));const s={size:t.size,componentType:ZC(e),count:Math.round(e.length/t.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(s,t))}addTexture(e){const{imageIndex:t}=e,n={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){this.gltf.buffers=[];const e=this.byteLength,t=new ArrayBuffer(e),n=new Uint8Array(t);let i=0;for(const s of this.sourceBuffers||[])i=D6(s,n,i);this.json?.buffers?.[0]?this.json.buffers[0].byteLength=e:this.json.buffers=[{byteLength:e}],this.gltf.binary=t,this.sourceBuffers=[t]}_removeStringFromArray(e,t){let n=!0;for(;n;){const i=e.indexOf(t);i>-1?e.splice(i,1):n=!1}}_addAttributes(e={}){const t={};for(const n in e){const i=e[n],s=this._getGltfAttributeName(n),o=this.addBinaryBuffer(i.value,i);t[s]=o}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const n={min:null,max:null};if(e.length<t)return n;n.min=[],n.max=[];const i=e.subarray(0,t);for(const s of i)n.min.push(s),n.max.push(s);for(let s=t;s<e.length;s+=t)for(let o=0;o<t;o++)n.min[0+o]=Math.min(n.min[0+o],e[s+o]),n.max[0+o]=Math.max(n.max[0+o],e[s+o]);return n}}function ZR(r){return(r%1+1)%1}const J8={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},V_e={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},X8={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function eT(r,e){return X8[e]*J8[r]}function Wy(r,e,t,n){if(t!=="UINT8"&&t!=="UINT16"&&t!=="UINT32"&&t!=="UINT64")return null;const i=r.getTypedArrayForBufferView(e),s=Jy(i,"SCALAR",t,n+1);return s instanceof BigInt64Array||s instanceof BigUint64Array?null:s}function Jy(r,e,t,n=1){const i=J8[e],s=V_e[t],o=X8[t],c=n*i,f=c*o;let A=r.buffer,v=r.byteOffset;return v%o!==0&&(A=new Uint8Array(A).slice(v,v+f).buffer,v=0),new s(A,v,c)}function tT(r,e,t){const n=`TEXCOORD_${e.texCoord||0}`,i=t.attributes[n],s=r.getTypedArrayForAccessor(i),o=r.gltf.json,c=e.index,f=o.textures?.[c]?.source;if(typeof f<"u"){const A=o.images?.[f]?.mimeType,v=r.gltf.images?.[f];if(v&&typeof v.width<"u"){const w=[];for(let S=0;S<s.length;S+=2){const F=H_e(v,A,s,S,e.channels);w.push(F)}return w}}return[]}function K8(r,e,t,n,i){if(!t?.length)return;const s=[];for(const v of t){let w=n.findIndex(S=>S===v);w===-1&&(w=n.push(v)-1),s.push(w)}const o=new Uint32Array(s),c=r.gltf.buffers.push({arrayBuffer:o.buffer,byteOffset:o.byteOffset,byteLength:o.byteLength})-1,f=r.addBufferView(o,c,0),A=r.addAccessor(f,{size:1,componentType:ZC(o),count:o.length});i.attributes[e]=A}function H_e(r,e,t,n,i=[0]){const s={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=t[n],c=t[n+1];let f=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(f=4);const A=j_e(o,c,r,f);let v=0;for(const w of i){const S=typeof w=="number"?Object.values(s)[w]:s[w],F=A+S.offset,N=xC(r);if(N.data.length<=F)throw new Error(`${N.data.length} <= ${F}`);const U=N.data[F];v|=U<<S.shift}return v}function j_e(r,e,t,n=1){const i=t.width,s=ZR(r)*(i-1),o=Math.round(s),c=t.height,f=ZR(e)*(c-1),A=Math.round(f),v=t.components?t.components:n;return(A*i+o)*v}function q8(r,e,t,n,i){const s=[];for(let o=0;o<e;o++){const c=t[o],f=t[o+1]-t[o];if(f+c>n)break;const A=c/i,v=f/i;s.push(r.slice(A,A+v))}return s}function Y8(r,e,t){const n=[];for(let i=0;i<e;i++){const s=i*t;n.push(r.slice(s,s+t))}return n}function Z8(r,e,t,n){if(t)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){const i=[],s=new TextDecoder("utf8");let o=0;for(let c=0;c<r;c++){const f=n[c+1]-n[c];if(f+o<=e.length){const A=e.subarray(o,f+o),v=s.decode(A);i.push(v),o+=f}}return i}return[]}const Q8="EXT_mesh_features",$_e=Q8;async function W_e(r,e){const t=new vo(r);J_e(t,e)}function J_e(r,e){const t=r.gltf.json;if(t.meshes)for(const n of t.meshes)for(const i of n.primitives)X_e(r,i,e)}function X_e(r,e,t){if(!t?.gltf?.loadBuffers)return;const i=e.extensions?.[Q8]?.featureIds;if(i)for(const s of i){let o;if(typeof s.attribute<"u"){const c=`_FEATURE_ID_${s.attribute}`,f=e.attributes[c];o=r.getTypedArrayForAccessor(f)}else typeof s.texture<"u"&&t?.gltf?.loadImages?o=tT(r,s.texture,e):o=[];s.data=o}}const K_e=Object.freeze(Object.defineProperty({__proto__:null,decode:W_e,name:$_e},Symbol.toStringTag,{value:"Module"})),rT="EXT_structural_metadata",q_e=rT;async function Y_e(r,e){const t=new vo(r);Z_e(t,e)}function Z_e(r,e){if(!e.gltf?.loadBuffers)return;const t=r.getExtension(rT);t&&(e.gltf?.loadImages&&Q_e(r,t),eye(r,t))}function Q_e(r,e){const t=e.propertyTextures,n=r.gltf.json;if(t&&n.meshes)for(const i of n.meshes)for(const s of i.primitives)rye(r,t,s,e)}function eye(r,e){const t=e.schema;if(!t)return;const n=t.classes,i=e.propertyTables;if(n&&i)for(const s in n){const o=tye(i,s);o&&iye(r,t,o)}}function tye(r,e){for(const t of r)if(t.class===e)return t;return null}function rye(r,e,t,n){if(!e)return;const s=t.extensions?.[rT]?.propertyTextures;if(s)for(const o of s){const c=e[o];nye(r,c,t,n)}}function nye(r,e,t,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);const i=e.class;for(const s in e.properties){const o=`${i}_${s}`,c=e.properties?.[s];if(!c)continue;c.data||(c.data=[]);const f=c.data,A=tT(r,c,t);A!==null&&(K8(r,o,A,f,t),c.data=f,n.dataAttributeNames.push(o))}}function iye(r,e,t){const n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);const i=t.count;for(const s in n.properties){const o=n.properties[s],c=t.properties?.[s];if(c){const f=sye(r,e,o,i,c);c.data=f}}}function sye(r,e,t,n,i){let s=[];const o=i.values,c=r.getTypedArrayForBufferView(o),f=oye(r,t,i,n),A=aye(r,i,n);switch(t.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{s=cye(t,n,c,f);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${t.type}`);case"STRING":{s=Z8(n,c,f,A);break}case"ENUM":{s=lye(e,t,n,c,f);break}default:throw new Error(`Unknown classProperty type ${t.type}`)}return s}function oye(r,e,t,n){return e.array&&typeof e.count>"u"&&typeof t.arrayOffsets<"u"?Wy(r,t.arrayOffsets,t.arrayOffsetType||"UINT32",n):null}function aye(r,e,t){return typeof e.stringOffsets<"u"?Wy(r,e.stringOffsets,e.stringOffsetType||"UINT32",t):null}function cye(r,e,t,n){const i=r.array,s=r.count,o=eT(r.type,r.componentType),c=t.byteLength/o;let f;return r.componentType?f=Jy(t,r.type,r.componentType,c):f=t,i?n?q8(f,e,n,t.length,o):s?Y8(f,e,s):[]:f}function lye(r,e,t,n,i){const s=e.enumType;if(!s)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");const o=r.enums?.[s];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${s}`);const c=o.valueType||"UINT16",f=eT(e.type,c),A=n.byteLength/f;let v=Jy(n,e.type,c,A);if(v||(v=n),e.array){if(i)return uye({valuesData:v,numberOfElements:t,arrayOffsets:i,valuesDataBytesLength:n.length,elementSize:f,enumEntry:o});const w=e.count;return w?fye(v,t,w,o):[]}return nT(v,0,t,o)}function uye(r){const{valuesData:e,numberOfElements:t,arrayOffsets:n,valuesDataBytesLength:i,elementSize:s,enumEntry:o}=r,c=[];for(let f=0;f<t;f++){const A=n[f],v=n[f+1]-n[f];if(v+A>i)break;const w=A/s,S=v/s,F=nT(e,w,S,o);c.push(F)}return c}function fye(r,e,t,n){const i=[];for(let s=0;s<e;s++){const o=t*s,c=nT(r,o,t,n);i.push(c)}return i}function nT(r,e,t,n){const i=[];for(let s=0;s<t;s++)if(r instanceof BigInt64Array||r instanceof BigUint64Array)i.push("");else{const o=r[e+s],c=hye(n,o);c?i.push(c.name):i.push("")}return i}function hye(r,e){for(const t of r.values)if(t.value===e)return t;return null}const dye=Object.freeze(Object.defineProperty({__proto__:null,decode:Y_e,name:q_e},Symbol.toStringTag,{value:"Module"})),eN="EXT_feature_metadata",pye=eN;async function Aye(r,e){const t=new vo(r);gye(t,e)}function gye(r,e){if(!e.gltf?.loadBuffers)return;const t=r.getExtension(eN);t&&(e.gltf?.loadImages&&mye(r,t),_ye(r,t))}function mye(r,e){const t=e.schema;if(!t)return;const n=t.classes,{featureTextures:i}=e;if(n&&i)for(const s in n){const o=n[s],c=vye(i,s);c&&xye(r,c,o)}}function _ye(r,e){const t=e.schema;if(!t)return;const n=t.classes,i=e.featureTables;if(n&&i)for(const s in n){const o=yye(i,s);o&&bye(r,t,o)}}function yye(r,e){for(const t in r){const n=r[t];if(n.class===e)return n}return null}function vye(r,e){for(const t in r){const n=r[t];if(n.class===e)return n}return null}function bye(r,e,t){if(!t.class)return;const n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);const i=t.count;for(const s in n.properties){const o=n.properties[s],c=t.properties?.[s];if(c){const f=wye(r,e,o,i,c);c.data=f}}}function xye(r,e,t){const n=e.class;for(const i in t.properties){const s=e?.properties?.[i];if(s){const o=Sye(r,s,n);s.data=o}}}function wye(r,e,t,n,i){let s=[];const o=i.bufferView,c=r.getTypedArrayForBufferView(o),f=Cye(r,t,i,n),A=Tye(r,t,i,n);return t.type==="STRING"||t.componentType==="STRING"?s=Z8(n,c,f,A):Eye(t)&&(s=Bye(t,n,c,f)),s}function Cye(r,e,t,n){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof t.arrayOffsetBufferView<"u"?Wy(r,t.arrayOffsetBufferView,t.offsetType||"UINT32",n):null}function Tye(r,e,t,n){return typeof t.stringOffsetBufferView<"u"?Wy(r,t.stringOffsetBufferView,t.offsetType||"UINT32",n):null}function Eye(r){const e=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return e.includes(r.type)||typeof r.componentType<"u"&&e.includes(r.componentType)}function Bye(r,e,t,n){const i=r.type==="ARRAY",s=r.componentCount,o="SCALAR",c=r.componentType||r.type,f=eT(o,c),A=t.byteLength/f,v=Jy(t,o,c,A);return i?n?q8(v,e,n,t.length,f):s?Y8(v,e,s):[]:v}function Sye(r,e,t){const n=r.gltf.json;if(!n.meshes)return[];const i=[];for(const s of n.meshes)for(const o of s.primitives)Iye(r,t,e,i,o);return i}function Iye(r,e,t,n,i){const s={channels:t.channels,...t.texture},o=tT(r,s,i);o&&K8(r,e,o,n,i)}const Mye=Object.freeze(Object.defineProperty({__proto__:null,decode:Aye,name:pye},Symbol.toStringTag,{value:"Module"})),Pye="4.2.4",Vp=!0,QR=1735152710,iT=12,K_=8,Rye=1313821514,Fye=5130562,Dye=0,Oye=0,Lye=1;function kye(r,e=0){return`${String.fromCharCode(r.getUint8(e+0))}${String.fromCharCode(r.getUint8(e+1))}${String.fromCharCode(r.getUint8(e+2))}${String.fromCharCode(r.getUint8(e+3))}`}function Nye(r,e=0,t={}){const n=new DataView(r),{magic:i=QR}=t,s=n.getUint32(e,!1);return s===i||s===QR}function Uye(r,e,t=0,n={}){const i=new DataView(e),s=kye(i,t+0),o=i.getUint32(t+4,Vp),c=i.getUint32(t+8,Vp);switch(Object.assign(r,{header:{byteOffset:t,byteLength:c,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),t+=iT,r.version){case 1:return zye(r,i,t);case 2:return Gye(r,i,t,n={});default:throw new Error(`Invalid GLB version ${r.version}. Only supports version 1 and 2.`)}}function zye(r,e,t){Ai(r.header.byteLength>iT+K_);const n=e.getUint32(t+0,Vp),i=e.getUint32(t+4,Vp);return t+=K_,Ai(i===Dye),Tx(r,e,t,n),t+=n,t+=Ex(r,e,t,r.header.byteLength),t}function Gye(r,e,t,n){return Ai(r.header.byteLength>iT+K_),Vye(r,e,t,n),t+r.header.byteLength}function Vye(r,e,t,n){for(;t+8<=r.header.byteLength;){const i=e.getUint32(t+0,Vp),s=e.getUint32(t+4,Vp);switch(t+=K_,s){case Rye:Tx(r,e,t,i);break;case Fye:Ex(r,e,t,i);break;case Oye:n.strict||Tx(r,e,t,i);break;case Lye:n.strict||Ex(r,e,t,i);break}t+=su(i,4)}return t}function Tx(r,e,t,n){const i=new Uint8Array(e.buffer,t,n),o=new TextDecoder("utf8").decode(i);return r.json=JSON.parse(o),su(n,4)}function Ex(r,e,t,n){return r.header.hasBinChunk=!0,r.binChunks.push({byteOffset:t,byteLength:n,arrayBuffer:e.buffer}),su(n,4)}function tN(r,e){if(r.startsWith("data:")||r.startsWith("http:")||r.startsWith("https:"))return r;const n=e.baseUri||e.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${r}`);return n.substr(0,n.lastIndexOf("/")+1)+r}const Hye="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",jye="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",$ye=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Wye=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Jye={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Xye={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function Kye(r,e,t,n,i,s="NONE"){const o=await qye();Qye(o,o.exports[Xye[i]],r,e,t,n,o.exports[Jye[s||"NONE"]])}let F1;async function qye(){return F1||(F1=Yye()),F1}async function Yye(){let r=Hye;WebAssembly.validate($ye)&&(r=jye,console.log("Warning: meshopt_decoder is using experimental SIMD support"));const e=await WebAssembly.instantiate(Zye(r),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}function Zye(r){const e=new Uint8Array(r.length);for(let n=0;n<r.length;++n){const i=r.charCodeAt(n);e[n]=i>96?i-71:i>64?i-65:i>47?i+4:i>46?63:62}let t=0;for(let n=0;n<r.length;++n)e[t++]=e[n]<60?Wye[e[n]]:(e[n]-60)*64+e[++n];return e.buffer.slice(0,t)}function Qye(r,e,t,n,i,s,o){const c=r.exports.sbrk,f=n+3&-4,A=c(f*i),v=c(s.length),w=new Uint8Array(r.exports.memory.buffer);w.set(s,v);const S=e(A,n,i,v,s.length);if(S===0&&o&&o(A,f,i),t.set(w.subarray(A,A+n*i)),c(A-c(0)),S!==0)throw new Error(`Malformed buffer data: ${S}`)}const q_="EXT_meshopt_compression",eve=q_;async function tve(r,e){const t=new vo(r);if(!e?.gltf?.decompressMeshes||!e.gltf?.loadBuffers)return;const n=[];for(const i of r.json.bufferViews||[])n.push(rve(t,i));await Promise.all(n),t.removeExtension(q_)}async function rve(r,e){const t=r.getObjectExtension(e,q_);if(t){const{byteOffset:n=0,byteLength:i=0,byteStride:s,count:o,mode:c,filter:f="NONE",buffer:A}=t,v=r.gltf.buffers[A],w=new Uint8Array(v.arrayBuffer,v.byteOffset+n,i),S=new Uint8Array(r.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);await Kye(S,o,s,w,c,f),r.removeObjectExtension(e,q_)}}const nve=Object.freeze(Object.defineProperty({__proto__:null,decode:tve,name:eve},Symbol.toStringTag,{value:"Module"})),tp="EXT_texture_webp",ive=tp;function sve(r,e){const t=new vo(r);if(!G6("image/webp")){if(t.getRequiredExtensions().includes(tp))throw new Error(`gltf: Required extension ${tp} not supported by browser`);return}const{json:n}=t;for(const i of n.textures||[]){const s=t.getObjectExtension(i,tp);s&&(i.source=s.source),t.removeObjectExtension(i,tp)}t.removeExtension(tp)}const ove=Object.freeze(Object.defineProperty({__proto__:null,name:ive,preprocess:sve},Symbol.toStringTag,{value:"Module"})),i_="KHR_texture_basisu",ave=i_;function cve(r,e){const t=new vo(r),{json:n}=t;for(const i of n.textures||[]){const s=t.getObjectExtension(i,i_);s&&(i.source=s.source,t.removeObjectExtension(i,i_))}t.removeExtension(i_)}const lve=Object.freeze(Object.defineProperty({__proto__:null,name:ave,preprocess:cve},Symbol.toStringTag,{value:"Module"}));function uve(r){const e={};for(const t in r){const n=r[t];if(t!=="indices"){const i=rN(n);e[t]=i}}return e}function rN(r){const{buffer:e,size:t,count:n}=fve(r);return{value:e,size:t,byteOffset:0,count:n,type:$8(t),componentType:ZC(e)}}function fve(r){let e=r,t=1,n=0;return r&&r.value&&(e=r.value,t=r.size||1),e&&(ArrayBuffer.isView(e)||(e=hve(e,Float32Array)),n=e.length/t),{buffer:e,size:t,count:n}}function hve(r,e,t=!1){return r?Array.isArray(r)?new e(r):t&&!(r instanceof e)?new e(r):r:null}const sf="KHR_draco_mesh_compression",dve=sf;function pve(r,e,t){const n=new vo(r);for(const i of nN(n))n.getObjectExtension(i,sf)}async function Ave(r,e,t){if(!e?.gltf?.decompressMeshes)return;const n=new vo(r),i=[];for(const s of nN(n))n.getObjectExtension(s,sf)&&i.push(mve(n,s,e,t));await Promise.all(i),n.removeExtension(sf)}function gve(r,e={}){const t=new vo(r);for(const n of t.json.meshes||[])_ve(n),t.addRequiredExtension(sf)}async function mve(r,e,t,n){const i=r.getObjectExtension(e,sf);if(!i)return;const s=r.getTypedArrayForBufferView(i.bufferView),o=Kg(s.buffer,s.byteOffset),c={...t};delete c["3d-tiles"];const f=await Bh(o,JC,c,n),A=uve(f.attributes);for(const[v,w]of Object.entries(A))if(v in e.attributes){const S=e.attributes[v],F=r.getAccessor(S);F?.min&&F?.max&&(w.min=F.min,w.max=F.max)}e.attributes=A,f.indices&&(e.indices=rN(f.indices)),r.removeObjectExtension(e,sf),yve(e)}function _ve(r,e,t=4,n,i){if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const s=n.DracoWriter.encodeSync({attributes:r}),o=i?.parseSync?.({attributes:r}),c=n._addFauxAttributes(o.attributes),f=n.addBufferView(s);return{primitives:[{attributes:c,mode:t,extensions:{[sf]:{bufferView:f,attributes:c}}}]}}function yve(r){if(!r.attributes&&Object.keys(r.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*nN(r){for(const e of r.json.meshes||[])for(const t of e.primitives)yield t}const vve=Object.freeze(Object.defineProperty({__proto__:null,decode:Ave,encode:gve,name:dve,preprocess:pve},Symbol.toStringTag,{value:"Module"})),Xy="KHR_texture_transform",bve=Xy,w0=new dt,xve=new gi,wve=new gi;async function Cve(r,e){if(!new vo(r).hasExtension(Xy)||!e.gltf?.loadBuffers)return;const i=r.json.materials||[];for(let s=0;s<i.length;s++)Tve(s,r)}function Tve(r,e){const t=e.json.materials?.[r],n=[t?.pbrMetallicRoughness?.baseColorTexture,t?.emissiveTexture,t?.normalTexture,t?.occlusionTexture,t?.pbrMetallicRoughness?.metallicRoughnessTexture],i=[];for(const s of n)s&&s?.extensions?.[Xy]&&Eve(e,r,s,i)}function Eve(r,e,t,n){const i=Bve(t,n);if(!i)return;const s=r.json.meshes||[];for(const o of s)for(const c of o.primitives){const f=c.material;Number.isFinite(f)&&e===f&&Sve(r,c,i)}}function Bve(r,e){const t=r.extensions?.[Xy],{texCoord:n=0}=r,{texCoord:i=n}=t;if(!(e.findIndex(([o,c])=>o===n&&c===i)!==-1)){const o=Pve(t);return n!==i&&(r.texCoord=i),e.push([n,i]),{originalTexCoord:n,texCoord:i,matrix:o}}return null}function Sve(r,e,t){const{originalTexCoord:n,texCoord:i,matrix:s}=t,o=e.attributes[`TEXCOORD_${n}`];if(Number.isFinite(o)){const c=r.json.accessors?.[o];if(c&&c.bufferView){const f=r.json.bufferViews?.[c.bufferView];if(f){const{arrayBuffer:A,byteOffset:v}=r.buffers[f.buffer],w=(v||0)+(c.byteOffset||0)+(f.byteOffset||0),{ArrayType:S,length:F}=QC(c,f),N=j8[c.componentType],U=H8[c.type],$=f.byteStride||N*U,G=new Float32Array(F);for(let H=0;H<c.count;H++){const J=new S(A,w+H*$,2);w0.set(J[0],J[1],1),w0.transformByMatrix3(s),G.set([w0[0],w0[1]],H*U)}n===i?Ive(c,f,r.buffers,G):Mve(i,c,e,r,G)}}}}function Ive(r,e,t,n){r.componentType=5126,t.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),e.buffer=t.length-1,e.byteLength=n.buffer.byteLength,e.byteOffset=0,delete e.byteStride}function Mve(r,e,t,n,i){n.buffers.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength});const s=n.json.bufferViews;if(!s)return;s.push({buffer:n.buffers.length-1,byteLength:i.buffer.byteLength,byteOffset:0});const o=n.json.accessors;o&&(o.push({bufferView:s?.length-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),t.attributes[`TEXCOORD_${r}`]=o.length-1)}function Pve(r){const{offset:e=[0,0],rotation:t=0,scale:n=[1,1]}=r,i=new gi().set(1,0,0,0,1,0,e[0],e[1],1),s=xve.set(Math.cos(t),Math.sin(t),0,-Math.sin(t),Math.cos(t),0,0,0,1),o=wve.set(n[0],0,0,0,n[1],0,0,0,1);return i.multiplyRight(s).multiplyRight(o)}const Rve=Object.freeze(Object.defineProperty({__proto__:null,decode:Cve,name:bve},Symbol.toStringTag,{value:"Module"})),th="KHR_lights_punctual",Fve=th;async function Dve(r){const e=new vo(r),{json:t}=e,n=e.getExtension(th);n&&(e.json.lights=n.lights,e.removeExtension(th));for(const i of t.nodes||[]){const s=e.getObjectExtension(i,th);s&&(i.light=s.light),e.removeObjectExtension(i,th)}}async function Ove(r){const e=new vo(r),{json:t}=e;if(t.lights){const n=e.addExtension(th);ga(!n.lights),n.lights=t.lights,delete t.lights}if(e.json.lights){for(const n of e.json.lights){const i=n.node;e.addObjectExtension(i,th,n)}delete e.json.lights}}const Lve=Object.freeze(Object.defineProperty({__proto__:null,decode:Dve,encode:Ove,name:Fve},Symbol.toStringTag,{value:"Module"})),Fg="KHR_materials_unlit",kve=Fg;async function Nve(r){const e=new vo(r),{json:t}=e;for(const n of t.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),e.removeObjectExtension(n,Fg);e.removeExtension(Fg)}function Uve(r){const e=new vo(r),{json:t}=e;if(e.materials)for(const n of t.materials||[])n.unlit&&(delete n.unlit,e.addObjectExtension(n,Fg,{}),e.addExtension(Fg))}const zve=Object.freeze(Object.defineProperty({__proto__:null,decode:Nve,encode:Uve,name:kve},Symbol.toStringTag,{value:"Module"})),ZA="KHR_techniques_webgl",Gve=ZA;async function Vve(r){const e=new vo(r),{json:t}=e,n=e.getExtension(ZA);if(n){const i=jve(n,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,ZA);o&&(s.technique=Object.assign({},o,i[o.technique]),s.technique.values=$ve(s.technique,e)),e.removeObjectExtension(s,ZA)}e.removeExtension(ZA)}}async function Hve(r,e){}function jve(r,e){const{programs:t=[],shaders:n=[],techniques:i=[]}=r,s=new TextDecoder;return n.forEach(o=>{if(Number.isFinite(o.bufferView))o.code=s.decode(e.getTypedArrayForBufferView(o.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),t.forEach(o=>{o.fragmentShader=n[o.fragmentShader],o.vertexShader=n[o.vertexShader]}),i.forEach(o=>{o.program=t[o.program]}),i}function $ve(r,e){const t=Object.assign({},r.values);return Object.keys(r.uniforms||{}).forEach(n=>{r.uniforms[n].value&&!(n in t)&&(t[n]=r.uniforms[n].value)}),Object.keys(t).forEach(n=>{typeof t[n]=="object"&&t[n].index!==void 0&&(t[n].texture=e.getTexture(t[n].index))}),t}const Wve=Object.freeze(Object.defineProperty({__proto__:null,decode:Vve,encode:Hve,name:Gve},Symbol.toStringTag,{value:"Module"})),iN=[dye,K_e,nve,ove,lve,vve,Lve,zve,Wve,Rve,Mye];function Jve(r,e={},t){const n=iN.filter(i=>sN(i.name,e));for(const i of n)i.preprocess?.(r,e,t)}async function Xve(r,e={},t){const n=iN.filter(i=>sN(i.name,e));for(const i of n)await i.decode?.(r,e,t)}function sN(r,e){const t=e?.gltf?.excludeExtensions||{};return!(r in t&&!t[r])}const D1="KHR_binary_glTF";function Kve(r){const e=new vo(r),{json:t}=e;for(const n of t.images||[]){const i=e.getObjectExtension(n,D1);i&&Object.assign(n,i),e.removeObjectExtension(n,D1)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(D1)}const eF={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},qve={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class Yve{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(e,t){this.json=e.json;const n=e.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),Kve(e),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in eF)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const n=e[t];if(!(!n||Array.isArray(n))){e[t]=[];for(const i in n){const s=n[i];s.id=s.id||i;const o=e[t].length;e[t].push(s),this.idToIndexMap[t][i]=o}}}_convertObjectIdsToArrayIndices(e){for(const t in eF)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:n,indices:i,material:s}=t;for(const o in n)n[o]=this._convertIdToIndex(n[o],"accessor");i&&(t.indices=this._convertIdToIndex(i,"accessor")),s&&(t.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(console.warn(`gltf v1: json doesn't contain attribute ${t}`),e[t]=[]);for(const n of e[t])for(const i in n){const s=n[i],o=this._convertIdToIndex(s,i);n[i]=o}}_convertIdToIndex(e,t){const n=qve[t];if(n in this.idToIndexMap){const i=this.idToIndexMap[n][e];if(!Number.isFinite(i))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return i}return e}_updateObjects(e){for(const t of this.json.buffers)delete t.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const n=t.values?.tex||t.values?.texture2d_0||t.values?.diffuseTex,i=e.textures.findIndex(s=>s.id===n);i!==-1&&(t.pbrMetallicRoughness.baseColorTexture={index:i})}}}function Zve(r,e={}){return new Yve().normalize(r,e)}async function Qve(r,e,t=0,n,i){return ebe(r,e,t,n),Zve(r,{normalize:n?.gltf?.normalize}),Jve(r,n,i),n?.gltf?.loadBuffers&&r.json.buffers&&await tbe(r,n,i),n?.gltf?.loadImages&&await rbe(r,n,i),await Xve(r,n,i),r}function ebe(r,e,t,n){if(n.uri&&(r.baseUri=n.uri),e instanceof ArrayBuffer&&!Nye(e,t,n)&&(e=new TextDecoder().decode(e)),typeof e=="string")r.json=F6(e);else if(e instanceof ArrayBuffer){const o={};t=Uye(o,e,t,n.glb),ga(o.type==="glTF",`Invalid GLB magic string ${o.type}`),r._glb=o,r.json=o.json}else ga(!1,"GLTF: must be ArrayBuffer or string");const i=r.json.buffers||[];if(r.buffers=new Array(i.length).fill(null),r._glb&&r._glb.header.hasBinChunk){const{binChunks:o}=r._glb;r.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}const s=r.json.images||[];r.images=new Array(s.length).fill({})}async function tbe(r,e,t){const n=r.json.buffers||[];for(let i=0;i<n.length;++i){const s=n[i];if(s.uri){const{fetch:o}=t;ga(o);const c=tN(s.uri,e),A=await(await t?.fetch?.(c))?.arrayBuffer?.();r.buffers[i]={arrayBuffer:A,byteOffset:0,byteLength:A.byteLength},delete s.uri}else r.buffers[i]===null&&(r.buffers[i]={arrayBuffer:new ArrayBuffer(s.byteLength),byteOffset:0,byteLength:s.byteLength})}}async function rbe(r,e,t){const n=nbe(r),i=r.json.images||[],s=[];for(const o of n)s.push(ibe(r,i[o],o,e,t));return await Promise.all(s)}function nbe(r){const e=new Set,t=r.json.textures||[];for(const n of t)n.source!==void 0&&e.add(n.source);return Array.from(e).sort()}async function ibe(r,e,t,n,i){let s;if(e.uri&&!e.hasOwnProperty("bufferView")){const c=tN(e.uri,n),{fetch:f}=i;s=await(await f(c)).arrayBuffer(),e.bufferView={data:s}}if(Number.isFinite(e.bufferView)){const c=U_e(r.json,r.buffers,e.bufferView);s=Kg(c.buffer,c.byteOffset,c.byteLength)}ga(s,"glTF image has no data");let o=await Bh(s,[Pg,C8],{...n,mimeType:e.mimeType,basis:n.basis||{format:$C()}},i);o&&o[0]&&(o={compressed:!0,mipmaps:!1,width:o[0].width,height:o[0].height,data:o[0]}),r.images=r.images||[],r.images[t]=o}const Y_={dataType:null,batchType:null,name:"glTF",id:"gltf",module:"gltf",version:Pye,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:sbe,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function sbe(r,e={},t){e={...Y_.options,...e},e.gltf={...Y_.options.gltf,...e.gltf};const{byteOffset:n=0}=e;return await Qve({},r,n,e,t)}const obe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},abe={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Oa={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},cbe={magFilter:Oa.TEXTURE_MAG_FILTER,minFilter:Oa.TEXTURE_MIN_FILTER,wrapS:Oa.TEXTURE_WRAP_S,wrapT:Oa.TEXTURE_WRAP_T},lbe={[Oa.TEXTURE_MAG_FILTER]:Oa.LINEAR,[Oa.TEXTURE_MIN_FILTER]:Oa.NEAREST_MIPMAP_LINEAR,[Oa.TEXTURE_WRAP_S]:Oa.REPEAT,[Oa.TEXTURE_WRAP_T]:Oa.REPEAT};function ube(){return{id:"default-sampler",parameters:lbe}}function fbe(r){return abe[r]}function hbe(r){return obe[r]}class dbe{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(e,t={}){const{json:n,buffers:i=[],images:s=[]}=e,{baseUri:o=""}=e;return ga(n),this.baseUri=o,this.buffers=i,this.images=s,this.jsonUnprocessed=n,this.json=this._resolveTree(e.json,t),this.json}_resolveTree(e,t={}){const n={...e};return this.json=n,e.bufferViews&&(n.bufferViews=e.bufferViews.map((i,s)=>this._resolveBufferView(i,s))),e.images&&(n.images=e.images.map((i,s)=>this._resolveImage(i,s))),e.samplers&&(n.samplers=e.samplers.map((i,s)=>this._resolveSampler(i,s))),e.textures&&(n.textures=e.textures.map((i,s)=>this._resolveTexture(i,s))),e.accessors&&(n.accessors=e.accessors.map((i,s)=>this._resolveAccessor(i,s))),e.materials&&(n.materials=e.materials.map((i,s)=>this._resolveMaterial(i,s))),e.meshes&&(n.meshes=e.meshes.map((i,s)=>this._resolveMesh(i,s))),e.nodes&&(n.nodes=e.nodes.map((i,s)=>this._resolveNode(i,s)),n.nodes=n.nodes.map((i,s)=>this._resolveNodeChildren(i))),e.skins&&(n.skins=e.skins.map((i,s)=>this._resolveSkin(i,s))),e.scenes&&(n.scenes=e.scenes.map((i,s)=>this._resolveScene(i,s))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(e){return this._get(this.json.scenes,e)}getNode(e){return this._get(this.json.nodes,e)}getSkin(e){return this._get(this.json.skins,e)}getMesh(e){return this._get(this.json.meshes,e)}getMaterial(e){return this._get(this.json.materials,e)}getAccessor(e){return this._get(this.json.accessors,e)}getCamera(e){return this._get(this.json.cameras,e)}getTexture(e){return this._get(this.json.textures,e)}getSampler(e){return this._get(this.json.samplers,e)}getImage(e){return this._get(this.json.images,e)}getBufferView(e){return this._get(this.json.bufferViews,e)}getBuffer(e){return this._get(this.json.buffers,e)}_get(e,t){if(typeof t=="object")return t;const n=e&&e[t];return n||console.warn(`glTF file error: Could not find ${e}[${t}]`),n}_resolveScene(e,t){return{...e,id:e.id||`scene-${t}`,nodes:(e.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(e,t){const n={...e,id:e?.id||`node-${t}`};return e.mesh!==void 0&&(n.mesh=this.getMesh(e.mesh)),e.camera!==void 0&&(n.camera=this.getCamera(e.camera)),e.skin!==void 0&&(n.skin=this.getSkin(e.skin)),e.meshes!==void 0&&e.meshes.length&&(n.mesh=e.meshes.reduce((i,s)=>{const o=this.getMesh(s);return i.id=o.id,i.primitives=i.primitives.concat(o.primitives),i},{primitives:[]})),n}_resolveNodeChildren(e){return e.children&&(e.children=e.children.map(t=>this.getNode(t))),e}_resolveSkin(e,t){const n=typeof e.inverseBindMatrices=="number"?this.getAccessor(e.inverseBindMatrices):void 0;return{...e,id:e.id||`skin-${t}`,inverseBindMatrices:n}}_resolveMesh(e,t){const n={...e,id:e.id||`mesh-${t}`,primitives:[]};return e.primitives&&(n.primitives=e.primitives.map(i=>{const s={...i,attributes:{},indices:void 0,material:void 0},o=i.attributes;for(const c in o)s.attributes[c]=this.getAccessor(o[c]);return i.indices!==void 0&&(s.indices=this.getAccessor(i.indices)),i.material!==void 0&&(s.material=this.getMaterial(i.material)),s})),n}_resolveMaterial(e,t){const n={...e,id:e.id||`material-${t}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};const i=n.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture={...i.baseColorTexture},i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture={...i.metallicRoughnessTexture},i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return n}_resolveAccessor(e,t){const n=fbe(e.componentType),i=hbe(e.type),s=n*i,o={...e,id:e.id||`accessor-${t}`,bytesPerComponent:n,components:i,bytesPerElement:s,value:void 0,bufferView:void 0,sparse:void 0};if(e.bufferView!==void 0&&(o.bufferView=this.getBufferView(e.bufferView)),o.bufferView){const c=o.bufferView.buffer,{ArrayType:f,byteLength:A}=QC(o,o.bufferView),v=(o.bufferView.byteOffset||0)+(o.byteOffset||0)+c.byteOffset;let w=c.arrayBuffer.slice(v,v+A);o.bufferView.byteStride&&(w=this._getValueFromInterleavedBuffer(c,v,o.bufferView.byteStride,o.bytesPerElement,o.count)),o.value=new f(w)}return o}_getValueFromInterleavedBuffer(e,t,n,i,s){const o=new Uint8Array(s*i);for(let c=0;c<s;c++){const f=t+c*n;o.set(new Uint8Array(e.arrayBuffer.slice(f,f+i)),c*i)}return o.buffer}_resolveTexture(e,t){return{...e,id:e.id||`texture-${t}`,sampler:typeof e.sampler=="number"?this.getSampler(e.sampler):ube(),source:typeof e.source=="number"?this.getImage(e.source):void 0}}_resolveSampler(e,t){const n={id:e.id||`sampler-${t}`,...e,parameters:{}};for(const i in n){const s=this._enumSamplerParameter(i);s!==void 0&&(n.parameters[s]=n[i])}return n}_enumSamplerParameter(e){return cbe[e]}_resolveImage(e,t){const n={...e,id:e.id||`image-${t}`,image:null,bufferView:e.bufferView!==void 0?this.getBufferView(e.bufferView):void 0},i=this.images[t];return i&&(n.image=i),n}_resolveBufferView(e,t){const n=e.buffer,i=this.buffers[n].arrayBuffer;let s=this.buffers[n].byteOffset||0;return e.byteOffset&&(s+=e.byteOffset),{id:`bufferView-${t}`,...e,buffer:this.buffers[n],data:new Uint8Array(i,s,e.byteLength)}}_resolveCamera(e,t){const n={...e,id:e.id||`camera-${t}`};return n.perspective,n.orthographic,n}}function oN(r,e){return new dbe().postProcess(r,e)}const Bx={URI:0,EMBEDDED:1};function aN(r,e,t,n){r.rotateYtoZ=!0;const i=(r.byteOffset||0)+(r.byteLength||0)-t;if(i===0)throw new Error("glTF byte length must be greater than 0.");return r.gltfUpAxis=n?.["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",r.gltfArrayBuffer=Kg(e,t,i),r.gltfByteOffset=0,r.gltfByteLength=i,t%4===0||console.warn(`${r.type}: embedded glb is not aligned to a 4-byte boundary.`),(r.byteOffset||0)+(r.byteLength||0)}async function cN(r,e,t,n){const i=t?.["3d-tiles"]||{};if(pbe(r,e),i.loadGLTF){if(!n)return;if(r.gltfUrl){const{fetch:s}=n,o=await s(r.gltfUrl,t);r.gltfArrayBuffer=await o.arrayBuffer(),r.gltfByteOffset=0}if(r.gltfArrayBuffer){const s=await Bh(r.gltfArrayBuffer,Y_,t,n);r.gltf=oN(s),r.gpuMemoryUsageInBytes=W8(r.gltf),delete r.gltfArrayBuffer,delete r.gltfByteOffset,delete r.gltfByteLength}}}function pbe(r,e,t){switch(e){case Bx.URI:if(r.gltfArrayBuffer){const n=new Uint8Array(r.gltfArrayBuffer,r.gltfByteOffset),s=new TextDecoder().decode(n);r.gltfUrl=s.replace(/[\s\0]+$/,"")}delete r.gltfArrayBuffer,delete r.gltfByteOffset,delete r.gltfByteLength;break;case Bx.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function Abe(r,e,t,n,i){t=gbe(r,e,t,n),await cN(r,Bx.EMBEDDED,n,i);const s=r?.gltf?.extensions;return s&&s.CESIUM_RTC&&(r.rtcCenter=s.CESIUM_RTC.center),t}function gbe(r,e,t,n,i){t=$y(r,e,t),t=qC(r,e,t),t=YC(r,e,t),t=aN(r,e,t,n);const s=new KC(r.featureTableJson,r.featureTableBinary);return r.rtcCenter=s.getGlobalProperty("RTC_CENTER",Un.FLOAT,3),t}async function mbe(r,e,t,n,i){return t=_be(r,e,t,n),await cN(r,r.gltfFormat||0,n,i),t}function _be(r,e,t,n,i){if(t=$y(r,e,t),r.version!==1)throw new Error(`Instanced 3D Model version ${r.version} is not supported`);t=qC(r,e,t);const s=new DataView(e);if(r.gltfFormat=s.getUint32(t,!0),t+=4,t=YC(r,e,t),t=aN(r,e,t,n),!r?.header?.featureTableJsonByteLength||r.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const o=new KC(r.featureTableJson,r.featureTableBinary),c=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=c,!Number.isFinite(c))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");r.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),r.rtcCenter=o.getGlobalProperty("RTC_CENTER",Un.FLOAT,3);const f=new G8(r.batchTableJson,r.batchTableBinary,c);return ybe(r,o,f,c),t}function ybe(r,e,t,n){const i=new Array(n),s=new dt;new dt,new dt,new dt;const o=new gi,c=new vg,f=new dt,A={},v=new vn,w=[],S=[],F=[],N=[];for(let U=0;U<n;U++){let $;if(e.hasProperty("POSITION"))$=e.getProperty("POSITION",Un.FLOAT,3,U,s);else if(e.hasProperty("POSITION_QUANTIZED")){$=e.getProperty("POSITION_QUANTIZED",Un.UNSIGNED_SHORT,3,U,s);const se=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Un.FLOAT,3);if(!se)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const Te=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Un.FLOAT,3);if(!Te)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const Ue=65535;for(let de=0;de<3;de++)$[de]=$[de]/Ue*Te[de]+se[de]}if(!$)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");if(s.copy($),A.translation=s,r.normalUp=e.getProperty("NORMAL_UP",Un.FLOAT,3,U,w),r.normalRight=e.getProperty("NORMAL_RIGHT",Un.FLOAT,3,U,S),r.normalUp){if(!r.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");r.hasCustomOrientation=!0}else{if(r.octNormalUp=e.getProperty("NORMAL_UP_OCT32P",Un.UNSIGNED_SHORT,2,U,w),r.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",Un.UNSIGNED_SHORT,2,U,S),r.octNormalUp)throw r.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");r.eastNorthUp?(wi.WGS84.eastNorthUpToFixedFrame(s,v),v.getRotationMatrix3(o)):o.identity()}c.fromMatrix3(o),A.rotation=c,f.set(1,1,1);const G=e.getProperty("SCALE",Un.FLOAT,1,U,F);Number.isFinite(G)&&f.multiplyByScalar(G);const H=e.getProperty("SCALE_NON_UNIFORM",Un.FLOAT,3,U,w);H&&f.scale(H),A.scale=f;let J=e.getProperty("BATCH_ID",Un.UNSIGNED_SHORT,1,U,N);J===void 0&&(J=U);const ue=new vn().fromQuaternion(A.rotation);v.identity(),v.translate(A.translation),v.multiplyRight(ue),v.scale(A.scale);const q=v.clone();i[U]={modelMatrix:q,batchId:J}}r.instances=i}async function vbe(r,e,t,n,i,s){t=$y(r,e,t);const o=new DataView(e);for(r.tilesLength=o.getUint32(t,!0),t+=4,r.tiles=[];r.tiles.length<r.tilesLength&&(r.byteLength||0)-t>12;){const c={shape:"tile3d"};r.tiles.push(c),t=await s(e,t,n,i,c)}return t}async function bbe(r,e,t,n){if(r.rotateYtoZ=!0,r.gltfUpAxis=t?.["3d-tiles"]?.assetGltfUpAxis?t["3d-tiles"].assetGltfUpAxis:"Y",t?.["3d-tiles"]?.loadGLTF){if(!n)return e.byteLength;const i=await Bh(e,Y_,t,n);r.gltf=oN(i),r.gpuMemoryUsageInBytes=W8(r.gltf)}else r.gltfArrayBuffer=e;return e.byteLength}async function lN(r,e=0,t,n,i={shape:"tile3d"}){switch(i.byteOffset=e,i.type=r_e(r,e),i.type){case UA.COMPOSITE:return await vbe(i,r,e,t,n,lN);case UA.BATCHED_3D_MODEL:return await Abe(i,r,e,t,n);case UA.GLTF:return await bbe(i,r,t,n);case UA.INSTANCED_3D_MODEL:return await mbe(i,r,e,t,n);case UA.POINT_CLOUD:return await C_e(i,r,e,t,n);default:throw new Error(`3DTileLoader: unknown type ${i.type}`)}}const xbe=1952609651,wbe=1;async function Cbe(r,e,t){if(new Uint32Array(r.slice(0,4))[0]!==xbe)throw new Error("Wrong subtree file magic number");if(new Uint32Array(r.slice(4,8))[0]!==wbe)throw new Error("Wrong subtree file verson, must be 1");const s=tF(r.slice(8,16)),o=new Uint8Array(r,24,s),f=new TextDecoder("utf8").decode(o),A=JSON.parse(f),v=tF(r.slice(16,24));let w=new ArrayBuffer(0);if(v&&(w=r.slice(24+s)),await C0(A,A.tileAvailability,w,t),Array.isArray(A.contentAvailability))for(const S of A.contentAvailability)await C0(A,S,w,t);else await C0(A,A.contentAvailability,w,t);return await C0(A,A.childSubtreeAvailability,w,t),A}async function C0(r,e,t,n){const i=Number.isFinite(e.bitstream)?e.bitstream:e.bufferView;if(typeof i!="number")return;const s=r.bufferViews[i],o=r.buffers[s.buffer];if(!n?.baseUrl)throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(o.uri){const f=`${n?.baseUrl||""}/${o.uri}`,v=await(await n.fetch(f)).arrayBuffer();e.explicitBitstream=new Uint8Array(v,s.byteOffset,s.byteLength);return}const c=r.buffers.slice(0,s.buffer).reduce((f,A)=>f+A.byteLength,0);e.explicitBitstream=new Uint8Array(t.slice(c,c+o.byteLength),s.byteOffset,s.byteLength)}function tF(r){const e=new DataView(r),t=e.getUint32(0,!0),n=e.getUint32(4,!0);return t+2**32*n}const uN={dataType:null,batchType:null,id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:N8,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Cbe,options:{}};var Ua=null;try{Ua=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function ai(r,e,t){this.low=r|0,this.high=e|0,this.unsigned=!!t}ai.prototype.__isLong__;Object.defineProperty(ai.prototype,"__isLong__",{value:!0});function bo(r){return(r&&r.__isLong__)===!0}function rF(r){var e=Math.clz32(r&-r);return r?31-e:e}ai.isLong=bo;var nF={},iF={};function Sh(r,e){var t,n,i;return e?(r>>>=0,(i=0<=r&&r<256)&&(n=iF[r],n)?n:(t=Gn(r,0,!0),i&&(iF[r]=t),t)):(r|=0,(i=-128<=r&&r<128)&&(n=nF[r],n)?n:(t=Gn(r,r<0?-1:0,!1),i&&(nF[r]=t),t))}ai.fromInt=Sh;function za(r,e){if(isNaN(r))return e?Zl:wc;if(e){if(r<0)return Zl;if(r>=fN)return pN}else{if(r<=-oF)return jo;if(r+1>=oF)return dN}return r<0?za(-r,e).neg():Gn(r%Hp|0,r/Hp|0,e)}ai.fromNumber=za;function Gn(r,e,t){return new ai(r,e,t)}ai.fromBits=Gn;var Z_=Math.pow;function sT(r,e,t){if(r.length===0)throw Error("empty string");if(typeof e=="number"?(t=e,e=!1):e=!!e,r==="NaN"||r==="Infinity"||r==="+Infinity"||r==="-Infinity")return e?Zl:wc;if(t=t||10,t<2||36<t)throw RangeError("radix");var n;if((n=r.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return sT(r.substring(1),e,t).neg();for(var i=za(Z_(t,8)),s=wc,o=0;o<r.length;o+=8){var c=Math.min(8,r.length-o),f=parseInt(r.substring(o,o+c),t);if(c<8){var A=za(Z_(t,c));s=s.mul(A).add(za(f))}else s=s.mul(i),s=s.add(za(f))}return s.unsigned=e,s}ai.fromString=sT;function Mc(r,e){return typeof r=="number"?za(r,e):typeof r=="string"?sT(r,e):Gn(r.low,r.high,typeof e=="boolean"?e:r.unsigned)}ai.fromValue=Mc;var sF=65536,Tbe=1<<24,Hp=sF*sF,fN=Hp*Hp,oF=fN/2,aF=Sh(Tbe),wc=Sh(0);ai.ZERO=wc;var Zl=Sh(0,!0);ai.UZERO=Zl;var gp=Sh(1);ai.ONE=gp;var hN=Sh(1,!0);ai.UONE=hN;var Sx=Sh(-1);ai.NEG_ONE=Sx;var dN=Gn(-1,2147483647,!1);ai.MAX_VALUE=dN;var pN=Gn(-1,-1,!0);ai.MAX_UNSIGNED_VALUE=pN;var jo=Gn(0,-2147483648,!1);ai.MIN_VALUE=jo;var rr=ai.prototype;rr.toInt=function(){return this.unsigned?this.low>>>0:this.low};rr.toNumber=function(){return this.unsigned?(this.high>>>0)*Hp+(this.low>>>0):this.high*Hp+(this.low>>>0)};rr.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(jo)){var t=za(e),n=this.div(t),i=n.mul(t).sub(this);return n.toString(e)+i.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var s=za(Z_(e,6),this.unsigned),o=this,c="";;){var f=o.div(s),A=o.sub(f.mul(s)).toInt()>>>0,v=A.toString(e);if(o=f,o.isZero())return v+c;for(;v.length<6;)v="0"+v;c=""+v+c}};rr.getHighBits=function(){return this.high};rr.getHighBitsUnsigned=function(){return this.high>>>0};rr.getLowBits=function(){return this.low};rr.getLowBitsUnsigned=function(){return this.low>>>0};rr.getNumBitsAbs=function(){if(this.isNegative())return this.eq(jo)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,t=31;t>0&&(e&1<<t)==0;t--);return this.high!=0?t+33:t+1};rr.isZero=function(){return this.high===0&&this.low===0};rr.eqz=rr.isZero;rr.isNegative=function(){return!this.unsigned&&this.high<0};rr.isPositive=function(){return this.unsigned||this.high>=0};rr.isOdd=function(){return(this.low&1)===1};rr.isEven=function(){return(this.low&1)===0};rr.equals=function(e){return bo(e)||(e=Mc(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};rr.eq=rr.equals;rr.notEquals=function(e){return!this.eq(e)};rr.neq=rr.notEquals;rr.ne=rr.notEquals;rr.lessThan=function(e){return this.comp(e)<0};rr.lt=rr.lessThan;rr.lessThanOrEqual=function(e){return this.comp(e)<=0};rr.lte=rr.lessThanOrEqual;rr.le=rr.lessThanOrEqual;rr.greaterThan=function(e){return this.comp(e)>0};rr.gt=rr.greaterThan;rr.greaterThanOrEqual=function(e){return this.comp(e)>=0};rr.gte=rr.greaterThanOrEqual;rr.ge=rr.greaterThanOrEqual;rr.compare=function(e){if(bo(e)||(e=Mc(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};rr.comp=rr.compare;rr.negate=function(){return!this.unsigned&&this.eq(jo)?jo:this.not().add(gp)};rr.neg=rr.negate;rr.add=function(e){bo(e)||(e=Mc(e));var t=this.high>>>16,n=this.high&65535,i=this.low>>>16,s=this.low&65535,o=e.high>>>16,c=e.high&65535,f=e.low>>>16,A=e.low&65535,v=0,w=0,S=0,F=0;return F+=s+A,S+=F>>>16,F&=65535,S+=i+f,w+=S>>>16,S&=65535,w+=n+c,v+=w>>>16,w&=65535,v+=t+o,v&=65535,Gn(S<<16|F,v<<16|w,this.unsigned)};rr.subtract=function(e){return bo(e)||(e=Mc(e)),this.add(e.neg())};rr.sub=rr.subtract;rr.multiply=function(e){if(this.isZero())return this;if(bo(e)||(e=Mc(e)),Ua){var t=Ua.mul(this.low,this.high,e.low,e.high);return Gn(t,Ua.get_high(),this.unsigned)}if(e.isZero())return this.unsigned?Zl:wc;if(this.eq(jo))return e.isOdd()?jo:wc;if(e.eq(jo))return this.isOdd()?jo:wc;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(aF)&&e.lt(aF))return za(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,s=this.low>>>16,o=this.low&65535,c=e.high>>>16,f=e.high&65535,A=e.low>>>16,v=e.low&65535,w=0,S=0,F=0,N=0;return N+=o*v,F+=N>>>16,N&=65535,F+=s*v,S+=F>>>16,F&=65535,F+=o*A,S+=F>>>16,F&=65535,S+=i*v,w+=S>>>16,S&=65535,S+=s*A,w+=S>>>16,S&=65535,S+=o*f,w+=S>>>16,S&=65535,w+=n*v+i*A+s*f+o*c,w&=65535,Gn(F<<16|N,w<<16|S,this.unsigned)};rr.mul=rr.multiply;rr.divide=function(e){if(bo(e)||(e=Mc(e)),e.isZero())throw Error("division by zero");if(Ua){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var t=(this.unsigned?Ua.div_u:Ua.div_s)(this.low,this.high,e.low,e.high);return Gn(t,Ua.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Zl:wc;var n,i,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return Zl;if(e.gt(this.shru(1)))return hN;s=Zl}else{if(this.eq(jo)){if(e.eq(gp)||e.eq(Sx))return jo;if(e.eq(jo))return gp;var o=this.shr(1);return n=o.div(e).shl(1),n.eq(wc)?e.isNegative()?gp:Sx:(i=this.sub(e.mul(n)),s=n.add(i.div(e)),s)}else if(e.eq(jo))return this.unsigned?Zl:wc;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=wc}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var c=Math.ceil(Math.log(n)/Math.LN2),f=c<=48?1:Z_(2,c-48),A=za(n),v=A.mul(e);v.isNegative()||v.gt(i);)n-=f,A=za(n,this.unsigned),v=A.mul(e);A.isZero()&&(A=gp),s=s.add(A),i=i.sub(v)}return s};rr.div=rr.divide;rr.modulo=function(e){if(bo(e)||(e=Mc(e)),Ua){var t=(this.unsigned?Ua.rem_u:Ua.rem_s)(this.low,this.high,e.low,e.high);return Gn(t,Ua.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};rr.mod=rr.modulo;rr.rem=rr.modulo;rr.not=function(){return Gn(~this.low,~this.high,this.unsigned)};rr.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};rr.clz=rr.countLeadingZeros;rr.countTrailingZeros=function(){return this.low?rF(this.low):rF(this.high)+32};rr.ctz=rr.countTrailingZeros;rr.and=function(e){return bo(e)||(e=Mc(e)),Gn(this.low&e.low,this.high&e.high,this.unsigned)};rr.or=function(e){return bo(e)||(e=Mc(e)),Gn(this.low|e.low,this.high|e.high,this.unsigned)};rr.xor=function(e){return bo(e)||(e=Mc(e)),Gn(this.low^e.low,this.high^e.high,this.unsigned)};rr.shiftLeft=function(e){return bo(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?Gn(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):Gn(0,this.low<<e-32,this.unsigned)};rr.shl=rr.shiftLeft;rr.shiftRight=function(e){return bo(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?Gn(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):Gn(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};rr.shr=rr.shiftRight;rr.shiftRightUnsigned=function(e){return bo(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?Gn(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):e===32?Gn(this.high,0,this.unsigned):Gn(this.high>>>e-32,0,this.unsigned)};rr.shru=rr.shiftRightUnsigned;rr.shr_u=rr.shiftRightUnsigned;rr.rotateLeft=function(e){var t;return bo(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?Gn(this.high,this.low,this.unsigned):e<32?(t=32-e,Gn(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(e-=32,t=32-e,Gn(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))};rr.rotl=rr.rotateLeft;rr.rotateRight=function(e){var t;return bo(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?Gn(this.high,this.low,this.unsigned):e<32?(t=32-e,Gn(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(e-=32,t=32-e,Gn(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))};rr.rotr=rr.rotateRight;rr.toSigned=function(){return this.unsigned?Gn(this.low,this.high,!1):this};rr.toUnsigned=function(){return this.unsigned?this:Gn(this.low,this.high,!0)};rr.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};rr.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]};rr.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]};ai.fromBytes=function(e,t,n){return n?ai.fromBytesLE(e,t):ai.fromBytesBE(e,t)};ai.fromBytesLE=function(e,t){return new ai(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)};ai.fromBytesBE=function(e,t){return new ai(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)};const Ebe=16;function AN(r){r==="X"&&(r="");const e=r.padEnd(Ebe,"0");return ai.fromString(e,!0,16)}function Bbe(r){if(r.isZero())return"X";let e=r.countTrailingZeros();const t=e%4;e=(e-t)/4;const n=e;e*=4;const s=r.shiftRightUnsigned(e).toString(16).replace(/0+$/,"");return Array(17-n-s.length).join("0")+s}function Sbe(r,e){const t=Ibe(r).shiftRightUnsigned(2);return r.add(ai.fromNumber(2*e+1-4).multiply(t))}function Ibe(r){return r.and(r.not().add(1))}const Mbe=3,Pbe=30,Rbe=2*Pbe+1,cF=180/Math.PI;function Fbe(r){if(r.length===0)throw new Error(`Invalid Hilbert quad key ${r}`);const e=r.split("/"),t=parseInt(e[0],10),n=e[1],i=n.length;let s=0;const o=[0,0];for(let c=i-1;c>=0;c--){s=i-c;const f=n[c];let A=0,v=0;f==="1"?v=1:f==="2"?(A=1,v=1):f==="3"&&(A=1);const w=Math.pow(2,s-1);Obe(w,o,A,v),o[0]+=w*A,o[1]+=w*v}if(t%2===1){const c=o[0];o[0]=o[1],o[1]=c}return{face:t,ij:o,level:s}}function Dbe(r){if(r.isZero())return"";let e=r.toString(2);for(;e.length<Mbe+Rbe;)e="0"+e;const t=e.lastIndexOf("1"),n=e.substring(0,3),i=e.substring(3,t),s=i.length/2,o=ai.fromString(n,!0,2).toString(10);let c="";if(s!==0)for(c=ai.fromString(i,!0,2).toString(4);c.length<s;)c="0"+c;return`${o}/${c}`}function gN(r,e,t){const n=1<<e;return[(r[0]+t[0])/n,(r[1]+t[1])/n]}function lF(r){return r>=.5?1/3*(4*r*r-1):1/3*(1-4*(1-r)*(1-r))}function mN(r){return[lF(r[0]),lF(r[1])]}function _N(r,[e,t]){switch(r){case 0:return[1,e,t];case 1:return[-e,1,t];case 2:return[-e,-t,1];case 3:return[-1,-t,-e];case 4:return[t,-1,-e];case 5:return[t,e,-1];default:throw new Error("Invalid face")}}function yN([r,e,t]){const n=Math.atan2(t,Math.sqrt(r*r+e*e));return[Math.atan2(e,r)*cF,n*cF]}function Obe(r,e,t,n){if(n===0){t===1&&(e[0]=r-1-e[0],e[1]=r-1-e[1]);const i=e[0];e[0]=e[1],e[1]=i}}function Lbe(r){const e=gN(r.ij,r.level,[.5,.5]),t=mN(e),n=_N(r.face,t);return yN(n)}const kbe=100;function uF(r){const{face:e,ij:t,level:n}=r,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],s=Math.max(1,Math.ceil(kbe*Math.pow(2,-n))),o=new Float64Array(4*s*2+2);let c=0,f=0;for(let A=0;A<4;A++){const v=i[A].slice(0),w=i[A+1],S=(w[0]-v[0])/s,F=(w[1]-v[1])/s;for(let N=0;N<s;N++){v[0]+=S,v[1]+=F;const U=gN(t,n,v),$=mN(U),G=_N(e,$),H=yN(G);Math.abs(H[1])>89.999&&(H[0]=f);const J=H[0]-f;H[0]+=J>180?-360:J<-180?360:0,o[c++]=H[0],o[c++]=H[1],f=H[0]}}return o[c++]=o[0],o[c++]=o[1],o}function oT(r){const e=Nbe(r);return Fbe(e)}function Nbe(r){if(r.indexOf("/")>0)return r;const e=AN(r);return Dbe(e)}function Ube(r){const e=oT(r);return Lbe(e)}function zbe(r){let e;if(r.face===2||r.face===5){let t=null,n=0;for(let i=0;i<4;i++){const s=`${r.face}/${i}`,o=oT(s),c=uF(o);(typeof t>"u"||t===null)&&(t=new Float64Array(4*c.length)),t.set(c,n),n+=c.length}e=fF(t)}else{const t=uF(r);e=fF(t)}return e}function fF(r){if(r.length%2!==0)throw new Error("Invalid corners");const e=[],t=[];for(let n=0;n<r.length;n+=2)e.push(r[n]),t.push(r[n+1]);return e.sort((n,i)=>n-i),t.sort((n,i)=>n-i),{west:e[0],east:e[e.length-1],north:t[t.length-1],south:t[0]}}function Gbe(r,e){const t=e?.minimumHeight||0,n=e?.maximumHeight||0,i=oT(r),s=zbe(i),o=s.west,c=s.south,f=s.east,A=s.north,v=[];return v.push(new dt(o,A,t)),v.push(new dt(f,A,t)),v.push(new dt(f,c,t)),v.push(new dt(o,c,t)),v.push(new dt(o,A,n)),v.push(new dt(f,A,n)),v.push(new dt(f,c,n)),v.push(new dt(o,c,n)),v}function vN(r){const e=r.token,t={minimumHeight:r.minimumHeight,maximumHeight:r.maximumHeight},n=Gbe(e,t),i=Ube(e),s=i[0],o=i[1],c=wi.WGS84.cartographicToCartesian([s,o,t.maximumHeight]),f=new dt(c[0],c[1],c[2]);n.push(f);const A=H6(n);return[...A.center,...A.halfAxes]}const Vbe=4,Hbe=8,jbe={QUADTREE:Vbe,OCTREE:Hbe};function $be(r,e,t){if(r?.box){const n=AN(r.s2VolumeInfo.token),i=Sbe(n,e),s=Bbe(i),o={...r.s2VolumeInfo};switch(o.token=s,t){case"OCTREE":const A=r.s2VolumeInfo,v=A.maximumHeight-A.minimumHeight,w=v/2,S=A.minimumHeight+v/2;A.minimumHeight=S-w,A.maximumHeight=S+w;break}return{box:vN(o),s2VolumeInfo:o}}}async function bN(r){const{implicitOptions:e,parentData:t={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,s2VolumeBox:i,loaderOptions:s}=r;let{subtree:o,level:c=0,globalData:f={level:0,mortonIndex:0,x:0,y:0,z:0}}=r;const{subdivisionScheme:A,subtreeLevels:v,maximumLevel:w,contentUrlTemplate:S,subtreesUriTemplate:F,basePath:N}=e,U={children:[],lodMetricValue:0,contentUrl:""};if(!w)return JL.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${S} won't be loaded...`),U;const $=c+f.level;if($>w)return U;const G=jbe[A],H=Math.log2(G),J=n&1,ue=n>>1&1,q=n>>2&1,se=(G**c-1)/(G-1);let Te=jf(t.mortonIndex,n,H),Ue=se+Te,de=jf(t.x,J,1),me=jf(t.y,ue,1),pe=jf(t.z,q,1),W=!1;c>=v&&(W=O1(o.childSubtreeAvailability,Te));const re=jf(f.x,de,c),Ee=jf(f.y,me,c),et=jf(f.z,pe,c);if(W){const tt=`${N}/${F}`,rt=Ix(tt,$,re,Ee,et);o=await Wp(rt,uN,s),f={mortonIndex:Te,x:de,y:me,z:pe,level:c},Te=0,Ue=0,de=0,me=0,pe=0,c=0}if(!O1(o.tileAvailability,Ue))return U;O1(o.contentAvailability,Ue)&&(U.contentUrl=Ix(S,$,re,Ee,et));const Ge=c+1,Ze={mortonIndex:Te,x:de,y:me,z:pe};for(let tt=0;tt<G;tt++){const rt=$be(i,tt,A),ut=await bN({subtree:o,implicitOptions:e,loaderOptions:s,parentData:Ze,childIndex:tt,level:Ge,globalData:{...f},s2VolumeBox:rt});if(ut.contentUrl||ut.children.length){const vt=$+1,st=Wbe(ut,vt,{childTileX:de,childTileY:me,childTileZ:pe},e,i);U.children.push(st)}}return U}function O1(r,e){let t;return Array.isArray(r)?(t=r[0],r.length>1&&JL.once('Not supported extension "3DTILES_multiple_contents" has been detected')):t=r,"constant"in t?!!t.constant:t.explicitBitstream?Kbe(e,t.explicitBitstream):!1}function Wbe(r,e,t,n,i){const{basePath:s,refine:o,getRefine:c,lodMetricType:f,getTileType:A,rootLodMetricValue:v,rootBoundingVolume:w}=n,S=r.contentUrl&&r.contentUrl.replace(`${s}/`,""),F=v/2**e,N=i?.box?{box:i.box}:w,U=Jbe(e,N,t);return{children:r.children,contentUrl:r.contentUrl,content:{uri:S},id:r.contentUrl,refine:c(o),type:A(r),lodMetricType:f,lodMetricValue:F,geometricError:F,transform:r.transform,boundingVolume:U}}function Jbe(r,e,t){if(e.region){const{childTileX:n,childTileY:i,childTileZ:s}=t,[o,c,f,A,v,w]=e.region,S=2**r,F=(f-o)/S,N=(A-c)/S,U=(w-v)/S,[$,G]=[o+F*n,o+F*(n+1)],[H,J]=[c+N*i,c+N*(i+1)],[ue,q]=[v+U*s,v+U*(s+1)];return{region:[$,H,G,J,ue,q]}}if(e.box)return e;throw new Error(`Unsupported bounding volume type ${JSON.stringify(e)}`)}function jf(r,e,t){return(r<<t)+e}function Ix(r,e,t,n,i){const s=Xbe({level:e,x:t,y:n,z:i});return r.replace(/{level}|{x}|{y}|{z}/gi,o=>s[o])}function Xbe(r){const e={};for(const t in r)e[`{${t}}`]=r[t];return e}function Kbe(r,e){const t=Math.floor(r/8),n=r%8;return(e[t]>>n&1)===1}function aT(r,e=""){if(!e)return Yl.EMPTY;const n=e.split("?")[0].split(".").pop();switch(n){case"pnts":return Yl.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Yl.SCENEGRAPH;default:return n||Yl.EMPTY}}function cT(r){switch(r){case"REPLACE":case"replace":return Tc.REPLACE;case"ADD":case"add":return Tc.ADD;default:return r}}function Mx(r,e){if(/^[a-z][0-9a-z+.-]*:/i.test(e)){const n=new URL(r,`${e}/`);return decodeURI(n.toString())}else if(r.startsWith("/"))return r;return Wue(e,r)}function hF(r,e){if(!r)return null;let t;if(r.content){const i=r.content.uri||r.content?.url;typeof i<"u"&&(t=Mx(i,e))}return{...r,id:t,contentUrl:t,lodMetricType:Gp.GEOMETRIC_ERROR,lodMetricValue:r.geometricError,transformMatrix:r.transform,type:aT(r,t),refine:cT(r.refine)}}async function qbe(r,e,t){let n=null;const i=pF(r.root);i&&r.root?n=await dF(r.root,r,e,i,t):n=hF(r.root,e);const s=[];for(s.push(n);s.length>0;){const o=s.pop()||{},c=o.children||[],f=[];for(const A of c){const v=pF(A);let w;v?w=await dF(A,r,e,v,t):w=hF(A,e),w&&(f.push(w),s.push(w))}o.children=f}return n}async function dF(r,e,t,n,i){const{subdivisionScheme:s,maximumLevel:o,availableLevels:c,subtreeLevels:f,subtrees:{uri:A}}=n,v=Ix(A,0,0,0,0),w=Mx(v,t),S=await Wp(w,uN,i),F=r.content?.uri,N=F?Mx(F,t):"",U=e?.root?.refine,$=r.geometricError,G=r.boundingVolume.extensions?.["3DTILES_bounding_volume_S2"];if(G){const q={box:vN(G),s2VolumeInfo:G};r.boundingVolume=q}const H=r.boundingVolume,J={contentUrlTemplate:N,subtreesUriTemplate:A,subdivisionScheme:s,subtreeLevels:f,maximumLevel:Number.isFinite(c)?c-1:o,refine:U,basePath:t,lodMetricType:Gp.GEOMETRIC_ERROR,rootLodMetricValue:$,rootBoundingVolume:H,getTileType:aT,getRefine:cT};return await Ybe(r,t,S,J,i)}async function Ybe(r,e,t,n,i){if(!r)return null;const{children:s,contentUrl:o}=await bN({subtree:t,implicitOptions:n,loaderOptions:i});let c,f=null;return o&&(c=o,f={uri:o.replace(`${e}/`,"")}),{...r,id:c,contentUrl:c,lodMetricType:Gp.GEOMETRIC_ERROR,lodMetricValue:r.geometricError,transformMatrix:r.transform,type:aT(r,c),refine:cT(r.refine),content:f||r.content,children:s}}function pF(r){return r?.extensions?.["3DTILES_implicit_tiling"]||r?.implicitTiling}const xN={dataType:null,batchType:null,id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:N8,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:Zbe,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function Zbe(r,e={},t){const n=e["3d-tiles"]||{};let i;return n.isTileset==="auto"?i=t?.url&&t.url.indexOf(".json")!==-1:i=n.isTileset,i?Qbe(r,e,t):e1e(r,e,t)}async function Qbe(r,e,t){const n=JSON.parse(new TextDecoder().decode(r)),i=t?.url||"",s=t1e(i),o=await qbe(n,s,e||{});return{...n,shape:"tileset3d",loader:xN,url:i,queryString:t?.queryString||"",basePath:s,root:o||n.root,type:Go.TILES3D,lodMetricType:Gp.GEOMETRIC_ERROR,lodMetricValue:n.root?.geometricError||0}}async function e1e(r,e,t){const n={content:{shape:"tile3d",featureIds:null}};return await lN(r,0,e,t,n.content),n.content}function t1e(r){return L6(r)}var L1={},AF;function pf(){return AF||(AF=1,function(r){var e=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function t(s,o){return Object.prototype.hasOwnProperty.call(s,o)}r.assign=function(s){for(var o=Array.prototype.slice.call(arguments,1);o.length;){var c=o.shift();if(c){if(typeof c!="object")throw new TypeError(c+"must be non-object");for(var f in c)t(c,f)&&(s[f]=c[f])}}return s},r.shrinkBuf=function(s,o){return s.length===o?s:s.subarray?s.subarray(0,o):(s.length=o,s)};var n={arraySet:function(s,o,c,f,A){if(o.subarray&&s.subarray){s.set(o.subarray(c,c+f),A);return}for(var v=0;v<f;v++)s[A+v]=o[c+v]},flattenChunks:function(s){var o,c,f,A,v,w;for(f=0,o=0,c=s.length;o<c;o++)f+=s[o].length;for(w=new Uint8Array(f),A=0,o=0,c=s.length;o<c;o++)v=s[o],w.set(v,A),A+=v.length;return w}},i={arraySet:function(s,o,c,f,A){for(var v=0;v<f;v++)s[A+v]=o[c+v]},flattenChunks:function(s){return[].concat.apply([],s)}};r.setTyped=function(s){s?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,n)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,i))},r.setTyped(e)}(L1)),L1}var Nd={},fc={},$f={},gF;function r1e(){if(gF)return $f;gF=1;var r=pf(),e=4,t=0,n=1,i=2;function s(Me){for(var kt=Me.length;--kt>=0;)Me[kt]=0}var o=0,c=1,f=2,A=3,v=258,w=29,S=256,F=S+1+w,N=30,U=19,$=2*F+1,G=15,H=16,J=7,ue=256,q=16,se=17,Te=18,Ue=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],de=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],me=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],pe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],W=512,re=new Array((F+2)*2);s(re);var Ee=new Array(N*2);s(Ee);var et=new Array(W);s(et);var _e=new Array(v-A+1);s(_e);var Le=new Array(w);s(Le);var Ge=new Array(N);s(Ge);function Ze(Me,kt,$t,lr,Ye){this.static_tree=Me,this.extra_bits=kt,this.extra_base=$t,this.elems=lr,this.max_length=Ye,this.has_stree=Me&&Me.length}var tt,rt,ut;function vt(Me,kt){this.dyn_tree=Me,this.max_code=0,this.stat_desc=kt}function St(Me){return Me<256?et[Me]:et[256+(Me>>>7)]}function st(Me,kt){Me.pending_buf[Me.pending++]=kt&255,Me.pending_buf[Me.pending++]=kt>>>8&255}function dr(Me,kt,$t){Me.bi_valid>H-$t?(Me.bi_buf|=kt<<Me.bi_valid&65535,st(Me,Me.bi_buf),Me.bi_buf=kt>>H-Me.bi_valid,Me.bi_valid+=$t-H):(Me.bi_buf|=kt<<Me.bi_valid&65535,Me.bi_valid+=$t)}function er(Me,kt,$t){dr(Me,$t[kt*2],$t[kt*2+1])}function Kt(Me,kt){var $t=0;do $t|=Me&1,Me>>>=1,$t<<=1;while(--kt>0);return $t>>>1}function Nt(Me){Me.bi_valid===16?(st(Me,Me.bi_buf),Me.bi_buf=0,Me.bi_valid=0):Me.bi_valid>=8&&(Me.pending_buf[Me.pending++]=Me.bi_buf&255,Me.bi_buf>>=8,Me.bi_valid-=8)}function Ar(Me,kt){var $t=kt.dyn_tree,lr=kt.max_code,Ye=kt.stat_desc.static_tree,Rt=kt.stat_desc.has_stree,Ae=kt.stat_desc.extra_bits,Gt=kt.stat_desc.extra_base,Tt=kt.stat_desc.max_length,j,bt,Bt,Ce,Je,lt,Y=0;for(Ce=0;Ce<=G;Ce++)Me.bl_count[Ce]=0;for($t[Me.heap[Me.heap_max]*2+1]=0,j=Me.heap_max+1;j<$;j++)bt=Me.heap[j],Ce=$t[$t[bt*2+1]*2+1]+1,Ce>Tt&&(Ce=Tt,Y++),$t[bt*2+1]=Ce,!(bt>lr)&&(Me.bl_count[Ce]++,Je=0,bt>=Gt&&(Je=Ae[bt-Gt]),lt=$t[bt*2],Me.opt_len+=lt*(Ce+Je),Rt&&(Me.static_len+=lt*(Ye[bt*2+1]+Je)));if(Y!==0){do{for(Ce=Tt-1;Me.bl_count[Ce]===0;)Ce--;Me.bl_count[Ce]--,Me.bl_count[Ce+1]+=2,Me.bl_count[Tt]--,Y-=2}while(Y>0);for(Ce=Tt;Ce!==0;Ce--)for(bt=Me.bl_count[Ce];bt!==0;)Bt=Me.heap[--j],!(Bt>lr)&&($t[Bt*2+1]!==Ce&&(Me.opt_len+=(Ce-$t[Bt*2+1])*$t[Bt*2],$t[Bt*2+1]=Ce),bt--)}}function ln(Me,kt,$t){var lr=new Array(G+1),Ye=0,Rt,Ae;for(Rt=1;Rt<=G;Rt++)lr[Rt]=Ye=Ye+$t[Rt-1]<<1;for(Ae=0;Ae<=kt;Ae++){var Gt=Me[Ae*2+1];Gt!==0&&(Me[Ae*2]=Kt(lr[Gt]++,Gt))}}function Pr(){var Me,kt,$t,lr,Ye,Rt=new Array(G+1);for($t=0,lr=0;lr<w-1;lr++)for(Le[lr]=$t,Me=0;Me<1<<Ue[lr];Me++)_e[$t++]=lr;for(_e[$t-1]=lr,Ye=0,lr=0;lr<16;lr++)for(Ge[lr]=Ye,Me=0;Me<1<<de[lr];Me++)et[Ye++]=lr;for(Ye>>=7;lr<N;lr++)for(Ge[lr]=Ye<<7,Me=0;Me<1<<de[lr]-7;Me++)et[256+Ye++]=lr;for(kt=0;kt<=G;kt++)Rt[kt]=0;for(Me=0;Me<=143;)re[Me*2+1]=8,Me++,Rt[8]++;for(;Me<=255;)re[Me*2+1]=9,Me++,Rt[9]++;for(;Me<=279;)re[Me*2+1]=7,Me++,Rt[7]++;for(;Me<=287;)re[Me*2+1]=8,Me++,Rt[8]++;for(ln(re,F+1,Rt),Me=0;Me<N;Me++)Ee[Me*2+1]=5,Ee[Me*2]=Kt(Me,5);tt=new Ze(re,Ue,S+1,F,G),rt=new Ze(Ee,de,0,N,G),ut=new Ze(new Array(0),me,0,U,J)}function xr(Me){var kt;for(kt=0;kt<F;kt++)Me.dyn_ltree[kt*2]=0;for(kt=0;kt<N;kt++)Me.dyn_dtree[kt*2]=0;for(kt=0;kt<U;kt++)Me.bl_tree[kt*2]=0;Me.dyn_ltree[ue*2]=1,Me.opt_len=Me.static_len=0,Me.last_lit=Me.matches=0}function Vn(Me){Me.bi_valid>8?st(Me,Me.bi_buf):Me.bi_valid>0&&(Me.pending_buf[Me.pending++]=Me.bi_buf),Me.bi_buf=0,Me.bi_valid=0}function _r(Me,kt,$t,lr){Vn(Me),st(Me,$t),st(Me,~$t),r.arraySet(Me.pending_buf,Me.window,kt,$t,Me.pending),Me.pending+=$t}function yr(Me,kt,$t,lr){var Ye=kt*2,Rt=$t*2;return Me[Ye]<Me[Rt]||Me[Ye]===Me[Rt]&&lr[kt]<=lr[$t]}function un(Me,kt,$t){for(var lr=Me.heap[$t],Ye=$t<<1;Ye<=Me.heap_len&&(Ye<Me.heap_len&&yr(kt,Me.heap[Ye+1],Me.heap[Ye],Me.depth)&&Ye++,!yr(kt,lr,Me.heap[Ye],Me.depth));)Me.heap[$t]=Me.heap[Ye],$t=Ye,Ye<<=1;Me.heap[$t]=lr}function Dr(Me,kt,$t){var lr,Ye,Rt=0,Ae,Gt;if(Me.last_lit!==0)do lr=Me.pending_buf[Me.d_buf+Rt*2]<<8|Me.pending_buf[Me.d_buf+Rt*2+1],Ye=Me.pending_buf[Me.l_buf+Rt],Rt++,lr===0?er(Me,Ye,kt):(Ae=_e[Ye],er(Me,Ae+S+1,kt),Gt=Ue[Ae],Gt!==0&&(Ye-=Le[Ae],dr(Me,Ye,Gt)),lr--,Ae=St(lr),er(Me,Ae,$t),Gt=de[Ae],Gt!==0&&(lr-=Ge[Ae],dr(Me,lr,Gt)));while(Rt<Me.last_lit);er(Me,ue,kt)}function ci(Me,kt){var $t=kt.dyn_tree,lr=kt.stat_desc.static_tree,Ye=kt.stat_desc.has_stree,Rt=kt.stat_desc.elems,Ae,Gt,Tt=-1,j;for(Me.heap_len=0,Me.heap_max=$,Ae=0;Ae<Rt;Ae++)$t[Ae*2]!==0?(Me.heap[++Me.heap_len]=Tt=Ae,Me.depth[Ae]=0):$t[Ae*2+1]=0;for(;Me.heap_len<2;)j=Me.heap[++Me.heap_len]=Tt<2?++Tt:0,$t[j*2]=1,Me.depth[j]=0,Me.opt_len--,Ye&&(Me.static_len-=lr[j*2+1]);for(kt.max_code=Tt,Ae=Me.heap_len>>1;Ae>=1;Ae--)un(Me,$t,Ae);j=Rt;do Ae=Me.heap[1],Me.heap[1]=Me.heap[Me.heap_len--],un(Me,$t,1),Gt=Me.heap[1],Me.heap[--Me.heap_max]=Ae,Me.heap[--Me.heap_max]=Gt,$t[j*2]=$t[Ae*2]+$t[Gt*2],Me.depth[j]=(Me.depth[Ae]>=Me.depth[Gt]?Me.depth[Ae]:Me.depth[Gt])+1,$t[Ae*2+1]=$t[Gt*2+1]=j,Me.heap[1]=j++,un(Me,$t,1);while(Me.heap_len>=2);Me.heap[--Me.heap_max]=Me.heap[1],Ar(Me,kt),ln($t,Tt,Me.bl_count)}function Yn(Me,kt,$t){var lr,Ye=-1,Rt,Ae=kt[0*2+1],Gt=0,Tt=7,j=4;for(Ae===0&&(Tt=138,j=3),kt[($t+1)*2+1]=65535,lr=0;lr<=$t;lr++)Rt=Ae,Ae=kt[(lr+1)*2+1],!(++Gt<Tt&&Rt===Ae)&&(Gt<j?Me.bl_tree[Rt*2]+=Gt:Rt!==0?(Rt!==Ye&&Me.bl_tree[Rt*2]++,Me.bl_tree[q*2]++):Gt<=10?Me.bl_tree[se*2]++:Me.bl_tree[Te*2]++,Gt=0,Ye=Rt,Ae===0?(Tt=138,j=3):Rt===Ae?(Tt=6,j=3):(Tt=7,j=4))}function mn(Me,kt,$t){var lr,Ye=-1,Rt,Ae=kt[0*2+1],Gt=0,Tt=7,j=4;for(Ae===0&&(Tt=138,j=3),lr=0;lr<=$t;lr++)if(Rt=Ae,Ae=kt[(lr+1)*2+1],!(++Gt<Tt&&Rt===Ae)){if(Gt<j)do er(Me,Rt,Me.bl_tree);while(--Gt!==0);else Rt!==0?(Rt!==Ye&&(er(Me,Rt,Me.bl_tree),Gt--),er(Me,q,Me.bl_tree),dr(Me,Gt-3,2)):Gt<=10?(er(Me,se,Me.bl_tree),dr(Me,Gt-3,3)):(er(Me,Te,Me.bl_tree),dr(Me,Gt-11,7));Gt=0,Ye=Rt,Ae===0?(Tt=138,j=3):Rt===Ae?(Tt=6,j=3):(Tt=7,j=4)}}function ti(Me){var kt;for(Yn(Me,Me.dyn_ltree,Me.l_desc.max_code),Yn(Me,Me.dyn_dtree,Me.d_desc.max_code),ci(Me,Me.bl_desc),kt=U-1;kt>=3&&Me.bl_tree[pe[kt]*2+1]===0;kt--);return Me.opt_len+=3*(kt+1)+5+5+4,kt}function Hn(Me,kt,$t,lr){var Ye;for(dr(Me,kt-257,5),dr(Me,$t-1,5),dr(Me,lr-4,4),Ye=0;Ye<lr;Ye++)dr(Me,Me.bl_tree[pe[Ye]*2+1],3);mn(Me,Me.dyn_ltree,kt-1),mn(Me,Me.dyn_dtree,$t-1)}function Bn(Me){var kt=4093624447,$t;for($t=0;$t<=31;$t++,kt>>>=1)if(kt&1&&Me.dyn_ltree[$t*2]!==0)return t;if(Me.dyn_ltree[9*2]!==0||Me.dyn_ltree[10*2]!==0||Me.dyn_ltree[13*2]!==0)return n;for($t=32;$t<S;$t++)if(Me.dyn_ltree[$t*2]!==0)return n;return t}var Zn=!1;function Vt(Me){Zn||(Pr(),Zn=!0),Me.l_desc=new vt(Me.dyn_ltree,tt),Me.d_desc=new vt(Me.dyn_dtree,rt),Me.bl_desc=new vt(Me.bl_tree,ut),Me.bi_buf=0,Me.bi_valid=0,xr(Me)}function mr(Me,kt,$t,lr){dr(Me,(o<<1)+(lr?1:0),3),_r(Me,kt,$t)}function Rr(Me){dr(Me,c<<1,3),er(Me,ue,re),Nt(Me)}function nn(Me,kt,$t,lr){var Ye,Rt,Ae=0;Me.level>0?(Me.strm.data_type===i&&(Me.strm.data_type=Bn(Me)),ci(Me,Me.l_desc),ci(Me,Me.d_desc),Ae=ti(Me),Ye=Me.opt_len+3+7>>>3,Rt=Me.static_len+3+7>>>3,Rt<=Ye&&(Ye=Rt)):Ye=Rt=$t+5,$t+4<=Ye&&kt!==-1?mr(Me,kt,$t,lr):Me.strategy===e||Rt===Ye?(dr(Me,(c<<1)+(lr?1:0),3),Dr(Me,re,Ee)):(dr(Me,(f<<1)+(lr?1:0),3),Hn(Me,Me.l_desc.max_code+1,Me.d_desc.max_code+1,Ae+1),Dr(Me,Me.dyn_ltree,Me.dyn_dtree)),xr(Me),lr&&Vn(Me)}function _i(Me,kt,$t){return Me.pending_buf[Me.d_buf+Me.last_lit*2]=kt>>>8&255,Me.pending_buf[Me.d_buf+Me.last_lit*2+1]=kt&255,Me.pending_buf[Me.l_buf+Me.last_lit]=$t&255,Me.last_lit++,kt===0?Me.dyn_ltree[$t*2]++:(Me.matches++,kt--,Me.dyn_ltree[(_e[$t]+S+1)*2]++,Me.dyn_dtree[St(kt)*2]++),Me.last_lit===Me.lit_bufsize-1}return $f._tr_init=Vt,$f._tr_stored_block=mr,$f._tr_flush_block=nn,$f._tr_tally=_i,$f._tr_align=Rr,$f}var k1,mF;function wN(){if(mF)return k1;mF=1;function r(e,t,n,i){for(var s=e&65535|0,o=e>>>16&65535|0,c=0;n!==0;){c=n>2e3?2e3:n,n-=c;do s=s+t[i++]|0,o=o+s|0;while(--c);s%=65521,o%=65521}return s|o<<16|0}return k1=r,k1}var N1,_F;function CN(){if(_F)return N1;_F=1;function r(){for(var n,i=[],s=0;s<256;s++){n=s;for(var o=0;o<8;o++)n=n&1?3988292384^n>>>1:n>>>1;i[s]=n}return i}var e=r();function t(n,i,s,o){var c=e,f=o+s;n^=-1;for(var A=o;A<f;A++)n=n>>>8^c[(n^i[A])&255];return n^-1}return N1=t,N1}var U1,yF;function lT(){return yF||(yF=1,U1={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),U1}var vF;function n1e(){if(vF)return fc;vF=1;var r=pf(),e=r1e(),t=wN(),n=CN(),i=lT(),s=0,o=1,c=3,f=4,A=5,v=0,w=1,S=-2,F=-3,N=-5,U=-1,$=1,G=2,H=3,J=4,ue=0,q=2,se=8,Te=9,Ue=15,de=8,me=29,pe=256,W=pe+1+me,re=30,Ee=19,et=2*W+1,_e=15,Le=3,Ge=258,Ze=Ge+Le+1,tt=32,rt=42,ut=69,vt=73,St=91,st=103,dr=113,er=666,Kt=1,Nt=2,Ar=3,ln=4,Pr=3;function xr(j,bt){return j.msg=i[bt],bt}function Vn(j){return(j<<1)-(j>4?9:0)}function _r(j){for(var bt=j.length;--bt>=0;)j[bt]=0}function yr(j){var bt=j.state,Bt=bt.pending;Bt>j.avail_out&&(Bt=j.avail_out),Bt!==0&&(r.arraySet(j.output,bt.pending_buf,bt.pending_out,Bt,j.next_out),j.next_out+=Bt,bt.pending_out+=Bt,j.total_out+=Bt,j.avail_out-=Bt,bt.pending-=Bt,bt.pending===0&&(bt.pending_out=0))}function un(j,bt){e._tr_flush_block(j,j.block_start>=0?j.block_start:-1,j.strstart-j.block_start,bt),j.block_start=j.strstart,yr(j.strm)}function Dr(j,bt){j.pending_buf[j.pending++]=bt}function ci(j,bt){j.pending_buf[j.pending++]=bt>>>8&255,j.pending_buf[j.pending++]=bt&255}function Yn(j,bt,Bt,Ce){var Je=j.avail_in;return Je>Ce&&(Je=Ce),Je===0?0:(j.avail_in-=Je,r.arraySet(bt,j.input,j.next_in,Je,Bt),j.state.wrap===1?j.adler=t(j.adler,bt,Je,Bt):j.state.wrap===2&&(j.adler=n(j.adler,bt,Je,Bt)),j.next_in+=Je,j.total_in+=Je,Je)}function mn(j,bt){var Bt=j.max_chain_length,Ce=j.strstart,Je,lt,Y=j.prev_length,ne=j.nice_match,le=j.strstart>j.w_size-Ze?j.strstart-(j.w_size-Ze):0,ve=j.window,Oe=j.w_mask,he=j.prev,be=j.strstart+Ge,ae=ve[Ce+Y-1],Be=ve[Ce+Y];j.prev_length>=j.good_match&&(Bt>>=2),ne>j.lookahead&&(ne=j.lookahead);do if(Je=bt,!(ve[Je+Y]!==Be||ve[Je+Y-1]!==ae||ve[Je]!==ve[Ce]||ve[++Je]!==ve[Ce+1])){Ce+=2,Je++;do;while(ve[++Ce]===ve[++Je]&&ve[++Ce]===ve[++Je]&&ve[++Ce]===ve[++Je]&&ve[++Ce]===ve[++Je]&&ve[++Ce]===ve[++Je]&&ve[++Ce]===ve[++Je]&&ve[++Ce]===ve[++Je]&&ve[++Ce]===ve[++Je]&&Ce<be);if(lt=Ge-(be-Ce),Ce=be-Ge,lt>Y){if(j.match_start=bt,Y=lt,lt>=ne)break;ae=ve[Ce+Y-1],Be=ve[Ce+Y]}}while((bt=he[bt&Oe])>le&&--Bt!==0);return Y<=j.lookahead?Y:j.lookahead}function ti(j){var bt=j.w_size,Bt,Ce,Je,lt,Y;do{if(lt=j.window_size-j.lookahead-j.strstart,j.strstart>=bt+(bt-Ze)){r.arraySet(j.window,j.window,bt,bt,0),j.match_start-=bt,j.strstart-=bt,j.block_start-=bt,Ce=j.hash_size,Bt=Ce;do Je=j.head[--Bt],j.head[Bt]=Je>=bt?Je-bt:0;while(--Ce);Ce=bt,Bt=Ce;do Je=j.prev[--Bt],j.prev[Bt]=Je>=bt?Je-bt:0;while(--Ce);lt+=bt}if(j.strm.avail_in===0)break;if(Ce=Yn(j.strm,j.window,j.strstart+j.lookahead,lt),j.lookahead+=Ce,j.lookahead+j.insert>=Le)for(Y=j.strstart-j.insert,j.ins_h=j.window[Y],j.ins_h=(j.ins_h<<j.hash_shift^j.window[Y+1])&j.hash_mask;j.insert&&(j.ins_h=(j.ins_h<<j.hash_shift^j.window[Y+Le-1])&j.hash_mask,j.prev[Y&j.w_mask]=j.head[j.ins_h],j.head[j.ins_h]=Y,Y++,j.insert--,!(j.lookahead+j.insert<Le)););}while(j.lookahead<Ze&&j.strm.avail_in!==0)}function Hn(j,bt){var Bt=65535;for(Bt>j.pending_buf_size-5&&(Bt=j.pending_buf_size-5);;){if(j.lookahead<=1){if(ti(j),j.lookahead===0&&bt===s)return Kt;if(j.lookahead===0)break}j.strstart+=j.lookahead,j.lookahead=0;var Ce=j.block_start+Bt;if((j.strstart===0||j.strstart>=Ce)&&(j.lookahead=j.strstart-Ce,j.strstart=Ce,un(j,!1),j.strm.avail_out===0)||j.strstart-j.block_start>=j.w_size-Ze&&(un(j,!1),j.strm.avail_out===0))return Kt}return j.insert=0,bt===f?(un(j,!0),j.strm.avail_out===0?Ar:ln):(j.strstart>j.block_start&&(un(j,!1),j.strm.avail_out===0),Kt)}function Bn(j,bt){for(var Bt,Ce;;){if(j.lookahead<Ze){if(ti(j),j.lookahead<Ze&&bt===s)return Kt;if(j.lookahead===0)break}if(Bt=0,j.lookahead>=Le&&(j.ins_h=(j.ins_h<<j.hash_shift^j.window[j.strstart+Le-1])&j.hash_mask,Bt=j.prev[j.strstart&j.w_mask]=j.head[j.ins_h],j.head[j.ins_h]=j.strstart),Bt!==0&&j.strstart-Bt<=j.w_size-Ze&&(j.match_length=mn(j,Bt)),j.match_length>=Le)if(Ce=e._tr_tally(j,j.strstart-j.match_start,j.match_length-Le),j.lookahead-=j.match_length,j.match_length<=j.max_lazy_match&&j.lookahead>=Le){j.match_length--;do j.strstart++,j.ins_h=(j.ins_h<<j.hash_shift^j.window[j.strstart+Le-1])&j.hash_mask,Bt=j.prev[j.strstart&j.w_mask]=j.head[j.ins_h],j.head[j.ins_h]=j.strstart;while(--j.match_length!==0);j.strstart++}else j.strstart+=j.match_length,j.match_length=0,j.ins_h=j.window[j.strstart],j.ins_h=(j.ins_h<<j.hash_shift^j.window[j.strstart+1])&j.hash_mask;else Ce=e._tr_tally(j,0,j.window[j.strstart]),j.lookahead--,j.strstart++;if(Ce&&(un(j,!1),j.strm.avail_out===0))return Kt}return j.insert=j.strstart<Le-1?j.strstart:Le-1,bt===f?(un(j,!0),j.strm.avail_out===0?Ar:ln):j.last_lit&&(un(j,!1),j.strm.avail_out===0)?Kt:Nt}function Zn(j,bt){for(var Bt,Ce,Je;;){if(j.lookahead<Ze){if(ti(j),j.lookahead<Ze&&bt===s)return Kt;if(j.lookahead===0)break}if(Bt=0,j.lookahead>=Le&&(j.ins_h=(j.ins_h<<j.hash_shift^j.window[j.strstart+Le-1])&j.hash_mask,Bt=j.prev[j.strstart&j.w_mask]=j.head[j.ins_h],j.head[j.ins_h]=j.strstart),j.prev_length=j.match_length,j.prev_match=j.match_start,j.match_length=Le-1,Bt!==0&&j.prev_length<j.max_lazy_match&&j.strstart-Bt<=j.w_size-Ze&&(j.match_length=mn(j,Bt),j.match_length<=5&&(j.strategy===$||j.match_length===Le&&j.strstart-j.match_start>4096)&&(j.match_length=Le-1)),j.prev_length>=Le&&j.match_length<=j.prev_length){Je=j.strstart+j.lookahead-Le,Ce=e._tr_tally(j,j.strstart-1-j.prev_match,j.prev_length-Le),j.lookahead-=j.prev_length-1,j.prev_length-=2;do++j.strstart<=Je&&(j.ins_h=(j.ins_h<<j.hash_shift^j.window[j.strstart+Le-1])&j.hash_mask,Bt=j.prev[j.strstart&j.w_mask]=j.head[j.ins_h],j.head[j.ins_h]=j.strstart);while(--j.prev_length!==0);if(j.match_available=0,j.match_length=Le-1,j.strstart++,Ce&&(un(j,!1),j.strm.avail_out===0))return Kt}else if(j.match_available){if(Ce=e._tr_tally(j,0,j.window[j.strstart-1]),Ce&&un(j,!1),j.strstart++,j.lookahead--,j.strm.avail_out===0)return Kt}else j.match_available=1,j.strstart++,j.lookahead--}return j.match_available&&(Ce=e._tr_tally(j,0,j.window[j.strstart-1]),j.match_available=0),j.insert=j.strstart<Le-1?j.strstart:Le-1,bt===f?(un(j,!0),j.strm.avail_out===0?Ar:ln):j.last_lit&&(un(j,!1),j.strm.avail_out===0)?Kt:Nt}function Vt(j,bt){for(var Bt,Ce,Je,lt,Y=j.window;;){if(j.lookahead<=Ge){if(ti(j),j.lookahead<=Ge&&bt===s)return Kt;if(j.lookahead===0)break}if(j.match_length=0,j.lookahead>=Le&&j.strstart>0&&(Je=j.strstart-1,Ce=Y[Je],Ce===Y[++Je]&&Ce===Y[++Je]&&Ce===Y[++Je])){lt=j.strstart+Ge;do;while(Ce===Y[++Je]&&Ce===Y[++Je]&&Ce===Y[++Je]&&Ce===Y[++Je]&&Ce===Y[++Je]&&Ce===Y[++Je]&&Ce===Y[++Je]&&Ce===Y[++Je]&&Je<lt);j.match_length=Ge-(lt-Je),j.match_length>j.lookahead&&(j.match_length=j.lookahead)}if(j.match_length>=Le?(Bt=e._tr_tally(j,1,j.match_length-Le),j.lookahead-=j.match_length,j.strstart+=j.match_length,j.match_length=0):(Bt=e._tr_tally(j,0,j.window[j.strstart]),j.lookahead--,j.strstart++),Bt&&(un(j,!1),j.strm.avail_out===0))return Kt}return j.insert=0,bt===f?(un(j,!0),j.strm.avail_out===0?Ar:ln):j.last_lit&&(un(j,!1),j.strm.avail_out===0)?Kt:Nt}function mr(j,bt){for(var Bt;;){if(j.lookahead===0&&(ti(j),j.lookahead===0)){if(bt===s)return Kt;break}if(j.match_length=0,Bt=e._tr_tally(j,0,j.window[j.strstart]),j.lookahead--,j.strstart++,Bt&&(un(j,!1),j.strm.avail_out===0))return Kt}return j.insert=0,bt===f?(un(j,!0),j.strm.avail_out===0?Ar:ln):j.last_lit&&(un(j,!1),j.strm.avail_out===0)?Kt:Nt}function Rr(j,bt,Bt,Ce,Je){this.good_length=j,this.max_lazy=bt,this.nice_length=Bt,this.max_chain=Ce,this.func=Je}var nn;nn=[new Rr(0,0,0,0,Hn),new Rr(4,4,8,4,Bn),new Rr(4,5,16,8,Bn),new Rr(4,6,32,32,Bn),new Rr(4,4,16,16,Zn),new Rr(8,16,32,32,Zn),new Rr(8,16,128,128,Zn),new Rr(8,32,128,256,Zn),new Rr(32,128,258,1024,Zn),new Rr(32,258,258,4096,Zn)];function _i(j){j.window_size=2*j.w_size,_r(j.head),j.max_lazy_match=nn[j.level].max_lazy,j.good_match=nn[j.level].good_length,j.nice_match=nn[j.level].nice_length,j.max_chain_length=nn[j.level].max_chain,j.strstart=0,j.block_start=0,j.lookahead=0,j.insert=0,j.match_length=j.prev_length=Le-1,j.match_available=0,j.ins_h=0}function Me(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=se,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(et*2),this.dyn_dtree=new r.Buf16((2*re+1)*2),this.bl_tree=new r.Buf16((2*Ee+1)*2),_r(this.dyn_ltree),_r(this.dyn_dtree),_r(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(_e+1),this.heap=new r.Buf16(2*W+1),_r(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*W+1),_r(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function kt(j){var bt;return!j||!j.state?xr(j,S):(j.total_in=j.total_out=0,j.data_type=q,bt=j.state,bt.pending=0,bt.pending_out=0,bt.wrap<0&&(bt.wrap=-bt.wrap),bt.status=bt.wrap?rt:dr,j.adler=bt.wrap===2?0:1,bt.last_flush=s,e._tr_init(bt),v)}function $t(j){var bt=kt(j);return bt===v&&_i(j.state),bt}function lr(j,bt){return!j||!j.state||j.state.wrap!==2?S:(j.state.gzhead=bt,v)}function Ye(j,bt,Bt,Ce,Je,lt){if(!j)return S;var Y=1;if(bt===U&&(bt=6),Ce<0?(Y=0,Ce=-Ce):Ce>15&&(Y=2,Ce-=16),Je<1||Je>Te||Bt!==se||Ce<8||Ce>15||bt<0||bt>9||lt<0||lt>J)return xr(j,S);Ce===8&&(Ce=9);var ne=new Me;return j.state=ne,ne.strm=j,ne.wrap=Y,ne.gzhead=null,ne.w_bits=Ce,ne.w_size=1<<ne.w_bits,ne.w_mask=ne.w_size-1,ne.hash_bits=Je+7,ne.hash_size=1<<ne.hash_bits,ne.hash_mask=ne.hash_size-1,ne.hash_shift=~~((ne.hash_bits+Le-1)/Le),ne.window=new r.Buf8(ne.w_size*2),ne.head=new r.Buf16(ne.hash_size),ne.prev=new r.Buf16(ne.w_size),ne.lit_bufsize=1<<Je+6,ne.pending_buf_size=ne.lit_bufsize*4,ne.pending_buf=new r.Buf8(ne.pending_buf_size),ne.d_buf=1*ne.lit_bufsize,ne.l_buf=3*ne.lit_bufsize,ne.level=bt,ne.strategy=lt,ne.method=Bt,$t(j)}function Rt(j,bt){return Ye(j,bt,se,Ue,de,ue)}function Ae(j,bt){var Bt,Ce,Je,lt;if(!j||!j.state||bt>A||bt<0)return j?xr(j,S):S;if(Ce=j.state,!j.output||!j.input&&j.avail_in!==0||Ce.status===er&&bt!==f)return xr(j,j.avail_out===0?N:S);if(Ce.strm=j,Bt=Ce.last_flush,Ce.last_flush=bt,Ce.status===rt)if(Ce.wrap===2)j.adler=0,Dr(Ce,31),Dr(Ce,139),Dr(Ce,8),Ce.gzhead?(Dr(Ce,(Ce.gzhead.text?1:0)+(Ce.gzhead.hcrc?2:0)+(Ce.gzhead.extra?4:0)+(Ce.gzhead.name?8:0)+(Ce.gzhead.comment?16:0)),Dr(Ce,Ce.gzhead.time&255),Dr(Ce,Ce.gzhead.time>>8&255),Dr(Ce,Ce.gzhead.time>>16&255),Dr(Ce,Ce.gzhead.time>>24&255),Dr(Ce,Ce.level===9?2:Ce.strategy>=G||Ce.level<2?4:0),Dr(Ce,Ce.gzhead.os&255),Ce.gzhead.extra&&Ce.gzhead.extra.length&&(Dr(Ce,Ce.gzhead.extra.length&255),Dr(Ce,Ce.gzhead.extra.length>>8&255)),Ce.gzhead.hcrc&&(j.adler=n(j.adler,Ce.pending_buf,Ce.pending,0)),Ce.gzindex=0,Ce.status=ut):(Dr(Ce,0),Dr(Ce,0),Dr(Ce,0),Dr(Ce,0),Dr(Ce,0),Dr(Ce,Ce.level===9?2:Ce.strategy>=G||Ce.level<2?4:0),Dr(Ce,Pr),Ce.status=dr);else{var Y=se+(Ce.w_bits-8<<4)<<8,ne=-1;Ce.strategy>=G||Ce.level<2?ne=0:Ce.level<6?ne=1:Ce.level===6?ne=2:ne=3,Y|=ne<<6,Ce.strstart!==0&&(Y|=tt),Y+=31-Y%31,Ce.status=dr,ci(Ce,Y),Ce.strstart!==0&&(ci(Ce,j.adler>>>16),ci(Ce,j.adler&65535)),j.adler=1}if(Ce.status===ut)if(Ce.gzhead.extra){for(Je=Ce.pending;Ce.gzindex<(Ce.gzhead.extra.length&65535)&&!(Ce.pending===Ce.pending_buf_size&&(Ce.gzhead.hcrc&&Ce.pending>Je&&(j.adler=n(j.adler,Ce.pending_buf,Ce.pending-Je,Je)),yr(j),Je=Ce.pending,Ce.pending===Ce.pending_buf_size));)Dr(Ce,Ce.gzhead.extra[Ce.gzindex]&255),Ce.gzindex++;Ce.gzhead.hcrc&&Ce.pending>Je&&(j.adler=n(j.adler,Ce.pending_buf,Ce.pending-Je,Je)),Ce.gzindex===Ce.gzhead.extra.length&&(Ce.gzindex=0,Ce.status=vt)}else Ce.status=vt;if(Ce.status===vt)if(Ce.gzhead.name){Je=Ce.pending;do{if(Ce.pending===Ce.pending_buf_size&&(Ce.gzhead.hcrc&&Ce.pending>Je&&(j.adler=n(j.adler,Ce.pending_buf,Ce.pending-Je,Je)),yr(j),Je=Ce.pending,Ce.pending===Ce.pending_buf_size)){lt=1;break}Ce.gzindex<Ce.gzhead.name.length?lt=Ce.gzhead.name.charCodeAt(Ce.gzindex++)&255:lt=0,Dr(Ce,lt)}while(lt!==0);Ce.gzhead.hcrc&&Ce.pending>Je&&(j.adler=n(j.adler,Ce.pending_buf,Ce.pending-Je,Je)),lt===0&&(Ce.gzindex=0,Ce.status=St)}else Ce.status=St;if(Ce.status===St)if(Ce.gzhead.comment){Je=Ce.pending;do{if(Ce.pending===Ce.pending_buf_size&&(Ce.gzhead.hcrc&&Ce.pending>Je&&(j.adler=n(j.adler,Ce.pending_buf,Ce.pending-Je,Je)),yr(j),Je=Ce.pending,Ce.pending===Ce.pending_buf_size)){lt=1;break}Ce.gzindex<Ce.gzhead.comment.length?lt=Ce.gzhead.comment.charCodeAt(Ce.gzindex++)&255:lt=0,Dr(Ce,lt)}while(lt!==0);Ce.gzhead.hcrc&&Ce.pending>Je&&(j.adler=n(j.adler,Ce.pending_buf,Ce.pending-Je,Je)),lt===0&&(Ce.status=st)}else Ce.status=st;if(Ce.status===st&&(Ce.gzhead.hcrc?(Ce.pending+2>Ce.pending_buf_size&&yr(j),Ce.pending+2<=Ce.pending_buf_size&&(Dr(Ce,j.adler&255),Dr(Ce,j.adler>>8&255),j.adler=0,Ce.status=dr)):Ce.status=dr),Ce.pending!==0){if(yr(j),j.avail_out===0)return Ce.last_flush=-1,v}else if(j.avail_in===0&&Vn(bt)<=Vn(Bt)&&bt!==f)return xr(j,N);if(Ce.status===er&&j.avail_in!==0)return xr(j,N);if(j.avail_in!==0||Ce.lookahead!==0||bt!==s&&Ce.status!==er){var le=Ce.strategy===G?mr(Ce,bt):Ce.strategy===H?Vt(Ce,bt):nn[Ce.level].func(Ce,bt);if((le===Ar||le===ln)&&(Ce.status=er),le===Kt||le===Ar)return j.avail_out===0&&(Ce.last_flush=-1),v;if(le===Nt&&(bt===o?e._tr_align(Ce):bt!==A&&(e._tr_stored_block(Ce,0,0,!1),bt===c&&(_r(Ce.head),Ce.lookahead===0&&(Ce.strstart=0,Ce.block_start=0,Ce.insert=0))),yr(j),j.avail_out===0))return Ce.last_flush=-1,v}return bt!==f?v:Ce.wrap<=0?w:(Ce.wrap===2?(Dr(Ce,j.adler&255),Dr(Ce,j.adler>>8&255),Dr(Ce,j.adler>>16&255),Dr(Ce,j.adler>>24&255),Dr(Ce,j.total_in&255),Dr(Ce,j.total_in>>8&255),Dr(Ce,j.total_in>>16&255),Dr(Ce,j.total_in>>24&255)):(ci(Ce,j.adler>>>16),ci(Ce,j.adler&65535)),yr(j),Ce.wrap>0&&(Ce.wrap=-Ce.wrap),Ce.pending!==0?v:w)}function Gt(j){var bt;return!j||!j.state?S:(bt=j.state.status,bt!==rt&&bt!==ut&&bt!==vt&&bt!==St&&bt!==st&&bt!==dr&&bt!==er?xr(j,S):(j.state=null,bt===dr?xr(j,F):v))}function Tt(j,bt){var Bt=bt.length,Ce,Je,lt,Y,ne,le,ve,Oe;if(!j||!j.state||(Ce=j.state,Y=Ce.wrap,Y===2||Y===1&&Ce.status!==rt||Ce.lookahead))return S;for(Y===1&&(j.adler=t(j.adler,bt,Bt,0)),Ce.wrap=0,Bt>=Ce.w_size&&(Y===0&&(_r(Ce.head),Ce.strstart=0,Ce.block_start=0,Ce.insert=0),Oe=new r.Buf8(Ce.w_size),r.arraySet(Oe,bt,Bt-Ce.w_size,Ce.w_size,0),bt=Oe,Bt=Ce.w_size),ne=j.avail_in,le=j.next_in,ve=j.input,j.avail_in=Bt,j.next_in=0,j.input=bt,ti(Ce);Ce.lookahead>=Le;){Je=Ce.strstart,lt=Ce.lookahead-(Le-1);do Ce.ins_h=(Ce.ins_h<<Ce.hash_shift^Ce.window[Je+Le-1])&Ce.hash_mask,Ce.prev[Je&Ce.w_mask]=Ce.head[Ce.ins_h],Ce.head[Ce.ins_h]=Je,Je++;while(--lt);Ce.strstart=Je,Ce.lookahead=Le-1,ti(Ce)}return Ce.strstart+=Ce.lookahead,Ce.block_start=Ce.strstart,Ce.insert=Ce.lookahead,Ce.lookahead=0,Ce.match_length=Ce.prev_length=Le-1,Ce.match_available=0,j.next_in=le,j.input=ve,j.avail_in=ne,Ce.wrap=Y,v}return fc.deflateInit=Rt,fc.deflateInit2=Ye,fc.deflateReset=$t,fc.deflateResetKeep=kt,fc.deflateSetHeader=lr,fc.deflate=Ae,fc.deflateEnd=Gt,fc.deflateSetDictionary=Tt,fc.deflateInfo="pako deflate (from Nodeca project)",fc}var Wf={},bF;function TN(){if(bF)return Wf;bF=1;var r=pf(),e=!0,t=!0;try{String.fromCharCode.apply(null,[0])}catch{e=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{t=!1}for(var n=new r.Buf8(256),i=0;i<256;i++)n[i]=i>=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;n[254]=n[254]=1,Wf.string2buf=function(o){var c,f,A,v,w,S=o.length,F=0;for(v=0;v<S;v++)f=o.charCodeAt(v),(f&64512)===55296&&v+1<S&&(A=o.charCodeAt(v+1),(A&64512)===56320&&(f=65536+(f-55296<<10)+(A-56320),v++)),F+=f<128?1:f<2048?2:f<65536?3:4;for(c=new r.Buf8(F),w=0,v=0;w<F;v++)f=o.charCodeAt(v),(f&64512)===55296&&v+1<S&&(A=o.charCodeAt(v+1),(A&64512)===56320&&(f=65536+(f-55296<<10)+(A-56320),v++)),f<128?c[w++]=f:f<2048?(c[w++]=192|f>>>6,c[w++]=128|f&63):f<65536?(c[w++]=224|f>>>12,c[w++]=128|f>>>6&63,c[w++]=128|f&63):(c[w++]=240|f>>>18,c[w++]=128|f>>>12&63,c[w++]=128|f>>>6&63,c[w++]=128|f&63);return c};function s(o,c){if(c<65534&&(o.subarray&&t||!o.subarray&&e))return String.fromCharCode.apply(null,r.shrinkBuf(o,c));for(var f="",A=0;A<c;A++)f+=String.fromCharCode(o[A]);return f}return Wf.buf2binstring=function(o){return s(o,o.length)},Wf.binstring2buf=function(o){for(var c=new r.Buf8(o.length),f=0,A=c.length;f<A;f++)c[f]=o.charCodeAt(f);return c},Wf.buf2string=function(o,c){var f,A,v,w,S=c||o.length,F=new Array(S*2);for(A=0,f=0;f<S;){if(v=o[f++],v<128){F[A++]=v;continue}if(w=n[v],w>4){F[A++]=65533,f+=w-1;continue}for(v&=w===2?31:w===3?15:7;w>1&&f<S;)v=v<<6|o[f++]&63,w--;if(w>1){F[A++]=65533;continue}v<65536?F[A++]=v:(v-=65536,F[A++]=55296|v>>10&1023,F[A++]=56320|v&1023)}return s(F,A)},Wf.utf8border=function(o,c){var f;for(c=c||o.length,c>o.length&&(c=o.length),f=c-1;f>=0&&(o[f]&192)===128;)f--;return f<0||f===0?c:f+n[o[f]]>c?f:c},Wf}var z1,xF;function EN(){if(xF)return z1;xF=1;function r(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return z1=r,z1}var wF;function i1e(){if(wF)return Nd;wF=1;var r=n1e(),e=pf(),t=TN(),n=lT(),i=EN(),s=Object.prototype.toString,o=0,c=4,f=0,A=1,v=2,w=-1,S=0,F=8;function N(H){if(!(this instanceof N))return new N(H);this.options=e.assign({level:w,method:F,chunkSize:16384,windowBits:15,memLevel:8,strategy:S,to:""},H||{});var J=this.options;J.raw&&J.windowBits>0?J.windowBits=-J.windowBits:J.gzip&&J.windowBits>0&&J.windowBits<16&&(J.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new i,this.strm.avail_out=0;var ue=r.deflateInit2(this.strm,J.level,J.method,J.windowBits,J.memLevel,J.strategy);if(ue!==f)throw new Error(n[ue]);if(J.header&&r.deflateSetHeader(this.strm,J.header),J.dictionary){var q;if(typeof J.dictionary=="string"?q=t.string2buf(J.dictionary):s.call(J.dictionary)==="[object ArrayBuffer]"?q=new Uint8Array(J.dictionary):q=J.dictionary,ue=r.deflateSetDictionary(this.strm,q),ue!==f)throw new Error(n[ue]);this._dict_set=!0}}N.prototype.push=function(H,J){var ue=this.strm,q=this.options.chunkSize,se,Te;if(this.ended)return!1;Te=J===~~J?J:J===!0?c:o,typeof H=="string"?ue.input=t.string2buf(H):s.call(H)==="[object ArrayBuffer]"?ue.input=new Uint8Array(H):ue.input=H,ue.next_in=0,ue.avail_in=ue.input.length;do{if(ue.avail_out===0&&(ue.output=new e.Buf8(q),ue.next_out=0,ue.avail_out=q),se=r.deflate(ue,Te),se!==A&&se!==f)return this.onEnd(se),this.ended=!0,!1;(ue.avail_out===0||ue.avail_in===0&&(Te===c||Te===v))&&(this.options.to==="string"?this.onData(t.buf2binstring(e.shrinkBuf(ue.output,ue.next_out))):this.onData(e.shrinkBuf(ue.output,ue.next_out)))}while((ue.avail_in>0||ue.avail_out===0)&&se!==A);return Te===c?(se=r.deflateEnd(this.strm),this.onEnd(se),this.ended=!0,se===f):(Te===v&&(this.onEnd(f),ue.avail_out=0),!0)},N.prototype.onData=function(H){this.chunks.push(H)},N.prototype.onEnd=function(H){H===f&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=e.flattenChunks(this.chunks)),this.chunks=[],this.err=H,this.msg=this.strm.msg};function U(H,J){var ue=new N(J);if(ue.push(H,!0),ue.err)throw ue.msg||n[ue.err];return ue.result}function $(H,J){return J=J||{},J.raw=!0,U(H,J)}function G(H,J){return J=J||{},J.gzip=!0,U(H,J)}return Nd.Deflate=N,Nd.deflate=U,Nd.deflateRaw=$,Nd.gzip=G,Nd}var Ud={},Fa={},G1,CF;function s1e(){if(CF)return G1;CF=1;var r=30,e=12;return G1=function(n,i){var s,o,c,f,A,v,w,S,F,N,U,$,G,H,J,ue,q,se,Te,Ue,de,me,pe,W,re;s=n.state,o=n.next_in,W=n.input,c=o+(n.avail_in-5),f=n.next_out,re=n.output,A=f-(i-n.avail_out),v=f+(n.avail_out-257),w=s.dmax,S=s.wsize,F=s.whave,N=s.wnext,U=s.window,$=s.hold,G=s.bits,H=s.lencode,J=s.distcode,ue=(1<<s.lenbits)-1,q=(1<<s.distbits)-1;e:do{G<15&&($+=W[o++]<<G,G+=8,$+=W[o++]<<G,G+=8),se=H[$&ue];t:for(;;){if(Te=se>>>24,$>>>=Te,G-=Te,Te=se>>>16&255,Te===0)re[f++]=se&65535;else if(Te&16){Ue=se&65535,Te&=15,Te&&(G<Te&&($+=W[o++]<<G,G+=8),Ue+=$&(1<<Te)-1,$>>>=Te,G-=Te),G<15&&($+=W[o++]<<G,G+=8,$+=W[o++]<<G,G+=8),se=J[$&q];r:for(;;){if(Te=se>>>24,$>>>=Te,G-=Te,Te=se>>>16&255,Te&16){if(de=se&65535,Te&=15,G<Te&&($+=W[o++]<<G,G+=8,G<Te&&($+=W[o++]<<G,G+=8)),de+=$&(1<<Te)-1,de>w){n.msg="invalid distance too far back",s.mode=r;break e}if($>>>=Te,G-=Te,Te=f-A,de>Te){if(Te=de-Te,Te>F&&s.sane){n.msg="invalid distance too far back",s.mode=r;break e}if(me=0,pe=U,N===0){if(me+=S-Te,Te<Ue){Ue-=Te;do re[f++]=U[me++];while(--Te);me=f-de,pe=re}}else if(N<Te){if(me+=S+N-Te,Te-=N,Te<Ue){Ue-=Te;do re[f++]=U[me++];while(--Te);if(me=0,N<Ue){Te=N,Ue-=Te;do re[f++]=U[me++];while(--Te);me=f-de,pe=re}}}else if(me+=N-Te,Te<Ue){Ue-=Te;do re[f++]=U[me++];while(--Te);me=f-de,pe=re}for(;Ue>2;)re[f++]=pe[me++],re[f++]=pe[me++],re[f++]=pe[me++],Ue-=3;Ue&&(re[f++]=pe[me++],Ue>1&&(re[f++]=pe[me++]))}else{me=f-de;do re[f++]=re[me++],re[f++]=re[me++],re[f++]=re[me++],Ue-=3;while(Ue>2);Ue&&(re[f++]=re[me++],Ue>1&&(re[f++]=re[me++]))}}else if((Te&64)===0){se=J[(se&65535)+($&(1<<Te)-1)];continue r}else{n.msg="invalid distance code",s.mode=r;break e}break}}else if((Te&64)===0){se=H[(se&65535)+($&(1<<Te)-1)];continue t}else if(Te&32){s.mode=e;break e}else{n.msg="invalid literal/length code",s.mode=r;break e}break}}while(o<c&&f<v);Ue=G>>3,o-=Ue,G-=Ue<<3,$&=(1<<G)-1,n.next_in=o,n.next_out=f,n.avail_in=o<c?5+(c-o):5-(o-c),n.avail_out=f<v?257+(v-f):257-(f-v),s.hold=$,s.bits=G},G1}var V1,TF;function o1e(){if(TF)return V1;TF=1;var r=pf(),e=15,t=852,n=592,i=0,s=1,o=2,c=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],A=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],v=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return V1=function(S,F,N,U,$,G,H,J){var ue=J.bits,q=0,se=0,Te=0,Ue=0,de=0,me=0,pe=0,W=0,re=0,Ee=0,et,_e,Le,Ge,Ze,tt=null,rt=0,ut,vt=new r.Buf16(e+1),St=new r.Buf16(e+1),st=null,dr=0,er,Kt,Nt;for(q=0;q<=e;q++)vt[q]=0;for(se=0;se<U;se++)vt[F[N+se]]++;for(de=ue,Ue=e;Ue>=1&&vt[Ue]===0;Ue--);if(de>Ue&&(de=Ue),Ue===0)return $[G++]=1<<24|64<<16|0,$[G++]=1<<24|64<<16|0,J.bits=1,0;for(Te=1;Te<Ue&&vt[Te]===0;Te++);for(de<Te&&(de=Te),W=1,q=1;q<=e;q++)if(W<<=1,W-=vt[q],W<0)return-1;if(W>0&&(S===i||Ue!==1))return-1;for(St[1]=0,q=1;q<e;q++)St[q+1]=St[q]+vt[q];for(se=0;se<U;se++)F[N+se]!==0&&(H[St[F[N+se]]++]=se);if(S===i?(tt=st=H,ut=19):S===s?(tt=c,rt-=257,st=f,dr-=257,ut=256):(tt=A,st=v,ut=-1),Ee=0,se=0,q=Te,Ze=G,me=de,pe=0,Le=-1,re=1<<de,Ge=re-1,S===s&&re>t||S===o&&re>n)return 1;for(;;){er=q-pe,H[se]<ut?(Kt=0,Nt=H[se]):H[se]>ut?(Kt=st[dr+H[se]],Nt=tt[rt+H[se]]):(Kt=96,Nt=0),et=1<<q-pe,_e=1<<me,Te=_e;do _e-=et,$[Ze+(Ee>>pe)+_e]=er<<24|Kt<<16|Nt|0;while(_e!==0);for(et=1<<q-1;Ee&et;)et>>=1;if(et!==0?(Ee&=et-1,Ee+=et):Ee=0,se++,--vt[q]===0){if(q===Ue)break;q=F[N+H[se]]}if(q>de&&(Ee&Ge)!==Le){for(pe===0&&(pe=de),Ze+=Te,me=q-pe,W=1<<me;me+pe<Ue&&(W-=vt[me+pe],!(W<=0));)me++,W<<=1;if(re+=1<<me,S===s&&re>t||S===o&&re>n)return 1;Le=Ee&Ge,$[Le]=de<<24|me<<16|Ze-G|0}}return Ee!==0&&($[Ze+Ee]=q-pe<<24|64<<16|0),J.bits=de,0},V1}var EF;function a1e(){if(EF)return Fa;EF=1;var r=pf(),e=wN(),t=CN(),n=s1e(),i=o1e(),s=0,o=1,c=2,f=4,A=5,v=6,w=0,S=1,F=2,N=-2,U=-3,$=-4,G=-5,H=8,J=1,ue=2,q=3,se=4,Te=5,Ue=6,de=7,me=8,pe=9,W=10,re=11,Ee=12,et=13,_e=14,Le=15,Ge=16,Ze=17,tt=18,rt=19,ut=20,vt=21,St=22,st=23,dr=24,er=25,Kt=26,Nt=27,Ar=28,ln=29,Pr=30,xr=31,Vn=32,_r=852,yr=592,un=15,Dr=un;function ci(Ye){return(Ye>>>24&255)+(Ye>>>8&65280)+((Ye&65280)<<8)+((Ye&255)<<24)}function Yn(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function mn(Ye){var Rt;return!Ye||!Ye.state?N:(Rt=Ye.state,Ye.total_in=Ye.total_out=Rt.total=0,Ye.msg="",Rt.wrap&&(Ye.adler=Rt.wrap&1),Rt.mode=J,Rt.last=0,Rt.havedict=0,Rt.dmax=32768,Rt.head=null,Rt.hold=0,Rt.bits=0,Rt.lencode=Rt.lendyn=new r.Buf32(_r),Rt.distcode=Rt.distdyn=new r.Buf32(yr),Rt.sane=1,Rt.back=-1,w)}function ti(Ye){var Rt;return!Ye||!Ye.state?N:(Rt=Ye.state,Rt.wsize=0,Rt.whave=0,Rt.wnext=0,mn(Ye))}function Hn(Ye,Rt){var Ae,Gt;return!Ye||!Ye.state||(Gt=Ye.state,Rt<0?(Ae=0,Rt=-Rt):(Ae=(Rt>>4)+1,Rt<48&&(Rt&=15)),Rt&&(Rt<8||Rt>15))?N:(Gt.window!==null&&Gt.wbits!==Rt&&(Gt.window=null),Gt.wrap=Ae,Gt.wbits=Rt,ti(Ye))}function Bn(Ye,Rt){var Ae,Gt;return Ye?(Gt=new Yn,Ye.state=Gt,Gt.window=null,Ae=Hn(Ye,Rt),Ae!==w&&(Ye.state=null),Ae):N}function Zn(Ye){return Bn(Ye,Dr)}var Vt=!0,mr,Rr;function nn(Ye){if(Vt){var Rt;for(mr=new r.Buf32(512),Rr=new r.Buf32(32),Rt=0;Rt<144;)Ye.lens[Rt++]=8;for(;Rt<256;)Ye.lens[Rt++]=9;for(;Rt<280;)Ye.lens[Rt++]=7;for(;Rt<288;)Ye.lens[Rt++]=8;for(i(o,Ye.lens,0,288,mr,0,Ye.work,{bits:9}),Rt=0;Rt<32;)Ye.lens[Rt++]=5;i(c,Ye.lens,0,32,Rr,0,Ye.work,{bits:5}),Vt=!1}Ye.lencode=mr,Ye.lenbits=9,Ye.distcode=Rr,Ye.distbits=5}function _i(Ye,Rt,Ae,Gt){var Tt,j=Ye.state;return j.window===null&&(j.wsize=1<<j.wbits,j.wnext=0,j.whave=0,j.window=new r.Buf8(j.wsize)),Gt>=j.wsize?(r.arraySet(j.window,Rt,Ae-j.wsize,j.wsize,0),j.wnext=0,j.whave=j.wsize):(Tt=j.wsize-j.wnext,Tt>Gt&&(Tt=Gt),r.arraySet(j.window,Rt,Ae-Gt,Tt,j.wnext),Gt-=Tt,Gt?(r.arraySet(j.window,Rt,Ae-Gt,Gt,0),j.wnext=Gt,j.whave=j.wsize):(j.wnext+=Tt,j.wnext===j.wsize&&(j.wnext=0),j.whave<j.wsize&&(j.whave+=Tt))),0}function Me(Ye,Rt){var Ae,Gt,Tt,j,bt,Bt,Ce,Je,lt,Y,ne,le,ve,Oe,he=0,be,ae,Be,g,ce,xt,Ke,Et,Pt=new r.Buf8(4),Ot,ht,Lt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!Ye||!Ye.state||!Ye.output||!Ye.input&&Ye.avail_in!==0)return N;Ae=Ye.state,Ae.mode===Ee&&(Ae.mode=et),bt=Ye.next_out,Tt=Ye.output,Ce=Ye.avail_out,j=Ye.next_in,Gt=Ye.input,Bt=Ye.avail_in,Je=Ae.hold,lt=Ae.bits,Y=Bt,ne=Ce,Et=w;e:for(;;)switch(Ae.mode){case J:if(Ae.wrap===0){Ae.mode=et;break}for(;lt<16;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if(Ae.wrap&2&&Je===35615){Ae.check=0,Pt[0]=Je&255,Pt[1]=Je>>>8&255,Ae.check=t(Ae.check,Pt,2,0),Je=0,lt=0,Ae.mode=ue;break}if(Ae.flags=0,Ae.head&&(Ae.head.done=!1),!(Ae.wrap&1)||(((Je&255)<<8)+(Je>>8))%31){Ye.msg="incorrect header check",Ae.mode=Pr;break}if((Je&15)!==H){Ye.msg="unknown compression method",Ae.mode=Pr;break}if(Je>>>=4,lt-=4,Ke=(Je&15)+8,Ae.wbits===0)Ae.wbits=Ke;else if(Ke>Ae.wbits){Ye.msg="invalid window size",Ae.mode=Pr;break}Ae.dmax=1<<Ke,Ye.adler=Ae.check=1,Ae.mode=Je&512?W:Ee,Je=0,lt=0;break;case ue:for(;lt<16;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if(Ae.flags=Je,(Ae.flags&255)!==H){Ye.msg="unknown compression method",Ae.mode=Pr;break}if(Ae.flags&57344){Ye.msg="unknown header flags set",Ae.mode=Pr;break}Ae.head&&(Ae.head.text=Je>>8&1),Ae.flags&512&&(Pt[0]=Je&255,Pt[1]=Je>>>8&255,Ae.check=t(Ae.check,Pt,2,0)),Je=0,lt=0,Ae.mode=q;case q:for(;lt<32;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Ae.head&&(Ae.head.time=Je),Ae.flags&512&&(Pt[0]=Je&255,Pt[1]=Je>>>8&255,Pt[2]=Je>>>16&255,Pt[3]=Je>>>24&255,Ae.check=t(Ae.check,Pt,4,0)),Je=0,lt=0,Ae.mode=se;case se:for(;lt<16;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Ae.head&&(Ae.head.xflags=Je&255,Ae.head.os=Je>>8),Ae.flags&512&&(Pt[0]=Je&255,Pt[1]=Je>>>8&255,Ae.check=t(Ae.check,Pt,2,0)),Je=0,lt=0,Ae.mode=Te;case Te:if(Ae.flags&1024){for(;lt<16;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Ae.length=Je,Ae.head&&(Ae.head.extra_len=Je),Ae.flags&512&&(Pt[0]=Je&255,Pt[1]=Je>>>8&255,Ae.check=t(Ae.check,Pt,2,0)),Je=0,lt=0}else Ae.head&&(Ae.head.extra=null);Ae.mode=Ue;case Ue:if(Ae.flags&1024&&(le=Ae.length,le>Bt&&(le=Bt),le&&(Ae.head&&(Ke=Ae.head.extra_len-Ae.length,Ae.head.extra||(Ae.head.extra=new Array(Ae.head.extra_len)),r.arraySet(Ae.head.extra,Gt,j,le,Ke)),Ae.flags&512&&(Ae.check=t(Ae.check,Gt,le,j)),Bt-=le,j+=le,Ae.length-=le),Ae.length))break e;Ae.length=0,Ae.mode=de;case de:if(Ae.flags&2048){if(Bt===0)break e;le=0;do Ke=Gt[j+le++],Ae.head&&Ke&&Ae.length<65536&&(Ae.head.name+=String.fromCharCode(Ke));while(Ke&&le<Bt);if(Ae.flags&512&&(Ae.check=t(Ae.check,Gt,le,j)),Bt-=le,j+=le,Ke)break e}else Ae.head&&(Ae.head.name=null);Ae.length=0,Ae.mode=me;case me:if(Ae.flags&4096){if(Bt===0)break e;le=0;do Ke=Gt[j+le++],Ae.head&&Ke&&Ae.length<65536&&(Ae.head.comment+=String.fromCharCode(Ke));while(Ke&&le<Bt);if(Ae.flags&512&&(Ae.check=t(Ae.check,Gt,le,j)),Bt-=le,j+=le,Ke)break e}else Ae.head&&(Ae.head.comment=null);Ae.mode=pe;case pe:if(Ae.flags&512){for(;lt<16;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if(Je!==(Ae.check&65535)){Ye.msg="header crc mismatch",Ae.mode=Pr;break}Je=0,lt=0}Ae.head&&(Ae.head.hcrc=Ae.flags>>9&1,Ae.head.done=!0),Ye.adler=Ae.check=0,Ae.mode=Ee;break;case W:for(;lt<32;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Ye.adler=Ae.check=ci(Je),Je=0,lt=0,Ae.mode=re;case re:if(Ae.havedict===0)return Ye.next_out=bt,Ye.avail_out=Ce,Ye.next_in=j,Ye.avail_in=Bt,Ae.hold=Je,Ae.bits=lt,F;Ye.adler=Ae.check=1,Ae.mode=Ee;case Ee:if(Rt===A||Rt===v)break e;case et:if(Ae.last){Je>>>=lt&7,lt-=lt&7,Ae.mode=Nt;break}for(;lt<3;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}switch(Ae.last=Je&1,Je>>>=1,lt-=1,Je&3){case 0:Ae.mode=_e;break;case 1:if(nn(Ae),Ae.mode=ut,Rt===v){Je>>>=2,lt-=2;break e}break;case 2:Ae.mode=Ze;break;case 3:Ye.msg="invalid block type",Ae.mode=Pr}Je>>>=2,lt-=2;break;case _e:for(Je>>>=lt&7,lt-=lt&7;lt<32;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if((Je&65535)!==(Je>>>16^65535)){Ye.msg="invalid stored block lengths",Ae.mode=Pr;break}if(Ae.length=Je&65535,Je=0,lt=0,Ae.mode=Le,Rt===v)break e;case Le:Ae.mode=Ge;case Ge:if(le=Ae.length,le){if(le>Bt&&(le=Bt),le>Ce&&(le=Ce),le===0)break e;r.arraySet(Tt,Gt,j,le,bt),Bt-=le,j+=le,Ce-=le,bt+=le,Ae.length-=le;break}Ae.mode=Ee;break;case Ze:for(;lt<14;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if(Ae.nlen=(Je&31)+257,Je>>>=5,lt-=5,Ae.ndist=(Je&31)+1,Je>>>=5,lt-=5,Ae.ncode=(Je&15)+4,Je>>>=4,lt-=4,Ae.nlen>286||Ae.ndist>30){Ye.msg="too many length or distance symbols",Ae.mode=Pr;break}Ae.have=0,Ae.mode=tt;case tt:for(;Ae.have<Ae.ncode;){for(;lt<3;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Ae.lens[Lt[Ae.have++]]=Je&7,Je>>>=3,lt-=3}for(;Ae.have<19;)Ae.lens[Lt[Ae.have++]]=0;if(Ae.lencode=Ae.lendyn,Ae.lenbits=7,Ot={bits:Ae.lenbits},Et=i(s,Ae.lens,0,19,Ae.lencode,0,Ae.work,Ot),Ae.lenbits=Ot.bits,Et){Ye.msg="invalid code lengths set",Ae.mode=Pr;break}Ae.have=0,Ae.mode=rt;case rt:for(;Ae.have<Ae.nlen+Ae.ndist;){for(;he=Ae.lencode[Je&(1<<Ae.lenbits)-1],be=he>>>24,ae=he>>>16&255,Be=he&65535,!(be<=lt);){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if(Be<16)Je>>>=be,lt-=be,Ae.lens[Ae.have++]=Be;else{if(Be===16){for(ht=be+2;lt<ht;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if(Je>>>=be,lt-=be,Ae.have===0){Ye.msg="invalid bit length repeat",Ae.mode=Pr;break}Ke=Ae.lens[Ae.have-1],le=3+(Je&3),Je>>>=2,lt-=2}else if(Be===17){for(ht=be+3;lt<ht;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Je>>>=be,lt-=be,Ke=0,le=3+(Je&7),Je>>>=3,lt-=3}else{for(ht=be+7;lt<ht;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Je>>>=be,lt-=be,Ke=0,le=11+(Je&127),Je>>>=7,lt-=7}if(Ae.have+le>Ae.nlen+Ae.ndist){Ye.msg="invalid bit length repeat",Ae.mode=Pr;break}for(;le--;)Ae.lens[Ae.have++]=Ke}}if(Ae.mode===Pr)break;if(Ae.lens[256]===0){Ye.msg="invalid code -- missing end-of-block",Ae.mode=Pr;break}if(Ae.lenbits=9,Ot={bits:Ae.lenbits},Et=i(o,Ae.lens,0,Ae.nlen,Ae.lencode,0,Ae.work,Ot),Ae.lenbits=Ot.bits,Et){Ye.msg="invalid literal/lengths set",Ae.mode=Pr;break}if(Ae.distbits=6,Ae.distcode=Ae.distdyn,Ot={bits:Ae.distbits},Et=i(c,Ae.lens,Ae.nlen,Ae.ndist,Ae.distcode,0,Ae.work,Ot),Ae.distbits=Ot.bits,Et){Ye.msg="invalid distances set",Ae.mode=Pr;break}if(Ae.mode=ut,Rt===v)break e;case ut:Ae.mode=vt;case vt:if(Bt>=6&&Ce>=258){Ye.next_out=bt,Ye.avail_out=Ce,Ye.next_in=j,Ye.avail_in=Bt,Ae.hold=Je,Ae.bits=lt,n(Ye,ne),bt=Ye.next_out,Tt=Ye.output,Ce=Ye.avail_out,j=Ye.next_in,Gt=Ye.input,Bt=Ye.avail_in,Je=Ae.hold,lt=Ae.bits,Ae.mode===Ee&&(Ae.back=-1);break}for(Ae.back=0;he=Ae.lencode[Je&(1<<Ae.lenbits)-1],be=he>>>24,ae=he>>>16&255,Be=he&65535,!(be<=lt);){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if(ae&&(ae&240)===0){for(g=be,ce=ae,xt=Be;he=Ae.lencode[xt+((Je&(1<<g+ce)-1)>>g)],be=he>>>24,ae=he>>>16&255,Be=he&65535,!(g+be<=lt);){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Je>>>=g,lt-=g,Ae.back+=g}if(Je>>>=be,lt-=be,Ae.back+=be,Ae.length=Be,ae===0){Ae.mode=Kt;break}if(ae&32){Ae.back=-1,Ae.mode=Ee;break}if(ae&64){Ye.msg="invalid literal/length code",Ae.mode=Pr;break}Ae.extra=ae&15,Ae.mode=St;case St:if(Ae.extra){for(ht=Ae.extra;lt<ht;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Ae.length+=Je&(1<<Ae.extra)-1,Je>>>=Ae.extra,lt-=Ae.extra,Ae.back+=Ae.extra}Ae.was=Ae.length,Ae.mode=st;case st:for(;he=Ae.distcode[Je&(1<<Ae.distbits)-1],be=he>>>24,ae=he>>>16&255,Be=he&65535,!(be<=lt);){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if((ae&240)===0){for(g=be,ce=ae,xt=Be;he=Ae.distcode[xt+((Je&(1<<g+ce)-1)>>g)],be=he>>>24,ae=he>>>16&255,Be=he&65535,!(g+be<=lt);){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Je>>>=g,lt-=g,Ae.back+=g}if(Je>>>=be,lt-=be,Ae.back+=be,ae&64){Ye.msg="invalid distance code",Ae.mode=Pr;break}Ae.offset=Be,Ae.extra=ae&15,Ae.mode=dr;case dr:if(Ae.extra){for(ht=Ae.extra;lt<ht;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}Ae.offset+=Je&(1<<Ae.extra)-1,Je>>>=Ae.extra,lt-=Ae.extra,Ae.back+=Ae.extra}if(Ae.offset>Ae.dmax){Ye.msg="invalid distance too far back",Ae.mode=Pr;break}Ae.mode=er;case er:if(Ce===0)break e;if(le=ne-Ce,Ae.offset>le){if(le=Ae.offset-le,le>Ae.whave&&Ae.sane){Ye.msg="invalid distance too far back",Ae.mode=Pr;break}le>Ae.wnext?(le-=Ae.wnext,ve=Ae.wsize-le):ve=Ae.wnext-le,le>Ae.length&&(le=Ae.length),Oe=Ae.window}else Oe=Tt,ve=bt-Ae.offset,le=Ae.length;le>Ce&&(le=Ce),Ce-=le,Ae.length-=le;do Tt[bt++]=Oe[ve++];while(--le);Ae.length===0&&(Ae.mode=vt);break;case Kt:if(Ce===0)break e;Tt[bt++]=Ae.length,Ce--,Ae.mode=vt;break;case Nt:if(Ae.wrap){for(;lt<32;){if(Bt===0)break e;Bt--,Je|=Gt[j++]<<lt,lt+=8}if(ne-=Ce,Ye.total_out+=ne,Ae.total+=ne,ne&&(Ye.adler=Ae.check=Ae.flags?t(Ae.check,Tt,ne,bt-ne):e(Ae.check,Tt,ne,bt-ne)),ne=Ce,(Ae.flags?Je:ci(Je))!==Ae.check){Ye.msg="incorrect data check",Ae.mode=Pr;break}Je=0,lt=0}Ae.mode=Ar;case Ar:if(Ae.wrap&&Ae.flags){for(;lt<32;){if(Bt===0)break e;Bt--,Je+=Gt[j++]<<lt,lt+=8}if(Je!==(Ae.total&4294967295)){Ye.msg="incorrect length check",Ae.mode=Pr;break}Je=0,lt=0}Ae.mode=ln;case ln:Et=S;break e;case Pr:Et=U;break e;case xr:return $;case Vn:default:return N}return Ye.next_out=bt,Ye.avail_out=Ce,Ye.next_in=j,Ye.avail_in=Bt,Ae.hold=Je,Ae.bits=lt,(Ae.wsize||ne!==Ye.avail_out&&Ae.mode<Pr&&(Ae.mode<Nt||Rt!==f))&&_i(Ye,Ye.output,Ye.next_out,ne-Ye.avail_out),Y-=Ye.avail_in,ne-=Ye.avail_out,Ye.total_in+=Y,Ye.total_out+=ne,Ae.total+=ne,Ae.wrap&&ne&&(Ye.adler=Ae.check=Ae.flags?t(Ae.check,Tt,ne,Ye.next_out-ne):e(Ae.check,Tt,ne,Ye.next_out-ne)),Ye.data_type=Ae.bits+(Ae.last?64:0)+(Ae.mode===Ee?128:0)+(Ae.mode===ut||Ae.mode===Le?256:0),(Y===0&&ne===0||Rt===f)&&Et===w&&(Et=G),Et}function kt(Ye){if(!Ye||!Ye.state)return N;var Rt=Ye.state;return Rt.window&&(Rt.window=null),Ye.state=null,w}function $t(Ye,Rt){var Ae;return!Ye||!Ye.state||(Ae=Ye.state,(Ae.wrap&2)===0)?N:(Ae.head=Rt,Rt.done=!1,w)}function lr(Ye,Rt){var Ae=Rt.length,Gt,Tt,j;return!Ye||!Ye.state||(Gt=Ye.state,Gt.wrap!==0&&Gt.mode!==re)?N:Gt.mode===re&&(Tt=1,Tt=e(Tt,Rt,Ae,0),Tt!==Gt.check)?U:(j=_i(Ye,Rt,Ae,Ae),j?(Gt.mode=xr,$):(Gt.havedict=1,w))}return Fa.inflateReset=ti,Fa.inflateReset2=Hn,Fa.inflateResetKeep=mn,Fa.inflateInit=Zn,Fa.inflateInit2=Bn,Fa.inflate=Me,Fa.inflateEnd=kt,Fa.inflateGetHeader=$t,Fa.inflateSetDictionary=lr,Fa.inflateInfo="pako inflate (from Nodeca project)",Fa}var H1,BF;function BN(){return BF||(BF=1,H1={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),H1}var j1,SF;function c1e(){if(SF)return j1;SF=1;function r(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}return j1=r,j1}var IF;function l1e(){if(IF)return Ud;IF=1;var r=a1e(),e=pf(),t=TN(),n=BN(),i=lT(),s=EN(),o=c1e(),c=Object.prototype.toString;function f(w){if(!(this instanceof f))return new f(w);this.options=e.assign({chunkSize:16384,windowBits:0,to:""},w||{});var S=this.options;S.raw&&S.windowBits>=0&&S.windowBits<16&&(S.windowBits=-S.windowBits,S.windowBits===0&&(S.windowBits=-15)),S.windowBits>=0&&S.windowBits<16&&!(w&&w.windowBits)&&(S.windowBits+=32),S.windowBits>15&&S.windowBits<48&&(S.windowBits&15)===0&&(S.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var F=r.inflateInit2(this.strm,S.windowBits);if(F!==n.Z_OK)throw new Error(i[F]);if(this.header=new o,r.inflateGetHeader(this.strm,this.header),S.dictionary&&(typeof S.dictionary=="string"?S.dictionary=t.string2buf(S.dictionary):c.call(S.dictionary)==="[object ArrayBuffer]"&&(S.dictionary=new Uint8Array(S.dictionary)),S.raw&&(F=r.inflateSetDictionary(this.strm,S.dictionary),F!==n.Z_OK)))throw new Error(i[F])}f.prototype.push=function(w,S){var F=this.strm,N=this.options.chunkSize,U=this.options.dictionary,$,G,H,J,ue,q=!1;if(this.ended)return!1;G=S===~~S?S:S===!0?n.Z_FINISH:n.Z_NO_FLUSH,typeof w=="string"?F.input=t.binstring2buf(w):c.call(w)==="[object ArrayBuffer]"?F.input=new Uint8Array(w):F.input=w,F.next_in=0,F.avail_in=F.input.length;do{if(F.avail_out===0&&(F.output=new e.Buf8(N),F.next_out=0,F.avail_out=N),$=r.inflate(F,n.Z_NO_FLUSH),$===n.Z_NEED_DICT&&U&&($=r.inflateSetDictionary(this.strm,U)),$===n.Z_BUF_ERROR&&q===!0&&($=n.Z_OK,q=!1),$!==n.Z_STREAM_END&&$!==n.Z_OK)return this.onEnd($),this.ended=!0,!1;F.next_out&&(F.avail_out===0||$===n.Z_STREAM_END||F.avail_in===0&&(G===n.Z_FINISH||G===n.Z_SYNC_FLUSH))&&(this.options.to==="string"?(H=t.utf8border(F.output,F.next_out),J=F.next_out-H,ue=t.buf2string(F.output,H),F.next_out=J,F.avail_out=N-J,J&&e.arraySet(F.output,F.output,H,J,0),this.onData(ue)):this.onData(e.shrinkBuf(F.output,F.next_out))),F.avail_in===0&&F.avail_out===0&&(q=!0)}while((F.avail_in>0||F.avail_out===0)&&$!==n.Z_STREAM_END);return $===n.Z_STREAM_END&&(G=n.Z_FINISH),G===n.Z_FINISH?($=r.inflateEnd(this.strm),this.onEnd($),this.ended=!0,$===n.Z_OK):(G===n.Z_SYNC_FLUSH&&(this.onEnd(n.Z_OK),F.avail_out=0),!0)},f.prototype.onData=function(w){this.chunks.push(w)},f.prototype.onEnd=function(w){w===n.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=e.flattenChunks(this.chunks)),this.chunks=[],this.err=w,this.msg=this.strm.msg};function A(w,S){var F=new f(S);if(F.push(w,!0),F.err)throw F.msg||i[F.err];return F.result}function v(w,S){return S=S||{},S.raw=!0,A(w,S)}return Ud.Inflate=f,Ud.inflate=A,Ud.inflateRaw=v,Ud.ungzip=A,Ud}var $1,MF;function u1e(){if(MF)return $1;MF=1;var r=pf().assign,e=i1e(),t=l1e(),n=BN(),i={};return r(i,e,t,n),$1=i,$1}var f1e=u1e();const zd=_h(f1e),PF=[0],h1e={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:"",loader:xN,onTilesetLoad:{type:"function",value:r=>{}},onTileLoad:{type:"function",value:r=>{}},onTileUnload:{type:"function",value:r=>{}},onTileError:{type:"function",value:(r,e,t)=>{}},_getMeshColor:{type:"function",value:r=>[255,255,255]}};class uT extends Bs{initializeState(){"onTileLoadFail"in this.props&&Yr.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}get isLoaded(){return!!(this.state?.tileset3d?.isLoaded()&&super.isLoaded)}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState({props:e,oldProps:t,changeFlags:n}){if(e.data&&e.data!==t.data&&this._loadTileset(e.data),n.viewportChanged){const{activeViewports:i}=this.state;Object.keys(i).length&&(this._updateTileset(i),this.state.lastUpdatedViewports=i,this.state.activeViewports={})}if(n.propsChanged){const{layerMap:i}=this.state;for(const s in i)i[s].needsUpdate=!0}}activateViewport(e){const{activeViewports:t,lastUpdatedViewports:n}=this.state;this.internalState.viewport=e,t[e.id]=e;const i=n?.[e.id];(!i||!e.equals(i))&&(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}getPickingInfo({info:e,sourceLayer:t}){const n=t&&t.props.tile;return e.picked&&(e.object=n),e.sourceTile=n,e}filterSubLayer({layer:e,viewport:t}){const{tile:n}=e.props,{id:i}=t;return n.selected&&n.viewportIds.includes(i)}_updateAutoHighlight(e){const t=e.sourceTile,n=this.state.layerMap[t?.id];n&&n.layer&&n.layer.updateAutoHighlight(e)}async _loadTileset(e){const{loadOptions:t={}}=this.props,n=this.props.loader||this.props.loaders,i=Array.isArray(n)?n[0]:n,s={loadOptions:{...t}};let o=e;if(i.preload){const A=await i.preload(e,t);A.url&&(o=A.url),A.headers&&(s.loadOptions.fetch={...s.loadOptions.fetch,headers:A.headers}),Object.assign(s,A)}const c=await Wp(o,i,s.loadOptions),f=new t_e(c,{onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError,...s});this.setState({tileset3d:f,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(f)}_onTileLoad(e){const{lastUpdatedViewports:t}=this.state;this.props.onTileLoad(e),this._updateTileset(t),this.setNeedsUpdate()}_onTileUnload(e){delete this.state.layerMap[e.id],this.props.onTileUnload(e)}_updateTileset(e){if(!e)return;const{tileset3d:t}=this.state,{timeline:n}=this.context,i=Object.keys(e).length;!n||!i||!t||t.selectTiles(Object.values(e)).then(s=>{this.state.frameNumber!==s&&this.setState({frameNumber:s})})}_getSubLayer(e,t){if(!e.content)return null;switch(e.type){case Yl.POINTCLOUD:return this._makePointCloudLayer(e,t);case Yl.SCENEGRAPH:return this._make3DModelLayer(e);case Yl.MESH:return this._makeSimpleMeshLayer(e,t);default:throw new Error(`Tile3DLayer: Failed to render layer of type ${e.content.type}`)}}_makePointCloudLayer(e,t){const{attributes:n,pointCount:i,constantRGBA:s,cartographicOrigin:o,modelMatrix:c}=e.content,{positions:f,normals:A,colors:v}=n;if(!f)return null;const w=t&&t.props.data||{header:{vertexCount:i},attributes:{POSITION:f,NORMAL:A,COLOR_0:v}},{pointSize:S,getPointColor:F}=this.props,N=this.getSubLayerClass("pointcloud",$g);return new N({pointSize:S},this.getSubLayerProps({id:"pointcloud"}),{id:`${this.id}-pointcloud-${e.id}`,tile:e,data:w,coordinateSystem:Qr.METER_OFFSETS,coordinateOrigin:o,modelMatrix:c,getColor:s||F,_offset:0})}_make3DModelLayer(e){const{gltf:t,instances:n,cartographicOrigin:i,modelMatrix:s}=e.content,o=this.getSubLayerClass("scenegraph",Qg);return new o({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:`${this.id}-scenegraph-${e.id}`,tile:e,data:n||PF,scenegraph:t,coordinateSystem:Qr.METER_OFFSETS,coordinateOrigin:i,modelMatrix:s,getTransformMatrix:c=>c.modelMatrix,getPosition:[0,0,0],_offset:0})}_makeSimpleMeshLayer(e,t){const n=e.content,{attributes:i,indices:s,modelMatrix:o,cartographicOrigin:c,coordinateSystem:f=Qr.METER_OFFSETS,material:A,featureIds:v}=n,{_getMeshColor:w}=this.props,S=t&&t.props.mesh||new Ys({topology:"triangle-list",attributes:d1e(i),indices:s}),F=this.getSubLayerClass("mesh",XC);return new F(this.getSubLayerProps({id:"mesh"}),{id:`${this.id}-mesh-${e.id}`,tile:e,mesh:S,data:PF,getColor:w(e),pbrMaterial:A,modelMatrix:o,coordinateOrigin:c,coordinateSystem:f,featureIds:v,_offset:0})}renderLayers(){const{tileset3d:e,layerMap:t}=this.state;return e?e.tiles.map(n=>{const i=t[n.id]=t[n.id]||{tile:n};let{layer:s}=i;return n.selected&&(s?i.needsUpdate&&(s=this._getSubLayer(n,s),i.needsUpdate=!1):s=this._getSubLayer(n)),i.layer=s,s}).filter(Boolean):null}}uT.defaultProps=h1e;uT.layerName="Tile3DLayer";function d1e(r){const e={};return e.positions={...r.positions,value:new Float32Array(r.positions.value)},r.normals&&(e.normals=r.normals),r.texCoords&&(e.texCoords=r.texCoords),r.colors&&(e.colors=r.colors),r.uvRegions&&(e.uvRegions=r.uvRegions),e}const p1e="4.2.4",SN={dataType:null,batchType:null,name:"Terrain",id:"terrain",module:"terrain",version:p1e,worker:!0,extensions:["png","pngraw","jpg","jpeg","gif","webp","bmp"],mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp"],options:{terrain:{tesselator:"auto",bounds:void 0,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:void 0}}};({...SN});const RF=[1],A1e={...ou.defaultProps,elevationData:H_,texture:{...H_,optional:!0},meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:"",wireframe:!1,material:!0,loaders:[SN]};function FF(r){return Array.isArray(r)?r.join(";"):r||""}class fT extends Bs{updateState({props:e,oldProps:t}){const n=e.elevationData!==t.elevationData;if(n){const{elevationData:s}=e,o=s&&(Array.isArray(s)||s.includes("{x}")&&s.includes("{y}"));this.setState({isTiled:o})}const i=n||e.meshMaxError!==t.meshMaxError||e.elevationDecoder!==t.elevationDecoder||e.bounds!==t.bounds;if(!this.state.isTiled&&i){const s=this.loadTerrain(e);this.setState({terrain:s})}e.workerUrl&&Yr.removed("workerUrl","loadOptions.terrain.workerUrl")()}loadTerrain({elevationData:e,bounds:t,elevationDecoder:n,meshMaxError:i,signal:s}){if(!e)return null;let o=this.getLoadOptions();o={...o,terrain:{skirtHeight:this.state.isTiled?i*2:0,...o?.terrain,bounds:t,meshMaxError:i,elevationDecoder:n}};const{fetch:c}=this.props;return c(e,{propName:"elevationData",layer:this,loadOptions:o,signal:s})}getTiledTerrainData(e){const{elevationData:t,fetch:n,texture:i,elevationDecoder:s,meshMaxError:o}=this.props,{viewport:c}=this.context,f=ph(t,e),A=i&&ph(i,e),{signal:v}=e;let w=[0,0],S=[0,0];if(c.isGeospatial){const $=e.bbox;w=c.projectFlat([$.west,$.south]),S=c.projectFlat([$.east,$.north])}else{const $=e.bbox;w=[$.left,$.bottom],S=[$.right,$.top]}const F=[w[0],w[1],S[0],S[1]],N=this.loadTerrain({elevationData:f,bounds:F,elevationDecoder:s,meshMaxError:o,signal:v}),U=A?n(A,{propName:"texture",layer:this,loaders:[],signal:v}).catch($=>null):Promise.resolve(null);return Promise.all([N,U])}renderSubLayers(e){const t=this.getSubLayerClass("mesh",Ah),{color:n,wireframe:i,material:s}=this.props,{data:o}=e;if(!o)return null;const[c,f]=o;return new t(e,{data:RF,mesh:c,texture:f,_instanced:!1,coordinateSystem:Qr.CARTESIAN,getPosition:A=>[0,0,0],getColor:n,wireframe:i,material:s})}onViewportLoad(e){if(!e)return;const{zRange:t}=this.state,n=e.map(o=>o.content).filter(Boolean).map(o=>o[0].header.boundingBox.map(f=>f[2]));if(n.length===0)return;const i=Math.min(...n.map(o=>o[0])),s=Math.max(...n.map(o=>o[1]));(!t||i<t[0]||s>t[1])&&this.setState({zRange:[i,s]})}renderLayers(){const{color:e,material:t,elevationData:n,texture:i,wireframe:s,meshMaxError:o,elevationDecoder:c,tileSize:f,maxZoom:A,minZoom:v,extent:w,maxRequests:S,onTileLoad:F,onTileUnload:N,onTileError:U,maxCacheSize:$,maxCacheByteSize:G,refinementStrategy:H}=this.props;if(this.state.isTiled)return new ou(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:FF(n),texture:FF(i),meshMaxError:o,elevationDecoder:c}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:f,maxZoom:A,minZoom:v,extent:w,maxRequests:S,onTileLoad:F,onTileUnload:N,onTileError:U,maxCacheSize:$,maxCacheByteSize:G,refinementStrategy:H});if(!n)return null;const J=this.getSubLayerClass("mesh",Ah);return new J(this.getSubLayerProps({id:"mesh"}),{data:RF,mesh:this.state.terrain,texture:i,_instanced:!1,getPosition:ue=>[0,0,0],getColor:e,material:t,wireframe:s})}}fT.defaultProps=A1e;fT.layerName="TerrainLayer";const g1e={clipBounds:[0,0,1,1],clipByInstance:void 0},IN=`
4598
4567
  uniform clipUniforms {
4599
4568
  vec4 bounds;
4600
4569
  } clip;
@@ -4685,7 +4654,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
4685
4654
  }
4686
4655
  `,"vs:DECKGL_FILTER_COLOR":`
4687
4656
  color.a *= collision_fade;
4688
- `},w1e=r=>{if(!r||!("dummyCollisionMap"in r))return{};const{enabled:e,collisionFBO:t,drawToCollisionMap:n,dummyCollisionMap:i}=r;return{enabled:e&&!n,sort:!!n,collision_texture:!n&&t?t.colorAttachments[0]:i}},C1e={name:"collision",dependencies:[hy],vs:b1e,inject:x1e,getUniforms:w1e,uniformTypes:{sort:"i32",enabled:"i32"}};class T1e extends dy{renderCollisionMap(e,t){const i=[0,0,0,0],s=[1,1,e.width-2*1,e.height-2*1];this.render({...t,clearColor:i,scissorRect:s,target:e,pass:"collision"})}getLayerParameters(e,t,n){return{...e.props.parameters,blend:!1,depthWriteEnabled:!0,depthCompare:"less-equal"}}getShaderModuleProps(){return{collision:{drawToCollisionMap:!0},picking:{isActive:1,isAttribute:!1},lighting:{enabled:!1}}}}const W1=2;class E1e{constructor(){this.id="collision-filter-effect",this.props=null,this.useInPicking=!0,this.order=1,this.channels={},this.collisionFBOs={}}setup(e){this.context=e;const{device:t}=e;this.dummyCollisionMap=t.createTexture({width:1,height:1}),this.collisionFilterPass=new T1e(t,{id:"default-collision-filter"})}preRender({effects:e,layers:t,layerFilter:n,viewports:i,onViewportActive:s,views:o,isPicking:c,preRenderStats:f={}}){const{device:A}=this.context;if(c)return;const v=t.filter(({props:{visible:$,collisionEnabled:G}})=>$&&G);if(v.length===0){this.channels={};return}const w=e?.filter($=>$.useInPicking&&f[$.id]),S=f["mask-effect"]?.didRender,F=this._groupByCollisionGroup(A,v),N=i[0],U=!this.lastViewport||!this.lastViewport.equals(N)||S;for(const $ in F){const G=this.collisionFBOs[$],H=F[$],[J,ue]=A.canvasContext.getPixelSize();G.resize({width:J/W1,height:ue/W1}),this._render(H,{effects:w,layerFilter:n,onViewportActive:s,views:o,viewport:N,viewportChanged:U})}}_render(e,{effects:t,layerFilter:n,onViewportActive:i,views:s,viewport:o,viewportChanged:c}){const{collisionGroup:f}=e,A=this.channels[f];if(!A)return;const v=c||e===A||!rs(A.layers,e.layers,1)||e.layerBounds.some((w,S)=>!ma(w,A.layerBounds[S]))||e.allLayersLoaded!==A.allLayersLoaded||e.layers.some(w=>w.props.transitions);if(this.channels[f]=e,v){this.lastViewport=o;const w=this.collisionFBOs[f];this.collisionFilterPass.renderCollisionMap(w,{pass:"collision-filter",isPicking:!0,layers:e.layers,effects:t,layerFilter:n,viewports:o?[o]:[],onViewportActive:i,views:s,shaderModuleProps:{collision:{enabled:!0,dummyCollisionMap:this.dummyCollisionMap},project:{devicePixelRatio:w.device.canvasContext.getDevicePixelRatio()/W1}}})}}_groupByCollisionGroup(e,t){const n={};for(const i of t){const s=i.props.collisionGroup;let o=n[s];o||(o={collisionGroup:s,layers:[],layerBounds:[],allLayersLoaded:!0},n[s]=o),o.layers.push(i),o.layerBounds.push(i.getBounds()),i.isLoaded||(o.allLayersLoaded=!1)}for(const i of Object.keys(n))this.collisionFBOs[i]||this.createFBO(e,i),this.channels[i]||(this.channels[i]=n[i]);for(const i of Object.keys(this.collisionFBOs))n[i]||this.destroyFBO(i);return n}getShaderModuleProps(e){const{collisionGroup:t,collisionEnabled:n}=e.props,{collisionFBOs:i,dummyCollisionMap:s}=this,o=i[t];return{collision:{enabled:n&&!!o,collisionFBO:o,dummyCollisionMap:s}}}cleanup(){this.dummyCollisionMap&&(this.dummyCollisionMap.delete(),this.dummyCollisionMap=void 0),this.channels={};for(const e of Object.keys(this.collisionFBOs))this.destroyFBO(e);this.collisionFBOs={},this.lastViewport=void 0}createFBO(e,t){const{width:n,height:i}=e.gl.canvas,s=e.createTexture({format:"rgba8unorm",width:n,height:i,sampler:{minFilter:"nearest",magFilter:"nearest",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}}),o=e.createTexture({format:"depth16unorm",width:n,height:i,mipmaps:!1});this.collisionFBOs[t]=e.createFramebuffer({id:`collision-${t}`,width:n,height:i,colorAttachments:[s],depthStencilAttachment:o})}destroyFBO(e){const t=this.collisionFBOs[e];t.colorAttachments[0]?.destroy(),t.depthStencilAttachment?.destroy(),t.destroy(),delete this.collisionFBOs[e]}}const B1e={getCollisionPriority:{type:"accessor",value:0},collisionEnabled:!0,collisionGroup:{type:"string",value:"default"},collisionTestProps:{}};class hT extends _y{getShaders(){return{modules:[C1e]}}draw({shaderModuleProps:e}){e.collision?.drawToCollisionMap&&(this.props=this.clone(this.props.collisionTestProps).props)}initializeState(e,t){if(this.getAttributeManager()===null)return;this.context.deck?._addDefaultEffect(new E1e),this.getAttributeManager().add({collisionPriorities:{size:1,stepMode:"dynamic",accessor:"getCollisionPriority"}})}getNeedsPickingBuffer(){return this.props.collisionEnabled}}hT.defaultProps=B1e;hT.extensionName="CollisionFilterExtension";function Px(r,e){const t=e?.globalFeatureId;return t!==void 0?S1e(r,t):I1e(r,e?.type)}function S1e(r,e){const t=MN(r);for(const n of t){let i=0,s=n.featureIds.value[0];for(let o=0;o<n.featureIds.value.length;o++){const c=n.featureIds.value[o];if(c!==s){if(e===n.globalFeatureIds.value[i])return Q_(n,i,o);i=o,s=c}}if(e===n.globalFeatureIds.value[i])return Q_(n,i,n.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}function I1e(r,e){const t=MN(r);return P1e(t)}function M1e(r,e,t){switch(r.type){case"Point":return O1e(r,e,t);case"LineString":return D1e(r,e,t);case"Polygon":return PN(r,e,t);default:const n=r;throw new Error(`Unsupported geometry type: ${n?.type}`)}}function MN(r,e){const t=[];return r.points&&(r.points.type="Point",t.push(r.points)),r.lines&&(r.lines.type="LineString",t.push(r.lines)),r.polygons&&(r.polygons.type="Polygon",t.push(r.polygons)),t}function P1e(r){const e=[];for(const t of r){if(t.featureIds.value.length===0)continue;let n=0,i=t.featureIds.value[0];for(let s=0;s<t.featureIds.value.length;s++){const o=t.featureIds.value[s];o!==i&&(e.push(Q_(t,n,s)),n=s,i=o)}e.push(Q_(t,n,t.featureIds.value.length))}return e}function Q_(r,e,t){const n=M1e(r,e,t),i=F1e(r,e),s=R1e(r,e);return{type:"Feature",geometry:n,properties:i,...s}}function R1e(r,e=0,t){return r.fields&&r.fields[r.featureIds.value[e]]}function F1e(r,e=0,t){const n=Object.assign({},r.properties[r.featureIds.value[e]]);for(const i in r.numericProps)n[i]=r.numericProps[i].value[e];return n}function PN(r,e=-1/0,t=1/0){const{positions:n}=r,i=r.polygonIndices.value.filter(f=>f>=e&&f<=t),s=r.primitivePolygonIndices.value.filter(f=>f>=e&&f<=t);if(!(i.length>2)){const f=[];for(let A=0;A<s.length-1;A++){const v=s[A],w=s[A+1],S=ey(n,v,w);f.push(S)}return{type:"Polygon",coordinates:f}}const c=[];for(let f=0;f<i.length-1;f++){const A=i[f],v=i[f+1],w=PN(r,A,v).coordinates;c.push(w)}return{type:"MultiPolygon",coordinates:c}}function D1e(r,e=-1/0,t=1/0){const{positions:n}=r,i=r.pathIndices.value.filter(c=>c>=e&&c<=t);if(!(i.length>2))return{type:"LineString",coordinates:ey(n,i[0],i[1])};const o=[];for(let c=0;c<i.length-1;c++){const f=ey(n,i[c],i[c+1]);o.push(f)}return{type:"MultiLineString",coordinates:o}}function O1e(r,e,t){const{positions:n}=r,i=ey(n,e,t);return i.length>1?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function ey(r,e,t){e=e||0,t=t||r.value.length/r.size;const n=[];for(let i=e;i<t;i++){const s=Array();for(let o=i*r.size;o<(i+1)*r.size;o++)s.push(Number(r.value[o]));n.push(s)}return n}var T0={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var DF;function L1e(){return DF||(DF=1,T0.read=function(r,e,t,n,i){var s,o,c=i*8-n-1,f=(1<<c)-1,A=f>>1,v=-7,w=t?i-1:0,S=t?-1:1,F=r[e+w];for(w+=S,s=F&(1<<-v)-1,F>>=-v,v+=c;v>0;s=s*256+r[e+w],w+=S,v-=8);for(o=s&(1<<-v)-1,s>>=-v,v+=n;v>0;o=o*256+r[e+w],w+=S,v-=8);if(s===0)s=1-A;else{if(s===f)return o?NaN:(F?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-A}return(F?-1:1)*o*Math.pow(2,s-n)},T0.write=function(r,e,t,n,i,s){var o,c,f,A=s*8-i-1,v=(1<<A)-1,w=v>>1,S=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,F=n?0:s-1,N=n?1:-1,U=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,o=v):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+w>=1?e+=S/f:e+=S*Math.pow(2,1-w),e*f>=2&&(o++,f/=2),o+w>=v?(c=0,o=v):o+w>=1?(c=(e*f-1)*Math.pow(2,i),o=o+w):(c=e*Math.pow(2,w-1)*Math.pow(2,i),o=0));i>=8;r[t+F]=c&255,F+=N,c/=256,i-=8);for(o=o<<i|c,A+=i;A>0;r[t+F]=o&255,F+=N,o/=256,A-=8);r[t+F-N]|=U*128}),T0}var J1,OF;function k1e(){if(OF)return J1;OF=1,J1=e;var r=L1e();function e(W){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(W)?W:new Uint8Array(W||0),this.pos=0,this.type=0,this.length=this.buf.length}e.Varint=0,e.Fixed64=1,e.Bytes=2,e.Fixed32=5;var t=65536*65536,n=1/t,i=12,s=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");e.prototype={destroy:function(){this.buf=null},readFields:function(W,re,Ee){for(Ee=Ee||this.length;this.pos<Ee;){var et=this.readVarint(),_e=et>>3,Le=this.pos;this.type=et&7,W(_e,re,this),this.pos===Le&&this.skip(et)}return re},readMessage:function(W,re){return this.readFields(W,re,this.readVarint()+this.pos)},readFixed32:function(){var W=se(this.buf,this.pos);return this.pos+=4,W},readSFixed32:function(){var W=Ue(this.buf,this.pos);return this.pos+=4,W},readFixed64:function(){var W=se(this.buf,this.pos)+se(this.buf,this.pos+4)*t;return this.pos+=8,W},readSFixed64:function(){var W=se(this.buf,this.pos)+Ue(this.buf,this.pos+4)*t;return this.pos+=8,W},readFloat:function(){var W=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,W},readDouble:function(){var W=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,W},readVarint:function(W){var re=this.buf,Ee,et;return et=re[this.pos++],Ee=et&127,et<128||(et=re[this.pos++],Ee|=(et&127)<<7,et<128)||(et=re[this.pos++],Ee|=(et&127)<<14,et<128)||(et=re[this.pos++],Ee|=(et&127)<<21,et<128)?Ee:(et=re[this.pos],Ee|=(et&15)<<28,o(Ee,W,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var W=this.readVarint();return W%2===1?(W+1)/-2:W/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var W=this.readVarint()+this.pos,re=this.pos;return this.pos=W,W-re>=i&&s?me(this.buf,re,W):de(this.buf,re,W)},readBytes:function(){var W=this.readVarint()+this.pos,re=this.buf.subarray(this.pos,W);return this.pos=W,re},readPackedVarint:function(W,re){if(this.type!==e.Bytes)return W.push(this.readVarint(re));var Ee=c(this);for(W=W||[];this.pos<Ee;)W.push(this.readVarint(re));return W},readPackedSVarint:function(W){if(this.type!==e.Bytes)return W.push(this.readSVarint());var re=c(this);for(W=W||[];this.pos<re;)W.push(this.readSVarint());return W},readPackedBoolean:function(W){if(this.type!==e.Bytes)return W.push(this.readBoolean());var re=c(this);for(W=W||[];this.pos<re;)W.push(this.readBoolean());return W},readPackedFloat:function(W){if(this.type!==e.Bytes)return W.push(this.readFloat());var re=c(this);for(W=W||[];this.pos<re;)W.push(this.readFloat());return W},readPackedDouble:function(W){if(this.type!==e.Bytes)return W.push(this.readDouble());var re=c(this);for(W=W||[];this.pos<re;)W.push(this.readDouble());return W},readPackedFixed32:function(W){if(this.type!==e.Bytes)return W.push(this.readFixed32());var re=c(this);for(W=W||[];this.pos<re;)W.push(this.readFixed32());return W},readPackedSFixed32:function(W){if(this.type!==e.Bytes)return W.push(this.readSFixed32());var re=c(this);for(W=W||[];this.pos<re;)W.push(this.readSFixed32());return W},readPackedFixed64:function(W){if(this.type!==e.Bytes)return W.push(this.readFixed64());var re=c(this);for(W=W||[];this.pos<re;)W.push(this.readFixed64());return W},readPackedSFixed64:function(W){if(this.type!==e.Bytes)return W.push(this.readSFixed64());var re=c(this);for(W=W||[];this.pos<re;)W.push(this.readSFixed64());return W},skip:function(W){var re=W&7;if(re===e.Varint)for(;this.buf[this.pos++]>127;);else if(re===e.Bytes)this.pos=this.readVarint()+this.pos;else if(re===e.Fixed32)this.pos+=4;else if(re===e.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+re)},writeTag:function(W,re){this.writeVarint(W<<3|re)},realloc:function(W){for(var re=this.length||16;re<this.pos+W;)re*=2;if(re!==this.length){var Ee=new Uint8Array(re);Ee.set(this.buf),this.buf=Ee,this.length=re}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(W){this.realloc(4),Te(this.buf,W,this.pos),this.pos+=4},writeSFixed32:function(W){this.realloc(4),Te(this.buf,W,this.pos),this.pos+=4},writeFixed64:function(W){this.realloc(8),Te(this.buf,W&-1,this.pos),Te(this.buf,Math.floor(W*n),this.pos+4),this.pos+=8},writeSFixed64:function(W){this.realloc(8),Te(this.buf,W&-1,this.pos),Te(this.buf,Math.floor(W*n),this.pos+4),this.pos+=8},writeVarint:function(W){if(W=+W||0,W>268435455||W<0){A(W,this);return}this.realloc(4),this.buf[this.pos++]=W&127|(W>127?128:0),!(W<=127)&&(this.buf[this.pos++]=(W>>>=7)&127|(W>127?128:0),!(W<=127)&&(this.buf[this.pos++]=(W>>>=7)&127|(W>127?128:0),!(W<=127)&&(this.buf[this.pos++]=W>>>7&127)))},writeSVarint:function(W){this.writeVarint(W<0?-W*2-1:W*2)},writeBoolean:function(W){this.writeVarint(!!W)},writeString:function(W){W=String(W),this.realloc(W.length*4),this.pos++;var re=this.pos;this.pos=pe(this.buf,W,this.pos);var Ee=this.pos-re;Ee>=128&&S(re,Ee,this),this.pos=re-1,this.writeVarint(Ee),this.pos+=Ee},writeFloat:function(W){this.realloc(4),r.write(this.buf,W,this.pos,!0,23,4),this.pos+=4},writeDouble:function(W){this.realloc(8),r.write(this.buf,W,this.pos,!0,52,8),this.pos+=8},writeBytes:function(W){var re=W.length;this.writeVarint(re),this.realloc(re);for(var Ee=0;Ee<re;Ee++)this.buf[this.pos++]=W[Ee]},writeRawMessage:function(W,re){this.pos++;var Ee=this.pos;W(re,this);var et=this.pos-Ee;et>=128&&S(Ee,et,this),this.pos=Ee-1,this.writeVarint(et),this.pos+=et},writeMessage:function(W,re,Ee){this.writeTag(W,e.Bytes),this.writeRawMessage(re,Ee)},writePackedVarint:function(W,re){re.length&&this.writeMessage(W,F,re)},writePackedSVarint:function(W,re){re.length&&this.writeMessage(W,N,re)},writePackedBoolean:function(W,re){re.length&&this.writeMessage(W,G,re)},writePackedFloat:function(W,re){re.length&&this.writeMessage(W,U,re)},writePackedDouble:function(W,re){re.length&&this.writeMessage(W,$,re)},writePackedFixed32:function(W,re){re.length&&this.writeMessage(W,H,re)},writePackedSFixed32:function(W,re){re.length&&this.writeMessage(W,J,re)},writePackedFixed64:function(W,re){re.length&&this.writeMessage(W,ue,re)},writePackedSFixed64:function(W,re){re.length&&this.writeMessage(W,q,re)},writeBytesField:function(W,re){this.writeTag(W,e.Bytes),this.writeBytes(re)},writeFixed32Field:function(W,re){this.writeTag(W,e.Fixed32),this.writeFixed32(re)},writeSFixed32Field:function(W,re){this.writeTag(W,e.Fixed32),this.writeSFixed32(re)},writeFixed64Field:function(W,re){this.writeTag(W,e.Fixed64),this.writeFixed64(re)},writeSFixed64Field:function(W,re){this.writeTag(W,e.Fixed64),this.writeSFixed64(re)},writeVarintField:function(W,re){this.writeTag(W,e.Varint),this.writeVarint(re)},writeSVarintField:function(W,re){this.writeTag(W,e.Varint),this.writeSVarint(re)},writeStringField:function(W,re){this.writeTag(W,e.Bytes),this.writeString(re)},writeFloatField:function(W,re){this.writeTag(W,e.Fixed32),this.writeFloat(re)},writeDoubleField:function(W,re){this.writeTag(W,e.Fixed64),this.writeDouble(re)},writeBooleanField:function(W,re){this.writeVarintField(W,!!re)}};function o(W,re,Ee){var et=Ee.buf,_e,Le;if(Le=et[Ee.pos++],_e=(Le&112)>>4,Le<128||(Le=et[Ee.pos++],_e|=(Le&127)<<3,Le<128)||(Le=et[Ee.pos++],_e|=(Le&127)<<10,Le<128)||(Le=et[Ee.pos++],_e|=(Le&127)<<17,Le<128)||(Le=et[Ee.pos++],_e|=(Le&127)<<24,Le<128)||(Le=et[Ee.pos++],_e|=(Le&1)<<31,Le<128))return f(W,_e,re);throw new Error("Expected varint not more than 10 bytes")}function c(W){return W.type===e.Bytes?W.readVarint()+W.pos:W.pos+1}function f(W,re,Ee){return Ee?re*4294967296+(W>>>0):(re>>>0)*4294967296+(W>>>0)}function A(W,re){var Ee,et;if(W>=0?(Ee=W%4294967296|0,et=W/4294967296|0):(Ee=~(-W%4294967296),et=~(-W/4294967296),Ee^4294967295?Ee=Ee+1|0:(Ee=0,et=et+1|0)),W>=18446744073709552e3||W<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");re.realloc(10),v(Ee,et,re),w(et,re)}function v(W,re,Ee){Ee.buf[Ee.pos++]=W&127|128,W>>>=7,Ee.buf[Ee.pos++]=W&127|128,W>>>=7,Ee.buf[Ee.pos++]=W&127|128,W>>>=7,Ee.buf[Ee.pos++]=W&127|128,W>>>=7,Ee.buf[Ee.pos]=W&127}function w(W,re){var Ee=(W&7)<<4;re.buf[re.pos++]|=Ee|((W>>>=3)?128:0),W&&(re.buf[re.pos++]=W&127|((W>>>=7)?128:0),W&&(re.buf[re.pos++]=W&127|((W>>>=7)?128:0),W&&(re.buf[re.pos++]=W&127|((W>>>=7)?128:0),W&&(re.buf[re.pos++]=W&127|((W>>>=7)?128:0),W&&(re.buf[re.pos++]=W&127)))))}function S(W,re,Ee){var et=re<=16383?1:re<=2097151?2:re<=268435455?3:Math.floor(Math.log(re)/(Math.LN2*7));Ee.realloc(et);for(var _e=Ee.pos-1;_e>=W;_e--)Ee.buf[_e+et]=Ee.buf[_e]}function F(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeVarint(W[Ee])}function N(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeSVarint(W[Ee])}function U(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeFloat(W[Ee])}function $(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeDouble(W[Ee])}function G(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeBoolean(W[Ee])}function H(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeFixed32(W[Ee])}function J(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeSFixed32(W[Ee])}function ue(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeFixed64(W[Ee])}function q(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeSFixed64(W[Ee])}function se(W,re){return(W[re]|W[re+1]<<8|W[re+2]<<16)+W[re+3]*16777216}function Te(W,re,Ee){W[Ee]=re,W[Ee+1]=re>>>8,W[Ee+2]=re>>>16,W[Ee+3]=re>>>24}function Ue(W,re){return(W[re]|W[re+1]<<8|W[re+2]<<16)+(W[re+3]<<24)}function de(W,re,Ee){for(var et="",_e=re;_e<Ee;){var Le=W[_e],Ge=null,Ze=Le>239?4:Le>223?3:Le>191?2:1;if(_e+Ze>Ee)break;var tt,rt,ut;Ze===1?Le<128&&(Ge=Le):Ze===2?(tt=W[_e+1],(tt&192)===128&&(Ge=(Le&31)<<6|tt&63,Ge<=127&&(Ge=null))):Ze===3?(tt=W[_e+1],rt=W[_e+2],(tt&192)===128&&(rt&192)===128&&(Ge=(Le&15)<<12|(tt&63)<<6|rt&63,(Ge<=2047||Ge>=55296&&Ge<=57343)&&(Ge=null))):Ze===4&&(tt=W[_e+1],rt=W[_e+2],ut=W[_e+3],(tt&192)===128&&(rt&192)===128&&(ut&192)===128&&(Ge=(Le&15)<<18|(tt&63)<<12|(rt&63)<<6|ut&63,(Ge<=65535||Ge>=1114112)&&(Ge=null))),Ge===null?(Ge=65533,Ze=1):Ge>65535&&(Ge-=65536,et+=String.fromCharCode(Ge>>>10&1023|55296),Ge=56320|Ge&1023),et+=String.fromCharCode(Ge),_e+=Ze}return et}function me(W,re,Ee){return s.decode(W.subarray(re,Ee))}function pe(W,re,Ee){for(var et=0,_e,Le;et<re.length;et++){if(_e=re.charCodeAt(et),_e>55295&&_e<57344)if(Le)if(_e<56320){W[Ee++]=239,W[Ee++]=191,W[Ee++]=189,Le=_e;continue}else _e=Le-55296<<10|_e-56320|65536,Le=null;else{_e>56319||et+1===re.length?(W[Ee++]=239,W[Ee++]=191,W[Ee++]=189):Le=_e;continue}else Le&&(W[Ee++]=239,W[Ee++]=191,W[Ee++]=189,Le=null);_e<128?W[Ee++]=_e:(_e<2048?W[Ee++]=_e>>6|192:(_e<65536?W[Ee++]=_e>>12|224:(W[Ee++]=_e>>18|240,W[Ee++]=_e>>12&63|128),W[Ee++]=_e>>6&63|128),W[Ee++]=_e&63|128)}return Ee}return J1}var N1e=k1e();const U1e=_h(N1e),z1e="4.2.4",RN={dataType:null,batchType:null,name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:z1e,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}};({...RN});const G1e={Point:FN,MultiPoint:V1e,LineString:DN,MultiLineString:H1e,Polygon:ON,MultiPolygon:j1e};function FN([r,e],[t,n],i){const s=Cc(t[0],n[0],r),o=Cc(t[1],n[1],e);return i.unprojectFlat([s,o])}function dT(r,e,t){return r.map(n=>FN(n,e,t))}function V1e(r,e,t){return dT(r,e,t)}function DN(r,e,t){return dT(r,e,t)}function H1e(r,e,t){return r.map(n=>DN(n,e,t))}function ON(r,e,t){return r.map(n=>dT(n,e,t))}function j1e(r,e,t){return r.map(n=>ON(n,e,t))}function $1e(r,e,t){const n=t.projectFlat([e.west,e.north]),i=t.projectFlat([e.east,e.south]),s=[n,i];return{...r,coordinates:G1e[r.type](r.coordinates,s,t)}}const W1e=["points","lines","polygons"];function J1e(r,e,t,n){for(const i of W1e){const s=r[i]&&X1e(r[i],e,t,n);if(s>=0)return s}return-1}function X1e(r,e,t,n){const i=r.featureIds.value;if(!i.length)return-1;let s=0,o=i[i.length-1]+1;if(n){const f=K1e(r,n);if(f)s=f[0],o=f[1]+1;else return-1}let c=-1;if(e in r.numericProps){const f=r.numericProps[e].value.findIndex((A,v)=>A===t&&i[v]>=s&&i[v]<o);return f>=0?r.globalFeatureIds.value[f]:-1}else e?c=LF(r.properties,f=>f[e]===t,s,o):r.fields&&(c=LF(r.fields,f=>f.id===t,s,o));return c>=0?q1e(r,c):-1}function K1e(r,e){if(!r.__layers){const t={},{properties:n}=r;for(let i=0;i<n.length;i++){const{layerName:s}=n[i];s&&(t[s]?t[s][1]=i:t[s]=[i,i])}r.__layers=t}return r.__layers[e]}function q1e(r,e){if(!r.__ids){const t=[],n=r.featureIds.value,i=r.globalFeatureIds.value;for(let s=0;s<n.length;s++)t[n[s]]=i[s];r.__ids=t}return r.__ids[e]}function LF(r,e,t,n){for(let i=t;i<n;i++)if(e(r[i],i))return i;return-1}const X1=512,Y1e={...iu.defaultProps,data:H_,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[RN],binary:!0};class Xp extends ou{initializeState(){super.initializeState();const e=this.context.viewport.resolution!==void 0?!1:this.props.binary;this.setState({binary:e,data:null,tileJSON:null,hoveredFeatureId:null,hoveredFeatureLayerName:null})}get isLoaded(){return!!(this.state?.data&&super.isLoaded)}updateState({props:e,oldProps:t,context:n,changeFlags:i}){i.dataChanged&&this._updateTileData(),this.state?.data&&(super.updateState({props:e,oldProps:t,context:n,changeFlags:i}),this._setWGS84PropertyForTiles());const{highlightColor:s}=e;s!==t.highlightColor&&Array.isArray(s)&&this.setState({highlightColor:s})}async _updateTileData(){let e=this.props.data,t=null;if(typeof e=="string"&&!nde(e)){const{onDataLoad:n,fetch:i}=this.props;this.setState({data:null,tileJSON:null});try{t=await i(e,{propName:"data",layer:this,loaders:[]})}catch(s){this.raiseError(s,"loading TileJSON"),e=null}n&&n(t,{propName:"data",layer:this})}else e&&typeof e=="object"&&"tilejson"in e&&(t=e);t&&(e=t.tiles),this.setState({data:e,tileJSON:t})}_getTilesetOptions(){const e=super._getTilesetOptions(),t=this.state.tileJSON,{minZoom:n,maxZoom:i}=this.props;return t&&(Number.isFinite(t.minzoom)&&t.minzoom>n&&(e.minZoom=t.minzoom),Number.isFinite(t.maxzoom)&&(!Number.isFinite(i)||t.maxzoom<i)&&(e.maxZoom=t.maxzoom)),e}renderLayers(){return this.state?.data?super.renderLayers():null}getTileData(e){const{data:t,binary:n}=this.state,{index:i,signal:s}=e,o=ph(t,e);if(!o)return Promise.reject("Invalid URL");let c=this.getLoadOptions();const{fetch:f}=this.props;return c={...c,mimeType:"application/x-protobuf",mvt:{...c?.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:i},gis:n?{format:"binary"}:{}},f(o,{propName:"data",layer:this,loadOptions:c,signal:s})}renderSubLayers(e){const{x:t,y:n,z:i}=e.tile.index,s=Math.pow(2,i),o=X1/s,c=-o,f=X1*t/s,A=X1*(1-n/s),v=new vn().scale([o,c,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=v,e.coordinateOrigin=[f,A,0],e.coordinateSystem=Qr.CARTESIAN,e.extensions=[...e.extensions||[],new Ky]);const w=super.renderSubLayers(e);return this.state.binary&&!(w instanceof iu)&&Yr.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),w}_updateAutoHighlight(e){const{uniqueIdProperty:t}=this.props,{hoveredFeatureId:n,hoveredFeatureLayerName:i}=this.state,s=e.object;let o=null,c=null;s&&(o=K1(s,t),c=kF(s));let{highlightColor:f}=this.props;typeof f=="function"&&(f=f(e)),(n!==o||i!==c)&&this.setState({highlightColor:f,hoveredFeatureId:o,hoveredFeatureLayerName:c})}_isWGS84(){return!!this.context.viewport.resolution}getPickingInfo(e){const t=super.getPickingInfo(e);if(this.state.binary&&t.index!==-1){const{data:n}=e.sourceLayer.props;t.object=Px(n,{globalFeatureId:t.index})}return t.object&&!this._isWGS84()&&(t.object=UF(t.object,t.tile.bbox,this.context.viewport)),t}getSubLayerPropsByTile(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(e){const{hoveredFeatureId:t,hoveredFeatureLayerName:n,binary:i}=this.state,{uniqueIdProperty:s,highlightedFeatureId:o}=this.props,c=e.content,f=NF(o);if(!(NF(t)||f))return-1;const v=f?o:t;return Array.isArray(c)?c.findIndex(w=>{const S=K1(w,s)===v,F=f||kF(w)===n;return S&&F}):c&&i?J1e(c,s,v,f?"":n):-1}_pickObjects(e){const{deck:t,viewport:n}=this.context,i=n.width,s=n.height,o=n.x,c=n.y,f=[this.id];return t.pickObjects({x:o,y:c,width:i,height:s,layerIds:f,maxObjects:e})}getRenderedFeatures(e=null){const t=this._pickObjects(e),n=new Set,i=[];for(const s of t){const o=K1(s.object,this.props.uniqueIdProperty);o===void 0?i.push(s.object):n.has(o)||(n.add(o),i.push(s.object))}return i}_setWGS84PropertyForTiles(){const e="dataInWGS84";this.state.tileset.selectedTiles.forEach(n=>{n.hasOwnProperty(e)||Object.defineProperty(n,e,{get:()=>{if(!n.content)return null;if(this.state.binary&&Array.isArray(n.content)&&!n.content.length)return[];const{bbox:i}=n;if(n._contentWGS84===void 0&&ide(i)){const s=this.state.binary?Px(n.content):n.content;n._contentWGS84=s.map(o=>UF(o,i,this.context.viewport))}return n._contentWGS84}})})}}Xp.layerName="MVTLayer";Xp.defaultProps=Y1e;function K1(r,e){if(r.properties&&e)return r.properties[e];if("id"in r)return r.id}function kF(r){return r.properties?.layerName||null}function NF(r){return r!=null&&r!==""}function UF(r,e,t){const n={...r,geometry:{type:r.geometry.type}};return Object.defineProperty(n.geometry,"coordinates",{get:()=>$1e(r.geometry,e,t).coordinates}),n}const zF="0123456789bcdefghjkmnpqrstuvwxyz",LN={};for(let r=0;r<zF.length;r++)LN[zF.charAt(r)]=r;const Z1e=-90,Q1e=90,e2e=-180,t2e=180;function r2e(r){let e=!0,t=Q1e,n=Z1e,i=t2e,s=e2e,o,c=0;for(let f=0,A=r.length;f<A;f++){const v=r[f].toLowerCase();c=LN[v];for(let w=4;w>=0;w--){const S=c>>w&1;e?(o=(i+s)/2,S===1?s=o:i=o):(o=(t+n)/2,S===1?n=o:t=o),e=!e}}return[n,s,t,i]}function n2e(r){const[e,t,n,i]=r2e(r);return[i,n,i,e,t,e,t,n,i,n]}const i2e={getGeohash:{type:"accessor",value:r=>r.geohash}};class qy extends df{indexToBounds(){const{data:e,getGeohash:t}=this.props;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(n,i)=>n2e(t(n,i))}}}qy.layerName="GeohashLayer";qy.defaultProps=i2e;const s2e=Object.freeze(Object.defineProperty({__proto__:null,GeohashLayer:qy,GreatCircleLayer:TC,H3ClusterLayer:Uy,H3HexagonLayer:_l,MVTLayer:Xp,QuadkeyLayer:Fy,S2Layer:Ry,TerrainLayer:fT,Tile3DLayer:uT,TileLayer:ou,TripsLayer:Ly,_GeoCellLayer:df,_Tile2DHeader:V6,_Tileset2D:Oy,_WMSLayer:CC,_getURLFromTemplate:ph},Symbol.toStringTag,{value:"Module"}));function o2e({pointCount:r,getBinId:e}){const t=new Map;for(let n=0;n<r;n++){const i=e(n);if(i===null)continue;let s=t.get(String(i));s?s.points.push(n):(s={id:i,index:t.size,points:[n]},t.set(String(i),s))}return Array.from(t.values())}function a2e({bins:r,dimensions:e,target:t}){const n=r.length*e;(!t||t.length<n)&&(t=new Float32Array(n));for(let i=0;i<r.length;i++){const{id:s}=r[i];Array.isArray(s)?t.set(s,i*e):t[i]=s}return t}const c2e=r=>r.length,kN=(r,e)=>{let t=0;for(const n of r)t+=e(n);return t},l2e=(r,e)=>r.length===0?NaN:kN(r,e)/r.length,u2e=(r,e)=>{let t=1/0;for(const n of r){const i=e(n);i<t&&(t=i)}return t},f2e=(r,e)=>{let t=-1/0;for(const n of r){const i=e(n);i>t&&(t=i)}return t},h2e={COUNT:c2e,SUM:kN,MEAN:l2e,MIN:u2e,MAX:f2e};function d2e({bins:r,getValue:e,operation:t,target:n}){(!n||n.length<r.length)&&(n=new Float32Array(r.length));let i=1/0,s=-1/0;for(let o=0;o<r.length;o++){const{points:c}=r[o];n[o]=t(c,e),n[o]<i&&(i=n[o]),n[o]>s&&(s=n[o])}return{value:n,domain:[i,s]}}function GF(r,e,t){const n={};for(const s of r.sources||[]){const o=e[s];if(o)n[s]=p2e(o);else throw new Error(`Cannot find attribute ${s}`)}const i={};return s=>{for(const o in n)i[o]=n[o](s);return r.getValue(i,s,t)}}function p2e(r){const e=r.value,{offset:t=0,stride:n,size:i}=r.getAccessor(),s=e.BYTES_PER_ELEMENT,o=t/s,c=n?n/s:i;if(i===1)return r.isConstant?()=>e[0]:A=>{const v=o+c*A;return e[v]};let f;return r.isConstant?(f=Array.from(e),()=>f):(f=new Array(i),A=>{const v=o+c*A;for(let w=0;w<i;w++)f[w]=e[v+w];return f})}class Kp{constructor(e){this.bins=[],this.binIds=null,this.results=[],this.dimensions=e.dimensions,this.channelCount=e.getValue.length,this.props={...e,binOptions:{},pointCount:0,operations:[],customOperations:[],attributes:{}},this.needsUpdate=!0,this.setProps(e)}destroy(){}get binCount(){return this.bins.length}setProps(e){const t=this.props;if(e.binOptions&&(rs(e.binOptions,t.binOptions,2)||this.setNeedsUpdate()),e.operations)for(let n=0;n<this.channelCount;n++)e.operations[n]!==t.operations[n]&&this.setNeedsUpdate(n);if(e.customOperations)for(let n=0;n<this.channelCount;n++)!!e.customOperations[n]!=!!t.customOperations[n]&&this.setNeedsUpdate(n);e.pointCount!==void 0&&e.pointCount!==t.pointCount&&this.setNeedsUpdate(),e.attributes&&(e.attributes={...t.attributes,...e.attributes}),Object.assign(this.props,e)}setNeedsUpdate(e){e===void 0?this.needsUpdate=!0:this.needsUpdate!==!0&&(this.needsUpdate=this.needsUpdate||[],this.needsUpdate[e]=!0)}update(){if(this.needsUpdate===!0){this.bins=o2e({pointCount:this.props.pointCount,getBinId:GF(this.props.getBin,this.props.attributes,this.props.binOptions)});const e=a2e({bins:this.bins,dimensions:this.dimensions,target:this.binIds?.value});this.binIds={value:e,type:"float32",size:this.dimensions}}for(let e=0;e<this.channelCount;e++)if(this.needsUpdate===!0||this.needsUpdate[e]){const t=this.props.customOperations[e]||h2e[this.props.operations[e]],{value:n,domain:i}=d2e({bins:this.bins,getValue:GF(this.props.getValue[e],this.props.attributes,void 0),operation:t,target:this.results[e]?.value});this.results[e]={value:n,domain:i,type:"float32",size:1},this.props.onUpdate?.({channel:e})}this.needsUpdate=!1}preDraw(){}getBins(){return this.binIds}getResult(e){return this.results[e]}getResultDomain(e){return this.results[e]?.domain??[1/0,-1/0]}getBin(e){const t=this.bins[e];if(!t)return null;const n=new Array(this.channelCount);for(let i=0;i<n.length;i++){const s=this.results[i];n[i]=s?.value[e]}return{id:t.id,value:n,count:t.points.length,pointIndices:t.points}}}function NN(r,e,t){return r.createFramebuffer({width:e,height:t,colorAttachments:[r.createTexture({width:e,height:t,format:"rgba32float",mipmaps:!1,sampler:{minFilter:"nearest",magFilter:"nearest"}})]})}const A2e=`uniform binSorterUniforms {
4657
+ `},w1e=r=>{if(!r||!("dummyCollisionMap"in r))return{};const{enabled:e,collisionFBO:t,drawToCollisionMap:n,dummyCollisionMap:i}=r;return{enabled:e&&!n,sort:!!n,collision_texture:!n&&t?t.colorAttachments[0]:i}},C1e={name:"collision",dependencies:[hy],vs:b1e,inject:x1e,getUniforms:w1e,uniformTypes:{sort:"i32",enabled:"i32"}};class T1e extends dy{renderCollisionMap(e,t){const i=[0,0,0,0],s=[1,1,e.width-2*1,e.height-2*1];this.render({...t,clearColor:i,scissorRect:s,target:e,pass:"collision"})}getLayerParameters(e,t,n){return{...e.props.parameters,blend:!1,depthWriteEnabled:!0,depthCompare:"less-equal"}}getShaderModuleProps(){return{collision:{drawToCollisionMap:!0},picking:{isActive:1,isAttribute:!1},lighting:{enabled:!1}}}}const W1=2;class E1e{constructor(){this.id="collision-filter-effect",this.props=null,this.useInPicking=!0,this.order=1,this.channels={},this.collisionFBOs={}}setup(e){this.context=e;const{device:t}=e;this.dummyCollisionMap=t.createTexture({width:1,height:1}),this.collisionFilterPass=new T1e(t,{id:"default-collision-filter"})}preRender({effects:e,layers:t,layerFilter:n,viewports:i,onViewportActive:s,views:o,isPicking:c,preRenderStats:f={}}){const{device:A}=this.context;if(c)return;const v=t.filter(({props:{visible:$,collisionEnabled:G}})=>$&&G);if(v.length===0){this.channels={};return}const w=e?.filter($=>$.useInPicking&&f[$.id]),S=f["mask-effect"]?.didRender,F=this._groupByCollisionGroup(A,v),N=i[0],U=!this.lastViewport||!this.lastViewport.equals(N)||S;for(const $ in F){const G=this.collisionFBOs[$],H=F[$],[J,ue]=A.canvasContext.getPixelSize();G.resize({width:J/W1,height:ue/W1}),this._render(H,{effects:w,layerFilter:n,onViewportActive:s,views:o,viewport:N,viewportChanged:U})}}_render(e,{effects:t,layerFilter:n,onViewportActive:i,views:s,viewport:o,viewportChanged:c}){const{collisionGroup:f}=e,A=this.channels[f];if(!A)return;const v=c||e===A||!rs(A.layers,e.layers,1)||e.layerBounds.some((w,S)=>!ma(w,A.layerBounds[S]))||e.allLayersLoaded!==A.allLayersLoaded||e.layers.some(w=>w.props.transitions);if(this.channels[f]=e,v){this.lastViewport=o;const w=this.collisionFBOs[f];this.collisionFilterPass.renderCollisionMap(w,{pass:"collision-filter",isPicking:!0,layers:e.layers,effects:t,layerFilter:n,viewports:o?[o]:[],onViewportActive:i,views:s,shaderModuleProps:{collision:{enabled:!0,dummyCollisionMap:this.dummyCollisionMap},project:{devicePixelRatio:w.device.canvasContext.getDevicePixelRatio()/W1}}})}}_groupByCollisionGroup(e,t){const n={};for(const i of t){const s=i.props.collisionGroup;let o=n[s];o||(o={collisionGroup:s,layers:[],layerBounds:[],allLayersLoaded:!0},n[s]=o),o.layers.push(i),o.layerBounds.push(i.getBounds()),i.isLoaded||(o.allLayersLoaded=!1)}for(const i of Object.keys(n))this.collisionFBOs[i]||this.createFBO(e,i),this.channels[i]||(this.channels[i]=n[i]);for(const i of Object.keys(this.collisionFBOs))n[i]||this.destroyFBO(i);return n}getShaderModuleProps(e){const{collisionGroup:t,collisionEnabled:n}=e.props,{collisionFBOs:i,dummyCollisionMap:s}=this,o=i[t];return{collision:{enabled:n&&!!o,collisionFBO:o,dummyCollisionMap:s}}}cleanup(){this.dummyCollisionMap&&(this.dummyCollisionMap.delete(),this.dummyCollisionMap=void 0),this.channels={};for(const e of Object.keys(this.collisionFBOs))this.destroyFBO(e);this.collisionFBOs={},this.lastViewport=void 0}createFBO(e,t){const{width:n,height:i}=e.gl.canvas,s=e.createTexture({format:"rgba8unorm",width:n,height:i,sampler:{minFilter:"nearest",magFilter:"nearest",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}}),o=e.createTexture({format:"depth16unorm",width:n,height:i,mipmaps:!1});this.collisionFBOs[t]=e.createFramebuffer({id:`collision-${t}`,width:n,height:i,colorAttachments:[s],depthStencilAttachment:o})}destroyFBO(e){const t=this.collisionFBOs[e];t.colorAttachments[0]?.destroy(),t.depthStencilAttachment?.destroy(),t.destroy(),delete this.collisionFBOs[e]}}const B1e={getCollisionPriority:{type:"accessor",value:0},collisionEnabled:!0,collisionGroup:{type:"string",value:"default"},collisionTestProps:{}};class hT extends _y{getShaders(){return{modules:[C1e]}}draw({shaderModuleProps:e}){e.collision?.drawToCollisionMap&&(this.props=this.clone(this.props.collisionTestProps).props)}initializeState(e,t){if(this.getAttributeManager()===null)return;this.context.deck?._addDefaultEffect(new E1e),this.getAttributeManager().add({collisionPriorities:{size:1,stepMode:"dynamic",accessor:"getCollisionPriority"}})}getNeedsPickingBuffer(){return this.props.collisionEnabled}}hT.defaultProps=B1e;hT.extensionName="CollisionFilterExtension";function Px(r,e){const t=e?.globalFeatureId;return t!==void 0?S1e(r,t):I1e(r,e?.type)}function S1e(r,e){const t=MN(r);for(const n of t){let i=0,s=n.featureIds.value[0];for(let o=0;o<n.featureIds.value.length;o++){const c=n.featureIds.value[o];if(c!==s){if(e===n.globalFeatureIds.value[i])return Q_(n,i,o);i=o,s=c}}if(e===n.globalFeatureIds.value[i])return Q_(n,i,n.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}function I1e(r,e){const t=MN(r);return P1e(t)}function M1e(r,e,t){switch(r.type){case"Point":return O1e(r,e,t);case"LineString":return D1e(r,e,t);case"Polygon":return PN(r,e,t);default:const n=r;throw new Error(`Unsupported geometry type: ${n?.type}`)}}function MN(r,e){const t=[];return r.points&&(r.points.type="Point",t.push(r.points)),r.lines&&(r.lines.type="LineString",t.push(r.lines)),r.polygons&&(r.polygons.type="Polygon",t.push(r.polygons)),t}function P1e(r){const e=[];for(const t of r){if(t.featureIds.value.length===0)continue;let n=0,i=t.featureIds.value[0];for(let s=0;s<t.featureIds.value.length;s++){const o=t.featureIds.value[s];o!==i&&(e.push(Q_(t,n,s)),n=s,i=o)}e.push(Q_(t,n,t.featureIds.value.length))}return e}function Q_(r,e,t){const n=M1e(r,e,t),i=F1e(r,e),s=R1e(r,e);return{type:"Feature",geometry:n,properties:i,...s}}function R1e(r,e=0,t){return r.fields&&r.fields[r.featureIds.value[e]]}function F1e(r,e=0,t){const n=Object.assign({},r.properties[r.featureIds.value[e]]);for(const i in r.numericProps)n[i]=r.numericProps[i].value[e];return n}function PN(r,e=-1/0,t=1/0){const{positions:n}=r,i=r.polygonIndices.value.filter(f=>f>=e&&f<=t),s=r.primitivePolygonIndices.value.filter(f=>f>=e&&f<=t);if(!(i.length>2)){const f=[];for(let A=0;A<s.length-1;A++){const v=s[A],w=s[A+1],S=ey(n,v,w);f.push(S)}return{type:"Polygon",coordinates:f}}const c=[];for(let f=0;f<i.length-1;f++){const A=i[f],v=i[f+1],w=PN(r,A,v).coordinates;c.push(w)}return{type:"MultiPolygon",coordinates:c}}function D1e(r,e=-1/0,t=1/0){const{positions:n}=r,i=r.pathIndices.value.filter(c=>c>=e&&c<=t);if(!(i.length>2))return{type:"LineString",coordinates:ey(n,i[0],i[1])};const o=[];for(let c=0;c<i.length-1;c++){const f=ey(n,i[c],i[c+1]);o.push(f)}return{type:"MultiLineString",coordinates:o}}function O1e(r,e,t){const{positions:n}=r,i=ey(n,e,t);return i.length>1?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function ey(r,e,t){e=e||0,t=t||r.value.length/r.size;const n=[];for(let i=e;i<t;i++){const s=Array();for(let o=i*r.size;o<(i+1)*r.size;o++)s.push(Number(r.value[o]));n.push(s)}return n}var T0={};var DF;function L1e(){return DF||(DF=1,T0.read=function(r,e,t,n,i){var s,o,c=i*8-n-1,f=(1<<c)-1,A=f>>1,v=-7,w=t?i-1:0,S=t?-1:1,F=r[e+w];for(w+=S,s=F&(1<<-v)-1,F>>=-v,v+=c;v>0;s=s*256+r[e+w],w+=S,v-=8);for(o=s&(1<<-v)-1,s>>=-v,v+=n;v>0;o=o*256+r[e+w],w+=S,v-=8);if(s===0)s=1-A;else{if(s===f)return o?NaN:(F?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-A}return(F?-1:1)*o*Math.pow(2,s-n)},T0.write=function(r,e,t,n,i,s){var o,c,f,A=s*8-i-1,v=(1<<A)-1,w=v>>1,S=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,F=n?0:s-1,N=n?1:-1,U=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,o=v):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+w>=1?e+=S/f:e+=S*Math.pow(2,1-w),e*f>=2&&(o++,f/=2),o+w>=v?(c=0,o=v):o+w>=1?(c=(e*f-1)*Math.pow(2,i),o=o+w):(c=e*Math.pow(2,w-1)*Math.pow(2,i),o=0));i>=8;r[t+F]=c&255,F+=N,c/=256,i-=8);for(o=o<<i|c,A+=i;A>0;r[t+F]=o&255,F+=N,o/=256,A-=8);r[t+F-N]|=U*128}),T0}var J1,OF;function k1e(){if(OF)return J1;OF=1,J1=e;var r=L1e();function e(W){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(W)?W:new Uint8Array(W||0),this.pos=0,this.type=0,this.length=this.buf.length}e.Varint=0,e.Fixed64=1,e.Bytes=2,e.Fixed32=5;var t=65536*65536,n=1/t,i=12,s=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");e.prototype={destroy:function(){this.buf=null},readFields:function(W,re,Ee){for(Ee=Ee||this.length;this.pos<Ee;){var et=this.readVarint(),_e=et>>3,Le=this.pos;this.type=et&7,W(_e,re,this),this.pos===Le&&this.skip(et)}return re},readMessage:function(W,re){return this.readFields(W,re,this.readVarint()+this.pos)},readFixed32:function(){var W=se(this.buf,this.pos);return this.pos+=4,W},readSFixed32:function(){var W=Ue(this.buf,this.pos);return this.pos+=4,W},readFixed64:function(){var W=se(this.buf,this.pos)+se(this.buf,this.pos+4)*t;return this.pos+=8,W},readSFixed64:function(){var W=se(this.buf,this.pos)+Ue(this.buf,this.pos+4)*t;return this.pos+=8,W},readFloat:function(){var W=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,W},readDouble:function(){var W=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,W},readVarint:function(W){var re=this.buf,Ee,et;return et=re[this.pos++],Ee=et&127,et<128||(et=re[this.pos++],Ee|=(et&127)<<7,et<128)||(et=re[this.pos++],Ee|=(et&127)<<14,et<128)||(et=re[this.pos++],Ee|=(et&127)<<21,et<128)?Ee:(et=re[this.pos],Ee|=(et&15)<<28,o(Ee,W,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var W=this.readVarint();return W%2===1?(W+1)/-2:W/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var W=this.readVarint()+this.pos,re=this.pos;return this.pos=W,W-re>=i&&s?me(this.buf,re,W):de(this.buf,re,W)},readBytes:function(){var W=this.readVarint()+this.pos,re=this.buf.subarray(this.pos,W);return this.pos=W,re},readPackedVarint:function(W,re){if(this.type!==e.Bytes)return W.push(this.readVarint(re));var Ee=c(this);for(W=W||[];this.pos<Ee;)W.push(this.readVarint(re));return W},readPackedSVarint:function(W){if(this.type!==e.Bytes)return W.push(this.readSVarint());var re=c(this);for(W=W||[];this.pos<re;)W.push(this.readSVarint());return W},readPackedBoolean:function(W){if(this.type!==e.Bytes)return W.push(this.readBoolean());var re=c(this);for(W=W||[];this.pos<re;)W.push(this.readBoolean());return W},readPackedFloat:function(W){if(this.type!==e.Bytes)return W.push(this.readFloat());var re=c(this);for(W=W||[];this.pos<re;)W.push(this.readFloat());return W},readPackedDouble:function(W){if(this.type!==e.Bytes)return W.push(this.readDouble());var re=c(this);for(W=W||[];this.pos<re;)W.push(this.readDouble());return W},readPackedFixed32:function(W){if(this.type!==e.Bytes)return W.push(this.readFixed32());var re=c(this);for(W=W||[];this.pos<re;)W.push(this.readFixed32());return W},readPackedSFixed32:function(W){if(this.type!==e.Bytes)return W.push(this.readSFixed32());var re=c(this);for(W=W||[];this.pos<re;)W.push(this.readSFixed32());return W},readPackedFixed64:function(W){if(this.type!==e.Bytes)return W.push(this.readFixed64());var re=c(this);for(W=W||[];this.pos<re;)W.push(this.readFixed64());return W},readPackedSFixed64:function(W){if(this.type!==e.Bytes)return W.push(this.readSFixed64());var re=c(this);for(W=W||[];this.pos<re;)W.push(this.readSFixed64());return W},skip:function(W){var re=W&7;if(re===e.Varint)for(;this.buf[this.pos++]>127;);else if(re===e.Bytes)this.pos=this.readVarint()+this.pos;else if(re===e.Fixed32)this.pos+=4;else if(re===e.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+re)},writeTag:function(W,re){this.writeVarint(W<<3|re)},realloc:function(W){for(var re=this.length||16;re<this.pos+W;)re*=2;if(re!==this.length){var Ee=new Uint8Array(re);Ee.set(this.buf),this.buf=Ee,this.length=re}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(W){this.realloc(4),Te(this.buf,W,this.pos),this.pos+=4},writeSFixed32:function(W){this.realloc(4),Te(this.buf,W,this.pos),this.pos+=4},writeFixed64:function(W){this.realloc(8),Te(this.buf,W&-1,this.pos),Te(this.buf,Math.floor(W*n),this.pos+4),this.pos+=8},writeSFixed64:function(W){this.realloc(8),Te(this.buf,W&-1,this.pos),Te(this.buf,Math.floor(W*n),this.pos+4),this.pos+=8},writeVarint:function(W){if(W=+W||0,W>268435455||W<0){A(W,this);return}this.realloc(4),this.buf[this.pos++]=W&127|(W>127?128:0),!(W<=127)&&(this.buf[this.pos++]=(W>>>=7)&127|(W>127?128:0),!(W<=127)&&(this.buf[this.pos++]=(W>>>=7)&127|(W>127?128:0),!(W<=127)&&(this.buf[this.pos++]=W>>>7&127)))},writeSVarint:function(W){this.writeVarint(W<0?-W*2-1:W*2)},writeBoolean:function(W){this.writeVarint(!!W)},writeString:function(W){W=String(W),this.realloc(W.length*4),this.pos++;var re=this.pos;this.pos=pe(this.buf,W,this.pos);var Ee=this.pos-re;Ee>=128&&S(re,Ee,this),this.pos=re-1,this.writeVarint(Ee),this.pos+=Ee},writeFloat:function(W){this.realloc(4),r.write(this.buf,W,this.pos,!0,23,4),this.pos+=4},writeDouble:function(W){this.realloc(8),r.write(this.buf,W,this.pos,!0,52,8),this.pos+=8},writeBytes:function(W){var re=W.length;this.writeVarint(re),this.realloc(re);for(var Ee=0;Ee<re;Ee++)this.buf[this.pos++]=W[Ee]},writeRawMessage:function(W,re){this.pos++;var Ee=this.pos;W(re,this);var et=this.pos-Ee;et>=128&&S(Ee,et,this),this.pos=Ee-1,this.writeVarint(et),this.pos+=et},writeMessage:function(W,re,Ee){this.writeTag(W,e.Bytes),this.writeRawMessage(re,Ee)},writePackedVarint:function(W,re){re.length&&this.writeMessage(W,F,re)},writePackedSVarint:function(W,re){re.length&&this.writeMessage(W,N,re)},writePackedBoolean:function(W,re){re.length&&this.writeMessage(W,G,re)},writePackedFloat:function(W,re){re.length&&this.writeMessage(W,U,re)},writePackedDouble:function(W,re){re.length&&this.writeMessage(W,$,re)},writePackedFixed32:function(W,re){re.length&&this.writeMessage(W,H,re)},writePackedSFixed32:function(W,re){re.length&&this.writeMessage(W,J,re)},writePackedFixed64:function(W,re){re.length&&this.writeMessage(W,ue,re)},writePackedSFixed64:function(W,re){re.length&&this.writeMessage(W,q,re)},writeBytesField:function(W,re){this.writeTag(W,e.Bytes),this.writeBytes(re)},writeFixed32Field:function(W,re){this.writeTag(W,e.Fixed32),this.writeFixed32(re)},writeSFixed32Field:function(W,re){this.writeTag(W,e.Fixed32),this.writeSFixed32(re)},writeFixed64Field:function(W,re){this.writeTag(W,e.Fixed64),this.writeFixed64(re)},writeSFixed64Field:function(W,re){this.writeTag(W,e.Fixed64),this.writeSFixed64(re)},writeVarintField:function(W,re){this.writeTag(W,e.Varint),this.writeVarint(re)},writeSVarintField:function(W,re){this.writeTag(W,e.Varint),this.writeSVarint(re)},writeStringField:function(W,re){this.writeTag(W,e.Bytes),this.writeString(re)},writeFloatField:function(W,re){this.writeTag(W,e.Fixed32),this.writeFloat(re)},writeDoubleField:function(W,re){this.writeTag(W,e.Fixed64),this.writeDouble(re)},writeBooleanField:function(W,re){this.writeVarintField(W,!!re)}};function o(W,re,Ee){var et=Ee.buf,_e,Le;if(Le=et[Ee.pos++],_e=(Le&112)>>4,Le<128||(Le=et[Ee.pos++],_e|=(Le&127)<<3,Le<128)||(Le=et[Ee.pos++],_e|=(Le&127)<<10,Le<128)||(Le=et[Ee.pos++],_e|=(Le&127)<<17,Le<128)||(Le=et[Ee.pos++],_e|=(Le&127)<<24,Le<128)||(Le=et[Ee.pos++],_e|=(Le&1)<<31,Le<128))return f(W,_e,re);throw new Error("Expected varint not more than 10 bytes")}function c(W){return W.type===e.Bytes?W.readVarint()+W.pos:W.pos+1}function f(W,re,Ee){return Ee?re*4294967296+(W>>>0):(re>>>0)*4294967296+(W>>>0)}function A(W,re){var Ee,et;if(W>=0?(Ee=W%4294967296|0,et=W/4294967296|0):(Ee=~(-W%4294967296),et=~(-W/4294967296),Ee^4294967295?Ee=Ee+1|0:(Ee=0,et=et+1|0)),W>=18446744073709552e3||W<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");re.realloc(10),v(Ee,et,re),w(et,re)}function v(W,re,Ee){Ee.buf[Ee.pos++]=W&127|128,W>>>=7,Ee.buf[Ee.pos++]=W&127|128,W>>>=7,Ee.buf[Ee.pos++]=W&127|128,W>>>=7,Ee.buf[Ee.pos++]=W&127|128,W>>>=7,Ee.buf[Ee.pos]=W&127}function w(W,re){var Ee=(W&7)<<4;re.buf[re.pos++]|=Ee|((W>>>=3)?128:0),W&&(re.buf[re.pos++]=W&127|((W>>>=7)?128:0),W&&(re.buf[re.pos++]=W&127|((W>>>=7)?128:0),W&&(re.buf[re.pos++]=W&127|((W>>>=7)?128:0),W&&(re.buf[re.pos++]=W&127|((W>>>=7)?128:0),W&&(re.buf[re.pos++]=W&127)))))}function S(W,re,Ee){var et=re<=16383?1:re<=2097151?2:re<=268435455?3:Math.floor(Math.log(re)/(Math.LN2*7));Ee.realloc(et);for(var _e=Ee.pos-1;_e>=W;_e--)Ee.buf[_e+et]=Ee.buf[_e]}function F(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeVarint(W[Ee])}function N(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeSVarint(W[Ee])}function U(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeFloat(W[Ee])}function $(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeDouble(W[Ee])}function G(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeBoolean(W[Ee])}function H(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeFixed32(W[Ee])}function J(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeSFixed32(W[Ee])}function ue(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeFixed64(W[Ee])}function q(W,re){for(var Ee=0;Ee<W.length;Ee++)re.writeSFixed64(W[Ee])}function se(W,re){return(W[re]|W[re+1]<<8|W[re+2]<<16)+W[re+3]*16777216}function Te(W,re,Ee){W[Ee]=re,W[Ee+1]=re>>>8,W[Ee+2]=re>>>16,W[Ee+3]=re>>>24}function Ue(W,re){return(W[re]|W[re+1]<<8|W[re+2]<<16)+(W[re+3]<<24)}function de(W,re,Ee){for(var et="",_e=re;_e<Ee;){var Le=W[_e],Ge=null,Ze=Le>239?4:Le>223?3:Le>191?2:1;if(_e+Ze>Ee)break;var tt,rt,ut;Ze===1?Le<128&&(Ge=Le):Ze===2?(tt=W[_e+1],(tt&192)===128&&(Ge=(Le&31)<<6|tt&63,Ge<=127&&(Ge=null))):Ze===3?(tt=W[_e+1],rt=W[_e+2],(tt&192)===128&&(rt&192)===128&&(Ge=(Le&15)<<12|(tt&63)<<6|rt&63,(Ge<=2047||Ge>=55296&&Ge<=57343)&&(Ge=null))):Ze===4&&(tt=W[_e+1],rt=W[_e+2],ut=W[_e+3],(tt&192)===128&&(rt&192)===128&&(ut&192)===128&&(Ge=(Le&15)<<18|(tt&63)<<12|(rt&63)<<6|ut&63,(Ge<=65535||Ge>=1114112)&&(Ge=null))),Ge===null?(Ge=65533,Ze=1):Ge>65535&&(Ge-=65536,et+=String.fromCharCode(Ge>>>10&1023|55296),Ge=56320|Ge&1023),et+=String.fromCharCode(Ge),_e+=Ze}return et}function me(W,re,Ee){return s.decode(W.subarray(re,Ee))}function pe(W,re,Ee){for(var et=0,_e,Le;et<re.length;et++){if(_e=re.charCodeAt(et),_e>55295&&_e<57344)if(Le)if(_e<56320){W[Ee++]=239,W[Ee++]=191,W[Ee++]=189,Le=_e;continue}else _e=Le-55296<<10|_e-56320|65536,Le=null;else{_e>56319||et+1===re.length?(W[Ee++]=239,W[Ee++]=191,W[Ee++]=189):Le=_e;continue}else Le&&(W[Ee++]=239,W[Ee++]=191,W[Ee++]=189,Le=null);_e<128?W[Ee++]=_e:(_e<2048?W[Ee++]=_e>>6|192:(_e<65536?W[Ee++]=_e>>12|224:(W[Ee++]=_e>>18|240,W[Ee++]=_e>>12&63|128),W[Ee++]=_e>>6&63|128),W[Ee++]=_e&63|128)}return Ee}return J1}var N1e=k1e();const U1e=_h(N1e),z1e="4.2.4",RN={dataType:null,batchType:null,name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:z1e,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}};({...RN});const G1e={Point:FN,MultiPoint:V1e,LineString:DN,MultiLineString:H1e,Polygon:ON,MultiPolygon:j1e};function FN([r,e],[t,n],i){const s=Cc(t[0],n[0],r),o=Cc(t[1],n[1],e);return i.unprojectFlat([s,o])}function dT(r,e,t){return r.map(n=>FN(n,e,t))}function V1e(r,e,t){return dT(r,e,t)}function DN(r,e,t){return dT(r,e,t)}function H1e(r,e,t){return r.map(n=>DN(n,e,t))}function ON(r,e,t){return r.map(n=>dT(n,e,t))}function j1e(r,e,t){return r.map(n=>ON(n,e,t))}function $1e(r,e,t){const n=t.projectFlat([e.west,e.north]),i=t.projectFlat([e.east,e.south]),s=[n,i];return{...r,coordinates:G1e[r.type](r.coordinates,s,t)}}const W1e=["points","lines","polygons"];function J1e(r,e,t,n){for(const i of W1e){const s=r[i]&&X1e(r[i],e,t,n);if(s>=0)return s}return-1}function X1e(r,e,t,n){const i=r.featureIds.value;if(!i.length)return-1;let s=0,o=i[i.length-1]+1;if(n){const f=K1e(r,n);if(f)s=f[0],o=f[1]+1;else return-1}let c=-1;if(e in r.numericProps){const f=r.numericProps[e].value.findIndex((A,v)=>A===t&&i[v]>=s&&i[v]<o);return f>=0?r.globalFeatureIds.value[f]:-1}else e?c=LF(r.properties,f=>f[e]===t,s,o):r.fields&&(c=LF(r.fields,f=>f.id===t,s,o));return c>=0?q1e(r,c):-1}function K1e(r,e){if(!r.__layers){const t={},{properties:n}=r;for(let i=0;i<n.length;i++){const{layerName:s}=n[i];s&&(t[s]?t[s][1]=i:t[s]=[i,i])}r.__layers=t}return r.__layers[e]}function q1e(r,e){if(!r.__ids){const t=[],n=r.featureIds.value,i=r.globalFeatureIds.value;for(let s=0;s<n.length;s++)t[n[s]]=i[s];r.__ids=t}return r.__ids[e]}function LF(r,e,t,n){for(let i=t;i<n;i++)if(e(r[i],i))return i;return-1}const X1=512,Y1e={...iu.defaultProps,data:H_,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[RN],binary:!0};class Xp extends ou{initializeState(){super.initializeState();const e=this.context.viewport.resolution!==void 0?!1:this.props.binary;this.setState({binary:e,data:null,tileJSON:null,hoveredFeatureId:null,hoveredFeatureLayerName:null})}get isLoaded(){return!!(this.state?.data&&super.isLoaded)}updateState({props:e,oldProps:t,context:n,changeFlags:i}){i.dataChanged&&this._updateTileData(),this.state?.data&&(super.updateState({props:e,oldProps:t,context:n,changeFlags:i}),this._setWGS84PropertyForTiles());const{highlightColor:s}=e;s!==t.highlightColor&&Array.isArray(s)&&this.setState({highlightColor:s})}async _updateTileData(){let e=this.props.data,t=null;if(typeof e=="string"&&!nde(e)){const{onDataLoad:n,fetch:i}=this.props;this.setState({data:null,tileJSON:null});try{t=await i(e,{propName:"data",layer:this,loaders:[]})}catch(s){this.raiseError(s,"loading TileJSON"),e=null}n&&n(t,{propName:"data",layer:this})}else e&&typeof e=="object"&&"tilejson"in e&&(t=e);t&&(e=t.tiles),this.setState({data:e,tileJSON:t})}_getTilesetOptions(){const e=super._getTilesetOptions(),t=this.state.tileJSON,{minZoom:n,maxZoom:i}=this.props;return t&&(Number.isFinite(t.minzoom)&&t.minzoom>n&&(e.minZoom=t.minzoom),Number.isFinite(t.maxzoom)&&(!Number.isFinite(i)||t.maxzoom<i)&&(e.maxZoom=t.maxzoom)),e}renderLayers(){return this.state?.data?super.renderLayers():null}getTileData(e){const{data:t,binary:n}=this.state,{index:i,signal:s}=e,o=ph(t,e);if(!o)return Promise.reject("Invalid URL");let c=this.getLoadOptions();const{fetch:f}=this.props;return c={...c,mimeType:"application/x-protobuf",mvt:{...c?.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:i},gis:n?{format:"binary"}:{}},f(o,{propName:"data",layer:this,loadOptions:c,signal:s})}renderSubLayers(e){const{x:t,y:n,z:i}=e.tile.index,s=Math.pow(2,i),o=X1/s,c=-o,f=X1*t/s,A=X1*(1-n/s),v=new vn().scale([o,c,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=v,e.coordinateOrigin=[f,A,0],e.coordinateSystem=Qr.CARTESIAN,e.extensions=[...e.extensions||[],new Ky]);const w=super.renderSubLayers(e);return this.state.binary&&!(w instanceof iu)&&Yr.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),w}_updateAutoHighlight(e){const{uniqueIdProperty:t}=this.props,{hoveredFeatureId:n,hoveredFeatureLayerName:i}=this.state,s=e.object;let o=null,c=null;s&&(o=K1(s,t),c=kF(s));let{highlightColor:f}=this.props;typeof f=="function"&&(f=f(e)),(n!==o||i!==c)&&this.setState({highlightColor:f,hoveredFeatureId:o,hoveredFeatureLayerName:c})}_isWGS84(){return!!this.context.viewport.resolution}getPickingInfo(e){const t=super.getPickingInfo(e);if(this.state.binary&&t.index!==-1){const{data:n}=e.sourceLayer.props;t.object=Px(n,{globalFeatureId:t.index})}return t.object&&!this._isWGS84()&&(t.object=UF(t.object,t.tile.bbox,this.context.viewport)),t}getSubLayerPropsByTile(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(e){const{hoveredFeatureId:t,hoveredFeatureLayerName:n,binary:i}=this.state,{uniqueIdProperty:s,highlightedFeatureId:o}=this.props,c=e.content,f=NF(o);if(!(NF(t)||f))return-1;const v=f?o:t;return Array.isArray(c)?c.findIndex(w=>{const S=K1(w,s)===v,F=f||kF(w)===n;return S&&F}):c&&i?J1e(c,s,v,f?"":n):-1}_pickObjects(e){const{deck:t,viewport:n}=this.context,i=n.width,s=n.height,o=n.x,c=n.y,f=[this.id];return t.pickObjects({x:o,y:c,width:i,height:s,layerIds:f,maxObjects:e})}getRenderedFeatures(e=null){const t=this._pickObjects(e),n=new Set,i=[];for(const s of t){const o=K1(s.object,this.props.uniqueIdProperty);o===void 0?i.push(s.object):n.has(o)||(n.add(o),i.push(s.object))}return i}_setWGS84PropertyForTiles(){const e="dataInWGS84";this.state.tileset.selectedTiles.forEach(n=>{n.hasOwnProperty(e)||Object.defineProperty(n,e,{get:()=>{if(!n.content)return null;if(this.state.binary&&Array.isArray(n.content)&&!n.content.length)return[];const{bbox:i}=n;if(n._contentWGS84===void 0&&ide(i)){const s=this.state.binary?Px(n.content):n.content;n._contentWGS84=s.map(o=>UF(o,i,this.context.viewport))}return n._contentWGS84}})})}}Xp.layerName="MVTLayer";Xp.defaultProps=Y1e;function K1(r,e){if(r.properties&&e)return r.properties[e];if("id"in r)return r.id}function kF(r){return r.properties?.layerName||null}function NF(r){return r!=null&&r!==""}function UF(r,e,t){const n={...r,geometry:{type:r.geometry.type}};return Object.defineProperty(n.geometry,"coordinates",{get:()=>$1e(r.geometry,e,t).coordinates}),n}const zF="0123456789bcdefghjkmnpqrstuvwxyz",LN={};for(let r=0;r<zF.length;r++)LN[zF.charAt(r)]=r;const Z1e=-90,Q1e=90,e2e=-180,t2e=180;function r2e(r){let e=!0,t=Q1e,n=Z1e,i=t2e,s=e2e,o,c=0;for(let f=0,A=r.length;f<A;f++){const v=r[f].toLowerCase();c=LN[v];for(let w=4;w>=0;w--){const S=c>>w&1;e?(o=(i+s)/2,S===1?s=o:i=o):(o=(t+n)/2,S===1?n=o:t=o),e=!e}}return[n,s,t,i]}function n2e(r){const[e,t,n,i]=r2e(r);return[i,n,i,e,t,e,t,n,i,n]}const i2e={getGeohash:{type:"accessor",value:r=>r.geohash}};class qy extends df{indexToBounds(){const{data:e,getGeohash:t}=this.props;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(n,i)=>n2e(t(n,i))}}}qy.layerName="GeohashLayer";qy.defaultProps=i2e;const s2e=Object.freeze(Object.defineProperty({__proto__:null,GeohashLayer:qy,GreatCircleLayer:TC,H3ClusterLayer:Uy,H3HexagonLayer:_l,MVTLayer:Xp,QuadkeyLayer:Fy,S2Layer:Ry,TerrainLayer:fT,Tile3DLayer:uT,TileLayer:ou,TripsLayer:Ly,_GeoCellLayer:df,_Tile2DHeader:V6,_Tileset2D:Oy,_WMSLayer:CC,_getURLFromTemplate:ph},Symbol.toStringTag,{value:"Module"}));function o2e({pointCount:r,getBinId:e}){const t=new Map;for(let n=0;n<r;n++){const i=e(n);if(i===null)continue;let s=t.get(String(i));s?s.points.push(n):(s={id:i,index:t.size,points:[n]},t.set(String(i),s))}return Array.from(t.values())}function a2e({bins:r,dimensions:e,target:t}){const n=r.length*e;(!t||t.length<n)&&(t=new Float32Array(n));for(let i=0;i<r.length;i++){const{id:s}=r[i];Array.isArray(s)?t.set(s,i*e):t[i]=s}return t}const c2e=r=>r.length,kN=(r,e)=>{let t=0;for(const n of r)t+=e(n);return t},l2e=(r,e)=>r.length===0?NaN:kN(r,e)/r.length,u2e=(r,e)=>{let t=1/0;for(const n of r){const i=e(n);i<t&&(t=i)}return t},f2e=(r,e)=>{let t=-1/0;for(const n of r){const i=e(n);i>t&&(t=i)}return t},h2e={COUNT:c2e,SUM:kN,MEAN:l2e,MIN:u2e,MAX:f2e};function d2e({bins:r,getValue:e,operation:t,target:n}){(!n||n.length<r.length)&&(n=new Float32Array(r.length));let i=1/0,s=-1/0;for(let o=0;o<r.length;o++){const{points:c}=r[o];n[o]=t(c,e),n[o]<i&&(i=n[o]),n[o]>s&&(s=n[o])}return{value:n,domain:[i,s]}}function GF(r,e,t){const n={};for(const s of r.sources||[]){const o=e[s];if(o)n[s]=p2e(o);else throw new Error(`Cannot find attribute ${s}`)}const i={};return s=>{for(const o in n)i[o]=n[o](s);return r.getValue(i,s,t)}}function p2e(r){const e=r.value,{offset:t=0,stride:n,size:i}=r.getAccessor(),s=e.BYTES_PER_ELEMENT,o=t/s,c=n?n/s:i;if(i===1)return r.isConstant?()=>e[0]:A=>{const v=o+c*A;return e[v]};let f;return r.isConstant?(f=Array.from(e),()=>f):(f=new Array(i),A=>{const v=o+c*A;for(let w=0;w<i;w++)f[w]=e[v+w];return f})}class Kp{constructor(e){this.bins=[],this.binIds=null,this.results=[],this.dimensions=e.dimensions,this.channelCount=e.getValue.length,this.props={...e,binOptions:{},pointCount:0,operations:[],customOperations:[],attributes:{}},this.needsUpdate=!0,this.setProps(e)}destroy(){}get binCount(){return this.bins.length}setProps(e){const t=this.props;if(e.binOptions&&(rs(e.binOptions,t.binOptions,2)||this.setNeedsUpdate()),e.operations)for(let n=0;n<this.channelCount;n++)e.operations[n]!==t.operations[n]&&this.setNeedsUpdate(n);if(e.customOperations)for(let n=0;n<this.channelCount;n++)!!e.customOperations[n]!=!!t.customOperations[n]&&this.setNeedsUpdate(n);e.pointCount!==void 0&&e.pointCount!==t.pointCount&&this.setNeedsUpdate(),e.attributes&&(e.attributes={...t.attributes,...e.attributes}),Object.assign(this.props,e)}setNeedsUpdate(e){e===void 0?this.needsUpdate=!0:this.needsUpdate!==!0&&(this.needsUpdate=this.needsUpdate||[],this.needsUpdate[e]=!0)}update(){if(this.needsUpdate===!0){this.bins=o2e({pointCount:this.props.pointCount,getBinId:GF(this.props.getBin,this.props.attributes,this.props.binOptions)});const e=a2e({bins:this.bins,dimensions:this.dimensions,target:this.binIds?.value});this.binIds={value:e,type:"float32",size:this.dimensions}}for(let e=0;e<this.channelCount;e++)if(this.needsUpdate===!0||this.needsUpdate[e]){const t=this.props.customOperations[e]||h2e[this.props.operations[e]],{value:n,domain:i}=d2e({bins:this.bins,getValue:GF(this.props.getValue[e],this.props.attributes,void 0),operation:t,target:this.results[e]?.value});this.results[e]={value:n,domain:i,type:"float32",size:1},this.props.onUpdate?.({channel:e})}this.needsUpdate=!1}preDraw(){}getBins(){return this.binIds}getResult(e){return this.results[e]}getResultDomain(e){return this.results[e]?.domain??[1/0,-1/0]}getBin(e){const t=this.bins[e];if(!t)return null;const n=new Array(this.channelCount);for(let i=0;i<n.length;i++){const s=this.results[i];n[i]=s?.value[e]}return{id:t.id,value:n,count:t.points.length,pointIndices:t.points}}}function NN(r,e,t){return r.createFramebuffer({width:e,height:t,colorAttachments:[r.createTexture({width:e,height:t,format:"rgba32float",mipmaps:!1,sampler:{minFilter:"nearest",magFilter:"nearest"}})]})}const A2e=`uniform binSorterUniforms {
4689
4658
  ivec4 binIdRange;
4690
4659
  ivec2 targetSize;
4691
4660
  } binSorter;
@@ -5363,5 +5332,5 @@ vColor = vec4(color.rgb, color.a * layer.opacity);
5363
5332
  }
5364
5333
  DECKGL_FILTER_COLOR(vColor, geometry);
5365
5334
  }
5366
- `,Twe={...ml.defaultProps,extruded:!1,diskResolution:4,vertices:[[-.5,-.5],[.5,-.5],[.5,.5],[-.5,.5]]};class mU extends fU(ml){getShaders(){const e=super.getShaders(),t=this.props.data,n=t.data.blockSize??Math.sqrt(t.length);return{...e,defines:{...e.defines,BLOCK_WIDTH:n},vs:Cwe}}initializeState(){this.getAttributeManager().addInstanced({instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:[255,255,255,255]}})}}mU.layerName="RasterColumnLayer";function Ewe(r,e){return r.data===e.data&&r.length===e.length}class kT extends Bs{renderLayers(){const{data:e,getElevation:t,getFillColor:n,getLineColor:i,getLineWidth:s,tileIndex:o,updateTriggers:c}=this.props;if(!e||!o)return null;const f=e.blockSize??0,[A,v,w]=eU(o),S=[A,v],F=w/f,N=this.getSubLayerClass("column",mU),{highlightedObjectIndex:U,highlightColor:$}=this.state;return new N(this.props,this.getSubLayerProps({id:"cell",updateTriggers:c,getElevation:this.getSubLayerAccessor(t),getFillColor:this.getSubLayerAccessor(n),getLineColor:this.getSubLayerAccessor(i),getLineWidth:this.getSubLayerAccessor(s)}),{data:{data:e,length:f*f},dataComparator:Ewe,offset:S,lineWidthScale:F,highlightedObjectIndex:U,highlightColor:$,parameters:{blendColorSrcFactor:"one",blendAlphaSrcFactor:"one",blendColorDstFactor:"zero",blendAlphaDstFactor:"zero",blendColorOperation:"add",blendAlphaOperation:"add"}})}getSubLayerAccessor(e){return typeof e!="function"?super.getSubLayerAccessor(e):(t,n)=>{const{data:i,index:s}=n,o=i.data,c=Lxe(o.cells,s);return e({properties:c},n)}}getPickingInfo(e){const t=super.getPickingInfo(e);return t.index!==-1&&(t.object=this.getSubLayerAccessor(n=>n)(void 0,{data:this.props,index:t.index})),t}_updateAutoHighlight(e){const{highlightedObjectIndex:t}=this.state;let n=-1;if(e.index!==-1&&(n=e.index),t!==n){let{highlightColor:i}=this.props;typeof i=="function"&&(i=i(e)),this.setState({highlightColor:i,highlightedObjectIndex:n})}}}kT.layerName="RasterLayer";kT.defaultProps=Twe;const Bwe={uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,uint64:BigUint64Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,int64:BigInt64Array,float32:Float32Array,float64:Float64Array};class NT{static read(e,t){return e.readFields(NT._readField,{name:"",type:"",data:null},t)}static _readField(e,t,n){if(e===1)t.name=n.readString();else if(e===2)t.type=n.readString();else if(e===3){const i=Bwe[t.type];if(!i)throw Error(`Invalid data type: ${t.type}`);t.data={};const{compression:s}=Ox;tv(i,n,t.data,{compression:s})}}}let Ox=class _U{static read(e,t){return e.readFields(_U._readField,{blockSize:0,bands:[]},t)}static _readField(e,t,n){e===1?t.blockSize=n.readVarint():e===2&&t.bands.push(NT.read(n,n.readVarint()+n.pos))}};const yU="9.1.14",vU="cartoRasterTile",Swe={cartoRasterTile:{metadata:null,workerUrl:ev(vU,yU)}},Iwe={name:"CARTO Raster Tile",version:yU,id:vU,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-raster-tile"],category:"geometry",parse:async(r,e)=>FD(r,e),parseSync:FD,worker:!0,options:Swe};function FD(r,e){const t=e?.cartoRasterTile?.metadata;if(!r||!t)return null;Ox.compression=t.compression;const n=rv(r,Ox),{bands:i,blockSize:s}=n,o={};for(let c=0;c<i.length;c++){const{name:f,data:A}=i[c];o[f]=A}return{blockSize:s,cells:{numericProps:o,properties:[]}}}Ug([Iwe]);const Mwe=r=>{const e=r.tile?.index?.q;return e?new kT(r,{tileIndex:e}):null},Pwe={data:mh,refinementStrategy:"no-overlap",tileSize:Yp};class Rwe extends hU(ou,hwe){filterSubLayer(e){const{tile:t}=e.layer.props;return t?super.filterSubLayer(e):!0}}class UT extends Bs{getLoadOptions(){const e=this.props.data;return Zp(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${e.accessToken}`}}})}renderLayers(){const e=this.props.data;if(!e)return null;const{tiles:t,minzoom:n,maxzoom:i,raster_metadata:s}=e,o=this.getSubLayerClass("tile",Rwe),c=this.getLoadOptions();return new o(this.props,{id:`raster-tile-layer-${this.props.id}`,data:t,TilesetClass:CT,renderSubLayers:Mwe,minZoom:n,maxZoom:i,loadOptions:{...c,cartoRasterTile:{...c?.cartoRasterTile,metadata:s}}})}}UT.layerName="RasterTileLayer";UT.defaultProps=Pwe;class zT{static read(e,t){return e.readFields(zT._readField,{properties:[],numericProps:{}},t)}static _readField(e,t,n){if(e===1)t.properties.push(Ih.read(n,n.readVarint()+n.pos));else if(e===2){const i=Mh.read(n,n.readVarint()+n.pos);t.numericProps[i.key]=i.value}}}const bU="9.1.14",xU="cartoPropertiesTile",Fwe={cartoPropertiesTile:{workerUrl:ev(xU,bU)}},Dwe={name:"CARTO Properties Tile",version:bU,id:xU,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-properties-tile"],category:"geometry",worker:!0,parse:async(r,e)=>DD(r),parseSync:DD,options:Fwe};function DD(r,e){return r?rv(r,zT):null}const wU="9.1.14",CU="cartoVectorTile",Owe={cartoVectorTile:{workerUrl:ev(CU,wU)}},Lwe={name:"CARTO Vector Tile",version:wU,id:CU,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-vector-tile"],category:"geometry",parse:async(r,e)=>OD(r),parseSync:OD,worker:!0,options:Owe};function kwe(r,e,{startPosition:t,endPosition:n,indices:i}){const s=r.positions.size,o=t*s,c=n*s,f=r.positions.value.subarray(o,c),A=i.slice(1).map(w=>w-t),v=y6(f,A,s);for(let w=0,S=v.length;w<S;++w)e.push(t+v[w])}function Nwe(r){const{polygonIndices:e,primitivePolygonIndices:t}=r,n=[];let i=0;for(let s=0;s<e.value.length-1;s++){const o=e.value[s],c=e.value[s+1],f=t.value.indexOf(c),A=t.value.subarray(i,f);i=f,kwe(r,n,{startPosition:o,endPosition:c,indices:A})}r.triangles={value:new Uint32Array(n),size:1}}function OD(r,e){if(!r)return null;const t=rv(r,qxe);return t.polygons&&!t.polygons.triangles&&Nwe(t.polygons),t}function Uwe(r,e){const t=e?e in r.numericProps:!1,n=new Map;for(let v=0;v<r.pathIndices.value.length-1;v++){const w=r.pathIndices.value[v],S=r.featureIds.value[w];let F;e===void 0?F=S:t?F=r.numericProps[e].value[w]:r.properties[S]&&e in r.properties[S]?F=r.properties[S][e]:F=void 0;const N=Wwe(r,v);(!n.has(F)||N>n.get(F).length)&&n.set(F,{index:v,length:N})}const i=[],s=[],o=[],c=[],f=ZN(n.size,r.numericProps);let A=0;for(const[v,{index:w}]of n){const S=Jwe(r,w);i.push(...S);const F=r.pathIndices.value[w],N=r.featureIds.value[F];o.push(A),s.push(r.properties[N]),c.push(r.globalFeatureIds.value[F]),QN(r.numericProps,f,F,A),A++}return wT(i,o,c,f,s)}function zwe(r,e,t){const{west:n,south:i,east:s,north:o}=e,f=(s-n)*(o-i)*1e-4,A=[],v=[],w=[],S=[],F=ZN(r.polygonIndices.value.length-1,r.numericProps);let N=0,U=0;const{extruded:$}=t;for(let G=0;G<r.polygonIndices.value.length-1;G++){const H=r.polygonIndices.value[G],J=r.polygonIndices.value[G+1];if(Gwe(r,G)<f)continue;const ue=jwe(r,G);let q=-1,se=[0,0],Te=!1;for(;U<r.triangles.value.length;){const de=r.triangles.value[U];if(de>=J)break;if(Te){U+=3;continue}const me=r.triangles.value[U+1],pe=r.triangles.value[U+2],W=r.positions.value.subarray(de*r.positions.size,de*r.positions.size+r.positions.size),re=r.positions.value.subarray(me*r.positions.size,me*r.positions.size+r.positions.size),Ee=r.positions.value.subarray(pe*r.positions.size,pe*r.positions.size+r.positions.size);if(Hwe(ue,W,re,Ee))Te=!0;else{const et=TU(W,re,Ee);et>q&&(q=et,se=[(W[0]+re[0]+Ee[0])/3,(W[1]+re[1]+Ee[1])/3])}U+=3}const Ue=Te?ue:se;if(Vwe(Ue,e)){A.push(...Ue);const de=r.featureIds.value[H];if($){const me=t.getElevation(void 0,{data:r,index:de});A.push(me*t.elevationScale)}v.push(r.properties[de]),w.push(N),S.push(r.globalFeatureIds.value[H]),QN(r.numericProps,F,H,N),N++}}return r.numericProps&&Object.keys(F).forEach(G=>{F[G].value=F[G].value.slice(0,N)}),wT(A,w,S,F,v,$?3:2)}function Gwe(r,e){const{positions:{value:t,size:n},polygonIndices:{value:i},triangles:{value:s}}=r,o=i[e],c=i[e+1];let f=0,A=0;for(;A<s.length&&!(s[A]>=o);)A+=3;for(;A<s.length;){const v=s[A];if(v>=c)break;const w=s[A+1],S=s[A+2],F=t.subarray(v*n,v*n+n),N=t.subarray(w*n,w*n+n),U=t.subarray(S*n,S*n+n);f+=TU(F,N,U),A+=3}return f}function Vwe([r,e],{west:t,east:n,south:i,north:s}){return r>=t&&r<n&&e>=i&&e<s}function Hwe(r,e,t,n){const i=Math.abs((t[0]-e[0])*(n[1]-e[1])-(n[0]-e[0])*(t[1]-e[1]))/2,s=Math.abs((e[0]-r[0])*(t[1]-r[1])-(t[0]-r[0])*(e[1]-r[1]))/2,o=Math.abs((t[0]-r[0])*(n[1]-r[1])-(n[0]-r[0])*(t[1]-r[1]))/2,c=Math.abs((n[0]-r[0])*(e[1]-r[1])-(e[0]-r[0])*(n[1]-r[1]))/2;return Math.abs(i-(s+o+c))<1e-10}function TU([r,e],[t,n],[i,s]){return Math.abs((r*(n-s)+t*(s-e)+i*(e-n))/2)}function jwe(r,e){const{positions:{value:t,size:n}}=r,i=n*r.polygonIndices.value[e],s=n*r.polygonIndices.value[e+1];let o=1/0,c=1/0,f=-1/0,A=-1/0;for(let v=i;v<s;v+=n){const[w,S]=t.subarray(v,v+2);o=Math.min(o,w),c=Math.min(c,S),f=Math.max(f,w),A=Math.max(A,S)}return[(o+f)/2,(c+A)/2]}function $we(r,e){const{positions:{value:t}}=r,[n,i,s,o]=t.subarray(e,e+4);return Math.sqrt(Math.pow(s-n,2)+Math.pow(o-i,2))}function Wwe(r,e){const{positions:{size:t}}=r,n=t*r.pathIndices.value[e],i=t*r.pathIndices.value[e+1];let s=0;for(let o=n;o<i;o+=t)s+=$we(r,o);return s}function Jwe(r,e){const{positions:{value:t},pathIndices:{value:n}}=r,i=n[e]*2,o=(n[e+1]*2-i)/2;if(o===2){const[f,A,v,w]=t.subarray(i,i+4);return[(f+v)/2,(A+w)/2]}const c=i+Math.floor(o/2)*2;return[t[c],t[c+1]]}Ug([Dwe,Lwe]);const Xwe={...Xp.defaultProps,autoLabels:!1,data:mh,dataComparator:mh.equal,tileSize:Yp};class GT extends Xp{constructor(...e){super(...e)}initializeState(){super.initializeState(),this.setState({binary:!0})}updateState(e){const{props:t}=e;if(t.data){super.updateState(e);const i=new URL(t.data.tiles[0]).searchParams.get("formatTiles")==="mvt";this.setState({mvt:i})}}getLoadOptions(){const e=this.props.data;return Zp(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${e.accessToken}`}},gis:{format:"binary"}})}async getTileData(e){const t=this.props.data,{tiles:n,properties_tiles:i}=t,s=ph(n,e);if(!s)return Promise.reject("Invalid URL");const o=this.getLoadOptions(),{fetch:c}=this.props,{signal:f}=e,A=c(s,{propName:"data",layer:this,loadOptions:o,signal:f});if(!i)return await A;const v=ph(i,e);if(!v)return Promise.reject("Invalid properties URL");const w=c(v,{propName:"data",layer:this,loadOptions:o,signal:f}),[S,F]=await Promise.all([A,w]);return S?F?ewe(S,F):S:null}renderSubLayers(e){if(e.data===null)return null;const t=e.tile.bbox,n=[],i={"points-text":{type:sv,...e?._subLayerProps?.["points-text"],extensions:[new hT,...e.extensions||[],...e?._subLayerProps?.["points-text"]?.extensions||[]]}};if(this.state.mvt)n.push(super.renderSubLayers(e));else{const{west:s,south:o,east:c,north:f}=t,A=[new Ky,...e.extensions||[]],v={clipBounds:[s,o,c,f]},w=F=>({[F]:{...v,...e?._subLayerProps?.[F],extensions:[...A,...e?._subLayerProps?.[F]?.extensions||[]]}}),S={...e,data:{...e.data,tileBbox:t},autoHighlight:!1,_subLayerProps:{...e._subLayerProps,...i,...w("polygons-fill"),...w("polygons-stroke"),...w("linestrings")}};n.push(new iu(S))}if(n[0]&&e.autoLabels){const s=YN();e.data.lines&&e.data.lines.positions.value.length>0&&(s.points=Uwe(e.data.lines,typeof e.autoLabels=="object"?e.autoLabels.uniqueIdProperty:void 0)),e.data.polygons&&e.data.polygons.positions.value.length>0&&(s.points=zwe(e.data.polygons,t,e)),n.push(n[0].clone({id:`${e.id}-labels`,data:s,pickable:!1,autoHighlight:!1}))}return n}renderLayers(){const e=super.renderLayers();if(!this.props.autoLabels)return e;const t=e.flat().filter(Boolean);return t.sort((n,i)=>{const s=n.id.includes("labels"),o=i.id.includes("labels");return s&&!o?1:!s&&o?-1:0}),t.map(n=>n.id.includes("labels")?n.clone({highlightedObjectIndex:-1}):n)}_isWGS84(){return this.state.mvt?super._isWGS84():!0}}GT.layerName="VectorTileLayer";GT.defaultProps=Xwe;var Pn={YlGn:{3:["#f7fcb9","#addd8e","#31a354"],4:["#ffffcc","#c2e699","#78c679","#238443"],5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]},YlGnBu:{3:["#edf8b1","#7fcdbb","#2c7fb8"],4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]},GnBu:{3:["#e0f3db","#a8ddb5","#43a2ca"],4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"]},BuGn:{3:["#e5f5f9","#99d8c9","#2ca25f"],4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"]},PuBuGn:{3:["#ece2f0","#a6bddb","#1c9099"],4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"]},PuBu:{3:["#ece7f2","#a6bddb","#2b8cbe"],4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"]},BuPu:{3:["#e0ecf4","#9ebcda","#8856a7"],4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"]},RdPu:{3:["#fde0dd","#fa9fb5","#c51b8a"],4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"]},PuRd:{3:["#e7e1ef","#c994c7","#dd1c77"],4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"]},OrRd:{3:["#fee8c8","#fdbb84","#e34a33"],4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"]},YlOrRd:{3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},YlOrBr:{3:["#fff7bc","#fec44f","#d95f0e"],4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"]},Purples:{3:["#efedf5","#bcbddc","#756bb1"],4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]},Blues:{3:["#deebf7","#9ecae1","#3182bd"],4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]},Greens:{3:["#e5f5e0","#a1d99b","#31a354"],4:["#edf8e9","#bae4b3","#74c476","#238b45"],5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]},Oranges:{3:["#fee6ce","#fdae6b","#e6550d"],4:["#feedde","#fdbe85","#fd8d3c","#d94701"],5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],9:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]},Reds:{3:["#fee0d2","#fc9272","#de2d26"],4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]},Greys:{3:["#f0f0f0","#bdbdbd","#636363"],4:["#f7f7f7","#cccccc","#969696","#525252"],5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]},PuOr:{3:["#f1a340","#f7f7f7","#998ec3"],4:["#e66101","#fdb863","#b2abd2","#5e3c99"],5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"]},BrBG:{3:["#d8b365","#f5f5f5","#5ab4ac"],4:["#a6611a","#dfc27d","#80cdc1","#018571"],5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]},PRGn:{3:["#af8dc3","#f7f7f7","#7fbf7b"],4:["#7b3294","#c2a5cf","#a6dba0","#008837"],5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]},PiYG:{3:["#e9a3c9","#f7f7f7","#a1d76a"],4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]},RdBu:{3:["#ef8a62","#f7f7f7","#67a9cf"],4:["#ca0020","#f4a582","#92c5de","#0571b0"],5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]},RdGy:{3:["#ef8a62","#ffffff","#999999"],4:["#ca0020","#f4a582","#bababa","#404040"],5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"]},RdYlBu:{3:["#fc8d59","#ffffbf","#91bfdb"],4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},Spectral:{3:["#fc8d59","#ffffbf","#99d594"],4:["#d7191c","#fdae61","#abdda4","#2b83ba"],5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],6:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]},RdYlGn:{3:["#fc8d59","#ffffbf","#91cf60"],4:["#d7191c","#fdae61","#a6d96a","#1a9641"],5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]},Accent:{3:["#7fc97f","#beaed4","#fdc086"],4:["#7fc97f","#beaed4","#fdc086","#ffff99"],5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"]},Dark2:{3:["#1b9e77","#d95f02","#7570b3"],4:["#1b9e77","#d95f02","#7570b3","#e7298a"],5:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],6:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],7:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],8:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"]},Paired:{3:["#a6cee3","#1f78b4","#b2df8a"],4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]},Pastel1:{3:["#fbb4ae","#b3cde3","#ccebc5"],4:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],5:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],6:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],7:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],8:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],9:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Pastel2:{3:["#b3e2cd","#fdcdac","#cbd5e8"],4:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],5:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],6:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],7:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],8:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]},Set1:{3:["#e41a1c","#377eb8","#4daf4a"],4:["#e41a1c","#377eb8","#4daf4a","#984ea3"],5:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],6:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],7:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],8:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],9:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},Set2:{3:["#66c2a5","#fc8d62","#8da0cb"],4:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],5:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],6:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],7:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],8:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]},Set3:{3:["#8dd3c7","#ffffb3","#bebada"],4:["#8dd3c7","#ffffb3","#bebada","#fb8072"],5:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],6:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],7:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],8:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],9:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],10:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],11:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],12:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]}},Kwe={2:["#ffc6c4","#672044"],3:["#ffc6c4","#cc607d","#672044"],4:["#ffc6c4","#e38191","#ad466c","#672044"],5:["#ffc6c4","#ee919b","#cc607d","#9e3963","#672044"],6:["#ffc6c4","#f29ca3","#da7489","#b95073","#93345d","#672044"],7:["#ffc6c4","#f4a3a8","#e38191","#cc607d","#ad466c","#8b3058","#672044"],tags:["quantitative"]},qwe={2:["#fbe6c5","#70284a"],3:["#fbe6c5","#dc7176","#70284a"],4:["#fbe6c5","#ee8a82","#c8586c","#70284a"],5:["#fbe6c5","#f2a28a","#dc7176","#b24b65","#70284a"],6:["#fbe6c5","#f4b191","#e7807d","#d06270","#a44360","#70284a"],7:["#fbe6c5","#f5ba98","#ee8a82","#dc7176","#c8586c","#9c3f5d","#70284a"],tags:["quantitative"]},Ywe={2:["#f6d2a9","#b13f64"],3:["#f6d2a9","#ea8171","#b13f64"],4:["#f6d2a9","#f19c7c","#dd686c","#b13f64"],5:["#f6d2a9","#f3aa84","#ea8171","#d55d6a","#b13f64"],6:["#f6d2a9","#f4b28a","#ef9177","#e3726d","#cf5669","#b13f64"],7:["#f6d2a9","#f5b78e","#f19c7c","#ea8171","#dd686c","#ca5268","#b13f64"],tags:["quantitative"]},Zwe={2:["#ecda9a","#ee4d5a"],3:["#ecda9a","#f7945d","#ee4d5a"],4:["#ecda9a","#f3ad6a","#f97b57","#ee4d5a"],5:["#ecda9a","#f1b973","#f7945d","#f86f56","#ee4d5a"],6:["#ecda9a","#f0c079","#f5a363","#f98558","#f76856","#ee4d5a"],7:["#ecda9a","#efc47e","#f3ad6a","#f7945d","#f97b57","#f66356","#ee4d5a"],tags:["quantitative"]},Qwe={2:["#fde0c5","#eb4a40"],3:["#fde0c5","#f59e72","#eb4a40"],4:["#fde0c5","#f8b58b","#f2855d","#eb4a40"],5:["#fde0c5","#f9c098","#f59e72","#f17854","#eb4a40"],6:["#fde0c5","#fac7a1","#f7ac80","#f38f65","#f0704f","#eb4a40"],7:["#fde0c5","#facba6","#f8b58b","#f59e72","#f2855d","#ef6a4c","#eb4a40"],tags:["quantitative"]},eCe={2:["#fef6b5","#e15383"],3:["#fef6b5","#ffa679","#e15383"],4:["#fef6b5","#ffc285","#fa8a76","#e15383"],5:["#fef6b5","#ffd08e","#ffa679","#f67b77","#e15383"],6:["#fef6b5","#ffd795","#ffb77f","#fd9576","#f37378","#e15383"],7:["#fef6b5","#ffdd9a","#ffc285","#ffa679","#fa8a76","#f16d7a","#e15383"],tags:["quantitative"]},tCe={2:["#e4f1e1","#0d585f"],3:["#e4f1e1","#63a6a0","#0d585f"],4:["#e4f1e1","#89c0b6","#448c8a","#0d585f"],5:["#E4F1E1","#9CCDC1","#63A6A0","#337F7F","#0D585F"],6:["#e4f1e1","#abd4c7","#7ab5ad","#509693","#2c7778","#0d585f"],7:["#e4f1e1","#b4d9cc","#89c0b6","#63a6a0","#448c8a","#287274","#0d585f"],tags:["quantitative"]},rCe={2:["#c4e6c3","#1d4f60"],3:["#c4e6c3","#4da284","#1d4f60"],4:["#c4e6c3","#6dbc90","#36877a","#1d4f60"],5:["#c4e6c3","#80c799","#4da284","#2d7974","#1d4f60"],6:["#c4e6c3","#8dce9f","#5fb28b","#3e927e","#297071","#1d4f60"],7:["#c4e6c3","#96d2a4","#6dbc90","#4da284","#36877a","#266b6e","#1d4f60"],tags:["quantitative"]},nCe={2:["#d2fbd4","#123f5a"],3:["#d2fbd4","#559c9e","#123f5a"],4:["#d2fbd4","#7bbcb0","#3a7c89","#123f5a"],5:["#d2fbd4","#8eccb9","#559c9e","#2b6c7f","#123f5a"],6:["#d2fbd4","#9cd5be","#6cafa9","#458892","#266377","#123f5a"],7:["#d2fbd4","#a5dbc2","#7bbcb0","#559c9e","#3a7c89","#235d72","#123f5a"],tags:["quantitative"]},iCe={2:["#d3f2a3","#074050"],3:["#d3f2a3","#4c9b82","#074050"],4:["#d3f2a3","#6cc08b","#217a79","#074050"],5:["#d3f2a3","#82d091","#4c9b82","#19696f","#074050"],6:["#d3f2a3","#8fda94","#60b187","#35877d","#145f69","#074050"],7:["#d3f2a3","#97e196","#6cc08b","#4c9b82","#217a79","#105965","#074050"],tags:["quantitative"]},sCe={2:["#245668","#EDEF5D"],3:["#245668","#39AB7E","#EDEF5D"],4:["#245668","#0D8F81","#6EC574","#EDEF5D"],5:["#245668","#04817E","#39AB7E","#8BD16D","#EDEF5D"],6:["#245668","#09787C","#1D9A81","#58BB79","#9DD869","#EDEF5D"],7:["#245668","#0F7279","#0D8F81","#39AB7E","#6EC574","#A9DC67","#EDEF5D"],tags:["aggregation"]},oCe={2:["#f7feae","#045275"],3:["#f7feae","#46aea0","#045275"],4:["#f7feae","#7ccba2","#089099","#045275"],5:["#f7feae","#9bd8a4","#46aea0","#058092","#045275"],6:["#f7feae","#ace1a4","#68bfa1","#2a9c9c","#02778e","#045275"],7:["#f7feae","#b7e6a5","#7ccba2","#46aea0","#089099","#00718b","#045275"],tags:["quantitative"]},aCe={2:["#d1eeea","#2a5674"],3:["#d1eeea","#68abb8","#2a5674"],4:["#d1eeea","#85c4c9","#4f90a6","#2a5674"],5:["#d1eeea","#96d0d1","#68abb8","#45829b","#2a5674"],6:["#d1eeea","#a1d7d6","#79bbc3","#599bae","#3f7994","#2a5674"],7:["#d1eeea","#a8dbd9","#85c4c9","#68abb8","#4f90a6","#3b738f","#2a5674"],tags:["quantitative"]},cCe={2:["#b0f2bc","#257d98"],3:["#b0f2bc","#4cc8a3","#257d98"],4:["#b0f2bc","#67dba5","#38b2a3","#257d98"],5:["#b0f2bc","#77e2a8","#4cc8a3","#31a6a2","#257d98"],6:["#b0f2bc","#82e6aa","#5bd4a4","#3fbba3","#2e9ea1","#257d98"],7:["#b0f2bc","#89e8ac","#67dba5","#4cc8a3","#38b2a3","#2c98a0","#257d98"],tags:["quantitative"]},lCe={2:["#f3e0f7","#63589f"],3:["#f3e0f7","#b998dd","#63589f"],4:["#f3e0f7","#d1afe8","#9f82ce","#63589f"],5:["#f3e0f7","#dbbaed","#b998dd","#9178c4","#63589f"],6:["#f3e0f7","#e0c2ef","#c8a5e4","#aa8bd4","#8871be","#63589f"],7:["#f3e0f7","#e4c7f1","#d1afe8","#b998dd","#9f82ce","#826dba","#63589f"],tags:["quantitative"]},uCe={2:["#f9ddda","#573b88"],3:["#f9ddda","#ce78b3","#573b88"],4:["#f9ddda","#e597b9","#ad5fad","#573b88"],5:["#f9ddda","#eda8bd","#ce78b3","#9955a8","#573b88"],6:["#f9ddda","#f0b2c1","#dd8ab6","#bb69b0","#8c4fa4","#573b88"],7:["#f9ddda","#f2b9c4","#e597b9","#ce78b3","#ad5fad","#834ba0","#573b88"],tags:["quantitative"]},fCe={2:["#f3e79b","#5c53a5"],3:["#f3e79b","#eb7f86","#5c53a5"],4:["#f3e79b","#f8a07e","#ce6693","#5c53a5"],5:["#f3e79b","#fab27f","#eb7f86","#b95e9a","#5c53a5"],6:["#f3e79b","#fabc82","#f59280","#dc6f8e","#ab5b9e","#5c53a5"],7:["#f3e79b","#fac484","#f8a07e","#eb7f86","#ce6693","#a059a0","#5c53a5"],tags:["quantitative"]},hCe={2:["#f3cbd3","#6c2167"],3:["#f3cbd3","#ca699d","#6c2167"],4:["#f3cbd3","#dd88ac","#b14d8e","#6c2167"],5:["#f3cbd3","#e498b4","#ca699d","#a24186","#6c2167"],6:["#f3cbd3","#e7a2b9","#d67ba5","#bc5894","#983a81","#6c2167"],7:["#f3cbd3","#eaa9bd","#dd88ac","#ca699d","#b14d8e","#91357d","#6c2167"],tags:["quantitative"]},dCe={2:["#fcde9c","#7c1d6f"],3:["#fcde9c","#e34f6f","#7c1d6f"],4:["#fcde9c","#f0746e","#dc3977","#7c1d6f"],5:["#fcde9c","#f58670","#e34f6f","#d72d7c","#7c1d6f"],6:["#fcde9c","#f89872","#ec666d","#df4273","#c5287b","#7c1d6f"],7:["#fcde9c","#faa476","#f0746e","#e34f6f","#dc3977","#b9257a","#7c1d6f"],tags:["quantitative"]},pCe={2:["#4b2991","#edd9a3"],3:["#4b2991","#ea4f88","#edd9a3"],4:["#4b2991","#c0369d","#fa7876","#edd9a3"],5:["#4b2991","#a52fa2","#ea4f88","#fa9074","#edd9a3"],6:["#4b2991","#932da3","#d43f96","#f7667c","#f89f77","#edd9a3"],7:["#4b2991","#872ca2","#c0369d","#ea4f88","#fa7876","#f6a97a","#edd9a3"],tags:["aggregation"]},ACe={2:["#ede5cf","#541f3f"],3:["#ede5cf","#c1766f","#541f3f"],4:["#ede5cf","#d39c83","#a65461","#541f3f"],5:["#ede5cf","#daaf91","#c1766f","#95455a","#541f3f"],6:["#ede5cf","#ddba9b","#cd8c7a","#b26166","#8a3c56","#541f3f"],7:["#ede5cf","#e0c2a2","#d39c83","#c1766f","#a65461","#813753","#541f3f"],tags:["quantitative"]},gCe={2:["#929b4f","#db8195"],3:["#a3ad62","#fdfbe4","#df91a3"],4:["#929b4f","#d9dbaf","#f3d1ca","#db8195"],5:["#879043","#c1c68c","#fdfbe4","#ebb4b8","#d8758b"],6:["#7f883b","#b0b874","#e3e4be","#f6ddd1","#e4a0ac","#d66d85"],7:["#798234","#a3ad62","#d0d3a2","#fdfbe4","#f0c6c3","#df91a3","#d46780"],tags:["diverging"]},mCe={2:["#3d5941","#ca562c"],3:["#3d5941","#f6edbd","#ca562c"],4:["#3d5941","#b5b991","#edbb8a","#ca562c"],5:["#3d5941","#96a07c","#f6edbd","#e6a272","#ca562c"],6:["#3d5941","#839170","#cecea2","#f1cf9e","#e19464","#ca562c"],7:["#3d5941","#778868","#b5b991","#f6edbd","#edbb8a","#de8a5a","#ca562c"],tags:["diverging"]},_Ce={2:["#008080","#ca562c"],3:["#008080","#f6edbd","#ca562c"],4:["#008080","#b4c8a8","#edbb8a","#ca562c"],5:["#008080","#92b69e","#f6edbd","#e6a272","#ca562c"],6:["#008080","#7eab98","#ced7b1","#f1cf9e","#e19464","#ca562c"],7:["#008080","#70a494","#b4c8a8","#f6edbd","#edbb8a","#de8a5a","#ca562c"],tags:["diverging"]},yCe={2:["#009392","#cf597e"],3:["#009392","#e9e29c","#cf597e"],4:["#009392","#9ccb86","#eeb479","#cf597e"],5:["#009392","#71be83","#e9e29c","#ed9c72","#cf597e"],6:["#009392","#52b684","#bcd48c","#edc783","#eb8d71","#cf597e"],7:["#009392","#39b185","#9ccb86","#e9e29c","#eeb479","#e88471","#cf597e"],tags:["diverging"]},vCe={2:["#009392","#d0587e"],3:["#009392","#f1eac8","#d0587e"],4:["#009392","#91b8aa","#f1eac8","#dfa0a0","#d0587e"],5:["#009392","#91b8aa","#f1eac8","#dfa0a0","#d0587e"],6:["#009392","#72aaa1","#b1c7b3","#e5b9ad","#d98994","#d0587e"],7:["#009392","#72aaa1","#b1c7b3","#f1eac8","#e5b9ad","#d98994","#d0587e"],tags:["diverging"]},bCe={2:["#009B9E","#C75DAB"],3:["#009B9E","#F1F1F1","#C75DAB"],4:["#009B9E","#A7D3D4","#E4C1D9","#C75DAB"],5:["#009B9E","#7CC5C6","#F1F1F1","#DDA9CD","#C75DAB"],6:["#009B9E","#5DBCBE","#C6DFDF","#E9D4E2","#D99BC6","#C75DAB"],7:["#009B9E","#42B7B9","#A7D3D4","#F1F1F1","#E4C1D9","#D691C1","#C75DAB"],tags:["diverging"]},xCe={2:["#A16928","#2887a1"],3:["#A16928","#edeac2","#2887a1"],4:["#A16928","#d6bd8d","#b5c8b8","#2887a1"],5:["#A16928","#caa873","#edeac2","#98b7b2","#2887a1"],6:["#A16928","#c29b64","#e0cfa2","#cbd5bc","#85adaf","#2887a1"],7:["#A16928","#bd925a","#d6bd8d","#edeac2","#b5c8b8","#79a7ac","#2887a1"],tags:["diverging"]},wCe={2:["#855C75","#D9AF6B","#7C7C7C"],3:["#855C75","#D9AF6B","#AF6458","#7C7C7C"],4:["#855C75","#D9AF6B","#AF6458","#736F4C","#7C7C7C"],5:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#7C7C7C"],6:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#7C7C7C"],7:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#7C7C7C"],8:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#7C7C7C"],9:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#7C7C7C"],10:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#8C785D","#7C7C7C"],11:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#8C785D","#467378","#7C7C7C"],tags:["qualitative"]},CCe={2:["#7F3C8D","#11A579","#A5AA99"],3:["#7F3C8D","#11A579","#3969AC","#A5AA99"],4:["#7F3C8D","#11A579","#3969AC","#F2B701","#A5AA99"],5:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#A5AA99"],6:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#A5AA99"],7:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#A5AA99"],8:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#A5AA99"],9:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#A5AA99"],10:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#f97b72","#A5AA99"],11:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#f97b72","#4b4b8f","#A5AA99"],tags:["qualitative"]},TCe={2:["#66C5CC","#F6CF71","#B3B3B3"],3:["#66C5CC","#F6CF71","#F89C74","#B3B3B3"],4:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#B3B3B3"],5:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#B3B3B3"],6:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#B3B3B3"],7:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#B3B3B3"],8:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#B3B3B3"],9:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B3B3B3"],10:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B497E7","#B3B3B3"],11:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B497E7","#D3B484","#B3B3B3"],tags:["qualitative"]},ECe={2:["#5F4690","#1D6996","#666666"],3:["#5F4690","#1D6996","#38A6A5","#666666"],4:["#5F4690","#1D6996","#38A6A5","#0F8554","#666666"],5:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#666666"],6:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#666666"],7:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#666666"],8:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#666666"],9:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#666666"],10:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#6F4070","#666666"],11:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#6F4070","#994E95","#666666"],tags:["qualitative"]},BCe={2:["#88CCEE","#CC6677","#888888"],3:["#88CCEE","#CC6677","#DDCC77","#888888"],4:["#88CCEE","#CC6677","#DDCC77","#117733","#888888"],5:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#888888"],6:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#888888"],7:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#888888"],8:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#888888"],9:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#888888"],10:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#661100","#888888"],11:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#661100","#6699CC","#888888"],tags:["qualitative","colorblind"]},SCe={2:["#E58606","#5D69B1","#A5AA99"],3:["#E58606","#5D69B1","#52BCA3","#A5AA99"],4:["#E58606","#5D69B1","#52BCA3","#99C945","#A5AA99"],5:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#A5AA99"],6:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#A5AA99"],7:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#A5AA99"],8:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#A5AA99"],9:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#A5AA99"],10:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#ED645A","#A5AA99"],11:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#ED645A","#CC3A8E","#A5AA99"],tags:["qualitative"]},ICe={...Pn.BuGn,tags:["quantitative"]},MCe={...Pn.BuPu,tags:["quantitative"]},PCe={...Pn.GnBu,tags:["quantitative"]},RCe={...Pn.OrRd,tags:["quantitative"]},FCe={...Pn.PuBu,tags:["quantitative"]},DCe={...Pn.PuBuGn,tags:["quantitative"]},OCe={...Pn.PuRd,tags:["quantitative"]},LCe={...Pn.RdPu,tags:["quantitative"]},kCe={...Pn.YlGn,tags:["quantitative"]},NCe={...Pn.YlGnBu,tags:["quantitative"]},UCe={...Pn.YlOrBr,tags:["quantitative"]},zCe={...Pn.YlOrRd,tags:["quantitative"]},GCe={...Pn.Accent,tags:["qualitative"]},VCe={...Pn.Dark2,tags:["qualitative"]},HCe={...Pn.Paired,tags:["qualitative"]},jCe={...Pn.Pastel1,tags:["qualitative"]},$Ce={...Pn.Pastel2,tags:["qualitative"]},WCe={...Pn.Set1,tags:["qualitative"]},JCe={...Pn.Set2,tags:["qualitative"]},XCe={...Pn.Set3,tags:["qualitative"]},KCe={...Pn.Blues,tags:["quantitative"]},qCe={...Pn.Greens,tags:["quantitative"]},YCe={...Pn.Greys,tags:["quantitative"]},ZCe={...Pn.Oranges,tags:["quantitative"]},QCe={...Pn.Purples,tags:["quantitative"]},eTe={...Pn.Reds,tags:["quantitative"]},tTe={...Pn.BrBG,tags:["diverging"]},rTe={...Pn.PiYG,tags:["diverging"]},nTe={...Pn.PRGn,tags:["diverging"]},iTe={...Pn.PuOr,tags:["diverging"]},sTe={...Pn.RdBu,tags:["diverging"]},oTe={...Pn.RdGy,tags:["diverging"]},aTe={...Pn.RdYlBu,tags:["diverging"]},cTe={...Pn.RdYlGn,tags:["diverging"]},lTe={...Pn.Spectral,tags:["diverging"]};const uTe=Object.freeze(Object.defineProperty({__proto__:null,Antique:wCe,ArmyRose:gCe,BluGrn:rCe,BluYl:oCe,Bold:CCe,BrwnYl:ACe,Burg:Kwe,BurgYl:qwe,DarkMint:nCe,Earth:xCe,Emrld:iCe,Fall:mCe,Geyser:_Ce,Magenta:hCe,Mint:tCe,OrYel:Zwe,Pastel:TCe,Peach:Qwe,PinkYl:eCe,Prism:ECe,Purp:lCe,PurpOr:uCe,RedOr:Ywe,Safe:BCe,Sunset:fCe,SunsetDark:dCe,Teal:aCe,TealGrn:cCe,TealRose:vCe,Temps:yCe,Tropic:bCe,Vivid:SCe,ag_GrnYl:sCe,ag_Sunset:pCe,cb_Accent:GCe,cb_Blues:KCe,cb_BrBG:tTe,cb_BuGn:ICe,cb_BuPu:MCe,cb_Dark2:VCe,cb_GnBu:PCe,cb_Greens:qCe,cb_Greys:YCe,cb_OrRd:RCe,cb_Oranges:ZCe,cb_PRGn:nTe,cb_Paired:HCe,cb_Pastel1:jCe,cb_Pastel2:$Ce,cb_PiYG:rTe,cb_PuBu:FCe,cb_PuBuGn:DCe,cb_PuOr:iTe,cb_PuRd:OCe,cb_Purples:QCe,cb_RdBu:sTe,cb_RdGy:oTe,cb_RdPu:LCe,cb_RdYlBu:aTe,cb_RdYlGn:cTe,cb_Reds:eTe,cb_Set1:WCe,cb_Set2:JCe,cb_Set3:XCe,cb_Spectral:lTe,cb_YlGn:kCe,cb_YlGnBu:NCe,cb_YlOrBr:UCe,cb_YlOrRd:zCe},Symbol.toStringTag,{value:"Module"})),VT="PurpOr",HT=[204,204,204],fTe=[119,119,119];function jT(r,e){const t=uTe[r];let n=e;gh(t,`Palette "${r}" not found. Expected a CARTOColors string`);const i=Object.keys(t).filter(f=>f!=="tags").map(Number),s=Math.max(...i),o=Math.min(...i);!Number.isInteger(e)||e>s?n=s:e<o&&(n=o);let c=t[n];return t.tags&&t.tags.includes("qualitative")&&(c=c.slice(0,-1)),c.map(f=>hTe(f))}function hTe(r){let e=/^#?([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(r);return e?[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),255]:(e=/^#?([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(r),e?[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)]:(e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),255]:(e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),gh(e,`Hexadecimal color "${r}" was not parsed correctly`),[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)])))}const dTe=Object.freeze(["function","string"]);function $T(r,e,t){return gh(typeof e=="object",'Expected "data" to be an object'),gh(dTe.includes(typeof r),'Expected "attr" to be a function or string'),typeof r=="function"?r(e,t):e?.properties?.[r]}function pTe({attr:r,domain:e,colors:t=VT,nullColor:n=HT}){gh(Array.isArray(e),'Expected "domain" to be an array of numbers');const i=typeof t=="string"?jT(t,e.length+1):t,s=u5().domain(e).range(i);return(o,c)=>{const f=$T(r,o,c);return typeof f=="number"&&Number.isFinite(f)?s(f):n}}function ATe({attr:r,domain:e,colors:t=VT,nullColor:n=HT,othersColor:i=fTe}){gh(Array.isArray(e),'Expected "domain" to be an array of numbers or strings');const s={},o=typeof t=="string"?jT(t,e.length):t;for(const[c,f]of e.entries())s[f]=o[c];return(c,f)=>{const A=$T(r,c,f);return typeof A=="number"&&Number.isFinite(A)||typeof A=="string"?s[A]||i:n}}function gTe({attr:r,domain:e,colors:t=VT,nullColor:n=HT}){gh(Array.isArray(e),'Expected "domain" to be an array of numbers');const i=typeof t=="string"?jT(t,e.length):t,s=f5().domain(e).range(i);return(o,c)=>{const f=$T(r,o,c);return typeof f=="number"&&Number.isFinite(f)?s(f):n}}const mTe={ClusterTileLayer:FT,H3TileLayer:DT,HeatmapTileLayer:LT,PointLabelLayer:sv,QuadbinTileLayer:iv,RasterTileLayer:UT,VectorTileLayer:GT};function Lx(r,e=""){if(!r)throw new Error(`JSON conversion error ${e}`)}function _Te(r,e){const t=vTe(e);let n=r;for(const i of t)n=yTe(n)?n[i]:void 0;return n}function yTe(r){return r!==null&&typeof r=="object"}const LD={};function vTe(r){if(typeof r=="string"){let e=LD[r];return e||(e=r.split("."),LD[r]=e),e}return Array.isArray(r)?r:[r]}var F0={exports:{}},kD;function bTe(){return kD||(kD=1,function(r,e){(function(t){var n="Compound",i="Identifier",s="MemberExpression",o="Literal",c="ThisExpression",f="CallExpression",A="UnaryExpression",v="BinaryExpression",w="LogicalExpression",S="ConditionalExpression",F="ArrayExpression",N=46,U=44,$=39,G=34,H=40,J=41,ue=91,q=93,se=63,Te=59,Ue=58,de=function(St,st){var dr=new Error(St+" at character "+st);throw dr.index=st,dr.description=St,dr},me=!0,pe={"-":me,"!":me,"~":me,"+":me},W={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},re=function(St){var st=0,dr;for(var er in St)(dr=er.length)>st&&St.hasOwnProperty(er)&&(st=dr);return st},Ee=re(pe),et=re(W),_e={true:!0,false:!1,null:null},Le="this",Ge=function(St){return W[St]||0},Ze=function(St,st,dr){var er=St==="||"||St==="&&"?w:v;return{type:er,operator:St,left:st,right:dr}},tt=function(St){return St>=48&&St<=57},rt=function(St){return St===36||St===95||St>=65&&St<=90||St>=97&&St<=122||St>=128&&!W[String.fromCharCode(St)]},ut=function(St){return St===36||St===95||St>=65&&St<=90||St>=97&&St<=122||St>=48&&St<=57||St>=128&&!W[String.fromCharCode(St)]},vt=function(St){for(var st=0,dr=St.charAt,er=St.charCodeAt,Kt=function(Vt){return dr.call(St,Vt)},Nt=function(Vt){return er.call(St,Vt)},Ar=St.length,ln=function(){for(var Vt=Nt(st);Vt===32||Vt===9||Vt===10||Vt===13;)Vt=Nt(++st)},Pr=function(){var Vt=Vn(),mr,Rr;if(ln(),Nt(st)===se){if(st++,mr=Pr(),mr||de("Expected expression",st),ln(),Nt(st)===Ue)return st++,Rr=Pr(),Rr||de("Expected expression",st),{type:S,test:Vt,consequent:mr,alternate:Rr};de("Expected :",st)}else return Vt},xr=function(){ln();for(var Vt=St.substr(st,et),mr=Vt.length;mr>0;){if(W.hasOwnProperty(Vt)&&(!rt(Nt(st))||st+Vt.length<St.length&&!ut(Nt(st+Vt.length))))return st+=mr,Vt;Vt=Vt.substr(0,--mr)}return!1},Vn=function(){var Vt,mr,Rr,nn,_i,Me,kt,$t,lr;if(Me=_r(),mr=xr(),!mr)return Me;for(_i={value:mr,prec:Ge(mr)},kt=_r(),kt||de("Expected expression after "+mr,st),nn=[Me,_i,kt];(mr=xr())&&(Rr=Ge(mr),Rr!==0);){for(_i={value:mr,prec:Rr},lr=mr;nn.length>2&&Rr<=nn[nn.length-2].prec;)kt=nn.pop(),mr=nn.pop().value,Me=nn.pop(),Vt=Ze(mr,Me,kt),nn.push(Vt);Vt=_r(),Vt||de("Expected expression after "+lr,st),nn.push(_i,Vt)}for($t=nn.length-1,Vt=nn[$t];$t>1;)Vt=Ze(nn[$t-1].value,nn[$t-2],Vt),$t-=2;return Vt},_r=function(){var Vt,mr,Rr;if(ln(),Vt=Nt(st),tt(Vt)||Vt===N)return yr();if(Vt===$||Vt===G)return un();if(Vt===ue)return ti();for(mr=St.substr(st,Ee),Rr=mr.length;Rr>0;){if(pe.hasOwnProperty(mr)&&(!rt(Nt(st))||st+mr.length<St.length&&!ut(Nt(st+mr.length))))return st+=Rr,{type:A,operator:mr,argument:_r(),prefix:!0};mr=mr.substr(0,--Rr)}return rt(Vt)||Vt===H?Yn():!1},yr=function(){for(var Vt="",mr,Rr;tt(Nt(st));)Vt+=Kt(st++);if(Nt(st)===N)for(Vt+=Kt(st++);tt(Nt(st));)Vt+=Kt(st++);if(mr=Kt(st),mr==="e"||mr==="E"){for(Vt+=Kt(st++),mr=Kt(st),(mr==="+"||mr==="-")&&(Vt+=Kt(st++));tt(Nt(st));)Vt+=Kt(st++);tt(Nt(st-1))||de("Expected exponent ("+Vt+Kt(st)+")",st)}return Rr=Nt(st),rt(Rr)?de("Variable names cannot start with a number ("+Vt+Kt(st)+")",st):Rr===N&&de("Unexpected period",st),{type:o,value:parseFloat(Vt),raw:Vt}},un=function(){for(var Vt="",mr=Kt(st++),Rr=!1,nn;st<Ar;)if(nn=Kt(st++),nn===mr){Rr=!0;break}else if(nn==="\\")switch(nn=Kt(st++),nn){case"n":Vt+=`
5367
- `;break;case"r":Vt+="\r";break;case"t":Vt+=" ";break;case"b":Vt+="\b";break;case"f":Vt+="\f";break;case"v":Vt+="\v";break;default:Vt+=nn}else Vt+=nn;return Rr||de('Unclosed quote after "'+Vt+'"',st),{type:o,value:Vt,raw:mr+Vt+mr}},Dr=function(){var Vt=Nt(st),mr=st,Rr;for(rt(Vt)?st++:de("Unexpected "+Kt(st),st);st<Ar&&(Vt=Nt(st),ut(Vt));)st++;return Rr=St.slice(mr,st),_e.hasOwnProperty(Rr)?{type:o,value:_e[Rr],raw:Rr}:Rr===Le?{type:c}:{type:i,name:Rr}},ci=function(Vt){for(var mr,Rr=[],nn,_i=!1,Me=0;st<Ar;)if(ln(),mr=Nt(st),mr===Vt){_i=!0,st++,Vt===J&&Me&&Me>=Rr.length&&de("Unexpected token "+String.fromCharCode(Vt),st);break}else if(mr===U){if(st++,Me++,Me!==Rr.length){if(Vt===J)de("Unexpected token ,",st);else if(Vt===q)for(var kt=Rr.length;kt<Me;kt++)Rr.push(null)}}else nn=Pr(),(!nn||nn.type===n)&&de("Expected comma",st),Rr.push(nn);return _i||de("Expected "+String.fromCharCode(Vt),st),Rr},Yn=function(){var Vt,mr;for(Vt=Nt(st),Vt===H?mr=mn():mr=Dr(),ln(),Vt=Nt(st);Vt===N||Vt===ue||Vt===H;)st++,Vt===N?(ln(),mr={type:s,computed:!1,object:mr,property:Dr()}):Vt===ue?(mr={type:s,computed:!0,object:mr,property:Pr()},ln(),Vt=Nt(st),Vt!==q&&de("Unclosed [",st),st++):Vt===H&&(mr={type:f,arguments:ci(J),callee:mr}),ln(),Vt=Nt(st);return mr},mn=function(){st++;var Vt=Pr();if(ln(),Nt(st)===J)return st++,Vt;de("Unclosed (",st)},ti=function(){return st++,{type:F,elements:ci(q)}},Hn=[],Bn,Zn;st<Ar;)Bn=Nt(st),Bn===Te||Bn===U?st++:(Zn=Pr())?Hn.push(Zn):st<Ar&&de('Unexpected "'+Kt(st)+'"',st);return Hn.length===1?Hn[0]:{type:n,body:Hn}};vt.version="0.3.5",vt.toString=function(){return"JavaScript Expression Parser (JSEP) v"+vt.version},vt.addUnaryOp=function(St){return Ee=Math.max(St.length,Ee),pe[St]=me,this},vt.addBinaryOp=function(St,st){return et=Math.max(St.length,et),W[St]=st,this},vt.addLiteral=function(St,st){return _e[St]=st,this},vt.removeUnaryOp=function(St){return delete pe[St],St.length===Ee&&(Ee=re(pe)),this},vt.removeAllUnaryOps=function(){return pe={},Ee=0,this},vt.removeBinaryOp=function(St){return delete W[St],St.length===et&&(et=re(W)),this},vt.removeAllBinaryOps=function(){return W={},et=0,this},vt.removeLiteral=function(St){return delete _e[St],this},vt.removeAllLiterals=function(){return _e={},this},r.exports?e=r.exports=vt:e.parse=vt})()}(F0,F0.exports)),F0.exports}var xTe=bTe();const wTe=_h(xTe),ND={"||":(r,e)=>r||e,"&&":(r,e)=>r&&e,"|":(r,e)=>r|e,"^":(r,e)=>r^e,"&":(r,e)=>r&e,"==":(r,e)=>r==e,"!=":(r,e)=>r!=e,"===":(r,e)=>r===e,"!==":(r,e)=>r!==e,"<":(r,e)=>r<e,">":(r,e)=>r>e,"<=":(r,e)=>r<=e,">=":(r,e)=>r>=e,"<<":(r,e)=>r<<e,">>":(r,e)=>r>>e,">>>":(r,e)=>r>>>e,"+":(r,e)=>r+e,"-":(r,e)=>r-e,"*":(r,e)=>r*e,"/":(r,e)=>r/e,"%":(r,e)=>r%e},CTe={"-":r=>-r,"+":r=>+r,"~":r=>~r,"!":r=>!r};function UD(r,e){return r.map(function(t){return Ks(t,e)})}function zD(r,e){const t=Ks(r.object,e);let n;if(r.computed?n=Ks(r.property,e):n=r.property.name,/^__proto__|prototype|constructor$/.test(n))throw Error(`Access to member "${n}" disallowed.`);return[t,t[n]]}function Ks(r,e){const t=r;switch(t.type){case"ArrayExpression":return UD(t.elements,e);case"BinaryExpression":return ND[t.operator](Ks(t.left,e),Ks(t.right,e));case"CallExpression":let n,i,s;return t.callee.type==="MemberExpression"?(s=zD(t.callee,e),n=s[0],i=s[1]):i=Ks(t.callee,e),typeof i!="function"?void 0:i.apply(n,UD(t.arguments,e));case"ConditionalExpression":return Ks(t.test,e)?Ks(t.consequent,e):Ks(t.alternate,e);case"Identifier":return e[t.name];case"Literal":return t.value;case"LogicalExpression":return t.operator==="||"?Ks(t.left,e)||Ks(t.right,e):t.operator==="&&"?Ks(t.left,e)&&Ks(t.right,e):ND[t.operator](Ks(t.left,e),Ks(t.right,e));case"MemberExpression":return zD(t,e)[1];case"ThisExpression":return e;case"UnaryExpression":return CTe[t.operator](Ks(t.argument,e));default:return}}const e2={"-":r=>r};function EU(r,e){if(r in e2)return e2[r];let t;const n=wTe(r);return n.type==="Identifier"?t=i=>_Te(i,r):(kx(n,i=>{if(i.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),t=i=>Ks(n,i)),e2[r]=t,t}function kx(r,e){if(Array.isArray(r))r.forEach(t=>kx(t,e));else if(r&&typeof r=="object"){r.type&&e(r);for(const t in r)kx(r[t],e)}}const ny="@@=",GD="@@#",TTe="@@type",BU="@@function",VD=r=>r&&typeof r=="object";class Nx{constructor(...e){this.typeKey=TTe,this.functionKey=BU,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=EU,this.preProcessClassProps=(t,n)=>n,this.postProcessConvertedJson=t=>t;for(const t of e)this.merge(t)}merge(e){for(const t in e)switch(t){case"layers":case"views":Object.assign(this.classes,e[t]);break;default:if(t in this){const n=e[t];this[t]=VD(this[t])?Object.assign(this[t],n):n}}}validate(e){return Lx(!this.typeKey||typeof this.typeKey=="string"),Lx(VD(this.classes)),!0}}function ETe(r){return typeof r=="string"&&r.startsWith(ny)}function BTe(r){return r.replace(ny,"")}function SU(r,e){const t={};for(const n in r){let i=r[n];ETe(i)&&(i=BTe(i),i=EU(i)),t[n]=i}return t}function STe(r,e,t){const n=t.classes[r],i=t.reactComponents[r];if(!n&&!i){const{log:s}=t;if(s){const o=JSON.stringify(e,null,0).slice(0,40);s.warn(`JSON converter: No registered class of type ${r}(${o}...) `)}return null}return n?ITe(n,e,t):MTe(i,e,t)}function ITe(r,e,t){return t.preProcessClassProps&&(e=t.preProcessClassProps(r,e,t)),e=SU(e),new r(e)}function MTe(r,e,t){const{React:n}=t,{children:i=[]}=e;return delete e.children,t.preProcessClassProps&&(e=t.preProcessClassProps(r,e,t)),e=SU(e),n.createElement(r,e,i)}function PTe(r,e,t){const n=t.functions[r];if(!n){const{log:i}=t;if(i){const s=JSON.stringify(e,null,0).slice(0,40);i.warn(`JSON converter: No registered function ${r}(${s}...) `)}return null}return n(e)}function RTe(r){return typeof r=="string"?JSON.parse(r):r}const WT=r=>r&&typeof r=="object";class FTe{constructor(e){this.log=console,this.onJSONChange=()=>{},this.json=null,this.convertedJson=null,this.setProps(e)}finalize(){}setProps(e){"configuration"in e&&(this.configuration=e.configuration instanceof Nx?e.configuration:new Nx(e.configuration)),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}mergeConfiguration(e){this.configuration.merge(e)}convert(e){if(!e||e===this.json)return this.convertedJson;this.json=e;const t=RTe(e);let n=DTe(t,this.configuration);return n=this.configuration.postProcessConvertedJson(n),this.convertedJson=n,n}convertJson(e){return this.convert(e)}}function DTe(r,e){return e=new Nx(e),JT(r,"",e)}function JT(r,e,t){return Array.isArray(r)?r.map((n,i)=>JT(n,String(i),t)):OTe(r,t)?LTe(r,t):WT(r)?BU in r?kTe(r,t):XT(r,t):typeof r=="string"?NTe(r,e,t):r}function OTe(r,e){const{typeKey:t}=e;return WT(r)&&!!r[t]}function LTe(r,e){const{typeKey:t}=e,n=r[t];let i={...r};return delete i[t],i=XT(i,e),STe(n,i,e)}function kTe(r,e){const{functionKey:t}=e,n=r[t];let i={...r};return delete i[t],i=XT(i,e),PTe(n,i,e)}function XT(r,e){Lx(WT(r));const t={};for(const n in r){const i=r[n];t[n]=JT(i,n,e)}return t}function NTe(r,e,t){if(r.startsWith(ny)&&t.convertFunction)return r=r.replace(ny,""),t.convertFunction(r,t);if(r.startsWith(GD)){if(r=r.replace(GD,""),t.constants[r])return t.constants[r];const[n,i]=r.split(".");return t.enumerations[n][i]}return r}const UTe={classes:{...fue,...Pxe,...s2e,...e0e,...mTe},functions:{colorBins:pTe,colorCategories:ATe,colorContinuous:gTe}},IU=new FTe({configuration:UTe}),zTe={[qy.layerName]:["getFillColor"],[Uy.layerName]:["getFillColor"],[_l.layerName]:["getFillColor"],[Xp.layerName]:["getFillColor"],[Fy.layerName]:["getFillColor"],[Ry.layerName]:["getFillColor"],[Ly.layerName]:["getColor"],[jg.layerName]:["getTargetColor","getSourceColor"],[ml.layerName]:["getFillColor"],[iu.layerName]:["getFillColor"],[Jp.layerName]:["getColor"],[Sy.layerName]:["getColor"],[uf.layerName]:["getColor"],[$g.layerName]:["getColor"],[hf.layerName]:["getFillColor"],[Wg.layerName]:["getFillColor","getColor","getLineColor"],[ff.layerName]:["getFillColor"],[Eh.layerName]:["getColor"],[Qg.layerName]:["getColor"],[Ah.layerName]:["getColor"]},GTe=({object:r,objectInfo:e,originalFillFunction:t})=>{const n=typeof t=="function"?t(r,e):t;if(Array.isArray(n))return[n[0]||0,n[1]||0,n[2]||0,n[3]||255];if(typeof n=="string"&&n.startsWith("@@=")){const i=IU.convert({originalColor:n}).originalColor(r);return[i[0]||0,i[1]||0,i[2]||0,i[3]||255]}return null},HD=({isSelected:r,object:e,objectInfo:t,opacity:n,originalFillFunction:i})=>{const s=GTe({object:e,objectInfo:t,originalFillFunction:i});if(!s)return null;let o=0;return r?o=Math.max(typeof s[3]=="number"?s[3]:n,n):o=Math.min(typeof s[3]=="number"?s[3]:n,n),[s[0]||0,s[1]||0,s[2]||0,o]},VTe=({isSelected:r,object:e,objectInfo:t,originalFillFunction:n,selectedColor:i,selectedOpacity:s=255,unselectedColor:o,unselectedOpacity:c=Math.floor(255*.4)})=>r?HD({opacity:s,isSelected:!0,object:e,objectInfo:t,originalFillFunction:n})||i:HD({opacity:c,isSelected:!1,object:e,objectInfo:t,originalFillFunction:n})||o,Dg={selection:{indices:{},objects:{}}},jD=(r,e)=>{const t=e.match(/{(.*?)}/g);return t&&t.forEach(n=>{const i=n.substring(1,n.length-1);Object.hasOwn(r.object,i)?e=e.replace(n,r.object[i]):Object.hasOwn(r.object,"properties")&&Object.hasOwn(r.object.properties,i)&&(e=e.replace(n,r.object.properties[i]))}),e};function HTe(r,e){return e.id?r.getElementState(e.id,"selection")??Dg:Dg}function jTe(r,e){if(!e.id)return Dg;const t=r.getStringValue(e);return(t?r2.parse(t):null)??Dg}function $Te(r,e,t,n){r.id&&e.setStringValue(r,JSON.stringify(t.value),{fromUi:t.fromUi},n)}const WTe=r=>{const{height:e,width:t,expanded:n}=XD(KD),{element:i,fragmentId:s,isLightTheme:o,theme:c,widgetMgr:f}=r,{selectionMode:A,tooltip:v,useContainerWidth:w}=i,S=n??!1,[F,N]=b5({element:i,getDefaultState:HTe,getStateFromWidgetMgr:jTe,updateWidgetMgrState:$Te,widgetMgr:f,fragmentId:s}),[U,$]=It.useState(null),{height:G,width:H}=Yae({element:i,isFullScreen:S,shouldUseContainerWidth:w,container:{height:e,width:t},heightFallback:U?.initialViewState?.height||c.sizes.defaultMapHeight}),[J,ue]=It.useState(null),q=A[0],se=q!==void 0,Te=se&&Object.keys(F.selection.indices).length>0,Ue=It.useMemo(()=>Object.freeze(r2.parse(i.json)),[S,o,i.json]),de=It.useMemo(()=>{const W={...Ue};if(W.mapStyle||(W.mapStyle=o?"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json":"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"),(W?.mapProvider=="carto"||W?.mapStyle&&W.mapStyle?.indexOf("cartocdn")>=0)&&!W.cartoKey&&(W.cartoKey="x7g2plm9yq8vfrc"),W.layers){const Ee=Object.values(F.selection.indices).some(_e=>_e?.length),et=W.layers.some(_e=>Object.hasOwn(_e,"pickable"));W.layers=W.layers.map(_e=>{if(!_e||Array.isArray(_e)||!se)return _e;et||(_e.pickable=!0);const Le=`${_e.id||null}`,Ge=F?.selection?.indices?.[Le]||[],Ze=zTe[_e["@@type"]];if(!Ze)return _e;const tt={..._e};return Ze.forEach(rt=>{tt.updateTriggers={[rt]:[...tt.updateTriggers?.[rt]||[],Ge,Ee]};const ut=!Ee,vt=_e[rt];if(ut||!vt)return tt;const St=255,st=Math.floor(255*.4),dr=AB(c.colors.primary),er=[dr[0],dr[1],dr[2],St],Kt=AB(c.colors.gray20),Nt=[Kt[0],Kt[1],Kt[2],st],Ar=(ln,Pr)=>VTe({isSelected:Ge.includes(Pr.index),object:ln,objectInfo:Pr,originalFillFunction:vt,selectedColor:er,unselectedColor:Nt,selectedOpacity:St,unselectedOpacity:st});tt[rt]=Ar}),tt})}return delete W?.views,IU.convert(W)},[F.selection.indices,o,se,Ue,c.colors.gray20,c.colors.primary]);It.useEffect(()=>{if(!h5(de.initialViewState,J)){const W=Object.keys(de.initialViewState).reduce((re,Ee)=>de.initialViewState[Ee]===J?.[Ee]?re:{...re,[Ee]:de.initialViewState[Ee]},{});$(re=>({...re,...W})),ue(de.initialViewState)}},[de.initialViewState,J,U]);const me=It.useCallback(W=>{if(!W?.object||!v)return null;const re=r2.parse(v);return re.html?re.html=jD(W,re.html):re.text=jD(W,re.text),re},[v]),pe=It.useCallback(({viewState:W})=>{$(W)},[$]);return{createTooltip:me,data:F,deck:de,hasActiveSelection:Te,height:G,isSelectionModeActivated:se,onViewStateChange:pe,selectionMode:q,setSelection:N,viewState:U,width:H}};Ug([Jw,X2]);const t2=Dg.selection,JTe=[],XTe=r=>{const{disabled:e,disableFullscreenMode:t,element:n,fragmentId:i,heightConfig:s,widgetMgr:o}=r,{libConfig:c}=It.useContext(d5),f=p5(),{expanded:A,expand:v,collapse:w}=XD(KD),S=!!s?.useStretch,{createTooltip:F,data:N,deck:U,hasActiveSelection:$,isSelectionModeActivated:G,onViewStateChange:H,selectionMode:J,setSelection:ue,viewState:q}=WTe({element:n,fragmentId:i,isLightTheme:JD(f),theme:f,widgetMgr:o}),se=n.mapboxToken||c.mapboxToken,Te=U.mapProvider=="mapbox"||U?.mapStyle&&U.mapStyle?.indexOf("mapbox")>=0,[Ue,de]=It.useState(!1);It.useEffect(()=>{de(!0)},[]);const me=It.useCallback(W=>{if(J===void 0)return;const{index:re,object:Ee}=W,et=`${W.layer?.id||null}`,_e=N,Le=re===-1,Ze=(()=>{if(Le)return t2;switch(J){case mB.SelectionMode.SINGLE_OBJECT:return _e.selection.indices[et]?.[0]===re?t2:{indices:{[`${et}`]:[re]},objects:{[`${et}`]:[Ee]}};case mB.SelectionMode.MULTI_OBJECT:{const tt=new Map((_e?.selection?.indices?.[et]||[]).map((ut,vt)=>[ut,_e.selection?.objects?.[et]?.[vt]]));if(tt.has(re)?tt.delete(re):tt.set(re,Ee),tt.size===0){const{[et]:rt,...ut}=_e.selection.indices,{[et]:vt,...St}=_e.selection.objects;return{indices:ut,objects:St}}return{indices:{..._e.selection.indices,[`${et}`]:Array.from(tt.keys())},objects:{..._e.selection.objects,[`${et}`]:Array.from(tt.values())}}}default:throw A5(J),new Error("Invalid selection mode")}})();JSON.stringify(Ze)!==JSON.stringify(_e.selection)&&ue({fromUi:!0,value:{selection:Ze}})},[J,N,ue]),pe=It.useCallback(()=>{ue({value:{selection:t2},fromUi:!0})},[ue]);return gB(SM,{className:"stDeckGlJsonChart","data-testid":"stDeckGlJsonChart",isStretchHeight:S,children:[Te?Jf(Kae,{}):null,Jf(v5,{isFullScreen:A,disableFullscreenMode:t,onExpand:v,onCollapse:w,target:SM,locked:$&&!e?!0:void 0,children:$&&!e&&Jf(y5,{label:"Clear selection",onClick:pe,icon:m5})}),q&&gB(EZ,{viewState:q,onViewStateChange:H,layers:Ue?U.layers:JTe,getTooltip:F,ContextProvider:Th.Provider,controller:!0,onClick:G&&!e?me:void 0,children:[Jf(nu,{mapStyle:U.mapStyle&&(typeof U.mapStyle=="string"?U.mapStyle:U.mapStyle[0]),mapboxApiAccessToken:se}),Jf(qae,{children:Jf($ae,{"data-testid":"stDeckGlJsonChartZoomButton",showCompass:!1})})]})]})},KTe=_5(XTe),nBe=It.memo(KTe);export{nBe as default};
5335
+ `,Twe={...ml.defaultProps,extruded:!1,diskResolution:4,vertices:[[-.5,-.5],[.5,-.5],[.5,.5],[-.5,.5]]};class mU extends fU(ml){getShaders(){const e=super.getShaders(),t=this.props.data,n=t.data.blockSize??Math.sqrt(t.length);return{...e,defines:{...e.defines,BLOCK_WIDTH:n},vs:Cwe}}initializeState(){this.getAttributeManager().addInstanced({instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:[255,255,255,255]}})}}mU.layerName="RasterColumnLayer";function Ewe(r,e){return r.data===e.data&&r.length===e.length}class kT extends Bs{renderLayers(){const{data:e,getElevation:t,getFillColor:n,getLineColor:i,getLineWidth:s,tileIndex:o,updateTriggers:c}=this.props;if(!e||!o)return null;const f=e.blockSize??0,[A,v,w]=eU(o),S=[A,v],F=w/f,N=this.getSubLayerClass("column",mU),{highlightedObjectIndex:U,highlightColor:$}=this.state;return new N(this.props,this.getSubLayerProps({id:"cell",updateTriggers:c,getElevation:this.getSubLayerAccessor(t),getFillColor:this.getSubLayerAccessor(n),getLineColor:this.getSubLayerAccessor(i),getLineWidth:this.getSubLayerAccessor(s)}),{data:{data:e,length:f*f},dataComparator:Ewe,offset:S,lineWidthScale:F,highlightedObjectIndex:U,highlightColor:$,parameters:{blendColorSrcFactor:"one",blendAlphaSrcFactor:"one",blendColorDstFactor:"zero",blendAlphaDstFactor:"zero",blendColorOperation:"add",blendAlphaOperation:"add"}})}getSubLayerAccessor(e){return typeof e!="function"?super.getSubLayerAccessor(e):(t,n)=>{const{data:i,index:s}=n,o=i.data,c=Lxe(o.cells,s);return e({properties:c},n)}}getPickingInfo(e){const t=super.getPickingInfo(e);return t.index!==-1&&(t.object=this.getSubLayerAccessor(n=>n)(void 0,{data:this.props,index:t.index})),t}_updateAutoHighlight(e){const{highlightedObjectIndex:t}=this.state;let n=-1;if(e.index!==-1&&(n=e.index),t!==n){let{highlightColor:i}=this.props;typeof i=="function"&&(i=i(e)),this.setState({highlightColor:i,highlightedObjectIndex:n})}}}kT.layerName="RasterLayer";kT.defaultProps=Twe;const Bwe={uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,uint64:BigUint64Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,int64:BigInt64Array,float32:Float32Array,float64:Float64Array};class NT{static read(e,t){return e.readFields(NT._readField,{name:"",type:"",data:null},t)}static _readField(e,t,n){if(e===1)t.name=n.readString();else if(e===2)t.type=n.readString();else if(e===3){const i=Bwe[t.type];if(!i)throw Error(`Invalid data type: ${t.type}`);t.data={};const{compression:s}=Ox;tv(i,n,t.data,{compression:s})}}}let Ox=class _U{static read(e,t){return e.readFields(_U._readField,{blockSize:0,bands:[]},t)}static _readField(e,t,n){e===1?t.blockSize=n.readVarint():e===2&&t.bands.push(NT.read(n,n.readVarint()+n.pos))}};const yU="9.1.14",vU="cartoRasterTile",Swe={cartoRasterTile:{metadata:null,workerUrl:ev(vU,yU)}},Iwe={name:"CARTO Raster Tile",version:yU,id:vU,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-raster-tile"],category:"geometry",parse:async(r,e)=>FD(r,e),parseSync:FD,worker:!0,options:Swe};function FD(r,e){const t=e?.cartoRasterTile?.metadata;if(!r||!t)return null;Ox.compression=t.compression;const n=rv(r,Ox),{bands:i,blockSize:s}=n,o={};for(let c=0;c<i.length;c++){const{name:f,data:A}=i[c];o[f]=A}return{blockSize:s,cells:{numericProps:o,properties:[]}}}Ug([Iwe]);const Mwe=r=>{const e=r.tile?.index?.q;return e?new kT(r,{tileIndex:e}):null},Pwe={data:mh,refinementStrategy:"no-overlap",tileSize:Yp};class Rwe extends hU(ou,hwe){filterSubLayer(e){const{tile:t}=e.layer.props;return t?super.filterSubLayer(e):!0}}class UT extends Bs{getLoadOptions(){const e=this.props.data;return Zp(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${e.accessToken}`}}})}renderLayers(){const e=this.props.data;if(!e)return null;const{tiles:t,minzoom:n,maxzoom:i,raster_metadata:s}=e,o=this.getSubLayerClass("tile",Rwe),c=this.getLoadOptions();return new o(this.props,{id:`raster-tile-layer-${this.props.id}`,data:t,TilesetClass:CT,renderSubLayers:Mwe,minZoom:n,maxZoom:i,loadOptions:{...c,cartoRasterTile:{...c?.cartoRasterTile,metadata:s}}})}}UT.layerName="RasterTileLayer";UT.defaultProps=Pwe;class zT{static read(e,t){return e.readFields(zT._readField,{properties:[],numericProps:{}},t)}static _readField(e,t,n){if(e===1)t.properties.push(Ih.read(n,n.readVarint()+n.pos));else if(e===2){const i=Mh.read(n,n.readVarint()+n.pos);t.numericProps[i.key]=i.value}}}const bU="9.1.14",xU="cartoPropertiesTile",Fwe={cartoPropertiesTile:{workerUrl:ev(xU,bU)}},Dwe={name:"CARTO Properties Tile",version:bU,id:xU,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-properties-tile"],category:"geometry",worker:!0,parse:async(r,e)=>DD(r),parseSync:DD,options:Fwe};function DD(r,e){return r?rv(r,zT):null}const wU="9.1.14",CU="cartoVectorTile",Owe={cartoVectorTile:{workerUrl:ev(CU,wU)}},Lwe={name:"CARTO Vector Tile",version:wU,id:CU,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-vector-tile"],category:"geometry",parse:async(r,e)=>OD(r),parseSync:OD,worker:!0,options:Owe};function kwe(r,e,{startPosition:t,endPosition:n,indices:i}){const s=r.positions.size,o=t*s,c=n*s,f=r.positions.value.subarray(o,c),A=i.slice(1).map(w=>w-t),v=y6(f,A,s);for(let w=0,S=v.length;w<S;++w)e.push(t+v[w])}function Nwe(r){const{polygonIndices:e,primitivePolygonIndices:t}=r,n=[];let i=0;for(let s=0;s<e.value.length-1;s++){const o=e.value[s],c=e.value[s+1],f=t.value.indexOf(c),A=t.value.subarray(i,f);i=f,kwe(r,n,{startPosition:o,endPosition:c,indices:A})}r.triangles={value:new Uint32Array(n),size:1}}function OD(r,e){if(!r)return null;const t=rv(r,qxe);return t.polygons&&!t.polygons.triangles&&Nwe(t.polygons),t}function Uwe(r,e){const t=e?e in r.numericProps:!1,n=new Map;for(let v=0;v<r.pathIndices.value.length-1;v++){const w=r.pathIndices.value[v],S=r.featureIds.value[w];let F;e===void 0?F=S:t?F=r.numericProps[e].value[w]:r.properties[S]&&e in r.properties[S]?F=r.properties[S][e]:F=void 0;const N=Wwe(r,v);(!n.has(F)||N>n.get(F).length)&&n.set(F,{index:v,length:N})}const i=[],s=[],o=[],c=[],f=ZN(n.size,r.numericProps);let A=0;for(const[v,{index:w}]of n){const S=Jwe(r,w);i.push(...S);const F=r.pathIndices.value[w],N=r.featureIds.value[F];o.push(A),s.push(r.properties[N]),c.push(r.globalFeatureIds.value[F]),QN(r.numericProps,f,F,A),A++}return wT(i,o,c,f,s)}function zwe(r,e,t){const{west:n,south:i,east:s,north:o}=e,f=(s-n)*(o-i)*1e-4,A=[],v=[],w=[],S=[],F=ZN(r.polygonIndices.value.length-1,r.numericProps);let N=0,U=0;const{extruded:$}=t;for(let G=0;G<r.polygonIndices.value.length-1;G++){const H=r.polygonIndices.value[G],J=r.polygonIndices.value[G+1];if(Gwe(r,G)<f)continue;const ue=jwe(r,G);let q=-1,se=[0,0],Te=!1;for(;U<r.triangles.value.length;){const de=r.triangles.value[U];if(de>=J)break;if(Te){U+=3;continue}const me=r.triangles.value[U+1],pe=r.triangles.value[U+2],W=r.positions.value.subarray(de*r.positions.size,de*r.positions.size+r.positions.size),re=r.positions.value.subarray(me*r.positions.size,me*r.positions.size+r.positions.size),Ee=r.positions.value.subarray(pe*r.positions.size,pe*r.positions.size+r.positions.size);if(Hwe(ue,W,re,Ee))Te=!0;else{const et=TU(W,re,Ee);et>q&&(q=et,se=[(W[0]+re[0]+Ee[0])/3,(W[1]+re[1]+Ee[1])/3])}U+=3}const Ue=Te?ue:se;if(Vwe(Ue,e)){A.push(...Ue);const de=r.featureIds.value[H];if($){const me=t.getElevation(void 0,{data:r,index:de});A.push(me*t.elevationScale)}v.push(r.properties[de]),w.push(N),S.push(r.globalFeatureIds.value[H]),QN(r.numericProps,F,H,N),N++}}return r.numericProps&&Object.keys(F).forEach(G=>{F[G].value=F[G].value.slice(0,N)}),wT(A,w,S,F,v,$?3:2)}function Gwe(r,e){const{positions:{value:t,size:n},polygonIndices:{value:i},triangles:{value:s}}=r,o=i[e],c=i[e+1];let f=0,A=0;for(;A<s.length&&!(s[A]>=o);)A+=3;for(;A<s.length;){const v=s[A];if(v>=c)break;const w=s[A+1],S=s[A+2],F=t.subarray(v*n,v*n+n),N=t.subarray(w*n,w*n+n),U=t.subarray(S*n,S*n+n);f+=TU(F,N,U),A+=3}return f}function Vwe([r,e],{west:t,east:n,south:i,north:s}){return r>=t&&r<n&&e>=i&&e<s}function Hwe(r,e,t,n){const i=Math.abs((t[0]-e[0])*(n[1]-e[1])-(n[0]-e[0])*(t[1]-e[1]))/2,s=Math.abs((e[0]-r[0])*(t[1]-r[1])-(t[0]-r[0])*(e[1]-r[1]))/2,o=Math.abs((t[0]-r[0])*(n[1]-r[1])-(n[0]-r[0])*(t[1]-r[1]))/2,c=Math.abs((n[0]-r[0])*(e[1]-r[1])-(e[0]-r[0])*(n[1]-r[1]))/2;return Math.abs(i-(s+o+c))<1e-10}function TU([r,e],[t,n],[i,s]){return Math.abs((r*(n-s)+t*(s-e)+i*(e-n))/2)}function jwe(r,e){const{positions:{value:t,size:n}}=r,i=n*r.polygonIndices.value[e],s=n*r.polygonIndices.value[e+1];let o=1/0,c=1/0,f=-1/0,A=-1/0;for(let v=i;v<s;v+=n){const[w,S]=t.subarray(v,v+2);o=Math.min(o,w),c=Math.min(c,S),f=Math.max(f,w),A=Math.max(A,S)}return[(o+f)/2,(c+A)/2]}function $we(r,e){const{positions:{value:t}}=r,[n,i,s,o]=t.subarray(e,e+4);return Math.sqrt(Math.pow(s-n,2)+Math.pow(o-i,2))}function Wwe(r,e){const{positions:{size:t}}=r,n=t*r.pathIndices.value[e],i=t*r.pathIndices.value[e+1];let s=0;for(let o=n;o<i;o+=t)s+=$we(r,o);return s}function Jwe(r,e){const{positions:{value:t},pathIndices:{value:n}}=r,i=n[e]*2,o=(n[e+1]*2-i)/2;if(o===2){const[f,A,v,w]=t.subarray(i,i+4);return[(f+v)/2,(A+w)/2]}const c=i+Math.floor(o/2)*2;return[t[c],t[c+1]]}Ug([Dwe,Lwe]);const Xwe={...Xp.defaultProps,autoLabels:!1,data:mh,dataComparator:mh.equal,tileSize:Yp};class GT extends Xp{constructor(...e){super(...e)}initializeState(){super.initializeState(),this.setState({binary:!0})}updateState(e){const{props:t}=e;if(t.data){super.updateState(e);const i=new URL(t.data.tiles[0]).searchParams.get("formatTiles")==="mvt";this.setState({mvt:i})}}getLoadOptions(){const e=this.props.data;return Zp(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${e.accessToken}`}},gis:{format:"binary"}})}async getTileData(e){const t=this.props.data,{tiles:n,properties_tiles:i}=t,s=ph(n,e);if(!s)return Promise.reject("Invalid URL");const o=this.getLoadOptions(),{fetch:c}=this.props,{signal:f}=e,A=c(s,{propName:"data",layer:this,loadOptions:o,signal:f});if(!i)return await A;const v=ph(i,e);if(!v)return Promise.reject("Invalid properties URL");const w=c(v,{propName:"data",layer:this,loadOptions:o,signal:f}),[S,F]=await Promise.all([A,w]);return S?F?ewe(S,F):S:null}renderSubLayers(e){if(e.data===null)return null;const t=e.tile.bbox,n=[],i={"points-text":{type:sv,...e?._subLayerProps?.["points-text"],extensions:[new hT,...e.extensions||[],...e?._subLayerProps?.["points-text"]?.extensions||[]]}};if(this.state.mvt)n.push(super.renderSubLayers(e));else{const{west:s,south:o,east:c,north:f}=t,A=[new Ky,...e.extensions||[]],v={clipBounds:[s,o,c,f]},w=F=>({[F]:{...v,...e?._subLayerProps?.[F],extensions:[...A,...e?._subLayerProps?.[F]?.extensions||[]]}}),S={...e,data:{...e.data,tileBbox:t},autoHighlight:!1,_subLayerProps:{...e._subLayerProps,...i,...w("polygons-fill"),...w("polygons-stroke"),...w("linestrings")}};n.push(new iu(S))}if(n[0]&&e.autoLabels){const s=YN();e.data.lines&&e.data.lines.positions.value.length>0&&(s.points=Uwe(e.data.lines,typeof e.autoLabels=="object"?e.autoLabels.uniqueIdProperty:void 0)),e.data.polygons&&e.data.polygons.positions.value.length>0&&(s.points=zwe(e.data.polygons,t,e)),n.push(n[0].clone({id:`${e.id}-labels`,data:s,pickable:!1,autoHighlight:!1}))}return n}renderLayers(){const e=super.renderLayers();if(!this.props.autoLabels)return e;const t=e.flat().filter(Boolean);return t.sort((n,i)=>{const s=n.id.includes("labels"),o=i.id.includes("labels");return s&&!o?1:!s&&o?-1:0}),t.map(n=>n.id.includes("labels")?n.clone({highlightedObjectIndex:-1}):n)}_isWGS84(){return this.state.mvt?super._isWGS84():!0}}GT.layerName="VectorTileLayer";GT.defaultProps=Xwe;var Pn={YlGn:{3:["#f7fcb9","#addd8e","#31a354"],4:["#ffffcc","#c2e699","#78c679","#238443"],5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]},YlGnBu:{3:["#edf8b1","#7fcdbb","#2c7fb8"],4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]},GnBu:{3:["#e0f3db","#a8ddb5","#43a2ca"],4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"]},BuGn:{3:["#e5f5f9","#99d8c9","#2ca25f"],4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"]},PuBuGn:{3:["#ece2f0","#a6bddb","#1c9099"],4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"]},PuBu:{3:["#ece7f2","#a6bddb","#2b8cbe"],4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"]},BuPu:{3:["#e0ecf4","#9ebcda","#8856a7"],4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"]},RdPu:{3:["#fde0dd","#fa9fb5","#c51b8a"],4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"]},PuRd:{3:["#e7e1ef","#c994c7","#dd1c77"],4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"]},OrRd:{3:["#fee8c8","#fdbb84","#e34a33"],4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"]},YlOrRd:{3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},YlOrBr:{3:["#fff7bc","#fec44f","#d95f0e"],4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"]},Purples:{3:["#efedf5","#bcbddc","#756bb1"],4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]},Blues:{3:["#deebf7","#9ecae1","#3182bd"],4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]},Greens:{3:["#e5f5e0","#a1d99b","#31a354"],4:["#edf8e9","#bae4b3","#74c476","#238b45"],5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]},Oranges:{3:["#fee6ce","#fdae6b","#e6550d"],4:["#feedde","#fdbe85","#fd8d3c","#d94701"],5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],9:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]},Reds:{3:["#fee0d2","#fc9272","#de2d26"],4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]},Greys:{3:["#f0f0f0","#bdbdbd","#636363"],4:["#f7f7f7","#cccccc","#969696","#525252"],5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]},PuOr:{3:["#f1a340","#f7f7f7","#998ec3"],4:["#e66101","#fdb863","#b2abd2","#5e3c99"],5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"]},BrBG:{3:["#d8b365","#f5f5f5","#5ab4ac"],4:["#a6611a","#dfc27d","#80cdc1","#018571"],5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]},PRGn:{3:["#af8dc3","#f7f7f7","#7fbf7b"],4:["#7b3294","#c2a5cf","#a6dba0","#008837"],5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]},PiYG:{3:["#e9a3c9","#f7f7f7","#a1d76a"],4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]},RdBu:{3:["#ef8a62","#f7f7f7","#67a9cf"],4:["#ca0020","#f4a582","#92c5de","#0571b0"],5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]},RdGy:{3:["#ef8a62","#ffffff","#999999"],4:["#ca0020","#f4a582","#bababa","#404040"],5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"]},RdYlBu:{3:["#fc8d59","#ffffbf","#91bfdb"],4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},Spectral:{3:["#fc8d59","#ffffbf","#99d594"],4:["#d7191c","#fdae61","#abdda4","#2b83ba"],5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],6:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]},RdYlGn:{3:["#fc8d59","#ffffbf","#91cf60"],4:["#d7191c","#fdae61","#a6d96a","#1a9641"],5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]},Accent:{3:["#7fc97f","#beaed4","#fdc086"],4:["#7fc97f","#beaed4","#fdc086","#ffff99"],5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"]},Dark2:{3:["#1b9e77","#d95f02","#7570b3"],4:["#1b9e77","#d95f02","#7570b3","#e7298a"],5:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],6:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],7:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],8:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"]},Paired:{3:["#a6cee3","#1f78b4","#b2df8a"],4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]},Pastel1:{3:["#fbb4ae","#b3cde3","#ccebc5"],4:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],5:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],6:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],7:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],8:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],9:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Pastel2:{3:["#b3e2cd","#fdcdac","#cbd5e8"],4:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],5:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],6:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],7:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],8:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]},Set1:{3:["#e41a1c","#377eb8","#4daf4a"],4:["#e41a1c","#377eb8","#4daf4a","#984ea3"],5:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],6:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],7:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],8:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],9:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},Set2:{3:["#66c2a5","#fc8d62","#8da0cb"],4:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],5:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],6:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],7:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],8:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]},Set3:{3:["#8dd3c7","#ffffb3","#bebada"],4:["#8dd3c7","#ffffb3","#bebada","#fb8072"],5:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],6:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],7:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],8:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],9:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],10:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],11:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],12:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]}},Kwe={2:["#ffc6c4","#672044"],3:["#ffc6c4","#cc607d","#672044"],4:["#ffc6c4","#e38191","#ad466c","#672044"],5:["#ffc6c4","#ee919b","#cc607d","#9e3963","#672044"],6:["#ffc6c4","#f29ca3","#da7489","#b95073","#93345d","#672044"],7:["#ffc6c4","#f4a3a8","#e38191","#cc607d","#ad466c","#8b3058","#672044"],tags:["quantitative"]},qwe={2:["#fbe6c5","#70284a"],3:["#fbe6c5","#dc7176","#70284a"],4:["#fbe6c5","#ee8a82","#c8586c","#70284a"],5:["#fbe6c5","#f2a28a","#dc7176","#b24b65","#70284a"],6:["#fbe6c5","#f4b191","#e7807d","#d06270","#a44360","#70284a"],7:["#fbe6c5","#f5ba98","#ee8a82","#dc7176","#c8586c","#9c3f5d","#70284a"],tags:["quantitative"]},Ywe={2:["#f6d2a9","#b13f64"],3:["#f6d2a9","#ea8171","#b13f64"],4:["#f6d2a9","#f19c7c","#dd686c","#b13f64"],5:["#f6d2a9","#f3aa84","#ea8171","#d55d6a","#b13f64"],6:["#f6d2a9","#f4b28a","#ef9177","#e3726d","#cf5669","#b13f64"],7:["#f6d2a9","#f5b78e","#f19c7c","#ea8171","#dd686c","#ca5268","#b13f64"],tags:["quantitative"]},Zwe={2:["#ecda9a","#ee4d5a"],3:["#ecda9a","#f7945d","#ee4d5a"],4:["#ecda9a","#f3ad6a","#f97b57","#ee4d5a"],5:["#ecda9a","#f1b973","#f7945d","#f86f56","#ee4d5a"],6:["#ecda9a","#f0c079","#f5a363","#f98558","#f76856","#ee4d5a"],7:["#ecda9a","#efc47e","#f3ad6a","#f7945d","#f97b57","#f66356","#ee4d5a"],tags:["quantitative"]},Qwe={2:["#fde0c5","#eb4a40"],3:["#fde0c5","#f59e72","#eb4a40"],4:["#fde0c5","#f8b58b","#f2855d","#eb4a40"],5:["#fde0c5","#f9c098","#f59e72","#f17854","#eb4a40"],6:["#fde0c5","#fac7a1","#f7ac80","#f38f65","#f0704f","#eb4a40"],7:["#fde0c5","#facba6","#f8b58b","#f59e72","#f2855d","#ef6a4c","#eb4a40"],tags:["quantitative"]},eCe={2:["#fef6b5","#e15383"],3:["#fef6b5","#ffa679","#e15383"],4:["#fef6b5","#ffc285","#fa8a76","#e15383"],5:["#fef6b5","#ffd08e","#ffa679","#f67b77","#e15383"],6:["#fef6b5","#ffd795","#ffb77f","#fd9576","#f37378","#e15383"],7:["#fef6b5","#ffdd9a","#ffc285","#ffa679","#fa8a76","#f16d7a","#e15383"],tags:["quantitative"]},tCe={2:["#e4f1e1","#0d585f"],3:["#e4f1e1","#63a6a0","#0d585f"],4:["#e4f1e1","#89c0b6","#448c8a","#0d585f"],5:["#E4F1E1","#9CCDC1","#63A6A0","#337F7F","#0D585F"],6:["#e4f1e1","#abd4c7","#7ab5ad","#509693","#2c7778","#0d585f"],7:["#e4f1e1","#b4d9cc","#89c0b6","#63a6a0","#448c8a","#287274","#0d585f"],tags:["quantitative"]},rCe={2:["#c4e6c3","#1d4f60"],3:["#c4e6c3","#4da284","#1d4f60"],4:["#c4e6c3","#6dbc90","#36877a","#1d4f60"],5:["#c4e6c3","#80c799","#4da284","#2d7974","#1d4f60"],6:["#c4e6c3","#8dce9f","#5fb28b","#3e927e","#297071","#1d4f60"],7:["#c4e6c3","#96d2a4","#6dbc90","#4da284","#36877a","#266b6e","#1d4f60"],tags:["quantitative"]},nCe={2:["#d2fbd4","#123f5a"],3:["#d2fbd4","#559c9e","#123f5a"],4:["#d2fbd4","#7bbcb0","#3a7c89","#123f5a"],5:["#d2fbd4","#8eccb9","#559c9e","#2b6c7f","#123f5a"],6:["#d2fbd4","#9cd5be","#6cafa9","#458892","#266377","#123f5a"],7:["#d2fbd4","#a5dbc2","#7bbcb0","#559c9e","#3a7c89","#235d72","#123f5a"],tags:["quantitative"]},iCe={2:["#d3f2a3","#074050"],3:["#d3f2a3","#4c9b82","#074050"],4:["#d3f2a3","#6cc08b","#217a79","#074050"],5:["#d3f2a3","#82d091","#4c9b82","#19696f","#074050"],6:["#d3f2a3","#8fda94","#60b187","#35877d","#145f69","#074050"],7:["#d3f2a3","#97e196","#6cc08b","#4c9b82","#217a79","#105965","#074050"],tags:["quantitative"]},sCe={2:["#245668","#EDEF5D"],3:["#245668","#39AB7E","#EDEF5D"],4:["#245668","#0D8F81","#6EC574","#EDEF5D"],5:["#245668","#04817E","#39AB7E","#8BD16D","#EDEF5D"],6:["#245668","#09787C","#1D9A81","#58BB79","#9DD869","#EDEF5D"],7:["#245668","#0F7279","#0D8F81","#39AB7E","#6EC574","#A9DC67","#EDEF5D"],tags:["aggregation"]},oCe={2:["#f7feae","#045275"],3:["#f7feae","#46aea0","#045275"],4:["#f7feae","#7ccba2","#089099","#045275"],5:["#f7feae","#9bd8a4","#46aea0","#058092","#045275"],6:["#f7feae","#ace1a4","#68bfa1","#2a9c9c","#02778e","#045275"],7:["#f7feae","#b7e6a5","#7ccba2","#46aea0","#089099","#00718b","#045275"],tags:["quantitative"]},aCe={2:["#d1eeea","#2a5674"],3:["#d1eeea","#68abb8","#2a5674"],4:["#d1eeea","#85c4c9","#4f90a6","#2a5674"],5:["#d1eeea","#96d0d1","#68abb8","#45829b","#2a5674"],6:["#d1eeea","#a1d7d6","#79bbc3","#599bae","#3f7994","#2a5674"],7:["#d1eeea","#a8dbd9","#85c4c9","#68abb8","#4f90a6","#3b738f","#2a5674"],tags:["quantitative"]},cCe={2:["#b0f2bc","#257d98"],3:["#b0f2bc","#4cc8a3","#257d98"],4:["#b0f2bc","#67dba5","#38b2a3","#257d98"],5:["#b0f2bc","#77e2a8","#4cc8a3","#31a6a2","#257d98"],6:["#b0f2bc","#82e6aa","#5bd4a4","#3fbba3","#2e9ea1","#257d98"],7:["#b0f2bc","#89e8ac","#67dba5","#4cc8a3","#38b2a3","#2c98a0","#257d98"],tags:["quantitative"]},lCe={2:["#f3e0f7","#63589f"],3:["#f3e0f7","#b998dd","#63589f"],4:["#f3e0f7","#d1afe8","#9f82ce","#63589f"],5:["#f3e0f7","#dbbaed","#b998dd","#9178c4","#63589f"],6:["#f3e0f7","#e0c2ef","#c8a5e4","#aa8bd4","#8871be","#63589f"],7:["#f3e0f7","#e4c7f1","#d1afe8","#b998dd","#9f82ce","#826dba","#63589f"],tags:["quantitative"]},uCe={2:["#f9ddda","#573b88"],3:["#f9ddda","#ce78b3","#573b88"],4:["#f9ddda","#e597b9","#ad5fad","#573b88"],5:["#f9ddda","#eda8bd","#ce78b3","#9955a8","#573b88"],6:["#f9ddda","#f0b2c1","#dd8ab6","#bb69b0","#8c4fa4","#573b88"],7:["#f9ddda","#f2b9c4","#e597b9","#ce78b3","#ad5fad","#834ba0","#573b88"],tags:["quantitative"]},fCe={2:["#f3e79b","#5c53a5"],3:["#f3e79b","#eb7f86","#5c53a5"],4:["#f3e79b","#f8a07e","#ce6693","#5c53a5"],5:["#f3e79b","#fab27f","#eb7f86","#b95e9a","#5c53a5"],6:["#f3e79b","#fabc82","#f59280","#dc6f8e","#ab5b9e","#5c53a5"],7:["#f3e79b","#fac484","#f8a07e","#eb7f86","#ce6693","#a059a0","#5c53a5"],tags:["quantitative"]},hCe={2:["#f3cbd3","#6c2167"],3:["#f3cbd3","#ca699d","#6c2167"],4:["#f3cbd3","#dd88ac","#b14d8e","#6c2167"],5:["#f3cbd3","#e498b4","#ca699d","#a24186","#6c2167"],6:["#f3cbd3","#e7a2b9","#d67ba5","#bc5894","#983a81","#6c2167"],7:["#f3cbd3","#eaa9bd","#dd88ac","#ca699d","#b14d8e","#91357d","#6c2167"],tags:["quantitative"]},dCe={2:["#fcde9c","#7c1d6f"],3:["#fcde9c","#e34f6f","#7c1d6f"],4:["#fcde9c","#f0746e","#dc3977","#7c1d6f"],5:["#fcde9c","#f58670","#e34f6f","#d72d7c","#7c1d6f"],6:["#fcde9c","#f89872","#ec666d","#df4273","#c5287b","#7c1d6f"],7:["#fcde9c","#faa476","#f0746e","#e34f6f","#dc3977","#b9257a","#7c1d6f"],tags:["quantitative"]},pCe={2:["#4b2991","#edd9a3"],3:["#4b2991","#ea4f88","#edd9a3"],4:["#4b2991","#c0369d","#fa7876","#edd9a3"],5:["#4b2991","#a52fa2","#ea4f88","#fa9074","#edd9a3"],6:["#4b2991","#932da3","#d43f96","#f7667c","#f89f77","#edd9a3"],7:["#4b2991","#872ca2","#c0369d","#ea4f88","#fa7876","#f6a97a","#edd9a3"],tags:["aggregation"]},ACe={2:["#ede5cf","#541f3f"],3:["#ede5cf","#c1766f","#541f3f"],4:["#ede5cf","#d39c83","#a65461","#541f3f"],5:["#ede5cf","#daaf91","#c1766f","#95455a","#541f3f"],6:["#ede5cf","#ddba9b","#cd8c7a","#b26166","#8a3c56","#541f3f"],7:["#ede5cf","#e0c2a2","#d39c83","#c1766f","#a65461","#813753","#541f3f"],tags:["quantitative"]},gCe={2:["#929b4f","#db8195"],3:["#a3ad62","#fdfbe4","#df91a3"],4:["#929b4f","#d9dbaf","#f3d1ca","#db8195"],5:["#879043","#c1c68c","#fdfbe4","#ebb4b8","#d8758b"],6:["#7f883b","#b0b874","#e3e4be","#f6ddd1","#e4a0ac","#d66d85"],7:["#798234","#a3ad62","#d0d3a2","#fdfbe4","#f0c6c3","#df91a3","#d46780"],tags:["diverging"]},mCe={2:["#3d5941","#ca562c"],3:["#3d5941","#f6edbd","#ca562c"],4:["#3d5941","#b5b991","#edbb8a","#ca562c"],5:["#3d5941","#96a07c","#f6edbd","#e6a272","#ca562c"],6:["#3d5941","#839170","#cecea2","#f1cf9e","#e19464","#ca562c"],7:["#3d5941","#778868","#b5b991","#f6edbd","#edbb8a","#de8a5a","#ca562c"],tags:["diverging"]},_Ce={2:["#008080","#ca562c"],3:["#008080","#f6edbd","#ca562c"],4:["#008080","#b4c8a8","#edbb8a","#ca562c"],5:["#008080","#92b69e","#f6edbd","#e6a272","#ca562c"],6:["#008080","#7eab98","#ced7b1","#f1cf9e","#e19464","#ca562c"],7:["#008080","#70a494","#b4c8a8","#f6edbd","#edbb8a","#de8a5a","#ca562c"],tags:["diverging"]},yCe={2:["#009392","#cf597e"],3:["#009392","#e9e29c","#cf597e"],4:["#009392","#9ccb86","#eeb479","#cf597e"],5:["#009392","#71be83","#e9e29c","#ed9c72","#cf597e"],6:["#009392","#52b684","#bcd48c","#edc783","#eb8d71","#cf597e"],7:["#009392","#39b185","#9ccb86","#e9e29c","#eeb479","#e88471","#cf597e"],tags:["diverging"]},vCe={2:["#009392","#d0587e"],3:["#009392","#f1eac8","#d0587e"],4:["#009392","#91b8aa","#f1eac8","#dfa0a0","#d0587e"],5:["#009392","#91b8aa","#f1eac8","#dfa0a0","#d0587e"],6:["#009392","#72aaa1","#b1c7b3","#e5b9ad","#d98994","#d0587e"],7:["#009392","#72aaa1","#b1c7b3","#f1eac8","#e5b9ad","#d98994","#d0587e"],tags:["diverging"]},bCe={2:["#009B9E","#C75DAB"],3:["#009B9E","#F1F1F1","#C75DAB"],4:["#009B9E","#A7D3D4","#E4C1D9","#C75DAB"],5:["#009B9E","#7CC5C6","#F1F1F1","#DDA9CD","#C75DAB"],6:["#009B9E","#5DBCBE","#C6DFDF","#E9D4E2","#D99BC6","#C75DAB"],7:["#009B9E","#42B7B9","#A7D3D4","#F1F1F1","#E4C1D9","#D691C1","#C75DAB"],tags:["diverging"]},xCe={2:["#A16928","#2887a1"],3:["#A16928","#edeac2","#2887a1"],4:["#A16928","#d6bd8d","#b5c8b8","#2887a1"],5:["#A16928","#caa873","#edeac2","#98b7b2","#2887a1"],6:["#A16928","#c29b64","#e0cfa2","#cbd5bc","#85adaf","#2887a1"],7:["#A16928","#bd925a","#d6bd8d","#edeac2","#b5c8b8","#79a7ac","#2887a1"],tags:["diverging"]},wCe={2:["#855C75","#D9AF6B","#7C7C7C"],3:["#855C75","#D9AF6B","#AF6458","#7C7C7C"],4:["#855C75","#D9AF6B","#AF6458","#736F4C","#7C7C7C"],5:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#7C7C7C"],6:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#7C7C7C"],7:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#7C7C7C"],8:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#7C7C7C"],9:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#7C7C7C"],10:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#8C785D","#7C7C7C"],11:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#8C785D","#467378","#7C7C7C"],tags:["qualitative"]},CCe={2:["#7F3C8D","#11A579","#A5AA99"],3:["#7F3C8D","#11A579","#3969AC","#A5AA99"],4:["#7F3C8D","#11A579","#3969AC","#F2B701","#A5AA99"],5:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#A5AA99"],6:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#A5AA99"],7:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#A5AA99"],8:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#A5AA99"],9:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#A5AA99"],10:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#f97b72","#A5AA99"],11:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#f97b72","#4b4b8f","#A5AA99"],tags:["qualitative"]},TCe={2:["#66C5CC","#F6CF71","#B3B3B3"],3:["#66C5CC","#F6CF71","#F89C74","#B3B3B3"],4:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#B3B3B3"],5:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#B3B3B3"],6:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#B3B3B3"],7:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#B3B3B3"],8:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#B3B3B3"],9:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B3B3B3"],10:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B497E7","#B3B3B3"],11:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B497E7","#D3B484","#B3B3B3"],tags:["qualitative"]},ECe={2:["#5F4690","#1D6996","#666666"],3:["#5F4690","#1D6996","#38A6A5","#666666"],4:["#5F4690","#1D6996","#38A6A5","#0F8554","#666666"],5:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#666666"],6:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#666666"],7:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#666666"],8:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#666666"],9:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#666666"],10:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#6F4070","#666666"],11:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#6F4070","#994E95","#666666"],tags:["qualitative"]},BCe={2:["#88CCEE","#CC6677","#888888"],3:["#88CCEE","#CC6677","#DDCC77","#888888"],4:["#88CCEE","#CC6677","#DDCC77","#117733","#888888"],5:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#888888"],6:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#888888"],7:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#888888"],8:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#888888"],9:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#888888"],10:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#661100","#888888"],11:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#661100","#6699CC","#888888"],tags:["qualitative","colorblind"]},SCe={2:["#E58606","#5D69B1","#A5AA99"],3:["#E58606","#5D69B1","#52BCA3","#A5AA99"],4:["#E58606","#5D69B1","#52BCA3","#99C945","#A5AA99"],5:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#A5AA99"],6:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#A5AA99"],7:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#A5AA99"],8:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#A5AA99"],9:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#A5AA99"],10:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#ED645A","#A5AA99"],11:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#ED645A","#CC3A8E","#A5AA99"],tags:["qualitative"]},ICe={...Pn.BuGn,tags:["quantitative"]},MCe={...Pn.BuPu,tags:["quantitative"]},PCe={...Pn.GnBu,tags:["quantitative"]},RCe={...Pn.OrRd,tags:["quantitative"]},FCe={...Pn.PuBu,tags:["quantitative"]},DCe={...Pn.PuBuGn,tags:["quantitative"]},OCe={...Pn.PuRd,tags:["quantitative"]},LCe={...Pn.RdPu,tags:["quantitative"]},kCe={...Pn.YlGn,tags:["quantitative"]},NCe={...Pn.YlGnBu,tags:["quantitative"]},UCe={...Pn.YlOrBr,tags:["quantitative"]},zCe={...Pn.YlOrRd,tags:["quantitative"]},GCe={...Pn.Accent,tags:["qualitative"]},VCe={...Pn.Dark2,tags:["qualitative"]},HCe={...Pn.Paired,tags:["qualitative"]},jCe={...Pn.Pastel1,tags:["qualitative"]},$Ce={...Pn.Pastel2,tags:["qualitative"]},WCe={...Pn.Set1,tags:["qualitative"]},JCe={...Pn.Set2,tags:["qualitative"]},XCe={...Pn.Set3,tags:["qualitative"]},KCe={...Pn.Blues,tags:["quantitative"]},qCe={...Pn.Greens,tags:["quantitative"]},YCe={...Pn.Greys,tags:["quantitative"]},ZCe={...Pn.Oranges,tags:["quantitative"]},QCe={...Pn.Purples,tags:["quantitative"]},eTe={...Pn.Reds,tags:["quantitative"]},tTe={...Pn.BrBG,tags:["diverging"]},rTe={...Pn.PiYG,tags:["diverging"]},nTe={...Pn.PRGn,tags:["diverging"]},iTe={...Pn.PuOr,tags:["diverging"]},sTe={...Pn.RdBu,tags:["diverging"]},oTe={...Pn.RdGy,tags:["diverging"]},aTe={...Pn.RdYlBu,tags:["diverging"]},cTe={...Pn.RdYlGn,tags:["diverging"]},lTe={...Pn.Spectral,tags:["diverging"]};const uTe=Object.freeze(Object.defineProperty({__proto__:null,Antique:wCe,ArmyRose:gCe,BluGrn:rCe,BluYl:oCe,Bold:CCe,BrwnYl:ACe,Burg:Kwe,BurgYl:qwe,DarkMint:nCe,Earth:xCe,Emrld:iCe,Fall:mCe,Geyser:_Ce,Magenta:hCe,Mint:tCe,OrYel:Zwe,Pastel:TCe,Peach:Qwe,PinkYl:eCe,Prism:ECe,Purp:lCe,PurpOr:uCe,RedOr:Ywe,Safe:BCe,Sunset:fCe,SunsetDark:dCe,Teal:aCe,TealGrn:cCe,TealRose:vCe,Temps:yCe,Tropic:bCe,Vivid:SCe,ag_GrnYl:sCe,ag_Sunset:pCe,cb_Accent:GCe,cb_Blues:KCe,cb_BrBG:tTe,cb_BuGn:ICe,cb_BuPu:MCe,cb_Dark2:VCe,cb_GnBu:PCe,cb_Greens:qCe,cb_Greys:YCe,cb_OrRd:RCe,cb_Oranges:ZCe,cb_PRGn:nTe,cb_Paired:HCe,cb_Pastel1:jCe,cb_Pastel2:$Ce,cb_PiYG:rTe,cb_PuBu:FCe,cb_PuBuGn:DCe,cb_PuOr:iTe,cb_PuRd:OCe,cb_Purples:QCe,cb_RdBu:sTe,cb_RdGy:oTe,cb_RdPu:LCe,cb_RdYlBu:aTe,cb_RdYlGn:cTe,cb_Reds:eTe,cb_Set1:WCe,cb_Set2:JCe,cb_Set3:XCe,cb_Spectral:lTe,cb_YlGn:kCe,cb_YlGnBu:NCe,cb_YlOrBr:UCe,cb_YlOrRd:zCe},Symbol.toStringTag,{value:"Module"})),VT="PurpOr",HT=[204,204,204],fTe=[119,119,119];function jT(r,e){const t=uTe[r];let n=e;gh(t,`Palette "${r}" not found. Expected a CARTOColors string`);const i=Object.keys(t).filter(f=>f!=="tags").map(Number),s=Math.max(...i),o=Math.min(...i);!Number.isInteger(e)||e>s?n=s:e<o&&(n=o);let c=t[n];return t.tags&&t.tags.includes("qualitative")&&(c=c.slice(0,-1)),c.map(f=>hTe(f))}function hTe(r){let e=/^#?([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(r);return e?[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),255]:(e=/^#?([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(r),e?[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)]:(e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),255]:(e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),gh(e,`Hexadecimal color "${r}" was not parsed correctly`),[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)])))}const dTe=Object.freeze(["function","string"]);function $T(r,e,t){return gh(typeof e=="object",'Expected "data" to be an object'),gh(dTe.includes(typeof r),'Expected "attr" to be a function or string'),typeof r=="function"?r(e,t):e?.properties?.[r]}function pTe({attr:r,domain:e,colors:t=VT,nullColor:n=HT}){gh(Array.isArray(e),'Expected "domain" to be an array of numbers');const i=typeof t=="string"?jT(t,e.length+1):t,s=v5().domain(e).range(i);return(o,c)=>{const f=$T(r,o,c);return typeof f=="number"&&Number.isFinite(f)?s(f):n}}function ATe({attr:r,domain:e,colors:t=VT,nullColor:n=HT,othersColor:i=fTe}){gh(Array.isArray(e),'Expected "domain" to be an array of numbers or strings');const s={},o=typeof t=="string"?jT(t,e.length):t;for(const[c,f]of e.entries())s[f]=o[c];return(c,f)=>{const A=$T(r,c,f);return typeof A=="number"&&Number.isFinite(A)||typeof A=="string"?s[A]||i:n}}function gTe({attr:r,domain:e,colors:t=VT,nullColor:n=HT}){gh(Array.isArray(e),'Expected "domain" to be an array of numbers');const i=typeof t=="string"?jT(t,e.length):t,s=b5().domain(e).range(i);return(o,c)=>{const f=$T(r,o,c);return typeof f=="number"&&Number.isFinite(f)?s(f):n}}const mTe={ClusterTileLayer:FT,H3TileLayer:DT,HeatmapTileLayer:LT,PointLabelLayer:sv,QuadbinTileLayer:iv,RasterTileLayer:UT,VectorTileLayer:GT};function Lx(r,e=""){if(!r)throw new Error(`JSON conversion error ${e}`)}function _Te(r,e){const t=vTe(e);let n=r;for(const i of t)n=yTe(n)?n[i]:void 0;return n}function yTe(r){return r!==null&&typeof r=="object"}const LD={};function vTe(r){if(typeof r=="string"){let e=LD[r];return e||(e=r.split("."),LD[r]=e),e}return Array.isArray(r)?r:[r]}var F0={exports:{}},kD;function bTe(){return kD||(kD=1,function(r,e){(function(t){var n="Compound",i="Identifier",s="MemberExpression",o="Literal",c="ThisExpression",f="CallExpression",A="UnaryExpression",v="BinaryExpression",w="LogicalExpression",S="ConditionalExpression",F="ArrayExpression",N=46,U=44,$=39,G=34,H=40,J=41,ue=91,q=93,se=63,Te=59,Ue=58,de=function(St,st){var dr=new Error(St+" at character "+st);throw dr.index=st,dr.description=St,dr},me=!0,pe={"-":me,"!":me,"~":me,"+":me},W={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},re=function(St){var st=0,dr;for(var er in St)(dr=er.length)>st&&St.hasOwnProperty(er)&&(st=dr);return st},Ee=re(pe),et=re(W),_e={true:!0,false:!1,null:null},Le="this",Ge=function(St){return W[St]||0},Ze=function(St,st,dr){var er=St==="||"||St==="&&"?w:v;return{type:er,operator:St,left:st,right:dr}},tt=function(St){return St>=48&&St<=57},rt=function(St){return St===36||St===95||St>=65&&St<=90||St>=97&&St<=122||St>=128&&!W[String.fromCharCode(St)]},ut=function(St){return St===36||St===95||St>=65&&St<=90||St>=97&&St<=122||St>=48&&St<=57||St>=128&&!W[String.fromCharCode(St)]},vt=function(St){for(var st=0,dr=St.charAt,er=St.charCodeAt,Kt=function(Vt){return dr.call(St,Vt)},Nt=function(Vt){return er.call(St,Vt)},Ar=St.length,ln=function(){for(var Vt=Nt(st);Vt===32||Vt===9||Vt===10||Vt===13;)Vt=Nt(++st)},Pr=function(){var Vt=Vn(),mr,Rr;if(ln(),Nt(st)===se){if(st++,mr=Pr(),mr||de("Expected expression",st),ln(),Nt(st)===Ue)return st++,Rr=Pr(),Rr||de("Expected expression",st),{type:S,test:Vt,consequent:mr,alternate:Rr};de("Expected :",st)}else return Vt},xr=function(){ln();for(var Vt=St.substr(st,et),mr=Vt.length;mr>0;){if(W.hasOwnProperty(Vt)&&(!rt(Nt(st))||st+Vt.length<St.length&&!ut(Nt(st+Vt.length))))return st+=mr,Vt;Vt=Vt.substr(0,--mr)}return!1},Vn=function(){var Vt,mr,Rr,nn,_i,Me,kt,$t,lr;if(Me=_r(),mr=xr(),!mr)return Me;for(_i={value:mr,prec:Ge(mr)},kt=_r(),kt||de("Expected expression after "+mr,st),nn=[Me,_i,kt];(mr=xr())&&(Rr=Ge(mr),Rr!==0);){for(_i={value:mr,prec:Rr},lr=mr;nn.length>2&&Rr<=nn[nn.length-2].prec;)kt=nn.pop(),mr=nn.pop().value,Me=nn.pop(),Vt=Ze(mr,Me,kt),nn.push(Vt);Vt=_r(),Vt||de("Expected expression after "+lr,st),nn.push(_i,Vt)}for($t=nn.length-1,Vt=nn[$t];$t>1;)Vt=Ze(nn[$t-1].value,nn[$t-2],Vt),$t-=2;return Vt},_r=function(){var Vt,mr,Rr;if(ln(),Vt=Nt(st),tt(Vt)||Vt===N)return yr();if(Vt===$||Vt===G)return un();if(Vt===ue)return ti();for(mr=St.substr(st,Ee),Rr=mr.length;Rr>0;){if(pe.hasOwnProperty(mr)&&(!rt(Nt(st))||st+mr.length<St.length&&!ut(Nt(st+mr.length))))return st+=Rr,{type:A,operator:mr,argument:_r(),prefix:!0};mr=mr.substr(0,--Rr)}return rt(Vt)||Vt===H?Yn():!1},yr=function(){for(var Vt="",mr,Rr;tt(Nt(st));)Vt+=Kt(st++);if(Nt(st)===N)for(Vt+=Kt(st++);tt(Nt(st));)Vt+=Kt(st++);if(mr=Kt(st),mr==="e"||mr==="E"){for(Vt+=Kt(st++),mr=Kt(st),(mr==="+"||mr==="-")&&(Vt+=Kt(st++));tt(Nt(st));)Vt+=Kt(st++);tt(Nt(st-1))||de("Expected exponent ("+Vt+Kt(st)+")",st)}return Rr=Nt(st),rt(Rr)?de("Variable names cannot start with a number ("+Vt+Kt(st)+")",st):Rr===N&&de("Unexpected period",st),{type:o,value:parseFloat(Vt),raw:Vt}},un=function(){for(var Vt="",mr=Kt(st++),Rr=!1,nn;st<Ar;)if(nn=Kt(st++),nn===mr){Rr=!0;break}else if(nn==="\\")switch(nn=Kt(st++),nn){case"n":Vt+=`
5336
+ `;break;case"r":Vt+="\r";break;case"t":Vt+=" ";break;case"b":Vt+="\b";break;case"f":Vt+="\f";break;case"v":Vt+="\v";break;default:Vt+=nn}else Vt+=nn;return Rr||de('Unclosed quote after "'+Vt+'"',st),{type:o,value:Vt,raw:mr+Vt+mr}},Dr=function(){var Vt=Nt(st),mr=st,Rr;for(rt(Vt)?st++:de("Unexpected "+Kt(st),st);st<Ar&&(Vt=Nt(st),ut(Vt));)st++;return Rr=St.slice(mr,st),_e.hasOwnProperty(Rr)?{type:o,value:_e[Rr],raw:Rr}:Rr===Le?{type:c}:{type:i,name:Rr}},ci=function(Vt){for(var mr,Rr=[],nn,_i=!1,Me=0;st<Ar;)if(ln(),mr=Nt(st),mr===Vt){_i=!0,st++,Vt===J&&Me&&Me>=Rr.length&&de("Unexpected token "+String.fromCharCode(Vt),st);break}else if(mr===U){if(st++,Me++,Me!==Rr.length){if(Vt===J)de("Unexpected token ,",st);else if(Vt===q)for(var kt=Rr.length;kt<Me;kt++)Rr.push(null)}}else nn=Pr(),(!nn||nn.type===n)&&de("Expected comma",st),Rr.push(nn);return _i||de("Expected "+String.fromCharCode(Vt),st),Rr},Yn=function(){var Vt,mr;for(Vt=Nt(st),Vt===H?mr=mn():mr=Dr(),ln(),Vt=Nt(st);Vt===N||Vt===ue||Vt===H;)st++,Vt===N?(ln(),mr={type:s,computed:!1,object:mr,property:Dr()}):Vt===ue?(mr={type:s,computed:!0,object:mr,property:Pr()},ln(),Vt=Nt(st),Vt!==q&&de("Unclosed [",st),st++):Vt===H&&(mr={type:f,arguments:ci(J),callee:mr}),ln(),Vt=Nt(st);return mr},mn=function(){st++;var Vt=Pr();if(ln(),Nt(st)===J)return st++,Vt;de("Unclosed (",st)},ti=function(){return st++,{type:F,elements:ci(q)}},Hn=[],Bn,Zn;st<Ar;)Bn=Nt(st),Bn===Te||Bn===U?st++:(Zn=Pr())?Hn.push(Zn):st<Ar&&de('Unexpected "'+Kt(st)+'"',st);return Hn.length===1?Hn[0]:{type:n,body:Hn}};vt.version="0.3.5",vt.toString=function(){return"JavaScript Expression Parser (JSEP) v"+vt.version},vt.addUnaryOp=function(St){return Ee=Math.max(St.length,Ee),pe[St]=me,this},vt.addBinaryOp=function(St,st){return et=Math.max(St.length,et),W[St]=st,this},vt.addLiteral=function(St,st){return _e[St]=st,this},vt.removeUnaryOp=function(St){return delete pe[St],St.length===Ee&&(Ee=re(pe)),this},vt.removeAllUnaryOps=function(){return pe={},Ee=0,this},vt.removeBinaryOp=function(St){return delete W[St],St.length===et&&(et=re(W)),this},vt.removeAllBinaryOps=function(){return W={},et=0,this},vt.removeLiteral=function(St){return delete _e[St],this},vt.removeAllLiterals=function(){return _e={},this},r.exports?e=r.exports=vt:e.parse=vt})()}(F0,F0.exports)),F0.exports}var xTe=bTe();const wTe=_h(xTe),ND={"||":(r,e)=>r||e,"&&":(r,e)=>r&&e,"|":(r,e)=>r|e,"^":(r,e)=>r^e,"&":(r,e)=>r&e,"==":(r,e)=>r==e,"!=":(r,e)=>r!=e,"===":(r,e)=>r===e,"!==":(r,e)=>r!==e,"<":(r,e)=>r<e,">":(r,e)=>r>e,"<=":(r,e)=>r<=e,">=":(r,e)=>r>=e,"<<":(r,e)=>r<<e,">>":(r,e)=>r>>e,">>>":(r,e)=>r>>>e,"+":(r,e)=>r+e,"-":(r,e)=>r-e,"*":(r,e)=>r*e,"/":(r,e)=>r/e,"%":(r,e)=>r%e},CTe={"-":r=>-r,"+":r=>+r,"~":r=>~r,"!":r=>!r};function UD(r,e){return r.map(function(t){return Ks(t,e)})}function zD(r,e){const t=Ks(r.object,e);let n;if(r.computed?n=Ks(r.property,e):n=r.property.name,/^__proto__|prototype|constructor$/.test(n))throw Error(`Access to member "${n}" disallowed.`);return[t,t[n]]}function Ks(r,e){const t=r;switch(t.type){case"ArrayExpression":return UD(t.elements,e);case"BinaryExpression":return ND[t.operator](Ks(t.left,e),Ks(t.right,e));case"CallExpression":let n,i,s;return t.callee.type==="MemberExpression"?(s=zD(t.callee,e),n=s[0],i=s[1]):i=Ks(t.callee,e),typeof i!="function"?void 0:i.apply(n,UD(t.arguments,e));case"ConditionalExpression":return Ks(t.test,e)?Ks(t.consequent,e):Ks(t.alternate,e);case"Identifier":return e[t.name];case"Literal":return t.value;case"LogicalExpression":return t.operator==="||"?Ks(t.left,e)||Ks(t.right,e):t.operator==="&&"?Ks(t.left,e)&&Ks(t.right,e):ND[t.operator](Ks(t.left,e),Ks(t.right,e));case"MemberExpression":return zD(t,e)[1];case"ThisExpression":return e;case"UnaryExpression":return CTe[t.operator](Ks(t.argument,e));default:return}}const e2={"-":r=>r};function EU(r,e){if(r in e2)return e2[r];let t;const n=wTe(r);return n.type==="Identifier"?t=i=>_Te(i,r):(kx(n,i=>{if(i.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),t=i=>Ks(n,i)),e2[r]=t,t}function kx(r,e){if(Array.isArray(r))r.forEach(t=>kx(t,e));else if(r&&typeof r=="object"){r.type&&e(r);for(const t in r)kx(r[t],e)}}const ny="@@=",GD="@@#",TTe="@@type",BU="@@function",VD=r=>r&&typeof r=="object";class Nx{constructor(...e){this.typeKey=TTe,this.functionKey=BU,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=EU,this.preProcessClassProps=(t,n)=>n,this.postProcessConvertedJson=t=>t;for(const t of e)this.merge(t)}merge(e){for(const t in e)switch(t){case"layers":case"views":Object.assign(this.classes,e[t]);break;default:if(t in this){const n=e[t];this[t]=VD(this[t])?Object.assign(this[t],n):n}}}validate(e){return Lx(!this.typeKey||typeof this.typeKey=="string"),Lx(VD(this.classes)),!0}}function ETe(r){return typeof r=="string"&&r.startsWith(ny)}function BTe(r){return r.replace(ny,"")}function SU(r,e){const t={};for(const n in r){let i=r[n];ETe(i)&&(i=BTe(i),i=EU(i)),t[n]=i}return t}function STe(r,e,t){const n=t.classes[r],i=t.reactComponents[r];if(!n&&!i){const{log:s}=t;if(s){const o=JSON.stringify(e,null,0).slice(0,40);s.warn(`JSON converter: No registered class of type ${r}(${o}...) `)}return null}return n?ITe(n,e,t):MTe(i,e,t)}function ITe(r,e,t){return t.preProcessClassProps&&(e=t.preProcessClassProps(r,e,t)),e=SU(e),new r(e)}function MTe(r,e,t){const{React:n}=t,{children:i=[]}=e;return delete e.children,t.preProcessClassProps&&(e=t.preProcessClassProps(r,e,t)),e=SU(e),n.createElement(r,e,i)}function PTe(r,e,t){const n=t.functions[r];if(!n){const{log:i}=t;if(i){const s=JSON.stringify(e,null,0).slice(0,40);i.warn(`JSON converter: No registered function ${r}(${s}...) `)}return null}return n(e)}function RTe(r){return typeof r=="string"?JSON.parse(r):r}const WT=r=>r&&typeof r=="object";class FTe{constructor(e){this.log=console,this.onJSONChange=()=>{},this.json=null,this.convertedJson=null,this.setProps(e)}finalize(){}setProps(e){"configuration"in e&&(this.configuration=e.configuration instanceof Nx?e.configuration:new Nx(e.configuration)),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}mergeConfiguration(e){this.configuration.merge(e)}convert(e){if(!e||e===this.json)return this.convertedJson;this.json=e;const t=RTe(e);let n=DTe(t,this.configuration);return n=this.configuration.postProcessConvertedJson(n),this.convertedJson=n,n}convertJson(e){return this.convert(e)}}function DTe(r,e){return e=new Nx(e),JT(r,"",e)}function JT(r,e,t){return Array.isArray(r)?r.map((n,i)=>JT(n,String(i),t)):OTe(r,t)?LTe(r,t):WT(r)?BU in r?kTe(r,t):XT(r,t):typeof r=="string"?NTe(r,e,t):r}function OTe(r,e){const{typeKey:t}=e;return WT(r)&&!!r[t]}function LTe(r,e){const{typeKey:t}=e,n=r[t];let i={...r};return delete i[t],i=XT(i,e),STe(n,i,e)}function kTe(r,e){const{functionKey:t}=e,n=r[t];let i={...r};return delete i[t],i=XT(i,e),PTe(n,i,e)}function XT(r,e){Lx(WT(r));const t={};for(const n in r){const i=r[n];t[n]=JT(i,n,e)}return t}function NTe(r,e,t){if(r.startsWith(ny)&&t.convertFunction)return r=r.replace(ny,""),t.convertFunction(r,t);if(r.startsWith(GD)){if(r=r.replace(GD,""),t.constants[r])return t.constants[r];const[n,i]=r.split(".");return t.enumerations[n][i]}return r}const UTe={classes:{...fue,...Pxe,...s2e,...e0e,...mTe},functions:{colorBins:pTe,colorCategories:ATe,colorContinuous:gTe}},IU=new FTe({configuration:UTe}),zTe={[qy.layerName]:["getFillColor"],[Uy.layerName]:["getFillColor"],[_l.layerName]:["getFillColor"],[Xp.layerName]:["getFillColor"],[Fy.layerName]:["getFillColor"],[Ry.layerName]:["getFillColor"],[Ly.layerName]:["getColor"],[jg.layerName]:["getTargetColor","getSourceColor"],[ml.layerName]:["getFillColor"],[iu.layerName]:["getFillColor"],[Jp.layerName]:["getColor"],[Sy.layerName]:["getColor"],[uf.layerName]:["getColor"],[$g.layerName]:["getColor"],[hf.layerName]:["getFillColor"],[Wg.layerName]:["getFillColor","getColor","getLineColor"],[ff.layerName]:["getFillColor"],[Eh.layerName]:["getColor"],[Qg.layerName]:["getColor"],[Ah.layerName]:["getColor"]},GTe=({object:r,objectInfo:e,originalFillFunction:t})=>{const n=typeof t=="function"?t(r,e):t;if(Array.isArray(n))return[n[0]||0,n[1]||0,n[2]||0,n[3]||255];if(typeof n=="string"&&n.startsWith("@@=")){const i=IU.convert({originalColor:n}).originalColor(r);return[i[0]||0,i[1]||0,i[2]||0,i[3]||255]}return null},HD=({isSelected:r,object:e,objectInfo:t,opacity:n,originalFillFunction:i})=>{const s=GTe({object:e,objectInfo:t,originalFillFunction:i});if(!s)return null;let o=0;return r?o=Math.max(typeof s[3]=="number"?s[3]:n,n):o=Math.min(typeof s[3]=="number"?s[3]:n,n),[s[0]||0,s[1]||0,s[2]||0,o]},VTe=({isSelected:r,object:e,objectInfo:t,originalFillFunction:n,selectedColor:i,selectedOpacity:s=255,unselectedColor:o,unselectedOpacity:c=Math.floor(255*.4)})=>r?HD({opacity:s,isSelected:!0,object:e,objectInfo:t,originalFillFunction:n})||i:HD({opacity:c,isSelected:!1,object:e,objectInfo:t,originalFillFunction:n})||o,Dg={selection:{indices:{},objects:{}}},jD=(r,e)=>{const t=e.match(/{(.*?)}/g);return t&&t.forEach(n=>{const i=n.substring(1,n.length-1);Object.hasOwn(r.object,i)?e=e.replace(n,r.object[i]):Object.hasOwn(r.object,"properties")&&Object.hasOwn(r.object.properties,i)&&(e=e.replace(n,r.object.properties[i]))}),e};function HTe(r,e){return e.id?r.getElementState(e.id,"selection")??Dg:Dg}function jTe(r,e){if(!e.id)return Dg;const t=r.getStringValue(e);return(t?r2.parse(t):null)??Dg}function $Te(r,e,t,n){r.id&&e.setStringValue(r,JSON.stringify(t.value),{fromUi:t.fromUi},n)}const WTe=r=>{const{height:e,width:t,expanded:n}=XD(KD),{element:i,fragmentId:s,isLightTheme:o,theme:c,widgetMgr:f}=r,{selectionMode:A,tooltip:v,useContainerWidth:w}=i,S=n??!1,[F,N]=y5({element:i,getDefaultState:HTe,getStateFromWidgetMgr:jTe,updateWidgetMgrState:$Te,widgetMgr:f,fragmentId:s}),[U,$]=It.useState(null),{height:G,width:H}=Yae({element:i,isFullScreen:S,shouldUseContainerWidth:w,container:{height:e,width:t},heightFallback:U?.initialViewState?.height||c.sizes.defaultMapHeight}),[J,ue]=It.useState(null),q=A[0],se=q!==void 0,Te=se&&Object.keys(F.selection.indices).length>0,Ue=It.useMemo(()=>Object.freeze(r2.parse(i.json)),[S,o,i.json]),de=It.useMemo(()=>{const W={...Ue};if(W.mapStyle||(W.mapStyle=o?"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json":"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"),(W?.mapProvider=="carto"||W?.mapStyle&&W.mapStyle?.indexOf("cartocdn")>=0)&&!W.cartoKey&&(W.cartoKey="x7g2plm9yq8vfrc"),W.layers){const Ee=Object.values(F.selection.indices).some(_e=>_e?.length),et=W.layers.some(_e=>Object.hasOwn(_e,"pickable"));W.layers=W.layers.map(_e=>{if(!_e||Array.isArray(_e)||!se)return _e;et||(_e.pickable=!0);const Le=`${_e.id||null}`,Ge=F?.selection?.indices?.[Le]||[],Ze=zTe[_e["@@type"]];if(!Ze)return _e;const tt={..._e};return Ze.forEach(rt=>{tt.updateTriggers={[rt]:[...tt.updateTriggers?.[rt]||[],Ge,Ee]};const ut=!Ee,vt=_e[rt];if(ut||!vt)return tt;const St=255,st=Math.floor(255*.4),dr=AB(c.colors.primary),er=[dr[0],dr[1],dr[2],St],Kt=AB(c.colors.gray20),Nt=[Kt[0],Kt[1],Kt[2],st],Ar=(ln,Pr)=>VTe({isSelected:Ge.includes(Pr.index),object:ln,objectInfo:Pr,originalFillFunction:vt,selectedColor:er,unselectedColor:Nt,selectedOpacity:St,unselectedOpacity:st});tt[rt]=Ar}),tt})}return delete W?.views,IU.convert(W)},[F.selection.indices,o,se,Ue,c.colors.gray20,c.colors.primary]);It.useEffect(()=>{if(!u5(de.initialViewState,J)){const W=Object.keys(de.initialViewState).reduce((re,Ee)=>de.initialViewState[Ee]===J?.[Ee]?re:{...re,[Ee]:de.initialViewState[Ee]},{});$(re=>({...re,...W})),ue(de.initialViewState)}},[de.initialViewState,J,U]);const me=It.useCallback(W=>{if(!W?.object||!v)return null;const re=r2.parse(v);return re.html?re.html=jD(W,re.html):re.text=jD(W,re.text),re},[v]),pe=It.useCallback(({viewState:W})=>{$(W)},[$]);return{createTooltip:me,data:F,deck:de,hasActiveSelection:Te,height:G,isSelectionModeActivated:se,onViewStateChange:pe,selectionMode:q,setSelection:N,viewState:U,width:H}};Ug([Jw,X2]);const t2=Dg.selection,JTe=[],XTe=r=>{const{disabled:e,disableFullscreenMode:t,element:n,fragmentId:i,heightConfig:s,widgetMgr:o}=r,{mapboxToken:c}=It.useContext(f5),f=h5(),{expanded:A,expand:v,collapse:w}=XD(KD),S=!!s?.useStretch,{createTooltip:F,data:N,deck:U,hasActiveSelection:$,isSelectionModeActivated:G,onViewStateChange:H,selectionMode:J,setSelection:ue,viewState:q}=WTe({element:n,fragmentId:i,isLightTheme:JD(f),theme:f,widgetMgr:o}),se=n.mapboxToken||c,Te=U.mapProvider=="mapbox"||U?.mapStyle&&U.mapStyle?.indexOf("mapbox")>=0,[Ue,de]=It.useState(!1);It.useEffect(()=>{de(!0)},[]);const me=It.useCallback(W=>{if(J===void 0)return;const{index:re,object:Ee}=W,et=`${W.layer?.id||null}`,_e=N,Le=re===-1,Ze=(()=>{if(Le)return t2;switch(J){case mB.SelectionMode.SINGLE_OBJECT:return _e.selection.indices[et]?.[0]===re?t2:{indices:{[`${et}`]:[re]},objects:{[`${et}`]:[Ee]}};case mB.SelectionMode.MULTI_OBJECT:{const tt=new Map((_e?.selection?.indices?.[et]||[]).map((ut,vt)=>[ut,_e.selection?.objects?.[et]?.[vt]]));if(tt.has(re)?tt.delete(re):tt.set(re,Ee),tt.size===0){const{[et]:rt,...ut}=_e.selection.indices,{[et]:vt,...St}=_e.selection.objects;return{indices:ut,objects:St}}return{indices:{..._e.selection.indices,[`${et}`]:Array.from(tt.keys())},objects:{..._e.selection.objects,[`${et}`]:Array.from(tt.values())}}}default:throw d5(J),new Error("Invalid selection mode")}})();JSON.stringify(Ze)!==JSON.stringify(_e.selection)&&ue({fromUi:!0,value:{selection:Ze}})},[J,N,ue]),pe=It.useCallback(()=>{ue({value:{selection:t2},fromUi:!0})},[ue]);return gB(SM,{className:"stDeckGlJsonChart","data-testid":"stDeckGlJsonChart",isStretchHeight:S,children:[Te?Jf(Kae,{}):null,Jf(_5,{isFullScreen:A,disableFullscreenMode:t,onExpand:v,onCollapse:w,target:SM,locked:$&&!e?!0:void 0,children:$&&!e&&Jf(m5,{label:"Clear selection",onClick:pe,icon:A5})}),q&&gB(EZ,{viewState:q,onViewStateChange:H,layers:Ue?U.layers:JTe,getTooltip:F,ContextProvider:Th.Provider,controller:!0,onClick:G&&!e?me:void 0,children:[Jf(nu,{mapStyle:U.mapStyle&&(typeof U.mapStyle=="string"?U.mapStyle:U.mapStyle[0]),mapboxApiAccessToken:se}),Jf(qae,{children:Jf($ae,{"data-testid":"stDeckGlJsonChartZoomButton",showCompass:!1})})]})]})},KTe=g5(XTe),oBe=It.memo(KTe);export{oBe as default};