@mountaya/elements 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (862) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +4 -3
  3. package/THIRD-PARTY-NOTICES.txt +1 -1
  4. package/dist/agent/index.cjs +1152 -1905
  5. package/dist/agent/index.cjs.map +1 -1
  6. package/dist/agent/index.d.cts +1152 -1202
  7. package/dist/agent/index.d.ts +1152 -1202
  8. package/dist/agent/index.js +1147 -1903
  9. package/dist/agent/index.js.map +1 -1
  10. package/dist/camera/index.cjs +2470 -3435
  11. package/dist/camera/index.cjs.map +1 -1
  12. package/dist/camera/index.d.cts +716 -744
  13. package/dist/camera/index.d.ts +716 -744
  14. package/dist/camera/index.js +2438 -3323
  15. package/dist/camera/index.js.map +1 -1
  16. package/dist/{units-D9mBrusY.d.cts → chunk-5pTPpv4v.d.cts} +38 -41
  17. package/dist/{units-D9mBrusY.d.ts → chunk-5pTPpv4v.d.ts} +38 -41
  18. package/dist/{order-BLhsGsH8.d.ts → chunk-6JzFMFHh.d.ts} +15 -28
  19. package/dist/chunk-6qyuJVvt.d.ts +513 -0
  20. package/dist/chunk-9fp0lDic.cjs +583 -0
  21. package/dist/chunk-9fp0lDic.cjs.map +1 -0
  22. package/dist/{zones-B05QA8fy.d.ts → chunk-A48H1rDg.d.cts} +2 -4
  23. package/dist/{zones-B05QA8fy.d.cts → chunk-A48H1rDg.d.ts} +2 -4
  24. package/dist/chunk-B-m1AchR.cjs +57 -0
  25. package/dist/chunk-B-m1AchR.cjs.map +1 -0
  26. package/dist/{bundle-xYrrbJTH.d.ts → chunk-B-qFTf04.d.ts} +51 -57
  27. package/dist/chunk-B0YROiZh.d.cts +1475 -0
  28. package/dist/chunk-B14wgOvH.d.cts +68 -0
  29. package/dist/chunk-B19l3j9r.cjs +150 -0
  30. package/dist/chunk-B19l3j9r.cjs.map +1 -0
  31. package/dist/chunk-B2PtjVKg.cjs +86 -0
  32. package/dist/chunk-B2PtjVKg.cjs.map +1 -0
  33. package/dist/chunk-B56Oyb7W.cjs +70 -0
  34. package/dist/chunk-B56Oyb7W.cjs.map +1 -0
  35. package/dist/chunk-B5WGMQwK.cjs +113 -0
  36. package/dist/chunk-B5WGMQwK.cjs.map +1 -0
  37. package/dist/{types-nO2joeRk.d.ts → chunk-B98mKrdu.d.cts} +103 -122
  38. package/dist/{videoOverlay-Dh_D5_Zs.d.ts → chunk-BB0PmqIM.d.cts} +10 -10
  39. package/dist/chunk-BBikve0Z.cjs +269 -0
  40. package/dist/chunk-BBikve0Z.cjs.map +1 -0
  41. package/dist/chunk-BHeXmM0X.js +37 -0
  42. package/dist/chunk-BHeXmM0X.js.map +1 -0
  43. package/dist/chunk-BI8WZLpU.cjs +281 -0
  44. package/dist/chunk-BI8WZLpU.cjs.map +1 -0
  45. package/dist/chunk-BIEc_SkR.cjs +29 -0
  46. package/dist/chunk-BIEc_SkR.cjs.map +1 -0
  47. package/dist/chunk-BJ6L6_W9.cjs +553 -0
  48. package/dist/chunk-BJ6L6_W9.cjs.map +1 -0
  49. package/dist/chunk-BJ91UCbB.js +11 -0
  50. package/dist/chunk-BJ91UCbB.js.map +1 -0
  51. package/dist/chunk-BJEZWTKj.cjs +166 -0
  52. package/dist/chunk-BJEZWTKj.cjs.map +1 -0
  53. package/dist/chunk-BJz54mfg.cjs +10 -0
  54. package/dist/chunk-BJz54mfg.cjs.map +1 -0
  55. package/dist/{sections-CVlc2Inr.d.cts → chunk-BNX5LAfN.d.cts} +289 -330
  56. package/dist/chunk-BP6KgA86.js +35 -0
  57. package/dist/chunk-BP6KgA86.js.map +1 -0
  58. package/dist/{segmentRoute-C5UL_5bp.d.ts → chunk-BRnjQq6K.d.cts} +44 -59
  59. package/dist/chunk-BSiMEwPS.js +46 -0
  60. package/dist/chunk-BSiMEwPS.js.map +1 -0
  61. package/dist/chunk-BTPjDw_y.cjs +16 -0
  62. package/dist/chunk-BTPjDw_y.cjs.map +1 -0
  63. package/dist/chunk-BTUUABGI.js +17 -0
  64. package/dist/chunk-BTUUABGI.js.map +1 -0
  65. package/dist/chunk-BUeL9y7s.cjs +45 -0
  66. package/dist/chunk-BUeL9y7s.cjs.map +1 -0
  67. package/dist/chunk-BWMuCNc9.cjs +172 -0
  68. package/dist/chunk-BWMuCNc9.cjs.map +1 -0
  69. package/dist/chunk-BWjRfhpF.js +126 -0
  70. package/dist/chunk-BWjRfhpF.js.map +1 -0
  71. package/dist/{types-CTQwbSdA.d.cts → chunk-BZ5KyZXI.d.ts} +103 -122
  72. package/dist/chunk-B_4SVmvh.js +94 -0
  73. package/dist/chunk-B_4SVmvh.js.map +1 -0
  74. package/dist/chunk-BcTUuZQ3.js +95 -0
  75. package/dist/chunk-BcTUuZQ3.js.map +1 -0
  76. package/dist/chunk-BdkqSsJe.cjs +140 -0
  77. package/dist/chunk-BdkqSsJe.cjs.map +1 -0
  78. package/dist/chunk-BfktMVmI.js +70 -0
  79. package/dist/chunk-BfktMVmI.js.map +1 -0
  80. package/dist/chunk-BfzQb0EK.cjs +6 -0
  81. package/dist/chunk-BhWfT-22.d.cts +808 -0
  82. package/dist/chunk-BjJcqX5J.cjs +60 -0
  83. package/dist/chunk-BjJcqX5J.cjs.map +1 -0
  84. package/dist/{geodesy-543qXKtI.d.ts → chunk-Bk0L8g5J.d.cts} +3 -4
  85. package/dist/{geodesy-543qXKtI.d.cts → chunk-Bk0L8g5J.d.ts} +3 -4
  86. package/dist/chunk-Bl4_uVa6.cjs +11 -0
  87. package/dist/chunk-Bl4_uVa6.cjs.map +1 -0
  88. package/dist/chunk-BlKF4lrp.js +43 -0
  89. package/dist/chunk-BlKF4lrp.js.map +1 -0
  90. package/dist/chunk-Bm1FieGR.js +4 -0
  91. package/dist/chunk-Bm1FieGR.js.map +1 -0
  92. package/dist/chunk-Bn6ZbxkS.cjs +27 -0
  93. package/dist/chunk-BpN3hr6a.cjs +541 -0
  94. package/dist/chunk-BpN3hr6a.cjs.map +1 -0
  95. package/dist/{order-BZkUwMou.d.cts → chunk-Bq_WHTfd.d.cts} +15 -28
  96. package/dist/chunk-Bqt4LBBz.cjs +648 -0
  97. package/dist/chunk-Bqt4LBBz.cjs.map +1 -0
  98. package/dist/{language-CEWQ5uYw.d.cts → chunk-Bqt97zwf.d.cts} +3 -18
  99. package/dist/{language-CEWQ5uYw.d.ts → chunk-Bqt97zwf.d.ts} +3 -18
  100. package/dist/chunk-BsBiN4w6.d.cts +245 -0
  101. package/dist/chunk-BvTpOUoC.cjs +207 -0
  102. package/dist/chunk-BvTpOUoC.cjs.map +1 -0
  103. package/dist/chunk-BwK6Hl3q.cjs +446 -0
  104. package/dist/chunk-BwK6Hl3q.cjs.map +1 -0
  105. package/dist/{elevationTiles-pmsb9wnU.d.cts → chunk-BxDQZDXR.d.cts} +26 -27
  106. package/dist/{elevationTiles-pmsb9wnU.d.ts → chunk-BxDQZDXR.d.ts} +26 -27
  107. package/dist/chunk-BxUio8kX.js +20 -0
  108. package/dist/chunk-BxUio8kX.js.map +1 -0
  109. package/dist/chunk-BxaocpFi.d.cts +1 -0
  110. package/dist/chunk-Bywi0K1N.js +36 -0
  111. package/dist/chunk-Bywi0K1N.js.map +1 -0
  112. package/dist/chunk-C-IlmkDl.js +59 -0
  113. package/dist/chunk-C-IlmkDl.js.map +1 -0
  114. package/dist/chunk-C5PtVewq.d.ts +389 -0
  115. package/dist/chunk-C5dpC7mQ.js +19 -0
  116. package/dist/chunk-C5dpC7mQ.js.map +1 -0
  117. package/dist/chunk-C5q1sgSa.js +46 -0
  118. package/dist/chunk-C5q1sgSa.js.map +1 -0
  119. package/dist/chunk-C6fU9G5I.cjs +221 -0
  120. package/dist/chunk-C6fU9G5I.cjs.map +1 -0
  121. package/dist/chunk-C71dpWUK.js +5 -0
  122. package/dist/chunk-C71dpWUK.js.map +1 -0
  123. package/dist/chunk-C82N1gQX.d.ts +1831 -0
  124. package/dist/chunk-C8HdaHpu.js +118 -0
  125. package/dist/chunk-C8HdaHpu.js.map +1 -0
  126. package/dist/chunk-C8ZGryck.js +236 -0
  127. package/dist/chunk-C8ZGryck.js.map +1 -0
  128. package/dist/chunk-C95NG0oD.cjs +43 -0
  129. package/dist/chunk-C95NG0oD.cjs.map +1 -0
  130. package/dist/chunk-C9aR8DXb.js +9 -0
  131. package/dist/chunk-C9aR8DXb.js.map +1 -0
  132. package/dist/{camera-C48Ykaxv.d.ts → chunk-CAUZnoCs.d.ts} +135 -159
  133. package/dist/chunk-CBXWWuM9.cjs +82 -0
  134. package/dist/chunk-CBXWWuM9.cjs.map +1 -0
  135. package/dist/chunk-CC_Kquu7.d.cts +125 -0
  136. package/dist/chunk-CC_Kquu7.d.ts +125 -0
  137. package/dist/chunk-CCp85vXg.cjs +60 -0
  138. package/dist/chunk-CCp85vXg.cjs.map +1 -0
  139. package/dist/chunk-CEcB1_uK.js +39 -0
  140. package/dist/chunk-CEcB1_uK.js.map +1 -0
  141. package/dist/{bundle-Je5zsRFg.d.cts → chunk-CFIo021l.d.cts} +51 -57
  142. package/dist/chunk-CH_IZoJE.js +33 -0
  143. package/dist/chunk-CH_IZoJE.js.map +1 -0
  144. package/dist/chunk-CHrasH_g.cjs +25 -0
  145. package/dist/chunk-CHrasH_g.cjs.map +1 -0
  146. package/dist/chunk-CJVoSaAE.cjs +3 -0
  147. package/dist/chunk-CJp8nGcb.js +96 -0
  148. package/dist/chunk-CJp8nGcb.js.map +1 -0
  149. package/dist/chunk-CJwUtkOt.js +112 -0
  150. package/dist/chunk-CJwUtkOt.js.map +1 -0
  151. package/dist/chunk-CKhCOVIf.d.cts +751 -0
  152. package/dist/chunk-CKiVSRYg.js +50 -0
  153. package/dist/chunk-CKiVSRYg.js.map +1 -0
  154. package/dist/chunk-CKtd19eD.cjs +59 -0
  155. package/dist/chunk-CKtd19eD.cjs.map +1 -0
  156. package/dist/chunk-CL92KE3j.d.ts +3188 -0
  157. package/dist/chunk-CLqUlkAe.js +54 -0
  158. package/dist/chunk-CLqUlkAe.js.map +1 -0
  159. package/dist/chunk-CMG5OV0q.cjs +4741 -0
  160. package/dist/chunk-CMG5OV0q.cjs.map +1 -0
  161. package/dist/chunk-CN_TKSgm.js +10 -0
  162. package/dist/chunk-CN_TKSgm.js.map +1 -0
  163. package/dist/chunk-CNe6MtqV.cjs +29 -0
  164. package/dist/chunk-CNe6MtqV.cjs.map +1 -0
  165. package/dist/chunk-COQkDTC5.js +83 -0
  166. package/dist/chunk-COQkDTC5.js.map +1 -0
  167. package/dist/chunk-CPBl6K4M.cjs +168 -0
  168. package/dist/chunk-CPBl6K4M.cjs.map +1 -0
  169. package/dist/chunk-CPx0ZYFB.d.ts +3 -0
  170. package/dist/chunk-CQQhcP_C.d.ts +197 -0
  171. package/dist/chunk-CTNoajFh.d.cts +389 -0
  172. package/dist/chunk-CTd-qgJc.cjs +384 -0
  173. package/dist/chunk-CTd-qgJc.cjs.map +1 -0
  174. package/dist/chunk-CW80YYtU.cjs +1056 -0
  175. package/dist/chunk-CW80YYtU.cjs.map +1 -0
  176. package/dist/{searchLimits-j99-NTXR.d.ts → chunk-CWpqBgkF.d.cts} +2 -2
  177. package/dist/{searchLimits-j99-NTXR.d.cts → chunk-CWpqBgkF.d.ts} +2 -2
  178. package/dist/chunk-CXjRArgy.d.ts +3 -0
  179. package/dist/chunk-CXonfH3-.cjs +14 -0
  180. package/dist/chunk-CXonfH3-.cjs.map +1 -0
  181. package/dist/chunk-CYcouGXN.d.ts +825 -0
  182. package/dist/chunk-CZDAzEBw.cjs +1621 -0
  183. package/dist/chunk-CZDAzEBw.cjs.map +1 -0
  184. package/dist/{amenities-B3-qAjxu.d.cts → chunk-C_fQFr70.d.cts} +40 -41
  185. package/dist/{amenities-B3-qAjxu.d.ts → chunk-C_fQFr70.d.ts} +40 -41
  186. package/dist/chunk-CbOtHnnB.cjs +359 -0
  187. package/dist/chunk-CbOtHnnB.cjs.map +1 -0
  188. package/dist/chunk-CdA6ZMGk.d.cts +825 -0
  189. package/dist/chunk-Ce1_thm7.js +146 -0
  190. package/dist/chunk-Ce1_thm7.js.map +1 -0
  191. package/dist/chunk-CeD8Hw0j.d.cts +3188 -0
  192. package/dist/{camera-BrFLU1DH.d.cts → chunk-CeiTuMyt.d.cts} +135 -159
  193. package/dist/chunk-Ch1OLzLi.js +1 -0
  194. package/dist/chunk-Cizu_j1N.cjs +87 -0
  195. package/dist/chunk-Cizu_j1N.cjs.map +1 -0
  196. package/dist/chunk-CjDe9z6A.d.cts +427 -0
  197. package/dist/chunk-Cl1etdlu.js +63 -0
  198. package/dist/chunk-Cl1etdlu.js.map +1 -0
  199. package/dist/chunk-CmoVJDoz.js +4 -0
  200. package/dist/chunk-CmoVJDoz.js.map +1 -0
  201. package/dist/chunk-CnLucxjG.cjs +197 -0
  202. package/dist/chunk-CnLucxjG.cjs.map +1 -0
  203. package/dist/chunk-CsWjBmdi.cjs +56 -0
  204. package/dist/chunk-CsWjBmdi.cjs.map +1 -0
  205. package/dist/chunk-CuseO5MZ.d.cts +3 -0
  206. package/dist/chunk-CvMHibbA.d.ts +427 -0
  207. package/dist/chunk-CwDeiN5U.js +870 -0
  208. package/dist/chunk-CwDeiN5U.js.map +1 -0
  209. package/dist/chunk-Cwdmx4tG.js +1 -0
  210. package/dist/{geolocation-DDkQdWMN.d.cts → chunk-D-4MxHTt.d.cts} +33 -34
  211. package/dist/{geolocation-DDkQdWMN.d.ts → chunk-D-4MxHTt.d.ts} +33 -34
  212. package/dist/chunk-D0LF-99V.js +1093 -0
  213. package/dist/chunk-D0LF-99V.js.map +1 -0
  214. package/dist/chunk-D1fe-0c_.js +367 -0
  215. package/dist/chunk-D1fe-0c_.js.map +1 -0
  216. package/dist/chunk-D21fEI6A.d.ts +1926 -0
  217. package/dist/chunk-D39gAxya.cjs +89 -0
  218. package/dist/chunk-D39gAxya.cjs.map +1 -0
  219. package/dist/chunk-D6KdIW5e.cjs +228 -0
  220. package/dist/chunk-D6KdIW5e.cjs.map +1 -0
  221. package/dist/chunk-D6qHYbgW.d.cts +36 -0
  222. package/dist/{videoOverlay-Dh_D5_Zs.d.cts → chunk-D89E-w70.d.ts} +10 -10
  223. package/dist/chunk-D8bdTysL.js +552 -0
  224. package/dist/chunk-D8bdTysL.js.map +1 -0
  225. package/dist/chunk-D96QJT24.cjs +109 -0
  226. package/dist/chunk-D96QJT24.cjs.map +1 -0
  227. package/dist/chunk-DAmkQl-i.js +119 -0
  228. package/dist/chunk-DAmkQl-i.js.map +1 -0
  229. package/dist/chunk-DEfsb2lc.cjs +10 -0
  230. package/dist/chunk-DEfsb2lc.cjs.map +1 -0
  231. package/dist/chunk-DIFjT5-V.d.cts +66 -0
  232. package/dist/{sections-CmtaduLc.d.ts → chunk-DJpUw8TN.d.ts} +289 -330
  233. package/dist/chunk-DK6lm2IZ.cjs +11 -0
  234. package/dist/chunk-DK6lm2IZ.cjs.map +1 -0
  235. package/dist/chunk-DKqgr31j.cjs +61 -0
  236. package/dist/chunk-DKqgr31j.cjs.map +1 -0
  237. package/dist/chunk-DLZ0QYm9.js +37 -0
  238. package/dist/chunk-DLZ0QYm9.js.map +1 -0
  239. package/dist/chunk-DLjS0uaC.js +4 -0
  240. package/dist/chunk-DLjS0uaC.js.map +1 -0
  241. package/dist/chunk-DMokwmOV.cjs +49 -0
  242. package/dist/chunk-DMokwmOV.cjs.map +1 -0
  243. package/dist/chunk-DMvWgBZL.d.cts +1831 -0
  244. package/dist/chunk-DNfGfIF3.js +31 -0
  245. package/dist/chunk-DNfGfIF3.js.map +1 -0
  246. package/dist/chunk-DQbSRe8D.d.ts +245 -0
  247. package/dist/chunk-DSGkP8_y.js +45 -0
  248. package/dist/chunk-DSGkP8_y.js.map +1 -0
  249. package/dist/chunk-DTctvfSd.d.cts +197 -0
  250. package/dist/chunk-DWe7igyw.cjs +206 -0
  251. package/dist/chunk-DWe7igyw.cjs.map +1 -0
  252. package/dist/chunk-DWsMP5JR.d.ts +68 -0
  253. package/dist/{provider-DM71XnLX.d.cts → chunk-DWsm3HIW.d.cts} +37 -38
  254. package/dist/{provider-DM71XnLX.d.ts → chunk-DWsm3HIW.d.ts} +37 -38
  255. package/dist/chunk-DXABHjLa.cjs +3 -0
  256. package/dist/chunk-D_BeqSbc.cjs +42 -0
  257. package/dist/chunk-D_BeqSbc.cjs.map +1 -0
  258. package/dist/chunk-D_svQNdW.d.ts +66 -0
  259. package/dist/chunk-Dav4xWrp.js +330 -0
  260. package/dist/chunk-Dav4xWrp.js.map +1 -0
  261. package/dist/chunk-DbCPhepL.js +293 -0
  262. package/dist/chunk-DbCPhepL.js.map +1 -0
  263. package/dist/chunk-DcrTy-y2.cjs +43 -0
  264. package/dist/chunk-DcrTy-y2.cjs.map +1 -0
  265. package/dist/chunk-Ddv484ld.js +487 -0
  266. package/dist/chunk-Ddv484ld.js.map +1 -0
  267. package/dist/chunk-De0bjnhY.cjs +88 -0
  268. package/dist/chunk-De0bjnhY.cjs.map +1 -0
  269. package/dist/chunk-De2FmNPu.cjs +32 -0
  270. package/dist/chunk-De2FmNPu.cjs.map +1 -0
  271. package/dist/{segmentRoute-CIo6dR8Y.d.cts → chunk-DeSjQXiI.d.ts} +44 -59
  272. package/dist/chunk-Den0Ta6C.js +132 -0
  273. package/dist/chunk-Den0Ta6C.js.map +1 -0
  274. package/dist/chunk-DiDKEeEa.js +8 -0
  275. package/dist/chunk-DiDKEeEa.js.map +1 -0
  276. package/dist/chunk-Dj60k5PU.js +197 -0
  277. package/dist/chunk-Dj60k5PU.js.map +1 -0
  278. package/dist/chunk-DjnYQBCN.js +4705 -0
  279. package/dist/chunk-DjnYQBCN.js.map +1 -0
  280. package/dist/chunk-Dk9VKvyq.d.ts +1 -0
  281. package/dist/chunk-Dor1ERI9.cjs +85 -0
  282. package/dist/chunk-Dor1ERI9.cjs.map +1 -0
  283. package/dist/chunk-DpMouOoH.js +451 -0
  284. package/dist/chunk-DpMouOoH.js.map +1 -0
  285. package/dist/chunk-DposgdNL.cjs +52 -0
  286. package/dist/chunk-DposgdNL.cjs.map +1 -0
  287. package/dist/chunk-DqLTG_5Q.d.cts +3 -0
  288. package/dist/{roadAccess-D_rOE4xW.d.cts → chunk-Dr5MCIpS.d.cts} +5 -28
  289. package/dist/{roadAccess-D_rOE4xW.d.ts → chunk-Dr5MCIpS.d.ts} +5 -28
  290. package/dist/chunk-DrudttCC.cjs +4 -0
  291. package/dist/chunk-DsDYVJQC.js +173 -0
  292. package/dist/chunk-DsDYVJQC.js.map +1 -0
  293. package/dist/chunk-Dw8ur6FJ.js +27 -0
  294. package/dist/chunk-Dw8ur6FJ.js.map +1 -0
  295. package/dist/chunk-DwG6M_0v.js +64 -0
  296. package/dist/chunk-DwG6M_0v.js.map +1 -0
  297. package/dist/chunk-Dy9a5ibO.js +284 -0
  298. package/dist/chunk-Dy9a5ibO.js.map +1 -0
  299. package/dist/chunk-DyayZlQJ.js +157 -0
  300. package/dist/chunk-DyayZlQJ.js.map +1 -0
  301. package/dist/chunk-DyhJZC2i.js +126 -0
  302. package/dist/chunk-DyhJZC2i.js.map +1 -0
  303. package/dist/chunk-F9zBzmmG.cjs +45 -0
  304. package/dist/chunk-F9zBzmmG.cjs.map +1 -0
  305. package/dist/chunk-FyCYofv2.js +116 -0
  306. package/dist/chunk-FyCYofv2.js.map +1 -0
  307. package/dist/chunk-GHJRjAk2.js +1 -0
  308. package/dist/chunk-H14isiSf.d.ts +751 -0
  309. package/dist/chunk-HIJzXoN4.js +7 -0
  310. package/dist/chunk-HIJzXoN4.js.map +1 -0
  311. package/dist/chunk-Id_8kRtu.d.ts +36 -0
  312. package/dist/chunk-KN60yxBQ.js +5 -0
  313. package/dist/chunk-KN60yxBQ.js.map +1 -0
  314. package/dist/chunk-NM5yg6bh.cjs +82 -0
  315. package/dist/chunk-NM5yg6bh.cjs.map +1 -0
  316. package/dist/chunk-OXr3zJfM.cjs +119 -0
  317. package/dist/chunk-OXr3zJfM.cjs.map +1 -0
  318. package/dist/chunk-QGqgNC4z.d.ts +928 -0
  319. package/dist/chunk-QJBtJrZ0.js +36 -0
  320. package/dist/chunk-QJBtJrZ0.js.map +1 -0
  321. package/dist/{routeProfile-BsSUABXv.d.cts → chunk-QKWhxfPv.d.cts} +196 -45
  322. package/dist/{routeProfile-BKfSfxx6.d.ts → chunk-QKWhxfPv.d.ts} +196 -45
  323. package/dist/chunk-QXW7b4Ev.d.cts +410 -0
  324. package/dist/chunk-RHZrxUrM.cjs +39 -0
  325. package/dist/chunk-RHZrxUrM.cjs.map +1 -0
  326. package/dist/chunk-RTxe2i66.js +91 -0
  327. package/dist/chunk-RTxe2i66.js.map +1 -0
  328. package/dist/chunk-RrKkJb6P.js +16 -0
  329. package/dist/chunk-RrKkJb6P.js.map +1 -0
  330. package/dist/chunk-VOJqpcnM.cjs +181 -0
  331. package/dist/chunk-VOJqpcnM.cjs.map +1 -0
  332. package/dist/chunk-VljGTrid.js +1 -0
  333. package/dist/chunk-X3UVwUEK.d.cts +513 -0
  334. package/dist/chunk-X9K2WChn.cjs +28 -0
  335. package/dist/chunk-X9K2WChn.cjs.map +1 -0
  336. package/dist/chunk-YrtOx6oy.js +251 -0
  337. package/dist/chunk-YrtOx6oy.js.map +1 -0
  338. package/dist/chunk-bY7ySujI.d.cts +928 -0
  339. package/dist/chunk-bYf1sBz5.d.cts +11 -0
  340. package/dist/chunk-bYf1sBz5.d.ts +11 -0
  341. package/dist/chunk-blfknWoM.d.cts +1926 -0
  342. package/dist/chunk-blqsohAb.js +113 -0
  343. package/dist/chunk-blqsohAb.js.map +1 -0
  344. package/dist/chunk-cDMCjodI.cjs +58 -0
  345. package/dist/chunk-cDMCjodI.cjs.map +1 -0
  346. package/dist/chunk-cWjE3qd6.cjs +10 -0
  347. package/dist/chunk-cWjE3qd6.cjs.map +1 -0
  348. package/dist/chunk-dfOgV3fu.js +26 -0
  349. package/dist/chunk-dfOgV3fu.js.map +1 -0
  350. package/dist/chunk-f9cTwUX1.cjs +125 -0
  351. package/dist/chunk-f9cTwUX1.cjs.map +1 -0
  352. package/dist/chunk-fHVYEZs4.cjs +28 -0
  353. package/dist/chunk-fHVYEZs4.cjs.map +1 -0
  354. package/dist/chunk-fWRUMgRI.js +22 -0
  355. package/dist/chunk-fWRUMgRI.js.map +1 -0
  356. package/dist/{types-BEv8V_8V.d.cts → chunk-fozLXfHY.d.cts} +8 -8
  357. package/dist/{types-BEv8V_8V.d.ts → chunk-fozLXfHY.d.ts} +8 -8
  358. package/dist/chunk-gWmB1l3A.cjs +3122 -0
  359. package/dist/chunk-gWmB1l3A.cjs.map +1 -0
  360. package/dist/chunk-gbj2R-_w.js +58 -0
  361. package/dist/chunk-gbj2R-_w.js.map +1 -0
  362. package/dist/chunk-iIWxsAXd.js +59 -0
  363. package/dist/chunk-iIWxsAXd.js.map +1 -0
  364. package/dist/chunk-lItIuOIS.cjs +137 -0
  365. package/dist/chunk-lItIuOIS.cjs.map +1 -0
  366. package/dist/chunk-m6Rh4PCe.cjs +798 -0
  367. package/dist/chunk-m6Rh4PCe.cjs.map +1 -0
  368. package/dist/chunk-o3IRANDf.cjs +99 -0
  369. package/dist/chunk-o3IRANDf.cjs.map +1 -0
  370. package/dist/chunk-obUcg3Sk.d.ts +808 -0
  371. package/dist/chunk-ohsf-6Rn.js +600 -0
  372. package/dist/chunk-ohsf-6Rn.js.map +1 -0
  373. package/dist/chunk-pBleU6Nv.js +3061 -0
  374. package/dist/chunk-pBleU6Nv.js.map +1 -0
  375. package/dist/chunk-px4e99cy.js +71 -0
  376. package/dist/chunk-px4e99cy.js.map +1 -0
  377. package/dist/chunk-qwYDLeXc.cjs +99 -0
  378. package/dist/chunk-qwYDLeXc.cjs.map +1 -0
  379. package/dist/chunk-rF_859Qk.cjs +101 -0
  380. package/dist/chunk-rF_859Qk.cjs.map +1 -0
  381. package/dist/chunk-rLJkqJ5j.d.ts +1475 -0
  382. package/dist/chunk-twQItIRg.cjs +338 -0
  383. package/dist/chunk-twQItIRg.cjs.map +1 -0
  384. package/dist/chunk-vnPrMVjY.js +10 -0
  385. package/dist/chunk-vnPrMVjY.js.map +1 -0
  386. package/dist/chunk-ws3bVwaS.d.ts +410 -0
  387. package/dist/chunk-xh3UkuVs.cjs +246 -0
  388. package/dist/chunk-xh3UkuVs.cjs.map +1 -0
  389. package/dist/chunk-yMzRr26E.js +153 -0
  390. package/dist/chunk-yMzRr26E.js.map +1 -0
  391. package/dist/collab/index.cjs +802 -1254
  392. package/dist/collab/index.cjs.map +1 -1
  393. package/dist/collab/index.d.cts +518 -544
  394. package/dist/collab/index.d.ts +518 -544
  395. package/dist/collab/index.js +797 -1252
  396. package/dist/collab/index.js.map +1 -1
  397. package/dist/data/index.cjs +39 -132
  398. package/dist/data/index.d.cts +6 -468
  399. package/dist/data/index.d.ts +6 -468
  400. package/dist/data/index.js +7 -15
  401. package/dist/editor/index.cjs +2631 -4424
  402. package/dist/editor/index.cjs.map +1 -1
  403. package/dist/editor/index.d.cts +10 -59
  404. package/dist/editor/index.d.ts +10 -59
  405. package/dist/editor/index.js +2619 -4403
  406. package/dist/editor/index.js.map +1 -1
  407. package/dist/errors/index.cjs +11 -28
  408. package/dist/errors/index.d.cts +2 -125
  409. package/dist/errors/index.d.ts +2 -125
  410. package/dist/errors/index.js +1 -3
  411. package/dist/geo/index.cjs +68 -232
  412. package/dist/geo/index.d.cts +6 -821
  413. package/dist/geo/index.d.ts +6 -821
  414. package/dist/geo/index.js +11 -15
  415. package/dist/i18n/fr/index.cjs +329 -334
  416. package/dist/i18n/fr/index.cjs.map +1 -1
  417. package/dist/i18n/fr/index.d.cts +3 -10
  418. package/dist/i18n/fr/index.d.ts +3 -10
  419. package/dist/i18n/fr/index.js +324 -332
  420. package/dist/i18n/fr/index.js.map +1 -1
  421. package/dist/i18n/index.cjs +434 -447
  422. package/dist/i18n/index.cjs.map +1 -1
  423. package/dist/i18n/index.d.cts +152 -111
  424. package/dist/i18n/index.d.ts +152 -111
  425. package/dist/i18n/index.js +420 -420
  426. package/dist/i18n/index.js.map +1 -1
  427. package/dist/icons/index.cjs +37 -116
  428. package/dist/icons/index.d.cts +4 -457
  429. package/dist/icons/index.d.ts +4 -457
  430. package/dist/icons/index.js +8 -11
  431. package/dist/index.cjs +515 -1867
  432. package/dist/index.cjs.map +1 -1
  433. package/dist/index.d.cts +44 -121
  434. package/dist/index.d.ts +44 -121
  435. package/dist/index.js +52 -65
  436. package/dist/index.js.map +1 -1
  437. package/dist/layers/index.cjs +83 -318
  438. package/dist/layers/index.d.cts +3 -1555
  439. package/dist/layers/index.d.ts +3 -1555
  440. package/dist/layers/index.js +5 -17
  441. package/dist/map-client/index.cjs +5 -4
  442. package/dist/map-client/index.d.cts +6 -1856
  443. package/dist/map-client/index.d.ts +6 -1856
  444. package/dist/map-client/index.js +0 -3
  445. package/dist/maplibre-worker.mjs +4 -4
  446. package/dist/navigation/index.cjs +584 -671
  447. package/dist/navigation/index.cjs.map +1 -1
  448. package/dist/navigation/index.d.cts +191 -272
  449. package/dist/navigation/index.d.ts +191 -272
  450. package/dist/navigation/index.js +579 -669
  451. package/dist/navigation/index.js.map +1 -1
  452. package/dist/profile/index.cjs +177 -675
  453. package/dist/profile/index.d.cts +8 -2086
  454. package/dist/profile/index.d.ts +8 -2086
  455. package/dist/profile/index.js +10 -18
  456. package/dist/seams/index.cjs +15 -39
  457. package/dist/seams/index.d.cts +4 -254
  458. package/dist/seams/index.d.ts +4 -254
  459. package/dist/seams/index.js +4 -6
  460. package/dist/search/index.cjs +39 -147
  461. package/dist/search/index.d.cts +6 -888
  462. package/dist/search/index.d.ts +6 -888
  463. package/dist/search/index.js +3 -14
  464. package/dist/style/index.cjs +34 -116
  465. package/dist/style/index.d.cts +5 -538
  466. package/dist/style/index.d.ts +5 -538
  467. package/dist/style/index.js +5 -11
  468. package/dist/testing/index.cjs +432 -617
  469. package/dist/testing/index.cjs.map +1 -1
  470. package/dist/testing/index.d.cts +61 -109
  471. package/dist/testing/index.d.ts +61 -109
  472. package/dist/testing/index.js +427 -615
  473. package/dist/testing/index.js.map +1 -1
  474. package/dist/timezone/index.cjs +1946 -752
  475. package/dist/timezone/index.cjs.map +1 -1
  476. package/dist/timezone/index.d.cts +4 -29
  477. package/dist/timezone/index.d.ts +4 -29
  478. package/dist/timezone/index.js +1941 -750
  479. package/dist/timezone/index.js.map +1 -1
  480. package/dist/units/index.cjs +29 -99
  481. package/dist/units/index.d.cts +3 -75
  482. package/dist/units/index.d.ts +3 -75
  483. package/dist/units/index.js +3 -6
  484. package/dist/video/index.cjs +1684 -2169
  485. package/dist/video/index.cjs.map +1 -1
  486. package/dist/video/index.d.cts +386 -413
  487. package/dist/video/index.d.ts +386 -413
  488. package/dist/video/index.js +1678 -2162
  489. package/dist/video/index.js.map +1 -1
  490. package/dist/view/index.cjs +6 -42
  491. package/dist/view/index.d.cts +3 -836
  492. package/dist/view/index.d.ts +3 -836
  493. package/dist/view/index.js +1 -34
  494. package/package.json +12 -12
  495. package/src/auth/rules/clientHeader.ts +1 -1
  496. package/src/camera/rules/modes.ts +38 -42
  497. package/src/camera/rules/routeContent.ts +1 -0
  498. package/src/collab/index.ts +1 -5
  499. package/src/compose/engines/mountayaMap.ts +16 -42
  500. package/src/compose/rules/developmentWarnings.ts +4 -3
  501. package/src/compose/rules/fitBox.ts +67 -0
  502. package/src/compose/rules/maplibreWorkerVersion.gen.ts +1 -1
  503. package/src/compose/rules/maxBounds.ts +5 -5
  504. package/src/compose/rules/types.ts +4 -11
  505. package/src/compose/rules/workerUrl.ts +41 -6
  506. package/src/editing/rules/engine.ts +4 -2
  507. package/src/editor/engines/viewClient.ts +8 -0
  508. package/src/editor/rules/contract.ts +1 -6
  509. package/src/errors/rules/errors.ts +1 -0
  510. package/src/geo/index.ts +1 -6
  511. package/src/i18n/index.ts +1 -0
  512. package/src/i18n/rules/dates.ts +165 -0
  513. package/src/index.ts +5 -24
  514. package/src/map-client/rules/mapClient.ts +4 -2
  515. package/src/profile/rules/scale.ts +1 -5
  516. package/src/profile/rules/waypointCard.ts +8 -11
  517. package/src/search/index.ts +3 -18
  518. package/src/video/index.ts +1 -1
  519. package/src/video/profileOverlay/rules/contract.ts +1 -3
  520. package/src/video/rules/videoEncoder.ts +1 -1
  521. package/dist/accentColor-GNKBD2CW.js +0 -4
  522. package/dist/accentColor-GNKBD2CW.js.map +0 -1
  523. package/dist/accentColor-VX2JSMGE.cjs +0 -17
  524. package/dist/accentColor-VX2JSMGE.cjs.map +0 -1
  525. package/dist/chunk-23PFRRB6.js +0 -3
  526. package/dist/chunk-23PFRRB6.js.map +0 -1
  527. package/dist/chunk-2GI5SAH2.js +0 -71
  528. package/dist/chunk-2GI5SAH2.js.map +0 -1
  529. package/dist/chunk-2MQK6A74.js +0 -39
  530. package/dist/chunk-2MQK6A74.js.map +0 -1
  531. package/dist/chunk-2RE7R4LD.js +0 -73
  532. package/dist/chunk-2RE7R4LD.js.map +0 -1
  533. package/dist/chunk-3JZQKN4O.js +0 -6
  534. package/dist/chunk-3JZQKN4O.js.map +0 -1
  535. package/dist/chunk-3NDXVUUI.js +0 -50
  536. package/dist/chunk-3NDXVUUI.js.map +0 -1
  537. package/dist/chunk-3R4GFTUM.cjs +0 -59
  538. package/dist/chunk-3R4GFTUM.cjs.map +0 -1
  539. package/dist/chunk-3RVUQ6JN.cjs +0 -22
  540. package/dist/chunk-3RVUQ6JN.cjs.map +0 -1
  541. package/dist/chunk-4F6BJMJC.cjs +0 -49
  542. package/dist/chunk-4F6BJMJC.cjs.map +0 -1
  543. package/dist/chunk-4NWQD4BX.js +0 -132
  544. package/dist/chunk-4NWQD4BX.js.map +0 -1
  545. package/dist/chunk-5K2MH3R6.js +0 -10
  546. package/dist/chunk-5K2MH3R6.js.map +0 -1
  547. package/dist/chunk-6ACRNQQQ.cjs +0 -8
  548. package/dist/chunk-6ACRNQQQ.cjs.map +0 -1
  549. package/dist/chunk-6D26E3IA.js +0 -66
  550. package/dist/chunk-6D26E3IA.js.map +0 -1
  551. package/dist/chunk-6ESAW35P.cjs +0 -80
  552. package/dist/chunk-6ESAW35P.cjs.map +0 -1
  553. package/dist/chunk-6LIW2A5M.cjs +0 -1176
  554. package/dist/chunk-6LIW2A5M.cjs.map +0 -1
  555. package/dist/chunk-6OTTWVCA.js +0 -57
  556. package/dist/chunk-6OTTWVCA.js.map +0 -1
  557. package/dist/chunk-6VROJ4UG.js +0 -862
  558. package/dist/chunk-6VROJ4UG.js.map +0 -1
  559. package/dist/chunk-6Y7FTGO4.js +0 -23
  560. package/dist/chunk-6Y7FTGO4.js.map +0 -1
  561. package/dist/chunk-75I4CG64.js +0 -104
  562. package/dist/chunk-75I4CG64.js.map +0 -1
  563. package/dist/chunk-7CUBXHAH.cjs +0 -14
  564. package/dist/chunk-7CUBXHAH.cjs.map +0 -1
  565. package/dist/chunk-7GTCURVY.js +0 -52
  566. package/dist/chunk-7GTCURVY.js.map +0 -1
  567. package/dist/chunk-7IWOL6AM.cjs +0 -100
  568. package/dist/chunk-7IWOL6AM.cjs.map +0 -1
  569. package/dist/chunk-7QN7M667.cjs +0 -151
  570. package/dist/chunk-7QN7M667.cjs.map +0 -1
  571. package/dist/chunk-A6KQDKLM.cjs +0 -1197
  572. package/dist/chunk-A6KQDKLM.cjs.map +0 -1
  573. package/dist/chunk-A77EA67G.js +0 -354
  574. package/dist/chunk-A77EA67G.js.map +0 -1
  575. package/dist/chunk-AFKOABJ4.cjs +0 -7194
  576. package/dist/chunk-AFKOABJ4.cjs.map +0 -1
  577. package/dist/chunk-AG6JV5Z2.cjs +0 -183
  578. package/dist/chunk-AG6JV5Z2.cjs.map +0 -1
  579. package/dist/chunk-APBK7NMS.js +0 -30
  580. package/dist/chunk-APBK7NMS.js.map +0 -1
  581. package/dist/chunk-AWO5YA7A.cjs +0 -33
  582. package/dist/chunk-AWO5YA7A.cjs.map +0 -1
  583. package/dist/chunk-AZATU6QW.js +0 -108
  584. package/dist/chunk-AZATU6QW.js.map +0 -1
  585. package/dist/chunk-BD2U3WST.cjs +0 -623
  586. package/dist/chunk-BD2U3WST.cjs.map +0 -1
  587. package/dist/chunk-BHBEOU6L.cjs +0 -65
  588. package/dist/chunk-BHBEOU6L.cjs.map +0 -1
  589. package/dist/chunk-CNOSNYNE.js +0 -8
  590. package/dist/chunk-CNOSNYNE.js.map +0 -1
  591. package/dist/chunk-CW3EFR4O.js +0 -12
  592. package/dist/chunk-CW3EFR4O.js.map +0 -1
  593. package/dist/chunk-DASVRNBK.js +0 -7187
  594. package/dist/chunk-DASVRNBK.js.map +0 -1
  595. package/dist/chunk-DJ6LCKYP.js +0 -42
  596. package/dist/chunk-DJ6LCKYP.js.map +0 -1
  597. package/dist/chunk-E5FHQAIO.cjs +0 -45
  598. package/dist/chunk-E5FHQAIO.cjs.map +0 -1
  599. package/dist/chunk-EOML5OTY.cjs +0 -360
  600. package/dist/chunk-EOML5OTY.cjs.map +0 -1
  601. package/dist/chunk-EP5CASHL.js +0 -613
  602. package/dist/chunk-EP5CASHL.js.map +0 -1
  603. package/dist/chunk-EP5OEEVZ.cjs +0 -14
  604. package/dist/chunk-EP5OEEVZ.cjs.map +0 -1
  605. package/dist/chunk-EUXI3FGQ.js +0 -150
  606. package/dist/chunk-EUXI3FGQ.js.map +0 -1
  607. package/dist/chunk-EWFSHCOS.js +0 -40
  608. package/dist/chunk-EWFSHCOS.js.map +0 -1
  609. package/dist/chunk-EX2C5K2T.cjs +0 -25
  610. package/dist/chunk-EX2C5K2T.cjs.map +0 -1
  611. package/dist/chunk-FEXWDQIZ.cjs +0 -8
  612. package/dist/chunk-FEXWDQIZ.cjs.map +0 -1
  613. package/dist/chunk-FEYBFY7H.cjs +0 -358
  614. package/dist/chunk-FEYBFY7H.cjs.map +0 -1
  615. package/dist/chunk-FRGAV6N6.cjs +0 -34
  616. package/dist/chunk-FRGAV6N6.cjs.map +0 -1
  617. package/dist/chunk-G5DHP5VF.js +0 -6
  618. package/dist/chunk-G5DHP5VF.js.map +0 -1
  619. package/dist/chunk-G5W2UHV2.js +0 -99
  620. package/dist/chunk-G5W2UHV2.js.map +0 -1
  621. package/dist/chunk-G7OP7O2C.cjs +0 -39
  622. package/dist/chunk-G7OP7O2C.cjs.map +0 -1
  623. package/dist/chunk-GE6CFCAM.cjs +0 -25
  624. package/dist/chunk-GE6CFCAM.cjs.map +0 -1
  625. package/dist/chunk-GIFALLHI.cjs +0 -111
  626. package/dist/chunk-GIFALLHI.cjs.map +0 -1
  627. package/dist/chunk-GLFET5GM.js +0 -129
  628. package/dist/chunk-GLFET5GM.js.map +0 -1
  629. package/dist/chunk-GQ6UFPFM.js +0 -22
  630. package/dist/chunk-GQ6UFPFM.js.map +0 -1
  631. package/dist/chunk-GQJWVMXS.js +0 -129
  632. package/dist/chunk-GQJWVMXS.js.map +0 -1
  633. package/dist/chunk-GVVJPUKC.js +0 -80
  634. package/dist/chunk-GVVJPUKC.js.map +0 -1
  635. package/dist/chunk-GZ2HOCQ2.cjs +0 -134
  636. package/dist/chunk-GZ2HOCQ2.cjs.map +0 -1
  637. package/dist/chunk-HCBOHXWP.js +0 -37
  638. package/dist/chunk-HCBOHXWP.js.map +0 -1
  639. package/dist/chunk-IBQJDVHF.cjs +0 -281
  640. package/dist/chunk-IBQJDVHF.cjs.map +0 -1
  641. package/dist/chunk-ISLB6Y5Q.cjs +0 -106
  642. package/dist/chunk-ISLB6Y5Q.cjs.map +0 -1
  643. package/dist/chunk-J55CRR4F.js +0 -105
  644. package/dist/chunk-J55CRR4F.js.map +0 -1
  645. package/dist/chunk-JBG6Z6MQ.cjs +0 -28
  646. package/dist/chunk-JBG6Z6MQ.cjs.map +0 -1
  647. package/dist/chunk-K3RQOZRU.js +0 -61
  648. package/dist/chunk-K3RQOZRU.js.map +0 -1
  649. package/dist/chunk-KDJYS4GB.cjs +0 -703
  650. package/dist/chunk-KDJYS4GB.cjs.map +0 -1
  651. package/dist/chunk-KMCAHUZM.cjs +0 -4
  652. package/dist/chunk-KMCAHUZM.cjs.map +0 -1
  653. package/dist/chunk-KUCBNPC6.js +0 -87
  654. package/dist/chunk-KUCBNPC6.js.map +0 -1
  655. package/dist/chunk-KV6UE5A4.js +0 -50
  656. package/dist/chunk-KV6UE5A4.js.map +0 -1
  657. package/dist/chunk-L6TZ2HQR.cjs +0 -18
  658. package/dist/chunk-L6TZ2HQR.cjs.map +0 -1
  659. package/dist/chunk-L7QHHGG2.cjs +0 -141
  660. package/dist/chunk-L7QHHGG2.cjs.map +0 -1
  661. package/dist/chunk-LHK3Y2AL.js +0 -271
  662. package/dist/chunk-LHK3Y2AL.js.map +0 -1
  663. package/dist/chunk-LO5RYRBH.cjs +0 -6317
  664. package/dist/chunk-LO5RYRBH.cjs.map +0 -1
  665. package/dist/chunk-LS5SJMUO.cjs +0 -194
  666. package/dist/chunk-LS5SJMUO.cjs.map +0 -1
  667. package/dist/chunk-LUGTMZFN.cjs +0 -42
  668. package/dist/chunk-LUGTMZFN.cjs.map +0 -1
  669. package/dist/chunk-LVUQU6D5.js +0 -32
  670. package/dist/chunk-LVUQU6D5.js.map +0 -1
  671. package/dist/chunk-M2QRC2GZ.js +0 -166
  672. package/dist/chunk-M2QRC2GZ.js.map +0 -1
  673. package/dist/chunk-M6QJYQIM.cjs +0 -53
  674. package/dist/chunk-M6QJYQIM.cjs.map +0 -1
  675. package/dist/chunk-MGCPH5EO.js +0 -12
  676. package/dist/chunk-MGCPH5EO.js.map +0 -1
  677. package/dist/chunk-MLVUWEZR.cjs +0 -474
  678. package/dist/chunk-MLVUWEZR.cjs.map +0 -1
  679. package/dist/chunk-MTAMJMZL.cjs +0 -707
  680. package/dist/chunk-MTAMJMZL.cjs.map +0 -1
  681. package/dist/chunk-MXL5AT3N.js +0 -48
  682. package/dist/chunk-MXL5AT3N.js.map +0 -1
  683. package/dist/chunk-MYEQSESM.cjs +0 -75
  684. package/dist/chunk-MYEQSESM.cjs.map +0 -1
  685. package/dist/chunk-N3VPF6ZD.js +0 -427
  686. package/dist/chunk-N3VPF6ZD.js.map +0 -1
  687. package/dist/chunk-N6VUAIGI.js +0 -7
  688. package/dist/chunk-N6VUAIGI.js.map +0 -1
  689. package/dist/chunk-N6XRLUN6.js +0 -6286
  690. package/dist/chunk-N6XRLUN6.js.map +0 -1
  691. package/dist/chunk-NOGDOZIT.cjs +0 -114
  692. package/dist/chunk-NOGDOZIT.cjs.map +0 -1
  693. package/dist/chunk-NUWXEISH.cjs +0 -10
  694. package/dist/chunk-NUWXEISH.cjs.map +0 -1
  695. package/dist/chunk-NZCZHXYN.cjs +0 -161
  696. package/dist/chunk-NZCZHXYN.cjs.map +0 -1
  697. package/dist/chunk-ODROSWQX.cjs +0 -53
  698. package/dist/chunk-ODROSWQX.cjs.map +0 -1
  699. package/dist/chunk-OE36AYKG.cjs +0 -82
  700. package/dist/chunk-OE36AYKG.cjs.map +0 -1
  701. package/dist/chunk-OLON7MO6.cjs +0 -437
  702. package/dist/chunk-OLON7MO6.cjs.map +0 -1
  703. package/dist/chunk-PBUOR2IT.js +0 -277
  704. package/dist/chunk-PBUOR2IT.js.map +0 -1
  705. package/dist/chunk-PC2ELXFF.cjs +0 -225
  706. package/dist/chunk-PC2ELXFF.cjs.map +0 -1
  707. package/dist/chunk-PCSGXLOC.js +0 -71
  708. package/dist/chunk-PCSGXLOC.js.map +0 -1
  709. package/dist/chunk-PFNMP6FQ.js +0 -56
  710. package/dist/chunk-PFNMP6FQ.js.map +0 -1
  711. package/dist/chunk-PIWSZTIP.js +0 -690
  712. package/dist/chunk-PIWSZTIP.js.map +0 -1
  713. package/dist/chunk-PKWHJ2GI.js +0 -136
  714. package/dist/chunk-PKWHJ2GI.js.map +0 -1
  715. package/dist/chunk-PLMVBX2A.cjs +0 -76
  716. package/dist/chunk-PLMVBX2A.cjs.map +0 -1
  717. package/dist/chunk-PM3XCD2G.cjs +0 -113
  718. package/dist/chunk-PM3XCD2G.cjs.map +0 -1
  719. package/dist/chunk-QAL4GZO7.cjs +0 -143
  720. package/dist/chunk-QAL4GZO7.cjs.map +0 -1
  721. package/dist/chunk-QDB2SEA2.js +0 -74
  722. package/dist/chunk-QDB2SEA2.js.map +0 -1
  723. package/dist/chunk-QOV7UNUN.js +0 -25
  724. package/dist/chunk-QOV7UNUN.js.map +0 -1
  725. package/dist/chunk-QQUWYLSF.cjs +0 -50
  726. package/dist/chunk-QQUWYLSF.cjs.map +0 -1
  727. package/dist/chunk-QUMBH3U4.cjs +0 -9
  728. package/dist/chunk-QUMBH3U4.cjs.map +0 -1
  729. package/dist/chunk-R4KA7OFQ.js +0 -12
  730. package/dist/chunk-R4KA7OFQ.js.map +0 -1
  731. package/dist/chunk-RBSGAZQQ.js +0 -17
  732. package/dist/chunk-RBSGAZQQ.js.map +0 -1
  733. package/dist/chunk-RM5YJWZI.js +0 -46
  734. package/dist/chunk-RM5YJWZI.js.map +0 -1
  735. package/dist/chunk-ROKNKXA4.cjs +0 -8
  736. package/dist/chunk-ROKNKXA4.cjs.map +0 -1
  737. package/dist/chunk-RQG6D546.cjs +0 -75
  738. package/dist/chunk-RQG6D546.cjs.map +0 -1
  739. package/dist/chunk-SG4YDD5L.cjs +0 -74
  740. package/dist/chunk-SG4YDD5L.cjs.map +0 -1
  741. package/dist/chunk-SNRCA7EO.js +0 -56
  742. package/dist/chunk-SNRCA7EO.js.map +0 -1
  743. package/dist/chunk-SO75R4WW.cjs +0 -22
  744. package/dist/chunk-SO75R4WW.cjs.map +0 -1
  745. package/dist/chunk-SP34NHFI.js +0 -45
  746. package/dist/chunk-SP34NHFI.js.map +0 -1
  747. package/dist/chunk-SSKSSBWJ.cjs +0 -179
  748. package/dist/chunk-SSKSSBWJ.cjs.map +0 -1
  749. package/dist/chunk-TB5663C2.js +0 -1108
  750. package/dist/chunk-TB5663C2.js.map +0 -1
  751. package/dist/chunk-TGH4NRES.js +0 -220
  752. package/dist/chunk-TGH4NRES.js.map +0 -1
  753. package/dist/chunk-TJ6ZPNID.js +0 -189
  754. package/dist/chunk-TJ6ZPNID.js.map +0 -1
  755. package/dist/chunk-U45T35N2.cjs +0 -90
  756. package/dist/chunk-U45T35N2.cjs.map +0 -1
  757. package/dist/chunk-UKVOPEZ2.js +0 -442
  758. package/dist/chunk-UKVOPEZ2.js.map +0 -1
  759. package/dist/chunk-UTB4NROA.cjs +0 -887
  760. package/dist/chunk-UTB4NROA.cjs.map +0 -1
  761. package/dist/chunk-UTW33B5V.js +0 -6
  762. package/dist/chunk-UTW33B5V.js.map +0 -1
  763. package/dist/chunk-UYUBSD2V.cjs +0 -33
  764. package/dist/chunk-UYUBSD2V.cjs.map +0 -1
  765. package/dist/chunk-V3JEP5AG.cjs +0 -59
  766. package/dist/chunk-V3JEP5AG.cjs.map +0 -1
  767. package/dist/chunk-VFAGJXHR.js +0 -18
  768. package/dist/chunk-VFAGJXHR.js.map +0 -1
  769. package/dist/chunk-VMEE57E5.cjs +0 -58
  770. package/dist/chunk-VMEE57E5.cjs.map +0 -1
  771. package/dist/chunk-VQVBEX3Y.cjs +0 -113
  772. package/dist/chunk-VQVBEX3Y.cjs.map +0 -1
  773. package/dist/chunk-VZDXX7TT.cjs +0 -64
  774. package/dist/chunk-VZDXX7TT.cjs.map +0 -1
  775. package/dist/chunk-WE5ZTI4D.js +0 -346
  776. package/dist/chunk-WE5ZTI4D.js.map +0 -1
  777. package/dist/chunk-WEFUVABP.js +0 -19
  778. package/dist/chunk-WEFUVABP.js.map +0 -1
  779. package/dist/chunk-WMU4LRKC.js +0 -28
  780. package/dist/chunk-WMU4LRKC.js.map +0 -1
  781. package/dist/chunk-WQ24RRHL.cjs +0 -354
  782. package/dist/chunk-WQ24RRHL.cjs.map +0 -1
  783. package/dist/chunk-WW4CGS7G.cjs +0 -26
  784. package/dist/chunk-WW4CGS7G.cjs.map +0 -1
  785. package/dist/chunk-WXE5WCTM.js +0 -1144
  786. package/dist/chunk-WXE5WCTM.js.map +0 -1
  787. package/dist/chunk-X23BGIYA.cjs +0 -37
  788. package/dist/chunk-X23BGIYA.cjs.map +0 -1
  789. package/dist/chunk-XEW4FTR2.js +0 -98
  790. package/dist/chunk-XEW4FTR2.js.map +0 -1
  791. package/dist/chunk-XIOI4IYW.js +0 -167
  792. package/dist/chunk-XIOI4IYW.js.map +0 -1
  793. package/dist/chunk-XLVPJ37V.cjs +0 -44
  794. package/dist/chunk-XLVPJ37V.cjs.map +0 -1
  795. package/dist/chunk-XOHAXXZA.cjs +0 -51
  796. package/dist/chunk-XOHAXXZA.cjs.map +0 -1
  797. package/dist/chunk-Y4NRIHK6.cjs +0 -313
  798. package/dist/chunk-Y4NRIHK6.cjs.map +0 -1
  799. package/dist/chunk-Y4YMMKL3.js +0 -23
  800. package/dist/chunk-Y4YMMKL3.js.map +0 -1
  801. package/dist/chunk-YJNYBVE3.cjs +0 -14
  802. package/dist/chunk-YJNYBVE3.cjs.map +0 -1
  803. package/dist/chunk-Z762QNQP.cjs +0 -60
  804. package/dist/chunk-Z762QNQP.cjs.map +0 -1
  805. package/dist/chunk-ZG5KMBOF.js +0 -669
  806. package/dist/chunk-ZG5KMBOF.js.map +0 -1
  807. package/dist/chunk-ZKONQEFA.js +0 -344
  808. package/dist/chunk-ZKONQEFA.js.map +0 -1
  809. package/dist/chunk-ZR5X7QMH.js +0 -39
  810. package/dist/chunk-ZR5X7QMH.js.map +0 -1
  811. package/dist/chunk-ZW4BJQ26.js +0 -84
  812. package/dist/chunk-ZW4BJQ26.js.map +0 -1
  813. package/dist/climbs-BhlWuu0x.d.ts +0 -70
  814. package/dist/climbs-DgBFwySV.d.cts +0 -70
  815. package/dist/data/index.cjs.map +0 -1
  816. package/dist/data/index.js.map +0 -1
  817. package/dist/errors/index.cjs.map +0 -1
  818. package/dist/errors/index.js.map +0 -1
  819. package/dist/geo/index.cjs.map +0 -1
  820. package/dist/geo/index.js.map +0 -1
  821. package/dist/icons/index.cjs.map +0 -1
  822. package/dist/icons/index.js.map +0 -1
  823. package/dist/itinerary-Dp2ZnqgD.d.cts +0 -178
  824. package/dist/itinerary-Dp2ZnqgD.d.ts +0 -178
  825. package/dist/layers/index.cjs.map +0 -1
  826. package/dist/layers/index.js.map +0 -1
  827. package/dist/map-client/index.cjs.map +0 -1
  828. package/dist/map-client/index.js.map +0 -1
  829. package/dist/markerSprite-DGBQF6PO.cjs +0 -49
  830. package/dist/markerSprite-DGBQF6PO.cjs.map +0 -1
  831. package/dist/markerSprite-DZLTR6F6.js +0 -8
  832. package/dist/markerSprite-DZLTR6F6.js.map +0 -1
  833. package/dist/mountayaMap-C9mxRFib.d.cts +0 -3277
  834. package/dist/mountayaMap-DgnlQ2fE.d.ts +0 -3277
  835. package/dist/paint-BgUcj8l7.d.cts +0 -118
  836. package/dist/paint-Dx_qGNE_.d.ts +0 -118
  837. package/dist/profile/index.cjs.map +0 -1
  838. package/dist/profile/index.js.map +0 -1
  839. package/dist/seams/index.cjs.map +0 -1
  840. package/dist/seams/index.js.map +0 -1
  841. package/dist/search/index.cjs.map +0 -1
  842. package/dist/search/index.js.map +0 -1
  843. package/dist/searchHighlight-DFE7LVIL.cjs +0 -33
  844. package/dist/searchHighlight-DFE7LVIL.cjs.map +0 -1
  845. package/dist/searchHighlight-MHAQZVWG.js +0 -12
  846. package/dist/searchHighlight-MHAQZVWG.js.map +0 -1
  847. package/dist/strings-30RSdIat.d.cts +0 -552
  848. package/dist/strings-DPTIbzT5.d.ts +0 -552
  849. package/dist/stripeImage-CQUXM2YI.js +0 -14
  850. package/dist/stripeImage-CQUXM2YI.js.map +0 -1
  851. package/dist/stripeImage-R43OPA6U.cjs +0 -39
  852. package/dist/stripeImage-R43OPA6U.cjs.map +0 -1
  853. package/dist/style/index.cjs.map +0 -1
  854. package/dist/style/index.js.map +0 -1
  855. package/dist/types-B034JMjl.d.ts +0 -973
  856. package/dist/types-B2NDLxQA.d.cts +0 -21
  857. package/dist/types-B2NDLxQA.d.ts +0 -21
  858. package/dist/types-C8aX5KMU.d.cts +0 -973
  859. package/dist/units/index.cjs.map +0 -1
  860. package/dist/units/index.js.map +0 -1
  861. package/dist/view/index.cjs.map +0 -1
  862. package/dist/view/index.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * MapLibre GL JS 6.18.0: the tile worker, bundled with its shared chunk inlined.
2
+ * MapLibre GL JS 6.20.0: the tile worker, bundled with its shared chunk inlined.
3
3
  *
4
4
  * Redistributed under the BSD 3-Clause License, Copyright (c) 2023 MapLibre contributors.
5
5
  * Full text: @mountaya/elements/THIRD-PARTY-NOTICES.txt, and maplibre-gl/LICENSE.txt in the
@@ -7,6 +7,6 @@
7
7
  */
8
8
  /**
9
9
  * MapLibre GL JS
10
- * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.18.0/LICENSE.txt
11
- */var l1=Object.create,rp=Object.defineProperty,u1=Object.getOwnPropertyDescriptor,h1=Object.getOwnPropertyNames,c1=Object.getPrototypeOf,ip=Object.prototype.hasOwnProperty,wl=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),p1=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=h1(t),a=0,s=n.length,o;a<s;a++)o=n[a],!ip.call(e,o)&&o!==r&&rp(e,o,{get:(l=>t[l]).bind(null,o),enumerable:!(i=u1(t,o))||i.enumerable});return e},f1=(e,t,r)=>(r=e==null?{}:l1(c1(e)),p1(t||!e||!e.__esModule||!ip.call(e,"default")?rp(r,"default",{value:e,enumerable:!0}):r,e));function B(e,t){this.x=e,this.y=t}B.prototype={clone(){return new B(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){let t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let t=Math.cos(e),r=Math.sin(e),i=t*this.x-r*this.y,n=r*this.x+t*this.y;return this.x=i,this.y=n,this},_rotateAround(e,t){let r=Math.cos(e),i=Math.sin(e),n=t.x+r*(this.x-t.x)-i*(this.y-t.y),a=t.y+i*(this.x-t.x)+r*(this.y-t.y);return this.x=n,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:B},B.convert=function(e){if(e instanceof B)return e;if(Array.isArray(e))return new B(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new B(+e.x,+e.y);throw Error("Expected [x, y] or {x, y} point format")};function d1(e,t,r,i){let n=3*e,a=3*(r-e)-n,s=1-n-a,o=3*t,l=3*(i-t)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-h;if(Math.abs(m)<c)return((u*p+l)*p+o)*p;let g=(3*s*p+2*a)*p+n;if(Math.abs(g)<1e-6)break;p-=m/g}let f=0,d=1;p=h;for(let y=0;y<20;y++){let m=((s*p+a)*p+n)*p;if(Math.abs(m-h)<c)break;h>m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var ih;function y1(){return ih??=typeof OffscreenCanvas<"u"&&!!new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function",ih}var Nn;function m1(){if(Nn==null&&(Nn=!1,y1())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let r=0;r<25;r++){let i=r*4;e.fillStyle=`rgb(${i},${i+1},${i+2})`,e.fillRect(r%5,Math.floor(r/5),1,1)}let t=e.getImageData(0,0,5,5).data;for(let r=0;r<100;r++)if(r%4!=3&&t[r]!==r){Nn=!0;break}}}return Nn||!1}var be=8192;function fa(e){return e instanceof Error?e:Error(typeof e=="string"?e:String(e))}function g1(e){if(e<=0)return 0;if(e>=1)return 1;let t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function x1(e,t,r,i){return d1(e,t,r,i)}x1(.25,.1,.25,1);function wt(e,t,r){return Math.min(r,Math.max(t,e))}function v1(e,t,r){let i=r-t,n=((e-t)%i+i)%i+t;return n===t?r:n}function Xe(e,...t){for(let r of t)for(let i in r)e[i]=r[i];return e}function b1(e){return Math.log(e)/Math.LN2%1==0}function da(e,t,r){let i={};for(let n in e)i[n]=t.call(r||this,e[n],n,e);return i}function w1(e,t,r){let i={};for(let n in e)t.call(r||this,e[n],n,e)&&(i[n]=e[n]);return i}function eo(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!eo(e[r],t[r]))return!1;return!0}if(typeof e=="object"&&e&&t!==null){if(typeof t!="object"||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(!eo(e[r],t[r]))return!1;return!0}return e===t}function Zt(e){return Array.isArray(e)?e.map(Zt):typeof e=="object"&&e?da(e,Zt):e}var nh={};function Pe(e){nh[e]||(typeof console<"u"&&console.warn(e),nh[e]=!0)}function Wt(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function Wr(e){return typeof WorkerGlobalScope<"u"&&e!==void 0&&e instanceof WorkerGlobalScope}function _l(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap}function _1(e,t,r,i,n){let a=Math.max(-t,0)*4,s=(Math.max(0,r)-r)*i*4+a,o=i*4,l=Math.max(0,t),u=Math.max(0,r),h=Math.min(e.width,t+i),c=Math.min(e.height,r+n);return{rect:{x:l,y:u,width:h-l,height:c-u},layout:[{offset:s,stride:o}]}}async function D1(e,t,r,i,n){if(typeof VideoFrame>"u")throw Error("VideoFrame not supported");let a=new VideoFrame(e,{timestamp:0});try{let s=a?.format;if(!s||!(s.startsWith("BGR")||s.startsWith("RGB")))throw Error(`Unrecognized format ${s}`);let o=s.startsWith("BGR"),l=new Uint8ClampedArray(i*n*4);if(await a.copyTo(l,_1(e,t,r,i,n)),o)for(let u=0;u<l.length;u+=4){let h=l[u];l[u]=l[u+2],l[u+2]=h}return l}finally{a.close()}}var Di,Si;function S1(e,t,r,i,n){let a=e.width,s=e.height;Di&&Si||(Di=new OffscreenCanvas(a,s),Si=Di.getContext("2d",{willReadFrequently:!0})),Di.width=a,Di.height=s,Si.drawImage(e,0,0,a,s);let o=Si.getImageData(t,r,i,n);return Si.clearRect(0,0,a,s),o.data}async function A1(e,t,r,i,n){if(m1())try{return await D1(e,t,r,i,n)}catch{}return S1(e,t,r,i,n)}function ah(e,t,r,i){return e.addEventListener(t,r,i),{unsubscribe:()=>{e.removeEventListener(t,r,i)}}}function sh(e){return e*Math.PI/180}function oh(e,t,r){r[e]?.includes(t)||(r[e]||=[],r[e].push(t))}function Is(e,t,r){if(r?.[e]){let i=r[e].indexOf(t);i!==-1&&r[e].splice(i,1)}}var np=class{constructor(e,t={}){Xe(this,t),this.type=e}},ya=class extends np{constructor(e,t={}){super("error",Xe({error:e},t))}},E1=class{on(e,t){return this._listeners||={},oh(e,t,this._listeners),{unsubscribe:()=>{this.off(e,t)}}}off(e,t){return Is(e,t,this._listeners),Is(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners||={},oh(e,t,this._oneTimeListeners),this):new Promise(r=>this.once(e,r))}fire(e,t){let r=typeof e=="string"?new np(e,t||{}):e,i=r.type;if(this.listens(i)){r.target=this;let n=this._listeners?.[i]?.slice()??[];for(let o of n)o.call(this,r);let a=this._oneTimeListeners?.[i]?.slice()??[];for(let o of a)Is(i,o,this._oneTimeListeners),o.call(this,r);let s=this._eventedParent;s&&(Xe(r,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),s.fire(r))}else r instanceof ya&&console.error(r.error);return this}listens(e){return!!(this._listeners?.[e]?.length||this._oneTimeListeners?.[e]?.length||this._eventedParent?.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}},lh="AbortError",Dl=class extends Error{constructor(e=lh){super(e instanceof Error?e.message:e),this.name=lh,e instanceof Error&&e.stack&&(this.stack=e.stack)}};function ap(e){return e instanceof Error&&e.name==="AbortError"}function F1(e){if(e.aborted)throw new Dl(e.reason)}var to=class sp{constructor(t,r,i){let n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;let s=new Int32Array(this.arrayBuffer);t=s[0],r=s[1],i=s[2],this.d=r+2*i;for(let u=0;u<this.d*this.d;u++){let h=s[3+u],c=s[3+u+1];n.push(h===c?null:s.subarray(h,c))}let o=s[3+n.length],l=s[3+n.length+1];this.keys=s.subarray(o,l),this.bboxes=s.subarray(l),this.insert=this._insertReadonly}else{this.d=r+2*i;for(let s=0;s<this.d*this.d;s++)n.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=t,this.padding=i,this.scale=r/t,this.uid=0;let a=i/r*t;this.min=-a,this.max=t+a}insert(t,r,i,n,a){this._forEachCell(r,i,n,a,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(a)}_insertReadonly(){throw Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,r,i,n,a,s){this.cells[a].push(s)}query(t,r,i,n,a){let s=this.min,o=this.max;if(t<=s&&r<=s&&o<=i&&o<=n&&!a)return[...this.keys];{let l=[];return this._forEachCell(t,r,i,n,this._queryCell,l,{},a),l}}_queryCell(t,r,i,n,a,s,o,l){let u=this.cells[a];if(u!==null){let h=this.keys,c=this.bboxes;for(let p of u)if(o[p]===void 0){let f=p*4;(l?l(c[f+0],c[f+1],c[f+2],c[f+3]):t<=c[f+2]&&r<=c[f+3]&&i>=c[f+0]&&n>=c[f+1])?(o[p]=!0,s.push(h[p])):o[p]=!1}}}_forEachCell(t,r,i,n,a,s,o,l){let u=this._convertToCellCoord(t),h=this._convertToCellCoord(r),c=this._convertToCellCoord(i),p=this._convertToCellCoord(n);for(let f=u;f<=c;f++)for(let d=h;d<=p;d++){let y=this.d*d+f;if((!l||l(this._convertFromCellCoord(f),this._convertFromCellCoord(d),this._convertFromCellCoord(f+1),this._convertFromCellCoord(d+1)))&&a.call(this,t,r,i,n,y,s,o,l))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let t=this.cells,r=3+this.cells.length+1+1,i=0;for(let s of this.cells)i+=s.length;let n=new Int32Array(r+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let a=r;for(let s=0;s<t.length;s++){let o=t[s];n[3+s]=a,n.set(o,a),a+=o.length}return n[3+t.length]=a,n.set(this.keys,a),a+=this.keys.length,n[3+t.length+1]=a,n.set(this.bboxes,a),a+=this.bboxes.length,n.buffer}static serialize(t,r){let i=t.toArrayBuffer();return r&&r.push(i),{buffer:i}}static deserialize(t){return new sp(t.buffer)}},op={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},emptyResponse:{type:"enum",values:{blank:{},missing:{}},default:"blank"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},emptyResponse:{type:"enum",values:{blank:{},missing:{}},default:"blank"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},emptyResponse:{type:"enum",values:{blank:{},missing:{}},default:"blank"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"},"fill-extrusion-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-height-offset":{type:"number",default:0,units:"meters",requires:[{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-height-anchor":{type:"enum",values:{ground:{},absolute:{}},default:"ground",requires:["symbol-height-offset"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-layer-blend":{type:"enum",values:{normal:{},multiply:{},color:{},luminosity:{},"plus-lighter":{},screen:{},overlay:{}},default:"normal","property-type":"constant",transition:!1},"fill-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state","elevation"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"line-layer-blend":{type:"enum",values:{normal:{},multiply:{},color:{},luminosity:{},"plus-lighter":{},screen:{},overlay:{}},default:"normal","property-type":"constant",transition:!1},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-layer-blend":{type:"enum",values:{normal:{},multiply:{},color:{},luminosity:{},"plus-lighter":{},screen:{},overlay:{}},default:"normal","property-type":"constant",transition:!1},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}},_=op,I1=["type","source","source-layer","minzoom","maxzoom","filter","layout"],F=class{constructor(e,t,r,i,n="error"){this.message=(e?`${e}: `:"")+r,i&&(this.identifier=i),this.severity=n,t!=null&&t.__line__&&(this.line=t.__line__)}},bt=class extends Error{constructor(e,t){super(t),this.message=t,this.key=e}},k1=class lp{constructor(t,r=[]){this.parent=t,this.bindings={};for(let[i,n]of r)this.bindings[i]=n}concat(t){return new lp(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw Error(`${t} not found in scope.`)}has(t){return this.bindings[t]?!0:this.parent?this.parent.has(t):!1}},pn={kind:"null"},C={kind:"number"},X={kind:"string"},K={kind:"boolean"},pt={kind:"color"},Ba={kind:"projectionDefinition"},cr={kind:"object"},Z={kind:"value"},T1={kind:"error"},za={kind:"collator"},fn={kind:"formatted"},La={kind:"padding"},Xi={kind:"colorArray"},Va={kind:"numberArray"},dn={kind:"resolvedImage"},Oa={kind:"variableAnchorOffsetCollection"};function Ne(e,t){return{kind:"array",itemType:e,N:t}}function ge(e){if(e.kind==="array"){let t=ge(e.itemType);return typeof e.N=="number"?`array<${t}, ${e.N}>`:e.itemType.kind==="value"?"array":`array<${t}>`}return e.kind}var C1=[pn,C,X,K,pt,Ba,fn,cr,Ne(Z),La,Va,Xi,dn,Oa];function Zi(e,t){if(t.kind==="error")return null;if(e.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Zi(e.itemType,t.itemType))&&(typeof e.N!="number"||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind==="value"){for(let r of C1)if(!Zi(r,t))return null}}return`Expected ${ge(e)} but found ${ge(t)} instead.`}function Sl(e,t){return t.some(r=>r.kind===e.kind)}function pr(e,t){return t.some(r=>r==="null"?e===null:r==="array"?Array.isArray(e):r==="object"?e&&!Array.isArray(e)&&typeof e=="object":r===typeof e)}function jt(e,t){return e.kind==="array"&&t.kind==="array"?e.itemType.kind===t.itemType.kind&&typeof e.N=="number":e.kind===t.kind}var up=.96422,hp=.82521,cp=4/29,ro=6/29,pp=3*ro*ro,M1=Math.PI/180,P1=180/Math.PI;function fp(e){return e%=360,e<0&&(e+=360),e}function dp([e,t,r,i]){e=ks(e),t=ks(t),r=ks(r);let n,a,s=Ts((.2225045*e+.7168786*t+.0606169*r)/1);e===t&&t===r?n=a=s:(n=Ts((.4360747*e+.3850649*t+.1430804*r)/up),a=Ts((.0139322*e+.0971045*t+.7141733*r)/hp));let o=116*s-16;return[o<0?0:o,500*(n-s),200*(s-a),i]}function ks(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Ts(e){return e>.008856451679035631?e**(1/3):e/pp+cp}function yp([e,t,r,i]){let n=(e+16)/116,a=isNaN(t)?n:n+t/500,s=isNaN(r)?n:n-r/200;return n=1*Ms(n),a=up*Ms(a),s=hp*Ms(s),[Cs(3.1338561*a-1.6168667*n-.4906146*s),Cs(-.9787684*a+1.9161415*n+.033454*s),Cs(.0719453*a-.2289914*n+1.4052427*s),i]}function Cs(e){return e=e<=.00304?12.92*e:1.055*e**(1/2.4)-.055,e<0?0:e>1?1:e}function Ms(e){return e>ro?e*e*e:pp*(e-cp)}function B1(e){let[t,r,i,n]=dp(e),a=Math.sqrt(r*r+i*i);return[Math.round(a*1e4)?fp(Math.atan2(i,r)*P1):NaN,a,t,n]}function z1([e,t,r,i]){return e=isNaN(e)?0:e*M1,yp([r,Math.cos(e)*t,Math.sin(e)*t,i])}function L1([e,t,r,i]){e=fp(e),t/=100,r/=100;function n(a){let s=(a+e/30)%12,o=t*Math.min(r,1-r);return r-o*Math.max(-1,Math.min(s-3,9-s,1))}return[n(0),n(8),n(4),i]}var V1=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function $i(e,t){return V1(e,t)?e[t]:void 0}function O1(e){if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t=$i(R1,e);if(t){let[i,n,a]=t;return[i/255,n/255,a/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let i=e.length<6?1:2,n=1;return[Un(e.slice(n,n+=i)),Un(e.slice(n,n+=i)),Un(e.slice(n,n+=i)),Un(e.slice(n,n+i)||"ff")]}if(e.startsWith("rgb")){let i=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){let[n,a,s,o,l,u,h,c,p,f,d,y]=i,m=[o||" ",h||" ",f].join("");if(m===" "||m===" /"||m===",,"||m===",,,"){let g=[s,u,p].join(""),x=g==="%%%"?100:g===""?255:0;if(x){let v=[Br(+a/x,0,1),Br(+l/x,0,1),Br(+c/x,0,1),d?uh(+d,y):1];if(hh(v))return v}}return}}let r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[i,n,a,s,o,l,u,h,c]=r,p=[a||" ",o||" ",u].join("");if(p===" "||p===" /"||p===",,"||p===",,,"){let f=[+n,Br(+s,0,100),Br(+l,0,100),h?uh(+h,c):1];if(hh(f))return L1(f)}}}function Un(e){return parseInt(e.padEnd(2,e),16)/255}function uh(e,t){return Br(t?e/100:e,0,1)}function Br(e,t,r){return Math.min(Math.max(t,e),r)}function hh(e){return!e.some(Number.isNaN)}var R1={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Ht(e,t,r){return e+r*(t-e)}function Hr(e,t,r){return e.map((i,n)=>Ht(i,t[n],r))}function $1(e){return e==="rgb"||e==="hcl"||e==="lab"}var xe=class vt{constructor(t,r,i,n=1,a=!0){this.r=t,this.g=r,this.b=i,this.a=n,a||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[t,r,i,n]))}static{this.black=new vt(0,0,0,1)}static{this.white=new vt(1,1,1,1)}static{this.transparent=new vt(0,0,0,0)}static{this.red=new vt(1,0,0,1)}static parse(t){if(t instanceof vt)return t;if(typeof t!="string")return;let r=O1(t);if(r)return new vt(...r,!1)}get rgb(){let{r:t,g:r,b:i,a:n}=this,a=n||1/0;return this.overwriteGetter("rgb",[t/a,r/a,i/a,n])}get hcl(){return this.overwriteGetter("hcl",B1(this.rgb))}get lab(){return this.overwriteGetter("lab",dp(this.rgb))}overwriteGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}toString(){let[t,r,i,n]=this.rgb;return`rgba(${[t,r,i].map(a=>Math.round(a*255)).join(",")},${n})`}static interpolate(t,r,i,n="rgb"){switch(n){case"rgb":{let[a,s,o,l]=Hr(t.rgb,r.rgb,i);return new vt(a,s,o,l,!1)}case"hcl":{let[a,s,o,l]=t.hcl,[u,h,c,p]=r.hcl,f,d;if(!isNaN(a)&&!isNaN(u)){let v=u-a;u>a&&v>180?v-=360:u<a&&a-u>180&&(v+=360),f=a+i*v}else isNaN(a)?isNaN(u)?f=NaN:(f=u,(o===1||o===0)&&(d=h)):(f=a,(c===1||c===0)&&(d=s));let[y,m,g,x]=z1([f,d??Ht(s,h,i),Ht(o,c,i),Ht(l,p,i)]);return new vt(y,m,g,x,!1)}case"lab":{let[a,s,o,l]=yp(Hr(t.lab,r.lab,i));return new vt(a,s,o,l,!1)}}}},Al=class{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}},N1=["bottom","center","top"],io=class{constructor(e,t,r,i,n,a){this.text=e,this.image=t,this.scale=r,this.fontStack=i,this.textColor=n,this.verticalAlign=a}},zt=class aa{constructor(t){this.sections=t}static fromString(t){return new aa([new io(t,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof aa?t:aa.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}},Et=class Mi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Mi)return t;if(typeof t=="number")return new Mi([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let r of t)if(typeof r!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new Mi(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i){return new Mi(Hr(t.values,r.values,i))}},Ft=class Pi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Pi)return t;if(typeof t=="number")return new Pi([t]);if(Array.isArray(t)){for(let r of t)if(typeof r!="number")return;return new Pi(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i){return new Pi(Hr(t.values,r.values,i))}},ot=class Bi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Bi)return t;if(typeof t=="string"){let i=xe.parse(t);return i?new Bi([i]):void 0}if(!Array.isArray(t))return;let r=[];for(let i of t){if(typeof i!="string")return;let n=xe.parse(i);if(!n)return;r.push(n)}return new Bi(r)}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i,n="rgb"){let a=[];if(t.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let s=0;s<t.values.length;s++)a.push(xe.interpolate(t.values[s],r.values[s],i,n));return new Bi(a)}},fe=class extends Error{constructor(e,t){super(e),this.name="RuntimeError",this.path=t}toJSON(){return this.message}},U1=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),St=class sa{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof sa)return t;if(!(!Array.isArray(t)||t.length<1||t.length%2!=0)){for(let r=0;r<t.length;r+=2){let i=t[r],n=t[r+1];if(typeof i!="string"||!U1.has(i)||!Array.isArray(n)||n.length!==2||typeof n[0]!="number"||typeof n[1]!="number")return}return new sa(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i,n){let a=t.values,s=r.values;if(a.length!==s.length)throw new fe(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${r.toString()}`,n);let o=[];for(let l=0;l<a.length;l+=2){if(a[l]!==s[l])throw new fe(`Cannot interpolate values containing mismatched anchors. from[${l}]: ${a[l]}, to[${l}]: ${s[l]}`,n);o.push(a[l]);let[u,h]=a[l+1],[c,p]=s[l+1];o.push([Ht(u,c,i),Ht(h,p,i)])}return new sa(o)}},At=class mp{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new mp({name:t,available:!1}):null}},xr=class zr{constructor(t,r,i){this.from=t,this.to=r,this.transition=i}toString(){return this.from===this.to&&this.transition===1?this.from:JSON.stringify([this.from,this.to,this.transition])}static interpolate(t,r,i){return new zr(t,r,i)}static parse(t){if(t instanceof zr)return t;if(Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number")return new zr(t[0],t[1],t[2]);if(typeof t=="object"&&typeof t.from=="string"&&typeof t.to=="string"&&typeof t.transition=="number")return new zr(t.from,t.to,t.transition);if(typeof t=="string")return new zr(t,t,1)}};function gp(e,t,r,i){return typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?i===void 0||typeof i=="number"&&i>=0&&i<=1?null:`Invalid rgba value [${[e,t,r,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof i=="number"?[e,t,r,i]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Jr(e){if(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||e instanceof xr||e instanceof xe||e instanceof Al||e instanceof zt||e instanceof Et||e instanceof Ft||e instanceof ot||e instanceof St||e instanceof At)return!0;if(Array.isArray(e)){for(let t of e)if(!Jr(t))return!1;return!0}if(typeof e=="object"){for(let t in e)if(!Jr(e[t]))return!1;return!0}return!1}function Ae(e){if(e===null)return pn;if(typeof e=="string")return X;if(typeof e=="boolean")return K;if(typeof e=="number")return C;if(e instanceof xe)return pt;if(e instanceof xr)return Ba;if(e instanceof Al)return za;if(e instanceof zt)return fn;if(e instanceof Et)return La;if(e instanceof Ft)return Va;if(e instanceof ot)return Xi;if(e instanceof St)return Oa;if(e instanceof At)return dn;if(Array.isArray(e)){let t=e.length,r;for(let i of e){let n=Ae(i);if(!r)r=n;else{if(r===n)continue;r=Z;break}}return Ne(r||Z,t)}return cr}function Ni(e){let t=typeof e;return e===null?"":t==="string"||t==="number"||t==="boolean"?String(e):e instanceof xe||e instanceof xr||e instanceof zt||e instanceof Et||e instanceof Ft||e instanceof ot||e instanceof St||e instanceof At?e.toString():JSON.stringify(e)}var Kr=class xp{constructor(t,r){this.type=t,this.value=r}static parse(t,r){if(t.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Jr(t[1]))return r.error(`invalid value of type "${typeof t[1]}"`);let i=t[1],n=Ae(i),a=r.expectedType;return n.kind==="array"&&n.N===0&&a&&a.kind==="array"&&(typeof a.N!="number"||a.N===0)&&(n=a),new xp(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},jn={string:X,number:C,boolean:K,object:cr},Ct=class vp{constructor(t,r,i){this.type=t,this.args=r,this.key=i}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=1,n,a=t[0];if(a==="array"){let o;if(t.length>2){let u=t[1];if(typeof u!="string"||!(u in jn)||u==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);o=jn[u],i++}else o=Z;let l;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);l=t[2],i++}n=Ne(o,l)}else{if(!jn[a])throw Error(`Types doesn't contain name = ${a}`);n=jn[a]}let s=[];for(;i<t.length;i++){let o=r.parse(t[i],i,Z);if(!o)return null;s.push(o)}return new vp(n,s,r.key)}evaluate(t){for(let r=0;r<this.args.length;r++){let i=this.args[r].evaluate(t);if(!Zi(this.type,Ae(i)))return i;if(r===this.args.length-1)throw new fe(`Expected value to be of type ${ge(this.type)}, but found ${ge(Ae(i))} instead.`,this.key)}throw Error()}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}},ch={"to-boolean":K,"to-color":pt,"to-number":C,"to-string":X},$r=class bp{constructor(t,r,i){this.type=t,this.args=r,this.key=i}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=t[0];if(!ch[i])throw Error(`Can't parse ${i} as it is not part of the known types`);if((i==="to-boolean"||i==="to-string")&&t.length!==2)return r.error("Expected one argument.");let n=ch[i],a=[];for(let s=1;s<t.length;s++){let o=r.parse(t[s],s,Z);if(!o)return null;a.push(o)}return new bp(n,a,r.key)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let r,i;for(let n of this.args){if(r=n.evaluate(t),i=null,r instanceof xe)return r;if(typeof r=="string"){let a=t.parseColor(r);if(a)return a}else if(Array.isArray(r)&&(i=r.length<3||r.length>4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:gp(r[0],r[1],r[2],r[3]),!i))return new xe(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new fe(i||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"padding":{let r;for(let i of this.args){r=i.evaluate(t);let n=Et.parse(r);if(n)return n}throw new fe(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"numberArray":{let r;for(let i of this.args){r=i.evaluate(t);let n=Ft.parse(r);if(n)return n}throw new fe(`Could not parse numberArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"colorArray":{let r;for(let i of this.args){r=i.evaluate(t);let n=ot.parse(r);if(n)return n}throw new fe(`Could not parse colorArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"variableAnchorOffsetCollection":{let r;for(let i of this.args){r=i.evaluate(t);let n=St.parse(r);if(n)return n}throw new fe(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"number":{let r=null;for(let i of this.args){if(r=i.evaluate(t),r===null)return 0;let n=Number(r);if(!isNaN(n))return n}throw new fe(`Could not convert ${JSON.stringify(r)} to number.`,this.key)}case"formatted":return zt.fromString(Ni(this.args[0].evaluate(t)));case"resolvedImage":return At.fromString(Ni(this.args[0].evaluate(t)));case"projectionDefinition":{let r=this.args[0].evaluate(t);if(xr.parse(r))return r;throw new fe(`Could not parse projectionDefinition from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}default:return Ni(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}},j1=["Unknown","Point","LineString","Polygon"],wp=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?j1[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=xe.parse(e),this._parseColorCache.set(e,t)),t}},_p=class Dp{constructor(t,r,i=[],n,a=new k1,s=[]){this.registry=t,this.path=i,this.key=i.map(o=>`[${o}]`).join(""),this.scope=a,this.errors=s,this.expectedType=n,this._isConstant=r}parse(t,r,i,n,a={}){return r==null?this._parse(t,a):this.concat(r,i,n)._parse(t,a)}_parse(t,r){(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number")&&(t=["literal",t]);let i=this.key;function n(a,s,o){return o==="assert"?new Ct(s,[a],i):o==="coerce"?new $r(s,[a],i):a}if(Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let a=t[0];if(typeof a!="string")return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let s=this.registry[a];if(s){let o=s.parse(t,this);if(!o)return null;if(this.expectedType){let l=this.expectedType,u=o.type;if((l.kind==="string"||l.kind==="number"||l.kind==="boolean"||l.kind==="object"||l.kind==="array")&&u.kind==="value")o=n(o,l,r.typeAnnotation||"assert");else if(l.kind==="projectionDefinition"&&["string","array","value"].includes(u.kind)||["color","formatted","resolvedImage"].includes(l.kind)&&["value","string"].includes(u.kind)||["padding","numberArray"].includes(l.kind)&&["value","number","array"].includes(u.kind)||l.kind==="colorArray"&&["value","string","array"].includes(u.kind)||l.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(u.kind))o=n(o,l,r.typeAnnotation||"coerce");else if(this.checkSubtype(l,u))return null}if(!(o instanceof Kr)&&o.type.kind!=="resolvedImage"&&this._isConstant(o)){let l=new wp;try{o=new Kr(o.type,o.evaluate(l))}catch(u){return this.error(u.message),null}}return o}return this.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0)}return t===void 0?this.error("'undefined' value invalid. Use null instead."):typeof t=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof t} instead.`)}concat(t,r,i){let n=typeof t=="number"?this.path.concat(t):this.path,a=i?this.scope.concat(i):this.scope;return new Dp(this.registry,this._isConstant,n,r||null,a,this.errors)}error(t,...r){let i=`${this.key}${r.map(n=>`[${n}]`).join("")}`;this.errors.push(new bt(i,t))}checkSubtype(t,r){let i=Zi(t,r);return i&&this.error(i),i}},Sp=class Ap{constructor(t,r){this.type=r.type,this.bindings=[].concat(t),this.result=r}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(let r of this.bindings)t(r[1]);t(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let i=[];for(let a=1;a<t.length-1;a+=2){let s=t[a];if(typeof s!="string")return r.error(`Expected string, but found ${typeof s} instead.`,a);if(/[^a-zA-Z0-9_]/.test(s))return r.error("Variable names must contain only alphanumeric characters or '_'.",a);let o=r.parse(t[a+1],a+1);if(!o)return null;i.push([s,o])}let n=r.parse(t[t.length-1],t.length-1,r.expectedType,i);return n?new Ap(i,n):null}outputDefined(){return this.result.outputDefined()}},Ep=class Fp{constructor(t,r){this.type=r.type,this.name=t,this.boundExpression=r}static parse(t,r){if(t.length!==2||typeof t[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");let i=t[1];return r.scope.has(i)?new Fp(i,r.scope.get(i)):r.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}},q1=class Ip{constructor(t,r,i,n){this.type=t,this.index=r,this.input=i,this.key=n}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,C),n=r.parse(t[2],2,Ne(r.expectedType||Z));if(!i||!n)return null;let a=n.type;return new Ip(a.itemType,i,n,r.key)}evaluate(t){let r=this.index.evaluate(t),i=this.input.evaluate(t);if(r<0)throw new fe(`Array index out of bounds: ${r} < 0.`,this.key);if(r>=i.length)throw new fe(`Array index out of bounds: ${r} > ${i.length-1}.`,this.key);if(r!==Math.floor(r))throw new fe(`Array index must be an integer, but found ${r} instead.`,this.key);return i[r]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}},G1=class kp{constructor(t,r,i){this.needle=t,this.haystack=r,this.key=i,this.type=K}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,Z),n=r.parse(t[2],2,Z);return!i||!n?null:Sl(i.type,[K,X,C,pn,Z])?new kp(i,n,r.key):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${ge(i.type)} instead`)}evaluate(t){let r=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!pr(r,["boolean","string","number","null"]))throw new fe(`Expected first argument to be of type boolean, string, number or null, but found ${ge(Ae(r))} instead.`,this.key);if(!pr(i,["string","array"]))throw new fe(`Expected second argument to be of type array or string, but found ${ge(Ae(i))} instead.`,this.key);return i.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}},Y1=class no{constructor(t,r,i,n){this.needle=t,this.haystack=r,this.key=i,this.fromIndex=n,this.type=C}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,Z),n=r.parse(t[2],2,Z);if(!i||!n)return null;if(!Sl(i.type,[K,X,C,pn,Z]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${ge(i.type)} instead`);if(t.length===4){let a=r.parse(t[3],3,C);return a?new no(i,n,r.key,a):null}return new no(i,n,r.key)}evaluate(t){let r=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!pr(r,["boolean","string","number","null"]))throw new fe(`Expected first argument to be of type boolean, string, number or null, but found ${ge(Ae(r))} instead.`,this.key);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(t)),pr(i,["string"])){let a=i.indexOf(r,n);return a===-1?-1:[...i.slice(0,a)].length}if(pr(i,["array"]))return i.indexOf(r,n);throw new fe(`Expected second argument to be of type array or string, but found ${ge(Ae(i))} instead.`,this.key)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}},X1=class Tp{constructor(t,r,i,n,a,s){this.inputType=t,this.type=r,this.input=i,this.cases=n,this.outputs=a,this.otherwise=s}static parse(t,r){if(t.length<5)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return r.error("Expected an even number of arguments.");let i,n;r.expectedType&&r.expectedType.kind!=="value"&&(n=r.expectedType);let a={},s=[];for(let u=2;u<t.length-1;u+=2){let h=t[u],c=t[u+1];Array.isArray(h)||(h=[h]);let p=r.concat(u);if(h.length===0)return p.error("Expected at least one branch label.");for(let d of h){if(typeof d!="number"&&typeof d!="string")return p.error("Branch labels must be numbers or strings.");if(typeof d=="number"&&Math.abs(d)>2**53-1)return p.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof d=="number"&&Math.floor(d)!==d)return p.error("Numeric branch labels must be integer values.");if(!i)i=Ae(d);else if(p.checkSubtype(i,Ae(d)))return null;if(a[String(d)]!==void 0)return p.error("Branch labels must be unique.");a[String(d)]=s.length}let f=r.parse(c,u,n);if(!f)return null;n||=f.type,s.push(f)}let o=r.parse(t[1],1,Z);if(!o)return null;let l=r.parse(t[t.length-1],t.length-1,n);return!l||o.type.kind!=="value"&&r.concat(1).checkSubtype(i,o.type)?null:new Tp(i,n,o,a,s,l)}evaluate(t){let r=this.input.evaluate(t);return(Ae(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}},Z1=class Cp{constructor(t,r,i){this.type=t,this.branches=r,this.otherwise=i}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return r.error("Expected an odd number of arguments.");let i;r.expectedType&&r.expectedType.kind!=="value"&&(i=r.expectedType);let n=[];for(let s=1;s<t.length-1;s+=2){let o=r.parse(t[s],s,K);if(!o)return null;let l=r.parse(t[s+1],s+1,i);if(!l)return null;n.push([o,l]),i||=l.type}let a=r.parse(t[t.length-1],t.length-1,i);if(!a)return null;if(!i)throw Error("Can't infer output type");return new Cp(i,n,a)}evaluate(t){for(let[r,i]of this.branches)if(r.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(let[r,i]of this.branches)t(r),t(i);t(this.otherwise)}outputDefined(){return this.branches.every(([t,r])=>r.outputDefined())&&this.otherwise.outputDefined()}},W1=class ao{constructor(t,r,i,n,a){this.type=t,this.input=r,this.beginIndex=i,this.key=n,this.endIndex=a}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,Z),n=r.parse(t[2],2,C);if(!i||!n)return null;if(!Sl(i.type,[Ne(Z),X,Z]))return r.error(`Expected first argument to be of type array or string, but found ${ge(i.type)} instead`);if(t.length===4){let a=r.parse(t[3],3,C);return a?new ao(i.type,i,n,r.key,a):null}return new ao(i.type,i,n,r.key)}evaluate(t){let r=this.input.evaluate(t),i=this.beginIndex.evaluate(t),n;if(this.endIndex&&(n=this.endIndex.evaluate(t)),pr(r,["string"]))return[...r].slice(i,n).join("");if(pr(r,["array"]))return r.slice(i,n);throw new fe(`Expected first argument to be of type array or string, but found ${ge(Ae(r))} instead.`,this.key)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}};function Ra(e,t,r){let i=e.length-1,n=0,a=i,s=0,o,l;for(;n<=a;)if(s=Math.floor((n+a)/2),o=e[s],l=e[s+1],o<=t){if(s===i||t<l)return s;n=s+1}else if(o>t)a=s-1;else throw new fe("Input is not a number.",r);return 0}var El=class Mp{constructor(t,r,i,n){this.type=t,this.input=r,this.key=n,this.labels=[],this.outputs=[];for(let[a,s]of i)this.labels.push(a),this.outputs.push(s)}static parse(t,r){if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");let i=r.parse(t[1],1,C);if(!i)return null;let n=[],a=null;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);for(let s=1;s<t.length;s+=2){let o=s===1?-1/0:t[s],l=t[s+1],u=s,h=s+1;if(typeof o!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(n.length&&n[n.length-1][0]>=o)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);let c=r.parse(l,h,a);if(!c)return null;a||=c.type,n.push([o,c])}return new Mp(a,i,n,r.key)}evaluate(t){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(t);let n=this.input.evaluate(t);if(n<=r[0])return i[0].evaluate(t);let a=r.length;return n>=r[a-1]?i[a-1].evaluate(t):i[Ra(r,n,this.key)].evaluate(t)}eachChild(t){t(this.input);for(let r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}};function H1(e,t,r,i){let n=3*e,a=3*(r-e)-n,s=1-n-a,o=3*t,l=3*(i-t)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-h;if(Math.abs(m)<c)return((u*p+l)*p+o)*p;let g=(3*s*p+2*a)*p+n;if(Math.abs(g)<1e-6)break;p-=m/g}let f=0,d=1;p=h;for(let y=0;y<20;y++){let m=((s*p+a)*p+n)*p;if(Math.abs(m-h)<c)break;h>m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var _t=class so{constructor(t,r,i,n,a,s){this.type=t,this.operator=r,this.interpolation=i,this.input=n,this.key=s,this.labels=[],this.outputs=[];for(let[o,l]of a)this.labels.push(o),this.outputs.push(l)}static interpolationFactor(t,r,i,n){let a=0;if(t.name==="exponential")a=Ps(r,t.base,i,n);else if(t.name==="linear")a=Ps(r,1,i,n);else if(t.name==="cubic-bezier"){let s=t.controlPoints;a=H1(s[0],s[1],s[2],s[3])(Ps(r,1,i,n))}return a}static parse(t,r){let[i,n,a,...s]=t;if(!Array.isArray(n)||n.length===0)return r.error("Expected an interpolation type expression.",1);if(n[0]==="linear")n={name:"linear"};else if(n[0]==="exponential"){let u=n[1];if(typeof u!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:u}}else if(n[0]==="cubic-bezier"){let u=n.slice(1);if(u.length!==4||u.some(h=>typeof h!="number"||h<0||h>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:u}}else return r.error(`Unknown interpolation type ${String(n[0])}`,1,0);if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(a=r.parse(a,2,C),!a)return null;let o=[],l=null;(i==="interpolate-hcl"||i==="interpolate-lab")&&r.expectedType!=Xi?l=pt:r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);for(let u=0;u<s.length;u+=2){let h=s[u],c=s[u+1],p=u+3,f=u+4;if(typeof h!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(o.length&&o[o.length-1][0]>=h)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);let d=r.parse(c,f,l);if(!d)return null;l||=d.type,o.push([h,d])}return!jt(l,C)&&!jt(l,Ba)&&!jt(l,pt)&&!jt(l,La)&&!jt(l,Va)&&!jt(l,Xi)&&!jt(l,Oa)&&!jt(l,Ne(C))?r.error(`Type ${ge(l)} is not interpolatable.`):new so(l,i,n,a,o,r.key)}evaluate(t){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(t);let n=this.input.evaluate(t);if(n<=r[0])return i[0].evaluate(t);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(t);let s=Ra(r,n,this.key),o=r[s],l=r[s+1],u=so.interpolationFactor(this.interpolation,n,o,l),h=i[s].evaluate(t),c=i[s+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Ht(h,c,u);case"color":return xe.interpolate(h,c,u);case"padding":return Et.interpolate(h,c,u);case"colorArray":return ot.interpolate(h,c,u);case"numberArray":return Ft.interpolate(h,c,u);case"variableAnchorOffsetCollection":return St.interpolate(h,c,u,this.key);case"array":return Hr(h,c,u);case"projectionDefinition":return xr.interpolate(h,c,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return xe.interpolate(h,c,u,"hcl");case"colorArray":return ot.interpolate(h,c,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return xe.interpolate(h,c,u,"lab");case"colorArray":return ot.interpolate(h,c,u,"lab")}}}eachChild(t){t(this.input);for(let r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}};function Ps(e,t,r,i){let n=i-r,a=e-r;return n===0?0:t===1?a/n:(t**+a-1)/(t**+n-1)}var fr={color:xe.interpolate,number:Ht,padding:Et.interpolate,numberArray:Ft.interpolate,colorArray:ot.interpolate,variableAnchorOffsetCollection:St.interpolate,array:Hr},Pp=class oo{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=null,n=r.expectedType;n&&n.kind!=="value"&&(i=n);let a=[];for(let s of t.slice(1)){let o=r.parse(s,1+a.length,i,void 0,{typeAnnotation:"omit"});if(!o)return null;i||=o.type,a.push(o)}if(!i)throw Error("No output type");return n&&a.some(s=>Zi(n,s.type))?new oo(Z,a):new oo(i,a)}evaluate(t){let r=null,i=0,n;for(let a of this.args)if(i++,r=a.evaluate(t),r&&r instanceof At&&!r.available&&(n||=r.name,r=null,i===this.args.length&&(r=n)),r!==null)break;return r}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}};function ph(e,t){return e==="=="||e==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function J1(e,t,r){return t===r}function K1(e,t,r){return t!==r}function Q1(e,t,r){return t<r}function em(e,t,r){return t>r}function tm(e,t,r){return t<=r}function rm(e,t,r){return t>=r}function Bp(e,t,r,i){return i.compare(t,r)===0}function im(e,t,r,i){return!Bp(e,t,r,i)}function nm(e,t,r,i){return i.compare(t,r)<0}function am(e,t,r,i){return i.compare(t,r)>0}function sm(e,t,r,i){return i.compare(t,r)<=0}function om(e,t,r,i){return i.compare(t,r)>=0}function si(e,t,r){let i=e!=="=="&&e!=="!=";return class zp{constructor(a,s,o,l){this.lhs=a,this.rhs=s,this.key=o,this.collator=l,this.type=K,this.hasUntypedArgument=a.type.kind==="value"||s.type.kind==="value"}static parse(a,s){if(a.length!==3&&a.length!==4)return s.error("Expected two or three arguments.");let o=a[0],l=s.parse(a[1],1,Z);if(!l)return null;if(!ph(o,l.type))return s.concat(1).error(`"${o}" comparisons are not supported for type '${ge(l.type)}'.`);let u=s.parse(a[2],2,Z);if(!u)return null;if(!ph(o,u.type))return s.concat(2).error(`"${o}" comparisons are not supported for type '${ge(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error(`Cannot compare types '${ge(l.type)}' and '${ge(u.type)}'.`);i&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new Ct(u.type,[l],s.key):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new Ct(l.type,[u],s.key)));let h=null;if(a.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error("Cannot use collator to compare non-string types.");if(h=s.parse(a[3],3,za),!h)return null}return new zp(l,u,s.key,h)}evaluate(a){let s=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(i&&this.hasUntypedArgument){let l=Ae(s),u=Ae(o);if(l.kind!==u.kind||l.kind!=="string"&&l.kind!=="number")throw new fe(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let l=Ae(s),u=Ae(o);if(l.kind!=="string"||u.kind!=="string")return t(a,s,o)}return this.collator?r(a,s,o,this.collator.evaluate(a)):t(a,s,o)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}}}var lm=si("==",J1,Bp),um=si("!=",K1,im),hm=si("<",Q1,nm),cm=si(">",em,am),pm=si("<=",tm,sm),fm=si(">=",rm,om),Lp=class Vp{constructor(t,r,i){this.type=za,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=r}static parse(t,r){if(t.length!==2)return r.error("Expected one argument.");let i=t[1];if(typeof i!="object"||Array.isArray(i))return r.error("Collator options argument must be an object.");let n=r.parse(i["case-sensitive"]!==void 0&&i["case-sensitive"],1,K);if(!n)return null;let a=r.parse(i["diacritic-sensitive"]!==void 0&&i["diacritic-sensitive"],1,K);if(!a)return null;let s=null;return i.locale&&(s=r.parse(i.locale,1,X),!s)?null:new Vp(n,a,s)}evaluate(t){return new Al(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}},dm=class Op{constructor(t,r,i,n,a,s){this.type=X,this.number=t,this.locale=r,this.currency=i,this.unit=n,this.minFractionDigits=a,this.maxFractionDigits=s}static parse(t,r){if(t.length!==3)return r.error("Expected two arguments.");let i=r.parse(t[1],1,C);if(!i)return null;let n=t[2];if(typeof n!="object"||Array.isArray(n))return r.error("NumberFormat options argument must be an object.");let a=null;if(n.locale&&(a=r.parse(n.locale,1,X),!a))return null;let s=null;if(n.currency&&(s=r.parse(n.currency,1,X),!s))return null;let o=null;if(n.unit&&(o=r.parse(n.unit,1,X),!o))return null;if(s&&o)return r.error("NumberFormat options `currency` and `unit` are mutually exclusive");let l=null;if(n["min-fraction-digits"]&&(l=r.parse(n["min-fraction-digits"],1,C),!l))return null;let u=null;return n["max-fraction-digits"]&&(u=r.parse(n["max-fraction-digits"],1,C),!u)?null:new Op(i,a,s,o,l,u)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}},Rp=class $p{constructor(t){this.type=fn,this.sections=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=t[1];if(!Array.isArray(i)&&typeof i=="object")return r.error("First argument must be an image or text section.");let n=[],a=!1;for(let s=1;s<=t.length-1;++s){let o=t[s];if(a&&typeof o=="object"&&!Array.isArray(o)){a=!1;let l=null;if(o["font-scale"]&&(l=r.parse(o["font-scale"],1,C),!l))return null;let u=null;if(o["text-font"]&&(u=r.parse(o["text-font"],1,Ne(X)),!u))return null;let h=null;if(o["text-color"]&&(h=r.parse(o["text-color"],1,pt),!h))return null;let c=null;if(o["vertical-align"]){if(typeof o["vertical-align"]=="string"&&!N1.includes(o["vertical-align"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${o["vertical-align"]}' instead.`);if(c=r.parse(o["vertical-align"],1,X),!c)return null}let p=n[n.length-1];p.scale=l,p.font=u,p.textColor=h,p.verticalAlign=c}else{let l=r.parse(t[s],1,Z);if(!l)return null;let u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new $p(n)}evaluate(t){return new zt(this.sections.map(r=>{let i=r.content.evaluate(t);return Ae(i)===dn?new io("",i,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(t):null):new io(Ni(i),null,r.scale?r.scale.evaluate(t):null,r.font?r.font.evaluate(t).join(","):null,r.textColor?r.textColor.evaluate(t):null,r.verticalAlign?r.verticalAlign.evaluate(t):null)}))}eachChild(t){for(let r of this.sections)t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor),r.verticalAlign&&t(r.verticalAlign)}outputDefined(){return!1}},ym=class Np{constructor(t){this.type=dn,this.input=t}static parse(t,r){if(t.length!==2)return r.error("Expected two arguments.");let i=r.parse(t[1],1,X);return i?new Np(i):r.error("No image name provided.")}evaluate(t){let r=this.input.evaluate(t),i=At.fromString(r);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(r)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}},mm=class Up{constructor(t,r){this.input=t,this.key=r,this.type=C}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let i=r.parse(t[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${ge(i.type)} instead.`):new Up(i,r.key):null}evaluate(t){let r=this.input.evaluate(t);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new fe(`Expected value to be of type string or array, but found ${ge(Ae(r))} instead.`,this.key)}eachChild(t){t(this.input)}outputDefined(){return!1}},Dt=8192;function gm(e,t){let r=xm(e[0]),i=bm(e[1]),n=2**t.z;return[Math.round(r*n*Dt),Math.round(i*n*Dt)]}function Fl(e,t){let r=2**t.z,i=(e[0]/Dt+t.x)/r,n=(e[1]/Dt+t.y)/r;return[vm(i),wm(n)]}function xm(e){return(180+e)/360}function vm(e){return e*360-180}function bm(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function wm(e){return 360/Math.PI*Math.atan(Math.exp((180-e*360)*Math.PI/180))-90}function yn(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Wi(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function _m(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function Dm(e,t,r){let i=e[0]-t[0],n=e[1]-t[1],a=e[0]-r[0],s=e[1]-r[1];return i*s-a*n===0&&i*a<=0&&n*s<=0}function $a(e,t,r,i){let n=[t[0]-e[0],t[1]-e[1]];return Fm([i[0]-r[0],i[1]-r[1]],n)!==0&&!!(fh(e,t,r,i)&&fh(r,i,e,t))}function Sm(e,t,r){for(let i of r)for(let n=0;n<i.length-1;++n)if($a(e,t,i[n],i[n+1]))return!0;return!1}function oi(e,t,r=!1){let i=!1;for(let n of t)for(let a=0;a<n.length-1;a++){if(Dm(e,n[a],n[a+1]))return r;_m(e,n[a],n[a+1])&&(i=!i)}return i}function Am(e,t){for(let r of t)if(oi(e,r))return!0;return!1}function jp(e,t){for(let r of e)if(!oi(r,t))return!1;for(let r=0;r<e.length-1;++r)if(Sm(e[r],e[r+1],t))return!1;return!0}function Em(e,t){for(let r of t)if(jp(e,r))return!0;return!1}function Fm(e,t){return e[0]*t[1]-e[1]*t[0]}function fh(e,t,r,i){let n=e[0]-r[0],a=e[1]-r[1],s=t[0]-r[0],o=t[1]-r[1],l=i[0]-r[0],u=i[1]-r[1],h=n*u-l*a,c=s*u-l*o;return h>0&&c<0||h<0&&c>0}function Il(e,t,r){let i=[];for(let n=0;n<e.length;n++){let a=[];for(let s=0;s<e[n].length;s++){let o=gm(e[n][s],r);yn(t,o),a.push(o)}i.push(a)}return i}function qp(e,t,r){let i=[];for(let n=0;n<e.length;n++){let a=Il(e[n],t,r);i.push(a)}return i}function Gp(e,t,r,i){if(e[0]<r[0]||e[0]>r[2]){let n=i*.5,a=e[0]-r[0]>n?-i:r[0]-e[0]>n?i:0;a===0&&(a=e[0]-r[2]>n?-i:r[2]-e[0]>n?i:0),e[0]+=a}yn(t,e)}function Im(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function dh(e,t,r,i){let n=2**i.z*Dt,a=[i.x*Dt,i.y*Dt],s=[];for(let o of e)for(let l of o){let u=[l.x+a[0],l.y+a[1]];Gp(u,t,r,n),s.push(u)}return s}function yh(e,t,r,i){let n=2**i.z*Dt,a=[i.x*Dt,i.y*Dt],s=[];for(let o of e){let l=[];for(let u of o){let h=[u.x+a[0],u.y+a[1]];yn(t,h),l.push(h)}s.push(l)}if(t[2]-t[0]<=n/2){Im(t);for(let o of s)for(let l of o)Gp(l,t,r,n)}return s}function km(e,t){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if(t.type==="Polygon"){let a=Il(t.coordinates,i,n),s=dh(e.geometry(),r,i,n);if(!Wi(r,i))return!1;for(let o of s)if(!oi(o,a))return!1}if(t.type==="MultiPolygon"){let a=qp(t.coordinates,i,n),s=dh(e.geometry(),r,i,n);if(!Wi(r,i))return!1;for(let o of s)if(!Am(o,a))return!1}return!0}function Tm(e,t){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if(t.type==="Polygon"){let a=Il(t.coordinates,i,n),s=yh(e.geometry(),r,i,n);if(!Wi(r,i))return!1;for(let o of s)if(!jp(o,a))return!1}if(t.type==="MultiPolygon"){let a=qp(t.coordinates,i,n),s=yh(e.geometry(),r,i,n);if(!Wi(r,i))return!1;for(let o of s)if(!Em(o,a))return!1}return!0}var kl=class oa{constructor(t,r){this.type=K,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Jr(t[1])){let i=t[1];if(i.type==="FeatureCollection"){let n=[];for(let a of i.features){let{type:s,coordinates:o}=a.geometry;s==="Polygon"&&n.push(o),s==="MultiPolygon"&&n.push(...o)}if(n.length)return new oa(i,{type:"MultiPolygon",coordinates:n})}else if(i.type==="Feature"){let n=i.geometry.type;if(n==="Polygon"||n==="MultiPolygon")return new oa(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new oa(i,i)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return km(t,this.geometries);if(t.geometryType()==="LineString")return Tm(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},Yp=class{constructor(e=[],t=(r,i)=>r<i?-1:+(r>i)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,i=t[e];for(;e>0;){let n=e-1>>1,a=t[n];if(r(i,a)>=0)break;t[e]=a,e=n}t[e]=i}_down(e){let{data:t,compare:r}=this,i=this.length>>1,n=t[e];for(;e<i;){let a=(e<<1)+1,s=a+1;if(s<this.length&&r(t[s],t[a])<0&&(a=s),r(t[a],n)>=0)break;t[e]=t[a],e=a}t[e]=n}};function Xp(e,t,r=0,i=e.length-1,n=Cm){for(;i>r;){if(i-r>600){let l=i-r+1,u=t-r+1,h=Math.log(l),c=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*c*(l-c)/l)*(u-l/2<0?-1:1);Xp(e,t,Math.max(r,Math.floor(t-u*c/l+p)),Math.min(i,Math.floor(t+(l-u)*c/l+p)),n)}let a=e[t],s=r,o=i;for(Ai(e,r,t),n(e[i],a)>0&&Ai(e,r,i);s<o;){for(Ai(e,s,o),s++,o--;n(e[s],a)<0;)s++;for(;n(e[o],a)>0;)o--}n(e[r],a)===0?Ai(e,r,o):(o++,Ai(e,o,i)),o<=t&&(r=o+1),t<=o&&(i=o-1)}}function Ai(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function Cm(e,t){return e<t?-1:+(e>t)}function Na(e,t){if(e.length<=1)return[e];let r=[],i,n;for(let a of e){let s=Pm(a);s!==0&&(a.area=Math.abs(s),n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[a]):i.push(a))}if(i&&r.push(i),t>1)for(let a=0;a<r.length;a++)r[a].length<=t||(Xp(r[a],t,1,r[a].length-1,Mm),r[a]=r[a].slice(0,t));return r}function Mm(e,t){return t.area-e.area}function Pm(e){let t=0;for(let r=0,i=e.length,n=i-1,a,s;r<i;n=r++)a=e[r],s=e[n],t+=(s.x-a.x)*(a.y+s.y);return t}var mh=Math.PI/180,Tl=class{constructor(e){let t=mh*6378.137*1e3,r=Math.cos(e*mh),i=1/(1-.0066943799901413165*(1-r*r)),n=Math.sqrt(i);this.kx=t*n*r,this.ky=t*n*i*.9933056200098587}distance(e,t){let r=this.wrap(e[0]-t[0])*this.kx,i=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+i*i)}pointOnLine(e,t){let r=1/0,i,n,a,s;for(let o=0;o<e.length-1;o++){let l=e[o][0],u=e[o][1],h=this.wrap(e[o+1][0]-l)*this.kx,c=(e[o+1][1]-u)*this.ky,p=0;(h!==0||c!==0)&&(p=(this.wrap(t[0]-l)*this.kx*h+(t[1]-u)*this.ky*c)/(h*h+c*c),p>1?(l=e[o+1][0],u=e[o+1][1]):p>0&&(l+=h/this.kx*p,u+=c/this.ky*p)),h=this.wrap(t[0]-l)*this.kx,c=(t[1]-u)*this.ky;let f=h*h+c*c;f<r&&(r=f,i=l,n=u,a=o,s=p)}return{point:[i,n],index:a,t:Math.max(0,Math.min(1,s))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}};function Zp(e,t){return t[0]-e[0]}function ma(e){return e[1]-e[0]+1}function Lt(e,t){return e[1]>=e[0]&&e[1]<t}function lo(e,t){if(e[0]>e[1])return[null,null];let r=ma(e);if(t){if(r===2)return[e,null];let n=Math.floor(r/2);return[[e[0],e[0]+n],[e[0]+n,e[1]]]}if(r===1)return[e,null];let i=Math.floor(r/2)-1;return[[e[0],e[0]+i],[e[0]+i+1,e[1]]]}function uo(e,t){if(!Lt(t,e.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=t[0];i<=t[1];++i)yn(r,e[i]);return r}function ho(e){let t=[1/0,1/0,-1/0,-1/0];for(let r of e)for(let i of r)yn(t,i);return t}function gh(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function Cl(e,t,r){if(!gh(e)||!gh(t))return NaN;let i=0,n=0;return e[2]<t[0]&&(i=t[0]-e[2]),e[0]>t[2]&&(i=e[0]-t[2]),e[1]>t[3]&&(n=e[1]-t[3]),e[3]<t[1]&&(n=t[1]-e[3]),r.distance([0,0],[i,n])}function lr(e,t,r){let i=r.pointOnLine(t,e);return r.distance(e,i.point)}function Ml(e,t,r,i,n){let a=Math.min(lr(e,[r,i],n),lr(t,[r,i],n)),s=Math.min(lr(r,[e,t],n),lr(i,[e,t],n));return Math.min(a,s)}function Bm(e,t,r,i,n){if(!(Lt(t,e.length)&&Lt(i,r.length)))return 1/0;let a=1/0;for(let s=t[0];s<t[1];++s){let o=e[s],l=e[s+1];for(let u=i[0];u<i[1];++u){let h=r[u],c=r[u+1];if($a(o,l,h,c))return 0;a=Math.min(a,Ml(o,l,h,c,n))}}return a}function zm(e,t,r,i,n){if(!(Lt(t,e.length)&&Lt(i,r.length)))return NaN;let a=1/0;for(let s=t[0];s<=t[1];++s)for(let o=i[0];o<=i[1];++o)if(a=Math.min(a,n.distance(e[s],r[o])),a===0)return a;return a}function Lm(e,t,r){if(oi(e,t,!0))return 0;let i=1/0;for(let n of t){let a=n[0],s=n[n.length-1];if(a!==s&&(i=Math.min(i,lr(e,[s,a],r)),i===0))return i;let o=r.pointOnLine(n,e);if(i=Math.min(i,r.distance(e,o.point)),i===0)return i}return i}function Vm(e,t,r,i){if(!Lt(t,e.length))return NaN;for(let a=t[0];a<=t[1];++a)if(oi(e[a],r,!0))return 0;let n=1/0;for(let a=t[0];a<t[1];++a){let s=e[a],o=e[a+1];for(let l of r)for(let u=0,h=l.length,c=h-1;u<h;c=u++){let p=l[c],f=l[u];if($a(s,o,p,f))return 0;n=Math.min(n,Ml(s,o,p,f,i))}}return n}function xh(e,t){for(let r of e)for(let i of r)if(oi(i,t,!0))return!0;return!1}function Om(e,t,r,i=1/0){let n=ho(e),a=ho(t);if(i!==1/0&&Cl(n,a,r)>=i)return i;if(Wi(n,a)){if(xh(e,t))return 0}else if(xh(t,e))return 0;let s=1/0;for(let o of e)for(let l=0,u=o.length,h=u-1;l<u;h=l++){let c=o[h],p=o[l];for(let f of t)for(let d=0,y=f.length,m=y-1;d<y;m=d++){let g=f[m],x=f[d];if($a(c,p,g,x))return 0;s=Math.min(s,Ml(c,p,g,x,r))}}return s}function vh(e,t,r,i,n,a){if(!a)return;let s=Cl(uo(i,a),n,r);s<t&&e.push([s,a,[0,0]])}function qn(e,t,r,i,n,a,s){if(!a||!s)return;let o=Cl(uo(i,a),uo(n,s),r);o<t&&e.push([o,a,s])}function ga(e,t,r,i,n=1/0){let a=Math.min(i.distance(e[0],r[0][0]),n);if(a===0)return a;let s=new Yp([[0,[0,e.length-1],[0,0]]],Zp),o=ho(r);for(;s.length>0;){let l=s.pop();if(l[0]>=a)continue;let u=l[1],h=t?50:100;if(ma(u)<=h){if(!Lt(u,e.length))return NaN;if(t){let c=Vm(e,u,r,i);if(isNaN(c)||c===0)return c;a=Math.min(a,c)}else for(let c=u[0];c<=u[1];++c){let p=Lm(e[c],r,i);if(a=Math.min(a,p),a===0)return 0}}else{let c=lo(u,t);vh(s,a,i,e,o,c[0]),vh(s,a,i,e,o,c[1])}}return a}function xa(e,t,r,i,n,a=1/0){let s=Math.min(a,n.distance(e[0],r[0]));if(s===0)return s;let o=new Yp([[0,[0,e.length-1],[0,r.length-1]]],Zp);for(;o.length>0;){let l=o.pop();if(l[0]>=s)continue;let u=l[1],h=l[2],c=t?50:100,p=i?50:100;if(ma(u)<=c&&ma(h)<=p){if(!Lt(u,e.length)&&Lt(h,r.length))return NaN;let f;if(t&&i)f=Bm(e,u,r,h,n),s=Math.min(s,f);else if(t&&!i){let d=e.slice(u[0],u[1]+1);for(let y=h[0];y<=h[1];++y)if(f=lr(r[y],d,n),s=Math.min(s,f),s===0)return s}else if(!t&&i){let d=r.slice(h[0],h[1]+1);for(let y=u[0];y<=u[1];++y)if(f=lr(e[y],d,n),s=Math.min(s,f),s===0)return s}else f=zm(e,u,r,h,n),s=Math.min(s,f)}else{let f=lo(u,t),d=lo(h,i);qn(o,s,n,e,r,f[0],d[0]),qn(o,s,n,e,r,f[0],d[1]),qn(o,s,n,e,r,f[1],d[0]),qn(o,s,n,e,r,f[1],d[1])}}return s}function Rm(e,t){let r=e.geometry(),i=r.flat().map(s=>Fl([s.x,s.y],e.canonical));if(r.length===0)return NaN;let n=new Tl(i[0][1]),a=1/0;for(let s of t){switch(s.type){case"Point":a=Math.min(a,xa(i,!1,[s.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,xa(i,!1,s.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,ga(i,!1,s.coordinates,n,a))}if(a===0)return a}return a}function $m(e,t){let r=e.geometry(),i=r.flat().map(s=>Fl([s.x,s.y],e.canonical));if(r.length===0)return NaN;let n=new Tl(i[0][1]),a=1/0;for(let s of t){switch(s.type){case"Point":a=Math.min(a,xa(i,!0,[s.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,xa(i,!0,s.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,ga(i,!0,s.coordinates,n,a))}if(a===0)return a}return a}function Nm(e,t){let r=e.geometry();if(r.length===0||r[0].length===0)return NaN;let i=Na(r,0).map(s=>s.map(o=>o.map(l=>Fl([l.x,l.y],e.canonical)))),n=new Tl(i[0][0][0][1]),a=1/0;for(let s of t)for(let o of i){switch(s.type){case"Point":a=Math.min(a,ga([s.coordinates],!1,o,n,a));break;case"LineString":a=Math.min(a,ga(s.coordinates,!0,o,n,a));break;case"Polygon":a=Math.min(a,Om(o,s.coordinates,n,a))}if(a===0)return a}return a}function Bs(e){return e.type==="MultiPolygon"?e.coordinates.map(t=>({type:"Polygon",coordinates:t})):e.type==="MultiLineString"?e.coordinates.map(t=>({type:"LineString",coordinates:t})):e.type==="MultiPoint"?e.coordinates.map(t=>({type:"Point",coordinates:t})):[e]}var Pl=class la{constructor(t,r){this.type=C,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Jr(t[1])){let i=t[1];if(i.type==="FeatureCollection")return new la(i,i.features.map(n=>Bs(n.geometry)).flat());if(i.type==="Feature")return new la(i,Bs(i.geometry));if("type"in i&&"coordinates"in i)return new la(i,Bs(i))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return Rm(t,this.geometries);if(t.geometryType()==="LineString")return $m(t,this.geometries);if(t.geometryType()==="Polygon")return Nm(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},Um=class Wp{constructor(t){let r=null;for(let i of t)if(!r)r=i.type;else{if(r===i.type)continue;r=Z;break}this.type=Ne(r??Z,t.length),this.arr=t}static parse(t,r){if(t.length!==2)return r.error(`'semiliteral' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Jr(t[1]))return r.error(`invalid value of type "${typeof t[1]}"`);let i=t[1],n=Ae(i);if(n.kind==="array"){let a=i,s=r.concat(1),o=[];for(let l=0;l<a.length;l++){let u=s.parse(a[l],l,Z);if(!u)return null;o.push(u)}return new Wp(o)}return new Kr(n,i)}evaluate(t){return this.arr.map(r=>r.evaluate(t))}eachChild(t){this.arr.forEach(t)}outputDefined(){return this.arr.every(t=>t.outputDefined())}},Bl=class Hp{constructor(t){this.key=t,this.type=Z}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let i=t[1];return i==null?r.error("Global state property must be defined."):typeof i=="string"?new Hp(i):r.error(`Global state property must be string, but found ${typeof t[1]} instead.`)}evaluate(t){let r=t.globals?.globalState;return!r||Object.keys(r).length===0?null:$i(r,this.key)??null}eachChild(){}outputDefined(){return!1}},jr={"==":lm,"!=":um,">":cm,"<":hm,">=":fm,"<=":pm,array:Ct,at:q1,boolean:Ct,case:Z1,coalesce:Pp,collator:Lp,format:Rp,image:ym,in:G1,"index-of":Y1,interpolate:_t,"interpolate-hcl":_t,"interpolate-lab":_t,length:mm,let:Sp,literal:Kr,match:X1,number:Ct,"number-format":dm,object:Ct,semiliteral:Um,slice:W1,step:El,string:Ct,"to-boolean":$r,"to-color":$r,"to-number":$r,"to-string":$r,var:Ep,within:kl,distance:Pl,"global-state":Bl},vr=class zi{constructor(t,r,i,n,a){this.name=t,this.type=r,this._evaluate=i,this.args=n,this.key=a}evaluate(t){return this._evaluate(t,this.args,this.key)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,r){let i=t[0],n=zi.definitions[i];if(!n)return r.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=s.filter(([u])=>!Array.isArray(u)||u.length===t.length-1),l=null;for(let[u,h]of o){l=new _p(r.registry,va,r.path,null,r.scope);let c=[],p=!1;for(let f=1;f<t.length;f++){let d=t[f],y=Array.isArray(u)?u[f-1]:u.type,m=l.parse(d,1+c.length,y);if(!m){p=!0;break}c.push(m)}if(!p)if(Array.isArray(u)&&u.length!==c.length)l.error(`Expected ${u.length} arguments, but found ${c.length} instead.`);else{for(let f=0;f<c.length;f++){let d=Array.isArray(u)?u[f]:u.type,y=c[f];l.concat(f+1).checkSubtype(d,y.type)}if(l.errors.length===0)return new zi(i,a,h,c,r.key)}}if(o.length===1)r.errors.push(...l.errors);else{let u=(o.length?o:s).map(([c])=>qm(c)).join(" | "),h=[];for(let c=1;c<t.length;c++){let p=r.parse(t[c],1+h.length);if(!p)return null;h.push(ge(p.type))}r.error(`Expected arguments of type ${u}, but found (${h.join(", ")}) instead.`)}return null}static register(t,r){zi.definitions=r;for(let i in r)t[i]=zi}};function bh(e,[t,r,i,n],a){t=t.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);let s=n?n.evaluate(e):1,o=gp(t,r,i,s);if(o)throw new fe(o,a);return new xe(t/255,r/255,i/255,s,!1)}function wh(e,t){return e in t&&t[e]!==void 0}function zs(e,t){let r=t[e];return r===void 0?null:r}function jm(e,t,r,i){for(;r<=i;){let n=r+i>>1;if(t[n]===e)return!0;t[n]>e?i=n-1:r=n+1}return!1}function nr(e){return{type:e}}vr.register(jr,{error:[T1,[X],(e,[t],r)=>{throw new fe(t.evaluate(e),r)}],typeof:[X,[Z],(e,[t])=>ge(Ae(t.evaluate(e)))],"to-rgba":[Ne(C,4),[pt],(e,[t])=>{let[r,i,n,a]=t.evaluate(e).rgb;return[r*255,i*255,n*255,a]}],rgb:[pt,[C,C,C],bh],rgba:[pt,[C,C,C,C],bh],has:{type:K,overloads:[[[X],(e,[t])=>wh(t.evaluate(e),e.properties())],[[X,cr],(e,[t,r])=>wh(t.evaluate(e),r.evaluate(e))]]},get:{type:Z,overloads:[[[X],(e,[t])=>zs(t.evaluate(e),e.properties())],[[X,cr],(e,[t,r])=>zs(t.evaluate(e),r.evaluate(e))]]},"feature-state":[Z,[X],(e,[t])=>zs(t.evaluate(e),e.featureState||{})],properties:[cr,[],e=>e.properties()],"geometry-type":[X,[],e=>e.geometryType()],id:[Z,[],e=>e.id()],zoom:[C,[],e=>e.globals.zoom],"heatmap-density":[C,[],e=>e.globals.heatmapDensity||0],elevation:[C,[],e=>e.globals.elevation||0],"line-progress":[C,[],e=>e.globals.lineProgress||0],accumulated:[Z,[],e=>e.globals.accumulated===void 0?null:e.globals.accumulated],"+":[C,nr(C),(e,t)=>{let r=0;for(let i of t)r+=i.evaluate(e);return r}],"*":[C,nr(C),(e,t)=>{let r=1;for(let i of t)r*=i.evaluate(e);return r}],"-":{type:C,overloads:[[[C,C],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[C],(e,[t])=>-t.evaluate(e)]]},"/":[C,[C,C],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[C,[C,C],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[C,[],()=>Math.LN2],pi:[C,[],()=>Math.PI],e:[C,[],()=>Math.E],"^":[C,[C,C],(e,[t,r])=>t.evaluate(e)**+r.evaluate(e)],sqrt:[C,[C],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[C,[C],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[C,[C],(e,[t])=>Math.log(t.evaluate(e))],log2:[C,[C],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[C,[C],(e,[t])=>Math.sin(t.evaluate(e))],cos:[C,[C],(e,[t])=>Math.cos(t.evaluate(e))],tan:[C,[C],(e,[t])=>Math.tan(t.evaluate(e))],asin:[C,[C],(e,[t])=>Math.asin(t.evaluate(e))],acos:[C,[C],(e,[t])=>Math.acos(t.evaluate(e))],atan:[C,[C],(e,[t])=>Math.atan(t.evaluate(e))],min:[C,nr(C),(e,t)=>Math.min(...t.map(r=>r.evaluate(e)))],max:[C,nr(C),(e,t)=>Math.max(...t.map(r=>r.evaluate(e)))],abs:[C,[C],(e,[t])=>Math.abs(t.evaluate(e))],round:[C,[C],(e,[t])=>{let r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[C,[C],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[C,[C],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[K,[X,Z],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[K,[Z],(e,[t])=>e.id()===t.value],"filter-type-==":[K,[X],(e,[t])=>e.geometryType()===t.value],"filter-<":[K,[X,Z],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<n}],"filter-id-<":[K,[Z],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r<i}],"filter->":[K,[X,Z],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[K,[Z],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r>i}],"filter-<=":[K,[X,Z],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[K,[Z],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r<=i}],"filter->=":[K,[X,Z],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[K,[Z],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r>=i}],"filter-has":[K,[Z],(e,[t])=>{let r=t.value,i=e.properties();return r in i&&i[r]!==void 0}],"filter-has-id":[K,[],e=>e.id()!==null&&e.id()!==void 0],"filter-type-in":[K,[Ne(X)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[K,[Ne(Z)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[K,[X,Ne(Z)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[K,[X,Ne(Z)],(e,[t,r])=>jm(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:K,overloads:[[[K,K],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[nr(K),(e,t)=>{for(let r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:K,overloads:[[[K,K],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[nr(K),(e,t)=>{for(let r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[K,[K],(e,[t])=>!t.evaluate(e)],"is-supported-script":[K,[X],(e,[t])=>{let r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[X,[X],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[X,[X],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[X,nr(Z),(e,t)=>t.map(r=>Ni(r.evaluate(e))).join("")],split:[Ne(X),[X,X],(e,[t,r])=>t.evaluate(e).split(r.evaluate(e))],join:[X,[Ne(X),X],(e,[t,r])=>t.evaluate(e).join(r.evaluate(e))],"resolved-locale":[X,[za],(e,[t])=>t.evaluate(e).resolvedLocale()]});function qm(e){return Array.isArray(e)?`(${e.map(ge).join(", ")})`:`(${ge(e.type)}...)`}function va(e){if(e instanceof Ep)return va(e.boundExpression);if(e instanceof vr&&e.name==="error"||e instanceof Lp||e instanceof kl||e instanceof Pl||e instanceof Bl)return!1;let t=e instanceof $r||e instanceof Ct,r=!0;return e.eachChild(i=>{r&&=t?va(i):i instanceof Kr}),r?Ua(e)&&ja(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function Ua(e){if(e instanceof vr&&(e.name==="get"&&e.args.length===1||e.name==="feature-state"||e.name==="has"&&e.args.length===1||e.name==="properties"||e.name==="geometry-type"||e.name==="id"||/^filter-/.test(e.name))||e instanceof kl||e instanceof Pl)return!1;let t=!0;return e.eachChild(r=>{t&&!Ua(r)&&(t=!1)}),t}function Hi(e){if(e instanceof vr&&e.name==="feature-state")return!1;let t=!0;return e.eachChild(r=>{t&&!Hi(r)&&(t=!1)}),t}function ja(e,t){if(e instanceof vr&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild(i=>{r&&!ja(i,t)&&(r=!1)}),r}function co(e){return{result:"success",value:e}}function Lr(e){return{result:"error",value:e}}function Qr(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function Jp(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function zl(e){return!!e.expression&&e.expression.interpolated}var Ll=/^(.*)-transition$/;function Ji(e,...t){for(let r of t)for(let i in r)e[i]=r[i];return e}function J(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":e===null?"null":typeof e}function qa(e){return typeof e=="object"&&!!e&&!Array.isArray(e)&&Ae(e)===cr}function Gm(e){return e}function Ym(e){switch(e.type){case"color":return xe.parse;case"padding":return Et.parse;case"numberArray":return Ft.parse;case"colorArray":return ot.parse;default:return null}}function Xm(e){switch(e){case"exponential":return Qp;case"interval":return Wm;case"categorical":return Zm;case"identity":return Hm;default:throw Error(`Unknown function type "${e}"`)}}function Kp(e,t){let r=e.stops&&typeof e.stops[0][0]=="object",i=r||e.property!==void 0,n=r||!i,a=e.type||(zl(t)?"exponential":"interval"),s=Ym(t);if(s&&(e=Ji({},e),e.stops&&(e.stops=e.stops.map(h=>[h[0],s(h[1])])),e.default?e.default=s(e.default):e.default=s(t.default)),e.colorSpace&&!$1(e.colorSpace))throw Error(`Unknown color space: "${e.colorSpace}"`);let o=Xm(a),l,u;if(a==="categorical"){l=Object.create(null);for(let h of e.stops)l[h[0]]=h[1];u=typeof e.stops[0][0]}if(r){let h={},c=[];for(let d=0;d<e.stops.length;d++){let y=e.stops[d],m=y[0].zoom;h[m]===void 0&&(h[m]={zoom:m,type:e.type,property:e.property,default:e.default,stops:[]},c.push(m)),h[m].stops.push([y[0].value,y[1]])}let p=[];for(let d of c)p.push([h[d].zoom,Kp(h[d],t)]);let f={name:"linear"};return{kind:"composite",interpolationType:f,interpolationFactor:_t.interpolationFactor.bind(void 0,f),zoomStops:p.map(d=>d[0]),evaluate({zoom:d},y){return Qp({stops:p,base:e.base},t,d).evaluate(d,y)}}}if(n){let h=a==="exponential"?{name:"exponential",base:e.base===void 0?1:e.base}:null;return{kind:"camera",interpolationType:h,interpolationFactor:_t.interpolationFactor.bind(void 0,h),zoomStops:e.stops.map(c=>c[0]),evaluate:({zoom:c})=>o(e,t,c,l,u)}}return{kind:"source",evaluate(h,c){let p=c&&c.properties?c.properties[e.property]:void 0;return p===void 0?mn(e.default,t.default):o(e,t,p,l,u)}}}function mn(e,t,r){if(e!==void 0)return e;if(t!==void 0)return t;if(r!==void 0)return r}function Zm(e,t,r,i,n){return mn(typeof r===n?i[r]:void 0,e.default,t.default)}function Wm(e,t,r){if(J(r)!=="number")return mn(e.default,t.default);let i=e.stops.length;if(i===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];let n=Ra(e.stops.map(a=>a[0]),r,"");return e.stops[n][1]}function Qp(e,t,r){let i=e.base===void 0?1:e.base;if(J(r)!=="number")return mn(e.default,t.default);let n=e.stops.length;if(n===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];let a=Ra(e.stops.map(h=>h[0]),r,""),s=Jm(r,i,e.stops[a][0],e.stops[a+1][0]),o=e.stops[a][1],l=e.stops[a+1][1],u=fr[t.type]||Gm;return typeof o.evaluate=="function"?{evaluate(...h){let c=o.evaluate.apply(void 0,h),p=l.evaluate.apply(void 0,h);if(c!==void 0&&p!==void 0)return u(c,p,s,e.colorSpace)}}:u(o,l,s,e.colorSpace)}function Hm(e,t,r){switch(t.type){case"color":r=xe.parse(r);break;case"formatted":r=zt.fromString(r.toString());break;case"resolvedImage":r=At.fromString(r.toString());break;case"padding":r=Et.parse(r);break;case"colorArray":r=ot.parse(r);break;case"numberArray":r=Ft.parse(r);break;default:J(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0)}return mn(r,e.default,t.default)}function Jm(e,t,r,i){let n=i-r,a=e-r;return n===0?0:t===1?a/n:(t**+a-1)/(t**+n-1)}var Vl=class{constructor(e,t,r,i){this.expression=e,this._warningHistory={},this._evaluator=new wp,this._defaultValue=r?sf(r):null,this._enumValues=r&&r.type==="enum"?r.values:null,this._globalState=i,this._rootKey=t}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=ei(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,i,n,a){this._globalState&&(e=ei(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s=="number"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new fe(`Expected value to be one of ${Object.keys(this._enumValues).map(o=>JSON.stringify(o)).join(", ")}, but found ${JSON.stringify(s)} instead.`,"");return s}catch(s){let o=s instanceof fe?s.path:"",l=`${o}|${s.message}`;return this._warningHistory[l]||(this._warningHistory[l]=!0,typeof console<"u"&&console.warn(ef(this._rootKey,o,s.message,this._defaultValue))),this._defaultValue}}};function ef(e,t,r,i){return`${e}${t}: ${r}${i==null?"":` Falling back to ${String(i)}.`}`}function tf(e){if(!e)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".')}function Ga(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in jr}function dr(e,t,r,i){tf(t);let n=new _p(jr,va,[],r?e0(r):void 0),a=n.parse(e,void 0,void 0,void 0,r&&r.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?co(new Vl(a,t,r,i)):Lr(n.errors)}var Ki=class{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!Hi(t.expression),this.globalStateRefs=gn(t.expression),this._globalState=r}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=ei(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}evaluate(e,t,r,i,n,a){return this._globalState&&(e=ei(e,this._globalState)),this._styleExpression.evaluate(e,t,r,i,n,a)}},ba=class{constructor(e,t,r,i,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!Hi(t.expression),this.globalStateRefs=gn(t.expression),this.interpolationType=i,this._globalState=n}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=ei(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}evaluate(e,t,r,i,n,a){return this._globalState&&(e=ei(e,this._globalState)),this._styleExpression.evaluate(e,t,r,i,n,a)}interpolationFactor(e,t,r){return this.interpolationType?_t.interpolationFactor(this.interpolationType,e,t,r):0}};function Km(e){return e._styleExpression!==void 0}function rf(e,t,r,i){let n=dr(e,t,r,i);if(n.result==="error")return n;let a=n.value.expression,s=Ua(a);if(!s&&!Qr(r))return Lr([new bt("","data expressions not supported")]);let o=ja(a,["zoom"]);if(!o&&!Jp(r))return Lr([new bt("","zoom expressions not supported")]);let l=ua(a);if(!l&&!o)return Lr([new bt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof bt)return Lr([l]);if(l instanceof _t&&!zl(r))return Lr([new bt("",'"interpolate" expressions cannot be used with this property')]);if(!l)return co(s?new Ki("constant",n.value,i):new Ki("source",n.value,i));let u=l instanceof _t?l.interpolation:void 0;return co(s?new ba("camera",n.value,l.labels,u,i):new ba("composite",n.value,l.labels,u,i))}var nf=class af{constructor(t,r,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,tf(r),this._parameters=t,this._specification=i,this._rootKey=r,this._defaultValue=sf(i),this._warningHistory={};let n=Kp(this._parameters,this._specification);this.kind=n.kind,this.interpolationFactor=n.interpolationFactor,this.zoomStops=n.zoomStops,this.interpolationType=n.interpolationType,this._innerEvaluate=n.evaluate}evaluate(t,r){try{return this._innerEvaluate(t,r)}catch(i){let n=i instanceof Error?i.message:String(i),a=`|${n}`;return this._warningHistory[a]||(this._warningHistory[a]=!0,typeof console<"u"&&console.warn(ef(this._rootKey,"",n,this._defaultValue))),this._defaultValue}}static deserialize(t){return new af(t._parameters,t._rootKey,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification,_rootKey:t._rootKey}}};function Qm(e,t,r,i){if(qa(e))return new nf(e,t,r);if(Ga(e)){let n=rf(e,t,r,i);if(n.result==="error")throw Error(n.value.map(a=>`${a.key}: ${a.message}`).join(", "));return n.value}{let n=e;return r.type==="color"&&typeof e=="string"?n=xe.parse(e):r.type==="padding"&&(typeof e=="number"||Array.isArray(e))?n=Et.parse(e):r.type==="numberArray"&&(typeof e=="number"||Array.isArray(e))?n=Ft.parse(e):r.type==="colorArray"&&(typeof e=="string"||Array.isArray(e))?n=ot.parse(e):r.type==="variableAnchorOffsetCollection"&&Array.isArray(e)?n=St.parse(e):r.type==="projectionDefinition"&&typeof e=="string"&&(n=xr.parse(e)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>n}}}function ua(e,t=new Map){if(t.has(e))return t.get(e);let r=null;if(e instanceof Sp)r=ua(e.result,t);else if(e instanceof Pp){for(let i of e.args)if(r=ua(i,t),r)break}else(e instanceof El||e instanceof _t)&&e.input instanceof vr&&e.input.name==="zoom"&&(r=e);return r instanceof bt?(t.set(e,r),r):(e.eachChild(i=>{let n=ua(i,t);n instanceof bt?r=n:!r&&n?r=new bt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new bt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t.set(e,r),r)}function gn(e,t=new Set){return e instanceof Bl&&t.add(e.key),e.eachChild(r=>{gn(r,t)}),t}function e0(e){let t={color:pt,string:X,number:C,enum:X,boolean:K,formatted:fn,padding:La,numberArray:Va,colorArray:Xi,projectionDefinition:Ba,resolvedImage:dn,variableAnchorOffsetCollection:Oa};return e.type==="array"?Ne(t[e.value]||Z,e.length):t[e.type]}function sf(e){if(e.type==="color"&&qa(e.default))return new xe(0,0,0,0);switch(e.type){case"color":return xe.parse(e.default)||null;case"padding":return Et.parse(e.default)||null;case"numberArray":return Ft.parse(e.default)||null;case"colorArray":return ot.parse(e.default)||null;case"variableAnchorOffsetCollection":return St.parse(e.default)||null;case"projectionDefinition":return xr.parse(e.default)||null;default:return e.default===void 0?null:e.default}}function ei(e,t){let{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o}=e??{};return{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o,globalState:t}}function t0(e){let t=!1;for(let r of e){let i=of(r);if(i==="expression")return"expression";i==="legacy"&&(t=!0)}return t?"legacy":"neutral"}function of(e){if(typeof e=="boolean")return"neutral";if(!Array.isArray(e)||e.length===0)return"legacy";switch(e[0]){case"has":return e.length<2||e[1]==="$id"||e[1]==="$type"?"legacy":e.length===2?"neutral":"expression";case"in":return e.length>=3&&(typeof e[1]!="string"||Array.isArray(e[2]))?"expression":"legacy";case"!in":case"!has":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2])?"expression":"legacy";case"none":return"legacy";case"any":case"all":return t0(e.slice(1));default:return"expression"}}function Ol(e){return of(e)!=="legacy"}function _h(e){return e==="$type"?["geometry-type"]:e==="$id"?["id"]:["get",e]}function r0(e){switch(e[0]){case"==":case"!=":case"<":case"<=":case">":case">=":return e.length!==3||typeof e[1]!="string"?null:[e[0],_h(e[1]),e[2]];case"in":case"!in":{if(e.length<2||typeof e[1]!="string")return null;let t=["in",_h(e[1]),["literal",e.slice(2)]];return e[0]==="!in"?["!",t]:t}case"has":case"!has":{if(e.length!==2||typeof e[1]!="string"||e[1]==="$type"||e[1]==="$id")return null;let t=["has",e[1]];return e[0]==="!has"?["!",t]:t}default:return null}}function lf(e){if((e[0]==="<"||e[0]==="<="||e[0]===">"||e[0]===">=")&&e[1]==="$type")return`"$type" cannot be use with operator "${e[0]}"`;let t=r0(e);return t?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(e)} with ${JSON.stringify(t)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(e)} to expression syntax.`}function Ls(e,t,r){let i=r[e];return Array.isArray(i)?Ol(i)?Rl(i,t.concat(e)):{path:t.concat(e),legacyFilter:i}:null}function Rl(e,t=[]){if(!Array.isArray(e)||e.length<1)return null;switch(e[0]){case"all":case"any":case"none":for(let r=1;r<e.length;r++){let i=Ls(r,t,e);if(i)return i}break;case"!":{let r=Ls(1,t,e);if(r)return r;break}case"case":for(let r=1;r<e.length-1;r+=2){let i=Ls(r,t,e);if(i)return i}}return null}function i0(e,t){let r=Rl(e);if(!r||typeof console>"u")return;let i=r.path.map(n=>`[${n}]`).join("");console.warn(`${t}${i}: ${lf(r.legacyFilter)}`)}var n0={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Qi(e,t,r){if(e==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Ol(e)?i0(e,t):e=wa(e);let i=dr(e,t,n0,r);if(i.result==="error")throw Error(i.value.map(n=>`${n.key}: ${n.message}`).join(", "));return{filter:(n,a,s)=>i.value.evaluate(n,a,{},s),needGeometry:uf(e),getGlobalStateRefs:()=>gn(i.value.expression)}}function a0(e,t){return e<t?-1:+(e>t)}function uf(e){if(!Array.isArray(e))return!1;if(e[0]==="within"||e[0]==="distance")return!0;for(let t=1;t<e.length;t++)if(uf(e[t]))return!0;return!1}function wa(e){if(!e)return!0;let t=e[0];return e.length<=1?t!=="any":t==="=="?Vs(e[1],e[2],"=="):t==="!="?Gn(Vs(e[1],e[2],"==")):t==="<"||t===">"||t==="<="||t===">="?Vs(e[1],e[2],t):t==="any"?s0(e.slice(1)):t==="all"?["all"].concat(e.slice(1).map(wa)):t==="none"?["all"].concat(e.slice(1).map(wa).map(Gn)):t==="in"?Dh(e[1],e.slice(2)):t==="!in"?Gn(Dh(e[1],e.slice(2))):t==="has"?Sh(e[1]):t!=="!has"||Gn(Sh(e[1]))}function Vs(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function s0(e){return["any"].concat(e.map(wa))}function Dh(e,t){if(t.length===0)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(r=>typeof r!=typeof t[0])?["filter-in-large",e,["literal",t.sort(a0)]]:["filter-in-small",e,["literal",t]]}}function Sh(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Gn(e){return["!",e]}function po(e){let t=typeof e;if(t==="number"||t==="boolean"||t==="string"||e==null)return JSON.stringify(e);if(Array.isArray(e)){let n="[";for(let a of e)n+=`${po(a)},`;return`${n}]`}let r=Object.keys(e).sort(),i="{";for(let n=0;n<r.length;n++)i+=`${JSON.stringify(r[n])}:${po(e[r[n]])},`;return`${i}}`}function o0(e){let t="";for(let r of I1)t+=`/${po(e[r])}`;return t}function l0(e,t){let r={};for(let n=0;n<e.length;n++){let a=t&&t[e[n].id]||o0(e[n]);t&&(t[e[n].id]=a);let s=r[a];s||=r[a]=[],s.push(e[n])}let i=[];for(let n in r)i.push(r[n]);return i}function hf(e){let t=e.key,r=e.value;return r?[new F(t,r,"constants have been deprecated as of v8")]:[]}function Se(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function yr(e){if(Array.isArray(e))return e.map(yr);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let r in e)t[r]=yr(e[r]);return t}return Se(e)}function Qe(e){let t=e.key,r=e.value,i=e.valueSpec||{},n=e.objectElementValidators||{},a=e.style,s=e.styleSpec,o=e.validateSpec,l=[],u=J(r);if(u!=="object")return[new F(t,r,`object expected, ${u} found`)];for(let h in r){let c=h.split(".")[0],p=$i(i,c)||i["*"],f;if($i(n,c))f=n[c];else if($i(i,c)){if(r[h]===void 0)continue;f=o}else if(n["*"])f=n["*"];else if(i["*"])f=o;else{l.push(new F(t,r[h],`unknown property "${h}"`));continue}l=l.concat(f({key:(t&&`${t}.`)+h,value:r[h],valueSpec:p,style:a,styleSpec:s,object:r,objectKey:h,validateSpec:o},r))}for(let h in i)n[h]||i[h].required&&i[h].default===void 0&&r[h]===void 0&&l.push(new F(t,r,`missing required property "${h}"`));return l}function $l(e){let t=e.value,r=e.valueSpec,i=e.validateSpec,n=e.style,a=e.styleSpec,s=e.key,o=e.arrayElementValidator||i;if(J(t)!=="array")return[new F(s,t,`array expected, ${J(t)} found`)];if(r.length&&t.length!==r.length)return[new F(s,t,`array length ${r.length} expected, length ${t.length} found`)];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),J(r.value)==="object"&&(l=r.value);let u=[];for(let h=0;h<t.length;h++)u=u.concat(o({array:t,arrayIndex:h,value:t[h],valueSpec:l,validateSpec:e.validateSpec,style:n,styleSpec:a,key:`${s}[${h}]`}));return u}function Ya(e){let t=e.key,r=e.value,i=e.valueSpec,n=J(r);return n==="number"&&r!==r&&(n="NaN"),n==="number"?"minimum"in i&&r<i.minimum?[new F(t,r,`${r} is less than the minimum value ${i.minimum}`)]:"maximum"in i&&r>i.maximum?[new F(t,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]:[new F(t,r,`number expected, ${n} found`)]}function cf(e){let t=e.valueSpec,r=Se(e.value.type),i,n={},a,s,o=r!=="categorical"&&e.value.property===void 0,l=!o,u=J(e.value.stops)==="array"&&J(e.value.stops[0])==="array"&&J(e.value.stops[0][0])==="object",h=Qe({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:c,default:d}});return r==="identity"&&o&&h.push(new F(e.key,e.value,'missing required property "property"')),r!=="identity"&&!e.value.stops&&h.push(new F(e.key,e.value,'missing required property "stops"')),r==="exponential"&&e.valueSpec.expression&&!zl(e.valueSpec)&&h.push(new F(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Qr(e.valueSpec)?h.push(new F(e.key,e.value,"property functions not supported")):o&&!Jp(e.valueSpec)&&h.push(new F(e.key,e.value,"zoom functions not supported"))),(r==="categorical"||u)&&e.value.property===void 0&&h.push(new F(e.key,e.value,'"property" property is required')),h;function c(y){if(r==="identity")return[new F(y.key,y.value,'identity function may not have a "stops" property')];let m=[],g=y.value;return m=m.concat($l({key:y.key,value:g,valueSpec:y.valueSpec,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,arrayElementValidator:p})),J(g)==="array"&&g.length===0&&m.push(new F(y.key,g,"array must have at least one stop")),m}function p(y){let m=[],g=y.value,x=y.key;if(J(g)!=="array")return[new F(x,g,`array expected, ${J(g)} found`)];if(g.length!==2)return[new F(x,g,`array length 2 expected, length ${g.length} found`)];if(u){if(J(g[0])!=="object")return[new F(x,g,`object expected, ${J(g[0])} found`)];if(g[0].zoom===void 0)return[new F(x,g,"object stop key must have zoom")];if(g[0].value===void 0)return[new F(x,g,"object stop key must have value")];if(s&&s>Se(g[0].zoom))return[new F(x,g[0].zoom,"stop zoom values must appear in ascending order")];Se(g[0].zoom)!==s&&(s=Se(g[0].zoom),a=void 0,n={}),m=m.concat(Qe({key:`${x}[0]`,value:g[0],valueSpec:{zoom:{}},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,objectElementValidators:{zoom:Ya,value:f}}))}else m=m.concat(f({key:`${x}[0]`,value:g[0],valueSpec:{},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec},g));return Ga(yr(g[1]))?m.concat([new F(`${x}[1]`,g[1],"expressions are not allowed in function stops.")]):m.concat(y.validateSpec({key:`${x}[1]`,value:g[1],valueSpec:t,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec}))}function f(y,m){let g=J(y.value),x=Se(y.value),v=y.value===null?m:y.value;if(!i)i=g;else if(g!==i)return[new F(y.key,v,`${g} stop domain type must match previous stop domain type ${i}`)];if(g!=="number"&&g!=="string"&&g!=="boolean")return[new F(y.key,v,"stop domain value must be a number, string, or boolean")];if(g!=="number"&&r!=="categorical"){let b=`number expected, ${g} found`;return Qr(t)&&r===void 0&&(b+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new F(y.key,v,b)]}return r==="categorical"&&g==="number"&&(!isFinite(x)||Math.floor(x)!==x)?[new F(y.key,v,`integer expected, found ${x}`)]:r!=="categorical"&&g==="number"&&a!==void 0&&x<a?[new F(y.key,v,"stop domain values must appear in ascending order")]:(a=x,r==="categorical"&&x in n?[new F(y.key,v,"stop domain values must be unique")]:(n[x]=!0,[]))}function d(y){return y.validateSpec({key:y.key,value:y.value,valueSpec:t,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec})}}function ti(e){let t=(e.expressionContext==="property"?rf:dr)(yr(e.value),e.key,e.valueSpec);if(t.result==="error")return t.value.map(i=>new F(`${e.key}${i.key}`,e.value,i.message));let r=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext==="property"&&e.propertyKey==="text-font"&&!r.outputDefined())return[new F(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if(e.expressionContext==="property"&&e.propertyType==="layout"&&!Hi(r))return[new F(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!Hi(r))return[new F(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!ja(r,["zoom","feature-state"]))return[new F(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!Ua(r))return[new F(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function u0(e){let t=e.value,r=e.key,i=J(t);return i==="boolean"?[]:[new F(r,t,`boolean expected, ${i} found`)]}function fo(e){let t=e.key,r=e.value,i=J(r);return i==="string"?xe.parse(String(r))?[]:[new F(t,r,`color expected, "${r}" found`)]:[new F(t,r,`color expected, ${i} found`)]}function en(e){let t=e.key,r=e.value,i=e.valueSpec,n=[];return Array.isArray(i.values)?i.values.indexOf(Se(r))===-1&&n.push(new F(t,r,`expected one of [${i.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(i.values).indexOf(Se(r))===-1&&n.push(new F(t,r,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(r)} found`)),n}function h0(e,t){let r=e;for(let i of t)r=r[i];return r}function c0(e,t){let r=Rl(t);return r?[new F(`${e.key}${r.path.map(i=>`[${i}]`).join("")}`,h0(e.value,r.path),lf(r.legacyFilter),null,"warning")]:[]}function Nl(e){let t=yr(e.value);return Ol(t)?[...c0(e,t),...ti(Ji({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}}))]:pf(e)}function pf(e){let t=e.value,r=e.key;if(J(t)!=="array")return[new F(r,t,`array expected, ${J(t)} found`)];let i=e.styleSpec,n,a=[];if(t.length<1)return[new F(r,t,"filter array must have at least 1 element")];switch(a=a.concat(en({key:`${r}[0]`,value:t[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),Se(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&Se(t[1])==="$type"&&a.push(new F(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&a.push(new F(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(n=J(t[1]),n!=="string"&&a.push(new F(`${r}[1]`,t[1],`string expected, ${n} found`)));for(let s=2;s<t.length;s++)n=J(t[s]),Se(t[1])==="$type"?a=a.concat(en({key:`${r}[${s}]`,value:t[s],valueSpec:i.geometry_type,style:e.style,styleSpec:e.styleSpec})):n!=="string"&&n!=="number"&&n!=="boolean"&&a.push(new F(`${r}[${s}]`,t[s],`string, number, or boolean expected, ${n} found`));break;case"any":case"all":case"none":for(let s=1;s<t.length;s++)a=a.concat(pf({key:`${r}[${s}]`,value:t[s],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":n=J(t[1]),t.length===2?n!=="string"&&a.push(new F(`${r}[1]`,t[1],`string expected, ${n} found`)):a.push(new F(r,t,`filter array for "${t[0]}" operator must have 2 elements`))}return a}function ff(e,t){let r=e.key,i=e.validateSpec,n=e.style,a=e.styleSpec,s=e.value,o=e.objectKey,l=a[`${t}_${e.layerType}`];if(!l)return[];let u=o.match(Ll);if(t==="paint"&&u&&l[u[1]]&&l[u[1]].transition)return i({key:r,value:s,valueSpec:a.transition,style:n,styleSpec:a});let h=e.valueSpec||l[o];if(!h)return[new F(r,s,`unknown property "${o}"`)];let c;if(J(s)==="string"&&Qr(h)&&!h.tokens&&(c=/^{([^}]+)}$/.exec(s)))return[new F(r,s,`"${o}" does not support interpolation syntax
12
- Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(c[1])} }\`.`)];let p=[];return e.layerType==="symbol"&&o==="text-font"&&qa(yr(s))&&Se(s.type)==="identity"&&p.push(new F(r,s,'"text-font" does not support identity functions')),p.concat(i({key:e.key,value:s,valueSpec:h,style:n,styleSpec:a,expressionContext:"property",propertyType:t,propertyKey:o}))}function df(e){return ff(e,"paint")}function yf(e){return ff(e,"layout")}function mf(e){let t=[],r=e.value,i=e.key,n=e.style,a=e.styleSpec;if(J(r)!=="object")return[new F(i,r,`object expected, ${J(r)} found`)];!r.type&&!r.ref&&t.push(new F(i,r,'either "type" or "ref" is required'));let s=Se(r.type),o=Se(r.ref);if(r.id){let l=Se(r.id);for(let u=0;u<e.arrayIndex;u++){let h=n.layers[u];Se(h.id)===l&&t.push(new F(i,r.id,`duplicate layer id "${r.id}", previously used at line ${h.id.__line__}`))}}if("ref"in r){["type","source","source-layer","filter","layout"].forEach(u=>{u in r&&t.push(new F(i,r[u],`"${u}" is prohibited for ref layers`))});let l;n.layers.forEach(u=>{Se(u.id)===o&&(l=u)}),l?l.ref?t.push(new F(i,r.ref,"ref cannot reference another ref layer")):s=Se(l.type):t.push(new F(i,r.ref,`ref layer "${o}" not found`))}else if(s!=="background")if(!r.source)t.push(new F(i,r,'missing required property "source"'));else{let l=n.sources&&n.sources[r.source],u=l&&Se(l.type);l?u==="vector"&&s==="raster"?t.push(new F(i,r.source,`layer "${r.id}" requires a raster source`)):u!=="raster-dem"&&s==="hillshade"||u!=="raster-dem"&&s==="color-relief"?t.push(new F(i,r.source,`layer "${r.id}" requires a raster-dem source`)):u==="raster"&&s!=="raster"?t.push(new F(i,r.source,`layer "${r.id}" requires a vector source`)):u==="vector"&&!r["source-layer"]?t.push(new F(i,r,`layer "${r.id}" must specify a "source-layer"`)):u==="raster-dem"&&s!=="hillshade"&&s!=="color-relief"?t.push(new F(i,r.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):s==="line"&&r.paint&&r.paint["line-gradient"]&&(u!=="geojson"||!l.lineMetrics)&&t.push(new F(i,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new F(i,r.source,`source "${r.source}" not found`))}return s==="raster"&&r.paint?.resampling&&r.paint?.["raster-resampling"]&&t.push(new F(i,r.paint,`layer "${r.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),t=t.concat(Qe({key:i,value:r,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(){return[]},type(){return e.validateSpec({key:`${i}.type`,value:r.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:r,objectKey:"type"})},filter:Nl,layout(l){return Qe({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return yf(Ji({layerType:s},u))}}})},paint(l){return Qe({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return df(Ji({layerType:s},u))}}})}}})),t}function Kt(e){let t=e.value,r=e.key,i=J(t);return i==="string"?[]:[new F(r,t,`string expected, ${i} found`)]}function p0(e){let t=e.sourceName??"",r=e.value,i=e.styleSpec,n=i.source_raster_dem,a=e.style,s=[],o=J(r);if(r===void 0)return s;if(o!=="object")return s.push(new F("source_raster_dem",r,`object expected, ${o} found`)),s;let l=Se(r.encoding)==="custom",u=["redFactor","greenFactor","blueFactor","baseShift"],h=e.value.encoding?`"${e.value.encoding}"`:"Default";for(let c in r)!l&&u.includes(c)?s.push(new F(c,r[c],`In "${t}": "${c}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):n[c]?s=s.concat(e.validateSpec({key:c,value:r[c],valueSpec:n[c],validateSpec:e.validateSpec,style:a,styleSpec:i})):s.push(new F(c,r[c],`unknown property "${c}"`));return s}var Ah={promoteId:f0};function gf(e){let t=e.value,r=e.key,i=e.styleSpec,n=e.style,a=e.validateSpec;if(!t.type)return[new F(r,t,'"type" is required')];let s=Se(t.type),o;switch(s){case"vector":case"raster":return o=Qe({key:r,value:t,valueSpec:i[`source_${s.replace("-","_")}`],style:e.style,styleSpec:i,objectElementValidators:Ah,validateSpec:a}),o;case"raster-dem":return o=p0({sourceName:r,value:t,style:e.style,styleSpec:i,validateSpec:a}),o;case"geojson":if(o=Qe({key:r,value:t,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:Ah}),t.cluster)for(let l in t.clusterProperties){let[u,h]=t.clusterProperties[l],c=typeof u=="string"?[u,["accumulated"],["get",l]]:u;o.push(...ti({key:`${r}.${l}.map`,value:h,validateSpec:a,expressionContext:"cluster-map"})),o.push(...ti({key:`${r}.${l}.reduce`,value:c,validateSpec:a,expressionContext:"cluster-reduce"}))}return o;case"video":return Qe({key:r,value:t,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case"image":return Qe({key:r,value:t,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case"canvas":return[new F(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return en({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,validateSpec:a,styleSpec:i})}}function f0({key:e,value:t}){if(J(t)==="string")return Kt({key:e,value:t});{let r=[];for(let i in t)r.push(...Kt({key:`${e}.${i}`,value:t[i]}));return r}}function xf(e){let t=e.value,r=e.styleSpec,i=r.light,n=e.style,a=[],s=J(t);if(t===void 0)return a;if(s!=="object")return a=a.concat([new F("light",t,`object expected, ${s} found`)]),a;for(let o in t){let l=o.match(Ll);a=l&&i[l[1]]&&i[l[1]].transition?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:r.transition,validateSpec:e.validateSpec,style:n,styleSpec:r})):i[o]?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:i[o],validateSpec:e.validateSpec,style:n,styleSpec:r})):a.concat([new F(o,t[o],`unknown property "${o}"`)])}return a}function vf(e){let t=e.value,r=e.styleSpec,i=r.sky,n=e.style,a=J(t);if(t===void 0)return[];if(a!=="object")return[new F("sky",t,`object expected, ${a} found`)];let s=[];for(let o in t){let l=o.match(Ll);s=l&&i[l[1]]&&i[l[1]].transition?s.concat(e.validateSpec({key:o,value:t[o],valueSpec:r.transition,style:n,styleSpec:r})):i[o]?s.concat(e.validateSpec({key:o,value:t[o],valueSpec:i[o],style:n,styleSpec:r})):s.concat([new F(o,t[o],`unknown property "${o}"`)])}return s}function bf(e){let t=e.value,r=e.styleSpec,i=r.terrain,n=e.style,a=[],s=J(t);if(t===void 0)return a;if(s!=="object")return a=a.concat([new F("terrain",t,`object expected, ${s} found`)]),a;for(let o in t)a=i[o]?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:i[o],validateSpec:e.validateSpec,style:n,styleSpec:r})):a.concat([new F(o,t[o],`unknown property "${o}"`)]);return a}function d0(e){return Kt(e).length===0?[]:ti(e)}function y0(e){return Kt(e).length===0?[]:ti(e)}function m0(e){let t=e.key,r=e.value;if(J(r)==="array"){if(r.length<1||r.length>4)return[new F(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:"number"},n=[];for(let a=0;a<r.length;a++)n=n.concat(e.validateSpec({key:`${t}[${a}]`,value:r[a],validateSpec:e.validateSpec,valueSpec:i}));return n}return Ya({key:t,value:r,valueSpec:{}})}function g0(e){let t=e.key,r=e.value;if(J(r)==="array"){let i={type:"number"};if(r.length<1)return[new F(t,r,"array length at least 1 expected, length 0 found")];let n=[];for(let a=0;a<r.length;a++)n=n.concat(e.validateSpec({key:`${t}[${a}]`,value:r[a],validateSpec:e.validateSpec,valueSpec:i}));return n}return Ya({key:t,value:r,valueSpec:{}})}function x0(e){let t=e.key,r=e.value;if(J(r)==="array"){if(r.length<1)return[new F(t,r,"array length at least 1 expected, length 0 found")];let i=[];for(let n=0;n<r.length;n++)i=i.concat(fo({key:`${t}[${n}]`,value:r[n],valueSpec:{}}));return i}return fo({key:t,value:r,valueSpec:{}})}function v0(e){let t=e.key,r=e.value,i=J(r),n=e.styleSpec;if(i!=="array"||r.length<1||r.length%2!=0)return[new F(t,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let s=0;s<r.length;s+=2)a=a.concat(en({key:`${t}[${s}]`,value:r[s],valueSpec:n.layout_symbol["text-anchor"]})),a=a.concat($l({key:`${t}[${s+1}]`,value:r[s+1],valueSpec:{length:2,value:"number"},validateSpec:e.validateSpec,style:e.style,styleSpec:n}));return a}function wf(e){let t=[],r=e.value,i=e.key;if(Array.isArray(r)){let n=[],a=[];for(let s in r)r[s].id&&n.includes(r[s].id)&&t.push(new F(i,r,`all the sprites' ids must be unique, but ${r[s].id} is duplicated`)),n.push(r[s].id),r[s].url&&a.includes(r[s].url)&&t.push(new F(i,r,`all the sprites' URLs must be unique, but ${r[s].url} is duplicated`)),a.push(r[s].url),t=t.concat(Qe({key:`${i}[${s}]`,value:r[s],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:e.validateSpec}));return t}return Kt({key:i,value:r})}function b0(e){let t=e.value,r=e.styleSpec,i=r.projection,n=e.style,a=J(t);if(t===void 0)return[];if(a!=="object")return[new F("projection",t,`object expected, ${a} found`)];let s=[];for(let o in t)s=i[o]?s.concat(e.validateSpec({key:o,value:t[o],valueSpec:i[o],style:n,styleSpec:r})):s.concat([new F(o,t[o],`unknown property "${o}"`)]);return s}function w0(e){let t=e.key,r=e.value;r=r instanceof String?r.valueOf():r;let i=J(r);return i==="array"&&!D0(r)&&!_0(r)?[new F(t,r,`projection expected, invalid array ${JSON.stringify(r)} found`)]:["array","string"].includes(i)?[]:[new F(t,r,`projection expected, invalid type "${i}" found`)]}function _0(e){return!!["interpolate","step","literal"].includes(e[0])}function D0(e){return Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number"}function yo(e){return!!e&&e.constructor===Object}function _f(e){return yo(e.value)?[]:[new F(e.key,e.value,`object expected, ${J(e.value)} found`)]}var Eh=1114111,S0=/^u\+(?:([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?|([0-9a-f]{0,5}\?{1,6}))$/i;function A0(e,t){if(J(t)!=="string")return[];let r=`${t}`,i=()=>[new F(e,t,'invalid unicode range, expected a value such as "U+26", "U+0-10FFFF" or "U+4??"')],n=r.match(S0);if(!n)return i();let[,a,s,o]=n;if(o!==void 0)return o.length>6?i():[];let l=parseInt(a,16),u=s===void 0?l:parseInt(s,16);return l>Eh||u>Eh?[new F(e,t,"unicode range is out of bounds, the maximum code point is U+10FFFF")]:l>u?[new F(e,t,`unicode range start must not be greater than its end, but ${r} is`)]:[]}function Df(e){let t=e.key??"font-faces",r=e.value,i=e.validateSpec,n=e.styleSpec??op,a=e.style;if(!yo(r))return[new F(t,r,`object expected, ${J(r)} found`)];let s=[];for(let o in r){let l=r[o],u=J(l);if(u==="string")s.push(...Kt({key:`${t}.${o}`,value:l}));else if(u==="array"){let h={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[c,p]of l.entries()){let f=`${t}.${o}[${c}]`;s.push(...Qe({key:f,value:p,valueSpec:h,styleSpec:n,style:a,validateSpec:i}));let d=yo(p)?p["unicode-range"]:void 0;if(J(d)==="array")for(let[y,m]of d.entries())s.push(...A0(`${f}.unicode-range[${y}]`,m))}}else s.push(new F(`${t}.${o}`,l,`string or array expected, ${u} found`))}return s}var Fh={"*"(){return[]},array:$l,boolean:u0,number:Ya,color:fo,constants:hf,enum:en,filter:Nl,function:cf,layer:mf,object:Qe,source:gf,light:xf,sky:vf,terrain:bf,projection:b0,projectionDefinition:w0,string:Kt,formatted:d0,resolvedImage:y0,padding:m0,numberArray:g0,colorArray:x0,variableAnchorOffsetCollection:v0,sprite:wf,state:_f,fontFaces:Df};function Ui(e){let t=e.value,r=e.valueSpec,i=e.styleSpec;return e.validateSpec=Ui,r.expression&&qa(Se(t))?cf(e):r.expression&&Ga(yr(t))?ti(e):r.type&&Fh[r.type]?Fh[r.type](e):Qe(Ji({},e,{valueSpec:r.type?i[r.type]:r}))}function Sf(e){let t=e.value,r=e.key,i=Kt(e);return i.length||(t.indexOf("{fontstack}")===-1&&i.push(new F(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&i.push(new F(r,t,'"glyphs" url must include a "{range}" token'))),i}function He(e,t=_){let r=[];return r=r.concat(Ui({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:Ui,objectElementValidators:{glyphs:Sf,"*"(){return[]}}})),e.constants&&(r=r.concat(hf({key:"constants",value:e.constants,style:e,styleSpec:t,validateSpec:Ui}))),Af(r)}He.source=nt(it(gf)),He.sprite=nt(it(wf)),He.glyphs=nt(it(Sf)),He.fontFaces=nt(it(Df)),He.light=nt(it(xf)),He.sky=nt(it(vf)),He.terrain=nt(it(bf)),He.state=nt(it(_f)),He.layer=nt(it(mf)),He.filter=nt(it(Nl)),He.paintProperty=nt(it(df)),He.layoutProperty=nt(it(yf));function it(e){return function(t){return e(Object.assign({},t,{validateSpec:Ui}))}}function Af(e){return[].concat(e).sort((t,r)=>t.line-r.line)}function nt(e){return function(...t){return Af(e.apply(this,t))}}var E0={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"},F0=class{constructor(e,t,r){this._rootKey=t,this._globalState=r,this.setValue(e)}evaluate(){return this._literalValue??this._compiledValue.evaluate({})}setValue(e){if(e==null||e==="visible"||e==="none"){this._literalValue=e==="none"?"none":"visible",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let t=dr(e,this._rootKey,E0,this._globalState);if(t.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,Error(t.value.map(r=>`${r.key}: ${r.message}`).join(", "));this._literalValue=void 0,this._compiledValue=t.value,this._globalStateRefs=gn(t.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};function I0(e,t,r){return new F0(e,t,r)}var Ul={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function k0(e){return Ul.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))]}function T0(e,t){Ul.REGISTERED_PROTOCOLS[e]=t}function C0(e){delete Ul.REGISTERED_PROTOCOLS[e]}var Ih="global-dispatcher",_a=class extends Error{constructor(e,t,r,i){super(`AJAXError: ${t} (${e}): ${r}`),this.status=e,this.statusText=t,this.url=r,this.body=i}};function Ef(){if(Wr(self))return self.worker?.referrer;if(window.location.protocol==="blob:")try{return window.parent.location.href}catch{}return window.location.href}var M0=e=>e.startsWith("file:")||Ef()?.startsWith("file:")&&!/^\w+:/.test(e);async function P0(e,t){let r=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:Ef(),referrerPolicy:e.referrerPolicy,signal:t.signal});e.type==="json"&&!r.headers.has("Accept")&&r.headers.set("Accept","application/json");let i;try{i=await fetch(r)}catch(s){throw ap(s)?s:new _a(0,fa(s).message,e.url,new Blob)}if(!i.ok){let s=await i.blob();throw new _a(i.status,i.statusText,e.url,s)}let n;n=e.type==="arrayBuffer"||e.type==="image"?i.arrayBuffer():e.type==="json"?i.json():i.text();let a=await n;return F1(t.signal),{data:a,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),etag:i.headers.get("ETag")}}function B0(e,t){return new Promise((r,i)=>{let n=new XMLHttpRequest;n.open(e.method||"GET",e.url,!0),(e.type==="arrayBuffer"||e.type==="image")&&(n.responseType="arraybuffer");for(let a in e.headers)n.setRequestHeader(a,e.headers[a]);e.type==="json"&&(n.responseType="text",e.headers?.Accept||n.setRequestHeader("Accept","application/json")),n.withCredentials=e.credentials==="include",n.onerror=()=>{i(Error(n.statusText))},n.onload=()=>{if(!t.signal.aborted)if((n.status>=200&&n.status<300||n.status===0)&&n.response!==null){let a=n.response;if(e.type==="json")try{a=JSON.parse(n.response)}catch(s){i(s);return}r({data:a,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires"),etag:n.getResponseHeader("ETag")})}else{let a=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});i(new _a(n.status,n.statusText,e.url,a))}},t.signal.addEventListener("abort",()=>{n.abort(),i(new Dl(t.signal.reason))}),n.send(e.body)})}var jl=async function(e,t){if(e.url.includes("://")&&!/^https?:|^file:/.test(e.url)){let r=k0(e.url);if(r){let i=await r(e,t);return!i.data&&e.type==="arrayBuffer"?Xe(i,{data:new ArrayBuffer(0)}):i}if(Wr(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:e,targetMapId:Ih},t)}if(!M0(e.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return P0(e,t);if(Wr(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:e,mustQueue:!0,targetMapId:Ih},t)}return B0(e,t)},z0=(e,t)=>jl(Xe(e,{type:"json"}),t),L0=(e,t)=>jl(Xe(e,{type:"arrayBuffer"}),t),Mt={};function P(e,t,r={}){if(Mt[e])throw Error(`${e} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),Mt[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}P("Object",Object),P("Set",Set),P("TransferableGridIndex",to),P("Color",xe),P("Error",Error),P("AJAXError",_a),P("ResolvedImage",At),P("StylePropertyFunction",nf),P("StyleExpression",Vl,{omit:["_evaluator"]}),P("ZoomDependentExpression",ba),P("ZoomConstantExpression",Ki),P("CompoundExpression",vr,{omit:["_evaluate"]});for(let e in jr)jr[e]._classRegistryKey||P(`Expression_${e}`,jr[e]);function Ff(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor?.name==="ArrayBuffer")}function ql(e){let t=e.constructor;return e.$name||t._classRegistryKey}function V0(e){if(typeof e!="object"||!e)return!1;let t=ql(e);return t&&t!=="Object"}function If(e){return!V0(e)&&(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||e instanceof Error||Ff(e)||_l(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function ji(e,t){if(If(e))return(Ff(e)||_l(e))&&t&&t.push(e),ArrayBuffer.isView(e)&&t&&t.push(e.buffer),e instanceof ImageData&&t&&t.push(e.data.buffer),e;if(Array.isArray(e)){let a=[];for(let s of e)a.push(ji(s,t));return a}if(typeof e!="object")throw Error(`can't serialize object of type ${typeof e}`);let r=ql(e);if(!r)throw Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!Mt[r])throw Error(`${r} is not registered.`);let{klass:i}=Mt[r],n=i.serialize?i.serialize(e,t):{};if(i.serialize){if(n===t?.[t.length-1])throw Error("statically serialized object won't survive transfer of $name property")}else{for(let a in e){if(!e.hasOwnProperty(a)||Mt[r].omit.includes(a))continue;let s=e[a];s!==void 0&&(n[a]=Mt[r].shallow.includes(a)?s:ji(s,t))}e instanceof Error&&(n.message=e.message)}if(n.$name)throw Error("$name property is reserved for worker serialization logic.");return r!=="Object"&&(n.$name=r),n}function qi(e){if(If(e))return e;if(Array.isArray(e))return e.map(qi);if(typeof e!="object")throw Error(`can't deserialize object of type ${typeof e}`);let t=ql(e)||"Object";if(!Mt[t])throw Error(`can't deserialize unregistered class ${t}`);let{klass:r}=Mt[t];if(!r)throw Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(e);let i=Object.create(r.prototype);for(let n of Object.keys(e)){if(n==="$name")continue;let a=e[n];i[n]=Mt[t].shallow.includes(n)?a:qi(a)}return i}var O0=class{constructor(e){this._methodToThrottle=e,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>this._invoke()}trigger(){this._triggered||(this._triggered=!0,this._channel?.port1.postMessage(!0),setTimeout(()=>this._invoke(),0))}_invoke(){this._triggered&&(this._triggered=!1,this._methodToThrottle())}remove(){delete this._channel,this._methodToThrottle=()=>{}}},R0={once:!0},$0=class{constructor(e,t){this.target=e,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new O0(()=>this.process()),this.subscription=ah(this.target,"message",r=>this.receive(r),!1),this.globalScope=Wr(self)?e:window}registerMessageHandler(e,t){this.messageHandlers[e]=t}unregisterMessageHandler(e){delete this.messageHandlers[e]}sendAsync(e,t){return new Promise((r,i)=>{let n=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=t?ah(t.signal,"abort",()=>{a?.unsubscribe(),delete this.resolveRejects[n];let l={id:n,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l),i(new Dl(t.signal.reason))},R0):null;this.resolveRejects[n]={resolve:l=>{a?.unsubscribe(),r(l)},reject:l=>{a?.unsubscribe(),i(l)}};let s=[],o={...e,id:n,sourceMapId:this.mapId,origin:location.origin,data:ji(e.data,s)};this.target.postMessage(o,{transfer:s})})}receive(e){let t=e.data,r=t.id,i=["file://","resource://android","null"],n=[t.origin,location.origin],a=t.origin===location.origin,s=n.some(o=>i.includes(o));if((a||s)&&!(t.targetMapId&&this.mapId!==t.targetMapId))if(t.type==="<cancel>"){delete this.tasks[r];let o=this.abortControllers[r];delete this.abortControllers[r],o&&o.abort()}else Wr(self)||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)}process(){if(this.taskQueue.length===0)return;let e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(e,t)}async processTask(e,t){if(t.type==="<response>"){let n=this.resolveRejects[e];if(delete this.resolveRejects[e],!n)return;t.error?n.reject(fa(qi(t.error))):n.resolve(qi(t.data));return}if(!this.messageHandlers[t.type]){this.completeTask(e,null,null);return}let r=qi(t.data),i=new AbortController;this.abortControllers[e]=i;try{let n=await this.messageHandlers[t.type](t.sourceMapId,r,i);this.completeTask(e,null,n)}catch(n){this.completeTask(e,fa(n))}}completeTask(e,t,r){let i=[];delete this.abortControllers[e];let n={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?ji(t):null,data:ji(r,i)};this.target.postMessage(n,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},kh=He;new Set(Object.keys(_).filter(e=>e.startsWith("source_")).map(e=>e.slice(7).replaceAll("_","-")));function N0(e,t){let r=!1;for(let i of t)i.severity==="warning"?Pe(i.message):(e.fire(new ya(Error(i.message))),r=!0);return r}function U0(e,t,r,i){return i?.validate!==!1&&N0(e,t({styleSpec:_,...r}))}var Th=class{constructor(){this.first=!0}update(e,t){let r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))}},le=class{constructor(e,t){this.zoom=e,t?(this.now=t.now||0,this.fadeDuration=t.fadeDuration||0,this.zoomHistory=t.zoomHistory||new Th,this.transition=t.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Th,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}}},tn=class{constructor(e,t,r,i){this.property=e,this.value=t,this.expression=Qm(t===void 0?e.specification.default:t,r,e.specification,i)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}readsGlobalState(e){let t=this.getGlobalStateRefs();return e.some(r=>t.has(r))}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}},mo=class{constructor(e,t,r){this.property=e,this.value=new tn(e,void 0,t,r)}transitioned(e,t){return t.value===this.value?t:new Ch(this.property,this.value,t,Xe({},e.transition,this.transition),e.now)}untransitioned(){return new Ch(this.property,this.value,null,{},0)}},j0=class{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=r,this._rootKey=t}_propertyRootKey(e){return`${this._rootKey}.${String(e)}`}hasProperty(e){return e in this._properties.defaultTransitionablePropertyValues}getValue(e){return Zt(this._values[e].value.value)}setValue(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new mo(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].value=new tn(this._values[e].property,t===null?void 0:Zt(t),this._propertyRootKey(e),this._globalState)}setValues(e){for(let t in e){let r=e[t];t.endsWith("-transition")?this.setTransition(t.slice(0,-11),r):eo(this._values[t].value.value,r)||this.setValue(t,r)}}getTransition(e){return Zt(this._values[e].transition)}setTransition(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new mo(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].transition=Zt(t)||void 0}retainPriorGlobalState(e,t,r){for(let i of Object.keys(r._values))for(let n=r._values[i];n;n=n.prior){let{value:a}=n;a.property.specification.transition&&!a.isDataDriven()&&a.expression._globalState===this._globalState&&a.readsGlobalState(e)&&(n.value=new tn(a.property,a.value,this._propertyRootKey(i),t))}}applyGlobalStateChange(e,t,r,i){this.retainPriorGlobalState(e,t,r);let n=!1;for(let a of Object.keys(this._values)){let{value:s}=this._values[a];s.readsGlobalState(e)&&(this.setValue(a,s.value),n=!0)}return n?this.transitioned(i,r):r}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);r!==void 0&&(e[t]=r);let i=this.getTransition(t);i!==void 0&&(e[`${t}-transition`]=i)}return e}transitioned(e,t){let r=new Mh(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(e,t._values[i]);return r}untransitioned(){let e=new Mh(this._properties);for(let t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}},Ch=class{constructor(e,t,r,i,n){this.property=e,this.value=t,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,e.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){let i=e.now||0,n=this.value.possiblyEvaluate(e,t,r),a=this.prior;if(!a)return n;if(i>this.end||this.value.isDataDriven())return this.prior=null,n;if(i<this.begin)return a.possiblyEvaluate(e,t,r);{let s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,r),n,g1(s))}}},Mh=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){let i=new Xa(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}},q0=class{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._globalState=r,this._rootKey=t}_propertyRootKey(e){return`${this._rootKey}.${String(e)}`}hasValue(e){return this._values[e].value!==void 0}hasProperty(e){return e in this._properties.defaultPropertyValues}getValue(e){return Zt(this._values[e].value)}setValue(e,t){this._values[e]=new tn(this._values[e].property,t===null?void 0:Zt(t),this._propertyRootKey(e),this._globalState)}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);r!==void 0&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){let i=new Xa(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}},st=class{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,t,r,i){return this.property.evaluate(this.value,this.parameters,e,t,r,i)}},Xa=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}};function Ph(e){if(Array.isArray(e))return e.length;let t=e?.values;return Array.isArray(t)?t.length:void 0}function kf(e,t){let r=Ph(e),i=Ph(t);return r!==void 0&&i!==void 0&&r!==i}var L=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t){if(e.isDataDriven())throw Error("Value should not be data driven");return e.expression.evaluate(t)}interpolate(e,t,r){if(kf(e,t))return Pe(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),t;let i=this.specification.type,n=fr[i];return n?n(e,t,r):e}},U=class{constructor(e,t,r){this.specification=e,this.name=t,this.overrides=r}possiblyEvaluate(e,t,r,i){return e.expression.kind==="constant"||e.expression.kind==="camera"?new st(this,{kind:"constant",value:e.expression.evaluate(t,null,{},r,i)},t):new st(this,e.expression,t)}interpolate(e,t,r){if(e.value.kind!=="constant"||t.value.kind!=="constant")return e;if(e.value.value===void 0||t.value.value===void 0)return new st(this,{kind:"constant",value:void 0},e.parameters);if(kf(e.value.value,t.value.value))return Pe(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),t;let i=this.specification.type,n=fr[i];if(n){let a=n(e.value.value,t.value.value,r);return new st(this,{kind:"constant",value:a},e.parameters)}return e}evaluate(e,t,r,i,n,a){return e.kind==="constant"?e.value:e.evaluate(t,r,i,n,a)}},rn=class extends U{possiblyEvaluate(e,t,r,i){if(e.value===void 0)return new st(this,{kind:"constant",value:void 0},t);if(e.expression.kind==="constant"){let n=e.expression.evaluate(t,null,{},r,i),a=e.property.specification.type==="resolvedImage"&&typeof n!="string"?n.name:n,s=this._calculate(a,a,a,t);return new st(this,{kind:"constant",value:s},t)}if(e.expression.kind==="camera"){let n=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new st(this,{kind:"constant",value:n},t)}return new st(this,e.expression,t)}evaluate(e,t,r,i,n,a){if(e.kind==="source"){let s=e.evaluate(t,r,i,n,a);return this._calculate(s,s,s,t)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,i),e.evaluate({zoom:Math.floor(t.zoom)},r,i),e.evaluate({zoom:Math.floor(t.zoom)+1},r,i),t):e.value}_calculate(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}},Tf=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t,r,i){if(e.value!==void 0){if(e.expression.kind==="constant"){let n=e.expression.evaluate(t,null,{},r,i);return this._calculate(n,n,n,t)}return this._calculate(e.expression.evaluate(new le(Math.floor(t.zoom-1),t)),e.expression.evaluate(new le(Math.floor(t.zoom),t)),e.expression.evaluate(new le(Math.floor(t.zoom+1),t)),t)}}_calculate(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}},Za=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t,r,i){return!!e.expression.evaluate(t,null,{},r,i)}interpolate(){return!1}},qe=class{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let t in e){let r=e[t];r.specification.overridable&&this.overridableProperties.push(t);let i=this.defaultPropertyValues[t]=new tn(r,void 0,r.name,void 0),n=this.defaultTransitionablePropertyValues[t]=new mo(r,r.name,void 0);this.defaultTransitioningPropertyValues[t]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=i.possiblyEvaluate({})}}};P("DataDrivenProperty",U),P("DataConstantProperty",L),P("CrossFadedDataDrivenProperty",rn),P("CrossFadedProperty",Tf),P("ColorRampProperty",Za);var Bh=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",Os=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?",dt=class extends E1{constructor(e,t,r){if(super(),this.id=e.id,this.type=e.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=I0(this.visibility,`layers[${this.id}].layout.visibility`,r),e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=Qi(e.filter,`layers[${this.id}].filter`,r)),t.layout&&(this._unevaluatedLayout=new q0(t.layout,`layers[${this.id}].layout`,r)),t.paint)){this._transitionablePaint=new j0(t.paint,`layers[${this.id}].paint`,r);for(let i in e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(let i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Xa(t.paint)}}setFilter(e){this.filter=e,this._featureFilter=Qi(e,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){if(e==="visibility")return this.visibility;if(this._transitionablePaint?.hasProperty(e))throw Error(e+Bh);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${e}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;for(let t of this._visibilityExpression.getGlobalStateRefs())e.add(t);if(this._unevaluatedLayout)for(let t in this._unevaluatedLayout._values){let r=this._unevaluatedLayout._values[t];for(let i of r.getGlobalStateRefs())e.add(i)}for(let t of this._featureFilter.getGlobalStateRefs())e.add(t);return e}getPaintAffectingGlobalStateRefs(){let e=new globalThis.Map;if(this._transitionablePaint)for(let t in this._transitionablePaint._values){let r=this._transitionablePaint._values[t].value;for(let i of r.getGlobalStateRefs()){let n=e.get(i)??[];n.push({name:t,value:r.value}),e.set(i,n)}}return e}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,t,r={}){e==="visibility"?(this.visibility=t,this._visibilityExpression.setValue(t),this.recalculateVisibility()):this._transitionablePaint?.hasProperty(e)?this.fire(new ya(Error(e+Bh))):t!=null&&this._validate(kh.layoutProperty,`layers.${this.id}.layout.${e}`,e,t,r)||this._unevaluatedLayout.setValue(e,t)}getPaintProperty(e){if(e.endsWith("-transition")){let t=e.slice(0,-11);if(t==="visibility"||this._unevaluatedLayout?.hasProperty(t))throw Error(e+Os);return this._transitionablePaint.getTransition(t)}if(e==="visibility"||this._unevaluatedLayout?.hasProperty(e))throw Error(e+Os);return this._transitionablePaint.getValue(e)}setPaintProperty(e,t,r={}){if(e==="visibility"||this._unevaluatedLayout?.hasProperty(e))return this.fire(new ya(Error(e+Os))),!1;if(t!=null&&this._validate(kh.paintProperty,`layers.${this.id}.paint.${e}`,e,t,r))return!1;if(e.endsWith("-transition"))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{let i=this._transitionablePaint._values[e],n=i.property.specification["property-type"]==="cross-faded-data-driven",a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);let o=this._transitionablePaint._values[e].value;return o.isDataDriven()||a||n||this._handleOverridablePaintPropertyUpdate(e,s,o)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e=this.minzoom,t=!1){return this.minzoom&&e<(t?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&e>=this.maxzoom?!0:this._evaluatedVisibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}retainPriorGlobalState(e,t){this._transitionablePaint?.retainPriorGlobalState(e,t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){let e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout?.serialize(),paint:this._transitionablePaint?.serialize()};return this.visibility&&(e.layout||={},e.layout.visibility=this.visibility),w1(e,(t,r)=>t!==void 0&&!(r==="layout"&&!Object.keys(t).length)&&!(r==="paint"&&!Object.keys(t).length))}_validate(e,t,r,i,n={}){return U0(this,e,{key:t,layerType:this.type,objectKey:r,value:i},n)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let t=this.paint.get(e);if(t instanceof st&&Qr(t.property.specification)&&(t.value.kind==="source"||t.value.kind==="composite")&&t.value.isStateDependent)return!0}return!1}},G0={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},xn=class{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},ve=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function Ee(e,t=1){let r=0,i=0;return{members:e.map(n=>{let a=Y0(n.type),s=r=zh(r,Math.max(t,a)),o=n.components||1;return i=Math.max(i,a),r+=a*o,{name:n.name,type:n.type,components:o,offset:s}}),size:zh(r,Math.max(i,t)),alignment:t}}function Y0(e){return G0[e].BYTES_PER_ELEMENT}function zh(e,t){return Math.ceil(e/t)*t}var nn=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=e*2;return this.int16[i+0]=t,this.int16[i+1]=r,e}};nn.prototype.bytesPerElement=4,P("StructArrayLayout2i4",nn);var go=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=e*3;return this.int16[n+0]=t,this.int16[n+1]=r,this.int16[n+2]=i,e}};go.prototype.bytesPerElement=6,P("StructArrayLayout3i6",go);var Lh=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){let a=e*4;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,e}};Lh.prototype.bytesPerElement=8,P("StructArrayLayout4i8",Lh);var xo=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=e*6;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,e}};xo.prototype.bytesPerElement=12,P("StructArrayLayout2i4i12",xo);var vo=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.int8=new Int8Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,e,t,r,i,n,a,s,o)}emplace(e,t,r,i,n,a,s,o,l){let u=e*5,h=e*10;return this.int16[u+0]=t,this.int16[u+1]=r,this.uint8[h+4]=i,this.uint8[h+5]=n,this.uint8[h+6]=a,this.uint8[h+7]=s,this.int8[h+8]=o,this.int8[h+9]=l,e}};vo.prototype.bytesPerElement=10,P("StructArrayLayout2i4ub2b10",vo);var an=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=e*2;return this.float32[i+0]=t,this.float32[i+1]=r,e}};an.prototype.bytesPerElement=8,P("StructArrayLayout2f8",an);var bo=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l,u){let h=this.length;return this.resize(h+1),this.emplace(h,e,t,r,i,n,a,s,o,l,u)}emplace(e,t,r,i,n,a,s,o,l,u,h){let c=e*10;return this.uint16[c+0]=t,this.uint16[c+1]=r,this.uint16[c+2]=i,this.uint16[c+3]=n,this.uint16[c+4]=a,this.uint16[c+5]=s,this.uint16[c+6]=o,this.uint16[c+7]=l,this.uint16[c+8]=u,this.uint16[c+9]=h,e}};bo.prototype.bytesPerElement=20,P("StructArrayLayout10ui20",bo);var wo=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,e,t,r,i,n,a,s,o)}emplace(e,t,r,i,n,a,s,o,l){let u=e*8;return this.uint16[u+0]=t,this.uint16[u+1]=r,this.uint16[u+2]=i,this.uint16[u+3]=n,this.uint16[u+4]=a,this.uint16[u+5]=s,this.uint16[u+6]=o,this.uint16[u+7]=l,e}};wo.prototype.bytesPerElement=16,P("StructArrayLayout8ui16",wo);var _o=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l,u,h,c,p){let f=this.length;return this.resize(f+1),this.emplace(f,e,t,r,i,n,a,s,o,l,u,h,c,p)}emplace(e,t,r,i,n,a,s,o,l,u,h,c,p,f){let d=e*14,y=e*7;return this.int16[d+0]=t,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=n,this.uint16[d+4]=a,this.uint16[d+5]=s,this.uint16[d+6]=o,this.uint16[d+7]=l,this.int16[d+8]=u,this.int16[d+9]=h,this.int16[d+10]=c,this.int16[d+11]=p,this.float32[y+6]=f,e}};_o.prototype.bytesPerElement=28,P("StructArrayLayout4i4ui4i1f28",_o);var Do=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=e*3;return this.float32[n+0]=t,this.float32[n+1]=r,this.float32[n+2]=i,e}};Do.prototype.bytesPerElement=12,P("StructArrayLayout3f12",Do);var So=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let r=e*1;return this.uint32[r+0]=t,e}};So.prototype.bytesPerElement=4,P("StructArrayLayout1ul4",So);var Ao=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l){let u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,i,n,a,s,o,l)}emplace(e,t,r,i,n,a,s,o,l,u){let h=e*10,c=e*5;return this.int16[h+0]=t,this.int16[h+1]=r,this.int16[h+2]=i,this.int16[h+3]=n,this.int16[h+4]=a,this.int16[h+5]=s,this.uint32[c+3]=o,this.uint16[h+8]=l,this.uint16[h+9]=u,e}};Ao.prototype.bytesPerElement=20,P("StructArrayLayout6i1ul2ui20",Ao);var Eo=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=e*6;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,e}};Eo.prototype.bytesPerElement=12,P("StructArrayLayout2i2i2i12",Eo);var Vh=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n)}emplace(e,t,r,i,n,a){let s=e*4,o=e*8;return this.float32[s+0]=t,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,e}};Vh.prototype.bytesPerElement=16,P("StructArrayLayout2f1f2i16",Vh);var Fo=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=e*16,l=e*4,u=e*8;return this.uint8[o+0]=t,this.uint8[o+1]=r,this.float32[l+1]=i,this.float32[l+2]=n,this.int16[u+6]=a,this.int16[u+7]=s,e}};Fo.prototype.bytesPerElement=16,P("StructArrayLayout2ub2f2i16",Fo);var Io=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=e*3;return this.uint16[n+0]=t,this.uint16[n+1]=r,this.uint16[n+2]=i,e}};Io.prototype.bytesPerElement=6,P("StructArrayLayout3ui6",Io);var ko=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g){let x=this.length;return this.resize(x+1),this.emplace(x,e,t,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g)}emplace(e,t,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x){let v=e*26,b=e*13,w=e*52;return this.int16[v+0]=t,this.int16[v+1]=r,this.uint16[v+2]=i,this.uint16[v+3]=n,this.uint32[b+2]=a,this.uint32[b+3]=s,this.uint32[b+4]=o,this.uint16[v+10]=l,this.uint16[v+11]=u,this.uint16[v+12]=h,this.float32[b+7]=c,this.float32[b+8]=p,this.uint8[w+36]=f,this.uint8[w+37]=d,this.uint8[w+38]=y,this.uint32[b+10]=m,this.int16[v+22]=g,this.float32[b+12]=x,e}};ko.prototype.bytesPerElement=52,P("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52",ko);var To=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,S,D,A,E,V,M,O){let R=this.length;return this.resize(R+1),this.emplace(R,e,t,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,S,D,A,E,V,M,O)}emplace(e,t,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,S,D,A,E,V,M,O,R){let T=e*34,I=e*17;return this.int16[T+0]=t,this.int16[T+1]=r,this.int16[T+2]=i,this.int16[T+3]=n,this.int16[T+4]=a,this.int16[T+5]=s,this.int16[T+6]=o,this.int16[T+7]=l,this.uint16[T+8]=u,this.uint16[T+9]=h,this.uint16[T+10]=c,this.uint16[T+11]=p,this.uint16[T+12]=f,this.uint16[T+13]=d,this.uint16[T+14]=y,this.uint16[T+15]=m,this.uint16[T+16]=g,this.uint16[T+17]=x,this.uint16[T+18]=v,this.uint16[T+19]=b,this.uint16[T+20]=w,this.uint16[T+21]=S,this.uint16[T+22]=D,this.uint32[I+12]=A,this.float32[I+13]=E,this.float32[I+14]=V,this.uint16[T+30]=M,this.uint16[T+31]=O,this.float32[I+16]=R,e}};To.prototype.bytesPerElement=68,P("StructArrayLayout8i15ui1ul2f2ui1f68",To);var Da=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let r=e*1;return this.float32[r+0]=t,e}};Da.prototype.bytesPerElement=4,P("StructArrayLayout1f4",Da);var Co=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=e*6,a=e*3;return this.uint16[n+0]=t,this.float32[a+1]=r,this.float32[a+2]=i,e}};Co.prototype.bytesPerElement=12,P("StructArrayLayout1ui2f12",Co);var Mo=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=e*2,a=e*4;return this.uint32[n+0]=t,this.uint16[a+2]=r,this.uint16[a+3]=i,e}};Mo.prototype.bytesPerElement=8,P("StructArrayLayout1ul2ui8",Mo);var Po=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=e*2;return this.uint16[i+0]=t,this.uint16[i+1]=r,e}};Po.prototype.bytesPerElement=4,P("StructArrayLayout2ui4",Po);var Oh=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let r=e*1;return this.uint16[r+0]=t,e}};Oh.prototype.bytesPerElement=2,P("StructArrayLayout1ui2",Oh);var Bo=class extends ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){let a=e*4;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,e}};Bo.prototype.bytesPerElement=16,P("StructArrayLayout4f16",Bo);var Cf=class extends xn{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new B(this.anchorPointX,this.anchorPointY)}};Cf.prototype.size=20;var Mf=class extends Ao{get(e){return new Cf(this,e)}};P("CollisionBoxArray",Mf);var Pf=class extends xn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}get heightOffset(){return this._structArray.float32[this._pos4+12]}};Pf.prototype.size=52;var Bf=class extends ko{get(e){return new Pf(this,e)}};P("PlacedSymbolArray",Bf);var zf=class extends xn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}get heightOffset(){return this._structArray.float32[this._pos4+16]}};zf.prototype.size=68;var Lf=class extends To{get(e){return new zf(this,e)}};P("SymbolInstanceArray",Lf);var Vf=class extends Da{getoffsetX(e){return this.float32[e*1+0]}};P("GlyphOffsetArray",Vf);var Of=class extends go{getx(e){return this.int16[e*3+0]}gety(e){return this.int16[e*3+1]}gettileUnitDistanceFromAnchor(e){return this.int16[e*3+2]}};P("SymbolLineVertexArray",Of);var Rf=class extends xn{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};Rf.prototype.size=12;var $f=class extends Co{get(e){return new Rf(this,e)}};P("TextAnchorOffsetArray",$f);var Nf=class extends xn{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};Nf.prototype.size=8;var Uf=class extends Mo{get(e){return new Nf(this,e)}};P("FeatureIndexArray",Uf);var X0=class extends nn{},Z0=class extends nn{},W0=class extends nn{},H0=class extends xo{},J0=class extends vo{},K0=class extends an{},Mr=class extends bo{},Rh=class extends wo{},Q0=class extends _o{},eg=class extends Do{},tg=class extends So{},$h=class extends Eo{},rg=class extends Fo{},vn=class extends Io{},zo=class extends Po{},Lo=Ee([{name:"a_pos",components:2,type:"Int16"}],4),ig=Lo.members;Lo.size,Lo.alignment;var et=class Vr{constructor(t=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=t}prepareSegment(t,r,i,n){let a=this.segments[this.segments.length-1];return t>Vr.MAX_VERTEX_ARRAY_LENGTH&&Pe(`Max vertices per segment is ${Vr.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${Vr.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+t>Vr.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n?this.createNewSegment(r,i,n):a}createNewSegment(t,r,i){let n={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return i!==void 0&&(n.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(n),n}getOrCreateLatestSegment(t,r,i){return this.prepareSegment(0,t,r,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let t of this.segments)for(let r in t.vaos)t.vaos[r].destroy()}static simpleSegment(t,r,i,n){return new Vr([{vertexOffset:t,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};et.MAX_VERTEX_ARRAY_LENGTH=2**16-1,P("SegmentVector",et);function Nh(e,t){return e=wt(Math.floor(e),0,255),t=wt(Math.floor(t),0,255),256*e+t}var ng=Ee([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),ag=Ee([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]),sg=wl(((e,t)=>{function r(i,n){for(var a=i.length&3,s=i.length-a,o=n,l,u=3432918353,h=461845907,c,p=0;p<s;)c=i.charCodeAt(p)&255|(i.charCodeAt(++p)&255)<<8|(i.charCodeAt(++p)&255)<<16|(i.charCodeAt(++p)&255)<<24,++p,c=(c&65535)*u+(((c>>>16)*u&65535)<<16)|0,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)|0,o^=c,o=o<<13|o>>>19,l=(o&65535)*5+(((o>>>16)*5&65535)<<16)|0,o=(l&65535)+27492+(((l>>>16)+58964&65535)<<16);switch(c=0,a){case 3:c^=(i.charCodeAt(p+2)&255)<<16;case 2:c^=(i.charCodeAt(p+1)&255)<<8;case 1:c^=i.charCodeAt(p)&255,c=(c&65535)*u+(((c>>>16)*u&65535)<<16)|0,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)|0,o^=c}return o^=i.length,o^=o>>>16,o=(o&65535)*2246822507+(((o>>>16)*2246822507&65535)<<16)|0,o^=o>>>13,o=(o&65535)*3266489909+(((o>>>16)*3266489909&65535)<<16)|0,o^=o>>>16,o>>>0}t!==void 0&&(t.exports=r)})),og=wl(((e,t)=>{function r(i,n){for(var a=i.length,s=n^a,o=0,l;a>=4;)l=i.charCodeAt(o)&255|(i.charCodeAt(++o)&255)<<8|(i.charCodeAt(++o)&255)<<16|(i.charCodeAt(++o)&255)<<24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),l^=l>>>24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)^l,a-=4,++o;switch(a){case 3:s^=(i.charCodeAt(o+2)&255)<<16;case 2:s^=(i.charCodeAt(o+1)&255)<<8;case 1:s^=i.charCodeAt(o)&255,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)}return s^=s>>>13,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>15,s>>>0}t.exports=r})),Sa=f1(wl(((e,t)=>{var r=sg(),i=og();t.exports=r,t.exports.murmur3=r,t.exports.murmur2=i}))(),1),jf=class qf{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,r,i,n){this.ids.push(Uh(t)),this.positions.push(r,i,n)}getPositions(t){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let r=Uh(t),i=0,n=this.ids.length-1;for(;i<n;){let s=i+n>>1;this.ids[s]>=r?n=s:i=s+1}let a=[];for(;this.ids[i]===r;){let s=this.positions[3*i],o=this.positions[3*i+1],l=this.positions[3*i+2];a.push({index:s,start:o,end:l}),i++}return a}static serialize(t,r){let i=new Float64Array(t.ids),n=new Uint32Array(t.positions);return Vo(i,n,0,i.length-1),r&&r.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(t){let r=new qf;return r.ids=t.ids,r.positions=t.positions,r.indexed=!0,r}};function Uh(e){let t=+e;return!isNaN(t)&&t<=2**53-1?t:(0,Sa.default)(String(e))}function Vo(e,t,r,i){let n=!1;for(;r<i;){let a=e[n?r+Math.floor(Math.random()*(i-r)):r+i>>1],s=r-1,o=i+1;for(;;){do s++;while(e[s]<a);do o--;while(e[o]>a);if(s>=o)break;Yn(e,s,o),Yn(t,3*s,3*o),Yn(t,3*s+1,3*o+1),Yn(t,3*s+2,3*o+2)}n=Math.min(o-r,i-o)<i-r>>3,o-r<i-o?(Vo(e,t,r,o),r=o+1):(Vo(e,t,o+1,i),i=o)}}function Yn(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}P("FeaturePositionMap",jf);var Gl=class{constructor(e,t){this.gl=e.gl,this.location=t}},Yl=class extends Gl{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}},lg=class extends Gl{constructor(e,t){super(e,t),this.current=[0,0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}},ug=class extends Gl{constructor(e,t){super(e,t),this.current=xe.transparent}set(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}};function Oo(e){return[Nh(255*e.r,255*e.g),Nh(255*e.b,255*e.a)]}var Li=class{constructor(e,t,r){this.value=e,this.uniformNames=t.map(i=>`u_${i}`),this.type=r}setUniform(e,t,r){e.set(r.constantOr(this.value))}getBinding(e,t,r){return this.type==="color"?new ug(e,t):new Yl(e,t)}},or=class{constructor(e,t){this.uniformNames=t.map(r=>`u_${r}`),this.patternFrom=null,this.patternTo=null,this.dashFrom=null,this.dashTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,t){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,t.y,t.height,t.width]}setUniform(e,t,r,i){let n=null;i==="u_pattern_to"?n=this.patternTo:i==="u_pattern_from"?n=this.patternFrom:i==="u_dasharray_to"?n=this.dashTo:i==="u_dasharray_from"?n=this.dashFrom:i==="u_pixel_ratio_to"?n=this.pixelRatioTo:i==="u_pixel_ratio_from"&&(n=this.pixelRatioFrom),n!==null&&e.set(n)}getBinding(e,t,r){return r.startsWith("u_pattern")||r.startsWith("u_dasharray_")?new lg(e,t):new Yl(e,t)}},Tt=class{constructor(e,t,r,i){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map(n=>({name:`a_${n}`,type:"Float32",components:r==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(e,t,r){let i=this.paintVertexArray.length,n=this.expression.evaluate(new le(0,r),t,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(i,e,n)}updatePaintArray(e,t,r,i,n){let a=this.expression.evaluate(new le(0,n),r,i);this._setPaintValue(e,t,a)}_setPaintValue(e,t,r){if(this.type==="color"){let i=Oo(r);for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,i[0],i[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},ht=class{constructor(e,t,r,i,n,a){this.expression=e,this.uniformNames=t.map(s=>`u_${s}_t`),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=t.map(s=>({name:`a_${s}`,type:"Float32",components:r==="color"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,t,r){let i=this.expression.evaluate(new le(this.zoom,r),t,{},r.canonical,[],r.formattedSection),n=this.expression.evaluate(new le(this.zoom+1,r),t,{},r.canonical,[],r.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(a,e,i,n)}updatePaintArray(e,t,r,i,n){let a=this.expression.evaluate(new le(this.zoom,n),r,i),s=this.expression.evaluate(new le(this.zoom+1,n),r,i);this._setPaintValue(e,t,a,s)}_setPaintValue(e,t,r,i){if(this.type==="color"){let n=Oo(r),a=Oo(i);for(let s=e;s<t;s++)this.paintVertexArray.emplace(s,n[0],n[1],a[0],a[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}}upload(e){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t){let r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,i=wt(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(i)}getBinding(e,t,r){return new Yl(e,t)}},Gt=class{constructor(e,t,r,i,n,a){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=i,this.layerId=a,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}populatePaintArray(e,t,r){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(i,e,this.getPositionIds(t),r)}updatePaintArray(e,t,r,i,n){this._setPaintValues(e,t,this.getPositionIds(r),n)}_setPaintValues(e,t,r,i){let n=this.getPositions(i);if(!n||!r)return;let a=n[r.min],s=n[r.mid],o=n[r.max];if(a&&s&&o)for(let l=e;l<t;l++)this.emplace(this.zoomInPaintVertexArray,l,a,s),this.emplace(this.zoomOutPaintVertexArray,l,o,s)}upload(e){if(this.zoomInPaintVertexArray?.arrayBuffer.byteLength&&this.zoomOutPaintVertexArray?.arrayBuffer.byteLength){let t=this.getVertexAttributes();this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,t,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,t,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},Gf=class extends Gt{getPositions(e){return e.imagePositions}getPositionIds(e){return e.patterns?.[this.layerId]}getVertexAttributes(){return ng.members}emplace(e,t,r,i){e.emplace(t,r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],i.tlbr[0],i.tlbr[1],i.tlbr[2],i.tlbr[3],r.pixelRatio,i.pixelRatio)}},Yf=class extends Gt{getPositions(e){return e.dashPositions}getPositionIds(e){return e.dashes?.[this.layerId]}getVertexAttributes(){return ag.members}emplace(e,t,r,i){e.emplace(t,0,r.y,r.height,r.width,0,i.y,i.height,i.width)}},Xf=class{constructor(e,t,r){this.binders={},this._buffers=[];let i=[];for(let n in e.paint._values){if(!r(n))continue;let a=e.paint.get(n);if(!(a instanceof st)||!Qr(a.property.specification))continue;let s=hg(n,e.type),o=a.value,l=a.property.specification.type,u=a.property.useIntegerZoom,h=a.property.specification["property-type"],c=h==="cross-faded"||h==="cross-faded-data-driven";if(o.kind==="constant")this.binders[n]=c?new or(o.value,s):new Li(o.value,s,l),i.push(`/u_${n}`);else if(o.kind==="source"||c){let p=jh(n,l,"source");this.binders[n]=c?n==="line-dasharray"?new Yf(o,l,u,t,p,e.id):new Gf(o,l,u,t,p,e.id):new Tt(o,s,l,p),i.push(`/a_${n}`)}else{let p=jh(n,l,"composite");this.binders[n]=new ht(o,s,l,u,t,p),i.push(`/z_${n}`)}}this.cacheKey=i.sort().join("")}getMaxValue(e){let t=this.binders[e];return t instanceof Tt||t instanceof ht?t.maxValue:0}populatePaintArrays(e,t,r){for(let i in this.binders){let n=this.binders[i];(n instanceof Tt||n instanceof ht||n instanceof Gt)&&n.populatePaintArray(e,t,r)}}setConstantPatternPositions(e,t){for(let r in this.binders){let i=this.binders[r];i instanceof or&&i.setConstantPatternPositions(e,t)}}setConstantDashPositions(e,t){for(let r in this.binders){let i=this.binders[r];i instanceof or&&i.setConstantDashPositions(e,t)}}updatePaintArrays(e,t,r,i,n){let a=!1;for(let s of e){let o=t.getPositions(s.id);for(let l of o){let u=r.feature(l.index);for(let h in this.binders){let c=this.binders[h];(c instanceof Tt||c instanceof ht||c instanceof Gt)&&c.expression.isStateDependent===!0&&(c.expression=i.paint.get(h).value,c.updatePaintArray(l.start,l.end,u,s.state,n),a=!0)}}}return a}defines(){let e=[];for(let t in this.binders){let r=this.binders[t];(r instanceof Li||r instanceof or)&&e.push(...r.uniformNames.map(i=>`#define HAS_UNIFORM_${i}`))}return e}getBinderAttributes(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof Tt||r instanceof ht)for(let i of r.paintVertexAttributes)e.push(i.name);else if(r instanceof Gt){let i=r.getVertexAttributes();for(let n of i)e.push(n.name)}}return e}getBinderUniforms(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof Li||r instanceof or||r instanceof ht)for(let i of r.uniformNames)e.push(i)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof Li||n instanceof or||n instanceof ht){for(let a of n.uniformNames)if(t[a]){let s=n.getBinding(e,t[a],a);r.push({name:a,property:i,binding:s})}}}return r}setUniforms(e,t,r,i){for(let{name:n,property:a,binding:s}of t)this.binders[a].setUniform(s,i,r.get(a),n)}updatePaintBuffers(e){this._buffers=[];for(let t in this.binders){let r=this.binders[t];if(e&&r instanceof Gt){let i=e.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(r instanceof Tt||r instanceof ht)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(e){for(let t in this.binders){let r=this.binders[t];(r instanceof Tt||r instanceof ht||r instanceof Gt)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let t=this.binders[e];(t instanceof Tt||t instanceof ht||t instanceof Gt)&&t.destroy()}}},mr=class{constructor(e,t,r=()=>!0){this.programConfigurations={};for(let i of e)this.programConfigurations[i.id]=new Xf(i,t,r);this.needsUpload=!1,this._featureMap=new jf,this._bufferOffset=0}populatePaintArrays(e,t,r,i){for(let n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(e,t,i);t.id!==void 0&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(e,this._featureMap,t,n,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}};function hg(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}function cg(e){return{"line-pattern":{source:Mr,composite:Mr},"fill-pattern":{source:Mr,composite:Mr},"fill-extrusion-pattern":{source:Mr,composite:Mr},"line-dasharray":{source:Rh,composite:Rh}}[e]}function jh(e,t,r){let i={color:{source:an,composite:Bo},number:{source:Da,composite:an}};return cg(e)?.[r]||i[t][r]}P("ConstantBinder",Li),P("CrossFadedConstantBinder",or),P("SourceExpressionBinder",Tt),P("CrossFadedPatternBinder",Gf),P("CrossFadedDasharrayBinder",Yf),P("CompositeExpressionBinder",ht),P("ProgramConfiguration",Xf,{omit:["_buffers"]}),P("ProgramConfigurationSet",mr);var Ro=2**14-1,qh=-Ro-1;function br(e){let t=be/e.extent,r=e.loadGeometry();for(let i of r)for(let n of i){let a=Math.round(n.x*t),s=Math.round(n.y*t);n.x=wt(a,qh,Ro),n.y=wt(s,qh,Ro),(a<n.x||a>n.x+1||s<n.y||s>n.y+1)&&Pe("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function li(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?br(e):[]}}var Aa=class $o{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(t){return this.minX=Math.min(this.minX,t.x),this.minY=Math.min(this.minY,t.y),this.maxX=Math.max(this.maxX,t.x),this.maxY=Math.max(this.maxY,t.y),this}expandBy(t){return this.minX-=t,this.minY-=t,this.maxX+=t,this.maxY+=t,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(t){return this.expandBy(-t)}map(t){let r=new $o;return r.extend(t(new B(this.minX,this.minY))),r.extend(t(new B(this.maxX,this.minY))),r.extend(t(new B(this.minX,this.maxY))),r.extend(t(new B(this.maxX,this.maxY))),r}static fromPoints(t){let r=new $o;for(let i of t)r.extend(i);return r}contains(t){return t.x>=this.minX&&t.x<=this.maxX&&t.y>=this.minY&&t.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(t){return!this.empty()&&!t.empty()&&t.minX>=this.minX&&t.maxX<=this.maxX&&t.minY>=this.minY&&t.maxY<=this.maxY}intersects(t){return!this.empty()&&!t.empty()&&t.minX<=this.maxX&&t.maxX>=this.minX&&t.minY<=this.maxY&&t.maxY>=this.minY}};Aa.fromPoints([new B(0,0),new B(be,be)]);function Ea(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}function Gh(e){return e.every(t=>t.x<0)||e.every(t=>t.x>8192)||e.every(t=>t.y<0)||e.every(t=>t.y>8192)}function Xl(e){return e.x<0||e.x>=8192||e.y<0||e.y>=8192}var Yh=-32768;function pg(e,t,r,i,n){e.emplaceBack(Yh+t*8+i,Yh+r*8+n)}var Zl=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>t.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new Z0,this.indexArray=new vn,this.segments=new et,this.programConfigurations=new mr(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(e,t,r){let i=this.layers[0],n=[],a=null,s=!1,o=i.type==="heatmap";if(i.type==="circle"){let c=i;a=c.layout.get("circle-sort-key"),s=!a.isConstant(),o||=c.paint.get("circle-pitch-alignment")==="map"}let l=o?t.subdivisionGranularity.circle:1,u=new le(this.zoom),h=this.layers[0]._featureFilter.needGeometry;for(let{feature:c,id:p,index:f,sourceLayerIndex:d}of e){let y=li(c,h);if(!this.layers[0]._featureFilter.filter(u,y,r))continue;let m=s?a.evaluate(y,{},r):void 0,g={id:p,properties:c.properties,type:c.type,sourceLayerIndex:d,index:f,geometry:h?y.geometry:br(c),patterns:{},sortKey:m};n.push(g)}s&&n.sort((c,p)=>c.sortKey-p.sortKey);for(let c of n){let{geometry:p,index:f,sourceLayerIndex:d}=c,y=e[f].feature;this.addFeature(c,p,f,r,l),t.featureIndex.insert(y,p,f,d,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}addFeatures(e){}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ig),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,i,n=1){let a;switch(n){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${n}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let o of t)for(let l of o){let u=l.x,h=l.y;if(Xl(l))continue;let c=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,e.sortKey),p=c.vertexLength;for(let f=0;f<s;f++)for(let d=0;d<s;d++)pg(this.layoutVertexArray,u,h,a[d],a[f]);for(let f=0;f<s-1;f++)for(let d=0;d<s-1;d++){let y=p+f*s+d,m=p+(f+1)*s+d;this.indexArray.emplaceBack(y,m+1,y+1),this.indexArray.emplaceBack(y,m,m+1)}c.vertexLength+=s*s,c.primitiveLength+=(s-1)*(s-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:{},canonical:i})}};P("CircleBucket",Zl,{omit:["layers"]});function fg(e,t){for(let r of e)if(ri(t,r))return!0;for(let r of t)if(ri(e,r))return!0;return Wl(e,t)}function Wa(e,t,r){return ri(e,t)?!0:No(t,e,r)}function Zf(e,t){if(e.length===1)return Xh(t,e[0]);for(let r of t)for(let i of r)if(ri(e,i))return!0;for(let r of e)if(Xh(t,r))return!0;for(let r of t)if(Wl(e,r))return!0;return!1}function dg(e,t,r){for(let i of t){if(e.length>=3){for(let n of i)if(ri(e,n))return!0}if(yg(e,i,r))return!0}return!1}function yg(e,t,r){if(e.length>1){if(Wl(e,t))return!0;for(let i of t)if(No(i,e,r))return!0}for(let i of e)if(No(i,t,r))return!0;return!1}function Wl(e,t){if(e.length===0||t.length===0)return!1;for(let r=0;r<e.length-1;r++){let i=e[r],n=e[r+1];for(let a=0;a<t.length-1;a++){let s=t[a],o=t[a+1];if(mg(i,n,s,o))return!0}}return!1}function mg(e,t,r,i){return Wt(e,r,i)!==Wt(t,r,i)&&Wt(e,t,r)!==Wt(e,t,i)}function No(e,t,r){let i=r*r;if(t.length===1)return e.distSqr(t[0])<i;for(let n=1;n<t.length;n++){let a=t[n-1],s=t[n];if(Wf(e,a,s)<i)return!0}return!1}function Wf(e,t,r){let i=t.distSqr(r);if(i===0)return e.distSqr(t);let n=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/i;return n<0?e.distSqr(t):n>1?e.distSqr(r):e.distSqr(r.sub(t)._mult(n)._add(t))}function Xh(e,t){let r=!1,i,n,a;for(let s of e){i=s;for(let o=0,l=i.length-1;o<i.length;l=o++)n=i[o],a=i[l],n.y>t.y!=a.y>t.y&&t.x<(a.x-n.x)*(t.y-n.y)/(a.y-n.y)+n.x&&(r=!r)}return r}function ri(e,t){let r=!1;for(let i=0,n=e.length-1;i<e.length;n=i++){let a=e[i],s=e[n];a.y>t.y!=s.y>t.y&&t.x<(s.x-a.x)*(t.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function gg(e,t,r,i,n){for(let s of e)if(t<=s.x&&r<=s.y&&i>=s.x&&n>=s.y)return!0;let a=[new B(t,r),new B(t,n),new B(i,n),new B(i,r)];if(e.length>2){for(let s of a)if(ri(e,s))return!0}for(let s=0;s<e.length-1;s++){let o=e[s],l=e[s+1];if(xg(o,l,a))return!0}return!1}function xg(e,t,r){let i=r[0],n=r[2];if(e.x<i.x&&t.x<i.x||e.x>n.x&&t.x>n.x||e.y<i.y&&t.y<i.y||e.y>n.y&&t.y>n.y)return!1;let a=Wt(e,t,r[0]);return a!==Wt(e,t,r[1])||a!==Wt(e,t,r[2])||a!==Wt(e,t,r[3])}function qr(e,t,r){let i=t.paint.get(e).value;return i.kind==="constant"?i.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Ha(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Ja(e,t,r,i,n){if(!t[0]&&!t[1])return e;let a=B.convert(t)._mult(n);r==="viewport"&&a._rotate(-i);let s=[];for(let o of e)s.push(o.sub(a));return s}function vg(e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],n=t.at(-1);(r===0||n&&!i.equals(n))&&t.push(i)}return t}function bg(e,t){let r=[];for(let i of e){let n=vg(i),a=[];for(let s=0;s<n.length;s++){let o=n[s],l=n[s-1],u=n[s+1],h=s===0?new B(0,0):o.sub(l)._unit()._perp(),c=s===n.length-1?new B(0,0):u.sub(o)._unit()._perp(),p=h._add(c)._unit(),f=p.x*c.x+p.y*c.y;f!==0&&p._mult(1/f),a.push(p._mult(t)._add(o))}r.push(a)}return r}function wg({queryGeometry:e,size:t},r){return Wa(e,r,t)}function _g({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n},a){return Wa(e,a,t*(r.projectTileCoordinates(a.x,a.y,i,n?.(a.x,a.y)).signedDistanceFromCamera/r.cameraToCenterDistance))}function Dg({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n},a){let s=r.projectTileCoordinates(a.x,a.y,i,n?.(a.x,a.y)).signedDistanceFromCamera,o=t*(r.cameraToCenterDistance/s);return Wa(e,Hl(a,r,i,n),o)}function Sg({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n},a){return Wa(e,Hl(a,r,i,n),t)}function Hf({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n,pitchAlignment:a="map",pitchScale:s="map"},o){let l=a==="map"?s==="map"?wg:_g:s==="map"?Dg:Sg,u={queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n};for(let h of o)for(let c of h)if(l(u,c))return!0;return!1}function Hl(e,t,r,i){let n=t.projectTileCoordinates(e.x,e.y,r,i?.(e.x,e.y)).point;return new B((n.x*.5+.5)*t.width,(-n.y*.5+.5)*t.height)}function Ag(e,t,r,i){return e.map(n=>Hl(n,t,r,i))}var Eg,Fg=()=>Eg||=new qe({"circle-sort-key":new U(_.layout_circle["circle-sort-key"],"circle-sort-key")}),Ig,kg=()=>Ig||=new qe({"circle-radius":new U(_.paint_circle["circle-radius"],"circle-radius"),"circle-color":new U(_.paint_circle["circle-color"],"circle-color"),"circle-blur":new U(_.paint_circle["circle-blur"],"circle-blur"),"circle-opacity":new U(_.paint_circle["circle-opacity"],"circle-opacity"),"circle-translate":new L(_.paint_circle["circle-translate"],"circle-translate"),"circle-translate-anchor":new L(_.paint_circle["circle-translate-anchor"],"circle-translate-anchor"),"circle-pitch-scale":new L(_.paint_circle["circle-pitch-scale"],"circle-pitch-scale"),"circle-pitch-alignment":new L(_.paint_circle["circle-pitch-alignment"],"circle-pitch-alignment"),"circle-stroke-width":new U(_.paint_circle["circle-stroke-width"],"circle-stroke-width"),"circle-stroke-color":new U(_.paint_circle["circle-stroke-color"],"circle-stroke-color"),"circle-stroke-opacity":new U(_.paint_circle["circle-stroke-opacity"],"circle-stroke-opacity")}),Tg={get paint(){return kg()},get layout(){return Fg()}},Cg=class extends dt{constructor(e,t){super(e,Tg,t)}createBucket(e){return new Zl(e)}queryRadius(e){let t=e;return qr("circle-radius",this,t)+qr("circle-stroke-width",this,t)+Ha(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){let l=Ja(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-n.bearingInRadians,a),u=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),h=this.paint.get("circle-pitch-scale"),c=this.paint.get("circle-pitch-alignment"),p,f;return c==="map"?(p=l,f=u*a):(p=Ag(l,n,s,o),f=u),Hf({queryGeometry:p,size:f,transform:n,unwrappedTileID:s,getElevation:o,pitchAlignment:c,pitchScale:h},i)}},Jf=class extends Zl{};P("HeatmapBucket",Jf,{omit:["layers"]});var Mg,Pg=()=>Mg||=new qe({"heatmap-radius":new U(_.paint_heatmap["heatmap-radius"],"heatmap-radius"),"heatmap-weight":new U(_.paint_heatmap["heatmap-weight"],"heatmap-weight"),"heatmap-intensity":new L(_.paint_heatmap["heatmap-intensity"],"heatmap-intensity"),"heatmap-color":new Za(_.paint_heatmap["heatmap-color"],"heatmap-color"),"heatmap-opacity":new L(_.paint_heatmap["heatmap-opacity"],"heatmap-opacity")}),Bg={get paint(){return Pg()}};function Jl(e,{width:t,height:r},i,n){if(!n)n=new Uint8Array(t*r*i);else if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==t*r*i)throw RangeError(`mismatched image size. expected: ${n.length} but got: ${t*r*i}`);return e.width=t,e.height=r,e.data=n,e}function Kf(e,{width:t,height:r},i){if(t===e.width&&r===e.height)return;let n=Jl({},{width:t,height:r},i);Kl(e,n,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,t),height:Math.min(e.height,r)},i),e.width=t,e.height=r,e.data=n.data}function Kl(e,t,r,i,n,a){if(n.width===0||n.height===0)return t;if(n.width>e.width||n.height>e.height||r.x>e.width-n.width||r.y>e.height-n.height)throw RangeError("out of range source coordinates for image copy");if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw RangeError("out of range destination coordinates for image copy");let s=e.data,o=t.data;if(s===o)throw Error("srcData equals dstData, so image is already copied");for(let l=0;l<n.height;l++){let u=((r.y+l)*e.width+r.x)*a,h=((i.y+l)*t.width+i.x)*a;for(let c=0;c<n.width*a;c++)o[h+c]=s[u+c]}return t}var Uo=class Qf{constructor(t,r){Jl(this,t,1,r)}resize(t){Kf(this,t,1)}clone(){return new Qf({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,r,i,n,a){Kl(t,r,i,n,a,1)}},Ke=class ed{constructor(t,r){Jl(this,t,4,r)}resize(t){Kf(this,t,4)}replace(t,r){r?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new ed({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,r,i,n,a){Kl(t,r,i,n,a,4)}setPixel(t,r,i){let n=(t*this.width+r)*4;this.data[n+0]=Math.round(i.r*255/i.a),this.data[n+1]=Math.round(i.g*255/i.a),this.data[n+2]=Math.round(i.b*255/i.a),this.data[n+3]=Math.round(i.a*255)}};function Rs(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r+=4){let i=e[r+3];t[r+0]=Math.round(e[r+0]*i/255),t[r+1]=Math.round(e[r+1]*i/255),t[r+2]=Math.round(e[r+2]*i/255),t[r+3]=i}return t}P("AlphaImage",Uo),P("RGBAImage",Ke);function zg(e){let t={},r=e.resolution||256,i=e.clips?e.clips.length:1,n=e.image||new Ke({width:r,height:i});if(!b1(r))throw Error(`width is not a power of 2 - ${r}`);let a=(s,o,l)=>{t[e.evaluationKey]=l;let u=e.expression.evaluate(t);n.setPixel(s/4/r,o/4,u)};if(e.clips)for(let s=0,o=0;s<i;++s,o+=r*4)for(let l=0,u=0;l<r;l++,u+=4){let h=l/(r-1),{start:c,end:p}=e.clips[s],f=c*(1-h)+p*h;a(o,u,f)}else for(let s=0,o=0;s<r;s++,o+=4){let l=s/(r-1);a(0,o,l)}return n}var Lg=class extends dt{createBucket(e){return new Jf(e)}constructor(e,t){super(e,Bg,t),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=zg({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has("big-fb")&&this.heatmapFbos.delete("big-fb")}queryRadius(e){return qr("heatmap-radius",this,e)}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){return Hf({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(t,r)*a,transform:n,unwrappedTileID:s,getElevation:o},i)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&!this.isHidden()}},Vg,Og=()=>Vg||=new qe({"hillshade-illumination-direction":new L(_.paint_hillshade["hillshade-illumination-direction"],"hillshade-illumination-direction"),"hillshade-illumination-altitude":new L(_.paint_hillshade["hillshade-illumination-altitude"],"hillshade-illumination-altitude"),"hillshade-illumination-anchor":new L(_.paint_hillshade["hillshade-illumination-anchor"],"hillshade-illumination-anchor"),"hillshade-exaggeration":new L(_.paint_hillshade["hillshade-exaggeration"],"hillshade-exaggeration"),"hillshade-shadow-color":new L(_.paint_hillshade["hillshade-shadow-color"],"hillshade-shadow-color"),"hillshade-highlight-color":new L(_.paint_hillshade["hillshade-highlight-color"],"hillshade-highlight-color"),"hillshade-accent-color":new L(_.paint_hillshade["hillshade-accent-color"],"hillshade-accent-color"),"hillshade-method":new L(_.paint_hillshade["hillshade-method"],"hillshade-method"),resampling:new L(_.paint_hillshade.resampling,"resampling")}),Rg={get paint(){return Og()}},$g=class extends dt{constructor(e,t){super(e,Rg,t),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,t=this.paint.get("hillshade-illumination-altitude").values,r=this.paint.get("hillshade-highlight-color").values,i=this.paint.get("hillshade-shadow-color").values,n=Math.max(e.length,t.length,r.length,i.length);e=e.concat(Array(n-e.length).fill(e.at(-1))),t=t.concat(Array(n-t.length).fill(t.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1)));let a=t.map(sh);return{directionRadians:e.map(sh),altitudeRadians:a,shadowColor:i,highlightColor:r}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}},Ng,Ug=()=>Ng||=new qe({"color-relief-opacity":new L(_["paint_color-relief"]["color-relief-opacity"],"color-relief-opacity"),"color-relief-color":new Za(_["paint_color-relief"]["color-relief-color"],"color-relief-color"),resampling:new L(_["paint_color-relief"].resampling,"resampling")}),jg={get paint(){return Ug()}};function Xn(e){return"data"in e}var Zh=class{constructor(e,t,r,i){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this._ownedHandle=this.texture,this.update(t,i)}update(e,t,r){let{width:i,height:n}=e,a=(this.size?.[0]!==i||this.size[1]!==n)&&!r,{context:s}=this,{gl:o}=s;this.useMipmap=!!t?.useMipmap,a&&this.size&&this.format===o.RGBA&&(o.deleteTexture(this.texture),this.texture=o.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),o.bindTexture(o.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1);let l=this.format===o.RGBA&&t?.premultiply!==!1;if(a)if(this.size=[i,n],this.format===o.RGBA&&i>0&&n>0){let u=this.useMipmap?Math.floor(Math.log2(Math.max(i,n)))+1:1;if(o.texStorage2D(o.TEXTURE_2D,u,o.RGBA8,i,n),Xn(e)){s.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:h}=e;l&&h&&(h=Rs(h)),h&&o.texSubImage2D(o.TEXTURE_2D,0,0,0,i,n,o.RGBA,o.UNSIGNED_BYTE,h)}else s.pixelStoreUnpackPremultiplyAlpha.set(l),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,e)}else Xn(e)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(e,l,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(e,o));else{let{x:u,y:h}=r||{x:0,y:0};Xn(e)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(e,l,u,h,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(e,u,h,o))}this.useMipmap&&!(Xn(e)&&e.data===null)&&o.generateMipmap(o.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(e,t){t.texImage2D(t.TEXTURE_2D,0,this.format,this.format,t.UNSIGNED_BYTE,e)}_uploadRawData(e,t,r,i,n){let{data:a}=e;t&&a&&(a=Rs(a)),n.texImage2D(n.TEXTURE_2D,0,this.format,r,i,0,this.format,n.UNSIGNED_BYTE,a)}_updateDomImage(e,t,r,i){i.texSubImage2D(i.TEXTURE_2D,0,t,r,i.RGBA,i.UNSIGNED_BYTE,e)}_updateRawData(e,t,r,i,n,a,s){let{data:o}=e;t&&o&&(o=Rs(o)),s.texSubImage2D(s.TEXTURE_2D,0,r,i,n,a,s.RGBA,s.UNSIGNED_BYTE,o)}bind(e,t,r){let{context:i}=this,{gl:n}=i;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST&&r!==n.LINEAR_MIPMAP_LINEAR||this.useMipmap||(r=n.LINEAR);let a=r||e;e!==this.magFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),this.magFilter=e),a!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,a),this.minFilter=a),t!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrap=t)}generateMipmap(){if(!this.useMipmap)return;let{gl:e}=this.context;e.bindTexture(e.TEXTURE_2D,this.texture),e.generateMipmap(e.TEXTURE_2D)}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},td=class ha{static{this.byteViewCache=new WeakMap}constructor(t,r,i,n=1,a=1,s=1,o=0){if(this.uid=t,r.height!==r.width)throw RangeError("DEM tiles must be square");if(i&&!["mapbox","terrarium","custom"].includes(i)){Pe(`"${i}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=r.height;let l=this.dim=r.height-4;switch(this.data=new Uint32Array(r.data.buffer),ha.byteViewCache.set(this,new Uint8Array(this.data.buffer)),i){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,this.greenFactor=a,this.blueFactor=s,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let h=-2;h<l+2;h++){let c=this._idx(0,Math.max(0,Math.min(l-1,h)));(h<0||h>=l)&&this.data.copyWithin(this._idx(0,h),c,c+l),this.data.fill(this.data[c],this._idx(-2,h),this._idx(0,h)),this.data.fill(this.data[c+l-1],this._idx(l,h),this._idx(l+1,h)+1)}let u=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let h=0;h<l;h++)for(let c=0;c<l;c++){let p=this._idx(h,c)*4,f=this._unpackAtIndex(u,p);f>this.max&&(this.max=f),f<this.min&&(this.min=f)}}get(t,r){let i=this._getByteView(),n=this._idx(t,r)*4;return this._unpackAtIndex(i,n)}sampleBilinear(t,r){let i=Math.floor(t),n=Math.floor(r);if(i<-1||i>=this.dim||n<-1||n>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${t}, y: ${r}, dim: ${this.dim}`);let a=this._getByteView(),s=((n+2)*this.stride+i+2)*4,o=this.stride*4,l=t-i,u=r-n,h=this._unpackAtIndex(a,s),c=this._unpackAtIndex(a,s+4),p=this._unpackAtIndex(a,s+o),f=this._unpackAtIndex(a,s+o+4);return h*(1-l)*(1-u)+c*l*(1-u)+p*(1-l)*u+f*l*u}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,r){if(t<-2||t>=this.dim+2||r<-2||r>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${t}, y: ${r}, dim: ${this.dim}`);return(r+2)*this.stride+(t+2)}unpack(t,r,i){return t*this.redFactor+r*this.greenFactor+i*this.blueFactor-this.baseShift}pack(t){return rd(t,this.getUnpackVector())}getPixels(){return new Ke({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(t,r,i){if(this.dim!==t.dim)throw Error("dem dimension mismatch");let n=r*this.dim,a=r*this.dim+this.dim,s=i*this.dim,o=i*this.dim+this.dim;switch(r){case-1:n=a-2;break;case 1:a=n+2}switch(i){case-1:s=o-2;break;case 1:o=s+2}let l=-r*this.dim,u=-i*this.dim;for(let h=s;h<o;h++)for(let c=n;c<a;c++)this.data[this._idx(c,h)]=t.data[this._idx(c+l,h+u)]}_getByteView(){let t=ha.byteViewCache.get(this);return t?.buffer!==this.data.buffer&&(t=new Uint8Array(this.data.buffer),ha.byteViewCache.set(this,t)),t}_unpackAtIndex(t,r){return this.unpack(t[r],t[r+1],t[r+2])}};function rd(e,t){let r=t[0],i=t[1],n=t[2],a=t[3],s=[r,i,n].filter(h=>h!==0);if(s.length===0)return{r:0,g:0,b:0};let o=Math.min(...s),l=Math.round((e+a)/o),u=h=>h===0?0:Math.floor(l*o/h)%256;return{r:u(r),g:u(i),b:u(n)}}P("DEMData",td);var qg=class extends dt{constructor(e,t){super(e,jg,t)}_createColorRamp(e){let t={elevationStops:[],colorStops:[]},r=this._transitionablePaint._values["color-relief-color"].value.expression;if(r instanceof Ki&&r._styleExpression.expression instanceof _t){this.colorRampExpression=r;let a=r._styleExpression.expression;t.elevationStops=a.labels,t.colorStops=[];for(let s of t.elevationStops)t.colorStops.push(a.evaluate({globals:{elevation:s}}))}if(t.elevationStops.length<1&&(t.elevationStops=[0],t.colorStops=[xe.transparent]),t.elevationStops.length<2&&(t.elevationStops.push(t.elevationStops[0]+1),t.colorStops.push(t.colorStops[0])),t.elevationStops.length<=e)return t;let i={elevationStops:[],colorStops:[]},n=(t.elevationStops.length-1)/(e-1);for(let a=0;a<t.elevationStops.length-.5;a+=n)i.elevationStops.push(t.elevationStops[Math.round(a)]),i.colorStops.push(t.colorStops[Math.round(a)]);return Pe(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${e}, provided: ${t.elevationStops.length}`),i}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(e,t,r){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let i=this._createColorRamp(t),n=new Ke({width:i.colorStops.length,height:1}),a=new Ke({width:i.colorStops.length,height:1});for(let s=0;s<i.elevationStops.length;s++){let o=rd(i.elevationStops[s],r);a.setPixel(0,s,new xe(o.r/255,o.g/255,o.b/255,1)),n.setPixel(0,s,i.colorStops[s])}return this.colorRampTextures={elevationTexture:new Zh(e,a,e.gl.RGBA),colorTexture:new Zh(e,n,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}},jo=Ee([{name:"a_pos",components:2,type:"Int16"}],4),Gg=jo.members;jo.size,jo.alignment;function Fa(e,t,r){let i=r.patternDependencies,n=!1;for(let a of t){let s=a.paint.get(`${e}-pattern`);s.isConstant()||(n=!0);let o=s.constantOr(null);o&&(n=!0,i[o.to]=!0,i[o.from]=!0)}return n}function Ql(e,t,r,i,n){let{zoom:a}=i,s=n.patternDependencies;for(let o of t){let l=o.paint.get(`${e}-pattern`).value;if(l.kind!=="constant"){let u=l.evaluate({zoom:a-1},r,{},n.availableImages),h=l.evaluate({zoom:a},r,{},n.availableImages),c=l.evaluate({zoom:a+1},r,{},n.availableImages);u=u?.name?u.name:u,h=h?.name?h.name:h,c=c?.name?c.name:c,s[u]=!0,s[h]=!0,s[c]=!0,r.patterns[o.id]={min:u,mid:h,max:c}}}return r}var sn=new Set,qo=!1;function Yg(e,t,r=2){let i=t&&t.length,n=i?t[0]*r:e.length;sn.size&&sn.clear();let a=id(e,0,n,r,!0),s=[];if(!a||a.next===a.prev)return s;let o=0,l=0,u=0;if(i&&(a=Jg(e,t,a,r)),e.length>80*r){o=e[0],l=e[1];let h=o,c=l;for(let p=r;p<n;p+=r){let f=e[p],d=e[p+1];f<o&&(o=f),d<l&&(l=d),f>h&&(h=f),d>c&&(c=d)}u=Math.max(h-o,c-l),u=u===0?0:32767/u}return Go(a,s,o,l,u),s}function id(e,t,r,i,n){let a=null;if(n===hx(e,t,r,i)>0)for(let s=t;s<r;s+=i)a=Jh(s/i|0,e[s],e[s+1],a);else for(let s=r-i;s>=t;s-=i)a=Jh(s/i|0,e[s],e[s+1],a);return a&&on(a,a.next)&&(un(a),a=a.next),a}function gr(e,t=e){let r=t===e,i=e,n;do n=!1,i!==i.next&&(sn.size===0||!sn.has(i))&&(on(i,i.next)||Ie(i.prev,i,i.next)===0)?((r||i===t)&&(t=i.prev),qo=!0,un(i),i=i.prev,n=!0):(r||i!==t)&&(i=i.next,n=!r);while(n||i!==t);return t}function Go(e,t,r,i,n){n&&nx(e,r,i,n);let a=e,s=!1;for(;e.prev!==e.next;){let o=e.prev,l=e.next;if(Ie(o,e,l)<0&&(n?Zg(e,r,i,n):Xg(e)))t.push(o.i,e.i,l.i),un(e),e=l,a=l;else if(e=l,e===a){if(qo=!1,e=gr(e),qo){a=e;continue}if(!s){e=Wg(e,t),a=e,s=!0;continue}Hg(e,t,r,i,n);break}}}function Xg(e){let t=e.prev,r=e,i=e.next,n=t.x,a=r.x,s=i.x,o=t.y,l=r.y,u=i.y,h=Math.min(n,a,s),c=Math.min(o,l,u),p=Math.max(n,a,s),f=Math.max(o,l,u),d=i.next;for(;d!==t;){if(d.x>=h&&d.x<=p&&d.y>=c&&d.y<=f&&(n!==d.x||o!==d.y)&&ka(n,o,a,l,s,u,d.x,d.y)&&Ie(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Zg(e,t,r,i){let n=e.prev,a=e,s=e.next,o=n.x,l=a.x,u=s.x,h=n.y,c=a.y,p=s.y,f=Math.min(o,l,u),d=Math.min(h,c,p),y=Math.max(o,l,u),m=Math.max(h,c,p),g=Wo(f,d,t,r,i),x=Wo(y,m,t,r,i),v=e.prevZ;for(;v&&v.z>=g;){if(v.x>=f&&v.x<=y&&v.y>=d&&v.y<=m&&v!==s&&(o!==v.x||h!==v.y)&&ka(o,h,l,c,u,p,v.x,v.y)&&Ie(v.prev,v,v.next)>=0)return!1;v=v.prevZ}let b=e.nextZ;for(;b&&b.z<=x;){if(b.x>=f&&b.x<=y&&b.y>=d&&b.y<=m&&b!==s&&(o!==b.x||h!==b.y)&&ka(o,h,l,c,u,p,b.x,b.y)&&Ie(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Wg(e,t){let r=e,i=!1;do{let n=r.prev,a=r.next.next;ad(n,r,r.next,a,!1)&&ln(n,a)&&ln(a,n)&&(t.push(n.i,r.i,a.i),un(r),un(r.next),r=e=a,i=!0),r=r.next}while(r!==e);return i?gr(r):r}function Hg(e,t,r,i,n){let a=e;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&ox(a,s)){let o=sd(a,s);a=gr(a,a.next),o=gr(o,o.next),Go(a,t,r,i,n),Go(o,t,r,i,n);return}s=s.next}a=a.next}while(a!==e)}var Yo=!1;function Jg(e,t,r,i){let n=[];for(let a=0,s=t.length;a<s;a++){let o=id(e,t[a]*i,a<s-1?t[a+1]*i:e.length,i,!1);o===o.next&&sn.add(o),n.push(sx(o))}n.sort(Kg),ex(e.length/i,t.length),nd(r,r),Yo=!0;for(let a=0;a<n.length;a++)r=Qg(n[a],r);return Yo=!1,gr(r)}function Kg(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function Qg(e,t){let r=rx(e,t);if(!r)return t;let i=sd(r,e),n=i.next;return nd(r,n.next),gr(i,i.next),gr(r,r.next)}var De=new Float64Array,Ia=0,Xo=[],Zo=[];function ex(e,t){let r=Math.ceil((e+2*t)/16)+t+2;De.length<r*4&&(De=new Float64Array(r*4)),Ia=0}function nd(e,t){let r=e;do{let i=Ia++;Xo[i]=r;let n=r.x,a=r.y,s=r.x,o=r.y,l=0;do{let h=r.next;r.z=i,h.x<n&&(n=h.x),h.x>s&&(s=h.x),h.y<a&&(a=h.y),h.y>o&&(o=h.y),r=h}while(++l<16&&r!==t);Zo[i]=r;let u=i*4;De[u]=n,De[u+1]=a,De[u+2]=s,De[u+3]=o}while(r!==t)}function tx(e,t){let r=e.z*4;t.x<De[r]&&(De[r]=t.x),t.y<De[r+1]&&(De[r+1]=t.y),t.x>De[r+2]&&(De[r+2]=t.x),t.y>De[r+3]&&(De[r+3]=t.y)}function Wh(e){let t=Zo[e];for(;t.prev.next!==t;)t=t.next;return Zo[e]=t,t}function Hh(e){let t=Xo[e];for(;t.prev.next!==t;)t=t.next;return Xo[e]=t,t}function rx(e,t){let r=t,i=e.x,n=e.y,a=-1/0,s;if(on(e,r))return r;for(let p=0,f=0;p<Ia;p++,f+=4){if(n<De[f+1]||n>De[f+3]||De[f]>i||De[f+2]<=a)continue;let d=Wh(p);r=Hh(p);do{if(r.prev.next===r){if(on(e,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let y=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(y<=i&&y>a&&(a=y,s=r.x<r.next.x?r:r.next,y===i))return s}}r=r.next}while(r!==d)}if(!s)return null;let o=s.x,l=s.y,u=Math.min(n,l),h=Math.max(n,l),c=1/0;for(let p=0,f=0;p<Ia;p++,f+=4){if(De[f+2]<o||De[f]>i||De[f+3]<u||De[f+1]>h)continue;let d=Wh(p);r=Hh(p);do{if(r.prev.next===r&&i>=r.x&&r.x>=o&&i!==r.x&&ka(n<l?i:a,n,o,l,n<l?a:i,n,r.x,r.y)){let y=Math.abs(n-r.y)/(i-r.x);(ln(r,e)||r.y===n&&r.next.y===n&&r.next.x>i)&&(y<c||y===c&&(r.x>s.x||r.x===s.x&&ix(s,r)))&&(s=r,c=y)}r=r.next}while(r!==d)}return s}function ix(e,t){return Ie(e.prev,e,t.prev)<0&&Ie(t.next,e,e.next)<0}var Je=[],Or=[],ar=new Uint32Array,Ei=new Uint32Array,Fi=new Uint32Array(256);function nx(e,t,r,i){let n=e,a=0;do n.z=Wo(n.x,n.y,t,r,i),Je[a++]=n,n=n.next;while(n!==e);ax(a);let s=null;for(let o=0;o<a;o++){let l=Je[o];l.prevZ=s,s&&(s.nextZ=l),s=l}s.nextZ=null,Je.fill(null,0,a),Or.fill(null,0,a)}function ax(e){if(e<=32)for(let t=1;t<e;t++){let r=Je[t],i=r.z,n=t-1;for(;n>=0&&Je[n].z>i;)Je[n+1]=Je[n],n--;Je[n+1]=r}else{ar.length<e&&(ar=new Uint32Array(e),Ei=new Uint32Array(e),Or=Array(e));for(let t=0;t<e;t++)ar[t]=Je[t].z;Zn(e,Je,ar,Or,Ei,0),Zn(e,Or,Ei,Je,ar,8),Zn(e,Je,ar,Or,Ei,16),Zn(e,Or,Ei,Je,ar,24)}}function Zn(e,t,r,i,n,a){Fi.fill(0);for(let o=0;o<e;o++)Fi[r[o]>>>a&255]++;let s=0;for(let o=0;o<256;o++){let l=Fi[o];Fi[o]=s,s+=l}for(let o=0;o<e;o++){let l=r[o],u=Fi[l>>>a&255]++;i[u]=t[o],n[u]=l}}function Wo(e,t,r,i,n){return e=(e-r)*n|0,t=(t-i)*n|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function sx(e){let t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function ka(e,t,r,i,n,a,s,o){return(n-s)*(t-o)>=(e-s)*(a-o)&&(e-s)*(i-o)>=(r-s)*(t-o)&&(r-s)*(a-o)>=(n-s)*(i-o)}function ox(e,t){let r=on(e,t)&&Ie(e.prev,e,e.next)>0&&Ie(t.prev,t,t.next)>0;return e.next.i!==t.i&&(r||ln(e,t)&&ln(t,e)&&(Ie(e.prev,e,t.prev)!==0||Ie(e,t.prev,t)!==0))&&!lx(e,t)&&(r||ux(e,t))}function Ie(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function on(e,t){return e.x===t.x&&e.y===t.y}function ad(e,t,r,i,n=!0){let a=Ie(e,t,r),s=Ie(e,t,i),o=Ie(r,i,e),l=Ie(r,i,t);return(a>0&&s<0||a<0&&s>0)&&(o>0&&l<0||o<0&&l>0)?!0:n?!!(a===0&&Wn(e,r,t)||s===0&&Wn(e,i,t)||o===0&&Wn(r,e,i)||l===0&&Wn(r,t,i)):!1}function Wn(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function lx(e,t){let r=Math.min(e.x,t.x),i=Math.max(e.x,t.x),n=Math.min(e.y,t.y),a=Math.max(e.y,t.y),s=e;do{let o=s.next;if(s.x>i&&o.x>i||s.x<r&&o.x<r||s.y>a&&o.y>a||s.y<n&&o.y<n)s=o;else{if(s.i!==e.i&&o.i!==e.i&&s.i!==t.i&&o.i!==t.i&&ad(s,o,e,t))return!0;s=o}}while(s!==e);return!1}function ln(e,t){return Ie(e.prev,e,e.next)<0?Ie(e,t,e.next)>=0&&Ie(e,e.prev,t)>=0:Ie(e,t,e.prev)<0||Ie(e,e.next,t)<0}function ux(e,t){let r=e,i=!1,n=(e.x+t.x)/2,a=(e.y+t.y)/2;do{let s=r.next;r.y>a!=s.y>a&&n<(s.x-r.x)*(a-r.y)/(s.y-r.y)+r.x&&(i=!i),r=s}while(r!==e);return i}function sd(e,t){let r=Ho(e.i,e.x,e.y),i=Ho(t.i,t.x,t.y),n=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function Jh(e,t,r,i){let n=Ho(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function un(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),Yo&&tx(e.prev,e.next)}function Ho(e,t,r){return{i:e,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function hx(e,t,r,i){let n=0;for(let a=t,s=r-i;a<r;a+=i)n+=(e[s]-e[a])*(e[a+1]+e[s+1]),s=a;return n}var Vi=class{constructor(e,t){if(t>e)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=t}getGranularityForZoomLevel(e){let t=1<<e;return Math.max(Math.floor(this._baseZoomGranularity/t),this._minGranularity,1)}},cx=class od{constructor(t){this.fill=t.fill,this.line=t.line,this.tile=t.tile,this.stencil=t.stencil,this.circle=t.circle}static{this.noSubdivision=new od({fill:new Vi(0,0),line:new Vi(0,0),tile:new Vi(0,0),stencil:new Vi(0,0),circle:1})}};P("SubdivisionGranularityExpression",Vi),P("SubdivisionGranularitySetting",cx);var $s=-32768,Ns=32767,px=class{constructor(e,t){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=e,this._granularityCellSize=be/e,this._canonical=t}_getKey(e,t){return e+=32768,t+=32768,e<<16|t}_vertexToIndex(e,t){if(e<-32768||t<-32768||e>32767||t>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let r=Math.round(e)|0,i=Math.round(t)|0,n=this._getKey(r,i),a=this._vertexDictionary.get(n);if(a!==void 0)return a;let s=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,s),this._vertexBuffer.push(r,i),s}_subdivideTrianglesScanline(e,t){if(this._granularity<2)return yx(this._vertexBuffer,dx(e,t));let r=[],i=e.length;for(let n=0;n<i;n+=3){let a=[t[e[n+0]],t[e[n+1]],t[e[n+2]]],s=[this._vertexBuffer[a[0]*2+0],this._vertexBuffer[a[0]*2+1],this._vertexBuffer[a[1]*2+0],this._vertexBuffer[a[1]*2+1],this._vertexBuffer[a[2]*2+0],this._vertexBuffer[a[2]*2+1]],o=1/0,l=1/0,u=-1/0,h=-1/0;for(let y=0;y<3;y++){let m=s[y*2],g=s[y*2+1];o=Math.min(o,m),u=Math.max(u,m),l=Math.min(l,g),h=Math.max(h,g)}if(o===u||l===h)continue;let c=Math.floor(o/this._granularityCellSize),p=Math.ceil(u/this._granularityCellSize),f=Math.floor(l/this._granularityCellSize),d=Math.ceil(h/this._granularityCellSize);if(c===p&&f===d)r.push(...a);else for(let y=f;y<d;y++){let m=this._scanlineGenerateVertexRingForCellRow(y,s,a);mx(this._vertexBuffer,m,r)}}return r}_scanlineGenerateVertexRingForCellRow(e,t,r){let i=e*this._granularityCellSize,n=i+this._granularityCellSize,a=[];for(let s=0;s<3;s++){let o=t[s*2],l=t[s*2+1],u=t[(s+1)*2%6],h=t[((s+1)*2+1)%6],c=t[(s+2)*2%6],p=t[((s+2)*2+1)%6],f=u-o,d=h-l,y=f===0,m=d===0,g=(i-l)/d,x=(n-l)/d,v=Math.min(g,x),b=Math.max(g,x);if(!m&&(v>=1||b<=0)||m&&(l<i||l>n)){h>=i&&h<=n&&a.push(r[(s+1)%3]);continue}if(!m&&v>0){let D=o+f*v,A=l+d*v;a.push(this._vertexToIndex(D,A))}let w=o+f*Math.max(v,0),S=o+f*Math.min(b,1);if(y||this._generateIntraEdgeVertices(a,o,l,u,h,w,S),!m&&b<1){let D=o+f*b,A=l+d*b;a.push(this._vertexToIndex(D,A))}(m||h>=i&&h<=n)&&a.push(r[(s+1)%3]),!m&&(h<=i||h>=n)&&this._generateInterEdgeVertices(a,o,l,u,h,c,p,S,i,n)}return a}_generateIntraEdgeVertices(e,t,r,i,n,a,s){let o=i-t,l=n-r,u=l===0,h=u?Math.min(t,i):Math.min(a,s),c=u?Math.max(t,i):Math.max(a,s),p=Math.floor(h/this._granularityCellSize)+1,f=Math.ceil(c/this._granularityCellSize)-1;if(u?t<i:a<s)for(let d=p;d<=f;d++){let y=d*this._granularityCellSize,m=r+l*(y-t)/o;e.push(this._vertexToIndex(y,m))}else for(let d=f;d>=p;d--){let y=d*this._granularityCellSize,m=r+l*(y-t)/o;e.push(this._vertexToIndex(y,m))}}_generateInterEdgeVertices(e,t,r,i,n,a,s,o,l,u){let h=n-r,c=a-i,p=s-n,f=(l-n)/p,d=(u-n)/p,y=Math.min(f,d),m=Math.max(f,d),g=i+c*y,x=Math.floor(Math.min(g,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(g,o)/this._granularityCellSize)-1,b=o<g,w=p===0;if(w&&(s===l||s===u))return;if(w||y>=1||m<=0){let D=t-a,A=r-s,E=(l-s)/A,V=(u-s)/A,M=a+D*Math.min(E,V);x=Math.floor(Math.min(M,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(M,o)/this._granularityCellSize)-1,b=o<M}let S=h>0?u:l;if(b)for(let D=x;D<=v;D++){let A=D*this._granularityCellSize;e.push(this._vertexToIndex(A,S))}else for(let D=v;D>=x;D--){let A=D*this._granularityCellSize;e.push(this._vertexToIndex(A,S))}}_generateOutline(e,t){let r=[],i=0;for(let n of e){let a=this._granularity<2?this._ringPathIndices(n,i,t):this._pointArrayToIndices(ur(n,this._granularity,!0));i+=n.length;let s=[];for(let o=1;o<a.length;o++)s.push(a[o-1]),s.push(a[o]);r.push(s)}return r}_ringPathIndices(e,t,r){let i=r.slice(t,t+e.length);return i.length>=2&&ud(e)&&i.push(i[0]),i}_handlePoles(e){let t=!1,r=!1;this._canonical&&(this._canonical.y===0&&(t=!0),this._canonical.y===(1<<this._canonical.z)-1&&(r=!0)),(t||r)&&this._fillPoles(e,t,r)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let t=0;t<e.length;t+=2){let r=e[t+1];r===-32768&&(e[t+1]=-32767),r===32767&&(e[t+1]=32766)}}_generatePoleQuad(e,t,r,i,n,a){i>n==(a===-32768)?(e.push(r),e.push(t),e.push(this._vertexToIndex(i,a)),e.push(this._vertexToIndex(n,a)),e.push(r),e.push(this._vertexToIndex(i,a))):(e.push(t),e.push(r),e.push(this._vertexToIndex(i,a)),e.push(r),e.push(this._vertexToIndex(n,a)),e.push(this._vertexToIndex(i,a)))}_fillPoles(e,t,r){let i=this._vertexBuffer,n=be,a=e.length;for(let s=2;s<a;s+=3){let o=e[s-2],l=e[s-1],u=e[s],h=i[o*2],c=i[o*2+1],p=i[l*2],f=i[l*2+1],d=i[u*2],y=i[u*2+1];t&&(c===0&&f===0&&this._generatePoleQuad(e,o,l,h,p,$s),f===0&&y===0&&this._generatePoleQuad(e,l,u,p,d,$s),y===0&&c===0&&this._generatePoleQuad(e,u,o,d,h,$s)),r&&(c===n&&f===n&&this._generatePoleQuad(e,o,l,h,p,Ns),f===n&&y===n&&this._generatePoleQuad(e,l,u,p,d,Ns),y===n&&c===n&&this._generatePoleQuad(e,u,o,d,h,Ns))}}_initializeVertices(e){let t=[];for(let r=0;r<e.length;r+=2)t.push(this._vertexToIndex(e[r],e[r+1]));return t}subdividePolygonInternal(e,t){if(this._used)throw Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:r,holeIndices:i}=fx(e),n=this._initializeVertices(r),a;try{let o=Yg(r,i);a=this._subdivideTrianglesScanline(o,n)}catch(o){console.error(o)}let s=[];return t&&(s=this._generateOutline(e,n)),this._ensureNoPoleVertices(),this._handlePoles(a),this._granularity>=2&&this._canonical?.z===0&&(a=this._removeTrianglesOutsideTileX(a),s=s.map(o=>this._removeLinesOutsideTileX(o))),{verticesFlattened:this._vertexBuffer,indicesTriangles:a,indicesLineList:s}}_vertexOutsideTileX(e){let t=this._vertexBuffer[e*2];return t<0||t>8192}_removeTrianglesOutsideTileX(e){let t=[];for(let r=0;r<e.length;r+=3)this._vertexOutsideTileX(e[r])||this._vertexOutsideTileX(e[r+1])||this._vertexOutsideTileX(e[r+2])||t.push(e[r],e[r+1],e[r+2]);return t}_removeLinesOutsideTileX(e){let t=[];for(let r=0;r<e.length;r+=2)this._vertexOutsideTileX(e[r])||this._vertexOutsideTileX(e[r+1])||t.push(e[r],e[r+1]);return t}_pointArrayToIndices(e){let t=[];for(let r of e)t.push(this._vertexToIndex(r.x,r.y));return t}};function ld(e,t,r,i=!0){return new px(r,t).subdividePolygonInternal(e,i)}function ur(e,t,r=!1){if(!e||e.length<1||e.length<2)return[];let i=r&&ud(e);if(t<2)return i?[...e,e[0]]:[...e];let n=Math.floor(be/t),a=[];a.push(new B(e[0].x,e[0].y));let s=e.length,o=i?s:s-1;for(let l=0;l<o;l++){let u=e[l],h=l<s-1?e[l+1]:e[0],c=u.x,p=u.y,f=h.x,d=h.y,y=c!==f,m=p!==d;if(!y&&!m)continue;let g=f-c,x=d-p,v=Math.abs(g),b=Math.abs(x),w=c,S=p;for(;;){let A=g>0?(Math.floor(w/n)+1)*n:(Math.ceil(w/n)-1)*n,E=x>0?(Math.floor(S/n)+1)*n:(Math.ceil(S/n)-1)*n,V=Math.abs(w-A),M=Math.abs(S-E),O=Math.abs(w-f),R=Math.abs(S-d),T=y?V/v:1/0,I=m?M/b:1/0;if((O<=V||!y)&&(R<=M||!m))break;if(T<I&&y||!m){w=A,S+=x*T;let z=new B(w,Math.round(S));(a[a.length-1].x!==z.x||a[a.length-1].y!==z.y)&&a.push(z)}else{w+=g*I,S=E;let z=new B(Math.round(w),S);(a[a.length-1].x!==z.x||a[a.length-1].y!==z.y)&&a.push(z)}}let D=new B(f,d);(a[a.length-1].x!==D.x||a[a.length-1].y!==D.y)&&a.push(D)}return a}function ud(e){return!e[0].equals(e[e.length-1])}function fx(e){let t=[],r=[];for(let i of e)if(i.length!==0){i!==e[0]&&t.push(r.length/2);for(let n of i)r.push(n.x),r.push(n.y)}return{flattened:r,holeIndices:t}}function dx(e,t){let r=Array(e.length);for(let i=0;i<e.length;i++)r[i]=t[e[i]];return r}function yx(e,t){let r=[];for(let i=0;i<t.length;i+=3){let n=t[i],a=t[i+1],s=t[i+2],o=e[n*2],l=e[n*2+1],u=e[a*2],h=e[a*2+1],c=e[s*2],p=e[s*2+1],f=u-o,d=h-l,y=c-o;f*(p-l)-d*y>0?(r.push(n),r.push(s),r.push(a)):(r.push(n),r.push(a),r.push(s))}return r}function mx(e,t,r){if(t.length===0)throw Error("Subdivision vertex ring is empty.");let i=0,n=e[t[0]*2];for(let l=1;l<t.length;l++){let u=e[t[l]*2];u<n&&(n=u,i=l)}let a=t.length,s=i,o=(s+1)%a;for(;;){let l=s-1>=0?s-1:a-1,u=(o+1)%a,h=e[t[l]*2],c=e[t[l]*2+1],p=e[t[u]*2],f=e[t[u]*2+1],d=e[t[s]*2],y=e[t[s]*2+1],m=e[t[o]*2],g=e[t[o]*2+1],x=!1;if(h<p)x=!0;else if(h>p)x=!1;else{let v=g-y,b=-(m-d),w=y<g?1:-1;((h-d)*v+(c-y)*b)*w>((p-d)*v+(f-y)*b)*w&&(x=!0)}if(x){let v=t[l],b=t[s],w=t[o];v!==b&&v!==w&&b!==w&&r.push(w,b,v),s--,s<0&&(s=a-1)}else{let v=t[u],b=t[s],w=t[o];v!==b&&v!==w&&b!==w&&r.push(w,b,v),o++,o>=a&&(o=0)}if(l===u)break}}function hd(e,t,r,i,n,a,s,o,l){let u=n.length/2,h=s&&o&&l;if(u<et.MAX_VERTEX_ARRAY_LENGTH){let c=t.prepareSegment(u,r,i),p=c.vertexLength;for(let y=0;y<a.length;y+=3)i.emplaceBack(p+a[y],p+a[y+1],p+a[y+2]);c.vertexLength+=u,c.primitiveLength+=a.length/3;let f,d;h&&(d=s.prepareSegment(u,r,o),f=d.vertexLength,d.vertexLength+=u);for(let y=0;y<n.length;y+=2)e(n[y],n[y+1]);if(h)for(let y of l){for(let m=1;m<y.length;m+=2)o.emplaceBack(f+y[m-1],f+y[m]);d.primitiveLength+=y.length/2}}else gx(t,r,i,n,a,e),h&&xx(s,r,o,n,l,e),t.forceNewSegmentOnNextPrepare(),s?.forceNewSegmentOnNextPrepare()}function Gi(e,t,r,i,n,a,s){if(a){let o=i.count;return r(t[n*2],t[n*2+1]),e[n]=i.count,i.count++,s.vertexLength++,o}return e[n]}function gx(e,t,r,i,n,a){let s=[];for(let c=0;c<i.length/2;c++)s.push(-1);let o={count:0},l=0,u=e.getOrCreateLatestSegment(t,r),h=u.vertexLength;for(let c=2;c<n.length;c+=3){let p=n[c-2],f=n[c-1],d=n[c],y=s[p]<l,m=s[f]<l,g=s[d]<l,x=+!!y+ +!!m+ +!!g;u.vertexLength+x>et.MAX_VERTEX_ARRAY_LENGTH&&(u=e.createNewSegment(t,r),l=o.count,y=!0,m=!0,g=!0,h=0);let v=Gi(s,i,a,o,p,y,u),b=Gi(s,i,a,o,f,m,u),w=Gi(s,i,a,o,d,g,u);r.emplaceBack(h+v-l,h+b-l,h+w-l),u.primitiveLength++}}function xx(e,t,r,i,n,a){let s=[];for(let c=0;c<i.length/2;c++)s.push(-1);let o={count:0},l=0,u=e.getOrCreateLatestSegment(t,r),h=u.vertexLength;for(let c of n)for(let p=1;p<c.length;p+=2){let f=c[p-1],d=c[p],y=s[f]<l,m=s[d]<l,g=+!!y+ +!!m;u.vertexLength+g>et.MAX_VERTEX_ARRAY_LENGTH&&(u=e.createNewSegment(t,r),l=o.count,y=!0,m=!0,h=0);let x=Gi(s,i,a,o,f,y,u),v=Gi(s,i,a,o,d,m,u);r.emplaceBack(h+x-l,h+v-l),u.primitiveLength++}}var cd=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>t.id),this.index=e.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new W0,this.indexArray=new vn,this.indexArray2=new zo,this.programConfigurations=new mr(e.layers,e.zoom),this.segments=new et,this.segments2=new et,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(e,t,r){this.hasDependencies=Fa("fill",this.layers,t);let i=this.layers[0].layout.get("fill-sort-key"),n=!i.isConstant(),a=[],s=new le(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of e){let p=li(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r,t.availableImages):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?p.geometry:br(l),patterns:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:h,sourceLayerIndex:c}=l;if(this.hasDependencies){let f=Ql("fill",this.layers,l,{zoom:this.zoom},t);this.patternFeatures.push(f)}else this.addFeature(l,u,h,r,{},t.subdivisionGranularity);let p=e[h].feature;t.featureIndex.insert(p,u,h,c,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}addFeatures({options:e,canonical:t,patternPositions:r,patternMap:i}){this.detectSdfPatterns(i);for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,t,r,e.subdivisionGranularity)}detectSdfPatterns(e){for(let t of this.patternFeatures)for(let r in t.patterns){let i=t.patterns[r];this.recordSdfPattern(r,e[i.min]),this.recordSdfPattern(r,e[i.mid]),this.recordSdfPattern(r,e[i.max])}for(let t of this.layers){let r=t.paint.get("fill-pattern").constantOr(null);r&&(this.recordSdfPattern(t.id,e[r.from.toString()]),this.recordSdfPattern(t.id,e[r.to.toString()]))}}recordSdfPattern(e,t){if(!t)return;let r=t.sdf===!0,i=this.sdfPatterns[e];i===void 0?this.sdfPatterns[e]=r:i!==r&&Pe(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer "${e}"`)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Gg),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,r,i,n,a){for(let s of Na(t,500)){let o=ld(s,i,a.fill.getGranularityForZoomLevel(i.z)),l=this.layoutVertexArray;hd((u,h)=>{l.emplaceBack(u,h)},this.segments,this.layoutVertexArray,this.indexArray,o.verticesFlattened,o.indicesTriangles,this.segments2,this.indexArray2,o.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:n,canonical:i})}};P("FillBucket",cd,{omit:["layers","patternFeatures"]});var vx,bx=()=>vx||=new qe({"fill-sort-key":new U(_.layout_fill["fill-sort-key"],"fill-sort-key")}),wx,_x=()=>wx||=new qe({"fill-antialias":new L(_.paint_fill["fill-antialias"],"fill-antialias"),"fill-opacity":new U(_.paint_fill["fill-opacity"],"fill-opacity"),"fill-layer-opacity":new L(_.paint_fill["fill-layer-opacity"],"fill-layer-opacity"),"fill-layer-blend":new L(_.paint_fill["fill-layer-blend"],"fill-layer-blend"),"fill-color":new U(_.paint_fill["fill-color"],"fill-color"),"fill-outline-color":new U(_.paint_fill["fill-outline-color"],"fill-outline-color"),"fill-translate":new L(_.paint_fill["fill-translate"],"fill-translate"),"fill-translate-anchor":new L(_.paint_fill["fill-translate-anchor"],"fill-translate-anchor"),"fill-pattern":new rn(_.paint_fill["fill-pattern"],"fill-pattern")}),Dx={get paint(){return _x()},get layout(){return bx()}},Sx=class extends dt{constructor(e,t){super(e,Dx,t)}recalculate(e,t){super.recalculate(e,t);let r=this.paint._values["fill-outline-color"];r.value.kind==="constant"&&r.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new cd(e)}queryRadius(){return Ha(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:t,transform:r,pixelsToTileUnits:i}){return Zf(Ja(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-r.bearingInRadians,i),t)}isTileClipped(){return!0}},Jo=Ee([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Ax=Ee([{name:"a_centroid",components:2,type:"Int16"}],4),Ex=Jo.members;Jo.size,Jo.alignment;var bn=class{constructor(e,t,r,i,n){for(this.properties=Object.create(null),this.extent=r,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=n;e.pos<t;){let a=e.readVarint();if(a===8)this.id=e.readVarint();else if(a===18){let s=e.readVarint()+e.pos;for(;e.pos<s;){let o=i[e.readVarint()],l=n[e.readVarint()];this.properties[o]=l}}else a===24?this.type=e.readVarint():(a===34&&(this._geometry=e.pos),e.skip(a))}}loadGeometry(){if(this._geometry<0)throw Error("feature has no geometry");let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,r=[],i,n=1,a=0,s=0,o=0;for(;e.pos<t;){if(a<=0){let l=e.readVarint();if(n=l&7,a=l>>3,a===0)continue}if(a--,n===1)s+=e.readSVarint(),o+=e.readSVarint(),i&&r.push(i),i=[new B(s,o)];else if(n===2)s+=e.readSVarint(),o+=e.readSVarint(),i&&i.push(new B(s,o));else if(n===7)i&&i.push(i[0].clone());else throw Error(`unknown command ${n}`)}return i&&r.push(i),r}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,l=1/0,u=-1/0;for(;e.pos<t;){if(i<=0){let h=e.readVarint();if(r=h&7,i=h>>3,i===0)continue}if(i--,r===1||r===2)n+=e.readSVarint(),a+=e.readSVarint(),n<s&&(s=n),n>o&&(o=n),a<l&&(l=a),a>u&&(u=a);else if(r!==7)throw Error(`unknown command ${r}`)}return[s,l,o,u]}toGeoJSON(e,t,r){let i=this.extent*2**r,n=this.extent*e,a=this.extent*t,s=this.loadGeometry();function o(c){return[(c.x+n)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(c.y+a)*2/i)*Math.PI))-90]}function l(c){return c.map(o)}let u;if(this.type===1){let c=[];for(let f of s)c.push(f[0]);let p=l(c);u=c.length===1?{type:"Point",coordinates:p[0]}:{type:"MultiPoint",coordinates:p}}else if(this.type===2){let c=s.map(l);u=c.length===1?{type:"LineString",coordinates:c[0]}:{type:"MultiLineString",coordinates:c}}else if(this.type===3){let c=pd(s),p=[];for(let f of c)p.push(f.map(l));u=p.length===1?{type:"Polygon",coordinates:p[0]}:{type:"MultiPolygon",coordinates:p}}else throw Error("unknown feature type");let h={type:"Feature",geometry:u,properties:this.properties};return this.id!=null&&(h.id=this.id),h}};bn.types=["Unknown","Point","LineString","Polygon"];function pd(e){let t=e.length;if(t<=1)return[e];let r=[],i,n;for(let a=0;a<t;a++){let s=Fx(e[a]);s!==0&&(n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[e[a]]):i&&i.push(e[a]))}return i&&r.push(i),r}function Fx(e){let t=0;for(let r=0,i=e.length,n=i-1,a,s;r<i;n=r++)a=e[r],s=e[n],t+=(s.x-a.x)*(a.y+s.y);return t}var Ix=class{constructor(e,t){for(this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],t===void 0&&(t=e.length);e.pos<t;){let r=e.readVarint();r===10?this.name=e.readString():r===18?(this._features.push(e.pos),e.skip(r)):r===26?this._keys.push(e.readString()):r===34?this._values.push(kx(e)):r===40?this.extent=e.readVarint():r===120?this.version=e.readVarint():e.skip(r)}this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[e];let t=this._pbf.readVarint()+this._pbf.pos;return new bn(this._pbf,t,this.extent,this._keys,this._values)}};function kx(e){let t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){let i=e.readVarint();t=i===10?e.readString():i===21?e.readFloat():i===25?e.readDouble():i===32?e.readVarint(!0):i===40?e.readVarint():i===48?e.readSVarint():i===56?e.readBoolean():(e.skip(i),null)}if(t==null)throw Error("unknown feature value");return t}var fd=class{constructor(e,t=e.length){let r=Object.create(null);for(;e.pos<t;){let i=e.readVarint();if(i===26){let n=new Ix(e,e.readVarint()+e.pos);n.length&&(r[n.name]=n)}else e.skip(i)}this.layers=r}},dd=63710088e-1,Ta=class Oi{constructor(t,r){if(isNaN(t)||isNaN(r))throw Error(`Invalid LngLat object: (${t}, ${r})`);if(this.lng=+t,this.lat=+r,this.lat>90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Oi(v1(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){let r=Math.PI/180,i=this.lat*r,n=t.lat*r,a=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((t.lng-this.lng)*r);return dd*Math.acos(Math.min(a,1))}static convert(t){if(t instanceof Oi)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new Oi(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t)return new Oi(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}},Us=6378137,Ko={origin:[-Math.PI*Us,Math.PI*Us],extentAtZoom0:2*Math.PI*Us},eu=2*Math.PI*dd;function yd(e){return eu*Math.cos(e*Math.PI/180)}function md(e){return(180+e)/360}function gd(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Qo(e,t){return e/yd(t)}function xd(e){return e*360-180}function hn(e){let t=180-e*360;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}function Tx(e,t){return e*yd(hn(t))}function vd(e){return 1/Math.cos(e*Math.PI/180)}var wn=class bd{constructor(t,r,i=0){this.x=+t,this.y=+r,this.z=+i}static fromLngLat(t,r=0){let i=Ta.convert(t);return new bd(md(i.lng),gd(i.lat),Qo(r,i.lat))}toLngLat(){return new Ta(xd(this.x),hn(this.y))}toAltitude(){return Tx(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/eu*vd(hn(this.y))}},Cx=new class{constructor(){this.name="mercator",this.wraps=!0,this.tileMatrixSet=Ko}worldFromLngLat(e,t,r){return new wn(md(e),gd(t),r===void 0?0:Qo(r,t))}lngLatFromWorld(e,t){return new Ta(xd(e),hn(t))}hasLngLat(e,t){return!0}metersPerWorldUnit(e,t){return 1/(1/eu*vd(hn(t)))}worldZFromAltitude(e,t){return Qo(e,t.lat)}};function Mx(e,t,r){let i=1/(1<<r.z);return new wn(e/be*i+r.x*i,t/be*i+r.y*i)}function Px(e,t,r){return Mx(e,t,r).toLngLat()}function Bx(e,t){return t<=0||!e||e.length===0?e:e.map(r=>Ox(r,t))}function zx(e,t){let r=Px(be/2,be/2,t),i=wn.fromLngLat(r).meterInMercatorCoordinateUnits(),n=(1<<t.z)*be;return e*i*n}var Lx=Math.cos(35*Math.PI/180);function Vx(e){let t=[null];for(let a=1;a<e.length;a++){let s=e[a].sub(e[a-1]),o=!Ea(e[a],e[a-1])&&s.mag()>0;t.push(o?s._perp():null)}let r=e.length-1,i=r>1&&e[0].equals(e[r]),n=[null];for(let a=1;a<=r;a++){let s=t[a];if(!s){n.push(null);continue}let o=i&&a===1?t[r]:t[a-1],l=i&&a===r?t[1]:t[a+1];n.push({start:Kh(s,o),end:Kh(s,l)})}return n}function Kh(e,t){if(!t)return e.unit();let r=e.mag(),i=t.mag();return e.x*t.x+e.y*t.y<Lx*r*i||r>=2*i?e.unit():i>=2*r?t.unit():e.add(t)._unit()}function Ox(e,t){if(!e||e.length<3)return e;let r=e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y,i=r?e.length-1:e.length;if(i<3)return e;let n=[],a=Ea(e[i-1],e[0]);for(let o=0;o<i;o++){let l=e[(o-1+i)%i],u=e[o],h=e[(o+1)%i],c=Ea(u,h);a||c?n.push(u.clone()):$x(n,l,u,h,t),a=c}let s=Rx(n);return s.length<3?e:(r&&s.push(s[0].clone()),s)}function Rx(e){let t=[];for(let r of e){let i=r.round(),n=t[t.length-1];(n?.x!==i.x||n?.y!==i.y)&&t.push(i)}for(;t.length>1&&t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y;)t.pop();return t}function $x(e,t,r,i,n){let a=t.sub(r),s=i.sub(r),o=a.mag(),l=s.mag();if(o<1e-6||l<1e-6){e.push(r.clone());return}a._div(o),s._div(l);let u=a.x*s.x+a.y*s.y;if(Math.abs(u)>Math.cos(5*Math.PI/180)){e.push(r.clone());return}let h=.2,c=Math.min(n,o*h,l*h),p=r.add(a.mult(c)),f=r.add(s.mult(c)),d=Math.sqrt((1+u)/2),y=r.add(a.add(s)._unit()._mult(c/d)),m=p.sub(y).angleWith(f.sub(y)),g=Math.max(2,Math.ceil(Math.abs(m)/(Math.PI/6)-1e-6));for(let x=0;x<=g;x++)e.push(p.rotateAround(x/g*m,y))}var js=8192;function Ii(e,t,r,i,n,a,s,o){e.emplaceBack(t,r,Math.floor(i*js)*2+s,n*js*2,a*js*2,Math.round(o))}var wd=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>t.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new H0,this.centroidVertexArray=new X0,this.indexArray=new vn,this.programConfigurations=new mr(e.layers,e.zoom),this.segments=new et,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(e,t,r){this.features=[],this.hasDependencies=Fa("fill-extrusion",this.layers,t);let i=new le(this.zoom),n=this.layers[0],a=n.layout.get("fill-extrusion-rounded-corner-distance"),s=a>0?zx(a,r):0,o=n._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of e){let p=li(l,o);if(!n._featureFilter.filter(i,p,r))continue;let f={id:u,sourceLayerIndex:c,index:h,geometry:Bx(o?p.geometry:br(l),s),properties:l.properties,type:l.type,patterns:{}};this.hasDependencies?this.features.push(Ql("fill-extrusion",this.layers,f,{zoom:this.zoom},t)):this.addFeature(f,f.geometry,h,r,{},t.subdivisionGranularity),t.featureIndex.insert(l,f.geometry,h,c,this.index,!0)}}addFeatures({options:e,canonical:t,patternPositions:r}){for(let i of this.features){let{geometry:n}=i;this.addFeature(i,n,i.index,t,r,e.subdivisionGranularity)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ex),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Ax.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,r,i,n,a){for(let s of Na(t,500)){let o={x:0,y:0,sampleCount:0},l=this.layoutVertexArray.length;this.processPolygon(o,i,e,s,a);let u=this.layoutVertexArray.length-l,h=Math.floor(o.x/o.sampleCount),c=Math.floor(o.y/o.sampleCount);for(let p=0;p<u;p++)this.centroidVertexArray.emplaceBack(h,c)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:n,canonical:i})}processPolygon(e,t,r,i,n){if(i.length<1||Gh(i[0]))return;for(let h of i)h.length!==0&&Nx(e,h);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},s=n.fill.getGranularityForZoomLevel(t.z),o=bn.types[r.type]==="Polygon";for(let h of i){if(h.length===0||Gh(h))continue;let c=ur(h,s,o);this._generateSideFaces(c,a)}if(!o)return;let l=ld(i,t,s,!1),u=this.layoutVertexArray;hd((h,c)=>{Ii(u,h,c,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(e,t){let r=0,i=this.layers[0].layout.get("fill-extrusion-rounded-corner-distance")>0?Vx(e):null;for(let n=1;n<e.length;n++){let a=e[n],s=e[n-1];if(Ea(a,s)||i&&!i[n])continue;t.segment.vertexLength+4>et.MAX_VERTEX_ARRAY_LENGTH&&(t.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let o=a.sub(s)._perp()._unit(),{start:l,end:u}=i?i[n]:{start:o,end:o},h=s.dist(a);r+h>32768&&(r=0),Ii(this.layoutVertexArray,a.x,a.y,u.x,u.y,0,0,r),Ii(this.layoutVertexArray,a.x,a.y,u.x,u.y,0,1,r),r+=h,Ii(this.layoutVertexArray,s.x,s.y,l.x,l.y,0,0,r),Ii(this.layoutVertexArray,s.x,s.y,l.x,l.y,0,1,r);let c=t.segment.vertexLength;this.indexArray.emplaceBack(c,c+2,c+1),this.indexArray.emplaceBack(c+1,c+2,c+3),t.segment.vertexLength+=4,t.segment.primitiveLength+=2}}};function Nx(e,t){for(let r=0;r<t.length;r++){let i=t[r];(r!==t.length-1||t[0].x!==i.x||t[0].y!==i.y)&&(e.x+=i.x,e.y+=i.y,e.sampleCount++)}}P("FillExtrusionBucket",wd,{omit:["layers","features"]});var Ux,jx=()=>Ux||=new qe({"fill-extrusion-rounded-corner-distance":new L(_["layout_fill-extrusion"]["fill-extrusion-rounded-corner-distance"],"fill-extrusion-rounded-corner-distance")}),qx,Gx=()=>qx||=new qe({"fill-extrusion-opacity":new L(_["paint_fill-extrusion"]["fill-extrusion-opacity"],"fill-extrusion-opacity"),"fill-extrusion-color":new U(_["paint_fill-extrusion"]["fill-extrusion-color"],"fill-extrusion-color"),"fill-extrusion-translate":new L(_["paint_fill-extrusion"]["fill-extrusion-translate"],"fill-extrusion-translate"),"fill-extrusion-translate-anchor":new L(_["paint_fill-extrusion"]["fill-extrusion-translate-anchor"],"fill-extrusion-translate-anchor"),"fill-extrusion-pattern":new rn(_["paint_fill-extrusion"]["fill-extrusion-pattern"],"fill-extrusion-pattern"),"fill-extrusion-height":new U(_["paint_fill-extrusion"]["fill-extrusion-height"],"fill-extrusion-height"),"fill-extrusion-base":new U(_["paint_fill-extrusion"]["fill-extrusion-base"],"fill-extrusion-base"),"fill-extrusion-vertical-gradient":new L(_["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"],"fill-extrusion-vertical-gradient")}),Yx={get paint(){return Gx()},get layout(){return jx()}},Xx=class extends dt{constructor(e,t){super(e,Yx,t)}createBucket(e){return new wd(e)}queryRadius(){return Ha(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:s}){let o=Ja(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-n.bearingInRadians,a),l=this.paint.get("fill-extrusion-height").evaluate(t,r),u=this.paint.get("fill-extrusion-base").evaluate(t,r),h=o.map(c=>qs(c,0,n,s));return Zx(i.map(c=>c.map(p=>qs(p,u,n,s))),i.map(c=>c.map(p=>qs(p,l,n,s))),h)}};function qs(e,t,r,i){let{point:n,signedDistanceFromCamera:a}=r.projectTileCoordinates(e.x,e.y,i,t),s=n;return s.z=a,s}function ki(e,t){return e.x*t.x+e.y*t.y}function Qh(e,t){if(e.length===1){let r=0,i=t[r++],n;for(;!n||i.equals(n);)if(n=t[r++],!n)return 1/0;for(;r<t.length;r++){let a=t[r],s=e[0],o=n.sub(i),l=a.sub(i),u=s.sub(i),h=ki(o,o),c=ki(o,l),p=ki(l,l),f=ki(u,o),d=ki(u,l),y=h*p-c*c,m=(p*f-c*d)/y,g=(h*d-c*f)/y,x=1-m-g,v=i.z*x+n.z*m+a.z*g;if(isFinite(v))return v}return 1/0}{let r=1/0;for(let i of t)r=Math.min(r,i.z);return r}}function Zx(e,t,r){let i=1/0;Zf(r,t)&&(i=Qh(r,t[0]));for(let n=0;n<t.length;n++){let a=t[n],s=e[n];for(let o=0;o<a.length-1;o++){let l=a[o],u=a[o+1],h=s[o],c=[l,u,s[o+1],h,l];fg(r,c)&&(i=Math.min(i,Qh(r,c)))}}return i!==1/0&&i}function Wx(e,t,r,i){let n=[t,r];for(;n.length;)r=n.pop(),t=n.pop(),Hx(e,t,r,i,n)}function Hx(e,t,r,i,n){let a=i,s=t+(r-t>>1),o=r-t,l,u=e[t],h=e[t+1],c=e[r],p=e[r+1];for(let f=t+3;f<r;f+=3){let d=Jx(e[f],e[f+1],u,h,c,p);if(d>a)l=f,a=d;else if(d===a){let y=Math.abs(f-s);y<o&&(l=f,o=y)}}a>i&&(e[l+2]=a,l-t>3&&n.push(t,l),r-l>3&&n.push(l,r))}function Jx(e,t,r,i,n,a){let s=n-r,o=a-i;if(s!==0||o!==0){let l=((e-r)*s+(t-i)*o)/(s*s+o*o);l>1?(r=n,i=a):l>0&&(r+=s*l,i+=o*l)}return s=e-r,o=t-i,s*s+o*o}function Me(e,t,r,i){let n={type:t,geom:r},a={id:e??null,type:n.type,geometry:n.geom,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(n.type){case"Point":case"MultiPoint":Ti(a,n.geom);break;case"LineString":Ti(a,n.geom.points);break;case"Polygon":Ti(a,n.geom[0].points);break;case"MultiLineString":for(let s of n.geom)Ti(a,s.points);break;case"MultiPolygon":for(let s of n.geom)Ti(a,s[0].points)}return a}function tu(e){let t=e;e.points.length>64&&(t.points=new Float64Array(e.points))}function Ti(e,t){for(let r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1])}var Kx=class{projectX(e){return e/360+.5}projectY(e){let t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}unprojectX(e){return(e-.5)*360}unprojectY(e){let t=(180-e*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}},Qx=class{projectX(e){return e}projectY(e){return e}unprojectX(e){return e}unprojectY(e){return e}},Ka=new Kx,e2=new Qx;function ru(e){return e==="unitSquare"?e2:Ka}function iu(e,t,r){let i=[];switch(e.type){case"FeatureCollection":for(let n=0;n<e.features.length;n++)Gs(i,e.features[n],t,r,n);break;case"Feature":Gs(i,e,t,r);break;default:Gs(i,{type:"Feature",geometry:e,properties:void 0},t,r)}return i}function Gs(e,t,r,i,n){let a=e.length;if(_d(e,t,r,n),!i)return;let s=Dd(t,r,n);s!=null&&(e.length>a?i.delete(s):i.set(s,{...t,id:s}))}function _d(e,t,r,i,n=0){if(!t.geometry)return;if(n>1024)throw Error("GeometryCollection nesting exceeds supported depth: 1024");if(t.geometry.type==="GeometryCollection"){t2(e,t,t.geometry,r,i,n+1);return}if(!t.geometry.coordinates?.length)return;let a=Dd(t,r,i),s=(r.tolerance/((1<<r.maxZoom)*r.extent))**2,o=ru(r.coordinates);switch(t.geometry.type){case"Point":r2(e,a,t.geometry,o,t.properties);return;case"MultiPoint":i2(e,a,t.geometry,o,t.properties);return;case"LineString":n2(e,a,t.geometry,s,o,t.properties);return;case"MultiLineString":a2(e,a,t.geometry,s,o,r,t.properties);return;case"Polygon":s2(e,a,t.geometry,s,o,t.properties);return;case"MultiPolygon":o2(e,a,t.geometry,s,o,t.properties);return;default:throw Error("Input data is not a valid GeoJSON object.")}}function Dd(e,t,r){return t.promoteId?e.properties?.[t.promoteId]:t.generateId?r||0:e.id}function t2(e,t,r,i,n,a=0){for(let s of r.geometries)_d(e,{id:t.id,type:"Feature",geometry:s,properties:t.properties},i,n,a)}function r2(e,t,r,i,n){let a=[];a.push(i.projectX(r.coordinates[0]),i.projectY(r.coordinates[1]),0),e.push(Me(t,"Point",a,n))}function i2(e,t,r,i,n){let a=[];for(let s of r.coordinates)a.push(i.projectX(s[0]),i.projectY(s[1]),0);e.push(Me(t,"MultiPoint",a,n))}function n2(e,t,r,i,n,a){let s={points:[]};nu(r.coordinates,s,i,!1,n),e.push(Me(t,"LineString",s,a))}function a2(e,t,r,i,n,a,s){if(a.lineMetrics)for(let o of r.coordinates){let l={points:[]};nu(o,l,i,!1,n),e.push(Me(t,"LineString",l,s))}else{let o=[];au(r.coordinates,o,i,!1,n),e.push(Me(t,"MultiLineString",o,s))}}function s2(e,t,r,i,n,a){let s=[];au(r.coordinates,s,i,!0,n),e.push(Me(t,"Polygon",s,a))}function o2(e,t,r,i,n,a){let s=[];for(let o of r.coordinates){let l=[];au(o,l,i,!0,n),l.length&&s.push(l)}s.length&&e.push(Me(t,"MultiPolygon",s,a))}function nu(e,t,r,i,n){let a,s,o=0;for(let u=0;u<e.length;u++){let h=n.projectX(e[u][0]),c=n.projectY(e[u][1]);t.points.push(h,c,0),u>0&&(o+=i?(a*c-h*s)/2:Math.sqrt((h-a)**2+(c-s)**2)),a=h,s=c}let l=t.points.length-3;t.points[2]=1,r>0&&Wx(t.points,0,l,r),t.points[l+2]=1,tu(t),t.size=Math.abs(o),t.start=0,t.end=t.size}function au(e,t,r,i,n){for(let a=0;a<e.length;a++){let s={points:[]};nu(e[a],s,r,i,n),t.push(s)}}function l2(e,t=Ka){return{type:"FeatureCollection",features:e.map(r=>Ca(r,t))}}function Ca(e,t=Ka){let r={type:"Feature",geometry:u2(e,t),properties:e.tags};return e.id!=null&&(r.id=e.id),r}function u2(e,t){let{type:r,geometry:i}=e;switch(r){case"Point":return{type:r,coordinates:Sd(i[0],i[1],t)};case"MultiPoint":return{type:r,coordinates:Hn(i,t)};case"LineString":return{type:r,coordinates:Hn(i.points,t)};case"MultiLineString":case"Polygon":return{type:r,coordinates:i.map(n=>Hn(n.points,t))};case"MultiPolygon":return{type:r,coordinates:i.map(n=>n.map(a=>Hn(a.points,t)))}}}function Hn(e,t=Ka){let r=[];for(let i=0;i<e.length;i+=3)r.push(Sd(e[i],e[i+1],t));return r}function Sd(e,t,r){return[r.unprojectX(e),r.unprojectY(t)]}function ct(e,t,r,i,n,a,s,o){if(r/=t,i/=t,a>=r&&s<i)return e;if(s<r||a>=i)return null;let l=[];for(let u of e){let h=n===0?u.minX:u.minY,c=n===0?u.maxX:u.maxY;if(h>=r&&c<i)l.push(u);else if(!(c<r||h>=i))switch(u.type){case"Point":case"MultiPoint":h2(u,l,r,i,n);continue;case"LineString":c2(u,l,r,i,n,o);continue;case"MultiLineString":p2(u,l,r,i,n);continue;case"Polygon":f2(u,l,r,i,n);continue;case"MultiPolygon":d2(u,l,r,i,n);continue}}return l.length?l:null}function h2(e,t,r,i,n){let a=[];if(y2(e.geometry,a,r,i,n),!a.length)return;let s=a.length===3?"Point":"MultiPoint";t.push(Me(e.id,s,a,e.tags))}function c2(e,t,r,i,n,a){let s=[];if(Ad(e.geometry,s,r,i,n,!1,a.lineMetrics),s.length)if(a.lineMetrics)for(let o of s)t.push(Me(e.id,"LineString",o,e.tags));else s.length>1?t.push(Me(e.id,"MultiLineString",s,e.tags)):t.push(Me(e.id,"LineString",s[0],e.tags))}function p2(e,t,r,i,n){let a=[];su(e.geometry,a,r,i,n,!1),a.length&&(a.length===1?t.push(Me(e.id,"LineString",a[0],e.tags)):t.push(Me(e.id,"MultiLineString",a,e.tags)))}function f2(e,t,r,i,n){let a=[];su(e.geometry,a,r,i,n,!0),a.length&&t.push(Me(e.id,"Polygon",a,e.tags))}function d2(e,t,r,i,n){let a=[];for(let s of e.geometry){let o=[];su(s,o,r,i,n,!0),o.length&&a.push(o)}a.length&&t.push(Me(e.id,"MultiPolygon",a,e.tags))}function y2(e,t,r,i,n){for(let a=0;a<e.length;a+=3){let s=e[a+n];s>=r&&s<=i&&Gr(t,e[a],e[a+1],e[a+2])}}function Ad(e,t,r,i,n,a,s){let o=ec(e),l=n===0?m2:g2,u=e.start,h,c;for(let g=0;g<e.points.length-3;g+=3){let x=e.points[g],v=e.points[g+1],b=e.points[g+2],w=e.points[g+3],S=e.points[g+4],D=n===0?x:v,A=n===0?w:S,E=!1;s&&(h=Math.sqrt((x-w)**2+(v-S)**2)),D<r?A>=r&&(c=l(o,x,v,w,S,r),s&&(o.start=u+h*c)):D>i?A<=i&&(c=l(o,x,v,w,S,i),s&&(o.start=u+h*c)):Gr(o.points,x,v,b),A<r&&D>=r&&(c=l(o,x,v,w,S,r),E=!0),A>i&&D<=i&&(c=l(o,x,v,w,S,i),E=!0),!a&&E&&(s&&(o.end=u+h*c),t.push(o),o=ec(e)),s&&(u+=h)}let p=e.points.length-3,f=e.points[p],d=e.points[p+1],y=e.points[p+2],m=n===0?f:d;m>=r&&m<=i&&Gr(o.points,f,d,y),p=o.points.length-3,a&&p>=3&&(o.points[p]!==o.points[0]||o.points[p+1]!==o.points[1])&&Gr(o.points,o.points[0],o.points[1],o.points[2]),o.points.length&&(tu(o),t.push(o))}function ec(e){return{points:[],size:e.size,start:e.start,end:e.end}}function su(e,t,r,i,n,a){for(let s of e)Ad(s,t,r,i,n,a,!1)}function Gr(e,t,r,i){e.push(t,r,i)}function m2(e,t,r,i,n,a){let s=(a-t)/(i-t);return Gr(e.points,a,r+(n-r)*s,1),s}function g2(e,t,r,i,n,a){let s=(a-r)/(n-r);return Gr(e.points,t+(i-t)*s,a,1),s}function ou(e,t){if(!t.wrap)return e;let r=t.buffer/t.extent,i=e,n=ct(e,1,-1-r,r,0,-1,2,t),a=ct(e,1,1-r,2+r,0,-1,2,t);return!n&&!a||(i=ct(e,1,-r,1+r,0,-1,2,t)||[],n&&(i=tc(n,1).concat(i)),a&&(i=i.concat(tc(a,-1)))),i}function tc(e,t){let r=[];for(let i of e)switch(i.type){case"Point":case"MultiPoint":{let n=x2(i.geometry,t);r.push(Me(i.id,i.type,n,i.tags));continue}case"LineString":{let n=Ys(i.geometry,t);r.push(Me(i.id,i.type,n,i.tags));continue}case"MultiLineString":case"Polygon":{let n=[];for(let a of i.geometry)n.push(Ys(a,t));r.push(Me(i.id,i.type,n,i.tags));continue}case"MultiPolygon":{let n=[];for(let a of i.geometry){let s=[];for(let o of a)s.push(Ys(o,t));n.push(s)}r.push(Me(i.id,i.type,n,i.tags));continue}}return r}function x2(e,t){let r=[];for(let i=0;i<e.length;i+=3)r.push(e[i]+t,e[i+1],e[i+2]);return r}function Ys(e,t){let r={points:[],size:e.size};e.start!==void 0&&(r.start=e.start,r.end=e.end);for(let i=0;i<e.points.length;i+=3)r.points.push(e.points[i]+t,e.points[i+1],e.points[i+2]);return tu(r),r}function v2(e,t,r,i){let n=_2(t,r),a=[];if(n.removeAll&&(a=e,e=[],i?.clear()),n.remove.size||n.add.size){for(let o of n.remove)i?.delete(o);let s=[];for(let o of e)(n.remove.has(o.id)||n.add.has(o.id))&&s.push(o);if(s.length){a=a.concat(s);let o=new Set(s.map(l=>l.id));e=e.filter(l=>!o.has(l.id))}if(n.add.size){let o=iu({type:"FeatureCollection",features:Array.from(n.add.values())},r,i);o=ou(o,r),a=a.concat(o),e=e.concat(o)}}if(n.update.size){let s=new Map,o=[];for(let l of e)n.update.has(l.id)?s.set(l.id,[...s.get(l.id)||[],l]):o.push(l);for(let[l,u]of n.update){let h=s.get(l);if(!h||h.length===0){if(!i?.has(l))continue;let p=w2(l,u,r,i);a=a.concat(p),o=o.concat(p);continue}let c=b2(h,u,r,i);a=a.concat(h,c),o=o.concat(c)}e=o}return{affected:a,source:e}}function b2(e,t,r,i){let n=!!t.newGeometry,a=Fd(t);if(n){let s=e[0],o=a?el(s.tags,t):s.tags;return Ed(s.id,t.newGeometry,o,r,i)}if(a){let s=[];for(let o of e){let l={...o};l.tags=el(l.tags,t),s.push(l)}return s}return e}function w2(e,t,r,i){let n=i.get(e),a=Fd(t)?el(n.properties,t):n.properties;return t.newGeometry?Ed(e,t.newGeometry,a,r,i):(i.set(e,{...n,properties:a}),[])}function Ed(e,t,r,i,n){return ou(iu({type:"FeatureCollection",features:[{type:"Feature",id:e,geometry:t,properties:r}]},{...i,promoteId:void 0,generateId:!1},n),i)}function Fd(e){return e.removeAllProperties||e.removeProperties?.length>0||e.addOrUpdateProperties?.length>0}function el(e,t){if(t.removeAllProperties)return{};let r={...e||{}};if(t.removeProperties)for(let i of t.removeProperties)delete r[i];if(t.addOrUpdateProperties)for(let{key:i,value:n}of t.addOrUpdateProperties)r[i]=n;return r}function _2(e,t){return e?{removeAll:e.removeAll,remove:new Set(e.remove||[]),add:new Map(e.add?.map(r=>[t.promoteId?r.properties?.[t.promoteId]:r.id,r])),update:new Map(e.update?.map(r=>[r.id,r]))}:{remove:new Set,add:new Map,update:new Map}}var rc=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],me=new Uint32Array(96),D2=class Id{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[r,i]=new Uint8Array(t,0,2);if(r!==219)throw Error("Data does not appear to be in a KDBush format.");let n=i>>4;if(n!==1)throw Error(`Got v${n} data when expected v1.`);let a=rc[i&15];if(!a)throw Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[o]=new Uint32Array(t,4,1);return new Id(o,s,a,void 0,t)}constructor(t,r=64,i=Float64Array,n=ArrayBuffer,a){if(isNaN(t)||t<0)throw Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let s=rc.indexOf(this.ArrayType),o=t*2*this.ArrayType.BYTES_PER_ELEMENT,l=t*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-l%8)%8;if(s<0)throw Error(`Unexpected typed array class: ${i}.`);if(a)this.data=a,this.ids=new this.IndexArrayType(a,8,t),this.coords=new i(a,8+l+u,t*2),this._pos=t*2,this._finished=!0;else{let h=this.data=new n(8+o+l+u);this.ids=new this.IndexArrayType(h,8,t),this.coords=new i(h,8+l+u,t*2),this._pos=0,this._finished=!1,new Uint8Array(h,0,2).set([219,16+s]),new Uint16Array(h,2,1)[0]=r,new Uint32Array(h,4,1)[0]=t}}add(t,r){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=r,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw Error(`Added ${t} items when expected ${this.numItems}.`);return tl(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:s,nodeSize:o}=this;me[0]=0,me[1]=a.length-1,me[2]=0;let l=3,u=[];for(;l>0;){let h=me[--l],c=me[--l],p=me[--l];if(c-p<=o){for(let m=p;m<=c;m++){let g=s[2*m],x=s[2*m+1];g>=t&&g<=i&&x>=r&&x<=n&&u.push(a[m])}continue}let f=p+c>>1,d=s[2*f],y=s[2*f+1];d>=t&&d<=i&&y>=r&&y<=n&&u.push(a[f]),(h===0?t<=d:r<=y)&&(me[l++]=p,me[l++]=f-1,me[l++]=1-h),(h===0?i>=d:n>=y)&&(me[l++]=f+1,me[l++]=c,me[l++]=1-h)}return u}within(t,r,i){let n=[];return this.withinInto(t,r,i,n),n}withinInto(t,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:s,nodeSize:o}=this;me[0]=0,me[1]=a.length-1,me[2]=0;let l=3,u=0,h=i*i;for(;l>0;){let c=me[--l],p=me[--l],f=me[--l];if(p-f<=o){for(let g=f;g<=p;g++)ic(s[2*g],s[2*g+1],t,r)<=h&&(n[u++]=a[g]);continue}let d=f+p>>1,y=s[2*d],m=s[2*d+1];ic(y,m,t,r)<=h&&(n[u++]=a[d]),(c===0?t-i<=y:r-i<=m)&&(me[l++]=f,me[l++]=d-1,me[l++]=1-c),(c===0?t+i>=y:r+i>=m)&&(me[l++]=d+1,me[l++]=p,me[l++]=1-c)}return u}};function tl(e,t,r,i,n,a){if(n-i<=r)return;let s=i+n>>1;kd(e,t,s,i,n,a),tl(e,t,r,i,s-1,1-a),tl(e,t,r,s+1,n,1-a)}function kd(e,t,r,i,n,a){for(;n>i;){if(n-i>600){let u=n-i+1,h=r-i+1,c=Math.log(u),p=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*p*(u-p)/u)*(h-u/2<0?-1:1);kd(e,t,r,Math.max(i,Math.floor(r-h*p/u+f)),Math.min(n,Math.floor(r+(u-h)*p/u+f)),a)}let s=t[2*r+a],o=i,l=n;for(Ci(e,t,i,r),t[2*n+a]>s&&Ci(e,t,i,n);o<l;){for(Ci(e,t,o,l),o++,l--;t[2*o+a]<s;)o++;for(;t[2*l+a]>s;)l--}t[2*i+a]===s?Ci(e,t,i,l):(l++,Ci(e,t,l,n)),l<=r&&(i=l+1),r<=l&&(n=l-1)}}function Ci(e,t,r,i){Xs(e,r,i),Xs(t,2*r,2*i),Xs(t,2*r+1,2*i+1)}function Xs(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function ic(e,t,r,i){let n=e-r,a=t-i;return n*n+a*a}var Td={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e,coordinates:"lngLat",wrap:!0},Ma=1073741824;function Ue(e){return(e-.5)*Ma}function ii(e){return e/Ma+.5}function nc(e){return Math.abs(Ue(e))<2147483647}var S2=class{constructor(e){this.options=ac(e),this.worldCoordinateHelper=ru(this.options.coordinates),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?5:4,this.clusterProps=[],this.points=[]}load(e){let t=[];for(let r of e){if(!r.geometry)continue;let i=r.geometry.type==="MultiPoint"?r.geometry.coordinates:[r.geometry.coordinates];for(let[n,a]of i){let[s,o]=[this.worldCoordinateHelper.projectX(n),this.worldCoordinateHelper.projectY(a)];if(!this.options.wrap&&!Zs([s,o]))continue;let l={id:r.id,type:"Point",geometry:[s,o],tags:r.properties};t.push(l)}}this.createIndex(t)}initialize(e){let t=[];for(let r of e)if(r.type==="Point"){if(!this.options.wrap&&!Zs(r.geometry))continue;t.push(r)}else if(r.type==="MultiPoint")for(let i=0;i<r.geometry.length;i+=3){let n=[r.geometry[i],r.geometry[i+1]];(this.options.wrap||Zs(n))&&t.push({id:r.id,type:"Point",geometry:n,tags:r.tags})}this.createIndex(t)}updateIndex(e,t,r){this.options=ac({...r.clusterOptions,coordinates:this.options.coordinates,wrap:this.options.wrap}),this.initialize(e)}createIndex(e){let{log:t,minZoom:r,maxZoom:i}=this.options;this.trees=Array(i+1),this.stride=this.options.reduce?5:4,this.clusterProps=[],t&&console.time("total time");let n=`prepare ${e.length} points`;t&&console.time(n),this.points=e;let a=this.stride,s=i+1,o=new Int32Array(e.length*2),l=new Int32Array(e.length*a),u=0;for(let f=0;f<e.length;f++){let d=e[f];if(!d?.geometry||!nc(d.geometry[0])||!nc(d.geometry[1]))continue;o[u*2]=Math.round(Ue(d.geometry[0])),o[u*2+1]=Math.round(Ue(d.geometry[1]));let y=u*a;l[y+0]=s,l[y+1]=f,l[y+2]=-1,l[y+3]=1,u++}let h=this.trees[i+1]=this.createTree(o,l,u);t&&console.timeEnd(n);let c=new Int32Array(u*2),p=new Int32Array(u*a);for(let f=i;f>=r;f--){let d=Date.now(),y=this.cluster(h,f,c,p);this.isSameAsTree(h,p,y)||(h=this.createTree(c.slice(0,y*2),p.slice(0,y*a),y)),this.trees[f]=h,t&&console.log("z%d: %d clusters in %dms",f,h.numItems,Date.now()-d)}t&&console.timeEnd("total time")}getClusters(e,t){return(this.options.wrap?this.options.coordinates==="unitSquare"?this.getClustersAcrossEdge(e,t):this.getClustersInternal(e,t):this.getClustersInWorld(e,t)).map(r=>Ca(r,this.worldCoordinateHelper))}getClustersInWorld(e,t){let r=this.options.coordinates!=="unitSquare",i=this.worldCoordinateHelper.projectY(r?Math.max(-90,Math.min(90,e[1])):e[1]),n=this.worldCoordinateHelper.projectY(r?Math.max(-90,Math.min(90,e[3])):e[3]),a=Math.max(0,this.worldCoordinateHelper.projectX(e[0])),s=Math.min(1,this.worldCoordinateHelper.projectX(e[2]));return a>s?[]:this.getClustersInRange([a,Math.min(i,n),s,Math.max(i,n)],t)}getClustersAcrossEdge([e,t,r,i],n){if(r<e&&(r+=1),r-e>=1)return this.getClustersInRange([0,t,1,i],n);let a=Math.floor(e),s=e-a,o=r-a;return o<=1?this.getClustersInRange([s,t,o,i],n):this.getClustersInRange([s,t,1,i],n).concat(this.getClustersInRange([0,t,o-1,i],n))}getClustersInternal(e,t){let r=((e[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[1])),n=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,n=180;else if(r>n){let s=this.getClustersInternal([r,i,180,a],t),o=this.getClustersInternal([-180,i,n,a],t);return s.concat(o)}return this.getClustersInRange([this.worldCoordinateHelper.projectX(r),this.worldCoordinateHelper.projectY(a),this.worldCoordinateHelper.projectX(n),this.worldCoordinateHelper.projectY(i)],t)}getClustersInRange([e,t,r,i],n){let a=this.trees[this.limitZoom(n)],s=a.range(Ue(e),Ue(t),Ue(r),Ue(i)),o=a.flatCoords,l=a.flatData,u=[];for(let h of s){let c=this.stride*h;u.push(l[c+3]>1?A2(o,h,l,c,this.clusterProps):this.points[l[c+1]])}return u}getChildren(e){let t=this.getOriginId(e),r=this.getOriginZoom(e),i=Error("No cluster with the specified id: "+e),n=this.trees[r];if(!n)throw i;let a=n.flatCoords,s=n.flatData;if(t>=n.numItems)throw i;let o=this.options.radius/(this.options.extent*2**(r-1))*Ma,l=a[t*2],u=a[t*2+1],h=n.within(l,u,o),c=[];for(let p of h){let f=p*this.stride;s[f+2]===e&&c.push(s[f+3]>1?E2(a,p,s,f,this.clusterProps,this.worldCoordinateHelper):Ca(this.points[s[f+1]],this.worldCoordinateHelper))}if(c.length===0)throw i;return c}getLeaves(e,t,r){t||=10,r||=0;let i=[];return this.appendLeaves(i,e,t,r,0),i}getTile(e,t,r){let i=this.trees[this.limitZoom(e)];if(!i)return null;let n=2**e;if(!this.options.wrap&&(t<0||t>=n||r<0||r>=n))return null;let{extent:a,radius:s}=this.options,o=s/a,l=Ue((r-o)/n),u=Ue((r+1+o)/n),h={transformed:!0,features:[],source:null,x:t,y:r,z:e};return this.addTileFeatures(i.range(Ue((t-o)/n),l,Ue((t+1+o)/n),u),i,t,r,n,h),this.options.wrap&&t===0&&this.addTileFeatures(i.range(Ue(1-o/n),l,Ue(1),u),i,n,r,n,h),this.options.wrap&&t===n-1&&this.addTileFeatures(i.range(Ue(0),l,Ue(o/n),u),i,-1,r,n,h),h}getClusterExpansionZoom(e){return this.getOriginZoom(e)}appendLeaves(e,t,r,i,n){let a=this.getChildren(t);for(let s of a){let o=s.properties;if(o?.cluster?n+o.point_count<=i?n+=o.point_count:n=this.appendLeaves(e,o.cluster_id,r,i,n):n<i?n++:e.push(s),e.length===r)break}return n}createTree(e,t,r){let i=new D2(r,this.options.nodeSize,Int32Array);for(let n=0;n<r;n++)i.add(e[n*2],e[n*2+1]);return i.finish(),i.flatCoords=e,i.flatData=t,i.data=null,i}isSameAsTree(e,t,r){if(r!==e.numItems)return!1;let i=e.flatData;for(let n=1;n<r*this.stride;n+=this.stride)if(t[n]!==i[n])return!1;return!0}addTileFeatures(e,t,r,i,n,a){let s=t.flatCoords,o=t.flatData;for(let l of e){let u=l*this.stride,h=o[u+3]>1,c,p,f;if(h)c=lu(o,u,this.clusterProps),p=ii(s[l*2]),f=ii(s[l*2+1]);else{let m=this.points[o[u+1]];c=m.tags,[p,f]=m.geometry}let d={type:1,geometry:[[Math.round(this.options.extent*(p*n-r)),Math.round(this.options.extent*(f*n-i))]],tags:c},y;y=h||this.options.generateId?o[u+1]:this.points[o[u+1]].id,y!==void 0&&(d.id=y),a.features.push(d)}}limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}cluster(e,t,r,i){let{radius:n,extent:a,reduce:s,minPoints:o,maxZoom:l}=this.options,u=n/(a*2**t)*Ma,h=l+1,c=e.flatCoords,p=e.flatData,f=this.stride,d=new Uint32Array(e.numItems),y=0;for(let m=0;m<e.numItems;m++){let g=m*f;if(p[g+0]<=t)continue;p[g+0]=t;let x=c[m*2],v=c[m*2+1],b=e.withinInto(x,v,u,d),w=p[g+3],S=w;for(let D=0;D<b;D++){let A=d[D]*f;p[A+0]>t&&(S+=p[A+3])}if(S>w&&S>=o){let D=x*w,A=v*w,E,V=-1,M=(m<<5)+(t+1)+this.points.length;for(let R=0;R<b;R++){let T=d[R],I=T*f;if(p[I+0]<=t)continue;p[I+0]=t;let z=p[I+3];D+=c[T*2]*z,A+=c[T*2+1]*z,p[I+2]=M,s&&(E||(E=this.map(p,g,!0),V=this.clusterProps.length,this.clusterProps.push(E)),s(E,this.map(p,I)))}p[g+2]=M,r[y*2]=Math.round(D/S),r[y*2+1]=Math.round(A/S);let O=y*f;i[O+0]=h,i[O+1]=M,i[O+2]=-1,i[O+3]=S,s&&(i[O+4]=V),y++}else{r[y*2]=x,r[y*2+1]=v;for(let D=0;D<f;D++)i[y*f+D]=p[g+D];if(y++,S>1)for(let D=0;D<b;D++){let A=d[D],E=A*f;if(!(p[E+0]<=t)){p[E+0]=t,r[y*2]=c[A*2],r[y*2+1]=c[A*2+1];for(let V=0;V<f;V++)i[y*f+V]=p[E+V];y++}}}}return y}getOriginId(e){return e-this.points.length>>5}getOriginZoom(e){return(e-this.points.length)%32}map(e,t,r){if(e[t+3]>1){let a=this.clusterProps[e[t+4]];return r?Object.assign({},a):a}let i=this.points[e[t+1]].tags,n=this.options.map(i);return r&&n===i?Object.assign({},n):n}};function ac(e){let t=Object.assign(Object.create(Td),e);return t.minZoom=Math.min(t.minZoom,30),t.maxZoom=Math.min(t.maxZoom,30),t}function A2(e,t,r,i,n){return{id:r[i+1],type:"Point",tags:lu(r,i,n),geometry:[ii(e[t*2]),ii(e[t*2+1])]}}function E2(e,t,r,i,n,a){return{type:"Feature",id:r[i+1],properties:lu(r,i,n),geometry:{type:"Point",coordinates:[a.unprojectX(ii(e[t*2])),a.unprojectY(ii(e[t*2+1]))]}}}function lu(e,t,r){let i=e[t+3],n=i>=1e4?`${Math.round(i/1e3)}k`:i>=1e3?`${Math.round(i/100)/10}k`:i,a=e[t+4],s=a===-1?{}:Object.assign({},r[a]);return Object.assign(s,{cluster:!0,cluster_id:e[t+1],point_count:i,point_count_abbreviated:n})}function Zs(e){return e[0]>=0&&e[0]<=1&&e[1]>=0&&e[1]<=1}var Cd="geojsonvt_clip_start",Md="geojsonvt_clip_end";function sc(e,t,r,i,n){let a=t===n.maxZoom?0:n.tolerance/((1<<t)*n.extent),s={transformed:!1,features:[],source:null,x:r,y:i,z:t,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:e.length};for(let o of e)F2(s,o,a,n);return s}function F2(e,t,r,i){switch(e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),t.type){case"Point":case"MultiPoint":I2(e,t);return;case"LineString":k2(e,t,r,i);return;case"MultiLineString":case"Polygon":T2(e,t,r);return;case"MultiPolygon":C2(e,t,r);return}}function I2(e,t){let r=[];for(let n=0;n<t.geometry.length;n+=3)r.push(t.geometry[n],t.geometry[n+1]),e.numPoints++,e.numSimplified++;if(!r.length)return;let i={type:1,tags:t.tags||null,geometry:r};t.id!==null&&(i.id=t.id),e.features.push(i)}function k2(e,t,r,i){let n=[];if(uu(n,t.geometry,e,r,!1,!1),!n.length)return;let a=t.tags||null;if(i.lineMetrics){a={};for(let o in t.tags)a[o]=t.tags[o];a[Cd]=t.geometry.start/t.geometry.size,a[Md]=t.geometry.end/t.geometry.size}let s={type:2,tags:a,geometry:n};t.id!==null&&(s.id=t.id),e.features.push(s)}function T2(e,t,r){let i=[];for(let a=0;a<t.geometry.length;a++)uu(i,t.geometry[a],e,r,t.type==="Polygon",a===0);if(!i.length)return;let n={type:t.type==="Polygon"?3:2,tags:t.tags||null,geometry:i};t.id!==null&&(n.id=t.id),e.features.push(n)}function C2(e,t,r){let i=[];for(let a=0;a<t.geometry.length;a++){let s=t.geometry[a];for(let o=0;o<s.length;o++)uu(i,s[o],e,r,!0,o===0)}if(!i.length)return;let n={type:3,tags:t.tags||null,geometry:i};t.id!==null&&(n.id=t.id),e.features.push(n)}function uu(e,t,r,i,n,a){let s=i*i;if(i>0&&t.size<(n?s:i)){r.numPoints+=t.points.length/3;return}let o=[];for(let l=0;l<t.points.length;l+=3)(i===0||t.points[l+2]>s)&&(r.numSimplified++,o.push(t.points[l],t.points[l+1])),r.numPoints++;n&&M2(o,a),e.push(o)}function M2(e,t){let r=0;for(let i=0,n=e.length,a=n-2;i<n;a=i,i+=2)r+=(e[i]-e[a])*(e[i+1]+e[a+1]);if(r>0===t)for(let i=0,n=e.length;i<n/2;i+=2){let a=e[i],s=e[i+1];e[i]=e[n-2-i],e[i+1]=e[n-1-i],e[n-2-i]=a,e[n-1-i]=s}}function oc(e,t){if(e.transformed)return e;let r=1<<e.z,i=e.x,n=e.y;for(let a of e.features)a.type===1?P2(a,t,r,i,n):B2(a,t,r,i,n);return e.transformed=!0,e}function P2(e,t,r,i,n){let a=e,s=e.geometry,o=[];for(let l=0;l<s.length;l+=2)o.push(Pd(s[l],s[l+1],t,r,i,n));return a.geometry=o,a}function B2(e,t,r,i,n){let a=e,s=e.geometry,o=[];for(let l of s){let u=[];for(let h=0;h<l.length;h+=2)u.push(Pd(l[h],l[h+1],t,r,i,n));o.push(u)}return a.geometry=o,a}function Pd(e,t,r,i,n,a){return[Math.round(r*(e*i-n)),Math.round(r*(t*i-a))]}var z2=class{constructor(e){this.options=e,this.total=0,this.stats={},this.tiles={},this.tileCoords=[],this.stats={},this.total=0}initialize(e){this.splitTile(this.clipToWorld(e),0,0,0),this.options.debug&&(e.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}updateIndex(e,t,r){r.debug>1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(t),r.debug>1&&console.timeEnd("invalidating");let[i,n,a]=[0,0,0],s=this.clipToWorld(e),o=sc(s,i,n,a,r);o.source=s;let l=Jn(i,n,a);if(this.tiles[l]=o,this.tileCoords.push({z:i,x:n,y:a,id:l}),r.debug){let u=`z${i}`;this.stats[u]=(this.stats[u]||0)+1,this.total++}}getClusterExpansionZoom(e){return null}getChildren(e){return null}getLeaves(e,t,r){return null}getTile(e,t,r){let{extent:i,debug:n}=this.options,a=1<<e;if(!this.options.wrap&&(t<0||t>=a))return null;t=t+a&a-1;let s=Jn(e,t,r);if(this.tiles[s])return oc(this.tiles[s],i);n>1&&console.log("drilling down to z%d-%d-%d",e,t,r);let o=e,l=t,u=r,h;for(;!h&&o>0;)o--,l>>=1,u>>=1,h=this.tiles[Jn(o,l,u)];return!h?.source||(n>1&&(console.log("found parent tile z%d-%d-%d",o,l,u),console.time("drilling down")),this.splitTile(h.source,o,l,u,e,t,r),n>1&&console.timeEnd("drilling down"),!this.tiles[s])?null:oc(this.tiles[s],i)}clipToWorld(e){let{wrap:t,coordinates:r}=this.options;if(t&&r!=="unitSquare")return e;let i=this.options.buffer/this.options.extent;return ct(t?e:ct(e,1,-i,1+i,0,-1/0,1/0,this.options)||[],1,-i,1+i,1,-1/0,1/0,this.options)||[]}splitTile(e,t,r,i,n,a,s){let o=[e,t,r,i],l=this.options,u=l.debug;for(;o.length;){i=o.pop(),r=o.pop(),t=o.pop(),e=o.pop();let h=1<<t,c=Jn(t,r,i),p=this.tiles[c];if(!p&&(u>1&&console.time("creation"),p=this.tiles[c]=sc(e,t,r,i,l),this.tileCoords.push({z:t,x:r,y:i,id:c}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));let D=`z${t}`;this.stats[D]=(this.stats[D]||0)+1,this.total++}if(p.source=e,n==null){if(t===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else{if(t===l.maxZoom||t===n)continue;if(n!=null){let D=n-t;if(r!==a>>D||i!==s>>D)continue}}if(p.source=null,!e.length)continue;u>1&&console.time("clipping");let f=.5*l.buffer/l.extent,d=.5-f,y=.5+f,m=1+f,g=null,x=null,v=null,b=null,w=ct(e,h,r-f,r+y,0,p.minX,p.maxX,l),S=ct(e,h,r+d,r+m,0,p.minX,p.maxX,l);w&&(g=ct(w,h,i-f,i+y,1,p.minY,p.maxY,l),x=ct(w,h,i+d,i+m,1,p.minY,p.maxY,l)),S&&(v=ct(S,h,i-f,i+y,1,p.minY,p.maxY,l),b=ct(S,h,i+d,i+m,1,p.minY,p.maxY,l)),u>1&&console.timeEnd("clipping"),o.push(g||[],t+1,r*2,i*2),o.push(x||[],t+1,r*2,i*2+1),o.push(v||[],t+1,r*2+1,i*2),o.push(b||[],t+1,r*2+1,i*2+1)}}invalidateTiles(e){if(!e.length)return;let t=this.options,{debug:r}=t,i=1/0,n=-1/0,a=1/0,s=-1/0;for(let u of e)i=Math.min(i,u.minX),n=Math.max(n,u.maxX),a=Math.min(a,u.minY),s=Math.max(s,u.maxY);let o=t.buffer/t.extent,l=new Set;for(let u in this.tiles){let h=this.tiles[u],c=1<<h.z,p=(h.x-o)/c,f=(h.x+1+o)/c,d=(h.y-o)/c,y=(h.y+1+o)/c;if(n<p||i>=f||s<d||a>=y)continue;let m=!1;for(let g of e)if(g.maxX>=p&&g.minX<f&&g.maxY>=d&&g.minY<y){m=!0;break}if(m){if(r){r>1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",h.z,h.x,h.y,h.numFeatures,h.numPoints,h.numSimplified);let g=`z${h.z}`;this.stats[g]=(this.stats[g]||0)-1,this.total--}delete this.tiles[u],l.add(u)}}l.size&&(this.tileCoords=this.tileCoords.filter(u=>!l.has(u.id)))}};function Jn(e,t,r){return((1<<e)*r+t)*32+e}var L2={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,cluster:!1,clusterOptions:Td,debug:0,coordinates:"lngLat",wrap:!0},V2=class{constructor(e,t){t=this.options=Object.assign({},L2,t),this.worldCoordinateHelper=ru(t.coordinates);let r=t.debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw Error("promoteId and generateId cannot be used together.");t.updateable&&(this.unlocated=new Map);let i=iu(e,t,this.unlocated);r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles")),i=ou(i,t),t.updateable&&(this.source=i),this.initializeIndex(i,t)}initializeIndex(e,t){this.tileIndex=t.cluster?new S2({...t.clusterOptions,coordinates:t.coordinates,wrap:t.wrap}):new z2(t),e.length&&this.tileIndex.initialize(e)}getTile(e,t,r){return e=+e,t=+t,r=+r,e<0||e>24?null:this.tileIndex.getTile(e,t,r)}updateData(e,t){let r=this.options;if(!r.updateable)throw Error("to update tile geojson `updateable` option must be set to true");let{affected:i,source:n}=v2(this.source,e,r,this.unlocated);t&&({affected:i,source:n}=this.filterUpdate(n,i,t)),i.length&&(this.source=n,this.tileIndex.updateIndex(n,i,r))}filterUpdate(e,t,r){let i=new Set;for(let n of e)n.id!=null&&(r(Ca(n,this.worldCoordinateHelper))||(t.push(n),i.add(n.id)));e=e.filter(n=>!i.has(n.id));for(let[n,a]of this.unlocated??[])a.geometry&&!r(a)&&this.unlocated.delete(n);return{affected:t,source:e}}getData(){if(!this.options.updateable)throw Error("to retrieve data the `updateable` option must be set to true");return l2(this.source,this.worldCoordinateHelper)}updateClusterOptions(e,t){let r=this.options.cluster;this.options.cluster=e,this.options.clusterOptions=t,r==e?this.tileIndex.updateIndex(this.source,[],this.options):this.initializeIndex(this.source,this.options)}getClusterExpansionZoom(e){return this.tileIndex.getClusterExpansionZoom(e)}getClusterChildren(e){return this.tileIndex.getChildren(e)}getClusterLeaves(e,t,r){return this.tileIndex.getLeaves(e,t,r)}},rl=Ee([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_offset_normal",components:2,type:"Int8"}],2),O2=rl.members;rl.size,rl.alignment;var il=Ee([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),R2=il.members;il.size,il.alignment;var $2=Math.cos(75/2*(Math.PI/180)),Bd=1/2,lc=2**14/Bd,zd=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>t.id),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let t of this.layers)this.gradients[t.id]={};this.layoutVertexArray=new J0,this.layoutVertexArray2=new K0,this.indexArray=new vn,this.programConfigurations=new mr(e.layers,e.zoom),this.segments=new et,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(e,t,r){this.hasDependencies=Fa("line",this.layers,t)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get("line-sort-key"),n=!i.isConstant(),a=[],s=new le(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of e){let p=li(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?p.geometry:br(l),patterns:{},dashes:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:h,sourceLayerIndex:c}=l;this.hasDependencies?(Fa("line",this.layers,t)?Ql("line",this.layers,l,{zoom:this.zoom},t):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,l,this.zoom,t),this.patternFeatures.push(l)):this.addFeature(l,u,h,r,{},{},t.subdivisionGranularity);let p=e[h].feature;t.featureIndex.insert(p,u,h,c,this.index)}}update(e,t,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r,dashPositions:i})}addFeatures({options:e,canonical:t,patternPositions:r,dashPositions:i}){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,t,r,i,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,R2)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,O2),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.hasOwn(e.properties,"geojsonvt_clip_start")&&Object.hasOwn(e.properties,"geojsonvt_clip_end"))return{start:+e.properties[Cd],end:+e.properties[Md]}}addFeature(e,t,r,i,n,a,s){let o=this.layers[0].layout,l=o.get("line-join").evaluate(e,{}),u=o.get("line-cap").evaluate(e,{}),h=o.get("line-miter-limit").evaluate(e,{}),c=o.get("line-round-limit").evaluate(e,{});this.lineClips=this.lineFeatureClips(e);for(let p of t)this.addLine(p,e,l,u,h,c,i,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:n,dashPositions:a,canonical:i})}addLine(e,t,r,i,n,a,s,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let l=s?o.line.getGranularityForZoomLevel(s.z):1;if(e=ur(e,l),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let v=0;v<e.length-1;v++)this.totalDistance+=e[v].dist(e[v+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let u=bn.types[t.type]==="Polygon",h=e.length;for(;h>=2&&e[h-1].equals(e[h-2]);)h--;let c=0;for(;c<h-1&&e[c].equals(e[c+1]);)c++;if(h-c<(u?3:2))return;r==="bevel"&&(n=1.05);let p=this.overscaling<=16?15*be/(512*this.overscaling):0,f=this.segments.prepareSegment(h*10,this.layoutVertexArray,this.indexArray),d,y,m,g,x;this.e1=this.e2=-1,u&&(d=e[h-2],x=e[c].sub(d)._unit()._perp());for(let v=c;v<h;v++){if(m=v===h-1?u?e[c+1]:void 0:e[v+1],m&&e[v].equals(m))continue;x&&(g=x),d&&(y=d),d=e[v],x=m?m.sub(d)._unit()._perp():g,g||=x;let b=g.add(x);(b.x!==0||b.y!==0)&&b._unit();let w=g.x*x.x+g.y*x.y,S=b.x*x.x+b.y*x.y,D=S===0?1/0:1/S,A=2*Math.sqrt(2-2*S),E=S<$2&&y&&m,V=g.x*x.y-g.y*x.x>0,M=b.mult(Math.min(D,2)),O=wt((D-3)/5,0,1);if(E&&v>c){let I=d.dist(y);if(I>2*p){let z=d.sub(d.sub(y)._mult(p/I)._round());this.updateDistance(y,z),this.addCurrentVertex(z,g,0,0,f),y=z}}let R=y&&m,T=R?r:u?"butt":i;if(R&&T==="round"&&(D<a?T="miter":D<=2&&(T="fakeround")),T==="miter"&&D>n&&(T="bevel"),T==="bevel"&&(D>2&&(T="flipbevel"),D<n&&(T="miter")),y&&this.updateDistance(y,d),T==="miter")b._mult(D),this.addCurrentVertex(d,b,0,0,f,!1,M);else if(T==="flipbevel"){if(D>100)b=x.mult(-1);else{let I=D*g.add(x).mag()/g.sub(x).mag();b._perp()._mult(I*(V?-1:1))}this.addCurrentVertex(d,b,0,0,f,!1,M,O),this.addCurrentVertex(d,b.mult(-1),0,0,f,!1,M,O)}else if(T==="bevel"||T==="fakeround"){let I=-Math.sqrt(D*D-1),z=V?I:0,$=V?0:I;if(y&&this.addCurrentVertex(d,g,z,$,f,!1,M),T==="fakeround"){let j=Math.round(A*180/Math.PI/20);for(let ie=1;ie<j;ie++){let se=ie/j;if(se!==.5){let oe=se-.5,de=1.0904+w*(-3.2452+w*(3.55645-w*1.43519)),tt=.848013+w*(-1.06021+w*.215638);se+=se*oe*(se-1)*(de*oe*oe+tt)}let he=x.sub(g)._mult(se)._add(g)._unit()._mult(V?-1:1);this.addHalfVertex(d,he.x,he.y,V?-M.x:M.x,V?-M.y:M.y,!1,V,f)}}m&&this.addCurrentVertex(d,x,-z,-$,f,!1,M)}else if(T==="butt")this.addCurrentVertex(d,b,0,0,f,!1,M);else if(T==="square"){let I=y?1:-1;this.addCurrentVertex(d,b,I,I,f,!1,M)}else T==="round"&&(y&&(this.addCurrentVertex(d,g,0,0,f,!1,M,O),this.addCurrentVertex(d,g,1,1,f,!0,M,O)),m&&(this.addCurrentVertex(d,x,-1,-1,f,!0,M,O),this.addCurrentVertex(d,x,0,0,f,!1,M,O)));if(E&&v<h-1){let I=d.dist(m);if(I>2*p){let z=d.add(m.sub(d)._mult(p/I)._round());this.updateDistance(d,z),this.addCurrentVertex(z,x,0,0,f),d=z}}}}addCurrentVertex(e,t,r,i,n,a=!1,s=t,o=0){let l=t.x+t.y*r,u=t.y-t.x*r,h=-t.x+t.y*i,c=-t.y-t.x*i,p=s.x+(t.x-s.x)*o,f=s.y+(t.y-s.y)*o;this.addHalfVertex(e,l,u,p,f,a,!1,n),this.addHalfVertex(e,h,c,-p,-f,a,!0,n),this.distance>lc/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,r,i,n,a,s,o))}addHalfVertex({x:e,y:t},r,i,n,a,s,o,l){let u=(this.lineClips?this.scaledDistance*(lc-1):this.scaledDistance)*Bd;if(this.layoutVertexArray.emplaceBack((e<<1)+ +!!s,(t<<1)+ +!!o,Math.round(63*r)+128,Math.round(63*i)+128,(u&63)<<2,u>>6,Math.round(63*n),Math.round(63*a)),this.lineClips){let c=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(c,this.lineClipsArray.length)}let h=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,h,this.e2),l.primitiveLength++),o?this.e2=h:this.e1=h}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}hasLineDasharray(e){for(let t of e){let r=t.paint.get("line-dasharray");if(r&&!r.isConstant())return!0}return!1}addLineDashDependencies(e,t,r,i){for(let n of e){let a=n.paint.get("line-dasharray");if(!a||a.value.kind==="constant")continue;let s=n.layout.get("line-cap").evaluate(t,{})==="round",o={dasharray:a.value.evaluate({zoom:r-1},t,{}),round:s},l={dasharray:a.value.evaluate({zoom:r},t,{}),round:s},u={dasharray:a.value.evaluate({zoom:r+1},t,{}),round:s},h=`${o.dasharray.join(",")},${o.round}`,c=`${l.dasharray.join(",")},${l.round}`,p=`${u.dasharray.join(",")},${u.round}`;i.dashDependencies[h]=o,i.dashDependencies[c]=l,i.dashDependencies[p]=u,t.dashes[n.id]={min:h,mid:c,max:p}}}};P("LineBucket",zd,{omit:["layers","patternFeatures"]});var N2,U2=()=>N2||=new qe({"line-cap":new U(_.layout_line["line-cap"],"line-cap"),"line-join":new U(_.layout_line["line-join"],"line-join"),"line-miter-limit":new U(_.layout_line["line-miter-limit"],"line-miter-limit"),"line-round-limit":new U(_.layout_line["line-round-limit"],"line-round-limit"),"line-sort-key":new U(_.layout_line["line-sort-key"],"line-sort-key")}),j2,q2=()=>j2||=new qe({"line-opacity":new U(_.paint_line["line-opacity"],"line-opacity"),"line-layer-opacity":new L(_.paint_line["line-layer-opacity"],"line-layer-opacity"),"line-layer-blend":new L(_.paint_line["line-layer-blend"],"line-layer-blend"),"line-color":new U(_.paint_line["line-color"],"line-color"),"line-translate":new L(_.paint_line["line-translate"],"line-translate"),"line-translate-anchor":new L(_.paint_line["line-translate-anchor"],"line-translate-anchor"),"line-width":new U(_.paint_line["line-width"],"line-width"),"line-gap-width":new U(_.paint_line["line-gap-width"],"line-gap-width"),"line-offset":new U(_.paint_line["line-offset"],"line-offset"),"line-blur":new U(_.paint_line["line-blur"],"line-blur"),"line-dasharray":new rn(_.paint_line["line-dasharray"],"line-dasharray"),"line-pattern":new rn(_.paint_line["line-pattern"],"line-pattern"),"line-gradient":new Za(_.paint_line["line-gradient"],"line-gradient")}),uc={get paint(){return q2()},get layout(){return U2()}},G2=class extends U{possiblyEvaluate(e,t){return t=new le(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,i){return t=Xe({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,i)}},Kn,Y2=class extends dt{constructor(e,t){super(e,uc,t),this.gradientVersion=0,Kn||(Kn=new G2(uc.paint.properties["line-width"].specification,"line-floorwidth"),Kn.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let t=this.gradientExpression();this.stepInterpolant=Km(t)?t._styleExpression.expression instanceof El:!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=Kn.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new zd(e)}queryRadius(e){let t=e,r=hc(qr("line-width",this,t),qr("line-gap-width",this,t)),i=qr("line-offset",this,t);return r/2+Math.abs(i)+Ha(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a}){let s=Ja(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-n.bearingInRadians,a),o=a/2*hc(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),l=this.paint.get("line-offset").evaluate(t,r);return l&&(i=bg(i,l*a)),dg(s,i,o)}isTileClipped(){return!0}};function hc(e,t){return t>0?t+2*e:e}var X2=Ee([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"},{name:"a_height_offset",components:1,type:"Float32"}],4),Z2=Ee([{name:"a_projected_pos",components:3,type:"Float32"}],4);Ee([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);var W2=Ee([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Ee([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);var cc=Ee([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);Ee([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),Ee([{name:"triangle",components:3,type:"Uint16"}]),Ee([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Float32",name:"heightOffset"}]),Ee([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"},{type:"Float32",name:"heightOffset"}]),Ee([{type:"Float32",name:"offsetX"}]),Ee([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Ee([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var ni=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){if(ni.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}async syncState(e,t){if(this.isParsed())return this.getState();if(e.pluginStatus!=="loading")return this.setState(e),e;let r=e.pluginURL,i=new Promise(a=>{this.loadScriptResolve=a}),n=new Promise(a=>setTimeout(()=>a(),this.TIMEOUT));if(await t(r),await Promise.race([i,n]),this.isParsed()){let a={pluginStatus:"loaded",pluginURL:r};return this.setState(a),a}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${r}`)}};function H2(e){return/[\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u077F\u07C0-\u07FA\u07FD-\u07FF\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\u1800\u1801\u1804\u1806-\u1819\u1820-\u1878\u1880-\u18AA\uA840-\uA877\uFB50-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDD00-\uDD27\uDD30-\uDD39\uDE60-\uDE7E\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDEFF\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB]|\uD805[\uDE60-\uDE6C]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]|\uD83A[\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(e))}function J2(e){return/[\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC57-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD1F-\uDD39\uDD3F-\uDD59\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58\uDE60-\uDE9F\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF00-\uDF35\uDF39-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD27\uDD30-\uDD39\uDD40-\uDD65\uDD69-\uDD85\uDD8E\uDD8F\uDE60-\uDE7E\uDE80-\uDEA9\uDEAB-\uDEAD\uDEB0\uDEB1\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDF27\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(e))}function K2(e){return/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(e))}function _n(e){return/[\u02EA\u02EB\u1100-\u11FF\u1401-\u167F\u18B0-\u18FF\u2065\u20DD-\u20E0\u20E2-\u20E4\u2B97\u2BF0-\u2BFF\u2E50\u2E51\u2E80-\u3007\u3012\u3013\u3020-\u302F\u3031-\u30FB\u30FD-\uA4CF\uA960-\uA97F\uAC00-\uD7FF\uF900-\uFAFF\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7\uFFF0-\uFFF8]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|[\uD80C-\uD810\uD81C-\uD822\uD83C\uD83D\uD840-\uD87E\uD880-\uD8BE][\uDC00-\uDFFF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFFF]|\uD823[\uDC00-\uDDFF]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFF]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83E[\uDD00-\uDEFF]|[\uD87F\uD8BF][\uDC00-\uDFFD]/gim.test(String.fromCodePoint(e))}function Q2(e){return/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(e))}function ev(e){return/[\r\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0600-\u0605\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DD\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0890\u0891\u0897-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E33-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB3-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1037\u1039-\u103E\u1056-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1084-\u1086\u108D\u109D\u1100-\u11FF\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60\u1A62\u1A65-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA960-\uA97C\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDD69-\uDD6D\uDEAB\uDEAC\uDEFA-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCBD\uDCC2\uDCCD\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC2\uDDC3\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74\uDFB8-\uDFC0\uDFC2\uDFC5\uDFC7-\uDFCA\uDFCC-\uDFD2\uDFE1\uDFE2]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF1F\uDF22-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE84-\uDE99\uDF60-\uDF67]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00-\uDF03\uDF34-\uDF3A\uDF3E-\uDF42\uDF5A]|\uD80D[\uDC40\uDC47-\uDC55]|\uD818[\uDD1E-\uDD2F]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDD63\uDD67-\uDD6A\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF\uDDEE\uDDEF\uDEE3\uDEE6\uDEEE\uDEEF\uDEF5]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDDE6-\uDDFF\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF]/.test(e)}function pc(e){return/[\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA\u1000-\u103F\u1050-\u108F\u109A-\u109F\u1780-\u17D3\u17D7\u17DC\u17DD\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19DE\u19DF\u1A20-\u1A5E\u1A60-\u1A7C\u1AA0-\u1AAD\u1B00-\u1B4C\u1B4E-\u1B7F\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE-\uA9EF\uA9FA-\uA9FE\uAA60-\uAAC2\uAADB-\uAADF]|\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF3A\uDF3B\uDF3F-\uDF46]/gim.test(String.fromCodePoint(e))}function tv(e,t){return/(?:[\u1039\u17D2\u1A60\u1BAB\u200D\uAAF6]|\uD802\uDE3F|\uD804[\uDD33\uDFD0]|\uD806[\uDD3E\uDE47\uDE99]|\uD807[\uDD45\uDD97\uDF42])$/.test(e)||/^\p{gc=Mc}/u.test(t)}var rv={C:"18g,1;g2,3;4nb,1",D:"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f",R:"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1",T:"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1"},iv={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},nv={\u0644\u0622:[65269,65270],\u0644\u0623:[65271,65272],\u0644\u0625:[65273,65274],\u0644\u0627:[65275,65276]},fc=1604,av=/[\u0600-\u06ff\u0750-\u077f\u0870-\u089f\u08a0-\u08ff\ufb50-\ufdff\ufe70-\ufeff]/;function sv(e,t,r){let i=0;for(let n of e.split(";")){let[a,s]=n.split(",").map(l=>parseInt(l,36)),o=i+a;for(let l=o;l<o+s;l++)r.set(l,t);i=o+s}}var Ld=new Map;for(let[e,t]of Object.entries(rv))sv(t,e,Ld);function ov(e){return Ld.get(e)??"U"}function lv(e){return e==="D"||e==="L"||e==="C"}function uv(e){return e==="D"||e==="R"||e==="C"}function hv(e,t,r){return e==="D"?t&&r?3:t?1:r?2:0:e==="R"?+!!t:e==="L"?r?2:0:null}function cv(e){return[...e].map(t=>{let r=t.codePointAt(0);return{codePoint:r,type:ov(r),form:null}})}function pv(e){let t=e.filter(r=>r.type!=="T");for(let r=0;r<t.length;r++){let i=t[r],n=r>0&&lv(t[r-1].type),a=r+1<t.length&&uv(t[r+1].type);i.form=hv(i.type,n,a)}}function fv(e){let t=!1;for(let r of e)r.type==="T"?r.form=t?3:0:t=r.form===2||r.form===3}function dv(e){let t=[];for(let r=0;r<e.length;r++){let i=e[r];if(i.codePoint!==fc){t.push(i);continue}let n=r+1;for(;n<e.length&&e[n].type==="T";)n++;let a=e[n],s=a&&nv[String.fromCodePoint(fc,a.codePoint)];if(!s){t.push(i);continue}let o=i.form===3||i.form===1;t.push({codePoint:s[+!!o],type:"R",form:0}),t.push(...e.slice(r+1,n)),r=n}return t}function yv(e){if(e.form===null)return e.codePoint;let t=iv[e.codePoint];return t&&(t[e.form]||t[0])||e.codePoint}function mv(e){if(!av.test(e))return e;let t=cv(e);return pv(t),fv(t),dv(t).map(r=>String.fromCodePoint(yv(r))).join("")}function gv(e,t,r){let i=t.layout.get("text-transform").evaluate(r,{});return i==="uppercase"?e=e.toLocaleUpperCase():i==="lowercase"&&(e=e.toLocaleLowerCase()),(ni.applyArabicShaping??mv)(e)}function xv(e,t,r){for(let i of e.sections)i.text=gv(i.text,t,r);return e}function Ws(e,t,r){let i=r?t.last.points:t.first.points,n=r?i[i.length-1]:i[0];return`${e}:${n.x}:${n.y}`}function vv(e){let t=e.first.points,r=t.length;for(let a=e.first.next;a;a=a.next)r+=a.points.length-1;let i=Array(r);for(let a=0;a<t.length;a++)i[a]=t[a];let n=t.length;for(let a=e.first.next;a;a=a.next){let s=a.points;for(let o=1;o<s.length;o++)i[n++]=s[o]}return i}function dc(e,t,r,i,n){let a=t[r];delete t[r],t[i]=a;let s=e[a];return s.last.next=n.first,s.last=n.last,a}function yc(e,t,r,i,n){let a=t[i];delete t[i],t[r]=a;let s=e[a];return n.last.next=s.first,s.first=n.first,a}function bv(e){let t={},r={},i=[];for(let a of e){let s=a.text?a.text.toString():null,o={points:a.geometry[0],next:null},l={feature:a,first:o,last:o};if(!s){i.push(l);continue}let u=Ws(s,l),h=Ws(s,l,!0);if(u in r&&h in t&&r[u]!==t[h]){let c=yc(i,t,u,h,l),p=dc(i,r,u,h,i[c]);delete t[u],delete r[h],r[Ws(s,i[p],!0)]=p,i[c].feature.geometry=null}else if(u in r)dc(i,r,u,h,l);else if(h in t)yc(i,t,u,h,l);else{let c=i.push(l)-1;t[u]=c,r[h]=c}}let n=[];for(let a of i){let s=a.feature;s.geometry&&(a.first.next&&(s.geometry[0]=vv(a)),n.push(s))}return n}var Vd=typeof Intl<"u"&&"Segmenter"in Intl,mc,gc;function nl(e){if(!Vd||!ev(e))return[...e];mc??=new Intl.Segmenter(void 0,{granularity:"grapheme"});let t=[];for(let{segment:r}of mc.segment(e)){let i=t.length-1;i>=0&&tv(t[i],r)?t[i]+=r:t.push(r)}return t}function wv(e){let t=new Set;if(Vd){gc??=new Intl.Segmenter(void 0,{granularity:"word"});for(let{index:i}of gc.segment(e))t.add(i);return t}let r=0;for(let i of e.split(/\b|(?=\p{Ideo})/u))t.add(r),r+=i.length;return t}function al(e){let t=e.codePointAt(0);return e.length>(t>65535?2:1)}function cn(e){return/\s/u.test(String.fromCodePoint(e))}function Qa(e){return/[\p{P}\p{S}]/u.test(String.fromCodePoint(e))}function sl(e){for(let t of e)if(_n(t.codePointAt(0)))return!0;return!1}function _v(e){for(let t of e)if(!Dv(t.codePointAt(0)))return!1;return!0}function Dv(e){return!H2(e)}function ai(e){return!(_n(e)||Q2(e))}function Od(e){return/\p{sc=Arab}/u.test(String.fromCodePoint(e))}function Rd(e){return J2(e)}function $d(e){for(let t of e)if(Rd(t.codePointAt(0)))return!0;return!1}var Nr={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u22EF":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};function Sv(e){let t="",r={premature:!0,value:void 0},i=e[Symbol.iterator](),n=i.next(),a=e[Symbol.iterator]();a.next();let s=a.next();for(;!n.done;)(s.done||!ai(s.value.codePointAt(0))||Nr[s.value])&&(r.premature||!ai(r.value.codePointAt(0))||Nr[r.value])&&Nr[n.value]?t+=Nr[n.value]:t+=n.value,r={value:n.value,premature:!1},n=i.next(),s=a.next();return t}var Av={10:!0,13:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Ev={40:!0};function xc(e,t,r,i,n,a){if("fontStack"in t){let s=r[t.fontStack]?.default,o=s?.[e];if(o)return o.metrics.advance*t.scale+n;let l=0;for(let u of e){let h=s?.[u];h&&(l+=h.metrics.advance*t.scale+n)}return l}{let s=i[t.imageName];return s?s.displaySize[0]*t.scale*24/a+n:0}}function vc(e,t,r,i){let n=(e-t)**2;return i?e<t?n/2:n*2:n+Math.abs(r)*r}function bc(e){return/^\s+$/u.test(e)}function Fv(e,t,r){let i=0;return(e===10||e===13)&&(i-=1e4),r&&(i+=150),(e===40||e===65288)&&(i+=50),(t===41||t===65289)&&(i+=50),i}function wc(e,t,r,i,n,a){let s=null,o=vc(t,r,n,a);for(let l of i){let u=vc(t-l.x,r,n,a)+l.badness;u<=o&&(s=l,o=u)}return{index:e,x:t,priorBreak:s,badness:o}}function Nd(e){return e?Nd(e.priorBreak).concat(e.index):[]}var hu=class ol{constructor(t="",r=[],i=[]){this.text=t,this.sections=r,this.sectionIndex=i,this.imageSectionID=null,this.cachedGraphemes=null}graphemes(){return this.cachedGraphemes??=nl(this.text),this.cachedGraphemes}static fromFeature(t,r,i,n){let a=new ol;for(let s of t.sections)s.image?a.addImageSection(s):a.addTextSection(s,r);return i&&a.verticalizePunctuation(n),a}length(){return this.graphemes().length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}verticalizePunctuation(t={},r){let i=Sv(this.text),n=0;this.cachedGraphemes=this.graphemes().map((a,s)=>{let o=i.slice(n,n+a.length);n+=a.length;let l=this.getSection(s);return r?.[s]!==!1&&"fontStack"in l&&t[l.fontStack]?.vertical?.[a]?a:o}),this.text=this.cachedGraphemes.join("")}hasZeroWidthSpaces(){return this.text.includes("\u200B")}trim(){let t=this.graphemes(),r=0;for(;r<t.length&&bc(t[r]);)r++;let i=t.length;for(;i>r&&bc(t[i-1]);)i--;this.text=t.slice(r,i).join(""),this.sectionIndex=this.sectionIndex.slice(r,i),this.cachedGraphemes=null}substring(t,r){let i=this.graphemes().slice(t,r).join(""),n=this.sectionIndex.slice(t,r);return new ol(i,this.sections,n)}toCodeUnitIndex(t){return this.graphemes().slice(0,t).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,r)=>Math.max(t,this.sections[r].scale),0)}getMaxImageSize(t){let r=0,i=0;for(let n=0;n<this.length();n++){let a=this.getSection(n);if("imageName"in a){let s=t[a.imageName];if(!s)continue;let o=s.displaySize;r=Math.max(r,o[0]),i=Math.max(i,o[1])}}return{maxImageWidth:r,maxImageHeight:i}}_appendSection(t,r){let i=this.graphemes(),n=i.length>0?i[i.length-1]:"",a=nl(n+t);this.text+=t,this.cachedGraphemes=i.slice(0,n?-1:void 0).concat(a);let s=a.length-+!!n;for(let o=0;o<s;o++)this.sectionIndex.push(r)}addTextSection(t,r){this.sections.push({scale:t.scale||1,verticalAlign:t.verticalAlign||"bottom",fontStack:t.fontStack||r}),this._appendSection(t.text,this.sections.length-1)}addImageSection(t){let r=t.image?t.image.name:"";if(r.length===0){Pe("Can't add FormattedSection with an empty image.");return}let i=this.getNextImageSectionCharCode();i?(this.sections.push({scale:1,verticalAlign:t.verticalAlign||"bottom",imageName:r}),this._appendSection(String.fromCharCode(i),this.sections.length-1)):Pe("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(t,r,i,n,a){let s=this.determineTotalWidth(t,i,n,a);if(t>=0&&s>0&&s<=r&&!/[\n\r]/.test(this.text))return[this.length()];let o=[],l=s/Math.max(1,Math.ceil(s/r)),u=this.hasZeroWidthSpaces(),h=this.graphemes(),c=null,p=0,f=0;for(let d=0;d<h.length;d++){let y=h[d];if(d>0){let m=h[d-1].codePointAt(0),g=y.codePointAt(0),x=K2(m),v=pc(m)&&pc(g);(Av[m]||x||"imageName"in this.getSection(d-1)||h[d+1]!==void 0&&Ev[g]||v&&(c??=wv(this.text)).has(f))&&o.push(wc(d,p,l,o,Fv(m,g,x&&u),!1))}cn(y.codePointAt(0))||(p+=xc(y,this.getSection(d),i,n,t,a)),f+=y.length}return Nd(wc(this.length(),p,l,o,0,!0))}determineTotalWidth(t,r,i,n){let a=0,s=0;for(let o of this.graphemes()){let l=this.getSection(s);a+=xc(o,l,r,i,t,n),s++}return a}};function Iv(){return(function(e){var t={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},r={},i={};r.L=1,i[1]="L",Object.keys(t).forEach(function(N,ae){r[N]=1<<ae+1,i[r[N]]=N}),Object.freeze(r);var n=r.LRI|r.RLI|r.FSI,a=r.L|r.R|r.AL,s=r.B|r.S|r.WS|r.ON|r.FSI|r.LRI|r.RLI|r.PDI,o=r.BN|r.RLE|r.LRE|r.RLO|r.LRO|r.PDF,l=r.S|r.WS|r.B|n|r.PDI|o,u=null;function h(){if(!u){u=new Map;var N=0;for(var ae in t)if(t.hasOwnProperty(ae))for(var re=t[ae],k="",Q=void 0,G=!1,H=0,Y=0;Y<=re.length+1;Y+=1){var ye=re[Y];if(ye!==","&&Y!==re.length)ye==="+"?(G=!0,H=N=H+parseInt(k,36),k=""):k+=ye;else{G?Q=N+parseInt(k,36):(H=N=H+parseInt(k,36),Q=N),G=!1,k="",H=Q;for(var we=N;we<Q+1;we+=1)u.set(we,r[ae])}}}}function c(N){return h(),u.get(N.codePointAt(0))||r.L}function p(N){return i[c(N)]}var f={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function d(N,ae){var re=0,k=new Map,Q=ae&&new Map,G;return N.split(",").forEach(function H(Y){if(Y.indexOf("+")!==-1)for(var ye=+Y;ye--;)H(G);else{G=Y;var we=Y.split(">"),ne=we[0],ke=we[1];ne=String.fromCodePoint(re+=parseInt(ne,36)),ke=String.fromCodePoint(re+=parseInt(ke,36)),k.set(ne,ke),ae&&Q.set(ke,ne)}}),{map:k,reverseMap:Q}}var y,m,g;function x(){if(!y){var N=d(f.pairs,!0),ae=N.map,re=N.reverseMap;y=ae,m=re,g=d(f.canonical,!1).map}}function v(N){return x(),y.get(N)||null}function b(N){return x(),m.get(N)||null}function w(N){return x(),g.get(N)||null}var S=r.L,D=r.R,A=r.EN,E=r.ES,V=r.ET,M=r.AN,O=r.CS,R=r.B,T=r.S,I=r.ON,z=r.BN,$=r.NSM,j=r.AL,ie=r.LRO,se=r.RLO,he=r.LRE,oe=r.RLE,de=r.PDF,tt=r.LRI,rt=r.RLI,Qt=r.FSI,Ze=r.PDI;function Sr(N,ae){for(var re=125,k=new Uint32Array(N.length),Q=0;Q<N.length;Q++)k[Q]=c(N[Q]);var G=new Map;function H(Ge,ut){var Ye=k[Ge];k[Ge]=ut,G.set(Ye,G.get(Ye)-1),Ye&s&&G.set(s,G.get(s)-1),G.set(ut,(G.get(ut)||0)+1),ut&s&&G.set(s,(G.get(s)||0)+1)}for(var Y=new Uint8Array(N.length),ye=new Map,we=[],ne=null,ke=0;ke<N.length;ke++)ne||we.push(ne={start:ke,end:N.length-1,level:ae==="rtl"?1:ae==="ltr"?0:th(ke,!1)}),k[ke]&R&&(ne.end=ke,ne=null);for(var pi=oe|he|se|ie|n|Ze|de|R,rr=function(Ge){return Ge+(Ge&1?1:2)},Ot=function(Ge){return Ge+(Ge&1?2:1)},Rt=0;Rt<we.length;Rt++){ne=we[Rt];var ue=[{_level:ne.level,_override:0,_isolate:0}],_e=void 0,kt=0,$t=0,rs=0;G.clear();for(var ze=ne.start;ze<=ne.end;ze++){var Le=k[ze];if(_e=ue[ue.length-1],G.set(Le,(G.get(Le)||0)+1),Le&s&&G.set(s,(G.get(s)||0)+1),Le&pi)if(Le&(oe|he)){Y[ze]=_e._level;var ku=(Le===oe?Ot:rr)(_e._level);ku<=re&&!kt&&!$t?ue.push({_level:ku,_override:0,_isolate:0}):kt||$t++}else if(Le&(se|ie)){Y[ze]=_e._level;var Tu=(Le===se?Ot:rr)(_e._level);Tu<=re&&!kt&&!$t?ue.push({_level:Tu,_override:Le&se?D:S,_isolate:0}):kt||$t++}else if(Le&n){Le&Qt&&(Le=th(ze+1,!0)===1?rt:tt),Y[ze]=_e._level,_e._override&&H(ze,_e._override);var Cu=(Le===rt?Ot:rr)(_e._level);Cu<=re&&kt===0&&$t===0?(rs++,ue.push({_level:Cu,_override:0,_isolate:1,_isolInitIndex:ze})):kt++}else if(Le&Ze){if(kt>0)kt--;else if(rs>0){for($t=0;!ue[ue.length-1]._isolate;)ue.pop();var is=ue[ue.length-1]._isolInitIndex;is!=null&&(ye.set(is,ze),ye.set(ze,is)),ue.pop(),rs--}_e=ue[ue.length-1],Y[ze]=_e._level,_e._override&&H(ze,_e._override)}else Le&de?(kt===0&&($t>0?$t--:!_e._isolate&&ue.length>1&&(ue.pop(),_e=ue[ue.length-1])),Y[ze]=_e._level):Le&R&&(Y[ze]=ne.level);else Y[ze]=_e._level,_e._override&&Le!==z&&H(ze,_e._override)}for(var Er=[],mt=null,ir=ne.start;ir<=ne.end;ir++){var ns=k[ir];if(!(ns&o)){var Mu=Y[ir],Pu=ns&n,r1=ns===Ze;mt&&Mu===mt._level?(mt._end=ir,mt._endsWithIsolInit=Pu):Er.push(mt={_start:ir,_end:ir,_level:Mu,_startsWithPDI:r1,_endsWithIsolInit:Pu})}}for(var as=[],An=0;An<Er.length;An++){var En=Er[An];if(!En._startsWithPDI||En._startsWithPDI&&!ye.has(En._start)){for(var ss=[mt=En],Bu=void 0;mt&&mt._endsWithIsolInit&&(Bu=ye.get(mt._end))!=null;)for(var Fn=An+1;Fn<Er.length;Fn++)if(Er[Fn]._start===Bu){ss.push(mt=Er[Fn]);break}for(var Fr=[],os=0;os<ss.length;os++)for(var zu=ss[os],ls=zu._start;ls<=zu._end;ls++)Fr.push(ls);for(var i1=Y[Fr[0]],Lu=ne.level,In=Fr[0]-1;In>=0;In--)if(!(k[In]&o)){Lu=Y[In];break}var us=Fr[Fr.length-1],n1=Y[us],Vu=ne.level;if(!(k[us]&n)){for(var kn=us+1;kn<=ne.end;kn++)if(!(k[kn]&o)){Vu=Y[kn];break}}as.push({_seqIndices:Fr,_sosType:Math.max(Lu,i1)%2?D:S,_eosType:Math.max(Vu,n1)%2?D:S})}}for(var hs=0;hs<as.length;hs++){var cs=as[hs],q=cs._seqIndices,fi=cs._sosType,a1=cs._eosType,Ir=Y[q[0]]&1?D:S;if(G.get($))for(var Tn=0;Tn<q.length;Tn++){var Ou=q[Tn];if(k[Ou]&$){for(var ps=fi,Cn=Tn-1;Cn>=0;Cn--)if(!(k[q[Cn]]&o)){ps=k[q[Cn]];break}H(Ou,ps&(n|Ze)?I:ps)}}if(G.get(A))for(var Mn=0;Mn<q.length;Mn++){var Ru=q[Mn];if(k[Ru]&A)for(var Pn=Mn-1;Pn>=-1;Pn--){var $u=Pn===-1?fi:k[q[Pn]];if($u&a){$u===j&&H(Ru,M);break}}}if(G.get(j))for(var fs=0;fs<q.length;fs++){var Nu=q[fs];k[Nu]&j&&H(Nu,D)}if(G.get(E)||G.get(O))for(var di=1;di<q.length-1;di++){var ds=q[di];if(k[ds]&(E|O)){for(var kr=0,ys=0,ms=di-1;ms>=0&&(kr=k[q[ms]],kr&o);ms--);for(var gs=di+1;gs<q.length&&(ys=k[q[gs]],ys&o);gs++);kr===ys&&(k[ds]===E?kr===A:kr&(A|M))&&H(ds,kr)}}if(G.get(A)){for(var gt=0;gt<q.length;gt++)if(k[q[gt]]&A){for(var Bn=gt-1;Bn>=0&&k[q[Bn]]&(V|o);Bn--)H(q[Bn],A);for(gt++;gt<q.length&&k[q[gt]]&(V|o|A);gt++)k[q[gt]]!==A&&H(q[gt],A)}}if(G.get(V)||G.get(E)||G.get(O))for(var yi=0;yi<q.length;yi++){var Uu=q[yi];if(k[Uu]&(V|E|O)){H(Uu,I);for(var zn=yi-1;zn>=0&&k[q[zn]]&o;zn--)H(q[zn],I);for(var Ln=yi+1;Ln<q.length&&k[q[Ln]]&o;Ln++)H(q[Ln],I)}}if(G.get(A))for(var xs=0,ju=fi;xs<q.length;xs++){var qu=q[xs],vs=k[qu];vs&A?ju===S&&H(qu,S):vs&a&&(ju=vs)}if(G.get(s)){for(var mi=D|A|M,Gu=mi|S,Vn=[],Tr=[],Cr=0;Cr<q.length;Cr++)if(k[q[Cr]]&s){var gi=N[q[Cr]],Yu=void 0;if(v(gi)!==null)if(Tr.length<63)Tr.push({char:gi,seqIndex:Cr});else break;else if((Yu=b(gi))!==null)for(var xi=Tr.length-1;xi>=0;xi--){var bs=Tr[xi].char;if(bs===Yu||bs===b(w(gi))||v(w(bs))===gi){Vn.push([Tr[xi].seqIndex,Cr]),Tr.length=xi;break}}}Vn.sort(function(Ge,ut){return Ge[0]-ut[0]});for(var ws=0;ws<Vn.length;ws++){for(var Xu=Vn[ws],On=Xu[0],_s=Xu[1],Zu=!1,xt=0,Ds=On+1;Ds<_s;Ds++){var Wu=q[Ds];if(k[Wu]&Gu){Zu=!0;var Hu=k[Wu]&mi?D:S;if(Hu===Ir){xt=Hu;break}}}if(Zu&&!xt){xt=fi;for(var Ss=On-1;Ss>=0;Ss--){var Ju=q[Ss];if(k[Ju]&Gu){var Ku=k[Ju]&mi?D:S;xt=Ku===Ir?Ir:Ku;break}}}if(xt){if(k[q[On]]=k[q[_s]]=xt,xt!==Ir){for(var vi=On+1;vi<q.length;vi++)if(!(k[q[vi]]&o)){c(N[q[vi]])&$&&(k[q[vi]]=xt);break}}if(xt!==Ir){for(var bi=_s+1;bi<q.length;bi++)if(!(k[q[bi]]&o)){c(N[q[bi]])&$&&(k[q[bi]]=xt);break}}}}for(var Nt=0;Nt<q.length;Nt++)if(k[q[Nt]]&s){for(var Qu=Nt,As=Nt,Es=fi,wi=Nt-1;wi>=0;wi--)if(k[q[wi]]&o)Qu=wi;else{Es=k[q[wi]]&mi?D:S;break}for(var eh=a1,_i=Nt+1;_i<q.length;_i++)if(k[q[_i]]&(s|o))As=_i;else{eh=k[q[_i]]&mi?D:S;break}for(var Fs=Qu;Fs<=As;Fs++)k[q[Fs]]=Es===eh?Es:Ir;Nt=As}}}for(var We=ne.start;We<=ne.end;We++){var s1=Y[We],Rn=k[We];if(s1&1?Rn&(S|A|M)&&Y[We]++:Rn&D?Y[We]++:Rn&(M|A)&&(Y[We]+=2),Rn&o&&(Y[We]=We===0?ne.level:Y[We-1]),We===ne.end||c(N[We])&(T|R))for(var $n=We;$n>=0&&c(N[$n])&l;$n--)Y[$n]=ne.level}}return{levels:Y,paragraphs:we};function th(Ge,ut){for(var Ye=Ge;Ye<N.length;Ye++){var Ut=k[Ye];if(Ut&(D|j))return 1;if(Ut&(R|S)||ut&&Ut===Ze)return 0;if(Ut&n){var rh=o1(Ye);Ye=rh===-1?N.length:rh}}return 0}function o1(Ge){for(var ut=1,Ye=Ge+1;Ye<N.length;Ye++){var Ut=k[Ye];if(Ut&R)break;if(Ut&Ze){if(--ut===0)return Ye}else Ut&n&&ut++}return-1}}var Ar="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",Vt;function yt(){if(!Vt){var N=d(Ar,!0),ae=N.map;N.reverseMap.forEach(function(re,k){ae.set(k,re)}),Vt=ae}}function er(N){return yt(),Vt.get(N)||null}function ci(N,ae,re,k){var Q=N.length;re=Math.max(0,re==null?0:+re),k=Math.min(Q-1,k==null?Q-1:+k);for(var G=new Map,H=re;H<=k;H++)if(ae[H]&1){var Y=er(N[H]);Y!==null&&G.set(H,Y)}return G}function Be(N,ae,re,k){var Q=N.length;re=Math.max(0,re==null?0:+re),k=Math.min(Q-1,k==null?Q-1:+k);var G=[];return ae.paragraphs.forEach(function(H){var Y=Math.max(re,H.start),ye=Math.min(k,H.end);if(Y<ye){for(var we=ae.levels.slice(Y,ye+1),ne=ye;ne>=Y&&c(N[ne])&l;ne--)we[ne]=H.level;for(var ke=H.level,pi=1/0,rr=0;rr<we.length;rr++){var Ot=we[rr];Ot>ke&&(ke=Ot),Ot<pi&&(pi=Ot|1)}for(var Rt=ke;Rt>=pi;Rt--)for(var ue=0;ue<we.length;ue++)if(we[ue]>=Rt){for(var _e=ue;ue+1<we.length&&we[ue+1]>=Rt;)ue++;ue>_e&&G.push([_e+Y,ue+Y])}}}),G}function It(N,ae,re,k){var Q=tr(N,ae,re,k),G=[].concat(N);return Q.forEach(function(H,Y){G[Y]=(ae.levels[H]&1?er(N[H]):null)||N[H]}),G.join("")}function tr(N,ae,re,k){for(var Q=Be(N,ae,re,k),G=[],H=0;H<N.length;H++)G[H]=H;return Q.forEach(function(Y){for(var ye=Y[0],we=Y[1],ne=G.slice(ye,we+1),ke=ne.length;ke--;)G[we-ke]=ne[ke]}),G}return e.closingToOpeningBracket=b,e.getBidiCharType=c,e.getBidiCharTypeName=p,e.getCanonicalBracket=w,e.getEmbeddingLevels=Sr,e.getMirroredCharacter=er,e.getMirroredCharactersMap=ci,e.getReorderSegments=Be,e.getReorderedIndices=tr,e.getReorderedString=It,e.openingToClosingBracket=v,Object.defineProperty(e,"__esModule",{value:!0}),e})({})}var cu=Iv(),kv=/[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/,Tv=new Set(["WS","FSI","LRI","RLI","PDI"]),Cv=new Set(["S","B"]);function Mv(e,t,r,i){let n=[],a=r;for(let s of nl(e.slice(r,i)))n.push({index:a,text:s,level:t[a]}),a+=s.length;return n}function Pv(e,t){let r=!0;for(let i=e.length-1;i>=0;i--){let n=cu.getBidiCharTypeName(e[i].text[0]);Cv.has(n)?(e[i].level=t,r=!0):r&&Tv.has(n)?e[i].level=t:r=!1}}function Bv(e,t){let r=t,i=1/0;for(let{level:a}of e)a>r&&(r=a),(a|1)<i&&(i=a|1);let n=e.slice();for(let a=r;a>=i;a--)for(let s=0;s<n.length;s++){if(n[s].level<a)continue;let o=s;for(;o+1<n.length&&n[o+1].level>=a;)o++;for(let l=s,u=o;l<u;l++,u--)[n[l],n[u]]=[n[u],n[l]];s=o}return n}function zv(e){return e.level%2==0?e.text:cu.getMirroredCharacter(e.text)??e.text}function Lv(e,t){return e.find(r=>t>=r.start&&t<=r.end)?.level??0}function Vv(e,t,r,i,n){let a=Mv(e,t,i,n);Pv(a,r);let s="",o=[];for(let l of Bv(a,r)){if(kv.test(l.text))continue;let u=zv(l);s+=u,o.push(...Array(u.length).fill(l.index))}return{text:s,sourceIndices:o}}function Ov(e,t){let r=t.filter(a=>a>0&&a<e.length),i=[...new Set([0,...r,e.length])].sort((a,s)=>a-s),n=[];for(let a=0;a+1<i.length;a++)n.push([i[a],i[a+1]]);return n}function Ud(e,t){let{levels:r,paragraphs:i}=cu.getEmbeddingLevels(e);return Ov(e,t.concat(i.map(n=>n.start))).map(([n,a])=>Vv(e,r,Lv(i,n),n,a))}function Rv(e,t){return Ud(e,t).map(r=>r.text)}function $v(e,t,r){return Ud(e,r).map(i=>[i.text,i.sourceIndices.map(n=>t[n]??0)])}var ll=4294967296,_c=1/ll,Dc=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),jd=class{constructor(e){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(e,t,r=this.length){let i;for(;i=this.nextField(r);)e(i,t,this);return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*ll;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*ll;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let t=this.buf,r=t[this.pos++];if(r<128)return r;let i=r&127,n;return n=t[this.pos++],i|=(n&127)<<7,n<128||(n=t[this.pos++],i|=(n&127)<<14,n<128)||(n=t[this.pos++],i|=(n&127)<<21,n<128)?i:(n=t[this.pos],i|=(n&15)<<28,Uv(i,e,this))}readSVarint(){let e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Dc?Dc.decode(this.buf.subarray(t,e)):rb(this.buf,t,e)}readBytes(){let e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){let r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}nextField(e=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=e)return 0;let t=this.readVarint();return this.type=t&7,this._valueStart=this.pos,t>>>3}skip(e){let t=e&7;if(t===0)for(;this.buf[this.pos++]>127;);else if(t===2)this.pos=this.readVarint()+this.pos;else if(t===5)this.pos+=4;else if(t===1)this.pos+=8;else throw Error(`Unimplemented type: ${t}`)}},Nv=class{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.length=this.buf.length}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){let r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.dataView=new DataView(r.buffer),this.length=t}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*_c),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*_c),!0),this.pos+=8}writeVarint(e){e=+e||0,e>=0&&e<128?(this.pos>=this.length&&this.realloc(1),this.buf[this.pos++]=e):e>268435455||e<0?qv(e,this):(this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),e<=127||(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),e<=127||(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;let t=this.pos;this.pos=ib(this.buf,e,this.pos);let r=this.pos-t;r>=128&&Sc(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){let t=e.length;this.writeVarint(t),this.realloc(t),this.buf.set(e,this.pos),this.pos+=t}writeRawMessage(e,t){this.pos++;let r=this.pos;e(t,this);let i=this.pos-r;i>=128&&Sc(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(e,t,r){this.writeTag(e,2),this.writeRawMessage(t,r)}writePackedVarint(e,t){t.length&&this.writeMessage(e,Xv,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,Zv,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,Jv,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,Wv,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,Hv,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,Kv,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,Qv,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,eb,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,tb,t)}writeBytesField(e,t){this.writeTag(e,2),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,5),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,5),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,1),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,1),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,0),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,0),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,2),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,5),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,1),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}};function Uv(e,t,r){let i=r.buf,n,a;if(a=i[r.pos++],n=(a&112)>>4,a<128||(a=i[r.pos++],n|=(a&127)<<3,a<128)||(a=i[r.pos++],n|=(a&127)<<10,a<128)||(a=i[r.pos++],n|=(a&127)<<17,a<128)||(a=i[r.pos++],n|=(a&127)<<24,a<128)||(a=i[r.pos++],n|=(a&1)<<31,a<128))return jv(e,n,t);throw Error("Expected varint not more than 10 bytes")}function jv(e,t,r){return r?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function qv(e,t){let r,i;if(e>=0?(r=e%4294967296|0,i=e/4294967296|0):(r=~(-e%4294967296),i=~(-e/4294967296),r^4294967295?r=r+1|0:(r=0,i=i+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw Error("Given varint doesn't fit into 10 bytes");t.realloc(10),Gv(r,i,t),Yv(i,t)}function Gv(e,t,r){r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos]=e&127}function Yv(e,t){let r=(e&7)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function Sc(e,t,r){let i=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));r.realloc(i),r.buf.copyWithin(e+i,e,r.pos)}function Xv(e,t){let r=e.length,i=t.buf,n=t.pos,a=t.length;for(let s=0;s<r;s++){let o=e[s];if(o<0||n+10>a)t.pos=n,t.writeVarint(o),i=t.buf,n=t.pos,a=t.length;else{for(;o>127;)i[n++]=o%128|128,o=Math.floor(o/128);i[n++]=o}}t.pos=n}function Zv(e,t){for(let r=0;r<e.length;r++)t.writeSVarint(e[r])}function Wv(e,t){for(let r=0;r<e.length;r++)t.writeFloat(e[r])}function Hv(e,t){for(let r=0;r<e.length;r++)t.writeDouble(e[r])}function Jv(e,t){for(let r=0;r<e.length;r++)t.writeBoolean(e[r])}function Kv(e,t){for(let r=0;r<e.length;r++)t.writeFixed32(e[r])}function Qv(e,t){for(let r=0;r<e.length;r++)t.writeSFixed32(e[r])}function eb(e,t){for(let r=0;r<e.length;r++)t.writeFixed64(e[r])}function tb(e,t){for(let r=0;r<e.length;r++)t.writeSFixed64(e[r])}function rb(e,t,r){let i="",n=t;for(;n<r;){let a=e[n],s=null,o=a>239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,h;o===1?a<128&&(s=a):o===2?(l=e[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=e[n+1],u=e[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=e[n+1],u=e[n+2],h=e[n+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function ib(e,t,r){for(let i=0,n,a;i<t.length;i++){if(n=t.charCodeAt(i),n>55295&&n<57344)if(a){if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,a=n;continue}n=a-55296<<10|n-56320|65536,a=null}else{n>56319||i+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):a=n;continue}else a&&=(e[r++]=239,e[r++]=191,e[r++]=189,null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=n&63|128)}return r}function nb(e){return typeof e?.renderWithWebGL=="function"}function qd(e){let t=0,r=0;for(let s of e)t+=s.w*s.h,r=Math.max(r,s.w);e.sort((s,o)=>o.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],n=0,a=0;for(let s of e)for(let o=i.length-1;o>=0;o--){let l=i[o];if(!(s.w>l.w||s.h>l.h)){if(s.x=l.x,s.y=l.y,a=Math.max(a,s.y+s.h),n=Math.max(n,s.x+s.w),s.w===l.w&&s.h===l.h){let u=i.pop();u&&o<i.length&&(i[o]=u)}else s.h===l.h?(l.x+=s.w,l.w-=s.w):s.w===l.w?(l.y+=s.h,l.h-=s.h):(i.push({x:l.x+s.w,y:l.y,w:l.w-s.w,h:s.h}),l.y+=s.h,l.h-=s.h);break}}return{w:n,h:a,fill:t/(n*a)||0}}var Gd=class{constructor(e,{pixelRatio:t,version:r,isWebGLImage:i=!1,stretchX:n,stretchY:a,content:s,textFitWidth:o,textFitHeight:l}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=n,this.stretchY=a,this.content=s,this.version=r,this.needsFirstWebGLRender=i,this.textFitWidth=o,this.textFitHeight=l}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}},Yd=class{constructor(e,t){let r={},i={};this.haveRenderCallbacks=[],this.patchedUpdateVersion=-1;let n=[];this.addImages(e,r,n),this.addImages(t,i,n);let{w:a,h:s}=qd(n),o=new Ke({width:a||1,height:s||1});for(let l in e){let u=e[l];if(u.isWebGLImage)continue;let h=r[l].paddedRect;Ke.copy(u.data,o,{x:0,y:0},{x:h.x+1,y:h.y+1},u.data)}for(let l in t){let u=t[l],h=i[l].paddedRect,c=h.x+1,p=h.y+1,f=u.data.width,d=u.data.height;Ke.copy(u.data,o,{x:0,y:0},{x:c,y:p},u.data),Ke.copy(u.data,o,{x:0,y:d-1},{x:c,y:p-1},{width:f,height:1}),Ke.copy(u.data,o,{x:0,y:0},{x:c,y:p+d},{width:f,height:1}),Ke.copy(u.data,o,{x:f-1,y:0},{x:c-1,y:p},{width:1,height:d}),Ke.copy(u.data,o,{x:0,y:0},{x:c+f,y:p},{width:1,height:d})}this.image=o,this.iconPositions=r,this.patternPositions=i}addImages(e,t,r){for(let i in e){let n=e[i],a={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(a),t[i]=new Gd(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,t){if(e.dispatchRenderCallbacks(this.haveRenderCallbacks),this.patchedUpdateVersion!==e.updateVersion){this.patchedUpdateVersion=e.updateVersion;for(let r in this.iconPositions)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t);for(let r in this.patternPositions)this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)}}patchUpdatedImage(e,t,r){if(!e||!t||!e.needsFirstWebGLRender&&e.version===t.version)return;e.needsFirstWebGLRender=!1,e.version=t.version;let[i,n]=e.tl,a=t.userImage?.data;if(!nb(a)){r.update(t.data,void 0,{x:i,y:n});return}let{width:s,height:o}=t.data;r.context.setCustomLayerDefaults(),a.renderWithWebGL({gl:r.context.gl,texture:r.texture,x:i,y:n,width:s,height:o}),r.context.setDirty()}};P("ImagePosition",Gd),P("ImageAtlas",Yd);var Xd=(function(e){return e[e.none=0]="none",e[e.horizontal=1]="horizontal",e[e.vertical=2]="vertical",e[e.horizontalOnly=3]="horizontalOnly",e})(Xd||{});function ab(e){for(let t of e)if(t.positionedGlyphs.length!==0)return!1;return!0}function sb(e,t){let r=[],i=0;for(let n of t)r.push(e.substring(i,n)),i=n;return i<e.length()&&r.push(e.substring(i,e.length())),r}var Ac=/^\p{gc=M}$/u;function ob(e){let t=[],r=0;for(;r<e.length;){if(!Ac.test(e[r])){t.push(r),r++;continue}let i=r;for(;i<e.length&&Ac.test(e[i]);)i++;let n=e[i];if(n!==void 0&&Rd(n.codePointAt(0))){t.push(i);for(let a=i-1;a>=r;a--)t.push(a);r=i+1}else{for(let a=r;a<i;a++)t.push(a);r=i}}return t}function lb(e){let t=[],r=0;for(let i of e.graphemes())t.push(...Array(i.length).fill(e.sectionIndex[r])),r++;return t}function ub(e,t){let r=t.map(a=>e.toCodeUnitIndex(a)),i=ni.isParsed()?ni:null;if(e.sections.length===1)return i?i.processBidirectionalText(e.toString(),r).map(a=>Ec(a,e.sections,[...a].map(()=>0))):Rv(e.toString(),r).map(a=>ul([...a],e.sections,[...a].map(()=>0)));let n=lb(e);return i?i.processStyledBidirectionalText(e.text,n,r).map(([a,s])=>Ec(a,e.sections,s)):$v(e.text,n,r).map(([a,s])=>{let o=[...a];return ul(o,e.sections,Zd(o).map(l=>s[l]??0))})}function ul(e,t,r){let i=new hu(e.join(""),t,[]),n=0;for(let a of i.graphemes())i.sectionIndex.push(r[n]??0),n+=[...a].length;return i}function Zd(e){let t=[],r=0;for(let i of e)t.push(r),r+=i.length;return t}function Ec(e,t,r){let i=[...e],n=Zd(i),a=ob(i);return ul(a.map(s=>i[s]),t,a.map(s=>r[n[s]]??0))}function Qn(e,t,r,i,n,a,s,o,l,u,h,c,p,f,d){let y=hu.fromFeature(e,n,c===2,t),m=y.determineLineBreaks(u,a,t,i,f),g=$d(y.text)?ub(y,m):sb(y,m),x=[],v={positionedLines:x,text:y.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:c,iconsInText:!1,verticalizable:!1};return db(v,t,r,i,g,s,o,l,c,u,p,d),!ab(x)&&v}function Wd(e){let t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function hb(e,t,r){let i=t.getMaxScale()*24,{maxImageWidth:n,maxImageHeight:a}=t.getMaxImageSize(e),s=Math.max(i,a*r);return{verticalLineContentWidth:Math.max(i,n*r),horizontalLineContentHeight:s}}function Hd(e){switch(e){case"top":return 0;case"center":return .5;default:return 1}}function cb(e,t){return e?.rect?e:t?{rect:null,metrics:t.metrics}:null}function Jd(e,t,r){return!(e===1||!t&&!_n(r)||t&&(cn(r)||Od(r)))}function ca(e){return/\p{Nd}/u.test(String.fromCodePoint(e))}function Kd(e){return/\p{Lu}/u.test(String.fromCodePoint(e))}function Qd(e){let t=e.some(ca)&&e.every(i=>ca(i)||Qa(i)),r=e.length<=3&&e.every(i=>Kd(i)||ca(i));return t||r}function ey(e){return(ca(e)||Kd(e))&&!Od(e)}function pb(e,t){return t?Jd(2,!0,e):!ai(e)||ey(e)||Qa(e)}function fb(e,t,r){let i=!1;for(let n=0;n<e.length;n++){if(t[n])continue;let a=Nr[e[n]];if(a&&(n===0||t[n-1])&&(n===e.length-1||t[n+1])){if(t[n]=!0,r[n])continue;e[n]=a,i=!0}}return i}function Fc(e,t,r){for(;t>=0&&t<e.length&&cn(e[t]);)t+=r;let i=[];for(;t>=0&&t<e.length&&!_n(e[t])&&!cn(e[t]);)i.push(e[t]),t+=r;return!Qd(i)&&!i.every(Qa)&&i.some(ai)}function ty(e,t){let r=e.graphemes().slice(),i=r.map(o=>o.codePointAt(0)),n=r.map((o,l)=>{let u=e.getSection(l);return"fontStack"in u&&!!t[u.fontStack]?.vertical?.[o]}),a=i.map(_n),s=o=>!a[o]&&!cn(i[o])&&!("imageName"in e.getSection(o));for(let o=0;o<i.length;o++){if(!s(o))continue;let l=o;for(;l+1<i.length&&s(l+1);)l++;let u=i.slice(o,l+1),h=Qd(u),c=u.every(Qa),p=c&&(Fc(i,o-1,-1)||Fc(i,l+1,1)),f=!h&&u.some(ai);for(let d=o;d<=l;d++)a[d]=h&&ey(i[d])||n[d]&&!p&&(c||!f&&!ai(i[d]));o=l}if(n.some((o,l)=>o&&!a[l])){let o=e.text;if(e.verticalizePunctuation(t,a),e.text!==o)return ty(e,t)}return fb(r,a,n)&&(e.text=r.join(""),e.cachedGraphemes=r),a}function db(e,t,r,i,n,a,s,o,l,u,h,c){let p=0,f=0,d=0,y=0,m=o==="right"?1:o==="left"?0:.5,g=24/c,x=0;for(let w of n){w.trim();let S=w.getMaxScale(),D={positionedGlyphs:[],lineOffset:0};e.positionedLines[x]=D;let A=D.positionedGlyphs,E=0;if(!w.length()){f+=a,++x;continue}let V=hb(i,w,g),M=l===2&&!h?ty(w,t):null,O=w.graphemes();for(let I=0;I<O.length;I++){let z=w.getSection(I),$=O[I],j=$.codePointAt(0),ie=M?M[I]:Jd(l,h,j),se="fontStack"in z&&al($)&&!t[z.fontStack]?.default?.[$]?[...$]:[$];for(let he of se){let oe={glyph:he.codePointAt(0),grapheme:he,imageName:null,x:p,y:f+-17,vertical:ie,scale:1,fontStack:"",sectionIndex:w.getSectionIndex(I),metrics:null,rect:null},de;if("fontStack"in z){if(de=yb(z,he,ie,V,t,r),!de)continue;oe.fontStack=z.fontStack}else{if(e.iconsInText=!0,z.scale*=g,de=mb(z,ie,S,V,i),!de)continue;E=Math.max(E,de.imageOffset),oe.imageName=z.imageName}let{rect:tt,metrics:rt,baselineOffset:Qt}=de;if(oe.y+=Qt,oe.scale=z.scale,oe.metrics=rt,oe.rect=tt,A.push(oe),!ie)p+=rt.advance*z.scale+u;else{e.verticalizable=!0;let Ze="imageName"in z?rt.advance:24;p+=Ze*z.scale+u}}}if(A.length!==0){let I=p-u;d=Math.max(I,d),gb(A,0,A.length-1,m)}p=0;let R=(S-1)*24;D.lineOffset=Math.max(E,R);let T=a*S+E;f+=T,y=Math.max(T,y),++x}let{horizontalAlign:v,verticalAlign:b}=Wd(s);xb(e.positionedLines,m,v,b,d,y,a,f,n.length),e.top+=-b*f,e.bottom=e.top+f,e.left+=-v*d,e.right=e.left+d}function yb(e,t,r,i,n,a){let s=r&&n[e.fontStack]?.vertical?.[t]?"vertical":"default",o=a[e.fontStack]?.[s]?.[t],l=n[e.fontStack]?.[s]?.[t],u=cb(o,l);if(u===null)return null;let h;if(r)h=i.verticalLineContentWidth-e.scale*24;else{let c=Hd(e.verticalAlign);h=(i.horizontalLineContentHeight-e.scale*24)*c}return{rect:u.rect,metrics:u.metrics,baselineOffset:h}}function mb(e,t,r,i,n){let a=n[e.imageName];if(!a)return null;let s=a.paddedRect,o=a.displaySize,l={width:o[0],height:o[1],left:1,top:-3,advance:t?o[1]:o[0]},u;if(t)u=i.verticalLineContentWidth-o[1]*e.scale;else{let c=Hd(e.verticalAlign);u=(i.horizontalLineContentHeight-o[1]*e.scale)*c}let h=(t?o[0]:o[1])*e.scale-24*r;return{rect:s,metrics:l,baselineOffset:u,imageOffset:h}}function gb(e,t,r,i){if(i===0)return;let n=e[r],a=n.metrics.advance*n.scale,s=(e[r].x+a)*i;for(let o=t;o<=r;o++)e[o].x-=s}function xb(e,t,r,i,n,a,s,o,l){let u=(t-r)*n,h=0;h=a===s?-i*l*s+.5*s:-o*i- -17;for(let c of e)for(let p of c.positionedGlyphs)p.x+=u,p.y+=h}function vb(e,t,r){let{horizontalAlign:i,verticalAlign:n}=Wd(r),a=t[0],s=t[1],o=a-e.displaySize[0]*i,l=o+e.displaySize[0],u=s-e.displaySize[1]*n;return{image:e,top:u,bottom:u+e.displaySize[1],left:o,right:l}}function ry(e){let t=e.left,r=e.top,i=e.right-t,n=e.bottom-r,a=e.image.content[2]-e.image.content[0],s=e.image.content[3]-e.image.content[1],o=e.image.textFitWidth??"stretchOrShrink",l=e.image.textFitHeight??"stretchOrShrink",u=a/s;if(l==="proportional"){if(o==="stretchOnly"&&i/n<u||o==="proportional"){let h=Math.ceil(n*u);t*=h/i,i=h}}else if(o==="proportional"&&l==="stretchOnly"&&u!==0&&i/n>u){let h=Math.ceil(i/u);r*=h/n,n=h}return{x1:t,y1:r,x2:t+i,y2:r+n}}function Ic(e,t,r,i,n,a,s=1){let o=e.image,l;if(o.content){let v=o.content,b=o.pixelRatio||1;l=[v[0]/b,v[1]/b,o.displaySize[0]-v[2]/b,o.displaySize[1]-v[3]/b]}let u=s>0?a/s:a,h=s>0?1/s:1,c=t.left*u,p=t.right*u,f,d,y,m;r==="width"||r==="both"?(m=n[0]+c-i[3]*h,d=n[0]+p+i[1]*h):(m=n[0]+(c+p-o.displaySize[0])/2,d=m+o.displaySize[0]);let g=t.top*u,x=t.bottom*u;return r==="height"||r==="both"?(f=n[1]+g-i[0]*h,y=n[1]+x+i[2]*h):(f=n[1]+(g+x-o.displaySize[1])/2,y=f+o.displaySize[1]),{image:o,top:f,right:d,bottom:y,left:m,collisionPadding:l}}var kc=32640;function Tc(e,t){let{expression:r}=t;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new le(e+1))};if(r.kind==="source")return{kind:"source"};if(r.kind==="composite"){let{minZoom:i,maxZoom:n}=bb(r.zoomStops,e);return{kind:"composite",minZoom:i,maxZoom:n,interpolationType:r.interpolationType}}{let i=wb(r),n=r.evaluate(new le(e+1));return{kind:"camera",zoomStops:r.zoomStops,sizes:i,layoutSize:n,interpolationType:r.interpolationType}}}function bb(e,t){let r=0;for(;r<e.length&&e[r]<=t;)r++;r=Math.max(0,r-1);let i=r;for(;i<e.length&&e[i]<t+1;)i++;return i=Math.min(e.length-1,i),{minZoom:e[r],maxZoom:e[i]}}function wb(e){return e.zoomStops.map(t=>e.evaluate(new le(t===-1/0?e.zoomStops[1]-1:t)))}var Yr=class iy extends B{constructor(t,r,i,n){super(t,r),this.angle=i,n!==void 0&&(this.segment=n)}clone(){return new iy(this.x,this.y,this.angle,this.segment)}};P("Anchor",Yr);function ny(e,t,r,i,n){if(t.segment===void 0||r===0)return!0;let a=t,s=t.segment+1,o=0;for(;o>-r/2;){if(s--,s<0)return!1;o-=e[s].dist(a),a=e[s]}o+=e[s].dist(e[s+1]),s++;let l=[],u=0;for(;o<r/2;){let h=e[s-1],c=e[s],p=e[s+1];if(!p)return!1;let f=h.angleTo(c)-c.angleTo(p);for(f=Math.abs((f+3*Math.PI)%(Math.PI*2)-Math.PI),l.push({distance:o,angleDelta:f}),u+=f;o-l[0].distance>i;)u-=l.shift().angleDelta;if(u>n)return!1;s++,o+=c.dist(p)}return!0}function ay(e){let t=0;for(let r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function sy(e,t,r){return e?3/5*t*r:0}function oy(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function _b(e,t,r,i,n,a){let s=sy(r,n,a),o=oy(r,i)*a,l=0,u=ay(e)/2;for(let h=0;h<e.length-1;h++){let c=e[h],p=e[h+1],f=c.dist(p);if(l+f>u){let d=(u-l)/f,y=new Yr(fr.number(c.x,p.x,d),fr.number(c.y,p.y,d),p.angleTo(c),h);return y._round(),!s||ny(e,y,o,s,t)?y:void 0}l+=f}}function Db(e,t,r,i,n,a,s,o,l){let u=sy(i,a,s),h=oy(i,n),c=h*s,p=e[0].x===0||e[0].x===l||e[0].y===0||e[0].y===l;t-c<t/4&&(t=c+t/4);let f=a*2;return ly(e,p?t/2*o%t:(h/2+f)*s*o%t,t,u,r,c,p,!1,l)}function ly(e,t,r,i,n,a,s,o,l){let u=a/2,h=ay(e),c=0,p=t-r,f=[];for(let d=0;d<e.length-1;d++){let y=e[d],m=e[d+1],g=y.dist(m),x=m.angleTo(y);for(;p+r<c+g;){p+=r;let v=(p-c)/g,b=fr.number(y.x,m.x,v),w=fr.number(y.y,m.y,v);if(b>=0&&b<l&&w>=0&&w<l&&p-u>=0&&p+u<=h){let S=new Yr(b,w,x,d);S._round(),(!i||ny(e,S,a,i,n))&&f.push(S)}}c+=g}return o||f.length||s||(f=ly(e,c/2,r,i,n,a,s,!0,l)),f}function Sb(e,t,r,i,n){let a=[];for(let s of e){let o;for(let l=0;l<s.length-1;l++){let u=s[l],h=s[l+1];u.x<t&&h.x<t||(u.x<t?u=new B(t,u.y+(h.y-u.y)*((t-u.x)/(h.x-u.x)))._round():h.x<t&&(h=new B(t,u.y+(h.y-u.y)*((t-u.x)/(h.x-u.x)))._round()),u.y<r&&h.y<r||(u.y<r?u=new B(u.x+(h.x-u.x)*((r-u.y)/(h.y-u.y)),r)._round():h.y<r&&(h=new B(u.x+(h.x-u.x)*((r-u.y)/(h.y-u.y)),r)._round()),u.x>=i&&h.x>=i||(u.x>=i?u=new B(i,u.y+(h.y-u.y)*((i-u.x)/(h.x-u.x)))._round():h.x>=i&&(h=new B(i,u.y+(h.y-u.y)*((i-u.x)/(h.x-u.x)))._round()),u.y>=n&&h.y>=n||(u.y>=n?u=new B(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round():h.y>=n&&(h=new B(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round()),o&&u.equals(o[o.length-1])||(o=[u],a.push(o)),o.push(h)))))}}return a}function Ab(e,t,r,i,n,a){let s=Cc(e,t,r,n,0);return s=Cc(s,t,i,a,1),s}function Cc(e,t,r,i,n){switch(t){case 1:return Eb(e,r,i,n);case 2:return Mc(e,r,i,n,!1);case 3:return Mc(e,r,i,n,!0)}return[]}function Eb(e,t,r,i){let n=[];for(let a of e)for(let s of a){let o=i===0?s.x:s.y;o>=t&&o<=r&&n.push([s])}return n}function Fb(e,t,r,i,n){let a=i===0?Ib:kb,s=[],o=[];for(let h=0;h<e.length-1;h++){let c=e[h],p=e[h+1],f=i===0?c.x:c.y,d=i===0?p.x:p.y,y=!1;f<t?d>=t&&s.push(a(c,p,t)):f>r?d<=r&&s.push(a(c,p,r)):s.push(c),d<t&&f>=t&&(s.push(a(c,p,t)),y=!0),d>r&&f<=r&&(s.push(a(c,p,r)),y=!0),!n&&y&&(o.push(s),s=[])}let l=e.length-1,u=i===0?e[l].x:e[l].y;return u>=t&&u<=r&&s.push(e[l]),n&&s.length>0&&!s[0].equals(s[s.length-1])&&s.push(new B(s[0].x,s[0].y)),s.length>0&&o.push(s),o}function Mc(e,t,r,i,n){let a=[];for(let s of e){let o=Fb(s,t,r,i,n);o.length>0&&a.push(...o)}return a}function Ib(e,t,r){let i=(r-e.x)/(t.x-e.x);return new B(r,e.y+(t.y-e.y)*i)}function kb(e,t,r){let i=(r-e.y)/(t.y-e.y);return new B(e.x+(t.x-e.x)*i,r)}function Pc(e,t,r,i,n=1){let a=[],s=e.image,o=s.pixelRatio,l=s.paddedRect.w-2,u=s.paddedRect.h-2,h={x1:e.left,y1:e.top,x2:e.right,y2:e.bottom},c=s.stretchX||[[0,l]],p=s.stretchY||[[0,u]],f=(I,z)=>I+z[1]-z[0],d=c.reduce(f,0),y=p.reduce(f,0),m=l-d,g=u-y,x=0,v=d,b=0,w=y,S=0,D=m,A=0,E=g;if(s.content&&i){let I=s.content,z=I[2]-I[0],$=I[3]-I[1];(s.textFitWidth||s.textFitHeight)&&(h=ry(e)),x=ea(c,0,I[0]),b=ea(p,0,I[1]),v=ea(c,I[0],I[2]),w=ea(p,I[1],I[3]),S=I[0]-x,A=I[1]-b,D=z-v,E=$-w}let V=h.x1,M=h.y1,O=h.x2-V,R=h.y2-M,T=(I,z,$,j)=>{let ie=ta(I.stretch-x,v,O,V),se=ra(I.fixed-S,D,I.stretch,d),he=ta(z.stretch-b,w,R,M),oe=ra(z.fixed-A,E,z.stretch,y),de=ta($.stretch-x,v,O,V),tt=ra($.fixed-S,D,$.stretch,d),rt=ta(j.stretch-b,w,R,M),Qt=ra(j.fixed-A,E,j.stretch,y),Ze=new B(ie,he),Sr=new B(de,he),Ar=new B(de,rt),Vt=new B(ie,rt),yt=n/o,er=new B(se*yt,oe*yt),ci=new B(tt*yt,Qt*yt),Be=t*Math.PI/180;if(Be){let re=Math.sin(Be),k=Math.cos(Be),Q=[k,-re,re,k];Ze._matMult(Q),Sr._matMult(Q),Vt._matMult(Q),Ar._matMult(Q)}let It=I.stretch+I.fixed,tr=$.stretch+$.fixed,N=z.stretch+z.fixed,ae=j.stretch+j.fixed;return{tl:Ze,tr:Sr,bl:Vt,br:Ar,tex:{x:s.paddedRect.x+1+It,y:s.paddedRect.y+1+N,w:tr-It,h:ae-N},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:er,pixelOffsetBR:ci,minFontScaleX:D*yt/O,minFontScaleY:E*yt/R,isSDF:r}};if(!i||!s.stretchX&&!s.stretchY)a.push(T({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:u+1}));else{let I=Bc(c,m,d),z=Bc(p,g,y);for(let $=0;$<I.length-1;$++){let j=I[$],ie=I[$+1];for(let se=0;se<z.length-1;se++){let he=z[se],oe=z[se+1];a.push(T(j,he,ie,oe))}}}return a}function ea(e,t,r){let i=0;for(let n of e)i+=Math.max(t,Math.min(r,n[1]))-Math.max(t,Math.min(r,n[0]));return i}function Bc(e,t,r){let i=[{fixed:-1,stretch:0}];for(let[n,a]of e){let s=i[i.length-1];i.push({fixed:n-s.stretch,stretch:s.stretch}),i.push({fixed:n-s.stretch,stretch:s.stretch+(a-n)})}return i.push({fixed:t+1,stretch:r}),i}function ta(e,t,r,i){return e/t*r+i}function ra(e,t,r,i){return e-t*r/i}function Tb(e,t,r,i,n,a,s,o){let l=i.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,u=[];for(let h of t.positionedLines)for(let c of h.positionedGlyphs){if(!c.rect)continue;let p=c.rect||{},f=4,d=!0,y=1,m=0,g=(n||o)&&c.vertical,x=c.metrics.advance*c.scale/2;if(o&&t.verticalizable){let $=(c.scale-1)*24,j=(24-c.metrics.width*c.scale)/2;m=h.lineOffset/2-(c.imageName?-j:$)}if(c.imageName){let $=s[c.imageName];d=$.sdf,y=$.pixelRatio,f=1/y}let v=n?[c.x+x,c.y]:[0,0],b=n?[0,0]:[c.x+x+r[0],c.y+r[1]-m],w=[0,0];g&&(w=b,b=[0,0]);let S=c.metrics.isDoubleResolution?2:1,D=(c.metrics.left-f)*c.scale-x+b[0],A=(-c.metrics.top-f)*c.scale+b[1],E=D+p.w/S*c.scale/y,V=A+p.h/S*c.scale/y,M=new B(D,A),O=new B(E,A),R=new B(D,V),T=new B(E,V);if(g){let $=new B(-x,x- -17),j=-Math.PI/2,ie=12-x,se=c.imageName?ie:0,he=new B(22-ie,-se),oe=new B(...w);M._rotateAround(j,$)._add(he)._add(oe),O._rotateAround(j,$)._add(he)._add(oe),R._rotateAround(j,$)._add(he)._add(oe),T._rotateAround(j,$)._add(he)._add(oe)}if(l){let $=Math.sin(l),j=Math.cos(l),ie=[j,-$,$,j];M._matMult(ie),O._matMult(ie),R._matMult(ie),T._matMult(ie)}let I=new B(0,0),z=new B(0,0);u.push({tl:M,tr:O,bl:R,br:T,tex:p,writingMode:t.writingMode,glyphOffset:v,sectionIndex:c.sectionIndex,isSDF:d,pixelOffsetTL:I,pixelOffsetBR:z,minFontScaleX:0,minFontScaleY:0})}return u}var ia=class{constructor(e,t,r,i,n,a,s,o,l,u){if(this.boxStartIndex=e.length,l){let h=a.top,c=a.bottom,p=a.collisionPadding;p&&(h-=p[1],c+=p[3]);let f=c-h;f>0&&(f=Math.max(10,f),this.circleDiameter=f)}else{let h=a.image?.content&&(a.image.textFitWidth||a.image.textFitHeight)?ry(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};h.y1=h.y1*s-o[0],h.y2=h.y2*s+o[2],h.x1=h.x1*s-o[3],h.x2=h.x2*s+o[1];let c=a.collisionPadding;if(c&&(h.x1-=c[0]*s,h.y1-=c[1]*s,h.x2+=c[2]*s,h.y2+=c[3]*s),u){let p=new B(h.x1,h.y1),f=new B(h.x2,h.y1),d=new B(h.x1,h.y2),y=new B(h.x2,h.y2),m=u*Math.PI/180;p._rotate(m),f._rotate(m),d._rotate(m),y._rotate(m),h.x1=Math.min(p.x,f.x,d.x,y.x),h.x2=Math.max(p.x,f.x,d.x,y.x),h.y1=Math.min(p.y,f.y,d.y,y.y),h.y2=Math.max(p.y,f.y,d.y,y.y)}e.emplaceBack(t.x,t.y,h.x1,h.y1,h.x2,h.y2,r,i,n)}this.boxEndIndex=e.length}},Cb=class{constructor(e=[],t=(r,i)=>r<i?-1:+(r>i)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,i=t[e];for(;e>0;){let n=e-1>>1,a=t[n];if(r(i,a)>=0)break;t[e]=a,e=n}t[e]=i}_down(e){let{data:t,compare:r}=this,i=this.length>>1,n=t[e];for(;e<i;){let a=(e<<1)+1,s=a+1;if(s<this.length&&r(t[s],t[a])<0&&(a=s),r(t[a],n)>=0)break;t[e]=t[a],e=a}t[e]=n}};function Mb(e,t=1){let r=Aa.fromPoints(e[0]),i=Math.min(r.width(),r.height()),n=i/2,a=new Cb([],Pb),{minX:s,minY:o,maxX:l,maxY:u}=r;if(i===0)return new B(s,o);for(let p=s;p<l;p+=i)for(let f=o;f<u;f+=i)a.push(new Rr(p+n,f+n,n,e));let h=zb(e),c=h;for(;a.length;){let p=a.pop();(p.d>c.d||!c.d)&&(c=p),p.max-c.d<=t||(n=p.h/2,a.push(new Rr(p.p.x-n,p.p.y-n,n,e)),a.push(new Rr(p.p.x+n,p.p.y-n,n,e)),a.push(new Rr(p.p.x-n,p.p.y+n,n,e)),a.push(new Rr(p.p.x+n,p.p.y+n,n,e)))}return h.d>0&&c.d-h.d<=t?h.p:c.p}function Pb(e,t){return t.max-e.max}var Rr=class{constructor(e,t,r,i){this.p=new B(e,t),this.h=r,this.d=Bb(this.p,i),this.max=this.d+this.h*Math.SQRT2}};function Bb(e,t){let r=!1,i=1/0;for(let n of t)for(let a=0,s=n.length,o=s-1;a<s;o=a++){let l=n[a],u=n[o];l.y>e.y!=u.y>e.y&&e.x<(u.x-l.x)*(e.y-l.y)/(u.y-l.y)+l.x&&(r=!r),i=Math.min(i,Wf(e,l,u))}return(r?1:-1)*Math.sqrt(i)}function zb(e){let t=0,r=0,i=0,n=e[0];for(let a=0,s=n.length,o=s-1;a<s;o=a++){let l=n[a],u=n[o],h=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*h,i+=(l.y+u.y)*h,t+=h*3}return new Rr(r/t,i/t,0,e)}var Lb=(function(e){return e[e.center=1]="center",e[e.left=2]="left",e[e.right=3]="right",e[e.top=4]="top",e[e.bottom=5]="bottom",e[e["top-left"]=6]="top-left",e[e["top-right"]=7]="top-right",e[e["bottom-left"]=8]="bottom-left",e[e["bottom-right"]=9]="bottom-right",e})({}),pu=1/0;function uy(e,t){function r(n,a){let s=0,o=0;a<0&&(a=0);let l=a/Math.SQRT2;switch(n){case"top-right":case"top-left":o=l-7;break;case"bottom-right":case"bottom-left":o=-l+7;break;case"bottom":o=-a+7;break;case"top":o=a-7}switch(n){case"top-right":case"bottom-right":s=-l;break;case"top-left":case"bottom-left":s=l;break;case"left":s=a;break;case"right":s=-a}return[s,o]}function i(n,a,s){let o=0,l=0;switch(a=Math.abs(a),s=Math.abs(s),n){case"top-right":case"top-left":case"top":l=s-7;break;case"bottom-right":case"bottom-left":case"bottom":l=-s+7}switch(n){case"top-right":case"bottom-right":case"right":o=-a;break;case"top-left":case"bottom-left":case"left":o=a}return[o,l]}return t[1]===pu?r(e,t[0]):i(e,t[0],t[1])}function hy(e,t,r){let i=e.layout,n=i.get("text-variable-anchor-offset")?.evaluate(t,{},r);if(n){let s=n.values,o=[];for(let l=0;l<s.length;l+=2){let u=o[l]=s[l],h=s[l+1].map(c=>c*24);u.startsWith("top")?h[1]-=7:u.startsWith("bottom")&&(h[1]+=7),o[l+1]=h}return new St(o)}let a=i.get("text-variable-anchor");if(a){let s;s=e._unevaluatedLayout.getValue("text-radial-offset")===void 0?i.get("text-offset").evaluate(t,{},r).map(l=>l*24):[i.get("text-radial-offset").evaluate(t,{},r)*24,pu];let o=[];for(let l of a)o.push(l,uy(l,s));return new St(o)}return null}function Vb(e){e.bucket.createArrays();let t=512*e.bucket.overscaling;e.bucket.tilePixelRatio=be/t,e.bucket.compareText={},e.bucket.iconsNeedLinear=!1;let r=e.bucket.layers[0],i=r.layout,n=r._unevaluatedLayout._values,a={layoutIconSize:n["icon-size"].possiblyEvaluate(new le(e.bucket.zoom+1),e.canonical),layoutTextSize:n["text-size"].possiblyEvaluate(new le(e.bucket.zoom+1),e.canonical),textMaxSize:n["text-size"].possiblyEvaluate(new le(18))};if(e.bucket.textSizeData.kind==="composite"){let{minZoom:h,maxZoom:c}=e.bucket.textSizeData;a.compositeTextSizes=[n["text-size"].possiblyEvaluate(new le(h),e.canonical),n["text-size"].possiblyEvaluate(new le(c),e.canonical)]}if(e.bucket.iconSizeData.kind==="composite"){let{minZoom:h,maxZoom:c}=e.bucket.iconSizeData;a.compositeIconSizes=[n["icon-size"].possiblyEvaluate(new le(h),e.canonical),n["icon-size"].possiblyEvaluate(new le(c),e.canonical)]}let s=i.get("text-line-height")*24,o=i.get("text-rotation-alignment")!=="viewport"&&i.get("symbol-placement")!=="point",l=i.get("text-keep-upright"),u=i.get("text-size");for(let h of e.bucket.features){let c=i.get("text-font").evaluate(h,{},e.canonical).join(","),p=u.evaluate(h,{},e.canonical),f=a.layoutTextSize.evaluate(h,{},e.canonical),d=a.layoutIconSize.evaluate(h,{},e.canonical),y={horizontal:{},vertical:void 0},m=h.text,g=[0,0];if(m){let w=m.toString(),S=i.get("text-letter-spacing").evaluate(h,{},e.canonical)*24,D=_v(w)?S:0,A=i.get("text-anchor").evaluate(h,{},e.canonical),E=hy(r,h,e.canonical);if(!E){let R=i.get("text-radial-offset").evaluate(h,{},e.canonical);g=R?uy(A,[R*24,pu]):i.get("text-offset").evaluate(h,{},e.canonical).map(T=>T*24)}let V=o?"center":i.get("text-justify").evaluate(h,{},e.canonical),M=i.get("symbol-placement")==="point"?i.get("text-max-width").evaluate(h,{},e.canonical)*24:1/0,O=()=>{e.bucket.allowVerticalPlacement&&sl(w)&&(y.vertical=Qn(m,e.glyphMap,e.glyphPositions,e.imagePositions,c,M,s,A,"left",D,g,2,!0,f,p))};if(!o&&E){let R=new Set;if(V==="auto")for(let I=0;I<E.values.length;I+=2)R.add(zc(E.values[I]));else R.add(V);let T=!1;for(let I of R)if(!y.horizontal[I])if(T)y.horizontal[I]=y.horizontal[0];else{let z=Qn(m,e.glyphMap,e.glyphPositions,e.imagePositions,c,M,s,"center",I,D,g,1,!1,f,p);z&&(y.horizontal[I]=z,T=z.positionedLines.length===1)}O()}else{V==="auto"&&(V=zc(A));let R=Qn(m,e.glyphMap,e.glyphPositions,e.imagePositions,c,M,s,A,V,D,g,1,!1,f,p);R&&(y.horizontal[V]=R),O(),sl(w)&&o&&l&&(y.vertical=Qn(m,e.glyphMap,e.glyphPositions,e.imagePositions,c,M,s,A,V,D,g,2,!1,f,p))}}let x,v=!1;if(h.icon?.name){let w=e.imageMap[h.icon.name];w&&(x=vb(e.imagePositions[h.icon.name],i.get("icon-offset").evaluate(h,{},e.canonical),i.get("icon-anchor").evaluate(h,{},e.canonical)),v=!!w.sdf,e.bucket.sdfIcons===void 0?e.bucket.sdfIcons=v:e.bucket.sdfIcons!==v&&Pe("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),w.pixelRatio===e.bucket.pixelRatio?i.get("icon-rotate").constantOr(1)!==0&&(e.bucket.iconsNeedLinear=!0):e.bucket.iconsNeedLinear=!0)}let b=cy(y.horizontal)||y.vertical;e.bucket.iconsInText||=b?b.iconsInText:!1,(b||x)&&Ob(e.bucket,h,y,x,e.imageMap,a,f,d,g,v,e.canonical,e.subdivisionGranularity,e.hasPromoteId)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()}function zc(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Ob(e,t,r,i,n,a,s,o,l,u,h,c,p){let f=a.textMaxSize.evaluate(t,{});f===void 0&&(f=s);let d=e.layers[0].layout,y=d.get("icon-offset").evaluate(t,{},h),m=cy(r.horizontal),g=s/24,x=e.tilePixelRatio*g,v=e.tilePixelRatio*f/24,b=e.tilePixelRatio*o,w=e.tilePixelRatio*d.get("symbol-spacing"),S=d.get("text-padding")*e.tilePixelRatio,D=Qb(d,t,h,e.tilePixelRatio),A=d.get("text-max-angle")/180*Math.PI,E=d.get("text-rotation-alignment")!=="viewport"&&d.get("symbol-placement")!=="point",V=d.get("icon-rotation-alignment").constantOr("viewport")==="map"&&d.get("symbol-placement")!=="point",M=d.get("symbol-placement"),O=w/2,R=d.get("icon-text-fit"),T;i&&R!=="none"&&(e.allowVerticalPlacement&&r.vertical&&(T=Ic(i,r.vertical,R,d.get("icon-text-fit-padding"),y,g,o)),m&&(i=Ic(i,m,R,d.get("icon-text-fit-padding"),y,g,o)));let I=h?c.line.getGranularityForZoomLevel(h.z):1,z=($,j)=>{Xl(j)||$b(e,j,$,r,i,n,T,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,x,[S,S,S,S],E,l,b,D,V,y,t,a,u,h,s,o,p)};if(M==="line")for(let $ of Sb(t.geometry,0,0,be,be)){let j=ur($,I),ie=Db(j,w,A,r.vertical||m,i,24,v,e.overscaling,be);for(let se of ie){let he=m;he&&Nb(e,he.text,O,se)||z(j,se)}}else if(M==="line-center"){for(let $ of t.geometry)if($.length>1){let j=ur($,I),ie=_b(j,A,r.vertical||m,i,24,v);ie&&z(j,ie)}}else if(t.type==="Polygon")for(let $ of Na(t.geometry,0)){let j=Mb($,16);z(ur($[0],I,!0),new Yr(j.x,j.y,0))}else if(t.type==="LineString")for(let $ of t.geometry){let j=ur($,I);z(j,new Yr(j[0].x,j[0].y,0))}else if(t.type==="Point")for(let $ of t.geometry)for(let j of $)z([j],new Yr(j.x,j.y,0))}function Rb(e,t){let r=e.length,i=t?.values;if(i?.length>0)for(let n=0;n<i.length;n+=2){let a=Lb[i[n]],s=i[n+1];e.emplaceBack(a,s[0],s[1])}return[r,e.length]}function Lc(e,t,r,i,n,a,s,o,l,u,h,c,p,f,d,y){let m=Tb(t,r,o,n,a,s,i,e.allowVerticalPlacement),g=e.textSizeData,x=null;g.kind==="source"?(x=[128*n.layout.get("text-size").evaluate(s,{})],x[0]>32640&&Pe(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):g.kind==="composite"&&(x=[128*d.compositeTextSizes[0].evaluate(s,{},y),128*d.compositeTextSizes[1].evaluate(s,{},y)],(x[0]>32640||x[1]>32640)&&Pe(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),e.addSymbols(e.text,m,x,o,a,s,h,t,u.lineStartIndex,u.lineLength,f,y,l);for(let v of c)p[v]=e.text.placedSymbolArray.length-1;return m.length*4}function cy(e){for(let t in e)return e[t];return null}function $b(e,t,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,S,D,A,E,V){let M=e.addToLineVertexArray(t,r),O=o.layout.get("symbol-height-offset").evaluate(b,{},D);O>e.maxHeightOffset&&(e.maxHeightOffset=O);let R,T,I,z,$=0,j=0,ie=0,se=0,he=-1,oe=-1,de={},tt=(0,Sa.default)("");if(e.allowVerticalPlacement&&i.vertical){let k=o.layout.get("text-rotate").evaluate(b,{},D)+90,Q=i.vertical;I=new ia(l,t,u,h,c,Q,p,f,d,k),s&&(z=new ia(l,t,u,h,c,s,m,g,d,k))}if(n){let k=o.layout.get("icon-rotate").evaluate(b,{}),Q=o.layout.get("icon-text-fit")!=="none",G=Pc(n,k,S,Q,E),H=s?Pc(s,k,S,Q,E):void 0;T=new ia(l,t,u,h,c,n,m,g,!1,k),$=G.length*4;let Y=e.iconSizeData,ye=null;Y.kind==="source"?(ye=[128*o.layout.get("icon-size").evaluate(b,{})],ye[0]>32640&&Pe(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):Y.kind==="composite"&&(ye=[128*w.compositeIconSizes[0].evaluate(b,{},D),128*w.compositeIconSizes[1].evaluate(b,{},D)],(ye[0]>32640||ye[1]>32640)&&Pe(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),e.addSymbols(e.icon,G,ye,v,x,b,0,t,M.lineStartIndex,M.lineLength,-1,D,O),he=e.icon.placedSymbolArray.length-1,H&&(j=H.length*4,e.addSymbols(e.icon,H,ye,v,x,b,2,t,M.lineStartIndex,M.lineLength,-1,D,O),oe=e.icon.placedSymbolArray.length-1)}let rt=Object.keys(i.horizontal);for(let k of rt){let Q=i.horizontal[k];R||=(tt=(0,Sa.default)(Q.text),new ia(l,t,u,h,c,Q,p,f,d,o.layout.get("text-rotate").evaluate(b,{},D)));let G=Q.positionedLines.length===1;if(ie+=Lc(e,t,Q,a,o,d,b,y,O,M,i.vertical?1:3,G?rt:[k],de,he,w,D),G)break}i.vertical&&(se+=Lc(e,t,i.vertical,a,o,d,b,y,O,M,2,["vertical"],de,oe,w,D));let Qt=R?R.boxStartIndex:e.collisionBoxArray.length,Ze=R?R.boxEndIndex:e.collisionBoxArray.length,Sr=I?I.boxStartIndex:e.collisionBoxArray.length,Ar=I?I.boxEndIndex:e.collisionBoxArray.length,Vt=T?T.boxStartIndex:e.collisionBoxArray.length,yt=T?T.boxEndIndex:e.collisionBoxArray.length,er=z?z.boxStartIndex:e.collisionBoxArray.length,ci=z?z.boxEndIndex:e.collisionBoxArray.length,Be=-1,It=(k,Q)=>k?.circleDiameter?Math.max(k.circleDiameter,Q):Q;Be=It(R,Be),Be=It(I,Be),Be=It(T,Be),Be=It(z,Be);let tr=+(Be>-1);tr&&(Be*=A/24),e.glyphOffsetArray.length>=e.maxGlyphs&&Pe("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),b.sortKey!==void 0&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey);let N=hy(o,b,D),[ae,re]=Rb(e.textAnchorOffsets,N);V&&(tt=Ub(tt,b)),e.symbolInstances.emplaceBack(t.x,t.y,de.right>=0?de.right:-1,de.center>=0?de.center:-1,de.left>=0?de.left:-1,de.vertical||-1,he,oe,tt,Qt,Ze,Sr,Ar,Vt,yt,er,ci,u,ie,se,$,j,tr,0,p,Be,ae,re,O)}function Nb(e,t,r,i){let n=e.compareText;if(!(t in n))n[t]=[];else{let a=n[t];for(let s=a.length-1;s>=0;s--)if(i.dist(a[s])<r)return!0}return n[t].push(i),!1}function Ub(e,t){return t.id==null||t.properties?.cluster?e:(0,Sa.default)(String(t.id),e)}function Vc(e,t,r){let i="never",n=e.get(t);return n?i=n:e.get(r)&&(i="always"),i}var jb=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function na(e,t,r,i,n,a,s,o,l,u,h,c,p,f){let d=o?Math.min(kc,Math.round(o[0])):0,y=o?Math.min(kc,Math.round(o[1])):0;e.emplaceBack(t,r,Math.round(i*32),Math.round(n*32),a,s,(d<<1)+ +!!l,y,u*16,h*16,c*256,p*256,f)}function qb(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function Gb(e){for(let t of e.sections)if($d(t.text))return!0;return!1}var hl=class{constructor(e){this.layoutVertexArray=new Q0,this.indexArray=new vn,this.programConfigurations=e,this.segments=new et,this.dynamicLayoutVertexArray=new eg,this.opacityVertexArray=new tg,this.hasVisibleVertices=!1,this.placedSymbolArray=new Bf}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,t,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,X2.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Z2.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,jb,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};P("SymbolBuffers",hl);var cl=class{constructor(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new et,this.collisionVertexArray=new rg}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,W2.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};P("CollisionBuffers",cl);var py=class{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(s=>s.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Tc(this.zoom,t["text-size"]),this.iconSizeData=Tc(this.zoom,t["icon-size"]);let r=this.layers[0].layout,i=r.get("symbol-sort-key"),n=r.get("symbol-z-order");this.canOverlap=Vc(r,"text-overlap","text-allow-overlap")!=="never"||Vc(r,"icon-overlap","icon-allow-overlap")!=="never"||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=n!=="viewport-y"&&!i.isConstant();let a=n==="viewport-y"||n==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map(s=>Xd[s])),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.sourceID=e.sourceID}createArrays(){this.text=new hl(new mr(this.layers,this.zoom,e=>e.startsWith("text"))),this.icon=new hl(new mr(this.layers,this.zoom,e=>e.startsWith("icon"))),this.glyphOffsetArray=new Vf,this.lineVertexArray=new Of,this.symbolInstances=new Lf,this.textAnchorOffsets=new $f}calculateGlyphDependencies(e,t,r,i){let n=hu.fromFeature(e,r,!1),a=n.graphemes();for(let s=0;s<a.length;s++){let o=n.getSection(s);if("imageName"in o)continue;t[o.fontStack]||={default:{},vertical:{}};let l=t[o.fontStack],u=a[s],h=i&&pb(u.codePointAt(0),this.allowVerticalPlacement);al(u)&&(l.default[u]=!0),h&&(l.vertical[u]=!0);for(let c of u){if(l.default[c]=!0,!i)continue;h&&al(u)&&(l.vertical[c]=!0);let p=Nr[c];p&&(l.default[p]=!0)}}}populate(e,t,r){let i=this.layers[0],n=i.layout,a=n.get("text-font"),s=n.get("text-field"),o=n.get("icon-image"),l=(s.value.kind!=="constant"||s.value.value instanceof zt&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&(a.value.kind!=="constant"||a.value.value.length>0),u=o.value.kind!=="constant"||!!o.value.value||Object.keys(o.parameters).length>0,h=n.get("symbol-sort-key"),c=n.get("symbol-placement")==="point";if(this.features=[],!l&&!u)return;let p=t.iconDependencies,f=t.glyphDependencies,d=t.availableImages,y=new le(this.zoom),m=n.get("text-keep-upright");for(let{feature:g,id:x,index:v,sourceLayerIndex:b}of e){let w=i._featureFilter.needGeometry,S=li(g,w);if(!i._featureFilter.filter(y,S,r)||(w||(S.geometry=br(g)),c&&g.type===1&&Yb(S.geometry)))continue;let D;if(l){let M=i.getValueAndResolveTokens("text-field",S,r,d),O=zt.factory(M);this.hasRTLText||=Gb(O),D=xv(O,i,S)}let A;if(u){let M=i.getValueAndResolveTokens("icon-image",S,r,d);A=M instanceof At?M:At.fromString(M)}if(!D&&!A)continue;let E=this.sortFeaturesByKey?h.evaluate(S,{},r):void 0,V={id:x,text:D,icon:A,index:v,sourceLayerIndex:b,geometry:S.geometry,properties:g.properties,type:bn.types[g.type],sortKey:E};if(this.features.push(V),A&&(p[A.name]=!0),D){let M=a.evaluate(S,{},r).join(","),O=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes?.includes(2);let R=(O&&m||this.allowVerticalPlacement)&&sl(D.toString());this.calculateGlyphDependencies(D,f,M,R);for(let T of D.sections)T.image&&(p[T.image.name]=!0)}}n.get("symbol-placement")==="line"&&(this.features=bv(this.features)),this.sortFeaturesByKey&&this.features.sort((g,x)=>g.sortKey-x.sortKey)}update(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:r}),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:r}))}addFeatures({options:e,canonical:t,glyphMap:r,glyphPositions:i,iconMap:n,iconPositions:a,showCollisionBoxes:s}){Vb({bucket:this,glyphMap:r,glyphPositions:i,imageMap:n,imagePositions:a,showCollisionBoxes:s,canonical:t,subdivisionGranularity:e.subdivisionGranularity,hasPromoteId:e.featureIndex.promoteId!=null})}isEmpty(){return this.symbolInstances.length===0}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){let r=this.lineVertexArray.length;if(e.segment!==void 0){let i=e.dist(t[e.segment+1]),n=e.dist(t[e.segment]),a={};for(let s=e.segment+1;s<t.length;s++)a[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:i},s<t.length-1&&(i+=t[s+1].dist(t[s]));for(let s=e.segment||0;s>=0;s--)a[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=t[s-1].dist(t[s]));for(let s=0;s<t.length;s++){let o=a[s];this.lineVertexArray.emplaceBack(o.x,o.y,o.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(e,t,r,i,n,a,s,o,l,u,h,c,p){let f=e.indexArray,d=e.layoutVertexArray,y=e.segments.prepareSegment(4*t.length,d,f,this.canOverlap?a.sortKey:void 0),m=this.glyphOffsetArray.length,g=y.vertexLength,x=this.allowVerticalPlacement&&s===2?Math.PI/2:0,v=a.text&&a.text.sections;for(let b=0;b<t.length;b++){let{tl:w,tr:S,bl:D,br:A,tex:E,pixelOffsetTL:V,pixelOffsetBR:M,minFontScaleX:O,minFontScaleY:R,glyphOffset:T,isSDF:I,sectionIndex:z}=t[b],$=y.vertexLength,j=T[1];na(d,o.x,o.y,w.x,j+w.y,E.x,E.y,r,I,V.x,V.y,O,R,p),na(d,o.x,o.y,S.x,j+S.y,E.x+E.w,E.y,r,I,M.x,V.y,O,R,p),na(d,o.x,o.y,D.x,j+D.y,E.x,E.y+E.h,r,I,V.x,M.y,O,R,p),na(d,o.x,o.y,A.x,j+A.y,E.x+E.w,E.y+E.h,r,I,M.x,M.y,O,R,p),qb(e.dynamicLayoutVertexArray,o,x),f.emplaceBack($,$+2,$+1),f.emplaceBack($+1,$+2,$+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(T[0]),(b===t.length-1||z!==t[b+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(d.length,a,a.index,{imagePositions:{},canonical:c,formattedSection:v?.[z]})}e.placedSymbolArray.emplaceBack(o.x,o.y,m,this.glyphOffsetArray.length-m,g,l,u,o.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],s,0,!1,0,h,p)}_addCollisionDebugVertex(e,t,r,i,n,a){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,i,n,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,t,r,i,n,a,s){let o=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),l=o.vertexLength,u=n.layoutVertexArray,h=n.collisionVertexArray,c=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,h,a,c,p,new B(e,t)),this._addCollisionDebugVertex(u,h,a,c,p,new B(r,t)),this._addCollisionDebugVertex(u,h,a,c,p,new B(r,i)),this._addCollisionDebugVertex(u,h,a,c,p,new B(e,i)),o.vertexLength+=4;let f=n.indexArray;f.emplaceBack(l,l+1),f.emplaceBack(l+1,l+2),f.emplaceBack(l+2,l+3),f.emplaceBack(l+3,l),o.primitiveLength+=4}addDebugCollisionBoxes(e,t,r,i){for(let n=e;n<t;n++){let a=this.collisionBoxArray.get(n),s=a.x1,o=a.y1,l=a.x2,u=a.y2;this.addCollisionDebugVertices(s,o,l,u,i?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new cl($h,cc.members,zo),this.iconCollisionBox=new cl($h,cc.members,zo);for(let e=0;e<this.symbolInstances.length;e++){let t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}}_deserializeCollisionBoxesForSymbol(e,t,r,i,n,a,s,o,l){let u={};for(let h=t;h<r;h++){let c=e.get(h);u.textBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.textFeatureIndex=c.featureIndex;break}for(let h=i;h<n;h++){let c=e.get(h);u.verticalTextBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.verticalTextFeatureIndex=c.featureIndex;break}for(let h=a;h<s;h++){let c=e.get(h);u.iconBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.iconFeatureIndex=c.featureIndex;break}for(let h=o;h<l;h++){let c=e.get(h);u.verticalIconBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.verticalIconFeatureIndex=c.featureIndex;break}return u}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){let r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,t){let r=e.placedSymbolArray.get(t),i=r.vertexStartIndex+r.numGlyphs*4;for(let n=r.vertexStartIndex;n<i;n+=4)e.indexArray.emplaceBack(n,n+2,n+1),e.indexArray.emplaceBack(n+1,n+2,n+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let t=Math.sin(e),r=Math.cos(e),i=[],n=[],a=[];for(let s=0;s<this.symbolInstances.length;++s){a.push(s);let o=this.symbolInstances.get(s);i.push(Math.round(t*o.anchorX+r*o.anchorY)|0),n.push(o.featureIndex)}return a.sort((s,o)=>i[s]-i[o]||n[o]-n[s]),a}addToSortKeyRanges(e,t){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];r?.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let t of this.symbolInstanceIndexes){let r=this.symbolInstances.get(t);this.featureSortOrder.push(r.featureIndex);let i=[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex];for(let n=0;n<i.length;n++){let a=i[n];a>=0&&i.indexOf(a)===n&&this.addIndicesForPlacedSymbol(this.text,a)}r.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,r.verticalPlacedTextSymbolIndex),r.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.placedIconSymbolIndex),r.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};function Yb(e){return e.every(t=>t.every(Xl))}P("SymbolBucket",py,{omit:["layers","collisionBoxArray","features","compareText"]});function Xb(e,t){return t.replace(/{([^{}]+)}/g,(r,i)=>e&&i in e?String(e[i]):"")}var Zb,Wb=()=>Zb||=new qe({"symbol-placement":new L(_.layout_symbol["symbol-placement"],"symbol-placement"),"symbol-spacing":new L(_.layout_symbol["symbol-spacing"],"symbol-spacing"),"symbol-avoid-edges":new L(_.layout_symbol["symbol-avoid-edges"],"symbol-avoid-edges"),"symbol-sort-key":new U(_.layout_symbol["symbol-sort-key"],"symbol-sort-key"),"symbol-z-order":new L(_.layout_symbol["symbol-z-order"],"symbol-z-order"),"icon-allow-overlap":new L(_.layout_symbol["icon-allow-overlap"],"icon-allow-overlap"),"icon-overlap":new L(_.layout_symbol["icon-overlap"],"icon-overlap"),"icon-ignore-placement":new L(_.layout_symbol["icon-ignore-placement"],"icon-ignore-placement"),"icon-optional":new L(_.layout_symbol["icon-optional"],"icon-optional"),"icon-rotation-alignment":new U(_.layout_symbol["icon-rotation-alignment"],"icon-rotation-alignment"),"icon-size":new U(_.layout_symbol["icon-size"],"icon-size"),"icon-text-fit":new L(_.layout_symbol["icon-text-fit"],"icon-text-fit"),"icon-text-fit-padding":new L(_.layout_symbol["icon-text-fit-padding"],"icon-text-fit-padding"),"icon-image":new U(_.layout_symbol["icon-image"],"icon-image"),"icon-rotate":new U(_.layout_symbol["icon-rotate"],"icon-rotate"),"icon-padding":new U(_.layout_symbol["icon-padding"],"icon-padding"),"icon-keep-upright":new L(_.layout_symbol["icon-keep-upright"],"icon-keep-upright"),"icon-offset":new U(_.layout_symbol["icon-offset"],"icon-offset"),"icon-anchor":new U(_.layout_symbol["icon-anchor"],"icon-anchor"),"icon-pitch-alignment":new L(_.layout_symbol["icon-pitch-alignment"],"icon-pitch-alignment"),"text-pitch-alignment":new L(_.layout_symbol["text-pitch-alignment"],"text-pitch-alignment"),"text-rotation-alignment":new L(_.layout_symbol["text-rotation-alignment"],"text-rotation-alignment"),"text-field":new U(_.layout_symbol["text-field"],"text-field"),"text-font":new U(_.layout_symbol["text-font"],"text-font"),"text-size":new U(_.layout_symbol["text-size"],"text-size"),"text-max-width":new U(_.layout_symbol["text-max-width"],"text-max-width"),"text-line-height":new L(_.layout_symbol["text-line-height"],"text-line-height"),"text-letter-spacing":new U(_.layout_symbol["text-letter-spacing"],"text-letter-spacing"),"text-justify":new U(_.layout_symbol["text-justify"],"text-justify"),"text-radial-offset":new U(_.layout_symbol["text-radial-offset"],"text-radial-offset"),"text-variable-anchor":new L(_.layout_symbol["text-variable-anchor"],"text-variable-anchor"),"text-variable-anchor-offset":new U(_.layout_symbol["text-variable-anchor-offset"],"text-variable-anchor-offset"),"text-anchor":new U(_.layout_symbol["text-anchor"],"text-anchor"),"text-max-angle":new L(_.layout_symbol["text-max-angle"],"text-max-angle"),"text-writing-mode":new L(_.layout_symbol["text-writing-mode"],"text-writing-mode"),"text-rotate":new U(_.layout_symbol["text-rotate"],"text-rotate"),"text-padding":new L(_.layout_symbol["text-padding"],"text-padding"),"text-keep-upright":new L(_.layout_symbol["text-keep-upright"],"text-keep-upright"),"text-transform":new U(_.layout_symbol["text-transform"],"text-transform"),"text-offset":new U(_.layout_symbol["text-offset"],"text-offset"),"text-allow-overlap":new L(_.layout_symbol["text-allow-overlap"],"text-allow-overlap"),"text-overlap":new L(_.layout_symbol["text-overlap"],"text-overlap"),"text-ignore-placement":new L(_.layout_symbol["text-ignore-placement"],"text-ignore-placement"),"text-optional":new L(_.layout_symbol["text-optional"],"text-optional"),"symbol-height-offset":new U(_.layout_symbol["symbol-height-offset"],"symbol-height-offset"),"symbol-height-anchor":new L(_.layout_symbol["symbol-height-anchor"],"symbol-height-anchor")}),Hb,Jb=()=>Hb||=new qe({"icon-opacity":new U(_.paint_symbol["icon-opacity"],"icon-opacity"),"icon-color":new U(_.paint_symbol["icon-color"],"icon-color"),"icon-halo-color":new U(_.paint_symbol["icon-halo-color"],"icon-halo-color"),"icon-halo-width":new U(_.paint_symbol["icon-halo-width"],"icon-halo-width"),"icon-halo-blur":new U(_.paint_symbol["icon-halo-blur"],"icon-halo-blur"),"icon-translate":new L(_.paint_symbol["icon-translate"],"icon-translate"),"icon-translate-anchor":new L(_.paint_symbol["icon-translate-anchor"],"icon-translate-anchor"),"text-opacity":new U(_.paint_symbol["text-opacity"],"text-opacity"),"text-color":new U(_.paint_symbol["text-color"],"text-color",{runtimeType:pt,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new U(_.paint_symbol["text-halo-color"],"text-halo-color"),"text-halo-width":new U(_.paint_symbol["text-halo-width"],"text-halo-width"),"text-halo-blur":new U(_.paint_symbol["text-halo-blur"],"text-halo-blur"),"text-translate":new L(_.paint_symbol["text-translate"],"text-translate"),"text-translate-anchor":new L(_.paint_symbol["text-translate-anchor"],"text-translate-anchor")}),Hs={get paint(){return Jb()},get layout(){return Wb()}},fy=class{constructor(e){if(e.property.overrides===void 0)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:pn,this.defaultValue=e}evaluate(e){if(e.formattedSection){let t=this.defaultValue.property.overrides;if(t?.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){if(!this.defaultValue.isConstant()){let t=this.defaultValue.value;e(t._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};P("FormatSectionOverride",fy,{omit:["defaultValue"]});var Kb=class pl extends dt{constructor(t,r){super(t,Hs,r)}recalculate(t,r){super.recalculate(t,r);let i=this.layout.get("icon-rotation-alignment");if((i.value.kind!=="constant"||i.value.value==="auto")&&(this.layout._values["icon-rotation-alignment"]=new st(i.property,{kind:"constant",value:this.layout.get("symbol-placement")==="point"?"viewport":"map"},i.parameters)),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")==="point"?this.layout._values["text-rotation-alignment"]="viewport":this.layout._values["text-rotation-alignment"]="map"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment").constantOr("viewport")),this.layout.get("symbol-placement")==="point"){let n=this.layout.get("text-writing-mode");if(n){let a=[];for(let s of n)a.includes(s)||a.push(s);this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,r,i,n){let a=this.layout.get(t).evaluate(r,{},i,n),s=this._unevaluatedLayout._values[t];return!s.isDataDriven()&&!Ga(s.value)&&a?Xb(r.properties,a):a}createBucket(t){return new py(t)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let t of Hs.paint.overridableProperties){if(!pl.hasPaintOverride(this.layout,t))continue;let r=this.paint.get(t),i=new Vl(new fy(r),`layers[${this.id}].paint.${r.property.name}`,r.property.specification),n=null;n=r.value.kind==="constant"||r.value.kind==="source"?new Ki("source",i):new ba("composite",i,r.value.zoomStops),this.paint._values[t]=new st(r.property,n,r.parameters)}}_handleOverridablePaintPropertyUpdate(t,r,i){return!this.layout||r.isDataDriven()||i.isDataDriven()?!1:pl.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,r){let i=t.get("text-field"),n=Hs.paint.properties[r],a=!1,s=o=>{for(let l of o)if(n.overrides?.hasOverride(l)){a=!0;return}};if(i.value.kind==="constant"&&i.value.value instanceof zt)s(i.value.value.sections);else if(i.value.kind==="source"||i.value.kind==="composite"){let o=u=>{if(!a)if(u instanceof Kr&&Ae(u.value)===fn){let h=u.value;s(h.sections)}else u instanceof Rp?s(u.sections):u.eachChild(o)},l=i.value;l._styleExpression&&o(l._styleExpression.expression)}return a}};function Qb(e,t,r,i=1){let n=e.get("icon-padding").evaluate(t,{},r)?.values;return[n[0]*i,n[1]*i,n[2]*i,n[3]*i]}var ew,tw=()=>ew||=new qe({"background-color":new L(_.paint_background["background-color"],"background-color"),"background-pattern":new Tf(_.paint_background["background-pattern"],"background-pattern"),"background-opacity":new L(_.paint_background["background-opacity"],"background-opacity")}),rw={get paint(){return tw()}},iw=class extends dt{constructor(e,t){super(e,rw,t)}},nw,aw=()=>nw||=new qe({"raster-opacity":new L(_.paint_raster["raster-opacity"],"raster-opacity"),"raster-layer-blend":new L(_.paint_raster["raster-layer-blend"],"raster-layer-blend"),"raster-hue-rotate":new L(_.paint_raster["raster-hue-rotate"],"raster-hue-rotate"),"raster-brightness-min":new L(_.paint_raster["raster-brightness-min"],"raster-brightness-min"),"raster-brightness-max":new L(_.paint_raster["raster-brightness-max"],"raster-brightness-max"),"raster-saturation":new L(_.paint_raster["raster-saturation"],"raster-saturation"),"raster-contrast":new L(_.paint_raster["raster-contrast"],"raster-contrast"),resampling:new L(_.paint_raster.resampling,"resampling"),"raster-resampling":new L(_.paint_raster["raster-resampling"],"raster-resampling"),"raster-fade-duration":new L(_.paint_raster["raster-fade-duration"],"raster-fade-duration")}),sw={get paint(){return aw()}},ow=class extends dt{constructor(e,t){super(e,sw,t)}},lw=class extends dt{constructor(e,t){super(e,{},t),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}};function uw(e,t){if(e.type==="custom")return new lw(e,t);switch(e.type){case"background":return new iw(e,t);case"circle":return new Cg(e,t);case"color-relief":return new qg(e,t);case"fill":return new Sx(e,t);case"fill-extrusion":return new Xx(e,t);case"heatmap":return new Lg(e,t);case"hillshade":return new $g(e,t);case"line":return new Y2(e,t);case"raster":return new ow(e,t);case"symbol":return new Kb(e,t)}}var hw=class{constructor(e,t){this.feature=e,this.type=e.type,this.properties=e.tags?e.tags:{},this.extent=t,"id"in e&&(typeof e.id=="string"?this.id=parseInt(e.id,10):typeof e.id=="number"&&!isNaN(e.id)&&(this.id=e.id))}loadGeometry(){let e=[],t=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(let r of t){let i=[];for(let n of r)i.push(new B(n[0],n[1]));e.push(i)}return e}},fl="_geojsonTileLayer",cw=class{constructor(e,t){this.layers={[fl]:this},this.name=fl,this.version=t?t.version:1,this.extent=t?t.extent:4096,this.length=e.length,this.features=e}feature(e){return new hw(this.features[e],this.extent)}};function dy(e,t=""){let r=new Nv;return pw(e,r,t),r.finish()}function pw(e,t,r=""){for(let i in e.layers)t.writeMessage(3,(n,a)=>fw(n,a,r),e.layers[i])}function fw(e,t,r=""){t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);let i={jsonPrefix:r,keys:[],values:[],keycache:{},valuecache:{}};for(let s=0;s<e.length;s++)i.feature=e.feature(s),t.writeMessage(2,dw,i);let n=i.keys;for(let s of n)t.writeStringField(3,s);let a=i.values;for(let s of a)t.writeMessage(4,gw,s)}function dw(e,t){if(!e.feature)return;let r=e.feature;r.id!==void 0&&t.writeVarintField(1,r.id),t.writeMessage(2,yw,e),t.writeVarintField(3,r.type),t.writeMessage(4,mw,r)}function yw(e,t){for(let r in e.feature?.properties){let i=e.feature.properties[r],n=e.keycache[r];if(i==null)continue;n===void 0&&(e.keys.push(r),n=e.keys.length-1,e.keycache[r]=n),t.writeVarint(n),typeof i!="string"&&typeof i!="boolean"&&typeof i!="number"&&(i=e.jsonPrefix+JSON.stringify(i));let a=typeof i+":"+i,s=e.valuecache[a];s===void 0&&(e.values.push(i),s=e.values.length-1,e.valuecache[a]=s),t.writeVarint(s)}}function Js(e,t){return(t<<3)+(e&7)}function Oc(e){return e<<1^e>>31}function mw(e,t){let r=e.loadGeometry(),i=e.type,n=0,a=0;for(let s of r){let o=1;i===1&&(o=s.length),t.writeVarint(Js(1,o));let l=s[s.length-1],u=i===3&&s.length>1&&l.x===s[0].x&&l.y===s[0].y?s.length-1:s.length;for(let h=0;h<u;h++){h===1&&i!==1&&t.writeVarint(Js(2,u-1));let c=s[h].x-n,p=s[h].y-a;t.writeVarint(Oc(c)),t.writeVarint(Oc(p)),n+=c,a+=p}e.type===3&&t.writeVarint(Js(7,1))}}function gw(e,t){let r=typeof e;r==="string"?t.writeStringField(1,e):r==="boolean"?t.writeBooleanField(7,e):r==="number"&&(e%1==0?e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e):t.writeDoubleField(3,e))}var yy=class{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){let r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}},xw=class dl{static{this.worldCoordinateHelpers=new WeakMap}constructor(t,r,i,n,a,s){this.type="Feature",this._vectorTileFeature=t,this._x=i,this._y=n,this._z=r,s!==Cx&&dl.worldCoordinateHelpers.set(this,s);for(let o in t.properties)typeof t.properties[o]=="string"&&t.properties[o].startsWith("__$json__:")&&(t.properties[o]=JSON.parse(t.properties[o].slice(10)));this.properties=t.properties,this.id=a}projectPoint(t,r,i,n,a){if(a){let s=a.lngLatFromWorld((t.x+r)/n,(t.y+i)/n);return[s.lng,s.lat]}return[(t.x+r)*360/n-180,360/Math.PI*Math.atan(Math.exp((1-(t.y+i)*2/n)*Math.PI))-90]}projectLine(t,r,i,n,a){return t.map(s=>this.projectPoint(s,r,i,n,a))}get geometry(){if(this._geometry)return this._geometry;let t=this._vectorTileFeature,r=dl.worldCoordinateHelpers.get(this),i=t.extent*2**this._z,n=t.extent*this._x,a=t.extent*this._y,s=t.loadGeometry();switch(t.type){case 1:{let o=[];for(let u of s)o.push(u[0]);let l=this.projectLine(o,n,a,i,r);this._geometry=o.length===1?{type:"Point",coordinates:l[0]}:{type:"MultiPoint",coordinates:l};break}case 2:{let o=s.map(l=>this.projectLine(l,n,a,i,r));this._geometry=o.length===1?{type:"LineString",coordinates:o[0]}:{type:"MultiLineString",coordinates:o};break}case 3:{let o=pd(s),l=[];for(let u of o)l.push(u.map(h=>this.projectLine(h,n,a,i,r)));this._geometry=l.length===1?{type:"Polygon",coordinates:l[0]}:{type:"MultiPolygon",coordinates:l};break}default:throw Error(`unknown feature type: ${t.type}`)}return this._geometry}set geometry(t){this._geometry=t}toJSON(){let t={geometry:this.geometry};for(let r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&r!=="_x"&&r!=="_y"&&r!=="_z"&&(t[r]=this[r]);return t}},wr=class{constructor(e,t,r){this._name=e,this.dataBuffer=t,typeof r=="number"?this._size=r:(this.nullabilityBuffer=r,this._size=r.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){return this.nullabilityBuffer?.get(e)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},es=class extends wr{},fu=class extends es{getValueFromBuffer(e){return this.dataBuffer[e]}},du=class extends es{getValueFromBuffer(e){return this.dataBuffer[e]}},my=class extends wr{constructor(e,t,r,i){super(e,t,i),this.delta=r}},yu=class extends my{constructor(e,t,r,i,n){super(e,n?Int32Array.of(t):Uint32Array.of(t),r,i)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}},mu=class extends wr{constructor(e,t,r,i){super(e,i?Int32Array.of(t):Uint32Array.of(t),r)}getValueFromBuffer(e){return this.dataBuffer[0]}},vw=class{constructor(e,t,r,i,n=4096){if(this._name=e,this._geometryVector=t,this._idVector=r,this._propertyVectors=i,this._extent=n,e.length===0)throw Error("Missing layer name")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors??[]}getPropertyVector(e){return this.propertyVectorsMap||=new Map(this.propertyVectors.map(t=>[t.name,t])),this.propertyVectorsMap.get(e)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let e=[],t=this.geometryVector.getGeometries();for(let r=0;r<this.numFeatures;r++){let i;if(this.idVector){let s=this.idVector.getValue(r);s!==null&&(i=this.containsMaxSafeIntegerValues(this.idVector)?Number(s):s)}let n={coordinates:t[r],type:this.geometryVector.geometryType(r)},a={};for(let s of this.propertyVectors){if(!s)continue;let o=s.name,l=s.getValue(r);l!==null&&(a[o]=l)}e.push({id:i,geometry:n,properties:a})}return e}containsMaxSafeIntegerValues(e){return e instanceof fu||e instanceof mu||e instanceof yu||e instanceof du}},Ri={FEATURE:0,VERTEX:1},te={BOOLEAN:0,INT_8:1,UINT_8:2,INT_32:3,UINT_32:4,INT_64:5,UINT_64:6,FLOAT:7,DOUBLE:8,STRING:9},Jt={GEOMETRY:0,STRUCT:1,MAP:2},gy={ID:0},xy=class{constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}increment(){return this.value++}add(e){this.value+=e}},W;(function(e){e.NONE="NONE",e.DELTA="DELTA",e.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",e.RLE="RLE",e.MORTON="MORTON"})(W||={});var lt;(function(e){e.NONE="NONE",e.FAST_PFOR="FAST_PFOR",e.VARINT="VARINT"})(lt||={});var gu=new Uint32Array(33);gu[0]=0;for(let e=1;e<=32;e++)gu[e]=e===32?4294967295:4294967295>>>32-e;var yl=gu,xu=65536;function vu(e,t){return e-e%t}function bw(e){return vu(e+31,32)}function vy(e){if(!Number.isFinite(e)||e<=0)return xu;let t=vu(Math.floor(e),256);return t===0?256:t}function ww(e){let t=e>>>0;return((t&255)<<24|(t&65280)<<8|t>>>8&65280|t>>>24&255)>>>0}function _w(e,t,r,i){let n=i,a=e[t]>>>0,s=e[t+1]>>>0;r[n++]=a>>>0&3,r[n++]=a>>>2&3,r[n++]=a>>>4&3,r[n++]=a>>>6&3,r[n++]=a>>>8&3,r[n++]=a>>>10&3,r[n++]=a>>>12&3,r[n++]=a>>>14&3,r[n++]=a>>>16&3,r[n++]=a>>>18&3,r[n++]=a>>>20&3,r[n++]=a>>>22&3,r[n++]=a>>>24&3,r[n++]=a>>>26&3,r[n++]=a>>>28&3,r[n++]=a>>>30&3,r[n++]=s>>>0&3,r[n++]=s>>>2&3,r[n++]=s>>>4&3,r[n++]=s>>>6&3,r[n++]=s>>>8&3,r[n++]=s>>>10&3,r[n++]=s>>>12&3,r[n++]=s>>>14&3,r[n++]=s>>>16&3,r[n++]=s>>>18&3,r[n++]=s>>>20&3,r[n++]=s>>>22&3,r[n++]=s>>>24&3,r[n++]=s>>>26&3,r[n++]=s>>>28&3,r[n]=s>>>30&3}function Dw(e,t,r,i){let n=i,a=e[t]>>>0,s=e[t+1]>>>0,o=e[t+2]>>>0;r[n++]=a>>>0&7,r[n++]=a>>>3&7,r[n++]=a>>>6&7,r[n++]=a>>>9&7,r[n++]=a>>>12&7,r[n++]=a>>>15&7,r[n++]=a>>>18&7,r[n++]=a>>>21&7,r[n++]=a>>>24&7,r[n++]=a>>>27&7,r[n++]=(a>>>30|(s&1)<<2)&7,r[n++]=s>>>1&7,r[n++]=s>>>4&7,r[n++]=s>>>7&7,r[n++]=s>>>10&7,r[n++]=s>>>13&7,r[n++]=s>>>16&7,r[n++]=s>>>19&7,r[n++]=s>>>22&7,r[n++]=s>>>25&7,r[n++]=s>>>28&7,r[n++]=(s>>>31|(o&3)<<1)&7,r[n++]=o>>>2&7,r[n++]=o>>>5&7,r[n++]=o>>>8&7,r[n++]=o>>>11&7,r[n++]=o>>>14&7,r[n++]=o>>>17&7,r[n++]=o>>>20&7,r[n++]=o>>>23&7,r[n++]=o>>>26&7,r[n]=o>>>29&7}function Sw(e,t,r,i){let n=i,a=e[t]>>>0,s=e[t+1]>>>0,o=e[t+2]>>>0,l=e[t+3]>>>0;r[n++]=a>>>0&15,r[n++]=a>>>4&15,r[n++]=a>>>8&15,r[n++]=a>>>12&15,r[n++]=a>>>16&15,r[n++]=a>>>20&15,r[n++]=a>>>24&15,r[n++]=a>>>28&15,r[n++]=s>>>0&15,r[n++]=s>>>4&15,r[n++]=s>>>8&15,r[n++]=s>>>12&15,r[n++]=s>>>16&15,r[n++]=s>>>20&15,r[n++]=s>>>24&15,r[n++]=s>>>28&15,r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n]=l>>>28&15}function Aw(e,t,r,i){let n=i,a=e[t]>>>0,s=e[t+1]>>>0,o=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0;r[n++]=a>>>0&31,r[n++]=a>>>5&31,r[n++]=a>>>10&31,r[n++]=a>>>15&31,r[n++]=a>>>20&31,r[n++]=a>>>25&31,r[n++]=(a>>>30|(s&7)<<2)&31,r[n++]=s>>>3&31,r[n++]=s>>>8&31,r[n++]=s>>>13&31,r[n++]=s>>>18&31,r[n++]=s>>>23&31,r[n++]=(s>>>28|(o&1)<<4)&31,r[n++]=o>>>1&31,r[n++]=o>>>6&31,r[n++]=o>>>11&31,r[n++]=o>>>16&31,r[n++]=o>>>21&31,r[n++]=o>>>26&31,r[n++]=(o>>>31|(l&15)<<1)&31,r[n++]=l>>>4&31,r[n++]=l>>>9&31,r[n++]=l>>>14&31,r[n++]=l>>>19&31,r[n++]=l>>>24&31,r[n++]=(l>>>29|(u&3)<<3)&31,r[n++]=u>>>2&31,r[n++]=u>>>7&31,r[n++]=u>>>12&31,r[n++]=u>>>17&31,r[n++]=u>>>22&31,r[n]=u>>>27&31}function Ew(e,t,r,i){let n=i,a=e[t]>>>0,s=e[t+1]>>>0,o=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,h=e[t+5]>>>0;r[n++]=a>>>0&63,r[n++]=a>>>6&63,r[n++]=a>>>12&63,r[n++]=a>>>18&63,r[n++]=a>>>24&63,r[n++]=(a>>>30|(s&15)<<2)&63,r[n++]=s>>>4&63,r[n++]=s>>>10&63,r[n++]=s>>>16&63,r[n++]=s>>>22&63,r[n++]=(s>>>28|(o&3)<<4)&63,r[n++]=o>>>2&63,r[n++]=o>>>8&63,r[n++]=o>>>14&63,r[n++]=o>>>20&63,r[n++]=o>>>26&63,r[n++]=l>>>0&63,r[n++]=l>>>6&63,r[n++]=l>>>12&63,r[n++]=l>>>18&63,r[n++]=l>>>24&63,r[n++]=(l>>>30|(u&15)<<2)&63,r[n++]=u>>>4&63,r[n++]=u>>>10&63,r[n++]=u>>>16&63,r[n++]=u>>>22&63,r[n++]=(u>>>28|(h&3)<<4)&63,r[n++]=h>>>2&63,r[n++]=h>>>8&63,r[n++]=h>>>14&63,r[n++]=h>>>20&63,r[n]=h>>>26&63}function Fw(e,t,r,i){let n=i,a=e[t]>>>0,s=e[t+1]>>>0,o=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,h=e[t+5]>>>0,c=e[t+6]>>>0;r[n++]=a>>>0&127,r[n++]=a>>>7&127,r[n++]=a>>>14&127,r[n++]=a>>>21&127,r[n++]=(a>>>28|(s&7)<<4)&127,r[n++]=s>>>3&127,r[n++]=s>>>10&127,r[n++]=s>>>17&127,r[n++]=s>>>24&127,r[n++]=(s>>>31|(o&63)<<1)&127,r[n++]=o>>>6&127,r[n++]=o>>>13&127,r[n++]=o>>>20&127,r[n++]=(o>>>27|(l&3)<<5)&127,r[n++]=l>>>2&127,r[n++]=l>>>9&127,r[n++]=l>>>16&127,r[n++]=l>>>23&127,r[n++]=(l>>>30|(u&31)<<2)&127,r[n++]=u>>>5&127,r[n++]=u>>>12&127,r[n++]=u>>>19&127,r[n++]=(u>>>26|(h&1)<<6)&127,r[n++]=h>>>1&127,r[n++]=h>>>8&127,r[n++]=h>>>15&127,r[n++]=h>>>22&127,r[n++]=(h>>>29|(c&15)<<3)&127,r[n++]=c>>>4&127,r[n++]=c>>>11&127,r[n++]=c>>>18&127,r[n]=c>>>25&127}function Iw(e,t,r,i){let n=i,a=e[t]>>>0,s=e[t+1]>>>0,o=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,h=e[t+5]>>>0,c=e[t+6]>>>0,p=e[t+7]>>>0;r[n++]=a>>>0&255,r[n++]=a>>>8&255,r[n++]=a>>>16&255,r[n++]=a>>>24&255,r[n++]=s>>>0&255,r[n++]=s>>>8&255,r[n++]=s>>>16&255,r[n++]=s>>>24&255,r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n]=p>>>24&255}function kw(e,t,r,i){let n=i,a=e[t]>>>0,s=e[t+1]>>>0,o=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,h=e[t+5]>>>0,c=e[t+6]>>>0,p=e[t+7]>>>0,f=e[t+8]>>>0;r[n++]=a>>>0&511,r[n++]=a>>>9&511,r[n++]=a>>>18&511,r[n++]=(a>>>27|(s&15)<<5)&511,r[n++]=s>>>4&511,r[n++]=s>>>13&511,r[n++]=s>>>22&511,r[n++]=(s>>>31|(o&255)<<1)&511,r[n++]=o>>>8&511,r[n++]=o>>>17&511,r[n++]=(o>>>26|(l&7)<<6)&511,r[n++]=l>>>3&511,r[n++]=l>>>12&511,r[n++]=l>>>21&511,r[n++]=(l>>>30|(u&127)<<2)&511,r[n++]=u>>>7&511,r[n++]=u>>>16&511,r[n++]=(u>>>25|(h&3)<<7)&511,r[n++]=h>>>2&511,r[n++]=h>>>11&511,r[n++]=h>>>20&511,r[n++]=(h>>>29|(c&63)<<3)&511,r[n++]=c>>>6&511,r[n++]=c>>>15&511,r[n++]=(c>>>24|(p&1)<<8)&511,r[n++]=p>>>1&511,r[n++]=p>>>10&511,r[n++]=p>>>19&511,r[n++]=(p>>>28|(f&31)<<4)&511,r[n++]=f>>>5&511,r[n++]=f>>>14&511,r[n]=f>>>23&511}function Tw(e,t,r,i){let n=i,a=e[t]>>>0,s=e[t+1]>>>0,o=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,h=e[t+5]>>>0,c=e[t+6]>>>0,p=e[t+7]>>>0,f=e[t+8]>>>0,d=e[t+9]>>>0;r[n++]=a>>>0&1023,r[n++]=a>>>10&1023,r[n++]=a>>>20&1023,r[n++]=(a>>>30|(s&255)<<2)&1023,r[n++]=s>>>8&1023,r[n++]=s>>>18&1023,r[n++]=(s>>>28|(o&63)<<4)&1023,r[n++]=o>>>6&1023,r[n++]=o>>>16&1023,r[n++]=(o>>>26|(l&15)<<6)&1023,r[n++]=l>>>4&1023,r[n++]=l>>>14&1023,r[n++]=(l>>>24|(u&3)<<8)&1023,r[n++]=u>>>2&1023,r[n++]=u>>>12&1023,r[n++]=u>>>22&1023,r[n++]=h>>>0&1023,r[n++]=h>>>10&1023,r[n++]=h>>>20&1023,r[n++]=(h>>>30|(c&255)<<2)&1023,r[n++]=c>>>8&1023,r[n++]=c>>>18&1023,r[n++]=(c>>>28|(p&63)<<4)&1023,r[n++]=p>>>6&1023,r[n++]=p>>>16&1023,r[n++]=(p>>>26|(f&15)<<6)&1023,r[n++]=f>>>4&1023,r[n++]=f>>>14&1023,r[n++]=(f>>>24|(d&3)<<8)&1023,r[n++]=d>>>2&1023,r[n++]=d>>>12&1023,r[n]=d>>>22&1023}function Cw(e,t,r,i){let n=i,a=e[t]>>>0,s=e[t+1]>>>0,o=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,h=e[t+5]>>>0,c=e[t+6]>>>0,p=e[t+7]>>>0,f=e[t+8]>>>0,d=e[t+9]>>>0,y=e[t+10]>>>0;r[n++]=a>>>0&2047,r[n++]=a>>>11&2047,r[n++]=(a>>>22|(s&1)<<10)&2047,r[n++]=s>>>1&2047,r[n++]=s>>>12&2047,r[n++]=(s>>>23|(o&3)<<9)&2047,r[n++]=o>>>2&2047,r[n++]=o>>>13&2047,r[n++]=(o>>>24|(l&7)<<8)&2047,r[n++]=l>>>3&2047,r[n++]=l>>>14&2047,r[n++]=(l>>>25|(u&15)<<7)&2047,r[n++]=u>>>4&2047,r[n++]=u>>>15&2047,r[n++]=(u>>>26|(h&31)<<6)&2047,r[n++]=h>>>5&2047,r[n++]=h>>>16&2047,r[n++]=(h>>>27|(c&63)<<5)&2047,r[n++]=c>>>6&2047,r[n++]=c>>>17&2047,r[n++]=(c>>>28|(p&127)<<4)&2047,r[n++]=p>>>7&2047,r[n++]=p>>>18&2047,r[n++]=(p>>>29|(f&255)<<3)&2047,r[n++]=f>>>8&2047,r[n++]=f>>>19&2047,r[n++]=(f>>>30|(d&511)<<2)&2047,r[n++]=d>>>9&2047,r[n++]=d>>>20&2047,r[n++]=(d>>>31|(y&1023)<<1)&2047,r[n++]=y>>>10&2047,r[n]=y>>>21&2047}function Mw(e,t,r,i){let n=i,a=e[t]>>>0,s=e[t+1]>>>0,o=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,h=e[t+5]>>>0,c=e[t+6]>>>0,p=e[t+7]>>>0,f=e[t+8]>>>0,d=e[t+9]>>>0,y=e[t+10]>>>0,m=e[t+11]>>>0;r[n++]=a>>>0&4095,r[n++]=a>>>12&4095,r[n++]=(a>>>24|(s&15)<<8)&4095,r[n++]=s>>>4&4095,r[n++]=s>>>16&4095,r[n++]=(s>>>28|(o&255)<<4)&4095,r[n++]=o>>>8&4095,r[n++]=o>>>20&4095,r[n++]=l>>>0&4095,r[n++]=l>>>12&4095,r[n++]=(l>>>24|(u&15)<<8)&4095,r[n++]=u>>>4&4095,r[n++]=u>>>16&4095,r[n++]=(u>>>28|(h&255)<<4)&4095,r[n++]=h>>>8&4095,r[n++]=h>>>20&4095,r[n++]=c>>>0&4095,r[n++]=c>>>12&4095,r[n++]=(c>>>24|(p&15)<<8)&4095,r[n++]=p>>>4&4095,r[n++]=p>>>16&4095,r[n++]=(p>>>28|(f&255)<<4)&4095,r[n++]=f>>>8&4095,r[n++]=f>>>20&4095,r[n++]=d>>>0&4095,r[n++]=d>>>12&4095,r[n++]=(d>>>24|(y&15)<<8)&4095,r[n++]=y>>>4&4095,r[n++]=y>>>16&4095,r[n++]=(y>>>28|(m&255)<<4)&4095,r[n++]=m>>>8&4095,r[n]=m>>>20&4095}function Pw(e,t,r,i){let n=i,a=e[t]>>>0,s=e[t+1]>>>0,o=e[t+2]>>>0,l=e[t+3]>>>0,u=e[t+4]>>>0,h=e[t+5]>>>0,c=e[t+6]>>>0,p=e[t+7]>>>0,f=e[t+8]>>>0,d=e[t+9]>>>0,y=e[t+10]>>>0,m=e[t+11]>>>0,g=e[t+12]>>>0,x=e[t+13]>>>0,v=e[t+14]>>>0,b=e[t+15]>>>0;r[n++]=a>>>0&65535,r[n++]=a>>>16&65535,r[n++]=s>>>0&65535,r[n++]=s>>>16&65535,r[n++]=o>>>0&65535,r[n++]=o>>>16&65535,r[n++]=l>>>0&65535,r[n++]=l>>>16&65535,r[n++]=u>>>0&65535,r[n++]=u>>>16&65535,r[n++]=h>>>0&65535,r[n++]=h>>>16&65535,r[n++]=c>>>0&65535,r[n++]=c>>>16&65535,r[n++]=p>>>0&65535,r[n++]=p>>>16&65535,r[n++]=f>>>0&65535,r[n++]=f>>>16&65535,r[n++]=d>>>0&65535,r[n++]=d>>>16&65535,r[n++]=y>>>0&65535,r[n++]=y>>>16&65535,r[n++]=m>>>0&65535,r[n++]=m>>>16&65535,r[n++]=g>>>0&65535,r[n++]=g>>>16&65535,r[n++]=x>>>0&65535,r[n++]=x>>>16&65535,r[n++]=v>>>0&65535,r[n++]=v>>>16&65535,r[n++]=b>>>0&65535,r[n]=b>>>16&65535}function Bw(e,t,r,i){let n=i,a=t;for(let s=0;s<8;s++){let o=e[a++]>>>0;r[n++]=o>>>0&1,r[n++]=o>>>1&1,r[n++]=o>>>2&1,r[n++]=o>>>3&1,r[n++]=o>>>4&1,r[n++]=o>>>5&1,r[n++]=o>>>6&1,r[n++]=o>>>7&1,r[n++]=o>>>8&1,r[n++]=o>>>9&1,r[n++]=o>>>10&1,r[n++]=o>>>11&1,r[n++]=o>>>12&1,r[n++]=o>>>13&1,r[n++]=o>>>14&1,r[n++]=o>>>15&1,r[n++]=o>>>16&1,r[n++]=o>>>17&1,r[n++]=o>>>18&1,r[n++]=o>>>19&1,r[n++]=o>>>20&1,r[n++]=o>>>21&1,r[n++]=o>>>22&1,r[n++]=o>>>23&1,r[n++]=o>>>24&1,r[n++]=o>>>25&1,r[n++]=o>>>26&1,r[n++]=o>>>27&1,r[n++]=o>>>28&1,r[n++]=o>>>29&1,r[n++]=o>>>30&1,r[n++]=o>>>31&1}}function zw(e,t,r,i){let n=i,a=t;for(let s=0;s<8;s++){let o=e[a++]>>>0,l=e[a++]>>>0;r[n++]=o>>>0&3,r[n++]=o>>>2&3,r[n++]=o>>>4&3,r[n++]=o>>>6&3,r[n++]=o>>>8&3,r[n++]=o>>>10&3,r[n++]=o>>>12&3,r[n++]=o>>>14&3,r[n++]=o>>>16&3,r[n++]=o>>>18&3,r[n++]=o>>>20&3,r[n++]=o>>>22&3,r[n++]=o>>>24&3,r[n++]=o>>>26&3,r[n++]=o>>>28&3,r[n++]=o>>>30&3,r[n++]=l>>>0&3,r[n++]=l>>>2&3,r[n++]=l>>>4&3,r[n++]=l>>>6&3,r[n++]=l>>>8&3,r[n++]=l>>>10&3,r[n++]=l>>>12&3,r[n++]=l>>>14&3,r[n++]=l>>>16&3,r[n++]=l>>>18&3,r[n++]=l>>>20&3,r[n++]=l>>>22&3,r[n++]=l>>>24&3,r[n++]=l>>>26&3,r[n++]=l>>>28&3,r[n++]=l>>>30&3}}function Lw(e,t,r,i){let n=i,a=t;for(let s=0;s<8;s++){let o=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0;r[n++]=o>>>0&7,r[n++]=o>>>3&7,r[n++]=o>>>6&7,r[n++]=o>>>9&7,r[n++]=o>>>12&7,r[n++]=o>>>15&7,r[n++]=o>>>18&7,r[n++]=o>>>21&7,r[n++]=o>>>24&7,r[n++]=o>>>27&7,r[n++]=(o>>>30|(l&1)<<2)&7,r[n++]=l>>>1&7,r[n++]=l>>>4&7,r[n++]=l>>>7&7,r[n++]=l>>>10&7,r[n++]=l>>>13&7,r[n++]=l>>>16&7,r[n++]=l>>>19&7,r[n++]=l>>>22&7,r[n++]=l>>>25&7,r[n++]=l>>>28&7,r[n++]=(l>>>31|(u&3)<<1)&7,r[n++]=u>>>2&7,r[n++]=u>>>5&7,r[n++]=u>>>8&7,r[n++]=u>>>11&7,r[n++]=u>>>14&7,r[n++]=u>>>17&7,r[n++]=u>>>20&7,r[n++]=u>>>23&7,r[n++]=u>>>26&7,r[n++]=u>>>29&7}}function Vw(e,t,r,i){let n=i,a=t;for(let s=0;s<8;s++){let o=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,h=e[a++]>>>0;r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n++]=l>>>28&15,r[n++]=u>>>0&15,r[n++]=u>>>4&15,r[n++]=u>>>8&15,r[n++]=u>>>12&15,r[n++]=u>>>16&15,r[n++]=u>>>20&15,r[n++]=u>>>24&15,r[n++]=u>>>28&15,r[n++]=h>>>0&15,r[n++]=h>>>4&15,r[n++]=h>>>8&15,r[n++]=h>>>12&15,r[n++]=h>>>16&15,r[n++]=h>>>20&15,r[n++]=h>>>24&15,r[n++]=h>>>28&15}}function Ow(e,t,r,i){let n=i,a=t;for(let s=0;s<8;s++){let o=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,h=e[a++]>>>0,c=e[a++]>>>0;r[n++]=o>>>0&31,r[n++]=o>>>5&31,r[n++]=o>>>10&31,r[n++]=o>>>15&31,r[n++]=o>>>20&31,r[n++]=o>>>25&31,r[n++]=(o>>>30|(l&7)<<2)&31,r[n++]=l>>>3&31,r[n++]=l>>>8&31,r[n++]=l>>>13&31,r[n++]=l>>>18&31,r[n++]=l>>>23&31,r[n++]=(l>>>28|(u&1)<<4)&31,r[n++]=u>>>1&31,r[n++]=u>>>6&31,r[n++]=u>>>11&31,r[n++]=u>>>16&31,r[n++]=u>>>21&31,r[n++]=u>>>26&31,r[n++]=(u>>>31|(h&15)<<1)&31,r[n++]=h>>>4&31,r[n++]=h>>>9&31,r[n++]=h>>>14&31,r[n++]=h>>>19&31,r[n++]=h>>>24&31,r[n++]=(h>>>29|(c&3)<<3)&31,r[n++]=c>>>2&31,r[n++]=c>>>7&31,r[n++]=c>>>12&31,r[n++]=c>>>17&31,r[n++]=c>>>22&31,r[n++]=c>>>27&31}}function Rw(e,t,r,i){let n=i,a=t;for(let s=0;s<8;s++){let o=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,h=e[a++]>>>0,c=e[a++]>>>0,p=e[a++]>>>0;r[n++]=o>>>0&63,r[n++]=o>>>6&63,r[n++]=o>>>12&63,r[n++]=o>>>18&63,r[n++]=o>>>24&63,r[n++]=(o>>>30|(l&15)<<2)&63,r[n++]=l>>>4&63,r[n++]=l>>>10&63,r[n++]=l>>>16&63,r[n++]=l>>>22&63,r[n++]=(l>>>28|(u&3)<<4)&63,r[n++]=u>>>2&63,r[n++]=u>>>8&63,r[n++]=u>>>14&63,r[n++]=u>>>20&63,r[n++]=u>>>26&63,r[n++]=h>>>0&63,r[n++]=h>>>6&63,r[n++]=h>>>12&63,r[n++]=h>>>18&63,r[n++]=h>>>24&63,r[n++]=(h>>>30|(c&15)<<2)&63,r[n++]=c>>>4&63,r[n++]=c>>>10&63,r[n++]=c>>>16&63,r[n++]=c>>>22&63,r[n++]=(c>>>28|(p&3)<<4)&63,r[n++]=p>>>2&63,r[n++]=p>>>8&63,r[n++]=p>>>14&63,r[n++]=p>>>20&63,r[n++]=p>>>26&63}}function $w(e,t,r,i){let n=i,a=t;for(let s=0;s<8;s++){let o=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,h=e[a++]>>>0,c=e[a++]>>>0,p=e[a++]>>>0,f=e[a++]>>>0;r[n++]=o>>>0&127,r[n++]=o>>>7&127,r[n++]=o>>>14&127,r[n++]=o>>>21&127,r[n++]=(o>>>28|(l&7)<<4)&127,r[n++]=l>>>3&127,r[n++]=l>>>10&127,r[n++]=l>>>17&127,r[n++]=l>>>24&127,r[n++]=(l>>>31|(u&63)<<1)&127,r[n++]=u>>>6&127,r[n++]=u>>>13&127,r[n++]=u>>>20&127,r[n++]=(u>>>27|(h&3)<<5)&127,r[n++]=h>>>2&127,r[n++]=h>>>9&127,r[n++]=h>>>16&127,r[n++]=h>>>23&127,r[n++]=(h>>>30|(c&31)<<2)&127,r[n++]=c>>>5&127,r[n++]=c>>>12&127,r[n++]=c>>>19&127,r[n++]=(c>>>26|(p&1)<<6)&127,r[n++]=p>>>1&127,r[n++]=p>>>8&127,r[n++]=p>>>15&127,r[n++]=p>>>22&127,r[n++]=(p>>>29|(f&15)<<3)&127,r[n++]=f>>>4&127,r[n++]=f>>>11&127,r[n++]=f>>>18&127,r[n++]=f>>>25&127}}function Nw(e,t,r,i){let n=i,a=t;for(let s=0;s<8;s++){let o=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,h=e[a++]>>>0,c=e[a++]>>>0,p=e[a++]>>>0,f=e[a++]>>>0,d=e[a++]>>>0;r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n++]=p>>>24&255,r[n++]=f>>>0&255,r[n++]=f>>>8&255,r[n++]=f>>>16&255,r[n++]=f>>>24&255,r[n++]=d>>>0&255,r[n++]=d>>>8&255,r[n++]=d>>>16&255,r[n++]=d>>>24&255}}function Uw(e,t,r,i){let n=i,a=t;for(let s=0;s<128;s++){let o=e[a++]>>>0;r[n++]=o&65535,r[n++]=o>>>16&65535}}function jw(e,t,r,i,n){let a=yl[n]>>>0,s=t,o=0,l=e[s]>>>0,u=i;for(let h=0;h<8;h++){for(let c=0;c<32;c++)if(o+n<=32){let p=l>>>o&a;r[u+c]=p|0,o+=n,o===32&&(o=0,s++,c!==31&&(l=e[s]>>>0))}else{let p=32-o,f=l>>>o;s++,l=e[s]>>>0;let d=n-p,y=-1>>>32-d>>>0,m=(f|(l&y)<<p)&a;r[u+c]=m|0,o=d}u+=32,o=0,h<7&&(l=e[s]>>>0)}}var ml=vy(xu),qw=3*ml/256+ml|0;function by(){let e=new Uint8Array(qw);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:e,byteContainerI32:new Int32Array(e.buffer,e.byteOffset,e.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function Gw(e=16){if(e<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${e}`);let t=Math.max(16,e|0);return{encodedWords:new Uint32Array(t),decoderWorkspace:by()}}function Yw(e,t){if(t<=e.encodedWords.length)return e.encodedWords;let r=new Uint32Array(Math.max(16,t*2));return e.encodedWords=r,r}function Xw(e,t,r,i){i.byteContainer.length<r&&(i.byteContainer=new Uint8Array(r*2),i.byteContainerI32=void 0);let n=i.byteContainer,a=r>>>2;if(n.byteOffset&3)for(let o=0;o<a;o=o+1|0){let l=e[t+o|0]|0,u=o<<2;n[u]=l&255,n[u+1|0]=l>>>8&255,n[u+2|0]=l>>>16&255,n[u+3|0]=l>>>24&255}else{let o=i.byteContainerI32;(!o||o.buffer!==n.buffer||o.byteOffset!==n.byteOffset||o.length<a)&&(o=i.byteContainerI32=new Int32Array(n.buffer,n.byteOffset,n.byteLength>>>2)),o.set(e.subarray(t,t+a))}let s=r&3;if(s>0){let o=e[t+a|0]|0,l=a<<2;for(let u=0;u<s;u=u+1|0)n[l+u|0]=o>>>(u<<3)&255}return n}function Zw(e,t,r){let i=e[t++]|0,n=r.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(i>>>a-1&1))continue;if(t>=e.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${t}, needWords=1, availableWords=${e.length-t}, encodedWords=${e.length})`);let s=e[t++]>>>0,o=bw(s),l=s*a+31>>>5;if(t+l>e.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${s}, streamWordIndex=${t}, needWords=${l}, availableWords=${e.length-t}, encodedWords=${e.length})`);let u=n[a];(!u||u.length<o)&&(u=n[a]=new Uint32Array(o));let h=0;for(;h<s;h=h+32|0)n3(e,t,u,h,a),t=t+a|0;let c=h-s|0;t=t-(c*a>>>5)|0,r.exceptionSizes[a]=s}return t}function Ww(e,t,r,i,n){switch(n){case 1:Bw(e,t,r,i);break;case 2:zw(e,t,r,i);break;case 3:Lw(e,t,r,i);break;case 4:Vw(e,t,r,i);break;case 5:Ow(e,t,r,i);break;case 6:Rw(e,t,r,i);break;case 7:$w(e,t,r,i);break;case 8:Nw(e,t,r,i);break;case 16:Uw(e,t,r,i);break;default:jw(e,t,r,i,n)}return t+(n<<3)|0}function Hw(e,t,r,i){if(r+2>t)throw Error(`FastPFOR decode: byteContainer underflow at block=${i} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${r}, byteSize=${t})`);let n=e[r++],a=e[r++];if(n>32)throw Error(`FastPFOR decode: invalid bitWidth=${n} at block=${i} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:n,exceptionCount:a,bytePosIn:r}}function Jw(e,t,r,i,n,a){if(r+1>t)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${r}, byteSize=${t})`);let s=e[r++];if(s<i||s>32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${a} (bitWidth=${i}, expected ${i}..32)`);let o=s-i|0;if(o<1||o>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${o} at block=${a} (bitWidth=${i}, maxBits=${s})`);if(r+n>t)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${n}, have=${t-r})`);return{maxBits:s,exceptionBitWidth:o,bytePosIn:r}}function Kw(e,t,r,i,n,a,s,o,l){let{maxBits:u,exceptionBitWidth:h,bytePosIn:c}=Jw(n,a,s,r,i,l);if(s=c,h===1){let m=1<<r;for(let g=0;g<i;g=g+1|0){let x=n[s++];e[x+t|0]|=m}return s}let p=o.dataToBePacked[h];if(!p)throw Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${h} (bitWidth=${r}, maxBits=${u}) at block ${l}`);let f=o.dataPointers,d=f[h]|0,y=o.exceptionSizes[h]|0;if(d+i>y)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${h} (ptr=${d}, need ${i}, size=${y}) at block ${l}`);for(let m=0;m<i;m=m+1|0){let g=n[s++],x=p[d++]|0;e[g+t|0]|=x<<r}return f[h]=d,s}function Qw(e,t,r,i,n,a,s,o,l,u){let h=r|0,c=0;for(let p=0;p<s;p=p+1|0){let f=Hw(o,l,c,p);c=f.bytePosIn;let d=f.bitWidth,y=f.exceptionCount,m=a+p*256|0;switch(d){case 0:n.fill(0,m,m+256);break;case 32:for(let g=0;g<256;g=g+1|0)n[m+g|0]=e[h+g|0]|0;h=h+256|0;break;default:h=Ww(e,h,n,m,d)}y>0&&(c=Kw(n,m,d,y,o,l,c,u,p))}if(h!==i)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${t}, packedStart=${r}, consumedPackedEnd=${h}, expectedPackedEnd=${i}, packedWords=${i-r}, encoded.length=${e.length})`)}function e3(e,t,r,i,n,a){let s=r|0,o=e[s]|0;if(o<=0||s+o>e.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${o} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${e.length})`);let l=s+1|0,u=s+o|0,h=e[u]>>>0,c=h+3>>>2,p=u+1,f=p+c;if(f>=e.length)throw Error(`FastPFOR decode: invalid byteSize=${h} (metaInts=${c}, pageStart=${s}, packedEnd=${u}, byteContainerStart=${p}) causes bitmapPos=${f} out of bounds (encoded.length=${e.length})`);let d=Xw(e,p,h,a),y=h,m=Zw(e,f,a);return a.dataPointers.fill(0),Qw(e,s,l,u,t,i|0,n/256|0,d,y,a),m}function t3(e,t,r,i,n,a){let s=i+vu(n,256),o=i,l=r;for(;o!==s;){let u=Math.min(ml,s-o);l=e3(e,t,l,o,u,a),o=o+u|0}return l}function r3(e,t,r,i,n,a){if(a===0)return t;let s=0,o=t,l=t+r,u=n,h=n,c=n+a,p=0,f=0;for(;o<l&&h<c;){let d=e[o]>>>s&255;if(s+=8,o+=s>>>5,s&=31,p|=(d&127)<<f,d&128)i[h++]=p|0,p=0,f=0;else if(f+=7,f>28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${f}, partial=${p}, decoded=${h-u}/${a}, inPos=${o}, inEnd=${l})`)}if(h!==c)throw Error(`FastPFOR VByte: truncated stream (decoded=${h-u}, expected=${a}, consumedWords=${o-t}/${r}, vbyteStart=${t}, vbyteEnd=${l})`);return o}function i3(e,t,r){let i=0,n=0,a=new Uint32Array(t),s=r??by();if(e.length>0){let u=e[i]|0;if(i=i+1|0,u&255)throw Error(`FastPFOR decode: invalid alignedLength=${u} (expected multiple of 256)`);if(n+u>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${n}, alignedLength=${u}, out.length=${a.length})`);i=t3(e,a,i,n,u,s),n=n+u|0}let o=e.length-i|0,l=t-n|0;return r3(e,i,o,a,n,l),a}function n3(e,t,r,i,n){switch(n){case 2:_w(e,t,r,i);return;case 3:Dw(e,t,r,i);return;case 4:Sw(e,t,r,i);return;case 5:Aw(e,t,r,i);return;case 6:Ew(e,t,r,i);return;case 7:Fw(e,t,r,i);return;case 8:Iw(e,t,r,i);return;case 9:kw(e,t,r,i);return;case 10:Tw(e,t,r,i);return;case 11:Cw(e,t,r,i);return;case 12:Mw(e,t,r,i);return;case 16:Pw(e,t,r,i);return;case 32:for(let u=0;u<32;u=u+1|0)r[i+u|0]=e[t+u|0]|0;return}let a=yl[n]>>>0,s=t,o=0,l=e[s]>>>0;for(let u=0;u<32;u++)if(o+n<=32){let h=l>>>o&a;r[i+u]=h|0,o+=n,o===32&&(o=0,s++,u!==31&&(l=e[s]>>>0))}else{let h=32-o,c=l>>>o;s++,l=e[s]>>>0;let p=yl[n-h]>>>0,f=(c|(l&p)<<h)&a;r[i+u]=f|0,o=n-h}}function a3(e,t,r,i){if(t<0||r<0||t+r>e.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${t}, byteLength=${r}, bytes.length=${e.length})`);let n=Math.floor(r/4),a=r%4!=0,s=a?n+1:n;if(i.length<s)throw RangeError(`decodeBigEndianInt32sInto: out.length=${i.length} < ${s}`);if(n>0){let o=e.byteOffset+t;if(o&3)for(let l=0;l<n;l++){let u=t+l*4;i[l]=e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]}else{let l=new Uint32Array(e.buffer,o,n);for(let u=0;u<n;u++)i[u]=ww(l[u])|0}}if(a){let o=t+n*4,l=r-n*4,u=0;for(let h=0;h<l;h++)u|=e[o+h]<<24-h*8;i[n]=u|0}return s}function $e(e,t,r){let i=new Uint32Array(r),n=0,a=t.get();for(let s=0;s<i.length;s++){let o=e[a++],l=o&127;o<128||(o=e[a++],l|=(o&127)<<7,o<128||(o=e[a++],l|=(o&127)<<14,o<128||(o=e[a++],l|=(o&127)<<21,o<128||(o=e[a++],l|=(o&15)<<28)))),i[n++]=l}return t.set(a),i}function bu(e,t,r){let i=new BigUint64Array(r);for(let n=0;n<i.length;n++)i[n]=s3(e,t);return i}function s3(e,t){let r=0n,i=0,n=t.get();for(;n<e.length;){let a=e[n++];if(r|=BigInt(a&127)<<BigInt(i),!(a&128))break;if(i+=7,i>=64)throw Error("Varint too long")}return t.set(n),r}function o3(e,t,r){let i=new Float64Array(r);for(let n=0;n<r;n++)i[n]=l3(e,t);return i}function l3(e,t){let r,i;return i=e[t.get()],t.increment(),r=i&127,i<128||(i=e[t.get()],t.increment(),r|=(i&127)<<7,i<128)||(i=e[t.get()],t.increment(),r|=(i&127)<<14,i<128)||(i=e[t.get()],t.increment(),r|=(i&127)<<21,i<128)?r:(i=e[t.get()],r|=(i&15)<<28,u3(r,e,t))}function u3(e,t,r){let i,n;if(n=t[r.get()],r.increment(),i=(n&112)>>4,n<128||(n=t[r.get()],r.increment(),i|=(n&127)<<3,n<128)||(n=t[r.get()],r.increment(),i|=(n&127)<<10,n<128)||(n=t[r.get()],r.increment(),i|=(n&127)<<17,n<128)||(n=t[r.get()],r.increment(),i|=(n&127)<<24,n<128)||(n=t[r.get()],r.increment(),i|=(n&1)<<31,n<128))return i*4294967296+(e>>>0);throw Error("Expected varint not more than 10 bytes")}function h3(e,t,r,i){return c3(e,t,r,i,Gw(r>>>2))}function c3(e,t,r,i,n){let a=i.get();if(r&3)throw Error(`FastPFOR: invalid encodedByteLength=${r} at offset=${a} (encodedBytes.length=${e.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let s=r>>>2,o=Yw(n,s);a3(e,a,r,o);let l=i3(o.subarray(0,s),t,n.decoderWorkspace);return i.add(r),l}function ee(e){return e>>>1^-(e&1)}function Oe(e){return e>>1n^-(e&1n)}function Yt(e){return e%2==1?(e+1)/-2:e/2}function p3(e){let t=new Int32Array(e.length);for(let r=0;r<e.length;r++)t[r]=ee(e[r]);return t}function f3(e){let t=new BigInt64Array(e.length);for(let r=0;r<e.length;r++)t[r]=Oe(e[r]);return t}function d3(e){for(let t=0;t<e.length;t++)e[t]=Yt(e[t])}function gl(e,t,r){if(r===void 0){r=0;for(let a=0;a<t;a++)r+=e[a]}let i=new Uint32Array(r),n=0;for(let a=0;a<t;a++){let s=e[a],o=e[a+t];i.fill(o,n,n+s),n+=s}return i}function xl(e,t,r){if(r===void 0){r=0;for(let a=0;a<t;a++)r+=Number(e[a])}let i=new BigUint64Array(r),n=0;for(let a=0;a<t;a++){let s=Number(e[a]),o=e[a+t];i.fill(o,n,n+s),n+=s}return i}function wy(e,t,r){let i=new Float64Array(r),n=0;for(let a=0;a<t;a++){let s=e[a],o=e[a+t];i.fill(o,n,n+s),n+=s}return i}function Rc(e){let t=new Int32Array(e.length);t[0]=ee(e[0]);let r=e.length/4*4,i=1;if(r>=4)for(;i<r-4;i+=4){let n=e[i],a=e[i+1],s=e[i+2],o=e[i+3];t[i]=ee(n)+t[i-1],t[i+1]=ee(a)+t[i],t[i+2]=ee(s)+t[i+1],t[i+3]=ee(o)+t[i+2]}for(;i!==e.length;++i)t[i]=ee(e[i])+t[i-1];return t}function $c(e){let t=new BigInt64Array(e.length);t[0]=Oe(e[0]);let r=e.length/4*4,i=1;if(r>=4)for(;i<r-4;i+=4){let n=e[i],a=e[i+1],s=e[i+2],o=e[i+3];t[i]=Oe(n)+t[i-1],t[i+1]=Oe(a)+t[i],t[i+2]=Oe(s)+t[i+1],t[i+3]=Oe(o)+t[i+2]}for(;i!==t.length;++i)t[i]=Oe(e[i])+t[i-1];return t}function y3(e){e[0]=Yt(e[0]);let t=e.length/4*4,r=1;if(t>=4)for(;r<t-4;r+=4){let i=e[r],n=e[r+1],a=e[r+2],s=e[r+3];e[r]=Yt(i)+e[r-1],e[r+1]=Yt(n)+e[r],e[r+2]=Yt(a)+e[r+1],e[r+3]=Yt(s)+e[r+2]}for(;r!==e.length;++r)e[r]=Yt(e[r])+e[r-1]}function m3(e,t,r){if(r===void 0){r=0;for(let a=0;a<t;a++)r+=e[a]}let i=new Int32Array(r),n=0;for(let a=0;a<t;a++){let s=e[a],o=e[a+t];o=ee(o),i.fill(o,n,n+s),n+=s}return i}function g3(e,t,r){if(r===void 0){r=0;for(let a=0;a<t;a++)r+=Number(e[a])}let i=new BigInt64Array(r),n=0;for(let a=0;a<t;a++){let s=Number(e[a]),o=e[a+t];o=Oe(o),i.fill(o,n,n+s),n+=s}return i}function x3(e,t,r){let i=new Float64Array(r),n=0;for(let a=0;a<t;a++){let s=e[a],o=e[a+t];o=Yt(o),i.fill(o,n,n+s),n+=s}return i}function wu(e){let t=e.length/4*4,r=1;if(t>=4)for(let i=e[0];r<t-4;r+=4)i=e[r]+=i,i=e[r+1]+=i,i=e[r+2]+=i,i=e[r+3]+=i;for(;r!==e.length;)e[r]+=e[r-1],++r}function v3(e){let t=0;for(let r=0;r<e.length;r++)e[r]+=t,t=e[r]}function b3(e){if(e.length<2)return new Int32Array(e);let t=new Int32Array(e.length);t[0]=ee(e[0]),t[1]=ee(e[1]);let r=e.length/4*4,i=2;if(r>=4)for(;i<r-4;i+=4){let n=e[i],a=e[i+1],s=e[i+2],o=e[i+3];t[i]=ee(n)+t[i-2],t[i+1]=ee(a)+t[i-1],t[i+2]=ee(s)+t[i],t[i+3]=ee(o)+t[i+1]}for(;i!==e.length;i+=2)t[i]=ee(e[i])+t[i-2],t[i+1]=ee(e[i+1])+t[i-1];return t}function _y(e,t,r,i){if(e.length<2)return new Int32Array(e);let n=new Int32Array(e.length),a=ee(e[0]),s=ee(e[1]);n[0]=qt(Math.round(a*t),r,i),n[1]=qt(Math.round(s*t),r,i);let o=e.length/16,l=2;if(o>=4)for(;l<o-4;l+=4){let u=e[l],h=e[l+1],c=ee(u)+a,p=ee(h)+s;n[l]=qt(Math.round(c*t),r,i),n[l+1]=qt(Math.round(p*t),r,i);let f=e[l+2],d=e[l+3];a=ee(f)+c,s=ee(d)+p,n[l+2]=qt(Math.round(a*t),r,i),n[l+3]=qt(Math.round(s*t),r,i)}for(;l!==e.length;l+=2)a+=ee(e[l]),s+=ee(e[l+1]),n[l]=qt(Math.round(a*t),r,i),n[l+1]=qt(Math.round(s*t),r,i);return n}function qt(e,t,r){return Math.min(r,Math.max(t,e))}function w3(e){let t=new Int32Array(e.length+1);t[0]=0,t[1]=ee(e[0]);let r=t[1];for(let i=2;i!==t.length;++i){let n=e[i-1],a=ee(n);r+=a,t[i]=t[i-1]+r}return new Uint32Array(t)}function _3(e,t,r){let i=new Int32Array(r+1);i[0]=0;let n=1,a=i[0];for(let s=0;s<t;s++){let o=e[s],l=e[s+t];l=ee(l);for(let u=n;u<n+o;u++)i[u]=l+a,a=i[u];n+=o}return i}function D3(e,t,r){let i=new Uint32Array(r+1);i[0]=0;let n=1,a=i[0];for(let s=0;s<t;s++){let o=e[s],l=e[s+t];for(let u=n;u<n+o;u++)i[u]=l+a,a=i[u];n+=o}return i}function S3(e,t,r){let i=new Int32Array(r),n=0,a=0;for(let s=0;s<t;s++){let o=e[s],l=e[s+t],u=ee(l);for(let h=0;h<o;h++)a+=u,i[n++]=a}return i}function A3(e,t,r){let i=new BigInt64Array(r),n=0,a=0n;for(let s=0;s<t;s++){let o=Number(e[s]),l=e[s+t],u=Oe(l);for(let h=0;h<o;h++)a+=u,i[n++]=a}return i}function Nc(e){let t=new Uint32Array(e.length);t[0]=ee(e[0])>>>0;for(let r=1;r<e.length;r++)t[r]=t[r-1]+ee(e[r])>>>0;return t}function Uc(e){let t=new BigUint64Array(e.length);t[0]=BigInt.asUintN(64,Oe(e[0]));for(let r=1;r<e.length;r++)t[r]=BigInt.asUintN(64,t[r-1]+Oe(e[r]));return t}function E3(e){if(e.length<2)return new Uint32Array(e);let t=new Uint32Array(e.length);t[0]=ee(e[0])>>>0,t[1]=ee(e[1])>>>0;for(let r=2;r<e.length;r+=2)t[r]=t[r-2]+ee(e[r])>>>0,t[r+1]=t[r-1]+ee(e[r+1])>>>0;return t}function F3(e,t,r,i){let n=_y(e,t,r,i);return new Uint32Array(n)}function I3(e){return e[1]}function k3(e){return ee(e[1])}function T3(e){if(e.length===2){let t=ee(e[1]);return[t,t]}return[ee(e[2]),ee(e[3])]}function C3(e){return e[1]}function M3(e){return Oe(e[1])}function P3(e){if(e.length===2){let t=Oe(e[1]);return[t,t]}return[Oe(e[2]),Oe(e[3])]}var Fe;(function(e){e.PRESENT="PRESENT",e.DATA="DATA",e.OFFSET="OFFSET",e.LENGTH="LENGTH"})(Fe||={});var je;(function(e){e.NONE="NONE",e.SINGLE="SINGLE",e.SHARED="SHARED",e.VERTEX="VERTEX",e.MORTON="MORTON",e.FSST="FSST"})(je||={});var Pt;(function(e){e.VERTEX="VERTEX",e.INDEX="INDEX",e.STRING="STRING",e.KEY="KEY"})(Pt||={});var Ce;(function(e){e.VAR_BINARY="VAR_BINARY",e.GEOMETRIES="GEOMETRIES",e.PARTS="PARTS",e.RINGS="RINGS",e.TRIANGLES="TRIANGLES",e.SYMBOL="SYMBOL",e.DICTIONARY="DICTIONARY"})(Ce||={});var B3=[Fe.PRESENT,Fe.DATA,Fe.OFFSET,Fe.LENGTH],jc=[W.NONE,W.DELTA,W.COMPONENTWISE_DELTA,W.RLE,W.MORTON],z3=[lt.NONE,lt.FAST_PFOR,lt.VARINT],L3=[je.NONE,je.SINGLE,je.SHARED,je.VERTEX,je.MORTON,je.FSST],V3=[Pt.VERTEX,Pt.INDEX,Pt.STRING,Pt.KEY],O3=[Ce.VAR_BINARY,Ce.GEOMETRIES,Ce.PARTS,Ce.RINGS,Ce.TRIANGLES,Ce.SYMBOL,Ce.DICTIONARY];function pe(e,t){let r=N3(e,t);return r.logicalLevelTechnique1===W.MORTON?R3(r,e,t):(W.RLE===r.logicalLevelTechnique1||W.RLE===r.logicalLevelTechnique2)&&lt.NONE!==r.physicalLevelTechnique?$3(r,e,t):r}function R3(e,t,r){let i=$e(t,r,2);return{physicalStreamType:e.physicalStreamType,logicalStreamType:e.logicalStreamType,logicalLevelTechnique1:e.logicalLevelTechnique1,logicalLevelTechnique2:e.logicalLevelTechnique2,physicalLevelTechnique:e.physicalLevelTechnique,numValues:e.numValues,byteLength:e.byteLength,decompressedCount:e.decompressedCount,numBits:i[0],coordinateShift:i[1]}}function $3(e,t,r){let i=$e(t,r,2);return{physicalStreamType:e.physicalStreamType,logicalStreamType:e.logicalStreamType,logicalLevelTechnique1:e.logicalLevelTechnique1,logicalLevelTechnique2:e.logicalLevelTechnique2,physicalLevelTechnique:e.physicalLevelTechnique,numValues:e.numValues,byteLength:e.byteLength,decompressedCount:i[1],runs:i[0],numRleValues:i[1]}}function N3(e,t){let r=e[t.get()],i=B3[r>>4],n={};switch(i){case Fe.DATA:n={dictionaryType:L3[r&15]};break;case Fe.OFFSET:n={offsetType:V3[r&15]};break;case Fe.LENGTH:n={lengthType:O3[r&15]}}t.increment();let a=e[t.get()],s=jc[a>>5],o=jc[a>>2&7],l=z3[a&3];t.increment();let u=$e(e,t,2),h=u[0],c=u[1];return{physicalStreamType:i,logicalStreamType:n,logicalLevelTechnique1:s,logicalLevelTechnique2:o,physicalLevelTechnique:l,numValues:h,byteLength:c,decompressedCount:h}}var ce;(function(e){e[e.FLAT=0]="FLAT",e[e.CONST=1]="CONST",e[e.SEQUENCE=2]="SEQUENCE",e[e.DICTIONARY=3]="DICTIONARY",e[e.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(ce||={});var ft=class{constructor(e,t){this.values=e,this._size=t}get(e){let t=Math.floor(e/8),r=e%8;return(this.values[t]>>r&1)==1}set(e,t){let r=Math.floor(e/8),i=e%8;this.values[r]=this.values[r]|+!!t<<i}getInt(e){let t=Math.floor(e/8),r=e%8;return this.values[t]>>r&1}size(){return this._size}getBuffer(){return this.values}};function _r(e,t,r){if(!t)return e;let i=t.size(),n=e.constructor,a=new n(i),s=0;for(let o=0;o<i;o++)a[o]=t.get(o)?e[s++]:r;return a}function U3(e,t,r){if(!r)return e;let i=r.size(),n=new ft(e,t),a=new ft(new Uint8Array(Math.ceil(i/8)),i),s=0;for(let o=0;o<i;o++){let l=r.get(o)?n.get(s++):!1;a.set(o,l)}return a.getBuffer()}function Dy(e,t,r){for(let i=0;i<e;i++){let n=pe(t,r);r.add(n.byteLength)}}function ui(e,t,r,i,n){let a=j3(e,Math.ceil(t/8),r,i);return n?U3(a,t,n):a}function j3(e,t,r,i){let n=new Uint8Array(t),a=0,s=i.get()+r;for(;a<t&&!(i.get()>=s);){let o=e[i.increment()];if(o<=127){let l=o+3,u=e[i.increment()],h=Math.min(a+l,t);n.fill(u,a,h),a=h}else{let l=256-o;for(let u=0;u<l&&a<t;u++)n[a++]=e[i.increment()]}}return i.set(s),n}function Sy(e,t,r,i){let n=t.get(),a=n+r*Float32Array.BYTES_PER_ELEMENT,s=new Uint8Array(e.subarray(n,a)).buffer,o=new Float32Array(s);return t.set(a),i?_r(o,i,0):o}function Ay(e,t,r,i){let n=t.get(),a=n+r*Float64Array.BYTES_PER_ELEMENT,s=new Uint8Array(e.subarray(n,a)).buffer,o=new Float64Array(s);return t.set(a),i?_r(o,i,0):o}function q3(e,t,r){let i=t.get(),n=r*Uint32Array.BYTES_PER_ELEMENT,a=new DataView(e.buffer,e.byteOffset,e.byteLength),s=new Uint32Array(r);for(let o=0;o<r;o++)s[o]=a.getUint32(i+o*Uint32Array.BYTES_PER_ELEMENT,!0);return t.add(n),s}function G3(e,t,r){let i=t.get(),n=r*BigUint64Array.BYTES_PER_ELEMENT,a=new DataView(e.buffer,e.byteOffset,e.byteLength),s=new BigUint64Array(r);for(let o=0;o<r;o++)s[o]=a.getBigUint64(i+o*BigUint64Array.BYTES_PER_ELEMENT,!0);return t.add(n),s}var Y3=new TextDecoder;function _u(e,t,r){return r-t>=12?Y3.decode(e.subarray(t,r)):X3(e,t,r)}function X3(e,t,r){let i="",n=t;for(;n<r;){let a=e[n],s=null,o=a>239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,h;o===1?a<128&&(s=a):o===2?(l=e[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=e[n+1],u=e[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=e[n+1],u=e[n+2],h=e[n+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function Pa(e,t,r,i,n){return K3(hi(e,t,r),r,i,n)}function Ve(e,t,r,i,n){return Q3(hi(e,t,r),r,i,n)}function Xt(e,t,r){return t6(hi(e,t,r),r)}function hi(e,t,r){let i=r.physicalLevelTechnique;switch(i){case lt.FAST_PFOR:return h3(e,r.numValues,r.byteLength,t);case lt.VARINT:return $e(e,t,r.numValues);case lt.NONE:return q3(e,t,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function Dn(e,t,r){let i=r.physicalLevelTechnique;switch(i){case lt.VARINT:return bu(e,t,r.numValues);case lt.NONE:return G3(e,t,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function Z3(e,t,r){let i=hi(e,t,r);return i.length===1?ee(i[0]):k3(i)}function Du(e,t,r){let i=hi(e,t,r);return i.length===1?r.logicalLevelTechnique1===W.DELTA?ee(i[0]):i[0]:I3(i)}function Ey(e,t,r){return T3(hi(e,t,r))}function Fy(e,t,r){return P3(bu(e,t,r.numValues))}function Iy(e,t,r,i){return Ty(Dn(e,t,r),r,i)}function Su(e,t,r,i){return Cy(Dn(e,t,r),r,i)}function W3(e,t,r,i){let n=H3(e,t,r,!1);return i?_r(n,i,0):n}function H3(e,t,r,i){if(r.physicalLevelTechnique===lt.VARINT)return e6(o3(e,t,r.numValues),r,i);let n=Dn(e,t,r),a=i?Ty(n,r):Cy(n,r);return Float64Array.from(a,Number)}function J3(e,t,r){let i=Dn(e,t,r);return i.length===1?Oe(i[0]):M3(i)}function ky(e,t,r){let i=Dn(e,t,r);return i.length===1?r.logicalLevelTechnique1===W.DELTA?Oe(i[0]):i[0]:C3(i)}function K3(e,t,r,i){let n;switch(t.logicalLevelTechnique1){case W.DELTA:if(t.logicalLevelTechnique2===W.RLE){let a=t;if(!i)return S3(e,a.runs,a.numRleValues);e=gl(e,a.runs,a.numRleValues),n=Rc(e)}else n=Rc(e);break;case W.RLE:n=m3(e,t.runs,t.numRleValues);break;case W.MORTON:wu(e),n=new Int32Array(e);break;case W.COMPONENTWISE_DELTA:if(r&&!i)return _y(e,r.scale,r.min,r.max);n=b3(e);break;case W.NONE:n=p3(e);break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return i?_r(n,i,0):n}function Q3(e,t,r,i){let n;switch(t.logicalLevelTechnique1){case W.DELTA:if(t.logicalLevelTechnique2===W.RLE){let a=t;n=Nc(gl(e,a.runs,a.numRleValues))}else n=Nc(e);break;case W.RLE:n=gl(e,t.runs,t.numRleValues);break;case W.MORTON:wu(e),n=e;break;case W.COMPONENTWISE_DELTA:n=r&&!i?F3(e,r.scale,r.min,r.max):E3(e);break;case W.NONE:n=e;break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return i?_r(n,i,0):n}function Ty(e,t,r){let i;switch(t.logicalLevelTechnique1){case W.DELTA:if(t.logicalLevelTechnique2===W.RLE){let n=t;if(!r)return A3(e,n.runs,n.numRleValues);e=xl(e,n.runs,n.numRleValues),i=$c(e)}else i=$c(e);break;case W.RLE:i=g3(e,t.runs,t.numRleValues);break;case W.NONE:i=f3(e);break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return r?_r(i,r,0n):i}function Cy(e,t,r){let i;switch(t.logicalLevelTechnique1){case W.DELTA:if(t.logicalLevelTechnique2===W.RLE){let n=t;i=Uc(xl(e,n.runs,n.numRleValues))}else i=Uc(e);break;case W.RLE:i=xl(e,t.runs,t.numRleValues);break;case W.NONE:i=e;break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return r?_r(i,r,0n):i}function e6(e,t,r){switch(t.logicalLevelTechnique1){case W.DELTA:if(t.logicalLevelTechnique2===W.RLE){let i=t;e=wy(e,i.runs,i.numRleValues)}return y3(e),e;case W.RLE:return i6(e,t,r);case W.NONE:return r&&d3(e),e;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}}function t6(e,t){if(t.logicalLevelTechnique1===W.DELTA&&t.logicalLevelTechnique2===W.NONE)return w3(e);if(t.logicalLevelTechnique1===W.RLE&&t.logicalLevelTechnique2===W.NONE){let r=t;return D3(e,r.runs,r.numRleValues)}if(t.logicalLevelTechnique1===W.NONE&&t.logicalLevelTechnique2===W.NONE){v3(e);let r=new Uint32Array(t.numValues+1);return r[0]=0,r.set(e,1),r}if(t.logicalLevelTechnique1===W.DELTA&&t.logicalLevelTechnique2===W.RLE){let r=t,i=_3(e,r.runs,r.numRleValues);return wu(i),new Uint32Array(i)}throw Error("Only delta encoding is supported for transforming length to offset streams yet.")}function ts(e,t,r,i,n="int32"){let a=e.logicalLevelTechnique1;if(a===W.RLE)return e.runs===1?ce.CONST:ce.FLAT;if(a!==W.DELTA||e.logicalLevelTechnique2!==W.RLE)return e.numValues===1?ce.CONST:ce.FLAT;let s=t instanceof ft?t.size():t,o=e;if(o.numRleValues!==s)return ce.FLAT;if(o.runs===1)return ce.SEQUENCE;if(o.runs!==2)return e.numValues===1?ce.CONST:ce.FLAT;let l=i.get();if(e.physicalLevelTechnique===lt.VARINT)return r6(r,i,n)?ce.SEQUENCE:e.numValues===1?ce.CONST:ce.FLAT;let u=i.get(),h=new Int32Array(r.buffer,r.byteOffset+u,4);return i.set(l),h[2]===2&&h[3]===2?ce.SEQUENCE:e.numValues===1?ce.CONST:ce.FLAT}function r6(e,t,r){let i=new xy(t.get());if(r==="int64"){let a=bu(e,i,4);return a[2]===2n&&a[3]===2n}let n=$e(e,i,4);return n[2]===2&&n[3]===2}function i6(e,t,r){return r?x3(e,t.runs,t.numRleValues):wy(e,t.runs,t.numRleValues)}var My=class extends es{getValueFromBuffer(e){return this.dataBuffer[e]}},Py=class extends my{constructor(e,t,r,i,n){super(e,n?BigInt64Array.of(t):BigUint64Array.of(t),r,i)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}};function Au(e,t,r){return{x:qc(e,t)-r,y:qc(e>>1,t)-r}}function qc(e,t){let r=0;for(let i=0;i<t;i++)r|=(e&1<<2*i)>>i;return r}var Re;(function(e){e[e.POINT=0]="POINT",e[e.LINESTRING=1]="LINESTRING",e[e.POLYGON=2]="POLYGON",e[e.MULTIPOINT=3]="MULTIPOINT",e[e.MULTILINESTRING=4]="MULTILINESTRING",e[e.MULTIPOLYGON=5]="MULTIPOLYGON"})(Re||={});var n6;(function(e){e[e.POINT=0]="POINT",e[e.LINESTRING=1]="LINESTRING",e[e.POLYGON=2]="POLYGON"})(n6||={});var Dr;(function(e){e[e.MORTON=0]="MORTON",e[e.VEC_2=1]="VEC_2",e[e.VEC_3=2]="VEC_3"})(Dr||={});function a6(e){let t=Array(e.numGeometries),r=1,i=1,n=1,a=0,s=0,o=0,l=e.mortonSettings,u=e.topologyVector,h=u.geometryOffsets,c=u.partOffsets,p=u.ringOffsets,f=e.vertexOffsets,d=!f||f.length===0,y=e.containsPolygonGeometry(),m=e.vertexBuffer;for(let g=0;g<e.numGeometries;g++){let x=e.geometryType(g);switch(x){case Re.POINT:{let v,b;if(d)v=m[s++],b=m[s++];else if(e.vertexBufferType===Dr.MORTON){let w=m[f[o++]],S=Au(w,l.numBits,l.coordinateShift);v=S.x,b=S.y}else{let w=f[o++]*2;v=m[w],b=m[w+1]}t[a++]=[[new B(v,b)]],h&&n++,c&&r++,p&&i++}break;case Re.MULTIPOINT:{let v=h[n]-h[n-1];n++;let b;if(d){b=Array(v);for(let w=0;w<v;w++){let S=m[s++],D=m[s++];b[w]=new B(S,D)}}else b=sr(e.vertexBufferType,m,f,o,v,!1,l),o+=v;t[a++]=b.map(w=>[w]),r+=v,i+=v}break;case Re.LINESTRING:{let v;y?(v=p[i]-p[i-1],i++):v=c[r]-c[r-1],r++;let b;d?(b=Pr(m,s,v,!1),s+=v*2):(b=sr(e.vertexBufferType,m,f,o,v,!1,l),o+=v),t[a++]=[b],h&&n++}break;case Re.POLYGON:{let v=c[r]-c[r-1];r++;let b=Array(v-1),w,S=p[i]-p[i-1];if(i++,d){w=Pr(m,s,S,!0),s+=S*2;for(let D=0;D<b.length;D++)S=p[i]-p[i-1],i++,b[D]=Pr(m,s,S,!0),s+=S*2}else{w=sr(e.vertexBufferType,m,f,o,S,!0,l),o+=S;for(let D=0;D<b.length;D++)S=p[i]-p[i-1],i++,b[D]=sr(e.vertexBufferType,m,f,o,S,!0,l),o+=S}t[a++]=[w].concat(b),h&&n++}break;case Re.MULTILINESTRING:{let v=h[n]-h[n-1];n++;let b=Array(v);for(let w=0;w<v;w++){let S;if(y?(S=p[i]-p[i-1],i++):S=c[r]-c[r-1],r++,d)b[w]=Pr(m,s,S,!1),s+=S*2;else{let D=sr(e.vertexBufferType,m,f,o,S,!1,l);b[w]=D,o+=S}}t[a++]=b}break;case Re.MULTIPOLYGON:{let v=h[n]-h[n-1];n++;let b=Array(v);for(let w=0;w<v;w++){let S=c[r]-c[r-1];r++;let D,A=Array(S-1),E=p[i]-p[i-1];i++,d?(D=Pr(m,s,E,!0),s+=E*2):(D=sr(e.vertexBufferType,m,f,o,E,!0,l),o+=E);for(let V=0;V<A.length;V++){let M=p[i]-p[i-1];i++,d?(A[V]=Pr(m,s,M,!0),s+=M*2):(A[V]=sr(e.vertexBufferType,m,f,o,M,!0,l),o+=M)}b[w]=[D].concat(A)}t[a++]=b.flat()}break;default:throw Error(`The specified geometry type (${x}) is currently not supported.`)}}return t}function sr(e,t,r,i,n,a,s){return e===Dr.MORTON?o6(t,r,i,n,a,s):s6(t,r,i,n,a)}function Pr(e,t,r,i){let n=Array(i?r+1:r);for(let a=0;a<r*2;a+=2){let s=e[t+a],o=e[t+a+1];n[a/2]=new B(s,o)}return i&&(n[n.length-1]=n[0]),n}function s6(e,t,r,i,n){let a=Array(n?i+1:i);for(let s=0;s<i*2;s+=2){let o=t[r+s/2]*2,l=e[o],u=e[o+1];a[s/2]=new B(l,u)}return n&&(a[a.length-1]=a[0]),a}function o6(e,t,r,i,n,a){let s=Array(n?i+1:i);for(let o=0;o<i;o++){let l=e[t[r+o]],u=Au(l,a.numBits,a.coordinateShift);s[o]=new B(u.x,u.y)}return n&&(s[s.length-1]=s[0]),s}var By=class{constructor(e,t,r,i,n){this._vertexBufferType=e,this._topologyVector=t,this._vertexOffsets=r,this._vertexBuffer=i,this._mortonSettings=n}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(e){let t=this.vertexOffsets?this.vertexOffsets[e]*2:e*2;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){let r=this.vertexOffsets[e],i=this.vertexBuffer[r],n=Au(i,this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[n.x,n.y]}let t=this.vertexOffsets?this.vertexOffsets[e]*2:e*2;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getGeometries(){return a6(this)}get mortonSettings(){return this._mortonSettings}};function l6(e,t,r,i,n){return new zy(e,t,Dr.VEC_2,r,i,n)}function u6(e,t,r,i,n,a){return new zy(e,t,Dr.MORTON,r,i,n,a)}var zy=class extends By{constructor(e,t,r,i,n,a,s){super(r,i,n,a,s),this._numGeometries=e,this._geometryType=t}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===Re.POLYGON||this._geometryType===Re.MULTIPOLYGON}containsSingleGeometryType(){return!0}};function Ly(e,t,r,i){return new Vy(Dr.VEC_2,e,t,r,i)}function h6(e,t,r,i,n){return new Vy(Dr.MORTON,e,t,r,i,n)}var Vy=class extends By{constructor(e,t,r,i,n,a){super(e,r,i,n,a),this._geometryTypes=t}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let e=0;e<this.numGeometries;e++)if(this.geometryType(e)===Re.POLYGON||this.geometryType(e)===Re.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}},Oy=class{constructor(e,t,r,i){this._triangleOffsets=e,this._indexBuffer=t,this._vertexBuffer=r,this._topologyVector=i}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw Error("Cannot convert GpuVector to coordinates without topology information");let e=new Uint32Array(this.numGeometries);for(let t=0;t<this.numGeometries;t++)e[t]=this.geometryType(t);return Ly(e,this._topologyVector,void 0,this._vertexBuffer).getGeometries()}[Symbol.iterator](){return null}};function Gc(e,t,r,i,n,a){return new c6(e,t,r,i,n,a)}var c6=class extends Oy{constructor(e,t,r,i,n,a){super(r,i,n,a),this._numGeometries=e,this._geometryType=t}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}};function Yc(e,t,r,i,n){return new p6(e,t,r,i,n)}var p6=class extends Oy{constructor(e,t,r,i,n){super(t,r,i,n),this._geometryTypes=e}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}};function f6(e,t,r,i,n){let a=pe(e,r),s=ts(a,i,e,r),o,l,u,h;if(s===ce.CONST){let v=Du(e,r,a),b,w,S,D;for(let A=0;A<t-1;A++){let E=pe(e,r);switch(E.physicalStreamType){case Fe.LENGTH:switch(E.logicalStreamType.lengthType){case Ce.GEOMETRIES:b=Xt(e,r,E);break;case Ce.PARTS:w=Xt(e,r,E);break;case Ce.RINGS:S=Xt(e,r,E);break;case Ce.TRIANGLES:D=Xt(e,r,E)}break;case Fe.OFFSET:switch(E.logicalStreamType.offsetType){case Pt.VERTEX:o=Ve(e,r,E);break;case Pt.INDEX:h=Ve(e,r,E)}break;case Fe.DATA:if(je.VERTEX===E.logicalStreamType.dictionaryType)l=Pa(e,r,E,n);else{let V=E;u={numBits:V.numBits,coordinateShift:V.coordinateShift},l=Ve(e,r,E,n)}}}return h?b!==void 0||w!==void 0?Gc(i,v,D,h,l,{geometryOffsets:b,partOffsets:w,ringOffsets:S}):Gc(i,v,D,h,l):u===void 0?l6(i,v,{geometryOffsets:b,partOffsets:w,ringOffsets:S},o,l):u6(i,v,{geometryOffsets:b,partOffsets:w,ringOffsets:S},o,l,u)}let c=Ve(e,r,a),p,f,d,y;for(let v=0;v<t-1;v++){let b=pe(e,r);switch(b.physicalStreamType){case Fe.LENGTH:switch(b.logicalStreamType.lengthType){case Ce.GEOMETRIES:p=Ve(e,r,b);break;case Ce.PARTS:f=Ve(e,r,b);break;case Ce.RINGS:d=Ve(e,r,b);break;case Ce.TRIANGLES:y=Xt(e,r,b)}break;case Fe.OFFSET:switch(b.logicalStreamType.offsetType){case Pt.VERTEX:o=Ve(e,r,b);break;case Pt.INDEX:h=Ve(e,r,b)}break;case Fe.DATA:if(je.VERTEX===b.logicalStreamType.dictionaryType)l=Pa(e,r,b,n);else{let w=b;u={numBits:w.numBits,coordinateShift:w.coordinateShift},l=Ve(e,r,b,n)}}}let m,g,x;return p?(m=Ks(c,p,2),f&&d?(g=Xc(c,m,f,!1),x=y6(c,m,g,d)):f&&(g=d6(c,m,f))):f&&d?(g=Ks(c,f,1),x=Xc(c,g,d,!0)):f&&(g=Ks(c,f,0)),h&&!g?Yc(c,y,h,l):h?Yc(c,y,h,l,{geometryOffsets:m,partOffsets:g,ringOffsets:x}):u===void 0?Ly(c,{geometryOffsets:m,partOffsets:g,ringOffsets:x},o,l):h6(c,{geometryOffsets:m,partOffsets:g,ringOffsets:x},o,l,u)}function Ks(e,t,r){let i=new Uint32Array(e.length+1),n=0;i[0]=n;let a=0;for(let s=0;s<e.length;s++)n=i[s+1]=n+(e[s]>r?t[a++]:1);return i}function Xc(e,t,r,i){let n=new Uint32Array(t[t.length-1]+1),a=0;n[0]=a;let s=1,o=0;for(let l=0;l<e.length;l++){let u=e[l],h=t[l+1]-t[l];if(u===5||u===2||i&&(u===4||u===1))for(let c=0;c<h;c++)a=n[s++]=a+r[o++];else for(let c=0;c<h;c++)n[s++]=++a}return n}function d6(e,t,r){let i=new Uint32Array(t[t.length-1]+1),n=0;i[0]=n;let a=1,s=0;for(let o=0;o<e.length;o++){let l=e[o],u=t[o+1]-t[o];if(l===4||l===1)for(let h=0;h<u;h++)n=i[a++]=n+r[s++];else for(let h=0;h<u;h++)i[a++]=++n}return i}function y6(e,t,r,i){let n=new Uint32Array(r[r.length-1]+1),a=0;n[0]=a;let s=1,o=1,l=0;for(let u=0;u<e.length;u++){let h=e[u],c=t[u+1]-t[u];if(h!==0&&h!==3)for(let p=0;p<c;p++){let f=r[s]-r[s-1];s++;for(let d=0;d<f;d++)a=n[o++]=a+i[l++]}else for(let p=0;p<c;p++)n[o++]=++a,s++}return n}var m6=class extends wr{constructor(e,t,r){super(e,t.getBuffer(),r),this.dataVector=t}getValueFromBuffer(e){return this.dataVector.get(e)}},g6=class extends es{getValueFromBuffer(e){return this.dataBuffer[e]}},Ry=class extends wr{constructor(e,t,r,i){super(e,i?BigInt64Array.of(t):BigUint64Array.of(t),r)}getValueFromBuffer(e){return this.dataBuffer[0]}},Eu=class extends wr{constructor(e,t,r,i){super(e,r,i),this.offsetBuffer=t}},Zc=class extends Eu{constructor(e,t,r,i){super(e,t,r,i??t.length-1)}getValueFromBuffer(e){let t=this.offsetBuffer[e],r=this.offsetBuffer[e+1];return _u(this.dataBuffer,t,r)}},Xr=class extends Eu{constructor(e,t,r,i,n){super(e,r,i,n??t.length),this.indexBuffer=t,this.indexBuffer=t}getValueFromBuffer(e){let t=this.indexBuffer[e],r=this.offsetBuffer[t],i=this.offsetBuffer[t+1];return _u(this.dataBuffer,r,i)}};function x6(e,t){let r=0;for(let i=0;i<t.length;i++){let n=t[i];n===255?(r++,i++):r+=e[n]}return r}function v6(e,t,r){let i=new Uint32Array(t.length);for(let s=1;s<t.length;s++)i[s]=i[s-1]+t[s-1];let n=new Uint8Array(x6(t,r)),a=0;for(let s=0;s<r.length;s++){let o=r[s];if(o===255)s++,n[a++]=r[s];else{let l=t[o],u=i[o];for(;l-- >0;)n[a++]=e[u++]}}return n}var $y=class extends Eu{constructor(e,t,r,i,n,a,s,o){super(e,r,i,s??t.length),this.indexBuffer=t,this.symbolOffsetBuffer=n,this.symbolTableBuffer=a,this.sharedDictionaryCache=o}getValueFromBuffer(e){this.decodedDictionary??(this.decodedDictionary=this.sharedDictionaryCache?.decodedDictionary,this.decodedDictionary??(this.decodedDictionary=this.decodeDictionary(),this.sharedDictionaryCache&&(this.sharedDictionaryCache.decodedDictionary=this.decodedDictionary)));let t=this.indexBuffer[e],r=this.offsetBuffer[t],i=this.offsetBuffer[t+1];return _u(this.decodedDictionary,r,i)}decodeDictionary(){return this.symbolLengthBuffer??=this.offsetToLengthBuffer(this.symbolOffsetBuffer),v6(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(e){let t=new Uint32Array(e.length-1),r=e[0];for(let i=1;i<e.length;i++){let n=e[i];t[i-1]=n-r,r=n}return t}};function Ny(e,t,r,i,n){let a,s,o,l,u,h=n,c,p;for(let f=0;f<i;f++){let d=pe(t,r);switch(d.physicalStreamType){case Fe.PRESENT:{let y=new ft(ui(t,d.numValues,d.byteLength,r),d.numValues);h=n??y;break}case Fe.OFFSET:s=Ve(t,r,d,void 0,h);break;case Fe.LENGTH:{let y=Xt(t,r,d);Ce.DICTIONARY===d.logicalStreamType.lengthType?a=y:Ce.SYMBOL===d.logicalStreamType.lengthType?l=y:c=y;break}case Fe.DATA:{let y=t.subarray(r.get(),r.get()+d.byteLength);r.add(d.byteLength);let m=d.logicalStreamType.dictionaryType;je.FSST===m?u=y:je.SINGLE===m||je.SHARED===m?o=y:je.NONE===m&&(p=y);break}}}return b6(e,u,s,a,o,l,h)??w6(e,o,s,a,h)??_6(e,c,p,s,h)}function b6(e,t,r,i,n,a,s){if(t){if(!r||!i||!n||!a)throw Error(`Incomplete FSST dictionary string column "${e}"`);return new $y(e,r,i,n,a,t,s)}}function w6(e,t,r,i,n){if(t){if(!r||!i)throw Error(`Incomplete dictionary string column "${e}"`);return n?new Xr(e,r,i,t,n):new Xr(e,r,i,t)}}function _6(e,t,r,i,n){if(t&&r){if(i)return n?new Xr(e,i,t,r,n):new Xr(e,i,t,r);if(n&&n.size()!==t.length-1){let a=new Uint32Array(n.size()),s=0;for(let o=0;o<n.size();o++)n.get(o)?a[o]=s++:a[o]=0;return new Xr(e,a,t,r,n)}return n?new Zc(e,t,r,n):new Zc(e,t,r)}}function D6(e,t,r,i){let n,a,s,o,l=!1;for(;!l;){let f=pe(e,t);switch(f.physicalStreamType){case Fe.LENGTH:Ce.DICTIONARY===f.logicalStreamType.lengthType?n=Xt(e,t,f):s=Xt(e,t,f);break;case Fe.DATA:je.SINGLE===f.logicalStreamType.dictionaryType||je.SHARED===f.logicalStreamType.dictionaryType?(a=e.subarray(t.get(),t.get()+f.byteLength),l=!0):o=e.subarray(t.get(),t.get()+f.byteLength),t.add(f.byteLength)}}if(r.type!=="complexType")throw Error(`Shared dictionary column ${r.name} must be a complex (struct) column.`);if(!n||!a)throw Error(`Incomplete shared dictionary for column "${r.name}"`);let u=r.complexType.children,h=[],c=o?{}:void 0,p=0;for(let f of u){let d=$e(e,t,1)[0];if(d===0)continue;let y=f.name?`${r.name}${f.name}`:r.name;if(i&&!i.has(y)){Dy(d,e,t);continue}if(f.type!=="scalarField"||f.scalarField.physicalType!==te.STRING)throw Error("Currently only scalar string fields are implemented for a struct.");if(d>1&&!f.nullable||d===1&&f.nullable)throw Error(`The number of streams for the child field ${f.name} does not match its nullability. nullibilty: ${f.nullable}, numStreams: ${d}`);let m;if(f.nullable){let x=pe(e,t);m=new ft(ui(e,x.numValues,x.byteLength,t),x.numValues)}let g=Ve(e,t,pe(e,t),void 0,m);if(o){if(!s)throw Error(`Incomplete shared FSST dictionary for column "${y}"`);h[p++]=new $y(y,g,n,a,s,o,m,c)}else h[p++]=new Xr(y,g,n,a,m)}return h}var Wc=class extends wr{constructor(e,t,r){super(e,new Uint8Array,r??t.length),this.values=t}getValueFromBuffer(e){return this.values[e]}},Bt;(function(e){e[e.STRING=1]="STRING",e[e.INT32=2]="INT32",e[e.UINT32=4]="UINT32",e[e.INT64=8]="INT64",e[e.UINT64=16]="UINT64",e[e.FLOAT=32]="FLOAT",e[e.DOUBLE=64]="DOUBLE",e[e.PRESENCE=128]="PRESENCE"})(Bt||={});var hr;(function(e){e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e[e.START_MAP=2]="START_MAP",e[e.START_LIST=3]="START_LIST",e[e.COUNT=4]="COUNT"})(hr||={});function S6(e,t,r,i){let n=A6(r);if(i===0)return n.map(h=>new Wc(h,[]));let a=E6(e,t,i),s=(a.presentStream?a.presentCount:a.lengthStream.length)/n.length,o=[],l=0,u=0;for(let h=0;h<n.length;h++){let c=C6(a,h,s,l,u);o.push(new Wc(n[h],c.value,c.nullabilityBuffer)),l=c.countsEnd,u=c.valuesEnd}return o}function A6(e){let t=e.type==="complexType"?e.complexType.children:void 0;return!t||t.length===0?[e.name]:t.map(r=>e.name+(r.name??""))}function E6(e,t,r){let i=e[t.get()];t.add(1);let n=Ve(e,t,pe(e,t)),a=r-1,s=[];i&Bt.STRING&&(a-=F6(e,t,s)),a-=I6(e,t,i,s),a-=k6(e,t,i,s);let o,l=0;if(i&Bt.PRESENCE){let h=T6(e,t);o=h.value,l=h.count,a--}let u=new Uint32Array;if(a>0&&(u=Ve(e,t,pe(e,t)),a--),a!==0)throw Error(`Unexpected number of remaining streams while decoding map column: ${a}`);return{lengthStream:n,dictionary:s,presentStream:o,presentCount:l,flattenedValues:u}}function F6(e,t,r){let i=e[t.get()];t.add(1);let n=Ny("",e,t,i);if(n)for(let a=0;a<n.size;a++)r.push(n.getValue(a));return i}function I6(e,t,r,i){let n=0;return r&Bt.INT32?(Ur(i,Pa(e,t,pe(e,t))),n++):r&Bt.INT64&&(Ur(i,Iy(e,t,pe(e,t))),n++),r&Bt.UINT32?(Ur(i,Ve(e,t,pe(e,t))),n++):r&Bt.UINT64&&(Ur(i,Su(e,t,pe(e,t))),n++),n}function k6(e,t,r,i){let n=0;return r&Bt.FLOAT&&(Ur(i,Sy(e,t,pe(e,t).numValues)),n++),r&Bt.DOUBLE&&(Ur(i,Ay(e,t,pe(e,t).numValues)),n++),n}function T6(e,t){let r=pe(e,t);if(r.physicalStreamType!==Fe.PRESENT)throw Error(`Expected PRESENT stream for map column but found: ${r.physicalStreamType}`);let i=r.numValues,n=t.get(),a=new ft(ui(e,i,r.byteLength,t),i);return t.set(n+r.byteLength),{value:a,count:i}}function C6(e,t,r,i,n){let{lengthStream:a,flattenedValues:s,presentStream:o,dictionary:l}=e,u=t*r,h=r,c;if(o){c=new ft(new Uint8Array(Math.ceil(r/8)),r),h=0;for(let x=0;x<r;x++)o.get(u+x)&&(c.set(x,!0),h++)}let p=i+h;if(p>a.length)throw Error("Merged map counts underflow while decoding child streams");let f=Array(r),d=i,y=n;for(let x=0;x<r;x++){if(o&&!o.get(u+x)){f[x]=null;continue}let v=y+a[d++];if(v>s.length)throw Error("Map value stream underflow while decoding feature payload");let b=M6(s,y,v,l);f[x]=b.value,y=b.nextIndex}let m=0;for(let x=i;x<p;x++)m+=a[x];let g=n+m;if(y!==g)throw Error("Unused flattened map values remain after decode");return{value:f,nullabilityBuffer:c,countsEnd:p,valuesEnd:g}}function M6(e,t,r,i){return r-t===1||e[t]===hr.START_LIST?Fu(e,t,r,i):Uy(e,t,r,i)}function Uy(e,t,r,i){let n=Object.create(null),a=t;for(;a<r;){let s=jy(e[a++],i);if(typeof s!="string")throw Error(`Map key dictionary index does not resolve to a string: ${s}`);let o=Fu(e,a,r,i);n[s]=o.value,a=o.nextIndex}return{value:n,nextIndex:a}}function Fu(e,t,r,i){if(t>=r)throw Error("Unexpected end of map value stream");let n=e[t];if(n===hr.FALSE)return{value:!1,nextIndex:t+1};if(n===hr.TRUE)return{value:!0,nextIndex:t+1};if(n===hr.START_MAP){let a=Hc(e,t,r);return{value:Uy(e,t+2,a,i).value,nextIndex:a}}if(n===hr.START_LIST){let a=Hc(e,t,r),s=[],o=t+2;for(;o<a;){let l=Fu(e,o,a,i);s.push(l.value),o=l.nextIndex}return{value:s,nextIndex:a}}return{value:jy(n,i),nextIndex:t+1}}function Hc(e,t,r){if(t+1>=r)throw Error("Missing length for nested map/list payload");let i=e[t+1];if(i<2)throw Error(`Invalid nested payload length: ${i}`);let n=t+i;if(n>r)throw Error("Nested payload exceeds containing payload bounds");return n}function jy(e,t){let r=e-hr.COUNT;if(r<0||r>=t.length)throw Error(`Scalar dictionary index out of range: ${e}`);return t[r]}function Ur(e,t){for(let r of t)e.push(r)}function P6(e,t,r,i,n,a){return r.type==="scalarType"?a&&!a.has(r.name)?(Dy(i,e,t),null):B6(i,e,t,n,r.scalarType,r):r.complexType?.physicalType===Jt.MAP?S6(e,t,r,i):i===0?null:D6(e,t,r,a)}function B6(e,t,r,i,n,a){let s;if(e===0)return null;if(a.nullable){let l=pe(t,r),u=l.numValues,h=r.get(),c=ui(t,u,l.byteLength,r);r.set(h+l.byteLength),s=new ft(c,l.numValues)}let o=s??i;switch(n.physicalType){case te.UINT_32:case te.INT_32:return R6(t,r,a,n,o);case te.STRING:{let l=a.nullable?e-1:e;return Ny(a.name,t,r,l,s)??null}case te.BOOLEAN:return z6(t,r,a,i,o);case te.UINT_64:case te.INT_64:return O6(t,r,a,o,n);case te.FLOAT:return L6(t,r,a,o);case te.DOUBLE:return V6(t,r,a,o);default:throw Error(`The specified data type for the field is currently not supported: ${n}`)}}function z6(e,t,r,i,n){let a=pe(e,t),s=a.numValues,o=t.get(),l=Sn(n)?n:void 0,u=ui(e,s,a.byteLength,t,l);t.set(o+a.byteLength);let h=new ft(u,s);return new m6(r.name,h,n)}function L6(e,t,r,i){let n=pe(e,t),a=Sn(i)?i:void 0,s=Sy(e,t,n.numValues,a);return new g6(r.name,s,i)}function V6(e,t,r,i){let n=pe(e,t),a=Sn(i)?i:void 0,s=Ay(e,t,n.numValues,a);return new du(r.name,s,i)}function O6(e,t,r,i,n){let a=pe(e,t),s=ts(a,i,e,t,"int64"),o=n.physicalType===te.INT_64;if(s===ce.FLAT){let u=Sn(i)?i:void 0,h=o?Iy(e,t,a,u):Su(e,t,a,u);return new My(r.name,h,i)}if(s===ce.SEQUENCE){let u=Fy(e,t,a);return new Py(r.name,u[0],u[1],a.numRleValues,o)}let l=o?J3(e,t,a):ky(e,t,a);return new Ry(r.name,l,i,o)}function R6(e,t,r,i,n){let a=pe(e,t),s=ts(a,n,e,t),o=i.physicalType===te.INT_32;if(s===ce.FLAT){let u=Sn(n)?n:void 0,h=o?Pa(e,t,a,void 0,u):Ve(e,t,a,void 0,u);return new fu(r.name,h,n)}if(s===ce.SEQUENCE){let u=Ey(e,t,a);return new yu(r.name,u[0],u[1],a.numRleValues,o)}let l=o?Z3(e,t,a):Du(e,t,a);return new mu(r.name,l,n,o)}function Sn(e){return e instanceof ft}var Te={ID:0,ID_NULLABLE:1,ID_LONG:2,GEOMETRY:4,SCALAR_BASE:10,STRUCT:30,MAP:31};function qy(e){switch(e){case Te.ID:case Te.ID|Te.ID_NULLABLE:case Te.ID|Te.ID_LONG:case Te.ID|Te.ID_LONG|Te.ID_NULLABLE:return{nullable:(e&Te.ID_NULLABLE)!==0,columnScope:Ri.FEATURE,type:"scalarType",scalarType:{longID:(e&Te.ID_LONG)!==0,type:"logicalType",logicalType:gy.ID}};case Te.GEOMETRY:return{nullable:!1,columnScope:Ri.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Jt.GEOMETRY,children:[]}};case Te.STRUCT:return{nullable:!1,columnScope:Ri.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Jt.STRUCT,children:[]}};case Te.MAP:return{nullable:!0,columnScope:Ri.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Jt.MAP,children:[]}};default:return q6(e)}}function $6(e){return e>=Te.SCALAR_BASE}function Gy(e){return e===Te.STRUCT||e===Te.MAP}function N6(e){if(e.type==="scalarType"){let t=e.scalarType;if(t.type==="physicalType")switch(t.physicalType){case te.BOOLEAN:case te.INT_8:case te.UINT_8:case te.INT_32:case te.UINT_32:case te.INT_64:case te.UINT_64:case te.FLOAT:case te.DOUBLE:return!1;case te.STRING:return!0;default:return!1}if(t.type==="logicalType")return!1}else if(e.type==="complexType"){let t=e.complexType;if(t.type==="physicalType")switch(t.physicalType){case Jt.GEOMETRY:case Jt.STRUCT:case Jt.MAP:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",e),!1}function U6(e){return e.type==="scalarType"&&e.scalarType?.type==="logicalType"&&e.scalarType.logicalType===gy.ID}function j6(e){return e.type==="complexType"&&e.complexType?.type==="physicalType"&&e.complexType.physicalType===Jt.GEOMETRY}function q6(e){let t;switch(e){case 10:case 11:t=te.BOOLEAN;break;case 12:case 13:t=te.INT_8;break;case 14:case 15:t=te.UINT_8;break;case 16:case 17:t=te.INT_32;break;case 18:case 19:t=te.UINT_32;break;case 20:case 21:t=te.INT_64;break;case 22:case 23:t=te.UINT_64;break;case 24:case 25:t=te.FLOAT;break;case 26:case 27:t=te.DOUBLE;break;case 28:case 29:t=te.STRING;break;default:return null}return{nullable:!!(e&1),columnScope:Ri.FEATURE,type:"scalarType",scalarType:{longID:!1,type:"physicalType",physicalType:t}}}var G6=new TextDecoder,Jc="0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)";function Iu(e,t){let r=$e(e,t,1)[0];if(r===0)return"";let i=t.get(),n=i+r,a=e.subarray(i,n);return t.add(r),G6.decode(a)}function Y6(e){let t=e.name,r=e.nullable;return e.type==="scalarType"?{type:"scalarField",scalarField:e.scalarType,name:t,nullable:r}:{type:"complexField",complexField:e.complexType,name:t,nullable:r}}function Yy(e,t){let r=$e(e,t,1)[0]>>>0,i=r>=Te.SCALAR_BASE?qy(r):null;if(!i)throw Error(`Unsupported field type code ${r}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let n={...i,name:Iu(e,t)};if(n.type==="complexType"&&Gy(r)){let a=n.complexType,s=$e(e,t,1)[0]>>>0;a.children=Array(s);for(let o=0;o<s;o++)a.children[o]=Yy(e,t)}return Y6(n)}function X6(e,t){let r=$e(e,t,1)[0]>>>0,i=qy(r);if(!i)throw Error(`Unsupported column type code ${r}. Supported: ${Jc}`);let n;if($6(r))n=Iu(e,t);else if(r<Te.GEOMETRY)n="id";else if(r===Te.GEOMETRY)n="geometry";else throw Error(`Unsupported column type code ${r}. Supported: ${Jc}`);let a={...i,name:n};if(a.type==="complexType"&&Gy(r)){let s=$e(e,t,1)[0]>>>0,o=a.complexType;o.children=Array(s);for(let l=0;l<s;l++)o.children[l]=Yy(e,t)}return a}function Z6(e,t){let r={};r.featureTables=[];let i={};if(i.name=Iu(e,t),i.name.length===0)throw Error("Missing layer name");let n=$e(e,t,1)[0]>>>0,a=$e(e,t,1)[0]>>>0;i.columns=Array(a);for(let s=0;s<a;s++)i.columns[s]=X6(e,t);return r.featureTables.push(i),[r,n]}function W6(e,t,r=!0){let i=new xy(0),n=[];for(;i.get()<e.length;){let a=$e(e,i,1)[0]>>>0,s=i.get()+a;if(s>e.length)throw Error(`Block overruns tile: ${s} > ${e.length}`);let o=$e(e,i,1)[0]>>>0;if(o!==1&&o!==2){i.set(s);continue}let[l,u]=Z6(e,i),h=l.featureTables[0],c=null,p=null,f=[],d=0;for(let m of h.columns){let g=m.name;if(U6(m)){let x=null;if(m.nullable){let b=pe(e,i),w=i.get(),S=ui(e,b.numValues,b.byteLength,i);i.set(w+b.byteLength),x=new ft(S,b.numValues)}let v=pe(e,i);d=x?x.size():v.decompressedCount,c=H6(e,m,i,g,v,x??d,r)}else if(j6(m)){let x=$e(e,i,1)[0];if(d===0){let v=i.get();d=pe(e,i).decompressedCount,i.set(v)}t&&(t.scale=t.extent/u),p=f6(e,x,i,d,t)}else{let x=N6(m)?$e(e,i,1)[0]:1;if(x===0)continue;let v=P6(e,i,m,x,d,void 0);if(v)if(Array.isArray(v))for(let b of v)f.push(b);else f.push(v)}}let y=new vw(h.name,p,c,f,u);n.push(y),i.set(s)}return n}function H6(e,t,r,i,n,a,s=!1){let o=t.scalarType?.longID?te.UINT_64:te.UINT_32,l=typeof a=="number"?void 0:a,u=ts(n,a,e,r,o===te.UINT_64?"int64":"int32");if(o===te.UINT_32)switch(u){case ce.FLAT:return new fu(i,Ve(e,r,n,void 0,l),a);case ce.SEQUENCE:{let h=Ey(e,r,n);return new yu(i,h[0],h[1],n.numRleValues,!1)}case ce.CONST:return new mu(i,Du(e,r,n),a,!1)}switch(u){case ce.FLAT:return s?new du(i,W3(e,r,n,l),a):new My(i,Su(e,r,n,l),a);case ce.SEQUENCE:{let h=Fy(e,r,n);return new Py(i,h[0],h[1],n.numRleValues,!1)}case ce.CONST:return new Ry(i,ky(e,r,n),a,!1)}throw Error("Vector type not supported for id column.")}var Qs=vy(xu);Qs/32*4,3*Qs/256+Qs|0;var J6=class{constructor(e,t){switch(this._featureData=e,this.properties=this._featureData.properties||{},this._featureData.geometry?.type){case Re.POINT:case Re.MULTIPOINT:this.type=1;break;case Re.LINESTRING:case Re.MULTILINESTRING:this.type=2;break;case Re.POLYGON:case Re.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=t,this.id=Number(this._featureData.id)}loadGeometry(){let e=[];for(let t of this._featureData.geometry.coordinates){let r=[];for(let i of t)r.push(new B(i.x,i.y));e.push(r)}return e}},K6=class{constructor(e){this.features=[],this.featureTable=e,this.name=e.name,this.extent=e.extent,this.version=2,this.features=e.getFeatures(),this.length=this.features.length}feature(e){return new J6(this.features[e],this.extent)}},Xy=class{constructor(e){this.layers={};let t=W6(new Uint8Array(e));this.layers=t.reduce((r,i)=>({...r,[i.name]:new K6(i)}),{})}},Zy=class{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new to(be,16,0),this.grid3D=new to(be,16,0),this.featureIndexArray=new Uf,this.promoteId=t}insert(e,t,r,i,n,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let o=a?this.grid3D:this.grid;for(let l of t){let u=[1/0,1/0,-1/0,-1/0];for(let h of l)u[0]=Math.min(u[0],h.x),u[1]=Math.min(u[1],h.y),u[2]=Math.max(u[2],h.x),u[3]=Math.max(u[3],h.y);u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&o.insert(s,u[0],u[1],u[2],u[3])}}loadVTLayers(){return this.vtLayers||(this.encoding==="mlt"?this.vtLayers=new Xy(this.rawTileData).layers:this.vtLayers=new fd(new jd(this.rawTileData)).layers,this.sourceLayerCoder=new yy(this.vtLayers?Object.keys(this.vtLayers).sort():[fl])),this.vtLayers}query(e,t,r,i){this.loadVTLayers();let n=e.params,a=be/e.tileSize/e.scale,s=Qi(n.filter,"queryRenderedFeatures filter",n.globalState),o=e.queryGeometry,l=e.queryPadding*a,u=Aa.fromPoints(o),h=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),c=Aa.fromPoints(e.cameraQueryGeometry).expandBy(l),p=this.grid3D.query(c.minX,c.minY,c.maxX,c.maxY,(y,m,g,x)=>gg(e.cameraQueryGeometry,y-l,m-l,g+l,x+l));for(let y of p)h.push(y);h.sort(e5);let f={},d;for(let y of h){if(y===d)continue;d=y;let m=this.featureIndexArray.get(y),g=null;this.loadMatchingFeature(f,m.bucketIndex,m.sourceLayerIndex,m.featureIndex,s,n.layers,n.availableImages,t,r,e.transform.worldCoordinateHelper,i,(x,v,b)=>(g||=br(x),v.queryIntersectsFeature({queryGeometry:o,feature:x,featureState:b,geometry:g,zoom:this.z,transform:e.transform,pixelsToTileUnits:a,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation})))}return f}loadMatchingFeature(e,t,r,i,n,a,s,o,l,u,h,c){let p=this.bucketLayerIDs[t];if(a&&!p.some(m=>a.has(m)))return;let f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(i);if(n.needGeometry){let m=li(d,!0);if(!n.filter(new le(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!n.filter(new le(this.tileID.overscaledZ),d))return;let y=this.getId(d,f);for(let m of p){if(a&&!a.has(m))continue;let g=o[m];if(!g)continue;let x={};y&&h&&(x=h.getState(g.sourceLayer||"_geojsonTileLayer",y));let v=Xe({},l[m]);v.paint=Kc(v.paint,g.paint,d,x,s),v.layout=Kc(v.layout,g.layout,d,x,s);let b=!c||c(d,g,x);if(!b)continue;let w=new xw(d,this.z,this.x,this.y,y,u);w.layer=v;let S=e[m];S===void 0&&(S=e[m]=[]),S.push({featureIndex:i,feature:w,intersectionZ:b})}}lookupSymbolFeatures(e,t,r,i,n,a,s,o){let l={};this.loadVTLayers();let u=Qi(n.filterSpec,"queryRenderedFeatures symbol filter",n.globalState);for(let h of e)this.loadMatchingFeature(l,r,i,h,u,a,s,o,t,n.worldCoordinateHelper);return l}hasLayer(e){for(let t of this.bucketLayerIDs)for(let r of t)if(e===r)return!0;return!1}getId(e,t){let r=e.id;if(this.promoteId){let i=typeof this.promoteId=="string"?this.promoteId:this.promoteId[t];r=e.properties[i],typeof r=="boolean"&&(r=Number(r)),r===void 0&&e.properties?.cluster&&this.promoteId&&(r=Number(e.properties.cluster_id))}return r}};P("FeatureIndex",Zy,{omit:["rawTileData","sourceLayerCoder"]});function Q6(e){return typeof e=="object"&&!!e&&"evaluate"in e}function Kc(e,t,r,i,n){return da(e,(a,s)=>{let o=t instanceof Xa?t.get(s):null;return Q6(o)?o.evaluate(r,i,void 0,n):o})}function e5(e,t){return t-e}var t5=class{constructor(e,t){this.keyCache={},e&&this.replace(e,t)}replace(e,t){this._layerConfigs={},this._layers={},this.update(e,[],t)}update(e,t,r){for(let n of e){this._layerConfigs[n.id]=n;let a=this._layers[n.id]=uw(n,r);a._featureFilter=Qi(a.filter,`layers[${n.id}].filter`,r),this.keyCache[n.id]&&delete this.keyCache[n.id]}for(let n of t)delete this.keyCache[n],delete this._layerConfigs[n],delete this._layers[n];this.familiesBySource={};let i=l0(Object.values(this._layerConfigs),this.keyCache);for(let n of i){let a=n.map(c=>this._layers[c.id]),s=a[0];if(s.isHidden())continue;let o=s.source||"",l=this.familiesBySource[o];l||=this.familiesBySource[o]={};let u=s.sourceLayer||"_geojsonTileLayer",h=l[u];h||=l[u]=[],h.push(a)}}},Wy=class{constructor(e){let t={},r=[];for(let s in e){let o=t[s]={};for(let l in e[s]){let u=e[s][l];o[l]={};for(let h in u){let c=u[h];if(!c||c.bitmap.width===0||c.bitmap.height===0)continue;let p={x:0,y:0,w:c.bitmap.width+2,h:c.bitmap.height+2};r.push(p),o[l][h]={rect:p,metrics:c.metrics}}}}let{w:i,h:n}=qd(r),a=new Uo({width:i||1,height:n||1});for(let s in e)for(let o in e[s]){let l=e[s][o];for(let u in l){let h=l[u];if(!h||h.bitmap.width===0||h.bitmap.height===0)continue;let c=t[s][o][u].rect;Uo.copy(h.bitmap,a,{x:0,y:0},{x:c.x+1,y:c.y+1},h.bitmap)}}this.image=a,this.positions=t}};P("GlyphAtlas",Wy);function r5(e,t,r){return!(e<0||e>25||r<0||r>=2**e||t<0||t>=2**e)}var Hy=class{constructor(e,t,r){if(!r5(e,t,r))throw Error(`x=${t}, y=${r}, z=${e} outside of bounds. 0<=x<${2**e}, 0<=y<${2**e} 0<=z<=25 `);this.z=e,this.x=t,this.y=r,this.key=Yi(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,r,i=Ko){let n=n5(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(r==="tms"?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,t>1?"@2x":"").replace(/{quadkey}/g,n).replace(/{bbox-epsg-3857}/g,()=>Qc(this.x,this.y,this.z,Ko)).replace(/{bbox}/g,()=>Qc(this.x,this.y,this.z,i))}isChildOf(e){let t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){let t=2**this.z;return new B((e.x*t-this.x)*be,(e.y*t-this.y)*be)}toString(){return`${this.z}/${this.x}/${this.y}`}},i5=class{constructor(e,t){this.wrap=e,this.canonical=t,this.key=Yi(e,t.z,t.z,t.x,t.y)}},Jy=class at{constructor(t,r,i,n,a){if(this.terrainRttPosMatrix32f=null,t<i)throw Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${i}`);this.overscaledZ=t,this.wrap=r,this.canonical=new Hy(i,+n,+a),this.key=Yi(r,t,i,n,a)}clone(){return new at(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-t;return t>this.canonical.z?new at(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new at(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(t,r){if(t>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-t;return t>this.canonical.z?Yi(this.wrap*+r,t,this.canonical.z,this.canonical.x,this.canonical.y):Yi(this.wrap*+r,t,t,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(t){if(t.wrap!==this.wrap||this.overscaledZ-t.overscaledZ<=0)return!1;if(t.overscaledZ===0)return this.overscaledZ>0;let r=this.canonical.z-t.canonical.z;return r<0?!1:t.canonical.x===this.canonical.x>>r&&t.canonical.y===this.canonical.y>>r}children(t){if(this.overscaledZ>=t)return[new at(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=this.canonical.x*2,n=this.canonical.y*2;return[new at(r,this.wrap,r,i,n),new at(r,this.wrap,r,i+1,n),new at(r,this.wrap,r,i,n+1),new at(r,this.wrap,r,i+1,n+1)]}isLessThan(t){return this.wrap<t.wrap?!0:this.wrap>t.wrap?!1:this.overscaledZ<t.overscaledZ?!0:this.overscaledZ>t.overscaledZ?!1:this.canonical.x<t.canonical.x?!0:this.canonical.x>t.canonical.x?!1:this.canonical.y<t.canonical.y}wrapped(){return new at(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new at(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return 2**(this.overscaledZ-this.canonical.z)}toUnwrapped(){return new i5(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new wn(t.x-this.wrap,t.y))}normalizeCoordinates(t,r,i=be){if(t>=0&&t<i&&r>=0&&r<i)return{tileID:this,x:t,y:r};let n=Math.floor(t/i),a=Math.floor(r/i),s=t-n*i,o=r-a*i,l=this.canonical.z,u=1<<l,h=this.canonical.y+a;if(h<0||h>=u)return null;let c=this.canonical.x+n,p=this.wrap;return c<0?(p-=Math.ceil(-c/u),c=(c%u+u)%u):c>=u&&(p+=Math.floor(c/u),c%=u),{tileID:new at(this.overscaledZ,p,l,c,h),x:s,y:o}}};function Yi(e,t,r,i,n){e*=2,e<0&&(e=e*-1-1);let a=1<<r;return(a*a*e+a*n+i).toString(36)+r.toString(36)+t.toString(36)}function Qc(e,t,r,i){let n=2**r,a=i.extentAtZoom0/n,[s,o]=i.origin,l=o-i.extentAtZoom0,u=n-t-1;return`${s+e*a},${l+u*a},${s+(e+1)*a},${l+(u+1)*a}`}function n5(e,t,r){let i="";for(let n=e;n>0;n--){let a=1<<n-1;i+=(t&a?1:0)+(r&a?2:0)}return i}P("CanonicalTileID",Hy),P("OverscaledTileID",Jy,{omit:["terrainRttPosMatrix32f"]});var Ky=class{constructor(e){this.tileID=new Jy(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[]}async parse(e,t,r,i,n){this.data=e,this.collisionBoxArray=new Mf;let a=new yy(Object.keys(e.layers).sort()),s=new Zy(this.tileID,this.promoteId);s.bucketLayerIDs=[];let o={},l={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:r,subdivisionGranularity:n},u=t.familiesBySource[this.source];for(let A in u){let E=e.layers[A];if(!E)continue;E.version===1&&Pe(`Vector tile source "${this.source}" layer "${A}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let V=a.encode(A),M=[];for(let O=0;O<E.length;O++){let R=E.feature(O),T=s.getId(R,A);M.push({feature:R,id:T,index:O,sourceLayerIndex:V})}for(let O of u[A]){let R=O[0];R.source!==this.source&&Pe(`layer.source = ${R.source} does not equal this.source = ${this.source}`),R.isHidden(this.zoom,!0)||(ep(O,this.zoom,r),(o[R.id]=R.createBucket({index:s.bucketLayerIDs.length,layers:O,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:V,sourceID:this.source})).populate(M,l,this.tileID.canonical),s.bucketLayerIDs.push(O.map(T=>T.id)))}}let h=da(l.glyphDependencies,A=>da(A,E=>Object.keys(E)));for(let A of this.inFlightDependencies)A?.abort();this.inFlightDependencies=[];let c=Promise.resolve({});if(Object.keys(h).length){let A=new AbortController;this.inFlightDependencies.push(A),c=i.sendAsync({type:"GG",data:{stacks:h,source:this.source,tileID:this.tileID,type:"glyphs"}},A)}let p=Object.keys(l.iconDependencies),f=Promise.resolve({});if(p.length){let A=new AbortController;this.inFlightDependencies.push(A),f=i.sendAsync({type:"GI",data:{icons:p,source:this.source,tileID:this.tileID,type:"icons"}},A)}let d=Object.keys(l.patternDependencies),y=Promise.resolve({});if(d.length){let A=new AbortController;this.inFlightDependencies.push(A),y=i.sendAsync({type:"GI",data:{icons:d,source:this.source,tileID:this.tileID,type:"patterns"}},A)}let m=l.dashDependencies,g=Promise.resolve({});if(Object.keys(m).length){let A=new AbortController;this.inFlightDependencies.push(A),g=i.sendAsync({type:"GDA",data:{dashes:m}},A)}let[x,v,b,w]=await Promise.all([c,f,y,g]),S=new Wy(x),D=new Yd(v,b);for(let A in o){let E=o[A];E.hasDependencies&&(ep(E.layers,this.zoom,r),E.addFeatures({options:l,canonical:this.tileID.canonical,glyphMap:x,glyphPositions:S.positions,iconMap:v,iconPositions:D.iconPositions,patternMap:b,patternPositions:D.patternPositions,dashPositions:w,showCollisionBoxes:this.showCollisionBoxes}))}return{buckets:Object.values(o).filter(A=>!A.isEmpty()),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:S.image,imageAtlas:D,dashPositions:w,glyphMap:this.returnDependencies?x:null,iconMap:this.returnDependencies?v:null,glyphPositions:this.returnDependencies?S.positions:null}}};function ep(e,t,r){let i=new le(t);for(let n of e)n.recalculate(i,r)}var Qy=class{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(e,t){this.loading[e]=t}finishLoading(e){delete this.loading[e]}abort(e){let t=this.loading[e];t?.abort&&(t.abort.abort(),delete this.loading[e])}getParsing(e){return this.parsing[e]}setParsing(e,t){this.parsing[e]=t}removeParsing(e){delete this.parsing[e]}markLoaded(e,t){this.loaded[e]=t}getLoaded(e){let t=this.loaded[e];if(t)return t}removeLoaded(e){delete this.loaded[e]}clearLoaded(){this.loaded={}}},a5=class{constructor(e){this.maxEntries=e,this.map=new Map}get(e){let t=this.map.get(e);return t!==void 0&&(this.map.delete(e),this.map.set(e,t)),t}set(e,t){if(this.map.has(e))this.map.delete(e);else if(this.map.size>=this.maxEntries){let r=this.map.keys().next().value;this.map.delete(r)}this.map.set(e,t)}clear(){this.map.clear()}},e1=class{constructor(e){this.start=`${e}#start`,this.end=`${e}#end`,this.measure=e,performance.mark(this.start)}finish(){performance.mark(this.end);let e=performance.getEntriesByName(this.measure);return e.length===0&&(performance.measure(this.measure,this.start,this.end),e=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),e}},s5=class{constructor(e,t,r,i,n){this.type=e,this.properties=r||{},this.extent=n,this.pointsArray=t,this.id=i}loadGeometry(){return this.pointsArray.map(e=>e.map(t=>new B(t.x,t.y)))}},o5=class{constructor(e,t,r){this.version=2,this._myFeatures=e,this.name=t,this.length=e.length,this.extent=r}feature(e){return this._myFeatures[e]}},l5=class{constructor(){this.layers={}}addLayer(e){this.layers[e.name]=e}};function u5(e,t,r){let{extent:i}=e,n=2**(r.z-t.z),a=(r.x-t.x*n)*i,s=(r.y-t.y*n)*i,o=[];for(let l=0;l<e.length;l++){let u=e.feature(l),h=u.loadGeometry();for(let p of h)for(let f of p)f.x=f.x*n-a,f.y=f.y*n-s;let c=Math.max(128,Math.round(128*i/4096));h=Ab(h,u.type,-c,-c,i+c,i+c),h.length!==0&&o.push(new s5(u.type,h,u.properties,u.id,i))}return new o5(o,e.name,i)}var h5=class{constructor(e,t,r){this.actor=e,this.layerIndex=t,this.availableImages=r,this.tileState=new Qy,this.overzoomedTileResultCache=new a5(1e3)}loadVectorTile(e,t){try{return{vectorTile:e.encoding==="mlt"?new Xy(t):new fd(new jd(t)),rawData:t}}catch(r){let i=new Uint8Array(t),n=i[0]===31&&i[1]===139,a=`Unable to parse the tile at ${e.request.url}, `;throw a+=n?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${fa(r).message}`,Error(a)}}async loadTile(e){let{uid:t,overzoomParameters:r}=e;r&&(e.request=r.overzoomRequest);let i=this._startRequestTiming(e),n=new Ky(e);this.tileState.startLoading(t,n);let a=new AbortController;n.abort=a;try{let s=await L0(e.request,a),o=this.tileState.getLoaded(t);if(e.etag&&e.etag===s.etag&&o?.etag===s.etag)return this.tileState.finishLoading(t),this._getEtagUnmodifiedResult(s,i);let l=this.loadVectorTile(e,s.data);if(this.tileState.finishLoading(t),!l)return null;let{vectorTile:u,rawData:h}=l;r&&({vectorTile:u,rawData:h}=this._getOverzoomTile(e,u));let c=this._getExpiryData(s),p=this._finishRequestTiming(i);n.vectorTile=u,n.etag=s.etag,this.tileState.markLoaded(t,n);let f={rawData:h,cacheControl:c,resourceTiming:p};return this.tileState.setParsing(t,f),await this._parseWorkerTile(n,e)}catch(s){throw this.tileState.finishLoading(t),this.tileState.markLoaded(t,n),s}}_getEtagUnmodifiedResult(e,t){return Xe({etagUnmodified:!0},this._getExpiryData(e),this._finishRequestTiming(t))}async _parseWorkerTile(e,t){let r=this.tileState.getParsing(e.uid),i=await e.parse(e.vectorTile,this.layerIndex,this.availableImages,this.actor,t.subdivisionGranularity);if(r){let{rawData:n,cacheControl:a,resourceTiming:s}=r,o=t.overzoomParameters?"mvt":t.encoding;i=Xe({rawTileData:n.slice(0),encoding:o},i,a,s),this.tileState.removeParsing(e.uid)}else e.etag&&(i=Xe(i,{etag:e.etag}));return i}_getExpiryData({expires:e,cacheControl:t,etag:r}){let i={};return e&&(i.expires=e),t&&(i.cacheControl=t),r&&(i.etag=r),i}_startRequestTiming(e){if(e.request?.collectResourceTiming)return new e1(e.request.url)}_finishRequestTiming(e){let t=e?.finish();return t?{resourceTiming:JSON.parse(JSON.stringify(t))}:{}}_getOverzoomTile(e,t){let{tileID:r,overzoomParameters:i}=e,{maxZoomTileID:n}=i,a=`${n.key}_${r.key}_${e.request?.url}`,s=this.overzoomedTileResultCache.get(a);if(s)return s;let o=new l5;for(let u of Object.values(t.layers)){let h=u5(u,n,r.canonical);h.length>0&&o.addLayer(h)}let l={vectorTile:o,rawData:dy(o).buffer};return this.overzoomedTileResultCache.set(a,l),l}async reloadTile(e){let t=e.uid,r=this.tileState.getLoaded(t);if(!r)throw Error("Should not be trying to reload a tile that was never loaded or has been removed");if(r.vectorTile)return r.showCollisionBoxes=e.showCollisionBoxes,r.tileID=r.tileID.unwrapTo(e.tileID.wrap),await this._parseWorkerTile(r,e)}async abortTile(e){this.tileState.abort(e.uid)}async removeTile(e){this.tileState.removeLoaded(e.uid)}},c5=class{constructor(){this.loaded={}}async loadTile(e){let{uid:t,encoding:r,rawImageData:i,redFactor:n,greenFactor:a,blueFactor:s,baseShift:o}=e,l=i.width+4,u=i.height+4,h=new td(t,_l(i)?new Ke({width:l,height:u},await A1(i,-2,-2,l,u)):i,r,n,a,s,o);return this.loaded||={},this.loaded[t]=h,h}removeTile(e){let t=this.loaded,r=e.uid;t?.[r]&&delete t[r]}},tp=class{constructor(e){this.wraps=!1,this._crs=e,this._originX=e.tileMatrixSet.origin[0],this._originY=e.tileMatrixSet.origin[1],this._extent=e.tileMatrixSet.extentAtZoom0}get name(){return this._crs.name}get tileMatrixSet(){return this._crs.tileMatrixSet}worldFromLngLat(e,t,r){let[i,n]=this._crs.projection.forward([e,t]);return new wn((i-this._originX)/this._extent,(this._originY-n)/this._extent,r===void 0?0:r/this._extent)}lngLatFromWorld(e,t){let r=wt(e,0,1),i=wt(t,0,1),n=this._inverse(e,t)??this._inverse(r,i)??this._inverseTowardCenter(r,i)??this._finiteInverse(r,i);if(!n)throw Error(`The inverse of the projection "${this._crs.name}" has no answer inside its tile matrix set.`);return new Ta(n[0],wt(n[1],-90,90))}hasLngLat(e,t){let r=this._inverse(e,t);return r!==null&&Math.abs(r[1])<=90}_inverse(e,t){let r=this._finiteInverse(e,t);if(!r)return null;let i=this._originX+e*this._extent,n=this._originY-t*this._extent,[a,s]=this._crs.projection.forward(r);return Math.hypot(a-i,s-n)<=.001*this._extent?r:null}_finiteInverse(e,t){let r;try{r=this._crs.projection.inverse([this._originX+e*this._extent,this._originY-t*this._extent])}catch{return null}return r&&Number.isFinite(r[0])&&Number.isFinite(r[1])?r:null}_inverseTowardCenter(e,t){let r=0,i=1;for(let n=0;n<30;n++){let a=(r+i)/2;this._inverse(.5+(e-.5)*a,.5+(t-.5)*a)?r=a:i=a}return this._inverse(.5+(e-.5)*r,.5+(t-.5)*r)}metersPerWorldUnit(e,t){return this._extent}worldZFromAltitude(e,t){return e/this._extent}get latitudeRange(){return this._latitudeRange??=[this._findLatitudeLimit(-90),this._findLatitudeLimit(90)],this._latitudeRange}_findLatitudeLimit(e){let t=this.lngLatFromWorld(.5,.5),r=10*this._meridianStretch(t.lng,t.lat);if(!(r>0))return e;let i=Math.sign(e-t.lat);for(let n=t.lat;Math.abs(e-n)>1;n+=i)if(!(this._meridianStretch(t.lng,n+i)<=r))return n;return e}_meridianStretch(e,t){let[r,i]=this._crs.projection.forward([e,t]),[n,a]=this._crs.projection.forward([e,t>=0?t-.01:t+.01]);return Math.hypot(n-r,a-i)}},p5=class{forward(e){return[e[0],e[1]]}inverse(e){return[e[0],e[1]]}},f5=new class{constructor(){this.name="identity",this.projection=new p5,this.tileMatrixSet={origin:[-90,90],extentAtZoom0:180}}},vl=null,pa=new Map;function d5(e){vl=e,pa.clear()}function y5(e){if(!e.definition)return new tp(f5);if(!vl)Pe("GeoJSON sources are drawn in the wrong place: no projection handler is set in the workers, see `setProjectionHandler` in the custom CRS guide.");else return pa.has(e.definition)||pa.set(e.definition,vl(e.definition)),new tp({name:e.name,definition:e.definition,projection:pa.get(e.definition),tileMatrixSet:e.tileMatrixSet})}function bl(e,t){let r=([s,o,...l])=>{let{x:u,y:h}=t.worldFromLngLat(s,o);return[u,h,...l]},[i,n]=t.latitudeRange;if(i===-90&&n===90)return Zr(e,r);let a=s=>s===i&&i>-90||s===n&&n<90;return Zr(e,r,s=>{let o=!1,l=s.map(p=>p[1]>=i&&p[1]<=n?r(p):(o=!0,p));if(!o)return l;let u=[],h=0,c=NaN;for(let p=0;p<s.length;p++){let[f,d,...y]=s[p],m=wt(d,i,n);if(m===c&&a(m)){let g=Math.ceil(Math.abs(f-h)/10);for(let x=1;x<g;x++)u.push(r([h+(f-h)*x/g,m]))}u.push(m===d?l[p]:r([f,m,...y])),h=f,c=m}return u})}function m5(e,t){return Zr(e,([r,i,...n])=>{let a=t.lngLatFromWorld(r,i);return[a.lng,a.lat,...n]})}function g5(e,t){let r={...e};return e.add&&(r.add=e.add.map(i=>bl(i,t))),e.update&&(r.update=e.update.map(i=>i.newGeometry?{...i,newGeometry:bl(i.newGeometry,t)}:i)),r}function Zr(e,t,r=i=>i.map(t)){if(!e||typeof e!="object")return e;switch(e.type){case"FeatureCollection":return{...e,features:e.features.map(i=>Zr(i,t,r))};case"Feature":return{...e,geometry:e.geometry?Zr(e.geometry,t,r):e.geometry};case"GeometryCollection":return{...e,geometries:e.geometries.map(i=>Zr(i,t,r))};case"Point":return{...e,coordinates:t(e.coordinates)};case"MultiPoint":return{...e,coordinates:e.coordinates.map(t)};case"LineString":return{...e,coordinates:r(e.coordinates)};case"MultiLineString":case"Polygon":return{...e,coordinates:e.coordinates.map(i=>r(i))};case"MultiPolygon":return{...e,coordinates:e.coordinates.map(i=>i.map(n=>r(n)))};default:return e}}var x5=class{constructor(e,t,r,i=v5){this.actor=e,this.layerIndex=t,this.availableImages=r,this.tileState=new Qy,this._createGeoJSONIndex=i}loadVectorTile(e){if(!this._geoJSONIndex)throw Error("Unable to parse the data into a cluster or geojson");let{z:t,x:r,y:i}=e.tileID.canonical,n=this._geoJSONIndex.getTile(t,r,i);if(!n)return null;let a=new cw(n.features,{version:2,extent:be});return{vectorTile:a,rawData:dy(a,"__$json__:").buffer}}async loadTile(e){let{uid:t}=e,r=new Ky(e);r.abort=new AbortController;try{let i=this.loadVectorTile(e);if(!i)return null;let{vectorTile:n,rawData:a}=i;r.vectorTile=n,this.tileState.markLoaded(t,r);let s={rawData:a};return this.tileState.setParsing(t,s),await this._parseWorkerTile(r,e)}catch(i){throw this.tileState.markLoaded(t,r),i}}async _parseWorkerTile(e,t){let r=this.tileState.getParsing(e.uid),i=await e.parse(e.vectorTile,this.layerIndex,this.availableImages,this.actor,t.subdivisionGranularity);if(r){let{rawData:n}=r;i=Xe({rawTileData:n.slice(0),encoding:"mvt"},i),this.tileState.removeParsing(e.uid)}return i}async abortTile(e){this.tileState.abort(e.uid)}async removeTile(e){this.tileState.removeLoaded(e.uid)}async loadData(e){this._pendingRequest?.abort();let t=this._startRequestTiming(e);this._pendingRequest=new AbortController;try{await this.loadAndProcessGeoJSON(e,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let r={};return e.request&&(r.data=e.data),this._finishRequestTiming(t,e,r),r}catch(r){if(delete this._pendingRequest,!ap(r))throw r;return{abandoned:!0}}}_startRequestTiming(e){if(e.request?.collectResourceTiming)return new e1(e.request.url)}_finishRequestTiming(e,t,r){let i=e?.finish();i&&(r.resourceTiming={[t.source]:JSON.parse(JSON.stringify(i))})}async reloadTile(e){let t=e.uid,r=this.tileState.getLoaded(t);if(!r)return await this.loadTile(e);if(r.vectorTile)return r.showCollisionBoxes=e.showCollisionBoxes,r.tileID=r.tileID.unwrapTo(e.tileID.wrap),await this._parseWorkerTile(r,e)}async loadAndProcessGeoJSON(e,t){if(e.request&&(e.data=(await z0(e.request,t)).data),this._crsHelper=e.crs?y5(e.crs):void 0,e.data){e.data=this._filterGeoJSON(e.data,e.filter,e.source);let r=this._crsHelper?bl(e.data,this._crsHelper):e.data;this._geoJSONIndex=this._createGeoJSONIndex(r,e,this._crsHelper!==void 0)}else{if(e.dataDiff){this._geoJSONIndex??=this._createGeoJSONIndex({type:"FeatureCollection",features:[]},e,this._crsHelper!==void 0);let r=this._crsHelper?g5(e.dataDiff,this._crsHelper):e.dataDiff;this._geoJSONIndex.updateData(r,this._getFilterPredicate(e.filter,e.source))}if(e.updateCluster&&this._geoJSONIndex.updateClusterOptions(e.geojsonVtOptions.cluster,t1(e)),this._geoJSONIndex==null)throw Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`)}}_filterGeoJSON(e,t,r){if(e.type!=="FeatureCollection")return e;let i=this._getFilterPredicate(t,r);return i?{type:"FeatureCollection",features:e.features.filter(n=>i(n))}:e}_getFilterPredicate(e,t){if(typeof e!="boolean"&&!e?.length)return;let r=dr(e,`sources.${t}.filter`,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(r.result==="error")throw Error(r.value.map(i=>`${i.key}: ${i.message}`).join(", "));return i=>r.value.evaluate({zoom:0},i)}async removeSource(e){this._pendingRequest?.abort()}getClusterExpansionZoom(e){return this._geoJSONIndex.getClusterExpansionZoom(e.clusterId)}getClusterChildren(e){return this._toLngLat(this._geoJSONIndex.getClusterChildren(e.clusterId))}getClusterLeaves(e){return this._toLngLat(this._geoJSONIndex.getClusterLeaves(e.clusterId,e.limit,e.offset))}_toLngLat(e){return this._crsHelper?e.map(t=>m5(t,this._crsHelper)):e}};function v5(e,t,r){return new V2(e,Xe(t.geojsonVtOptions||{},{updateable:!0,clusterOptions:t1(t),coordinates:r?"unitSquare":"lngLat",wrap:!r}))}function t1({geojsonVtOptions:e,clusterProperties:t,source:r}){if(!t||!e.clusterOptions)return e.clusterOptions;let i={},n={},a={accumulated:null,zoom:0},s={properties:null},o=Object.keys(t);for(let l of o){let[u,h]=t[l],c=dr(h,`sources.${r}.clusterProperties.${l}[1]`),p=dr(typeof u=="string"?[u,["accumulated"],["get",l]]:u,`sources.${r}.clusterProperties.${l}[0]`);i[l]=c.value,n[l]=p.value}return e.clusterOptions.map=l=>{s.properties=l;let u={};for(let h of o)u[h]=i[h].evaluate(a,s);return u},e.clusterOptions.reduce=(l,u)=>{s.properties=u;for(let h of o)a.accumulated=l[h],l[h]=n[h].evaluate(a,s)},e.clusterOptions}async function b5(e){if(e.endsWith(".mjs")){await import(e);return}let t=await fetch(e,{credentials:"same-origin"});if(!t.ok)throw Error(`Failed to load ${e}: ${t.status}`);let r=await t.text();if(/^[ \t]*(import|export)\s/m.test(r)){let i=URL.createObjectURL(new Blob([r],{type:"text/javascript"}));try{await import(i)}finally{URL.revokeObjectURL(i)}}else globalThis.eval(r)}var w5=class{constructor(e){this.self=e,this.actor=new $0(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.importedScripts=new Map,this.self.registerWorkerSource=(t,r)=>{if(this.externalWorkerSourceTypes[t])throw Error(`Worker source with name "${t}" already registered.`);this.externalWorkerSourceTypes[t]=r},this.self.addProtocol=T0,this.self.removeProtocol=C0,this.self.registerRTLTextPlugin=t=>{ni.setMethods(t)},this.self.makeRequest=jl,this.self.setProjectionHandler=d5,this.actor.registerMessageHandler("LDT",(t,r)=>this._getDEMWorkerSource(t,r.source).loadTile(r)),this.actor.registerMessageHandler("RDT",async(t,r)=>{this._getDEMWorkerSource(t,r.source).removeTile(r)}),this.actor.registerMessageHandler("GCEZ",async(t,r)=>this._getWorkerSource(t,r.type,r.source).getClusterExpansionZoom(r)),this.actor.registerMessageHandler("GCC",async(t,r)=>this._getWorkerSource(t,r.type,r.source).getClusterChildren(r)),this.actor.registerMessageHandler("GCL",async(t,r)=>this._getWorkerSource(t,r.type,r.source).getClusterLeaves(r)),this.actor.registerMessageHandler("LD",(t,r)=>this._getWorkerSource(t,r.type,r.source).loadData(r)),this.actor.registerMessageHandler("LT",(t,r)=>this._getWorkerSource(t,r.type,r.source).loadTile(r)),this.actor.registerMessageHandler("RT",(t,r)=>this._getWorkerSource(t,r.type,r.source).reloadTile(r)),this.actor.registerMessageHandler("AT",(t,r)=>this._getWorkerSource(t,r.type,r.source).abortTile(r)),this.actor.registerMessageHandler("RMT",(t,r)=>this._getWorkerSource(t,r.type,r.source).removeTile(r)),this.actor.registerMessageHandler("RS",async(t,r)=>{if(!this.workerSources[t]?.[r.type]?.[r.source])return;let i=this.workerSources[t][r.type][r.source];delete this.workerSources[t][r.type][r.source],i.removeSource!==void 0&&i.removeSource(r)}),this.actor.registerMessageHandler("RM",async t=>{delete this.layerIndexes[t],delete this.availableImages[t],delete this.workerSources[t],delete this.demWorkerSources[t],this.globalStates.delete(t)}),this.actor.registerMessageHandler("SR",async(t,r)=>{this.referrer=r}),this.actor.registerMessageHandler("PI",async()=>{}),this.actor.registerMessageHandler("SRPS",(t,r)=>this._syncRTLPluginState(t,r)),this.actor.registerMessageHandler("IS",(t,r)=>this._importScript(r)),this.actor.registerMessageHandler("SI",(t,r)=>this._setImages(t,r)),this.actor.registerMessageHandler("UL",async(t,r)=>{this._getLayerIndex(t).update(r.layers,r.removedIds,this._getGlobalState(t))}),this.actor.registerMessageHandler("UGS",async(t,r)=>{let i=this._getGlobalState(t);for(let n in r)i[n]=r[n]}),this.actor.registerMessageHandler("SL",async(t,r)=>{this._getLayerIndex(t).replace(r,this._getGlobalState(t))})}async _importScript(e){let t=this.importedScripts.get(e);if(t)return t;let r=b5(e);this.importedScripts.set(e,r);try{await r}catch(i){throw this.importedScripts.delete(e),i}}_getGlobalState(e){let t=this.globalStates.get(e);return t||(t={},this.globalStates.set(e,t)),t}async _setImages(e,t){this.availableImages[e]=t;for(let r in this.workerSources[e]){let i=this.workerSources[e][r];for(let n in i)i[n].availableImages=t}}async _syncRTLPluginState(e,t){return await ni.syncState(t,r=>this._importScript(r))}_getAvailableImages(e){let t=this.availableImages[e];return t||=[],t}_getLayerIndex(e){let t=this.layerIndexes[e];return t||=this.layerIndexes[e]=new t5,t}_getWorkerSource(e,t,r){if(this.workerSources[e]||={},this.workerSources[e][t]||={},!this.workerSources[e][t][r]){let i={sendAsync:(n,a)=>(n.targetMapId=e,this.actor.sendAsync(n,a))};switch(t){case"vector":this.workerSources[e][t][r]=new h5(i,this._getLayerIndex(e),this._getAvailableImages(e));break;case"geojson":this.workerSources[e][t][r]=new x5(i,this._getLayerIndex(e),this._getAvailableImages(e));break;default:this.workerSources[e][t][r]=new this.externalWorkerSourceTypes[t](i,this._getLayerIndex(e),this._getAvailableImages(e))}}return this.workerSources[e][t][r]}_getDEMWorkerSource(e,t){return this.demWorkerSources[e]||={},this.demWorkerSources[e][t]||=new c5,this.demWorkerSources[e][t]}};Wr(self)&&(self.worker=new w5(self));export{w5 as default};
10
+ * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.20.0/LICENSE.txt
11
+ */var j0=Object.create,df=Object.defineProperty,U0=Object.getOwnPropertyDescriptor,q0=Object.getOwnPropertyNames,G0=Object.getPrototypeOf,yf=Object.prototype.hasOwnProperty,eu=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e,e.exports),t=null),e.exports),X0=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(var n=q0(e),a=0,s=n.length,o;a<s;a++)o=n[a],!yf.call(t,o)&&o!==r&&df(t,o,{get:(l=>e[l]).bind(null,o),enumerable:!(i=U0(e,o))||i.enumerable});return t},Y0=(t,e,r)=>(r=t==null?{}:j0(G0(t)),X0(e||!t||!t.__esModule||!yf.call(t,"default")?df(r,"default",{value:t,enumerable:!0}):r,t));function F(t,e){this.x=t,this.y=e}F.prototype={clone(){return new F(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,e){return this.clone()._rotateAround(t,e)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){let e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult(t){let e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){let t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){let e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround(t,e){let r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),a=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:F},F.convert=function(t){if(t instanceof F)return t;if(Array.isArray(t))return new F(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new F(+t.x,+t.y);throw Error("Expected [x, y] or {x, y} point format")};function W0(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(c,h=1e-6){if(c<=0)return 0;if(c>=1)return 1;let p=c;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-c;if(Math.abs(m)<h)return((u*p+l)*p+o)*p;let g=(3*s*p+2*a)*p+n;if(Math.abs(g)<1e-6)break;p-=m/g}let f=0,d=1;p=c;for(let y=0;y<20;y++){let m=((s*p+a)*p+n)*p;if(Math.abs(m-c)<h)break;c>m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var Uc;function Z0(){return Uc??=typeof OffscreenCanvas<"u"&&!!new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function",Uc}var aa;function H0(){if(aa==null&&(aa=!1,Z0())){let t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let r=0;r<25;r++){let i=r*4;t.fillStyle=`rgb(${i},${i+1},${i+2})`,t.fillRect(r%5,Math.floor(r/5),1,1)}let e=t.getImageData(0,0,5,5).data;for(let r=0;r<100;r++)if(r%4!=3&&e[r]!==r){aa=!0;break}}}return aa||!1}var hn=typeof Float32Array<"u"?Float32Array:Array;function K0(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ru(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function So(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],m=e[13],g=e[14],x=e[15],v=r[0],b=r[1],w=r[2],_=r[3];return t[0]=v*i+b*o+w*h+_*y,t[1]=v*n+b*l+w*p+_*m,t[2]=v*a+b*u+w*f+_*g,t[3]=v*s+b*c+w*d+_*x,v=r[4],b=r[5],w=r[6],_=r[7],t[4]=v*i+b*o+w*h+_*y,t[5]=v*n+b*l+w*p+_*m,t[6]=v*a+b*u+w*f+_*g,t[7]=v*s+b*c+w*d+_*x,v=r[8],b=r[9],w=r[10],_=r[11],t[8]=v*i+b*o+w*h+_*y,t[9]=v*n+b*l+w*p+_*m,t[10]=v*a+b*u+w*f+_*g,t[11]=v*s+b*c+w*d+_*x,v=r[12],b=r[13],w=r[14],_=r[15],t[12]=v*i+b*o+w*h+_*y,t[13]=v*n+b*l+w*p+_*m,t[14]=v*a+b*u+w*f+_*g,t[15]=v*s+b*c+w*d+_*x,t}function mf(t,e,r){var i=r[0],n=r[1],a=r[2],s,o,l,u,c,h,p,f,d,y,m,g;return e===t?(t[12]=e[0]*i+e[4]*n+e[8]*a+e[12],t[13]=e[1]*i+e[5]*n+e[9]*a+e[13],t[14]=e[2]*i+e[6]*n+e[10]*a+e[14],t[15]=e[3]*i+e[7]*n+e[11]*a+e[15]):(s=e[0],o=e[1],l=e[2],u=e[3],c=e[4],h=e[5],p=e[6],f=e[7],d=e[8],y=e[9],m=e[10],g=e[11],t[0]=s,t[1]=o,t[2]=l,t[3]=u,t[4]=c,t[5]=h,t[6]=p,t[7]=f,t[8]=d,t[9]=y,t[10]=m,t[11]=g,t[12]=s*i+c*n+d*a+e[12],t[13]=o*i+h*n+y*a+e[13],t[14]=l*i+p*n+m*a+e[14],t[15]=u*i+f*n+g*a+e[15]),t}function gf(t,e,r){var i=r[0],n=r[1],a=r[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function J0(){var t=new hn(3);return hn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Q0(t){var e=new hn(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Qa(t){var e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)}function Sa(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function xf(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function dr(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function vf(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t}function ke(t,e){var r=e[0],i=e[1],n=e[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function yr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function iu(t,e,r){var i=e[0],n=e[1],a=e[2],s=r[0],o=r[1],l=r[2];return t[0]=n*l-a*o,t[1]=a*s-i*l,t[2]=i*o-n*s,t}function tm(t,e,r,i){var n=e[0],a=e[1],s=e[2];return t[0]=n+i*(r[0]-n),t[1]=a+i*(r[1]-a),t[2]=s+i*(r[2]-s),t}var We=xf,Ao=Qa;(function(){var t=J0();return function(e,r,i,n,a,s){var o,l;for(r||=3,i||=0,l=n?Math.min(n*r+i,e.length):e.length,o=i;o<l;o+=r)t[0]=e[o],t[1]=e[o+1],t[2]=e[o+2],a(t,t,s),e[o]=t[0],e[o+1]=t[1],e[o+2]=t[2];return e}})();function em(){var t=new hn(4);return hn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function rm(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function im(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function ze(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,t[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,t[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,t[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,t}var nm=rm;(function(){var t=em();return function(e,r,i,n,a,s){var o,l;for(r||=4,i||=0,l=n?Math.min(n*r+i,e.length):e.length,o=i;o<l;o+=r)t[0]=e[o],t[1]=e[o+1],t[2]=e[o+2],t[3]=e[o+3],a(t,t,s),e[o]=t[0],e[o+1]=t[1],e[o+2]=t[2],e[o+3]=t[3];return e}})();var et=8192;function Ma(t){return t instanceof Error?t:Error(typeof t=="string"?t:String(t))}function nu(){return new Float64Array(4)}function Nt(){return new Float64Array(3)}function Eo(){return new Float64Array(16)}function am(){return new Float32Array(16)}function sm(){let t=new Float32Array(16);return ru(t),t}function To(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]}function om(t,e,r){let i=t[0]*r[0]+t[1]*r[1]+t[2]*r[2],n=e[0]*r[0]+e[1]*r[1]+e[2]*r[2];return n===0?null:(-i-r[3])/n}function qc(t,e){let r=Pa(t,360),i=Pa(e,360),n=i-r,a=i>r?n-360:n+360;return Math.abs(n)<Math.abs(a)?n:a}function Pa(t,e){return(t%e+e)%e}function Gc(t,e,r){return t*(1-r)+e*r}function lm(t){if(t<=0)return 0;if(t>=1)return 1;let e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function um(t,e,r,i){return W0(t,e,r,i)}um(.25,.1,.25,1);function Gt(t,e,r){return Math.min(r,Math.max(e,t))}function Ar(t,e,r){let i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n}function cm(t){return Math.log(t)/Math.LN2%1==0}function hm(t){return 2**t}function pm(t,e,r){let i={};for(let n in t)e.call(r||this,t[n],n,t)&&(i[n]=t[n]);return i}function Fo(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!Fo(t[r],e[r]))return!1;return!0}if(typeof t=="object"&&t&&e!==null){if(typeof e!="object"||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(!Fo(t[r],e[r]))return!1;return!0}return t===e}function pr(t){return Array.isArray(t)?t.map(pr):typeof t=="object"&&t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,pr(r)])):t}var Xc={};function Mt(t){Xc[t]||(typeof console<"u"&&console.warn(t),Xc[t]=!0)}function fr(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function fi(t){return typeof WorkerGlobalScope<"u"&&t!==void 0&&t instanceof WorkerGlobalScope}function au(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}function fm(t,e,r,i,n){let a=Math.max(-e,0)*4,s=(Math.max(0,r)-r)*i*4+a,o=i*4,l=Math.max(0,e),u=Math.max(0,r),c=Math.min(t.width,e+i),h=Math.min(t.height,r+n);return{rect:{x:l,y:u,width:c-l,height:h-u},layout:[{offset:s,stride:o}]}}async function dm(t,e,r,i,n){if(typeof VideoFrame>"u")throw Error("VideoFrame not supported");let a=new VideoFrame(t,{timestamp:0});try{let s=a?.format;if(!s||!(s.startsWith("BGR")||s.startsWith("RGB")))throw Error(`Unrecognized format ${s}`);let o=s.startsWith("BGR"),l=new Uint8ClampedArray(i*n*4);if(await a.copyTo(l,fm(t,e,r,i,n)),o)for(let u=0;u<l.length;u+=4){let c=l[u];l[u]=l[u+2],l[u+2]=c}return l}finally{a.close()}}var Ni,ji;function ym(t,e,r,i,n){let a=t.width,s=t.height;Ni&&ji||(Ni=new OffscreenCanvas(a,s),ji=Ni.getContext("2d",{willReadFrequently:!0})),Ni.width=a,Ni.height=s,ji.drawImage(t,0,0,a,s);let o=ji.getImageData(e,r,i,n);return ji.clearRect(0,0,a,s),o.data}async function mm(t,e,r,i,n){if(H0())try{return await dm(t,e,r,i,n)}catch{}return ym(t,e,r,i,n)}function Yc(t,e,r,i){return t.addEventListener(e,r,i),{unsubscribe:()=>{t.removeEventListener(e,r,i)}}}function di(t){return t*Math.PI/180}function Wc(t,e,r){r[t]?.includes(e)||(r[t]||=[],r[t].push(e))}function Zs(t,e,r){if(r?.[t]){let i=r[t].indexOf(e);i!==-1&&r[t].splice(i,1)}}function bf(t,e){if(e)for(let[r,i]of Object.entries(e))Object.defineProperty(t,r,{value:i,writable:!0,enumerable:!0,configurable:!0})}var wf=class{constructor(t,e={}){bf(this,e),this.type=t}},Ba=class extends wf{constructor(t,e={}){super("error",{error:t,...e})}},gm=class{on(t,e){return this._listeners||={},Wc(t,e,this._listeners),{unsubscribe:()=>{this.off(t,e)}}}off(t,e){return Zs(t,e,this._listeners),Zs(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners||={},Wc(t,e,this._oneTimeListeners),this):new Promise(r=>this.once(t,r))}fire(t,e){let r=typeof t=="string"?new wf(t,e||{}):t,i=r.type;if(this.listens(i)){r.target=this;let n=this._listeners?.[i]?.slice()??[];for(let o of n)o.call(this,r);let a=this._oneTimeListeners?.[i]?.slice()??[];for(let o of a)Zs(i,o,this._oneTimeListeners),o.call(this,r);let s=this._eventedParent;s&&(bf(r,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),s.fire(r))}else r instanceof Ba&&console.error(r.error);return this}listens(t){return!!(this._listeners?.[t]?.length||this._oneTimeListeners?.[t]?.length||this._eventedParent?.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}},Zc="AbortError",su=class extends Error{constructor(t=Zc){super(t instanceof Error?t.message:t),this.name=Zc,t instanceof Error&&t.stack&&(this.stack=t.stack)}};function _f(t){return t instanceof Error&&t.name==="AbortError"}function xm(t){if(t.aborted)throw new su(t.reason)}var Co=class Df{constructor(e,r,i){let n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let s=new Int32Array(this.arrayBuffer);e=s[0],r=s[1],i=s[2],this.d=r+2*i;for(let u=0;u<this.d*this.d;u++){let c=s[3+u],h=s[3+u+1];n.push(c===h?null:s.subarray(c,h))}let o=s[3+n.length],l=s[3+n.length+1];this.keys=s.subarray(o,l),this.bboxes=s.subarray(l),this.insert=this._insertReadonly}else{this.d=r+2*i;for(let s=0;s<this.d*this.d;s++)n.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=e,this.padding=i,this.scale=r/e,this.uid=0;let a=i/r*e;this.min=-a,this.max=e+a}insert(e,r,i,n,a){this._forEachCell(r,i,n,a,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(a)}_insertReadonly(){throw Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,r,i,n,a,s){this.cells[a].push(s)}query(e,r,i,n,a){let s=this.min,o=this.max;if(e<=s&&r<=s&&o<=i&&o<=n&&!a)return[...this.keys];{let l=[];return this._forEachCell(e,r,i,n,this._queryCell,l,{},a),l}}_queryCell(e,r,i,n,a,s,o,l){let u=this.cells[a];if(u!==null){let c=this.keys,h=this.bboxes;for(let p of u)if(o[p]===void 0){let f=p*4;(l?l(h[f+0],h[f+1],h[f+2],h[f+3]):e<=h[f+2]&&r<=h[f+3]&&i>=h[f+0]&&n>=h[f+1])?(o[p]=!0,s.push(c[p])):o[p]=!1}}}_forEachCell(e,r,i,n,a,s,o,l){let u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),h=this._convertToCellCoord(i),p=this._convertToCellCoord(n);for(let f=u;f<=h;f++)for(let d=c;d<=p;d++){let y=this.d*d+f;if((!l||l(this._convertFromCellCoord(f),this._convertFromCellCoord(d),this._convertFromCellCoord(f+1),this._convertFromCellCoord(d+1)))&&a.call(this,e,r,i,n,y,s,o,l))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,r=3+this.cells.length+1+1,i=0;for(let s of this.cells)i+=s.length;let n=new Int32Array(r+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let a=r;for(let s=0;s<e.length;s++){let o=e[s];n[3+s]=a,n.set(o,a),a+=o.length}return n[3+e.length]=a,n.set(this.keys,a),a+=this.keys.length,n[3+e.length+1]=a,n.set(this.bboxes,a),a+=this.bboxes.length,n.buffer}static serialize(e,r){let i=e.toArrayBuffer();return r&&r.push(i),{buffer:i}}static deserialize(e){return new Df(e.buffer)}},Sf={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},sparse:{type:"boolean",default:!1},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"},"fill-extrusion-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-height-offset":{type:"number",default:0,units:"meters",requires:[{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-height-anchor":{type:"enum",values:{ground:{},absolute:{}},default:"ground",requires:["symbol-height-offset"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature","pitch","bearing"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{},oklch:{},oklab:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-layer-blend":{type:"enum",values:{normal:{},multiply:{},color:{},luminosity:{},"plus-lighter":{},screen:{},overlay:{},difference:{},exclusion:{},"soft-light":{},"hard-light":{},darken:{},lighten:{},"color-dodge":{},"color-burn":{},hue:{},saturation:{}},default:"normal","property-type":"constant",transition:!1},"fill-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state","elevation"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"line-layer-blend":{type:"enum",values:{normal:{},multiply:{},color:{},luminosity:{},"plus-lighter":{},screen:{},overlay:{},difference:{},exclusion:{},"soft-light":{},"hard-light":{},darken:{},lighten:{},"color-dodge":{},"color-burn":{},hue:{},saturation:{}},default:"normal","property-type":"constant",transition:!1},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-layer-blend":{type:"enum",values:{normal:{},multiply:{},color:{},luminosity:{},"plus-lighter":{},screen:{},overlay:{},difference:{},exclusion:{},"soft-light":{},"hard-light":{},darken:{},lighten:{},"color-dodge":{},"color-burn":{},hue:{},saturation:{}},default:"normal","property-type":"constant",transition:!1},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}},S=Sf,vm=["type","source","source-layer","minzoom","maxzoom","filter","layout"],T=class{constructor(t,e,r,i,n="error"){this.message=(t?`${t}: `:"")+r,i&&(this.identifier=i),this.severity=n,typeof e?.__line__=="number"&&e.__line__&&(this.line=e.__line__)}},Se=class extends Error{constructor(t,e){super(e),this.message=e,this.key=t}},bm=class Af{constructor(e,r=[]){this.parent=e,this.bindings=new Map(r)}concat(e){return new Af(this,e)}get(e){if(this.bindings.has(e))return this.bindings.get(e);if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return this.bindings.has(e)?!0:this.parent?this.parent.has(e):!1}},kn={kind:"null"},M={kind:"number"},W={kind:"string"},Q={kind:"boolean"},Ae={kind:"color"},ts={kind:"projectionDefinition"},Cr={kind:"object"},H={kind:"value"},wm={kind:"error"},es={kind:"collator"},Mn={kind:"formatted"},rs={kind:"padding"},pn={kind:"colorArray"},is={kind:"numberArray"},Pn={kind:"resolvedImage"},ns={kind:"variableAnchorOffsetCollection"};function qt(t,e){return{kind:"array",itemType:t,N:e}}function bt(t){if(t.kind==="array"){let e=bt(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}return t.kind}var _m=[kn,M,W,Q,Ae,ts,Mn,Cr,qt(H),rs,is,pn,Pn,ns];function fn(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!fn(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(let r of _m)if(!fn(r,e))return null}}return`Expected ${bt(t)} but found ${bt(e)} instead.`}function ou(t,e){return e.some(r=>r.kind===t.kind)}function Ir(t,e){return e.some(r=>r==="null"?t===null:r==="array"?Array.isArray(t):r==="object"?t&&!Array.isArray(t)&&typeof t=="object":r===typeof t)}function sr(t,e){return t.kind==="array"&&e.kind==="array"?t.itemType.kind===e.itemType.kind&&typeof t.N=="number":t.kind===e.kind}var Ef=.96422,Tf=.82521,Ff=4/29,Io=6/29,Cf=3*Io*Io,If=Math.PI/180,lu=180/Math.PI;function uu(t){return t%=360,t<0&&(t+=360),t}function kf([t,e,r,i]){t=Me(t),e=Me(e),r=Me(r);let n,a,s=Hs((.2225045*t+.7168786*e+.0606169*r)/1);return t===e&&e===r?n=a=s:(n=Hs((.4360747*t+.3850649*e+.1430804*r)/Ef),a=Hs((.0139322*t+.0971045*e+.7141733*r)/Tf)),[116*s-16,500*(n-s),200*(s-a),i]}function Me(t){let e=Math.abs(t);return e<=.04045?t/12.92:Math.sign(t)*((e+.055)/1.055)**2.4}function Hs(t){return t>.008856451679035631?t**(1/3):t/Cf+Ff}function Mf([t,e,r,i]){let n=(t+16)/116,a=isNaN(e)?n:n+e/500,s=isNaN(r)?n:n-r/200;return n=1*Js(n),a=Ef*Js(a),s=Tf*Js(s),[Ks(3.1338561*a-1.6168667*n-.4906146*s),Ks(-.9787684*a+1.9161415*n+.033454*s),Ks(.0719453*a-.2289914*n+1.4052427*s),i]}function Ks(t){let e=Math.abs(t);return e<=.00304?12.92*t:Math.sign(t)*(1.055*e**(1/2.4)-.055)}function Js(t){return t>Io?t*t*t:Cf*(t-Ff)}function Dm(t){let[e,r,i,n]=kf(t),a=Math.sqrt(r*r+i*i);return[Math.round(a*1e4)?uu(Math.atan2(i,r)*lu):NaN,a,e,n]}function Sm([t,e,r,i]){return t=isNaN(t)?0:t*If,Mf([r,Math.cos(t)*e,Math.sin(t)*e,i])}function Am([t,e,r,i]){t=uu(t),e/=100,r/=100;function n(a){let s=(a+t/30)%12,o=e*Math.min(r,1-r);return r-o*Math.max(-1,Math.min(s-3,9-s,1))}return[n(0),n(8),n(4),i]}var Pf=[[506752/1228815,87881/245763,12673/70218],[87098/409605,175762/245763,12673/175545],[7918/409605,87881/737289,1001167/1053270]],Bf=[[12831/3959,-329/214,-1974/3959],[-851781/878810,1648619/878810,36519/878810],[705/12673,-2585/12673,705/667]],Em=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],Tm=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],Fm=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],Cm=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]];function Pe(t,[e,r,i]){return[t[0][0]*e+t[0][1]*r+t[0][2]*i,t[1][0]*e+t[1][1]*r+t[1][2]*i,t[2][0]*e+t[2][1]*r+t[2][2]*i]}function nn(t){let e=Math.abs(t);return e>.0031308?Math.sign(t)*(1.055*e**(1/2.4)-.055):12.92*t}function zf([t,e,r]){let[i,n,a]=Pe(Em,Pe(Pf,[Me(t),Me(e),Me(r)]));return Pe(Tm,[Math.cbrt(i),Math.cbrt(n),Math.cbrt(a)])}function Im(t){let[e,r,i]=Pe(Fm,t),[n,a,s]=Pe(Bf,Pe(Cm,[e*e*e,r*r*r,i*i*i]));return[nn(n),nn(a),nn(s)]}function km([t,e,r,i]){let[n,a,s]=zf([t,e,r]);return[n,a,s,i]}function Mm([t,e,r,i]){let[n,a,s]=zf([t,e,r]),o=Math.sqrt(a*a+s*s);return o<=4e-6?[n,0,NaN,i]:[n,o,uu(Math.atan2(s,a)*lu),i]}function cu([t,e,r,i]){let n=isNaN(r)?0:r*If,a=Math.min(e,1e6),[s,o,l]=Im([t,a*Math.cos(n),a*Math.sin(n)]);return[s,o,l,i]}function Lf([t,e,r,i]){return cu([t,Math.hypot(e,r),Math.atan2(r,e)*lu,i])}var Pm=[[608311/1250200,189793/714400,198249/1000160],[35783/156275,247089/357200,198249/2500400],[0,32229/714400,5220557/5000800]],Bm=[[446124/178915,-333277/357830,-72051/178915],[-14852/17905,63121/35810,423/17905],[11844/330415,-50337/660830,316169/330415]];function zm([t,e,r,i]){let[n,a,s]=[t,e,r].map(c=>Me(Math.min(Math.max(c,-1e6),1e6))),[o,l,u]=Pe(Bf,Pe(Pm,[n,a,s])).map(nn);return[o,l,u,i]}function Lm([t,e,r,i]){let[n,a,s]=Pe(Bm,Pe(Pf,[Me(t),Me(e),Me(r)])).map(o=>Math.min(Math.max(nn(o),0),1));return[n,a,s,i]}var Om=Object.hasOwn||function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};function zt(t,e){return Om(t,e)?t[e]:void 0}function Vm(t){if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e=zt(jm,t);if(e){let[s,o,l]=e;return[s/255,o/255,l/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let s=t.length<6?1:2,o=1;return[sa(t.slice(o,o+=s)),sa(t.slice(o,o+=s)),sa(t.slice(o,o+=s)),sa(t.slice(o,o+s)||"ff")]}if(t.startsWith("rgb")){let s=t.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(s){let[o,l,u,c,h,p,f,d,y,m,g,x]=s,v=[c||" ",f||" ",m].join("");if(v===" "||v===" /"||v===",,"||v===",,,"){let b=[u,p,y].join(""),w=b==="%%%"?100:b===""?255:0;if(w){let _=[be(+l/w,0,1),be(+h/w,0,1),be(+d/w,0,1),g?Kc(+g,x):1];if(Jc(_))return _}}return}}let r=t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[s,o,l,u,c,h,p,f,d]=r,y=[l||" ",c||" ",p].join("");if(y===" "||y===" /"||y===",,"||y===",,,"){let m=[+o,be(+u,0,100),be(+h,0,100),f?Kc(+f,d):1];if(Jc(m))return Am(m)}}let i=t.match(Rm);if(i){let[,s,o,l,u]=i,c=[oe(s,1),oe(o,.4),oe(l,1),u===void 0?1:oe(u,1)];if(c.every(Number.isFinite))return cu([be(c[0],0,1),Math.max(c[1],0),c[2]%360,be(c[3],0,1)])}let n=t.match($m);if(n){let[,s,o,l,u]=n,c=[oe(s,1),oe(o,.4),oe(l,.4),u===void 0?1:oe(u,1)];if(c.every(Number.isFinite))return Lf([be(c[0],0,1),c[1],c[2],be(c[3],0,1)])}let a=t.match(Nm);if(a){let[,s,o,l,u]=a,c=[oe(s,1),oe(o,1),oe(l,1),u===void 0?1:oe(u,1)];if(c.every(Number.isFinite))return zm([c[0],c[1],c[2],be(c[3],0,1)])}}var fe="[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:e[+-]?\\d+)?",Rm=RegExp(`^oklch\\(\\s*(none|${fe}%?)\\s+(none|${fe}%?)\\s+(none|${fe}(?:deg|grad|rad|turn)?)\\s*(?:\\/\\s*(none|${fe}%?)\\s*)?\\)$`),$m=RegExp(`^oklab\\(\\s*(none|${fe}%?)\\s+(none|${fe}%?)\\s+(none|${fe}%?)\\s*(?:\\/\\s*(none|${fe}%?)\\s*)?\\)$`),Nm=RegExp(`^color\\(\\s*display-p3\\s+(none|${fe}%?)\\s+(none|${fe}%?)\\s+(none|${fe}%?)\\s*(?:\\/\\s*(none|${fe}%?)\\s*)?\\)$`),Hc={deg:1,grad:.9,rad:180/Math.PI,turn:360};function oe(t,e){if(t==="none")return 0;let[,r,i]=t.match(/^(.+?)(%|[a-z]+)?$/);return i==="%"?r/100*e:i?+r%(360/Hc[i])*Hc[i]:+r}function sa(t){return parseInt(t.padEnd(2,t),16)/255}function Kc(t,e){return be(e?t/100:t,0,1)}function be(t,e,r){return Math.min(Math.max(e,t),r)}function Jc(t){return!t.some(Number.isNaN)}var jm={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Ut(t,e,r){return t+r*(e-t)}function yi(t,e,r){return t.map((i,n)=>Ut(i,e[n],r))}function Um(t){return t==="rgb"||t==="hcl"||t==="lab"||t==="oklch"||t==="oklab"}var mt=class ce{constructor(e,r,i,n=1,a=!0){!a&&(Math.min(e,r,i)<0||Math.max(e,r,i)>1)&&(this.overwriteGetter("unclippedRgb",[e,r,i,n]),e=Math.min(Math.max(e,0),1),r=Math.min(Math.max(r,0),1),i=Math.min(Math.max(i,0),1)),this.r=e,this.g=r,this.b=i,this.a=n,a||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,r,i,n]))}static{this.black=new ce(0,0,0,1)}static{this.white=new ce(1,1,1,1)}static{this.transparent=new ce(0,0,0,0)}static{this.red=new ce(1,0,0,1)}static parse(e){if(e instanceof ce)return e;if(typeof e!="string")return;let r=Vm(e);if(r)return new ce(...r,!1)}get rgb(){let{r:e,g:r,b:i,a:n}=this,a=n||1/0;return this.overwriteGetter("rgb",[e/a,r/a,i/a,n])}get hcl(){return this.overwriteGetter("hcl",Dm(this.unclippedRgb))}get lab(){return this.overwriteGetter("lab",kf(this.unclippedRgb))}get oklch(){return this.overwriteGetter("oklch",Mm(this.unclippedRgb))}get oklab(){return this.overwriteGetter("oklab",km(this.unclippedRgb))}get displayP3(){return this.overwriteGetter("displayP3",Lm(this.unclippedRgb))}get unclippedRgb(){return this.rgb}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,i,n]=this.rgb;return`rgba(${[e,r,i].map(a=>Math.round(a*255)).join(",")},${n})`}static interpolate(e,r,i,n="rgb"){switch(n){case"rgb":{let[a,s,o,l]=yi(e.unclippedRgb,r.unclippedRgb,i);return new ce(a,s,o,l,!1)}case"hcl":{let[a,s,o,l]=e.hcl,[u,c,h,p]=r.hcl,f,d;if(!isNaN(a)&&!isNaN(u)){let v=u-a;u>a&&v>180?v-=360:u<a&&a-u>180&&(v+=360),f=a+i*v}else isNaN(a)?isNaN(u)?f=NaN:(f=u,(o===1||o===0)&&(d=c)):(f=a,(h===1||h===0)&&(d=s));let[y,m,g,x]=Sm([f,d??Ut(s,c,i),Ut(o,h,i),Ut(l,p,i)]);return new ce(y,m,g,x,!1)}case"lab":{let[a,s,o,l]=Mf(yi(e.lab,r.lab,i));return new ce(a,s,o,l,!1)}case"oklch":{let[a,s,o,l]=e.oklch,[u,c,h,p]=r.oklch,f=isNaN(o)?h:o,d=isNaN(h)?o:h;d-f>180?f+=360:d-f<-180&&(d+=360);let y=Ut(l,p,i),m=y===0?1:y,[g,x,v]=cu([Ut(a*l,u*p,i)/m,Ut(s*l,c*p,i)/m,Ut(f,d,i),y]);return new ce(g,x,v,y,!1)}case"oklab":{let[a,s,o,l]=e.oklab,[u,c,h,p]=r.oklab,f=Ut(l,p,i),d=f===0?1:f,[y,m,g]=Lf([Ut(a*l,u*p,i)/d,Ut(s*l,c*p,i)/d,Ut(o*l,h*p,i)/d,f]);return new ce(y,m,g,f,!1)}}}},hu=class{constructor(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}},qm=["bottom","center","top"],ko=class{constructor(t,e,r,i,n,a){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n,this.verticalAlign=a}},Ze=class Aa{constructor(e){this.sections=e}static fromString(e){return new Aa([new ko(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Aa?e:Aa.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}},Ve=class Zi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Zi)return e;if(typeof e=="number")return new Zi([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Zi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new Zi(yi(e.values,r.values,i))}},Re=class Hi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Hi)return e;if(typeof e=="number")return new Hi([e]);if(Array.isArray(e)){for(let r of e)if(typeof r!="number")return;return new Hi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new Hi(yi(e.values,r.values,i))}},Kt=class Ki{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ki)return e;if(typeof e=="string"){let i=mt.parse(e);return i?new Ki([i]):void 0}if(!Array.isArray(e))return;let r=[];for(let i of e){if(typeof i!="string")return;let n=mt.parse(i);if(!n)return;r.push(n)}return new Ki(r)}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i,n="rgb"){let a=[];if(e.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let s=0;s<e.values.length;s++)a.push(mt.interpolate(e.values[s],r.values[s],i,n));return new Ki(a)}},xt=class extends Error{constructor(t,e){super(t),this.name="RuntimeError",this.path=e}toJSON(){return this.message}},Gm=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),Le=class Ea{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ea)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!=0)){for(let r=0;r<e.length;r+=2){let i=e[r],n=e[r+1];if(typeof i!="string"||!Gm.has(i)||!Array.isArray(n)||n.length!==2||typeof n[0]!="number"||typeof n[1]!="number")return}return new Ea(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i,n){let a=e.values,s=r.values;if(a.length!==s.length)throw new xt(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${r.toString()}`,n);let o=[];for(let l=0;l<a.length;l+=2){if(a[l]!==s[l])throw new xt(`Cannot interpolate values containing mismatched anchors. from[${l}]: ${a[l]}, to[${l}]: ${s[l]}`,n);o.push(a[l]);let[u,c]=a[l+1],[h,p]=s[l+1];o.push([Ut(u,h,i),Ut(c,p,i)])}return new Ea(o)}},Oe=class Of{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Of({name:e,available:!1}):null}},Or=class Qr{constructor(e,r,i){this.from=e,this.to=r,this.transition=i}toString(){return this.from===this.to&&this.transition===1?this.from:JSON.stringify([this.from,this.to,this.transition])}static interpolate(e,r,i){return new Qr(e,r,i)}static parse(e){if(e instanceof Qr)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number")return new Qr(e[0],e[1],e[2]);if(typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number")return new Qr(e.from,e.to,e.transition);if(typeof e=="string")return new Qr(e,e,1)}};function Vf(t,e,r,i){return typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?i===void 0||typeof i=="number"&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,r,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof i=="number"?[t,e,r,i]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function mi(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof Or||t instanceof mt||t instanceof hu||t instanceof Ze||t instanceof Ve||t instanceof Re||t instanceof Kt||t instanceof Le||t instanceof Oe)return!0;if(Array.isArray(t)){for(let e of t)if(!mi(e))return!1;return!0}if(typeof t=="object"){for(let e in t)if(!mi(t[e]))return!1;return!0}return!1}function Ft(t){if(t===null)return kn;if(typeof t=="string")return W;if(typeof t=="boolean")return Q;if(typeof t=="number")return M;if(t instanceof mt)return Ae;if(t instanceof Or)return ts;if(t instanceof hu)return es;if(t instanceof Ze)return Mn;if(t instanceof Ve)return rs;if(t instanceof Re)return is;if(t instanceof Kt)return pn;if(t instanceof Le)return ns;if(t instanceof Oe)return Pn;if(Array.isArray(t)){let e=t.length,r;for(let i of t){let n=Ft(i);if(!r)r=n;else{if(r===n)continue;r=H;break}}return qt(r||H,e)}return Cr}function an(t){let e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof mt||t instanceof Or||t instanceof Ze||t instanceof Ve||t instanceof Re||t instanceof Kt||t instanceof Le||t instanceof Oe?t.toString():JSON.stringify(t)}var gi=class Rf{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!mi(e[1]))return r.error(`invalid value of type "${typeof e[1]}"`);let i=e[1],n=Ft(i),a=r.expectedType;return n.kind==="array"&&n.N===0&&a&&a.kind==="array"&&(typeof a.N!="number"||a.N===0)&&(n=a),new Rf(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},oa={string:W,number:M,boolean:Q,object:Cr},Ue=class $f{constructor(e,r,i){this.type=e,this.args=r,this.key=i}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=1,n,a=e[0];if(a==="array"){let o;if(e.length>2){let u=e[1];if(typeof u!="string"||!(u in oa)||u==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);o=oa[u],i++}else o=H;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);l=e[2],i++}n=qt(o,l)}else{if(!oa[a])throw Error(`Types doesn't contain name = ${a}`);n=oa[a]}let s=[];for(;i<e.length;i++){let o=r.parse(e[i],i,H);if(!o)return null;s.push(o)}return new $f(n,s,r.key)}evaluate(e){for(let r=0;r<this.args.length;r++){let i=this.args[r].evaluate(e);if(!fn(this.type,Ft(i)))return i;if(r===this.args.length-1)throw new xt(`Expected value to be of type ${bt(this.type)}, but found ${bt(Ft(i))} instead.`,this.key)}throw Error()}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Qc={"to-boolean":Q,"to-color":Ae,"to-number":M,"to-string":W},ii=class Nf{constructor(e,r,i){this.type=e,this.args=r,this.key=i}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=e[0];if(!Qc[i])throw Error(`Can't parse ${i} as it is not part of the known types`);if((i==="to-boolean"||i==="to-string")&&e.length!==2)return r.error("Expected one argument.");let n=Qc[i],a=[];for(let s=1;s<e.length;s++){let o=r.parse(e[s],s,H);if(!o)return null;a.push(o)}return new Nf(n,a,r.key)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let r,i;for(let n of this.args){if(r=n.evaluate(e),i=null,r instanceof mt)return r;if(typeof r=="string"){let a=e.parseColor(r);if(a)return a}else if(Array.isArray(r)&&(i=r.length<3||r.length>4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Vf(r[0],r[1],r[2],r[3]),!i))return new mt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new xt(i||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"padding":{let r;for(let i of this.args){r=i.evaluate(e);let n=Ve.parse(r);if(n)return n}throw new xt(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"numberArray":{let r;for(let i of this.args){r=i.evaluate(e);let n=Re.parse(r);if(n)return n}throw new xt(`Could not parse numberArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"colorArray":{let r;for(let i of this.args){r=i.evaluate(e);let n=Kt.parse(r);if(n)return n}throw new xt(`Could not parse colorArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"variableAnchorOffsetCollection":{let r;for(let i of this.args){r=i.evaluate(e);let n=Le.parse(r);if(n)return n}throw new xt(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}case"number":{let r=null;for(let i of this.args){if(r=i.evaluate(e),r===null)return 0;let n=Number(r);if(!isNaN(n))return n}throw new xt(`Could not convert ${JSON.stringify(r)} to number.`,this.key)}case"formatted":return Ze.fromString(an(this.args[0].evaluate(e)));case"resolvedImage":return Oe.fromString(an(this.args[0].evaluate(e)));case"projectionDefinition":{let r=this.args[0].evaluate(e);if(Or.parse(r))return r;throw new xt(`Could not parse projectionDefinition from value '${typeof r=="string"?r:JSON.stringify(r)}'`,this.key)}default:return an(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Xm=["Unknown","Point","LineString","Polygon"],jf=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Xm[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache.get(t);return e||(e=mt.parse(t),this._parseColorCache.set(t,e)),e}},Uf=class qf{constructor(e,r,i=[],n,a=new bm,s=[]){this.registry=e,this.path=i,this.key=i.map(o=>`[${o}]`).join(""),this.scope=a,this.errors=s,this.expectedType=n,this._isConstant=r}parse(e,r,i,n,a={}){return r==null?this._parse(e,a):this.concat(r,i,n)._parse(e,a)}_parse(e,r){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);let i=this.key;function n(a,s,o){return o==="assert"?new Ue(s,[a],i):o==="coerce"?new ii(s,[a],i):a}if(Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let a=e[0];if(typeof a!="string")return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let s=zt(this.registry,a);if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){let l=this.expectedType,u=o.type;if((l.kind==="string"||l.kind==="number"||l.kind==="boolean"||l.kind==="object"||l.kind==="array")&&u.kind==="value")o=n(o,l,r.typeAnnotation||"assert");else if(l.kind==="projectionDefinition"&&["string","array","value"].includes(u.kind)||["color","formatted","resolvedImage"].includes(l.kind)&&["value","string"].includes(u.kind)||["padding","numberArray"].includes(l.kind)&&["value","number","array"].includes(u.kind)||l.kind==="colorArray"&&["value","string","array"].includes(u.kind)||l.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(u.kind))o=n(o,l,r.typeAnnotation||"coerce");else if(this.checkSubtype(l,u))return null}if(!(o instanceof gi)&&o.type.kind!=="resolvedImage"&&this._isConstant(o)){let l=new jf;try{o=new gi(o.type,o.evaluate(l))}catch(u){return this.error(u.message),null}}return o}return this.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0)}return e===void 0?this.error("'undefined' value invalid. Use null instead."):typeof e=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,r,i){let n=typeof e=="number"?this.path.concat(e):this.path,a=i?this.scope.concat(i):this.scope;return new qf(this.registry,this._isConstant,n,r||null,a,this.errors)}error(e,...r){let i=`${this.key}${r.map(n=>`[${n}]`).join("")}`;this.errors.push(new Se(i,e))}checkSubtype(e,r){let i=fn(e,r);return i&&this.error(i),i}},Gf=class Xf{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let i=[];for(let a=1;a<e.length-1;a+=2){let s=e[a];if(typeof s!="string")return r.error(`Expected string, but found ${typeof s} instead.`,a);if(/[^a-zA-Z0-9_]/.test(s))return r.error("Variable names must contain only alphanumeric characters or '_'.",a);let o=r.parse(e[a+1],a+1);if(!o)return null;i.push([s,o])}let n=r.parse(e[e.length-1],e.length-1,r.expectedType,i);return n?new Xf(i,n):null}outputDefined(){return this.result.outputDefined()}},Yf=class Wf{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");let i=e[1];return r.scope.has(i)?new Wf(i,r.scope.get(i)):r.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}},Ym=class Zf{constructor(e,r,i,n){this.type=e,this.index=r,this.input=i,this.key=n}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,M),n=r.parse(e[2],2,qt(r.expectedType||H));if(!i||!n)return null;let a=n.type;return new Zf(a.itemType,i,n,r.key)}evaluate(e){let r=this.index.evaluate(e),i=this.input.evaluate(e);if(r<0)throw new xt(`Array index out of bounds: ${r} < 0.`,this.key);if(r>=i.length)throw new xt(`Array index out of bounds: ${r} > ${i.length-1}.`,this.key);if(r!==Math.floor(r))throw new xt(`Array index must be an integer, but found ${r} instead.`,this.key);return i[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},Wm=class Hf{constructor(e,r,i){this.needle=e,this.haystack=r,this.key=i,this.type=Q}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,H),n=r.parse(e[2],2,H);return!i||!n?null:ou(i.type,[Q,W,M,kn,H])?new Hf(i,n,r.key):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${bt(i.type)} instead`)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!Ir(r,["boolean","string","number","null"]))throw new xt(`Expected first argument to be of type boolean, string, number or null, but found ${bt(Ft(r))} instead.`,this.key);if(!Ir(i,["string","array"]))throw new xt(`Expected second argument to be of type array or string, but found ${bt(Ft(i))} instead.`,this.key);return i.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},Zm=class Mo{constructor(e,r,i,n){this.needle=e,this.haystack=r,this.key=i,this.fromIndex=n,this.type=M}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,H),n=r.parse(e[2],2,H);if(!i||!n)return null;if(!ou(i.type,[Q,W,M,kn,H]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${bt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,M);return a?new Mo(i,n,r.key,a):null}return new Mo(i,n,r.key)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!Ir(r,["boolean","string","number","null"]))throw new xt(`Expected first argument to be of type boolean, string, number or null, but found ${bt(Ft(r))} instead.`,this.key);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),Ir(i,["string"])){let a=i.indexOf(r,n);return a===-1?-1:[...i.slice(0,a)].length}if(Ir(i,["array"]))return i.indexOf(r,n);throw new xt(`Expected second argument to be of type array or string, but found ${bt(Ft(i))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},Hm=class Kf{constructor(e,r,i,n,a,s){this.inputType=e,this.type=r,this.input=i,this.cases=n,this.outputs=a,this.otherwise=s}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let i,n;r.expectedType&&r.expectedType.kind!=="value"&&(n=r.expectedType);let a={},s=[];for(let u=2;u<e.length-1;u+=2){let c=e[u],h=e[u+1];Array.isArray(c)||(c=[c]);let p=r.concat(u);if(c.length===0)return p.error("Expected at least one branch label.");for(let d of c){if(typeof d!="number"&&typeof d!="string")return p.error("Branch labels must be numbers or strings.");if(typeof d=="number"&&Math.abs(d)>2**53-1)return p.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof d=="number"&&Math.floor(d)!==d)return p.error("Numeric branch labels must be integer values.");if(!i)i=Ft(d);else if(p.checkSubtype(i,Ft(d)))return null;if(a[String(d)]!==void 0)return p.error("Branch labels must be unique.");a[String(d)]=s.length}let f=r.parse(h,u,n);if(!f)return null;n||=f.type,s.push(f)}let o=r.parse(e[1],1,H);if(!o)return null;let l=r.parse(e[e.length-1],e.length-1,n);return!l||o.type.kind!=="value"&&r.concat(1).checkSubtype(i,o.type)?null:new Kf(i,n,o,a,s,l)}evaluate(e){let r=this.input.evaluate(e);return(Ft(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}},Km=class Jf{constructor(e,r,i){this.type=e,this.branches=r,this.otherwise=i}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let i;r.expectedType&&r.expectedType.kind!=="value"&&(i=r.expectedType);let n=[];for(let s=1;s<e.length-1;s+=2){let o=r.parse(e[s],s,Q);if(!o)return null;let l=r.parse(e[s+1],s+1,i);if(!l)return null;n.push([o,l]),i||=l.type}let a=r.parse(e[e.length-1],e.length-1,i);if(!a)return null;if(!i)throw Error("Can't infer output type");return new Jf(i,n,a)}evaluate(e){for(let[r,i]of this.branches)if(r.evaluate(e))return i.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[r,i]of this.branches)e(r),e(i);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}},Jm=class Po{constructor(e,r,i,n,a){this.type=e,this.input=r,this.beginIndex=i,this.key=n,this.endIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,H),n=r.parse(e[2],2,M);if(!i||!n)return null;if(!ou(i.type,[qt(H),W,H]))return r.error(`Expected first argument to be of type array or string, but found ${bt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,M);return a?new Po(i.type,i,n,r.key,a):null}return new Po(i.type,i,n,r.key)}evaluate(e){let r=this.input.evaluate(e),i=this.beginIndex.evaluate(e),n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),Ir(r,["string"]))return[...r].slice(i,n).join("");if(Ir(r,["array"]))return r.slice(i,n);throw new xt(`Expected first argument to be of type array or string, but found ${bt(Ft(r))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function as(t,e,r){let i=t.length-1,n=0,a=i,s=0,o,l;for(;n<=a;)if(s=Math.floor((n+a)/2),o=t[s],l=t[s+1],o<=e){if(s===i||e<l)return s;n=s+1}else if(o>e)a=s-1;else throw new xt("Input is not a number.",r);return 0}var pu=class Qf{constructor(e,r,i,n){this.type=e,this.input=r,this.key=n,this.labels=[],this.outputs=[];for(let[a,s]of i)this.labels.push(a),this.outputs.push(s)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");let i=r.parse(e[1],1,M);if(!i)return null;let n=[],a=null;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);for(let s=1;s<e.length;s+=2){let o=s===1?-1/0:e[s],l=e[s+1],u=s,c=s+1;if(typeof o!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(n.length&&n[n.length-1][0]>=o)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);let h=r.parse(l,c,a);if(!h)return null;a||=h.type,n.push([o,h])}return new Qf(a,i,n,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;return n>=r[a-1]?i[a-1].evaluate(e):i[as(r,n,this.key)].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function Qm(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(c,h=1e-6){if(c<=0)return 0;if(c>=1)return 1;let p=c;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-c;if(Math.abs(m)<h)return((u*p+l)*p+o)*p;let g=(3*s*p+2*a)*p+n;if(Math.abs(g)<1e-6)break;p-=m/g}let f=0,d=1;p=c;for(let y=0;y<20;y++){let m=((s*p+a)*p+n)*p;if(Math.abs(m-c)<h)break;c>m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}function si(t,e){if(!(t instanceof e))return!1;try{return e.prototype.valueOf.call(t),!0}catch{return!1}}function Dt(t){return si(t,Number)||si(t,String)||si(t,Boolean)?t.valueOf():t}function Mr(t){if(Array.isArray(t))return t.map(Mr);let e=Dt(t);return e instanceof Object?Object.fromEntries(Object.entries(e).map(([r,i])=>[r,Mr(i)])):e}function _e(t){let e=Dt(t);return typeof e=="object"&&e?JSON.stringify(e):String(e)}var pe=class Bo{constructor(e,r,i,n,a,s){this.type=e,this.operator=r,this.interpolation=i,this.input=n,this.key=s,this.labels=[],this.outputs=[];for(let[o,l]of a)this.labels.push(o),this.outputs.push(l)}static interpolationFactor(e,r,i,n){let a=0;if(e.name==="exponential")a=Qs(r,e.base,i,n);else if(e.name==="linear")a=Qs(r,1,i,n);else if(e.name==="cubic-bezier"){let s=e.controlPoints;a=Qm(s[0],s[1],s[2],s[3])(Qs(r,1,i,n))}return a}static parse(e,r){let[i,n,a,...s]=e;if(!Array.isArray(n)||n.length===0)return r.error("Expected an interpolation type expression.",1);if(n[0]==="linear")n={name:"linear"};else if(n[0]==="exponential"){let u=n[1];if(typeof u!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:u}}else if(n[0]==="cubic-bezier"){let u=n.slice(1);if(u.length!==4||u.some(c=>typeof c!="number"||c<0||c>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:u}}else return r.error(`Unknown interpolation type ${_e(n[0])}`,1,0);if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(a=r.parse(a,2,M),!a)return null;let o=[],l=null;(i==="interpolate-hcl"||i==="interpolate-lab"||i==="interpolate-oklch"||i==="interpolate-oklab")&&r.expectedType!=pn?l=Ae:r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);for(let u=0;u<s.length;u+=2){let c=s[u],h=s[u+1],p=u+3,f=u+4;if(typeof c!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(o.length&&o[o.length-1][0]>=c)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);let d=r.parse(h,f,l);if(!d)return null;l||=d.type,o.push([c,d])}return!sr(l,M)&&!sr(l,ts)&&!sr(l,Ae)&&!sr(l,rs)&&!sr(l,is)&&!sr(l,pn)&&!sr(l,ns)&&!sr(l,qt(M))?r.error(`Type ${bt(l)} is not interpolatable.`):new Bo(l,i,n,a,o,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(e);let s=as(r,n,this.key),o=r[s],l=r[s+1],u=Bo.interpolationFactor(this.interpolation,n,o,l),c=i[s].evaluate(e),h=i[s+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Ut(c,h,u);case"color":return mt.interpolate(c,h,u);case"padding":return Ve.interpolate(c,h,u);case"colorArray":return Kt.interpolate(c,h,u);case"numberArray":return Re.interpolate(c,h,u);case"variableAnchorOffsetCollection":return Le.interpolate(c,h,u,this.key);case"array":return yi(c,h,u);case"projectionDefinition":return Or.interpolate(c,h,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return mt.interpolate(c,h,u,"hcl");case"colorArray":return Kt.interpolate(c,h,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return mt.interpolate(c,h,u,"lab");case"colorArray":return Kt.interpolate(c,h,u,"lab")}case"interpolate-oklch":switch(this.type.kind){case"color":return mt.interpolate(c,h,u,"oklch");case"colorArray":return Kt.interpolate(c,h,u,"oklch")}case"interpolate-oklab":switch(this.type.kind){case"color":return mt.interpolate(c,h,u,"oklab");case"colorArray":return Kt.interpolate(c,h,u,"oklab")}}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function Qs(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}var He={color:mt.interpolate,number:Ut,padding:Ve.interpolate,numberArray:Re.interpolate,colorArray:Kt.interpolate,variableAnchorOffsetCollection:Le.interpolate,array:yi},td=class zo{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=null,n=r.expectedType;n&&n.kind!=="value"&&(i=n);let a=[];for(let s of e.slice(1)){let o=r.parse(s,1+a.length,i,void 0,{typeAnnotation:"omit"});if(!o)return null;i||=o.type,a.push(o)}if(!i)throw Error("No output type");return n&&a.some(s=>fn(n,s.type))?new zo(H,a):new zo(i,a)}evaluate(e){let r=null,i=0,n;for(let a of this.args)if(i++,r=a.evaluate(e),r&&r instanceof Oe&&!r.available&&(n||=r.name,r=null,i===this.args.length&&(r=n)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function th(t,e){return t==="=="||t==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function tg(t,e,r){return e===r}function eg(t,e,r){return e!==r}function rg(t,e,r){return e<r}function ig(t,e,r){return e>r}function ng(t,e,r){return e<=r}function ag(t,e,r){return e>=r}function ed(t,e,r,i){return i.compare(e,r)===0}function sg(t,e,r,i){return!ed(t,e,r,i)}function og(t,e,r,i){return i.compare(e,r)<0}function lg(t,e,r,i){return i.compare(e,r)>0}function ug(t,e,r,i){return i.compare(e,r)<=0}function cg(t,e,r,i){return i.compare(e,r)>=0}function Ei(t,e,r){let i=t!=="=="&&t!=="!=";return class rd{constructor(a,s,o,l){this.lhs=a,this.rhs=s,this.key=o,this.collator=l,this.type=Q,this.hasUntypedArgument=a.type.kind==="value"||s.type.kind==="value"}static parse(a,s){if(a.length!==3&&a.length!==4)return s.error("Expected two or three arguments.");let o=a[0],l=s.parse(a[1],1,H);if(!l)return null;if(!th(o,l.type))return s.concat(1).error(`"${o}" comparisons are not supported for type '${bt(l.type)}'.`);let u=s.parse(a[2],2,H);if(!u)return null;if(!th(o,u.type))return s.concat(2).error(`"${o}" comparisons are not supported for type '${bt(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error(`Cannot compare types '${bt(l.type)}' and '${bt(u.type)}'.`);i&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new Ue(u.type,[l],s.key):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new Ue(l.type,[u],s.key)));let c=null;if(a.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error("Cannot use collator to compare non-string types.");if(c=s.parse(a[3],3,es),!c)return null}return new rd(l,u,s.key,c)}evaluate(a){let s=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(i&&this.hasUntypedArgument){let l=Ft(s),u=Ft(o);if(l.kind!==u.kind||l.kind!=="string"&&l.kind!=="number")throw new xt(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let l=Ft(s),u=Ft(o);if(l.kind!=="string"||u.kind!=="string")return e(a,s,o)}return this.collator?r(a,s,o,this.collator.evaluate(a)):e(a,s,o)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}}}var hg=Ei("==",tg,ed),pg=Ei("!=",eg,sg),fg=Ei("<",rg,og),dg=Ei(">",ig,lg),yg=Ei("<=",ng,ug),mg=Ei(">=",ag,cg),id=class nd{constructor(e,r,i){this.type=es,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");let i=e[1];if(typeof i!="object"||!i||Array.isArray(i))return r.error("Collator options argument must be an object.");let n=r.parse(i["case-sensitive"]!==void 0&&i["case-sensitive"],1,Q);if(!n)return null;let a=r.parse(i["diacritic-sensitive"]!==void 0&&i["diacritic-sensitive"],1,Q);if(!a)return null;let s=null;return i.locale&&(s=r.parse(i.locale,1,W),!s)?null:new nd(n,a,s)}evaluate(e){return new hu(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},gg=class ad{constructor(e,r,i,n,a,s){this.type=W,this.number=e,this.locale=r,this.currency=i,this.unit=n,this.minFractionDigits=a,this.maxFractionDigits=s}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");let i=r.parse(e[1],1,M);if(!i)return null;let n=e[2];if(typeof n!="object"||!n||Array.isArray(n))return r.error("NumberFormat options argument must be an object.");let a=null;if(n.locale&&(a=r.parse(n.locale,1,W),!a))return null;let s=null;if(n.currency&&(s=r.parse(n.currency,1,W),!s))return null;let o=null;if(n.unit&&(o=r.parse(n.unit,1,W),!o))return null;if(s&&o)return r.error("NumberFormat options `currency` and `unit` are mutually exclusive");let l=null;if(n["min-fraction-digits"]&&(l=r.parse(n["min-fraction-digits"],1,M),!l))return null;let u=null;return n["max-fraction-digits"]&&(u=r.parse(n["max-fraction-digits"],1,M),!u)?null:new ad(i,a,s,o,l,u)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},sd=class od{constructor(e){this.type=Mn,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=e[1];if(!Array.isArray(i)&&typeof i=="object")return r.error("First argument must be an image or text section.");let n=[],a=!1;for(let s=1;s<=e.length-1;++s){let o=e[s];if(a&&typeof o=="object"&&o&&!Array.isArray(o)){a=!1;let l=null;if(o["font-scale"]&&(l=r.parse(o["font-scale"],1,M),!l))return null;let u=null;if(o["text-font"]&&(u=r.parse(o["text-font"],1,qt(W)),!u))return null;let c=null;if(o["text-color"]&&(c=r.parse(o["text-color"],1,Ae),!c))return null;let h=null;if(o["vertical-align"]){if(typeof o["vertical-align"]=="string"&&!qm.includes(o["vertical-align"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${o["vertical-align"]}' instead.`);if(h=r.parse(o["vertical-align"],1,W),!h)return null}let p=n[n.length-1];p.scale=l,p.font=u,p.textColor=c,p.verticalAlign=h}else{let l=r.parse(e[s],1,H);if(!l)return null;let u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new od(n)}evaluate(e){return new Ze(this.sections.map(r=>{let i=r.content.evaluate(e);return Ft(i)===Pn?new ko("",i,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(e):null):new ko(an(i),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null,r.verticalAlign?r.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor),r.verticalAlign&&e(r.verticalAlign)}outputDefined(){return!1}},xg=class ld{constructor(e){this.type=Pn,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");let i=r.parse(e[1],1,W);return i?new ld(i):r.error("No image name provided.")}evaluate(e){let r=this.input.evaluate(e),i=Oe.fromString(r);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(r)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}},vg=class ud{constructor(e,r){this.input=e,this.key=r,this.type=M}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=r.parse(e[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${bt(i.type)} instead.`):new ud(i,r.key):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new xt(`Expected value to be of type string or array, but found ${bt(Ft(r))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}},eh={Point:0,MultiPoint:1,LineString:1,MultiLineString:2,Polygon:2,MultiPolygon:3};function cd(t,e){return Array.isArray(t)?e===0?t.length>=2&&t.every(r=>typeof r=="number"):t.every(r=>cd(r,e-1)):!1}function rh(t){if(typeof t!="object"||!t)return!1;let{type:e,coordinates:r}=t;return typeof e=="string"&&Object.keys(eh).includes(e)&&cd(r,eh[e])}function hd(t){if(typeof t!="object"||!t)return null;let{type:e,geometry:r,features:i}=t,n;if(e==="FeatureCollection"){if(!Array.isArray(i))return null;n=[];for(let s of i){if(typeof s!="object"||!s)return null;s.geometry!==null&&n.push(s.geometry)}}else if(e==="Feature")n=[r];else return rh(t)?[t]:null;let a=[];for(let s of n)if(rh(s))a.push(s);else if(s?.type!=="GeometryCollection")return null;return a}var Be=8192;function bg(t,e){let r=wg(t[0]),i=Dg(t[1]),n=2**e.z;return[Math.round(r*n*Be),Math.round(i*n*Be)]}function fu(t,e){let r=2**e.z,i=(t[0]/Be+e.x)/r,n=(t[1]/Be+e.y)/r;return[_g(i),Sg(n)]}function wg(t){return(180+t)/360}function _g(t){return t*360-180}function Dg(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Sg(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}function Bn(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function dn(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Ag(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Eg(t,e,r){let i=t[0]-e[0],n=t[1]-e[1],a=t[0]-r[0],s=t[1]-r[1];return i*s-a*n===0&&i*a<=0&&n*s<=0}function ss(t,e,r,i){let n=[e[0]-t[0],e[1]-t[1]];return Ig([i[0]-r[0],i[1]-r[1]],n)!==0&&!!(ih(t,e,r,i)&&ih(r,i,t,e))}function Tg(t,e,r){for(let i of r)for(let n=0;n<i.length-1;++n)if(ss(t,e,i[n],i[n+1]))return!0;return!1}function Ti(t,e,r=!1){let i=!1;for(let n of e)for(let a=0;a<n.length-1;a++){if(Eg(t,n[a],n[a+1]))return r;Ag(t,n[a],n[a+1])&&(i=!i)}return i}function Fg(t,e){for(let r of e)if(Ti(t,r))return!0;return!1}function pd(t,e){for(let r of t)if(!Ti(r,e))return!1;for(let r=0;r<t.length-1;++r)if(Tg(t[r],t[r+1],e))return!1;return!0}function Cg(t,e){for(let r of e)if(pd(t,r))return!0;return!1}function Ig(t,e){return t[0]*e[1]-t[1]*e[0]}function ih(t,e,r,i){let n=t[0]-r[0],a=t[1]-r[1],s=e[0]-r[0],o=e[1]-r[1],l=i[0]-r[0],u=i[1]-r[1],c=n*u-l*a,h=s*u-l*o;return c>0&&h<0||c<0&&h>0}function du(t,e,r){let i=[];for(let n=0;n<t.length;n++){let a=[];for(let s=0;s<t[n].length;s++){let o=bg(t[n][s],r);Bn(e,o),a.push(o)}i.push(a)}return i}function fd(t,e,r){let i=[];for(let n=0;n<t.length;n++){let a=du(t[n],e,r);i.push(a)}return i}function dd(t,e,r,i){if(t[0]<r[0]||t[0]>r[2]){let n=i*.5,a=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;a===0&&(a=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=a}Bn(e,t)}function kg(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}function nh(t,e,r,i){let n=2**i.z*Be,a=[i.x*Be,i.y*Be],s=[];for(let o of t)for(let l of o){let u=[l.x+a[0],l.y+a[1]];dd(u,e,r,n),s.push(u)}return s}function ah(t,e,r,i){let n=2**i.z*Be,a=[i.x*Be,i.y*Be],s=[];for(let o of t){let l=[];for(let u of o){let c=[u.x+a[0],u.y+a[1]];Bn(e,c),l.push(c)}s.push(l)}if(e[2]-e[0]<=n/2){kg(e);for(let o of s)for(let l of o)dd(l,e,r,n)}return s}function Mg(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type==="Polygon"){let a=du(e.coordinates,i,n),s=nh(t.geometry(),r,i,n);if(!dn(r,i))return!1;for(let o of s)if(!Ti(o,a))return!1}if(e.type==="MultiPolygon"){let a=fd(e.coordinates,i,n),s=nh(t.geometry(),r,i,n);if(!dn(r,i))return!1;for(let o of s)if(!Fg(o,a))return!1}return!0}function Pg(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type==="Polygon"){let a=du(e.coordinates,i,n),s=ah(t.geometry(),r,i,n);if(!dn(r,i))return!1;for(let o of s)if(!pd(o,a))return!1}if(e.type==="MultiPolygon"){let a=fd(e.coordinates,i,n),s=ah(t.geometry(),r,i,n);if(!dn(r,i))return!1;for(let o of s)if(!Cg(o,a))return!1}return!0}var yu=class Lo{constructor(e,r){this.type=Q,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);let i=mi(e[1])?hd(e[1]):null;if(i){let n=e[1];if(n.type==="FeatureCollection"){let a=[];for(let{type:s,coordinates:o}of i)s==="Polygon"&&a.push(o),s==="MultiPolygon"&&a.push(...o);if(a.length)return new Lo(n,{type:"MultiPolygon",coordinates:a})}else{let a=i[0];if(a?.type==="Polygon"||a?.type==="MultiPolygon")return new Lo(n,a)}}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return Mg(e,this.geometries);if(e.geometryType()==="LineString")return Pg(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},yd=class{constructor(t=[],e=(r,i)=>r<i?-1:+(r>i)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t<i;){let a=(t<<1)+1,s=a+1;if(s<this.length&&r(e[s],e[a])<0&&(a=s),r(e[a],n)>=0)break;e[t]=e[a],t=a}e[t]=n}};function md(t,e,r=0,i=t.length-1,n=Bg){for(;i>r;){if(i-r>600){let l=i-r+1,u=e-r+1,c=Math.log(l),h=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);md(t,e,Math.max(r,Math.floor(e-u*h/l+p)),Math.min(i,Math.floor(e+(l-u)*h/l+p)),n)}let a=t[e],s=r,o=i;for(Ui(t,r,e),n(t[i],a)>0&&Ui(t,r,i);s<o;){for(Ui(t,s,o),s++,o--;n(t[s],a)<0;)s++;for(;n(t[o],a)>0;)o--}n(t[r],a)===0?Ui(t,r,o):(o++,Ui(t,o,i)),o<=e&&(r=o+1),e<=o&&(i=o-1)}}function Ui(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function Bg(t,e){return t<e?-1:+(t>e)}function os(t,e){if(t.length<=1)return[t];let r=[],i,n;for(let a of t){let s=Lg(a);s!==0&&(a.area=Math.abs(s),n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[a]):i.push(a))}if(i&&r.push(i),e>1)for(let a=0;a<r.length;a++)r[a].length<=e||(md(r[a],e,1,r[a].length-1,zg),r[a]=r[a].slice(0,e));return r}function zg(t,e){return e.area-t.area}function Lg(t){let e=0;for(let r=0,i=t.length,n=i-1,a,s;r<i;n=r++)a=t[r],s=t[n],e+=(s.x-a.x)*(a.y+s.y);return e}var sh=Math.PI/180,mu=class{constructor(t){let e=sh*6378.137*1e3,r=Math.cos(t*sh),i=1/(1-.0066943799901413165*(1-r*r)),n=Math.sqrt(i);this.kx=e*n*r,this.ky=e*n*i*.9933056200098587}distance(t,e){let r=this.wrap(t[0]-e[0])*this.kx,i=(t[1]-e[1])*this.ky;return Math.sqrt(r*r+i*i)}pointOnLine(t,e){let r=1/0,i,n,a,s;for(let o=0;o<t.length-1;o++){let l=t[o][0],u=t[o][1],c=this.wrap(t[o+1][0]-l)*this.kx,h=(t[o+1][1]-u)*this.ky,p=0;(c!==0||h!==0)&&(p=(this.wrap(e[0]-l)*this.kx*c+(e[1]-u)*this.ky*h)/(c*c+h*h),p>1?(l=t[o+1][0],u=t[o+1][1]):p>0&&(l+=c/this.kx*p,u+=h/this.ky*p)),c=this.wrap(e[0]-l)*this.kx,h=(e[1]-u)*this.ky;let f=c*c+h*h;f<r&&(r=f,i=l,n=u,a=o,s=p)}return{point:[i,n],index:a,t:Math.max(0,Math.min(1,s))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}};function gd(t,e){return e[0]-t[0]}function za(t){return t[1]-t[0]+1}function Ke(t,e){return t[1]>=t[0]&&t[1]<e}function Oo(t,e){if(t[0]>t[1])return[null,null];let r=za(t);if(e){if(r===2)return[t,null];let n=Math.floor(r/2);return[[t[0],t[0]+n],[t[0]+n,t[1]]]}if(r===1)return[t,null];let i=Math.floor(r/2)-1;return[[t[0],t[0]+i],[t[0]+i+1,t[1]]]}function Vo(t,e){if(!Ke(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=e[0];i<=e[1];++i)Bn(r,t[i]);return r}function Ro(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let i of r)Bn(e,i);return e}function oh(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function gu(t,e,r){if(!oh(t)||!oh(e))return NaN;let i=0,n=0;return t[2]<e[0]&&(i=e[0]-t[2]),t[0]>e[2]&&(i=t[0]-e[2]),t[1]>e[3]&&(n=t[1]-e[3]),t[3]<e[1]&&(n=e[1]-t[3]),r.distance([0,0],[i,n])}function Er(t,e,r){let i=r.pointOnLine(e,t);return r.distance(t,i.point)}function xu(t,e,r,i,n){let a=Math.min(Er(t,[r,i],n),Er(e,[r,i],n)),s=Math.min(Er(r,[t,e],n),Er(i,[t,e],n));return Math.min(a,s)}function Og(t,e,r,i,n){if(!(Ke(e,t.length)&&Ke(i,r.length)))return 1/0;let a=1/0;for(let s=e[0];s<e[1];++s){let o=t[s],l=t[s+1];for(let u=i[0];u<i[1];++u){let c=r[u],h=r[u+1];if(ss(o,l,c,h))return 0;a=Math.min(a,xu(o,l,c,h,n))}}return a}function Vg(t,e,r,i,n){if(!(Ke(e,t.length)&&Ke(i,r.length)))return NaN;let a=1/0;for(let s=e[0];s<=e[1];++s)for(let o=i[0];o<=i[1];++o)if(a=Math.min(a,n.distance(t[s],r[o])),a===0)return a;return a}function Rg(t,e,r){if(Ti(t,e,!0))return 0;let i=1/0;for(let n of e){let a=n[0],s=n[n.length-1];if(a!==s&&(i=Math.min(i,Er(t,[s,a],r)),i===0))return i;let o=r.pointOnLine(n,t);if(i=Math.min(i,r.distance(t,o.point)),i===0)return i}return i}function $g(t,e,r,i){if(!Ke(e,t.length))return NaN;for(let a=e[0];a<=e[1];++a)if(Ti(t[a],r,!0))return 0;let n=1/0;for(let a=e[0];a<e[1];++a){let s=t[a],o=t[a+1];for(let l of r)for(let u=0,c=l.length,h=c-1;u<c;h=u++){let p=l[h],f=l[u];if(ss(s,o,p,f))return 0;n=Math.min(n,xu(s,o,p,f,i))}}return n}function lh(t,e){for(let r of t)for(let i of r)if(Ti(i,e,!0))return!0;return!1}function Ng(t,e,r,i=1/0){let n=Ro(t),a=Ro(e);if(i!==1/0&&gu(n,a,r)>=i)return i;if(dn(n,a)){if(lh(t,e))return 0}else if(lh(e,t))return 0;let s=1/0;for(let o of t)for(let l=0,u=o.length,c=u-1;l<u;c=l++){let h=o[c],p=o[l];for(let f of e)for(let d=0,y=f.length,m=y-1;d<y;m=d++){let g=f[m],x=f[d];if(ss(h,p,g,x))return 0;s=Math.min(s,xu(h,p,g,x,r))}}return s}function uh(t,e,r,i,n,a){if(!a)return;let s=gu(Vo(i,a),n,r);s<e&&t.push([s,a,[0,0]])}function la(t,e,r,i,n,a,s){if(!a||!s)return;let o=gu(Vo(i,a),Vo(n,s),r);o<e&&t.push([o,a,s])}function La(t,e,r,i,n=1/0){let a=Math.min(i.distance(t[0],r[0][0]),n);if(a===0)return a;let s=new yd([[0,[0,t.length-1],[0,0]]],gd),o=Ro(r);for(;s.length>0;){let l=s.pop();if(l[0]>=a)continue;let u=l[1],c=e?50:100;if(za(u)<=c){if(!Ke(u,t.length))return NaN;if(e){let h=$g(t,u,r,i);if(isNaN(h)||h===0)return h;a=Math.min(a,h)}else for(let h=u[0];h<=u[1];++h){let p=Rg(t[h],r,i);if(a=Math.min(a,p),a===0)return 0}}else{let h=Oo(u,e);uh(s,a,i,t,o,h[0]),uh(s,a,i,t,o,h[1])}}return a}function Oa(t,e,r,i,n,a=1/0){let s=Math.min(a,n.distance(t[0],r[0]));if(s===0)return s;let o=new yd([[0,[0,t.length-1],[0,r.length-1]]],gd);for(;o.length>0;){let l=o.pop();if(l[0]>=s)continue;let u=l[1],c=l[2],h=e?50:100,p=i?50:100;if(za(u)<=h&&za(c)<=p){if(!Ke(u,t.length)&&Ke(c,r.length))return NaN;let f;if(e&&i)f=Og(t,u,r,c,n),s=Math.min(s,f);else if(e&&!i){let d=t.slice(u[0],u[1]+1);for(let y=c[0];y<=c[1];++y)if(f=Er(r[y],d,n),s=Math.min(s,f),s===0)return s}else if(!e&&i){let d=r.slice(c[0],c[1]+1);for(let y=u[0];y<=u[1];++y)if(f=Er(t[y],d,n),s=Math.min(s,f),s===0)return s}else f=Vg(t,u,r,c,n),s=Math.min(s,f)}else{let f=Oo(u,e),d=Oo(c,i);la(o,s,n,t,r,f[0],d[0]),la(o,s,n,t,r,f[0],d[1]),la(o,s,n,t,r,f[1],d[0]),la(o,s,n,t,r,f[1],d[1])}}return s}function jg(t,e){let r=t.geometry(),i=r.flat().map(s=>fu([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new mu(i[0][1]),a=1/0;for(let s of e){switch(s.type){case"Point":a=Math.min(a,Oa(i,!1,[s.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,Oa(i,!1,s.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,La(i,!1,s.coordinates,n,a))}if(a===0)return a}return a}function Ug(t,e){let r=t.geometry(),i=r.flat().map(s=>fu([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new mu(i[0][1]),a=1/0;for(let s of e){switch(s.type){case"Point":a=Math.min(a,Oa(i,!0,[s.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,Oa(i,!0,s.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,La(i,!0,s.coordinates,n,a))}if(a===0)return a}return a}function qg(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let i=os(r,0).map(s=>s.map(o=>o.map(l=>fu([l.x,l.y],t.canonical)))),n=new mu(i[0][0][0][1]),a=1/0;for(let s of e)for(let o of i){switch(s.type){case"Point":a=Math.min(a,La([s.coordinates],!1,o,n,a));break;case"LineString":a=Math.min(a,La(s.coordinates,!0,o,n,a));break;case"Polygon":a=Math.min(a,Ng(o,s.coordinates,n,a))}if(a===0)return a}return a}function Gg(t){return t.type==="MultiPolygon"?t.coordinates.map(e=>({type:"Polygon",coordinates:e})):t.type==="MultiLineString"?t.coordinates.map(e=>({type:"LineString",coordinates:e})):t.type==="MultiPoint"?t.coordinates.map(e=>({type:"Point",coordinates:e})):[t]}var vu=class xd{constructor(e,r){this.type=M,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);let i=mi(e[1])?hd(e[1]):null;return i?new xd(e[1],i.flatMap(n=>Gg(n))):r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return jg(e,this.geometries);if(e.geometryType()==="LineString")return Ug(e,this.geometries);if(e.geometryType()==="Polygon")return qg(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},Xg=class vd{constructor(e){let r=null;for(let i of e)if(!r)r=i.type;else{if(r===i.type)continue;r=H;break}this.type=qt(r??H,e.length),this.arr=e}static parse(e,r){if(e.length!==2)return r.error(`'semiliteral' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!mi(e[1]))return r.error(`invalid value of type "${typeof e[1]}"`);let i=e[1],n=Ft(i);if(n.kind==="array"){let a=i,s=r.concat(1),o=[];for(let l=0;l<a.length;l++){let u=s.parse(a[l],l,H);if(!u)return null;o.push(u)}return new vd(o)}return new gi(n,i)}evaluate(e){return this.arr.map(r=>r.evaluate(e))}eachChild(e){this.arr.forEach(e)}outputDefined(){return this.arr.every(e=>e.outputDefined())}},bu=class bd{constructor(e){this.key=e,this.type=H}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=e[1];return i==null?r.error("Global state property must be defined."):typeof i=="string"?new bd(i):r.error(`Global state property must be string, but found ${typeof e[1]} instead.`)}evaluate(e){let r=e.globals?.globalState;return!r||Object.keys(r).length===0?null:zt(r,this.key)??null}eachChild(){}outputDefined(){return!1}},oi={"==":hg,"!=":pg,">":dg,"<":fg,">=":mg,"<=":yg,array:Ue,at:Ym,boolean:Ue,case:Km,coalesce:td,collator:id,format:sd,image:xg,in:Wm,"index-of":Zm,interpolate:pe,"interpolate-hcl":pe,"interpolate-lab":pe,"interpolate-oklch":pe,"interpolate-oklab":pe,length:vg,let:Gf,literal:gi,match:Hm,number:Ue,"number-format":gg,object:Ue,semiliteral:Xg,slice:Jm,step:pu,string:Ue,"to-boolean":ii,"to-color":ii,"to-number":ii,"to-string":ii,var:Yf,within:yu,distance:vu,"global-state":bu},Vr=class Ji{constructor(e,r,i,n,a){this.name=e,this.type=r,this._evaluate=i,this.args=n,this.key=a}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let i=e[0],n=Ji.definitions[i];if(!n)return r.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=s.filter(([u])=>!Array.isArray(u)||u.length===e.length-1),l=null;for(let[u,c]of o){l=new Uf(r.registry,Va,r.path,null,r.scope);let h=[],p=!1;for(let f=1;f<e.length;f++){let d=e[f],y=Array.isArray(u)?u[f-1]:u.type,m=l.parse(d,1+h.length,y);if(!m){p=!0;break}h.push(m)}if(!p)if(Array.isArray(u)&&u.length!==h.length)l.error(`Expected ${u.length} arguments, but found ${h.length} instead.`);else{for(let f=0;f<h.length;f++){let d=Array.isArray(u)?u[f]:u.type,y=h[f];l.concat(f+1).checkSubtype(d,y.type)}if(l.errors.length===0)return new Ji(i,a,c,h,r.key)}}if(o.length===1)r.errors.push(...l.errors);else{let u=(o.length?o:s).map(([h])=>Wg(h)).join(" | "),c=[];for(let h=1;h<e.length;h++){let p=r.parse(e[h],1+c.length);if(!p)return null;c.push(bt(p.type))}r.error(`Expected arguments of type ${u}, but found (${c.join(", ")}) instead.`)}return null}static register(e,r){Ji.definitions=r;for(let i in r)e[i]=Ji}};function ch(t,[e,r,i,n],a){e=e.evaluate(t),r=r.evaluate(t),i=i.evaluate(t);let s=n?n.evaluate(t):1,o=Vf(e,r,i,s);if(o)throw new xt(o,a);return new mt(e/255,r/255,i/255,s,!1)}function hh(t,e){return t in e&&e[t]!==void 0}function to(t,e){let r=e[t];return r===void 0?null:r}function Yg(t,e,r,i){for(;r<=i;){let n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}function br(t){return{type:t}}Vr.register(oi,{error:[wm,[W],(t,[e],r)=>{throw new xt(e.evaluate(t),r)}],typeof:[W,[H],(t,[e])=>bt(Ft(e.evaluate(t)))],"to-rgba":[qt(M,4),[Ae],(t,[e])=>{let[r,i,n,a]=e.evaluate(t).rgb;return[r*255,i*255,n*255,a]}],rgb:[Ae,[M,M,M],ch],rgba:[Ae,[M,M,M,M],ch],has:{type:Q,overloads:[[[W],(t,[e])=>hh(e.evaluate(t),t.properties())],[[W,Cr],(t,[e,r])=>hh(e.evaluate(t),r.evaluate(t))]]},get:{type:H,overloads:[[[W],(t,[e])=>to(e.evaluate(t),t.properties())],[[W,Cr],(t,[e,r])=>to(e.evaluate(t),r.evaluate(t))]]},"feature-state":[H,[W],(t,[e])=>to(e.evaluate(t),t.featureState||{})],properties:[Cr,[],t=>t.properties()],"geometry-type":[W,[],t=>t.geometryType()],id:[H,[],t=>t.id()],zoom:[M,[],t=>t.globals.zoom],pitch:[M,[],t=>t.globals.pitch||0],bearing:[M,[],t=>t.globals.bearing||0],"heatmap-density":[M,[],t=>t.globals.heatmapDensity||0],elevation:[M,[],t=>t.globals.elevation||0],"line-progress":[M,[],t=>t.globals.lineProgress||0],accumulated:[H,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[M,br(M),(t,e)=>{let r=0;for(let i of e)r+=i.evaluate(t);return r}],"*":[M,br(M),(t,e)=>{let r=1;for(let i of e)r*=i.evaluate(t);return r}],"-":{type:M,overloads:[[[M,M],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[M],(t,[e])=>-e.evaluate(t)]]},"/":[M,[M,M],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[M,[M,M],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[M,[],()=>Math.LN2],pi:[M,[],()=>Math.PI],e:[M,[],()=>Math.E],"^":[M,[M,M],(t,[e,r])=>e.evaluate(t)**+r.evaluate(t)],sqrt:[M,[M],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[M,[M],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[M,[M],(t,[e])=>Math.log(e.evaluate(t))],log2:[M,[M],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[M,[M],(t,[e])=>Math.sin(e.evaluate(t))],cos:[M,[M],(t,[e])=>Math.cos(e.evaluate(t))],tan:[M,[M],(t,[e])=>Math.tan(e.evaluate(t))],asin:[M,[M],(t,[e])=>Math.asin(e.evaluate(t))],acos:[M,[M],(t,[e])=>Math.acos(e.evaluate(t))],atan:[M,[M],(t,[e])=>Math.atan(e.evaluate(t))],min:[M,br(M),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[M,br(M),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[M,[M],(t,[e])=>Math.abs(e.evaluate(t))],round:[M,[M],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[M,[M],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[M,[M],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Q,[W,H],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[Q,[H],(t,[e])=>t.id()===e.value],"filter-type-==":[Q,[W],(t,[e])=>t.geometryType()===e.value],"filter-<":[Q,[W,H],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<n}],"filter-id-<":[Q,[H],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r<i}],"filter->":[Q,[W,H],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[Q,[H],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>i}],"filter-<=":[Q,[W,H],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[Q,[H],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r<=i}],"filter->=":[Q,[W,H],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[Q,[H],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>=i}],"filter-has":[Q,[H],(t,[e])=>{let r=e.value,i=t.properties();return r in i&&i[r]!==void 0}],"filter-has-id":[Q,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[Q,[qt(W)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Q,[qt(H)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Q,[W,qt(H)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Q,[W,qt(H)],(t,[e,r])=>Yg(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Q,overloads:[[[Q,Q],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[br(Q),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:Q,overloads:[[[Q,Q],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[br(Q),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[Q,[Q],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Q,[W],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[W,[W],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[W,[W],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[W,br(H),(t,e)=>e.map(r=>an(r.evaluate(t))).join("")],split:[qt(W),[W,W],(t,[e,r])=>e.evaluate(t).split(r.evaluate(t))],join:[W,[qt(W),W],(t,[e,r])=>e.evaluate(t).join(r.evaluate(t))],"resolved-locale":[W,[es],(t,[e])=>e.evaluate(t).resolvedLocale()]});function Wg(t){return Array.isArray(t)?`(${t.map(bt).join(", ")})`:`(${bt(t.type)}...)`}function Va(t){if(t instanceof Yf)return Va(t.boundExpression);if(t instanceof Vr&&t.name==="error"||t instanceof id||t instanceof yu||t instanceof vu||t instanceof bu)return!1;let e=t instanceof ii||t instanceof Ue,r=!0;return t.eachChild(i=>{r&&=e?Va(i):i instanceof gi}),r?ls(t)&&Pr(t,["zoom","pitch","bearing","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function ls(t){if(t instanceof Vr&&(t.name==="get"&&t.args.length===1||t.name==="feature-state"||t.name==="has"&&t.args.length===1||t.name==="properties"||t.name==="geometry-type"||t.name==="id"||/^filter-/.test(t.name))||t instanceof yu||t instanceof vu)return!1;let e=!0;return t.eachChild(r=>{e&&!ls(r)&&(e=!1)}),e}function yn(t){if(t instanceof Vr&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(r=>{e&&!yn(r)&&(e=!1)}),e}function Pr(t,e){if(t instanceof Vr&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(i=>{r&&!Pr(i,e)&&(r=!1)}),r}function $o(t){return{result:"success",value:t}}function Dr(t){return{result:"error",value:t}}function xi(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}function wd(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function wu(t){return!!t.expression&&t.expression.interpolated}var _u=/^(.*)-transition$/;function q(t){return si(t,Number)?"number":si(t,String)?"string":si(t,Boolean)?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function us(t){return typeof t=="object"&&!!t&&!Array.isArray(t)&&Ft(t)===Cr}function Zg(t){return t}function Hg(t){switch(t.type){case"color":return mt.parse;case"padding":return Ve.parse;case"numberArray":return Re.parse;case"colorArray":return Kt.parse;default:return null}}function Kg(t){switch(t){case"exponential":return Dd;case"interval":return Qg;case"categorical":return Jg;case"identity":return tx;default:throw Error(`Unknown function type "${t}"`)}}function _d(t,e){let r=t.stops&&typeof t.stops[0][0]=="object",i=r||t.property!==void 0,n=r||!i,a=t.type||(wu(e)?"exponential":"interval"),s=Hg(e);if(s&&(t={...t},t.stops&&(t.stops=t.stops.map(c=>[c[0],s(c[1])])),t.default?t.default=s(t.default):t.default=s(e.default)),t.colorSpace&&!Um(t.colorSpace))throw Error(`Unknown color space: "${t.colorSpace}"`);let o=Kg(a),l,u;if(a==="categorical"){l=Object.create(null);for(let c of t.stops)l[c[0]]=c[1];u=typeof t.stops[0][0]}if(r){let c={},h=[];for(let d=0;d<t.stops.length;d++){let y=t.stops[d],m=y[0].zoom;c[m]===void 0&&(c[m]={zoom:m,type:t.type,property:t.property,default:t.default,colorSpace:t.colorSpace,stops:[]},h.push(m)),c[m].stops.push([y[0].value,y[1]])}let p=[];for(let d of h)p.push([c[d].zoom,_d(c[d],e)]);let f={name:"linear"};return{kind:"composite",interpolationType:f,interpolationFactor:pe.interpolationFactor.bind(void 0,f),zoomStops:p.map(d=>d[0]),evaluate({zoom:d},y){return Dd({stops:p,base:t.base,colorSpace:t.colorSpace},e,d).evaluate(d,y)}}}if(n){let c=a==="exponential"?{name:"exponential",base:t.base===void 0?1:t.base}:null;return{kind:"camera",interpolationType:c,interpolationFactor:pe.interpolationFactor.bind(void 0,c),zoomStops:t.stops.map(h=>h[0]),evaluate:({zoom:h})=>o(t,e,h,l,u)}}return{kind:"source",evaluate(c,h){let p=h&&h.properties?h.properties[t.property]:void 0;return p===void 0?zn(t.default,e.default):o(t,e,p,l,u)}}}function zn(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}function Jg(t,e,r,i,n){return zn(typeof r===n?i[r]:void 0,t.default,e.default)}function Qg(t,e,r){if(q(r)!=="number")return zn(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let n=as(t.stops.map(a=>a[0]),r,"");return t.stops[n][1]}function Dd(t,e,r){let i=t.base===void 0?1:t.base;if(q(r)!=="number")return zn(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let a=as(t.stops.map(c=>c[0]),r,""),s=ex(r,i,t.stops[a][0],t.stops[a+1][0]),o=t.stops[a][1],l=t.stops[a+1][1],u=He[e.type]||Zg;return typeof o.evaluate=="function"?{evaluate(...c){let h=o.evaluate.apply(void 0,c),p=l.evaluate.apply(void 0,c);if(h!==void 0&&p!==void 0)return u(h,p,s,t.colorSpace)}}:u(o,l,s,t.colorSpace)}function tx(t,e,r){switch(e.type){case"color":r=mt.parse(r);break;case"formatted":r=Ze.fromString(r.toString());break;case"resolvedImage":r=Oe.fromString(r.toString());break;case"padding":r=Ve.parse(r);break;case"colorArray":r=Kt.parse(r);break;case"numberArray":r=Re.parse(r);break;default:q(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return zn(r,t.default,e.default)}function ex(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}var Du=class{constructor(t,e,r,i){this.expression=t,this._warningHistory={},this._evaluator=new jf,this._defaultValue=r?Cd(r):null,this._enumValues=r&&r.type==="enum"?r.values:null,this._globalState=i,this._rootKey=e}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=vi(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,i,n,a){this._globalState&&(t=vi(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s=="number"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new xt(`Expected value to be one of ${Object.keys(this._enumValues).map(o=>JSON.stringify(o)).join(", ")}, but found ${JSON.stringify(s)} instead.`,"");return s}catch(s){let o=s instanceof xt?s.path:"",l=`${o}|${s.message}`;return this._warningHistory[l]||(this._warningHistory[l]=!0,typeof console<"u"&&console.warn(Sd(this._rootKey,o,s.message,this._defaultValue))),this._defaultValue}}};function Sd(t,e,r,i){return`${t}${e}: ${r}${i==null?"":` Falling back to ${String(i)}.`}`}function Ad(t){if(!t)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".')}function cs(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&zt(oi,t[0])!==void 0}function Br(t,e,r,i){Ad(e);let n=new Uf(oi,Va,[],r?nx(r):void 0),a=n.parse(t,void 0,void 0,void 0,r&&r.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?$o(new Du(a,e,r,i)):Dr(n.errors)}var mn=class{constructor(t,e,r){this.kind=t,this._styleExpression=e,this.isStateDependent=t!=="constant"&&!yn(e.expression),this.globalStateRefs=Ln(e.expression),this._globalState=r}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=vi(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=vi(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}},Ra=class{constructor(t,e,r,i,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent=t!=="camera"&&!yn(e.expression),this.globalStateRefs=Ln(e.expression),this.interpolationType=i,this._globalState=n}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=vi(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=vi(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}interpolationFactor(t,e,r){return this.interpolationType?pe.interpolationFactor(this.interpolationType,t,e,r):0}};function rx(t){return t._styleExpression!==void 0}function Ed(t,e,r,i){let n=Br(t,e,r,i);if(n.result==="error")return n;let a=n.value.expression,s=ls(a);if(!s&&!xi(r))return Dr([new Se("","data expressions not supported")]);let o=Pr(a,["zoom"]);if(!o&&!wd(r))return Dr([new Se("","zoom expressions not supported")]);if(!Pr(a,["pitch","bearing"]))return Dr([new Se("",'"pitch" and "bearing" expressions are only supported in symbol layer filters.')]);let l=Ta(a);if(!l&&!o)return Dr([new Se("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof Se)return Dr([l]);if(l instanceof pe&&!wu(r))return Dr([new Se("",'"interpolate" expressions cannot be used with this property')]);if(!l)return $o(s?new mn("constant",n.value,i):new mn("source",n.value,i));let u=l instanceof pe?l.interpolation:void 0;return $o(s?new Ra("camera",n.value,l.labels,u,i):new Ra("composite",n.value,l.labels,u,i))}var Td=class Fd{constructor(e,r,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,Ad(r),this._parameters=e,this._specification=i,this._rootKey=r,this._defaultValue=Cd(i),this._warningHistory={};let n=_d(this._parameters,this._specification);this.kind=n.kind,this.interpolationFactor=n.interpolationFactor,this.zoomStops=n.zoomStops,this.interpolationType=n.interpolationType,this._innerEvaluate=n.evaluate}evaluate(e,r){try{return this._innerEvaluate(e,r)}catch(i){let n=i instanceof Error?i.message:String(i),a=`|${n}`;return this._warningHistory[a]||(this._warningHistory[a]=!0,typeof console<"u"&&console.warn(Sd(this._rootKey,"",n,this._defaultValue))),this._defaultValue}}static deserialize(e){return new Fd(e._parameters,e._rootKey,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification,_rootKey:e._rootKey}}};function ix(t,e,r,i){if(us(t))return new Td(t,e,r);if(cs(t)){let n=Ed(t,e,r,i);if(n.result==="error")throw Error(n.value.map(a=>`${a.key}: ${a.message}`).join(", "));return n.value}{let n=t;return r.type==="color"&&typeof t=="string"?n=mt.parse(t):r.type==="padding"&&(typeof t=="number"||Array.isArray(t))?n=Ve.parse(t):r.type==="numberArray"&&(typeof t=="number"||Array.isArray(t))?n=Re.parse(t):r.type==="colorArray"&&(typeof t=="string"||Array.isArray(t))?n=Kt.parse(t):r.type==="variableAnchorOffsetCollection"&&Array.isArray(t)?n=Le.parse(t):r.type==="projectionDefinition"&&typeof t=="string"&&(n=Or.parse(t)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>n}}}function Ta(t,e=new Map){if(e.has(t))return e.get(t);let r=null;if(t instanceof Gf)r=Ta(t.result,e);else if(t instanceof td){for(let i of t.args)if(r=Ta(i,e),r)break}else(t instanceof pu||t instanceof pe)&&t.input instanceof Vr&&t.input.name==="zoom"&&(r=t);return r instanceof Se?(e.set(t,r),r):(t.eachChild(i=>{let n=Ta(i,e);n instanceof Se?r=n:!r&&n?r=new Se("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new Se("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e.set(t,r),r)}function Ln(t,e=new Set){return t instanceof bu&&e.add(t.key),t.eachChild(r=>{Ln(r,e)}),e}function nx(t){let e={color:Ae,string:W,number:M,enum:W,boolean:Q,formatted:Mn,padding:rs,numberArray:is,colorArray:pn,projectionDefinition:ts,resolvedImage:Pn,variableAnchorOffsetCollection:ns};return t.type==="array"?qt(e[t.value]||H,t.length):e[t.type]}function Cd(t){if(t.type==="color"&&us(t.default))return new mt(0,0,0,0);switch(t.type){case"color":return mt.parse(t.default)||null;case"padding":return Ve.parse(t.default)||null;case"numberArray":return Re.parse(t.default)||null;case"colorArray":return Kt.parse(t.default)||null;case"variableAnchorOffsetCollection":return Le.parse(t.default)||null;case"projectionDefinition":return Or.parse(t.default)||null;default:return t.default===void 0?null:t.default}}function vi(t,e){let{zoom:r,pitch:i,bearing:n,heatmapDensity:a,elevation:s,lineProgress:o,isSupportedScript:l,accumulated:u}=t??{};return{zoom:r,pitch:i,bearing:n,heatmapDensity:a,elevation:s,lineProgress:o,isSupportedScript:l,accumulated:u,globalState:e}}function ax(t){let e=!1;for(let r of t){let i=Id(r);if(i==="expression")return"expression";i==="legacy"&&(e=!0)}return e?"legacy":"neutral"}function Id(t){if(typeof t=="boolean")return"neutral";if(!Array.isArray(t)||t.length===0)return"legacy";switch(t[0]){case"has":return t.length<2||t[1]==="$id"||t[1]==="$type"?"legacy":t.length===2?"neutral":"expression";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]))?"expression":"legacy";case"!in":case"!has":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2])?"expression":"legacy";case"none":return"legacy";case"any":case"all":return ax(t.slice(1));default:return"expression"}}function Su(t){return Id(t)!=="legacy"}function ph(t){return t==="$type"?["geometry-type"]:t==="$id"?["id"]:["get",t]}function sx(t){switch(t[0]){case"==":case"!=":case"<":case"<=":case">":case">=":return t.length!==3||typeof t[1]!="string"?null:[t[0],ph(t[1]),t[2]];case"in":case"!in":{if(t.length<2||typeof t[1]!="string")return null;let e=["in",ph(t[1]),["literal",t.slice(2)]];return t[0]==="!in"?["!",e]:e}case"has":case"!has":{if(t.length!==2||typeof t[1]!="string"||t[1]==="$type"||t[1]==="$id")return null;let e=["has",t[1]];return t[0]==="!has"?["!",e]:e}default:return null}}function kd(t){if((t[0]==="<"||t[0]==="<="||t[0]===">"||t[0]===">=")&&t[1]==="$type")return`"$type" cannot be use with operator "${t[0]}"`;let e=sx(t);return e?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(t)} with ${JSON.stringify(e)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(t)} to expression syntax.`}function eo(t,e,r){let i=r[t];return Array.isArray(i)?Su(i)?Au(i,e.concat(t)):{path:e.concat(t),legacyFilter:i}:null}function Au(t,e=[]){if(!Array.isArray(t)||t.length<1)return null;switch(t[0]){case"all":case"any":case"none":for(let r=1;r<t.length;r++){let i=eo(r,e,t);if(i)return i}break;case"!":{let r=eo(1,e,t);if(r)return r;break}case"case":for(let r=1;r<t.length-1;r+=2){let i=eo(r,e,t);if(i)return i}}return null}function ox(t,e){let r=Au(t);if(!r||typeof console>"u")return;let i=r.path.map(n=>`[${n}]`).join("");console.warn(`${e}${i}: ${kd(r.legacyFilter)}`)}var lx={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","bearing"]}};function gn(t,e,r){if(t==null)return{filter:()=>!0,needGeometry:!1,needCamera:!1,getGlobalStateRefs:()=>new Set};Su(t)?ox(t,e):t=$a(t);let i=Br(t,e,lx,r);if(i.result==="error")throw Error(i.value.map(n=>`${n.key}: ${n.message}`).join(", "));return{filter:(n,a,s)=>i.value.evaluate(n,a,{},s),needGeometry:Md(t),needCamera:!Pr(i.value.expression,["pitch","bearing"]),getGlobalStateRefs:()=>Ln(i.value.expression)}}function ux(t,e){return t<e?-1:+(t>e)}function Md(t){if(!Array.isArray(t))return!1;if(t[0]==="within"||t[0]==="distance")return!0;for(let e=1;e<t.length;e++)if(Md(t[e]))return!0;return!1}function $a(t){if(!t)return!0;let e=t[0];return t.length<=1?e!=="any":e==="=="?ro(t[1],t[2],"=="):e==="!="?ua(ro(t[1],t[2],"==")):e==="<"||e===">"||e==="<="||e===">="?ro(t[1],t[2],e):e==="any"?cx(t.slice(1)):e==="all"?["all"].concat(t.slice(1).map($a)):e==="none"?["all"].concat(t.slice(1).map($a).map(ua)):e==="in"?fh(t[1],t.slice(2)):e==="!in"?ua(fh(t[1],t.slice(2))):e==="has"?dh(t[1]):e!=="!has"||ua(dh(t[1]))}function ro(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function cx(t){return["any"].concat(t.map($a))}function fh(t,e){if(e.length===0)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",t,["literal",e.sort(ux)]]:["filter-in-small",t,["literal",e]]}}function dh(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function ua(t){return["!",t]}function No(t){let e=typeof t;if(e==="number"||e==="boolean"||e==="string"||t==null)return JSON.stringify(t);if(Array.isArray(t)){let n="[";for(let a of t)n+=`${No(a)},`;return`${n}]`}let r=Object.keys(t).sort(),i="{";for(let n=0;n<r.length;n++)i+=`${JSON.stringify(r[n])}:${No(t[r[n]])},`;return`${i}}`}function hx(t){let e="";for(let r of vm)e+=`/${No(t[r])}`;return e}function px(t,e){let r={};for(let n=0;n<t.length;n++){let a=e&&e[t[n].id]||hx(t[n]);e&&(e[t[n].id]=a);let s=r[a];s||=r[a]=[],s.push(t[n])}let i=[];for(let n in r)i.push(r[n]);return i}function Pd(t){let e=t.key,r=t.value;return r?[new T(e,r,"constants have been deprecated as of v8")]:[]}function ne(t){let e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},a=t.style,s=t.styleSpec,o=t.validateSpec,l=[],u=q(r);if(u!=="object")return[new T(e,r,`object expected, ${u} found`)];for(let c in r){let h=c.split(".")[0],p=zt(i,h)||i["*"],f;if(zt(n,h))f=n[h];else if(zt(i,h)){if(r[c]===void 0)continue;f=o}else if(n["*"])f=n["*"];else if(i["*"])f=o;else{l.push(new T(e,r[c],`unknown property "${c}"`));continue}l=l.concat(f({key:(e&&`${e}.`)+c,value:r[c],valueSpec:p,style:a,styleSpec:s,object:r,objectKey:c,validateSpec:o},r))}for(let c in i)n[c]||i[c].required&&i[c].default===void 0&&r[c]===void 0&&l.push(new T(e,r,`missing required property "${c}"`));return l}function Eu(t){let e=t.value,r=t.valueSpec,i=t.validateSpec,n=t.style,a=t.styleSpec,s=t.key,o=t.arrayElementValidator||i;if(q(e)!=="array")return[new T(s,e,`array expected, ${q(e)} found`)];if(r.length&&e.length!==r.length)return[new T(s,e,`array length ${r.length} expected, length ${e.length} found`)];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),q(r.value)==="object"&&(l=r.value);let u=[];for(let c=0;c<e.length;c++)u=u.concat(o({array:e,arrayIndex:c,value:e[c],valueSpec:l,validateSpec:t.validateSpec,style:n,styleSpec:a,key:`${s}[${c}]`}));return u}function hs(t){let e=t.key,r=t.value,i=t.valueSpec,n=q(r);return n==="number"&&r!==r&&(n="NaN"),n==="number"?"minimum"in i&&r<i.minimum?[new T(e,r,`${r} is less than the minimum value ${i.minimum}`)]:"maximum"in i&&r>i.maximum?[new T(e,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]:[new T(e,r,`number expected, ${n} found`)]}function Bd(t){let e=t.valueSpec,r=Dt(t.value.type),i,n={},a,s,o=r!=="categorical"&&t.value.property===void 0,l=!o,u=q(t.value.stops)==="array"&&q(t.value.stops[0])==="array"&&q(t.value.stops[0][0])==="object",c=ne({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:h,default:d}});return r==="identity"&&o&&c.push(new T(t.key,t.value,'missing required property "property"')),r!=="identity"&&!t.value.stops&&c.push(new T(t.key,t.value,'missing required property "stops"')),r==="exponential"&&t.valueSpec.expression&&!wu(t.valueSpec)&&c.push(new T(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!xi(t.valueSpec)?c.push(new T(t.key,t.value,"property functions not supported")):o&&!wd(t.valueSpec)&&c.push(new T(t.key,t.value,"zoom functions not supported"))),(r==="categorical"||u)&&t.value.property===void 0&&c.push(new T(t.key,t.value,'"property" property is required')),c;function h(y){if(r==="identity")return[new T(y.key,y.value,'identity function may not have a "stops" property')];let m=[],g=y.value;return m=m.concat(Eu({key:y.key,value:g,valueSpec:y.valueSpec,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,arrayElementValidator:p})),q(g)==="array"&&g.length===0&&m.push(new T(y.key,g,"array must have at least one stop")),m}function p(y){let m=[],g=y.value,x=y.key;if(q(g)!=="array")return[new T(x,g,`array expected, ${q(g)} found`)];if(g.length!==2)return[new T(x,g,`array length 2 expected, length ${g.length} found`)];if(u){if(q(g[0])!=="object")return[new T(x,g,`object expected, ${q(g[0])} found`)];if(g[0].zoom===void 0)return[new T(x,g,"object stop key must have zoom")];if(g[0].value===void 0)return[new T(x,g,"object stop key must have value")];if(q(g[0].zoom)!=="number")return[new T(`${x}[0].zoom`,g[0].zoom,`number expected, ${q(g[0].zoom)} found`)];if(s&&s>Dt(g[0].zoom))return[new T(x,g[0].zoom,"stop zoom values must appear in ascending order")];Dt(g[0].zoom)!==s&&(s=Dt(g[0].zoom),a=void 0,n={}),m=m.concat(ne({key:`${x}[0]`,value:g[0],valueSpec:{zoom:{}},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,objectElementValidators:{zoom:hs,value:f}}))}else m=m.concat(f({key:`${x}[0]`,value:g[0],valueSpec:{},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec},g));return cs(Mr(g[1]))?m.concat([new T(`${x}[1]`,g[1],"expressions are not allowed in function stops.")]):m.concat(y.validateSpec({key:`${x}[1]`,value:g[1],valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec}))}function f(y,m){let g=q(y.value),x=Dt(y.value),v=y.value===null?m:y.value;if(!i)i=g;else if(g!==i)return[new T(y.key,v,`${g} stop domain type must match previous stop domain type ${i}`)];if(g!=="number"&&g!=="string"&&g!=="boolean")return[new T(y.key,v,"stop domain value must be a number, string, or boolean")];if(g!=="number"&&r!=="categorical"){let b=`number expected, ${g} found`;return xi(e)&&r===void 0&&(b+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new T(y.key,v,b)]}return r==="categorical"&&g==="number"&&(!isFinite(x)||Math.floor(x)!==x)?[new T(y.key,v,`integer expected, found ${x}`)]:r!=="categorical"&&g==="number"&&a!==void 0&&x<a?[new T(y.key,v,"stop domain values must appear in ascending order")]:(a=x,r==="categorical"&&x in n?[new T(y.key,v,"stop domain values must be unique")]:(n[x]=!0,[]))}function d(y){return y.validateSpec({key:y.key,value:y.value,valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec})}}function bi(t){let e=(t.expressionContext==="property"?Ed:Br)(Mr(t.value),t.key,t.valueSpec);if(e.result==="error")return e.value.map(i=>new T(`${t.key}${i.key}`,t.value,i.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!r.outputDefined())return[new T(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!yn(r))return[new T(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter"&&!yn(r))return[new T(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if((t.expressionContext!=="filter"||t.layerType!=="symbol")&&!Pr(r,["pitch","bearing"]))return[new T(t.key,t.value,'"pitch" and "bearing" expressions are only supported in symbol layer filters.')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!Pr(r,["zoom","feature-state"]))return[new T(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!ls(r))return[new T(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function fx(t){let e=t.value,r=t.key,i=q(e);return i==="boolean"?[]:[new T(r,e,`boolean expected, ${i} found`)]}function jo(t){let e=t.key,r=t.value,i=q(r);return i==="string"?mt.parse(String(r))?[]:[new T(e,r,`color expected, "${r}" found`)]:[new T(e,r,`color expected, ${i} found`)]}function xn(t){let e=t.key,r=t.value,i=t.valueSpec,n=[];return Array.isArray(i.values)?i.values.indexOf(Dt(r))===-1&&n.push(new T(e,r,`expected one of [${i.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(i.values).indexOf(Dt(r))===-1&&n.push(new T(e,r,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(r)} found`)),n}function dx(t,e){let r=t;for(let i of e)r=r[i];return r}function yx(t,e){let r=Au(e);return r?[new T(`${t.key}${r.path.map(i=>`[${i}]`).join("")}`,dx(t.value,r.path),kd(r.legacyFilter),null,"warning")]:[]}function Tu(t){let e=Mr(t.value);return Su(e)?[...yx(t,e),...bi({...t,expressionContext:"filter",valueSpec:{value:"boolean"}})]:zd(t)}function zd(t){let e=t.value,r=t.key;if(q(e)!=="array")return[new T(r,e,`array expected, ${q(e)} found`)];let i=t.styleSpec,n,a=[];if(e.length<1)return[new T(r,e,"filter array must have at least 1 element")];switch(a=a.concat(xn({key:`${r}[0]`,value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),Dt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Dt(e[1])==="$type"&&a.push(new T(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&a.push(new T(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(n=q(e[1]),n!=="string"&&a.push(new T(`${r}[1]`,e[1],`string expected, ${n} found`)));for(let s=2;s<e.length;s++)n=q(e[s]),Dt(e[1])==="$type"?a=a.concat(xn({key:`${r}[${s}]`,value:e[s],valueSpec:i.geometry_type,style:t.style,styleSpec:t.styleSpec})):n!=="string"&&n!=="number"&&n!=="boolean"&&a.push(new T(`${r}[${s}]`,e[s],`string, number, or boolean expected, ${n} found`));break;case"any":case"all":case"none":for(let s=1;s<e.length;s++)a=a.concat(zd({key:`${r}[${s}]`,value:e[s],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":n=q(e[1]),e.length===2?n!=="string"&&a.push(new T(`${r}[1]`,e[1],`string expected, ${n} found`)):a.push(new T(r,e,`filter array for "${e[0]}" operator must have 2 elements`))}return a}function Ld(t,e){let r=t.key,i=t.validateSpec,n=t.style,a=t.styleSpec,s=t.value,o=t.objectKey,l=typeof t.layerType=="string"?zt(a,`${e}_${t.layerType}`):void 0;if(!l)return[];let u=o.match(_u);if(e==="paint"&&u&&zt(l,u[1])?.transition)return i({key:r,value:s,valueSpec:a.transition,style:n,styleSpec:a});let c=t.valueSpec||zt(l,o);if(!c)return[new T(r,s,`unknown property "${o}"`)];let h;if(q(s)==="string"&&xi(c)&&!c.tokens&&(h=/^{([^}]+)}$/.exec(s)))return[new T(r,s,`"${o}" does not support interpolation syntax
12
+ Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(h[1])} }\`.`)];let p=[];return t.layerType==="symbol"&&o==="text-font"&&us(Mr(s))&&Dt(s.type)==="identity"&&p.push(new T(r,s,'"text-font" does not support identity functions')),p.concat(i({key:t.key,value:s,valueSpec:c,style:n,styleSpec:a,expressionContext:"property",propertyType:e,propertyKey:o}))}function Od(t){return Ld(t,"paint")}function Vd(t){return Ld(t,"layout")}function Rd(t){let e=[],r=t.value,i=t.key,n=t.style,a=t.styleSpec;if(q(r)!=="object")return[new T(i,r,`object expected, ${q(r)} found`)];!r.type&&!r.ref&&e.push(new T(i,r,'either "type" or "ref" is required'));let s=Dt(r.type),o=Dt(r.ref);if(r.id){let l=Dt(r.id);for(let u=0;u<t.arrayIndex;u++){let c=n.layers[u];q(c)==="object"&&Dt(c.id)===l&&e.push(new T(i,r.id,`duplicate layer id "${_e(r.id)}", previously used at line ${c.id.__line__}`))}}if("ref"in r){["type","source","source-layer","filter","layout"].forEach(u=>{u in r&&e.push(new T(i,r[u],`"${u}" is prohibited for ref layers`))});let l;n.layers.forEach(u=>{q(u)==="object"&&Dt(u.id)===o&&(l=u)}),l?l.ref?e.push(new T(i,r.ref,"ref cannot reference another ref layer")):s=Dt(l.type):e.push(new T(i,r.ref,`ref layer "${_e(o)}" not found`))}else if(s!=="background")if(!r.source)e.push(new T(i,r,'missing required property "source"'));else{let l=_e(r.source),u=n.sources&&zt(n.sources,l),c=u&&Dt(u.type);u?c==="vector"&&s==="raster"?e.push(new T(i,r.source,`layer "${_e(r.id)}" requires a raster source`)):c!=="raster-dem"&&s==="hillshade"||c!=="raster-dem"&&s==="color-relief"?e.push(new T(i,r.source,`layer "${_e(r.id)}" requires a raster-dem source`)):c==="raster"&&s!=="raster"?e.push(new T(i,r.source,`layer "${_e(r.id)}" requires a vector source`)):c==="vector"&&!r["source-layer"]?e.push(new T(i,r,`layer "${_e(r.id)}" must specify a "source-layer"`)):c==="raster-dem"&&s!=="hillshade"&&s!=="color-relief"?e.push(new T(i,r.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):s==="line"&&r.paint&&r.paint["line-gradient"]&&(c!=="geojson"||!u.lineMetrics)&&e.push(new T(i,r,`layer "${_e(r.id)}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new T(i,r.source,`source "${l}" not found`))}return s==="raster"&&r.paint?.resampling&&r.paint?.["raster-resampling"]&&e.push(new T(i,r.paint,`layer "${_e(r.id)}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),e=e.concat(ne({key:i,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*"(){return[]},type(){return t.validateSpec({key:`${i}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"})},filter(l){return Tu({layerType:s,...l})},layout(l){return ne({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return Vd({layerType:s,...u})}}})},paint(l){return ne({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return Od({layerType:s,...u})}}})}}})),e}function gr(t){let e=t.value,r=t.key,i=q(e);return i==="string"?[]:[new T(r,e,`string expected, ${i} found`)]}function mx(t){let e=t.sourceName??"",r=t.value,i=t.styleSpec,n=i.source_raster_dem,a=t.style,s=[],o=q(r);if(r===void 0)return s;if(o!=="object")return s.push(new T("source_raster_dem",r,`object expected, ${o} found`)),s;let l=Dt(r.encoding)==="custom",u=["redFactor","greenFactor","blueFactor","baseShift"],c=t.value.encoding?`"${_e(t.value.encoding)}"`:"Default";for(let h in r)!l&&u.includes(h)?s.push(new T(h,r[h],`In "${e}": "${h}" is only valid when "encoding" is set to "custom". ${c} encoding found`)):zt(n,h)?s=s.concat(t.validateSpec({key:h,value:r[h],valueSpec:n[h],validateSpec:t.validateSpec,style:a,styleSpec:i})):s.push(new T(h,r[h],`unknown property "${h}"`));return s}var yh={promoteId:gx};function $d(t){let e=t.value,r=t.key,i=t.styleSpec,n=t.style,a=t.validateSpec;if(q(e)!=="object")return[new T(r,e,`object expected, ${q(e)} found`)];if(!e.type)return[new T(r,e,'"type" is required')];let s=Dt(e.type),o;switch(s){case"vector":case"raster":return o=ne({key:r,value:e,valueSpec:i[`source_${s.replace("-","_")}`],style:t.style,styleSpec:i,objectElementValidators:yh,validateSpec:a}),o;case"raster-dem":return o=mx({sourceName:r,value:e,style:t.style,styleSpec:i,validateSpec:a}),o;case"geojson":if(o=ne({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:yh}),e.cluster&&e.clusterProperties!==void 0){if(q(e.clusterProperties)!=="object")return o.push(new T(`${r}.clusterProperties`,e.clusterProperties,`object expected, ${q(e.clusterProperties)} found`)),o;for(let l in e.clusterProperties){let u=e.clusterProperties[l];if(q(u)!=="array"){o.push(new T(`${r}.${l}`,u,`array expected, ${q(u)} found`));continue}let[c,h]=u,p=typeof c=="string"?[c,["accumulated"],["get",l]]:c;o.push(...bi({key:`${r}.${l}.map`,value:h,validateSpec:a,expressionContext:"cluster-map"})),o.push(...bi({key:`${r}.${l}.reduce`,value:p,validateSpec:a,expressionContext:"cluster-reduce"}))}}return o;case"video":return ne({key:r,value:e,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case"image":return ne({key:r,value:e,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case"canvas":return[new T(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return xn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,validateSpec:a,styleSpec:i})}}function gx({key:t,value:e}){if(q(e)==="string")return gr({key:t,value:e});{let r=[];for(let i in e)r.push(...gr({key:`${t}.${i}`,value:e[i]}));return r}}function Nd(t){let e=t.value,r=t.styleSpec,i=r.light,n=t.style,a=[],s=q(e);if(e===void 0)return a;if(s!=="object")return a=a.concat([new T("light",e,`object expected, ${s} found`)]),a;for(let o in e){let l=o.match(_u);a=l&&zt(i,l[1])?.transition?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,validateSpec:t.validateSpec,style:n,styleSpec:r})):zt(i,o)?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new T(o,e[o],`unknown property "${o}"`)])}return a}function jd(t){let e=t.value,r=t.styleSpec,i=r.sky,n=t.style,a=q(e);if(e===void 0)return[];if(a!=="object")return[new T("sky",e,`object expected, ${a} found`)];let s=[];for(let o in e){let l=o.match(_u);s=l&&zt(i,l[1])?.transition?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,style:n,styleSpec:r})):zt(i,o)?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],style:n,styleSpec:r})):s.concat([new T(o,e[o],`unknown property "${o}"`)])}return s}function Ud(t){let e=t.value,r=t.styleSpec,i=r.terrain,n=t.style,a=[],s=q(e);if(e===void 0)return a;if(s!=="object")return a=a.concat([new T("terrain",e,`object expected, ${s} found`)]),a;for(let o in e)a=zt(i,o)?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new T(o,e[o],`unknown property "${o}"`)]);return a}function xx(t){return gr(t).length===0?[]:bi(t)}function vx(t){return gr(t).length===0?[]:bi(t)}function bx(t){let e=t.key,r=t.value;if(q(r)==="array"){if(r.length<1||r.length>4)return[new T(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:"number"},n=[];for(let a=0;a<r.length;a++)n=n.concat(t.validateSpec({key:`${e}[${a}]`,value:r[a],validateSpec:t.validateSpec,valueSpec:i}));return n}return hs({key:e,value:r,valueSpec:{}})}function wx(t){let e=t.key,r=t.value;if(q(r)==="array"){let i={type:"number"};if(r.length<1)return[new T(e,r,"array length at least 1 expected, length 0 found")];let n=[];for(let a=0;a<r.length;a++)n=n.concat(t.validateSpec({key:`${e}[${a}]`,value:r[a],validateSpec:t.validateSpec,valueSpec:i}));return n}return hs({key:e,value:r,valueSpec:{}})}function _x(t){let e=t.key,r=t.value;if(q(r)==="array"){if(r.length<1)return[new T(e,r,"array length at least 1 expected, length 0 found")];let i=[];for(let n=0;n<r.length;n++)i=i.concat(jo({key:`${e}[${n}]`,value:r[n],valueSpec:{}}));return i}return jo({key:e,value:r,valueSpec:{}})}function Dx(t){let e=t.key,r=t.value,i=q(r),n=t.styleSpec;if(i!=="array"||r.length<1||r.length%2!=0)return[new T(e,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let s=0;s<r.length;s+=2)a=a.concat(xn({key:`${e}[${s}]`,value:r[s],valueSpec:n.layout_symbol["text-anchor"]})),a=a.concat(Eu({key:`${e}[${s+1}]`,value:r[s+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:n}));return a}function qd(t){let e=[],r=t.value,i=t.key;if(Array.isArray(r)){let n=[],a=[];for(let s in r)q(r[s])==="object"?(r[s].id&&n.includes(r[s].id)&&e.push(new T(i,r,`all the sprites' ids must be unique, but ${r[s].id} is duplicated`)),n.push(r[s].id),r[s].url&&a.includes(r[s].url)&&e.push(new T(i,r,`all the sprites' URLs must be unique, but ${r[s].url} is duplicated`)),a.push(r[s].url),e=e.concat(ne({key:`${i}[${s}]`,value:r[s],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:t.validateSpec}))):e.push(new T(`${i}[${s}]`,r[s],`object expected, ${q(r[s])} found`));return e}return gr({key:i,value:r})}function Sx(t){let e=t.value,r=t.styleSpec,i=r.projection,n=t.style,a=q(e);if(e===void 0)return[];if(a!=="object")return[new T("projection",e,`object expected, ${a} found`)];let s=[];for(let o in e)s=zt(i,o)?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],style:n,styleSpec:r})):s.concat([new T(o,e[o],`unknown property "${o}"`)]);return s}function Ax(t){let e=t.key,r=t.value;r=r instanceof String?r.valueOf():r;let i=q(r);return i==="array"&&!Tx(r)&&!Ex(r)?[new T(e,r,`projection expected, invalid array ${JSON.stringify(r)} found`)]:["array","string"].includes(i)?[]:[new T(e,r,`projection expected, invalid type "${i}" found`)]}function Ex(t){return!!["interpolate","step","literal"].includes(t[0])}function Tx(t){return Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number"}function Uo(t){return!!t&&t.constructor===Object}function Gd(t){return Uo(t.value)?[]:[new T(t.key,t.value,`object expected, ${q(t.value)} found`)]}var mh=1114111,Fx=/^u\+(?:([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?|([0-9a-f]{0,5}\?{1,6}))$/i;function Cx(t,e){if(q(e)!=="string")return[];let r=`${e}`,i=()=>[new T(t,e,'invalid unicode range, expected a value such as "U+26", "U+0-10FFFF" or "U+4??"')],n=r.match(Fx);if(!n)return i();let[,a,s,o]=n;if(o!==void 0)return o.length>6?i():[];let l=parseInt(a,16),u=s===void 0?l:parseInt(s,16);return l>mh||u>mh?[new T(t,e,"unicode range is out of bounds, the maximum code point is U+10FFFF")]:l>u?[new T(t,e,`unicode range start must not be greater than its end, but ${r} is`)]:[]}function Xd(t){let e=t.key??"font-faces",r=t.value,i=t.validateSpec,n=t.styleSpec??Sf,a=t.style;if(!Uo(r))return[new T(e,r,`object expected, ${q(r)} found`)];let s=[];for(let o in r){let l=r[o],u=q(l);if(u==="string")s.push(...gr({key:`${e}.${o}`,value:l}));else if(u==="array"){let c={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[h,p]of l.entries()){let f=`${e}.${o}[${h}]`;s.push(...ne({key:f,value:p,valueSpec:c,styleSpec:n,style:a,validateSpec:i}));let d=Uo(p)?p["unicode-range"]:void 0;if(q(d)==="array")for(let[y,m]of d.entries())s.push(...Cx(`${f}.unicode-range[${y}]`,m))}}else s.push(new T(`${e}.${o}`,l,`string or array expected, ${u} found`))}return s}var gh={"*"(){return[]},array:Eu,boolean:fx,number:hs,color:jo,constants:Pd,enum:xn,filter:Tu,function:Bd,layer:Rd,object:ne,source:$d,light:Nd,sky:jd,terrain:Ud,projection:Sx,projectionDefinition:Ax,string:gr,formatted:xx,resolvedImage:vx,padding:bx,numberArray:wx,colorArray:_x,variableAnchorOffsetCollection:Dx,sprite:qd,state:Gd,fontFaces:Xd};function sn(t){let e=t.value,r=t.valueSpec,i=t.styleSpec;return t.validateSpec=sn,r.expression&&us(Dt(e))?Bd(t):r.expression&&cs(Mr(e))?bi(t):r.type&&gh[r.type]?gh[r.type](t):ne({...t,valueSpec:r.type?i[r.type]:r})}function Yd(t){let e=t.value,r=t.key,i=gr(t);return i.length||(e.indexOf("{fontstack}")===-1&&i.push(new T(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&i.push(new T(r,e,'"glyphs" url must include a "{range}" token'))),i}function ee(t,e=S){let r=[];return r=r.concat(sn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:sn,objectElementValidators:{glyphs:Yd,"*"(){return[]}}})),t?.constants&&(r=r.concat(Pd({key:"constants",value:t.constants,style:t,styleSpec:e,validateSpec:sn}))),Wd(r)}ee.source=ue(le($d)),ee.sprite=ue(le(qd)),ee.glyphs=ue(le(Yd)),ee.fontFaces=ue(le(Xd)),ee.light=ue(le(Nd)),ee.sky=ue(le(jd)),ee.terrain=ue(le(Ud)),ee.state=ue(le(Gd)),ee.layer=ue(le(Rd)),ee.filter=ue(le(Tu)),ee.paintProperty=ue(le(Od)),ee.layoutProperty=ue(le(Vd));function le(t){return function(e){return t(Object.assign({},e,{validateSpec:sn}))}}function Wd(t){return[].concat(t).sort((e,r)=>e.line-r.line)}function ue(t){return function(...e){return Wd(t.apply(this,e))}}var Ix={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"},kx=class{constructor(t,e,r){this._rootKey=e,this._globalState=r,this.setValue(t)}evaluate(){return this._literalValue??this._compiledValue.evaluate({})}setValue(t){if(t==null||t==="visible"||t==="none"){this._literalValue=t==="none"?"none":"visible",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let e=Br(t,this._rootKey,Ix,this._globalState);if(e.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));this._literalValue=void 0,this._compiledValue=e.value,this._globalStateRefs=Ln(e.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};function Mx(t,e,r){return new kx(t,e,r)}var Fu={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Px(t){return Fu.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}function Bx(t,e){Fu.REGISTERED_PROTOCOLS[t]=e}function zx(t){delete Fu.REGISTERED_PROTOCOLS[t]}var xh="global-dispatcher",Na=class extends Error{constructor(t,e,r,i){super(`AJAXError: ${e} (${t}): ${r}`),this.status=t,this.statusText=e,this.url=r,this.body=i}};function Zd(){if(fi(self))return self.worker?.referrer;if(window.location.protocol==="blob:")try{return window.parent.location.href}catch{}return window.location.href}var Lx=t=>t.startsWith("file:")||Zd()?.startsWith("file:")&&!/^\w+:/.test(t);async function Ox(t,e){let r=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:Zd(),referrerPolicy:t.referrerPolicy,signal:e.signal});t.type==="json"&&!r.headers.has("Accept")&&r.headers.set("Accept","application/json");let i;try{i=await fetch(r)}catch(s){throw _f(s)?s:new Na(0,Ma(s).message,t.url,new Blob)}if(!i.ok){let s=await i.blob();throw new Na(i.status,i.statusText,t.url,s)}let n;n=t.type==="arrayBuffer"||t.type==="image"?i.arrayBuffer():t.type==="json"?i.json():i.text();let a=await n;return xm(e.signal),{data:a,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),etag:i.headers.get("ETag")}}function Vx(t,e){return new Promise((r,i)=>{let n=new XMLHttpRequest;n.open(t.method||"GET",t.url,!0),(t.type==="arrayBuffer"||t.type==="image")&&(n.responseType="arraybuffer");for(let a in t.headers)n.setRequestHeader(a,t.headers[a]);t.type==="json"&&(n.responseType="text",t.headers?.Accept||n.setRequestHeader("Accept","application/json")),n.withCredentials=t.credentials==="include",n.onerror=()=>{i(Error(n.statusText))},n.onload=()=>{if(!e.signal.aborted)if((n.status>=200&&n.status<300||n.status===0)&&n.response!==null){let a=n.response;if(t.type==="json")try{a=JSON.parse(n.response)}catch(s){i(s);return}r({data:a,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires"),etag:n.getResponseHeader("ETag")})}else{let a=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});i(new Na(n.status,n.statusText,t.url,a))}},e.signal.addEventListener("abort",()=>{n.abort(),i(new su(e.signal.reason))}),n.send(t.body)})}var Cu=async function(t,e){if(t.url.includes("://")&&!/^https?:|^file:/.test(t.url)){let r=Px(t.url);if(r){let i=await r(t,e);return!i.data&&t.type==="arrayBuffer"?{...i,data:new ArrayBuffer(0)}:i}if(fi(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:xh},e)}if(!Lx(t.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return Ox(t,e);if(fi(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:xh},e)}return Vx(t,e)},Rx=(t,e)=>Cu({...t,type:"json"},e),$x=(t,e)=>Cu({...t,type:"arrayBuffer"},e),Ge={};function P(t,e,r={}){if(Ge[t])throw Error(`${t} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Ge[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}P("Object",Object),P("Set",Set),P("TransferableGridIndex",Co),P("Color",mt),P("Error",Error),P("AJAXError",Na),P("ResolvedImage",Oe),P("StylePropertyFunction",Td),P("StyleExpression",Du,{omit:["_evaluator"]}),P("ZoomDependentExpression",Ra),P("ZoomConstantExpression",mn),P("CompoundExpression",Vr,{omit:["_evaluate"]});for(let t in oi)oi[t]._classRegistryKey||P(`Expression_${t}`,oi[t]);function Hd(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor?.name==="ArrayBuffer")}function Iu(t){let e=t.constructor;return t.$name||e._classRegistryKey}function Nx(t){if(typeof t!="object"||!t)return!1;let e=Iu(t);return e&&e!=="Object"}function Kd(t){return!Nx(t)&&(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||Hd(t)||au(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}function on(t,e){if(Kd(t))return(Hd(t)||au(t))&&e&&e.push(t),ArrayBuffer.isView(t)&&e&&e.push(t.buffer),t instanceof ImageData&&e&&e.push(t.data.buffer),t;if(Array.isArray(t)){let a=[];for(let s of t)a.push(on(s,e));return a}if(typeof t!="object")throw Error(`can't serialize object of type ${typeof t}`);let r=Iu(t);if(!r)throw Error(`can't serialize object of unregistered class ${t.constructor.name}`);if(!Ge[r])throw Error(`${r} is not registered.`);let{klass:i}=Ge[r],n=i.serialize?i.serialize(t,e):{};if(i.serialize){if(n===e?.[e.length-1])throw Error("statically serialized object won't survive transfer of $name property")}else{for(let a in t){if(!t.hasOwnProperty(a)||Ge[r].omit.includes(a))continue;let s=t[a];s!==void 0&&(n[a]=Ge[r].shallow.includes(a)?s:on(s,e))}t instanceof Error&&(n.message=t.message)}if(n.$name)throw Error("$name property is reserved for worker serialization logic.");return r!=="Object"&&(n.$name=r),n}function ln(t){if(Kd(t))return t;if(Array.isArray(t))return t.map(ln);if(typeof t!="object")throw Error(`can't deserialize object of type ${typeof t}`);let e=Iu(t)||"Object";if(!Ge[e])throw Error(`can't deserialize unregistered class ${e}`);let{klass:r}=Ge[e];if(!r)throw Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(t);let i=Object.create(r.prototype);for(let n of Object.keys(t)){if(n==="$name")continue;let a=t[n];i[n]=Ge[e].shallow.includes(n)?a:ln(a)}return i}var jx=class{constructor(t){this._methodToThrottle=t,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>this._invoke()}trigger(){this._triggered||(this._triggered=!0,this._channel?.port1.postMessage(!0),setTimeout(()=>this._invoke(),0))}_invoke(){this._triggered&&(this._triggered=!1,this._methodToThrottle())}remove(){delete this._channel,this._methodToThrottle=()=>{}}},Ux={once:!0},qx=class{constructor(t,e){this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new jx(()=>this.process()),this.subscription=Yc(this.target,"message",r=>this.receive(r),!1),this.globalScope=fi(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}unregisterMessageHandler(t){delete this.messageHandlers[t]}sendAsync(t,e){return new Promise((r,i)=>{let n=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=e?Yc(e.signal,"abort",()=>{a?.unsubscribe(),delete this.resolveRejects[n];let l={id:n,type:"<cancel>",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l),i(new su(e.signal.reason))},Ux):null;this.resolveRejects[n]={resolve:l=>{a?.unsubscribe(),r(l)},reject:l=>{a?.unsubscribe(),i(l)}};let s=[],o={...t,id:n,sourceMapId:this.mapId,origin:location.origin,data:on(t.data,s)};this.target.postMessage(o,{transfer:s})})}receive(t){let e=t.data,r=e.id,i=["file://","resource://android","null"],n=[e.origin,location.origin],a=e.origin===location.origin,s=n.some(o=>i.includes(o));if((a||s)&&!(e.targetMapId&&this.mapId!==e.targetMapId))if(e.type==="<cancel>"){delete this.tasks[r];let o=this.abortControllers[r];delete this.abortControllers[r],o&&o.abort()}else fi(self)||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)}process(){if(this.taskQueue.length===0)return;let t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}async processTask(t,e){if(e.type==="<response>"){let n=this.resolveRejects[t];if(delete this.resolveRejects[t],!n)return;e.error?n.reject(Ma(ln(e.error))):n.resolve(ln(e.data));return}if(!this.messageHandlers[e.type]){this.completeTask(t,null,null);return}let r=ln(e.data),i=new AbortController;this.abortControllers[t]=i;try{let n=await this.messageHandlers[e.type](e.sourceMapId,r,i);this.completeTask(t,null,n)}catch(n){this.completeTask(t,Ma(n))}}completeTask(t,e,r){let i=[];delete this.abortControllers[t];let n={id:t,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?on(e):null,data:on(r,i)};this.target.postMessage(n,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},vh=ee;new Set(Object.keys(S).filter(t=>t.startsWith("source_")).map(t=>t.slice(7).replaceAll("_","-")));function Gx(t,e){let r=!1;for(let i of e)i.severity==="warning"?Mt(i.message):(t.fire(new Ba(Error(i.message))),r=!0);return r}function Xx(t,e,r,i){return i?.validate!==!1&&Gx(t,e({styleSpec:S,...r}))}var bh=class{constructor(){this.first=!0}update(t,e){let r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))}},ot=class{constructor(t,e){this.zoom=t,e?(this.now=e.now||0,this.fadeDuration=e.fadeDuration||0,this.zoomHistory=e.zoomHistory||new bh,this.transition=e.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new bh,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}}},vn=class{constructor(t,e,r,i){this.property=t,this.value=e,this.expression=ix(e===void 0?t.specification.default:e,r,t.specification,i)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}readsGlobalState(t){let e=this.getGlobalStateRefs();return t.some(r=>e.has(r))}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}},qo=class{constructor(t,e,r){this.property=t,this.value=new vn(t,void 0,e,r)}transitioned(t,e){return e.value===this.value?e:new wh(this.property,this.value,e,{...t.transition,...this.transition},t.now)}untransitioned(){return new wh(this.property,this.value,null,{},0)}},Yx=class{constructor(t,e,r){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=r,this._rootKey=e}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasProperty(t){return t in this._properties.defaultTransitionablePropertyValues}getValue(t){return pr(this._values[t].value.value)}setValue(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new qo(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].value=new vn(this._values[t].property,e===null?void 0:pr(e),this._propertyRootKey(t),this._globalState)}setValues(t){for(let e in t){let r=t[e];e.endsWith("-transition")?this.setTransition(e.slice(0,-11),r):Fo(this._values[e].value.value,r)||this.setValue(e,r)}}getTransition(t){return pr(this._values[t].transition)}setTransition(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new qo(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].transition=pr(e)||void 0}retainPriorGlobalState(t,e,r){for(let i of Object.keys(r._values))for(let n=r._values[i];n;n=n.prior){let{value:a}=n;a.property.specification.transition&&!a.isDataDriven()&&a.expression._globalState===this._globalState&&a.readsGlobalState(t)&&(n.value=new vn(a.property,a.value,this._propertyRootKey(i),e))}}applyGlobalStateChange(t,e,r,i){this.retainPriorGlobalState(t,e,r);let n=!1;for(let a of Object.keys(this._values)){let{value:s}=this._values[a];s.readsGlobalState(t)&&(this.setValue(a,s.value),n=!0)}return n?this.transitioned(i,r):r}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);r!==void 0&&(t[e]=r);let i=this.getTransition(e);i!==void 0&&(t[`${e}-transition`]=i)}return t}transitioned(t,e){let r=new _h(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(t,e._values[i]);return r}untransitioned(){let t=new _h(this._properties);for(let e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}},wh=class{constructor(t,e,r,i,n){this.property=t,this.value=e,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(t,e,r){let i=t.now||0,n=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(!a)return n;if(i>this.end||this.value.isDataDriven())return this.prior=null,n;if(i<this.begin)return a.possiblyEvaluate(t,e,r);{let s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(t,e,r),n,lm(s))}}},_h=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,r){let i=new ps(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(t,e,r);return i}hasTransition(){for(let t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}},Wx=class{constructor(t,e,r){this._properties=t,this._values=Object.create(t.defaultPropertyValues),this._globalState=r,this._rootKey=e}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasValue(t){return this._values[t].value!==void 0}hasProperty(t){return t in this._properties.defaultPropertyValues}getValue(t){return pr(this._values[t].value)}setValue(t,e){this._values[t]=new vn(this._values[t].property,e===null?void 0:pr(e),this._propertyRootKey(t),this._globalState)}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);r!==void 0&&(t[e]=r)}return t}possiblyEvaluate(t,e,r){let i=new ps(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(t,e,r);return i}},de=class{constructor(t,e,r){this.property=t,this.value=e,this.parameters=r}isConstant(){return this.value.kind==="constant"}constantOr(t){return this.value.kind==="constant"?this.value.value:t}evaluate(t,e,r,i){return this.property.evaluate(this.value,this.parameters,t,e,r,i)}},ps=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}};function Dh(t){if(Array.isArray(t))return t.length;let e=t?.values;return Array.isArray(e)?e.length:void 0}function Jd(t,e){let r=Dh(t),i=Dh(e);return r!==void 0&&i!==void 0&&r!==i}var V=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e){if(t.isDataDriven())throw Error("Value should not be data driven");return t.expression.evaluate(e)}interpolate(t,e,r){if(Jd(t,e))return Mt(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),e;let i=this.specification.type,n=He[i];return n?n(t,e,r):t}},N=class{constructor(t,e,r){this.specification=t,this.name=e,this.overrides=r}possiblyEvaluate(t,e,r,i){return t.expression.kind==="constant"||t.expression.kind==="camera"?new de(this,{kind:"constant",value:t.expression.evaluate(e,null,{},r,i)},e):new de(this,t.expression,e)}interpolate(t,e,r){if(t.value.kind!=="constant"||e.value.kind!=="constant")return t;if(t.value.value===void 0||e.value.value===void 0)return new de(this,{kind:"constant",value:void 0},t.parameters);if(Jd(t.value.value,e.value.value))return Mt(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),e;let i=this.specification.type,n=He[i];if(n){let a=n(t.value.value,e.value.value,r);return new de(this,{kind:"constant",value:a},t.parameters)}return t}evaluate(t,e,r,i,n,a){return t.kind==="constant"?t.value:t.evaluate(e,r,i,n,a)}},bn=class extends N{possiblyEvaluate(t,e,r,i){if(t.value===void 0)return new de(this,{kind:"constant",value:void 0},e);if(t.expression.kind==="constant"){let n=t.expression.evaluate(e,null,{},r,i),a=t.property.specification.type==="resolvedImage"&&typeof n!="string"?n.name:n,s=this._calculate(a,a,a,e);return new de(this,{kind:"constant",value:s},e)}if(t.expression.kind==="camera"){let n=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new de(this,{kind:"constant",value:n},e)}return new de(this,t.expression,e)}evaluate(t,e,r,i,n,a){if(t.kind==="source"){let s=t.evaluate(e,r,i,n,a);return this._calculate(s,s,s,e)}return t.kind==="composite"?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,i),t.evaluate({zoom:Math.floor(e.zoom)},r,i),t.evaluate({zoom:Math.floor(e.zoom)+1},r,i),e):t.value}_calculate(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},Qd=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){if(t.value!==void 0){if(t.expression.kind==="constant"){let n=t.expression.evaluate(e,null,{},r,i);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new ot(Math.floor(e.zoom-1),e)),t.expression.evaluate(new ot(Math.floor(e.zoom),e)),t.expression.evaluate(new ot(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},fs=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){return!!t.expression.evaluate(e,null,{},r,i)}interpolate(){return!1}},Wt=class{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let e in t){let r=t[e];r.specification.overridable&&this.overridableProperties.push(e);let i=this.defaultPropertyValues[e]=new vn(r,void 0,r.name,void 0),n=this.defaultTransitionablePropertyValues[e]=new qo(r,r.name,void 0);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}}};P("DataDrivenProperty",N),P("DataConstantProperty",V),P("CrossFadedDataDrivenProperty",bn),P("CrossFadedProperty",Qd),P("ColorRampProperty",fs);var Sh=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",io=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?",Te=class extends gm{constructor(t,e,r){if(super(),this.id=t.id,this.type=t.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,needCamera:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=Mx(this.visibility,`layers[${this.id}].layout.visibility`,r),t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter,this._featureFilter=gn(t.filter,`layers[${this.id}].filter`,r)),e.layout&&(this._unevaluatedLayout=new Wx(e.layout,`layers[${this.id}].layout`,r)),e.paint)){this._transitionablePaint=new Yx(e.paint,`layers[${this.id}].paint`,r);for(let i in t.paint)this.setPaintProperty(i,t.paint[i],{validate:!1});for(let i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ps(e.paint)}}setFilter(t){this.filter=t,this._featureFilter=gn(t,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){if(t==="visibility")return this.visibility;if(this._transitionablePaint?.hasProperty(t))throw Error(t+Sh);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${t}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){let t=new Set;for(let e of this._visibilityExpression.getGlobalStateRefs())t.add(e);if(this._unevaluatedLayout)for(let e in this._unevaluatedLayout._values){let r=this._unevaluatedLayout._values[e];for(let i of r.getGlobalStateRefs())t.add(i)}for(let e of this._featureFilter.getGlobalStateRefs())t.add(e);return t}getPaintAffectingGlobalStateRefs(){let t=new globalThis.Map;if(this._transitionablePaint)for(let e in this._transitionablePaint._values){let r=this._transitionablePaint._values[e].value;for(let i of r.getGlobalStateRefs()){let n=t.get(i)??[];n.push({name:e,value:r.value}),t.set(i,n)}}return t}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(t,e,r={}){t==="visibility"?(this.visibility=e,this._visibilityExpression.setValue(e),this.recalculateVisibility()):this._transitionablePaint?.hasProperty(t)?this.fire(new Ba(Error(t+Sh))):e!=null&&this._validate(vh.layoutProperty,`layers.${this.id}.layout.${t}`,t,e,r)||this._unevaluatedLayout.setValue(t,e)}getPaintProperty(t){if(t.endsWith("-transition")){let e=t.slice(0,-11);if(e==="visibility"||this._unevaluatedLayout?.hasProperty(e))throw Error(t+io);return this._transitionablePaint.getTransition(e)}if(t==="visibility"||this._unevaluatedLayout?.hasProperty(t))throw Error(t+io);return this._transitionablePaint.getValue(t)}setPaintProperty(t,e,r={}){if(t==="visibility"||this._unevaluatedLayout?.hasProperty(t))return this.fire(new Ba(Error(t+io))),!1;if(e!=null&&this._validate(vh.paintProperty,`layers.${this.id}.paint.${t}`,t,e,r))return!1;if(t.endsWith("-transition"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{let i=this._transitionablePaint._values[t],n=i.property.specification["property-type"]==="cross-faded-data-driven",a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);let o=this._transitionablePaint._values[t].value;return o.isDataDriven()||a||n||this._handleOverridablePaintPropertyUpdate(t,s,o)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,r){return!1}isHidden(t=this.minzoom,e=!1){return this.minzoom&&t<(e?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&t>=this.maxzoom?!0:this._evaluatedVisibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}retainPriorGlobalState(t,e){this._transitionablePaint?.retainPriorGlobalState(t,e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){let t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout?.serialize(),paint:this._transitionablePaint?.serialize()};return this.visibility&&(t.layout||={},t.layout.visibility=this.visibility),pm(t,(e,r)=>e!==void 0&&!(r==="layout"&&!Object.keys(e).length)&&!(r==="paint"&&!Object.keys(e).length))}_validate(t,e,r,i,n={}){return Xx(this,t,{key:e,layerType:this.type,objectKey:r,value:i},n)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let e=this.paint.get(t);if(e instanceof de&&xi(e.property.specification)&&(e.value.kind==="source"||e.value.kind==="composite")&&e.value.isStateDependent)return!0}return!1}},Zx={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},On=class{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},wt=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function Tt(t,e=1){let r=0,i=0;return{members:t.map(n=>{let a=Hx(n.type),s=r=Ah(r,Math.max(e,a)),o=n.components||1;return i=Math.max(i,a),r+=a*o,{name:n.name,type:n.type,components:o,offset:s}}),size:Ah(r,Math.max(i,e)),alignment:e}}function Hx(t){return Zx[t].BYTES_PER_ELEMENT}function Ah(t,e){return Math.ceil(t/e)*e}var wn=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.int16[i+0]=e,this.int16[i+1]=r,t}};wn.prototype.bytesPerElement=4,P("StructArrayLayout2i4",wn);var Go=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,t}};Go.prototype.bytesPerElement=6,P("StructArrayLayout3i6",Go);var Eh=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,t}};Eh.prototype.bytesPerElement=8,P("StructArrayLayout4i8",Eh);var Xo=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};Xo.prototype.bytesPerElement=12,P("StructArrayLayout2i4i12",Xo);var Yo=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.int8=new Int8Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,a,s,o)}emplace(t,e,r,i,n,a,s,o,l){let u=t*5,c=t*10;return this.int16[u+0]=e,this.int16[u+1]=r,this.uint8[c+4]=i,this.uint8[c+5]=n,this.uint8[c+6]=a,this.uint8[c+7]=s,this.int8[c+8]=o,this.int8[c+9]=l,t}};Yo.prototype.bytesPerElement=10,P("StructArrayLayout2i4ub2b10",Yo);var _n=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.float32[i+0]=e,this.float32[i+1]=r,t}};_n.prototype.bytesPerElement=8,P("StructArrayLayout2f8",_n);var Dn=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.float32[r+0]=e,t}};Dn.prototype.bytesPerElement=4,P("StructArrayLayout1f4",Dn);var Wo=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u){let c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,i,n,a,s,o,l,u)}emplace(t,e,r,i,n,a,s,o,l,u,c){let h=t*10;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=i,this.uint16[h+3]=n,this.uint16[h+4]=a,this.uint16[h+5]=s,this.uint16[h+6]=o,this.uint16[h+7]=l,this.uint16[h+8]=u,this.uint16[h+9]=c,t}};Wo.prototype.bytesPerElement=20,P("StructArrayLayout10ui20",Wo);var Zo=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,a,s,o)}emplace(t,e,r,i,n,a,s,o,l){let u=t*8;return this.uint16[u+0]=e,this.uint16[u+1]=r,this.uint16[u+2]=i,this.uint16[u+3]=n,this.uint16[u+4]=a,this.uint16[u+5]=s,this.uint16[u+6]=o,this.uint16[u+7]=l,t}};Zo.prototype.bytesPerElement=16,P("StructArrayLayout8ui16",Zo);var Ho=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,c,h,p){let f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,i,n,a,s,o,l,u,c,h,p)}emplace(t,e,r,i,n,a,s,o,l,u,c,h,p,f){let d=t*14,y=t*7;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=n,this.uint16[d+4]=a,this.uint16[d+5]=s,this.uint16[d+6]=o,this.uint16[d+7]=l,this.int16[d+8]=u,this.int16[d+9]=c,this.int16[d+10]=h,this.int16[d+11]=p,this.float32[y+6]=f,t}};Ho.prototype.bytesPerElement=28,P("StructArrayLayout4i4ui4i1f28",Ho);var Ko=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,t}};Ko.prototype.bytesPerElement=12,P("StructArrayLayout3f12",Ko);var Jo=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint32[r+0]=e,t}};Jo.prototype.bytesPerElement=4,P("StructArrayLayout1ul4",Jo);var Qo=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l){let u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,i,n,a,s,o,l)}emplace(t,e,r,i,n,a,s,o,l,u){let c=t*10,h=t*5;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=i,this.int16[c+3]=n,this.int16[c+4]=a,this.int16[c+5]=s,this.uint32[h+3]=o,this.uint16[c+8]=l,this.uint16[c+9]=u,t}};Qo.prototype.bytesPerElement=20,P("StructArrayLayout6i1ul2ui20",Qo);var tl=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};tl.prototype.bytesPerElement=12,P("StructArrayLayout2i2i2i12",tl);var Th=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n)}emplace(t,e,r,i,n,a){let s=t*4,o=t*8;return this.float32[s+0]=e,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,t}};Th.prototype.bytesPerElement=16,P("StructArrayLayout2f1f2i16",Th);var el=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*16,l=t*4,u=t*8;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[l+1]=i,this.float32[l+2]=n,this.int16[u+6]=a,this.int16[u+7]=s,t}};el.prototype.bytesPerElement=16,P("StructArrayLayout2ub2f2i16",el);var rl=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.uint16[n+0]=e,this.uint16[n+1]=r,this.uint16[n+2]=i,t}};rl.prototype.bytesPerElement=6,P("StructArrayLayout3ui6",rl);var il=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g){let x=this.length;return this.resize(x+1),this.emplace(x,t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g)}emplace(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g,x){let v=t*28,b=t*14,w=t*56;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint32[b+1]=i,this.uint16[v+4]=n,this.uint32[b+3]=a,this.uint32[b+4]=s,this.uint32[b+5]=o,this.uint16[v+12]=l,this.uint16[v+13]=u,this.uint16[v+14]=c,this.float32[b+8]=h,this.float32[b+9]=p,this.uint8[w+40]=f,this.uint8[w+41]=d,this.uint8[w+42]=y,this.uint32[b+11]=m,this.int16[v+24]=g,this.float32[b+13]=x,t}};il.prototype.bytesPerElement=56,P("StructArrayLayout2i1ul1ui3ul3ui2f3ub1ul1i1f56",il);var nl=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g,x,v,b,w,_,D,A,E,O,k,B){let R=this.length;return this.resize(R+1),this.emplace(R,t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g,x,v,b,w,_,D,A,E,O,k,B)}emplace(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g,x,v,b,w,_,D,A,E,O,k,B,R){let I=t*34,C=t*17;return this.int16[I+0]=e,this.int16[I+1]=r,this.int16[I+2]=i,this.int16[I+3]=n,this.int16[I+4]=a,this.int16[I+5]=s,this.int16[I+6]=o,this.int16[I+7]=l,this.uint16[I+8]=u,this.uint16[I+9]=c,this.uint16[I+10]=h,this.uint16[I+11]=p,this.uint16[I+12]=f,this.uint16[I+13]=d,this.uint16[I+14]=y,this.uint16[I+15]=m,this.uint16[I+16]=g,this.uint16[I+17]=x,this.uint16[I+18]=v,this.uint16[I+19]=b,this.uint16[I+20]=w,this.uint16[I+21]=_,this.uint16[I+22]=D,this.uint32[C+12]=A,this.float32[C+13]=E,this.float32[C+14]=O,this.uint16[I+30]=k,this.uint16[I+31]=B,this.float32[C+16]=R,t}};nl.prototype.bytesPerElement=68,P("StructArrayLayout8i15ui1ul2f2ui1f68",nl);var al=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*6,a=t*3;return this.uint16[n+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,t}};al.prototype.bytesPerElement=12,P("StructArrayLayout1ui2f12",al);var sl=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*2,a=t*4;return this.uint32[n+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=i,t}};sl.prototype.bytesPerElement=8,P("StructArrayLayout1ul2ui8",sl);var ol=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.uint16[i+0]=e,this.uint16[i+1]=r,t}};ol.prototype.bytesPerElement=4,P("StructArrayLayout2ui4",ol);var Fh=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint16[r+0]=e,t}};Fh.prototype.bytesPerElement=2,P("StructArrayLayout1ui2",Fh);var ll=class extends wt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,t}};ll.prototype.bytesPerElement=16,P("StructArrayLayout4f16",ll);var ty=class extends On{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new F(this.anchorPointX,this.anchorPointY)}};ty.prototype.size=20;var ey=class extends Qo{get(t){return new ty(this,t)}};P("CollisionBoxArray",ey);var ry=class extends On{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint32[this._pos4+1]}get numGlyphs(){return this._structArray.uint16[this._pos2+4]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineStartIndex(){return this._structArray.uint32[this._pos4+4]}get lineLength(){return this._structArray.uint32[this._pos4+5]}get segment(){return this._structArray.uint16[this._pos2+12]}get lowerSize(){return this._structArray.uint16[this._pos2+13]}get upperSize(){return this._structArray.uint16[this._pos2+14]}get lineOffsetX(){return this._structArray.float32[this._pos4+8]}get lineOffsetY(){return this._structArray.float32[this._pos4+9]}get writingMode(){return this._structArray.uint8[this._pos1+40]}get placedOrientation(){return this._structArray.uint8[this._pos1+41]}set placedOrientation(t){this._structArray.uint8[this._pos1+41]=t}get hidden(){return this._structArray.uint8[this._pos1+42]}set hidden(t){this._structArray.uint8[this._pos1+42]=t}get crossTileID(){return this._structArray.uint32[this._pos4+11]}set crossTileID(t){this._structArray.uint32[this._pos4+11]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+24]}get heightOffset(){return this._structArray.float32[this._pos4+13]}};ry.prototype.size=56;var iy=class extends il{get(t){return new ry(this,t)}};P("PlacedSymbolArray",iy);var ny=class extends On{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}get heightOffset(){return this._structArray.float32[this._pos4+16]}};ny.prototype.size=68;var ay=class extends nl{get(t){return new ny(this,t)}};P("SymbolInstanceArray",ay);var sy=class extends Dn{getoffsetX(t){return this.float32[t*1+0]}};P("GlyphOffsetArray",sy);var oy=class extends Go{getx(t){return this.int16[t*3+0]}gety(t){return this.int16[t*3+1]}gettileUnitDistanceFromAnchor(t){return this.int16[t*3+2]}};P("SymbolLineVertexArray",oy);var ly=class extends On{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};ly.prototype.size=12;var uy=class extends al{get(t){return new ly(this,t)}};P("TextAnchorOffsetArray",uy);var cy=class extends On{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};cy.prototype.size=8;var hy=class extends sl{get(t){return new cy(this,t)}};P("FeatureIndexArray",hy);var Kx=class extends wn{},Jx=class extends wn{},Qx=class extends wn{},t2=class extends Xo{},e2=class extends Yo{},r2=class extends _n{},i2=class extends Dn{},Kr=class extends Wo{},Ch=class extends Zo{},n2=class extends Ho{},a2=class extends Ko{},s2=class extends Jo{},Ih=class extends tl{},o2=class extends el{},Vn=class extends rl{},ul=class extends ol{},cl=Tt([{name:"a_pos",components:2,type:"Int16"}],4),l2=cl.members;cl.size,cl.alignment;var ae=class ti{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,r,i,n){let a=this.segments[this.segments.length-1];return e>ti.MAX_VERTEX_ARRAY_LENGTH&&Mt(`Max vertices per segment is ${ti.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${ti.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+e>ti.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n?this.createNewSegment(r,i,n):a}createNewSegment(e,r,i){let n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return i!==void 0&&(n.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(n),n}getOrCreateLatestSegment(e,r,i){return this.prepareSegment(0,e,r,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,i,n){return new ti([{vertexOffset:e,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};ae.MAX_VERTEX_ARRAY_LENGTH=2**16-1,P("SegmentVector",ae);function kh(t,e){return t=Gt(Math.floor(t),0,255),e=Gt(Math.floor(e),0,255),256*t+e}var u2=Tt([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),c2=Tt([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]),h2=eu(((t,e)=>{function r(i,n){for(var a=i.length&3,s=i.length-a,o=n,l,u=3432918353,c=461845907,h,p=0;p<s;)h=i.charCodeAt(p)&255|(i.charCodeAt(++p)&255)<<8|(i.charCodeAt(++p)&255)<<16|(i.charCodeAt(++p)&255)<<24,++p,h=(h&65535)*u+(((h>>>16)*u&65535)<<16)|0,h=h<<15|h>>>17,h=(h&65535)*c+(((h>>>16)*c&65535)<<16)|0,o^=h,o=o<<13|o>>>19,l=(o&65535)*5+(((o>>>16)*5&65535)<<16)|0,o=(l&65535)+27492+(((l>>>16)+58964&65535)<<16);switch(h=0,a){case 3:h^=(i.charCodeAt(p+2)&255)<<16;case 2:h^=(i.charCodeAt(p+1)&255)<<8;case 1:h^=i.charCodeAt(p)&255,h=(h&65535)*u+(((h>>>16)*u&65535)<<16)|0,h=h<<15|h>>>17,h=(h&65535)*c+(((h>>>16)*c&65535)<<16)|0,o^=h}return o^=i.length,o^=o>>>16,o=(o&65535)*2246822507+(((o>>>16)*2246822507&65535)<<16)|0,o^=o>>>13,o=(o&65535)*3266489909+(((o>>>16)*3266489909&65535)<<16)|0,o^=o>>>16,o>>>0}e!==void 0&&(e.exports=r)})),p2=eu(((t,e)=>{e.exports=function(r,i){for(var n=r.length,a=i^n,s=0,o;n>=4;)o=r.charCodeAt(s)&255|(r.charCodeAt(++s)&255)<<8|(r.charCodeAt(++s)&255)<<16|(r.charCodeAt(++s)&255)<<24,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),o^=o>>>24,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16)^o,n-=4,++s;switch(n){case 3:a^=(r.charCodeAt(s+2)&255)<<16;case 2:a^=(r.charCodeAt(s+1)&255)<<8;case 1:a^=r.charCodeAt(s)&255,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16)}return a^=a>>>13,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16),a^=a>>>15,a>>>0}})),ja=Y0(eu(((t,e)=>{var r=h2(),i=p2();e.exports=r,e.exports.murmur3=r,e.exports.murmur2=i}))(),1),py=class fy{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,i,n){this.ids.push(Mh(e)),this.positions.push(r,i,n)}getPositions(e){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let r=Mh(e),i=0,n=this.ids.length-1;for(;i<n;){let s=i+n>>1;this.ids[s]>=r?n=s:i=s+1}let a=[];for(;this.ids[i]===r;){let s=this.positions[3*i],o=this.positions[3*i+1],l=this.positions[3*i+2];a.push({index:s,start:o,end:l}),i++}return a}static serialize(e,r){let i=new Float64Array(e.ids),n=new Uint32Array(e.positions);return hl(i,n,0,i.length-1),r&&r.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(e){let r=new fy;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};function Mh(t){let e=+t;return!isNaN(e)&&e<=2**53-1?e:(0,ja.default)(String(t))}function hl(t,e,r,i){let n=!1;for(;r<i;){let a=t[n?r+Math.floor(Math.random()*(i-r)):r+i>>1],s=r-1,o=i+1;for(;;){do s++;while(t[s]<a);do o--;while(t[o]>a);if(s>=o)break;ca(t,s,o),ca(e,3*s,3*o),ca(e,3*s+1,3*o+1),ca(e,3*s+2,3*o+2)}n=Math.min(o-r,i-o)<i-r>>3,o-r<i-o?(hl(t,e,r,o),r=o+1):(hl(t,e,o+1,i),i=o)}}function ca(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}P("FeaturePositionMap",py);var ku=class{constructor(t,e){this.gl=t.gl,this.location=e}},Mu=class extends ku{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}},f2=class extends ku{constructor(t,e){super(t,e),this.current=[0,0,0,0]}set(t){(t[0]!==this.current[0]||t[1]!==this.current[1]||t[2]!==this.current[2]||t[3]!==this.current[3])&&(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}},d2=class extends ku{constructor(t,e){super(t,e),this.current=mt.transparent}set(t){(t.r!==this.current.r||t.g!==this.current.g||t.b!==this.current.b||t.a!==this.current.a)&&(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}};function pl(t){return[kh(255*t.r,255*t.g),kh(255*t.b,255*t.a)]}var Qi=class{constructor(t,e,r){this.value=t,this.uniformNames=e.map(i=>`u_${i}`),this.type=r}setUniform(t,e,r){t.set(r.constantOr(this.value))}getBinding(t,e,r){return this.type==="color"?new d2(t,e):new Mu(t,e)}},Sr=class{constructor(t,e){this.uniformNames=e.map(r=>`u_${r}`),this.patternFrom=null,this.patternTo=null,this.dashFrom=null,this.dashTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,e){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,e.y,e.height,e.width]}setUniform(t,e,r,i){let n=null;i==="u_pattern_to"?n=this.patternTo:i==="u_pattern_from"?n=this.patternFrom:i==="u_dasharray_to"?n=this.dashTo:i==="u_dasharray_from"?n=this.dashFrom:i==="u_pixel_ratio_to"?n=this.pixelRatioTo:i==="u_pixel_ratio_from"&&(n=this.pixelRatioFrom),n!==null&&t.set(n)}getBinding(t,e,r){return r.startsWith("u_pattern")||r.startsWith("u_dasharray_")?new f2(t,e):new Mu(t,e)}},Ne=class{constructor(t,e,r,i){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map(n=>({name:`a_${n}`,type:"Float32",components:r==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(t,e,r){let i=this.paintVertexArray.length,n=this.expression.evaluate(new ot(0,r),e,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(i,t,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new ot(0,n),r,i);this._setPaintValue(t,e,a)}_setPaintValue(t,e,r){if(this.type==="color"){let i=pl(r);for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,i[0],i[1])}else{for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(t){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},we=class{constructor(t,e,r,i,n,a){this.expression=t,this.uniformNames=e.map(s=>`u_${s}_t`),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map(s=>({name:`a_${s}`,type:"Float32",components:r==="color"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(t,e,r){let i=this.expression.evaluate(new ot(this.zoom,r),e,{},r.canonical,[],r.formattedSection),n=this.expression.evaluate(new ot(this.zoom+1,r),e,{},r.canonical,[],r.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,i,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new ot(this.zoom,n),r,i),s=this.expression.evaluate(new ot(this.zoom+1,n),r,i);this._setPaintValue(t,e,a,s)}_setPaintValue(t,e,r,i){if(this.type==="color"){let n=pl(r),a=pl(i);for(let s=t;s<e;s++)this.paintVertexArray.emplace(s,n[0],n[1],a[0],a[1])}else{for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}}upload(t){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,e){let r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,i=Gt(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(i)}getBinding(t,e,r){return new Mu(t,e)}},ur=class{constructor(t,e,r,i,n,a){this.expression=t,this.type=e,this.useIntegerZoom=r,this.zoom=i,this.layerId=a,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}populatePaintArray(t,e,r){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(i,t,this.getPositionIds(e),r)}updatePaintArray(t,e,r,i,n){this._setPaintValues(t,e,this.getPositionIds(r),n)}_setPaintValues(t,e,r,i){let n=this.getPositions(i);if(!n||!r)return;let a=n[r.min],s=n[r.mid],o=n[r.max];if(a&&s&&o)for(let l=t;l<e;l++)this.emplace(this.zoomInPaintVertexArray,l,a,s),this.emplace(this.zoomOutPaintVertexArray,l,o,s)}upload(t){if(this.zoomInPaintVertexArray?.arrayBuffer.byteLength&&this.zoomOutPaintVertexArray?.arrayBuffer.byteLength){let e=this.getVertexAttributes();this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,e,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,e,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},dy=class extends ur{getPositions(t){return t.imagePositions}getPositionIds(t){return t.patterns?.[this.layerId]}getVertexAttributes(){return u2.members}emplace(t,e,r,i){t.emplace(e,r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],i.tlbr[0],i.tlbr[1],i.tlbr[2],i.tlbr[3],r.pixelRatio,i.pixelRatio)}},yy=class extends ur{getPositions(t){return t.dashPositions}getPositionIds(t){return t.dashes?.[this.layerId]}getVertexAttributes(){return c2.members}emplace(t,e,r,i){t.emplace(e,0,r.y,r.height,r.width,0,i.y,i.height,i.width)}},my=class{constructor(t,e,r){this.binders={},this._buffers=[];let i=[];for(let n in t.paint._values){if(!r(n))continue;let a=t.paint.get(n);if(!(a instanceof de)||!xi(a.property.specification))continue;let s=y2(n,t.type),o=a.value,l=a.property.specification.type,u=a.property.useIntegerZoom,c=a.property.specification["property-type"],h=c==="cross-faded"||c==="cross-faded-data-driven";if(o.kind==="constant")this.binders[n]=h?new Sr(o.value,s):new Qi(o.value,s,l),i.push(`/u_${n}`);else if(o.kind==="source"||h){let p=Ph(n,l,"source");this.binders[n]=h?n==="line-dasharray"?new yy(o,l,u,e,p,t.id):new dy(o,l,u,e,p,t.id):new Ne(o,s,l,p),i.push(`/a_${n}`)}else{let p=Ph(n,l,"composite");this.binders[n]=new we(o,s,l,u,e,p),i.push(`/z_${n}`)}}this.cacheKey=i.sort().join("")}getMaxValue(t){let e=this.binders[t];return e instanceof Ne||e instanceof we?e.maxValue:0}populatePaintArrays(t,e,r){for(let i in this.binders){let n=this.binders[i];(n instanceof Ne||n instanceof we||n instanceof ur)&&n.populatePaintArray(t,e,r)}}setConstantPatternPositions(t,e){for(let r in this.binders){let i=this.binders[r];i instanceof Sr&&i.setConstantPatternPositions(t,e)}}setConstantDashPositions(t,e){for(let r in this.binders){let i=this.binders[r];i instanceof Sr&&i.setConstantDashPositions(t,e)}}updatePaintArrays(t,e,r,i,n){let a=!1;for(let s of t){let o=e.getPositions(s.id);for(let l of o){let u=r.feature(l.index);for(let c in this.binders){let h=this.binders[c];(h instanceof Ne||h instanceof we||h instanceof ur)&&h.expression.isStateDependent===!0&&(h.expression=i.paint.get(c).value,h.updatePaintArray(l.start,l.end,u,s.state,n),a=!0)}}}return a}defines(){let t=[];for(let e in this.binders){let r=this.binders[e];(r instanceof Qi||r instanceof Sr)&&t.push(...r.uniformNames.map(i=>`#define HAS_UNIFORM_${i}`))}return t}getBinderAttributes(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof Ne||r instanceof we)for(let i of r.paintVertexAttributes)t.push(i.name);else if(r instanceof ur){let i=r.getVertexAttributes();for(let n of i)t.push(n.name)}}return t}getBinderUniforms(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof Qi||r instanceof Sr||r instanceof we)for(let i of r.uniformNames)t.push(i)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof Qi||n instanceof Sr||n instanceof we){for(let a of n.uniformNames)if(e[a]){let s=n.getBinding(t,e[a],a);r.push({name:a,property:i,binding:s})}}}return r}setUniforms(t,e,r,i){for(let{name:n,property:a,binding:s}of e)this.binders[a].setUniform(s,i,r.get(a),n)}updatePaintBuffers(t){this._buffers=[];for(let e in this.binders){let r=this.binders[e];if(t&&r instanceof ur){let i=t.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(r instanceof Ne||r instanceof we)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(t){for(let e in this.binders){let r=this.binders[e];(r instanceof Ne||r instanceof we||r instanceof ur)&&r.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let e=this.binders[t];(e instanceof Ne||e instanceof we||e instanceof ur)&&e.destroy()}}},zr=class{constructor(t,e,r=()=>!0){this.programConfigurations={};for(let i of t)this.programConfigurations[i.id]=new my(i,e,r);this.needsUpload=!1,this._featureMap=new py,this._bufferOffset=0}populatePaintArrays(t,e,r,i){for(let n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(t,e,i);e.id!==void 0&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(t,this._featureMap,e,n,i)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}};function y2(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function m2(t){return{"line-pattern":{source:Kr,composite:Kr},"fill-pattern":{source:Kr,composite:Kr},"fill-extrusion-pattern":{source:Kr,composite:Kr},"line-dasharray":{source:Ch,composite:Ch}}[t]}function Ph(t,e,r){let i={color:{source:_n,composite:ll},number:{source:Dn,composite:_n}};return m2(t)?.[r]||i[e][r]}P("ConstantBinder",Qi),P("CrossFadedConstantBinder",Sr),P("SourceExpressionBinder",Ne),P("CrossFadedPatternBinder",dy),P("CrossFadedDasharrayBinder",yy),P("CompositeExpressionBinder",we),P("ProgramConfiguration",my,{omit:["_buffers"]}),P("ProgramConfigurationSet",zr);var fl=2**14-1,Bh=-fl-1;function Rr(t){let e=et/t.extent,r=t.loadGeometry();for(let i of r)for(let n of i){let a=Math.round(n.x*e),s=Math.round(n.y*e);n.x=Gt(a,Bh,fl),n.y=Gt(s,Bh,fl),(a<n.x||a>n.x+1||s<n.y||s>n.y+1)&&Mt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Fi(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Rr(t):[]}}var Sn=class dl{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let r=new dl;return r.extend(e(new F(this.minX,this.minY))),r.extend(e(new F(this.maxX,this.minY))),r.extend(e(new F(this.minX,this.maxY))),r.extend(e(new F(this.maxX,this.maxY))),r}static fromPoints(e){let r=new dl;for(let i of e)r.extend(i);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}};Sn.fromPoints([new F(0,0),new F(et,et)]);function Ua(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function zh(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}function Pu(t){return t.x<0||t.x>=8192||t.y<0||t.y>=8192}var Lh=-32768;function g2(t,e,r,i,n){t.emplaceBack(Lh+e*8+i,Lh+r*8+n)}var Bu=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new Jx,this.indexArray=new Vn,this.segments=new ae,this.programConfigurations=new zr(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){let i=this.layers[0],n=[],a=null,s=!1,o=i.type==="heatmap";if(i.type==="circle"){let h=i;a=h.layout.get("circle-sort-key"),s=!a.isConstant(),o||=h.paint.get("circle-pitch-alignment")==="map"}let l=o?e.subdivisionGranularity.circle:1,u=new ot(this.zoom),c=this.layers[0]._featureFilter.needGeometry;for(let{feature:h,id:p,index:f,sourceLayerIndex:d}of t){let y=Fi(h,c);if(!this.layers[0]._featureFilter.filter(u,y,r))continue;let m=s?a.evaluate(y,{},r):void 0,g={id:p,properties:h.properties,type:h.type,sourceLayerIndex:d,index:f,geometry:c?y.geometry:Rr(h),patterns:{},sortKey:m};n.push(g)}s&&n.sort((h,p)=>h.sortKey-p.sortKey);for(let h of n){let{geometry:p,index:f,sourceLayerIndex:d}=h,y=t[f].feature;this.addFeature(h,p,f,r,l),e.featureIndex.insert(y,p,f,d,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures(t){}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,l2),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,r,i,n=1){let a;switch(n){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${n}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let o of e)for(let l of o){let u=l.x,c=l.y;if(Pu(l))continue;let h=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,t.sortKey),p=h.vertexLength;for(let f=0;f<s;f++)for(let d=0;d<s;d++)g2(this.layoutVertexArray,u,c,a[d],a[f]);for(let f=0;f<s-1;f++)for(let d=0;d<s-1;d++){let y=p+f*s+d,m=p+(f+1)*s+d;this.indexArray.emplaceBack(y,m+1,y+1),this.indexArray.emplaceBack(y,m,m+1)}h.vertexLength+=s*s,h.primitiveLength+=(s-1)*(s-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:{},canonical:i})}};P("CircleBucket",Bu,{omit:["layers"]});function x2(t,e){for(let r of t)if(wi(e,r))return!0;for(let r of e)if(wi(t,r))return!0;return zu(t,e)}function ds(t,e,r){return wi(t,e)?!0:yl(e,t,r)}function gy(t,e){if(t.length===1)return Oh(e,t[0]);for(let r of e)for(let i of r)if(wi(t,i))return!0;for(let r of t)if(Oh(e,r))return!0;for(let r of e)if(zu(t,r))return!0;return!1}function v2(t,e,r){for(let i of e){if(t.length>=3){for(let n of i)if(wi(t,n))return!0}if(b2(t,i,r))return!0}return!1}function b2(t,e,r){if(t.length>1){if(zu(t,e))return!0;for(let i of e)if(yl(i,t,r))return!0}for(let i of t)if(yl(i,e,r))return!0;return!1}function zu(t,e){if(t.length===0||e.length===0)return!1;for(let r=0;r<t.length-1;r++){let i=t[r],n=t[r+1];for(let a=0;a<e.length-1;a++)if(w2(i,n,e[a],e[a+1]))return!0}return!1}function w2(t,e,r,i){return fr(t,r,i)!==fr(e,r,i)&&fr(t,e,r)!==fr(t,e,i)}function yl(t,e,r){let i=r*r;if(e.length===1)return t.distSqr(e[0])<i;for(let n=1;n<e.length;n++)if(xy(t,e[n-1],e[n])<i)return!0;return!1}function xy(t,e,r){let i=e.distSqr(r);if(i===0)return t.distSqr(e);let n=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/i;return n<0?t.distSqr(e):n>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(n)._add(e))}function Oh(t,e){let r=!1,i,n,a;for(let s of t){i=s;for(let o=0,l=i.length-1;o<i.length;l=o++)n=i[o],a=i[l],n.y>e.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(r=!r)}return r}function wi(t,e){let r=!1;for(let i=0,n=t.length-1;i<t.length;n=i++){let a=t[i],s=t[n];a.y>e.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function _2(t,e,r,i,n){for(let s of t)if(e<=s.x&&r<=s.y&&i>=s.x&&n>=s.y)return!0;let a=[new F(e,r),new F(e,n),new F(i,n),new F(i,r)];if(t.length>2){for(let s of a)if(wi(t,s))return!0}for(let s=0;s<t.length-1;s++)if(D2(t[s],t[s+1],a))return!0;return!1}function D2(t,e,r){let i=r[0],n=r[2];if(t.x<i.x&&e.x<i.x||t.x>n.x&&e.x>n.x||t.y<i.y&&e.y<i.y||t.y>n.y&&e.y>n.y)return!1;let a=fr(t,e,r[0]);return a!==fr(t,e,r[1])||a!==fr(t,e,r[2])||a!==fr(t,e,r[3])}var qe=63710088e-1,dt=class tn{constructor(e,r){if(isNaN(e)||isNaN(r))throw Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new tn(Ar(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let r=Math.PI/180,i=this.lat*r,n=e.lat*r,a=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-this.lng)*r);return qe*Math.acos(Math.min(a,1))}static convert(e){if(e instanceof tn)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new tn(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e)return new tn(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}},no=6378137,ml={origin:[-Math.PI*no,Math.PI*no],extentAtZoom0:2*Math.PI*no},Lu=2*Math.PI*qe;function vy(t){return Lu*Math.cos(t*Math.PI/180)}function Ou(t){return(180+t)/360}function Vu(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function gl(t,e){return t/vy(e)}function by(t){return t*360-180}function An(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function S2(t,e){return t*vy(An(e))}function wy(t){return 1/Math.cos(t*Math.PI/180)}var me=class _y{constructor(e,r,i=0){this.x=+e,this.y=+r,this.z=+i}static fromLngLat(e,r=0){let i=dt.convert(e);return new _y(Ou(i.lng),Vu(i.lat),gl(r,i.lat))}toLngLat(){return new dt(by(this.x),An(this.y))}toAltitude(){return S2(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Lu*wy(An(this.y))}},A2=new class{constructor(){this.name="mercator",this.wraps=!0,this.tileMatrixSet=ml}worldFromLngLat(t,e,r){return new me(Ou(t),Vu(e),r===void 0?0:gl(r,e))}lngLatFromWorld(t,e){return new dt(by(t),An(e))}hasLngLat(t,e){return!0}metersPerWorldUnit(t,e){return 1/(1/Lu*wy(An(e)))}worldZFromAltitude(t,e){return gl(t,e.lat)}};function E2(t,e,r){return!(t<0||t>25||r<0||r>=2**t||e<0||e>=2**t)}var Dy=class{constructor(t,e,r){if(!E2(t,e,r))throw Error(`x=${e}, y=${r}, z=${t} outside of bounds. 0<=x<${2**t}, 0<=y<${2**t} 0<=z<=25 `);this.z=t,this.x=e,this.y=r,this.key=li(0,t,t,e,r)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,r,i=ml){let n=T2(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(r==="tms"?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,e>1?"@2x":"").replace(/{quadkey}/g,n).replace(/{bbox-epsg-3857}/g,()=>Vh(this.x,this.y,this.z,ml)).replace(/{bbox}/g,()=>Vh(this.x,this.y,this.z,i))}isChildOf(t){let e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){let e=2**this.z;return new F((t.x*e-this.x)*et,(t.y*e-this.y)*et)}toString(){return`${this.z}/${this.x}/${this.y}`}},qa=class{constructor(t,e){this.wrap=t,this.canonical=e,this.key=li(t,e.z,e.z,e.x,e.y)}},ys=class he{constructor(e,r,i,n,a){if(this.terrainRttPosMatrix32f=null,e<i)throw Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${i}`);this.overscaledZ=e,this.wrap=r,this.canonical=new Dy(i,+n,+a),this.key=li(r,e,i,n,a)}clone(){return new he(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?new he(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new he(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,r){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-e;return e>this.canonical.z?li(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):li(this.wrap*+r,e,e,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;let r=this.canonical.z-e.canonical.z;return r<0?!1:e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new he(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=this.canonical.x*2,n=this.canonical.y*2;return[new he(r,this.wrap,r,i,n),new he(r,this.wrap,r,i+1,n),new he(r,this.wrap,r,i,n+1),new he(r,this.wrap,r,i+1,n+1)]}isLessThan(e){return this.wrap<e.wrap?!0:this.wrap>e.wrap?!1:this.overscaledZ<e.overscaledZ?!0:this.overscaledZ>e.overscaledZ?!1:this.canonical.x<e.canonical.x?!0:this.canonical.x>e.canonical.x?!1:this.canonical.y<e.canonical.y}wrapped(){return new he(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new he(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return 2**(this.overscaledZ-this.canonical.z)}toUnwrapped(){return new qa(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new me(e.x-this.wrap,e.y))}normalizeCoordinates(e,r,i=et){if(e>=0&&e<i&&r>=0&&r<i)return{tileID:this,x:e,y:r};let n=Math.floor(e/i),a=Math.floor(r/i),s=e-n*i,o=r-a*i,l=this.canonical.z,u=1<<l,c=this.canonical.y+a;if(c<0||c>=u)return null;let h=this.canonical.x+n,p=this.wrap;return h<0?(p-=Math.ceil(-h/u),h=(h%u+u)%u):h>=u&&(p+=Math.floor(h/u),h%=u),{tileID:new he(this.overscaledZ,p,l,h,c),x:s,y:o}}};function li(t,e,r,i,n){t*=2,t<0&&(t=t*-1-1);let a=1<<r;return(a*a*t+a*n+i).toString(36)+r.toString(36)+e.toString(36)}function Vh(t,e,r,i){let n=2**r,a=i.extentAtZoom0/n,[s,o]=i.origin,l=o-i.extentAtZoom0,u=n-e-1;return`${s+t*a},${l+u*a},${s+(t+1)*a},${l+(u+1)*a}`}function T2(t,e,r){let i="";for(let n=t;n>0;n--){let a=1<<n-1;i+=(e&a?1:0)+(r&a?2:0)}return i}P("CanonicalTileID",Dy),P("OverscaledTileID",ys,{omit:["terrainRttPosMatrix32f"]});var Sy=class je{constructor(e,r){e&&(r?this.setSouthWest(e).setNorthEast(r):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof dt?new dt(e.lng,e.lat):dt.convert(e),this}setSouthWest(e){return this._sw=e instanceof dt?new dt(e.lng,e.lat):dt.convert(e),this}extend(e){let r=this._sw,i=this._ne,n,a;if(e instanceof dt)n=e,a=e;else if(e instanceof je){if(n=e._sw,a=e._ne,!n||!a)return this}else{if(Array.isArray(e)){if(e.length===4||e.every(Array.isArray)){let s=e;return this.extend(je.convert(s))}{let s=e;return this.extend(dt.convert(s))}}return e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(dt.convert(e)):this}return!r&&!i?(this._sw=new dt(n.lng,n.lat),this._ne=new dt(a.lng,a.lat)):(r.lng=Math.min(n.lng,r.lng),r.lat=Math.min(n.lat,r.lat),i.lng=Math.max(a.lng,i.lng),i.lat=Math.max(a.lat,i.lat)),this}getCenter(){return new dt((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new dt(this.getWest(),this.getNorth())}getSouthEast(){return new dt(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){let{lng:r,lat:i}=dt.convert(e),n=this._sw.lat<=i&&i<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),n&&a}intersects(e){if(e=je.convert(e),!(e.getNorth()>=this.getSouth()&&e.getSouth()<=this.getNorth()))return!1;let r=Math.abs(this.getEast()-this.getWest()),i=Math.abs(e.getEast()-e.getWest());if(r>=360||i>=360)return!0;let n=Ar(this.getWest(),-180,180),a=Ar(this.getEast(),-180,180),s=Ar(e.getWest(),-180,180),o=Ar(e.getEast(),-180,180),l=n>a,u=s>o;return l&&u?!0:l?o>=n||s<=a:u?a>=s||n<=o:s<=a&&o>=n}static convert(e){return e instanceof je||!e?e:new je(e)}static fromLngLat(e,r=0){let i=360*r/40075017,n=i/Math.cos(Math.PI/180*e.lat);return new je(new dt(e.lng-n,e.lat-i),new dt(e.lng+n,e.lat+i))}adjustAntiMeridian(){let e=new dt(this._sw.lng,this._sw.lat),r=new dt(this._ne.lng,this._ne.lat);return e.lng>r.lng?new je(e,new dt(r.lng+360,r.lat)):new je(e,r)}};function Ay(t,e,r){let i=1/(1<<r.z);return new me(t/et*i+r.x*i,e/et*i+r.y*i)}function Ey(t){if(!t)return[0,0,1,1];let e=t.canonical.z>=0?1<<t.canonical.z:2**t.canonical.z;return[t.canonical.x/e,t.canonical.y/e,1/e/et,1/e/et]}function F2(t,e,r){return Ay(t,e,r).toLngLat()}function C2(t){return t.cameraToCenterDistance*Math.min(Math.tan(di(90-t.pitch))*.85,Math.tan(di(89.25-t.pitch)))}function xl(t,e){let r=t.canonical,i=e/hm(r.z),n=r.x+2**r.z*t.wrap,a=new Float64Array(16);return ru(a),mf(a,a,[n*i,r.y*i,0]),gf(a,a,[i/et,i/et,1]),a}function I2(t,e,r,i){let{x:n,y:a,z:s}=k2(e,r),o=i*-n,l=i*-a,u=i*s;return new me(t.x+o,t.y+l,t.z+u)}function k2(t,e){let r=di(t),i=di(e),n=Math.cos(-r),a=Math.sin(r);return{x:a*Math.sin(i),y:-a*Math.cos(i),z:n}}function M2(t,e,r){let i=e[0],n=e[1];return t[0]=r[0]*i+r[4]*n+r[12],t[1]=r[1]*i+r[5]*n+r[13],t[3]=r[3]*i+r[7]*n+r[15],t}function It(t){return t.projection==="globe"?t.globeness>0?t.verticalPerspective:t.mercator:t}function ao(t){return It(t).projection==="vertical-perspective"}function P2(t){let e=Math.tan(t.pitchInRadians)*(t.cameraToCenterDistance||1);return t.centerPoint.add(new F(e*Math.sin(t.rollInRadians),e*Math.cos(t.rollInRadians)))}function Ty(t,e){let r=P2(t);if(e.length===1)return[e[0],r];let{minX:i,minY:n,maxX:a,maxY:s}=Sn.fromPoints(e).extend(r);return[new F(i,n),new F(a,n),new F(a,s),new F(i,s),new F(i,n)]}function B2(t,e=1,r=0,i,n){let a=[[-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]],s=n?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],o=2**r,l=a.map(p=>z2(p,t,e,o));i&&L2(l,s[0],i,n);let u=s.map(p=>{let f=ke([],iu([],We([],l[p[0]],l[p[1]]),We([],l[p[2]],l[p[1]]))),d=-yr(f,l[p[1]]);return f.concat(d)}),c=[1/0,1/0,1/0],h=[-1/0,-1/0,-1/0];for(let p of l)for(let f=0;f<3;f++)c[f]=Math.min(c[f],p[f]),h[f]=Math.max(h[f],p[f]);return{points:l,planes:u,aabb:{min:c,max:h}}}function z2(t,e,r,i){let n=ze([],t,e),a=1/n[3]/r*i;return nm(n,n,[a,a,1/n[3],a])}function L2(t,e,r,i){let n=i?4:0,a=i?0:4,s=0,o=[],l=[];for(let h=0;h<4;h++){let p=We([],t[h+a],t[h+n]),f=Qa(p);dr(p,p,1/f),o.push(f),l.push(p)}for(let h=0;h<4;h++){let p=om(t[h+n],l[h],r);s=p!==null&&p>=0?Math.max(s,p):Math.max(s,o[h])}let u=O2(t,e),c=V2(r,u);if(c!==null){let h=c/yr(l[0],u);s=Math.min(s,h)}for(let h=0;h<4;h++){let p=Math.min(s,o[h]);t[h+a]=[t[h+n][0]+l[h][0]*p,t[h+n][1]+l[h][1]*p,t[h+n][2]+l[h][2]*p,1]}}function O2(t,e){let r=We([],t[e[0]],t[e[1]]),i=We([],t[e[2]],t[e[1]]),n=[0,0,0,0];return ke(n,iu([],r,i)),n[3]=-yr(n,t[e[0]]),n}function V2(t,e){let r=im([],t,1/Ao(t)),i=We([],e,dr([],r,yr(e,r))),n=Ao(i);if(n>0){let a=Math.sqrt(1-r[3]*r[3]);return To(e,Sa([],dr([],r,-r[3]),dr([],i,a/n)))}return null}var Rh=et*(1-1e-12),$h={covered:!1,demLoaded:!1,elevation:0};function Fy(t,e,r,i,n){if(i<0||i>=1||!n&&(r<0||r>=1))return $h;let a=n?Math.floor(r):0,s=r-a;for(let o of t.zooms){let l=1<<o,u=s*l,c=i*l,h=Math.floor(u),p=Math.floor(c),f=`${a}/${o}/${h}/${p}`;if(!t.samplerPerTile.has(f))continue;let d=t.samplerPerTile.get(f);return d?{covered:!0,demLoaded:!0,elevation:d(Math.min((u-h)*et,Rh),Math.min((c-p)*et,Rh),et)*e}:{covered:!0,demLoaded:!1,elevation:0}}return $h}function Cy(t,e){return t.covered&&e<=t.elevation+1e-6}function Iy(t,e,r,i,n){for(let a=0;a<40&&i-r>n;a++){let s=(r+i)/2;e(t,s)?i=s:r=s}return{lo:r,hi:i}}var Nh=new WeakMap;function vl(t){let e=Nh.get(t);return e||(e={posMatrices:new Map,alignedPosMatrices:new Map,fogMatrices:new Map},Nh.set(t,e)),e}function jh(t){return C2(t)}function Uh(t,e){return e?t.lngLatFromWorld(e.x,e.y):void 0}function R2(t,e,r,i,n){let a=n.getCoverageIndex();if(!a)return null;let s=t.worldSize,o=i[0]-r[0],l=i[1]-r[1],u=i[2]-r[2],c={index:a,exaggeration:n.exaggeration,near:r,dx:o,dy:l,dz:u,worldSize:s,wraps:e.wraps},h=0,p=1;if(u===0){if(r[2]>a.maxElevation||r[2]<a.minElevation)return null}else{let g=(a.maxElevation-r[2])/u,x=(a.minElevation-r[2])/u;if(h=Math.max(h,Math.min(g,x)),p=Math.min(p,Math.max(g,x)),h>p)return null}let f=Math.hypot(o,l),d=Gt(Math.ceil(f*(p-h)/4),1,512),y=0,m=!ha(c,0);for(let g=0;g<=d;g++){let x=h+(p-h)*g/d;if(!m)m=!ha(c,x);else if(ha(c,x)){let{lo:v,hi:b}=Iy(c,ha,y,x,.001/f),w=Fa(c,v),_=Fa(c,b),D=r[2]+v*u-w.elevation,A=r[2]+b*u-_.elevation,E=w.covered&&D>A?Gt(v+D*(b-v)/(D-A),v,b):b;return new me((r[0]+E*o)/s,(r[1]+E*l)/s,Fa(c,E).elevation)}y=x}return null}function bl(t,e,r=0){let i=[e.x,e.y,r,1],n=[e.x,e.y,1,1];ze(i,i,t.pixelMatrixInverse),ze(n,n,t.pixelMatrixInverse);let a=i[3],s=n[3],o=t.elevation;return{near:[i[0]/a,i[1]/a,i[2]/a+o],far:[n[0]/s,n[1]/s,n[2]/s+o]}}function or(t,e,r){let i=r||0,{near:n,far:a}=bl(t,e),s=n[2]===a[2]?0:(i+t.elevation-n[2])/(a[2]-n[2]);return new me(He.number(n[0],a[0],s)/t.worldSize,He.number(n[1],a[1],s)/t.worldSize,i)}function qh(t,e,r=0,i=t.pixelMatrix){let n=ky(t,e,r,i),a=n[3];return a>0?new F(n[0]/a,n[1]/a):$2(t,n[0],n[1],a)}function ky(t,e,r,i){let n=[e.x*t.worldSize,e.y*t.worldSize,r,1];return ze(n,n,i)}function $2(t,e,r,i){let n=t.width/2,a=t.height/2,s=e-n*i,o=r-a*i;s===0&&o===0&&(o=1);let l=n+t.width,u=a+t.height,c=Math.min(s===0?1/0:l/Math.abs(s),o===0?1/0:u/Math.abs(o));return new F(n+s*c,a+o*c)}function so(t,e,r=!1,i=!1){let n=e.key??li(e.wrap,e.canonical.z,e.canonical.z,e.canonical.x,e.canonical.y),a=r?vl(t).alignedPosMatrices:vl(t).posMatrices;if(a.has(n)){let l=a.get(n);return i?l.f32:l.f64}let s=xl(e,t.worldSize);So(s,r?t.alignedModelViewProjectionMatrix:t.modelViewProjectionMatrix,s);let o={f64:s,f32:new Float32Array(s)};return a.set(n,o),i?o.f32:o.f64}function Fa(t,e){return Fy(t.index,t.exaggeration,(t.near[0]+e*t.dx)/t.worldSize,(t.near[1]+e*t.dy)/t.worldSize,t.wraps)}function ha(t,e){return Cy(Fa(t,e),t.near[2]+e*t.dz)}function Gh({near:t,far:e},r,i,n){let a=e[0]-t[0],s=e[1]-t[1],o=e[2]-t[2];return((r-t[0])*a+(i-t[1])*s+(n-t[2])*o)/(a*a+s*s+o*o)}var N2=class{getVisibleUnwrappedCoordinates(t,e,r){let i=[new qa(0,r)];if(t.renderWorldCopies&&e.wraps){let n=or(t,new F(0,0)),a=or(t,new F(t.width,0)),s=or(t,new F(t.width,t.height)),o=or(t,new F(0,t.height)),l=Math.floor(Math.min(n.x,a.x,s.x,o.x)),u=Math.floor(Math.max(n.x,a.x,s.x,o.x));for(let c=l-1;c<=u+1;c++)c!==0&&i.push(new qa(c,r))}return i}getCameraFrustum(t){return B2(t.inverseModelViewProjectionMatrix,t.worldSize)}locationToScreenPoint(t,e,r,i){let n=e.worldFromLngLat(r.lng,r.lat);return i?qh(t,n,i.getElevationForLngLat(r,t.tileZoom),t.pixelMatrix3D):qh(t,n)}screenPointToLocation(t,e,r,i){return Uh(e,this.screenPointToMercatorCoordinate(t,e,r,i))}screenPointToLocationAtElevation(t,e,r,i){return Uh(e,or(t,r,i-t.elevation))}screenPointToMercatorCoordinate(t,e,r,i){if(i){let n=this.screenTerrainPointToMercatorCoordinate(t,e,r,i);if(n!=null)return n}return or(t,r)}screenTerrainPointToMercatorCoordinate(t,e,r,i){let{near:n,far:a}=bl(t,r,-1);return R2(t,e,n,a,i)}getBounds(t,e){let r=Math.max(0,t.height/2-jh(t));return new Sy().extend(this.screenPointToLocation(t,e,new F(0,r))).extend(this.screenPointToLocation(t,e,new F(t.width,r))).extend(this.screenPointToLocation(t,e,new F(t.width,t.height))).extend(this.screenPointToLocation(t,e,new F(0,t.height)))}isPointOnMapSurface(t,e,r,i){if(i)return this.screenTerrainPointToMercatorCoordinate(t,e,r,i)!=null;let n=r.y>t.centerPoint.y-jh(t);if(!n||e.wraps)return n;let a=or(t,r);return e.hasLngLat(a.x,a.y)}calculateFogMatrix(t,e){let r=e.key,i=vl(t).fogMatrices;if(i.has(r))return i.get(r);let n=xl(e,t.worldSize);return So(n,t.fogMatrix,n),i.set(r,new Float32Array(n)),i.get(r)}maxPitchScaleFactor(t){if(!t.pixelMatrixInverse)return 1;let e=or(t,new F(0,0)),r=[e.x*t.worldSize,e.y*t.worldSize,0,1];return ze(r,r,t.pixelMatrix)[3]/t.cameraToCenterDistance}getCameraAltitude(t){return Math.cos(t.pitchInRadians)*t.cameraToCenterDistance/t.pixelsPerMeter+t.elevation}getCameraLngLat(t,e){let r=t.center,i=e.worldZFromAltitude(1,r),n=i*t.worldSize,a=t.cameraToCenterDistance/n,s=I2(e.worldFromLngLat(r.lng,r.lat,t.elevation),t.pitch,t.bearing,a*i);return e.lngLatFromWorld(s.x,s.y)}getProjectionData(t,e){let{overscaledTileID:r,aligned:i,applyTerrainMatrix:n}=e,a=Ey(r),s=r?so(t,r,i,!0):null,o;return o=r?.terrainRttPosMatrix32f&&n?r.terrainRttPosMatrix32f:s||sm(),{mainMatrix:o,tileMercatorCoords:a,clippingPlane:[0,0,0,0],tileOrigin:[0,0,0,0],tileOriginPosition:[0,0],projectionTransition:0,fallbackMatrix:o,clipAntimeridian:!1}}isLocationOccluded(t,e,r,i,n){if(!i?.getCoverageIndex())return!1;let a=e.worldFromLngLat(r.lng,r.lat);n??=i.getElevationForLngLat(r,t.tileZoom);let s=ky(t,a,n,t.pixelMatrix3D),o=s[3];if(o<=0||s[2]>o)return!0;let l=new F(s[0]/o,s[1]/o),u=this.screenTerrainPointToMercatorCoordinate(t,e,l,i);if(u==null)return!1;let c=bl(t,l,-1),h=Gh(c,a.x*t.worldSize,a.y*t.worldSize,n);return Gh(c,u.x*t.worldSize,u.y*t.worldSize,u.z)<h*.99}getPixelScale(t){return 1}getCircleRadiusCorrection(t){return 1}getPitchedTextCorrection(t,e,r,i){return 1}transformLightDirection(t,e){return Q0(e)}projectTileCoordinates(t,e,r,i,n){let a=so(t,i),s;n==null?(s=[e,r,0,1],M2(s,s,a)):(s=[e,r,n,1],ze(s,s,a));let o=s[3];return{point:new F(s[0]/o,s[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}getProjectionDataForCustomLayer(t,e=!0){let r=new ys(0,0,0,0,0),i=this.getProjectionData(t,{overscaledTileID:r,applyGlobeMatrix:e}),n=xl(r,t.worldSize);So(n,t.modelViewProjectionMatrix,n);let a=[et,et,t.worldSize/t.pixelsPerMeter],s=Eo();return gf(s,n,a),{...i,tileMercatorCoords:[0,0,1,1],fallbackMatrix:s,mainMatrix:s}}getFastPathSimpleProjectionMatrix(t,e){return so(t,e)}getClippingPlane(t){return null}getRayDirectionFromPixel(t,e){throw Error("Not implemented.")}getCameraQueryGeometry(t,e){return Ty(t,e)}};function j2(t,e){return[Pa(t*Math.PI*2+Math.PI,Math.PI*2),2*Math.atan(Math.exp(Math.PI-e*Math.PI*2))-Math.PI*.5]}function U2(t,e){let r=Math.cos(e),i=new Float64Array(3);return i[0]=Math.sin(t)*r,i[1]=Math.sin(e),i[2]=Math.cos(t)*r,i}function My(t,e,r,i,n){let a=1/(1<<n),s=t/et*a+r*a,o=e/et*a+i*a,l=Pa(s*Math.PI*2+Math.PI,Math.PI*2),u=2*Math.atan(Math.exp(Math.PI-o*Math.PI*2))-Math.PI*.5,c=Math.cos(u),h=new Float64Array(3);return h[0]=Math.sin(l)*c,h[1]=Math.sin(u),h[2]=Math.cos(l)*c,h}function wl(t){return U2(t.lng*Math.PI/180,t.lat*Math.PI/180)}function Ga(t){let e=Math.asin(t[1])/Math.PI*180,r=Math.sqrt(t[0]*t[0]+t[2]*t[2]);if(r>1e-6){let i=t[0]/r,n=t[2]/r,a=Math.acos(n);return new dt(Ar((i>0?a:-a)/Math.PI*180,-180,180),e)}return new dt(0,e)}function q2(t){let e=Nt();return e[0]=t[0]*-t[3],e[1]=t[1]*-t[3],e[2]=t[2]*-t[3],{center:e,radius:Math.sqrt(1-t[3]*t[3])}}function G2(t,e,r){let i=Nt();We(i,r,t);let n=Nt();return vf(n,t,i,e/Ao(i)),n}function Xh(t){return Math.cos(Math.min(Math.abs(t),85.051129)*Math.PI/180)}function Xa(t,e,r=1){let i=yr(t,e),n=r*r,a=Nt(),s=Nt();dr(s,e,i),We(a,t,s);let o=n-yr(a,a);if(o<0)return null;let l=yr(t,t)-n,u=-i+(i<0?1:-1)*Math.sqrt(o),c=l/u,h=u,p=Math.max(c,h);return p<0?null:{tMin:Math.min(c,h),tMax:p}}var Yh=new WeakMap;function X2(t,e){let r=Yh.get(t);r||(r=new Map,Yh.set(t,r));let i=r.get(e.key);if(i)return i;let n=1<<e.z,a=Ar(Ou(t.center.lng)*n-e.x,.5-n/2,.5+n/2),s=Vu(t.center.lat)*n-e.y,o=Math.round(Gt(a,0,1)*et),l=Math.round(Gt(s,0,1)*et),u=My(o,l,e.x,e.y,e.z),c=Math.hypot(u[0],u[2]),h=am();mf(h,t.modelViewProjectionMatrix,u);let p=t.clippingPlane,f=1+p[3],d=p[3]+p[0]*u[0]+p[1]*u[1]+p[2]*u[2],y={matrix:h,clippingPlane:[p[0]/f,p[1]/f,p[2]/f,d/f],tileOrigin:[u[0]/c,u[2]/c,(1+u[1])/c,1],tileOriginPosition:[o,l]};return r.set(e.key,y),y}function _l(t,e,r){return{mainMatrix:t.modelViewProjectionMatrix32f,tileMercatorCoords:Ey(e),clippingPlane:t.clippingPlane,tileOrigin:[0,0,0,0],tileOriginPosition:[0,0],projectionTransition:+!!r,fallbackMatrix:t.modelViewProjectionMatrix32f,clipAntimeridian:e?.canonical.z===0}}function Y2(t,e,r,i){let n=t.cameraPosition,a=e-n[0],s=r-n[1],o=i-n[2],l=a*a+s*s+o*o;if(l===0)return!1;let u=Gt(-(n[0]*a+n[1]*s+n[2]*o)/l,0,1),c=n[0]+u*a,h=n[1]+u*s,p=n[2]+u*o;return c*c+h*h+p*p<1}function oo(t,e){let r=nu();return ze(r,[...e,1],t.modelViewProjectionMatrix),r[0]/=r[3],r[1]/=r[3],new F((r[0]*.5+.5)*t.width,(-r[1]*.5+.5)*t.height)}function Wh(t,e){return!!Xa(t.cameraPosition,un(t,e))}function un(t,e){let r=nu();r[0]=e.x/t.width*2-1,r[1]=(e.y/t.height*2-1)*-1,r[2]=1,r[3]=1,ze(r,r,t.inverseModelViewProjectionMatrix),r[0]/=r[3],r[1]/=r[3],r[2]/=r[3];let i=Nt();i[0]=r[0]-t.cameraPosition[0],i[1]=r[1]-t.cameraPosition[1],i[2]=r[2]-t.cameraPosition[2];let n=Nt();return ke(n,i),n}function Py(t,e){let r=t.clippingPlane;return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]>=0}function Zh(t,e){if(!Py(t,e))return!1;let r=nu();return ze(r,[...e,1],t.modelViewProjectionMatrix),r[0]/=r[3],r[1]/=r[3],r[2]/=r[3],r[0]>-1&&r[0]<1&&r[1]>-1&&r[1]<1&&r[2]>-1&&r[2]<1}function lo(t,e){let r=t.cameraPosition,i=un(t,e),n=Xa(r,i);if(n){let c=Nt();Sa(c,r,[i[0]*n.tMin,i[1]*n.tMin,i[2]*n.tMin]);let h=Nt();return ke(h,c),Ga(h)}let a=t.clippingPlane,s=a[0]*i[0]+a[1]*i[1]+a[2]*i[2],o=-To(a,r)/s,l=Nt();if(o>0)Sa(l,r,[i[0]*o,i[1]*o,i[2]*o]);else{let c=Nt();Sa(c,r,[i[0]*2,i[1]*2,i[2]*2]);let h=To(a,c);We(l,c,[a[0]*h,a[1]*h,a[2]*h])}let u=q2(a);return Ga(G2(u.center,u.radius,l))}function By(t,e){let r=Nt();vf(r,t.origin,t.direction,e);let i=Qa(r),n=Nt();dr(n,r,1/i);let a=Ga(n),s=me.fromLngLat(a),o=new me(s.x,Gt(s.y,0,.999999999)),l=Fy(t.index,t.exaggeration,o.x,o.y,!1),u=Math.abs(a.lat)>85.051129?0:l.elevation;return{sample:{...l,elevation:u},radius:i,mercator:o}}function Hh(t,e){let{sample:r,radius:i}=By(t,e);return Cy(r,(i-1)*qe)}function Kh(t,e){let r=wl(t);return dr(r,r,1+e/qe)}function Jh(t,e,r){return yr(xf(Nt(),r,t),e)}var W2=class{getProjectionData(t,e){let{overscaledTileID:r,applyGlobeMatrix:i}=e,n=_l(t,r,i);if(!(i&&r!=null&&t.zoom>=10))return n;let a=X2(t,r.canonical);return n.mainMatrix=a.matrix,n.clippingPlane=a.clippingPlane,n.tileOrigin=a.tileOrigin,n.tileOriginPosition=a.tileOriginPosition,n}isLocationOccluded(t,e,r,i,n){let a=i?.getCoverageIndex();n??=a?i.getElevationForLngLat(r,t.tileZoom):0;let s=Kh(r,n);if(!Py(t,s))return!0;if(!a)return!1;let o=oo(t,s),l=t.cameraPosition,u=un(t,o),c=Jh(l,u,s);if(c<=0)return!0;let h=this.screenTerrainPointToMercatorCoordinate(t,e,o,i);return h!=null&&Jh(l,u,Kh(h.toLngLat(),h.z))<c*.99}transformLightDirection(t,e){let r=t.center.lng*Math.PI/180,i=t.center.lat*Math.PI/180,n=Math.cos(i),a=[Math.sin(r)*n,Math.sin(i),Math.cos(r)*n],s=[a[2],0,-a[0]],o=[0,0,0];iu(o,s,a),ke(s,s),ke(o,o);let l=[s[0]*e[0]+o[0]*e[1]+a[0]*e[2],s[1]*e[0]+o[1]*e[1]+a[1]*e[2],s[2]*e[0]+o[2]*e[1]+a[2]*e[2]],u=[0,0,0];return ke(u,l),u}getPixelScale(t){return 1/Xh(t.center.lat)}getCircleRadiusCorrection(t){return Xh(t.center.lat)}getPitchedTextCorrection(t,e,r,i){let n=Ay(e,r,i.canonical),a=j2(n.x,n.y);return this.getCircleRadiusCorrection(t)/Math.cos(a[1])}projectTileCoordinates(t,e,r,i,n){let a=i.canonical,s=My(e,r,a.x,a.y,a.z),o=1+(n??0)/qe,l=s[0]*o,u=s[1]*o,c=s[2]*o,h=[l,u,c,1];ze(h,h,t.modelViewProjectionMatrix);let p;if(o<=1){let f=t.clippingPlane;p=f[0]*s[0]+f[1]*s[1]+f[2]*s[2]+f[3]<0}else p=Y2(t,l,u,c);return{point:new F(h[0]/h[3],h[1]/h[3]),signedDistanceFromCamera:h[3],isOccluded:p}}calculateFogMatrix(t,e){Mt("calculateFogMatrix is not supported on globe projection.");let r=Eo();return ru(r),r}getVisibleUnwrappedCoordinates(t,e,r){return[new qa(0,r)]}getCameraFrustum(t){return t.frustum}maxPitchScaleFactor(t){return 1}getCameraAltitude(t){return(Qa(t.cameraPosition)-1)*qe}getCameraLngLat(t,e){let r=Nt();return ke(r,t.cameraPosition),Ga(r)}getBounds(t,e){let r=t.width*.5,i=t.height*.5,n=[new F(0,0),new F(r,0),new F(t.width,0),new F(t.width,i),new F(t.width,t.height),new F(r,t.height),new F(0,t.height),new F(0,i)],a=[];for(let p of n)a.push(lo(t,p));let s=0,o=0,l=0,u=0,c=t.center;for(let p of a){let f=qc(c.lng,p.lng),d=qc(c.lat,p.lat);f<o&&(o=f),f>s&&(s=f),d<u&&(u=d),d>l&&(l=d)}let h=[c.lng+o,c.lat+u,c.lng+s,c.lat+l];return Zh(t,[0,1,0])&&(h[3]=90,h[0]=-180,h[2]=180),Zh(t,[0,-1,0])&&(h[1]=-90,h[0]=-180,h[2]=180),new Sy(h)}locationToScreenPoint(t,e,r,i){let n=wl(r);return i&&dr(n,n,1+i.getElevationForLngLat(r,t.tileZoom)/qe),oo(t,n)}getCameraQueryGeometry(t,e){if(e.length!==1||!Wh(t,e[0]))return Ty(t,e);let r=wl(lo(t,e[0])),i=ke(Nt(),t.cameraPosition),n=[e[0]];for(let a=1;a<=8;a++){let s=tm(Nt(),r,i,a/8);n.push(oo(t,ke(s,s)))}return n}screenPointToMercatorCoordinate(t,e,r,i){if(i){let n=this.screenTerrainPointToMercatorCoordinate(t,e,r,i);if(n)return n}return me.fromLngLat(lo(t,r))}screenTerrainPointToMercatorCoordinate(t,e,r,i){let n=i.getCoverageIndex();if(!n)return null;let a=t.cameraPosition,s=un(t,r),o=Xa(a,s,1+n.maxElevation/qe);if(!o)return null;let l=Xa(a,s,1+n.minElevation/qe),u=Math.max(o.tMin,0),c=l?l.tMin:o.tMax;if(c<=u)return null;let h={index:n,exaggeration:i.exaggeration,origin:a,direction:s},p=0;for(let f=0;f<=256;f++){let d=u+(c-u)*f/256;if(Hh(h,d)){let{hi:y}=Iy(h,Hh,p,d,1e-12),{sample:m,mercator:g}=By(h,y);return new me(g.x,g.y,m.elevation)}p=d}return null}screenPointToLocation(t,e,r,i){return this.screenPointToMercatorCoordinate(t,e,r,i)?.toLngLat()}screenPointToLocationAtElevation(t,e,r,i){return this.screenPointToLocation(t,e,r)}isPointOnMapSurface(t,e,r,i){return Wh(t,r)}getProjectionDataForCustomLayer(t,e=!0){let r=_l(t,new ys(0,0,0,0,0),e),i=Eo();return K0(i,t.modelViewProjectionMatrix),{...r,mainMatrix:i,tileMercatorCoords:[0,0,1,1]}}getFastPathSimpleProjectionMatrix(t,e){}getClippingPlane(t){return t.clippingPlane}getRayDirectionFromPixel(t,e){return un(t,e)}},Z2=class{constructor(t,e){this._mercator=t,this._verticalPerspective=e}_renderedMath(t){return ao(t)?this._verticalPerspective:this._mercator}getProjectionData(t,e){let r=this._mercator.getProjectionData(t.mercator,e),i=_l(t.verticalPerspective,e.overscaledTileID,e.applyGlobeMatrix);return{mainMatrix:ao(t)?i.mainMatrix:r.mainMatrix,clippingPlane:i.clippingPlane,tileMercatorCoords:i.tileMercatorCoords,tileOrigin:i.tileOrigin,tileOriginPosition:i.tileOriginPosition,projectionTransition:e.applyGlobeMatrix?t.globeness:0,fallbackMatrix:r.fallbackMatrix,clipAntimeridian:i.clipAntimeridian}}getProjectionDataForCustomLayer(t,e=!0){let r=this._mercator.getProjectionDataForCustomLayer(t.mercator,e);if(!ao(t))return r;let i=this._verticalPerspective.getProjectionDataForCustomLayer(t.verticalPerspective,e);return i.fallbackMatrix=r.mainMatrix,i.projectionTransition=t.globeness,i}getFastPathSimpleProjectionMatrix(t,e){return this._renderedMath(t).getFastPathSimpleProjectionMatrix(It(t),e)}projectTileCoordinates(t,e,r,i,n){return this._renderedMath(t).projectTileCoordinates(It(t),e,r,i,n)}getPitchedTextCorrection(t,e,r,i){return Gc(this._mercator.getPitchedTextCorrection(t.mercator,e,r,i),this._verticalPerspective.getPitchedTextCorrection(t.verticalPerspective,e,r,i),t.globeness)}getCircleRadiusCorrection(t){return this._renderedMath(t).getCircleRadiusCorrection(It(t))}getPixelScale(t){return Gc(this._mercator.getPixelScale(t.mercator),this._verticalPerspective.getPixelScale(t.verticalPerspective),t.globeness)}transformLightDirection(t,e){return this._renderedMath(t).transformLightDirection(It(t),e)}calculateFogMatrix(t,e){return this._renderedMath(t).calculateFogMatrix(It(t),e)}getVisibleUnwrappedCoordinates(t,e,r){return this._renderedMath(t).getVisibleUnwrappedCoordinates(It(t),e,r)}getCameraFrustum(t){return this._renderedMath(t).getCameraFrustum(It(t))}getClippingPlane(t){return this._renderedMath(t).getClippingPlane(It(t))}maxPitchScaleFactor(t){return this._mercator.maxPitchScaleFactor(t.mercator)}getCameraAltitude(t){return this._renderedMath(t).getCameraAltitude(It(t))}getCameraLngLat(t,e){return this._renderedMath(t).getCameraLngLat(It(t),e)}getBounds(t,e){return this._renderedMath(t).getBounds(It(t),e)}isLocationOccluded(t,e,r,i,n){return this._renderedMath(t).isLocationOccluded(It(t),e,r,i,n)}locationToScreenPoint(t,e,r,i){return this._renderedMath(t).locationToScreenPoint(It(t),e,r,i)}screenPointToLocation(t,e,r,i){return this._renderedMath(t).screenPointToLocation(It(t),e,r,i)}screenPointToLocationAtElevation(t,e,r,i){return this._renderedMath(t).screenPointToLocationAtElevation(It(t),e,r,i)}screenPointToMercatorCoordinate(t,e,r,i){return this._renderedMath(t).screenPointToMercatorCoordinate(It(t),e,r,i)}screenTerrainPointToMercatorCoordinate(t,e,r,i){return this._renderedMath(t).screenTerrainPointToMercatorCoordinate(It(t),e,r,i)}isPointOnMapSurface(t,e,r,i){return this._renderedMath(t).isPointOnMapSurface(It(t),e,r,i)}getRayDirectionFromPixel(t,e){return this._verticalPerspective.getRayDirectionFromPixel(t.verticalPerspective,e)}getCameraQueryGeometry(t,e){return this._renderedMath(t).getCameraQueryGeometry(It(t),e)}},zy=new N2,Ly=new W2,H2=new Z2(zy,Ly);function ms(t){switch(t.projection){case"mercator":return zy;case"vertical-perspective":return Ly;case"globe":return H2}}function ui(t,e,r){let i=e.paint.get(t).value;return i.kind==="constant"?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function gs(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function xs(t,e,r,i,n){if(!e[0]&&!e[1])return t;let a=F.convert(e)._mult(n);r==="viewport"&&a._rotate(-i);let s=[];for(let o of t)s.push(o.sub(a));return s}function K2(t){let e=[];for(let r=0;r<t.length;r++){let i=t[r],n=e.at(-1);(r===0||n&&!i.equals(n))&&e.push(i)}return e}function J2(t,e){let r=[];for(let i of t){let n=K2(i),a=[];for(let s=0;s<n.length;s++){let o=n[s],l=n[s-1],u=n[s+1],c=s===0?new F(0,0):o.sub(l)._unit()._perp(),h=s===n.length-1?new F(0,0):u.sub(o)._unit()._perp(),p=c._add(h)._unit(),f=p.x*h.x+p.y*h.y;f!==0&&p._mult(1/f),a.push(p._mult(e)._add(o))}r.push(a)}return r}function Q2({queryGeometry:t,size:e},r){return ds(t,r,e)}function tv({queryGeometry:t,size:e,projectedCamera:r,unwrappedTileID:i,getElevation:n},a){return ds(t,a,e*(ms(r).projectTileCoordinates(r,a.x,a.y,i,n?.(a.x,a.y)).signedDistanceFromCamera/r.cameraToCenterDistance))}function ev({queryGeometry:t,size:e,projectedCamera:r,unwrappedTileID:i,getElevation:n},a){let s=ms(r).projectTileCoordinates(r,a.x,a.y,i,n?.(a.x,a.y)).signedDistanceFromCamera,o=e*(r.cameraToCenterDistance/s);return ds(t,Ru(a,r,i,n),o)}function rv({queryGeometry:t,size:e,projectedCamera:r,unwrappedTileID:i,getElevation:n},a){return ds(t,Ru(a,r,i,n),e)}function Oy({queryGeometry:t,size:e,projectedCamera:r,unwrappedTileID:i,getElevation:n,pitchAlignment:a="map",pitchScale:s="map"},o){let l=a==="map"?s==="map"?Q2:tv:s==="map"?ev:rv,u={queryGeometry:t,size:e,projectedCamera:r,unwrappedTileID:i,getElevation:n};for(let c of o)for(let h of c)if(l(u,h))return!0;return!1}function Ru(t,e,r,i){let n=ms(e).projectTileCoordinates(e,t.x,t.y,r,i?.(t.x,t.y)).point;return new F((n.x*.5+.5)*e.width,(-n.y*.5+.5)*e.height)}function iv(t,e,r,i){return t.map(n=>Ru(n,e,r,i))}var nv,av=()=>nv||=new Wt({"circle-sort-key":new N(S.layout_circle["circle-sort-key"],"circle-sort-key")}),sv,ov=()=>sv||=new Wt({"circle-radius":new N(S.paint_circle["circle-radius"],"circle-radius"),"circle-color":new N(S.paint_circle["circle-color"],"circle-color"),"circle-blur":new N(S.paint_circle["circle-blur"],"circle-blur"),"circle-opacity":new N(S.paint_circle["circle-opacity"],"circle-opacity"),"circle-translate":new V(S.paint_circle["circle-translate"],"circle-translate"),"circle-translate-anchor":new V(S.paint_circle["circle-translate-anchor"],"circle-translate-anchor"),"circle-pitch-scale":new V(S.paint_circle["circle-pitch-scale"],"circle-pitch-scale"),"circle-pitch-alignment":new V(S.paint_circle["circle-pitch-alignment"],"circle-pitch-alignment"),"circle-stroke-width":new N(S.paint_circle["circle-stroke-width"],"circle-stroke-width"),"circle-stroke-color":new N(S.paint_circle["circle-stroke-color"],"circle-stroke-color"),"circle-stroke-opacity":new N(S.paint_circle["circle-stroke-opacity"],"circle-stroke-opacity")}),lv={get paint(){return ov()},get layout(){return av()}},uv=class extends Te{constructor(t,e){super(t,lv,e)}createBucket(t){return new Bu(t)}queryRadius(t){let e=t;return ui("circle-radius",this,e)+ui("circle-stroke-width",this,e)+gs(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,projectedCamera:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){let l=xs(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-n.bearingInRadians,a),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c=this.paint.get("circle-pitch-scale"),h=this.paint.get("circle-pitch-alignment"),p,f;return h==="map"?(p=l,f=u*a):(p=iv(l,n,s,o),f=u),Oy({queryGeometry:p,size:f,projectedCamera:n,unwrappedTileID:s,getElevation:o,pitchAlignment:h,pitchScale:c},i)}},Vy=class extends Bu{};P("HeatmapBucket",Vy,{omit:["layers"]});var cv,hv=()=>cv||=new Wt({"heatmap-radius":new N(S.paint_heatmap["heatmap-radius"],"heatmap-radius"),"heatmap-weight":new N(S.paint_heatmap["heatmap-weight"],"heatmap-weight"),"heatmap-intensity":new V(S.paint_heatmap["heatmap-intensity"],"heatmap-intensity"),"heatmap-color":new fs(S.paint_heatmap["heatmap-color"],"heatmap-color"),"heatmap-opacity":new V(S.paint_heatmap["heatmap-opacity"],"heatmap-opacity")}),pv={get paint(){return hv()}};function $u(t,{width:e,height:r},i,n){if(!n)n=new Uint8Array(e*r*i);else if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==e*r*i)throw RangeError(`mismatched image size. expected: ${n.length} but got: ${e*r*i}`);return t.width=e,t.height=r,t.data=n,t}function Ry(t,{width:e,height:r},i){if(e===t.width&&r===t.height)return;let n=$u({},{width:e,height:r},i);Nu(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},i),t.width=e,t.height=r,t.data=n.data}function Nu(t,e,r,i,n,a){if(n.width===0||n.height===0)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw RangeError("out of range destination coordinates for image copy");let s=t.data,o=e.data;if(s===o)throw Error("srcData equals dstData, so image is already copied");for(let l=0;l<n.height;l++){let u=((r.y+l)*t.width+r.x)*a,c=((i.y+l)*e.width+i.x)*a;for(let h=0;h<n.width*a;h++)o[c+h]=s[u+h]}return e}var Dl=class $y{constructor(e,r){$u(this,e,1,r)}resize(e){Ry(this,e,1)}clone(){return new $y({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,i,n,a){Nu(e,r,i,n,a,1)}},ie=class Ny{constructor(e,r){$u(this,e,4,r)}resize(e){Ry(this,e,4)}replace(e,r){r?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Ny({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,i,n,a){Nu(e,r,i,n,a,4)}setPixel(e,r,i){let n=(e*this.width+r)*4;this.data[n+0]=Math.round(i.r*255/i.a),this.data[n+1]=Math.round(i.g*255/i.a),this.data[n+2]=Math.round(i.b*255/i.a),this.data[n+3]=Math.round(i.a*255)}};function uo(t){let e=new Uint8Array(t.length);for(let r=0;r<t.length;r+=4){let i=t[r+3];e[r+0]=Math.round(t[r+0]*i/255),e[r+1]=Math.round(t[r+1]*i/255),e[r+2]=Math.round(t[r+2]*i/255),e[r+3]=i}return e}P("AlphaImage",Dl),P("RGBAImage",ie);function fv(t){let e={},r=t.resolution||256,i=t.clips?t.clips.length:1,n=t.image||new ie({width:r,height:i});if(!cm(r))throw Error(`width is not a power of 2 - ${r}`);let a=(s,o,l)=>{e[t.evaluationKey]=l;let u=t.expression.evaluate(e);n.setPixel(s/4/r,o/4,u)};if(t.clips)for(let s=0,o=0;s<i;++s,o+=r*4)for(let l=0,u=0;l<r;l++,u+=4){let c=l/(r-1),{start:h,end:p}=t.clips[s],f=h*(1-c)+p*c;a(o,u,f)}else for(let s=0,o=0;s<r;s++,o+=4){let l=s/(r-1);a(0,o,l)}return n}var dv=class extends Te{createBucket(t){return new Vy(t)}constructor(t,e){super(t,pv,e),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){let t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=fv({expression:t,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has("big-fb")&&this.heatmapFbos.delete("big-fb")}queryRadius(t){return ui("heatmap-radius",this,t)}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,projectedCamera:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){return Oy({queryGeometry:t,size:this.paint.get("heatmap-radius").evaluate(e,r)*a,projectedCamera:n,unwrappedTileID:s,getElevation:o},i)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&!this.isHidden()}},yv,mv=()=>yv||=new Wt({"hillshade-illumination-direction":new V(S.paint_hillshade["hillshade-illumination-direction"],"hillshade-illumination-direction"),"hillshade-illumination-altitude":new V(S.paint_hillshade["hillshade-illumination-altitude"],"hillshade-illumination-altitude"),"hillshade-illumination-anchor":new V(S.paint_hillshade["hillshade-illumination-anchor"],"hillshade-illumination-anchor"),"hillshade-exaggeration":new V(S.paint_hillshade["hillshade-exaggeration"],"hillshade-exaggeration"),"hillshade-shadow-color":new V(S.paint_hillshade["hillshade-shadow-color"],"hillshade-shadow-color"),"hillshade-highlight-color":new V(S.paint_hillshade["hillshade-highlight-color"],"hillshade-highlight-color"),"hillshade-accent-color":new V(S.paint_hillshade["hillshade-accent-color"],"hillshade-accent-color"),"hillshade-method":new V(S.paint_hillshade["hillshade-method"],"hillshade-method"),resampling:new V(S.paint_hillshade.resampling,"resampling")}),gv={get paint(){return mv()}},xv=class extends Te{constructor(t,e){super(t,gv,e),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get("hillshade-illumination-direction").values,e=this.paint.get("hillshade-illumination-altitude").values,r=this.paint.get("hillshade-highlight-color").values,i=this.paint.get("hillshade-shadow-color").values,n=Math.max(t.length,e.length,r.length,i.length);t=t.concat(Array(n-t.length).fill(t.at(-1))),e=e.concat(Array(n-e.length).fill(e.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1)));let a=e.map(di);return{directionRadians:t.map(di),altitudeRadians:a,shadowColor:i,highlightColor:r}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}},vv,bv=()=>vv||=new Wt({"color-relief-opacity":new V(S["paint_color-relief"]["color-relief-opacity"],"color-relief-opacity"),"color-relief-color":new fs(S["paint_color-relief"]["color-relief-color"],"color-relief-color"),resampling:new V(S["paint_color-relief"].resampling,"resampling")}),wv={get paint(){return bv()}};function pa(t){return"data"in t}var Qh=class{constructor(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this._ownedHandle=this.texture,this.update(e,i)}update(t,e,r){let{width:i,height:n}=t,a=(this.size?.[0]!==i||this.size[1]!==n)&&!r,{context:s}=this,{gl:o}=s;this.useMipmap=!!e?.useMipmap,a&&this.size&&this.format===o.RGBA&&(o.deleteTexture(this.texture),this.texture=o.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),o.bindTexture(o.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1);let l=this.format===o.RGBA&&e?.premultiply!==!1;if(a)if(this.size=[i,n],this.format===o.RGBA&&i>0&&n>0){let u=this.useMipmap?Math.floor(Math.log2(Math.max(i,n)))+1:1;if(o.texStorage2D(o.TEXTURE_2D,u,o.RGBA8,i,n),pa(t)){s.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:c}=t;l&&c&&(c=uo(c)),c&&o.texSubImage2D(o.TEXTURE_2D,0,0,0,i,n,o.RGBA,o.UNSIGNED_BYTE,c)}else s.pixelStoreUnpackPremultiplyAlpha.set(l),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,t)}else pa(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(t,l,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(t,o));else{let{x:u,y:c}=r||{x:0,y:0};pa(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(t,l,u,c,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(t,u,c,o))}this.useMipmap&&!(pa(t)&&t.data===null)&&o.generateMipmap(o.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(t,e){e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,e.UNSIGNED_BYTE,t)}_uploadRawData(t,e,r,i,n){let{data:a}=t;e&&a&&(a=uo(a)),n.texImage2D(n.TEXTURE_2D,0,this.format,r,i,0,this.format,n.UNSIGNED_BYTE,a)}_updateDomImage(t,e,r,i){i.texSubImage2D(i.TEXTURE_2D,0,e,r,i.RGBA,i.UNSIGNED_BYTE,t)}_updateRawData(t,e,r,i,n,a,s){let{data:o}=t;e&&o&&(o=uo(o)),s.texSubImage2D(s.TEXTURE_2D,0,r,i,n,a,s.RGBA,s.UNSIGNED_BYTE,o)}bind(t,e,r){let{context:i}=this,{gl:n}=i;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST&&r!==n.LINEAR_MIPMAP_LINEAR||this.useMipmap||(r=n.LINEAR);let a=r||t;t!==this.magFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),this.magFilter=t),a!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,a),this.minFilter=a),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)}generateMipmap(){if(!this.useMipmap)return;let{gl:t}=this.context;t.bindTexture(t.TEXTURE_2D,this.texture),t.generateMipmap(t.TEXTURE_2D)}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},jy=class Ca{static{this.byteViewCache=new WeakMap}constructor(e,r,i,n=1,a=1,s=1,o=0){if(this.uid=e,r.height!==r.width)throw RangeError("DEM tiles must be square");if(i&&!["mapbox","terrarium","custom"].includes(i)){Mt(`"${i}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=r.height;let l=this.dim=r.height-4;switch(this.data=new Uint32Array(r.data.buffer),Ca.byteViewCache.set(this,new Uint8Array(this.data.buffer)),i){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,this.greenFactor=a,this.blueFactor=s,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let c=-2;c<l+2;c++){let h=this._idx(0,Math.max(0,Math.min(l-1,c)));(c<0||c>=l)&&this.data.copyWithin(this._idx(0,c),h,h+l),this.data.fill(this.data[h],this._idx(-2,c),this._idx(0,c)),this.data.fill(this.data[h+l-1],this._idx(l,c),this._idx(l+1,c)+1)}let u=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let c=0;c<l;c++)for(let h=0;h<l;h++){let p=this._idx(c,h)*4,f=this._unpackAtIndex(u,p);f>this.max&&(this.max=f),f<this.min&&(this.min=f)}}get(e,r){let i=this._getByteView(),n=this._idx(e,r)*4;return this._unpackAtIndex(i,n)}sampleBilinear(e,r){let i=Math.floor(e),n=Math.floor(r);if(i<-1||i>=this.dim||n<-1||n>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);let a=this._getByteView(),s=((n+2)*this.stride+i+2)*4,o=this.stride*4,l=e-i,u=r-n,c=this._unpackAtIndex(a,s),h=this._unpackAtIndex(a,s+4),p=this._unpackAtIndex(a,s+o),f=this._unpackAtIndex(a,s+o+4);return c*(1-l)*(1-u)+h*l*(1-u)+p*(1-l)*u+f*l*u}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-2||e>=this.dim+2||r<-2||r>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);return(r+2)*this.stride+(e+2)}unpack(e,r,i){return e*this.redFactor+r*this.greenFactor+i*this.blueFactor-this.baseShift}pack(e){return Uy(e,this.getUnpackVector())}getPixels(){return new ie({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,r,i){if(this.dim!==e.dim)throw Error("dem dimension mismatch");let n=r*this.dim,a=r*this.dim+this.dim,s=i*this.dim,o=i*this.dim+this.dim;switch(r){case-1:n=a-2;break;case 1:a=n+2}switch(i){case-1:s=o-2;break;case 1:o=s+2}let l=-r*this.dim,u=-i*this.dim;for(let c=s;c<o;c++)for(let h=n;h<a;h++)this.data[this._idx(h,c)]=e.data[this._idx(h+l,c+u)]}_getByteView(){let e=Ca.byteViewCache.get(this);return e?.buffer!==this.data.buffer&&(e=new Uint8Array(this.data.buffer),Ca.byteViewCache.set(this,e)),e}_unpackAtIndex(e,r){return this.unpack(e[r],e[r+1],e[r+2])}};function Uy(t,e){let r=e[0],i=e[1],n=e[2],a=e[3],s=[r,i,n].filter(c=>c!==0);if(s.length===0)return{r:0,g:0,b:0};let o=Math.min(...s),l=Math.round((t+a)/o),u=c=>c===0?0:Math.floor(l*o/c)%256;return{r:u(r),g:u(i),b:u(n)}}P("DEMData",jy);var _v=class extends Te{constructor(t,e){super(t,wv,e)}_createColorRamp(t){let e={elevationStops:[],colorStops:[]},r=this._transitionablePaint._values["color-relief-color"].value.expression;if(r instanceof mn&&r._styleExpression.expression instanceof pe){this.colorRampExpression=r;let a=r._styleExpression.expression;e.elevationStops=a.labels,e.colorStops=[];for(let s of e.elevationStops)e.colorStops.push(a.evaluate({globals:{elevation:s}}))}if(e.elevationStops.length<1&&(e.elevationStops=[0],e.colorStops=[mt.transparent]),e.elevationStops.length<2&&(e.elevationStops.push(e.elevationStops[0]+1),e.colorStops.push(e.colorStops[0])),e.elevationStops.length<=t)return e;let i={elevationStops:[],colorStops:[]},n=(e.elevationStops.length-1)/(t-1);for(let a=0;a<e.elevationStops.length-.5;a+=n)i.elevationStops.push(e.elevationStops[Math.round(a)]),i.colorStops.push(e.colorStops[Math.round(a)]);return Mt(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${t}, provided: ${e.elevationStops.length}`),i}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(t,e,r){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let i=this._createColorRamp(e),n=new ie({width:i.colorStops.length,height:1}),a=new ie({width:i.colorStops.length,height:1});for(let s=0;s<i.elevationStops.length;s++){let o=Uy(i.elevationStops[s],r);a.setPixel(0,s,new mt(o.r/255,o.g/255,o.b/255,1)),n.setPixel(0,s,i.colorStops[s])}return this.colorRampTextures={elevationTexture:new Qh(t,a,t.gl.RGBA),colorTexture:new Qh(t,n,t.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}},Sl=Tt([{name:"a_pos",components:2,type:"Int16"}],4),Dv=Sl.members;Sl.size,Sl.alignment;function Ya(t,e,r){let i=r.patternDependencies,n=!1;for(let a of e){let s=a.paint.get(`${t}-pattern`);s.isConstant()||(n=!0);let o=s.constantOr(null);o&&(n=!0,i[o.to]=!0,i[o.from]=!0)}return n}function ju(t,e,r,i,n){let{zoom:a}=i,s=n.patternDependencies;for(let o of e){let l=o.paint.get(`${t}-pattern`).value;if(l.kind!=="constant"){let u=l.evaluate({zoom:a-1},r,{},n.availableImages),c=l.evaluate({zoom:a},r,{},n.availableImages),h=l.evaluate({zoom:a+1},r,{},n.availableImages);u=u?.name?u.name:u,c=c?.name?c.name:c,h=h?.name?h.name:h,s[u]=!0,s[c]=!0,s[h]=!0,r.patterns[o.id]={min:u,mid:c,max:h}}}return r}var En=new Set,Al=!1;function Sv(t,e,r=2){let i=e&&e.length,n=i?e[0]*r:t.length;En.size&&En.clear();let a=qy(t,0,n,r,!0),s=[];if(!a||a.next===a.prev)return s;let o=0,l=0,u=0;if(i&&(a=Cv(t,e,a,r)),t.length>80*r){o=t[0],l=t[1];let c=o,h=l;for(let p=r;p<n;p+=r){let f=t[p],d=t[p+1];f<o&&(o=f),d<l&&(l=d),f>c&&(c=f),d>h&&(h=d)}u=Math.max(c-o,h-l),u=u===0?0:32767/u}return El(a,s,o,l,u),s}function qy(t,e,r,i,n){let a=null;if(n===jv(t,e,r,i)>0)for(let s=e;s<r;s+=i)a=rp(s/i|0,t[s],t[s+1],a);else for(let s=r-i;s>=e;s-=i)a=rp(s/i|0,t[s],t[s+1],a);return a&&Tn(a,a.next)&&(Cn(a),a=a.next),a}function Lr(t,e=t){let r=e===t,i=t,n;do n=!1,i!==i.next&&(En.size===0||!En.has(i))&&(Tn(i,i.next)||kt(i.prev,i,i.next)===0)?((r||i===e)&&(e=i.prev),Al=!0,Cn(i),i=i.prev,n=!0):(r||i!==e)&&(i=i.next,n=!r);while(n||i!==e);return e}function El(t,e,r,i,n){n&&Lv(t,r,i,n);let a=t,s=!1;for(;t.prev!==t.next;){let o=t.prev,l=t.next;if(kt(o,t,l)<0&&(n?Ev(t,r,i,n):Av(t)))e.push(o.i,t.i,l.i),Cn(t),t=l,a=l;else if(t=l,t===a){if(Al=!1,t=Lr(t),Al){a=t;continue}if(!s){t=Tv(t,e),a=t,s=!0;continue}Fv(t,e,r,i,n);break}}}function Av(t){let e=t.prev,r=t,i=t.next,n=e.x,a=r.x,s=i.x,o=e.y,l=r.y,u=i.y,c=Math.min(n,a,s),h=Math.min(o,l,u),p=Math.max(n,a,s),f=Math.max(o,l,u),d=i.next;for(;d!==e;){if(d.x>=c&&d.x<=p&&d.y>=h&&d.y<=f&&(n!==d.x||o!==d.y)&&Za(n,o,a,l,s,u,d.x,d.y)&&kt(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Ev(t,e,r,i){let n=t.prev,a=t,s=t.next,o=n.x,l=a.x,u=s.x,c=n.y,h=a.y,p=s.y,f=Math.min(o,l,u),d=Math.min(c,h,p),y=Math.max(o,l,u),m=Math.max(c,h,p),g=Il(f,d,e,r,i),x=Il(y,m,e,r,i),v=t.prevZ;for(;v&&v.z>=g;){if(v.x>=f&&v.x<=y&&v.y>=d&&v.y<=m&&v!==s&&(o!==v.x||c!==v.y)&&Za(o,c,l,h,u,p,v.x,v.y)&&kt(v.prev,v,v.next)>=0)return!1;v=v.prevZ}let b=t.nextZ;for(;b&&b.z<=x;){if(b.x>=f&&b.x<=y&&b.y>=d&&b.y<=m&&b!==s&&(o!==b.x||c!==b.y)&&Za(o,c,l,h,u,p,b.x,b.y)&&kt(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Tv(t,e){let r=t,i=!1;do{let n=r.prev,a=r.next.next;Xy(n,r,r.next,a,!1)&&Fn(n,a)&&Fn(a,n)&&(e.push(n.i,r.i,a.i),Cn(r),Cn(r.next),r=t=a,i=!0),r=r.next}while(r!==t);return i?Lr(r):r}function Fv(t,e,r,i,n){let a=t;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&Rv(a,s)){let o=Yy(a,s);a=Lr(a,a.next),o=Lr(o,o.next),El(a,e,r,i,n),El(o,e,r,i,n);return}s=s.next}a=a.next}while(a!==t)}var Tl=!1;function Cv(t,e,r,i){let n=[];for(let a=0,s=e.length;a<s;a++){let o=qy(t,e[a]*i,a<s-1?e[a+1]*i:t.length,i,!1);o===o.next&&En.add(o),n.push(Vv(o))}n.sort(Iv),Mv(t.length/i,e.length),Gy(r,r),Tl=!0;for(let a=0;a<n.length;a++)r=kv(n[a],r);return Tl=!1,Lr(r)}function Iv(t,e){return t.x-e.x||t.y-e.y||(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}function kv(t,e){let r=Bv(t,e);if(!r)return e;let i=Yy(r,t);return Gy(r,i.next.next),Lr(i,i.next),Lr(r,r.next)}var Et=new Float64Array,Wa=0,Fl=[],Cl=[];function Mv(t,e){let r=Math.ceil((t+2*e)/16)+e+2;Et.length<r*4&&(Et=new Float64Array(r*4)),Wa=0}function Gy(t,e){let r=t;do{let i=Wa++;Fl[i]=r;let n=r.x,a=r.y,s=r.x,o=r.y,l=0;do{let c=r.next;r.z=i,c.x<n&&(n=c.x),c.x>s&&(s=c.x),c.y<a&&(a=c.y),c.y>o&&(o=c.y),r=c}while(++l<16&&r!==e);Cl[i]=r;let u=i*4;Et[u]=n,Et[u+1]=a,Et[u+2]=s,Et[u+3]=o}while(r!==e)}function Pv(t,e){let r=t.z*4;e.x<Et[r]&&(Et[r]=e.x),e.y<Et[r+1]&&(Et[r+1]=e.y),e.x>Et[r+2]&&(Et[r+2]=e.x),e.y>Et[r+3]&&(Et[r+3]=e.y)}function tp(t){let e=Cl[t];for(;e.prev.next!==e;)e=e.next;return Cl[t]=e,e}function ep(t){let e=Fl[t];for(;e.prev.next!==e;)e=e.next;return Fl[t]=e,e}function Bv(t,e){let r=e,i=t.x,n=t.y,a=-1/0,s;if(Tn(t,r))return r;for(let p=0,f=0;p<Wa;p++,f+=4){if(n<Et[f+1]||n>Et[f+3]||Et[f]>i||Et[f+2]<=a)continue;let d=tp(p);r=ep(p);do{if(r.prev.next===r){if(Tn(t,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let y=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(y<=i&&y>a&&(a=y,s=r.x<r.next.x?r:r.next,y===i))return s}}r=r.next}while(r!==d)}if(!s)return null;let o=s.x,l=s.y,u=Math.min(n,l),c=Math.max(n,l),h=1/0;for(let p=0,f=0;p<Wa;p++,f+=4){if(Et[f+2]<o||Et[f]>i||Et[f+3]<u||Et[f+1]>c)continue;let d=tp(p);r=ep(p);do{if(r.prev.next===r&&i>=r.x&&r.x>=o&&i!==r.x&&Za(n<l?i:a,n,o,l,n<l?a:i,n,r.x,r.y)){let y=Math.abs(n-r.y)/(i-r.x);(Fn(r,t)||r.y===n&&r.next.y===n&&r.next.x>i)&&(y<h||y===h&&(r.x>s.x||r.x===s.x&&zv(s,r)))&&(s=r,h=y)}r=r.next}while(r!==d)}return s}function zv(t,e){return kt(t.prev,t,e.prev)<0&&kt(e.next,t,t.next)<0}var re=[],ei=[],wr=new Uint32Array,qi=new Uint32Array,Gi=new Uint32Array(256);function Lv(t,e,r,i){let n=t,a=0;do n.z=Il(n.x,n.y,e,r,i),re[a++]=n,n=n.next;while(n!==t);Ov(a);let s=null;for(let o=0;o<a;o++){let l=re[o];l.prevZ=s,s&&(s.nextZ=l),s=l}s.nextZ=null,re.fill(null,0,a),ei.fill(null,0,a)}function Ov(t){if(t<=32)for(let e=1;e<t;e++){let r=re[e],i=r.z,n=e-1;for(;n>=0&&re[n].z>i;)re[n+1]=re[n],n--;re[n+1]=r}else{wr.length<t&&(wr=new Uint32Array(t),qi=new Uint32Array(t),ei=Array(t));for(let e=0;e<t;e++)wr[e]=re[e].z;fa(t,re,wr,ei,qi,0),fa(t,ei,qi,re,wr,8),fa(t,re,wr,ei,qi,16),fa(t,ei,qi,re,wr,24)}}function fa(t,e,r,i,n,a){Gi.fill(0);for(let o=0;o<t;o++)Gi[r[o]>>>a&255]++;let s=0;for(let o=0;o<256;o++){let l=Gi[o];Gi[o]=s,s+=l}for(let o=0;o<t;o++){let l=r[o],u=Gi[l>>>a&255]++;i[u]=e[o],n[u]=l}}function Il(t,e,r,i,n){return t=(t-r)*n|0,e=(e-i)*n|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function Vv(t){let e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function Za(t,e,r,i,n,a,s,o){return(n-s)*(e-o)>=(t-s)*(a-o)&&(t-s)*(i-o)>=(r-s)*(e-o)&&(r-s)*(a-o)>=(n-s)*(i-o)}function Rv(t,e){let r=Tn(t,e)&&kt(t.prev,t,t.next)>0&&kt(e.prev,e,e.next)>0;return t.next.i!==e.i&&(r||Fn(t,e)&&Fn(e,t)&&(kt(t.prev,t,e.prev)!==0||kt(t,e.prev,e)!==0))&&!$v(t,e)&&(r||Nv(t,e))}function kt(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Tn(t,e){return t.x===e.x&&t.y===e.y}function Xy(t,e,r,i,n=!0){let a=kt(t,e,r),s=kt(t,e,i),o=kt(r,i,t),l=kt(r,i,e);return(a>0&&s<0||a<0&&s>0)&&(o>0&&l<0||o<0&&l>0)?!0:n?!!(a===0&&da(t,r,e)||s===0&&da(t,i,e)||o===0&&da(r,t,i)||l===0&&da(r,e,i)):!1}function da(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function $v(t,e){let r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.y,e.y),s=t;do{let o=s.next;if(s.x>i&&o.x>i||s.x<r&&o.x<r||s.y>a&&o.y>a||s.y<n&&o.y<n)s=o;else{if(s.i!==t.i&&o.i!==t.i&&s.i!==e.i&&o.i!==e.i&&Xy(s,o,t,e))return!0;s=o}}while(s!==t);return!1}function Fn(t,e){return kt(t.prev,t,t.next)<0?kt(t,e,t.next)>=0&&kt(t,t.prev,e)>=0:kt(t,e,t.prev)<0||kt(t,t.next,e)<0}function Nv(t,e){let r=t,i=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do{let s=r.next;r.y>a!=s.y>a&&n<(s.x-r.x)*(a-r.y)/(s.y-r.y)+r.x&&(i=!i),r=s}while(r!==t);return i}function Yy(t,e){let r=kl(t.i,t.x,t.y),i=kl(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function rp(t,e,r,i){let n=kl(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function Cn(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ),Tl&&Pv(t.prev,t.next)}function kl(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function jv(t,e,r,i){let n=0;for(let a=e,s=r-i;a<r;a+=i)n+=(t[s]-t[a])*(t[a+1]+t[s+1]),s=a;return n}var en=class{constructor(t,e){if(e>t)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=e}getGranularityForZoomLevel(t){let e=1<<t;return Math.max(Math.floor(this._baseZoomGranularity/e),this._minGranularity,1)}},Uv=class Wy{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}static{this.noSubdivision=new Wy({fill:new en(0,0),line:new en(0,0),tile:new en(0,0),stencil:new en(0,0),circle:1})}};P("SubdivisionGranularityExpression",en),P("SubdivisionGranularitySetting",Uv);var co=-32768,ho=32767,qv=class{constructor(t,e){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=t,this._granularityCellSize=et/t,this._canonical=e}_getKey(t,e){return t+=32768,e+=32768,t<<16|e}_vertexToIndex(t,e){if(t<-32768||e<-32768||t>32767||e>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let r=Math.round(t)|0,i=Math.round(e)|0,n=this._getKey(r,i),a=this._vertexDictionary.get(n);if(a!==void 0)return a;let s=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,s),this._vertexBuffer.push(r,i),s}_subdivideTrianglesScanline(t,e){if(this._granularity<2)return Yv(this._vertexBuffer,Xv(t,e));let r=[],i=t.length;for(let n=0;n<i;n+=3){let a=[e[t[n+0]],e[t[n+1]],e[t[n+2]]],s=[this._vertexBuffer[a[0]*2+0],this._vertexBuffer[a[0]*2+1],this._vertexBuffer[a[1]*2+0],this._vertexBuffer[a[1]*2+1],this._vertexBuffer[a[2]*2+0],this._vertexBuffer[a[2]*2+1]],o=1/0,l=1/0,u=-1/0,c=-1/0;for(let y=0;y<3;y++){let m=s[y*2],g=s[y*2+1];o=Math.min(o,m),u=Math.max(u,m),l=Math.min(l,g),c=Math.max(c,g)}if(o===u||l===c)continue;let h=Math.floor(o/this._granularityCellSize),p=Math.ceil(u/this._granularityCellSize),f=Math.floor(l/this._granularityCellSize),d=Math.ceil(c/this._granularityCellSize);if(h===p&&f===d)r.push(...a);else for(let y=f;y<d;y++){let m=this._scanlineGenerateVertexRingForCellRow(y,s,a);Wv(this._vertexBuffer,m,r)}}return r}_scanlineGenerateVertexRingForCellRow(t,e,r){let i=t*this._granularityCellSize,n=i+this._granularityCellSize,a=[];for(let s=0;s<3;s++){let o=e[s*2],l=e[s*2+1],u=e[(s+1)*2%6],c=e[((s+1)*2+1)%6],h=e[(s+2)*2%6],p=e[((s+2)*2+1)%6],f=u-o,d=c-l,y=f===0,m=d===0,g=(i-l)/d,x=(n-l)/d,v=Math.min(g,x),b=Math.max(g,x);if(!m&&(v>=1||b<=0)||m&&(l<i||l>n)){c>=i&&c<=n&&a.push(r[(s+1)%3]);continue}if(!m&&v>0){let D=o+f*v,A=l+d*v;a.push(this._vertexToIndex(D,A))}let w=o+f*Math.max(v,0),_=o+f*Math.min(b,1);if(y||this._generateIntraEdgeVertices(a,o,l,u,c,w,_),!m&&b<1){let D=o+f*b,A=l+d*b;a.push(this._vertexToIndex(D,A))}(m||c>=i&&c<=n)&&a.push(r[(s+1)%3]),!m&&(c<=i||c>=n)&&this._generateInterEdgeVertices(a,o,l,u,c,h,p,_,i,n)}return a}_generateIntraEdgeVertices(t,e,r,i,n,a,s){let o=i-e,l=n-r,u=l===0,c=u?Math.min(e,i):Math.min(a,s),h=u?Math.max(e,i):Math.max(a,s),p=Math.floor(c/this._granularityCellSize)+1,f=Math.ceil(h/this._granularityCellSize)-1;if(u?e<i:a<s)for(let d=p;d<=f;d++){let y=d*this._granularityCellSize,m=r+l*(y-e)/o;t.push(this._vertexToIndex(y,m))}else for(let d=f;d>=p;d--){let y=d*this._granularityCellSize,m=r+l*(y-e)/o;t.push(this._vertexToIndex(y,m))}}_generateInterEdgeVertices(t,e,r,i,n,a,s,o,l,u){let c=n-r,h=a-i,p=s-n,f=(l-n)/p,d=(u-n)/p,y=Math.min(f,d),m=Math.max(f,d),g=i+h*y,x=Math.floor(Math.min(g,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(g,o)/this._granularityCellSize)-1,b=o<g,w=p===0;if(w&&(s===l||s===u))return;if(w||y>=1||m<=0){let D=e-a,A=r-s,E=(l-s)/A,O=(u-s)/A,k=a+D*Math.min(E,O);x=Math.floor(Math.min(k,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(k,o)/this._granularityCellSize)-1,b=o<k}let _=c>0?u:l;if(b)for(let D=x;D<=v;D++){let A=D*this._granularityCellSize;t.push(this._vertexToIndex(A,_))}else for(let D=v;D>=x;D--){let A=D*this._granularityCellSize;t.push(this._vertexToIndex(A,_))}}_generateOutline(t,e){let r=[],i=0;for(let n of t){let a=this._granularity<2?this._ringPathIndices(n,i,e):this._pointArrayToIndices(Tr(n,this._granularity,!0));i+=n.length;let s=[];for(let o=1;o<a.length;o++)s.push(a[o-1]),s.push(a[o]);r.push(s)}return r}_ringPathIndices(t,e,r){let i=r.slice(e,e+t.length);return i.length>=2&&Hy(t)&&i.push(i[0]),i}_handlePoles(t){let e=!1,r=!1;this._canonical&&(this._canonical.y===0&&(e=!0),this._canonical.y===(1<<this._canonical.z)-1&&(r=!0)),(e||r)&&this._fillPoles(t,e,r)}_ensureNoPoleVertices(){let t=this._vertexBuffer;for(let e=0;e<t.length;e+=2){let r=t[e+1];r===-32768&&(t[e+1]=-32767),r===32767&&(t[e+1]=32766)}}_generatePoleQuad(t,e,r,i,n,a){i>n==(a===-32768)?(t.push(r),t.push(e),t.push(this._vertexToIndex(i,a)),t.push(this._vertexToIndex(n,a)),t.push(r),t.push(this._vertexToIndex(i,a))):(t.push(e),t.push(r),t.push(this._vertexToIndex(i,a)),t.push(r),t.push(this._vertexToIndex(n,a)),t.push(this._vertexToIndex(i,a)))}_fillPoles(t,e,r){let i=this._vertexBuffer,n=et,a=t.length;for(let s=2;s<a;s+=3){let o=t[s-2],l=t[s-1],u=t[s],c=i[o*2],h=i[o*2+1],p=i[l*2],f=i[l*2+1],d=i[u*2],y=i[u*2+1];e&&(h===0&&f===0&&this._generatePoleQuad(t,o,l,c,p,co),f===0&&y===0&&this._generatePoleQuad(t,l,u,p,d,co),y===0&&h===0&&this._generatePoleQuad(t,u,o,d,c,co)),r&&(h===n&&f===n&&this._generatePoleQuad(t,o,l,c,p,ho),f===n&&y===n&&this._generatePoleQuad(t,l,u,p,d,ho),y===n&&h===n&&this._generatePoleQuad(t,u,o,d,c,ho))}}_initializeVertices(t){let e=[];for(let r=0;r<t.length;r+=2)e.push(this._vertexToIndex(t[r],t[r+1]));return e}subdividePolygonInternal(t,e){if(this._used)throw Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:r,holeIndices:i}=Gv(t),n=this._initializeVertices(r),a;try{let o=Sv(r,i);a=this._subdivideTrianglesScanline(o,n)}catch(o){console.error(o)}let s=[];return e&&(s=this._generateOutline(t,n)),this._ensureNoPoleVertices(),this._handlePoles(a),this._granularity>=2&&this._canonical?.z===0&&(a=this._removeTrianglesOutsideTileX(a),s=s.map(o=>this._removeLinesOutsideTileX(o))),{verticesFlattened:this._vertexBuffer,indicesTriangles:a,indicesLineList:s}}_vertexOutsideTileX(t){let e=this._vertexBuffer[t*2];return e<0||e>8192}_removeTrianglesOutsideTileX(t){let e=[];for(let r=0;r<t.length;r+=3)this._vertexOutsideTileX(t[r])||this._vertexOutsideTileX(t[r+1])||this._vertexOutsideTileX(t[r+2])||e.push(t[r],t[r+1],t[r+2]);return e}_removeLinesOutsideTileX(t){let e=[];for(let r=0;r<t.length;r+=2)this._vertexOutsideTileX(t[r])||this._vertexOutsideTileX(t[r+1])||e.push(t[r],t[r+1]);return e}_pointArrayToIndices(t){let e=[];for(let r of t)e.push(this._vertexToIndex(r.x,r.y));return e}};function Zy(t,e,r,i=!0){return new qv(r,e).subdividePolygonInternal(t,i)}function Tr(t,e,r=!1){if(!t||t.length<1||t.length<2)return[];let i=r&&Hy(t);if(e<2)return i?[...t,t[0]]:[...t];let n=Math.floor(et/e),a=[];a.push(new F(t[0].x,t[0].y));let s=t.length,o=i?s:s-1;for(let l=0;l<o;l++){let u=t[l],c=l<s-1?t[l+1]:t[0],h=u.x,p=u.y,f=c.x,d=c.y,y=h!==f,m=p!==d;if(!y&&!m)continue;let g=f-h,x=d-p,v=Math.abs(g),b=Math.abs(x),w=h,_=p;for(;;){let A=g>0?(Math.floor(w/n)+1)*n:(Math.ceil(w/n)-1)*n,E=x>0?(Math.floor(_/n)+1)*n:(Math.ceil(_/n)-1)*n,O=Math.abs(w-A),k=Math.abs(_-E),B=Math.abs(w-f),R=Math.abs(_-d),I=y?O/v:1/0,C=m?k/b:1/0;if((B<=O||!y)&&(R<=k||!m))break;if(I<C&&y||!m){w=A,_+=x*I;let L=new F(w,Math.round(_));(a[a.length-1].x!==L.x||a[a.length-1].y!==L.y)&&a.push(L)}else{w+=g*C,_=E;let L=new F(Math.round(w),_);(a[a.length-1].x!==L.x||a[a.length-1].y!==L.y)&&a.push(L)}}let D=new F(f,d);(a[a.length-1].x!==D.x||a[a.length-1].y!==D.y)&&a.push(D)}return a}function Hy(t){return!t[0].equals(t[t.length-1])}function Gv(t){let e=[],r=[];for(let i of t)if(i.length!==0){i!==t[0]&&e.push(r.length/2);for(let n of i)r.push(n.x),r.push(n.y)}return{flattened:r,holeIndices:e}}function Xv(t,e){let r=Array(t.length);for(let i=0;i<t.length;i++)r[i]=e[t[i]];return r}function Yv(t,e){let r=[];for(let i=0;i<e.length;i+=3){let n=e[i],a=e[i+1],s=e[i+2],o=t[n*2],l=t[n*2+1],u=t[a*2],c=t[a*2+1],h=t[s*2],p=t[s*2+1],f=u-o,d=c-l,y=h-o;f*(p-l)-d*y>0?(r.push(n),r.push(s),r.push(a)):(r.push(n),r.push(a),r.push(s))}return r}function Wv(t,e,r){if(e.length===0)throw Error("Subdivision vertex ring is empty.");let i=0,n=t[e[0]*2];for(let l=1;l<e.length;l++){let u=t[e[l]*2];u<n&&(n=u,i=l)}let a=e.length,s=i,o=(s+1)%a;for(;;){let l=s-1>=0?s-1:a-1,u=(o+1)%a,c=t[e[l]*2],h=t[e[l]*2+1],p=t[e[u]*2],f=t[e[u]*2+1],d=t[e[s]*2],y=t[e[s]*2+1],m=t[e[o]*2],g=t[e[o]*2+1],x=!1;if(c<p)x=!0;else if(c>p)x=!1;else{let v=g-y,b=-(m-d),w=y<g?1:-1;((c-d)*v+(h-y)*b)*w>((p-d)*v+(f-y)*b)*w&&(x=!0)}if(x){let v=e[l],b=e[s],w=e[o];v!==b&&v!==w&&b!==w&&r.push(w,b,v),s--,s<0&&(s=a-1)}else{let v=e[u],b=e[s],w=e[o];v!==b&&v!==w&&b!==w&&r.push(w,b,v),o++,o>=a&&(o=0)}if(l===u)break}}function Ky(t,e,r,i,n,a,s,o,l){let u=n.length/2,c=s&&o&&l;if(u<ae.MAX_VERTEX_ARRAY_LENGTH){let h=e.prepareSegment(u,r,i),p=h.vertexLength;for(let y=0;y<a.length;y+=3)i.emplaceBack(p+a[y],p+a[y+1],p+a[y+2]);h.vertexLength+=u,h.primitiveLength+=a.length/3;let f,d;c&&(d=s.prepareSegment(u,r,o),f=d.vertexLength,d.vertexLength+=u);for(let y=0;y<n.length;y+=2)t(n[y],n[y+1]);if(c)for(let y of l){for(let m=1;m<y.length;m+=2)o.emplaceBack(f+y[m-1],f+y[m]);d.primitiveLength+=y.length/2}}else Zv(e,r,i,n,a,t),c&&Hv(s,r,o,n,l,t),e.forceNewSegmentOnNextPrepare(),s?.forceNewSegmentOnNextPrepare()}function cn(t,e,r,i,n,a,s){if(a){let o=i.count;return r(e[n*2],e[n*2+1]),t[n]=i.count,i.count++,s.vertexLength++,o}return t[n]}function Zv(t,e,r,i,n,a){let s=[];for(let h=0;h<i.length/2;h++)s.push(-1);let o={count:0},l=0,u=t.getOrCreateLatestSegment(e,r),c=u.vertexLength;for(let h=2;h<n.length;h+=3){let p=n[h-2],f=n[h-1],d=n[h],y=s[p]<l,m=s[f]<l,g=s[d]<l,x=+!!y+ +!!m+ +!!g;u.vertexLength+x>ae.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,g=!0,c=0);let v=cn(s,i,a,o,p,y,u),b=cn(s,i,a,o,f,m,u),w=cn(s,i,a,o,d,g,u);r.emplaceBack(c+v-l,c+b-l,c+w-l),u.primitiveLength++}}function Hv(t,e,r,i,n,a){let s=[];for(let h=0;h<i.length/2;h++)s.push(-1);let o={count:0},l=0,u=t.getOrCreateLatestSegment(e,r),c=u.vertexLength;for(let h of n)for(let p=1;p<h.length;p+=2){let f=h[p-1],d=h[p],y=s[f]<l,m=s[d]<l,g=+!!y+ +!!m;u.vertexLength+g>ae.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,c=0);let x=cn(s,i,a,o,f,y,u),v=cn(s,i,a,o,d,m,u);r.emplaceBack(c+x-l,c+v-l),u.primitiveLength++}}var Jy=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new Qx,this.indexArray=new Vn,this.indexArray2=new ul,this.programConfigurations=new zr(t.layers,t.zoom),this.segments=new ae,this.segments2=new ae,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=Ya("fill",this.layers,e);let i=this.layers[0].layout.get("fill-sort-key"),n=!i.isConstant(),a=[],s=new ot(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:c,sourceLayerIndex:h}of t){let p=Fi(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r,e.availableImages):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:o?p.geometry:Rr(l),patterns:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:c,sourceLayerIndex:h}=l;if(this.hasDependencies){let f=ju("fill",this.layers,l,{zoom:this.zoom},e);this.patternFeatures.push(f)}else this.addFeature(l,u,c,r,{},e.subdivisionGranularity);let p=t[c].feature;e.featureIndex.insert(p,u,c,h,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures({options:t,canonical:e,patternPositions:r,patternMap:i}){this.detectSdfPatterns(i);for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,t.subdivisionGranularity)}detectSdfPatterns(t){for(let e of this.patternFeatures)for(let r in e.patterns){let i=e.patterns[r];this.recordSdfPattern(r,t[i.min]),this.recordSdfPattern(r,t[i.mid]),this.recordSdfPattern(r,t[i.max])}for(let e of this.layers){let r=e.paint.get("fill-pattern").constantOr(null);r&&(this.recordSdfPattern(e.id,t[r.from.toString()]),this.recordSdfPattern(e.id,t[r.to.toString()]))}}recordSdfPattern(t,e){if(!e)return;let r=e.sdf===!0,i=this.sdfPatterns[t];i===void 0?this.sdfPatterns[t]=r:i!==r&&Mt(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer "${t}"`)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Dv),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,r,i,n,a){for(let s of os(e,500)){let o=Zy(s,i,a.fill.getGranularityForZoomLevel(i.z)),l=this.layoutVertexArray;Ky((u,c)=>{l.emplaceBack(u,c)},this.segments,this.layoutVertexArray,this.indexArray,o.verticesFlattened,o.indicesTriangles,this.segments2,this.indexArray2,o.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,canonical:i})}};P("FillBucket",Jy,{omit:["layers","patternFeatures"]});var Kv,Jv=()=>Kv||=new Wt({"fill-sort-key":new N(S.layout_fill["fill-sort-key"],"fill-sort-key")}),Qv,tb=()=>Qv||=new Wt({"fill-antialias":new V(S.paint_fill["fill-antialias"],"fill-antialias"),"fill-opacity":new N(S.paint_fill["fill-opacity"],"fill-opacity"),"fill-layer-opacity":new V(S.paint_fill["fill-layer-opacity"],"fill-layer-opacity"),"fill-layer-blend":new V(S.paint_fill["fill-layer-blend"],"fill-layer-blend"),"fill-color":new N(S.paint_fill["fill-color"],"fill-color"),"fill-outline-color":new N(S.paint_fill["fill-outline-color"],"fill-outline-color"),"fill-translate":new V(S.paint_fill["fill-translate"],"fill-translate"),"fill-translate-anchor":new V(S.paint_fill["fill-translate-anchor"],"fill-translate-anchor"),"fill-pattern":new bn(S.paint_fill["fill-pattern"],"fill-pattern"),"fill-rounded-corner-distance":new V(S.paint_fill["fill-rounded-corner-distance"],"fill-rounded-corner-distance")}),eb={get paint(){return tb()},get layout(){return Jv()}},rb=class extends Te{constructor(t,e){super(t,eb,e)}recalculate(t,e){super.recalculate(t,e);let r=this.paint._values["fill-outline-color"];r.value.kind==="constant"&&r.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new Jy(t)}queryRadius(){return gs(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:t,geometry:e,projectedCamera:r,pixelsToTileUnits:i}){return gy(xs(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-r.bearingInRadians,i),e)}isTileClipped(){return!0}},Ml=Tt([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),ib=Tt([{name:"a_centroid",components:2,type:"Int16"}],4),nb=Ml.members;Ml.size,Ml.alignment;var Rn=class{constructor(t,e,r,i,n){for(this.properties=Object.create(null),this.extent=r,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n;t.pos<e;){let a=t.readVarint();if(a===8)this.id=t.readVarint();else if(a===18){let s=t.readVarint()+t.pos;for(;t.pos<s;){let o=i[t.readVarint()],l=n[t.readVarint()];this.properties[o]=l}}else a===24?this.type=t.readVarint():(a===34&&(this._geometry=t.pos),t.skip(a))}}loadGeometry(){if(this._geometry<0)throw Error("feature has no geometry");let t=this._pbf;t.pos=this._geometry;let e=t.readVarint()+t.pos,r=[],i,n=1,a=0,s=0,o=0;for(;t.pos<e;){if(a<=0){let l=t.readVarint();if(n=l&7,a=l>>3,a===0)continue}if(a--,n===1)s+=t.readSVarint(),o+=t.readSVarint(),i&&r.push(i),i=[new F(s,o)];else if(n===2)s+=t.readSVarint(),o+=t.readSVarint(),i&&i.push(new F(s,o));else if(n===7)i&&i.push(i[0].clone());else throw Error(`unknown command ${n}`)}return i&&r.push(i),r}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let t=this._pbf;t.pos=this._geometry;let e=t.readVarint()+t.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,l=1/0,u=-1/0;for(;t.pos<e;){if(i<=0){let c=t.readVarint();if(r=c&7,i=c>>3,i===0)continue}if(i--,r===1||r===2)n+=t.readSVarint(),a+=t.readSVarint(),n<s&&(s=n),n>o&&(o=n),a<l&&(l=a),a>u&&(u=a);else if(r!==7)throw Error(`unknown command ${r}`)}return[s,l,o,u]}toGeoJSON(t,e,r){let i=this.extent*2**r,n=this.extent*t,a=this.extent*e,s=this.loadGeometry();function o(h){return[(h.x+n)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(h.y+a)*2/i)*Math.PI))-90]}function l(h){return h.map(o)}let u;if(this.type===1){let h=[];for(let f of s)h.push(f[0]);let p=l(h);u=h.length===1?{type:"Point",coordinates:p[0]}:{type:"MultiPoint",coordinates:p}}else if(this.type===2){let h=s.map(l);u=h.length===1?{type:"LineString",coordinates:h[0]}:{type:"MultiLineString",coordinates:h}}else if(this.type===3){let h=Qy(s),p=[];for(let f of h)p.push(f.map(l));u=p.length===1?{type:"Polygon",coordinates:p[0]}:{type:"MultiPolygon",coordinates:p}}else throw Error("unknown feature type");let c={type:"Feature",geometry:u,properties:this.properties};return this.id!=null&&(c.id=this.id),c}};Rn.types=["Unknown","Point","LineString","Polygon"];function Qy(t){let e=t.length;if(e<=1)return[t];let r=[],i,n;for(let a=0;a<e;a++){let s=ab(t[a]);s!==0&&(n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[t[a]]):i&&i.push(t[a]))}return i&&r.push(i),r}function ab(t){let e=0;for(let r=0,i=t.length,n=i-1,a,s;r<i;n=r++)a=t[r],s=t[n],e+=(s.x-a.x)*(a.y+s.y);return e}var sb=class{constructor(t,e){for(this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],e===void 0&&(e=t.length);t.pos<e;){let r=t.readVarint();r===10?this.name=t.readString():r===18?(this._features.push(t.pos),t.skip(r)):r===26?this._keys.push(t.readString()):r===34?this._values.push(ob(t)):r===40?this.extent=t.readVarint():r===120?this.version=t.readVarint():t.skip(r)}this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[t];let e=this._pbf.readVarint()+this._pbf.pos;return new Rn(this._pbf,e,this.extent,this._keys,this._values)}};function ob(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let i=t.readVarint();e=i===10?t.readString():i===21?t.readFloat():i===25?t.readDouble():i===32?t.readVarint(!0):i===40?t.readVarint():i===48?t.readSVarint():i===56?t.readBoolean():(t.skip(i),null)}if(e==null)throw Error("unknown feature value");return e}var t1=class{constructor(t,e=t.length){let r=Object.create(null);for(;t.pos<e;){let i=t.readVarint();if(i===26){let n=new sb(t,t.readVarint()+t.pos);n.length&&(r[n.name]=n)}else t.skip(i)}this.layers=r}};function lb(t,e){return e<=0||!t||t.length===0?t:t.map(r=>pb(r,e))}function ub(t,e){let r=F2(et/2,et/2,e),i=me.fromLngLat(r).meterInMercatorCoordinateUnits(),n=(1<<e.z)*et;return t*i*n}var cb=Math.cos(35*Math.PI/180);function hb(t){let e=[null];for(let a=1;a<t.length;a++){let s=t[a].sub(t[a-1]),o=!Ua(t[a],t[a-1])&&s.mag()>0;e.push(o?s._perp():null)}let r=t.length-1,i=r>1&&t[0].equals(t[r]),n=[null];for(let a=1;a<=r;a++){let s=e[a];if(!s){n.push(null);continue}let o=i&&a===1?e[r]:e[a-1],l=i&&a===r?e[1]:e[a+1];n.push({start:ip(s,o),end:ip(s,l)})}return n}function ip(t,e){if(!e)return t.unit();let r=t.mag(),i=e.mag();return t.x*e.x+t.y*e.y<cb*r*i||r>=2*i?t.unit():i>=2*r?e.unit():t.add(e)._unit()}function pb(t,e){if(!t||t.length<3)return t;let r=t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y,i=r?t.length-1:t.length;if(i<3)return t;let n=[],a=Ua(t[i-1],t[0]);for(let o=0;o<i;o++){let l=t[(o-1+i)%i],u=t[o],c=t[(o+1)%i],h=Ua(u,c);a||h?n.push(u.clone()):db(n,l,u,c,e),a=h}let s=fb(n);return s.length<3?t:(r&&s.push(s[0].clone()),s)}function fb(t){let e=[];for(let r of t){let i=r.round(),n=e[e.length-1];(n?.x!==i.x||n?.y!==i.y)&&e.push(i)}for(;e.length>1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y;)e.pop();return e}function db(t,e,r,i,n){let a=e.sub(r),s=i.sub(r),o=a.mag(),l=s.mag();if(o<1e-6||l<1e-6){t.push(r.clone());return}a._div(o),s._div(l);let u=a.x*s.x+a.y*s.y;if(Math.abs(u)>Math.cos(5*Math.PI/180)){t.push(r.clone());return}let c=.2,h=Math.min(n,o*c,l*c),p=r.add(a.mult(h)),f=r.add(s.mult(h)),d=Math.sqrt((1+u)/2),y=r.add(a.add(s)._unit()._mult(h/d)),m=p.sub(y).angleWith(f.sub(y)),g=Math.max(2,Math.ceil(Math.abs(m)/(Math.PI/6)-1e-6));for(let x=0;x<=g;x++)t.push(p.rotateAround(x/g*m,y))}var po=8192;function Xi(t,e,r,i,n,a,s,o){t.emplaceBack(e,r,Math.floor(i*po)*2+s,n*po*2,a*po*2,Math.round(o))}var e1=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new t2,this.centroidVertexArray=new Kx,this.indexArray=new Vn,this.programConfigurations=new zr(t.layers,t.zoom),this.segments=new ae,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.features=[],this.hasDependencies=Ya("fill-extrusion",this.layers,e);let i=new ot(this.zoom),n=this.layers[0],a=n.layout.get("fill-extrusion-rounded-corner-distance"),s=a>0?ub(a,r):0,o=n._featureFilter.needGeometry;for(let{feature:l,id:u,index:c,sourceLayerIndex:h}of t){let p=Fi(l,o);if(!n._featureFilter.filter(i,p,r))continue;let f={id:u,sourceLayerIndex:h,index:c,geometry:lb(o?p.geometry:Rr(l),s),properties:l.properties,type:l.type,patterns:{}};this.hasDependencies?this.features.push(ju("fill-extrusion",this.layers,f,{zoom:this.zoom},e)):this.addFeature(f,f.geometry,c,r,{},e.subdivisionGranularity),e.featureIndex.insert(l,f.geometry,c,h,this.index,!0)}}addFeatures({options:t,canonical:e,patternPositions:r}){for(let i of this.features){let{geometry:n}=i;this.addFeature(i,n,i.index,e,r,t.subdivisionGranularity)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,nb),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,ib.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,r,i,n,a){for(let s of os(e,500)){let o={x:0,y:0,sampleCount:0},l=this.layoutVertexArray.length;this.processPolygon(o,i,t,s,a);let u=this.layoutVertexArray.length-l,c=Math.floor(o.x/o.sampleCount),h=Math.floor(o.y/o.sampleCount);for(let p=0;p<u;p++)this.centroidVertexArray.emplaceBack(c,h)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,canonical:i})}processPolygon(t,e,r,i,n){if(i.length<1||zh(i[0]))return;for(let c of i)c.length!==0&&yb(t,c);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},s=n.fill.getGranularityForZoomLevel(e.z),o=Rn.types[r.type]==="Polygon";for(let c of i){if(c.length===0||zh(c))continue;let h=Tr(c,s,o);this._generateSideFaces(h,a)}if(!o)return;let l=Zy(i,e,s,!1),u=this.layoutVertexArray;Ky((c,h)=>{Xi(u,c,h,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(t,e){let r=0,i=this.layers[0].layout.get("fill-extrusion-rounded-corner-distance")>0?hb(t):null;for(let n=1;n<t.length;n++){let a=t[n],s=t[n-1];if(Ua(a,s)||i&&!i[n])continue;e.segment.vertexLength+4>ae.MAX_VERTEX_ARRAY_LENGTH&&(e.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let o=a.sub(s)._perp()._unit(),{start:l,end:u}=i?i[n]:{start:o,end:o},c=s.dist(a);r+c>32768&&(r=0),Xi(this.layoutVertexArray,a.x,a.y,u.x,u.y,0,0,r),Xi(this.layoutVertexArray,a.x,a.y,u.x,u.y,0,1,r),r+=c,Xi(this.layoutVertexArray,s.x,s.y,l.x,l.y,0,0,r),Xi(this.layoutVertexArray,s.x,s.y,l.x,l.y,0,1,r);let h=e.segment.vertexLength;this.indexArray.emplaceBack(h,h+2,h+1),this.indexArray.emplaceBack(h+1,h+2,h+3),e.segment.vertexLength+=4,e.segment.primitiveLength+=2}}};function yb(t,e){for(let r=0;r<e.length;r++){let i=e[r];(r!==e.length-1||e[0].x!==i.x||e[0].y!==i.y)&&(t.x+=i.x,t.y+=i.y,t.sampleCount++)}}P("FillExtrusionBucket",e1,{omit:["layers","features"]});var mb,gb=()=>mb||=new Wt({"fill-extrusion-rounded-corner-distance":new V(S["layout_fill-extrusion"]["fill-extrusion-rounded-corner-distance"],"fill-extrusion-rounded-corner-distance")}),xb,vb=()=>xb||=new Wt({"fill-extrusion-opacity":new N(S["paint_fill-extrusion"]["fill-extrusion-opacity"],"fill-extrusion-opacity"),"fill-extrusion-layer-opacity":new V(S["paint_fill-extrusion"]["fill-extrusion-layer-opacity"],"fill-extrusion-layer-opacity"),"fill-extrusion-color":new N(S["paint_fill-extrusion"]["fill-extrusion-color"],"fill-extrusion-color"),"fill-extrusion-translate":new V(S["paint_fill-extrusion"]["fill-extrusion-translate"],"fill-extrusion-translate"),"fill-extrusion-translate-anchor":new V(S["paint_fill-extrusion"]["fill-extrusion-translate-anchor"],"fill-extrusion-translate-anchor"),"fill-extrusion-pattern":new bn(S["paint_fill-extrusion"]["fill-extrusion-pattern"],"fill-extrusion-pattern"),"fill-extrusion-height":new N(S["paint_fill-extrusion"]["fill-extrusion-height"],"fill-extrusion-height"),"fill-extrusion-base":new N(S["paint_fill-extrusion"]["fill-extrusion-base"],"fill-extrusion-base"),"fill-extrusion-vertical-gradient":new V(S["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"],"fill-extrusion-vertical-gradient")}),bb={get paint(){return vb()},get layout(){return gb()}},wb=class extends Te{constructor(t,e){super(t,bb,e)}createBucket(t){return new e1(t)}queryRadius(){return gs(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,projectedCamera:n,pixelsToTileUnits:a,unwrappedTileID:s}){let o=xs(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-n.bearingInRadians,a),l=this.paint.get("fill-extrusion-height").evaluate(e,r),u=this.paint.get("fill-extrusion-base").evaluate(e,r),c=o.map(h=>fo(h,0,n,s));return _b(i.map(h=>h.map(p=>fo(p,u,n,s))),i.map(h=>h.map(p=>fo(p,l,n,s))),c)}};function fo(t,e,r,i){let{point:n,signedDistanceFromCamera:a}=ms(r).projectTileCoordinates(r,t.x,t.y,i,e),s=n;return s.z=a,s}function Yi(t,e){return t.x*e.x+t.y*e.y}function np(t,e){if(t.length===1){let r=0,i=e[r++],n;for(;!n||i.equals(n);)if(n=e[r++],!n)return 1/0;for(;r<e.length;r++){let a=e[r],s=t[0],o=n.sub(i),l=a.sub(i),u=s.sub(i),c=Yi(o,o),h=Yi(o,l),p=Yi(l,l),f=Yi(u,o),d=Yi(u,l),y=c*p-h*h,m=(p*f-h*d)/y,g=(c*d-h*f)/y,x=1-m-g,v=i.z*x+n.z*m+a.z*g;if(isFinite(v))return v}return 1/0}{let r=1/0;for(let i of e)r=Math.min(r,i.z);return r}}function _b(t,e,r){let i=1/0;gy(r,e)&&(i=np(r,e[0]));for(let n=0;n<e.length;n++){let a=e[n],s=t[n];for(let o=0;o<a.length-1;o++){let l=a[o],u=a[o+1],c=s[o],h=[l,u,s[o+1],c,l];x2(r,h)&&(i=Math.min(i,np(r,h)))}}return i!==1/0&&i}function Db(t,e,r,i){let n=[e,r];for(;n.length;)r=n.pop(),e=n.pop(),Sb(t,e,r,i,n)}function Sb(t,e,r,i,n){let a=i,s=e+(r-e>>1),o=r-e,l,u=t[e],c=t[e+1],h=t[r],p=t[r+1];for(let f=e+3;f<r;f+=3){let d=Ab(t[f],t[f+1],u,c,h,p);if(d>a)l=f,a=d;else if(d===a){let y=Math.abs(f-s);y<o&&(l=f,o=y)}}a>i&&(t[l+2]=a,l-e>3&&n.push(e,l),r-l>3&&n.push(l,r))}function Ab(t,e,r,i,n,a){let s=n-r,o=a-i;if(s!==0||o!==0){let l=((t-r)*s+(e-i)*o)/(s*s+o*o);l>1?(r=n,i=a):l>0&&(r+=s*l,i+=o*l)}return s=t-r,o=e-i,s*s+o*o}function kr(t,e,r,i){let n={id:t??null,type:e,geometry:r,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,worldOffset:0};if(e==="MultiPoint")return up(n,r,0,r.length),n;let a=e==="Polygon"||e==="MultiPolygon";for(let s=0;s<r.length;){let o=s+2+r[s]*3;a&&vs(r[s+1])||up(n,r,s+2,o),s=o}return n}function vs(t){return t<0||Object.is(t,-0)}function Uu(t,e,r,i){return{id:t??null,type:"Point",x:e,y:r,tags:i}}function ap(t){return t.type==="Point"?t.x:t.minX}function sp(t){return t.type==="Point"?t.y:t.minY}function op(t){return t.type==="Point"?t.x:t.maxX}function lp(t){return t.type==="Point"?t.y:t.maxY}function up(t,e,r,i){for(let n=r;n<i;n+=3)t.minX=Math.min(t.minX,e[n]),t.minY=Math.min(t.minY,e[n+1]),t.maxX=Math.max(t.maxX,e[n]),t.maxY=Math.max(t.maxY,e[n+1])}var Eb=class{projectX(t){return t/360+.5}projectY(t){let e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}unprojectX(t){return(t-.5)*360}unprojectY(t){let e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}},Tb=class{projectX(t){return t}projectY(t){return t}unprojectX(t){return t}unprojectY(t){return t}},qu=new Eb,Fb=new Tb;function Gu(t){return t==="unitSquare"?Fb:qu}function Xu(t,e,r){let i=[];switch(t.type){case"FeatureCollection":for(let n=0;n<t.features.length;n++)yo(i,t.features[n],e,r,n);break;case"Feature":yo(i,t,e,r);break;default:yo(i,{type:"Feature",geometry:t,properties:void 0},e,r)}return i}function yo(t,e,r,i,n){let a=t.length;if(r1(t,e,r,n),!i)return;let s=i1(e,r,n);s!=null&&(t.length>a?i.delete(s):i.set(s,{...e,id:s}))}function r1(t,e,r,i,n=0){if(!e.geometry)return;if(n>1024)throw Error("GeometryCollection nesting exceeds supported depth: 1024");if(e.geometry.type==="GeometryCollection"){Cb(t,e,e.geometry,r,i,n+1);return}if(!e.geometry.coordinates?.length)return;let a=i1(e,r,i),s=(r.tolerance/((1<<r.maxZoom)*r.extent))**2,o=Gu(r.coordinates);switch(e.geometry.type){case"Point":t.push(Uu(a,o.projectX(e.geometry.coordinates[0]),o.projectY(e.geometry.coordinates[1]),e.properties));return;case"MultiPoint":Ib(t,a,e.geometry,o,e.properties);return;case"LineString":cp(t,a,e.geometry.coordinates,s,o,r,e.properties);return;case"MultiLineString":if(r.lineMetrics){for(let l of e.geometry.coordinates)cp(t,a,l,s,o,r,e.properties);return}mo(t,a,"MultiLineString",[e.geometry.coordinates],s,o,e.properties);return;case"Polygon":mo(t,a,"Polygon",[e.geometry.coordinates],s,o,e.properties);return;case"MultiPolygon":mo(t,a,"MultiPolygon",e.geometry.coordinates,s,o,e.properties);return;default:throw Error("Input data is not a valid GeoJSON object.")}}function i1(t,e,r){return e.promoteId?t.properties?.[e.promoteId]:e.generateId?r||0:t.id}function Cb(t,e,r,i,n,a=0){for(let s of r.geometries)r1(t,{id:e.id,type:"Feature",geometry:s,properties:e.properties},i,n,a)}function Ib(t,e,r,i,n){let a=new Float64Array(r.coordinates.length*3);for(let s=0;s<r.coordinates.length;s++)a[s*3]=i.projectX(r.coordinates[s][0]),a[s*3+1]=i.projectY(r.coordinates[s][1]);t.push(kr(e,"MultiPoint",a,n))}function cp(t,e,r,i,n,a,s){if(!r.length)return;let o=new Float64Array(2+r.length*3);n1(r,o,0,i,!1,!1,n);let l=kr(e,"LineString",o,s);a.lineMetrics&&(l.start=0,l.end=l.size=o[1]),t.push(l)}function mo(t,e,r,i,n,a,s){let o=0;for(let h of i)for(let p of h)p.length&&(o+=2+p.length*3);if(!o)return;let l=r!=="MultiLineString",u=new Float64Array(o),c=0;for(let h of i){let p=!0;for(let f of h)f.length&&(c=n1(f,u,c,n,l,p,a),p=!1)}t.push(kr(e,r,u,s))}function kb(t){let e=Math.abs(t);return Number.isNaN(e)?-1/0:-e}function n1(t,e,r,i,n,a,s){let o=r+2,l,u,c=0,h=o;for(let f=0;f<t.length;f++){let d=s.projectX(t[f][0]),y=s.projectY(t[f][1]);e[h]=d,e[h+1]=y,h+=3,f>0&&(c+=n?(l*y-d*u)/2:Math.sqrt((d-l)**2+(y-u)**2)),l=d,u=y}let p=h-3;return e[o+2]=1,i>0&&Db(e,o,p,i),e[p+2]=1,e[r]=t.length,e[r+1]=n&&!a?kb(c):Math.abs(c),h}function Mb(t,e=qu){return{type:"FeatureCollection",features:t.map(r=>Ha(r,e))}}function Ha(t,e=qu){let r={type:"Feature",geometry:Pb(t,e),properties:t.tags};return t.id!=null&&(r.id=t.id),r}function Pb(t,e){switch(t.type){case"Point":return{type:t.type,coordinates:[e.unprojectX(t.x),e.unprojectY(t.y)]};case"MultiPoint":return{type:t.type,coordinates:Yu(t.geometry,t.worldOffset,0,t.geometry.length,e)};case"LineString":return{type:t.type,coordinates:hp(t.geometry,t.worldOffset,e)[0]};case"MultiLineString":case"Polygon":return{type:t.type,coordinates:hp(t.geometry,t.worldOffset,e)};case"MultiPolygon":return{type:t.type,coordinates:Bb(t.geometry,t.worldOffset,e)}}}function hp(t,e,r){let i=[];for(let n=0;n<t.length;){let a=n+2+t[n]*3;i.push(Yu(t,e,n+2,a,r)),n=a}return i}function Bb(t,e,r){let i=[];for(let n=0;n<t.length;){let a=n+2+t[n]*3,s=Yu(t,e,n+2,a,r);!vs(t[n+1])||!i.length?i.push([s]):i[i.length-1].push(s),n=a}return i}function Yu(t,e,r,i,n){let a=[];for(let s=r;s<i;s+=3)a.push([n.unprojectX(t[s]+e),n.unprojectY(t[s+1])]);return a}function De(t,e,r,i,n,a,s,o){if(r/=e,i/=e,a>=r&&s<i)return t;if(s<r||a>=i)return null;let l=[];for(let u of t){if(u.type==="Point"){let p=n===0?u.x:u.y;p>=r&&p<i&&l.push(u);continue}let c=n===0?u.minX:u.minY,h=n===0?u.maxX:u.maxY;c>=r&&h<i?l.push(u):h<r||c>=i||(u.type==="MultiPoint"?zb(u,l,r,i,n):Lb(u,l,r,i,n,o))}return l.length?l:null}function zb(t,e,r,i,n){let a=t.geometry,s=t.worldOffset,o=n===0?s:0,l=0,u=0;for(let p=0;p<a.length;p+=3){let f=a[p+n]+o;f>=r&&f<=i&&(l++,u=p)}if(!l)return;if(l===1){e.push(Uu(t.id,a[u]+s,a[u+1],t.tags));return}let c=new Float64Array(l*3),h=0;for(let p=0;p<a.length;p+=3){let f=a[p+n]+o;f>=r&&f<=i&&(c[h]=a[p]+s,c[h+1]=a[p+1],c[h+2]=a[p+2],h+=3)}e.push(kr(t.id,"MultiPoint",c,t.tags))}function Lb(t,e,r,i,n,a){let s=t.geometry,o=t.worldOffset,l=t.type==="Polygon"||t.type==="MultiPolygon",u=0;for(let m=0;m<s.length;){let g=m+2+s[m]*3;u+=Ob(s,o,m+2,g,r,i,n,l),m=g}if(!u)return;let c=a.lineMetrics&&t.type==="LineString"?t:null,h=[],p=new Float64Array(u),f=0,d=!1;for(let m=0;m<s.length;){let g=m+2+s[m]*3,x=s[m+1];l&&(vs(x)||(d=!1),d||(x=Math.abs(x)));let v=f;f=Vb(s,o,m+2,g,x,p,f,r,i,n,l,c,h),f>v&&(d=!0),m=g}if(f<u&&(p=p.subarray(0,f)),c){for(let m=0,g=0;m<p.length;g+=2){let x=m+2+p[m]*3,v=kr(t.id,"LineString",m===0&&x===p.length?p:p.slice(m,x),t.tags);v.start=h[g],v.end=h[g+1],v.size=c.size,e.push(v),m=x}return}if(l){e.push(kr(t.id,t.type,p,t.tags));return}let y=2+p[0]*3===p.length;e.push(kr(t.id,y?"LineString":"MultiLineString",p,t.tags))}function Ob(t,e,r,i,n,a,s,o){let l=s===0?e:0,u=0,c=0,h=0;for(let f=r;f<i-3;f+=3){let d=t[f+s]+l,y=t[f+3+s]+l,m=!1;d<n?y>=n&&h++:d>a?y<=a&&h++:h++,y<n&&d>=n&&(h++,m=!0),y>a&&d<=a&&(h++,m=!0),!o&&m&&(c+=h,u++,h=0)}let p=t[i-3+s]+l;return p>=n&&p<=a&&h++,o&&h>=2&&h++,h>0&&(c+=h,u++),c*3+u*2}function Vb(t,e,r,i,n,a,s,o,l,u,c,h,p){let f=s;a[s+1]=n,s+=2;let d=s,y=h?h.start:0,m=y,g,x;for(let D=r;D<i-3;D+=3){let A=t[D]+e,E=t[D+1],O=t[D+2],k=t[D+3]+e,B=t[D+4],R=u===0?A:E,I=u===0?k:B,C=!1;h&&(g=Math.sqrt((A-k)**2+(E-B)**2)),R<o?I>=o&&(x=ya(a,s,A,E,k,B,o,u),s+=3,h&&(m=y+g*x)):R>l?I<=l&&(x=ya(a,s,A,E,k,B,l,u),s+=3,h&&(m=y+g*x)):(a[s]=A,a[s+1]=E,a[s+2]=O,s+=3),I<o&&R>=o&&(x=ya(a,s,A,E,k,B,o,u),s+=3,C=!0),I>l&&R<=l&&(x=ya(a,s,A,E,k,B,l,u),s+=3,C=!0),!c&&C&&(a[f]=(s-d)/3,h&&(p.push(m,y+g*x),m=h.start),f=s,a[s+1]=n,s+=2,d=s),h&&(y+=g)}let v=i-3,b=t[v]+e,w=t[v+1],_=u===0?b:w;return _>=o&&_<=l&&(a[s]=b,a[s+1]=w,a[s+2]=t[v+2],s+=3),c&&s-d>=6&&(a[s-3]!==a[d]||a[s-2]!==a[d+1])&&(a[s]=a[d],a[s+1]=a[d+1],a[s+2]=a[d+2],s+=3),s===d?f:(a[f]=(s-d)/3,h&&p.push(m,h.end),s)}function ya(t,e,r,i,n,a,s,o){let l;return o===0?(l=(s-r)/(n-r),t[e]=s,t[e+1]=i+(a-i)*l):(l=(s-i)/(a-i),t[e]=r+(n-r)*l,t[e+1]=s),t[e+2]=1,l}function Wu(t,e){if(!e.wrap)return t;let r=e.buffer/e.extent,i=t,n=De(t,1,-1-r,r,0,-1,2,e),a=De(t,1,1-r,2+r,0,-1,2,e);return!n&&!a||(i=De(t,1,-r,1+r,0,-1,2,e)||[],n&&(i=pp(n,1).concat(i)),a&&(i=i.concat(pp(a,-1)))),i}function pp(t,e){let r=[];for(let i of t)i.type==="Point"?r.push(Uu(i.id,i.x+e,i.y,i.tags)):r.push({...i,minX:i.minX+e,maxX:i.maxX+e,worldOffset:i.worldOffset+e});return r}function Rb(t,e,r,i){let n=jb(e,r),a=[];if(n.removeAll&&(a=t,t=[],i?.clear()),n.remove.size||n.add.size){for(let o of n.remove)i?.delete(o);let s=[];for(let o of t)(n.remove.has(o.id)||n.add.has(o.id))&&s.push(o);if(s.length){a=a.concat(s);let o=new Set(s.map(l=>l.id));t=t.filter(l=>!o.has(l.id))}if(n.add.size){let o=Xu({type:"FeatureCollection",features:Array.from(n.add.values())},{...r,generateId:!1},i);o=Wu(o,r),a=a.concat(o),t=t.concat(o)}}if(n.update.size){let s=new Map,o=[];for(let l of t)n.update.has(l.id)?s.set(l.id,[...s.get(l.id)||[],l]):o.push(l);for(let[l,u]of n.update){let c=s.get(l);if(!c||c.length===0){if(!i?.has(l))continue;let p=Nb(l,u,r,i);a=a.concat(p),o=o.concat(p);continue}let h=$b(c,u,r,i);a=a.concat(c,h),o=o.concat(h)}t=o}return{affected:a,source:t}}function $b(t,e,r,i){let n=!!e.newGeometry,a=s1(e);if(n){let s=t[0],o=a?Pl(s.tags,e):s.tags;return a1(s.id,e.newGeometry,o,r,i)}if(a){let s=[];for(let o of t){let l={...o};l.tags=Pl(l.tags,e),s.push(l)}return s}return t}function Nb(t,e,r,i){let n=i.get(t),a=s1(e)?Pl(n.properties,e):n.properties;return e.newGeometry?a1(t,e.newGeometry,a,r,i):(i.set(t,{...n,properties:a}),[])}function a1(t,e,r,i,n){return Wu(Xu({type:"FeatureCollection",features:[{type:"Feature",id:t,geometry:e,properties:r}]},{...i,promoteId:void 0,generateId:!1},n),i)}function s1(t){return t.removeAllProperties||t.removeProperties?.length>0||t.addOrUpdateProperties?.length>0}function Pl(t,e){if(e.removeAllProperties)return{};let r={...t||{}};if(e.removeProperties)for(let i of e.removeProperties)delete r[i];if(e.addOrUpdateProperties)for(let{key:i,value:n}of e.addOrUpdateProperties)r[i]=n;return r}function jb(t,e){return t?{removeAll:t.removeAll,remove:new Set(t.remove||[]),add:new Map(t.add?.map(r=>[e.promoteId?r.properties?.[e.promoteId]:r.id,r])),update:new Map(t.update?.map(r=>[r.id,r]))}:{remove:new Set,add:new Map,update:new Map}}var fp=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],vt=new Uint32Array(96),Ub=class o1{static from(e){if(!e||e.byteLength===void 0||e.buffer)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[r,i]=new Uint8Array(e,0,2);if(r!==219)throw Error("Data does not appear to be in a KDBush format.");let n=i>>4;if(n!==1)throw Error(`Got v${n} data when expected v1.`);let a=fp[i&15];if(!a)throw Error("Unrecognized array type.");let[s]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new o1(o,s,a,void 0,e)}constructor(e,r=64,i=Float64Array,n=ArrayBuffer,a){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let s=fp.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-l%8)%8;if(s<0)throw Error(`Unexpected typed array class: ${i}.`);if(a)this.data=a,this.ids=new this.IndexArrayType(a,8,e),this.coords=new i(a,8+l+u,e*2),this._pos=e*2,this._finished=!0;else{let c=this.data=new n(8+o+l+u);this.ids=new this.IndexArrayType(c,8,e),this.coords=new i(c,8+l+u,e*2),this._pos=0,this._finished=!1,new Uint8Array(c,0,2).set([219,16+s]),new Uint16Array(c,2,1)[0]=r,new Uint32Array(c,4,1)[0]=e}}add(e,r){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=r,i}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return Bl(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:s,nodeSize:o}=this;vt[0]=0,vt[1]=a.length-1,vt[2]=0;let l=3,u=[];for(;l>0;){let c=vt[--l],h=vt[--l],p=vt[--l];if(h-p<=o){for(let m=p;m<=h;m++){let g=s[2*m],x=s[2*m+1];g>=e&&g<=i&&x>=r&&x<=n&&u.push(a[m])}continue}let f=p+h>>1,d=s[2*f],y=s[2*f+1];d>=e&&d<=i&&y>=r&&y<=n&&u.push(a[f]),(c===0?e<=d:r<=y)&&(vt[l++]=p,vt[l++]=f-1,vt[l++]=1-c),(c===0?i>=d:n>=y)&&(vt[l++]=f+1,vt[l++]=h,vt[l++]=1-c)}return u}within(e,r,i){let n=[];return this.withinInto(e,r,i,n),n}withinInto(e,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:s,nodeSize:o}=this;vt[0]=0,vt[1]=a.length-1,vt[2]=0;let l=3,u=0,c=i*i;for(;l>0;){let h=vt[--l],p=vt[--l],f=vt[--l];if(p-f<=o){for(let g=f;g<=p;g++)dp(s[2*g],s[2*g+1],e,r)<=c&&(n[u++]=a[g]);continue}let d=f+p>>1,y=s[2*d],m=s[2*d+1];dp(y,m,e,r)<=c&&(n[u++]=a[d]),(h===0?e-i<=y:r-i<=m)&&(vt[l++]=f,vt[l++]=d-1,vt[l++]=1-h),(h===0?e+i>=y:r+i>=m)&&(vt[l++]=d+1,vt[l++]=p,vt[l++]=1-h)}return u}};function Bl(t,e,r,i,n,a){if(n-i<=r)return;let s=i+n>>1;l1(t,e,s,i,n,a),Bl(t,e,r,i,s-1,1-a),Bl(t,e,r,s+1,n,1-a)}function l1(t,e,r,i,n,a){for(;n>i;){if(n-i>600){let u=n-i+1,c=r-i+1,h=Math.log(u),p=.5*Math.exp(2*h/3),f=.5*Math.sqrt(h*p*(u-p)/u)*(c-u/2<0?-1:1);l1(t,e,r,Math.max(i,Math.floor(r-c*p/u+f)),Math.min(n,Math.floor(r+(u-c)*p/u+f)),a)}let s=e[2*r+a],o=i,l=n;for(Wi(t,e,i,r),e[2*n+a]>s&&Wi(t,e,i,n);o<l;){for(Wi(t,e,o,l),o++,l--;e[2*o+a]<s;)o++;for(;e[2*l+a]>s;)l--}e[2*i+a]===s?Wi(t,e,i,l):(l++,Wi(t,e,l,n)),l<=r&&(i=l+1),r<=l&&(n=l-1)}}function Wi(t,e,r,i){go(t,r,i),go(e,2*r,2*i),go(e,2*r+1,2*i+1)}function go(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function dp(t,e,r,i){let n=t-r,a=e-i;return n*n+a*a}var u1={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t,coordinates:"lngLat",wrap:!0},Ka=1073741824;function Xt(t){return(t-.5)*Ka}function _i(t){return t/Ka+.5}function yp(t){return Math.abs(Xt(t))<2147483647}var qb=class{constructor(t){this.options=mp(t),this.worldCoordinateHelper=Gu(this.options.coordinates),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?5:4,this.clusterProps=[],this.points=[]}load(t){let e=[];for(let r of t){if(!r.geometry)continue;let i=r.geometry.type==="MultiPoint"?r.geometry.coordinates:[r.geometry.coordinates];for(let[n,a]of i){let[s,o]=[this.worldCoordinateHelper.projectX(n),this.worldCoordinateHelper.projectY(a)];if(!this.options.wrap&&!gp(s,o))continue;let l={id:r.id,type:"Point",x:s,y:o,tags:r.properties};e.push(l)}}this.createIndex(e)}initialize(t){let e=[];for(let r of t)if(r.type==="Point"){if(!this.isClustered(r.x,r.y))continue;e.push(r)}else if(r.type==="MultiPoint")for(let i=0;i<r.geometry.length;i+=3){let n=r.geometry[i]+r.worldOffset,a=r.geometry[i+1];this.isClustered(n,a)&&e.push({id:r.id,type:"Point",x:n,y:a,tags:r.tags})}this.createIndex(e)}isClustered(t,e){return this.options.wrap?t>=0&&t<1:gp(t,e)}updateIndex(t,e,r){this.options=mp({...r.clusterOptions,coordinates:this.options.coordinates,wrap:this.options.wrap}),this.initialize(t)}createIndex(t){let{log:e,minZoom:r,maxZoom:i}=this.options;this.trees=Array(i+1),this.stride=this.options.reduce?5:4,this.clusterProps=[],e&&console.time("total time");let n=`prepare ${t.length} points`;e&&console.time(n),this.points=t;let a=this.stride,s=i+1,o=new Int32Array(t.length*2),l=new Int32Array(t.length*a),u=0;for(let f=0;f<t.length;f++){let d=t[f];if(!yp(d.x)||!yp(d.y))continue;o[u*2]=Math.round(Xt(d.x)),o[u*2+1]=Math.round(Xt(d.y));let y=u*a;l[y+0]=s,l[y+1]=f,l[y+2]=-1,l[y+3]=1,u++}let c=this.trees[i+1]=this.createTree(o,l,u);e&&console.timeEnd(n);let h=new Int32Array(u*2),p=new Int32Array(u*a);for(let f=i;f>=r;f--){let d=Date.now(),y=this.cluster(c,f,h,p);this.isSameAsTree(c,p,y)||(c=this.createTree(h.slice(0,y*2),p.slice(0,y*a),y)),this.trees[f]=c,e&&console.log("z%d: %d clusters in %dms",f,c.numItems,Date.now()-d)}e&&console.timeEnd("total time")}getClusters(t,e){return(this.options.wrap?this.options.coordinates==="unitSquare"?this.getClustersAcrossEdge(t,e):this.getClustersInternal(t,e):this.getClustersInWorld(t,e)).map(r=>Ha(r,this.worldCoordinateHelper))}getClustersInWorld(t,e){let r=this.options.coordinates!=="unitSquare",i=this.worldCoordinateHelper.projectY(r?Math.max(-90,Math.min(90,t[1])):t[1]),n=this.worldCoordinateHelper.projectY(r?Math.max(-90,Math.min(90,t[3])):t[3]),a=Math.max(0,this.worldCoordinateHelper.projectX(t[0])),s=Math.min(1,this.worldCoordinateHelper.projectX(t[2]));return a>s?[]:this.getClustersInRange([a,Math.min(i,n),s,Math.max(i,n)],e)}getClustersAcrossEdge([t,e,r,i],n){if(r<t&&(r+=1),r-t>=1)return this.getClustersInRange([0,e,1,i],n);let a=Math.floor(t),s=t-a,o=r-a;return o<=1?this.getClustersInRange([s,e,o,i],n):this.getClustersInRange([s,e,1,i],n).concat(this.getClustersInRange([0,e,o-1,i],n))}getClustersInternal(t,e){let r=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),n=t[2]===180?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,n=180;else if(r>n){let s=this.getClustersInternal([r,i,180,a],e),o=this.getClustersInternal([-180,i,n,a],e);return s.concat(o)}return this.getClustersInRange([this.worldCoordinateHelper.projectX(r),this.worldCoordinateHelper.projectY(a),this.worldCoordinateHelper.projectX(n),this.worldCoordinateHelper.projectY(i)],e)}getClustersInRange([t,e,r,i],n){let a=this.trees[this.limitZoom(n)],s=a.range(Xt(t),Xt(e),Xt(r),Xt(i)),o=a.flatCoords,l=a.flatData,u=[];for(let c of s){let h=this.stride*c;u.push(l[h+3]>1?Gb(o,c,l,h,this.clusterProps):this.points[l[h+1]])}return u}getChildren(t){let e=this.getOriginId(t),r=this.getOriginZoom(t),i=Error("No cluster with the specified id: "+t),n=this.trees[r];if(!n)throw i;let a=n.flatCoords,s=n.flatData;if(e>=n.numItems)throw i;let o=this.options.radius/(this.options.extent*2**(r-1))*Ka,l=a[e*2],u=a[e*2+1],c=n.within(l,u,o),h=[];for(let p of c){let f=p*this.stride;s[f+2]===t&&h.push(s[f+3]>1?Xb(a,p,s,f,this.clusterProps,this.worldCoordinateHelper):Ha(this.points[s[f+1]],this.worldCoordinateHelper))}if(h.length===0)throw i;return h}getLeaves(t,e,r){e||=10,r||=0;let i=[];return this.appendLeaves(i,t,e,r,0),i}getTile(t,e,r){let i=this.trees[this.limitZoom(t)];if(!i)return null;let n=2**t;if(!this.options.wrap&&(e<0||e>=n||r<0||r>=n))return null;let{extent:a,radius:s}=this.options,o=s/a,l=Xt((r-o)/n),u=Xt((r+1+o)/n),c={features:[]};return this.addTileFeatures(i.range(Xt((e-o)/n),l,Xt((e+1+o)/n),u),i,e,r,n,c),this.options.wrap&&e===0&&this.addTileFeatures(i.range(Xt(1-o/n),l,Xt(1),u),i,n,r,n,c),this.options.wrap&&e===n-1&&this.addTileFeatures(i.range(Xt(0),l,Xt(o/n),u),i,-1,r,n,c),c}getClusterExpansionZoom(t){return this.getOriginZoom(t)}appendLeaves(t,e,r,i,n){let a=this.getChildren(e);for(let s of a){let o=s.properties;if(o?.cluster?n+o.point_count<=i?n+=o.point_count:n=this.appendLeaves(t,o.cluster_id,r,i,n):n<i?n++:t.push(s),t.length===r)break}return n}createTree(t,e,r){let i=new Ub(r,this.options.nodeSize,Int32Array);for(let n=0;n<r;n++)i.add(t[n*2],t[n*2+1]);return i.finish(),i.flatCoords=t,i.flatData=e,i.data=null,i}isSameAsTree(t,e,r){if(r!==t.numItems)return!1;let i=t.flatData;for(let n=1;n<r*this.stride;n+=this.stride)if(e[n]!==i[n])return!1;return!0}addTileFeatures(t,e,r,i,n,a){let s=e.flatCoords,o=e.flatData;for(let l of t){let u=l*this.stride,c=o[u+3]>1,h,p,f;if(c)h=Zu(o,u,this.clusterProps),p=_i(s[l*2]),f=_i(s[l*2+1]);else{let m=this.points[o[u+1]];h=m.tags,p=m.x,f=m.y}let d={type:1,geometry:[[Math.round(this.options.extent*(p*n-r)),Math.round(this.options.extent*(f*n-i))]],tags:h},y;y=c||this.options.generateId?o[u+1]:this.points[o[u+1]].id,y!==void 0&&(d.id=y),a.features.push(d)}}limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}cluster(t,e,r,i){let{radius:n,extent:a,reduce:s,minPoints:o,maxZoom:l}=this.options,u=n/(a*2**e)*Ka,c=l+1,h=t.flatCoords,p=t.flatData,f=this.stride,d=new Uint32Array(t.numItems),y=0;for(let m=0;m<t.numItems;m++){let g=m*f;if(p[g+0]<=e)continue;p[g+0]=e;let x=h[m*2],v=h[m*2+1],b=t.withinInto(x,v,u,d),w=p[g+3],_=w;for(let D=0;D<b;D++){let A=d[D]*f;p[A+0]>e&&(_+=p[A+3])}if(_>w&&_>=o){let D=x*w,A=v*w,E,O=-1,k=(m<<5)+(e+1)+this.points.length;for(let R=0;R<b;R++){let I=d[R],C=I*f;if(p[C+0]<=e)continue;p[C+0]=e;let L=p[C+3];D+=h[I*2]*L,A+=h[I*2+1]*L,p[C+2]=k,s&&(E||(E=this.map(p,g,!0),O=this.clusterProps.length,this.clusterProps.push(E)),s(E,this.map(p,C)))}p[g+2]=k,r[y*2]=Math.round(D/_),r[y*2+1]=Math.round(A/_);let B=y*f;i[B+0]=c,i[B+1]=k,i[B+2]=-1,i[B+3]=_,s&&(i[B+4]=O),y++}else{r[y*2]=x,r[y*2+1]=v;for(let D=0;D<f;D++)i[y*f+D]=p[g+D];if(y++,_>1)for(let D=0;D<b;D++){let A=d[D],E=A*f;if(!(p[E+0]<=e)){p[E+0]=e,r[y*2]=h[A*2],r[y*2+1]=h[A*2+1];for(let O=0;O<f;O++)i[y*f+O]=p[E+O];y++}}}}return y}getOriginId(t){return t-this.points.length>>5}getOriginZoom(t){return(t-this.points.length)%32}map(t,e,r){if(t[e+3]>1){let a=this.clusterProps[t[e+4]];return r?Object.assign({},a):a}let i=this.points[t[e+1]].tags,n=this.options.map(i);return r&&n===i?Object.assign({},n):n}};function mp(t){let e=Object.assign(Object.create(u1),t);return e.minZoom=Math.min(e.minZoom,30),e.maxZoom=Math.min(e.maxZoom,30),e}function Gb(t,e,r,i,n){return{id:r[i+1],type:"Point",tags:Zu(r,i,n),x:_i(t[e*2]),y:_i(t[e*2+1])}}function Xb(t,e,r,i,n,a){return{type:"Feature",id:r[i+1],properties:Zu(r,i,n),geometry:{type:"Point",coordinates:[a.unprojectX(_i(t[e*2])),a.unprojectY(_i(t[e*2+1]))]}}}function Zu(t,e,r){let i=t[e+3],n=i>=1e4?`${Math.round(i/1e3)}k`:i>=1e3?`${Math.round(i/100)/10}k`:i,a=t[e+4],s=a===-1?{}:Object.assign({},r[a]);return Object.assign(s,{cluster:!0,cluster_id:t[e+1],point_count:i,point_count_abbreviated:n})}function gp(t,e){return t>=0&&t<=1&&e>=0&&e<=1}var c1="geojsonvt_clip_start",h1="geojsonvt_clip_end";function Yb(t){return t.extent+t.buffer<=32767?Int16Array:Int32Array}function xp(t,e,r,i,n,a=Yb(n)){let s=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),o={features:[],source:null,x:r,y:i,z:e,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:t.length},l={z2:1<<e,tx:r,ty:i,extent:n.extent,CoordArray:a};for(let u of t)Wb(o,u,s,n,l);return o}function Wb(t,e,r,i,n){e.type==="Point"?Zb(t,e,n):(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),e.type==="MultiPoint"?Hb(t,e,n):Kb(t,e,r,i,n))}function Zb(t,e,r){t.minX=Math.min(t.minX,e.x),t.minY=Math.min(t.minY,e.y),t.maxX=Math.max(t.maxX,e.x),t.maxY=Math.max(t.maxY,e.y),t.numPoints++,t.numSimplified++;let i={type:4,tags:e.tags||null,x:Di(e.x,r.tx,r),y:Di(e.y,r.ty,r)};e.id!==null&&(i.id=e.id),t.features.push(i)}function Hb(t,e,r){let i=e.geometry.length/3;if(!i)return;let n=f1(e.geometry,e.worldOffset,r);t.numPoints+=i,t.numSimplified+=i;let a={type:1,tags:e.tags||null,geometry:n};e.id!==null&&(a.id=e.id),t.features.push(a)}function Kb(t,e,r,i,n){let a=e.type==="Polygon"||e.type==="MultiPolygon",s=e.geometry,o=[];for(let c=0;c<s.length;){let h=c+2+s[c]*3;Jb(o,s,e.worldOffset,c+2,h,s[c+1],t,r,a,n),c=h}if(!o.length)return;let l=e.tags||null;if(e.type==="LineString"&&i.lineMetrics){l={};for(let c in e.tags)l[c]=e.tags[c];l[c1]=e.start/e.size,l[h1]=e.end/e.size}let u={type:a?3:2,tags:l,geometry:o};e.id!==null&&(u.id=e.id),t.features.push(u)}function Jb(t,e,r,i,n,a,s,o,l,u){let c=o*o,h=(n-i)/3;if(s.numPoints+=h,o>0&&Math.abs(a)<(l?c:o))return;let p=n-3;for(;p>i&&o>0&&e[p+2]<=c;)p-=3;let f=e[p]+r,d=e[p+1],y=0,m=0;for(let v=i;v<n;v+=3)(o===0||e[v+2]>c)&&(y+=(e[v]+r-f)*(e[v+1]+d),f=e[v]+r,d=e[v+1],m++);s.numSimplified+=m;let g=l&&y>0==!vs(a),x=p1(e,r,i,n,o,m,g,u);l&&Qb(e,r,i,n,o,g,x)&&tw(x),t.push(x)}function p1(t,e,r,i,n,a,s,o,l=o.CoordArray){let u=n*n,c=l===Int16Array?32767:2147483647,h=new l(a*2),p=s?h.length-2:0;for(let f=r;f<i;f+=3)if(n===0||t[f+2]>u){let d=Di(t[f]+e,o.tx,o),y=Di(t[f+1],o.ty,o);if(l!==Float64Array&&!(Math.abs(d)<=c&&Math.abs(y)<=c))return p1(t,e,r,i,n,a,s,o,Float64Array);h[p]=d,h[p+1]=y,p+=s?-2:2}return h}function Qb(t,e,r,i,n,a,s){let o=n*n,l=a?-3:3,u=0,c=0,h=0,p=0,f=0,d=0,y=0,m=0,g=0;for(let x=a?i-3:r;x>=r&&x<i;x+=l)if(!(n>0&&!(t[x+2]>o))){if(g===0)u=t[x]+e,c=t[x+1];else{let v=t[x]+e-u,b=t[x+1]-c,w=s[g]-s[0],_=s[g+1]-s[1];y+=h*b-v*p,m+=f*_-w*d,h=v,p=b,f=w,d=_}g+=2}return y*m<0}function tw(t){for(let e=0,r=t.length-2;e<r;e+=2,r-=2){let i=t[e],n=t[e+1];t[e]=t[r],t[e+1]=t[r+1],t[r]=i,t[r+1]=n}}function Di(t,e,r){return Math.round(r.extent*(t*r.z2-e))}function f1(t,e,r,i=r.CoordArray){let n=i===Int16Array?32767:2147483647,a=new i(t.length/3*2);for(let s=0,o=0;s<t.length;s+=3,o+=2){let l=Di(t[s]+e,r.tx,r),u=Di(t[s+1],r.ty,r);if(i!==Float64Array&&!(Math.abs(l)<=n&&Math.abs(u)<=n))return f1(t,e,r,Float64Array);a[o]=l,a[o+1]=u}return a}function vp(t){let e=[];for(let r of t.features)e.push(ew(r));return{features:e}}function ew(t){let e;return e=t.type===4?{type:1,tags:t.tags,geometry:[[t.x,t.y]]}:t.type===1?{type:1,tags:t.tags,geometry:bp(t.geometry)}:{type:t.type,tags:t.tags,geometry:t.geometry.map(bp)},t.id!==void 0&&(e.id=t.id),e}function bp(t){let e=[];for(let r=0;r<t.length;r+=2)e.push([t[r],t[r+1]]);return e}var rw=class{constructor(t){this.options=t,this.total=0,this.stats={},this.tiles={},this.tileCoords=[],this.stats={},this.total=0}initialize(t){this.splitTile(this.clipToWorld(t),0,0,0),this.options.debug&&(t.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}updateIndex(t,e,r){r.debug>1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(e),r.debug>1&&console.timeEnd("invalidating");let[i,n,a]=[0,0,0],s=this.clipToWorld(t),o=xp(s,i,n,a,r);o.source=s;let l=ma(i,n,a);if(this.tiles[l]=o,this.tileCoords.push({z:i,x:n,y:a,id:l}),r.debug){let u=`z${i}`;this.stats[u]=(this.stats[u]||0)+1,this.total++}}getClusterExpansionZoom(t){return null}getChildren(t){return null}getLeaves(t,e,r){return null}getTile(t,e,r){let{debug:i}=this.options,n=1<<t;if(!this.options.wrap&&(e<0||e>=n))return null;e=e+n&n-1;let a=ma(t,e,r);if(this.tiles[a])return vp(this.tiles[a]);i>1&&console.log("drilling down to z%d-%d-%d",t,e,r);let s=t,o=e,l=r,u;for(;!u&&s>0;)s--,o>>=1,l>>=1,u=this.tiles[ma(s,o,l)];return!u?.source||(i>1&&(console.log("found parent tile z%d-%d-%d",s,o,l),console.time("drilling down")),this.splitTile(u.source,s,o,l,t,e,r),i>1&&console.timeEnd("drilling down"),!this.tiles[a])?null:vp(this.tiles[a])}clipToWorld(t){let{wrap:e,coordinates:r}=this.options;if(e&&r!=="unitSquare")return t;let i=this.options.buffer/this.options.extent;return De(e?t:De(t,1,-i,1+i,0,-1/0,1/0,this.options)||[],1,-i,1+i,1,-1/0,1/0,this.options)||[]}splitTile(t,e,r,i,n,a,s){let o=[t,e,r,i],l=this.options,u=l.debug;for(;o.length;){i=o.pop(),r=o.pop(),e=o.pop(),t=o.pop();let c=1<<e,h=ma(e,r,i),p=this.tiles[h];if(!p&&(u>1&&console.time("creation"),p=this.tiles[h]=xp(t,e,r,i,l),this.tileCoords.push({z:e,x:r,y:i,id:h}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));let D=`z${e}`;this.stats[D]=(this.stats[D]||0)+1,this.total++}if(p.source=t,n==null){if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===n)continue;if(n!=null){let D=n-e;if(r!==a>>D||i!==s>>D)continue}}if(p.source=null,!t.length)continue;u>1&&console.time("clipping");let f=.5*l.buffer/l.extent,d=.5-f,y=.5+f,m=1+f,g=null,x=null,v=null,b=null,w=De(t,c,r-f,r+y,0,p.minX,p.maxX,l),_=De(t,c,r+d,r+m,0,p.minX,p.maxX,l);w&&(g=De(w,c,i-f,i+y,1,p.minY,p.maxY,l),x=De(w,c,i+d,i+m,1,p.minY,p.maxY,l)),_&&(v=De(_,c,i-f,i+y,1,p.minY,p.maxY,l),b=De(_,c,i+d,i+m,1,p.minY,p.maxY,l)),u>1&&console.timeEnd("clipping"),o.push(g||[],e+1,r*2,i*2),o.push(x||[],e+1,r*2,i*2+1),o.push(v||[],e+1,r*2+1,i*2),o.push(b||[],e+1,r*2+1,i*2+1)}}invalidateTiles(t){if(!t.length)return;let e=this.options,{debug:r}=e,i=1/0,n=-1/0,a=1/0,s=-1/0;for(let u of t)i=Math.min(i,ap(u)),n=Math.max(n,op(u)),a=Math.min(a,sp(u)),s=Math.max(s,lp(u));let o=e.buffer/e.extent,l=new Set;for(let u in this.tiles){let c=this.tiles[u],h=1<<c.z,p=(c.x-o)/h,f=(c.x+1+o)/h,d=(c.y-o)/h,y=(c.y+1+o)/h;if(n<p||i>=f||s<d||a>=y)continue;let m=!1;for(let g of t)if(op(g)>=p&&ap(g)<f&&lp(g)>=d&&sp(g)<y){m=!0;break}if(m){if(r){r>1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",c.z,c.x,c.y,c.numFeatures,c.numPoints,c.numSimplified);let g=`z${c.z}`;this.stats[g]=(this.stats[g]||0)-1,this.total--}delete this.tiles[u],l.add(u)}}l.size&&(this.tileCoords=this.tileCoords.filter(u=>!l.has(u.id)))}};function ma(t,e,r){return((1<<t)*r+e)*32+t}var iw={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,cluster:!1,clusterOptions:u1,debug:0,coordinates:"lngLat",wrap:!0},nw=class{constructor(t,e){e=this.options=Object.assign({},iw,e),this.worldCoordinateHelper=Gu(e.coordinates);let r=e.debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw Error("promoteId and generateId cannot be used together.");e.updateable&&(this.unlocated=new Map),this.nextId=t.type==="FeatureCollection"?t.features.length:1;let i=Xu(t,e,this.unlocated);r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles")),i=Wu(i,e),e.updateable&&(this.source=i),this.initializeIndex(i,e)}initializeIndex(t,e){this.tileIndex=e.cluster?new qb({...e.clusterOptions,coordinates:e.coordinates,wrap:e.wrap}):new rw(e),t.length&&this.tileIndex.initialize(t)}getTile(t,e,r){return t=+t,e=+e,r=+r,t<0||t>24?null:this.tileIndex.getTile(t,e,r)}updateData(t,e){let r=this.options;if(!r.updateable)throw Error("to update tile geojson `updateable` option must be set to true");r.generateId&&t.add&&(t={...t,add:t.add.map(a=>({...a,id:this.nextId++}))});let{affected:i,source:n}=Rb(this.source,t,r,this.unlocated);e&&({affected:i,source:n}=this.filterUpdate(n,i,e)),i.length&&(this.source=n,this.tileIndex.updateIndex(n,i,r))}filterUpdate(t,e,r){let i=new Set;for(let n of t)n.id!=null&&(r(Ha(n,this.worldCoordinateHelper))||(e.push(n),i.add(n.id)));t=t.filter(n=>!i.has(n.id));for(let[n,a]of this.unlocated??[])a.geometry&&!r(a)&&this.unlocated.delete(n);return{affected:e,source:t}}getData(){if(!this.options.updateable)throw Error("to retrieve data the `updateable` option must be set to true");return Mb(this.source,this.worldCoordinateHelper)}updateClusterOptions(t,e){if(!this.options.updateable)throw Error("to update cluster options the `updateable` option must be set to true");let r=this.options.cluster;this.options.cluster=t,this.options.clusterOptions=e,r==t?this.tileIndex.updateIndex(this.source,[],this.options):this.initializeIndex(this.source,this.options)}getClusterExpansionZoom(t){return this.tileIndex.getClusterExpansionZoom(t)}getClusterChildren(t){return this.tileIndex.getChildren(t)}getClusterLeaves(t,e,r){return this.tileIndex.getLeaves(t,e,r)}},zl=Tt([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_offset_normal",components:2,type:"Int8"}],2),aw=zl.members;zl.size,zl.alignment;var Ll=Tt([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),sw=Ll.members;Ll.size,Ll.alignment;var Ol=Tt([{name:"a_offset_distance",components:1,type:"Float32"}]),ow=Ol.members;Ol.size,Ol.alignment;var lw=Math.cos(75/2*(Math.PI/180));function wp(t,e){let r=e.x*t.x+e.y*t.y,i=e.sub(t.mult(r)),n=Math.sqrt(3),a=i.mag();return a>n&&i._mult(n/a),i._add(t)}function uw(t){return!!t.paint.get("line-dasharray").constantOr(1)&&t.paint.get("line-offset").constantOr(1)!==0}var d1=1/2,xo=2**14/d1,y1=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let e of this.layers)this.gradients[e.id]={};this.layoutVertexArray=new e2,this.layoutVertexArray2=new r2,this.offsetDistanceArray=this.layers.some(uw)?new i2:void 0,this.offsetDistanceBuffer=void 0,this.indexArray=new Vn,this.programConfigurations=new zr(t.layers,t.zoom),this.segments=new ae,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=Ya("line",this.layers,e)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get("line-sort-key"),n=!i.isConstant(),a=[],s=new ot(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:c,sourceLayerIndex:h}of t){let p=Fi(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:o?p.geometry:Rr(l),patterns:{},dashes:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:c,sourceLayerIndex:h}=l;this.hasDependencies?(Ya("line",this.layers,e)?ju("line",this.layers,l,{zoom:this.zoom},e):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,l,this.zoom,e),this.patternFeatures.push(l)):this.addFeature(l,u,c,r,{},{},e.subdivisionGranularity);let p=t[c].feature;e.featureIndex.insert(p,u,c,h,this.index)}}update(t,e,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r,dashPositions:i})}addFeatures({options:t,canonical:e,patternPositions:r,dashPositions:i}){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,i,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,sw)),this.offsetDistanceArray?.length&&(this.offsetDistanceBuffer=t.createVertexBuffer(this.offsetDistanceArray,ow)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,aw),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.offsetDistanceBuffer?.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.hasOwn(t.properties,"geojsonvt_clip_start")&&Object.hasOwn(t.properties,"geojsonvt_clip_end"))return{start:+t.properties[c1],end:+t.properties[h1]}}addFeature(t,e,r,i,n,a,s){let o=this.layers[0].layout,l=o.get("line-join").evaluate(t,{}),u=o.get("line-cap").evaluate(t,{}),c=o.get("line-miter-limit").evaluate(t,{}),h=o.get("line-round-limit").evaluate(t,{});this.lineClips=this.lineFeatureClips(t);for(let p of e){let f=this.layoutVertexArray.length;this.addLine(p,t,l,u,c,h,i,s),this.offsetDistanceArray&&this.addOffsetDistances(f)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,dashPositions:a,canonical:i})}addLine(t,e,r,i,n,a,s,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let l=s?o.line.getGranularityForZoomLevel(s.z):1;if(t=Tr(t,l),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let v=0;v<t.length-1;v++)this.totalDistance+=t[v].dist(t[v+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let u=Rn.types[e.type]==="Polygon",c=t.length;for(;c>=2&&t[c-1].equals(t[c-2]);)c--;let h=0;for(;h<c-1&&t[h].equals(t[h+1]);)h++;if(c-h<(u?3:2))return;r==="bevel"&&(n=1.05);let p=this.overscaling<=16?15*et/(512*this.overscaling):0,f=this.segments.prepareSegment(c*10,this.layoutVertexArray,this.indexArray),d,y,m,g,x;this.e1=this.e2=-1,u&&(d=t[c-2],x=t[h].sub(d)._unit()._perp());for(let v=h;v<c;v++){if(m=v===c-1?u?t[h+1]:void 0:t[v+1],m&&t[v].equals(m))continue;x&&(g=x),d&&(y=d),d=t[v],x=m?m.sub(d)._unit()._perp():g,g||=x;let b=g.add(x);(b.x!==0||b.y!==0)&&b._unit();let w=g.x*x.x+g.y*x.y,_=b.x*x.x+b.y*x.y,D=_===0?1/0:1/_,A=2*Math.sqrt(2-2*_),E=_<lw&&y&&m,O=g.x*x.y-g.y*x.x>0,k=b.mult(Math.min(D,2)),B=Gt((D-3)/5,0,1);if(E&&v>h){let C=d.dist(y);if(C>2*p){let L=d.sub(d.sub(y)._mult(p/C)._round());this.updateDistance(y,L),this.addCurrentVertex(L,g,0,0,f,!1,wp(g,k),B),y=L}}let R=y&&m,I=R?r:u?"butt":i;if(R&&I==="round"&&(D<a?I="miter":D<=2&&(I="fakeround")),I==="miter"&&D>n&&(I="bevel"),I==="bevel"&&(D>2&&(I="flipbevel"),D<n&&(I="miter")),y&&this.updateDistance(y,d),I==="miter")b._mult(D),this.addCurrentVertex(d,b,0,0,f,!1,k);else if(I==="flipbevel"){if(D>100)b=x.mult(-1);else{let C=D*g.add(x).mag()/g.sub(x).mag();b._perp()._mult(C*(O?-1:1))}this.addCurrentVertex(d,b,0,0,f,!1,k,B),this.addCurrentVertex(d,b.mult(-1),0,0,f,!1,k,B)}else if(I==="bevel"||I==="fakeround"){let C=-Math.sqrt(D*D-1),L=O?C:0,$=O?0:C;if(y&&this.addCurrentVertex(d,g,L,$,f,!1,k),I==="fakeround"){let X=Math.round(A*180/Math.PI/20);for(let at=1;at<X;at++){let ft=at/X;if(ft!==.5){let ct=ft-.5,_t=1.0904+w*(-3.2452+w*(3.55645-w*1.43519)),Jt=.848013+w*(-1.06021+w*.215638);ft+=ft*ct*(ft-1)*(_t*ct*ct+Jt)}let ut=x.sub(g)._mult(ft)._add(g)._unit()._mult(O?-1:1);this.addHalfVertex(d,ut.x,ut.y,O?-k.x:k.x,O?-k.y:k.y,!1,O,f)}}m&&this.addCurrentVertex(d,x,-L,-$,f,!1,k)}else if(I==="butt")this.addCurrentVertex(d,b,0,0,f,!1,k);else if(I==="square"){let C=y?1:-1;this.addCurrentVertex(d,b,C,C,f,!1,k)}else I==="round"&&(y&&(this.addCurrentVertex(d,g,0,0,f,!1,k,B),this.addCurrentVertex(d,g,1,1,f,!0,k,B)),m&&(this.addCurrentVertex(d,x,-1,-1,f,!0,k,B),this.addCurrentVertex(d,x,0,0,f,!1,k,B)));if(E&&v<c-1){let C=d.dist(m);if(C>2*p){let L=d.add(m.sub(d)._mult(p/C)._round());this.updateDistance(d,L),this.addCurrentVertex(L,x,0,0,f,!1,wp(x,k),B),d=L}}}}addCurrentVertex(t,e,r,i,n,a=!1,s=e,o=0){let l=e.x+e.y*r,u=e.y-e.x*r,c=-e.x+e.y*i,h=-e.y-e.x*i,p=s.x+(e.x-s.x)*o,f=s.y+(e.y-s.y)*o;this.addHalfVertex(t,l,u,p,f,a,!1,n),this.addHalfVertex(t,c,h,-p,-f,a,!0,n),this.distance>xo/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,r,i,n,a,s,o))}addHalfVertex({x:t,y:e},r,i,n,a,s,o,l){let u=(this.lineClips?this.scaledDistance*(xo-1):this.scaledDistance)*d1;if(this.layoutVertexArray.emplaceBack((t<<1)+ +!!s,(e<<1)+ +!!o,Math.round(63*r)+128,Math.round(63*i)+128,(u&63)<<2,u>>6,Math.round(63*n),Math.round(63*a)),this.lineClips){let h=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(h,this.lineClipsArray.length)}let c=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,c,this.e2),l.primitiveLength++),o?this.e2=c:this.e1=c}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}addOffsetDistances(t){let{int16:e,int8:r}=this.layoutVertexArray,i=this.lineClips?(this.lineClips.end-this.lineClips.start)*(xo-1)/this.totalDistance:1,n=0,a=0,s=0,o=0,l=0;for(let u=t;u<this.layoutVertexArray.length;u++){let c=e[u*5]>>1,h=e[u*5+1]>>1,p=e[u*5+1]&1?-1:1,f=p*r[u*10+8]/63,d=p*r[u*10+9]/63,y=c-a,m=h-s;u>t&&(y!==0||m!==0)&&(n+=((f-o)*y+(d-l)*m)/Math.hypot(y,m)),this.offsetDistanceArray.emplaceBack(n*i),a=c,s=h,o=f,l=d}}hasLineDasharray(t){for(let e of t){let r=e.paint.get("line-dasharray");if(r&&!r.isConstant())return!0}return!1}addLineDashDependencies(t,e,r,i){for(let n of t){let a=n.paint.get("line-dasharray");if(!a||a.value.kind==="constant")continue;let s=n.layout.get("line-cap").evaluate(e,{})==="round",o={dasharray:a.value.evaluate({zoom:r-1},e,{}),round:s},l={dasharray:a.value.evaluate({zoom:r},e,{}),round:s},u={dasharray:a.value.evaluate({zoom:r+1},e,{}),round:s},c=`${o.dasharray.join(",")},${o.round}`,h=`${l.dasharray.join(",")},${l.round}`,p=`${u.dasharray.join(",")},${u.round}`;i.dashDependencies[c]=o,i.dashDependencies[h]=l,i.dashDependencies[p]=u,e.dashes[n.id]={min:c,mid:h,max:p}}}};P("LineBucket",y1,{omit:["layers","patternFeatures"]});var cw,hw=()=>cw||=new Wt({"line-cap":new N(S.layout_line["line-cap"],"line-cap"),"line-join":new N(S.layout_line["line-join"],"line-join"),"line-miter-limit":new N(S.layout_line["line-miter-limit"],"line-miter-limit"),"line-round-limit":new N(S.layout_line["line-round-limit"],"line-round-limit"),"line-sort-key":new N(S.layout_line["line-sort-key"],"line-sort-key")}),pw,fw=()=>pw||=new Wt({"line-opacity":new N(S.paint_line["line-opacity"],"line-opacity"),"line-layer-opacity":new V(S.paint_line["line-layer-opacity"],"line-layer-opacity"),"line-layer-blend":new V(S.paint_line["line-layer-blend"],"line-layer-blend"),"line-color":new N(S.paint_line["line-color"],"line-color"),"line-translate":new V(S.paint_line["line-translate"],"line-translate"),"line-translate-anchor":new V(S.paint_line["line-translate-anchor"],"line-translate-anchor"),"line-width":new N(S.paint_line["line-width"],"line-width"),"line-gap-width":new N(S.paint_line["line-gap-width"],"line-gap-width"),"line-offset":new N(S.paint_line["line-offset"],"line-offset"),"line-blur":new N(S.paint_line["line-blur"],"line-blur"),"line-dasharray":new bn(S.paint_line["line-dasharray"],"line-dasharray"),"line-pattern":new bn(S.paint_line["line-pattern"],"line-pattern"),"line-gradient":new fs(S.paint_line["line-gradient"],"line-gradient")}),_p={get paint(){return fw()},get layout(){return hw()}},dw=class extends N{possiblyEvaluate(t,e){return e=new ot(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,i){return e=new ot(Math.floor(e.zoom),e),super.evaluate(t,e,r,i)}},ga,yw=class extends Te{constructor(t,e){super(t,_p,e),this.gradientVersion=0,ga||(ga=new dw(_p.paint.properties["line-width"].specification,"line-floorwidth"),ga.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){let e=this.gradientExpression();this.stepInterpolant=rx(e)?e._styleExpression.expression instanceof pu:!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=ga.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new y1(t)}queryRadius(t){let e=t,r=Dp(ui("line-width",this,e),ui("line-gap-width",this,e)),i=ui("line-offset",this,e);return r/2+Math.abs(i)+gs(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,projectedCamera:n,pixelsToTileUnits:a}){let s=xs(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-n.bearingInRadians,a),o=a/2*Dp(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),l=this.paint.get("line-offset").evaluate(e,r);return l&&(i=J2(i,l*a)),v2(s,i,o)}isTileClipped(){return!0}};function Dp(t,e){return e>0?e+2*t:t}var mw=Tt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"},{name:"a_height_offset",components:1,type:"Float32"}],4),gw=Tt([{name:"a_projected_pos",components:3,type:"Float32"}],4);Tt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);var xw=Tt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Tt([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);var Sp=Tt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);Tt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),Tt([{name:"triangle",components:3,type:"Uint16"}]),Tt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint32",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Float32",name:"heightOffset"}]),Tt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"},{type:"Float32",name:"heightOffset"}]),Tt([{type:"Float32",name:"offsetX"}]),Tt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Tt([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var Si=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){if(Si.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}async syncState(t,e){if(this.isParsed())return this.getState();if(t.pluginStatus!=="loading")return this.setState(t),t;let r=t.pluginURL,i=new Promise(a=>{this.loadScriptResolve=a}),n=new Promise(a=>setTimeout(()=>a(),this.TIMEOUT));if(await e(r),await Promise.race([i,n]),this.isParsed()){let a={pluginStatus:"loaded",pluginURL:r};return this.setState(a),a}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${r}`)}};function vw(t){return/[\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u077F\u07C0-\u07FA\u07FD-\u07FF\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\u1800\u1801\u1804\u1806-\u1819\u1820-\u1878\u1880-\u18AA\uA840-\uA877\uFB50-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDD00-\uDD27\uDD30-\uDD39\uDE60-\uDE7E\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDEFF\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB]|\uD805[\uDE60-\uDE6C]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]|\uD83A[\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(t))}function bw(t){return/[\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC57-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD1F-\uDD39\uDD3F-\uDD59\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58\uDE60-\uDE9F\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF00-\uDF35\uDF39-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD27\uDD30-\uDD39\uDD40-\uDD65\uDD69-\uDD85\uDD8E\uDD8F\uDE60-\uDE7E\uDE80-\uDEA9\uDEAB-\uDEAD\uDEB0\uDEB1\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDF27\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(t))}function ww(t){return/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(t))}function $n(t){return/[\u02EA\u02EB\u1100-\u11FF\u1401-\u167F\u18B0-\u18FF\u2065\u20DD-\u20E0\u20E2-\u20E4\u2B97\u2BF0-\u2BFF\u2E50\u2E51\u2E80-\u3007\u3012\u3013\u3020-\u302F\u3031-\u30FB\u30FD-\uA4CF\uA960-\uA97F\uAC00-\uD7FF\uF900-\uFAFF\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7\uFFF0-\uFFF8]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|[\uD80C-\uD810\uD81C-\uD822\uD83C\uD83D\uD840-\uD87E\uD880-\uD8BE][\uDC00-\uDFFF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFFF]|\uD823[\uDC00-\uDDFF]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFF]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83E[\uDD00-\uDEFF]|[\uD87F\uD8BF][\uDC00-\uDFFD]/gim.test(String.fromCodePoint(t))}function _w(t){return/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(t))}function Dw(t){return/[\r\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0600-\u0605\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DD\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0890\u0891\u0897-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E33-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB3-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1037\u1039-\u103E\u1056-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1084-\u1086\u108D\u109D\u1100-\u11FF\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60\u1A62\u1A65-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA960-\uA97C\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDD69-\uDD6D\uDEAB\uDEAC\uDEFA-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCBD\uDCC2\uDCCD\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC2\uDDC3\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74\uDFB8-\uDFC0\uDFC2\uDFC5\uDFC7-\uDFCA\uDFCC-\uDFD2\uDFE1\uDFE2]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF1F\uDF22-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE84-\uDE99\uDF60-\uDF67]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00-\uDF03\uDF34-\uDF3A\uDF3E-\uDF42\uDF5A]|\uD80D[\uDC40\uDC47-\uDC55]|\uD818[\uDD1E-\uDD2F]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDD63\uDD67-\uDD6A\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF\uDDEE\uDDEF\uDEE3\uDEE6\uDEEE\uDEEF\uDEF5]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDDE6-\uDDFF\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF]/.test(t)}function Ap(t){return/[\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA\u1000-\u103F\u1050-\u108F\u109A-\u109F\u1780-\u17D3\u17D7\u17DC\u17DD\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19DE\u19DF\u1A20-\u1A5E\u1A60-\u1A7C\u1AA0-\u1AAD\u1B00-\u1B4C\u1B4E-\u1B7F\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE-\uA9EF\uA9FA-\uA9FE\uAA60-\uAAC2\uAADB-\uAADF]|\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF3A\uDF3B\uDF3F-\uDF46]/gim.test(String.fromCodePoint(t))}function Sw(t,e){return/(?:[\u1039\u17D2\u1A60\u1BAB\u200D\uAAF6]|\uD802\uDE3F|\uD804[\uDD33\uDFD0]|\uD806[\uDD3E\uDE47\uDE99]|\uD807[\uDD45\uDD97\uDF42])$/.test(t)||/^\p{gc=Mc}/u.test(e)}var Aw={C:"18g,1;g2,3;4nb,1",D:"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f",R:"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1",T:"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1"},Ew={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},Tw={\u0644\u0622:[65269,65270],\u0644\u0623:[65271,65272],\u0644\u0625:[65273,65274],\u0644\u0627:[65275,65276]},Ep=1604,Fw=/[\u0600-\u06ff\u0750-\u077f\u0870-\u089f\u08a0-\u08ff\ufb50-\ufdff\ufe70-\ufeff]/;function Cw(t,e,r){let i=0;for(let n of t.split(";")){let[a,s]=n.split(",").map(l=>parseInt(l,36)),o=i+a;for(let l=o;l<o+s;l++)r.set(l,e);i=o+s}}var m1=new Map;for(let[t,e]of Object.entries(Aw))Cw(e,t,m1);function Iw(t){return m1.get(t)??"U"}function kw(t){return t==="D"||t==="L"||t==="C"}function Mw(t){return t==="D"||t==="R"||t==="C"}function Pw(t,e,r){return t==="D"?e&&r?3:e?1:r?2:0:t==="R"?+!!e:t==="L"?r?2:0:null}function Bw(t){return[...t].map(e=>{let r=e.codePointAt(0);return{codePoint:r,type:Iw(r),form:null}})}function zw(t){let e=t.filter(r=>r.type!=="T");for(let r=0;r<e.length;r++){let i=e[r],n=r>0&&kw(e[r-1].type),a=r+1<e.length&&Mw(e[r+1].type);i.form=Pw(i.type,n,a)}}function Lw(t){let e=!1;for(let r of t)r.type==="T"?r.form=e?3:0:e=r.form===2||r.form===3}function Ow(t){let e=[];for(let r=0;r<t.length;r++){let i=t[r];if(i.codePoint!==Ep){e.push(i);continue}let n=r+1;for(;n<t.length&&t[n].type==="T";)n++;let a=t[n],s=a&&Tw[String.fromCodePoint(Ep,a.codePoint)];if(!s){e.push(i);continue}let o=i.form===3||i.form===1;e.push({codePoint:s[+!!o],type:"R",form:0}),e.push(...t.slice(r+1,n)),r=n}return e}function Vw(t){if(t.form===null)return t.codePoint;let e=Ew[t.codePoint];return e&&(e[t.form]||e[0])||t.codePoint}function Rw(t){if(!Fw.test(t))return t;let e=Bw(t);return zw(e),Lw(e),Ow(e).map(r=>String.fromCodePoint(Vw(r))).join("")}function $w(t,e,r){let i=e.layout.get("text-transform").evaluate(r,{});return i==="uppercase"?t=t.toLocaleUpperCase():i==="lowercase"&&(t=t.toLocaleLowerCase()),(Si.applyArabicShaping??Rw)(t)}function Nw(t,e,r){for(let i of t.sections)i.text=$w(i.text,e,r);return t}function vo(t,e,r){let i=r?e.last.points:e.first.points,n=r?i[i.length-1]:i[0];return`${t}:${n.x}:${n.y}`}function jw(t){let e=t.first.points,r=e.length;for(let a=t.first.next;a;a=a.next)r+=a.points.length-1;let i=Array(r);for(let a=0;a<e.length;a++)i[a]=e[a];let n=e.length;for(let a=t.first.next;a;a=a.next){let s=a.points;for(let o=1;o<s.length;o++)i[n++]=s[o]}return i}function Tp(t,e,r,i,n){let a=e[r];delete e[r],e[i]=a;let s=t[a];return s.last.next=n.first,s.last=n.last,a}function Fp(t,e,r,i,n){let a=e[i];delete e[i],e[r]=a;let s=t[a];return n.last.next=s.first,s.first=n.first,a}function Uw(t){let e={},r={},i=[];for(let a of t){let s=a.text?a.text.toString():null,o={points:a.geometry[0],next:null},l={feature:a,first:o,last:o};if(!s){i.push(l);continue}let u=vo(s,l),c=vo(s,l,!0);if(u in r&&c in e&&r[u]!==e[c]){let h=Fp(i,e,u,c,l),p=Tp(i,r,u,c,i[h]);delete e[u],delete r[c],r[vo(s,i[p],!0)]=p,i[h].feature.geometry=null}else if(u in r)Tp(i,r,u,c,l);else if(c in e)Fp(i,e,u,c,l);else{let h=i.push(l)-1;e[u]=h,r[c]=h}}let n=[];for(let a of i){let s=a.feature;s.geometry&&(a.first.next&&(s.geometry[0]=jw(a)),n.push(s))}return n}var g1=typeof Intl<"u"&&"Segmenter"in Intl,Cp,Ip;function Vl(t){if(!g1||!Dw(t))return[...t];Cp??=new Intl.Segmenter(void 0,{granularity:"grapheme"});let e=[];for(let{segment:r}of Cp.segment(t)){let i=e.length-1;i>=0&&Sw(e[i],r)?e[i]+=r:e.push(r)}return e}function qw(t){let e=new Set;if(g1){Ip??=new Intl.Segmenter(void 0,{granularity:"word"});for(let{index:i}of Ip.segment(t))e.add(i);return e}let r=0;for(let i of t.split(/\b|(?=\p{Ideo})/u))e.add(r),r+=i.length;return e}function Rl(t){let e=t.codePointAt(0);return t.length>(e>65535?2:1)}function In(t){return/\s/u.test(String.fromCodePoint(t))}function bs(t){return/[\p{P}\p{S}]/u.test(String.fromCodePoint(t))}function $l(t){for(let e of t)if($n(e.codePointAt(0)))return!0;return!1}function x1(t){for(let e of t)if(!Gw(e.codePointAt(0)))return!1;return!0}function Gw(t){return!vw(t)}function Ai(t){return!($n(t)||_w(t))}function v1(t){return/\p{sc=Arab}/u.test(String.fromCodePoint(t))}function b1(t){return bw(t)}function w1(t){for(let e of t)if(b1(e.codePointAt(0)))return!0;return!1}var ni={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u22EF":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};function Xw(t){let e="",r={premature:!0,value:void 0},i=t[Symbol.iterator](),n=i.next(),a=t[Symbol.iterator]();a.next();let s=a.next();for(;!n.done;)(s.done||!Ai(s.value.codePointAt(0))||ni[s.value])&&(r.premature||!Ai(r.value.codePointAt(0))||ni[r.value])&&ni[n.value]?e+=ni[n.value]:e+=n.value,r={value:n.value,premature:!1},n=i.next(),s=a.next();return e}var Yw={10:!0,13:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Ww={40:!0};function kp(t,e,r,i,n,a){if("fontStack"in e){let s=r[e.fontStack]?.default,o=s?.[t];if(o)return o.metrics.advance*e.scale+n;let l=0;for(let u of t){let c=s?.[u];c&&(l+=c.metrics.advance*e.scale+n)}return l}{let s=i[e.imageName];return s?s.displaySize[0]*e.scale*24/a+n:0}}function Mp(t,e,r,i){let n=(t-e)**2;return i?t<e?n/2:n*2:n+Math.abs(r)*r}function Pp(t){return/^\s+$/u.test(t)}function Zw(t,e,r){let i=0;return(t===10||t===13)&&(i-=1e4),r&&(i+=150),(t===40||t===65288)&&(i+=50),(e===41||e===65289)&&(i+=50),i}function Bp(t,e,r,i,n,a){let s=null,o=Mp(e,r,n,a);for(let l of i){let u=Mp(e-l.x,r,n,a)+l.badness;u<=o&&(s=l,o=u)}return{index:t,x:e,priorBreak:s,badness:o}}function _1(t){return t?_1(t.priorBreak).concat(t.index):[]}var Hu=class Nl{constructor(e="",r=[],i=[]){this.text=e,this.sections=r,this.sectionIndex=i,this.imageSectionID=null,this.cachedGraphemes=null}graphemes(){return this.cachedGraphemes??=Vl(this.text),this.cachedGraphemes}static fromFeature(e,r,i,n){let a=new Nl;for(let s of e.sections)s.image?a.addImageSection(s):a.addTextSection(s,r);return i&&a.verticalizePunctuation(n),a}length(){return this.graphemes().length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}verticalizePunctuation(e={},r){let i=Xw(this.text),n=0;this.cachedGraphemes=this.graphemes().map((a,s)=>{let o=i.slice(n,n+a.length);n+=a.length;let l=this.getSection(s);return r?.[s]!==!1&&"fontStack"in l&&e[l.fontStack]?.vertical?.[a]?a:o}),this.text=this.cachedGraphemes.join("")}hasZeroWidthSpaces(){return this.text.includes("\u200B")}trim(){let e=this.graphemes(),r=0;for(;r<e.length&&Pp(e[r]);)r++;let i=e.length;for(;i>r&&Pp(e[i-1]);)i--;this.text=e.slice(r,i).join(""),this.sectionIndex=this.sectionIndex.slice(r,i),this.cachedGraphemes=null}substring(e,r){let i=this.graphemes().slice(e,r).join(""),n=this.sectionIndex.slice(e,r);return new Nl(i,this.sections,n)}toCodeUnitIndex(e){return this.graphemes().slice(0,e).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}getMaxImageSize(e){let r=0,i=0;for(let n=0;n<this.length();n++){let a=this.getSection(n);if("imageName"in a){let s=e[a.imageName];if(!s)continue;let o=s.displaySize;r=Math.max(r,o[0]),i=Math.max(i,o[1])}}return{maxImageWidth:r,maxImageHeight:i}}_appendSection(e,r){let i=this.graphemes(),n=i.length>0?i[i.length-1]:"",a=Vl(n+e);this.text+=e,this.cachedGraphemes=i.slice(0,n?-1:void 0).concat(a);let s=a.length-+!!n;for(let o=0;o<s;o++)this.sectionIndex.push(r)}addTextSection(e,r){this.sections.push({scale:e.scale||1,verticalAlign:e.verticalAlign||"bottom",fontStack:e.fontStack||r}),this._appendSection(e.text,this.sections.length-1)}addImageSection(e){let r=e.image?e.image.name:"";if(r.length===0){Mt("Can't add FormattedSection with an empty image.");return}let i=this.getNextImageSectionCharCode();i?(this.sections.push({scale:1,verticalAlign:e.verticalAlign||"bottom",imageName:r}),this._appendSection(String.fromCharCode(i),this.sections.length-1)):Mt("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,r,i,n,a){let s=this.determineTotalWidth(e,i,n,a);if(e>=0&&s>0&&s<=r&&!/[\n\r]/.test(this.text))return[this.length()];let o=[],l=s/Math.max(1,Math.ceil(s/r)),u=this.hasZeroWidthSpaces(),c=this.graphemes(),h=null,p=0,f=0;for(let d=0;d<c.length;d++){let y=c[d];if(d>0){let m=c[d-1].codePointAt(0),g=y.codePointAt(0),x=ww(m),v=Ap(m)&&Ap(g);(Yw[m]||x||"imageName"in this.getSection(d-1)||c[d+1]!==void 0&&Ww[g]||v&&(h??=qw(this.text)).has(f))&&o.push(Bp(d,p,l,o,Zw(m,g,x&&u),!1))}In(y.codePointAt(0))||(p+=kp(y,this.getSection(d),i,n,e,a)),f+=y.length}return _1(Bp(this.length(),p,l,o,0,!0))}determineTotalWidth(e,r,i,n){let a=0,s=0;for(let o of this.graphemes()){let l=this.getSection(s);a+=kp(o,l,r,i,e,n),s++}return a}};function Hw(){return(function(t){var e={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},r={},i={};r.L=1,i[1]="L",Object.keys(e).forEach(function(j,J){r[j]=1<<J+1,i[r[j]]=j}),Object.freeze(r);var n=r.LRI|r.RLI|r.FSI,a=r.L|r.R|r.AL,s=r.B|r.S|r.WS|r.ON|r.FSI|r.LRI|r.RLI|r.PDI,o=r.BN|r.RLE|r.LRE|r.RLO|r.LRO|r.PDF,l=r.S|r.WS|r.B|n|r.PDI|o,u=null;function c(){if(!u){u=new Map;var j=0;for(var J in e)if(e.hasOwnProperty(J))for(var rt=e[J],z="",ht=void 0,Y=!1,Z=0,U=0;U<=rt.length+1;U+=1){var st=rt[U];if(st!==","&&U!==rt.length)st==="+"?(Y=!0,Z=j=Z+parseInt(z,36),z=""):z+=st;else{Y?ht=j+parseInt(z,36):(Z=j=Z+parseInt(z,36),ht=j),Y=!1,z="",Z=ht;for(var lt=j;lt<ht+1;lt+=1)u.set(lt,r[J])}}}}function h(j){return c(),u.get(j.codePointAt(0))||r.L}var p={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function f(j,J){var rt=0,z=new Map,ht=J&&new Map,Y;return j.split(",").forEach(function Z(U){if(U.indexOf("+")!==-1)for(var st=+U;st--;)Z(Y);else{Y=U;var lt=U.split(">"),it=lt[0],St=lt[1];it=String.fromCodePoint(rt+=parseInt(it,36)),St=String.fromCodePoint(rt+=parseInt(St,36)),z.set(it,St),J&&ht.set(St,it)}}),{map:z,reverseMap:ht}}var d,y,m;function g(){if(!d){var j=f(p.pairs,!0),J=j.map,rt=j.reverseMap;d=J,y=rt,m=f(p.canonical,!1).map}}function x(j){return g(),d.get(j)||null}function v(j){return g(),y.get(j)||null}function b(j){return g(),m.get(j)||null}var w=r.L,_=r.R,D=r.EN,A=r.ES,E=r.ET,O=r.AN,k=r.CS,B=r.B,R=r.S,I=r.ON,C=r.BN,L=r.NSM,$=r.AL,X=r.LRO,at=r.RLO,ft=r.LRE,ut=r.RLE,ct=r.PDF,_t=r.LRI,Jt=r.RLI,ge=r.FSI,se=r.PDI,Je="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",Qe;function Ur(){if(!Qe){var j=f(Je,!0),J=j.map;j.reverseMap.forEach(function(rt,z){J.set(z,rt)}),Qe=J}}function tr(j){return Ur(),Qe.get(j)||null}function xe(j,J,rt,z){var ht=j.length;rt=Math.max(0,rt==null?0:+rt),z=Math.min(ht-1,z==null?ht-1:+z);var Y=[];return J.paragraphs.forEach(function(Z){var U=Math.max(rt,Z.start),st=Math.min(z,Z.end);if(U<st){for(var lt=J.levels.slice(U,st+1),it=st;it>=U&&h(j[it])&l;it--)lt[it]=Z.level;for(var St=Z.level,Qt=1/0,xr=0;xr<lt.length;xr++){var er=lt[xr];er>St&&(St=er),er<Qt&&(Qt=er|1)}for(var rr=St;rr>=Qt;rr--)for(var pt=0;pt<lt.length;pt++)if(lt[pt]>=rr){for(var At=pt;pt+1<lt.length&&lt[pt+1]>=rr;)pt++;pt>At&&Y.push([At+U,pt+U])}}}),Y}function qr(j,J,rt,z){for(var ht=xe(j,J,rt,z),Y=[],Z=0;Z<j.length;Z++)Y[Z]=Z;return ht.forEach(function(U){for(var st=U[0],lt=U[1],it=Y.slice(st,lt+1),St=it.length;St--;)Y[lt-St]=it[St]}),Y}return t.closingToOpeningBracket=v,t.getBidiCharType=h,t.getBidiCharTypeName=function(j){return i[h(j)]},t.getCanonicalBracket=b,t.getEmbeddingLevels=function(j,J){for(var rt=125,z=new Uint32Array(j.length),ht=0;ht<j.length;ht++)z[ht]=h(j[ht]);var Y=new Map;function Z(Zt,ve){var Ht=z[Zt];z[Zt]=ve,Y.set(Ht,Y.get(Ht)-1),Ht&s&&Y.set(s,Y.get(s)-1),Y.set(ve,(Y.get(ve)||0)+1),ve&s&&Y.set(s,(Y.get(s)||0)+1)}for(var U=new Uint8Array(j.length),st=new Map,lt=[],it=null,St=0;St<j.length;St++)it||lt.push(it={start:St,end:j.length-1,level:J==="rtl"?1:J==="ltr"?0:Nc(St,!1)}),z[St]&B&&(it.end=St,it=null);for(var Qt=ut|ft|at|X|n|se|ct|B,xr=function(Zt){return Zt+(Zt&1?1:2)},er=function(Zt){return Zt+(Zt&1?2:1)},rr=0;rr<lt.length;rr++){it=lt[rr];var pt=[{_level:it.level,_override:0,_isolate:0}],At=void 0,$e=0,ir=0,Ds=0;Y.clear();for(var Lt=it.start;Lt<=it.end;Lt++){var Ot=z[Lt];if(At=pt[pt.length-1],Y.set(Ot,(Y.get(Ot)||0)+1),Ot&s&&Y.set(s,(Y.get(s)||0)+1),Ot&Qt)if(Ot&(ut|ft)){U[Lt]=At._level;var yc=(Ot===ut?er:xr)(At._level);yc<=rt&&!$e&&!ir?pt.push({_level:yc,_override:0,_isolate:0}):$e||ir++}else if(Ot&(at|X)){U[Lt]=At._level;var mc=(Ot===at?er:xr)(At._level);mc<=rt&&!$e&&!ir?pt.push({_level:mc,_override:Ot&at?_:w,_isolate:0}):$e||ir++}else if(Ot&n){Ot&ge&&(Ot=Nc(Lt+1,!0)===1?Jt:_t),U[Lt]=At._level,At._override&&Z(Lt,At._override);var gc=(Ot===Jt?er:xr)(At._level);gc<=rt&&$e===0&&ir===0?(Ds++,pt.push({_level:gc,_override:0,_isolate:1,_isolInitIndex:Lt})):$e++}else if(Ot&se){if($e>0)$e--;else if(Ds>0){for(ir=0;!pt[pt.length-1]._isolate;)pt.pop();var Ss=pt[pt.length-1]._isolInitIndex;Ss!=null&&(st.set(Ss,Lt),st.set(Lt,Ss)),pt.pop(),Ds--}At=pt[pt.length-1],U[Lt]=At._level,At._override&&Z(Lt,At._override)}else Ot&ct?($e===0&&(ir>0?ir--:!At._isolate&&pt.length>1&&(pt.pop(),At=pt[pt.length-1])),U[Lt]=At._level):Ot&B&&(U[Lt]=it.level);else U[Lt]=At._level,At._override&&Ot!==C&&Z(Lt,At._override)}for(var Gr=[],Fe=null,vr=it.start;vr<=it.end;vr++){var As=z[vr];if(!(As&o)){var xc=U[vr],vc=As&n,L0=As===se;Fe&&xc===Fe._level?(Fe._end=vr,Fe._endsWithIsolInit=vc):Gr.push(Fe={_start:vr,_end:vr,_level:xc,_startsWithPDI:L0,_endsWithIsolInit:vc})}}for(var Es=[],Un=0;Un<Gr.length;Un++){var qn=Gr[Un];if(!qn._startsWithPDI||qn._startsWithPDI&&!st.has(qn._start)){for(var Ts=[Fe=qn],bc=void 0;Fe&&Fe._endsWithIsolInit&&(bc=st.get(Fe._end))!=null;)for(var Gn=Un+1;Gn<Gr.length;Gn++)if(Gr[Gn]._start===bc){Ts.push(Fe=Gr[Gn]);break}for(var Xr=[],Fs=0;Fs<Ts.length;Fs++)for(var wc=Ts[Fs],Cs=wc._start;Cs<=wc._end;Cs++)Xr.push(Cs);for(var O0=U[Xr[0]],_c=it.level,Xn=Xr[0]-1;Xn>=0;Xn--)if(!(z[Xn]&o)){_c=U[Xn];break}var Is=Xr[Xr.length-1],V0=U[Is],Dc=it.level;if(!(z[Is]&n)){for(var Yn=Is+1;Yn<=it.end;Yn++)if(!(z[Yn]&o)){Dc=U[Yn];break}}Es.push({_seqIndices:Xr,_sosType:Math.max(_c,O0)%2?_:w,_eosType:Math.max(Dc,V0)%2?_:w})}}for(var ks=0;ks<Es.length;ks++){var Ms=Es[ks],G=Ms._seqIndices,ki=Ms._sosType,R0=Ms._eosType,Yr=U[G[0]]&1?_:w;if(Y.get(L))for(var Wn=0;Wn<G.length;Wn++){var Sc=G[Wn];if(z[Sc]&L){for(var Ps=ki,Zn=Wn-1;Zn>=0;Zn--)if(!(z[G[Zn]]&o)){Ps=z[G[Zn]];break}Z(Sc,Ps&(n|se)?I:Ps)}}if(Y.get(D))for(var Hn=0;Hn<G.length;Hn++){var Ac=G[Hn];if(z[Ac]&D)for(var Kn=Hn-1;Kn>=-1;Kn--){var Ec=Kn===-1?ki:z[G[Kn]];if(Ec&a){Ec===$&&Z(Ac,O);break}}}if(Y.get($))for(var Bs=0;Bs<G.length;Bs++){var Tc=G[Bs];z[Tc]&$&&Z(Tc,_)}if(Y.get(A)||Y.get(k))for(var Mi=1;Mi<G.length-1;Mi++){var zs=G[Mi];if(z[zs]&(A|k)){for(var Wr=0,Ls=0,Os=Mi-1;Os>=0&&(Wr=z[G[Os]],Wr&o);Os--);for(var Vs=Mi+1;Vs<G.length&&(Ls=z[G[Vs]],Ls&o);Vs++);Wr===Ls&&(z[zs]===A?Wr===D:Wr&(D|O))&&Z(zs,Wr)}}if(Y.get(D)){for(var Ce=0;Ce<G.length;Ce++)if(z[G[Ce]]&D){for(var Jn=Ce-1;Jn>=0&&z[G[Jn]]&(E|o);Jn--)Z(G[Jn],D);for(Ce++;Ce<G.length&&z[G[Ce]]&(E|o|D);Ce++)z[G[Ce]]!==D&&Z(G[Ce],D)}}if(Y.get(E)||Y.get(A)||Y.get(k))for(var Pi=0;Pi<G.length;Pi++){var Fc=G[Pi];if(z[Fc]&(E|A|k)){Z(Fc,I);for(var Qn=Pi-1;Qn>=0&&z[G[Qn]]&o;Qn--)Z(G[Qn],I);for(var ta=Pi+1;ta<G.length&&z[G[ta]]&o;ta++)Z(G[ta],I)}}if(Y.get(D))for(var Rs=0,Cc=ki;Rs<G.length;Rs++){var Ic=G[Rs],$s=z[Ic];$s&D?Cc===w&&Z(Ic,w):$s&a&&(Cc=$s)}if(Y.get(s)){for(var Bi=_|D|O,kc=Bi|w,ea=[],Zr=[],Hr=0;Hr<G.length;Hr++)if(z[G[Hr]]&s){var zi=j[G[Hr]],Mc=void 0;if(x(zi)!==null)if(Zr.length<63)Zr.push({char:zi,seqIndex:Hr});else break;else if((Mc=v(zi))!==null)for(var Li=Zr.length-1;Li>=0;Li--){var Ns=Zr[Li].char;if(Ns===Mc||Ns===v(b(zi))||x(b(Ns))===zi){ea.push([Zr[Li].seqIndex,Hr]),Zr.length=Li;break}}}ea.sort(function(Zt,ve){return Zt[0]-ve[0]});for(var js=0;js<ea.length;js++){for(var Pc=ea[js],ra=Pc[0],Us=Pc[1],Bc=!1,Ie=0,qs=ra+1;qs<Us;qs++){var zc=G[qs];if(z[zc]&kc){Bc=!0;var Lc=z[zc]&Bi?_:w;if(Lc===Yr){Ie=Lc;break}}}if(Bc&&!Ie){Ie=ki;for(var Gs=ra-1;Gs>=0;Gs--){var Oc=G[Gs];if(z[Oc]&kc){var Vc=z[Oc]&Bi?_:w;Ie=Vc===Yr?Yr:Vc;break}}}if(Ie){if(z[G[ra]]=z[G[Us]]=Ie,Ie!==Yr){for(var Oi=ra+1;Oi<G.length;Oi++)if(!(z[G[Oi]]&o)){h(j[G[Oi]])&L&&(z[G[Oi]]=Ie);break}}if(Ie!==Yr){for(var Vi=Us+1;Vi<G.length;Vi++)if(!(z[G[Vi]]&o)){h(j[G[Vi]])&L&&(z[G[Vi]]=Ie);break}}}}for(var nr=0;nr<G.length;nr++)if(z[G[nr]]&s){for(var Rc=nr,Xs=nr,Ys=ki,Ri=nr-1;Ri>=0;Ri--)if(z[G[Ri]]&o)Rc=Ri;else{Ys=z[G[Ri]]&Bi?_:w;break}for(var $c=R0,$i=nr+1;$i<G.length;$i++)if(z[G[$i]]&(s|o))Xs=$i;else{$c=z[G[$i]]&Bi?_:w;break}for(var Ws=Rc;Ws<=Xs;Ws++)z[G[Ws]]=Ys===$c?Ys:Yr;nr=Xs}}}for(var te=it.start;te<=it.end;te++){var $0=U[te],ia=z[te];if($0&1?ia&(w|D|O)&&U[te]++:ia&_?U[te]++:ia&(O|D)&&(U[te]+=2),ia&o&&(U[te]=te===0?it.level:U[te-1]),te===it.end||h(j[te])&(R|B))for(var na=te;na>=0&&h(j[na])&l;na--)U[na]=it.level}}return{levels:U,paragraphs:lt};function Nc(Zt,ve){for(var Ht=Zt;Ht<j.length;Ht++){var ar=z[Ht];if(ar&(_|$))return 1;if(ar&(B|w)||ve&&ar===se)return 0;if(ar&n){var jc=N0(Ht);Ht=jc===-1?j.length:jc}}return 0}function N0(Zt){for(var ve=1,Ht=Zt+1;Ht<j.length;Ht++){var ar=z[Ht];if(ar&B)break;if(ar&se){if(--ve===0)return Ht}else ar&n&&ve++}return-1}},t.getMirroredCharacter=tr,t.getMirroredCharactersMap=function(j,J,rt,z){var ht=j.length;rt=Math.max(0,rt==null?0:+rt),z=Math.min(ht-1,z==null?ht-1:+z);for(var Y=new Map,Z=rt;Z<=z;Z++)if(J[Z]&1){var U=tr(j[Z]);U!==null&&Y.set(Z,U)}return Y},t.getReorderSegments=xe,t.getReorderedIndices=qr,t.getReorderedString=function(j,J,rt,z){var ht=qr(j,J,rt,z),Y=[].concat(j);return ht.forEach(function(Z,U){Y[U]=(J.levels[Z]&1?tr(j[Z]):null)||j[Z]}),Y.join("")},t.openingToClosingBracket=x,Object.defineProperty(t,"__esModule",{value:!0}),t})({})}var Ku=Hw(),Kw=/[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/,Jw=new Set(["WS","FSI","LRI","RLI","PDI"]),Qw=new Set(["S","B"]);function t3(t,e,r,i){let n=[],a=r;for(let s of Vl(t.slice(r,i)))n.push({index:a,text:s,level:e[a]}),a+=s.length;return n}function e3(t,e){let r=!0;for(let i=t.length-1;i>=0;i--){let n=Ku.getBidiCharTypeName(t[i].text[0]);Qw.has(n)?(t[i].level=e,r=!0):r&&Jw.has(n)?t[i].level=e:r=!1}}function r3(t,e){let r=e,i=1/0;for(let{level:a}of t)a>r&&(r=a),(a|1)<i&&(i=a|1);let n=t.slice();for(let a=r;a>=i;a--)for(let s=0;s<n.length;s++){if(n[s].level<a)continue;let o=s;for(;o+1<n.length&&n[o+1].level>=a;)o++;for(let l=s,u=o;l<u;l++,u--)[n[l],n[u]]=[n[u],n[l]];s=o}return n}function i3(t){return t.level%2==0?t.text:Ku.getMirroredCharacter(t.text)??t.text}function n3(t,e){return t.find(r=>e>=r.start&&e<=r.end)?.level??0}function a3(t,e,r,i,n){let a=t3(t,e,i,n);e3(a,r);let s="",o=[];for(let l of r3(a,r)){if(Kw.test(l.text))continue;let u=i3(l);s+=u,o.push(...Array(u.length).fill(l.index))}return{text:s,sourceIndices:o}}function s3(t,e){let r=e.filter(a=>a>0&&a<t.length),i=[...new Set([0,...r,t.length])].sort((a,s)=>a-s),n=[];for(let a=0;a+1<i.length;a++)n.push([i[a],i[a+1]]);return n}function D1(t,e){let{levels:r,paragraphs:i}=Ku.getEmbeddingLevels(t);return s3(t,e.concat(i.map(n=>n.start))).map(([n,a])=>a3(t,r,n3(i,n),n,a))}function o3(t,e){return D1(t,e).map(r=>r.text)}function l3(t,e,r){return D1(t,r).map(i=>[i.text,i.sourceIndices.map(n=>e[n]??0)])}var jl=4294967296,zp=1/jl,S1=new TextDecoder,A1=class{constructor(t){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(t,e,r=this.length){let i;for(;i=this.nextField(r);)t(i,e,this);return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*jl;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*jl;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let e=this.buf,r=e[this.pos++];if(r<128)return r;let i=r&127,n;return n=e[this.pos++],i|=(n&127)<<7,n<128||(n=e[this.pos++],i|=(n&127)<<14,n<128)||(n=e[this.pos++],i|=(n&127)<<21,n<128)?i:(n=e[this.pos],i|=(n&15)<<28,c3(i,t,this))}readSVarint(){let t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=(this.buf[e]<128?12:32)?S1.decode(this.buf.subarray(e,t)):S3(this.buf,e,t)}readBytes(){let t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){let r=this.readPackedEnd(),i=this.buf,n=this.pos;for(;n<r;){let a=i[n];if(a<128){t.push(a),n++;continue}let s=i[n+1];s<128?(t.push(a&127|s<<7),n+=2):(this.pos=n,t.push(this.readVarint(e)),n=this.pos)}return this.pos=n,t}readPackedSVarint(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFloat());return t}readPackedDouble(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}nextField(t=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=t)return 0;let e=this.readVarint();return this.type=e&7,this._valueStart=this.pos,e>>>3}skip(t){let e=t&7;if(e===0)for(;this.buf[this.pos++]>127;);else if(e===2)this.pos=this.readVarint()+this.pos;else if(e===5)this.pos+=4;else if(e===1)this.pos+=8;else throw Error(`Unimplemented type: ${e}`)}},u3=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.length=this.buf.length}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e<this.pos+t;)e*=2;if(e!==this.length){let r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.dataView=new DataView(r.buffer),this.length=e}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*zp),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*zp),!0),this.pos+=8}writeVarint(t){if(t=+t||0,t>=0&&t<128)this.pos>=this.length&&this.realloc(1),this.buf[this.pos++]=t;else if(t>268435455||t<0)p3(t,this);else{for(this.realloc(4);t>127;)this.buf[this.pos++]=t&127|128,t>>>=7;this.buf[this.pos++]=t}}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let e=this.pos;this.pos=A3(this.buf,t,this.pos);let r=this.pos-e;r>=128&&Lp(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let e=t.length;this.writeVarint(e),this.realloc(e),this.buf.set(t,this.pos),this.pos+=e}writeRawMessage(t,e){this.pos++;let r=this.pos;t(e,this);let i=this.pos-r;i>=128&&Lp(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(t,e,r){this.writeTag(t,2),this.writeRawMessage(e,r)}writePackedVarint(t,e){e.length&&this.writeMessage(t,y3,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,m3,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,v3,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,g3,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,x3,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,b3,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,w3,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,_3,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,D3,e)}writeBytesField(t,e){this.writeTag(t,2),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,5),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,5),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,1),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,1),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,0),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,0),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,2),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,5),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,1),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}};function c3(t,e,r){let i=r.buf,n,a;if(a=i[r.pos++],n=(a&112)>>4,a<128||(a=i[r.pos++],n|=(a&127)<<3,a<128)||(a=i[r.pos++],n|=(a&127)<<10,a<128)||(a=i[r.pos++],n|=(a&127)<<17,a<128)||(a=i[r.pos++],n|=(a&127)<<24,a<128)||(a=i[r.pos++],n|=(a&1)<<31,a<128))return h3(t,n,e);throw Error("Expected varint not more than 10 bytes")}function h3(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function p3(t,e){let r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(r=~(-t%4294967296),i=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw Error("Given varint doesn't fit into 10 bytes");e.realloc(10),f3(r,i,e),d3(i,e)}function f3(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}function d3(t,e){let r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function Lp(t,e,r){let i=e<=16383?1:e<=2097151?2:e<=268435455?3:4;r.realloc(i),r.buf.copyWithin(t+i,t,r.pos)}function y3(t,e){let r=t.length,i=e.buf,n=e.pos,a=e.length;for(let s=0;s<r;s++){let o=t[s];if(o<0||n+10>a)e.pos=n,e.writeVarint(o),i=e.buf,n=e.pos,a=e.length;else{for(;o>127;)i[n++]=o%128|128,o=Math.floor(o/128);i[n++]=o}}e.pos=n}function m3(t,e){for(let r=0;r<t.length;r++)e.writeSVarint(t[r])}function g3(t,e){for(let r=0;r<t.length;r++)e.writeFloat(t[r])}function x3(t,e){for(let r=0;r<t.length;r++)e.writeDouble(t[r])}function v3(t,e){for(let r=0;r<t.length;r++)e.writeBoolean(t[r])}function b3(t,e){for(let r=0;r<t.length;r++)e.writeFixed32(t[r])}function w3(t,e){for(let r=0;r<t.length;r++)e.writeSFixed32(t[r])}function _3(t,e){for(let r=0;r<t.length;r++)e.writeFixed64(t[r])}function D3(t,e){for(let r=0;r<t.length;r++)e.writeSFixed64(t[r])}function S3(t,e,r){let i="";for(let n=e;n<r;n++){let a=t[n];if(a>127){let s=t[n+1]^128,o=t[n+2]^128;if(a>=194&&a<224&&s<64&&n+1<r)a=(a&31)<<6|s,n++;else if((a&240)==224&&s<64&&o<64&&n+2<r&&(a=(a&15)<<12|s<<6|o)>=2048&&(a<55296||a>57343))n+=2;else return S1.decode(t.subarray(e,r))}i+=String.fromCharCode(a)}return i}function A3(t,e,r){for(let i=0;i<e.length;i++){let n=e.charCodeAt(i);if(n>=128)return E3(t,e,r,i);t[r++]=n}return r}function E3(t,e,r,i){let n;for(let a;i<e.length;i++){if(a=e.charCodeAt(i),a>55295&&a<57344)if(n){if(a<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=a;continue}a=(n-55296<<10|a-56320)+65536,n=null}else{a>56319?(t[r++]=239,t[r++]=191,t[r++]=189):n=a;continue}else n&&=(t[r++]=239,t[r++]=191,t[r++]=189,null);a<128?t[r++]=a:(a<2048?t[r++]=a>>6|192:(a<65536?t[r++]=a>>12|224:(t[r++]=a>>18|240,t[r++]=a>>12&63|128),t[r++]=a>>6&63|128),t[r++]=a&63|128)}return n&&(t[r++]=239,t[r++]=191,t[r++]=189),r}function T3(t){return typeof t?.renderWithWebGL=="function"}function E1(t){let e=0,r=0;for(let s of t)e+=s.w*s.h,r=Math.max(r,s.w);t.sort((s,o)=>o.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],n=0,a=0;for(let s of t)for(let o=i.length-1;o>=0;o--){let l=i[o];if(!(s.w>l.w||s.h>l.h)){if(s.x=l.x,s.y=l.y,a=Math.max(a,s.y+s.h),n=Math.max(n,s.x+s.w),s.w===l.w&&s.h===l.h){let u=i.pop();u&&o<i.length&&(i[o]=u)}else s.h===l.h?(l.x+=s.w,l.w-=s.w):s.w===l.w?(l.y+=s.h,l.h-=s.h):(i.push({x:l.x+s.w,y:l.y,w:l.w-s.w,h:s.h}),l.y+=s.h,l.h-=s.h);break}}return{w:n,h:a,fill:e/(n*a)||0}}var T1=class{constructor(t,{pixelRatio:e,version:r,isWebGLImage:i=!1,stretchX:n,stretchY:a,content:s,textFitWidth:o,textFitHeight:l}){this.paddedRect=t,this.pixelRatio=e,this.stretchX=n,this.stretchY=a,this.content=s,this.version=r,this.needsFirstWebGLRender=i,this.textFitWidth=o,this.textFitHeight=l}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}},F1=class{constructor(t,e){let r={},i={};this.haveRenderCallbacks=[],this.patchedUpdateVersion=-1;let n=[];this.addImages(t,r,n),this.addImages(e,i,n);let{w:a,h:s}=E1(n),o=new ie({width:a||1,height:s||1});for(let l in t){let u=t[l];if(u.isWebGLImage)continue;let c=r[l].paddedRect;ie.copy(u.data,o,{x:0,y:0},{x:c.x+1,y:c.y+1},u.data)}for(let l in e){let u=e[l],c=i[l].paddedRect,h=c.x+1,p=c.y+1,f=u.data.width,d=u.data.height;ie.copy(u.data,o,{x:0,y:0},{x:h,y:p},u.data),ie.copy(u.data,o,{x:0,y:d-1},{x:h,y:p-1},{width:f,height:1}),ie.copy(u.data,o,{x:0,y:0},{x:h,y:p+d},{width:f,height:1}),ie.copy(u.data,o,{x:f-1,y:0},{x:h-1,y:p},{width:1,height:d}),ie.copy(u.data,o,{x:0,y:0},{x:h+f,y:p},{width:1,height:d})}this.image=o,this.iconPositions=r,this.patternPositions=i}addImages(t,e,r){for(let i in t){let n=t[i],a={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(a),e[i]=new T1(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(t,e){if(t.dispatchRenderCallbacks(this.haveRenderCallbacks),this.patchedUpdateVersion!==t.updateVersion){this.patchedUpdateVersion=t.updateVersion;for(let r in this.iconPositions)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e);for(let r in this.patternPositions)this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)}}patchUpdatedImage(t,e,r){if(!t||!e||!t.needsFirstWebGLRender&&t.version===e.version)return;t.needsFirstWebGLRender=!1,t.version=e.version;let[i,n]=t.tl,a=e.userImage?.data;if(!T3(a)){r.update(e.data,void 0,{x:i,y:n});return}let{width:s,height:o}=e.data;r.context.setCustomLayerDefaults(),a.renderWithWebGL({gl:r.context.gl,texture:r.texture,x:i,y:n,width:s,height:o}),r.context.setDirty()}};P("ImagePosition",T1),P("ImageAtlas",F1);var C1=(function(t){return t[t.none=0]="none",t[t.horizontal=1]="horizontal",t[t.vertical=2]="vertical",t[t.horizontalOnly=3]="horizontalOnly",t})(C1||{});function F3(t){for(let e of t)if(e.positionedGlyphs.length!==0)return!1;return!0}function C3(t,e){let r=[],i=0;for(let n of e)r.push(t.substring(i,n)),i=n;return i<t.length()&&r.push(t.substring(i,t.length())),r}var Op=/^\p{gc=M}$/u;function I3(t){let e=[],r=0;for(;r<t.length;){if(!Op.test(t[r])){e.push(r),r++;continue}let i=r;for(;i<t.length&&Op.test(t[i]);)i++;let n=t[i];if(n!==void 0&&b1(n.codePointAt(0))){e.push(i);for(let a=i-1;a>=r;a--)e.push(a);r=i+1}else{for(let a=r;a<i;a++)e.push(a);r=i}}return e}function k3(t){let e=[],r=0;for(let i of t.graphemes())e.push(...Array(i.length).fill(t.sectionIndex[r])),r++;return e}function M3(t,e){let r=e.map(a=>t.toCodeUnitIndex(a)),i=Si.isParsed()?Si:null;if(t.sections.length===1)return i?i.processBidirectionalText(t.toString(),r).map(a=>Vp(a,t.sections,[...a].map(()=>0))):o3(t.toString(),r).map(a=>Ul([...a],t.sections,[...a].map(()=>0)));let n=k3(t);return i?i.processStyledBidirectionalText(t.text,n,r).map(([a,s])=>Vp(a,t.sections,s)):l3(t.text,n,r).map(([a,s])=>{let o=[...a];return Ul(o,t.sections,I1(o).map(l=>s[l]??0))})}function Ul(t,e,r){let i=new Hu(t.join(""),e,[]),n=0;for(let a of i.graphemes())i.sectionIndex.push(r[n]??0),n+=[...a].length;return i}function I1(t){let e=[],r=0;for(let i of t)e.push(r),r+=i.length;return e}function Vp(t,e,r){let i=[...t],n=I1(i),a=I3(i);return Ul(a.map(s=>i[s]),e,a.map(s=>r[n[s]]??0))}function xa(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d){let y=Hu.fromFeature(t,n,h===2,e),m=y.determineLineBreaks(u,a,e,i,f),g=w1(y.text)?M3(y,m):C3(y,m),x=[],v={positionedLines:x,text:y.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:h,iconsInText:!1,verticalizable:!1};return O3(v,e,r,i,g,s,o,l,h,u,p,d),!F3(x)&&v}function k1(t){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function P3(t,e,r){let i=e.getMaxScale()*24,{maxImageWidth:n,maxImageHeight:a}=e.getMaxImageSize(t),s=Math.max(i,a*r);return{verticalLineContentWidth:Math.max(i,n*r),horizontalLineContentHeight:s}}function M1(t){switch(t){case"top":return 0;case"center":return .5;default:return 1}}function B3(t,e){return t?.rect?t:e?{rect:null,metrics:e.metrics}:null}function P1(t,e,r){return!(t===1||!e&&!$n(r)||e&&(In(r)||v1(r)))}function Ia(t){return/\p{Nd}/u.test(String.fromCodePoint(t))}function B1(t){return/\p{Lu}/u.test(String.fromCodePoint(t))}function z1(t){let e=t.some(Ia)&&t.every(i=>Ia(i)||bs(i)),r=t.length<=3&&t.every(i=>B1(i)||Ia(i));return e||r}function L1(t){return(Ia(t)||B1(t))&&!v1(t)}function z3(t,e){return e?P1(2,!0,t):!Ai(t)||L1(t)||bs(t)}function L3(t,e,r){let i=!1;for(let n=0;n<t.length;n++){if(e[n])continue;let a=ni[t[n]];if(a&&(n===0||e[n-1])&&(n===t.length-1||e[n+1])){if(e[n]=!0,r[n])continue;t[n]=a,i=!0}}return i}function Rp(t,e,r){for(;e>=0&&e<t.length&&In(t[e]);)e+=r;let i=[];for(;e>=0&&e<t.length&&!$n(t[e])&&!In(t[e]);)i.push(t[e]),e+=r;return!z1(i)&&!i.every(bs)&&i.some(Ai)}function O1(t,e){let r=t.graphemes().slice(),i=r.map(o=>o.codePointAt(0)),n=r.map((o,l)=>{let u=t.getSection(l);return"fontStack"in u&&!!e[u.fontStack]?.vertical?.[o]}),a=i.map($n),s=o=>!a[o]&&!In(i[o])&&!("imageName"in t.getSection(o));for(let o=0;o<i.length;o++){if(!s(o))continue;let l=o;for(;l+1<i.length&&s(l+1);)l++;let u=i.slice(o,l+1),c=z1(u),h=u.every(bs),p=h&&(Rp(i,o-1,-1)||Rp(i,l+1,1)),f=!c&&u.some(Ai);for(let d=o;d<=l;d++)a[d]=c&&L1(i[d])||n[d]&&!p&&(h||!f&&!Ai(i[d]));o=l}if(n.some((o,l)=>o&&!a[l])){let o=t.text;if(t.verticalizePunctuation(e,a),t.text!==o)return O1(t,e)}return L3(r,a,n)&&(t.text=r.join(""),t.cachedGraphemes=r),a}function O3(t,e,r,i,n,a,s,o,l,u,c,h){let p=0,f=0,d=0,y=0,m=o==="right"?1:o==="left"?0:.5,g=24/h,x=0;for(let w of n){w.trim();let _=w.getMaxScale(),D={positionedGlyphs:[],lineOffset:0};t.positionedLines[x]=D;let A=D.positionedGlyphs,E=0;if(!w.length()){f+=a,++x;continue}let O=P3(i,w,g),k=l===2&&!c?O1(w,e):null,B=w.graphemes();for(let C=0;C<B.length;C++){let L=w.getSection(C),$=B[C],X=$.codePointAt(0),at=k?k[C]:P1(l,c,X),ft="fontStack"in L&&Rl($)&&!e[L.fontStack]?.default?.[$]?[...$]:[$];for(let ut of ft){let ct={glyph:ut.codePointAt(0),grapheme:ut,imageName:null,x:p,y:f+-17,vertical:at,scale:1,fontStack:"",sectionIndex:w.getSectionIndex(C),metrics:null,rect:null},_t;if("fontStack"in L){if(_t=V3(L,ut,at,O,e,r),!_t)continue;ct.fontStack=L.fontStack}else{if(t.iconsInText=!0,L.scale*=g,_t=R3(L,at,_,O,i),!_t)continue;E=Math.max(E,_t.imageOffset),ct.imageName=L.imageName}let{rect:Jt,metrics:ge,baselineOffset:se}=_t;if(ct.y+=se,ct.scale=L.scale,ct.metrics=ge,ct.rect=Jt,A.push(ct),!at)p+=ge.advance*L.scale+u;else{t.verticalizable=!0;let Je="imageName"in L?ge.advance:24;p+=Je*L.scale+u}}}if(A.length!==0){let C=p-u;d=Math.max(C,d),$3(A,0,A.length-1,m)}p=0;let R=(_-1)*24;D.lineOffset=Math.max(E,R);let I=a*_+E;f+=I,y=Math.max(I,y),++x}let{horizontalAlign:v,verticalAlign:b}=k1(s);N3(t.positionedLines,m,v,b,d,y,a,f,n.length),t.top+=-b*f,t.bottom=t.top+f,t.left+=-v*d,t.right=t.left+d}function V3(t,e,r,i,n,a){let s=r&&n[t.fontStack]?.vertical?.[e]?"vertical":"default",o=B3(a[t.fontStack]?.[s]?.[e],n[t.fontStack]?.[s]?.[e]);if(o===null)return null;let l;if(r)l=i.verticalLineContentWidth-t.scale*24;else{let u=M1(t.verticalAlign);l=(i.horizontalLineContentHeight-t.scale*24)*u}return{rect:o.rect,metrics:o.metrics,baselineOffset:l}}function R3(t,e,r,i,n){let a=n[t.imageName];if(!a)return null;let s=a.paddedRect,o=a.displaySize,l={width:o[0],height:o[1],left:1,top:-3,advance:e?o[1]:o[0]},u;if(e)u=i.verticalLineContentWidth-o[1]*t.scale;else{let h=M1(t.verticalAlign);u=(i.horizontalLineContentHeight-o[1]*t.scale)*h}let c=(e?o[0]:o[1])*t.scale-24*r;return{rect:s,metrics:l,baselineOffset:u,imageOffset:c}}function $3(t,e,r,i){if(i===0)return;let n=t[r],a=n.metrics.advance*n.scale,s=(t[r].x+a)*i;for(let o=e;o<=r;o++)t[o].x-=s}function N3(t,e,r,i,n,a,s,o,l){let u=(e-r)*n,c=0;c=a===s?-i*l*s+.5*s:-o*i- -17;for(let h of t)for(let p of h.positionedGlyphs)p.x+=u,p.y+=c}function j3(t,e,r){let{horizontalAlign:i,verticalAlign:n}=k1(r),a=e[0],s=e[1],o=a-t.displaySize[0]*i,l=o+t.displaySize[0],u=s-t.displaySize[1]*n;return{image:t,top:u,bottom:u+t.displaySize[1],left:o,right:l}}function V1(t){let e=t.left,r=t.top,i=t.right-e,n=t.bottom-r,a=t.image.content[2]-t.image.content[0],s=t.image.content[3]-t.image.content[1],o=t.image.textFitWidth??"stretchOrShrink",l=t.image.textFitHeight??"stretchOrShrink",u=a/s;if(l==="proportional"){if(o==="stretchOnly"&&i/n<u||o==="proportional"){let c=Math.ceil(n*u);e*=c/i,i=c}}else if(o==="proportional"&&l==="stretchOnly"&&u!==0&&i/n>u){let c=Math.ceil(i/u);r*=c/n,n=c}return{x1:e,y1:r,x2:e+i,y2:r+n}}function $p(t,e,r,i,n,a,s=1){let o=t.image,l;if(o.content){let v=o.content,b=o.pixelRatio||1;l=[v[0]/b,v[1]/b,o.displaySize[0]-v[2]/b,o.displaySize[1]-v[3]/b]}let u=s>0?a/s:a,c=s>0?1/s:1,h=e.left*u,p=e.right*u,f,d,y,m;r==="width"||r==="both"?(m=n[0]+h-i[3]*c,d=n[0]+p+i[1]*c):(m=n[0]+(h+p-o.displaySize[0])/2,d=m+o.displaySize[0]);let g=e.top*u,x=e.bottom*u;return r==="height"||r==="both"?(f=n[1]+g-i[0]*c,y=n[1]+x+i[2]*c):(f=n[1]+(g+x-o.displaySize[1])/2,y=f+o.displaySize[1]),{image:o,top:f,right:d,bottom:y,left:m,collisionPadding:l}}var Np=32640;function jp(t,e){let{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new ot(t+1))};if(r.kind==="source")return{kind:"source"};if(r.kind==="composite"){let{minZoom:i,maxZoom:n}=U3(r.zoomStops,t);return{kind:"composite",minZoom:i,maxZoom:n,interpolationType:r.interpolationType}}{let i=q3(r),n=r.evaluate(new ot(t+1));return{kind:"camera",zoomStops:r.zoomStops,sizes:i,layoutSize:n,interpolationType:r.interpolationType}}}function U3(t,e){let r=0;for(;r<t.length&&t[r]<=e;)r++;r=Math.max(0,r-1);let i=r;for(;i<t.length&&t[i]<e+1;)i++;return i=Math.min(t.length-1,i),{minZoom:t[r],maxZoom:t[i]}}function q3(t){return t.zoomStops.map(e=>t.evaluate(new ot(e===-1/0?t.zoomStops[1]-1:e)))}var ci=class R1 extends F{constructor(e,r,i,n){super(e,r),this.angle=i,n!==void 0&&(this.segment=n)}clone(){return new R1(this.x,this.y,this.angle,this.segment)}};P("Anchor",ci);function $1(t,e,r,i,n){if(e.segment===void 0||r===0)return!0;let a=e,s=e.segment+1,o=0;for(;o>-r/2;){if(s--,s<0)return!1;o-=t[s].dist(a),a=t[s]}o+=t[s].dist(t[s+1]),s++;let l=[],u=0;for(;o<r/2;){let c=t[s-1],h=t[s],p=t[s+1];if(!p)return!1;let f=c.angleTo(h)-h.angleTo(p);for(f=Math.abs((f+3*Math.PI)%(Math.PI*2)-Math.PI),l.push({distance:o,angleDelta:f}),u+=f;o-l[0].distance>i;)u-=l.shift().angleDelta;if(u>n)return!1;s++,o+=h.dist(p)}return!0}function N1(t){let e=0;for(let r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function j1(t,e,r){return t?3/5*e*r:0}function U1(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function G3(t,e,r,i,n,a){let s=j1(r,n,a),o=U1(r,i)*a,l=0,u=N1(t)/2;for(let c=0;c<t.length-1;c++){let h=t[c],p=t[c+1],f=h.dist(p);if(l+f>u){let d=(u-l)/f,y=new ci(He.number(h.x,p.x,d),He.number(h.y,p.y,d),p.angleTo(h),c);return y._round(),!s||$1(t,y,o,s,e)?y:void 0}l+=f}}function X3(t,e,r,i,n,a,s,o,l){let u=j1(i,a,s),c=U1(i,n),h=c*s,p=t[0].x===0||t[0].x===l||t[0].y===0||t[0].y===l;e-h<e/4&&(e=h+e/4);let f=a*2;return q1(t,p?e/2*o%e:(c/2+f)*s*o%e,e,u,r,h,p,!1,l)}function q1(t,e,r,i,n,a,s,o,l){let u=a/2,c=N1(t),h=0,p=e-r,f=[];for(let d=0;d<t.length-1;d++){let y=t[d],m=t[d+1],g=y.dist(m),x=m.angleTo(y);for(;p+r<h+g;){p+=r;let v=(p-h)/g,b=He.number(y.x,m.x,v),w=He.number(y.y,m.y,v);if(b>=0&&b<l&&w>=0&&w<l&&p-u>=0&&p+u<=c){let _=new ci(b,w,x,d);_._round(),(!i||$1(t,_,a,i,n))&&f.push(_)}}h+=g}return o||f.length||s||(f=q1(t,h/2,r,i,n,a,s,!0,l)),f}function Y3(t,e,r,i,n){let a=[];for(let s of t){let o;for(let l=0;l<s.length-1;l++){let u=s[l],c=s[l+1];u.x<e&&c.x<e||(u.x<e?u=new F(e,u.y+(c.y-u.y)*((e-u.x)/(c.x-u.x)))._round():c.x<e&&(c=new F(e,u.y+(c.y-u.y)*((e-u.x)/(c.x-u.x)))._round()),u.y<r&&c.y<r||(u.y<r?u=new F(u.x+(c.x-u.x)*((r-u.y)/(c.y-u.y)),r)._round():c.y<r&&(c=new F(u.x+(c.x-u.x)*((r-u.y)/(c.y-u.y)),r)._round()),u.x>=i&&c.x>=i||(u.x>=i?u=new F(i,u.y+(c.y-u.y)*((i-u.x)/(c.x-u.x)))._round():c.x>=i&&(c=new F(i,u.y+(c.y-u.y)*((i-u.x)/(c.x-u.x)))._round()),u.y>=n&&c.y>=n||(u.y>=n?u=new F(u.x+(c.x-u.x)*((n-u.y)/(c.y-u.y)),n)._round():c.y>=n&&(c=new F(u.x+(c.x-u.x)*((n-u.y)/(c.y-u.y)),n)._round()),o&&u.equals(o[o.length-1])||(o=[u],a.push(o)),o.push(c)))))}}return a}function W3(t,e,r,i,n,a){let s=Up(t,e,r,n,0);return s=Up(s,e,i,a,1),s}function Up(t,e,r,i,n){switch(e){case 1:return Z3(t,r,i,n);case 2:return qp(t,r,i,n,!1);case 3:return qp(t,r,i,n,!0)}return[]}function Z3(t,e,r,i){let n=[];for(let a of t)for(let s of a){let o=i===0?s.x:s.y;o>=e&&o<=r&&n.push([s])}return n}function H3(t,e,r,i,n){let a=i===0?K3:J3,s=[],o=[];for(let c=0;c<t.length-1;c++){let h=t[c],p=t[c+1],f=i===0?h.x:h.y,d=i===0?p.x:p.y,y=!1;f<e?d>=e&&s.push(a(h,p,e)):f>r?d<=r&&s.push(a(h,p,r)):s.push(h),d<e&&f>=e&&(s.push(a(h,p,e)),y=!0),d>r&&f<=r&&(s.push(a(h,p,r)),y=!0),!n&&y&&(o.push(s),s=[])}let l=t.length-1,u=i===0?t[l].x:t[l].y;return u>=e&&u<=r&&s.push(t[l]),n&&s.length>0&&!s[0].equals(s[s.length-1])&&s.push(new F(s[0].x,s[0].y)),s.length>0&&o.push(s),o}function qp(t,e,r,i,n){let a=[];for(let s of t){let o=H3(s,e,r,i,n);o.length>0&&a.push(...o)}return a}function K3(t,e,r){let i=(r-t.x)/(e.x-t.x);return new F(r,t.y+(e.y-t.y)*i)}function J3(t,e,r){let i=(r-t.y)/(e.y-t.y);return new F(t.x+(e.x-t.x)*i,r)}function Gp(t,e,r,i,n=1){let a=[],s=t.image,o=s.pixelRatio,l=s.paddedRect.w-2,u=s.paddedRect.h-2,c={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},h=s.stretchX||[[0,l]],p=s.stretchY||[[0,u]],f=(C,L)=>C+L[1]-L[0],d=h.reduce(f,0),y=p.reduce(f,0),m=l-d,g=u-y,x=0,v=d,b=0,w=y,_=0,D=m,A=0,E=g;if(s.content&&i){let C=s.content,L=C[2]-C[0],$=C[3]-C[1];(s.textFitWidth||s.textFitHeight)&&(c=V1(t)),x=va(h,0,C[0]),b=va(p,0,C[1]),v=va(h,C[0],C[2]),w=va(p,C[1],C[3]),_=C[0]-x,A=C[1]-b,D=L-v,E=$-w}let O=c.x1,k=c.y1,B=c.x2-O,R=c.y2-k,I=(C,L,$,X)=>{let at=ba(C.stretch-x,v,B,O),ft=wa(C.fixed-_,D,C.stretch,d),ut=ba(L.stretch-b,w,R,k),ct=wa(L.fixed-A,E,L.stretch,y),_t=ba($.stretch-x,v,B,O),Jt=wa($.fixed-_,D,$.stretch,d),ge=ba(X.stretch-b,w,R,k),se=wa(X.fixed-A,E,X.stretch,y),Je=new F(at,ut),Qe=new F(_t,ut),Ur=new F(_t,ge),tr=new F(at,ge),xe=n/o,qr=new F(ft*xe,ct*xe),j=new F(Jt*xe,se*xe),J=e*Math.PI/180;if(J){let Z=Math.sin(J),U=Math.cos(J),st=[U,-Z,Z,U];Je._matMult(st),Qe._matMult(st),tr._matMult(st),Ur._matMult(st)}let rt=C.stretch+C.fixed,z=$.stretch+$.fixed,ht=L.stretch+L.fixed,Y=X.stretch+X.fixed;return{tl:Je,tr:Qe,bl:tr,br:Ur,tex:{x:s.paddedRect.x+1+rt,y:s.paddedRect.y+1+ht,w:z-rt,h:Y-ht},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:qr,pixelOffsetBR:j,minFontScaleX:D*xe/B,minFontScaleY:E*xe/R,isSDF:r}};if(!i||!s.stretchX&&!s.stretchY)a.push(I({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:u+1}));else{let C=Xp(h,m,d),L=Xp(p,g,y);for(let $=0;$<C.length-1;$++){let X=C[$],at=C[$+1];for(let ft=0;ft<L.length-1;ft++){let ut=L[ft],ct=L[ft+1];a.push(I(X,ut,at,ct))}}}return a}function va(t,e,r){let i=0;for(let n of t)i+=Math.max(e,Math.min(r,n[1]))-Math.max(e,Math.min(r,n[0]));return i}function Xp(t,e,r){let i=[{fixed:-1,stretch:0}];for(let[n,a]of t){let s=i[i.length-1];i.push({fixed:n-s.stretch,stretch:s.stretch}),i.push({fixed:n-s.stretch,stretch:s.stretch+(a-n)})}return i.push({fixed:e+1,stretch:r}),i}function ba(t,e,r,i){return t/e*r+i}function wa(t,e,r,i){return t-e*r/i}function Q3(t,e,r,i,n,a,s,o){let l=i.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,u=[];for(let c of e.positionedLines)for(let h of c.positionedGlyphs){if(!h.rect)continue;let p=h.rect||{},f=4,d=!0,y=1,m=0,g=(n||o)&&h.vertical,x=h.metrics.advance*h.scale/2;if(o&&e.verticalizable){let $=(h.scale-1)*24,X=(24-h.metrics.width*h.scale)/2;m=c.lineOffset/2-(h.imageName?-X:$)}if(h.imageName){let $=s[h.imageName];d=$.sdf,y=$.pixelRatio,f=1/y}let v=n?[h.x+x,h.y]:[0,0],b=n?[0,0]:[h.x+x+r[0],h.y+r[1]-m],w=[0,0];g&&(w=b,b=[0,0]);let _=h.metrics.isDoubleResolution?2:1,D=(h.metrics.left-f)*h.scale-x+b[0],A=(-h.metrics.top-f)*h.scale+b[1],E=D+p.w/_*h.scale/y,O=A+p.h/_*h.scale/y,k=new F(D,A),B=new F(E,A),R=new F(D,O),I=new F(E,O);if(g){let $=new F(-x,x- -17),X=-Math.PI/2,at=12-x,ft=h.imageName?at:0,ut=new F(22-at,-ft),ct=new F(...w);k._rotateAround(X,$)._add(ut)._add(ct),B._rotateAround(X,$)._add(ut)._add(ct),R._rotateAround(X,$)._add(ut)._add(ct),I._rotateAround(X,$)._add(ut)._add(ct)}if(l){let $=Math.sin(l),X=Math.cos(l),at=[X,-$,$,X];k._matMult(at),B._matMult(at),R._matMult(at),I._matMult(at)}let C=new F(0,0),L=new F(0,0);u.push({tl:k,tr:B,bl:R,br:I,tex:p,writingMode:e.writingMode,glyphOffset:v,sectionIndex:h.sectionIndex,isSDF:d,pixelOffsetTL:C,pixelOffsetBR:L,minFontScaleX:0,minFontScaleY:0})}return u}var _a=class{constructor(t,e,r,i,n,a,s,o,l,u){if(this.boxStartIndex=t.length,l){let c=a.top,h=a.bottom,p=a.collisionPadding;p&&(c-=p[1],h+=p[3]);let f=h-c;f>0&&(f=Math.max(10,f),this.circleDiameter=f)}else{let c=a.image?.content&&(a.image.textFitWidth||a.image.textFitHeight)?V1(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};c.y1=c.y1*s-o[0],c.y2=c.y2*s+o[2],c.x1=c.x1*s-o[3],c.x2=c.x2*s+o[1];let h=a.collisionPadding;if(h&&(c.x1-=h[0]*s,c.y1-=h[1]*s,c.x2+=h[2]*s,c.y2+=h[3]*s),u){let p=new F(c.x1,c.y1),f=new F(c.x2,c.y1),d=new F(c.x1,c.y2),y=new F(c.x2,c.y2),m=u*Math.PI/180;p._rotate(m),f._rotate(m),d._rotate(m),y._rotate(m),c.x1=Math.min(p.x,f.x,d.x,y.x),c.x2=Math.max(p.x,f.x,d.x,y.x),c.y1=Math.min(p.y,f.y,d.y,y.y),c.y2=Math.max(p.y,f.y,d.y,y.y)}t.emplaceBack(e.x,e.y,c.x1,c.y1,c.x2,c.y2,r,i,n)}this.boxEndIndex=t.length}},t5=class{constructor(t=[],e=(r,i)=>r<i?-1:+(r>i)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t<i;){let a=(t<<1)+1,s=a+1;if(s<this.length&&r(e[s],e[a])<0&&(a=s),r(e[a],n)>=0)break;e[t]=e[a],t=a}e[t]=n}};function e5(t,e=1){let r=Sn.fromPoints(t[0]),i=Math.min(r.width(),r.height()),n=i/2,a=new t5([],r5),{minX:s,minY:o,maxX:l,maxY:u}=r;if(i===0)return new F(s,o);for(let p=s;p<l;p+=i)for(let f=o;f<u;f+=i)a.push(new ri(p+n,f+n,n,t));let c=n5(t),h=c;for(;a.length;){let p=a.pop();(p.d>h.d||!h.d)&&(h=p),p.max-h.d<=e||(n=p.h/2,a.push(new ri(p.p.x-n,p.p.y-n,n,t)),a.push(new ri(p.p.x+n,p.p.y-n,n,t)),a.push(new ri(p.p.x-n,p.p.y+n,n,t)),a.push(new ri(p.p.x+n,p.p.y+n,n,t)))}return c.d>0&&h.d-c.d<=e?c.p:h.p}function r5(t,e){return e.max-t.max}var ri=class{constructor(t,e,r,i){this.p=new F(t,e),this.h=r,this.d=i5(this.p,i),this.max=this.d+this.h*Math.SQRT2}};function i5(t,e){let r=!1,i=1/0;for(let n of e)for(let a=0,s=n.length,o=s-1;a<s;o=a++){let l=n[a],u=n[o];l.y>t.y!=u.y>t.y&&t.x<(u.x-l.x)*(t.y-l.y)/(u.y-l.y)+l.x&&(r=!r),i=Math.min(i,xy(t,l,u))}return(r?1:-1)*Math.sqrt(i)}function n5(t){let e=0,r=0,i=0,n=t[0];for(let a=0,s=n.length,o=s-1;a<s;o=a++){let l=n[a],u=n[o],c=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*c,i+=(l.y+u.y)*c,e+=c*3}return new ri(r/e,i/e,0,t)}var a5=(function(t){return t[t.center=1]="center",t[t.left=2]="left",t[t.right=3]="right",t[t.top=4]="top",t[t.bottom=5]="bottom",t[t["top-left"]=6]="top-left",t[t["top-right"]=7]="top-right",t[t["bottom-left"]=8]="bottom-left",t[t["bottom-right"]=9]="bottom-right",t})({}),Ju=1/0;function G1(t,e){function r(n,a){let s=0,o=0;a<0&&(a=0);let l=a/Math.SQRT2;switch(n){case"top-right":case"top-left":o=l-7;break;case"bottom-right":case"bottom-left":o=-l+7;break;case"bottom":o=-a+7;break;case"top":o=a-7}switch(n){case"top-right":case"bottom-right":s=-l;break;case"top-left":case"bottom-left":s=l;break;case"left":s=a;break;case"right":s=-a}return[s,o]}function i(n,a,s){let o=0,l=0;switch(a=Math.abs(a),s=Math.abs(s),n){case"top-right":case"top-left":case"top":l=s-7;break;case"bottom-right":case"bottom-left":case"bottom":l=-s+7}switch(n){case"top-right":case"bottom-right":case"right":o=-a;break;case"top-left":case"bottom-left":case"left":o=a}return[o,l]}return e[1]===Ju?r(t,e[0]):i(t,e[0],e[1])}function X1(t,e,r){let i=t.layout,n=i.get("text-variable-anchor-offset")?.evaluate(e,{},r);if(n){let s=n.values,o=[];for(let l=0;l<s.length;l+=2){let u=o[l]=s[l],c=s[l+1].map(h=>h*24);u.startsWith("top")?c[1]-=7:u.startsWith("bottom")&&(c[1]+=7),o[l+1]=c}return new Le(o)}let a=i.get("text-variable-anchor");if(a){let s;s=t._unevaluatedLayout.getValue("text-radial-offset")===void 0?i.get("text-offset").evaluate(e,{},r).map(l=>l*24):[i.get("text-radial-offset").evaluate(e,{},r)*24,Ju];let o=[];for(let l of a)o.push(l,G1(l,s));return new Le(o)}return null}function s5(t){t.bucket.createArrays();let e=512*t.bucket.overscaling;t.bucket.tilePixelRatio=et/e,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],i=r.layout,n=r._unevaluatedLayout._values,a={layoutIconSize:n["icon-size"].possiblyEvaluate(new ot(t.bucket.zoom+1),t.canonical),layoutTextSize:n["text-size"].possiblyEvaluate(new ot(t.bucket.zoom+1),t.canonical),textMaxSize:n["text-size"].possiblyEvaluate(new ot(18))};if(t.bucket.textSizeData.kind==="composite"){let{minZoom:c,maxZoom:h}=t.bucket.textSizeData;a.compositeTextSizes=[n["text-size"].possiblyEvaluate(new ot(c),t.canonical),n["text-size"].possiblyEvaluate(new ot(h),t.canonical)]}if(t.bucket.iconSizeData.kind==="composite"){let{minZoom:c,maxZoom:h}=t.bucket.iconSizeData;a.compositeIconSizes=[n["icon-size"].possiblyEvaluate(new ot(c),t.canonical),n["icon-size"].possiblyEvaluate(new ot(h),t.canonical)]}let s=i.get("text-line-height")*24,o=i.get("text-rotation-alignment")!=="viewport"&&i.get("symbol-placement")!=="point",l=i.get("text-keep-upright"),u=i.get("text-size");for(let c of t.bucket.features){let h=i.get("text-font").evaluate(c,{},t.canonical).join(","),p=u.evaluate(c,{},t.canonical),f=a.layoutTextSize.evaluate(c,{},t.canonical),d=a.layoutIconSize.evaluate(c,{},t.canonical),y={horizontal:{},vertical:void 0},m=c.text,g=[0,0];if(m){let w=m.toString(),_=i.get("text-letter-spacing").evaluate(c,{},t.canonical)*24,D=x1(w)?_:0,A=i.get("text-anchor").evaluate(c,{},t.canonical),E=X1(r,c,t.canonical);if(!E){let R=i.get("text-radial-offset").evaluate(c,{},t.canonical);g=R?G1(A,[R*24,Ju]):i.get("text-offset").evaluate(c,{},t.canonical).map(I=>I*24)}let O=o?"center":i.get("text-justify").evaluate(c,{},t.canonical),k=i.get("symbol-placement")==="point"?i.get("text-max-width").evaluate(c,{},t.canonical)*24:1/0,B=()=>{t.bucket.allowVerticalPlacement&&$l(w)&&(y.vertical=xa(m,t.glyphMap,t.glyphPositions,t.imagePositions,h,k,s,A,"left",D,g,2,!0,f,p))};if(!o&&E){let R=new Set;if(O==="auto")for(let C=0;C<E.values.length;C+=2)R.add(Yp(E.values[C]));else R.add(O);let I=!1;for(let C of R)if(!y.horizontal[C])if(I)y.horizontal[C]=y.horizontal[0];else{let L=xa(m,t.glyphMap,t.glyphPositions,t.imagePositions,h,k,s,"center",C,D,g,1,!1,f,p);L&&(y.horizontal[C]=L,I=L.positionedLines.length===1)}B()}else{O==="auto"&&(O=Yp(A));let R=xa(m,t.glyphMap,t.glyphPositions,t.imagePositions,h,k,s,A,O,D,g,1,!1,f,p);R&&(y.horizontal[O]=R),B(),$l(w)&&o&&l&&(y.vertical=xa(m,t.glyphMap,t.glyphPositions,t.imagePositions,h,k,s,A,O,D,g,2,!1,f,p))}}let x,v=!1;if(c.icon?.name){let w=t.imageMap[c.icon.name];w&&(x=j3(t.imagePositions[c.icon.name],i.get("icon-offset").evaluate(c,{},t.canonical),i.get("icon-anchor").evaluate(c,{},t.canonical)),v=!!w.sdf,t.bucket.sdfIcons===void 0?t.bucket.sdfIcons=v:t.bucket.sdfIcons!==v&&Mt("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),w.pixelRatio===t.bucket.pixelRatio?i.get("icon-rotate").constantOr(1)!==0&&(t.bucket.iconsNeedLinear=!0):t.bucket.iconsNeedLinear=!0)}let b=Y1(y.horizontal)||y.vertical;t.bucket.iconsInText||=b?b.iconsInText:!1,(b||x)&&o5(t.bucket,c,y,x,t.imageMap,a,f,d,g,v,t.canonical,t.subdivisionGranularity,t.hasPromoteId)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()}function Yp(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function o5(t,e,r,i,n,a,s,o,l,u,c,h,p){let f=a.textMaxSize.evaluate(e,{});f===void 0&&(f=s);let d=t.layers[0].layout,y=d.get("icon-offset").evaluate(e,{},c),m=Y1(r.horizontal),g=s/24,x=t.tilePixelRatio*g,v=t.tilePixelRatio*f/24,b=t.tilePixelRatio*o,w=t.tilePixelRatio*d.get("symbol-spacing"),_=d.get("text-padding")*t.tilePixelRatio,D=D5(d,e,c,t.tilePixelRatio),A=d.get("text-max-angle")/180*Math.PI,E=d.get("text-rotation-alignment")!=="viewport"&&d.get("symbol-placement")!=="point",O=d.get("icon-rotation-alignment").constantOr("viewport")==="map"&&d.get("symbol-placement")!=="point",k=d.get("symbol-placement"),B=w/2,R=d.get("icon-text-fit"),I;i&&R!=="none"&&(t.allowVerticalPlacement&&r.vertical&&(I=$p(i,r.vertical,R,d.get("icon-text-fit-padding"),y,g,o)),m&&(i=$p(i,m,R,d.get("icon-text-fit-padding"),y,g,o)));let C=c?h.line.getGranularityForZoomLevel(c.z):1,L=($,X)=>{Pu(X)||u5(t,X,$,r,i,n,I,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,x,[_,_,_,_],E,l,b,D,O,y,e,a,u,c,s,o,p)};if(k==="line")for(let $ of Y3(e.geometry,0,0,et,et)){let X=Tr($,C),at=X3(X,w,A,r.vertical||m,i,24,v,t.overscaling,et);for(let ft of at){let ut=m;ut&&c5(t,ut.text,B,ft)||L(X,ft)}}else if(k==="line-center"){for(let $ of e.geometry)if($.length>1){let X=Tr($,C),at=G3(X,A,r.vertical||m,i,24,v);at&&L(X,at)}}else if(e.type==="Polygon")for(let $ of os(e.geometry,0)){let X=e5($,16);L(Tr($[0],C,!0),new ci(X.x,X.y,0))}else if(e.type==="LineString")for(let $ of e.geometry){let X=Tr($,C);L(X,new ci(X[0].x,X[0].y,0))}else if(e.type==="Point")for(let $ of e.geometry)for(let X of $)L([X],new ci(X.x,X.y,0))}function l5(t,e){let r=t.length,i=e?.values;if(i?.length>0)for(let n=0;n<i.length;n+=2){let a=a5[i[n]],s=i[n+1];t.emplaceBack(a,s[0],s[1])}return[r,t.length]}function Wp(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y){let m=Q3(e,r,o,n,a,s,i,t.allowVerticalPlacement),g=t.textSizeData,x=null;g.kind==="source"?(x=[128*n.layout.get("text-size").evaluate(s,{})],x[0]>32640&&Mt(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):g.kind==="composite"&&(x=[128*d.compositeTextSizes[0].evaluate(s,{},y),128*d.compositeTextSizes[1].evaluate(s,{},y)],(x[0]>32640||x[1]>32640)&&Mt(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,m,x,o,a,s,c,e,u.lineStartIndex,u.lineLength,f,y,l);for(let v of h)p[v]=t.text.placedSymbolArray.length-1;return m.length*4}function Y1(t){for(let e in t)return t[e];return null}function u5(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g,x,v,b,w,_,D,A,E,O){let k=t.addToLineVertexArray(e,r),B=o.layout.get("symbol-height-offset").evaluate(b,{},D);B>t.maxHeightOffset&&(t.maxHeightOffset=B);let R,I,C,L,$=0,X=0,at=0,ft=0,ut=-1,ct=-1,_t={},Jt=(0,ja.default)("");if(t.allowVerticalPlacement&&i.vertical){let U=o.layout.get("text-rotate").evaluate(b,{},D)+90;C=new _a(l,e,u,c,h,i.vertical,p,f,d,U),s&&(L=new _a(l,e,u,c,h,s,m,g,d,U))}if(n){let U=o.layout.get("icon-rotate").evaluate(b,{}),st=o.layout.get("icon-text-fit")!=="none",lt=Gp(n,U,_,st,E),it=s?Gp(s,U,_,st,E):void 0;I=new _a(l,e,u,c,h,n,m,g,!1,U),$=lt.length*4;let St=t.iconSizeData,Qt=null;St.kind==="source"?(Qt=[128*o.layout.get("icon-size").evaluate(b,{})],Qt[0]>32640&&Mt(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):St.kind==="composite"&&(Qt=[128*w.compositeIconSizes[0].evaluate(b,{},D),128*w.compositeIconSizes[1].evaluate(b,{},D)],(Qt[0]>32640||Qt[1]>32640)&&Mt(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),t.addSymbols(t.icon,lt,Qt,v,x,b,0,e,k.lineStartIndex,k.lineLength,-1,D,B),ut=t.icon.placedSymbolArray.length-1,it&&(X=it.length*4,t.addSymbols(t.icon,it,Qt,v,x,b,2,e,k.lineStartIndex,k.lineLength,-1,D,B),ct=t.icon.placedSymbolArray.length-1)}let ge=Object.keys(i.horizontal);for(let U of ge){let st=i.horizontal[U];R||=(Jt=(0,ja.default)(st.text),new _a(l,e,u,c,h,st,p,f,d,o.layout.get("text-rotate").evaluate(b,{},D)));let lt=st.positionedLines.length===1;if(at+=Wp(t,e,st,a,o,d,b,y,B,k,i.vertical?1:3,lt?ge:[U],_t,ut,w,D),lt)break}i.vertical&&(ft+=Wp(t,e,i.vertical,a,o,d,b,y,B,k,2,["vertical"],_t,ct,w,D));let se=R?R.boxStartIndex:t.collisionBoxArray.length,Je=R?R.boxEndIndex:t.collisionBoxArray.length,Qe=C?C.boxStartIndex:t.collisionBoxArray.length,Ur=C?C.boxEndIndex:t.collisionBoxArray.length,tr=I?I.boxStartIndex:t.collisionBoxArray.length,xe=I?I.boxEndIndex:t.collisionBoxArray.length,qr=L?L.boxStartIndex:t.collisionBoxArray.length,j=L?L.boxEndIndex:t.collisionBoxArray.length,J=-1,rt=(U,st)=>U?.circleDiameter?Math.max(U.circleDiameter,st):st;J=rt(R,J),J=rt(C,J),J=rt(I,J),J=rt(L,J);let z=+(J>-1);z&&(J*=A/24),t.glyphOffsetArray.length>=t.maxGlyphs&&Mt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),b.sortKey!==void 0&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey);let ht=X1(o,b,D),[Y,Z]=l5(t.textAnchorOffsets,ht);O&&(Jt=h5(Jt,b)),t.symbolInstances.emplaceBack(e.x,e.y,_t.right>=0?_t.right:-1,_t.center>=0?_t.center:-1,_t.left>=0?_t.left:-1,_t.vertical||-1,ut,ct,Jt,se,Je,Qe,Ur,tr,xe,qr,j,u,at,ft,$,X,z,0,p,J,Y,Z,B)}function c5(t,e,r,i){let n=t.compareText;if(!(e in n))n[e]=[];else{let a=n[e];for(let s=a.length-1;s>=0;s--)if(i.dist(a[s])<r)return!0}return n[e].push(i),!1}function h5(t,e){return e.id==null||e.properties?.cluster?t:(0,ja.default)(String(e.id),t)}function Zp(t,e,r){let i="never",n=t.get(e);return n?i=n:t.get(r)&&(i="always"),i}var p5=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Da(t,e,r,i,n,a,s,o,l,u,c,h,p,f){let d=o?Math.min(Np,Math.round(o[0])):0,y=o?Math.min(Np,Math.round(o[1])):0;t.emplaceBack(e,r,Math.round(i*32),Math.round(n*32),a,s,(d<<1)+ +!!l,y,u*16,c*16,h*256,p*256,f)}function f5(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function d5(t){for(let e of t.sections)if(w1(e.text))return!0;return!1}function y5(t){return t.sections.some(e=>!x1(e.text))}var ql=class{constructor(t){this.layoutVertexArray=new n2,this.indexArray=new Vn,this.programConfigurations=t,this.segments=new ae,this.dynamicLayoutVertexArray=new a2,this.opacityVertexArray=new s2,this.hasVisibleVertices=!1,this.placedSymbolArray=new iy}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,e,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,mw.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,gw.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,p5,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};P("SymbolBuffers",ql);var Gl=class{constructor(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new ae,this.collisionVertexArray=new o2}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,xw.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};P("CollisionBuffers",Gl);var W1=class{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(s=>s.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.hasCursiveText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=jp(this.zoom,e["text-size"]),this.iconSizeData=jp(this.zoom,e["icon-size"]);let r=this.layers[0].layout,i=r.get("symbol-sort-key"),n=r.get("symbol-z-order");this.canOverlap=Zp(r,"text-overlap","text-allow-overlap")!=="never"||Zp(r,"icon-overlap","icon-allow-overlap")!=="never"||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=n!=="viewport-y"&&!i.isConstant();let a=n==="viewport-y"||n==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map(s=>C1[s])),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.sourceID=t.sourceID}createArrays(){this.text=new ql(new zr(this.layers,this.zoom,t=>t.startsWith("text"))),this.icon=new ql(new zr(this.layers,this.zoom,t=>t.startsWith("icon"))),this.glyphOffsetArray=new sy,this.lineVertexArray=new oy,this.symbolInstances=new ay,this.textAnchorOffsets=new uy}calculateGlyphDependencies(t,e,r,i){let n=Hu.fromFeature(t,r,!1),a=n.graphemes();for(let s=0;s<a.length;s++){let o=n.getSection(s);if("imageName"in o)continue;e[o.fontStack]||={default:{},vertical:{}};let l=e[o.fontStack],u=a[s],c=i&&z3(u.codePointAt(0),this.allowVerticalPlacement);Rl(u)&&(l.default[u]=!0),c&&(l.vertical[u]=!0);for(let h of u){if(l.default[h]=!0,!i)continue;c&&Rl(u)&&(l.vertical[h]=!0);let p=ni[h];p&&(l.default[p]=!0)}}}populate(t,e,r){let i=this.layers[0],n=i.layout,a=n.get("text-font"),s=n.get("text-field"),o=n.get("icon-image"),l=(s.value.kind!=="constant"||s.value.value instanceof Ze&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&(a.value.kind!=="constant"||a.value.value.length>0),u=o.value.kind!=="constant"||!!o.value.value||Object.keys(o.parameters).length>0,c=n.get("symbol-sort-key"),h=n.get("symbol-placement")==="point";if(this.features=[],!l&&!u)return;let p=e.iconDependencies,f=e.glyphDependencies,d=e.availableImages,y=new ot(this.zoom),m=n.get("text-keep-upright");for(let{feature:g,id:x,index:v,sourceLayerIndex:b}of t){let w=i._featureFilter.needGeometry,_=Fi(g,w);if(!i._featureFilter.filter(y,_,r)||(w||(_.geometry=Rr(g)),h&&g.type===1&&m5(_.geometry)))continue;let D;if(l){let k=i.getValueAndResolveTokens("text-field",_,r,d),B=Ze.factory(k);this.hasRTLText||=d5(B),this.hasCursiveText||=y5(B),D=Nw(B,i,_)}let A;if(u){let k=i.getValueAndResolveTokens("icon-image",_,r,d);A=k instanceof Oe?k:Oe.fromString(k)}if(!D&&!A)continue;let E=this.sortFeaturesByKey?c.evaluate(_,{},r):void 0,O={id:x,text:D,icon:A,index:v,sourceLayerIndex:b,geometry:_.geometry,properties:g.properties,type:Rn.types[g.type],sortKey:E};if(this.features.push(O),A&&(p[A.name]=!0),D){let k=a.evaluate(_,{},r).join(","),B=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes?.includes(2);let R=(B&&m||this.allowVerticalPlacement)&&$l(D.toString());this.calculateGlyphDependencies(D,f,k,R);for(let I of D.sections)I.image&&(p[I.image.name]=!0)}}n.get("symbol-placement")==="line"&&(this.features=Uw(this.features)),this.sortFeaturesByKey&&this.features.sort((g,x)=>g.sortKey-x.sortKey)}update(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}))}addFeatures({options:t,canonical:e,glyphMap:r,glyphPositions:i,iconMap:n,iconPositions:a,showCollisionBoxes:s}){s5({bucket:this,glyphMap:r,glyphPositions:i,imageMap:n,imagePositions:a,showCollisionBoxes:s,canonical:e,subdivisionGranularity:t.subdivisionGranularity,hasPromoteId:t.featureIndex.promoteId!=null})}isEmpty(){return this.symbolInstances.length===0}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){let r=this.lineVertexArray.length;if(t.segment!==void 0){let i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),a={};for(let s=t.segment+1;s<e.length;s++)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s<e.length-1&&(i+=e[s+1].dist(e[s]));for(let s=t.segment||0;s>=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=e[s-1].dist(e[s]));for(let s=0;s<e.length;s++){let o=a[s];this.lineVertexArray.emplaceBack(o.x,o.y,o.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(t,e,r,i,n,a,s,o,l,u,c,h,p){let f=t.indexArray,d=t.layoutVertexArray,y=t.segments.prepareSegment(4*e.length,d,f,this.canOverlap?a.sortKey:void 0),m=this.glyphOffsetArray.length,g=y.vertexLength,x=this.allowVerticalPlacement&&s===2?Math.PI/2:0,v=a.text&&a.text.sections;for(let b=0;b<e.length;b++){let{tl:w,tr:_,bl:D,br:A,tex:E,pixelOffsetTL:O,pixelOffsetBR:k,minFontScaleX:B,minFontScaleY:R,glyphOffset:I,isSDF:C,sectionIndex:L}=e[b],$=y.vertexLength,X=I[1];Da(d,o.x,o.y,w.x,X+w.y,E.x,E.y,r,C,O.x,O.y,B,R,p),Da(d,o.x,o.y,_.x,X+_.y,E.x+E.w,E.y,r,C,k.x,O.y,B,R,p),Da(d,o.x,o.y,D.x,X+D.y,E.x,E.y+E.h,r,C,O.x,k.y,B,R,p),Da(d,o.x,o.y,A.x,X+A.y,E.x+E.w,E.y+E.h,r,C,k.x,k.y,B,R,p),f5(t.dynamicLayoutVertexArray,o,x),f.emplaceBack($,$+2,$+1),f.emplaceBack($+1,$+2,$+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(I[0]),(b===e.length-1||L!==e[b+1].sectionIndex)&&t.programConfigurations.populatePaintArrays(d.length,a,a.index,{imagePositions:{},canonical:h,formattedSection:v?.[L]})}t.placedSymbolArray.emplaceBack(o.x,o.y,m,this.glyphOffsetArray.length-m,g,l,u,o.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],s,0,!1,0,c,p)}_addCollisionDebugVertex(t,e,r,i,n,a){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,i,n,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(t,e,r,i,n,a,s){let o=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),l=o.vertexLength,u=n.layoutVertexArray,c=n.collisionVertexArray,h=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,c,a,h,p,new F(t,e)),this._addCollisionDebugVertex(u,c,a,h,p,new F(r,e)),this._addCollisionDebugVertex(u,c,a,h,p,new F(r,i)),this._addCollisionDebugVertex(u,c,a,h,p,new F(t,i)),o.vertexLength+=4;let f=n.indexArray;f.emplaceBack(l,l+1),f.emplaceBack(l+1,l+2),f.emplaceBack(l+2,l+3),f.emplaceBack(l+3,l),o.primitiveLength+=4}addDebugCollisionBoxes(t,e,r,i){for(let n=t;n<e;n++){let a=this.collisionBoxArray.get(n),s=a.x1,o=a.y1,l=a.x2,u=a.y2;this.addCollisionDebugVertices(s,o,l,u,i?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Gl(Ih,Sp.members,ul),this.iconCollisionBox=new Gl(Ih,Sp.members,ul);for(let t=0;t<this.symbolInstances.length;t++){let e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}}_deserializeCollisionBoxesForSymbol(t,e,r,i,n,a,s,o,l){let u={};for(let c=e;c<r;c++){let h=t.get(c);u.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.textFeatureIndex=h.featureIndex;break}for(let c=i;c<n;c++){let h=t.get(c);u.verticalTextBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.verticalTextFeatureIndex=h.featureIndex;break}for(let c=a;c<s;c++){let h=t.get(c);u.iconBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.iconFeatureIndex=h.featureIndex;break}for(let c=o;c<l;c++){let h=t.get(c);u.verticalIconBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.verticalIconFeatureIndex=h.featureIndex;break}return u}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){let r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,e){let r=t.placedSymbolArray.get(e),i=r.vertexStartIndex+r.numGlyphs*4;for(let n=r.vertexStartIndex;n<i;n+=4)t.indexArray.emplaceBack(n,n+2,n+1),t.indexArray.emplaceBack(n+1,n+2,n+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let e=Math.sin(t),r=Math.cos(t),i=[],n=[],a=[];for(let s=0;s<this.symbolInstances.length;++s){a.push(s);let o=this.symbolInstances.get(s);i.push(Math.round(e*o.anchorX+r*o.anchorY)|0),n.push(o.featureIndex)}return a.sort((s,o)=>i[s]-i[o]||n[o]-n[s]),a}addToSortKeyRanges(t,e){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];r?.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let r=this.symbolInstances.get(e);this.featureSortOrder.push(r.featureIndex);let i=[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex];for(let n=0;n<i.length;n++){let a=i[n];a>=0&&i.indexOf(a)===n&&this.addIndicesForPlacedSymbol(this.text,a)}r.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,r.verticalPlacedTextSymbolIndex),r.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.placedIconSymbolIndex),r.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};function m5(t){return t.every(e=>e.every(Pu))}P("SymbolBucket",W1,{omit:["layers","collisionBoxArray","features","compareText"]});function g5(t,e){return e.replace(/{([^{}]+)}/g,(r,i)=>t&&i in t?String(t[i]):"")}var x5,v5=()=>x5||=new Wt({"symbol-placement":new V(S.layout_symbol["symbol-placement"],"symbol-placement"),"symbol-spacing":new V(S.layout_symbol["symbol-spacing"],"symbol-spacing"),"symbol-avoid-edges":new V(S.layout_symbol["symbol-avoid-edges"],"symbol-avoid-edges"),"symbol-sort-key":new N(S.layout_symbol["symbol-sort-key"],"symbol-sort-key"),"symbol-z-order":new V(S.layout_symbol["symbol-z-order"],"symbol-z-order"),"icon-allow-overlap":new V(S.layout_symbol["icon-allow-overlap"],"icon-allow-overlap"),"icon-overlap":new V(S.layout_symbol["icon-overlap"],"icon-overlap"),"icon-ignore-placement":new V(S.layout_symbol["icon-ignore-placement"],"icon-ignore-placement"),"icon-optional":new V(S.layout_symbol["icon-optional"],"icon-optional"),"icon-rotation-alignment":new N(S.layout_symbol["icon-rotation-alignment"],"icon-rotation-alignment"),"icon-size":new N(S.layout_symbol["icon-size"],"icon-size"),"icon-text-fit":new V(S.layout_symbol["icon-text-fit"],"icon-text-fit"),"icon-text-fit-padding":new V(S.layout_symbol["icon-text-fit-padding"],"icon-text-fit-padding"),"icon-image":new N(S.layout_symbol["icon-image"],"icon-image"),"icon-rotate":new N(S.layout_symbol["icon-rotate"],"icon-rotate"),"icon-padding":new N(S.layout_symbol["icon-padding"],"icon-padding"),"icon-keep-upright":new V(S.layout_symbol["icon-keep-upright"],"icon-keep-upright"),"icon-offset":new N(S.layout_symbol["icon-offset"],"icon-offset"),"icon-anchor":new N(S.layout_symbol["icon-anchor"],"icon-anchor"),"icon-pitch-alignment":new V(S.layout_symbol["icon-pitch-alignment"],"icon-pitch-alignment"),"text-pitch-alignment":new V(S.layout_symbol["text-pitch-alignment"],"text-pitch-alignment"),"text-rotation-alignment":new V(S.layout_symbol["text-rotation-alignment"],"text-rotation-alignment"),"text-field":new N(S.layout_symbol["text-field"],"text-field"),"text-font":new N(S.layout_symbol["text-font"],"text-font"),"text-size":new N(S.layout_symbol["text-size"],"text-size"),"text-max-width":new N(S.layout_symbol["text-max-width"],"text-max-width"),"text-line-height":new V(S.layout_symbol["text-line-height"],"text-line-height"),"text-letter-spacing":new N(S.layout_symbol["text-letter-spacing"],"text-letter-spacing"),"text-justify":new N(S.layout_symbol["text-justify"],"text-justify"),"text-radial-offset":new N(S.layout_symbol["text-radial-offset"],"text-radial-offset"),"text-variable-anchor":new V(S.layout_symbol["text-variable-anchor"],"text-variable-anchor"),"text-variable-anchor-offset":new N(S.layout_symbol["text-variable-anchor-offset"],"text-variable-anchor-offset"),"text-anchor":new N(S.layout_symbol["text-anchor"],"text-anchor"),"text-max-angle":new V(S.layout_symbol["text-max-angle"],"text-max-angle"),"text-writing-mode":new V(S.layout_symbol["text-writing-mode"],"text-writing-mode"),"text-rotate":new N(S.layout_symbol["text-rotate"],"text-rotate"),"text-padding":new V(S.layout_symbol["text-padding"],"text-padding"),"text-keep-upright":new V(S.layout_symbol["text-keep-upright"],"text-keep-upright"),"text-transform":new N(S.layout_symbol["text-transform"],"text-transform"),"text-offset":new N(S.layout_symbol["text-offset"],"text-offset"),"text-allow-overlap":new V(S.layout_symbol["text-allow-overlap"],"text-allow-overlap"),"text-overlap":new V(S.layout_symbol["text-overlap"],"text-overlap"),"text-ignore-placement":new V(S.layout_symbol["text-ignore-placement"],"text-ignore-placement"),"text-optional":new V(S.layout_symbol["text-optional"],"text-optional"),"symbol-height-offset":new N(S.layout_symbol["symbol-height-offset"],"symbol-height-offset"),"symbol-height-anchor":new V(S.layout_symbol["symbol-height-anchor"],"symbol-height-anchor")}),b5,w5=()=>b5||=new Wt({"icon-opacity":new N(S.paint_symbol["icon-opacity"],"icon-opacity"),"icon-color":new N(S.paint_symbol["icon-color"],"icon-color"),"icon-halo-color":new N(S.paint_symbol["icon-halo-color"],"icon-halo-color"),"icon-halo-width":new N(S.paint_symbol["icon-halo-width"],"icon-halo-width"),"icon-halo-blur":new N(S.paint_symbol["icon-halo-blur"],"icon-halo-blur"),"icon-translate":new V(S.paint_symbol["icon-translate"],"icon-translate"),"icon-translate-anchor":new V(S.paint_symbol["icon-translate-anchor"],"icon-translate-anchor"),"text-opacity":new N(S.paint_symbol["text-opacity"],"text-opacity"),"text-color":new N(S.paint_symbol["text-color"],"text-color",{runtimeType:Ae,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new N(S.paint_symbol["text-halo-color"],"text-halo-color"),"text-halo-width":new N(S.paint_symbol["text-halo-width"],"text-halo-width"),"text-halo-blur":new N(S.paint_symbol["text-halo-blur"],"text-halo-blur"),"text-translate":new V(S.paint_symbol["text-translate"],"text-translate"),"text-translate-anchor":new V(S.paint_symbol["text-translate-anchor"],"text-translate-anchor")}),bo={get paint(){return w5()},get layout(){return v5()}},Z1=class{constructor(t){if(t.property.overrides===void 0)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:kn,this.defaultValue=t}evaluate(t){if(t.formattedSection){let e=this.defaultValue.property.overrides;if(e?.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}};P("FormatSectionOverride",Z1,{omit:["defaultValue"]});var _5=class Xl extends Te{constructor(e,r){super(e,bo,r)}recalculate(e,r){super.recalculate(e,r);let i=this.layout.get("icon-rotation-alignment");if((i.value.kind!=="constant"||i.value.value==="auto")&&(this.layout._values["icon-rotation-alignment"]=new de(i.property,{kind:"constant",value:this.layout.get("symbol-placement")==="point"?"viewport":"map"},i.parameters)),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")==="point"?this.layout._values["text-rotation-alignment"]="viewport":this.layout._values["text-rotation-alignment"]="map"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment").constantOr("viewport")),this.layout.get("symbol-placement")==="point"){let n=this.layout.get("text-writing-mode");if(n){let a=[];for(let s of n)a.includes(s)||a.push(s);this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,i,n){let a=this.layout.get(e).evaluate(r,{},i,n),s=this._unevaluatedLayout._values[e];return!s.isDataDriven()&&!cs(s.value)&&a?g5(r.properties,a):a}createBucket(e){return new W1(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of bo.paint.overridableProperties){if(!Xl.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),i=new Du(new Z1(r),`layers[${this.id}].paint.${r.property.name}`,r.property.specification),n=null;n=r.value.kind==="constant"||r.value.kind==="source"?new mn("source",i):new Ra("composite",i,r.value.zoomStops),this.paint._values[e]=new de(r.property,n,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,i){return!this.layout||r.isDataDriven()||i.isDataDriven()?!1:Xl.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let i=e.get("text-field"),n=bo.paint.properties[r],a=!1,s=o=>{for(let l of o)if(n.overrides?.hasOverride(l)){a=!0;return}};if(i.value.kind==="constant"&&i.value.value instanceof Ze)s(i.value.value.sections);else if(i.value.kind==="source"||i.value.kind==="composite"){let o=u=>{if(!a)if(u instanceof gi&&Ft(u.value)===Mn){let c=u.value;s(c.sections)}else u instanceof sd?s(u.sections):u.eachChild(o)},l=i.value;l._styleExpression&&o(l._styleExpression.expression)}return a}};function D5(t,e,r,i=1){let n=t.get("icon-padding").evaluate(e,{},r)?.values;return[n[0]*i,n[1]*i,n[2]*i,n[3]*i]}var S5,A5=()=>S5||=new Wt({"background-color":new V(S.paint_background["background-color"],"background-color"),"background-pattern":new Qd(S.paint_background["background-pattern"],"background-pattern"),"background-opacity":new V(S.paint_background["background-opacity"],"background-opacity")}),E5={get paint(){return A5()}},T5=class extends Te{constructor(t,e){super(t,E5,e)}},F5,C5=()=>F5||=new Wt({"raster-opacity":new V(S.paint_raster["raster-opacity"],"raster-opacity"),"raster-layer-blend":new V(S.paint_raster["raster-layer-blend"],"raster-layer-blend"),"raster-hue-rotate":new V(S.paint_raster["raster-hue-rotate"],"raster-hue-rotate"),"raster-brightness-min":new V(S.paint_raster["raster-brightness-min"],"raster-brightness-min"),"raster-brightness-max":new V(S.paint_raster["raster-brightness-max"],"raster-brightness-max"),"raster-saturation":new V(S.paint_raster["raster-saturation"],"raster-saturation"),"raster-contrast":new V(S.paint_raster["raster-contrast"],"raster-contrast"),resampling:new V(S.paint_raster.resampling,"resampling"),"raster-resampling":new V(S.paint_raster["raster-resampling"],"raster-resampling"),"raster-fade-duration":new V(S.paint_raster["raster-fade-duration"],"raster-fade-duration")}),I5={get paint(){return C5()}},k5=class extends Te{constructor(t,e){super(t,I5,e)}},M5=class extends Te{constructor(t,e){super(t,{},e),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}};function P5(t,e){if(t.type==="custom")return new M5(t,e);switch(t.type){case"background":return new T5(t,e);case"circle":return new uv(t,e);case"color-relief":return new _v(t,e);case"fill":return new rb(t,e);case"fill-extrusion":return new wb(t,e);case"heatmap":return new dv(t,e);case"hillshade":return new xv(t,e);case"line":return new yw(t,e);case"raster":return new k5(t,e);case"symbol":return new _5(t,e)}}var B5=class{constructor(t,e){this.feature=t,this.type=t.type,this.properties=t.tags?t.tags:{},this.extent=e,"id"in t&&(typeof t.id=="string"?this.id=parseInt(t.id,10):typeof t.id=="number"&&!isNaN(t.id)&&(this.id=t.id))}loadGeometry(){let t=[],e=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(let r of e){let i=[];for(let n of r)i.push(new F(n[0],n[1]));t.push(i)}return t}},Yl="_geojsonTileLayer",z5=class{constructor(t,e){this.layers={[Yl]:this},this.name=Yl,this.version=e?e.version:1,this.extent=e?e.extent:4096,this.length=t.length,this.features=t}feature(t){return new B5(this.features[t],this.extent)}};function H1(t,e=""){let r=new u3;return L5(t,r,e),r.finish()}function L5(t,e,r=""){for(let i in t.layers)e.writeMessage(3,(n,a)=>O5(n,a,r),t.layers[i])}function O5(t,e,r=""){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);let i={jsonPrefix:r,keys:[],values:[],keycache:{},valuecache:{}};for(let s=0;s<t.length;s++)i.feature=t.feature(s),e.writeMessage(2,V5,i);let n=i.keys;for(let s of n)e.writeStringField(3,s);let a=i.values;for(let s of a)e.writeMessage(4,N5,s)}function V5(t,e){if(!t.feature)return;let r=t.feature;r.id!==void 0&&e.writeVarintField(1,r.id),e.writeMessage(2,R5,t),e.writeVarintField(3,r.type),e.writeMessage(4,$5,r)}function R5(t,e){for(let r in t.feature?.properties){let i=t.feature.properties[r],n=t.keycache[r];if(i==null)continue;n===void 0&&(t.keys.push(r),n=t.keys.length-1,t.keycache[r]=n),e.writeVarint(n),typeof i!="string"&&typeof i!="boolean"&&typeof i!="number"&&(i=t.jsonPrefix+JSON.stringify(i));let a=typeof i+":"+i,s=t.valuecache[a];s===void 0&&(t.values.push(i),s=t.values.length-1,t.valuecache[a]=s),e.writeVarint(s)}}function wo(t,e){return(e<<3)+(t&7)}function Hp(t){return t<<1^t>>31}function $5(t,e){let r=t.loadGeometry(),i=t.type,n=0,a=0;for(let s of r){let o=1;i===1&&(o=s.length),e.writeVarint(wo(1,o));let l=s[s.length-1],u=i===3&&s.length>1&&l.x===s[0].x&&l.y===s[0].y?s.length-1:s.length;for(let c=0;c<u;c++){c===1&&i!==1&&e.writeVarint(wo(2,u-1));let h=s[c].x-n,p=s[c].y-a;e.writeVarint(Hp(h)),e.writeVarint(Hp(p)),n+=h,a+=p}t.type===3&&e.writeVarint(wo(7,1))}}function N5(t,e){let r=typeof t;r==="string"?e.writeStringField(1,t):r==="boolean"?e.writeBooleanField(7,t):r==="number"&&(t%1==0?t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t):e.writeDoubleField(3,t))}var K1=class{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){let r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}},j5=class Wl{static{this.worldCoordinateHelpers=new WeakMap}constructor(e,r,i,n,a,s){this.type="Feature",this._vectorTileFeature=e,this._x=i,this._y=n,this._z=r,s!==A2&&Wl.worldCoordinateHelpers.set(this,s);for(let o in e.properties)typeof e.properties[o]=="string"&&e.properties[o].startsWith("__$json__:")&&(e.properties[o]=JSON.parse(e.properties[o].slice(10)));this.properties=e.properties,this.id=a}projectPoint(e,r,i,n,a){if(a){let s=a.lngLatFromWorld((e.x+r)/n,(e.y+i)/n);return[s.lng,s.lat]}return[(e.x+r)*360/n-180,360/Math.PI*Math.atan(Math.exp((1-(e.y+i)*2/n)*Math.PI))-90]}projectLine(e,r,i,n,a){return e.map(s=>this.projectPoint(s,r,i,n,a))}get geometry(){if(this._geometry)return this._geometry;let e=this._vectorTileFeature,r=Wl.worldCoordinateHelpers.get(this),i=e.extent*2**this._z,n=e.extent*this._x,a=e.extent*this._y,s=e.loadGeometry();switch(e.type){case 1:{let o=[];for(let u of s)o.push(u[0]);let l=this.projectLine(o,n,a,i,r);this._geometry=o.length===1?{type:"Point",coordinates:l[0]}:{type:"MultiPoint",coordinates:l};break}case 2:{let o=s.map(l=>this.projectLine(l,n,a,i,r));this._geometry=o.length===1?{type:"LineString",coordinates:o[0]}:{type:"MultiLineString",coordinates:o};break}case 3:{let o=Qy(s),l=[];for(let u of o)l.push(u.map(c=>this.projectLine(c,n,a,i,r)));this._geometry=l.length===1?{type:"Polygon",coordinates:l[0]}:{type:"MultiPolygon",coordinates:l};break}default:throw Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&r!=="_x"&&r!=="_y"&&r!=="_z"&&(e[r]=this[r]);return e}},$r=class{constructor(t,e,r){this._name=t,this.dataBuffer=e,typeof r=="number"?this._size=r:(this.nullabilityBuffer=r,this._size=r.size())}getValue(t){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(t)?null:this.getValueFromBuffer(t)}has(t){return this.nullabilityBuffer?.get(t)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},ws=class extends $r{},Qu=class extends ws{getValueFromBuffer(t){return this.dataBuffer[t]}},tc=class extends ws{getValueFromBuffer(t){return this.dataBuffer[t]}},J1=class extends $r{constructor(t,e,r,i){super(t,e,i),this.delta=r}},ec=class extends J1{constructor(t,e,r,i,n){super(t,n?Int32Array.of(e):Uint32Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+t*this.delta}},rc=class extends $r{constructor(t,e,r,i){super(t,i?Int32Array.of(e):Uint32Array.of(e),r)}getValueFromBuffer(t){return this.dataBuffer[0]}},U5=class{constructor(t,e,r,i,n=4096){if(this._name=t,this._geometryVector=e,this._idVector=r,this._propertyVectors=i,this._extent=n,t.length===0)throw Error("Missing layer name")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors??[]}getPropertyVector(t){return this.propertyVectorsMap||=new Map(this.propertyVectors.map(e=>[e.name,e])),this.propertyVectorsMap.get(t)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let t=[],e=this.geometryVector.getGeometries();for(let r=0;r<this.numFeatures;r++){let i;if(this.idVector){let s=this.idVector.getValue(r);s!==null&&(i=this.containsMaxSafeIntegerValues(this.idVector)?Number(s):s)}let n={coordinates:e[r],type:this.geometryVector.geometryType(r)},a={};for(let s of this.propertyVectors){if(!s)continue;let o=s.name,l=s.getValue(r);l!==null&&(a[o]=l)}t.push({id:i,geometry:n,properties:a})}return t}containsMaxSafeIntegerValues(t){return t instanceof Qu||t instanceof rc||t instanceof ec||t instanceof tc}},rn={FEATURE:0,VERTEX:1},nt={BOOLEAN:0,INT_8:1,UINT_8:2,INT_32:3,UINT_32:4,INT_64:5,UINT_64:6,FLOAT:7,DOUBLE:8,STRING:9},mr={GEOMETRY:0,STRUCT:1,MAP:2},Q1={ID:0},t0=class{constructor(t){this.value=t}get(){return this.value}set(t){this.value=t}increment(){return this.value++}add(t){this.value+=t}},K;(function(t){t.NONE="NONE",t.DELTA="DELTA",t.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",t.RLE="RLE",t.MORTON="MORTON"})(K||={});var ye;(function(t){t.NONE="NONE",t.FAST_PFOR="FAST_PFOR",t.VARINT="VARINT"})(ye||={});var ic=new Uint32Array(33);ic[0]=0;for(let t=1;t<=32;t++)ic[t]=t===32?4294967295:4294967295>>>32-t;var Zl=ic,nc=65536;function ac(t,e){return t-t%e}function q5(t){return ac(t+31,32)}function e0(t){if(!Number.isFinite(t)||t<=0)return nc;let e=ac(Math.floor(t),256);return e===0?256:e}function G5(t){let e=t>>>0;return((e&255)<<24|(e&65280)<<8|e>>>8&65280|e>>>24&255)>>>0}function X5(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0;r[n++]=a>>>0&3,r[n++]=a>>>2&3,r[n++]=a>>>4&3,r[n++]=a>>>6&3,r[n++]=a>>>8&3,r[n++]=a>>>10&3,r[n++]=a>>>12&3,r[n++]=a>>>14&3,r[n++]=a>>>16&3,r[n++]=a>>>18&3,r[n++]=a>>>20&3,r[n++]=a>>>22&3,r[n++]=a>>>24&3,r[n++]=a>>>26&3,r[n++]=a>>>28&3,r[n++]=a>>>30&3,r[n++]=s>>>0&3,r[n++]=s>>>2&3,r[n++]=s>>>4&3,r[n++]=s>>>6&3,r[n++]=s>>>8&3,r[n++]=s>>>10&3,r[n++]=s>>>12&3,r[n++]=s>>>14&3,r[n++]=s>>>16&3,r[n++]=s>>>18&3,r[n++]=s>>>20&3,r[n++]=s>>>22&3,r[n++]=s>>>24&3,r[n++]=s>>>26&3,r[n++]=s>>>28&3,r[n]=s>>>30&3}function Y5(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0;r[n++]=a>>>0&7,r[n++]=a>>>3&7,r[n++]=a>>>6&7,r[n++]=a>>>9&7,r[n++]=a>>>12&7,r[n++]=a>>>15&7,r[n++]=a>>>18&7,r[n++]=a>>>21&7,r[n++]=a>>>24&7,r[n++]=a>>>27&7,r[n++]=(a>>>30|(s&1)<<2)&7,r[n++]=s>>>1&7,r[n++]=s>>>4&7,r[n++]=s>>>7&7,r[n++]=s>>>10&7,r[n++]=s>>>13&7,r[n++]=s>>>16&7,r[n++]=s>>>19&7,r[n++]=s>>>22&7,r[n++]=s>>>25&7,r[n++]=s>>>28&7,r[n++]=(s>>>31|(o&3)<<1)&7,r[n++]=o>>>2&7,r[n++]=o>>>5&7,r[n++]=o>>>8&7,r[n++]=o>>>11&7,r[n++]=o>>>14&7,r[n++]=o>>>17&7,r[n++]=o>>>20&7,r[n++]=o>>>23&7,r[n++]=o>>>26&7,r[n]=o>>>29&7}function W5(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0;r[n++]=a>>>0&15,r[n++]=a>>>4&15,r[n++]=a>>>8&15,r[n++]=a>>>12&15,r[n++]=a>>>16&15,r[n++]=a>>>20&15,r[n++]=a>>>24&15,r[n++]=a>>>28&15,r[n++]=s>>>0&15,r[n++]=s>>>4&15,r[n++]=s>>>8&15,r[n++]=s>>>12&15,r[n++]=s>>>16&15,r[n++]=s>>>20&15,r[n++]=s>>>24&15,r[n++]=s>>>28&15,r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n]=l>>>28&15}function Z5(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0;r[n++]=a>>>0&31,r[n++]=a>>>5&31,r[n++]=a>>>10&31,r[n++]=a>>>15&31,r[n++]=a>>>20&31,r[n++]=a>>>25&31,r[n++]=(a>>>30|(s&7)<<2)&31,r[n++]=s>>>3&31,r[n++]=s>>>8&31,r[n++]=s>>>13&31,r[n++]=s>>>18&31,r[n++]=s>>>23&31,r[n++]=(s>>>28|(o&1)<<4)&31,r[n++]=o>>>1&31,r[n++]=o>>>6&31,r[n++]=o>>>11&31,r[n++]=o>>>16&31,r[n++]=o>>>21&31,r[n++]=o>>>26&31,r[n++]=(o>>>31|(l&15)<<1)&31,r[n++]=l>>>4&31,r[n++]=l>>>9&31,r[n++]=l>>>14&31,r[n++]=l>>>19&31,r[n++]=l>>>24&31,r[n++]=(l>>>29|(u&3)<<3)&31,r[n++]=u>>>2&31,r[n++]=u>>>7&31,r[n++]=u>>>12&31,r[n++]=u>>>17&31,r[n++]=u>>>22&31,r[n]=u>>>27&31}function H5(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0;r[n++]=a>>>0&63,r[n++]=a>>>6&63,r[n++]=a>>>12&63,r[n++]=a>>>18&63,r[n++]=a>>>24&63,r[n++]=(a>>>30|(s&15)<<2)&63,r[n++]=s>>>4&63,r[n++]=s>>>10&63,r[n++]=s>>>16&63,r[n++]=s>>>22&63,r[n++]=(s>>>28|(o&3)<<4)&63,r[n++]=o>>>2&63,r[n++]=o>>>8&63,r[n++]=o>>>14&63,r[n++]=o>>>20&63,r[n++]=o>>>26&63,r[n++]=l>>>0&63,r[n++]=l>>>6&63,r[n++]=l>>>12&63,r[n++]=l>>>18&63,r[n++]=l>>>24&63,r[n++]=(l>>>30|(u&15)<<2)&63,r[n++]=u>>>4&63,r[n++]=u>>>10&63,r[n++]=u>>>16&63,r[n++]=u>>>22&63,r[n++]=(u>>>28|(c&3)<<4)&63,r[n++]=c>>>2&63,r[n++]=c>>>8&63,r[n++]=c>>>14&63,r[n++]=c>>>20&63,r[n]=c>>>26&63}function K5(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0;r[n++]=a>>>0&127,r[n++]=a>>>7&127,r[n++]=a>>>14&127,r[n++]=a>>>21&127,r[n++]=(a>>>28|(s&7)<<4)&127,r[n++]=s>>>3&127,r[n++]=s>>>10&127,r[n++]=s>>>17&127,r[n++]=s>>>24&127,r[n++]=(s>>>31|(o&63)<<1)&127,r[n++]=o>>>6&127,r[n++]=o>>>13&127,r[n++]=o>>>20&127,r[n++]=(o>>>27|(l&3)<<5)&127,r[n++]=l>>>2&127,r[n++]=l>>>9&127,r[n++]=l>>>16&127,r[n++]=l>>>23&127,r[n++]=(l>>>30|(u&31)<<2)&127,r[n++]=u>>>5&127,r[n++]=u>>>12&127,r[n++]=u>>>19&127,r[n++]=(u>>>26|(c&1)<<6)&127,r[n++]=c>>>1&127,r[n++]=c>>>8&127,r[n++]=c>>>15&127,r[n++]=c>>>22&127,r[n++]=(c>>>29|(h&15)<<3)&127,r[n++]=h>>>4&127,r[n++]=h>>>11&127,r[n++]=h>>>18&127,r[n]=h>>>25&127}function J5(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0;r[n++]=a>>>0&255,r[n++]=a>>>8&255,r[n++]=a>>>16&255,r[n++]=a>>>24&255,r[n++]=s>>>0&255,r[n++]=s>>>8&255,r[n++]=s>>>16&255,r[n++]=s>>>24&255,r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n]=p>>>24&255}function Q5(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0;r[n++]=a>>>0&511,r[n++]=a>>>9&511,r[n++]=a>>>18&511,r[n++]=(a>>>27|(s&15)<<5)&511,r[n++]=s>>>4&511,r[n++]=s>>>13&511,r[n++]=s>>>22&511,r[n++]=(s>>>31|(o&255)<<1)&511,r[n++]=o>>>8&511,r[n++]=o>>>17&511,r[n++]=(o>>>26|(l&7)<<6)&511,r[n++]=l>>>3&511,r[n++]=l>>>12&511,r[n++]=l>>>21&511,r[n++]=(l>>>30|(u&127)<<2)&511,r[n++]=u>>>7&511,r[n++]=u>>>16&511,r[n++]=(u>>>25|(c&3)<<7)&511,r[n++]=c>>>2&511,r[n++]=c>>>11&511,r[n++]=c>>>20&511,r[n++]=(c>>>29|(h&63)<<3)&511,r[n++]=h>>>6&511,r[n++]=h>>>15&511,r[n++]=(h>>>24|(p&1)<<8)&511,r[n++]=p>>>1&511,r[n++]=p>>>10&511,r[n++]=p>>>19&511,r[n++]=(p>>>28|(f&31)<<4)&511,r[n++]=f>>>5&511,r[n++]=f>>>14&511,r[n]=f>>>23&511}function t6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0;r[n++]=a>>>0&1023,r[n++]=a>>>10&1023,r[n++]=a>>>20&1023,r[n++]=(a>>>30|(s&255)<<2)&1023,r[n++]=s>>>8&1023,r[n++]=s>>>18&1023,r[n++]=(s>>>28|(o&63)<<4)&1023,r[n++]=o>>>6&1023,r[n++]=o>>>16&1023,r[n++]=(o>>>26|(l&15)<<6)&1023,r[n++]=l>>>4&1023,r[n++]=l>>>14&1023,r[n++]=(l>>>24|(u&3)<<8)&1023,r[n++]=u>>>2&1023,r[n++]=u>>>12&1023,r[n++]=u>>>22&1023,r[n++]=c>>>0&1023,r[n++]=c>>>10&1023,r[n++]=c>>>20&1023,r[n++]=(c>>>30|(h&255)<<2)&1023,r[n++]=h>>>8&1023,r[n++]=h>>>18&1023,r[n++]=(h>>>28|(p&63)<<4)&1023,r[n++]=p>>>6&1023,r[n++]=p>>>16&1023,r[n++]=(p>>>26|(f&15)<<6)&1023,r[n++]=f>>>4&1023,r[n++]=f>>>14&1023,r[n++]=(f>>>24|(d&3)<<8)&1023,r[n++]=d>>>2&1023,r[n++]=d>>>12&1023,r[n]=d>>>22&1023}function e6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0;r[n++]=a>>>0&2047,r[n++]=a>>>11&2047,r[n++]=(a>>>22|(s&1)<<10)&2047,r[n++]=s>>>1&2047,r[n++]=s>>>12&2047,r[n++]=(s>>>23|(o&3)<<9)&2047,r[n++]=o>>>2&2047,r[n++]=o>>>13&2047,r[n++]=(o>>>24|(l&7)<<8)&2047,r[n++]=l>>>3&2047,r[n++]=l>>>14&2047,r[n++]=(l>>>25|(u&15)<<7)&2047,r[n++]=u>>>4&2047,r[n++]=u>>>15&2047,r[n++]=(u>>>26|(c&31)<<6)&2047,r[n++]=c>>>5&2047,r[n++]=c>>>16&2047,r[n++]=(c>>>27|(h&63)<<5)&2047,r[n++]=h>>>6&2047,r[n++]=h>>>17&2047,r[n++]=(h>>>28|(p&127)<<4)&2047,r[n++]=p>>>7&2047,r[n++]=p>>>18&2047,r[n++]=(p>>>29|(f&255)<<3)&2047,r[n++]=f>>>8&2047,r[n++]=f>>>19&2047,r[n++]=(f>>>30|(d&511)<<2)&2047,r[n++]=d>>>9&2047,r[n++]=d>>>20&2047,r[n++]=(d>>>31|(y&1023)<<1)&2047,r[n++]=y>>>10&2047,r[n]=y>>>21&2047}function r6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0;r[n++]=a>>>0&4095,r[n++]=a>>>12&4095,r[n++]=(a>>>24|(s&15)<<8)&4095,r[n++]=s>>>4&4095,r[n++]=s>>>16&4095,r[n++]=(s>>>28|(o&255)<<4)&4095,r[n++]=o>>>8&4095,r[n++]=o>>>20&4095,r[n++]=l>>>0&4095,r[n++]=l>>>12&4095,r[n++]=(l>>>24|(u&15)<<8)&4095,r[n++]=u>>>4&4095,r[n++]=u>>>16&4095,r[n++]=(u>>>28|(c&255)<<4)&4095,r[n++]=c>>>8&4095,r[n++]=c>>>20&4095,r[n++]=h>>>0&4095,r[n++]=h>>>12&4095,r[n++]=(h>>>24|(p&15)<<8)&4095,r[n++]=p>>>4&4095,r[n++]=p>>>16&4095,r[n++]=(p>>>28|(f&255)<<4)&4095,r[n++]=f>>>8&4095,r[n++]=f>>>20&4095,r[n++]=d>>>0&4095,r[n++]=d>>>12&4095,r[n++]=(d>>>24|(y&15)<<8)&4095,r[n++]=y>>>4&4095,r[n++]=y>>>16&4095,r[n++]=(y>>>28|(m&255)<<4)&4095,r[n++]=m>>>8&4095,r[n]=m>>>20&4095}function i6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0,g=t[e+12]>>>0,x=t[e+13]>>>0,v=t[e+14]>>>0,b=t[e+15]>>>0;r[n++]=a>>>0&65535,r[n++]=a>>>16&65535,r[n++]=s>>>0&65535,r[n++]=s>>>16&65535,r[n++]=o>>>0&65535,r[n++]=o>>>16&65535,r[n++]=l>>>0&65535,r[n++]=l>>>16&65535,r[n++]=u>>>0&65535,r[n++]=u>>>16&65535,r[n++]=c>>>0&65535,r[n++]=c>>>16&65535,r[n++]=h>>>0&65535,r[n++]=h>>>16&65535,r[n++]=p>>>0&65535,r[n++]=p>>>16&65535,r[n++]=f>>>0&65535,r[n++]=f>>>16&65535,r[n++]=d>>>0&65535,r[n++]=d>>>16&65535,r[n++]=y>>>0&65535,r[n++]=y>>>16&65535,r[n++]=m>>>0&65535,r[n++]=m>>>16&65535,r[n++]=g>>>0&65535,r[n++]=g>>>16&65535,r[n++]=x>>>0&65535,r[n++]=x>>>16&65535,r[n++]=v>>>0&65535,r[n++]=v>>>16&65535,r[n++]=b>>>0&65535,r[n]=b>>>16&65535}function n6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0;r[n++]=o>>>0&1,r[n++]=o>>>1&1,r[n++]=o>>>2&1,r[n++]=o>>>3&1,r[n++]=o>>>4&1,r[n++]=o>>>5&1,r[n++]=o>>>6&1,r[n++]=o>>>7&1,r[n++]=o>>>8&1,r[n++]=o>>>9&1,r[n++]=o>>>10&1,r[n++]=o>>>11&1,r[n++]=o>>>12&1,r[n++]=o>>>13&1,r[n++]=o>>>14&1,r[n++]=o>>>15&1,r[n++]=o>>>16&1,r[n++]=o>>>17&1,r[n++]=o>>>18&1,r[n++]=o>>>19&1,r[n++]=o>>>20&1,r[n++]=o>>>21&1,r[n++]=o>>>22&1,r[n++]=o>>>23&1,r[n++]=o>>>24&1,r[n++]=o>>>25&1,r[n++]=o>>>26&1,r[n++]=o>>>27&1,r[n++]=o>>>28&1,r[n++]=o>>>29&1,r[n++]=o>>>30&1,r[n++]=o>>>31&1}}function a6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0;r[n++]=o>>>0&3,r[n++]=o>>>2&3,r[n++]=o>>>4&3,r[n++]=o>>>6&3,r[n++]=o>>>8&3,r[n++]=o>>>10&3,r[n++]=o>>>12&3,r[n++]=o>>>14&3,r[n++]=o>>>16&3,r[n++]=o>>>18&3,r[n++]=o>>>20&3,r[n++]=o>>>22&3,r[n++]=o>>>24&3,r[n++]=o>>>26&3,r[n++]=o>>>28&3,r[n++]=o>>>30&3,r[n++]=l>>>0&3,r[n++]=l>>>2&3,r[n++]=l>>>4&3,r[n++]=l>>>6&3,r[n++]=l>>>8&3,r[n++]=l>>>10&3,r[n++]=l>>>12&3,r[n++]=l>>>14&3,r[n++]=l>>>16&3,r[n++]=l>>>18&3,r[n++]=l>>>20&3,r[n++]=l>>>22&3,r[n++]=l>>>24&3,r[n++]=l>>>26&3,r[n++]=l>>>28&3,r[n++]=l>>>30&3}}function s6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0;r[n++]=o>>>0&7,r[n++]=o>>>3&7,r[n++]=o>>>6&7,r[n++]=o>>>9&7,r[n++]=o>>>12&7,r[n++]=o>>>15&7,r[n++]=o>>>18&7,r[n++]=o>>>21&7,r[n++]=o>>>24&7,r[n++]=o>>>27&7,r[n++]=(o>>>30|(l&1)<<2)&7,r[n++]=l>>>1&7,r[n++]=l>>>4&7,r[n++]=l>>>7&7,r[n++]=l>>>10&7,r[n++]=l>>>13&7,r[n++]=l>>>16&7,r[n++]=l>>>19&7,r[n++]=l>>>22&7,r[n++]=l>>>25&7,r[n++]=l>>>28&7,r[n++]=(l>>>31|(u&3)<<1)&7,r[n++]=u>>>2&7,r[n++]=u>>>5&7,r[n++]=u>>>8&7,r[n++]=u>>>11&7,r[n++]=u>>>14&7,r[n++]=u>>>17&7,r[n++]=u>>>20&7,r[n++]=u>>>23&7,r[n++]=u>>>26&7,r[n++]=u>>>29&7}}function o6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,c=t[a++]>>>0;r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n++]=l>>>28&15,r[n++]=u>>>0&15,r[n++]=u>>>4&15,r[n++]=u>>>8&15,r[n++]=u>>>12&15,r[n++]=u>>>16&15,r[n++]=u>>>20&15,r[n++]=u>>>24&15,r[n++]=u>>>28&15,r[n++]=c>>>0&15,r[n++]=c>>>4&15,r[n++]=c>>>8&15,r[n++]=c>>>12&15,r[n++]=c>>>16&15,r[n++]=c>>>20&15,r[n++]=c>>>24&15,r[n++]=c>>>28&15}}function l6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,c=t[a++]>>>0,h=t[a++]>>>0;r[n++]=o>>>0&31,r[n++]=o>>>5&31,r[n++]=o>>>10&31,r[n++]=o>>>15&31,r[n++]=o>>>20&31,r[n++]=o>>>25&31,r[n++]=(o>>>30|(l&7)<<2)&31,r[n++]=l>>>3&31,r[n++]=l>>>8&31,r[n++]=l>>>13&31,r[n++]=l>>>18&31,r[n++]=l>>>23&31,r[n++]=(l>>>28|(u&1)<<4)&31,r[n++]=u>>>1&31,r[n++]=u>>>6&31,r[n++]=u>>>11&31,r[n++]=u>>>16&31,r[n++]=u>>>21&31,r[n++]=u>>>26&31,r[n++]=(u>>>31|(c&15)<<1)&31,r[n++]=c>>>4&31,r[n++]=c>>>9&31,r[n++]=c>>>14&31,r[n++]=c>>>19&31,r[n++]=c>>>24&31,r[n++]=(c>>>29|(h&3)<<3)&31,r[n++]=h>>>2&31,r[n++]=h>>>7&31,r[n++]=h>>>12&31,r[n++]=h>>>17&31,r[n++]=h>>>22&31,r[n++]=h>>>27&31}}function u6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,c=t[a++]>>>0,h=t[a++]>>>0,p=t[a++]>>>0;r[n++]=o>>>0&63,r[n++]=o>>>6&63,r[n++]=o>>>12&63,r[n++]=o>>>18&63,r[n++]=o>>>24&63,r[n++]=(o>>>30|(l&15)<<2)&63,r[n++]=l>>>4&63,r[n++]=l>>>10&63,r[n++]=l>>>16&63,r[n++]=l>>>22&63,r[n++]=(l>>>28|(u&3)<<4)&63,r[n++]=u>>>2&63,r[n++]=u>>>8&63,r[n++]=u>>>14&63,r[n++]=u>>>20&63,r[n++]=u>>>26&63,r[n++]=c>>>0&63,r[n++]=c>>>6&63,r[n++]=c>>>12&63,r[n++]=c>>>18&63,r[n++]=c>>>24&63,r[n++]=(c>>>30|(h&15)<<2)&63,r[n++]=h>>>4&63,r[n++]=h>>>10&63,r[n++]=h>>>16&63,r[n++]=h>>>22&63,r[n++]=(h>>>28|(p&3)<<4)&63,r[n++]=p>>>2&63,r[n++]=p>>>8&63,r[n++]=p>>>14&63,r[n++]=p>>>20&63,r[n++]=p>>>26&63}}function c6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,c=t[a++]>>>0,h=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0;r[n++]=o>>>0&127,r[n++]=o>>>7&127,r[n++]=o>>>14&127,r[n++]=o>>>21&127,r[n++]=(o>>>28|(l&7)<<4)&127,r[n++]=l>>>3&127,r[n++]=l>>>10&127,r[n++]=l>>>17&127,r[n++]=l>>>24&127,r[n++]=(l>>>31|(u&63)<<1)&127,r[n++]=u>>>6&127,r[n++]=u>>>13&127,r[n++]=u>>>20&127,r[n++]=(u>>>27|(c&3)<<5)&127,r[n++]=c>>>2&127,r[n++]=c>>>9&127,r[n++]=c>>>16&127,r[n++]=c>>>23&127,r[n++]=(c>>>30|(h&31)<<2)&127,r[n++]=h>>>5&127,r[n++]=h>>>12&127,r[n++]=h>>>19&127,r[n++]=(h>>>26|(p&1)<<6)&127,r[n++]=p>>>1&127,r[n++]=p>>>8&127,r[n++]=p>>>15&127,r[n++]=p>>>22&127,r[n++]=(p>>>29|(f&15)<<3)&127,r[n++]=f>>>4&127,r[n++]=f>>>11&127,r[n++]=f>>>18&127,r[n++]=f>>>25&127}}function h6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,c=t[a++]>>>0,h=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0,d=t[a++]>>>0;r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n++]=p>>>24&255,r[n++]=f>>>0&255,r[n++]=f>>>8&255,r[n++]=f>>>16&255,r[n++]=f>>>24&255,r[n++]=d>>>0&255,r[n++]=d>>>8&255,r[n++]=d>>>16&255,r[n++]=d>>>24&255}}function p6(t,e,r,i){let n=i,a=e;for(let s=0;s<128;s++){let o=t[a++]>>>0;r[n++]=o&65535,r[n++]=o>>>16&65535}}function f6(t,e,r,i,n){let a=Zl[n]>>>0,s=e,o=0,l=t[s]>>>0,u=i;for(let c=0;c<8;c++){for(let h=0;h<32;h++)if(o+n<=32){let p=l>>>o&a;r[u+h]=p|0,o+=n,o===32&&(o=0,s++,h!==31&&(l=t[s]>>>0))}else{let p=32-o,f=l>>>o;s++,l=t[s]>>>0;let d=n-p,y=-1>>>32-d>>>0,m=(f|(l&y)<<p)&a;r[u+h]=m|0,o=d}u+=32,o=0,c<7&&(l=t[s]>>>0)}}var Hl=e0(nc),d6=3*Hl/256+Hl|0;function r0(){let t=new Uint8Array(d6);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:t,byteContainerI32:new Int32Array(t.buffer,t.byteOffset,t.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function y6(t=16){if(t<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${t}`);let e=Math.max(16,t|0);return{encodedWords:new Uint32Array(e),decoderWorkspace:r0()}}function m6(t,e){if(e<=t.encodedWords.length)return t.encodedWords;let r=new Uint32Array(Math.max(16,e*2));return t.encodedWords=r,r}function g6(t,e,r,i){i.byteContainer.length<r&&(i.byteContainer=new Uint8Array(r*2),i.byteContainerI32=void 0);let n=i.byteContainer,a=r>>>2;if(n.byteOffset&3)for(let o=0;o<a;o=o+1|0){let l=t[e+o|0]|0,u=o<<2;n[u]=l&255,n[u+1|0]=l>>>8&255,n[u+2|0]=l>>>16&255,n[u+3|0]=l>>>24&255}else{let o=i.byteContainerI32;(!o||o.buffer!==n.buffer||o.byteOffset!==n.byteOffset||o.length<a)&&(o=i.byteContainerI32=new Int32Array(n.buffer,n.byteOffset,n.byteLength>>>2)),o.set(t.subarray(e,e+a))}let s=r&3;if(s>0){let o=t[e+a|0]|0,l=a<<2;for(let u=0;u<s;u=u+1|0)n[l+u|0]=o>>>(u<<3)&255}return n}function x6(t,e,r){let i=t[e++]|0,n=r.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(i>>>a-1&1))continue;if(e>=t.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${e}, needWords=1, availableWords=${t.length-e}, encodedWords=${t.length})`);let s=t[e++]>>>0,o=q5(s),l=s*a+31>>>5;if(e+l>t.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${s}, streamWordIndex=${e}, needWords=${l}, availableWords=${t.length-e}, encodedWords=${t.length})`);let u=n[a];(!u||u.length<o)&&(u=n[a]=new Uint32Array(o));let c=0;for(;c<s;c=c+32|0)F6(t,e,u,c,a),e=e+a|0;let h=c-s|0;e=e-(h*a>>>5)|0,r.exceptionSizes[a]=s}return e}function v6(t,e,r,i,n){switch(n){case 1:n6(t,e,r,i);break;case 2:a6(t,e,r,i);break;case 3:s6(t,e,r,i);break;case 4:o6(t,e,r,i);break;case 5:l6(t,e,r,i);break;case 6:u6(t,e,r,i);break;case 7:c6(t,e,r,i);break;case 8:h6(t,e,r,i);break;case 16:p6(t,e,r,i);break;default:f6(t,e,r,i,n)}return e+(n<<3)|0}function b6(t,e,r,i){if(r+2>e)throw Error(`FastPFOR decode: byteContainer underflow at block=${i} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${r}, byteSize=${e})`);let n=t[r++],a=t[r++];if(n>32)throw Error(`FastPFOR decode: invalid bitWidth=${n} at block=${i} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:n,exceptionCount:a,bytePosIn:r}}function w6(t,e,r,i,n,a){if(r+1>e)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${r}, byteSize=${e})`);let s=t[r++];if(s<i||s>32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${a} (bitWidth=${i}, expected ${i}..32)`);let o=s-i|0;if(o<1||o>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${o} at block=${a} (bitWidth=${i}, maxBits=${s})`);if(r+n>e)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${n}, have=${e-r})`);return{maxBits:s,exceptionBitWidth:o,bytePosIn:r}}function _6(t,e,r,i,n,a,s,o,l){let{maxBits:u,exceptionBitWidth:c,bytePosIn:h}=w6(n,a,s,r,i,l);if(s=h,c===1){let m=1<<r;for(let g=0;g<i;g=g+1|0){let x=n[s++];t[x+e|0]|=m}return s}let p=o.dataToBePacked[c];if(!p)throw Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${c} (bitWidth=${r}, maxBits=${u}) at block ${l}`);let f=o.dataPointers,d=f[c]|0,y=o.exceptionSizes[c]|0;if(d+i>y)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${c} (ptr=${d}, need ${i}, size=${y}) at block ${l}`);for(let m=0;m<i;m=m+1|0){let g=n[s++],x=p[d++]|0;t[g+e|0]|=x<<r}return f[c]=d,s}function D6(t,e,r,i,n,a,s,o,l,u){let c=r|0,h=0;for(let p=0;p<s;p=p+1|0){let f=b6(o,l,h,p);h=f.bytePosIn;let d=f.bitWidth,y=f.exceptionCount,m=a+p*256|0;switch(d){case 0:n.fill(0,m,m+256);break;case 32:for(let g=0;g<256;g=g+1|0)n[m+g|0]=t[c+g|0]|0;c=c+256|0;break;default:c=v6(t,c,n,m,d)}y>0&&(h=_6(n,m,d,y,o,l,h,u,p))}if(c!==i)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${e}, packedStart=${r}, consumedPackedEnd=${c}, expectedPackedEnd=${i}, packedWords=${i-r}, encoded.length=${t.length})`)}function S6(t,e,r,i,n,a){let s=r|0,o=t[s]|0;if(o<=0||s+o>t.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${o} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${t.length})`);let l=s+1|0,u=s+o|0,c=t[u]>>>0,h=c+3>>>2,p=u+1,f=p+h;if(f>=t.length)throw Error(`FastPFOR decode: invalid byteSize=${c} (metaInts=${h}, pageStart=${s}, packedEnd=${u}, byteContainerStart=${p}) causes bitmapPos=${f} out of bounds (encoded.length=${t.length})`);let d=g6(t,p,c,a),y=c,m=x6(t,f,a);return a.dataPointers.fill(0),D6(t,s,l,u,e,i|0,n/256|0,d,y,a),m}function A6(t,e,r,i,n,a){let s=i+ac(n,256),o=i,l=r;for(;o!==s;){let u=Math.min(Hl,s-o);l=S6(t,e,l,o,u,a),o=o+u|0}return l}function E6(t,e,r,i,n,a){if(a===0)return e;let s=0,o=e,l=e+r,u=n,c=n,h=n+a,p=0,f=0;for(;o<l&&c<h;){let d=t[o]>>>s&255;if(s+=8,o+=s>>>5,s&=31,p|=(d&127)<<f,d&128)i[c++]=p|0,p=0,f=0;else if(f+=7,f>28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${f}, partial=${p}, decoded=${c-u}/${a}, inPos=${o}, inEnd=${l})`)}if(c!==h)throw Error(`FastPFOR VByte: truncated stream (decoded=${c-u}, expected=${a}, consumedWords=${o-e}/${r}, vbyteStart=${e}, vbyteEnd=${l})`);return o}function T6(t,e,r){let i=0,n=0,a=new Uint32Array(e),s=r??r0();if(t.length>0){let u=t[i]|0;if(i=i+1|0,u&255)throw Error(`FastPFOR decode: invalid alignedLength=${u} (expected multiple of 256)`);if(n+u>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${n}, alignedLength=${u}, out.length=${a.length})`);i=A6(t,a,i,n,u,s),n=n+u|0}let o=t.length-i|0,l=e-n|0;return E6(t,i,o,a,n,l),a}function F6(t,e,r,i,n){switch(n){case 2:X5(t,e,r,i);return;case 3:Y5(t,e,r,i);return;case 4:W5(t,e,r,i);return;case 5:Z5(t,e,r,i);return;case 6:H5(t,e,r,i);return;case 7:K5(t,e,r,i);return;case 8:J5(t,e,r,i);return;case 9:Q5(t,e,r,i);return;case 10:t6(t,e,r,i);return;case 11:e6(t,e,r,i);return;case 12:r6(t,e,r,i);return;case 16:i6(t,e,r,i);return;case 32:for(let u=0;u<32;u=u+1|0)r[i+u|0]=t[e+u|0]|0;return}let a=Zl[n]>>>0,s=e,o=0,l=t[s]>>>0;for(let u=0;u<32;u++)if(o+n<=32){let c=l>>>o&a;r[i+u]=c|0,o+=n,o===32&&(o=0,s++,u!==31&&(l=t[s]>>>0))}else{let c=32-o,h=l>>>o;s++,l=t[s]>>>0;let p=Zl[n-c]>>>0,f=(h|(l&p)<<c)&a;r[i+u]=f|0,o=n-c}}function C6(t,e,r,i){if(e<0||r<0||e+r>t.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${e}, byteLength=${r}, bytes.length=${t.length})`);let n=Math.floor(r/4),a=r%4!=0,s=a?n+1:n;if(i.length<s)throw RangeError(`decodeBigEndianInt32sInto: out.length=${i.length} < ${s}`);if(n>0){let o=t.byteOffset+e;if(o&3)for(let l=0;l<n;l++){let u=e+l*4;i[l]=t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]}else{let l=new Uint32Array(t.buffer,o,n);for(let u=0;u<n;u++)i[u]=G5(l[u])|0}}if(a){let o=e+n*4,l=r-n*4,u=0;for(let c=0;c<l;c++)u|=t[o+c]<<24-c*8;i[n]=u|0}return s}function jt(t,e,r){let i=new Uint32Array(r),n=0,a=e.get();for(let s=0;s<i.length;s++){let o=t[a++],l=o&127;o<128||(o=t[a++],l|=(o&127)<<7,o<128||(o=t[a++],l|=(o&127)<<14,o<128||(o=t[a++],l|=(o&127)<<21,o<128||(o=t[a++],l|=(o&15)<<28)))),i[n++]=l}return e.set(a),i}function sc(t,e,r){let i=new BigUint64Array(r);for(let n=0;n<i.length;n++)i[n]=I6(t,e);return i}function I6(t,e){let r=0n,i=0,n=e.get();for(;n<t.length;){let a=t[n++];if(r|=BigInt(a&127)<<BigInt(i),!(a&128))break;if(i+=7,i>=64)throw Error("Varint too long")}return e.set(n),r}function k6(t,e,r){let i=new Float64Array(r);for(let n=0;n<r;n++)i[n]=M6(t,e);return i}function M6(t,e){let r,i;return i=t[e.get()],e.increment(),r=i&127,i<128||(i=t[e.get()],e.increment(),r|=(i&127)<<7,i<128)||(i=t[e.get()],e.increment(),r|=(i&127)<<14,i<128)||(i=t[e.get()],e.increment(),r|=(i&127)<<21,i<128)?r:(i=t[e.get()],r|=(i&15)<<28,P6(r,t,e))}function P6(t,e,r){let i,n;if(n=e[r.get()],r.increment(),i=(n&112)>>4,n<128||(n=e[r.get()],r.increment(),i|=(n&127)<<3,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<10,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<17,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<24,n<128)||(n=e[r.get()],r.increment(),i|=(n&1)<<31,n<128))return i*4294967296+(t>>>0);throw Error("Expected varint not more than 10 bytes")}function B6(t,e,r,i){return z6(t,e,r,i,y6(r>>>2))}function z6(t,e,r,i,n){let a=i.get();if(r&3)throw Error(`FastPFOR: invalid encodedByteLength=${r} at offset=${a} (encodedBytes.length=${t.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let s=r>>>2,o=m6(n,s);C6(t,a,r,o);let l=T6(o.subarray(0,s),e,n.decoderWorkspace);return i.add(r),l}function tt(t){return t>>>1^-(t&1)}function Rt(t){return t>>1n^-(t&1n)}function cr(t){return t%2==1?(t+1)/-2:t/2}function L6(t){let e=new Int32Array(t.length);for(let r=0;r<t.length;r++)e[r]=tt(t[r]);return e}function O6(t){let e=new BigInt64Array(t.length);for(let r=0;r<t.length;r++)e[r]=Rt(t[r]);return e}function V6(t){for(let e=0;e<t.length;e++)t[e]=cr(t[e])}function Kl(t,e,r){if(r===void 0){r=0;for(let a=0;a<e;a++)r+=t[a]}let i=new Uint32Array(r),n=0;for(let a=0;a<e;a++){let s=t[a],o=t[a+e];i.fill(o,n,n+s),n+=s}return i}function Jl(t,e,r){if(r===void 0){r=0;for(let a=0;a<e;a++)r+=Number(t[a])}let i=new BigUint64Array(r),n=0;for(let a=0;a<e;a++){let s=Number(t[a]),o=t[a+e];i.fill(o,n,n+s),n+=s}return i}function i0(t,e,r){let i=new Float64Array(r),n=0;for(let a=0;a<e;a++){let s=t[a],o=t[a+e];i.fill(o,n,n+s),n+=s}return i}function Kp(t){let e=new Int32Array(t.length);e[0]=tt(t[0]);let r=t.length/4*4,i=1;if(r>=4)for(;i<r-4;i+=4){let n=t[i],a=t[i+1],s=t[i+2],o=t[i+3];e[i]=tt(n)+e[i-1],e[i+1]=tt(a)+e[i],e[i+2]=tt(s)+e[i+1],e[i+3]=tt(o)+e[i+2]}for(;i!==t.length;++i)e[i]=tt(t[i])+e[i-1];return e}function Jp(t){let e=new BigInt64Array(t.length);e[0]=Rt(t[0]);let r=t.length/4*4,i=1;if(r>=4)for(;i<r-4;i+=4){let n=t[i],a=t[i+1],s=t[i+2],o=t[i+3];e[i]=Rt(n)+e[i-1],e[i+1]=Rt(a)+e[i],e[i+2]=Rt(s)+e[i+1],e[i+3]=Rt(o)+e[i+2]}for(;i!==e.length;++i)e[i]=Rt(t[i])+e[i-1];return e}function R6(t){t[0]=cr(t[0]);let e=t.length/4*4,r=1;if(e>=4)for(;r<e-4;r+=4){let i=t[r],n=t[r+1],a=t[r+2],s=t[r+3];t[r]=cr(i)+t[r-1],t[r+1]=cr(n)+t[r],t[r+2]=cr(a)+t[r+1],t[r+3]=cr(s)+t[r+2]}for(;r!==t.length;++r)t[r]=cr(t[r])+t[r-1]}function $6(t,e,r){if(r===void 0){r=0;for(let a=0;a<e;a++)r+=t[a]}let i=new Int32Array(r),n=0;for(let a=0;a<e;a++){let s=t[a],o=t[a+e];o=tt(o),i.fill(o,n,n+s),n+=s}return i}function N6(t,e,r){if(r===void 0){r=0;for(let a=0;a<e;a++)r+=Number(t[a])}let i=new BigInt64Array(r),n=0;for(let a=0;a<e;a++){let s=Number(t[a]),o=t[a+e];o=Rt(o),i.fill(o,n,n+s),n+=s}return i}function j6(t,e,r){let i=new Float64Array(r),n=0;for(let a=0;a<e;a++){let s=t[a],o=t[a+e];o=cr(o),i.fill(o,n,n+s),n+=s}return i}function oc(t){let e=t.length/4*4,r=1;if(e>=4)for(let i=t[0];r<e-4;r+=4)i=t[r]+=i,i=t[r+1]+=i,i=t[r+2]+=i,i=t[r+3]+=i;for(;r!==t.length;)t[r]+=t[r-1],++r}function U6(t){let e=0;for(let r=0;r<t.length;r++)t[r]+=e,e=t[r]}function q6(t){if(t.length<2)return new Int32Array(t);let e=new Int32Array(t.length);e[0]=tt(t[0]),e[1]=tt(t[1]);let r=t.length/4*4,i=2;if(r>=4)for(;i<r-4;i+=4){let n=t[i],a=t[i+1],s=t[i+2],o=t[i+3];e[i]=tt(n)+e[i-2],e[i+1]=tt(a)+e[i-1],e[i+2]=tt(s)+e[i],e[i+3]=tt(o)+e[i+1]}for(;i!==t.length;i+=2)e[i]=tt(t[i])+e[i-2],e[i+1]=tt(t[i+1])+e[i-1];return e}function n0(t,e,r,i){if(t.length<2)return new Int32Array(t);let n=new Int32Array(t.length),a=tt(t[0]),s=tt(t[1]);n[0]=lr(Math.round(a*e),r,i),n[1]=lr(Math.round(s*e),r,i);let o=t.length/16,l=2;if(o>=4)for(;l<o-4;l+=4){let u=t[l],c=t[l+1],h=tt(u)+a,p=tt(c)+s;n[l]=lr(Math.round(h*e),r,i),n[l+1]=lr(Math.round(p*e),r,i);let f=t[l+2],d=t[l+3];a=tt(f)+h,s=tt(d)+p,n[l+2]=lr(Math.round(a*e),r,i),n[l+3]=lr(Math.round(s*e),r,i)}for(;l!==t.length;l+=2)a+=tt(t[l]),s+=tt(t[l+1]),n[l]=lr(Math.round(a*e),r,i),n[l+1]=lr(Math.round(s*e),r,i);return n}function lr(t,e,r){return Math.min(r,Math.max(e,t))}function G6(t){let e=new Int32Array(t.length+1);e[0]=0,e[1]=tt(t[0]);let r=e[1];for(let i=2;i!==e.length;++i){let n=tt(t[i-1]);r+=n,e[i]=e[i-1]+r}return new Uint32Array(e)}function X6(t,e,r){let i=new Int32Array(r+1);i[0]=0;let n=1,a=i[0];for(let s=0;s<e;s++){let o=t[s],l=t[s+e];l=tt(l);for(let u=n;u<n+o;u++)i[u]=l+a,a=i[u];n+=o}return i}function Y6(t,e,r){let i=new Uint32Array(r+1);i[0]=0;let n=1,a=i[0];for(let s=0;s<e;s++){let o=t[s],l=t[s+e];for(let u=n;u<n+o;u++)i[u]=l+a,a=i[u];n+=o}return i}function W6(t,e,r){let i=new Int32Array(r),n=0,a=0;for(let s=0;s<e;s++){let o=t[s],l=tt(t[s+e]);for(let u=0;u<o;u++)a+=l,i[n++]=a}return i}function Z6(t,e,r){let i=new BigInt64Array(r),n=0,a=0n;for(let s=0;s<e;s++){let o=Number(t[s]),l=Rt(t[s+e]);for(let u=0;u<o;u++)a+=l,i[n++]=a}return i}function Qp(t){let e=new Uint32Array(t.length);e[0]=tt(t[0])>>>0;for(let r=1;r<t.length;r++)e[r]=e[r-1]+tt(t[r])>>>0;return e}function tf(t){let e=new BigUint64Array(t.length);e[0]=BigInt.asUintN(64,Rt(t[0]));for(let r=1;r<t.length;r++)e[r]=BigInt.asUintN(64,e[r-1]+Rt(t[r]));return e}function H6(t){if(t.length<2)return new Uint32Array(t);let e=new Uint32Array(t.length);e[0]=tt(t[0])>>>0,e[1]=tt(t[1])>>>0;for(let r=2;r<t.length;r+=2)e[r]=e[r-2]+tt(t[r])>>>0,e[r+1]=e[r-1]+tt(t[r+1])>>>0;return e}function K6(t,e,r,i){let n=n0(t,e,r,i);return new Uint32Array(n)}function J6(t){return t[1]}function Q6(t){return tt(t[1])}function t_(t){if(t.length===2){let e=tt(t[1]);return[e,e]}return[tt(t[2]),tt(t[3])]}function e_(t){return t[1]}function r_(t){return Rt(t[1])}function i_(t){if(t.length===2){let e=Rt(t[1]);return[e,e]}return[Rt(t[2]),Rt(t[3])]}var Ct;(function(t){t.PRESENT="PRESENT",t.DATA="DATA",t.OFFSET="OFFSET",t.LENGTH="LENGTH"})(Ct||={});var Yt;(function(t){t.NONE="NONE",t.SINGLE="SINGLE",t.SHARED="SHARED",t.VERTEX="VERTEX",t.MORTON="MORTON",t.FSST="FSST"})(Yt||={});var Xe;(function(t){t.VERTEX="VERTEX",t.INDEX="INDEX",t.STRING="STRING",t.KEY="KEY"})(Xe||={});var Bt;(function(t){t.VAR_BINARY="VAR_BINARY",t.GEOMETRIES="GEOMETRIES",t.PARTS="PARTS",t.RINGS="RINGS",t.TRIANGLES="TRIANGLES",t.SYMBOL="SYMBOL",t.DICTIONARY="DICTIONARY"})(Bt||={});var n_=[Ct.PRESENT,Ct.DATA,Ct.OFFSET,Ct.LENGTH],ef=[K.NONE,K.DELTA,K.COMPONENTWISE_DELTA,K.RLE,K.MORTON],a_=[ye.NONE,ye.FAST_PFOR,ye.VARINT],s_=[Yt.NONE,Yt.SINGLE,Yt.SHARED,Yt.VERTEX,Yt.MORTON,Yt.FSST],o_=[Xe.VERTEX,Xe.INDEX,Xe.STRING,Xe.KEY],l_=[Bt.VAR_BINARY,Bt.GEOMETRIES,Bt.PARTS,Bt.RINGS,Bt.TRIANGLES,Bt.SYMBOL,Bt.DICTIONARY];function gt(t,e){let r=h_(t,e);return r.logicalLevelTechnique1===K.MORTON?u_(r,t,e):(K.RLE===r.logicalLevelTechnique1||K.RLE===r.logicalLevelTechnique2)&&ye.NONE!==r.physicalLevelTechnique?c_(r,t,e):r}function u_(t,e,r){let i=jt(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:t.decompressedCount,numBits:i[0],coordinateShift:i[1]}}function c_(t,e,r){let i=jt(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:i[1],runs:i[0],numRleValues:i[1]}}function h_(t,e){let r=t[e.get()],i=n_[r>>4],n={};switch(i){case Ct.DATA:n={dictionaryType:s_[r&15]};break;case Ct.OFFSET:n={offsetType:o_[r&15]};break;case Ct.LENGTH:n={lengthType:l_[r&15]}}e.increment();let a=t[e.get()],s=ef[a>>5],o=ef[a>>2&7],l=a_[a&3];e.increment();let u=jt(t,e,2),c=u[0],h=u[1];return{physicalStreamType:i,logicalStreamType:n,logicalLevelTechnique1:s,logicalLevelTechnique2:o,physicalLevelTechnique:l,numValues:c,byteLength:h,decompressedCount:c}}var yt;(function(t){t[t.FLAT=0]="FLAT",t[t.CONST=1]="CONST",t[t.SEQUENCE=2]="SEQUENCE",t[t.DICTIONARY=3]="DICTIONARY",t[t.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(yt||={});var Ee=class{constructor(t,e){this.values=t,this._size=e}get(t){let e=Math.floor(t/8),r=t%8;return(this.values[e]>>r&1)==1}set(t,e){let r=Math.floor(t/8),i=t%8;this.values[r]=this.values[r]|+!!e<<i}getInt(t){let e=Math.floor(t/8),r=t%8;return this.values[e]>>r&1}size(){return this._size}getBuffer(){return this.values}};function Nr(t,e,r){if(!e)return t;let i=e.size(),n=new t.constructor(i),a=0;for(let s=0;s<i;s++)n[s]=e.get(s)?t[a++]:r;return n}function p_(t,e,r){if(!r)return t;let i=r.size(),n=new Ee(t,e),a=new Ee(new Uint8Array(Math.ceil(i/8)),i),s=0;for(let o=0;o<i;o++){let l=r.get(o)?n.get(s++):!1;a.set(o,l)}return a.getBuffer()}function a0(t,e,r){for(let i=0;i<t;i++){let n=gt(e,r);r.add(n.byteLength)}}function Ci(t,e,r,i,n){let a=f_(t,Math.ceil(e/8),r,i);return n?p_(a,e,n):a}function f_(t,e,r,i){let n=new Uint8Array(e),a=0,s=i.get()+r;for(;a<e&&!(i.get()>=s);){let o=t[i.increment()];if(o<=127){let l=o+3,u=t[i.increment()],c=Math.min(a+l,e);n.fill(u,a,c),a=c}else{let l=256-o;for(let u=0;u<l&&a<e;u++)n[a++]=t[i.increment()]}}return i.set(s),n}function s0(t,e,r,i){let n=e.get(),a=n+r*Float32Array.BYTES_PER_ELEMENT,s=new Uint8Array(t.subarray(n,a)).buffer,o=new Float32Array(s);return e.set(a),i?Nr(o,i,0):o}function o0(t,e,r,i){let n=e.get(),a=n+r*Float64Array.BYTES_PER_ELEMENT,s=new Uint8Array(t.subarray(n,a)).buffer,o=new Float64Array(s);return e.set(a),i?Nr(o,i,0):o}function d_(t,e,r){let i=e.get(),n=r*Uint32Array.BYTES_PER_ELEMENT,a=new DataView(t.buffer,t.byteOffset,t.byteLength),s=new Uint32Array(r);for(let o=0;o<r;o++)s[o]=a.getUint32(i+o*Uint32Array.BYTES_PER_ELEMENT,!0);return e.add(n),s}function y_(t,e,r){let i=e.get(),n=r*BigUint64Array.BYTES_PER_ELEMENT,a=new DataView(t.buffer,t.byteOffset,t.byteLength),s=new BigUint64Array(r);for(let o=0;o<r;o++)s[o]=a.getBigUint64(i+o*BigUint64Array.BYTES_PER_ELEMENT,!0);return e.add(n),s}var m_=new TextDecoder;function lc(t,e,r){return r-e>=12?m_.decode(t.subarray(e,r)):g_(t,e,r)}function g_(t,e,r){let i="",n=e;for(;n<r;){let a=t[n],s=null,o=a>239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,c;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],c=t[n+3],(l&192)==128&&(u&192)==128&&(c&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|c&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function Ja(t,e,r,i,n){return __(Ii(t,e,r),r,i,n)}function Vt(t,e,r,i,n){return D_(Ii(t,e,r),r,i,n)}function hr(t,e,r){return A_(Ii(t,e,r),r)}function Ii(t,e,r){let i=r.physicalLevelTechnique;switch(i){case ye.FAST_PFOR:return B6(t,r.numValues,r.byteLength,e);case ye.VARINT:return jt(t,e,r.numValues);case ye.NONE:return d_(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function Nn(t,e,r){let i=r.physicalLevelTechnique;switch(i){case ye.VARINT:return sc(t,e,r.numValues);case ye.NONE:return y_(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function x_(t,e,r){let i=Ii(t,e,r);return i.length===1?tt(i[0]):Q6(i)}function uc(t,e,r){let i=Ii(t,e,r);return i.length===1?r.logicalLevelTechnique1===K.DELTA?tt(i[0]):i[0]:J6(i)}function l0(t,e,r){return t_(Ii(t,e,r))}function u0(t,e,r){return i_(sc(t,e,r.numValues))}function c0(t,e,r,i){return p0(Nn(t,e,r),r,i)}function cc(t,e,r,i){return f0(Nn(t,e,r),r,i)}function v_(t,e,r,i){let n=b_(t,e,r,!1);return i?Nr(n,i,0):n}function b_(t,e,r,i){if(r.physicalLevelTechnique===ye.VARINT)return S_(k6(t,e,r.numValues),r,i);let n=Nn(t,e,r),a=i?p0(n,r):f0(n,r);return Float64Array.from(a,Number)}function w_(t,e,r){let i=Nn(t,e,r);return i.length===1?Rt(i[0]):r_(i)}function h0(t,e,r){let i=Nn(t,e,r);return i.length===1?r.logicalLevelTechnique1===K.DELTA?Rt(i[0]):i[0]:e_(i)}function __(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case K.DELTA:if(e.logicalLevelTechnique2===K.RLE){let a=e;if(!i)return W6(t,a.runs,a.numRleValues);t=Kl(t,a.runs,a.numRleValues),n=Kp(t)}else n=Kp(t);break;case K.RLE:n=$6(t,e.runs,e.numRleValues);break;case K.MORTON:oc(t),n=new Int32Array(t);break;case K.COMPONENTWISE_DELTA:if(r&&!i)return n0(t,r.scale,r.min,r.max);n=q6(t);break;case K.NONE:n=L6(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Nr(n,i,0):n}function D_(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case K.DELTA:if(e.logicalLevelTechnique2===K.RLE){let a=e;n=Qp(Kl(t,a.runs,a.numRleValues))}else n=Qp(t);break;case K.RLE:n=Kl(t,e.runs,e.numRleValues);break;case K.MORTON:oc(t),n=t;break;case K.COMPONENTWISE_DELTA:n=r&&!i?K6(t,r.scale,r.min,r.max):H6(t);break;case K.NONE:n=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Nr(n,i,0):n}function p0(t,e,r){let i;switch(e.logicalLevelTechnique1){case K.DELTA:if(e.logicalLevelTechnique2===K.RLE){let n=e;if(!r)return Z6(t,n.runs,n.numRleValues);t=Jl(t,n.runs,n.numRleValues),i=Jp(t)}else i=Jp(t);break;case K.RLE:i=N6(t,e.runs,e.numRleValues);break;case K.NONE:i=O6(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Nr(i,r,0n):i}function f0(t,e,r){let i;switch(e.logicalLevelTechnique1){case K.DELTA:if(e.logicalLevelTechnique2===K.RLE){let n=e;i=tf(Jl(t,n.runs,n.numRleValues))}else i=tf(t);break;case K.RLE:i=Jl(t,e.runs,e.numRleValues);break;case K.NONE:i=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Nr(i,r,0n):i}function S_(t,e,r){switch(e.logicalLevelTechnique1){case K.DELTA:if(e.logicalLevelTechnique2===K.RLE){let i=e;t=i0(t,i.runs,i.numRleValues)}return R6(t),t;case K.RLE:return T_(t,e,r);case K.NONE:return r&&V6(t),t;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}}function A_(t,e){if(e.logicalLevelTechnique1===K.DELTA&&e.logicalLevelTechnique2===K.NONE)return G6(t);if(e.logicalLevelTechnique1===K.RLE&&e.logicalLevelTechnique2===K.NONE){let r=e;return Y6(t,r.runs,r.numRleValues)}if(e.logicalLevelTechnique1===K.NONE&&e.logicalLevelTechnique2===K.NONE){U6(t);let r=new Uint32Array(e.numValues+1);return r[0]=0,r.set(t,1),r}if(e.logicalLevelTechnique1===K.DELTA&&e.logicalLevelTechnique2===K.RLE){let r=e,i=X6(t,r.runs,r.numRleValues);return oc(i),new Uint32Array(i)}throw Error("Only delta encoding is supported for transforming length to offset streams yet.")}function _s(t,e,r,i,n="int32"){let a=t.logicalLevelTechnique1;if(a===K.RLE)return t.runs===1?yt.CONST:yt.FLAT;if(a!==K.DELTA||t.logicalLevelTechnique2!==K.RLE)return t.numValues===1?yt.CONST:yt.FLAT;let s=e instanceof Ee?e.size():e,o=t;if(o.numRleValues!==s)return yt.FLAT;if(o.runs===1)return yt.SEQUENCE;if(o.runs!==2)return t.numValues===1?yt.CONST:yt.FLAT;let l=i.get();if(t.physicalLevelTechnique===ye.VARINT)return E_(r,i,n)?yt.SEQUENCE:t.numValues===1?yt.CONST:yt.FLAT;let u=i.get(),c=new Int32Array(r.buffer,r.byteOffset+u,4);return i.set(l),c[2]===2&&c[3]===2?yt.SEQUENCE:t.numValues===1?yt.CONST:yt.FLAT}function E_(t,e,r){let i=new t0(e.get());if(r==="int64"){let a=sc(t,i,4);return a[2]===2n&&a[3]===2n}let n=jt(t,i,4);return n[2]===2&&n[3]===2}function T_(t,e,r){return r?j6(t,e.runs,e.numRleValues):i0(t,e.runs,e.numRleValues)}var d0=class extends ws{getValueFromBuffer(t){return this.dataBuffer[t]}},y0=class extends J1{constructor(t,e,r,i,n){super(t,n?BigInt64Array.of(e):BigUint64Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+BigInt(t)*this.delta}};function hc(t,e,r){return{x:rf(t,e)-r,y:rf(t>>1,e)-r}}function rf(t,e){let r=0;for(let i=0;i<e;i++)r|=(t&1<<2*i)>>i;return r}var $t;(function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON",t[t.MULTIPOINT=3]="MULTIPOINT",t[t.MULTILINESTRING=4]="MULTILINESTRING",t[t.MULTIPOLYGON=5]="MULTIPOLYGON"})($t||={});var F_;(function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON"})(F_||={});var jr;(function(t){t[t.MORTON=0]="MORTON",t[t.VEC_2=1]="VEC_2",t[t.VEC_3=2]="VEC_3"})(jr||={});function C_(t){let e=Array(t.numGeometries),r=1,i=1,n=1,a=0,s=0,o=0,l=t.mortonSettings,u=t.topologyVector,c=u.geometryOffsets,h=u.partOffsets,p=u.ringOffsets,f=t.vertexOffsets,d=!f||f.length===0,y=t.containsPolygonGeometry(),m=t.vertexBuffer;for(let g=0;g<t.numGeometries;g++){let x=t.geometryType(g);switch(x){case $t.POINT:{let v,b;if(d)v=m[s++],b=m[s++];else if(t.vertexBufferType===jr.MORTON){let w=hc(m[f[o++]],l.numBits,l.coordinateShift);v=w.x,b=w.y}else{let w=f[o++]*2;v=m[w],b=m[w+1]}e[a++]=[[new F(v,b)]],c&&n++,h&&r++,p&&i++}break;case $t.MULTIPOINT:{let v=c[n]-c[n-1];n++;let b;if(d){b=Array(v);for(let w=0;w<v;w++){let _=m[s++],D=m[s++];b[w]=new F(_,D)}}else b=_r(t.vertexBufferType,m,f,o,v,!1,l),o+=v;e[a++]=b.map(w=>[w]),r+=v,i+=v}break;case $t.LINESTRING:{let v;y?(v=p[i]-p[i-1],i++):v=h[r]-h[r-1],r++;let b;d?(b=Jr(m,s,v,!1),s+=v*2):(b=_r(t.vertexBufferType,m,f,o,v,!1,l),o+=v),e[a++]=[b],c&&n++}break;case $t.POLYGON:{let v=h[r]-h[r-1];r++;let b=Array(v-1),w,_=p[i]-p[i-1];if(i++,d){w=Jr(m,s,_,!0),s+=_*2;for(let D=0;D<b.length;D++)_=p[i]-p[i-1],i++,b[D]=Jr(m,s,_,!0),s+=_*2}else{w=_r(t.vertexBufferType,m,f,o,_,!0,l),o+=_;for(let D=0;D<b.length;D++)_=p[i]-p[i-1],i++,b[D]=_r(t.vertexBufferType,m,f,o,_,!0,l),o+=_}e[a++]=[w].concat(b),c&&n++}break;case $t.MULTILINESTRING:{let v=c[n]-c[n-1];n++;let b=Array(v);for(let w=0;w<v;w++){let _;if(y?(_=p[i]-p[i-1],i++):_=h[r]-h[r-1],r++,d)b[w]=Jr(m,s,_,!1),s+=_*2;else{let D=_r(t.vertexBufferType,m,f,o,_,!1,l);b[w]=D,o+=_}}e[a++]=b}break;case $t.MULTIPOLYGON:{let v=c[n]-c[n-1];n++;let b=Array(v);for(let w=0;w<v;w++){let _=h[r]-h[r-1];r++;let D,A=Array(_-1),E=p[i]-p[i-1];i++,d?(D=Jr(m,s,E,!0),s+=E*2):(D=_r(t.vertexBufferType,m,f,o,E,!0,l),o+=E);for(let O=0;O<A.length;O++){let k=p[i]-p[i-1];i++,d?(A[O]=Jr(m,s,k,!0),s+=k*2):(A[O]=_r(t.vertexBufferType,m,f,o,k,!0,l),o+=k)}b[w]=[D].concat(A)}e[a++]=b.flat()}break;default:throw Error(`The specified geometry type (${x}) is currently not supported.`)}}return e}function _r(t,e,r,i,n,a,s){return t===jr.MORTON?k_(e,r,i,n,a,s):I_(e,r,i,n,a)}function Jr(t,e,r,i){let n=Array(i?r+1:r);for(let a=0;a<r*2;a+=2){let s=t[e+a],o=t[e+a+1];n[a/2]=new F(s,o)}return i&&(n[n.length-1]=n[0]),n}function I_(t,e,r,i,n){let a=Array(n?i+1:i);for(let s=0;s<i*2;s+=2){let o=e[r+s/2]*2,l=t[o],u=t[o+1];a[s/2]=new F(l,u)}return n&&(a[a.length-1]=a[0]),a}function k_(t,e,r,i,n,a){let s=Array(n?i+1:i);for(let o=0;o<i;o++){let l=hc(t[e[r+o]],a.numBits,a.coordinateShift);s[o]=new F(l.x,l.y)}return n&&(s[s.length-1]=s[0]),s}var m0=class{constructor(t,e,r,i,n){this._vertexBufferType=t,this._topologyVector=e,this._vertexOffsets=r,this._vertexBuffer=i,this._mortonSettings=n}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(t){let e=this.vertexOffsets?this.vertexOffsets[t]*2:t*2;return[this.vertexBuffer[e],this.vertexBuffer[e+1]]}getVertex(t){if(this.vertexOffsets&&this.mortonSettings){let r=this.vertexOffsets[t],i=hc(this.vertexBuffer[r],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[i.x,i.y]}let e=this.vertexOffsets?this.vertexOffsets[t]*2:t*2;return[this.vertexBuffer[e],this.vertexBuffer[e+1]]}getGeometries(){return C_(this)}get mortonSettings(){return this._mortonSettings}};function M_(t,e,r,i,n){return new g0(t,e,jr.VEC_2,r,i,n)}function P_(t,e,r,i,n,a){return new g0(t,e,jr.MORTON,r,i,n,a)}var g0=class extends m0{constructor(t,e,r,i,n,a,s){super(r,i,n,a,s),this._numGeometries=t,this._geometryType=e}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===$t.POLYGON||this._geometryType===$t.MULTIPOLYGON}containsSingleGeometryType(){return!0}};function x0(t,e,r,i){return new v0(jr.VEC_2,t,e,r,i)}function B_(t,e,r,i,n){return new v0(jr.MORTON,t,e,r,i,n)}var v0=class extends m0{constructor(t,e,r,i,n,a){super(t,r,i,n,a),this._geometryTypes=e}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let t=0;t<this.numGeometries;t++)if(this.geometryType(t)===$t.POLYGON||this.geometryType(t)===$t.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}},b0=class{constructor(t,e,r,i){this._triangleOffsets=t,this._indexBuffer=e,this._vertexBuffer=r,this._topologyVector=i}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw Error("Cannot convert GpuVector to coordinates without topology information");let t=new Uint32Array(this.numGeometries);for(let e=0;e<this.numGeometries;e++)t[e]=this.geometryType(e);return x0(t,this._topologyVector,void 0,this._vertexBuffer).getGeometries()}[Symbol.iterator](){return null}};function nf(t,e,r,i,n,a){return new z_(t,e,r,i,n,a)}var z_=class extends b0{constructor(t,e,r,i,n,a){super(r,i,n,a),this._numGeometries=t,this._geometryType=e}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}};function af(t,e,r,i,n){return new L_(t,e,r,i,n)}var L_=class extends b0{constructor(t,e,r,i,n){super(e,r,i,n),this._geometryTypes=t}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}};function O_(t,e,r,i,n){let a=gt(t,r),s=_s(a,i,t,r),o,l,u,c;if(s===yt.CONST){let v=uc(t,r,a),b,w,_,D;for(let A=0;A<e-1;A++){let E=gt(t,r);switch(E.physicalStreamType){case Ct.LENGTH:switch(E.logicalStreamType.lengthType){case Bt.GEOMETRIES:b=hr(t,r,E);break;case Bt.PARTS:w=hr(t,r,E);break;case Bt.RINGS:_=hr(t,r,E);break;case Bt.TRIANGLES:D=hr(t,r,E)}break;case Ct.OFFSET:switch(E.logicalStreamType.offsetType){case Xe.VERTEX:o=Vt(t,r,E);break;case Xe.INDEX:c=Vt(t,r,E)}break;case Ct.DATA:if(Yt.VERTEX===E.logicalStreamType.dictionaryType)l=Ja(t,r,E,n);else{let O=E;u={numBits:O.numBits,coordinateShift:O.coordinateShift},l=Vt(t,r,E,n)}}}return c?b!==void 0||w!==void 0?nf(i,v,D,c,l,{geometryOffsets:b,partOffsets:w,ringOffsets:_}):nf(i,v,D,c,l):u===void 0?M_(i,v,{geometryOffsets:b,partOffsets:w,ringOffsets:_},o,l):P_(i,v,{geometryOffsets:b,partOffsets:w,ringOffsets:_},o,l,u)}let h=Vt(t,r,a),p,f,d,y;for(let v=0;v<e-1;v++){let b=gt(t,r);switch(b.physicalStreamType){case Ct.LENGTH:switch(b.logicalStreamType.lengthType){case Bt.GEOMETRIES:p=Vt(t,r,b);break;case Bt.PARTS:f=Vt(t,r,b);break;case Bt.RINGS:d=Vt(t,r,b);break;case Bt.TRIANGLES:y=hr(t,r,b)}break;case Ct.OFFSET:switch(b.logicalStreamType.offsetType){case Xe.VERTEX:o=Vt(t,r,b);break;case Xe.INDEX:c=Vt(t,r,b)}break;case Ct.DATA:if(Yt.VERTEX===b.logicalStreamType.dictionaryType)l=Ja(t,r,b,n);else{let w=b;u={numBits:w.numBits,coordinateShift:w.coordinateShift},l=Vt(t,r,b,n)}}}let m,g,x;return p?(m=_o(h,p,2),f&&d?(g=sf(h,m,f,!1),x=R_(h,m,g,d)):f&&(g=V_(h,m,f))):f&&d?(g=_o(h,f,1),x=sf(h,g,d,!0)):f&&(g=_o(h,f,0)),c&&!g?af(h,y,c,l):c?af(h,y,c,l,{geometryOffsets:m,partOffsets:g,ringOffsets:x}):u===void 0?x0(h,{geometryOffsets:m,partOffsets:g,ringOffsets:x},o,l):B_(h,{geometryOffsets:m,partOffsets:g,ringOffsets:x},o,l,u)}function _o(t,e,r){let i=new Uint32Array(t.length+1),n=0;i[0]=n;let a=0;for(let s=0;s<t.length;s++)n=i[s+1]=n+(t[s]>r?e[a++]:1);return i}function sf(t,e,r,i){let n=new Uint32Array(e[e.length-1]+1),a=0;n[0]=a;let s=1,o=0;for(let l=0;l<t.length;l++){let u=t[l],c=e[l+1]-e[l];if(u===5||u===2||i&&(u===4||u===1))for(let h=0;h<c;h++)a=n[s++]=a+r[o++];else for(let h=0;h<c;h++)n[s++]=++a}return n}function V_(t,e,r){let i=new Uint32Array(e[e.length-1]+1),n=0;i[0]=n;let a=1,s=0;for(let o=0;o<t.length;o++){let l=t[o],u=e[o+1]-e[o];if(l===4||l===1)for(let c=0;c<u;c++)n=i[a++]=n+r[s++];else for(let c=0;c<u;c++)i[a++]=++n}return i}function R_(t,e,r,i){let n=new Uint32Array(r[r.length-1]+1),a=0;n[0]=a;let s=1,o=1,l=0;for(let u=0;u<t.length;u++){let c=t[u],h=e[u+1]-e[u];if(c!==0&&c!==3)for(let p=0;p<h;p++){let f=r[s]-r[s-1];s++;for(let d=0;d<f;d++)a=n[o++]=a+i[l++]}else for(let p=0;p<h;p++)n[o++]=++a,s++}return n}var $_=class extends $r{constructor(t,e,r){super(t,e.getBuffer(),r),this.dataVector=e}getValueFromBuffer(t){return this.dataVector.get(t)}},N_=class extends ws{getValueFromBuffer(t){return this.dataBuffer[t]}},w0=class extends $r{constructor(t,e,r,i){super(t,i?BigInt64Array.of(e):BigUint64Array.of(e),r)}getValueFromBuffer(t){return this.dataBuffer[0]}},pc=class extends $r{constructor(t,e,r,i){super(t,r,i),this.offsetBuffer=e}},of=class extends pc{constructor(t,e,r,i){super(t,e,r,i??e.length-1)}getValueFromBuffer(t){let e=this.offsetBuffer[t],r=this.offsetBuffer[t+1];return lc(this.dataBuffer,e,r)}},hi=class extends pc{constructor(t,e,r,i,n){super(t,r,i,n??e.length),this.indexBuffer=e,this.indexBuffer=e}getValueFromBuffer(t){let e=this.indexBuffer[t],r=this.offsetBuffer[e],i=this.offsetBuffer[e+1];return lc(this.dataBuffer,r,i)}};function j_(t,e){let r=0;for(let i=0;i<e.length;i++){let n=e[i];n===255?(r++,i++):r+=t[n]}return r}function U_(t,e,r){let i=new Uint32Array(e.length);for(let s=1;s<e.length;s++)i[s]=i[s-1]+e[s-1];let n=new Uint8Array(j_(e,r)),a=0;for(let s=0;s<r.length;s++){let o=r[s];if(o===255)s++,n[a++]=r[s];else{let l=e[o],u=i[o];for(;l-- >0;)n[a++]=t[u++]}}return n}var _0=class extends pc{constructor(t,e,r,i,n,a,s,o){super(t,r,i,s??e.length),this.indexBuffer=e,this.symbolOffsetBuffer=n,this.symbolTableBuffer=a,this.sharedDictionaryCache=o}getValueFromBuffer(t){this.decodedDictionary??(this.decodedDictionary=this.sharedDictionaryCache?.decodedDictionary,this.decodedDictionary??(this.decodedDictionary=this.decodeDictionary(),this.sharedDictionaryCache&&(this.sharedDictionaryCache.decodedDictionary=this.decodedDictionary)));let e=this.indexBuffer[t],r=this.offsetBuffer[e],i=this.offsetBuffer[e+1];return lc(this.decodedDictionary,r,i)}decodeDictionary(){return this.symbolLengthBuffer??=this.offsetToLengthBuffer(this.symbolOffsetBuffer),U_(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(t){let e=new Uint32Array(t.length-1),r=t[0];for(let i=1;i<t.length;i++){let n=t[i];e[i-1]=n-r,r=n}return e}};function D0(t,e,r,i,n){let a,s,o,l,u,c=n,h,p;for(let f=0;f<i;f++){let d=gt(e,r);switch(d.physicalStreamType){case Ct.PRESENT:{let y=new Ee(Ci(e,d.numValues,d.byteLength,r),d.numValues);c=n??y;break}case Ct.OFFSET:s=Vt(e,r,d,void 0,c);break;case Ct.LENGTH:{let y=hr(e,r,d);Bt.DICTIONARY===d.logicalStreamType.lengthType?a=y:Bt.SYMBOL===d.logicalStreamType.lengthType?l=y:h=y;break}case Ct.DATA:{let y=e.subarray(r.get(),r.get()+d.byteLength);r.add(d.byteLength);let m=d.logicalStreamType.dictionaryType;Yt.FSST===m?u=y:Yt.SINGLE===m||Yt.SHARED===m?o=y:Yt.NONE===m&&(p=y);break}}}return q_(t,u,s,a,o,l,c)??G_(t,o,s,a,c)??X_(t,h,p,s,c)}function q_(t,e,r,i,n,a,s){if(e){if(!r||!i||!n||!a)throw Error(`Incomplete FSST dictionary string column "${t}"`);return new _0(t,r,i,n,a,e,s)}}function G_(t,e,r,i,n){if(e){if(!r||!i)throw Error(`Incomplete dictionary string column "${t}"`);return n?new hi(t,r,i,e,n):new hi(t,r,i,e)}}function X_(t,e,r,i,n){if(e&&r){if(i)return n?new hi(t,i,e,r,n):new hi(t,i,e,r);if(n&&n.size()!==e.length-1){let a=new Uint32Array(n.size()),s=0;for(let o=0;o<n.size();o++)n.get(o)?a[o]=s++:a[o]=0;return new hi(t,a,e,r,n)}return n?new of(t,e,r,n):new of(t,e,r)}}function Y_(t,e,r,i){let n,a,s,o,l=!1;for(;!l;){let f=gt(t,e);switch(f.physicalStreamType){case Ct.LENGTH:Bt.DICTIONARY===f.logicalStreamType.lengthType?n=hr(t,e,f):s=hr(t,e,f);break;case Ct.DATA:Yt.SINGLE===f.logicalStreamType.dictionaryType||Yt.SHARED===f.logicalStreamType.dictionaryType?(a=t.subarray(e.get(),e.get()+f.byteLength),l=!0):o=t.subarray(e.get(),e.get()+f.byteLength),e.add(f.byteLength)}}if(r.type!=="complexType")throw Error(`Shared dictionary column ${r.name} must be a complex (struct) column.`);if(!n||!a)throw Error(`Incomplete shared dictionary for column "${r.name}"`);let u=r.complexType.children,c=[],h=o?{}:void 0,p=0;for(let f of u){let d=jt(t,e,1)[0];if(d===0)continue;let y=f.name?`${r.name}${f.name}`:r.name;if(i&&!i.has(y)){a0(d,t,e);continue}if(f.type!=="scalarField"||f.scalarField.physicalType!==nt.STRING)throw Error("Currently only scalar string fields are implemented for a struct.");if(d>1&&!f.nullable||d===1&&f.nullable)throw Error(`The number of streams for the child field ${f.name} does not match its nullability. nullibilty: ${f.nullable}, numStreams: ${d}`);let m;if(f.nullable){let x=gt(t,e);m=new Ee(Ci(t,x.numValues,x.byteLength,e),x.numValues)}let g=Vt(t,e,gt(t,e),void 0,m);if(o){if(!s)throw Error(`Incomplete shared FSST dictionary for column "${y}"`);c[p++]=new _0(y,g,n,a,s,o,m,h)}else c[p++]=new hi(y,g,n,a,m)}return c}var lf=class extends $r{constructor(t,e,r){super(t,new Uint8Array,r??e.length),this.values=e}getValueFromBuffer(t){return this.values[t]}},Ye;(function(t){t[t.STRING=1]="STRING",t[t.INT32=2]="INT32",t[t.UINT32=4]="UINT32",t[t.INT64=8]="INT64",t[t.UINT64=16]="UINT64",t[t.FLOAT=32]="FLOAT",t[t.DOUBLE=64]="DOUBLE",t[t.PRESENCE=128]="PRESENCE"})(Ye||={});var Fr;(function(t){t[t.FALSE=0]="FALSE",t[t.TRUE=1]="TRUE",t[t.START_MAP=2]="START_MAP",t[t.START_LIST=3]="START_LIST",t[t.COUNT=4]="COUNT"})(Fr||={});function W_(t,e,r,i){let n=Z_(r);if(i===0)return n.map(c=>new lf(c,[]));let a=H_(t,e,i),s=(a.presentStream?a.presentCount:a.lengthStream.length)/n.length,o=[],l=0,u=0;for(let c=0;c<n.length;c++){let h=eD(a,c,s,l,u);o.push(new lf(n[c],h.value,h.nullabilityBuffer)),l=h.countsEnd,u=h.valuesEnd}return o}function Z_(t){let e=t.type==="complexType"?t.complexType.children:void 0;return!e||e.length===0?[t.name]:e.map(r=>t.name+(r.name??""))}function H_(t,e,r){let i=t[e.get()];e.add(1);let n=Vt(t,e,gt(t,e)),a=r-1,s=[];i&Ye.STRING&&(a-=K_(t,e,s)),a-=J_(t,e,i,s),a-=Q_(t,e,i,s);let o,l=0;if(i&Ye.PRESENCE){let c=tD(t,e);o=c.value,l=c.count,a--}let u=new Uint32Array;if(a>0&&(u=Vt(t,e,gt(t,e)),a--),a!==0)throw Error(`Unexpected number of remaining streams while decoding map column: ${a}`);return{lengthStream:n,dictionary:s,presentStream:o,presentCount:l,flattenedValues:u}}function K_(t,e,r){let i=t[e.get()];e.add(1);let n=D0("",t,e,i);if(n)for(let a=0;a<n.size;a++)r.push(n.getValue(a));return i}function J_(t,e,r,i){let n=0;return r&Ye.INT32?(ai(i,Ja(t,e,gt(t,e))),n++):r&Ye.INT64&&(ai(i,c0(t,e,gt(t,e))),n++),r&Ye.UINT32?(ai(i,Vt(t,e,gt(t,e))),n++):r&Ye.UINT64&&(ai(i,cc(t,e,gt(t,e))),n++),n}function Q_(t,e,r,i){let n=0;return r&Ye.FLOAT&&(ai(i,s0(t,e,gt(t,e).numValues)),n++),r&Ye.DOUBLE&&(ai(i,o0(t,e,gt(t,e).numValues)),n++),n}function tD(t,e){let r=gt(t,e);if(r.physicalStreamType!==Ct.PRESENT)throw Error(`Expected PRESENT stream for map column but found: ${r.physicalStreamType}`);let i=r.numValues,n=e.get(),a=new Ee(Ci(t,i,r.byteLength,e),i);return e.set(n+r.byteLength),{value:a,count:i}}function eD(t,e,r,i,n){let{lengthStream:a,flattenedValues:s,presentStream:o,dictionary:l}=t,u=e*r,c=r,h;if(o){h=new Ee(new Uint8Array(Math.ceil(r/8)),r),c=0;for(let x=0;x<r;x++)o.get(u+x)&&(h.set(x,!0),c++)}let p=i+c;if(p>a.length)throw Error("Merged map counts underflow while decoding child streams");let f=Array(r),d=i,y=n;for(let x=0;x<r;x++){if(o&&!o.get(u+x)){f[x]=null;continue}let v=y+a[d++];if(v>s.length)throw Error("Map value stream underflow while decoding feature payload");let b=rD(s,y,v,l);f[x]=b.value,y=b.nextIndex}let m=0;for(let x=i;x<p;x++)m+=a[x];let g=n+m;if(y!==g)throw Error("Unused flattened map values remain after decode");return{value:f,nullabilityBuffer:h,countsEnd:p,valuesEnd:g}}function rD(t,e,r,i){return r-e===1||t[e]===Fr.START_LIST?fc(t,e,r,i):S0(t,e,r,i)}function S0(t,e,r,i){let n=Object.create(null),a=e;for(;a<r;){let s=A0(t[a++],i);if(typeof s!="string")throw Error(`Map key dictionary index does not resolve to a string: ${s}`);let o=fc(t,a,r,i);n[s]=o.value,a=o.nextIndex}return{value:n,nextIndex:a}}function fc(t,e,r,i){if(e>=r)throw Error("Unexpected end of map value stream");let n=t[e];if(n===Fr.FALSE)return{value:!1,nextIndex:e+1};if(n===Fr.TRUE)return{value:!0,nextIndex:e+1};if(n===Fr.START_MAP){let a=uf(t,e,r);return{value:S0(t,e+2,a,i).value,nextIndex:a}}if(n===Fr.START_LIST){let a=uf(t,e,r),s=[],o=e+2;for(;o<a;){let l=fc(t,o,a,i);s.push(l.value),o=l.nextIndex}return{value:s,nextIndex:a}}return{value:A0(n,i),nextIndex:e+1}}function uf(t,e,r){if(e+1>=r)throw Error("Missing length for nested map/list payload");let i=t[e+1];if(i<2)throw Error(`Invalid nested payload length: ${i}`);let n=e+i;if(n>r)throw Error("Nested payload exceeds containing payload bounds");return n}function A0(t,e){let r=t-Fr.COUNT;if(r<0||r>=e.length)throw Error(`Scalar dictionary index out of range: ${t}`);return e[r]}function ai(t,e){for(let r of e)t.push(r)}function iD(t,e,r,i,n,a){return r.type==="scalarType"?a&&!a.has(r.name)?(a0(i,t,e),null):nD(i,t,e,n,r.scalarType,r):r.complexType?.physicalType===mr.MAP?W_(t,e,r,i):i===0?null:Y_(t,e,r,a)}function nD(t,e,r,i,n,a){let s;if(t===0)return null;if(a.nullable){let l=gt(e,r),u=l.numValues,c=r.get(),h=Ci(e,u,l.byteLength,r);r.set(c+l.byteLength),s=new Ee(h,l.numValues)}let o=s??i;switch(n.physicalType){case nt.UINT_32:case nt.INT_32:return uD(e,r,a,n,o);case nt.STRING:{let l=a.nullable?t-1:t;return D0(a.name,e,r,l,s)??null}case nt.BOOLEAN:return aD(e,r,a,i,o);case nt.UINT_64:case nt.INT_64:return lD(e,r,a,o,n);case nt.FLOAT:return sD(e,r,a,o);case nt.DOUBLE:return oD(e,r,a,o);default:throw Error(`The specified data type for the field is currently not supported: ${n}`)}}function aD(t,e,r,i,n){let a=gt(t,e),s=a.numValues,o=e.get(),l=jn(n)?n:void 0,u=Ci(t,s,a.byteLength,e,l);e.set(o+a.byteLength);let c=new Ee(u,s);return new $_(r.name,c,n)}function sD(t,e,r,i){let n=gt(t,e),a=jn(i)?i:void 0,s=s0(t,e,n.numValues,a);return new N_(r.name,s,i)}function oD(t,e,r,i){let n=gt(t,e),a=jn(i)?i:void 0,s=o0(t,e,n.numValues,a);return new tc(r.name,s,i)}function lD(t,e,r,i,n){let a=gt(t,e),s=_s(a,i,t,e,"int64"),o=n.physicalType===nt.INT_64;if(s===yt.FLAT){let u=jn(i)?i:void 0,c=o?c0(t,e,a,u):cc(t,e,a,u);return new d0(r.name,c,i)}if(s===yt.SEQUENCE){let u=u0(t,e,a);return new y0(r.name,u[0],u[1],a.numRleValues,o)}let l=o?w_(t,e,a):h0(t,e,a);return new w0(r.name,l,i,o)}function uD(t,e,r,i,n){let a=gt(t,e),s=_s(a,n,t,e),o=i.physicalType===nt.INT_32;if(s===yt.FLAT){let u=jn(n)?n:void 0,c=o?Ja(t,e,a,void 0,u):Vt(t,e,a,void 0,u);return new Qu(r.name,c,n)}if(s===yt.SEQUENCE){let u=l0(t,e,a);return new ec(r.name,u[0],u[1],a.numRleValues,o)}let l=o?x_(t,e,a):uc(t,e,a);return new rc(r.name,l,n,o)}function jn(t){return t instanceof Ee}var Pt={ID:0,ID_NULLABLE:1,ID_LONG:2,GEOMETRY:4,SCALAR_BASE:10,STRUCT:30,MAP:31};function E0(t){switch(t){case Pt.ID:case Pt.ID|Pt.ID_NULLABLE:case Pt.ID|Pt.ID_LONG:case Pt.ID|Pt.ID_LONG|Pt.ID_NULLABLE:return{nullable:(t&Pt.ID_NULLABLE)!==0,columnScope:rn.FEATURE,type:"scalarType",scalarType:{longID:(t&Pt.ID_LONG)!==0,type:"logicalType",logicalType:Q1.ID}};case Pt.GEOMETRY:return{nullable:!1,columnScope:rn.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:mr.GEOMETRY,children:[]}};case Pt.STRUCT:return{nullable:!1,columnScope:rn.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:mr.STRUCT,children:[]}};case Pt.MAP:return{nullable:!0,columnScope:rn.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:mr.MAP,children:[]}};default:return dD(t)}}function cD(t){return t>=Pt.SCALAR_BASE}function T0(t){return t===Pt.STRUCT||t===Pt.MAP}function hD(t){if(t.type==="scalarType"){let e=t.scalarType;if(e.type==="physicalType")switch(e.physicalType){case nt.BOOLEAN:case nt.INT_8:case nt.UINT_8:case nt.INT_32:case nt.UINT_32:case nt.INT_64:case nt.UINT_64:case nt.FLOAT:case nt.DOUBLE:return!1;case nt.STRING:return!0;default:return!1}if(e.type==="logicalType")return!1}else if(t.type==="complexType"){let e=t.complexType;if(e.type==="physicalType")switch(e.physicalType){case mr.GEOMETRY:case mr.STRUCT:case mr.MAP:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",t),!1}function pD(t){return t.type==="scalarType"&&t.scalarType?.type==="logicalType"&&t.scalarType.logicalType===Q1.ID}function fD(t){return t.type==="complexType"&&t.complexType?.type==="physicalType"&&t.complexType.physicalType===mr.GEOMETRY}function dD(t){let e;switch(t){case 10:case 11:e=nt.BOOLEAN;break;case 12:case 13:e=nt.INT_8;break;case 14:case 15:e=nt.UINT_8;break;case 16:case 17:e=nt.INT_32;break;case 18:case 19:e=nt.UINT_32;break;case 20:case 21:e=nt.INT_64;break;case 22:case 23:e=nt.UINT_64;break;case 24:case 25:e=nt.FLOAT;break;case 26:case 27:e=nt.DOUBLE;break;case 28:case 29:e=nt.STRING;break;default:return null}return{nullable:!!(t&1),columnScope:rn.FEATURE,type:"scalarType",scalarType:{longID:!1,type:"physicalType",physicalType:e}}}var yD=new TextDecoder,cf="0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)";function dc(t,e){let r=jt(t,e,1)[0];if(r===0)return"";let i=e.get(),n=i+r,a=t.subarray(i,n);return e.add(r),yD.decode(a)}function mD(t){let e=t.name,r=t.nullable;return t.type==="scalarType"?{type:"scalarField",scalarField:t.scalarType,name:e,nullable:r}:{type:"complexField",complexField:t.complexType,name:e,nullable:r}}function F0(t,e){let r=jt(t,e,1)[0]>>>0,i=r>=Pt.SCALAR_BASE?E0(r):null;if(!i)throw Error(`Unsupported field type code ${r}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let n={...i,name:dc(t,e)};if(n.type==="complexType"&&T0(r)){let a=n.complexType,s=jt(t,e,1)[0]>>>0;a.children=Array(s);for(let o=0;o<s;o++)a.children[o]=F0(t,e)}return mD(n)}function gD(t,e){let r=jt(t,e,1)[0]>>>0,i=E0(r);if(!i)throw Error(`Unsupported column type code ${r}. Supported: ${cf}`);let n;if(cD(r))n=dc(t,e);else if(r<Pt.GEOMETRY)n="id";else if(r===Pt.GEOMETRY)n="geometry";else throw Error(`Unsupported column type code ${r}. Supported: ${cf}`);let a={...i,name:n};if(a.type==="complexType"&&T0(r)){let s=jt(t,e,1)[0]>>>0,o=a.complexType;o.children=Array(s);for(let l=0;l<s;l++)o.children[l]=F0(t,e)}return a}function xD(t,e){let r={};r.featureTables=[];let i={};if(i.name=dc(t,e),i.name.length===0)throw Error("Missing layer name");let n=jt(t,e,1)[0]>>>0,a=jt(t,e,1)[0]>>>0;i.columns=Array(a);for(let s=0;s<a;s++)i.columns[s]=gD(t,e);return r.featureTables.push(i),[r,n]}function vD(t,e,r=!0){let i=new t0(0),n=[];for(;i.get()<t.length;){let a=jt(t,i,1)[0]>>>0,s=i.get()+a;if(s>t.length)throw Error(`Block overruns tile: ${s} > ${t.length}`);let o=jt(t,i,1)[0]>>>0;if(o!==1&&o!==2){i.set(s);continue}let[l,u]=xD(t,i),c=l.featureTables[0],h=null,p=null,f=[],d=0;for(let m of c.columns){let g=m.name;if(pD(m)){let x=null;if(m.nullable){let b=gt(t,i),w=i.get(),_=Ci(t,b.numValues,b.byteLength,i);i.set(w+b.byteLength),x=new Ee(_,b.numValues)}let v=gt(t,i);d=x?x.size():v.decompressedCount,h=bD(t,m,i,g,v,x??d,r)}else if(fD(m)){let x=jt(t,i,1)[0];if(d===0){let v=i.get();d=gt(t,i).decompressedCount,i.set(v)}e&&(e.scale=e.extent/u),p=O_(t,x,i,d,e)}else{let x=hD(m)?jt(t,i,1)[0]:1;if(x===0)continue;let v=iD(t,i,m,x,d,void 0);if(v)if(Array.isArray(v))for(let b of v)f.push(b);else f.push(v)}}let y=new U5(c.name,p,h,f,u);n.push(y),i.set(s)}return n}function bD(t,e,r,i,n,a,s=!1){let o=e.scalarType?.longID?nt.UINT_64:nt.UINT_32,l=typeof a=="number"?void 0:a,u=_s(n,a,t,r,o===nt.UINT_64?"int64":"int32");if(o===nt.UINT_32)switch(u){case yt.FLAT:return new Qu(i,Vt(t,r,n,void 0,l),a);case yt.SEQUENCE:{let c=l0(t,r,n);return new ec(i,c[0],c[1],n.numRleValues,!1)}case yt.CONST:return new rc(i,uc(t,r,n),a,!1)}switch(u){case yt.FLAT:return s?new tc(i,v_(t,r,n,l),a):new d0(i,cc(t,r,n,l),a);case yt.SEQUENCE:{let c=u0(t,r,n);return new y0(i,c[0],c[1],n.numRleValues,!1)}case yt.CONST:return new w0(i,h0(t,r,n),a,!1)}throw Error("Vector type not supported for id column.")}var Do=e0(nc);Do/32*4,3*Do/256+Do|0;var wD=class{constructor(t,e){switch(this._featureData=t,this.properties=this._featureData.properties||{},this._featureData.geometry?.type){case $t.POINT:case $t.MULTIPOINT:this.type=1;break;case $t.LINESTRING:case $t.MULTILINESTRING:this.type=2;break;case $t.POLYGON:case $t.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=e,this.id=Number(this._featureData.id)}loadGeometry(){let t=[];for(let e of this._featureData.geometry.coordinates){let r=[];for(let i of e)r.push(new F(i.x,i.y));t.push(r)}return t}},_D=class{constructor(t){this.features=[],this.featureTable=t,this.name=t.name,this.extent=t.extent,this.version=2,this.features=t.getFeatures(),this.length=this.features.length}feature(t){return new wD(this.features[t],this.extent)}},C0=class{constructor(t){this.layers={};let e=vD(new Uint8Array(t));this.layers=e.reduce((r,i)=>({...r,[i.name]:new _D(i)}),{})}},I0=class{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Co(et,16,0),this.grid3D=new Co(et,16,0),this.featureIndexArray=new hy,this.promoteId=e}insert(t,e,r,i,n,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let o=a?this.grid3D:this.grid;for(let l of e){let u=[1/0,1/0,-1/0,-1/0];for(let c of l)u[0]=Math.min(u[0],c.x),u[1]=Math.min(u[1],c.y),u[2]=Math.max(u[2],c.x),u[3]=Math.max(u[3],c.y);u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&o.insert(s,u[0],u[1],u[2],u[3])}}loadVTLayers(){return this.vtLayers||(this.encoding==="mlt"?this.vtLayers=new C0(this.rawTileData).layers:this.vtLayers=new t1(new A1(this.rawTileData)).layers,this.sourceLayerCoder=new K1(this.vtLayers?Object.keys(this.vtLayers).sort():[Yl])),this.vtLayers}query(t,e,r,i){this.loadVTLayers();let n=t.params,a=et/t.tileSize/t.scale,s=gn(n.filter,"queryRenderedFeatures filter",n.globalState),o=t.queryGeometry,l=t.queryPadding*a,u=Sn.fromPoints(o),c=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),h=Sn.fromPoints(t.cameraQueryGeometry).expandBy(l),p=this.grid3D.query(h.minX,h.minY,h.maxX,h.maxY,(y,m,g,x)=>_2(t.cameraQueryGeometry,y-l,m-l,g+l,x+l));for(let y of p)c.push(y);c.sort(SD);let f={},d;for(let y of c){if(y===d)continue;d=y;let m=this.featureIndexArray.get(y),g=null;this.loadMatchingFeature(f,m.bucketIndex,m.sourceLayerIndex,m.featureIndex,s,n.layers,n.availableImages,e,r,t.worldCoordinateHelper,i,(x,v,b)=>(g||=Rr(x),v.queryIntersectsFeature({queryGeometry:o,feature:x,featureState:b,geometry:g,zoom:this.z,projectedCamera:t.projectedCamera,pixelsToTileUnits:a,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation})))}return f}loadMatchingFeature(t,e,r,i,n,a,s,o,l,u,c,h){let p=this.bucketLayerIDs[e];if(a&&!p.some(m=>a.has(m)))return;let f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(i);if(n.needGeometry){let m=Fi(d,!0);if(!n.filter(new ot(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!n.filter(new ot(this.tileID.overscaledZ),d))return;let y=this.getId(d,f);for(let m of p){if(a&&!a.has(m))continue;let g=o[m];if(!g)continue;let x={};y&&c&&(x=c.getState(g.sourceLayer||"_geojsonTileLayer",y));let v={...l[m]};v.paint=hf(v.paint,g.paint,d,x,s),v.layout=hf(v.layout,g.layout,d,x,s);let b=!h||h(d,g,x);if(!b)continue;let w=new j5(d,this.z,this.x,this.y,y,u);w.layer=v;let _=t[m];_===void 0&&(_=t[m]=[]),_.push({featureIndex:i,feature:w,intersectionZ:b})}}lookupSymbolFeatures(t,e,r,i,n,a,s,o){let l={};this.loadVTLayers();let u=gn(n.filterSpec,"queryRenderedFeatures symbol filter",n.globalState);for(let c of t)this.loadMatchingFeature(l,r,i,c,u,a,s,o,e,n.worldCoordinateHelper);return l}hasLayer(t){for(let e of this.bucketLayerIDs)for(let r of e)if(t===r)return!0;return!1}getId(t,e){let r=t.id;if(this.promoteId){let i=typeof this.promoteId=="string"?this.promoteId:this.promoteId[e];r=t.properties[i],typeof r=="boolean"&&(r=Number(r)),r===void 0&&t.properties?.cluster&&this.promoteId&&(r=Number(t.properties.cluster_id))}return r}};P("FeatureIndex",I0,{omit:["rawTileData","sourceLayerCoder"]});function DD(t){return typeof t=="object"&&!!t&&"evaluate"in t}function hf(t,e,r,i,n){return Object.fromEntries(Object.keys(t??{}).map(a=>{let s=e instanceof ps?e.get(a):null;return[a,DD(s)?s.evaluate(r,i,void 0,n):s]}))}function SD(t,e){return e-t}var AD=class{constructor(t,e){this.keyCache={},t&&this.replace(t,e)}replace(t,e){this._layerConfigs={},this._layers={},this.update(t,[],e)}update(t,e,r){for(let n of t){this._layerConfigs[n.id]=n;let a=this._layers[n.id]=P5(n,r);a._featureFilter=gn(a.filter,`layers[${n.id}].filter`,r),this.keyCache[n.id]&&delete this.keyCache[n.id]}for(let n of e)delete this.keyCache[n],delete this._layerConfigs[n],delete this._layers[n];this.familiesBySource=Object.create(null);let i=px(Object.values(this._layerConfigs),this.keyCache);for(let n of i){let a=n.map(h=>this._layers[h.id]),s=a[0];if(s.isHidden())continue;let o=s.source||"",l=this.familiesBySource[o];l||=this.familiesBySource[o]=Object.create(null);let u=s.sourceLayer||"_geojsonTileLayer",c=l[u];c||=l[u]=[],c.push(a)}}},k0=class{constructor(t){let e={},r=[];for(let s in t){let o=e[s]={};for(let l in t[s]){let u=t[s][l];o[l]={};for(let c in u){let h=u[c];if(!h||h.bitmap.width===0||h.bitmap.height===0)continue;let p={x:0,y:0,w:h.bitmap.width+2,h:h.bitmap.height+2};r.push(p),o[l][c]={rect:p,metrics:h.metrics}}}}let{w:i,h:n}=E1(r),a=new Dl({width:i||1,height:n||1});for(let s in t)for(let o in t[s]){let l=t[s][o];for(let u in l){let c=l[u];if(!c||c.bitmap.width===0||c.bitmap.height===0)continue;let h=e[s][o][u].rect;Dl.copy(c.bitmap,a,{x:0,y:0},{x:h.x+1,y:h.y+1},c.bitmap)}}this.image=a,this.positions=e}};P("GlyphAtlas",k0);var M0=class{constructor(t){this.tileID=new ys(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[]}async parse(t,e,r,i,n){this.data=t,this.collisionBoxArray=new ey;let a=new K1(Object.keys(t.layers).sort()),s=new I0(this.tileID,this.promoteId);s.bucketLayerIDs=[];let o={},l={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:r,subdivisionGranularity:n},u=e.familiesBySource[this.source];for(let A in u){let E=t.layers[A];if(!E)continue;E.version===1&&Mt(`Vector tile source "${this.source}" layer "${A}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let O=a.encode(A),k=[];for(let B=0;B<E.length;B++){let R=E.feature(B),I=s.getId(R,A);k.push({feature:R,id:I,index:B,sourceLayerIndex:O})}for(let B of u[A]){let R=B[0];R.source!==this.source&&Mt(`layer.source = ${R.source} does not equal this.source = ${this.source}`),R.isHidden(this.zoom,!0)||(pf(B,this.zoom,r),(o[R.id]=R.createBucket({index:s.bucketLayerIDs.length,layers:B,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:O,sourceID:this.source})).populate(k,l,this.tileID.canonical),s.bucketLayerIDs.push(B.map(I=>I.id)))}}let c=Object.fromEntries(Object.entries(l.glyphDependencies).map(([A,E])=>[A,Object.fromEntries(Object.entries(E).map(([O,k])=>[O,Object.keys(k)]))]));for(let A of this.inFlightDependencies)A?.abort();this.inFlightDependencies=[];let h=Promise.resolve({});if(Object.keys(c).length){let A=new AbortController;this.inFlightDependencies.push(A),h=i.sendAsync({type:"GG",data:{stacks:c,source:this.source,tileID:this.tileID,type:"glyphs"}},A)}let p=Object.keys(l.iconDependencies),f=Promise.resolve({});if(p.length){let A=new AbortController;this.inFlightDependencies.push(A),f=i.sendAsync({type:"GI",data:{icons:p,source:this.source,tileID:this.tileID,type:"icons"}},A)}let d=Object.keys(l.patternDependencies),y=Promise.resolve({});if(d.length){let A=new AbortController;this.inFlightDependencies.push(A),y=i.sendAsync({type:"GI",data:{icons:d,source:this.source,tileID:this.tileID,type:"patterns"}},A)}let m=l.dashDependencies,g=Promise.resolve({});if(Object.keys(m).length){let A=new AbortController;this.inFlightDependencies.push(A),g=i.sendAsync({type:"GDA",data:{dashes:m}},A)}let[x,v,b,w]=await Promise.all([h,f,y,g]),_=new k0(x),D=new F1(v,b);for(let A in o){let E=o[A];E.hasDependencies&&(pf(E.layers,this.zoom,r),E.addFeatures({options:l,canonical:this.tileID.canonical,glyphMap:x,glyphPositions:_.positions,iconMap:v,iconPositions:D.iconPositions,patternMap:b,patternPositions:D.patternPositions,dashPositions:w,showCollisionBoxes:this.showCollisionBoxes}))}return{buckets:Object.values(o).filter(A=>!A.isEmpty()),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:_.image,imageAtlas:D,dashPositions:w,glyphMap:this.returnDependencies?x:null,iconMap:this.returnDependencies?v:null,glyphPositions:this.returnDependencies?_.positions:null}}};function pf(t,e,r){let i=new ot(e);for(let n of t)n.recalculate(i,r)}var P0=class{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(t,e){this.loading[t]=e}finishLoading(t){delete this.loading[t]}abort(t){let e=this.loading[t];e?.abort&&(e.abort.abort(),delete this.loading[t])}getParsing(t){return this.parsing[t]}setParsing(t,e){this.parsing[t]=e}removeParsing(t){delete this.parsing[t]}markLoaded(t,e){this.loaded[t]=e}getLoaded(t){let e=this.loaded[t];if(e)return e}removeLoaded(t){delete this.loaded[t]}clearLoaded(){this.loaded={}}},ED=class{constructor(t){this.maxEntries=t,this.map=new Map}get(t){let e=this.map.get(t);return e!==void 0&&(this.map.delete(t),this.map.set(t,e)),e}set(t,e){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxEntries){let r=this.map.keys().next().value;this.map.delete(r)}this.map.set(t,e)}clear(){this.map.clear()}},B0=class{constructor(t){this.start=`${t}#start`,this.end=`${t}#end`,this.measure=t,performance.mark(this.start)}finish(){performance.mark(this.end);let t=performance.getEntriesByName(this.measure);return t.length===0&&(performance.measure(this.measure,this.start,this.end),t=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),t}},TD=class{constructor(t,e,r,i,n){this.type=t,this.properties=r||{},this.extent=n,this.pointsArray=e,this.id=i}loadGeometry(){return this.pointsArray.map(t=>t.map(e=>new F(e.x,e.y)))}},FD=class{constructor(t,e,r){this.version=2,this._myFeatures=t,this.name=e,this.length=t.length,this.extent=r}feature(t){return this._myFeatures[t]}},CD=class{constructor(){this.layers={}}addLayer(t){this.layers[t.name]=t}};function ID(t,e,r){let{extent:i}=t,n=2**(r.z-e.z),a=(r.x-e.x*n)*i,s=(r.y-e.y*n)*i,o=[];for(let l=0;l<t.length;l++){let u=t.feature(l),c=u.loadGeometry();for(let p of c)for(let f of p)f.x=f.x*n-a,f.y=f.y*n-s;let h=Math.max(128,Math.round(128*i/4096));c=W3(c,u.type,-h,-h,i+h,i+h),c.length!==0&&o.push(new TD(u.type,c,u.properties,u.id,i))}return new FD(o,t.name,i)}var kD=class{constructor(t,e,r){this.actor=t,this.layerIndex=e,this.availableImages=r,this.tileState=new P0,this.overzoomedTileResultCache=new ED(1e3)}loadVectorTile(t,e){try{return{vectorTile:t.encoding==="mlt"?new C0(e):new t1(new A1(e)),rawData:e}}catch(r){let i=new Uint8Array(e),n=i[0]===31&&i[1]===139,a=`Unable to parse the tile at ${t.request.url}, `;throw a+=n?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${Ma(r).message}`,Error(a)}}async loadTile(t){let{uid:e,overzoomParameters:r}=t;r&&(t.request=r.overzoomRequest);let i=this._startRequestTiming(t),n=new M0(t);this.tileState.startLoading(e,n);let a=new AbortController;n.abort=a;try{let s=await $x(t.request,a),o=this.tileState.getLoaded(e);if(t.etag&&t.etag===s.etag&&o?.etag===s.etag)return this.tileState.finishLoading(e),this._getEtagUnmodifiedResult(s,i);let l=this.loadVectorTile(t,s.data);if(this.tileState.finishLoading(e),!l)return null;let{vectorTile:u,rawData:c}=l;r&&({vectorTile:u,rawData:c}=this._getOverzoomTile(t,u));let h=this._getExpiryData(s),p=this._finishRequestTiming(i);n.vectorTile=u,n.etag=s.etag,this.tileState.markLoaded(e,n);let f={rawData:c,cacheControl:h,resourceTiming:p};return this.tileState.setParsing(e,f),await this._parseWorkerTile(n,t)}catch(s){throw this.tileState.finishLoading(e),this.tileState.markLoaded(e,n),s}}_getEtagUnmodifiedResult(t,e){let r=this._getExpiryData(t),i=this._finishRequestTiming(e);return{etagUnmodified:!0,...r,...i}}async _parseWorkerTile(t,e){let r=this.tileState.getParsing(t.uid),i=await t.parse(t.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);if(r){let{rawData:n,cacheControl:a,resourceTiming:s}=r,o=e.overzoomParameters?"mvt":e.encoding;i={rawTileData:n.slice(0),encoding:o,...i,...a,...s},this.tileState.removeParsing(t.uid)}else t.etag&&(i={...i,etag:t.etag});return i}_getExpiryData({expires:t,cacheControl:e,etag:r}){let i={};return t&&(i.expires=t),e&&(i.cacheControl=e),r&&(i.etag=r),i}_startRequestTiming(t){if(t.request?.collectResourceTiming)return new B0(t.request.url)}_finishRequestTiming(t){let e=t?.finish();return e?{resourceTiming:JSON.parse(JSON.stringify(e))}:{}}_getOverzoomTile(t,e){let{tileID:r,overzoomParameters:i}=t,{maxZoomTileID:n}=i,a=`${n.key}_${r.key}_${t.request?.url}`,s=this.overzoomedTileResultCache.get(a);if(s)return s;let o=new CD;for(let u of Object.values(e.layers)){let c=ID(u,n,r.canonical);c.length>0&&o.addLayer(c)}let l={vectorTile:o,rawData:H1(o).buffer};return this.overzoomedTileResultCache.set(a,l),l}async reloadTile(t){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)throw Error("Should not be trying to reload a tile that was never loaded or has been removed");if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,r.tileID=r.tileID.unwrapTo(t.tileID.wrap),await this._parseWorkerTile(r,t)}async abortTile(t){this.tileState.abort(t.uid)}async removeTile(t){this.tileState.removeLoaded(t.uid)}},MD=class{constructor(){this.loaded={}}async loadTile(t){let{uid:e,encoding:r,rawImageData:i,redFactor:n,greenFactor:a,blueFactor:s,baseShift:o}=t,l=i.width+4,u=i.height+4,c=new jy(e,au(i)?new ie({width:l,height:u},await mm(i,-2,-2,l,u)):i,r,n,a,s,o);return this.loaded||={},this.loaded[e]=c,c}removeTile(t){let e=this.loaded,r=t.uid;e?.[r]&&delete e[r]}},ff=class{constructor(t){this.wraps=!1,this._crs=t,this._originX=t.tileMatrixSet.origin[0],this._originY=t.tileMatrixSet.origin[1],this._extent=t.tileMatrixSet.extentAtZoom0}get name(){return this._crs.name}get tileMatrixSet(){return this._crs.tileMatrixSet}worldFromLngLat(t,e,r){let[i,n]=this._crs.projection.forward([t,e]);return new me((i-this._originX)/this._extent,(this._originY-n)/this._extent,r===void 0?0:r/this._extent)}lngLatFromWorld(t,e){let r=Gt(t,0,1),i=Gt(e,0,1),n=this._inverse(t,e)??this._inverse(r,i)??this._inverseTowardCenter(r,i)??this._finiteInverse(r,i);if(!n)throw Error(`The inverse of the projection "${this._crs.name}" has no answer inside its tile matrix set.`);return new dt(n[0],Gt(n[1],-90,90))}hasLngLat(t,e){let r=this._inverse(t,e);return r!==null&&Math.abs(r[1])<=90}_inverse(t,e){let r=this._finiteInverse(t,e);if(!r)return null;let i=this._originX+t*this._extent,n=this._originY-e*this._extent,[a,s]=this._crs.projection.forward(r);return Math.hypot(a-i,s-n)<=.001*this._extent?r:null}_finiteInverse(t,e){let r;try{r=this._crs.projection.inverse([this._originX+t*this._extent,this._originY-e*this._extent])}catch{return null}return r&&Number.isFinite(r[0])&&Number.isFinite(r[1])?r:null}_inverseTowardCenter(t,e){let r=0,i=1;for(let n=0;n<30;n++){let a=(r+i)/2;this._inverse(.5+(t-.5)*a,.5+(e-.5)*a)?r=a:i=a}return this._inverse(.5+(t-.5)*r,.5+(e-.5)*r)}metersPerWorldUnit(t,e){return this._extent}worldZFromAltitude(t,e){return t/this._extent}get latitudeRange(){return this._latitudeRange??=[this._findLatitudeLimit(-90),this._findLatitudeLimit(90)],this._latitudeRange}_findLatitudeLimit(t){let e=this.lngLatFromWorld(.5,.5),r=10*this._meridianStretch(e.lng,e.lat);if(!(r>0))return t;let i=Math.sign(t-e.lat);for(let n=e.lat;Math.abs(t-n)>1;n+=i)if(!(this._meridianStretch(e.lng,n+i)<=r))return n;return t}_meridianStretch(t,e){let[r,i]=this._crs.projection.forward([t,e]),[n,a]=this._crs.projection.forward([t,e>=0?e-.01:e+.01]);return Math.hypot(n-r,a-i)}},PD=class{forward(t){return[t[0],t[1]]}inverse(t){return[t[0],t[1]]}},BD=new class{constructor(){this.name="identity",this.projection=new PD,this.tileMatrixSet={origin:[-90,90],extentAtZoom0:180}}},Ql=null,ka=new Map;function zD(t){Ql=t,ka.clear()}function LD(t){if(!t.definition)return new ff(BD);if(!Ql)Mt("GeoJSON sources are drawn in the wrong place: no projection handler is set in the workers, see `setProjectionHandler` in the custom CRS guide.");else return ka.has(t.definition)||ka.set(t.definition,Ql(t.definition)),new ff({name:t.name,definition:t.definition,projection:ka.get(t.definition),tileMatrixSet:t.tileMatrixSet})}function tu(t,e){let r=([s,o,...l])=>{let{x:u,y:c}=e.worldFromLngLat(s,o);return[u,c,...l]},[i,n]=e.latitudeRange;if(i===-90&&n===90)return pi(t,r);let a=s=>s===i&&i>-90||s===n&&n<90;return pi(t,r,s=>{let o=!1,l=s.map(p=>p[1]>=i&&p[1]<=n?r(p):(o=!0,p));if(!o)return l;let u=[],c=0,h=NaN;for(let p=0;p<s.length;p++){let[f,d,...y]=s[p],m=Gt(d,i,n);if(m===h&&a(m)){let g=Math.ceil(Math.abs(f-c)/10);for(let x=1;x<g;x++)u.push(r([c+(f-c)*x/g,m]))}u.push(m===d?l[p]:r([f,m,...y])),c=f,h=m}return u})}function OD(t,e){return pi(t,([r,i,...n])=>{let a=e.lngLatFromWorld(r,i);return[a.lng,a.lat,...n]})}function VD(t,e){let r={...t};return t.add&&(r.add=t.add.map(i=>tu(i,e))),t.update&&(r.update=t.update.map(i=>i.newGeometry?{...i,newGeometry:tu(i.newGeometry,e)}:i)),r}function pi(t,e,r=i=>i.map(e)){if(!t||typeof t!="object")return t;switch(t.type){case"FeatureCollection":return{...t,features:t.features.map(i=>pi(i,e,r))};case"Feature":return{...t,geometry:t.geometry?pi(t.geometry,e,r):t.geometry};case"GeometryCollection":return{...t,geometries:t.geometries.map(i=>pi(i,e,r))};case"Point":return{...t,coordinates:e(t.coordinates)};case"MultiPoint":return{...t,coordinates:t.coordinates.map(e)};case"LineString":return{...t,coordinates:r(t.coordinates)};case"MultiLineString":case"Polygon":return{...t,coordinates:t.coordinates.map(i=>r(i))};case"MultiPolygon":return{...t,coordinates:t.coordinates.map(i=>i.map(n=>r(n)))};default:return t}}var RD=class{constructor(t,e,r,i=$D){this.actor=t,this.layerIndex=e,this.availableImages=r,this.tileState=new P0,this._createGeoJSONIndex=i}loadVectorTile(t){if(!this._geoJSONIndex)throw Error("Unable to parse the data into a cluster or geojson");let{z:e,x:r,y:i}=t.tileID.canonical,n=this._geoJSONIndex.getTile(e,r,i);if(!n)return null;let a=new z5(n.features,{version:2,extent:et});return{vectorTile:a,rawData:H1(a,"__$json__:").buffer}}async loadTile(t){let{uid:e}=t,r=new M0(t);r.abort=new AbortController;try{let i=this.loadVectorTile(t);if(!i)return null;let{vectorTile:n,rawData:a}=i;r.vectorTile=n,this.tileState.markLoaded(e,r);let s={rawData:a};return this.tileState.setParsing(e,s),await this._parseWorkerTile(r,t)}catch(i){throw this.tileState.markLoaded(e,r),i}}async _parseWorkerTile(t,e){let r=this.tileState.getParsing(t.uid),i=await t.parse(t.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);if(r){let{rawData:n}=r;i={rawTileData:n.slice(0),encoding:"mvt",...i},this.tileState.removeParsing(t.uid)}return i}async abortTile(t){this.tileState.abort(t.uid)}async removeTile(t){this.tileState.removeLoaded(t.uid)}async loadData(t){this._pendingRequest?.abort();let e=this._startRequestTiming(t);this._pendingRequest=new AbortController;try{await this.loadAndProcessGeoJSON(t,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let r={};return t.request&&(r.data=t.data),this._finishRequestTiming(e,t,r),r}catch(r){if(delete this._pendingRequest,!_f(r))throw r;return{abandoned:!0}}}_startRequestTiming(t){if(t.request?.collectResourceTiming)return new B0(t.request.url)}_finishRequestTiming(t,e,r){let i=t?.finish();i&&(r.resourceTiming={[e.source]:JSON.parse(JSON.stringify(i))})}async reloadTile(t){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)return await this.loadTile(t);if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,r.tileID=r.tileID.unwrapTo(t.tileID.wrap),await this._parseWorkerTile(r,t)}async loadAndProcessGeoJSON(t,e){if(t.request&&(t.data=(await Rx(t.request,e)).data),this._crsHelper=t.crs?LD(t.crs):void 0,t.data){t.data=this._filterGeoJSON(t.data,t.filter,t.source);let r=this._crsHelper?tu(t.data,this._crsHelper):t.data;this._geoJSONIndex=this._createGeoJSONIndex(r,t,this._crsHelper!==void 0)}else{if(t.dataDiff){this._geoJSONIndex??=this._createGeoJSONIndex({type:"FeatureCollection",features:[]},t,this._crsHelper!==void 0);let r=this._crsHelper?VD(t.dataDiff,this._crsHelper):t.dataDiff;this._geoJSONIndex.updateData(r,this._getFilterPredicate(t.filter,t.source))}if(t.updateCluster&&this._geoJSONIndex.updateClusterOptions(t.geojsonVtOptions.cluster,z0(t)),this._geoJSONIndex==null)throw Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`)}}_filterGeoJSON(t,e,r){if(t.type!=="FeatureCollection")return t;let i=this._getFilterPredicate(e,r);return i?{type:"FeatureCollection",features:t.features.filter(n=>i(n))}:t}_getFilterPredicate(t,e){if(typeof t!="boolean"&&!t?.length)return;let r=Br(t,`sources.${e}.filter`,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(r.result==="error")throw Error(r.value.map(i=>`${i.key}: ${i.message}`).join(", "));return i=>r.value.evaluate({zoom:0},i)}async removeSource(t){this._pendingRequest?.abort()}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._toLngLat(this._geoJSONIndex.getClusterChildren(t.clusterId))}getClusterLeaves(t){return this._toLngLat(this._geoJSONIndex.getClusterLeaves(t.clusterId,t.limit,t.offset))}_toLngLat(t){return this._crsHelper?t.map(e=>OD(e,this._crsHelper)):t}};function $D(t,e,r){return new nw(t,{...e.geojsonVtOptions,updateable:!0,clusterOptions:z0(e),coordinates:r?"unitSquare":"lngLat",wrap:!r})}function z0({geojsonVtOptions:t,clusterProperties:e,source:r}){if(!e||!t.clusterOptions)return t.clusterOptions;let i={},n={},a={accumulated:null,zoom:0},s={properties:null},o=Object.keys(e);for(let l of o){let[u,c]=e[l],h=Br(c,`sources.${r}.clusterProperties.${l}[1]`),p=Br(typeof u=="string"?[u,["accumulated"],["get",l]]:u,`sources.${r}.clusterProperties.${l}[0]`);i[l]=h.value,n[l]=p.value}return t.clusterOptions.map=l=>{s.properties=l;let u={};for(let c of o)u[c]=i[c].evaluate(a,s);return u},t.clusterOptions.reduce=(l,u)=>{s.properties=u;for(let c of o)a.accumulated=l[c],l[c]=n[c].evaluate(a,s)},t.clusterOptions}async function ND(t){if(t.endsWith(".mjs")){await import(t);return}let e=await fetch(t,{credentials:"same-origin"});if(!e.ok)throw Error(`Failed to load ${t}: ${e.status}`);let r=await e.text();if(/^[ \t]*(import|export)\s/m.test(r)){let i=URL.createObjectURL(new Blob([r],{type:"text/javascript"}));try{await import(i)}finally{URL.revokeObjectURL(i)}}else globalThis.eval(r)}var jD=class{constructor(t){this.self=t,this.actor=new qx(t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.importedScripts=new Map,this.self.registerWorkerSource=(e,r)=>{if(this.externalWorkerSourceTypes[e])throw Error(`Worker source with name "${e}" already registered.`);this.externalWorkerSourceTypes[e]=r},this.self.addProtocol=Bx,this.self.removeProtocol=zx,this.self.registerRTLTextPlugin=e=>{Si.setMethods(e)},this.self.makeRequest=Cu,this.self.setProjectionHandler=zD,this.actor.registerMessageHandler("LDT",(e,r)=>this._getDEMWorkerSource(e,r.source).loadTile(r)),this.actor.registerMessageHandler("RDT",async(e,r)=>{this._getDEMWorkerSource(e,r.source).removeTile(r)}),this.actor.registerMessageHandler("GCEZ",async(e,r)=>this._getWorkerSource(e,r.type,r.source).getClusterExpansionZoom(r)),this.actor.registerMessageHandler("GCC",async(e,r)=>this._getWorkerSource(e,r.type,r.source).getClusterChildren(r)),this.actor.registerMessageHandler("GCL",async(e,r)=>this._getWorkerSource(e,r.type,r.source).getClusterLeaves(r)),this.actor.registerMessageHandler("LD",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadData(r)),this.actor.registerMessageHandler("LT",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadTile(r)),this.actor.registerMessageHandler("RT",(e,r)=>this._getWorkerSource(e,r.type,r.source).reloadTile(r)),this.actor.registerMessageHandler("AT",(e,r)=>this._getWorkerSource(e,r.type,r.source).abortTile(r)),this.actor.registerMessageHandler("RMT",(e,r)=>this._getWorkerSource(e,r.type,r.source).removeTile(r)),this.actor.registerMessageHandler("RS",async(e,r)=>{if(!this.workerSources[e]?.[r.type]?.[r.source])return;let i=this.workerSources[e][r.type][r.source];delete this.workerSources[e][r.type][r.source],i.removeSource!==void 0&&i.removeSource(r)}),this.actor.registerMessageHandler("RM",async e=>{delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],this.globalStates.delete(e)}),this.actor.registerMessageHandler("SR",async(e,r)=>{this.referrer=r}),this.actor.registerMessageHandler("PI",async()=>{}),this.actor.registerMessageHandler("SRPS",(e,r)=>this._syncRTLPluginState(e,r)),this.actor.registerMessageHandler("IS",(e,r)=>this._importScript(r)),this.actor.registerMessageHandler("SI",(e,r)=>this._setImages(e,r)),this.actor.registerMessageHandler("UL",async(e,r)=>{this._getLayerIndex(e).update(r.layers,r.removedIds,this._getGlobalState(e))}),this.actor.registerMessageHandler("UGS",async(e,r)=>{let i=this._getGlobalState(e);for(let n in r)i[n]=r[n]}),this.actor.registerMessageHandler("SL",async(e,r)=>{this._getLayerIndex(e).replace(r,this._getGlobalState(e))})}async _importScript(t){let e=this.importedScripts.get(t);if(e)return e;let r=ND(t);this.importedScripts.set(t,r);try{await r}catch(i){throw this.importedScripts.delete(t),i}}_getGlobalState(t){let e=this.globalStates.get(t);return e||(e={},this.globalStates.set(t,e)),e}async _setImages(t,e){this.availableImages[t]=e;for(let r in this.workerSources[t]){let i=this.workerSources[t][r];for(let n in i)i[n].availableImages=e}}async _syncRTLPluginState(t,e){return await Si.syncState(e,r=>this._importScript(r))}_getAvailableImages(t){let e=this.availableImages[t];return e||=[],e}_getLayerIndex(t){let e=this.layerIndexes[t];return e||=this.layerIndexes[t]=new AD,e}_getWorkerSource(t,e,r){if(this.workerSources[t]||={},this.workerSources[t][e]||={},!this.workerSources[t][e][r]){let i={sendAsync:(n,a)=>(n.targetMapId=t,this.actor.sendAsync(n,a))};switch(e){case"vector":this.workerSources[t][e][r]=new kD(i,this._getLayerIndex(t),this._getAvailableImages(t));break;case"geojson":this.workerSources[t][e][r]=new RD(i,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][r]=new this.externalWorkerSourceTypes[e](i,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][r]}_getDEMWorkerSource(t,e){return this.demWorkerSources[t]||={},this.demWorkerSources[t][e]||=new MD,this.demWorkerSources[t][e]}};fi(self)&&(self.worker=new jD(self));export{jD as default};