@toclocoinc/lattice-grid 1.74.0 → 1.75.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/angular/package.json +1 -1
  4. package/docs/API.html +44 -6
  5. package/docs/CHART-CODES.md +8 -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/charts.html +28 -2
  10. package/docs/api/data-router.html +1 -1
  11. package/docs/api/deckgl.html +2 -2
  12. package/docs/api/gantt.html +1 -1
  13. package/docs/api/geometry.html +1 -1
  14. package/docs/api/grid.html +2 -2
  15. package/docs/api/index.html +2 -2
  16. package/docs/api/kanban.html +1 -1
  17. package/docs/api/kpi.html +1 -1
  18. package/docs/api/layout.html +1 -1
  19. package/docs/api/list.html +1 -1
  20. package/docs/api/mock-socket.html +1 -1
  21. package/docs/api/tabs.html +1 -1
  22. package/docs/api/types.html +13 -1
  23. package/docs/api-detail.html +13 -4
  24. package/docs/warnings.json +36 -3
  25. package/lattice-grid.d.ts +37 -2
  26. package/lattice-grid.esm.min.js +3 -3
  27. package/lattice-grid.min.cjs +3 -3
  28. package/lattice-grid.min.js +3 -3
  29. package/modules/ai.d.ts +1 -1
  30. package/modules/ai.esm.min.js +2 -2
  31. package/modules/ai.min.cjs +2 -2
  32. package/modules/ai.min.js +2 -2
  33. package/modules/alarms.d.ts +1 -1
  34. package/modules/alarms.esm.min.js +2 -2
  35. package/modules/alarms.min.cjs +2 -2
  36. package/modules/alarms.min.js +2 -2
  37. package/modules/angular.d.ts +1 -1
  38. package/modules/angular.esm.min.js +2 -2
  39. package/modules/angular.min.cjs +2 -2
  40. package/modules/angular.min.js +2 -2
  41. package/modules/chart-alluvial.d.ts +1 -1
  42. package/modules/chart-alluvial.esm.min.js +1 -1
  43. package/modules/chart-alluvial.min.cjs +1 -1
  44. package/modules/chart-alluvial.min.js +1 -1
  45. package/modules/chart-arc.d.ts +1 -1
  46. package/modules/chart-arc.esm.min.js +1 -1
  47. package/modules/chart-arc.min.cjs +1 -1
  48. package/modules/chart-arc.min.js +1 -1
  49. package/modules/chart-bubblemap.d.ts +1 -1
  50. package/modules/chart-bubblemap.esm.min.js +1 -1
  51. package/modules/chart-bubblemap.min.cjs +1 -1
  52. package/modules/chart-bubblemap.min.js +1 -1
  53. package/modules/chart-bump.d.ts +1 -1
  54. package/modules/chart-bump.esm.min.js +1 -1
  55. package/modules/chart-bump.min.cjs +1 -1
  56. package/modules/chart-bump.min.js +1 -1
  57. package/modules/chart-calendar.d.ts +1 -1
  58. package/modules/chart-calendar.esm.min.js +2 -2
  59. package/modules/chart-calendar.esm.min.js.map +1 -1
  60. package/modules/chart-calendar.min.cjs +2 -2
  61. package/modules/chart-calendar.min.js +2 -2
  62. package/modules/chart-calendar.min.js.map +1 -1
  63. package/modules/chart-choropleth.d.ts +1 -1
  64. package/modules/chart-choropleth.esm.min.js +2 -2
  65. package/modules/chart-choropleth.esm.min.js.map +1 -1
  66. package/modules/chart-choropleth.min.cjs +2 -2
  67. package/modules/chart-choropleth.min.js +2 -2
  68. package/modules/chart-choropleth.min.js.map +1 -1
  69. package/modules/chart-decomposition.d.ts +1 -1
  70. package/modules/chart-decomposition.esm.min.js +1 -1
  71. package/modules/chart-decomposition.min.cjs +1 -1
  72. package/modules/chart-decomposition.min.js +1 -1
  73. package/modules/chart-diverging.d.ts +1 -1
  74. package/modules/chart-diverging.esm.min.js +1 -1
  75. package/modules/chart-diverging.min.cjs +1 -1
  76. package/modules/chart-diverging.min.js +1 -1
  77. package/modules/chart-dumbbell.d.ts +1 -1
  78. package/modules/chart-dumbbell.esm.min.js +1 -1
  79. package/modules/chart-dumbbell.min.cjs +1 -1
  80. package/modules/chart-dumbbell.min.js +1 -1
  81. package/modules/chart-fan.d.ts +1 -1
  82. package/modules/chart-fan.esm.min.js +1 -1
  83. package/modules/chart-fan.min.cjs +1 -1
  84. package/modules/chart-fan.min.js +1 -1
  85. package/modules/chart-hexbin.d.ts +1 -1
  86. package/modules/chart-hexbin.esm.min.js +2 -2
  87. package/modules/chart-hexbin.esm.min.js.map +1 -1
  88. package/modules/chart-hexbin.min.cjs +2 -2
  89. package/modules/chart-hexbin.min.js +2 -2
  90. package/modules/chart-hexbin.min.js.map +1 -1
  91. package/modules/chart-hexmap.d.ts +1 -1
  92. package/modules/chart-hexmap.esm.min.js +2 -2
  93. package/modules/chart-hexmap.esm.min.js.map +1 -1
  94. package/modules/chart-hexmap.min.cjs +2 -2
  95. package/modules/chart-hexmap.min.js +2 -2
  96. package/modules/chart-hexmap.min.js.map +1 -1
  97. package/modules/chart-icicle.d.ts +1 -1
  98. package/modules/chart-icicle.esm.min.js +1 -1
  99. package/modules/chart-icicle.min.cjs +1 -1
  100. package/modules/chart-icicle.min.js +1 -1
  101. package/modules/chart-markermap.d.ts +1 -1
  102. package/modules/chart-markermap.esm.min.js +1 -1
  103. package/modules/chart-markermap.min.cjs +1 -1
  104. package/modules/chart-markermap.min.js +1 -1
  105. package/modules/chart-parallel.d.ts +1 -1
  106. package/modules/chart-parallel.esm.min.js +1 -1
  107. package/modules/chart-parallel.min.cjs +1 -1
  108. package/modules/chart-parallel.min.js +1 -1
  109. package/modules/chart-ridgeline.d.ts +1 -1
  110. package/modules/chart-ridgeline.esm.min.js +1 -1
  111. package/modules/chart-ridgeline.min.cjs +1 -1
  112. package/modules/chart-ridgeline.min.js +1 -1
  113. package/modules/chart-roc.d.ts +1 -1
  114. package/modules/chart-roc.esm.min.js +1 -1
  115. package/modules/chart-roc.min.cjs +1 -1
  116. package/modules/chart-roc.min.js +1 -1
  117. package/modules/chart-slope.d.ts +1 -1
  118. package/modules/chart-slope.esm.min.js +1 -1
  119. package/modules/chart-slope.min.cjs +1 -1
  120. package/modules/chart-slope.min.js +1 -1
  121. package/modules/chart-splom.d.ts +1 -1
  122. package/modules/chart-splom.esm.min.js +1 -1
  123. package/modules/chart-splom.min.cjs +1 -1
  124. package/modules/chart-splom.min.js +1 -1
  125. package/modules/chart-waffle.d.ts +1 -1
  126. package/modules/chart-waffle.esm.min.js +1 -1
  127. package/modules/chart-waffle.min.cjs +1 -1
  128. package/modules/chart-waffle.min.js +1 -1
  129. package/modules/charts.d.ts +1 -1
  130. package/modules/charts.esm.min.js +185 -178
  131. package/modules/charts.esm.min.js.map +2 -2
  132. package/modules/charts.min.cjs +185 -178
  133. package/modules/charts.min.js +185 -178
  134. package/modules/charts.min.js.map +2 -2
  135. package/modules/data-router.d.ts +1 -1
  136. package/modules/data-router.esm.min.js +2 -2
  137. package/modules/data-router.min.cjs +2 -2
  138. package/modules/data-router.min.js +2 -2
  139. package/modules/deckgl.d.ts +9 -3
  140. package/modules/deckgl.esm.min.js +18 -11
  141. package/modules/deckgl.esm.min.js.map +2 -2
  142. package/modules/deckgl.min.cjs +18 -11
  143. package/modules/deckgl.min.js +18 -11
  144. package/modules/deckgl.min.js.map +2 -2
  145. package/modules/devtools.d.ts +1 -1
  146. package/modules/devtools.esm.min.js +1 -1
  147. package/modules/devtools.min.cjs +1 -1
  148. package/modules/devtools.min.js +1 -1
  149. package/modules/dhtmlx-compat.d.ts +1 -1
  150. package/modules/dhtmlx-compat.esm.min.js +2 -2
  151. package/modules/dhtmlx-compat.min.cjs +2 -2
  152. package/modules/dhtmlx-compat.min.js +2 -2
  153. package/modules/gantt.d.ts +1 -1
  154. package/modules/gantt.esm.min.js +2 -2
  155. package/modules/gantt.min.cjs +2 -2
  156. package/modules/gantt.min.js +2 -2
  157. package/modules/geo-europe-nuts.d.ts +1 -1
  158. package/modules/geo-europe-nuts.esm.min.js +1 -1
  159. package/modules/geo-europe-nuts.min.cjs +1 -1
  160. package/modules/geo-europe-nuts.min.js +1 -1
  161. package/modules/geo-uk.d.ts +1 -1
  162. package/modules/geo-uk.esm.min.js +1 -1
  163. package/modules/geo-uk.min.cjs +1 -1
  164. package/modules/geo-uk.min.js +1 -1
  165. package/modules/geo-us-states.d.ts +1 -1
  166. package/modules/geo-us-states.esm.min.js +1 -1
  167. package/modules/geo-us-states.min.cjs +1 -1
  168. package/modules/geo-us-states.min.js +1 -1
  169. package/modules/geo-world-110m.d.ts +1 -1
  170. package/modules/geo-world-110m.esm.min.js +1 -1
  171. package/modules/geo-world-110m.min.cjs +1 -1
  172. package/modules/geo-world-110m.min.js +1 -1
  173. package/modules/geo-world-50m.d.ts +1 -1
  174. package/modules/geo-world-50m.esm.min.js +1 -1
  175. package/modules/geo-world-50m.min.cjs +1 -1
  176. package/modules/geo-world-50m.min.js +1 -1
  177. package/modules/geometry.d.ts +1 -1
  178. package/modules/geometry.esm.min.js +2 -2
  179. package/modules/geometry.min.cjs +2 -2
  180. package/modules/geometry.min.js +2 -2
  181. package/modules/htmx.d.ts +1 -1
  182. package/modules/htmx.esm.min.js +3 -3
  183. package/modules/htmx.min.cjs +3 -3
  184. package/modules/htmx.min.js +3 -3
  185. package/modules/kanban.d.ts +1 -1
  186. package/modules/kanban.esm.min.js +2 -2
  187. package/modules/kanban.min.cjs +2 -2
  188. package/modules/kanban.min.js +2 -2
  189. package/modules/kpi.d.ts +1 -1
  190. package/modules/kpi.esm.min.js +2 -2
  191. package/modules/kpi.min.cjs +2 -2
  192. package/modules/kpi.min.js +2 -2
  193. package/modules/layout.d.ts +1 -1
  194. package/modules/layout.esm.min.js +2 -2
  195. package/modules/layout.min.cjs +2 -2
  196. package/modules/layout.min.js +2 -2
  197. package/modules/list.d.ts +1 -1
  198. package/modules/list.esm.min.js +2 -2
  199. package/modules/list.min.cjs +2 -2
  200. package/modules/list.min.js +2 -2
  201. package/modules/mock-socket.d.ts +1 -1
  202. package/modules/mock-socket.esm.min.js +1 -1
  203. package/modules/mock-socket.min.cjs +1 -1
  204. package/modules/mock-socket.min.js +1 -1
  205. package/modules/react.d.ts +1 -1
  206. package/modules/react.esm.min.js +2 -2
  207. package/modules/react.min.cjs +2 -2
  208. package/modules/react.min.js +2 -2
  209. package/modules/svelte.d.ts +1 -1
  210. package/modules/svelte.esm.min.js +2 -2
  211. package/modules/svelte.min.cjs +2 -2
  212. package/modules/svelte.min.js +2 -2
  213. package/modules/tabs.d.ts +1 -1
  214. package/modules/tabs.esm.min.js +2 -2
  215. package/modules/tabs.min.cjs +2 -2
  216. package/modules/tabs.min.js +2 -2
  217. package/modules/vue.d.ts +1 -1
  218. package/modules/vue.esm.min.js +2 -2
  219. package/modules/vue.min.cjs +2 -2
  220. package/modules/vue.min.js +2 -2
  221. package/modules/webcomponent.d.ts +1 -1
  222. package/modules/webcomponent.esm.min.js +3 -3
  223. package/modules/webcomponent.min.cjs +3 -3
  224. package/modules/webcomponent.min.js +3 -3
  225. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * Lattice Grid 1.74.0, geometry module
2
+ * Lattice Grid 1.75.0, geometry module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
6
- (function(Ee){"use strict";var Ae=Object.create(null),Ne=Object.create(null);function fe(c,k){Ae[c]=k}function ke(c){var k=Ne[c];if(k)return k;var T=Object.create(null);Ne[c]=T;var $=Ae[c];if(!$)throw new Error("[lattice] missing module: "+c);return $(T,ke),T}var Re=Object.create(null);Re["@toclocoinc/lattice-grid"]=Ee.LatticeGrid||null;function Ge(c){var k=Re[c],T=typeof globalThis<"u"?globalThis:typeof self<"u"?self:null;if(k)return k;if(c==="@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: "+c)}fe("packages/core/src/internal/util.js",function(c,k){"use strict";Object.defineProperty(c,"VERSION",{enumerable:!0,get:function(){return K}}),Object.defineProperty(c,"reportedWarnings",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"warnOnce",{enumerable:!0,get:function(){return V}}),Object.defineProperty(c,"infoOnce",{enumerable:!0,get:function(){return O}}),Object.defineProperty(c,"resetWarnings",{enumerable:!0,get:function(){return E}}),Object.defineProperty(c,"fail",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"invariant",{enumerable:!0,get:function(){return S}}),Object.defineProperty(c,"DEV",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"isObject",{enumerable:!0,get:function(){return x}}),Object.defineProperty(c,"isFunction",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"isNil",{enumerable:!0,get:function(){return _}}),Object.defineProperty(c,"isBlank",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"isCtor",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(c,"pathGetter",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(c,"pathSetter",{enumerable:!0,get:function(){return H}}),Object.defineProperty(c,"getPath",{enumerable:!0,get:function(){return G}}),Object.defineProperty(c,"setPath",{enumerable:!0,get:function(){return j}}),Object.defineProperty(c,"humanise",{enumerable:!0,get:function(){return U}}),Object.defineProperty(c,"escapeHtml",{enumerable:!0,get:function(){return se}}),Object.defineProperty(c,"titleCase",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(c,"expand",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(c,"toArray",{enumerable:!0,get:function(){return we}}),Object.defineProperty(c,"merge",{enumerable:!0,get:function(){return me}}),Object.defineProperty(c,"mergeRow",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(c,"Lru",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(c,"collator",{enumerable:!0,get:function(){return u}}),Object.defineProperty(c,"defaultCompare",{enumerable:!0,get:function(){return g}}),Object.defineProperty(c,"now",{enumerable:!0,get:function(){return b}}),Object.defineProperty(c,"nextFrame",{enumerable:!0,get:function(){return I}}),Object.defineProperty(c,"cancelFrame",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"frameBatched",{enumerable:!0,get:function(){return q}}),Object.defineProperty(c,"settleDebounce",{enumerable:!0,get:function(){return re}}),Object.defineProperty(c,"whenIdle",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(c,"uid",{enumerable:!0,get:function(){return le}});const T="1.74.0";async function $(){return T}const K="1.74.0",A=new Set,R=2e3;function h(o){if(A.add(o),A.size>R){const i=A.values().next().value;i!==void 0&&A.delete(i)}}const F=[],Q=500;function z(o,i,a){F.push({key:o,level:i,message:a.map(d=>typeof d=="string"?d:N(d)).join(" "),at:Date.now()}),F.length>Q&&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 V(o,...i){A.has(o)||(h(o),z(o,"warn",i),console.warn("[lattice]",...i))}function O(o,...i){A.has(o)||(h(o),z(o,"info",i),console.info("[lattice]",...i))}function E(){A.clear(),F.length=0}function w(o,i){const a=new Error(`[lattice] ${o}`);throw i!==void 0&&(a.cause=i),a}function S(o,i){o||w(i)}const B=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function x(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function J(o){return typeof o=="function"}function _(o){return o==null}function oe(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 ie=new Map;function ee(o){let i=ie.get(o);if(i)return i;if(!o.includes("."))i=a=>a?.[o];else{const a=o.split("."),d=a.length;i=Y=>{let D=Y;for(let W=0;W<d;W++){if(D==null)return;D=D[a[W]]}return D}}return ie.set(o,i),i}const v=new Map;function H(o){let i=v.get(o);if(i)return i;if(!o.includes("."))i=(a,d)=>{a!=null&&(a[o]=d)};else{const a=o.split("."),d=a.length-1;i=(Y,D)=>{let W=Y;for(let X=0;X<d;X++){if(W==null)return;const de=a[X];W[de]==null&&(W[de]={}),W=W[de]}W!=null&&(W[a[d]]=D)}}return v.set(o,i),i}function G(o,i){return ee(i)(o)}function j(o,i,a){H(i)(o,a)}function U(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(/^./,a=>a.toUpperCase()):""}const ne={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function se(o){const i=o==null?"":String(o);return/[&<>"']/.test(i)?i.replace(/[&<>"']/g,a=>ne[a]):i}function ce(o){return String(o).replace(/\w\S*/g,i=>i[0].toUpperCase()+i.slice(1).toLowerCase())}function Pe(o,i,a){if(o!==void 0)return o===!0?{enabled:!0,...a}:o===!1?{enabled:!1}:x(o)?o:{[i]:o,enabled:!0}}function we(o){return o==null?[]:Array.isArray(o)?o:[o]}const je=Object.freeze(new Set(["__proto__","constructor","prototype"]));function me(o,i){if(!x(o))return x(i)?{...i}:i;if(!x(i))return i===void 0?o:i;const a={...o};for(const d of Object.keys(i)){if(je.has(d))continue;const Y=i[d];Y!==void 0&&(a[d]=x(Y)&&x(a[d])?me(a[d],Y):Y)}return a}function ye(o,i){if(!x(o)||!x(i)||o===i)return i;const a=Object.create(Object.getPrototypeOf(o));return Object.assign(a,o,i),a}class ge{#n;#e=new Map;#t;constructor(i=256,a=null){this.#n=i,this.#t=a}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 a=this.#e;if(!a.has(i))return;const d=a.get(i);return a.delete(i),a.set(i,d),d}peek(i){return this.#e.get(i)}set(i,a){const d=this.#e;return d.has(i)&&d.delete(i),d.set(i,a),this.#r(),a}delete(i){const a=this.#e.get(i);return this.#e.delete(i)&&this.#t&&this.#t(a,i),a}clear(){if(this.#t)for(const[i,a]of this.#e)this.#t(a,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 a=i.keys().next().value,d=i.get(a);i.delete(a),this.#t&&this.#t(d,a)}}}const he=new Map;function u(o,i){const a=`${o||""}|${i?JSON.stringify(i):""}`;let d=he.get(a);return d||(d=new Intl.Collator(o||void 0,{numeric:!0,sensitivity:"variant",...i}),he.set(a,d)),d}function g(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 a=String(o),d=String(i);return a<d?-1:a>d?1:0}function b(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const L=typeof requestAnimationFrame=="function";function I(o){return L?requestAnimationFrame(o):setTimeout(()=>o(b()),16)}function Z(o){o!=null&&(L?cancelAnimationFrame(o):clearTimeout(o))}function q(o){let i=null,a=null;const d=()=>{i=null;const D=a;a=null,o(...D||[])},Y=(...D)=>{a=D,i===null&&(i=I(d))};return Y.cancel=()=>{Z(i),i=null,a=null},Y.flush=()=>{i!==null&&(Z(i),d())},Y}function re(o,i){let a=null,d=null;const Y=()=>{if(a=null,d===null)return;const X=d;d=null,o(...X),D()},D=()=>{a=setTimeout(Y,i),typeof a?.unref=="function"&&a.unref()},W=(...X)=>{a===null?(o(...X),D()):(d=X,clearTimeout(a),D())};return W.flush=()=>{if(a!==null&&clearTimeout(a),a=null,d===null)return;const X=d;d=null,o(...X)},W.cancel=()=>{a!==null&&clearTimeout(a),a=null,d=null},W.pending=()=>a!==null||d!==null,W}function ue(o,i=50){return typeof requestIdleCallback=="function"?requestIdleCallback(o,{timeout:i}):setTimeout(()=>o({timeRemaining:()=>0,didTimeout:!0}),1)}let pe=0;function le(o="l"){return`${o}${(++pe).toString(36)}`}}),fe("packages/core/src/format/number.js",function(c,k){"use strict";Object.defineProperty(c,"compileNumber",{enumerable:!0,get:function(){return K}});const $=k("packages/core/src/internal/util.js").isNil;function K(A,R){const h=A||{},F=h.locale||R||void 0,Q=h.style||"decimal",z=typeof h.scale=="number"?h.scale:1,N=h.nullDisplay??"",C=h.zeroDisplay,V=h.prefix||"",O=h.suffix||"",E=h.negative||"minus",w=h.signed===!0,S={style:Q,notation:h.notation||"standard"};Q==="currency"&&(S.currency=h.currency||"USD",h.currencyDisplay&&(S.currencyDisplay=h.currencyDisplay)),typeof h.decimals=="number"?(S.minimumFractionDigits=h.decimals,S.maximumFractionDigits=h.decimals):(typeof h.minDecimals=="number"&&(S.minimumFractionDigits=h.minDecimals),typeof h.maxDecimals=="number"&&(S.maximumFractionDigits=h.maxDecimals),S.minimumFractionDigits>(S.maximumFractionDigits??20)&&(S.maximumFractionDigits=S.minimumFractionDigits)),h.thousandsSeparator===!1&&(S.useGrouping=!1),S.notation==="compact"&&(S.compactDisplay=h.compactDisplay||"short");const B=new Intl.NumberFormat(F,S),x=typeof h.thousandsSeparator=="string"?h.thousandsSeparator:null,J=typeof h.decimalSeparator=="string"?h.decimalSeparator:null;let _=",",oe=".";if(x||J)for(const G of B.formatToParts(12345.6))G.type==="group"?_=G.value:G.type==="decimal"&&(oe=G.value);const ae=G=>{let j=G;return x&&(j=j.split(_).join("")),J&&(j=j.split(oe).join("")),x&&(j=j.split("").join(x)),J&&(j=j.split("").join(J)),j},ie=!!(x||J),ee=V!==""&&Q==="currency",v=G=>{let j;if(ee){const U=B.formatToParts(G);let ne=!1;j="";for(const se of U)j+=se.value,!ne&&se.type==="currency"&&(j+=V,ne=!0);ne||(j=V+j)}else j=V+B.format(G);return ie&&(j=ae(j)),j+O},H=G=>{if($(G)||G==="")return N;const j=typeof G=="number"?G:Number(G);if(Number.isNaN(j))return N;const U=z===1?j:j*z;return U===0&&C!==void 0?C:U<0?E==="parentheses"?`(${v(-U)})`:E==="suffix"?`${v(-U)}-`:v(U):w&&U>0?`+${v(U)}`:v(U)};return H.negativeClass=h.negativeClass||null,H.spec=h,H}}),fe("packages/modules/geometry/geodata.js",function(c,k){"use strict";Object.defineProperty(c,"GEOMETRY_KINDS",{enumerable:!0,get:function(){return R}}),Object.defineProperty(c,"SPATIAL_OPERATORS",{enumerable:!0,get:function(){return h}}),Object.defineProperty(c,"GEOMETRY_OPERATORS",{enumerable:!0,get:function(){return F}}),Object.defineProperty(c,"EARTH_RADIUS",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(c,"toWkt",{enumerable:!0,get:function(){return U}}),Object.defineProperty(c,"toWkb",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(c,"readGeometry",{enumerable:!0,get:function(){return g}}),Object.defineProperty(c,"parseGeometry",{enumerable:!0,get:function(){return L}}),Object.defineProperty(c,"haversine",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"geometryInfo",{enumerable:!0,get:function(){return d}}),Object.defineProperty(c,"geometryKind",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(c,"spatialOperand",{enumerable:!0,get:function(){return W}}),Object.defineProperty(c,"spatialPredicate",{enumerable:!0,get:function(){return We}});const T=k("packages/core/src/internal/util.js"),$=T.isNil,K=T.isObject,A=T.warnOnce,R=Object.freeze(["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"]),h=Object.freeze(["withinBbox","withinPolygon","intersects","withinDistance"]),F=Object.freeze([...h,"blank","notBlank"]),Q=63710088e-1,z=Math.PI/180,N=16,C=1e-12;class V extends Error{}function O(t){throw new V(t)}function E(t){(!Array.isArray(t)||t.length<2)&&O("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))&&O("a coordinate is not a finite number"),[e,n]}function w(t,e,n){Array.isArray(t)||O(`${n} is not an array of positions`);const r=t.map(E);return r.length<e&&O(`${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&&O(`a polygon ring needs at least 3 distinct corners, found ${e.length-1}`),e}function B(t){return(!Array.isArray(t)||t.length===0)&&O("a polygon needs at least an outer ring"),t.map(S)}function x(t,e){switch(e>N&&O("geometry collections nest too deeply"),K(t)||O("GeoJSON must be an object"),t.type){case"Feature":return t.geometry==null?null:x(t.geometry,e+1);case"FeatureCollection":return O("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)&&O("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)&&O("a MultiPolygon needs at least one polygon"),{type:"MultiPolygon",coordinates:t.coordinates.map(B)};case"GeometryCollection":{(!Array.isArray(t.geometries)||!t.geometries.length)&&O("a GeometryCollection needs at least one geometry");const n=t.geometries.map(r=>x(r,e+1)).filter(Boolean);return n.length?{type:"GeometryCollection",geometries:n}:null}default:return O(`"${String(t.type)}" is not a GeoJSON geometry type`)}}const J=Object.freeze({POINT:"Point",LINESTRING:"LineString",POLYGON:"Polygon",MULTIPOINT:"MultiPoint",MULTILINESTRING:"MultiLineString",MULTIPOLYGON:"MultiPolygon",GEOMETRYCOLLECTION:"GeometryCollection"}),_=/[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/y,oe=/[A-Za-z]+/y,ae=/^\s*(?:SRID\s*=\s*\d+\s*;\s*)?[A-Za-z]+\s*(?:ZM|Z|M)?\s*(?:\(|EMPTY\b)/i;class ie{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&&O(`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(),_.lastIndex=this.at,_.test(this.text)}number(){this.space(),_.lastIndex=this.at;const e=_.exec(this.text);return e||O(`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&&O("geometry collections nest too deeply");const n=this.word(),r=J[n];r||O(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 ie(String(t).replace(/^\s*SRID\s*=\s*\d+\s*;/i,"")),n=e.geometry(0);return e.space(),e.at<e.text.length&&O(`WKT has unexpected text after the geometry at character ${e.at+1}`),n}function v(t){return Object.is(t,-0)?"0":String(t)}function H(t){return`${v(t[0])} ${v(t[1])}`}function G(t){return`(${t.map(H).join(", ")})`}function j(t){return`(${t.map(G).join(", ")})`}function U(t){const e=L(t);return e?ne(e):""}function ne(t){switch(t.type){case"Point":return`POINT (${H(t.coordinates)})`;case"LineString":return`LINESTRING ${G(t.coordinates)}`;case"Polygon":return`POLYGON ${j(t.coordinates)}`;case"MultiPoint":return`MULTIPOINT (${t.coordinates.map(e=>`(${H(e)})`).join(", ")})`;case"MultiLineString":return`MULTILINESTRING (${t.coordinates.map(G).join(", ")})`;case"MultiPolygon":return`MULTIPOLYGON (${t.coordinates.map(j).join(", ")})`;default:return`GEOMETRYCOLLECTION (${t.geometries.map(ne).join(", ")})`}}class se{view;at=0;constructor(e){this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}need(e){this.at+e>this.view.byteLength&&O(`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&&O(`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&&O("geometry collections nest too deeply");const r=this.u8();r!==0&&r!==1&&O(`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&&O(`WKB geometry type ${m} is not one this reads`),f=2+(M===3?2:1),m%=1e3}const P=R[m-1];switch(P||O(`WKB geometry type ${m} is not one this reads`),n&&P!==n&&O(`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),y=[];for(let p=0;p<M;p++)y.push(this.positions(s,f));return M?{type:"Polygon",coordinates:B(y)}:null}default:{const M=this.count(s,5),y=P==="GeometryCollection"?void 0:P.slice(5),p=[];for(let te=0;te<M;te++){const Se=this.geometry(e+1,y);Se&&p.push(Se)}return p.length?P==="GeometryCollection"?{type:P,geometries:p}:{type:P,coordinates:p.map(te=>te.coordinates)}:null}}}}function ce(t){const e=new se(t),n=e.geometry(0);return e.at!==t.byteLength&&O(`WKB has ${t.byteLength-e.at} bytes left over after the geometry`),n}function Pe(t){const e=L(t);if(!e)return null;const n=[];let r=0;const s=y=>{const p=new DataView(new ArrayBuffer(5));p.setUint8(0,1),p.setUint32(1,R.indexOf(y)+1,!0),n.push(p),r+=5},l=y=>{const p=new DataView(new ArrayBuffer(4));p.setUint32(0,y,!0),n.push(p),r+=4},f=y=>{const p=new DataView(new ArrayBuffer(16*y.length));y.forEach((te,Se)=>{p.setFloat64(Se*16,te[0],!0),p.setFloat64(Se*16+8,te[1],!0)}),n.push(p),r+=16*y.length},m=y=>{switch(s(y.type),y.type){case"Point":f([y.coordinates]);break;case"LineString":l(y.coordinates.length),f(y.coordinates);break;case"Polygon":l(y.coordinates.length);for(const p of y.coordinates)l(p.length),f(p);break;case"GeometryCollection":l(y.geometries.length);for(const p of y.geometries)m(p);break;default:{const p=y.type.slice(5);l(y.coordinates.length);for(const te of y.coordinates)m({type:p,coordinates:te})}}};m(e);const P=new Uint8Array(r);let M=0;for(const y of n)P.set(new Uint8Array(y.buffer),M),M+=y.byteLength;return P}const we=/^0[01](?:[0-9a-fA-F]{2})+$/,je=/^[A-Za-z0-9+/_-]+={0,2}$/,me=(()=>{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 ye(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|me[e.charCodeAt(f)],r+=6,r>=8&&(r-=8,n[l++]=s>>r&255);return n.subarray(0,l)}function he(t){const e=t.trim();if(e==="")return null;if(e[0]==="{"){let n;try{n=JSON.parse(e)}catch{return O("the text starts like GeoJSON but is not valid JSON")}return x(n,0)}if(we.test(e))return ce(ye(e));if(ae.test(e))return ee(e);if(je.test(e)){const n=ge(e);if(n.length>=5&&(n[0]===0||n[0]===1))return ce(n)}return O("the text is not WKT, GeoJSON, or hex or base64 WKB")}const u=new WeakSet;function g(t){if($(t))return{geometry:null,reason:null};if(typeof t=="object"&&u.has(t))return{geometry:t,reason:null};try{let e;return typeof t=="string"?e=he(t):t instanceof Uint8Array?e=ce(t):t instanceof ArrayBuffer?e=ce(new Uint8Array(t)):ArrayBuffer.isView(t)?e=ce(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)):K(t)?e=x(t,0):O(`${Array.isArray(t)?"an array":`a ${typeof t}`} is not a geometry`),e&&b(e),{geometry:e||null,reason:null}}catch(e){if(e instanceof V)return{geometry:null,reason:e.message};throw e}}function b(t){if(u.add(t),t.type==="GeometryCollection")for(const e of t.geometries)b(e)}function L(t){return g(t).geometry}function I(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)I(n,e)}}function Z(t,e){const n=t[1]*z,r=e[1]*z,s=r-n,l=(e[0]-t[0])*z,f=Math.sin(s/2)**2+Math.cos(n)*Math.cos(r)*Math.sin(l/2)**2;return 2*Q*Math.asin(Math.min(1,Math.sqrt(f)))}function q(t){let e=0;for(let n=1;n<t.length;n++)e+=Z(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])*z*Math.sin(t[r][1]*z)}return Math.abs(n)*Q*Q/2}function ue(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 o(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 i(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 y=pe(P),p=(M===0?1:-1)*(y.a<0?-1:1);s+=p*y.a,l+=p*y.cx,f+=p*y.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)i(n,e)}}const a=new WeakMap;function d(t){const e=L(t);if(!e)return null;const n=a.get(e);if(n)return n;const r=[1/0,1/0,-1/0,-1/0];I(e,y=>{y[0]<r[0]&&(r[0]=y[0]),y[1]<r[1]&&(r[1]=y[1]),y[0]>r[2]&&(r[2]=y[0]),y[1]>r[3]&&(r[3]=y[1])});const s=[le(),le(),le()];i(e,s);const l=s[2].get()||s[1].get()||s[0].get()||o([[r[0],r[1]],[r[2],r[3]]]);let f=0,m=0;const P=y=>{switch(y.type){case"LineString":f+=q(y.coordinates);break;case"MultiLineString":for(const p of y.coordinates)f+=q(p);break;case"Polygon":m+=ue(y.coordinates);for(const p of y.coordinates)f+=q(p);break;case"MultiPolygon":for(const p of y.coordinates){m+=ue(p);for(const te of p)f+=q(te)}break;case"GeometryCollection":for(const p of y.geometries)P(p);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 a.set(e,M),M}function Y(t){const e=d(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 W(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(K(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}=g(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 X(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,y]=e[f];P>r!=y>r&&n<(M-m)*(r-P)/(y-P)+m&&(s=!s)}return s}function de(t,e){if(!X(t,e[0]))return!1;for(let n=1;n<e.length;n++)if(X(t,e[n]))return!1;return!0}function Te(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)Te(r,e)}return e}function be(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 Oe(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 xe(t,e){const[n,r]=t,[s,l]=e,f=be(n,r,s),m=be(n,r,l),P=be(s,l,n),M=be(s,l,r);return f!==m&&P!==M?!0:f===0&&Oe(s,n,r)||m===0&&Oe(l,n,r)||P===0&&Oe(n,s,l)||M===0&&Oe(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=d(t),r=d(e);if(!$e(n.bbox,r.bbox))return!1;const s=Te(t),l=Te(e);for(const f of l.polygons)for(const m of s.points)if(de(m,f))return!0;for(const f of s.polygons)for(const m of l.points)if(de(m,f))return!0;for(const f of s.segments)for(const m of l.segments)if(xe(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(be(m[0],m[1],f)===0&&Oe(f,m[0],m[1]))return!0}for(const f of l.points)for(const m of s.segments)if(be(m[0],m[1],f)===0&&Oe(f,m[0],m[1]))return!0;return!1}function We(t,e){const{operand:n,reason:r}=W(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=d(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=>de(f,m));return f=>{const m=L(f);return m?m.type==="Point"?l(m.coordinates):m.type==="MultiPoint"?m.coordinates.every(l):l(d(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=d(l);return!!f&&Z(f.centroid,s)<=n.metres}}}}}),fe("packages/modules/geometry/messages.js",function(c,k){"use strict";Object.defineProperty(c,"withFallback",{enumerable:!0,get:function(){return K}});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,R){const h=T[A];return h===void 0?A:Array.isArray(h)?`${R.count} ${R.count===1?h[0]:h[1]}`:h.replace("{value}",String(R.value??""))}function K(A){return{t(R,h={}){const F=A&&typeof A.t=="function"?A.t(R,h):R;return F===R?$(R,h):F}}}}),fe("packages/modules/geometry/filter.js",function(c,k){"use strict";Object.defineProperty(c,"GeometryFilter",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return V}});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 K=T.createMessages;if(typeof K>"u")throw new Error("[lattice] geometry needs createMessages from the lattice-grid module. Load lattice-grid before geometry.");const A=k("packages/modules/geometry/geodata.js"),R=A.spatialOperand,h=A.toWkt,F=A.parseGeometry,z=k("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||K();super.init({...w,messages:z(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)?h(E):""}nodes(){const E=[];for(const w of super.nodes()){const S=w;if(!N[S.op]){E.push(w);continue}const{operand:B}=R(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 V=C}),fe("packages/modules/geometry/type.js",function(c,k){"use strict";Object.defineProperty(c,"GEOMETRY_KINDS",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"SPATIAL_OPERATORS",{enumerable:!0,get:function(){return V}}),Object.defineProperty(c,"GEOMETRY_OPERATORS",{enumerable:!0,get:function(){return O}}),Object.defineProperty(c,"EARTH_RADIUS",{enumerable:!0,get:function(){return E}}),Object.defineProperty(c,"readGeometry",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"parseGeometry",{enumerable:!0,get:function(){return S}}),Object.defineProperty(c,"toWkt",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"toWkb",{enumerable:!0,get:function(){return x}}),Object.defineProperty(c,"geometryInfo",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"geometryKind",{enumerable:!0,get:function(){return _}}),Object.defineProperty(c,"haversine",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"spatialOperand",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(c,"spatialPredicate",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(c,"GEOMETRY_FORMAT_PATTERNS",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(c,"compareGeometry",{enumerable:!0,get:function(){return H}}),Object.defineProperty(c,"formatGeometry",{enumerable:!0,get:function(){return me}}),Object.defineProperty(c,"GEOMETRY_TYPES",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return he}});const T=k("packages/core/src/internal/util.js"),$=T.isNil,K=T.warnOnce,R=k("packages/core/src/format/number.js").compileNumber,F=k("packages/modules/geometry/filter.js").GeometryFilter,z=k("packages/modules/geometry/messages.js").withFallback,N=k("packages/modules/geometry/geodata.js"),C=N.GEOMETRY_KINDS,V=N.SPATIAL_OPERATORS,O=N.GEOMETRY_OPERATORS,E=N.EARTH_RADIUS,w=N.readGeometry,S=N.parseGeometry,B=N.toWkt,x=N.toWkb,J=N.geometryInfo,_=N.geometryKind,oe=N.haversine,ae=N.spatialOperand,ie=N.spatialPredicate,ee=Object.freeze(["summary","wkt","geojson"]);function v(u,g){const{geometry:b,reason:L}=w(u);if(L){const I=g&&g.colId||"?";K(`geometry:refused:${I}`,`column "${I}" 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 b}function H(u,g){const b=J(u),L=J(g);if(!b||!L){if(b)return-1;if(L)return 1;if($(u))return $(g)?0:1;if($(g))return-1;const q=String(u),re=String(g);return q<re?-1:q>re?1:0}const I=b.centroid[1]-L.centroid[1];if(I!==0)return I<0?-1:1;const Z=b.centroid[0]-L.centroid[0];return Z<0?-1:Z>0?1:0}const G=new Map;function j(u,g,b){const L=`${u||""}|${b}`;let I=G.get(L);if(!I){const Z=R(g,u);I=q=>Z(q),G.set(L,I)}return I}function U(u,g){return u<1e3?`${j(g,{maxDecimals:0},"m")(u)} m`:`${j(g,{maxDecimals:1},"km")(u/1e3)} km`}function ne(u,g){return u<1e6?`${j(g,{maxDecimals:0},"m")(u)} m²`:`${j(g,{maxDecimals:2},"km2")(u/1e6)} km²`}function se(u){switch(u.type){case"Point":return 1;case"MultiPoint":case"LineString":return u.coordinates.length;case"MultiLineString":return u.coordinates.reduce((g,b)=>g+b.length,0);case"Polygon":return u.coordinates.reduce((g,b)=>g+b.length-1,0);case"MultiPolygon":return u.coordinates.reduce((g,b)=>g+b.reduce((L,I)=>L+I.length-1,0),0);default:return u.geometries.reduce((g,b)=>g+se(b),0)}}function ce(u){return z(u&&u.messages)}function Pe(u){return{compile:g=>ie(u,g),check:g=>ae(u,g).reason||null}}function we(u,g,b){const L=J(u);if(u.type==="Point"){const ue=j(g,{decimals:4},"deg"),[pe,le]=u.coordinates,o=b.t(le<0?"geometry.south":"geometry.north",{value:ue(Math.abs(le))}),i=b.t(pe<0?"geometry.west":"geometry.east",{value:ue(Math.abs(pe))});return`Point ${o} ${i}`}const I=[u.type];if(u.type.startsWith("Multi")||u.type==="GeometryCollection"){const ue=u.type==="GeometryCollection"?u.geometries.length:u.coordinates.length;I.push(b.t("geometry.parts",{count:ue}))}const q=se(u),re=u.type==="Polygon"||u.type==="MultiPolygon";return u.type!=="GeometryCollection"&&I.push(b.t(re?"geometry.vertices":"geometry.points",{count:q})),re?I.push(ne(L.area,g)):(u.type==="LineString"||u.type==="MultiLineString")&&I.push(U(L.length,g)),I.join(", ")}function je(u){const g=u&&u.format,b=g&&typeof g=="object"?g.pattern:void 0;if(b===void 0)return"summary";if(ee.includes(b))return b;const L=u&&u.id||"?";return K(`geometry:format:${L}`,`column "${L}" asks for geometry format pattern "${String(b)}", which is not one of ${ee.join(", ")}; the summary is shown instead.`),"summary"}function me(u){const g=u&&u.value;if($(g)||g==="")return"";const b=S(g);if(!b)return typeof g=="string"?g:"";switch(je(u.column)){case"wkt":return B(b);case"geojson":return JSON.stringify(b);default:return we(b,u.locale,ce(u.grid))}}function ye(u){if($(u))return"";const g=S(u);return g?B(g):typeof u=="string"?u:""}const ge=Object.freeze({geometry:{base:"object",storage:"object",format:u=>me(u),parse:u=>S(u&&u.text),compare:H,groupProjector:()=>u=>_(u)??u,geometry:u=>J(u),operators:Object.freeze(Object.fromEntries(V.map(u=>[u,Pe(u)]))),formatPatterns:ee,defaults:{filter:F,editor:"none",align:"start"},totals:{supported:["count","countValues"]},excel:"@",excelKind:"string",exportText:ye,toStorage:(u,g)=>v(u,g),toClipboard:ye,fromClipboard:u=>S(u)}}),he=ge}),fe("packages/modules/geometry/index.js",function(c,k){"use strict";Object.defineProperty(c,"geometryModule",{enumerable:!0,get:function(){return R}}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return h}});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=k("packages/modules/geometry/type.js").GEOMETRY_TYPES,R=Object.freeze({name:"geometry",capabilities:["dataType:geometry"],install(F){F.registry.register("dataType","geometry",A.geometry)}});$(R);const h=R});var Me=ke("packages/modules/geometry/index.js");if(typeof module=="object"&&module.exports)module.exports=Me;else if(typeof define=="function"&&define.amd)define(function(){return Me});else{var Ie=Ee.LatticeGrid||(Ee.LatticeGrid={});for(var Le in Me)Le!=="default"&&(Ie[Le]=Me[Le])}})(typeof globalThis<"u"?globalThis:this);
6
+ (function(Ee){"use strict";var Ae=Object.create(null),Ne=Object.create(null);function fe(c,k){Ae[c]=k}function ke(c){var k=Ne[c];if(k)return k;var T=Object.create(null);Ne[c]=T;var $=Ae[c];if(!$)throw new Error("[lattice] missing module: "+c);return $(T,ke),T}var Re=Object.create(null);Re["@toclocoinc/lattice-grid"]=Ee.LatticeGrid||null;function Ge(c){var k=Re[c],T=typeof globalThis<"u"?globalThis:typeof self<"u"?self:null;if(k)return k;if(c==="@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: "+c)}fe("packages/core/src/internal/util.js",function(c,k){"use strict";Object.defineProperty(c,"VERSION",{enumerable:!0,get:function(){return K}}),Object.defineProperty(c,"reportedWarnings",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"warnOnce",{enumerable:!0,get:function(){return V}}),Object.defineProperty(c,"infoOnce",{enumerable:!0,get:function(){return O}}),Object.defineProperty(c,"resetWarnings",{enumerable:!0,get:function(){return E}}),Object.defineProperty(c,"fail",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"invariant",{enumerable:!0,get:function(){return S}}),Object.defineProperty(c,"DEV",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"isObject",{enumerable:!0,get:function(){return x}}),Object.defineProperty(c,"isFunction",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"isNil",{enumerable:!0,get:function(){return _}}),Object.defineProperty(c,"isBlank",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"isCtor",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(c,"pathGetter",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(c,"pathSetter",{enumerable:!0,get:function(){return H}}),Object.defineProperty(c,"getPath",{enumerable:!0,get:function(){return G}}),Object.defineProperty(c,"setPath",{enumerable:!0,get:function(){return j}}),Object.defineProperty(c,"humanise",{enumerable:!0,get:function(){return U}}),Object.defineProperty(c,"escapeHtml",{enumerable:!0,get:function(){return se}}),Object.defineProperty(c,"titleCase",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(c,"expand",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(c,"toArray",{enumerable:!0,get:function(){return we}}),Object.defineProperty(c,"merge",{enumerable:!0,get:function(){return me}}),Object.defineProperty(c,"mergeRow",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(c,"Lru",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(c,"collator",{enumerable:!0,get:function(){return u}}),Object.defineProperty(c,"defaultCompare",{enumerable:!0,get:function(){return g}}),Object.defineProperty(c,"now",{enumerable:!0,get:function(){return b}}),Object.defineProperty(c,"nextFrame",{enumerable:!0,get:function(){return I}}),Object.defineProperty(c,"cancelFrame",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"frameBatched",{enumerable:!0,get:function(){return q}}),Object.defineProperty(c,"settleDebounce",{enumerable:!0,get:function(){return re}}),Object.defineProperty(c,"whenIdle",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(c,"uid",{enumerable:!0,get:function(){return le}});const T="1.75.0";async function $(){return T}const K="1.75.0",A=new Set,R=2e3;function h(o){if(A.add(o),A.size>R){const i=A.values().next().value;i!==void 0&&A.delete(i)}}const F=[],Q=500;function z(o,i,a){F.push({key:o,level:i,message:a.map(d=>typeof d=="string"?d:N(d)).join(" "),at:Date.now()}),F.length>Q&&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 V(o,...i){A.has(o)||(h(o),z(o,"warn",i),console.warn("[lattice]",...i))}function O(o,...i){A.has(o)||(h(o),z(o,"info",i),console.info("[lattice]",...i))}function E(){A.clear(),F.length=0}function w(o,i){const a=new Error(`[lattice] ${o}`);throw i!==void 0&&(a.cause=i),a}function S(o,i){o||w(i)}const B=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function x(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function J(o){return typeof o=="function"}function _(o){return o==null}function oe(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 ie=new Map;function ee(o){let i=ie.get(o);if(i)return i;if(!o.includes("."))i=a=>a?.[o];else{const a=o.split("."),d=a.length;i=Y=>{let D=Y;for(let W=0;W<d;W++){if(D==null)return;D=D[a[W]]}return D}}return ie.set(o,i),i}const v=new Map;function H(o){let i=v.get(o);if(i)return i;if(!o.includes("."))i=(a,d)=>{a!=null&&(a[o]=d)};else{const a=o.split("."),d=a.length-1;i=(Y,D)=>{let W=Y;for(let X=0;X<d;X++){if(W==null)return;const de=a[X];W[de]==null&&(W[de]={}),W=W[de]}W!=null&&(W[a[d]]=D)}}return v.set(o,i),i}function G(o,i){return ee(i)(o)}function j(o,i,a){H(i)(o,a)}function U(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(/^./,a=>a.toUpperCase()):""}const ne={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function se(o){const i=o==null?"":String(o);return/[&<>"']/.test(i)?i.replace(/[&<>"']/g,a=>ne[a]):i}function ce(o){return String(o).replace(/\w\S*/g,i=>i[0].toUpperCase()+i.slice(1).toLowerCase())}function Pe(o,i,a){if(o!==void 0)return o===!0?{enabled:!0,...a}:o===!1?{enabled:!1}:x(o)?o:{[i]:o,enabled:!0}}function we(o){return o==null?[]:Array.isArray(o)?o:[o]}const je=Object.freeze(new Set(["__proto__","constructor","prototype"]));function me(o,i){if(!x(o))return x(i)?{...i}:i;if(!x(i))return i===void 0?o:i;const a={...o};for(const d of Object.keys(i)){if(je.has(d))continue;const Y=i[d];Y!==void 0&&(a[d]=x(Y)&&x(a[d])?me(a[d],Y):Y)}return a}function ye(o,i){if(!x(o)||!x(i)||o===i)return i;const a=Object.create(Object.getPrototypeOf(o));return Object.assign(a,o,i),a}class ge{#n;#e=new Map;#t;constructor(i=256,a=null){this.#n=i,this.#t=a}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 a=this.#e;if(!a.has(i))return;const d=a.get(i);return a.delete(i),a.set(i,d),d}peek(i){return this.#e.get(i)}set(i,a){const d=this.#e;return d.has(i)&&d.delete(i),d.set(i,a),this.#r(),a}delete(i){const a=this.#e.get(i);return this.#e.delete(i)&&this.#t&&this.#t(a,i),a}clear(){if(this.#t)for(const[i,a]of this.#e)this.#t(a,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 a=i.keys().next().value,d=i.get(a);i.delete(a),this.#t&&this.#t(d,a)}}}const he=new Map;function u(o,i){const a=`${o||""}|${i?JSON.stringify(i):""}`;let d=he.get(a);return d||(d=new Intl.Collator(o||void 0,{numeric:!0,sensitivity:"variant",...i}),he.set(a,d)),d}function g(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 a=String(o),d=String(i);return a<d?-1:a>d?1:0}function b(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const L=typeof requestAnimationFrame=="function";function I(o){return L?requestAnimationFrame(o):setTimeout(()=>o(b()),16)}function Z(o){o!=null&&(L?cancelAnimationFrame(o):clearTimeout(o))}function q(o){let i=null,a=null;const d=()=>{i=null;const D=a;a=null,o(...D||[])},Y=(...D)=>{a=D,i===null&&(i=I(d))};return Y.cancel=()=>{Z(i),i=null,a=null},Y.flush=()=>{i!==null&&(Z(i),d())},Y}function re(o,i){let a=null,d=null;const Y=()=>{if(a=null,d===null)return;const X=d;d=null,o(...X),D()},D=()=>{a=setTimeout(Y,i),typeof a?.unref=="function"&&a.unref()},W=(...X)=>{a===null?(o(...X),D()):(d=X,clearTimeout(a),D())};return W.flush=()=>{if(a!==null&&clearTimeout(a),a=null,d===null)return;const X=d;d=null,o(...X)},W.cancel=()=>{a!==null&&clearTimeout(a),a=null,d=null},W.pending=()=>a!==null||d!==null,W}function ue(o,i=50){return typeof requestIdleCallback=="function"?requestIdleCallback(o,{timeout:i}):setTimeout(()=>o({timeRemaining:()=>0,didTimeout:!0}),1)}let pe=0;function le(o="l"){return`${o}${(++pe).toString(36)}`}}),fe("packages/core/src/format/number.js",function(c,k){"use strict";Object.defineProperty(c,"compileNumber",{enumerable:!0,get:function(){return K}});const $=k("packages/core/src/internal/util.js").isNil;function K(A,R){const h=A||{},F=h.locale||R||void 0,Q=h.style||"decimal",z=typeof h.scale=="number"?h.scale:1,N=h.nullDisplay??"",C=h.zeroDisplay,V=h.prefix||"",O=h.suffix||"",E=h.negative||"minus",w=h.signed===!0,S={style:Q,notation:h.notation||"standard"};Q==="currency"&&(S.currency=h.currency||"USD",h.currencyDisplay&&(S.currencyDisplay=h.currencyDisplay)),typeof h.decimals=="number"?(S.minimumFractionDigits=h.decimals,S.maximumFractionDigits=h.decimals):(typeof h.minDecimals=="number"&&(S.minimumFractionDigits=h.minDecimals),typeof h.maxDecimals=="number"&&(S.maximumFractionDigits=h.maxDecimals),S.minimumFractionDigits>(S.maximumFractionDigits??20)&&(S.maximumFractionDigits=S.minimumFractionDigits)),h.thousandsSeparator===!1&&(S.useGrouping=!1),S.notation==="compact"&&(S.compactDisplay=h.compactDisplay||"short");const B=new Intl.NumberFormat(F,S),x=typeof h.thousandsSeparator=="string"?h.thousandsSeparator:null,J=typeof h.decimalSeparator=="string"?h.decimalSeparator:null;let _=",",oe=".";if(x||J)for(const G of B.formatToParts(12345.6))G.type==="group"?_=G.value:G.type==="decimal"&&(oe=G.value);const ae=G=>{let j=G;return x&&(j=j.split(_).join("")),J&&(j=j.split(oe).join("")),x&&(j=j.split("").join(x)),J&&(j=j.split("").join(J)),j},ie=!!(x||J),ee=V!==""&&Q==="currency",v=G=>{let j;if(ee){const U=B.formatToParts(G);let ne=!1;j="";for(const se of U)j+=se.value,!ne&&se.type==="currency"&&(j+=V,ne=!0);ne||(j=V+j)}else j=V+B.format(G);return ie&&(j=ae(j)),j+O},H=G=>{if($(G)||G==="")return N;const j=typeof G=="number"?G:Number(G);if(Number.isNaN(j))return N;const U=z===1?j:j*z;return U===0&&C!==void 0?C:U<0?E==="parentheses"?`(${v(-U)})`:E==="suffix"?`${v(-U)}-`:v(U):w&&U>0?`+${v(U)}`:v(U)};return H.negativeClass=h.negativeClass||null,H.spec=h,H}}),fe("packages/modules/geometry/geodata.js",function(c,k){"use strict";Object.defineProperty(c,"GEOMETRY_KINDS",{enumerable:!0,get:function(){return R}}),Object.defineProperty(c,"SPATIAL_OPERATORS",{enumerable:!0,get:function(){return h}}),Object.defineProperty(c,"GEOMETRY_OPERATORS",{enumerable:!0,get:function(){return F}}),Object.defineProperty(c,"EARTH_RADIUS",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(c,"toWkt",{enumerable:!0,get:function(){return U}}),Object.defineProperty(c,"toWkb",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(c,"readGeometry",{enumerable:!0,get:function(){return g}}),Object.defineProperty(c,"parseGeometry",{enumerable:!0,get:function(){return L}}),Object.defineProperty(c,"haversine",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"geometryInfo",{enumerable:!0,get:function(){return d}}),Object.defineProperty(c,"geometryKind",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(c,"spatialOperand",{enumerable:!0,get:function(){return W}}),Object.defineProperty(c,"spatialPredicate",{enumerable:!0,get:function(){return We}});const T=k("packages/core/src/internal/util.js"),$=T.isNil,K=T.isObject,A=T.warnOnce,R=Object.freeze(["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"]),h=Object.freeze(["withinBbox","withinPolygon","intersects","withinDistance"]),F=Object.freeze([...h,"blank","notBlank"]),Q=63710088e-1,z=Math.PI/180,N=16,C=1e-12;class V extends Error{}function O(t){throw new V(t)}function E(t){(!Array.isArray(t)||t.length<2)&&O("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))&&O("a coordinate is not a finite number"),[e,n]}function w(t,e,n){Array.isArray(t)||O(`${n} is not an array of positions`);const r=t.map(E);return r.length<e&&O(`${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&&O(`a polygon ring needs at least 3 distinct corners, found ${e.length-1}`),e}function B(t){return(!Array.isArray(t)||t.length===0)&&O("a polygon needs at least an outer ring"),t.map(S)}function x(t,e){switch(e>N&&O("geometry collections nest too deeply"),K(t)||O("GeoJSON must be an object"),t.type){case"Feature":return t.geometry==null?null:x(t.geometry,e+1);case"FeatureCollection":return O("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)&&O("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)&&O("a MultiPolygon needs at least one polygon"),{type:"MultiPolygon",coordinates:t.coordinates.map(B)};case"GeometryCollection":{(!Array.isArray(t.geometries)||!t.geometries.length)&&O("a GeometryCollection needs at least one geometry");const n=t.geometries.map(r=>x(r,e+1)).filter(Boolean);return n.length?{type:"GeometryCollection",geometries:n}:null}default:return O(`"${String(t.type)}" is not a GeoJSON geometry type`)}}const J=Object.freeze({POINT:"Point",LINESTRING:"LineString",POLYGON:"Polygon",MULTIPOINT:"MultiPoint",MULTILINESTRING:"MultiLineString",MULTIPOLYGON:"MultiPolygon",GEOMETRYCOLLECTION:"GeometryCollection"}),_=/[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/y,oe=/[A-Za-z]+/y,ae=/^\s*(?:SRID\s*=\s*\d+\s*;\s*)?[A-Za-z]+\s*(?:ZM|Z|M)?\s*(?:\(|EMPTY\b)/i;class ie{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&&O(`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(),_.lastIndex=this.at,_.test(this.text)}number(){this.space(),_.lastIndex=this.at;const e=_.exec(this.text);return e||O(`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&&O("geometry collections nest too deeply");const n=this.word(),r=J[n];r||O(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 ie(String(t).replace(/^\s*SRID\s*=\s*\d+\s*;/i,"")),n=e.geometry(0);return e.space(),e.at<e.text.length&&O(`WKT has unexpected text after the geometry at character ${e.at+1}`),n}function v(t){return Object.is(t,-0)?"0":String(t)}function H(t){return`${v(t[0])} ${v(t[1])}`}function G(t){return`(${t.map(H).join(", ")})`}function j(t){return`(${t.map(G).join(", ")})`}function U(t){const e=L(t);return e?ne(e):""}function ne(t){switch(t.type){case"Point":return`POINT (${H(t.coordinates)})`;case"LineString":return`LINESTRING ${G(t.coordinates)}`;case"Polygon":return`POLYGON ${j(t.coordinates)}`;case"MultiPoint":return`MULTIPOINT (${t.coordinates.map(e=>`(${H(e)})`).join(", ")})`;case"MultiLineString":return`MULTILINESTRING (${t.coordinates.map(G).join(", ")})`;case"MultiPolygon":return`MULTIPOLYGON (${t.coordinates.map(j).join(", ")})`;default:return`GEOMETRYCOLLECTION (${t.geometries.map(ne).join(", ")})`}}class se{view;at=0;constructor(e){this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}need(e){this.at+e>this.view.byteLength&&O(`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&&O(`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&&O("geometry collections nest too deeply");const r=this.u8();r!==0&&r!==1&&O(`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&&O(`WKB geometry type ${m} is not one this reads`),f=2+(M===3?2:1),m%=1e3}const P=R[m-1];switch(P||O(`WKB geometry type ${m} is not one this reads`),n&&P!==n&&O(`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),y=[];for(let p=0;p<M;p++)y.push(this.positions(s,f));return M?{type:"Polygon",coordinates:B(y)}:null}default:{const M=this.count(s,5),y=P==="GeometryCollection"?void 0:P.slice(5),p=[];for(let te=0;te<M;te++){const Se=this.geometry(e+1,y);Se&&p.push(Se)}return p.length?P==="GeometryCollection"?{type:P,geometries:p}:{type:P,coordinates:p.map(te=>te.coordinates)}:null}}}}function ce(t){const e=new se(t),n=e.geometry(0);return e.at!==t.byteLength&&O(`WKB has ${t.byteLength-e.at} bytes left over after the geometry`),n}function Pe(t){const e=L(t);if(!e)return null;const n=[];let r=0;const s=y=>{const p=new DataView(new ArrayBuffer(5));p.setUint8(0,1),p.setUint32(1,R.indexOf(y)+1,!0),n.push(p),r+=5},l=y=>{const p=new DataView(new ArrayBuffer(4));p.setUint32(0,y,!0),n.push(p),r+=4},f=y=>{const p=new DataView(new ArrayBuffer(16*y.length));y.forEach((te,Se)=>{p.setFloat64(Se*16,te[0],!0),p.setFloat64(Se*16+8,te[1],!0)}),n.push(p),r+=16*y.length},m=y=>{switch(s(y.type),y.type){case"Point":f([y.coordinates]);break;case"LineString":l(y.coordinates.length),f(y.coordinates);break;case"Polygon":l(y.coordinates.length);for(const p of y.coordinates)l(p.length),f(p);break;case"GeometryCollection":l(y.geometries.length);for(const p of y.geometries)m(p);break;default:{const p=y.type.slice(5);l(y.coordinates.length);for(const te of y.coordinates)m({type:p,coordinates:te})}}};m(e);const P=new Uint8Array(r);let M=0;for(const y of n)P.set(new Uint8Array(y.buffer),M),M+=y.byteLength;return P}const we=/^0[01](?:[0-9a-fA-F]{2})+$/,je=/^[A-Za-z0-9+/_-]+={0,2}$/,me=(()=>{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 ye(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|me[e.charCodeAt(f)],r+=6,r>=8&&(r-=8,n[l++]=s>>r&255);return n.subarray(0,l)}function he(t){const e=t.trim();if(e==="")return null;if(e[0]==="{"){let n;try{n=JSON.parse(e)}catch{return O("the text starts like GeoJSON but is not valid JSON")}return x(n,0)}if(we.test(e))return ce(ye(e));if(ae.test(e))return ee(e);if(je.test(e)){const n=ge(e);if(n.length>=5&&(n[0]===0||n[0]===1))return ce(n)}return O("the text is not WKT, GeoJSON, or hex or base64 WKB")}const u=new WeakSet;function g(t){if($(t))return{geometry:null,reason:null};if(typeof t=="object"&&u.has(t))return{geometry:t,reason:null};try{let e;return typeof t=="string"?e=he(t):t instanceof Uint8Array?e=ce(t):t instanceof ArrayBuffer?e=ce(new Uint8Array(t)):ArrayBuffer.isView(t)?e=ce(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)):K(t)?e=x(t,0):O(`${Array.isArray(t)?"an array":`a ${typeof t}`} is not a geometry`),e&&b(e),{geometry:e||null,reason:null}}catch(e){if(e instanceof V)return{geometry:null,reason:e.message};throw e}}function b(t){if(u.add(t),t.type==="GeometryCollection")for(const e of t.geometries)b(e)}function L(t){return g(t).geometry}function I(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)I(n,e)}}function Z(t,e){const n=t[1]*z,r=e[1]*z,s=r-n,l=(e[0]-t[0])*z,f=Math.sin(s/2)**2+Math.cos(n)*Math.cos(r)*Math.sin(l/2)**2;return 2*Q*Math.asin(Math.min(1,Math.sqrt(f)))}function q(t){let e=0;for(let n=1;n<t.length;n++)e+=Z(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])*z*Math.sin(t[r][1]*z)}return Math.abs(n)*Q*Q/2}function ue(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 o(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 i(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 y=pe(P),p=(M===0?1:-1)*(y.a<0?-1:1);s+=p*y.a,l+=p*y.cx,f+=p*y.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)i(n,e)}}const a=new WeakMap;function d(t){const e=L(t);if(!e)return null;const n=a.get(e);if(n)return n;const r=[1/0,1/0,-1/0,-1/0];I(e,y=>{y[0]<r[0]&&(r[0]=y[0]),y[1]<r[1]&&(r[1]=y[1]),y[0]>r[2]&&(r[2]=y[0]),y[1]>r[3]&&(r[3]=y[1])});const s=[le(),le(),le()];i(e,s);const l=s[2].get()||s[1].get()||s[0].get()||o([[r[0],r[1]],[r[2],r[3]]]);let f=0,m=0;const P=y=>{switch(y.type){case"LineString":f+=q(y.coordinates);break;case"MultiLineString":for(const p of y.coordinates)f+=q(p);break;case"Polygon":m+=ue(y.coordinates);for(const p of y.coordinates)f+=q(p);break;case"MultiPolygon":for(const p of y.coordinates){m+=ue(p);for(const te of p)f+=q(te)}break;case"GeometryCollection":for(const p of y.geometries)P(p);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 a.set(e,M),M}function Y(t){const e=d(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 W(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(K(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}=g(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 X(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,y]=e[f];P>r!=y>r&&n<(M-m)*(r-P)/(y-P)+m&&(s=!s)}return s}function de(t,e){if(!X(t,e[0]))return!1;for(let n=1;n<e.length;n++)if(X(t,e[n]))return!1;return!0}function Te(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)Te(r,e)}return e}function be(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 Oe(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 xe(t,e){const[n,r]=t,[s,l]=e,f=be(n,r,s),m=be(n,r,l),P=be(s,l,n),M=be(s,l,r);return f!==m&&P!==M?!0:f===0&&Oe(s,n,r)||m===0&&Oe(l,n,r)||P===0&&Oe(n,s,l)||M===0&&Oe(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=d(t),r=d(e);if(!$e(n.bbox,r.bbox))return!1;const s=Te(t),l=Te(e);for(const f of l.polygons)for(const m of s.points)if(de(m,f))return!0;for(const f of s.polygons)for(const m of l.points)if(de(m,f))return!0;for(const f of s.segments)for(const m of l.segments)if(xe(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(be(m[0],m[1],f)===0&&Oe(f,m[0],m[1]))return!0}for(const f of l.points)for(const m of s.segments)if(be(m[0],m[1],f)===0&&Oe(f,m[0],m[1]))return!0;return!1}function We(t,e){const{operand:n,reason:r}=W(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=d(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=>de(f,m));return f=>{const m=L(f);return m?m.type==="Point"?l(m.coordinates):m.type==="MultiPoint"?m.coordinates.every(l):l(d(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=d(l);return!!f&&Z(f.centroid,s)<=n.metres}}}}}),fe("packages/modules/geometry/messages.js",function(c,k){"use strict";Object.defineProperty(c,"withFallback",{enumerable:!0,get:function(){return K}});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,R){const h=T[A];return h===void 0?A:Array.isArray(h)?`${R.count} ${R.count===1?h[0]:h[1]}`:h.replace("{value}",String(R.value??""))}function K(A){return{t(R,h={}){const F=A&&typeof A.t=="function"?A.t(R,h):R;return F===R?$(R,h):F}}}}),fe("packages/modules/geometry/filter.js",function(c,k){"use strict";Object.defineProperty(c,"GeometryFilter",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return V}});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 K=T.createMessages;if(typeof K>"u")throw new Error("[lattice] geometry needs createMessages from the lattice-grid module. Load lattice-grid before geometry.");const A=k("packages/modules/geometry/geodata.js"),R=A.spatialOperand,h=A.toWkt,F=A.parseGeometry,z=k("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||K();super.init({...w,messages:z(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)?h(E):""}nodes(){const E=[];for(const w of super.nodes()){const S=w;if(!N[S.op]){E.push(w);continue}const{operand:B}=R(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 V=C}),fe("packages/modules/geometry/type.js",function(c,k){"use strict";Object.defineProperty(c,"GEOMETRY_KINDS",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"SPATIAL_OPERATORS",{enumerable:!0,get:function(){return V}}),Object.defineProperty(c,"GEOMETRY_OPERATORS",{enumerable:!0,get:function(){return O}}),Object.defineProperty(c,"EARTH_RADIUS",{enumerable:!0,get:function(){return E}}),Object.defineProperty(c,"readGeometry",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"parseGeometry",{enumerable:!0,get:function(){return S}}),Object.defineProperty(c,"toWkt",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"toWkb",{enumerable:!0,get:function(){return x}}),Object.defineProperty(c,"geometryInfo",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"geometryKind",{enumerable:!0,get:function(){return _}}),Object.defineProperty(c,"haversine",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"spatialOperand",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(c,"spatialPredicate",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(c,"GEOMETRY_FORMAT_PATTERNS",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(c,"compareGeometry",{enumerable:!0,get:function(){return H}}),Object.defineProperty(c,"formatGeometry",{enumerable:!0,get:function(){return me}}),Object.defineProperty(c,"GEOMETRY_TYPES",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return he}});const T=k("packages/core/src/internal/util.js"),$=T.isNil,K=T.warnOnce,R=k("packages/core/src/format/number.js").compileNumber,F=k("packages/modules/geometry/filter.js").GeometryFilter,z=k("packages/modules/geometry/messages.js").withFallback,N=k("packages/modules/geometry/geodata.js"),C=N.GEOMETRY_KINDS,V=N.SPATIAL_OPERATORS,O=N.GEOMETRY_OPERATORS,E=N.EARTH_RADIUS,w=N.readGeometry,S=N.parseGeometry,B=N.toWkt,x=N.toWkb,J=N.geometryInfo,_=N.geometryKind,oe=N.haversine,ae=N.spatialOperand,ie=N.spatialPredicate,ee=Object.freeze(["summary","wkt","geojson"]);function v(u,g){const{geometry:b,reason:L}=w(u);if(L){const I=g&&g.colId||"?";K(`geometry:refused:${I}`,`column "${I}" 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 b}function H(u,g){const b=J(u),L=J(g);if(!b||!L){if(b)return-1;if(L)return 1;if($(u))return $(g)?0:1;if($(g))return-1;const q=String(u),re=String(g);return q<re?-1:q>re?1:0}const I=b.centroid[1]-L.centroid[1];if(I!==0)return I<0?-1:1;const Z=b.centroid[0]-L.centroid[0];return Z<0?-1:Z>0?1:0}const G=new Map;function j(u,g,b){const L=`${u||""}|${b}`;let I=G.get(L);if(!I){const Z=R(g,u);I=q=>Z(q),G.set(L,I)}return I}function U(u,g){return u<1e3?`${j(g,{maxDecimals:0},"m")(u)} m`:`${j(g,{maxDecimals:1},"km")(u/1e3)} km`}function ne(u,g){return u<1e6?`${j(g,{maxDecimals:0},"m")(u)} m²`:`${j(g,{maxDecimals:2},"km2")(u/1e6)} km²`}function se(u){switch(u.type){case"Point":return 1;case"MultiPoint":case"LineString":return u.coordinates.length;case"MultiLineString":return u.coordinates.reduce((g,b)=>g+b.length,0);case"Polygon":return u.coordinates.reduce((g,b)=>g+b.length-1,0);case"MultiPolygon":return u.coordinates.reduce((g,b)=>g+b.reduce((L,I)=>L+I.length-1,0),0);default:return u.geometries.reduce((g,b)=>g+se(b),0)}}function ce(u){return z(u&&u.messages)}function Pe(u){return{compile:g=>ie(u,g),check:g=>ae(u,g).reason||null}}function we(u,g,b){const L=J(u);if(u.type==="Point"){const ue=j(g,{decimals:4},"deg"),[pe,le]=u.coordinates,o=b.t(le<0?"geometry.south":"geometry.north",{value:ue(Math.abs(le))}),i=b.t(pe<0?"geometry.west":"geometry.east",{value:ue(Math.abs(pe))});return`Point ${o} ${i}`}const I=[u.type];if(u.type.startsWith("Multi")||u.type==="GeometryCollection"){const ue=u.type==="GeometryCollection"?u.geometries.length:u.coordinates.length;I.push(b.t("geometry.parts",{count:ue}))}const q=se(u),re=u.type==="Polygon"||u.type==="MultiPolygon";return u.type!=="GeometryCollection"&&I.push(b.t(re?"geometry.vertices":"geometry.points",{count:q})),re?I.push(ne(L.area,g)):(u.type==="LineString"||u.type==="MultiLineString")&&I.push(U(L.length,g)),I.join(", ")}function je(u){const g=u&&u.format,b=g&&typeof g=="object"?g.pattern:void 0;if(b===void 0)return"summary";if(ee.includes(b))return b;const L=u&&u.id||"?";return K(`geometry:format:${L}`,`column "${L}" asks for geometry format pattern "${String(b)}", which is not one of ${ee.join(", ")}; the summary is shown instead.`),"summary"}function me(u){const g=u&&u.value;if($(g)||g==="")return"";const b=S(g);if(!b)return typeof g=="string"?g:"";switch(je(u.column)){case"wkt":return B(b);case"geojson":return JSON.stringify(b);default:return we(b,u.locale,ce(u.grid))}}function ye(u){if($(u))return"";const g=S(u);return g?B(g):typeof u=="string"?u:""}const ge=Object.freeze({geometry:{base:"object",storage:"object",format:u=>me(u),parse:u=>S(u&&u.text),compare:H,groupProjector:()=>u=>_(u)??u,geometry:u=>J(u),operators:Object.freeze(Object.fromEntries(V.map(u=>[u,Pe(u)]))),formatPatterns:ee,defaults:{filter:F,editor:"none",align:"start"},totals:{supported:["count","countValues"]},excel:"@",excelKind:"string",exportText:ye,toStorage:(u,g)=>v(u,g),toClipboard:ye,fromClipboard:u=>S(u)}}),he=ge}),fe("packages/modules/geometry/index.js",function(c,k){"use strict";Object.defineProperty(c,"geometryModule",{enumerable:!0,get:function(){return R}}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return h}});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=k("packages/modules/geometry/type.js").GEOMETRY_TYPES,R=Object.freeze({name:"geometry",capabilities:["dataType:geometry"],install(F){F.registry.register("dataType","geometry",A.geometry)}});$(R);const h=R});var Me=ke("packages/modules/geometry/index.js");if(typeof module=="object"&&module.exports)module.exports=Me;else if(typeof define=="function"&&define.amd)define(function(){return Me});else{var Ie=Ee.LatticeGrid||(Ee.LatticeGrid={});for(var Le in Me)Le!=="default"&&(Ie[Le]=Me[Le])}})(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.74.0, htmx module type declarations
2
+ * Lattice Grid 1.75.0, htmx module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */