@malloydata/render 0.0.239-dev250226010331 → 0.0.239-dev250226183425

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.
@@ -56752,7 +56752,7 @@ function GDe(t) {
56752
56752
  }
56753
56753
  }
56754
56754
  (function(t) {
56755
- Object.defineProperty(t, "__esModule", { value: !0 }), t.InMemoryURLReader = t.EmptyURLReader = t.SingleConnectionRuntime = t.ConnectionRuntime = t.AtomicFieldType = t.Runtime = t.Malloy = t.Model = t.MalloyTranslator = t.composeSQLExpr = t.indent = t.expressionIsUngroupedAggregate = t.expressionIsScalar = t.expressionIsCalculation = t.expressionIsAnalytic = t.expressionIsAggregate = t.mkFieldDef = t.mkArrayDef = t.isScalarArray = t.isRepeatedRecord = t.isSamplingRows = t.isSamplingPercent = t.isSamplingEnable = t.isJoinedSource = t.isJoined = t.isLeafAtomic = t.Segment = t.isSourceDef = t.TinyParser = t.Dialect = t.spread = t.literal = t.variadicParam = t.param = t.makeParam = t.sql = t.maxScalar = t.minAggregate = t.anyExprType = t.minScalar = t.overload = t.qtz = t.arg = t.registerDialect = t.MySQLDialect = t.SnowflakeDialect = t.PostgresDialect = t.TrinoDialect = t.StandardSQLDialect = t.DuckDBDialect = void 0, t.annotationToTag = t.modelDefToModelInfo = t.toAsyncGenerator = t.CacheManager = t.InMemoryModelCache = t.Explore = t.DataWriter = t.Parse = t.JSONWriter = t.CSVWriter = t.QueryMaterializer = t.Result = t.PreparedResult = t.TimestampTimeframe = t.DateTimeframe = t.SourceRelationship = t.JoinRelationship = t.MalloyError = t.FixedConnectionMap = void 0;
56755
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.InMemoryURLReader = t.EmptyURLReader = t.SingleConnectionRuntime = t.ConnectionRuntime = t.AtomicFieldType = t.Runtime = t.Malloy = t.Model = t.MalloyTranslator = t.composeSQLExpr = t.indent = t.expressionIsUngroupedAggregate = t.expressionIsScalar = t.expressionIsCalculation = t.expressionIsAnalytic = t.expressionIsAggregate = t.mkFieldDef = t.mkArrayDef = t.isScalarArray = t.isRepeatedRecord = t.isSamplingRows = t.isSamplingPercent = t.isSamplingEnable = t.isJoinedSource = t.isJoined = t.isLeafAtomic = t.Segment = t.isSourceDef = t.TinyParser = t.Dialect = t.spread = t.literal = t.variadicParam = t.param = t.makeParam = t.sql = t.maxScalar = t.minAggregate = t.anyExprType = t.minScalar = t.overload = t.qtz = t.arg = t.registerDialect = t.MySQLDialect = t.SnowflakeDialect = t.PostgresDialect = t.TrinoDialect = t.StandardSQLDialect = t.DuckDBDialect = void 0, t.annotationToTaglines = t.annotationToTag = t.modelDefToModelInfo = t.toAsyncGenerator = t.CacheManager = t.InMemoryModelCache = t.Explore = t.DataWriter = t.Parse = t.JSONWriter = t.CSVWriter = t.QueryMaterializer = t.Result = t.PreparedResult = t.TimestampTimeframe = t.DateTimeframe = t.SourceRelationship = t.JoinRelationship = t.MalloyError = t.FixedConnectionMap = void 0;
56756
56756
  var e = Ph;
56757
56757
  Object.defineProperty(t, "DuckDBDialect", { enumerable: !0, get: function() {
56758
56758
  return e.DuckDBDialect;
@@ -56904,6 +56904,8 @@ function GDe(t) {
56904
56904
  var u = ds;
56905
56905
  Object.defineProperty(t, "annotationToTag", { enumerable: !0, get: function() {
56906
56906
  return u.annotationToTag;
56907
+ } }), Object.defineProperty(t, "annotationToTaglines", { enumerable: !0, get: function() {
56908
+ return u.annotationToTaglines;
56907
56909
  } });
56908
56910
  })(Pt);
56909
56911
  function WDe(t, e, n, r) {
@@ -1293,7 +1293,7 @@ ${R}`,b)}else{if(_.urls)for(const R of _.urls)try{if(N_(R))throw new Error("In o
1293
1293
  `)}}this.stream.write(`
1294
1294
  ]
1295
1295
  `),this.stream.close()}}Oe.JSONWriter=MDe;class UDe extends c8{constructor(){super(...arguments),this.columnSeparator=",",this.rowSeparator=`
1296
- `,this.quoteCharacter='"',this.includeHeader=!0,this.emptyCell=""}escape(e){const n=e.includes(this.quoteCharacter),r=e.includes(this.columnSeparator),i=e.includes(this.rowSeparator),s=r||n||i;return n&&(e=e.replace(new RegExp(this.quoteCharacter,"g"),this.quoteCharacter+this.quoteCharacter)),s&&(e=this.quoteCharacter+e+this.quoteCharacter),e}stringify(e){return e===null?this.emptyCell:e instanceof Date?e.toISOString():typeof e=="boolean"||typeof e=="number"?JSON.stringify(e):`${e}`}getColWeight(e){let n=e;Array.isArray(e)&&(n=e[0]);let r=0;for(const i in n){r=r+1;const s=n[i];if(Array.isArray(s)){const o=this.getColWeight(s)-1;r=r+o}}return r}getHeaderRow(e){const n=[];let r=0;for(const i in e){n.push(this.escape(i));const s=e[i];if(r++,Array.isArray(s)){const o=this.getColWeight(s)-1;r=r+o;for(let u=0;u<o;u++)n.push(this.emptyCell)}}return{rows:[n.join(this.columnSeparator)],length:1,width:r}}mergeMatrices(e){const n=Math.max(...e.map(s=>s.length)),r=e.reduce((s,o)=>s+o.width,0),i=[];for(let s=0;s<n;s++){const o=[];for(const u of e)if(s<u.length)o.push(u.rows[s]);else{const a=Array(u.width).fill(this.emptyCell);o.push(...a)}i.push(o.join(this.columnSeparator))}return{rows:i,length:n,width:r}}getChildMatrix(e){if(Array.isArray(e)){if(e.length===0)return{rows:[""],length:1,width:1}}else return{rows:["Invalid data found, value is not an array"],length:1,width:1};const n=[],r=this.getHeaderRow(e[0]);n.push(...r.rows);const i=r.width;let s=1;for(const o of e){const u=this.getRowMatrix(o);s=s+u.length,n.push(...u.rows)}return{rows:n,length:s,width:i}}getRowMatrix(e){const n=[];for(const r in e){const i=e[r];if(Array.isArray(i)){const s=this.getChildMatrix(i);n.push(s)}else{const s={rows:[this.stringify(i)],length:1,width:1};n.push(s)}}return this.mergeMatrices(n)}async process(e){let n=!1;for await(const r of e){if(!n&&this.includeHeader){const s=this.getHeaderRow(r.toObject());this.stream.write(s.rows[0]),this.stream.write(this.rowSeparator),n=!0}const i=this.getRowMatrix(r.toObject());for(const s of i.rows)this.stream.write(s),this.stream.write(this.rowSeparator)}this.stream.close()}}Oe.CSVWriter=UDe;class jDe{constructor(e){this.modelCache=e,this.modelDependencies=new Map,this.modelInvalidationKeys=new Map}async getCachedModelDef(e,n){const r=this.modelDependencies.get(n);if(r===void 0)return;const i=[n,...O_(r)],s={};for(const u of i){const a=this.modelInvalidationKeys.get(u);if(a==null)return;s[u]=a}for(const u of i)if(await f8(e,new URL(u))!==s[u])return;const o=await this.modelCache.getModel(new URL(n));if(o!==void 0){for(const u of i)if(o.invalidationKeys[u]!==s[u])return;return{modelDef:o.modelDef,invalidationKeys:s}}}async setCachedModelDef(e,n){this.modelDependencies.set(e,n.modelDef.dependencies);const r={};for(const s of[e,...O_(n.modelDef.dependencies)]){if(n.invalidationKeys[s]===null)return!1;if(n.invalidationKeys[s]===void 0)throw new Error(`Missing invalidation key for dependency ${s}`);this.modelInvalidationKeys.set(s,n.invalidationKeys[s]),r[s]=n.invalidationKeys[s]}return!!await this.modelCache.setModel(new URL(e),{modelDef:n.modelDef,invalidationKeys:r})}}Oe.CacheManager=jDe;function O_(t){return[...Object.keys(t),...Object.values(t).map(O_).flat()]}class qDe{constructor(){this.models=new Map}async getModel(e){return Promise.resolve(this.models.get(e.toString()))}async setModel(e,n){return this.models.set(e.toString(),n),Promise.resolve(!0)}}Oe.InMemoryModelCache=qDe;function oV(t){return(0,LDe.v5)(t,"76c17e9d-f3ce-5f2d-bfde-98ad3d2a37f6")}async function F_(t,e){const n=await t.readURL(e),{contents:r,invalidationKey:i}=typeof n=="string"?{contents:n,invalidationKey:void 0}:n;return{contents:r,invalidationKey:N_(e.toString())?null:i??oV(r)}}async function f8(t,e){return N_(e.toString())?null:t.getInvalidationKey!==void 0?await t.getInvalidationKey(e):(await F_(t,e)).invalidationKey}function N_(t){return t.startsWith("internal://")}var w_={};Object.defineProperty(w_,"__esModule",{value:!0}),w_.toAsyncGenerator=void 0;async function*HDe(t){let e=!1;function n(i){let s;const o=new Promise(u=>{s=u});return i(u=>{s({done:!0,isError:!0,error:u})},u=>{s({done:!1,value:u,isError:!1,next:new Promise(a=>{s=a})})},()=>{s({done:!0,isError:!1})}),o}let r=n(t);for(;!e;){const i=await r;if(i.done){if(e=!0,i.isError)throw i.error;break}else r=i.next,yield i.value}}w_.toAsyncGenerator=HDe;var L_={};Object.defineProperty(L_,"__esModule",{value:!0}),L_.modelDefToModelInfo=void 0;const Ga=Li,uV=Bs;function zDe(t){const e={entries:[],anonymous_queries:[]};for(const[n,r]of Object.entries(t.contents))if(t.exports.includes(n)){if((0,Ga.isSourceDef)(r)){const i={kind:"source",name:n,schema:{fields:I_(r,r.fields)}};e.entries.push(i)}else if(r.type==="query"){const i=(0,uV.getResultStructDefForQuery)(t,r),s={kind:"source",name:n,schema:{fields:I_(i,i.fields)}};e.entries.push(s)}}return e}L_.modelDefToModelInfo=zDe;function I_(t,e){var n,r,i;const s=[];for(const o of e)if((0,Ga.isTurtle)(o)){const u=(0,uV.getResultStructDefForView)(t,o),a={kind:"view",name:(n=o.as)!==null&&n!==void 0?n:o.name,schema:{fields:I_(u,u.fields)}};s.push(a)}else if((0,Ga.isAtomic)(o)){const u=(0,Ga.expressionIsAggregate)(o.expressionType),a=(0,Ga.expressionIsScalar)(o.expressionType);if(!u&&!a||o.type==="error")continue;const l={kind:u?"measure":"dimension",name:(r=o.as)!==null&&r!==void 0?r:o.name,type:x8(o)};s.push(l)}else if((0,Ga.isJoinedSource)(o)){const u={kind:"join",name:(i=o.as)!==null&&i!==void 0?i:o.name,schema:{fields:I_(o,o.fields)},relationship:o.join};s.push(u)}return s}function x8(t){if((0,Ga.isLeafAtomic)(t))switch(t.type){case"string":return{kind:"string_type"};case"number":return{kind:"number_type",subtype:t.numberType==="float"?"decimal":t.numberType==="integer"?"integer":void 0};case"boolean":return{kind:"boolean_type"};case"date":return{kind:"date_type",timeframe:QDe(t.timeframe)};case"timestamp":return{kind:"timestamp_type",timeframe:t.timeframe};case"json":return{kind:"json_type"};case"sql native":return{kind:"sql_native_type",sql_type:t.rawType};case"error":throw new Error("Error type is not supported in stable interface")}else{if((0,Ga.isRepeatedRecord)(t))return{kind:"array_type",element_type:aV(t)};if(t.type==="record")return aV(t);if(t.type==="array")return{kind:"array_type",element_type:x8(t.elementTypeDef)}}throw new Error("Unexpected field type")}function aV(t){return{kind:"record_type",fields:t.fields.map(e=>{if((0,Ga.isAtomic)(e))return{name:e.name,type:x8(e)};throw new Error("Expected record type to not have a table as its child")})}}function QDe(t){switch(t){case void 0:return;case"day":case"week":case"month":case"year":case"quarter":return t;default:throw new Error("Invalid date timeframe")}}function Rlt(t){return t}function Dlt(t){return t}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryURLReader=t.EmptyURLReader=t.SingleConnectionRuntime=t.ConnectionRuntime=t.AtomicFieldType=t.Runtime=t.Malloy=t.Model=t.MalloyTranslator=t.composeSQLExpr=t.indent=t.expressionIsUngroupedAggregate=t.expressionIsScalar=t.expressionIsCalculation=t.expressionIsAnalytic=t.expressionIsAggregate=t.mkFieldDef=t.mkArrayDef=t.isScalarArray=t.isRepeatedRecord=t.isSamplingRows=t.isSamplingPercent=t.isSamplingEnable=t.isJoinedSource=t.isJoined=t.isLeafAtomic=t.Segment=t.isSourceDef=t.TinyParser=t.Dialect=t.spread=t.literal=t.variadicParam=t.param=t.makeParam=t.sql=t.maxScalar=t.minAggregate=t.anyExprType=t.minScalar=t.overload=t.qtz=t.arg=t.registerDialect=t.MySQLDialect=t.SnowflakeDialect=t.PostgresDialect=t.TrinoDialect=t.StandardSQLDialect=t.DuckDBDialect=void 0,t.annotationToTag=t.modelDefToModelInfo=t.toAsyncGenerator=t.CacheManager=t.InMemoryModelCache=t.Explore=t.DataWriter=t.Parse=t.JSONWriter=t.CSVWriter=t.QueryMaterializer=t.Result=t.PreparedResult=t.TimestampTimeframe=t.DateTimeframe=t.SourceRelationship=t.JoinRelationship=t.MalloyError=t.FixedConnectionMap=void 0;var e=Hx;Object.defineProperty(t,"DuckDBDialect",{enumerable:!0,get:function(){return e.DuckDBDialect}}),Object.defineProperty(t,"StandardSQLDialect",{enumerable:!0,get:function(){return e.StandardSQLDialect}}),Object.defineProperty(t,"TrinoDialect",{enumerable:!0,get:function(){return e.TrinoDialect}}),Object.defineProperty(t,"PostgresDialect",{enumerable:!0,get:function(){return e.PostgresDialect}}),Object.defineProperty(t,"SnowflakeDialect",{enumerable:!0,get:function(){return e.SnowflakeDialect}}),Object.defineProperty(t,"MySQLDialect",{enumerable:!0,get:function(){return e.MySQLDialect}}),Object.defineProperty(t,"registerDialect",{enumerable:!0,get:function(){return e.registerDialect}}),Object.defineProperty(t,"arg",{enumerable:!0,get:function(){return e.arg}}),Object.defineProperty(t,"qtz",{enumerable:!0,get:function(){return e.qtz}}),Object.defineProperty(t,"overload",{enumerable:!0,get:function(){return e.overload}}),Object.defineProperty(t,"minScalar",{enumerable:!0,get:function(){return e.minScalar}}),Object.defineProperty(t,"anyExprType",{enumerable:!0,get:function(){return e.anyExprType}}),Object.defineProperty(t,"minAggregate",{enumerable:!0,get:function(){return e.minAggregate}}),Object.defineProperty(t,"maxScalar",{enumerable:!0,get:function(){return e.maxScalar}}),Object.defineProperty(t,"sql",{enumerable:!0,get:function(){return e.sql}}),Object.defineProperty(t,"makeParam",{enumerable:!0,get:function(){return e.makeParam}}),Object.defineProperty(t,"param",{enumerable:!0,get:function(){return e.param}}),Object.defineProperty(t,"variadicParam",{enumerable:!0,get:function(){return e.variadicParam}}),Object.defineProperty(t,"literal",{enumerable:!0,get:function(){return e.literal}}),Object.defineProperty(t,"spread",{enumerable:!0,get:function(){return e.spread}}),Object.defineProperty(t,"Dialect",{enumerable:!0,get:function(){return e.Dialect}}),Object.defineProperty(t,"TinyParser",{enumerable:!0,get:function(){return e.TinyParser}});var n=Li;Object.defineProperty(t,"isSourceDef",{enumerable:!0,get:function(){return n.isSourceDef}}),Object.defineProperty(t,"Segment",{enumerable:!0,get:function(){return n.Segment}}),Object.defineProperty(t,"isLeafAtomic",{enumerable:!0,get:function(){return n.isLeafAtomic}}),Object.defineProperty(t,"isJoined",{enumerable:!0,get:function(){return n.isJoined}}),Object.defineProperty(t,"isJoinedSource",{enumerable:!0,get:function(){return n.isJoinedSource}}),Object.defineProperty(t,"isSamplingEnable",{enumerable:!0,get:function(){return n.isSamplingEnable}}),Object.defineProperty(t,"isSamplingPercent",{enumerable:!0,get:function(){return n.isSamplingPercent}}),Object.defineProperty(t,"isSamplingRows",{enumerable:!0,get:function(){return n.isSamplingRows}}),Object.defineProperty(t,"isRepeatedRecord",{enumerable:!0,get:function(){return n.isRepeatedRecord}}),Object.defineProperty(t,"isScalarArray",{enumerable:!0,get:function(){return n.isScalarArray}}),Object.defineProperty(t,"mkArrayDef",{enumerable:!0,get:function(){return n.mkArrayDef}}),Object.defineProperty(t,"mkFieldDef",{enumerable:!0,get:function(){return n.mkFieldDef}}),Object.defineProperty(t,"expressionIsAggregate",{enumerable:!0,get:function(){return n.expressionIsAggregate}}),Object.defineProperty(t,"expressionIsAnalytic",{enumerable:!0,get:function(){return n.expressionIsAnalytic}}),Object.defineProperty(t,"expressionIsCalculation",{enumerable:!0,get:function(){return n.expressionIsCalculation}}),Object.defineProperty(t,"expressionIsScalar",{enumerable:!0,get:function(){return n.expressionIsScalar}}),Object.defineProperty(t,"expressionIsUngroupedAggregate",{enumerable:!0,get:function(){return n.expressionIsUngroupedAggregate}}),Object.defineProperty(t,"indent",{enumerable:!0,get:function(){return n.indent}}),Object.defineProperty(t,"composeSQLExpr",{enumerable:!0,get:function(){return n.composeSQLExpr}});var r=iD;Object.defineProperty(t,"MalloyTranslator",{enumerable:!0,get:function(){return r.MalloyTranslator}});var i=Oe;Object.defineProperty(t,"Model",{enumerable:!0,get:function(){return i.Model}}),Object.defineProperty(t,"Malloy",{enumerable:!0,get:function(){return i.Malloy}}),Object.defineProperty(t,"Runtime",{enumerable:!0,get:function(){return i.Runtime}}),Object.defineProperty(t,"AtomicFieldType",{enumerable:!0,get:function(){return i.AtomicFieldType}}),Object.defineProperty(t,"ConnectionRuntime",{enumerable:!0,get:function(){return i.ConnectionRuntime}}),Object.defineProperty(t,"SingleConnectionRuntime",{enumerable:!0,get:function(){return i.SingleConnectionRuntime}}),Object.defineProperty(t,"EmptyURLReader",{enumerable:!0,get:function(){return i.EmptyURLReader}}),Object.defineProperty(t,"InMemoryURLReader",{enumerable:!0,get:function(){return i.InMemoryURLReader}}),Object.defineProperty(t,"FixedConnectionMap",{enumerable:!0,get:function(){return i.FixedConnectionMap}}),Object.defineProperty(t,"MalloyError",{enumerable:!0,get:function(){return i.MalloyError}}),Object.defineProperty(t,"JoinRelationship",{enumerable:!0,get:function(){return i.JoinRelationship}}),Object.defineProperty(t,"SourceRelationship",{enumerable:!0,get:function(){return i.SourceRelationship}}),Object.defineProperty(t,"DateTimeframe",{enumerable:!0,get:function(){return i.DateTimeframe}}),Object.defineProperty(t,"TimestampTimeframe",{enumerable:!0,get:function(){return i.TimestampTimeframe}}),Object.defineProperty(t,"PreparedResult",{enumerable:!0,get:function(){return i.PreparedResult}}),Object.defineProperty(t,"Result",{enumerable:!0,get:function(){return i.Result}}),Object.defineProperty(t,"QueryMaterializer",{enumerable:!0,get:function(){return i.QueryMaterializer}}),Object.defineProperty(t,"CSVWriter",{enumerable:!0,get:function(){return i.CSVWriter}}),Object.defineProperty(t,"JSONWriter",{enumerable:!0,get:function(){return i.JSONWriter}}),Object.defineProperty(t,"Parse",{enumerable:!0,get:function(){return i.Parse}}),Object.defineProperty(t,"DataWriter",{enumerable:!0,get:function(){return i.DataWriter}}),Object.defineProperty(t,"Explore",{enumerable:!0,get:function(){return i.Explore}}),Object.defineProperty(t,"InMemoryModelCache",{enumerable:!0,get:function(){return i.InMemoryModelCache}}),Object.defineProperty(t,"CacheManager",{enumerable:!0,get:function(){return i.CacheManager}});var s=w_;Object.defineProperty(t,"toAsyncGenerator",{enumerable:!0,get:function(){return s.toAsyncGenerator}});var o=L_;Object.defineProperty(t,"modelDefToModelInfo",{enumerable:!0,get:function(){return o.modelDefToModelInfo}});var u=ss;Object.defineProperty(t,"annotationToTag",{enumerable:!0,get:function(){return u.annotationToTag}})})(Pt);function GDe(t,e,n,r){var i=-1,s=t==null?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}var WDe=GDe;function VDe(t){return function(e){return t==null?void 0:t[e]}}var YDe=VDe,KDe=YDe,JDe={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},XDe=KDe(JDe),ZDe=XDe,e7e=typeof T=="object"&&T&&T.Object===Object&&T,t7e=e7e,n7e=t7e,r7e=typeof self=="object"&&self&&self.Object===Object&&self,i7e=n7e||r7e||Function("return this")(),s7e=i7e,o7e=s7e,u7e=o7e.Symbol,d8=u7e;function a7e(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var l7e=a7e,c7e=Array.isArray,f7e=c7e,lV=d8,cV=Object.prototype,x7e=cV.hasOwnProperty,d7e=cV.toString,Yg=lV?lV.toStringTag:void 0;function h7e(t){var e=x7e.call(t,Yg),n=t[Yg];try{t[Yg]=void 0;var r=!0}catch{}var i=d7e.call(t);return r&&(e?t[Yg]=n:delete t[Yg]),i}var p7e=h7e,g7e=Object.prototype,m7e=g7e.toString;function y7e(t){return m7e.call(t)}var E7e=y7e,fV=d8,A7e=p7e,v7e=E7e,C7e="[object Null]",_7e="[object Undefined]",xV=fV?fV.toStringTag:void 0;function S7e(t){return t==null?t===void 0?_7e:C7e:xV&&xV in Object(t)?A7e(t):v7e(t)}var b7e=S7e;function T7e(t){return t!=null&&typeof t=="object"}var R7e=T7e,D7e=b7e,O7e=R7e,F7e="[object Symbol]";function N7e(t){return typeof t=="symbol"||O7e(t)&&D7e(t)==F7e}var w7e=N7e,dV=d8,L7e=l7e,I7e=f7e,B7e=w7e,$7e=1/0,hV=dV?dV.prototype:void 0,pV=hV?hV.toString:void 0;function gV(t){if(typeof t=="string")return t;if(I7e(t))return L7e(t,gV)+"";if(B7e(t))return pV?pV.call(t):"";var e=t+"";return e=="0"&&1/t==-$7e?"-0":e}var k7e=gV,P7e=k7e;function M7e(t){return t==null?"":P7e(t)}var h8=M7e,U7e=ZDe,j7e=h8,q7e=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,H7e="\\u0300-\\u036f",z7e="\\ufe20-\\ufe2f",Q7e="\\u20d0-\\u20ff",G7e=H7e+z7e+Q7e,W7e="["+G7e+"]",V7e=RegExp(W7e,"g");function Y7e(t){return t=j7e(t),t&&t.replace(q7e,U7e).replace(V7e,"")}var K7e=Y7e,J7e=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function X7e(t){return t.match(J7e)||[]}var Z7e=X7e,eOe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function tOe(t){return eOe.test(t)}var nOe=tOe,mV="\\ud800-\\udfff",rOe="\\u0300-\\u036f",iOe="\\ufe20-\\ufe2f",sOe="\\u20d0-\\u20ff",oOe=rOe+iOe+sOe,yV="\\u2700-\\u27bf",EV="a-z\\xdf-\\xf6\\xf8-\\xff",uOe="\\xac\\xb1\\xd7\\xf7",aOe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",lOe="\\u2000-\\u206f",cOe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",AV="A-Z\\xc0-\\xd6\\xd8-\\xde",fOe="\\ufe0e\\ufe0f",vV=uOe+aOe+lOe+cOe,CV="['’]",_V="["+vV+"]",xOe="["+oOe+"]",SV="\\d+",dOe="["+yV+"]",bV="["+EV+"]",TV="[^"+mV+vV+SV+yV+EV+AV+"]",hOe="\\ud83c[\\udffb-\\udfff]",pOe="(?:"+xOe+"|"+hOe+")",gOe="[^"+mV+"]",RV="(?:\\ud83c[\\udde6-\\uddff]){2}",DV="[\\ud800-\\udbff][\\udc00-\\udfff]",Ch="["+AV+"]",mOe="\\u200d",OV="(?:"+bV+"|"+TV+")",yOe="(?:"+Ch+"|"+TV+")",FV="(?:"+CV+"(?:d|ll|m|re|s|t|ve))?",NV="(?:"+CV+"(?:D|LL|M|RE|S|T|VE))?",wV=pOe+"?",LV="["+fOe+"]?",EOe="(?:"+mOe+"(?:"+[gOe,RV,DV].join("|")+")"+LV+wV+")*",AOe="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vOe="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",COe=LV+wV+EOe,_Oe="(?:"+[dOe,RV,DV].join("|")+")"+COe,SOe=RegExp([Ch+"?"+bV+"+"+FV+"(?="+[_V,Ch,"$"].join("|")+")",yOe+"+"+NV+"(?="+[_V,Ch+OV,"$"].join("|")+")",Ch+"?"+OV+"+"+FV,Ch+"+"+NV,vOe,AOe,SV,_Oe].join("|"),"g");function bOe(t){return t.match(SOe)||[]}var TOe=bOe,ROe=Z7e,DOe=nOe,OOe=h8,FOe=TOe;function NOe(t,e,n){return t=OOe(t),e=n?void 0:e,e===void 0?DOe(t)?FOe(t):ROe(t):t.match(e)||[]}var wOe=NOe,LOe=WDe,IOe=K7e,BOe=wOe,$Oe="['’]",kOe=RegExp($Oe,"g");function POe(t){return function(e){return LOe(BOe(IOe(e).replace(kOe,"")),t,"")}}var MOe=POe;function UOe(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}var jOe=UOe,qOe=jOe;function HOe(t,e,n){var r=t.length;return n=n===void 0?r:n,!e&&n>=r?t:qOe(t,e,n)}var zOe=HOe,QOe="\\ud800-\\udfff",GOe="\\u0300-\\u036f",WOe="\\ufe20-\\ufe2f",VOe="\\u20d0-\\u20ff",YOe=GOe+WOe+VOe,KOe="\\ufe0e\\ufe0f",JOe="\\u200d",XOe=RegExp("["+JOe+QOe+YOe+KOe+"]");function ZOe(t){return XOe.test(t)}var IV=ZOe;function e8e(t){return t.split("")}var t8e=e8e,BV="\\ud800-\\udfff",n8e="\\u0300-\\u036f",r8e="\\ufe20-\\ufe2f",i8e="\\u20d0-\\u20ff",s8e=n8e+r8e+i8e,o8e="\\ufe0e\\ufe0f",u8e="["+BV+"]",p8="["+s8e+"]",g8="\\ud83c[\\udffb-\\udfff]",a8e="(?:"+p8+"|"+g8+")",$V="[^"+BV+"]",kV="(?:\\ud83c[\\udde6-\\uddff]){2}",PV="[\\ud800-\\udbff][\\udc00-\\udfff]",l8e="\\u200d",MV=a8e+"?",UV="["+o8e+"]?",c8e="(?:"+l8e+"(?:"+[$V,kV,PV].join("|")+")"+UV+MV+")*",f8e=UV+MV+c8e,x8e="(?:"+[$V+p8+"?",p8,kV,PV,u8e].join("|")+")",d8e=RegExp(g8+"(?="+g8+")|"+x8e+f8e,"g");function h8e(t){return t.match(d8e)||[]}var p8e=h8e,g8e=t8e,m8e=IV,y8e=p8e;function E8e(t){return m8e(t)?y8e(t):g8e(t)}var A8e=E8e,v8e=zOe,C8e=IV,_8e=A8e,S8e=h8;function b8e(t){return function(e){e=S8e(e);var n=C8e(e)?_8e(e):void 0,r=n?n[0]:e.charAt(0),i=n?v8e(n,1).join(""):e.slice(1);return r[t]()+i}}var T8e=b8e,R8e=T8e,D8e=R8e("toUpperCase"),O8e=D8e,F8e=MOe,N8e=O8e,w8e=F8e(function(t,e,n){return t+(n?" ":"")+N8e(e)}),L8e=w8e;const I8e=ky(L8e);function ji(t,e,n=!1){if(t!==void 0)switch(t){case"ordinal":return{range:["#C2D5EE","#1A73E8"]};case"temporal":case"quantitative":return e?n?{range:["#6BA4EE","#EEA361"]}:{range:["#1A73E8","#E8710A"]}:{range:["#C2D5EE","#1A73E8"]};case"nominal":return n?{range:["#6BA4EE","#66CEDC","#EC72B8","#EEA361","#F9C85B","#AACD85","#B87CED","#ACB0B3"]}:{range:["#1A73E8","#12B5CB","#E52592","#E8710A","#F9AB00","#7CB342","#9334E6","#80868B"]}}}function on(t,e){return t.toString().padStart(e,"0")}function B_(t,e,n){e||(e=Pt.TimestampTimeframe.Second);let r=!1;switch(e){case Pt.TimestampTimeframe.Hour:case Pt.TimestampTimeframe.Minute:case Pt.TimestampTimeframe.Second:r=!0;break}const i=lt.fromJSDate(t,{zone:r&&n?n:"UTC"});switch(e){case Pt.TimestampTimeframe.Year:case Pt.DateTimeframe.Year:return`${on(i.year,4)}`;case Pt.TimestampTimeframe.Quarter:case Pt.DateTimeframe.Quarter:{const s=on(i.year,4),o=Math.floor(i.month/3)+1;return`${s}-Q${o}`}case Pt.TimestampTimeframe.Month:case Pt.DateTimeframe.Month:{const s=on(i.year,2),o=on(i.month,2);return`${s}-${o}`}case Pt.TimestampTimeframe.Week:case Pt.DateTimeframe.Week:{const s=on(i.year,2),o=on(i.month,2),u=on(i.day,2);return`WK${s}-${o}-${u}`}case Pt.DateTimeframe.Day:case Pt.TimestampTimeframe.Day:{const s=on(i.year,2),o=on(i.month,2),u=on(i.day,2);return`${s}-${o}-${u}`}case Pt.TimestampTimeframe.Hour:{const s=on(i.year,2),o=on(i.month,2),u=on(i.day,2),a=on(i.hour,2);return`${s}-${o}-${u} ${a}:00 for 1 hour`}case Pt.TimestampTimeframe.Minute:{const s=on(i.year,2),o=on(i.month,2),u=on(i.day,2),a=on(i.hour,2),l=on(i.minute,2);return`${s}-${o}-${u} ${a}:${l}`}case Pt.TimestampTimeframe.Second:{const s=on(i.year,2),o=on(i.month,2),u=on(i.day,2),a=on(i.hour,2),l=on(i.minute,2),c=on(i.second,2);return`${s}-${o}-${u} ${a}:${l}:${c}`}default:throw new Error("Unknown timeframe.")}}function B8e(t,e){const n=lt.fromJSDate(t,{zone:e??"UTC"});return new Date(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond)}let m8;const $8e=100;async function $_(){const t=Date.now();if(!(m8&&t<m8+$8e))return m8=t,new Promise(e=>{setTimeout(e,0)})}function Es(t,e){const n=t.createElement("span");return n.classList.add("error"),n.appendChild(t.createTextNode(typeof e=="string"?e:e.message)),n}function Kg(t){const e=t.createElement("span");return e.appendChild(t.createTextNode("∅")),e.classList.add("value-null"),e}function jV(t){const e=t.createElement("div");return e.classList.add("drill-icon"),e.innerHTML=`
1296
+ `,this.quoteCharacter='"',this.includeHeader=!0,this.emptyCell=""}escape(e){const n=e.includes(this.quoteCharacter),r=e.includes(this.columnSeparator),i=e.includes(this.rowSeparator),s=r||n||i;return n&&(e=e.replace(new RegExp(this.quoteCharacter,"g"),this.quoteCharacter+this.quoteCharacter)),s&&(e=this.quoteCharacter+e+this.quoteCharacter),e}stringify(e){return e===null?this.emptyCell:e instanceof Date?e.toISOString():typeof e=="boolean"||typeof e=="number"?JSON.stringify(e):`${e}`}getColWeight(e){let n=e;Array.isArray(e)&&(n=e[0]);let r=0;for(const i in n){r=r+1;const s=n[i];if(Array.isArray(s)){const o=this.getColWeight(s)-1;r=r+o}}return r}getHeaderRow(e){const n=[];let r=0;for(const i in e){n.push(this.escape(i));const s=e[i];if(r++,Array.isArray(s)){const o=this.getColWeight(s)-1;r=r+o;for(let u=0;u<o;u++)n.push(this.emptyCell)}}return{rows:[n.join(this.columnSeparator)],length:1,width:r}}mergeMatrices(e){const n=Math.max(...e.map(s=>s.length)),r=e.reduce((s,o)=>s+o.width,0),i=[];for(let s=0;s<n;s++){const o=[];for(const u of e)if(s<u.length)o.push(u.rows[s]);else{const a=Array(u.width).fill(this.emptyCell);o.push(...a)}i.push(o.join(this.columnSeparator))}return{rows:i,length:n,width:r}}getChildMatrix(e){if(Array.isArray(e)){if(e.length===0)return{rows:[""],length:1,width:1}}else return{rows:["Invalid data found, value is not an array"],length:1,width:1};const n=[],r=this.getHeaderRow(e[0]);n.push(...r.rows);const i=r.width;let s=1;for(const o of e){const u=this.getRowMatrix(o);s=s+u.length,n.push(...u.rows)}return{rows:n,length:s,width:i}}getRowMatrix(e){const n=[];for(const r in e){const i=e[r];if(Array.isArray(i)){const s=this.getChildMatrix(i);n.push(s)}else{const s={rows:[this.stringify(i)],length:1,width:1};n.push(s)}}return this.mergeMatrices(n)}async process(e){let n=!1;for await(const r of e){if(!n&&this.includeHeader){const s=this.getHeaderRow(r.toObject());this.stream.write(s.rows[0]),this.stream.write(this.rowSeparator),n=!0}const i=this.getRowMatrix(r.toObject());for(const s of i.rows)this.stream.write(s),this.stream.write(this.rowSeparator)}this.stream.close()}}Oe.CSVWriter=UDe;class jDe{constructor(e){this.modelCache=e,this.modelDependencies=new Map,this.modelInvalidationKeys=new Map}async getCachedModelDef(e,n){const r=this.modelDependencies.get(n);if(r===void 0)return;const i=[n,...O_(r)],s={};for(const u of i){const a=this.modelInvalidationKeys.get(u);if(a==null)return;s[u]=a}for(const u of i)if(await f8(e,new URL(u))!==s[u])return;const o=await this.modelCache.getModel(new URL(n));if(o!==void 0){for(const u of i)if(o.invalidationKeys[u]!==s[u])return;return{modelDef:o.modelDef,invalidationKeys:s}}}async setCachedModelDef(e,n){this.modelDependencies.set(e,n.modelDef.dependencies);const r={};for(const s of[e,...O_(n.modelDef.dependencies)]){if(n.invalidationKeys[s]===null)return!1;if(n.invalidationKeys[s]===void 0)throw new Error(`Missing invalidation key for dependency ${s}`);this.modelInvalidationKeys.set(s,n.invalidationKeys[s]),r[s]=n.invalidationKeys[s]}return!!await this.modelCache.setModel(new URL(e),{modelDef:n.modelDef,invalidationKeys:r})}}Oe.CacheManager=jDe;function O_(t){return[...Object.keys(t),...Object.values(t).map(O_).flat()]}class qDe{constructor(){this.models=new Map}async getModel(e){return Promise.resolve(this.models.get(e.toString()))}async setModel(e,n){return this.models.set(e.toString(),n),Promise.resolve(!0)}}Oe.InMemoryModelCache=qDe;function oV(t){return(0,LDe.v5)(t,"76c17e9d-f3ce-5f2d-bfde-98ad3d2a37f6")}async function F_(t,e){const n=await t.readURL(e),{contents:r,invalidationKey:i}=typeof n=="string"?{contents:n,invalidationKey:void 0}:n;return{contents:r,invalidationKey:N_(e.toString())?null:i??oV(r)}}async function f8(t,e){return N_(e.toString())?null:t.getInvalidationKey!==void 0?await t.getInvalidationKey(e):(await F_(t,e)).invalidationKey}function N_(t){return t.startsWith("internal://")}var w_={};Object.defineProperty(w_,"__esModule",{value:!0}),w_.toAsyncGenerator=void 0;async function*HDe(t){let e=!1;function n(i){let s;const o=new Promise(u=>{s=u});return i(u=>{s({done:!0,isError:!0,error:u})},u=>{s({done:!1,value:u,isError:!1,next:new Promise(a=>{s=a})})},()=>{s({done:!0,isError:!1})}),o}let r=n(t);for(;!e;){const i=await r;if(i.done){if(e=!0,i.isError)throw i.error;break}else r=i.next,yield i.value}}w_.toAsyncGenerator=HDe;var L_={};Object.defineProperty(L_,"__esModule",{value:!0}),L_.modelDefToModelInfo=void 0;const Ga=Li,uV=Bs;function zDe(t){const e={entries:[],anonymous_queries:[]};for(const[n,r]of Object.entries(t.contents))if(t.exports.includes(n)){if((0,Ga.isSourceDef)(r)){const i={kind:"source",name:n,schema:{fields:I_(r,r.fields)}};e.entries.push(i)}else if(r.type==="query"){const i=(0,uV.getResultStructDefForQuery)(t,r),s={kind:"source",name:n,schema:{fields:I_(i,i.fields)}};e.entries.push(s)}}return e}L_.modelDefToModelInfo=zDe;function I_(t,e){var n,r,i;const s=[];for(const o of e)if((0,Ga.isTurtle)(o)){const u=(0,uV.getResultStructDefForView)(t,o),a={kind:"view",name:(n=o.as)!==null&&n!==void 0?n:o.name,schema:{fields:I_(u,u.fields)}};s.push(a)}else if((0,Ga.isAtomic)(o)){const u=(0,Ga.expressionIsAggregate)(o.expressionType),a=(0,Ga.expressionIsScalar)(o.expressionType);if(!u&&!a||o.type==="error")continue;const l={kind:u?"measure":"dimension",name:(r=o.as)!==null&&r!==void 0?r:o.name,type:x8(o)};s.push(l)}else if((0,Ga.isJoinedSource)(o)){const u={kind:"join",name:(i=o.as)!==null&&i!==void 0?i:o.name,schema:{fields:I_(o,o.fields)},relationship:o.join};s.push(u)}return s}function x8(t){if((0,Ga.isLeafAtomic)(t))switch(t.type){case"string":return{kind:"string_type"};case"number":return{kind:"number_type",subtype:t.numberType==="float"?"decimal":t.numberType==="integer"?"integer":void 0};case"boolean":return{kind:"boolean_type"};case"date":return{kind:"date_type",timeframe:QDe(t.timeframe)};case"timestamp":return{kind:"timestamp_type",timeframe:t.timeframe};case"json":return{kind:"json_type"};case"sql native":return{kind:"sql_native_type",sql_type:t.rawType};case"error":throw new Error("Error type is not supported in stable interface")}else{if((0,Ga.isRepeatedRecord)(t))return{kind:"array_type",element_type:aV(t)};if(t.type==="record")return aV(t);if(t.type==="array")return{kind:"array_type",element_type:x8(t.elementTypeDef)}}throw new Error("Unexpected field type")}function aV(t){return{kind:"record_type",fields:t.fields.map(e=>{if((0,Ga.isAtomic)(e))return{name:e.name,type:x8(e)};throw new Error("Expected record type to not have a table as its child")})}}function QDe(t){switch(t){case void 0:return;case"day":case"week":case"month":case"year":case"quarter":return t;default:throw new Error("Invalid date timeframe")}}function Rlt(t){return t}function Dlt(t){return t}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryURLReader=t.EmptyURLReader=t.SingleConnectionRuntime=t.ConnectionRuntime=t.AtomicFieldType=t.Runtime=t.Malloy=t.Model=t.MalloyTranslator=t.composeSQLExpr=t.indent=t.expressionIsUngroupedAggregate=t.expressionIsScalar=t.expressionIsCalculation=t.expressionIsAnalytic=t.expressionIsAggregate=t.mkFieldDef=t.mkArrayDef=t.isScalarArray=t.isRepeatedRecord=t.isSamplingRows=t.isSamplingPercent=t.isSamplingEnable=t.isJoinedSource=t.isJoined=t.isLeafAtomic=t.Segment=t.isSourceDef=t.TinyParser=t.Dialect=t.spread=t.literal=t.variadicParam=t.param=t.makeParam=t.sql=t.maxScalar=t.minAggregate=t.anyExprType=t.minScalar=t.overload=t.qtz=t.arg=t.registerDialect=t.MySQLDialect=t.SnowflakeDialect=t.PostgresDialect=t.TrinoDialect=t.StandardSQLDialect=t.DuckDBDialect=void 0,t.annotationToTaglines=t.annotationToTag=t.modelDefToModelInfo=t.toAsyncGenerator=t.CacheManager=t.InMemoryModelCache=t.Explore=t.DataWriter=t.Parse=t.JSONWriter=t.CSVWriter=t.QueryMaterializer=t.Result=t.PreparedResult=t.TimestampTimeframe=t.DateTimeframe=t.SourceRelationship=t.JoinRelationship=t.MalloyError=t.FixedConnectionMap=void 0;var e=Hx;Object.defineProperty(t,"DuckDBDialect",{enumerable:!0,get:function(){return e.DuckDBDialect}}),Object.defineProperty(t,"StandardSQLDialect",{enumerable:!0,get:function(){return e.StandardSQLDialect}}),Object.defineProperty(t,"TrinoDialect",{enumerable:!0,get:function(){return e.TrinoDialect}}),Object.defineProperty(t,"PostgresDialect",{enumerable:!0,get:function(){return e.PostgresDialect}}),Object.defineProperty(t,"SnowflakeDialect",{enumerable:!0,get:function(){return e.SnowflakeDialect}}),Object.defineProperty(t,"MySQLDialect",{enumerable:!0,get:function(){return e.MySQLDialect}}),Object.defineProperty(t,"registerDialect",{enumerable:!0,get:function(){return e.registerDialect}}),Object.defineProperty(t,"arg",{enumerable:!0,get:function(){return e.arg}}),Object.defineProperty(t,"qtz",{enumerable:!0,get:function(){return e.qtz}}),Object.defineProperty(t,"overload",{enumerable:!0,get:function(){return e.overload}}),Object.defineProperty(t,"minScalar",{enumerable:!0,get:function(){return e.minScalar}}),Object.defineProperty(t,"anyExprType",{enumerable:!0,get:function(){return e.anyExprType}}),Object.defineProperty(t,"minAggregate",{enumerable:!0,get:function(){return e.minAggregate}}),Object.defineProperty(t,"maxScalar",{enumerable:!0,get:function(){return e.maxScalar}}),Object.defineProperty(t,"sql",{enumerable:!0,get:function(){return e.sql}}),Object.defineProperty(t,"makeParam",{enumerable:!0,get:function(){return e.makeParam}}),Object.defineProperty(t,"param",{enumerable:!0,get:function(){return e.param}}),Object.defineProperty(t,"variadicParam",{enumerable:!0,get:function(){return e.variadicParam}}),Object.defineProperty(t,"literal",{enumerable:!0,get:function(){return e.literal}}),Object.defineProperty(t,"spread",{enumerable:!0,get:function(){return e.spread}}),Object.defineProperty(t,"Dialect",{enumerable:!0,get:function(){return e.Dialect}}),Object.defineProperty(t,"TinyParser",{enumerable:!0,get:function(){return e.TinyParser}});var n=Li;Object.defineProperty(t,"isSourceDef",{enumerable:!0,get:function(){return n.isSourceDef}}),Object.defineProperty(t,"Segment",{enumerable:!0,get:function(){return n.Segment}}),Object.defineProperty(t,"isLeafAtomic",{enumerable:!0,get:function(){return n.isLeafAtomic}}),Object.defineProperty(t,"isJoined",{enumerable:!0,get:function(){return n.isJoined}}),Object.defineProperty(t,"isJoinedSource",{enumerable:!0,get:function(){return n.isJoinedSource}}),Object.defineProperty(t,"isSamplingEnable",{enumerable:!0,get:function(){return n.isSamplingEnable}}),Object.defineProperty(t,"isSamplingPercent",{enumerable:!0,get:function(){return n.isSamplingPercent}}),Object.defineProperty(t,"isSamplingRows",{enumerable:!0,get:function(){return n.isSamplingRows}}),Object.defineProperty(t,"isRepeatedRecord",{enumerable:!0,get:function(){return n.isRepeatedRecord}}),Object.defineProperty(t,"isScalarArray",{enumerable:!0,get:function(){return n.isScalarArray}}),Object.defineProperty(t,"mkArrayDef",{enumerable:!0,get:function(){return n.mkArrayDef}}),Object.defineProperty(t,"mkFieldDef",{enumerable:!0,get:function(){return n.mkFieldDef}}),Object.defineProperty(t,"expressionIsAggregate",{enumerable:!0,get:function(){return n.expressionIsAggregate}}),Object.defineProperty(t,"expressionIsAnalytic",{enumerable:!0,get:function(){return n.expressionIsAnalytic}}),Object.defineProperty(t,"expressionIsCalculation",{enumerable:!0,get:function(){return n.expressionIsCalculation}}),Object.defineProperty(t,"expressionIsScalar",{enumerable:!0,get:function(){return n.expressionIsScalar}}),Object.defineProperty(t,"expressionIsUngroupedAggregate",{enumerable:!0,get:function(){return n.expressionIsUngroupedAggregate}}),Object.defineProperty(t,"indent",{enumerable:!0,get:function(){return n.indent}}),Object.defineProperty(t,"composeSQLExpr",{enumerable:!0,get:function(){return n.composeSQLExpr}});var r=iD;Object.defineProperty(t,"MalloyTranslator",{enumerable:!0,get:function(){return r.MalloyTranslator}});var i=Oe;Object.defineProperty(t,"Model",{enumerable:!0,get:function(){return i.Model}}),Object.defineProperty(t,"Malloy",{enumerable:!0,get:function(){return i.Malloy}}),Object.defineProperty(t,"Runtime",{enumerable:!0,get:function(){return i.Runtime}}),Object.defineProperty(t,"AtomicFieldType",{enumerable:!0,get:function(){return i.AtomicFieldType}}),Object.defineProperty(t,"ConnectionRuntime",{enumerable:!0,get:function(){return i.ConnectionRuntime}}),Object.defineProperty(t,"SingleConnectionRuntime",{enumerable:!0,get:function(){return i.SingleConnectionRuntime}}),Object.defineProperty(t,"EmptyURLReader",{enumerable:!0,get:function(){return i.EmptyURLReader}}),Object.defineProperty(t,"InMemoryURLReader",{enumerable:!0,get:function(){return i.InMemoryURLReader}}),Object.defineProperty(t,"FixedConnectionMap",{enumerable:!0,get:function(){return i.FixedConnectionMap}}),Object.defineProperty(t,"MalloyError",{enumerable:!0,get:function(){return i.MalloyError}}),Object.defineProperty(t,"JoinRelationship",{enumerable:!0,get:function(){return i.JoinRelationship}}),Object.defineProperty(t,"SourceRelationship",{enumerable:!0,get:function(){return i.SourceRelationship}}),Object.defineProperty(t,"DateTimeframe",{enumerable:!0,get:function(){return i.DateTimeframe}}),Object.defineProperty(t,"TimestampTimeframe",{enumerable:!0,get:function(){return i.TimestampTimeframe}}),Object.defineProperty(t,"PreparedResult",{enumerable:!0,get:function(){return i.PreparedResult}}),Object.defineProperty(t,"Result",{enumerable:!0,get:function(){return i.Result}}),Object.defineProperty(t,"QueryMaterializer",{enumerable:!0,get:function(){return i.QueryMaterializer}}),Object.defineProperty(t,"CSVWriter",{enumerable:!0,get:function(){return i.CSVWriter}}),Object.defineProperty(t,"JSONWriter",{enumerable:!0,get:function(){return i.JSONWriter}}),Object.defineProperty(t,"Parse",{enumerable:!0,get:function(){return i.Parse}}),Object.defineProperty(t,"DataWriter",{enumerable:!0,get:function(){return i.DataWriter}}),Object.defineProperty(t,"Explore",{enumerable:!0,get:function(){return i.Explore}}),Object.defineProperty(t,"InMemoryModelCache",{enumerable:!0,get:function(){return i.InMemoryModelCache}}),Object.defineProperty(t,"CacheManager",{enumerable:!0,get:function(){return i.CacheManager}});var s=w_;Object.defineProperty(t,"toAsyncGenerator",{enumerable:!0,get:function(){return s.toAsyncGenerator}});var o=L_;Object.defineProperty(t,"modelDefToModelInfo",{enumerable:!0,get:function(){return o.modelDefToModelInfo}});var u=ss;Object.defineProperty(t,"annotationToTag",{enumerable:!0,get:function(){return u.annotationToTag}}),Object.defineProperty(t,"annotationToTaglines",{enumerable:!0,get:function(){return u.annotationToTaglines}})})(Pt);function GDe(t,e,n,r){var i=-1,s=t==null?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}var WDe=GDe;function VDe(t){return function(e){return t==null?void 0:t[e]}}var YDe=VDe,KDe=YDe,JDe={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},XDe=KDe(JDe),ZDe=XDe,e7e=typeof T=="object"&&T&&T.Object===Object&&T,t7e=e7e,n7e=t7e,r7e=typeof self=="object"&&self&&self.Object===Object&&self,i7e=n7e||r7e||Function("return this")(),s7e=i7e,o7e=s7e,u7e=o7e.Symbol,d8=u7e;function a7e(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var l7e=a7e,c7e=Array.isArray,f7e=c7e,lV=d8,cV=Object.prototype,x7e=cV.hasOwnProperty,d7e=cV.toString,Yg=lV?lV.toStringTag:void 0;function h7e(t){var e=x7e.call(t,Yg),n=t[Yg];try{t[Yg]=void 0;var r=!0}catch{}var i=d7e.call(t);return r&&(e?t[Yg]=n:delete t[Yg]),i}var p7e=h7e,g7e=Object.prototype,m7e=g7e.toString;function y7e(t){return m7e.call(t)}var E7e=y7e,fV=d8,A7e=p7e,v7e=E7e,C7e="[object Null]",_7e="[object Undefined]",xV=fV?fV.toStringTag:void 0;function S7e(t){return t==null?t===void 0?_7e:C7e:xV&&xV in Object(t)?A7e(t):v7e(t)}var b7e=S7e;function T7e(t){return t!=null&&typeof t=="object"}var R7e=T7e,D7e=b7e,O7e=R7e,F7e="[object Symbol]";function N7e(t){return typeof t=="symbol"||O7e(t)&&D7e(t)==F7e}var w7e=N7e,dV=d8,L7e=l7e,I7e=f7e,B7e=w7e,$7e=1/0,hV=dV?dV.prototype:void 0,pV=hV?hV.toString:void 0;function gV(t){if(typeof t=="string")return t;if(I7e(t))return L7e(t,gV)+"";if(B7e(t))return pV?pV.call(t):"";var e=t+"";return e=="0"&&1/t==-$7e?"-0":e}var k7e=gV,P7e=k7e;function M7e(t){return t==null?"":P7e(t)}var h8=M7e,U7e=ZDe,j7e=h8,q7e=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,H7e="\\u0300-\\u036f",z7e="\\ufe20-\\ufe2f",Q7e="\\u20d0-\\u20ff",G7e=H7e+z7e+Q7e,W7e="["+G7e+"]",V7e=RegExp(W7e,"g");function Y7e(t){return t=j7e(t),t&&t.replace(q7e,U7e).replace(V7e,"")}var K7e=Y7e,J7e=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function X7e(t){return t.match(J7e)||[]}var Z7e=X7e,eOe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function tOe(t){return eOe.test(t)}var nOe=tOe,mV="\\ud800-\\udfff",rOe="\\u0300-\\u036f",iOe="\\ufe20-\\ufe2f",sOe="\\u20d0-\\u20ff",oOe=rOe+iOe+sOe,yV="\\u2700-\\u27bf",EV="a-z\\xdf-\\xf6\\xf8-\\xff",uOe="\\xac\\xb1\\xd7\\xf7",aOe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",lOe="\\u2000-\\u206f",cOe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",AV="A-Z\\xc0-\\xd6\\xd8-\\xde",fOe="\\ufe0e\\ufe0f",vV=uOe+aOe+lOe+cOe,CV="['’]",_V="["+vV+"]",xOe="["+oOe+"]",SV="\\d+",dOe="["+yV+"]",bV="["+EV+"]",TV="[^"+mV+vV+SV+yV+EV+AV+"]",hOe="\\ud83c[\\udffb-\\udfff]",pOe="(?:"+xOe+"|"+hOe+")",gOe="[^"+mV+"]",RV="(?:\\ud83c[\\udde6-\\uddff]){2}",DV="[\\ud800-\\udbff][\\udc00-\\udfff]",Ch="["+AV+"]",mOe="\\u200d",OV="(?:"+bV+"|"+TV+")",yOe="(?:"+Ch+"|"+TV+")",FV="(?:"+CV+"(?:d|ll|m|re|s|t|ve))?",NV="(?:"+CV+"(?:D|LL|M|RE|S|T|VE))?",wV=pOe+"?",LV="["+fOe+"]?",EOe="(?:"+mOe+"(?:"+[gOe,RV,DV].join("|")+")"+LV+wV+")*",AOe="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vOe="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",COe=LV+wV+EOe,_Oe="(?:"+[dOe,RV,DV].join("|")+")"+COe,SOe=RegExp([Ch+"?"+bV+"+"+FV+"(?="+[_V,Ch,"$"].join("|")+")",yOe+"+"+NV+"(?="+[_V,Ch+OV,"$"].join("|")+")",Ch+"?"+OV+"+"+FV,Ch+"+"+NV,vOe,AOe,SV,_Oe].join("|"),"g");function bOe(t){return t.match(SOe)||[]}var TOe=bOe,ROe=Z7e,DOe=nOe,OOe=h8,FOe=TOe;function NOe(t,e,n){return t=OOe(t),e=n?void 0:e,e===void 0?DOe(t)?FOe(t):ROe(t):t.match(e)||[]}var wOe=NOe,LOe=WDe,IOe=K7e,BOe=wOe,$Oe="['’]",kOe=RegExp($Oe,"g");function POe(t){return function(e){return LOe(BOe(IOe(e).replace(kOe,"")),t,"")}}var MOe=POe;function UOe(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}var jOe=UOe,qOe=jOe;function HOe(t,e,n){var r=t.length;return n=n===void 0?r:n,!e&&n>=r?t:qOe(t,e,n)}var zOe=HOe,QOe="\\ud800-\\udfff",GOe="\\u0300-\\u036f",WOe="\\ufe20-\\ufe2f",VOe="\\u20d0-\\u20ff",YOe=GOe+WOe+VOe,KOe="\\ufe0e\\ufe0f",JOe="\\u200d",XOe=RegExp("["+JOe+QOe+YOe+KOe+"]");function ZOe(t){return XOe.test(t)}var IV=ZOe;function e8e(t){return t.split("")}var t8e=e8e,BV="\\ud800-\\udfff",n8e="\\u0300-\\u036f",r8e="\\ufe20-\\ufe2f",i8e="\\u20d0-\\u20ff",s8e=n8e+r8e+i8e,o8e="\\ufe0e\\ufe0f",u8e="["+BV+"]",p8="["+s8e+"]",g8="\\ud83c[\\udffb-\\udfff]",a8e="(?:"+p8+"|"+g8+")",$V="[^"+BV+"]",kV="(?:\\ud83c[\\udde6-\\uddff]){2}",PV="[\\ud800-\\udbff][\\udc00-\\udfff]",l8e="\\u200d",MV=a8e+"?",UV="["+o8e+"]?",c8e="(?:"+l8e+"(?:"+[$V,kV,PV].join("|")+")"+UV+MV+")*",f8e=UV+MV+c8e,x8e="(?:"+[$V+p8+"?",p8,kV,PV,u8e].join("|")+")",d8e=RegExp(g8+"(?="+g8+")|"+x8e+f8e,"g");function h8e(t){return t.match(d8e)||[]}var p8e=h8e,g8e=t8e,m8e=IV,y8e=p8e;function E8e(t){return m8e(t)?y8e(t):g8e(t)}var A8e=E8e,v8e=zOe,C8e=IV,_8e=A8e,S8e=h8;function b8e(t){return function(e){e=S8e(e);var n=C8e(e)?_8e(e):void 0,r=n?n[0]:e.charAt(0),i=n?v8e(n,1).join(""):e.slice(1);return r[t]()+i}}var T8e=b8e,R8e=T8e,D8e=R8e("toUpperCase"),O8e=D8e,F8e=MOe,N8e=O8e,w8e=F8e(function(t,e,n){return t+(n?" ":"")+N8e(e)}),L8e=w8e;const I8e=ky(L8e);function ji(t,e,n=!1){if(t!==void 0)switch(t){case"ordinal":return{range:["#C2D5EE","#1A73E8"]};case"temporal":case"quantitative":return e?n?{range:["#6BA4EE","#EEA361"]}:{range:["#1A73E8","#E8710A"]}:{range:["#C2D5EE","#1A73E8"]};case"nominal":return n?{range:["#6BA4EE","#66CEDC","#EC72B8","#EEA361","#F9C85B","#AACD85","#B87CED","#ACB0B3"]}:{range:["#1A73E8","#12B5CB","#E52592","#E8710A","#F9AB00","#7CB342","#9334E6","#80868B"]}}}function on(t,e){return t.toString().padStart(e,"0")}function B_(t,e,n){e||(e=Pt.TimestampTimeframe.Second);let r=!1;switch(e){case Pt.TimestampTimeframe.Hour:case Pt.TimestampTimeframe.Minute:case Pt.TimestampTimeframe.Second:r=!0;break}const i=lt.fromJSDate(t,{zone:r&&n?n:"UTC"});switch(e){case Pt.TimestampTimeframe.Year:case Pt.DateTimeframe.Year:return`${on(i.year,4)}`;case Pt.TimestampTimeframe.Quarter:case Pt.DateTimeframe.Quarter:{const s=on(i.year,4),o=Math.floor(i.month/3)+1;return`${s}-Q${o}`}case Pt.TimestampTimeframe.Month:case Pt.DateTimeframe.Month:{const s=on(i.year,2),o=on(i.month,2);return`${s}-${o}`}case Pt.TimestampTimeframe.Week:case Pt.DateTimeframe.Week:{const s=on(i.year,2),o=on(i.month,2),u=on(i.day,2);return`WK${s}-${o}-${u}`}case Pt.DateTimeframe.Day:case Pt.TimestampTimeframe.Day:{const s=on(i.year,2),o=on(i.month,2),u=on(i.day,2);return`${s}-${o}-${u}`}case Pt.TimestampTimeframe.Hour:{const s=on(i.year,2),o=on(i.month,2),u=on(i.day,2),a=on(i.hour,2);return`${s}-${o}-${u} ${a}:00 for 1 hour`}case Pt.TimestampTimeframe.Minute:{const s=on(i.year,2),o=on(i.month,2),u=on(i.day,2),a=on(i.hour,2),l=on(i.minute,2);return`${s}-${o}-${u} ${a}:${l}`}case Pt.TimestampTimeframe.Second:{const s=on(i.year,2),o=on(i.month,2),u=on(i.day,2),a=on(i.hour,2),l=on(i.minute,2),c=on(i.second,2);return`${s}-${o}-${u} ${a}:${l}:${c}`}default:throw new Error("Unknown timeframe.")}}function B8e(t,e){const n=lt.fromJSDate(t,{zone:e??"UTC"});return new Date(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond)}let m8;const $8e=100;async function $_(){const t=Date.now();if(!(m8&&t<m8+$8e))return m8=t,new Promise(e=>{setTimeout(e,0)})}function Es(t,e){const n=t.createElement("span");return n.classList.add("error"),n.appendChild(t.createTextNode(typeof e=="string"?e:e.message)),n}function Kg(t){const e=t.createElement("span");return e.appendChild(t.createTextNode("∅")),e.classList.add("value-null"),e}function jV(t){const e=t.createElement("div");return e.classList.add("drill-icon"),e.innerHTML=`
1297
1297
  <style>
1298
1298
  .drill-icon:hover .copy-circle {
1299
1299
  fill: #eef7f9;