@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.
- package/CHANGELOG.md +15 -0
- package/README.md +1 -1
- package/angular/package.json +1 -1
- package/docs/API.html +5 -5
- package/docs/THEMING.md +27 -0
- package/docs/api/adapters.html +1 -1
- package/docs/api/ai.html +1 -1
- package/docs/api/alarms.html +1 -1
- package/docs/api/calendar.html +1 -1
- package/docs/api/charts.html +1 -1
- package/docs/api/dashboard.html +1 -1
- package/docs/api/data-router.html +1 -1
- package/docs/api/deckgl.html +1 -1
- package/docs/api/designer.html +2 -2
- package/docs/api/gantt.html +1 -1
- package/docs/api/geometry.html +1 -1
- package/docs/api/grid.html +2 -2
- package/docs/api/index.html +1 -1
- package/docs/api/kanban.html +1 -1
- package/docs/api/kpi.html +1 -1
- package/docs/api/layout.html +1 -1
- package/docs/api/leaflet.html +1 -1
- package/docs/api/list.html +1 -1
- package/docs/api/mapview.html +1 -1
- package/docs/api/mock-socket.html +1 -1
- package/docs/api/presets.html +1 -1
- package/docs/api/tabs.html +1 -1
- package/docs/api/types.html +1 -1
- package/docs/api-detail.html +4 -4
- package/docs/warnings.json +1 -1
- package/lattice-grid.d.ts +1 -1
- package/lattice-grid.esm.min.js +3 -3
- package/lattice-grid.min.cjs +3 -3
- package/lattice-grid.min.css +1 -1
- package/lattice-grid.min.js +3 -3
- package/modules/ai.d.ts +1 -1
- package/modules/ai.esm.min.js +2 -2
- package/modules/ai.min.cjs +2 -2
- package/modules/ai.min.js +2 -2
- package/modules/alarms.d.ts +1 -1
- package/modules/alarms.esm.min.js +2 -2
- package/modules/alarms.min.cjs +2 -2
- package/modules/alarms.min.js +2 -2
- package/modules/angular.d.ts +1 -1
- package/modules/angular.esm.min.js +2 -2
- package/modules/angular.min.cjs +2 -2
- package/modules/angular.min.js +2 -2
- package/modules/calendar.d.ts +1 -1
- package/modules/calendar.esm.min.js +2 -2
- package/modules/calendar.min.cjs +2 -2
- package/modules/calendar.min.js +2 -2
- package/modules/chart-alluvial.d.ts +1 -1
- package/modules/chart-alluvial.esm.min.js +1 -1
- package/modules/chart-alluvial.min.cjs +1 -1
- package/modules/chart-alluvial.min.js +1 -1
- package/modules/chart-arc.d.ts +1 -1
- package/modules/chart-arc.esm.min.js +1 -1
- package/modules/chart-arc.min.cjs +1 -1
- package/modules/chart-arc.min.js +1 -1
- package/modules/chart-barrace.d.ts +1 -1
- package/modules/chart-barrace.esm.min.js +1 -1
- package/modules/chart-barrace.min.cjs +1 -1
- package/modules/chart-barrace.min.js +1 -1
- package/modules/chart-bubblemap.d.ts +1 -1
- package/modules/chart-bubblemap.esm.min.js +1 -1
- package/modules/chart-bubblemap.min.cjs +1 -1
- package/modules/chart-bubblemap.min.js +1 -1
- package/modules/chart-bump.d.ts +1 -1
- package/modules/chart-bump.esm.min.js +1 -1
- package/modules/chart-bump.min.cjs +1 -1
- package/modules/chart-bump.min.js +1 -1
- package/modules/chart-calendar.d.ts +1 -1
- package/modules/chart-calendar.esm.min.js +1 -1
- package/modules/chart-calendar.min.cjs +1 -1
- package/modules/chart-calendar.min.js +1 -1
- package/modules/chart-choropleth.d.ts +1 -1
- package/modules/chart-choropleth.esm.min.js +1 -1
- package/modules/chart-choropleth.min.cjs +1 -1
- package/modules/chart-choropleth.min.js +1 -1
- package/modules/chart-decomposition.d.ts +1 -1
- package/modules/chart-decomposition.esm.min.js +1 -1
- package/modules/chart-decomposition.min.cjs +1 -1
- package/modules/chart-decomposition.min.js +1 -1
- package/modules/chart-diverging.d.ts +1 -1
- package/modules/chart-diverging.esm.min.js +1 -1
- package/modules/chart-diverging.min.cjs +1 -1
- package/modules/chart-diverging.min.js +1 -1
- package/modules/chart-dumbbell.d.ts +1 -1
- package/modules/chart-dumbbell.esm.min.js +1 -1
- package/modules/chart-dumbbell.min.cjs +1 -1
- package/modules/chart-dumbbell.min.js +1 -1
- package/modules/chart-fan.d.ts +1 -1
- package/modules/chart-fan.esm.min.js +1 -1
- package/modules/chart-fan.min.cjs +1 -1
- package/modules/chart-fan.min.js +1 -1
- package/modules/chart-forcetree.d.ts +1 -1
- package/modules/chart-forcetree.esm.min.js +1 -1
- package/modules/chart-forcetree.min.cjs +1 -1
- package/modules/chart-forcetree.min.js +1 -1
- package/modules/chart-hexbin.d.ts +1 -1
- package/modules/chart-hexbin.esm.min.js +1 -1
- package/modules/chart-hexbin.min.cjs +1 -1
- package/modules/chart-hexbin.min.js +1 -1
- package/modules/chart-hexmap.d.ts +1 -1
- package/modules/chart-hexmap.esm.min.js +1 -1
- package/modules/chart-hexmap.min.cjs +1 -1
- package/modules/chart-hexmap.min.js +1 -1
- package/modules/chart-icicle.d.ts +1 -1
- package/modules/chart-icicle.esm.min.js +1 -1
- package/modules/chart-icicle.min.cjs +1 -1
- package/modules/chart-icicle.min.js +1 -1
- package/modules/chart-markermap.d.ts +1 -1
- package/modules/chart-markermap.esm.min.js +1 -1
- package/modules/chart-markermap.min.cjs +1 -1
- package/modules/chart-markermap.min.js +1 -1
- package/modules/chart-motion.d.ts +1 -1
- package/modules/chart-motion.esm.min.js +1 -1
- package/modules/chart-motion.min.cjs +1 -1
- package/modules/chart-motion.min.js +1 -1
- package/modules/chart-pack.d.ts +1 -1
- package/modules/chart-pack.esm.min.js +1 -1
- package/modules/chart-pack.min.cjs +1 -1
- package/modules/chart-pack.min.js +1 -1
- package/modules/chart-parallel.d.ts +1 -1
- package/modules/chart-parallel.esm.min.js +1 -1
- package/modules/chart-parallel.min.cjs +1 -1
- package/modules/chart-parallel.min.js +1 -1
- package/modules/chart-pictorial.d.ts +1 -1
- package/modules/chart-pictorial.esm.min.js +1 -1
- package/modules/chart-pictorial.min.cjs +1 -1
- package/modules/chart-pictorial.min.js +1 -1
- package/modules/chart-polararea.d.ts +1 -1
- package/modules/chart-polararea.esm.min.js +1 -1
- package/modules/chart-polararea.min.cjs +1 -1
- package/modules/chart-polararea.min.js +1 -1
- package/modules/chart-polarscatter.d.ts +1 -1
- package/modules/chart-polarscatter.esm.min.js +1 -1
- package/modules/chart-polarscatter.min.cjs +1 -1
- package/modules/chart-polarscatter.min.js +1 -1
- package/modules/chart-pyramid.d.ts +1 -1
- package/modules/chart-pyramid.esm.min.js +1 -1
- package/modules/chart-pyramid.min.cjs +1 -1
- package/modules/chart-pyramid.min.js +1 -1
- package/modules/chart-radialbar.d.ts +1 -1
- package/modules/chart-radialbar.esm.min.js +1 -1
- package/modules/chart-radialbar.min.cjs +1 -1
- package/modules/chart-radialbar.min.js +1 -1
- package/modules/chart-ridgeline.d.ts +1 -1
- package/modules/chart-ridgeline.esm.min.js +1 -1
- package/modules/chart-ridgeline.min.cjs +1 -1
- package/modules/chart-ridgeline.min.js +1 -1
- package/modules/chart-roc.d.ts +1 -1
- package/modules/chart-roc.esm.min.js +1 -1
- package/modules/chart-roc.min.cjs +1 -1
- package/modules/chart-roc.min.js +1 -1
- package/modules/chart-serpentine.d.ts +1 -1
- package/modules/chart-serpentine.esm.min.js +1 -1
- package/modules/chart-serpentine.min.cjs +1 -1
- package/modules/chart-serpentine.min.js +1 -1
- package/modules/chart-slope.d.ts +1 -1
- package/modules/chart-slope.esm.min.js +1 -1
- package/modules/chart-slope.min.cjs +1 -1
- package/modules/chart-slope.min.js +1 -1
- package/modules/chart-spiral.d.ts +1 -1
- package/modules/chart-spiral.esm.min.js +1 -1
- package/modules/chart-spiral.min.cjs +1 -1
- package/modules/chart-spiral.min.js +1 -1
- package/modules/chart-splom.d.ts +1 -1
- package/modules/chart-splom.esm.min.js +1 -1
- package/modules/chart-splom.min.cjs +1 -1
- package/modules/chart-splom.min.js +1 -1
- package/modules/chart-tree.d.ts +1 -1
- package/modules/chart-tree.esm.min.js +1 -1
- package/modules/chart-tree.min.cjs +1 -1
- package/modules/chart-tree.min.js +1 -1
- package/modules/chart-venn.d.ts +1 -1
- package/modules/chart-venn.esm.min.js +1 -1
- package/modules/chart-venn.min.cjs +1 -1
- package/modules/chart-venn.min.js +1 -1
- package/modules/chart-voronoi.d.ts +1 -1
- package/modules/chart-voronoi.esm.min.js +1 -1
- package/modules/chart-voronoi.min.cjs +1 -1
- package/modules/chart-voronoi.min.js +1 -1
- package/modules/chart-waffle.d.ts +1 -1
- package/modules/chart-waffle.esm.min.js +1 -1
- package/modules/chart-waffle.min.cjs +1 -1
- package/modules/chart-waffle.min.js +1 -1
- package/modules/chart-wordcloud.d.ts +1 -1
- package/modules/chart-wordcloud.esm.min.js +1 -1
- package/modules/chart-wordcloud.min.cjs +1 -1
- package/modules/chart-wordcloud.min.js +1 -1
- package/modules/charts.d.ts +1 -1
- package/modules/charts.esm.min.js +2 -2
- package/modules/charts.min.cjs +2 -2
- package/modules/charts.min.js +2 -2
- package/modules/dashboard.d.ts +1 -1
- package/modules/dashboard.esm.min.js +2 -2
- package/modules/dashboard.min.cjs +2 -2
- package/modules/dashboard.min.js +2 -2
- package/modules/data-router.d.ts +1 -1
- package/modules/data-router.esm.min.js +2 -2
- package/modules/data-router.min.cjs +2 -2
- package/modules/data-router.min.js +2 -2
- package/modules/deckgl.d.ts +1 -1
- package/modules/deckgl.esm.min.js +2 -2
- package/modules/deckgl.min.cjs +2 -2
- package/modules/deckgl.min.js +2 -2
- package/modules/designer.d.ts +1 -1
- package/modules/designer.esm.min.js +187 -73
- package/modules/designer.esm.min.js.map +2 -2
- package/modules/designer.min.cjs +187 -73
- package/modules/designer.min.js +187 -73
- package/modules/designer.min.js.map +2 -2
- package/modules/devtools.d.ts +1 -1
- package/modules/devtools.esm.min.js +1 -1
- package/modules/devtools.min.cjs +1 -1
- package/modules/devtools.min.js +1 -1
- package/modules/dhtmlx-compat.d.ts +1 -1
- package/modules/dhtmlx-compat.esm.min.js +2 -2
- package/modules/dhtmlx-compat.min.cjs +2 -2
- package/modules/dhtmlx-compat.min.js +2 -2
- package/modules/gantt.d.ts +1 -1
- package/modules/gantt.esm.min.js +2 -2
- package/modules/gantt.min.cjs +2 -2
- package/modules/gantt.min.js +2 -2
- package/modules/geo-europe-nuts.d.ts +1 -1
- package/modules/geo-europe-nuts.esm.min.js +1 -1
- package/modules/geo-europe-nuts.min.cjs +1 -1
- package/modules/geo-europe-nuts.min.js +1 -1
- package/modules/geo-uk.d.ts +1 -1
- package/modules/geo-uk.esm.min.js +1 -1
- package/modules/geo-uk.min.cjs +1 -1
- package/modules/geo-uk.min.js +1 -1
- package/modules/geo-us-states.d.ts +1 -1
- package/modules/geo-us-states.esm.min.js +1 -1
- package/modules/geo-us-states.min.cjs +1 -1
- package/modules/geo-us-states.min.js +1 -1
- package/modules/geo-world-110m.d.ts +1 -1
- package/modules/geo-world-110m.esm.min.js +1 -1
- package/modules/geo-world-110m.min.cjs +1 -1
- package/modules/geo-world-110m.min.js +1 -1
- package/modules/geo-world-50m.d.ts +1 -1
- package/modules/geo-world-50m.esm.min.js +1 -1
- package/modules/geo-world-50m.min.cjs +1 -1
- package/modules/geo-world-50m.min.js +1 -1
- package/modules/geometry.d.ts +1 -1
- package/modules/geometry.esm.min.js +2 -2
- package/modules/geometry.min.cjs +2 -2
- package/modules/geometry.min.js +2 -2
- package/modules/htmx.d.ts +1 -1
- package/modules/htmx.esm.min.js +3 -3
- package/modules/htmx.min.cjs +3 -3
- package/modules/htmx.min.js +3 -3
- package/modules/kanban.d.ts +1 -1
- package/modules/kanban.esm.min.js +2 -2
- package/modules/kanban.min.cjs +2 -2
- package/modules/kanban.min.js +2 -2
- package/modules/kpi.d.ts +1 -1
- package/modules/kpi.esm.min.js +2 -2
- package/modules/kpi.min.cjs +2 -2
- package/modules/kpi.min.js +2 -2
- package/modules/layout.d.ts +1 -1
- package/modules/layout.esm.min.js +2 -2
- package/modules/layout.min.cjs +2 -2
- package/modules/layout.min.js +2 -2
- package/modules/leaflet.d.ts +1 -1
- package/modules/leaflet.esm.min.js +2 -2
- package/modules/leaflet.min.cjs +2 -2
- package/modules/leaflet.min.js +2 -2
- package/modules/list.d.ts +1 -1
- package/modules/list.esm.min.js +2 -2
- package/modules/list.min.cjs +2 -2
- package/modules/list.min.js +2 -2
- package/modules/mapview.d.ts +1 -1
- package/modules/mapview.esm.min.js +2 -2
- package/modules/mapview.min.cjs +2 -2
- package/modules/mapview.min.js +2 -2
- package/modules/mock-socket.d.ts +1 -1
- package/modules/mock-socket.esm.min.js +1 -1
- package/modules/mock-socket.min.cjs +1 -1
- package/modules/mock-socket.min.js +1 -1
- package/modules/presets/antd5.css +9 -0
- package/modules/presets/bootstrap5.css +9 -0
- package/modules/presets/fluent2.css +9 -0
- package/modules/presets/material3.css +9 -0
- package/modules/presets.d.ts +1 -1
- package/modules/presets.esm.min.js +2 -2
- package/modules/presets.min.cjs +2 -2
- package/modules/presets.min.js +2 -2
- package/modules/react.d.ts +1 -1
- package/modules/react.esm.min.js +2 -2
- package/modules/react.min.cjs +2 -2
- package/modules/react.min.js +2 -2
- package/modules/svelte.d.ts +1 -1
- package/modules/svelte.esm.min.js +2 -2
- package/modules/svelte.min.cjs +2 -2
- package/modules/svelte.min.js +2 -2
- package/modules/tabs.d.ts +1 -1
- package/modules/tabs.esm.min.js +2 -2
- package/modules/tabs.min.cjs +2 -2
- package/modules/tabs.min.js +2 -2
- package/modules/vue.d.ts +1 -1
- package/modules/vue.esm.min.js +2 -2
- package/modules/vue.min.cjs +2 -2
- package/modules/vue.min.js +2 -2
- package/modules/webcomponent.d.ts +1 -1
- package/modules/webcomponent.esm.min.js +3 -3
- package/modules/webcomponent.min.cjs +3 -3
- package/modules/webcomponent.min.js +3 -3
- package/package.json +1 -1
package/modules/charts.min.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.89.
|
|
2
|
+
* Lattice Grid 1.89.1, charts module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
(function(Ir){"use strict";var Dr=Object.create(null),Br=Object.create(null);function at(r,le){Dr[r]=le}function Gr(r){var le=Br[r];if(le)return le;var Oe=Object.create(null);Br[r]=Oe;var ue=Dr[r];if(!ue)throw new Error("[lattice] missing module: "+r);return ue(Oe,Gr),Oe}at("packages/modules/charts/svg.js",function(r,le){"use strict";Object.defineProperty(r,"SVG_NS",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(r,"el",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"svg",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"attr",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"attrs",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(r,"setText",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"clear",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"append",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(r,"path",{enumerable:!0,get:function(){return F}}),Object.defineProperty(r,"ribbonPath",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"round",{enumerable:!0,get:function(){return R}}),Object.defineProperty(r,"pathRings",{enumerable:!0,get:function(){return c}}),Object.defineProperty(r,"insideRings",{enumerable:!0,get:function(){return Z}});const Oe="http://www.w3.org/2000/svg";function ue(X){const M=X.indexOf(")");return M<0?X:X.slice(M+1).trim()||"#0072b2"}function j(X,M,g){const h=X.createElement(M);return g&&h.setAttribute("class",g),h}function Ae(X,M,g){const h=X.createElementNS(Oe,M);if(g)for(const f of Object.keys(g))h.setAttribute(f,String(g[f]));return h}function Se(X,M,g){if(!X)return;if(g==null){X.removeAttribute(M);return}let h=String(g);h.startsWith("url(#")&&(M==="stroke"||M==="fill"&&X.localName==="text")&&(h=ue(h)),X.setAttribute(M,h)}function fe(X,M){if(X)for(const g of Object.keys(M))Se(X,g,M[g])}function ae(X,M){X&&(X.textContent=M==null?"":String(M))}function ee(X){if(X)for(;X.firstChild;)X.removeChild(X.firstChild)}function ce(X,M){for(const g of M)g&&X.appendChild(g);return X}function F(X){return X.join(" ")}function x(X){if(!X||X.length<2)return"";const M=["M",X[0].x,X[0].upper];for(let g=1;g<X.length;g++)M.push("L",X[g].x,X[g].upper);for(let g=X.length-1;g>=0;g--)M.push("L",X[g].x,X[g].lower);return M.push("Z"),F(M)}function R(X){return Math.round(X*100)/100}function c(X){const M=[];let g=[];const h=String(X||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let f="",v=[];const J=()=>{if(!f||!v.length){v=[];return}if(f==="M"||f==="L")for(let p=0;p+1<v.length;p+=2)g.push([v[p],v[p+1]]);else f!=="Z"&&v.length>=2&&g.push([v[v.length-2],v[v.length-1]]);v=[]};for(const p of h){if(/[A-Za-z]/.test(p)){if(J(),p==="Z"||p==="z"){g.length>2&&M.push(g),g=[],f="";continue}p==="M"&&g.length>2&&(M.push(g),g=[]),f=p;continue}v.push(Number(p))}return J(),g.length>2&&M.push(g),M}function Z(X,M,g){let h=!1;for(const f of X)for(let v=0,J=f.length-1;v<f.length;J=v++){const[p,z]=f[v],[d,S]=f[J];z>g!=S>g&&M<(d-p)*(g-z)/(S-z||1e-12)+p&&(h=!h)}return h}}),at("packages/modules/charts/typography.js",function(r,le){"use strict";Object.defineProperty(r,"BASE_SIZE",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(r,"BASE_FAMILY",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(r,"CHAR_RATIO",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"resolveType",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"textWidth",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(r,"widestLabel",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"truncateTo",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"applySize",{enumerable:!0,get:function(){return ce}});const Oe=12,ue="var(--lattice-font-family, system-ui, -apple-system, sans-serif)",j=.62;function Ae(F){const x=F&&F.font,R=typeof x=="number"?{size:x}:x||{},c=Se(R.size,Oe);return{family:R.family||ue,size:c,small:Se(R.small??R.tickSize,Math.max(9,c-1)),title:Se(R.title,Math.round(c*1.15)),axisTitle:Se(R.axisTitle,Math.max(10,c-1)),weight:R.weight||"inherit"}}function Se(F,x){const R=Number(F);return Number.isFinite(R)&&R>0?R:x}function fe(F,x){return String(F??"").length*x*j}function ae(F,x){let R=0;for(const c of F||[]){const Z=fe(c,x);Z>R&&(R=Z)}return R}function ee(F,x,R){const c=String(F??""),Z=Math.floor(x/(R*j));return Z<=0?"":c.length<=Z?c:Z===1?"…":`${c.slice(0,Z-1)}…`}function ce(F,x){!F||!Number.isFinite(x)||(F.style?F.style.fontSize=`${x}px`:F.setAttribute("style",`font-size:${x}px`))}}),at("packages/modules/charts/frame.js",function(r,le){"use strict";Object.defineProperty(r,"LABEL_GAP",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"LABEL_GUTTER_SHARE",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"resolveMargin",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(r,"plotRect",{enumerable:!0,get:function(){return F}}),Object.defineProperty(r,"shouldRotate",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"Pool",{enumerable:!0,get:function(){return R}});const ue=le("packages/modules/charts/svg.js").SVG_NS,j=le("packages/modules/charts/typography.js"),Ae=j.textWidth,Se=j.widestLabel,fe=8,ae=6,ee=.4;function ce(c,Z){const X=typeof c=="number"?c:Z,M=c&&typeof c=="object"?c:{},g=h=>Number.isFinite(h)&&h>=0?Number(h):X;return{base:X,top:g(M.top),right:g(M.right),bottom:g(M.bottom),left:g(M.left)}}function F(c){const Z=ce(c.margin,typeof c.padding=="number"?c.padding:8),X=Z.base,M=c.fontSize||12,g=c.yLabels||[],h=c.xLabels||[],f=c.ySide==="right"?"right":"left",v=f==="right"?"left":"right",J=c.titles||{},p=c.titleSize||M,z=W=>W?p+ae:0,d=Se(g,M),S=g.length?Math.min(c.width*ee,Z[f]+d+ae):Math.max(fe,Z[f]),_=Z[v]+(c.rightGutter||0),w=(f==="left"?S:_)+z(J.left),m=Se(h.map(W=>String(W).slice(0,14)),M),G=(h.length?c.rotated?Math.min(c.height*ee,ae+m):M+ae+Z.bottom:Math.max(fe,Z.bottom))+z(J.bottom),P=(f==="right"?S:_)+z(J.right),B=Z.top+(c.topGutter||0),ie=Math.max(0,c.width-w-P),se=Math.max(0,c.height-B-G);return{left:w,top:B,width:ie,height:se,right:w+ie,bottom:B+se,gutter:{left:w,bottom:G,right:P,top:B}}}function x(c,Z,X,M){if(!c.length||Z<=0)return!1;const g=Number.isFinite(M)&&M>0?Number(M):1;return Se(c,X)>Z*g-4}class R{#r;#n=0;static#i="data-pool-key";constructor(Z,X=0){this.#r=Z,this.#n=X>0?X:0}next(Z,X,M){if(M!=null)return this.#e(Z,X,String(M));const g=this.#r.childNodes[this.#n],h=g&&g.tagName,f=/(^|\s)\S*__axis-title(\s|$)/,v=h&&f.test(String(g.getAttribute("class")||"")),J=!!X&&f.test(String(X));if(h&&(!v||J)&&String(h).toLowerCase()===Z.toLowerCase())return X&&g.setAttribute("class",X),this.#n++,g;const p=this.#r.ownerDocument.createElementNS(ue,Z);return X&&p.setAttribute("class",X),g?this.#r.insertBefore(p,g):this.#r.appendChild(p),this.#n++,p}#e(Z,X,M){const g=Z.toLowerCase();for(let v=this.#n;v<this.#r.childNodes.length;v++){const J=this.#r.childNodes[v],p=J&&J.tagName;if(p&&String(p).toLowerCase()===g&&J.getAttribute(R.#i)===M)return v!==this.#n&&this.#r.insertBefore(J,this.#r.childNodes[this.#n]),X&&J.setAttribute("class",X),this.#n++,J}const h=this.#r.ownerDocument.createElementNS(ue,Z);h.setAttribute(R.#i,M),X&&h.setAttribute("class",X);const f=this.#r.childNodes[this.#n];return f?this.#r.insertBefore(h,f):this.#r.appendChild(h),this.#n++,h}finish(){for(;this.#r.childNodes.length>this.#n;)this.#r.removeChild(this.#r.lastChild);this.#n=0}}}),at("packages/core/src/internal/util.js",function(r,le){"use strict";Object.defineProperty(r,"VERSION",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"reportedWarnings",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return c}}),Object.defineProperty(r,"infoOnce",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(r,"resetWarnings",{enumerable:!0,get:function(){return X}}),Object.defineProperty(r,"fail",{enumerable:!0,get:function(){return M}}),Object.defineProperty(r,"invariant",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"DEV",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"isObject",{enumerable:!0,get:function(){return f}}),Object.defineProperty(r,"isFunction",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"isNil",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"isBlank",{enumerable:!0,get:function(){return p}}),Object.defineProperty(r,"isCtor",{enumerable:!0,get:function(){return z}}),Object.defineProperty(r,"pathGetter",{enumerable:!0,get:function(){return S}}),Object.defineProperty(r,"pathSetter",{enumerable:!0,get:function(){return w}}),Object.defineProperty(r,"getPath",{enumerable:!0,get:function(){return m}}),Object.defineProperty(r,"setPath",{enumerable:!0,get:function(){return G}}),Object.defineProperty(r,"humanise",{enumerable:!0,get:function(){return P}}),Object.defineProperty(r,"escapeHtml",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(r,"titleCase",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"expand",{enumerable:!0,get:function(){return W}}),Object.defineProperty(r,"toArray",{enumerable:!0,get:function(){return L}}),Object.defineProperty(r,"merge",{enumerable:!0,get:function(){return i}}),Object.defineProperty(r,"mergeRow",{enumerable:!0,get:function(){return t}}),Object.defineProperty(r,"Lru",{enumerable:!0,get:function(){return e}}),Object.defineProperty(r,"collator",{enumerable:!0,get:function(){return $}}),Object.defineProperty(r,"defaultCompare",{enumerable:!0,get:function(){return O}}),Object.defineProperty(r,"now",{enumerable:!0,get:function(){return C}}),Object.defineProperty(r,"nextFrame",{enumerable:!0,get:function(){return I}}),Object.defineProperty(r,"cancelFrame",{enumerable:!0,get:function(){return b}}),Object.defineProperty(r,"frameBatched",{enumerable:!0,get:function(){return H}}),Object.defineProperty(r,"settleDebounce",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(r,"whenIdle",{enumerable:!0,get:function(){return re}}),Object.defineProperty(r,"uid",{enumerable:!0,get:function(){return te}});const Oe="1.89.0";async function ue(){return Oe}const j="1.89.0",Ae=new Set,Se=2e3;function fe(E){if(Ae.add(E),Ae.size>Se){const Y=Ae.values().next().value;Y!==void 0&&Ae.delete(Y)}}const ae=[],ee=500;function ce(E,Y,ne){ae.push({key:E,level:Y,message:ne.map(a=>typeof a=="string"?a:F(a)).join(" "),at:Date.now()}),ae.length>ee&&ae.shift()}function F(E){if(E instanceof Error)return E.message;try{return JSON.stringify(E)}catch{return String(E)}}function x(){return ae.map(E=>({...E}))}function R(E){if(E.length===0||typeof E[0]!="string")return E;const Y=E[0].replace(/^\[lattice\]\s*/,"");return Y===E[0]?E:[Y,...E.slice(1)]}function c(E,...Y){if(Ae.has(E))return;fe(E);const ne=R(Y);ce(E,"warn",ne),console.warn("[lattice]",...ne)}function Z(E,...Y){if(Ae.has(E))return;fe(E);const ne=R(Y);ce(E,"info",ne),console.info("[lattice]",...ne)}function X(){Ae.clear(),ae.length=0}function M(E,Y){const ne=new Error(`[lattice] ${E}`);throw Y!==void 0&&(ne.cause=Y),ne}function g(E,Y){E||M(Y)}const h=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function f(E){return E!==null&&typeof E=="object"&&!Array.isArray(E)}function v(E){return typeof E=="function"}function J(E){return E==null}function p(E){return E==null||E===""}function z(E){return typeof E!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(E))?!0:!!(E.prototype&&Object.getOwnPropertyNames(E.prototype).length>1)}const d=new Map;function S(E){let Y=d.get(E);if(Y)return Y;if(!E.includes("."))Y=ne=>ne?.[E];else{const ne=E.split("."),a=ne.length;Y=s=>{let n=s;for(let N=0;N<a;N++){if(n==null)return;n=n[ne[N]]}return n}}return d.set(E,Y),Y}const _=new Map;function w(E){let Y=_.get(E);if(Y)return Y;if(!E.includes("."))Y=(ne,a)=>{ne!=null&&(ne[E]=a)};else{const ne=E.split("."),a=ne.length-1;Y=(s,n)=>{let N=s;for(let o=0;o<a;o++){if(N==null)return;const k=ne[o];N[k]==null&&(N[k]={}),N=N[k]}N!=null&&(N[ne[a]]=n)}}return _.set(E,Y),Y}function m(E,Y){return S(Y)(E)}function G(E,Y,ne){w(Y)(E,ne)}function P(E){return E?(E.includes(".")?E.slice(E.lastIndexOf(".")+1):E).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(/^./,ne=>ne.toUpperCase()):""}const B={"&":"&","<":"<",">":">",'"':""","'":"'"};function ie(E){const Y=E==null?"":String(E);return/[&<>"']/.test(Y)?Y.replace(/[&<>"']/g,ne=>B[ne]):Y}function se(E){return String(E).replace(/\w\S*/g,Y=>Y[0].toUpperCase()+Y.slice(1).toLowerCase())}function W(E,Y,ne){if(E!==void 0)return E===!0?{enabled:!0,...ne}:E===!1?{enabled:!1}:f(E)?E:{[Y]:E,enabled:!0}}function L(E){return E==null?[]:Array.isArray(E)?E:[E]}const T=Object.freeze(new Set(["__proto__","constructor","prototype"]));function i(E,Y){if(!f(E))return f(Y)?{...Y}:Y;if(!f(Y))return Y===void 0?E:Y;const ne={...E};for(const a of Object.keys(Y)){if(T.has(a))continue;const s=Y[a];s!==void 0&&(ne[a]=f(s)&&f(ne[a])?i(ne[a],s):s)}return ne}function t(E,Y){if(!f(E)||!f(Y)||E===Y)return Y;const ne=Object.create(Object.getPrototypeOf(E));return Object.assign(ne,E,Y),ne}class e{#r;#n=new Map;#i;constructor(Y=256,ne=null){this.#r=Y,this.#i=ne}get size(){return this.#n.size}get max(){return this.#r}set max(Y){this.#r=Y,this.#e()}has(Y){return this.#n.has(Y)}get(Y){const ne=this.#n;if(!ne.has(Y))return;const a=ne.get(Y);return ne.delete(Y),ne.set(Y,a),a}peek(Y){return this.#n.get(Y)}set(Y,ne){const a=this.#n;return a.has(Y)&&a.delete(Y),a.set(Y,ne),this.#e(),ne}delete(Y){const ne=this.#n.get(Y);return this.#n.delete(Y)&&this.#i&&this.#i(ne,Y),ne}clear(){if(this.#i)for(const[Y,ne]of this.#n)this.#i(ne,Y);this.#n.clear()}keys(){return this.#n.keys()}values(){return this.#n.values()}#e(){const Y=this.#n;for(;Y.size>this.#r;){const ne=Y.keys().next().value,a=Y.get(ne);Y.delete(ne),this.#i&&this.#i(a,ne)}}}const u=new Map;function $(E,Y){const ne=`${E||""}|${Y?JSON.stringify(Y):""}`;let a=u.get(ne);return a||(a=new Intl.Collator(E||void 0,{numeric:!0,sensitivity:"variant",...Y}),u.set(ne,a)),a}function O(E,Y){if(E===Y)return 0;if(E==null)return 1;if(Y==null)return-1;if(typeof E=="number"&&typeof Y=="number")return Number.isNaN(E)?Number.isNaN(Y)?0:1:Number.isNaN(Y)||E<Y?-1:E>Y?1:0;const ne=String(E),a=String(Y);return ne<a?-1:ne>a?1:0}function C(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const V=typeof requestAnimationFrame=="function";function I(E){return V?requestAnimationFrame(E):setTimeout(()=>E(C()),16)}function b(E){E!=null&&(V?cancelAnimationFrame(E):clearTimeout(E))}function H(E){let Y=null,ne=null;const a=()=>{Y=null;const n=ne;ne=null,E(...n||[])},s=(...n)=>{ne=n,Y===null&&(Y=I(a))};return s.cancel=()=>{b(Y),Y=null,ne=null},s.flush=()=>{Y!==null&&(b(Y),a())},s}function oe(E,Y){let ne=null,a=null;const s=()=>{if(ne=null,a===null)return;const o=a;a=null,E(...o),n()},n=()=>{ne=setTimeout(s,Y),typeof ne?.unref=="function"&&ne.unref()},N=(...o)=>{ne===null?(E(...o),n()):(a=o,clearTimeout(ne),n())};return N.flush=()=>{if(ne!==null&&clearTimeout(ne),ne=null,a===null)return;const o=a;a=null,E(...o)},N.cancel=()=>{ne!==null&&clearTimeout(ne),ne=null,a=null},N.pending=()=>ne!==null||a!==null,N}function re(E,Y=50){return typeof requestIdleCallback=="function"?requestIdleCallback(E,{timeout:Y}):setTimeout(()=>E({timeRemaining:()=>0,didTimeout:!0}),1)}let pe=0;function te(E="l"){return`${E}${(++pe).toString(36)}`}}),at("packages/modules/charts/fills.js",function(r,le){"use strict";Object.defineProperty(r,"PATTERNS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"GRADIENTS",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"isFill",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(r,"isPaintRef",{enumerable:!0,get:function(){return F}}),Object.defineProperty(r,"paintFallback",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"normaliseFill",{enumerable:!0,get:function(){return c}}),Object.defineProperty(r,"swatchCss",{enumerable:!0,get:function(){return X}}),Object.defineProperty(r,"createFillRegistry",{enumerable:!0,get:function(){return M}}),Object.defineProperty(r,"rowPaint",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"patternSeries",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"paintSolid",{enumerable:!0,get:function(){return f}}),Object.defineProperty(r,"rowFillSource",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"nodePaint",{enumerable:!0,get:function(){return J}});const ue=le("packages/core/src/internal/util.js").warnOnce,j=Object.freeze(["hatch","crosshatch","dots","grid"]),Ae=Object.freeze(["linear","radial"]),Se=8,fe="#0072b2";let ae=0;const ee=new Map;function ce(p){return!!p&&typeof p=="object"&&!Array.isArray(p)&&(typeof p.gradient=="string"||typeof p.pattern=="string")}function F(p){return typeof p=="string"&&p.startsWith("url(#")}function x(p){if(typeof p!="string")return p==null?"":String(p);if(!p.startsWith("url("))return p;const z=p.indexOf(")");return(z<0?"":p.slice(z+1).trim())||fe}function R(p,z){ue(`chart:fill:invalid:${p}`,`a chart fill object was ignored: ${z} The mark was drawn in a solid colour instead. A fill is a gradient object (gradient: "linear" or "radial", with stops of [offset, colour]) or a pattern object (pattern: "hatch", "crosshatch", "dots" or "grid", with a colour).`)}function c(p,z){if(!ce(p))return null;const d=z||fe;if(typeof p.gradient=="string"){if(!Ae.includes(p.gradient))return R("gradient",`the gradient "${p.gradient}" is not one of ${Ae.join(", ")}.`),null;const m=Array.isArray(p.stops)?p.stops:[],G=[];for(const B of m){const ie=Array.isArray(B)?Number(B[0]):Number(B&&B.offset),se=Array.isArray(B)?B[1]:B&&B.colour;!Number.isFinite(ie)||typeof se!="string"||!se||G.push({offset:Math.min(1,Math.max(0,ie)),colour:se})}if(G.length<2)return R("stops","a gradient needs at least two [offset, colour] stops."),null;G.sort((B,ie)=>B.offset-ie.offset);const P=Number.isFinite(Number(p.angle))?Number(p.angle):180;return{kind:p.gradient,angle:P,stops:G,solid:G[0].colour}}if(!j.includes(p.pattern))return R("pattern",`the pattern "${p.pattern}" is not one of ${j.join(", ")}.`),null;const S=Number(p.size),_=Number(p.angle),w=typeof p.colour=="string"&&p.colour?p.colour:d;return{kind:"pattern",pattern:p.pattern,colour:w,background:typeof p.background=="string"&&p.background?p.background:null,size:Number.isFinite(S)&&S>=2?S:Se,angle:Number.isFinite(_)?_:p.pattern==="grid"||p.pattern==="dots"?0:45,solid:w}}function Z(p){if(p.kind==="pattern"){const d=p.colour,S=p.size,_=Math.max(1,S/5),w=p.background||"transparent",m=G=>`repeating-linear-gradient(${G+90}deg,${d} 0 ${_}px,transparent ${_}px ${S}px)`;return p.pattern==="hatch"?`${m(p.angle)},${w}`:p.pattern==="crosshatch"?`${m(p.angle)},${m(p.angle+90)},${w}`:p.pattern==="grid"?`${m(p.angle)},${m(p.angle+90)},${w}`:`radial-gradient(circle at 50% 50%,${d} ${S/6}px,transparent ${S/6+.5}px) 0 0/${S}px ${S}px,${w}`}const z=p.stops.map(d=>`${d.colour} ${Math.round(d.offset*100)}%`).join(",");return p.kind==="radial"?`radial-gradient(circle,${z})`:`linear-gradient(${p.angle}deg,${z})`}function X(p){if(!F(p))return typeof p=="string"?p:"";const z=String(p).indexOf(")"),d=String(p).slice(5,z),S=ee.get(d);return S?Z(S):x(p)}function M(p){const z=`lattice-fill-${++ae}`;let d=new Map,S=0;const _=(m,G)=>{const P=p.ownerDocument.createElementNS("http://www.w3.org/2000/svg",m);for(const B of Object.keys(G))P.setAttribute(B,String(G[B]));return P},w=(m,G)=>{if(G.kind==="pattern"){const B=G.size,ie=Math.max(1,B/5),se=_("pattern",{id:m,width:B,height:B,patternUnits:"userSpaceOnUse"});G.angle&&se.setAttribute("patternTransform",`rotate(${G.angle})`),G.background&&se.appendChild(_("rect",{width:B,height:B,fill:G.background}));const W={stroke:G.colour,"stroke-width":ie};G.pattern==="dots"?se.appendChild(_("circle",{cx:B/2,cy:B/2,r:Math.max(1,B/6),fill:G.colour})):(se.appendChild(_("line",{x1:B/2,y1:0,x2:B/2,y2:B,...W})),G.pattern!=="hatch"&&se.appendChild(_("line",{x1:0,y1:B/2,x2:B,y2:B/2,...W}))),p.appendChild(se);return}let P;if(G.kind==="radial")P=_("radialGradient",{id:m,cx:.5,cy:.5,r:.5});else{const B=G.angle*Math.PI/180,ie=Math.sin(B)/2,se=-Math.cos(B)/2;P=_("linearGradient",{id:m,x1:+(.5-ie).toFixed(4),y1:+(.5-se).toFixed(4),x2:+(.5+ie).toFixed(4),y2:+(.5+se).toFixed(4)})}for(const B of G.stops)P.appendChild(_("stop",{offset:B.offset,"stop-color":B.colour}));p.appendChild(P)};return{prefix:z,paint(m,G){const P=c(m,G);if(!P)return G||fe;if(!p||!p.ownerDocument)return P.solid;const B=JSON.stringify(P);let ie=d.get(B);if(!ie){const se=`${z}-${S++}`;w(se,P),ee.set(se,P),ie=`url(#${se}) ${P.solid}`,d.set(B,ie)}return ie},reset(){for(const m of d.values())ee.delete(m.slice(5,m.indexOf(")")));if(d=new Map,S=0,p)for(;p.firstChild;)p.removeChild(p.firstChild)},ids(){return[...d.values()].map(m=>m.slice(5,m.indexOf(")")))}}}function g(p,z,d){if(p==null||p==="")return null;const S=x(d);if(ce(p))return z?z.paint(p,S):(c(p,S)||{}).solid||null;if(typeof p=="string"){if(j.includes(p)){const _={pattern:p,colour:S};return z?z.paint(_,S):S}return p}return null}function h(p){const z=[{pattern:"hatch",angle:45},{pattern:"dots"},{pattern:"crosshatch",angle:45},{pattern:"hatch",angle:135},{pattern:"grid"},{pattern:"dots",size:5},{pattern:"hatch",angle:0},{pattern:"crosshatch",angle:0,size:6}];return p.map((d,S)=>({...z[S%z.length],colour:d,background:"var(--lattice-background, #fff)"}))}function f(p){return F(p)?String(p).replace(/^url\([^)]*\)\s*/,""):p}function v(p,z){const d=p.fill;if(ce(d))return(_,w)=>g(d,z.fills,f(w));if(typeof d=="function")return(_,w)=>{let m=null;try{m=d({label:_.label,x:_.x,y:_.y,rowKey:_.rowKey})}catch{m=null}return g(m,z.fills,f(w))};const S=typeof d=="string"?d:d&&typeof d=="object"&&typeof d.col=="string"?d.col:null;return S?(_,w)=>_.rowKey===void 0||_.rowKey===null?null:g(p.grid.rows.value(_.rowKey,S),z.fills,f(w)):null}function J(p,z,d){return p&&p({label:z.label,x:z.value,y:z.total,rowKey:z.rowKey},d)||d}}),at("packages/modules/charts/scheme.js",function(r,le){"use strict";Object.defineProperty(r,"PALETTE",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"SCHEMES",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"registerScheme",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"setDefaultScheme",{enumerable:!0,get:function(){return R}}),Object.defineProperty(r,"schemeNames",{enumerable:!0,get:function(){return c}}),Object.defineProperty(r,"resolveScheme",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"RAMP_SCALES",{enumerable:!0,get:function(){return f}}),Object.defineProperty(r,"toRgb",{enumerable:!0,get:function(){return p}}),Object.defineProperty(r,"rampStops",{enumerable:!0,get:function(){return z}});const ue=le("packages/core/src/internal/util.js").warnOnce,j=le("packages/modules/charts/fills.js"),Ae=j.isFill,Se=j.patternSeries,fe=j.rowPaint,ae=Object.freeze(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#7a5195","#6b7d8c"]),ee=Object.freeze({default:{series:ae,sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"},bright:{series:["#1f77d0","#ff7f0e","#2ca02c","#d62728","#9467bd","#17becf","#e377c2","#7f7f7f"],sequential:["#eef4fb","#1f77d0"],diverging:["#d62728","#f7f7f7","#1f77d0"],positive:"#2ca02c",negative:"#d62728"},earth:{series:["#5b7c6f","#c08b52","#7a6a53","#a4553f","#4e6a83","#8f8259","#6d5566","#8c9196"],sequential:["#f2efe9","#4e6a83"],diverging:["#a4553f","#f2efe9","#4e6a83"],positive:"#5b7c6f",negative:"#a4553f"},mono:{series:["#0b2a3d","#17475f","#2c6480","#4a82a0","#6da0bd","#94bcd6","#bcd7e9","#dfecf5"],sequential:["#eef3f7","#0b2a3d"],diverging:["#7a5c00","#f5f5f5","#0b2a3d"],positive:"#17475f",negative:"#7a5c00"},patterns:{series:Se(ae),sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"}}),ce=new Map;let F="default";function x(d,S){!d||!S||ce.set(String(d),S)}function R(d){if(typeof d=="string"){F=d;return}d&&typeof d=="object"&&(ce.set("__default__",d),F="__default__")}function c(){return[...Object.keys(ee),...ce.keys()].filter(d=>!d.startsWith("__"))}function Z(d){return ce.has(d)?ce.get(d):ee[d]||null}const X=["series","sequential","diverging","positive","negative"];function M(d){return!d||typeof d!="object"||Array.isArray(d)?!1:!X.some(S=>S in d)}function g(d,S){const _=S&&S.fills||null,w=Z(F)||ee.default,m=d&&d.scheme,G=M(m)?m:null,P=Array.isArray(m)&&m.length?m:null,B=typeof m=="string"?Z(m):G||Array.isArray(m)?null:m||null,ie=(d&&Array.isArray(d.palette)&&d.palette.length?d.palette:null)||P;G&&ie&&ue("chart:scheme:array-and-map",'chart "scheme" was given as a name map together with a "palette" array; the two do not combine. Colours came from the map and the array was ignored. Pass one or the other.');const se=G?null:ie,W={...ee.default,...w,...B||{}};se&&(W.series=se);const L=d&&d.ramp&&typeof d.ramp=="object"&&!Array.isArray(d.ramp)?d.ramp:null,T=L?L.colours:d&&d.ramp,i=Array.isArray(T)&&T.length>=2?T:null;i&&(W.sequential=i);const t=L?v(L.scale):null,e=!!(B||se||G),u=W.series&&W.series.length?W.series:ae,$=new Map;let O=0;return{...W,series:(V,I)=>{if(G&&I!==void 0&&I!==null){const b=String(I);return Object.prototype.hasOwnProperty.call(G,b)?h(G[b],_,V):($.has(b)||$.set(b,O++),h(J(u,$.get(b),!0),_,$.get(b)))}return h(J(u,V,e),_,V)},explicit:e,nameMap:!!G,rampScale:t,fills:_}}function h(d,S,_){if(!Ae(d))return d;const w=ae[(_%ae.length+ae.length)%ae.length];return fe(d,S,w)||w}const f=Object.freeze(["linear","log","quantile"]);function v(d){return d==null?null:f.includes(d)?d:(ue(`chart:ramp:scale:${String(d)}`,`chart "ramp.scale" was "${String(d)}", which is not a ramp scale; the chart chose one from its values instead. Use "linear", "log" or "quantile".`),null)}function J(d,S,_){const w=(S%d.length+d.length)%d.length;return _||typeof d[w]!="string"?d[w]:`var(--lattice-chart-${w+1}, ${d[w]})`}function p(d){if(typeof d!="string")return null;const S=d.trim(),_=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(S);if(_){const G=_[1];return G.length===3?[0,1,2].map(P=>parseInt(G[P]+G[P],16)):[0,2,4].map(P=>parseInt(G.slice(P,P+2),16))}const w=/^rgba?\(([^)]+)\)$/i.exec(S);if(!w)return null;const m=w[1].split(/[\s,/]+/).filter(Boolean).slice(0,3).map(Number);return m.length===3&&m.every(G=>Number.isFinite(G))?m:null}function z(d,S){const _=S?d.diverging:d.sequential,w=S?ee.default.diverging:ee.default.sequential,m=(Array.isArray(_)?_:w).map((G,P)=>p(G)||p(w[P])||[0,0,0]);return m.length>=2?m:w.map(G=>p(G))}}),at("packages/modules/charts/styles.js",function(r,le){"use strict";Object.defineProperty(r,"NS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"seriesColour",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"css",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(r,"injectStyles",{enumerable:!0,get:function(){return ae}});const ue=le("packages/modules/charts/scheme.js").PALETTE,j="lat-chartview",Ae="data-lattice-chartview";function Se(ee){const ce=(ee%ue.length+ue.length)%ue.length;return`var(--lattice-chart-${ce+1}, ${ue[ce]})`}function fe(){return`
|
|
6
|
+
(function(Ir){"use strict";var Dr=Object.create(null),Br=Object.create(null);function at(r,le){Dr[r]=le}function Gr(r){var le=Br[r];if(le)return le;var Oe=Object.create(null);Br[r]=Oe;var ue=Dr[r];if(!ue)throw new Error("[lattice] missing module: "+r);return ue(Oe,Gr),Oe}at("packages/modules/charts/svg.js",function(r,le){"use strict";Object.defineProperty(r,"SVG_NS",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(r,"el",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"svg",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"attr",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"attrs",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(r,"setText",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"clear",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"append",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(r,"path",{enumerable:!0,get:function(){return F}}),Object.defineProperty(r,"ribbonPath",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"round",{enumerable:!0,get:function(){return R}}),Object.defineProperty(r,"pathRings",{enumerable:!0,get:function(){return c}}),Object.defineProperty(r,"insideRings",{enumerable:!0,get:function(){return Z}});const Oe="http://www.w3.org/2000/svg";function ue(X){const M=X.indexOf(")");return M<0?X:X.slice(M+1).trim()||"#0072b2"}function j(X,M,g){const h=X.createElement(M);return g&&h.setAttribute("class",g),h}function Ae(X,M,g){const h=X.createElementNS(Oe,M);if(g)for(const f of Object.keys(g))h.setAttribute(f,String(g[f]));return h}function Se(X,M,g){if(!X)return;if(g==null){X.removeAttribute(M);return}let h=String(g);h.startsWith("url(#")&&(M==="stroke"||M==="fill"&&X.localName==="text")&&(h=ue(h)),X.setAttribute(M,h)}function fe(X,M){if(X)for(const g of Object.keys(M))Se(X,g,M[g])}function ae(X,M){X&&(X.textContent=M==null?"":String(M))}function ee(X){if(X)for(;X.firstChild;)X.removeChild(X.firstChild)}function ce(X,M){for(const g of M)g&&X.appendChild(g);return X}function F(X){return X.join(" ")}function x(X){if(!X||X.length<2)return"";const M=["M",X[0].x,X[0].upper];for(let g=1;g<X.length;g++)M.push("L",X[g].x,X[g].upper);for(let g=X.length-1;g>=0;g--)M.push("L",X[g].x,X[g].lower);return M.push("Z"),F(M)}function R(X){return Math.round(X*100)/100}function c(X){const M=[];let g=[];const h=String(X||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let f="",v=[];const J=()=>{if(!f||!v.length){v=[];return}if(f==="M"||f==="L")for(let p=0;p+1<v.length;p+=2)g.push([v[p],v[p+1]]);else f!=="Z"&&v.length>=2&&g.push([v[v.length-2],v[v.length-1]]);v=[]};for(const p of h){if(/[A-Za-z]/.test(p)){if(J(),p==="Z"||p==="z"){g.length>2&&M.push(g),g=[],f="";continue}p==="M"&&g.length>2&&(M.push(g),g=[]),f=p;continue}v.push(Number(p))}return J(),g.length>2&&M.push(g),M}function Z(X,M,g){let h=!1;for(const f of X)for(let v=0,J=f.length-1;v<f.length;J=v++){const[p,z]=f[v],[d,S]=f[J];z>g!=S>g&&M<(d-p)*(g-z)/(S-z||1e-12)+p&&(h=!h)}return h}}),at("packages/modules/charts/typography.js",function(r,le){"use strict";Object.defineProperty(r,"BASE_SIZE",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(r,"BASE_FAMILY",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(r,"CHAR_RATIO",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"resolveType",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"textWidth",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(r,"widestLabel",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"truncateTo",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"applySize",{enumerable:!0,get:function(){return ce}});const Oe=12,ue="var(--lattice-font-family, system-ui, -apple-system, sans-serif)",j=.62;function Ae(F){const x=F&&F.font,R=typeof x=="number"?{size:x}:x||{},c=Se(R.size,Oe);return{family:R.family||ue,size:c,small:Se(R.small??R.tickSize,Math.max(9,c-1)),title:Se(R.title,Math.round(c*1.15)),axisTitle:Se(R.axisTitle,Math.max(10,c-1)),weight:R.weight||"inherit"}}function Se(F,x){const R=Number(F);return Number.isFinite(R)&&R>0?R:x}function fe(F,x){return String(F??"").length*x*j}function ae(F,x){let R=0;for(const c of F||[]){const Z=fe(c,x);Z>R&&(R=Z)}return R}function ee(F,x,R){const c=String(F??""),Z=Math.floor(x/(R*j));return Z<=0?"":c.length<=Z?c:Z===1?"…":`${c.slice(0,Z-1)}…`}function ce(F,x){!F||!Number.isFinite(x)||(F.style?F.style.fontSize=`${x}px`:F.setAttribute("style",`font-size:${x}px`))}}),at("packages/modules/charts/frame.js",function(r,le){"use strict";Object.defineProperty(r,"LABEL_GAP",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"LABEL_GUTTER_SHARE",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"resolveMargin",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(r,"plotRect",{enumerable:!0,get:function(){return F}}),Object.defineProperty(r,"shouldRotate",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"Pool",{enumerable:!0,get:function(){return R}});const ue=le("packages/modules/charts/svg.js").SVG_NS,j=le("packages/modules/charts/typography.js"),Ae=j.textWidth,Se=j.widestLabel,fe=8,ae=6,ee=.4;function ce(c,Z){const X=typeof c=="number"?c:Z,M=c&&typeof c=="object"?c:{},g=h=>Number.isFinite(h)&&h>=0?Number(h):X;return{base:X,top:g(M.top),right:g(M.right),bottom:g(M.bottom),left:g(M.left)}}function F(c){const Z=ce(c.margin,typeof c.padding=="number"?c.padding:8),X=Z.base,M=c.fontSize||12,g=c.yLabels||[],h=c.xLabels||[],f=c.ySide==="right"?"right":"left",v=f==="right"?"left":"right",J=c.titles||{},p=c.titleSize||M,z=W=>W?p+ae:0,d=Se(g,M),S=g.length?Math.min(c.width*ee,Z[f]+d+ae):Math.max(fe,Z[f]),_=Z[v]+(c.rightGutter||0),w=(f==="left"?S:_)+z(J.left),m=Se(h.map(W=>String(W).slice(0,14)),M),G=(h.length?c.rotated?Math.min(c.height*ee,ae+m):M+ae+Z.bottom:Math.max(fe,Z.bottom))+z(J.bottom),P=(f==="right"?S:_)+z(J.right),B=Z.top+(c.topGutter||0),ie=Math.max(0,c.width-w-P),se=Math.max(0,c.height-B-G);return{left:w,top:B,width:ie,height:se,right:w+ie,bottom:B+se,gutter:{left:w,bottom:G,right:P,top:B}}}function x(c,Z,X,M){if(!c.length||Z<=0)return!1;const g=Number.isFinite(M)&&M>0?Number(M):1;return Se(c,X)>Z*g-4}class R{#r;#n=0;static#i="data-pool-key";constructor(Z,X=0){this.#r=Z,this.#n=X>0?X:0}next(Z,X,M){if(M!=null)return this.#e(Z,X,String(M));const g=this.#r.childNodes[this.#n],h=g&&g.tagName,f=/(^|\s)\S*__axis-title(\s|$)/,v=h&&f.test(String(g.getAttribute("class")||"")),J=!!X&&f.test(String(X));if(h&&(!v||J)&&String(h).toLowerCase()===Z.toLowerCase())return X&&g.setAttribute("class",X),this.#n++,g;const p=this.#r.ownerDocument.createElementNS(ue,Z);return X&&p.setAttribute("class",X),g?this.#r.insertBefore(p,g):this.#r.appendChild(p),this.#n++,p}#e(Z,X,M){const g=Z.toLowerCase();for(let v=this.#n;v<this.#r.childNodes.length;v++){const J=this.#r.childNodes[v],p=J&&J.tagName;if(p&&String(p).toLowerCase()===g&&J.getAttribute(R.#i)===M)return v!==this.#n&&this.#r.insertBefore(J,this.#r.childNodes[this.#n]),X&&J.setAttribute("class",X),this.#n++,J}const h=this.#r.ownerDocument.createElementNS(ue,Z);h.setAttribute(R.#i,M),X&&h.setAttribute("class",X);const f=this.#r.childNodes[this.#n];return f?this.#r.insertBefore(h,f):this.#r.appendChild(h),this.#n++,h}finish(){for(;this.#r.childNodes.length>this.#n;)this.#r.removeChild(this.#r.lastChild);this.#n=0}}}),at("packages/core/src/internal/util.js",function(r,le){"use strict";Object.defineProperty(r,"VERSION",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"reportedWarnings",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return c}}),Object.defineProperty(r,"infoOnce",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(r,"resetWarnings",{enumerable:!0,get:function(){return X}}),Object.defineProperty(r,"fail",{enumerable:!0,get:function(){return M}}),Object.defineProperty(r,"invariant",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"DEV",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"isObject",{enumerable:!0,get:function(){return f}}),Object.defineProperty(r,"isFunction",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"isNil",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"isBlank",{enumerable:!0,get:function(){return p}}),Object.defineProperty(r,"isCtor",{enumerable:!0,get:function(){return z}}),Object.defineProperty(r,"pathGetter",{enumerable:!0,get:function(){return S}}),Object.defineProperty(r,"pathSetter",{enumerable:!0,get:function(){return w}}),Object.defineProperty(r,"getPath",{enumerable:!0,get:function(){return m}}),Object.defineProperty(r,"setPath",{enumerable:!0,get:function(){return G}}),Object.defineProperty(r,"humanise",{enumerable:!0,get:function(){return P}}),Object.defineProperty(r,"escapeHtml",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(r,"titleCase",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"expand",{enumerable:!0,get:function(){return W}}),Object.defineProperty(r,"toArray",{enumerable:!0,get:function(){return L}}),Object.defineProperty(r,"merge",{enumerable:!0,get:function(){return i}}),Object.defineProperty(r,"mergeRow",{enumerable:!0,get:function(){return t}}),Object.defineProperty(r,"Lru",{enumerable:!0,get:function(){return e}}),Object.defineProperty(r,"collator",{enumerable:!0,get:function(){return $}}),Object.defineProperty(r,"defaultCompare",{enumerable:!0,get:function(){return O}}),Object.defineProperty(r,"now",{enumerable:!0,get:function(){return C}}),Object.defineProperty(r,"nextFrame",{enumerable:!0,get:function(){return I}}),Object.defineProperty(r,"cancelFrame",{enumerable:!0,get:function(){return b}}),Object.defineProperty(r,"frameBatched",{enumerable:!0,get:function(){return H}}),Object.defineProperty(r,"settleDebounce",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(r,"whenIdle",{enumerable:!0,get:function(){return re}}),Object.defineProperty(r,"uid",{enumerable:!0,get:function(){return te}});const Oe="1.89.1";async function ue(){return Oe}const j="1.89.1",Ae=new Set,Se=2e3;function fe(E){if(Ae.add(E),Ae.size>Se){const Y=Ae.values().next().value;Y!==void 0&&Ae.delete(Y)}}const ae=[],ee=500;function ce(E,Y,ne){ae.push({key:E,level:Y,message:ne.map(a=>typeof a=="string"?a:F(a)).join(" "),at:Date.now()}),ae.length>ee&&ae.shift()}function F(E){if(E instanceof Error)return E.message;try{return JSON.stringify(E)}catch{return String(E)}}function x(){return ae.map(E=>({...E}))}function R(E){if(E.length===0||typeof E[0]!="string")return E;const Y=E[0].replace(/^\[lattice\]\s*/,"");return Y===E[0]?E:[Y,...E.slice(1)]}function c(E,...Y){if(Ae.has(E))return;fe(E);const ne=R(Y);ce(E,"warn",ne),console.warn("[lattice]",...ne)}function Z(E,...Y){if(Ae.has(E))return;fe(E);const ne=R(Y);ce(E,"info",ne),console.info("[lattice]",...ne)}function X(){Ae.clear(),ae.length=0}function M(E,Y){const ne=new Error(`[lattice] ${E}`);throw Y!==void 0&&(ne.cause=Y),ne}function g(E,Y){E||M(Y)}const h=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function f(E){return E!==null&&typeof E=="object"&&!Array.isArray(E)}function v(E){return typeof E=="function"}function J(E){return E==null}function p(E){return E==null||E===""}function z(E){return typeof E!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(E))?!0:!!(E.prototype&&Object.getOwnPropertyNames(E.prototype).length>1)}const d=new Map;function S(E){let Y=d.get(E);if(Y)return Y;if(!E.includes("."))Y=ne=>ne?.[E];else{const ne=E.split("."),a=ne.length;Y=s=>{let n=s;for(let N=0;N<a;N++){if(n==null)return;n=n[ne[N]]}return n}}return d.set(E,Y),Y}const _=new Map;function w(E){let Y=_.get(E);if(Y)return Y;if(!E.includes("."))Y=(ne,a)=>{ne!=null&&(ne[E]=a)};else{const ne=E.split("."),a=ne.length-1;Y=(s,n)=>{let N=s;for(let o=0;o<a;o++){if(N==null)return;const k=ne[o];N[k]==null&&(N[k]={}),N=N[k]}N!=null&&(N[ne[a]]=n)}}return _.set(E,Y),Y}function m(E,Y){return S(Y)(E)}function G(E,Y,ne){w(Y)(E,ne)}function P(E){return E?(E.includes(".")?E.slice(E.lastIndexOf(".")+1):E).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(/^./,ne=>ne.toUpperCase()):""}const B={"&":"&","<":"<",">":">",'"':""","'":"'"};function ie(E){const Y=E==null?"":String(E);return/[&<>"']/.test(Y)?Y.replace(/[&<>"']/g,ne=>B[ne]):Y}function se(E){return String(E).replace(/\w\S*/g,Y=>Y[0].toUpperCase()+Y.slice(1).toLowerCase())}function W(E,Y,ne){if(E!==void 0)return E===!0?{enabled:!0,...ne}:E===!1?{enabled:!1}:f(E)?E:{[Y]:E,enabled:!0}}function L(E){return E==null?[]:Array.isArray(E)?E:[E]}const T=Object.freeze(new Set(["__proto__","constructor","prototype"]));function i(E,Y){if(!f(E))return f(Y)?{...Y}:Y;if(!f(Y))return Y===void 0?E:Y;const ne={...E};for(const a of Object.keys(Y)){if(T.has(a))continue;const s=Y[a];s!==void 0&&(ne[a]=f(s)&&f(ne[a])?i(ne[a],s):s)}return ne}function t(E,Y){if(!f(E)||!f(Y)||E===Y)return Y;const ne=Object.create(Object.getPrototypeOf(E));return Object.assign(ne,E,Y),ne}class e{#r;#n=new Map;#i;constructor(Y=256,ne=null){this.#r=Y,this.#i=ne}get size(){return this.#n.size}get max(){return this.#r}set max(Y){this.#r=Y,this.#e()}has(Y){return this.#n.has(Y)}get(Y){const ne=this.#n;if(!ne.has(Y))return;const a=ne.get(Y);return ne.delete(Y),ne.set(Y,a),a}peek(Y){return this.#n.get(Y)}set(Y,ne){const a=this.#n;return a.has(Y)&&a.delete(Y),a.set(Y,ne),this.#e(),ne}delete(Y){const ne=this.#n.get(Y);return this.#n.delete(Y)&&this.#i&&this.#i(ne,Y),ne}clear(){if(this.#i)for(const[Y,ne]of this.#n)this.#i(ne,Y);this.#n.clear()}keys(){return this.#n.keys()}values(){return this.#n.values()}#e(){const Y=this.#n;for(;Y.size>this.#r;){const ne=Y.keys().next().value,a=Y.get(ne);Y.delete(ne),this.#i&&this.#i(a,ne)}}}const u=new Map;function $(E,Y){const ne=`${E||""}|${Y?JSON.stringify(Y):""}`;let a=u.get(ne);return a||(a=new Intl.Collator(E||void 0,{numeric:!0,sensitivity:"variant",...Y}),u.set(ne,a)),a}function O(E,Y){if(E===Y)return 0;if(E==null)return 1;if(Y==null)return-1;if(typeof E=="number"&&typeof Y=="number")return Number.isNaN(E)?Number.isNaN(Y)?0:1:Number.isNaN(Y)||E<Y?-1:E>Y?1:0;const ne=String(E),a=String(Y);return ne<a?-1:ne>a?1:0}function C(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const V=typeof requestAnimationFrame=="function";function I(E){return V?requestAnimationFrame(E):setTimeout(()=>E(C()),16)}function b(E){E!=null&&(V?cancelAnimationFrame(E):clearTimeout(E))}function H(E){let Y=null,ne=null;const a=()=>{Y=null;const n=ne;ne=null,E(...n||[])},s=(...n)=>{ne=n,Y===null&&(Y=I(a))};return s.cancel=()=>{b(Y),Y=null,ne=null},s.flush=()=>{Y!==null&&(b(Y),a())},s}function oe(E,Y){let ne=null,a=null;const s=()=>{if(ne=null,a===null)return;const o=a;a=null,E(...o),n()},n=()=>{ne=setTimeout(s,Y),typeof ne?.unref=="function"&&ne.unref()},N=(...o)=>{ne===null?(E(...o),n()):(a=o,clearTimeout(ne),n())};return N.flush=()=>{if(ne!==null&&clearTimeout(ne),ne=null,a===null)return;const o=a;a=null,E(...o)},N.cancel=()=>{ne!==null&&clearTimeout(ne),ne=null,a=null},N.pending=()=>ne!==null||a!==null,N}function re(E,Y=50){return typeof requestIdleCallback=="function"?requestIdleCallback(E,{timeout:Y}):setTimeout(()=>E({timeRemaining:()=>0,didTimeout:!0}),1)}let pe=0;function te(E="l"){return`${E}${(++pe).toString(36)}`}}),at("packages/modules/charts/fills.js",function(r,le){"use strict";Object.defineProperty(r,"PATTERNS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"GRADIENTS",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"isFill",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(r,"isPaintRef",{enumerable:!0,get:function(){return F}}),Object.defineProperty(r,"paintFallback",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"normaliseFill",{enumerable:!0,get:function(){return c}}),Object.defineProperty(r,"swatchCss",{enumerable:!0,get:function(){return X}}),Object.defineProperty(r,"createFillRegistry",{enumerable:!0,get:function(){return M}}),Object.defineProperty(r,"rowPaint",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"patternSeries",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"paintSolid",{enumerable:!0,get:function(){return f}}),Object.defineProperty(r,"rowFillSource",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"nodePaint",{enumerable:!0,get:function(){return J}});const ue=le("packages/core/src/internal/util.js").warnOnce,j=Object.freeze(["hatch","crosshatch","dots","grid"]),Ae=Object.freeze(["linear","radial"]),Se=8,fe="#0072b2";let ae=0;const ee=new Map;function ce(p){return!!p&&typeof p=="object"&&!Array.isArray(p)&&(typeof p.gradient=="string"||typeof p.pattern=="string")}function F(p){return typeof p=="string"&&p.startsWith("url(#")}function x(p){if(typeof p!="string")return p==null?"":String(p);if(!p.startsWith("url("))return p;const z=p.indexOf(")");return(z<0?"":p.slice(z+1).trim())||fe}function R(p,z){ue(`chart:fill:invalid:${p}`,`a chart fill object was ignored: ${z} The mark was drawn in a solid colour instead. A fill is a gradient object (gradient: "linear" or "radial", with stops of [offset, colour]) or a pattern object (pattern: "hatch", "crosshatch", "dots" or "grid", with a colour).`)}function c(p,z){if(!ce(p))return null;const d=z||fe;if(typeof p.gradient=="string"){if(!Ae.includes(p.gradient))return R("gradient",`the gradient "${p.gradient}" is not one of ${Ae.join(", ")}.`),null;const m=Array.isArray(p.stops)?p.stops:[],G=[];for(const B of m){const ie=Array.isArray(B)?Number(B[0]):Number(B&&B.offset),se=Array.isArray(B)?B[1]:B&&B.colour;!Number.isFinite(ie)||typeof se!="string"||!se||G.push({offset:Math.min(1,Math.max(0,ie)),colour:se})}if(G.length<2)return R("stops","a gradient needs at least two [offset, colour] stops."),null;G.sort((B,ie)=>B.offset-ie.offset);const P=Number.isFinite(Number(p.angle))?Number(p.angle):180;return{kind:p.gradient,angle:P,stops:G,solid:G[0].colour}}if(!j.includes(p.pattern))return R("pattern",`the pattern "${p.pattern}" is not one of ${j.join(", ")}.`),null;const S=Number(p.size),_=Number(p.angle),w=typeof p.colour=="string"&&p.colour?p.colour:d;return{kind:"pattern",pattern:p.pattern,colour:w,background:typeof p.background=="string"&&p.background?p.background:null,size:Number.isFinite(S)&&S>=2?S:Se,angle:Number.isFinite(_)?_:p.pattern==="grid"||p.pattern==="dots"?0:45,solid:w}}function Z(p){if(p.kind==="pattern"){const d=p.colour,S=p.size,_=Math.max(1,S/5),w=p.background||"transparent",m=G=>`repeating-linear-gradient(${G+90}deg,${d} 0 ${_}px,transparent ${_}px ${S}px)`;return p.pattern==="hatch"?`${m(p.angle)},${w}`:p.pattern==="crosshatch"?`${m(p.angle)},${m(p.angle+90)},${w}`:p.pattern==="grid"?`${m(p.angle)},${m(p.angle+90)},${w}`:`radial-gradient(circle at 50% 50%,${d} ${S/6}px,transparent ${S/6+.5}px) 0 0/${S}px ${S}px,${w}`}const z=p.stops.map(d=>`${d.colour} ${Math.round(d.offset*100)}%`).join(",");return p.kind==="radial"?`radial-gradient(circle,${z})`:`linear-gradient(${p.angle}deg,${z})`}function X(p){if(!F(p))return typeof p=="string"?p:"";const z=String(p).indexOf(")"),d=String(p).slice(5,z),S=ee.get(d);return S?Z(S):x(p)}function M(p){const z=`lattice-fill-${++ae}`;let d=new Map,S=0;const _=(m,G)=>{const P=p.ownerDocument.createElementNS("http://www.w3.org/2000/svg",m);for(const B of Object.keys(G))P.setAttribute(B,String(G[B]));return P},w=(m,G)=>{if(G.kind==="pattern"){const B=G.size,ie=Math.max(1,B/5),se=_("pattern",{id:m,width:B,height:B,patternUnits:"userSpaceOnUse"});G.angle&&se.setAttribute("patternTransform",`rotate(${G.angle})`),G.background&&se.appendChild(_("rect",{width:B,height:B,fill:G.background}));const W={stroke:G.colour,"stroke-width":ie};G.pattern==="dots"?se.appendChild(_("circle",{cx:B/2,cy:B/2,r:Math.max(1,B/6),fill:G.colour})):(se.appendChild(_("line",{x1:B/2,y1:0,x2:B/2,y2:B,...W})),G.pattern!=="hatch"&&se.appendChild(_("line",{x1:0,y1:B/2,x2:B,y2:B/2,...W}))),p.appendChild(se);return}let P;if(G.kind==="radial")P=_("radialGradient",{id:m,cx:.5,cy:.5,r:.5});else{const B=G.angle*Math.PI/180,ie=Math.sin(B)/2,se=-Math.cos(B)/2;P=_("linearGradient",{id:m,x1:+(.5-ie).toFixed(4),y1:+(.5-se).toFixed(4),x2:+(.5+ie).toFixed(4),y2:+(.5+se).toFixed(4)})}for(const B of G.stops)P.appendChild(_("stop",{offset:B.offset,"stop-color":B.colour}));p.appendChild(P)};return{prefix:z,paint(m,G){const P=c(m,G);if(!P)return G||fe;if(!p||!p.ownerDocument)return P.solid;const B=JSON.stringify(P);let ie=d.get(B);if(!ie){const se=`${z}-${S++}`;w(se,P),ee.set(se,P),ie=`url(#${se}) ${P.solid}`,d.set(B,ie)}return ie},reset(){for(const m of d.values())ee.delete(m.slice(5,m.indexOf(")")));if(d=new Map,S=0,p)for(;p.firstChild;)p.removeChild(p.firstChild)},ids(){return[...d.values()].map(m=>m.slice(5,m.indexOf(")")))}}}function g(p,z,d){if(p==null||p==="")return null;const S=x(d);if(ce(p))return z?z.paint(p,S):(c(p,S)||{}).solid||null;if(typeof p=="string"){if(j.includes(p)){const _={pattern:p,colour:S};return z?z.paint(_,S):S}return p}return null}function h(p){const z=[{pattern:"hatch",angle:45},{pattern:"dots"},{pattern:"crosshatch",angle:45},{pattern:"hatch",angle:135},{pattern:"grid"},{pattern:"dots",size:5},{pattern:"hatch",angle:0},{pattern:"crosshatch",angle:0,size:6}];return p.map((d,S)=>({...z[S%z.length],colour:d,background:"var(--lattice-background, #fff)"}))}function f(p){return F(p)?String(p).replace(/^url\([^)]*\)\s*/,""):p}function v(p,z){const d=p.fill;if(ce(d))return(_,w)=>g(d,z.fills,f(w));if(typeof d=="function")return(_,w)=>{let m=null;try{m=d({label:_.label,x:_.x,y:_.y,rowKey:_.rowKey})}catch{m=null}return g(m,z.fills,f(w))};const S=typeof d=="string"?d:d&&typeof d=="object"&&typeof d.col=="string"?d.col:null;return S?(_,w)=>_.rowKey===void 0||_.rowKey===null?null:g(p.grid.rows.value(_.rowKey,S),z.fills,f(w)):null}function J(p,z,d){return p&&p({label:z.label,x:z.value,y:z.total,rowKey:z.rowKey},d)||d}}),at("packages/modules/charts/scheme.js",function(r,le){"use strict";Object.defineProperty(r,"PALETTE",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"SCHEMES",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"registerScheme",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"setDefaultScheme",{enumerable:!0,get:function(){return R}}),Object.defineProperty(r,"schemeNames",{enumerable:!0,get:function(){return c}}),Object.defineProperty(r,"resolveScheme",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"RAMP_SCALES",{enumerable:!0,get:function(){return f}}),Object.defineProperty(r,"toRgb",{enumerable:!0,get:function(){return p}}),Object.defineProperty(r,"rampStops",{enumerable:!0,get:function(){return z}});const ue=le("packages/core/src/internal/util.js").warnOnce,j=le("packages/modules/charts/fills.js"),Ae=j.isFill,Se=j.patternSeries,fe=j.rowPaint,ae=Object.freeze(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#7a5195","#6b7d8c"]),ee=Object.freeze({default:{series:ae,sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"},bright:{series:["#1f77d0","#ff7f0e","#2ca02c","#d62728","#9467bd","#17becf","#e377c2","#7f7f7f"],sequential:["#eef4fb","#1f77d0"],diverging:["#d62728","#f7f7f7","#1f77d0"],positive:"#2ca02c",negative:"#d62728"},earth:{series:["#5b7c6f","#c08b52","#7a6a53","#a4553f","#4e6a83","#8f8259","#6d5566","#8c9196"],sequential:["#f2efe9","#4e6a83"],diverging:["#a4553f","#f2efe9","#4e6a83"],positive:"#5b7c6f",negative:"#a4553f"},mono:{series:["#0b2a3d","#17475f","#2c6480","#4a82a0","#6da0bd","#94bcd6","#bcd7e9","#dfecf5"],sequential:["#eef3f7","#0b2a3d"],diverging:["#7a5c00","#f5f5f5","#0b2a3d"],positive:"#17475f",negative:"#7a5c00"},patterns:{series:Se(ae),sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"}}),ce=new Map;let F="default";function x(d,S){!d||!S||ce.set(String(d),S)}function R(d){if(typeof d=="string"){F=d;return}d&&typeof d=="object"&&(ce.set("__default__",d),F="__default__")}function c(){return[...Object.keys(ee),...ce.keys()].filter(d=>!d.startsWith("__"))}function Z(d){return ce.has(d)?ce.get(d):ee[d]||null}const X=["series","sequential","diverging","positive","negative"];function M(d){return!d||typeof d!="object"||Array.isArray(d)?!1:!X.some(S=>S in d)}function g(d,S){const _=S&&S.fills||null,w=Z(F)||ee.default,m=d&&d.scheme,G=M(m)?m:null,P=Array.isArray(m)&&m.length?m:null,B=typeof m=="string"?Z(m):G||Array.isArray(m)?null:m||null,ie=(d&&Array.isArray(d.palette)&&d.palette.length?d.palette:null)||P;G&&ie&&ue("chart:scheme:array-and-map",'chart "scheme" was given as a name map together with a "palette" array; the two do not combine. Colours came from the map and the array was ignored. Pass one or the other.');const se=G?null:ie,W={...ee.default,...w,...B||{}};se&&(W.series=se);const L=d&&d.ramp&&typeof d.ramp=="object"&&!Array.isArray(d.ramp)?d.ramp:null,T=L?L.colours:d&&d.ramp,i=Array.isArray(T)&&T.length>=2?T:null;i&&(W.sequential=i);const t=L?v(L.scale):null,e=!!(B||se||G),u=W.series&&W.series.length?W.series:ae,$=new Map;let O=0;return{...W,series:(V,I)=>{if(G&&I!==void 0&&I!==null){const b=String(I);return Object.prototype.hasOwnProperty.call(G,b)?h(G[b],_,V):($.has(b)||$.set(b,O++),h(J(u,$.get(b),!0),_,$.get(b)))}return h(J(u,V,e),_,V)},explicit:e,nameMap:!!G,rampScale:t,fills:_}}function h(d,S,_){if(!Ae(d))return d;const w=ae[(_%ae.length+ae.length)%ae.length];return fe(d,S,w)||w}const f=Object.freeze(["linear","log","quantile"]);function v(d){return d==null?null:f.includes(d)?d:(ue(`chart:ramp:scale:${String(d)}`,`chart "ramp.scale" was "${String(d)}", which is not a ramp scale; the chart chose one from its values instead. Use "linear", "log" or "quantile".`),null)}function J(d,S,_){const w=(S%d.length+d.length)%d.length;return _||typeof d[w]!="string"?d[w]:`var(--lattice-chart-${w+1}, ${d[w]})`}function p(d){if(typeof d!="string")return null;const S=d.trim(),_=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(S);if(_){const G=_[1];return G.length===3?[0,1,2].map(P=>parseInt(G[P]+G[P],16)):[0,2,4].map(P=>parseInt(G.slice(P,P+2),16))}const w=/^rgba?\(([^)]+)\)$/i.exec(S);if(!w)return null;const m=w[1].split(/[\s,/]+/).filter(Boolean).slice(0,3).map(Number);return m.length===3&&m.every(G=>Number.isFinite(G))?m:null}function z(d,S){const _=S?d.diverging:d.sequential,w=S?ee.default.diverging:ee.default.sequential,m=(Array.isArray(_)?_:w).map((G,P)=>p(G)||p(w[P])||[0,0,0]);return m.length>=2?m:w.map(G=>p(G))}}),at("packages/modules/charts/styles.js",function(r,le){"use strict";Object.defineProperty(r,"NS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"seriesColour",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"css",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(r,"injectStyles",{enumerable:!0,get:function(){return ae}});const ue=le("packages/modules/charts/scheme.js").PALETTE,j="lat-chartview",Ae="data-lattice-chartview";function Se(ee){const ce=(ee%ue.length+ue.length)%ue.length;return`var(--lattice-chart-${ce+1}, ${ue[ce]})`}function fe(){return`
|
|
7
7
|
.${j}{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;
|
|
8
8
|
width:100%;height:100%;box-sizing:border-box;
|
|
9
9
|
font-family:var(--lattice-font-family,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif);
|
package/modules/charts.min.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.89.
|
|
2
|
+
* Lattice Grid 1.89.1, charts module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
(function(Ir){"use strict";var Dr=Object.create(null),Br=Object.create(null);function at(r,le){Dr[r]=le}function Gr(r){var le=Br[r];if(le)return le;var Oe=Object.create(null);Br[r]=Oe;var ue=Dr[r];if(!ue)throw new Error("[lattice] missing module: "+r);return ue(Oe,Gr),Oe}at("packages/modules/charts/svg.js",function(r,le){"use strict";Object.defineProperty(r,"SVG_NS",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(r,"el",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"svg",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"attr",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"attrs",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(r,"setText",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"clear",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"append",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(r,"path",{enumerable:!0,get:function(){return F}}),Object.defineProperty(r,"ribbonPath",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"round",{enumerable:!0,get:function(){return R}}),Object.defineProperty(r,"pathRings",{enumerable:!0,get:function(){return c}}),Object.defineProperty(r,"insideRings",{enumerable:!0,get:function(){return Z}});const Oe="http://www.w3.org/2000/svg";function ue(X){const M=X.indexOf(")");return M<0?X:X.slice(M+1).trim()||"#0072b2"}function j(X,M,g){const h=X.createElement(M);return g&&h.setAttribute("class",g),h}function Ae(X,M,g){const h=X.createElementNS(Oe,M);if(g)for(const f of Object.keys(g))h.setAttribute(f,String(g[f]));return h}function Se(X,M,g){if(!X)return;if(g==null){X.removeAttribute(M);return}let h=String(g);h.startsWith("url(#")&&(M==="stroke"||M==="fill"&&X.localName==="text")&&(h=ue(h)),X.setAttribute(M,h)}function fe(X,M){if(X)for(const g of Object.keys(M))Se(X,g,M[g])}function ae(X,M){X&&(X.textContent=M==null?"":String(M))}function ee(X){if(X)for(;X.firstChild;)X.removeChild(X.firstChild)}function ce(X,M){for(const g of M)g&&X.appendChild(g);return X}function F(X){return X.join(" ")}function x(X){if(!X||X.length<2)return"";const M=["M",X[0].x,X[0].upper];for(let g=1;g<X.length;g++)M.push("L",X[g].x,X[g].upper);for(let g=X.length-1;g>=0;g--)M.push("L",X[g].x,X[g].lower);return M.push("Z"),F(M)}function R(X){return Math.round(X*100)/100}function c(X){const M=[];let g=[];const h=String(X||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let f="",v=[];const J=()=>{if(!f||!v.length){v=[];return}if(f==="M"||f==="L")for(let p=0;p+1<v.length;p+=2)g.push([v[p],v[p+1]]);else f!=="Z"&&v.length>=2&&g.push([v[v.length-2],v[v.length-1]]);v=[]};for(const p of h){if(/[A-Za-z]/.test(p)){if(J(),p==="Z"||p==="z"){g.length>2&&M.push(g),g=[],f="";continue}p==="M"&&g.length>2&&(M.push(g),g=[]),f=p;continue}v.push(Number(p))}return J(),g.length>2&&M.push(g),M}function Z(X,M,g){let h=!1;for(const f of X)for(let v=0,J=f.length-1;v<f.length;J=v++){const[p,z]=f[v],[d,S]=f[J];z>g!=S>g&&M<(d-p)*(g-z)/(S-z||1e-12)+p&&(h=!h)}return h}}),at("packages/modules/charts/typography.js",function(r,le){"use strict";Object.defineProperty(r,"BASE_SIZE",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(r,"BASE_FAMILY",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(r,"CHAR_RATIO",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"resolveType",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"textWidth",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(r,"widestLabel",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"truncateTo",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"applySize",{enumerable:!0,get:function(){return ce}});const Oe=12,ue="var(--lattice-font-family, system-ui, -apple-system, sans-serif)",j=.62;function Ae(F){const x=F&&F.font,R=typeof x=="number"?{size:x}:x||{},c=Se(R.size,Oe);return{family:R.family||ue,size:c,small:Se(R.small??R.tickSize,Math.max(9,c-1)),title:Se(R.title,Math.round(c*1.15)),axisTitle:Se(R.axisTitle,Math.max(10,c-1)),weight:R.weight||"inherit"}}function Se(F,x){const R=Number(F);return Number.isFinite(R)&&R>0?R:x}function fe(F,x){return String(F??"").length*x*j}function ae(F,x){let R=0;for(const c of F||[]){const Z=fe(c,x);Z>R&&(R=Z)}return R}function ee(F,x,R){const c=String(F??""),Z=Math.floor(x/(R*j));return Z<=0?"":c.length<=Z?c:Z===1?"…":`${c.slice(0,Z-1)}…`}function ce(F,x){!F||!Number.isFinite(x)||(F.style?F.style.fontSize=`${x}px`:F.setAttribute("style",`font-size:${x}px`))}}),at("packages/modules/charts/frame.js",function(r,le){"use strict";Object.defineProperty(r,"LABEL_GAP",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"LABEL_GUTTER_SHARE",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"resolveMargin",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(r,"plotRect",{enumerable:!0,get:function(){return F}}),Object.defineProperty(r,"shouldRotate",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"Pool",{enumerable:!0,get:function(){return R}});const ue=le("packages/modules/charts/svg.js").SVG_NS,j=le("packages/modules/charts/typography.js"),Ae=j.textWidth,Se=j.widestLabel,fe=8,ae=6,ee=.4;function ce(c,Z){const X=typeof c=="number"?c:Z,M=c&&typeof c=="object"?c:{},g=h=>Number.isFinite(h)&&h>=0?Number(h):X;return{base:X,top:g(M.top),right:g(M.right),bottom:g(M.bottom),left:g(M.left)}}function F(c){const Z=ce(c.margin,typeof c.padding=="number"?c.padding:8),X=Z.base,M=c.fontSize||12,g=c.yLabels||[],h=c.xLabels||[],f=c.ySide==="right"?"right":"left",v=f==="right"?"left":"right",J=c.titles||{},p=c.titleSize||M,z=W=>W?p+ae:0,d=Se(g,M),S=g.length?Math.min(c.width*ee,Z[f]+d+ae):Math.max(fe,Z[f]),_=Z[v]+(c.rightGutter||0),w=(f==="left"?S:_)+z(J.left),m=Se(h.map(W=>String(W).slice(0,14)),M),G=(h.length?c.rotated?Math.min(c.height*ee,ae+m):M+ae+Z.bottom:Math.max(fe,Z.bottom))+z(J.bottom),P=(f==="right"?S:_)+z(J.right),B=Z.top+(c.topGutter||0),ie=Math.max(0,c.width-w-P),se=Math.max(0,c.height-B-G);return{left:w,top:B,width:ie,height:se,right:w+ie,bottom:B+se,gutter:{left:w,bottom:G,right:P,top:B}}}function x(c,Z,X,M){if(!c.length||Z<=0)return!1;const g=Number.isFinite(M)&&M>0?Number(M):1;return Se(c,X)>Z*g-4}class R{#r;#n=0;static#i="data-pool-key";constructor(Z,X=0){this.#r=Z,this.#n=X>0?X:0}next(Z,X,M){if(M!=null)return this.#e(Z,X,String(M));const g=this.#r.childNodes[this.#n],h=g&&g.tagName,f=/(^|\s)\S*__axis-title(\s|$)/,v=h&&f.test(String(g.getAttribute("class")||"")),J=!!X&&f.test(String(X));if(h&&(!v||J)&&String(h).toLowerCase()===Z.toLowerCase())return X&&g.setAttribute("class",X),this.#n++,g;const p=this.#r.ownerDocument.createElementNS(ue,Z);return X&&p.setAttribute("class",X),g?this.#r.insertBefore(p,g):this.#r.appendChild(p),this.#n++,p}#e(Z,X,M){const g=Z.toLowerCase();for(let v=this.#n;v<this.#r.childNodes.length;v++){const J=this.#r.childNodes[v],p=J&&J.tagName;if(p&&String(p).toLowerCase()===g&&J.getAttribute(R.#i)===M)return v!==this.#n&&this.#r.insertBefore(J,this.#r.childNodes[this.#n]),X&&J.setAttribute("class",X),this.#n++,J}const h=this.#r.ownerDocument.createElementNS(ue,Z);h.setAttribute(R.#i,M),X&&h.setAttribute("class",X);const f=this.#r.childNodes[this.#n];return f?this.#r.insertBefore(h,f):this.#r.appendChild(h),this.#n++,h}finish(){for(;this.#r.childNodes.length>this.#n;)this.#r.removeChild(this.#r.lastChild);this.#n=0}}}),at("packages/core/src/internal/util.js",function(r,le){"use strict";Object.defineProperty(r,"VERSION",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"reportedWarnings",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return c}}),Object.defineProperty(r,"infoOnce",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(r,"resetWarnings",{enumerable:!0,get:function(){return X}}),Object.defineProperty(r,"fail",{enumerable:!0,get:function(){return M}}),Object.defineProperty(r,"invariant",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"DEV",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"isObject",{enumerable:!0,get:function(){return f}}),Object.defineProperty(r,"isFunction",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"isNil",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"isBlank",{enumerable:!0,get:function(){return p}}),Object.defineProperty(r,"isCtor",{enumerable:!0,get:function(){return z}}),Object.defineProperty(r,"pathGetter",{enumerable:!0,get:function(){return S}}),Object.defineProperty(r,"pathSetter",{enumerable:!0,get:function(){return w}}),Object.defineProperty(r,"getPath",{enumerable:!0,get:function(){return m}}),Object.defineProperty(r,"setPath",{enumerable:!0,get:function(){return G}}),Object.defineProperty(r,"humanise",{enumerable:!0,get:function(){return P}}),Object.defineProperty(r,"escapeHtml",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(r,"titleCase",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"expand",{enumerable:!0,get:function(){return W}}),Object.defineProperty(r,"toArray",{enumerable:!0,get:function(){return L}}),Object.defineProperty(r,"merge",{enumerable:!0,get:function(){return i}}),Object.defineProperty(r,"mergeRow",{enumerable:!0,get:function(){return t}}),Object.defineProperty(r,"Lru",{enumerable:!0,get:function(){return e}}),Object.defineProperty(r,"collator",{enumerable:!0,get:function(){return $}}),Object.defineProperty(r,"defaultCompare",{enumerable:!0,get:function(){return O}}),Object.defineProperty(r,"now",{enumerable:!0,get:function(){return C}}),Object.defineProperty(r,"nextFrame",{enumerable:!0,get:function(){return I}}),Object.defineProperty(r,"cancelFrame",{enumerable:!0,get:function(){return b}}),Object.defineProperty(r,"frameBatched",{enumerable:!0,get:function(){return H}}),Object.defineProperty(r,"settleDebounce",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(r,"whenIdle",{enumerable:!0,get:function(){return re}}),Object.defineProperty(r,"uid",{enumerable:!0,get:function(){return te}});const Oe="1.89.0";async function ue(){return Oe}const j="1.89.0",Ae=new Set,Se=2e3;function fe(E){if(Ae.add(E),Ae.size>Se){const Y=Ae.values().next().value;Y!==void 0&&Ae.delete(Y)}}const ae=[],ee=500;function ce(E,Y,ne){ae.push({key:E,level:Y,message:ne.map(a=>typeof a=="string"?a:F(a)).join(" "),at:Date.now()}),ae.length>ee&&ae.shift()}function F(E){if(E instanceof Error)return E.message;try{return JSON.stringify(E)}catch{return String(E)}}function x(){return ae.map(E=>({...E}))}function R(E){if(E.length===0||typeof E[0]!="string")return E;const Y=E[0].replace(/^\[lattice\]\s*/,"");return Y===E[0]?E:[Y,...E.slice(1)]}function c(E,...Y){if(Ae.has(E))return;fe(E);const ne=R(Y);ce(E,"warn",ne),console.warn("[lattice]",...ne)}function Z(E,...Y){if(Ae.has(E))return;fe(E);const ne=R(Y);ce(E,"info",ne),console.info("[lattice]",...ne)}function X(){Ae.clear(),ae.length=0}function M(E,Y){const ne=new Error(`[lattice] ${E}`);throw Y!==void 0&&(ne.cause=Y),ne}function g(E,Y){E||M(Y)}const h=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function f(E){return E!==null&&typeof E=="object"&&!Array.isArray(E)}function v(E){return typeof E=="function"}function J(E){return E==null}function p(E){return E==null||E===""}function z(E){return typeof E!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(E))?!0:!!(E.prototype&&Object.getOwnPropertyNames(E.prototype).length>1)}const d=new Map;function S(E){let Y=d.get(E);if(Y)return Y;if(!E.includes("."))Y=ne=>ne?.[E];else{const ne=E.split("."),a=ne.length;Y=s=>{let n=s;for(let N=0;N<a;N++){if(n==null)return;n=n[ne[N]]}return n}}return d.set(E,Y),Y}const _=new Map;function w(E){let Y=_.get(E);if(Y)return Y;if(!E.includes("."))Y=(ne,a)=>{ne!=null&&(ne[E]=a)};else{const ne=E.split("."),a=ne.length-1;Y=(s,n)=>{let N=s;for(let o=0;o<a;o++){if(N==null)return;const k=ne[o];N[k]==null&&(N[k]={}),N=N[k]}N!=null&&(N[ne[a]]=n)}}return _.set(E,Y),Y}function m(E,Y){return S(Y)(E)}function G(E,Y,ne){w(Y)(E,ne)}function P(E){return E?(E.includes(".")?E.slice(E.lastIndexOf(".")+1):E).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(/^./,ne=>ne.toUpperCase()):""}const B={"&":"&","<":"<",">":">",'"':""","'":"'"};function ie(E){const Y=E==null?"":String(E);return/[&<>"']/.test(Y)?Y.replace(/[&<>"']/g,ne=>B[ne]):Y}function se(E){return String(E).replace(/\w\S*/g,Y=>Y[0].toUpperCase()+Y.slice(1).toLowerCase())}function W(E,Y,ne){if(E!==void 0)return E===!0?{enabled:!0,...ne}:E===!1?{enabled:!1}:f(E)?E:{[Y]:E,enabled:!0}}function L(E){return E==null?[]:Array.isArray(E)?E:[E]}const T=Object.freeze(new Set(["__proto__","constructor","prototype"]));function i(E,Y){if(!f(E))return f(Y)?{...Y}:Y;if(!f(Y))return Y===void 0?E:Y;const ne={...E};for(const a of Object.keys(Y)){if(T.has(a))continue;const s=Y[a];s!==void 0&&(ne[a]=f(s)&&f(ne[a])?i(ne[a],s):s)}return ne}function t(E,Y){if(!f(E)||!f(Y)||E===Y)return Y;const ne=Object.create(Object.getPrototypeOf(E));return Object.assign(ne,E,Y),ne}class e{#r;#n=new Map;#i;constructor(Y=256,ne=null){this.#r=Y,this.#i=ne}get size(){return this.#n.size}get max(){return this.#r}set max(Y){this.#r=Y,this.#e()}has(Y){return this.#n.has(Y)}get(Y){const ne=this.#n;if(!ne.has(Y))return;const a=ne.get(Y);return ne.delete(Y),ne.set(Y,a),a}peek(Y){return this.#n.get(Y)}set(Y,ne){const a=this.#n;return a.has(Y)&&a.delete(Y),a.set(Y,ne),this.#e(),ne}delete(Y){const ne=this.#n.get(Y);return this.#n.delete(Y)&&this.#i&&this.#i(ne,Y),ne}clear(){if(this.#i)for(const[Y,ne]of this.#n)this.#i(ne,Y);this.#n.clear()}keys(){return this.#n.keys()}values(){return this.#n.values()}#e(){const Y=this.#n;for(;Y.size>this.#r;){const ne=Y.keys().next().value,a=Y.get(ne);Y.delete(ne),this.#i&&this.#i(a,ne)}}}const u=new Map;function $(E,Y){const ne=`${E||""}|${Y?JSON.stringify(Y):""}`;let a=u.get(ne);return a||(a=new Intl.Collator(E||void 0,{numeric:!0,sensitivity:"variant",...Y}),u.set(ne,a)),a}function O(E,Y){if(E===Y)return 0;if(E==null)return 1;if(Y==null)return-1;if(typeof E=="number"&&typeof Y=="number")return Number.isNaN(E)?Number.isNaN(Y)?0:1:Number.isNaN(Y)||E<Y?-1:E>Y?1:0;const ne=String(E),a=String(Y);return ne<a?-1:ne>a?1:0}function C(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const V=typeof requestAnimationFrame=="function";function I(E){return V?requestAnimationFrame(E):setTimeout(()=>E(C()),16)}function b(E){E!=null&&(V?cancelAnimationFrame(E):clearTimeout(E))}function H(E){let Y=null,ne=null;const a=()=>{Y=null;const n=ne;ne=null,E(...n||[])},s=(...n)=>{ne=n,Y===null&&(Y=I(a))};return s.cancel=()=>{b(Y),Y=null,ne=null},s.flush=()=>{Y!==null&&(b(Y),a())},s}function oe(E,Y){let ne=null,a=null;const s=()=>{if(ne=null,a===null)return;const o=a;a=null,E(...o),n()},n=()=>{ne=setTimeout(s,Y),typeof ne?.unref=="function"&&ne.unref()},N=(...o)=>{ne===null?(E(...o),n()):(a=o,clearTimeout(ne),n())};return N.flush=()=>{if(ne!==null&&clearTimeout(ne),ne=null,a===null)return;const o=a;a=null,E(...o)},N.cancel=()=>{ne!==null&&clearTimeout(ne),ne=null,a=null},N.pending=()=>ne!==null||a!==null,N}function re(E,Y=50){return typeof requestIdleCallback=="function"?requestIdleCallback(E,{timeout:Y}):setTimeout(()=>E({timeRemaining:()=>0,didTimeout:!0}),1)}let pe=0;function te(E="l"){return`${E}${(++pe).toString(36)}`}}),at("packages/modules/charts/fills.js",function(r,le){"use strict";Object.defineProperty(r,"PATTERNS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"GRADIENTS",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"isFill",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(r,"isPaintRef",{enumerable:!0,get:function(){return F}}),Object.defineProperty(r,"paintFallback",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"normaliseFill",{enumerable:!0,get:function(){return c}}),Object.defineProperty(r,"swatchCss",{enumerable:!0,get:function(){return X}}),Object.defineProperty(r,"createFillRegistry",{enumerable:!0,get:function(){return M}}),Object.defineProperty(r,"rowPaint",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"patternSeries",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"paintSolid",{enumerable:!0,get:function(){return f}}),Object.defineProperty(r,"rowFillSource",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"nodePaint",{enumerable:!0,get:function(){return J}});const ue=le("packages/core/src/internal/util.js").warnOnce,j=Object.freeze(["hatch","crosshatch","dots","grid"]),Ae=Object.freeze(["linear","radial"]),Se=8,fe="#0072b2";let ae=0;const ee=new Map;function ce(p){return!!p&&typeof p=="object"&&!Array.isArray(p)&&(typeof p.gradient=="string"||typeof p.pattern=="string")}function F(p){return typeof p=="string"&&p.startsWith("url(#")}function x(p){if(typeof p!="string")return p==null?"":String(p);if(!p.startsWith("url("))return p;const z=p.indexOf(")");return(z<0?"":p.slice(z+1).trim())||fe}function R(p,z){ue(`chart:fill:invalid:${p}`,`a chart fill object was ignored: ${z} The mark was drawn in a solid colour instead. A fill is a gradient object (gradient: "linear" or "radial", with stops of [offset, colour]) or a pattern object (pattern: "hatch", "crosshatch", "dots" or "grid", with a colour).`)}function c(p,z){if(!ce(p))return null;const d=z||fe;if(typeof p.gradient=="string"){if(!Ae.includes(p.gradient))return R("gradient",`the gradient "${p.gradient}" is not one of ${Ae.join(", ")}.`),null;const m=Array.isArray(p.stops)?p.stops:[],G=[];for(const B of m){const ie=Array.isArray(B)?Number(B[0]):Number(B&&B.offset),se=Array.isArray(B)?B[1]:B&&B.colour;!Number.isFinite(ie)||typeof se!="string"||!se||G.push({offset:Math.min(1,Math.max(0,ie)),colour:se})}if(G.length<2)return R("stops","a gradient needs at least two [offset, colour] stops."),null;G.sort((B,ie)=>B.offset-ie.offset);const P=Number.isFinite(Number(p.angle))?Number(p.angle):180;return{kind:p.gradient,angle:P,stops:G,solid:G[0].colour}}if(!j.includes(p.pattern))return R("pattern",`the pattern "${p.pattern}" is not one of ${j.join(", ")}.`),null;const S=Number(p.size),_=Number(p.angle),w=typeof p.colour=="string"&&p.colour?p.colour:d;return{kind:"pattern",pattern:p.pattern,colour:w,background:typeof p.background=="string"&&p.background?p.background:null,size:Number.isFinite(S)&&S>=2?S:Se,angle:Number.isFinite(_)?_:p.pattern==="grid"||p.pattern==="dots"?0:45,solid:w}}function Z(p){if(p.kind==="pattern"){const d=p.colour,S=p.size,_=Math.max(1,S/5),w=p.background||"transparent",m=G=>`repeating-linear-gradient(${G+90}deg,${d} 0 ${_}px,transparent ${_}px ${S}px)`;return p.pattern==="hatch"?`${m(p.angle)},${w}`:p.pattern==="crosshatch"?`${m(p.angle)},${m(p.angle+90)},${w}`:p.pattern==="grid"?`${m(p.angle)},${m(p.angle+90)},${w}`:`radial-gradient(circle at 50% 50%,${d} ${S/6}px,transparent ${S/6+.5}px) 0 0/${S}px ${S}px,${w}`}const z=p.stops.map(d=>`${d.colour} ${Math.round(d.offset*100)}%`).join(",");return p.kind==="radial"?`radial-gradient(circle,${z})`:`linear-gradient(${p.angle}deg,${z})`}function X(p){if(!F(p))return typeof p=="string"?p:"";const z=String(p).indexOf(")"),d=String(p).slice(5,z),S=ee.get(d);return S?Z(S):x(p)}function M(p){const z=`lattice-fill-${++ae}`;let d=new Map,S=0;const _=(m,G)=>{const P=p.ownerDocument.createElementNS("http://www.w3.org/2000/svg",m);for(const B of Object.keys(G))P.setAttribute(B,String(G[B]));return P},w=(m,G)=>{if(G.kind==="pattern"){const B=G.size,ie=Math.max(1,B/5),se=_("pattern",{id:m,width:B,height:B,patternUnits:"userSpaceOnUse"});G.angle&&se.setAttribute("patternTransform",`rotate(${G.angle})`),G.background&&se.appendChild(_("rect",{width:B,height:B,fill:G.background}));const W={stroke:G.colour,"stroke-width":ie};G.pattern==="dots"?se.appendChild(_("circle",{cx:B/2,cy:B/2,r:Math.max(1,B/6),fill:G.colour})):(se.appendChild(_("line",{x1:B/2,y1:0,x2:B/2,y2:B,...W})),G.pattern!=="hatch"&&se.appendChild(_("line",{x1:0,y1:B/2,x2:B,y2:B/2,...W}))),p.appendChild(se);return}let P;if(G.kind==="radial")P=_("radialGradient",{id:m,cx:.5,cy:.5,r:.5});else{const B=G.angle*Math.PI/180,ie=Math.sin(B)/2,se=-Math.cos(B)/2;P=_("linearGradient",{id:m,x1:+(.5-ie).toFixed(4),y1:+(.5-se).toFixed(4),x2:+(.5+ie).toFixed(4),y2:+(.5+se).toFixed(4)})}for(const B of G.stops)P.appendChild(_("stop",{offset:B.offset,"stop-color":B.colour}));p.appendChild(P)};return{prefix:z,paint(m,G){const P=c(m,G);if(!P)return G||fe;if(!p||!p.ownerDocument)return P.solid;const B=JSON.stringify(P);let ie=d.get(B);if(!ie){const se=`${z}-${S++}`;w(se,P),ee.set(se,P),ie=`url(#${se}) ${P.solid}`,d.set(B,ie)}return ie},reset(){for(const m of d.values())ee.delete(m.slice(5,m.indexOf(")")));if(d=new Map,S=0,p)for(;p.firstChild;)p.removeChild(p.firstChild)},ids(){return[...d.values()].map(m=>m.slice(5,m.indexOf(")")))}}}function g(p,z,d){if(p==null||p==="")return null;const S=x(d);if(ce(p))return z?z.paint(p,S):(c(p,S)||{}).solid||null;if(typeof p=="string"){if(j.includes(p)){const _={pattern:p,colour:S};return z?z.paint(_,S):S}return p}return null}function h(p){const z=[{pattern:"hatch",angle:45},{pattern:"dots"},{pattern:"crosshatch",angle:45},{pattern:"hatch",angle:135},{pattern:"grid"},{pattern:"dots",size:5},{pattern:"hatch",angle:0},{pattern:"crosshatch",angle:0,size:6}];return p.map((d,S)=>({...z[S%z.length],colour:d,background:"var(--lattice-background, #fff)"}))}function f(p){return F(p)?String(p).replace(/^url\([^)]*\)\s*/,""):p}function v(p,z){const d=p.fill;if(ce(d))return(_,w)=>g(d,z.fills,f(w));if(typeof d=="function")return(_,w)=>{let m=null;try{m=d({label:_.label,x:_.x,y:_.y,rowKey:_.rowKey})}catch{m=null}return g(m,z.fills,f(w))};const S=typeof d=="string"?d:d&&typeof d=="object"&&typeof d.col=="string"?d.col:null;return S?(_,w)=>_.rowKey===void 0||_.rowKey===null?null:g(p.grid.rows.value(_.rowKey,S),z.fills,f(w)):null}function J(p,z,d){return p&&p({label:z.label,x:z.value,y:z.total,rowKey:z.rowKey},d)||d}}),at("packages/modules/charts/scheme.js",function(r,le){"use strict";Object.defineProperty(r,"PALETTE",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"SCHEMES",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"registerScheme",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"setDefaultScheme",{enumerable:!0,get:function(){return R}}),Object.defineProperty(r,"schemeNames",{enumerable:!0,get:function(){return c}}),Object.defineProperty(r,"resolveScheme",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"RAMP_SCALES",{enumerable:!0,get:function(){return f}}),Object.defineProperty(r,"toRgb",{enumerable:!0,get:function(){return p}}),Object.defineProperty(r,"rampStops",{enumerable:!0,get:function(){return z}});const ue=le("packages/core/src/internal/util.js").warnOnce,j=le("packages/modules/charts/fills.js"),Ae=j.isFill,Se=j.patternSeries,fe=j.rowPaint,ae=Object.freeze(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#7a5195","#6b7d8c"]),ee=Object.freeze({default:{series:ae,sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"},bright:{series:["#1f77d0","#ff7f0e","#2ca02c","#d62728","#9467bd","#17becf","#e377c2","#7f7f7f"],sequential:["#eef4fb","#1f77d0"],diverging:["#d62728","#f7f7f7","#1f77d0"],positive:"#2ca02c",negative:"#d62728"},earth:{series:["#5b7c6f","#c08b52","#7a6a53","#a4553f","#4e6a83","#8f8259","#6d5566","#8c9196"],sequential:["#f2efe9","#4e6a83"],diverging:["#a4553f","#f2efe9","#4e6a83"],positive:"#5b7c6f",negative:"#a4553f"},mono:{series:["#0b2a3d","#17475f","#2c6480","#4a82a0","#6da0bd","#94bcd6","#bcd7e9","#dfecf5"],sequential:["#eef3f7","#0b2a3d"],diverging:["#7a5c00","#f5f5f5","#0b2a3d"],positive:"#17475f",negative:"#7a5c00"},patterns:{series:Se(ae),sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"}}),ce=new Map;let F="default";function x(d,S){!d||!S||ce.set(String(d),S)}function R(d){if(typeof d=="string"){F=d;return}d&&typeof d=="object"&&(ce.set("__default__",d),F="__default__")}function c(){return[...Object.keys(ee),...ce.keys()].filter(d=>!d.startsWith("__"))}function Z(d){return ce.has(d)?ce.get(d):ee[d]||null}const X=["series","sequential","diverging","positive","negative"];function M(d){return!d||typeof d!="object"||Array.isArray(d)?!1:!X.some(S=>S in d)}function g(d,S){const _=S&&S.fills||null,w=Z(F)||ee.default,m=d&&d.scheme,G=M(m)?m:null,P=Array.isArray(m)&&m.length?m:null,B=typeof m=="string"?Z(m):G||Array.isArray(m)?null:m||null,ie=(d&&Array.isArray(d.palette)&&d.palette.length?d.palette:null)||P;G&&ie&&ue("chart:scheme:array-and-map",'chart "scheme" was given as a name map together with a "palette" array; the two do not combine. Colours came from the map and the array was ignored. Pass one or the other.');const se=G?null:ie,W={...ee.default,...w,...B||{}};se&&(W.series=se);const L=d&&d.ramp&&typeof d.ramp=="object"&&!Array.isArray(d.ramp)?d.ramp:null,T=L?L.colours:d&&d.ramp,i=Array.isArray(T)&&T.length>=2?T:null;i&&(W.sequential=i);const t=L?v(L.scale):null,e=!!(B||se||G),u=W.series&&W.series.length?W.series:ae,$=new Map;let O=0;return{...W,series:(V,I)=>{if(G&&I!==void 0&&I!==null){const b=String(I);return Object.prototype.hasOwnProperty.call(G,b)?h(G[b],_,V):($.has(b)||$.set(b,O++),h(J(u,$.get(b),!0),_,$.get(b)))}return h(J(u,V,e),_,V)},explicit:e,nameMap:!!G,rampScale:t,fills:_}}function h(d,S,_){if(!Ae(d))return d;const w=ae[(_%ae.length+ae.length)%ae.length];return fe(d,S,w)||w}const f=Object.freeze(["linear","log","quantile"]);function v(d){return d==null?null:f.includes(d)?d:(ue(`chart:ramp:scale:${String(d)}`,`chart "ramp.scale" was "${String(d)}", which is not a ramp scale; the chart chose one from its values instead. Use "linear", "log" or "quantile".`),null)}function J(d,S,_){const w=(S%d.length+d.length)%d.length;return _||typeof d[w]!="string"?d[w]:`var(--lattice-chart-${w+1}, ${d[w]})`}function p(d){if(typeof d!="string")return null;const S=d.trim(),_=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(S);if(_){const G=_[1];return G.length===3?[0,1,2].map(P=>parseInt(G[P]+G[P],16)):[0,2,4].map(P=>parseInt(G.slice(P,P+2),16))}const w=/^rgba?\(([^)]+)\)$/i.exec(S);if(!w)return null;const m=w[1].split(/[\s,/]+/).filter(Boolean).slice(0,3).map(Number);return m.length===3&&m.every(G=>Number.isFinite(G))?m:null}function z(d,S){const _=S?d.diverging:d.sequential,w=S?ee.default.diverging:ee.default.sequential,m=(Array.isArray(_)?_:w).map((G,P)=>p(G)||p(w[P])||[0,0,0]);return m.length>=2?m:w.map(G=>p(G))}}),at("packages/modules/charts/styles.js",function(r,le){"use strict";Object.defineProperty(r,"NS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"seriesColour",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"css",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(r,"injectStyles",{enumerable:!0,get:function(){return ae}});const ue=le("packages/modules/charts/scheme.js").PALETTE,j="lat-chartview",Ae="data-lattice-chartview";function Se(ee){const ce=(ee%ue.length+ue.length)%ue.length;return`var(--lattice-chart-${ce+1}, ${ue[ce]})`}function fe(){return`
|
|
6
|
+
(function(Ir){"use strict";var Dr=Object.create(null),Br=Object.create(null);function at(r,le){Dr[r]=le}function Gr(r){var le=Br[r];if(le)return le;var Oe=Object.create(null);Br[r]=Oe;var ue=Dr[r];if(!ue)throw new Error("[lattice] missing module: "+r);return ue(Oe,Gr),Oe}at("packages/modules/charts/svg.js",function(r,le){"use strict";Object.defineProperty(r,"SVG_NS",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(r,"el",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"svg",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"attr",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"attrs",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(r,"setText",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"clear",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"append",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(r,"path",{enumerable:!0,get:function(){return F}}),Object.defineProperty(r,"ribbonPath",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"round",{enumerable:!0,get:function(){return R}}),Object.defineProperty(r,"pathRings",{enumerable:!0,get:function(){return c}}),Object.defineProperty(r,"insideRings",{enumerable:!0,get:function(){return Z}});const Oe="http://www.w3.org/2000/svg";function ue(X){const M=X.indexOf(")");return M<0?X:X.slice(M+1).trim()||"#0072b2"}function j(X,M,g){const h=X.createElement(M);return g&&h.setAttribute("class",g),h}function Ae(X,M,g){const h=X.createElementNS(Oe,M);if(g)for(const f of Object.keys(g))h.setAttribute(f,String(g[f]));return h}function Se(X,M,g){if(!X)return;if(g==null){X.removeAttribute(M);return}let h=String(g);h.startsWith("url(#")&&(M==="stroke"||M==="fill"&&X.localName==="text")&&(h=ue(h)),X.setAttribute(M,h)}function fe(X,M){if(X)for(const g of Object.keys(M))Se(X,g,M[g])}function ae(X,M){X&&(X.textContent=M==null?"":String(M))}function ee(X){if(X)for(;X.firstChild;)X.removeChild(X.firstChild)}function ce(X,M){for(const g of M)g&&X.appendChild(g);return X}function F(X){return X.join(" ")}function x(X){if(!X||X.length<2)return"";const M=["M",X[0].x,X[0].upper];for(let g=1;g<X.length;g++)M.push("L",X[g].x,X[g].upper);for(let g=X.length-1;g>=0;g--)M.push("L",X[g].x,X[g].lower);return M.push("Z"),F(M)}function R(X){return Math.round(X*100)/100}function c(X){const M=[];let g=[];const h=String(X||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let f="",v=[];const J=()=>{if(!f||!v.length){v=[];return}if(f==="M"||f==="L")for(let p=0;p+1<v.length;p+=2)g.push([v[p],v[p+1]]);else f!=="Z"&&v.length>=2&&g.push([v[v.length-2],v[v.length-1]]);v=[]};for(const p of h){if(/[A-Za-z]/.test(p)){if(J(),p==="Z"||p==="z"){g.length>2&&M.push(g),g=[],f="";continue}p==="M"&&g.length>2&&(M.push(g),g=[]),f=p;continue}v.push(Number(p))}return J(),g.length>2&&M.push(g),M}function Z(X,M,g){let h=!1;for(const f of X)for(let v=0,J=f.length-1;v<f.length;J=v++){const[p,z]=f[v],[d,S]=f[J];z>g!=S>g&&M<(d-p)*(g-z)/(S-z||1e-12)+p&&(h=!h)}return h}}),at("packages/modules/charts/typography.js",function(r,le){"use strict";Object.defineProperty(r,"BASE_SIZE",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(r,"BASE_FAMILY",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(r,"CHAR_RATIO",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"resolveType",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"textWidth",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(r,"widestLabel",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"truncateTo",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"applySize",{enumerable:!0,get:function(){return ce}});const Oe=12,ue="var(--lattice-font-family, system-ui, -apple-system, sans-serif)",j=.62;function Ae(F){const x=F&&F.font,R=typeof x=="number"?{size:x}:x||{},c=Se(R.size,Oe);return{family:R.family||ue,size:c,small:Se(R.small??R.tickSize,Math.max(9,c-1)),title:Se(R.title,Math.round(c*1.15)),axisTitle:Se(R.axisTitle,Math.max(10,c-1)),weight:R.weight||"inherit"}}function Se(F,x){const R=Number(F);return Number.isFinite(R)&&R>0?R:x}function fe(F,x){return String(F??"").length*x*j}function ae(F,x){let R=0;for(const c of F||[]){const Z=fe(c,x);Z>R&&(R=Z)}return R}function ee(F,x,R){const c=String(F??""),Z=Math.floor(x/(R*j));return Z<=0?"":c.length<=Z?c:Z===1?"…":`${c.slice(0,Z-1)}…`}function ce(F,x){!F||!Number.isFinite(x)||(F.style?F.style.fontSize=`${x}px`:F.setAttribute("style",`font-size:${x}px`))}}),at("packages/modules/charts/frame.js",function(r,le){"use strict";Object.defineProperty(r,"LABEL_GAP",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"LABEL_GUTTER_SHARE",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"resolveMargin",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(r,"plotRect",{enumerable:!0,get:function(){return F}}),Object.defineProperty(r,"shouldRotate",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"Pool",{enumerable:!0,get:function(){return R}});const ue=le("packages/modules/charts/svg.js").SVG_NS,j=le("packages/modules/charts/typography.js"),Ae=j.textWidth,Se=j.widestLabel,fe=8,ae=6,ee=.4;function ce(c,Z){const X=typeof c=="number"?c:Z,M=c&&typeof c=="object"?c:{},g=h=>Number.isFinite(h)&&h>=0?Number(h):X;return{base:X,top:g(M.top),right:g(M.right),bottom:g(M.bottom),left:g(M.left)}}function F(c){const Z=ce(c.margin,typeof c.padding=="number"?c.padding:8),X=Z.base,M=c.fontSize||12,g=c.yLabels||[],h=c.xLabels||[],f=c.ySide==="right"?"right":"left",v=f==="right"?"left":"right",J=c.titles||{},p=c.titleSize||M,z=W=>W?p+ae:0,d=Se(g,M),S=g.length?Math.min(c.width*ee,Z[f]+d+ae):Math.max(fe,Z[f]),_=Z[v]+(c.rightGutter||0),w=(f==="left"?S:_)+z(J.left),m=Se(h.map(W=>String(W).slice(0,14)),M),G=(h.length?c.rotated?Math.min(c.height*ee,ae+m):M+ae+Z.bottom:Math.max(fe,Z.bottom))+z(J.bottom),P=(f==="right"?S:_)+z(J.right),B=Z.top+(c.topGutter||0),ie=Math.max(0,c.width-w-P),se=Math.max(0,c.height-B-G);return{left:w,top:B,width:ie,height:se,right:w+ie,bottom:B+se,gutter:{left:w,bottom:G,right:P,top:B}}}function x(c,Z,X,M){if(!c.length||Z<=0)return!1;const g=Number.isFinite(M)&&M>0?Number(M):1;return Se(c,X)>Z*g-4}class R{#r;#n=0;static#i="data-pool-key";constructor(Z,X=0){this.#r=Z,this.#n=X>0?X:0}next(Z,X,M){if(M!=null)return this.#e(Z,X,String(M));const g=this.#r.childNodes[this.#n],h=g&&g.tagName,f=/(^|\s)\S*__axis-title(\s|$)/,v=h&&f.test(String(g.getAttribute("class")||"")),J=!!X&&f.test(String(X));if(h&&(!v||J)&&String(h).toLowerCase()===Z.toLowerCase())return X&&g.setAttribute("class",X),this.#n++,g;const p=this.#r.ownerDocument.createElementNS(ue,Z);return X&&p.setAttribute("class",X),g?this.#r.insertBefore(p,g):this.#r.appendChild(p),this.#n++,p}#e(Z,X,M){const g=Z.toLowerCase();for(let v=this.#n;v<this.#r.childNodes.length;v++){const J=this.#r.childNodes[v],p=J&&J.tagName;if(p&&String(p).toLowerCase()===g&&J.getAttribute(R.#i)===M)return v!==this.#n&&this.#r.insertBefore(J,this.#r.childNodes[this.#n]),X&&J.setAttribute("class",X),this.#n++,J}const h=this.#r.ownerDocument.createElementNS(ue,Z);h.setAttribute(R.#i,M),X&&h.setAttribute("class",X);const f=this.#r.childNodes[this.#n];return f?this.#r.insertBefore(h,f):this.#r.appendChild(h),this.#n++,h}finish(){for(;this.#r.childNodes.length>this.#n;)this.#r.removeChild(this.#r.lastChild);this.#n=0}}}),at("packages/core/src/internal/util.js",function(r,le){"use strict";Object.defineProperty(r,"VERSION",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"reportedWarnings",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return c}}),Object.defineProperty(r,"infoOnce",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(r,"resetWarnings",{enumerable:!0,get:function(){return X}}),Object.defineProperty(r,"fail",{enumerable:!0,get:function(){return M}}),Object.defineProperty(r,"invariant",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"DEV",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"isObject",{enumerable:!0,get:function(){return f}}),Object.defineProperty(r,"isFunction",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"isNil",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"isBlank",{enumerable:!0,get:function(){return p}}),Object.defineProperty(r,"isCtor",{enumerable:!0,get:function(){return z}}),Object.defineProperty(r,"pathGetter",{enumerable:!0,get:function(){return S}}),Object.defineProperty(r,"pathSetter",{enumerable:!0,get:function(){return w}}),Object.defineProperty(r,"getPath",{enumerable:!0,get:function(){return m}}),Object.defineProperty(r,"setPath",{enumerable:!0,get:function(){return G}}),Object.defineProperty(r,"humanise",{enumerable:!0,get:function(){return P}}),Object.defineProperty(r,"escapeHtml",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(r,"titleCase",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"expand",{enumerable:!0,get:function(){return W}}),Object.defineProperty(r,"toArray",{enumerable:!0,get:function(){return L}}),Object.defineProperty(r,"merge",{enumerable:!0,get:function(){return i}}),Object.defineProperty(r,"mergeRow",{enumerable:!0,get:function(){return t}}),Object.defineProperty(r,"Lru",{enumerable:!0,get:function(){return e}}),Object.defineProperty(r,"collator",{enumerable:!0,get:function(){return $}}),Object.defineProperty(r,"defaultCompare",{enumerable:!0,get:function(){return O}}),Object.defineProperty(r,"now",{enumerable:!0,get:function(){return C}}),Object.defineProperty(r,"nextFrame",{enumerable:!0,get:function(){return I}}),Object.defineProperty(r,"cancelFrame",{enumerable:!0,get:function(){return b}}),Object.defineProperty(r,"frameBatched",{enumerable:!0,get:function(){return H}}),Object.defineProperty(r,"settleDebounce",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(r,"whenIdle",{enumerable:!0,get:function(){return re}}),Object.defineProperty(r,"uid",{enumerable:!0,get:function(){return te}});const Oe="1.89.1";async function ue(){return Oe}const j="1.89.1",Ae=new Set,Se=2e3;function fe(E){if(Ae.add(E),Ae.size>Se){const Y=Ae.values().next().value;Y!==void 0&&Ae.delete(Y)}}const ae=[],ee=500;function ce(E,Y,ne){ae.push({key:E,level:Y,message:ne.map(a=>typeof a=="string"?a:F(a)).join(" "),at:Date.now()}),ae.length>ee&&ae.shift()}function F(E){if(E instanceof Error)return E.message;try{return JSON.stringify(E)}catch{return String(E)}}function x(){return ae.map(E=>({...E}))}function R(E){if(E.length===0||typeof E[0]!="string")return E;const Y=E[0].replace(/^\[lattice\]\s*/,"");return Y===E[0]?E:[Y,...E.slice(1)]}function c(E,...Y){if(Ae.has(E))return;fe(E);const ne=R(Y);ce(E,"warn",ne),console.warn("[lattice]",...ne)}function Z(E,...Y){if(Ae.has(E))return;fe(E);const ne=R(Y);ce(E,"info",ne),console.info("[lattice]",...ne)}function X(){Ae.clear(),ae.length=0}function M(E,Y){const ne=new Error(`[lattice] ${E}`);throw Y!==void 0&&(ne.cause=Y),ne}function g(E,Y){E||M(Y)}const h=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function f(E){return E!==null&&typeof E=="object"&&!Array.isArray(E)}function v(E){return typeof E=="function"}function J(E){return E==null}function p(E){return E==null||E===""}function z(E){return typeof E!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(E))?!0:!!(E.prototype&&Object.getOwnPropertyNames(E.prototype).length>1)}const d=new Map;function S(E){let Y=d.get(E);if(Y)return Y;if(!E.includes("."))Y=ne=>ne?.[E];else{const ne=E.split("."),a=ne.length;Y=s=>{let n=s;for(let N=0;N<a;N++){if(n==null)return;n=n[ne[N]]}return n}}return d.set(E,Y),Y}const _=new Map;function w(E){let Y=_.get(E);if(Y)return Y;if(!E.includes("."))Y=(ne,a)=>{ne!=null&&(ne[E]=a)};else{const ne=E.split("."),a=ne.length-1;Y=(s,n)=>{let N=s;for(let o=0;o<a;o++){if(N==null)return;const k=ne[o];N[k]==null&&(N[k]={}),N=N[k]}N!=null&&(N[ne[a]]=n)}}return _.set(E,Y),Y}function m(E,Y){return S(Y)(E)}function G(E,Y,ne){w(Y)(E,ne)}function P(E){return E?(E.includes(".")?E.slice(E.lastIndexOf(".")+1):E).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(/^./,ne=>ne.toUpperCase()):""}const B={"&":"&","<":"<",">":">",'"':""","'":"'"};function ie(E){const Y=E==null?"":String(E);return/[&<>"']/.test(Y)?Y.replace(/[&<>"']/g,ne=>B[ne]):Y}function se(E){return String(E).replace(/\w\S*/g,Y=>Y[0].toUpperCase()+Y.slice(1).toLowerCase())}function W(E,Y,ne){if(E!==void 0)return E===!0?{enabled:!0,...ne}:E===!1?{enabled:!1}:f(E)?E:{[Y]:E,enabled:!0}}function L(E){return E==null?[]:Array.isArray(E)?E:[E]}const T=Object.freeze(new Set(["__proto__","constructor","prototype"]));function i(E,Y){if(!f(E))return f(Y)?{...Y}:Y;if(!f(Y))return Y===void 0?E:Y;const ne={...E};for(const a of Object.keys(Y)){if(T.has(a))continue;const s=Y[a];s!==void 0&&(ne[a]=f(s)&&f(ne[a])?i(ne[a],s):s)}return ne}function t(E,Y){if(!f(E)||!f(Y)||E===Y)return Y;const ne=Object.create(Object.getPrototypeOf(E));return Object.assign(ne,E,Y),ne}class e{#r;#n=new Map;#i;constructor(Y=256,ne=null){this.#r=Y,this.#i=ne}get size(){return this.#n.size}get max(){return this.#r}set max(Y){this.#r=Y,this.#e()}has(Y){return this.#n.has(Y)}get(Y){const ne=this.#n;if(!ne.has(Y))return;const a=ne.get(Y);return ne.delete(Y),ne.set(Y,a),a}peek(Y){return this.#n.get(Y)}set(Y,ne){const a=this.#n;return a.has(Y)&&a.delete(Y),a.set(Y,ne),this.#e(),ne}delete(Y){const ne=this.#n.get(Y);return this.#n.delete(Y)&&this.#i&&this.#i(ne,Y),ne}clear(){if(this.#i)for(const[Y,ne]of this.#n)this.#i(ne,Y);this.#n.clear()}keys(){return this.#n.keys()}values(){return this.#n.values()}#e(){const Y=this.#n;for(;Y.size>this.#r;){const ne=Y.keys().next().value,a=Y.get(ne);Y.delete(ne),this.#i&&this.#i(a,ne)}}}const u=new Map;function $(E,Y){const ne=`${E||""}|${Y?JSON.stringify(Y):""}`;let a=u.get(ne);return a||(a=new Intl.Collator(E||void 0,{numeric:!0,sensitivity:"variant",...Y}),u.set(ne,a)),a}function O(E,Y){if(E===Y)return 0;if(E==null)return 1;if(Y==null)return-1;if(typeof E=="number"&&typeof Y=="number")return Number.isNaN(E)?Number.isNaN(Y)?0:1:Number.isNaN(Y)||E<Y?-1:E>Y?1:0;const ne=String(E),a=String(Y);return ne<a?-1:ne>a?1:0}function C(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const V=typeof requestAnimationFrame=="function";function I(E){return V?requestAnimationFrame(E):setTimeout(()=>E(C()),16)}function b(E){E!=null&&(V?cancelAnimationFrame(E):clearTimeout(E))}function H(E){let Y=null,ne=null;const a=()=>{Y=null;const n=ne;ne=null,E(...n||[])},s=(...n)=>{ne=n,Y===null&&(Y=I(a))};return s.cancel=()=>{b(Y),Y=null,ne=null},s.flush=()=>{Y!==null&&(b(Y),a())},s}function oe(E,Y){let ne=null,a=null;const s=()=>{if(ne=null,a===null)return;const o=a;a=null,E(...o),n()},n=()=>{ne=setTimeout(s,Y),typeof ne?.unref=="function"&&ne.unref()},N=(...o)=>{ne===null?(E(...o),n()):(a=o,clearTimeout(ne),n())};return N.flush=()=>{if(ne!==null&&clearTimeout(ne),ne=null,a===null)return;const o=a;a=null,E(...o)},N.cancel=()=>{ne!==null&&clearTimeout(ne),ne=null,a=null},N.pending=()=>ne!==null||a!==null,N}function re(E,Y=50){return typeof requestIdleCallback=="function"?requestIdleCallback(E,{timeout:Y}):setTimeout(()=>E({timeRemaining:()=>0,didTimeout:!0}),1)}let pe=0;function te(E="l"){return`${E}${(++pe).toString(36)}`}}),at("packages/modules/charts/fills.js",function(r,le){"use strict";Object.defineProperty(r,"PATTERNS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"GRADIENTS",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"isFill",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(r,"isPaintRef",{enumerable:!0,get:function(){return F}}),Object.defineProperty(r,"paintFallback",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"normaliseFill",{enumerable:!0,get:function(){return c}}),Object.defineProperty(r,"swatchCss",{enumerable:!0,get:function(){return X}}),Object.defineProperty(r,"createFillRegistry",{enumerable:!0,get:function(){return M}}),Object.defineProperty(r,"rowPaint",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"patternSeries",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"paintSolid",{enumerable:!0,get:function(){return f}}),Object.defineProperty(r,"rowFillSource",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"nodePaint",{enumerable:!0,get:function(){return J}});const ue=le("packages/core/src/internal/util.js").warnOnce,j=Object.freeze(["hatch","crosshatch","dots","grid"]),Ae=Object.freeze(["linear","radial"]),Se=8,fe="#0072b2";let ae=0;const ee=new Map;function ce(p){return!!p&&typeof p=="object"&&!Array.isArray(p)&&(typeof p.gradient=="string"||typeof p.pattern=="string")}function F(p){return typeof p=="string"&&p.startsWith("url(#")}function x(p){if(typeof p!="string")return p==null?"":String(p);if(!p.startsWith("url("))return p;const z=p.indexOf(")");return(z<0?"":p.slice(z+1).trim())||fe}function R(p,z){ue(`chart:fill:invalid:${p}`,`a chart fill object was ignored: ${z} The mark was drawn in a solid colour instead. A fill is a gradient object (gradient: "linear" or "radial", with stops of [offset, colour]) or a pattern object (pattern: "hatch", "crosshatch", "dots" or "grid", with a colour).`)}function c(p,z){if(!ce(p))return null;const d=z||fe;if(typeof p.gradient=="string"){if(!Ae.includes(p.gradient))return R("gradient",`the gradient "${p.gradient}" is not one of ${Ae.join(", ")}.`),null;const m=Array.isArray(p.stops)?p.stops:[],G=[];for(const B of m){const ie=Array.isArray(B)?Number(B[0]):Number(B&&B.offset),se=Array.isArray(B)?B[1]:B&&B.colour;!Number.isFinite(ie)||typeof se!="string"||!se||G.push({offset:Math.min(1,Math.max(0,ie)),colour:se})}if(G.length<2)return R("stops","a gradient needs at least two [offset, colour] stops."),null;G.sort((B,ie)=>B.offset-ie.offset);const P=Number.isFinite(Number(p.angle))?Number(p.angle):180;return{kind:p.gradient,angle:P,stops:G,solid:G[0].colour}}if(!j.includes(p.pattern))return R("pattern",`the pattern "${p.pattern}" is not one of ${j.join(", ")}.`),null;const S=Number(p.size),_=Number(p.angle),w=typeof p.colour=="string"&&p.colour?p.colour:d;return{kind:"pattern",pattern:p.pattern,colour:w,background:typeof p.background=="string"&&p.background?p.background:null,size:Number.isFinite(S)&&S>=2?S:Se,angle:Number.isFinite(_)?_:p.pattern==="grid"||p.pattern==="dots"?0:45,solid:w}}function Z(p){if(p.kind==="pattern"){const d=p.colour,S=p.size,_=Math.max(1,S/5),w=p.background||"transparent",m=G=>`repeating-linear-gradient(${G+90}deg,${d} 0 ${_}px,transparent ${_}px ${S}px)`;return p.pattern==="hatch"?`${m(p.angle)},${w}`:p.pattern==="crosshatch"?`${m(p.angle)},${m(p.angle+90)},${w}`:p.pattern==="grid"?`${m(p.angle)},${m(p.angle+90)},${w}`:`radial-gradient(circle at 50% 50%,${d} ${S/6}px,transparent ${S/6+.5}px) 0 0/${S}px ${S}px,${w}`}const z=p.stops.map(d=>`${d.colour} ${Math.round(d.offset*100)}%`).join(",");return p.kind==="radial"?`radial-gradient(circle,${z})`:`linear-gradient(${p.angle}deg,${z})`}function X(p){if(!F(p))return typeof p=="string"?p:"";const z=String(p).indexOf(")"),d=String(p).slice(5,z),S=ee.get(d);return S?Z(S):x(p)}function M(p){const z=`lattice-fill-${++ae}`;let d=new Map,S=0;const _=(m,G)=>{const P=p.ownerDocument.createElementNS("http://www.w3.org/2000/svg",m);for(const B of Object.keys(G))P.setAttribute(B,String(G[B]));return P},w=(m,G)=>{if(G.kind==="pattern"){const B=G.size,ie=Math.max(1,B/5),se=_("pattern",{id:m,width:B,height:B,patternUnits:"userSpaceOnUse"});G.angle&&se.setAttribute("patternTransform",`rotate(${G.angle})`),G.background&&se.appendChild(_("rect",{width:B,height:B,fill:G.background}));const W={stroke:G.colour,"stroke-width":ie};G.pattern==="dots"?se.appendChild(_("circle",{cx:B/2,cy:B/2,r:Math.max(1,B/6),fill:G.colour})):(se.appendChild(_("line",{x1:B/2,y1:0,x2:B/2,y2:B,...W})),G.pattern!=="hatch"&&se.appendChild(_("line",{x1:0,y1:B/2,x2:B,y2:B/2,...W}))),p.appendChild(se);return}let P;if(G.kind==="radial")P=_("radialGradient",{id:m,cx:.5,cy:.5,r:.5});else{const B=G.angle*Math.PI/180,ie=Math.sin(B)/2,se=-Math.cos(B)/2;P=_("linearGradient",{id:m,x1:+(.5-ie).toFixed(4),y1:+(.5-se).toFixed(4),x2:+(.5+ie).toFixed(4),y2:+(.5+se).toFixed(4)})}for(const B of G.stops)P.appendChild(_("stop",{offset:B.offset,"stop-color":B.colour}));p.appendChild(P)};return{prefix:z,paint(m,G){const P=c(m,G);if(!P)return G||fe;if(!p||!p.ownerDocument)return P.solid;const B=JSON.stringify(P);let ie=d.get(B);if(!ie){const se=`${z}-${S++}`;w(se,P),ee.set(se,P),ie=`url(#${se}) ${P.solid}`,d.set(B,ie)}return ie},reset(){for(const m of d.values())ee.delete(m.slice(5,m.indexOf(")")));if(d=new Map,S=0,p)for(;p.firstChild;)p.removeChild(p.firstChild)},ids(){return[...d.values()].map(m=>m.slice(5,m.indexOf(")")))}}}function g(p,z,d){if(p==null||p==="")return null;const S=x(d);if(ce(p))return z?z.paint(p,S):(c(p,S)||{}).solid||null;if(typeof p=="string"){if(j.includes(p)){const _={pattern:p,colour:S};return z?z.paint(_,S):S}return p}return null}function h(p){const z=[{pattern:"hatch",angle:45},{pattern:"dots"},{pattern:"crosshatch",angle:45},{pattern:"hatch",angle:135},{pattern:"grid"},{pattern:"dots",size:5},{pattern:"hatch",angle:0},{pattern:"crosshatch",angle:0,size:6}];return p.map((d,S)=>({...z[S%z.length],colour:d,background:"var(--lattice-background, #fff)"}))}function f(p){return F(p)?String(p).replace(/^url\([^)]*\)\s*/,""):p}function v(p,z){const d=p.fill;if(ce(d))return(_,w)=>g(d,z.fills,f(w));if(typeof d=="function")return(_,w)=>{let m=null;try{m=d({label:_.label,x:_.x,y:_.y,rowKey:_.rowKey})}catch{m=null}return g(m,z.fills,f(w))};const S=typeof d=="string"?d:d&&typeof d=="object"&&typeof d.col=="string"?d.col:null;return S?(_,w)=>_.rowKey===void 0||_.rowKey===null?null:g(p.grid.rows.value(_.rowKey,S),z.fills,f(w)):null}function J(p,z,d){return p&&p({label:z.label,x:z.value,y:z.total,rowKey:z.rowKey},d)||d}}),at("packages/modules/charts/scheme.js",function(r,le){"use strict";Object.defineProperty(r,"PALETTE",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"SCHEMES",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"registerScheme",{enumerable:!0,get:function(){return x}}),Object.defineProperty(r,"setDefaultScheme",{enumerable:!0,get:function(){return R}}),Object.defineProperty(r,"schemeNames",{enumerable:!0,get:function(){return c}}),Object.defineProperty(r,"resolveScheme",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"RAMP_SCALES",{enumerable:!0,get:function(){return f}}),Object.defineProperty(r,"toRgb",{enumerable:!0,get:function(){return p}}),Object.defineProperty(r,"rampStops",{enumerable:!0,get:function(){return z}});const ue=le("packages/core/src/internal/util.js").warnOnce,j=le("packages/modules/charts/fills.js"),Ae=j.isFill,Se=j.patternSeries,fe=j.rowPaint,ae=Object.freeze(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#7a5195","#6b7d8c"]),ee=Object.freeze({default:{series:ae,sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"},bright:{series:["#1f77d0","#ff7f0e","#2ca02c","#d62728","#9467bd","#17becf","#e377c2","#7f7f7f"],sequential:["#eef4fb","#1f77d0"],diverging:["#d62728","#f7f7f7","#1f77d0"],positive:"#2ca02c",negative:"#d62728"},earth:{series:["#5b7c6f","#c08b52","#7a6a53","#a4553f","#4e6a83","#8f8259","#6d5566","#8c9196"],sequential:["#f2efe9","#4e6a83"],diverging:["#a4553f","#f2efe9","#4e6a83"],positive:"#5b7c6f",negative:"#a4553f"},mono:{series:["#0b2a3d","#17475f","#2c6480","#4a82a0","#6da0bd","#94bcd6","#bcd7e9","#dfecf5"],sequential:["#eef3f7","#0b2a3d"],diverging:["#7a5c00","#f5f5f5","#0b2a3d"],positive:"#17475f",negative:"#7a5c00"},patterns:{series:Se(ae),sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"}}),ce=new Map;let F="default";function x(d,S){!d||!S||ce.set(String(d),S)}function R(d){if(typeof d=="string"){F=d;return}d&&typeof d=="object"&&(ce.set("__default__",d),F="__default__")}function c(){return[...Object.keys(ee),...ce.keys()].filter(d=>!d.startsWith("__"))}function Z(d){return ce.has(d)?ce.get(d):ee[d]||null}const X=["series","sequential","diverging","positive","negative"];function M(d){return!d||typeof d!="object"||Array.isArray(d)?!1:!X.some(S=>S in d)}function g(d,S){const _=S&&S.fills||null,w=Z(F)||ee.default,m=d&&d.scheme,G=M(m)?m:null,P=Array.isArray(m)&&m.length?m:null,B=typeof m=="string"?Z(m):G||Array.isArray(m)?null:m||null,ie=(d&&Array.isArray(d.palette)&&d.palette.length?d.palette:null)||P;G&&ie&&ue("chart:scheme:array-and-map",'chart "scheme" was given as a name map together with a "palette" array; the two do not combine. Colours came from the map and the array was ignored. Pass one or the other.');const se=G?null:ie,W={...ee.default,...w,...B||{}};se&&(W.series=se);const L=d&&d.ramp&&typeof d.ramp=="object"&&!Array.isArray(d.ramp)?d.ramp:null,T=L?L.colours:d&&d.ramp,i=Array.isArray(T)&&T.length>=2?T:null;i&&(W.sequential=i);const t=L?v(L.scale):null,e=!!(B||se||G),u=W.series&&W.series.length?W.series:ae,$=new Map;let O=0;return{...W,series:(V,I)=>{if(G&&I!==void 0&&I!==null){const b=String(I);return Object.prototype.hasOwnProperty.call(G,b)?h(G[b],_,V):($.has(b)||$.set(b,O++),h(J(u,$.get(b),!0),_,$.get(b)))}return h(J(u,V,e),_,V)},explicit:e,nameMap:!!G,rampScale:t,fills:_}}function h(d,S,_){if(!Ae(d))return d;const w=ae[(_%ae.length+ae.length)%ae.length];return fe(d,S,w)||w}const f=Object.freeze(["linear","log","quantile"]);function v(d){return d==null?null:f.includes(d)?d:(ue(`chart:ramp:scale:${String(d)}`,`chart "ramp.scale" was "${String(d)}", which is not a ramp scale; the chart chose one from its values instead. Use "linear", "log" or "quantile".`),null)}function J(d,S,_){const w=(S%d.length+d.length)%d.length;return _||typeof d[w]!="string"?d[w]:`var(--lattice-chart-${w+1}, ${d[w]})`}function p(d){if(typeof d!="string")return null;const S=d.trim(),_=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(S);if(_){const G=_[1];return G.length===3?[0,1,2].map(P=>parseInt(G[P]+G[P],16)):[0,2,4].map(P=>parseInt(G.slice(P,P+2),16))}const w=/^rgba?\(([^)]+)\)$/i.exec(S);if(!w)return null;const m=w[1].split(/[\s,/]+/).filter(Boolean).slice(0,3).map(Number);return m.length===3&&m.every(G=>Number.isFinite(G))?m:null}function z(d,S){const _=S?d.diverging:d.sequential,w=S?ee.default.diverging:ee.default.sequential,m=(Array.isArray(_)?_:w).map((G,P)=>p(G)||p(w[P])||[0,0,0]);return m.length>=2?m:w.map(G=>p(G))}}),at("packages/modules/charts/styles.js",function(r,le){"use strict";Object.defineProperty(r,"NS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"seriesColour",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"css",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(r,"injectStyles",{enumerable:!0,get:function(){return ae}});const ue=le("packages/modules/charts/scheme.js").PALETTE,j="lat-chartview",Ae="data-lattice-chartview";function Se(ee){const ce=(ee%ue.length+ue.length)%ue.length;return`var(--lattice-chart-${ce+1}, ${ue[ce]})`}function fe(){return`
|
|
7
7
|
.${j}{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;
|
|
8
8
|
width:100%;height:100%;box-sizing:border-box;
|
|
9
9
|
font-family:var(--lattice-font-family,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif);
|
package/modules/dashboard.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.89.
|
|
2
|
+
* Lattice Grid 1.89.1, dashboard module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
var Ie=Object.create(null),ze=Object.create(null);function ve(y,ee){Ie[y]=ee}function Ke(y){var ee=ze[y];if(ee)return ee;var V=Object.create(null);ze[y]=V;var I=Ie[y];if(!I)throw new Error("[lattice] missing module: "+y);return I(V,Ke),V}ve("packages/core/src/internal/util.js",function(y,ee){"use strict";Object.defineProperty(y,"VERSION",{enumerable:!0,get:function(){return A}}),Object.defineProperty(y,"reportedWarnings",{enumerable:!0,get:function(){return de}}),Object.defineProperty(y,"warnOnce",{enumerable:!0,get:function(){return D}}),Object.defineProperty(y,"infoOnce",{enumerable:!0,get:function(){return k}}),Object.defineProperty(y,"resetWarnings",{enumerable:!0,get:function(){return j}}),Object.defineProperty(y,"fail",{enumerable:!0,get:function(){return f}}),Object.defineProperty(y,"invariant",{enumerable:!0,get:function(){return m}}),Object.defineProperty(y,"DEV",{enumerable:!0,get:function(){return z}}),Object.defineProperty(y,"isObject",{enumerable:!0,get:function(){return G}}),Object.defineProperty(y,"isFunction",{enumerable:!0,get:function(){return S}}),Object.defineProperty(y,"isNil",{enumerable:!0,get:function(){return X}}),Object.defineProperty(y,"isBlank",{enumerable:!0,get:function(){return M}}),Object.defineProperty(y,"isCtor",{enumerable:!0,get:function(){return R}}),Object.defineProperty(y,"pathGetter",{enumerable:!0,get:function(){return N}}),Object.defineProperty(y,"pathSetter",{enumerable:!0,get:function(){return c}}),Object.defineProperty(y,"getPath",{enumerable:!0,get:function(){return h}}),Object.defineProperty(y,"setPath",{enumerable:!0,get:function(){return a}}),Object.defineProperty(y,"humanise",{enumerable:!0,get:function(){return d}}),Object.defineProperty(y,"escapeHtml",{enumerable:!0,get:function(){return w}}),Object.defineProperty(y,"titleCase",{enumerable:!0,get:function(){return C}}),Object.defineProperty(y,"expand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(y,"toArray",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(y,"merge",{enumerable:!0,get:function(){return me}}),Object.defineProperty(y,"mergeRow",{enumerable:!0,get:function(){return be}}),Object.defineProperty(y,"Lru",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(y,"collator",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(y,"defaultCompare",{enumerable:!0,get:function(){return re}}),Object.defineProperty(y,"now",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(y,"nextFrame",{enumerable:!0,get:function(){return we}}),Object.defineProperty(y,"cancelFrame",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(y,"frameBatched",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(y,"settleDebounce",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(y,"whenIdle",{enumerable:!0,get:function(){return je}}),Object.defineProperty(y,"uid",{enumerable:!0,get:function(){return Se}});const V="1.89.0";async function I(){return V}const A="1.89.0",T=new Set,fe=2e3;function ne(n){if(T.add(n),T.size>fe){const r=T.values().next().value;r!==void 0&&T.delete(r)}}const W=[],ae=500;function b(n,r,u){W.push({key:n,level:r,message:u.map($=>typeof $=="string"?$:x($)).join(" "),at:Date.now()}),W.length>ae&&W.shift()}function x(n){if(n instanceof Error)return n.message;try{return JSON.stringify(n)}catch{return String(n)}}function de(){return W.map(n=>({...n}))}function ie(n){if(n.length===0||typeof n[0]!="string")return n;const r=n[0].replace(/^\[lattice\]\s*/,"");return r===n[0]?n:[r,...n.slice(1)]}function D(n,...r){if(T.has(n))return;ne(n);const u=ie(r);b(n,"warn",u),console.warn("[lattice]",...u)}function k(n,...r){if(T.has(n))return;ne(n);const u=ie(r);b(n,"info",u),console.info("[lattice]",...u)}function j(){T.clear(),W.length=0}function f(n,r){const u=new Error(`[lattice] ${n}`);throw r!==void 0&&(u.cause=r),u}function m(n,r){n||f(r)}const z=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function G(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function S(n){return typeof n=="function"}function X(n){return n==null}function M(n){return n==null||n===""}function R(n){return typeof n!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(n))?!0:!!(n.prototype&&Object.getOwnPropertyNames(n.prototype).length>1)}const P=new Map;function N(n){let r=P.get(n);if(r)return r;if(!n.includes("."))r=u=>u?.[n];else{const u=n.split("."),$=u.length;r=Z=>{let Q=Z;for(let U=0;U<$;U++){if(Q==null)return;Q=Q[u[U]]}return Q}}return P.set(n,r),r}const E=new Map;function c(n){let r=E.get(n);if(r)return r;if(!n.includes("."))r=(u,$)=>{u!=null&&(u[n]=$)};else{const u=n.split("."),$=u.length-1;r=(Z,Q)=>{let U=Z;for(let se=0;se<$;se++){if(U==null)return;const ke=u[se];U[ke]==null&&(U[ke]={}),U=U[ke]}U!=null&&(U[u[$]]=Q)}}return E.set(n,r),r}function h(n,r){return N(r)(n)}function a(n,r,u){c(r)(n,u)}function d(n){return n?(n.includes(".")?n.slice(n.lastIndexOf(".")+1):n).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(/^./,u=>u.toUpperCase()):""}const l={"&":"&","<":"<",">":">",'"':""","'":"'"};function w(n){const r=n==null?"":String(n);return/[&<>"']/.test(r)?r.replace(/[&<>"']/g,u=>l[u]):r}function C(n){return String(n).replace(/\w\S*/g,r=>r[0].toUpperCase()+r.slice(1).toLowerCase())}function te(n,r,u){if(n!==void 0)return n===!0?{enabled:!0,...u}:n===!1?{enabled:!1}:G(n)?n:{[r]:n,enabled:!0}}function oe(n){return n==null?[]:Array.isArray(n)?n:[n]}const $e=Object.freeze(new Set(["__proto__","constructor","prototype"]));function me(n,r){if(!G(n))return G(r)?{...r}:r;if(!G(r))return r===void 0?n:r;const u={...n};for(const $ of Object.keys(r)){if($e.has($))continue;const Z=r[$];Z!==void 0&&(u[$]=G(Z)&&G(u[$])?me(u[$],Z):Z)}return u}function be(n,r){if(!G(n)||!G(r)||n===r)return r;const u=Object.create(Object.getPrototypeOf(n));return Object.assign(u,n,r),u}class Y{#t;#e=new Map;#n;constructor(r=256,u=null){this.#t=r,this.#n=u}get size(){return this.#e.size}get max(){return this.#t}set max(r){this.#t=r,this.#r()}has(r){return this.#e.has(r)}get(r){const u=this.#e;if(!u.has(r))return;const $=u.get(r);return u.delete(r),u.set(r,$),$}peek(r){return this.#e.get(r)}set(r,u){const $=this.#e;return $.has(r)&&$.delete(r),$.set(r,u),this.#r(),u}delete(r){const u=this.#e.get(r);return this.#e.delete(r)&&this.#n&&this.#n(u,r),u}clear(){if(this.#n)for(const[r,u]of this.#e)this.#n(u,r);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const r=this.#e;for(;r.size>this.#t;){const u=r.keys().next().value,$=r.get(u);r.delete(u),this.#n&&this.#n($,u)}}}const le=new Map;function Ne(n,r){const u=`${n||""}|${r?JSON.stringify(r):""}`;let $=le.get(u);return $||($=new Intl.Collator(n||void 0,{numeric:!0,sensitivity:"variant",...r}),le.set(u,$)),$}function re(n,r){if(n===r)return 0;if(n==null)return 1;if(r==null)return-1;if(typeof n=="number"&&typeof r=="number")return Number.isNaN(n)?Number.isNaN(r)?0:1:Number.isNaN(r)||n<r?-1:n>r?1:0;const u=String(n),$=String(r);return u<$?-1:u>$?1:0}function ye(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const Oe=typeof requestAnimationFrame=="function";function we(n){return Oe?requestAnimationFrame(n):setTimeout(()=>n(ye()),16)}function pe(n){n!=null&&(Oe?cancelAnimationFrame(n):clearTimeout(n))}function Re(n){let r=null,u=null;const $=()=>{r=null;const Q=u;u=null,n(...Q||[])},Z=(...Q)=>{u=Q,r===null&&(r=we($))};return Z.cancel=()=>{pe(r),r=null,u=null},Z.flush=()=>{r!==null&&(pe(r),$())},Z}function Pe(n,r){let u=null,$=null;const Z=()=>{if(u=null,$===null)return;const se=$;$=null,n(...se),Q()},Q=()=>{u=setTimeout(Z,r),typeof u?.unref=="function"&&u.unref()},U=(...se)=>{u===null?(n(...se),Q()):($=se,clearTimeout(u),Q())};return U.flush=()=>{if(u!==null&&clearTimeout(u),u=null,$===null)return;const se=$;$=null,n(...se)},U.cancel=()=>{u!==null&&clearTimeout(u),u=null,$=null},U.pending=()=>u!==null||$!==null,U}function je(n,r=50){return typeof requestIdleCallback=="function"?requestIdleCallback(n,{timeout:r}):setTimeout(()=>n({timeRemaining:()=>0,didTimeout:!0}),1)}let Le=0;function Se(n="l"){return`${n}${(++Le).toString(36)}`}}),ve("packages/modules/dashboard/spec.js",function(y,ee){"use strict";Object.defineProperty(y,"PANEL_KINDS",{enumerable:!0,get:function(){return V}}),Object.defineProperty(y,"SOURCE_KINDS",{enumerable:!0,get:function(){return I}}),Object.defineProperty(y,"MAP_BINDINGS",{enumerable:!0,get:function(){return A}}),Object.defineProperty(y,"GRID_REF",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(y,"isPlain",{enumerable:!0,get:function(){return b}}),Object.defineProperty(y,"copySpec",{enumerable:!0,get:function(){return x}}),Object.defineProperty(y,"sameSpec",{enumerable:!0,get:function(){return de}}),Object.defineProperty(y,"parseSourceRef",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(y,"readRelation",{enumerable:!0,get:function(){return D}}),Object.defineProperty(y,"inspectSpec",{enumerable:!0,get:function(){return k}}),Object.defineProperty(y,"validateDashboardSpec",{enumerable:!0,get:function(){return j}});const V=Object.freeze(["grid","chart","kpi","calendar","map","html"]),I=Object.freeze(["rows","pushdown","router","grid"]),A=Object.freeze(["chart","leaflet","deckgl"]),T=Object.freeze(["layout","panels","sources","links"]),fe=Object.freeze(["id","kind","title","source","options","binding"]),ne=Object.freeze(["from","to","on"]),W=Object.freeze({rows:["kind","rows","columns","rowKey"],router:["kind","router","predicate","route","columns","rowKey"],grid:["kind","of"]}),ae="grid:";function b(f){if(!f||typeof f!="object"||Array.isArray(f))return!1;const m=Object.getPrototypeOf(f);return m===Object.prototype||m===null}function x(f,m){if(m==="rows"&&Array.isArray(f))return f;if(Array.isArray(f))return f.map(G=>x(G));if(!b(f)||Object.values(f).some(G=>typeof G=="function"))return f;const z={};for(const[G,S]of Object.entries(f))S!==void 0&&(z[G]=x(S,G));return z}function de(f,m){if(f===m)return!0;if(Array.isArray(f)||Array.isArray(m))return!Array.isArray(f)||!Array.isArray(m)||f.length!==m.length?!1:f.every((S,X)=>de(S,m[X]));if(!b(f)||!b(m))return!1;const z=Object.keys(f).filter(S=>f[S]!==void 0),G=Object.keys(m).filter(S=>m[S]!==void 0);return z.length!==G.length?!1:z.every(S=>de(f[S],m[S]))}function ie(f){return typeof f!="string"||f===""?null:f.startsWith(ae)?{kind:"grid",of:f.slice(ae.length)}:{kind:"named",id:f}}function D(f){return typeof f=="string"&&f!==""?{from:f,to:f}:typeof f=="function"?f:b(f)&&typeof f.from=="string"&&f.from!==""&&typeof f.to=="string"&&f.to!==""?{from:f.from,to:f.to}:null}function k(f){const m=[],z=new Set,G=new Set,S=new Set,X=new Set,M={fatal:null,problems:m,badPanels:z,badSources:G,badLinks:S,badWindows:X};if(!b(f))return M.fatal="the spec is not an object",m.push({path:"",message:"is not an object: a spec is { layout, panels, sources, links }"}),M;const R=f;if(!Array.isArray(R.panels))return M.fatal="spec.panels is not an array",m.push({path:"panels",message:"is not an array of panels"}),M;for(const c of Object.keys(R))T.includes(c)||m.push({path:c,message:`is not a dashboard spec key (${T.join(", ")})`});const P=new Map;R.panels.forEach((c,h)=>{const a=`panels[${h}]`;if(!b(c)){z.add(h),m.push({path:a,message:"is not an object"});return}if(typeof c.id!="string"||c.id===""){z.add(h),m.push({path:`${a}.id`,message:"is missing: every panel needs a unique string id"});return}if(P.has(c.id)){z.add(h),m.push({path:`${a}.id`,panel:c.id,message:`repeats "${c.id}", which panels[${P.get(c.id).index}] already uses`});return}P.set(c.id,{index:h,kind:c.kind})});const N=R.sources===void 0?{}:R.sources;if(!b(N))m.push({path:"sources",message:"is not an object of named sources"});else for(const[c,h]of Object.entries(N)){const a=`sources.${c}`,d=(w,C)=>{G.add(c),m.push({path:w,message:C})};if(!b(h)){d(a,"is not an object");continue}if(!I.includes(h.kind)){d(`${a}.kind`,`names no source kind (${I.join(", ")})`);continue}const l=W[h.kind];if(l)for(const w of Object.keys(h))l.includes(w)||m.push({path:`${a}.${w}`,message:`is not a key of a ${h.kind} source (${l.join(", ")})`});if(h.columns!==void 0&&!Array.isArray(h.columns)&&d(`${a}.columns`,"is not an array of columns"),h.kind==="rows"&&!Array.isArray(h.rows)&&d(`${a}.rows`,"is not an array of rows"),h.kind==="pushdown"&&!(h.adapter&&typeof h.adapter.execute=="function")&&d(`${a}.adapter`,"is not a pushdown adapter (an object with execute())"),h.kind==="router"&&(h.router&&typeof h.router.attach=="function"||d(`${a}.router`,"is not a Data Router (an object with attach())"),h.predicate===void 0&&d(`${a}.predicate`,"is missing: name the partition value or predicate the route matches")),h.kind==="grid"){const w=typeof h.of=="string"?P.get(h.of):void 0;w?w.kind!=="grid"&&d(`${a}.of`,`names "${h.of}", a ${w.kind} panel: only a grid panel has a grid to view`):d(`${a}.of`,"names no panel")}}const E=new Map;R.panels.forEach((c,h)=>{if(z.has(h))return;const a=`panels[${h}]`,d=(C,te)=>{z.add(h),m.push({path:C,panel:c.id,message:te})};for(const C of Object.keys(c))fe.includes(C)||m.push({path:`${a}.${C}`,panel:c.id,message:`is not a panel key (${fe.join(", ")}); a viewer's own settings go in options`});if(!V.includes(c.kind)){d(`${a}.kind`,`names no panel kind (${V.join(", ")})`);return}if(c.title!==void 0&&typeof c.title!="string"&&m.push({path:`${a}.title`,panel:c.id,message:"is not a string"}),c.options!==void 0&&!b(c.options)){d(`${a}.options`,"is not an object");return}if(c.binding!==void 0&&(c.kind!=="map"?d(`${a}.binding`,`is only read on a map panel, and this is a ${c.kind} panel`):A.includes(c.binding)||d(`${a}.binding`,`names no map binding (${A.join(", ")})`)),c.source===void 0){(c.kind==="chart"||c.kind==="map"||c.kind==="calendar")&&d(`${a}.source`,`is missing: a ${c.kind} panel draws a source's rows`);return}if(c.kind==="html"){d(`${a}.source`,"is set on an html panel, which reads no rows");return}const l=ie(c.source);if(!l){d(`${a}.source`,"is not a source id");return}let w=null;if(l.kind==="grid")w=l.of;else if(!b(N)||!Object.hasOwn(N,l.id)){d(`${a}.source`,`names "${l.id}", which is not in sources`);return}else if(G.has(l.id)){d(`${a}.source`,`names "${l.id}", a source that is not usable`);return}else N[l.id].kind==="grid"&&(w=N[l.id].of);if(w!==null){const C=P.get(w);if(!C){d(`${a}.source`,`views the grid of "${w}", which is not a panel`);return}if(C.kind!=="grid"){d(`${a}.source`,`views the grid of "${w}", a ${C.kind} panel`);return}if(w===c.id){d(`${a}.source`,"views its own grid");return}E.set(c.id,w)}});for(let c=!0;c;)c=!1,R.panels.forEach((h,a)=>{if(z.has(a)||!E.has(h.id))return;const d=new Set([h.id]);let l=E.get(h.id);for(;l!==void 0;){const w=P.get(l);if(d.has(l)){z.add(a),m.push({path:`panels[${a}].source`,panel:h.id,message:`is part of a cycle of panels viewing each other's grids (${[...d,l].join(" -> ")})`}),c=!0;return}if(!w||z.has(w.index)){z.add(a),m.push({path:`panels[${a}].source`,panel:h.id,message:`views the grid of "${l}", a panel that was not built`}),c=!0;return}d.add(l),l=E.get(l)}});if(R.links!==void 0&&!Array.isArray(R.links)?m.push({path:"links",message:"is not an array of links"}):(R.links||[]).forEach((c,h)=>{const a=`links[${h}]`,d=(l,w)=>{S.add(h),m.push({path:l,link:h,message:w})};if(!b(c)){d(a,"is not an object");return}for(const l of Object.keys(c))ne.includes(l)||m.push({path:`${a}.${l}`,link:h,message:`is not a link key (${ne.join(", ")})`});if(typeof c.from!="string"||!P.has(c.from)){d(`${a}.from`,"names no panel");return}if(typeof c.to!="string"||!P.has(c.to)){d(`${a}.to`,"names no panel");return}if(c.from===c.to){d(`${a}.to`,"is the panel the link starts from");return}D(c.on)||d(`${a}.on`,"is not a column name, a { from, to } pair of column names, or a relation function")}),R.layout!==void 0){if(!b(R.layout))m.push({path:"layout",message:"is not an object"});else if(R.layout.windows!==void 0)if(!Array.isArray(R.layout.windows))m.push({path:"layout.windows",message:"is not an array of windows"});else{const c=new Set;R.layout.windows.forEach((h,a)=>{const d=`layout.windows[${a}]`;!b(h)||typeof h.id!="string"?(X.add(a),m.push({path:d,message:"is not a window with a string id"})):P.has(h.id)?c.has(h.id)?(X.add(a),m.push({path:`${d}.id`,message:`places "${h.id}" a second time`})):c.add(h.id):(X.add(a),m.push({path:`${d}.id`,message:`names "${h.id}", which is not a panel`}))})}}return M}function j(f){const{problems:m}=k(f);return{ok:m.length===0,problems:m.map(({path:z,message:G})=>({path:z,message:G}))}}}),ve("packages/modules/dashboard/propose.js",function(y,ee){"use strict";Object.defineProperty(y,"PROPOSE_SYSTEM",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(y,"columnRefs",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(y,"proposalRequest",{enumerable:!0,get:function(){return b}}),Object.defineProperty(y,"parseProposal",{enumerable:!0,get:function(){return de}}),Object.defineProperty(y,"checkProposal",{enumerable:!0,get:function(){return ie}});const V=ee("packages/modules/dashboard/spec.js"),I=V.inspectSpec,A=V.isPlain,T=V.copySpec,fe=V.parseSourceRef,ne=["You design dashboards for a data grid. Return ONLY a JSON object of the form",'{ "layout": { "columns": <n>, "rows": <n> }, "panels": [ { "id": "<id>", "kind": "<kind>",','"title": "<title>", "source": "<source id>", "binding": "chart", "options": { ... } } ],','"links": [ { "from": "<grid panel id>", "to": "<panel id>", "on": "<column>" } ] }.',"Use only the panel kinds and the columns listed in SCHEMA, and only the source it names.","A chart panel's options are a chart spec (type, x, y, series); a kpi panel's are",'{ tiles: [ { id, field, aggregation } ] }; a map panel with binding "chart" takes a map chart',`spec (type "markermap", lon, lat); a grid panel's are { columns: [ { field } ] }.`,"A person reviews the proposal before anything is built."].join(" "),W=Object.freeze(["x","y","series","measure","size","value","volume","lon","lat","geometry","label","start","end","source","target","multiples"]);function ae(D){const k=new Set,j=A(D.options)?D.options:{},f=m=>{typeof m=="string"&&m!==""&&k.add(m)};if(D.kind==="grid")for(const m of Array.isArray(j.columns)?j.columns:[])A(m)&&f(m.field);else if(D.kind==="kpi"){for(const m of Array.isArray(j.tiles)?j.tiles:[])A(m)&&f(m.field);for(const m of Array.isArray(j.fields)?j.fields:[])f(m)}else if(D.kind==="chart"||D.kind==="map"&&(D.binding||"chart")==="chart")for(const m of W)f(j[m]);else D.kind==="map"&&A(j.position)&&(f(j.position.lon),f(j.position.lat),f(j.position.geometry));return[...k]}function b(D,k){const j={source:k.source,columns:k.columns,kinds:k.kinds};let f=`${D}
|
|
6
|
+
var Ie=Object.create(null),ze=Object.create(null);function ve(y,ee){Ie[y]=ee}function Ke(y){var ee=ze[y];if(ee)return ee;var V=Object.create(null);ze[y]=V;var I=Ie[y];if(!I)throw new Error("[lattice] missing module: "+y);return I(V,Ke),V}ve("packages/core/src/internal/util.js",function(y,ee){"use strict";Object.defineProperty(y,"VERSION",{enumerable:!0,get:function(){return A}}),Object.defineProperty(y,"reportedWarnings",{enumerable:!0,get:function(){return de}}),Object.defineProperty(y,"warnOnce",{enumerable:!0,get:function(){return D}}),Object.defineProperty(y,"infoOnce",{enumerable:!0,get:function(){return k}}),Object.defineProperty(y,"resetWarnings",{enumerable:!0,get:function(){return j}}),Object.defineProperty(y,"fail",{enumerable:!0,get:function(){return f}}),Object.defineProperty(y,"invariant",{enumerable:!0,get:function(){return m}}),Object.defineProperty(y,"DEV",{enumerable:!0,get:function(){return z}}),Object.defineProperty(y,"isObject",{enumerable:!0,get:function(){return G}}),Object.defineProperty(y,"isFunction",{enumerable:!0,get:function(){return S}}),Object.defineProperty(y,"isNil",{enumerable:!0,get:function(){return X}}),Object.defineProperty(y,"isBlank",{enumerable:!0,get:function(){return M}}),Object.defineProperty(y,"isCtor",{enumerable:!0,get:function(){return R}}),Object.defineProperty(y,"pathGetter",{enumerable:!0,get:function(){return N}}),Object.defineProperty(y,"pathSetter",{enumerable:!0,get:function(){return c}}),Object.defineProperty(y,"getPath",{enumerable:!0,get:function(){return h}}),Object.defineProperty(y,"setPath",{enumerable:!0,get:function(){return a}}),Object.defineProperty(y,"humanise",{enumerable:!0,get:function(){return d}}),Object.defineProperty(y,"escapeHtml",{enumerable:!0,get:function(){return w}}),Object.defineProperty(y,"titleCase",{enumerable:!0,get:function(){return C}}),Object.defineProperty(y,"expand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(y,"toArray",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(y,"merge",{enumerable:!0,get:function(){return me}}),Object.defineProperty(y,"mergeRow",{enumerable:!0,get:function(){return be}}),Object.defineProperty(y,"Lru",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(y,"collator",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(y,"defaultCompare",{enumerable:!0,get:function(){return re}}),Object.defineProperty(y,"now",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(y,"nextFrame",{enumerable:!0,get:function(){return we}}),Object.defineProperty(y,"cancelFrame",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(y,"frameBatched",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(y,"settleDebounce",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(y,"whenIdle",{enumerable:!0,get:function(){return je}}),Object.defineProperty(y,"uid",{enumerable:!0,get:function(){return Se}});const V="1.89.1";async function I(){return V}const A="1.89.1",T=new Set,fe=2e3;function ne(n){if(T.add(n),T.size>fe){const r=T.values().next().value;r!==void 0&&T.delete(r)}}const W=[],ae=500;function b(n,r,u){W.push({key:n,level:r,message:u.map($=>typeof $=="string"?$:x($)).join(" "),at:Date.now()}),W.length>ae&&W.shift()}function x(n){if(n instanceof Error)return n.message;try{return JSON.stringify(n)}catch{return String(n)}}function de(){return W.map(n=>({...n}))}function ie(n){if(n.length===0||typeof n[0]!="string")return n;const r=n[0].replace(/^\[lattice\]\s*/,"");return r===n[0]?n:[r,...n.slice(1)]}function D(n,...r){if(T.has(n))return;ne(n);const u=ie(r);b(n,"warn",u),console.warn("[lattice]",...u)}function k(n,...r){if(T.has(n))return;ne(n);const u=ie(r);b(n,"info",u),console.info("[lattice]",...u)}function j(){T.clear(),W.length=0}function f(n,r){const u=new Error(`[lattice] ${n}`);throw r!==void 0&&(u.cause=r),u}function m(n,r){n||f(r)}const z=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function G(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function S(n){return typeof n=="function"}function X(n){return n==null}function M(n){return n==null||n===""}function R(n){return typeof n!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(n))?!0:!!(n.prototype&&Object.getOwnPropertyNames(n.prototype).length>1)}const P=new Map;function N(n){let r=P.get(n);if(r)return r;if(!n.includes("."))r=u=>u?.[n];else{const u=n.split("."),$=u.length;r=Z=>{let Q=Z;for(let U=0;U<$;U++){if(Q==null)return;Q=Q[u[U]]}return Q}}return P.set(n,r),r}const E=new Map;function c(n){let r=E.get(n);if(r)return r;if(!n.includes("."))r=(u,$)=>{u!=null&&(u[n]=$)};else{const u=n.split("."),$=u.length-1;r=(Z,Q)=>{let U=Z;for(let se=0;se<$;se++){if(U==null)return;const ke=u[se];U[ke]==null&&(U[ke]={}),U=U[ke]}U!=null&&(U[u[$]]=Q)}}return E.set(n,r),r}function h(n,r){return N(r)(n)}function a(n,r,u){c(r)(n,u)}function d(n){return n?(n.includes(".")?n.slice(n.lastIndexOf(".")+1):n).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(/^./,u=>u.toUpperCase()):""}const l={"&":"&","<":"<",">":">",'"':""","'":"'"};function w(n){const r=n==null?"":String(n);return/[&<>"']/.test(r)?r.replace(/[&<>"']/g,u=>l[u]):r}function C(n){return String(n).replace(/\w\S*/g,r=>r[0].toUpperCase()+r.slice(1).toLowerCase())}function te(n,r,u){if(n!==void 0)return n===!0?{enabled:!0,...u}:n===!1?{enabled:!1}:G(n)?n:{[r]:n,enabled:!0}}function oe(n){return n==null?[]:Array.isArray(n)?n:[n]}const $e=Object.freeze(new Set(["__proto__","constructor","prototype"]));function me(n,r){if(!G(n))return G(r)?{...r}:r;if(!G(r))return r===void 0?n:r;const u={...n};for(const $ of Object.keys(r)){if($e.has($))continue;const Z=r[$];Z!==void 0&&(u[$]=G(Z)&&G(u[$])?me(u[$],Z):Z)}return u}function be(n,r){if(!G(n)||!G(r)||n===r)return r;const u=Object.create(Object.getPrototypeOf(n));return Object.assign(u,n,r),u}class Y{#t;#e=new Map;#n;constructor(r=256,u=null){this.#t=r,this.#n=u}get size(){return this.#e.size}get max(){return this.#t}set max(r){this.#t=r,this.#r()}has(r){return this.#e.has(r)}get(r){const u=this.#e;if(!u.has(r))return;const $=u.get(r);return u.delete(r),u.set(r,$),$}peek(r){return this.#e.get(r)}set(r,u){const $=this.#e;return $.has(r)&&$.delete(r),$.set(r,u),this.#r(),u}delete(r){const u=this.#e.get(r);return this.#e.delete(r)&&this.#n&&this.#n(u,r),u}clear(){if(this.#n)for(const[r,u]of this.#e)this.#n(u,r);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const r=this.#e;for(;r.size>this.#t;){const u=r.keys().next().value,$=r.get(u);r.delete(u),this.#n&&this.#n($,u)}}}const le=new Map;function Ne(n,r){const u=`${n||""}|${r?JSON.stringify(r):""}`;let $=le.get(u);return $||($=new Intl.Collator(n||void 0,{numeric:!0,sensitivity:"variant",...r}),le.set(u,$)),$}function re(n,r){if(n===r)return 0;if(n==null)return 1;if(r==null)return-1;if(typeof n=="number"&&typeof r=="number")return Number.isNaN(n)?Number.isNaN(r)?0:1:Number.isNaN(r)||n<r?-1:n>r?1:0;const u=String(n),$=String(r);return u<$?-1:u>$?1:0}function ye(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const Oe=typeof requestAnimationFrame=="function";function we(n){return Oe?requestAnimationFrame(n):setTimeout(()=>n(ye()),16)}function pe(n){n!=null&&(Oe?cancelAnimationFrame(n):clearTimeout(n))}function Re(n){let r=null,u=null;const $=()=>{r=null;const Q=u;u=null,n(...Q||[])},Z=(...Q)=>{u=Q,r===null&&(r=we($))};return Z.cancel=()=>{pe(r),r=null,u=null},Z.flush=()=>{r!==null&&(pe(r),$())},Z}function Pe(n,r){let u=null,$=null;const Z=()=>{if(u=null,$===null)return;const se=$;$=null,n(...se),Q()},Q=()=>{u=setTimeout(Z,r),typeof u?.unref=="function"&&u.unref()},U=(...se)=>{u===null?(n(...se),Q()):($=se,clearTimeout(u),Q())};return U.flush=()=>{if(u!==null&&clearTimeout(u),u=null,$===null)return;const se=$;$=null,n(...se)},U.cancel=()=>{u!==null&&clearTimeout(u),u=null,$=null},U.pending=()=>u!==null||$!==null,U}function je(n,r=50){return typeof requestIdleCallback=="function"?requestIdleCallback(n,{timeout:r}):setTimeout(()=>n({timeRemaining:()=>0,didTimeout:!0}),1)}let Le=0;function Se(n="l"){return`${n}${(++Le).toString(36)}`}}),ve("packages/modules/dashboard/spec.js",function(y,ee){"use strict";Object.defineProperty(y,"PANEL_KINDS",{enumerable:!0,get:function(){return V}}),Object.defineProperty(y,"SOURCE_KINDS",{enumerable:!0,get:function(){return I}}),Object.defineProperty(y,"MAP_BINDINGS",{enumerable:!0,get:function(){return A}}),Object.defineProperty(y,"GRID_REF",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(y,"isPlain",{enumerable:!0,get:function(){return b}}),Object.defineProperty(y,"copySpec",{enumerable:!0,get:function(){return x}}),Object.defineProperty(y,"sameSpec",{enumerable:!0,get:function(){return de}}),Object.defineProperty(y,"parseSourceRef",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(y,"readRelation",{enumerable:!0,get:function(){return D}}),Object.defineProperty(y,"inspectSpec",{enumerable:!0,get:function(){return k}}),Object.defineProperty(y,"validateDashboardSpec",{enumerable:!0,get:function(){return j}});const V=Object.freeze(["grid","chart","kpi","calendar","map","html"]),I=Object.freeze(["rows","pushdown","router","grid"]),A=Object.freeze(["chart","leaflet","deckgl"]),T=Object.freeze(["layout","panels","sources","links"]),fe=Object.freeze(["id","kind","title","source","options","binding"]),ne=Object.freeze(["from","to","on"]),W=Object.freeze({rows:["kind","rows","columns","rowKey"],router:["kind","router","predicate","route","columns","rowKey"],grid:["kind","of"]}),ae="grid:";function b(f){if(!f||typeof f!="object"||Array.isArray(f))return!1;const m=Object.getPrototypeOf(f);return m===Object.prototype||m===null}function x(f,m){if(m==="rows"&&Array.isArray(f))return f;if(Array.isArray(f))return f.map(G=>x(G));if(!b(f)||Object.values(f).some(G=>typeof G=="function"))return f;const z={};for(const[G,S]of Object.entries(f))S!==void 0&&(z[G]=x(S,G));return z}function de(f,m){if(f===m)return!0;if(Array.isArray(f)||Array.isArray(m))return!Array.isArray(f)||!Array.isArray(m)||f.length!==m.length?!1:f.every((S,X)=>de(S,m[X]));if(!b(f)||!b(m))return!1;const z=Object.keys(f).filter(S=>f[S]!==void 0),G=Object.keys(m).filter(S=>m[S]!==void 0);return z.length!==G.length?!1:z.every(S=>de(f[S],m[S]))}function ie(f){return typeof f!="string"||f===""?null:f.startsWith(ae)?{kind:"grid",of:f.slice(ae.length)}:{kind:"named",id:f}}function D(f){return typeof f=="string"&&f!==""?{from:f,to:f}:typeof f=="function"?f:b(f)&&typeof f.from=="string"&&f.from!==""&&typeof f.to=="string"&&f.to!==""?{from:f.from,to:f.to}:null}function k(f){const m=[],z=new Set,G=new Set,S=new Set,X=new Set,M={fatal:null,problems:m,badPanels:z,badSources:G,badLinks:S,badWindows:X};if(!b(f))return M.fatal="the spec is not an object",m.push({path:"",message:"is not an object: a spec is { layout, panels, sources, links }"}),M;const R=f;if(!Array.isArray(R.panels))return M.fatal="spec.panels is not an array",m.push({path:"panels",message:"is not an array of panels"}),M;for(const c of Object.keys(R))T.includes(c)||m.push({path:c,message:`is not a dashboard spec key (${T.join(", ")})`});const P=new Map;R.panels.forEach((c,h)=>{const a=`panels[${h}]`;if(!b(c)){z.add(h),m.push({path:a,message:"is not an object"});return}if(typeof c.id!="string"||c.id===""){z.add(h),m.push({path:`${a}.id`,message:"is missing: every panel needs a unique string id"});return}if(P.has(c.id)){z.add(h),m.push({path:`${a}.id`,panel:c.id,message:`repeats "${c.id}", which panels[${P.get(c.id).index}] already uses`});return}P.set(c.id,{index:h,kind:c.kind})});const N=R.sources===void 0?{}:R.sources;if(!b(N))m.push({path:"sources",message:"is not an object of named sources"});else for(const[c,h]of Object.entries(N)){const a=`sources.${c}`,d=(w,C)=>{G.add(c),m.push({path:w,message:C})};if(!b(h)){d(a,"is not an object");continue}if(!I.includes(h.kind)){d(`${a}.kind`,`names no source kind (${I.join(", ")})`);continue}const l=W[h.kind];if(l)for(const w of Object.keys(h))l.includes(w)||m.push({path:`${a}.${w}`,message:`is not a key of a ${h.kind} source (${l.join(", ")})`});if(h.columns!==void 0&&!Array.isArray(h.columns)&&d(`${a}.columns`,"is not an array of columns"),h.kind==="rows"&&!Array.isArray(h.rows)&&d(`${a}.rows`,"is not an array of rows"),h.kind==="pushdown"&&!(h.adapter&&typeof h.adapter.execute=="function")&&d(`${a}.adapter`,"is not a pushdown adapter (an object with execute())"),h.kind==="router"&&(h.router&&typeof h.router.attach=="function"||d(`${a}.router`,"is not a Data Router (an object with attach())"),h.predicate===void 0&&d(`${a}.predicate`,"is missing: name the partition value or predicate the route matches")),h.kind==="grid"){const w=typeof h.of=="string"?P.get(h.of):void 0;w?w.kind!=="grid"&&d(`${a}.of`,`names "${h.of}", a ${w.kind} panel: only a grid panel has a grid to view`):d(`${a}.of`,"names no panel")}}const E=new Map;R.panels.forEach((c,h)=>{if(z.has(h))return;const a=`panels[${h}]`,d=(C,te)=>{z.add(h),m.push({path:C,panel:c.id,message:te})};for(const C of Object.keys(c))fe.includes(C)||m.push({path:`${a}.${C}`,panel:c.id,message:`is not a panel key (${fe.join(", ")}); a viewer's own settings go in options`});if(!V.includes(c.kind)){d(`${a}.kind`,`names no panel kind (${V.join(", ")})`);return}if(c.title!==void 0&&typeof c.title!="string"&&m.push({path:`${a}.title`,panel:c.id,message:"is not a string"}),c.options!==void 0&&!b(c.options)){d(`${a}.options`,"is not an object");return}if(c.binding!==void 0&&(c.kind!=="map"?d(`${a}.binding`,`is only read on a map panel, and this is a ${c.kind} panel`):A.includes(c.binding)||d(`${a}.binding`,`names no map binding (${A.join(", ")})`)),c.source===void 0){(c.kind==="chart"||c.kind==="map"||c.kind==="calendar")&&d(`${a}.source`,`is missing: a ${c.kind} panel draws a source's rows`);return}if(c.kind==="html"){d(`${a}.source`,"is set on an html panel, which reads no rows");return}const l=ie(c.source);if(!l){d(`${a}.source`,"is not a source id");return}let w=null;if(l.kind==="grid")w=l.of;else if(!b(N)||!Object.hasOwn(N,l.id)){d(`${a}.source`,`names "${l.id}", which is not in sources`);return}else if(G.has(l.id)){d(`${a}.source`,`names "${l.id}", a source that is not usable`);return}else N[l.id].kind==="grid"&&(w=N[l.id].of);if(w!==null){const C=P.get(w);if(!C){d(`${a}.source`,`views the grid of "${w}", which is not a panel`);return}if(C.kind!=="grid"){d(`${a}.source`,`views the grid of "${w}", a ${C.kind} panel`);return}if(w===c.id){d(`${a}.source`,"views its own grid");return}E.set(c.id,w)}});for(let c=!0;c;)c=!1,R.panels.forEach((h,a)=>{if(z.has(a)||!E.has(h.id))return;const d=new Set([h.id]);let l=E.get(h.id);for(;l!==void 0;){const w=P.get(l);if(d.has(l)){z.add(a),m.push({path:`panels[${a}].source`,panel:h.id,message:`is part of a cycle of panels viewing each other's grids (${[...d,l].join(" -> ")})`}),c=!0;return}if(!w||z.has(w.index)){z.add(a),m.push({path:`panels[${a}].source`,panel:h.id,message:`views the grid of "${l}", a panel that was not built`}),c=!0;return}d.add(l),l=E.get(l)}});if(R.links!==void 0&&!Array.isArray(R.links)?m.push({path:"links",message:"is not an array of links"}):(R.links||[]).forEach((c,h)=>{const a=`links[${h}]`,d=(l,w)=>{S.add(h),m.push({path:l,link:h,message:w})};if(!b(c)){d(a,"is not an object");return}for(const l of Object.keys(c))ne.includes(l)||m.push({path:`${a}.${l}`,link:h,message:`is not a link key (${ne.join(", ")})`});if(typeof c.from!="string"||!P.has(c.from)){d(`${a}.from`,"names no panel");return}if(typeof c.to!="string"||!P.has(c.to)){d(`${a}.to`,"names no panel");return}if(c.from===c.to){d(`${a}.to`,"is the panel the link starts from");return}D(c.on)||d(`${a}.on`,"is not a column name, a { from, to } pair of column names, or a relation function")}),R.layout!==void 0){if(!b(R.layout))m.push({path:"layout",message:"is not an object"});else if(R.layout.windows!==void 0)if(!Array.isArray(R.layout.windows))m.push({path:"layout.windows",message:"is not an array of windows"});else{const c=new Set;R.layout.windows.forEach((h,a)=>{const d=`layout.windows[${a}]`;!b(h)||typeof h.id!="string"?(X.add(a),m.push({path:d,message:"is not a window with a string id"})):P.has(h.id)?c.has(h.id)?(X.add(a),m.push({path:`${d}.id`,message:`places "${h.id}" a second time`})):c.add(h.id):(X.add(a),m.push({path:`${d}.id`,message:`names "${h.id}", which is not a panel`}))})}}return M}function j(f){const{problems:m}=k(f);return{ok:m.length===0,problems:m.map(({path:z,message:G})=>({path:z,message:G}))}}}),ve("packages/modules/dashboard/propose.js",function(y,ee){"use strict";Object.defineProperty(y,"PROPOSE_SYSTEM",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(y,"columnRefs",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(y,"proposalRequest",{enumerable:!0,get:function(){return b}}),Object.defineProperty(y,"parseProposal",{enumerable:!0,get:function(){return de}}),Object.defineProperty(y,"checkProposal",{enumerable:!0,get:function(){return ie}});const V=ee("packages/modules/dashboard/spec.js"),I=V.inspectSpec,A=V.isPlain,T=V.copySpec,fe=V.parseSourceRef,ne=["You design dashboards for a data grid. Return ONLY a JSON object of the form",'{ "layout": { "columns": <n>, "rows": <n> }, "panels": [ { "id": "<id>", "kind": "<kind>",','"title": "<title>", "source": "<source id>", "binding": "chart", "options": { ... } } ],','"links": [ { "from": "<grid panel id>", "to": "<panel id>", "on": "<column>" } ] }.',"Use only the panel kinds and the columns listed in SCHEMA, and only the source it names.","A chart panel's options are a chart spec (type, x, y, series); a kpi panel's are",'{ tiles: [ { id, field, aggregation } ] }; a map panel with binding "chart" takes a map chart',`spec (type "markermap", lon, lat); a grid panel's are { columns: [ { field } ] }.`,"A person reviews the proposal before anything is built."].join(" "),W=Object.freeze(["x","y","series","measure","size","value","volume","lon","lat","geometry","label","start","end","source","target","multiples"]);function ae(D){const k=new Set,j=A(D.options)?D.options:{},f=m=>{typeof m=="string"&&m!==""&&k.add(m)};if(D.kind==="grid")for(const m of Array.isArray(j.columns)?j.columns:[])A(m)&&f(m.field);else if(D.kind==="kpi"){for(const m of Array.isArray(j.tiles)?j.tiles:[])A(m)&&f(m.field);for(const m of Array.isArray(j.fields)?j.fields:[])f(m)}else if(D.kind==="chart"||D.kind==="map"&&(D.binding||"chart")==="chart")for(const m of W)f(j[m]);else D.kind==="map"&&A(j.position)&&(f(j.position.lon),f(j.position.lat),f(j.position.geometry));return[...k]}function b(D,k){const j={source:k.source,columns:k.columns,kinds:k.kinds};let f=`${D}
|
|
7
7
|
|
|
8
8
|
SCHEMA
|
|
9
9
|
${JSON.stringify(j)}`;k.rows&&(f+=`
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.89.
|
|
2
|
+
* Lattice Grid 1.89.1, dashboard module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
(function(Te){"use strict";var Ie=Object.create(null),ze=Object.create(null);function Pe(y,ee){Ie[y]=ee}function Ke(y){var ee=ze[y];if(ee)return ee;var V=Object.create(null);ze[y]=V;var I=Ie[y];if(!I)throw new Error("[lattice] missing module: "+y);return I(V,Ke),V}Pe("packages/core/src/internal/util.js",function(y,ee){"use strict";Object.defineProperty(y,"VERSION",{enumerable:!0,get:function(){return A}}),Object.defineProperty(y,"reportedWarnings",{enumerable:!0,get:function(){return de}}),Object.defineProperty(y,"warnOnce",{enumerable:!0,get:function(){return G}}),Object.defineProperty(y,"infoOnce",{enumerable:!0,get:function(){return k}}),Object.defineProperty(y,"resetWarnings",{enumerable:!0,get:function(){return j}}),Object.defineProperty(y,"fail",{enumerable:!0,get:function(){return f}}),Object.defineProperty(y,"invariant",{enumerable:!0,get:function(){return m}}),Object.defineProperty(y,"DEV",{enumerable:!0,get:function(){return z}}),Object.defineProperty(y,"isObject",{enumerable:!0,get:function(){return C}}),Object.defineProperty(y,"isFunction",{enumerable:!0,get:function(){return S}}),Object.defineProperty(y,"isNil",{enumerable:!0,get:function(){return X}}),Object.defineProperty(y,"isBlank",{enumerable:!0,get:function(){return D}}),Object.defineProperty(y,"isCtor",{enumerable:!0,get:function(){return R}}),Object.defineProperty(y,"pathGetter",{enumerable:!0,get:function(){return N}}),Object.defineProperty(y,"pathSetter",{enumerable:!0,get:function(){return c}}),Object.defineProperty(y,"getPath",{enumerable:!0,get:function(){return h}}),Object.defineProperty(y,"setPath",{enumerable:!0,get:function(){return a}}),Object.defineProperty(y,"humanise",{enumerable:!0,get:function(){return d}}),Object.defineProperty(y,"escapeHtml",{enumerable:!0,get:function(){return w}}),Object.defineProperty(y,"titleCase",{enumerable:!0,get:function(){return M}}),Object.defineProperty(y,"expand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(y,"toArray",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(y,"merge",{enumerable:!0,get:function(){return me}}),Object.defineProperty(y,"mergeRow",{enumerable:!0,get:function(){return be}}),Object.defineProperty(y,"Lru",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(y,"collator",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(y,"defaultCompare",{enumerable:!0,get:function(){return re}}),Object.defineProperty(y,"now",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(y,"nextFrame",{enumerable:!0,get:function(){return we}}),Object.defineProperty(y,"cancelFrame",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(y,"frameBatched",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(y,"settleDebounce",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(y,"whenIdle",{enumerable:!0,get:function(){return je}}),Object.defineProperty(y,"uid",{enumerable:!0,get:function(){return Se}});const V="1.89.0";async function I(){return V}const A="1.89.0",F=new Set,fe=2e3;function ne(n){if(F.add(n),F.size>fe){const r=F.values().next().value;r!==void 0&&F.delete(r)}}const W=[],ae=500;function b(n,r,u){W.push({key:n,level:r,message:u.map($=>typeof $=="string"?$:x($)).join(" "),at:Date.now()}),W.length>ae&&W.shift()}function x(n){if(n instanceof Error)return n.message;try{return JSON.stringify(n)}catch{return String(n)}}function de(){return W.map(n=>({...n}))}function se(n){if(n.length===0||typeof n[0]!="string")return n;const r=n[0].replace(/^\[lattice\]\s*/,"");return r===n[0]?n:[r,...n.slice(1)]}function G(n,...r){if(F.has(n))return;ne(n);const u=se(r);b(n,"warn",u),console.warn("[lattice]",...u)}function k(n,...r){if(F.has(n))return;ne(n);const u=se(r);b(n,"info",u),console.info("[lattice]",...u)}function j(){F.clear(),W.length=0}function f(n,r){const u=new Error(`[lattice] ${n}`);throw r!==void 0&&(u.cause=r),u}function m(n,r){n||f(r)}const z=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function C(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function S(n){return typeof n=="function"}function X(n){return n==null}function D(n){return n==null||n===""}function R(n){return typeof n!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(n))?!0:!!(n.prototype&&Object.getOwnPropertyNames(n.prototype).length>1)}const P=new Map;function N(n){let r=P.get(n);if(r)return r;if(!n.includes("."))r=u=>u?.[n];else{const u=n.split("."),$=u.length;r=Z=>{let Q=Z;for(let U=0;U<$;U++){if(Q==null)return;Q=Q[u[U]]}return Q}}return P.set(n,r),r}const E=new Map;function c(n){let r=E.get(n);if(r)return r;if(!n.includes("."))r=(u,$)=>{u!=null&&(u[n]=$)};else{const u=n.split("."),$=u.length-1;r=(Z,Q)=>{let U=Z;for(let ie=0;ie<$;ie++){if(U==null)return;const ke=u[ie];U[ke]==null&&(U[ke]={}),U=U[ke]}U!=null&&(U[u[$]]=Q)}}return E.set(n,r),r}function h(n,r){return N(r)(n)}function a(n,r,u){c(r)(n,u)}function d(n){return n?(n.includes(".")?n.slice(n.lastIndexOf(".")+1):n).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(/^./,u=>u.toUpperCase()):""}const l={"&":"&","<":"<",">":">",'"':""","'":"'"};function w(n){const r=n==null?"":String(n);return/[&<>"']/.test(r)?r.replace(/[&<>"']/g,u=>l[u]):r}function M(n){return String(n).replace(/\w\S*/g,r=>r[0].toUpperCase()+r.slice(1).toLowerCase())}function te(n,r,u){if(n!==void 0)return n===!0?{enabled:!0,...u}:n===!1?{enabled:!1}:C(n)?n:{[r]:n,enabled:!0}}function oe(n){return n==null?[]:Array.isArray(n)?n:[n]}const $e=Object.freeze(new Set(["__proto__","constructor","prototype"]));function me(n,r){if(!C(n))return C(r)?{...r}:r;if(!C(r))return r===void 0?n:r;const u={...n};for(const $ of Object.keys(r)){if($e.has($))continue;const Z=r[$];Z!==void 0&&(u[$]=C(Z)&&C(u[$])?me(u[$],Z):Z)}return u}function be(n,r){if(!C(n)||!C(r)||n===r)return r;const u=Object.create(Object.getPrototypeOf(n));return Object.assign(u,n,r),u}class Y{#t;#e=new Map;#n;constructor(r=256,u=null){this.#t=r,this.#n=u}get size(){return this.#e.size}get max(){return this.#t}set max(r){this.#t=r,this.#r()}has(r){return this.#e.has(r)}get(r){const u=this.#e;if(!u.has(r))return;const $=u.get(r);return u.delete(r),u.set(r,$),$}peek(r){return this.#e.get(r)}set(r,u){const $=this.#e;return $.has(r)&&$.delete(r),$.set(r,u),this.#r(),u}delete(r){const u=this.#e.get(r);return this.#e.delete(r)&&this.#n&&this.#n(u,r),u}clear(){if(this.#n)for(const[r,u]of this.#e)this.#n(u,r);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const r=this.#e;for(;r.size>this.#t;){const u=r.keys().next().value,$=r.get(u);r.delete(u),this.#n&&this.#n($,u)}}}const le=new Map;function Re(n,r){const u=`${n||""}|${r?JSON.stringify(r):""}`;let $=le.get(u);return $||($=new Intl.Collator(n||void 0,{numeric:!0,sensitivity:"variant",...r}),le.set(u,$)),$}function re(n,r){if(n===r)return 0;if(n==null)return 1;if(r==null)return-1;if(typeof n=="number"&&typeof r=="number")return Number.isNaN(n)?Number.isNaN(r)?0:1:Number.isNaN(r)||n<r?-1:n>r?1:0;const u=String(n),$=String(r);return u<$?-1:u>$?1:0}function ye(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const Oe=typeof requestAnimationFrame=="function";function we(n){return Oe?requestAnimationFrame(n):setTimeout(()=>n(ye()),16)}function pe(n){n!=null&&(Oe?cancelAnimationFrame(n):clearTimeout(n))}function Le(n){let r=null,u=null;const $=()=>{r=null;const Q=u;u=null,n(...Q||[])},Z=(...Q)=>{u=Q,r===null&&(r=we($))};return Z.cancel=()=>{pe(r),r=null,u=null},Z.flush=()=>{r!==null&&(pe(r),$())},Z}function Ae(n,r){let u=null,$=null;const Z=()=>{if(u=null,$===null)return;const ie=$;$=null,n(...ie),Q()},Q=()=>{u=setTimeout(Z,r),typeof u?.unref=="function"&&u.unref()},U=(...ie)=>{u===null?(n(...ie),Q()):($=ie,clearTimeout(u),Q())};return U.flush=()=>{if(u!==null&&clearTimeout(u),u=null,$===null)return;const ie=$;$=null,n(...ie)},U.cancel=()=>{u!==null&&clearTimeout(u),u=null,$=null},U.pending=()=>u!==null||$!==null,U}function je(n,r=50){return typeof requestIdleCallback=="function"?requestIdleCallback(n,{timeout:r}):setTimeout(()=>n({timeRemaining:()=>0,didTimeout:!0}),1)}let Ee=0;function Se(n="l"){return`${n}${(++Ee).toString(36)}`}}),Pe("packages/modules/dashboard/spec.js",function(y,ee){"use strict";Object.defineProperty(y,"PANEL_KINDS",{enumerable:!0,get:function(){return V}}),Object.defineProperty(y,"SOURCE_KINDS",{enumerable:!0,get:function(){return I}}),Object.defineProperty(y,"MAP_BINDINGS",{enumerable:!0,get:function(){return A}}),Object.defineProperty(y,"GRID_REF",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(y,"isPlain",{enumerable:!0,get:function(){return b}}),Object.defineProperty(y,"copySpec",{enumerable:!0,get:function(){return x}}),Object.defineProperty(y,"sameSpec",{enumerable:!0,get:function(){return de}}),Object.defineProperty(y,"parseSourceRef",{enumerable:!0,get:function(){return se}}),Object.defineProperty(y,"readRelation",{enumerable:!0,get:function(){return G}}),Object.defineProperty(y,"inspectSpec",{enumerable:!0,get:function(){return k}}),Object.defineProperty(y,"validateDashboardSpec",{enumerable:!0,get:function(){return j}});const V=Object.freeze(["grid","chart","kpi","calendar","map","html"]),I=Object.freeze(["rows","pushdown","router","grid"]),A=Object.freeze(["chart","leaflet","deckgl"]),F=Object.freeze(["layout","panels","sources","links"]),fe=Object.freeze(["id","kind","title","source","options","binding"]),ne=Object.freeze(["from","to","on"]),W=Object.freeze({rows:["kind","rows","columns","rowKey"],router:["kind","router","predicate","route","columns","rowKey"],grid:["kind","of"]}),ae="grid:";function b(f){if(!f||typeof f!="object"||Array.isArray(f))return!1;const m=Object.getPrototypeOf(f);return m===Object.prototype||m===null}function x(f,m){if(m==="rows"&&Array.isArray(f))return f;if(Array.isArray(f))return f.map(C=>x(C));if(!b(f)||Object.values(f).some(C=>typeof C=="function"))return f;const z={};for(const[C,S]of Object.entries(f))S!==void 0&&(z[C]=x(S,C));return z}function de(f,m){if(f===m)return!0;if(Array.isArray(f)||Array.isArray(m))return!Array.isArray(f)||!Array.isArray(m)||f.length!==m.length?!1:f.every((S,X)=>de(S,m[X]));if(!b(f)||!b(m))return!1;const z=Object.keys(f).filter(S=>f[S]!==void 0),C=Object.keys(m).filter(S=>m[S]!==void 0);return z.length!==C.length?!1:z.every(S=>de(f[S],m[S]))}function se(f){return typeof f!="string"||f===""?null:f.startsWith(ae)?{kind:"grid",of:f.slice(ae.length)}:{kind:"named",id:f}}function G(f){return typeof f=="string"&&f!==""?{from:f,to:f}:typeof f=="function"?f:b(f)&&typeof f.from=="string"&&f.from!==""&&typeof f.to=="string"&&f.to!==""?{from:f.from,to:f.to}:null}function k(f){const m=[],z=new Set,C=new Set,S=new Set,X=new Set,D={fatal:null,problems:m,badPanels:z,badSources:C,badLinks:S,badWindows:X};if(!b(f))return D.fatal="the spec is not an object",m.push({path:"",message:"is not an object: a spec is { layout, panels, sources, links }"}),D;const R=f;if(!Array.isArray(R.panels))return D.fatal="spec.panels is not an array",m.push({path:"panels",message:"is not an array of panels"}),D;for(const c of Object.keys(R))F.includes(c)||m.push({path:c,message:`is not a dashboard spec key (${F.join(", ")})`});const P=new Map;R.panels.forEach((c,h)=>{const a=`panels[${h}]`;if(!b(c)){z.add(h),m.push({path:a,message:"is not an object"});return}if(typeof c.id!="string"||c.id===""){z.add(h),m.push({path:`${a}.id`,message:"is missing: every panel needs a unique string id"});return}if(P.has(c.id)){z.add(h),m.push({path:`${a}.id`,panel:c.id,message:`repeats "${c.id}", which panels[${P.get(c.id).index}] already uses`});return}P.set(c.id,{index:h,kind:c.kind})});const N=R.sources===void 0?{}:R.sources;if(!b(N))m.push({path:"sources",message:"is not an object of named sources"});else for(const[c,h]of Object.entries(N)){const a=`sources.${c}`,d=(w,M)=>{C.add(c),m.push({path:w,message:M})};if(!b(h)){d(a,"is not an object");continue}if(!I.includes(h.kind)){d(`${a}.kind`,`names no source kind (${I.join(", ")})`);continue}const l=W[h.kind];if(l)for(const w of Object.keys(h))l.includes(w)||m.push({path:`${a}.${w}`,message:`is not a key of a ${h.kind} source (${l.join(", ")})`});if(h.columns!==void 0&&!Array.isArray(h.columns)&&d(`${a}.columns`,"is not an array of columns"),h.kind==="rows"&&!Array.isArray(h.rows)&&d(`${a}.rows`,"is not an array of rows"),h.kind==="pushdown"&&!(h.adapter&&typeof h.adapter.execute=="function")&&d(`${a}.adapter`,"is not a pushdown adapter (an object with execute())"),h.kind==="router"&&(h.router&&typeof h.router.attach=="function"||d(`${a}.router`,"is not a Data Router (an object with attach())"),h.predicate===void 0&&d(`${a}.predicate`,"is missing: name the partition value or predicate the route matches")),h.kind==="grid"){const w=typeof h.of=="string"?P.get(h.of):void 0;w?w.kind!=="grid"&&d(`${a}.of`,`names "${h.of}", a ${w.kind} panel: only a grid panel has a grid to view`):d(`${a}.of`,"names no panel")}}const E=new Map;R.panels.forEach((c,h)=>{if(z.has(h))return;const a=`panels[${h}]`,d=(M,te)=>{z.add(h),m.push({path:M,panel:c.id,message:te})};for(const M of Object.keys(c))fe.includes(M)||m.push({path:`${a}.${M}`,panel:c.id,message:`is not a panel key (${fe.join(", ")}); a viewer's own settings go in options`});if(!V.includes(c.kind)){d(`${a}.kind`,`names no panel kind (${V.join(", ")})`);return}if(c.title!==void 0&&typeof c.title!="string"&&m.push({path:`${a}.title`,panel:c.id,message:"is not a string"}),c.options!==void 0&&!b(c.options)){d(`${a}.options`,"is not an object");return}if(c.binding!==void 0&&(c.kind!=="map"?d(`${a}.binding`,`is only read on a map panel, and this is a ${c.kind} panel`):A.includes(c.binding)||d(`${a}.binding`,`names no map binding (${A.join(", ")})`)),c.source===void 0){(c.kind==="chart"||c.kind==="map"||c.kind==="calendar")&&d(`${a}.source`,`is missing: a ${c.kind} panel draws a source's rows`);return}if(c.kind==="html"){d(`${a}.source`,"is set on an html panel, which reads no rows");return}const l=se(c.source);if(!l){d(`${a}.source`,"is not a source id");return}let w=null;if(l.kind==="grid")w=l.of;else if(!b(N)||!Object.hasOwn(N,l.id)){d(`${a}.source`,`names "${l.id}", which is not in sources`);return}else if(C.has(l.id)){d(`${a}.source`,`names "${l.id}", a source that is not usable`);return}else N[l.id].kind==="grid"&&(w=N[l.id].of);if(w!==null){const M=P.get(w);if(!M){d(`${a}.source`,`views the grid of "${w}", which is not a panel`);return}if(M.kind!=="grid"){d(`${a}.source`,`views the grid of "${w}", a ${M.kind} panel`);return}if(w===c.id){d(`${a}.source`,"views its own grid");return}E.set(c.id,w)}});for(let c=!0;c;)c=!1,R.panels.forEach((h,a)=>{if(z.has(a)||!E.has(h.id))return;const d=new Set([h.id]);let l=E.get(h.id);for(;l!==void 0;){const w=P.get(l);if(d.has(l)){z.add(a),m.push({path:`panels[${a}].source`,panel:h.id,message:`is part of a cycle of panels viewing each other's grids (${[...d,l].join(" -> ")})`}),c=!0;return}if(!w||z.has(w.index)){z.add(a),m.push({path:`panels[${a}].source`,panel:h.id,message:`views the grid of "${l}", a panel that was not built`}),c=!0;return}d.add(l),l=E.get(l)}});if(R.links!==void 0&&!Array.isArray(R.links)?m.push({path:"links",message:"is not an array of links"}):(R.links||[]).forEach((c,h)=>{const a=`links[${h}]`,d=(l,w)=>{S.add(h),m.push({path:l,link:h,message:w})};if(!b(c)){d(a,"is not an object");return}for(const l of Object.keys(c))ne.includes(l)||m.push({path:`${a}.${l}`,link:h,message:`is not a link key (${ne.join(", ")})`});if(typeof c.from!="string"||!P.has(c.from)){d(`${a}.from`,"names no panel");return}if(typeof c.to!="string"||!P.has(c.to)){d(`${a}.to`,"names no panel");return}if(c.from===c.to){d(`${a}.to`,"is the panel the link starts from");return}G(c.on)||d(`${a}.on`,"is not a column name, a { from, to } pair of column names, or a relation function")}),R.layout!==void 0){if(!b(R.layout))m.push({path:"layout",message:"is not an object"});else if(R.layout.windows!==void 0)if(!Array.isArray(R.layout.windows))m.push({path:"layout.windows",message:"is not an array of windows"});else{const c=new Set;R.layout.windows.forEach((h,a)=>{const d=`layout.windows[${a}]`;!b(h)||typeof h.id!="string"?(X.add(a),m.push({path:d,message:"is not a window with a string id"})):P.has(h.id)?c.has(h.id)?(X.add(a),m.push({path:`${d}.id`,message:`places "${h.id}" a second time`})):c.add(h.id):(X.add(a),m.push({path:`${d}.id`,message:`names "${h.id}", which is not a panel`}))})}}return D}function j(f){const{problems:m}=k(f);return{ok:m.length===0,problems:m.map(({path:z,message:C})=>({path:z,message:C}))}}}),Pe("packages/modules/dashboard/propose.js",function(y,ee){"use strict";Object.defineProperty(y,"PROPOSE_SYSTEM",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(y,"columnRefs",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(y,"proposalRequest",{enumerable:!0,get:function(){return b}}),Object.defineProperty(y,"parseProposal",{enumerable:!0,get:function(){return de}}),Object.defineProperty(y,"checkProposal",{enumerable:!0,get:function(){return se}});const V=ee("packages/modules/dashboard/spec.js"),I=V.inspectSpec,A=V.isPlain,F=V.copySpec,fe=V.parseSourceRef,ne=["You design dashboards for a data grid. Return ONLY a JSON object of the form",'{ "layout": { "columns": <n>, "rows": <n> }, "panels": [ { "id": "<id>", "kind": "<kind>",','"title": "<title>", "source": "<source id>", "binding": "chart", "options": { ... } } ],','"links": [ { "from": "<grid panel id>", "to": "<panel id>", "on": "<column>" } ] }.',"Use only the panel kinds and the columns listed in SCHEMA, and only the source it names.","A chart panel's options are a chart spec (type, x, y, series); a kpi panel's are",'{ tiles: [ { id, field, aggregation } ] }; a map panel with binding "chart" takes a map chart',`spec (type "markermap", lon, lat); a grid panel's are { columns: [ { field } ] }.`,"A person reviews the proposal before anything is built."].join(" "),W=Object.freeze(["x","y","series","measure","size","value","volume","lon","lat","geometry","label","start","end","source","target","multiples"]);function ae(G){const k=new Set,j=A(G.options)?G.options:{},f=m=>{typeof m=="string"&&m!==""&&k.add(m)};if(G.kind==="grid")for(const m of Array.isArray(j.columns)?j.columns:[])A(m)&&f(m.field);else if(G.kind==="kpi"){for(const m of Array.isArray(j.tiles)?j.tiles:[])A(m)&&f(m.field);for(const m of Array.isArray(j.fields)?j.fields:[])f(m)}else if(G.kind==="chart"||G.kind==="map"&&(G.binding||"chart")==="chart")for(const m of W)f(j[m]);else G.kind==="map"&&A(j.position)&&(f(j.position.lon),f(j.position.lat),f(j.position.geometry));return[...k]}function b(G,k){const j={source:k.source,columns:k.columns,kinds:k.kinds};let f=`${G}
|
|
6
|
+
(function(Te){"use strict";var Ie=Object.create(null),ze=Object.create(null);function Pe(y,ee){Ie[y]=ee}function Ke(y){var ee=ze[y];if(ee)return ee;var V=Object.create(null);ze[y]=V;var I=Ie[y];if(!I)throw new Error("[lattice] missing module: "+y);return I(V,Ke),V}Pe("packages/core/src/internal/util.js",function(y,ee){"use strict";Object.defineProperty(y,"VERSION",{enumerable:!0,get:function(){return A}}),Object.defineProperty(y,"reportedWarnings",{enumerable:!0,get:function(){return de}}),Object.defineProperty(y,"warnOnce",{enumerable:!0,get:function(){return G}}),Object.defineProperty(y,"infoOnce",{enumerable:!0,get:function(){return k}}),Object.defineProperty(y,"resetWarnings",{enumerable:!0,get:function(){return j}}),Object.defineProperty(y,"fail",{enumerable:!0,get:function(){return f}}),Object.defineProperty(y,"invariant",{enumerable:!0,get:function(){return m}}),Object.defineProperty(y,"DEV",{enumerable:!0,get:function(){return z}}),Object.defineProperty(y,"isObject",{enumerable:!0,get:function(){return C}}),Object.defineProperty(y,"isFunction",{enumerable:!0,get:function(){return S}}),Object.defineProperty(y,"isNil",{enumerable:!0,get:function(){return X}}),Object.defineProperty(y,"isBlank",{enumerable:!0,get:function(){return D}}),Object.defineProperty(y,"isCtor",{enumerable:!0,get:function(){return R}}),Object.defineProperty(y,"pathGetter",{enumerable:!0,get:function(){return N}}),Object.defineProperty(y,"pathSetter",{enumerable:!0,get:function(){return c}}),Object.defineProperty(y,"getPath",{enumerable:!0,get:function(){return h}}),Object.defineProperty(y,"setPath",{enumerable:!0,get:function(){return a}}),Object.defineProperty(y,"humanise",{enumerable:!0,get:function(){return d}}),Object.defineProperty(y,"escapeHtml",{enumerable:!0,get:function(){return w}}),Object.defineProperty(y,"titleCase",{enumerable:!0,get:function(){return M}}),Object.defineProperty(y,"expand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(y,"toArray",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(y,"merge",{enumerable:!0,get:function(){return me}}),Object.defineProperty(y,"mergeRow",{enumerable:!0,get:function(){return be}}),Object.defineProperty(y,"Lru",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(y,"collator",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(y,"defaultCompare",{enumerable:!0,get:function(){return re}}),Object.defineProperty(y,"now",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(y,"nextFrame",{enumerable:!0,get:function(){return we}}),Object.defineProperty(y,"cancelFrame",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(y,"frameBatched",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(y,"settleDebounce",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(y,"whenIdle",{enumerable:!0,get:function(){return je}}),Object.defineProperty(y,"uid",{enumerable:!0,get:function(){return Se}});const V="1.89.1";async function I(){return V}const A="1.89.1",F=new Set,fe=2e3;function ne(n){if(F.add(n),F.size>fe){const r=F.values().next().value;r!==void 0&&F.delete(r)}}const W=[],ae=500;function b(n,r,u){W.push({key:n,level:r,message:u.map($=>typeof $=="string"?$:x($)).join(" "),at:Date.now()}),W.length>ae&&W.shift()}function x(n){if(n instanceof Error)return n.message;try{return JSON.stringify(n)}catch{return String(n)}}function de(){return W.map(n=>({...n}))}function se(n){if(n.length===0||typeof n[0]!="string")return n;const r=n[0].replace(/^\[lattice\]\s*/,"");return r===n[0]?n:[r,...n.slice(1)]}function G(n,...r){if(F.has(n))return;ne(n);const u=se(r);b(n,"warn",u),console.warn("[lattice]",...u)}function k(n,...r){if(F.has(n))return;ne(n);const u=se(r);b(n,"info",u),console.info("[lattice]",...u)}function j(){F.clear(),W.length=0}function f(n,r){const u=new Error(`[lattice] ${n}`);throw r!==void 0&&(u.cause=r),u}function m(n,r){n||f(r)}const z=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function C(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function S(n){return typeof n=="function"}function X(n){return n==null}function D(n){return n==null||n===""}function R(n){return typeof n!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(n))?!0:!!(n.prototype&&Object.getOwnPropertyNames(n.prototype).length>1)}const P=new Map;function N(n){let r=P.get(n);if(r)return r;if(!n.includes("."))r=u=>u?.[n];else{const u=n.split("."),$=u.length;r=Z=>{let Q=Z;for(let U=0;U<$;U++){if(Q==null)return;Q=Q[u[U]]}return Q}}return P.set(n,r),r}const E=new Map;function c(n){let r=E.get(n);if(r)return r;if(!n.includes("."))r=(u,$)=>{u!=null&&(u[n]=$)};else{const u=n.split("."),$=u.length-1;r=(Z,Q)=>{let U=Z;for(let ie=0;ie<$;ie++){if(U==null)return;const ke=u[ie];U[ke]==null&&(U[ke]={}),U=U[ke]}U!=null&&(U[u[$]]=Q)}}return E.set(n,r),r}function h(n,r){return N(r)(n)}function a(n,r,u){c(r)(n,u)}function d(n){return n?(n.includes(".")?n.slice(n.lastIndexOf(".")+1):n).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(/^./,u=>u.toUpperCase()):""}const l={"&":"&","<":"<",">":">",'"':""","'":"'"};function w(n){const r=n==null?"":String(n);return/[&<>"']/.test(r)?r.replace(/[&<>"']/g,u=>l[u]):r}function M(n){return String(n).replace(/\w\S*/g,r=>r[0].toUpperCase()+r.slice(1).toLowerCase())}function te(n,r,u){if(n!==void 0)return n===!0?{enabled:!0,...u}:n===!1?{enabled:!1}:C(n)?n:{[r]:n,enabled:!0}}function oe(n){return n==null?[]:Array.isArray(n)?n:[n]}const $e=Object.freeze(new Set(["__proto__","constructor","prototype"]));function me(n,r){if(!C(n))return C(r)?{...r}:r;if(!C(r))return r===void 0?n:r;const u={...n};for(const $ of Object.keys(r)){if($e.has($))continue;const Z=r[$];Z!==void 0&&(u[$]=C(Z)&&C(u[$])?me(u[$],Z):Z)}return u}function be(n,r){if(!C(n)||!C(r)||n===r)return r;const u=Object.create(Object.getPrototypeOf(n));return Object.assign(u,n,r),u}class Y{#t;#e=new Map;#n;constructor(r=256,u=null){this.#t=r,this.#n=u}get size(){return this.#e.size}get max(){return this.#t}set max(r){this.#t=r,this.#r()}has(r){return this.#e.has(r)}get(r){const u=this.#e;if(!u.has(r))return;const $=u.get(r);return u.delete(r),u.set(r,$),$}peek(r){return this.#e.get(r)}set(r,u){const $=this.#e;return $.has(r)&&$.delete(r),$.set(r,u),this.#r(),u}delete(r){const u=this.#e.get(r);return this.#e.delete(r)&&this.#n&&this.#n(u,r),u}clear(){if(this.#n)for(const[r,u]of this.#e)this.#n(u,r);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const r=this.#e;for(;r.size>this.#t;){const u=r.keys().next().value,$=r.get(u);r.delete(u),this.#n&&this.#n($,u)}}}const le=new Map;function Re(n,r){const u=`${n||""}|${r?JSON.stringify(r):""}`;let $=le.get(u);return $||($=new Intl.Collator(n||void 0,{numeric:!0,sensitivity:"variant",...r}),le.set(u,$)),$}function re(n,r){if(n===r)return 0;if(n==null)return 1;if(r==null)return-1;if(typeof n=="number"&&typeof r=="number")return Number.isNaN(n)?Number.isNaN(r)?0:1:Number.isNaN(r)||n<r?-1:n>r?1:0;const u=String(n),$=String(r);return u<$?-1:u>$?1:0}function ye(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const Oe=typeof requestAnimationFrame=="function";function we(n){return Oe?requestAnimationFrame(n):setTimeout(()=>n(ye()),16)}function pe(n){n!=null&&(Oe?cancelAnimationFrame(n):clearTimeout(n))}function Le(n){let r=null,u=null;const $=()=>{r=null;const Q=u;u=null,n(...Q||[])},Z=(...Q)=>{u=Q,r===null&&(r=we($))};return Z.cancel=()=>{pe(r),r=null,u=null},Z.flush=()=>{r!==null&&(pe(r),$())},Z}function Ae(n,r){let u=null,$=null;const Z=()=>{if(u=null,$===null)return;const ie=$;$=null,n(...ie),Q()},Q=()=>{u=setTimeout(Z,r),typeof u?.unref=="function"&&u.unref()},U=(...ie)=>{u===null?(n(...ie),Q()):($=ie,clearTimeout(u),Q())};return U.flush=()=>{if(u!==null&&clearTimeout(u),u=null,$===null)return;const ie=$;$=null,n(...ie)},U.cancel=()=>{u!==null&&clearTimeout(u),u=null,$=null},U.pending=()=>u!==null||$!==null,U}function je(n,r=50){return typeof requestIdleCallback=="function"?requestIdleCallback(n,{timeout:r}):setTimeout(()=>n({timeRemaining:()=>0,didTimeout:!0}),1)}let Ee=0;function Se(n="l"){return`${n}${(++Ee).toString(36)}`}}),Pe("packages/modules/dashboard/spec.js",function(y,ee){"use strict";Object.defineProperty(y,"PANEL_KINDS",{enumerable:!0,get:function(){return V}}),Object.defineProperty(y,"SOURCE_KINDS",{enumerable:!0,get:function(){return I}}),Object.defineProperty(y,"MAP_BINDINGS",{enumerable:!0,get:function(){return A}}),Object.defineProperty(y,"GRID_REF",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(y,"isPlain",{enumerable:!0,get:function(){return b}}),Object.defineProperty(y,"copySpec",{enumerable:!0,get:function(){return x}}),Object.defineProperty(y,"sameSpec",{enumerable:!0,get:function(){return de}}),Object.defineProperty(y,"parseSourceRef",{enumerable:!0,get:function(){return se}}),Object.defineProperty(y,"readRelation",{enumerable:!0,get:function(){return G}}),Object.defineProperty(y,"inspectSpec",{enumerable:!0,get:function(){return k}}),Object.defineProperty(y,"validateDashboardSpec",{enumerable:!0,get:function(){return j}});const V=Object.freeze(["grid","chart","kpi","calendar","map","html"]),I=Object.freeze(["rows","pushdown","router","grid"]),A=Object.freeze(["chart","leaflet","deckgl"]),F=Object.freeze(["layout","panels","sources","links"]),fe=Object.freeze(["id","kind","title","source","options","binding"]),ne=Object.freeze(["from","to","on"]),W=Object.freeze({rows:["kind","rows","columns","rowKey"],router:["kind","router","predicate","route","columns","rowKey"],grid:["kind","of"]}),ae="grid:";function b(f){if(!f||typeof f!="object"||Array.isArray(f))return!1;const m=Object.getPrototypeOf(f);return m===Object.prototype||m===null}function x(f,m){if(m==="rows"&&Array.isArray(f))return f;if(Array.isArray(f))return f.map(C=>x(C));if(!b(f)||Object.values(f).some(C=>typeof C=="function"))return f;const z={};for(const[C,S]of Object.entries(f))S!==void 0&&(z[C]=x(S,C));return z}function de(f,m){if(f===m)return!0;if(Array.isArray(f)||Array.isArray(m))return!Array.isArray(f)||!Array.isArray(m)||f.length!==m.length?!1:f.every((S,X)=>de(S,m[X]));if(!b(f)||!b(m))return!1;const z=Object.keys(f).filter(S=>f[S]!==void 0),C=Object.keys(m).filter(S=>m[S]!==void 0);return z.length!==C.length?!1:z.every(S=>de(f[S],m[S]))}function se(f){return typeof f!="string"||f===""?null:f.startsWith(ae)?{kind:"grid",of:f.slice(ae.length)}:{kind:"named",id:f}}function G(f){return typeof f=="string"&&f!==""?{from:f,to:f}:typeof f=="function"?f:b(f)&&typeof f.from=="string"&&f.from!==""&&typeof f.to=="string"&&f.to!==""?{from:f.from,to:f.to}:null}function k(f){const m=[],z=new Set,C=new Set,S=new Set,X=new Set,D={fatal:null,problems:m,badPanels:z,badSources:C,badLinks:S,badWindows:X};if(!b(f))return D.fatal="the spec is not an object",m.push({path:"",message:"is not an object: a spec is { layout, panels, sources, links }"}),D;const R=f;if(!Array.isArray(R.panels))return D.fatal="spec.panels is not an array",m.push({path:"panels",message:"is not an array of panels"}),D;for(const c of Object.keys(R))F.includes(c)||m.push({path:c,message:`is not a dashboard spec key (${F.join(", ")})`});const P=new Map;R.panels.forEach((c,h)=>{const a=`panels[${h}]`;if(!b(c)){z.add(h),m.push({path:a,message:"is not an object"});return}if(typeof c.id!="string"||c.id===""){z.add(h),m.push({path:`${a}.id`,message:"is missing: every panel needs a unique string id"});return}if(P.has(c.id)){z.add(h),m.push({path:`${a}.id`,panel:c.id,message:`repeats "${c.id}", which panels[${P.get(c.id).index}] already uses`});return}P.set(c.id,{index:h,kind:c.kind})});const N=R.sources===void 0?{}:R.sources;if(!b(N))m.push({path:"sources",message:"is not an object of named sources"});else for(const[c,h]of Object.entries(N)){const a=`sources.${c}`,d=(w,M)=>{C.add(c),m.push({path:w,message:M})};if(!b(h)){d(a,"is not an object");continue}if(!I.includes(h.kind)){d(`${a}.kind`,`names no source kind (${I.join(", ")})`);continue}const l=W[h.kind];if(l)for(const w of Object.keys(h))l.includes(w)||m.push({path:`${a}.${w}`,message:`is not a key of a ${h.kind} source (${l.join(", ")})`});if(h.columns!==void 0&&!Array.isArray(h.columns)&&d(`${a}.columns`,"is not an array of columns"),h.kind==="rows"&&!Array.isArray(h.rows)&&d(`${a}.rows`,"is not an array of rows"),h.kind==="pushdown"&&!(h.adapter&&typeof h.adapter.execute=="function")&&d(`${a}.adapter`,"is not a pushdown adapter (an object with execute())"),h.kind==="router"&&(h.router&&typeof h.router.attach=="function"||d(`${a}.router`,"is not a Data Router (an object with attach())"),h.predicate===void 0&&d(`${a}.predicate`,"is missing: name the partition value or predicate the route matches")),h.kind==="grid"){const w=typeof h.of=="string"?P.get(h.of):void 0;w?w.kind!=="grid"&&d(`${a}.of`,`names "${h.of}", a ${w.kind} panel: only a grid panel has a grid to view`):d(`${a}.of`,"names no panel")}}const E=new Map;R.panels.forEach((c,h)=>{if(z.has(h))return;const a=`panels[${h}]`,d=(M,te)=>{z.add(h),m.push({path:M,panel:c.id,message:te})};for(const M of Object.keys(c))fe.includes(M)||m.push({path:`${a}.${M}`,panel:c.id,message:`is not a panel key (${fe.join(", ")}); a viewer's own settings go in options`});if(!V.includes(c.kind)){d(`${a}.kind`,`names no panel kind (${V.join(", ")})`);return}if(c.title!==void 0&&typeof c.title!="string"&&m.push({path:`${a}.title`,panel:c.id,message:"is not a string"}),c.options!==void 0&&!b(c.options)){d(`${a}.options`,"is not an object");return}if(c.binding!==void 0&&(c.kind!=="map"?d(`${a}.binding`,`is only read on a map panel, and this is a ${c.kind} panel`):A.includes(c.binding)||d(`${a}.binding`,`names no map binding (${A.join(", ")})`)),c.source===void 0){(c.kind==="chart"||c.kind==="map"||c.kind==="calendar")&&d(`${a}.source`,`is missing: a ${c.kind} panel draws a source's rows`);return}if(c.kind==="html"){d(`${a}.source`,"is set on an html panel, which reads no rows");return}const l=se(c.source);if(!l){d(`${a}.source`,"is not a source id");return}let w=null;if(l.kind==="grid")w=l.of;else if(!b(N)||!Object.hasOwn(N,l.id)){d(`${a}.source`,`names "${l.id}", which is not in sources`);return}else if(C.has(l.id)){d(`${a}.source`,`names "${l.id}", a source that is not usable`);return}else N[l.id].kind==="grid"&&(w=N[l.id].of);if(w!==null){const M=P.get(w);if(!M){d(`${a}.source`,`views the grid of "${w}", which is not a panel`);return}if(M.kind!=="grid"){d(`${a}.source`,`views the grid of "${w}", a ${M.kind} panel`);return}if(w===c.id){d(`${a}.source`,"views its own grid");return}E.set(c.id,w)}});for(let c=!0;c;)c=!1,R.panels.forEach((h,a)=>{if(z.has(a)||!E.has(h.id))return;const d=new Set([h.id]);let l=E.get(h.id);for(;l!==void 0;){const w=P.get(l);if(d.has(l)){z.add(a),m.push({path:`panels[${a}].source`,panel:h.id,message:`is part of a cycle of panels viewing each other's grids (${[...d,l].join(" -> ")})`}),c=!0;return}if(!w||z.has(w.index)){z.add(a),m.push({path:`panels[${a}].source`,panel:h.id,message:`views the grid of "${l}", a panel that was not built`}),c=!0;return}d.add(l),l=E.get(l)}});if(R.links!==void 0&&!Array.isArray(R.links)?m.push({path:"links",message:"is not an array of links"}):(R.links||[]).forEach((c,h)=>{const a=`links[${h}]`,d=(l,w)=>{S.add(h),m.push({path:l,link:h,message:w})};if(!b(c)){d(a,"is not an object");return}for(const l of Object.keys(c))ne.includes(l)||m.push({path:`${a}.${l}`,link:h,message:`is not a link key (${ne.join(", ")})`});if(typeof c.from!="string"||!P.has(c.from)){d(`${a}.from`,"names no panel");return}if(typeof c.to!="string"||!P.has(c.to)){d(`${a}.to`,"names no panel");return}if(c.from===c.to){d(`${a}.to`,"is the panel the link starts from");return}G(c.on)||d(`${a}.on`,"is not a column name, a { from, to } pair of column names, or a relation function")}),R.layout!==void 0){if(!b(R.layout))m.push({path:"layout",message:"is not an object"});else if(R.layout.windows!==void 0)if(!Array.isArray(R.layout.windows))m.push({path:"layout.windows",message:"is not an array of windows"});else{const c=new Set;R.layout.windows.forEach((h,a)=>{const d=`layout.windows[${a}]`;!b(h)||typeof h.id!="string"?(X.add(a),m.push({path:d,message:"is not a window with a string id"})):P.has(h.id)?c.has(h.id)?(X.add(a),m.push({path:`${d}.id`,message:`places "${h.id}" a second time`})):c.add(h.id):(X.add(a),m.push({path:`${d}.id`,message:`names "${h.id}", which is not a panel`}))})}}return D}function j(f){const{problems:m}=k(f);return{ok:m.length===0,problems:m.map(({path:z,message:C})=>({path:z,message:C}))}}}),Pe("packages/modules/dashboard/propose.js",function(y,ee){"use strict";Object.defineProperty(y,"PROPOSE_SYSTEM",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(y,"columnRefs",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(y,"proposalRequest",{enumerable:!0,get:function(){return b}}),Object.defineProperty(y,"parseProposal",{enumerable:!0,get:function(){return de}}),Object.defineProperty(y,"checkProposal",{enumerable:!0,get:function(){return se}});const V=ee("packages/modules/dashboard/spec.js"),I=V.inspectSpec,A=V.isPlain,F=V.copySpec,fe=V.parseSourceRef,ne=["You design dashboards for a data grid. Return ONLY a JSON object of the form",'{ "layout": { "columns": <n>, "rows": <n> }, "panels": [ { "id": "<id>", "kind": "<kind>",','"title": "<title>", "source": "<source id>", "binding": "chart", "options": { ... } } ],','"links": [ { "from": "<grid panel id>", "to": "<panel id>", "on": "<column>" } ] }.',"Use only the panel kinds and the columns listed in SCHEMA, and only the source it names.","A chart panel's options are a chart spec (type, x, y, series); a kpi panel's are",'{ tiles: [ { id, field, aggregation } ] }; a map panel with binding "chart" takes a map chart',`spec (type "markermap", lon, lat); a grid panel's are { columns: [ { field } ] }.`,"A person reviews the proposal before anything is built."].join(" "),W=Object.freeze(["x","y","series","measure","size","value","volume","lon","lat","geometry","label","start","end","source","target","multiples"]);function ae(G){const k=new Set,j=A(G.options)?G.options:{},f=m=>{typeof m=="string"&&m!==""&&k.add(m)};if(G.kind==="grid")for(const m of Array.isArray(j.columns)?j.columns:[])A(m)&&f(m.field);else if(G.kind==="kpi"){for(const m of Array.isArray(j.tiles)?j.tiles:[])A(m)&&f(m.field);for(const m of Array.isArray(j.fields)?j.fields:[])f(m)}else if(G.kind==="chart"||G.kind==="map"&&(G.binding||"chart")==="chart")for(const m of W)f(j[m]);else G.kind==="map"&&A(j.position)&&(f(j.position.lon),f(j.position.lat),f(j.position.geometry));return[...k]}function b(G,k){const j={source:k.source,columns:k.columns,kinds:k.kinds};let f=`${G}
|
|
7
7
|
|
|
8
8
|
SCHEMA
|
|
9
9
|
${JSON.stringify(j)}`;k.rows&&(f+=`
|