@toclocoinc/lattice-grid 1.89.0 → 1.89.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +1 -1
  3. package/angular/package.json +1 -1
  4. package/docs/API.html +5 -5
  5. package/docs/THEMING.md +27 -0
  6. package/docs/api/adapters.html +1 -1
  7. package/docs/api/ai.html +1 -1
  8. package/docs/api/alarms.html +1 -1
  9. package/docs/api/calendar.html +1 -1
  10. package/docs/api/charts.html +1 -1
  11. package/docs/api/dashboard.html +1 -1
  12. package/docs/api/data-router.html +1 -1
  13. package/docs/api/deckgl.html +1 -1
  14. package/docs/api/designer.html +2 -2
  15. package/docs/api/gantt.html +1 -1
  16. package/docs/api/geometry.html +1 -1
  17. package/docs/api/grid.html +2 -2
  18. package/docs/api/index.html +1 -1
  19. package/docs/api/kanban.html +1 -1
  20. package/docs/api/kpi.html +1 -1
  21. package/docs/api/layout.html +1 -1
  22. package/docs/api/leaflet.html +1 -1
  23. package/docs/api/list.html +1 -1
  24. package/docs/api/mapview.html +1 -1
  25. package/docs/api/mock-socket.html +1 -1
  26. package/docs/api/presets.html +1 -1
  27. package/docs/api/tabs.html +1 -1
  28. package/docs/api/types.html +1 -1
  29. package/docs/api-detail.html +4 -4
  30. package/docs/warnings.json +1 -1
  31. package/lattice-grid.d.ts +1 -1
  32. package/lattice-grid.esm.min.js +3 -3
  33. package/lattice-grid.min.cjs +3 -3
  34. package/lattice-grid.min.css +1 -1
  35. package/lattice-grid.min.js +3 -3
  36. package/modules/ai.d.ts +1 -1
  37. package/modules/ai.esm.min.js +2 -2
  38. package/modules/ai.min.cjs +2 -2
  39. package/modules/ai.min.js +2 -2
  40. package/modules/alarms.d.ts +1 -1
  41. package/modules/alarms.esm.min.js +2 -2
  42. package/modules/alarms.min.cjs +2 -2
  43. package/modules/alarms.min.js +2 -2
  44. package/modules/angular.d.ts +1 -1
  45. package/modules/angular.esm.min.js +2 -2
  46. package/modules/angular.min.cjs +2 -2
  47. package/modules/angular.min.js +2 -2
  48. package/modules/calendar.d.ts +1 -1
  49. package/modules/calendar.esm.min.js +2 -2
  50. package/modules/calendar.min.cjs +2 -2
  51. package/modules/calendar.min.js +2 -2
  52. package/modules/chart-alluvial.d.ts +1 -1
  53. package/modules/chart-alluvial.esm.min.js +1 -1
  54. package/modules/chart-alluvial.min.cjs +1 -1
  55. package/modules/chart-alluvial.min.js +1 -1
  56. package/modules/chart-arc.d.ts +1 -1
  57. package/modules/chart-arc.esm.min.js +1 -1
  58. package/modules/chart-arc.min.cjs +1 -1
  59. package/modules/chart-arc.min.js +1 -1
  60. package/modules/chart-barrace.d.ts +1 -1
  61. package/modules/chart-barrace.esm.min.js +1 -1
  62. package/modules/chart-barrace.min.cjs +1 -1
  63. package/modules/chart-barrace.min.js +1 -1
  64. package/modules/chart-bubblemap.d.ts +1 -1
  65. package/modules/chart-bubblemap.esm.min.js +1 -1
  66. package/modules/chart-bubblemap.min.cjs +1 -1
  67. package/modules/chart-bubblemap.min.js +1 -1
  68. package/modules/chart-bump.d.ts +1 -1
  69. package/modules/chart-bump.esm.min.js +1 -1
  70. package/modules/chart-bump.min.cjs +1 -1
  71. package/modules/chart-bump.min.js +1 -1
  72. package/modules/chart-calendar.d.ts +1 -1
  73. package/modules/chart-calendar.esm.min.js +1 -1
  74. package/modules/chart-calendar.min.cjs +1 -1
  75. package/modules/chart-calendar.min.js +1 -1
  76. package/modules/chart-choropleth.d.ts +1 -1
  77. package/modules/chart-choropleth.esm.min.js +1 -1
  78. package/modules/chart-choropleth.min.cjs +1 -1
  79. package/modules/chart-choropleth.min.js +1 -1
  80. package/modules/chart-decomposition.d.ts +1 -1
  81. package/modules/chart-decomposition.esm.min.js +1 -1
  82. package/modules/chart-decomposition.min.cjs +1 -1
  83. package/modules/chart-decomposition.min.js +1 -1
  84. package/modules/chart-diverging.d.ts +1 -1
  85. package/modules/chart-diverging.esm.min.js +1 -1
  86. package/modules/chart-diverging.min.cjs +1 -1
  87. package/modules/chart-diverging.min.js +1 -1
  88. package/modules/chart-dumbbell.d.ts +1 -1
  89. package/modules/chart-dumbbell.esm.min.js +1 -1
  90. package/modules/chart-dumbbell.min.cjs +1 -1
  91. package/modules/chart-dumbbell.min.js +1 -1
  92. package/modules/chart-fan.d.ts +1 -1
  93. package/modules/chart-fan.esm.min.js +1 -1
  94. package/modules/chart-fan.min.cjs +1 -1
  95. package/modules/chart-fan.min.js +1 -1
  96. package/modules/chart-forcetree.d.ts +1 -1
  97. package/modules/chart-forcetree.esm.min.js +1 -1
  98. package/modules/chart-forcetree.min.cjs +1 -1
  99. package/modules/chart-forcetree.min.js +1 -1
  100. package/modules/chart-hexbin.d.ts +1 -1
  101. package/modules/chart-hexbin.esm.min.js +1 -1
  102. package/modules/chart-hexbin.min.cjs +1 -1
  103. package/modules/chart-hexbin.min.js +1 -1
  104. package/modules/chart-hexmap.d.ts +1 -1
  105. package/modules/chart-hexmap.esm.min.js +1 -1
  106. package/modules/chart-hexmap.min.cjs +1 -1
  107. package/modules/chart-hexmap.min.js +1 -1
  108. package/modules/chart-icicle.d.ts +1 -1
  109. package/modules/chart-icicle.esm.min.js +1 -1
  110. package/modules/chart-icicle.min.cjs +1 -1
  111. package/modules/chart-icicle.min.js +1 -1
  112. package/modules/chart-markermap.d.ts +1 -1
  113. package/modules/chart-markermap.esm.min.js +1 -1
  114. package/modules/chart-markermap.min.cjs +1 -1
  115. package/modules/chart-markermap.min.js +1 -1
  116. package/modules/chart-motion.d.ts +1 -1
  117. package/modules/chart-motion.esm.min.js +1 -1
  118. package/modules/chart-motion.min.cjs +1 -1
  119. package/modules/chart-motion.min.js +1 -1
  120. package/modules/chart-pack.d.ts +1 -1
  121. package/modules/chart-pack.esm.min.js +1 -1
  122. package/modules/chart-pack.min.cjs +1 -1
  123. package/modules/chart-pack.min.js +1 -1
  124. package/modules/chart-parallel.d.ts +1 -1
  125. package/modules/chart-parallel.esm.min.js +1 -1
  126. package/modules/chart-parallel.min.cjs +1 -1
  127. package/modules/chart-parallel.min.js +1 -1
  128. package/modules/chart-pictorial.d.ts +1 -1
  129. package/modules/chart-pictorial.esm.min.js +1 -1
  130. package/modules/chart-pictorial.min.cjs +1 -1
  131. package/modules/chart-pictorial.min.js +1 -1
  132. package/modules/chart-polararea.d.ts +1 -1
  133. package/modules/chart-polararea.esm.min.js +1 -1
  134. package/modules/chart-polararea.min.cjs +1 -1
  135. package/modules/chart-polararea.min.js +1 -1
  136. package/modules/chart-polarscatter.d.ts +1 -1
  137. package/modules/chart-polarscatter.esm.min.js +1 -1
  138. package/modules/chart-polarscatter.min.cjs +1 -1
  139. package/modules/chart-polarscatter.min.js +1 -1
  140. package/modules/chart-pyramid.d.ts +1 -1
  141. package/modules/chart-pyramid.esm.min.js +1 -1
  142. package/modules/chart-pyramid.min.cjs +1 -1
  143. package/modules/chart-pyramid.min.js +1 -1
  144. package/modules/chart-radialbar.d.ts +1 -1
  145. package/modules/chart-radialbar.esm.min.js +1 -1
  146. package/modules/chart-radialbar.min.cjs +1 -1
  147. package/modules/chart-radialbar.min.js +1 -1
  148. package/modules/chart-ridgeline.d.ts +1 -1
  149. package/modules/chart-ridgeline.esm.min.js +1 -1
  150. package/modules/chart-ridgeline.min.cjs +1 -1
  151. package/modules/chart-ridgeline.min.js +1 -1
  152. package/modules/chart-roc.d.ts +1 -1
  153. package/modules/chart-roc.esm.min.js +1 -1
  154. package/modules/chart-roc.min.cjs +1 -1
  155. package/modules/chart-roc.min.js +1 -1
  156. package/modules/chart-serpentine.d.ts +1 -1
  157. package/modules/chart-serpentine.esm.min.js +1 -1
  158. package/modules/chart-serpentine.min.cjs +1 -1
  159. package/modules/chart-serpentine.min.js +1 -1
  160. package/modules/chart-slope.d.ts +1 -1
  161. package/modules/chart-slope.esm.min.js +1 -1
  162. package/modules/chart-slope.min.cjs +1 -1
  163. package/modules/chart-slope.min.js +1 -1
  164. package/modules/chart-spiral.d.ts +1 -1
  165. package/modules/chart-spiral.esm.min.js +1 -1
  166. package/modules/chart-spiral.min.cjs +1 -1
  167. package/modules/chart-spiral.min.js +1 -1
  168. package/modules/chart-splom.d.ts +1 -1
  169. package/modules/chart-splom.esm.min.js +1 -1
  170. package/modules/chart-splom.min.cjs +1 -1
  171. package/modules/chart-splom.min.js +1 -1
  172. package/modules/chart-tree.d.ts +1 -1
  173. package/modules/chart-tree.esm.min.js +1 -1
  174. package/modules/chart-tree.min.cjs +1 -1
  175. package/modules/chart-tree.min.js +1 -1
  176. package/modules/chart-venn.d.ts +1 -1
  177. package/modules/chart-venn.esm.min.js +1 -1
  178. package/modules/chart-venn.min.cjs +1 -1
  179. package/modules/chart-venn.min.js +1 -1
  180. package/modules/chart-voronoi.d.ts +1 -1
  181. package/modules/chart-voronoi.esm.min.js +1 -1
  182. package/modules/chart-voronoi.min.cjs +1 -1
  183. package/modules/chart-voronoi.min.js +1 -1
  184. package/modules/chart-waffle.d.ts +1 -1
  185. package/modules/chart-waffle.esm.min.js +1 -1
  186. package/modules/chart-waffle.min.cjs +1 -1
  187. package/modules/chart-waffle.min.js +1 -1
  188. package/modules/chart-wordcloud.d.ts +1 -1
  189. package/modules/chart-wordcloud.esm.min.js +1 -1
  190. package/modules/chart-wordcloud.min.cjs +1 -1
  191. package/modules/chart-wordcloud.min.js +1 -1
  192. package/modules/charts.d.ts +1 -1
  193. package/modules/charts.esm.min.js +2 -2
  194. package/modules/charts.min.cjs +2 -2
  195. package/modules/charts.min.js +2 -2
  196. package/modules/dashboard.d.ts +1 -1
  197. package/modules/dashboard.esm.min.js +2 -2
  198. package/modules/dashboard.min.cjs +2 -2
  199. package/modules/dashboard.min.js +2 -2
  200. package/modules/data-router.d.ts +1 -1
  201. package/modules/data-router.esm.min.js +2 -2
  202. package/modules/data-router.min.cjs +2 -2
  203. package/modules/data-router.min.js +2 -2
  204. package/modules/deckgl.d.ts +1 -1
  205. package/modules/deckgl.esm.min.js +2 -2
  206. package/modules/deckgl.min.cjs +2 -2
  207. package/modules/deckgl.min.js +2 -2
  208. package/modules/designer.d.ts +1 -1
  209. package/modules/designer.esm.min.js +187 -73
  210. package/modules/designer.esm.min.js.map +2 -2
  211. package/modules/designer.min.cjs +187 -73
  212. package/modules/designer.min.js +187 -73
  213. package/modules/designer.min.js.map +2 -2
  214. package/modules/devtools.d.ts +1 -1
  215. package/modules/devtools.esm.min.js +1 -1
  216. package/modules/devtools.min.cjs +1 -1
  217. package/modules/devtools.min.js +1 -1
  218. package/modules/dhtmlx-compat.d.ts +1 -1
  219. package/modules/dhtmlx-compat.esm.min.js +2 -2
  220. package/modules/dhtmlx-compat.min.cjs +2 -2
  221. package/modules/dhtmlx-compat.min.js +2 -2
  222. package/modules/gantt.d.ts +1 -1
  223. package/modules/gantt.esm.min.js +2 -2
  224. package/modules/gantt.min.cjs +2 -2
  225. package/modules/gantt.min.js +2 -2
  226. package/modules/geo-europe-nuts.d.ts +1 -1
  227. package/modules/geo-europe-nuts.esm.min.js +1 -1
  228. package/modules/geo-europe-nuts.min.cjs +1 -1
  229. package/modules/geo-europe-nuts.min.js +1 -1
  230. package/modules/geo-uk.d.ts +1 -1
  231. package/modules/geo-uk.esm.min.js +1 -1
  232. package/modules/geo-uk.min.cjs +1 -1
  233. package/modules/geo-uk.min.js +1 -1
  234. package/modules/geo-us-states.d.ts +1 -1
  235. package/modules/geo-us-states.esm.min.js +1 -1
  236. package/modules/geo-us-states.min.cjs +1 -1
  237. package/modules/geo-us-states.min.js +1 -1
  238. package/modules/geo-world-110m.d.ts +1 -1
  239. package/modules/geo-world-110m.esm.min.js +1 -1
  240. package/modules/geo-world-110m.min.cjs +1 -1
  241. package/modules/geo-world-110m.min.js +1 -1
  242. package/modules/geo-world-50m.d.ts +1 -1
  243. package/modules/geo-world-50m.esm.min.js +1 -1
  244. package/modules/geo-world-50m.min.cjs +1 -1
  245. package/modules/geo-world-50m.min.js +1 -1
  246. package/modules/geometry.d.ts +1 -1
  247. package/modules/geometry.esm.min.js +2 -2
  248. package/modules/geometry.min.cjs +2 -2
  249. package/modules/geometry.min.js +2 -2
  250. package/modules/htmx.d.ts +1 -1
  251. package/modules/htmx.esm.min.js +3 -3
  252. package/modules/htmx.min.cjs +3 -3
  253. package/modules/htmx.min.js +3 -3
  254. package/modules/kanban.d.ts +1 -1
  255. package/modules/kanban.esm.min.js +2 -2
  256. package/modules/kanban.min.cjs +2 -2
  257. package/modules/kanban.min.js +2 -2
  258. package/modules/kpi.d.ts +1 -1
  259. package/modules/kpi.esm.min.js +2 -2
  260. package/modules/kpi.min.cjs +2 -2
  261. package/modules/kpi.min.js +2 -2
  262. package/modules/layout.d.ts +1 -1
  263. package/modules/layout.esm.min.js +2 -2
  264. package/modules/layout.min.cjs +2 -2
  265. package/modules/layout.min.js +2 -2
  266. package/modules/leaflet.d.ts +1 -1
  267. package/modules/leaflet.esm.min.js +2 -2
  268. package/modules/leaflet.min.cjs +2 -2
  269. package/modules/leaflet.min.js +2 -2
  270. package/modules/list.d.ts +1 -1
  271. package/modules/list.esm.min.js +2 -2
  272. package/modules/list.min.cjs +2 -2
  273. package/modules/list.min.js +2 -2
  274. package/modules/mapview.d.ts +1 -1
  275. package/modules/mapview.esm.min.js +2 -2
  276. package/modules/mapview.min.cjs +2 -2
  277. package/modules/mapview.min.js +2 -2
  278. package/modules/mock-socket.d.ts +1 -1
  279. package/modules/mock-socket.esm.min.js +1 -1
  280. package/modules/mock-socket.min.cjs +1 -1
  281. package/modules/mock-socket.min.js +1 -1
  282. package/modules/presets/antd5.css +9 -0
  283. package/modules/presets/bootstrap5.css +9 -0
  284. package/modules/presets/fluent2.css +9 -0
  285. package/modules/presets/material3.css +9 -0
  286. package/modules/presets.d.ts +1 -1
  287. package/modules/presets.esm.min.js +2 -2
  288. package/modules/presets.min.cjs +2 -2
  289. package/modules/presets.min.js +2 -2
  290. package/modules/react.d.ts +1 -1
  291. package/modules/react.esm.min.js +2 -2
  292. package/modules/react.min.cjs +2 -2
  293. package/modules/react.min.js +2 -2
  294. package/modules/svelte.d.ts +1 -1
  295. package/modules/svelte.esm.min.js +2 -2
  296. package/modules/svelte.min.cjs +2 -2
  297. package/modules/svelte.min.js +2 -2
  298. package/modules/tabs.d.ts +1 -1
  299. package/modules/tabs.esm.min.js +2 -2
  300. package/modules/tabs.min.cjs +2 -2
  301. package/modules/tabs.min.js +2 -2
  302. package/modules/vue.d.ts +1 -1
  303. package/modules/vue.esm.min.js +2 -2
  304. package/modules/vue.min.cjs +2 -2
  305. package/modules/vue.min.js +2 -2
  306. package/modules/webcomponent.d.ts +1 -1
  307. package/modules/webcomponent.esm.min.js +3 -3
  308. package/modules/webcomponent.min.cjs +3 -3
  309. package/modules/webcomponent.min.js +3 -3
  310. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * Lattice Grid 1.89.0, geometry module
2
+ * Lattice Grid 1.89.1, geometry module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
6
- (function(Le){"use strict";var Ae=Object.create(null),Ne=Object.create(null);function fe(u,R){Ae[u]=R}function ke(u){var R=Ne[u];if(R)return R;var T=Object.create(null);Ne[u]=T;var $=Ae[u];if(!$)throw new Error("[lattice] missing module: "+u);return $(T,ke),T}var Re=Object.create(null);Re["@toclocoinc/lattice-grid"]=Le.LatticeGrid||null;function Ge(u){var R=Re[u],T=typeof globalThis<"u"?globalThis:typeof self<"u"?self:null;if(R)return R;if(u==="@toclocoinc/lattice-grid"&&T&&T.LatticeGrid)return T.LatticeGrid;throw new Error("[lattice] this module shares the Lattice core with the page, but it was not found. Load lattice-grid (or its script build) before this module. Missing: "+u)}fe("packages/core/src/internal/util.js",function(u,R){"use strict";Object.defineProperty(u,"VERSION",{enumerable:!0,get:function(){return z}}),Object.defineProperty(u,"reportedWarnings",{enumerable:!0,get:function(){return C}}),Object.defineProperty(u,"warnOnce",{enumerable:!0,get:function(){return b}}),Object.defineProperty(u,"infoOnce",{enumerable:!0,get:function(){return E}}),Object.defineProperty(u,"resetWarnings",{enumerable:!0,get:function(){return w}}),Object.defineProperty(u,"fail",{enumerable:!0,get:function(){return S}}),Object.defineProperty(u,"invariant",{enumerable:!0,get:function(){return B}}),Object.defineProperty(u,"DEV",{enumerable:!0,get:function(){return v}}),Object.defineProperty(u,"isObject",{enumerable:!0,get:function(){return I}}),Object.defineProperty(u,"isFunction",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(u,"isNil",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(u,"isBlank",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(u,"isCtor",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(u,"pathGetter",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(u,"pathSetter",{enumerable:!0,get:function(){return k}}),Object.defineProperty(u,"getPath",{enumerable:!0,get:function(){return j}}),Object.defineProperty(u,"setPath",{enumerable:!0,get:function(){return U}}),Object.defineProperty(u,"humanise",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(u,"escapeHtml",{enumerable:!0,get:function(){return se}}),Object.defineProperty(u,"titleCase",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(u,"expand",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(u,"toArray",{enumerable:!0,get:function(){return we}}),Object.defineProperty(u,"merge",{enumerable:!0,get:function(){return me}}),Object.defineProperty(u,"mergeRow",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(u,"Lru",{enumerable:!0,get:function(){return je}}),Object.defineProperty(u,"collator",{enumerable:!0,get:function(){return y}}),Object.defineProperty(u,"defaultCompare",{enumerable:!0,get:function(){return O}}),Object.defineProperty(u,"now",{enumerable:!0,get:function(){return L}}),Object.defineProperty(u,"nextFrame",{enumerable:!0,get:function(){return _}}),Object.defineProperty(u,"cancelFrame",{enumerable:!0,get:function(){return V}}),Object.defineProperty(u,"frameBatched",{enumerable:!0,get:function(){return re}}),Object.defineProperty(u,"settleDebounce",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(u,"whenIdle",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(u,"uid",{enumerable:!0,get:function(){return Se}});const T="1.89.0";async function $(){return T}const z="1.89.0",A=new Set,G=2e3;function g(o){if(A.add(o),A.size>G){const i=A.values().next().value;i!==void 0&&A.delete(i)}}const F=[],X=500;function Y(o,i,c){F.push({key:o,level:i,message:c.map(p=>typeof p=="string"?p:N(p)).join(" "),at:Date.now()}),F.length>X&&F.shift()}function N(o){if(o instanceof Error)return o.message;try{return JSON.stringify(o)}catch{return String(o)}}function C(){return F.map(o=>({...o}))}function J(o){if(o.length===0||typeof o[0]!="string")return o;const i=o[0].replace(/^\[lattice\]\s*/,"");return i===o[0]?o:[i,...o.slice(1)]}function b(o,...i){if(A.has(o))return;g(o);const c=J(i);Y(o,"warn",c),console.warn("[lattice]",...c)}function E(o,...i){if(A.has(o))return;g(o);const c=J(i);Y(o,"info",c),console.info("[lattice]",...c)}function w(){A.clear(),F.length=0}function S(o,i){const c=new Error(`[lattice] ${o}`);throw i!==void 0&&(c.cause=i),c}function B(o,i){o||S(i)}const v=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function I(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function Q(o){return typeof o=="function"}function oe(o){return o==null}function ue(o){return o==null||o===""}function ae(o){return typeof o!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(o))?!0:!!(o.prototype&&Object.getOwnPropertyNames(o.prototype).length>1)}const ee=new Map;function Z(o){let i=ee.get(o);if(i)return i;if(!o.includes("."))i=c=>c?.[o];else{const c=o.split("."),p=c.length;i=D=>{let K=D;for(let W=0;W<p;W++){if(K==null)return;K=K[c[W]]}return K}}return ee.set(o,i),i}const q=new Map;function k(o){let i=q.get(o);if(i)return i;if(!o.includes("."))i=(c,p)=>{c!=null&&(c[o]=p)};else{const c=o.split("."),p=c.length-1;i=(D,K)=>{let W=D;for(let H=0;H<p;H++){if(W==null)return;const de=c[H];W[de]==null&&(W[de]={}),W=W[de]}W!=null&&(W[c[p]]=K)}}return q.set(o,i),i}function j(o,i){return Z(i)(o)}function U(o,i,c){k(i)(o,c)}function ne(o){return o?(o.includes(".")?o.slice(o.lastIndexOf(".")+1):o).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,c=>c.toUpperCase()):""}const ie={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function se(o){const i=o==null?"":String(o);return/[&<>"']/.test(i)?i.replace(/[&<>"']/g,c=>ie[c]):i}function Oe(o){return String(o).replace(/\w\S*/g,i=>i[0].toUpperCase()+i.slice(1).toLowerCase())}function Pe(o,i,c){if(o!==void 0)return o===!0?{enabled:!0,...c}:o===!1?{enabled:!1}:I(o)?o:{[i]:o,enabled:!0}}function we(o){return o==null?[]:Array.isArray(o)?o:[o]}const ye=Object.freeze(new Set(["__proto__","constructor","prototype"]));function me(o,i){if(!I(o))return I(i)?{...i}:i;if(!I(i))return i===void 0?o:i;const c={...o};for(const p of Object.keys(i)){if(ye.has(p))continue;const D=i[p];D!==void 0&&(c[p]=I(D)&&I(c[p])?me(c[p],D):D)}return c}function ge(o,i){if(!I(o)||!I(i)||o===i)return i;const c=Object.create(Object.getPrototypeOf(o));return Object.assign(c,o,i),c}class je{#n;#e=new Map;#t;constructor(i=256,c=null){this.#n=i,this.#t=c}get size(){return this.#e.size}get max(){return this.#n}set max(i){this.#n=i,this.#r()}has(i){return this.#e.has(i)}get(i){const c=this.#e;if(!c.has(i))return;const p=c.get(i);return c.delete(i),c.set(i,p),p}peek(i){return this.#e.get(i)}set(i,c){const p=this.#e;return p.has(i)&&p.delete(i),p.set(i,c),this.#r(),c}delete(i){const c=this.#e.get(i);return this.#e.delete(i)&&this.#t&&this.#t(c,i),c}clear(){if(this.#t)for(const[i,c]of this.#e)this.#t(c,i);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const i=this.#e;for(;i.size>this.#n;){const c=i.keys().next().value,p=i.get(c);i.delete(c),this.#t&&this.#t(p,c)}}}const a=new Map;function y(o,i){const c=`${o||""}|${i?JSON.stringify(i):""}`;let p=a.get(c);return p||(p=new Intl.Collator(o||void 0,{numeric:!0,sensitivity:"variant",...i}),a.set(c,p)),p}function O(o,i){if(o===i)return 0;if(o==null)return 1;if(i==null)return-1;if(typeof o=="number"&&typeof i=="number")return Number.isNaN(o)?Number.isNaN(i)?0:1:Number.isNaN(i)||o<i?-1:o>i?1:0;const c=String(o),p=String(i);return c<p?-1:c>p?1:0}function L(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const x=typeof requestAnimationFrame=="function";function _(o){return x?requestAnimationFrame(o):setTimeout(()=>o(L()),16)}function V(o){o!=null&&(x?cancelAnimationFrame(o):clearTimeout(o))}function re(o){let i=null,c=null;const p=()=>{i=null;const K=c;c=null,o(...K||[])},D=(...K)=>{c=K,i===null&&(i=_(p))};return D.cancel=()=>{V(i),i=null,c=null},D.flush=()=>{i!==null&&(V(i),p())},D}function ce(o,i){let c=null,p=null;const D=()=>{if(c=null,p===null)return;const H=p;p=null,o(...H),K()},K=()=>{c=setTimeout(D,i),typeof c?.unref=="function"&&c.unref()},W=(...H)=>{c===null?(o(...H),K()):(p=H,clearTimeout(c),K())};return W.flush=()=>{if(c!==null&&clearTimeout(c),c=null,p===null)return;const H=p;p=null,o(...H)},W.cancel=()=>{c!==null&&clearTimeout(c),c=null,p=null},W.pending=()=>c!==null||p!==null,W}function pe(o,i=50){return typeof requestIdleCallback=="function"?requestIdleCallback(o,{timeout:i}):setTimeout(()=>o({timeRemaining:()=>0,didTimeout:!0}),1)}let le=0;function Se(o="l"){return`${o}${(++le).toString(36)}`}}),fe("packages/core/src/format/number.js",function(u,R){"use strict";Object.defineProperty(u,"compileNumber",{enumerable:!0,get:function(){return z}});const $=R("packages/core/src/internal/util.js").isNil;function z(A,G){const g=A||{},F=g.locale||G||void 0,X=g.style||"decimal",Y=typeof g.scale=="number"?g.scale:1,N=g.nullDisplay??"",C=g.zeroDisplay,J=g.prefix||"",b=g.suffix||"",E=g.negative||"minus",w=g.signed===!0,S={style:X,notation:g.notation||"standard"};X==="currency"&&(S.currency=g.currency||"USD",g.currencyDisplay&&(S.currencyDisplay=g.currencyDisplay)),typeof g.decimals=="number"?(S.minimumFractionDigits=g.decimals,S.maximumFractionDigits=g.decimals):(typeof g.minDecimals=="number"&&(S.minimumFractionDigits=g.minDecimals),typeof g.maxDecimals=="number"&&(S.maximumFractionDigits=g.maxDecimals),S.minimumFractionDigits>(S.maximumFractionDigits??20)&&(S.maximumFractionDigits=S.minimumFractionDigits)),g.thousandsSeparator===!1&&(S.useGrouping=!1),S.notation==="compact"&&(S.compactDisplay=g.compactDisplay||"short");const B=new Intl.NumberFormat(F,S),v=typeof g.thousandsSeparator=="string"?g.thousandsSeparator:null,I=typeof g.decimalSeparator=="string"?g.decimalSeparator:null;let Q=",",oe=".";if(v||I)for(const k of B.formatToParts(12345.6))k.type==="group"?Q=k.value:k.type==="decimal"&&(oe=k.value);const ue=k=>{let j=k;return v&&(j=j.split(Q).join("")),I&&(j=j.split(oe).join("")),v&&(j=j.split("").join(v)),I&&(j=j.split("").join(I)),j},ae=!!(v||I),ee=J!==""&&X==="currency",Z=k=>{let j;if(ee){const U=B.formatToParts(k);let ne=!1;j="";for(const ie of U)j+=ie.value,!ne&&ie.type==="currency"&&(j+=J,ne=!0);ne||(j=J+j)}else j=J+B.format(k);return ae&&(j=ue(j)),j+b},q=k=>{if($(k)||k==="")return N;const j=typeof k=="number"?k:Number(k);if(Number.isNaN(j))return N;const U=Y===1?j:j*Y;return U===0&&C!==void 0?C:U<0?E==="parentheses"?`(${Z(-U)})`:E==="suffix"?`${Z(-U)}-`:Z(U):w&&U>0?`+${Z(U)}`:Z(U)};return q.negativeClass=g.negativeClass||null,q.spec=g,q}}),fe("packages/modules/geometry/geodata.js",function(u,R){"use strict";Object.defineProperty(u,"GEOMETRY_KINDS",{enumerable:!0,get:function(){return G}}),Object.defineProperty(u,"SPATIAL_OPERATORS",{enumerable:!0,get:function(){return g}}),Object.defineProperty(u,"GEOMETRY_OPERATORS",{enumerable:!0,get:function(){return F}}),Object.defineProperty(u,"EARTH_RADIUS",{enumerable:!0,get:function(){return X}}),Object.defineProperty(u,"toWkt",{enumerable:!0,get:function(){return U}}),Object.defineProperty(u,"toWkb",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(u,"readGeometry",{enumerable:!0,get:function(){return y}}),Object.defineProperty(u,"parseGeometry",{enumerable:!0,get:function(){return L}}),Object.defineProperty(u,"haversine",{enumerable:!0,get:function(){return _}}),Object.defineProperty(u,"geometryInfo",{enumerable:!0,get:function(){return c}}),Object.defineProperty(u,"geometryKind",{enumerable:!0,get:function(){return p}}),Object.defineProperty(u,"spatialOperand",{enumerable:!0,get:function(){return K}}),Object.defineProperty(u,"spatialPredicate",{enumerable:!0,get:function(){return We}});const T=R("packages/core/src/internal/util.js"),$=T.isNil,z=T.isObject,A=T.warnOnce,G=Object.freeze(["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"]),g=Object.freeze(["withinBbox","withinPolygon","intersects","withinDistance"]),F=Object.freeze([...g,"blank","notBlank"]),X=63710088e-1,Y=Math.PI/180,N=16,C=1e-12;class J extends Error{}function b(t){throw new J(t)}function E(t){(!Array.isArray(t)||t.length<2)&&b("a position needs at least two numbers");const e=Number(t[0]),n=Number(t[1]);return(typeof t[0]!="number"||typeof t[1]!="number"||!Number.isFinite(e)||!Number.isFinite(n))&&b("a coordinate is not a finite number"),[e,n]}function w(t,e,n){Array.isArray(t)||b(`${n} is not an array of positions`);const r=t.map(E);return r.length<e&&b(`${n} needs at least ${e} positions, found ${r.length}`),r}function S(t){const e=w(t,3,"a polygon ring"),n=e[0],r=e[e.length-1];return(n[0]!==r[0]||n[1]!==r[1])&&e.push([n[0],n[1]]),e.length<4&&b(`a polygon ring needs at least 3 distinct corners, found ${e.length-1}`),e}function B(t){return(!Array.isArray(t)||t.length===0)&&b("a polygon needs at least an outer ring"),t.map(S)}function v(t,e){switch(e>N&&b("geometry collections nest too deeply"),z(t)||b("GeoJSON must be an object"),t.type){case"Feature":return t.geometry==null?null:v(t.geometry,e+1);case"FeatureCollection":return b("a FeatureCollection holds many rows, not one value; load its features as rows");case"Point":return{type:"Point",coordinates:E(t.coordinates)};case"MultiPoint":return{type:"MultiPoint",coordinates:w(t.coordinates,1,"a MultiPoint")};case"LineString":return{type:"LineString",coordinates:w(t.coordinates,2,"a LineString")};case"MultiLineString":return(!Array.isArray(t.coordinates)||!t.coordinates.length)&&b("a MultiLineString needs at least one line"),{type:"MultiLineString",coordinates:t.coordinates.map(n=>w(n,2,"a LineString"))};case"Polygon":return{type:"Polygon",coordinates:B(t.coordinates)};case"MultiPolygon":return(!Array.isArray(t.coordinates)||!t.coordinates.length)&&b("a MultiPolygon needs at least one polygon"),{type:"MultiPolygon",coordinates:t.coordinates.map(B)};case"GeometryCollection":{(!Array.isArray(t.geometries)||!t.geometries.length)&&b("a GeometryCollection needs at least one geometry");const n=t.geometries.map(r=>v(r,e+1)).filter(Boolean);return n.length?{type:"GeometryCollection",geometries:n}:null}default:return b(`"${String(t.type)}" is not a GeoJSON geometry type`)}}const I=Object.freeze({POINT:"Point",LINESTRING:"LineString",POLYGON:"Polygon",MULTIPOINT:"MultiPoint",MULTILINESTRING:"MultiLineString",MULTIPOLYGON:"MultiPolygon",GEOMETRYCOLLECTION:"GeometryCollection"}),Q=/[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/y,oe=/[A-Za-z]+/y,ue=/^\s*(?:SRID\s*=\s*\d+\s*;\s*)?[A-Za-z]+\s*(?:ZM|Z|M)?\s*(?:\(|EMPTY\b)/i;class ae{text;at=0;constructor(e){this.text=e}space(){for(;this.at<this.text.length&&/\s/.test(this.text[this.at]);)this.at++}expect(e){this.space(),this.text[this.at]!==e&&b(`WKT expected "${e}" at character ${this.at+1}, found "${this.text[this.at]??"the end"}"`),this.at++}accept(e){return this.space(),this.text[this.at]===e?(this.at++,!0):!1}word(){this.space(),oe.lastIndex=this.at;const e=oe.exec(this.text);return e?(this.at+=e[0].length,e[0].toUpperCase()):""}numberNext(){return this.space(),Q.lastIndex=this.at,Q.test(this.text)}number(){this.space(),Q.lastIndex=this.at;const e=Q.exec(this.text);return e||b(`WKT expected a number at character ${this.at+1}`),this.at+=e[0].length,Number(e[0])}position(){const e=this.number(),n=this.number();for(;this.numberNext();)this.number();return[e,n]}positionList(){this.expect("(");const e=[this.position()];for(;this.accept(",");)e.push(this.position());return this.expect(")"),e}empty(){const e=this.at;return this.word()==="EMPTY"?!0:(this.at=e,!1)}geometry(e){e>N&&b("geometry collections nest too deeply");const n=this.word(),r=I[n];r||b(n?`"${n}" is not a WKT geometry type`:"WKT expected a geometry type");const s=this.at,l=this.word();return l!=="Z"&&l!=="M"&&l!=="ZM"&&(this.at=s),this.empty()?null:this.body(r,e)}body(e,n){switch(e){case"Point":{this.expect("(");const r=this.position();return this.expect(")"),{type:"Point",coordinates:r}}case"LineString":return{type:"LineString",coordinates:w(this.positionList(),2,"a LineString")};case"Polygon":return{type:"Polygon",coordinates:this.polygonBody()};case"MultiPoint":{this.expect("(");const r=[];do this.empty()||(this.accept("(")?(r.push(this.position()),this.expect(")")):r.push(this.position()));while(this.accept(","));return this.expect(")"),r.length?{type:"MultiPoint",coordinates:r}:null}case"MultiLineString":{const r=this.parts(()=>w(this.positionList(),2,"a LineString"));return r.length?{type:"MultiLineString",coordinates:r}:null}case"MultiPolygon":{const r=this.parts(()=>this.polygonBody());return r.length?{type:"MultiPolygon",coordinates:r}:null}default:{this.expect("(");const r=[];do{const s=this.geometry(n+1);s&&r.push(s)}while(this.accept(","));return this.expect(")"),r.length?{type:"GeometryCollection",geometries:r}:null}}}parts(e){this.expect("(");const n=[];do this.empty()||n.push(e());while(this.accept(","));return this.expect(")"),n}polygonBody(){return B(this.parts(()=>this.positionList()))}}function ee(t){const e=new ae(String(t).replace(/^\s*SRID\s*=\s*\d+\s*;/i,"")),n=e.geometry(0);return e.space(),e.at<e.text.length&&b(`WKT has unexpected text after the geometry at character ${e.at+1}`),n}function Z(t){return Object.is(t,-0)?"0":String(t)}function q(t){return`${Z(t[0])} ${Z(t[1])}`}function k(t){return`(${t.map(q).join(", ")})`}function j(t){return`(${t.map(k).join(", ")})`}function U(t){const e=L(t);return e?ne(e):""}function ne(t){switch(t.type){case"Point":return`POINT (${q(t.coordinates)})`;case"LineString":return`LINESTRING ${k(t.coordinates)}`;case"Polygon":return`POLYGON ${j(t.coordinates)}`;case"MultiPoint":return`MULTIPOINT (${t.coordinates.map(e=>`(${q(e)})`).join(", ")})`;case"MultiLineString":return`MULTILINESTRING (${t.coordinates.map(k).join(", ")})`;case"MultiPolygon":return`MULTIPOLYGON (${t.coordinates.map(j).join(", ")})`;default:return`GEOMETRYCOLLECTION (${t.geometries.map(ne).join(", ")})`}}class ie{view;at=0;constructor(e){this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}need(e){this.at+e>this.view.byteLength&&b(`WKB ends after ${this.view.byteLength} bytes, in the middle of a geometry`)}u8(){return this.need(1),this.view.getUint8(this.at++)}u32(e){this.need(4);const n=this.view.getUint32(this.at,e);return this.at+=4,n}f64(e){this.need(8);const n=this.view.getFloat64(this.at,e);return this.at+=8,n}count(e,n){const r=this.u32(e);return r*n>this.view.byteLength-this.at&&b(`WKB claims ${r} elements, more than its bytes can hold`),r}position(e,n){const r=this.f64(e),s=this.f64(e);for(let l=2;l<n;l++)this.f64(e);return[r,s]}positions(e,n){const r=this.count(e,8*n),s=new Array(r);for(let l=0;l<r;l++)s[l]=this.position(e,n);return s}geometry(e,n){e>N&&b("geometry collections nest too deeply");const r=this.u8();r!==0&&r!==1&&b(`WKB byte-order mark is ${r}, not 0 or 1`);const s=r===1,l=this.u32(s);let f=2;l&2147483648&&f++,l&1073741824&&f++,l&536870912&&this.u32(s);let m=l&268435455;if(m>=1e3){const M=Math.floor(m/1e3);M>3&&b(`WKB geometry type ${m} is not one this reads`),f=2+(M===3?2:1),m%=1e3}const P=G[m-1];switch(P||b(`WKB geometry type ${m} is not one this reads`),n&&P!==n&&b(`a part of a WKB Multi${n} is a ${P}`),P){case"Point":{const M=this.position(s,f);return Number.isNaN(M[0])&&Number.isNaN(M[1])?null:{type:"Point",coordinates:E(M)}}case"LineString":return{type:"LineString",coordinates:w(this.positions(s,f),2,"a LineString")};case"Polygon":{const M=this.count(s,4),d=[];for(let h=0;h<M;h++)d.push(this.positions(s,f));return M?{type:"Polygon",coordinates:B(d)}:null}default:{const M=this.count(s,5),d=P==="GeometryCollection"?void 0:P.slice(5),h=[];for(let te=0;te<M;te++){const Me=this.geometry(e+1,d);Me&&h.push(Me)}return h.length?P==="GeometryCollection"?{type:P,geometries:h}:{type:P,coordinates:h.map(te=>te.coordinates)}:null}}}}function se(t){const e=new ie(t),n=e.geometry(0);return e.at!==t.byteLength&&b(`WKB has ${t.byteLength-e.at} bytes left over after the geometry`),n}function Oe(t){const e=L(t);if(!e)return null;const n=[];let r=0;const s=d=>{const h=new DataView(new ArrayBuffer(5));h.setUint8(0,1),h.setUint32(1,G.indexOf(d)+1,!0),n.push(h),r+=5},l=d=>{const h=new DataView(new ArrayBuffer(4));h.setUint32(0,d,!0),n.push(h),r+=4},f=d=>{const h=new DataView(new ArrayBuffer(16*d.length));d.forEach((te,Me)=>{h.setFloat64(Me*16,te[0],!0),h.setFloat64(Me*16+8,te[1],!0)}),n.push(h),r+=16*d.length},m=d=>{switch(s(d.type),d.type){case"Point":f([d.coordinates]);break;case"LineString":l(d.coordinates.length),f(d.coordinates);break;case"Polygon":l(d.coordinates.length);for(const h of d.coordinates)l(h.length),f(h);break;case"GeometryCollection":l(d.geometries.length);for(const h of d.geometries)m(h);break;default:{const h=d.type.slice(5);l(d.coordinates.length);for(const te of d.coordinates)m({type:h,coordinates:te})}}};m(e);const P=new Uint8Array(r);let M=0;for(const d of n)P.set(new Uint8Array(d.buffer),M),M+=d.byteLength;return P}const Pe=/^0[01](?:[0-9a-fA-F]{2})+$/,we=/^[A-Za-z0-9+/_-]+={0,2}$/,ye=(()=>{const t=new Int16Array(128).fill(-1),e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=n;return t[45]=62,t[95]=63,t})();function me(t){const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++)e[n]=parseInt(t.slice(n*2,n*2+2),16);return e}function ge(t){const e=t.replace(/=+$/,""),n=new Uint8Array(Math.floor(e.length*3/4));let r=0,s=0,l=0;for(let f=0;f<e.length;f++)s=s<<6|ye[e.charCodeAt(f)],r+=6,r>=8&&(r-=8,n[l++]=s>>r&255);return n.subarray(0,l)}function je(t){const e=t.trim();if(e==="")return null;if(e[0]==="{"){let n;try{n=JSON.parse(e)}catch{return b("the text starts like GeoJSON but is not valid JSON")}return v(n,0)}if(Pe.test(e))return se(me(e));if(ue.test(e))return ee(e);if(we.test(e)){const n=ge(e);if(n.length>=5&&(n[0]===0||n[0]===1))return se(n)}return b("the text is not WKT, GeoJSON, or hex or base64 WKB")}const a=new WeakSet;function y(t){if($(t))return{geometry:null,reason:null};if(typeof t=="object"&&a.has(t))return{geometry:t,reason:null};try{let e;return typeof t=="string"?e=je(t):t instanceof Uint8Array?e=se(t):t instanceof ArrayBuffer?e=se(new Uint8Array(t)):ArrayBuffer.isView(t)?e=se(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)):z(t)?e=v(t,0):b(`${Array.isArray(t)?"an array":`a ${typeof t}`} is not a geometry`),e&&O(e),{geometry:e||null,reason:null}}catch(e){if(e instanceof J)return{geometry:null,reason:e.message};throw e}}function O(t){if(a.add(t),t.type==="GeometryCollection")for(const e of t.geometries)O(e)}function L(t){return y(t).geometry}function x(t,e){switch(t.type){case"Point":e(t.coordinates);break;case"MultiPoint":case"LineString":t.coordinates.forEach(e);break;case"MultiLineString":case"Polygon":for(const n of t.coordinates)n.forEach(e);break;case"MultiPolygon":for(const n of t.coordinates)for(const r of n)r.forEach(e);break;default:for(const n of t.geometries)x(n,e)}}function _(t,e){const n=t[1]*Y,r=e[1]*Y,s=r-n,l=(e[0]-t[0])*Y,f=Math.sin(s/2)**2+Math.cos(n)*Math.cos(r)*Math.sin(l/2)**2;return 2*X*Math.asin(Math.min(1,Math.sqrt(f)))}function V(t){let e=0;for(let n=1;n<t.length;n++)e+=_(t[n-1],t[n]);return e}function re(t){const e=t.length-1;if(e<3)return 0;let n=0;for(let r=0;r<e;r++){const s=t[(r-1+e)%e],l=t[(r+1)%e];n+=(l[0]-s[0])*Y*Math.sin(t[r][1]*Y)}return Math.abs(n)*X*X/2}function ce(t){let e=re(t[0]);for(let n=1;n<t.length;n++)e-=re(t[n]);return Math.max(0,e)}function pe(t){let e=0,n=0,r=0;for(let s=0;s<t.length-1;s++){const[l,f]=t[s],[m,P]=t[s+1],M=l*P-m*f;e+=M,n+=(l+m)*M,r+=(f+P)*M}return{a:e,cx:n,cy:r}}function le(){let t=0,e=0,n=0;return{add(r,s,l){t+=r*l,e+=s*l,n+=l},get(){return n>0?[t/n,e/n]:null}}}function Se(t){let e=0,n=0;for(const r of t)e+=r[0],n+=r[1];return[e/t.length,n/t.length]}function o(t,e){switch(t.type){case"Point":e[0].add(t.coordinates[0],t.coordinates[1],1);break;case"MultiPoint":for(const n of t.coordinates)e[0].add(n[0],n[1],1);break;case"LineString":case"MultiLineString":{const n=t.type==="LineString"?[t.coordinates]:t.coordinates;for(const r of n){for(let s=1;s<r.length;s++){const[l,f]=r[s-1],[m,P]=r[s],M=Math.hypot(m-l,P-f);e[1].add((l+m)/2,(f+P)/2,M)}for(const s of r)e[0].add(s[0],s[1],1)}break}case"Polygon":case"MultiPolygon":{const n=t.type==="Polygon"?[t.coordinates]:t.coordinates;for(const r of n){let s=0,l=0,f=0;r.forEach((P,M)=>{const d=pe(P),h=(M===0?1:-1)*(d.a<0?-1:1);s+=h*d.a,l+=h*d.cx,f+=h*d.cy}),Math.abs(s)>C&&e[2].add(l/(3*s),f/(3*s),Math.abs(s)/2);const m=r[0].slice(0,-1);for(const P of m)e[0].add(P[0],P[1],1)}break}default:for(const n of t.geometries)o(n,e)}}const i=new WeakMap;function c(t){const e=L(t);if(!e)return null;const n=i.get(e);if(n)return n;const r=[1/0,1/0,-1/0,-1/0];x(e,d=>{d[0]<r[0]&&(r[0]=d[0]),d[1]<r[1]&&(r[1]=d[1]),d[0]>r[2]&&(r[2]=d[0]),d[1]>r[3]&&(r[3]=d[1])});const s=[le(),le(),le()];o(e,s);const l=s[2].get()||s[1].get()||s[0].get()||Se([[r[0],r[1]],[r[2],r[3]]]);let f=0,m=0;const P=d=>{switch(d.type){case"LineString":f+=V(d.coordinates);break;case"MultiLineString":for(const h of d.coordinates)f+=V(h);break;case"Polygon":m+=ce(d.coordinates);for(const h of d.coordinates)f+=V(h);break;case"MultiPolygon":for(const h of d.coordinates){m+=ce(h);for(const te of h)f+=V(te)}break;case"GeometryCollection":for(const h of d.geometries)P(h);break;default:break}};P(e);const M=Object.freeze({kind:e.type,bbox:Object.freeze(r),centroid:Object.freeze(l),length:f,area:m});return i.set(e,M),M}function p(t){const e=c(t);return e?e.kind:null}function D(t,e){const n=typeof t=="string"?t.split(/[\s,;]+/).filter(Boolean):t;if(!Array.isArray(n)||n.length!==e)return null;const r=n.map(s=>typeof s=="number"?s:typeof s=="string"?Number(s):NaN);return r.every(Number.isFinite)?r:null}function K(t,e){if(t==="withinBbox"){const n=D(e,4);return n?n[0]>n[2]?{reason:'the box crosses the antimeridian (its west edge is east of its east edge), which is not supported; split it into two withinBbox conditions joined by "or"'}:n[1]>n[3]?{reason:"the box's minLat is above its maxLat"}:{operand:n}:{reason:"withinBbox needs [minLon, minLat, maxLon, maxLat]"}}if(t==="withinDistance"){let n=null;if(z(e)&&!Array.isArray(e)){const r=e;n=D([r.lon,r.lat,r.metres],3)}else n=D(e,3);return!n||n[2]<0?{reason:"withinDistance needs { lon, lat, metres } with metres of 0 or more"}:{operand:{lon:n[0],lat:n[1],metres:n[2]}}}if(t==="withinPolygon"||t==="intersects"){const n=t==="intersects"?D(e,4):null;if(n){if(n[0]>n[2]||n[1]>n[3])return{reason:"the box's minimum is above its maximum"};const[l,f,m,P]=n;return{operand:{type:"Polygon",coordinates:[[[l,f],[m,f],[m,P],[l,P],[l,f]]]}}}const{geometry:r,reason:s}=y(e);return r?t==="withinPolygon"&&r.type!=="Polygon"&&r.type!=="MultiPolygon"?{reason:`withinPolygon needs a Polygon or MultiPolygon, not a ${r.type}`}:{operand:r}:{reason:`${t} needs a geometry: ${s||"none was given"}`}}return{reason:`"${t}" is not a spatial operator`}}function W(t,e){const[n,r]=t;let s=!1;for(let l=0,f=e.length-2;l<e.length-1;f=l++){const[m,P]=e[l],[M,d]=e[f];P>r!=d>r&&n<(M-m)*(r-P)/(d-P)+m&&(s=!s)}return s}function H(t,e){if(!W(t,e[0]))return!1;for(let n=1;n<e.length;n++)if(W(t,e[n]))return!1;return!0}function de(t,e={points:[],segments:[],polygons:[]}){const n=r=>{for(let s=1;s<r.length;s++)e.segments.push([r[s-1],r[s]]);for(const s of r)e.points.push(s)};switch(t.type){case"Point":e.points.push(t.coordinates);break;case"MultiPoint":for(const r of t.coordinates)e.points.push(r);break;case"LineString":n(t.coordinates);break;case"MultiLineString":t.coordinates.forEach(n);break;case"Polygon":e.polygons.push(t.coordinates),t.coordinates.forEach(n);break;case"MultiPolygon":for(const r of t.coordinates)e.polygons.push(r),r.forEach(n);break;default:for(const r of t.geometries)de(r,e)}return e}function he(t,e,n){const r=(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0]);return Math.abs(r)<=C?0:Math.sign(r)}function be(t,e,n){return t[0]>=Math.min(e[0],n[0])-C&&t[0]<=Math.max(e[0],n[0])+C&&t[1]>=Math.min(e[1],n[1])-C&&t[1]<=Math.max(e[1],n[1])+C}function Ie(t,e){const[n,r]=t,[s,l]=e,f=he(n,r,s),m=he(n,r,l),P=he(s,l,n),M=he(s,l,r);return f!==m&&P!==M?!0:f===0&&be(s,n,r)||m===0&&be(l,n,r)||P===0&&be(n,s,l)||M===0&&be(r,s,l)}function $e(t,e){return t[0]<=e[2]&&e[0]<=t[2]&&t[1]<=e[3]&&e[1]<=t[3]}function De(t,e){const n=c(t),r=c(e);if(!$e(n.bbox,r.bbox))return!1;const s=de(t),l=de(e);for(const f of l.polygons)for(const m of s.points)if(H(m,f))return!0;for(const f of s.polygons)for(const m of l.points)if(H(m,f))return!0;for(const f of s.segments)for(const m of l.segments)if(Ie(f,m))return!0;for(const f of s.points){for(const m of l.points)if(Math.abs(f[0]-m[0])<=C&&Math.abs(f[1]-m[1])<=C)return!0;for(const m of l.segments)if(he(m[0],m[1],f)===0&&be(f,m[0],m[1]))return!0}for(const f of l.points)for(const m of s.segments)if(he(m[0],m[1],f)===0&&be(f,m[0],m[1]))return!0;return!1}function We(t,e){const{operand:n,reason:r}=K(t,e);if(r)return A(`filter:geometry:${t}`,`a "${t}" condition was refused: ${r}. It matches no row rather than guessing.`),()=>!1;switch(t){case"withinBbox":return s=>{const l=c(s);if(!l)return!1;const f=l.bbox;return f[0]>=n[0]&&f[1]>=n[1]&&f[2]<=n[2]&&f[3]<=n[3]};case"withinPolygon":{const s=n.type==="Polygon"?[n.coordinates]:n.coordinates,l=f=>s.some(m=>H(f,m));return f=>{const m=L(f);return m?m.type==="Point"?l(m.coordinates):m.type==="MultiPoint"?m.coordinates.every(l):l(c(m).centroid):!1}}case"intersects":return s=>{const l=L(s);return!!l&&De(l,n)};default:{const s=[n.lon,n.lat];return l=>{const f=c(l);return!!f&&_(f.centroid,s)<=n.metres}}}}}),fe("packages/modules/geometry/messages.js",function(u,R){"use strict";Object.defineProperty(u,"withFallback",{enumerable:!0,get:function(){return z}});const T=Object.freeze({"filter.op.withinBbox":"Within box","filter.op.withinPolygon":"Within polygon","filter.op.intersects":"Intersects","filter.op.withinDistance":"Within distance of","filter.geometry.bbox":"minLon, minLat, maxLon, maxLat","filter.geometry.polygon":"Polygon as WKT or GeoJSON","filter.geometry.shape":"WKT, GeoJSON, or minLon, minLat, maxLon, maxLat","filter.geometry.distance":"lon, lat, metres","geometry.points":["point","points"],"geometry.vertices":["vertex","vertices"],"geometry.parts":["part","parts"],"geometry.north":"{value}°N","geometry.south":"{value}°S","geometry.east":"{value}°E","geometry.west":"{value}°W"});function $(A,G){const g=T[A];return g===void 0?A:Array.isArray(g)?`${G.count} ${G.count===1?g[0]:g[1]}`:g.replace("{value}",String(G.value??""))}function z(A){return{t(G,g={}){const F=A&&typeof A.t=="function"?A.t(G,g):G;return F===G?$(G,g):F}}}}),fe("packages/modules/geometry/filter.js",function(u,R){"use strict";Object.defineProperty(u,"GeometryFilter",{enumerable:!0,get:function(){return C}}),Object.defineProperty(u,"default",{enumerable:!0,get:function(){return J}});const T=Ge("@toclocoinc/lattice-grid"),$=T.ConditionFilter;if(typeof $>"u")throw new Error("[lattice] geometry needs ConditionFilter from the lattice-grid module. Load lattice-grid before geometry.");const z=T.createMessages;if(typeof z>"u")throw new Error("[lattice] geometry needs createMessages from the lattice-grid module. Load lattice-grid before geometry.");const A=R("packages/modules/geometry/geodata.js"),G=A.spatialOperand,g=A.toWkt,F=A.parseGeometry,Y=R("packages/modules/geometry/messages.js").withFallback,N=Object.freeze({withinBbox:"filter.geometry.bbox",withinPolygon:"filter.geometry.polygon",intersects:"filter.geometry.shape",withinDistance:"filter.geometry.distance"});class C extends ${static operators=Object.freeze(["withinBbox","withinPolygon","intersects","withinDistance","blank","notBlank"]);static wire=Object.freeze({withinBbox:"withinBbox",withinPolygon:"withinPolygon",intersects:"intersects",withinDistance:"withinDistance",blank:"blank",notBlank:"notBlank"});static type="geometry";init(E){const w=E||{},S=w.messages||w.grid&&w.grid.messages||z();super.init({...w,messages:Y(S)})}static defaultOperator="withinBbox";parseInput(E){const w=String(E??"").trim();return w===""?null:w}formatInput(E){if(E==null)return"";if(typeof E=="string")return E;if(Array.isArray(E))return E.join(", ");const w=E;return typeof w.lon=="number"&&typeof w.lat=="number"?`${w.lon}, ${w.lat}, ${w.metres}`:F(E)?g(E):""}nodes(){const E=[];for(const w of super.nodes()){const S=w;if(!N[S.op]){E.push(w);continue}const{operand:B}=G(S.op,S.value);B!==void 0&&E.push({...S,value:B})}return E}hintFor(E){const w=N[E];return w?this.messages.t(w):null}}const J=C}),fe("packages/modules/geometry/type.js",function(u,R){"use strict";Object.defineProperty(u,"GEOMETRY_KINDS",{enumerable:!0,get:function(){return C}}),Object.defineProperty(u,"SPATIAL_OPERATORS",{enumerable:!0,get:function(){return J}}),Object.defineProperty(u,"GEOMETRY_OPERATORS",{enumerable:!0,get:function(){return b}}),Object.defineProperty(u,"EARTH_RADIUS",{enumerable:!0,get:function(){return E}}),Object.defineProperty(u,"readGeometry",{enumerable:!0,get:function(){return w}}),Object.defineProperty(u,"parseGeometry",{enumerable:!0,get:function(){return S}}),Object.defineProperty(u,"toWkt",{enumerable:!0,get:function(){return B}}),Object.defineProperty(u,"toWkb",{enumerable:!0,get:function(){return v}}),Object.defineProperty(u,"geometryInfo",{enumerable:!0,get:function(){return I}}),Object.defineProperty(u,"geometryKind",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(u,"haversine",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(u,"spatialOperand",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(u,"spatialPredicate",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(u,"GEOMETRY_FORMAT_PATTERNS",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(u,"compareGeometry",{enumerable:!0,get:function(){return q}}),Object.defineProperty(u,"formatGeometry",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(u,"GEOMETRY_TYPES",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(u,"default",{enumerable:!0,get:function(){return je}});const T=R("packages/core/src/internal/util.js"),$=T.isNil,z=T.warnOnce,G=R("packages/core/src/format/number.js").compileNumber,F=R("packages/modules/geometry/filter.js").GeometryFilter,Y=R("packages/modules/geometry/messages.js").withFallback,N=R("packages/modules/geometry/geodata.js"),C=N.GEOMETRY_KINDS,J=N.SPATIAL_OPERATORS,b=N.GEOMETRY_OPERATORS,E=N.EARTH_RADIUS,w=N.readGeometry,S=N.parseGeometry,B=N.toWkt,v=N.toWkb,I=N.geometryInfo,Q=N.geometryKind,oe=N.haversine,ue=N.spatialOperand,ae=N.spatialPredicate,ee=Object.freeze(["summary","wkt","geojson"]);function Z(a,y){const{geometry:O,reason:L}=w(a);if(L){const x=y&&y.colId||"?";z(`geometry:refused:${x}`,`column "${x}" refused a value that is not a geometry (${L}); the cell is left blank rather than storing it. A geometry column accepts WKB, WKT or GeoJSON.`)}return O}function q(a,y){const O=I(a),L=I(y);if(!O||!L){if(O)return-1;if(L)return 1;if($(a))return $(y)?0:1;if($(y))return-1;const V=String(a),re=String(y);return V<re?-1:V>re?1:0}const x=O.centroid[1]-L.centroid[1];if(x!==0)return x<0?-1:1;const _=O.centroid[0]-L.centroid[0];return _<0?-1:_>0?1:0}const k=new Map;function j(a,y,O){const L=`${a||""}|${O}`;let x=k.get(L);if(!x){const _=G(y,a);x=V=>_(V),k.set(L,x)}return x}function U(a,y){return a<1e3?`${j(y,{maxDecimals:0},"m")(a)} m`:`${j(y,{maxDecimals:1},"km")(a/1e3)} km`}function ne(a,y){return a<1e6?`${j(y,{maxDecimals:0},"m")(a)} m²`:`${j(y,{maxDecimals:2},"km2")(a/1e6)} km²`}function ie(a){switch(a.type){case"Point":return 1;case"MultiPoint":case"LineString":return a.coordinates.length;case"MultiLineString":return a.coordinates.reduce((y,O)=>y+O.length,0);case"Polygon":return a.coordinates.reduce((y,O)=>y+O.length-1,0);case"MultiPolygon":return a.coordinates.reduce((y,O)=>y+O.reduce((L,x)=>L+x.length-1,0),0);default:return a.geometries.reduce((y,O)=>y+ie(O),0)}}function se(a){return Y(a&&a.messages)}function Oe(a){return{compile:y=>ae(a,y),check:y=>ue(a,y).reason||null}}function Pe(a,y,O){const L=I(a);if(a.type==="Point"){const ce=j(y,{decimals:4},"deg"),[pe,le]=a.coordinates,Se=O.t(le<0?"geometry.south":"geometry.north",{value:ce(Math.abs(le))}),o=O.t(pe<0?"geometry.west":"geometry.east",{value:ce(Math.abs(pe))});return`Point ${Se} ${o}`}const x=[a.type];if(a.type.startsWith("Multi")||a.type==="GeometryCollection"){const ce=a.type==="GeometryCollection"?a.geometries.length:a.coordinates.length;x.push(O.t("geometry.parts",{count:ce}))}const V=ie(a),re=a.type==="Polygon"||a.type==="MultiPolygon";return a.type!=="GeometryCollection"&&x.push(O.t(re?"geometry.vertices":"geometry.points",{count:V})),re?x.push(ne(L.area,y)):(a.type==="LineString"||a.type==="MultiLineString")&&x.push(U(L.length,y)),x.join(", ")}function we(a){const y=a&&a.format,O=y&&typeof y=="object"?y.pattern:void 0;if(O===void 0)return"summary";if(ee.includes(O))return O;const L=a&&a.id||"?";return z(`geometry:format:${L}`,`column "${L}" asks for geometry format pattern "${String(O)}", which is not one of ${ee.join(", ")}; the summary is shown instead.`),"summary"}function ye(a){const y=a&&a.value;if($(y)||y==="")return"";const O=S(y);if(!O)return typeof y=="string"?y:"";switch(we(a.column)){case"wkt":return B(O);case"geojson":return JSON.stringify(O);default:return Pe(O,a.locale,se(a.grid))}}function me(a){if($(a))return"";const y=S(a);return y?B(y):typeof a=="string"?a:""}const ge=Object.freeze({geometry:{base:"object",storage:"object",format:a=>ye(a),parse:a=>S(a&&a.text),compare:q,groupProjector:()=>a=>Q(a)??a,geometry:a=>I(a),operators:Object.freeze(Object.fromEntries(J.map(a=>[a,Oe(a)]))),formatPatterns:ee,defaults:{filter:F,editor:"none",align:"start"},totals:{supported:["count","countValues"]},excel:"@",excelKind:"string",exportText:me,toStorage:(a,y)=>Z(a,y),toClipboard:me,fromClipboard:a=>S(a)}}),je=ge}),fe("packages/modules/geometry/index.js",function(u,R){"use strict";Object.defineProperty(u,"geometryModule",{enumerable:!0,get:function(){return G}}),Object.defineProperty(u,"default",{enumerable:!0,get:function(){return g}});const $=Ge("@toclocoinc/lattice-grid").registerModules;if(typeof $>"u")throw new Error("[lattice] geometry needs registerModules from the lattice-grid module. Load lattice-grid before geometry.");const A=R("packages/modules/geometry/type.js").GEOMETRY_TYPES,G=Object.freeze({name:"geometry",capabilities:["dataType:geometry"],install(F){F.registry.register("dataType","geometry",A.geometry)}});$(G);const g=G});var Ee=ke("packages/modules/geometry/index.js");if(typeof module=="object"&&module.exports)module.exports=Ee;else if(typeof define=="function"&&define.amd)define(function(){return Ee});else{var xe=Le.LatticeGrid||(Le.LatticeGrid={});for(var Te in Ee)Te!=="default"&&(xe[Te]=Ee[Te])}})(typeof globalThis<"u"?globalThis:this);
6
+ (function(Le){"use strict";var Ae=Object.create(null),Ne=Object.create(null);function fe(u,R){Ae[u]=R}function ke(u){var R=Ne[u];if(R)return R;var T=Object.create(null);Ne[u]=T;var $=Ae[u];if(!$)throw new Error("[lattice] missing module: "+u);return $(T,ke),T}var Re=Object.create(null);Re["@toclocoinc/lattice-grid"]=Le.LatticeGrid||null;function Ge(u){var R=Re[u],T=typeof globalThis<"u"?globalThis:typeof self<"u"?self:null;if(R)return R;if(u==="@toclocoinc/lattice-grid"&&T&&T.LatticeGrid)return T.LatticeGrid;throw new Error("[lattice] this module shares the Lattice core with the page, but it was not found. Load lattice-grid (or its script build) before this module. Missing: "+u)}fe("packages/core/src/internal/util.js",function(u,R){"use strict";Object.defineProperty(u,"VERSION",{enumerable:!0,get:function(){return z}}),Object.defineProperty(u,"reportedWarnings",{enumerable:!0,get:function(){return C}}),Object.defineProperty(u,"warnOnce",{enumerable:!0,get:function(){return b}}),Object.defineProperty(u,"infoOnce",{enumerable:!0,get:function(){return E}}),Object.defineProperty(u,"resetWarnings",{enumerable:!0,get:function(){return w}}),Object.defineProperty(u,"fail",{enumerable:!0,get:function(){return S}}),Object.defineProperty(u,"invariant",{enumerable:!0,get:function(){return B}}),Object.defineProperty(u,"DEV",{enumerable:!0,get:function(){return v}}),Object.defineProperty(u,"isObject",{enumerable:!0,get:function(){return I}}),Object.defineProperty(u,"isFunction",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(u,"isNil",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(u,"isBlank",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(u,"isCtor",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(u,"pathGetter",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(u,"pathSetter",{enumerable:!0,get:function(){return k}}),Object.defineProperty(u,"getPath",{enumerable:!0,get:function(){return j}}),Object.defineProperty(u,"setPath",{enumerable:!0,get:function(){return U}}),Object.defineProperty(u,"humanise",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(u,"escapeHtml",{enumerable:!0,get:function(){return se}}),Object.defineProperty(u,"titleCase",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(u,"expand",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(u,"toArray",{enumerable:!0,get:function(){return we}}),Object.defineProperty(u,"merge",{enumerable:!0,get:function(){return me}}),Object.defineProperty(u,"mergeRow",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(u,"Lru",{enumerable:!0,get:function(){return je}}),Object.defineProperty(u,"collator",{enumerable:!0,get:function(){return y}}),Object.defineProperty(u,"defaultCompare",{enumerable:!0,get:function(){return O}}),Object.defineProperty(u,"now",{enumerable:!0,get:function(){return L}}),Object.defineProperty(u,"nextFrame",{enumerable:!0,get:function(){return _}}),Object.defineProperty(u,"cancelFrame",{enumerable:!0,get:function(){return V}}),Object.defineProperty(u,"frameBatched",{enumerable:!0,get:function(){return re}}),Object.defineProperty(u,"settleDebounce",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(u,"whenIdle",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(u,"uid",{enumerable:!0,get:function(){return Se}});const T="1.89.1";async function $(){return T}const z="1.89.1",A=new Set,G=2e3;function g(o){if(A.add(o),A.size>G){const i=A.values().next().value;i!==void 0&&A.delete(i)}}const F=[],X=500;function Y(o,i,c){F.push({key:o,level:i,message:c.map(p=>typeof p=="string"?p:N(p)).join(" "),at:Date.now()}),F.length>X&&F.shift()}function N(o){if(o instanceof Error)return o.message;try{return JSON.stringify(o)}catch{return String(o)}}function C(){return F.map(o=>({...o}))}function J(o){if(o.length===0||typeof o[0]!="string")return o;const i=o[0].replace(/^\[lattice\]\s*/,"");return i===o[0]?o:[i,...o.slice(1)]}function b(o,...i){if(A.has(o))return;g(o);const c=J(i);Y(o,"warn",c),console.warn("[lattice]",...c)}function E(o,...i){if(A.has(o))return;g(o);const c=J(i);Y(o,"info",c),console.info("[lattice]",...c)}function w(){A.clear(),F.length=0}function S(o,i){const c=new Error(`[lattice] ${o}`);throw i!==void 0&&(c.cause=i),c}function B(o,i){o||S(i)}const v=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function I(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function Q(o){return typeof o=="function"}function oe(o){return o==null}function ue(o){return o==null||o===""}function ae(o){return typeof o!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(o))?!0:!!(o.prototype&&Object.getOwnPropertyNames(o.prototype).length>1)}const ee=new Map;function Z(o){let i=ee.get(o);if(i)return i;if(!o.includes("."))i=c=>c?.[o];else{const c=o.split("."),p=c.length;i=D=>{let K=D;for(let W=0;W<p;W++){if(K==null)return;K=K[c[W]]}return K}}return ee.set(o,i),i}const q=new Map;function k(o){let i=q.get(o);if(i)return i;if(!o.includes("."))i=(c,p)=>{c!=null&&(c[o]=p)};else{const c=o.split("."),p=c.length-1;i=(D,K)=>{let W=D;for(let H=0;H<p;H++){if(W==null)return;const de=c[H];W[de]==null&&(W[de]={}),W=W[de]}W!=null&&(W[c[p]]=K)}}return q.set(o,i),i}function j(o,i){return Z(i)(o)}function U(o,i,c){k(i)(o,c)}function ne(o){return o?(o.includes(".")?o.slice(o.lastIndexOf(".")+1):o).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,c=>c.toUpperCase()):""}const ie={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function se(o){const i=o==null?"":String(o);return/[&<>"']/.test(i)?i.replace(/[&<>"']/g,c=>ie[c]):i}function Oe(o){return String(o).replace(/\w\S*/g,i=>i[0].toUpperCase()+i.slice(1).toLowerCase())}function Pe(o,i,c){if(o!==void 0)return o===!0?{enabled:!0,...c}:o===!1?{enabled:!1}:I(o)?o:{[i]:o,enabled:!0}}function we(o){return o==null?[]:Array.isArray(o)?o:[o]}const ye=Object.freeze(new Set(["__proto__","constructor","prototype"]));function me(o,i){if(!I(o))return I(i)?{...i}:i;if(!I(i))return i===void 0?o:i;const c={...o};for(const p of Object.keys(i)){if(ye.has(p))continue;const D=i[p];D!==void 0&&(c[p]=I(D)&&I(c[p])?me(c[p],D):D)}return c}function ge(o,i){if(!I(o)||!I(i)||o===i)return i;const c=Object.create(Object.getPrototypeOf(o));return Object.assign(c,o,i),c}class je{#n;#e=new Map;#t;constructor(i=256,c=null){this.#n=i,this.#t=c}get size(){return this.#e.size}get max(){return this.#n}set max(i){this.#n=i,this.#r()}has(i){return this.#e.has(i)}get(i){const c=this.#e;if(!c.has(i))return;const p=c.get(i);return c.delete(i),c.set(i,p),p}peek(i){return this.#e.get(i)}set(i,c){const p=this.#e;return p.has(i)&&p.delete(i),p.set(i,c),this.#r(),c}delete(i){const c=this.#e.get(i);return this.#e.delete(i)&&this.#t&&this.#t(c,i),c}clear(){if(this.#t)for(const[i,c]of this.#e)this.#t(c,i);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const i=this.#e;for(;i.size>this.#n;){const c=i.keys().next().value,p=i.get(c);i.delete(c),this.#t&&this.#t(p,c)}}}const a=new Map;function y(o,i){const c=`${o||""}|${i?JSON.stringify(i):""}`;let p=a.get(c);return p||(p=new Intl.Collator(o||void 0,{numeric:!0,sensitivity:"variant",...i}),a.set(c,p)),p}function O(o,i){if(o===i)return 0;if(o==null)return 1;if(i==null)return-1;if(typeof o=="number"&&typeof i=="number")return Number.isNaN(o)?Number.isNaN(i)?0:1:Number.isNaN(i)||o<i?-1:o>i?1:0;const c=String(o),p=String(i);return c<p?-1:c>p?1:0}function L(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const x=typeof requestAnimationFrame=="function";function _(o){return x?requestAnimationFrame(o):setTimeout(()=>o(L()),16)}function V(o){o!=null&&(x?cancelAnimationFrame(o):clearTimeout(o))}function re(o){let i=null,c=null;const p=()=>{i=null;const K=c;c=null,o(...K||[])},D=(...K)=>{c=K,i===null&&(i=_(p))};return D.cancel=()=>{V(i),i=null,c=null},D.flush=()=>{i!==null&&(V(i),p())},D}function ce(o,i){let c=null,p=null;const D=()=>{if(c=null,p===null)return;const H=p;p=null,o(...H),K()},K=()=>{c=setTimeout(D,i),typeof c?.unref=="function"&&c.unref()},W=(...H)=>{c===null?(o(...H),K()):(p=H,clearTimeout(c),K())};return W.flush=()=>{if(c!==null&&clearTimeout(c),c=null,p===null)return;const H=p;p=null,o(...H)},W.cancel=()=>{c!==null&&clearTimeout(c),c=null,p=null},W.pending=()=>c!==null||p!==null,W}function pe(o,i=50){return typeof requestIdleCallback=="function"?requestIdleCallback(o,{timeout:i}):setTimeout(()=>o({timeRemaining:()=>0,didTimeout:!0}),1)}let le=0;function Se(o="l"){return`${o}${(++le).toString(36)}`}}),fe("packages/core/src/format/number.js",function(u,R){"use strict";Object.defineProperty(u,"compileNumber",{enumerable:!0,get:function(){return z}});const $=R("packages/core/src/internal/util.js").isNil;function z(A,G){const g=A||{},F=g.locale||G||void 0,X=g.style||"decimal",Y=typeof g.scale=="number"?g.scale:1,N=g.nullDisplay??"",C=g.zeroDisplay,J=g.prefix||"",b=g.suffix||"",E=g.negative||"minus",w=g.signed===!0,S={style:X,notation:g.notation||"standard"};X==="currency"&&(S.currency=g.currency||"USD",g.currencyDisplay&&(S.currencyDisplay=g.currencyDisplay)),typeof g.decimals=="number"?(S.minimumFractionDigits=g.decimals,S.maximumFractionDigits=g.decimals):(typeof g.minDecimals=="number"&&(S.minimumFractionDigits=g.minDecimals),typeof g.maxDecimals=="number"&&(S.maximumFractionDigits=g.maxDecimals),S.minimumFractionDigits>(S.maximumFractionDigits??20)&&(S.maximumFractionDigits=S.minimumFractionDigits)),g.thousandsSeparator===!1&&(S.useGrouping=!1),S.notation==="compact"&&(S.compactDisplay=g.compactDisplay||"short");const B=new Intl.NumberFormat(F,S),v=typeof g.thousandsSeparator=="string"?g.thousandsSeparator:null,I=typeof g.decimalSeparator=="string"?g.decimalSeparator:null;let Q=",",oe=".";if(v||I)for(const k of B.formatToParts(12345.6))k.type==="group"?Q=k.value:k.type==="decimal"&&(oe=k.value);const ue=k=>{let j=k;return v&&(j=j.split(Q).join("")),I&&(j=j.split(oe).join("")),v&&(j=j.split("").join(v)),I&&(j=j.split("").join(I)),j},ae=!!(v||I),ee=J!==""&&X==="currency",Z=k=>{let j;if(ee){const U=B.formatToParts(k);let ne=!1;j="";for(const ie of U)j+=ie.value,!ne&&ie.type==="currency"&&(j+=J,ne=!0);ne||(j=J+j)}else j=J+B.format(k);return ae&&(j=ue(j)),j+b},q=k=>{if($(k)||k==="")return N;const j=typeof k=="number"?k:Number(k);if(Number.isNaN(j))return N;const U=Y===1?j:j*Y;return U===0&&C!==void 0?C:U<0?E==="parentheses"?`(${Z(-U)})`:E==="suffix"?`${Z(-U)}-`:Z(U):w&&U>0?`+${Z(U)}`:Z(U)};return q.negativeClass=g.negativeClass||null,q.spec=g,q}}),fe("packages/modules/geometry/geodata.js",function(u,R){"use strict";Object.defineProperty(u,"GEOMETRY_KINDS",{enumerable:!0,get:function(){return G}}),Object.defineProperty(u,"SPATIAL_OPERATORS",{enumerable:!0,get:function(){return g}}),Object.defineProperty(u,"GEOMETRY_OPERATORS",{enumerable:!0,get:function(){return F}}),Object.defineProperty(u,"EARTH_RADIUS",{enumerable:!0,get:function(){return X}}),Object.defineProperty(u,"toWkt",{enumerable:!0,get:function(){return U}}),Object.defineProperty(u,"toWkb",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(u,"readGeometry",{enumerable:!0,get:function(){return y}}),Object.defineProperty(u,"parseGeometry",{enumerable:!0,get:function(){return L}}),Object.defineProperty(u,"haversine",{enumerable:!0,get:function(){return _}}),Object.defineProperty(u,"geometryInfo",{enumerable:!0,get:function(){return c}}),Object.defineProperty(u,"geometryKind",{enumerable:!0,get:function(){return p}}),Object.defineProperty(u,"spatialOperand",{enumerable:!0,get:function(){return K}}),Object.defineProperty(u,"spatialPredicate",{enumerable:!0,get:function(){return We}});const T=R("packages/core/src/internal/util.js"),$=T.isNil,z=T.isObject,A=T.warnOnce,G=Object.freeze(["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"]),g=Object.freeze(["withinBbox","withinPolygon","intersects","withinDistance"]),F=Object.freeze([...g,"blank","notBlank"]),X=63710088e-1,Y=Math.PI/180,N=16,C=1e-12;class J extends Error{}function b(t){throw new J(t)}function E(t){(!Array.isArray(t)||t.length<2)&&b("a position needs at least two numbers");const e=Number(t[0]),n=Number(t[1]);return(typeof t[0]!="number"||typeof t[1]!="number"||!Number.isFinite(e)||!Number.isFinite(n))&&b("a coordinate is not a finite number"),[e,n]}function w(t,e,n){Array.isArray(t)||b(`${n} is not an array of positions`);const r=t.map(E);return r.length<e&&b(`${n} needs at least ${e} positions, found ${r.length}`),r}function S(t){const e=w(t,3,"a polygon ring"),n=e[0],r=e[e.length-1];return(n[0]!==r[0]||n[1]!==r[1])&&e.push([n[0],n[1]]),e.length<4&&b(`a polygon ring needs at least 3 distinct corners, found ${e.length-1}`),e}function B(t){return(!Array.isArray(t)||t.length===0)&&b("a polygon needs at least an outer ring"),t.map(S)}function v(t,e){switch(e>N&&b("geometry collections nest too deeply"),z(t)||b("GeoJSON must be an object"),t.type){case"Feature":return t.geometry==null?null:v(t.geometry,e+1);case"FeatureCollection":return b("a FeatureCollection holds many rows, not one value; load its features as rows");case"Point":return{type:"Point",coordinates:E(t.coordinates)};case"MultiPoint":return{type:"MultiPoint",coordinates:w(t.coordinates,1,"a MultiPoint")};case"LineString":return{type:"LineString",coordinates:w(t.coordinates,2,"a LineString")};case"MultiLineString":return(!Array.isArray(t.coordinates)||!t.coordinates.length)&&b("a MultiLineString needs at least one line"),{type:"MultiLineString",coordinates:t.coordinates.map(n=>w(n,2,"a LineString"))};case"Polygon":return{type:"Polygon",coordinates:B(t.coordinates)};case"MultiPolygon":return(!Array.isArray(t.coordinates)||!t.coordinates.length)&&b("a MultiPolygon needs at least one polygon"),{type:"MultiPolygon",coordinates:t.coordinates.map(B)};case"GeometryCollection":{(!Array.isArray(t.geometries)||!t.geometries.length)&&b("a GeometryCollection needs at least one geometry");const n=t.geometries.map(r=>v(r,e+1)).filter(Boolean);return n.length?{type:"GeometryCollection",geometries:n}:null}default:return b(`"${String(t.type)}" is not a GeoJSON geometry type`)}}const I=Object.freeze({POINT:"Point",LINESTRING:"LineString",POLYGON:"Polygon",MULTIPOINT:"MultiPoint",MULTILINESTRING:"MultiLineString",MULTIPOLYGON:"MultiPolygon",GEOMETRYCOLLECTION:"GeometryCollection"}),Q=/[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/y,oe=/[A-Za-z]+/y,ue=/^\s*(?:SRID\s*=\s*\d+\s*;\s*)?[A-Za-z]+\s*(?:ZM|Z|M)?\s*(?:\(|EMPTY\b)/i;class ae{text;at=0;constructor(e){this.text=e}space(){for(;this.at<this.text.length&&/\s/.test(this.text[this.at]);)this.at++}expect(e){this.space(),this.text[this.at]!==e&&b(`WKT expected "${e}" at character ${this.at+1}, found "${this.text[this.at]??"the end"}"`),this.at++}accept(e){return this.space(),this.text[this.at]===e?(this.at++,!0):!1}word(){this.space(),oe.lastIndex=this.at;const e=oe.exec(this.text);return e?(this.at+=e[0].length,e[0].toUpperCase()):""}numberNext(){return this.space(),Q.lastIndex=this.at,Q.test(this.text)}number(){this.space(),Q.lastIndex=this.at;const e=Q.exec(this.text);return e||b(`WKT expected a number at character ${this.at+1}`),this.at+=e[0].length,Number(e[0])}position(){const e=this.number(),n=this.number();for(;this.numberNext();)this.number();return[e,n]}positionList(){this.expect("(");const e=[this.position()];for(;this.accept(",");)e.push(this.position());return this.expect(")"),e}empty(){const e=this.at;return this.word()==="EMPTY"?!0:(this.at=e,!1)}geometry(e){e>N&&b("geometry collections nest too deeply");const n=this.word(),r=I[n];r||b(n?`"${n}" is not a WKT geometry type`:"WKT expected a geometry type");const s=this.at,l=this.word();return l!=="Z"&&l!=="M"&&l!=="ZM"&&(this.at=s),this.empty()?null:this.body(r,e)}body(e,n){switch(e){case"Point":{this.expect("(");const r=this.position();return this.expect(")"),{type:"Point",coordinates:r}}case"LineString":return{type:"LineString",coordinates:w(this.positionList(),2,"a LineString")};case"Polygon":return{type:"Polygon",coordinates:this.polygonBody()};case"MultiPoint":{this.expect("(");const r=[];do this.empty()||(this.accept("(")?(r.push(this.position()),this.expect(")")):r.push(this.position()));while(this.accept(","));return this.expect(")"),r.length?{type:"MultiPoint",coordinates:r}:null}case"MultiLineString":{const r=this.parts(()=>w(this.positionList(),2,"a LineString"));return r.length?{type:"MultiLineString",coordinates:r}:null}case"MultiPolygon":{const r=this.parts(()=>this.polygonBody());return r.length?{type:"MultiPolygon",coordinates:r}:null}default:{this.expect("(");const r=[];do{const s=this.geometry(n+1);s&&r.push(s)}while(this.accept(","));return this.expect(")"),r.length?{type:"GeometryCollection",geometries:r}:null}}}parts(e){this.expect("(");const n=[];do this.empty()||n.push(e());while(this.accept(","));return this.expect(")"),n}polygonBody(){return B(this.parts(()=>this.positionList()))}}function ee(t){const e=new ae(String(t).replace(/^\s*SRID\s*=\s*\d+\s*;/i,"")),n=e.geometry(0);return e.space(),e.at<e.text.length&&b(`WKT has unexpected text after the geometry at character ${e.at+1}`),n}function Z(t){return Object.is(t,-0)?"0":String(t)}function q(t){return`${Z(t[0])} ${Z(t[1])}`}function k(t){return`(${t.map(q).join(", ")})`}function j(t){return`(${t.map(k).join(", ")})`}function U(t){const e=L(t);return e?ne(e):""}function ne(t){switch(t.type){case"Point":return`POINT (${q(t.coordinates)})`;case"LineString":return`LINESTRING ${k(t.coordinates)}`;case"Polygon":return`POLYGON ${j(t.coordinates)}`;case"MultiPoint":return`MULTIPOINT (${t.coordinates.map(e=>`(${q(e)})`).join(", ")})`;case"MultiLineString":return`MULTILINESTRING (${t.coordinates.map(k).join(", ")})`;case"MultiPolygon":return`MULTIPOLYGON (${t.coordinates.map(j).join(", ")})`;default:return`GEOMETRYCOLLECTION (${t.geometries.map(ne).join(", ")})`}}class ie{view;at=0;constructor(e){this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}need(e){this.at+e>this.view.byteLength&&b(`WKB ends after ${this.view.byteLength} bytes, in the middle of a geometry`)}u8(){return this.need(1),this.view.getUint8(this.at++)}u32(e){this.need(4);const n=this.view.getUint32(this.at,e);return this.at+=4,n}f64(e){this.need(8);const n=this.view.getFloat64(this.at,e);return this.at+=8,n}count(e,n){const r=this.u32(e);return r*n>this.view.byteLength-this.at&&b(`WKB claims ${r} elements, more than its bytes can hold`),r}position(e,n){const r=this.f64(e),s=this.f64(e);for(let l=2;l<n;l++)this.f64(e);return[r,s]}positions(e,n){const r=this.count(e,8*n),s=new Array(r);for(let l=0;l<r;l++)s[l]=this.position(e,n);return s}geometry(e,n){e>N&&b("geometry collections nest too deeply");const r=this.u8();r!==0&&r!==1&&b(`WKB byte-order mark is ${r}, not 0 or 1`);const s=r===1,l=this.u32(s);let f=2;l&2147483648&&f++,l&1073741824&&f++,l&536870912&&this.u32(s);let m=l&268435455;if(m>=1e3){const M=Math.floor(m/1e3);M>3&&b(`WKB geometry type ${m} is not one this reads`),f=2+(M===3?2:1),m%=1e3}const P=G[m-1];switch(P||b(`WKB geometry type ${m} is not one this reads`),n&&P!==n&&b(`a part of a WKB Multi${n} is a ${P}`),P){case"Point":{const M=this.position(s,f);return Number.isNaN(M[0])&&Number.isNaN(M[1])?null:{type:"Point",coordinates:E(M)}}case"LineString":return{type:"LineString",coordinates:w(this.positions(s,f),2,"a LineString")};case"Polygon":{const M=this.count(s,4),d=[];for(let h=0;h<M;h++)d.push(this.positions(s,f));return M?{type:"Polygon",coordinates:B(d)}:null}default:{const M=this.count(s,5),d=P==="GeometryCollection"?void 0:P.slice(5),h=[];for(let te=0;te<M;te++){const Me=this.geometry(e+1,d);Me&&h.push(Me)}return h.length?P==="GeometryCollection"?{type:P,geometries:h}:{type:P,coordinates:h.map(te=>te.coordinates)}:null}}}}function se(t){const e=new ie(t),n=e.geometry(0);return e.at!==t.byteLength&&b(`WKB has ${t.byteLength-e.at} bytes left over after the geometry`),n}function Oe(t){const e=L(t);if(!e)return null;const n=[];let r=0;const s=d=>{const h=new DataView(new ArrayBuffer(5));h.setUint8(0,1),h.setUint32(1,G.indexOf(d)+1,!0),n.push(h),r+=5},l=d=>{const h=new DataView(new ArrayBuffer(4));h.setUint32(0,d,!0),n.push(h),r+=4},f=d=>{const h=new DataView(new ArrayBuffer(16*d.length));d.forEach((te,Me)=>{h.setFloat64(Me*16,te[0],!0),h.setFloat64(Me*16+8,te[1],!0)}),n.push(h),r+=16*d.length},m=d=>{switch(s(d.type),d.type){case"Point":f([d.coordinates]);break;case"LineString":l(d.coordinates.length),f(d.coordinates);break;case"Polygon":l(d.coordinates.length);for(const h of d.coordinates)l(h.length),f(h);break;case"GeometryCollection":l(d.geometries.length);for(const h of d.geometries)m(h);break;default:{const h=d.type.slice(5);l(d.coordinates.length);for(const te of d.coordinates)m({type:h,coordinates:te})}}};m(e);const P=new Uint8Array(r);let M=0;for(const d of n)P.set(new Uint8Array(d.buffer),M),M+=d.byteLength;return P}const Pe=/^0[01](?:[0-9a-fA-F]{2})+$/,we=/^[A-Za-z0-9+/_-]+={0,2}$/,ye=(()=>{const t=new Int16Array(128).fill(-1),e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=n;return t[45]=62,t[95]=63,t})();function me(t){const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++)e[n]=parseInt(t.slice(n*2,n*2+2),16);return e}function ge(t){const e=t.replace(/=+$/,""),n=new Uint8Array(Math.floor(e.length*3/4));let r=0,s=0,l=0;for(let f=0;f<e.length;f++)s=s<<6|ye[e.charCodeAt(f)],r+=6,r>=8&&(r-=8,n[l++]=s>>r&255);return n.subarray(0,l)}function je(t){const e=t.trim();if(e==="")return null;if(e[0]==="{"){let n;try{n=JSON.parse(e)}catch{return b("the text starts like GeoJSON but is not valid JSON")}return v(n,0)}if(Pe.test(e))return se(me(e));if(ue.test(e))return ee(e);if(we.test(e)){const n=ge(e);if(n.length>=5&&(n[0]===0||n[0]===1))return se(n)}return b("the text is not WKT, GeoJSON, or hex or base64 WKB")}const a=new WeakSet;function y(t){if($(t))return{geometry:null,reason:null};if(typeof t=="object"&&a.has(t))return{geometry:t,reason:null};try{let e;return typeof t=="string"?e=je(t):t instanceof Uint8Array?e=se(t):t instanceof ArrayBuffer?e=se(new Uint8Array(t)):ArrayBuffer.isView(t)?e=se(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)):z(t)?e=v(t,0):b(`${Array.isArray(t)?"an array":`a ${typeof t}`} is not a geometry`),e&&O(e),{geometry:e||null,reason:null}}catch(e){if(e instanceof J)return{geometry:null,reason:e.message};throw e}}function O(t){if(a.add(t),t.type==="GeometryCollection")for(const e of t.geometries)O(e)}function L(t){return y(t).geometry}function x(t,e){switch(t.type){case"Point":e(t.coordinates);break;case"MultiPoint":case"LineString":t.coordinates.forEach(e);break;case"MultiLineString":case"Polygon":for(const n of t.coordinates)n.forEach(e);break;case"MultiPolygon":for(const n of t.coordinates)for(const r of n)r.forEach(e);break;default:for(const n of t.geometries)x(n,e)}}function _(t,e){const n=t[1]*Y,r=e[1]*Y,s=r-n,l=(e[0]-t[0])*Y,f=Math.sin(s/2)**2+Math.cos(n)*Math.cos(r)*Math.sin(l/2)**2;return 2*X*Math.asin(Math.min(1,Math.sqrt(f)))}function V(t){let e=0;for(let n=1;n<t.length;n++)e+=_(t[n-1],t[n]);return e}function re(t){const e=t.length-1;if(e<3)return 0;let n=0;for(let r=0;r<e;r++){const s=t[(r-1+e)%e],l=t[(r+1)%e];n+=(l[0]-s[0])*Y*Math.sin(t[r][1]*Y)}return Math.abs(n)*X*X/2}function ce(t){let e=re(t[0]);for(let n=1;n<t.length;n++)e-=re(t[n]);return Math.max(0,e)}function pe(t){let e=0,n=0,r=0;for(let s=0;s<t.length-1;s++){const[l,f]=t[s],[m,P]=t[s+1],M=l*P-m*f;e+=M,n+=(l+m)*M,r+=(f+P)*M}return{a:e,cx:n,cy:r}}function le(){let t=0,e=0,n=0;return{add(r,s,l){t+=r*l,e+=s*l,n+=l},get(){return n>0?[t/n,e/n]:null}}}function Se(t){let e=0,n=0;for(const r of t)e+=r[0],n+=r[1];return[e/t.length,n/t.length]}function o(t,e){switch(t.type){case"Point":e[0].add(t.coordinates[0],t.coordinates[1],1);break;case"MultiPoint":for(const n of t.coordinates)e[0].add(n[0],n[1],1);break;case"LineString":case"MultiLineString":{const n=t.type==="LineString"?[t.coordinates]:t.coordinates;for(const r of n){for(let s=1;s<r.length;s++){const[l,f]=r[s-1],[m,P]=r[s],M=Math.hypot(m-l,P-f);e[1].add((l+m)/2,(f+P)/2,M)}for(const s of r)e[0].add(s[0],s[1],1)}break}case"Polygon":case"MultiPolygon":{const n=t.type==="Polygon"?[t.coordinates]:t.coordinates;for(const r of n){let s=0,l=0,f=0;r.forEach((P,M)=>{const d=pe(P),h=(M===0?1:-1)*(d.a<0?-1:1);s+=h*d.a,l+=h*d.cx,f+=h*d.cy}),Math.abs(s)>C&&e[2].add(l/(3*s),f/(3*s),Math.abs(s)/2);const m=r[0].slice(0,-1);for(const P of m)e[0].add(P[0],P[1],1)}break}default:for(const n of t.geometries)o(n,e)}}const i=new WeakMap;function c(t){const e=L(t);if(!e)return null;const n=i.get(e);if(n)return n;const r=[1/0,1/0,-1/0,-1/0];x(e,d=>{d[0]<r[0]&&(r[0]=d[0]),d[1]<r[1]&&(r[1]=d[1]),d[0]>r[2]&&(r[2]=d[0]),d[1]>r[3]&&(r[3]=d[1])});const s=[le(),le(),le()];o(e,s);const l=s[2].get()||s[1].get()||s[0].get()||Se([[r[0],r[1]],[r[2],r[3]]]);let f=0,m=0;const P=d=>{switch(d.type){case"LineString":f+=V(d.coordinates);break;case"MultiLineString":for(const h of d.coordinates)f+=V(h);break;case"Polygon":m+=ce(d.coordinates);for(const h of d.coordinates)f+=V(h);break;case"MultiPolygon":for(const h of d.coordinates){m+=ce(h);for(const te of h)f+=V(te)}break;case"GeometryCollection":for(const h of d.geometries)P(h);break;default:break}};P(e);const M=Object.freeze({kind:e.type,bbox:Object.freeze(r),centroid:Object.freeze(l),length:f,area:m});return i.set(e,M),M}function p(t){const e=c(t);return e?e.kind:null}function D(t,e){const n=typeof t=="string"?t.split(/[\s,;]+/).filter(Boolean):t;if(!Array.isArray(n)||n.length!==e)return null;const r=n.map(s=>typeof s=="number"?s:typeof s=="string"?Number(s):NaN);return r.every(Number.isFinite)?r:null}function K(t,e){if(t==="withinBbox"){const n=D(e,4);return n?n[0]>n[2]?{reason:'the box crosses the antimeridian (its west edge is east of its east edge), which is not supported; split it into two withinBbox conditions joined by "or"'}:n[1]>n[3]?{reason:"the box's minLat is above its maxLat"}:{operand:n}:{reason:"withinBbox needs [minLon, minLat, maxLon, maxLat]"}}if(t==="withinDistance"){let n=null;if(z(e)&&!Array.isArray(e)){const r=e;n=D([r.lon,r.lat,r.metres],3)}else n=D(e,3);return!n||n[2]<0?{reason:"withinDistance needs { lon, lat, metres } with metres of 0 or more"}:{operand:{lon:n[0],lat:n[1],metres:n[2]}}}if(t==="withinPolygon"||t==="intersects"){const n=t==="intersects"?D(e,4):null;if(n){if(n[0]>n[2]||n[1]>n[3])return{reason:"the box's minimum is above its maximum"};const[l,f,m,P]=n;return{operand:{type:"Polygon",coordinates:[[[l,f],[m,f],[m,P],[l,P],[l,f]]]}}}const{geometry:r,reason:s}=y(e);return r?t==="withinPolygon"&&r.type!=="Polygon"&&r.type!=="MultiPolygon"?{reason:`withinPolygon needs a Polygon or MultiPolygon, not a ${r.type}`}:{operand:r}:{reason:`${t} needs a geometry: ${s||"none was given"}`}}return{reason:`"${t}" is not a spatial operator`}}function W(t,e){const[n,r]=t;let s=!1;for(let l=0,f=e.length-2;l<e.length-1;f=l++){const[m,P]=e[l],[M,d]=e[f];P>r!=d>r&&n<(M-m)*(r-P)/(d-P)+m&&(s=!s)}return s}function H(t,e){if(!W(t,e[0]))return!1;for(let n=1;n<e.length;n++)if(W(t,e[n]))return!1;return!0}function de(t,e={points:[],segments:[],polygons:[]}){const n=r=>{for(let s=1;s<r.length;s++)e.segments.push([r[s-1],r[s]]);for(const s of r)e.points.push(s)};switch(t.type){case"Point":e.points.push(t.coordinates);break;case"MultiPoint":for(const r of t.coordinates)e.points.push(r);break;case"LineString":n(t.coordinates);break;case"MultiLineString":t.coordinates.forEach(n);break;case"Polygon":e.polygons.push(t.coordinates),t.coordinates.forEach(n);break;case"MultiPolygon":for(const r of t.coordinates)e.polygons.push(r),r.forEach(n);break;default:for(const r of t.geometries)de(r,e)}return e}function he(t,e,n){const r=(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0]);return Math.abs(r)<=C?0:Math.sign(r)}function be(t,e,n){return t[0]>=Math.min(e[0],n[0])-C&&t[0]<=Math.max(e[0],n[0])+C&&t[1]>=Math.min(e[1],n[1])-C&&t[1]<=Math.max(e[1],n[1])+C}function Ie(t,e){const[n,r]=t,[s,l]=e,f=he(n,r,s),m=he(n,r,l),P=he(s,l,n),M=he(s,l,r);return f!==m&&P!==M?!0:f===0&&be(s,n,r)||m===0&&be(l,n,r)||P===0&&be(n,s,l)||M===0&&be(r,s,l)}function $e(t,e){return t[0]<=e[2]&&e[0]<=t[2]&&t[1]<=e[3]&&e[1]<=t[3]}function De(t,e){const n=c(t),r=c(e);if(!$e(n.bbox,r.bbox))return!1;const s=de(t),l=de(e);for(const f of l.polygons)for(const m of s.points)if(H(m,f))return!0;for(const f of s.polygons)for(const m of l.points)if(H(m,f))return!0;for(const f of s.segments)for(const m of l.segments)if(Ie(f,m))return!0;for(const f of s.points){for(const m of l.points)if(Math.abs(f[0]-m[0])<=C&&Math.abs(f[1]-m[1])<=C)return!0;for(const m of l.segments)if(he(m[0],m[1],f)===0&&be(f,m[0],m[1]))return!0}for(const f of l.points)for(const m of s.segments)if(he(m[0],m[1],f)===0&&be(f,m[0],m[1]))return!0;return!1}function We(t,e){const{operand:n,reason:r}=K(t,e);if(r)return A(`filter:geometry:${t}`,`a "${t}" condition was refused: ${r}. It matches no row rather than guessing.`),()=>!1;switch(t){case"withinBbox":return s=>{const l=c(s);if(!l)return!1;const f=l.bbox;return f[0]>=n[0]&&f[1]>=n[1]&&f[2]<=n[2]&&f[3]<=n[3]};case"withinPolygon":{const s=n.type==="Polygon"?[n.coordinates]:n.coordinates,l=f=>s.some(m=>H(f,m));return f=>{const m=L(f);return m?m.type==="Point"?l(m.coordinates):m.type==="MultiPoint"?m.coordinates.every(l):l(c(m).centroid):!1}}case"intersects":return s=>{const l=L(s);return!!l&&De(l,n)};default:{const s=[n.lon,n.lat];return l=>{const f=c(l);return!!f&&_(f.centroid,s)<=n.metres}}}}}),fe("packages/modules/geometry/messages.js",function(u,R){"use strict";Object.defineProperty(u,"withFallback",{enumerable:!0,get:function(){return z}});const T=Object.freeze({"filter.op.withinBbox":"Within box","filter.op.withinPolygon":"Within polygon","filter.op.intersects":"Intersects","filter.op.withinDistance":"Within distance of","filter.geometry.bbox":"minLon, minLat, maxLon, maxLat","filter.geometry.polygon":"Polygon as WKT or GeoJSON","filter.geometry.shape":"WKT, GeoJSON, or minLon, minLat, maxLon, maxLat","filter.geometry.distance":"lon, lat, metres","geometry.points":["point","points"],"geometry.vertices":["vertex","vertices"],"geometry.parts":["part","parts"],"geometry.north":"{value}°N","geometry.south":"{value}°S","geometry.east":"{value}°E","geometry.west":"{value}°W"});function $(A,G){const g=T[A];return g===void 0?A:Array.isArray(g)?`${G.count} ${G.count===1?g[0]:g[1]}`:g.replace("{value}",String(G.value??""))}function z(A){return{t(G,g={}){const F=A&&typeof A.t=="function"?A.t(G,g):G;return F===G?$(G,g):F}}}}),fe("packages/modules/geometry/filter.js",function(u,R){"use strict";Object.defineProperty(u,"GeometryFilter",{enumerable:!0,get:function(){return C}}),Object.defineProperty(u,"default",{enumerable:!0,get:function(){return J}});const T=Ge("@toclocoinc/lattice-grid"),$=T.ConditionFilter;if(typeof $>"u")throw new Error("[lattice] geometry needs ConditionFilter from the lattice-grid module. Load lattice-grid before geometry.");const z=T.createMessages;if(typeof z>"u")throw new Error("[lattice] geometry needs createMessages from the lattice-grid module. Load lattice-grid before geometry.");const A=R("packages/modules/geometry/geodata.js"),G=A.spatialOperand,g=A.toWkt,F=A.parseGeometry,Y=R("packages/modules/geometry/messages.js").withFallback,N=Object.freeze({withinBbox:"filter.geometry.bbox",withinPolygon:"filter.geometry.polygon",intersects:"filter.geometry.shape",withinDistance:"filter.geometry.distance"});class C extends ${static operators=Object.freeze(["withinBbox","withinPolygon","intersects","withinDistance","blank","notBlank"]);static wire=Object.freeze({withinBbox:"withinBbox",withinPolygon:"withinPolygon",intersects:"intersects",withinDistance:"withinDistance",blank:"blank",notBlank:"notBlank"});static type="geometry";init(E){const w=E||{},S=w.messages||w.grid&&w.grid.messages||z();super.init({...w,messages:Y(S)})}static defaultOperator="withinBbox";parseInput(E){const w=String(E??"").trim();return w===""?null:w}formatInput(E){if(E==null)return"";if(typeof E=="string")return E;if(Array.isArray(E))return E.join(", ");const w=E;return typeof w.lon=="number"&&typeof w.lat=="number"?`${w.lon}, ${w.lat}, ${w.metres}`:F(E)?g(E):""}nodes(){const E=[];for(const w of super.nodes()){const S=w;if(!N[S.op]){E.push(w);continue}const{operand:B}=G(S.op,S.value);B!==void 0&&E.push({...S,value:B})}return E}hintFor(E){const w=N[E];return w?this.messages.t(w):null}}const J=C}),fe("packages/modules/geometry/type.js",function(u,R){"use strict";Object.defineProperty(u,"GEOMETRY_KINDS",{enumerable:!0,get:function(){return C}}),Object.defineProperty(u,"SPATIAL_OPERATORS",{enumerable:!0,get:function(){return J}}),Object.defineProperty(u,"GEOMETRY_OPERATORS",{enumerable:!0,get:function(){return b}}),Object.defineProperty(u,"EARTH_RADIUS",{enumerable:!0,get:function(){return E}}),Object.defineProperty(u,"readGeometry",{enumerable:!0,get:function(){return w}}),Object.defineProperty(u,"parseGeometry",{enumerable:!0,get:function(){return S}}),Object.defineProperty(u,"toWkt",{enumerable:!0,get:function(){return B}}),Object.defineProperty(u,"toWkb",{enumerable:!0,get:function(){return v}}),Object.defineProperty(u,"geometryInfo",{enumerable:!0,get:function(){return I}}),Object.defineProperty(u,"geometryKind",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(u,"haversine",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(u,"spatialOperand",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(u,"spatialPredicate",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(u,"GEOMETRY_FORMAT_PATTERNS",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(u,"compareGeometry",{enumerable:!0,get:function(){return q}}),Object.defineProperty(u,"formatGeometry",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(u,"GEOMETRY_TYPES",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(u,"default",{enumerable:!0,get:function(){return je}});const T=R("packages/core/src/internal/util.js"),$=T.isNil,z=T.warnOnce,G=R("packages/core/src/format/number.js").compileNumber,F=R("packages/modules/geometry/filter.js").GeometryFilter,Y=R("packages/modules/geometry/messages.js").withFallback,N=R("packages/modules/geometry/geodata.js"),C=N.GEOMETRY_KINDS,J=N.SPATIAL_OPERATORS,b=N.GEOMETRY_OPERATORS,E=N.EARTH_RADIUS,w=N.readGeometry,S=N.parseGeometry,B=N.toWkt,v=N.toWkb,I=N.geometryInfo,Q=N.geometryKind,oe=N.haversine,ue=N.spatialOperand,ae=N.spatialPredicate,ee=Object.freeze(["summary","wkt","geojson"]);function Z(a,y){const{geometry:O,reason:L}=w(a);if(L){const x=y&&y.colId||"?";z(`geometry:refused:${x}`,`column "${x}" refused a value that is not a geometry (${L}); the cell is left blank rather than storing it. A geometry column accepts WKB, WKT or GeoJSON.`)}return O}function q(a,y){const O=I(a),L=I(y);if(!O||!L){if(O)return-1;if(L)return 1;if($(a))return $(y)?0:1;if($(y))return-1;const V=String(a),re=String(y);return V<re?-1:V>re?1:0}const x=O.centroid[1]-L.centroid[1];if(x!==0)return x<0?-1:1;const _=O.centroid[0]-L.centroid[0];return _<0?-1:_>0?1:0}const k=new Map;function j(a,y,O){const L=`${a||""}|${O}`;let x=k.get(L);if(!x){const _=G(y,a);x=V=>_(V),k.set(L,x)}return x}function U(a,y){return a<1e3?`${j(y,{maxDecimals:0},"m")(a)} m`:`${j(y,{maxDecimals:1},"km")(a/1e3)} km`}function ne(a,y){return a<1e6?`${j(y,{maxDecimals:0},"m")(a)} m²`:`${j(y,{maxDecimals:2},"km2")(a/1e6)} km²`}function ie(a){switch(a.type){case"Point":return 1;case"MultiPoint":case"LineString":return a.coordinates.length;case"MultiLineString":return a.coordinates.reduce((y,O)=>y+O.length,0);case"Polygon":return a.coordinates.reduce((y,O)=>y+O.length-1,0);case"MultiPolygon":return a.coordinates.reduce((y,O)=>y+O.reduce((L,x)=>L+x.length-1,0),0);default:return a.geometries.reduce((y,O)=>y+ie(O),0)}}function se(a){return Y(a&&a.messages)}function Oe(a){return{compile:y=>ae(a,y),check:y=>ue(a,y).reason||null}}function Pe(a,y,O){const L=I(a);if(a.type==="Point"){const ce=j(y,{decimals:4},"deg"),[pe,le]=a.coordinates,Se=O.t(le<0?"geometry.south":"geometry.north",{value:ce(Math.abs(le))}),o=O.t(pe<0?"geometry.west":"geometry.east",{value:ce(Math.abs(pe))});return`Point ${Se} ${o}`}const x=[a.type];if(a.type.startsWith("Multi")||a.type==="GeometryCollection"){const ce=a.type==="GeometryCollection"?a.geometries.length:a.coordinates.length;x.push(O.t("geometry.parts",{count:ce}))}const V=ie(a),re=a.type==="Polygon"||a.type==="MultiPolygon";return a.type!=="GeometryCollection"&&x.push(O.t(re?"geometry.vertices":"geometry.points",{count:V})),re?x.push(ne(L.area,y)):(a.type==="LineString"||a.type==="MultiLineString")&&x.push(U(L.length,y)),x.join(", ")}function we(a){const y=a&&a.format,O=y&&typeof y=="object"?y.pattern:void 0;if(O===void 0)return"summary";if(ee.includes(O))return O;const L=a&&a.id||"?";return z(`geometry:format:${L}`,`column "${L}" asks for geometry format pattern "${String(O)}", which is not one of ${ee.join(", ")}; the summary is shown instead.`),"summary"}function ye(a){const y=a&&a.value;if($(y)||y==="")return"";const O=S(y);if(!O)return typeof y=="string"?y:"";switch(we(a.column)){case"wkt":return B(O);case"geojson":return JSON.stringify(O);default:return Pe(O,a.locale,se(a.grid))}}function me(a){if($(a))return"";const y=S(a);return y?B(y):typeof a=="string"?a:""}const ge=Object.freeze({geometry:{base:"object",storage:"object",format:a=>ye(a),parse:a=>S(a&&a.text),compare:q,groupProjector:()=>a=>Q(a)??a,geometry:a=>I(a),operators:Object.freeze(Object.fromEntries(J.map(a=>[a,Oe(a)]))),formatPatterns:ee,defaults:{filter:F,editor:"none",align:"start"},totals:{supported:["count","countValues"]},excel:"@",excelKind:"string",exportText:me,toStorage:(a,y)=>Z(a,y),toClipboard:me,fromClipboard:a=>S(a)}}),je=ge}),fe("packages/modules/geometry/index.js",function(u,R){"use strict";Object.defineProperty(u,"geometryModule",{enumerable:!0,get:function(){return G}}),Object.defineProperty(u,"default",{enumerable:!0,get:function(){return g}});const $=Ge("@toclocoinc/lattice-grid").registerModules;if(typeof $>"u")throw new Error("[lattice] geometry needs registerModules from the lattice-grid module. Load lattice-grid before geometry.");const A=R("packages/modules/geometry/type.js").GEOMETRY_TYPES,G=Object.freeze({name:"geometry",capabilities:["dataType:geometry"],install(F){F.registry.register("dataType","geometry",A.geometry)}});$(G);const g=G});var Ee=ke("packages/modules/geometry/index.js");if(typeof module=="object"&&module.exports)module.exports=Ee;else if(typeof define=="function"&&define.amd)define(function(){return Ee});else{var xe=Le.LatticeGrid||(Le.LatticeGrid={});for(var Te in Ee)Te!=="default"&&(xe[Te]=Ee[Te])}})(typeof globalThis<"u"?globalThis:this);
7
7
 
8
8
  //# sourceMappingURL=geometry.min.js.map
package/modules/htmx.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.89.0, htmx module type declarations
2
+ * Lattice Grid 1.89.1, htmx module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */