@malloydata/render 0.0.352 → 0.0.353
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/dist/module/index.mjs +110 -87
- package/dist/module/index.umd.js +2 -2
- package/package.json +5 -5
package/dist/module/index.mjs
CHANGED
|
@@ -7049,6 +7049,12 @@ ${n}}`, i;
|
|
|
7049
7049
|
if (!(i === void 0 || Array.isArray(i)))
|
|
7050
7050
|
return i instanceof Date ? i.toISOString() : String(i);
|
|
7051
7051
|
}
|
|
7052
|
+
scalarType(...t) {
|
|
7053
|
+
var n;
|
|
7054
|
+
const i = t.length > 0 ? (n = this.find(t)) === null || n === void 0 ? void 0 : n.getEq() : this.getEq();
|
|
7055
|
+
if (!(i === void 0 || Array.isArray(i)))
|
|
7056
|
+
return i instanceof Date ? "date" : typeof i;
|
|
7057
|
+
}
|
|
7052
7058
|
numeric(...t) {
|
|
7053
7059
|
var n;
|
|
7054
7060
|
const i = (n = this.find(t)) === null || n === void 0 ? void 0 : n.getEq();
|
|
@@ -13665,7 +13671,7 @@ class Eq {
|
|
|
13665
13671
|
* Called during registerFields for each field.
|
|
13666
13672
|
*/
|
|
13667
13673
|
validateFieldTags(t) {
|
|
13668
|
-
var
|
|
13674
|
+
var m;
|
|
13669
13675
|
const n = t.tag, i = pD(t), r = this.logCollector, s = [
|
|
13670
13676
|
"viz",
|
|
13671
13677
|
"bar_chart",
|
|
@@ -13677,10 +13683,10 @@ class Eq {
|
|
|
13677
13683
|
"transpose",
|
|
13678
13684
|
"table"
|
|
13679
13685
|
], a = [cn.RepeatedRecord, cn.Record];
|
|
13680
|
-
for (const
|
|
13681
|
-
n.has(
|
|
13682
|
-
`Tag '${
|
|
13683
|
-
n.tag(
|
|
13686
|
+
for (const p of s)
|
|
13687
|
+
n.has(p) && !a.includes(i) && r.error(
|
|
13688
|
+
`Tag '${p}' on field '${t.name}' requires a nested query, but field is ${i}`,
|
|
13689
|
+
n.tag(p)
|
|
13684
13690
|
);
|
|
13685
13691
|
n.has("link") && i !== cn.String && r.error(
|
|
13686
13692
|
`Tag 'link' on field '${t.name}' requires a string field, but field is ${i}`,
|
|
@@ -13690,42 +13696,47 @@ class Eq {
|
|
|
13690
13696
|
n.tag("image")
|
|
13691
13697
|
);
|
|
13692
13698
|
const o = ["number", "currency", "percent", "duration"];
|
|
13693
|
-
for (const
|
|
13694
|
-
n.has(
|
|
13695
|
-
!(
|
|
13696
|
-
`Tag '${
|
|
13697
|
-
n.tag(
|
|
13699
|
+
for (const p of o)
|
|
13700
|
+
n.has(p) && i !== cn.Number && i !== cn.Array && // number tag is also valid on date/timestamp for format strings
|
|
13701
|
+
!(p === "number" && (i === cn.Date || i === cn.Timestamp)) && r.error(
|
|
13702
|
+
`Tag '${p}' on field '${t.name}' requires a numeric field, but field is ${i}`,
|
|
13703
|
+
n.tag(p)
|
|
13698
13704
|
);
|
|
13699
|
-
const l = n.
|
|
13700
|
-
|
|
13701
|
-
|
|
13702
|
-
|
|
13703
|
-
|
|
13705
|
+
const l = n.tag("number");
|
|
13706
|
+
(l == null ? void 0 : l.scalarType()) === "number" && r.error(
|
|
13707
|
+
`Tag 'number' on field '${t.name}' has a bare numeric value. Use a quoted format string instead, e.g. # number="#,##0.00"`,
|
|
13708
|
+
l
|
|
13709
|
+
);
|
|
13710
|
+
const u = n.text("viz");
|
|
13711
|
+
if (u !== void 0) {
|
|
13712
|
+
const p = ["bar", "line", "table", "dashboard"];
|
|
13713
|
+
p.includes(u) || r.error(
|
|
13714
|
+
`Invalid viz type '${u}' on field '${t.name}'. Valid types: ${p.join(", ")}`,
|
|
13704
13715
|
n.tag("viz")
|
|
13705
13716
|
);
|
|
13706
13717
|
}
|
|
13707
|
-
const
|
|
13708
|
-
if (
|
|
13709
|
-
const
|
|
13710
|
-
!
|
|
13711
|
-
`Unknown size '${
|
|
13718
|
+
const c = n.text("size");
|
|
13719
|
+
if (c !== void 0) {
|
|
13720
|
+
const p = ["fill", "spark", "xs", "sm", "md", "lg", "xl", "2xl"];
|
|
13721
|
+
!p.includes(c) && !((m = n.tag("size")) != null && m.has("width")) && r.warn(
|
|
13722
|
+
`Unknown size '${c}' on field '${t.name}'. Valid presets: ${p.join(", ")}`,
|
|
13712
13723
|
n.tag("size")
|
|
13713
13724
|
);
|
|
13714
13725
|
}
|
|
13715
13726
|
if (n.has("currency")) {
|
|
13716
|
-
const
|
|
13717
|
-
if (
|
|
13718
|
-
const
|
|
13719
|
-
|
|
13720
|
-
`Unknown currency '${
|
|
13727
|
+
const p = n.text("currency");
|
|
13728
|
+
if (p !== void 0) {
|
|
13729
|
+
const g = ["usd", "eur", "gbp", "euro", "pound"];
|
|
13730
|
+
p.match(/^(euro|pound|usd|eur|gbp)/i) || r.error(
|
|
13731
|
+
`Unknown currency '${p}' on field '${t.name}'. Valid codes: ${g.join(", ")}`,
|
|
13721
13732
|
n.tag("currency")
|
|
13722
13733
|
);
|
|
13723
13734
|
}
|
|
13724
13735
|
}
|
|
13725
13736
|
if (n.has("duration")) {
|
|
13726
|
-
const
|
|
13727
|
-
if (
|
|
13728
|
-
const
|
|
13737
|
+
const p = n.text("duration");
|
|
13738
|
+
if (p !== void 0) {
|
|
13739
|
+
const g = [
|
|
13729
13740
|
"nanoseconds",
|
|
13730
13741
|
"microseconds",
|
|
13731
13742
|
"milliseconds",
|
|
@@ -13734,88 +13745,100 @@ class Eq {
|
|
|
13734
13745
|
"hours",
|
|
13735
13746
|
"days"
|
|
13736
13747
|
];
|
|
13737
|
-
|
|
13738
|
-
`Unknown duration unit '${
|
|
13748
|
+
g.includes(p) || r.error(
|
|
13749
|
+
`Unknown duration unit '${p}' on field '${t.name}'. Valid units: ${g.join(", ")}`,
|
|
13739
13750
|
n.tag("duration")
|
|
13740
13751
|
);
|
|
13741
13752
|
}
|
|
13742
13753
|
}
|
|
13743
13754
|
if (t.isNest()) {
|
|
13744
|
-
const
|
|
13745
|
-
if (
|
|
13746
|
-
const
|
|
13747
|
-
for (const
|
|
13748
|
-
const
|
|
13749
|
-
|
|
13750
|
-
for (const
|
|
13751
|
-
|
|
13752
|
-
`Chart field reference '${
|
|
13753
|
-
|
|
13755
|
+
const p = n.tag("viz");
|
|
13756
|
+
if (p) {
|
|
13757
|
+
const g = new Set(t.fields.map((y) => y.name));
|
|
13758
|
+
for (const y of ["x", "y", "series"]) {
|
|
13759
|
+
const b = p.textArray(y), v = b ?? [], x = p.text(y);
|
|
13760
|
+
x && !b && v.push(x);
|
|
13761
|
+
for (const w of v)
|
|
13762
|
+
g.has(w) || r.error(
|
|
13763
|
+
`Chart field reference '${w}' for '${y}' on '${t.name}' does not match any field. Available fields: ${[...g].join(", ")}`,
|
|
13764
|
+
p.tag(y)
|
|
13754
13765
|
);
|
|
13755
13766
|
}
|
|
13756
13767
|
}
|
|
13757
13768
|
}
|
|
13758
|
-
const
|
|
13759
|
-
if (
|
|
13760
|
-
const
|
|
13761
|
-
if (
|
|
13762
|
-
const
|
|
13763
|
-
|
|
13764
|
-
`Unknown column width '${
|
|
13765
|
-
|
|
13769
|
+
const f = n.tag("column");
|
|
13770
|
+
if (f) {
|
|
13771
|
+
const p = f.text("width");
|
|
13772
|
+
if (p !== void 0) {
|
|
13773
|
+
const y = ["xs", "sm", "md", "lg", "xl", "2xl"];
|
|
13774
|
+
f.numeric("width") === void 0 && !y.includes(p) && r.warn(
|
|
13775
|
+
`Unknown column width '${p}' on field '${t.name}'. Valid presets: ${y.join(", ")}`,
|
|
13776
|
+
f.tag("width")
|
|
13766
13777
|
);
|
|
13767
13778
|
}
|
|
13768
|
-
const
|
|
13769
|
-
|
|
13770
|
-
`Unknown column word_break '${
|
|
13771
|
-
|
|
13779
|
+
const g = f.text("word_break");
|
|
13780
|
+
g !== void 0 && g !== "break_all" && r.error(
|
|
13781
|
+
`Unknown column word_break '${g}' on field '${t.name}'. Valid values: break_all`,
|
|
13782
|
+
f.tag("word_break")
|
|
13772
13783
|
);
|
|
13773
13784
|
}
|
|
13774
13785
|
if (t.isNest()) {
|
|
13775
|
-
const
|
|
13776
|
-
if (
|
|
13777
|
-
const
|
|
13778
|
-
if (
|
|
13779
|
-
const
|
|
13780
|
-
|
|
13781
|
-
`Invalid chart mode '${
|
|
13782
|
-
|
|
13786
|
+
const p = n.tag("viz");
|
|
13787
|
+
if (p) {
|
|
13788
|
+
const g = p.text("mode");
|
|
13789
|
+
if (g !== void 0) {
|
|
13790
|
+
const y = ["normal", "yoy"];
|
|
13791
|
+
y.includes(g) || r.error(
|
|
13792
|
+
`Invalid chart mode '${g}' on field '${t.name}'. Valid modes: ${y.join(", ")}`,
|
|
13793
|
+
p.tag("mode")
|
|
13783
13794
|
);
|
|
13784
13795
|
}
|
|
13785
13796
|
}
|
|
13786
13797
|
}
|
|
13787
|
-
const
|
|
13788
|
-
if (
|
|
13789
|
-
const
|
|
13790
|
-
if (
|
|
13791
|
-
const
|
|
13792
|
-
|
|
13793
|
-
`Invalid big_value size '${
|
|
13794
|
-
|
|
13798
|
+
const d = n.tag("big_value");
|
|
13799
|
+
if (d) {
|
|
13800
|
+
const p = d.text("size");
|
|
13801
|
+
if (p !== void 0) {
|
|
13802
|
+
const y = ["sm", "md", "lg"];
|
|
13803
|
+
y.includes(p) || r.error(
|
|
13804
|
+
`Invalid big_value size '${p}' on field '${t.name}'. Valid sizes: ${y.join(", ")}`,
|
|
13805
|
+
d.tag("size")
|
|
13795
13806
|
);
|
|
13796
13807
|
}
|
|
13797
|
-
const
|
|
13798
|
-
if (
|
|
13799
|
-
const
|
|
13800
|
-
|
|
13801
|
-
`Invalid big_value comparison_format '${
|
|
13802
|
-
|
|
13808
|
+
const g = d.text("comparison_format");
|
|
13809
|
+
if (g !== void 0) {
|
|
13810
|
+
const y = ["pct", "ppt"];
|
|
13811
|
+
y.includes(g) || r.error(
|
|
13812
|
+
`Invalid big_value comparison_format '${g}' on field '${t.name}'. Valid formats: ${y.join(", ")}`,
|
|
13813
|
+
d.tag("comparison_format")
|
|
13803
13814
|
);
|
|
13804
13815
|
}
|
|
13805
13816
|
}
|
|
13806
|
-
|
|
13807
|
-
|
|
13808
|
-
|
|
13809
|
-
|
|
13810
|
-
|
|
13811
|
-
g.
|
|
13812
|
-
|
|
13813
|
-
|
|
13817
|
+
if (n.has("big_value") && t.isNest()) {
|
|
13818
|
+
const p = t.fields.filter(
|
|
13819
|
+
(g) => g.isBasic() && g.wasDimension()
|
|
13820
|
+
);
|
|
13821
|
+
if (p.length > 0) {
|
|
13822
|
+
const g = p.map((y) => y.name).join(", ");
|
|
13823
|
+
r.error(
|
|
13824
|
+
`Tag 'big_value' on field '${t.name}' does not support group_by fields. Found dimensions: ${g}`,
|
|
13825
|
+
n.tag("big_value")
|
|
13814
13826
|
);
|
|
13815
13827
|
}
|
|
13816
|
-
|
|
13828
|
+
}
|
|
13829
|
+
const h = n.tag("number");
|
|
13830
|
+
if (h) {
|
|
13831
|
+
const p = h.text("scale");
|
|
13817
13832
|
if (p !== void 0) {
|
|
13818
|
-
const
|
|
13833
|
+
const y = ["k", "m", "b", "t", "q", "auto"];
|
|
13834
|
+
y.includes(p) || r.error(
|
|
13835
|
+
`Invalid number scale '${p}' on field '${t.name}'. Valid scales: ${y.join(", ")}`,
|
|
13836
|
+
h.tag("scale")
|
|
13837
|
+
);
|
|
13838
|
+
}
|
|
13839
|
+
const g = h.text("suffix");
|
|
13840
|
+
if (g !== void 0) {
|
|
13841
|
+
const y = [
|
|
13819
13842
|
"letter",
|
|
13820
13843
|
"lower",
|
|
13821
13844
|
"word",
|
|
@@ -13824,9 +13847,9 @@ class Eq {
|
|
|
13824
13847
|
"scientific",
|
|
13825
13848
|
"none"
|
|
13826
13849
|
];
|
|
13827
|
-
|
|
13828
|
-
`Invalid number suffix '${
|
|
13829
|
-
|
|
13850
|
+
y.includes(g) || r.error(
|
|
13851
|
+
`Invalid number suffix '${g}' on field '${t.name}'. Valid suffixes: ${y.join(", ")}`,
|
|
13852
|
+
h.tag("suffix")
|
|
13830
13853
|
);
|
|
13831
13854
|
}
|
|
13832
13855
|
}
|
package/dist/module/index.umd.js
CHANGED
|
@@ -43,7 +43,7 @@ ${n} `)}
|
|
|
43
43
|
${n} ]`:i+=`
|
|
44
44
|
${n} =: ${this.eq}`),this.properties)for(const r in this.properties)i+=`
|
|
45
45
|
${n} ${r}: ${this.properties[r].peek(t+2)}`;return i+=`
|
|
46
|
-
${n}}`,i}constructor(t={},n){if(this._read=!1,n!==void 0&&(this._parent=n),t.eq!==void 0&&(Array.isArray(t.eq)?this.eq=t.eq.map(i=>i instanceof it?i:new it(i,this)):this.eq=t.eq),t.properties){this.properties={};for(const[i,r]of Object.entries(t.properties))this.properties[i]=r instanceof it?r:new it(r,this)}t.deleted&&(this.deleted=t.deleted),t.prefix&&(this.prefix=t.prefix)}static withPrefix(t){return new it({prefix:t})}tag(...t){return this.find(t)}text(...t){var n;const i=(n=this.find(t))===null||n===void 0?void 0:n.getEq();if(!(i===void 0||Array.isArray(i)))return i instanceof Date?i.toISOString():String(i)}numeric(...t){var n;const i=(n=this.find(t))===null||n===void 0?void 0:n.getEq();if(typeof i=="number")return i;if(typeof i=="string"){const r=Number.parseFloat(i);if(!Number.isNaN(r))return r}}boolean(...t){var n;const i=(n=this.find(t))===null||n===void 0?void 0:n.getEq();if(typeof i=="boolean")return i}isTrue(...t){var n;return((n=this.find(t))===null||n===void 0?void 0:n.getEq())===!0}isFalse(...t){var n;return((n=this.find(t))===null||n===void 0?void 0:n.getEq())===!1}date(...t){var n;const i=(n=this.find(t))===null||n===void 0?void 0:n.getEq();if(i instanceof Date)return i}bare(...t){const n=this.find(t);if(n!==void 0)return!n.hasProperties()}getEq(){return this.eq}getProperty(t){var n;return(n=this.properties)===null||n===void 0?void 0:n[t]}getArrayElement(t){if(Array.isArray(this.eq)&&t<this.eq.length)return this.eq[t]}get dict(){var t;return(t=this.properties)!==null&&t!==void 0?t:{}}*entries(){if(this.properties)for(const t in this.properties)yield[t,this.properties[t]]}*keys(){if(this.properties)for(const t in this.properties)yield t}hasProperties(){return this.properties!==void 0&&Object.keys(this.properties).length>0}array(...t){const n=this.find(t);if(n===void 0)return;const i=n.getEq();if(Array.isArray(i))return i.map((r,s)=>n.getArrayElement(s))}textArray(...t){const n=this.find(t);if(n===void 0)return;const i=n.getEq();if(Array.isArray(i))return i.reduce((r,s,a)=>{const o=n.getArrayElement(a),l=o==null?void 0:o.getEq();return l===void 0||Array.isArray(l)?r:l instanceof Date?r.concat(l.toISOString()):r.concat(String(l))},[])}numericArray(...t){const n=this.find(t);if(n===void 0)return;const i=n.getEq();if(Array.isArray(i))return i.reduce((r,s,a)=>{const o=n.getArrayElement(a),l=o==null?void 0:o.getEq();if(typeof l=="number")return r.concat(l);if(typeof l=="string"){const u=Number.parseFloat(l);if(!Number.isNaN(u))return r.concat(u)}return r},[])}getProperties(){return this.properties===void 0&&(this.properties={}),this.properties}clone(t){const n=new it({},t);if(n.prefix=this.prefix,n.deleted=this.deleted,n.location=this.location,n._clonedFrom=this,this.eq!==void 0&&(Array.isArray(this.eq)?n.eq=this.eq.map(i=>i.clone(n)):n.eq=this.eq instanceof Date?new Date(this.eq):this.eq),this.properties){n.properties={};for(const[i,r]of Object.entries(this.properties))n.properties[i]=r.clone(n)}return n}static scalarToObject(t){return t}static tagToObject(t){const n=t.properties!==void 0&&Object.keys(t.properties).length>0,i=t.eq!==void 0;if(!i&&!n)return!0;if(!i&&n){const s={};for(const[a,o]of Object.entries(t.properties))o.deleted||(s[a]=it.tagToObject(o));return s}if(i&&!n)return Array.isArray(t.eq)?t.eq.map(s=>it.tagToObject(s)):it.scalarToObject(t.eq);const r={};Array.isArray(t.eq)?r["="]=t.eq.map(s=>it.tagToObject(s)):r["="]=it.scalarToObject(t.eq);for(const[s,a]of Object.entries(t.properties))a.deleted||(r[s]=it.tagToObject(a));return r}toObject(t=new Set){const n={};if(this.properties)for(const[i,r]of Object.entries(this.properties))r.deleted||(n[i]=r.toObjectValue(t));return n}toObjectValue(t){const n=this.properties!==void 0&&Object.keys(this.properties).length>0,i=this.eq!==void 0;if(!i&&!n)return!0;if(!i&&n)return this.toObject(t);if(i&&!n)return Array.isArray(this.eq)?this.eq.map(s=>s.toObjectValue(t)):this.eq;const r=this.toObject(t);return Array.isArray(this.eq)?r["="]=this.eq.map(s=>s.toObjectValue(t)):r["="]=this.eq,r}toJSON(){const t={};if(this.eq!==void 0&&(Array.isArray(this.eq)?t.eq=this.eq.map(n=>n.toJSON()):t.eq=this.eq),this.properties!==void 0){t.properties={};for(const[n,i]of Object.entries(this.properties))t.properties[n]=i.toJSON()}return this.deleted&&(t.deleted=!0),this.prefix&&(t.prefix=this.prefix),t}validateReferences(){const t=[];return this.collectReferenceErrors(t,[]),t}collectReferenceErrors(t,n){if(this.properties)for(const[i,r]of Object.entries(this.properties))r.deleted||r.collectReferenceErrors(t,[...n,i]);Array.isArray(this.eq)&&this.eq.forEach((i,r)=>{i.collectReferenceErrors(t,[...n,`[${r}]`])})}static escapeString(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n")}static escapeProp(t){return t.replace(/\\/g,"\\\\").replace(/`/g,"\\`")}static quoteAndEscape(t,n=!1){return t.match(/^[0-9A-Za-z_]+$/)?t:n?`\`${it.escapeProp(t)}\``:`"${it.escapeString(t)}"`}static serializeScalar(t){return typeof t=="boolean"?t?"@true":"@false":t instanceof Date?`@${t.toISOString()}`:typeof t=="number"?String(t):it.quoteAndEscape(t)}toString(){var t;let n=(t=this.prefix)!==null&&t!==void 0?t:"# ";function i(a){var o;const l=Object.keys((o=a.properties)!==null&&o!==void 0?o:{});for(let u=0;u<l.length;u++)s(l[u],a.properties[l[u]]),u<l.length-1&&(n+=" ")}function r(a,o=!1){if(a.eq!==void 0)if(o||(n+=" = "),Array.isArray(a.eq)){n+="[";for(let l=0;l<a.eq.length;l++)r(a.eq[l],!0),l!==a.eq.length-1&&(n+=", ");n+="]"}else n+=it.serializeScalar(a.eq);if(a.properties){const l=Object.keys(a.properties);!o&&l.length===1&&!l.some(u=>{var c;return((c=a.properties)!==null&&c!==void 0?c:{})[u].deleted})&&a.eq===void 0?(n+=".",i(a)):((!o||a.eq!==void 0)&&(n+=" "),n+="{ ",i(a),n+=" }")}}function s(a,o){if(o.deleted){n+=`-${it.quoteAndEscape(a,!0)}`;return}n+=it.quoteAndEscape(a,!0),r(o)}return i(this),n+=`
|
|
46
|
+
${n}}`,i}constructor(t={},n){if(this._read=!1,n!==void 0&&(this._parent=n),t.eq!==void 0&&(Array.isArray(t.eq)?this.eq=t.eq.map(i=>i instanceof it?i:new it(i,this)):this.eq=t.eq),t.properties){this.properties={};for(const[i,r]of Object.entries(t.properties))this.properties[i]=r instanceof it?r:new it(r,this)}t.deleted&&(this.deleted=t.deleted),t.prefix&&(this.prefix=t.prefix)}static withPrefix(t){return new it({prefix:t})}tag(...t){return this.find(t)}text(...t){var n;const i=(n=this.find(t))===null||n===void 0?void 0:n.getEq();if(!(i===void 0||Array.isArray(i)))return i instanceof Date?i.toISOString():String(i)}scalarType(...t){var n;const i=t.length>0?(n=this.find(t))===null||n===void 0?void 0:n.getEq():this.getEq();if(!(i===void 0||Array.isArray(i)))return i instanceof Date?"date":typeof i}numeric(...t){var n;const i=(n=this.find(t))===null||n===void 0?void 0:n.getEq();if(typeof i=="number")return i;if(typeof i=="string"){const r=Number.parseFloat(i);if(!Number.isNaN(r))return r}}boolean(...t){var n;const i=(n=this.find(t))===null||n===void 0?void 0:n.getEq();if(typeof i=="boolean")return i}isTrue(...t){var n;return((n=this.find(t))===null||n===void 0?void 0:n.getEq())===!0}isFalse(...t){var n;return((n=this.find(t))===null||n===void 0?void 0:n.getEq())===!1}date(...t){var n;const i=(n=this.find(t))===null||n===void 0?void 0:n.getEq();if(i instanceof Date)return i}bare(...t){const n=this.find(t);if(n!==void 0)return!n.hasProperties()}getEq(){return this.eq}getProperty(t){var n;return(n=this.properties)===null||n===void 0?void 0:n[t]}getArrayElement(t){if(Array.isArray(this.eq)&&t<this.eq.length)return this.eq[t]}get dict(){var t;return(t=this.properties)!==null&&t!==void 0?t:{}}*entries(){if(this.properties)for(const t in this.properties)yield[t,this.properties[t]]}*keys(){if(this.properties)for(const t in this.properties)yield t}hasProperties(){return this.properties!==void 0&&Object.keys(this.properties).length>0}array(...t){const n=this.find(t);if(n===void 0)return;const i=n.getEq();if(Array.isArray(i))return i.map((r,s)=>n.getArrayElement(s))}textArray(...t){const n=this.find(t);if(n===void 0)return;const i=n.getEq();if(Array.isArray(i))return i.reduce((r,s,a)=>{const o=n.getArrayElement(a),l=o==null?void 0:o.getEq();return l===void 0||Array.isArray(l)?r:l instanceof Date?r.concat(l.toISOString()):r.concat(String(l))},[])}numericArray(...t){const n=this.find(t);if(n===void 0)return;const i=n.getEq();if(Array.isArray(i))return i.reduce((r,s,a)=>{const o=n.getArrayElement(a),l=o==null?void 0:o.getEq();if(typeof l=="number")return r.concat(l);if(typeof l=="string"){const u=Number.parseFloat(l);if(!Number.isNaN(u))return r.concat(u)}return r},[])}getProperties(){return this.properties===void 0&&(this.properties={}),this.properties}clone(t){const n=new it({},t);if(n.prefix=this.prefix,n.deleted=this.deleted,n.location=this.location,n._clonedFrom=this,this.eq!==void 0&&(Array.isArray(this.eq)?n.eq=this.eq.map(i=>i.clone(n)):n.eq=this.eq instanceof Date?new Date(this.eq):this.eq),this.properties){n.properties={};for(const[i,r]of Object.entries(this.properties))n.properties[i]=r.clone(n)}return n}static scalarToObject(t){return t}static tagToObject(t){const n=t.properties!==void 0&&Object.keys(t.properties).length>0,i=t.eq!==void 0;if(!i&&!n)return!0;if(!i&&n){const s={};for(const[a,o]of Object.entries(t.properties))o.deleted||(s[a]=it.tagToObject(o));return s}if(i&&!n)return Array.isArray(t.eq)?t.eq.map(s=>it.tagToObject(s)):it.scalarToObject(t.eq);const r={};Array.isArray(t.eq)?r["="]=t.eq.map(s=>it.tagToObject(s)):r["="]=it.scalarToObject(t.eq);for(const[s,a]of Object.entries(t.properties))a.deleted||(r[s]=it.tagToObject(a));return r}toObject(t=new Set){const n={};if(this.properties)for(const[i,r]of Object.entries(this.properties))r.deleted||(n[i]=r.toObjectValue(t));return n}toObjectValue(t){const n=this.properties!==void 0&&Object.keys(this.properties).length>0,i=this.eq!==void 0;if(!i&&!n)return!0;if(!i&&n)return this.toObject(t);if(i&&!n)return Array.isArray(this.eq)?this.eq.map(s=>s.toObjectValue(t)):this.eq;const r=this.toObject(t);return Array.isArray(this.eq)?r["="]=this.eq.map(s=>s.toObjectValue(t)):r["="]=this.eq,r}toJSON(){const t={};if(this.eq!==void 0&&(Array.isArray(this.eq)?t.eq=this.eq.map(n=>n.toJSON()):t.eq=this.eq),this.properties!==void 0){t.properties={};for(const[n,i]of Object.entries(this.properties))t.properties[n]=i.toJSON()}return this.deleted&&(t.deleted=!0),this.prefix&&(t.prefix=this.prefix),t}validateReferences(){const t=[];return this.collectReferenceErrors(t,[]),t}collectReferenceErrors(t,n){if(this.properties)for(const[i,r]of Object.entries(this.properties))r.deleted||r.collectReferenceErrors(t,[...n,i]);Array.isArray(this.eq)&&this.eq.forEach((i,r)=>{i.collectReferenceErrors(t,[...n,`[${r}]`])})}static escapeString(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n")}static escapeProp(t){return t.replace(/\\/g,"\\\\").replace(/`/g,"\\`")}static quoteAndEscape(t,n=!1){return t.match(/^[0-9A-Za-z_]+$/)?t:n?`\`${it.escapeProp(t)}\``:`"${it.escapeString(t)}"`}static serializeScalar(t){return typeof t=="boolean"?t?"@true":"@false":t instanceof Date?`@${t.toISOString()}`:typeof t=="number"?String(t):it.quoteAndEscape(t)}toString(){var t;let n=(t=this.prefix)!==null&&t!==void 0?t:"# ";function i(a){var o;const l=Object.keys((o=a.properties)!==null&&o!==void 0?o:{});for(let u=0;u<l.length;u++)s(l[u],a.properties[l[u]]),u<l.length-1&&(n+=" ")}function r(a,o=!1){if(a.eq!==void 0)if(o||(n+=" = "),Array.isArray(a.eq)){n+="[";for(let l=0;l<a.eq.length;l++)r(a.eq[l],!0),l!==a.eq.length-1&&(n+=", ");n+="]"}else n+=it.serializeScalar(a.eq);if(a.properties){const l=Object.keys(a.properties);!o&&l.length===1&&!l.some(u=>{var c;return((c=a.properties)!==null&&c!==void 0?c:{})[u].deleted})&&a.eq===void 0?(n+=".",i(a)):((!o||a.eq!==void 0)&&(n+=" "),n+="{ ",i(a),n+=" }")}}function s(a,o){if(o.deleted){n+=`-${it.quoteAndEscape(a,!0)}`;return}n+=it.quoteAndEscape(a,!0),r(o)}return i(this),n+=`
|
|
47
47
|
`,n}find(t){let n=this;for(const i of t){let r;if(typeof i=="number"?r=n.getArrayElement(i):r=n.getProperty(i),r===void 0)return;r.markRead(),n=r}return n.deleted?void 0:n}markRead(){this._read=!0,this._clonedFrom&&(this._clonedFrom._read=!0)}get wasRead(){return this._read}resetReadTracking(){if(this._read=!1,this.properties)for(const t of Object.values(this.properties))t.resetReadTracking();if(Array.isArray(this.eq))for(const t of this.eq)t.resetReadTracking()}getUnreadProperties(t=[]){const n=[];if(this.properties)for(const[i,r]of Object.entries(this.properties)){if(r.deleted)continue;const s=[...t,i];r._read?n.push(...r.getUnreadProperties(s)):n.push(s)}return n}has(...t){return this.find(t)!==void 0}set(t,n=null){let i=this,r,s;for(const a of t)if(r=i,s=a,typeof a=="number"){if(i.eq===void 0||!Array.isArray(i.eq))i.eq=Array.from({length:a+1}).map(()=>new it({},i));else if(i.eq.length<=a){const o=i.eq,l=Array.from({length:a+1}).map((u,c)=>c<o.length?o[c]:new it({},i));i.eq=l}i=i.eq[a]}else{const o=i.properties;o===void 0?(i.properties={[a]:new it({},i)},i=i.properties[a]):a in o?(i=o[a],i.deleted&&(i.deleted=!1)):(o[a]=new it({},i),i=o[a])}if(n===null)i.eq=void 0;else if(n instanceof it){const a=n.clone(r);r&&s!==void 0&&(typeof s=="number"&&Array.isArray(r.eq)?r.eq[s]=a:typeof s=="string"&&r.properties&&(r.properties[s]=a))}else typeof n=="string"||typeof n=="number"||typeof n=="boolean"||n instanceof Date?i.eq=n:Array.isArray(n)&&(i.eq=n.map(a=>new it({eq:a},i)));return this}delete(...t){return this.remove(t,!1)}unset(...t){return this.remove(t,!0)}remove(t,n=!1){var i;let r=this;for(const a of t.slice(0,t.length-1))if(typeof a=="number"){if(r.eq===void 0||!Array.isArray(r.eq)){if(!n)return this;r.eq=Array.from({length:a}).map(()=>new it({},r))}else if(r.eq.length<=a){if(!n)return this;const o=r.eq,l=Array.from({length:a}).map((u,c)=>c<o.length?o[c]:new it({},r));r.eq=l}r=r.eq[a]}else{const o=r.properties;if(o===void 0){if(!n)return this;r.properties={[a]:new it({},r)},r=r.properties[a]}else if(a in o)r=o[a];else{if(!n)return this;o[a]=new it({},r),r=o[a]}}const s=t[t.length-1];return typeof s=="string"?r.properties&&s in r.properties?delete r.properties[s]:n&&((i=r.properties)!==null&&i!==void 0||(r.properties={}),r.properties[s]=new it({deleted:!0},r)):Array.isArray(r.eq)&&r.eq.splice(s,1),this}}Bo.Tag=it,it.ids=new Map,it.nextTagId=1e3;class j6 extends it{constructor(t,n,i){super({},i),this.ups=t,this.refPath=n}resolve(){let t;if(this.ups===0)t=this.root;else{t=this.parent;for(let n=0;n<this.ups&&t!==void 0;n++)t=t.parent}if(t!==void 0)return t.find(this.refPath)}quoteSegment(t){return/^[0-9A-Za-z_\u00C0-\u024F\u1E00-\u1EFF]+$/.test(t)?t:"`"+t.replace(/\\/g,"\\\\").replace(/`/g,"\\`")+"`"}toRefString(){const t="$"+"^".repeat(this.ups),n=this.refPath.map((i,r)=>{if(typeof i=="number")return`[${i}]`;const s=this.quoteSegment(i);return r===0?s:`.${s}`}).join("");return t+n}getEq(){var t;return(t=this.resolve())===null||t===void 0?void 0:t.getEq()}getProperty(t){var n;return(n=this.resolve())===null||n===void 0?void 0:n.getProperty(t)}getArrayElement(t){var n;return(n=this.resolve())===null||n===void 0?void 0:n.getArrayElement(t)}hasProperties(){var t,n;return(n=(t=this.resolve())===null||t===void 0?void 0:t.hasProperties())!==null&&n!==void 0?n:!1}toObjectValue(t){if(t.has(this))return;const n=this.resolve();if(n===void 0)return;t.add(this);const i=n.toObjectValue(t);return t.delete(this),i}toJSON(){return{linkTo:this.toRefString()}}collectReferenceErrors(t,n){if(this.resolve()===void 0){const i=n.length>0?n.join("."):"root";t.push(`Unresolved reference at ${i}: ${this.toRefString()}`)}}clone(t){const n=new j6(this.ups,[...this.refPath],t);return n._clonedFrom=this,n}}Bo.RefTag=j6;function W6(e){const t={};return e.eq!==void 0&&(Array.isArray(e.eq)?t.eq=e.eq.map(n=>W6(n)):t.eq=e.eq),e.properties!==void 0&&(t.properties=FO(e.properties)),e.deleted&&(t.deleted=!0),t}function FO(e){const t={};for(const[n,i]of Object.entries(e))t[n]=W6(i);return t}var X1={},TO={},qo={};Object.defineProperty(qo,"__esModule",{value:!0}),qo.formatRef=Nue,qo.isRef=Iue,qo.isEnvRef=zue;function Nue(e){let t="$";for(let i=0;i<e.linkUps;i++)t+="^";let n=!0;for(const i of e.linkTo)typeof i=="string"?(n||(t+="."),t+=i,n=!1):t+=`[${i}]`;return t}function Iue(e){return typeof e=="object"&&e!==null&&"linkTo"in e&&"linkUps"in e&&!Array.isArray(e)&&!(e instanceof Date)}function zue(e){return typeof e=="object"&&e!==null&&"env"in e&&!Array.isArray(e)&&!(e instanceof Date)}var M2={},V6={};Object.defineProperty(V6,"__esModule",{value:!0}),V6.parse=Bue;class Pue{constructor(t){this.input=t,this.pos=0}peekChar(){return this.pos<this.input.length?this.input[this.pos]:void 0}advance(t){this.pos+=t}startsWith(t){return this.input.startsWith(t,this.pos)}eatChar(t){return this.peekChar()===t?(this.advance(1),!0):!1}expectChar(t){if(!this.eatChar(t))throw this.errorPoint(`Expected '${t}'`)}position(){const t=this.input.substring(0,this.pos),n=(t.match(/\n/g)||[]).length,i=t.lastIndexOf(`
|
|
48
48
|
`),r=this.pos-(i===-1?0:i+1);return{line:n,column:r,offset:this.pos}}errorPoint(t){const n=this.position();return{code:"tag-parse-syntax-error",message:t,begin:n,end:n}}errorSpan(t,n){return{code:"tag-parse-syntax-error",message:t,begin:n,end:this.position()}}skipWs(){for(;;){for(;this.pos<this.input.length;){const t=this.input[this.pos];if(t===" "||t===" "||t==="\r"||t===`
|
|
49
49
|
`)this.pos++;else break}if(this.peekChar()==="#")for(;this.pos<this.input.length;){const t=this.input[this.pos];if(t==="\r"||t===`
|
|
@@ -63,7 +63,7 @@ ${n}}`,i}constructor(t={},n){if(this._read=!1,n!==void 0&&(this._parent=n),t.eq!
|
|
|
63
63
|
drill:
|
|
64
64
|
${n.map(r=>` ${r}`).join(`,
|
|
65
65
|
`)}
|
|
66
|
-
} +`),i+=" { select: * }",i}class Vs{constructor(t,n,i){this.cell=t,this.field=n,this.parent=i}get literalValue(){}isNull(){return this instanceof b7}isArray(){return this instanceof y7}isRecord(){return this instanceof q2}isRepeatedRecord(){return this instanceof B2}isRecordOrRepeatedRecord(){return this.isRepeatedRecord()||this.isRecord()}isNest(){return this.isRepeatedRecord()||this.isRecord()||this.isArray()}isNumber(){return this instanceof v7}isDate(){return this instanceof x7}isTime(){return this.isDate()||this.isTimestamp()}isJSON(){return this instanceof $7}isString(){return this instanceof S7}isTimestamp(){return this instanceof w7}isBoolean(){return this instanceof k7}asCell(){if(this instanceof y7||this instanceof B2||this instanceof q2||this instanceof v7||this instanceof x7||this instanceof $7||this instanceof S7||this instanceof w7||this instanceof k7||this instanceof b7||this instanceof lR)return this;throw new Error("Not a cell")}root(){return this.parent?this.parent.root():this.asCell()}getPathInfo(t){const n=t.split("/"),i=n.filter(s=>s==="..").length+1,r=n.filter(s=>s!==".."&&s!=="");return{levelsUp:i,pathSegments:r}}getParentRecord(t){let n=this.asCell();for(;n&&t>0;){for(n=n.parent;n!=null&&n.isArray();)n=n.parent;t--}if(!(n!=null&&n.isRecord()))throw new Error(`Parent ${t} levels up was not a record`);return n}getRelativeCell(t){try{const{levelsUp:n,pathSegments:i}=this.getPathInfo(t);return this.getParentRecord(n).cellAtPath(i)}catch{return}}cellAt(t){return typeof t=="string"?this.cellAtPath(JSON.parse(t)):this.cellAtPath(t)}cellAtPath(t){if(t.length===0)return this.asCell();throw new Error(`${this.constructor.name} cannot contain columns`)}compareTo(t){return 0}canDrill(){return yfe(this.asCell())}getStableDrillQuery(){return rR(this.asCell())}getStableDrillClauses(){return g7(this.asCell())}getDrillExpressions(){return aR(this.asCell())}getDrillEntries(){return bfe(this.asCell())}getStableDrillQueryMalloy(){return oR(this.asCell())}getDrillQueryMalloy(){return vfe(this.asCell())}}class y7 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.values=[];for(const r of this.cell.array_value)this.values.push(uR.from(r,this.field.elementField,this))}get value(){return this.values}}class B2 extends Vs{constructor(t,n,i){var s;super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.rows=[],this.fieldValueSets=new Map;for(let a=0;a<this.cell.array_value.length;a++){const o=this.cell.array_value[a];if(!("record_value"in o))throw new Error("Expected record cell in RepeatedRecordCell");const l=new q2(o,this.field.nestedRecordField,this);this.rows.push(l)}for(const a of this.rows)for(const o of a.columns){const l=o.field;let u=this.fieldValueSets.get(l.name);u===void 0&&(u=new Set,this.fieldValueSets.set(l.name,u)),u.add(o.value)}for(const[a,o]of this.fieldValueSets.entries())this.field.registerValueSetSize(a,o.size);const r=this.field.getPlugins();for(const a of r)(s=a.processData)==null||s.call(a,this.field,this)}get value(){return this.rows}get values(){return this.rows}}class xfe extends B2{constructor(t,n){super(t,n,void 0),this.cell=t,this.field=n}}class q2 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.cells={};for(let r=0;r<n.fields.length;r++){const s=n.fields[r],a=uR.from(t.record_value[r],s,this);this.cells[s.name]=a}}get rows(){return[this]}get value(){return this.cells}column(t){return this.cells[t]}get columns(){return this.field.fields.map(t=>this.column(t.name))}allCellValues(){return Object.fromEntries(Object.entries(this.cells).map(([t,n])=>[t,n.value]))}cellAtPath(t){if(t.length===0)return this.asCell();{const[n,...i]=t,r=this.cells[n];if(r===void 0)throw new Error(`No such column ${n} in ${this.field.path}`);return r.cellAtPath(i)}}}class b7 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.field.registerNullValue()}get value(){return null}get literalValue(){return{kind:"null_literal"}}}class v7 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.field.registerValue(this.value)}get value(){return this.cell.number_value}get stringValue(){return this.cell.string_value}get subtype(){return this.cell.subtype}needsStringPrecision(){return this.subtype==="bigint"}numberValue(){return this.value}bigint(){return this.stringValue!==void 0?BigInt(this.stringValue):BigInt(this.value)}compareTo(t){if(!t.isNumber())return 0;if(this.stringValue!==void 0&&t.stringValue!==void 0){const i=this.bigint(),r=t.bigint();return i>r?1:i<r?-1:0}const n=this.value-t.value;return n>0?1:n===0?0:-1}get literalValue(){return{kind:"number_literal",number_value:this.value,string_value:this.stringValue}}}class x7 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.field.registerValue(this.value)}get value(){return new Date(this.cell.date_value)}get timeframe(){return this.field.timeframe}compareTo(t){return t.isTime()?this.value>t.value?1:this.value<t.value?-1:0:0}get literalValue(){return{kind:"date_literal",date_value:this.cell.date_value,granularity:this.timeframe}}}class w7 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.field.registerValue(this.value)}get value(){return new Date(this.cell.timestamp_value)}get timeframe(){return this.field.timeframe}compareTo(t){return t.isTime()?this.value>t.value?1:this.value<t.value?-1:0:0}get literalValue(){return{kind:"timestamp_literal",timestamp_value:this.cell.timestamp_value,granularity:this.timeframe}}}class $7 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i}get value(){try{return JSON.parse(this.cell.json_value)}catch{return this.cell.json_value}}compareTo(t){const n=this.value.toString(),i=t.toString();return n===i?0:n>i?1:-1}}class lR extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i}get value(){try{return JSON.parse(this.cell.sql_native_value)}catch{return this.cell.sql_native_value}}compareTo(t){const n=this.value.toString(),i=t.toString();return n===i?0:n>i?1:-1}}class S7 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.field.registerValue(this.value)}get value(){return this.cell.string_value}compareTo(t){return t.isString()?this.value.toLocaleLowerCase().localeCompare(t.value.toLocaleLowerCase()):0}get literalValue(){return{kind:"string_literal",string_value:this.cell.string_value}}}class k7 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.field.registerValue(this.value)}get value(){return this.cell.boolean_value}compareTo(t){return this.value===t.value?0:this.value?1:-1}get literalValue(){return{kind:"boolean_literal",boolean_value:this.cell.boolean_value}}}const uR={from(e,t,n){switch(e.kind){case"array_cell":{if(t instanceof au)return new B2(e,t,n);if(t instanceof Ld)return new y7(e,t,n);throw new Error("Expected record data to be associated with record field")}case"record_cell":{if(t instanceof Ho)return new q2(e,t,n);throw new Error("Expected record data to be associated with record field")}case"null_cell":return new b7(e,t,n);case"number_cell":{if(t instanceof n0)return new v7(e,t,n);throw new Error("Expected number data to be associated with number field")}case"date_cell":{if(t instanceof i0)return new x7(e,t,n);throw new Error("Expected date data to be associated with date field")}case"json_cell":{if(t instanceof a0)return new $7(e,t,n);throw new Error("Expected JSON data to be associated with JSON field")}case"string_cell":{if(t instanceof Pd)return new S7(e,t,n);throw new Error("Expected string data to be associated with string field")}case"timestamp_cell":{if(t instanceof r0)return new w7(e,t,n);throw new Error("Expected timestamp data to be associated with timestamp field")}case"boolean_cell":{if(t instanceof o0)return new k7(e,t,n);throw new Error("Expected boolean data to be associated with boolean field")}case"sql_native_cell":{if(t instanceof s0)return new lR(e,t,n);throw new Error("Expected sql_native data to be associated with sql_native field")}}}},wfe={url:"",range:{start:{line:0,character:0},end:{line:0,character:0}}};function cR(e){return(e==null?void 0:e.location)??wfe}class fR{constructor(){this.logs=[]}reset(){this.logs=[]}warn(t,n){this.add("warn",t,n)}error(t,n){this.add("error",t,n)}add(t,n,i){const{url:r,range:s}=i?cR(i):cR();this.logs.push({url:r,range:s,severity:t,message:n})}collectUnreadTags(t,n){const i=t.getUnreadProperties();for(const r of i){const s=r.join(".");this.warn(`Unknown render tag '${s}' on field '${n}'`,t)}}getLogs(){return[...this.logs]}}class dR{constructor(t,n=[],i={},r,s){this.pluginRegistry=n,this.pluginOptions=i,this.onPluginCreateError=r,this.logCollector=s??new fR,this.registry=new Map,this.rootField=new gfe({name:"root",type:{kind:"array_type",element_type:{kind:"record_type",fields:t.schema.fields.filter(a=>a.kind==="dimension"||a.kind==="calculate")}},annotations:t.annotations},{modelTag:C7(t.model_annotations,"## "),queryTimezone:t.query_timezone}),this.registerFields(this.rootField)}instantiatePluginsForField(t){const n=[];for(const i of this.pluginRegistry)try{if(i.matches(t,t.tag,tR(t))){const r=this.pluginOptions[i.name],s=this.rootField.modelTag,a=i.create(t,r,s);n.push(a)}}catch(r){console.warn(`Plugin ${i.name} failed to instantiate for field ${t.key}:`,r),this.onPluginCreateError&&this.onPluginCreateError(r,i,t,n)}return t.setPlugins(n),n}registerFields(t){const n=t.key;if(!this.registry.has(n)){const i=this.instantiatePluginsForField(t),r={field:t,renderProperties:{field:t,renderAs:t.renderAs(),sizingStrategy:"fit",properties:{},errors:[]},plugins:i},s=this.populateRenderFieldProperties(t,i);r.renderProperties.properties=s.properties,r.renderProperties.errors=s.errors,this.registry.set(n,r),this.validateFieldTags(t),this.markDeclaredTags(t,i)}if(t.isNest())for(const i of t.fields)this.registerFields(i)}populateRenderFieldProperties(t,n){const i={},r=[];for(const s of n)i[s.name]=s.getMetadata();return{properties:i,errors:r}}getAllFields(){return Array.from(this.registry.values()).map(t=>t.field)}getRootField(){return this.rootField}getPluginsForField(t){const n=this.registry.get(t);return n?n.plugins:[]}getFieldEntry(t){return this.registry.get(t)}validateFieldTags(t){var h;const n=t.tag,i=tR(t),r=this.logCollector,s=["viz","bar_chart","line_chart","list","list_detail","pivot","dashboard","transpose","table"],a=[un.RepeatedRecord,un.Record];for(const m of s)n.has(m)&&!a.includes(i)&&r.error(`Tag '${m}' on field '${t.name}' requires a nested query, but field is ${i}`,n.tag(m));n.has("link")&&i!==un.String&&r.error(`Tag 'link' on field '${t.name}' requires a string field, but field is ${i}`,n.tag("link")),n.has("image")&&i!==un.String&&r.error(`Tag 'image' on field '${t.name}' requires a string field, but field is ${i}`,n.tag("image"));const o=["number","currency","percent","duration"];for(const m of o)n.has(m)&&i!==un.Number&&i!==un.Array&&!(m==="number"&&(i===un.Date||i===un.Timestamp))&&r.error(`Tag '${m}' on field '${t.name}' requires a numeric field, but field is ${i}`,n.tag(m));const l=n.text("viz");if(l!==void 0){const m=["bar","line","table","dashboard"];m.includes(l)||r.error(`Invalid viz type '${l}' on field '${t.name}'. Valid types: ${m.join(", ")}`,n.tag("viz"))}const u=n.text("size");if(u!==void 0){const m=["fill","spark","xs","sm","md","lg","xl","2xl"];!m.includes(u)&&!((h=n.tag("size"))!=null&&h.has("width"))&&r.warn(`Unknown size '${u}' on field '${t.name}'. Valid presets: ${m.join(", ")}`,n.tag("size"))}if(n.has("currency")){const m=n.text("currency");if(m!==void 0){const p=["usd","eur","gbp","euro","pound"];m.match(/^(euro|pound|usd|eur|gbp)/i)||r.error(`Unknown currency '${m}' on field '${t.name}'. Valid codes: ${p.join(", ")}`,n.tag("currency"))}}if(n.has("duration")){const m=n.text("duration");if(m!==void 0){const p=["nanoseconds","microseconds","milliseconds","seconds","minutes","hours","days"];p.includes(m)||r.error(`Unknown duration unit '${m}' on field '${t.name}'. Valid units: ${p.join(", ")}`,n.tag("duration"))}}if(t.isNest()){const m=n.tag("viz");if(m){const p=new Set(t.fields.map(g=>g.name));for(const g of["x","y","series"]){const y=m.textArray(g),b=y??[],v=m.text(g);v&&!y&&b.push(v);for(const x of b)p.has(x)||r.error(`Chart field reference '${x}' for '${g}' on '${t.name}' does not match any field. Available fields: ${[...p].join(", ")}`,m.tag(g))}}}const c=n.tag("column");if(c){const m=c.text("width");if(m!==void 0){const g=["xs","sm","md","lg","xl","2xl"];c.numeric("width")===void 0&&!g.includes(m)&&r.warn(`Unknown column width '${m}' on field '${t.name}'. Valid presets: ${g.join(", ")}`,c.tag("width"))}const p=c.text("word_break");p!==void 0&&p!=="break_all"&&r.error(`Unknown column word_break '${p}' on field '${t.name}'. Valid values: break_all`,c.tag("word_break"))}if(t.isNest()){const m=n.tag("viz");if(m){const p=m.text("mode");if(p!==void 0){const g=["normal","yoy"];g.includes(p)||r.error(`Invalid chart mode '${p}' on field '${t.name}'. Valid modes: ${g.join(", ")}`,m.tag("mode"))}}}const f=n.tag("big_value");if(f){const m=f.text("size");if(m!==void 0){const g=["sm","md","lg"];g.includes(m)||r.error(`Invalid big_value size '${m}' on field '${t.name}'. Valid sizes: ${g.join(", ")}`,f.tag("size"))}const p=f.text("comparison_format");if(p!==void 0){const g=["pct","ppt"];g.includes(p)||r.error(`Invalid big_value comparison_format '${p}' on field '${t.name}'. Valid formats: ${g.join(", ")}`,f.tag("comparison_format"))}}const d=n.tag("number");if(d){const m=d.text("scale");if(m!==void 0){const g=["k","m","b","t","q","auto"];g.includes(m)||r.error(`Invalid number scale '${m}' on field '${t.name}'. Valid scales: ${g.join(", ")}`,d.tag("scale"))}const p=d.text("suffix");if(p!==void 0){const g=["letter","lower","word","short","finance","scientific","none"];g.includes(p)||r.error(`Invalid number suffix '${p}' on field '${t.name}'. Valid suffixes: ${g.join(", ")}`,d.tag("suffix"))}}}markDeclaredTags(t,n){const i=t.tag;for(const r of n)if(r.getDeclaredTagPaths)for(const s of r.getDeclaredTagPaths())i.find(s);for(const r of $fe)i.find(r)}}const $fe=[["link","field"],["link","url_template"],["image","height"],["image","width"],["image","alt"],["image","alt","field"],["duration","terse"],["scatter_chart"],["shape_map"],["segment_map"],["x"],["y"],["series"],["tooltip"]];function hR(e,t){t||(t=new dR(e));const n=t.getRootField(),i=e.data.kind==="record_cell"?{kind:"array_cell",array_value:[e.data]}:e.data;return new xfe(i,n)}function Sfe(e){return["day","week","month","quarter","year"].includes(e)}function mR(e){return Sfe(e)||["hour","minute","second"].includes(e)}const jt="∅";function _7(...e){const t={};for(const n of e)if(E7(n))for(const i in n){const r=n[i];if(E7(r)){const s=E7(t[i])?t[i]:{};t[i]=_7(s,r)}else t[i]=n[i]}return t}function E7(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function C7(e,t="# "){var r;const n=((r=e==null?void 0:e.map(s=>s.value))==null?void 0:r.filter(s=>s.startsWith(t)))??[],i=new Md.TagParser;for(const s of n)i.parse(s);return i.finish()}function kfe(e){var s,a;const t=((s=e==null?void 0:e.map(o=>o.value))==null?void 0:s.filter(o=>o.startsWith("# ")))??[],n=((a=e==null?void 0:e.map(o=>o.value))==null?void 0:a.filter(o=>o.startsWith("#r ")))??[],i=[...t,...n],r=new Md.TagParser;for(const o of i)r.parse(o);return r.finish()}function pR(e,t,n={}){let i=t.toString();return n.terse?i=_fe.get(t)??i:e===1&&(i=i.substring(0,i.length-1)),`${n.numFormat?Lo.format(n.numFormat,e):e.toLocaleString()}${n.terse?"":" "}${i}`}const _fe=new Map([[ct.Nanoseconds,"ns"],[ct.Microseconds,"µs"],[ct.Milliseconds,"ms"],[ct.Seconds,"s"],[ct.Minutes,"m"],[ct.Hours,"h"],[ct.Days,"d"]]),Efe=new Map([[ct.Nanoseconds,1e3],[ct.Microseconds,1e3],[ct.Milliseconds,1e3],[ct.Seconds,60],[ct.Minutes,60],[ct.Hours,24],[ct.Days,Number.MAX_VALUE]]);function Cfe(e,t,n){const i=n.durationUnit&&a7(n.durationUnit)?n.durationUnit:ct.Seconds,r=e.tag,s=r.text("number"),a=r.has("duration","terse");let o=t,l=0,u=[],c=!1;for(const[f,d]of Efe)if(f===i&&(c=!0),!!c&&(l=o%d,o=Math.floor(o/=d),l>0&&(u=[pR(l,f,{numFormat:s,terse:a}),...u]),o===0))break;return u.length>0?u.slice(0,2).join(" "):pR(0,i,{numFormat:s,terse:a})}function l0(e,t=2){return`${"0".repeat(t-1)}${e}`.slice(-t)}function gR(e,t={}){if(t.timezone){const f=t.timeframe&&mR(t.timeframe)?t.timeframe:"second";return C2(e,f,t.timezone)}if(t.extractFormat)switch(t.extractFormat){case"month-day":return e.toLocaleDateString("en-US",{month:"short",day:"numeric",timeZone:"UTC"});case"month":return e.toLocaleDateString("en-US",{month:"long",timeZone:"UTC"});case"quarter":return`Q${Math.floor(e.getUTCMonth()/3)+1}`;case"week":return e.toLocaleDateString("en-US",{month:"short",day:"numeric",timeZone:"UTC"});case"day":return e.toLocaleDateString("en-US",{day:"numeric",timeZone:"UTC"})}const n=e.getUTCFullYear(),i=l0(e.getUTCMonth()+1),r=l0(e.getUTCDate()),s=l0(e.getUTCHours()),a=l0(e.getUTCMinutes()),o=l0(e.getUTCSeconds()),l=`${s}:${a}:${o}`,u=`${n}-${i}-${r}`,c=t.timeframe;if(c&&mR(c))switch(c){case"second":return`${u} ${l}`;case"minute":return`${u} ${s}:${a}`;case"hour":return`${u} ${s}`;case"day":return`${u}`;case"week":return`${u}-WK`;case"month":return`${n}-${i}`;case"quarter":return`${n}-Q${Math.floor(e.getUTCMonth()/3)+1}`;case"year":return e.getUTCFullYear().toString()}return t.isDate?u:`${u} ${l}`}function Afe(e){return`"${e.replace(/(["\\])/g,"\\$1")}"`}function yR(e){return e.isNull()?"null":e.isString()?Afe(e.value):e.isNumber()||e.isBoolean()?e.value.toString():e.isTime()?"@"+gR(e.value,{isDate:e.isDate(),timeframe:e.field.timeframe}):"invalid_drill_literal()"}function A7(e,t){e.fields.forEach(n=>{t(n),Bd.isNestField(n)&&A7(n,t)})}function Mfe(e){return e!==void 0}function M7(e){const t=Math.abs(e),n=e<0?"-":"";let i,r="";if(t>=1e15)i=(t/1e15).toFixed(1),r="Q";else if(t>=1e12)i=(t/1e12).toFixed(1),r="T";else if(t>=1e9)i=(t/1e9).toFixed(1),r="B";else if(t>=1e6)i=(t/1e6).toFixed(1),r="M";else if(t>=1e3)i=(t/1e3).toFixed(1),r="K";else return e.toLocaleString("en-US");return i=i.replace(/\.0$/,""),`${n}${i}${r}`}const Hs={k:{divisor:1e3,threshold:1e3},m:{divisor:1e6,threshold:1e6},b:{divisor:1e9,threshold:1e9},t:{divisor:1e12,threshold:1e12},q:{divisor:1e15,threshold:1e15}},Ffe={letter:{k:"K",m:"M",b:"B",t:"T",q:"Q"},lower:{k:"k",m:"m",b:"b",t:"t",q:"q"},word:{k:" Thousand",m:" Million",b:" Billion",t:" Trillion",q:" Quadrillion"},short:{k:"K",m:" Mil",b:" Bil",t:" Tril",q:" Quad"},finance:{k:"M",m:"MM",b:"B",t:"T",q:"Q"},scientific:{k:"×10³",m:"×10⁶",b:"×10⁹",t:"×10¹²",q:"×10¹⁵"},none:{k:"",m:"",b:"",t:"",q:""}};function qd(e,t={}){const{scale:n="auto",decimals:i=2,suffix:r="lower"}=t,s=Math.min(Math.max(0,i),10),a=Math.abs(e),o=e<0?"-":"";let l=null,u=1;if(n==="auto")if(a>=Hs.q.threshold)l="q",u=Hs.q.divisor;else if(a>=Hs.t.threshold)l="t",u=Hs.t.divisor;else if(a>=Hs.b.threshold)l="b",u=Hs.b.divisor;else if(a>=Hs.m.threshold)l="m",u=Hs.m.divisor;else if(a>=Hs.k.threshold)l="k",u=Hs.k.divisor;else return e.toLocaleString("en-US");else l=n,u=Hs[n].divisor;const c=a/u;if(r==="scientific"){const h=Math.floor(Math.log10(a)+1e-10),p=(a/Math.pow(10,h)).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:s}),g={0:"⁰",1:"¹",2:"²",3:"³",4:"⁴",5:"⁵",6:"⁶",7:"⁷",8:"⁸",9:"⁹","-":"⁻"},y=String(h).split("").map(b=>g[b]||b).join("");return`${o}${p}×10${y}`}const f=c.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:s}),d=Ffe[r][l];return`${o}${f}${d}`}const Tfe={usd:"$",eur:"€",gbp:"£",euro:"€",pound:"£"};function bR(e){const t=e.toLowerCase().trim();if(t==="auto")return{scale:"auto",decimals:2};if(t==="id")return{isId:!0};const n=t.match(/^(\d)([kmbtq])$/i);if(n){const r=parseInt(n[1],10),s=n[2].toLowerCase();return{decimals:r,scale:s}}const i=t.match(/^(\d)$/);return i?{decimals:parseInt(i[1],10)}:null}function Dfe(e){const t=e.toLowerCase().trim(),n=t.match(/^(euro|pound|usd|eur|gbp)/i);if(!n)return null;const i=n[1].toLowerCase(),r=Tfe[i];if(!r)return null;const s=t.slice(n[1].length);if(s===".auto")return{currency:i,symbol:r,scale:"auto",decimals:2};const a=s.match(/^(\d)([kmbtq])$/i);if(a)return{currency:i,symbol:r,decimals:parseInt(a[1],10),scale:a[2].toLowerCase()};const o=s.match(/^(\d)$/);return o?{currency:i,symbol:r,decimals:parseInt(o[1],10)}:s===""?{currency:i,symbol:r}:null}function F7(e){if(!e)return;const t=e.toLowerCase().trim();if(["k","m","b","t","q"].includes(t))return t;if(t==="auto")return"auto"}class U2 extends nu{constructor(t,n){super(t),this.options=n}getText(t){if(!t.isNumber())return null;if(this.options.value_format){if(this.options.value_format==="big")return M7(t.value);try{return Lo.format(this.options.value_format,t.value)}catch{throw new Error(`Invalid value format: ${this.options.value_format}`)}}return t.value.toLocaleString()}}const Px=class Px extends Pt{constructor(){super(),this.addExtractor((t,n)=>{t.value_format=n==null?void 0:n.text()},this.rendererName,"format")}activates(t){return t.isNumber()}create(t,n,i,r,s){return new U2(t,s)}get rendererName(){return"number"}};Px.instance=new Px;let T7=Px;class vR{constructor(t,n,i){this.parentField=t,this.values=n,this.span=i,this.key=JSON.stringify({parentField:this.parentField.name,values:this.values.map(r=>r.field.isBasic()?String(r.value):"")}),this.fieldValueMap=new Map;for(const r of this.values)this.fieldValueMap.set(r.field.name,r)}}class u0{constructor(t,n,i){this.pivotedField=t,this.field=n,this.userDefinedPivotDimensions=i}isPivotedColumnField(){return this instanceof u0}}class c0{constructor(t,n,i){this.flattenedField=t,this.field=n,this.name=i}isFlattenedColumnField(){return this instanceof c0}getChildRenderer(t){const n=t[this.flattenedField.name];if(n instanceof f0)return n.childRenderers[this.field.name];throw Error("Could not render flattened table. `# flatten` only supports nests.")}getValue(t){const n=t.column(this.flattenedField.name);if(n.isRecord())return n.column(this.field.name);throw Error("Cannot find nested record within flattened field. `# flatten` only supports nests with no group_bys.")}}function xR(e){return e.isRecord()&&e.tag.has("flatten")}class f0 extends u2{constructor(){super(...arguments),this.childrenStyleDefaults={size:"medium"}}async render(t){var d,h,m;if(t.isNull())return this.document.createElement("span");if(!t.isRecordOrRepeatedRecord())throw new Error("Invalid type for Table Renderer");const n=this.tagged.has("transpose"),i=t.field.fields;if(n&&i.length>20)throw new Error("Transpose limit of 20 columns exceeded.");let r=0,s=0,a=[];a[r]=[];const o=[];let l=0;for(const p of i){if(p.isHidden())continue;const g=this.childRenderers[p.name];if(g instanceof f0&&g.tagged.has("pivot")){const b=g.tagged.textArray("pivot","dimensions");let v,x=[];const w=new Map;for(const $ of t.rows){const k=$.column(p.name);if(!k.isNull()){if(!k.isRecordOrRepeatedRecord())throw new Error(`Can not pivot field ${p.name}.`);if(!v){const _=g.calculatePivotDimensions(k,b);v=_.dimensions,x=_.nonDimensions}for(const _ of k.rows){const E=new vR(k.field,v.map(M=>_.column(M.field.name)),x.length),C=E.key;w.get(C)||w.set(C,E)}}}if(!v)throw new Error(`Could not pivot ${p.name}, no data found.`);const S=Array.from(w.values()).sort(($,k)=>{for(const _ of v){const E=$.fieldValueMap.get(_.field.name),C=k.fieldValueMap.get(_.field.name);if(E!=null&&E.field.isBasic()&&(C!=null&&C.field.isBasic())&&typeof E==typeof C){if(E.isNull())return C.isNull()?0:1;if(C.isNull())return-1;const M=E.compareTo(C);if(M!==0)return _.dir!=="desc"?M:-M}}return 0});for(const $ of S)for(const k of x)o.push(new u0($,k.field,b)),a[r][s]=g.createHeaderCell(k.field,n,{name:(d=k.flattenedField)==null?void 0:d.name,childRenderer:(h=k.flattenedField)==null?void 0:h.getChildRenderer(g.childRenderers)}),s++;l=Math.max(l,v.length)}else if(xR(p)){const b=p,x=b.fields.map(w=>new c0(b,w,`${b.name} ${w.name}`));for(const w of x)a[r][s]=this.createHeaderCell(w.field,n,{name:w.name,childRenderer:w.getChildRenderer(this.childRenderers)}),o.push(w),s++}else a[r][s]=this.createHeaderCell(p,n),o.push(p),s++}if(l>0&&o.length>30)throw new Error("Pivot limit of 30 columns exceeded.");if(!n&&this.options.isDrillingEnabled){const p=this.document.createElement("th");p.style.cssText=`
|
|
66
|
+
} +`),i+=" { select: * }",i}class Vs{constructor(t,n,i){this.cell=t,this.field=n,this.parent=i}get literalValue(){}isNull(){return this instanceof b7}isArray(){return this instanceof y7}isRecord(){return this instanceof q2}isRepeatedRecord(){return this instanceof B2}isRecordOrRepeatedRecord(){return this.isRepeatedRecord()||this.isRecord()}isNest(){return this.isRepeatedRecord()||this.isRecord()||this.isArray()}isNumber(){return this instanceof v7}isDate(){return this instanceof x7}isTime(){return this.isDate()||this.isTimestamp()}isJSON(){return this instanceof $7}isString(){return this instanceof S7}isTimestamp(){return this instanceof w7}isBoolean(){return this instanceof k7}asCell(){if(this instanceof y7||this instanceof B2||this instanceof q2||this instanceof v7||this instanceof x7||this instanceof $7||this instanceof S7||this instanceof w7||this instanceof k7||this instanceof b7||this instanceof lR)return this;throw new Error("Not a cell")}root(){return this.parent?this.parent.root():this.asCell()}getPathInfo(t){const n=t.split("/"),i=n.filter(s=>s==="..").length+1,r=n.filter(s=>s!==".."&&s!=="");return{levelsUp:i,pathSegments:r}}getParentRecord(t){let n=this.asCell();for(;n&&t>0;){for(n=n.parent;n!=null&&n.isArray();)n=n.parent;t--}if(!(n!=null&&n.isRecord()))throw new Error(`Parent ${t} levels up was not a record`);return n}getRelativeCell(t){try{const{levelsUp:n,pathSegments:i}=this.getPathInfo(t);return this.getParentRecord(n).cellAtPath(i)}catch{return}}cellAt(t){return typeof t=="string"?this.cellAtPath(JSON.parse(t)):this.cellAtPath(t)}cellAtPath(t){if(t.length===0)return this.asCell();throw new Error(`${this.constructor.name} cannot contain columns`)}compareTo(t){return 0}canDrill(){return yfe(this.asCell())}getStableDrillQuery(){return rR(this.asCell())}getStableDrillClauses(){return g7(this.asCell())}getDrillExpressions(){return aR(this.asCell())}getDrillEntries(){return bfe(this.asCell())}getStableDrillQueryMalloy(){return oR(this.asCell())}getDrillQueryMalloy(){return vfe(this.asCell())}}class y7 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.values=[];for(const r of this.cell.array_value)this.values.push(uR.from(r,this.field.elementField,this))}get value(){return this.values}}class B2 extends Vs{constructor(t,n,i){var s;super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.rows=[],this.fieldValueSets=new Map;for(let a=0;a<this.cell.array_value.length;a++){const o=this.cell.array_value[a];if(!("record_value"in o))throw new Error("Expected record cell in RepeatedRecordCell");const l=new q2(o,this.field.nestedRecordField,this);this.rows.push(l)}for(const a of this.rows)for(const o of a.columns){const l=o.field;let u=this.fieldValueSets.get(l.name);u===void 0&&(u=new Set,this.fieldValueSets.set(l.name,u)),u.add(o.value)}for(const[a,o]of this.fieldValueSets.entries())this.field.registerValueSetSize(a,o.size);const r=this.field.getPlugins();for(const a of r)(s=a.processData)==null||s.call(a,this.field,this)}get value(){return this.rows}get values(){return this.rows}}class xfe extends B2{constructor(t,n){super(t,n,void 0),this.cell=t,this.field=n}}class q2 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.cells={};for(let r=0;r<n.fields.length;r++){const s=n.fields[r],a=uR.from(t.record_value[r],s,this);this.cells[s.name]=a}}get rows(){return[this]}get value(){return this.cells}column(t){return this.cells[t]}get columns(){return this.field.fields.map(t=>this.column(t.name))}allCellValues(){return Object.fromEntries(Object.entries(this.cells).map(([t,n])=>[t,n.value]))}cellAtPath(t){if(t.length===0)return this.asCell();{const[n,...i]=t,r=this.cells[n];if(r===void 0)throw new Error(`No such column ${n} in ${this.field.path}`);return r.cellAtPath(i)}}}class b7 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.field.registerNullValue()}get value(){return null}get literalValue(){return{kind:"null_literal"}}}class v7 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.field.registerValue(this.value)}get value(){return this.cell.number_value}get stringValue(){return this.cell.string_value}get subtype(){return this.cell.subtype}needsStringPrecision(){return this.subtype==="bigint"}numberValue(){return this.value}bigint(){return this.stringValue!==void 0?BigInt(this.stringValue):BigInt(this.value)}compareTo(t){if(!t.isNumber())return 0;if(this.stringValue!==void 0&&t.stringValue!==void 0){const i=this.bigint(),r=t.bigint();return i>r?1:i<r?-1:0}const n=this.value-t.value;return n>0?1:n===0?0:-1}get literalValue(){return{kind:"number_literal",number_value:this.value,string_value:this.stringValue}}}class x7 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.field.registerValue(this.value)}get value(){return new Date(this.cell.date_value)}get timeframe(){return this.field.timeframe}compareTo(t){return t.isTime()?this.value>t.value?1:this.value<t.value?-1:0:0}get literalValue(){return{kind:"date_literal",date_value:this.cell.date_value,granularity:this.timeframe}}}class w7 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.field.registerValue(this.value)}get value(){return new Date(this.cell.timestamp_value)}get timeframe(){return this.field.timeframe}compareTo(t){return t.isTime()?this.value>t.value?1:this.value<t.value?-1:0:0}get literalValue(){return{kind:"timestamp_literal",timestamp_value:this.cell.timestamp_value,granularity:this.timeframe}}}class $7 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i}get value(){try{return JSON.parse(this.cell.json_value)}catch{return this.cell.json_value}}compareTo(t){const n=this.value.toString(),i=t.toString();return n===i?0:n>i?1:-1}}class lR extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i}get value(){try{return JSON.parse(this.cell.sql_native_value)}catch{return this.cell.sql_native_value}}compareTo(t){const n=this.value.toString(),i=t.toString();return n===i?0:n>i?1:-1}}class S7 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.field.registerValue(this.value)}get value(){return this.cell.string_value}compareTo(t){return t.isString()?this.value.toLocaleLowerCase().localeCompare(t.value.toLocaleLowerCase()):0}get literalValue(){return{kind:"string_literal",string_value:this.cell.string_value}}}class k7 extends Vs{constructor(t,n,i){super(t,n,i),this.cell=t,this.field=n,this.parent=i,this.field.registerValue(this.value)}get value(){return this.cell.boolean_value}compareTo(t){return this.value===t.value?0:this.value?1:-1}get literalValue(){return{kind:"boolean_literal",boolean_value:this.cell.boolean_value}}}const uR={from(e,t,n){switch(e.kind){case"array_cell":{if(t instanceof au)return new B2(e,t,n);if(t instanceof Ld)return new y7(e,t,n);throw new Error("Expected record data to be associated with record field")}case"record_cell":{if(t instanceof Ho)return new q2(e,t,n);throw new Error("Expected record data to be associated with record field")}case"null_cell":return new b7(e,t,n);case"number_cell":{if(t instanceof n0)return new v7(e,t,n);throw new Error("Expected number data to be associated with number field")}case"date_cell":{if(t instanceof i0)return new x7(e,t,n);throw new Error("Expected date data to be associated with date field")}case"json_cell":{if(t instanceof a0)return new $7(e,t,n);throw new Error("Expected JSON data to be associated with JSON field")}case"string_cell":{if(t instanceof Pd)return new S7(e,t,n);throw new Error("Expected string data to be associated with string field")}case"timestamp_cell":{if(t instanceof r0)return new w7(e,t,n);throw new Error("Expected timestamp data to be associated with timestamp field")}case"boolean_cell":{if(t instanceof o0)return new k7(e,t,n);throw new Error("Expected boolean data to be associated with boolean field")}case"sql_native_cell":{if(t instanceof s0)return new lR(e,t,n);throw new Error("Expected sql_native data to be associated with sql_native field")}}}},wfe={url:"",range:{start:{line:0,character:0},end:{line:0,character:0}}};function cR(e){return(e==null?void 0:e.location)??wfe}class fR{constructor(){this.logs=[]}reset(){this.logs=[]}warn(t,n){this.add("warn",t,n)}error(t,n){this.add("error",t,n)}add(t,n,i){const{url:r,range:s}=i?cR(i):cR();this.logs.push({url:r,range:s,severity:t,message:n})}collectUnreadTags(t,n){const i=t.getUnreadProperties();for(const r of i){const s=r.join(".");this.warn(`Unknown render tag '${s}' on field '${n}'`,t)}}getLogs(){return[...this.logs]}}class dR{constructor(t,n=[],i={},r,s){this.pluginRegistry=n,this.pluginOptions=i,this.onPluginCreateError=r,this.logCollector=s??new fR,this.registry=new Map,this.rootField=new gfe({name:"root",type:{kind:"array_type",element_type:{kind:"record_type",fields:t.schema.fields.filter(a=>a.kind==="dimension"||a.kind==="calculate")}},annotations:t.annotations},{modelTag:C7(t.model_annotations,"## "),queryTimezone:t.query_timezone}),this.registerFields(this.rootField)}instantiatePluginsForField(t){const n=[];for(const i of this.pluginRegistry)try{if(i.matches(t,t.tag,tR(t))){const r=this.pluginOptions[i.name],s=this.rootField.modelTag,a=i.create(t,r,s);n.push(a)}}catch(r){console.warn(`Plugin ${i.name} failed to instantiate for field ${t.key}:`,r),this.onPluginCreateError&&this.onPluginCreateError(r,i,t,n)}return t.setPlugins(n),n}registerFields(t){const n=t.key;if(!this.registry.has(n)){const i=this.instantiatePluginsForField(t),r={field:t,renderProperties:{field:t,renderAs:t.renderAs(),sizingStrategy:"fit",properties:{},errors:[]},plugins:i},s=this.populateRenderFieldProperties(t,i);r.renderProperties.properties=s.properties,r.renderProperties.errors=s.errors,this.registry.set(n,r),this.validateFieldTags(t),this.markDeclaredTags(t,i)}if(t.isNest())for(const i of t.fields)this.registerFields(i)}populateRenderFieldProperties(t,n){const i={},r=[];for(const s of n)i[s.name]=s.getMetadata();return{properties:i,errors:r}}getAllFields(){return Array.from(this.registry.values()).map(t=>t.field)}getRootField(){return this.rootField}getPluginsForField(t){const n=this.registry.get(t);return n?n.plugins:[]}getFieldEntry(t){return this.registry.get(t)}validateFieldTags(t){var m;const n=t.tag,i=tR(t),r=this.logCollector,s=["viz","bar_chart","line_chart","list","list_detail","pivot","dashboard","transpose","table"],a=[un.RepeatedRecord,un.Record];for(const p of s)n.has(p)&&!a.includes(i)&&r.error(`Tag '${p}' on field '${t.name}' requires a nested query, but field is ${i}`,n.tag(p));n.has("link")&&i!==un.String&&r.error(`Tag 'link' on field '${t.name}' requires a string field, but field is ${i}`,n.tag("link")),n.has("image")&&i!==un.String&&r.error(`Tag 'image' on field '${t.name}' requires a string field, but field is ${i}`,n.tag("image"));const o=["number","currency","percent","duration"];for(const p of o)n.has(p)&&i!==un.Number&&i!==un.Array&&!(p==="number"&&(i===un.Date||i===un.Timestamp))&&r.error(`Tag '${p}' on field '${t.name}' requires a numeric field, but field is ${i}`,n.tag(p));const l=n.tag("number");(l==null?void 0:l.scalarType())==="number"&&r.error(`Tag 'number' on field '${t.name}' has a bare numeric value. Use a quoted format string instead, e.g. # number="#,##0.00"`,l);const u=n.text("viz");if(u!==void 0){const p=["bar","line","table","dashboard"];p.includes(u)||r.error(`Invalid viz type '${u}' on field '${t.name}'. Valid types: ${p.join(", ")}`,n.tag("viz"))}const c=n.text("size");if(c!==void 0){const p=["fill","spark","xs","sm","md","lg","xl","2xl"];!p.includes(c)&&!((m=n.tag("size"))!=null&&m.has("width"))&&r.warn(`Unknown size '${c}' on field '${t.name}'. Valid presets: ${p.join(", ")}`,n.tag("size"))}if(n.has("currency")){const p=n.text("currency");if(p!==void 0){const g=["usd","eur","gbp","euro","pound"];p.match(/^(euro|pound|usd|eur|gbp)/i)||r.error(`Unknown currency '${p}' on field '${t.name}'. Valid codes: ${g.join(", ")}`,n.tag("currency"))}}if(n.has("duration")){const p=n.text("duration");if(p!==void 0){const g=["nanoseconds","microseconds","milliseconds","seconds","minutes","hours","days"];g.includes(p)||r.error(`Unknown duration unit '${p}' on field '${t.name}'. Valid units: ${g.join(", ")}`,n.tag("duration"))}}if(t.isNest()){const p=n.tag("viz");if(p){const g=new Set(t.fields.map(y=>y.name));for(const y of["x","y","series"]){const b=p.textArray(y),v=b??[],x=p.text(y);x&&!b&&v.push(x);for(const w of v)g.has(w)||r.error(`Chart field reference '${w}' for '${y}' on '${t.name}' does not match any field. Available fields: ${[...g].join(", ")}`,p.tag(y))}}}const f=n.tag("column");if(f){const p=f.text("width");if(p!==void 0){const y=["xs","sm","md","lg","xl","2xl"];f.numeric("width")===void 0&&!y.includes(p)&&r.warn(`Unknown column width '${p}' on field '${t.name}'. Valid presets: ${y.join(", ")}`,f.tag("width"))}const g=f.text("word_break");g!==void 0&&g!=="break_all"&&r.error(`Unknown column word_break '${g}' on field '${t.name}'. Valid values: break_all`,f.tag("word_break"))}if(t.isNest()){const p=n.tag("viz");if(p){const g=p.text("mode");if(g!==void 0){const y=["normal","yoy"];y.includes(g)||r.error(`Invalid chart mode '${g}' on field '${t.name}'. Valid modes: ${y.join(", ")}`,p.tag("mode"))}}}const d=n.tag("big_value");if(d){const p=d.text("size");if(p!==void 0){const y=["sm","md","lg"];y.includes(p)||r.error(`Invalid big_value size '${p}' on field '${t.name}'. Valid sizes: ${y.join(", ")}`,d.tag("size"))}const g=d.text("comparison_format");if(g!==void 0){const y=["pct","ppt"];y.includes(g)||r.error(`Invalid big_value comparison_format '${g}' on field '${t.name}'. Valid formats: ${y.join(", ")}`,d.tag("comparison_format"))}}if(n.has("big_value")&&t.isNest()){const p=t.fields.filter(g=>g.isBasic()&&g.wasDimension());if(p.length>0){const g=p.map(y=>y.name).join(", ");r.error(`Tag 'big_value' on field '${t.name}' does not support group_by fields. Found dimensions: ${g}`,n.tag("big_value"))}}const h=n.tag("number");if(h){const p=h.text("scale");if(p!==void 0){const y=["k","m","b","t","q","auto"];y.includes(p)||r.error(`Invalid number scale '${p}' on field '${t.name}'. Valid scales: ${y.join(", ")}`,h.tag("scale"))}const g=h.text("suffix");if(g!==void 0){const y=["letter","lower","word","short","finance","scientific","none"];y.includes(g)||r.error(`Invalid number suffix '${g}' on field '${t.name}'. Valid suffixes: ${y.join(", ")}`,h.tag("suffix"))}}}markDeclaredTags(t,n){const i=t.tag;for(const r of n)if(r.getDeclaredTagPaths)for(const s of r.getDeclaredTagPaths())i.find(s);for(const r of $fe)i.find(r)}}const $fe=[["link","field"],["link","url_template"],["image","height"],["image","width"],["image","alt"],["image","alt","field"],["duration","terse"],["scatter_chart"],["shape_map"],["segment_map"],["x"],["y"],["series"],["tooltip"]];function hR(e,t){t||(t=new dR(e));const n=t.getRootField(),i=e.data.kind==="record_cell"?{kind:"array_cell",array_value:[e.data]}:e.data;return new xfe(i,n)}function Sfe(e){return["day","week","month","quarter","year"].includes(e)}function mR(e){return Sfe(e)||["hour","minute","second"].includes(e)}const jt="∅";function _7(...e){const t={};for(const n of e)if(E7(n))for(const i in n){const r=n[i];if(E7(r)){const s=E7(t[i])?t[i]:{};t[i]=_7(s,r)}else t[i]=n[i]}return t}function E7(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function C7(e,t="# "){var r;const n=((r=e==null?void 0:e.map(s=>s.value))==null?void 0:r.filter(s=>s.startsWith(t)))??[],i=new Md.TagParser;for(const s of n)i.parse(s);return i.finish()}function kfe(e){var s,a;const t=((s=e==null?void 0:e.map(o=>o.value))==null?void 0:s.filter(o=>o.startsWith("# ")))??[],n=((a=e==null?void 0:e.map(o=>o.value))==null?void 0:a.filter(o=>o.startsWith("#r ")))??[],i=[...t,...n],r=new Md.TagParser;for(const o of i)r.parse(o);return r.finish()}function pR(e,t,n={}){let i=t.toString();return n.terse?i=_fe.get(t)??i:e===1&&(i=i.substring(0,i.length-1)),`${n.numFormat?Lo.format(n.numFormat,e):e.toLocaleString()}${n.terse?"":" "}${i}`}const _fe=new Map([[ct.Nanoseconds,"ns"],[ct.Microseconds,"µs"],[ct.Milliseconds,"ms"],[ct.Seconds,"s"],[ct.Minutes,"m"],[ct.Hours,"h"],[ct.Days,"d"]]),Efe=new Map([[ct.Nanoseconds,1e3],[ct.Microseconds,1e3],[ct.Milliseconds,1e3],[ct.Seconds,60],[ct.Minutes,60],[ct.Hours,24],[ct.Days,Number.MAX_VALUE]]);function Cfe(e,t,n){const i=n.durationUnit&&a7(n.durationUnit)?n.durationUnit:ct.Seconds,r=e.tag,s=r.text("number"),a=r.has("duration","terse");let o=t,l=0,u=[],c=!1;for(const[f,d]of Efe)if(f===i&&(c=!0),!!c&&(l=o%d,o=Math.floor(o/=d),l>0&&(u=[pR(l,f,{numFormat:s,terse:a}),...u]),o===0))break;return u.length>0?u.slice(0,2).join(" "):pR(0,i,{numFormat:s,terse:a})}function l0(e,t=2){return`${"0".repeat(t-1)}${e}`.slice(-t)}function gR(e,t={}){if(t.timezone){const f=t.timeframe&&mR(t.timeframe)?t.timeframe:"second";return C2(e,f,t.timezone)}if(t.extractFormat)switch(t.extractFormat){case"month-day":return e.toLocaleDateString("en-US",{month:"short",day:"numeric",timeZone:"UTC"});case"month":return e.toLocaleDateString("en-US",{month:"long",timeZone:"UTC"});case"quarter":return`Q${Math.floor(e.getUTCMonth()/3)+1}`;case"week":return e.toLocaleDateString("en-US",{month:"short",day:"numeric",timeZone:"UTC"});case"day":return e.toLocaleDateString("en-US",{day:"numeric",timeZone:"UTC"})}const n=e.getUTCFullYear(),i=l0(e.getUTCMonth()+1),r=l0(e.getUTCDate()),s=l0(e.getUTCHours()),a=l0(e.getUTCMinutes()),o=l0(e.getUTCSeconds()),l=`${s}:${a}:${o}`,u=`${n}-${i}-${r}`,c=t.timeframe;if(c&&mR(c))switch(c){case"second":return`${u} ${l}`;case"minute":return`${u} ${s}:${a}`;case"hour":return`${u} ${s}`;case"day":return`${u}`;case"week":return`${u}-WK`;case"month":return`${n}-${i}`;case"quarter":return`${n}-Q${Math.floor(e.getUTCMonth()/3)+1}`;case"year":return e.getUTCFullYear().toString()}return t.isDate?u:`${u} ${l}`}function Afe(e){return`"${e.replace(/(["\\])/g,"\\$1")}"`}function yR(e){return e.isNull()?"null":e.isString()?Afe(e.value):e.isNumber()||e.isBoolean()?e.value.toString():e.isTime()?"@"+gR(e.value,{isDate:e.isDate(),timeframe:e.field.timeframe}):"invalid_drill_literal()"}function A7(e,t){e.fields.forEach(n=>{t(n),Bd.isNestField(n)&&A7(n,t)})}function Mfe(e){return e!==void 0}function M7(e){const t=Math.abs(e),n=e<0?"-":"";let i,r="";if(t>=1e15)i=(t/1e15).toFixed(1),r="Q";else if(t>=1e12)i=(t/1e12).toFixed(1),r="T";else if(t>=1e9)i=(t/1e9).toFixed(1),r="B";else if(t>=1e6)i=(t/1e6).toFixed(1),r="M";else if(t>=1e3)i=(t/1e3).toFixed(1),r="K";else return e.toLocaleString("en-US");return i=i.replace(/\.0$/,""),`${n}${i}${r}`}const Hs={k:{divisor:1e3,threshold:1e3},m:{divisor:1e6,threshold:1e6},b:{divisor:1e9,threshold:1e9},t:{divisor:1e12,threshold:1e12},q:{divisor:1e15,threshold:1e15}},Ffe={letter:{k:"K",m:"M",b:"B",t:"T",q:"Q"},lower:{k:"k",m:"m",b:"b",t:"t",q:"q"},word:{k:" Thousand",m:" Million",b:" Billion",t:" Trillion",q:" Quadrillion"},short:{k:"K",m:" Mil",b:" Bil",t:" Tril",q:" Quad"},finance:{k:"M",m:"MM",b:"B",t:"T",q:"Q"},scientific:{k:"×10³",m:"×10⁶",b:"×10⁹",t:"×10¹²",q:"×10¹⁵"},none:{k:"",m:"",b:"",t:"",q:""}};function qd(e,t={}){const{scale:n="auto",decimals:i=2,suffix:r="lower"}=t,s=Math.min(Math.max(0,i),10),a=Math.abs(e),o=e<0?"-":"";let l=null,u=1;if(n==="auto")if(a>=Hs.q.threshold)l="q",u=Hs.q.divisor;else if(a>=Hs.t.threshold)l="t",u=Hs.t.divisor;else if(a>=Hs.b.threshold)l="b",u=Hs.b.divisor;else if(a>=Hs.m.threshold)l="m",u=Hs.m.divisor;else if(a>=Hs.k.threshold)l="k",u=Hs.k.divisor;else return e.toLocaleString("en-US");else l=n,u=Hs[n].divisor;const c=a/u;if(r==="scientific"){const h=Math.floor(Math.log10(a)+1e-10),p=(a/Math.pow(10,h)).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:s}),g={0:"⁰",1:"¹",2:"²",3:"³",4:"⁴",5:"⁵",6:"⁶",7:"⁷",8:"⁸",9:"⁹","-":"⁻"},y=String(h).split("").map(b=>g[b]||b).join("");return`${o}${p}×10${y}`}const f=c.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:s}),d=Ffe[r][l];return`${o}${f}${d}`}const Tfe={usd:"$",eur:"€",gbp:"£",euro:"€",pound:"£"};function bR(e){const t=e.toLowerCase().trim();if(t==="auto")return{scale:"auto",decimals:2};if(t==="id")return{isId:!0};const n=t.match(/^(\d)([kmbtq])$/i);if(n){const r=parseInt(n[1],10),s=n[2].toLowerCase();return{decimals:r,scale:s}}const i=t.match(/^(\d)$/);return i?{decimals:parseInt(i[1],10)}:null}function Dfe(e){const t=e.toLowerCase().trim(),n=t.match(/^(euro|pound|usd|eur|gbp)/i);if(!n)return null;const i=n[1].toLowerCase(),r=Tfe[i];if(!r)return null;const s=t.slice(n[1].length);if(s===".auto")return{currency:i,symbol:r,scale:"auto",decimals:2};const a=s.match(/^(\d)([kmbtq])$/i);if(a)return{currency:i,symbol:r,decimals:parseInt(a[1],10),scale:a[2].toLowerCase()};const o=s.match(/^(\d)$/);return o?{currency:i,symbol:r,decimals:parseInt(o[1],10)}:s===""?{currency:i,symbol:r}:null}function F7(e){if(!e)return;const t=e.toLowerCase().trim();if(["k","m","b","t","q"].includes(t))return t;if(t==="auto")return"auto"}class U2 extends nu{constructor(t,n){super(t),this.options=n}getText(t){if(!t.isNumber())return null;if(this.options.value_format){if(this.options.value_format==="big")return M7(t.value);try{return Lo.format(this.options.value_format,t.value)}catch{throw new Error(`Invalid value format: ${this.options.value_format}`)}}return t.value.toLocaleString()}}const Px=class Px extends Pt{constructor(){super(),this.addExtractor((t,n)=>{t.value_format=n==null?void 0:n.text()},this.rendererName,"format")}activates(t){return t.isNumber()}create(t,n,i,r,s){return new U2(t,s)}get rendererName(){return"number"}};Px.instance=new Px;let T7=Px;class vR{constructor(t,n,i){this.parentField=t,this.values=n,this.span=i,this.key=JSON.stringify({parentField:this.parentField.name,values:this.values.map(r=>r.field.isBasic()?String(r.value):"")}),this.fieldValueMap=new Map;for(const r of this.values)this.fieldValueMap.set(r.field.name,r)}}class u0{constructor(t,n,i){this.pivotedField=t,this.field=n,this.userDefinedPivotDimensions=i}isPivotedColumnField(){return this instanceof u0}}class c0{constructor(t,n,i){this.flattenedField=t,this.field=n,this.name=i}isFlattenedColumnField(){return this instanceof c0}getChildRenderer(t){const n=t[this.flattenedField.name];if(n instanceof f0)return n.childRenderers[this.field.name];throw Error("Could not render flattened table. `# flatten` only supports nests.")}getValue(t){const n=t.column(this.flattenedField.name);if(n.isRecord())return n.column(this.field.name);throw Error("Cannot find nested record within flattened field. `# flatten` only supports nests with no group_bys.")}}function xR(e){return e.isRecord()&&e.tag.has("flatten")}class f0 extends u2{constructor(){super(...arguments),this.childrenStyleDefaults={size:"medium"}}async render(t){var d,h,m;if(t.isNull())return this.document.createElement("span");if(!t.isRecordOrRepeatedRecord())throw new Error("Invalid type for Table Renderer");const n=this.tagged.has("transpose"),i=t.field.fields;if(n&&i.length>20)throw new Error("Transpose limit of 20 columns exceeded.");let r=0,s=0,a=[];a[r]=[];const o=[];let l=0;for(const p of i){if(p.isHidden())continue;const g=this.childRenderers[p.name];if(g instanceof f0&&g.tagged.has("pivot")){const b=g.tagged.textArray("pivot","dimensions");let v,x=[];const w=new Map;for(const $ of t.rows){const k=$.column(p.name);if(!k.isNull()){if(!k.isRecordOrRepeatedRecord())throw new Error(`Can not pivot field ${p.name}.`);if(!v){const _=g.calculatePivotDimensions(k,b);v=_.dimensions,x=_.nonDimensions}for(const _ of k.rows){const E=new vR(k.field,v.map(M=>_.column(M.field.name)),x.length),C=E.key;w.get(C)||w.set(C,E)}}}if(!v)throw new Error(`Could not pivot ${p.name}, no data found.`);const S=Array.from(w.values()).sort(($,k)=>{for(const _ of v){const E=$.fieldValueMap.get(_.field.name),C=k.fieldValueMap.get(_.field.name);if(E!=null&&E.field.isBasic()&&(C!=null&&C.field.isBasic())&&typeof E==typeof C){if(E.isNull())return C.isNull()?0:1;if(C.isNull())return-1;const M=E.compareTo(C);if(M!==0)return _.dir!=="desc"?M:-M}}return 0});for(const $ of S)for(const k of x)o.push(new u0($,k.field,b)),a[r][s]=g.createHeaderCell(k.field,n,{name:(d=k.flattenedField)==null?void 0:d.name,childRenderer:(h=k.flattenedField)==null?void 0:h.getChildRenderer(g.childRenderers)}),s++;l=Math.max(l,v.length)}else if(xR(p)){const b=p,x=b.fields.map(w=>new c0(b,w,`${b.name} ${w.name}`));for(const w of x)a[r][s]=this.createHeaderCell(w.field,n,{name:w.name,childRenderer:w.getChildRenderer(this.childRenderers)}),o.push(w),s++}else a[r][s]=this.createHeaderCell(p,n),o.push(p),s++}if(l>0&&o.length>30)throw new Error("Pivot limit of 30 columns exceeded.");if(!n&&this.options.isDrillingEnabled){const p=this.document.createElement("th");p.style.cssText=`
|
|
67
67
|
padding: 8px;
|
|
68
68
|
color: var(--malloy-title-color, #505050);
|
|
69
69
|
border-bottom: 1px solid var(--malloy-border-color, #eaeaea);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/render",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.353",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/module/index.umd.js",
|
|
6
6
|
"types": "dist/module/index.d.ts",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"generate-flow": "ts-node ../../scripts/gen-flow.ts"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@malloydata/malloy-interfaces": "0.0.
|
|
33
|
-
"@malloydata/malloy-tag": "0.0.
|
|
32
|
+
"@malloydata/malloy-interfaces": "0.0.353",
|
|
33
|
+
"@malloydata/malloy-tag": "0.0.353",
|
|
34
34
|
"@tanstack/solid-virtual": "^3.10.4",
|
|
35
35
|
"lodash": "^4.17.20",
|
|
36
36
|
"luxon": "^3.5.0",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"vega-lite": "^5.2.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@malloydata/db-duckdb": "0.0.
|
|
46
|
-
"@malloydata/malloy": "0.0.
|
|
45
|
+
"@malloydata/db-duckdb": "0.0.353",
|
|
46
|
+
"@malloydata/malloy": "0.0.353",
|
|
47
47
|
"@storybook/addon-essentials": "^8.6.15",
|
|
48
48
|
"@storybook/addon-interactions": "^8.6.15",
|
|
49
49
|
"@storybook/addon-links": "^8.6.15",
|